]> git.hungrycats.org Git - xscreensaver/commitdiff
http://se.aminet.net/pub/X11/ftp.x.org/contrib/applications/xlockmore-5.01.1.tar.gz xlockmore-5.01.1 github/xlockmore-5.01.1
authorZygo Blaxell <zblaxell@faye.furryterror.org>
Mon, 2 Mar 2009 00:28:51 +0000 (19:28 -0500)
committerZygo Blaxell <zblaxell@faye.furryterror.org>
Mon, 2 Mar 2009 00:28:51 +0000 (19:28 -0500)
-rw-r--r-- 1 zblaxell zblaxell 1696108 May 25  2001 xlockmore-5.01.1.tar.gz
2de3a3222c580982b7259a92aae465550bd7bd10  xlockmore-5.01.1.tar.gz

508 files changed:
Imakefile [new file with mode: 0644]
Makefile.in [new file with mode: 0644]
README [new file with mode: 0644]
bitmaps/bad.xbm [new file with mode: 0644]
bitmaps/bat-0.xbm [new file with mode: 0644]
bitmaps/bat-1.xbm [new file with mode: 0644]
bitmaps/bat-2.xbm [new file with mode: 0644]
bitmaps/bat-3.xbm [new file with mode: 0644]
bitmaps/bat-4.xbm [new file with mode: 0644]
bitmaps/bounce-0.xbm [new file with mode: 0644]
bitmaps/bounce-1.xbm [new file with mode: 0644]
bitmaps/bounce-2.xbm [new file with mode: 0644]
bitmaps/bounce-3.xbm [new file with mode: 0644]
bitmaps/bounce-mask.xbm [new file with mode: 0644]
bitmaps/cooperat.xbm [new file with mode: 0644]
bitmaps/cross_weave.xbm [new file with mode: 0644]
bitmaps/defect.xbm [new file with mode: 0644]
bitmaps/dimple1.xbm [new file with mode: 0644]
bitmaps/dimple3.xbm [new file with mode: 0644]
bitmaps/donkey.xbm [new file with mode: 0644]
bitmaps/earth.xbm [new file with mode: 0644]
bitmaps/elephant.xbm [new file with mode: 0644]
bitmaps/enterprise-2.xbm [new file with mode: 0644]
bitmaps/enterprise-3.xbm [new file with mode: 0644]
bitmaps/enterprise-5.xbm [new file with mode: 0644]
bitmaps/enterprise-6.xbm [new file with mode: 0644]
bitmaps/fish-0.xbm [new file with mode: 0644]
bitmaps/fish-1.xbm [new file with mode: 0644]
bitmaps/fish-2.xbm [new file with mode: 0644]
bitmaps/fish-3.xbm [new file with mode: 0644]
bitmaps/fish-4.xbm [new file with mode: 0644]
bitmaps/fish-5.xbm [new file with mode: 0644]
bitmaps/fish-6.xbm [new file with mode: 0644]
bitmaps/fish-7.xbm [new file with mode: 0644]
bitmaps/flipped_gray.xbm [new file with mode: 0644]
bitmaps/good.xbm [new file with mode: 0644]
bitmaps/gray1.xbm [new file with mode: 0644]
bitmaps/gray3.xbm [new file with mode: 0644]
bitmaps/hlines2.xbm [new file with mode: 0644]
bitmaps/l-bob.xbm [new file with mode: 0644]
bitmaps/l-bsd.xbm [new file with mode: 0644]
bitmaps/l-dec.xbm [new file with mode: 0644]
bitmaps/l-hp.xbm [new file with mode: 0644]
bitmaps/l-ibm.xbm [new file with mode: 0644]
bitmaps/l-linux.xbm [new file with mode: 0644]
bitmaps/l-linux1.xbm [new file with mode: 0644]
bitmaps/l-mot.xbm [new file with mode: 0644]
bitmaps/l-sco.xbm [new file with mode: 0644]
bitmaps/l-sgi.xbm [new file with mode: 0644]
bitmaps/l-sun.xbm [new file with mode: 0644]
bitmaps/l-x11.xbm [new file with mode: 0644]
bitmaps/l-xlock.xbm [new file with mode: 0644]
bitmaps/light_gray.xbm [new file with mode: 0644]
bitmaps/m-bob.xbm [new file with mode: 0644]
bitmaps/m-bsd.xbm [new file with mode: 0644]
bitmaps/m-dec.xbm [new file with mode: 0644]
bitmaps/m-ghost.xbm [new file with mode: 0644]
bitmaps/m-grelb-2.xbm [new file with mode: 0644]
bitmaps/m-grelb.xbm [new file with mode: 0644]
bitmaps/m-hp.xbm [new file with mode: 0644]
bitmaps/m-ibm.xbm [new file with mode: 0644]
bitmaps/m-linux.xbm [new file with mode: 0644]
bitmaps/m-linux1.xbm [new file with mode: 0644]
bitmaps/m-mot.xbm [new file with mode: 0644]
bitmaps/m-sco.xbm [new file with mode: 0644]
bitmaps/m-sgi.xbm [new file with mode: 0644]
bitmaps/m-sun.xbm [new file with mode: 0644]
bitmaps/m-x11.xbm [new file with mode: 0644]
bitmaps/m-xlock.xbm [new file with mode: 0644]
bitmaps/mailempty.xbm [new file with mode: 0644]
bitmaps/mailfull.xbm [new file with mode: 0644]
bitmaps/nose-faced.xbm [new file with mode: 0644]
bitmaps/nose-facef.xbm [new file with mode: 0644]
bitmaps/nose-facel.xbm [new file with mode: 0644]
bitmaps/nose-facer.xbm [new file with mode: 0644]
bitmaps/nose-hat.xbm [new file with mode: 0644]
bitmaps/nose-hatd.xbm [new file with mode: 0644]
bitmaps/nose-shoef.xbm [new file with mode: 0644]
bitmaps/nose-shoel.xbm [new file with mode: 0644]
bitmaps/nose-shoer.xbm [new file with mode: 0644]
bitmaps/nose-stepl.xbm [new file with mode: 0644]
bitmaps/nose-stepr.xbm [new file with mode: 0644]
bitmaps/root_weave.xbm [new file with mode: 0644]
bitmaps/s-bsd.xbm [new file with mode: 0644]
bitmaps/s-dec.xbm [new file with mode: 0644]
bitmaps/s-grelb-2.xbm [new file with mode: 0644]
bitmaps/s-grelb.xbm [new file with mode: 0644]
bitmaps/s-hp.xbm [new file with mode: 0644]
bitmaps/s-ibm.xbm [new file with mode: 0644]
bitmaps/s-linux.xbm [new file with mode: 0644]
bitmaps/s-linux1.xbm [new file with mode: 0644]
bitmaps/s-mot.xbm [new file with mode: 0644]
bitmaps/s-osf.xbm [new file with mode: 0644]
bitmaps/s-sco.xbm [new file with mode: 0644]
bitmaps/s-sgi.xbm [new file with mode: 0644]
bitmaps/s-sun.xbm [new file with mode: 0644]
bitmaps/s-x11.xbm [new file with mode: 0644]
bitmaps/shark-0.xbm [new file with mode: 0644]
bitmaps/shark-1.xbm [new file with mode: 0644]
bitmaps/shark-2.xbm [new file with mode: 0644]
bitmaps/shark-3.xbm [new file with mode: 0644]
bitmaps/shark-4.xbm [new file with mode: 0644]
bitmaps/shark-5.xbm [new file with mode: 0644]
bitmaps/shark-6.xbm [new file with mode: 0644]
bitmaps/shark-7.xbm [new file with mode: 0644]
bitmaps/sickle.xbm [new file with mode: 0644]
bitmaps/stipple.xbm [new file with mode: 0644]
bitmaps/t-smilie.xbm [new file with mode: 0644]
bitmaps/t-x11.xbm [new file with mode: 0644]
bitmaps/terra-00.xbm [new file with mode: 0644]
bitmaps/terra-01.xbm [new file with mode: 0644]
bitmaps/terra-02.xbm [new file with mode: 0644]
bitmaps/terra-03.xbm [new file with mode: 0644]
bitmaps/terra-04.xbm [new file with mode: 0644]
bitmaps/terra-05.xbm [new file with mode: 0644]
bitmaps/terra-06.xbm [new file with mode: 0644]
bitmaps/terra-07.xbm [new file with mode: 0644]
bitmaps/terra-08.xbm [new file with mode: 0644]
bitmaps/terra-09.xbm [new file with mode: 0644]
bitmaps/terra-10.xbm [new file with mode: 0644]
bitmaps/terra-11.xbm [new file with mode: 0644]
bitmaps/terra-12.xbm [new file with mode: 0644]
bitmaps/terra-13.xbm [new file with mode: 0644]
bitmaps/terra-14.xbm [new file with mode: 0644]
bitmaps/terra-15.xbm [new file with mode: 0644]
bitmaps/terra-16.xbm [new file with mode: 0644]
bitmaps/terra-17.xbm [new file with mode: 0644]
bitmaps/terra-18.xbm [new file with mode: 0644]
bitmaps/terra-19.xbm [new file with mode: 0644]
bitmaps/terra-20.xbm [new file with mode: 0644]
bitmaps/terra-21.xbm [new file with mode: 0644]
bitmaps/terra-22.xbm [new file with mode: 0644]
bitmaps/terra-23.xbm [new file with mode: 0644]
bitmaps/terra-24.xbm [new file with mode: 0644]
bitmaps/terra-25.xbm [new file with mode: 0644]
bitmaps/terra-26.xbm [new file with mode: 0644]
bitmaps/terra-27.xbm [new file with mode: 0644]
bitmaps/terra-28.xbm [new file with mode: 0644]
bitmaps/terra-29.xbm [new file with mode: 0644]
bitmaps/vlines2.xbm [new file with mode: 0644]
bitmaps/vlines3.xbm [new file with mode: 0644]
config.guess [new file with mode: 0755]
config.h.in [new file with mode: 0644]
config.sub [new file with mode: 0755]
configure [new file with mode: 0755]
configure.in [new file with mode: 0644]
configure.tcl [new file with mode: 0755]
docs/3d.howto [new file with mode: 0644]
docs/HACKERS.GUIDE [new file with mode: 0644]
docs/HACKERS.GUIDE.fr [new file with mode: 0644]
docs/Purify [new file with mode: 0644]
docs/Purify.sunos4 [new file with mode: 0644]
docs/Purify.sunos5 [new file with mode: 0644]
docs/Revisions [new file with mode: 0644]
docs/TODO [new file with mode: 0644]
docs/cell_automata [new file with mode: 0644]
docs/xlock.hlp [new file with mode: 0644]
docs/xlock.html [new file with mode: 0644]
etc/README.etc [new file with mode: 0644]
etc/chkmbox/Mail.xpm [new file with mode: 0644]
etc/chkmbox/Makefile [new file with mode: 0644]
etc/chkmbox/NoMail.xpm [new file with mode: 0644]
etc/chkmbox/chkmbox.c [new file with mode: 0644]
etc/chkmbox/chkmbox.cfg [new file with mode: 0644]
etc/chkmbox/imapsocket.c [new file with mode: 0644]
etc/chkmbox/imapsocket.h [new file with mode: 0644]
etc/descrip.mms [new file with mode: 0644]
etc/dtprofile [new file with mode: 0644]
etc/dtscreen.dt [new file with mode: 0644]
etc/ext.life [new file with mode: 0644]
etc/fortune.dat [new file with mode: 0644]
etc/genlauncher/Makefile [new file with mode: 0644]
etc/genlauncher/README.gui [new file with mode: 0644]
etc/genlauncher/etc.xlock.java [new file with mode: 0644]
etc/genlauncher/etc.xlock.tcl [new file with mode: 0644]
etc/genlauncher/guibuild.pl [new file with mode: 0755]
etc/genlauncher/lmode.h [new file with mode: 0644]
etc/genlauncher/xglock.modes.tpl [new file with mode: 0644]
etc/genlauncher/xlockgen.lex [new file with mode: 0644]
etc/genlauncher/xmlock.modes.tpl [new file with mode: 0644]
etc/gif/README [new file with mode: 0644]
etc/gif/deflag.gif [new file with mode: 0644]
etc/gif/frflag.gif [new file with mode: 0644]
etc/gif/jpflag.gif [new file with mode: 0644]
etc/gif/nlflag.gif [new file with mode: 0644]
etc/gif/ukflag.gif [new file with mode: 0644]
etc/glider.3dlife [new file with mode: 0644]
etc/glider.hlife [new file with mode: 0644]
etc/glider.life [new file with mode: 0644]
etc/play.sh [new file with mode: 0755]
etc/rplay.conf [new file with mode: 0644]
etc/rplay.hosts [new file with mode: 0644]
etc/rplay.servers [new file with mode: 0644]
etc/showmodes.sh [new file with mode: 0755]
etc/system.fvwm2rc.xlock [new file with mode: 0644]
etc/system.fvwmrc.xlock [new file with mode: 0644]
etc/system.mwmrc.xlock [new file with mode: 0644]
etc/system.olwmrc.xlock [new file with mode: 0644]
etc/system.wmrc.xlock [new file with mode: 0644]
etc/vtswitch.c [new file with mode: 0644]
etc/xlock.java [new file with mode: 0644]
etc/xlock.sh [new file with mode: 0755]
etc/xlock.staff [new file with mode: 0644]
etc/xlock.tcl [new file with mode: 0755]
etc/xlock1.sh [new file with mode: 0644]
etc/xlockFrame.java [new file with mode: 0644]
etc/xlockhexlife.pl [new file with mode: 0755]
etc/xlocklife.pl [new file with mode: 0755]
etc/xlockranddur.pl [new file with mode: 0755]
etc/xlockrandimage.pl [new file with mode: 0755]
etc/xlocksat.pl [new file with mode: 0755]
etc/xtermlock.sh [new file with mode: 0755]
etc/xwinlock.sh [new file with mode: 0755]
gettext.tcl [new file with mode: 0755]
iconfig.h [new file with mode: 0644]
install-sh [new file with mode: 0755]
language.ja.tcl [new file with mode: 0755]
language.tcl.tmpl [new file with mode: 0644]
make.com [new file with mode: 0644]
mkinstalldirs [new file with mode: 0755]
mmov.com [new file with mode: 0644]
modes/Imakefile [new file with mode: 0644]
modes/Makefile.in [new file with mode: 0644]
modes/Makefile.inxs [new file with mode: 0644]
modes/ant.c [new file with mode: 0644]
modes/ball.c [new file with mode: 0644]
modes/bat.c [new file with mode: 0644]
modes/blank.c [new file with mode: 0644]
modes/blot.c [new file with mode: 0644]
modes/bomb.c [new file with mode: 0644]
modes/bouboule.c [new file with mode: 0644]
modes/bounce.c [new file with mode: 0644]
modes/braid.c [new file with mode: 0644]
modes/bubble.c [new file with mode: 0644]
modes/bug.c [new file with mode: 0644]
modes/clock.c [new file with mode: 0644]
modes/coral.c [new file with mode: 0644]
modes/crystal.c [new file with mode: 0644]
modes/daisy.c [new file with mode: 0644]
modes/dclock-msg-jp.h [new file with mode: 0644]
modes/dclock.c [new file with mode: 0644]
modes/decay.c [new file with mode: 0644]
modes/deco.c [new file with mode: 0644]
modes/demon.c [new file with mode: 0644]
modes/dilemma.c [new file with mode: 0644]
modes/discrete.c [new file with mode: 0644]
modes/dragon.c [new file with mode: 0644]
modes/drift.c [new file with mode: 0644]
modes/euler2d.c [new file with mode: 0644]
modes/euler2d.tex [new file with mode: 0644]
modes/eyes.c [new file with mode: 0644]
modes/fadeplot.c [new file with mode: 0644]
modes/flag.c [new file with mode: 0644]
modes/flame.c [new file with mode: 0644]
modes/flow.c [new file with mode: 0644]
modes/forest.c [new file with mode: 0644]
modes/galaxy.c [new file with mode: 0644]
modes/glx/Imakefile [new file with mode: 0644]
modes/glx/Makefile.in [new file with mode: 0644]
modes/glx/atlantis.c [new file with mode: 0644]
modes/glx/atlantis.h [new file with mode: 0644]
modes/glx/b_draw.c [new file with mode: 0644]
modes/glx/b_lockglue.c [new file with mode: 0644]
modes/glx/b_sphere.c [new file with mode: 0644]
modes/glx/bubble3d.c [new file with mode: 0644]
modes/glx/bubble3d.h [new file with mode: 0644]
modes/glx/buildlwo.c [new file with mode: 0644]
modes/glx/buildlwo.h [new file with mode: 0644]
modes/glx/cage.c [new file with mode: 0644]
modes/glx/dolphin.c [new file with mode: 0644]
modes/glx/e_textures.h [new file with mode: 0644]
modes/glx/fire.c [new file with mode: 0644]
modes/glx/gears.c [new file with mode: 0644]
modes/glx/glplanet.c [new file with mode: 0644]
modes/glx/i_evert.h [new file with mode: 0644]
modes/glx/i_figureeight.cc [new file with mode: 0644]
modes/glx/i_figureeight.h [new file with mode: 0644]
modes/glx/i_linkage.cc [new file with mode: 0644]
modes/glx/i_linkage.h [new file with mode: 0644]
modes/glx/i_sphere.cc [new file with mode: 0644]
modes/glx/i_sphere.h [new file with mode: 0644]
modes/glx/i_spline.cc [new file with mode: 0644]
modes/glx/i_spline.h [new file with mode: 0644]
modes/glx/i_threejet.cc [new file with mode: 0644]
modes/glx/i_threejet.h [new file with mode: 0644]
modes/glx/i_threejetvec.cc [new file with mode: 0644]
modes/glx/i_threejetvec.h [new file with mode: 0644]
modes/glx/i_twojet.cc [new file with mode: 0644]
modes/glx/i_twojet.h [new file with mode: 0644]
modes/glx/i_twojetvec.cc [new file with mode: 0644]
modes/glx/i_twojetvec.h [new file with mode: 0644]
modes/glx/invert.c [new file with mode: 0644]
modes/glx/lament.c [new file with mode: 0644]
modes/glx/moebius.c [new file with mode: 0644]
modes/glx/molecule.c [new file with mode: 0644]
modes/glx/molecules.h [new file with mode: 0644]
modes/glx/morph3d.c [new file with mode: 0644]
modes/glx/pipeobjs.c [new file with mode: 0644]
modes/glx/pipes.c [new file with mode: 0644]
modes/glx/rubik.c [new file with mode: 0644]
modes/glx/s1_1.c [new file with mode: 0644]
modes/glx/s1_2.c [new file with mode: 0644]
modes/glx/s1_3.c [new file with mode: 0644]
modes/glx/s1_4.c [new file with mode: 0644]
modes/glx/s1_5.c [new file with mode: 0644]
modes/glx/s1_6.c [new file with mode: 0644]
modes/glx/s1_b.c [new file with mode: 0644]
modes/glx/sballs.c [new file with mode: 0644]
modes/glx/shark.c [new file with mode: 0644]
modes/glx/sierpinski3d.c [new file with mode: 0644]
modes/glx/skewb.c [new file with mode: 0644]
modes/glx/sphere.c [new file with mode: 0644]
modes/glx/sphere.h [new file with mode: 0644]
modes/glx/sproingies.c [new file with mode: 0644]
modes/glx/sproingiewrap.c [new file with mode: 0644]
modes/glx/stairs.c [new file with mode: 0644]
modes/glx/superquadrics.c [new file with mode: 0644]
modes/glx/swim.c [new file with mode: 0644]
modes/glx/text3d.cc [new file with mode: 0644]
modes/glx/text3d.h [new file with mode: 0644]
modes/glx/tube.c [new file with mode: 0644]
modes/glx/tube.h [new file with mode: 0644]
modes/glx/whale.c [new file with mode: 0644]
modes/glx/xpm-ximage.c [new file with mode: 0644]
modes/glx/xpm-ximage.h [new file with mode: 0644]
modes/goop.c [new file with mode: 0644]
modes/grav.c [new file with mode: 0644]
modes/helix.c [new file with mode: 0644]
modes/hop.c [new file with mode: 0644]
modes/hyper.c [new file with mode: 0644]
modes/ico.c [new file with mode: 0644]
modes/ifs.c [new file with mode: 0644]
modes/image.c [new file with mode: 0644]
modes/juggle.c [new file with mode: 0644]
modes/julia.c [new file with mode: 0644]
modes/kaleid.c [new file with mode: 0644]
modes/kumppa.c [new file with mode: 0644]
modes/laser.c [new file with mode: 0644]
modes/life.c [new file with mode: 0644]
modes/life1d.c [new file with mode: 0644]
modes/life3d.c [new file with mode: 0644]
modes/lightning.c [new file with mode: 0644]
modes/lisa.c [new file with mode: 0644]
modes/lissie.c [new file with mode: 0644]
modes/loop.c [new file with mode: 0644]
modes/lyapunov.c [new file with mode: 0644]
modes/mandelbrot.c [new file with mode: 0644]
modes/marquee.c [new file with mode: 0644]
modes/matrix.c [new file with mode: 0644]
modes/maze.c [new file with mode: 0644]
modes/mountain.c [new file with mode: 0644]
modes/munch.c [new file with mode: 0644]
modes/nose.c [new file with mode: 0644]
modes/pacman.c [new file with mode: 0644]
modes/penrose.c [new file with mode: 0644]
modes/petal.c [new file with mode: 0644]
modes/polyominoes.c [new file with mode: 0644]
modes/puzzle.c [new file with mode: 0644]
modes/pyro.c [new file with mode: 0644]
modes/qix.c [new file with mode: 0644]
modes/random.c [new file with mode: 0644]
modes/roll.c [new file with mode: 0644]
modes/rotor.c [new file with mode: 0644]
modes/run.c [new file with mode: 0644]
modes/scooter.c [new file with mode: 0644]
modes/shape.c [new file with mode: 0644]
modes/sierpinski.c [new file with mode: 0644]
modes/slip.c [new file with mode: 0644]
modes/solitare.cc [new file with mode: 0644]
modes/space.c [new file with mode: 0644]
modes/sphere.c [new file with mode: 0644]
modes/spiral.c [new file with mode: 0644]
modes/spline.c [new file with mode: 0644]
modes/star.c [new file with mode: 0644]
modes/starfish.c [new file with mode: 0644]
modes/strange.c [new file with mode: 0644]
modes/swarm.c [new file with mode: 0644]
modes/swirl.c [new file with mode: 0644]
modes/t3d.c [new file with mode: 0644]
modes/tetris.c [new file with mode: 0644]
modes/thornbird.c [new file with mode: 0644]
modes/tik_tak.c [new file with mode: 0644]
modes/triangle.c [new file with mode: 0644]
modes/tube.c [new file with mode: 0644]
modes/turtle.c [new file with mode: 0644]
modes/vines.c [new file with mode: 0644]
modes/voters.c [new file with mode: 0644]
modes/wator.c [new file with mode: 0644]
modes/wire.c [new file with mode: 0644]
modes/world.c [new file with mode: 0644]
modes/worm.c [new file with mode: 0644]
modes/xcl.c [new file with mode: 0644]
modes/xcl.h [new file with mode: 0644]
modes/xjack.c [new file with mode: 0644]
pixmaps/back.xpm [new file with mode: 0644]
pixmaps/bat-0.xpm [new file with mode: 0644]
pixmaps/bat-1.xpm [new file with mode: 0644]
pixmaps/bat-2.xpm [new file with mode: 0644]
pixmaps/bat-3.xpm [new file with mode: 0644]
pixmaps/bat-4.xpm [new file with mode: 0644]
pixmaps/face.xpm [new file with mode: 0644]
pixmaps/ground.xpm [new file with mode: 0644]
pixmaps/l-bob.xpm [new file with mode: 0644]
pixmaps/l-bsd.xpm [new file with mode: 0644]
pixmaps/l-hp.xpm [new file with mode: 0644]
pixmaps/l-irix.xpm [new file with mode: 0644]
pixmaps/l-lin.xpm [new file with mode: 0644]
pixmaps/l-linux.xpm [new file with mode: 0644]
pixmaps/l-sgi.xpm [new file with mode: 0644]
pixmaps/l-sol.xpm [new file with mode: 0644]
pixmaps/l-xlock.xpm [new file with mode: 0644]
pixmaps/lament.xpm [new file with mode: 0644]
pixmaps/m-axp.xpm [new file with mode: 0644]
pixmaps/m-blank.xpm [new file with mode: 0644]
pixmaps/m-bsd.xpm [new file with mode: 0644]
pixmaps/m-dec.xpm [new file with mode: 0644]
pixmaps/m-hp.xpm [new file with mode: 0644]
pixmaps/m-ibm.xpm [new file with mode: 0644]
pixmaps/m-linux.xpm [new file with mode: 0644]
pixmaps/m-linux1.xpm [new file with mode: 0644]
pixmaps/m-sco.xpm [new file with mode: 0644]
pixmaps/m-sgi.xpm [new file with mode: 0644]
pixmaps/m-sol.xpm [new file with mode: 0644]
pixmaps/m-solaris.xpm [new file with mode: 0644]
pixmaps/m-sun.xpm [new file with mode: 0644]
pixmaps/m-x11.xpm [new file with mode: 0644]
pixmaps/m-xlock.xpm [new file with mode: 0644]
pixmaps/s-grelb-2.xpm [new file with mode: 0644]
pixmaps/s-grelb.xpm [new file with mode: 0644]
pixmaps/sea-texture.xpm [new file with mode: 0644]
pixmaps/tree.xpm [new file with mode: 0644]
sounds/complete.au [new file with mode: 0644]
sounds/identify-please.au [new file with mode: 0644]
sounds/not-programmed.au [new file with mode: 0644]
sounds/thank-you.au [new file with mode: 0644]
tclIndex [new file with mode: 0644]
xglock/Makefile.in [new file with mode: 0644]
xglock/README.xglock [new file with mode: 0644]
xglock/logo.h [new file with mode: 0644]
xglock/modes.h [new file with mode: 0644]
xglock/xglock.c [new file with mode: 0644]
xglock/xglockrc [new file with mode: 0644]
xlock/Imakefile [new file with mode: 0644]
xlock/Makefile.in [new file with mode: 0644]
xlock/Makefile.inxs [new file with mode: 0644]
xlock/XLock-jp.ad [new file with mode: 0644]
xlock/XLock.ad [new file with mode: 0644]
xlock/automata.c [new file with mode: 0644]
xlock/automata.h [new file with mode: 0644]
xlock/color.c [new file with mode: 0644]
xlock/color.h [new file with mode: 0644]
xlock/erase.c [new file with mode: 0644]
xlock/erase.h [new file with mode: 0644]
xlock/erase_debug.h [new file with mode: 0644]
xlock/erase_init.h [new file with mode: 0644]
xlock/iostuff.c [new file with mode: 0644]
xlock/iostuff.h [new file with mode: 0644]
xlock/logout.c [new file with mode: 0644]
xlock/magick.c [new file with mode: 0644]
xlock/magick.h [new file with mode: 0644]
xlock/memcheck.c [new file with mode: 0644]
xlock/mode.c [new file with mode: 0644]
xlock/mode.h [new file with mode: 0644]
xlock/parsecmd.c [new file with mode: 0644]
xlock/passwd.c [new file with mode: 0644]
xlock/passwd.h [new file with mode: 0644]
xlock/random.c [new file with mode: 0644]
xlock/random.h [new file with mode: 0644]
xlock/ras.c [new file with mode: 0644]
xlock/ras.h [new file with mode: 0644]
xlock/resource-msg-jp.h [new file with mode: 0644]
xlock/resource.c [new file with mode: 0644]
xlock/sound.c [new file with mode: 0644]
xlock/spline.c [new file with mode: 0644]
xlock/spline.h [new file with mode: 0644]
xlock/util.c [new file with mode: 0644]
xlock/util.h [new file with mode: 0644]
xlock/version.h [new file with mode: 0644]
xlock/vis.c [new file with mode: 0644]
xlock/vis.h [new file with mode: 0644]
xlock/visgl.c [new file with mode: 0644]
xlock/visgl.h [new file with mode: 0644]
xlock/vms_amd.c [new file with mode: 0644]
xlock/vms_amd.h [new file with mode: 0644]
xlock/vms_mmov.c [new file with mode: 0644]
xlock/vms_x_fix.h [new file with mode: 0644]
xlock/vroot.h [new file with mode: 0644]
xlock/vtlock.c [new file with mode: 0644]
xlock/vtlock_proc.c [new file with mode: 0644]
xlock/xbm.c [new file with mode: 0644]
xlock/xlock-msg-jp.h [new file with mode: 0644]
xlock/xlock.c [new file with mode: 0644]
xlock/xlock.h [new file with mode: 0644]
xlock/xlock.man [new file with mode: 0644]
xlock/xlockimage.c [new file with mode: 0644]
xlock/xlockimage.h [new file with mode: 0644]
xmlock/Imakefile [new file with mode: 0644]
xmlock/Makefile.in [new file with mode: 0644]
xmlock/XmLock-jp.ad [new file with mode: 0644]
xmlock/XmLock.ad [new file with mode: 0644]
xmlock/menu.h [new file with mode: 0644]
xmlock/modes.h [new file with mode: 0644]
xmlock/option.c [new file with mode: 0644]
xmlock/option.h [new file with mode: 0644]
xmlock/xmlock.c [new file with mode: 0644]
xscreensaver/Makefile.in [new file with mode: 0644]
xscreensaver/README [new file with mode: 0644]
xscreensaver/configure.in [new file with mode: 0644]

diff --git a/Imakefile b/Imakefile
new file mode 100644 (file)
index 0000000..4881455
--- /dev/null
+++ b/Imakefile
@@ -0,0 +1,68 @@
+#ifndef XCOMM
+#define XCOMM /**/#
+#endif
+XCOMM @(#)Imakefile    5.01 2001/01/26 xlockmore
+XCOMM Many "ideas" taken from xscreensaver-1.34 by Jamie Zawinski.
+XCOMM
+
+VER = xlockmore
+DISTVER = xlockmore-5.01
+
+SUBDIRS = xlock modes/glx modes xmlock
+
+XCOMM CXX=g++
+XCOMM CXX=CC
+
+MAKE_SUBDIR = for dir in $(SUBDIRS) ; do ( cd $$dir ; $(MAKE) $@ \
+CC="$(CC)" CXX="$(CXX)" CCOPTIONS="$(CCOPTIONS)" CDEBUGFLAGS="$(CDEBUGFLAGS)" \
+BINDIR="$(BINDIR)" XAPPLOADDIR="$(XAPPLOADDIR)") ; done
+
+SUB_MAKEFILES = xlock/Makefile modes/glx/Makefile modes/Makefile xmlock/Makefile
+
+all::
+       @echo ""                  ; \
+       echo "        ==========================================================" ; \
+       echo ""                   ; \
+       echo "        Did you read and edit iconfig.h? " ; \
+       echo "           Otherwise it will assume a minimum configuration." ; \
+       echo "        Run \"make depend\" if you can not find \"decay.xbm\"." ; \
+       echo ""                   ; \
+       echo "        ==========================================================" ; \
+       echo ""
+
+
+all:: $(SUB_MAKEFILES)
+       @$(MAKE_SUBDIR)
+
+install:: all
+       @$(MAKE_SUBDIR)
+
+install.man:: all
+       @$(MAKE_SUBDIR)
+
+install.ad:: all
+       @$(MAKE_SUBDIR)
+
+clean::
+       @$(MAKE_SUBDIR)
+
+depend::
+       @$(MAKE_SUBDIR)
+
+distclean : clean
+       @$(MAKE_SUBDIR)
+       -rm -f Makefile config.status config.cache config.log config.h
+
+Makefiles:: $(SUB_MAKEFILES)
+
+xlock/Makefile : Imakefile iconfig.h
+       cd xlock  ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/xlock
+
+modes/glx/Makefile : modes/glx/Imakefile iconfig.h
+       cd modes/glx ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/modes/glx
+
+modes/Makefile : modes/Imakefile iconfig.h
+       cd modes  ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/modes
+
+xmlock/Makefile : xmlock/Imakefile iconfig.h
+       cd xmlock  ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/xmlock
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..3e104b6
--- /dev/null
@@ -0,0 +1,126 @@
+############################################################
+#
+# $Id : Makefile.in 4.16 2000/01/17 $
+#
+# xlockmore Makefile.in for autoconf (UNIX/VMS X11 support)
+############################################################
+
+SUBDIRS = xlock modes/glx modes xmlock xglock
+
+MAKE_SUBDIR = for dir in $(SUBDIRS) ; do ( cd $$dir ; $(MAKE) $@ ) ; done
+# convenient not to use configure just to clean
+MAKEIN_SUBDIR = for dir in $(SUBDIRS) ; do ( cd $$dir ; sed s/@MODULES@/\#/ Makefile.in > Makefile ; $(MAKE) $@ ) ; done
+
+all :
+       @$(MAKE_SUBDIR)
+
+# this tells GNU make not to export variables into the environment
+# But other makes do not understand its significance, so it must
+# not be the first target in the file. So it is here, before
+# any variables are created, but after the default target
+.NOEXPORT :
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@/
+
+TAR = tar
+RM = rm -f
+
+VER = xlockmore
+DISTVER = xlockmore-4.13
+
+install :
+       @$(MAKE_SUBDIR)
+
+install-program :
+       @$(MAKE_SUBDIR)
+
+install-man :
+       @$(MAKE_SUBDIR)
+
+install-ad :
+       @$(MAKE_SUBDIR)
+
+uninstall :
+       @$(MAKE_SUBDIR)
+
+uninstall-program :
+       @$(MAKE_SUBDIR)
+
+uninstall-man :
+       @$(MAKE_SUBDIR)
+
+install.program : install-program
+
+install.man : install-man
+
+install.ad : install-ad
+
+uninstall.program : uninstall-program
+
+uninstall.man : uninstall-man
+
+uninstall.ad : uninstall-ad
+
+depend :
+       @$(MAKE_SUBDIR)
+
+distdepend :
+       @$(MAKE_SUBDIR)
+
+lint :
+       @$(MAKE_SUBDIR)
+
+xrdb :
+       @$(MAKE_SUBDIR)
+
+man :
+       @$(MAKE_SUBDIR)
+
+html :
+       @$(MAKE_SUBDIR)
+
+hlp :
+       @$(MAKE_SUBDIR)
+
+clean :
+       $(RM) core *~ *% *.bak *.orig *.rej make.log MakeOut *.patch
+       @$(MAKE_SUBDIR)
+
+distclean :
+       $(RM) core *~ *% *.bak *.orig *.rej make.log MakeOut *.patch
+       $(RM) Makefile config.status config.cache config.log config.h
+       @$(MAKEIN_SUBDIR)
+
+Makefile : Makefile.in config.status
+       $(SHELL) config.status
+config.status : configure
+       $(SHELL) config.status --recheck
+#configure : configure.in
+# enable this rule if you want autoconf to be executed automatically when
+# configure.in is changed. This is commented out, since patching might give
+# configure.in a newer timestamp than configure and not everybody has autoconf
+#      cd $(srcdir); autoconf
+
+clean.all : distclean
+
+tar : distclean
+       cd .. ; $(TAR) cvf $(VER).tar $(VER)/*
+
+compress : tar
+       cd .. ; compress -f $(VER).tar
+
+gzip : tar
+       cd .. ; gzip -best -f $(VER).tar
+
+dist : gzip
+
+tgz : tar
+       cd .. ; gzip -best -c $(VER).tar > `echo $(VER) | cut -c1-8`.tgz ; \
+$(RM) $(VER).tar
+
+read :
+       more README
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..22e11a2
--- /dev/null
+++ b/README
@@ -0,0 +1,1027 @@
+xlockmore-5.01.1: the maintained version of xlock
+see docs/Revisions for more version stuff
+see docs/TODO for stuff to do :)
+Help is always appreciated too ;) .
+
+Primary site: ftp://ftp.tux.org/pub/people/david-bagley/xlockmore
+Secondary site: ftp://ftp.x.org/contrib/applications
+Web page: http://www.tux.org/~bagleyd/xlockmore.html
+Maintainer: David A. Bagley <bagleyd@tux.org>
+
+Mailman lists: http://www.tux.org/mailman/listinfo
+If you are interested in contributing to XLock development and/or maintenance
+or just want to be notified when the latest stable version comes out.
+
+    choices                 brief description
+    -------                 -----------------
+    xlock-announce          Xlock beta and production announcements
+    xlock-develop           Xlock alpha ("daily") release announcements
+    xlock-discuss           Xlock/Xlockmore development discussion
+
+SECURITY WARNING:
+-----------------
+xlock using the MesaGL Libraries (<= 2.6) setuid root has a known method for
+users to obtain root privledges!
+
+LEAK
+----
+If using Mesa 3.4.1 and earlier you may want to fix a leak for glXUseXFont()
+*** src/X/xfonts.c.orig        Fri Feb  9 09:42:36 2001
+--- src/X/xfonts.c     Thu May  3 09:24:21 2001
+***************
+*** 260,266 ****
+    bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof 
+  (GLubyte));
+    if (!bm) {
+!       XFreeFontInfo( NULL, fs, 0 );
+        gl_error(NULL, GL_OUT_OF_MEMORY,
+                  "Couldn't allocate bitmap in glXUseXFont()");
+        return;
+--- 260,266 ----
+    bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof 
+  (GLubyte));
+    if (!bm) {
+!       XFreeFontInfo( NULL, fs, 1 );
+        gl_error(NULL, GL_OUT_OF_MEMORY,
+                  "Couldn't allocate bitmap in glXUseXFont()");
+        return;
+***************
+*** 375,381 ****
+      }
+  
+    FREE(bm);
+!   XFreeFontInfo( NULL, fs, 0 );
+    XFreeGC (dpy, gc);
+  
+    /* Restore saved packing modes.  */
+--- 375,381 ----
+      }
+  
+    FREE(bm);
+!   XFreeFontInfo( NULL, fs, 1 );
+    XFreeGC (dpy, gc);
+  
+    /* Restore saved packing modes.  */
+
+
+
+Please send all bug reports to bagleyd@tux.org .
+Alpha versions may be available through web page or primary ftp site.
+Adapted from Patrick J. Naughton's original xlock, with lots of help
+ from others.
+
+
+How to build?
+-------------
+  An ANSI C compiler is required for build.
+  motif (and editres) are used to build xmlock and are not used in xlock.
+
+  Check below to see if your machine is one mentioned that causes
+  problems, otherwise it should be easy.  Just to be safe after installing
+  test it with something like: `/usr/local/bin/xlock -debug -verbose`
+
+  If you installed this before you may want to back up your XLock.ad file
+  if you made changes, since `make install` will overwrite this.
+
+  There are 3 ways to build:
+
+  configure:
+    `configure --help` to see options.
+
+               configure ; make ; make install
+
+               For Linux and others you may want something like:
+    configure --prefix=/usr/X11R6 ; make ; make install
+    that way it will install it in /usr/X11R6 not /usr/local
+               For Suns you may want:
+    configure --prefix=/usr/openwin ; make ; make install
+
+  imake:
+    Sometimes this is not setup correctly by the distributor ... i.e. not
+    my fault.  You may want to do these quick edits to the iconfig.h so you
+    have more capabilities:
+
+    Do you have XPM?              If so, uncomment "#define XpmLibrary".
+    Do you have OpenGL or MesaGL? If so, uncomment "#define GLLibrary".
+    Do you have CDE?              If so, uncomment "#define DtSaverLibrary".
+    Do you have RPLAY?            If so, uncomment "#define RplayLibrary".
+    Do you have NAS?              If so, uncomment "#define NasLibrary".
+    Do you have Motif?            If so, uncomment "#define XmLibrary".
+
+    Examine iconfig.h for other optional capabilities.
+
+    xmkmf ; make Makefiles ; make depend ; make ; make install
+    or
+    xmkmf -a ; make ; make install
+
+  make.com:
+    See VMS below.
+
+
+Note to binary redistributors:
+-----------------------------
+  Probably should not distribute with any library requirements
+  (except possibly XPM, unless you statically link them in
+  and with USE_BOMB since it might not run right if you do not know
+  if your users will use xdm or not.  For example:
+    configure --without-xpm --without-opengl --without-mesagl
+      --without-dtsaver --without-rplay --without-nas --disable-bomb; make
+  You may want to distribute it with the xlock/XLock.ad file with "XLock."
+  instances replaced with "*".  On Sun's, I need it to override the system
+  XLock.ad  file.
+  Please let me know if there are other concerns.
+
+
+Likely Problems
+---------------
+  Make sure you use the new XLock.ad resource file (or at least remove the
+    old one) otherwise several modes will not be set up nicely.  This is
+    usually put as a file in $HOME/XLock and/or
+    $WHEREVER_X11_IS_LOADED/lib/X11/app-defaults/XLock .
+
+  "Key: " this usually means you should get your administrator to setuid
+    xlock to root or at least setgid xlock to shadow.  If you do not have
+    a friendly administrator it is asking for a key (password) that it will
+    save encrypted your $HOME/.xlockrc file.
+
+  AIX (IBM RS6000)
+    AIX's "make":
+      AIX's "make" can not handle "+=" so if you use the iconfig.h, you
+      have to group all your DEFINES into one long line and use "="
+      instead.  GNU's "make" solves this problem.
+    AIX 3.1 and less:
+      it SHOULD compile automatically with -DLESS_THAN_AIX3_2 using the
+      iconfig.h, since the passwd struct is not available.
+    AIX 3.2 and greater:
+      one must have setuid xlock to root if you want to use it
+      without being root.
+       su - root
+       chown root xlock
+       chmod u+s xlock
+       chmod og+rx xlock
+    AFS users:
+      See iconfig.h, grep on "AFS".
+    Some machines have an alternate password shadowing method, if someone
+      figures it out mail me the patch.
+    AIX with DCE you will need "-ls" among the XLOCKLIBS.
+
+  Alpha-OSF/1 (Digital Equipment Corp)
+
+    Enhanced security:
+      Compile with -DOSF1_ENH_SEC see iconfig.h
+        chown auth.auth xlock
+        chmod 2755 xlock
+      Unfortunately the following is reportedly broken since xlockmore-2.10
+      and needs a patch, I heard it produces the following at runtime.
+Unaligned access pid=1767 <xlock> va=140489e24 pc=3ff807d9978 ra=3ff807d9880
+type=ldq
+Segmentation fault (core dumped)
+
+  Apollo (HP)
+    Shift-Control-Break is caught.  See HP.
+
+  CDE (DT) Common Desktop Environment.
+    Go to the CDE DT CONFIG SECTION of the
+     iconfig.h and uncomment (should be autodetected if you use configure)
+XCOMM #define DtSaverLibrary
+    Here's what it does:
+      The DT screensaver is part of the dtwm window manager and what it does
+      is create a full-screen-sized window for each screen of your display.
+      This is different from other screen savers which use virtual roots.
+
+      What the DTSAVER option does is basically call a DT routine that
+      returns the id's of the windows it creates for the screensaver.  Then
+      xlockmore will use these windows to display its stuff.
+
+      DT has a program where you can select your screensaver modes (or
+      screen saver programs), ala xmlock, and set your screensaver settings.
+      It also creates a small window where if you select a particular mode
+      it will run the screen saver and display it on that small window.
+
+    Here's how to set it up on your home directory.
+      cp etc/dtprofile $HOME/.dtprofile
+        This uses a ksh syntax.  If your shell is csh or other change it
+        accordingly.
+      cp etc/dtscreen.dt $HOME/.dt/types
+        The actions points to /usr/remote so you may want to change this.
+      After this you need to completely logout from your CDE session and log
+      back in so it will read the .dtprofile.  (If you just modify the actions
+      in dtscreen.dt you don't need to log out; you can simply restart your
+      dtwm.)
+    Here's how to set it up on your system.
+      edit /usr/dt/bin/Xsession DTSCREENSAVERLIST to contain the
+        DTSCREENSAVERLIST stuff in etc/dtprofile
+      cp etc/dtscreen.dt /usr/dt/appconfig/types/C/dtscreen.dt
+
+    The disadvantage to the above is some features of xlock are absent,
+      in particular, the logout lab feature.  This version of xlock does not
+      hava a drop in replacement for the Screen Style Manager.  Here is a
+      work around on Solaris in 3 patches:
+      1. Take out Screen option.
+      2. Put in /usr/local/bin/xlock as the default locker.
+      3. Turn off the default DT locking mechanism.
+*** /usr/dt/app-defaults/C/Dtstyle.orig        Fri Apr 12 11:53:00 1996
+--- /usr/dt/app-defaults/C/Dtstyle     Thu Jul 24 09:47:34 1997
+***************
+*** 24,30 ****
+  !#   Do not translate the following
+  !###
+  !# componentList specifies the buttons that appear in the Style Manager.
+! Dtstyle*componentList:  Color Font Backdrop Keyboard Mouse Beep Screen Dtwm Startup
+
+  !# The Style Manager may be oriented vertically by commenting out this line
+  Dtstyle*mainRC.orientation:         HORIZONTAL
+--- 24,31 ----
+  !#   Do not translate the following
+  !###
+  !# componentList specifies the buttons that appear in the Style Manager.
+! !#Dtstyle*componentList:  Color Font Backdrop Keyboard Mouse Beep Screen Dtwm Startup
+! Dtstyle*componentList:  Color Font Backdrop Keyboard Mouse Beep Dtwm Startup
+
+  !# The Style Manager may be oriented vertically by commenting out this line
+  Dtstyle*mainRC.orientation:         HORIZONTAL
+*** /usr/dt/appconfig/types/C/dt.dt.orig       Fri Apr 12 11:53:28 1996
+--- /usr/dt/appconfig/types/C/dt.dt    Thu Jul 24 11:32:21 1997
+***************
+*** 226,235 ****
+  ACTION LockDisplay
+  {
+       LABEL           LockDisplay
+!         TYPE            TT_MSG
+!         TT_CLASS     TT_REQUEST
+!         TT_SCOPE     TT_SESSION
+!         TT_OPERATION Display_Lock
+          DESCRIPTION     The LockDisplay action locks the workstation. \
+                          You must know the user's or root password to \
+                          unlock the workstation.
+--- 226,239 ----
+  ACTION LockDisplay
+  {
+       LABEL           LockDisplay
+! #        TYPE            TT_MSG
+! #        TT_CLASS    TT_REQUEST
+! #        TT_SCOPE    TT_SESSION
+! #        TT_OPERATION        Display_Lock
+!         TYPE            COMMAND
+!         ARG_COUNT    0
+!         WINDOW_TYPE  NO_STDIO
+!         EXEC_STRING  /usr/local/bin/xlock
+          DESCRIPTION     The LockDisplay action locks the workstation. \
+                          You must know the user's or root password to \
+                          unlock the workstation.
+*** /usr/dt/config/C/sys.resources.orig        Fri Apr 12 11:53:15 1996
+--- /usr/dt/config/C/sys.resources     Thu Jul 24 11:33:57 1997
+***************
+*** 82,88 ****
+
+
+  dtsession*saverTimeout:  10
+! dtsession*lockTimeout:   30
+  dtsession*cycleTimeout:  3
+  dtsession*saverList: StartDtscreenBlank
+
+--- 82,89 ----
+
+
+  dtsession*saverTimeout:  10
+! !#dtsession*lockTimeout:   30
+! dtsession*lockTimeout:   0
+  dtsession*cycleTimeout:  3
+  dtsession*saverList: StartDtscreenBlank
+
+
+  Using xlock from the dtwm front panel
+  (from Sun Infodoc ID 13527 available from http://sunsolve.sun.com)
+--------------------------------------------------------------------
+First the easy way (This is to overwrite the default CDE action)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Run dtcreate
+2. Create an action called LockDisplay
+3. Set the "Command when action is opened" field to:
+                /usr/openwin/bin/xlock
+4. Set the "Window Type" field to No Output.
+5. Save the file ==> this creates a LockDisplay.dt in ~/.dt/types
+6. Reload the action.
+
+This will help you to bring up xlock when you are using lock in the
+front panel.
+
+                       
+
+
+Second way (another way to use action)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Create a new action for your desktop.  We'll call it Xlock.
+2. Tell the desktop about the new action and then test it.
+3. Modify the front panel so that it will call your new
+           action, Xlock, instead of the old action, LockDisplay.
+
+1. CREATING A NEW ACTION:
+
+        - cd to ~/.dt/types and create a file called Xlock.dt.
+        - Add the following action definition to this file.
+
+ACTION Xlock
+{
+        LABEL           Xlock
+        ARG_COUNT       0
+        TYPE            COMMAND
+        WINDOW_TYPE     NO_STDIO
+        EXEC_STRING     /usr/openwin/bin/xlock
+        DESCRIPTION     xlock
+}
+
+        - This action definition defines an action called "Xlock".
+          When the action is called, it will execute xlock by
+          calling /usr/openwin/bin/xlock.
+
+2. TELLING THE DESKTOP ABOUT THE NEW ACTION AND TESTING IT:
+
+        - Now that we have defined the new Xlock action, we need to
+          first tell the desktop about it and then test it.
+        - To tell the desktop about the new action bring up
+          the "Application Manager".  You can do this by selecting
+          it from the front panel.
+        - From the Application Manager, select "Desktop_Tools"
+        - Now, select "Reload Actions". 
+
+        - At this point, the desktop knows about the new Xlock action.
+          To test it, type "dtaction Xlock".  Xlock should start up.
+
+
+3. ADDING THE NEW ACTION TO THE FRONT PANEL:
+          
+        - copy the dtwm front panel configuration file, dtwm.fp, from 
+          /opt/CDE/appconfig/types/C directory to your personal dt 
+          directory "~/.dt/types" directory.
+        - cd to ~/.dt/types
+        - From here, edit the dtwm.fp
+        - Search for Lock.  You should see something like:
+
+CONTROL Lock
+{
+  TYPE                  icon
+  CONTAINER_NAME        Switch
+  CONTAINER_TYPE        SWITCH
+  POSITION_HINTS        1
+  ICON                  Fplock
+  LABEL                 Lock
+  PUSH_ACTION           LockDisplay
+  HELP_TOPIC            FPOnItemLock
+  HELP_VOLUME           FPanel
+}
+
+        - When you press the lock icon on the front panel, it calls
+          the action LockDisplay.  The above paragraph is the definition
+          for that front panel lock icon.
+
+        - To get the front panel lock icon to call the action we
+          just defined, Xlock, instead of the LockDisplay action, all 
+          you need do is change the PUSH_ACTION line from 
+          "LockDisplay" to "Xlock".  
+          
+CONTROL Lock
+{
+  TYPE                  icon
+  CONTAINER_NAME        Switch
+  CONTAINER_TYPE        SWITCH
+  POSITION_HINTS        1
+  ICON                  Fplock
+  LABEL                 Lock
+  PUSH_ACTION           Xlock
+  HELP_TOPIC            FPOnItemLock
+  HELP_VOLUME           FPanel
+}
+
+        - Note:  You might change the Label field to Xlock and you 
+          might remove the HELP_TOPIC and HELP_VOLUME fields, but this
+          modification is not necessary.
+
+        - Now tell the window manger to reread the configuration
+          files.  You do this by selecting "Restart Workspace Manager..."
+          from your workspace menu.
+
+        - Press the lock icon on the front panel...xlock should be 
+          called.  If not, make sure your DTDATABASESEARCHPATH 
+          environment variable contains $HOME/.dt/types.
+--------------------------------------------------------------------
+
+  DCE authentication (tested only on HP's)
+    See iconfig.h (xmkmf) or modes/Makefile.in (configure).
+
+  Digital Unix
+    Reported that 3.2D (8bpp) password screen color map gets messed up
+    sometimes when in random mode as it switches from one mode to another.
+
+  ESIX
+    Similar to Solaris2.x.  You will need a -DSVR4 to compile.
+    chmod 440 /etc/shadow
+    if you get libX11.so.xxx not found
+      link with the static versions of the X libraries
+    chmod 2755 xlock
+
+  FreeBSD
+    One may have to setuid xlock to root (are there any objections?).
+    Also see "XFree86" if applicable.
+
+  HP
+    Shift-Control-Break is caught.  This uses a library Xhp11 that may
+      not exist on some systems.  Comment out
+        XHPDisableReset(dsp);
+      and
+        XHPEnableReset(dsp);
+      in "xlock.c" if you do not have this library.
+      May have to setuid xlock to root.
+    The optimizer may break in xlock/ .
+    HP's "make":
+      HP's "make" can not handle "+=" so if you use the iconfig.h, you
+      have to group all your DEFINES into one long line and use "="
+      instead.  GNU's "make" solves this problem.
+    HP-UX with Secured Passwords:
+      Compile with -DHPUX_SECURE_PASSWD and setuid xlock to root.
+    HP-UX with Passwd Etc:
+      Compile with -DHP_PASSWDETC .
+      Link with -lrgy -lnck -lndbm .
+      This is insecure so make sure you know this by having you go to the
+      code to enable it.
+    Calls to XSetScreenSaver when using CDE (i.e. not called with -dtsaver)
+      are not supported.  This can cause a disruption in the rpc ttdbserver
+      system resulting in the CDE lock and exit buttons to fail, 5 to 50%
+      of the time.  I am told this will not be fixed by HP, only documented.
+      The only supported method of doing this stuff is via dtstyle.
+    configure --without-editres   if configure gets tripped up
+    I found on my system -g -O trips up on life.c and shape.c ... so just
+      have one or the other.
+
+  IRIX (SGI)
+    OpenGL works but may be a little flaky.
+
+  KERBEROS
+    See iconfig.h (xmkmf) or configure --help .
+
+  Linux (Intel 80386, 80486, & Pentium)
+    Red Hat and PAM ... may not work ... #define BAD_PAM in config.h after
+      you do a configure and before a make.  Then make sure xlock is setuid
+      root.
+    If you are using elf _or_ shadow passwords:
+      xlock should compile with -DHAVE_SHADOW
+      this is already forced if you have elf so do not worry, it should
+      work even if you do not have shadow passwording.
+    If you are _not_ using elf and are using shadow passwords:
+      (this old version of shadowing has a _MAJOR_ known security flaw)
+      link with -lshadow -lgdbm
+    Next if using shadow passwords:
+      chown root.root xlock  (or root.shadow if it exists)
+      chmod 4755 xlock
+      (chmod 2755 xlock may be better if shadow has group read for root group)
+      Also check that the following was done:
+        Your /usr/X11R6/lib/X11/config/linux.cf should have
+#define HasShadowPasswd         YES
+          This would let the iconfig.h work automatically for compile/link.
+        chown root.root /etc/shadow   (or root.shadow if it exists)
+        chmod 400 /etc/shadow
+        (chmod 440 /etc/shadow may be better).
+    If you want to install shadow passwords on a system that doesn't
+     already have them  (be careful, it can be tricky),  see
+     http://sunsite.unc.edu/linux/HOWTO/Shadow-Password-HOWTO.html
+
+    Also see "XFree86" if applicable.
+
+  Linux (Alpha)
+    Change the order of XLIB and XPMLIB in the iconfig.h so the XPMLIB
+     comes first.  Intel stuff above probably applies as well.
+
+  MesaGL and OpenGL
+    I assume the Mesa 3-D Graphics Library for the Imakefile.  See below
+      on availability.  Follow its instructions and then go to MesaGL
+      section of the iconfig.h and uncomment
+XCOMM #define GLLibrary
+      MesaGL and sometimes OpenGL are autodetected if you use configure.
+
+  Rplay
+    Audio package.  See below on availability.  Follow its instructions and
+      then go to iconfig.h and uncomment (should be autodetected if you use
+      configure)
+XCOMM #define RplayLibrary
+      See config directory for example.  (Note: The example files are
+      concerned with getting it working ... not security).
+
+  Solaris2.x (Sun SPARC)
+    You could use MesaGL or OpenGL.  I found a developers version of OpenGL at
+      http://www.sun.com/solaris/opengl/
+    Solaris2.6 may not work with rplay.  configure --without-rplay
+    If you get something like:
+xlock.c:1584: `sigset_t' undeclared (first use this function)
+      try removing -I/usr/include from the Makefiles or get rid of -Xc
+      in the xlock/Makefile.  If someone figures out a way around this
+      in the code let me know.
+    To get xlock working with Sun's GL libraries and includes
+      If you get "macro `glNormal3f' used with just one arg" ... you need
+         -DSUN_OGL_NO_VERTEX_MACROS
+      If using Imakefile, see iconfig.h .
+      After a make, use on a display that supports GLX  `xdpyinfo | grep GLX`
+    Imake will compile with the -DHAVE_SHADOW switch.
+    With GNU's gcc, get rid of the "-ansi" during compilation, also
+      one may want to get rid of the -xF references in
+      /usr/openwin/lib/config/sun.cf and Imake.tmpl if you get a
+      cc: language F not recognized
+    Solaris2.x NIS+ or not using NIS (/etc/passwd):
+      If you use netgroup make sure there is a return at the end of file.
+    If your using g++-2.95 or later and have old X11 includes you may have
+      to change "g++" to "g++ -fpermissive" in the Makefiles.
+
+  SunOS4.1.x (Sun Sparc & 680x0)
+    bubble may crash the xnews server if patch 100444-76 OpenWindows V3.0
+      Server patch is installed.  To test this
+      `strings /usr/openwin/bin/xnews | grep Patch`
+      It would then show Patch #3000-124 if 10044-76 is installed.
+    Put in a link from /usr/include/X11 to your ${OPENWINHOME}/include/X11
+      to use the xmkmf or use the configure file provided.
+    gcc -Wall gives a lot of silly warnings, its safe to disregard them.
+    If your using g++-2.95 or later and have old X11 includes you may have
+      to change "g++" to "g++ -fpermissive" in the Makefiles.
+
+  Ultrix (DEC)
+    I heard that the logout button just kills xlock.
+    USE_XLOCKRC feature unimplemented, but may not be hard to do.
+    xlock must be either setuid root or setgid authread to validate the
+      password on an Ultrix system.
+
+  VMS (DEC)
+    You may want to set a few things like vroot, bomb, and sound (see audio
+      below) at the top of the file.
+    All you should need to do to build the executable is:
+        $ @make
+    To run xlock a symbol needs to be defined, for example:
+        XLOCK:==$H268SYSEXE:XLOCK
+      where H268SYSEXE is a logical name pointing to the directory where
+      XLOCK.EXE resides. The '$' after == means this is a foreign command
+      and VMS makes the command line available to the program.
+    If the link bombs out I recommend trying it again like the following:
+        $ @make clean
+        $ @make
+    -allowroot only works if you have SYSPRV enabled which is a bit limiting.
+      Unless one uses the privileged install by a system manager.  To do
+      this, the following command needs to be executed at system startup
+      (i.e. included in systartup_vms.com):
+         INSTALL ADD {dev}:[{dir}]XLOCK.EXE/PRIV=(SYSPRV)
+      where {dev}:[{dir}] is the full path of the executable.
+    The XLock file normally in /usr/lib/X11/app-defaults needs to be in the
+      directory DECW$SYSTEM_DEFAULTS on VMS systems and be called
+      'DECW$XLOCK.DAT'.
+    USE_XLOCKRC, USE_AUTO_LOGOUT, USE_BUTTON_LOGOUT, & USE_MULTIPLE_ROOT
+      features are not implemented.
+    To use audio:
+      Set "sound" to be 1 in the make.com file.  Only available on the Alpha.
+      To get it work on a VAX some editing of the make.com is needed
+        (scan for USE_VMSPLAY)
+      The default sound files are hard coded to be in the current directory
+        see line 128 or so of the resource.c file but can be overruled from
+        the command line or the resourcefile decw$xlock.dat.
+      Sounds did not work for me on the VAX.
+      It should work OK on an AXP. (Due to a bug in the SO driver on some
+        models running VMS7.0, sounds are only available on the headset).
+    To use new event loop:
+       For VMS7.0 and higher : new event loop is used by default.
+         You do not need to install extra software.
+       For VMS6.2 or lower :
+         You need some UNIX utilities installed (XVMSUTILS).  See where to get
+         it below.
+         Look at the make.com and xvmsutil stuff.
+    Latest on VMS sound
+      first it tests if the SO: device is present
+      Then if it could be compiled in (license problems) MMOV (Multimedia
+      services for OpenVMS) is used. Probably you'll need the Developer
+      license to get it compiled.
+      limitations :
+         -currently the SYSNAM privilige is needed to play sounds
+          (limitation of MMOV)
+         -some compilation warnings/informationals in the routines which
+          are taken from the users system disk. (problem in MMOV)
+         -One warning due to multiple defined symbols in the libraries
+          issued by Compaq should be ignored.
+         -Presently A developer license for MMOV is needed. Probably by
+          slightly modifying DEF_PLAY the Run-time license could also
+          be usable.
+
+  X11
+    If your using g++-2.95 or later and have old X11 includes you may have
+      to change "g++" to "g++ -fpermissive" in the Makefiles.
+
+  XFree86
+    Control-Alt-Backspace will defeat locking mechanism and return your
+      console back unless you put "DontZap" in your XF86Config file.
+      (In X11R5, that would be a "dontzap" in your Xconfig file).
+    Control-Alt-F1 (among others) will defeat locking mechanism with
+      virtual terminals. This is not too good, right?  If you are using
+      Linux, try vlock on tsx-11.mit.edu in /pub/linux/sources/usr.bin .
+      The current XFree86 (as far as I know) does not have a server
+      extension for catching or disabling VT switching.
+    Here is a work around, put this line in /etc/profile:
+        alias x='(startx >/dev/null &);clear;logout'
+      then use 'x' instead of 'startx' (with no other active VT's).
+    Try configuring with --enable-vtlock .  This is experimental and requires
+      xlock being setuid to root so there are security concerns with it.
+      See man pages for its runtime options.
+
+  XPM
+    Full color pixmap package.  See below on availability.  Follow its
+      instructions and then go to iconfig.h and uncomment (should be
+      autodetected if you use configure)
+XCOMM #define XpmLibrary
+
+  X-Terminal
+    (My heart bleeds for you.)
+    To get xlock to run, run with -remote option or set XLock.remote on
+    in XLock.ad .  You might have to use -allowaccess as well.
+
+  tvtwm
+    One used to get following error when running xlock (+nolock) with
+      tvtwm.
+    X Error of failed request:  BadWindow (invalid Window parameter)
+    What happens is that RootWindow(dsp, screen) fails when tvtwm is
+      running.  There is a kludge fix, but multiscreens will not work
+      right with tvtwm and xlock. (grep on TVTWM in xlock.c).
+    Another option, don't compile with -DUSE_VROOT .  If you debug it
+      mail ME -OR- both the author of tvtwm and ME the patch.
+    StickyAbove problems:
+      Windows in a tvtwm that have "StickyAbove" set to true are still
+      visible when xlock (+inroot) is running. If this bothers you,
+      don't compile with -DUSE_VROOT .  Is it possible to have xlock
+      set "StickyAbove" to true as well?
+
+  fvwm
+    -install does not install colormaps.  fvwm will not allow an
+    application to install its own colormap.  You could always edit the
+    source if you have it, (fvwm-1.24r)colormaps.c, where it says
+ if(ReInstall)
+   {
+     XInstallColormap(dpy,last_cmap);
+   }
+    make sure this does not happen.
+    (fvwm does this because its following the X11 docs which say that
+    window managers should not allow an application to install colormaps).
+
+  swirl (and tube) mode
+    Use with -install to see colormap change.
+    See "fvwm" if applicable.
+    "swirl" cycles its colors, except black and white.
+    This is easily seen when on a color monitor one enters:
+       ./xlock -mode swirl -inwindow -install
+    now move the mouse in the window.
+    If you find this annoying compile swirl.c with -DFORCEFIXEDCOLORS.
+    I hear it LOCKS UP on i386BsdArchitecture and tvtwm.
+    With twm (and fvwm see above) the colormap does not change.
+
+  transparent mode
+     Try this fudge:
+       xlock -mode blank -geometry 1x1 -enablesaver
+
+  SafeWord
+    Edit config.h.in ... uncomment SAFEWORD line near bottom.
+    In modes/Makefile.in make sure SAFEWORD is linked in, comment out
+      similar link that does not contain safeword libraries.
+    Put the cust*.h files in the main xlock directory.
+    Use `configure; make`.
+    Get back to me if it works or does not work.
+
+  Dynamic Linking
+    Dynamic Linking using elf on the Linux and Sun.  This is kind of fragile
+      and will break other systems.  GL modes using Mesa on a PseudoColor
+      display seem to run short of colors.
+    Linux:
+      Not all distributions of Linux have "dlfcn.h" which is needed.
+      Using configure --enable-modules (MODULE_PATH set in modes/Makefile(.in)
+        and xlock/Makefile(.in) then build as normal. This is not recomended
+        since random mode seems to act very strangely.
+      Uncomment at least "#define Modules" in iconfig.h, run "xmkmf -a"
+        and run make install as normal.
+    Sun:
+      Need Gnu's make
+      Can use gcc (recommended) or cc 
+        cc and CC problem with C++ modes (solitare and text3d)
+          xlock: LoadModule: modes/solitare.xlk: ld.so.1: xlock/xlock: fatal:
+          relocation error: file modes/solitare.xlk: symbol __0OnwUi:
+          referenced symbol not found unrecognized mode "solitare").
+      configure will not work.
+      Uncomment at least "#define Modules" in iconfig.h.
+      If you have more than one C++ compiler set CXX in iconfig.h
+        (seems to default to g++ for me)
+      xmkmf -a # Ignore errors on Sun (should not get errors on Linux)
+      Edit generated Makefiles like this:
+for i in Makefile xlock/Makefile modes/Makefile modes/glx/Makefile ; do
+  # both cc (& CC) and gcc (& g++)
+  sed -e "s#/usr/ccs/bin/make#/usr/local/bin/make#g" $i > $i.tmp ; mv $i.tmp $i
+  sed -e "s# -z text -M mapfile##g" $i > $i.tmp ; mv $i.tmp $i
+  sed -e "s# -Xc -xF -xcg92##g" $i > $i.tmp ; mv $i.tmp $i
+  #following seds for gcc and g++ only
+  sed -e "s#= cc\$#= gcc#g" $i > $i.tmp ; mv $i.tmp $i
+  sed -e "s#= cc #= gcc #g" $i > $i.tmp ; mv $i.tmp $i
+  sed -e "s# -Kpic##g" $i > $i.tmp ; mv $i.tmp $i
+done
+         For g++ and Sun edit modes/Makefile and modes/glx/Makefile for
+            -isystem change (use grep on isystem to find it).
+         Also, if you have more than one C++ compiler set CXX in Makefile.
+      make install
+
+Personal Use
+------------
+  You may want to compile with USE_XLOCKRC .  xlock will then prompt
+  you the first time you use it for a password.  It is then encrypted
+  and stored in your $HOME/.xlockrc file.  This is also good for
+  users who have an unrecognized shadow password environment.  See
+  iconfig.h file (xmkmf) or `configure --help` for an example.
+  Please note that it may be rude to use xlock in a lab environment.
+
+Lab Environment
+---------------
+  The auto logout feature, when enabled, will log out a user after
+  30 minutes (by default).  The timeout can be changed or disabled
+  with a command-line option (or x resource -- this is allowed because
+  the logout button can always be used; see below).  The time
+  remaining before auto-logout is displayed on the password entry
+  screen.
+
+  The logout button, when enabled, is a button that appears on the
+  password entry screen after 5 minutes (configurable at
+  compile-time) that, when clicked, logs out the user.  The rationale
+  for this thing is that in a lab environment, we wanted a way for
+  users to be able to reliably lock their display for short periods
+  of time, but still be allowed to have the display locked for longer
+  than that if the lab isn't busy.  If the lab IS busy, and there is
+  a need for workstations, the logout button can be used to logout
+  someone who's been gone for more than 5 minutes.
+
+  Of course, the auto-logout and the logout button are
+  enabled/disabled by compile-time defines.  All these are OFF by
+  default.  One can also force use these features with a local policy
+  of exemptions (e.g. username or group). See the iconfig.h file or
+  `configure --help` for an example.  Edit your /etc/xlock.staff
+  file to reflect your policy.  If using xdm, you may just want to use
+  -DCLOSEDOWN_LOGOUT (or -DSESSION_LOGOUT <- old way) in conjunction
+  with -DUSE_AUTO_LOGOUT or -DUSE_BUTTON_LOGOUT.  That way all
+  backgrounded processes owned by a user do not have to be killed.
+
+  Don't PANIC, the auto-logout and the logout button will not run if
+  you are root.  Otherwise, it will kill all of root's processes, not
+  a good idea.  As long as you do not lock the screen (using -nolock,
+  -inwindow, or -inroot) the policy of xlock users does not go into
+  effect.  If configured with --use-button-logout=-1, the user can decide
+  if he/she wants the logout button enabled (not enabled if
+  XLock.buttonLogout=0).
+
+  blank mode only
+    Change xlock/XLock.ad from
+XLock.mode: random
+!XLock.mode: blank
+    to
+!XLock.mode: random
+XLock.mode: blank
+
+    Do a configure with these options, since they would useless now...
+    configure  --without-opengl --without-mesagl --without-xpm
+    Edit the generated config.h, add "#define BLANK_ONLY", then to a make.
+
+xlock still does not work:  :-(
+-------------------------------
+  If all that does not work you may need to adjust xlock.h, passwd.c
+  xlock.c, and resource.c since these files are highly implementation
+  dependent.  If you have to make this kind of change to get it working,
+  let me know.
+
+  You can try compiling with -g and running it with -debug and your
+  favorite debugger, so xlock will run in a more friendly way (i.e. it
+  does not lock the screen).  There are also may be compile time switches
+  that could be turned on with -DDEBUG depending on what is not working
+  correctly.
+
+  Here is a simple recipe:
+    Make sure the 12th line in the iconfig.h is a comment
+      (This is because the debug library for xpm is not usually installed)
+XCOMM #define XpmLibrary
+    xmkmf  <or configure --without-xpm>
+    edit Makefile  on the line with CC = gcc or or CC = cc change to
+               CC = gcc -g -DDEBUG
+    make depend <but not if using configure>
+    make
+    gdb xlock  (xdb or dbx xlock may work too.)
+    run -debug <other xlock options you want here>
+    where
+    print <relevant variables>
+      (you may have to use "up" to take you to xlockmore code)>
+    Mail me the results.
+
+  If xlock crashes for you when in random mode... try this and mail
+    me the results.  (If it runs for a long time partial result will do
+    (gut the middle part)).
+  xlock -mode random -modelist all +install -debug -verbose
+    -modelist all: all modes except blank
+    -debug: so it does not lock the screen.
+    -verbose: for maximum verbosity.
+    +install: so it does not keep changing the colormap
+
+
+Other things to try: (if you got it working :-) )
+-------------------------------------------------
+
+  Check out etc directory for menus and other goodies.
+
+  If you like to check out what xlock looks like on multiscreens and you
+    do not have them... but do have Linux and Xnest ... try:
+     Xnest -scrns 3 :1 &
+     xterm -display :1.0
+    And run xlock from the created xterm.  (For some reason I have to do
+    it as root).
+    If you are using MesaGL, it must be compiled without SHM extension do
+      to a bug in Xnest (even in XFree3.3 == X11R6.3) or you will get
+      "BadDrawable (invalid Pixmap or Window parameter)".
+
+  You may want to change the 1st line of XLock.ad "random" to "blank",
+  "life", or whatever your favorite is and copy it to
+  /usr/lib/X11/app-defaults or $HOME (or wherever your application
+  defaults files are) and rename to XLock .
+
+  You may want some of the modes never to come up in random.  This is
+  already hard coded for the blank mode.  See xlock man page on "modelist".
+  In mode.c you can hard code others by just putting the stuff that you do
+  not like in the LockProcs to the end of the static array and in
+  random.c increase NUMSPECIAL by the number of new screens that you do
+  not want displayed.
+
+  You may want to move xlock into /usr/bin/X11 (or wherever your X
+  binaries are). You may also want to move xlock.man to
+  /usr/man/man1/xlock.1 .
+
+  If you want to remove some unwanted modes just edit "mode.h" and
+  "mode.c" grep the for the unwanted modes.  You might want to edit
+  the man page and your favorite make file as well.
+
+  I am very interested in cellular automata.  I am always looking to
+  improve ant, life, life3d, and life1d.  If anyone knows any new
+  collections (I have lifep.zip (May 94) and xlife 3.0) let me know.  If
+  you would like further information let me know.  There are several
+  run-time options to check out, see docs/cell_automata.
+
+  Still like xscreensaver better?  (Obscenities omitted ;) ) Try
+  setting your apps-defaults file for xscreensaver like:
+*programs:      xlock -nolock +grabmouse -mode random
+
+  If you want to hack a new mode check out docs/HACKERS.GUIDE.  Then
+  when working, just mail it to me, grep on "Maintainer" for the
+  address.
+
+
+Other related stuff (all not maintained by me):
+--------------------------------------------------------------------
+  NAME
+   LOCATION (last seen at)
+   DESCRIPTION
+ =============
+  audio/VMS
+    http://axp616.gsi.de:8080/www/vms/mzsw.html
+  fortune
+    ftp://igor.girton.cam.ac.uk/pub/funny/cookie.tgz
+    ftp://ftp.uu.net/systems/unix/BSD/games/fortune
+    ftp://ftp.sterling.com/usenet/alt.sources/index (grep for cookie)
+    Please note that my format is slightly different.  The number at the
+      top of the file should match `grep -c "^%%$" fortune.dat`
+  freetype and gltt for text3d
+    http://freetype.sourceforge.net/ is the official site for freetype
+      (need 1.3.1)
+    http://gltt.sourceforge.net/ is the official site for gltt (2.5)
+      To get this to compile with CC on Sun (mainly for xlock maintainer's
+        reference in case he ever has to do it again; if this is built using
+        g++ then xlock must be built using g++ if you want text3d to work).
+          configure --with-ttf-includes=/usr/openwin/include/freetype --with-ttf-libraries=/usr/openwin/lib
+          change g++ reference in generated Makefile to CC
+          change .la references to .a in Makefile to produce a libgltt.a
+          remove -Wall to get rid of warnings in Makefile
+          change compiler_o_lo="no" for libtool
+          remove -fPIC to get rid of warnings in libtool
+    http://perso.libertysurf.fr/lassauge/en_xlock.htm  another link.
+  imake
+    ftp://hpux.csc.liv.ac.uk/hpux/X11/Core/imake-5.06/imake-5.06-ss-9.03.tar.gz
+    I had to worry about FIXUP_CPP_WHITESPACE.
+  Lesstif
+    ftp://ftp.hungry.com/pub/hungry/lesstif/lesstif-current.tar.gz
+    Lesstif Library (just like Motif)
+  Man2HTML
+    ftp://sunsite.unc.edu/pub/Linux/system/Manual-pagers/vh-man2html-1.4.tar.gz
+  Mesa (similar to OpenGL)
+    ftp://iris.ssec.wisc.edu/pub/Mesa
+    Mesa 3-D Graphics Library (like OpenGL) Mesa-3.0 or greater required.
+    Mesa-2.2 and below has some memory leaks and 2.6 and below has some
+      security concerns.
+  NAS (audio package)
+    ftp://ftp.x.org/contrib/audio/nas
+  OpenGL (for Sun)
+    http://www.sun.com/software/graphics/OpenGL/
+  rplay (audio package)
+    ftp://ftp.x.org/contrib/audio/rplay
+  UNIX/VMS
+    Unix-like routines XVMSUTILS can be found at
+      http://axp616.gsi.de:8080/www/vms/mzsw.html
+  xautolock (runs xlock after a idle time)
+    ftp://ftp.x.org/contrib/applications
+    ftp://sunsite.unc.edu/pub/Linux/X11/screensavers
+    (I use openwin and I put this in my $HOME/.openwin-init)
+    toolwait /usr/local/bin/xautolock -time 5 -locker "xlock -lockdelay 30"
+  XPM
+    ftp://ftp.x.org/contrib/libraries
+    color pixmaps
+  XPM/VMS
+    use the one above or xlock may bomb out,
+    compile with cc/standard=vaxc/define=(need_strcasecmp,need_strdup)
+      except when using XVMSUTILS.
+  xscreensaver
+    ftp://ftp.x.org/contrib/applications
+    http://www.jwz.org/xscreensaver
+
+
+Operation: (Blurb taken from Darren Senn's xlock)
+-------------------------------------------------
+
+  Under X, run xlock.  The screen will clear, and some pretty animated
+  picture (exactly which depends on which module is active) will appear
+  on the screen.  If you hit a key, then the screen will clear, and
+  (unless you've changed the application defaults file that I packaged
+  with this) you'll get a black screen with some graphics in the top
+  center.  These graphics consist of a reduced size image of the module
+  you were viewing, the name of the user who executed xlock, and
+  password prompt field, and some short instructions.
+
+  At this point, you can either click on the graphic to return to xlock,
+  or you can type a password.  If the password is verifiable as the
+  root password, or the password of the user listed above, then xlock
+  will terminate.  THIS IS THE ONLY WAY TO STOP XLOCK WITHOUT SHUTTING
+  DOWN THE X SERVER.  That's what makes it a lock.
+
+
+Resources: (Also taken from Darren Senn's xlock)
+------------------------------------------------
+
+  There are two sets of resources for XLock.  The first set are (what I
+  call) global XLock resources, while the second set consists of
+  module-specific resources.
+
+  The global resources are:
+        XLock.mode: This sets the module.
+        XLock.font: This is the font used on the password entry screen.
+        XLock.background: The background color for the password entry screen.
+        XLock.foreground: The foreground color for the password entry screen.
+        XLock.username: The label for the field indicating the user name.
+        XLock.password: The label for the password prompt.
+        XLock.info: The "short instructions" to print.
+        XLock.validate: A message to display while checking the password
+        XLock.invalid: A message to display if the password is incorrect
+        XLock.nice: How much XLock should nice itself.
+        XLock.timeout: How long to wait idle at the password prompt.
+        XLock.timeelapsed: Message to see how long lock running (yes or no)
+        XLock.mono: Monochrome mode (yes or no)
+        XLock.nolock: disable the lock mechanism (yes or no)
+        XLock.remote: allow remote locking (meaningless under linux)
+        XLock.allowroot: allow the root password to unlock (yes or no)
+        XLock.enablesaver: allow the system screensaver to work (yes or no)
+        XLock.allowaccess: allow other clients to connect while active
+        XLock.echokeys: Echo "?" for each password keypress (yes or no)
+        XLock.usefirst: Ignore the first character typed (yes or no)
+        XLock.verbose: Verbose mode. (yes or no)
+        XLock.inwindow: allow the xlock to run in a window (yes or no)
+        XLock.inroot: allow the xlock to run in the root window (yes or no)
+        XLock.grabmouse: Grab the keyboard and mouse (yes or no)
+
+  XLock has a number of modules which it can display.  (See the man page
+  for a complete list).  It turns out that each module is characterized
+  by a number of initializations, separated by a number of "draws".
+  Each module has the following resources defined:
+
+        XLock.<module>.delay: How long to wait between draws (usec)
+        XLock.<module>.batchcount: May mean various things (see man page).
+        XLock.<module>.cycles: Controls the timeout of screen (see man page).
+        XLock.<module>.size: Controls size of objects on screen (see man page).
+        XLock.<module>.saturation: Saturation (as in HSV) of colors to use.
+
+
+Acknowledgments:
+----------------
+
+  I did not write the original algorithms in any of the lock screens
+  (except wator, bug, life1d, demon, ant, daisy, and voters), although I
+  did convert many of the new ones to run with xlock.  I tried to follow
+  the original style of Patrick Naughton.  Updates are made at
+  ftp.x.org in directory /contrib/applications.  Many of the additions
+  were "borrowed" from xscreensaver (Jamie Zawinski <jwz@jwz.org>).
+  Some of the others were "borrowed" from old demos from Sun.  Many more
+  are contributions.
+
+  I will consider putting new ones in if (1) they are more or less public
+  domain (i.e. BSD, sorry no GNU copyrights), (2) they are neat (I am
+  biased towards mathematically based programs (especially the Computer
+  Recreations of Scientific American)), and (3) I have the time.
+
+  Also many thanks to the people that helped me countless times with
+  xlock mentioned in "Revisions", especially Jouk Jansen, Tom Schmidt,
+  David Hansen, Ed Mackey, Marcelo Vianna, Ron Hitchens, and Heath Kehoe.
+
diff --git a/bitmaps/bad.xbm b/bitmaps/bad.xbm
new file mode 100644 (file)
index 0000000..a778f5e
--- /dev/null
@@ -0,0 +1,9 @@
+#define bad_width 21
+#define bad_height 21
+static unsigned char bad_bits[] = {
+   0x80, 0x1f, 0x00, 0x60, 0x60, 0x00, 0x10, 0x80, 0x00, 0x08, 0x00, 0x01,
+   0x04, 0x00, 0x02, 0x82, 0x10, 0x04, 0x42, 0x29, 0x04, 0x81, 0x10, 0x08,
+   0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0x08,
+   0xe1, 0x7f, 0x08, 0xe2, 0x7f, 0x04, 0x02, 0x00, 0x04, 0x04, 0x00, 0x02,
+   0x08, 0x00, 0x01, 0x10, 0x80, 0x00, 0x60, 0x60, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x00, 0x00};
diff --git a/bitmaps/bat-0.xbm b/bitmaps/bat-0.xbm
new file mode 100644 (file)
index 0000000..f73886e
--- /dev/null
@@ -0,0 +1,174 @@
+#define bat0_width 147
+#define bat0_height 108
+static unsigned char bat0_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
+   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xe1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x11, 0x7e, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xc0, 0x03, 0xfd, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xb6,
+   0xcf, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x76, 0xa7, 0x19, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+   0x00, 0xc6, 0xb7, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xe0, 0xdd, 0x86, 0x61, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x06, 0xf8, 0x7f, 0x8c, 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x70, 0xfe,
+   0x86, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x01, 0x06, 0xf0, 0xfe, 0x0c, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06,
+   0x60, 0x0e, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x06, 0x70, 0x0e, 0x18, 0x02, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+   0x80, 0x06, 0x60, 0x06, 0x90, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xe0, 0x07, 0x70, 0x07, 0x30,
+   0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x30, 0x60, 0x0e, 0x30, 0x05, 0x30, 0x0c, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x20, 0x00, 0x30,
+   0x05, 0x30, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x10, 0x30, 0x00, 0x30, 0x05, 0x30, 0x18, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30,
+   0x00, 0x30, 0x05, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x00, 0x30, 0x07, 0x10, 0x10,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x08, 0x30, 0x00, 0xb0, 0x02, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x10, 0x00, 0xb0, 0x02,
+   0x0e, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x10, 0x00, 0xb8, 0x02, 0x0f, 0x20, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x00,
+   0x98, 0x02, 0x07, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x00, 0x98, 0x03, 0x06, 0x60, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+   0x30, 0x00, 0x98, 0x03, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x00, 0x98, 0x01, 0x04,
+   0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x06, 0x20, 0x00, 0x98, 0x01, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x20, 0x00, 0x98,
+   0x01, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0xc8, 0x01, 0x0c, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x60,
+   0x00, 0xc0, 0x00, 0x0c, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x40, 0x00, 0x00, 0x00, 0x04, 0x80,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc6, 0xdf, 0x00, 0x00, 0x00, 0x04, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0xf8, 0x00, 0x00, 0x00,
+   0x06, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x76, 0xe0, 0x01, 0x00, 0x00, 0x06, 0xa0, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0xc0, 0x01,
+   0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x16, 0x80, 0x03, 0x00, 0x00, 0x02, 0xa0, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16,
+   0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x07, 0x00, 0x00, 0x03,
+   0xa0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x1c, 0x00, 0x06, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
+   0x80, 0x01, 0xa0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00,
+   0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xa0,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xbc, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x60,
+   0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00,
+   0x00, 0xf8, 0x7f, 0x60, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0x00, 0x00, 0x38, 0xe8, 0x43, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+   0x08, 0x00, 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0x00, 0x00, 0x00, 0x00,
+   0xac, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xf0, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x04, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
+   0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc0, 0x80, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00,
+   0x80, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x80, 0xf9, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
+   0x00, 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bat-1.xbm b/bitmaps/bat-1.xbm
new file mode 100644 (file)
index 0000000..5c421d1
--- /dev/null
@@ -0,0 +1,174 @@
+#define bat1_width 147
+#define bat1_height 108
+static unsigned char bat1_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0b,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x0a, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1f,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x7c, 0xce, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xdf,
+   0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0xc3, 0xff, 0x03, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00,
+   0x80, 0x81, 0xbf, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x80, 0x18, 0xcf, 0x03, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+   0x00, 0x00, 0x90, 0x09, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x1c, 0x83, 0x1f,
+   0xe2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x38, 0x00, 0x00, 0x00, 0x06, 0xfe, 0x03, 0x03, 0x0e, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x03,
+   0xa0, 0xff, 0x01, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0x00, 0x90, 0x7d, 0x00, 0x80, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+   0xc0, 0x00, 0x90, 0x0d, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x60, 0x00, 0x88, 0x05, 0x00,
+   0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00,
+   0x00, 0x00, 0x30, 0x00, 0x88, 0x85, 0x07, 0x00, 0x20, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xc8,
+   0x62, 0x1c, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0c,
+   0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x84, 0x12, 0x30, 0x00, 0x00, 0x03,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32, 0x00, 0x00, 0x00, 0x00, 0x08,
+   0x00, 0xa4, 0x03, 0xc0, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xe4, 0x01, 0x80, 0x01,
+   0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x7c, 0x00, 0x00,
+   0x00, 0x04, 0x00, 0x54, 0x01, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xe0, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x04, 0x00, 0xd2, 0x00,
+   0x00, 0x06, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+   0x07, 0xf0, 0x03, 0x06, 0x00, 0xda, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x03,
+   0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x1c, 0xbc, 0x2f, 0x02, 0x00,
+   0x68, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x8c,
+   0x00, 0x00, 0x70, 0x0c, 0x18, 0x02, 0x00, 0x6d, 0x00, 0x00, 0x08, 0x00,
+   0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0xc0, 0x06, 0x10,
+   0x03, 0x00, 0x65, 0x00, 0x00, 0x08, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
+   0x00, 0x02, 0x0e, 0x00, 0x80, 0x03, 0x30, 0x02, 0x00, 0x35, 0x00, 0x00,
+   0x0c, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x30, 0x00, 0x80,
+   0x03, 0x20, 0x03, 0x80, 0x32, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0x03, 0x80, 0x3a,
+   0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00,
+   0x00, 0x00, 0x03, 0x60, 0x01, 0x80, 0x1b, 0x00, 0x00, 0x06, 0x00, 0x00,
+   0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x60, 0x01,
+   0x80, 0x19, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x80, 0x19, 0x00, 0x80, 0x03,
+   0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc0, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xc0, 0x0c, 0x00,
+   0x1f, 0x00, 0x00, 0x00, 0xf8, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xc0, 0x01, 0xc0, 0x0c, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x1f,
+   0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xc0,
+   0x04, 0x00, 0xe0, 0x00, 0x00, 0xe0, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x06, 0x00, 0x80, 0x03, 0x00,
+   0x18, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+   0x01, 0x00, 0x02, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x03, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x0c, 0x00, 0x03, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc0, 0x00, 0x00, 0x00,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x18, 0x60, 0x00, 0x00, 0xf0, 0x67, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00,
+   0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x60, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+   0x0c, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x06, 0x00, 0x00, 0x00, 0x33,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bat-2.xbm b/bitmaps/bat-2.xbm
new file mode 100644 (file)
index 0000000..c1ff4b4
--- /dev/null
@@ -0,0 +1,174 @@
+#define bat2_width 147
+#define bat2_height 108
+static unsigned char bat2_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfc, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x20, 0xf6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xc3, 0x03, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81,
+   0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x0c, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x58, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x30, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x90, 0xc0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x81,
+   0x01, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x20, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x30, 0x02, 0x0e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x38, 0x00, 0x00,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x20, 0x00, 0xe0, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x80,
+   0x01, 0x00, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x0f, 0x60, 0xf2, 0x03, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+   0x00, 0x00, 0xfc, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0xff,
+   0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0xc0, 0x8f, 0xff,
+   0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf7, 0x0f, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x23, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0x73, 0x38, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
+   0xb3, 0x0f, 0x06, 0xd0, 0xaf, 0xa0, 0x0d, 0x00, 0x0e, 0x1a, 0x02, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0xc3, 0x2d, 0x06, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x03, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
+   0x00, 0x80, 0xff, 0x7c, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x1b,
+   0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0x7c, 0xfc, 0x3f,
+   0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00,
+   0x80, 0x00, 0x00, 0xc0, 0x70, 0xfc, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x18,
+   0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0x30,
+   0x1c, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0x30, 0x1c, 0x00, 0x03, 0x00, 0x00,
+   0x00, 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
+   0xfc, 0x31, 0x14, 0x00, 0x06, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0c, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xfe, 0x33, 0x1c, 0x00, 0x1c,
+   0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+   0x00, 0x00, 0x83, 0x37, 0x0c, 0x00, 0x18, 0x00, 0x00, 0x60, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x81, 0x2f, 0x0c,
+   0x00, 0x30, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x40, 0x00, 0x00, 0x01, 0x2a, 0x0e, 0x00, 0x30, 0x00, 0x00, 0x30,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7e, 0x80, 0x01,
+   0x20, 0x0c, 0x00, 0x30, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x40, 0xfe, 0x83, 0x01, 0x28, 0x0c, 0x00, 0x30, 0x00,
+   0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03,
+   0x8f, 0x01, 0x28, 0x0e, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xb8, 0x01, 0x38, 0x0e, 0x00,
+   0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc0, 0x00, 0xf0, 0x01, 0x18, 0x0e, 0x00, 0x0c, 0x00, 0x00, 0x04, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xc0, 0x01, 0x30,
+   0x06, 0x00, 0xfe, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x60, 0x00, 0x80, 0x01, 0x18, 0x06, 0xc0, 0x3f, 0xfe, 0x00,
+   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x80,
+   0x01, 0x18, 0x06, 0xc0, 0x01, 0xc0, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x03, 0x18, 0x0e, 0x80, 0x00,
+   0x00, 0x0e, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+   0x00, 0x00, 0x03, 0x18, 0x06, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x18, 0x06,
+   0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x30, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
+   0x0c, 0x06, 0x00, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x07, 0x00, 0x00, 0x00,
+   0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x0c, 0x0c, 0x06, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bat-3.xbm b/bitmaps/bat-3.xbm
new file mode 100644 (file)
index 0000000..bfe7265
--- /dev/null
@@ -0,0 +1,174 @@
+#define bat3_width 147
+#define bat3_height 108
+static unsigned char bat3_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x66, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x87, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x38, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x27, 0x06, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x60, 0x34, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xdc, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x30, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x34,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x60, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x9c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x64, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x10, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x14, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0c, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x04, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x04, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+   0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+   0x70, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x00, 0x80, 0x00, 0x00,
+   0x80, 0x00, 0x89, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x02, 0x80, 0x03, 0x70, 0x01, 0x00, 0x40, 0x00, 0x09, 0x03, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0xc0,
+   0x01, 0x00, 0x20, 0x80, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x02, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x18, 0x80, 0x10,
+   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+   0x70, 0x00, 0x01, 0x02, 0x0c, 0x00, 0x21, 0x0c, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xe0, 0x00, 0x03, 0x03, 0x02,
+   0x40, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+   0x01, 0x00, 0x80, 0x03, 0xe2, 0x03, 0x01, 0x00, 0x40, 0x10, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x06, 0xf3,
+   0xc0, 0x00, 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x40, 0x00, 0x00, 0xf0, 0xff, 0x60, 0x00, 0xa0, 0x00, 0x60,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+   0xf8, 0xbf, 0x19, 0x00, 0x20, 0x00, 0x82, 0x01, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x70, 0x0c, 0x8f, 0x05, 0x00, 0x90,
+   0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
+   0x00, 0xfc, 0x6f, 0x9a, 0x01, 0x00, 0x10, 0x00, 0x08, 0x06, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x06, 0x6c, 0x93, 0x01,
+   0x00, 0x00, 0x00, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x10, 0x00, 0x00, 0x06, 0xf8, 0xc7, 0x00, 0x00, 0x08, 0x00, 0x40, 0x38,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0xf8,
+   0x7f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0xf0, 0x9e, 0x1f, 0x00, 0x44, 0x00,
+   0x00, 0x82, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xe0,
+   0x06, 0x50, 0x1e, 0x38, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0xf8, 0x07, 0x50, 0x0a, 0x60, 0x00,
+   0x02, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+   0x00, 0x4c, 0x07, 0x50, 0x0a, 0xc0, 0x00, 0x41, 0x00, 0x00, 0xfc, 0x0f,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x79, 0x00, 0x04, 0x0e, 0x50, 0x0a,
+   0x80, 0x00, 0x00, 0x00, 0x80, 0x17, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc0, 0xff, 0x01, 0x06, 0x00, 0x58, 0x0a, 0x80, 0x81, 0x40, 0x00, 0xe0,
+   0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x03, 0x06, 0x00,
+   0x50, 0x0a, 0x00, 0x81, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x40, 0x00, 0x06, 0x03, 0x00, 0x70, 0x0a, 0x00, 0x43, 0x00,
+   0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+   0x03, 0x00, 0x28, 0x0a, 0x00, 0x23, 0x20, 0x80, 0x03, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x03, 0x00, 0x38, 0x0e, 0x00,
+   0x23, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x30, 0x01, 0x00, 0x28, 0x06, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x38,
+   0x06, 0x00, 0x03, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x38, 0x06, 0x00, 0x03, 0x00, 0x18,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
+   0x00, 0x38, 0x06, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x38, 0x06, 0x00, 0x01,
+   0x10, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x03, 0x00, 0x18, 0x07, 0x80, 0xff, 0x00, 0x03, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x18, 0x07,
+   0x00, 0xc3, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x03, 0x00, 0x18, 0x03, 0x00, 0x00, 0xd1, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
+   0x18, 0x03, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x18, 0x03, 0x00, 0x00, 0x66,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x06, 0x00, 0x18, 0x03, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x18, 0x03, 0x00,
+   0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x08, 0x03, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bat-4.xbm b/bitmaps/bat-4.xbm
new file mode 100644 (file)
index 0000000..f8de033
--- /dev/null
@@ -0,0 +1,174 @@
+#define bat4_width 147
+#define bat4_height 108
+static unsigned char bat4_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x7c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xc1, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x67, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x31,
+   0x8c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x18, 0x98, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x60, 0x0c, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x06, 0x9c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x10, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x83, 0xff,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x0c, 0x83, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84,
+   0xc1, 0xc4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x41, 0x84, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x83, 0x80, 0x06, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x80, 0x04, 0x36,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x41, 0x80, 0x04, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x60, 0x80,
+   0x05, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x00, 0x05, 0x90, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+   0x30, 0x00, 0x08, 0x10, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x30, 0x38,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x18, 0x10, 0x00, 0x00, 0x20, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00,
+   0x60, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x04, 0x18, 0x00, 0x00, 0x40, 0x00, 0x1e, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c,
+   0x00, 0x00, 0xc0, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x08, 0x00, 0x00, 0x80, 0x00, 0x00,
+   0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+   0x01, 0x0c, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x00, 0x80,
+   0x01, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x20, 0x00, 0x0c, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x07,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0c, 0x00,
+   0x00, 0x00, 0x01, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+   0x5f, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
+   0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01,
+   0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x04, 0x00, 0x00,
+   0x80, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x30, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08,
+   0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80, 0x00, 0x80,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
+   0x00, 0x08, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0xc0,
+   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+   0xff, 0x07, 0x00, 0x18, 0x00, 0x00, 0x40, 0x00, 0x60, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x1e, 0x00, 0x10, 0x00,
+   0x00, 0x60, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x38, 0x00, 0x70, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, 0x30, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00,
+   0x30, 0xc0, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x20, 0xa0, 0x01, 0x10, 0x02,
+   0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x80, 0x01, 0x20, 0x00, 0x01, 0x19, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x60, 0x00, 0x81,
+   0x0b, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0xc2, 0x0d, 0x00, 0x10, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xc0,
+   0x00, 0xf2, 0x06, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0xe1, 0x7f, 0x03, 0x00, 0x10,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x04, 0x00, 0xb3, 0xff, 0x01, 0xe0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x3e, 0xff, 0x38,
+   0xfd, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x6c, 0x87, 0xff, 0x0f, 0x3e, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08,
+   0x97, 0x83, 0x07, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0xbb, 0x80, 0x03, 0x70, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+   0xc0, 0x99, 0xe7, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xf0, 0xf0, 0x7f, 0x00, 0x00,
+   0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x10, 0x18, 0xe0, 0x1c, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0c, 0xa0, 0x1c,
+   0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x30, 0x0c, 0xe0, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08,
+   0xc0, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x1f, 0xc0, 0x14, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xe0, 0x1f, 0xc0, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0xc0, 0x14, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x60, 0x30, 0xc0, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0xc0,
+   0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xc0, 0x14, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+   0x00, 0xc0, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xc0, 0x14, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x60, 0x00, 0xc0, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0x1c,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x60, 0x00, 0xc0, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
+   0x80, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x80, 0x18, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x60, 0x00, 0x80, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x80, 0x18, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x80, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+   0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bounce-0.xbm b/bitmaps/bounce-0.xbm
new file mode 100644 (file)
index 0000000..b20b404
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounce0_width 64
+#define bounce0_height 64
+static unsigned char bounce0_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x78, 0x1e, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0x7f, 0xfe, 0x31, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x7f,
+   0xfe, 0xcf, 0x00, 0x00, 0x00, 0x80, 0xfc, 0x7f, 0xfe, 0x3f, 0x01, 0x00,
+   0x00, 0x60, 0xff, 0x3f, 0xfc, 0xff, 0x06, 0x00, 0x00, 0x90, 0xff, 0x1f,
+   0xf8, 0xff, 0x09, 0x00, 0x00, 0xc8, 0xff, 0x07, 0xe0, 0xff, 0x13, 0x00,
+   0x00, 0xe4, 0xff, 0x03, 0xc0, 0xff, 0x27, 0x00, 0x00, 0xf2, 0xff, 0x01,
+   0x80, 0xff, 0x4f, 0x00, 0x00, 0xe1, 0x7f, 0x00, 0x00, 0xfe, 0x87, 0x00,
+   0x80, 0xc0, 0x1f, 0x00, 0x00, 0xf8, 0x03, 0x01, 0x40, 0x80, 0x01, 0x00,
+   0x00, 0x80, 0x01, 0x02, 0x40, 0x00, 0x78, 0x00, 0x00, 0x1e, 0x00, 0x02,
+   0x20, 0x80, 0x7f, 0x00, 0x00, 0xfe, 0x01, 0x04, 0x10, 0xc0, 0xff, 0x00,
+   0x00, 0xff, 0x03, 0x08, 0x10, 0xe0, 0xff, 0x00, 0x00, 0xff, 0x07, 0x08,
+   0x08, 0xe0, 0xff, 0x00, 0x00, 0xff, 0x07, 0x10, 0x08, 0xf0, 0xff, 0x01,
+   0x80, 0xff, 0x0f, 0x10, 0x04, 0xf0, 0xff, 0x01, 0x80, 0xff, 0x0f, 0x20,
+   0x04, 0xf8, 0xff, 0x03, 0xc0, 0xff, 0x1f, 0x20, 0x04, 0xf8, 0xff, 0x03,
+   0xc0, 0xff, 0x1f, 0x20, 0x02, 0xfc, 0xff, 0xf9, 0x9f, 0xff, 0x3f, 0x40,
+   0x02, 0xfc, 0xff, 0xfc, 0x3f, 0xff, 0x3f, 0x40, 0xfa, 0xfc, 0xff, 0xfe,
+   0x7f, 0xff, 0x3f, 0x5f, 0xfa, 0xfc, 0x7f, 0xfe, 0x7f, 0xfe, 0x3f, 0x5f,
+   0xfd, 0xfd, 0x7f, 0xff, 0xff, 0xfe, 0xbf, 0xbf, 0xfd, 0xf9, 0x3f, 0xff,
+   0xff, 0xfc, 0x9f, 0xbf, 0xfd, 0xf9, 0xbf, 0xff, 0xff, 0xfd, 0x9f, 0xbf,
+   0xfd, 0xfb, 0x9f, 0xff, 0xff, 0xf9, 0xdf, 0xbf, 0xfd, 0xfb, 0x9f, 0xff,
+   0xff, 0xf9, 0xdf, 0xbf, 0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf,
+   0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf, 0xfd, 0x03, 0xc0, 0xff,
+   0xff, 0x03, 0xc0, 0xbf, 0xfd, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xbf,
+   0xfd, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xbf, 0xfa, 0x03, 0x80, 0xff,
+   0xff, 0x01, 0xc0, 0x5f, 0xfa, 0x03, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x5f,
+   0xfa, 0x03, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x5f, 0xfa, 0x03, 0x00, 0xfe,
+   0x7f, 0x00, 0xc0, 0x5f, 0xf4, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x80, 0x2f,
+   0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0xf4, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x2f, 0xe8, 0x01, 0x00, 0xfc, 0x3f, 0x00, 0x80, 0x17,
+   0xe8, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x80, 0x17, 0xd0, 0x00, 0x00, 0xff,
+   0xff, 0x00, 0x00, 0x0b, 0x10, 0x3e, 0x80, 0xff, 0xff, 0x01, 0x7c, 0x08,
+   0x20, 0xff, 0x81, 0xff, 0xff, 0x81, 0xff, 0x04, 0x40, 0xff, 0xcf, 0xff,
+   0xff, 0xf3, 0xff, 0x02, 0x40, 0xfe, 0xcf, 0xff, 0xff, 0xf3, 0x7f, 0x02,
+   0x80, 0xfe, 0x9f, 0xff, 0xff, 0xf9, 0x7f, 0x01, 0x00, 0xfd, 0x3f, 0xff,
+   0xff, 0xfc, 0xbf, 0x00, 0x00, 0xfa, 0x7f, 0xfe, 0x7f, 0xfe, 0x5f, 0x00,
+   0x00, 0xf4, 0x7f, 0xfe, 0x7f, 0xfe, 0x2f, 0x00, 0x00, 0xc8, 0xff, 0xfc,
+   0x3f, 0xff, 0x13, 0x00, 0x00, 0x90, 0xff, 0x01, 0x80, 0xff, 0x09, 0x00,
+   0x00, 0x60, 0xff, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0x80, 0xfc, 0x00,
+   0x00, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0xce, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00,
+   0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bounce-1.xbm b/bitmaps/bounce-1.xbm
new file mode 100644 (file)
index 0000000..1a0ff30
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounce1_width 64
+#define bounce1_height 64
+static unsigned char bounce1_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0x1f, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0xff, 0x7f, 0x30, 0x00, 0x00, 0x00, 0x00, 0xf3, 0xff,
+   0x7f, 0xc0, 0x00, 0x00, 0x00, 0x80, 0xfc, 0xff, 0x7f, 0x00, 0x01, 0x00,
+   0x00, 0x60, 0xfe, 0xff, 0x7f, 0x00, 0x06, 0x00, 0x00, 0x10, 0xfe, 0xff,
+   0x7f, 0x00, 0x08, 0x00, 0x00, 0xc8, 0xfc, 0xff, 0x1f, 0x00, 0x10, 0x00,
+   0x00, 0xf4, 0x81, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0xfa, 0x01, 0x00,
+   0xf0, 0x01, 0x40, 0x00, 0x00, 0xfd, 0x01, 0x00, 0xff, 0x07, 0x80, 0x00,
+   0x80, 0xfe, 0x01, 0x00, 0xff, 0x1f, 0x20, 0x01, 0x40, 0xfe, 0x01, 0x00,
+   0xff, 0x7f, 0x70, 0x02, 0x40, 0xff, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x02,
+   0xa0, 0xff, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x05, 0xd0, 0xff, 0x00, 0x00,
+   0xff, 0xff, 0xfd, 0x0b, 0xd0, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x0b,
+   0xe8, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x17, 0xe8, 0x7f, 0x00, 0x00,
+   0xff, 0xff, 0xfb, 0x17, 0xf4, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x2f,
+   0xf4, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xf3, 0x2f, 0xf4, 0x67, 0x00, 0xe0,
+   0xf0, 0xff, 0xf3, 0x2f, 0xe2, 0xf1, 0x01, 0xfc, 0xc7, 0xff, 0xe0, 0x5f,
+   0x82, 0xf8, 0x03, 0xff, 0x1f, 0x1f, 0xe0, 0x5f, 0x02, 0xfe, 0xc7, 0xff,
+   0x7f, 0x06, 0xc0, 0x5f, 0x02, 0xff, 0xcf, 0xff, 0xff, 0x00, 0x80, 0x5f,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbf, 0x01, 0xff, 0xcf, 0xff,
+   0xff, 0x01, 0x00, 0xbf, 0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbe,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbc, 0x01, 0xff, 0xcf, 0xff,
+   0xff, 0x01, 0x00, 0x80, 0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0x80,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbc, 0x01, 0xff, 0xcf, 0xff,
+   0xff, 0x01, 0x00, 0xbe, 0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbf,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbf, 0x02, 0xff, 0xcf, 0xff,
+   0xff, 0x00, 0x80, 0x5f, 0x02, 0xfe, 0xc7, 0xff, 0x7f, 0x06, 0xc0, 0x5f,
+   0x82, 0xf8, 0x03, 0xff, 0x1f, 0x1f, 0xe0, 0x5f, 0xe2, 0xf1, 0x01, 0xfc,
+   0xc7, 0xff, 0xe0, 0x5f, 0xf4, 0x67, 0x00, 0xe0, 0xf0, 0xff, 0xf3, 0x2f,
+   0xf4, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xf3, 0x2f, 0xf4, 0x1f, 0x00, 0x00,
+   0xff, 0xff, 0xfb, 0x2f, 0xe8, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x17,
+   0xe8, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x17, 0xd0, 0x7f, 0x00, 0x00,
+   0xff, 0xff, 0xf9, 0x0b, 0xd0, 0xff, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x0b,
+   0xa0, 0xff, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x05, 0x40, 0xff, 0x00, 0x00,
+   0xff, 0xff, 0xf8, 0x02, 0x40, 0xfe, 0x01, 0x00, 0xff, 0x7f, 0x70, 0x02,
+   0x80, 0xfe, 0x01, 0x00, 0xff, 0x1f, 0x20, 0x01, 0x00, 0xfd, 0x01, 0x00,
+   0xff, 0x07, 0x80, 0x00, 0x00, 0xfa, 0x01, 0x00, 0xf0, 0x01, 0x40, 0x00,
+   0x00, 0xf4, 0x81, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0xc8, 0xfc, 0xff,
+   0x1f, 0x00, 0x10, 0x00, 0x00, 0x10, 0xfe, 0xff, 0x7f, 0x00, 0x08, 0x00,
+   0x00, 0x60, 0xfe, 0xff, 0x7f, 0x00, 0x06, 0x00, 0x00, 0x80, 0xfc, 0xff,
+   0x7f, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf3, 0xff, 0x7f, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0xff, 0x7f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8,
+   0x1f, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bounce-2.xbm b/bitmaps/bounce-2.xbm
new file mode 100644 (file)
index 0000000..9af0c72
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounce2_width 64
+#define bounce2_height 64
+static unsigned char bounce2_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00,
+   0x00, 0xce, 0x00, 0x00, 0x00, 0x80, 0xfc, 0x00, 0x00, 0x3f, 0x01, 0x00,
+   0x00, 0x60, 0xff, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0x90, 0xff, 0x01,
+   0x80, 0xff, 0x09, 0x00, 0x00, 0xc8, 0xff, 0xfc, 0x3f, 0xff, 0x13, 0x00,
+   0x00, 0xf4, 0x7f, 0xfe, 0x7f, 0xfe, 0x2f, 0x00, 0x00, 0xfa, 0x7f, 0xfe,
+   0x7f, 0xfe, 0x5f, 0x00, 0x00, 0xfd, 0x3f, 0xff, 0xff, 0xfc, 0xbf, 0x00,
+   0x80, 0xfe, 0x9f, 0xff, 0xff, 0xf9, 0x7f, 0x01, 0x40, 0xfe, 0xcf, 0xff,
+   0xff, 0xf3, 0x7f, 0x02, 0x40, 0xff, 0xcf, 0xff, 0xff, 0xf3, 0xff, 0x02,
+   0x20, 0xff, 0x81, 0xff, 0xff, 0x81, 0xff, 0x04, 0x10, 0x3e, 0x80, 0xff,
+   0xff, 0x01, 0x7c, 0x08, 0xd0, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x0b,
+   0xe8, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x80, 0x17, 0xe8, 0x01, 0x00, 0xfc,
+   0x3f, 0x00, 0x80, 0x17, 0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f,
+   0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0xf4, 0x01, 0x00, 0xfe,
+   0x7f, 0x00, 0x80, 0x2f, 0xfa, 0x03, 0x00, 0xfe, 0x7f, 0x00, 0xc0, 0x5f,
+   0xfa, 0x03, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x5f, 0xfa, 0x03, 0x00, 0xff,
+   0xff, 0x00, 0xc0, 0x5f, 0xfa, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0x5f,
+   0xfd, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xbf, 0xfd, 0x03, 0x80, 0xff,
+   0xff, 0x01, 0xc0, 0xbf, 0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf,
+   0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf, 0xfd, 0x03, 0xc0, 0xff,
+   0xff, 0x03, 0xc0, 0xbf, 0xfd, 0xfb, 0x9f, 0xff, 0xff, 0xf9, 0xdf, 0xbf,
+   0xfd, 0xfb, 0x9f, 0xff, 0xff, 0xf9, 0xdf, 0xbf, 0xfd, 0xf9, 0xbf, 0xff,
+   0xff, 0xfd, 0x9f, 0xbf, 0xfd, 0xf9, 0x3f, 0xff, 0xff, 0xfc, 0x9f, 0xbf,
+   0xfd, 0xfd, 0x7f, 0xff, 0xff, 0xfe, 0xbf, 0xbf, 0xfa, 0xfc, 0x7f, 0xfe,
+   0x7f, 0xfe, 0x3f, 0x5f, 0xfa, 0xfc, 0xff, 0xfe, 0x7f, 0xff, 0x3f, 0x5f,
+   0x02, 0xfc, 0xff, 0xfc, 0x3f, 0xff, 0x3f, 0x40, 0x02, 0xfc, 0xff, 0xf9,
+   0x9f, 0xff, 0x3f, 0x40, 0x04, 0xf8, 0xff, 0x03, 0xc0, 0xff, 0x1f, 0x20,
+   0x04, 0xf8, 0xff, 0x03, 0xc0, 0xff, 0x1f, 0x20, 0x04, 0xf0, 0xff, 0x01,
+   0x80, 0xff, 0x0f, 0x20, 0x08, 0xf0, 0xff, 0x01, 0x80, 0xff, 0x0f, 0x10,
+   0x08, 0xe0, 0xff, 0x00, 0x00, 0xff, 0x07, 0x10, 0x10, 0xe0, 0xff, 0x00,
+   0x00, 0xff, 0x07, 0x08, 0x10, 0xc0, 0xff, 0x00, 0x00, 0xff, 0x03, 0x08,
+   0x20, 0x80, 0x7f, 0x00, 0x00, 0xfe, 0x01, 0x04, 0x40, 0x00, 0x78, 0x00,
+   0x00, 0x1e, 0x00, 0x02, 0x40, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x02,
+   0x80, 0xc0, 0x1f, 0x00, 0x00, 0xf8, 0x03, 0x01, 0x00, 0xe1, 0x7f, 0x00,
+   0x00, 0xfe, 0x87, 0x00, 0x00, 0xf2, 0xff, 0x01, 0x80, 0xff, 0x4f, 0x00,
+   0x00, 0xe4, 0xff, 0x03, 0xc0, 0xff, 0x27, 0x00, 0x00, 0xc8, 0xff, 0x07,
+   0xe0, 0xff, 0x13, 0x00, 0x00, 0x90, 0xff, 0x1f, 0xf8, 0xff, 0x09, 0x00,
+   0x00, 0x60, 0xff, 0x3f, 0xfc, 0xff, 0x06, 0x00, 0x00, 0x80, 0xfc, 0x7f,
+   0xfe, 0x3f, 0x01, 0x00, 0x00, 0x00, 0xf3, 0x7f, 0xfe, 0xcf, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0x7f, 0xfe, 0x31, 0x00, 0x00, 0x00, 0x00, 0x70, 0x78,
+   0x1e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bounce-3.xbm b/bitmaps/bounce-3.xbm
new file mode 100644 (file)
index 0000000..59c0c7a
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounce3_width 64
+#define bounce3_height 64
+static unsigned char bounce3_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0x1f, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0xfe, 0xff, 0x31, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe,
+   0xff, 0xcf, 0x00, 0x00, 0x00, 0x80, 0x00, 0xfe, 0xff, 0x3f, 0x01, 0x00,
+   0x00, 0x60, 0x00, 0xfe, 0xff, 0x7f, 0x06, 0x00, 0x00, 0x10, 0x00, 0xfe,
+   0xff, 0x7f, 0x08, 0x00, 0x00, 0x08, 0x00, 0xf8, 0xff, 0x3f, 0x13, 0x00,
+   0x00, 0x04, 0x00, 0xc0, 0xff, 0x81, 0x2f, 0x00, 0x00, 0x02, 0x80, 0x0f,
+   0x00, 0x80, 0x5f, 0x00, 0x00, 0x01, 0xe0, 0xff, 0x00, 0x80, 0xbf, 0x00,
+   0x80, 0x04, 0xf8, 0xff, 0x00, 0x80, 0x7f, 0x01, 0x40, 0x0e, 0xfe, 0xff,
+   0x00, 0x80, 0x7f, 0x02, 0x40, 0x1f, 0xff, 0xff, 0x00, 0x00, 0xff, 0x02,
+   0xa0, 0xbf, 0xff, 0xff, 0x00, 0x00, 0xff, 0x05, 0xd0, 0xbf, 0xff, 0xff,
+   0x00, 0x00, 0xff, 0x0b, 0xd0, 0x9f, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x0b,
+   0xe8, 0x9f, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x17, 0xe8, 0xdf, 0xff, 0xff,
+   0x00, 0x00, 0xfe, 0x17, 0xf4, 0xdf, 0xff, 0xff, 0x00, 0x00, 0xf8, 0x2f,
+   0xf4, 0xcf, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0x2f, 0xf4, 0xcf, 0xff, 0x0f,
+   0x07, 0x00, 0xe6, 0x2f, 0xfa, 0x07, 0xff, 0xe3, 0x3f, 0x80, 0x8f, 0x47,
+   0xfa, 0x07, 0xf8, 0xf8, 0xff, 0xc0, 0x1f, 0x41, 0xfa, 0x03, 0x60, 0xfe,
+   0xff, 0xe3, 0x7f, 0x40, 0xfa, 0x01, 0x00, 0xff, 0xff, 0xf3, 0xff, 0x40,
+   0xfd, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0xfd, 0x00, 0x80, 0xff,
+   0xff, 0xf3, 0xff, 0x80, 0x7d, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80,
+   0x3d, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0x01, 0x00, 0x80, 0xff,
+   0xff, 0xf3, 0xff, 0x80, 0x01, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80,
+   0x3d, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0x7d, 0x00, 0x80, 0xff,
+   0xff, 0xf3, 0xff, 0x80, 0xfd, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80,
+   0xfd, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0xfa, 0x01, 0x00, 0xff,
+   0xff, 0xf3, 0xff, 0x40, 0xfa, 0x03, 0x60, 0xfe, 0xff, 0xe3, 0x7f, 0x40,
+   0xfa, 0x07, 0xf8, 0xf8, 0xff, 0xc0, 0x1f, 0x41, 0xfa, 0x07, 0xff, 0xe3,
+   0x3f, 0x80, 0x8f, 0x47, 0xf4, 0xcf, 0xff, 0x0f, 0x07, 0x00, 0xe6, 0x2f,
+   0xf4, 0xcf, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0x2f, 0xf4, 0xdf, 0xff, 0xff,
+   0x00, 0x00, 0xf8, 0x2f, 0xe8, 0xdf, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x17,
+   0xe8, 0x9f, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x17, 0xd0, 0x9f, 0xff, 0xff,
+   0x00, 0x00, 0xfe, 0x0b, 0xd0, 0xbf, 0xff, 0xff, 0x00, 0x00, 0xff, 0x0b,
+   0xa0, 0xbf, 0xff, 0xff, 0x00, 0x00, 0xff, 0x05, 0x40, 0x1f, 0xff, 0xff,
+   0x00, 0x00, 0xff, 0x02, 0x40, 0x0e, 0xfe, 0xff, 0x00, 0x80, 0x7f, 0x02,
+   0x80, 0x04, 0xf8, 0xff, 0x00, 0x80, 0x7f, 0x01, 0x00, 0x01, 0xe0, 0xff,
+   0x00, 0x80, 0xbf, 0x00, 0x00, 0x02, 0x80, 0x0f, 0x00, 0x80, 0x5f, 0x00,
+   0x00, 0x04, 0x00, 0xc0, 0xff, 0x81, 0x2f, 0x00, 0x00, 0x08, 0x00, 0xf8,
+   0xff, 0x3f, 0x13, 0x00, 0x00, 0x10, 0x00, 0xfe, 0xff, 0x7f, 0x08, 0x00,
+   0x00, 0x60, 0x00, 0xfe, 0xff, 0x7f, 0x06, 0x00, 0x00, 0x80, 0x00, 0xfe,
+   0xff, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xcf, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0xfe, 0xff, 0x31, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8,
+   0x1f, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/bounce-mask.xbm b/bitmaps/bounce-mask.xbm
new file mode 100644 (file)
index 0000000..73996f0
--- /dev/null
@@ -0,0 +1,46 @@
+#define bouncemask_width 64
+#define bouncemask_height 64
+static unsigned char bouncemask_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+   0x00, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+   0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
+   0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
+   0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0xff, 0xff,
+   0xff, 0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+   0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+   0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+   0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
+   0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0xff, 0xff,
+   0xff, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00,
+   0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x80, 0xff, 0xff,
+   0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/cooperat.xbm b/bitmaps/cooperat.xbm
new file mode 100644 (file)
index 0000000..6f15e15
--- /dev/null
@@ -0,0 +1,9 @@
+#define cooperat_width 21
+#define cooperat_height 21
+static unsigned char cooperat_bits[] = {
+   0x80, 0x1f, 0x00, 0x60, 0x60, 0x00, 0x10, 0x80, 0x00, 0x08, 0x00, 0x01,
+   0x04, 0x00, 0x02, 0xc2, 0x30, 0x04, 0xc2, 0x30, 0x04, 0x01, 0x00, 0x08,
+   0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x21, 0x40, 0x08, 0x21, 0x40, 0x08,
+   0x41, 0x20, 0x08, 0x82, 0x10, 0x04, 0x02, 0x0f, 0x04, 0x04, 0x00, 0x02,
+   0x08, 0x00, 0x01, 0x10, 0x80, 0x00, 0x60, 0x60, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x00, 0x00};
diff --git a/bitmaps/cross_weave.xbm b/bitmaps/cross_weave.xbm
new file mode 100644 (file)
index 0000000..45ffbb4
--- /dev/null
@@ -0,0 +1,6 @@
+#define cross_weave_width 16
+#define cross_weave_height 16
+static unsigned char cross_weave_bits[] = {
+   0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22, 0x55, 0x55, 0x88, 0x88,
+   0x55, 0x55, 0x22, 0x22, 0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22,
+   0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22};
diff --git a/bitmaps/defect.xbm b/bitmaps/defect.xbm
new file mode 100644 (file)
index 0000000..3456772
--- /dev/null
@@ -0,0 +1,9 @@
+#define defect_width 21
+#define defect_height 21
+static unsigned char defect_bits[] = {
+   0x80, 0x1f, 0x00, 0x60, 0x60, 0x00, 0x10, 0x80, 0x00, 0x08, 0x00, 0x01,
+   0x04, 0x00, 0x02, 0x82, 0x10, 0x04, 0x42, 0x29, 0x04, 0x81, 0x10, 0x08,
+   0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0x08,
+   0xe1, 0x7f, 0x08, 0xe2, 0x7f, 0x04, 0x02, 0x00, 0x04, 0x04, 0x00, 0x02,
+   0x08, 0x00, 0x01, 0x10, 0x80, 0x00, 0x60, 0x60, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x00, 0x00};
diff --git a/bitmaps/dimple1.xbm b/bitmaps/dimple1.xbm
new file mode 100644 (file)
index 0000000..c1a36e5
--- /dev/null
@@ -0,0 +1,6 @@
+#define dimple1_width 16
+#define dimple1_height 16
+static unsigned char dimple1_bits[] = {
+   0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
+   0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
+   0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00};
diff --git a/bitmaps/dimple3.xbm b/bitmaps/dimple3.xbm
new file mode 100644 (file)
index 0000000..25eb294
--- /dev/null
@@ -0,0 +1,6 @@
+#define dimple3_width 16
+#define dimple3_height 16
+static unsigned char dimple3_bits[] = {
+   0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/donkey.xbm b/bitmaps/donkey.xbm
new file mode 100644 (file)
index 0000000..d2d40a6
--- /dev/null
@@ -0,0 +1,9 @@
+#define donkey_width 21
+#define donkey_height 21
+static unsigned char donkey_bits[] = {
+   0x44, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x6c, 0x00, 0x00,
+   0x28, 0x00, 0x00, 0x38, 0x00, 0x00, 0x74, 0x00, 0x00, 0xfe, 0x00, 0x00,
+   0xef, 0xff, 0x00, 0xc2, 0xff, 0x01, 0xc0, 0xff, 0x01, 0x80, 0xff, 0x02,
+   0x80, 0xff, 0x02, 0x80, 0xa2, 0x04, 0x80, 0x42, 0x05, 0x80, 0x42, 0x01,
+   0x80, 0xa2, 0x00, 0x80, 0xa2, 0x00, 0x80, 0xa2, 0x00, 0x80, 0x20, 0x00,
+   0x00, 0x00, 0x00};
diff --git a/bitmaps/earth.xbm b/bitmaps/earth.xbm
new file mode 100644 (file)
index 0000000..9545ad5
--- /dev/null
@@ -0,0 +1,2192 @@
+/* The surface of the earth.  Created with:
+   xearth -proj mercator -noshade -ppm \
+     | ppmtopgm | pgmtopbm -thresh | pbmtoxbm
+ */
+#define earth_width 512
+#define earth_height 512
+static unsigned char earth_bits[] = {
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0xfc,0x00,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0xfc,0x00,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0x07,0xfc,0x01,0xc2,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xff,0x3f,0xff,0xdf,0x3f,0x00,0x7e,0x00,
+ 0xc0,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xfe,0x1f,0xfe,0xff,
+ 0x3f,0x00,0x1e,0x00,0xc0,0x01,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0xfe,0x1f,0xfc,0xff,0x3f,0x00,0x3f,0x00,0xc0,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0xfe,0x1f,0xfc,0xff,0x37,0x00,0x3f,0x00,0x80,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0x7f,0xff,0x1f,0xfc,0xff,0x03,0x00,0x7f,
+ 0x00,0x80,0x00,0xe2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0x1f,0xfc,
+ 0xff,0x03,0x00,0x8f,0x03,0x80,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0xf0,0xff,0x1f,0xfc,0xff,0x03,0x00,0x0f,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0xc0,0xff,0x3f,0xf8,0xff,0x07,0x00,0x0f,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0xc0,0x3f,0xe0,0xff,0x0f,0xf8,0xff,0x03,0x00,
+ 0xff,0x0c,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xc0,0x1f,0xf0,0xff,0x03,
+ 0xf0,0xff,0x01,0x00,0x3f,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xc0,
+ 0x1f,0xf8,0xff,0x07,0xf0,0xff,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0xe0,0x3f,0xf8,0xff,0x07,0xf0,0xff,0x03,0x00,0x7e,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xe0,0x7f,0xfc,0xff,0x3f,0xf0,0xff,0x07,
+ 0x00,0xfe,0x01,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xf0,0xff,0xff,0xff,
+ 0x3f,0x70,0xff,0x0f,0x00,0xf3,0x07,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0xf0,0xff,0xff,0xff,0x7f,0x78,0xfc,0x1f,0x00,0xe3,0x0f,0x0e,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x40,0xf0,0xff,0xff,0xef,0x7f,0x38,0xfc,0x30,0x80,0xc3,0x0f,
+ 0x03,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x60,0xfc,0xff,0xff,0xef,0x7f,0x38,0xfc,
+ 0x00,0x80,0xc1,0xfd,0x03,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x70,0xfe,0xff,0xff,
+ 0xef,0x7f,0x38,0xf8,0x00,0x80,0xc1,0x70,0x06,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0xf8,0xff,0xff,0xff,0xef,0xff,0x3c,0xf8,0x00,0x80,0x41,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0xfc,0xff,0xff,0xff,0xef,0xff,0x3f,0xf8,0x00,0x80,0x41,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x87,0xff,0xff,0xff,0xff,0x3f,
+ 0xfc,0x00,0x80,0x41,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcf,0x81,0xff,
+ 0xf9,0xff,0xff,0x3f,0xfc,0x00,0xc0,0x41,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xe7,0x01,0xfe,0xf8,0xff,0xff,0xff,0x7f,0x00,0xf1,0x40,0x00,0x00,0x00,
+ 0x06,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xe7,0x03,0x7e,0xf8,0xff,0xff,0xff,0xff,0x00,0xff,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x7c,0xf8,0xff,0xff,
+ 0x7f,0xfe,0x80,0xff,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x7c,0xfc,0xff,0xff,0x3f,0xfc,0xcf,0x41,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x7c,0xfc,0xf7,0xff,0x7f,0xf8,0xff,0xc0,0x01,0x00,0x00,
+ 0x80,0xff,0xd9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x7c,0xfc,0xf7,0xff,0xff,0xff,0x7f,
+ 0x80,0x03,0x00,0x00,0xf8,0xff,0x08,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x78,0xf8,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xc0,0xff,0x7f,0x08,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x78,0xf8,0xe3,0xf3,0xf7,0xff,0xff,0x07,0x00,0x0c,0xf3,0x7f,0x27,0x08,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0d,0x00,0xc0,0x67,0xe3,0xc3,0xbf,0xff,0x07,0x80,0x39,
+ 0xf7,0x0f,0x00,0x08,0x36,0x1f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xc0,0x7f,0xc3,0xc3,0xbf,
+ 0xc7,0x03,0x80,0xf7,0xff,0x07,0x00,0x00,0x16,0x3f,0xbc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xf0,0xff,0xff,0x01,0xc0,
+ 0x7f,0x82,0x83,0xff,0xc7,0x01,0x00,0xfe,0xff,0x07,0x00,0x00,0x1c,0x4b,0x1c,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xf0,
+ 0xff,0x0f,0x00,0xe0,0x3f,0xc0,0x83,0xff,0xc7,0x00,0x00,0xfc,0xff,0x07,0x00,
+ 0x00,0x08,0x8b,0x0c,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0xe0,0xff,0x03,0x00,0xe0,0x0f,0xc0,0x87,0xff,0xc7,0x08,0x00,
+ 0xf8,0xff,0x1f,0x00,0x00,0x00,0x8b,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xc0,0xff,0x07,0x70,0x70,0x0f,0xc0,0x07,
+ 0xfe,0x84,0x05,0x00,0xfc,0xff,0x0f,0x00,0x00,0x00,0x0f,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0xf8,0x07,0xfe,
+ 0x3f,0xff,0xe1,0x1f,0x2c,0x00,0x01,0x00,0xff,0xff,0x07,0x00,0x00,0x00,0x03,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xe0,0x3f,0x1c,0x00,0x00,0x00,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0xf0,0xff,0xff,0xff,0x3f,0xe0,0x3f,0x38,0x00,0x10,
+ 0xc8,0xff,0xef,0x01,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xe0,0xff,0xff,0xff,0x3f,0xf0,
+ 0x3f,0x78,0x00,0x18,0xfc,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xe0,0xff,
+ 0xff,0xff,0x3f,0xf8,0x3e,0xfe,0x01,0x30,0xfe,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0xe0,0xff,0xff,0xff,0xff,0x3f,0x3c,0xfe,0x03,0xc0,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0xc0,0xff,0xff,0xff,0xff,0x1f,0x3c,0xfc,0x27,
+ 0xc0,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0x1f,0x1c,0xfc,0xff,0xc0,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x1c,
+ 0xff,0xff,0xff,0xff,0x1f,0x0c,0xfc,0xff,0x81,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0x81,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0x3f,0x0c,0xf8,0xff,0x81,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0xc0,0x00,0xff,0x7f,0xfc,0xff,0x7f,0x0e,0xe0,
+ 0xff,0xc1,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x60,0x80,0xff,0x7f,0xf8,
+ 0xff,0xff,0x0f,0xc0,0xf1,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x30,
+ 0x80,0xf0,0x4f,0xf8,0x37,0xff,0x0f,0x00,0xc0,0xff,0xff,0xfb,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x38,0x00,0x70,0x07,0xfc,0xe3,0xff,0x3f,0x00,0x80,0xfb,0xff,
+ 0xa1,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x1c,0x00,0x70,0x87,0xfe,0x01,0xdf,0xff,
+ 0x01,0x00,0xff,0xff,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x1c,0x00,0x38,0x86,
+ 0xff,0x03,0x0f,0xff,0x01,0x00,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x0e,0x00,0x00,0x06,0xff,0x83,0x07,0xfc,0x03,0x00,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x04,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x1e,0x00,0x00,0x06,0x9f,0xc1,0x03,0xf8,0x3f,0x00,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0x3f,0x00,0x00,0x82,0x1f,0xe1,0x03,
+ 0xf0,0xff,0x81,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0xfb,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x86,0x1f,0xc0,0x03,0xf8,0xff,0xc3,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x86,0x3f,0xc0,0x01,0xfc,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xdf,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x80,0x3f,0x80,0x01,0x7e,0xf8,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xfd,0xff,0x1f,0x00,0x00,0x80,0x7f,0x80,
+ 0x01,0x1f,0xf0,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0xc0,0xf9,0xff,0xff,0xff,0xf9,0xff,0x3f,0x00,
+ 0x00,0x00,0x7f,0x80,0xb1,0x0f,0xf8,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x30,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xe7,
+ 0xf8,0xff,0xff,0x00,0x00,0x80,0xff,0xc0,0xf1,0x0f,0x3c,0xfe,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0xf4,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x3b,0x30,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0xff,0x71,0x78,0xff,0xff,0x3f,0x00,0x80,0xff,0xc0,0xf9,0x07,0x0e,
+ 0xf4,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0xf1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x7f,0x08,0x78,0xff,0xff,0x7f,0x00,0x80,0xff,
+ 0xe4,0xff,0x03,0x07,0xe0,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x02,0xfb,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0xf8,0x23,0x06,0x30,0xe3,0x3f,
+ 0xe0,0x00,0x80,0xff,0xfd,0xfe,0x03,0x01,0x82,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0xc3,0xff,0xff,0xff,0xff,0xff,0x03,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xe1,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0xf0,0x01,
+ 0x00,0x00,0xc3,0x3f,0x00,0x00,0x80,0xff,0x7f,0xfc,0x81,0x01,0x00,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xdf,0xef,0xff,0xff,0xff,0x03,0x82,0xff,0xff,0xff,0xff,0x7f,0x03,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0x81,0x00,0x00,0x80,0x3f,0x00,0x00,0x00,0xff,0x3f,0xfc,0x81,
+ 0x01,0x00,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0x0f,0x83,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
+ 0xfe,0x1f,0xf8,0x81,0x03,0x06,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xfd,0xf9,0xff,0xff,0xff,0xff,
+ 0xc3,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x7c,0x00,0x00,0x00,0xfc,0x0f,0xf8,0x80,0x00,0x3f,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0x03,0x00,0x00,0xf8,0x1f,0xf8,0x80,0x00,0xcf,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xbf,0xff,
+ 0xff,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x0f,0x00,0x00,0xf8,0x0f,0xfc,
+ 0x83,0x00,0x8c,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0x1f,0xf9,0xff,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,
+ 0x00,0xf8,0x0f,0xf8,0x87,0x00,0x14,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0x7f,0x17,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x0c,0x00,0x81,0xff,0x07,0xf8,0xc0,0x00,0x00,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x3f,0x71,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0xfe,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0xe0,0x83,0xff,0x0e,0xf8,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x3f,0x70,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x30,0xf8,0xff,0xff,0xff,
+ 0xff,0xf3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0x06,0x7e,0x0e,
+ 0xfc,0x01,0x00,0x00,0xfe,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0x3f,0xe0,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x10,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcf,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0x1f,0x1c,0x7f,0x1c,0xfc,0x03,0x00,0x00,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0x3f,0xe0,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x30,0xfc,0xff,0xff,0xff,
+ 0x0f,0xf0,0x8f,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0x0f,0xfc,0x1f,0x7c,0xfe,0x0f,0x00,0x80,0xfe,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x3f,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xe0,0xff,0xff,0xff,0xff,0x0f,0x04,
+ 0xfe,0x0f,0xfc,0xff,0x19,0x00,0x00,0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x7f,0xfc,0x3f,0x38,0xf8,0x0f,0x00,
+ 0x00,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xdc,0xff,0xff,0xff,0x3f,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0x0f,0x10,0xf8,0x03,0xf8,0xff,0x3e,0x00,0x00,0xf8,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0xf8,0x7f,
+ 0x18,0xf0,0x7f,0x00,0x00,0xf0,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0x7f,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0x07,0x08,0xc0,0x01,0xf8,0x3f,0x3c,0x00,0x00,
+ 0xe0,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,
+ 0x00,0x1c,0xe0,0xff,0x38,0xf8,0x9f,0x01,0x00,0xf0,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0x21,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0xc0,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xf0,
+ 0x01,0x30,0x00,0x00,0x80,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x7c,0x00,0x00,0x10,0xc0,0x3f,0x3f,0xd8,0x0f,0x9f,0x01,0xfc,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x7f,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xe0,0xff,0x9f,0xf9,0xff,0x0f,
+ 0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x3f,0x00,0x00,0x10,0x00,0x3f,0x1e,0x98,0x0f,
+ 0xbe,0x01,0xf0,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0x73,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0xe0,0xff,
+ 0x0f,0xf0,0xff,0x0f,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
+ 0xf7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x78,0x02,0x00,0x10,0x00,
+ 0x40,0x06,0x88,0x1f,0xee,0x01,0xe8,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0x39,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0xb0,0xff,0x1f,0xf8,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x83,0xff,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,
+ 0x03,0x00,0x10,0x00,0x00,0x02,0x80,0x0f,0xfc,0x03,0x80,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0x7f,0x78,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x10,0xf8,0xff,0x1f,0xe4,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0x01,0x00,0x10,0x00,0x00,0x02,0x80,0x07,0xfc,0x03,0x80,
+ 0xff,0xff,0x27,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0x0f,0x00,0x08,0xf8,0x83,0x7f,0xc6,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x7c,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x02,0xc0,
+ 0x03,0xde,0x07,0xd0,0xff,0xff,0x23,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0x07,0x00,0x07,0x08,
+ 0x01,0x00,0xe4,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0x00,0x00,0x00,
+ 0x00,0x00,0x02,0xc0,0x02,0xff,0x03,0x10,0xff,0xff,0x37,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,
+ 0x07,0x00,0x01,0x1c,0x00,0x00,0xc0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x12,0x00,0x00,0x00,0x00,0x00,0x01,0xc0,0x01,0xff,0x01,0x00,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0xc0,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0xf8,0xff,0xf7,0x03,0x00,0x02,0x0e,0x00,0x00,0x80,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x80,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0xff,0x0f,
+ 0xc0,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x40,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0xfc,0xff,0xff,0x01,0x00,0x00,0x06,0x02,0x00,0x00,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xc0,0xff,0x00,0x06,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0x1f,0x20,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x8c,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xfe,0xff,0xff,0x01,0x00,0x00,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xec,
+ 0xc0,0xff,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x1c,0xc0,0xff,0xff,0x67,0x00,0x00,0x00,
+ 0x80,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xc0,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x14,0xe0,0xff,0xff,
+ 0x43,0x00,0x00,0x00,0x00,0xda,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xc3,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc1,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x7f,
+ 0x34,0xe0,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xf7,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xcf,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x81,0xc9,0x7f,0x3e,0xc0,0xff,0xff,0x11,0x00,0x00,0x00,0x00,0xe2,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x02,0xff,0xff,0x3f,0xc0,0xff,0xff,0x63,0x00,0x00,
+ 0x00,0x00,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,
+ 0xff,0x1f,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xfb,0xff,0x1f,0x00,0xff,
+ 0xff,0x3b,0x00,0x00,0x00,0x00,0xf4,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf1,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xf0,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0xff,
+ 0xff,0x1f,0x00,0xfe,0xff,0x3f,0x00,0x00,0x00,0x20,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xe7,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x60,0xfe,0xff,0x07,0x00,0xfe,0xff,0x3f,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xfc,0xff,0xc3,0x00,0xfe,0xff,0x1f,0x00,
+ 0x00,0x00,0x80,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,
+ 0xff,0xfe,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x30,0x38,0x00,0x30,0x00,0x00,0x30,0xf8,0xff,0xc3,0x01,
+ 0xf8,0xff,0x03,0x00,0x00,0x00,0x90,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfd,0xff,0xb9,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x1c,0x00,0x18,0x00,0x00,0x38,
+ 0xf0,0xef,0x03,0x10,0xfc,0xff,0x09,0x00,0x00,0x00,0x88,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0xff,0xb0,0x71,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0x07,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0x00,
+ 0x00,0x00,0x90,0x1f,0xe0,0x47,0x00,0x30,0xf0,0xff,0x16,0x00,0x00,0x00,0xf0,
+ 0xf9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xfe,0x7f,0xb0,0xc3,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0x07,0x00,0x00,0xe0,0x1c,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xf8,0x03,0x00,0x00,0x00,0xc0,0x0f,0xe0,0x03,0x00,0x3c,0xf0,0xff,0x08,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0xfe,0x7f,0x90,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x1f,0x00,0x00,0x10,0x3c,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0xc0,0x3f,0xe6,0x07,0x10,
+ 0x38,0xf8,0xff,0x04,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0xfe,0x7f,0x90,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x18,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0xf8,
+ 0x3f,0xc7,0xef,0x30,0x38,0xfc,0xff,0x01,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfe,0x7f,0x18,0x87,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x1c,0xfc,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x01,0x78,0xfe,0xff,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfe,0x3f,0x30,
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0x1f,0x00,0x00,0x0c,0xff,0x7f,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x03,0xf0,0xff,0xff,
+ 0x00,0x00,0x00,0x10,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0xfc,0x3f,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x06,0x00,0xfe,0xff,0xff,0xff,0x33,0x02,0x80,0x9e,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xf9,0xfd,
+ 0x03,0xe0,0xff,0xff,0x00,0x00,0x00,0x90,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xbf,0xf8,0x3f,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xff,0xff,0xff,0xff,0xf3,
+ 0x07,0x20,0xcf,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xfc,0xff,0x07,0xe0,0xff,0x7f,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xf0,0x7f,0x20,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0xfe,0xff,0xff,0x4f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x87,0xe0,0xff,0xff,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0x7f,
+ 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x02,0x80,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xfe,0xff,0xff,0x9f,0x02,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x9f,0xf9,0x0f,0xe1,0xff,
+ 0xff,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xc9,0xff,
+ 0xff,0xff,0x9f,0x3f,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x84,0x03,0xc0,0xff,0xff,0xff,0xff,0xff,0xf7,0x07,0xfe,
+ 0xff,0xff,0xff,0x05,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0xc0,0xff,0xff,0xdf,
+ 0xf0,0x0f,0xe3,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x2f,0xc0,0xff,0xff,0xff,0xbf,0xfc,0x60,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8f,0x03,0xe4,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xfb,0xff,0xff,0x7f,0x0a,0x00,0x00,0x00,0x00,0x08,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0x00,0x3f,0xf6,0xff,0xff,0x03,0x00,0xc8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xe0,0xff,0xff,0xff,0x7f,0xf0,0xe0,0x04,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xcf,0x01,0xef,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x97,0xfb,0xff,0xff,0x7f,0x0a,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x01,0x3f,0xfc,0xff,0xff,0x01,0x00,
+ 0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x05,0x00,0xff,0xff,0xfb,0xff,
+ 0xc0,0xc1,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xa0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0xf8,0xff,0xff,0xff,
+ 0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x00,0xfe,0xfc,
+ 0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0xfe,0xff,0xf3,0xdf,0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,
+ 0xfc,0xff,0xff,0xff,0x1d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0x00,0xfe,0xfd,0xff,0xff,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x04,0xf0,0xff,0x7f,0x47,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x7f,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0x00,0xfc,0xff,0xff,0xff,0x00,0xc0,0xff,0xff,0x7f,
+ 0xff,0xff,0xff,0xff,0xff,0x2f,0x00,0x00,0xe0,0x9f,0x1f,0x01,0x00,0xc0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x7f,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0x3d,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x01,0x80,0xff,0xff,0xff,0x00,0xf0,0xf7,0xff,0xff,0x01,
+ 0xc0,0xff,0xff,0x1f,0xbf,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xc0,0x1f,0x0f,
+ 0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0x3f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x80,0xff,0xff,0xff,0x00,0xf0,
+ 0xff,0xff,0xff,0x01,0xc0,0xff,0xff,0x7f,0x01,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x1e,0x07,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0x1f,0xf4,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0xfe,0xff,0xff,0xff,0xff,0x2f,0x00,0x38,0x00,0x00,0x00,0x80,0x00,0x80,0xff,
+ 0xff,0x7f,0x00,0xf0,0xff,0xff,0xff,0x01,0xe0,0xff,0xff,0x7f,0x00,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0xdc,0x01,0x00,0x00,0x20,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1f,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0xff,0xff,0xff,0xff,0xff,0x4f,0x02,0x00,0x00,0x00,0x00,
+ 0x80,0x00,0x80,0xff,0xff,0x3f,0x00,0xf8,0xff,0xff,0xff,0x01,0xf0,0xff,0xff,
+ 0x3f,0x00,0xfe,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x9c,0x01,0x00,0x00,0x38,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xf9,0x1f,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xd7,0xff,0xff,0xff,0xff,0xff,0xdf,0x00,
+ 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0xff,0xff,0x3f,0x00,0xf8,0xfb,0xff,0xff,
+ 0x03,0xf8,0xff,0xff,0x7f,0x00,0xfe,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x3c,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xfd,0x0f,0xfa,0xff,0xff,0xff,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xf8,0xff,0x3f,0x00,
+ 0xf8,0xfb,0xff,0xff,0x03,0xf8,0xff,0xff,0x3f,0x00,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x01,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0x7f,0x00,0xf8,0xf1,0xff,0xff,0x03,0xfc,0xff,0xff,0x7f,0x80,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x06,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0x03,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0xfe,0xff,0xff,0xff,0xff,0xff,0xaf,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x00,0xe0,0xf1,0xff,0xff,0x27,0xfc,0xff,
+ 0xff,0xff,0xf0,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xbc,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
+ 0x03,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcf,
+ 0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x00,0x60,0xf0,0xff,
+ 0xff,0x3f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x70,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0x01,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xdf,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0x00,0x00,0xf0,0xff,0xff,0x7f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x78,0x00,0xfc,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x01,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0x00,0x00,0xf0,0xff,0xff,0xbf,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x78,0x00,0xdc,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x01,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x77,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x38,0x00,0x9c,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0x01,0xfc,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x10,0x24,0x00,0x00,0xf0,0x7f,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x1c,0x00,
+ 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0x01,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0xc0,
+ 0x3f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x0e,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x01,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2f,0x00,0x00,0x00,0x00,0x00,
+ 0x3e,0x00,0x00,0xc0,0x0f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x07,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x01,0xfe,
+ 0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0xc0,0x03,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xc0,0x83,0x02,0x04,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0xc0,0x03,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xc0,0x03,
+ 0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x9f,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,
+ 0xc0,0x07,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0xc0,0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x02,0x00,0x00,0x00,
+ 0x00,0x40,0x00,0x00,0xa0,0x03,0x00,0x20,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x01,0xe0,0x03,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x83,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x06,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0xc0,0x03,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0x7f,0x00,0xe0,0x03,0x26,0x0c,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0xbf,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0c,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0xc0,0x07,0x00,
+ 0xc0,0x01,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xe0,
+ 0x03,0x60,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xf9,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x09,0x00,0x00,0x00,0x00,0x48,0x00,
+ 0x00,0x80,0x07,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0xc0,0x03,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x31,0xff,0xff,0xcf,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1b,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x80,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x80,0x8f,0xe7,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xff,0xff,
+ 0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xf9,0x7f,0x10,0x80,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x20,0xff,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x13,0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0x3f,0x18,
+ 0xc1,0x3f,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x01,0x00,0x00,0x00,0x00,0x20,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x03,0x04,0x00,0x00,0x06,0x01,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xfc,0x7f,0x9c,0xe0,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0x3f,0xf0,0x17,0x00,0x40,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x60,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0x3f,0xf0,0x1f,0x00,
+ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,
+ 0x00,0x00,0x60,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,
+ 0x37,0xb0,0x1f,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0x01,0x00,0x00,0x00,0x00,0x60,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0x3f,0x00,0x00,0x00,0x38,0xc0,0xfb,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xfc,0xff,0x77,0xf0,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xe0,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0x7f,0x00,0x00,0x00,0xfc,0xe3,0xfd,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0x71,0xf0,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0xe0,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0xc0,0xfd,0x00,0x00,0x00,0x7f,
+ 0xfe,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0xe0,0xff,0x79,0xfe,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0x00,0x00,0x80,0xc0,0xfd,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xe3,
+ 0xff,0x51,0xfe,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xe0,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x7f,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xc3,0xc3,0xff,0xf9,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0xe0,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x03,0x00,0x00,0xf0,0x3f,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xc3,0xff,0xfb,0xff,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x13,0x00,0x00,
+ 0xe0,0x1f,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xc1,0xff,0x93,0x47,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x1c,0x3e,0x00,0x00,0xf0,0x1f,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,
+ 0xc1,0x3f,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x08,0x3e,0x00,0x00,0xe0,0xff,0xc7,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xf1,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0xf8,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x0e,0x00,0x00,0x20,0xfb,0xcb,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x04,0x00,
+ 0x00,0x90,0xfd,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x0c,0xc4,0x07,0x00,0x2e,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x80,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x7d,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x06,0xc0,0x03,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xd1,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x7a,0x00,0xf0,0xf3,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x08,0xfe,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x37,0x00,
+ 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xa0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x20,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0x01,0x0c,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfa,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0xf0,0x01,0x0e,0x00,0x10,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x30,0x3c,0x00,0xfc,0x01,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x80,0xff,0x7f,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xa0,0x00,0x00,0x78,0x3c,
+ 0x00,0x7c,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xc2,
+ 0xff,0x7f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x07,0x00,0xe0,
+ 0x00,0x00,0xf8,0x00,0x00,0x3e,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xb8,0x87,0xff,0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0xc0,0xe3,0x01,0x00,0xfc,0x3e,0x00,0x7c,0x00,0x0d,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x07,0xff,0x3f,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0xef,0xc3,0x01,0x00,0xfc,0x7f,0x00,0x7c,0x00,
+ 0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x07,0xff,0x1f,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xc2,0x07,0x00,0xfe,
+ 0xff,0x03,0xfc,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0x1f,0xfe,0x07,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0x01,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,
+ 0x86,0x0f,0x00,0xfe,0xff,0x07,0xf8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x08,0x1f,0xfe,0x07,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9f,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0xc0,0xff,0x0f,0x1e,0x00,0xfe,0xff,0x07,0xf0,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1f,0xfc,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x9f,0x03,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0xe0,0xff,0x3e,0x3e,0x00,0x7e,0xfc,0x03,0xe0,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f,0x3c,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x03,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xf0,0x7f,0x7e,0x38,0x00,
+ 0x10,0xe0,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0x1f,0x9f,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x06,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x78,
+ 0x7f,0xfe,0x34,0xf8,0x03,0x00,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0x4f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x06,0x00,
+ 0x00,0x00,0x20,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0xf0,0x7f,0xff,0x3d,0x3c,0x00,0x00,0x00,0xe0,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x27,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0c,0x00,0x00,0xf0,0xe3,0x03,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xf8,0xff,0xff,0x7d,0x3c,0x00,0x00,0x00,
+ 0xf0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xcf,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x1c,0x00,0x00,0xfc,0xff,0x1f,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xfc,0xff,0xff,0x7d,
+ 0x7c,0x00,0x00,0x00,0xf0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x38,0x00,0x00,0xfe,0xff,
+ 0x3f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0xfe,0xff,0x0f,0xff,0x78,0x00,0x00,0x80,0xe0,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x73,
+ 0x00,0x00,0xff,0xff,0x3f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x04,0x3e,0xff,0xfc,0x00,0x00,0x00,0x80,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x73,0x00,0x00,0xff,0xff,0x3f,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0x03,0x00,0xfc,0xff,0xfd,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf3,0x00,0x00,0xfe,0xff,0x3f,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xfc,
+ 0xff,0xff,0x33,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x20,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0x01,0x00,0xfe,
+ 0xff,0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xcf,0x01,0x00,0xff,0xff,0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xfe,0xff,0xcf,0x7f,0x06,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xdf,0x03,0x00,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x80,
+ 0xff,0xff,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x80,0x3f,0xfc,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x80,0xff,0xff,0x9f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x3f,0xf0,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0xff,0xff,0x37,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0x00,0x3c,0x80,0xef,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0xff,0x83,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xf7,0x07,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0xfe,0x83,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xfe,0xc1,0xff,0x8f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x40,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x70,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xf8,0xc1,
+ 0xff,0x1f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x78,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xe0,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xe0,0xff,0xff,0x87,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+ 0x00,0xc0,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xe0,0xff,0xe7,0x07,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x07,0x00,0xc0,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x0c,
+ 0xf0,0xff,0xff,0x8f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0xbf,0x1f,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0xf0,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x9f,
+ 0xff,0x3f,0x00,0x00,0x00,0x40,0x00,0x00,0xc0,0xfd,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x1c,0x00,0x00,0x0e,0xff,0xff,0x00,0x00,0x00,0xc0,0x00,0x00,0xe0,0xfd,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0xf0,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0xf8,0xff,0x00,
+ 0x00,0x00,0xfe,0x01,0x00,0xf0,0xfc,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x78,0x00,0x00,
+ 0x00,0xf0,0xff,0x01,0x00,0x00,0xfe,0x03,0x00,0xf0,0xfc,0xff,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x70,0x00,0x00,0x00,0xf8,0xff,0x33,0x00,0x00,0xff,0x07,0x00,0xe0,0xff,
+ 0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0xfc,0xff,0x3f,0x00,0x80,0xff,
+ 0x0f,0x00,0xe0,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0xfe,0xff,
+ 0x3f,0x00,0xc0,0xff,0x0f,0x00,0xc0,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x03,
+ 0x00,0x00,0xfe,0xff,0x3f,0x00,0xe0,0xff,0x8f,0x00,0x00,0xff,0xff,0xf9,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xf8,0xff,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0x03,0x00,0x00,0xff,0xff,0x3f,0x00,0xf0,0xff,0xcf,0x01,0x00,
+ 0xfe,0xff,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xf9,0x3f,0x08,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0x00,0x80,0xff,0xff,0x7f,0x00,0xf8,
+ 0xff,0xff,0x01,0x00,0xfe,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x73,0x3e,0x08,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x0f,0x00,0xc0,0xff,
+ 0xff,0x7f,0x00,0xfc,0xff,0xff,0x01,0x00,0xfe,0xff,0x5b,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x09,0x08,0x00,0xfb,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0x0f,0x00,0xf8,0xff,0xff,0x7f,0x00,0xff,0xff,0xff,0x03,0x00,0xfc,0xff,0xff,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9f,0x03,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0x0f,0x00,0xfc,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x33,
+ 0x00,0xfe,0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0f,0x00,0xfe,0xff,0xff,0xff,0x00,
+ 0xfe,0xff,0xfb,0xf7,0x00,0xfe,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0xc0,0xff,
+ 0xff,0xff,0xff,0x01,0xfe,0xff,0xfb,0xf7,0x01,0xff,0xff,0xdf,0xfd,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x18,0xe0,0xff,0xff,0xff,0xff,0x01,0xfe,0xff,0xff,0xf7,0xc3,0xff,0xbf,
+ 0xff,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x08,0x00,0x00,0x00,0x00,0x10,0xfe,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,
+ 0xf7,0xcf,0xff,0xdf,0x1f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0xa0,0xff,0xe7,0xff,0xff,0xff,
+ 0x03,0xff,0xff,0xff,0xf7,0xef,0xff,0xff,0x6f,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,0x7f,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x10,0xe0,0x0f,0xff,0xff,0xff,0xff,0x07,0xff,0xff,0xff,0xe7,0xff,0xff,
+ 0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0xff,0xff,0xff,0xff,0x0f,0xfd,0xff,
+ 0xff,0xef,0xff,0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xcf,0xf9,0xff,0xff,0x1f,0xff,0xff,0x07,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xf9,0xff,0xff,0x3f,0xfe,0xff,0x83,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0x3f,0xfc,
+ 0xff,0x81,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xf9,
+ 0xff,0x7f,0x3c,0xfc,0xff,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x78,0xfc,0x7f,0x80,0xff,0xbf,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xf8,0x3f,0x00,0xff,
+ 0x9e,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,
+ 0xf8,0x27,0x80,0xe3,0xdf,0xc7,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0xc0,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0xf3,0x07,0x80,0xfb,0xff,0x83,0xc5,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x40,0xe4,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xfe,0x07,0x80,0xdb,0xdf,0x8f,0x03,
+ 0xfc,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x80,
+ 0xc2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xf8,0x07,0xc0,
+ 0xe3,0xff,0x0f,0x01,0xc0,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0xf8,0x0f,0xc0,0xe3,0x3f,0x1c,0x00,0x00,0x7f,0xef,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x08,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0xe0,0x1f,0xc0,0xc9,0xef,0xff,0x03,0x00,0x8e,0xdf,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xa0,0x1f,0xe0,0x81,0xff,0xff,
+ 0x1f,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x48,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x7d,
+ 0xe7,0x57,0xff,0xff,0x1f,0x00,0xfc,0xff,0xf6,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x81,0xff,0xff,0x33,0xff,0x7f,0x3f,0x00,0xf8,0xff,0xdf,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xc0,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0xff,0xff,0xff,0x1f,0xe0,0xf1,
+ 0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xe0,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0xff,0xff,0xff,
+ 0xf7,0xdf,0xe1,0xe3,0xff,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0xe0,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,
+ 0xff,0xff,0xff,0xef,0xff,0xff,0xff,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x20,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x38,0xf8,0xff,0xdb,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xf0,0x8d,0xf7,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x37,0xfe,
+ 0xf9,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xe7,0xfd,0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x02,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x37,0xf2,0xc7,0xff,0xff,0xff,
+ 0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x02,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xf0,
+ 0xc7,0xff,0xff,0xff,0xff,0xff,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x02,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xf8,0x07,0xff,0xff,0xff,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x04,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xf8,0x07,0xff,0xff,0xff,0xff,0xff,0xbf,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x04,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x04,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0x03,0xf8,0x07,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x08,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x08,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x01,
+ 0xf0,0x07,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x80,0x07,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x02,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x01,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x01,0xde,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x01,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x01,0xfe,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x01,0xfe,0x8f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0xfe,0x03,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x10,0x00,0x7e,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
+ 0x00,0x7f,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x40,0x00,0x80,0x7f,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x60,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xe0,0x7f,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xf0,0x7f,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0xf8,0x7f,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0xfc,0x7f,0xc0,0xff,0xfb,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xfe,0x7f,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xfe,0x3f,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0xfe,0x3f,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x00,0xfc,0x3f,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xfc,0x3f,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x02,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xfc,
+ 0x3f,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0xfc,0x3f,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xfc,0x7f,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xf3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xf0,0x07,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0xfc,0x0f,0x00,0x00,0xf8,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x40,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x80,0xff,0x1f,0x01,0x00,0xf8,0xff,0xff,0xff,0xcf,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xc0,0xff,0xbf,0x01,0x00,0xf8,
+ 0xff,0xff,0xff,0x1f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x80,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xc0,0xff,
+ 0xff,0x02,0x00,0xf8,0xff,0xff,0xff,0x0f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xe3,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0xfe,0xff,0xff,0x0f,0x00,0xf8,0xff,0xff,0xff,0x0f,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x1f,0x00,0xf8,0xff,0xff,0xff,
+ 0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,0xff,0x1f,0x00,
+ 0xff,0xff,0xff,0xff,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x80,0xff,0xff,0xff,0xff,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xff,0xd1,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x4f,0xfe,0xff,0xff,0x7f,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x02,0x10,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xff,
+ 0xff,0x3f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x03,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0xfe,0xff,0xff,0x1f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x01,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0xfe,0xff,0xff,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0x0f,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2f,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xbf,0xf2,0x7f,0xf9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x5f,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1b,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x4f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xf1,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x6f,0xe8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xdf,0x88,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x4f,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2f,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xe8,0xef,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0xee,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x07,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1e,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x06,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x1e,
+ 0xfd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x1e,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x06,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,
+ 0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x43,0xff,0xff,0xff,0x3f,0x06,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0x0f,0xff,0xff,0xff,0x3f,
+ 0x02,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0x77,
+ 0xff,0xff,0xff,0x18,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0xc6,0xff,0xff,0xfc,0xff,0xff,0xff,0x3f,0x04,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xc7,0xfd,0xff,0xe1,0xdf,0xff,0xff,0x0f,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xf7,0xff,0x87,0xff,0xff,0xff,
+ 0x00,0x02,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x0c,0x7f,0xb3,0xff,
+ 0x00,0x30,0xff,0xff,0x08,0x02,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x30,0xff,0x01,0x00,0xfe,0xf7,0x1f,0x02,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x80,0xff,0x01,0x00,0xf8,0xe7,0x1f,0x03,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x80,0xff,0x03,0x00,0xf8,
+ 0xfd,0x03,0x03,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0xff,0x03,0x00,0xe0,0x3c,0xdf,0x03,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x40,0x38,0xff,0x01,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x7f,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xfd,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0x7f,0xf0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x7f,0xc0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0xc0,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x80,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xf4,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0xfc,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xe0,0x9f,0x3f,0xfe,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0x03,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xcf,0xff,0xff,0xff,0xe7,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0x03,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,
+ 0x03,0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xff,0xff,0xff,0xc7,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0f,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x9f,0x01,0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0x87,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0xfe,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0x87,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x9f,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x04,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x38,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0x70,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0x79,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xbf,0x38,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcf,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xf1,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x38,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x8f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x18,0xfe,0xff,0xff,
+ 0xef,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0x7f,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x83,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0xc0,0xff,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,0x07,0xfe,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x80,0x1f,0x00,0xc0,0xff,0xfd,0xff,0xff,0xff,0x03,
+ 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x87,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x02,0x00,0x00,0x02,0x00,0x80,0x03,0xc3,
+ 0xff,0xff,0xff,0x00,0xf4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0xe1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x01,0x00,0xff,0xff,0x1f,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xf1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfb,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfb,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xf7,0xf9,0xff,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xe7,0xfc,0xff,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x0f,
+ 0xfc,0x7f,0x00,0xfe,0xff,0xff,0x3f,0xfc,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0x1f,0xfe,0x3f,0x00,0xff,0xff,0x7f,0x00,0xe0,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1f,0xff,0x3f,0xc0,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xbf,0xff,0x1f,0xc0,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0x07,0xc0,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0x00,0xc0,0xbf,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x3f,0x00,0xe0,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf4,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x1f,0x00,
+ 0xe0,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0x1f,0x00,0xe0,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0x3f,0x00,0xf0,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0xf8,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xc7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
+ 0x0f,0xfe,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0xfc,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xe0,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0xf0,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
diff --git a/bitmaps/elephant.xbm b/bitmaps/elephant.xbm
new file mode 100644 (file)
index 0000000..8f93397
--- /dev/null
@@ -0,0 +1,8 @@
+#define elephant_width 20
+#define elephant_height 20
+static unsigned char elephant_bits[] = {
+ 0xc0,0x07,0x00,0xc0,0x19,0x00,0xe0,0x76,0x00,0xe0,0xf6,0x00,0xf0,0xf7,0x01,
+ 0xf8,0xf7,0x03,0xd8,0xf7,0x07,0xfa,0xf7,0x07,0x7d,0xfb,0x07,0xfb,0xfc,0x0f,
+ 0xfe,0xff,0x0f,0xfc,0xff,0x0f,0xfe,0xff,0x0f,0xf6,0xff,0x0f,0xf2,0xff,0x06,
+ 0x72,0xe3,0x06,0x73,0xe3,0x06,0x71,0xe3,0x06,0x71,0xe3,0x06,0x70,0xe0,0x00
+ };
diff --git a/bitmaps/enterprise-2.xbm b/bitmaps/enterprise-2.xbm
new file mode 100644 (file)
index 0000000..34982c5
--- /dev/null
@@ -0,0 +1,142 @@
+#define enterprise2_width 241
+#define enterprise2_height 67
+static unsigned char enterprise2_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xdf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0x4f,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x40,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x02,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xf8,0xff,0x77,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x20,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x02,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x02,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xfe,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x02,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0xfe,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x08,0x02,0x00,0x00,0xd4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x08,0xfc,0xff,0xff,0x9f,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x04,0x00,0x00,0xf4,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x0c,0xfc,0x00,0x00,0x54,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0x84,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x0c,0x84,0x00,0x00,0x64,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x0f,0x84,0x00,0x00,0x0c,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x84,0xff,0xff,0x03,0x00,0xf8,
+ 0xff,0xff,0xff,0x3f,0x02,0x80,0x00,0x20,0xc0,0xff,0x1f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x84,0x00,0x00,0x00,0xf0,
+ 0x07,0x86,0x00,0x00,0x00,0x02,0x80,0x00,0x20,0x00,0x02,0x64,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x84,0x00,0x00,0x00,
+ 0x18,0x00,0x80,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x01,0x82,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0xc8,0x00,0x00,
+ 0x00,0x08,0x00,0x80,0x03,0xf8,0xff,0xfd,0xff,0xff,0x1f,0x00,0x01,0x42,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0xc8,0x00,
+ 0x00,0x00,0x18,0x02,0xf7,0xff,0x0f,0x00,0x02,0x80,0x00,0xf0,0xff,0x03,0x40,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x48,
+ 0x00,0x00,0x00,0xf0,0xff,0x1f,0x02,0xfc,0xff,0x07,0x20,0xf0,0xf9,0xff,0x00,
+ 0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
+ 0x48,0x00,0x00,0x00,0xc0,0x04,0xf0,0xff,0x03,0x1f,0x08,0x38,0x0f,0xfe,0xc1,
+ 0xff,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x10,0x48,0x00,0x00,0x00,0x80,0xe9,0xff,0xff,0xff,0x0f,0x11,0x44,0xfe,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x10,0x48,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xfa,0x2c,0x20,0x97,0xf8,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x10,0x48,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0xfd,0x57,0x24,0x49,
+ 0xfe,0xf8,0x7f,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,0x80,0x03,0x00,0x80,0xdf,0xef,0xa5,
+ 0xf5,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,0x40,0x01,0x00,0x40,0x00,0x70,
+ 0xa8,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,0xc0,0x00,0x00,0x60,0x00,
+ 0xc0,0xa2,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,0x60,0x00,0x00,0x10,
+ 0x00,0x80,0xa3,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,0x30,0x00,0x00,
+ 0x18,0x00,0x00,0x5e,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,0x38,0x00,
+ 0x00,0x06,0x00,0x00,0x5c,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,0x08,
+ 0x00,0x00,0x05,0x00,0x00,0xf8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x48,0x00,0x00,0x00,
+ 0x0c,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x28,0x00,0x00,
+ 0x00,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x28,0x00,
+ 0x00,0x00,0x03,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x38,
+ 0x00,0x00,0x80,0x01,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
+ 0x30,0x00,0x00,0xc0,0xf0,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x40,0x30,0x00,0x00,0x70,0xff,0xf9,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x40,0x30,0x00,0xf8,0x0f,0x80,0x00,0xd0,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x40,0xb0,0xff,0x07,0xc0,0xff,0xff,0x5f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x7e,0xf0,0xf3,0xff,0x3e,0x00,0x01,0xc0,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xe8,0x41,0xfc,0x0f,0x00,0x01,0x00,0x01,0x80,0x10,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0x0c,0x00,0x00,0x00,0x00,0x01,0x80,0x20,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x07,0x00,0xa0,0xff,0xff,0xff,0xff,0x20,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0x1f,0x00,0x00,0x01,0x80,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x01,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xfc,0xff,0xff,0xff,
+ 0xff,0x3f,0x01,0x80,0x2f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x3c,0x00,
+ 0x00,0x00,0x00,0x00,0x01,0x90,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,
+ 0xff,0xff,0x01,0x00,0x00,0x01,0x90,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0x03,0x00,0xfe,0xff,0x01,0xf9,0xbf,0x2f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x1f,0x00,0x00,0xfe,0x07,0x90,0x16,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0x03,0x00,0x01,0x90,0x06,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00};
diff --git a/bitmaps/enterprise-3.xbm b/bitmaps/enterprise-3.xbm
new file mode 100644 (file)
index 0000000..69115a1
--- /dev/null
@@ -0,0 +1,267 @@
+#define enterprise3_width 241
+#define enterprise3_height 102
+static unsigned char enterprise3_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xe0, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc7, 0xff, 0x85, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0xff, 0x3f, 0x00, 0x29, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xf8, 0xc1, 0xff, 0x00, 0x00, 0x00, 0xc5, 0x14,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+   0x7b, 0x00, 0x00, 0xff, 0xbf, 0xb2, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x80,
+   0x92, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xf0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x40, 0x05, 0x78, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x20, 0x39, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x09, 0x30, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x5f, 0x33, 0x68, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f,
+   0xf0, 0x89, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x24,
+   0x34, 0x00, 0x00, 0x00, 0x00, 0x78, 0xfe, 0x4f, 0x16, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xd4, 0x12, 0x00, 0x00, 0x00, 0x00,
+   0xfa, 0x01, 0xc0, 0xfa, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xe0, 0xff, 0xff, 0xff, 0x01,
+   0x40, 0x52, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xa0, 0x22, 0x13,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x01, 0x00, 0x00, 0x10, 0xfb, 0xbf, 0x10, 0x09, 0x00, 0x00,
+   0x00, 0x00, 0x01, 0x00, 0x50, 0x22, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xfd, 0x0f,
+   0x88, 0x04, 0x80, 0xc2, 0x06, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f,
+   0xe2, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf4, 0x67, 0x78, 0x00, 0x95, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x68, 0x19, 0x1b, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x80, 0x13, 0x70, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x28, 0x0b, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x08, 0x00,
+   0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xa8, 0x04, 0x24, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x1b, 0xf8, 0x6b, 0x07, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x82,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x94, 0x00,
+   0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x1d, 0x00, 0x24, 0x05, 0x1a, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01,
+   0x28, 0x1b, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x10, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0xa8, 0xf0, 0x2b, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xfe, 0x33, 0x56, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x12, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x8d, 0x48, 0x74,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xaa, 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x6e, 0x5b, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x94, 0x80, 0x04,
+   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
+   0xa0, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf0, 0xab, 0x43, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0a, 0x18, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x56,
+   0xee, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x60, 0x14, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x4a, 0xc6, 0x12, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x40,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+   0x2b, 0x71, 0xa7, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0e, 0x25, 0x07, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x60, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x40, 0x25, 0x11, 0x45, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x25, 0x11, 0x49,
+   0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x22, 0x11, 0x88, 0xfe, 0x87, 0x80, 0xff, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x20,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xef, 0x22,
+   0x81, 0x0b, 0x3d, 0x78, 0xbf, 0xff, 0xff, 0xff, 0x03, 0x80, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0xec, 0xef, 0xb9, 0xde, 0x3f, 0xc0,
+   0xff, 0xf9, 0xff, 0xfb, 0xff, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x40, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x5b, 0x7e,
+   0x8f, 0x81, 0x20, 0x00, 0x03, 0xf8, 0xc0, 0x7f, 0x00, 0x80, 0xff, 0x07,
+   0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0d, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x6f, 0xdb, 0xc7, 0x60, 0x40, 0x40, 0x00, 0x1c,
+   0x00, 0x0f, 0x80, 0x7f, 0x00, 0x00, 0xf8, 0x6f, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x32, 0x10, 0x00, 0x00, 0x00, 0x00, 0x80, 0x9f, 0x7f,
+   0x7b, 0x3c, 0x18, 0x20, 0x40, 0x00, 0x60, 0x00, 0xf0, 0x03, 0x80, 0x7f,
+   0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x60,
+   0x00, 0x00, 0x00, 0x00, 0x7f, 0x7e, 0xdf, 0xc7, 0x03, 0x07, 0x10, 0x80,
+   0x00, 0x80, 0x03, 0x00, 0x7c, 0x00, 0x80, 0xff, 0xf0, 0x91, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x98,
+   0xf9, 0x3c, 0x38, 0xc0, 0x00, 0x08, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x80,
+   0x0f, 0x00, 0xc0, 0x0c, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x81, 0x01, 0x00, 0xe0, 0x73, 0xa4, 0xc7, 0x03, 0x07, 0x30, 0x00,
+   0x06, 0x00, 0x01, 0x00, 0x30, 0x00, 0x00, 0xf0, 0x81, 0x3f, 0x04, 0x48,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x06, 0x02, 0x00, 0xde,
+   0x8b, 0x3d, 0x3c, 0xe0, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc0,
+   0x01, 0x00, 0x00, 0x7a, 0x00, 0x04, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x19, 0x0c, 0xc0, 0x07, 0xfc, 0xe1, 0x03, 0x1e, 0x80,
+   0x03, 0x80, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x00, 0xf0, 0x07, 0x00,
+   0x02, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x10,
+   0xde, 0xb9, 0x07, 0x1e, 0xc0, 0x01, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02,
+   0x00, 0x00, 0x10, 0xf0, 0x0f, 0x04, 0x00, 0x02, 0x2c, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x00, 0xe7, 0x01, 0x0e, 0x80, 0x07,
+   0x00, 0x06, 0x00, 0x20, 0x00, 0x00, 0x88, 0xff, 0xff, 0xff, 0x1f, 0x00,
+   0x02, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x40, 0x13, 0x1f, 0xf0, 0x01, 0x78, 0x00, 0xc0, 0x01, 0x00, 0x10, 0x00,
+   0xf8, 0x67, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0xb9, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7c, 0x00, 0x0f, 0x00,
+   0x06, 0x00, 0x20, 0x00, 0x00, 0x88, 0xff, 0x07, 0x10, 0x00, 0x00, 0x10,
+   0x00, 0x00, 0x02, 0x80, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x73, 0xbf, 0x00, 0xc0, 0x01, 0x00, 0x18, 0x00, 0xe0,
+   0x7f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x9c, 0x0f,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x80,
+   0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0x1f, 0x04, 0x00, 0x00, 0x10, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xe1, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x80, 0x00, 0x20, 0x00, 0x00, 0x04,
+   0x00, 0x00, 0x04, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x78, 0xe2,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x60, 0x80, 0x00, 0x20, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00,
+   0x10, 0x00, 0x00, 0x00, 0xfc, 0x87, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x40, 0x00,
+   0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x10, 0x00, 0xf8, 0xff, 0x03,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x01, 0x01, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04,
+   0x00, 0x00, 0x10, 0xff, 0x07, 0x08, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00,
+   0x80, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0xff, 0x1f, 0xf2, 0x7f,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf9, 0x7f, 0x01, 0x00, 0x10, 0x00,
+   0xc0, 0xf7, 0xff, 0xff, 0xdd, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xd0, 0x39, 0x80, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xb7, 0xdf, 0x41, 0x92,
+   0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xdc, 0xfd, 0xfb, 0xff,
+   0xff, 0xff, 0x3e, 0xc0, 0x22, 0x42, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x44,
+   0x22, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x0c,
+   0x00, 0x00, 0x00, 0x00, 0x01, 0xd0, 0x89, 0x22, 0x75, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00,
+   0x30, 0x12, 0x24, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x98, 0x61, 0x00, 0x00, 0x00, 0x80, 0x00, 0x30, 0x2c, 0xa4, 0x04, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x01, 0x00, 0x00,
+   0x80, 0x00, 0x30, 0x50, 0xa5, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x19, 0x04, 0x00, 0x00, 0x80, 0x00, 0x18, 0x80, 0x4d,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x08,
+   0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x30, 0x00, 0x00, 0x60, 0x00, 0x0c,
+   0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x18, 0x41, 0x00, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x86, 0xf1, 0xff, 0xff,
+   0x17, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x08, 0xf2, 0xff, 0x3f, 0x6c, 0x0e, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x04,
+   0x00, 0x20, 0x8c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xd0, 0x4c, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x88, 0x60, 0x0b, 0x18, 0x10, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0c, 0xf0, 0x03, 0x06,
+   0xac, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x41, 0x0a, 0x3d, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x00,
+   0x91, 0x00, 0x05, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x61, 0xa1, 0x84, 0x41, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+   0x0c, 0x80, 0x80, 0x5a, 0xcc, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x80, 0x40, 0x20, 0x32,
+   0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x40, 0xe0, 0x40, 0x40, 0x2c, 0x0d, 0x70, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x43, 0x20,
+   0xd2, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x40, 0x01, 0x3c, 0x20, 0x4a, 0x01, 0xc0, 0x02, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
+   0x20, 0x03, 0x65, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x20, 0xbc, 0x64, 0x00, 0x00,
+   0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x20, 0x20, 0xd0, 0x12, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x20, 0x10, 0x09,
+   0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xa0, 0x21, 0x90, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x22,
+   0x90, 0x34, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x90, 0x34, 0x00, 0x00, 0x05,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x32, 0x90, 0x34, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x90, 0x34, 0x00,
+   0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x58, 0x7c, 0x0d, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x10,
+   0x23, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x6a, 0x00, 0x40, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x80, 0x21, 0x92, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x54, 0x02, 0xb0,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x47, 0xa8, 0x0d, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x0c,
+   0xd6, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x42, 0xf8, 0x22, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xe0, 0x4c, 0x11, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x31, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/enterprise-5.xbm b/bitmaps/enterprise-5.xbm
new file mode 100644 (file)
index 0000000..6e16ad3
--- /dev/null
@@ -0,0 +1,214 @@
+#define enterprise5_width 241
+#define enterprise5_height 102
+static unsigned char enterprise5_bits[] = {
+ 0x00,0x00,0x00,0x00,0xe4,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x43,0xff,0xc7,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0x29,0x01,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x46,0x01,0x00,0x00,0xfe,0x07,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x9a,0xfa,0xff,0x01,0x00,0xbc,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x93,0x02,0x00,0xfe,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x40,0x05,0x00,0x00,0x00,
+ 0xc0,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x38,0x09,0x00,0x00,
+ 0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x20,0x09,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x98,0xf5,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x48,
+ 0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x22,0x1f,0xfc,0x03,0x00,0x00,0x00,0x00,0x90,
+ 0x56,0x06,0x00,0x00,0x00,0x00,0xf0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xd0,0xe4,0xff,0x3c,0x00,0x00,0x00,0x00,
+ 0x70,0x95,0x04,0x00,0xff,0xff,0xff,0x0f,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xbe,0x06,0x00,0xbf,0x00,0x00,0x00,
+ 0x00,0x20,0x11,0xfa,0xbf,0x11,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x89,0x0a,0x00,0x00,0x01,0x00,
+ 0x00,0x00,0xc0,0x86,0x02,0x40,0x22,0xe0,0x7f,0x7f,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x89,0x14,0x00,0x00,0x01,
+ 0x00,0x00,0x00,0x00,0x53,0x01,0x3c,0xcc,0x5f,0xf8,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x8e,0xf0,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0xa8,0x00,0x1c,0x90,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x31,0x2d,0x00,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x76,0x00,0x20,0xa0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0xa0,0x29,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x40,
+ 0x2a,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x04,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,
+ 0xc0,0xad,0x3f,0xb0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x19,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x50,0x00,0x52,0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x22,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xb0,0x40,0x49,0x00,0x70,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x18,0xb0,0x29,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x20,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xa8,0x1f,0x2a,0xf0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x90,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x78,0xd4,0x98,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x40,0x20,0x01,0xaa,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x5c,0x24,0x62,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0x41,0x02,0x52,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xb5,0xed,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x82,0x84,0xab,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x21,0x0a,0x1c,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xef,0xd4,0x7c,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xa0,0x3c,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xc6,0xa4,0xfe,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x50,0x0c,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xcb,0x1d,0xa9,0x05,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x2c,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x49,0xe1,0xfe,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x12,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x45,0x11,0x49,0x05,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x0d,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x25,0x11,0x49,
+ 0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x40,0x02,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,0xc2,0xff,0x22,0x10,
+ 0x89,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xb0,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0xff,0xff,0xff,0xfb,0x3d,0x78,0xa1,
+ 0x03,0x89,0xee,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x68,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xff,0xbf,0xff,0x3f,0xff,0x07,0xf8,0xf7,
+ 0x3a,0xef,0x6f,0xd8,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,
+ 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0xc0,0xff,0x03,0x00,0xfc,0x07,0x3e,
+ 0x80,0x01,0x08,0x02,0xe3,0xfd,0xb4,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0x81,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xed,0x3f,0x00,0x00,0xfc,0x03,0xe0,
+ 0x01,0x70,0x00,0x04,0x04,0x0c,0xc6,0xb7,0xed,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x60,0x60,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xf2,0x00,0x00,0xfc,0x03,0x80,
+ 0x1f,0x00,0x0c,0x00,0x04,0x08,0x30,0x78,0xbc,0xfd,0xf3,0x03,0x00,0x00,0x00,
+ 0x00,0x10,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x1f,0xfe,0x03,0x00,
+ 0x7c,0x00,0x80,0x03,0x00,0x02,0x10,0xc0,0x81,0xc7,0xf7,0xfd,0xfc,0x01,0x00,
+ 0x00,0x00,0x0c,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x60,0x06,0x00,
+ 0xe0,0x03,0x00,0x60,0x00,0x00,0x01,0x20,0x00,0x06,0x38,0x78,0x3e,0x33,0x7e,
+ 0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40,0xf8,
+ 0x03,0x1f,0x00,0x00,0x18,0x00,0x00,0x01,0xc0,0x00,0x18,0xc0,0x81,0xc7,0x4b,
+ 0x9c,0x0f,0x00,0x00,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40,
+ 0x00,0xbc,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x01,0x60,0x00,0x0e,0x78,
+ 0x78,0xa3,0xf7,0x00,0x80,0xc0,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,
+ 0x80,0x00,0xc0,0x1f,0x00,0xe0,0x00,0x00,0x80,0x00,0x00,0x02,0x80,0x03,0xf0,
+ 0x80,0x0f,0x7f,0xc0,0x07,0x60,0x30,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x68,0x80,0x00,0x40,0xe0,0x1f,0x10,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x0c,
+ 0x00,0x07,0xf0,0xc0,0x3b,0xf7,0x10,0xc8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0x01,0x01,0x80,0x00,0xf0,0xff,0xff,0xff,0x23,0x00,0x00,0x08,0x00,
+ 0xc0,0x00,0xc0,0x03,0xe0,0x00,0xcf,0x01,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x3a,0x01,0x80,0x00,0x00,0x10,0x00,0x00,0xcc,0x3f,0x00,0x10,
+ 0x00,0x00,0x07,0x00,0x3c,0x00,0x1f,0xf0,0x91,0x05,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xdc,0x02,0x80,0x00,0x00,0x10,0x00,0x00,0x10,0xc0,0xff,
+ 0x23,0x00,0x00,0x08,0x00,0xc0,0x00,0xe0,0x01,0x7c,0x02,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0x73,0x80,0x00,0x00,0x10,0x00,0x00,0x10,0x00,
+ 0x00,0xfc,0x0f,0x00,0x30,0x00,0x00,0x07,0x00,0xfa,0x9d,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x0e,0x01,0x00,0x00,0x00,0x00,0x10,
+ 0x00,0x00,0x40,0xf0,0xff,0xbf,0xff,0xff,0xff,0xff,0x03,0x46,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8e,0x3c,0x00,0x00,0x00,0x00,
+ 0x10,0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x08,0x00,0x02,0x36,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xc3,0x7f,0x00,0x00,
+ 0x00,0x10,0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x08,0x00,0x02,0x0c,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x81,0xff,
+ 0x3f,0x00,0x10,0x00,0x00,0x40,0x00,0x00,0x20,0x00,0x00,0x04,0x00,0x01,0x04,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0x21,0xc0,0xff,0x11,0x00,0x00,0x40,0x00,0x00,0x20,0x00,0x00,0x04,0x00,0x01,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x9f,0xf0,0xff,0x01,0x20,0x00,0x00,0x20,0x00,0x00,0x02,0x00,
+ 0x30,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xa0,0x76,0xff,0xff,0xdf,0x07,0x00,0x10,0x00,0x00,0xfd,
+ 0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x93,0x04,0xf7,0xdb,0xff,0xff,0xff,0xff,0x7f,
+ 0x03,0x38,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x17,0x84,0x88,0x06,0xf8,0xfe,0xff,0xff,
+ 0xbf,0x7f,0x77,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x88,0x44,0x0e,0x00,0x01,0x00,
+ 0x00,0x00,0x00,0x60,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0x89,0x22,0x17,0x00,0x01,
+ 0x00,0x00,0x00,0x60,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa8,0x49,0x90,0x18,0x00,
+ 0x02,0x00,0x00,0x00,0x10,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x4a,0x68,0x18,
+ 0x00,0x02,0x00,0x00,0x00,0x0c,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x4b,0x15,
+ 0x18,0x00,0x02,0x00,0x00,0x00,0x83,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,
+ 0x03,0x30,0x00,0x02,0x00,0x00,0x40,0x30,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x20,0x88,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x40,0x00,0x60,0x00,0x0c,0x00,0x00,0x18,0x46,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x60,0x00,0x08,0x00,0x00,0x04,0x31,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x60,0xd0,0xff,0xff,0x1f,0xc3,0x0c,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x6c,0xf8,0xff,0x9f,0x20,0x02,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x63,0x08,0x00,0x40,0x90,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x16,0x00,0x00,0x00,0x4c,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x10,0x30,0xa0,0x0d,0x22,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x6a,0xc0,0x80,0x1f,0x60,
+ 0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0xa1,0x04,0x61,0x00,
+ 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x41,0x01,0x12,
+ 0x01,0x40,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x43,0x0a,
+ 0x0d,0x01,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0x67,
+ 0xb4,0x02,0x02,0x60,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,
+ 0x98,0x08,0x04,0x02,0x10,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x1d,0x60,0x69,0x04,0x04,0x0e,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0x80,0x96,0x08,0x84,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0x06,0x00,0xa5,0x08,0x78,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0x00,0x00,0x4c,0x81,0x09,0x20,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x40,0x01,0x00,0x4c,0x7a,0x08,0x70,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x90,0x16,0x08,0x08,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x20,0x11,0x08,0x14,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x40,0x12,0x08,0x0b,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x58,0x12,0x88,0x06,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x58,0x12,0x68,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x00,0x58,0x12,0x98,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x58,0x12,
+ 0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x60,
+ 0x7d,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,
+ 0x88,0x11,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,
+ 0x00,0xac,0x08,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x0c,0x00,0x92,0x08,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x1a,0x80,0x54,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x32,0x60,0x2b,0xc4,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xa4,0xd7,0x60,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x88,0x3e,0x84,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xb0,0x10,0x65,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
diff --git a/bitmaps/enterprise-6.xbm b/bitmaps/enterprise-6.xbm
new file mode 100644 (file)
index 0000000..92b8847
--- /dev/null
@@ -0,0 +1,177 @@
+#define enterprise6_width 241
+#define enterprise6_height 67
+static unsigned char enterprise6_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe5, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xc0, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xdc, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xc0, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x20, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x78, 0x00, 0x00, 0x80, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xe0,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x56, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0xff, 0xff,
+   0x7f, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x40, 0xe0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54,
+   0x00, 0x00, 0x7e, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x43, 0xc0, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x4c, 0x00, 0x00, 0x42, 0x60, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+   0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x42,
+   0xe0, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xff, 0x07, 0x08, 0x00, 0x02, 0x80, 0xf8, 0xff, 0xff,
+   0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0x43, 0x20, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x80, 0x00,
+   0x08, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0xc2, 0xc0, 0x1f, 0x00, 0x00,
+   0x00, 0x42, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x01, 0x00, 0x00, 0x02, 0x80, 0x00,
+   0x00, 0x00, 0x02, 0x00, 0x30, 0x00, 0x00, 0x00, 0x42, 0x20, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85,
+   0x00, 0x01, 0xf0, 0xff, 0xff, 0x7f, 0xff, 0x3f, 0x80, 0x03, 0x00, 0x20,
+   0x00, 0x00, 0x00, 0x26, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x80, 0xff, 0x1f, 0x00, 0x02,
+   0x80, 0x00, 0xe0, 0xff, 0xdf, 0x81, 0x30, 0x00, 0x00, 0x00, 0x26, 0x30,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x3a, 0x00, 0xfe, 0x3f, 0x1f, 0x08, 0xc0, 0xff, 0x7f, 0x80, 0xf0,
+   0xff, 0x1f, 0x00, 0x00, 0x00, 0x24, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0xfe, 0x07, 0xff,
+   0xe0, 0x39, 0x20, 0xf0, 0x81, 0xff, 0x1f, 0x40, 0x06, 0x00, 0x00, 0x00,
+   0x24, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x44, 0x10, 0xe1, 0xff,
+   0xff, 0xff, 0x2f, 0x03, 0x00, 0x00, 0x00, 0x24, 0x10, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+   0xff, 0xff, 0x3f, 0xd2, 0x09, 0x68, 0xbe, 0x00, 0x00, 0xc0, 0x01, 0x00,
+   0x00, 0x00, 0x24, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfd, 0x3f, 0xfe, 0x24, 0x49,
+   0xd4, 0x7f, 0x01, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x24, 0x10, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xf0, 0x5f, 0x4b, 0xef, 0xf7, 0x03, 0x00, 0x80,
+   0x03, 0x00, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x06, 0x2a, 0x1c, 0x00, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x24,
+   0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x8a, 0x06, 0x00, 0x0c,
+   0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x58, 0x8b, 0x03, 0x00, 0x10, 0x00, 0x00, 0x0c, 0x00, 0x00,
+   0x00, 0x24, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf4, 0x00,
+   0x00, 0x30, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x75, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x38,
+   0x00, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x3f, 0x00, 0x00, 0x40, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x24, 0x08,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+   0x00, 0x60, 0x00, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xc0, 0x00, 0x00, 0x00,
+   0x28, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x0c, 0x00, 0x80, 0x01, 0x00, 0x00, 0x28, 0x08, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03,
+   0x00, 0x00, 0x38, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x06, 0x00, 0x00, 0x18, 0x04, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f,
+   0xff, 0x1d, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xe0, 0x17, 0x00, 0x02, 0xe0, 0x3f, 0x00, 0x18,
+   0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xf4, 0xff, 0xff, 0x07, 0xc0, 0xff, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x01, 0xf8, 0xfe,
+   0x9f, 0x1f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x10, 0x02, 0x00, 0x01, 0x00, 0x01, 0xe0, 0x7f, 0x04, 0x2f, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x01,
+   0x00, 0x00, 0x00, 0x60, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x08, 0xfe, 0xff, 0xff, 0xff, 0x0b, 0x00, 0xc0, 0x01,
+   0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03,
+   0x00, 0x01, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x08, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xe8, 0x03, 0x00, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x20,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xfe, 0xff,
+   0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x08, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+   0x78, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+   0x12, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x07, 0x06, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xfb, 0x3f, 0x01, 0xff, 0xff,
+   0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xd0, 0x12, 0xc0, 0xff, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x12, 0x00, 0x01,
+   0x80, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00};
diff --git a/bitmaps/fish-0.xbm b/bitmaps/fish-0.xbm
new file mode 100644 (file)
index 0000000..a2bc1ed
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish0_width 20
+#define fish0_height 20
+static unsigned char fish0_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x80, 0x1f, 0x00, 0xc0, 0x3f, 0x00, 0x40, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x38, 0x00,
+   0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/fish-1.xbm b/bitmaps/fish-1.xbm
new file mode 100644 (file)
index 0000000..82f1818
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish1_width 20
+#define fish1_height 20
+static unsigned char fish1_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x00,
+   0x80, 0x1f, 0x00, 0xc0, 0x7f, 0x00, 0xe0, 0x7f, 0x00, 0xb8, 0x1f, 0x00,
+   0x10, 0x06, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/fish-2.xbm b/bitmaps/fish-2.xbm
new file mode 100644 (file)
index 0000000..766845f
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish2_width 20
+#define fish2_height 20
+static unsigned char fish2_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+   0xc0, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x2f, 0x00, 0xc0, 0x3f, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/fish-3.xbm b/bitmaps/fish-3.xbm
new file mode 100644 (file)
index 0000000..15f1f00
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish3_width 20
+#define fish3_height 20
+static unsigned char fish3_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x86, 0x00,
+   0x80, 0xdf, 0x01, 0xe0, 0x7f, 0x00, 0xe0, 0x3f, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x06, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/fish-4.xbm b/bitmaps/fish-4.xbm
new file mode 100644 (file)
index 0000000..80405d8
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish4_width 20
+#define fish4_height 20
+static unsigned char fish4_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x80, 0x1f, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x2f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x00, 0xc0, 0x01, 0x00,
+   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/fish-5.xbm b/bitmaps/fish-5.xbm
new file mode 100644 (file)
index 0000000..580a265
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish5_width 20
+#define fish5_height 20
+static unsigned char fish5_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x10, 0x06, 0x00,
+   0xb8, 0x1f, 0x00, 0xe0, 0x7f, 0x00, 0xc0, 0x7f, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/fish-6.xbm b/bitmaps/fish-6.xbm
new file mode 100644 (file)
index 0000000..27057fc
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish6_width 20
+#define fish6_height 20
+static unsigned char fish6_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+   0x00, 0x38, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00,
+   0x40, 0x0f, 0x00, 0xc0, 0x3f, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/fish-7.xbm b/bitmaps/fish-7.xbm
new file mode 100644 (file)
index 0000000..38671d0
--- /dev/null
@@ -0,0 +1,8 @@
+#define fish7_width 20
+#define fish7_height 20
+static unsigned char fish7_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x06, 0x00,
+   0x80, 0x1f, 0x00, 0xe0, 0x3f, 0x00, 0xe0, 0x7f, 0x00, 0x80, 0xdf, 0x01,
+   0x00, 0x86, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/flipped_gray.xbm b/bitmaps/flipped_gray.xbm
new file mode 100644 (file)
index 0000000..b24f5db
--- /dev/null
@@ -0,0 +1,4 @@
+#define flipped_gray_width 4
+#define flipped_gray_height 2
+static unsigned char flipped_gray_bits[] = {
+   0x07, 0x0d};
diff --git a/bitmaps/good.xbm b/bitmaps/good.xbm
new file mode 100644 (file)
index 0000000..60dabc5
--- /dev/null
@@ -0,0 +1,9 @@
+#define good_width 21
+#define good_height 21
+static unsigned char good_bits[] = {
+   0x80, 0x1f, 0x00, 0x60, 0x60, 0x00, 0x10, 0x80, 0x00, 0x08, 0x00, 0x01,
+   0x04, 0x00, 0x02, 0xc2, 0x30, 0x04, 0xc2, 0x30, 0x04, 0x01, 0x00, 0x08,
+   0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x21, 0x40, 0x08, 0x21, 0x40, 0x08,
+   0x41, 0x20, 0x08, 0x82, 0x10, 0x04, 0x02, 0x0f, 0x04, 0x04, 0x00, 0x02,
+   0x08, 0x00, 0x01, 0x10, 0x80, 0x00, 0x60, 0x60, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x00, 0x00};
diff --git a/bitmaps/gray1.xbm b/bitmaps/gray1.xbm
new file mode 100644 (file)
index 0000000..186ea22
--- /dev/null
@@ -0,0 +1,4 @@
+#define gray1_width 2
+#define gray1_height 2
+static unsigned char gray1_bits[] = {
+   0x01, 0x02};
diff --git a/bitmaps/gray3.xbm b/bitmaps/gray3.xbm
new file mode 100644 (file)
index 0000000..0356c8d
--- /dev/null
@@ -0,0 +1,4 @@
+#define gray3_width 4
+#define gray3_height 4
+static unsigned char gray3_bits[] = {
+   0x01, 0x00, 0x04, 0x00};
diff --git a/bitmaps/hlines2.xbm b/bitmaps/hlines2.xbm
new file mode 100644 (file)
index 0000000..6b7e18e
--- /dev/null
@@ -0,0 +1,4 @@
+#define hlines2_width 1
+#define hlines2_height 2
+static unsigned char hlines2_bits[] = {
+   0x01, 0x00};
diff --git a/bitmaps/l-bob.xbm b/bitmaps/l-bob.xbm
new file mode 100644 (file)
index 0000000..f428960
--- /dev/null
@@ -0,0 +1,366 @@
+#define image_width 172
+#define image_height 246
+static unsigned char image_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xdf,0xff,0xf3,0xff,0x1f,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xdf,0xff,0xff,0x9f,0xff,0xe3,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x9f,0xff,
+ 0xff,0x3f,0xff,0xc7,0xff,0x3f,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0x1f,0xf2,0x7f,0x7f,0xfe,0xc3,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x3f,0xc0,0x7f,
+ 0x7e,0xfc,0xc1,0xff,0xff,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xcf,0x7f,0x00,0xff,0x7c,0xfc,0xc1,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x0f,0xff,0x00,0xff,0x78,
+ 0xf0,0xc1,0xff,0xff,0x03,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xfc,0x1f,0xfe,0x00,0xff,0x30,0xe0,0x81,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0x00,0xfc,0xff,0x7f,0x38,0x1f,0xfc,0x01,0xfe,0x01,0xe0,
+ 0x83,0xff,0xf9,0x07,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xff,0xff,0x3f,
+ 0x38,0x1e,0xf8,0x01,0xfc,0x01,0xe0,0x87,0xff,0xfb,0x07,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0x7f,0x00,0x3c,0xf0,0x01,0xf8,0x01,0xe0,0x8f,
+ 0xff,0xf3,0x07,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xc0,0xff,0xff,0x7f,0x00,
+ 0x3c,0xf0,0x03,0xf8,0x01,0xc0,0xff,0xff,0xf3,0x0f,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0x00,0x7c,0xe0,0x03,0xf0,0x01,0xc0,0xff,0xff,
+ 0xf3,0x3f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x81,0x7f,
+ 0xe0,0x03,0xf0,0x03,0xc0,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0x83,0xff,0xe0,0x03,0xe0,0x03,0xc0,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x97,0xff,0xc0,
+ 0x07,0xe0,0x03,0x80,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xf0,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xc1,0x07,0xc0,0x07,0x80,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0xf0,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xc1,0x07,
+ 0xc0,0x03,0x80,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0xf0,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0x83,0x0f,0xc0,0x07,0xc0,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0xf0,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xc7,0x0f,0xc0,
+ 0x1f,0xe0,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0xf0,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xcf,0x1f,0xc0,0x7f,0xfc,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xc0,0x7f,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xf0,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xc3,0x7f,0xfe,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0xf0,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0x7f,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0xf0,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0xfe,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xf0,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0xf0,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0xfe,0xff,0xff,0x0f,0xff,0xff,0x1f,0x00,0xf0,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xfe,0xff,0xff,
+ 0x07,0xff,0xff,0x1f,0x00,0xf0,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0xff,0xff,0xbf,0x00,0xff,0xff,0x1f,0x00,0xf0,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0x0f,0x00,
+ 0xff,0xff,0x1f,0x00,0xf0,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0xfe,0xff,0x3f,0x00,0xf0,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xfe,
+ 0xff,0x3f,0x00,0xf0,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0xfe,0xff,0x3f,0x00,0xf0,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xfc,0xff,
+ 0x3f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0x7f,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0xfc,0xff,0x3f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,
+ 0x7f,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xf8,0xff,0x3f,
+ 0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0x03,0xf0,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0x3f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0x03,
+ 0xe0,0xff,0xff,0xe7,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0xf8,0xff,0x7f,0x00,
+ 0xf0,0x00,0x00,0xf0,0xff,0xff,0x01,0x00,0x00,0x80,0xc3,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x7f,0x00,0xf0,
+ 0x00,0x00,0xf8,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xf8,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x7f,0x00,0xf0,0x00,
+ 0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0x7f,0x00,0xf0,0x00,0x00,
+ 0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x7f,
+ 0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x7f,0x00,
+ 0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x7f,0x00,0xf0,
+ 0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xc0,0xff,0x7f,0x00,0xf0,0x00,
+ 0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x70,0xc0,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xc0,0xff,0x7f,0x00,0xf0,0x00,0x00,
+ 0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0xc1,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xc1,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xc1,
+ 0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xc1,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xc1,0xff,
+ 0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0xc1,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xc1,0xff,0x7f,
+ 0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xc1,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xc1,0xff,0x7f,0x00,
+ 0xf0,0x00,0x00,0xf0,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xc1,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xc1,0xff,0x7f,0x00,0xf0,
+ 0x00,0x00,0xf0,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xc3,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0x03,0x40,0x91,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x00,0xe0,0xc3,0xff,0x7f,0x00,0xf0,0x00,
+ 0x00,0xf0,0xff,0xff,0x03,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xf0,0xff,0x0f,
+ 0xe0,0xc3,0xff,0x7f,0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0xc3,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xf3,0xc3,0xff,0x7f,0x00,0xf0,0x00,0x00,
+ 0xfc,0xff,0xff,0xe3,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xf7,
+ 0x83,0xff,0xff,0x00,0xf0,0x00,0x00,0xfc,0xff,0xff,0xf3,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0x00,0xf0,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x03,
+ 0xff,0xff,0x00,0xf0,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0x07,0xff,0xff,0x00,0xf0,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0x01,0xfc,0xff,0x01,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x07,0xff,
+ 0xff,0x00,0xf0,0x00,0x00,0xfc,0xff,0xff,0x5f,0x00,0xf8,0xff,0x03,0x00,0x00,
+ 0xc0,0xff,0x3f,0x00,0xff,0x0f,0xff,0xff,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,
+ 0x1f,0x00,0xe0,0xff,0x07,0x00,0x00,0xe0,0xff,0x03,0x00,0xfc,0x0f,0xfe,0x7f,
+ 0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x1f,0x00,0xc0,0xff,0x0f,0x00,0x00,0xf0,
+ 0xff,0x00,0x00,0xf0,0x0f,0xfe,0x7f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0x1f,
+ 0xf0,0xff,0xff,0x1f,0x00,0x00,0xf8,0xff,0x23,0x00,0xe0,0x1f,0xfe,0x3f,0x00,
+ 0xf0,0x00,0x00,0xf8,0xff,0xff,0x1f,0xfe,0xff,0xff,0x3f,0x00,0x00,0xfc,0xff,
+ 0xff,0x07,0xe0,0x1f,0xfe,0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0xfe,0xff,0xff,0x3f,0xc0,0x1f,0xfe,0x3f,0x00,0xf0,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,
+ 0x7f,0xc0,0x1f,0xfe,0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,0x3f,0xfe,0xff,0xff,
+ 0xff,0xff,0x01,0x80,0xff,0xff,0xff,0xff,0x81,0x1f,0xfc,0x3f,0x00,0xf0,0x00,
+ 0x00,0xf8,0xff,0x3f,0xfc,0xff,0xff,0xff,0xff,0x01,0xc0,0xff,0xff,0xff,0xff,
+ 0x83,0x1f,0xfc,0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,0x1f,0xf8,0xff,0xff,0xff,
+ 0xff,0x01,0xe0,0xff,0xff,0xff,0xff,0x83,0x1f,0xfc,0x3f,0x00,0xf0,0x00,0x00,
+ 0xf8,0xff,0x1f,0xf8,0xf7,0xff,0xf9,0xff,0x01,0xe0,0xff,0xff,0xff,0xfb,0x03,
+ 0x1f,0xfc,0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,0x0f,0xf8,0xc1,0xff,0xe0,0xff,
+ 0x03,0xf0,0xff,0x83,0xff,0xe1,0x07,0x1e,0xfe,0x3f,0x00,0xf0,0x00,0x00,0xf8,
+ 0xff,0x0f,0xf8,0xc1,0xff,0xe0,0xff,0x03,0xf0,0xff,0x83,0xff,0xe1,0x07,0x1e,
+ 0xfe,0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,0x0f,0xf8,0xc0,0xff,0xe0,0xff,0x03,
+ 0xe0,0xff,0x81,0xff,0xe1,0x07,0x1f,0xfe,0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,
+ 0x0f,0xf8,0xc0,0xff,0xe0,0xff,0x03,0xc0,0xff,0x80,0xff,0xe1,0x03,0x1e,0xfe,
+ 0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,0x1f,0x70,0xc0,0x7f,0xf0,0xff,0x03,0x00,
+ 0x00,0x80,0xff,0xe1,0x01,0x1e,0xfe,0x3f,0x00,0xf0,0x00,0x00,0xf8,0xff,0x1f,
+ 0x20,0x00,0x07,0xf8,0xff,0x03,0x00,0x00,0xf8,0xff,0xc0,0x00,0x1e,0xfe,0x1f,
+ 0x00,0xf0,0x00,0x00,0xf8,0xff,0x0f,0x00,0x00,0x00,0xfe,0xff,0x03,0x00,0x00,
+ 0xfe,0x07,0x00,0x00,0x1e,0xfe,0x1f,0x00,0xf0,0x00,0x00,0xf8,0xff,0x0f,0x00,
+ 0x00,0x80,0xff,0xfc,0x03,0x00,0x00,0xfe,0x03,0x00,0x00,0x1e,0xfe,0x1f,0x00,
+ 0xf0,0x00,0x00,0xf8,0xbf,0x0f,0x00,0x00,0xe0,0xff,0xfc,0x03,0x00,0x00,0xfe,
+ 0x03,0x00,0x00,0x08,0xfe,0x1f,0x00,0xf0,0x00,0x00,0xf0,0xbf,0x0f,0x00,0x00,
+ 0xf8,0x7f,0xfc,0x03,0x00,0x00,0xfc,0x0f,0x00,0x00,0x00,0xfe,0x1f,0x00,0xf0,
+ 0x00,0x00,0xf0,0x3f,0x0f,0x00,0xfc,0xff,0x3f,0xf8,0x03,0x00,0x00,0xf8,0xff,
+ 0x00,0x00,0x00,0xfe,0x0f,0x00,0xf0,0x00,0x00,0xf0,0x3f,0x0e,0x00,0xfc,0xff,
+ 0x0f,0xf8,0x01,0x00,0x00,0xf0,0xff,0x01,0x00,0x00,0xfe,0x1f,0x00,0xf0,0x00,
+ 0x00,0xf0,0x3f,0x0f,0x00,0xfc,0xff,0x07,0xf8,0x01,0x00,0x00,0xc0,0xff,0x01,
+ 0x00,0x00,0xfe,0x0f,0x00,0xf0,0x00,0x00,0xf0,0x7f,0x06,0x00,0xfc,0xff,0x01,
+ 0xf8,0x01,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x0f,0x00,0xf0,0x00,0x00,
+ 0xf0,0x7f,0x06,0x00,0xe0,0x3f,0x00,0xf8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0x0f,0x00,0xf0,0x00,0x00,0xf0,0x7f,0x06,0x00,0x00,0x07,0x00,0xf8,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x07,0x00,0xf0,0x00,0x00,0xe0,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0xf8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0x07,0x00,0xf0,0x00,0x00,0xe0,0x7f,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x07,0x00,0xf0,0x00,0x00,0xf0,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0x07,0x00,0xf0,0x00,0x00,0xe0,0x7f,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x0f,0x00,0xf0,0x00,0x00,0xe0,0x7f,0x1c,
+ 0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x0f,
+ 0x00,0xf0,0x00,0x00,0xe0,0x7f,0x3c,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x9e,0x0f,0x00,0xf0,0x00,0x00,0xe0,0xff,0x3c,0x00,
+ 0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9e,0x0f,0x00,
+ 0xf0,0x00,0x00,0xc0,0xfd,0x7c,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x9e,0x0f,0x00,0xf0,0x00,0x00,0x80,0xfd,0x7c,0x00,0x00,
+ 0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x07,0x00,0xf0,
+ 0x00,0x00,0x00,0xfc,0x7c,0x00,0x00,0x00,0x80,0x3f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x9f,0x07,0x00,0xf0,0x00,0x00,0x00,0xfc,0xfc,0x00,0x00,0x00,
+ 0x80,0x3f,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x07,0x00,0xf0,0x00,
+ 0x00,0x80,0xff,0xfc,0x00,0x00,0x00,0xe0,0x3f,0x00,0x38,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0x03,0x00,0xf0,0x00,0x00,0x80,0xff,0xf8,0x01,0x00,0x00,0xf0,
+ 0x3f,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,0x00,0xf0,0x00,0x00,
+ 0x00,0xff,0xf8,0x03,0x00,0x00,0xf8,0x3f,0x00,0x20,0x00,0x1e,0x00,0x00,0x00,
+ 0x04,0xef,0x01,0x00,0xf0,0x00,0x00,0x00,0xff,0xf8,0x03,0x00,0x00,0xff,0x1f,
+ 0x00,0x20,0xc0,0x7f,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
+ 0x7c,0xf8,0x07,0x00,0x80,0xff,0x1f,0x00,0x00,0xe0,0xff,0x01,0x00,0x00,0x0f,
+ 0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0x07,0x00,0xe0,0xff,0x1f,0x00,
+ 0x00,0xe0,0xff,0x03,0x00,0xc0,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
+ 0xf8,0x07,0x00,0xf0,0xff,0x1f,0x00,0x00,0xf0,0xff,0x07,0x00,0xc0,0x1f,0x00,
+ 0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0x0f,0x00,0xf8,0xfe,0x1f,0x00,0x00,
+ 0xfc,0xf3,0x0f,0x00,0xf0,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,
+ 0x0f,0x00,0x7c,0xfc,0x3f,0x00,0x80,0xff,0xe1,0x3f,0x00,0xf8,0x0f,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0x1f,0x00,0x3e,0xfc,0xbf,0x00,0xe0,0xff,
+ 0xc0,0x3f,0x00,0xfe,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0x1f,
+ 0x00,0x1f,0xfc,0xff,0x03,0xf0,0x7f,0x80,0x7f,0x80,0xff,0x0f,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0x00,0xf8,0x1f,0x80,0x0f,0xfe,0xff,0x07,0xfe,0x3f,0x00,
+ 0x7f,0xf8,0xff,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0x7f,0xe0,
+ 0x07,0xff,0xff,0xff,0xff,0x1f,0x00,0xff,0xf9,0xff,0x0f,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0xf0,0x83,0xff,0xff,0xff,0xff,0x03,0x00,0xfe,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0x83,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0xfe,0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0x80,0xff,0xff,0xff,0x7f,0x00,0x00,0xfc,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xe0,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0xf8,0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0x7f,0xe0,0xff,0xff,0xff,0x1f,0x00,0x00,0xf8,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xfc,0xff,0x3f,0xf0,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0xf0,0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0x1f,0xfc,0xff,0xff,0xff,0x07,0x00,0x00,0xf8,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xfc,0xff,0x07,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0xf0,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0x83,0xff,0xff,0xff,0xff,0x01,0x00,0xff,0xff,0x1f,0xff,0x1f,0x00,
+ 0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xfc,0xff,0x81,0xff,0xff,0xff,0xff,0x00,
+ 0xe0,0xff,0xff,0x07,0xf8,0x1f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0x01,0xff,0xff,0xff,0x3f,0x80,0xff,0xff,0xff,0x01,0xf8,0x3f,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0x00,0xfc,0xff,0x01,0xfe,0xff,0xff,0x1f,0xc0,0xff,
+ 0xff,0xff,0x00,0xf8,0x1f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0x01,0xf8,0xff,0xff,0x1f,0xf8,0xff,0xff,0x7f,0x00,0xf8,0x1f,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0x00,0xf8,0xff,0x01,0xf8,0x8f,0xfc,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0xfc,0x1f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf8,0xff,0x01,
+ 0xf8,0x0f,0xe0,0xff,0xff,0x07,0xf8,0x0f,0x00,0xfc,0x1f,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0xf8,0xe7,0x03,0xf8,0x0f,0x00,0x04,0x00,0x00,0xf8,0x0f,
+ 0x00,0xfc,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf0,0xef,0x03,0xfc,
+ 0x0f,0x00,0x00,0x00,0x00,0xfe,0x07,0x00,0xfc,0x0f,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0x00,0x00,0xf0,0xef,0x07,0xfc,0x1f,0x00,0x00,0x00,0x00,0xff,0x03,0x00,
+ 0xfc,0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xf0,0xc7,0x07,0xf8,0x3f,
+ 0x00,0x00,0x00,0x00,0xff,0x01,0x00,0xfe,0x07,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0x00,0x00,0xe0,0xc7,0x07,0xf8,0xff,0x01,0x00,0x00,0x00,0xff,0x00,0x00,0xfe,
+ 0x07,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xe0,0xc7,0x07,0xf0,0xff,0x0f,
+ 0x00,0x00,0x00,0xff,0x00,0x00,0xff,0x07,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
+ 0x00,0xe0,0xc7,0x07,0xf0,0xff,0x1f,0x00,0x00,0x80,0xff,0x00,0x00,0xff,0x03,
+ 0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0xc0,0xcf,0x07,0xf0,0xff,0x3f,0x00,
+ 0x00,0xc0,0x7f,0x00,0x00,0xff,0x03,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
+ 0xc0,0xdf,0x07,0xe0,0xff,0x3f,0x00,0x00,0xe0,0x07,0x00,0x80,0xff,0x01,0x00,
+ 0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x80,0x9f,0x0f,0xe0,0xff,0x7f,0x00,0x00,
+ 0xc6,0x00,0x00,0x80,0xff,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x80,
+ 0xbf,0x0f,0xe0,0xff,0x7f,0x00,0xfc,0x0f,0x00,0x00,0x80,0xff,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xff,0x0f,0xc0,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0xc0,0xff,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0x0f,0x80,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xc0,0x7f,0x00,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0x00,0x00,0xfe,0x0f,0x80,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0xc0,0x7f,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xfe,0x0f,
+ 0x80,0xff,0xff,0xf0,0x3f,0x00,0x00,0x00,0xe0,0x7f,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x1f,0xc0,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0x3f,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xfc,0x1f,0xe0,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f,0x00,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0x3c,0xf0,0xff,0x7f,0x00,0x00,0x10,0x00,0x00,0xf0,
+ 0x1f,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xf8,0x3c,0xf0,0xff,
+ 0xff,0x00,0xf0,0x7f,0x00,0x00,0xf8,0x1f,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0x18,0xfc,0xff,0xff,0x07,0xfe,0xff,0x00,0x00,0xf8,0x1f,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xe0,0x10,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0xf8,0x0f,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0x00,0xff,0xcf,0xff,0xff,0xff,0xff,0x01,0x00,0xfc,0x0f,0x00,
+ 0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x40,0xc0,0xff,0x87,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0xfc,0x07,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0x83,0xff,0xff,0xff,0xff,0x00,0x00,0xfc,0x03,0x00,0x00,
+ 0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0x81,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0xfe,0x03,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0x81,0xff,0xff,0xff,0x1f,0x00,0x00,0xfe,0x01,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xc1,0xff,0xcf,0xff,0x0f,
+ 0x00,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xf0,0xff,0x03,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xf0,0xff,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0x7f,0xf0,0x3f,0x00,0x00,0x00,0x00,0xc0,0xff,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x3f,0xf0,0x3f,0x00,0x00,0x00,0x00,0xc0,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0xc0,0x00,0x00,0x00,0xff,0x3f,
+ 0xfc,0x1f,0x00,0x00,0x00,0x00,0xe0,0x3f,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0xf0,0x03,0x03,0xc0,0xff,0x1f,0xfc,0x0f,0x00,0x00,0x00,0x00,0xf0,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0xfc,0x83,0x07,0xe0,0xff,0x3f,0xfc,
+ 0x07,0x00,0x00,0x00,0x00,0xf8,0x0f,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0xfe,0x87,0x07,0xf0,0xff,0x3f,0xfe,0x07,0x00,0x00,0x00,0x00,0xfc,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0xfe,0xc3,0x0f,0xf8,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0xfe,0x0f,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x80,0xff,
+ 0xc3,0x1f,0xfc,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0x00,0x80,0xff,0xe3,0x1f,0xfe,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xe0,0xff,0xf1,
+ 0x3f,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x80,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0x00,0xe0,0x1f,0xfc,0xff,0xff,0x3f,0xfc,0xff,0x03,0x00,0x00,
+ 0x00,0xe0,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xe0,0x1f,0xfc,0xff,
+ 0xff,0x3f,0xfc,0xff,0x03,0x00,0x00,0x00,0xe0,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0xe0,0x0f,0xfc,0xff,0xff,0x1f,0xfc,0xff,0x03,0x00,0x00,0x00,
+ 0xf0,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xc0,0x01,0xfe,0xff,0xff,
+ 0x1f,0xf8,0xff,0x07,0x00,0x00,0x00,0xfc,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0xfe,0xff,0xff,0x0f,0xf8,0xff,0x0f,0x00,0x00,0x80,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
+ 0xf0,0xff,0xff,0x0f,0x08,0xfc,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x0f,0x1c,0xfc,0xff,0xff,0x07,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x80,0xff,0x1f,0xf8,0xff,0xff,0x03,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,
+ 0xff,0x3f,0xf8,0xff,0xff,0x01,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xff,0x3f,0xf0,0xff,0xff,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xff,
+ 0x7f,0xf0,0xff,0xff,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0xff,0xff,0xe0,0xff,0x7f,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xff,0xff,
+ 0xe0,0xff,0x7f,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0x00,0xfe,0xff,0xc0,0xff,0x3f,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xfc,0xff,0xc1,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0x00,0xfc,0xff,0xc1,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xfc,0xff,0xc1,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0xfc,0xff,0xc1,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xf8,0xff,0xc3,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0x00,0xf8,0xff,0xc3,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xf0,0xff,0xc3,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0xf0,0xff,0xc7,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xe0,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,
+ 0xe0,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xc0,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x80,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0xfe,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0x00,0x00,0xfc,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0xf8,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0x00,0x00,0xe0,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0};
+
+/* J.R. "Bob" Dobbs, the holy prophet of the Church of the SubGenius */
diff --git a/bitmaps/l-bsd.xbm b/bitmaps/l-bsd.xbm
new file mode 100644 (file)
index 0000000..33e4f04
--- /dev/null
@@ -0,0 +1,52 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x50, 0x3c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x48, 0xee,
+   0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x81, 0x0f, 0x70, 0x00, 0x00,
+   0x00, 0x00, 0xa8, 0x00, 0x0a, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00,
+   0x38, 0xa0, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x38, 0x90, 0x01, 0x00,
+   0x00, 0x00, 0x30, 0x07, 0x50, 0xdc, 0x01, 0x00, 0x00, 0x00, 0x90, 0x08,
+   0xc0, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x90, 0xc8, 0x01, 0xd0, 0x00, 0x00,
+   0x00, 0x00, 0x48, 0x24, 0x02, 0x7c, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x25,
+   0x02, 0x34, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25, 0x82, 0x0f, 0x00, 0x00,
+   0x00, 0x00, 0xc4, 0x73, 0xc2, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x53,
+   0xa2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x81, 0xf1, 0x82, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x01, 0xf3, 0xe1, 0x01, 0x00, 0x00, 0x00, 0x06, 0x81, 0xe0,
+   0xa0, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x41, 0x00, 0x90, 0x00, 0x00, 0x00,
+   0x00, 0x1c, 0x96, 0x08, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x24, 0x0f,
+   0x70, 0x00, 0x00, 0x00, 0xc0, 0x18, 0xc8, 0x80, 0x58, 0x00, 0x00, 0x00,
+   0xc0, 0x11, 0x90, 0x73, 0x34, 0x00, 0x00, 0x00, 0x80, 0x13, 0x60, 0x0f,
+   0x1a, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x80, 0x00, 0x07, 0x00, 0x00, 0x00,
+   0x38, 0x3c, 0x00, 0xd1, 0x06, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x0e, 0x01,
+   0x05, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x13, 0x01, 0x07, 0x00, 0x00, 0x00,
+   0x00, 0xe0, 0xa9, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x43, 0x80,
+   0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00,
+   0x00, 0x80, 0x2c, 0x80, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x80, 0xa4, 0x3e,
+   0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd2, 0xa1, 0x0e, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x59, 0x61, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x01,
+   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x06, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x40, 0x80, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1,
+   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xff, 0x05, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x10, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x80,
+   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x37, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x20, 0xc0, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xc1,
+   0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7b, 0xdc, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x60, 0x08, 0xf6, 0xff, 0x00, 0x00, 0x00, 0x00, 0x30, 0x99,
+   0x04, 0x57, 0x0f, 0x00, 0x00, 0x00, 0xd0, 0x28, 0x04, 0xfc, 0x17, 0x00,
+   0x00, 0x00, 0xc8, 0x5e, 0x08, 0x00, 0xfc, 0x00, 0x00, 0xc0, 0xb7, 0x27,
+   0x08, 0x00, 0xb0, 0x01, 0x00, 0x30, 0xf4, 0x19, 0x18, 0x00, 0xc0, 0x02,
+   0x00, 0x08, 0x5c, 0x0a, 0x1c, 0x00, 0xb4, 0x03, 0x00, 0x04, 0x04, 0x03,
+   0x0b, 0x80, 0xdb, 0x00, 0x00, 0x04, 0x06, 0xd1, 0x07, 0x80, 0x34, 0x00,
+   0x00, 0xf8, 0x01, 0xe2, 0x00, 0xe0, 0x09, 0x00, 0x00, 0x00, 0x06, 0x1f,
+   0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+/*
+ * BSD daemon
+ * The original BSD daemon is Copyright (c) 1988 Marshall Kirk McKusick.
+ * All Rights Reserved.  Reproduced with permission.
+ */
diff --git a/bitmaps/l-dec.xbm b/bitmaps/l-dec.xbm
new file mode 100644 (file)
index 0000000..d737889
--- /dev/null
@@ -0,0 +1,27 @@
+#define image_width 82
+#define image_height 26
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+   0xef, 0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef,
+   0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f,
+   0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0xff,
+   0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0xff, 0xf7,
+   0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xec, 0x79, 0xff, 0xf7, 0xbc,
+   0xff, 0xfb, 0xbf, 0xe7, 0x01, 0xfe, 0xec, 0x79, 0xff, 0xf7, 0xbc, 0xc7,
+   0xfb, 0xbf, 0xe7, 0x01, 0xfe, 0xec, 0x79, 0xff, 0xf7, 0xbc, 0xc7, 0xfb,
+   0xbf, 0xe7, 0x01, 0xfe, 0xec, 0x7f, 0xff, 0xf7, 0xbf, 0xc7, 0xfb, 0xbf,
+   0xe7, 0x01, 0x0e, 0xec, 0x79, 0x0f, 0xf6, 0xbc, 0x83, 0x3b, 0xb8, 0xe7,
+   0x01, 0x06, 0xec, 0x79, 0x07, 0xf6, 0xbc, 0x83, 0x1b, 0xb0, 0xe7, 0x01,
+   0x46, 0xec, 0x79, 0x23, 0xf6, 0xbc, 0xc7, 0xfb, 0xb1, 0xe7, 0x01, 0xe6,
+   0xec, 0x79, 0x73, 0xf6, 0xbc, 0xc7, 0x3b, 0xb0, 0xe7, 0x01, 0xe6, 0xec,
+   0x79, 0x73, 0xf6, 0xbc, 0xc7, 0x1b, 0xb0, 0xe7, 0x01, 0xe6, 0xec, 0x79,
+   0x73, 0xf6, 0xbc, 0xc7, 0x9b, 0xb1, 0xe7, 0x01, 0x46, 0xec, 0x79, 0x23,
+   0xf6, 0xbc, 0xc7, 0x9b, 0xb1, 0xe7, 0x01, 0x06, 0xec, 0x79, 0x07, 0xf6,
+   0xbc, 0x87, 0x1b, 0xb0, 0xe7, 0x01, 0x1e, 0xec, 0x79, 0x0f, 0xf6, 0xbc,
+   0x8f, 0x3b, 0xb0, 0xe7, 0x01, 0xfe, 0xef, 0x7f, 0x7f, 0xf6, 0xbf, 0xff,
+   0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0x23, 0xf6, 0xbf, 0xff, 0xfb,
+   0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0x07, 0xf7, 0xbf, 0xff, 0xfb, 0xbf,
+   0xff, 0x01, 0xfe, 0xef, 0x7f, 0x9f, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff,
+   0x01, 0xfe, 0xef, 0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01,
+   0xfe, 0xef, 0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/l-hp.xbm b/bitmaps/l-hp.xbm
new file mode 100644 (file)
index 0000000..1be3800
--- /dev/null
@@ -0,0 +1,20 @@
+#define image_width 46
+#define image_height 34
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xff, 0x79, 0xfe, 0xff, 0xc1,
+   0xf8, 0xff, 0x39, 0xfe, 0xff, 0xc7, 0xfc, 0xff, 0x3d, 0xfc, 0xff, 0xcf,
+   0xfc, 0xff, 0x3c, 0xe0, 0xff, 0xcf, 0xfe, 0x7f, 0x1c, 0x80, 0xff, 0xdf,
+   0xfe, 0x3f, 0x1c, 0x00, 0xff, 0xdf, 0xfe, 0x1f, 0x1e, 0x00, 0xfe, 0xdf,
+   0xfe, 0x0f, 0x1e, 0x00, 0xfc, 0xdf, 0xfe, 0x07, 0x0e, 0x00, 0xf8, 0xdf,
+   0xfe, 0x07, 0x0f, 0x00, 0xf8, 0xdf, 0xfe, 0x03, 0x7f, 0xfc, 0xf1, 0xdf,
+   0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf, 0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf,
+   0xfe, 0x81, 0xf7, 0xde, 0xe3, 0xdf, 0xfe, 0x81, 0x77, 0xde, 0xe1, 0xdf,
+   0xfe, 0x81, 0x73, 0xce, 0xe1, 0xdf, 0xfe, 0xc1, 0x7b, 0xee, 0xe1, 0xdf,
+   0xfe, 0xc1, 0x7b, 0xef, 0xe1, 0xdf, 0xfe, 0xc1, 0x3b, 0xe7, 0xe0, 0xdf,
+   0xfe, 0xc3, 0x39, 0xff, 0xf0, 0xdf, 0xfe, 0xe3, 0xbd, 0xff, 0xf0, 0xdf,
+   0xfe, 0xe3, 0xbd, 0x7f, 0xf0, 0xdf, 0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf,
+   0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf, 0xfe, 0x0f, 0xc0, 0x03, 0xfc, 0xdf,
+   0xfe, 0x1f, 0xc0, 0x03, 0xfe, 0xdf, 0xfe, 0x3f, 0xc0, 0x01, 0xff, 0xdf,
+   0xfe, 0x7f, 0xc0, 0x81, 0xff, 0xdf, 0xfc, 0xff, 0xe1, 0xe1, 0xff, 0xcf,
+   0xfc, 0xff, 0xe7, 0xfc, 0xff, 0xcf, 0xf8, 0xff, 0xe7, 0xfc, 0xff, 0xc7,
+   0xe0, 0xff, 0xf3, 0xfc, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0};
diff --git a/bitmaps/l-ibm.xbm b/bitmaps/l-ibm.xbm
new file mode 100644 (file)
index 0000000..203c6de
--- /dev/null
@@ -0,0 +1,32 @@
+#define image_width 78
+#define image_height 34
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0xff, 0xf8, 0xff,
+   0x3f, 0xf0, 0xff, 0x00, 0xff, 0xcf, 0xfc, 0xff, 0xf8, 0xff, 0x7f, 0xf0,
+   0xff, 0x00, 0xff, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0xfc, 0xff, 0xf8, 0xff, 0xff, 0xf1, 0xff, 0xc1, 0xff, 0xcf, 0xfc, 0xff,
+   0xf8, 0xff, 0xff, 0xf1, 0xff, 0xc1, 0xff, 0xcf, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0xff, 0xe3,
+   0xff, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0xff, 0xe3, 0xff, 0xc0,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0f, 0x80, 0xff,
+   0xff, 0x00, 0xff, 0xf7, 0xff, 0xc0, 0xc0, 0x0f, 0x80, 0xff, 0x7f, 0x00,
+   0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0xc0, 0x0f, 0x80, 0xff, 0x7f, 0x00, 0xbf, 0xff, 0xfd, 0xc0, 0xc0, 0x0f,
+   0x80, 0xff, 0x7f, 0x00, 0xbf, 0xff, 0xfd, 0xc0, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0x3f, 0x7f,
+   0xfc, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0x3f, 0x7f, 0xfc, 0xc0,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0xff, 0xf8, 0xff,
+   0xff, 0xf1, 0x3f, 0x3e, 0xfc, 0xcf, 0xfc, 0xff, 0xf8, 0xff, 0xff, 0xf1,
+   0x3f, 0x3e, 0xfc, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0xfc, 0xff, 0xf8, 0xff, 0x7f, 0xf0, 0x3f, 0x1c, 0xfc, 0xcf, 0xfc, 0xff,
+   0xf8, 0xff, 0x3f, 0xf0, 0x3f, 0x1c, 0xfc, 0xcf, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0};
diff --git a/bitmaps/l-linux.xbm b/bitmaps/l-linux.xbm
new file mode 100644 (file)
index 0000000..7ceeaf9
--- /dev/null
@@ -0,0 +1,205 @@
+#define image_width 128
+#define image_height 151
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+   0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
+   0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x1f, 0x00, 0x00, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x06, 0xf8, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
+   0x00, 0x09, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x0f, 0x00, 0x00, 0x00, 0x02, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x50, 0x00, 0x00, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x14, 0x00,
+   0xe8, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x03, 0x2e, 0x00, 0x5c, 0x07, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x5f, 0x00, 0xf7, 0x0b, 0x00, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0x7d, 0x00,
+   0xfe, 0x0f, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x83, 0x7f, 0x80, 0xff, 0x0b, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xf1, 0x80, 0x0f, 0x1f, 0x00, 0xfe,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xe0, 0x80,
+   0x87, 0x1e, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xc7, 0xc8, 0x81, 0x87, 0x1c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xd0, 0x80, 0x03, 0x3c, 0x00, 0xfe,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xd0, 0x81,
+   0x03, 0x3c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xc7, 0xc0, 0x00, 0x03, 0x3c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0xc0, 0x2a, 0x03, 0x3c, 0x00, 0xfe,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0x41, 0xff,
+   0x01, 0x3c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x87, 0xa1, 0x2b, 0x0f, 0x1e, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xeb, 0xfe, 0x9f, 0x0f, 0x00, 0xfe,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf7, 0xfb,
+   0x76, 0x0d, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x07, 0xba, 0xdf, 0xff, 0x07, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xea, 0xfd, 0xdb, 0x1e, 0x00, 0xfc,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x7d, 0x6f,
+   0xff, 0x1b, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x87, 0xd6, 0xfd, 0x6d, 0x1b, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x47, 0xfb, 0xef, 0xf7, 0x15, 0x00, 0xfc,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x47, 0x6d, 0xff,
+   0x3e, 0x1d, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x87, 0xde, 0xbb, 0xcf, 0x16, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfa, 0xef, 0xb3, 0x0b, 0x04, 0xf8,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xd8, 0xbe,
+   0xe8, 0x05, 0x08, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x87, 0xf2, 0x37, 0x55, 0x1d, 0x54, 0xf0, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x01, 0x40, 0x7d, 0x3f, 0x28, 0xe0,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xd7, 0xbf,
+   0x8b, 0x3f, 0xa8, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x8f, 0x57, 0x65, 0xf5, 0x77, 0x50, 0xc0, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x4e, 0x5b, 0x75, 0x5f, 0x40, 0xc0,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0x3f, 0x2a,
+   0xfd, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x83, 0x77, 0x89, 0xee, 0xff, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xdf, 0xf5, 0xff, 0xff, 0x00, 0x00,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0x7f, 0xff,
+   0xfe, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xc0, 0xff, 0xfd, 0xff, 0xff, 0x01, 0x00, 0xfe, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0x7f, 0xc0, 0xdf, 0xb7, 0xff, 0xff, 0x03, 0x00,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xe0, 0xff, 0xfe,
+   0xff, 0xff, 0x03, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0x3f, 0xf0, 0xff, 0xfb, 0xff, 0xff, 0x07, 0x00, 0xf8, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00,
+   0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff,
+   0xff, 0xff, 0x07, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xe0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00,
+   0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff,
+   0xff, 0xff, 0x0f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0x03, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
+   0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
+   0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0x7f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x1f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+   0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x80, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+   0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xe0, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01,
+   0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
+   0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
+   0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x07, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+   0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0xff,
+   0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfe, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x00,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfc, 0xff,
+   0xff, 0xff, 0x7f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x7f, 0x80,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf8, 0xff,
+   0xff, 0xff, 0x3f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x3f, 0x80, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x1f, 0x80,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+   0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x07, 0xc0,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+   0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x03, 0xc0,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+   0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x03, 0xc0,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+   0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xe3, 0xc3,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0xff, 0x5f, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xf7, 0x8f, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x36, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xbb, 0x1d,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff,
+   0xff, 0xff, 0xf7, 0x37, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x36,
+   0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xda, 0x5e, 0xf8, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xbf, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0xbd, 0xfb,
+   0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x00, 0x80, 0xfb, 0xff,
+   0xff, 0xff, 0xeb, 0xbf, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f,
+   0x00, 0x80, 0xfe, 0xff, 0xff, 0x7f, 0xfd, 0xf5, 0x81, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xbf, 0x15, 0x00, 0xc0, 0xf7, 0xff, 0xff, 0x5f, 0xb7, 0xde,
+   0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x6f, 0x00, 0xe0, 0xfe, 0xff,
+   0xff, 0xaf, 0xfd, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x3d,
+   0x00, 0xb0, 0xf7, 0xff, 0xff, 0x6a, 0xd7, 0xb6, 0x05, 0xfc, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x57, 0x01, 0xd4, 0xfd, 0xff, 0x6f, 0xb5, 0xbf, 0xff,
+   0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xbb, 0x4a, 0x75, 0xff, 0xff,
+   0xf3, 0xef, 0xf5, 0xb6, 0x06, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd6,
+   0xaa, 0xda, 0xf7, 0xff, 0x5f, 0x7d, 0xef, 0xff, 0x1f, 0xc0, 0xff, 0xff,
+   0xff, 0xff, 0x7f, 0xbf, 0xaa, 0xf6, 0xfd, 0xff, 0xf5, 0xdf, 0x7f, 0xb7,
+   0x2d, 0x00, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xd5, 0x55, 0xbb, 0xde, 0xff,
+   0xdd, 0xf6, 0xd5, 0xfb, 0x3f, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xbf, 0xbe,
+   0xfe, 0xee, 0xf7, 0xff, 0xf7, 0x7b, 0x7f, 0x6f, 0x5b, 0x00, 0xfe, 0xff,
+   0xff, 0xff, 0x7f, 0xd5, 0xab, 0xfd, 0xbd, 0xff, 0x7b, 0xef, 0xfd, 0xdf,
+   0xbf, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0xfd, 0xda, 0xb7, 0xef, 0xff,
+   0xad, 0xbf, 0x57, 0xfb, 0xf6, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xbf, 0xaa,
+   0xf7, 0xfe, 0xfd, 0xfe, 0xfb, 0xf5, 0xff, 0xb7, 0x7f, 0x01, 0xfe, 0xff,
+   0xff, 0xff, 0x3f, 0xfd, 0x5e, 0xb7, 0xb7, 0xfb, 0x6d, 0x5f, 0xbd, 0xee,
+   0xeb, 0x02, 0xfe, 0xff, 0xff, 0xff, 0x5f, 0xab, 0xfb, 0xfd, 0xde, 0xff,
+   0xf7, 0xff, 0xef, 0xbd, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xfd,
+   0xef, 0xdf, 0xbd, 0xed, 0xdb, 0xea, 0xfb, 0xfb, 0xbb, 0xc5, 0xff, 0xff,
+   0xff, 0xff, 0x83, 0xb6, 0x7d, 0xf7, 0xf7, 0xff, 0xb5, 0xbf, 0x5e, 0xaf,
+   0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfb, 0xdf, 0xdf, 0xfe, 0xad,
+   0xfb, 0xee, 0xf7, 0xff, 0xde, 0xea, 0xff, 0xff, 0xff, 0xff, 0x40, 0xad,
+   0xfb, 0xfa, 0xd7, 0xfe, 0xd7, 0xbb, 0xde, 0xf6, 0xfb, 0xff, 0xff, 0xff,
+   0xff, 0x7f, 0x00, 0xfd, 0xee, 0xbf, 0xfd, 0xb7, 0xfb, 0xff, 0xfb, 0xbf,
+   0xbf, 0xd6, 0xff, 0xff, 0xff, 0x1f, 0xc0, 0xee, 0xbf, 0xf7, 0x77, 0xdf,
+   0x55, 0xdb, 0x5f, 0xed, 0xd6, 0xaf, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xbb,
+   0xf6, 0x5e, 0xdf, 0xf6, 0xfb, 0xfe, 0xf6, 0xff, 0xff, 0xb5, 0xff, 0xff,
+   0xff, 0x03, 0x40, 0xf5, 0xbf, 0xfb, 0xfb, 0xdf, 0xed, 0xab, 0xdf, 0x55,
+   0x5b, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x80, 0xde, 0xfa, 0x5e, 0x6f, 0xf5,
+   0xb7, 0xff, 0xf6, 0xfe, 0xff, 0x6b, 0xfc, 0xff, 0x1f, 0x00, 0x40, 0xf7,
+   0xd7, 0xf7, 0xfb, 0xff, 0xdb, 0xed, 0xff, 0xbb, 0xed, 0x36, 0xe0, 0x7f,
+   0x00, 0x00, 0x80, 0x7a, 0x7f, 0xdd, 0xae, 0xfe, 0xed, 0xde, 0xb6, 0xff,
+   0x77, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x40, 0xdd, 0xed, 0xfb, 0xdf, 0xff,
+   0x57, 0xbb, 0xfb, 0xdb, 0xde, 0xab, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf7,
+   0xf7, 0xdf, 0xea, 0xff, 0xbb, 0xed, 0xae, 0xbe, 0x7f, 0x5d, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0xba, 0xbf, 0x76, 0xfb, 0xff, 0x4b, 0xb5, 0xf5, 0xf7,
+   0xf6, 0x57, 0x00, 0x00, 0x00, 0x00, 0x40, 0x6d, 0xdb, 0xaf, 0xfc, 0xff,
+   0xa7, 0xaa, 0x56, 0xdd, 0x5f, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5,
+   0xf7, 0x5a, 0xff, 0xff, 0x1f, 0xa9, 0x5a, 0xf5, 0xf6, 0x2b, 0x00, 0x00,
+   0x00, 0x00, 0xa0, 0x5a, 0x5d, 0x95, 0xff, 0xff, 0xff, 0xa7, 0x52, 0xab,
+   0x5d, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6a, 0xd7, 0xca, 0xff, 0xff,
+   0xff, 0x1f, 0xa4, 0x54, 0xab, 0x09, 0x00, 0xfc, 0xff, 0xff, 0x00, 0xaa,
+   0xba, 0xf2, 0xff, 0xff, 0xff, 0xff, 0x41, 0xaa, 0x5a, 0x25, 0xf8, 0xff,
+   0xff, 0xff, 0x0f, 0xd5, 0x4a, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xa4,
+   0x4a, 0x02, 0xfc, 0xff, 0xff, 0xff, 0x4f, 0xa4, 0x2a, 0xfc, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x11, 0x29, 0x91, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x52,
+   0x95, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x44, 0xc4, 0xff, 0xff,
+   0xff, 0xff, 0x1f, 0x90, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+   0x12, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x08, 0x91, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff};
diff --git a/bitmaps/l-linux1.xbm b/bitmaps/l-linux1.xbm
new file mode 100644 (file)
index 0000000..4d155e5
--- /dev/null
@@ -0,0 +1,46 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x02, 0x00,
+   0x20, 0x00, 0x00, 0xc2, 0x12, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40,
+   0x46, 0x00, 0x01, 0x04, 0x10, 0x40, 0x00, 0x61, 0x04, 0x20, 0x80, 0x00,
+   0x02, 0x08, 0x20, 0x20, 0x2c, 0x84, 0x10, 0x42, 0x08, 0x21, 0x84, 0x30,
+   0x88, 0xf0, 0x7f, 0x08, 0x21, 0x84, 0x10, 0x12, 0x58, 0x22, 0x40, 0x21,
+   0x84, 0x10, 0x42, 0x18, 0x10, 0x28, 0x40, 0x84, 0x10, 0x42, 0x08, 0x09,
+   0x30, 0x61, 0xe0, 0x10, 0x42, 0x08, 0x21, 0x0c, 0x60, 0xc4, 0x30, 0x42,
+   0x08, 0x21, 0x84, 0x04, 0xe0, 0xd2, 0x50, 0x29, 0xa5, 0x94, 0x52, 0x06,
+   0x40, 0xa5, 0x90, 0x52, 0x4a, 0x29, 0xa5, 0x02, 0xc0, 0xca, 0x38, 0xa5,
+   0x94, 0x52, 0x4a, 0x03, 0x80, 0xb5, 0xf8, 0xff, 0xfb, 0xef, 0xff, 0x3f,
+   0x80, 0xdb, 0x28, 0x0c, 0x8d, 0x38, 0x0c, 0x21, 0x00, 0x77, 0x78, 0x1e,
+   0xcb, 0x69, 0x9e, 0x31, 0x00, 0x6f, 0x78, 0x16, 0xce, 0x79, 0x9e, 0x19,
+   0x00, 0x7a, 0x6c, 0x1e, 0xc6, 0x38, 0x9b, 0x0c, 0x00, 0x7e, 0x3c, 0x1e,
+   0xe6, 0x3c, 0x1f, 0x04, 0x00, 0x7c, 0x3c, 0x8e, 0xe4, 0x3c, 0x1f, 0x06,
+   0x00, 0x2c, 0x3c, 0x8f, 0xe4, 0x1c, 0x1f, 0x03, 0x00, 0x38, 0x3c, 0xcf,
+   0x64, 0x9c, 0x0f, 0x01, 0x00, 0x38, 0x1e, 0xc7, 0x70, 0x9e, 0x07, 0x01,
+   0x00, 0x30, 0x1e, 0xc7, 0x71, 0x9e, 0x27, 0x01, 0x00, 0x30, 0x9e, 0xe7,
+   0x71, 0x8e, 0x33, 0x01, 0x00, 0x10, 0x9e, 0xe7, 0x79, 0xc0, 0x31, 0x03,
+   0x00, 0x10, 0x0e, 0xc3, 0xf9, 0xe0, 0x10, 0x02, 0xff, 0x1f, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x1f, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0x00, 0x08, 0x01, 0x13,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xf1, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0x0c, 0xfe, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x06, 0x7e, 0xf8,
+   0xff, 0x7f, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf8, 0xff, 0x3f, 0x00, 0x00,
+   0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+   0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+   0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+   0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/l-mot.xbm b/bitmaps/l-mot.xbm
new file mode 100644 (file)
index 0000000..db0e78d
--- /dev/null
@@ -0,0 +1,67 @@
+#define image_width 76
+#define image_height 76
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xfc, 0x07, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x78, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
+   0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x01, 0x1e,
+   0x00, 0x00, 0x00, 0xe0, 0x01, 0x0c, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00,
+   0x00, 0x70, 0x00, 0x0c, 0x00, 0x80, 0x01, 0x70, 0x00, 0x00, 0x00, 0x38,
+   0x00, 0x0c, 0x00, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e,
+   0x00, 0x80, 0x03, 0xc0, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x80,
+   0x03, 0x80, 0x03, 0x00, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0xc0, 0x03, 0x00,
+   0x03, 0x00, 0x00, 0x07, 0x00, 0x1e, 0x00, 0xc0, 0x07, 0x00, 0x07, 0x00,
+   0x80, 0x03, 0x00, 0x3f, 0x00, 0xc0, 0x07, 0x00, 0x0e, 0x00, 0x80, 0x01,
+   0x00, 0x3f, 0x00, 0xe0, 0x07, 0x00, 0x0c, 0x00, 0xc0, 0x01, 0x00, 0x3f,
+   0x00, 0xe0, 0x0f, 0x00, 0x18, 0x00, 0xc0, 0x00, 0x80, 0x7f, 0x00, 0xe0,
+   0x0f, 0x00, 0x38, 0x00, 0xe0, 0x00, 0x80, 0x7f, 0x00, 0xf0, 0x0f, 0x00,
+   0x30, 0x00, 0x60, 0x00, 0x80, 0x7f, 0x00, 0xf0, 0x1f, 0x00, 0x70, 0x00,
+   0x70, 0x00, 0xc0, 0xff, 0x00, 0xf0, 0x1f, 0x00, 0x60, 0x00, 0x30, 0x00,
+   0xc0, 0xff, 0x00, 0xf0, 0x1f, 0x00, 0x60, 0x00, 0x30, 0x00, 0xc0, 0xff,
+   0x00, 0xf8, 0x3f, 0x00, 0xe0, 0x00, 0x38, 0x00, 0xc0, 0xff, 0x01, 0xf8,
+   0x3f, 0x00, 0xc0, 0x00, 0x18, 0x00, 0xe0, 0xff, 0x01, 0xf8, 0x3f, 0x00,
+   0xc0, 0x00, 0x18, 0x00, 0xe0, 0xff, 0x01, 0xfc, 0x7f, 0x00, 0xc0, 0x01,
+   0x18, 0x00, 0xe0, 0xff, 0x03, 0xfc, 0x7f, 0x00, 0x80, 0x01, 0x1c, 0x00,
+   0xf0, 0xff, 0x03, 0xfc, 0x7f, 0x00, 0x80, 0x01, 0x0c, 0x00, 0xf0, 0xff,
+   0x03, 0xfc, 0x7f, 0x00, 0x80, 0x01, 0x0c, 0x00, 0xf0, 0xff, 0x03, 0xfe,
+   0xff, 0x00, 0x80, 0x01, 0x0c, 0x00, 0xf8, 0xff, 0x07, 0xfe, 0xff, 0x00,
+   0x80, 0x01, 0x0c, 0x00, 0xf8, 0xff, 0x07, 0xfe, 0xff, 0x00, 0x80, 0x03,
+   0x0c, 0x00, 0xf8, 0xff, 0x07, 0xff, 0xff, 0x01, 0x00, 0x03, 0x0c, 0x00,
+   0xf8, 0xff, 0x0f, 0xff, 0xff, 0x01, 0x00, 0x03, 0x0c, 0x00, 0xfc, 0xc1,
+   0x0f, 0x1f, 0xf8, 0x01, 0x00, 0x03, 0x0c, 0x00, 0x7c, 0x00, 0x8f, 0x0f,
+   0xe0, 0x03, 0x00, 0x03, 0x0c, 0x00, 0x3c, 0x00, 0x9e, 0x07, 0xc0, 0x03,
+   0x00, 0x03, 0x0c, 0x00, 0x1e, 0x00, 0x9c, 0x03, 0x80, 0x03, 0x80, 0x01,
+   0x0c, 0x00, 0x0e, 0x00, 0x9c, 0x01, 0x80, 0x07, 0x80, 0x01, 0x0c, 0x00,
+   0x0e, 0x00, 0xf8, 0x01, 0x00, 0x07, 0x80, 0x01, 0x1c, 0x00, 0x06, 0x00,
+   0xf0, 0x00, 0x00, 0x07, 0x80, 0x01, 0x18, 0x00, 0x07, 0x00, 0x70, 0x00,
+   0x00, 0x06, 0x80, 0x01, 0x18, 0x00, 0x07, 0x00, 0x60, 0x00, 0x00, 0x0e,
+   0xc0, 0x01, 0x18, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x0c, 0xc0, 0x00,
+   0x38, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xc0, 0x00, 0x30, 0x80,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xc0, 0x00, 0x30, 0x80, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x18, 0xe0, 0x00, 0x70, 0xc0, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x18, 0x60, 0x00, 0x60, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38,
+   0x70, 0x00, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00,
+   0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0xc0, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x80, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x06, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00,
+   0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x18,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x70, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38,
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
+   0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00,
+   0x1e, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00,
+   0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00,
+   0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0xfc, 0x07, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/l-sco.xbm b/bitmaps/l-sco.xbm
new file mode 100644 (file)
index 0000000..9e56780
--- /dev/null
@@ -0,0 +1,20 @@
+#define image_width 76
+#define image_height 25
+static unsigned char image_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x07,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x3f,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x07,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x3f,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0x1f,0xf0,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0xf0,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0xff,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,0x00,0xf0,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x78,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x03,0xf0,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x07,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x03,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
diff --git a/bitmaps/l-sgi.xbm b/bitmaps/l-sgi.xbm
new file mode 100644 (file)
index 0000000..5f4c5e4
--- /dev/null
@@ -0,0 +1,46 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+   0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7f, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f,
+   0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0xfc, 0x0f, 0x00, 0x00,
+   0x00, 0x00, 0xf8, 0x7f, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f,
+   0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0xfc, 0xff, 0x01, 0x00,
+   0x00, 0x80, 0xff, 0x7c, 0x7c, 0xfe, 0x03, 0x00, 0x00, 0xe0, 0x3f, 0x7c,
+   0x7c, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x1f, 0x7c, 0x7c, 0xf0, 0x3f, 0x00,
+   0x00, 0xfc, 0x07, 0x7c, 0x7c, 0xc0, 0x7f, 0x00, 0x00, 0xff, 0x01, 0x7c,
+   0x7c, 0x00, 0xff, 0x01, 0x00, 0x7f, 0x00, 0x7c, 0x7c, 0x00, 0xfc, 0x01,
+   0x80, 0x3f, 0x00, 0x7c, 0x7c, 0x00, 0xf8, 0x03, 0x00, 0xff, 0x00, 0x7c,
+   0x7c, 0x00, 0xfe, 0x01, 0x00, 0xff, 0x03, 0x7c, 0x7c, 0x80, 0xff, 0x01,
+   0x00, 0xfc, 0x0f, 0x7c, 0x7c, 0xe0, 0x7f, 0x00, 0x40, 0xf0, 0x3f, 0x7c,
+   0x7c, 0xf8, 0x1f, 0x04, 0xf0, 0xe1, 0xff, 0x7c, 0x7c, 0xfe, 0x0f, 0x1f,
+   0xf8, 0x87, 0xff, 0x73, 0x9c, 0xff, 0xc3, 0x3f, 0xf8, 0x0f, 0xfe, 0x4f,
+   0xe4, 0xff, 0xe0, 0x3f, 0xfc, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x7f,
+   0xfc, 0xff, 0xe0, 0xff, 0xff, 0x0f, 0xfe, 0x7f, 0xfc, 0xff, 0x83, 0xff,
+   0xff, 0x83, 0xff, 0x7f, 0xfc, 0xff, 0x07, 0xff, 0xff, 0xc1, 0xff, 0x7f,
+   0x7c, 0xfe, 0x1f, 0xfc, 0x7f, 0xf0, 0xff, 0x7c, 0x7c, 0xf8, 0x7f, 0xf2,
+   0x9f, 0xfc, 0x3f, 0x7c, 0x7c, 0xe0, 0xff, 0xcd, 0x67, 0xfe, 0x0f, 0x7c,
+   0x7c, 0xc0, 0xff, 0x33, 0x99, 0xff, 0x07, 0x7c, 0x7c, 0x00, 0xff, 0x0f,
+   0xe0, 0xff, 0x01, 0x7c, 0x7c, 0x00, 0xfc, 0x3f, 0xf8, 0x7f, 0x00, 0x7c,
+   0x7c, 0x00, 0xf2, 0x7f, 0xfc, 0x9f, 0x00, 0x7c, 0x7c, 0x80, 0xcf, 0x7f,
+   0xfd, 0xe7, 0x03, 0x7c, 0x7c, 0xe0, 0xbf, 0x7f, 0xfd, 0xf9, 0x0f, 0x7c,
+   0x7c, 0xf8, 0x7f, 0x7e, 0xfd, 0xfc, 0x3f, 0x7c, 0x7c, 0xfe, 0x0f, 0x7c,
+   0x7d, 0xe0, 0xff, 0x7c, 0xfc, 0xff, 0x83, 0x7d, 0x7d, 0x83, 0xff, 0x7f,
+   0xfc, 0xff, 0xe0, 0x7d, 0x7d, 0x0f, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x7d,
+   0x7c, 0x3f, 0xf8, 0x7f, 0xfc, 0x0f, 0xfe, 0x7d, 0x7c, 0xff, 0xe0, 0x7f,
+   0xfc, 0x03, 0xff, 0x7d, 0x7c, 0xff, 0x81, 0x7f, 0xf8, 0xc0, 0xff, 0x7d,
+   0x7c, 0xff, 0x07, 0x3e, 0x30, 0xf0, 0xff, 0x7c, 0x7c, 0xfe, 0x1f, 0x18,
+   0x00, 0xfc, 0x3f, 0x7c, 0x7c, 0xf8, 0x7f, 0x00, 0x00, 0xff, 0x0f, 0x7c,
+   0x7c, 0xe0, 0xff, 0x01, 0x80, 0xff, 0x03, 0x7c, 0x7c, 0x80, 0xff, 0x03,
+   0x80, 0xff, 0x00, 0x7c, 0x7c, 0x00, 0xfe, 0x03, 0xc0, 0x3f, 0x00, 0x7c,
+   0x7c, 0x00, 0xf8, 0x07, 0xc0, 0x7f, 0x00, 0x7c, 0x7c, 0x00, 0xfc, 0x07,
+   0x80, 0xff, 0x01, 0x7c, 0x7c, 0x00, 0xff, 0x03, 0x80, 0xff, 0x07, 0x7c,
+   0x7c, 0xc0, 0xff, 0x03, 0x00, 0xfe, 0x1f, 0x7c, 0x7c, 0xf0, 0xff, 0x00,
+   0x00, 0xf8, 0x7f, 0x7c, 0x7c, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0x7d,
+   0x7c, 0xff, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x7f, 0xfc, 0xff, 0x03, 0x00,
+   0x00, 0x00, 0xfe, 0x7f, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f,
+   0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0xfc, 0x0f, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x7f, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e,
+   0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/l-sun.xbm b/bitmaps/l-sun.xbm
new file mode 100644 (file)
index 0000000..681167f
--- /dev/null
@@ -0,0 +1,46 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+   0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7e, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe,
+   0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfc, 0xfd, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xfd, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb,
+   0xf7, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf4, 0xf7, 0xef, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xee, 0xef, 0xdf, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xdf,
+   0xbf, 0xff, 0x00, 0x00, 0x00, 0x80, 0xbf, 0xbf, 0x7f, 0xff, 0x00, 0x00,
+   0x00, 0x80, 0x7f, 0x7f, 0xff, 0x7e, 0x03, 0x00, 0x00, 0x60, 0xff, 0xfe,
+   0xfe, 0xbd, 0x07, 0x00, 0x00, 0xf0, 0xfe, 0xfd, 0xfd, 0xdb, 0x0f, 0x00,
+   0x00, 0xf8, 0xfd, 0xfb, 0xfb, 0xe7, 0x1f, 0x00, 0x00, 0xfc, 0xfb, 0xf7,
+   0xf7, 0xf7, 0x2f, 0x00, 0x00, 0xfe, 0xf5, 0xef, 0xef, 0xfb, 0x77, 0x00,
+   0x00, 0xff, 0xee, 0xdf, 0xcf, 0xfd, 0xfb, 0x00, 0x80, 0x7f, 0xdf, 0xbf,
+   0x9f, 0xfe, 0xfd, 0x01, 0xc0, 0xbf, 0xbf, 0xff, 0x1f, 0xff, 0xfe, 0x00,
+   0xe0, 0xdf, 0x1f, 0xff, 0x9f, 0x7f, 0x7f, 0x00, 0xf0, 0xef, 0x0f, 0xfe,
+   0xcf, 0xbf, 0x3f, 0x07, 0xf8, 0xf7, 0xe7, 0xfc, 0xef, 0xdf, 0xdf, 0x1f,
+   0xfc, 0xfb, 0xfb, 0xfb, 0xf7, 0xef, 0xef, 0x3f, 0xfe, 0xfd, 0xfd, 0xe7,
+   0xf9, 0xf7, 0xf7, 0x7f, 0xfe, 0xfe, 0xfe, 0x07, 0xf8, 0xfb, 0xfb, 0x7f,
+   0x7f, 0x7f, 0xff, 0x0f, 0xfc, 0xfd, 0xfd, 0xff, 0xbf, 0xbf, 0xff, 0x0f,
+   0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xdf, 0xdf, 0x0f, 0xfc, 0x7f, 0xff, 0xfe,
+   0xff, 0xef, 0xef, 0x0f, 0xfc, 0xbf, 0x7f, 0xff, 0xfe, 0xf7, 0xf7, 0x07,
+   0xf8, 0xdf, 0xbf, 0x7f, 0xfe, 0xfb, 0xfb, 0xe7, 0xf9, 0xef, 0xdf, 0x7f,
+   0xfc, 0xfd, 0xfd, 0xfb, 0xf7, 0xf7, 0xef, 0x3f, 0x70, 0xfe, 0xfe, 0xfd,
+   0xcf, 0xf9, 0xf7, 0x1f, 0x00, 0x7f, 0xff, 0xfc, 0x1f, 0xfc, 0xfb, 0x0f,
+   0x80, 0xbf, 0x7f, 0xfe, 0x3f, 0xfe, 0xfd, 0x07, 0xc0, 0xdf, 0x3f, 0xfe,
+   0x7f, 0xff, 0xfe, 0x03, 0x80, 0xef, 0x5f, 0x7e, 0xff, 0x7e, 0xff, 0x01,
+   0x00, 0xf7, 0xef, 0xfc, 0xfe, 0xbd, 0xff, 0x00, 0x00, 0xfa, 0xf7, 0xfd,
+   0xfd, 0xdb, 0x7f, 0x00, 0x00, 0xfc, 0xfb, 0xfb, 0xfb, 0xe7, 0x3f, 0x00,
+   0x00, 0xf8, 0xf9, 0xf7, 0xf7, 0xef, 0x1f, 0x00, 0x00, 0xf0, 0xee, 0xef,
+   0xef, 0xdf, 0x0f, 0x00, 0x00, 0x60, 0xdf, 0xdf, 0xdf, 0xbf, 0x07, 0x00,
+   0x00, 0x80, 0xbf, 0xbf, 0xbf, 0x7f, 0x03, 0x00, 0x00, 0x80, 0x7f, 0x7f,
+   0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0xfe, 0xfe, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0xfd, 0xfd, 0x7d, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfb,
+   0xfb, 0x3b, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf7, 0xf7, 0x17, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xef, 0xef, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdf,
+   0xdf, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x7f, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00};
diff --git a/bitmaps/l-x11.xbm b/bitmaps/l-x11.xbm
new file mode 100644 (file)
index 0000000..96e306f
--- /dev/null
@@ -0,0 +1,46 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x7c,
+   0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xf8, 0xff, 0x07, 0x00,
+   0x00, 0x00, 0x00, 0x1f, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x0f,
+   0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0x0f, 0xc0, 0xff, 0x3f, 0x00,
+   0x00, 0x00, 0xc0, 0x07, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0x03,
+   0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0xff, 0xff, 0x00,
+   0x00, 0x00, 0xf8, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x00,
+   0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xfc, 0xff, 0x03,
+   0x00, 0x00, 0x3e, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x1f, 0x00,
+   0x00, 0xf0, 0xff, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0x0f,
+   0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0xc0, 0x07, 0x00,
+   0x00, 0xc0, 0xff, 0x3f, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x80, 0xff, 0x7f,
+   0x00, 0xf0, 0x01, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0xf8, 0x00, 0x00,
+   0x00, 0x00, 0xff, 0xff, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+   0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x3e, 0x00, 0x00,
+   0x00, 0x00, 0xfc, 0xff, 0x03, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+   0x87, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xcf, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0xe0, 0xff, 0xcf, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+   0xe7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xf3, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+   0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7e, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e,
+   0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0xff, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0xcf, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe7,
+   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe7, 0xff, 0x1f, 0x00, 0x00,
+   0x00, 0x00, 0xe0, 0xc3, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc1,
+   0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x80, 0xff, 0x7f, 0x00, 0x00,
+   0x00, 0x00, 0x7c, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00,
+   0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xfe, 0xff, 0x01, 0x00,
+   0x00, 0x00, 0x1f, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x80, 0x0f, 0x00,
+   0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0x07, 0x00, 0xf0, 0xff, 0x0f, 0x00,
+   0x00, 0xe0, 0x03, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0x03, 0x00,
+   0xe0, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0x01, 0x00, 0xc0, 0xff, 0x3f, 0x00,
+   0x00, 0xf8, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x7c, 0x00, 0x00,
+   0x80, 0xff, 0x7f, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00,
+   0x00, 0x3e, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x1f, 0x00, 0x00,
+   0x00, 0xfc, 0xff, 0x03, 0x80, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03,
+   0xc0, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07, 0xe0, 0x03, 0x00, 0x00,
+   0x00, 0xf0, 0xff, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f,
+   0xf0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0xf8, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0xff, 0x3f, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f,
+   0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff};
diff --git a/bitmaps/l-xlock.xbm b/bitmaps/l-xlock.xbm
new file mode 100644 (file)
index 0000000..7ce996c
--- /dev/null
@@ -0,0 +1,55 @@
+#define image_width 100
+#define image_height 48
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x0f, 0x03, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x7f, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0x0f, 0x07, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0xf8, 0xff,
+   0xff, 0xff, 0xff, 0x0f, 0x0f, 0x00, 0x80, 0xff, 0xff, 0xff, 0x1f, 0xfc,
+   0xff, 0xff, 0xff, 0xff, 0x0f, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x3f, 0x00, 0x00, 0xfe, 0xff, 0xff,
+   0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x7f, 0x00, 0x00, 0xfc, 0xff,
+   0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0x00, 0x00, 0xf8,
+   0xff, 0xff, 0xc1, 0xff, 0xff, 0x3f, 0x00, 0xff, 0x0f, 0xff, 0x01, 0x00,
+   0xf0, 0xff, 0xff, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0xfc, 0x0f, 0xff, 0x03,
+   0x00, 0xe0, 0xff, 0x7f, 0xf0, 0xff, 0xff, 0x03, 0x00, 0xf0, 0x0f, 0xff,
+   0x07, 0x00, 0xc0, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x03, 0x00, 0xf0, 0x0f,
+   0xff, 0x0f, 0x00, 0x80, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x01, 0x00, 0xe0,
+   0x0f, 0xff, 0x1f, 0x00, 0x00, 0xff, 0x0f, 0xfe, 0xff, 0xff, 0x01, 0x00,
+   0xe0, 0x0f, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0x07, 0xff, 0xff, 0xff, 0x00,
+   0x1e, 0xc0, 0x0f, 0xff, 0x7f, 0x00, 0x00, 0xfc, 0x83, 0xff, 0xff, 0xff,
+   0x00, 0x3f, 0xc0, 0x0f, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xc1, 0xff, 0xff,
+   0xff, 0x80, 0x7f, 0xc0, 0x0f, 0xff, 0xff, 0x01, 0x00, 0xf0, 0xe0, 0xff,
+   0xff, 0xff, 0xc0, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0x03, 0x00, 0x70, 0xf0,
+   0xff, 0xff, 0xff, 0xc0, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0x07, 0x00, 0x38,
+   0xf8, 0xff, 0xff, 0xff, 0xc0, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0x0f, 0x00,
+   0x1c, 0xfc, 0xff, 0xff, 0xff, 0xc0, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0x1f,
+   0x00, 0x0e, 0xfe, 0xff, 0xff, 0xff, 0xc0, 0xff, 0xc0, 0x0f, 0xff, 0xff,
+   0x3f, 0x00, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xc0, 0xff, 0xc0, 0x0f, 0xff,
+   0xff, 0x7f, 0x80, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+   0xff, 0xff, 0xff, 0xc0, 0x01, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00,
+   0x0c, 0xff, 0xff, 0xff, 0xe0, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+   0x00, 0x0c, 0xff, 0xff, 0x7f, 0x70, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00,
+   0x00, 0x00, 0x0c, 0xff, 0xff, 0x3f, 0x38, 0x00, 0xc0, 0xff, 0xff, 0x0f,
+   0x00, 0x00, 0x00, 0x0c, 0xff, 0xff, 0x1f, 0x1c, 0x00, 0x80, 0xff, 0xff,
+   0x0f, 0xc0, 0xc0, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0x1e, 0x00, 0x00, 0xff,
+   0xff, 0x0f, 0xc0, 0xc0, 0x00, 0x0c, 0xff, 0xff, 0x07, 0x3f, 0x00, 0x00,
+   0xfe, 0xff, 0x0f, 0xc3, 0xff, 0x30, 0x0c, 0xff, 0xff, 0x83, 0x7f, 0x00,
+   0x00, 0xfc, 0xff, 0x0f, 0xc3, 0xff, 0x30, 0x0c, 0xff, 0xff, 0xc1, 0xff,
+   0x00, 0x00, 0xf8, 0xff, 0x0f, 0xc3, 0xc0, 0x30, 0x0c, 0xff, 0xff, 0xe0,
+   0xff, 0x01, 0x00, 0xf0, 0xff, 0x0f, 0xc3, 0xc0, 0x30, 0x0c, 0xff, 0x7f,
+   0xf0, 0xff, 0x03, 0x00, 0xe0, 0xff, 0x0f, 0xc3, 0xff, 0x30, 0x0c, 0xff,
+   0x3f, 0xf8, 0xff, 0x07, 0x00, 0xc0, 0xff, 0x0f, 0xc3, 0xff, 0x30, 0x0c,
+   0xff, 0x1f, 0xfc, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x0f, 0xc3, 0xc0, 0x30,
+   0x0c, 0xff, 0x0f, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0xff, 0x0f, 0xc3, 0xc0,
+   0x30, 0x0c, 0xff, 0x07, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0x0f, 0xc3,
+   0xff, 0x30, 0x0c, 0xff, 0x83, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfc, 0x0f,
+   0xc3, 0xff, 0x30, 0x0c, 0xff, 0xc1, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8,
+   0x0f, 0xc3, 0xc0, 0x30, 0x0c, 0xff, 0xe0, 0xff, 0xff, 0xff, 0x01, 0x00,
+   0xf0, 0x0f, 0xc3, 0xc0, 0x30, 0x0c, 0x7f, 0xf0, 0xff, 0xff, 0xff, 0x03,
+   0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x0c, 0x3f, 0xf8, 0xff, 0xff, 0xff,
+   0x07, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x0c, 0x1f, 0xfc, 0xff, 0xff,
+   0xff, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x0c, 0x0f, 0xfe, 0xff,
+   0xff, 0xff, 0x1f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f};
diff --git a/bitmaps/light_gray.xbm b/bitmaps/light_gray.xbm
new file mode 100644 (file)
index 0000000..ed1e0be
--- /dev/null
@@ -0,0 +1,4 @@
+#define light_gray_width 4
+#define light_gray_height 2
+static unsigned char light_gray_bits[] = {
+   0x08, 0x02};
diff --git a/bitmaps/m-bob.xbm b/bitmaps/m-bob.xbm
new file mode 100644 (file)
index 0000000..f6ba484
--- /dev/null
@@ -0,0 +1,43 @@
+#define image_width 61
+#define image_height 75
+static unsigned char image_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0x1f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xfb,
+ 0x00,0x00,0x00,0xc0,0xff,0xcf,0x9f,0xd1,0x03,0x00,0x00,0xf0,0x7f,0x8c,0x33,
+ 0x91,0x07,0x00,0x00,0xf8,0xa7,0x18,0x27,0xb1,0x06,0x00,0x00,0xfc,0x47,0x31,
+ 0x4e,0xa6,0x0e,0x00,0x00,0xfe,0x4f,0x21,0x4c,0xae,0x3d,0x00,0x00,0xff,0xdf,
+ 0x23,0x8d,0xbe,0x7d,0x00,0x80,0xff,0xff,0x67,0xbd,0xfe,0xff,0x01,0x80,0xff,
+ 0xff,0x7f,0xbf,0xff,0xff,0x03,0xc0,0xff,0xff,0xff,0xbf,0xff,0xf8,0x07,0xc0,
+ 0xff,0xff,0xff,0xbf,0x3f,0xf8,0x07,0xc0,0xff,0xff,0xff,0xff,0x07,0xf8,0x0f,
+ 0xc0,0xff,0xff,0xff,0x3f,0x00,0xf8,0x0f,0xe0,0x7f,0x00,0xf8,0x07,0x00,0xf0,
+ 0x0f,0xe0,0x3f,0x00,0x00,0x00,0x00,0xf0,0x07,0xe0,0x3f,0x00,0x00,0x00,0x00,
+ 0xf0,0x07,0xe0,0x3f,0x00,0x00,0x00,0x00,0xf4,0x07,0xe0,0x3f,0x00,0x00,0x00,
+ 0x00,0xe4,0x07,0xe0,0x3f,0x00,0x00,0x00,0x00,0xe4,0x07,0xe0,0x3f,0x00,0x00,
+ 0x00,0x00,0xe6,0x07,0xe0,0x3f,0x00,0x00,0x00,0x00,0xe7,0x07,0xe0,0x3f,0x00,
+ 0x00,0x00,0x00,0xe6,0x07,0xe0,0x3f,0x00,0x00,0x00,0x00,0xe6,0x07,0xe0,0x3f,
+ 0x00,0x00,0x00,0x00,0xe6,0x07,0xc0,0x3f,0x00,0x00,0x00,0x78,0xf6,0x07,0xa0,
+ 0xbf,0xff,0x00,0x00,0xff,0xf7,0x07,0x70,0x9f,0xff,0x01,0x80,0xff,0xef,0x07,
+ 0xf0,0x1c,0x80,0x03,0xe0,0x01,0xef,0x07,0xf0,0x1f,0xbe,0x07,0xf0,0x3f,0xee,
+ 0x07,0xe0,0x9d,0x83,0x1f,0xf8,0xe1,0xdc,0x07,0xe0,0xc1,0x7f,0x1f,0xfc,0xff,
+ 0xc8,0x07,0xe0,0xc1,0x69,0x1e,0x7e,0xca,0xc0,0x03,0xe0,0x81,0xb8,0x1f,0xc0,
+ 0x0e,0xc0,0x03,0xe0,0x01,0xc0,0x1b,0xc0,0xcf,0xc1,0x03,0xc0,0x03,0xf7,0x11,
+ 0x00,0x7f,0xc0,0x03,0xc0,0x03,0x7c,0x18,0x00,0x1c,0xc0,0x02,0xc0,0x02,0x30,
+ 0x08,0x00,0x00,0x40,0x03,0x40,0x03,0x00,0x08,0x00,0x00,0x40,0x02,0x40,0x13,
+ 0x00,0x0c,0x00,0x00,0x60,0x02,0x40,0x12,0x00,0x0e,0x00,0x00,0xc0,0x03,0x80,
+ 0x33,0x80,0x0e,0x00,0x00,0xa8,0x01,0x00,0x33,0x40,0x0f,0xa0,0x03,0x2c,0x00,
+ 0x00,0x74,0x30,0x0f,0x38,0x07,0x2e,0x00,0x00,0x74,0x98,0x1f,0x1e,0x1e,0x2f,
+ 0x00,0x00,0xfc,0x8f,0xff,0x0f,0xfc,0x2f,0x00,0x00,0xf8,0xe3,0xff,0x03,0xf8,
+ 0x2f,0x00,0x00,0xf8,0xfd,0xff,0x81,0xff,0x3f,0x00,0x00,0xb8,0xf9,0x1f,0xf8,
+ 0x0f,0x1e,0x00,0x00,0x30,0xf1,0xf0,0x0f,0x03,0x0e,0x00,0x00,0x30,0xf1,0x01,
+ 0x80,0x01,0x0f,0x00,0x00,0x20,0xf1,0xf7,0xff,0x00,0x07,0x00,0x00,0x60,0xe3,
+ 0x01,0x60,0x80,0x07,0x00,0x00,0x60,0xc3,0xef,0x3f,0x80,0x03,0x00,0x00,0x40,
+ 0xc2,0xff,0x0f,0xc0,0x03,0x00,0x00,0xc0,0xe6,0x1f,0x00,0xc0,0x01,0x00,0x00,
+ 0x80,0xf4,0xfe,0x3f,0xe0,0x00,0x00,0x00,0x80,0x79,0xfe,0x1f,0xe0,0x00,0x00,
+ 0xc0,0x01,0x3d,0x3e,0x00,0x70,0x00,0x00,0x30,0x06,0x3e,0x0f,0x00,0x38,0x00,
+ 0x00,0xc8,0x8c,0x1f,0x07,0x00,0x38,0x00,0x00,0xf4,0xcc,0x8f,0x07,0x00,0x1c,
+ 0x00,0x00,0x72,0xee,0xf7,0x07,0x00,0x0e,0x00,0x00,0x02,0xff,0xe3,0x07,0x00,
+ 0x07,0x00,0x00,0x32,0xfe,0xc1,0xff,0x8f,0x03,0x00,0x00,0x3e,0xfe,0x80,0xff,
+ 0xff,0x01,0x00,0x00,0x7e,0x7c,0x00,0x00,0x7e,0x00,0x00,0x00,0x7c,0x3c,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x1c,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
diff --git a/bitmaps/m-bsd.xbm b/bitmaps/m-bsd.xbm
new file mode 100644 (file)
index 0000000..8cb527f
--- /dev/null
@@ -0,0 +1,39 @@
+#define image_width 50
+#define image_height 50
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xe3, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x06, 0x14, 0x00,
+   0x00, 0x00, 0x80, 0x06, 0x1c, 0x3c, 0x00, 0x00, 0x00, 0x80, 0x03, 0x38,
+   0x28, 0x00, 0x00, 0x00, 0x00, 0x01, 0x70, 0x2c, 0x00, 0x00, 0x00, 0x00,
+   0x19, 0xe0, 0x27, 0x00, 0x00, 0x00, 0x00, 0x25, 0x03, 0x30, 0x00, 0x00,
+   0x00, 0x80, 0xa4, 0x04, 0x18, 0x00, 0x00, 0x00, 0x80, 0xbe, 0x04, 0x07,
+   0x00, 0x00, 0x00, 0x40, 0x9a, 0x45, 0x01, 0x00, 0x00, 0x00, 0x20, 0x5e,
+   0x85, 0x00, 0x00, 0x00, 0x00, 0x20, 0xcc, 0x87, 0x00, 0x00, 0x00, 0x80,
+   0x20, 0xc4, 0xc3, 0x00, 0x00, 0x00, 0x80, 0x23, 0x84, 0x81, 0x00, 0x00,
+   0x00, 0x00, 0x43, 0x3d, 0x60, 0x00, 0x00, 0x00, 0x20, 0x86, 0x02, 0x70,
+   0x00, 0x00, 0x00, 0xe0, 0x06, 0x8d, 0x39, 0x00, 0x00, 0x00, 0xc0, 0x06,
+   0x7a, 0x1c, 0x00, 0x00, 0x00, 0x88, 0x07, 0x06, 0x0e, 0x00, 0x00, 0x00,
+   0x18, 0xcf, 0xfa, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x03, 0x06, 0x00,
+   0x00, 0x00, 0xc0, 0x38, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03,
+   0x0c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+   0x50, 0x34, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x30, 0x7d, 0x0c, 0x00, 0x00,
+   0x00, 0x00, 0xa0, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x04,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xc5, 0x05, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe8, 0x07, 0x00, 0x00, 0x00,
+   0x00, 0x80, 0x10, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0e, 0x00,
+   0x00, 0x00, 0x00, 0x80, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
+   0xc8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x74, 0x3f, 0x00, 0x00, 0x00,
+   0x00, 0x53, 0x88, 0xdf, 0x01, 0x00, 0x00, 0x80, 0x25, 0x09, 0xf0, 0x07,
+   0x00, 0x00, 0x70, 0x9d, 0x18, 0x00, 0x0e, 0x00, 0x00, 0x4c, 0x4f, 0x18,
+   0x00, 0x0c, 0x00, 0x00, 0x82, 0x3c, 0x0c, 0x80, 0x0e, 0x00, 0x00, 0x41,
+   0x48, 0x03, 0xc0, 0x07, 0x00, 0x00, 0x3e, 0xc0, 0x01, 0x60, 0x01, 0x00,
+   0x00, 0xc0, 0x3f, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00};
+
+/*
+ * BSD daemon
+ * The original BSD daemon is Copyright (c) 1988 Marshall Kirk McKusick.
+ * All Rights Reserved.  Used by permission.
+ */
diff --git a/bitmaps/m-dec.xbm b/bitmaps/m-dec.xbm
new file mode 100644 (file)
index 0000000..d737889
--- /dev/null
@@ -0,0 +1,27 @@
+#define image_width 82
+#define image_height 26
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+   0xef, 0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef,
+   0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f,
+   0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0xff,
+   0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0xff, 0xf7,
+   0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xec, 0x79, 0xff, 0xf7, 0xbc,
+   0xff, 0xfb, 0xbf, 0xe7, 0x01, 0xfe, 0xec, 0x79, 0xff, 0xf7, 0xbc, 0xc7,
+   0xfb, 0xbf, 0xe7, 0x01, 0xfe, 0xec, 0x79, 0xff, 0xf7, 0xbc, 0xc7, 0xfb,
+   0xbf, 0xe7, 0x01, 0xfe, 0xec, 0x7f, 0xff, 0xf7, 0xbf, 0xc7, 0xfb, 0xbf,
+   0xe7, 0x01, 0x0e, 0xec, 0x79, 0x0f, 0xf6, 0xbc, 0x83, 0x3b, 0xb8, 0xe7,
+   0x01, 0x06, 0xec, 0x79, 0x07, 0xf6, 0xbc, 0x83, 0x1b, 0xb0, 0xe7, 0x01,
+   0x46, 0xec, 0x79, 0x23, 0xf6, 0xbc, 0xc7, 0xfb, 0xb1, 0xe7, 0x01, 0xe6,
+   0xec, 0x79, 0x73, 0xf6, 0xbc, 0xc7, 0x3b, 0xb0, 0xe7, 0x01, 0xe6, 0xec,
+   0x79, 0x73, 0xf6, 0xbc, 0xc7, 0x1b, 0xb0, 0xe7, 0x01, 0xe6, 0xec, 0x79,
+   0x73, 0xf6, 0xbc, 0xc7, 0x9b, 0xb1, 0xe7, 0x01, 0x46, 0xec, 0x79, 0x23,
+   0xf6, 0xbc, 0xc7, 0x9b, 0xb1, 0xe7, 0x01, 0x06, 0xec, 0x79, 0x07, 0xf6,
+   0xbc, 0x87, 0x1b, 0xb0, 0xe7, 0x01, 0x1e, 0xec, 0x79, 0x0f, 0xf6, 0xbc,
+   0x8f, 0x3b, 0xb0, 0xe7, 0x01, 0xfe, 0xef, 0x7f, 0x7f, 0xf6, 0xbf, 0xff,
+   0xfb, 0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0x23, 0xf6, 0xbf, 0xff, 0xfb,
+   0xbf, 0xff, 0x01, 0xfe, 0xef, 0x7f, 0x07, 0xf7, 0xbf, 0xff, 0xfb, 0xbf,
+   0xff, 0x01, 0xfe, 0xef, 0x7f, 0x9f, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff,
+   0x01, 0xfe, 0xef, 0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01,
+   0xfe, 0xef, 0x7f, 0xff, 0xf7, 0xbf, 0xff, 0xfb, 0xbf, 0xff, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/m-ghost.xbm b/bitmaps/m-ghost.xbm
new file mode 100644 (file)
index 0000000..fa40be1
--- /dev/null
@@ -0,0 +1,41 @@
+#define image_width 58
+#define image_height 57
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,
+   0x00, 0x80, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
+   0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfe, 0x07, 0xff,
+   0xff, 0xc1, 0x07, 0x00, 0x00, 0xff, 0x03, 0xfe, 0xff, 0x80, 0x1f, 0x00,
+   0x80, 0xff, 0x01, 0xfc, 0x7f, 0x00, 0x1f, 0x00, 0x80, 0xff, 0x01, 0xfc,
+   0x7f, 0x00, 0x3f, 0x00, 0xc0, 0xff, 0x80, 0xf9, 0x3f, 0x40, 0x3e, 0x00,
+   0xe0, 0x7f, 0xc0, 0xfb, 0x1f, 0xf0, 0x7e, 0x00, 0xf0, 0x7f, 0xf0, 0xf3,
+   0x1f, 0xf8, 0x7c, 0x00, 0xf0, 0x3f, 0xf8, 0xf7, 0x0f, 0xfc, 0x7d, 0x00,
+   0xf8, 0x3f, 0xfc, 0xf3, 0x0f, 0xfe, 0x7c, 0x00, 0xf8, 0x3f, 0xfe, 0xfb,
+   0x0f, 0xff, 0xfe, 0x00, 0xf8, 0x3f, 0xfe, 0xfb, 0x0f, 0xff, 0xfe, 0x00,
+   0xfc, 0x3f, 0xfe, 0xf9, 0x0f, 0x7f, 0xfe, 0x00, 0xfc, 0x7f, 0xff, 0xf9,
+   0x9f, 0x7f, 0xfe, 0x00, 0xfe, 0x7f, 0xfe, 0xfc, 0x9f, 0x3f, 0xff, 0x01,
+   0xfe, 0xff, 0xfc, 0xfe, 0x3f, 0x9f, 0xff, 0x01, 0xfe, 0xff, 0x39, 0xff,
+   0x7f, 0xc0, 0xff, 0x01, 0xff, 0xff, 0x87, 0xff, 0xff, 0xe1, 0xff, 0x01,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0x3f, 0xde,
+   0xf3, 0xff, 0xff, 0x03, 0xff, 0xff, 0x07, 0xde, 0x83, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0x03, 0xde, 0x03, 0xf8, 0xff, 0x03, 0xff, 0xff, 0x01, 0xde,
+   0x03, 0xe0, 0xff, 0x03, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03,
+   0xff, 0x3f, 0x80, 0xff, 0x1f, 0x80, 0xff, 0x03, 0xff, 0x1f, 0xf0, 0xff,
+   0xff, 0x03, 0xff, 0x03, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x0f, 0xfe, 0x03,
+   0xff, 0x0f, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03, 0xff, 0xfd, 0xf7, 0xef, 0xef, 0xef, 0xdf, 0x03,
+   0x7f, 0xf8, 0xe1, 0xc7, 0xc7, 0xcf, 0x8f, 0x03, 0x3e, 0xf0, 0xc0, 0xc3,
+   0x83, 0x87, 0x07, 0x03, 0x1c, 0x60, 0x80, 0x01, 0x00, 0x03, 0x03, 0x00};
diff --git a/bitmaps/m-grelb-2.xbm b/bitmaps/m-grelb-2.xbm
new file mode 100644 (file)
index 0000000..cf9c973
--- /dev/null
@@ -0,0 +1,25 @@
+#define image2_width 40
+#define image2_height 44
+static unsigned char image2_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+   0x00, 0x80, 0x01, 0x80, 0x06, 0x00, 0xc0, 0x02, 0x00, 0x0c, 0x00, 0x60,
+   0x00, 0x00, 0x18, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00,
+   0x20, 0xff, 0x09, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff,
+   0x3f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01,
+   0x80, 0xff, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0xff, 0x03, 0xc0, 0x1f,
+   0xff, 0xf1, 0x07, 0xc0, 0x0f, 0xfe, 0xe0, 0x07, 0xc0, 0x0f, 0xfe, 0xe0,
+   0x07, 0xc0, 0x1f, 0xff, 0xf1, 0x07, 0xc0, 0xff, 0xff, 0xff, 0x07, 0x80,
+   0xff, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff,
+   0xff, 0x01, 0x00, 0xfe, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xff, 0x3f, 0x00,
+   0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00,
+   0xc7, 0x01, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
+   0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00,
+   0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x82,
+   0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00,
+   0x00, 0xfe, 0x83, 0xff, 0x00, 0x00, 0xff, 0xc7, 0xff, 0x01, 0x00, 0xfe,
+   0x83, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00};
+/*
+ *      "Life.  Don't talk to me about life" -Marvin the Paranoid Android
+ */
diff --git a/bitmaps/m-grelb.xbm b/bitmaps/m-grelb.xbm
new file mode 100644 (file)
index 0000000..6b7c352
--- /dev/null
@@ -0,0 +1,26 @@
+#define XBM_GRELB
+#define image_width 40
+#define image_height 44
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x80, 0x1f, 0x00, 0xf0, 0x03, 0x40, 0x30, 0x00, 0x18, 0x04, 0x00,
+   0x20, 0xff, 0x09, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff,
+   0x3f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01,
+   0x80, 0xff, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0xff, 0x03, 0xc0, 0x1f,
+   0xff, 0xf1, 0x07, 0xc0, 0x0f, 0xfe, 0xe0, 0x07, 0xc0, 0x0f, 0xfe, 0xe0,
+   0x07, 0xc0, 0x1f, 0xff, 0xf1, 0x07, 0xc0, 0xff, 0xff, 0xff, 0x07, 0x80,
+   0xff, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff,
+   0xff, 0x01, 0x00, 0xfe, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xff, 0x3f, 0x00,
+   0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00,
+   0xc7, 0x01, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
+   0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00,
+   0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x82,
+   0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00,
+   0x00, 0xfe, 0x83, 0xff, 0x00, 0x00, 0xff, 0xc7, 0xff, 0x01, 0x00, 0xfe,
+   0x83, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00};
+/*
+ *      "Life.  Don't talk to me about life" -Marvin the Paranoid Android
+ */
diff --git a/bitmaps/m-hp.xbm b/bitmaps/m-hp.xbm
new file mode 100644 (file)
index 0000000..1be3800
--- /dev/null
@@ -0,0 +1,20 @@
+#define image_width 46
+#define image_height 34
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xff, 0x79, 0xfe, 0xff, 0xc1,
+   0xf8, 0xff, 0x39, 0xfe, 0xff, 0xc7, 0xfc, 0xff, 0x3d, 0xfc, 0xff, 0xcf,
+   0xfc, 0xff, 0x3c, 0xe0, 0xff, 0xcf, 0xfe, 0x7f, 0x1c, 0x80, 0xff, 0xdf,
+   0xfe, 0x3f, 0x1c, 0x00, 0xff, 0xdf, 0xfe, 0x1f, 0x1e, 0x00, 0xfe, 0xdf,
+   0xfe, 0x0f, 0x1e, 0x00, 0xfc, 0xdf, 0xfe, 0x07, 0x0e, 0x00, 0xf8, 0xdf,
+   0xfe, 0x07, 0x0f, 0x00, 0xf8, 0xdf, 0xfe, 0x03, 0x7f, 0xfc, 0xf1, 0xdf,
+   0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf, 0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf,
+   0xfe, 0x81, 0xf7, 0xde, 0xe3, 0xdf, 0xfe, 0x81, 0x77, 0xde, 0xe1, 0xdf,
+   0xfe, 0x81, 0x73, 0xce, 0xe1, 0xdf, 0xfe, 0xc1, 0x7b, 0xee, 0xe1, 0xdf,
+   0xfe, 0xc1, 0x7b, 0xef, 0xe1, 0xdf, 0xfe, 0xc1, 0x3b, 0xe7, 0xe0, 0xdf,
+   0xfe, 0xc3, 0x39, 0xff, 0xf0, 0xdf, 0xfe, 0xe3, 0xbd, 0xff, 0xf0, 0xdf,
+   0xfe, 0xe3, 0xbd, 0x7f, 0xf0, 0xdf, 0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf,
+   0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf, 0xfe, 0x0f, 0xc0, 0x03, 0xfc, 0xdf,
+   0xfe, 0x1f, 0xc0, 0x03, 0xfe, 0xdf, 0xfe, 0x3f, 0xc0, 0x01, 0xff, 0xdf,
+   0xfe, 0x7f, 0xc0, 0x81, 0xff, 0xdf, 0xfc, 0xff, 0xe1, 0xe1, 0xff, 0xcf,
+   0xfc, 0xff, 0xe7, 0xfc, 0xff, 0xcf, 0xf8, 0xff, 0xe7, 0xfc, 0xff, 0xc7,
+   0xe0, 0xff, 0xf3, 0xfc, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0};
diff --git a/bitmaps/m-ibm.xbm b/bitmaps/m-ibm.xbm
new file mode 100644 (file)
index 0000000..203c6de
--- /dev/null
@@ -0,0 +1,32 @@
+#define image_width 78
+#define image_height 34
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0xff, 0xf8, 0xff,
+   0x3f, 0xf0, 0xff, 0x00, 0xff, 0xcf, 0xfc, 0xff, 0xf8, 0xff, 0x7f, 0xf0,
+   0xff, 0x00, 0xff, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0xfc, 0xff, 0xf8, 0xff, 0xff, 0xf1, 0xff, 0xc1, 0xff, 0xcf, 0xfc, 0xff,
+   0xf8, 0xff, 0xff, 0xf1, 0xff, 0xc1, 0xff, 0xcf, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0xff, 0xe3,
+   0xff, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0xff, 0xe3, 0xff, 0xc0,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0f, 0x80, 0xff,
+   0xff, 0x00, 0xff, 0xf7, 0xff, 0xc0, 0xc0, 0x0f, 0x80, 0xff, 0x7f, 0x00,
+   0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0xc0, 0x0f, 0x80, 0xff, 0x7f, 0x00, 0xbf, 0xff, 0xfd, 0xc0, 0xc0, 0x0f,
+   0x80, 0xff, 0x7f, 0x00, 0xbf, 0xff, 0xfd, 0xc0, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0x3f, 0x7f,
+   0xfc, 0xc0, 0xc0, 0x0f, 0x80, 0x1f, 0xf8, 0x01, 0x3f, 0x7f, 0xfc, 0xc0,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0xff, 0xf8, 0xff,
+   0xff, 0xf1, 0x3f, 0x3e, 0xfc, 0xcf, 0xfc, 0xff, 0xf8, 0xff, 0xff, 0xf1,
+   0x3f, 0x3e, 0xfc, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+   0xfc, 0xff, 0xf8, 0xff, 0x7f, 0xf0, 0x3f, 0x1c, 0xfc, 0xcf, 0xfc, 0xff,
+   0xf8, 0xff, 0x3f, 0xf0, 0x3f, 0x1c, 0xfc, 0xcf, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0};
diff --git a/bitmaps/m-linux.xbm b/bitmaps/m-linux.xbm
new file mode 100644 (file)
index 0000000..db3befe
--- /dev/null
@@ -0,0 +1,53 @@
+#define image_width 64
+#define image_height 75
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
+   0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
+   0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff,
+   0xff, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
+   0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
+   0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x04, 0x1c, 0xf0, 0xff, 0xff,
+   0xff, 0xff, 0x1f, 0x07, 0x3f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x0f,
+   0x7f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x08, 0x63, 0xe0, 0xff, 0xff,
+   0xff, 0xff, 0xbf, 0x1c, 0x61, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x08,
+   0x61, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf9, 0x61, 0xe0, 0xff, 0xff,
+   0xff, 0xff, 0x3f, 0x69, 0x37, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfe,
+   0x3d, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xba, 0x6f, 0xe0, 0xff, 0xff,
+   0xff, 0xff, 0x3f, 0xf7, 0x5b, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x7d,
+   0x6b, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0x1c, 0xc0, 0xff, 0xff,
+   0xff, 0xff, 0x3f, 0x01, 0x77, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xd7,
+   0xf9, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x27, 0xfe, 0x00, 0xff, 0xff,
+   0xff, 0xff, 0x1f, 0xdf, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff,
+   0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0x03, 0xfc, 0xff,
+   0xff, 0xff, 0xc7, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xe3, 0xff,
+   0xff, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0x03, 0xf0, 0xff,
+   0xff, 0xff, 0xe1, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xff, 0xf0, 0xff,
+   0xff, 0x07, 0xe0, 0xff, 0xff, 0x7f, 0xe0, 0xff, 0xff, 0x0f, 0xc0, 0xff,
+   0xff, 0x7f, 0xf0, 0xff, 0xff, 0x0f, 0x80, 0xff, 0xff, 0x3f, 0xf8, 0xff,
+   0xff, 0x1f, 0x80, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0xff,
+   0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0x00, 0xff, 0xff, 0x1f, 0xfc, 0xff,
+   0xff, 0x3f, 0x00, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0xfe,
+   0xff, 0x0f, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0xfe, 0xff, 0x0f, 0xff, 0xff,
+   0xff, 0x7f, 0x00, 0xfe, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc,
+   0xff, 0x07, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0x07, 0xff, 0xff,
+   0xff, 0x7f, 0x00, 0xfc, 0xff, 0x83, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc,
+   0xff, 0x81, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0x81, 0xff, 0xff,
+   0xff, 0x7f, 0x00, 0xfc, 0xff, 0x81, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc,
+   0xff, 0x89, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0xbf, 0xff, 0xff,
+   0xff, 0x7f, 0x00, 0xfc, 0xff, 0x77, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0xfe,
+   0xff, 0xdd, 0xfc, 0xff, 0xff, 0xf7, 0x00, 0xff, 0xff, 0xfe, 0xf9, 0xff,
+   0xff, 0x5f, 0x00, 0xff, 0x7f, 0x6b, 0xf1, 0xff, 0xff, 0x77, 0x80, 0xfd,
+   0x5f, 0xff, 0xe3, 0xff, 0xff, 0x6f, 0xc1, 0xff, 0xed, 0xb5, 0x82, 0xff,
+   0xff, 0xbf, 0xea, 0xfe, 0xbd, 0xff, 0x07, 0xff, 0xff, 0x6f, 0x5b, 0xff,
+   0xf7, 0xde, 0x0b, 0xfe, 0xff, 0xe7, 0xf5, 0xfb, 0xbf, 0xb7, 0x0e, 0xfe,
+   0xff, 0x57, 0xbf, 0xfd, 0x6b, 0xfb, 0x1b, 0xfe, 0xff, 0xef, 0xed, 0xee,
+   0xfd, 0x5f, 0xbf, 0xff, 0xff, 0xb1, 0xfb, 0xbd, 0xb7, 0xfd, 0xab, 0xff,
+   0xff, 0xd0, 0xef, 0xf7, 0xed, 0xaf, 0xfe, 0xff, 0x7f, 0x60, 0xbf, 0xff,
+   0xbb, 0xfb, 0x5b, 0xff, 0x1f, 0xf0, 0xfb, 0xad, 0xfd, 0xbe, 0x7f, 0xfe,
+   0x07, 0x50, 0x6f, 0xff, 0xd7, 0xf7, 0xaa, 0x00, 0x00, 0xf0, 0xdd, 0xf7,
+   0x6b, 0xdd, 0x7f, 0x00, 0x00, 0xd0, 0xff, 0xfc, 0xa9, 0x76, 0xaf, 0x00,
+   0x00, 0xa8, 0x56, 0xff, 0x5f, 0xa9, 0x35, 0x00, 0x00, 0x60, 0xab, 0xff,
+   0xff, 0xa5, 0x16, 0xfc, 0xff, 0x93, 0xca, 0xff, 0xff, 0x9f, 0x48, 0xff,
+   0xff, 0x47, 0xe5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
diff --git a/bitmaps/m-linux1.xbm b/bitmaps/m-linux1.xbm
new file mode 100644 (file)
index 0000000..4d155e5
--- /dev/null
@@ -0,0 +1,46 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x02, 0x00,
+   0x20, 0x00, 0x00, 0xc2, 0x12, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40,
+   0x46, 0x00, 0x01, 0x04, 0x10, 0x40, 0x00, 0x61, 0x04, 0x20, 0x80, 0x00,
+   0x02, 0x08, 0x20, 0x20, 0x2c, 0x84, 0x10, 0x42, 0x08, 0x21, 0x84, 0x30,
+   0x88, 0xf0, 0x7f, 0x08, 0x21, 0x84, 0x10, 0x12, 0x58, 0x22, 0x40, 0x21,
+   0x84, 0x10, 0x42, 0x18, 0x10, 0x28, 0x40, 0x84, 0x10, 0x42, 0x08, 0x09,
+   0x30, 0x61, 0xe0, 0x10, 0x42, 0x08, 0x21, 0x0c, 0x60, 0xc4, 0x30, 0x42,
+   0x08, 0x21, 0x84, 0x04, 0xe0, 0xd2, 0x50, 0x29, 0xa5, 0x94, 0x52, 0x06,
+   0x40, 0xa5, 0x90, 0x52, 0x4a, 0x29, 0xa5, 0x02, 0xc0, 0xca, 0x38, 0xa5,
+   0x94, 0x52, 0x4a, 0x03, 0x80, 0xb5, 0xf8, 0xff, 0xfb, 0xef, 0xff, 0x3f,
+   0x80, 0xdb, 0x28, 0x0c, 0x8d, 0x38, 0x0c, 0x21, 0x00, 0x77, 0x78, 0x1e,
+   0xcb, 0x69, 0x9e, 0x31, 0x00, 0x6f, 0x78, 0x16, 0xce, 0x79, 0x9e, 0x19,
+   0x00, 0x7a, 0x6c, 0x1e, 0xc6, 0x38, 0x9b, 0x0c, 0x00, 0x7e, 0x3c, 0x1e,
+   0xe6, 0x3c, 0x1f, 0x04, 0x00, 0x7c, 0x3c, 0x8e, 0xe4, 0x3c, 0x1f, 0x06,
+   0x00, 0x2c, 0x3c, 0x8f, 0xe4, 0x1c, 0x1f, 0x03, 0x00, 0x38, 0x3c, 0xcf,
+   0x64, 0x9c, 0x0f, 0x01, 0x00, 0x38, 0x1e, 0xc7, 0x70, 0x9e, 0x07, 0x01,
+   0x00, 0x30, 0x1e, 0xc7, 0x71, 0x9e, 0x27, 0x01, 0x00, 0x30, 0x9e, 0xe7,
+   0x71, 0x8e, 0x33, 0x01, 0x00, 0x10, 0x9e, 0xe7, 0x79, 0xc0, 0x31, 0x03,
+   0x00, 0x10, 0x0e, 0xc3, 0xf9, 0xe0, 0x10, 0x02, 0xff, 0x1f, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0x1f, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0x00, 0x08, 0x01, 0x13,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xf1, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0x0c, 0xfe, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x06, 0x7e, 0xf8,
+   0xff, 0x7f, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf8, 0xff, 0x3f, 0x00, 0x00,
+   0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+   0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
+   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+   0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+   0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/m-mot.xbm b/bitmaps/m-mot.xbm
new file mode 100644 (file)
index 0000000..db0e78d
--- /dev/null
@@ -0,0 +1,67 @@
+#define image_width 76
+#define image_height 76
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xfc, 0x07, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x78, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
+   0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x01, 0x1e,
+   0x00, 0x00, 0x00, 0xe0, 0x01, 0x0c, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00,
+   0x00, 0x70, 0x00, 0x0c, 0x00, 0x80, 0x01, 0x70, 0x00, 0x00, 0x00, 0x38,
+   0x00, 0x0c, 0x00, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e,
+   0x00, 0x80, 0x03, 0xc0, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x80,
+   0x03, 0x80, 0x03, 0x00, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0xc0, 0x03, 0x00,
+   0x03, 0x00, 0x00, 0x07, 0x00, 0x1e, 0x00, 0xc0, 0x07, 0x00, 0x07, 0x00,
+   0x80, 0x03, 0x00, 0x3f, 0x00, 0xc0, 0x07, 0x00, 0x0e, 0x00, 0x80, 0x01,
+   0x00, 0x3f, 0x00, 0xe0, 0x07, 0x00, 0x0c, 0x00, 0xc0, 0x01, 0x00, 0x3f,
+   0x00, 0xe0, 0x0f, 0x00, 0x18, 0x00, 0xc0, 0x00, 0x80, 0x7f, 0x00, 0xe0,
+   0x0f, 0x00, 0x38, 0x00, 0xe0, 0x00, 0x80, 0x7f, 0x00, 0xf0, 0x0f, 0x00,
+   0x30, 0x00, 0x60, 0x00, 0x80, 0x7f, 0x00, 0xf0, 0x1f, 0x00, 0x70, 0x00,
+   0x70, 0x00, 0xc0, 0xff, 0x00, 0xf0, 0x1f, 0x00, 0x60, 0x00, 0x30, 0x00,
+   0xc0, 0xff, 0x00, 0xf0, 0x1f, 0x00, 0x60, 0x00, 0x30, 0x00, 0xc0, 0xff,
+   0x00, 0xf8, 0x3f, 0x00, 0xe0, 0x00, 0x38, 0x00, 0xc0, 0xff, 0x01, 0xf8,
+   0x3f, 0x00, 0xc0, 0x00, 0x18, 0x00, 0xe0, 0xff, 0x01, 0xf8, 0x3f, 0x00,
+   0xc0, 0x00, 0x18, 0x00, 0xe0, 0xff, 0x01, 0xfc, 0x7f, 0x00, 0xc0, 0x01,
+   0x18, 0x00, 0xe0, 0xff, 0x03, 0xfc, 0x7f, 0x00, 0x80, 0x01, 0x1c, 0x00,
+   0xf0, 0xff, 0x03, 0xfc, 0x7f, 0x00, 0x80, 0x01, 0x0c, 0x00, 0xf0, 0xff,
+   0x03, 0xfc, 0x7f, 0x00, 0x80, 0x01, 0x0c, 0x00, 0xf0, 0xff, 0x03, 0xfe,
+   0xff, 0x00, 0x80, 0x01, 0x0c, 0x00, 0xf8, 0xff, 0x07, 0xfe, 0xff, 0x00,
+   0x80, 0x01, 0x0c, 0x00, 0xf8, 0xff, 0x07, 0xfe, 0xff, 0x00, 0x80, 0x03,
+   0x0c, 0x00, 0xf8, 0xff, 0x07, 0xff, 0xff, 0x01, 0x00, 0x03, 0x0c, 0x00,
+   0xf8, 0xff, 0x0f, 0xff, 0xff, 0x01, 0x00, 0x03, 0x0c, 0x00, 0xfc, 0xc1,
+   0x0f, 0x1f, 0xf8, 0x01, 0x00, 0x03, 0x0c, 0x00, 0x7c, 0x00, 0x8f, 0x0f,
+   0xe0, 0x03, 0x00, 0x03, 0x0c, 0x00, 0x3c, 0x00, 0x9e, 0x07, 0xc0, 0x03,
+   0x00, 0x03, 0x0c, 0x00, 0x1e, 0x00, 0x9c, 0x03, 0x80, 0x03, 0x80, 0x01,
+   0x0c, 0x00, 0x0e, 0x00, 0x9c, 0x01, 0x80, 0x07, 0x80, 0x01, 0x0c, 0x00,
+   0x0e, 0x00, 0xf8, 0x01, 0x00, 0x07, 0x80, 0x01, 0x1c, 0x00, 0x06, 0x00,
+   0xf0, 0x00, 0x00, 0x07, 0x80, 0x01, 0x18, 0x00, 0x07, 0x00, 0x70, 0x00,
+   0x00, 0x06, 0x80, 0x01, 0x18, 0x00, 0x07, 0x00, 0x60, 0x00, 0x00, 0x0e,
+   0xc0, 0x01, 0x18, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x0c, 0xc0, 0x00,
+   0x38, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xc0, 0x00, 0x30, 0x80,
+   0x01, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xc0, 0x00, 0x30, 0x80, 0x01, 0x00,
+   0x00, 0x00, 0x00, 0x18, 0xe0, 0x00, 0x70, 0xc0, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x18, 0x60, 0x00, 0x60, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38,
+   0x70, 0x00, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00,
+   0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0xc0, 0x01,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x80, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x06, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00,
+   0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x18,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x70, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38,
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
+   0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00,
+   0x1e, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00,
+   0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00,
+   0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0xfc, 0x07, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/m-sco.xbm b/bitmaps/m-sco.xbm
new file mode 100644 (file)
index 0000000..9e56780
--- /dev/null
@@ -0,0 +1,20 @@
+#define image_width 76
+#define image_height 25
+static unsigned char image_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x07,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x3f,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x07,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x3f,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0x1f,0xf0,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0xf0,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0xff,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,0x00,0xf0,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x78,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x03,0xf0,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x07,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x03,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
diff --git a/bitmaps/m-sgi.xbm b/bitmaps/m-sgi.xbm
new file mode 100644 (file)
index 0000000..5f4c5e4
--- /dev/null
@@ -0,0 +1,46 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+   0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7f, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f,
+   0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0xfc, 0x0f, 0x00, 0x00,
+   0x00, 0x00, 0xf8, 0x7f, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f,
+   0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0xfc, 0xff, 0x01, 0x00,
+   0x00, 0x80, 0xff, 0x7c, 0x7c, 0xfe, 0x03, 0x00, 0x00, 0xe0, 0x3f, 0x7c,
+   0x7c, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x1f, 0x7c, 0x7c, 0xf0, 0x3f, 0x00,
+   0x00, 0xfc, 0x07, 0x7c, 0x7c, 0xc0, 0x7f, 0x00, 0x00, 0xff, 0x01, 0x7c,
+   0x7c, 0x00, 0xff, 0x01, 0x00, 0x7f, 0x00, 0x7c, 0x7c, 0x00, 0xfc, 0x01,
+   0x80, 0x3f, 0x00, 0x7c, 0x7c, 0x00, 0xf8, 0x03, 0x00, 0xff, 0x00, 0x7c,
+   0x7c, 0x00, 0xfe, 0x01, 0x00, 0xff, 0x03, 0x7c, 0x7c, 0x80, 0xff, 0x01,
+   0x00, 0xfc, 0x0f, 0x7c, 0x7c, 0xe0, 0x7f, 0x00, 0x40, 0xf0, 0x3f, 0x7c,
+   0x7c, 0xf8, 0x1f, 0x04, 0xf0, 0xe1, 0xff, 0x7c, 0x7c, 0xfe, 0x0f, 0x1f,
+   0xf8, 0x87, 0xff, 0x73, 0x9c, 0xff, 0xc3, 0x3f, 0xf8, 0x0f, 0xfe, 0x4f,
+   0xe4, 0xff, 0xe0, 0x3f, 0xfc, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x7f,
+   0xfc, 0xff, 0xe0, 0xff, 0xff, 0x0f, 0xfe, 0x7f, 0xfc, 0xff, 0x83, 0xff,
+   0xff, 0x83, 0xff, 0x7f, 0xfc, 0xff, 0x07, 0xff, 0xff, 0xc1, 0xff, 0x7f,
+   0x7c, 0xfe, 0x1f, 0xfc, 0x7f, 0xf0, 0xff, 0x7c, 0x7c, 0xf8, 0x7f, 0xf2,
+   0x9f, 0xfc, 0x3f, 0x7c, 0x7c, 0xe0, 0xff, 0xcd, 0x67, 0xfe, 0x0f, 0x7c,
+   0x7c, 0xc0, 0xff, 0x33, 0x99, 0xff, 0x07, 0x7c, 0x7c, 0x00, 0xff, 0x0f,
+   0xe0, 0xff, 0x01, 0x7c, 0x7c, 0x00, 0xfc, 0x3f, 0xf8, 0x7f, 0x00, 0x7c,
+   0x7c, 0x00, 0xf2, 0x7f, 0xfc, 0x9f, 0x00, 0x7c, 0x7c, 0x80, 0xcf, 0x7f,
+   0xfd, 0xe7, 0x03, 0x7c, 0x7c, 0xe0, 0xbf, 0x7f, 0xfd, 0xf9, 0x0f, 0x7c,
+   0x7c, 0xf8, 0x7f, 0x7e, 0xfd, 0xfc, 0x3f, 0x7c, 0x7c, 0xfe, 0x0f, 0x7c,
+   0x7d, 0xe0, 0xff, 0x7c, 0xfc, 0xff, 0x83, 0x7d, 0x7d, 0x83, 0xff, 0x7f,
+   0xfc, 0xff, 0xe0, 0x7d, 0x7d, 0x0f, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x7d,
+   0x7c, 0x3f, 0xf8, 0x7f, 0xfc, 0x0f, 0xfe, 0x7d, 0x7c, 0xff, 0xe0, 0x7f,
+   0xfc, 0x03, 0xff, 0x7d, 0x7c, 0xff, 0x81, 0x7f, 0xf8, 0xc0, 0xff, 0x7d,
+   0x7c, 0xff, 0x07, 0x3e, 0x30, 0xf0, 0xff, 0x7c, 0x7c, 0xfe, 0x1f, 0x18,
+   0x00, 0xfc, 0x3f, 0x7c, 0x7c, 0xf8, 0x7f, 0x00, 0x00, 0xff, 0x0f, 0x7c,
+   0x7c, 0xe0, 0xff, 0x01, 0x80, 0xff, 0x03, 0x7c, 0x7c, 0x80, 0xff, 0x03,
+   0x80, 0xff, 0x00, 0x7c, 0x7c, 0x00, 0xfe, 0x03, 0xc0, 0x3f, 0x00, 0x7c,
+   0x7c, 0x00, 0xf8, 0x07, 0xc0, 0x7f, 0x00, 0x7c, 0x7c, 0x00, 0xfc, 0x07,
+   0x80, 0xff, 0x01, 0x7c, 0x7c, 0x00, 0xff, 0x03, 0x80, 0xff, 0x07, 0x7c,
+   0x7c, 0xc0, 0xff, 0x03, 0x00, 0xfe, 0x1f, 0x7c, 0x7c, 0xf0, 0xff, 0x00,
+   0x00, 0xf8, 0x7f, 0x7c, 0x7c, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0x7d,
+   0x7c, 0xff, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x7f, 0xfc, 0xff, 0x03, 0x00,
+   0x00, 0x00, 0xfe, 0x7f, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f,
+   0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0xfc, 0x0f, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x7f, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e,
+   0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/m-sun.xbm b/bitmaps/m-sun.xbm
new file mode 100644 (file)
index 0000000..681167f
--- /dev/null
@@ -0,0 +1,46 @@
+#define image_width 64
+#define image_height 64
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+   0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7e, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe,
+   0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfc, 0xfd, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xfd, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb,
+   0xf7, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf4, 0xf7, 0xef, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xee, 0xef, 0xdf, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xdf,
+   0xbf, 0xff, 0x00, 0x00, 0x00, 0x80, 0xbf, 0xbf, 0x7f, 0xff, 0x00, 0x00,
+   0x00, 0x80, 0x7f, 0x7f, 0xff, 0x7e, 0x03, 0x00, 0x00, 0x60, 0xff, 0xfe,
+   0xfe, 0xbd, 0x07, 0x00, 0x00, 0xf0, 0xfe, 0xfd, 0xfd, 0xdb, 0x0f, 0x00,
+   0x00, 0xf8, 0xfd, 0xfb, 0xfb, 0xe7, 0x1f, 0x00, 0x00, 0xfc, 0xfb, 0xf7,
+   0xf7, 0xf7, 0x2f, 0x00, 0x00, 0xfe, 0xf5, 0xef, 0xef, 0xfb, 0x77, 0x00,
+   0x00, 0xff, 0xee, 0xdf, 0xcf, 0xfd, 0xfb, 0x00, 0x80, 0x7f, 0xdf, 0xbf,
+   0x9f, 0xfe, 0xfd, 0x01, 0xc0, 0xbf, 0xbf, 0xff, 0x1f, 0xff, 0xfe, 0x00,
+   0xe0, 0xdf, 0x1f, 0xff, 0x9f, 0x7f, 0x7f, 0x00, 0xf0, 0xef, 0x0f, 0xfe,
+   0xcf, 0xbf, 0x3f, 0x07, 0xf8, 0xf7, 0xe7, 0xfc, 0xef, 0xdf, 0xdf, 0x1f,
+   0xfc, 0xfb, 0xfb, 0xfb, 0xf7, 0xef, 0xef, 0x3f, 0xfe, 0xfd, 0xfd, 0xe7,
+   0xf9, 0xf7, 0xf7, 0x7f, 0xfe, 0xfe, 0xfe, 0x07, 0xf8, 0xfb, 0xfb, 0x7f,
+   0x7f, 0x7f, 0xff, 0x0f, 0xfc, 0xfd, 0xfd, 0xff, 0xbf, 0xbf, 0xff, 0x0f,
+   0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xdf, 0xdf, 0x0f, 0xfc, 0x7f, 0xff, 0xfe,
+   0xff, 0xef, 0xef, 0x0f, 0xfc, 0xbf, 0x7f, 0xff, 0xfe, 0xf7, 0xf7, 0x07,
+   0xf8, 0xdf, 0xbf, 0x7f, 0xfe, 0xfb, 0xfb, 0xe7, 0xf9, 0xef, 0xdf, 0x7f,
+   0xfc, 0xfd, 0xfd, 0xfb, 0xf7, 0xf7, 0xef, 0x3f, 0x70, 0xfe, 0xfe, 0xfd,
+   0xcf, 0xf9, 0xf7, 0x1f, 0x00, 0x7f, 0xff, 0xfc, 0x1f, 0xfc, 0xfb, 0x0f,
+   0x80, 0xbf, 0x7f, 0xfe, 0x3f, 0xfe, 0xfd, 0x07, 0xc0, 0xdf, 0x3f, 0xfe,
+   0x7f, 0xff, 0xfe, 0x03, 0x80, 0xef, 0x5f, 0x7e, 0xff, 0x7e, 0xff, 0x01,
+   0x00, 0xf7, 0xef, 0xfc, 0xfe, 0xbd, 0xff, 0x00, 0x00, 0xfa, 0xf7, 0xfd,
+   0xfd, 0xdb, 0x7f, 0x00, 0x00, 0xfc, 0xfb, 0xfb, 0xfb, 0xe7, 0x3f, 0x00,
+   0x00, 0xf8, 0xf9, 0xf7, 0xf7, 0xef, 0x1f, 0x00, 0x00, 0xf0, 0xee, 0xef,
+   0xef, 0xdf, 0x0f, 0x00, 0x00, 0x60, 0xdf, 0xdf, 0xdf, 0xbf, 0x07, 0x00,
+   0x00, 0x80, 0xbf, 0xbf, 0xbf, 0x7f, 0x03, 0x00, 0x00, 0x80, 0x7f, 0x7f,
+   0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0xfe, 0xfe, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0xfd, 0xfd, 0x7d, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfb,
+   0xfb, 0x3b, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf7, 0xf7, 0x17, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xef, 0xef, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdf,
+   0xdf, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x7f, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00};
diff --git a/bitmaps/m-x11.xbm b/bitmaps/m-x11.xbm
new file mode 100644 (file)
index 0000000..b725672
--- /dev/null
@@ -0,0 +1,14 @@
+#define image_width 32
+#define image_height 32
+static unsigned char image_bits[] = {
+   0xff, 0x00, 0x00, 0xc0, 0xfe, 0x01, 0x00, 0xc0, 0xfc, 0x03, 0x00, 0x60,
+   0xf8, 0x07, 0x00, 0x30, 0xf8, 0x07, 0x00, 0x18, 0xf0, 0x0f, 0x00, 0x0c,
+   0xe0, 0x1f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x03,
+   0x80, 0x7f, 0x80, 0x01, 0x00, 0xff, 0xc0, 0x00, 0x00, 0xfe, 0x61, 0x00,
+   0x00, 0xfe, 0x31, 0x00, 0x00, 0xfc, 0x33, 0x00, 0x00, 0xf8, 0x1b, 0x00,
+   0x00, 0xf0, 0x0d, 0x00, 0x00, 0xf0, 0x0e, 0x00, 0x00, 0x60, 0x1f, 0x00,
+   0x00, 0xb0, 0x3f, 0x00, 0x00, 0x98, 0x7f, 0x00, 0x00, 0x98, 0x7f, 0x00,
+   0x00, 0x0c, 0xff, 0x00, 0x00, 0x06, 0xfe, 0x01, 0x00, 0x03, 0xfc, 0x03,
+   0x80, 0x01, 0xfc, 0x03, 0xc0, 0x00, 0xf8, 0x07, 0xc0, 0x00, 0xf0, 0x0f,
+   0x60, 0x00, 0xe0, 0x1f, 0x30, 0x00, 0xe0, 0x1f, 0x18, 0x00, 0xc0, 0x3f,
+   0x0c, 0x00, 0x80, 0x7f, 0x06, 0x00, 0x00, 0xff};
diff --git a/bitmaps/m-xlock.xbm b/bitmaps/m-xlock.xbm
new file mode 100644 (file)
index 0000000..27bc331
--- /dev/null
@@ -0,0 +1,17 @@
+#define image_width 50
+#define image_height 24
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x01, 0xf8, 0xff, 0xc7, 0xff,
+   0xff, 0x03, 0x03, 0xf0, 0xff, 0xe3, 0xff, 0xff, 0x03, 0x07, 0xe0, 0xff,
+   0xf1, 0xff, 0xff, 0x03, 0x0f, 0xc0, 0xff, 0xf8, 0x7f, 0xf0, 0x03, 0x1f,
+   0x80, 0x7f, 0xfc, 0x1f, 0xc0, 0x03, 0x3f, 0x00, 0x3f, 0xfe, 0x1f, 0xc0,
+   0x03, 0x7f, 0x00, 0x1e, 0xff, 0x0f, 0x87, 0x03, 0xff, 0x00, 0x8c, 0xff,
+   0x8f, 0x8f, 0x03, 0xff, 0x01, 0xc4, 0xff, 0x8f, 0x8f, 0x03, 0xff, 0x03,
+   0xe2, 0xff, 0x8f, 0x8f, 0x03, 0xff, 0x07, 0xe1, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0x8f, 0xc0, 0xff, 0x03, 0x00, 0x02, 0xff, 0x47, 0x80, 0xff, 0x03,
+   0x00, 0x02, 0xff, 0x23, 0x00, 0xff, 0x83, 0x08, 0x02, 0xff, 0x71, 0x00,
+   0xfe, 0x93, 0x4f, 0x02, 0xff, 0xf8, 0x00, 0xfc, 0x93, 0x48, 0x02, 0x7f,
+   0xfc, 0x01, 0xf8, 0x93, 0x4f, 0x02, 0x3f, 0xfe, 0x03, 0xf0, 0x93, 0x48,
+   0x02, 0x1f, 0xff, 0x07, 0xe0, 0x93, 0x4f, 0x02, 0x8f, 0xff, 0x0f, 0xc0,
+   0x93, 0x48, 0x02, 0xc7, 0xff, 0x1f, 0x80, 0x03, 0x00, 0x02, 0xe3, 0xff,
+   0x3f, 0x00, 0x03, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03};
diff --git a/bitmaps/mailempty.xbm b/bitmaps/mailempty.xbm
new file mode 100644 (file)
index 0000000..0642525
--- /dev/null
@@ -0,0 +1,27 @@
+#define mailempty_width 48
+#define mailempty_height 48
+static unsigned char mailempty_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x80, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xc0, 0xaf, 0xaa, 0xaa, 0xaa, 0x7a, 0xe0, 0x57, 0x55, 0x55, 0x55, 0x7d,
+   0xf0, 0xaf, 0xaa, 0xaa, 0xaa, 0x7e, 0xf8, 0x57, 0x55, 0x55, 0x55, 0x7f,
+   0xfc, 0xaf, 0xaa, 0xaa, 0xaa, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xab, 0xaa, 0xaa, 0xea, 0x7f,
+   0xfe, 0x55, 0x55, 0x55, 0xf5, 0x6f, 0xfe, 0xaa, 0xaa, 0xaa, 0xea, 0x67,
+   0x7e, 0x55, 0x55, 0x55, 0xf5, 0x63, 0xbe, 0xaa, 0xaa, 0xaa, 0xea, 0x61,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0x60, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0x60,
+   0x06, 0x06, 0x00, 0x00, 0x60, 0x60, 0x06, 0x06, 0x00, 0x00, 0x60, 0x60,
+   0x06, 0x06, 0x00, 0x00, 0x60, 0x60, 0x06, 0x06, 0x00, 0x00, 0x60, 0x60,
+   0x06, 0x06, 0x00, 0x00, 0x60, 0x60, 0x06, 0xfe, 0xff, 0xff, 0xff, 0x7f,
+   0x06, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x86, 0xaf, 0xaa, 0xaa, 0xea, 0x7a,
+   0xc6, 0x57, 0x55, 0x55, 0x75, 0x7d, 0xe6, 0xaf, 0xaa, 0xaa, 0xea, 0x7e,
+   0xf6, 0x57, 0x55, 0x55, 0x75, 0x7f, 0xfe, 0xaf, 0xaa, 0xaa, 0xea, 0x7f,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xfe, 0xab, 0xaa, 0xaa, 0xea, 0x7f, 0xfe, 0x55, 0x55, 0x55, 0xf5, 0x6f,
+   0xfe, 0xaa, 0xaa, 0xaa, 0xea, 0x67, 0x7e, 0x55, 0x55, 0x55, 0xf5, 0x63,
+   0xbe, 0xaa, 0xaa, 0xaa, 0xea, 0x61, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x60,
+   0xfe, 0xff, 0xff, 0xff, 0x7f, 0x60, 0x06, 0x06, 0x00, 0x00, 0x60, 0x00,
+   0x06, 0x00, 0x00, 0x00, 0x60, 0x00, 0x06, 0x00, 0x00, 0x00, 0x60, 0x00,
+   0x06, 0x00, 0x00, 0x00, 0x60, 0x00, 0x06, 0x00, 0x00, 0x00, 0x60, 0x00,
+   0x06, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/mailfull.xbm b/bitmaps/mailfull.xbm
new file mode 100644 (file)
index 0000000..cc2f6f8
--- /dev/null
@@ -0,0 +1,27 @@
+#define mailfull_width 48
+#define mailfull_height 48
+static unsigned char mailfull_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x07,
+   0xc0, 0xff, 0xff, 0xff, 0x1f, 0x04, 0x40, 0x00, 0x00, 0x00, 0xd0, 0x05,
+   0x40, 0x00, 0x00, 0x00, 0x57, 0x7d, 0x40, 0x1e, 0x00, 0x00, 0x55, 0x7d,
+   0x40, 0x00, 0x00, 0x00, 0xd5, 0x7d, 0x60, 0x02, 0x00, 0x00, 0x17, 0x7c,
+   0x70, 0x00, 0x7e, 0x00, 0x10, 0x7c, 0x78, 0x00, 0x00, 0x00, 0x10, 0x7e,
+   0x7c, 0x00, 0x1e, 0x00, 0x10, 0x7f, 0x7e, 0x00, 0x00, 0x00, 0x90, 0x7f,
+   0x7e, 0x00, 0x3e, 0x07, 0xd0, 0x7f, 0x7e, 0x00, 0x00, 0x00, 0xf0, 0x7f,
+   0x7e, 0x00, 0x00, 0x00, 0xf0, 0x6f, 0x7e, 0x00, 0x00, 0x00, 0xf0, 0x67,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0x63, 0xbe, 0xaa, 0xaa, 0xaa, 0xea, 0x61,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0x60, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0x60,
+   0x06, 0x06, 0x00, 0x00, 0x60, 0x60, 0x06, 0x06, 0x00, 0x00, 0x60, 0x60,
+   0x06, 0x06, 0x00, 0x00, 0x60, 0x60, 0x06, 0x06, 0x00, 0x00, 0x60, 0x60,
+   0x06, 0x06, 0x00, 0x00, 0x60, 0x60, 0x06, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0x86, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xc6, 0xaf, 0xaa, 0xaa, 0xea, 0x7a,
+   0xe6, 0x57, 0x55, 0x55, 0x75, 0x7d, 0xf6, 0xaf, 0xaa, 0xaa, 0xea, 0x7e,
+   0xfe, 0x57, 0x55, 0x55, 0x75, 0x7f, 0xfe, 0xaf, 0xaa, 0xaa, 0xea, 0x7f,
+   0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xfe, 0xab, 0xaa, 0xaa, 0xea, 0x7f, 0xfe, 0x55, 0x55, 0x55, 0xf5, 0x6f,
+   0xfe, 0xaa, 0xaa, 0xaa, 0xea, 0x67, 0x7e, 0x55, 0x55, 0x55, 0xf5, 0x63,
+   0xbe, 0xaa, 0xaa, 0xaa, 0xea, 0x61, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x60,
+   0xfe, 0xff, 0xff, 0xff, 0x7f, 0x60, 0x06, 0x06, 0x00, 0x00, 0x60, 0x60,
+   0x06, 0x00, 0x00, 0x00, 0x60, 0x00, 0x06, 0xee, 0x9c, 0x37, 0x60, 0x00,
+   0x06, 0xfe, 0x36, 0x33, 0x60, 0x00, 0x06, 0xd6, 0x3e, 0x33, 0x60, 0x00,
+   0x06, 0xc6, 0xb6, 0xf7, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/nose-faced.xbm b/bitmaps/nose-faced.xbm
new file mode 100644 (file)
index 0000000..fe57c02
--- /dev/null
@@ -0,0 +1,5 @@
+#define nose_face_down_width 18
+#define nose_face_down_height 7
+static unsigned char nose_face_down_bits[] = {
+ 0xff,0xff,0x03,0xff,0xff,0x03,0xfe,0xff,0x01,0xfe,0xff,0x01,0xfc,0xff,0x00,
+ 0xf8,0x7f,0x00,0xe0,0x1f,0x00};
diff --git a/bitmaps/nose-facef.xbm b/bitmaps/nose-facef.xbm
new file mode 100644 (file)
index 0000000..6044d94
--- /dev/null
@@ -0,0 +1,15 @@
+#define nose_face_front_width 41
+#define nose_face_front_height 28
+static unsigned char nose_face_front_bits[] = {
+ 0x00,0x00,0xff,0x01,0x00,0x00,0x00,0xc0,0xff,0x07,0x00,0x00,0x00,0xe0,0xff,
+ 0x0f,0x00,0x00,0xe0,0xf7,0xff,0xdf,0x0f,0x00,0xe0,0xf7,0xff,0xdf,0x0f,0x00,
+ 0xf0,0xfb,0xff,0xbf,0x1f,0x00,0xf8,0xfb,0xff,0xbf,0x3f,0x00,0xf8,0xfd,0xff,
+ 0x7f,0x3f,0x00,0xfc,0xfd,0xff,0x7f,0x7f,0x00,0xfc,0xfe,0xff,0xff,0x7e,0x00,
+ 0xfe,0xfe,0xff,0xff,0xfe,0x00,0xfe,0xfe,0xff,0xff,0xfe,0x00,0xfe,0xfe,0xff,
+ 0xff,0xfe,0x00,0xff,0xfe,0xff,0xff,0xfe,0x01,0xff,0xfe,0xff,0xff,0xfe,0x01,
+ 0xff,0xfe,0xff,0xff,0xfe,0x01,0xff,0xfd,0xff,0x7f,0xff,0x01,0xff,0xfd,0xff,
+ 0x7f,0xff,0x01,0xff,0xfb,0xff,0xbf,0xff,0x01,0xff,0xfb,0xff,0xbf,0xff,0x01,
+ 0xff,0xf7,0xff,0xdf,0xff,0x01,0xfe,0xef,0xff,0xef,0xff,0x00,0xfe,0x9f,0xff,
+ 0xf3,0xff,0x00,0xfe,0x7f,0xfe,0xfc,0xff,0x00,0xfc,0xff,0x01,0xff,0x7f,0x00,
+ 0xfc,0xff,0xff,0xff,0x7f,0x00,0xf8,0xff,0xff,0xff,0x3f,0x00,0xf0,0xff,0xff,
+ 0xff,0x1f,0x00};
diff --git a/bitmaps/nose-facel.xbm b/bitmaps/nose-facel.xbm
new file mode 100644 (file)
index 0000000..46633ac
--- /dev/null
@@ -0,0 +1,15 @@
+#define nose_face_left_width 50
+#define nose_face_left_height 25
+static unsigned char nose_face_left_bits[] = {
+ 0x00,0x7e,0xff,0xff,0xff,0x1f,0x00,0xc0,0xff,0xfc,0xff,0xff,0x3f,0x00,0xe0,
+ 0xff,0xfb,0xff,0xff,0x3f,0x00,0xf0,0xff,0xf7,0xff,0xff,0x7f,0x00,0xf8,0xff,
+ 0xef,0xff,0xff,0x7f,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xfe,0xff,0xff,0xff,0xff,0xff,0x03,0xfe,
+ 0xff,0xdf,0xff,0xff,0xff,0x03,0xfc,0xff,0xdf,0xff,0xff,0xff,0x01,0xf8,0xff,
+ 0xef,0xff,0xff,0xff,0x01,0xf0,0xff,0xf7,0xff,0xff,0xff,0x01,0xe0,0xff,0xfb,
+ 0xff,0xff,0xff,0x00,0xc0,0xff,0xfc,0xff,0xff,0xff,0x00,0x00,0x7f,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0xff,0xff,0xff,0x3f,0x00};
diff --git a/bitmaps/nose-facer.xbm b/bitmaps/nose-facer.xbm
new file mode 100644 (file)
index 0000000..e7dba81
--- /dev/null
@@ -0,0 +1,15 @@
+#define nose_face_right_width 50
+#define nose_face_right_height 25
+static unsigned char nose_face_right_bits[] = {
+ 0xe0,0xff,0xff,0xff,0xfb,0x01,0x00,0xf0,0xff,0xff,0xff,0xfc,0x0f,0x00,0xf0,
+ 0xff,0xff,0x7f,0xff,0x1f,0x00,0xf8,0xff,0xff,0xbf,0xff,0x3f,0x00,0xf8,0xff,
+ 0xff,0xdf,0xff,0x7f,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0xfe,0xff,0xff,0xff,0xff,0xff,0x01,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0xfe,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xff,
+ 0xff,0xff,0xef,0xff,0xff,0x01,0xfe,0xff,0xff,0xef,0xff,0xff,0x00,0xfe,0xff,
+ 0xff,0xdf,0xff,0x7f,0x00,0xfe,0xff,0xff,0xbf,0xff,0x3f,0x00,0xfc,0xff,0xff,
+ 0x7f,0xff,0x1f,0x00,0xfc,0xff,0xff,0xff,0xfc,0x0f,0x00,0xf8,0xff,0xff,0xff,
+ 0xfb,0x03,0x00,0xf0,0xff,0xff,0xff,0x03,0x00,0x00};
diff --git a/bitmaps/nose-hat.xbm b/bitmaps/nose-hat.xbm
new file mode 100644 (file)
index 0000000..b03e41e
--- /dev/null
@@ -0,0 +1,8 @@
+#define nose_hat_width 43
+#define nose_hat_height 10
+static unsigned char nose_hat_bits[] = {
+ 0x00,0xf8,0xff,0xff,0x00,0x00,0x00,0xf8,0xff,0xff,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0x00,0x00,0x00,0xf8,0xff,0xff,0x00,0x00,0x00,0xf8,0xff,0xff,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0x00,0x00,0xff,0x0f,0x00,0x80,0xff,0x07,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0xff,0xff,0xff,0xff,0xff,0x07,0xff,0xff,0xff,0xff,0xff,0x07
+ };
diff --git a/bitmaps/nose-hatd.xbm b/bitmaps/nose-hatd.xbm
new file mode 100644 (file)
index 0000000..8f27cee
--- /dev/null
@@ -0,0 +1,20 @@
+#define nose_hat_down_width 49
+#define nose_hat_down_height 28
+static unsigned char nose_hat_down_bits[] = {
+   0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f,
+   0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff,
+   0xff, 0xff, 0x01, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0xe0,
+   0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0x00, 0xf8, 0xff, 0x1f, 0xf0, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xe7, 0xcf,
+   0xff, 0x7f, 0x00, 0xfc, 0xff, 0xfb, 0xbf, 0xff, 0x7f, 0x00, 0xfe, 0xff,
+   0xfd, 0x7f, 0xff, 0xff, 0x00, 0xfe, 0xff, 0xfd, 0x7f, 0xff, 0xff, 0x00,
+   0xff, 0xff, 0xf9, 0x3f, 0xff, 0xff, 0x01, 0xff, 0xff, 0xe5, 0x4f, 0xff,
+   0xff, 0x01, 0xff, 0xff, 0x1d, 0x70, 0xff, 0xff, 0x01, 0xff, 0xff, 0xfd,
+   0x7f, 0xff, 0xff, 0x01, 0xfd, 0xff, 0xfb, 0xbf, 0xff, 0x7f, 0x01, 0xfb,
+   0xff, 0xe7, 0xcf, 0xff, 0xbf, 0x01, 0xf6, 0xff, 0x1f, 0xf0, 0xff, 0xdf,
+   0x00, 0xec, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x00, 0xdc, 0xff, 0xff, 0xff,
+   0xff, 0x77, 0x00, 0xb8, 0xff, 0xff, 0xff, 0xff, 0x3b, 0x00, 0x70, 0xfe,
+   0xff, 0xff, 0xff, 0x1c, 0x00, 0xe0, 0xf1, 0xff, 0xff, 0x1f, 0x0f, 0x00,
+   0x80, 0x0f, 0xff, 0xff, 0xe1, 0x03, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe,
+   0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0xff, 0x03, 0x00, 0x00};
diff --git a/bitmaps/nose-shoef.xbm b/bitmaps/nose-shoef.xbm
new file mode 100644 (file)
index 0000000..1b3bbe3
--- /dev/null
@@ -0,0 +1,14 @@
+#define nose_shoe_front_width 61
+#define nose_shoe_front_height 20
+static unsigned char nose_shoe_front_bits[] = {
+ 0x00,0x00,0xf0,0x01,0xf0,0x01,0x00,0x00,0x00,0x00,0xf8,0x03,0xf8,0x03,0x00,
+ 0x00,0x00,0x00,0xfc,0x0f,0xfe,0x07,0x00,0x00,0x00,0x00,0xfc,0x1f,0xff,0x07,
+ 0x00,0x00,0xf0,0x0f,0xfe,0xbf,0xff,0x0f,0xfe,0x01,0xfc,0x1f,0xff,0xbf,0xff,
+ 0x1f,0xff,0x07,0xfc,0x3f,0xff,0xbf,0xff,0x9f,0xff,0x07,0xfe,0x3f,0xff,0xbf,
+ 0xff,0x9f,0xff,0x0f,0xfe,0xff,0xfc,0xbf,0xff,0xe7,0xff,0x0f,0xff,0xff,0xf9,
+ 0xbf,0xff,0xf3,0xff,0x1f,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0x1f,0xff,0xff,
+ 0xff,0x1f,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0x0f,0xfe,0xff,0xff,0x1f,0xf7,
+ 0xff,0xff,0x0f,0xfe,0xff,0xff,0x1d,0xf7,0xff,0xff,0x0f,0xfe,0xff,0xff,0x1d,
+ 0xcf,0xff,0xff,0x0f,0xfe,0xff,0x7f,0x1e,0x3f,0xff,0xff,0x1f,0xff,0xff,0x9f,
+ 0x1f,0xfe,0xff,0xff,0x1f,0xff,0xff,0xff,0x0f,0xfc,0xff,0xff,0x1f,0xff,0xff,
+ 0xff,0x07,0xf8,0xff,0xff,0x1f,0xff,0xff,0xff,0x03};
diff --git a/bitmaps/nose-shoel.xbm b/bitmaps/nose-shoel.xbm
new file mode 100644 (file)
index 0000000..072ee66
--- /dev/null
@@ -0,0 +1,10 @@
+#define nose_shoe_left_width 39
+#define nose_shoe_left_height 19
+static unsigned char nose_shoe_left_bits[] = {
+ 0x00,0x00,0x00,0xf8,0x0f,0x00,0xff,0x00,0xfc,0x1f,0xc0,0xff,0x03,0xff,0x1f,
+ 0xf0,0xff,0x0f,0xff,0x3f,0xf8,0xff,0x9f,0xff,0x3f,0xfc,0xfc,0xbf,0xff,0x3f,
+ 0x3e,0xff,0x3f,0xff,0x3f,0xbe,0xff,0x7f,0xff,0x3f,0xdf,0xff,0xff,0xfe,0x3f,
+ 0xdf,0xff,0xff,0xfe,0x3f,0xdf,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0xff,0x7f,
+ 0xff,0xff,0xff,0xff,0x7f,0xfe,0xff,0xff,0xff,0x7f,0xfe,0xff,0xff,0xff,0x7f,
+ 0xfc,0xff,0xff,0xff,0x3f,0xf8,0xff,0xff,0xff,0x3f,0xf0,0xff,0xff,0xff,0x1f,
+ 0xc0,0xff,0xff,0xff,0x0f};
diff --git a/bitmaps/nose-shoer.xbm b/bitmaps/nose-shoer.xbm
new file mode 100644 (file)
index 0000000..e375474
--- /dev/null
@@ -0,0 +1,10 @@
+#define nose_shoe_right_width 39
+#define nose_shoe_right_height 19
+static unsigned char nose_shoe_right_bits[] = {
+ 0xf8,0x0f,0x00,0x00,0x00,0xfc,0x1f,0x80,0x7f,0x00,0xfc,0x7f,0xe0,0xff,0x01,
+ 0xfe,0x7f,0xf8,0xff,0x07,0xfe,0xff,0xfc,0xff,0x0f,0xfe,0xff,0xfe,0x9f,0x1f,
+ 0xfe,0x7f,0xfe,0x7f,0x3e,0xfe,0x7f,0xff,0xff,0x3e,0xfe,0xbf,0xff,0xff,0x7d,
+ 0xfe,0xbf,0xff,0xff,0x7d,0xfe,0xff,0xff,0xff,0x7d,0xff,0xff,0xff,0xff,0x7f,
+ 0xff,0xff,0xff,0xff,0x7f,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0xff,0x3f,
+ 0xfe,0xff,0xff,0xff,0x1f,0xfe,0xff,0xff,0xff,0x0f,0xfc,0xff,0xff,0xff,0x07,
+ 0xf8,0xff,0xff,0xff,0x01};
diff --git a/bitmaps/nose-stepl.xbm b/bitmaps/nose-stepl.xbm
new file mode 100644 (file)
index 0000000..cf6c902
--- /dev/null
@@ -0,0 +1,16 @@
+#define nose_step_left_width 62
+#define nose_step_left_height 23
+static unsigned char nose_step_left_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0x0f,0xc0,0x0f,0x00,0x00,0x00,0x00,0xfc,0x1f,0xf0,0x3f,0xe0,0x03,0x00,
+ 0x00,0xfe,0x3f,0xf8,0x7f,0xf0,0x07,0x80,0x0f,0xff,0x3f,0xfc,0xff,0xf0,0x0f,
+ 0xe0,0x3f,0xff,0x3f,0xfe,0xff,0xf9,0x1f,0xf0,0x7f,0xff,0x1f,0x9f,0xff,0xfb,
+ 0x3f,0xfc,0x7f,0xff,0x1f,0xef,0xff,0xfb,0x7f,0x7e,0xfe,0xfe,0x0f,0xf7,0xff,
+ 0xfb,0x7f,0xbf,0xff,0xf9,0x0f,0xf7,0xff,0xf7,0x7f,0xdf,0xff,0xff,0x07,0xf7,
+ 0xff,0xf7,0x3f,0xdf,0xff,0xff,0x03,0xff,0xff,0xef,0x3f,0xdf,0xff,0xff,0x03,
+ 0xff,0xff,0xff,0x1f,0xdf,0xff,0xff,0x01,0xfe,0xff,0xff,0x1f,0xff,0xff,0xff,
+ 0x00,0xfe,0xff,0xff,0x1f,0xff,0xff,0xff,0x00,0xfc,0xff,0xff,0x1f,0xfe,0xff,
+ 0x7f,0x00,0xf8,0xff,0xff,0x1f,0xfe,0xff,0x7f,0x00,0xf0,0xff,0xff,0x0f,0xfc,
+ 0xff,0x3f,0x00,0xc0,0xff,0xff,0x07,0xf8,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0x07,0x00};
diff --git a/bitmaps/nose-stepr.xbm b/bitmaps/nose-stepr.xbm
new file mode 100644 (file)
index 0000000..98c838d
--- /dev/null
@@ -0,0 +1,16 @@
+#define nose_step_right_width 62
+#define nose_step_right_height 23
+static unsigned char nose_step_right_bits[] = {
+ 0x80,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0x0f,0x00,0x00,0x00,0x00,0xfc,0x00,0xff,0x1f,0x00,0x00,0xf0,
+ 0x01,0xff,0x03,0xff,0x3f,0x7c,0x00,0xf8,0x83,0xff,0x07,0xff,0x3f,0xff,0x01,
+ 0xfc,0xc3,0xff,0x0f,0xfe,0xbf,0xff,0x03,0xfe,0xe7,0xff,0x1f,0xfe,0xbf,0xff,
+ 0x0f,0xff,0xf7,0x7f,0x3e,0xfc,0xdf,0x9f,0x9f,0xff,0xf7,0xff,0x3d,0xfc,0xe7,
+ 0x7f,0xbf,0xff,0xf7,0xff,0x3b,0xf8,0xff,0xff,0xbe,0xff,0xfb,0xff,0x3b,0xf0,
+ 0xff,0xff,0x3e,0xff,0xfb,0xff,0x3b,0xf0,0xff,0xff,0x3e,0xff,0xfd,0xff,0x3f,
+ 0xe0,0xff,0xff,0x3e,0xfe,0xff,0xff,0x3f,0xc0,0xff,0xff,0x3f,0xfe,0xff,0xff,
+ 0x1f,0xc0,0xff,0xff,0x3f,0xfe,0xff,0xff,0x1f,0x80,0xff,0xff,0x1f,0xfe,0xff,
+ 0xff,0x0f,0x80,0xff,0xff,0x1f,0xfe,0xff,0xff,0x07,0x00,0xff,0xff,0x0f,0xfc,
+ 0xff,0xff,0x03,0x00,0xfe,0xff,0x07,0xf8,0xff,0xff,0x00,0x00,0xf8,0xff,0x01,
+ 0x00,0x00,0x00,0x00};
diff --git a/bitmaps/root_weave.xbm b/bitmaps/root_weave.xbm
new file mode 100644 (file)
index 0000000..6e72323
--- /dev/null
@@ -0,0 +1,4 @@
+#define root_weave_width 4
+#define root_weave_height 4
+static unsigned char root_weave_bits[] = {
+   0x07, 0x0d, 0x0b, 0x0e};
diff --git a/bitmaps/s-bsd.xbm b/bitmaps/s-bsd.xbm
new file mode 100644 (file)
index 0000000..2220bdd
--- /dev/null
@@ -0,0 +1,21 @@
+#define image_width 29
+#define image_height 35
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
+   0x00, 0x07, 0x40, 0x00, 0x00, 0xfb, 0xc1, 0x00, 0x00, 0xfd, 0xc3, 0x00,
+   0x00, 0xf6, 0xcf, 0x01, 0x00, 0x6a, 0xef, 0x01, 0x00, 0xb2, 0xfe, 0x00,
+   0x00, 0x33, 0x7f, 0x00, 0x00, 0x3f, 0x1f, 0x00, 0x80, 0xf7, 0x0f, 0x00,
+   0x98, 0xe7, 0x0f, 0x00, 0x90, 0xfd, 0x0f, 0x00, 0x36, 0xbb, 0x0f, 0x00,
+   0x3c, 0xc7, 0x07, 0x00, 0x39, 0xfc, 0x03, 0x00, 0x3f, 0xfc, 0x00, 0x00,
+   0xc0, 0x59, 0x01, 0x00, 0xc0, 0xfb, 0x01, 0x00, 0xc0, 0xf7, 0x01, 0x00,
+   0x80, 0xcd, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00,
+   0x00, 0xfa, 0x01, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, 0xbe, 0x07, 0x00,
+   0x00, 0x7c, 0x1f, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0xef, 0xc3, 0x0f,
+   0xc0, 0xef, 0x03, 0x1c, 0xf0, 0xf7, 0x03, 0x18, 0xf0, 0xfd, 0x01, 0x0b,
+   0xe0, 0xfe, 0x80, 0x07, 0x00, 0x38, 0x00, 0x00};
+
+/*
+ * BSD daemon
+ * The original BSD daemon is Copyright (c) 1988 Marshall Kirk McKusick.
+ * All rights reserved.  Reproduced with permission.
+ */
diff --git a/bitmaps/s-dec.xbm b/bitmaps/s-dec.xbm
new file mode 100644 (file)
index 0000000..8dcf7f7
--- /dev/null
@@ -0,0 +1,10 @@
+#define image_width 41
+#define image_height 13
+static unsigned char image_bits[] = {
+   0xdf, 0xfb, 0xbd, 0xef, 0xfb, 0x00, 0xdf, 0xfb, 0xbd, 0xef, 0xfb, 0x00,
+   0xd7, 0xfa, 0xb5, 0xef, 0xdb, 0x00, 0xd7, 0xfb, 0xbd, 0xed, 0xdb, 0x00,
+   0xd1, 0x1a, 0xb5, 0x28, 0xda, 0x00, 0xd5, 0x0a, 0xb5, 0xed, 0xda, 0x00,
+   0xd5, 0x6a, 0xb5, 0x2d, 0xda, 0x00, 0xd5, 0x0a, 0xb5, 0xad, 0xda, 0x00,
+   0xd3, 0x3a, 0xb5, 0x29, 0xda, 0x00, 0xdf, 0x0b, 0xbd, 0xef, 0xfb, 0x00,
+   0xdf, 0xbb, 0xbd, 0xef, 0xfb, 0x00, 0xdf, 0xfb, 0xbd, 0xef, 0xfb, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/s-grelb-2.xbm b/bitmaps/s-grelb-2.xbm
new file mode 100644 (file)
index 0000000..f548068
--- /dev/null
@@ -0,0 +1,17 @@
+#define image2_width 30
+#define image2_height 33
+static unsigned char image2_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x03,
+   0x20, 0x01, 0x80, 0x04, 0x00, 0x02, 0x40, 0x00, 0x00, 0xe4, 0x27, 0x00,
+   0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01,
+   0xc0, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xe7, 0xe7, 0x07,
+   0xe0, 0xc3, 0xc3, 0x07, 0xe0, 0xe7, 0xe7, 0x07, 0xe0, 0xff, 0xff, 0x07,
+   0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00,
+   0x00, 0xfc, 0x3f, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x70, 0x0e, 0x00,
+   0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00,
+   0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00,
+   0x00, 0x3f, 0xfc, 0x00, 0x80, 0x7f, 0xfe, 0x01, 0x00, 0x3f, 0xfc, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+/*
+ *      "Life.  Don't talk to me about life" -Marvin the Paranoid Android
+ */
diff --git a/bitmaps/s-grelb.xbm b/bitmaps/s-grelb.xbm
new file mode 100644 (file)
index 0000000..1f253f2
--- /dev/null
@@ -0,0 +1,18 @@
+#define XBM_GRELB
+#define image_width 30
+#define image_height 33
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0x20, 0xe4, 0x27, 0x04,
+   0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01,
+   0xc0, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xe7, 0xe7, 0x07,
+   0xe0, 0xc3, 0xc3, 0x07, 0xe0, 0xe7, 0xe7, 0x07, 0xe0, 0xff, 0xff, 0x07,
+   0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00,
+   0x00, 0xfc, 0x3f, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x70, 0x0e, 0x00,
+   0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00,
+   0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00,
+   0x00, 0x3f, 0xfc, 0x00, 0x80, 0x7f, 0xfe, 0x01, 0x00, 0x3f, 0xfc, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+/*
+ *      "Life.  Don't talk to me about life" -Marvin the Paranoid Android
+ */
diff --git a/bitmaps/s-hp.xbm b/bitmaps/s-hp.xbm
new file mode 100644 (file)
index 0000000..6e90251
--- /dev/null
@@ -0,0 +1,9 @@
+#define image_width 17
+#define image_height 23
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0xbe, 0xfe, 0x00, 0xbe, 0xfc, 0x00, 0xbf, 0xf8, 0x01,
+   0x9f, 0xf0, 0x01, 0xcf, 0xe0, 0x01, 0x4f, 0xe0, 0x01, 0x4f, 0xe0, 0x01,
+   0xcf, 0xec, 0x01, 0xe7, 0xce, 0x01, 0xe7, 0xca, 0x01, 0xa7, 0xca, 0x01,
+   0xa7, 0xca, 0x01, 0xa7, 0xca, 0x01, 0xaf, 0xee, 0x01, 0x0f, 0xe6, 0x01,
+   0x0f, 0xe2, 0x01, 0x0f, 0xe2, 0x01, 0x1f, 0xf3, 0x01, 0x3f, 0xf9, 0x01,
+   0x7e, 0xfd, 0x00, 0x7e, 0xfd, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/s-ibm.xbm b/bitmaps/s-ibm.xbm
new file mode 100644 (file)
index 0000000..4a9873d
--- /dev/null
@@ -0,0 +1,11 @@
+#define image_width 39
+#define image_height 17
+static unsigned char image_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfc, 0xc7, 0x0f, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfe, 0xfc, 0xdf, 0x9f, 0x3f, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x38, 0x70, 0x1c, 0x9f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
+   0xf0, 0x0f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xf0, 0x0f,
+   0xf7, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x70, 0x1c, 0x67, 0x0e,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfc, 0xdf, 0x67, 0x3e, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfe, 0xfc, 0xcf, 0x07, 0x3e, 0x00, 0x00, 0x00, 0x00,
+   0x00};
diff --git a/bitmaps/s-linux.xbm b/bitmaps/s-linux.xbm
new file mode 100644 (file)
index 0000000..f3604ee
--- /dev/null
@@ -0,0 +1,31 @@
+#define image_width 32
+#define image_height 37
+static unsigned char image_bits[] = {
+   0xff, 0x7f, 0xfe, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff,
+   0xff, 0x07, 0xc0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x07, 0xc0, 0xff,
+   0xff, 0x37, 0xc7, 0xff, 0xff, 0x07, 0x89, 0xff, 0xff, 0x07, 0x89, 0xff,
+   0xff, 0xd7, 0x87, 0xff, 0xff, 0x77, 0x8f, 0xff, 0xff, 0xe7, 0x85, 0xff,
+   0xff, 0x57, 0x2d, 0xff, 0xff, 0xb7, 0x0e, 0xff, 0xff, 0xf3, 0x1f, 0xfe,
+   0xff, 0xf9, 0x1f, 0xfe, 0xff, 0xf9, 0x3f, 0xfc, 0xff, 0xfc, 0x3f, 0xf8,
+   0x7f, 0xfc, 0x7f, 0xf0, 0x7f, 0xfc, 0x7f, 0xf0, 0x7f, 0xfe, 0x7f, 0xf0,
+   0x3f, 0xfe, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xe0,
+   0x1f, 0xff, 0xff, 0xe0, 0x9f, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xe0,
+   0xef, 0xfc, 0xbf, 0xf0, 0xbf, 0xf9, 0xff, 0xf0, 0xf7, 0xf3, 0xbf, 0xdd,
+   0xdd, 0xe2, 0xff, 0xfe, 0x7f, 0xf7, 0x9f, 0xdb, 0xdb, 0xfb, 0x8f, 0xff,
+   0xfd, 0xee, 0xc3, 0xbb, 0xab, 0x07, 0x80, 0xee, 0xa7, 0x0a, 0x80, 0xf5,
+   0x7f, 0xf2, 0x3f, 0xf9};
+
+/* Linux Penguin from logo.gif and logo.txt /usr/src/linux/Documentation
+This is the full-colour version of the currenly unofficial Linux logo
+("currently unofficial" just means that there has been no paperwork and
+that I haven't really announced it yet).  It was created by Larry Ewing,
+and is freely usable as long as you acknowledge Larry as the original
+artist.
+
+Note that there are black-and-white versions of this available that
+scale down to smaller sizes and are better for letterheads or whatever
+you want to use it for: for the full range of logos take a look at
+Larry's web-page:
+
+        http://www.isc.tamu.edu/~lewing/linux/
+ */
diff --git a/bitmaps/s-linux1.xbm b/bitmaps/s-linux1.xbm
new file mode 100644 (file)
index 0000000..3d543c1
--- /dev/null
@@ -0,0 +1,13 @@
+#define image_width 29
+#define image_height 29
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0x1f, 0x03, 0x00, 0x00, 0x18, 0x12, 0x10, 0x10, 0x08,
+   0xfe, 0x89, 0x88, 0x0c, 0x04, 0x11, 0x11, 0x05, 0x9c, 0xab, 0xaa, 0x06,
+   0x98, 0xff, 0xff, 0x0f, 0x98, 0x68, 0xad, 0x0b, 0x90, 0x4d, 0x2d, 0x09,
+   0x90, 0x4d, 0x6d, 0x0c, 0x90, 0x0d, 0x6d, 0x04, 0x90, 0x2d, 0x6d, 0x0c,
+   0x90, 0x2d, 0x21, 0x09, 0x90, 0x68, 0xa1, 0x0b, 0x9f, 0xff, 0xff, 0x1f,
+   0x9f, 0xef, 0xff, 0x1f, 0x98, 0xef, 0x3f, 0x00, 0x08, 0xe0, 0x1f, 0x00,
+   0xf8, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00,
+   0x00, 0xfc, 0x07, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xf8, 0x03, 0x00,
+   0x00, 0xf0, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00,
+   0x00, 0xe0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00};
diff --git a/bitmaps/s-mot.xbm b/bitmaps/s-mot.xbm
new file mode 100644 (file)
index 0000000..11e43e7
--- /dev/null
@@ -0,0 +1,12 @@
+#define image_width 25
+#define image_height 25
+static unsigned char image_bits[] = {
+   0x1f, 0x00, 0xf0, 0x01, 0x0f, 0xfe, 0xe0, 0x01, 0x87, 0x01, 0xc3, 0x01,
+   0x63, 0x00, 0x8c, 0x01, 0x31, 0x01, 0x19, 0x01, 0x18, 0x01, 0x31, 0x00,
+   0x08, 0x83, 0x23, 0x00, 0x84, 0x83, 0x43, 0x00, 0x84, 0x83, 0x43, 0x00,
+   0x82, 0xc7, 0x83, 0x00, 0xc2, 0xc7, 0x87, 0x00, 0xc2, 0xc7, 0x87, 0x00,
+   0xc2, 0xef, 0x8f, 0x00, 0xc2, 0xee, 0x8e, 0x00, 0x62, 0x28, 0x88, 0x00,
+   0x22, 0x30, 0x88, 0x00, 0x24, 0x10, 0x58, 0x00, 0x14, 0x00, 0x50, 0x00,
+   0x18, 0x00, 0x30, 0x00, 0x18, 0x00, 0x30, 0x00, 0x31, 0x00, 0x18, 0x01,
+   0x63, 0x00, 0x8c, 0x01, 0x87, 0x01, 0xc3, 0x01, 0x0f, 0xfe, 0xe0, 0x01,
+   0x1f, 0x00, 0xf0, 0x01};
diff --git a/bitmaps/s-osf.xbm b/bitmaps/s-osf.xbm
new file mode 100644 (file)
index 0000000..c9c9f03
--- /dev/null
@@ -0,0 +1,13 @@
+#define image_width 50
+#define image_height 16
+static unsigned char image_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x01, 0x80, 0x03, 0x00, 0x07,
+   0x00, 0x02, 0x01, 0x80, 0x03, 0x00, 0x07, 0x00, 0x02, 0x01, 0x80, 0x03,
+   0x00, 0x07, 0x00, 0x02, 0xf1, 0x83, 0xe3, 0x03, 0xc7, 0x3f, 0x02, 0xf9,
+   0x87, 0xf3, 0x07, 0xc7, 0x1f, 0x02, 0x3d, 0x87, 0x33, 0x06, 0xe7, 0x00,
+   0x02, 0x1d, 0x8e, 0x73, 0x00, 0xe7, 0x00, 0x02, 0x0d, 0x8e, 0xf3, 0x01,
+   0xe7, 0x00, 0x02, 0x0f, 0x8f, 0xe3, 0x03, 0xe7, 0x0f, 0x02, 0x0f, 0x87,
+   0x83, 0x07, 0xf7, 0x07, 0x02, 0x8f, 0x87, 0x1f, 0x07, 0x77, 0x00, 0x02,
+   0xff, 0x83, 0xff, 0x07, 0x7f, 0x00, 0x02, 0xff, 0x81, 0xff, 0x03, 0x3f,
+   0x00, 0x02, 0xff, 0x80, 0xff, 0x00, 0x3f, 0x00, 0x02, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0x03};
diff --git a/bitmaps/s-sco.xbm b/bitmaps/s-sco.xbm
new file mode 100644 (file)
index 0000000..9e56780
--- /dev/null
@@ -0,0 +1,20 @@
+#define image_width 76
+#define image_height 25
+static unsigned char image_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x07,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x3f,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x07,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x3f,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0x1f,0xf0,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0xf0,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0xff,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,0x00,0xf0,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x78,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x03,0xf0,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x07,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0x03,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
diff --git a/bitmaps/s-sgi.xbm b/bitmaps/s-sgi.xbm
new file mode 100644 (file)
index 0000000..f9b8cd2
--- /dev/null
@@ -0,0 +1,14 @@
+#define image_width 32
+#define image_height 32
+static unsigned char image_bits[] = {
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0xf0, 0x1e, 0x00,
+  0x00, 0xfc, 0x7e, 0x00, 0x00, 0xff, 0xfe, 0x01, 0x80, 0xe7, 0xce, 0x03,
+  0xe0, 0xe3, 0x8e, 0x0f, 0xf0, 0xe0, 0x0e, 0x1e, 0xf0, 0xe0, 0x0e, 0x1e,
+  0xe0, 0xe3, 0x8e, 0x0f, 0x9c, 0xef, 0xee, 0x73, 0x3c, 0x1e, 0xf0, 0x78,
+  0xfe, 0xf8, 0x3f, 0xfe, 0xfe, 0xf3, 0x9f, 0xff, 0xce, 0xcf, 0xe7, 0xe7,
+  0x8e, 0x1f, 0xf0, 0xe3, 0x0e, 0x7e, 0xfc, 0xe0, 0x8e, 0xf9, 0x3e, 0xe3,
+  0xce, 0xe3, 0x8e, 0xe7, 0xfe, 0xe1, 0x0e, 0xff, 0x7e, 0xec, 0x6e, 0xfc,
+  0x1e, 0xef, 0xee, 0xf1, 0xc4, 0xef, 0xee, 0x47, 0xf0, 0xe3, 0x8e, 0x1f,
+  0xf0, 0xe0, 0x0e, 0x1e, 0xf8, 0xe0, 0x0e, 0x3e, 0xf0, 0xe3, 0x8e, 0x1f,
+  0xc0, 0xef, 0xee, 0x07, 0x00, 0xff, 0xfe, 0x01, 0x00, 0xfc, 0x7e, 0x00,
+  0x00, 0xf0, 0x1e, 0x00, 0x00, 0x40, 0x04, 0x00};
diff --git a/bitmaps/s-sun.xbm b/bitmaps/s-sun.xbm
new file mode 100644 (file)
index 0000000..2b0a295
--- /dev/null
@@ -0,0 +1,13 @@
+#define image_width 29
+#define image_height 29
+static unsigned char image_bits[] = {
+   0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0x74, 0x07, 0x00, 0x00, 0xee, 0x0e, 0x00, 0x00, 0xdd, 0x1d, 0x00,
+   0x80, 0xbb, 0x3b, 0x00, 0x40, 0x77, 0x57, 0x00, 0xe0, 0xee, 0xee, 0x00,
+   0x70, 0xdd, 0x75, 0x01, 0xb8, 0xbb, 0xb9, 0x03, 0xdc, 0xf1, 0xdd, 0x01,
+   0xee, 0xee, 0xee, 0x0e, 0x77, 0x1f, 0x77, 0x1f, 0xbb, 0x1b, 0xbb, 0x1b,
+   0xdf, 0x1d, 0xdf, 0x1d, 0xee, 0xee, 0xee, 0x0e, 0x70, 0xf7, 0x71, 0x07,
+   0xb8, 0xb3, 0xbb, 0x03, 0xd0, 0x75, 0xd7, 0x01, 0xe0, 0xee, 0xee, 0x00,
+   0x40, 0xdd, 0x5d, 0x00, 0x80, 0xbb, 0x3b, 0x00, 0x00, 0x77, 0x17, 0x00,
+   0x00, 0xee, 0x0e, 0x00, 0x00, 0xdc, 0x05, 0x00, 0x00, 0xb8, 0x01, 0x00,
+   0x00, 0xf0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00};
diff --git a/bitmaps/s-x11.xbm b/bitmaps/s-x11.xbm
new file mode 100644 (file)
index 0000000..7669c09
--- /dev/null
@@ -0,0 +1,6 @@
+#define image_width 16
+#define image_height 16
+static unsigned char image_bits[] = {
+   0x0f, 0x80, 0x1e, 0x80, 0x3c, 0x40, 0x78, 0x20, 0x78, 0x10, 0xf0, 0x08,
+   0xe0, 0x09, 0xc0, 0x05, 0xc0, 0x02, 0x40, 0x07, 0x20, 0x0f, 0x20, 0x1e,
+   0x10, 0x1e, 0x08, 0x3c, 0x04, 0x78, 0x02, 0xf0};
diff --git a/bitmaps/shark-0.xbm b/bitmaps/shark-0.xbm
new file mode 100644 (file)
index 0000000..fbfe999
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark0_width 20
+#define shark0_height 20
+static unsigned char shark0_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x80, 0x1f, 0x00,
+   0xc0, 0x3f, 0x00, 0x40, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00,
+   0x00, 0x06, 0x00, 0x00, 0x26, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x38, 0x00};
diff --git a/bitmaps/shark-1.xbm b/bitmaps/shark-1.xbm
new file mode 100644 (file)
index 0000000..d4d6027
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark1_width 20
+#define shark1_height 20
+static unsigned char shark1_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x18, 0x00,
+   0xc0, 0xff, 0x01, 0xfc, 0xff, 0x07, 0xfe, 0xff, 0x07, 0xc3, 0xff, 0x01,
+   0x01, 0x18, 0x00, 0x07, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/shark-2.xbm b/bitmaps/shark-2.xbm
new file mode 100644 (file)
index 0000000..6ab9dac
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark2_width 20
+#define shark2_height 20
+static unsigned char shark2_bits[] = {
+   0xc0, 0x01, 0x00, 0x60, 0x03, 0x00, 0x40, 0x06, 0x00, 0x00, 0x06, 0x00,
+   0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x2f, 0x00, 0xc0, 0x3f, 0x00,
+   0x80, 0x1f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/shark-3.xbm b/bitmaps/shark-3.xbm
new file mode 100644 (file)
index 0000000..b1db4dc
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark3_width 20
+#define shark3_height 20
+static unsigned char shark3_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x0e, 0x80, 0x01, 0x08,
+   0xf8, 0x3f, 0x0c, 0xfe, 0xff, 0x07, 0xfe, 0xff, 0x03, 0xf8, 0x3f, 0x00,
+   0x80, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/shark-4.xbm b/bitmaps/shark-4.xbm
new file mode 100644 (file)
index 0000000..ec181a0
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark4_width 20
+#define shark4_height 20
+static unsigned char shark4_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x80, 0x1f, 0x00,
+   0xc0, 0x3f, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00,
+   0x00, 0x06, 0x00, 0x40, 0x06, 0x00, 0x60, 0x03, 0x00, 0xc0, 0x01, 0x00};
diff --git a/bitmaps/shark-5.xbm b/bitmaps/shark-5.xbm
new file mode 100644 (file)
index 0000000..a31ab23
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark5_width 20
+#define shark5_height 20
+static unsigned char shark5_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x08, 0x00, 0x01, 0x18, 0x00,
+   0xc3, 0xff, 0x01, 0xfe, 0xff, 0x07, 0xfc, 0xff, 0x07, 0xc0, 0xff, 0x01,
+   0x00, 0x18, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/shark-6.xbm b/bitmaps/shark-6.xbm
new file mode 100644 (file)
index 0000000..09e0182
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark6_width 20
+#define shark6_height 20
+static unsigned char shark6_bits[] = {
+   0x00, 0x38, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x26, 0x00, 0x00, 0x06, 0x00,
+   0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x40, 0x0f, 0x00, 0xc0, 0x3f, 0x00,
+   0x80, 0x1f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/shark-7.xbm b/bitmaps/shark-7.xbm
new file mode 100644 (file)
index 0000000..b7c6821
--- /dev/null
@@ -0,0 +1,8 @@
+#define shark7_width 20
+#define shark7_height 20
+static unsigned char shark7_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x80, 0x01, 0x00,
+   0xf8, 0x3f, 0x00, 0xfe, 0xff, 0x03, 0xfe, 0xff, 0x07, 0xf8, 0x3f, 0x0c,
+   0x80, 0x01, 0x08, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmaps/sickle.xbm b/bitmaps/sickle.xbm
new file mode 100644 (file)
index 0000000..91d7b4b
--- /dev/null
@@ -0,0 +1,9 @@
+#define sickle_width 21
+#define sickle_height 21
+static unsigned char sickle_bits[] = {
+   0x00, 0x1e, 0x00, 0x00, 0x38, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc0, 0x00,
+   0xc0, 0x81, 0x01, 0xe0, 0x00, 0x03, 0xf0, 0x00, 0x03, 0xb8, 0x01, 0x07,
+   0x10, 0x03, 0x07, 0x00, 0x06, 0x07, 0x00, 0x0c, 0x07, 0x00, 0x18, 0x07,
+   0x00, 0x30, 0x07, 0x30, 0xe0, 0x03, 0x78, 0xc0, 0x03, 0xcc, 0xc0, 0x01,
+   0x86, 0xe3, 0x03, 0x07, 0x7f, 0x06, 0x07, 0x3c, 0x0c, 0x03, 0x00, 0x08,
+   0x00, 0x00, 0x00};
diff --git a/bitmaps/stipple.xbm b/bitmaps/stipple.xbm
new file mode 100644 (file)
index 0000000..2e5b941
--- /dev/null
@@ -0,0 +1,4 @@
+#define stipple_width 16
+#define stipple_height 4
+static unsigned char stipple_bits[] = {
+   0x55, 0x55, 0xee, 0xee, 0x55, 0x55, 0xba, 0xbb};
diff --git a/bitmaps/t-smilie.xbm b/bitmaps/t-smilie.xbm
new file mode 100644 (file)
index 0000000..7b8bd52
--- /dev/null
@@ -0,0 +1,4 @@
+#define image_width 8
+#define image_height 8
+static unsigned char image_bits[] = {
+   0x3c, 0x7e, 0xdb, 0xff, 0xdb, 0xe7, 0x7e, 0x3c};
diff --git a/bitmaps/t-x11.xbm b/bitmaps/t-x11.xbm
new file mode 100644 (file)
index 0000000..ef9bfda
--- /dev/null
@@ -0,0 +1,5 @@
+#define image_width 11
+#define image_height 11
+static unsigned char image_bits[] = {
+ 0x0f, 0x04, 0x0f, 0x02, 0x1e, 0x01, 0x3c, 0x01, 0xb8, 0x00, 0x58, 0x00,
+ 0xe8, 0x00, 0xe4, 0x01, 0xc4, 0x03, 0xc2, 0x03, 0x81, 0x07 };
diff --git a/bitmaps/terra-00.xbm b/bitmaps/terra-00.xbm
new file mode 100644 (file)
index 0000000..11e714a
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra00_width 64
+#define terra00_height 64
+#define terra00_x_hot 32
+#define terra00_y_hot 32
+static unsigned char terra00_bits[] = {
+0x00, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f,
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x01, 0xf8, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x20, 0x00, 0xdc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0xdc, 0xff, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0xd8, 0xff, 0x03, 0x00,
+0x00, 0xe0, 0x00, 0xe0, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x78, 0x00, 0x00,
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x1c, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00,
+0x00, 0x0e, 0x00, 0x80, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0x03, 0x00, 0xf0,
+0x21, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0xf0, 0x80, 0xfb, 0xff, 0x01,
+0x00, 0x00, 0x00, 0x60, 0x00, 0xf2, 0xff, 0x01, 0x40, 0x00, 0x00, 0xa0,
+0x1f, 0x80, 0xff, 0x03, 0x20, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0xff, 0x07,
+0x00, 0x00, 0x00, 0xf0, 0xff, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8,
+0xff, 0xff, 0xdf, 0x0f, 0x08, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3e, 0x1f,
+0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7d, 0x18, 0x00, 0x00, 0x00, 0xff,
+0xff, 0xff, 0xf9, 0x19, 0x04, 0x00, 0x80, 0xff, 0xff, 0xff, 0xfb, 0x31,
+0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf7, 0x21, 0x00, 0x00, 0x00, 0xff,
+0xff, 0xff, 0xe7, 0x21, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xef, 0x00,
+0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x7f, 0x40, 0x04, 0x00, 0x80, 0xff,
+0xff, 0xff, 0x1f, 0x40, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00,
+0x1e, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x1e, 0x00, 0x00, 0xfc,
+0xf8, 0xff, 0xff, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00,
+0x7e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x7f, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0x3f, 0x00, 0xff, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00,
+0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0xff, 0x0f, 0x00, 0x00,
+0xc0, 0xff, 0x0f, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00,
+0xfe, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0xfe, 0x1f, 0x00, 0x00,
+0x80, 0xff, 0x0f, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00,
+0xfc, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x8f, 0x00, 0xfc, 0x0f, 0x00, 0x00,
+0x80, 0xff, 0xcf, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x67, 0x00,
+0xf0, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x63, 0x00, 0xf0, 0x0f, 0x00, 0x00,
+0x80, 0xff, 0x21, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0xff, 0x21, 0x00,
+0xe0, 0x07, 0x00, 0x00, 0x00, 0xff, 0x11, 0x00, 0xe0, 0x03, 0x00, 0x00,
+0x00, 0x7f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
+0xc0, 0x03, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
+0x00, 0x1e, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-01.xbm b/bitmaps/terra-01.xbm
new file mode 100644 (file)
index 0000000..908fc45
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra01_width 64
+#define terra01_height 64
+#define terra01_x_hot 32
+#define terra01_y_hot 32
+static unsigned char terra01_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x07, 0xe0, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x86, 0x01, 0x60, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
+0xe0, 0xfe, 0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0xc6, 0xfc, 0x03, 0x00,
+0x00, 0xe0, 0x03, 0x00, 0xce, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x02, 0x00,
+0xf0, 0xff, 0x1f, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00,
+0x00, 0x3c, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x0f, 0x00, 0x00,
+0x3e, 0xf4, 0xff, 0x00, 0x80, 0x03, 0x00, 0x00, 0x1e, 0xa0, 0xff, 0x01,
+0x80, 0x01, 0x00, 0x00, 0x1c, 0x48, 0xff, 0x01, 0xc0, 0x00, 0x00, 0x00,
+0xf0, 0x03, 0xf0, 0x03, 0x60, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x07,
+0x20, 0x00, 0x00, 0x00, 0xfe, 0x9f, 0xfd, 0x07, 0x30, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0x0f, 0x38, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x19,
+0x38, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xdf, 0x13, 0x38, 0x00, 0x00, 0xc0,
+0xff, 0xff, 0xbf, 0x0f, 0x24, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x0f,
+0x40, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x0f, 0x02, 0x00, 0x00, 0xc0,
+0xff, 0xff, 0xff, 0x0e, 0x02, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0e,
+0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x07, 0x20, 0x00, 0x00, 0xc0,
+0xff, 0xff, 0xff, 0x03, 0xf0, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x0f,
+0xfc, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0x01, 0x00, 0x00,
+0x7e, 0xfe, 0xff, 0x0f, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07,
+0xf8, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0xfc, 0x0f, 0x00, 0x00,
+0x00, 0xf0, 0xff, 0x07, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03,
+0xfc, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0xfc, 0xff, 0x03, 0x00,
+0x00, 0xe0, 0xff, 0x01, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x01,
+0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xf8, 0xff, 0x07, 0x00,
+0x00, 0xc0, 0xff, 0x01, 0xf0, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x01,
+0xf0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0xf0, 0xff, 0x03, 0x00,
+0x00, 0xe0, 0xff, 0x04, 0xe0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x04,
+0xc0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0x7f, 0x02, 0x80, 0xff, 0x01, 0x00,
+0x00, 0xe0, 0x3f, 0x02, 0x80, 0xff, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x01,
+0x80, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x01, 0x00, 0x7f, 0x00, 0x00,
+0x00, 0xe0, 0x0f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00,
+0x00, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x3e, 0x00, 0x00,
+0x00, 0xc0, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xfe, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-02.xbm b/bitmaps/terra-02.xbm
new file mode 100644 (file)
index 0000000..2be7943
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra02_width 64
+#define terra02_height 64
+#define terra02_x_hot 32
+#define terra02_y_hot 32
+static unsigned char terra02_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf9,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3c, 0x80, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x08, 0x0c, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00,
+0x00, 0xf7, 0x00, 0x00, 0x00, 0xc0, 0x1e, 0x00, 0x60, 0xe4, 0x03, 0x00,
+0x00, 0xe0, 0x3f, 0x00, 0xa0, 0xfe, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00,
+0x00, 0xff, 0x1f, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xff, 0x3f, 0x00,
+0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00,
+0xc0, 0x07, 0xff, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x80, 0x03, 0xff, 0x01,
+0x80, 0x0f, 0x00, 0x00, 0x80, 0x03, 0xf4, 0x01, 0xc0, 0x07, 0x00, 0x00,
+0x00, 0x7d, 0xc0, 0x03, 0xe0, 0x03, 0x00, 0x00, 0x80, 0xff, 0x80, 0x07,
+0xe0, 0x01, 0x00, 0x00, 0x80, 0xff, 0xfb, 0x07, 0x30, 0x00, 0x00, 0x00,
+0xc0, 0xff, 0xff, 0x0f, 0x18, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1e,
+0x08, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x08, 0x00, 0x00, 0x00,
+0xf0, 0xff, 0xff, 0x1f, 0x04, 0x01, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f,
+0x14, 0x02, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x37, 0x0c, 0x00, 0x00, 0x00,
+0xf0, 0xff, 0xff, 0x37, 0x18, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x2f,
+0x18, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x10, 0x03, 0x00, 0x00,
+0xf0, 0xff, 0xff, 0x1f, 0x90, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f,
+0xc0, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x80, 0x7f, 0x00, 0x00,
+0x80, 0x9f, 0xff, 0x3f, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x3f,
+0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xc0, 0xff, 0x03, 0x00,
+0x00, 0x00, 0xfc, 0x3f, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfc, 0x1f,
+0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xe0, 0xff, 0xff, 0x00,
+0x00, 0x00, 0xf8, 0x1f, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x0f,
+0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x0f, 0xc0, 0xff, 0xff, 0x01,
+0x00, 0x00, 0xf8, 0x0f, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x0f,
+0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0xff, 0xff, 0x00,
+0x00, 0x00, 0xfc, 0x2f, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x07,
+0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x13, 0x00, 0xfc, 0x7f, 0x00,
+0x00, 0x00, 0xf8, 0x01, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0x09,
+0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xf8, 0x0f, 0x00,
+0x00, 0x00, 0xfc, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x7c, 0x00,
+0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x00,
+0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xf8, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x90, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-03.xbm b/bitmaps/terra-03.xbm
new file mode 100644 (file)
index 0000000..13e7fd8
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra03_width 64
+#define terra03_height 64
+#define terra03_x_hot 32
+#define terra03_y_hot 32
+static unsigned char terra03_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe3,
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x00, 0x0e, 0x00, 0x00,
+0x00, 0x00, 0x2e, 0x70, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00,
+0x00, 0xd8, 0x00, 0x00, 0x00, 0xc0, 0xf3, 0x01, 0x00, 0xa2, 0x03, 0x00,
+0x00, 0xe0, 0xff, 0x01, 0x00, 0xec, 0x07, 0x00, 0x00, 0xf8, 0x3f, 0x01,
+0x00, 0xf0, 0x1f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xf0, 0x3f, 0x00,
+0x00, 0xfe, 0x0f, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xff, 0x03, 0x00,
+0x00, 0x78, 0xf8, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x78, 0xe8, 0x01,
+0xc0, 0xff, 0x00, 0x00, 0x00, 0x30, 0xe8, 0x01, 0xc0, 0x7f, 0x00, 0x00,
+0x00, 0xe0, 0x07, 0x03, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x06,
+0xe0, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0xe0, 0x08, 0x00, 0x00,
+0x00, 0xf0, 0xff, 0x0f, 0x70, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f,
+0x30, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x30, 0x00, 0x00, 0x00,
+0x00, 0xfc, 0xff, 0x1f, 0x30, 0x11, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f,
+0xb0, 0x40, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0xf0, 0x00, 0x00, 0x00,
+0x00, 0xf8, 0xff, 0x3f, 0xc0, 0x01, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f,
+0x80, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x61, 0x00, 0x00,
+0x00, 0xf8, 0xff, 0x7f, 0x00, 0xf1, 0x03, 0x00, 0x00, 0xf0, 0xff, 0x7f,
+0x00, 0xfa, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0xf8, 0x0f, 0x00,
+0x00, 0xc0, 0xe7, 0xff, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff,
+0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x00,
+0x00, 0x00, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x80, 0x7f,
+0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0xfe, 0xff, 0x7f,
+0x00, 0x00, 0x00, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x7f,
+0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0x00, 0xf8, 0xff, 0xff,
+0x00, 0x00, 0x00, 0x3f, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x3f,
+0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xf0, 0xff, 0x3f,
+0x00, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x3f,
+0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x80, 0xff, 0x3f,
+0x00, 0x00, 0x80, 0x0f, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x0f,
+0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xff, 0x03,
+0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x80, 0x03,
+0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xff, 0x00,
+0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xe0, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x30, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-04.xbm b/bitmaps/terra-04.xbm
new file mode 100644 (file)
index 0000000..373b059
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra04_width 64
+#define terra04_height 64
+#define terra04_x_hot 32
+#define terra04_y_hot 32
+static unsigned char terra04_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8f,
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x9d, 0x07, 0x08, 0x00, 0x00,
+0x00, 0x00, 0x3e, 0x81, 0x03, 0x70, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0b,
+0x00, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x9f, 0x0f, 0x00, 0x90, 0x02, 0x00,
+0x00, 0xe0, 0xdf, 0x1f, 0x00, 0x70, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x31,
+0x00, 0x80, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x3f, 0x00,
+0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0xfe, 0x7f, 0x00,
+0x00, 0x80, 0xf3, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc3, 0x01,
+0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x02, 0x01, 0x80, 0xff, 0x07, 0x00,
+0x00, 0x00, 0x38, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x7e, 0x00,
+0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x07, 0xc0, 0x07, 0x01, 0x00,
+0x00, 0x00, 0xfe, 0x0f, 0xc0, 0x03, 0x01, 0x00, 0x00, 0x00, 0xff, 0x1f,
+0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x80, 0x01, 0x00, 0x00,
+0x00, 0x00, 0xff, 0x1f, 0x80, 0x11, 0x02, 0x00, 0x00, 0x00, 0xff, 0x3f,
+0x80, 0x1b, 0x18, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x80, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f,
+0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x10, 0x08, 0x00,
+0x00, 0x00, 0xfe, 0x7f, 0x00, 0x20, 0xfe, 0x01, 0x00, 0x00, 0xfc, 0x7f,
+0x00, 0x40, 0xff, 0x03, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xff, 0x07,
+0x00, 0x00, 0xf8, 0xfe, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xfc,
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0x7f,
+0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8,
+0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff,
+0x3f, 0x00, 0x00, 0xf0, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0,
+0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xff, 0xff,
+0x7f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00, 0x70,
+0x00, 0x00, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0xfc, 0xff,
+0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x38,
+0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x38, 0x00, 0x00, 0xe0, 0xff,
+0x0f, 0x00, 0x00, 0x38, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x1c,
+0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0xff,
+0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x0c,
+0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xe0, 0x3f,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x80, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x70, 0x1e, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-05.xbm b/bitmaps/terra-05.xbm
new file mode 100644 (file)
index 0000000..2a058a6
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra05_width 64
+#define terra05_height 64
+#define terra05_x_hot 32
+#define terra05_y_hot 32
+static unsigned char terra05_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f,
+0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x67, 0x3c, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x00, 0x0c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x78,
+0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf8, 0x00, 0x40, 0x02, 0x00,
+0x00, 0xc0, 0xff, 0xfd, 0x01, 0x80, 0x06, 0x00, 0x00, 0xe0, 0xff, 0x7f,
+0x02, 0x00, 0x1e, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x3c, 0x00,
+0x00, 0xf8, 0xff, 0x2f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xf8, 0xff, 0x07,
+0x00, 0x00, 0xdc, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x38, 0x01,
+0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x30, 0x01, 0x00, 0xfe, 0xff, 0x00,
+0x00, 0x00, 0xc0, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x03,
+0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x7c, 0x20, 0x00,
+0x00, 0x00, 0xe0, 0x0f, 0x00, 0x3c, 0x20, 0x00, 0x00, 0x00, 0xe0, 0x1f,
+0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x38, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0x1f, 0x00, 0x38, 0xc2, 0x00, 0x00, 0x00, 0xe0, 0x3f,
+0x00, 0x38, 0x03, 0x06, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0xf0, 0x01, 0x00,
+0x00, 0x00, 0xe0, 0x3f, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0xe0, 0x7f,
+0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x04, 0x02,
+0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x88, 0x7f, 0x00, 0x00, 0x80, 0x7f,
+0x00, 0x00, 0xd0, 0xff, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x80, 0xff,
+0x03, 0x00, 0x00, 0xef, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0xe0,
+0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff,
+0x1f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0xc0,
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff,
+0xff, 0x0f, 0x00, 0x80, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x80,
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+0xff, 0x1f, 0x00, 0x40, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x40,
+0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff,
+0xff, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x20,
+0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8,
+0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8,
+0x1f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x08,
+0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x19, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-06.xbm b/bitmaps/terra-06.xbm
new file mode 100644 (file)
index 0000000..be610e5
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra06_width 64
+#define terra06_height 64
+#define terra06_x_hot 32
+#define terra06_y_hot 32
+static unsigned char terra06_bits[] = {
+0x00, 0x00, 0x00, 0x60, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x9f, 0xf3, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x07, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc3,
+0x05, 0x80, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc7, 0x0f, 0x00, 0x02, 0x00,
+0x00, 0x80, 0xff, 0xdf, 0x1f, 0x00, 0x06, 0x00, 0x00, 0x80, 0xff, 0xff,
+0x07, 0x00, 0x18, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x30, 0x00,
+0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x40, 0x00, 0x00, 0xe0, 0xff, 0xff,
+0x00, 0x00, 0xe0, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0x00,
+0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf0, 0xff, 0x3f,
+0x00, 0x00, 0x00, 0x03, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x07,
+0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0xc0, 0x1f, 0x08,
+0x00, 0x00, 0x00, 0x0e, 0x00, 0xc0, 0x0f, 0x08, 0x00, 0x00, 0x00, 0x1e,
+0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x80, 0x07, 0x00,
+0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x87, 0x20, 0x00, 0x00, 0x00, 0x3e,
+0x00, 0x00, 0xcf, 0x00, 0x03, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7e, 0x00,
+0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x7c,
+0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x81,
+0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xc2, 0x3f, 0x00, 0x00, 0x78,
+0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xe0,
+0xff, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x80,
+0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x07, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0,
+0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00,
+0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-07.xbm b/bitmaps/terra-07.xbm
new file mode 100644 (file)
index 0000000..6bfcc08
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra07_width 64
+#define terra07_height 64
+#define terra07_x_hot 32
+#define terra07_y_hot 32
+static unsigned char terra07_bits[] = {
+0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4,
+0xe1, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xcc, 0x03, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x3f, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x1f,
+0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x7c, 0x00, 0x02, 0x00,
+0x00, 0x00, 0xfc, 0xff, 0xfd, 0x01, 0x08, 0x00, 0x00, 0x00, 0xfc, 0xff,
+0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+0x1f, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x01,
+0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x04,
+0x00, 0x00, 0xfe, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03,
+0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x18,
+0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xe0, 0x01,
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xe0, 0x21, 0x08, 0x00, 0x00, 0x30,
+0x00, 0x00, 0xe0, 0x33, 0xe0, 0x00, 0x00, 0x30, 0x00, 0x00, 0x80, 0x3f,
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x60,
+0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80,
+0x40, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0xe1, 0x0f, 0x00, 0x40,
+0x00, 0x00, 0x00, 0x00, 0xfa, 0x1f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
+0xf0, 0x3f, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-08.xbm b/bitmaps/terra-08.xbm
new file mode 100644 (file)
index 0000000..023f485
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra08_width 64
+#define terra08_height 64
+#define terra08_x_hot 32
+#define terra08_y_hot 32
+static unsigned char terra08_bits[] = {
+0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90,
+0x83, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x33, 0x06, 0x00, 0x00,
+0x00, 0x00, 0xfc, 0xff, 0x61, 0x08, 0x00, 0x00, 0x00, 0x00, 0xe2, 0xff,
+0xe1, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xc7, 0x03, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+0xff, 0x2f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7e, 0x80, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x02, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x40,
+0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf8, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-09.xbm b/bitmaps/terra-09.xbm
new file mode 100644 (file)
index 0000000..046a7ae
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra09_width 64
+#define terra09_height 64
+#define terra09_x_hot 32
+#define terra09_y_hot 32
+static unsigned char terra09_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x9f, 0x0c, 0x00, 0x00,
+0x00, 0x00, 0xf8, 0xff, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff,
+0x0f, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x1e, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x01, 0x00,
+0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0x3f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x1f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x86, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x7e, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-10.xbm b/bitmaps/terra-10.xbm
new file mode 100644 (file)
index 0000000..89fee81
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra10_width 64
+#define terra10_height 64
+#define terra10_x_hot 32
+#define terra10_y_hot 32
+static unsigned char terra10_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xff, 0xff, 0x04, 0x00, 0x00,
+0x00, 0x00, 0xc6, 0xff, 0x7f, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x60, 0xf8,
+0x7f, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x73, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf0, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x07, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xd0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x10, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x07,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-11.xbm b/bitmaps/terra-11.xbm
new file mode 100644 (file)
index 0000000..353faef
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra11_width 64
+#define terra11_height 64
+#define terra11_x_hot 32
+#define terra11_y_hot 32
+static unsigned char terra11_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0xff, 0x0b, 0x00, 0x00,
+0x00, 0x00, 0x0e, 0xff, 0xff, 0x33, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc3,
+0xff, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xdf, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfd, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x40, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x13, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x20, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
+0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x10, 0x00, 0x00,
+0x00, 0x00, 0x60, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00,
+0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-12.xbm b/bitmaps/terra-12.xbm
new file mode 100644 (file)
index 0000000..af1faff
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra12_width 64
+#define terra12_height 64
+#define terra12_x_hot 32
+#define terra12_y_hot 32
+static unsigned char terra12_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfb, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x3e, 0xf8, 0xff, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38,
+0xfc, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf8, 0x7f, 0x03, 0x00,
+0x00, 0x20, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x08, 0x00, 0x00,
+0xc0, 0xff, 0x1f, 0x00, 0x00, 0x04, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00,
+0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x40, 0x00, 0x00, 0x00,
+0x00, 0xfc, 0xff, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x20, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x01, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00,
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-13.xbm b/bitmaps/terra-13.xbm
new file mode 100644 (file)
index 0000000..f9b0f9e
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra13_width 64
+#define terra13_height 64
+#define terra13_x_hot 32
+#define terra13_y_hot 32
+static unsigned char terra13_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
+0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xcf, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xc1, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80,
+0xe1, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0x0c, 0x00, 0x80, 0xff, 0x03, 0x00,
+0x00, 0x60, 0x02, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x38, 0x00, 0x00,
+0x00, 0xfc, 0x1f, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00,
+0x00, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xc0, 0x01, 0x00, 0x00,
+0x00, 0x80, 0xff, 0x03, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1c, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-14.xbm b/bitmaps/terra-14.xbm
new file mode 100644 (file)
index 0000000..1debfc8
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra14_width 64
+#define terra14_height 64
+#define terra14_x_hot 32
+#define terra14_y_hot 32
+static unsigned char terra14_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
+0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x0f, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00,
+0x1c, 0xfe, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x00, 0x00, 0xfc, 0x03, 0x00,
+0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xf8, 0x01, 0x00,
+0x00, 0xc0, 0x1f, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00,
+0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x07, 0x00, 0x00,
+0x00, 0x00, 0xff, 0x00, 0x80, 0x13, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01,
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x40, 0x05, 0x00, 0x00,
+0x00, 0x00, 0xf8, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07,
+0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x30, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x07, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
+0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3e, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x10, 0x1e, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-15.xbm b/bitmaps/terra-15.xbm
new file mode 100644 (file)
index 0000000..749b96d
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra15_width 64
+#define terra15_height 64
+#define terra15_x_hot 32
+#define terra15_y_hot 32
+static unsigned char terra15_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05,
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xf9, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0x7f, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x04,
+0xc0, 0xf8, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x06, 0x00, 0xe0, 0x03, 0x00,
+0x00, 0xe0, 0x0f, 0x01, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00,
+0x00, 0x00, 0x1e, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x3c, 0x00,
+0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3f, 0x00, 0x00,
+0x00, 0x00, 0xf0, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01,
+0x80, 0x8b, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x41, 0x00, 0x00,
+0x00, 0x00, 0xc0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
+0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0e, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x06, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x16, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x3c, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x27, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x07, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x70, 0x1c, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-16.xbm b/bitmaps/terra-16.xbm
new file mode 100644 (file)
index 0000000..941aa93
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra16_width 64
+#define terra16_height 64
+#define terra16_x_hot 32
+#define terra16_y_hot 32
+static unsigned char terra16_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1b,
+0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xef, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0x83, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x61,
+0x00, 0xe6, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x30, 0x00, 0x00, 0x03, 0x00,
+0x00, 0xe0, 0xff, 0x10, 0x00, 0x00, 0x06, 0x00, 0x00, 0xf8, 0x7f, 0x00,
+0x00, 0x00, 0x18, 0x00, 0x00, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0x30, 0x00,
+0x00, 0xfe, 0x4f, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xff, 0x01, 0x00,
+0x00, 0x00, 0xc0, 0x00, 0x80, 0xbf, 0x10, 0x00, 0x00, 0x00, 0x80, 0x01,
+0x80, 0x9f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x0f, 0x06, 0x00,
+0x00, 0x00, 0x00, 0x02, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x08, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x68, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x40, 0x04, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0c, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xfe, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xf0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x18, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-17.xbm b/bitmaps/terra-17.xbm
new file mode 100644 (file)
index 0000000..c87f824
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra17_width 64
+#define terra17_height 64
+#define terra17_x_hot 32
+#define terra17_y_hot 32
+static unsigned char terra17_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0x1f, 0x7e, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f,
+0x06, 0x90, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x03, 0x10, 0x02, 0x00,
+0x00, 0xe0, 0xff, 0x07, 0x01, 0x00, 0x04, 0x00, 0x00, 0xf8, 0xff, 0x03,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x80, 0xff, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x81, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x41, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xc2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x20, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0e, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x40, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x40, 0x26, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0xe0, 0x03,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x87, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x03,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0x3f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xc0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-18.xbm b/bitmaps/terra-18.xbm
new file mode 100644 (file)
index 0000000..e06a34d
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra18_width 64
+#define terra18_height 64
+#define terra18_x_hot 32
+#define terra18_y_hot 32
+static unsigned char terra18_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0e, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x78, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f,
+0x30, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x30, 0x00, 0x00, 0x00,
+0x00, 0xe0, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xbf, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x43,
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x41, 0x00, 0x00, 0x00, 0x00,
+0x80, 0xff, 0x1f, 0x61, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x11,
+0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x04, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x70, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x38, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1e, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x08, 0x3c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x38, 0x30, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x08, 0x02, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x22, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x86, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xcc, 0x09, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xf0,
+0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x40, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x8f,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdf, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
+0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xf8,
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xc0, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-19.xbm b/bitmaps/terra-19.xbm
new file mode 100644 (file)
index 0000000..bb73741
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra19_width 64
+#define terra19_height 64
+#define terra19_x_hot 32
+#define terra19_y_hot 32
+static unsigned char terra19_bits[] = {
+0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f,
+0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x67, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+0x07, 0x81, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x83, 0x01, 0x00, 0x00,
+0x00, 0xe0, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0xff, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f,
+0x08, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x23, 0x00, 0x00, 0x00, 0x00,
+0x80, 0xff, 0xff, 0x63, 0x08, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03,
+0x06, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07,
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
+0xe8, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xff, 0x7f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc4, 0xe7, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xc4, 0xe3, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xe1, 0x07, 0x04,
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x40, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0e, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x08,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x02, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x73, 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06,
+0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e,
+0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-20.xbm b/bitmaps/terra-20.xbm
new file mode 100644 (file)
index 0000000..04ad565
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra20_width 64
+#define terra20_height 64
+#define terra20_x_hot 32
+#define terra20_y_hot 32
+static unsigned char terra20_bits[] = {
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+0x3f, 0x08, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x08, 0x02, 0x00,
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+0x7f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+0x0f, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x0d, 0x00, 0x00, 0x00,
+0x80, 0xff, 0xff, 0xff, 0x08, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
+0x88, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x20, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
+0x01, 0x00, 0x00, 0x00, 0xd8, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
+0x38, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x38, 0xfe, 0xff, 0x1f,
+0x01, 0x00, 0x00, 0x00, 0x3c, 0xfe, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x1c, 0x7c, 0xf8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3c, 0xf8, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x06, 0x0c, 0xe0, 0x03, 0x01, 0x00, 0x00, 0x00,
+0x02, 0x0c, 0xe0, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x03,
+0x04, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x03, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x20, 0x40,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x68, 0x60, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x50, 0x70, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x60, 0x7c,
+0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x60, 0x3c, 0xc0, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xc0, 0x38, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
+0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1b, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0xff, 0x3f, 0x00, 0x00, 0x08, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0x83, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-21.xbm b/bitmaps/terra-21.xbm
new file mode 100644 (file)
index 0000000..6058d45
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra21_width 64
+#define terra21_height 64
+#define terra21_x_hot 32
+#define terra21_y_hot 32
+static unsigned char terra21_bits[] = {
+0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
+0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+0xff, 0x21, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x61, 0x00, 0x00,
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x47, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
+0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+0xff, 0x21, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x9f, 0x21, 0x00, 0x00,
+0xc0, 0xff, 0xff, 0xff, 0x1f, 0x21, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
+0x1f, 0x30, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x04, 0x00, 0x00,
+0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0xff, 0xff,
+0x7f, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
+0xf8, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe8, 0xe3, 0xff, 0xff,
+0x0f, 0x00, 0x00, 0x00, 0xfc, 0xc1, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xf4, 0x81, 0x0f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x76, 0x80, 0x07, 0xfe,
+0x00, 0x00, 0x00, 0x00, 0x36, 0x80, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00,
+0x1e, 0x80, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x01, 0xe0,
+0x00, 0x00, 0x00, 0x00, 0x1e, 0x80, 0x01, 0x40, 0x00, 0x03, 0x00, 0x00,
+0x1f, 0x00, 0x02, 0x08, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x10,
+0x10, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x16, 0x38, 0x00, 0x00, 0x00,
+0x0f, 0x00, 0x00, 0x2c, 0x1c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x18,
+0x3e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x30, 0x1e, 0x20, 0x00, 0x00,
+0x03, 0x00, 0x00, 0x70, 0xdc, 0xa0, 0x01, 0x00, 0x03, 0x00, 0x00, 0x60,
+0x00, 0x80, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x06, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
+0x00, 0x7e, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0xff, 0x06, 0x00,
+0x24, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x24, 0x00, 0x00, 0x00,
+0xe0, 0xff, 0x0f, 0x00, 0x28, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00,
+0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x08, 0x00, 0x00, 0x00,
+0xf8, 0xff, 0x0f, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf0, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x90,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-22.xbm b/bitmaps/terra-22.xbm
new file mode 100644 (file)
index 0000000..94bdaa6
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra22_width 64
+#define terra22_height 64
+#define terra22_x_hot 32
+#define terra22_y_hot 32
+static unsigned char terra22_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce,
+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+0xff, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x8f, 0x01, 0x00,
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+0xff, 0x7f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
+0x00, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xff,
+0xff, 0x3f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x13, 0x02, 0x00,
+0x80, 0xff, 0xff, 0xff, 0xff, 0x23, 0x02, 0x00, 0x00, 0xfe, 0xff, 0xff,
+0xff, 0x27, 0x03, 0x00, 0x20, 0xfe, 0xff, 0xff, 0xff, 0x87, 0x00, 0x00,
+0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xf7, 0xff, 0xff,
+0xff, 0x0f, 0x00, 0x00, 0xf8, 0xe7, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0xb8, 0x0f, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0xb8, 0x3f, 0xfc, 0xff,
+0xff, 0x03, 0x00, 0x00, 0xbc, 0x3f, 0xf0, 0xc7, 0xbf, 0x00, 0x00, 0x00,
+0xbc, 0x1f, 0xf0, 0x83, 0x9f, 0x00, 0x00, 0x00, 0xbe, 0x0f, 0xf0, 0x81,
+0x3f, 0x00, 0x00, 0x00, 0xbe, 0x03, 0xf0, 0x00, 0x7e, 0x00, 0x00, 0x00,
+0xfe, 0x00, 0x60, 0x00, 0x7e, 0x20, 0x00, 0x00, 0x7e, 0x00, 0x60, 0x00,
+0x70, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x60, 0x00, 0x20, 0xc0, 0x00, 0x00,
+0xff, 0x01, 0x80, 0x00, 0x02, 0xc0, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
+0x04, 0x88, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x09, 0x0c, 0x00, 0x00,
+0xff, 0x00, 0x00, 0x00, 0x0a, 0x0e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00,
+0x8c, 0x0f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x1c, 0x0f, 0x08, 0x00,
+0x1f, 0x00, 0x00, 0x00, 0x38, 0x27, 0x78, 0x00, 0x1f, 0x00, 0x00, 0x00,
+0x10, 0x20, 0xe0, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
+0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x3e, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x3e, 0x03, 0x00, 0x00,
+0x00, 0x80, 0x4f, 0x00, 0x3e, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00,
+0x3c, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x3c, 0x02, 0x00, 0x00,
+0x00, 0xf8, 0xff, 0x00, 0x38, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00,
+0x38, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x30, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0xff, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00,
+0x60, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x40, 0x00, 0x00, 0x00,
+0x00, 0x1e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-23.xbm b/bitmaps/terra-23.xbm
new file mode 100644 (file)
index 0000000..0d025ff
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra23_width 64
+#define terra23_height 64
+#define terra23_x_hot 32
+#define terra23_y_hot 32
+static unsigned char terra23_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88,
+0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+0xff, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00,
+0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff,
+0xff, 0xff, 0x03, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
+0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff, 0xff,
+0xff, 0xff, 0x01, 0x00, 0x00, 0xfa, 0xff, 0xff, 0xff, 0xbf, 0x01, 0x00,
+0x40, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x40, 0xe0, 0xff, 0xff,
+0xff, 0x7f, 0x30, 0x00, 0x20, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x08, 0x00,
+0xe0, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf0, 0x7f, 0xfe, 0xff,
+0xff, 0xff, 0x01, 0x00, 0xf8, 0xff, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00,
+0xf8, 0xfb, 0x84, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0xfb, 0x0f, 0xff,
+0xff, 0x7f, 0x00, 0x00, 0xfc, 0xfb, 0x07, 0xfc, 0xf3, 0x2f, 0x00, 0x00,
+0xfc, 0xf3, 0x03, 0xfc, 0xe1, 0x27, 0x00, 0x00, 0xfe, 0xf3, 0x01, 0x7c,
+0xc0, 0x0f, 0x04, 0x00, 0xfe, 0x73, 0x00, 0x38, 0x00, 0x1f, 0x04, 0x00,
+0xfe, 0x1f, 0x00, 0x38, 0x00, 0x1f, 0x08, 0x00, 0xfe, 0x07, 0x00, 0x38,
+0x00, 0x1c, 0x10, 0x00, 0xfe, 0x7f, 0x00, 0x10, 0x00, 0x08, 0x10, 0x00,
+0xff, 0x3f, 0x00, 0x40, 0x00, 0x01, 0x10, 0x00, 0xff, 0x3f, 0x00, 0x00,
+0x00, 0x02, 0x02, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x80, 0x02, 0x03, 0x00,
+0xfe, 0x0f, 0x00, 0x00, 0x00, 0x87, 0x03, 0x00, 0xfe, 0x07, 0x00, 0x00,
+0x00, 0xc7, 0x13, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x03, 0x00,
+0xfe, 0x03, 0x00, 0x00, 0x00, 0xcc, 0x09, 0x07, 0xfc, 0x01, 0x00, 0x00,
+0x00, 0x0c, 0x08, 0x0e, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0xfc, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x10, 0x10, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xf8, 0x63, 0x00, 0x00,
+0x00, 0x00, 0xf0, 0x05, 0xf8, 0x33, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07,
+0xf8, 0x21, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x21, 0x00, 0x00,
+0x00, 0x00, 0xff, 0x07, 0xf0, 0x23, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07,
+0xe0, 0x23, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0xe0, 0x03, 0x00, 0x00,
+0x00, 0xc0, 0xff, 0x07, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03,
+0x80, 0x03, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x80, 0x03, 0x00, 0x00,
+0x00, 0xc0, 0xe3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-24.xbm b/bitmaps/terra-24.xbm
new file mode 100644 (file)
index 0000000..a0e3646
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra24_width 64
+#define terra24_height 64
+#define terra24_x_hot 32
+#define terra24_y_hot 32
+static unsigned char terra24_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
+0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0xff,
+0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00,
+0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xe8, 0xff, 0xff,
+0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x00,
+0x00, 0xd4, 0xff, 0xff, 0xff, 0xff, 0x87, 0x00, 0xc0, 0x01, 0xff, 0xff,
+0xff, 0xff, 0xa7, 0x00, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x00,
+0xe0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0xdf, 0xff,
+0xff, 0xff, 0x1f, 0x00, 0xf8, 0xbf, 0x1f, 0xff, 0xff, 0xff, 0x1f, 0x00,
+0xf8, 0x3f, 0xbf, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0xf8, 0x7f, 0xff, 0xc1,
+0xff, 0xff, 0x0f, 0x00, 0xfc, 0x7f, 0xff, 0x01, 0xff, 0xfc, 0x01, 0x00,
+0xfc, 0x7f, 0xfe, 0x00, 0x7e, 0xf8, 0x05, 0x00, 0xfe, 0x7f, 0x7e, 0x00,
+0x3e, 0xf0, 0x03, 0x00, 0xfe, 0xff, 0x1e, 0x00, 0x1e, 0xc0, 0x03, 0x00,
+0xfe, 0xff, 0x03, 0x00, 0x0c, 0xc0, 0x07, 0x00, 0xfe, 0xff, 0x01, 0x00,
+0x0c, 0x00, 0x07, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x0c, 0x00, 0x02, 0x00,
+0xff, 0xff, 0x0f, 0x00, 0x00, 0x40, 0x00, 0x02, 0xff, 0xff, 0x07, 0x00,
+0x00, 0x80, 0x40, 0x02, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x20, 0x60, 0x00,
+0xf0, 0xff, 0x03, 0x00, 0x00, 0x40, 0x61, 0x00, 0xf0, 0xff, 0x01, 0x00,
+0x00, 0x80, 0x71, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x80, 0x71, 0x00,
+0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x33, 0x30, 0xf0, 0x7f, 0x00, 0x00,
+0x00, 0x00, 0x02, 0x20, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x20, 0x62, 0xe0, 0x7f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0x7f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0xe0, 0xff, 0x08, 0x00,
+0x00, 0x00, 0x00, 0x0e, 0xc0, 0x7f, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x1f,
+0xc0, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xc0, 0x3f, 0x0c, 0x00,
+0x00, 0x00, 0xe0, 0x1f, 0x80, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0xf0, 0x1f,
+0x00, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x3f, 0x00, 0x00,
+0x00, 0x00, 0xf8, 0x0f, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f,
+0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x1c, 0x00, 0x00,
+0x00, 0x00, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-25.xbm b/bitmaps/terra-25.xbm
new file mode 100644 (file)
index 0000000..30fb7de
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra25_width 64
+#define terra25_height 64
+#define terra25_x_hot 32
+#define terra25_y_hot 32
+static unsigned char terra25_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xff,
+0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xf4, 0xff, 0xff, 0xff, 0x03, 0x00,
+0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0xff,
+0xff, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
+0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x4c, 0xff, 0xff,
+0xff, 0xff, 0x3f, 0x00, 0x00, 0x06, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x00,
+0x00, 0x03, 0xfd, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x0f, 0xe0, 0xff,
+0xff, 0xff, 0x7f, 0x02, 0x80, 0x0f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x02,
+0xc0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xf3,
+0xff, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xf7, 0xc7, 0xff, 0xff, 0xff, 0x01,
+0xf0, 0xff, 0xef, 0x2f, 0xf8, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xef, 0xff,
+0xf0, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xcf, 0x7f, 0xc0, 0x3f, 0x3f, 0x00,
+0xf8, 0xff, 0xcf, 0x7f, 0x80, 0x1f, 0x3e, 0x00, 0xfc, 0xff, 0x9f, 0x1f,
+0x80, 0x0f, 0x7c, 0x00, 0xfc, 0xff, 0x9f, 0x07, 0x80, 0x07, 0x78, 0x00,
+0xfc, 0xff, 0xff, 0x01, 0x00, 0x07, 0x78, 0x08, 0xfc, 0xff, 0x7f, 0x00,
+0x00, 0x07, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x02, 0x40, 0x10,
+0xfc, 0xff, 0xff, 0x03, 0x00, 0x08, 0x10, 0x10, 0xdc, 0xff, 0xff, 0x03,
+0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x28, 0x04,
+0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x30, 0x06, 0x80, 0xff, 0x7f, 0x00,
+0x00, 0x00, 0x30, 0x07, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x20, 0x46,
+0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xc6, 0x00, 0xff, 0x1f, 0x00,
+0x00, 0x00, 0x40, 0x80, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80,
+0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xfe, 0x1f, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xfe, 0x1f, 0x06,
+0x00, 0x00, 0x00, 0x70, 0x00, 0xfe, 0x1f, 0x03, 0x00, 0x00, 0x00, 0x38,
+0x00, 0xfc, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0xfc, 0x07, 0x03,
+0x00, 0x00, 0x00, 0x3e, 0x00, 0xf8, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1f,
+0x00, 0xf8, 0x07, 0x01, 0x00, 0x00, 0x00, 0x1f, 0x00, 0xf0, 0x07, 0x00,
+0x00, 0x00, 0x80, 0x1f, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x80, 0x0f,
+0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0xc0, 0x03, 0x00,
+0x00, 0x00, 0xc0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x80, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-26.xbm b/bitmaps/terra-26.xbm
new file mode 100644 (file)
index 0000000..4f398cb
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra26_width 64
+#define terra26_height 64
+#define terra26_x_hot 32
+#define terra26_y_hot 32
+static unsigned char terra26_bits[] = {
+0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfe,
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x32, 0xff, 0xff, 0xff, 0x03, 0x00,
+0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff,
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
+0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x70, 0xf4, 0xff,
+0xff, 0xff, 0xff, 0x00, 0x00, 0x38, 0xb1, 0xff, 0xff, 0xff, 0xff, 0x01,
+0x00, 0x18, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0x00, 0xfc,
+0xff, 0xff, 0xff, 0x01, 0x00, 0xfc, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x03,
+0x00, 0xfe, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0xff,
+0xfe, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0xfd, 0xf1, 0xff, 0xff, 0x07,
+0xc0, 0xff, 0xff, 0xf9, 0x0b, 0xfe, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0xfb,
+0x3f, 0xfc, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xf3, 0x3f, 0xf0, 0xe7, 0x03,
+0xe0, 0xff, 0xff, 0xf3, 0x1f, 0xe0, 0xc3, 0x03, 0xf0, 0xff, 0xff, 0xe7,
+0x07, 0xe0, 0xc3, 0x03, 0xf0, 0xff, 0xff, 0xef, 0x01, 0xc0, 0x01, 0x07,
+0xf0, 0xff, 0xff, 0x5f, 0x00, 0xc0, 0x00, 0x07, 0xf0, 0xff, 0xff, 0x1f,
+0x00, 0x80, 0x00, 0x04, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x80, 0x00, 0x04,
+0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, 0xe0, 0xfd, 0xff, 0xff,
+0x00, 0x00, 0x00, 0x02, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x21,
+0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x22, 0x00, 0xf0, 0xff, 0x3f,
+0x00, 0x00, 0x00, 0xf2, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf4,
+0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0xe0, 0xff, 0x07,
+0x00, 0x00, 0x00, 0x04, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x08,
+0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0xff, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x8f,
+0x01, 0x00, 0x00, 0x40, 0x00, 0xc0, 0xff, 0xc7, 0x01, 0x00, 0x00, 0x00,
+0x00, 0xc0, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x20, 0x00, 0x80, 0xff, 0xc1,
+0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x18,
+0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xff, 0x00,
+0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x0c,
+0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x78, 0x00,
+0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-27.xbm b/bitmaps/terra-27.xbm
new file mode 100644 (file)
index 0000000..ef57001
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra27_width 64
+#define terra27_height 64
+#define terra27_x_hot 32
+#define terra27_y_hot 32
+static unsigned char terra27_bits[] = {
+0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x30, 0xf8, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7,
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x10, 0xfb, 0xff, 0xff, 0x03, 0x00,
+0x00, 0x00, 0xdc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff,
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x3f, 0x00,
+0x00, 0x00, 0x7c, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x80, 0xc7, 0xfe,
+0xff, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x83, 0xf6, 0xff, 0xff, 0xff, 0x01,
+0x00, 0xc0, 0x41, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x1f, 0x00,
+0xff, 0xff, 0xff, 0x03, 0x00, 0xe0, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x07,
+0x00, 0xf0, 0x7f, 0xef, 0xff, 0xff, 0xff, 0x07, 0x00, 0xf8, 0xff, 0xff,
+0xbf, 0xff, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x7f, 0x7f, 0xfc, 0xff, 0x1f,
+0x00, 0xfe, 0xff, 0xff, 0xfe, 0x82, 0xff, 0x1f, 0x00, 0xfe, 0xff, 0xff,
+0xfe, 0x0f, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x0f, 0x7c, 0x1e,
+0x00, 0xff, 0xff, 0xff, 0xf9, 0x07, 0x7c, 0x1c, 0x00, 0xff, 0xff, 0xff,
+0xf9, 0x03, 0x38, 0x1c, 0x80, 0xff, 0xff, 0xff, 0xf3, 0x00, 0x38, 0x18,
+0x80, 0xff, 0xff, 0xff, 0x37, 0x00, 0x30, 0x30, 0x80, 0xff, 0xff, 0xff,
+0x0f, 0x00, 0x30, 0x20, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x20,
+0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x40, 0x00, 0x00, 0xbe, 0xff, 0xff,
+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x90,
+0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x90, 0x00, 0x00, 0xfc, 0xff,
+0x0f, 0x00, 0x00, 0xb0, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xa0,
+0x01, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xe0, 0x01, 0x00, 0xf8, 0xff,
+0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00,
+0x03, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff,
+0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00,
+0x02, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff,
+0x43, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x71, 0x00, 0x00, 0x00,
+0x04, 0x00, 0xf0, 0xff, 0x60, 0x00, 0x00, 0x00, 0x04, 0x00, 0xe0, 0x7f,
+0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x30, 0x00, 0x00, 0x00,
+0x00, 0x00, 0xe0, 0x7f, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0xc0, 0x3f,
+0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-28.xbm b/bitmaps/terra-28.xbm
new file mode 100644 (file)
index 0000000..d9e3d6f
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra28_width 64
+#define terra28_height 64
+#define terra28_x_hot 32
+#define terra28_y_hot 32
+static unsigned char terra28_bits[] = {
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
+0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0xff, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x04, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0x98, 0xff, 0xff, 0x03, 0x00,
+0x00, 0x00, 0xe0, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x80, 0xff,
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00,
+0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x78, 0xc8,
+0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3c, 0xd0, 0xfe, 0xff, 0xff, 0x01,
+0x00, 0x00, 0x1c, 0x88, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x03,
+0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfc, 0x03, 0xe0, 0xff, 0xff, 0x07,
+0x00, 0x00, 0xfe, 0xcf, 0xfb, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff,
+0xff, 0xef, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0xff, 0xdf, 0x9f, 0xff, 0x1f,
+0x00, 0xc0, 0xff, 0xff, 0xbf, 0xbf, 0xf0, 0x1f, 0x00, 0xe0, 0xff, 0xff,
+0x3f, 0xff, 0xe1, 0x1f, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xff, 0xc1, 0x37,
+0x00, 0xe0, 0xff, 0xff, 0x7f, 0xfe, 0x81, 0x33, 0x00, 0xf0, 0xff, 0xff,
+0xff, 0xfc, 0x80, 0x23, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3d, 0x00, 0x63,
+0x00, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x43, 0x00, 0xf0, 0xff, 0xff,
+0xff, 0x03, 0x00, 0x02, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02,
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x01, 0xc0, 0xe7, 0xff,
+0xff, 0x1f, 0x00, 0x00, 0x01, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00,
+0x01, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x80, 0x01, 0x00, 0x00, 0xff,
+0xff, 0x07, 0x00, 0x80, 0x03, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x80,
+0x07, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xfe,
+0xff, 0x01, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00,
+0x1f, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc,
+0xff, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00,
+0x0e, 0x00, 0x00, 0xfc, 0xff, 0x21, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc,
+0xff, 0x31, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 0x7f, 0x18, 0x00, 0x00,
+0x1c, 0x00, 0x00, 0xfc, 0x3f, 0x18, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xf8,
+0x3f, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf8, 0x3f, 0x0c, 0x00, 0x00,
+0x08, 0x00, 0x00, 0xf8, 0x1f, 0x04, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf0,
+0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xe0,
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/terra-29.xbm b/bitmaps/terra-29.xbm
new file mode 100644 (file)
index 0000000..ed1df1d
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra29_width 64
+#define terra29_height 64
+#define terra29_x_hot 32
+#define terra29_y_hot 32
+static unsigned char terra29_bits[] = {
+0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xdf, 0x0f, 0x00, 0x00,
+0x00, 0x00, 0x08, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+0xfb, 0xff, 0x00, 0x00, 0x00, 0x40, 0x00, 0x8c, 0xf9, 0xff, 0x03, 0x00,
+0x00, 0x20, 0x00, 0xce, 0xff, 0xff, 0x07, 0x00, 0x00, 0x18, 0x00, 0xf8,
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x04, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x00,
+0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0f,
+0xf9, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0x07, 0xda, 0xff, 0xff, 0x01,
+0x00, 0x00, 0x80, 0x03, 0x90, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x7d,
+0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xf8, 0xff, 0x07,
+0x00, 0x00, 0xc0, 0xff, 0xf3, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff,
+0xff, 0xff, 0xfd, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0xf3, 0x1f,
+0x00, 0x00, 0xf8, 0xff, 0xff, 0xef, 0x07, 0x1f, 0x00, 0x00, 0xfc, 0xff,
+0xff, 0xef, 0x3f, 0x1e, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xdf, 0x3f, 0x1c,
+0x00, 0x00, 0xfc, 0xff, 0xff, 0x9f, 0x3f, 0x18, 0x00, 0x00, 0xfc, 0xff,
+0xff, 0xbf, 0x1f, 0x18, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0x0f, 0x18,
+0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x03, 0x10, 0x00, 0x00, 0xfe, 0xff,
+0xff, 0xff, 0x00, 0x10, 0x02, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0x00,
+0x03, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x07, 0x00, 0x03, 0x00, 0xf0, 0xf3,
+0xff, 0xff, 0x07, 0x00, 0x07, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
+0x07, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x07, 0x00, 0x00, 0x80,
+0xff, 0xff, 0x01, 0x00, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00,
+0x3f, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x7f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00,
+0xff, 0x01, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00,
+0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00,
+0xfe, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x04, 0x00, 0xfe, 0x00, 0x00, 0x00,
+0xff, 0x7f, 0x06, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x07, 0x00,
+0xfc, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x03, 0x00, 0xfc, 0x00, 0x00, 0x00,
+0xfe, 0x0f, 0x03, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x01, 0x00,
+0x78, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x01, 0x00, 0x70, 0x00, 0x00, 0x00,
+0xfc, 0x03, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
+0x60, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
+0x78, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bitmaps/vlines2.xbm b/bitmaps/vlines2.xbm
new file mode 100644 (file)
index 0000000..dc73864
--- /dev/null
@@ -0,0 +1,4 @@
+#define vlines2_width 2
+#define vlines2_height 1
+static unsigned char vlines2_bits[] = {
+   0x01};
diff --git a/bitmaps/vlines3.xbm b/bitmaps/vlines3.xbm
new file mode 100644 (file)
index 0000000..a9b3073
--- /dev/null
@@ -0,0 +1,4 @@
+#define vlines3_width 3
+#define vlines3_height 1
+static unsigned char vlines3_bits[] = {
+   0x02};
diff --git a/config.guess b/config.guess
new file mode 100755 (executable)
index 0000000..e9e4455
--- /dev/null
@@ -0,0 +1,693 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
+#
+# This file 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# The master version of this file is at the FSF in /home/gd/gnu/lib.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit system type (host/target name).
+#
+# Only a few systems have been added to this list; please add others
+# (but try to keep the structure clean).
+#
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 8/24/94.)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    alpha:OSF1:*:*)
+       # A Vn.n version is a released version.
+       # A Tn.n version is a released field test version.
+       # A Xn.n version is an unreleased experimental baselevel.
+       # 1.2 uses "1.2" for uname -r.
+       echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
+       exit 0 ;;
+    21064:Windows_NT:50:3)
+       echo alpha-dec-winnt3.5
+       exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-cbm-sysv4
+       exit 0;;
+    amiga:NetBSD:*:*)
+      echo m68k-cbm-netbsd${UNAME_RELEASE}
+      exit 0 ;;
+    amiga:OpenBSD:*:*)
+      echo m68k-cbm-openbsd${UNAME_RELEASE}
+      exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+       echo arm-acorn-riscix${UNAME_RELEASE}
+       exit 0;;
+    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit 0 ;;
+    NILE:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    i86pc:SunOS:5.*:*)
+       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4*:SunOS:6*:*)
+       # According to config.sub, this is the proper way to canonicalize
+       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+       # it's likely to be more like Solaris than SunOS4.
+       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       exit 0 ;;
+    sun3*:SunOS:*:*)
+       echo m68k-sun-sunos${UNAME_RELEASE}
+       exit 0 ;;
+    aushp:SunOS:*:*)
+       echo sparc-auspex-sunos${UNAME_RELEASE}
+       exit 0 ;;
+    atari*:NetBSD:*:*)
+       echo m68k-atari-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    atari*:OpenBSD:*:*)
+       echo m68k-atari-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3*:NetBSD:*:*)
+       echo m68k-sun-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3*:OpenBSD:*:*)
+       echo m68k-sun-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mac68k:NetBSD:*:*)
+       echo m68k-apple-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mac68k:OpenBSD:*:*)
+       echo m68k-apple-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    powerpc:machten:*:*)
+       echo powerpc-apple-machten${UNAME_RELEASE}
+       exit 0 ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit 0 ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix${UNAME_RELEASE}
+       exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix${UNAME_RELEASE}
+       exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       sed 's/^        //' << EOF >dummy.c
+       int main (argc, argv) int argc; char **argv; {
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       ${CC-cc} dummy.c -o dummy \
+         && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && rm dummy.c dummy && exit 0
+       rm -f dummy.c dummy
+       echo mips-mips-riscos${UNAME_RELEASE}
+       exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit 0 ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit 0 ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit 0 ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+       if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+            -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+               echo m88k-dg-dgux${UNAME_RELEASE}
+       else
+               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+       fi
+        else echo i586-dg-dgux${UNAME_RELEASE}
+        fi
+       exit 0 ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit 0 ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit 0 ;;
+    *:IRIX*:*:*)
+       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i?86:AIX:*:*)
+       echo i386-ibm-aix
+       exit 0 ;;
+    *:AIX:2:3)
+       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               sed 's/^                //' << EOF >dummy.c
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+               rm -f dummy.c dummy
+               echo rs6000-ibm-aix3.2.5
+       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+               echo rs6000-ibm-aix3.2.4
+       else
+               echo rs6000-ibm-aix3.2
+       fi
+       exit 0 ;;
+    *:AIX:*:4)
+       if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       else
+               IBM_ARCH=powerpc
+       fi
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=4.${UNAME_RELEASE}
+       fi
+       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       exit 0 ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+       echo romp-ibm-bsd4.4
+       exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
+       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       echo m68k-hp-bsd4.4
+       exit 0 ;;
+    9000/[3478]??:HP-UX:*:*)
+       case "${UNAME_MACHINE}" in
+           9000/31? )            HP_ARCH=m68000 ;;
+           9000/[34]?? )         HP_ARCH=m68k ;;
+           9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
+           9000/8?? )            HP_ARCH=hppa1.0 ;;
+       esac
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       exit 0 ;;
+    3050*:HI-UX:*:*)
+       sed 's/^        //' << EOF >dummy.c
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+       rm -f dummy.c dummy
+       echo unknown-hitachi-hiuxwe2
+       exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+       echo hppa1.1-hp-bsd
+       exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+       echo hppa1.1-hp-osf
+       exit 0 ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit 0 ;;
+    i?86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo ${UNAME_MACHINE}-unknown-osf1mk
+       else
+           echo ${UNAME_MACHINE}-unknown-osf1
+       fi
+       exit 0 ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*X-MP:*:*:*)
+       echo xmp-cray-unicos
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos${UNAME_RELEASE}
+       exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+       exit 0 ;;
+    CRAY*TS:*:*:*)
+       echo t90-cray-unicos${UNAME_RELEASE}
+       exit 0 ;;
+    CRAY-2:*:*:*)
+       echo cray2-cray-unicos
+        exit 0 ;;
+    F300:UNIX_System_V:*:*)
+        FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    F301:UNIX_System_V:*:*)
+       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+       exit 0 ;;
+    hp3[0-9][05]:NetBSD:*:*)
+       echo m68k-hp-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    hp3[0-9][05]:OpenBSD:*:*)
+       echo m68k-hp-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    i?86:BSD/386:*:* | *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       exit 0 ;;
+    *:FreeBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit 0 ;;
+    *:NetBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       exit 0 ;;
+    *:OpenBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       exit 0 ;;
+    i*:CYGWIN*:*)
+       echo i386-pc-cygwin32
+       exit 0 ;;
+    p*:CYGWIN*:*)
+       echo powerpcle-unknown-cygwin32
+       exit 0 ;;
+    prep*:SunOS:5.*:*)
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    *:GNU:*:*)
+       echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       exit 0 ;;
+    *:Linux:*:*)
+       # The BFD linker knows what the default object file format is, so
+       # first see if it will tell us.
+       ld_help_string=`ld --help 2>&1`
+       if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
+         echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
+         echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
+         echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
+         echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
+         echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
+         echo "powerpc-unknown-linux-gnu" ; exit 0
+       elif test "${UNAME_MACHINE}" = "alpha" ; then
+         echo alpha-unknown-linux-gnu ; exit 0
+       elif test "${UNAME_MACHINE}" = "sparc" ; then
+         echo sparc-unknown-linux-gnu ; exit 0
+       else
+         # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
+         # useful --help.  Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
+         test ! -d /usr/lib/ldscripts/. \
+           && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+         # Determine whether the default compiler is a.out or elf
+         cat >dummy.c <<EOF
+main(argc, argv)
+int argc;
+char *argv[];
+{
+#ifdef __ELF__
+  printf ("%s-pc-linux-gnu\n", argv[1]);
+#else
+  printf ("%s-pc-linux-gnuaout\n", argv[1]);
+#endif
+  return 0;
+}
+EOF
+         ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+         rm -f dummy.c dummy
+       fi ;;
+# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
+# are messed up and put the nodename in both sysname and nodename.
+    i?86:DYNIX/ptx:4*:*)
+       echo i386-sequent-sysv4
+       exit 0 ;;
+    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+       fi
+       exit 0 ;;
+    i?86:*:3.2:*)
+       if test -f /usr/options/cb.name; then
+               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       exit 0 ;;
+    Intel:Mach:3*:*)
+       echo i386-pc-mach3
+       exit 0 ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+       else # Add other i860-SVR4 vendors below as they are discovered.
+         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+       fi
+       exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit 0 ;;
+    M68*:*:R3V[567]*:*)
+       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+       OS_REL=''
+       test -r /etc/.relid \
+       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:*)
+       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+       echo m68k-atari-sysv4
+       exit 0 ;;
+    i?86:LynxOS:2.*:*)
+       echo i386-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv${UNAME_RELEASE}
+       exit 0 ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit 0 ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo ${UNAME_MACHINE}-sni-sysv4
+       else
+               echo ns32k-sni-sysv
+       fi
+       exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit 0 ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       exit 0 ;;
+    mc68*:A/UX:*:*)
+       echo m68k-apple-aux${UNAME_RELEASE}
+       exit 0 ;;
+    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
+       if [ -d /usr/nec ]; then
+               echo mips-nec-sysv${UNAME_RELEASE}
+       else
+               echo mips-unknown-sysv${UNAME_RELEASE}
+       fi
+        exit 0 ;;
+    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                           # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+         ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+       printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+       printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+  printf ("vax-dec-bsd\n"); exit (0);
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+rm -f dummy.c dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+       echo c1-convex-bsd
+       exit 0 ;;
+    c2*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit 0 ;;
+    c34*)
+       echo c34-convex-bsd
+       exit 0 ;;
+    c38*)
+       echo c38-convex-bsd
+       exit 0 ;;
+    c4*)
+       echo c4-convex-bsd
+       exit 0 ;;
+    esac
+fi
+
+#echo '(Unable to guess system type)' 1>&2
+
+exit 1
diff --git a/config.h.in b/config.h.in
new file mode 100644 (file)
index 0000000..f93ef73
--- /dev/null
@@ -0,0 +1,360 @@
+/*-
+ * config.h.in --- xlockmore
+ *
+ *  The best way to set these parameters is by running the included `configure'
+ *  script.  That examines your system, and generates `config.h' from
+ *  `config.h.in'.
+ *
+ *  If something goes very wrong, you can edit `config.h' directly, but beware
+ *  that your changes will be lost if you ever run `configure' again.
+ *
+ *  At the bottom, there are a few things commented out that are not
+ *  automatically detected (past "NOT AUTOMATICALLY DETECTED YET").
+ *
+ */
+
+/* Define to empty if the keyword does not work.  */
+#if !defined(_HPUX_SOURCE) && !defined(__cplusplus) && !defined(c_plusplus)
+#undef const
+#endif
+
+/* Define to empty if the keyword does not work.  */
+#if !defined(__cplusplus) && !defined(c_plusplus)
+#undef inline
+#endif
+
+/* Define to the type of elements in the array set by `getgroups'. Usually
+   this is either `int' or `gid_t'.  */
+#undef GETGROUPS_T
+
+/* Define to `int' if <sys/types.h> doesn't define.  */
+#undef gid_t
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to `int' if <sys/types.h> doesn't define.  */
+#undef pid_t
+
+/* Define as the return type of signal handlers (int or void).  */
+#undef RETSIGTYPE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+#undef size_t
+
+/* Define if you have the ANSI C header files.  */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <sys/time.h> and <time.h>.  */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if your <sys/time.h> declares struct tm.  */
+#undef TM_IN_SYS_TIME
+
+/* Define if you have the gettimeofday function.  */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if gettimeofday requires two arguments.  */
+#undef GETTIMEOFDAY_TWO_ARGS
+
+/* Define if you have the tzset function.  */
+#undef HAVE_TZSET
+
+/* Define if you have the timelocal function.  */
+#undef HAVE_TIMELOCAL
+
+/* Define to `int' if <sys/types.h> doesn't define.  */
+#undef uid_t
+
+/* Define if you have the gethostname function.  */
+#undef HAVE_GETHOSTNAME
+
+/* Define if you have the select function.  */
+#undef HAVE_SELECT
+
+/* Define if you have the strdup function.  */
+#undef HAVE_STRDUP
+
+/* Define if you have the seteuid function.  */
+#undef HAVE_SETEUID
+
+/* Define if you have the setreuid function.  */
+#undef HAVE_SETREUID
+
+/* Define one of these if they exist, usleep prefered.  */
+#undef HAVE_USLEEP
+#undef HAVE_NANOSLEEP
+
+/* If left undefined will default to internal Random Number Generator */
+/* #undef SRAND */
+/* #undef LRAND */
+/* #undef MAXRAND */
+#undef HAVE_RAND48
+#undef HAVE_RANDOM
+#undef HAVE_RAND
+
+/* Avoid delaring these if the system has already done it for us. */
+#undef DECLARED_GETENV
+#undef DECLARED_SRAND48
+
+/* Enable use of matherr function */
+#undef USE_MATHERR
+
+/* Define if you have the <dirent.h> header file.  */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <fcntl.h> header file.  */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <limits.h> header file.  */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <ndir.h> header file.  */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <sys/dir.h> header file.  */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/ndir.h> header file.  */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/time.h> header file.  */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <sys/select.h> header file.  */
+#undef HAVE_SYS_SELECT_H
+
+/* Define if you have the <syslog.h> header file.  */
+#undef HAVE_SYSLOG_H
+
+/* Define if you have the <unistd.h> header file.  */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <sys/param.h> header file.  */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the shadow passwords (or elf).  */
+#undef HAVE_SHADOW
+
+/* Define if you have the sigset_t structure.  */
+#undef HAVE_STRUCT_SIGSET_T
+
+/* Define if you have libesd (Enlightenment Sound Daemon) */
+#undef HAVE_LIBESD
+
+/* Various system defines.  */
+#undef SYSV
+#undef SVR4
+#undef linux
+#undef SOLARIS2
+#undef LESS_THAN_SOLARIS2_5
+#undef SUNOS4
+#undef _POSIX_SOURCE
+#undef _BSD_SOURCE
+#undef _GNU_SOURCE
+#undef AIXV3
+#undef LESS_THAN_AIX3_2
+#undef SUN_OGL_NO_VERTEX_MACROS
+
+/* Define this if your version of OpenGL has the glBindTexture() routine.
+   This is the case for OpenGL 1.1, but not for OpenGL 1.0.
+ */
+#undef HAVE_GLBINDTEXTURE
+
+/* Define if you have XPM (look for it under a X11 dir).  */
+#undef USE_XPM
+
+/* Define if you have XPM (when its not under a X11 dir, not the norm).  */
+#undef USE_XPMINC
+
+/* Define if you have c++ */
+#undef HAVE_CXX
+
+/* Define if you have FreeType (libttf.a)  */
+#undef HAVE_TTF
+
+/* Define if you have GLTT (libgltt.a)  */
+#undef HAVE_GLTT
+
+/* Define if you have XMU (Editres).  */
+#undef USE_XMU
+
+/* Define if you have GL (MesaGL).  */
+#undef USE_GL
+
+/* Define if you have DtSaver.  */
+#undef USE_DTSAVER
+
+/* Define if you have DPMS (Display Power Management Signaling).  */
+#undef USE_DPMS
+
+/* Define one of these for sounds.  */
+#undef USE_RPLAY
+#undef USE_NAS
+#undef USE_VMSPLAY
+#undef DEF_PLAY
+#undef USE_ESOUND
+
+/* Allows xlock to run in root window (some window managers have problems) */
+#undef USE_VROOT
+
+/* Users can not turn off allowroot */
+#undef ALWAYS_ALLOW_ROOT
+
+/* Paranoid administrator option (a check is also done to see if you have it) */
+#undef USE_SYSLOG
+
+/* Multiple users ... security? */
+#undef USE_MULTIPLE_USER
+
+/* Multiple root users ... security? */
+#undef USE_MULTIPLE_ROOT
+
+/* Allow a window to be placed over xlock */
+#undef USE_WINDOW_VISIBILITY
+
+/* Some machines may still need this (fd_set errors may be a sign) */
+#undef USE_OLD_EVENT_LOOP
+
+/* This patches up old __VMS_VER < 70000000 */
+#undef USE_VMSUTILS
+
+/* For personal use you may want to consider: */
+/* Unfriendly paranoid admininistrator or unknown shadow passwd algorithm */
+#undef USE_XLOCKRC
+
+/* For labs you may want to consider: */
+
+/* Enable auto-logout code, minutes until auto-logout */
+#undef USE_AUTO_LOGOUT
+
+/* Set default for auto-logout code, hard limit is USE_AUTO_LOGOUT */
+#undef DEF_AUTO_LOGOUT
+
+/* Enable logout button, minutes until button appears */
+#undef USE_BUTTON_LOGOUT
+
+/* Set default for logout button code, hard limit is USE_LOGOUT_BUTTON */
+#undef DEF_BUTTON_LOGOUT
+
+/* Enable automatic logout mode (does not come up in random mode) */
+#undef USE_BOMB
+
+/* Disable interactive modes (useful in production environments) */
+#undef DISABLE_INTERACTIVE
+
+/* Enable unstable modes */
+#undef USE_UNSTABLE
+
+/* Define one of these with USE_AUTO_LOGOUT, USE_LOGOUT_BUTTON, and/or
+   USE_BOMB, if using xdm */
+#undef CLOSEDOWN_LOGOUT
+#undef SESSION_LOGOUT
+
+/* File of staff who are exempt */
+#undef STAFF_FILE
+
+/* Netgroup that is exempt */
+#undef STAFF_NETGROUP
+
+/* Digital Unix Enhanced Security */
+#undef OSF1_ENH_SEC
+
+/* Kerberos 4 */
+#undef HAVE_KRB4
+
+/* Kerberos 5 */
+#undef HAVE_KRB5
+
+/* DCE Passwording */
+#undef DCE_PASSWD
+
+/* Define to use and link against PAM */
+#undef PAM
+
+/* AIX & Solaris AFS Passwording */
+#undef AFS
+
+/* DEC Tru64 SIA Passwording */
+#undef SIA
+
+/* SUNOS Adjunct Passwording */
+#undef SUNOS_ADJUNCT_PASSWD
+
+/* USE Xmb function series */
+#undef USE_MB
+
+/* XResource customization, drawback -display option may not work  */
+#undef CUSTOMIZATION
+
+/* New Dynamic Linking */
+#undef USE_MODULES
+
+/* reporting language customization */
+#undef NL
+#undef FR
+#undef DE
+#undef JP
+
+/* enabling original mail icon xpm patch */
+#undef ORIGINAL_XPM_PATCH
+
+/* Virtual Terminal Lock for XFree86 users  */
+#undef USE_VTLOCK
+
+/* The FOLLOWING are NOT AUTOMATICALLY DETECTED YET */
+
+/* Force NON-MESA GL using MESA includes, uncomment next line */
+/* #define OPENGL_MESA_INCLUDES */
+
+/* EXTRA SOUND STUFF if you do not have RPLAY or NAS */
+/* SUNOS 4.1.3 */
+/* #define DEF_PLAY "/usr/demo/SOUND/play /usr/local/share/sounds/xlock/" */
+/* IRIX 5.3 */
+/* #define DEF_PLAY "/usr/sbin/sfplay /usr/local/share/sounds/xlock/" */
+/* Digital Unix with Multimedia Services installed */
+/* #define DEF_PLAY "/usr/bin/mme/decsound -play
+   /usr/local/share/sounds/xlock/" */
+/* LINUX and others (see config directory) */
+/* #define DEF_PLAY "/usr/local/bin/play.sh /usr/local/share/sounds/xlock/" */
+
+/* EXTRA SYSLOG STUFF if you want to override defaults for SYSLOG */
+/* You may want to set all -DSYSLOG_* to LOG_WARNING to maximize messages */
+/* #define SYSLOG_FACILITY LOG_AUTH */
+/* #define SYSLOG_WARNING LOG_WARNING */
+/* #define SYSLOG_NOTICE LOG_NOTICE */
+/* #define SYSLOG_INFO LOG_INFO */
+
+/* #define SAFEWORD */
+/* #define FX */
+
+/* Full screen colormaps are not allowed on compliant window managers
+   like FVWM, TVWM, SCWM, and DEC WINDOWS and tricks xlock, this fix does
+   not work on TrueColor
+ */
+/* #define COMPLIANT_COLORMAP */
+
+/* Blank only: may be good on high use workstations where cpu usage is
+   precious...
+ */
+/* #define BLANK_ONLY */
+
+/* Bad version of PAM  */
+/* #define BAD_PAM */
+
+/* Anybody with a password can unlock, good to use with HAVE_SYSLOG_H */
+/* #define GLOBAL_UNLOCK */
+
+/* I use this for testing SunCplusplus
+   I still get this in the link:
+   Undefined                       first referenced
+   symbol                             in file
+   gethostbyname(const char*)               ../xlock/resource.o
+   kill(long, int)                         ../xlock/logout.o
+   signal(int, void (*)(int))                   ../xlock/logout.o
+   also define HAVE_USLEEP
+ */
+/* #define SunCplusplus */
+
+/* I use this when I am working on something */
+/* #define UNDER_DEVELOPMENT */
diff --git a/config.sub b/config.sub
new file mode 100755 (executable)
index 0000000..029b08d
--- /dev/null
@@ -0,0 +1,927 @@
+#! /bin/sh
+# Configuration validation subroutine script, version 1.1.
+#   Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file 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.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+if [ x$1 = x ]
+then
+       echo Configuration name missing. 1>&2
+       echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+       echo "or     $0 ALIAS" 1>&2
+       echo where ALIAS is a recognized configuration type. 1>&2
+       exit 1
+fi
+
+# First pass through any local machine types.
+case $1 in
+       *local*)
+               echo $1
+               exit 0
+               ;;
+       *)
+       ;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  linux-gnu*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+       -sun*os*)
+               # Prevent following clause from handling this invalid input.
+               ;;
+       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+       -apple)
+               os=
+               basic_machine=$1
+               ;;
+       -hiux*)
+               os=-hiuxwe2
+               ;;
+       -sco5)
+               os=sco3.2v5
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco4)
+               os=-sco3.2v4
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2v[4-9]*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco*)
+               os=-sco3.2v2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -isc)
+               os=-isc2.2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -clix*)
+               basic_machine=clipper-intergraph
+               ;;
+       -isc*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -lynx*)
+               os=-lynxos
+               ;;
+       -ptx*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+               ;;
+       -windowsnt*)
+               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+       # Recognize the basic CPU types without company name.
+       # Some are omitted here because they have special meanings below.
+       tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
+               | arme[lb] | pyramid \
+               | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
+               | alpha | we32k | ns16k | clipper | i370 | sh \
+               | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
+               | pdp11 | mips64el | mips64orion | mips64orionel \
+               | sparc | sparclet | sparclite | sparc64)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i[3456]86)
+         basic_machine=$basic_machine-pc
+         ;;
+       # Object if more than one company name word.
+       *-*-*)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+       # Recognize the basic CPU types with company name.
+       vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
+             | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
+             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
+             | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
+             | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
+             | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
+             | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
+             | mips64el-* | mips64orion-* | mips64orionel-* | f301-* | armv*-*)
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+               basic_machine=m68000-att
+               ;;
+       3b*)
+               basic_machine=we32k-att
+               ;;
+       alliant | fx80)
+               basic_machine=fx80-alliant
+               ;;
+       altos | altos3068)
+               basic_machine=m68k-altos
+               ;;
+       am29k)
+               basic_machine=a29k-none
+               os=-bsd
+               ;;
+       amdahl)
+               basic_machine=580-amdahl
+               os=-sysv
+               ;;
+       amiga | amiga-*)
+               basic_machine=m68k-cbm
+               ;;
+       amigados)
+               basic_machine=m68k-cbm
+               os=-amigados
+               ;;
+       amigaunix | amix)
+               basic_machine=m68k-cbm
+               os=-sysv4
+               ;;
+       apollo68)
+               basic_machine=m68k-apollo
+               os=-sysv
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       convex-c1)
+               basic_machine=c1-convex
+               os=-bsd
+               ;;
+       convex-c2)
+               basic_machine=c2-convex
+               os=-bsd
+               ;;
+       convex-c32)
+               basic_machine=c32-convex
+               os=-bsd
+               ;;
+       convex-c34)
+               basic_machine=c34-convex
+               os=-bsd
+               ;;
+       convex-c38)
+               basic_machine=c38-convex
+               os=-bsd
+               ;;
+       cray | ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
+       cray2)
+               basic_machine=cray2-cray
+               os=-unicos
+               ;;
+       [ctj]90-cray)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       da30 | da30-*)
+               basic_machine=m68k-da30
+               ;;
+       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+               basic_machine=mips-dec
+               ;;
+       delta | 3300 | motorola-3300 | motorola-delta \
+             | 3300-motorola | delta-motorola)
+               basic_machine=m68k-motorola
+               ;;
+       delta88)
+               basic_machine=m88k-motorola
+               os=-sysv3
+               ;;
+       dpx20 | dpx20-*)
+               basic_machine=rs6000-bull
+               os=-bosx
+               ;;
+       dpx2* | dpx2*-bull)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       ebmon29k)
+               basic_machine=a29k-amd
+               os=-ebmon
+               ;;
+       elxsi)
+               basic_machine=elxsi-elxsi
+               os=-bsd
+               ;;
+       encore | umax | mmax)
+               basic_machine=ns32k-encore
+               ;;
+       fx2800)
+               basic_machine=i860-alliant
+               ;;
+       genix)
+               basic_machine=ns32k-ns
+               ;;
+       gmicro)
+               basic_machine=tron-gmicro
+               os=-sysv
+               ;;
+       h3050r* | hiux*)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       h8300hms)
+               basic_machine=h8300-hitachi
+               os=-hms
+               ;;
+       harris)
+               basic_machine=m88k-harris
+               os=-sysv3
+               ;;
+       hp300-*)
+               basic_machine=m68k-hp
+               ;;
+       hp300bsd)
+               basic_machine=m68k-hp
+               os=-bsd
+               ;;
+       hp300hpux)
+               basic_machine=m68k-hp
+               os=-hpux
+               ;;
+       hp9k2[0-9][0-9] | hp9k31[0-9])
+               basic_machine=m68000-hp
+               ;;
+       hp9k3[2-9][0-9])
+               basic_machine=m68k-hp
+               ;;
+       hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][0-9] | hp8[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hppa-next)
+               os=-nextstep3
+               ;;
+       i370-ibm* | ibm*)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+       i[3456]86v32)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv32
+               ;;
+       i[3456]86v4*)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv4
+               ;;
+       i[3456]86v)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv
+               ;;
+       i[3456]86sol2)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-solaris2
+               ;;
+       iris | iris4d)
+               basic_machine=mips-sgi
+               case $os in
+                   -irix*)
+                       ;;
+                   *)
+                       os=-irix4
+                       ;;
+               esac
+               ;;
+       isi68 | isi)
+               basic_machine=m68k-isi
+               os=-sysv
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       mips3*-*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               ;;
+       mips3*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               ;;
+       ncr3000)
+               basic_machine=i486-ncr
+               os=-sysv4
+               ;;
+       news | news700 | news800 | news900)
+               basic_machine=m68k-sony
+               os=-newsos
+               ;;
+       news1000)
+               basic_machine=m68030-sony
+               os=-newsos
+               ;;
+       news-3600 | risc-news)
+               basic_machine=mips-sony
+               os=-newsos
+               ;;
+       next | m*-next )
+               basic_machine=m68k-next
+               case $os in
+                   -nextstep* )
+                       ;;
+                   -ns2*)
+                     os=-nextstep2
+                       ;;
+                   *)
+                     os=-nextstep3
+                       ;;
+               esac
+               ;;
+       nh3000)
+               basic_machine=m68k-harris
+               os=-cxux
+               ;;
+       nh[45]000)
+               basic_machine=m88k-harris
+               os=-cxux
+               ;;
+       nindy960)
+               basic_machine=i960-intel
+               os=-nindy
+               ;;
+       np1)
+               basic_machine=np1-gould
+               ;;
+       pa-hitachi)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       paragon)
+               basic_machine=i860-intel
+               os=-osf
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+        pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pentium | p5)
+               basic_machine=i586-intel
+               ;;
+       pentiumpro | p6)
+               basic_machine=i686-intel
+               ;;
+       pentium-* | p5-*)
+               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       k5)
+               # We don't have specific support for AMD's K5 yet, so just call it a Pentium
+               basic_machine=i586-amd
+               ;;
+       nexen)
+               # We don't have specific support for Nexgen yet, so just call it a Pentium
+               basic_machine=i586-nexgen
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=rs6000-ibm
+               ;;
+       ppc)    basic_machine=powerpc-unknown
+               ;;
+       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle | ppc-le | powerpc-little)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ps2)
+               basic_machine=i386-ibm
+               ;;
+       rm[46]00)
+               basic_machine=mips-siemens
+               ;;
+       rtpc | rtpc-*)
+               basic_machine=romp-ibm
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sps7)
+               basic_machine=m68k-bull
+               os=-sysv2
+               ;;
+       spur)
+               basic_machine=spur-unknown
+               ;;
+       sun2)
+               basic_machine=m68000-sun
+               ;;
+       sun2os3)
+               basic_machine=m68000-sun
+               os=-sunos3
+               ;;
+       sun2os4)
+               basic_machine=m68000-sun
+               os=-sunos4
+               ;;
+       sun3os3)
+               basic_machine=m68k-sun
+               os=-sunos3
+               ;;
+       sun3os4)
+               basic_machine=m68k-sun
+               os=-sunos4
+               ;;
+       sun4os3)
+               basic_machine=sparc-sun
+               os=-sunos3
+               ;;
+       sun4os4)
+               basic_machine=sparc-sun
+               os=-sunos4
+               ;;
+       sun4sol2)
+               basic_machine=sparc-sun
+               os=-solaris2
+               ;;
+       sun3 | sun3-*)
+               basic_machine=m68k-sun
+               ;;
+       sun4)
+               basic_machine=sparc-sun
+               ;;
+       sun386 | sun386i | roadrunner)
+               basic_machine=i386-sun
+               ;;
+       symmetry)
+               basic_machine=i386-sequent
+               os=-dynix
+               ;;
+       tower | tower-32)
+               basic_machine=m68k-ncr
+               ;;
+       udi29k)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       ultra3)
+               basic_machine=a29k-nyu
+               os=-sym1
+               ;;
+       vaxv)
+               basic_machine=vax-dec
+               os=-sysv
+               ;;
+       vms)
+               basic_machine=vax-dec
+               os=-vms
+               ;;
+       vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+       vxworks960)
+               basic_machine=i960-wrs
+               os=-vxworks
+               ;;
+       vxworks68)
+               basic_machine=m68k-wrs
+               os=-vxworks
+               ;;
+       vxworks29k)
+               basic_machine=a29k-wrs
+               os=-vxworks
+               ;;
+       xmp)
+               basic_machine=xmp-cray
+               os=-unicos
+               ;;
+        xps | xps100)
+               basic_machine=xps100-honeywell
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+       mips)
+               basic_machine=mips-mips
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sparc)
+               basic_machine=sparc-sun
+               ;;
+        cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       *)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+       # -solaris* is a basic system type, with this one exception.
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -unixware* | svr4*)
+               os=-sysv4
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # First accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST END IN A *, to match a version number.
+       # -sysv* is not here because it comes later, after sysvr4.
+       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -linux-gnu* | -uxpv*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -linux*)
+               os=`echo $os | sed -e 's|linux|linux-gnu|'`
+               ;;
+       -sunos5*)
+               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -osfrose*)
+               os=-osfrose
+               ;;
+       -osf*)
+               os=-osf
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -ns2 )
+               os=-nextstep2
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -xenix)
+               os=-xenix
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+        pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               # This also exists in the configure program, but was not the
+               # default.
+               # os=-sunos4
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigados
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next )
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-next)
+               os=-nextstep3
+               ;;
+        *-gould)
+               os=-sysv
+               ;;
+        *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+        *-sgi)
+               os=-irix
+               ;;
+        *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f301-fujitsu)
+               os=-uxpv
+               ;;
+       *)
+               os=-none
+               ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+       *-unknown)
+               case $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -aix*)
+                               vendor=ibm
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -vxsim* | -vxworks*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+               esac
+               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo $basic_machine$os
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..a61e513
--- /dev/null
+++ b/configure
@@ -0,0 +1,8196 @@
+#! /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
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --with-purify           configure to postprocess with purify"
+ac_help="$ac_help
+  --with-x                use the X Window System"
+ac_help="$ac_help
+  --with-includes=DIR     search include DIR for optional packages below"
+ac_help="$ac_help
+  --with-libraries=DIR    search library DIR for optional packages below"
+ac_help="$ac_help
+  --without-motif         disable Motif (for xmlock)"
+ac_help="$ac_help
+  --without-editres       disable debugger (for x?lock)"
+ac_help="$ac_help
+  --without-xpm           enable color pixmap XPM mode(s)"
+ac_help="$ac_help
+  --without-gltt          disable GL True text library"
+ac_help="$ac_help
+  --without-ttf           enable color pixmap TTF mode(s)"
+ac_help="$ac_help
+  --without-opengl        disable 3D OpenGL (for GL modes)"
+ac_help="$ac_help
+  --without-mesa          disable Mesa 3D (for GL modes)"
+ac_help="$ac_help
+  --without-dtsaver       disable -dtsaver option"
+ac_help="$ac_help
+  --without-dpms          disable DPMS"
+ac_help="$ac_help
+  --without-rplay         disable RPLAY sounds"
+ac_help="$ac_help
+  --with-esound           enable Enlightenment Sound Daemon sounds"
+ac_help="$ac_help
+  --with-esound-config    use this configurator for Enlightenment Sound Daemon sounds"
+ac_help="$ac_help
+  --with-esound-prefix    use this prefix for Enlightenment Sound Daemon sounds"
+ac_help="$ac_help
+  --with-esound-includes  use this dir for Enlightenment Sound Daemon sounds headers"
+ac_help="$ac_help
+  --with-esound-libraries use this dir for Enlightenment Sound Daemon sounds libs"
+ac_help="$ac_help
+  --without-nas           disable NAS sounds"
+ac_help="$ac_help
+  --without-crypt         disable CRYPT"
+ac_help="$ac_help
+  --without-gtk           disable GTK (no xglock build)"
+ac_help="$ac_help
+  --with-gtk-prefix=DIR   Prefix where GTK is installed (optional)"
+ac_help="$ac_help
+  --with-gtk-exec-prefix=DIR
+                          Exec prefix where GTK is installed (optional)"
+ac_help="$ac_help
+  --disable-gtktest       Do not try to compile and run a test GTK program"
+ac_help="$ac_help
+  --enable-bitmapdir=DIR  set directory for bitmaps, default is ./bitmaps"
+ac_help="$ac_help
+  --enable-bitmaptype=name
+                          set name for bitmap type"
+ac_help="$ac_help
+  --enable-pixmapdir=DIR  set directory for pixmaps, default is ./pixmaps"
+ac_help="$ac_help
+  --enable-pixmaptype=name
+                          set name for pixmap type"
+ac_help="$ac_help
+  --enable-mapdir=DIR     set directory for bitmaps and pixmaps"
+ac_help="$ac_help
+  --enable-maptype=name   set name for bitmap and pixmap type"
+ac_help="$ac_help
+  --enable-def-play=program
+                          set def-play to program that plays sounds"
+ac_help="$ac_help
+  --disable-vroot         disables xlock from being able to run in root window
+                          (some window managers have problems)"
+ac_help="$ac_help
+  --disable-allow-root    allows users to turn off allowroot (default is to
+                          always allow root to be able to unlock xlock)"
+ac_help="$ac_help
+  --enable-vtlock         allows to turn on VT switch lock (default is to be
+                          able to switch to another VT)"
+ac_help="$ac_help
+  --enable-syslog         enable syslog logging"
+ac_help="$ac_help
+  --enable-multiple-user  enable multiple users"
+ac_help="$ac_help
+  --enable-multiple-root  enable multiple root users"
+ac_help="$ac_help
+  --enable-window-visibility
+                          allow a window to be displayed over xlock"
+ac_help="$ac_help
+  --enable-old-event-loop some machines may still need this
+                          (fd_set errors may be a sign)"
+ac_help="$ac_help
+  --enable-xlockrc        for unknown shadow passwd algorithm"
+ac_help="$ac_help
+  --enable-auto-logout=time
+                          enable auto-logout code for lab use (time in minutes)"
+ac_help="$ac_help
+  --enable-default-auto-logout=time
+                          set default-auto-logout (time in minutes)"
+ac_help="$ac_help
+  --enable-button-logout=time
+                          enable button logout for lab use (time in minutes)"
+ac_help="$ac_help
+  --enable-default-button-logout=time
+                          set default-button-logout (time in minutes)"
+ac_help="$ac_help
+  --disable-bomb          disable automatic logout mode"
+ac_help="$ac_help
+  --disable-interactive   disables interactive modes (useful for production enviroments)"
+ac_help="$ac_help
+  --enable-unstable       enables unstable (alpha) modes"
+ac_help="$ac_help
+  --enable-closedown-logout
+                          define this one or next, with enable-auto-logout,"
+ac_help="$ac_help
+  --enable-session-logout enable-button-logout, and/or enable-bomb, for xdm"
+ac_help="$ac_help
+  --enable-staff-file=filename
+                          set file of staff who are exempt from auto-logout"
+ac_help="$ac_help
+  --enable-staff-netgroup=netgroup
+                          set netgroup of staff who are exempt from auto-logout"
+ac_help="$ac_help
+  --enable-kerberos4      enable Kerberos 4"
+ac_help="$ac_help
+  --enable-kerberos5      enable Kerberos 5"
+ac_help="$ac_help
+  --enable-dce-passwd     enable DCE passwording"
+ac_help="$ac_help
+  --enable-pam            enable PAM"
+ac_help="$ac_help
+  --enable-afs            enable AFS"
+ac_help="$ac_help
+  --enable-sia            enable SIA"
+ac_help="$ac_help
+  --enable-sunos-adjunct-passwd
+                          enable SUNOS Adjunct passwording"
+ac_help="$ac_help
+  --enable-use-mb         enable Xmb function series (new)"
+ac_help="$ac_help
+  --enable-customization  enable customization of XResource"
+ac_help="$ac_help
+  --enable-modules        enable modules (better to use xmkmf for this)"
+ac_help="$ac_help
+  --enable-check          enable check (new and experimental)"
+ac_help="$ac_help
+  --with-lang=lang        use a foreign language (nl/fr/de/jp)"
+ac_help="$ac_help
+  --enable-orig-xpm-patch use the original pixmap patch for mail icon
+                          (have colormap problems in 8 bits depth visuals)"
+ac_help="$ac_help
+  --disable-setuid        disables setuid installation if automatically chosen"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# 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
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=config.h.in
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+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
+
+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 ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='       '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# 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:702: 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/'`
+echo "$ac_t""$host" 1>&6
+
+canonical=$host
+
+# 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:727: 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"
+      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
+
+if test -z "$CC"; then
+  # 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:757: 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
+        ac_prog_rejected=yes
+       continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+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
+
+  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:808: 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:840: 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 851 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:856: \"$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
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  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:882: 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:887: 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
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:896: \"$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
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+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:915: 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
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+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
+
+if test "$CC" = gcc; then
+  for ac_prog in $CCC g++ CC C++ c++ cxx cc++ xlC $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:952: 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"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+else
+  for ac_prog in $CCC CC C++ g++ c++ cxx cc++ xlC $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:988: 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"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+fi
+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:1024: 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"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1056: 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 1067 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1072: \"$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
+    ac_cv_prog_cxx_cross=no
+  else
+    ac_cv_prog_cxx_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cxx_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_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_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 ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1098: 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:1103: 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
+  cat > conftest.C <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1112: \"$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
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+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:1131: 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
+  echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+  ac_cv_prog_cxx_g=yes
+else
+  ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+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
+
+if test "${CXX}" = "xlC" ; then
+  CXXFLAGS="${CXXFLAGS} -+"
+fi
+
+
+cat >> confdefs.h <<\EOF
+#define HAVE_CXX 1
+EOF
+
+CCC=
+
+PACKAGE=xlockmore
+
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+VERSION=5.00
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+
+
+opt_purify=no
+# Check whether --with-purify or --without-purify was given.
+if test "${with_purify+set}" = set; then
+  withval="$with_purify"
+  opt_purify=$withval
+fi
+
+if test "$opt_purify" = yes; then
+  echo "$ac_t""enabling purify" 1>&6
+  PURIFY="purify"
+else
+  PURIFY=
+fi
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1204: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1225: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 1240 "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:1246: \"$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="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 1257 "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:1263: \"$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="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 1274 "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:1280: \"$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"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking for AIX""... $ac_c" 1>&6
+echo "configure:1305: checking for AIX" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1307 "configure"
+#include "confdefs.h"
+#ifdef _AIX
+  yes
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define _ALL_SOURCE 1
+EOF
+
+else
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1340: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+         if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:1393: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+ac_link_test="-L"
+# test test
+echo $ac_n "checking test -h""... $ac_c" 1>&6
+echo "configure:1422: checking test -h" >&5
+if (test \! -h /) >/dev/null 2>/dev/null ; then
+  ac_link_test="-h"
+  echo "$ac_t""$ac_link_test" 1>&6
+else
+  echo "$ac_t""$ac_link_test" 1>&6
+fi
+
+
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:1432: checking for POSIXized ISC" >&5
+if test -d /etc/conf/kconfig.d &&
+  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+  echo "$ac_t""yes" 1>&6
+  ISC=yes # If later tests want to check for ISC.
+  cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+  if test "$GCC" = yes; then
+    CC="$CC -posix"
+  else
+    CC="$CC -Xp"
+  fi
+else
+  echo "$ac_t""no" 1>&6
+  ISC=
+fi
+
+echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
+echo "configure:1453: checking whether byte ordering is bigendian" >&5
+if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_c_bigendian=unknown
+# See if sys/param.h defines the BYTE_ORDER macro.
+cat > conftest.$ac_ext <<EOF
+#line 1460 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/param.h>
+int main() {
+
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat > conftest.$ac_ext <<EOF
+#line 1475 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/param.h>
+int main() {
+
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_bigendian=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_bigendian=no
+fi
+rm -f conftest*
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+if test $ac_cv_c_bigendian = unknown; then
+if test "$cross_compiling" = yes; then
+    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1506 "configure"
+#include "confdefs.h"
+main () {
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long l;
+    char c[sizeof (long)];
+  } u;
+  u.l = 1;
+  exit (u.c[sizeof (long) - 1] == 1);
+}
+EOF
+if { (eval echo configure:1519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_c_bigendian=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_c_bigendian=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+if test $ac_cv_c_bigendian = yes; then
+  cat >> confdefs.h <<\EOF
+#define WORDS_BIGENDIAN 1
+EOF
+
+fi
+
+for ac_hdr in fcntl.h limits.h sys/select.h sys/time.h syslog.h unistd.h memory.h sys/param.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1546: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1551 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1556: \"$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*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1584: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1589 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this.  */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this.  */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this.  */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+   It does not let you subtract one const X* pointer from another in an arm
+   of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this.  */
+  char *t;
+  char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+  *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+  int x[] = {25, 17};
+  const int *foo = &x[0];
+  ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+  typedef const int *iptr;
+  iptr p = 0;
+  ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+  struct s { int j; const int *ap[3]; };
+  struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+  const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_const=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+  cat >> confdefs.h <<\EOF
+#define const 
+EOF
+
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1659: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1664 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1672: \"$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*
+  ac_cv_header_stdc=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1689 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1707 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1728 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking for mode_t""... $ac_c" 1>&6
+echo "configure:1763: checking for mode_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1768 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_mode_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_mode_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_mode_t" 1>&6
+if test $ac_cv_type_mode_t = no; then
+  cat >> confdefs.h <<\EOF
+#define mode_t int
+EOF
+
+fi
+
+echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:1796: checking for uid_t in sys/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1801 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "uid_t" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_uid_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+if test $ac_cv_type_uid_t = no; then
+  cat >> confdefs.h <<\EOF
+#define uid_t int
+EOF
+
+  cat >> confdefs.h <<\EOF
+#define gid_t int
+EOF
+
+fi
+
+echo $ac_n "checking for pid_t""... $ac_c" 1>&6
+echo "configure:1830: checking for pid_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1835 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_pid_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_pid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+if test $ac_cv_type_pid_t = no; then
+  cat >> confdefs.h <<\EOF
+#define pid_t int
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1863: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1868 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_size_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+  cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:1896: checking whether time.h and sys/time.h may both be included" >&5
+if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1901 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int main() {
+struct tm *tp;
+; return 0; }
+EOF
+if { (eval echo configure:1910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_header_time=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_time=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_time" 1>&6
+if test $ac_cv_header_time = yes; then
+  cat >> confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
+echo "configure:1931: checking whether struct tm is in sys/time.h or time.h" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1936 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <time.h>
+int main() {
+struct tm *tp; tp->tm_sec;
+; return 0; }
+EOF
+if { (eval echo configure:1944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_struct_tm=time.h
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_struct_tm=sys/time.h
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_tm" 1>&6
+if test $ac_cv_struct_tm = sys/time.h; then
+  cat >> confdefs.h <<\EOF
+#define TM_IN_SYS_TIME 1
+EOF
+
+fi
+
+
+echo $ac_n "checking for getenv declaration""... $ac_c" 1>&6
+echo "configure:1966: checking for getenv declaration" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1968 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "getenv" >/dev/null 2>&1; then
+  rm -rf conftest*
+  cat >> confdefs.h <<\EOF
+#define DECLARED_GETENV 1
+EOF
+ echo "$ac_t""yes" 1>&6
+else
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+
+for ac_func in gethostname select strdup
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1989: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1994 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for vfork""... $ac_c" 1>&6
+echo "configure:2043: checking for vfork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2048 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char vfork(); below.  */
+#include <assert.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 vfork();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_vfork) || defined (__stub___vfork)
+choke me
+#else
+vfork();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_vfork=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_vfork=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_VFORK 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for seteuid""... $ac_c" 1>&6
+echo "configure:2094: checking for seteuid" >&5
+if eval "test \"`echo '$''{'ac_cv_func_seteuid'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2099 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char seteuid(); below.  */
+#include <assert.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 seteuid();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_seteuid) || defined (__stub___seteuid)
+choke me
+#else
+seteuid();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_seteuid=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_seteuid=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'seteuid`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_SETEUID 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for setreuid""... $ac_c" 1>&6
+echo "configure:2143: checking for setreuid" >&5
+if eval "test \"`echo '$''{'ac_cv_func_setreuid'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2148 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char setreuid(); below.  */
+#include <assert.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 setreuid();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_setreuid) || defined (__stub___setreuid)
+choke me
+#else
+setreuid();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_setreuid=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_setreuid=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'setreuid`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_SETREUID 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+
+
+# Configure paths for GTK+
+# Owen Taylor     97-11-3
+
+
+
+# If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# 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:2207: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+  :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+  cd conftestdir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat > Imakefile <<'EOF'
+acfindx:
+       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+        ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case "$ac_im_incroot" in
+       /usr/include) ;;
+       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+    esac
+    case "$ac_im_usrlibdir" in
+       /usr/lib | /lib) ;;
+       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftestdir
+fi
+
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+  # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 2269 "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:2274: \"$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.
+ac_x_includes=
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
+
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS="$LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2343 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:2350: \"$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.
+ac_x_libraries=
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+    /usr/X11/lib          \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11     \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$ac_t""$have_x" 1>&6
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  cat >> confdefs.h <<\EOF
+#define X_DISPLAY_MISSING 1
+EOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    case "`(uname -sr) 2>/dev/null`" in
+    "SunOS 5"*)
+      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
+echo "configure:2456: checking whether -R must be followed by a space" >&5
+      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+      cat > conftest.$ac_ext <<EOF
+#line 2459 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_R_nospace=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_R_nospace=no
+fi
+rm -f conftest*
+      if test $ac_R_nospace = yes; then
+       echo "$ac_t""no" 1>&6
+       X_LIBS="$X_LIBS -R$x_libraries"
+      else
+       LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat > conftest.$ac_ext <<EOF
+#line 2482 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_R_space=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_R_space=no
+fi
+rm -f conftest*
+       if test $ac_R_space = yes; then
+         echo "$ac_t""yes" 1>&6
+         X_LIBS="$X_LIBS -R $x_libraries"
+       else
+         echo "$ac_t""neither works" 1>&6
+       fi
+      fi
+      LIBS="$ac_xsave_LIBS"
+    esac
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And karl@cs.umb.edu says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
+echo "configure:2521: checking for dnet_ntoa in -ldnet" >&5
+ac_lib_var=`echo dnet'_'dnet_ntoa | 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="-ldnet  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2529 "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 dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:2540: \"$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
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
+echo "configure:2562: checking for dnet_ntoa in -ldnet_stub" >&5
+ac_lib_var=`echo dnet_stub'_'dnet_ntoa | 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="-ldnet_stub  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2570 "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 dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:2581: \"$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
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to dickey@clark.net.
+    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
+echo "configure:2610: checking for gethostbyname" >&5
+if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2615 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname(); below.  */
+#include <assert.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 gethostbyname();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+gethostbyname();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_gethostbyname=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_gethostbyname=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_gethostbyname = no; then
+      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:2659: checking for gethostbyname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostbyname | 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="-lnsl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2667 "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 gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:2678: \"$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
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says simon@lia.di.epfl.ch: it contains
+    # gethostby* variants that don't use the nameserver (or something).
+    # -lsocket must be given before -lnsl if both are needed.
+    # We assume that if connect needs -lnsl, so does gethostbyname.
+    echo $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:2708: checking for connect" >&5
+if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2713 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect(); below.  */
+#include <assert.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 connect();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+connect();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_connect=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_connect=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_connect = no; then
+      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+echo "configure:2757: checking for connect in -lsocket" >&5
+ac_lib_var=`echo socket'_'connect | 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="-lsocket $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2765 "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 connect();
+
+int main() {
+connect()
+; return 0; }
+EOF
+if { (eval echo configure:2776: \"$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
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
+    echo $ac_n "checking for remove""... $ac_c" 1>&6
+echo "configure:2800: checking for remove" >&5
+if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2805 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove(); below.  */
+#include <assert.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 remove();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_remove) || defined (__stub___remove)
+choke me
+#else
+remove();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_remove=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_remove=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_remove = no; then
+      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
+echo "configure:2849: checking for remove in -lposix" >&5
+ac_lib_var=`echo posix'_'remove | 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="-lposix  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2857 "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 remove();
+
+int main() {
+remove()
+; return 0; }
+EOF
+if { (eval echo configure:2868: \"$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
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    echo $ac_n "checking for shmat""... $ac_c" 1>&6
+echo "configure:2892: checking for shmat" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2897 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat(); below.  */
+#include <assert.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 shmat();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shmat) || defined (__stub___shmat)
+choke me
+#else
+shmat();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test $ac_cv_func_shmat = no; then
+      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
+echo "configure:2941: checking for shmat in -lipc" >&5
+ac_lib_var=`echo ipc'_'shmat | 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="-lipc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2949 "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 shmat();
+
+int main() {
+shmat()
+; return 0; }
+EOF
+if { (eval echo configure:2960: \"$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
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS="$LDFLAGS"
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
+echo "configure:2993: checking for IceConnectionNumber in -lICE" >&5
+ac_lib_var=`echo ICE'_'IceConnectionNumber | 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="-lICE $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3001 "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 IceConnectionNumber();
+
+int main() {
+IceConnectionNumber()
+; return 0; }
+EOF
+if { (eval echo configure:3012: \"$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
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  LDFLAGS="$ac_save_LDFLAGS"
+
+fi
+
+if test "$no_x" = yes; then
+  XLIBS=NONE
+else
+  if test -n "${x_includes}"; then
+    XLOCKINC="-I${x_includes} ${XLOCKINC}"
+    XMLOCKINC="-I${x_includes} ${XMLOCKINC}"
+    if test "${CXX}" = "g++" ; then
+       XLOCKINC="-isystem ${x_includes} ${XLOCKINC}"
+       XMLOCKINC="-isystem ${x_includes} ${XMLOCKINC}"
+    fi
+  fi
+  XLIBS="${x_libraries}"
+  if test -n "${x_libraries}"; then
+    XLOCK_LDFLAGS="/usr/lib:${x_libraries}"
+    XMLOCK_LDFLAGS="/usr/lib:${x_libraries}"
+    XLOCKLIBPATHS="-L${x_libraries} ${XLOCKLIBPATHS}"
+    XMLOCKLIBPATHS="-L${x_libraries} ${XMLOCKLIBPATHS}"
+  fi
+  XLOCKLIBS="${X_PRE_LIBS} ${X_EXTRA_LIBS} ${XLOCKLIBS}"
+  case "${canonical}" in
+    *-*-sco* )
+      XLOCKLIBS="${X_PRE_LIBS} ${XLOCKLIBS} ${X_EXTRA_LIBS}"
+    ;;
+  esac
+  XMLOCKLIBS="-lXt ${XMLOCKLIBS}"
+#  if you need regex and regcmp
+#  XMLOCKLIBS="-lXt ${XMLOCKLIBS} -lgen"
+fi
+
+# Try and find the app-defaults directory.
+
+
+
+
+
+
+
+
+    echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
+echo "configure:3075: checking for X app-defaults directory" >&5
+if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+  rm -fr conftestdir
+  if mkdir conftestdir; then
+    cd conftestdir
+    # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+    cat > Imakefile <<'EOF'
+acfindx:
+  @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
+EOF
+    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+      # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
+      eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    fi
+    cd ..
+    rm -fr conftestdir
+  fi
+        # Look for the directory under a standard set of common directories.
+  # Check X11 before X11Rn because it's often a symlink to the current release.
+  for ac_dir in         \
+    /lib/X11/app-defaults \
+    /lib/app-defaults \
+    /lib/X11R6.5.1/app-defaults \
+    /lib/X11R6.5.1/X11/app-defaults \
+    /lib/X11R6.4/app-defaults \
+    /lib/X11R6.4/X11/app-defaults \
+    /lib/X11R6.3/app-defaults \
+    /lib/X11R6.3/X11/app-defaults \
+    /lib/X11R6.2/app-defaults \
+    /lib/X11R6.2/X11/app-defaults \
+    /lib/X11R6.1/app-defaults \
+    /lib/X11R6.1/X11/app-defaults \
+    /lib/X11R6/app-defaults \
+    /lib/X11R6/X11/app-defaults \
+    /lib/X11R5/app-defaults \
+    /lib/X11R5/X11/app-defaults \
+    /lib/X11R4/app-defaults \
+    /lib/X11R4/X11/app-defaults \
+    ; \
+  do
+    found=""
+    if test -d "${prefix}$ac_dir"; then
+      ac_x_app_defaults=\\\$\\\{prefix\\\}$ac_dir
+    found="1"
+      break
+    fi
+  done
+  if test -z "$found"; then
+  for ac_dir in         \
+    /usr/X11/lib/app-defaults     \
+    /lib/X11R6.5.1/lib/app-defaults \
+    /lib/X11R6.5.1/lib/X11/app-defaults \
+    /lib/X11R6.4/lib/app-defaults \
+    /lib/X11R6.4/lib/X11/app-defaults \
+    /usr/X11R6.3/lib/app-defaults     \
+    /usr/X11R6.3/lib/X11/app-defaults   \
+    /usr/X11R6.2/lib/app-defaults     \
+    /usr/X11R6.2/lib/X11/app-defaults   \
+    /usr/X11R6.1/lib/app-defaults     \
+    /usr/X11R6.1/lib/X11/app-defaults   \
+    /usr/X11R6/lib/app-defaults     \
+    /usr/X11R6/lib/X11/app-defaults   \
+    /usr/X11R5/lib/app-defaults     \
+    /usr/X11R5/lib/X11/app-defaults   \
+    /usr/X11R4/lib/app-defaults     \
+    /usr/X11R4/lib/X11/app-defaults   \
+            \
+    /usr/lib/X11/app-defaults     \
+    /usr/lib/X11R6.5.1/app-defaults \
+    /usr/lib/X11R6.4/app-defaults \
+    /usr/lib/X11R6.3/app-defaults     \
+    /usr/lib/X11R6.2/app-defaults     \
+    /usr/lib/X11R6.1/app-defaults     \
+    /usr/lib/X11R6/app-defaults     \
+    /usr/lib/X11R5/app-defaults     \
+    /usr/lib/X11R4/app-defaults     \
+            \
+    /usr/local/X11/lib/app-defaults   \
+    /usr/remote/X11/lib/app-defaults   \
+    /usr/local/X11R6.5.1/lib/app-defaults   \
+    /usr/local/X11R6.5.1/lib/X11/app-defaults   \
+    /usr/local/X11R6.4/lib/app-defaults   \
+    /usr/local/X11R6.4/lib/X11/app-defaults   \
+    /usr/local/X11R6.3/lib/app-defaults   \
+    /usr/local/X11R6.3/lib/X11/app-defaults   \
+    /usr/local/X11R6.2/lib/app-defaults   \
+    /usr/local/X11R6.2/lib/X11/app-defaults   \
+    /usr/local/X11R6.1/lib/app-defaults   \
+    /usr/local/X11R6.1/lib/X11/app-defaults   \
+    /usr/local/X11R6/lib/app-defaults   \
+    /usr/local/X11R6/lib/X11/app-defaults   \
+    /usr/local/X11R5/lib/app-defaults   \
+    /usr/local/X11R5/lib/X11/app-defaults   \
+    /usr/local/X11R4/lib/app-defaults   \
+    /usr/local/X11R4/lib/X11/app-defaults   \
+            \
+    /usr/local/lib/X11/app-defaults   \
+    /usr/remote/lib/X11/app-defaults   \
+    /usr/local/lib/X11R6.5.1/app-defaults   \
+    /usr/local/lib/X11R6.5.1/X11/app-defaults \
+    /usr/local/lib/X11R6.4/app-defaults   \
+    /usr/local/lib/X11R6.4/X11/app-defaults \
+    /usr/local/lib/X11R6.3/app-defaults   \
+    /usr/local/lib/X11R6.3/X11/app-defaults \
+    /usr/local/lib/X11R6.2/app-defaults   \
+    /usr/local/lib/X11R6.2/X11/app-defaults \
+    /usr/local/lib/X11R6.1/app-defaults   \
+    /usr/local/lib/X11R6.1/X11/app-defaults \
+    /usr/local/lib/X11R6/app-defaults   \
+    /usr/local/lib/X11R6/X11/app-defaults \
+    /usr/local/lib/X11R5/app-defaults   \
+    /usr/local/lib/X11R5/X11/app-defaults \
+    /usr/local/lib/X11R4/app-defaults   \
+    /usr/local/lib/X11R4/X11/app-defaults \
+            \
+    /usr/X386/lib/X11/app-defaults    \
+    /usr/x386/lib/X11/app-defaults    \
+    /usr/XFree86/lib/X11/app-defaults   \
+            \
+    /usr/lib/X11/app-defaults     \
+    /usr/unsupported/lib/X11/app-defaults \
+    /usr/athena/lib/X11/app-defaults    \
+    /usr/local/x11r5/lib/X11/app-defaults \
+    /usr/lpp/Xamples/lib/X11/app-defaults \
+    /lib/usr/lib/X11/app-defaults   \
+    /usr/local/lib/app-defaults   \
+    /usr/remote/lib/app-defaults   \
+            \
+    /usr/openwin/lib/app-defaults   \
+    /usr/openwin/lib/X11/app-defaults   \
+    /usr/openwin/share/lib/app-defaults   \
+    /usr/openwin/share/lib/X11/app-defaults \
+            \
+    /X11R6.5.1/lib/app-defaults   \
+    /X11R6.4/lib/app-defaults     \
+    /X11R6.3/lib/app-defaults     \
+    /X11R6.2/lib/app-defaults     \
+    /X11R6.1/lib/app-defaults     \
+    /X11R6/lib/app-defaults     \
+    /X11R5/lib/app-defaults     \
+    /X11R4/lib/app-defaults     \
+    ; \
+  do
+    if test -d "$ac_dir"; then
+      ac_x_app_defaults=$ac_dir
+      break
+    fi
+  done
+    fi
+
+      if test x"$ac_x_app_defaults" = x; then
+        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
+      else
+        # Record where we found app-defaults for the cache.
+        ac_cv_x_app_defaults="$ac_x_app_defaults"
+      fi
+fi
+
+echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
+    eval ac_x_app_defaults="$ac_cv_x_app_defaults"
+
+APPDEFAULTS=$ac_x_app_defaults
+
+# Check whether --with-includes or --without-includes was given.
+if test "${with_includes+set}" = set; then
+  withval="$with_includes"
+  :
+fi
+
+case "x$withval" in
+x/*|x.*)
+  extra_include=$withval
+  echo "$ac_t""adding $extra_include to include search path for following packages" 1>&6
+  if test ! -d $extra_include; then
+    echo "$ac_t""Warning: Directory $extra_include does not exist" 1>&6
+  fi
+  ;;
+*)
+  extra_include=""
+  ;;
+esac
+
+# Check whether --with-libraries or --without-libraries was given.
+if test "${with_libraries+set}" = set; then
+  withval="$with_libraries"
+  :
+fi
+
+case "x$withval" in
+x/*|x.*)
+  extra_lib=$withval
+  echo "$ac_t""adding $extra_lib to library search path for following packages" 1>&6
+  if test ! -d $extra_lib; then
+    echo "$ac_t""Warning: Directory $extra_lib does not exist" 1>&6
+  fi
+  ;;
+*)
+  extra_lib=""
+  ;;
+esac
+
+
+
+
+
+
+motif_includes=NONE
+motif_libraries=NONE
+
+echo $ac_n "checking for Motif""... $ac_c" 1>&6
+echo "configure:3288: checking for Motif" >&5
+# Check whether --with-motif or --without-motif was given.
+if test "${with_motif+set}" = set; then
+  withval="$with_motif"
+  :
+fi
+
+if test "x$with_motif" = xno; then
+  no_motif=yes
+else
+  if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
+    no_motif=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_motif'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_motif=yes
+test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
+test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
+test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
+  for ac_dir in               \
+    /usr/include/Motif1.2     \
+    /usr/Motif1.2/include     \
+                              \
+    /usr/motif/include        \
+                              \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X11/include          \
+    /usr/include/X11          \
+    /usr/local/X11/include    \
+    /usr/local/include/X11    \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/dt/include           \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$motif_direct_test_include"; then
+      no_motif= ac_motif_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$motif_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
+    /usr/lib/Motif1.2     \
+    /usr/Motif1.2/lib     \
+                          \
+    /usr/motif/lib        \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X11/lib          \
+    /usr/lib/X11          \
+    /usr/local/X11/lib    \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
+      no_motif= ac_motif_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_motif" = yes; then
+  ac_cv_path_motif="no_motif=yes"
+else
+  ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_motif"
+fi # with_motif != no
+
+if test "$no_motif" = yes; then
+  echo "$ac_t""no" 1>&6
+  XMLOCK=""
+  INSTALL_XMLOCK=""
+  UNINSTALL_XMLOCK=""
+else
+  XMLOCKLIBS="-lXm ${XMLOCKLIBS}"
+  XMLOCK="xmlock"
+  INSTALL_XMLOCK="install_xmlock"
+  UNINSTALL_XMLOCK="uninstall_xmlock"
+  test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
+  test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
+  ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
+  echo "$ac_t""libraries $motif_libraries, headers $motif_includes" 1>&6
+fi
+
+
+if test "x$motif_libraries" != x && test "x$motif_libraries" != xNONE ; then
+  XMLOCK_LDFLAGS="${XMLOCK_LDFLAGS}:$motif_libraries"
+  XMLOCKLIBPATHS="${XMLOCKLIBPATHS} -L$motif_libraries"
+fi
+if test "x$motif_includes" != x && test "x$motif_includes" != xNONE ; then
+  XMLOCKINC="${XMLOCKINC} -I$motif_includes"
+fi
+
+
+
+
+
+
+editres_includes=NONE
+editres_libraries=NONE
+
+echo $ac_n "checking for Editres""... $ac_c" 1>&6
+echo "configure:3497: checking for Editres" >&5
+# Check whether --with-editres or --without-editres was given.
+if test "${with_editres+set}" = set; then
+  withval="$with_editres"
+  :
+fi
+
+if test "x$with_editres" = xno; then
+  no_editres=yes
+else
+  if test "x$editres_includes" != xNONE && test "x$editres_libraries" != xNONE; then
+    no_editres=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_editres'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_editres=yes
+test -z "$editres_direct_test_library" && editres_direct_test_library=Xmu
+test -z "$editres_direct_test_function" && editres_direct_test_function=_XEditResCheckMessages
+test -z "$editres_direct_test_include" && editres_direct_test_include=X11/Xmu/Editres.h
+  for ac_dir in               \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include      \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$editres_direct_test_include"; then
+      no_editres= ac_editres_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$editres_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_editres_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${editres_direct_test_library}.$ac_extension; then
+      no_editres= ac_editres_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_editres" = yes; then
+  ac_cv_path_editres="no_editres=yes"
+else
+  ac_cv_path_editres="no_editres= ac_editres_includes=$ac_editres_includes ac_editres_libraries=$ac_editres_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_editres"
+fi # with_editres != no
+
+if test "$no_editres" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+  cat >> confdefs.h <<\EOF
+#define USE_XMU 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lXmu"
+  XMLOCKLIBS="-lXmu ${XMLOCKLIBS}"
+  test "x$editres_includes" = xNONE && editres_includes=$ac_editres_includes
+  test "x$editres_libraries" = xNONE && editres_libraries=$ac_editres_libraries
+  ac_cv_path_editres="no_editres= ac_editres_includes=$editres_includes ac_editres_libraries=$editres_libraries"
+  echo "$ac_t""libraries $editres_libraries, headers $editres_includes" 1>&6
+fi
+
+
+if test "x$editres_libraries" != x && test "x$editres_libraries" != xNONE ; then
+  XMLOCK_LDFLAGS="${XMLOCK_LDFLAGS}:$editres_libraries"
+  XMLOCKLIBPATHS="${XMLOCKLIBPATHS} -L$editres_libraries"
+fi
+if test "x$editres_includes" != x && test "x$editres_includes" != xNONE ; then
+  XMLOCKINC="${XMLOCKINC} -I$editres_includes"
+fi
+
+xpm=no
+
+
+
+
+
+xpm_includes=NONE
+xpm_libraries=NONE
+
+echo $ac_n "checking for XPM""... $ac_c" 1>&6
+echo "configure:3701: checking for XPM" >&5
+# Check whether --with-xpm or --without-xpm was given.
+if test "${with_xpm+set}" = set; then
+  withval="$with_xpm"
+  :
+fi
+
+if test "x$with_xpm" = xno; then
+  no_xpm=yes
+else
+  if test "x$xpm_includes" != xNONE && test "x$xpm_libraries" != xNONE; then
+    no_xpm=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_xpm'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_xpm=yes
+test -z "$xpm_direct_test_library" && xpm_direct_test_library=Xpm
+test -z "$xpm_direct_test_function" && xpm_direct_test_function=XpmCreateImageFromData
+test -z "$xpm_direct_test_include" && xpm_direct_test_include=xpm.h
+  for ac_dir in                   \
+    /usr/X11R6.5.1/include/X11    \
+    /usr/X11R6.4/include/X11      \
+    /usr/X11R6.3/include/X11      \
+    /usr/X11R6.2/include/X11      \
+    /usr/X11R6.1/include/X11      \
+    /usr/X11R6/include/X11        \
+    /usr/X11R5/include/X11        \
+    /usr/X11R4/include/X11        \
+    /usr/X11/include/X11          \
+                                  \
+    /usr/include/X11/X11          \
+    /usr/include/X11R6.5.1/X11    \
+    /usr/include/X11R6.4/X11      \
+    /usr/include/X11R6.3/X11      \
+    /usr/include/X11R6.2/X11      \
+    /usr/include/X11R6.1/X11      \
+    /usr/include/X11R6/X11        \
+    /usr/include/X11R5/X11        \
+    /usr/include/X11R4/X11        \
+                                  \
+    /usr/local/X11/include/X11    \
+    /usr/local/X11R6.5.1/include/X11  \
+    /usr/local/X11R6.4/include/X11  \
+    /usr/local/X11R6.3/include/X11  \
+    /usr/local/X11R6.2/include/X11  \
+    /usr/local/X11R6.1/include/X11  \
+    /usr/local/X11R6/include/X11  \
+    /usr/local/X11R5/include/X11  \
+    /usr/local/X11R4/include/X11  \
+                                  \
+    /usr/local/include/X11/X11    \
+    /usr/local/include/X11R6.5.1/X11  \
+    /usr/local/include/X11R6.4/X11  \
+    /usr/local/include/X11R6.3/X11  \
+    /usr/local/include/X11R6.2/X11  \
+    /usr/local/include/X11R6.1/X11  \
+    /usr/local/include/X11R6/X11  \
+    /usr/local/include/X11R5/X11  \
+    /usr/local/include/X11R4/X11  \
+                                  \
+    /usr/X386/include/X11         \
+    /usr/x386/include/X11         \
+    /usr/XFree86/include/X11/X11  \
+                                  \
+    /usr/local/include/X11        \
+    /usr/remote/include/X11       \
+    /usr/include/X11              \
+    /usr/unsupported/include/X11  \
+    /usr/athena/include/X11       \
+    /usr/local/x11r5/include/X11  \
+    /usr/lpp/Xamples/include/X11  \
+                                  \
+    /usr/openwin/include/X11      \
+    /usr/openwin/share/include/X11 \
+    /usr/openwin/include          \
+                                  \
+    /usr/include/Vk               \
+    $extra_include                \
+    $extra_include/X11            \
+    ; \
+  do
+    if test -r "$ac_dir/$xpm_direct_test_include"; then
+      no_xpm= ac_xpm_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$xpm_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_xpm_includes" | sed s%/X11$%% | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${xpm_direct_test_library}.$ac_extension; then
+      no_xpm= ac_xpm_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_xpm" = yes; then
+  ac_cv_path_xpm="no_xpm=yes"
+else
+  ac_cv_path_xpm="no_xpm= ac_xpm_includes=$ac_xpm_includes ac_xpm_libraries=$ac_xpm_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_xpm"
+fi # with_xpm != no
+
+if test "$no_xpm" = yes; then
+  echo "$ac_t""no" 1>&6
+  XPM="#"
+else
+  xpm=yes
+  cat >> confdefs.h <<\EOF
+#define USE_XPMINC 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lXpm"
+  XMLOCKLIBS="-lXpm ${XMLOCKLIBS}"
+  test "x$xpm_includes" = xNONE && xpm_includes=$ac_xpm_includes
+  test "x$xpm_libraries" = xNONE && xpm_libraries=$ac_xpm_libraries
+  ac_cv_path_xpm="no_xpm= ac_xpm_includes=$xpm_includes ac_xpm_libraries=$xpm_libraries"
+  echo "$ac_t""libraries $xpm_libraries, headers $xpm_includes" 1>&6
+  XPM=""
+fi
+
+
+if test "x$xpm_libraries" != x && test "x$xpm_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$xpm_libraries"
+  XMLOCK_LDFLAGS="${XMLOCK_LDFLAGS}:$xpm_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$xpm_libraries"
+  XMLOCKLIBPATHS="${XMLOCKLIBPATHS} -L$xpm_libraries"
+fi
+if test "x$xpm_includes" != x && test "x$xpm_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$xpm_includes"
+fi
+
+gltt=no
+
+
+
+
+
+gltt_includes=NONE
+gltt_libraries=NONE
+
+echo $ac_n "checking for GLTT""... $ac_c" 1>&6
+echo "configure:3909: checking for GLTT" >&5
+# Check whether --with-gltt or --without-gltt was given.
+if test "${with_gltt+set}" = set; then
+  withval="$with_gltt"
+  :
+fi
+
+if test "x$with_gltt" = xno; then
+  no_gltt=yes
+else
+  if test "x$gltt_includes" != xNONE && test "x$gltt_libraries" != xNONE; then
+    no_gltt=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_gltt'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_gltt=yes
+test -z "$gltt_direct_test_library" && gltt_direct_test_library=gltt
+# test -z "$gltt_direct_test_function" && gltt_direct_test_function=glttCreateImageFromData
+test -z "$gltt_direct_test_include" && gltt_direct_test_include=gltt/GLTTFont.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    /usr/openwin/include      \
+                              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$gltt_direct_test_include"; then
+      no_gltt= ac_gltt_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$gltt_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_gltt_includes" | sed s%/X11$%% | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${gltt_direct_test_library}.$ac_extension; then
+      no_gltt= ac_gltt_libraries=$ac_dir
+      break 2
+   fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_gltt" = yes; then
+  ac_cv_path_gltt="no_gltt=yes"
+else
+  ac_cv_path_gltt="no_gltt= ac_gltt_includes=$ac_gltt_includes ac_gltt_libraries=$ac_gltt_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_gltt"
+fi # with_gltt != no
+
+if test "$no_gltt" = yes; then
+  echo "$ac_t""no" 1>&6
+  GLTT="#"
+else
+  gltt=yes
+  cat >> confdefs.h <<\EOF
+#define HAVE_GLTT 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lgltt"
+  test "x$gltt_includes" = xNONE && gltt_includes=$ac_gltt_includes
+  test "x$gltt_libraries" = xNONE && gltt_libraries=$ac_gltt_libraries
+  ac_cv_path_gltt="no_gltt= ac_gltt_includes=$gltt_includes ac_gltt_libraries=$gltt_libraries"
+  echo "$ac_t""libraries $gltt_libraries, headers $gltt_includes" 1>&6
+  GLTT=""
+fi
+
+
+if test "x$gltt_libraries" != x && test "x$gltt_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$gltt_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$gltt_libraries"
+fi
+if test "x$gltt_includes" != x && test "x$gltt_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$gltt_includes"
+fi
+
+ttf=no
+
+
+
+
+
+ttf_includes=NONE
+ttf_libraries=NONE
+
+echo $ac_n "checking for TTF""... $ac_c" 1>&6
+echo "configure:4112: checking for TTF" >&5
+# Check whether --with-ttf or --without-ttf was given.
+if test "${with_ttf+set}" = set; then
+  withval="$with_ttf"
+  :
+fi
+
+if test "x$with_ttf" = xno; then
+  no_ttf=yes
+else
+  if test "x$ttf_includes" != xNONE && test "x$ttf_libraries" != xNONE; then
+    no_ttf=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_ttf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_ttf=yes
+test -z "$ttf_direct_test_library" && ttf_direct_test_library=ttf
+test -z "$ttf_direct_test_function" && ttf_direct_test_function=TT_Init_FreeType
+test -z "$ttf_direct_test_include" && ttf_direct_test_include=gltt/FTFace.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include/X11          \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    /usr/openwin/include      \
+                              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$ttf_direct_test_include"; then
+      no_ttf= ac_ttf_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$ttf_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_ttf_includes" | sed s%/X11$%% | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${ttf_direct_test_library}.$ac_extension; then
+      no_ttf= ac_ttf_libraries=$ac_dir
+      break 2
+   fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_ttf" = yes; then
+  ac_cv_path_ttf="no_ttf=yes"
+else
+  ac_cv_path_ttf="no_ttf= ac_ttf_includes=$ac_ttf_includes ac_ttf_libraries=$ac_ttf_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_ttf"
+fi # with_ttf != no
+
+if test "$no_ttf" = yes; then
+  echo "$ac_t""no" 1>&6
+  TTF="#"
+else
+  ttf=yes
+  cat >> confdefs.h <<\EOF
+#define HAVE_TTF 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lttf"
+  test "x$ttf_includes" = xNONE && ttf_includes=$ac_ttf_includes
+  test "x$ttf_libraries" = xNONE && ttf_libraries=$ac_ttf_libraries
+  ac_cv_path_ttf="no_ttf= ac_ttf_includes=$ttf_includes ac_ttf_libraries=$ttf_libraries"
+  echo "$ac_t""libraries $ttf_libraries, headers $ttf_includes" 1>&6
+  TTF=""
+fi
+
+
+if test "x$ttf_libraries" != x && test "x$ttf_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$ttf_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$ttf_libraries"
+fi
+if test "x$ttf_includes" != x && test "x$ttf_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$ttf_includes"
+fi
+
+gl=no
+
+
+
+
+
+opengl_includes=NONE
+opengl_libraries=NONE
+
+echo $ac_n "checking for OpenGL""... $ac_c" 1>&6
+echo "configure:4315: checking for OpenGL" >&5
+echo "$ac_t""OK if OpenGL found is really Mesa" 1>&6
+# Check whether --with-opengl or --without-opengl was given.
+if test "${with_opengl+set}" = set; then
+  withval="$with_opengl"
+  :
+fi
+
+if test "x$with_opengl" = xno; then
+  no_opengl=yes
+else
+  if test "x$opengl_includes" != xNONE && test "x$opengl_libraries" != xNONE; then
+    no_opengl=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_opengl'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_opengl=yes
+test -z "$opengl_direct_test_library" && opengl_direct_test_library=GL
+test -z "$opengl_direct_test_library" && opengl_direct_test_library=GLU
+test -z "$opengl_direct_test_function" && opengl_direct_test_function=glXCreateContext
+test -z "$opengl_direct_test_include" && opengl_direct_test_include=GL/gl.h
+  for ac_dir in               \
+    /usr/include              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+                              \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/unsupported/include  \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$opengl_direct_test_include"; then
+      no_opengl= ac_opengl_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$opengl_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_opengl_includes" | sed s/include/lib/` \
+                          \
+    /usr/lib              \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+# Make sure its not a symbolic link to MesaGL library
+
+    if test -r $ac_dir/lib${opengl_direct_test_library}.$ac_extension && test ! $ac_link_test $ac_dir/lib${opengl_direct_test_library}.$ac_extension && test ! -r $ac_dir/libMesa${opengl_direct_test_library}.$ac_extension; then
+      no_opengl= ac_opengl_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_opengl" = yes; then
+  ac_cv_path_opengl="no_opengl=yes"
+else
+  ac_cv_path_opengl="no_opengl= ac_opengl_includes=$ac_opengl_includes ac_opengl_libraries=$ac_opengl_libraries"
+
+fi
+fi
+  fi
+  eval "$ac_cv_path_opengl"
+fi # with_opengl != no
+
+if test "$no_opengl" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+  gl=yes
+  cat >> confdefs.h <<\EOF
+#define USE_GL 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lGL -lGLU"
+  test "x$opengl_includes" = xNONE && opengl_includes=$ac_opengl_includes
+  test "x$opengl_libraries" = xNONE && opengl_libraries=$ac_opengl_libraries
+  case "${canonical}" in
+    *-*-solaris2* )
+      cat >> confdefs.h <<\EOF
+#define SUN_OGL_NO_VERTEX_MACROS 1
+EOF
+
+      if test "x$opengl_includes" = "x/usr/include"; then
+        opengl_includes=""
+      fi
+    ;;
+    *-*-irix5* | *-*-irix6* )
+      XLOCKLIBS="${XLOCKLIBS} -lgl"
+    ;;
+  esac
+  ac_cv_path_opengl="no_opengl= ac_opengl_includes=$opengl_includes ac_opengl_libraries=$opengl_libraries"
+  echo "$ac_t""libraries $opengl_libraries, headers $opengl_includes" 1>&6
+  GL=""
+fi
+
+
+if test "x$opengl_libraries" != x && test "x$opengl_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$opengl_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$opengl_libraries"
+fi
+if test "x$opengl_includes" != x && test "x$opengl_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$opengl_includes"
+fi
+
+
+
+
+
+
+mesa_includes=NONE
+mesa_libraries=NONE
+
+echo $ac_n "checking for Mesa""... $ac_c" 1>&6
+echo "configure:4531: checking for Mesa" >&5
+# Check whether --with-mesa or --without-mesa was given.
+if test "${with_mesa+set}" = set; then
+  withval="$with_mesa"
+  :
+fi
+
+if test "x$with_mesa" = xno; then
+  no_mesa=yes
+else
+  if test "x$mesa_includes" != xNONE && test "x$mesa_libraries" != xNONE; then
+    no_mesa=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_mesa'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_mesa=yes
+test -z "$mesa_direct_test_library" && mesa_direct_test_library=MesaGL
+test -z "$mesa_direct_test_library" && mesa_direct_test_library=MesaGLU
+test -z "$mesa_direct_test_function" && mesa_direct_test_function=glXCreateContext
+test -z "$mesa_direct_test_include" && mesa_direct_test_include=GL/gl.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$mesa_direct_test_include"; then
+      no_mesa= ac_mesa_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$mesa_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_mesa_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${mesa_direct_test_library}.$ac_extension; then
+      no_mesa= ac_mesa_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_mesa" = yes; then
+  ac_cv_path_mesa="no_mesa=yes"
+else
+  ac_cv_path_mesa="no_mesa= ac_mesa_includes=$ac_mesa_includes ac_mesa_libraries=$ac_mesa_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_mesa"
+fi # with_mesa != no
+
+if test "$no_mesa" = yes; then
+  echo "$ac_t""no" 1>&6
+  GL="#"
+else
+  if test "$gl" = no; then
+    gl=yes
+    cat >> confdefs.h <<\EOF
+#define USE_GL 1
+EOF
+
+    XLOCKLIBS="${XLOCKLIBS} -lMesaGL -lMesaGLU"
+    test "x$mesa_includes" = xNONE && mesa_includes=$ac_mesa_includes
+    test "x$mesa_libraries" = xNONE && mesa_libraries=$ac_mesa_libraries
+    case "${canonical}" in
+      *-*-solaris2* )
+        if test "x$mesa_includes" = "x/usr/include"; then
+          mesa_includes=""
+        fi
+      ;;
+    esac
+    ac_cv_path_mesa="no_mesa= ac_mesa_includes=$mesa_includes ac_mesa_libraries=$mesa_libraries"
+    echo "$ac_t""libraries $mesa_libraries, headers $mesa_includes" 1>&6
+    # Issue a warning if the version number of Mesa is less than 3.0 since
+    # 2.6 and earlier had a security bug and 2.2 and earlier had memory leaks.
+    # pre-3.4 Mesa will core dump with the -showfps option. A patch must be
+    # applied to 3.4 and 3.4.1 Mesa to correct a memory leak in the molecule
+    # mode and the -showfps option. This memory leak is fixed in Mesa 3.4.2
+    echo $ac_n "checking Mesa version number""... $ac_c" 1>&6
+echo "configure:4721: checking Mesa version number" >&5
+if eval "test \"`echo '$''{'ac_cv_mesa_version_string'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4726 "configure"
+#include "confdefs.h"
+#include <GL/xmesa.h>
+configure: XMESA_MAJOR_VERSION XMESA_MINOR_VERSION
+EOF
+         ac_save_CPPFLAGS="$CPPFLAGS"
+         if test \! -z "$ac_mesa_includes" ; then
+           CPPFLAGS="$CPPFLAGS -I$ac_mesa_includes"
+         fi
+         CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+         
+         mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
+              's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
+         
+
+         rm -f conftest.$ac_ext
+
+         CPPFLAGS="$ac_save_CPPFLAGS"
+
+         if test "$mglv" = ""; then
+           ac_mesa_version=unknown
+           ac_mesa_version_string=unknown
+         else
+           ac_mesa_version_string=$mglv
+           maj=`echo $mglv | sed -n 's/\..*//p'`
+           min=`echo $mglv | sed -n 's/.*\.//p'`
+           ac_mesa_version=`echo "$maj * 1000 + $min" | bc`
+           if test -z "$ac_mesa_version"; then
+             ac_mesa_version=unknown
+             ac_mesa_version_string=unknown
+           fi
+         fi
+         ac_cv_mesa_version=$ac_mesa_version
+         ac_cv_mesa_version_string=$ac_mesa_version_string
+      
+fi
+
+echo "$ac_t""$ac_cv_mesa_version_string" 1>&6 
+    ac_mesa_version=$ac_cv_mesa_version
+    ac_mesa_version_string=$ac_cv_mesa_version_string
+    preferred_mesa="3.4.2"
+    if test "$ac_mesa_version" = unknown; then
+      echo "$ac_t""!!!WARNING!!! Unable to determine the Mesa version number!" 1>&6
+      echo "$ac_t""!!!WARNING!!! Make sure you are using Mesa version $preferred_mesa or newer." 1>&6
+    elif test \! "$ac_mesa_version" -gt 3004; then
+      echo "$ac_t""!!!WARNING!!! Mesa version $ac_mesa_version_string is being used." 1>&6
+      echo "$ac_t""!!!WARNING!!! Mesa versions 3.4.1 and earlier have a memory leak when using" 1>&6
+      echo "$ac_t""!!!WARNING!!! molecule mode or the -showfps option. This can be corrected by" 1>&6
+      echo "$ac_t""!!!WARNING!!! applying the Mesa.patch file to Mesa 3.4 or 3.4.1 using patch" 1>&6
+      echo "$ac_t""!!!WARNING!!! or by using Mesa 3.4.2 or newer." 1>&6
+      if test \! "$ac_mesa_version" -gt 3003; then
+        echo "$ac_t""!!!WARNING!!! Mesa version $ac_mesa_version_string is being used." 1>&6
+        echo "$ac_t""!!!WARNING!!! Mesa versions 3.3 and earlier will SEGV with the -showfps option." 1>&6
+        if test \! "$ac_mesa_version" -gt 2006; then
+          echo "$ac_t""!!!WARNING!!! Mesa versions 2.6 and earlier have a security bug." 1>&6
+          if test \! "$ac_mesa_version" -gt 2002; then
+            echo "$ac_t""!!!WARNING!!! Mesa versions 2.2 and earlier have memory leaks." 1>&6
+          fi
+        fi
+      fi
+      echo "$ac_t""!!!WARNING!!! It is strongly recommended that you upgrade to Mesa V$preferred_mesa or newer." 1>&6
+    fi
+
+    case "${canonical}" in
+      *-*-linux* )
+        # Testing if Mesa was compiled against VGA
+        if test -f $mesa_libraries/libMesaGL.so; then
+          have_mesa_svga=`nm $mesa_libraries/libMesaGL.so | grep SVGAMesa | wc -l`
+        else
+          have_mesa_svga=0
+        fi
+        if eval "test $have_mesa_svga -ge 1"; then
+          echo "$ac_t""Mesa library is linked against SVGA: adding -lvga" 1>&6
+          XLOCKLIBS="${XLOCKLIBS} -lvga"
+        fi
+        # Testing if Mesa was compiled against glide
+        if test -f $mesa_libraries/libMesaGL.so; then
+          have_mesa_glide=`nm $mesa_libraries/libMesaGL.so | grep grGlideInit | wc -l`
+        else
+          have_mesa_glide=0
+        fi
+        if eval "test $have_mesa_glide -ge 1"; then
+          echo "$ac_t""Mesa library is linked against GLIDE: adding -lglide2x" 1>&6
+          XLOCKLIBS="${XLOCKLIBS} -lglide2x"
+        fi
+#  Causes major errors for maintainer.  xlock refuses to run.
+#  I am not able to reproduce the problem ? What is it ?
+# Does a new glibc version fix this problem ?
+        # Testing if Mesa was compiled against pthread
+        if test -f $mesa_libraries/libMesaGL.so; then
+          have_mesa_pthread=`nm $mesa_libraries/libMesaGL.so | grep pthread_once | wc -l`
+        else
+          have_mesa_pthread=0
+        fi
+        if eval "test $have_mesa_pthread -ge 1"; then
+          echo "$ac_t""Mesa library is linked against PTHREAD: adding -lpthread" 1>&6
+          XLOCKLIBS="${XLOCKLIBS} -lpthread"
+        fi
+        ;;
+    esac
+    GL=""
+  else
+    echo "$ac_t""ignored - using OpenGL" 1>&6
+  fi
+
+fi
+
+
+if test "x$mesa_libraries" != x && test "x$mesa_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="$mesa_libraries:${XLOCK_LDFLAGS}"
+  XLOCKLIBPATHS="-L$mesa_libraries ${XLOCKLIBPATHS}"
+fi
+if test "x$mesa_includes" != x && test "x$mesa_includes" != xNONE ; then
+  XLOCKINC="-I$mesa_includes ${XLOCKINC}"
+fi
+
+# Test if Mesa or OpenGL has GL1.1 features
+# (Should this test be performed only if (Mesa)GL is used? In that case
+# it fails anyway.)
+echo $ac_n "checking for GL >=1.1""... $ac_c" 1>&6
+echo "configure:4846: checking for GL >=1.1" >&5
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="${CFLAGS} ${XLOCKINC}"
+LIBS="${XLOCKLIBPATHS} ${XLOCKLIBS} -lX11 -lXext -lm"
+if eval "test \"`echo '$''{'ac_cv_c_gl1_1'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 4856 "configure"
+#include "confdefs.h"
+#define _XOPEN_SOURCE 1
+#include <GL/gl.h>
+int main() {
+
+GLint texture;
+glBindTexture(GL_TEXTURE_2D, texture);
+
+; return 0; }
+EOF
+if { (eval echo configure:4867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_c_gl1_1=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_gl1_1=no
+fi
+rm -f conftest*
+fi
+
+    cat >> confdefs.h <<\EOF
+#define HAVE_GLBINDTEXTURE 1
+EOF
+
+    echo "$ac_t""yes" 1>&6
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+
+
+
+
+
+
+dtsaver_includes=NONE
+dtsaver_libraries=NONE
+
+echo $ac_n "checking for DtSaver""... $ac_c" 1>&6
+echo "configure:4896: checking for DtSaver" >&5
+# Check whether --with-dtsaver or --without-dtsaver was given.
+if test "${with_dtsaver+set}" = set; then
+  withval="$with_dtsaver"
+  :
+fi
+
+if test "x$with_dtsaver" = xno; then
+  no_dtsaver=yes
+else
+  if test "x$dtsaver_includes" != xNONE && test "x$dtsaver_libraries" != xNONE; then
+    no_dtsaver=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_dtsaver'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_dtsaver=yes
+test -z "$dtsaver_direct_test_library" && dtsaver_direct_test_library=DtSvc
+test -z "$dtsaver_direct_test_function" && dtsaver_direct_test_function=DtSaverGetWindows
+test -z "$dtsaver_direct_test_include" && dtsaver_direct_test_include=Dt/Saver.h
+  for ac_dir in            \
+    /usr/dt/include        \
+    $extra_include         \
+    ; \
+  do
+    if test -r "$ac_dir/$dtsaver_direct_test_include"; then
+      no_dtsaver= ac_dtsaver_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$dtsaver_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_dtsaver_includes" | sed s/include/lib/` \
+    $extra_lib         \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${dtsaver_direct_test_library}.$ac_extension; then
+      no_dtsaver= ac_dtsaver_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_dtsaver" = yes; then
+  ac_cv_path_dtsaver="no_dtsaver=yes"
+else
+  ac_cv_path_dtsaver="no_dtsaver= ac_dtsaver_includes=$ac_dtsaver_includes ac_dtsaver_libraries=$ac_dtsaver_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_dtsaver"
+fi # with_dtsaver != no
+
+if test "$no_dtsaver" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+  cat >> confdefs.h <<\EOF
+#define USE_DTSAVER 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lDtSvc"
+  test "x$dtsaver_includes" = xNONE && dtsaver_includes=$ac_dtsaver_includes
+  test "x$dtsaver_libraries" = xNONE && dtsaver_libraries=$ac_dtsaver_libraries
+  ac_cv_path_dtsaver="no_dtsaver= ac_dtsaver_includes=$dtsaver_includes ac_dtsaver_libraries=$dtsaver_libraries"
+  echo "$ac_t""libraries $dtsaver_libraries, headers $dtsaver_includes" 1>&6
+fi
+
+
+if test "x$dtsaver_libraries" != x && test "x$dtsaver_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$dtsaver_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$dtsaver_libraries"
+fi
+if test "x$dtsaver_includes" != x && test "x$dtsaver_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$dtsaver_includes"
+fi
+
+
+
+
+
+
+dpms_includes=NONE
+dpms_libraries=NONE
+
+echo $ac_n "checking for DPMS""... $ac_c" 1>&6
+echo "configure:4989: checking for DPMS" >&5
+# Check whether --with-dpms or --without-dpms was given.
+if test "${with_dpms+set}" = set; then
+  withval="$with_dpms"
+  :
+fi
+
+dpmslib=no
+if test "x$with_dpms" = xno; then
+  no_dpms=yes
+else
+  if test "x$dpms_includes" != xNONE && test "x$dpms_libraries" != xNONE; then
+    no_dpms=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_dpms'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_dpms=yes
+test -z "$dpms_direct_test_library" && dpms_direct_test_library=Xdpms
+test -z "$dpms_direct_test_function" && dpms_direct_test_function=DPMSSetTimeouts
+test -z "$dpms_direct_test_include" && dpms_direct_test_include=X11/extensions/dpms.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X11/include          \
+    /usr/include/X11          \
+    /usr/local/X11/include    \
+    /usr/local/include/X11    \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/dt/include           \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/dpms/include         \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$dpms_direct_test_include"; then
+      no_dpms= ac_dpms_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$dpms_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_dpms_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X11/lib          \
+    /usr/lib/X11          \
+    /usr/local/X11/lib    \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/dpms/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    /shlib                \
+    /usr/shlib            \
+    /usr/shlib/X11        \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${dpms_direct_test_library}.$ac_extension; then
+      no_dpms= ac_dpms_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_dpms" = yes; then
+  ac_cv_path_dpms="no_dpms=yes"
+else
+  ac_cv_path_dpms="no_dpms= ac_dpms_includes=$ac_dpms_includes ac_dpms_libraries=$ac_dpms_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_dpms"
+fi # with_dpms != no
+
+if test "$no_dpms" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+  cat >> confdefs.h <<\EOF
+#define USE_DPMS 1
+EOF
+
+  if test "x$ac_dpms_libraries" != x && test "x$ac_dpms_libraries" != xNONE ; then
+    XLOCKLIBS="${XLOCKLIBS} -lXdpms"
+  fi
+  test "x$dpms_includes" = xNONE && dpms_includes=$ac_dpms_includes
+  test "x$dpms_libraries" = xNONE && dpms_libraries=$ac_dpms_libraries
+  ac_cv_path_dpms="no_dpms= ac_dpms_includes=$dpms_includes ac_dpms_libraries=$dpms_libraries"
+  echo "$ac_t""libraries $dpms_libraries, headers $dpms_includes" 1>&6
+fi
+
+
+if test "x$dpms_libraries" != x && test "x$dpms_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$dpms_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$dpms_libraries"
+fi
+if test "x$dpms_includes" != x && test "x$dpms_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$dpms_includes"
+fi
+
+sound=none
+
+
+
+
+
+rplay_includes=NONE
+rplay_libraries=NONE
+
+echo $ac_n "checking for RPLAY""... $ac_c" 1>&6
+echo "configure:5200: checking for RPLAY" >&5
+# Check whether --with-rplay or --without-rplay was given.
+if test "${with_rplay+set}" = set; then
+  withval="$with_rplay"
+  :
+fi
+
+if test "x$with_rplay" = xno; then
+  no_rplay=yes
+else
+  if test "x$rplay_includes" != xNONE && test "x$rplay_libraries" != xNONE; then
+    no_rplay=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_rplay'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_rplay=yes
+test -z "$rplay_direct_test_library" && rplay_direct_test_library=rplay
+test -z "$rplay_direct_test_function" && rplay_direct_test_function=rplay_open_default
+test -z "$rplay_direct_test_include" && rplay_direct_test_include=rplay.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$rplay_direct_test_include"; then
+      no_rplay= ac_rplay_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$rplay_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_rplay_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11/lib          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${rplay_direct_test_library}.$ac_extension; then
+      no_rplay= ac_rplay_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_rplay" = yes; then
+  ac_cv_path_rplay="no_rplay=yes"
+else
+  ac_cv_path_rplay="no_rplay= ac_rplay_includes=$ac_rplay_includes ac_rplay_libraries=$ac_rplay_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_rplay"
+fi # with_rplay != no
+
+if test "$no_rplay" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+    sound=rplay
+    cat >> confdefs.h <<\EOF
+#define USE_RPLAY 1
+EOF
+
+    XLOCKLIBS="${XLOCKLIBS} -lrplay"
+    test "x$rplay_includes" = xNONE && rplay_includes=$ac_rplay_includes
+    test "x$rplay_libraries" = xNONE && rplay_libraries=$ac_rplay_libraries
+    ac_cv_path_rplay="no_rplay= ac_rplay_includes=$rplay_includes ac_rplay_libraries=$rplay_libraries"
+    echo "$ac_t""libraries $rplay_libraries, headers $rplay_includes" 1>&6
+fi
+
+
+if test "x$rplay_libraries" != x && test "x$rplay_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$rplay_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$rplay_libraries"
+fi
+if test "x$rplay_includes" != x && test "x$rplay_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$rplay_includes"
+fi
+
+
+
+
+
+esound_includes=NONE
+esound_libraries=NONE
+
+echo $ac_n "checking for ESOUND""... $ac_c" 1>&6
+echo "configure:5315: checking for ESOUND" >&5
+# Check whether --with-esound or --without-esound was given.
+if test "${with_esound+set}" = set; then
+  withval="$with_esound"
+  :
+fi
+
+# Check whether --with-esound_config or --without-esound_config was given.
+if test "${with_esound_config+set}" = set; then
+  withval="$with_esound_config"
+  :
+fi
+
+# Check whether --with-esound_prefix or --without-esound_prefix was given.
+if test "${with_esound_prefix+set}" = set; then
+  withval="$with_esound_prefix"
+  :
+fi
+
+# Check whether --with-esound_includes or --without-esound_includes was given.
+if test "${with_esound_includes+set}" = set; then
+  withval="$with_esound_includes"
+  :
+fi
+
+# Check whether --with-esound_librairies or --without-esound_librairies was given.
+if test "${with_esound_librairies+set}" = set; then
+  withval="$with_esound_librairies"
+  :
+fi
+
+if test "x$with_esound" = xno; then
+  no_esound=yes
+else
+  if test "x$esound_includes" != xNONE && test "x$esound_libraries" != xNONE; then
+    no_esound=
+    if test "x$esound_config" = "x"; then
+      if test "x$esound_prefix" != "x"; then
+        esound_config="$esound_prefix/bin/esd-config"
+      else
+        esound_config="esd-config"
+     fi
+   else
+     if test "x$esound_prefix" = "x"; then
+        esound_prefix=`$esound_config --prefix`
+     fi
+   fi
+  else
+    if test "x$esound_config" = "x"; then
+      if test "x$esound_prefix" != "x"; then
+        esound_config="$esound_prefix/bin/esd-config"
+      else
+        esound_config="esd-config"
+     fi
+   else
+     if test "x$esound_prefix" = "x"; then
+        esound_prefix=`$esound_config --prefix`
+     fi
+   fi
+if eval "test \"`echo '$''{'ac_cv_path_esound'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_esound=yes
+if test "x$esound_prefix" != "x"; then
+  ac_esound_prefix=$esound_prefix
+  ac_esound_includes=$ac_esound_prefix/include
+  ac_esound_libraries=$ac_esound_prefix/lib
+  no_esound="ac_esound_config=$ac_esound_config ac_esound_prefix=$ac_esound_prefix ac_esound_includes=$ac_esound_includes ac_esound_libraries=$ac_esound_libraries"
+else
+  ac_esound_config="$esound_config"
+  ac_esound_prefix=`$esound_config --prefix`
+  if test $? != 0; then
+    no_esound=yes
+    ac_esound_config=""
+    ac_esound_prefix=""
+    echo
+    echo "cannot get prefix"
+  else
+    no_esound=
+    ac_esound_includes=$ac_esound_prefix/include
+    ac_esound_libraries=$ac_esound_prefix/lib
+  fi
+fi
+if test "$no_esound" = yes; then
+  ac_cv_path_esound="no_esound=yes"
+else
+  ac_cv_path_esound="no_esound= ac_esound_config=\"$ac_esound_config\" ac_esound_prefix=\"$ac_esound_prefix\" ac_esound_includes=\"$ac_esound_includes\" ac_esound_libraries=\"$ac_esound_libraries\""
+fi
+fi
+  fi
+  eval "$ac_cv_path_esound"
+fi # with_esound != no
+
+if test "$no_esound" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+  if test "$sound" = none; then
+    sound=yes
+    cat >> confdefs.h <<\EOF
+#define USE_ESOUND 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define HAVE_LIBESD 1
+EOF
+
+    test "x$esound_config" = xNONE && esound_config=$ac_esound_config
+    test "x$esound_prefix" = xNONE && esound_prefix=$ac_esound_prefix
+    test "x$esound_includes" = xNONE && esound_includes=$ac_esound_includes
+    test "x$esound_libraries" = xNONE && esound_libraries=$ac_esound_libraries
+    ac_cv_path_esound="no_esound= ac_esound_config=$esound_config ac_esound_prefix=$esound_prefix ac_esound_includes=$esound_includes ac_esound_libraries=$esound_libraries"
+    echo "$ac_t""libraries $esound_libraries, headers $esound_includes" 1>&6
+  else
+    echo "$ac_t""ignored - using $sound" 1>&6
+  fi
+fi
+
+
+if test "x$esound_libraries" != x && test "x$esound_libraries" != xNONE ; then
+  XLOCKLIBS="${XLOCKLIBS} `$esound_config --libs`"
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$esound_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$esound_libraries"
+fi
+if test "x$esound_includes" != x && test "x$esound_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$esound_includes `$esound_config --cflags`"
+fi
+
+
+
+
+
+
+nas_includes=NONE
+nas_libraries=NONE
+
+echo $ac_n "checking for NAS""... $ac_c" 1>&6
+echo "configure:5452: checking for NAS" >&5
+# Check whether --with-nas or --without-nas was given.
+if test "${with_nas+set}" = set; then
+  withval="$with_nas"
+  :
+fi
+
+if test "x$with_nas" = xno; then
+  no_nas=yes
+else
+  if test "x$nas_includes" != xNONE && test "x$nas_libraries" != xNONE; then
+    no_nas=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_nas'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_nas=yes
+test -z "$nas_direct_test_library" && nas_direct_test_library=audio
+test -z "$nas_direct_test_function" && nas_direct_test_function=AuOpenServer
+test -z "$nas_direct_test_include" && nas_direct_test_include=audio/audio.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$nas_direct_test_include"; then
+      no_nas= ac_nas_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$nas_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_nas_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11/lib          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${nas_direct_test_library}.$ac_extension; then
+      no_nas= ac_nas_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_nas" = yes; then
+  ac_cv_path_nas="no_nas=yes"
+else
+  ac_cv_path_nas="no_nas= ac_nas_includes=$ac_nas_includes ac_nas_libraries=$ac_nas_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_nas"
+fi # with_nas != no
+
+if test "$no_nas" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+  if test "$sound" = none; then
+    sgi=no
+    case "${canonical}" in
+      *-*-irix5* | *-*-irix6* )
+        sgi=yes
+      ;;
+    esac
+    if test "$sgi" = yes; then
+      echo "$ac_t""ignored - problems here with audio and nas" 1>&6
+    else
+      sound=nas
+      cat >> confdefs.h <<\EOF
+#define USE_NAS 1
+EOF
+
+      XLOCKLIBS="${XLOCKLIBS} -laudio"
+      test "x$nas_includes" = xNONE && nas_includes=$ac_nas_includes
+      test "x$nas_libraries" = xNONE && nas_libraries=$ac_nas_libraries
+      ac_cv_path_nas="no_nas= ac_nas_includes=$nas_includes ac_nas_libraries=$nas_libraries"
+      echo "$ac_t""libraries $nas_libraries, headers $nas_includes" 1>&6
+    fi
+  else
+      echo "$ac_t""ignored - using rplay" 1>&6
+  fi
+fi
+
+
+if test "x$nas_libraries" != x && test "x$nas_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$nas_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$nas_libraries"
+fi
+if test "x$nas_includes" != x && test "x$nas_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$nas_includes"
+fi
+
+
+
+
+
+
+crypt_libraries=NONE
+
+echo $ac_n "checking for CRYPT""... $ac_c" 1>&6
+echo "configure:5581: checking for CRYPT" >&5
+# Check whether --with-crypt or --without-crypt was given.
+if test "${with_crypt+set}" = set; then
+  withval="$with_crypt"
+  :
+fi
+
+if test "x$with_crypt" = xno; then
+  no_crypt=yes
+else
+  if test "x$crypt_libraries" != xNONE; then
+    no_crypt=
+  else
+if eval "test \"`echo '$''{'ac_cv_path_crypt'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of these vars are not set, and there is no cached value.
+no_crypt=yes
+test -z "$crypt_direct_test_library" && crypt_direct_test_library=crypt
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$crypt_direct_test_library $LIBS"
+for ac_dir in \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${crypt_direct_test_library}.$ac_extension; then
+      no_crypt= ac_crypt_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"
+
+if test "$no_crypt" = yes; then
+  ac_cv_path_crypt="no_crypt=yes"
+else
+  ac_cv_path_crypt="no_crypt= ac_crypt_libraries=$ac_crypt_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_path_crypt"
+fi # with_crypt != no
+
+if test "$no_crypt" = yes; then
+  echo "$ac_t""no" 1>&6
+else
+  XLOCKLIBS="${XLOCKLIBS} -lcrypt"
+  test "x$crypt_libraries" = xNONE && crypt_libraries=$ac_crypt_libraries
+  ac_cv_path_crypt="no_crypt= ac_crypt_libraries=$crypt_libraries"
+  echo "$ac_t""libraries $crypt_libraries" 1>&6
+fi
+
+
+if test "x$crypt_libraries" != x && test "x$crypt_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$crypt_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$crypt_libraries"
+fi
+
+
+XGLOCK=""
+XGLOCKDIR=""
+INSTALL_XGLOCK=""
+UNINSTALL_XGLOCK=""
+XGLOCK_MAKEFILE=""
+# Check whether --with-gtk or --without-gtk was given.
+if test "${with_gtk+set}" = set; then
+  withval="$with_gtk"
+  :
+fi
+
+if test "x$with_gtk" != "xno" ; then
+   # Check whether --with-gtk-prefix or --without-gtk-prefix was given.
+if test "${with_gtk_prefix+set}" = set; then
+  withval="$with_gtk_prefix"
+  gtk_config_prefix="$withval"
+else
+  gtk_config_prefix=""
+fi
+
+# Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given.
+if test "${with_gtk_exec_prefix+set}" = set; then
+  withval="$with_gtk_exec_prefix"
+  gtk_config_exec_prefix="$withval"
+else
+  gtk_config_exec_prefix=""
+fi
+
+# Check whether --enable-gtktest or --disable-gtktest was given.
+if test "${enable_gtktest+set}" = set; then
+  enableval="$enable_gtktest"
+  :
+else
+  enable_gtktest=yes
+fi
+
+
+  if test x$gtk_config_exec_prefix != x ; then
+     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+     fi
+  fi
+  if test x$gtk_config_prefix != x ; then
+     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+     fi
+  fi
+
+  # Extract the first word of "gtk-config", so it can be a program name with args.
+set dummy gtk-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:5701: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$GTK_CONFIG" in
+  /*)
+  ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  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_path_GTK_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no"
+  ;;
+esac
+fi
+GTK_CONFIG="$ac_cv_path_GTK_CONFIG"
+if test -n "$GTK_CONFIG"; then
+  echo "$ac_t""$GTK_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  min_gtk_version=1.2.0
+  echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
+echo "configure:5736: checking for GTK - version >= $min_gtk_version" >&5
+  no_gtk=""
+  if test "$GTK_CONFIG" = "no" ; then
+    no_gtk=yes
+  else
+    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+    if test "x$enable_gtktest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GTK_CFLAGS"
+      LIBS="$LIBS $GTK_LIBS"
+      rm -f conf.gtktest
+      if test "$cross_compiling" = yes; then
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5759 "configure"
+#include "confdefs.h"
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.gtktest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_gtk_version");
+     exit(1);
+   }
+
+  if ((gtk_major_version != $gtk_config_major_version) ||
+      (gtk_minor_version != $gtk_config_minor_version) ||
+      (gtk_micro_version != $gtk_config_micro_version))
+    {
+      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
+             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+             gtk_major_version, gtk_minor_version, gtk_micro_version);
+      printf ("*** was found! If gtk-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
+      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+  else
+    {
+      if ((gtk_major_version > major) ||
+        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+               gtk_major_version, gtk_minor_version, gtk_micro_version);
+        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+              major, minor, micro);
+        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
+        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+
+EOF
+if { (eval echo configure:5825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  no_gtk=yes
+fi
+rm -fr conftest*
+fi
+
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gtk" = x ; then
+     echo "$ac_t""yes" 1>&6
+     have_gtk="yes"
+  else
+     echo "$ac_t""no" 1>&6
+     if test "$GTK_CONFIG" = "no" ; then
+       echo "*** The gtk-config script installed by GTK could not be found"
+       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GTK_CONFIG environment variable to the"
+       echo "*** full path to gtk-config."
+     else
+       if test -f conf.gtktest ; then
+        :
+       else
+          echo "*** Could not run GTK test program, checking why..."
+          CFLAGS="$CFLAGS $GTK_CFLAGS"
+          LIBS="$LIBS $GTK_LIBS"
+          cat > conftest.$ac_ext <<EOF
+#line 5859 "configure"
+#include "confdefs.h"
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int main() {
+ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); 
+; return 0; }
+EOF
+if { (eval echo configure:5869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+   echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GTK or finding the wrong"
+          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+          echo "*** came with the system with the command"
+          echo "***"
+          echo "***    rpm --erase --nodeps gtk gtk-devel" 
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+   echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
+          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
+          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" 
+fi
+rm -f conftest*
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GTK_CFLAGS=""
+     GTK_LIBS=""
+     have_gtk="no"
+  fi
+  
+  
+  rm -f conf.gtktest
+
+fi
+
+
+
+aixv3=no
+dirent=yes
+
+case "${canonical}" in
+
+  *-*-aix* )
+    BITMAPTYPE="ibm"
+    PIXMAPTYPE="ibm"
+    cat >> confdefs.h <<\EOF
+#define AIXV3 1
+EOF
+
+    aixv3=yes
+    case "${canonical}" in
+      *-*-aix2* | *-*-aix3.0* | *-*-aix3.1* )
+        cat >> confdefs.h <<\EOF
+#define LESS_THAN_AIX3_2 1
+EOF
+
+      ;;
+    esac
+  ;;
+
+  *-*-freebsd* | *-*-openbsd* | *-*-netbsd*  )
+    BITMAPTYPE="bsd"
+    PIXMAPTYPE="bsd"
+    INSTPGMFLAGS="-s -o root -m 4111"
+    XLOCKLDFLAGS="-Wl,-R${XLOCK_LDFLAGS}"
+    XMLOCKLDFLAGS="-Wl,-R${XMLOCK_LDFLAGS}"
+  ;;
+
+  *-*-dgux5* )
+    BITMAPTYPE="x11"
+    PIXMAPTYPE="x11"
+  ;;
+
+  *-*-hpux* )
+    if test "${CC}" = "cc" ; then
+      CFLAGS="${CFLAGS} -Aa -z -D_HPUX_SOURCE"
+      GPROF_CFLAGS="${GPROF_CFLAGS} -Aa -z -D_HPUX_SOURCE"
+    fi
+    XLOCKLIBS="-lXhp11 ${XLOCKLIBS}"
+    cat >> confdefs.h <<\EOF
+#define SYSV 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define SVR4 1
+EOF
+
+    BITMAPTYPE="hp"
+    PIXMAPTYPE="hp"
+  ;;
+
+  *-*-irix5* | *-*-irix6* )
+    if test "${CC}" = "cc" ; then
+      CFLAGS="${CFLAGS} -fullwarn"
+    fi
+    BITMAPTYPE="sgi"
+    PIXMAPTYPE="sgi"
+  ;;
+
+  *-*-linux* )
+    ac_safe=`echo "elf.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for elf.h""... $ac_c" 1>&6
+echo "configure:5976: checking for elf.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5981 "configure"
+#include "confdefs.h"
+#include <elf.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5986: \"$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*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_SHADOW 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    cat >> confdefs.h <<\EOF
+#define linux 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define _BSD_SOURCE 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define _GNU_SOURCE 1
+EOF
+
+    if test -e /etc/shadow ; then
+      INSTPGMFLAGS="-g shadow -m 2111"
+      case `ls -l /etc/shadow` in
+        -???r?????\ *\ shadow\ *\ /etc/shadow)  # group shadow can read it
+          INSTPGMFLAGS="-g shadow -m 2111"
+          ;;
+        *)
+          INSTPGMFLAGS="-o root -m 4111"
+          ;;
+      esac
+    fi
+    INSTPGMFLAGS="-s $INSTPGMFLAGS"
+    BITMAPTYPE="linux"
+    PIXMAPTYPE="linux"
+  ;;
+
+  *-*-osf* )
+    BITMAPTYPE="dec"
+    PIXMAPTYPE="dec"
+    echo $ac_n "checking for Digital Unix Enhanced Security""... $ac_c" 1>&6
+echo "configure:6046: checking for Digital Unix Enhanced Security" >&5
+    if test -f /usr/sbin/rcmgr && test -f /etc/rc.config ; then
+      if test X`/usr/sbin/rcmgr get SECURITY` = XENHANCED ; then
+        echo "$ac_t""yes" 1>&6
+        cat >> confdefs.h <<\EOF
+#define OSF1_ENH_SEC 1
+EOF
+
+        
+        XLOCKLIBS="${XLOCKLIBS} -lsecurity"
+        INSTPGMFLAGS="-s -g auth -m 2111"
+      else
+        echo "$ac_t""no" 1>&6
+      fi
+    fi
+  ;;
+
+  *-*-sco* )
+    BITMAPTYPE="sco"
+    PIXMAPTYPE="sco"
+    cat >> confdefs.h <<\EOF
+#define HAVE_SHADOW 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define SYSV 1
+EOF
+
+  ;;
+
+  *-*-solaris2* )
+    cat >> confdefs.h <<\EOF
+#define SOLARIS2 1
+EOF
+
+    PIXMAPTYPE="solaris"
+    case "${canonical}" in
+      *-*-solaris2.0* | *-*-solaris2.1* | *-*-solaris2.2* | *-*-solaris2.3* | *-*-solaris2.4* )
+        cat >> confdefs.h <<\EOF
+#define LESS_THAN_SOLARIS2_5 1
+EOF
+
+        PIXMAPTYPE="sol"
+      ;;
+      *-*-solaris2.5* | *-*-solaris2.6* )
+        PIXMAPTYPE="sol"
+      ;;
+    esac
+    INSTPGMFLAGS="-s -o root -m 4111"
+    cat >> confdefs.h <<\EOF
+#define HAVE_SHADOW 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define SYSV 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define SVR4 1
+EOF
+
+    BITMAPTYPE="sun"
+    XLOCKLIBS="${XLOCKLIBS} -lposix4"
+    LIBS="${LIBS} -lsocket -lnsl -lposix4"
+    XLOCKLDFLAGS="-R${XLOCK_LDFLAGS}"
+    XMLOCKLDFLAGS="-R${XMLOCK_LDFLAGS}"
+  ;;
+
+  *-*-sunos4* )
+    cat >> confdefs.h <<\EOF
+#define SUNOS4 1
+EOF
+
+    BITMAPTYPE="sun"
+    PIXMAPTYPE="sun"
+  ;;
+
+  *-*-sysv5* )
+    INSTPGMFLAGS="-s -o root -m 4111"
+    cat >> confdefs.h <<\EOF
+#define HAVE_SHADOW 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define SYSV 1
+EOF
+
+    cat >> confdefs.h <<\EOF
+#define SVR4 1
+EOF
+
+    XLOCKLIBS="${XLOCKLIBS} -lgen"
+    XMLOCKLIBS="${XMLOCKLIBS} -lgen"
+    LIBS="${LIBS} -lsocket -lnsl"
+    BITMAPTYPE="x11"
+    PIXMAPTYPE="x11"
+  ;;
+
+  *)
+    BITMAPTYPE="x11"
+    PIXMAPTYPE="x11"
+  ;;
+esac
+
+
+if test "$dirent" = yes; then
+  ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:6157: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6162 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:6170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ ac_header_dirent=$ac_hdr; break
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:6195: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | 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="-ldir  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6203 "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 opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:6214: \"$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
+  LIBS="$LIBS -ldir"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:6236: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | 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="-lx  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6244 "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 opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:6255: \"$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
+  LIBS="$LIBS -lx"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+fi
+
+echo $ac_n "checking for usleep""... $ac_c" 1>&6
+echo "configure:6280: checking for usleep" >&5
+if eval "test \"`echo '$''{'ac_cv_func_usleep'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6285 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char usleep(); below.  */
+#include <assert.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 usleep();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_usleep) || defined (__stub___usleep)
+choke me
+#else
+usleep();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_usleep=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_usleep=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'usleep`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_USLEEP 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
+echo "configure:6329: checking for nanosleep" >&5
+if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6334 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char nanosleep(); below.  */
+#include <assert.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 nanosleep();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_nanosleep) || defined (__stub___nanosleep)
+choke me
+#else
+nanosleep();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_nanosleep=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_nanosleep=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'nanosleep`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_NANOSLEEP 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+
+echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
+echo "configure:6383: checking how to call gettimeofday" >&5
+if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6388 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <sys/time.h>
+int main() {
+struct timeval tv; struct timezone tzp;
+      gettimeofday(&tv, &tzp);
+; return 0; }
+EOF
+if { (eval echo configure:6397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_gettimeofday_args=2
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  cat > conftest.$ac_ext <<EOF
+#line 6405 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <sys/time.h>
+int main() {
+struct timeval tv; gettimeofday(&tv);
+; return 0; }
+EOF
+if { (eval echo configure:6413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_gettimeofday_args=1
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_gettimeofday_args=0
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_gettimeofday_args=$ac_gettimeofday_args
+fi
+
+ac_gettimeofday_args=$ac_cv_gettimeofday_args
+if test $ac_gettimeofday_args = 2 ; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_GETTIMEOFDAY 1
+EOF
+
+  cat >> confdefs.h <<\EOF
+#define GETTIMEOFDAY_TWO_ARGS 1
+EOF
+
+  echo "$ac_t""two arguments" 1>&6
+elif test $ac_gettimeofday_args = 1 ; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_GETTIMEOFDAY 1
+EOF
+
+  echo "$ac_t""one argument" 1>&6
+else
+  echo "$ac_t""unknown" 1>&6
+fi
+
+for ac_func in tzset timelocal
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6452: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6457 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.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 $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:6506: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat > conftest.$ac_ext <<EOF
+#line 6513 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:6520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_inline=$ac_kw; break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+  inline | yes) ;;
+  no) cat >> confdefs.h <<\EOF
+#define inline 
+EOF
+ ;;
+  *)  cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+
+srand=no
+echo $ac_n "checking for srand48""... $ac_c" 1>&6
+echo "configure:6548: checking for srand48" >&5
+if eval "test \"`echo '$''{'ac_cv_func_srand48'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6553 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char srand48(); below.  */
+#include <assert.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 srand48();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_srand48) || defined (__stub___srand48)
+choke me
+#else
+srand48();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_srand48=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_srand48=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'srand48`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_RAND48 1
+EOF
+
+   echo $ac_n "checking for srand48 declaration""... $ac_c" 1>&6
+echo "configure:6595: checking for srand48 declaration" >&5
+   cat > conftest.$ac_ext <<EOF
+#line 6597 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "srand48" >/dev/null 2>&1; then
+  rm -rf conftest*
+  cat >> confdefs.h <<\EOF
+#define DECLARED_SRAND48 1
+EOF
+ echo "$ac_t""yes" 1>&6
+else
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for srandom""... $ac_c" 1>&6
+echo "configure:6617: checking for srandom" >&5
+if eval "test \"`echo '$''{'ac_cv_func_srandom'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6622 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char srandom(); below.  */
+#include <assert.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 srandom();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_srandom) || defined (__stub___srandom)
+choke me
+#else
+srandom();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_srandom=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_srandom=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'srandom`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_RANDOM 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for random""... $ac_c" 1>&6
+echo "configure:6666: checking for random" >&5
+if eval "test \"`echo '$''{'ac_cv_func_random'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6671 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char random(); below.  */
+#include <assert.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 random();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_random) || defined (__stub___random)
+choke me
+#else
+random();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_random=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_random=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'random`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_RAND 1
+EOF
+ srand=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+fi
+
+if test "$srand" = yes; then
+  if test "$aixv3" = yes; then
+    cat >> confdefs.h <<\EOF
+#define MAXRAND 2147483648.0
+EOF
+
+  else
+    cat >> confdefs.h <<\EOF
+#define MAXRAND 32768.0
+EOF
+
+  fi
+fi
+
+echo $ac_n "checking matherr support""... $ac_c" 1>&6
+echo "configure:6735: checking matherr support" >&5
+if eval "test \"`echo '$''{'ac_cv_c_matherr'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 6741 "configure"
+#include "confdefs.h"
+#define _XOPEN_SOURCE 1
+#include <math.h>
+int main() {
+
+struct exception x;
+x.type = DOMAIN;
+x.type = SING;
+
+; return 0; }
+EOF
+if { (eval echo configure:6753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_matherr=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_matherr=no
+fi
+rm -f conftest*
+fi
+
+if test x"$ac_cv_c_matherr" = xyes; then
+    cat >> confdefs.h <<\EOF
+#define USE_MATHERR 1
+EOF
+
+    echo "$ac_t""yes" 1>&6
+else
+    echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking struct sigset_t""... $ac_c" 1>&6
+echo "configure:6776: checking struct sigset_t" >&5
+if eval "test \"`echo '$''{'ac_cv_c_sigset_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 6782 "configure"
+#include "confdefs.h"
+/*#define _XOPEN_SOURCE 1*/
+#include <signal.h>
+int main() {
+
+typedef struct {unsigned long __sigbits[4];} sigset_t;
+sigset_t sigmask;
+
+; return 0; }
+EOF
+if { (eval echo configure:6793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_sigset_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_sigset_t=no
+fi
+rm -f conftest*
+fi
+
+if test x"$ac_cv_c_sigset_t" = xyes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_SIGSET_T 1
+EOF
+
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+# Check whether --enable-bitmapdir or --disable-bitmapdir was given.
+if test "${enable_bitmapdir+set}" = set; then
+  enableval="$enable_bitmapdir"
+  bitmap_dir=$enableval
+else
+  bitmap_dir=no
+fi
+
+case "x$bitmap_dir" in
+x/*|x.*)
+  echo "$ac_t""setting BITMAPDIR = $enableval" 1>&6
+  BITMAPDIR=$enableval
+  if test ! -d $bitmap_dir; then
+    echo "$ac_t""Warning: Directory $enableval does not exist" 1>&6
+  fi
+  ;;
+*)
+  BITMAPDIR='$(top_srcdir)/bitmaps'
+  bitmap_dir='$top_srcdir/bitmaps'
+  ;;
+esac
+
+# Check whether --enable-bitmaptype or --disable-bitmaptype was given.
+if test "${enable_bitmaptype+set}" = set; then
+  enableval="$enable_bitmaptype"
+  bitmap_type=$enableval
+else
+  bitmap_type=no
+fi
+
+case "x$bitmap_type" in
+xyes*|xno*)
+  ;;
+*)
+  echo "$ac_t""setting BITMAPTYPE = $enableval" 1>&6
+  BITMAPTYPE=$enableval
+  if test ! -f $bitmap_dir/l-$BITMAPTYPE.xbm; then
+    echo "$ac_t""Warning: Bitmap $BITMAPDIR/l-$BITMAPTYPE.xbm does not exist" 1>&6
+  fi
+  ;;
+esac
+
+# Check whether --enable-pixmapdir or --disable-pixmapdir was given.
+if test "${enable_pixmapdir+set}" = set; then
+  enableval="$enable_pixmapdir"
+  pixmap_dir=$enableval
+else
+  pixmap_dir=no
+fi
+
+case "x$pixmap_dir" in
+x/*|x.*)
+  echo "$ac_t""setting PIXMAPDIR = $enableval" 1>&6
+  PIXMAPDIR=$enableval
+  if test ! -d $pixmap_dir; then
+    echo "$ac_t""Warning: Directory $enableval does not exist" 1>&6
+  fi
+  ;;
+*)
+  PIXMAPDIR='$(top_srcdir)/pixmaps'
+  pixmap_dir='$top_srcdir/pixmaps'
+  ;;
+esac
+
+# Check whether --enable-pixmaptype or --disable-pixmaptype was given.
+if test "${enable_pixmaptype+set}" = set; then
+  enableval="$enable_pixmaptype"
+  pixmap_type=$enableval
+else
+  pixmap_type=no
+fi
+
+case "x$pixmap_type" in
+xyes*|xno*)
+  ;;
+*)
+  echo "$ac_t""setting PIXMAPTYPE = $enableval" 1>&6
+  PIXMAPTYPE=$enableval
+  if test ! -f $pixmap_dir/m-$PIXMAPTYPE.xpm; then
+    echo "$ac_t""Warning: Pixmap $PIXMAPDIR/m-$PIXMAPTYPE.xpm does not exist" 1>&6
+  fi
+  ;;
+esac
+
+# Check whether --enable-mapdir or --disable-mapdir was given.
+if test "${enable_mapdir+set}" = set; then
+  enableval="$enable_mapdir"
+  map_dir=$enableval
+else
+  map_dir=no
+fi
+
+case "x$map_dir" in
+x/*|x.*)
+  echo "$ac_t""setting BITMAPDIR = $enableval" 1>&6
+  BITMAPDIR=$enableval
+  echo "$ac_t""setting PIXMAPDIR = $enableval" 1>&6
+  PIXMAPDIR=$enableval
+  if test ! -d $map_dir; then
+    echo "$ac_t""Warning: Directory $enableval does not exist" 1>&6
+  fi
+  ;;
+*)
+  BITMAPDIR='$(top_srcdir)/bitmaps'
+  bitmap_dir='$top_srcdir/bitmaps'
+  PIXMAPDIR='$(top_srcdir)/pixmaps'
+  pixmap_dir='$top_srcdir/pixmaps'
+  ;;
+esac
+
+# Check whether --enable-maptype or --disable-maptype was given.
+if test "${enable_maptype+set}" = set; then
+  enableval="$enable_maptype"
+  map_type=$enableval
+else
+  map_type=no
+fi
+
+case "x$map_type" in
+xyes*|xno*)
+  ;;
+*)
+  echo "$ac_t""setting BITMAPTYPE = $enableval" 1>&6
+  BITMAPTYPE=$enableval
+  if test ! -f $map_dir/l-$BITMAPTYPE.xbm; then
+    echo "$ac_t""Warning: Bitmap $BITMAPDIR/l-$BITMAPTYPE.xbm does not exist" 1>&6
+  fi
+  echo "$ac_t""setting PIXMAPTYPE = $enableval" 1>&6
+  PIXMAPTYPE=$enableval
+  if test ! -f $map_dir/m-$PIXMAPTYPE.xpm; then
+    echo "$ac_t""Warning: Pixmap $PIXMAPDIR/m-$PIXMAPTYPE.xpm does not exist" 1>&6
+  fi
+  ;;
+esac
+
+if test "$sound" = none; then
+  # Check whether --enable-def_play or --disable-def_play was given.
+if test "${enable_def_play+set}" = set; then
+  enableval="$enable_def_play"
+  def_play=$enableval
+else
+  def_play=no
+fi
+
+  if test "$def_play" != no; then
+    echo "$ac_t""defining option DEF_PLAY = "$enableval"" 1>&6
+    cat >> confdefs.h <<EOF
+#define DEF_PLAY "$enableval"
+EOF
+
+  fi
+fi
+
+# Check whether --enable-vroot or --disable-vroot was given.
+if test "${enable_vroot+set}" = set; then
+  enableval="$enable_vroot"
+  use_vroot=$enableval
+else
+  use_vroot=yes
+fi
+
+if test "$use_vroot" = yes; then
+  echo "$ac_t""defining option USE_VROOT" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_VROOT 1
+EOF
+
+fi
+
+# Check whether --enable-allow-root or --disable-allow-root was given.
+if test "${enable_allow_root+set}" = set; then
+  enableval="$enable_allow_root"
+  allow_root=$enableval
+else
+  allow_root=yes
+fi
+
+if test "$allow_root" = yes; then
+  echo "$ac_t""defining option ALWAYS_ALLOW_ROOT" 1>&6
+  cat >> confdefs.h <<\EOF
+#define ALWAYS_ALLOW_ROOT 1
+EOF
+
+fi
+
+case ${canonical} in
+    *-*-linux* | *-*-freebsd* | *-*-openbsd* | *-*-netbsd*  )
+      # Check whether --enable-vtlock or --disable-vtlock was given.
+if test "${enable_vtlock+set}" = set; then
+  enableval="$enable_vtlock"
+  vtlock=$enableval
+else
+  vtlock=no
+fi
+
+      if test "$vtlock" = yes; then
+        echo "$ac_t""defining option USE_VTLOCK" 1>&6
+        cat >> confdefs.h <<\EOF
+#define USE_VTLOCK 1
+EOF
+
+      fi
+      ;;
+    *)
+      ;;
+esac
+
+# Check whether --enable-syslog or --disable-syslog was given.
+if test "${enable_syslog+set}" = set; then
+  enableval="$enable_syslog"
+  use_syslog=$enableval
+else
+  use_syslog=no
+fi
+
+if test "$use_syslog" = yes; then
+  echo "$ac_t""defining option USE_SYSLOG" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_SYSLOG 1
+EOF
+
+fi
+
+# Check whether --enable-multiple-user or --disable-multiple-user was given.
+if test "${enable_multiple_user+set}" = set; then
+  enableval="$enable_multiple_user"
+  use_multiple_user=$enableval
+else
+  use_multiple_user=no
+fi
+
+if test "$use_multiple_user" = yes; then
+  echo "$ac_t""defining option USE_MULTIPLE_USER" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_MULTIPLE_USER 1
+EOF
+
+fi
+
+# Check whether --enable-multiple-root or --disable-multiple-root was given.
+if test "${enable_multiple_root+set}" = set; then
+  enableval="$enable_multiple_root"
+  use_multiple_root=$enableval
+else
+  use_multiple_root=no
+fi
+
+if test "$use_multiple_root" = yes; then
+  echo "$ac_t""defining option USE_MULTIPLE_ROOT" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_MULTIPLE_ROOT 1
+EOF
+
+fi
+
+# Check whether --enable-window-visibility or --disable-window-visibility was given.
+if test "${enable_window_visibility+set}" = set; then
+  enableval="$enable_window_visibility"
+  use_window_visiblity=$enableval
+else
+  use_window_visibility=no
+fi
+
+if test "$use_window_visibility" = yes; then
+  echo "$ac_t""defining option USE_WINDOW_VISIBILITY" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_WINDOW_VISIBLITY 1
+EOF
+
+fi
+
+# Check whether --enable-old-event-loop or --disable-old-event-loop was given.
+if test "${enable_old_event_loop+set}" = set; then
+  enableval="$enable_old_event_loop"
+  use_old_event_loop=$enableval
+else
+  use_old_event_loop=no
+fi
+
+if test "$use_old_event_loop" = yes; then
+  echo "$ac_t""defining option USE_OLD_EVENT_LOOP" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_OLD_EVENT_LOOP 1
+EOF
+
+fi
+
+
+# Check whether --enable-xlockrc or --disable-xlockrc was given.
+if test "${enable_xlockrc+set}" = set; then
+  enableval="$enable_xlockrc"
+  use_xlockrc=$enableval
+else
+  use_xlockrc=no
+fi
+
+if test "$use_xlockrc" = yes; then
+  echo "$ac_t""defining option USE_XLOCKRC" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_XLOCKRC 1
+EOF
+
+fi
+
+# Check whether --enable-auto-logout or --disable-auto-logout was given.
+if test "${enable_auto_logout+set}" = set; then
+  enableval="$enable_auto_logout"
+  use_auto_logout=$enableval
+else
+  use_auto_logout=no
+fi
+
+case "x$use_auto_logout" in
+x|xyes*)
+  echo "$ac_t""defining option USE_AUTO_LOGOUT = 240 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_AUTO_LOGOUT 240
+EOF
+
+  ;;
+x[0-9]*)
+  echo "$ac_t""defining option USE_AUTO_LOGOUT = $enableval minutes" 1>&6
+  cat >> confdefs.h <<EOF
+#define USE_AUTO_LOGOUT $enableval
+EOF
+
+  ;;
+xno*)
+  ;;
+*)
+  echo "$ac_t""Warning: Illegal time value "$use_auto_logout" given" 1>&6
+  echo "$ac_t""defining option USE_AUTO_LOGOUT = 240 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_AUTO_LOGOUT 240
+EOF
+
+  ;;
+esac
+
+# Check whether --enable-default-auto-logout or --disable-default-auto-logout was given.
+if test "${enable_default_auto_logout+set}" = set; then
+  enableval="$enable_default_auto_logout"
+  def_auto_logout=$enableval
+else
+  def_auto_logout=no
+fi
+
+case "x$def_auto_logout" in
+x|xyes*)
+  echo "$ac_t""defining option DEF_AUTO_LOGOUT = 120 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define DEF_AUTO_LOGOUT "120"
+EOF
+
+  ;;
+x[0-9]*)
+  echo "$ac_t""defining option DEF_AUTO_LOGOUT = $enableval minutes" 1>&6
+  cat >> confdefs.h <<EOF
+#define DEF_AUTO_LOGOUT "$enableval"
+EOF
+
+  ;;
+xno*)
+  ;;
+*)
+  echo "$ac_t""Warning: Illegal time value "$def_auto_logout" given" 1>&6
+  echo "$ac_t""defining option DEF_AUTO_LOGOUT = 120 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define DEF_AUTO_LOGOUT "120"
+EOF
+
+  ;;
+esac
+
+# Check whether --enable-button-logout or --disable-button-logout was given.
+if test "${enable_button_logout+set}" = set; then
+  enableval="$enable_button_logout"
+  use_button_logout=$enableval
+else
+  use_button_logout=no
+fi
+
+case "x$use_button_logout" in
+x|xyes*)
+  echo "$ac_t""defining option USE_BUTTON_LOGOUT = 10 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_BUTTON_LOGOUT 10
+EOF
+
+  ;;
+x[0-9]*|x-0-9*)
+  echo "$ac_t""defining option USE_BUTTON_LOGOUT = $enableval minutes" 1>&6
+  cat >> confdefs.h <<EOF
+#define USE_BUTTON_LOGOUT $enableval
+EOF
+
+  ;;
+xno*)
+  ;;
+*)
+  echo "$ac_t""Warning: Illegal time value "$use_button_logout" given" 1>&6
+  echo "$ac_t""defining option USE_BUTTON_LOGOUT = 10 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_BUTTON_LOGOUT 10
+EOF
+
+  ;;
+esac
+
+# Check whether --enable-default-button-logout or --disable-default-button-logout was given.
+if test "${enable_default_button_logout+set}" = set; then
+  enableval="$enable_default_button_logout"
+  def_button_logout=$enableval
+else
+  def_button_logout=no
+fi
+
+case "x$def_button_logout" in
+x|xyes*)
+  echo "$ac_t""defining option DEF_BUTTON_LOGOUT = 5 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define DEF_BUTTON_LOGOUT "5"
+EOF
+
+  ;;
+x[0-9]*)
+  echo "$ac_t""defining option DEF_BUTTON_LOGOUT = $enableval minutes" 1>&6
+  cat >> confdefs.h <<EOF
+#define DEF_BUTTON_LOGOUT "$enableval"
+EOF
+
+  ;;
+xno*)
+  ;;
+*)
+  echo "$ac_t""Warning: Illegal time value "$def_button_logout" given" 1>&6
+  echo "$ac_t""defining option DEF_BUTTON_LOGOUT = 5 minutes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define DEF_BUTTON_LOGOUT "5"
+EOF
+
+  ;;
+esac
+
+# Check whether --enable-bomb or --disable-bomb was given.
+if test "${enable_bomb+set}" = set; then
+  enableval="$enable_bomb"
+  use_bomb=$enableval
+else
+  use_bomb=yes
+fi
+
+if test "$use_bomb" = yes; then
+  echo "$ac_t""defining option USE_BOMB" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_BOMB 1
+EOF
+
+  BOMB=""
+else
+  BOMB="#"
+fi
+
+# Check whether --enable-interactive or --disable-interactive was given.
+if test "${enable_interactive+set}" = set; then
+  enableval="$enable_interactive"
+  no_interactive=$enableval
+else
+  no_interactive=yes
+fi
+
+if test "$no_interactive" = no; then
+  echo "$ac_t""defining option DISABLE_INTERACTIVE" 1>&6
+  cat >> confdefs.h <<\EOF
+#define DISABLE_INTERACTIVE 1
+EOF
+
+  INTERACTIVE=""
+else
+  INTERACTIVE="#"
+fi
+
+# Check whether --enable-unstable or --disable-unstable was given.
+if test "${enable_unstable+set}" = set; then
+  enableval="$enable_unstable"
+  use_unstable=$enableval
+else
+  use_unstable=no
+fi
+
+if test "$use_unstable" = yes; then
+  echo "$ac_t""defining option USE_UNSTABLE" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_UNSTABLE 1
+EOF
+
+  UNSTABLE=""
+else
+  UNSTABLE="#"
+fi
+
+# Check whether --enable-closedown-logout or --disable-closedown-logout was given.
+if test "${enable_closedown_logout+set}" = set; then
+  enableval="$enable_closedown_logout"
+  closedown_logout=$enableval
+else
+  closedown_logout=no
+fi
+
+if test "$closedown_logout" = yes; then
+  echo "$ac_t""defining option CLOSEDOWN_LOGOUT" 1>&6
+  cat >> confdefs.h <<\EOF
+#define CLOSEDOWN_LOGOUT 1
+EOF
+
+fi
+
+# Check whether --enable-session-logout or --disable-session-logout was given.
+if test "${enable_session_logout+set}" = set; then
+  enableval="$enable_session_logout"
+  session_logout=$enableval
+else
+  session_logout=no
+fi
+
+if test "$session_logout" = yes; then
+  echo "$ac_t""defining option SESSION_LOGOUT" 1>&6
+  cat >> confdefs.h <<\EOF
+#define SESSION_LOGOUT 1
+EOF
+
+fi
+
+# Check whether --enable-staff-file or --disable-staff-file was given.
+if test "${enable_staff_file+set}" = set; then
+  enableval="$enable_staff_file"
+  use_staff_file=$enableval
+else
+  use_staff_file=no
+fi
+
+case "x$use_staff_file" in
+x|xyes*)
+  echo "$ac_t""defining option STAFF_FILE = "/usr/remote/etc/xlock.staff"" 1>&6
+  cat >> confdefs.h <<EOF
+#define STAFF_FILE "/usr/remote/etc/xlock.staff"
+EOF
+
+  if test ! -f /usr/remote/etc/xlock.staff; then
+    echo "$ac_t""Warning: File /usr/remote/etc/xlock.staff does not exist" 1>&6
+  fi
+  ;;
+x/*)
+  echo "$ac_t""defining option STAFF_FILE = "$enableval"" 1>&6
+  cat >> confdefs.h <<EOF
+#define STAFF_FILE "$enableval"
+EOF
+
+  if test ! -f $use_staff_file; then
+    echo "$ac_t""Warning: File $enableval does not exist" 1>&6
+  fi
+  ;;
+esac
+
+# Check whether --enable-staff-netgroup or --disable-staff-netgroup was given.
+if test "${enable_staff_netgroup+set}" = set; then
+  enableval="$enable_staff_netgroup"
+  use_staff_netgroup=$enableval
+else
+  use_staff_netgroup=no
+fi
+
+if test "$use_staff_netgroup" != no; then
+  echo "$ac_t""defining option STAFF_NETGROUP = "$enableval"" 1>&6
+  cat >> confdefs.h <<EOF
+#define STAFF_NETGROUP "$enableval"
+EOF
+
+fi
+
+# Check whether --enable-kerberos4 or --disable-kerberos4 was given.
+if test "${enable_kerberos4+set}" = set; then
+  enableval="$enable_kerberos4"
+  kerberos4=$enableval
+else
+  kerberos4=no
+fi
+
+if test "$kerberos4" = yes; then
+  echo "$ac_t""defining option HAVE_KRB4" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_KRB4 1
+EOF
+
+  XLOCKINC="${XLOCKINC} -I/usr/athena/include"
+  XLOCKLIBS="${XLOCKLIBS} -L/usr/athena/lib -lkrb -ldes"
+fi
+
+# Check whether --enable-kerberos5 or --disable-kerberos5 was given.
+if test "${enable_kerberos5+set}" = set; then
+  enableval="$enable_kerberos5"
+  kerberos5=$enableval
+else
+  kerberos5=no
+fi
+
+if test "$kerberos5" = yes; then
+  echo "$ac_t""defining option HAVE_KRB5" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_KRB5 1
+EOF
+
+  XLOCKINC="${XLOCKINC} -I/usr/local/include"
+  XLOCKLIBS="${XLOCKLIBS} -L/usr/local/lib -lkrb5 -lcrypto -lcom_err"
+fi
+
+# Check whether --enable-dce_passwd or --disable-dce_passwd was given.
+if test "${enable_dce_passwd+set}" = set; then
+  enableval="$enable_dce_passwd"
+  dce_passwd=$enableval
+else
+  dce_passwd=no
+fi
+
+if test "$dce_passwd" = yes; then
+  echo "$ac_t""defining option DCE_PASSWD" 1>&6
+  cat >> confdefs.h <<\EOF
+#define DCE_PASSWD 1
+EOF
+
+  XLOCKINC="${XLOCKINC} -I/usr/include/reentrant"
+  XLOCKLIBS="${XLOCKLIBS} -ldce -lc_r"
+fi
+
+# Check whether --enable-pam or --disable-pam was given.
+if test "${enable_pam+set}" = set; then
+  enableval="$enable_pam"
+  pam=$enableval
+else
+  pam=no
+fi
+
+if test "$pam" = yes; then
+  echo "$ac_t""defining option PAM" 1>&6
+  cat >> confdefs.h <<\EOF
+#define PAM 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lpam -ldl"
+fi
+
+# Check whether --enable-afs or --disable-afs was given.
+if test "${enable_afs+set}" = set; then
+  enableval="$enable_afs"
+  afs=$enableval
+else
+  afs=no
+fi
+
+if test "$afs" = yes; then
+  echo "$ac_t""defining option AFS" 1>&6
+  cat >> confdefs.h <<\EOF
+#define AFS 1
+EOF
+
+  XLOCKINC="${XLOCKINC} -I/usr/afsws/include"
+  case "${canonical}" in
+    *-*-solaris2.* )
+      XLOCKLIBS="${XLOCKLIBS} -lucb -L/usr/afsws/lib -L/usr/afsws/lib/afs -lkauth.krb -lprot -lubik -lauth.krb -lrxkad -lsys -ldes -lrx -llwp -lcom_err -lcmd /usr/afsws/lib/afs/util.a -laudit -lsys"
+    ;;
+    * )
+      XLOCKLIBS="${XLOCKLIBS} -L/usr/afsws/lib -L/usr/afsws/lib/afs -lkauth -lubik -lprot -lrxkad -lrx -llwp -lauth -lsys -ldes -lcmd -lcom_err /usr/afsws/lib/afs/util.a -laudit"
+    ;;
+  esac
+fi
+
+# Check whether --enable-afs or --disable-afs was given.
+if test "${enable_afs+set}" = set; then
+  enableval="$enable_afs"
+  sia=$enableval
+else
+  sia=no
+fi
+
+if test "$sia" = yes; then
+  echo "$ac_t""defining option SIA" 1>&6
+  cat >> confdefs.h <<\EOF
+#define SIA 1
+EOF
+
+  XLOCKLIBS="${XLOCKLIBS} -lsecurity"
+fi
+
+# Check whether --enable-sunos_adjunct_passwd or --disable-sunos_adjunct_passwd was given.
+if test "${enable_sunos_adjunct_passwd+set}" = set; then
+  enableval="$enable_sunos_adjunct_passwd"
+  sunos_adjunct_passwd=$enableval
+else
+  sunos_adjunct_passwd=no
+fi
+
+if test "$sunos_adjunct_passwd" = yes; then
+  echo "$ac_t""defining option SUNOS_ADJUNCT_PASSWD" 1>&6
+  cat >> confdefs.h <<\EOF
+#define SUNOS_ADJUNCT_PASSWD 1
+EOF
+
+fi
+
+# Check whether --enable-use_mb or --disable-use_mb was given.
+if test "${enable_use_mb+set}" = set; then
+  enableval="$enable_use_mb"
+  use_mb=$enableval
+else
+  use_mb=no
+fi
+
+if test "$use_mb" = yes; then
+  echo "$ac_t""defining option USE_MB" 1>&6
+  cat >> confdefs.h <<\EOF
+#define USE_MB 1
+EOF
+
+fi
+
+# Check whether --enable-customization or --disable-customization was given.
+if test "${enable_customization+set}" = set; then
+  enableval="$enable_customization"
+  customization=$enableval
+else
+  customization=no
+fi
+
+if test "$customization" = yes; then
+  echo "$ac_t""defining option CUSTOMIZATION" 1>&6
+  cat >> confdefs.h <<\EOF
+#define CUSTOMIZATION 1
+EOF
+
+fi
+
+# Check whether --enable-modules or --disable-modules was given.
+if test "${enable_modules+set}" = set; then
+  enableval="$enable_modules"
+  modules=$enableval
+else
+  modules=no
+fi
+
+if test "$modules" = yes; then
+  echo "$ac_t""enabling xlk modules" 1>&6
+  MODULES=""
+  NOMODULES="#"
+  cat >> confdefs.h <<\EOF
+#define USE_MODULES 1
+EOF
+
+case ${canonical} in
+    *-*-linux* )
+      MODULEFLAGS="-rdynamic"
+      ;;
+    *)
+      MODULEFLAGS=""
+      ;;
+esac
+else
+  MODULES="#"
+  NOMODULES=""
+  MODULEFLAGS=""
+fi
+
+# Check whether --enable-check or --disable-check was given.
+if test "${enable_check+set}" = set; then
+  enableval="$enable_check"
+  check=$enableval
+else
+  check=no
+fi
+
+if test "$check" = yes; then
+  echo "$ac_t""enabling memory debug checking" 1>&6
+  CHECK=""
+else
+  CHECK="#"
+fi
+
+# Check whether --with-lang or --without-lang was given.
+if test "${with_lang+set}" = set; then
+  withval="$with_lang"
+  lang=$withval
+else
+  lang=none
+fi
+
+case "$lang" in
+  nl|NL|Nl)
+    echo "$ac_t""enabling some reporting in Dutch" 1>&6
+    cat >> confdefs.h <<\EOF
+#define NL 1
+EOF
+
+    ;;
+  fr|FR|Fr)
+    echo "$ac_t""enabling some reporting in French" 1>&6
+    cat >> confdefs.h <<\EOF
+#define FR 1
+EOF
+
+    ;;
+  de|DE|De)
+    echo "$ac_t""enabling some reporting in German" 1>&6
+    cat >> confdefs.h <<\EOF
+#define DE 1
+EOF
+
+    ;;
+  jp|JP|Jp)
+    echo "$ac_t""enabling some reporting in Japanese" 1>&6
+    cat >> confdefs.h <<\EOF
+#define JP 1
+EOF
+
+    ;;
+  none)
+    echo "$ac_t""using default language (English)" 1>&6
+    ;;
+  *)
+    echo "$ac_t""unknown language $lang. using default language (English)" 1>&6
+    ;;
+esac
+
+# Check whether --enable-orig_xpm_patch or --disable-orig_xpm_patch was given.
+if test "${enable_orig_xpm_patch+set}" = set; then
+  enableval="$enable_orig_xpm_patch"
+  orig_xpm_patch=$enableval
+else
+  orig_xpm_patch=no
+fi
+
+if test "$orig_xpm_patch" = "yes"; then
+  echo "$ac_t""enabling original mail icon xpm patch" 1>&6
+  cat >> confdefs.h <<\EOF
+#define ORIGINAL_XPM_PATCH 1
+EOF
+
+fi
+
+if test "x$INSTPGMFLAGS" != x; then
+# Check whether --enable-setuid or --disable-setuid was given.
+if test "${enable_setuid+set}" = set; then
+  enableval="$enable_setuid"
+  setuid=$enableval
+else
+  setuid=yes
+fi
+
+case "x$setuid" in
+xno*)
+  case ${canonical} in
+  *-*-linux*)
+    if test "$vtlock" = "yes"; then
+      INSTPGMFLAGS="-s -o root -g bin -m 4111"
+      echo "$ac_t""defining install options (setuid/setgid) = "$INSTPGMFLAGS" for vtlock" 1>&6
+       echo "experimental: Big buffer overrun security risk"
+    else
+  INSTPGMFLAGS=""
+  echo "$ac_t""no setuid/setgid install" 1>&6
+    fi
+    ;;
+  *)
+  INSTPGMFLAGS=""
+  echo "$ac_t""no setuid/setgid install" 1>&6
+  ;;
+  esac
+  ;;
+x|xyes*)
+  case ${canonical} in
+  *-*-linux*)
+    if test "$vtlock" = "yes"; then
+      INSTPGMFLAGS="-s -o root -g bin -m 4111"
+      echo "$ac_t""defining install options (setuid/setgid) = "$INSTPGMFLAGS" for vtlock" 1>&6
+    else
+  echo "$ac_t""defining install options (setuid/setgid) = "$INSTPGMFLAGS"" 1>&6
+    fi
+    ;;
+  *)
+  echo "$ac_t""defining install options (setuid/setgid) = "$INSTPGMFLAGS"" 1>&6
+  ;;
+  esac
+  ;;
+x*)
+  INSTPGMFLAGS=$enableval
+  echo "$ac_t""defining install options (setuid/setgid) = "$enableval"" 1>&6
+  ;;
+esac
+else
+  echo "$ac_t""no setuid/setgid install" 1>&6
+fi
+
+DEPEND=makedepend
+DEPEND_FLAGS=
+DEPEND_DEFINES=
+
+case "${canonical}" in
+  *-*-irix5* | *-*-irix6* )
+    XLOCKLIBPATHS="-L/usr/lib32 ${XLOCKLIBPATHS}"
+    XMLOCKLIBPATHS="-L/usr/lib32 ${XMLOCKLIBPATHS}"
+    XGLOCKLIBPATHS="-L/usr/lib32 ${XGLOCKLIBPATHS}"
+  ;;
+esac
+XLOCKLIBS="${XLOCKLIBPATHS} ${XLOCKLIBS} -lX11 -lXext -lm"
+XMLOCKLIBS="${XMLOCKLIBPATHS} ${XMLOCKLIBS} -lX11"
+XGLOCKLIBS="${XGLOCKLIBPATHS} ${XGLOCKLIBS} ${GTK_LIBS}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# 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 \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    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 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile
+    xlock/Makefile
+    modes/Makefile
+    modes/glx/Makefile
+    xmlock/Makefile
+    xglock/Makefile
+   config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ 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
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@CC@%$CC%g
+s%@CXX@%$CXX%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@LN_S@%$LN_S%g
+s%@CPP@%$CPP%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@X_CFLAGS@%$X_CFLAGS%g
+s%@X_PRE_LIBS@%$X_PRE_LIBS%g
+s%@X_LIBS@%$X_LIBS%g
+s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
+s%@GTK_CONFIG@%$GTK_CONFIG%g
+s%@GTK_CFLAGS@%$GTK_CFLAGS%g
+s%@GTK_LIBS@%$GTK_LIBS%g
+s%@OSF1_ENH_SEC@%$OSF1_ENH_SEC%g
+s%@XLOCKLDFLAGS@%$XLOCKLDFLAGS%g
+s%@XMLOCKLDFLAGS@%$XMLOCKLDFLAGS%g
+s%@XGLOCKLDFLAGS@%$XGLOCKLDFLAGS%g
+s%@INSTPGMFLAGS@%$INSTPGMFLAGS%g
+s%@MODULEFLAGS@%$MODULEFLAGS%g
+s%@XLOCKINC@%$XLOCKINC%g
+s%@XMLOCKINC@%$XMLOCKINC%g
+s%@XGLOCKINC@%$XGLOCKINC%g
+s%@XLIBS@%$XLIBS%g
+s%@BITMAPTYPE@%$BITMAPTYPE%g
+s%@PIXMAPTYPE@%$PIXMAPTYPE%g
+s%@BITMAPDIR@%$BITMAPDIR%g
+s%@PIXMAPDIR@%$PIXMAPDIR%g
+s%@XLOCKLIBS@%$XLOCKLIBS%g
+s%@XMLOCKLIBS@%$XMLOCKLIBS%g
+s%@XGLOCKLIBS@%$XGLOCKLIBS%g
+s%@XMLOCK@%$XMLOCK%g
+s%@XGLOCK@%$XGLOCK%g
+s%@XGLOCKDIR@%$XGLOCKDIR%g
+s%@INSTALL_XMLOCK@%$INSTALL_XMLOCK%g
+s%@INSTALL_XGLOCK@%$INSTALL_XGLOCK%g
+s%@UNINSTALL_XMLOCK@%$UNINSTALL_XMLOCK%g
+s%@UNINSTALL_XGLOCK@%$UNINSTALL_XGLOCK%g
+s%@APPDEFAULTS@%$APPDEFAULTS%g
+s%@LINT@%$LINT%g
+s%@CHECK@%$CHECK%g
+s%@PURIFY@%$PURIFY%g
+s%@XPM@%$XPM%g
+s%@GL@%$GL%g
+s%@GLTT@%$GLTT%g
+s%@BOMB@%$BOMB%g
+s%@INTERACTIVE@%$INTERACTIVE%g
+s%@UNSTABLE@%$UNSTABLE%g
+s%@DEPEND@%$DEPEND%g
+s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
+s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
+s%@CCC@%$CCC%g
+s%@MODULES@%$MODULES%g
+s%@NOMODULES@%$NOMODULES%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile
+    xlock/Makefile
+    modes/Makefile
+    modes/glx/Makefile
+    xmlock/Makefile
+    xglock/Makefile
+  "}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([  ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='\([     ][      ]*\)[^  ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uB='\([     ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+  CONFIG_HEADERS="config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f conftest.frag conftest.in conftest.out
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h.  And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+  ac_lines=`grep -c . conftest.vals`
+  # grep -c gives empty output for an empty file on some AIX systems.
+  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+  # Write a limited-size here document to conftest.frag.
+  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+  echo 'CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  rm -f conftest.in
+  mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  rm -f conftest.vals
+  mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+  rm -f conftest.frag conftest.h
+  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
+  cat conftest.in >> conftest.h
+  rm -f conftest.in
+  if cmp -s $ac_file conftest.h 2>/dev/null; then
+    echo "$ac_file is unchanged"
+    rm -f conftest.h
+  else
+    # Remove last slash and all that follows it.  Not all systems have dirname.
+      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+      # The file is in a subdirectory.
+      test ! -d "$ac_dir" && mkdir "$ac_dir"
+    fi
+    rm -f $ac_file
+    mv conftest.h $ac_file
+  fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/configure.in b/configure.in
new file mode 100644 (file)
index 0000000..0aa36fc
--- /dev/null
@@ -0,0 +1,3616 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl configure.in for xlockmore.  Various things were taken from xscreensaver's
+dnl configure.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+dnl
+
+AC_INIT(config.h.in)
+AC_CONFIG_HEADER(config.h)
+AC_CANONICAL_HOST
+canonical=$host
+
+AC_PROG_CC
+dnl Check if C++ compiler is present. If not set CXX to the C-compiler used
+dnl for the other compilations.
+if test "$CC" = gcc; then
+  AC_CHECK_PROGS(CXX, $CCC g++ CC C++ c++ cxx cc++ xlC $CC, gcc)
+else
+  AC_CHECK_PROGS(CXX, $CCC CC C++ g++ c++ cxx cc++ xlC $CC, gcc)
+fi
+AC_PROG_CXX
+if test "${CXX}" = "xlC" ; then
+  CXXFLAGS="${CXXFLAGS} -+"
+fi
+
+dnl If you're using g++-2.95 or later and have old X11 includes, you may need
+dnl to use "g++ -fpermissive" in the Makefiles
+dnl if test "${CXX}" = "g++" ; then
+dnl   gpp_major_version=`g++ --version | cut -f1 -d.`
+dnl   if test "${gpp_major_version}" -gt "2" ; then
+dnl     AC_MSG_RESULT([enabling -fpermissive option for g++])
+dnl     CXXFLAGS="${CXXFLAGS} -fpermissive"
+dnl   fi
+dnl   if test "${gpp_major_version}" -eq "2" ; then
+dnl     gpp_minor_version=`g++ --version | cut -f2 -d.`
+dnl     if test "${gpp_minor_version}" -ge "95" ; then
+dnl       AC_MSG_RESULT([enabling -fpermissive option for g++])
+dnl       CXXFLAGS="${CXXFLAGS} -fpermissive"
+dnl     fi
+dnl   fi
+dnl fi
+
+dnl These 2 assume for now c++ exists....
+AC_DEFINE(HAVE_CXX)
+CCC=
+
+PACKAGE=xlockmore
+AC_SUBST(PACKAGE)
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+VERSION=5.00
+AC_SUBST(VERSION)
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+
+dnl Checks for programs.
+dnl AC_ARG_WITH(gcc,
+dnl[  --without-gcc           use CC to compile])
+
+dnl test -n "$CC" && cc_specified=yes
+dnl case ${with_gcc} in
+dnl   yes ) CC=gcc ;;
+dnl dnl yes ) CC=g++ ;;
+dnl  no  ) CC=cc ;;
+dnl  *   ) AC_PROG_CC;;
+dnl  *   ) AC_PROG_CXX ;;
+dnl esac
+
+dnl This creates a lot of noise.
+dnl if test "${CC}" = "gcc" ; then
+dnl   CFLAGS="${CFLAGS} -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes"
+dnl -Waggregate-return
+dnl fi
+
+opt_purify=no
+AC_ARG_WITH(purify, [  --with-purify           configure to postprocess with purify], opt_purify=$withval)
+if test "$opt_purify" = yes; then
+  AC_MSG_RESULT([enabling purify])
+  PURIFY="purify"
+else
+  PURIFY=
+fi
+
+AC_PROG_LN_S
+AC_PROG_CPP
+AC_AIX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+ac_link_test="-L"
+# test test
+AC_MSG_CHECKING([test -h])
+if (test \! -h /) >/dev/null 2>/dev/null ; then
+  ac_link_test="-h"
+  AC_MSG_RESULT($ac_link_test)
+else
+  AC_MSG_RESULT($ac_link_test)
+fi
+
+dnl Optional features.
+dnl add copious amounts of debugging with gcc
+
+dnl Checks for header files.
+dnl AC_HEADER_STDC /* If its not ansi, its not going to go */
+AC_ISC_POSIX
+AC_C_BIGENDIAN
+dnl AC_HEADER_SYS_WAIT
+dnl AC_CHECK_HEADERS(poll.h sys/poll.h)
+AC_CHECK_HEADERS(fcntl.h limits.h sys/select.h sys/time.h syslog.h unistd.h memory.h sys/param.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+dnl AC_HEADER_SYS_WAIT
+AC_TYPE_MODE_T
+AC_TYPE_UID_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+
+AC_MSG_CHECKING([for getenv declaration])
+AC_EGREP_HEADER(getenv, stdlib.h,
+       AC_DEFINE(DECLARED_GETENV) AC_MSG_RESULT(yes),
+       AC_MSG_RESULT(no))
+
+dnl Checks for library functions.
+dnl AC_TYPE_GETGROUPS
+dnl AC_TYPE_SIGNAL
+dnl AC_CHECK_FUNCS(poll)
+dnl AC_CHECK_FUNCS(signal)
+AC_CHECK_FUNCS(gethostname select strdup)
+
+AC_CHECK_FUNC(vfork, AC_DEFINE(HAVE_VFORK))
+AC_CHECK_FUNC(seteuid, AC_DEFINE(HAVE_SETEUID),
+AC_CHECK_FUNC(setreuid, AC_DEFINE(HAVE_SETREUID)))
+
+
+# Configure paths for GTK+
+# Owen Taylor     97-11-3
+
+dnl AC_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
+dnl
+AC_DEFUN(AC_PATH_GTK,
+[dnl
+dnl Get the cflags and libraries from the gtk-config script
+dnl
+AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=DIR   Prefix where GTK is installed (optional)],
+            gtk_config_prefix="$withval", gtk_config_prefix="")
+AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=DIR
+                          Exec prefix where GTK is installed (optional)],
+            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
+AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
+                   , enable_gtktest=yes)
+
+  if test x$gtk_config_exec_prefix != x ; then
+     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+     fi
+  fi
+  if test x$gtk_config_prefix != x ; then
+     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+     fi
+  fi
+
+  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
+  min_gtk_version=ifelse([$1], ,0.99.7,$1)
+  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
+  no_gtk=""
+  if test "$GTK_CONFIG" = "no" ; then
+    no_gtk=yes
+  else
+    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_gtktest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GTK_CFLAGS"
+      LIBS="$LIBS $GTK_LIBS"
+dnl
+dnl Now check if the installed GTK is sufficiently new. (Also sanity
+dnl checks the results of gtk-config to some extent
+dnl
+      rm -f conf.gtktest
+      AC_TRY_RUN([
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.gtktest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_gtk_version");
+     exit(1);
+   }
+
+  if ((gtk_major_version != $gtk_config_major_version) ||
+      (gtk_minor_version != $gtk_config_minor_version) ||
+      (gtk_micro_version != $gtk_config_micro_version))
+    {
+      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
+             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+             gtk_major_version, gtk_minor_version, gtk_micro_version);
+      printf ("*** was found! If gtk-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
+      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+  else
+    {
+      if ((gtk_major_version > major) ||
+        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+               gtk_major_version, gtk_minor_version, gtk_micro_version);
+        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+              major, minor, micro);
+        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
+        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gtk" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+  else
+     AC_MSG_RESULT(no)
+     if test "$GTK_CONFIG" = "no" ; then
+       echo "*** The gtk-config script installed by GTK could not be found"
+       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GTK_CONFIG environment variable to the"
+       echo "*** full path to gtk-config."
+     else
+       if test -f conf.gtktest ; then
+        :
+       else
+          echo "*** Could not run GTK test program, checking why..."
+          CFLAGS="$CFLAGS $GTK_CFLAGS"
+          LIBS="$LIBS $GTK_LIBS"
+          AC_TRY_LINK([
+#include <gtk/gtk.h>
+#include <stdio.h>
+],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GTK or finding the wrong"
+          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+          echo "*** came with the system with the command"
+          echo "***"
+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
+          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
+          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GTK_CFLAGS=""
+     GTK_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GTK_CFLAGS)
+  AC_SUBST(GTK_LIBS)
+  rm -f conf.gtktest
+])
+
+dnl X Window System files.
+AC_PATH_XTRA
+if test "$no_x" = yes; then
+  XLIBS=NONE
+else
+  if test -n "${x_includes}"; then
+    XLOCKINC="-I${x_includes} ${XLOCKINC}"
+    XMLOCKINC="-I${x_includes} ${XMLOCKINC}"
+    if test "${CXX}" = "g++" ; then
+dnl    Do not warn me about anything here
+       XLOCKINC="-isystem ${x_includes} ${XLOCKINC}"
+       XMLOCKINC="-isystem ${x_includes} ${XMLOCKINC}"
+    fi
+  fi
+  XLIBS="${x_libraries}"
+  if test -n "${x_libraries}"; then
+    XLOCK_LDFLAGS="/usr/lib:${x_libraries}"
+    XMLOCK_LDFLAGS="/usr/lib:${x_libraries}"
+    XLOCKLIBPATHS="-L${x_libraries} ${XLOCKLIBPATHS}"
+    XMLOCKLIBPATHS="-L${x_libraries} ${XMLOCKLIBPATHS}"
+  fi
+  XLOCKLIBS="${X_PRE_LIBS} ${X_EXTRA_LIBS} ${XLOCKLIBS}"
+  case "${canonical}" in
+    *-*-sco* )
+      XLOCKLIBS="${X_PRE_LIBS} ${XLOCKLIBS} ${X_EXTRA_LIBS}"
+    ;;
+  esac
+  XMLOCKLIBS="-lXt ${XMLOCKLIBS}"
+#  if you need regex and regcmp
+#  XMLOCKLIBS="-lXt ${XMLOCKLIBS} -lgen"
+dnl AC_DEFINE(X11) /* If there is no X, its not going to go */
+fi
+
+# Try and find the app-defaults directory.
+AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,
+  [
+  rm -fr conftestdir
+  if mkdir conftestdir; then
+    cd conftestdir
+    # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+    cat > Imakefile <<'EOF'
+acfindx:
+  @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
+EOF
+    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+      # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
+      eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    fi
+    cd ..
+    rm -fr conftestdir
+  fi])
+
+AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,
+[  # Look for the directory under a standard set of common directories.
+  # Check X11 before X11Rn because it's often a symlink to the current release.
+  for ac_dir in         \
+    /lib/X11/app-defaults \
+    /lib/app-defaults \
+    /lib/X11R6.5.1/app-defaults \
+    /lib/X11R6.5.1/X11/app-defaults \
+    /lib/X11R6.4/app-defaults \
+    /lib/X11R6.4/X11/app-defaults \
+    /lib/X11R6.3/app-defaults \
+    /lib/X11R6.3/X11/app-defaults \
+    /lib/X11R6.2/app-defaults \
+    /lib/X11R6.2/X11/app-defaults \
+    /lib/X11R6.1/app-defaults \
+    /lib/X11R6.1/X11/app-defaults \
+    /lib/X11R6/app-defaults \
+    /lib/X11R6/X11/app-defaults \
+    /lib/X11R5/app-defaults \
+    /lib/X11R5/X11/app-defaults \
+    /lib/X11R4/app-defaults \
+    /lib/X11R4/X11/app-defaults \
+    ; \
+  do
+    found=""
+    if test -d "${prefix}$ac_dir"; then
+      ac_x_app_defaults=\\\$\\\{prefix\\\}$ac_dir
+    found="1"
+      break
+    fi
+  done
+  if test -z "$found"; then
+  for ac_dir in         \
+    /usr/X11/lib/app-defaults     \
+    /lib/X11R6.5.1/lib/app-defaults \
+    /lib/X11R6.5.1/lib/X11/app-defaults \
+    /lib/X11R6.4/lib/app-defaults \
+    /lib/X11R6.4/lib/X11/app-defaults \
+    /usr/X11R6.3/lib/app-defaults     \
+    /usr/X11R6.3/lib/X11/app-defaults   \
+    /usr/X11R6.2/lib/app-defaults     \
+    /usr/X11R6.2/lib/X11/app-defaults   \
+    /usr/X11R6.1/lib/app-defaults     \
+    /usr/X11R6.1/lib/X11/app-defaults   \
+    /usr/X11R6/lib/app-defaults     \
+    /usr/X11R6/lib/X11/app-defaults   \
+    /usr/X11R5/lib/app-defaults     \
+    /usr/X11R5/lib/X11/app-defaults   \
+    /usr/X11R4/lib/app-defaults     \
+    /usr/X11R4/lib/X11/app-defaults   \
+            \
+    /usr/lib/X11/app-defaults     \
+    /usr/lib/X11R6.5.1/app-defaults \
+    /usr/lib/X11R6.4/app-defaults \
+    /usr/lib/X11R6.3/app-defaults     \
+    /usr/lib/X11R6.2/app-defaults     \
+    /usr/lib/X11R6.1/app-defaults     \
+    /usr/lib/X11R6/app-defaults     \
+    /usr/lib/X11R5/app-defaults     \
+    /usr/lib/X11R4/app-defaults     \
+            \
+    /usr/local/X11/lib/app-defaults   \
+    /usr/remote/X11/lib/app-defaults   \
+    /usr/local/X11R6.5.1/lib/app-defaults   \
+    /usr/local/X11R6.5.1/lib/X11/app-defaults   \
+    /usr/local/X11R6.4/lib/app-defaults   \
+    /usr/local/X11R6.4/lib/X11/app-defaults   \
+    /usr/local/X11R6.3/lib/app-defaults   \
+    /usr/local/X11R6.3/lib/X11/app-defaults   \
+    /usr/local/X11R6.2/lib/app-defaults   \
+    /usr/local/X11R6.2/lib/X11/app-defaults   \
+    /usr/local/X11R6.1/lib/app-defaults   \
+    /usr/local/X11R6.1/lib/X11/app-defaults   \
+    /usr/local/X11R6/lib/app-defaults   \
+    /usr/local/X11R6/lib/X11/app-defaults   \
+    /usr/local/X11R5/lib/app-defaults   \
+    /usr/local/X11R5/lib/X11/app-defaults   \
+    /usr/local/X11R4/lib/app-defaults   \
+    /usr/local/X11R4/lib/X11/app-defaults   \
+            \
+    /usr/local/lib/X11/app-defaults   \
+    /usr/remote/lib/X11/app-defaults   \
+    /usr/local/lib/X11R6.5.1/app-defaults   \
+    /usr/local/lib/X11R6.5.1/X11/app-defaults \
+    /usr/local/lib/X11R6.4/app-defaults   \
+    /usr/local/lib/X11R6.4/X11/app-defaults \
+    /usr/local/lib/X11R6.3/app-defaults   \
+    /usr/local/lib/X11R6.3/X11/app-defaults \
+    /usr/local/lib/X11R6.2/app-defaults   \
+    /usr/local/lib/X11R6.2/X11/app-defaults \
+    /usr/local/lib/X11R6.1/app-defaults   \
+    /usr/local/lib/X11R6.1/X11/app-defaults \
+    /usr/local/lib/X11R6/app-defaults   \
+    /usr/local/lib/X11R6/X11/app-defaults \
+    /usr/local/lib/X11R5/app-defaults   \
+    /usr/local/lib/X11R5/X11/app-defaults \
+    /usr/local/lib/X11R4/app-defaults   \
+    /usr/local/lib/X11R4/X11/app-defaults \
+            \
+    /usr/X386/lib/X11/app-defaults    \
+    /usr/x386/lib/X11/app-defaults    \
+    /usr/XFree86/lib/X11/app-defaults   \
+            \
+    /usr/lib/X11/app-defaults     \
+    /usr/unsupported/lib/X11/app-defaults \
+    /usr/athena/lib/X11/app-defaults    \
+    /usr/local/x11r5/lib/X11/app-defaults \
+    /usr/lpp/Xamples/lib/X11/app-defaults \
+    /lib/usr/lib/X11/app-defaults   \
+    /usr/local/lib/app-defaults   \
+    /usr/remote/lib/app-defaults   \
+            \
+    /usr/openwin/lib/app-defaults   \
+    /usr/openwin/lib/X11/app-defaults   \
+    /usr/openwin/share/lib/app-defaults   \
+    /usr/openwin/share/lib/X11/app-defaults \
+            \
+    /X11R6.5.1/lib/app-defaults   \
+    /X11R6.4/lib/app-defaults     \
+    /X11R6.3/lib/app-defaults     \
+    /X11R6.2/lib/app-defaults     \
+    /X11R6.1/lib/app-defaults     \
+    /X11R6/lib/app-defaults     \
+    /X11R5/lib/app-defaults     \
+    /X11R4/lib/app-defaults     \
+    ; \
+  do
+    if test -d "$ac_dir"; then
+      ac_x_app_defaults=$ac_dir
+      break
+    fi
+  done
+    fi
+])
+
+
+AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
+  [AC_REQUIRE_CPP()
+    AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
+     [AC_PATH_X_APP_DEFAULTS_XMKMF
+      AC_PATH_X_APP_DEFAULTS_DIRECT
+      if test x"$ac_x_app_defaults" = x; then
+        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
+      else
+        # Record where we found app-defaults for the cache.
+        ac_cv_x_app_defaults="$ac_x_app_defaults"
+      fi])
+    eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
+
+AC_PATH_X_APP_DEFAULTS
+
+APPDEFAULTS=$ac_x_app_defaults
+
+AC_ARG_WITH(includes, [  --with-includes=DIR     search include DIR for optional packages below])
+case "x$withval" in
+x/*|x.*)
+  extra_include=$withval
+  AC_MSG_RESULT([adding $extra_include to include search path for following packages])
+  if test ! -d $extra_include; then
+    AC_MSG_RESULT([Warning: Directory $extra_include does not exist])
+  fi
+  ;;
+*)
+  extra_include=""
+  ;;
+esac
+
+AC_ARG_WITH(libraries, [  --with-libraries=DIR    search library DIR for optional packages below])
+case "x$withval" in
+x/*|x.*)
+  extra_lib=$withval
+  AC_MSG_RESULT([adding $extra_lib to library search path for following packages])
+  if test ! -d $extra_lib; then
+    AC_MSG_RESULT([Warning: Directory $extra_lib does not exist])
+  fi
+  ;;
+*)
+  extra_lib=""
+  ;;
+esac
+
+dnl Xm MOTIF Motif motif
+
+AC_DEFUN(AC_PATH_MOTIF_DIRECT,
+[test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
+test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
+test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
+  for ac_dir in               \
+    /usr/include/Motif1.2     \
+    /usr/Motif1.2/include     \
+                              \
+    /usr/motif/include        \
+                              \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X11/include          \
+    /usr/include/X11          \
+    /usr/local/X11/include    \
+    /usr/local/include/X11    \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/dt/include           \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$motif_direct_test_include"; then
+      no_motif= ac_motif_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$motif_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
+    /usr/lib/Motif1.2     \
+    /usr/Motif1.2/lib     \
+                          \
+    /usr/motif/lib        \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X11/lib          \
+    /usr/lib/X11          \
+    /usr/local/X11/lib    \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
+      no_motif= ac_motif_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_MOTIF,
+[AC_REQUIRE_CPP()dnl
+
+motif_includes=NONE
+motif_libraries=NONE
+
+AC_MSG_CHECKING(for Motif)
+AC_ARG_WITH(motif, [  --without-motif         disable Motif (for xmlock)])
+if test "x$with_motif" = xno; then
+  no_motif=yes
+else
+  if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
+    no_motif=
+  else
+AC_CACHE_VAL(ac_cv_path_motif,
+[# One or both of these vars are not set, and there is no cached value.
+no_motif=yes
+AC_PATH_MOTIF_DIRECT
+
+if test "$no_motif" = yes; then
+  ac_cv_path_motif="no_motif=yes"
+else
+  ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_motif"
+fi # with_motif != no
+
+if test "$no_motif" = yes; then
+  AC_MSG_RESULT(no)
+  XMLOCK=""
+  INSTALL_XMLOCK=""
+  UNINSTALL_XMLOCK=""
+else
+  XMLOCKLIBS="-lXm ${XMLOCKLIBS}"
+  XMLOCK="xmlock"
+  INSTALL_XMLOCK="install_xmlock"
+  UNINSTALL_XMLOCK="uninstall_xmlock"
+  test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
+  test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
+  ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
+  AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
+fi
+])
+
+AC_PATH_MOTIF
+
+if test "x$motif_libraries" != x && test "x$motif_libraries" != xNONE ; then
+  XMLOCK_LDFLAGS="${XMLOCK_LDFLAGS}:$motif_libraries"
+  XMLOCKLIBPATHS="${XMLOCKLIBPATHS} -L$motif_libraries"
+fi
+if test "x$motif_includes" != x && test "x$motif_includes" != xNONE ; then
+  XMLOCKINC="${XMLOCKINC} -I$motif_includes"
+fi
+
+dnl Xmu EDITRES Editres editres
+
+AC_DEFUN(AC_PATH_EDITRES_DIRECT,
+[test -z "$editres_direct_test_library" && editres_direct_test_library=Xmu
+test -z "$editres_direct_test_function" && editres_direct_test_function=_XEditResCheckMessages
+test -z "$editres_direct_test_include" && editres_direct_test_include=X11/Xmu/Editres.h
+  for ac_dir in               \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include      \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$editres_direct_test_include"; then
+      no_editres= ac_editres_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$editres_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_editres_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${editres_direct_test_library}.$ac_extension; then
+      no_editres= ac_editres_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_EDITRES,
+[AC_REQUIRE_CPP()dnl
+
+editres_includes=NONE
+editres_libraries=NONE
+
+AC_MSG_CHECKING(for Editres)
+AC_ARG_WITH(editres, [  --without-editres       disable debugger (for x?lock)])
+if test "x$with_editres" = xno; then
+  no_editres=yes
+else
+  if test "x$editres_includes" != xNONE && test "x$editres_libraries" != xNONE; then
+    no_editres=
+  else
+AC_CACHE_VAL(ac_cv_path_editres,
+[# One or both of these vars are not set, and there is no cached value.
+no_editres=yes
+AC_PATH_EDITRES_DIRECT
+
+if test "$no_editres" = yes; then
+  ac_cv_path_editres="no_editres=yes"
+else
+  ac_cv_path_editres="no_editres= ac_editres_includes=$ac_editres_includes ac_editres_libraries=$ac_editres_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_editres"
+fi # with_editres != no
+
+if test "$no_editres" = yes; then
+  AC_MSG_RESULT(no)
+else
+  AC_DEFINE(USE_XMU)
+  XLOCKLIBS="${XLOCKLIBS} -lXmu"
+  XMLOCKLIBS="-lXmu ${XMLOCKLIBS}"
+  test "x$editres_includes" = xNONE && editres_includes=$ac_editres_includes
+  test "x$editres_libraries" = xNONE && editres_libraries=$ac_editres_libraries
+  ac_cv_path_editres="no_editres= ac_editres_includes=$editres_includes ac_editres_libraries=$editres_libraries"
+  AC_MSG_RESULT([libraries $editres_libraries, headers $editres_includes])
+fi
+])
+
+AC_PATH_EDITRES
+
+if test "x$editres_libraries" != x && test "x$editres_libraries" != xNONE ; then
+  XMLOCK_LDFLAGS="${XMLOCK_LDFLAGS}:$editres_libraries"
+  XMLOCKLIBPATHS="${XMLOCKLIBPATHS} -L$editres_libraries"
+fi
+if test "x$editres_includes" != x && test "x$editres_includes" != xNONE ; then
+  XMLOCKINC="${XMLOCKINC} -I$editres_includes"
+fi
+
+xpm=no
+dnl Xpm XPM xpm
+
+AC_DEFUN(AC_PATH_XPM_DIRECT,
+[test -z "$xpm_direct_test_library" && xpm_direct_test_library=Xpm
+test -z "$xpm_direct_test_function" && xpm_direct_test_function=XpmCreateImageFromData
+test -z "$xpm_direct_test_include" && xpm_direct_test_include=xpm.h
+  for ac_dir in                   \
+    /usr/X11R6.5.1/include/X11    \
+    /usr/X11R6.4/include/X11      \
+    /usr/X11R6.3/include/X11      \
+    /usr/X11R6.2/include/X11      \
+    /usr/X11R6.1/include/X11      \
+    /usr/X11R6/include/X11        \
+    /usr/X11R5/include/X11        \
+    /usr/X11R4/include/X11        \
+    /usr/X11/include/X11          \
+                                  \
+    /usr/include/X11/X11          \
+    /usr/include/X11R6.5.1/X11    \
+    /usr/include/X11R6.4/X11      \
+    /usr/include/X11R6.3/X11      \
+    /usr/include/X11R6.2/X11      \
+    /usr/include/X11R6.1/X11      \
+    /usr/include/X11R6/X11        \
+    /usr/include/X11R5/X11        \
+    /usr/include/X11R4/X11        \
+                                  \
+    /usr/local/X11/include/X11    \
+    /usr/local/X11R6.5.1/include/X11  \
+    /usr/local/X11R6.4/include/X11  \
+    /usr/local/X11R6.3/include/X11  \
+    /usr/local/X11R6.2/include/X11  \
+    /usr/local/X11R6.1/include/X11  \
+    /usr/local/X11R6/include/X11  \
+    /usr/local/X11R5/include/X11  \
+    /usr/local/X11R4/include/X11  \
+                                  \
+    /usr/local/include/X11/X11    \
+    /usr/local/include/X11R6.5.1/X11  \
+    /usr/local/include/X11R6.4/X11  \
+    /usr/local/include/X11R6.3/X11  \
+    /usr/local/include/X11R6.2/X11  \
+    /usr/local/include/X11R6.1/X11  \
+    /usr/local/include/X11R6/X11  \
+    /usr/local/include/X11R5/X11  \
+    /usr/local/include/X11R4/X11  \
+                                  \
+    /usr/X386/include/X11         \
+    /usr/x386/include/X11         \
+    /usr/XFree86/include/X11/X11  \
+                                  \
+    /usr/local/include/X11        \
+    /usr/remote/include/X11       \
+    /usr/include/X11              \
+    /usr/unsupported/include/X11  \
+    /usr/athena/include/X11       \
+    /usr/local/x11r5/include/X11  \
+    /usr/lpp/Xamples/include/X11  \
+                                  \
+    /usr/openwin/include/X11      \
+    /usr/openwin/share/include/X11 \
+    /usr/openwin/include          \
+                                  \
+    /usr/include/Vk               \
+    $extra_include                \
+    $extra_include/X11            \
+    ; \
+  do
+    if test -r "$ac_dir/$xpm_direct_test_include"; then
+      no_xpm= ac_xpm_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$xpm_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_xpm_includes" | sed s%/X11$%% | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${xpm_direct_test_library}.$ac_extension; then
+      no_xpm= ac_xpm_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_XPM,
+[AC_REQUIRE_CPP()dnl
+
+xpm_includes=NONE
+xpm_libraries=NONE
+
+AC_MSG_CHECKING(for XPM)
+AC_ARG_WITH(xpm, [  --without-xpm           enable color pixmap XPM mode(s)])
+if test "x$with_xpm" = xno; then
+  no_xpm=yes
+else
+  if test "x$xpm_includes" != xNONE && test "x$xpm_libraries" != xNONE; then
+    no_xpm=
+  else
+AC_CACHE_VAL(ac_cv_path_xpm,
+[# One or both of these vars are not set, and there is no cached value.
+no_xpm=yes
+AC_PATH_XPM_DIRECT
+
+if test "$no_xpm" = yes; then
+  ac_cv_path_xpm="no_xpm=yes"
+else
+  ac_cv_path_xpm="no_xpm= ac_xpm_includes=$ac_xpm_includes ac_xpm_libraries=$ac_xpm_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_xpm"
+fi # with_xpm != no
+
+if test "$no_xpm" = yes; then
+  AC_MSG_RESULT(no)
+  XPM="#"
+else
+  xpm=yes
+  AC_DEFINE(USE_XPMINC)
+  XLOCKLIBS="${XLOCKLIBS} -lXpm"
+  XMLOCKLIBS="-lXpm ${XMLOCKLIBS}"
+  test "x$xpm_includes" = xNONE && xpm_includes=$ac_xpm_includes
+  test "x$xpm_libraries" = xNONE && xpm_libraries=$ac_xpm_libraries
+  ac_cv_path_xpm="no_xpm= ac_xpm_includes=$xpm_includes ac_xpm_libraries=$xpm_libraries"
+  AC_MSG_RESULT([libraries $xpm_libraries, headers $xpm_includes])
+  XPM=""
+fi
+])
+
+AC_PATH_XPM
+
+if test "x$xpm_libraries" != x && test "x$xpm_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$xpm_libraries"
+  XMLOCK_LDFLAGS="${XMLOCK_LDFLAGS}:$xpm_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$xpm_libraries"
+  XMLOCKLIBPATHS="${XMLOCKLIBPATHS} -L$xpm_libraries"
+fi
+if test "x$xpm_includes" != x && test "x$xpm_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$xpm_includes"
+fi
+
+gltt=no
+dnl gltt GLTT
+
+AC_DEFUN(AC_PATH_GLTT_DIRECT,
+[test -z "$gltt_direct_test_library" && gltt_direct_test_library=gltt
+# test -z "$gltt_direct_test_function" && gltt_direct_test_function=glttCreateImageFromData
+test -z "$gltt_direct_test_include" && gltt_direct_test_include=gltt/GLTTFont.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    /usr/openwin/include      \
+                              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$gltt_direct_test_include"; then
+      no_gltt= ac_gltt_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$gltt_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_gltt_includes" | sed s%/X11$%% | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${gltt_direct_test_library}.$ac_extension; then
+      no_gltt= ac_gltt_libraries=$ac_dir
+      break 2
+   fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_GLTT,
+[AC_REQUIRE_CPP()dnl
+
+gltt_includes=NONE
+gltt_libraries=NONE
+
+AC_MSG_CHECKING(for GLTT)
+AC_ARG_WITH(gltt, [  --without-gltt          disable GL True text library])
+if test "x$with_gltt" = xno; then
+  no_gltt=yes
+else
+  if test "x$gltt_includes" != xNONE && test "x$gltt_libraries" != xNONE; then
+    no_gltt=
+  else
+AC_CACHE_VAL(ac_cv_path_gltt,
+[# One or both of these vars are not set, and there is no cached value.
+no_gltt=yes
+AC_PATH_GLTT_DIRECT
+
+if test "$no_gltt" = yes; then
+  ac_cv_path_gltt="no_gltt=yes"
+else
+  ac_cv_path_gltt="no_gltt= ac_gltt_includes=$ac_gltt_includes ac_gltt_libraries=$ac_gltt_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_gltt"
+fi # with_gltt != no
+
+if test "$no_gltt" = yes; then
+  AC_MSG_RESULT(no)
+  GLTT="#"
+else
+  gltt=yes
+  AC_DEFINE(HAVE_GLTT)
+  XLOCKLIBS="${XLOCKLIBS} -lgltt"
+  test "x$gltt_includes" = xNONE && gltt_includes=$ac_gltt_includes
+  test "x$gltt_libraries" = xNONE && gltt_libraries=$ac_gltt_libraries
+  ac_cv_path_gltt="no_gltt= ac_gltt_includes=$gltt_includes ac_gltt_libraries=$gltt_libraries"
+  AC_MSG_RESULT([libraries $gltt_libraries, headers $gltt_includes])
+  GLTT=""
+fi
+])
+
+AC_PATH_GLTT
+
+if test "x$gltt_libraries" != x && test "x$gltt_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$gltt_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$gltt_libraries"
+fi
+if test "x$gltt_includes" != x && test "x$gltt_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$gltt_includes"
+fi
+
+ttf=no
+dnl ttf TTF
+
+AC_DEFUN(AC_PATH_TTF_DIRECT,
+[test -z "$ttf_direct_test_library" && ttf_direct_test_library=ttf
+test -z "$ttf_direct_test_function" && ttf_direct_test_function=TT_Init_FreeType
+test -z "$ttf_direct_test_include" && ttf_direct_test_include=gltt/FTFace.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include/X11          \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    /usr/openwin/include      \
+                              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$ttf_direct_test_include"; then
+      no_ttf= ac_ttf_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$ttf_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_ttf_includes" | sed s%/X11$%% | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib      \
+    /usr/X11R6.4/lib        \
+    /usr/X11R6.3/lib        \
+    /usr/X11R6.2/lib        \
+    /usr/X11R6.1/lib        \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1      \
+    /usr/lib/X11R6.4        \
+    /usr/lib/X11R6.3        \
+    /usr/lib/X11R6.2        \
+    /usr/lib/X11R6.1        \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${ttf_direct_test_library}.$ac_extension; then
+      no_ttf= ac_ttf_libraries=$ac_dir
+      break 2
+   fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_TTF,
+[AC_REQUIRE_CPP()dnl
+
+ttf_includes=NONE
+ttf_libraries=NONE
+
+AC_MSG_CHECKING(for TTF)
+AC_ARG_WITH(ttf, [  --without-ttf           enable color pixmap TTF mode(s)])
+if test "x$with_ttf" = xno; then
+  no_ttf=yes
+else
+  if test "x$ttf_includes" != xNONE && test "x$ttf_libraries" != xNONE; then
+    no_ttf=
+  else
+AC_CACHE_VAL(ac_cv_path_ttf,
+[# One or both of these vars are not set, and there is no cached value.
+no_ttf=yes
+AC_PATH_TTF_DIRECT
+
+if test "$no_ttf" = yes; then
+  ac_cv_path_ttf="no_ttf=yes"
+else
+  ac_cv_path_ttf="no_ttf= ac_ttf_includes=$ac_ttf_includes ac_ttf_libraries=$ac_ttf_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_ttf"
+fi # with_ttf != no
+
+if test "$no_ttf" = yes; then
+  AC_MSG_RESULT(no)
+  TTF="#"
+else
+  ttf=yes
+  AC_DEFINE(HAVE_TTF)
+  XLOCKLIBS="${XLOCKLIBS} -lttf"
+  test "x$ttf_includes" = xNONE && ttf_includes=$ac_ttf_includes
+  test "x$ttf_libraries" = xNONE && ttf_libraries=$ac_ttf_libraries
+  ac_cv_path_ttf="no_ttf= ac_ttf_includes=$ttf_includes ac_ttf_libraries=$ttf_libraries"
+  AC_MSG_RESULT([libraries $ttf_libraries, headers $ttf_includes])
+  TTF=""
+fi
+])
+
+AC_PATH_TTF
+
+if test "x$ttf_libraries" != x && test "x$ttf_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$ttf_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$ttf_libraries"
+fi
+if test "x$ttf_includes" != x && test "x$ttf_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$ttf_includes"
+fi
+
+gl=no
+dnl OpenGL opengl
+
+dnl test -z "$opengl_direct_test_library" && opengl_direct_test_library=opengl
+AC_DEFUN(AC_PATH_OPENGL_DIRECT,
+[test -z "$opengl_direct_test_library" && opengl_direct_test_library=GL
+test -z "$opengl_direct_test_library" && opengl_direct_test_library=GLU
+test -z "$opengl_direct_test_function" && opengl_direct_test_function=glXCreateContext
+test -z "$opengl_direct_test_include" && opengl_direct_test_include=GL/gl.h
+  for ac_dir in               \
+    /usr/include              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+                              \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/unsupported/include  \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    $extra_include            \
+    ; \
+  do
+dnl # Make sure this is not Mesa
+dnl    if test -r "$ac_dir/$opengl_direct_test_include" && test ! -r "$ac_dir/GL/xmesa.h"; then
+    if test -r "$ac_dir/$opengl_direct_test_include"; then
+      no_opengl= ac_opengl_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$opengl_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_opengl_includes" | sed s/include/lib/` \
+                          \
+    /usr/lib              \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+# Make sure its not a symbolic link to MesaGL library
+
+    if test -r $ac_dir/lib${opengl_direct_test_library}.$ac_extension && test ! $ac_link_test $ac_dir/lib${opengl_direct_test_library}.$ac_extension && test ! -r $ac_dir/libMesa${opengl_direct_test_library}.$ac_extension; then
+      no_opengl= ac_opengl_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_OPENGL,
+[AC_REQUIRE_CPP()dnl
+
+opengl_includes=NONE
+opengl_libraries=NONE
+
+AC_MSG_CHECKING(for OpenGL)
+AC_MSG_RESULT(OK if OpenGL found is really Mesa)
+AC_ARG_WITH(opengl, [  --without-opengl        disable 3D OpenGL (for GL modes)])
+if test "x$with_opengl" = xno; then
+  no_opengl=yes
+else
+  if test "x$opengl_includes" != xNONE && test "x$opengl_libraries" != xNONE; then
+    no_opengl=
+  else
+AC_CACHE_VAL(ac_cv_path_opengl,
+[# One or both of these vars are not set, and there is no cached value.
+no_opengl=yes
+AC_PATH_OPENGL_DIRECT
+
+if test "$no_opengl" = yes; then
+  ac_cv_path_opengl="no_opengl=yes"
+else
+  ac_cv_path_opengl="no_opengl= ac_opengl_includes=$ac_opengl_includes ac_opengl_libraries=$ac_opengl_libraries"
+
+fi])dnl
+  fi
+  eval "$ac_cv_path_opengl"
+fi # with_opengl != no
+
+if test "$no_opengl" = yes; then
+  AC_MSG_RESULT(no)
+else
+  gl=yes
+  AC_DEFINE(USE_GL)
+  XLOCKLIBS="${XLOCKLIBS} -lGL -lGLU"
+  test "x$opengl_includes" = xNONE && opengl_includes=$ac_opengl_includes
+  test "x$opengl_libraries" = xNONE && opengl_libraries=$ac_opengl_libraries
+  case "${canonical}" in
+    *-*-solaris2* )
+      AC_DEFINE(SUN_OGL_NO_VERTEX_MACROS)
+      if test "x$opengl_includes" = "x/usr/include"; then
+        opengl_includes=""
+      fi
+    ;;
+    *-*-irix5* | *-*-irix6* )
+      XLOCKLIBS="${XLOCKLIBS} -lgl"
+    ;;
+  esac
+  ac_cv_path_opengl="no_opengl= ac_opengl_includes=$opengl_includes ac_opengl_libraries=$opengl_libraries"
+  AC_MSG_RESULT([libraries $opengl_libraries, headers $opengl_includes])
+  GL=""
+fi
+])
+
+AC_PATH_OPENGL
+
+if test "x$opengl_libraries" != x && test "x$opengl_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$opengl_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$opengl_libraries"
+fi
+if test "x$opengl_includes" != x && test "x$opengl_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$opengl_includes"
+fi
+
+dnl Mesa mesa
+
+dnl test -z "$mesa_direct_test_library" && mesa_direct_test_library=MesaGLU
+AC_DEFUN(AC_PATH_MESA_DIRECT,
+[test -z "$mesa_direct_test_library" && mesa_direct_test_library=MesaGL
+test -z "$mesa_direct_test_library" && mesa_direct_test_library=MesaGLU
+test -z "$mesa_direct_test_function" && mesa_direct_test_function=glXCreateContext
+test -z "$mesa_direct_test_include" && mesa_direct_test_include=GL/gl.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$mesa_direct_test_include"; then
+      no_mesa= ac_mesa_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$mesa_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_mesa_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11/lib          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11      \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${mesa_direct_test_library}.$ac_extension; then
+      no_mesa= ac_mesa_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_MESA,
+[AC_REQUIRE_CPP()dnl
+
+mesa_includes=NONE
+mesa_libraries=NONE
+
+AC_MSG_CHECKING(for Mesa)
+AC_ARG_WITH(mesa, [  --without-mesa          disable Mesa 3D (for GL modes)])
+if test "x$with_mesa" = xno; then
+  no_mesa=yes
+else
+  if test "x$mesa_includes" != xNONE && test "x$mesa_libraries" != xNONE; then
+    no_mesa=
+  else
+AC_CACHE_VAL(ac_cv_path_mesa,
+[# One or both of these vars are not set, and there is no cached value.
+no_mesa=yes
+AC_PATH_MESA_DIRECT
+
+if test "$no_mesa" = yes; then
+  ac_cv_path_mesa="no_mesa=yes"
+else
+  ac_cv_path_mesa="no_mesa= ac_mesa_includes=$ac_mesa_includes ac_mesa_libraries=$ac_mesa_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_mesa"
+fi # with_mesa != no
+
+if test "$no_mesa" = yes; then
+  AC_MSG_RESULT(no)
+  GL="#"
+else
+  if test "$gl" = no; then
+    gl=yes
+    AC_DEFINE(USE_GL)
+    XLOCKLIBS="${XLOCKLIBS} -lMesaGL -lMesaGLU"
+    test "x$mesa_includes" = xNONE && mesa_includes=$ac_mesa_includes
+    test "x$mesa_libraries" = xNONE && mesa_libraries=$ac_mesa_libraries
+    case "${canonical}" in
+      *-*-solaris2* )
+        if test "x$mesa_includes" = "x/usr/include"; then
+          mesa_includes=""
+        fi
+      ;;
+    esac
+    ac_cv_path_mesa="no_mesa= ac_mesa_includes=$mesa_includes ac_mesa_libraries=$mesa_libraries"
+    AC_MSG_RESULT([libraries $mesa_libraries, headers $mesa_includes])
+    # Issue a warning if the version number of Mesa is less than 3.0 since
+    # 2.6 and earlier had a security bug and 2.2 and earlier had memory leaks.
+    # pre-3.4 Mesa will core dump with the -showfps option. A patch must be
+    # applied to 3.4 and 3.4.1 Mesa to correct a memory leak in the molecule
+    # mode and the -showfps option. This memory leak is fixed in Mesa 3.4.2
+    AC_CACHE_CHECK([Mesa version number], ac_cv_mesa_version_string,
+        [cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+#include <GL/xmesa.h>
+configure: XMESA_MAJOR_VERSION XMESA_MINOR_VERSION
+EOF
+         ac_save_CPPFLAGS="$CPPFLAGS"
+         if test \! -z "$ac_mesa_includes" ; then
+           CPPFLAGS="$CPPFLAGS -I$ac_mesa_includes"
+         fi
+         CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+         changequote(X,Y)
+         mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | sed -n \
+              's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
+         changequote([,])
+
+         rm -f conftest.$ac_ext
+
+         CPPFLAGS="$ac_save_CPPFLAGS"
+
+         if test "$mglv" = ""; then
+           ac_mesa_version=unknown
+           ac_mesa_version_string=unknown
+         else
+           ac_mesa_version_string=$mglv
+           maj=`echo $mglv | sed -n 's/\..*//p'`
+           min=`echo $mglv | sed -n 's/.*\.//p'`
+           ac_mesa_version=`echo "$maj * 1000 + $min" | bc`
+           if test -z "$ac_mesa_version"; then
+             ac_mesa_version=unknown
+             ac_mesa_version_string=unknown
+           fi
+         fi
+         ac_cv_mesa_version=$ac_mesa_version
+         ac_cv_mesa_version_string=$ac_mesa_version_string
+      ]) 
+    ac_mesa_version=$ac_cv_mesa_version
+    ac_mesa_version_string=$ac_cv_mesa_version_string
+    preferred_mesa="3.4.2"
+    if test "$ac_mesa_version" = unknown; then
+      AC_MSG_RESULT(!!!WARNING!!! Unable to determine the Mesa version number!)
+      AC_MSG_RESULT(!!!WARNING!!! Make sure you are using Mesa version $preferred_mesa or newer.)
+    elif test \! "$ac_mesa_version" -gt 3004; then
+      AC_MSG_RESULT(!!!WARNING!!! Mesa version $ac_mesa_version_string is being used.)
+      AC_MSG_RESULT(!!!WARNING!!! Mesa versions 3.4.1 and earlier have a memory leak when using)
+      AC_MSG_RESULT(!!!WARNING!!! molecule mode or the -showfps option. This can be corrected by)
+      AC_MSG_RESULT(!!!WARNING!!! applying the Mesa.patch file to Mesa 3.4 or 3.4.1 using patch)
+      AC_MSG_RESULT(!!!WARNING!!! or by using Mesa 3.4.2 or newer.)
+      if test \! "$ac_mesa_version" -gt 3003; then
+        AC_MSG_RESULT(!!!WARNING!!! Mesa version $ac_mesa_version_string is being used.)
+        AC_MSG_RESULT(!!!WARNING!!! Mesa versions 3.3 and earlier will SEGV with the -showfps option.)
+        if test \! "$ac_mesa_version" -gt 2006; then
+          AC_MSG_RESULT(!!!WARNING!!! Mesa versions 2.6 and earlier have a security bug.)
+          if test \! "$ac_mesa_version" -gt 2002; then
+            AC_MSG_RESULT(!!!WARNING!!! Mesa versions 2.2 and earlier have memory leaks.)
+          fi
+        fi
+      fi
+      AC_MSG_RESULT(!!!WARNING!!! It is strongly recommended that you upgrade to Mesa V$preferred_mesa or newer.)
+    fi
+
+    case "${canonical}" in
+      *-*-linux* )
+        # Testing if Mesa was compiled against VGA
+        if test -f $mesa_libraries/libMesaGL.so; then
+          have_mesa_svga=`nm $mesa_libraries/libMesaGL.so | grep SVGAMesa | wc -l`
+        else
+          have_mesa_svga=0
+        fi
+        if eval "test $have_mesa_svga -ge 1"; then
+          AC_MSG_RESULT([Mesa library is linked against SVGA: adding -lvga])
+          XLOCKLIBS="${XLOCKLIBS} -lvga"
+        fi
+        # Testing if Mesa was compiled against glide
+        if test -f $mesa_libraries/libMesaGL.so; then
+          have_mesa_glide=`nm $mesa_libraries/libMesaGL.so | grep grGlideInit | wc -l`
+        else
+          have_mesa_glide=0
+        fi
+        if eval "test $have_mesa_glide -ge 1"; then
+          AC_MSG_RESULT([Mesa library is linked against GLIDE: adding -lglide2x])
+          XLOCKLIBS="${XLOCKLIBS} -lglide2x"
+        fi
+#  Causes major errors for maintainer.  xlock refuses to run.
+#  I am not able to reproduce the problem ? What is it ?
+# Does a new glibc version fix this problem ?
+        # Testing if Mesa was compiled against pthread
+        if test -f $mesa_libraries/libMesaGL.so; then
+          have_mesa_pthread=`nm $mesa_libraries/libMesaGL.so | grep pthread_once | wc -l`
+        else
+          have_mesa_pthread=0
+        fi
+        if eval "test $have_mesa_pthread -ge 1"; then
+          AC_MSG_RESULT([Mesa library is linked against PTHREAD: adding -lpthread])
+          XLOCKLIBS="${XLOCKLIBS} -lpthread"
+        fi
+        ;;
+    esac
+    GL=""
+  else
+    AC_MSG_RESULT(ignored - using OpenGL)
+  fi
+
+fi
+])
+
+AC_PATH_MESA
+
+if test "x$mesa_libraries" != x && test "x$mesa_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="$mesa_libraries:${XLOCK_LDFLAGS}"
+  XLOCKLIBPATHS="-L$mesa_libraries ${XLOCKLIBPATHS}"
+fi
+if test "x$mesa_includes" != x && test "x$mesa_includes" != xNONE ; then
+  XLOCKINC="-I$mesa_includes ${XLOCKINC}"
+fi
+
+# Test if Mesa or OpenGL has GL1.1 features
+# (Should this test be performed only if (Mesa)GL is used? In that case
+# it fails anyway.)
+AC_MSG_CHECKING([for GL >=1.1])
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="${CFLAGS} ${XLOCKINC}"
+LIBS="${XLOCKLIBPATHS} ${XLOCKLIBS} -lX11 -lXext -lm"
+AC_CACHE_VAL(ac_cv_c_gl1_1,[
+AC_TRY_LINK([#define _XOPEN_SOURCE 1
+#include <GL/gl.h>], [
+GLint texture;
+glBindTexture(GL_TEXTURE_2D, texture);
+], ac_cv_c_gl1_1=yes, ac_cv_c_gl1_1=no)])
+dnl This does not seem to work on Sun's OpenGL
+dnl if test x"$ac_cv_c_gl1_1" = xyes; then
+    AC_DEFINE(HAVE_GLBINDTEXTURE)
+    AC_MSG_RESULT(yes)
+dnl else
+dnl    AC_MSG_RESULT(no)
+dnl fi
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+
+dnl DTSAVER DtSaver dtsaver DtSvc
+
+AC_DEFUN(AC_PATH_DTSAVER_DIRECT,
+[test -z "$dtsaver_direct_test_library" && dtsaver_direct_test_library=DtSvc
+test -z "$dtsaver_direct_test_function" && dtsaver_direct_test_function=DtSaverGetWindows
+test -z "$dtsaver_direct_test_include" && dtsaver_direct_test_include=Dt/Saver.h
+  for ac_dir in            \
+    /usr/dt/include        \
+    $extra_include         \
+    ; \
+  do
+    if test -r "$ac_dir/$dtsaver_direct_test_include"; then
+      no_dtsaver= ac_dtsaver_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$dtsaver_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_dtsaver_includes" | sed s/include/lib/` \
+    $extra_lib         \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${dtsaver_direct_test_library}.$ac_extension; then
+      no_dtsaver= ac_dtsaver_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_DTSAVER,
+[AC_REQUIRE_CPP()dnl
+
+dtsaver_includes=NONE
+dtsaver_libraries=NONE
+
+AC_MSG_CHECKING(for DtSaver)
+AC_ARG_WITH(dtsaver, [  --without-dtsaver       disable -dtsaver option])
+if test "x$with_dtsaver" = xno; then
+  no_dtsaver=yes
+else
+  if test "x$dtsaver_includes" != xNONE && test "x$dtsaver_libraries" != xNONE; then
+    no_dtsaver=
+  else
+AC_CACHE_VAL(ac_cv_path_dtsaver,
+[# One or both of these vars are not set, and there is no cached value.
+no_dtsaver=yes
+AC_PATH_DTSAVER_DIRECT
+
+if test "$no_dtsaver" = yes; then
+  ac_cv_path_dtsaver="no_dtsaver=yes"
+else
+  ac_cv_path_dtsaver="no_dtsaver= ac_dtsaver_includes=$ac_dtsaver_includes ac_dtsaver_libraries=$ac_dtsaver_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_dtsaver"
+fi # with_dtsaver != no
+
+if test "$no_dtsaver" = yes; then
+  AC_MSG_RESULT(no)
+else
+  AC_DEFINE(USE_DTSAVER)
+  XLOCKLIBS="${XLOCKLIBS} -lDtSvc"
+  test "x$dtsaver_includes" = xNONE && dtsaver_includes=$ac_dtsaver_includes
+  test "x$dtsaver_libraries" = xNONE && dtsaver_libraries=$ac_dtsaver_libraries
+  ac_cv_path_dtsaver="no_dtsaver= ac_dtsaver_includes=$dtsaver_includes ac_dtsaver_libraries=$dtsaver_libraries"
+  AC_MSG_RESULT([libraries $dtsaver_libraries, headers $dtsaver_includes])
+fi
+])
+
+AC_PATH_DTSAVER
+
+if test "x$dtsaver_libraries" != x && test "x$dtsaver_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$dtsaver_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$dtsaver_libraries"
+fi
+if test "x$dtsaver_includes" != x && test "x$dtsaver_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$dtsaver_includes"
+fi
+
+dnl Xdpms DPMS
+
+AC_DEFUN(AC_PATH_DPMS_DIRECT,
+[test -z "$dpms_direct_test_library" && dpms_direct_test_library=Xdpms
+test -z "$dpms_direct_test_function" && dpms_direct_test_function=DPMSSetTimeouts
+test -z "$dpms_direct_test_include" && dpms_direct_test_include=X11/extensions/dpms.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11R6.5.1    \
+    /usr/include/X11R6.4      \
+    /usr/include/X11R6.3      \
+    /usr/include/X11R6.2      \
+    /usr/include/X11R6.1      \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11R6.5.1/include  \
+    /usr/local/X11R6.4/include  \
+    /usr/local/X11R6.3/include  \
+    /usr/local/X11R6.2/include  \
+    /usr/local/X11R6.1/include  \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11R6.5.1  \
+    /usr/local/include/X11R6.4  \
+    /usr/local/include/X11R6.3  \
+    /usr/local/include/X11R6.2  \
+    /usr/local/include/X11R6.1  \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X11/include          \
+    /usr/include/X11          \
+    /usr/local/X11/include    \
+    /usr/local/include/X11    \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/dt/include           \
+                              \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    /usr/unsupported/include  \
+    /usr/dpms/include         \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$dpms_direct_test_include"; then
+      no_dpms= ac_dpms_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$dpms_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_dpms_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11R6.5.1    \
+    /usr/lib/X11R6.4      \
+    /usr/lib/X11R6.3      \
+    /usr/lib/X11R6.2      \
+    /usr/lib/X11R6.1      \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11R6.5.1/lib  \
+    /usr/local/X11R6.4/lib  \
+    /usr/local/X11R6.3/lib  \
+    /usr/local/X11R6.2/lib  \
+    /usr/local/X11R6.1/lib  \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11R6.5.1  \
+    /usr/local/lib/X11R6.4  \
+    /usr/local/lib/X11R6.3  \
+    /usr/local/lib/X11R6.2  \
+    /usr/local/lib/X11R6.1  \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X11/lib          \
+    /usr/lib/X11          \
+    /usr/local/X11/lib    \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    /usr/unsupported/lib  \
+    /usr/dpms/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    /shlib                \
+    /usr/shlib            \
+    /usr/shlib/X11        \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${dpms_direct_test_library}.$ac_extension; then
+      no_dpms= ac_dpms_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_DPMS,
+[AC_REQUIRE_CPP()dnl
+
+dpms_includes=NONE
+dpms_libraries=NONE
+
+AC_MSG_CHECKING(for DPMS)
+AC_ARG_WITH(dpms, [  --without-dpms          disable DPMS])
+dpmslib=no
+if test "x$with_dpms" = xno; then
+  no_dpms=yes
+else
+  if test "x$dpms_includes" != xNONE && test "x$dpms_libraries" != xNONE; then
+    no_dpms=
+  else
+AC_CACHE_VAL(ac_cv_path_dpms,
+[# One or both of these vars are not set, and there is no cached value.
+no_dpms=yes
+AC_PATH_DPMS_DIRECT
+
+if test "$no_dpms" = yes; then
+  ac_cv_path_dpms="no_dpms=yes"
+else
+  ac_cv_path_dpms="no_dpms= ac_dpms_includes=$ac_dpms_includes ac_dpms_libraries=$ac_dpms_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_dpms"
+fi # with_dpms != no
+
+if test "$no_dpms" = yes; then
+  AC_MSG_RESULT(no)
+else
+  AC_DEFINE(USE_DPMS)
+dnl test needed for Digital Unix machines
+  if test "x$ac_dpms_libraries" != x && test "x$ac_dpms_libraries" != xNONE ; then
+    XLOCKLIBS="${XLOCKLIBS} -lXdpms"
+  fi
+  test "x$dpms_includes" = xNONE && dpms_includes=$ac_dpms_includes
+  test "x$dpms_libraries" = xNONE && dpms_libraries=$ac_dpms_libraries
+  ac_cv_path_dpms="no_dpms= ac_dpms_includes=$dpms_includes ac_dpms_libraries=$dpms_libraries"
+  AC_MSG_RESULT([libraries $dpms_libraries, headers $dpms_includes])
+fi
+])
+
+AC_PATH_DPMS
+
+if test "x$dpms_libraries" != x && test "x$dpms_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$dpms_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$dpms_libraries"
+fi
+if test "x$dpms_includes" != x && test "x$dpms_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$dpms_includes"
+fi
+
+sound=none
+dnl RPLAY RPlay rplay
+
+AC_DEFUN(AC_PATH_RPLAY_DIRECT,
+[test -z "$rplay_direct_test_library" && rplay_direct_test_library=rplay
+test -z "$rplay_direct_test_function" && rplay_direct_test_function=rplay_open_default
+test -z "$rplay_direct_test_include" && rplay_direct_test_include=rplay.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$rplay_direct_test_include"; then
+      no_rplay= ac_rplay_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$rplay_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_rplay_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11/lib          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${rplay_direct_test_library}.$ac_extension; then
+      no_rplay= ac_rplay_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_RPLAY,
+[AC_REQUIRE_CPP()dnl
+
+rplay_includes=NONE
+rplay_libraries=NONE
+
+AC_MSG_CHECKING(for RPLAY)
+AC_ARG_WITH(rplay, [  --without-rplay         disable RPLAY sounds])
+if test "x$with_rplay" = xno; then
+  no_rplay=yes
+else
+  if test "x$rplay_includes" != xNONE && test "x$rplay_libraries" != xNONE; then
+    no_rplay=
+  else
+AC_CACHE_VAL(ac_cv_path_rplay,
+[# One or both of these vars are not set, and there is no cached value.
+no_rplay=yes
+AC_PATH_RPLAY_DIRECT
+
+if test "$no_rplay" = yes; then
+  ac_cv_path_rplay="no_rplay=yes"
+else
+  ac_cv_path_rplay="no_rplay= ac_rplay_includes=$ac_rplay_includes ac_rplay_libraries=$ac_rplay_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_rplay"
+fi # with_rplay != no
+
+if test "$no_rplay" = yes; then
+  AC_MSG_RESULT(no)
+else
+dnl  solaris26=no
+dnl  case "${canonical}" in
+dnl    *-*-solaris2.6 )
+dnl    solaris26=yes
+dnl    ;;
+dnl  esac
+dnl  if test "$CC" = gcc && test "$solaris26" = yes; then
+dnl    AC_MSG_RESULT(ignored - problems here with gcc and solaris2.6)
+dnl  else
+    sound=rplay
+    AC_DEFINE(USE_RPLAY)
+    XLOCKLIBS="${XLOCKLIBS} -lrplay"
+    test "x$rplay_includes" = xNONE && rplay_includes=$ac_rplay_includes
+    test "x$rplay_libraries" = xNONE && rplay_libraries=$ac_rplay_libraries
+    ac_cv_path_rplay="no_rplay= ac_rplay_includes=$rplay_includes ac_rplay_libraries=$rplay_libraries"
+    AC_MSG_RESULT([libraries $rplay_libraries, headers $rplay_includes])
+dnl  fi
+fi
+])
+
+AC_PATH_RPLAY
+
+if test "x$rplay_libraries" != x && test "x$rplay_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$rplay_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$rplay_libraries"
+fi
+if test "x$rplay_includes" != x && test "x$rplay_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$rplay_includes"
+fi
+
+dnl ESOUND Enlightenment sound daemon
+
+AC_DEFUN(AC_PATH_ESOUND,
+[AC_REQUIRE_CPP()dnl
+
+esound_includes=NONE
+esound_libraries=NONE
+
+AC_MSG_CHECKING(for ESOUND)
+AC_ARG_WITH(esound,            [  --with-esound           enable Enlightenment Sound Daemon sounds])
+AC_ARG_WITH(esound_config,     [  --with-esound-config    use this configurator for Enlightenment Sound Daemon sounds])
+AC_ARG_WITH(esound_prefix,     [  --with-esound-prefix    use this prefix for Enlightenment Sound Daemon sounds])
+AC_ARG_WITH(esound_includes,   [  --with-esound-includes  use this dir for Enlightenment Sound Daemon sounds headers])
+AC_ARG_WITH(esound_librairies, [  --with-esound-libraries use this dir for Enlightenment Sound Daemon sounds libs])
+if test "x$with_esound" = xno; then
+  no_esound=yes
+else
+  if test "x$esound_includes" != xNONE && test "x$esound_libraries" != xNONE; then
+    no_esound=
+    if test "x$esound_config" = "x"; then
+      if test "x$esound_prefix" != "x"; then
+        esound_config="$esound_prefix/bin/esd-config"
+      else
+        esound_config="esd-config"
+     fi
+   else
+     if test "x$esound_prefix" = "x"; then
+        esound_prefix=`$esound_config --prefix`
+     fi
+   fi
+  else
+    if test "x$esound_config" = "x"; then
+      if test "x$esound_prefix" != "x"; then
+        esound_config="$esound_prefix/bin/esd-config"
+      else
+        esound_config="esd-config"
+     fi
+   else
+     if test "x$esound_prefix" = "x"; then
+        esound_prefix=`$esound_config --prefix`
+     fi
+   fi
+AC_CACHE_VAL(ac_cv_path_esound,
+[# One or both of these vars are not set, and there is no cached value.
+no_esound=yes
+if test "x$esound_prefix" != "x"; then
+  ac_esound_prefix=$esound_prefix
+  ac_esound_includes=$ac_esound_prefix/include
+  ac_esound_libraries=$ac_esound_prefix/lib
+  no_esound="ac_esound_config=$ac_esound_config ac_esound_prefix=$ac_esound_prefix ac_esound_includes=$ac_esound_includes ac_esound_libraries=$ac_esound_libraries"
+else
+  ac_esound_config="$esound_config"
+  ac_esound_prefix=`$esound_config --prefix`
+  if test $? != 0; then
+    no_esound=yes
+    ac_esound_config=""
+    ac_esound_prefix=""
+    echo
+    echo "cannot get prefix"
+  else
+    no_esound=
+    ac_esound_includes=$ac_esound_prefix/include
+    ac_esound_libraries=$ac_esound_prefix/lib
+  fi
+fi
+if test "$no_esound" = yes; then
+  ac_cv_path_esound="no_esound=yes"
+else
+  ac_cv_path_esound="no_esound= ac_esound_config=\"$ac_esound_config\" ac_esound_prefix=\"$ac_esound_prefix\" ac_esound_includes=\"$ac_esound_includes\" ac_esound_libraries=\"$ac_esound_libraries\""
+fi])dnl
+  fi
+  eval "$ac_cv_path_esound"
+fi # with_esound != no
+
+if test "$no_esound" = yes; then
+  AC_MSG_RESULT(no)
+else
+  if test "$sound" = none; then
+    sound=yes
+    AC_DEFINE(USE_ESOUND)
+    AC_DEFINE(HAVE_LIBESD)
+    test "x$esound_config" = xNONE && esound_config=$ac_esound_config
+    test "x$esound_prefix" = xNONE && esound_prefix=$ac_esound_prefix
+    test "x$esound_includes" = xNONE && esound_includes=$ac_esound_includes
+    test "x$esound_libraries" = xNONE && esound_libraries=$ac_esound_libraries
+    ac_cv_path_esound="no_esound= ac_esound_config=$esound_config ac_esound_prefix=$esound_prefix ac_esound_includes=$esound_includes ac_esound_libraries=$esound_libraries"
+    AC_MSG_RESULT([libraries $esound_libraries, headers $esound_includes])
+  else
+    AC_MSG_RESULT(ignored - using $sound)
+  fi
+fi
+])
+
+AC_PATH_ESOUND
+
+if test "x$esound_libraries" != x && test "x$esound_libraries" != xNONE ; then
+  XLOCKLIBS="${XLOCKLIBS} `$esound_config --libs`"
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$esound_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$esound_libraries"
+fi
+if test "x$esound_includes" != x && test "x$esound_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$esound_includes `$esound_config --cflags`"
+fi
+
+dnl NAS audio
+
+AC_DEFUN(AC_PATH_NAS_DIRECT,
+[test -z "$nas_direct_test_library" && nas_direct_test_library=audio
+test -z "$nas_direct_test_function" && nas_direct_test_function=AuOpenServer
+test -z "$nas_direct_test_include" && nas_direct_test_include=audio/audio.h
+  for ac_dir in               \
+    /usr/X11R6.5.1/include    \
+    /usr/X11R6.4/include      \
+    /usr/X11R6.3/include      \
+    /usr/X11R6.2/include      \
+    /usr/X11R6.1/include      \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11/include          \
+    /usr/local/include        \
+    /usr/remote/include       \
+    /usr/include              \
+    $extra_include            \
+    ; \
+  do
+    if test -r "$ac_dir/$nas_direct_test_include"; then
+      no_nas= ac_nas_includes=$ac_dir
+      break
+    fi
+  done
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$nas_direct_test_library $LIBS"
+# First see if replacing the include by lib works.
+for ac_dir in `echo "$ac_nas_includes" | sed s/include/lib/` \
+                          \
+    /usr/X11R6.5.1/lib    \
+    /usr/X11R6.4/lib      \
+    /usr/X11R6.3/lib      \
+    /usr/X11R6.2/lib      \
+    /usr/X11R6.1/lib      \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11/lib          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${nas_direct_test_library}.$ac_extension; then
+      no_nas= ac_nas_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_NAS,
+[AC_REQUIRE_CPP()dnl
+
+nas_includes=NONE
+nas_libraries=NONE
+
+AC_MSG_CHECKING(for NAS)
+AC_ARG_WITH(nas, [  --without-nas           disable NAS sounds])
+if test "x$with_nas" = xno; then
+  no_nas=yes
+else
+  if test "x$nas_includes" != xNONE && test "x$nas_libraries" != xNONE; then
+    no_nas=
+  else
+AC_CACHE_VAL(ac_cv_path_nas,
+[# One or both of these vars are not set, and there is no cached value.
+no_nas=yes
+AC_PATH_NAS_DIRECT
+
+if test "$no_nas" = yes; then
+  ac_cv_path_nas="no_nas=yes"
+else
+  ac_cv_path_nas="no_nas= ac_nas_includes=$ac_nas_includes ac_nas_libraries=$ac_nas_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_nas"
+fi # with_nas != no
+
+if test "$no_nas" = yes; then
+  AC_MSG_RESULT(no)
+else
+  if test "$sound" = none; then
+    sgi=no
+    case "${canonical}" in
+      *-*-irix5* | *-*-irix6* )
+        sgi=yes
+      ;;
+    esac
+    if test "$sgi" = yes; then
+      AC_MSG_RESULT(ignored - problems here with audio and nas)
+    else
+      sound=nas
+      AC_DEFINE(USE_NAS)
+      XLOCKLIBS="${XLOCKLIBS} -laudio"
+dnl    XLOCKLIBS="${XLOCKLIBS} -lnas"
+      test "x$nas_includes" = xNONE && nas_includes=$ac_nas_includes
+      test "x$nas_libraries" = xNONE && nas_libraries=$ac_nas_libraries
+      ac_cv_path_nas="no_nas= ac_nas_includes=$nas_includes ac_nas_libraries=$nas_libraries"
+      AC_MSG_RESULT([libraries $nas_libraries, headers $nas_includes])
+    fi
+  else
+      AC_MSG_RESULT(ignored - using rplay)
+  fi
+fi
+])
+
+AC_PATH_NAS
+
+if test "x$nas_libraries" != x && test "x$nas_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$nas_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$nas_libraries"
+fi
+if test "x$nas_includes" != x && test "x$nas_includes" != xNONE ; then
+  XLOCKINC="${XLOCKINC} -I$nas_includes"
+fi
+
+dnl crypt CRYPT
+
+AC_DEFUN(AC_PATH_CRYPT_DIRECT,
+[test -z "$crypt_direct_test_library" && crypt_direct_test_library=crypt
+
+# Check for the libraries.
+# See if we find them without any special options.
+# Do not add to $LIBS permanently.
+ac_save_LIBS="$LIBS"
+LIBS="-l$crypt_direct_test_library $LIBS"
+for ac_dir in \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/remote/lib       \
+    $extra_lib            \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${crypt_direct_test_library}.$ac_extension; then
+      no_crypt= ac_crypt_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+LIBS="$ac_save_LIBS"])
+AC_DEFUN(AC_PATH_CRYPT,
+[AC_REQUIRE_CPP()dnl
+
+crypt_libraries=NONE
+
+AC_MSG_CHECKING(for CRYPT)
+AC_ARG_WITH(crypt, [  --without-crypt         disable CRYPT])
+if test "x$with_crypt" = xno; then
+  no_crypt=yes
+else
+  if test "x$crypt_libraries" != xNONE; then
+    no_crypt=
+  else
+AC_CACHE_VAL(ac_cv_path_crypt,
+[# One or both of these vars are not set, and there is no cached value.
+no_crypt=yes
+AC_PATH_CRYPT_DIRECT
+
+if test "$no_crypt" = yes; then
+  ac_cv_path_crypt="no_crypt=yes"
+else
+  ac_cv_path_crypt="no_crypt= ac_crypt_libraries=$ac_crypt_libraries"
+fi])dnl
+  fi
+  eval "$ac_cv_path_crypt"
+fi # with_crypt != no
+
+if test "$no_crypt" = yes; then
+  AC_MSG_RESULT(no)
+else
+  XLOCKLIBS="${XLOCKLIBS} -lcrypt"
+  test "x$crypt_libraries" = xNONE && crypt_libraries=$ac_crypt_libraries
+  ac_cv_path_crypt="no_crypt= ac_crypt_libraries=$crypt_libraries"
+  AC_MSG_RESULT([libraries $crypt_libraries])
+fi
+])
+
+AC_PATH_CRYPT
+
+if test "x$crypt_libraries" != x && test "x$crypt_libraries" != xNONE ; then
+  XLOCK_LDFLAGS="${XLOCK_LDFLAGS}:$crypt_libraries"
+  XLOCKLIBPATHS="${XLOCKLIBPATHS} -L$crypt_libraries"
+fi
+
+
+XGLOCK=""
+XGLOCKDIR=""
+INSTALL_XGLOCK=""
+UNINSTALL_XGLOCK=""
+XGLOCK_MAKEFILE=""
+AC_ARG_WITH(gtk, [  --without-gtk           disable GTK (no xglock build)],)
+if test "x$with_gtk" != "xno" ; then
+   AC_PATH_GTK(1.2.0,
+               have_gtk="yes",
+               have_gtk="no")
+fi
+
+dnl Should have a tester for XHPUX Xhp
+
+dnl Now we handle the various system dependant problems
+dnl that are not addressed in the X header files, or things dealing
+dnl with utility quirks on some systems.
+
+aixv3=no
+dirent=yes
+
+case "${canonical}" in
+
+  *-*-aix* )
+    BITMAPTYPE="ibm"
+    PIXMAPTYPE="ibm"
+    AC_DEFINE(AIXV3)
+    aixv3=yes
+    case "${canonical}" in
+      *-*-aix2* | *-*-aix3.0* | *-*-aix3.1* )
+        AC_DEFINE(LESS_THAN_AIX3_2)
+      ;;
+    esac
+  ;;
+
+  *-*-freebsd* | *-*-openbsd* | *-*-netbsd*  )
+    BITMAPTYPE="bsd"
+    PIXMAPTYPE="bsd"
+    INSTPGMFLAGS="-s -o root -m 4111"
+    XLOCKLDFLAGS="-Wl,-R${XLOCK_LDFLAGS}"
+    XMLOCKLDFLAGS="-Wl,-R${XMLOCK_LDFLAGS}"
+  ;;
+
+  *-*-dgux5* )
+    BITMAPTYPE="x11"
+    PIXMAPTYPE="x11"
+  ;;
+
+  *-*-hpux* )
+    if test "${CC}" = "cc" ; then
+dnl      CFLAGS="${CFLAGS} -O -Aa -z -D_HPUX_SOURCE" # -O sometimes problems
+      CFLAGS="${CFLAGS} -Aa -z -D_HPUX_SOURCE"
+      GPROF_CFLAGS="${GPROF_CFLAGS} -Aa -z -D_HPUX_SOURCE"
+    fi
+dnl    LDFLAGS=-Wl,-B,immediate
+    XLOCKLIBS="-lXhp11 ${XLOCKLIBS}"
+    AC_DEFINE(SYSV)
+    AC_DEFINE(SVR4)
+    BITMAPTYPE="hp"
+    PIXMAPTYPE="hp"
+  ;;
+
+  *-*-irix5* | *-*-irix6* )
+    if test "${CC}" = "cc" ; then
+      CFLAGS="${CFLAGS} -fullwarn"
+    fi
+    BITMAPTYPE="sgi"
+    PIXMAPTYPE="sgi"
+  ;;
+
+  *-*-linux* )
+    AC_CHECK_HEADER(elf.h, AC_DEFINE(HAVE_SHADOW))
+dnl    CFLAGS="${CFLAGS} -ansi -pedantic"
+    AC_DEFINE(linux)
+dnl    AC_DEFINE(__i386__)
+    AC_DEFINE(_POSIX_SOURCE)
+    AC_DEFINE(_BSD_SOURCE)
+    AC_DEFINE(_GNU_SOURCE)
+dnl    AC_DEFINE(DX_LOCALE)
+    if test -e /etc/shadow ; then
+      INSTPGMFLAGS="-g shadow -m 2111"
+      case `ls -l /etc/shadow` in
+        -???r?????\ *\ shadow\ *\ /etc/shadow)  # group shadow can read it
+          INSTPGMFLAGS="-g shadow -m 2111"
+          ;;
+        *)
+          INSTPGMFLAGS="-o root -m 4111"
+          ;;
+      esac
+    fi
+    INSTPGMFLAGS="-s $INSTPGMFLAGS"
+    BITMAPTYPE="linux"
+    PIXMAPTYPE="linux"
+dnl if Shadow and not elf
+dnl XLOCKLIBS="${XLOCKLIBS} -lgdbm"
+  ;;
+
+  *-*-osf* )
+    BITMAPTYPE="dec"
+    PIXMAPTYPE="dec"
+    AC_MSG_CHECKING(for Digital Unix Enhanced Security)
+    if test -f /usr/sbin/rcmgr && test -f /etc/rc.config ; then
+      if test X`/usr/sbin/rcmgr get SECURITY` = XENHANCED ; then
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(OSF1_ENH_SEC)
+        AC_SUBST(OSF1_ENH_SEC)
+        XLOCKLIBS="${XLOCKLIBS} -lsecurity"
+        INSTPGMFLAGS="-s -g auth -m 2111"
+      else
+        AC_MSG_RESULT(no)
+      fi
+    fi
+  ;;
+
+  *-*-sco* )
+    BITMAPTYPE="sco"
+    PIXMAPTYPE="sco"
+    AC_DEFINE(HAVE_SHADOW)
+    AC_DEFINE(SYSV)
+  ;;
+
+  *-*-solaris2* )
+    AC_DEFINE(SOLARIS2)
+    PIXMAPTYPE="solaris"
+    case "${canonical}" in
+      *-*-solaris2.0* | *-*-solaris2.1* | *-*-solaris2.2* | *-*-solaris2.3* | *-*-solaris2.4* )
+        AC_DEFINE(LESS_THAN_SOLARIS2_5)
+        PIXMAPTYPE="sol"
+      ;;
+      *-*-solaris2.5* | *-*-solaris2.6* )
+        PIXMAPTYPE="sol"
+      ;;
+    esac
+    INSTPGMFLAGS="-s -o root -m 4111"
+    AC_DEFINE(HAVE_SHADOW)
+    AC_DEFINE(SYSV)
+    AC_DEFINE(SVR4)
+    BITMAPTYPE="sun"
+dnl    XLOCKLIBS="${XLOCKLIBS} -lsocket -lnsl -lposix4"
+    XLOCKLIBS="${XLOCKLIBS} -lposix4"
+    LIBS="${LIBS} -lsocket -lnsl -lposix4"
+    XLOCKLDFLAGS="-R${XLOCK_LDFLAGS}"
+    XMLOCKLDFLAGS="-R${XMLOCK_LDFLAGS}"
+  ;;
+
+  *-*-sunos4* )
+    AC_DEFINE(SUNOS4)
+    BITMAPTYPE="sun"
+    PIXMAPTYPE="sun"
+  ;;
+
+  *-*-sysv5* )
+    INSTPGMFLAGS="-s -o root -m 4111"
+    AC_DEFINE(HAVE_SHADOW)
+    AC_DEFINE(SYSV)
+    AC_DEFINE(SVR4)
+    XLOCKLIBS="${XLOCKLIBS} -lgen"
+    XMLOCKLIBS="${XMLOCKLIBS} -lgen"
+    LIBS="${LIBS} -lsocket -lnsl"
+    BITMAPTYPE="x11"
+    PIXMAPTYPE="x11"
+  ;;
+
+  *)
+    BITMAPTYPE="x11"
+    PIXMAPTYPE="x11"
+  ;;
+esac
+
+
+if test "$dirent" = yes; then
+  AC_HEADER_DIRENT
+fi
+
+dnl Rather have a usleep
+AC_CHECK_FUNC(usleep, AC_DEFINE(HAVE_USLEEP),
+AC_CHECK_FUNC(nanosleep, AC_DEFINE(HAVE_NANOSLEEP)))
+
+dnl AC_CHECK_FUNCS(gettimeofday)
+AC_MSG_CHECKING(how to call gettimeofday)
+AC_CACHE_VAL(ac_cv_gettimeofday_args,
+ [AC_TRY_COMPILE([#include <stdlib.h>
+#include <sys/time.h>],
+     [struct timeval tv; struct timezone tzp;
+      gettimeofday(&tv, &tzp);],
+     [ac_gettimeofday_args=2],
+     [AC_TRY_COMPILE([#include <stdlib.h>
+#include <sys/time.h>],
+         [struct timeval tv; gettimeofday(&tv);],
+         [ac_gettimeofday_args=1],
+         [ac_gettimeofday_args=0])])
+  ac_cv_gettimeofday_args=$ac_gettimeofday_args])
+ac_gettimeofday_args=$ac_cv_gettimeofday_args
+if test $ac_gettimeofday_args = 2 ; then
+  AC_DEFINE(HAVE_GETTIMEOFDAY)
+  AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
+  AC_MSG_RESULT(two arguments)
+elif test $ac_gettimeofday_args = 1 ; then
+  AC_DEFINE(HAVE_GETTIMEOFDAY)
+  AC_MSG_RESULT(one argument)
+else
+  AC_MSG_RESULT(unknown)
+fi
+
+AC_CHECK_FUNCS(tzset timelocal)
+
+AC_C_INLINE
+
+srand=no
+dnl AC_CHECK_FUNC(srand48, AC_DEFINE(SRAND,srand48) AC_DEFINE(LRAND,lrand48)
+dnl   AC_DEFINE(MAXRAND,2147483648.0),
+dnl [AC_CHECK_FUNC(srandom, AC_DEFINE(SRAND,srandom) AC_DEFINE(LRAND,random)
+dnl   AC_DEFINE(MAXRAND,2147483648.0),
+dnl AC_CHECK_FUNC(srand, AC_DEFINE(SRAND,srand) AC_DEFINE(LRAND,rand) srand=yes))])
+AC_CHECK_FUNC(srand48, 
+  [AC_DEFINE(HAVE_RAND48)
+   AC_MSG_CHECKING([for srand48 declaration])
+   AC_EGREP_HEADER(srand48, stdlib.h,
+     AC_DEFINE(DECLARED_SRAND48) AC_MSG_RESULT(yes),
+     AC_MSG_RESULT(no))],
+  [AC_CHECK_FUNC(srandom, AC_DEFINE(HAVE_RANDOM),
+   AC_CHECK_FUNC(random, AC_DEFINE(HAVE_RAND) srand=yes))])
+if test "$srand" = yes; then
+  if test "$aixv3" = yes; then
+    AC_DEFINE(MAXRAND,2147483648.0)
+  else
+    AC_DEFINE(MAXRAND,32768.0)
+  fi
+fi
+
+AC_MSG_CHECKING([matherr support])
+AC_CACHE_VAL(ac_cv_c_matherr,[
+AC_TRY_COMPILE([#define _XOPEN_SOURCE 1
+#include <math.h>], [
+struct exception x;
+x.type = DOMAIN;
+x.type = SING;
+], ac_cv_c_matherr=yes, ac_cv_c_matherr=no)])
+if test x"$ac_cv_c_matherr" = xyes; then
+    AC_DEFINE(USE_MATHERR)
+    AC_MSG_RESULT(yes)
+else
+    AC_MSG_RESULT(no)
+fi
+
+dnl Problems here if -I/usr/include used with gcc on Solaris
+AC_MSG_CHECKING([struct sigset_t])
+AC_CACHE_VAL(ac_cv_c_sigset_t,[
+AC_TRY_COMPILE([/*#define _XOPEN_SOURCE 1*/
+#include <signal.h>], [
+typedef struct {unsigned long __sigbits[4];} sigset_t;
+sigset_t sigmask;
+], ac_cv_c_sigset_t=yes, ac_cv_c_sigset_t=no)])
+if test x"$ac_cv_c_sigset_t" = xyes; then
+  AC_DEFINE(HAVE_STRUCT_SIGSET_T)
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+fi
+
+AC_ARG_ENABLE(bitmapdir, [  --enable-bitmapdir=DIR  set directory for bitmaps, default is ./bitmaps],bitmap_dir=$enableval,bitmap_dir=no)
+case "x$bitmap_dir" in
+x/*|x.*)
+  AC_MSG_RESULT([setting BITMAPDIR = $enableval])
+  BITMAPDIR=$enableval
+  if test ! -d $bitmap_dir; then
+    AC_MSG_RESULT([Warning: Directory $enableval does not exist])
+  fi
+  ;;
+*)
+  BITMAPDIR='$(top_srcdir)/bitmaps'
+  bitmap_dir='$top_srcdir/bitmaps'
+  ;;
+esac
+
+AC_ARG_ENABLE(bitmaptype, [  --enable-bitmaptype=name
+                          set name for bitmap type],bitmap_type=$enableval,bitmap_type=no)
+case "x$bitmap_type" in
+xyes*|xno*)
+  ;;
+*)
+  AC_MSG_RESULT([setting BITMAPTYPE = $enableval])
+  BITMAPTYPE=$enableval
+  if test ! -f $bitmap_dir/l-$BITMAPTYPE.xbm; then
+    AC_MSG_RESULT([Warning: Bitmap $BITMAPDIR/l-$BITMAPTYPE.xbm does not exist])
+  fi
+  ;;
+esac
+
+AC_ARG_ENABLE(pixmapdir, [  --enable-pixmapdir=DIR  set directory for pixmaps, default is ./pixmaps],pixmap_dir=$enableval,pixmap_dir=no)
+case "x$pixmap_dir" in
+x/*|x.*)
+  AC_MSG_RESULT([setting PIXMAPDIR = $enableval])
+  PIXMAPDIR=$enableval
+  if test ! -d $pixmap_dir; then
+    AC_MSG_RESULT([Warning: Directory $enableval does not exist])
+  fi
+  ;;
+*)
+  PIXMAPDIR='$(top_srcdir)/pixmaps'
+  pixmap_dir='$top_srcdir/pixmaps'
+  ;;
+esac
+
+AC_ARG_ENABLE(pixmaptype, [  --enable-pixmaptype=name
+                          set name for pixmap type],pixmap_type=$enableval,pixmap_type=no)
+case "x$pixmap_type" in
+xyes*|xno*)
+  ;;
+*)
+  AC_MSG_RESULT([setting PIXMAPTYPE = $enableval])
+  PIXMAPTYPE=$enableval
+  if test ! -f $pixmap_dir/m-$PIXMAPTYPE.xpm; then
+    AC_MSG_RESULT([Warning: Pixmap $PIXMAPDIR/m-$PIXMAPTYPE.xpm does not exist])
+  fi
+  ;;
+esac
+
+AC_ARG_ENABLE(mapdir, [  --enable-mapdir=DIR     set directory for bitmaps and pixmaps],map_dir=$enableval,map_dir=no)
+case "x$map_dir" in
+x/*|x.*)
+  AC_MSG_RESULT([setting BITMAPDIR = $enableval])
+  BITMAPDIR=$enableval
+  AC_MSG_RESULT([setting PIXMAPDIR = $enableval])
+  PIXMAPDIR=$enableval
+  if test ! -d $map_dir; then
+    AC_MSG_RESULT([Warning: Directory $enableval does not exist])
+  fi
+  ;;
+*)
+  BITMAPDIR='$(top_srcdir)/bitmaps'
+  bitmap_dir='$top_srcdir/bitmaps'
+  PIXMAPDIR='$(top_srcdir)/pixmaps'
+  pixmap_dir='$top_srcdir/pixmaps'
+  ;;
+esac
+
+AC_ARG_ENABLE(maptype, [  --enable-maptype=name   set name for bitmap and pixmap type],map_type=$enableval,map_type=no)
+case "x$map_type" in
+xyes*|xno*)
+  ;;
+*)
+  AC_MSG_RESULT([setting BITMAPTYPE = $enableval])
+  BITMAPTYPE=$enableval
+  if test ! -f $map_dir/l-$BITMAPTYPE.xbm; then
+    AC_MSG_RESULT([Warning: Bitmap $BITMAPDIR/l-$BITMAPTYPE.xbm does not exist])
+  fi
+  AC_MSG_RESULT([setting PIXMAPTYPE = $enableval])
+  PIXMAPTYPE=$enableval
+  if test ! -f $map_dir/m-$PIXMAPTYPE.xpm; then
+    AC_MSG_RESULT([Warning: Pixmap $PIXMAPDIR/m-$PIXMAPTYPE.xpm does not exist])
+  fi
+  ;;
+esac
+
+if test "$sound" = none; then
+  AC_ARG_ENABLE(def_play, [  --enable-def-play=program
+                          set def-play to program that plays sounds],def_play=$enableval,def_play=no)
+  if test "$def_play" != no; then
+    AC_MSG_RESULT([defining option DEF_PLAY = "$enableval"])
+    AC_DEFINE_UNQUOTED(DEF_PLAY,"$enableval")
+  fi
+fi
+
+AC_ARG_ENABLE(vroot, [  --disable-vroot         disables xlock from being able to run in root window
+                          (some window managers have problems)],use_vroot=$enableval,use_vroot=yes)
+if test "$use_vroot" = yes; then
+  AC_MSG_RESULT([defining option USE_VROOT])
+  AC_DEFINE(USE_VROOT)
+fi
+
+AC_ARG_ENABLE(allow-root, [  --disable-allow-root    allows users to turn off allowroot (default is to
+                          always allow root to be able to unlock xlock)],allow_root=$enableval,allow_root=yes)
+if test "$allow_root" = yes; then
+  AC_MSG_RESULT([defining option ALWAYS_ALLOW_ROOT])
+  AC_DEFINE(ALWAYS_ALLOW_ROOT)
+fi
+
+case ${canonical} in
+    *-*-linux* | *-*-freebsd* | *-*-openbsd* | *-*-netbsd*  )
+      AC_ARG_ENABLE(vtlock, [  --enable-vtlock         allows to turn on VT switch lock (default is to be
+                          able to switch to another VT)],vtlock=$enableval,vtlock=no)
+      if test "$vtlock" = yes; then
+        AC_MSG_RESULT([defining option USE_VTLOCK])
+        AC_DEFINE(USE_VTLOCK)
+      fi
+      ;;
+    *)
+      ;;
+esac
+
+AC_ARG_ENABLE(syslog, [  --enable-syslog         enable syslog logging],use_syslog=$enableval,use_syslog=no)
+if test "$use_syslog" = yes; then
+  AC_MSG_RESULT([defining option USE_SYSLOG])
+  AC_DEFINE(USE_SYSLOG)
+fi
+
+AC_ARG_ENABLE(multiple-user, [  --enable-multiple-user  enable multiple users],use_multiple_user=$enableval,use_multiple_user=no)
+if test "$use_multiple_user" = yes; then
+  AC_MSG_RESULT([defining option USE_MULTIPLE_USER])
+  AC_DEFINE(USE_MULTIPLE_USER)
+fi
+
+AC_ARG_ENABLE(multiple-root, [  --enable-multiple-root  enable multiple root users],use_multiple_root=$enableval,use_multiple_root=no)
+if test "$use_multiple_root" = yes; then
+  AC_MSG_RESULT([defining option USE_MULTIPLE_ROOT])
+  AC_DEFINE(USE_MULTIPLE_ROOT)
+fi
+
+AC_ARG_ENABLE(window-visibility, [  --enable-window-visibility
+                          allow a window to be displayed over xlock],use_window_visiblity=$enableval,use_window_visibility=no)
+if test "$use_window_visibility" = yes; then
+  AC_MSG_RESULT([defining option USE_WINDOW_VISIBILITY])
+  AC_DEFINE(USE_WINDOW_VISIBLITY)
+fi
+
+AC_ARG_ENABLE(old-event-loop, [  --enable-old-event-loop some machines may still need this
+                          (fd_set errors may be a sign)],use_old_event_loop=$enableval,use_old_event_loop=no)
+if test "$use_old_event_loop" = yes; then
+  AC_MSG_RESULT([defining option USE_OLD_EVENT_LOOP])
+  AC_DEFINE(USE_OLD_EVENT_LOOP)
+fi
+
+dnl AC_ARG_ENABLE(vmsutils, [  --enable-vmsutils       patches up old __VMS_VER < 70000000],use_vmsutils=$enableval,use_vmsutils=no)
+dnl if test "$use_vmsutils" = yes; then
+dnl   AC_MSG_RESULT([defining option USE_VMSUTILS])
+dnl   AC_DEFINE(USE_VMSUTILS)
+dnl fi
+
+AC_ARG_ENABLE(xlockrc, [  --enable-xlockrc        for unknown shadow passwd algorithm],use_xlockrc=$enableval,use_xlockrc=no)
+if test "$use_xlockrc" = yes; then
+  AC_MSG_RESULT([defining option USE_XLOCKRC])
+  AC_DEFINE(USE_XLOCKRC)
+fi
+
+AC_ARG_ENABLE(auto-logout, [  --enable-auto-logout=time
+                          enable auto-logout code for lab use (time in minutes)],use_auto_logout=$enableval,use_auto_logout=no)
+case "x$use_auto_logout" in
+x|xyes*)
+  AC_MSG_RESULT([defining option USE_AUTO_LOGOUT = 240 minutes])
+  AC_DEFINE(USE_AUTO_LOGOUT,240)
+  ;;
+x[[0-9]]*)
+  AC_MSG_RESULT([defining option USE_AUTO_LOGOUT = $enableval minutes])
+  AC_DEFINE_UNQUOTED(USE_AUTO_LOGOUT,$enableval)
+  ;;
+xno*)
+  ;;
+*)
+  AC_MSG_RESULT([Warning: Illegal time value "$use_auto_logout" given])
+  AC_MSG_RESULT([defining option USE_AUTO_LOGOUT = 240 minutes])
+  AC_DEFINE(USE_AUTO_LOGOUT,240)
+  ;;
+esac
+
+AC_ARG_ENABLE(default-auto-logout, [  --enable-default-auto-logout=time
+                          set default-auto-logout (time in minutes)],
+              def_auto_logout=$enableval,
+              def_auto_logout=no)
+case "x$def_auto_logout" in
+x|xyes*)
+  AC_MSG_RESULT([defining option DEF_AUTO_LOGOUT = 120 minutes])
+  AC_DEFINE(DEF_AUTO_LOGOUT,"120")
+  ;;
+x[[0-9]]*)
+  AC_MSG_RESULT([defining option DEF_AUTO_LOGOUT = $enableval minutes])
+  AC_DEFINE_UNQUOTED(DEF_AUTO_LOGOUT,"$enableval")
+  ;;
+xno*)
+  ;;
+*)
+  AC_MSG_RESULT([Warning: Illegal time value "$def_auto_logout" given])
+  AC_MSG_RESULT([defining option DEF_AUTO_LOGOUT = 120 minutes])
+  AC_DEFINE(DEF_AUTO_LOGOUT,"120")
+  ;;
+esac
+
+AC_ARG_ENABLE(button-logout, [  --enable-button-logout=time
+                          enable button logout for lab use (time in minutes)],
+              use_button_logout=$enableval,
+              use_button_logout=no)
+case "x$use_button_logout" in
+x|xyes*)
+  AC_MSG_RESULT([defining option USE_BUTTON_LOGOUT = 10 minutes])
+  AC_DEFINE(USE_BUTTON_LOGOUT,10)
+  ;;
+x[[0-9]]*|x-[0-9]*)
+  AC_MSG_RESULT([defining option USE_BUTTON_LOGOUT = $enableval minutes])
+  AC_DEFINE_UNQUOTED(USE_BUTTON_LOGOUT,$enableval)
+  ;;
+xno*)
+  ;;
+*)
+  AC_MSG_RESULT([Warning: Illegal time value "$use_button_logout" given])
+  AC_MSG_RESULT([defining option USE_BUTTON_LOGOUT = 10 minutes])
+  AC_DEFINE(USE_BUTTON_LOGOUT,10)
+  ;;
+esac
+
+AC_ARG_ENABLE(default-button-logout, [  --enable-default-button-logout=time
+                          set default-button-logout (time in minutes)],
+              def_button_logout=$enableval,
+              def_button_logout=no)
+case "x$def_button_logout" in
+x|xyes*)
+  AC_MSG_RESULT([defining option DEF_BUTTON_LOGOUT = 5 minutes])
+  AC_DEFINE(DEF_BUTTON_LOGOUT,"5")
+  ;;
+x[[0-9]]*)
+  AC_MSG_RESULT([defining option DEF_BUTTON_LOGOUT = $enableval minutes])
+  AC_DEFINE_UNQUOTED(DEF_BUTTON_LOGOUT,"$enableval")
+  ;;
+xno*)
+  ;;
+*)
+  AC_MSG_RESULT([Warning: Illegal time value "$def_button_logout" given])
+  AC_MSG_RESULT([defining option DEF_BUTTON_LOGOUT = 5 minutes])
+  AC_DEFINE(DEF_BUTTON_LOGOUT,"5")
+  ;;
+esac
+
+AC_ARG_ENABLE(bomb, [  --disable-bomb          disable automatic logout mode],
+              use_bomb=$enableval,
+              use_bomb=yes)
+if test "$use_bomb" = yes; then
+  AC_MSG_RESULT([defining option USE_BOMB])
+  AC_DEFINE(USE_BOMB)
+  BOMB=""
+else
+  BOMB="#"
+fi
+
+AC_ARG_ENABLE(interactive, [  --disable-interactive   disables interactive modes (useful for production enviroments)],
+              no_interactive=$enableval,
+              no_interactive=yes)
+if test "$no_interactive" = no; then
+  AC_MSG_RESULT([defining option DISABLE_INTERACTIVE])
+  AC_DEFINE(DISABLE_INTERACTIVE)
+  INTERACTIVE=""
+else
+  INTERACTIVE="#"
+fi
+
+AC_ARG_ENABLE(unstable, [  --enable-unstable       enables unstable (alpha) modes],
+              use_unstable=$enableval,
+              use_unstable=no)
+if test "$use_unstable" = yes; then
+  AC_MSG_RESULT([defining option USE_UNSTABLE])
+  AC_DEFINE(USE_UNSTABLE)
+  UNSTABLE=""
+else
+  UNSTABLE="#"
+fi
+
+AC_ARG_ENABLE(closedown-logout, [  --enable-closedown-logout
+                          define this one or next, with enable-auto-logout,],
+              closedown_logout=$enableval,
+              closedown_logout=no)
+if test "$closedown_logout" = yes; then
+  AC_MSG_RESULT([defining option CLOSEDOWN_LOGOUT])
+  AC_DEFINE(CLOSEDOWN_LOGOUT)
+fi
+
+AC_ARG_ENABLE(session-logout, [  --enable-session-logout enable-button-logout, and/or enable-bomb, for xdm],
+              session_logout=$enableval,
+              session_logout=no)
+if test "$session_logout" = yes; then
+  AC_MSG_RESULT([defining option SESSION_LOGOUT])
+  AC_DEFINE(SESSION_LOGOUT)
+fi
+
+AC_ARG_ENABLE(staff-file, [  --enable-staff-file=filename
+                          set file of staff who are exempt from auto-logout],
+              use_staff_file=$enableval,
+              use_staff_file=no)
+case "x$use_staff_file" in
+x|xyes*)
+  AC_MSG_RESULT([defining option STAFF_FILE = "/usr/remote/etc/xlock.staff"])
+  AC_DEFINE_UNQUOTED(STAFF_FILE,"/usr/remote/etc/xlock.staff")
+  if test ! -f /usr/remote/etc/xlock.staff; then
+    AC_MSG_RESULT([Warning: File /usr/remote/etc/xlock.staff does not exist])
+  fi
+  ;;
+x/*)
+  AC_MSG_RESULT([defining option STAFF_FILE = "$enableval"])
+  AC_DEFINE_UNQUOTED(STAFF_FILE,"$enableval")
+  if test ! -f $use_staff_file; then
+    AC_MSG_RESULT([Warning: File $enableval does not exist])
+  fi
+  ;;
+esac
+
+AC_ARG_ENABLE(staff-netgroup, [  --enable-staff-netgroup=netgroup
+                          set netgroup of staff who are exempt from auto-logout],use_staff_netgroup=$enableval,use_staff_netgroup=no)
+if test "$use_staff_netgroup" != no; then
+  AC_MSG_RESULT([defining option STAFF_NETGROUP = "$enableval"])
+  AC_DEFINE_UNQUOTED(STAFF_NETGROUP,"$enableval")
+fi
+
+AC_ARG_ENABLE(kerberos4, [  --enable-kerberos4      enable Kerberos 4],kerberos4=$enableval,kerberos4=no)
+if test "$kerberos4" = yes; then
+  AC_MSG_RESULT([defining option HAVE_KRB4])
+  AC_DEFINE(HAVE_KRB4)
+  XLOCKINC="${XLOCKINC} -I/usr/athena/include"
+  XLOCKLIBS="${XLOCKLIBS} -L/usr/athena/lib -lkrb -ldes"
+fi
+
+AC_ARG_ENABLE(kerberos5, [  --enable-kerberos5      enable Kerberos 5],kerberos5=$enableval,kerberos5=no)
+if test "$kerberos5" = yes; then
+  AC_MSG_RESULT([defining option HAVE_KRB5])
+  AC_DEFINE(HAVE_KRB5)
+  XLOCKINC="${XLOCKINC} -I/usr/local/include"
+  XLOCKLIBS="${XLOCKLIBS} -L/usr/local/lib -lkrb5 -lcrypto -lcom_err"
+fi
+
+AC_ARG_ENABLE(dce_passwd, [  --enable-dce-passwd     enable DCE passwording],dce_passwd=$enableval,dce_passwd=no)
+if test "$dce_passwd" = yes; then
+  AC_MSG_RESULT([defining option DCE_PASSWD])
+  AC_DEFINE(DCE_PASSWD)
+  XLOCKINC="${XLOCKINC} -I/usr/include/reentrant"
+  XLOCKLIBS="${XLOCKLIBS} -ldce -lc_r"
+fi
+
+AC_ARG_ENABLE(pam, [  --enable-pam            enable PAM], pam=$enableval,pam=no)
+if test "$pam" = yes; then
+  AC_MSG_RESULT([defining option PAM])
+  AC_DEFINE(PAM)
+  XLOCKLIBS="${XLOCKLIBS} -lpam -ldl"
+fi
+
+AC_ARG_ENABLE(afs, [  --enable-afs            enable AFS],afs=$enableval,afs=no)
+if test "$afs" = yes; then
+  AC_MSG_RESULT([defining option AFS])
+  AC_DEFINE(AFS)
+  XLOCKINC="${XLOCKINC} -I/usr/afsws/include"
+  case "${canonical}" in
+    *-*-solaris2.* )
+      XLOCKLIBS="${XLOCKLIBS} -lucb -L/usr/afsws/lib -L/usr/afsws/lib/afs -lkauth.krb -lprot -lubik -lauth.krb -lrxkad -lsys -ldes -lrx -llwp -lcom_err -lcmd /usr/afsws/lib/afs/util.a -laudit -lsys"
+    ;;
+    * )
+      XLOCKLIBS="${XLOCKLIBS} -L/usr/afsws/lib -L/usr/afsws/lib/afs -lkauth -lubik -lprot -lrxkad -lrx -llwp -lauth -lsys -ldes -lcmd -lcom_err /usr/afsws/lib/afs/util.a -laudit"
+    ;;
+  esac
+fi
+
+AC_ARG_ENABLE(afs, [  --enable-sia            enable SIA],sia=$enableval,sia=no)
+if test "$sia" = yes; then
+  AC_MSG_RESULT([defining option SIA])
+  AC_DEFINE(SIA)
+  XLOCKLIBS="${XLOCKLIBS} -lsecurity"
+fi
+
+AC_ARG_ENABLE(sunos_adjunct_passwd, [  --enable-sunos-adjunct-passwd
+                          enable SUNOS Adjunct passwording],sunos_adjunct_passwd=$enableval,sunos_adjunct_passwd=no)
+if test "$sunos_adjunct_passwd" = yes; then
+  AC_MSG_RESULT([defining option SUNOS_ADJUNCT_PASSWD])
+  AC_DEFINE(SUNOS_ADJUNCT_PASSWD)
+fi
+
+AC_ARG_ENABLE(use_mb, [  --enable-use-mb         enable Xmb function series (new)],use_mb=$enableval,use_mb=no)
+if test "$use_mb" = yes; then
+  AC_MSG_RESULT([defining option USE_MB])
+  AC_DEFINE(USE_MB)
+fi
+
+AC_ARG_ENABLE(customization, [  --enable-customization  enable customization of XResource],customization=$enableval,customization=no)
+if test "$customization" = yes; then
+  AC_MSG_RESULT([defining option CUSTOMIZATION])
+  AC_DEFINE(CUSTOMIZATION)
+fi
+
+AC_ARG_ENABLE(modules, [  --enable-modules        enable modules (better to use xmkmf for this)],modules=$enableval,modules=no)
+if test "$modules" = yes; then
+  AC_MSG_RESULT([enabling xlk modules])
+  MODULES=""
+  NOMODULES="#"
+  AC_DEFINE(USE_MODULES)
+case ${canonical} in
+    *-*-linux* )
+      MODULEFLAGS="-rdynamic"
+      ;;
+    *)
+      MODULEFLAGS=""
+      ;;
+esac
+else
+  MODULES="#"
+  NOMODULES=""
+  MODULEFLAGS=""
+fi
+
+AC_ARG_ENABLE(check, [  --enable-check          enable check (new and experimental)],check=$enableval,check=no)
+if test "$check" = yes; then
+  AC_MSG_RESULT([enabling memory debug checking])
+  CHECK=""
+else
+  CHECK="#"
+fi
+
+AC_ARG_WITH(lang, [  --with-lang=lang        use a foreign language (nl/fr/de/jp)],lang=$withval,lang=none)
+case "$lang" in
+  nl|NL|Nl)
+    AC_MSG_RESULT([enabling some reporting in Dutch])
+    AC_DEFINE(NL)
+    ;;
+  fr|FR|Fr)
+    AC_MSG_RESULT([enabling some reporting in French])
+    AC_DEFINE(FR)
+    ;;
+  de|DE|De)
+    AC_MSG_RESULT([enabling some reporting in German])
+    AC_DEFINE(DE)
+    ;;
+  jp|JP|Jp)
+    AC_MSG_RESULT([enabling some reporting in Japanese])
+    AC_DEFINE(JP)
+    ;;
+  none)
+    AC_MSG_RESULT([using default language (English)])
+    ;;
+  *)
+    AC_MSG_RESULT([unknown language $lang. using default language (English)])
+    ;;
+esac
+
+AC_ARG_ENABLE(orig_xpm_patch, [  --enable-orig-xpm-patch use the original pixmap patch for mail icon
+                          (have colormap problems in 8 bits depth visuals)],
+              orig_xpm_patch=$enableval,
+              orig_xpm_patch=no)
+if test "$orig_xpm_patch" = "yes"; then
+  AC_MSG_RESULT([enabling original mail icon xpm patch])
+  AC_DEFINE(ORIGINAL_XPM_PATCH)
+fi
+
+if test "x$INSTPGMFLAGS" != x; then
+AC_ARG_ENABLE(setuid, [  --disable-setuid        disables setuid installation if automatically chosen],setuid=$enableval,setuid=yes)
+case "x$setuid" in
+xno*)
+  case ${canonical} in
+  *-*-linux*)
+    if test "$vtlock" = "yes"; then
+      INSTPGMFLAGS="-s -o root -g bin -m 4111"
+      AC_MSG_RESULT([defining install options (setuid/setgid) = "$INSTPGMFLAGS" for vtlock])
+       echo "experimental: Big buffer overrun security risk"
+    else
+  INSTPGMFLAGS=""
+  AC_MSG_RESULT([no setuid/setgid install])
+    fi
+    ;;
+  *)
+  INSTPGMFLAGS=""
+  AC_MSG_RESULT([no setuid/setgid install])
+  ;;
+  esac
+  ;;
+x|xyes*)
+  case ${canonical} in
+  *-*-linux*)
+    if test "$vtlock" = "yes"; then
+      INSTPGMFLAGS="-s -o root -g bin -m 4111"
+      AC_MSG_RESULT([defining install options (setuid/setgid) = "$INSTPGMFLAGS" for vtlock])
+    else
+  AC_MSG_RESULT([defining install options (setuid/setgid) = "$INSTPGMFLAGS"])
+    fi
+    ;;
+  *)
+  AC_MSG_RESULT([defining install options (setuid/setgid) = "$INSTPGMFLAGS"])
+  ;;
+  esac
+  ;;
+x*)
+  INSTPGMFLAGS=$enableval
+  AC_MSG_RESULT([defining install options (setuid/setgid) = "$enableval"])
+  ;;
+esac
+else
+  AC_MSG_RESULT([no setuid/setgid install])
+fi
+
+DEPEND=makedepend
+DEPEND_FLAGS=
+DEPEND_DEFINES=
+
+case "${canonical}" in
+  *-*-irix5* | *-*-irix6* )
+    XLOCKLIBPATHS="-L/usr/lib32 ${XLOCKLIBPATHS}"
+    XMLOCKLIBPATHS="-L/usr/lib32 ${XMLOCKLIBPATHS}"
+    XGLOCKLIBPATHS="-L/usr/lib32 ${XGLOCKLIBPATHS}"
+  ;;
+esac
+XLOCKLIBS="${XLOCKLIBPATHS} ${XLOCKLIBS} -lX11 -lXext -lm"
+XMLOCKLIBS="${XMLOCKLIBPATHS} ${XMLOCKLIBS} -lX11"
+XGLOCKLIBS="${XGLOCKLIBPATHS} ${XGLOCKLIBS} ${GTK_LIBS}"
+AC_SUBST(XLOCKLDFLAGS)
+AC_SUBST(XMLOCKLDFLAGS)
+AC_SUBST(XGLOCKLDFLAGS)
+AC_SUBST(INSTPGMFLAGS)
+AC_SUBST(MODULEFLAGS)
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(XLOCKINC)
+AC_SUBST(XMLOCKINC)
+AC_SUBST(XGLOCKINC)
+AC_SUBST(GTK_LIBS)
+AC_SUBST(XLIBS)
+AC_SUBST(BITMAPTYPE)
+AC_SUBST(PIXMAPTYPE)
+AC_SUBST(BITMAPDIR)
+AC_SUBST(PIXMAPDIR)
+AC_SUBST(XLOCKLIBS)
+AC_SUBST(XMLOCKLIBS)
+AC_SUBST(XGLOCKLIBS)
+AC_SUBST(XMLOCK)
+AC_SUBST(XGLOCK)
+AC_SUBST(XGLOCKDIR)
+AC_SUBST(INSTALL_XMLOCK)
+AC_SUBST(INSTALL_XGLOCK)
+AC_SUBST(UNINSTALL_XMLOCK)
+AC_SUBST(UNINSTALL_XGLOCK)
+AC_SUBST(APPDEFAULTS)
+AC_SUBST(LINT)
+AC_SUBST(CHECK)
+AC_SUBST(PURIFY)
+AC_SUBST(XPM)
+AC_SUBST(GL)
+AC_SUBST(GLTT)
+AC_SUBST(BOMB)
+AC_SUBST(INTERACTIVE)
+AC_SUBST(UNSTABLE)
+AC_SUBST(DEPEND)
+AC_SUBST(DEPEND_FLAGS)
+AC_SUBST(DEPEND_DEFINES)
+AC_SUBST(CXX)
+AC_SUBST(CCC)
+AC_SUBST(MODULES)
+AC_SUBST(NOMODULES)
+
+AC_CONFIG_HEADER(config.h)
+AC_OUTPUT(Makefile
+    xlock/Makefile
+    modes/Makefile
+    modes/glx/Makefile
+    xmlock/Makefile
+    xglock/Makefile
+  )
diff --git a/configure.tcl b/configure.tcl
new file mode 100755 (executable)
index 0000000..1df7d39
--- /dev/null
@@ -0,0 +1,427 @@
+#!/bin/sh
+#charles vidal 1998 <vidalc@club-internet.fr>
+# Thu Jul 30 06:21:57 MET DST 1998
+#Projet Wizard in french Assistant
+#http://www.chez.com/vidalc/assist/
+#Sun Jul  4 01:35:05 MET DST 1999
+# Add filevents find in setup.tcl of the xap ( X Application Panel )
+# thank's to rasca, berlin 1999
+#
+# Sat Jul 29 20:18:28 JST 2000
+#   Fix font dialog and button action.
+#   Add I18N system
+#      By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
+#
+
+# the next line restart wish \
+exec wish "$0" "$@"
+
+# Setup I18N system
+set auto_path [linsert $auto_path end .]
+set_catalogue [set_language]
+
+set titleassist [_ "Wizard configure"]
+wm title . $titleassist
+
+# Declaration des variables globales
+set nbwidget 0
+
+# number of the current screen
+set nb_ecran 0
+
+set lang " "
+
+proc cont {w input} {
+    if [eof $input] {
+       close $input
+    } else {
+       gets $input line
+       $w insert end "$line\n"
+       $w see end
+    }
+}
+
+proc read_pipe { command w } {
+    $w delete 1.0 end
+    $w insert end "$command\n"
+    set fileid [open "|$command" r]
+    fileevent $fileid readable "cont $w $fileid"
+}
+
+proc action { } {
+    global bitmapdir pixmapdir
+    global incdir libdir
+    global soundprog
+    global wgcc wmotif weditres wpurify wxpm wopengl wmesagl wdtsaver wdpms
+    global esyslog emulroot emuluser eunstable
+    global nb_ecran nbtotalecran
+    global lang
+
+    if { $nb_ecran == [expr $nbtotalecran -1 ]}  {
+       # Press "configure" button
+       set commandline "./configure"
+       append commandline $wgcc $wpurify $wmotif $weditres $wxpm $wopengl $wmesagl $wdtsaver \
+               $esyslog $emuluser $emulroot $eunstable
+       if {$bitmapdir!=""} { append commandline " --enable-bitmapdir=$bitmapdir" }
+       if {$pixmapdir!=""} { append commandline " --enable-pixmapdir=$pixmapdir" }
+       if {$incdir!=""}    { append commandline " --x-includes=$incdir" }
+       if {$libdir!=""}    { append commandline " --x-libraries=$libdir" }
+       if {$soundprog!=""} { append commandline " --enable-def-play=$soundprog" }
+       append commandline " $lang"
+       if { [getyesno [_ "Do you really want to launch configure?"]] == "yes" } {
+           puts $commandline
+           pack forget .f$nb_ecran
+
+           frame .fconf
+           button .f.make -text [_ "Make"] -command {
+               set commandline "make"
+               read_pipe $commandline  .fconf.t
+           }
+           button .f.install -text [_ "Make Install"] -command {
+               set commandline "make install"
+               read_pipe $commandline .fconf.t
+           }
+           button .f.exit -text [_ "Exit"] -command exit
+           scrollbar .fconf.s -orient vertical -command {.fconf.t yview}
+
+           text .fconf.t -yscrollcommand {.fconf.s set} \
+                   -wrap word -width 50 -height 10 \
+                   -setgrid 1
+
+           pack .fconf.s -side right  -fill y
+           pack .fconf.t -expand yes -side right -fill both
+           pack .fconf -side top -expand yes -fill both
+           pack .f.make  .f.install .f.exit  -side left
+           pack forget .f.b1 .f.b2 .f.b3
+
+           update
+           read_pipe $commandline  .fconf.t
+       }
+    } else {
+       # Press "abort" button
+       exit
+    }
+}
+
+# get a dialog yes or no
+proc getyesno { text } {
+    return [ tk_messageBox -parent . -title [_ "Launch Configure"] -type yesno \
+           -icon warning \
+           -message $text ]
+}
+
+set tmpfnt ""
+
+# Declaration des variables globales
+set nbwidget 0
+
+# numero de l'ecran courant
+set nb_ecran 0
+
+# open font dialog
+proc openfont { var } {
+    upvar $var toto
+    global tmpfnt
+
+    set w .font
+
+    toplevel $w
+    wm title $w [_ "Font Options"]
+
+    frame $w.f
+    label $w.f.msg0 -text [_ "Font Options"]
+
+    listbox $w.f.names -yscrollcommand "$w.f.scroll set" \
+       -xscrollcommand "$w.f.scroll2 set"  -setgrid 1 \
+         -exportselection false
+    bind $w.f.names <Double-1> "fontselect_action $w"
+    scrollbar $w.f.scroll -orient vertical -command "$w.f.names yview" \
+            -relief sunken -borderwidth 2
+    scrollbar $w.f.scroll2 -orient horizontal -command "$w.f.names xview" \
+            -relief sunken -borderwidth 2
+
+    label $w.f.test -text [_ "ABCDEFGHIJKabedfghijkmnopq12345"]
+
+    set fd [open "|xlsfonts" r]
+    while {[gets $fd line]>=0} {
+       $w.f.names insert end $line
+    }
+    close $fd
+
+    grid rowconfigure $w 0 -weight 100
+    grid columnconfigure $w 0 -weight 100
+
+    grid $w.f -column 0 -row 0 -sticky nsew
+    grid $w.f.msg0 -column 0 -row 0 -sticky ew
+    grid $w.f.names -column 0 -row 1 -sticky nsew
+    grid $w.f.scroll -column 1 -row 1 -sticky ns
+    grid $w.f.scroll2 -column 0 -row 2 -sticky ew
+    grid $w.f.test -column 0 -row 3 -sticky ew
+    grid rowconfigure $w.f 1 -weight 100
+    grid columnconfigure $w.f 0 -weight 100
+
+    frame $w.f2
+    button $w.f2.cancel -text [_ "Cancel"] -command "destroy $w"
+    button $w.f2.ok -text [_ "OK"] -command "set $var \$tmpfnt; destroy $w"
+
+    grid $w.f2 -column 0 -row 1
+    pack $w.f2.ok $w.f2.cancel -side left
+}
+
+proc fontselect_action {w} {
+    global tmpfnt
+
+    set fname [$w.f.names get [$w.f.names curselection]]
+    $w.f.test configure -font $fname
+    set tmpfnt $fname
+}
+
+# open color dialog
+proc opencolorsel {titre var wf} {
+    upvar $var toto
+    set toto [tk_chooseColor -title $titre]
+    $wf.label configure -foreground $toto
+}
+
+# open file dialog
+proc openfilesel { var } {
+    upvar $var toto
+    set toto [ tk_getOpenFile -parent .]
+}
+
+# Configure button state for "previous" button and "next" button
+proc state_configure {} {
+    global nbtotalecran nb_ecran
+
+    if {$nb_ecran != 0} {
+       .f.b1 configure -state active
+    } else {
+       .f.b1 configure -state disabled
+    }
+
+    if {$nb_ecran != [expr $nbtotalecran - 1]} {
+       .f.b2 configure -state active
+    } else {
+       .f.b2 configure -state disabled
+    }
+}
+
+
+# Callback pour revenir a l'ecran precedent
+proc prec_ecran { } {
+    global nbtotalecran nb_ecran
+    set tmp [expr $nb_ecran - 1]
+    if { $tmp >= 0} {
+       pack forget .f$nb_ecran
+       set nb_ecran [expr $nb_ecran - 1]
+       pack .f$nb_ecran
+    }
+
+    state_configure
+
+    if { $nb_ecran != [expr $nbtotalecran - 1 ]}  {
+       .f.b3 configure -text [_ "Abort"]
+    }
+}
+
+# Callback pour aller a l'ecran suivant
+proc next_ecran { } {
+    global nb_ecran nbtotalecran
+    set tmp [expr $nb_ecran + 1]
+    if { $tmp < $nbtotalecran} {
+       pack forget .f$nb_ecran
+       set nb_ecran [expr $nb_ecran + 1]
+       pack .f$nb_ecran
+    }
+
+    state_configure
+
+    if { $nb_ecran == [expr $nbtotalecran - 1 ]}  {
+       .f.b3 configure -text [_ "Configure"]
+    }
+
+    if { $nb_ecran != [expr $nbtotalecran - 1 ]}  {
+       .f.b3 configure -text [_ "Abort"]
+    }
+}
+
+# Creation du label titre et du texte explicatif
+# Argument n:numero de l'ecran title:titre desc description
+
+proc creationscreennb { n title desc icon} {
+    set currentarg 0
+    frame .f$n -height 10 -width 10
+    image create bitmap  image$n -file bitmaps/$icon
+    label .f$n.lt$n -text [_ $title] -font [_ -Adobe-Courier-Bold-R-Normal-*-140-*]
+    label .f$n.li$n -image image$n
+    pack .f$n.lt$n  .f$n.li$n
+    frame .f$n.fdesc
+    message  .f$n.mesg -text [_ $desc] -width 25c
+    pack .f$n.mesg -fill x
+    pack .f$n.fdesc
+}
+
+# Creation de deux label + entry avec variable texte
+# Argument n:numero de l'ecran label1:label devant texte vtext1:variable text
+# De meme pour les xxxx2
+
+proc creationentry { n nbf  text variable value} {
+    frame .f$n.fr$nbf
+    label .f$n.fr$nbf.lab1 -text [_ $text]
+    entry .f$n.fr$nbf.e1 -textvariable  $variable
+    .f$n.fr$nbf.e1 insert 0 $value
+    pack .f$n.fr$nbf
+    pack .f$n.fr$nbf.e1  -side right
+    pack .f$n.fr$nbf.lab1  -side left
+}
+
+proc mkecran { n args } {
+    global nbwidget
+    set nbf 0
+    set w .f$n
+    foreach i $args {
+       switch -regexp  [lindex $i 0] {
+           LIST {
+               listbox  $w.list$nbwidget
+               pack  $w.list$nbwidget
+           }
+           ENTRY {
+               creationentry  $n $nbwidget [lindex $i 1] [lindex $i 2] [lindex $i 3]
+           }
+           LABEL {
+               label  $w.label$nbwidget -text [_ [lindex $i 1]]
+               pack  $w.label$nbwidget
+           }
+           CHECK {
+               checkbutton  $w.check$nbwidget \
+                       -text [_ [lindex $i 1]] \
+                       -variable  [lindex $i 2] \
+                       -onvalue  [lindex $i 3] \
+                       -offvalue [lindex $i 4]
+               pack  $w.check$nbwidget
+           }
+           RADIO {
+               frame $w.fr$nbwidget
+               image create photo   [lindex $i 4] -file [lindex $i 5]
+               label  $w.fr$nbwidget.labrad  -image [lindex $i 4]
+               radiobutton  $w.fr$nbwidget.radio$nbwidget \
+                       -text [_ [lindex $i 1]] \
+                       -variable  [lindex $i 2] \
+                       -value [lindex $i 3]
+               pack   $w.fr$nbwidget.labrad  $w.fr$nbwidget.radio$nbwidget -side left
+               pack   $w.fr$nbwidget
+           }
+           BUTTON {
+               button  $w.button$nbwidget -text [_ [lindex $i 1]]
+               pack  $w.button$nbwidget
+           }
+           SCALE {
+               scale  $w.scale$nbwidget -from [lindex $i 1] -to [lindex $i 2] -orient horizontal
+               pack  $w.scale$nbwidget
+           }
+           FILE {
+               frame   $w.frame$nbwidget
+               set  wf $w.frame$nbwidget
+               label   $wf.label  -text [_ [lindex $i 1]]
+               entry   $wf.entry  -textvariable [lindex $i 2]
+               $wf.entry insert 0 [lindex $i 3]
+               button $wf.button -text [_ "File"] -command "openfilesel [lindex $i 2]"
+               pack $wf
+               pack  $wf.label $wf.entry $wf.button -side left
+           }
+           COLOR {
+               frame   $w.frame$nbwidget
+               set  wf $w.frame$nbwidget
+               if { [lindex $i 4] !="" } {
+                   label $wf.label  -text [_ [lindex $i 1]] -foreground [lindex $i 4]
+               } else {
+                   label $wf.label  -text [_ [lindex $i 1]]
+               }
+               entry   $wf.entry  -textvariable [lindex $i 2]
+               $wf.entry insert 0 [lindex $i 4]
+               button $wf.button -text [_ "Color"] -command "opencolorsel [lindex $i 3] [lindex $i 2] $wf"
+               pack $wf
+               pack  $wf.label $wf.entry $wf.button  -side left
+           }
+           FONT {
+               frame   $w.frame$nbwidget
+               set  wf $w.frame$nbwidget
+               label   $wf.label  -text [_ [lindex $i 1]]
+               entry   $wf.entry  -textvariable [lindex $i 2]
+               $wf.entry insert 0 [lindex $i 3]
+               button $wf.button -text [_ "Font"] -command "openfont [lindex $i 2]"
+               pack $wf
+               pack  $wf.label $wf.entry $wf.button -side left
+           }
+       }
+       set nbwidget [expr $nbwidget + 1]
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+# number total of screens
+set nbtotalecran 0
+
+creationscreennb  0 "wizard configure xlockmore" "This should help you to build xlockmore" m-xlock.xbm
+mkecran 0 \
+       {CHECK "without gcc    " wgcc     " --without-gcc" "" }\
+       {CHECK "with-purify    " wpurify  " --with-purify" "" }\
+       {CHECK "without motif  " wmotif   " --without-motif" ""}\
+       {CHECK "without editres" weditres " --without-editres" ""}\
+       {CHECK "without xpm    " wxpm     " --without-xpm" ""}\
+       {CHECK "without opengl " wopengl  " --without-opengl" "" }\
+       {CHECK "without mesagl " wmesagl  " --without-mesagl" "" }\
+       {CHECK "without dtsaver" wdtsaver " --without-dtsaver" "" }\
+       {CHECK "without dpms   " wdpms    " --without-dpms" "" }\
+       { }
+incr nbtotalecran
+
+creationscreennb  1 "Wizard configure image path" "please enter the image path"  m-xlock.xbm
+mkecran 1 \
+       {ENTRY  "Bitmap dir" bitmapdir }\
+       {ENTRY "Pixmaps dir" pixmapdir }\
+       {ENTRY "sound player program" soundprog    }\
+       {CHECK "enable syslog logging      " esyslog   " --enable-syslog" "" }\
+       {CHECK "enable multiple users      " emuluser  " --enable-multiple-user" "" }\
+       {CHECK "enable multiple root users " emulroot  " --enable-multiple-root" "" }\
+       {CHECK "enable unstable            " eunstable " --enable-unstable" "" }\
+       { }
+incr nbtotalecran
+
+creationscreennb  2 "Wizard configure include and library path" "Please enter the path"  m-x11.xbm
+mkecran 2 \
+       {ENTRY "path of X include          " incdir   }\
+       {ENTRY "path of X library          " libdir }\
+       {ENTRY "user executables in        " bindir }\
+       {ENTRY "system admin executables in" sbindir }\
+       {ENTRY "program executables in     " libexecdir }\
+       {ENTRY "info documentation in      " infodir }\
+       {ENTRY "man documentation in       " mandir }\
+       {ENTRY "find the sources in        " srcdir }\
+       { }
+incr nbtotalecran
+
+creationscreennb  3 "Wizard configure language" "Please choice your language "  m-xlock.xbm
+mkecran 3 \
+       {RADIO "Dutch   " lang  " --with-lang=nl" fdutch etc/gif/nlflag.gif}\
+       {RADIO "English " lang " " fenglish etc/gif/ukflag.gif}\
+       {RADIO "French  " lang  " --with-lang=fr" ffrench etc/gif/frflag.gif}\
+       {RADIO "German  " lang  " --with-lang=de" fgerman etc/gif/deflag.gif}\
+       {RADIO "Japanese" lang  " --with-lang=jp" fjapanese etc/gif/jpflag.gif}\
+       {}
+incr nbtotalecran
+
+#-----------------------------
+
+frame .f
+
+button .f.b1 -text [_ "< Previous"] -command {prec_ecran} -state disabled
+button .f.b2 -text [_ "Next >"] -command {next_ecran}
+button .f.b3 -text [_ "Abort"] -command {action}
+
+pack .f.b1 .f.b2  .f.b3  -padx 2m -pady 2m -side left
+pack .f -side bottom
+pack .f0
+
+# end
diff --git a/docs/3d.howto b/docs/3d.howto
new file mode 100644 (file)
index 0000000..536fb22
--- /dev/null
@@ -0,0 +1,43 @@
+
+              Introduction to 3d modes
+                  Henrik Theiling
+
+
+This is a short introduction to how you could try to see the 3d effects
+in xlock:
+
+- You will need glasses with one lens red and the other blue (or green).
+  The blue (or green) one needs to be in front of the left eye, the red one
+  in front of the right one.  If you have got differently coloured lenses
+  (like green) you can try to adjust the colours by using the switches
+  -right3d <colour> and -left3d <colour> .
+
+ If you do not see any 3d effect, try to change the -delta3d value.
+
+- Adjust the colour of your screen (or use -right3d/-left3d instead).  Most
+  likely if you use the green colours will be too bright so you can see them
+  through the red lens, too.
+
+- Let the program display in blue for the green lens.  You should still be
+  able to see blue through your green lens, but less likely through your
+  red lens.
+
+- Try to zoom in from a completely dark screen.
+
+- Try different 3d modes.  Some people see `rock' more easily, others `worm'.
+  It depends.
+
+I hope you enjoy it.
+
+Currently the following modes are implemented for 3d view:
+  rock, worm, bouboule, pyro.
+
+BUGS:
+  Some of the 3d modes are not implemented with real 3d.  They try to
+  use a close approach.
+  Rock, pyro and bouboule use real 3d calculations.
+  In the worm mode, worms can not just creep to the bottom or the top.  That
+  means they do not have a real 3d direction but one 2d direction (the same
+  as in 2d mode) and an additional 1d direction for the z-axis.  This could
+  be fixed.
+
diff --git a/docs/HACKERS.GUIDE b/docs/HACKERS.GUIDE
new file mode 100644 (file)
index 0000000..38731de
--- /dev/null
@@ -0,0 +1,591 @@
+
+
+                       The xlock Hacker's Guide
+                             Ron Hitchens
+
+
+INTRODUCTION
+
+   This document is meant to serve as a guide for those who wish to hack
+xlock; to make changes, add new modes, fix bugs, etc.  The intent is to
+explain non-obvious things about how the various pieces of xlock
+are organized, to help the casual hacker avoid common coding mistakes
+and to stay away from "off limits" parts of xlock.
+
+
+What Is Xlock?
+
+   Xlock is an application for the X Window system which will cover up
+one or more X screens to prevent access.  It may be run manually by a
+user to lock the display or, more commonly, xlock may be run automatically
+by a daemon utility after a period of inactivity.
+
+   Xlock creates a "blanket" window to cover the entire screen, and also
+grabs the X server to prevent access by external clients.  When the
+user presses a key or clicks a mouse button, xlock will prompt for a
+password.  When the proper password is provided, xlock releases the
+server and removes its blanket window.
+
+   While xlock has the display locked, it runs one or more "modes" which
+are code modules that draw various things on the xlock window.  These
+modes act as screen savers.  They attempt to provide amusing and/or
+entertaining displays, while avoiding static imagery which could lead
+to screen phosphor "burn-in".
+
+   The xlock application began life at Sun Microsystems many years
+ago.  It was written by Patrick J. Naughton and was much simpler then.
+That original xlock is almost ubiquitous in the X Windows world.  This
+distribution, known as xlockmore, is maintained by David Bagley and
+is not officially connected with the original xlock, (although it
+received Patrick's blessing).  Major enhancements have been made to
+xlock - many, many new modes have been added and significant structural
+changes have been made.  This document will attempt to inform you of
+how xlock is structured and how the pieces fit together.
+
+
+ORGANIZATION
+
+   Xlock is organized into two basic parts: the "mainline" code, which
+handles startup, window creation, passwords, etc, and the modes,
+which are self-contained modules that draw things on the window(s)
+provided by the mainline code.
+
+   The code which makes up an xlock mode is accessed through a few
+well-defined callback functions, or "hooks".  The mode should not
+concern itself with anything not provided to it via these hooks.
+As of the xlockmore-3.8 release, these hooks have been restructured
+to provide all the environmental information a mode needs to do its
+task.  Prior to this, it was necessary for the modes to access global
+variables.  This is no longer condoned, it is now strongly suggested
+that modes only trust the passed-in information.  These globals will
+probably go away once all the naive modes have been updated.
+
+
+MAINLINE CODE
+
+   The mainline xlock code is concerned with preventing unauthorized
+access to the X server and creating the environment in which the modes
+run.  It also calls the hooks for the current mode in response to
+external events and timing intervals.  The mainline code keeps track
+of the clock and determines when to make calls to a mode.
+
+        < unfinished >
+
+MODES
+
+   The primary focus of this document is writing and maintaining
+modes.  The remainder will be concerned with how to write a mode,
+how a mode accesses the display, what a mode should not do, etc.
+
+
+HOOKS
+
+   Xlock modes are driven entirely through their externally visible
+hook functions.  There are currently five hooks defined, with a sixth
+reserved for future expansion.  The first two, init and callback, are
+the same as in older versions of xlock.  The release, refresh and
+change hooks are new to xlockmore-3.8:
+
+       o init   This hook will be called to prepare a mode for running.
+               The mode should allocate resources, establish its
+               initial state, etc.  This hook may be called
+               multiple times, and the window and/or screen
+               values may be different each time.
+
+       o callback  This is the main driver hook for a mode.  It
+               is called repeatedly, at a time interval determined
+               by defaults or command line arguments.  A mode sees
+               each call as one "tick", it may chose to do something
+               on every tick, or count the calls and only update
+               the screen periodically.  A mode should not spend a
+               lot of time executing the callback function.  If it
+               has a lot of screen updating to do, it should spread
+               the work across multiple calls.  A mode can depend
+               on the init hook being called at least once before
+               the callback hook is called.  But it should not depend
+               on the callback hook ever being called following an init.
+
+       o release  This hook will be called when some other mode is
+               about to be initialized, or when xlock is shutting
+               down.  This hook should free up any long-lived,
+               dynamically allocated resources the mode has acquired.
+               This would include memory and X resources, such as
+               Pixmaps and GCs.
+
+       o refresh  This hook is called when the drawing window may have
+               been damaged.   It should take steps to repaint the
+               window.  No information about which part(s) of the
+               window have been damaged is provided.  The mode should
+               repaint the entire window.  If no refresh hook is
+               provided, the init hook will be called when a refresh
+               is needed.
+
+       o change  This hook is called when the user requests a change.
+               In the current implementation, this is when the user
+               clicks the middle mouse button.  This hook is currently
+               only used by the random mode, it means to move on to
+               the next mode (random mode runs other modes as slaves).
+               A mode is free to interpret a change request in any
+               way it likes.  The logical thing is to start over,
+               change colors, etc.
+
+
+Calling Conventions
+
+   The prototype for a mode hook is defined in mode.h, and looks like
+this:
+
+       void mode_hook (ModeInfo *mode_info)
+
+   The argument, a pointer to a ModeInfo structure, contains
+all the context information a mode needs to run.  Writers of new modes
+are strongly encouraged to acquire all information they need through
+this handle.
+
+   A ModeInfo handle is provided to every hook type.  The information
+in this structure is current ONLY AT THE TIME THE HOOK IS CALLED.  The
+structure it points to is volatile and the pointer should not be cached
+by the mode.  It is also important to note that xlock may be locking
+several screens simultaneously.  The window information may not be the
+same across subsequent calls to the same callback function.  Use the
+information provided, do not look at globals, and do not stash the pointer.
+
+
+The Init Hook
+
+   A mode's init hook will be called whenever the mainline code wants
+to inform a mode it is about to run on a particular window.  The mainline
+xlock code will only run one mode at a time, but it may be running that
+mode on several screens at once.  It is therefore possible for the init
+hook to be called several times, each with a different window context,
+before its callback hook is run.  An init hook should not assume the
+window provided is the window to be used by the next call to the
+callback hook.  Depending on the nature of the mode, it may be
+necessary to maintain several sets of state information, one for each
+screen.
+
+   The number of active screens, and the maximum possible number of
+screens are provided in the ModeInfo struct.  Modes are encouraged
+to look at this information and allocate data structures dynamically.
+The number of active screens will not change during an xlock run.
+A global symbol, MAXSCREENS, is defined in xlock.h but programmers
+are strongly urged not to use this or any other fixed value.  If
+you use only the information passed to the hooks, your code will
+always be correct.
+
+   An init hook should also be prepared to be called at any time.  The
+mainline xlock code changes window configuration in response to user
+input, and may call the init hook in place of a missing refresh hook.
+An init hook should therefore not expect to be balanced with a call
+to the release hook.  The init hook should not allocate resources on
+each call, it should track its allocations to make sure they are only
+done once.
+
+   Neither should an init hook depend on the callback hook ever being
+called.  It's possible a call to the init hook may be followed by another
+call to the init hook, or a call to the release hook without an intervening
+call to the callback hook.
+
+   An init hook may be called twice in a row, and will be if more than
+one screen is being locked.  To avoid unexpected glitches on-screen,
+it is recommended that you do not draw anything to the screen during
+the init hook.  Save the drawing for the callback hook, with appropriate
+status information if an initial screen paint is needed.
+
+   Be careful not to blindly do dynamic allocations in your init hook,
+keep track of your allocations and only do the necessary state reset
+each time.  Track your allocations so they can be undone by the release
+hook at a later time.
+
+   The init hook will be called for each screen before the callback
+hook is called for any screen.
+
+
+The Callback Hook
+
+   The callback hook is the method by which a mode runs.  The mainline
+code calls a mode's callback hook periodically, usually on a fixed time
+schedule, and checks for user input between each call.
+
+   The time interval between calls to the callback hook is set by a
+field in the LockStruct entry for the mode (see mode.h and mode.c).
+This value may also be set by the user on the command line, or via
+an X resource.  The mainline code attempts to keep the time interval
+between the *beginning* of each call constant.  The time spent executing
+the mode's callback hook is subtracted from the interval to keep the
+ticks as constant as possible.  This is hardly perfect, but an effort
+is made to remain as accurate as is possible on a multi-tasking system.
+
+   A mode should therefore not spend a large amount of time executing
+in the callback hook.  While in the callback, the mainline code cannot
+respond to external events from the user.  It is preferable for a
+callback hook to do a little bit of the work on each call, rather than
+a complete update each time.
+
+   A callback should pay attention to the context information passed
+to it.  On multi-headed displays, the callback may be called successively
+for each screen on the display.  It may be necessary to maintain
+state information which is indexed by the given screen number, rather
+than simply using local static variables.
+
+   The screen number is provided by the ModeInfo argument and will
+range from 0 to n, where n is the number of active screens minus one.
+There will always be a screen 0.  A mode wishing to paint the same
+imagery one each screen should do the same thing each time the callback
+is called, and advance its state when the screen number is 0.  However,
+the window may not be the same size on every screen.  Do not assume it is.
+
+   A call to the callback hook is not guaranteed following an init call
+for a given screen, but at least one init call is guaranteed before the
+first callback call.  If the window size changes, as when the icon
+window is presented to prompt for the password, an init call
+will be made with the new window information.  A mode should
+always use the window information passed to it rather than caching
+information passed to the init hook, but it can use the information
+passed to the init hook to setup its own data structures and rely
+on the information matching the next callback call, *for that screen*.
+
+
+The Release Hook
+
+   This hook is new to release 3.8.  The release hook will be called by
+the mainline code when it is about to call the init hook of another mode,
+and your init hook has been called at least once since the last call
+to your release hook.
+
+   The release hook should undo any dynamic allocations done by the
+init hook, or anything else that needs to be done to make the mode
+inactive.  Once the release hook returns, the mode is marked as not
+initialized.  If your mode is never initialized again, no further
+calls to any of its hooks will be made.  The release hook is where
+you must surrender any resources that only your mode knows about.
+
+   The release hook is called ONLY ONCE.  It will not be called
+for each screen like most of the other hooks.  A mode should not
+access any of the window information, other that the display handle
+and number of active screens.
+
+   Once the release hook has been called the mode is considered
+to be inactive, the same as if it had never been run at all.
+
+  < Final call at shutdown?? >
+
+
+The Refresh Hook
+
+   This hook is new to release 3.8.  The refresh hook is called when
+the mainline suspects the window may have been damaged.
+
+   When running in "inwindow" mode (xlock runs in a plain window, not locking)
+this may happen when windows are shuffled by the user.  It may also happen
+when in normal full-screen mode and some new window appears on the display.
+In this case, xlock immediately pushes itself to the top, to cover the
+new window.  However, the temporary appearance of the new window may
+have left a "hole" on the display.  The refresh hook should take steps
+to repaint the entire display whenever it is called.
+
+   It will also be called when the window is first mapped.  However,
+a mode should not depend on a refresh call to do its initial screen
+paint.  When running random mode, other modes will be stopped and started
+on the same window, with no intervening refresh call.  A mode should
+usually do a full paint on the first callback following an init call.
+It is a good strategy to have the refresh hook simply set a status flag
+(or whatever) to cause the next callback call to do a full repaint.  This
+would be similar to an init, but internal state would not be reset.
+
+   If no refresh hook is provided for your mode (configured in mode.c),
+then your init hook will be called in place of the refresh hook.  The
+refresh hook is provided so your mode can repair window damage
+without losing the internal state of the mode.
+
+   As of this writing, there is a hack in place which will prevent a
+second call to the init hook (in place of a refresh) if the callback
+hook has not been called since the last init call for that screen.
+This causes undesirable behavior in some naive modes.  It is expected
+this hack will be removed.  Modes should be prepared for their init
+hooks to be called at any time, even repeatedly.
+
+
+The Change Hook
+
+   This hook is new to release 3.8.  It is called when the user requests
+a change.  This is currently in response to a click on the middle mouse
+button.
+
+   In the case of random mode, which runs other modes, it means to
+move on to the next mode without waiting for the time to expire.  Other
+modes are free to interpret this call in way they choose.  If no change
+hook is provided for a mode, no action will be taken when the middle mouse
+button is clicked.
+
+   This hook will be called once for each active screen when a change
+request is made.
+
+
+Hook Calling Sequence
+
+   A typical sequence of calls when running on two screens would be:
+
+       init [screen 0]
+       init [screen 1]
+       refresh [screen 0]      (caused by first mapping the window)
+       refresh [screen 1]
+       callback [screen 0]
+       callback [screen 1]
+       callback [screen 0]
+       callback [screen 1]
+       ...
+       refresh [screen 0]      (caused by window damage)
+       refresh [screen 1]
+       callback [screen 0]
+       callback [screen 1]
+       ...
+       init [screen 0]         (switch to icon screen)
+       callback [screen 0]
+       callback [screen 1]
+       ...
+
+
+HANDS OFF THOSE GLOBALS
+
+   All the environmental information a mode needs is provided to the
+hook functions via the ModeInfo passed as an argument.  But prior to
+the restructuring done in xlockmore-3.8, much of this information
+had to be accessed directly from global variables.  Listed here are
+the globals which correspond to the information passed in ModeInfo.
+You should not access these variables directly (they will go away),
+nor should you use these names for local variables.  The first column
+is the global name, the second column is the macro to use to get
+the same information from the ModeInfo argument (see mode.h):
+
+   These variables pertain to the X screen
+       dsp             MI_DISPLAY      handle to the X server display.
+       screen          MI_SCREEN       Current screen number
+       Scr             MI_PERSCREEN    perscreen struct ptr for curr screen
+       Scr[n].gc       MI_GC           gc handle for current screen
+       Scr[n].npixels  MI_NPIXELS      num available pixels for curr screen
+       Scr[n].cmap     MI_CMAP         colormap handle for current screen
+       Scr[n].pixels   MI_PIXELS       pixel array for current screen
+       Scr[n].pixels[i] MI_PIXEL       a given pixel in the pixel array
+
+   These variables control execution, set by cmd line or resources
+       delay           MI_DELAY        time (microsecs) between callbacks
+       batchcount      MI_BATCHCOUNT   batchcount value
+       cycles          MI_CYCLES       cycles value
+       saturation      MI_SATURATION   colormap saturation value
+
+   These variables are booleans, usually set by cmd line:
+       mono            MI_IS_MONO      use only B&W (can be set for color)
+       inwindow        MI_IS_INWINDOW  running in regular window
+       inroot          MI_IS_INROOT  running in the root window
+
+   The MI_IS_MONO flag will be true if the global "mono" is set
+(which can be specified on the command line for color displays) or
+if the screen is a monochrome device.  It IS possible to have both
+color and monochrome screens at the same time.  Use the passed-in
+information on a screen-by-screen basis, do not assume they are all
+the same.
+
+   There are several other global booleans in resource.c.  These will
+probably be eliminated in future releases.  Do not access them directly.
+They should not be of interest to a mode anyway, but be careful not to
+use those names in your own code.
+
+
+PLUGGING A NEW MODE INTO XLOCK
+
+   The code making up a mode should be self-contained.  A mode should
+hide all of its internal variables and functions.  Only the hook functions
+and one configuration variable should be visible outside the module
+the mode is defined in.  Because there are some many code modules
+compiled into xlock, written by many different people, the chance
+of naming conflicts is quite high.  Keep all your local stuff local.
+
+   The nexus where the mainline xlock code connects to the individual
+modes is in the file mode.c.  It contains an array of pre-initialized
+LockStruct structures named LockProcs.  This struct is currently
+defined as:
+
+       typedef struct LockStruct_s {
+               char       *cmdline_arg;        /* mode name */
+               ModeHook   *init_hook;          /* func to init a mode */
+               ModeHook   *callback_hook;      /* func to run (tick) a mode */
+               ModeHook   *release_hook;       /* func to shutdown a mode */
+               ModeHook   *refresh_hook;       /* tells mode to repaint */
+               ModeHook   *change_hook;        /* user wants mode to change */
+               ModeHook   *unused_hook;        /* for future expansion */
+               ModeSpecOpt *msopt;             /* this mode's def resources */
+               int         def_delay;          /* default delay for mode */
+               int         def_batchcount;
+               int         def_cycles;
+               float       def_saturation;
+               char       *desc;               /* text description of mode */
+               int         flags;              /* state flags for this mode */
+               void       *userdata;           /* for use by the mode */
+       } LockStruct;
+
+   Of these fields, the hooks and msopt are defined in the mode itself.
+The hooks are names of functions which are called as previously described.
+Init and callback hooks are required, all others are optional.
+Any hooks not provided are specified as NULL.  The field "msopt" is
+a pointer to a ModeSpecOpt struct (xlock.h).  Every mode must define
+one of these structures and make it globally visible to mode.c.  This
+structure provides a handle to X resource information that allows
+for parsing command line arguments unique to your mode and setting
+static variables private to your mode.
+       << unfinished, see random.c for an example >>
+
+   The remaining fields of the LockStruct struct are defined directly
+in the array in mode.c.  The fields with the names def_* are the default
+values to be used when running this mode, if not overridden by command
+line arguments of resources.
+
+   The field def_delay controls how often the callback hook is called
+(specified in microseconds).
+
+   The floating point number def_saturation controls the saturation of
+the colormap to allocate.  This controls how the color ramp is
+populated (<<unfinished: how?>>)
+
+   The other two default values, def_batchcount and def_cycles, are
+for use by the mode.  They can be used to control how many thingys
+to draw at once, how often to restart, etc.  These values can be
+specified at run time which allows the user to affect how a mode runs.
+
+   The text pointers cmdline_arg and desc are used when printing
+command line help.  They provide the simple name and a more verbose
+short description.
+
+   The flags field should always be set to zero, it is used internally
+to keep track of state information.
+
+   The last field, userdata, is for use by the mode.  The mode may use
+this generic pointer for any purpose it likes.  The mainline code will
+never touch it and it will be available to all subsequent hook calls.
+This value will survive init - release - init cycles.
+
+
+GETTING INFORMATION FROM ModeInfo
+
+   The ModeInfo structure is defined in mode.h.  It contains several
+types of information and is actually made up of several other structs.
+This structure is likely to undergo major revision in future releases,
+so macros are provided to access all the fields.  Use the macros,
+things are guaranteed to change.
+
+   Of the fields available in ModeInfo, most are copies of the same
+information available in the globals described above.  But some are new.
+Most notably, the window dimensions and black/white pixel values are
+now provided, so there is no need to make direct X library calls to
+get this information yourself.
+
+   There is also some provision for a future debugging facility to
+fake multiple screens by using multiple regular windows.  This
+code is not yet implemented.  When it is, the number returned by
+the MI_SCREEN macro may not correspond to a real X screen.  As of
+this writing, MI_SCREEN and MI_REAL_SCREEN always contain the same
+value.  Use MI_SCREEN as an index to track which window you are
+drawing to, use MI_REAL_SCREEN when calling X Windows functions
+which require actual screen numbers.  The MI_SCREENPTR pointer
+will always be valid, but identical for all faked screens.
+
+   The ModeInfo structure also provides a pointer to the LockStruct
+record that corresponds to the mode.  DO NOT MODIFY THIS STRUCTURE.
+This is provided so that you can see what your compiled in defaults
+where for delay, batchcount, cycles and saturation.  You can also
+get your own name and description and access the userdata field (it's
+ok to modify userdata, do not change anything else, use the macros).
+
+   All fields should be considered read-only, except MI_USERDATA
+and MI_PAUSE.  MI_USERDATA is not used by the mainline code, you
+can use any way you like and its value will be preserved.  However,
+the MI_PAUSE field is special.  MI_PAUSE is examined up upon return
+from your callback hook.  If it is not zero (it will be set zero
+before the call) it is interpreted as a time, in microseconds, to
+delay before making the next callback.
+
+   The MI_PAUSE mechanism is somewhat of a hack, and it is expected
+to change in future revisions of xlock.  Most probably it will be
+moved out of the ModeInfo struct and the callback return value will
+specify the delay value.  This one-time pause mechanism is also
+broken for multiple screens.  It is only noticed on the highest
+numbered screen.   Future revisions of xlock will (hopefully) fix this,
+but for now you can see how it works by looking at the code for maze
+or triangle.
+
+
+EXAMPLE
+
+   <<unfinished>>
+
+   The eyes mode (eyes.c) was written by the same author that did
+the majority of the restructuring for the new mode interface.  It
+should (hopefully) serve as a good example of a properly written
+mode.  It makes use of the new refresh and release hooks.  The
+random mode (random.c) will also illustrate the change hook and
+private resources.  The triangle mode (triangle.c) has also been
+updated to use the new scheme.  It uses the MI_PAUSE mechanism to
+sleep between scenes.
+
+------------------------
+
+   The official xlockmore maintainer is David Bagley.  He can be
+reached at bagleyd@tux.org.  The current release of xlockmore
+is available by anonymous ftp at ftp.x.org in /contrib/applications.
+Alpha versions are available at
+ftp://ftp.tux.org/pub/X-Windows/xlockmore/index.html
+
+   The restructuring of the calling mechanism for mode hooks was
+done by Ron Hitchens <ron@idiom.com>.
+
+------------------------
+
+   This document written by Ron Hitchens <ron@idiom.com>
+It is still very rough and incomplete.  What you see here is
+basically the first draft, brain-dump version.  It needs to be
+polished to make it more readable, condensed to make it less
+redundant and organized to make it more cogent.  But it's a start.
+Hopefully, this will eventually be converted to LaTeX.  When
+I get some time...
+
+
+Last Update:
+Mon Mar 18 03:46:16 MST 1996
+
+Dave's Check List for new modes
+-------------------------------
+
+Do not use:
+#elif  had some trouble with it once somewhere I think, hmm maybe its ok.
+snprintf is a nice command but not all unixes support it like HPUX 10.20
+XSync(dsp, True) in modes, typing in password will be hard
+exit or abort in modes.... its a lock and this will unlock it.
+
+Please do:
+each allocation of memory should be checked or else a malicious user can
+  start many processes on the machine to unlock it
+
+Debug code:
+Use #define DEBUG for one-time debugging stuff that may still prove useful.
+I found in debugging X that XSynchronize(dsp, True) is real helpful.
+
+OK now you got a working mode $file.  What auxiliary files are there to change?
+$file.c mode.c mode.h                       You must have changed already
+modes/random.c                              If its a special mode or gl mode
+modes/Makefile.in make.com modes/Imakefile  Makefiles
+modes/glx/Imakefile                         If it is a gl mode
+xlock/XLock.ad                              Resource file
+xlock/xlock.man                             The manual
+xmlock/modes.h                              Motif launcher file (generated)
+etc/xlock.tcl                               TCL lanuncher file (generated)
+etc/xlockFrame.java                         Java lanuncher file
+etc/system.fvwm2rc.xlock                    fvwm2 menu
+etc/system.fvwmrc.xlock                     fvwm menu
+etc/system.olwmrc.xlock                     Openwin menu
+etc/system.mwmrc.xlock                      Motif menu
+etc/system.wmrc.xlock                       GNU WindowMaker menu
+etc/dtscreen.dt                             Screensaver actions for CDE (descr)
+etc/dtprofile                               CDE profile
+docs/Revisions                              Give credit
+docs/xlock.html                             Web reformat of manual (generated)
+docs/xlock.hlp                              VMS reformat of manual (generated)
diff --git a/docs/HACKERS.GUIDE.fr b/docs/HACKERS.GUIDE.fr
new file mode 100644 (file)
index 0000000..a417f35
--- /dev/null
@@ -0,0 +1,286 @@
+I translate a part of the HACKER.DOC in french
+first in text
+second in html
+bye
+--
+charles /  \
+vidal  / ..|\
+      (_\  |_)vidalc@club-internet.fr
+      /  \@'
+     /     \  http://www.chez.com/vidalc
+ _  /  `   |
+\\/  \  | _\
+ \   /_ || \\
+  \____)|_) \_)
+-----------------------------------------
+LA DOC DU BIDOUILLEUR
+
+INTRODUCTION
+________________________________________________________________________________
+
+Ce document est pour tous ceux qui veulent modifier xlock (more), ajouter de
+nouveaux modes, debugger , etc....
+
+xlock kesako ?
+
+xlock est une application pour X-windows qui emp\88che l'acc\8as d'un ou plusieurs
+\82crans. Il peut \88tre envoy\82 manuellement ou plus commun\82ment envoy\82
+automatiquement par un d\82mon apr\8as une p\82riodes d'inactivit\82.
+Xlock cr\82\82 une fen\88tre couvrant enti\8arement l'\82cran, et capte tous \82v\82nements
+pr\82venant ainsi l'acc\8as ext\82rieur.
+Quand une touche est press\82e alors xlock affiche un message mais aussi le mode
+dans une icone
+(MODE_ICONIQUE) et demande votre mot de passe.
+Lorsque l'\82cran est lock\82 ( ferm\82 ), des images, des dessins, ou des animations
+sont affich\82es servant de screen-saver \82vitant la d\82gradation du phosphore.
+Xlock fut d\82velopp\82 chez Sun Micro System par Pack J Naughton.David Bagley l'a
+repris et maintenu sous le nom de Xlockmore dans lequel d'innombrable mode ont
+\82t\82 ajout\82, ainsi que la possibilit\82 d'afficher un mode dans une fen\88tre et
+aussi sur la root window.
+
+________________________________________________________________________________
+ORGANISATION GENERALE
+
+xlock est organiser en deux partie.
+
+1. le traitement de la ligne de commande, la cr\82ation de fen\88tre, le mot de
+passe, etc ...
+
+2 les modes: ils peuvent \88tre coder de tel mani\8are qu'il n'y a pas besoin de
+faire appel \85 X pour la taille de la fen\88tre, les couleurs ...
+Une API est comprise dans xlock pour avoir tout les renseignements en ce qui
+concerne l'\82cran.
+C'est dans cette partie que vous allez pouvoir ajouter d'autres modes.
+
+L'architecture logiciel d'un mode est structur\82 en 4 sortes de fonctions:
+
+-init:
+celle-ci devra \88tre appelle pour pr\82parer le d\82roulement d'un mode. Le mode
+devra initialiser des tables de sinus
+par exemple, allouer des ressources, m\82moire entre autre, \82tablir l'\82tat initial
+par des variables etc. ...
+Cette fonction peut \88tre appel\82 plusieurs fois et la fen\88tre ou l'\82cran peuvent avoir des taille diff\82rentes.
+
+-callback:
+C'est la principale fonction, c'est la que est implement\82 le corps du mode.
+ Elle est appel\82 p\82riodiquement.
+ Cette fonction ne doit pas occuper beaucoup de temps a s'ex\82cuter.
+Cette fonction peut etre appele dans deux contextes diff\82rents:
+ plein \82cran ou en version icon. La fonction MI_IS_ICONIC vous dira dans
+quelle contexte on se trouve.
+
+-release:
+Ici, cette fonction sera appel\82 si un autre mode est appel\82 ( random , et bouton
+droit ), ou si xlock se termine.
+Dans cette fonction, il faut d\82sallouer la m\82moire, X ressource, Pixmaps et
+graphics context.
+
+-refresh:
+ Celle ci est appel\82 lorsque le dessin peut \88tre abim\82. Le mode doit repeindre
+l'ensemble de la fen\88tre.
+
+-change: ???? <A FINIR>
+
+
+
+________________________________________________________________________________
+CONVERSION:
+Le prototype de ces fonctions est d\82fini dans mode.h et ressemble \85:
+       void typefonction _mode( ModeInfo *mode_info)
+La structure mode_info est en lecture seule, et contient l'ensemble des
+informations sur l'\82cran.
+Ne regardez pas les variables globales, n'\82crasez pas ce pointeur.
+Au lieu de faire des requetes pour conna\8ctre le num\82ro de la couleur blanche
+etc... , il y a des fonctions propres a xlock: utilisez les.
+
+
+
+
+________________________________________________________________________________
+L'AJOUT D'UN NOUVEAU MODE:
+
+Ajoutons un nouveau mode appel\82 fadeplot:
+Pour ce faire il faut d'abords ajouter dans mode.h
+® extern ModeHook init_fadeplot;
+extern ModeHook draw_fadeplot;
+extern ModeHook release_fadeplot;
+extern ModeHook refresh_fadeplot; ¯
+les fonctions qui vont \88tre cr\82\82s.
+
+® extern ModeSpecOpt fadeplot_opts; ¯
+une structure qui ne m'a pas r\82v\82l\82 tous ces secrets.
+
+mais aussi dans mode.c \85 cot\82 des autres fonctions , dans ce que j'appelle la
+ tableau des modes:
+ {"fadeplot", init_fadeplot, draw_fadeplot, release_fadeplot,
+ refresh_fadeplot, init_fadeplot, NULL, &blank_opts, 17000, 1, 20, 1.0,
+  "fadeplot", 0, NULL},
+
+On passe ensuite \85 l'impl\82mentation des fonctions proprement dit dans un fichier
+que l'on appellera fadeplot.c.
+Il est \82vident qu'il faudra modifier le Makefile ( Pour cela je vous laisse
+faire :).
+
+Dans ces fonctions, \85 partir de la structure ModeInfo, on va obtenir des
+informations sur l'\82cran qui sont indispensables pour la suite
+
+MI_WIDTH(mi) et MI_HEIGHT(mi)  vont nous donn\82 la taille de l'\82cran.
+Display    *display    = MI_DISPLAY(mi);       d\82livre le display
+Window      window = MI_WINDOW(mi);      d\82livre l'identificateur de la fen\88tre
+GC          gc               = MI_GC(mi);    donne le graphics context courant
+XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               Mettre la couleur du trac\82 en noir
+XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                                Mettre la couleur du trac\82 en blanc
+
+MI_IS_ICONIC(mi)               permet de savoir si on est pass\82 en phase
+                                                               password.
+NUMCOLORS                      Donne le nombre de couleur
+
+
+Oubliez pas apr\8as avoir dessin\82 l'ensemble de faire Xflush(display),
+ce qui permettra d'afficher r\82ellement votre graphisme sur l'\82cran.
+La cr\82ation d'un nouveau mode s'\82ffectue souvent en r\82cup\82rant le squelette
+d'un autre et de le modifier \85 sa volont\82.
+N'h\82sitez pas a \85 regarder le code des autres modes, c'est souvent tr\82s
+instructifs.
+Dernierement on peut utiliser la librairie mesa (la libraire GNU OpenGL de
+silicon Graphics) dans xlock.
+Voila j'espere que vous prendrez plaisir a ajouter des nouveaux modes \85 xlock,
+ un petit conseil le mainteneur de xlock est un fan de casse t\88te et compagnie.
+Bon Xlock.
+
+Charles VIDAL: vidalc@club-internet.fr
+mode flag, fadeplot, circle
+createur de xmxlock : GUI launcher de xlockmore.
+
+------------------------------------------------------
+
+<HTML>
+<HEAD>
+<TITLE>Xlock french hacker</TITLE>
+</HEAD>
+<BODY>
+<Center><H1>XLOCK FRENCH HACKER</H1></Center>
+<BR>
+<H2>INTRODUCTION</H2>
+<HR>
+Ce document est pour tous ceux qui veulent modifier xlock (more), ajouter de nouveaux modes, debugger , etc....
+
+<H2>xlock kesako ?</H2>
+
+xlock est une application pour X-windows qui empêche l\92accès d\92un ou plusieurs écrans. Il peut être envoyé manuellement ou plus communément envoyé automatiquement par un démon après une périodes d\92inactivité.
+ Xlock créé une fenêtre couvrant entièrement l\92écran, et capte tous événements prévenant ainsi l\92accès extérieur.
+Quand une touche est pressée alors xlock affiche un message mais aussi le mode dans une icone (MODE_ICONIQUE) et demande votre mot de passe.<p>
+Lorsque l\92écran est locké ( fermé ), des images, des dessins, ou des animations sont affichées servant de screen-saver évitant la dégradation du phosphore.
+Xlock fut développé chez Sun Micro System par Pack J Naughton.David Bagley l\92a repris et maintenu sous le nom de Xlockmore dans lequel d\92innombrable mode ont été ajouté, ainsi que la possibilité d\92afficher un mode dans une fenêtre et aussi sur la root window ou d\92afficher sequentiellement plusieur mode par l\92option random et par l\92appuis du bouton du millieu.<p>
+Il existe des terminaux X avec plusieur ecrans gere par un seul terminal, alors le même mode s\92affichera sur plusieur ecran. On peut toutefois faire des effets, comme une balle passant de lui a l\92autre.
+
+<HR>
+<H2>ORGANISATION GENERALE</H2>
+
+xlock est organiser en deux partie.<p>
+
+<OL>
+<LI> le traitement de la ligne de commande, la création de fenêtre(s), le mot de passe, etc ...
+<LI> les modes: ils peuvent être coder de tel manière qu\92il n\92y a pas besoin de faire appel à X pour la taille de la fenêtre, les couleurs ... Une API est comprise dans xlock pour avoir tout les renseignements en ce qui concerne l\92écran.C\92est dans cette
+</OL>
+<HR>
+<B>L\92architecture logiciel d\92un mode est structuré en 4 sortes de fonctions:</B>
+<UL>
+<LI><U><B>-init:</B></U>
+celle-ci devra être appelle pour préparer le déroulement d\92un mode. Le mode devra initialiser des tables de sinus par exemple, allouer des ressources, mémoire entre autre, établir l\92état initial par des variables etc. ...
+Cette fonction peut être appelé plusieurs fois et la fenêtre ou l\92écran peuvent avoir des taille différentes.<p>
+
+<LI><U><B>-callback:</B></U>
+C\92est la principale fonction, c\92est la que est implementé le corps du mode. Elle est appelé périodiquement. Cette fonction ne doit pas occuper beaucoup de temps a s\92exécuter surtout si elle a plusieur ecran s\92occuper.
+Cette fonction peut etre appele dans deux contextes différents:
+ plein écran ou en version icon. La fonction MI_IS_ICONIC vous dira dans quelle contexte on se trouve.
+la fonction init_mode est toujours appelle avant la fonction callback.
+On peut choisir de faire quelque chose a chaque appelle, ou de compter le nombre d\92appelle, et puis de modifier l\92ecran periodiquement.<p>
+
+<LI><U><B>-release: </B></U>
+Ici, cette fonction sera appelé si un autre mode est appelé ( random , et bouton droit ), ou si xlock se termine. Dans cette fonction, il faut désallouer la mémoire, X ressource, Pixmaps et graphics context.
+<p>
+<LI><U><B>-refresh:</B></U>
+ Celle ci est appelé lorsque le dessin peut être abimé. Le mode doit repeindre l\92ensemble de la fenêtre.
+Aucun information sur la partie de l\92ecran endomage n\92est delivre.
+<p>
+<LI><U><B>-change:</B></U> Dans la version courante, seule le mode random utilise cette fonctionnalite. Cet fonction est appele lorsque que l\92on change de mode par l\92appuie du boutton du millieu. Il est laisse a l\92imagination de chacun en ce qui conserne
+</UL>
+
+
+<HR>
+<H2>CONVENTION:</H2>
+Le prototype de ces fonctions est défini dans mode.h et ressemble à:<p>
+<Center>       void typefonction _mode( ModeInfo *mode_info)</Center>
+La structure mode_info est en lecture seule, et contient l\92ensemble des informations sur l\92écran. Ne regardez pas les variables globales, n\92écrasez pas ce pointeur. Au lieu de faire des requetes pour connaître le numéro de la couleur blanche etc... , il y a des fonctions propres a xlock: utilisez les. Si vous utilisez les informations passe en parametre des fonctions du modes ( voir ci dessus ), votre code sera toujours correcte.
+Le temps entre chaque appelle  de fonctions est en milliseconde.
+
+<HR>
+<H2>L\92AJOUT D\92UN NOUVEAU MODE:</H2>
+
+Ajoutons un nouveau mode appelé <A HREF="file:fadeplot.txt">fadeplot</A>:<p>
+Pour ce faire il faut d\92abords ajouter dans mode.h<p>
+« extern ModeHook init_fadeplot;<p>
+extern ModeHook draw_fadeplot;<p>
+extern ModeHook release_fadeplot;<p>
+extern ModeHook refresh_fadeplot; »<p>
+les fonctions qui vont être créés.
+<p>
+« extern ModeSpecOpt fadeplot_opts; »<p>
+une structure qui ne m\92a pas révélé tous ces secrets.<p>
+
+mais aussi dans mode.c à coté des autres fonctions , dans ce que j\92appelle le tableau des modes:<p>
+ {"fadeplot", init_fadeplot, draw_fadeplot, release_fadeplot,
+ refresh_fadeplot, init_fadeplot, NULL, &blank_opts, 17000, 1, 20, 1.0,
+  "fadeplot", 0, NULL},<p>
+
+On passe ensuite à l\92implémentation des fonctions proprement dit dans un fichier que l\92on appellera fadeplot.c.<p>
+Il est évident qu\92il faudra modifier le Makefile ( Pour cela je vous laisse faire :).<p>
+Dans ces fonctions, à partir de la structure ModeInfo ( mode.h ) , on va obtenir des informations sur l\92écran qui sont indispensables pour la suite.<p>
+
+<TABLE Border=1>
+<CAPTION><B>fonction</B></CAPTION>
+<TR><TD>MI_WIDTH(mi) et MI_HEIGHT(mi)</TD>     <TD>vont nous donné la taille de l\92écran</TD></TR>.
+<TR><TD>Display    *display    = MI_DISPLAY(mi);</TD>  <TD>délivre le display</TD></TR>
+<TR>   <TD>             MI_SCREEN      </TD>   <TD>délivre le screen</TD></TR>
+<TR><TD>Window      window = MI_WINDOW(mi)</TD>;       <TD>délivre l\92identificateur de la fenêtre</TD></TR>
+<TR><TD>GC          gc               = MI_GC(mi);</TD> <TD>donne le graphics context courant</TD></TR>
+<TR>           <TD>MI_DELAY</TD>               <TD>    donne le delai (microsec.) entre callbacks</TD></TR>
+<TR>        <TD>MI_CMAP</TD>           <TD>donne la table des couleurs</TD></TR>
+<TR><TD>XSetForeground(display, gc, MI_BLACK_PIXEL(mi));</TD>  <TD>Mettre la couleur du tracé en noir</TD></TR>
+<TR><TD>XSetForeground(display, gc, MI_WHITE_PIXEL(mi));</TD> <TD>Mettre la couleur du tracé en blanc</TD></TR>
+<TR><TD>MI_IS_ICONIC(mi)       </TD>   <TD>permet de savoir si on est passé en phase password. </TD></TR>
+</TABLE>
+
+<TABLE Border=1>
+<CAPTION><B>variable</B></CAPTION>
+<TR><TD>MI_IS_MONO     </TD>           <TD>l\92ecran est monochrome</TD></TR>
+<TR><TD>MI_IS_INWINDOW</TD>            <TD>le mode s\92affiche dans un fenetre reguliere</TD></TR>
+<TR><TD>MI_IS_INROOT   </TD>           <TD>le mode s\92affiche sur la root windows</TD></TR>
+<TR><TD>NUMCOLORS</TD>                 <TD>Donne le nombre de couleur</TD></TR>
+</TABLE>
+
+
+Oubliez pas après avoir dessiné l\92ensemble de faire Xflush(display), ce qui permettra d\92afficher réellement votre graphisme sur l\92écran.
+La création d\92un nouveau mode s\92éffectue souvent en récupérant le squelette d\92un autre et de le modifier à sa volonté.
+N\92hésitez pas a à regarder le code des autres modes, c\92est souvent trés instructifs.
+<HR>
+<H2>Perspective:</H2>
+Dernierement on peut utiliser la librairie mesa (la libraire OpenGL de silicon GNU) dans xlock, quelqu\92un s\92est propose de faire le screen-saver tube de Win NT.
+Je pense qu\92il serait interressant de joindre a xlock un langage simple ( genre logo un peu plus evolue).
+<HR>
+<H2>Reference: </H2>
+HACKERS.GUIDE qui se trouve dans le repertoire docs ( j\92ai essaye de le traduire :)<p>
+           X_Window programmation avec les Xt-Intrinsics Douglas A YOUNG MASSON PARIS.<p>
+<HR>
+Voila j\92espere que vous prendrez plaisir a ajouter des nouveaux modes à xlock; c\92est une maniere de programmer facilement des graphismes sous X11. Un petit conseil le mainteneur de xlock est un fan de casse tête et compagnie.
+Bon Xlock.
+<p>
+Charles VIDAL: vidalc@club-internet.fr<p>
+mode flag, fadeplot, bubble<p>
+createur de xmxlock : GUI launcher de xlockmore.<p>
+
+</BODY>
+</HTML>
diff --git a/docs/Purify b/docs/Purify
new file mode 100644 (file)
index 0000000..43bcdbb
--- /dev/null
@@ -0,0 +1,31 @@
+Summary of problems detected using Purify
+-----------------------------------------
+Purify problems are marked in code comments with "PURIFY" keyword
+
+Mode      Problem
+--------  -------------------------------------------------------------------
+bat       Possible 15985 byte memory leak from XPutImage.
+cartoon   Possible 29756 byte memory leak from XPutImage.
+flag      Sometimes have thousands of Array Bounds Reads and Free Memory Reads
+          on XGetPixel call when image loaded is small.
+life      Possible 132 byte memory leak from XPutImage
+star      Possible 3264 byte memory leak detected only on SunOS 4.1.X
+swirl     Possible 256 byte memory leak from XPutImage
+tetris    Possible 120 byte memory leak from XPutImage
+text3d    (unstable mode) Array Bounds Reads and Writes
+
+There are also some Uninitialized Memory Reads that appear to be internal
+to X11.
+
+There are also some memory leaks detected in these source code files:
+xlock/iostuff.c xlock/resource.c xlock/spline.c xmlock/option.c
+
+MesaGL 2.3 fixes many cumulative leaks and uninitialized memory reads that
+existed in MesaGL 2.2 and earlier MesaGL releases.  This affected all GL modes.
+MesaGL 2.3 or newer is recommended since it fixes these memory leaks and runs
+faster.  Cumulative means that the memory leaks occur each time the mode is run
+when in random mode, which is why after some time it may crash xlock since it
+runs out of available memory.
+
+---
+Thanks to Tom Schmidt (tschmidt@micron.com) for the Purify logs.
diff --git a/docs/Purify.sunos4 b/docs/Purify.sunos4
new file mode 100644 (file)
index 0000000..69ce8ae
--- /dev/null
@@ -0,0 +1,219 @@
+****  Purify instrumented xlock/xlock (pid 23512 at Thu Aug 10 17:07:33 2000)
+  * Purify 4.5.1 SunOS 4.1, Copyright (C) 1992-1999 Rational Software Corp. All rights reserved. 
+  * For contact information type: "purify -help"
+  * For TTY output, use the option "-windows=no"
+  * Command-line: xlock/xlock -sequential -verbose -modelist all
+  * Options settings: -chain-length=25 -windows=yes -g++=yes -purify \
+    -collector=/usr/bin/ld -purify-home=/opt/pure/purify-4.5.1-sunos4 
+
+****  Purify instrumented xlock/xlock (pid 23512)  ****
+Current file descriptors in use: 8
+FIU: file descriptor 0: <stdin>
+FIU: file descriptor 1: <stdout>
+FIU: file descriptor 2: <stderr>
+FIU: file descriptor 3: <unnamed socket>, O_RDWR
+   * This file descriptor was allocated from:
+       socket         [rtlib.o]
+       MakeUNIXSocketConnection [libX11.so.4.10]
+       _XConnectDisplay [libX11.so.4.10]
+       XOpenDisplay   [libX11.so.4.10]
+       openDisplay    [resource.c:1429]
+       getResources   [resource.c:1792]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+FIU: file descriptor 4: "/usr/local/xlock.staff", O_RDONLY
+   * File info: -rw-r--r--  1 root     staff           20 Oct 13  1998
+   * File position: 20
+   * This file descriptor was allocated from:
+       open           [rtlib.o]
+       _endopen       [libc.so.1.9]
+       fopen          [libc.so.1.9]
+       my_fopen       [iostuff.c:59]
+       fullLock       [logout.c:500]
+       getResources   [resource.c:1990]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+FIU: file descriptor 5: <unnamed socket>, O_RDWR
+   * This file descriptor was allocated from:
+       socket         [rtlib.o]
+       clntudp_bufcreate [libc.so.1.9]
+       load_dom_binding [libc.so.1.9]
+       _yp_dobind_soft [libc.so.1.9]
+       _yp_dobind     [libc.so.1.9]
+       yp_match       [libc.so.1.9]
+       getnamefromyellow [libc.so.1.9]
+       matchuid       [libc.so.1.9]
+       getpwuid       [libc.so.1.9]
+       fullLock       [logout.c:491]
+       getResources   [resource.c:1990]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+FIU: file descriptor 26: <reserved for Purify internal use>
+FIU: file descriptor 27: <reserved for Purify internal use>
+
+****  Purify instrumented xlock/xlock (pid 23512)  ****
+Purify: Searching for all memory leaks...
+
+Memory leaked: 209 bytes (0.00308%); potentially leaked: 0 bytes (0%)
+
+MLK: 32 bytes leaked in 2 blocks
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+  * Block of 16 bytes (2 times); last block at 0x6aeef8
+
+MLK: 26 bytes leaked at 0x6b5b60
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       GetResource    [resource.c:1201]
+       getResources   [resource.c:1946]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 24 bytes leaked at 0x6af058
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 16 bytes leaked at 0x676aa8
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _XlcDupLocale  [libX11.so.4.10]
+       _XrmInitParseInfo [libX11.so.4.10]
+       NewDatabase    [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XlockrmParseCommand [parsecmd.c:195]
+       getResources   [resource.c:1844]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 16 bytes leaked at 0x674fe8
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _XlcDupLocale  [libX11.so.4.10]
+       _XrmInitParseInfo [libX11.so.4.10]
+       NewDatabase    [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1818]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 16 bytes leaked at 0x682650
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _XlcDupLocale  [libX11.so.4.10]
+       _XrmInitParseInfo [libX11.so.4.10]
+       NewDatabase    [libX11.so.4.10]
+       XrmGetStringDatabase [libX11.so.4.10]
+       getServerResources [resource.c:1606]
+       getResources   [resource.c:1794]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 16 bytes leaked at 0x696470
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _XlcDupLocale  [libX11.so.4.10]
+       _XrmInitParseInfo [libX11.so.4.10]
+       NewDatabase    [libX11.so.4.10]
+       XrmGetFileDatabase [libX11.so.4.10]
+       parsefilepath  [resource.c:1330]
+       getAppResources [resource.c:1677]
+       getResources   [resource.c:1791]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 16 bytes leaked at 0x6aece8
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _XlcDupLocale  [libX11.so.4.10]
+       _XrmInitParseInfo [libX11.so.4.10]
+       NewDatabase    [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 16 bytes leaked at 0x6aed98
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 15 bytes leaked at 0x6aefa8
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 12 bytes leaked at 0x66de58
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       NewDatabase    [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+MLK: 4 bytes leaked at 0x67bc20
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [libX11.so.4.10]
+       XrmQPutStringResource [libX11.so.4.10]
+       XrmParseCommand [libX11.so.4.10]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       start          [crt0.o]
+
+Purify Heap Analysis (combining suppressed and unsuppressed blocks)
+                         Blocks        Bytes
+              Leaked         14          221
+  Potentially Leaked          0            0
+              In-Use        380      6786713
+  ----------------------------------------
+     Total Allocated        394      6786934
+
+****  Purify instrumented xlock/xlock (pid 23512)  ****
+  * Program exited with status code 0.
+  * 0 access errors, 0 total occurrences.
+  * 209 bytes leaked.
+  * 0 bytes potentially leaked.
+  * Basic memory usage (including Purify overhead):
+    6012288 code
+    668912 data/bss
+    18252032 heap (peak use)
+    1904 stack
+  * Shared library memory usage (including Purify overhead):
+    688128 libX11_pure_p3_c0_451_413_U1V.so.4.10 (shared code)
+    49152 libX11_pure_p3_c0_451_413_U1V.so.4.10 (private data)
+    49152 libXext_pure_p3_c0_451_413_U1V.so.4.10 (shared code)
+    8192 libXext_pure_p3_c0_451_413_U1V.so.4.10 (private data)
+    696320 libc_pure_p3_c0_451_413_U1V.so.1.9 (shared code)
+    16384 libc_pure_p3_c0_451_413_U1V.so.1.9 (private data)
+    8192 libdl.so.1.0 (shared code)
+    8192 libdl.so.1.0 (private data)
+    8192 libinternal_stubs.so.1.0 (shared code)
+    8192 libinternal_stubs.so.1.0 (private data)
+  * Memory mapped usage:
+    4096 mmap'd at 0xef0f1000
diff --git a/docs/Purify.sunos5 b/docs/Purify.sunos5
new file mode 100644 (file)
index 0000000..9dcde21
--- /dev/null
@@ -0,0 +1,261 @@
+****  Purify instrumented xlock/xlock (pid 4834 at Wed Aug  9 17:07:56 2000)
+  * Purify 5.1 Solaris 2 (32-bit), Copyright (C) 1992-2000 Rational Software Corp. All rights reserved. 
+  * For contact information type: "purify -help"
+  * For TTY output, use the option "-windows=no"
+  * Command-line: xlock/xlock -sequential -verbose -modelist all
+  * Options settings: -chain-length=25 -windows=yes -g++=yes -purify \
+    -purify-home=/opt/pure/purify-5.1-solaris2 -threads=yes \
+    -use-internal-locks=yes -thread_stack_change=0x4000 -mt_safe_malloc=yes 
+  * Command-line: xlock/xlock -sequential -verbose -modelist all
+
+****  Purify instrumented xlock/xlock (pid 4834)  ****
+Current file descriptors in use: 8
+FIU: file descriptor 0: <stdin>
+FIU: file descriptor 1: <stdout>
+FIU: file descriptor 2: <stderr>
+FIU: file descriptor 3: "/tmp/.X11-pipe/X0", O_RDWR
+   * File info: prw-rw-rw-  1 root     root             0 Jun 16 16:09
+   * This file descriptor was allocated from:
+       _open          [libc.so.1]
+       open           [libc.so.1]
+       _X11TransSocketPIPEConnect [x11trans.c]
+       _X11TransConnect [x11trans.c]
+       _X11TransConnectDisplay [ConnDis.c]
+       XOpenDisplay   [OpenDis.c]
+       openDisplay    [resource.c:1429]
+       getResources   [resource.c:1792]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+FIU: file descriptor 4: "/etc/.name_service_door", O_RDONLY
+   * File info: ?r--r--r--  1 root     root             0 Jun 11  1999
+   * This file descriptor was allocated from:
+       _open64        [libc.so.1]
+       _nsc_trydoorcall [libc.so.1]
+       getpwuid_r     [libc.so.1]
+       fullLock       [logout.c:491]
+       getResources   [resource.c:1990]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+FIU: file descriptor 5: "/usr/local/xlock.staff", O_RDONLY
+   * File info: -rw-r--r--  1 root     other           20 Oct 13  1998
+   * File position: 20
+   * This file descriptor was allocated from:
+       _open          [libc.so.1]
+       _endopen       [libc.so.1]
+       fopen          [libc.so.1]
+       my_fopen       [iostuff.c:59]
+       fullLock       [logout.c:500]
+       getResources   [resource.c:1990]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+FIU: file descriptor 26: <reserved for Purify internal use>
+FIU: file descriptor 27: <reserved for Purify internal use>
+
+****  Purify instrumented xlock/xlock (pid 4834)  ****
+Purify: Searching for all memory leaks...
+
+Memory leaked: 3241 bytes (0.0319%); potentially leaked: 0 bytes (0%)
+
+MLK: 1024 bytes leaked at 0x6b3120
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _nss_compat_XY_all [nss_compat.so.1]
+       nss_search     [libc.so.1]
+       getspnam_r     [libc.so.1]
+       getCryptedRootPasswd [passwd.c:923]
+       initPasswd     [passwd.c:1947]
+       main           [xlock.c:2933]
+       _start         [crt1.o]
+
+MLK: 1024 bytes leaked at 0x6b4040
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _nss_compat_XY_all [nss_compat.so.1]
+       nss_search     [libc.so.1]
+       getspnam_r     [libc.so.1]
+       my_passwd_entry [passwd.c:407]
+       getCryptedUserPasswd [passwd.c:766]
+       initPasswd     [passwd.c:1939]
+       main           [xlock.c:2933]
+       _start         [crt1.o]
+
+MLK: 1024 bytes leaked at 0x6ddd90
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _nss_compat_XY_all [nss_compat.so.1]
+       nss_search     [libc.so.1]
+       getspnam_r     [libc.so.1]
+       my_passwd_entry [passwd.c:407]
+       getUserName    [passwd.c:531]
+       initPasswd     [passwd.c:1924]
+       main           [xlock.c:2933]
+       _start         [crt1.o]
+
+MLK: 32 bytes leaked in 2 blocks
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+  * Block of 16 bytes (2 times); last block at 0x6c5fb8
+
+MLK: 26 bytes leaked at 0x7054b0
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       GetResource    [resource.c:1201]
+       getResources   [resource.c:1946]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 24 bytes leaked at 0x6c61c0
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 20 bytes leaked at 0x6bfe50
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       create_conv    [lcDefConv.c]
+       _XlcOpenConverter [lcConv.c]
+       _XrmDefaultInitParseInfo [lcRM.c]
+       NewDatabase    [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 16 bytes leaked at 0x6bff08
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 16 bytes leaked at 0x6bffc8
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       NewDatabase    [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 15 bytes leaked at 0x6c6110
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 8 bytes leaked at 0x6c3170
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       create_conv    [lcDefConv.c]
+       _XlcOpenConverter [lcConv.c]
+       _XrmDefaultInitParseInfo [lcRM.c]
+       NewDatabase    [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 8 bytes leaked at 0x6e2cb0
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       _XrmDefaultInitParseInfo [lcRM.c]
+       NewDatabase    [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+MLK: 4 bytes leaked at 0x6c6068
+  * This memory was allocated from:
+       malloc         [rtlib.o]
+       PutEntry       [Xrm.c]
+       XrmQPutStringResource [Xrm.c]
+       XrmParseCommand [ParseCmd.c]
+       getResources   [resource.c:1860]
+       main           [xlock.c:2918]
+       _start         [crt1.o]
+
+Purify Heap Analysis (combining suppressed and unsuppressed blocks)
+                         Blocks        Bytes
+              Leaked         23         3241
+  Potentially Leaked          1         8200
+              In-Use       6212     10140895
+  ----------------------------------------
+     Total Allocated       6236     10152336
+
+****  Purify instrumented xlock/xlock (pid 4834)  ****
+Thread Summary : 1 threads in existence
+  * Thread 0 [main thread]
+     Stack: (0xefffe048 0xf0000000), size = 0x1fb8
+
+****  Purify instrumented xlock/xlock (pid 4834)  ****
+  * Program exited with status code 0.
+  * 1 access error, 654 total occurrences.
+  * 3241 bytes leaked.
+  * 0 bytes potentially leaked.
+  * Basic memory usage (including Purify overhead):
+    6205148 code
+    672992 data/bss
+    22593540 heap (peak use)
+    6856 stack
+  * Shared library memory usage (including Purify overhead):
+    1456 libpure_solaris2_init.so.1 (shared code)
+    252 libpure_solaris2_init.so.1 (private data)
+    51619 libSM.so.6_pure_p3_c0_510_56_32 (shared code)
+    3584 libSM.so.6_pure_p3_c0_510_56_32 (private data)
+    114154 libICE.so.6_pure_p3_c0_510_56_32 (shared code)
+    12152 libICE.so.6_pure_p3_c0_510_56_32 (private data)
+    41726 libsocket.so.1_pure_p3_c0_510_56_32 (shared code)
+    3316 libsocket.so.1_pure_p3_c0_510_56_32 (private data)
+    736310 libnsl.so.1_pure_p3_c0_510_56_32 (shared code)
+    114968 libnsl.so.1_pure_p3_c0_510_56_32 (private data)
+    560976 libDtSvc.so.1_pure_p3_c0_510_56_32 (shared code)
+    22520 libDtSvc.so.1_pure_p3_c0_510_56_32 (private data)
+    2048 solaris2_threads.so_pure_p3_c0_510_56_32 (shared code)
+    8544 solaris2_threads.so_pure_p3_c0_510_56_32 (private data)
+    25835 libposix4.so.1_pure_p3_c0_510_56_32 (shared code)
+    1820 libposix4.so.1_pure_p3_c0_510_56_32 (private data)
+    844434 libX11.so.4_pure_p3_c0_510_56_32 (shared code)
+    59356 libX11.so.4_pure_p3_c0_510_56_32 (private data)
+    135413 libXext.so.0_pure_p3_c0_510_56_32 (shared code)
+    2564 libXext.so.0_pure_p3_c0_510_56_32 (private data)
+    140125 libm.so.1_pure_p3_c0_510_56_32 (shared code)
+    1332 libm.so.1_pure_p3_c0_510_56_32 (private data)
+    964709 libc.so.1_pure_p3_c0_510_56_32 (shared code)
+    31024 libc.so.1_pure_p3_c0_510_56_32 (private data)
+    2040 libdl.so.1_pure_p3_c0_510_56_32 (shared code)
+    4 libdl.so.1_pure_p3_c0_510_56_32 (private data)
+    13528 libinternal_stubs.so.1 (shared code)
+    916 libinternal_stubs.so.1 (private data)
+    16264 libmp.so.2_pure_p3_c0_510_56_32 (shared code)
+    836 libmp.so.2_pure_p3_c0_510_56_32 (private data)
+    658534 libtt.so.2_pure_p3_c0_510_56_32 (shared code)
+    47160 libtt.so.2_pure_p3_c0_510_56_32 (private data)
+    2594362 libXm.so.3_pure_p3_c0_510_56_32 (shared code)
+    182028 libXm.so.3_pure_p3_c0_510_56_32 (private data)
+    587610 libXt.so.4_pure_p3_c0_510_56_32 (shared code)
+    24908 libXt.so.4_pure_p3_c0_510_56_32 (private data)
+    35802 libaio.so.1_pure_p3_c0_510_56_32 (shared code)
+    6404 libaio.so.1_pure_p3_c0_510_56_32 (private data)
diff --git a/docs/Revisions b/docs/Revisions
new file mode 100644 (file)
index 0000000..43727d4
--- /dev/null
@@ -0,0 +1,2216 @@
+xlockmore-5.01.1 as of 25 May 2001, the maintained version of xlock
+Adapted from Patrick J. Naughton's original xlock
+
+Primary site: ftp://ftp.tux.org/pub/tux/bagleyd/xlockmore
+Secondary site: ftp://ftp.x.org/contrib/applications
+Web page: http://www.tux.org/~bagleyd/xlockmore.html
+Maintainer: David A. Bagley <bagleyd@tux.org>
+
+Mailman lists: http://www.tux.org/mailman/listinfo
+If you are interested in contributing to XLock development and/or maintenance
+or just want to be notified when the latest stable version comes out.
+
+    choices                 brief description
+    -------                 -----------------
+    xlock-announce          Xlock beta and production announcements
+    xlock-develop           Xlock alpha ("daily") release announcements
+    xlock-discuss           Xlock/Xlockmore development discussion
+
+Please send all bug reports to bagleyd@tux.org .
+Alpha versions may be available through web page or ftp site.
+Adapted from Patrick J. Naughton's original xlock, with lots of help
+ from others.
+
+BUGS to fix and other stuff to do see docs/TODO.
+
+5.01.1
+  Missed a patch to config.h.in for Red Hat 7.1... thanks again to
+    Tim Aukland <tda10@Procket.com>.
+  New "tetris -well", now uses generated images, also cleaned up some
+    bugs too.  Bug fix thanks to Tom Schmidt.
+  New molecule to solve a random SEGV on Sun thanks to Tom Schmidt
+    <tschmidt@micron.com> (it still crashes on my Sun with OpenGL but
+    I think its an isolated case).  Also cleaned up a few mistakes in the
+    menus and resource file.
+  OSF1_ENH_SEC passwd updated to handle passwords with more than eight
+    characters using dispcrypt, thanks to Steve VanDevender
+    <stevev@hexadecimal.uoregon.edu>.
+  molecule fix in sscanf thanks to Jouk Jansen.
+  scooter updated thanks to Sven Thoennissen <posse@gmx.net>.
+  Got rid of of some -Wall, lint, and C++ warnings (mostly the new 5.01 modes).
+    ecgs g++ warnings removed from solitare and all glx modes, regular modes
+    left for later (casting NULL).
+  Fixed generated xlock.hlp.
+  gears added -size but defaults to 0, only -planetary will use up lots of
+    CPU so added a -planetsize 400 which takes over if size is 0 (full screen
+    if both are 0).
+
+5.01
+  molecule, glplanet, and sierpinski3d modes converted from xscreensaver
+    thanks to Rolf Groppe <rolf@groppe.de>. 
+    VMS changes for gl modes thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+    Updates to molecule thanks to Rolf Groppe and Tom Schmidt.
+  Forte cpp changes for polyominoes.c, tetris.c, and scooter.c
+    (mostly just casting malloc).
+  "Kick me out" statement is removed since XLock.logoutButtonHelp is probably
+    more descriptive.  Thanks to Tom Schmidt.
+  Workaround for possible crashing when xautolock calls xlock when its
+    already running on Linux.  etc/xlock1.sh thanks to Chima Njaka
+    <dream@linkline.com>.  [Have not observed this on my Sun. DAB]
+  texture for atlantis from xscreensaver-3.32 thanks to Eric Lassauge.
+    <lassauge@mail.dotcom.fr>.
+  showfps with some MESA causes problems.  configure changes thanks to
+    Tom Schmidt.
+  scooter mode added: thanks to Sven Thoennissen <posse@gmx.net>.
+    Sort of like star mode... also took out space from "unstable" and
+    may in the future combine them both into star mode.
+  kerberos patch from Marc Mengel <mengel@fnal.gov>.  It no longer rewrites
+    the ticket cache with a ticket which may have several options turned off,
+    when they were turned on before you locked the screen.
+  DPMS patch thanks to Maorong Zou <mzou@mail.ma.utexas.edu>.  xlock will
+    not burn up cpu when screen is blank.
+  tetris and dragon leak fixed thanks to Tom Schmidt.
+    Memory read fix in tetris thanks to Tom Schmidt.
+  dragon mode added.  Just one of Oskar van Deventer's ingenius mazes.
+  juggle mode: probablility of adding another ball when juggling 2 balls
+    was increased.
+  loop mode: Added some flaws, random blue wall spots, to "liven" it up.
+  tetris fixes for -well :  1. clearing of multiple rows;
+    2. invisible squares when folded on a corner;
+    3. Frozen walls are now white.
+  xmlock update thanks to Charles Vidal <vidalc@club-internet.fr>, now with
+    a task bar and more toggles.
+  -showfps, moebius, and gears updates thanks to Eric Lassauge
+    <lassauge@mail.dotcom.fr> and Jamie Zawinski <jwz@jwz.org>.
+  polyominoes memory leaks and array bounds problems fixed thanks to
+    Tom Schmidt <tschmidt@micron.com>.
+  nice was causing a stalling problem renice stuff removed thanks to
+    Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp>
+  plain bitmap added for polyominoes and tetris
+  polyominoes mode algorithm improved thanks to Stephen Montgomery-Smith
+    <stephen@math.missouri.edu>.  Name changed from pentominoes to
+    polyominoes.  New with lots of puzzles (-identical) most of which take
+    a while and some one sided and combination puzzles.
+    Added -cycles (default 8192) if set to 0 will try to solve puzzle forever
+    Changed some wait and delay stuff.  Will now try to display a small puzzle
+    if a large one does not fit at all (usually in the password window).
+    25 by 22 elevenomino now takes advantage of 180 symmetry.  180 symmetry
+    now have their colors cooridinated.
+  RedHat configure changes thanks to Tim Auckland <Tim.Auckland@Procket.com>.
+  juggle spin now tracks with -count
+  xcl fixes thanks to Martin Berentsen <berentsen@sent5.uni-duisburg.de>.
+  text3d fixes to get it to work on my Linux box.  Seems to generate wacky
+    file names if there is more than one font in the font directory somewhere
+    in iostuff.c.
+  SGI fixes thanks to Ed Mackey <emackey@early.com> needs /usr/lib32 in path
+    and must #undef offsetof .
+  Dynamic linking (Modules) working again (broken in 5.00).  Also Makefiles
+    now handle multi-file modes.
+  fire and text3d updates from Eric Lassauge <lassauge@mail.dotcom.fr>
+    fire with -count 0 shows rain.
+  sco changes to configure MAY have caused problems in slackware starting
+    in 4.17.  Backed out the changes and put in a special case for sco.
+    where XGetScreenSaver is moved before GrabKeyboardAndMouse
+  Fixed cases for -allowroot if root has a null password or does not have
+    a password thanks to Stefan `Sec` Zehl <sec@yoda.fwe.pi.musin.de>.
+    Also fixed BSD_AUTH & ultrix in a similar way but not tested.
+    (Should VMS have this too?  I know its unlikely for a couple of reasons.)
+  galaxy -fisheye lens option thanks to Richard Loftin <rich@sevenravens.com>.
+  xlock allocation updates (color.c, iostuff.c) and text3d updates
+    (not complete).  Should there be a standard spot for the text3d font
+    similar to the sound directory?.  Ideas welcome.
+  commented out #define MODE_dclock_millennium from mode.h in the 3rd
+    millennium.
+  wator.c an alloc check added.
+  tetris now has the newer bitmaps taken from pentominoes mode.
+
+5.00
+  Just about all modes are now updated.  Numerous bug fixes added.
+    Modes modified for safer allocating.  Part of fix to security flaw.
+    xlock was broken by using up all the virtual memory.
+    xlockdir may need more work.  Multiscreen fixes added.
+    text3d, an unstable C++ mode, needs more work, for the calls to "new".
+    Tom Schmidt & Jouk Jansen caught numerous goofs.
+  Assorted fixes when doing above like "discrete -mono", and lyapunov &
+    mandelbrot now sometimes draw from the right side.  tube, lyapunov, and
+    mandelbrot now go through colormap changes forward and backward.
+  XFreeColors bug fix in colors.c thanks to Ian Collier
+    <Ian.Collier@comlab.ox.ac.uk>.
+  Enhanced xlock/util.c for SunOS 4.1.X and others that needed the
+    matherr() function defined.  Now handles acos() and asin() DOMAIN
+    error messages. Thanks to Tom Schmidt <tschmidt@micron.com>.
+  SunOS 4.1.3_U1 did not have CLOCKS_PER_SEC defined.  Thanks to Tom Schmidt
+    <tschmidt@micron.com>.
+  pentomino mode added by Stephen Montgomery-Smith
+    <stephen@math.missouri.edu>... it includes a scalable 3d look.
+    tetris mode now uses and older version of this scalable 3d look as well.
+  fire, sballs, lament and atlantis updates by Eric Lassauge.
+  SIA passwording for Tru64 help thanks to Octave Orgeron <octave@sun.com>.
+  ImageMagick stuff added by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+    Setup to go only for VMS.
+  SunC++ (Forte 6 U1) compatiblity changes.
+  sball mode... new GL mode, converted by Eric Lassauge.
+  euler2d new mode option, eulerpower Added optimizations, rotation
+    of region to maximize screen fill, and new algorithm for solving
+    diff equation makes it twice as fast thanks to Stephen
+    Montgomery-Smith <stephen@math.missouri.edu>.
+  bubble3d, invert release fix
+  fire mode... new GL mode converted by Eric Lassauge
+    <lassauge@mail.dotcom.fr>.  Also had a few other mods including a
+    solitare and new l-* icons in pixmaps.  Tom Schmidt
+    <tschmidt@micron.com> added a -size option similar to sproingies for fire.
+  lint cleanups
+  cartoon and raster image removed, bat and bounce modes modified to do
+    some of what it used to but not all...
+  e-sound can now be turned off thanks to Mark Davies
+  life patterns more random
+  VMS edits thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  Dpms lib changes for configure for Solaris 8 and XFree86 4.0 (latter not
+    tested).  Also added a new Solaris xpm.
+  kaleid: new spiral and spots options thanks Robert Adam, II
+    <raii@comm.net> (spiral looks best like:
+    xlock -mode kaleid -spiral -alternate -size 20 -count 5  ).
+  Configure update for Mesa thanks to Tom Schmidt <tschmidt@micron.com>.
+  closedown patch thanks to Bernd 'Bing' Leibing
+    <bernd.leibing@rz.uni-ulm.de>.
+  vtlock patches Eric Lassauge <lassauge@mail.dotcom.fr>.
+  Configure update for X11R6.4 and X11R6.5.1.
+  Display error should be printed if SYSLOG defined thanks to Alexander
+    Elgert <elgert@rbg.informatik.tu-darmstadt.de>.
+  xlock -resources crash fixed on Solaris thanks to Alexander Elgert
+    <elgert@rbg.informatik.tu-darmstadt.de>.
+  coredump fix for GL modes cage, moebius, rubik, skewb, and stairs
+    and Mesa3.1 thanks to Tom Schmidt <tschmidt@micron.com>.
+  solitare.cc update for disable-interactive.
+  xlock -resources crash fixed on Solaris thanks to Alexander Elgert
+    <elgert@rbg.informatik.tu-darmstadt.de>.
+  Security Focus found a security bug with display name passing "%d" as the
+    display name.  Thanks to Jeremy Buhler <jbuhler@cs.washington.edu> for
+    the xlockmore patch.
+  Environment configuration (--disable-interactive) logic was corrected
+    (default was ok but you had to --enable-interactive to disable) thanks
+    to Tom Schmidt <tschmidt@micron.com>.
+  Man page changes.
+
+4.17
+  euler2d, new mode thanks to Stephen Montgomery-Smith
+    <stephen@math.missouri.edu> also some work was done by Tim Auckland
+    <Tim.Auckland@Procket.com>.  See euler2d.tex for theory.
+  XSync(dsp, True) should not be used in modes as it is hard to log in
+    when input password characters are randomly dropped.
+  tetris, you can now play with -trackmouse, row clearing fixed, bonus
+    pieces.  Added a new look to pieces but must be compiled in with
+    -DBM_PLAIN.
+  Purify Uninitialized Memory Read found in euler2d, life, and swarm and
+   a memory leak in juggle.  SunOS fix for xcl and juggle and gameless
+   environment configuration (--disable-interactive) thanks to Tom Schmidt
+   <tschmidt@micron.com>.
+  bounce, bat, pacman, and braid should look better for password sized
+    windows
+  xcl, new mode control-line combat model race, conversion from xscreensaver
+    thanks to its author Martin Berentsen <berentsen@sent5.uni-duisburg.de>.
+  multi-byte character support for languages like Japanese.  Fixed for
+    bomb.c, nose.c, dclock.c, xlock.c, resource.c, iostuff.c,
+    xmlock.c, and xglock.c.  Also added new xmlock/XmLock-jp.ad.
+    Thanks to Yokota Hiroshi <yokota@netlab.is.tsukuba.ac.jp>.
+    Maintainer (David Bagley) is a little confused about gettext and
+    settext stuff.
+  swarm improvements thanks to Juan Heguiabehere <juanh@wins.uva.nl>.
+    Now do not fly at 45 degree angles most of the time and longer trails
+    with -size.  Noticed some drawing errors on some Sun displays with
+    long trails, probably a Sun hardware problem.
+  added BLANK_ONLY #define if you only want the blank mode.
+  VMS patch for sound thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  sco patch from Ronald Joe Record <rr@sco.com>.  Did not take the patches
+    straight so there could be some problems still, but tried to address
+    the issues.  (etc/play.sh, spline.cc sqr, t3d.c time inc, and sysv5
+    build issues).
+  configure should now find Mesa as opengl.  Worked before
+    for me... but may work for others now too.
+  Minor warnings removed various files.
+  loop.c now loops can go clockwise too.  The program decides which set of
+    rules to use. (Is handedness a requirement for life? (DNA for example
+    has right-handed helices.))  Added some debugging for building rules
+    easier, hexagonal life more fleshed out so RAND_RULES will work until
+    about generation 540.
+  ESound updates by Eric Lassauge <lassauge@mail.dotcom.fr>.
+  juggle.c: fix bug which caused crashes on some machines, less flashy arms,
+    real-time, -pattern random (a true pattern generator), figure moved down
+    and scaled, bouncing, more random, one ball juggling should not come
+    up, and Sun CC 5.0 errors/warnings removed thanks to Tim Auckland
+    <Tim.Auckland@Procket.com>.
+  HP problems identified for life.c and shape.c, no code changes since it
+    seems to be a strange bug in the HP cc compiler when using both -O and
+    -g flags (default).  HP CC warnings removed in solitare.cc, xlock.c,
+    resource.c, dclock.c, decay.c, goop.c, ico.c, juggle.c, starfish.c,
+    t3d.c, tetris.c, erase*.*.  Updated configure and README for compiling
+    and linking through HP's cc.  Still some open problems.
+  Some arbitrary sized arrays removed in xlock.c, resource.c, and mode.c,
+    do not believe them to be security problems.
+  HP_PASSWDETC - due to possible security problems this will no longer
+    compile by default, pointed out by Theo de Raadt
+    <deraadt@cvs.openbsd.org>.
+  Sun CC 5.0 warnings changes cover all modes with options.
+  skewb mode added as an unstable GL mode.  Its in development.  Not much
+    yet... I just have the corners drawn so far and no real movement yet.
+    Its like a Rubik's Cube but with diagonal cuts that cut through the
+    the center of the cube on a skewed angle.
+  Buffer overrun security fix does not allow root access directly but the
+    encrypted password file may be found in memory.  This vulnerability was
+    discovered by Brock Tellier with additional research by Anthony Osborne
+    at the COVERT Labs of PGP Security, Inc.  Now allocate memory instead
+    of an arbitrary limit on mode name length.
+  run mode added, its a hack but it sort of works.  :)
+    Also changed resource.c to make a special case for it.
+    would be nice if password window worked too...
+    Will probably crash and burn on multiscreens, random mode, etc.
+    run like:
+    xlock -mode run -geometrystring geometry -runprogram xclock
+    xlock -mode run -geometrystring g -runprogram xlogo
+    xlock -mode run -geometrystring none -runprogram xfishtank
+    (May be having a little problem with the none option...)
+    _NOT_ a good idea to recursively run xlock
+    Not fond of the name of the mode or its option names... so if you
+    have better names in mind ... tell me.
+    Moved to unstable (due to VMS and -debug problems).
+  ico.c most flashing removed.  FullRandom added and now rotates more
+    randomly, rotates in the proper direction (looking at it from the top,
+    I guess its wrong if you think it should be on a glass table and the
+    view is underneath...) and changes when it hits the end of the screen.
+    Linewidth and "points" added as well.
+  rubik.c update for stickers and cube roundness variables now set in macro,
+    keeping it in sync with skewb.c .
+  xlock.c, swirl.c, color.c, logout.c, random.c updates to use less calls
+    to ScreenCount or ScreenOfDisplay, looking into supporting Xinerama
+    (keep each screen independent (see TODO)) and feel these calls would
+    cause problems.
+  XFree86 4.0 fixes for DPMS and XCloseDisplay thanks to Jeremy Buhler
+    <jbuhler@cs.washington.edu>.  Call to XCloseDisplay was causing
+    problems, removing it should not, right?  More fixes for DPMS, this time
+    for NetBSD.  Thanks to <hubert.feyrer@rz.uni-regensburg.de>
+  solitare.cc Solaris CC warnings removed and fixed shapes when in
+    password window.
+  xalock removed from distribution
+
+4.16
+  ico.c added double buffering to face drawings.  Run like -faces since the
+    default is off (still kind of flashy and added late).  Also removed
+    pyramid (drawing errors, count = 7) and plane (boring, count = 6) from
+    showing up randomly.
+  ant.c noticed triangular ants were wrong, reverted some of the code back
+    to 4.14.  Also made ants with neighbors > 6 more rare.
+  if both esound and rplay are installed, rplay is configured by default.
+  t3d.c converted from xscreensaver thanks to Jouk Jansen
+    see t3d.c for notes on what is being worked on...
+    Still needs to be scaled to window size.
+  bomb.c update to get rid of warning and more 2038 compatible.
+  juggle.c thanks to Tim Auckland <Tim.Auckland@Procket.com>.
+    Added -pattern option to try out new patterns.  As a juggler myself I
+    find this very useful.  Cleaned up some of the release code.
+    Now works for patterns with 0's.  Beginnings of a pattern generator
+    is in the works.  Maintainer made it a bit more random.
+  loop mode 2 bugs fixed for -neighbors 6
+    Minimum size increased for mono because of drawing errors
+    Should now work for small geometries like 32x32
+  image.c update... needs a fast redraw between displays or the original
+    version looks better.  Changed image defaults.
+  rotor.c changed defaults.  Should behave more like the Sun version.
+  rubik.c 2 bugs fixed with one statement.  Now works for -hideshuffling
+    when turning on non square sides and checks that it down not make 2
+    consecutive 180 degree turns when scrambling.
+  genlauncher (stuff to help me maintain this) updated.
+  dclock.c updates so y2k sub mode will no longer appear in random mode
+    thanks to Tom Schmidt.
+  xglock font problem fixes
+    esound implements Enlightenment Sound daemon
+    vtproc patch (compares of unsigned to negative)
+    thanks to Remi Cohen-Scali<remi.cohenscali@pobox.com>
+  new make.com that does not mess up the new users VMS environment
+    thanks to Jouk Jansen.
+  solitare mode added from the book Object Oriented Programming by Timothy
+    Budd.  Added stuff: Mouse interaction, resizing, no initial flashing,
+    and now should release memory.
+  Added a check for gtkfontsel.h fore configure since glock fails to build for
+    me.
+  Dynamic linking of modules.  See "Dynamic Linking" in README.
+    Now works with xmkmf -a (or configure --enable-modules, Linux only) .
+    GL still has colormap problems... do not have a clue.
+    random mode fixed so it will not call blank, bomb, or itself by default.
+    Problems with multi file (GL) modes, these are temporarily being excluded.
+  VMS patches for C++.  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  Various g++ Wall warnings removed.
+  xmlock NUMPROCS to low thanks to James Hiller <jhiller@crl.com>.
+  BAD_PAM ifdefs fixed thanks to Naomaru Itoi <itoi@eecs.umich.edu>.
+  dclock HIV adjustment thanks to Kenneth Stailey <kstailey@primark.com>.
+  life3d with -mono should look better.
+  genlauncher update with new modes, added xglock to genluancher, modified
+    text3d, and modified xglock (a lot).  (Still have a question with
+    recent Gtk (at least with 1.2.6): when GtkFontSelection is configured
+    the corresponding library is added to xglock's Makefile but it is
+    useless with the recent Gtks. It certainly needs to be incorporated in
+    the configure program.) Thanks to Eric Lassauge
+    <lassauge@mail.dotcom.fr>.
+
+4.15
+  -install now works for tetris and kumppa using PseudoColor.
+  configure updates to allow use of Sun C++ if g++ is present thanks to
+    Tom Schmidt.
+  configure updates for g++ not to give warnings or errors about old
+    X11 include files thanks to Alexandre Oliva <oliva@lsd.ic.unicamp.br>.
+  star mode: more enterprises and drawing bug on enterprise fixed
+    (weirded out when at top or left edge on Solaris).
+  general cleanup: xmkmf fixes, gcc warning in text3d.cc removed, and
+    delinted
+  NetBSD patch for xlock.h thanks to Hubert Feyrer
+    <hubert.feyrer@rz.uni-regensburg.de>.
+  dclock now has an led option
+  bug mode now has triangular bugs.  Well, they are still square but the
+    neighborhoods can now be 3 or 12.  Added some extra genes to make
+    odd and even locations independent for neighborhoods of 3 (could not
+    figure out neighborhood 9).
+  ant mode fixing neighborhood 12 (no neighborhood 9 as well).
+  #define BAD_PAM if your system (known to happen on a version of RedHat)
+    has a bad version of PAM with shadow passwords thanks to Lincoln Stein
+    <lstein@cshl.org>
+  xlock.c FD_SET now add one to get rid of a EBADF (Bad-file-descriptor)
+    error on VMS.  Not sure what the consequences are on UNIX... left alone
+    there, thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  flag -bitmap core dumps fixed.
+  xpm modes: reinitializing just images and redrawing on a colormap
+    change is not good enough... I found one needs to reinitialize all the
+    variables to assure that the initial info is correct.  For instance, a
+    refresh for life mode would come up with a new bitmap where size of the
+    bitmap was all wrong.
+  Allow for -1 for configuring a button so a button logout can be chosen
+    (or not) by a user.  Still can be forced at compiletime.  Thanks to the
+    Michael Stone (Debian maintainer for xlock) <mstone@justice.loyola.edu>.
+  crystal fix for Solaris.  Lines needed to be drawn without xor or would
+    have drawing errors.
+  life shooters fixed up for -callahan and -andreen.  Gliders can come from
+    6 directions.  Also fixed a deadly core dump or infinite loop where a
+    shooter could write a cell out of bounds (in a small window like the
+    password window) possibly even for standard life as well (though you
+    would need a really small password window).
+  life with -fullrandom includes callahan and andreen rules
+  eyes on triangular and hexagonal ants, also fixed truchet for triangular
+    and hexagonal (+sharpturn) ants.
+  config.sub fixed for linux/arm, also a fix for when USE_XLOCKRC nor
+    FALLBACK_XLOCKRC is defined.  Thanks to the Michael Stone (Debian
+    maintainer for xlock) <mstone@justice.loyola.edu>.
+  eyes grelb now has moving antennas too.  They are down when flying up and
+    up when falling.
+  text3d and bubble3d now protected from the pipe mode.  Using MesaGL a lot
+    of flashing was observed with these modes after the pipe mode was run.
+  tik_tak new mode from Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  galaxy authorship for work done fixed.
+  life grelbs now have moving antennas.  Its subtle but it HAD to be done.
+    One can still bring in images and change the default grelb screen.
+  fullrandom now uses xbm half the time for image, maze, and puzzle.
+  inline is left defined for C++ if using C++ and C for config.h.in and
+    xlock.h.  Trips up new SparcWorks C++ 6.1.  Help from Danny Zerkel
+    <dzerkel@cas.org>.
+  invert C++ compile errors for gcc-2.95.1 fixed by Jeremy Buhler
+    <jbuhler@cs.washington.edu>.
+  removed numerous warnings generated by gcc-2.95.1 -Wall.  Added statement
+    in README about using old X11 include files with g++-2.95.1  (you need
+    -fpermissive).
+  xlock.tcl update from Charles Vidal <vidalc@club-internet.fr>.
+  bat mode now shows the colored mono images half the time in fullrandom
+    thanks to Jouk Jansen.
+  dclock HIV adjustment thanks to Kenneth Stailey <kstailey@primark.com>.
+  xglock fixes for Gtk-1.2.3 thanks to Thomas Brupbacher <brp@cerberus.ch>.
+  matrix.c from Jeremy Buhler <jbuhler@cs.washington.edu>.  Password window
+   works much better along with other fixes, see comments in matrix.c .
+  configure.tcl update with make, make install, and view in real time thanks
+    to Charles Vidal <vidalc@club-internet.fr>.
+  SUNWspro 6.1 i_twojet.h compilation may be fixed.
+  imake patch (decay and unstable) thanks to
+     <Matthew_Clarke@mindlink.bc.ca>.
+  blank mode: logic was reversed for enablesaver thanks to Eirik Fuller
+    <eirik@netcom.com>.
+  Kerberos4 patch thanks to Mark Murray
+  FreeBSD patch for disabling FPE (there have been a few requests for this),
+    thanks to Thomas Gellekum <tg@zabagek.ihf.rwth-aachen.de>.
+
+4.14
+  Peter Munster <peter@gmv.spm.univ-rennes1.fr> found a bug with -lockdelay
+    and +mousemotion.  Moving the mouse after the delay brought up the
+    password window.
+  Later, I will probably add "#ident" stuff for all .h files.
+    Started but commented out for now since it should be tested more.
+  Update matrix in menus, man page XLock.ad, and gui programs.
+  matrix: update to make it look more like the movie thanks to Joan Touzet
+    <joant@cadence.com>.
+  life: added a P88 oscillator to life.c from Paul Callahan
+    http://www.cs.jhu.edu/~callahan/patterns/p1/p1.html and a diagonal
+    sparker from Tim Coe
+    http://www.cs.jhu.edu/~callahan/patterns/dspark/dspark.html
+  thornbird: upgraded from author Tim Auckland <Tim.Auckland@Procket.com>.
+  xjack: fix for little window thanks to Jouk Jansen.
+  text3d: -message "text" updates from Eric Lassauge and Jouk Jansen.
+    Purify errors noted in text3d.cc thanks to Tom Schmidt.
+    updates for fortunes from Jouk Jansen
+    initialization errors of GLTT library.  Thanks to Jouk Jansen and Scott
+    <mcmillan@cambridge.com>.
+  dclock: options y2k and millennium from Tom Schmidt <tschmidt@micron.com>.
+    It uses local timezone and description was cleaned up.  French
+    translations by Eric Lassauge <lassauge@mail.dotcom.fr> and Dutch
+    translations from Jouk Jansen.  Also Tom patched dclock up for NetBSD.
+  flag: descriptions and purify errors from Tom Schmidt <tschmidt@micron.com>.
+  -neighbors now a mode option.   -mouse changed to -trackmouse
+    -mousemotion was getting picked up instead.  -shift, tshift and -cycle
+    combined to -cycle for crystal, tetris, and starfish.
+  Multiple options use in modes now possible.  Set up only for -eyes for
+    ant and bug.  (Also another major test would be an option that passed
+    an integer in).  Code stolen from ParseCmd.c from X11R6.4 source and then
+    made so argc and argv are NOT updated.  Jouk Jansen fixed if for VMS.
+  Jouk Jansen cleaned up the erase modes.  New option -erasetime added which
+    will cause the erase to come to an abrupt end on a slow machine.  Default
+    set at 2 seconds.  Also made the erasing smoother...   Also fixed a
+    problem on starfish when size became 0.
+  Resurrected some old code in ant.c so now ant and bug have an -eyes switch.
+    (In the case of bug, it does not let the bug see any better, it just
+    shows the direction its facing).  So far its for neighbors = 4 or 8 only
+    in ant  ... (and bug also has neighbor = 6 setup).  The graphics leaves
+    some room for improvement.
+  bug now can have 4 or 8 neighbors and restarts if all bugs die (this did
+    not always work before).
+  -cpasswd will now work if system uses shadow passwords even if not
+    configured with --enable-xlockrc .
+  matrix mode thanks to Erik O'Shaughness <eriko@austin.ibm.com>.
+    Miscellaneous patches to this mode (less warnings, unexpected events,
+    leaks thanks to Tom Schmidt, Jouk Jansen and myself).  The font seems
+    is from X11.
+  rubik.c now supports LxMxN cubes where non-square faces turn 180 degrees.
+    (nx2n 90 degree turns or known more generally as "banded cubes" is yet
+    another level of complication which I will not attempt... yet).
+  fizzle and spiral erase modes ported from xscreensaver thanks to
+    Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  showmodes.sh fixed... need nawk or gawk not awk
+  loop now has a mechanism to realize when the lifeforms are dead.
+    Still some futile life is not caught (i.e life that will eventually
+    repeat itself).
+  A way for users to unlock each others display.  Kind of defeats
+    the lock but the unlocked user is mailed and and entry is
+    written to syslogd.  Thanks to Mark Kirk <mkirk@pdi.com> for
+    his vizlock-1.0 patch.  Compile-time switch for this is GLOBAL_UNLOCK.
+    This is probably full of security holes when enabled... :)
+  decay update.  Now does not show user screen by default.  +hide will
+    decay the screen.  Also want to update it so that it randomizes the
+    position of the screen in the little password window when +hide is used.
+  bug mode bugfix (fixed a rare segmentation fault) thanks to
+    Mike Coleman <mkc@kc.net>.
+  Cleaned up a warning in invert mode and some extra files.
+  mandelbrot update by Tim AuckLand <Tim.Auckland@Procket.com>.
+    -binary  Modulates the colours to indicate the "Binary Decomposition"
+       of the exterior of the mandelbrot set.
+    -dem  Instead of displaying 'escape times', display an estimate of the
+        distance between the point to be coloured and the set.
+  xpm modes should refresh better now when the colormap changes.
+  decay and lyapunov taken out of unstable category.
+  lament changed for latest MesaGL version, text3d updates for fortunes
+    thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+  Red and Blue swapped for -use3d to conform with my glasses from Sun,
+    National Geographic, and Insight.
+  Colormap problems fixed when two xlock (with -install) run (this can
+    happen if xautolock is running and you lock the machine manually)
+    thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+  New space mode from <Vincent.Caron@ecl1999.ec-lyon.fr>.  Probably will
+    combine the best features of star and space for a new star mode.
+    You must compile it in with --enable-unstable even though it seems
+    to be stable...
+  Changed my e-mail address to bagleyd@tux.org... the old one will still
+    work (as long as the new one does).
+
+4.13
+  kumppa patch (kumppa wrote only to the right quarter of the screen) and
+    make.com fix thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+  lyapunov array bounds read error fixed.
+  New option "-/+description" on by default.  Now can turn off description
+    of mode above password window.
+  crystal and tetris more xscreensaver more compatible (did not test it
+    using xscreensaver).
+  PAM ignored allowroot option, fixed by Sven Paas <Sven.Paas@t-online.de>.
+  Bernd 'Bing' Leibing <bernd.leibing@rz.uni-ulm.de> fixed a compile bug
+    for logout.c that I introduced in 4.12.
+  I got a patch from Andrew Sumner <asumner@netmap.com.au>.  This provides a
+    a way (simple edits to mode.h) to excluding unwanted modes.  This is a
+    global change to all modes (especially random) except the blank mode.
+    Also affected are mode.c and mode.h.
+  Lost bees now caught in flow thanks to original author Tim Auckland
+    <Tim.Auckland@Procket.com>.  This caused problems on VMS and probably
+    would happen on BSD systems.
+  lypapunov mode added.  It is really slow.  The way it is now -count is
+    set at 600 (4000 is recommended for a high quality picture but this
+    takes a real long time).  So far its only available as a unstable mode.
+    Needs a way to speed it up (Sci Am recommends a table of logarithms).
+    Now with random forcing strings.  (Hexadecimal representation shown with
+    -verbose).
+  Fixes for invert for pgcc compiler thanks to Tomasz Sulej
+    <tay@inferno.mikrus.pw.edu.pl>.
+  Thanks to Dan Stromberg <strombrg@nis.acs.uci.edu> for his update to
+    mandelbrot.  It now does subregions.
+  lament problems with multiscreens fixed and kumppa problems fixed by
+    David Hansen <dhansen@metapath.com>.  He also noticed problems with
+    life1d.c (SEGV'd in a malloc from XCreateGC), I have not been able to
+    duplicate the problem).
+  Found bug in xjack.  When in small window a divide by zero would occur.
+    Taken out of unstable.
+  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> his new tetris mode.
+    It now extensively remodeled after altris.  Taken out of unstable.
+  Thanks to Tom Schmidt <tschmidt@micron.com> various fixes and leaks to
+    rubik, lament, invert, text3d, flow, decay, and tetris.
+    Also found problems with gltt which hopefully will be handled by the
+    gltt maintainers.
+  Thanks to Kenneth Stailey <kstailey@disclosure.com> for his "hiv" add-on
+    to dclock.  I also added my personal hang-ups "lab" (research animals)
+    and "veg" (consumed animals).  Upgraded the last 2 to work off current
+    year to get rid of arbitrary start year of 1970.
+  decay mode from xscreensaver thanks to Peter D. Gray
+    <pdg@draci.its.uow.edu.au> but it does not work yet.
+    Proabably will add a nondefault uption where it will use your current
+    image on screen to play around with.  New compile-time option to
+    activate: "CHANGEME".  Have not tried it yet my machine is real slow.
+  Fixed -fullrandom for multiscreens.
+  Cool flow update by author Tim AuckLand <tim.auckland@corp.sun.com> .
+    A camera is attached to one of the trained bees and Duffing's forced
+    oscillator added.  And multiscreen fix for tetris.
+  Configure updates
+    Various warnings about shadowing and prototyping removed.  Removed -Wall
+    on gcc since it creates too much noise.  Will use it privately though.
+    configure now assumes latest version of GL for lament.  configure switch
+    does not seem to work on my Sun.  Also added a switch for conditional
+    compile and link C++ code but not sure how to get it to work in configure
+    (see top of configure.in).  (This introduces problems in make.com which
+    will soon be addressed.)  I fixed the compile without --enable-unstable :).
+    Took out lament and invert from unstable and put in xjack (partially
+    put in before) and tetris (not that its unstable but it needs a lot of
+    work).  Put it a warning if your using --enable-vtlock that it is a
+    pretty big security hole.
+    Update for bsd from Thorsten Frueauf <frueauf@ira.uka.de>
+  New lifeform for loop.  I am not sure if its ever been done on a
+    hexagonal grid (Nov 02 1998).  The hexagonal grid to be is slightly
+    more life-like since it maximzes a cell's area while minimizing its
+    perimeter.  (Currently working on a triangular version in a hex grid).
+    Run xlock with the following "-mode loop -neighbors 6".  Its cells use
+    6 states.  Beware, this option is very liberal about declaring memory.
+    Its not clear whether this lifeform for will survive on the infinite
+    plane forever or choke on its own waste.  loop made them more bomb
+    proof similar to wire.
+  Thanks to <rastlin@rast.lodz.pdi.net> for pointing out that if DEF_PLAY
+    is used it could be made to overflow.  Fixed, not a security issue though.
+    Another possible overflow in iostuff.c fixed (Jouk also fixed it too).
+  Thanks to <tim.auckland@corp.sun.com> for his fix for multiheaded bug
+    for starfish and link now uses thc CFLAG settings.  There should not
+    be calls to release_starfish in draw_starfish.
+  Thanks to  Tim Rowley <tor@cs.brown.edu> for his new mode "invert", a
+    demonstration of turning a sphere inside out without  creating  any kinks
+    (two surfaces can occupy the same space at the same time).
+  wire upgrades made more bomb proof... possibly an issue on a multihead
+    monochrome.
+  make clean should now work if ../configure is run in say xlockmore/linux.
+  Thanks to Kevin Vajk <kvajk@ricochet.net> for his fix if Xresources
+    contains "xlock.mode: Something_really_long..." xlock would memory fault.
+  Thanks to Remi Cohen-Scali <remi.cohenscali@pobox.com> and Eric Lassauge
+    <lassauge@mail.dotcom.fr> and Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+    for updates to text3d and configure for text3d.  Also "*.h" files
+    upgraded to handle C++ better.
+  Thanks to Remi Cohen-Scali <remi.cohenscali@pobox.com> and Eric Lassauge
+    <lassauge@mail.dotcom.fr> for vtlock upgrade.
+  Thanks to <todd.miller@courtesan.com> for his signature patch if
+    a file has a NUL without a newline.
+  Added -showplanes for hyper.  Option looks real bad now but it may be
+    improved upon later.  All the planes that include the origin are shown.
+  Port of xjack.c from xscreensaver by request.  Most of the delays removed.
+  configure change, added afs for Solaris
+  configure change, removed --without-gcc, now just set CC before running
+    configure.
+  configure changes for app-defaults and X11R6.3
+  configure and util.c change for usleep for Ultrix.
+  text3d updates for AIX from Jouk Jansen.
+
+4.12
+  crypt(3) requires strings to be null-terminated.  The 3rd character
+    should be null.  Does not matter for most implementations.  Thanks to
+    Bill Fenner <fenner@parc.xerox.com>.
+  configure fix for afs thanks to Charles Hines <chuck_hines@vnet.ibm.com>.
+  configure fix for group shadow on linux.
+  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> for the port of starfish
+    and kumppa.  starfish must be enabled (using configure --enable-unstable)
+    to use... found unstable on multiscreens and possibly TrueColor.
+    Multiscreen error (seen on Xnest and real multiscreens):
+      X Error of failed request:  BadMatch (invalid parameter attributes)
+        Major opcode of failed request: 2 (X_ChangedWindowAttributes)
+    On TrueColor it sometimes says it can not get all the colors.
+    Also did the dclock Dutch translation.
+  -fullrandom in 4.11 is confusing so I made it a special option under the
+    random mode.
+  Now can use g++ on Linux.  Working on SunC++.  Many stupid warnings
+    removed.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for his genlauncher.
+    This tool (in etc) should help me maintain xlock.  Still needs some work.
+    (java, dt stuff)  also in xalock and xmlock the #ifdef stuff gets
+    stripped.  Also created a new configure.tcl .  Also did the French
+    translation for dclock (accents were not available at the time).
+  goop -count now has some effect.
+  kaleid option for qix.
+  Allow customization of .Xresources.  If using configure uncomment
+    CUSTOMIZATION  part after running configure in config.h .  Thanks to
+    Robert Bihlmeyer <robbe@orcus.priv.at> .  I personally would rather
+    "xlock -display whatever:0" to work as it does in the original.  If
+    someone else thinks this default should change ... let me know.
+  Thanks to Tom Schmidt <tschmidt@micron.com> various fixes and purify report.
+    Patch for root with no password... not allowed to unlock... could this
+    be a problem?  Added verbose fix to color.c stuff.
+    Also several fixes for bubble3d on SunOS, now considered stable.
+  kumppa leak fixes and starfish leak fixes  (one starfish leak remains?)
+    Thanks to Jouk Jansen and Tom Schmidt for finding -bitmap leaks.
+  Thanks to Remi Cohen-Scali <remi.cohenscali@pobox.com> and Eric Lassauge
+     <lassauge@mail.dotcom.fr> for:
+    vtlock: xlock now VT lock switch when using -vtlock option. This is
+          enabled for linux with the --enable-vtlock option of configure.
+          This may or may not work on some versions of Linux, for example
+          it does not work on the maintainers machine. :(   (His latest
+          did not make it in this release but tries to take care of the
+          potential problem of "locking" a vt while another one is active
+          (if using xautolock and two X servers for example).)
+          I recently changed this option from lockvt to vtlock so I would
+          not be confused.
+    configure: add autodetection of MesaGL links (pthread/glide/vga)
+          Autodetection of pthread caused xlock not to run for the maintainer
+          so it was commented out.
+    language: configure can select the lang used for elapsed time display.  A
+          grammar/syntax problem have been fixed in French language.
+          The option selecting the language is --with-lang in configure.
+    xglock: configure can search for GTK+. Makefiles are now generated in
+          xglock if GTK+ is found. xglock have been adapted to gtk+-1.0.4.
+          It is under development.
+    ORIGINAL_XPM_PATCH:
+          the ORIGINAL_XPM_PATCH define enabling the pixmap icon mail can
+          be activated in configure with --enable-orig-xpm-patch option.
+    bubble3d: this mode now has now randomly colored bubbles.
+    text3d: compile with -DUSE_TEXT and GL but need g++ and the gltt lib.
+          configure not set up for this so edit the generated Makefiles.
+          This version works better but the Animate function needs still
+          some work.
+  More language stuff added in resource.c .  It needs a few more German
+    translations and other languages too (besides French and Dutch).
+    To do more, each mode description would need to be translated.  I
+    currently think that would be hard to maintain, but I will not turn
+    down a patch (to mode.c) on this if someone really wants to have this.
+  atlantis should no longer flash.
+  Fix for shadow passwords if the user no longer exists.
+  popex (population explosion) and forest (tropical deforestation) options
+    for dclock... really depressing.  See dclock.c for where I get my
+    numbers.
+  Fade out converted from xscreensaver by Jouk Jansen.  Still to do:
+    -fade out the session at xlock startup
+    fixed one, squaretate to draw with more granualarity so it would
+    not be so slow on my slow machine.
+  Update to crystal by  Jouk Jansen to cycle colors like starfish.  (Name of
+    option changed from -cycle to -shift so +cycle would still work on
+    starfish.  Next version the maintainer hopes to have time to fix this...)
+  hyper -use3d.  Too bad humans only have 2 eyes...  otherwise I would add a
+    -use4d option and have it default to use green cellophane
+  -popcorn option on hop works but the output seems different then a picture
+     from my copy of Scientific American.
+  mandelbrot update by Tim AuckLand <tim.auckland@corp.sun.com>
+     changed from cut-off radius from 2 to sqrt(13) to improve resolution.
+  Fix for julia has some initialize errors... pixels in upper left corner.
+  Fix off by one error in triple_wipe.
+  Fix for -fg red -bg green ... fading does not work here.
+  starfish taken out of unstable since it is fixed for multiscreens.
+    Similar changes for kumppa and crystal.
+  Fix for the following:
+    xlock -mode random -modelist image -bitmap /nonexistant/
+      xlock: caught signal 11 while running image mode (uid 561).
+    xlock -mode random -modelist image -bitmap /nonexistant
+      could not read file "gublety-gook"
+  Converted Jamie Zawinski <jwz@jwz.org> lament to xlockmore.
+    This mode I just got working, so you need to configure with
+    --enable-unstable .  Needs OpenGL1.1 ... configure and Imakefile assume
+    it for now.  Beware of opening doors...
+  Also stole Jamie Zawinski's neat depend/distdepend stuff.  This gives
+    errors if setup on linux.  If setup on Sun (make distdepend after a
+    normal configure) it seems fine.
+      makedepend: warning:  ../xlock/xlock.c: 13:
+        # error architecture not supported by the Linux C library
+  Took out xalock from building by default.  configure gets tripped up
+    by a Sun include file of the same name.
+  kumppa now changes direction by -cycles 1000 .
+  Fixed up distdepend and reorganized dependencies to be the minimum necessary.
+  crystal, starfish, kumppa fixes for -mono and +install .
+  automata modes to have borders when -neighbors 4 or 8 since the others have
+    them.  ant's squares should really be square now.
+  Thanks to Marcelo F. Vianna <m-vianna@usa.net> for his new version of
+    rubik.c .
+
+4.11
+  atlantis mode thanks to Eric Lassauge <lassauge@mail.dotcom.fr> ported from
+    Mark J. Kilgard of Silicon Graphics.
+  kaleid thanks to Robert Adam, II  <raii@comm.net>.  -fullrandom
+    capability added thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+    kaleid is a totally new version.  Make sure you reinstall XLock.ad.
+    May resurrect the old kaleid in qix?
+  bubble3d mode thanks to Richard Jones <rjones@orchestream.com>.
+    Not sure about the name... bubble is taken and bubbles is taken in
+    screensaver ... original name was glbubble.  Seems to give problems
+    on SunOS so it must be enabled (using configure --enable-unstable)
+    to use.
+  hyper mode thanks to John Heidemann <johnh@isi.edu>.  This was built
+    independently from hyper.  I did not understand some of the color stuff
+    and through it away in the name of speed (quick coding and quick exec).
+    Took move_line from the xscreensaver port.
+  -fullrandom added to mountain, triangle, and petal for wireframe the first
+    2 include a joke... mixed wireframe/solid
+  Yet another try to solve the  colormap problems with fvwm and tvwm.
+    New compile-time option for this COMPLIANT_COLORMAP.  Currently this
+    is off by default since this fails on TrueColor.  (See config.h[.in]
+    for more info).
+  Fixed white background on goop with +install.  Also some day I have to add
+    back some of its xscreensaver options.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for his improved
+    xlock.tcl .  He is also starting a configure.tcl... do not expect it to
+    work yet. ;)
+  Thanks to Tom Schmidt <tschmidt@micron.com> for fixing up the mailCmd to a
+    later point in the password screen since it could take several seconds
+    to run with the mail automounted.
+  Thanks to Jamie Zawinski <jwz@jwz.org> ansi and mono fixes for flow.c.
+    Jamie also fixed global -no- options in xlock when compiled under
+    xscreensaver.
+    Fixed some compilation problems when compiling in xscreensaver.
+    glx stuff is now in sync with xscreensaver-2.17.
+  multiscreen fix for DT.  Sometimes it uses the DefaultScreen and sometimes
+    it uses all its screens.
+  Bug fix, food for bugs not updated.
+  configure fix for Linux and shadow thanks to Robert Bihlmeyer
+     <robbe@orcus.priv.at> .
+  new ant.  Size does not get too small except if the user wants it or there
+     is only a small space (iconified).  -sharpturn option mainly for
+     neighbors = 6 but also works for 12.  This new option easily degenerates
+     bees/ants to create highways.  Also worked on getting the truchet
+     lines better... still not perfect.
+  fullrandom option now defaults on... this will probably cause confusion
+    when certain options are selected but most users probably do not run it
+    with options anyway.
+  batchcount depreciated ... it still works but not as a resource.  Use
+    count.
+  xscreensaver/xautolock problem found.  If using a xlock executable with
+     xscreensaver see xlock/vroot.h .
+  lisa looks a little better.  I messed up the refreshing... oops.
+  If saturation not 1.0 it will run out of colors frequently if the colormap
+    is constant... I now retry it as 1.0.  (No COMPLIANT_COLORMAP).
+  Fix for BSD_AUTH thanks to Douglas Berry <doug@monk.cancom.net>.
+
+4.10
+  goop mode added from xscreensaver.
+  color background stuff changed around... did I get it right yet?
+    I think the biggest outstanding problem is fvwm[2] and that I may not
+    have much control over since it does not let me install the colormap for
+    the whole screen.
+  color background reset for shape so it does not screw up other modes.
+  Solaris configure fixes by Tom Schmidt and David Bagley (Imakefile may
+    need some work)
+  xlock.c and random.c modified to allow -inwindow to pop up only once in
+    a multiscreen and work from :0.1.
+  Release code patches for bug, life, life3d, triangle, voters, and wator
+    to get it to work with the new -inwindow.
+  Thanks to Eduardo Santiago <esm@lanl.gov> for his -enablesaver fix broken
+    probably in 4.06.
+  -inroot refresh problems, clear window was added to refresh
+    ant bat bouboule bounce braid bug clock dclock deco fadeplot flag forest
+    galaxy grav helix ico image julia laser life life3d lisa lissie loop
+    marquee maze mountain nose pacman petal pyro qix roll rotor
+    shape sierpinski spiral star swarm swirl triangle
+    vines voters wator wire world worm
+    Also debounced some modes since they now need a "painted" variable.
+    ant, ball, bug, crystal, helix, life, life3d, lissie,
+    petal, voters, and wator.
+      deco, marquee, nose could be better too.
+  debounced puzzle.
+  bug more interruptable.
+  xmlock and xalock patched to display black screens.
+  "xlock -sound -lockdelay 1" fixed so there is no overlapping sounds.
+  Thanks to Michael Duane <mduane@metapath.com> for his check mail patch.
+    New options added -mailCmd,  -mailIcon, -nomailIcon.  A sample
+    check mail is supplied (by Michael) in etc .
+    Original patch used XPM.  The code is still there under
+    ORIGINAL_XPM_PATCH, uncomment in xlock/mode.h.  This has some colormap
+    problems.
+  Thanks to David Leigh <dleigh@us.ibm.com> for his AIX DCE password patch.
+    Suggestions in README for compiling.
+  Replaced MI_WIN_* with MI_* .
+  Changed many references from batchcount to count.  -batchcount is still
+    used... could not figure out how to have them both work.
+  xlockmore can now be is dropped into the main xscreensaver directory and
+    have its modes compile for xscreensaver.
+    Sync'ed up these modes from xscreensaver-2.16:
+      ant bouboule braid drift fadeplot forest galaxy grav
+      hop[along] ifs julia laser lightning lisa lissie mountain
+      penrose rotor sierpinski slip sphere spiral strange swirl
+      triangle vines worm (flag has diverged)
+    Various new line width improvements from jwz:  braid size option,
+    rotor size option, and lisa randomized linewidth.
+    Currently all xlock modes (but random) will compile in xscreensaver.
+    mandelbrot and tube will NOT run yet.  The xpm stuff and program
+    option of marquee and tube still need to be improved too.
+    Could not figure out how to get -no-fullrandom to work if
+    "*fullrandom: True \n" is set in the mode.
+    xlockmore is dropped into the main xscreensaver directory.  See README
+    in xlockmore/xscreensaver for more info.
+  Split out utils.c stuff to util.c random.c automata.c iostuff.c.
+    Also changed  visual.c to vis.c .  This is all in the name of
+    more xscreensaver compatibility.
+  Name changes
+    -imagefile -> -bitmap  xscreensaver capability...
+    -messagefont -> -planfont  probably not used too much anyway
+    -mfont -> -messagefont  goes along with -message...
+    (This is not compatible with xscreensaver but true compatibility required
+    too many changes...)
+  Thanks to Tim Auckland <Tim.Auckland@Procket.com> for 3 new fractal modes
+    discrete, flow, and thornbird.  Also wrote a wrapper script that
+    may give better performance when using java or netscape... set
+    etc/xlock.sh .  Also -name fix.
+  Problem with bomb on 24 bit screen on Solaris 2, same as deco problem,
+    "fixed".
+  Multiscreen error when -geometry is used.  Password screen size would be
+    set to the last screen, fixed.
+  Thanks to Yoav Yerushalmi <yoav@mit.edu> for Kerberos fix.
+  -wireframe options added for mountain, petal, and triangle.
+  bad memory reads fixes on ant and thornbird thanks to Tom Schmidt
+    <tschmidt@micron.com> and Purify.
+  Fixed a bug with penrose where it would stop drawing if clicked a few
+    times.
+  DPMS (Display Power Management Signaling) Monitor patch thanks to
+    Matthew D. Rench <mdrench@mtu.edu>.  I guess it would make sense to
+    run xlock with +enablesaver when your using these new options.
+    Info for man pages obtained from http://www.randomc.com/~dperr/dpms.htm .
+  Fixed program default message bug for marquee and nose when compiled in
+    xscreensaver.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for his improved
+    xlock.tcl .
+
+4.09
+  Fixed some white background problems.
+  Fixed flag free bug.  Showed up on Linux and possibly to a lesser degree on
+    all BSD varieties.
+  shape "fix" on 15/16 bit displays on Linux.  Took away stippling on Linux.
+    It will be back when it does not crash.  Also added borders and shadowing
+    on shape.
+  Thanks to Yoav Yerushalmi <yoav@mit.edu> for adding new resources:
+    logoutCmd, startCmd, and endCmd.  Also patched up the .xlockrc stuff
+    as a fallback when using Kerberos.
+  Thanks to Alexander Knoll <alexander.knoll@hl.siemens.de> for adding a patch
+    for xlock to switch to blank mode if a SIGUSR1 is detected and back if
+    SIGUSR2 is detected.  This is useful if one wants to used a load sharing
+    facility and does not want xlock gobling up precious CPU time.
+  qix modified to handle polygons.  geometry.c merged in with a -complete
+    option (and with -fullrandom).  geometry.c removed.
+  resource.c changed.  Null strings are no longer malloc'd.  life, life3d,
+    getText (used in marquee & nose) fixed to compensate for this.  This
+    fixed an annoying but tiny (1 byte) leak.
+  ncolors on all modes should now be 64.  There may be a problem on linux
+    (involving libc6?) BadValue on X_PolyPoint.
+  Added LESS_THAN_SOLARIS2_5 switch so that gcc could compile xlock.c.
+  xlock -help should not need -remote option if running xlock remotely.
+    This was moved for the modules stuff that I have not got working.  This
+    bug is still present for modules, if it works.
+  Implemented USE_MULTIPLE_USER for acceptance of multiple passwords to unlock
+    similar to USE_MULTIPLE_ROOT.
+  +install now works again... broken in 4.08.  I recommend -saturation 1.0
+    when running in random mode so you get less mono modes.
+  Weeding out of ".", ".." `files' fixed for imagefile in UNIX.
+  -sequential now goes more alphabetically.
+  SYSV patches for VMS thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  Image directories no longer need a final slash for -imagefile.
+  Fix when compiled with logout button and used in dtsaver on a 24 bit display.
+  Finally fixed puzzle mode when moved off screen as in -debug or -inwindow.
+
+4.08
+  Patched up imagefile
+  Took out MAXSCREENS.  No multiscreen limit now.
+  Took out NUMCOLORS.  Put in ncolors as a mode option, range 2-200
+  Took out inital point in qix in the top left corner.
+  Fixed closedown logout.  Display was shutdown before logout was running.
+  New crystal.c thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> and fixes
+    for AIX and VMS.
+  Fixes for TrueColor.  Major bug fix for writable modes and TrueColor.
+  -imagefile for pacman and eyes.  So far there is no xpm or ras.
+  Fixed up configure/Imakefile for Motif2.0.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for his improved
+    xalock and xmlock.  His new improvements use the -parent option.
+    That option does not appear to work for multiscreens, but I think
+    the fix should be on the xlock side.
+  Removed some gcc-2.8.0 warnings and a static variable in draw_flame
+    (usually not multi-screen friendly).
+  Fixed white screens on mono.
+  make.com fix for clean thanks to to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  bouboule.c and rotor minor initialize fix
+  coral, swirl, flag, braid, and strange leak and bad memory reads fixes
+    thanks to Tom Schmidt <tschmidt@micron.com> and Purify.
+  Thanks to Hiroshi Kawaguchi <hirosi-k@is.aist-nara.ac.jp> for his
+    multi-byte character patches for password prompt and marquee mode.
+    Set up using configure --enable-use-mb.
+  Lint warnings removed.
+  Flag patched yet again.  Default set back to xbm for image to get rid of
+    the annoying bad colors on the message part.
+
+4.07
+  Added ELF patch I received from Adam P. Jenkins <apj@twain.oit.umass.edu>
+    in January 96.  At the time it seemed like a lot of work to add and
+    maintain since I could not test it.  It needs more work to get it running.
+  Changed back some code in resource.c to allow for machines that have
+    dynamically allocated IP addresses.  Not sure if this was necessary now...
+  Added patch for SafeWord, not tested.
+  took out warnings about strdup in flag.c
+  removed g++ warnings in cartoon, crystal, mandelbrot, tube, and random.
+  Added hexlife rules to life, they both have known glider lifeforms...
+    (-callahan and -andreen options).  The callahan option is more developed.
+    May yet add gliders coming from top and bottom.
+  Changed around sigset_t on the Sun.  It may give lots of warnings on the
+    Sun but I think it will always compile this now.
+  -imagefile for each mode like batchcount.
+  Fixed swirl, tube, and mandelbrot with BadValue in X_QueryColors on
+    Solaris2.6.  tube and mandelbrot fixed when static colormap.
+    This "fix" probably caused swirl to error out with -forground gray (or
+    -background) -install, this was then fixed..
+  Changed default for -usefirst .  The default is now on.  I am amazed that
+    I have never done this before.
+  configure sometimes mistakenly sets up to use matherr then utils.c errors
+    out.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for his improved
+    xlock.tcl and a more wavy flag.
+  fadeplot was blank on TrueColor and there was a dot in the upper left.
+    This no longer happens but it no longer fades either.  Added more
+    variablity and release code.
+  deco fixed some round-off errors (if width or height odd).
+  ant's truchet mode turned off if size is small.
+  GL modes are not be compiled in at all if there is no GL, same for
+    cartoon and xpm.
+  sproingies, pipes, and gears caused a Bad match on X_GLXMakeCurrent
+    after their release code is run and am running it remotely.
+  deco was weird on TrueColor (Ultra2).  Strange repeated rectangles appear
+    in the first square (ie. top left) about 1/4 of the time.
+    gl modes are not always cleared when completed.  XClearWindow does not
+    work all the time. This led to MI_CLEARWINDOW* macros defined in mode.h
+    and used in all modes.
+    (Fixed flame, turtle, and petal are blank on mono and with -mono ).
+  MI_PAUSE removed from all modes since it does not work on multiscreens
+    especially with above patch.
+  Modified xlock to give a blank screen the glx modes when GLX is not
+    supported by the screen.  This is good for multiheaded machines with
+    a monochrome and OpenGL.
+  Separate LDFLAGS in configure for xlock, xmlock and xalock.
+  -mode ant,bug is an error but should not Segmentation Fault.  Related to
+    the new -imagefile mode option.  Fixed thanks to David Hansen
+    <dhansen@metapath.com>.
+  Interrupts for short delays thanks to William Shubert <wms@hevanet.com>.
+    Delay for bouboule and swarm changed to compensate for this.
+    Currently backed out since it causes problems with random mode,
+    (USE_NEW_EVENT_LOOP).
+  If -duration is fast, password screen now gets the text info about the
+    mode updated.
+  -neighbors option for wire mode.
+  Stippling for demon mode on mono.
+  Use of union for neighbors info.
+  Thanks to Tom Schmidt <tschmidt@micron.com> for adding "default" as a
+    visual name.
+  Separated escher into cage and moebius.
+  Changed the compile-time option USE_MOUSE_MOTION to a run-time option
+    -mousemotion.  Added a new compile-time option -DUSE_WINDOW_VISIBILITY,
+    which was suggested a while back (Heath Rice <rice@asl.dl.nec.com>),
+    allows one to have a window that sits on top of xlock. (This window must
+    pop itself in front if it gets a visibility event).
+  If xlock fails to get the encrypted shadow password it now attempts to use
+    the -cpasswd option, failing that $HOME/.xlockrc, failing that it queries
+    the user.  This way, you do not need to choose between to have it
+    as a compile-time option.  This is only used as a fallback.  -DUSE_XLOCKRC
+    still remains in case that default is prefered.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for his new mode, bubble.
+  Solved a bug in flag involving raster files.
+  -garden mode for daisy.
+  Thanks to Marcelo F. Vianna <m-vianna@usa.net> for his early version of
+    the stairs mode, ala Infinite Stairs.  It needs a bouncing ball on the
+    steps.... work in progress.
+  Configure changes for xalock, rplay, and nas.
+  fullrandom stuff for ant, bubble, daisy, and penrose.
+  AIXV3 fix for flag.
+  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> for his patches to utils.c
+    that allow imagefile to work with the random mode and can now use
+    wild cards to choose specific files in a directory.
+  Thanks to Leonid V. Kalmankin <leonid@cs.msu.su> for his patch for the
+    3Dfx card.  It is not autodetected so FX must be uncommented in
+    config.h.in before running configure (or iconfig.h before running
+    xmkmf -a ).
+  -mode life -rule and -mode life3d -rule3d format changed.  It now
+    allows greater flexibility.  Groupings of symmetric neighbor patterns
+    are also possible in life.  So far this is only available for hexagonal
+    life.  Add -lifefile and life3dfile for the life and life3d.
+    They pretty much follow the simple #P format of xlife.
+file: glider.life (-rule S23/B3 -neighbors 8)
+#P -1 -1
+***
+..*
+.*.
+file: glider.hlife  (-rule S2b34/B2a -neighbors 6 (-callahan))
+#P -2 -2
+    . . O .
+   . . . O
+  O . . O
+ . . . O
+. . . O
+file: glider.3dlife (-rule S45/B5)
+#P -2 -2 -1
+.**.
+*..*
+*..*
+
+....
+.**.
+.**.
+  Added a bit more color to pyro.
+  Fixed MesaGL on TrueColor for modes with MI_WIN_DEPTH in them.
+  KRB fixes thanks to Robert L. Sink <sinkr@cbl.umces.edu>.
+  PAM support thanks to Michael K. Johnson <johnsonm@redhat.com>
+   and Marc Ewing <marc@redhat.com>, use --enable-pam .
+  Obscure multiscreen bug fix
+     xautolock -time 1 -locker "xlock" &
+     xlock/xlock -mode qix -saturation 0.4
+    Caused a bad window because of a bad property.  This was traced back
+    to vroot.h... this stuff does not need to run unless inroot is true.
+  Fixed Makefile.in for BSD... hopefully.
+  Visual fix if GL is not installed.  Still not exactly right for xpm stuff.
+  tube and mandelbrot sometimes did not call XStoreColors correctly.
+  star fixes for multiscreens.
+  Will not exit out if someone did not set up /etc/hosts file correctly.
+
+4.06
+  Fix for floating point error in cartoon for DEC UNIX.
+  Assorted minor fixes.  Imakefile and Makefile.in fixes.
+  Thanks to Mike Kelly <tfsmiles@ecst.csuchico.edu> for fixing xlock on
+    xterminals (caused a buffer overrun ... not enough memory malloc'd).
+  In bug, bugs are now stippled on monochrome.
+  -modelist allxpm and -modelist allwrite for writeable colormap modes
+    added.   I kept it mutually exclusive... even though allxpm modes use
+    a writeable colormap (I'll change this if anyone thinks that it is
+    confusing).
+  Added a feature to my_fopen that allows creation of a new file.  Needed
+    for .xlockrc .
+  Added DEC, IBM, and SCO bitmaps and pixmaps.
+  Writeable colormap conflict should not bomb out xlock.  There will be
+    no graphics.  Not sure if the problem is in MesaGL but there is no
+    problem in OpenGL.  -debug will print out the error when hit.
+    This is fixed in MesaGL2.5 when its released.
+  Rearranged XVisualInfo and context stuff.  Should work the same...
+    May cause leaks if using < MesaGL2.5.  Hoped that it would fix above
+    problem... it did not.
+  Thanks to Dan Stromberg <strombrg@nis.acs.uci.edu> for mandelbrot.
+    Thanks to Tom Schmidt <tschmidt@micron.com> leak fix.
+  RAS and XPM added for flag, maze, life, and life1d.  Probably opened flood
+    gate for leaks...  flag and scream.ras does not work well yet...
+    probably some padding problem...  life and life1d still default to
+    bitmaps.
+  +resetsaver option added.  If using DPMS, XResetScreenSaver resets
+    power timeouts, which may not be desirable.  -resetsaver is on by
+    default.  Thanks to Michel Eyckmans <eyckmans@imec.be>.
+  New Prisoner's Dilemma automata mode, "dilemma".  Thanks to Tom Schmidt for
+    his leak fix.
+  New deco and coral modes stolen from xscreensaver.
+  Hopefully fixed font bomb on bomb.
+  New Purify logs from Tom Schmidt.
+  Fixed exposures on dclock, ifs, nose, and strange.  It could still be a
+    problem on coral if your machine is slow.  If you use -lockdelay it may
+    have to be lengthened.
+  Fixed some flashing on multiscreens for ifs and strange.
+
+4.05
+  Fixes for bat and ifs leaks.  Thanks to Tom Schmidt <tschmidt@micron.com>
+    for his purify report.
+  Fix for galaxy (floating point error on FreeBSD) with help from Bruce
+    Evans <bde@zeta.org.au>.
+  Changed configure so that -lgl is only for IRIX.
+  sierpinski in 3D thanks to Antti Kuntsi <kuntsi@iki.fi>.  -size 3 it will
+    have 3 corners and -size 4 it will have 4 corners... all others cause it
+    to pick 3 and 4 randomly.
+  Thanks to Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> for his patch to
+    configure for Digital Unix and using prefix to set the app-defaults
+    directory.
+  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> for his new crystal.c.
+    Now all orthogonal unit cell crystals are represented (quasicrystals
+    are not).  Fix for bad memory access and refresh.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for his improved
+    xlock.tcl.
+  Modified Makefiles.in used by configure.  A make can be made in xlock and
+    modes/gl directories.  Should be OK now with BSD make but I have not
+    tested it.  Also added setuid and password stuff.
+  XPM MesaGL conflict lock pick solved by having the iconified window to have
+    fixed colors.  This was added to fixedColors in utils.c .  Other writable
+    colormap modes were updated to handle this.  This also solves the problem
+    of the "black" password screen not being black.  This probably does not
+    fix the real cause of the problem...
+  Better color handling of OpenGL.  Still not perfect.  GL modes may look
+    bad in PseudoColor and tube and swirl (and bat, image, puzzle, and
+    cartoon with XPM) may look bad in TrueColor at least on a 8 bit display.
+  Many thanks to Jongki Suwandi <Jongki.Suwandi@eng.Sun.COM> who figured out
+    what -dtsaver does and how to use it.  See README.
+  Fix so that when DT changes the modes on xlock it does not cause errors in
+    the errorlog.
+  Pipes in the pipe mode going towards "near" and "far" should no longer be
+    invisible in OpenGL.
+  Put more shapes in tube.
+
+4.04
+  Thanks to Marcelo F. Vianna <m-vianna@usa.net> for speed ups in morph3d
+    Created the great new rubik gl mode.  D. Bagley made it a lot more
+    unreadable but also made it NxNxN.
+  fract name changed to vines. If batchcount is zero then each iteration
+    will produce a complete vine, otherwise it will produce a portion of
+    the vine.  Nice values for growing the vines to be -batchcount 100
+     and -delay 50000.  Thanks to David Hansen <dhansen@metapath.com>
+  Thanks to Tom Schmidt <tschmidt@micron.com> for his password window
+    patches for server name and mode descriptions.
+  Thanks to Christian von Roques <roques@pond.sub.org> for his galaxy speed
+    ups.
+  Thanks to John Gotts <jgotts@engin.umich.edu> for his syslog display patch.
+  Changed flag to allow it to change between image and message.
+  New directory structure.  configure still needs some more work to get
+    it to make from any internal directory.  configure should now get the
+    correct xapp directory.  Many "ideas" were taken from Jamie Zawinski's
+    xscreensaver.  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> for his
+    new make.com.
+  puzzle should no longer bomb out with BadMatch if in a window.
+    Thanks to David Hansen <dhansen@metapath.com> for handling the -inroot
+    case.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for starting 2 more gui
+    interfaces xalock, this time using Athena and libsx, and etc/xlock.java.
+  -parent <window id> patch to be used with -inwindow option.  This option
+    will be used on the GNOME project (http://www.gnome.org).  Thanks to
+    Radek Doulik <doulik@karlin.mff.cuni.cz>.
+  Added 12 and 6 bit for defaultVisualInfo.
+  Moved config directory to etc... imake could get confused.
+  Fixed color.c so that it could handle the case when all colors are used up.
+  sphere.c now can have the shadow in 4 different locations... it is randomly
+    chosen when init_sphere is run.  Fixed a bug if sphere was restarted.
+  Fixed sierpinski and wire if there are only a few colors.
+  Fixed escher.c it had FALSE instead of "False" in 2 places and was
+    causing problems on 64 bit Digital Unix.
+  Fall throughs in case statements found on hop and ant.
+  hop would sometimes give a blank screen for a nonexisting hop.
+  hop now centered and scaled better.
+  ifs and strange are now reinitialized when refreshed... the size
+    of the window could have changed.
+  Ideas in DT workaround in README from Wade Wegner
+    <wwegner@surveyor.aae.uiuc.edu>
+  munch lifted from xscreensaver.
+  Thanks to Eric McDonald <e@aw.sgi.com> for his help on the SGI 12 bit
+    display.
+  Imakefile patch for SCO and Sun with OGL.
+  Configure patch for Purify.
+  Dave Prosser <dfp@sco.com> SVR4 random image patch.
+  allautomata, allspace, allgeometry add.  allstandard taken away.
+    This also puts stuff back in alphabetical order except the special
+    modes.
+  Password window username now displays host and display info.  Display info
+    only displayed if significant.
+  puzzle patched to handle bomb when batchcount was negative.
+  inline patch if set -ansi -pedantic .
+  More xscreensaver compatibility.  flag and others need a bit more work.
+  Added eyes and swarm mouse options, very similar to the julia code.
+  Patch for Solaris2.6 .
+  Fix, sometimes flags would have enough room to fly.
+
+4.03
+  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> for VMS GL patches and
+    new mode, crystal.
+  Thanks to Ed Mackey <emackey@early.com> for taking out some common code
+    to all GL modes and placed it in utils.c.  Also found BIG leak in
+    gears.c, rewrote sproingies (now handles more sproingies and have
+    better explosions and not have 2 sproingies generated from the same
+    spot at the same time).  Added many neat things to pipes.
+  Thanks to Tom Schmidt <tschmidt@micron.com> for his memory leak fixes
+    to xmlock.c and option.c.  More unresolved leaks and uninitialized memory
+    reads are noted in the source.  Handle matherr in utils.c.
+    Fixed uninitialized memory reads in pyro and worm for -use3d.
+  Thanks to Marcelo F. Vianna <m-vianna@usa.net> for speed ups in all gl
+    modes.  Removed conflict between pipes and superquadrics & sproingies.
+    Pipes to handle -inwindow better.  Created the great new escher gl mode.
+  Thanks to Jamie Zawinski <jwz@jwz.org> for
+    VMS hlp capability make -f Makefile.in hlp
+    braid spin can go the other way, flag font and image capability,
+    ifs and strange less flashy, julia mouse option, sphere draws all 4 ways
+    swirl debugged on 24 bit sgi... it needs 32 bits
+  Thanks to Curtis Larsen <larsen@rtp3.med.utah.edu> for a new improved
+    bounce mode when run in -inroot.
+  Thanks to Jeff Epler <jepler@inetnebr.com> for less tight turns in pipes.
+  Thanks to Scott Carter <scarter@sdsc.edu> for check that only regular files
+    are read in the .xlockmessage, .plan, .signature.  (Tom Schmidt did this
+    for all fopen calls except one :) ).
+    Tabs here are now interpreted.
+  Jason Larke <jlarke@psc.lsa.umich.edu> for his AFS patch so nonsence lines
+    in passwd or shadow do not cause the xlock to barf.
+  release code now called in finish originally written by Ron Hitchens
+    <ron@idiom.com>.
+  XSetScreensaver now only called if locking the screen.  Also able to turn
+    it off now in blank mode.
+  starting to remove the dependencies on MAXSCREENS and NUMCOLORS
+  bigcrypt added for HP secure passwords.
+  `xlock -mode spline -cycles 1 -erase` fixed.
+  boubloule bug solve using -use3d.  all3d modelist option added.
+  New mode added, voters.
+  life3d.c leak fix.
+  Lifeforms added P3 Question, P8 Asym, and P8 Smiley added from
+    http://www.halcyon.com/hkoenig/LifeInfo/LifeInfo.html
+    life.c can now handle -neighbors 3, 4, 6, 8, 9 and 12.  New pointer
+    algorithm.  Hexagons for life, demon, & ant now look better.
+    wator.c can now handle -neighbors 3, 4, 6, 8, 9 and 12.
+  hop fix for multiscreens.  Most of xmartin2.2 algorithms stolen.  xmartin
+    was written by Ed Kubaitis <ejk@ux2.cso.uiuc.edu>.
+  a swirl fix for multisceens... one screen if larger than the other would
+     not reach its maximum size.
+  xmlock string options are now all in quotes.
+  bitmaps, pixmap and flag links are now no longer destroyed with a make
+    clean.
+  stderr is used for the VERBOSE stuff unless its informational stuff about
+    the mode as in ant and life*.
+  tube no longer changes fg and bg.  Should no longer bomb out on TrueColor.
+  Can now use Makefile to adjust SYSLOG stuff.
+  Found a bug in ant and galaxy fixed on the HP-UX 9.0.
+  Got rid of some flashing of the grelb on eyes.
+  Reinitialize qix lines on each init_qix call.  This gets rid of old lines
+    reappearing.
+  Added -imagefile option for bitmaps in life, life1d, and maze.   eyes and
+    pacman will require more thought.  flag now can have a runtime message or
+    use bitmaps.  Thanks to Jamie Zawinski.
+       Put random colors on the nose guy.
+       Added -grabserver option for unsecure SGI.
+  Bug in strcat_firstword fixed thanks to <Jeffrey_Doggett@caradon.com>
+    Fix for ":not found" text that appears after about 40 minutes.
+
+4.02
+  Logout patch for SUNOS4, galaxy and life3d leak fix thanks to Tom Schmidt.
+    inline and seteuid patches for configure and xlock.h.
+  flag-freebsd.h added.
+  First mode was not being released in random mode.  Fixed.
+  new ellipse code from Dan Stromberg <strombrg@nis.acs.uci.edu> (formerly
+    named trig) added to helix  (xlock -mode helix -ellipse).
+  -fullrandom option added to make xlock more random.  Thanks to Jouk
+    Jansen <joukj@hrem.stm.tudelft.nl>.  So far only drift, helix, hop, &
+    spline are set up.  Spline in -erase mode has cycles divided by 64
+    so it is compatible with +erase.  New options added to hop (-jong
+    and -sine).
+  Got SunC++, GnuC++, DECC++ errors and warnings out of xlock.c, passwd.c,
+    utils.c, logout.c, cartoon.c, clock.c, galaxy.c, life1d.c, turtle.c,
+    worm.c, bomb.c, fract.c, tube.c .  It still does not link.
+    GnuC++ was tested on Linux and Solaris.  Thanks to Jouk Jansen
+    <joukj@hrem.stm.tudelft.nl> for the DECC++ patches.
+  Thanks to Tom Schmidt <tschmidt@micron.com> for his memory leak fixes
+    to gears.c, mode.c, & resource.c.  MesaGL 2.1 has some leaks that were
+    reported to the MesaGL maintainer and fixed in 2.2.  Also fixed swirl,
+    and GL modes so they always default to the best visual.  Also added
+    -visual (available with hackers code).  gears and morph3d fixed to be
+    more random at start.
+       gears and morph3d multiscreen bug fixed by Brian Paul
+    <brianp@ra.avid.com> MesaGL creator.
+  Thanks to Massimino Pascal <Pascal.Massimon@ens.fr> for ifs and strange.
+  Thanks to Marcelo F. Vianna <m-vianna@usa.net> for morph3d and pipes.
+  Thanks to Dan Stromberg <strombrg@nis.acs.uci.edu> for tube.
+  Thanks to Caleb Cullen <CCullen@hal-pc.org> for lisa.
+       On Solaris, initial random mode was not random.  This was fixed by a
+    cast for SRAND.  Also updated references for seconds() from long or
+    int to unsigned long.  time(NULL) will exceed maximum signed int in
+    2038.
+  flag jumpiness and gears -mono fixed thanks to Ed Mackey
+    <emackey@early.com>  http://www.early.com/~emackey/sproingies/.
+    Sproingies and superquadrics GL modes and -wireframe option added.
+    "configure --enable-sproingies"    sproingies is not compiled in by
+    default since it may run VERY slow on some machines.  Also the -size
+    option may help you here (thanks to Tom Schmidt for this option).
+  Thanks to Tracy Camp <campt@hurrah.com> for fract with improvements by
+    David Hansen <dhansen@metapath.com>.
+  "Minor" security hole noticed by David Hedley <hedley@cs.bris.ac.uk>.
+    Minor in that the array is in the heap and not the stack, so it would
+    be tricky to write an exploit.  Patched up by David Hansen
+    <dhansen@metapath.com>.
+  Debian bug report fix Bug#8276: xlockmore: xlock -help should output
+    to stdout rather stderr, thanks to Heiko Schlittermann
+    <heiko@lotte.sax.de> for pointing it out.  xlock -version fixed too.
+  Debian bug report fix Bug#8406: app file was not being read when configure
+    was used.  Fixed.  Thanks to Herbert Xu <herbert@greathan.apana.org.au>
+    and Dirk Eddelbuettel <edd@rosebud.sps.queensu.ca> for pointing it out.
+  added allnice, allstandard, allstable to modelist choices for the
+    random mode.  Any mode that runs slower than star mode is considered
+    not nice.  If gl modes are compiled in, these are considered
+    nonstandard modes.  If hackers modes are compiled in, these are
+    considered unstable modes.  To get only GL modes try:
+      xlock -mode random -modelist allstable-allstandard
+    allgl works too if you do not want to type that much. :)
+  X11 ico added added dodecahedron, tetrahedron, and the star octahedron.
+    -face and other options were removed to ease port.
+  -resources now prints out the resources for mode options.
+  button-logout and auto-logout rearranged.  Also the logout button should
+    no longer overwrite your plan.  See "configure --help".  Note: 0 is a
+    special case and handled as infinity.
+  -icongeometry 1x1 fixes for bug, hop, and triangle .
+  fvwm2 menus thanks to James G. Feeney <james@albion.glarp.com>
+  Changed pause on multiscreens so that if pausing the second screen will
+    not override it.  Its not exactly right but I am happy with it for now.
+  Thanks to Charles K. Hines <chuck_hines@vnet.ibm.com> for fixing grav.c
+    bug, casts to unsigned int.
+  LDFLAGS used if using cc on Solaris.  There could be library problems if
+    setuid to root.
+       -neighbors 8 & 3 added to ant and  8, 3, 9, & 12 added for demon.
+  Fix on FreeBSD with xlock setuid and xdm for $HOME/.Xauthority thanks to
+    Thomas Gellekum <thomas@ghpc6.ihf.rwth-aachen.de>.
+  -sequential option for random.  Since the random mode is the most easily
+    broken... its good to have repeatability.
+
+4.01
+  Fix in xlock.c if the HOME variable is not set.  Fix in demon.c for
+    multiscreens thanks to David Hansen <dhansen@metapath.com>.
+  Security hole when xlock is setuid to root found by Richard Jones
+    <richard@a42.deep-thought.org> (this affects all previous releases).
+               Similar problem found by David Hansen <dhansen@metapath.com>.
+    Thanks to David Hansen for his solution of mallocing userfile,
+    appdefaults, modname, modeclassname, fullname, fullclassname, buf
+    variables.  Also the memory leak on line 831 of GetResources variable
+    classname is believed solved (David Hansen again).  In utils.c get_dir
+    "dir" and "filename" are forced to remain within the sizes of DIRBUF
+    and MAXNAMLEN respectively.
+  Thanks to Tom Schmidt <tschmidt@micron.com> for adding --enable-hackers
+    --with-includes and --with-libraries and patching up the handling of
+    Editres in configure.in .  A gears and tube bug patched.  Also
+    contributed new Purify report showing many problems with the GL modes
+    (gears and morph3d).
+  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> for the DECC patches.
+
+4.00
+  xlock.html thanks to vh-man2html .
+       Patch for SGI to kill the Xsgi process when using 4Dwm thanks to
+    Martin Ebert <hi17@iss.mach.uni-karlsruhe.de> and Phillip Moore
+    <phil@ERC.MsState.Edu>.
+  Fix for colormap stuff, swirl in random mode could crash xlock, error
+    made in ALPHA version.
+  Thanks to Alexander Jolk <jolk@ap-pc513b.physik.uni-karlsruhe.de> for a
+               update to lissie to handle -size .
+  Thanks to Sergio Gelato <gelato@spacenet.tn.cornell.edu> for a bug fix
+    for galaxy.
+  Fixed a "Bad Match" generated with random mode for multi-headed color
+    monitors using -install.
+  Thanks to Rick Ohnemus <rick@ecompcon.com> for patches to NAS sound
+    stuff. Typos were my fault.
+  I noticed a problem with Solaris2 and dirent.h .
+    xlock -mode image -imagefile ./bitmaps/
+    is supposed to pick a random file.  This mechanism does not seem to
+    work too well and may corrupt the filename when you give it a specific
+    file name.  Therefore for Solaris2, I compile without dirent.h.
+    Check out utils.c and grep on Solaris2 to see more...
+    One must give a specific filename on Solaris...  here
+    config/xlockrandimage.pl may help you.
+  Thanks to Charles Vidal <vidalc@club-internet.fr> for starting another gui
+    interface to xlock, xlock.tcl, in config directory.  Moved xmlock, the
+    Motif gui for xlock (also written by Charles Vidal), from hackers
+    directory.
+  Robert Duff <duffrd@aud.alcatel.com> patch to randomize the starting
+    color of marquee.  Same patch applied to blot, bouboule, braid, dclock,
+    geometry, flag, helix, hop, kaleid, julia, qix, roll, rotor, spiral,
+    spline, swarm, worm.  On bomb, life, triangle this was not done on
+    purpose and on others...  flame and lissie it was done already.
+  Leaks fixed in gears.c and bomb.c.  Purify was not used so there could be
+    others there.
+  dclock should work correctly in password window... i.e. it should not get
+    stuck, and randomized initial direction.
+  penrose.c  run with -verbose and it will tell you when it hits some
+    weirdness (about once an hour) "Dislocation occurred!"
+    If it says "Weirdness...." it would have terminated previously.
+  Updated make.com to use links instead of copies.  Thanks to Jouk Jansen
+    <joukj@hrem.stm.tudelft.nl>.
+  Thanks to Tom Schmidt <tschmidt@micron.com> for fixing the formatting
+    on the "hours elapsed since locked." message and logout patches.
+    Also for adding several options to configure.
+  Thanks to Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> for Digital Unix
+    (aka OSF1) for patches to the Imakefile.
+  Middle button fix and monochrome random mode fix for multiscreens.
+    Multiscreen patch for marquee and nose.
+  Updated xlock.h not to have a \ at the end a line with a #if.  VAXC chokes.
+  Updated size and batchcount in ball and size in pyro.
+  Updated mode.c for maze.  Incorrect if XLock.ad was not installed.
+  Updated turtle.c.  Incorrect HARTER_HEIGHTWAY mode and float casts to int
+    to please the VMS god.
+  Updated ant.c to handle more kinds of ants.  Thanks to J Austin David
+    <Austin.David@tlogic.com>.  Check out http://havoc.gtf.gatech.edu/austin
+  Hackers modes moved to main directory.  cartoon.c may be kind of flashy
+    with -install and without it you might not get any cartoons.  Looks OK
+    on monochrome.
+  audio stuff for VMS is in config directory.
+  Updated grav compile-time options now runtime options-> -decay and -trail.
+  New "-version" option now pulls the version from version.h.  Also added a
+    more verbose option "-verbose" for maximum verbosity.  -v now gets
+    version instead.
+  New "-sound" option added.  It is off by default.  If on it will only work
+    if RPLAY, NAS, VMS_PLAY, or DEF_PLAY are used at compile-time.
+  "Feature" where truncated mode names were accepted, such as "-mode s" now
+    give an error.  It did not work well anyway (above example ran shapes in
+    monochrome).
+  Thanks to Alexander Lehmann <lehmann@mathematik.th-darmstadt.de> for adding
+    backspace capability Control-H for marquee (but not with -message).
+  configure is now used.  At this stage the Imakefile is still probably
+    more reliable.  The Makefile.[acc hp std sun] are no longer supported.
+    (But are in config for reference).  The Imakefile and make.com are still
+    supported.  imake has fallen out of favor with me.  imake is sometimes
+    not configured well, its make depend is confusing (some systems it is not
+    required), and cumbersome (and ugly) "@@\"'s are used to do more
+    complicated things.  And it is not installed on some HP's.
+    A few things have been added for configure, but NOT used with Imakefile
+    or make.com:
+      config.h.in -> config.h  when "configure" is run.
+        This file is where the users options are stored.  These may depend
+        more on the administrator/user than on the system, but some options
+        are not available on some machines.  See "configure --help".
+        If this file is modified... a "make clean" should be done unless you
+        know what your doing.
+      Makefile.in -> Makefile  when "configure" is run.
+      configure.in -> configure  when "autoconf" is run.  Note: autoconf is
+        a GNU product that may not be installed.  This is need only if you
+        update configure.in .
+     Although there is some VMS support features in Makefile.in... full
+       support for MMS, MMK, or VMS-GNU-MAKE is not there yet.
+
+3.13
+  loop.c added, it is not exactly a screen saver, but it demonstrates
+    self-production.
+  turtle.c added.  Recursive turtle graphics.  The only one that works
+    at present is the Hilbert curve (which is may not exactly be
+    a turtle curve... but close enough).
+  Thanks to M G Berberich <berberic@forwiss.uni-passau.de> for .plan and
+    .signature stuff and purify log.
+  bomb and signature updates for VMS thanks to Jouk Jansen
+    <joukj@hrem.stm.tudelft.nl>.
+  flag fix for negative size thanks to <Mark_Buglewicz@itd.sterling.com>.
+  MULTIPLE_ROOT & passwd in compat mode bug fix and NAS sound patch bug
+    fix thanks to Dave Smith <drs@aeolians.bt.co.uk>.
+  Thanks to Tom L. Schmidt <tschmidt@micron.com> for purify logs.
+  Many leaks patched thanks to Purify!  grep on "PURIFY" to find
+    unresolved leaks.  Purify file is in the docs directory.
+  2 problems in the Imakefile cleaned up thanks to Simon Josefsson
+    <jas@pdc.kth.se>.
+  Patch to allow marquee to handle extended character set >=128
+    Alexander Lehmann <lehmann@mathematik.th-darmstadt.de>.
+  XPM files now work with -install (thanks to XPM maintainer Arnaud
+    Le Hors for pointing me in the right direction).  Managed to reserve
+    black and white, but not fg and bg does not work.  Sometimes in random
+    mode the colors are not mapped correctly.
+  -geometry should now work again without excessive refreshing.
+  Refresh update on image.c.
+  ball, julia, roll in the hackers directory are probably ready for
+    prime-time but have not been BETA tested.
+
+3.12
+  swirl will cause xlock to dump core or CRASH OS within 50 repetitions
+    when run in random mode, fixed.
+  xlock -mode tri -mono  dies, fixed.
+  xlock -mode swirl +install  with netscape (stealing colors) running
+    is even less reliable, fixed.
+  daisy and slip are sometimes in red when there are no colors left, fixed.
+  After the delay has expired the first button click only redraws the
+    current mode.  It then takes a second click to activate the
+    password display.  Fixed thanks to David Hansen <dhansen@metapath.com>.
+  Individual -size option added (like batchcount).  -gridsize removed.
+    If 0 it will use the bitmap if available.  If negative it will be
+    random from 1 to -size inclusive (like batchcount).
+  Combined star mode with rock mode.  rock mode removed.
+    -trek, -rock, -straight options.  Star Trek features by Heath Rice
+    <rice@asl.dl.nec.com>.
+  dclock updated offscreen so there is no annoying flashing.  Originally
+    submitted by Michael Stembera <mrbig@fc.net>.
+  bomb mode back... but its essentials are NOT compiled in by default.
+  Patches for SUNOS_ADJUNCT_PASSWD thanks to Mark Buglewicz
+    <mark@itd.sterling.com>.
+  Many modes patched that did not initialize the redrawing variable.
+  Demon bug solved when alternating between iconified window and normal
+    window.
+  mountain patched so it would not be so slow.
+  life1d much improved.  It now has a fade out if it is found repeating.
+    Now can break without it completing a whole screen.  -totalistic
+    option added (+totalistic -> LCAU collection instead).
+  Updated clock to use batchcount  (i.e. many clocks) .. if there are too
+    many collisions it will draw less clocks.
+  Thanks to Rene' Driessen <rdr@crys.chem.uva.nl>
+    xlock -mode puzzle -mono ( -inwindow | -debug )
+    will get a Bad Match if obscured (but still errors out if moved off
+    screen).
+  Updated modes to use size instead of batchcount... clock, flag,
+    maze, penrose.
+  Updated modes to use size instead of cycles... bouboule, star.
+  Updated modes to use size instead of worm's CIRCSIZE, and galaxy's STARSIZE.
+  Updated other modes to use size bat, bounce, ant, demon, life1d, life,
+    wator, wire.
+  galaxy bug on VAX now gone... not sure why...  Disappeared when I added
+    temporary sin and cos calculations for efficiency.
+  Thanks to Dr. George D M Ross <gdmr@dcs.ed.ac.uk> for SYSLOG (xlock.c)
+    and NETGROUP patches (logout.c).
+  Thanks to Gabor Herr <herr@iti.informatik.th-darmstadt.de> for pointing
+    out that uid and gid privileges should be taken away unconditionally
+    after the encrypted password is grabbed.  Otherwise, it may lead to a
+    major security hole depending on how it is installed.
+  xmlock.c added to hackers directory.  Thanks to Charles Vidal
+    <vidalc@club-internet.fr> for starting a gui interface to xlock.  Feel
+    free to improve upon it, but mail me your diffs.
+  -DUSE_HACKERS compile-time option added (cartoon.c took a step back,
+    nobody's fault but mine).
+  ant mode with -truchet memory leak found.  Refreshing improved.
+
+3.11
+  Ron Hitchens <ron@idiom.com> Updated xlock so it would refresh more
+    reliably and handle window resizing and -inroot
+  -neighbors is now randomly 4 or 6 if not 4 or 6.  This affects the ant and
+    demon mode.  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  -help now displays help messages of each mode if there is one.
+  Changed _opts to include a separate counter for opts and vars & desc
+    since they do not have to be the same if there are boolean switches.
+  Added a -truchet option to ant, this leaves a trail of the ant.
+    One should probably change -gridsize to see it more clearly.
+  Added a -erase option to spline, if used one should make -cycles low,
+    say 20.
+  My long request for a penrose algorithm has been answered :) ,
+    penrose.c added thanks to Timo Korvola <tkorvola@dopey.hut.fi> .
+    -ammann will show ammann lines.  These were useful for debugging
+    penrose.c .  It is currently my favorite mode.  Once I saw it do
+    a dislocation, I think.
+  tri.c added thanks to Desmond Daignault <tekdd@dtol.datatimes.com> .
+    I would like to see other fractals added to this like fern.
+  daisy.c added.  I modeled it after some slow PC lockscreen in the office.
+  More 3d options besides rock: bouboule, pyro, & worms.  Rock patched up.
+    Now includes overlap color if colormap is installed.  Thanks to
+    Henrik Theiling <theiling@coli.uni-sb.de> .
+    There is a bug on some machines with rock mode.  A border of red can
+    be seen around the magenta rock (which should be blue).  This happens
+    on my Sun with the colormap installed but not on Linux.
+  Password code mallocs fixed up and BSD_AUTH code added thanks to
+    Paul Borman <prb@bsdi.com> .
+  2 problems in Kerberos code and 2 in the Imakefile cleaned up thanks
+    to Simon Josefsson <jas@pdc.kth.se> .
+  Kerberos 5 added thanks to Dale Harris <rodmur@ecst.csuchico.edu> .
+  Multi user per uid patch thanks to der Mouse
+    <mouse@collatz.mcrcim.mcgill.edu> .
+  Now should compile under C++, but it complains about signaling, pclose,
+    crypt, and gethostname when linking.
+  All modes now have refresh hooks, but some just call the init_ hook.
+    lissie, bug, rotor, spline -erase and worm hooks thanks to Alexander
+    Jolk <jolk@ap-pc513b.physik.uni-karlsruhe.de> .
+    On slip, penrose, and puzzle, I made no attempt.
+  All modes now have change hooks.  All except random call the init_ hook.
+    So when running a mode you can get it to restart by pressing the middle
+    button on your mouse.  This does not work with the password window up
+    but probably should.
+  Added -debug runtime switch.  Formerly accessed only by -DDEBUG.  Some
+    debug switches are still only accessed in this way.
+  -rule for life and -rule3d for life3d runtime switches.  Also a real
+    change hooks for these modes.  For -rule3d if set to 0 all rules that
+    have known patterns will randomly selected.  If set to 1 all rules that
+    have known gliders will be randomly selected.
+  "xlock -inwindow -lockdelay 10" now should work.
+  Sped up sphere by not drawing off screen.
+  Added a hackers directory for hackers.
+  Added hooks to Imakefile for MesaGL.  No mode uses this yet see the
+    hackers directory.
+
+3.10
+  Reorganized bitmaps.  All single bitmaps use "image_" inside the bitmap
+    file.  They are now organized t-tiny, s-small, m-medium, and l-large.
+    That way one can, if one wished, one can use one bitmap file for eyes,
+    image, life, life1d, maze, and puzzle at compile-time.
+  Removed all references to Scr, screen, and dsp in the modes.
+  Release mode stuff added to all modes (except random).  Rewrote image
+    initialization for bat, image, and puzzle to make it safe for
+    multiscreens (image and puzzle are still not correct for multiscreens).
+  Negative batchcounts now allowed, if negative it will be random from
+    the smallest allowed positive batchcount to ABS(batchcount), inclusive.
+    It is available on
+      ant, bat, bounce, bug, eyes, flag, galaxy, geometry, grav, image, laser,
+      lissie, maze, mountain, petal, puzzle, rock, spiral, spline, swarm,
+      world, worm.
+  More mallocing (and freeing) done for bat, bounce, bug, eyes, galaxy,
+    geometry, image, lissie, maze, puzzle, rock, rotor, spline, wator, world,
+    worm, so there are less predefined limits.  In the case of eyes and rock,
+    some limits were imposed where a dynamic number of pixmaps were
+    dynamically declared, so that xlock would not easily slow down to a crawl
+    and run out of memory.
+  bug now uses gridsize.  And to some degree life, life1d, and wator.
+    It would be neat if you could choose not to use the bitmaps for big
+    windows.
+  worm now uses cycles for length of worm and galaxy uses cycles now too.
+    rock uses cycles for max rock size.
+  One no longer has to hit return twice to unlock using lockdelay.
+  flag now uses batchcount for "point" size.
+  XClearWindow is used instead of filling screen with a big black rectangle.
+  Added -icongeometry option. It has a range of 1x1 to 256x256 .  Position
+    information is ignored.  Updated modes to handle weird geometry's bat,
+    bounce, braid, bug, eyes, kaleid, life, life1d, maze, nose, puzzle,
+    wator, world.
+  mountain changed to allow it to be interrupted quicker, (braid and slip
+    are harder :) ).
+  bounce changed to get rid of drawing errors.  I could not figure out how
+    easily remove more without the balls flashing.
+  wire mode added based on code from Kevin Dahlhausen <ap096@po.cwru.edu>
+    and Stefan Strack <stst@vuse.vanderbilt.edu>.
+  lightning mode added thanks to Keith Romberg <kromberg@saxe.com>.
+  in xlock.c, in function runMainLoop, reads should be declared not as
+    struct fd_set.  This causes compilation errors with Linux kernels 2.0
+    and higher.  Thanks to Brian R. Doherty <doherty@rice.edu>.
+  "nice" patch for xlock to so that xlock is "not so nice" when a password
+    window is being presented.  Thanks to Jouk Jansen
+    <joukj@hrem.stm.tudelft.nl>.
+  lightning, eyes, maze, shape patched for multiscreens.  XPM stuff patched
+    for multiscreens (thanks to XPM maintainer Arnaud Le Hors).
+    Tested on a machine where 0.0 is black/white, 0.1 is 8 bit color.
+    Also random mode does not use the correct initial values of modes on
+    multiscreens.  Testing on multiscreen thanks to Mark Wedel
+    <mwedel@pyramid.com>.
+  Long standing bug fixed (>= before MAXBATCH) for flame.c thanks to Ron
+    Charlton <crc@ornl.gov>.
+  puzzle when in -inwindow or compiled with -DDEBUG and moved off screen
+    will not bomb out unless it is using an xbm image.  This should be
+    completely fixed in 3.11.
+  New defaults: grelb substituted for life icon, -install for
+    installation of the colormap, some modes slowed down so they would look
+    correct on fast machines.
+
+3.9
+  All modes (except eyes.c) have been updated to use less global variables.
+    Also updated xlockmore to ANSI C by GNU's protoize.
+  demon.c updated to be faster.  Although it is now significantly more
+    complicated.
+  ant.c and demon now have runtime options.   -neighbors 6 or 4 (default = 4)
+    -gridsize (170 default)  (In ant, when neighbors = 6 it is called bees.
+    Not much is known about these critters.  They do not seem to exhibit the
+    highway building activity found in normal ants, but otherwise they
+    behave pretty similar.)
+  flag mode thanks to Charles Vidal <vidalc@club-internet.fr>.
+  The Lissajous worm (lissie mode) thanks to Alexander Jolk
+    <ub9x@rz.uni-karlsruhe.de>.
+  Shape mode now has triangles.  Also now looks better when minimized.
+    From an idea in REC (Recreational & Educational Computing).
+  Random mode now tells you which mode is running when run with -verbose
+    [formerly -v].
+    Added VERBOSE stuff to life, life3d, life1d, and ant.
+  Changed rock.c to use blue by default for the left eye.  All 3D glasses
+    I have seen use blue.
+  Fixed swirl so it would not swirl "white".  Even if it is not a bg or fg
+    color.  This made the border around the little window change color.
+  From Ron Hitchens <ron@idiom.com>:
+    patch for middle button so that it will change locks even if duration
+      is 0 in random mode.
+    patch for window title noticeable when used with the -inwindow option.
+    fixed up demon.c
+  Random access to raster files by giving a directory thanks to Jouk
+    Jansen <joukj@alpha.chem.uva.nl>.  If UNIX, give directory followed by
+    a "/", also it may try to put "." as an image file.
+  When xlock is compiled with shadow passwords it will still work on non
+    shadowed systems that use elf, thanks to Marek Michalkiewicz
+    <marekm@i17linuxb.ists.pwr.wroc.pl>  Compilation with HAS_SHADOW is
+    forced on Linux with ELF (even if shadow passwording is not used).
+    This will facilitate a migration towards shadow passwording.
+  For the sake of completeness, xbm files can now be read in at run-time.
+    Courtesy of John Bradley's xv(xvbm.c), used by permission.
+  "xlock -nolock -lockdelay 1" should no longer crash
+
+3.8
+  system call for sounds using DEF_PLAY thanks to Milco Numan
+    <milcon@krim.chem.uva.nl>
+  Used GNU's indent to reformat all *.c and *.h files.  It may have
+    screwed up some comments. I used:
+    -bap -nbacc -bad -nbc -br -bs -c33 -cd33 -ncdb -ce
+    -d0 -di12 -neei -fc1 -i8 -ip8 -l79 -lp -npcs -psl -nsc -nsob
+    -cli8 -cs -cp1
+  Multiple root accounts for allowroot.  Thanks to Lewis Muhlenkamp
+    <lewism@tt.comm.mot.com>.
+  Better make.com file for for VMS thanks to Jouk Jansen and the
+    author of XVMSUTILS, Trevor Taylor <taylort@decus.com.au>.
+  -display fix for VAX thanks to Jouk Jansen.
+  eyes mode, revamp to eliminate need for global variables in modes,
+    new hooks (release and refresh), and middle button for "Next" in
+    random mode, thanks to Ron Hitchens <ron@idiom.com>.
+    This now allows for many things to be cleaned up.  Due to the number
+    of modes, it will take a few releases.  See HACKERS.GUIDE.
+  puzzle mode thanks to Heath Rice <hrice@netcom.com> & Jouk Jansen
+    <joukj@alpha.chem.uva.nl>.
+  Raster files (for puzzle.c and image.c) thanks to Tobias Gloth
+    <gloth@math.uni-muenster.de> & Jouk Jansen <joukj@alpha.chem.uva.nl>.
+    Background is now black when used with -install.
+  swirl for 16 bytes per pixel patch <davidm@azstarnet.com>
+  bouboule mode memory leaks fixed thanks to Jeremie Petit <jpetit@essi.fr>.
+  maze's dead ends are now filled in.
+  More syslog stuff for notifying failures in unlocking xlock Andrew Sammut
+    <sammut@dstc.qut.edu.au>.
+  blank now uses the power-down sleep mode if available, thanks to Ron
+    Hitchens <ron@idiom.com>.
+
+3.7
+  HP bug timing bug fixed thanks to Ron Hitchens <ron@idiom.com>.
+  3D mode for rock thanks to <theiling@coli.uni-sb.de>.
+    Get out your 3D glasses, Red on right and Green on left.
+  added compile time option for spline, FOLLOW to erase old splines
+    like Qix thanks to Richard Duran <rduran@cs.utep.edu>
+  petal now works with -inroot .
+  CDE DT saver thanks to Trevor Bourget <trevor@thomsoft.com>
+    see Imakefile and README.
+  bouboule mode added, thanks to Jeremie Petit <jpetit@essi.fr>.
+    bouboule fixed for VMS and TrueColor.
+
+3.6
+  Many patches, thanks to Ron Hitchens <ron@idiom.com>.
+    xlock now appears over the screensaver, passwd.c reorganized,
+    new event loop in xlock.c, new icons in bitmaps, updated clock
+    and triangle, and resource parsing fixed for "xlock".
+  pedal renamed to petal.
+  Clock mode updated to change in size thanks to original author
+    Petit Jeremie <jpetit@essi.fr>.
+  More context handling stuff for DCE thanks to Terje Marthinussen
+    <terjem@cc.uit.no>.
+  slip mode added thanks to Scott Draves <spot@cs.cmu.edu>
+    with a patch from <joukj@alpha.chem.uva.nl>.
+  patch for -messagesfile code favored early quotes and new event loop
+    compatibility thanks to <joukj@alpha.chem.uva.nl>.
+  XLock.ad and xlock.man updated to be more consistent.
+  ultrix fix for strdup thanks to Erik Bertelsen <erik@sockdev.uni-c.dk>.
+  invalid sound added thanks to <J.M.Box@dcs.warwick.ac.uk>
+  Thanks to <mccomb@interport.net> for helping to debug marquee and nose
+    on multiheaded machines.
+
+3.5
+  Fixed my goof on worm.c.
+  vms_play fixed for nonexisting sound files and -messagesfile code
+    updated thanks to <joukj@alpha.chem.uva.nl>.
+  marquee now more random and memmove no longer used.
+  marquee fixed for multiheaded machines thanks to Caleb Epstein
+    <epstein_caleb@jpmorgan.com>.
+  Random number generator fixed for 64 bit "long" thanks to Scott McCoy
+    <smccoy@dr3w.ess.harris.com>.
+
+3.4
+  rplay patch thanks to Simon Banks <sbanks@cellnet.co.uk>.  xlock now
+    has sound where available.  Edit your favorite makefile.
+  2 new modes thanks to Tobias Gloth <gloth@math.uni-muenster.de>.
+    marquee (I changed a lot) shows text on the screen, similar to nose
+    triangle, (colormaping removed) similar to mountain
+  nose text functions removed to utils.c
+  image.c now with -imagefile option (only with XPM).
+  rect.c name changed to shape.c.
+  swirl.c and world.c fixed for multiscreens, thanks to Grant McDorman
+    <grant@isgtec.com>.
+  A better way of handling fortunes from a file, thanks to Jouk Jansen
+    <joukj@alpha.chem.uva.nl>.  To try use -messagesfile fortune.dat.
+    Also contributed vms_play.c and a new make.com file.
+  KERBEROS patch thanks to Omar Siddique <omar@gl.umbc.edu> for sending
+    and testing it (patch author unknown).
+
+3.3
+  LIFE_5655 and LIFE_6767 compile time options for life3d.
+  ultrix passwd bug fix thanks to Erik Bertelsen <erik@sockdev.uni-c.dk>.
+  nose now has a font option and is fixed for multiscreens.
+  Stupid memory leak in ant fixed.  Now random colors.
+  swirl now needs to be used with -install to look right,
+    thanks to Heath A. Kehoe <hakehoe@icaen.uiowa.edu>.
+  Patch for AIX thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+  Color pixmaps for bat from <patol@info.isbiel.ch>.
+  image pixmaps now default to bitmaps if xpm fails, thanks to
+    <Markus.Zellner@anu.edu.au>.
+  flame crashed xlock when using random mode on Linux, fixed.
+  Numerous fixes for multiscreens incl: bat, bounce, rect, hyper, life1d,
+    forest, laser, mountain, and braid.  Also xlock.c patched or second
+    screen would have a black and white display.
+    Purify found memory leaks in swirl, mountain, laser, hyper, maze.
+    Thanks to <mccomb@interport.net>.
+  New option -lockdelay #, for those who were bothered by xautolock
+    locking the screen when you you did not want it, now just hit
+    return (within a specified number of seconds) to get the screen back.
+    This option is intended to be used with xautolock.
+  worm now has no limit on the number of worms.
+  pyro bug fixed for large batchcount (500-2000), thanks to
+    Minoura Makoto <minoura@flab.fujitsu.co.jp>.
+
+3.2
+  Doug McLaren <dougmc@comco.com> noticed a big security hole in
+    nose.c when xlock is setuid to root.  Now, after the password is
+    read, it gives up root, thanks to Heath A. Kehoe
+    <hakehoe@icaen.uiowa.edu>.
+  DCE Authentication patch added.
+  Thanks to Jouk Jansen <joukj@hrem.stm.tudelft.nl> for clearing up
+    a timing problem using -DOLD_EVENT_LOOP .
+
+3.1
+  Multipatch by Heath A. Kehoe <hakehoe@icaen.uiowa.edu> it includes
+    speed up in helix, random mode now switches modes, input to mode
+    is now customizable (see random.c), and a DCE authentication patch
+    (based on work by Phil O'Connell <philo@icaen.uiowa.edu>).  Also
+    usleep was dropped in favor of a new timing mechanism.  It is still
+    available using -DOLD_EVENT_LOOP (VMS still uses it by default).
+  braid.c thanks to John Neil <neil@math.idbsu.edu>.
+  helix now looks even better.  I found a bug in the translation from
+    xscreensaver.
+  nose.c may still need a little work (its a bit slow).  Taken from 2
+    sources xnlock and xscreensaver's noseguy.  It no longer leaves
+    dust on the screen as well (the bitmaps are shifted up by one pixel).
+  pedal.c taken from xscreensaver.
+  Patches for OSF1_ENH_SEC but it unfortunately seems to need more work.
+  Idea to have the mode.h defaults used thanks to Roland Bock
+    <exp120@physik.uni-kiel.d400.de>.
+  closedown patch for xdm use from Janet Carson's xclosedown
+    with modifications from Anthony Thyssen <anthony@cit.gu.edu.au>.
+  image.c updated to use xbm if using a monochrome monitor or using -mono.
+  life1d, bug.c, ant.c, and demon.c added from Scientific American's
+    Computer Recreations.
+  hop.c now has Peter de Jong's hop.  Half the time its boring but
+    the other half of the time its great.
+  A better patch from Peter Schmitzberger <schmitz@coma.sbg.ac.at> for
+    spiral (a bug that I introduced).
+
+3.0
+  Patch from Peter Schmitzberger <schmitz@coma.sbg.ac.at> for maze and image.
+  Thanks to Shane Watts <shane@phobes.mlckew.edu.au> for helping me with
+    Linux shadowing.
+  world.c backward spinning jump fixed by Neale Pickett <zephyr@nmt.edu>.
+  laser.c bug (that I introduced) solved by Heath A. Kehoe
+    <hakehoe@icaen.uiowa.edu>.
+  Edited rect so that it does ellipses as well, like After Dark.
+    I should of renamed it right?
+  Got rid of "+=" in Imakefile because HP, AIX, and Ultrix have
+    trouble with it.  Still used by some systems where there seems to
+    be no trouble.
+  passwd.c extracted from xlock.c and xlock.h .  May have cured some
+    bugs (like a BIG network security bug) but most likely broke some
+    systems.  Thanks for the many people who gave feedback during
+    the BETA test.
+
+2.10
+  xlockrc password for more user control of xlock.  Author unknown.
+    It is a compile-time option, see Imakefile and README.
+    Moved usleep.c and hsbramp.c to utils.c and logout.c to opt.c .
+    Split out mode.h from resource.c .
+  Changes of Skip_Burrell@sterling.com were incorporated into image.c .
+    Not sure how to get pixmaps to randomize color and -mono does
+    not work for pixmaps.  See Imakefile and README.
+  -allowroot now works on Solaris2.x.
+  Clock mode added, thanks to Jeremie Petit <petit@simula.unice.fr>.
+  laser and mountain modes added, similar to After Dark's version, and
+    also forest mode thanks to Pascal Pensa <pensa@aurora.unice.fr>.
+  Updated maze and helix after seeing mountain mode.  Do not have to
+    wait a second to enter password. :)
+  Now provide random number generator.  Thanks to Mike Arras
+    <arras@intertv.com>.  I changed RAND to LRAND.
+  Due to overwhelming demand, the old flame is back... well OK its
+    slightly modified.
+  Patch for SUNOS_ADJUNCT_PASSWD, thanks to Dale A. Harris
+    <rodmur@ecst.csuchico.edu>.
+  Imakefile reorganized for AIX.
+
+2.9
+  "make install.man" should now work for imake users (if you would like
+   it to work for Makefile.hp ...  mail me the patch).
+  Unbundled SunC warnings removed in bitmap files, maze, grav, life,
+    and swirl.
+  Swirl patched to work sensibly with TrueColor displays, thanks to
+    Steve Early <sde1000@cam.ac.uk>
+  Rock mode made much better by Jeremie Petit <petit@simula.unice.fr>.
+  Imakefile reorganized by <mjacob@feral.COM> for Solaris2.x .
+  Reorganized the README and the screens are now (mostly) alphabetical
+    throughout.
+  Updated life3d to include compile-time options LIFE_5766 and LIFE_4555.
+    5766 is more like life, but 4555 (default) seems to be better.
+  I went through the lifep.zip (May 94) collection and pulled out some
+    small and interesting life forms.
+  I added another control to the screens.  "-cycles num" influences the
+    time out (it applies to about a 1/3 of the screens, see man pages).
+    For consistency, the meaning of batchcount for qix, life, life3d,
+    and rect was changed.  References to "seconds()" in the screens were
+    removed.  The length of a "cycle" depends on "delay".
+  Multidisplay bug fix for maze, thanks to <epstein_caleb@jpmorgan.com>.
+  AIXV3 with AFS, thanks to <chuck_hines@VNET.IBM.COM>.
+
+2.8
+  No more bomb.c, if you think xlock needs it, let the maintainer know.
+  full_lock rewritten by Dale A. Harris <rodmur@ecst.csuchico.edu> to
+    handle non-login groups as well.
+  fixed a bug in wator, introduced in 2.7.
+  fixed nanosleep bug for delays of 1 second or more.  Nanosleep is now
+    used by default on Solaris.  The Imakefile will have to be modified
+    if using Solaris 2.0-2.2, since nanosleep is not available.
+  I do not know why, but the logout out feature now works on Solaris.
+  Various warnings and errors fixed in make.com, resource.c, logout.c,
+    and galaxy.c for VMS.  Also fixed random generator for VMS not to
+    toggle the least significant bit.  This made worm.c look funny.
+  xlock now works on VMS/AXP thanks to <JOUKJ@CRYS.CHEM.UVA.NL>.  One
+    will have to uncomment sections in make.com .  Also fixed some
+    AIX problems.
+  Modes spiral and geometry thanks to Darrick Brown <dbrown@cs.hope.edu>.
+    Batchcount in maze and spline were changed to behave similarly.
+  A patch from Heath Rice <hrice@netcom.com> for a better way to handle
+    batchcount, delay, and saturation.
+  I went through xlife3.0 huge collection and added "suitable" lifeforms.
+
+2.7
+  sgi patches and logos from Dave Truesdell <truesdel@nas.nasa.gov>.
+  flame bug fixed thanks to <spot@cs.cmu.edu> and
+    <M.R.Dobie@ecs.soton.ac.uk>.
+  MANY patches from Heath A. Kehoe <hakehoe@icaen.uiowa.edu> include:
+    The long awaited HP patch.  It appears there was a bug in HP's XFlush
+    function.  So XSync was substituted.  HP_PASSWDETC patch.
+    maze, swarm, and worm -mono now look better.
+    Many changes to the Imakefile, new compile time features ...
+    including a logout button for labs (this appears to be better
+    implementation than the bomb mode (much of the bomb code has been
+    reused)) -install option to allow xlock to install its own colormap
+    if it runs out of colors.
+  Thanks to <slouken@virtbrew.water.ca.gov> for yet another option:
+    grabmouse for compatibility with xscreensaver.  So you would set
+    your apps-defaults file for xscreensaver like:
+
+*programs:      xlock -nolock +grabmouse -mode random
+
+  Updated life3d to include shooting gliders.
+  BSD and Linux icons slightly modified.  Also new ships for life.
+  Compile time options HAS_RAND, HAS_RANDOM, and HAS_RAND48, and
+    updated the sccsid so `what` will give you something meaningful.
+
+2.6
+  Created a HAS_USLEEP and a USE_VROOT switch.
+    There were numerous reports of the incompatibility with tvtwm,
+    (also problems with windows with StickyAbove set to true and
+    swirl), read the README section on that.
+  Thanks to Chris Ross <cross@va.pubnix.com>, maintainer of tvtwm, for
+    fixing various bugs; make depend for R5 and less, life3d should not
+    have malloc.h, and a time-elapsed patch.
+  A few new life forms for life.c.  Anyone know what SMILEY is really
+    supposed to look like?  :)
+  Revised -inroot does not lock screen, as this is done better with the
+    following patch, and as someone pointed out, its not intuitive.
+  Thanks to Tim Medley for sending the -geometry patch of Mike Peercy
+    <peercy@crhc.uiuc.edu>.  Many of the modes will fail if the windows
+    are far from square or are too small.  You can place Xlock off the
+    screen, for example,
+      xlock -enablesaver -mode blank -geometry +1152+0
+    puts the window off the visible screen on a Sun.
+  A new version of flame.c from the original author Scott Draves
+    <spot@cs.cmu.edu>.
+  Something really devilish for BSD (new icons) thanks to J Wunsch
+    <j@uriah.sax.de>, but they have been modified.  I also created a
+    Linux icon.
+  A patch for Ultrix systems (at least DECstations) running enhanced
+    security thanks to Chris Fuhrman <cfuhrman@vt.edu> and friend.
+  Multidisplay bug fix for life3d and wator, thanks to
+    <epstein_caleb@jpmorgan.com>.
+  Life3d on a monochrome monitor looks a little better. -mono was
+    working right.
+
+2.5
+  A patch for swirl for fixed color maps (more colorful) and the
+    image now spirals outwards from the center with a fixed number of
+    points drawn every iteration, thanks to <M.R.Dobie@ecs.soton.ac.uk>.
+  A patch for blot on dual-headed machines and nanosleep, thanks to
+    Greg Onufer <Greg.Onufer@Eng.Sun.COM>. Use nanosleep on Solaris2.3
+    and greater, examine the Imakefile and/or README for details.
+  A long needed patch for X11R5+ for -delay, -batchcount, and
+    -saturation to work thanks to Patrick D Sullivan <pds@bss.com>.
+  bomb mode patch for more flexibility thanks to Dave Shield
+    <D.T.Shield@csc.liv.ac.uk>.
+  bomb mode patch for Sun10 thanks to Nicolas Pioch <pioch@Email.ENST.Fr>.
+  modes wator and life3d added.
+  life now has a random soup pattern stolen from life3d.
+  -inroot option added, thanks to Bill Woodward <wpwood@pencom.com>.
+    Now more compatible with xscreensaver if run as
+    "xlock -mode kaleid -inroot -nolock".
+
+2.4
+  hopalong now includes a sine hop (but less likely to come up).
+  life now has new organisms. They are now better centered.  Some of
+   the nonperiodic forms were removed.
+   life's gliders now come from the edge of the screen, usually.
+  image now centers icons, for example, the hp icon is now centered.
+  blot now randomly has xsym, ysym, or both.
+  Solaris should now compile out of the box to handle shadow passwords.
+    Thanks to Alain Brossard <brossard@siisun.epfl.ch>.
+  rock, grav, rect, bat, world, bounce and swirl fix for 24 bit colors.
+  Patch for building under HP-UX with Secured Passwords, thanks to
+    Dale Harris <rodmur@ecst.csuchico.edu>.
+
+2.3
+  Now the X Logo displays if not Sun or HP.
+  "bat" mode disastrous bug fixed.  Thanks to R.K.Lloyd@csc.liv.ac.uk
+    for pointing it out.
+  -DMOUSE_MOTION switch added for those who want the Password window to
+    come up if you just moved the mouse. (Not recommended).
+  "swirl" mode was modified to check background, foreground, and black
+    so as not to cycle these colors, special thanks to Mark Dobie
+    <mrd@ecs.soton.ac.uk>.
+  -DFORCEFIXEDCOLORS switch for those who are annoyed by swirl cycling
+    its colors.
+
+2.2
+  Made more consistent with the slackware release.  XLock.ad changes
+    to rock, rotor, and foreground and background colors.
+  Fixed bug in life.c, evident in the Slackware release.
+  Minor patch for swirl on HP's due to R.K.Lloyd@csc.liv.ac.uk.
+  "bat" put back with minor changes.
+
+2.1
+  Large modifications to README.
+  Patch for building under QNX 4.2 w/ Metrolink X server, thanks to
+    Brian Campbell <brianc@qnx.com>.
+
+2.0
+  "swirl" mode was added, thanks to Mark Dobie <mrd@ecs.soton.ac.uk>.
+    WOW, but not-so-neat on monochrome monitors.
+  Patch for Solaris 2.3 for local, NIS, and NIS+ passwords, thanks to
+    <Christian.Iseli@di.epfl.ch>.
+  "image" mode was put back but random will not run it, too boring.
+  "bomb" mode was added, thanks to <D.T.Shield@compsci.liverpool.ac.uk>.
+  In order to use extra-long passwords with the Linux, changed
+    PASSLENGTH from 20 to 64.  Thanks to <slouken@virtbrew.water.ca.gov>.
+
+1.14
+  Multidisplay bug fix for rect, thanks to <epstein_caleb@jpmorgan.com>.
+  Now works on IRIX on the SGI. Thanks to <reggers@julian.uwo.ca>.
+  Now works on NetBSD. Thanks to Greg Earle <earle@isolar.Tujunga.CA.US>.
+  Now works on a Alpha 3000/400 OSF/1 V2.0. Thanks to Udo Linauer
+    <ul@eacpc4.tuwien.ac.at>.
+  "galaxy" mode was added, thanks to Hubert Feyrer
+    <hubert.feyrer@rz.uni-regensburg.de>.
+  "kaleid" mode was added, taken from the Linux version of xkaleid.
+
+1.13
+  "timeelapsed" option was added.  Allows you to find out how long a
+    machine is locked so you can complain to an administrator.
+  Now may work on IRIX on the SGI. Thanks to Thomas Runge
+    <runge@egd.igd.fhg.de>
+  "bat" mode was added, thanks to Lorenzo Patocchi <patol@info.isbiel.ch>.
+
+1.12
+  xlock now works on Linux with shadow passwords.  Special thanks to
+    H. J. Dihu <macgyver@mcs.com>
+
+1.11
+  Shadow passwords and DES encryption are now detected by the Imakefile.
+    Victor Langeveld <vic@mbfys.kun.nl> reorganized the Imakefile for
+    shadow passwords and crypt.  Now should compile "right out of the
+    box" (although there are still problems on Solaris 2.3).
+  Patch to fix sudden rotation changes in rock from Yoshiaki Kasahara
+    <kasahara@csce.kyushu-u.ac.jp>.
+
+1.10
+  R.K.Lloyd@csc.liv.ac.uk reorganized the Imakefile yet again.
+  Fixed a bug in rect.c thanks to <epstein_caleb@jpmorgan.com>.
+  Ditched bzero and bcopy since both are more generally available as
+    memset and memcpy.  Also removed some lint warnings.
+
+1.9
+  "rect" mode was added from xscreensaver's greynetic.
+  "helix" bug fixed.  It is now more interesting.
+  bounce.c divide by zero fixed and grav.c improvements.  Thanks to Greg
+    Bowering <gb@pobox.com>.
+  grav.c, rock.c, world.c fixed so no black objects.
+
+1.8
+  Imakefile did not work with R6.  Also Solaris2.3 may use SVR4
+    instead of SYSV.  Thanks to Chris P. Ross <cross@eng.umd.edu>
+  "grav" mode was added.  Its a simplistic gravitational simulation,
+    with (currently a constant 16) solid spheres (non-rendered) of equal
+    size and mass orbiting a fixed central mass.  The sphere's orbit in
+    3 dimensions, their position and size being projected with simple
+    perspective.  Thanks to Greg Bowering <gb@pobox.com>.
+  "inwindow" option was added.  Allows you to do what xlock already
+    did when DEBUG was defined.  It no longer locks your screen, but
+    allows you to run xlock as a (somewhat distracting) decoration.
+    Thanks to Greg Bowering <gb@pobox.com>.
+  "bounce" mode (football) is back.
+  "world" mode was added.  Thanks to Matthew Moyle-Croft
+    <matthew@moyle-croft.com>
+  "image" mode was removed. It was very similar to world anyway.
+
+1.7
+  cuserid() is needed by Solaris2.3 with shadow passwords in xlock.c.
+    Thanks to Bill <benedett@gentire.com>.
+
+1.6
+  R.K.Lloyd@csc.liv.ac.uk pointed out again that gray_bits in maze.c needs
+    a type cast.
+  xlock.c defaults to "blank" to minimize cpu usage on a network.
+
+1.5
+  xlock works again on VMS (see README.VMS) thanks to Anthony Clarke
+    <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>.
+  memcpy and memset definitions for SYSV. Also there now is a switch
+    for shadow passwords thanks to <reggers@julian.uwo.ca>.
+
+1.4
+  Now works on BSD. Thanks to Victor Langeveld <vic@mbfys.kun.nl>
+  Both Victor and Alexandre Miguel <miguel@natacha.ens-cachan.fr>
+    suggested taking out the cuserid() call in xlock.c.  For FreeBSD its
+    a necessity and the old way is is a security hole in SunOS.
+
+1.3
+  Linux port from Darren Senn's (sinster@scintilla.capitola.ca.us) xlock.
+  Fixed drand to random in helix.c
+  Fixed a memory leak in rock.c.
+
+1.2
+  SHIFT - CONTROL - BREAK on the HP is trapped. Thanks to
+  R.K.Lloyd@csc.liv.ac.uk who pointed out that this was done in xscreensaver.
+  AIXV3 and HP bugs fixed, again due to R. K. Lloyd.
+
+1.1 & 1.0
+  took out "rint" from "worm.c" since HP's have trouble with it
+  added spline, maze, sphere, hyper, helix, rock, & blot modes.
+  fixed "xlock.h" and "usleep" for the HP.
+  changed border so it varies with size of screen on "swarm" so the
+    wasp would not be stuck in a corner when the password is entered.
+
+-------------------------------------------------------------------------------
+
+Original author: Patrick J. Naughton
+Site: ftp.x.org in /R5contrib
+The changes in the original xlock
+
+Changes of xlock (sccs version 23.21) patchlevel = 2.3
+    o added worm mode.
+    o old -name and .name changed to -username and .username.
+    o lint cast.
+    o change color allocation to allow "#ffaabb" style color names.
+    o portability bug in flame mode fixed plus some other nits.
+    o white on black on monochrome screens fixed.
+Changes of xlock (sccs version 23.19) patchlevel = 2.2
+    o added -name to allow different resource files to be used.
+    o added -usefirst to allow first keystroke to be used in password.
+    o made changes to life mode to allow wrap around.
+    o made old life cells stay blue.
+    o added -resources to get default resource file.
+    o added random mode
+    o added pyro mode
+    o added flame mode.
+    o made passwords a little more secure.
+    o use effective uid to find current user.
+    o make main window managed by the wm in debug mode.
+    o some more SVR4 portability changes.
+    o resource code now looks at XUSERFILESEARCHPATH and XAPPLRESDIR.
+    o removed verbose copyright info from each file.
+
+-------------------------------------------------------------------------------
+
+ Copyright (c) 1988-91 by Patrick J. Naughton.
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation.
+
+ This file is provided AS IS with no warranties of any kind.  The author
+ shall have no liability with respect to the infringement of copyrights,
+ trade secrets or any patents by this file or any part thereof.  In no
+ event will the author be liable for any lost revenue or profits or
+ other special, indirect and consequential damages.
+
+    ______________________________________________________________________
+    Patrick J. Naughton                                   email: naughton@sun.com
+    Sun Microsystems Laboratories, Inc.                   voice: (415) 336 - 1080
+
+Maintainer: David A. Bagley <bagleyd@tux.org>
diff --git a/docs/TODO b/docs/TODO
new file mode 100644 (file)
index 0000000..88aa351
--- /dev/null
+++ b/docs/TODO
@@ -0,0 +1,495 @@
+General problems:
+  o For security (Theo de Raadt <deraadt@cvs.openbsd.org>)
+    - in initpasswd()
+
+    - create two pipes
+    - fork a child
+        - read a password from the pipe
+        - do a check
+        - write a 1 or a 0
+        loop
+
+    - have the parent revoke it's uid's completely.
+        - use one pipe to send passwords to the child
+        - read for 0 or 1
+        - use SIGCHLD to detect child exit
+
+  o Switching consoles using XFree-4.0, the X server sends a fully-obscured
+   event to all its clients, and when I switch back to the graphical
+   terminal, it sends fully-visible or partially-obscured event to its
+   clients.  xlock doesn't handle these event, it still can consume 99% of
+   CPU time in several lock-modes. It would be really good if xlock, when
+   receiving an obscure-event, stopped doing anything CPU-consuming stuff.
+
+   The three messages (fully visible, partially visible and fully obscured)
+   exist in X11 for a long time. Launch the utility 'xev' and move another
+   window over it, and see what it prints. This is useful so that
+   applications (such as fractal animators or Spectrum/C64 emulators or
+   really anything) know if its window is not visible and therefore can save
+   a lot of cpu time if it doesn't even want to draw (update) its contents.
+   For example there's a spectrum emulator at
+   http://www.inf.bme.hu/~mszeredi/spectemu/spectemu.html, if you launch this
+   and switch to full speed mode, you'll see that it runs much faster if its
+   window is obscured by another window or windows.
+
+   Using the XFree-3.3 servers if you switched back to the linux console, no
+   events were sent to the applications, so they couldn't realize that thier
+   contents is not visible to the user in this case. In XFree-4.0 the windows
+   get the fully-obscured event when you switch to linux console, so for
+   example a Spectrum emulator can save really a lot of cpu time, since it
+   doesn't need to redraw its screen 50 times per second.
+
+  o It would be nice to have an option -idletime time.  Where xlock would
+   run after a certain idle time.  (Here xautolock may help you, see
+   above).
+
+  o If an user tries to log in, and his password is wrong,
+   and the input password doesn't has lower-case letters,
+   but upper-case letters, the the message is printed:
+   "Password invalid - please check if SHIFT LOCK is enabled".
+   (It should be possible also to check directly for SHIFT LOCK,
+   I think, but probably more work..)
+
+  o xscreensaver compatibility
+    2 of the writable modes: mandelbrot, tube-> get them to RUN (compile OK)
+    XPM  capability needs to be improved.
+
+  o Add a way to get xlock to switch to "blank" mode after X minutes
+    of (keyboard) inactivity, and to switch back to whatever mode list was
+    being used when activity is detected.  This would be good for
+    users using DPMS to power down the monitor without using precious cpu
+    when the modes are not visible.
+
+  o configure.in should be condensed.  Its getting out of hand.
+
+  o Look into any way of not clearing the screen if can not get control of it
+     (2nd xlock running).
+
+  o gentlerandom mode option.  Switching to next mode when mode completed
+      what it was working on.
+
+  o On a PsuedoColor display
+      xlock -mode life -install &
+      sleep 5 ; xlock -mode life -install
+    Colors will all be messed up after the second one tries to run.
+    This can easily happen if you are using xautolock and decide to lock
+    the display manually.
+
+  o -wireframe should be a mode option (i.e. you should be able to turn it
+    on and off for a particular mode).  Also a linewidth mode option would be
+    nice
+
+  o I got an error with moebius running it on opengl on a 24 bit TrueColor like:
+    xlock -mode moebius -visual PseudoColor
+    (all the gl modes are messed up anyway... all mono)
+
+  o some configurations of linux: swarm and flow has noise when bees go
+    beyond screen (also may happen with forest).
+    Sun Ultra5 PCI Bus 24 bit display: flow has some noise (usually red)
+    This is especially true if you use -inwindow for swarm, flow, euler2d.
+
+  o A few uninitialized memory reads and memory leaks were detected in some
+   of the code.  grep for "PURIFY" in the source files to see where the
+   remaining problems are.  Also see docs/Purify for more details.
+
+  o  -showfps option may give a Zero Page Read and SEGV error using Mesa
+     and Sun
+
+  o superquadrics does not work on some Linux boxes (not mine).
+
+  o Text3d will dump core on some linux boxes (not mine) due to random font
+   routine.  Temporary solution: use arial.ttf directly.  See "#if 0" in
+   text3d.cc.
+
+  o glplanet does not stars clearly on Sun with OpenGL except when in
+   password window (Sun with Mesa ok).
+
+  o glplanet.c, i_spline.cc, molecule.c exit code should be recoded
+
+  o gears.c, lament.c , moebius.c, molecule.c sierpinski3d.c tube.c decay.c
+   goop.c abort code should be recoded.
+
+  o molecule logs me out on Sun Ultra 5 with OpenGL 1.2.1 and 1.2.2
+   (using gcc or cc) when the return key is held down.  This has not
+   been repeated on any other Sun.  Tracing on this seems to indicate
+   the release code but when commented out would still die (done
+   with XSynchronize on).
+
+  o -mono does not work for XPM (they just use XBM when mono), also cage
+   and stairs.
+
+  o Not all resources are listed in "xlock -resources", e.g. nolock.
+   If xlock is renamed these resources are not picked up.
+
+  o Without any programs stealing your colors, like netscape
+   xlock -modelist all -sequential -install -verbose
+   Hit the middle button a hundred times (not to bad on an ultra actually)
+   or try -duration 1 and let it sit for a while.
+   The second time it runs the GL modes they have all lost some colors.
+   This was only noticed on Solaris with pseudocolor.  Also noticed on an
+   ancient HP9000/380 HPUX9.0 with 6 bit depth (without netscape).
+
+  o On a German keyboard and Linux if the password contains special
+   characters (`|' vertical bar, `@' at-sign) while in debug mode
+   everything works fine. This probably has something to do with the
+   X11-keymapping, as these characters are composed with the right Alt-key
+   on a German keyboard.
+
+  o OpenGL and DT may be incompatible on PseudoColor.  (MesaGL should be
+   OK.)  OpenGL frequently causes xlock to error out on non-default visuals.
+
+  o -visual DirectColor if used with any of the with the writable modes
+   (mandelbrot, swirl, or tube) may corrupt the dynamic allocation of memory.
+
+  o Errors in modes, if any, should not break lock.
+
+  o Compile-time option to allow running of separate processes.
+
+  o make -n install prefix=/foo/bar does not work.
+
+  o "xlock -mode random -modelist image -bitmap ./bitmaps/"
+   It should change images when middle mouse is pushed or when
+   -duration time runs out.
+
+  o some sort of completion is used which may be confusing on UNIX
+   Say if a ../bitmaps directory exists and ../bitmap does not
+   xlock -mode random -modelist image -bitmap ../bitmap
+   will try to load ../bitmaps as a file...
+
+  o kill -HUP to change modes as well as middle mouse button.  Needed when
+   using -inroot .
+
+  o jpeg/gif/animated gif support  Fix ras for > 8 bit TrueColor
+
+  o "-visual" commandline argument should accept "best" as well as
+   PseudoColor, TrueColor, default, etc.
+
+  o Is there any chance the "visual" selection code could be made
+   mode-dependent?  Most Xservers that support TrueColor, etc, visuals also
+   support PseudoColor visuals and it would be nice to have color-cycling
+   modes like "starfish" and "swirl" pick a PseudoColor visual if available,
+   while xpm modes could prevent colormap flashing by picking a TrueColor
+   visual.
+   I heard that VisualDepthMask taken out of vis.c it seems to work better
+   to get a PseudoColor visual one a root window of 24 bits.
+
+  o  From Duncan Simpson <dps@io.stargate.co.uk>
+
+Due to the introduction of Xinerama, and a couple of monitor displays, I would
+find a horizontal fivision option that runs two windows each half the width
+of the display (which corresponds to one window one each monitor).
+
+I do not know the details of x2x, although I guess various sorts of multiple
+monitor technology might benefit from this sort of support (one could think
+of Xnest with re-direction to appropiate screens).
+
+Information on x2x is almost certainly somewhere on the web, but I do not 
+have a URL on me (ask your favorite search engine, I guess). I think it 
+involves using multiple boxes for display driving purposes---I hear someone in 
+the lab has 4 screens across with x2x (the pointer moves off one screem onto 
+another). Xnest is an xserver that asks a parent X server to do the work, and 
+I think you can use it to present different display information and so forth.
+
+Xinemera is much easier, it basically just glues mutliple bits of hardare 
+together into a single huge bit of virtual hardware. It does not appear in the 
+extensions list. xlock just sees a single display with 2304x900 pixels on my 
+system, which is actually 2 screens 1152x900 each.  AFAIK there is no easy way 
+to detect Xinemera modulo strange aspect ratios and the like (e.g. my display 
+is suspicously wide, assuming I am using conventional display hardware). 
+Recycled 1990 SUN monitors are conventional, albeit rather pickier about the 
+video signal that one expects these days.
+
+I was thinking I could add -hdiv 2 and would xlock use half the display width, 
+in my case 1152, as the width of an appropiate number of windows (2 for half 
+width). One could think of a maximum window width, with the code generating an 
+appropiate number of windows, for a similar effect. I image neither option 
+would involve vast amounts of code or internal changes.
+
+Actually, on a more careful analysis Xinereama is listed in the extensions and 
+in extensions/Xinerama.h I see the following functions
+
+Bool XineramaIsActive(Display *dpy);
+XineramaScreenInfo * 
+XineramaQueryScreens(
+   Display *dpy,
+   int     *number
+);
+
+XinermaScreenInfo is a structure that contains screen number, x and y origin, 
+width and height (one per head, judjing by the function prototype). The 
+extension is not supported everywhere but feature test macros or autoconf 
+should cope. Imake apparently includes
+
+#define XineramaDefines -DPANORAMIX
+
+if you have the support (and presumably this means you have the header too). 
+My proposal would be less elegant.
+
+~$ gcc -o xintest.^H ci^H^Hxintest.c -:^HL/usr/X11R6/lib -lX11 
+=^H-lXext -lXinerama
+~$ ./xintest 
+Xinerama supported: event base 0, error base 0
+Xinerama active
+There are 2 heads
+Head 0: screen 0 size  1152x900 starting at 0,0
+Head 1: screen 1 size  1152x900 starting at 1152,0
+~$ exit
+
+Script done on Sat Apr 15 19:25:46 2000
+
+Which has interesting effects in ink blot mode (50% of the ink blot on each 
+screen, not indeal). Modes dewsned for about 4x3 suffer quite badly from 
+stretching pn 2304x900... hence my desire for a version aof xlockmore aware of 
+the screen boundaries.
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/extensions/Xinerama.h>
+
+int main(void)
+{
+    Display *dpy;
+    int xin, ev, err, i, nh;
+    XineramaScreenInfo *scr;
+
+    dpy=XOpenDisplay("");
+    xin=XineramaQueryExtension(dpy, &ev, &err);
+
+    if (!xin)
+    {
+        printf("Xinerama not avialable\n");
+        XCloseDisplay(dpy);
+        return 0;
+    }
+    printf ("Xinerama supported: event base %d, error base %d\n",
+            ev, err);
+
+    printf("Xinerama %sactive\n", XineramaIsActive(dpy) ? "" : "in");
+    
+    if ((scr=XineramaQueryScreens(dpy, &nh))!=NULL)
+    {
+        printf("There are %d heads\n", nh);
+        for (i=0; i<nh; i++)
+        {
+            printf ("Head %d: screen %d size  %dx%d starting at %d,%d\n",
+                    i, (scr+i)->screen_number,
+                    (scr+i)->width, (scr+i)->height,
+                    (scr+i)->x_org, (scr+i)->y_org);
+        }
+        XFree(scr);
+    }
+    XCloseDisplay(dpy);
+    return 0;
+}
+
+
+  o modes from xscreensaver :) : bubbles, moire, LMorph, halo, ImsMap, BlitSpin
+
+
+Mode specific problems:
+----------------------
+  Various modes need better refresh capability.
+  Various modes need more mouse capability like pacman and worm.
+
+  ant:
+    round ants.  This would involve masking and images to do efficiently.
+    3d version? may be hard to see interior though.
+
+  ball: can it be updated to use a pixmap instead of a slow circle fill?
+
+  braid: should be made so that it can be interrupted quicker.
+
+  bouboule: always starts at the bottom right
+
+  bounce:
+    sometimes a ball does not roll off another ball.
+    momentum seems to be created.
+    A -wall option, multiscreens should have balls bouncing between
+      screens.
+    -mode bounce -inroot may give BadWindow in X_GetWindowAttributes
+      if run for a while, but the screen is not locked :)
+    allow a background picture to be seen behind the bouncing football
+      (soccer ball) in "bounce" mode.  Thus a picture of your favorite
+      team, etc. can be seen behind the bouncing balls.
+    football version of "bounce" using a pigskin instead of a soccer ball for
+      Americans/Canadians/etc.
+    Different balls with different mass and size.
+
+  bug:
+    3d version?
+
+  dclock: needs a -led [LED] option
+
+  ico:
+    should have all the features of the original.
+    triangular face objects do not look good when rotated.
+
+  image: middle button should do something when called like
+     "-bitmap ./bitmap/"
+
+  flag:
+    sometimes a refresh causes a white background rectangle
+
+  hop: center and size many of the hops.
+
+  life:
+    -find option to find new lifeforms.  (mail the results out :) ).
+    When the bitmap is big it is rejected.  Probably could be handled
+      better but if accepted then the screen could be blank because there
+      are bitmaps that are off screen.
+
+  life3d: draws invisible cubes when it does not have to.  The original
+    MS DOS code weeded this out, but it did not seem to port to X.
+    Also see life.
+
+  lyapunov: needs to be speeded up
+
+  marquee:
+    "-messagefile filename" truncates a large file.
+    "-message string" does not handle Control-H correctly.
+    fallback font if screen is small... like bomb
+
+
+  mountain: -size # for mountain should do something.
+
+  nose:
+    should handle Control-H better for underlining and accents.
+    fallback font if screen is small... like bomb
+
+  pacman: add (varying but left/right symmetric) maze walls
+
+  pyro: needs XDrawSegments code similar to swarm to give it depth.
+
+  slip:
+    should be less jarring
+    get rid of single color blotch.
+    should be made so that it can be interrupted quicker.
+
+  star:
+    fractal cracks when hit by rocks (with sound?)
+    user defined ships (user defined pixmaps like eyes and pacman).
+    stars should look more star-like "*"'s
+    combine space and star for a backwards and sideways motion
+
+  swirl:
+    needs to be refreshed quicker
+    does not refresh well when colormap changes
+
+  text3d:
+     time stuff in text3d
+     maybe dclock and marquee could be combined too?
+     a separate -message3d for text3d
+
+  voters and wator:
+    neighbors option bug ... sometimes circles are not
+      drawn in the correct spot.
+    A -/+ wrap option would be nice also.
+
+  wire:  it needs a better circuit generator.
+
+  xglock:  Needs a lot of work.
+
+  kscreensaver:  port xlock to KDE.
+
+
+New mode ideas... (some may be very hard :) ):
+---------------------------------------------
+  o "bsdworm" BSD worm game with computer (and later mouse control), also
+      have more than one worm
+  o "dead" a Grateful Dead mode with dancing bears/skeletons/turtles.
+      (Or maybe "nose" in a tie die?)
+  o "floyd" a Pink Floyd mode from the cover of "Dark Side of the Moon"
+      with a turning prism and rainbow effect.
+  o "graph" a random planar graph drawn ... filled in by a 5 (or 4 :) )
+      coloring algorithm.
+  o "mail" show that one has mail (can also be an option on flag, image, etc.)
+      A spinning GL mailbox would be really cool.  Note that the password
+      screen can be setup to show if one has mail.
+  o "minimal" a random minimal surface generator.
+  o "pangea" a mode showing the changes to the earth's surface over
+      millions of years.
+  o "snow" mode with a nice Winter scene picture background and snowflakes
+      falling
+  o "soap" mode showing soap films
+  o "squig" mode from squig/xsquig (xsquig is too slow)
+  o "venus" mode showing the transformation of a Etruscan Venus to a
+      Roman surface to a Boy surface to a Ida surface, back into a
+      Etruscan Venus using GL.  This is a 3D shadow of a 4D Klein Bottle
+      (which in turn is a a 3D moebius strip).
+      (Science News October 24, 1987 Vol 132, No 17.)
+  o Simulations like sandpile avalanches or forest fires.
+      (Science News July 15, 1989 Vol 136, No 3.)
+  o A NT-like GL 3D Maze, where you are inside the maze
+  o NT-like GL FlowerBox spring and Flying Objects
+  o A GL 4D ico where the 6 4D "platonic" objects "roll" around in 3D space.
+  o GL modes based on demos: isosurf, reflect, bounce, stex3d
+  o KitCat (R) clock mode (based on X11 catclock, a version of xclock) where
+     the cat clock floats around the screen like "dclock" mode does.  Colors
+     of cat clock could be picked like nose-guy in "nose" mode.
+  o Lottery with bouncing numbered balls like PowerBall.
+  o A simple set of 2D geometric shapes that morph into one another whilst
+     colour cycling. So say you start with a rectangle that morphs into a
+     circle (leaving a small trail like Qix) that morphs into a triangle
+     that morphs into a polygon that morphs into a rectangle, etc.  All the
+     while you have movement and colour cycling like Qix.  If the trail is to
+     large then things could become messy, but if too short then you loose the
+     history element.
+  o A simple bouncing ball on a chess board. The ball is a silver
+     ray-traced/rendered globe. The chess board is a series of black and
+     white squares. Each black square is gold veined marble with the gold
+     glinting. Each white square is a textured surface (like little bumps, or
+     ridges). The whole screen is lit from two light sources (either fixed or
+     moving). As the ball bounces it reflects like a mirror what is around it.
+  o A variant of the above would be to hold that ball still in the centre of
+     the screen and move a randomly chosen bitmap around the ball.
+  o The above could also have embossed on standout lettering added (say a
+     single word like Linux). The lettering could either be stationary or
+     float around the ball in orbit a bit like the the Universal studios logo
+     where the Universal name revolves around a picture of the earth.
+  o Take pipes and add the constantly moving view point that you get with
+     rock so the mass of pipes seems to revolve and rotate around a moving
+     point in space.
+  o Make the little man in Nose seem to carve the letters of the message into
+     rock, or paint them on the screen.
+  o Make marquee use 3D extruded text that can be texture mapped and seem to
+     zoom into and out of the screen with the zoom source point drifting
+     around the screen at random
+  o Make puzzle take the present desktop image, invert it and shuffle the
+     pieces then put the whole things back. Once it has reassembled the
+     desktop you could have the image flip top over bottom as it reseeds into
+     the screen, only to have a new randomly shuffled version of the desktop
+     flip back out.
+  o Use the spheres generated in sphere to draw molecules on the screen,
+     colour coding for the various types of atom present. A limit on the size
+     of each sphere would be needed. The spheres could be joined by simple
+     white lines. If you are feeling adventurous you could make it seem to
+     rotate in space so all parts of the molecule could be seen.
+  o In shape change things so that the shapes appear to be extruded from a
+     random point on the screen. You could also have a number of shapes be
+     extruded, each from its own origin, only to shrink back into the screen
+     again.  Each time a shape shrinks back into the screen the origin would
+     move and a new shape would be chosen.
+  o When the screensaver is started have curtains drawn across the desktop
+     at a medium pace, a second or twos pause then the curtain a pulled open
+     quickly to reveal a bitmaped image in place of the desktop. This cycles
+     with a different image each time.
+  o In pyro have the fireworks appear to zoom from a randomly choose point on
+     the screen. This would give the effect of the display being seen from
+     above.
+
+PLEASE NOTE:
+-----------
+  I _REALLY_ hate to turn down contributions...  I will try to consider
+   all submissions.  Some things on new modes that bother me are:
+   Did not black out the screen when they start.  I do not like people
+     to see what I am doing. :^|  (This could be a non-default option...
+     see decay mode).
+   Did not work in the little window or buggy.  (I usually try to clean
+     it up).
+   Is too similar mode to a mode that already exists. (Maybe an option could
+     be added on an existing mode?).
+   Many people complained about the mode.
+   Just not enough randomness or is not interesting enough.
+   No multiscreen support (I usually try to clean this up too).
+  But I labor over them (in a haphazard fashion) and they usually are
+   released eventually.  (If they are in assembler I would definitely need
+   a working example and all the binaries and libraries to get it to run.)
diff --git a/docs/cell_automata b/docs/cell_automata
new file mode 100644 (file)
index 0000000..56c03aa
--- /dev/null
@@ -0,0 +1,169 @@
+There are a few modes devoted to cellular automata.
+I also added a bunch of options.  So I am providing a little explanation
+so it is not overwhelming.  I also say a little something at the top of the
+C file of each.  If your favorite little automaton is not here (or you think
+it should be enhanced)... let me know.
+The modes are ant, bug, demon, dilemma, life, life1d, life3d, loop, voters,
+wator and wire.
+use -install if netscape is stealing all your colors... :)
+"xlock -help" may be helpful too.
+
+ant: Turing Machines where the tape is the screen.
+ Special options:
+  -truchet: this shows the path (good to use with -size at
+    least 10)  Truchet option turned off if its not Turk's ants.
+
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: number of ants
+  -cycles <int>: how many cycles before a new ant
+  -size <int>: size of ant in pixels
+
+  -eyes  eyes on ant (did not bother for -neighbors 12)
+    eyes are backwards on triangular ants (easier to place them).
+  -neighbors <int>: 0 random, 4 & 8 ants, 3, 6, & 12 bees (9 seemed hard
+    to make consistent, but since 3 was done, there should be a way...)
+  -verbose: verbose help identify ant  (good to use with -inwindow or -debug)
+
+bug: Evolving bugs (big squares) learn to walk straight (except in the garden)
+   to pick up bacteria food (little squares) unlike other modes there is no
+   wrapping (this to me is logical because its like the bug is in a glass
+   jar)
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: number of bugs
+  -cycles <int>: how many cycles before a new world
+  -size <int>: size of bug in pixels
+
+  -eyes  eyes on bug
+  -neighbors <int>: 0 random, 4 & 8 rectangular, 6 hexagonal, 3 & 12
+    triangular (9 seemed hard to make consistent, but since 3 was done,
+    there should be a way...)
+
+demon: A simple modulo automata
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: number of states
+  -cycles <int>: how many cycles before a new screen
+  -size <int>: size of cell in pixels
+
+  -neighbors <int>: 0 random, 4 & 8 rectangular, 6 hexagonal, 3, 9 & 12
+    triangular
+
+dilemma: Happy (good) and Mean (bad) cells compete for domination
+ Special options:
+  -conscious: (default) uses its own state in calculation of payoff
+  +conscious: does not use its own state in calculation of payoff
+  -bonus <flt>: payoff for defecting
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: number of bad or defecting initial cells
+  -cycles <int>: how many cycles before a new screen
+  -size <int>: size of cell in pixels (mean faces and happy faces become
+    polygons and circles if not 0)
+
+  -neighbors <int>: 0 random, 4 & 8 rectangular, 6 hexagonal, 3, 9 & 12
+    triangular (mean faces and happy faces become polygons and circles if
+    not 4 or 8)
+
+life:
+ Special options:
+  -rule <string>: survival and birth parameters formated
+    S<neighborhood>/B<neighborhood>, so Conways rule is S23/B3.
+    Two format exceptions:
+      -rule P:  Picks a random rule from all rules that have known patterns
+      -rule G:  Picks a random rule from all rules that have known gliders
+  -callahan: Paul Callahan's B2a/S2b34 hexagonal life
+  -andreen: Bob Andreen's B2a3a4b/S2a2b4a hexagonal life
+  -lifefile <filename>: only the #P format of xlife
+    There is a limit of 128 initial live cells set by NUMFILEPTS in life.c.
+
+ Mode options:
+  -cycles <int>: how many cycles before a new lifeform
+  -batchcount <int>: number of cycles before glider (if one exists)
+  -delay <int>: controls the length of a cycle in microsec
+  -size <int>: size of cell in pixels, if 0 may default to bitmap
+
+  -neighbors <int>: 0 random, 4 & 8 rectangular, 6 hexagonal, 3, 9 & 12
+    triangular
+  -verbose: verbose help identify life (to be referenced with the source code)
+    (good to use with -inwindow or -debug)
+
+life1d: 1 dimensional life
+ Special options:
+  -totalistic: (default) totalistic 1d life
+  +totalistic: LCAU collection  These rules may not be symmetric and are
+    more general (totalistic is a subset).
+
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -cycles <int>: how many pages before a new lifeform
+  -size <int>: size of cell in pixels, if 0 may default to bitmap
+
+  -verbose: verbose to help identify life (to be referenced with the source
+    code) (good to use with -inwindow or -debug)
+
+life3d: 3 dimensional life
+ Special options:
+  -rule3d <string>: survival and birth parameters formated
+    S<neighborhood>/B<neighborhood>, so Bays' rules are S45/B5, S567/B6,
+    S56/B5, and S67/B67.  There is currently no way of accessing the
+    neighborhoods 10 to 27.
+    Two format exceptions:
+      -rule3d P:  Picks a random rule from all rules that have known patterns
+      -rule3d G:  Picks a random rule from all rules that have known gliders
+  -life3dfile <filename>: similar to the #P format of xlife, 3 integers are
+    required to center, sequential linefeeds imply a depth change
+    There is a limit of 84 initial live cells set by NUMFILEPTS in life3d.c.
+
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: number of cycles before glider (if one exists)
+  -cycles <int>: how many cycles before a new lifeform
+
+  -verbose: verbose to help identify life (to be referenced with the source
+    code) (good to use with -inwindow or -debug)
+
+loop: Chris Langton's loops, its always the same but oriented 4 ways
+    this is far as I know is the best example of a self-generating life form.
+    Caution: this may cause you to question G-d's existence. :)
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -cycles <int>: how many cycles before it starts over
+  -size <int>: size of cell in pixels
+
+  -neighbors <int>: 0 random, 4 rectangular, 6 hexagonal
+
+voters: your political belief is influenced by your neighbor
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: number of parties 2 or 3 (3 may not be available)
+  -cycles <int>: how many cycles before a new world starts
+  -size <int>: size of cell in pixels (elephants and donkeys become
+    squares and circles if not 0, hammer/sickle unavailable)
+
+  -neighbors <int>: 0 random, 4 & 8 rectangular, 6 hexagonal, 3, 9 & 12
+    triangular (elephants and donkeys become squares and circles if
+    not 4 or 8, hammer/sickle unavailable)
+
+wator: sharks and fish on a water torus planet
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: breed time for the fish
+  -cycles <int>: how many cycles before a new world starts
+  -size <int>: size of cell in pixels (sharks and fish become polygons
+    and circles if not 0)
+
+  -neighbors <int>: 0 random, 4 & 8 rectangular, 6 hexagonal, 3, 9 & 12
+    triangular (sharks and fish become polygons and circles if not 4 or 8)
+
+wire: (this mode lacks a good circuit generator)  unlike other modes there
+   is no wrapping
+ Mode options:
+  -delay <int>: controls the length of a cycle in microsec
+  -batchcount <int>: length of random circuit
+  -cycles <int>: how many cycles before a circuit
+  -size <int>: size of cell in pixels
+
+  -neighbors <int>: 0 random, 4 & 8 rectangular, 6 hexagonal, 3, 9 & 12
+    triangular
diff --git a/docs/xlock.hlp b/docs/xlock.hlp
new file mode 100644 (file)
index 0000000..27e56eb
--- /dev/null
@@ -0,0 +1,1646 @@
+1 
+
+
+xlock - Locks the  local  X  display  until  a  password  is
+entered.
+
+xlock [ -help ] [ -version  ]  [  -resources  ]  [  -display
+displayname  ] [ -visual visualname ] [ -name resourcename ]
+[ -mode modename ] [ -delay usecs ] [ -batchcount  num  ]  [
+-count  num ] [ -cycles num ] [ -ncolors num ] [ -size num ]
+[ -saturation value ] [ -erasemode modename ] [  -erasedelay
+usecs  ] [ -/+allowaccess ] [ -vtlock modename ] [ -/+nolock
+] [ -/+inwindow ] [ -/+inroot ] [ -/+remote ] [ -/+mono ]  [
+-/+allowroot ] [ -/+debug ] [ -/+description ] [ -/+echokeys
+] [ -/+enablesaver ] [ -/+resetsaver ] [ -/+grabmouse ] [  -
+/+grabserver  ] [ -/+install ] [ -/+mousemotion ] [ -/+sound
+] [ -/+timeelapsed ] [ -/+usefirst ] [ -/+verbose ] [  -nice
+level  ] [ -lockdelay seconds ] [ -timeout seconds ] [ -font
+fontname ] [ -planfont fontname ] [ -bg color ] [ -fg  color
+]  [  -background  color ] [ -foreground color ] [ -username
+string ] [ -password string ] [ -info string ]  [  -validate
+string   ]  [  -invalid  string  ]  [  -geometry  geom  ]  [
+-icongeometry geom ] [ -glgeometry geom ] [ -/+wireframe ] [
+-/+showfps  ] [ -fpsfont fontname ] [ -/+fpstop ] [ -/+use3d
+] [ -delta3d value ] [ -none3d color ] [ -right3d color ]  [
+-left3d color ] [ -both3d color ] [ -program programname ] [
+-messagesfile formatted-filename ] [ -messagefile filename ]
+[  -message  string  ]  [  -messagefont fontname ] [ -bitmap
+filename ] [  -cpasswd  crypted-password  ]  [  -forceLogout
+minutes  ]  [  -logoutButtonLabel textstring ] [ -logoutBut-
+tonHelp textstring ] [ -logoutFailedString textstring ] [  -
+/+dtsaver  ]  [  -modulepath  path ] [ -locksound string ] [
+-infosound string ] [ -validsound string ]  [  -invalidsound
+string  ]  [  -startCmd  string  ]  [  -endCmd  string  ]  [
+-logoutCmd string ]
+
+xlock locks the X server till the user enters their password
+at  the  keyboard.   While  xlock is running, all new server
+connections are refused.  The screen saver is disabled.  The
+mouse  cursor  is  turned  off.  The screen is blanked and a
+changing pattern is put on the screen.  If a key or a  mouse
+button is pressed then the user is prompted for the password
+of the user who started xlock.
+
+2 If the  correct  password  is  typed,  then  the  screen  is
+unlocked  and  the  X  server  is restored.  When typing the
+password Control-U and Control-H  are  active  as  kill  and
+erase  respectively.   To return to the locked screen, click
+in the small icon version of the changing pattern.
+
+2 In  the  lower  part  of  the  password  screen  a  text  is
+displayed.  This message is taken from the first file of the
+following that exists:   $HOME/.xlocktext,  $HOME/.plan,  or
+$HOME/.signature.
+
+2 On systems which support new BSD style  authentication,  the
+password may be prefixed by an authentication style followed
+by a colon (i.e. "style:password").  See  the  login.conf(5)
+for more information on authentication styles.
+
+2 NOTE_ON ETIQUETTE
+2 Xlock should not be used on public terminals when there is a
+high demand for them.
+
+2 If you find a  public  terminal  that  has  been  locked  by
+another user and there are no other terminals available, and
+the terminal appears to have been  left  idle  for  a  while
+(normally  more than 15 minutes), it is fair to try to reset
+the session in some manner.
+
+2 OPTIONS
+-help
+     Print options and a brief description to standard  out-
+     put.
+
+-version
+     Print version number (if >= 4.00) to standard output.
+
+-resources
+     Print default resource file to standard output.
+
+-display displayname
+     The display option sets the X11 display to lock.  xlock
+     locks all available screens on a given server, and res-
+     tricts you to locking  only  a  local  server  such  as
+     unix:0,  localhost:0,  or :0 unless you set the -remote
+     option.
+
+-visual visualname
+     visualname which is one of  "StaticGray",  "GrayScale",
+     "StaticColor",        "PseudoColor",       "TrueColor",
+     "DirectColor", or "default".  default used to  set  the
+     screen's  default  visual  (the visual of the root win-
+     dow).
+
+-name resourcename
+     resourcename is used instead of XLock when looking  for
+     resources to configure xlock.
+
+-mode modename
+
+     As of this writing there are over 90 display modes sup-
+     ported  (plus  one  more for random selection of one of
+     these).
+
+ant     Shows Langton's and Turk's generalized ants.
+
+atlantis
+        Shows  moving  sharks/whales/dolphin.   May  not  be
+        available depending on how it was configured.
+
+ball    Shows bouncing balls.
+
+bat     Shows bouncing flying bats.
+
+blot    Shows Rorschach's ink blot test.
+
+bouboule
+        Shows Mimi's bouboule of moving stars.
+
+bounce  Shows bouncing footballs.
+
+braid   Shows random braids and knots.
+
+bubble  Shows popping bubbles.
+
+bubble3d
+        Shows Richard Jones's GL bubbles.  May not be avail-
+        able depending on how it was configured.
+
+bug     Shows Palmiter's bug evolution and a garden of Eden.
+
+clock   Shows Packard's oclock.
+
+coral   Shows a coral reef.
+
+crystal Shows polygons in 2D plane groups.
+
+daisy   Shows a meadow of daisies.
+
+dclock  Shows a floating digital clock or message.
+
+deco    Shows art as ugly as sin.
+
+demon   Shows Griffeath's cellular automata.
+
+dilemma Shows Lloyd's Prisoner's Dilemma simulation.
+
+discrete
+        Shows various discrete maps.
+
+dragon  Shows Deventer's Hexagonal Dragons Maze.
+
+drift   Shows cosmic drifting flame fractals.
+
+cage    Shows the Impossible Cage, an Escher-like GL  scene.
+        May not be available depending on how it was config-
+        ured.
+
+euler2d Shows a simulation  of  2D  incompressible  inviscid
+        fluid.
+
+eyes    Shows eyes following a bouncing grelb.
+
+fadeplot
+        Shows a fading plot of sine squared.
+
+fire    Shows a 3D fire-like image.  May  not  be  available
+        depending on how it was configured.
+
+flag    Shows a waving flag image.  This may be  text  or  a
+        graphic  image.   Default  text  is the hostname and
+        operating system.
+
+flame   Shows cosmic flame fractals.
+
+flow    Shows dynamic strange attractors.
+
+forest  Shows binary trees of a fractal forest.
+
+galaxy  Shows crashing spiral galaxies.
+
+gears   Shows GL's gears.  May not be available depending on
+        how it was configured.
+
+glplanet
+        Animates texture mapped sphere (planet)
+
+goop    Shows goop from a lava lamp.
+
+grav    Shows orbiting planets.
+
+helix   Shows string art.
+
+hop     Shows real plane iterated fractals.
+
+hyper   Shows spinning n-dimensional hypercubes.
+
+ico     Shows a bouncing polyhedron.
+
+ifs     Shows a modified iterated function system.
+
+image   Shows randomly appearing logos.
+
+juggle  Shows a Juggler, juggling.
+
+julia   Shows the Julia set.
+
+kaleid  Shows Brewster's Kaleidoscope.
+
+kumppa  Shows kumppa.
+
+laser   Shows spinning lasers.
+
+life    Shows Conway's game of life.
+
+life1d  Shows Wolfram's game of 1D life.
+
+life3d  Shows Bays' game of 3D life.
+
+lightning
+        Shows Keith's fractal lightning bolts.
+
+lisa    Shows animated lissajous loops.
+
+lissie  Shows lissajous worms.
+
+loop    Shows Langton's self-producing loops.
+
+mandelbrot
+        Shows mandelbrot sets.
+
+marquee Shows text.
+
+matrix  Shows the matrix.
+
+maze    Shows a random maze and a depth first  search  solu-
+        tion.
+
+moebius Shows the Moebius Strip II, an Escher-like GL  scene
+        with ants.  May not be available depending on how it
+        was configured.
+
+molecule
+        Draws molecules, based on coordinates from PDB (Pro-
+        tein Data Base) files.
+
+morph3d Shows GL morphing polyhedra.  May not  be  available
+        depending on how it was configured.
+
+mountain
+        Shows Papo's mountain range.
+
+munch   Shows munching squares.
+
+nose    Shows a man with a big nose runs around spewing  out
+        text.
+
+pacman  Shows Pacman(tm).
+
+penrose Shows Penrose's quasiperiodic tilings.
+
+petal   Shows various GCD Flowers.
+
+pipes   Shows a  self-building  pipe  system.   May  not  be
+        available depending on how it was configured.
+
+polyominoes
+        Shows attempts to place polyominoes into  a  rectan-
+        gle.
+
+puzzle  Shows a puzzle being scrambled and then solved.
+
+pyro    Shows fireworks.
+
+qix     Shows spinning lines a la Qix(tm).
+
+roll    Shows a rolling ball.
+
+rotor   Shows Tom's Roto-Rooter.
+
+rubik   Shows an auto-solving  Rubik's  Cube.   May  not  be
+        available depending on how it was configured.
+
+sballs  Shows balls spinning like crazy in GL.  May  not  be
+        available depending on how it was configured.
+
+scooter Shows a journey through space tunnel and stars.
+
+shape   Shows stippled rectangles, ellipses, and triangles.
+
+sierpinski
+        Shows a Sierpinski's triangle.
+
+sierpinski3d
+        Shows a Sierpinski's gasket.
+
+slip    Shows slipping blits.
+
+solitare
+        Shows Klondike's game of solitare.
+
+space   Shows a journey into deep space.
+
+sphere  Shows a bunch of shaded spheres.
+
+spiral  Shows a helical locus of points.
+
+spline  Shows colorful moving splines.
+
+sproingies
+        Shows Sproingies!   Nontoxic.   Safe  for  pets  and
+        small  children.   May not be available depending on
+        how it was configured.
+
+stairs  Shows Infinite Stairs, an Escher-like GL scene.  May
+        not be available depending on how it was configured.
+
+star    Shows a star field with a twist.
+
+starfish
+        Shows starfish.
+
+strange Shows strange attractors.
+
+superquadrics
+        Shows 3D mathematical shapes.  May not be  available
+        depending on how it was configured.
+
+swarm   Shows a swarm of bees following a wasp.
+
+swirl   Shows animated swirling patterns.
+
+t3d     Shows a Flying Balls Clock Demo.
+
+tetris  Shows an autoplaying tetris game.
+
+text3d  Shows 3D moving texts.
+
+thornbird
+        Shows an animated Bird in a Thorn Bush fractal map.
+
+tik_tak Shows rotating polygons.
+
+triangle
+        Shows a triangular mountain range.
+
+tube    Shows an animated tube.
+
+turtle  Shows turtle fractals.
+
+vines   Shows fractal-like vines.
+
+voters  Shows Dewdney's Voters.
+
+wator   Shows  Dewdney's  Water-Torus  planet  of  fish  and
+        sharks.
+
+wire    Shows a random circuit with 2 electrons.
+
+world   Shows spinning Earths.
+
+worm    Shows wiggly worms.
+
+xjack   Shows Jack having one of those days.
+
+xcl     Shows a Control Line combat model race
+
+blank   Shows nothing but a black screen.  Does not show  up
+        in random mode.
+
+bomb    Shows a bomb and will autologout after a time.  Does
+        not  show  up  in  random  mode and may be available
+        depending on how it was configured.
+
+random  Shows a random mode from  above  except  blank  (and
+        bomb).
+
+-delay usecs
+     The delay option sets the speed at which  a  mode  will
+     operate.   It simply sets the number of microseconds to
+     delay between batches of animations.  In blank mode, it
+     is  important  to  set  this  to  some  small number of
+     seconds,  because  the  keyboard  and  mouse  are  only
+     checked  after  each delay, so you cannot set the delay
+     too high, but a delay of zero would needlessly  consume
+     cpu  checking  for  mouse and keyboard input in a tight
+     loop, since blank mode has no work to do.
+
+-count num
+     The batchcount option sets number of things to  do  per
+     batch to num .
+
+     In ant mode this refers the number of ants.
+
+     In atlantis mode it is the number of sharks.
+
+     In ball mode it is the number of balls.
+
+     In bat mode it is the number of  bats,  could  be  less
+     because of conflicts.
+
+     In blot mode this refers to the number of  pixels  ren-
+     dered in the same color.
+
+     In bouboule mode it is the number of stars.
+
+     In bounce mode it is the number of balls, could be less
+     because of conflicts.
+
+     In braid mode it is the upper bound number of strands.
+
+     In bubble mode it is the number of bubbles.
+
+     In bubble3d mode it is the number of bubbles.
+
+     In bug mode it is the number of  bugs,  could  be  less
+     because of conflicts.
+
+     In cage mode it is means nothing.
+
+     In clock mode it is the percentage of the  screen,  but
+     less than 100%.
+
+     In coral mode it is the number of seeds.
+
+     In crystal mode it is the number of polygons.
+
+     In daisy mode it is the  number  flowers  that  make  a
+     meadow.
+
+     In dclock mode it means nothing.
+
+     In deco mode it is the depth.
+
+     In demon mode this refers the number of colors.
+
+     In dilemma mode  this  refers  the  number  of  initial
+     defectors.
+
+     In discrete mode it is the number of points.
+
+     In drift mode it is the number  of  levels  to  recurse
+     (larger = more complex).
+
+     In dragon mode it means nothing.
+
+     In euler2d mode it is the number of segments.
+
+     In eyes mode it is the number of eyes.
+
+     In fadeplot mode it is the number of steps.
+
+     In fire mode it is the number of fire particles (set it
+     to 0 to have rain).
+
+     In flag mode it means nothing.
+
+     In flame mode it is the number  of  levels  to  recurse
+     (larger = more complex).
+
+     In flow mode it is the number of bees.
+
+     In forest mode it is  the  number  trees  that  make  a
+     forest.
+
+     In galaxy mode it means the number of galaxies.
+
+     In gears mode it is the number of degrees to rotate the
+     set of gears by.
+
+     In glplanet mode it is the number of hundredth  degrees
+     to roll the planet by.
+
+     In goop mode it is the number of blobs per plane.
+
+     In grav mode it is the number of planets.
+
+     In helix mode it means nothing.
+
+     In hop mode this refers to the number  of  pixels  ren-
+     dered in the same color.
+
+     In hyper mode it the number of dimensions.
+
+     In ico mode it is the ith platonic solid.
+
+     In ifs mode it means nothing.
+
+     In image mode it means it is the  number  of  logos  on
+     screen at once.
+
+     In juggle mode it is speed in milliseconds  betewwen  a
+     throw and the next catch.
+
+     In julia mode it is the depth of recursion.
+
+     In kaleid mode it is the number of pens.
+
+     In kumppa mode it means nothing.
+
+     In lament mode it means nothing.
+
+     In laser mode it is the number lasers.
+
+     In life mode it is the number of generations  before  a
+     glider is introduced.
+
+     In life1d mode it means nothing.
+
+     In life3d mode it is the number of generations before a
+     glider is introduced.
+
+     In lisa mode it is the number of loops.
+
+     In lissie mode it is the number of worms.
+
+     In loop mode it is the number of flaws.
+
+     In mandelbrot mode it is the order.
+
+     In marquee mode it means nothing.
+
+     In matrix mode it means nothing.
+
+     In maze mode it means nothing.
+
+     In moebius mode it is means nothing.
+
+     In molecule mode it means nothing.
+
+     In morph3d mode it is the ith platonic solid.
+
+     In mountain mode it is the number of mountains.
+
+     In munch mode it means nothing.
+
+     In nose mode it means nothing.
+
+     In qix mode it is the number of points.
+
+     In pacman mode it means the number of ghosts.
+
+     In penrose mode it means nothing.
+
+     In petal mode it the greatest random number of petals.
+
+     In pipes mode it shows different joints,  0  random,  1
+     spherical, 2 bolted elbow, 3 elbow, and 4 alternating.
+
+     In polyominoes mode it means nothing.
+
+     In puzzle mode it the number of moves.
+
+     In pyro mode it is the maximum number flying rockets at
+     one time.
+
+     In roll mode it is the number of points.
+
+     In rotor mode it is the number of rotor  thingys  which
+     whirr...
+
+     In rubik mode it is the number of moves.
+
+     In sballs mode it is the number of spheres.
+
+     In scooter mode it is the number of doors.
+
+     In shape mode it means nothing.
+
+     In sierpinski mode it is the number of points.
+
+     In slip mode it means nothing.
+
+     In solitare mode it means nothing.
+
+     In space mode it is the number of stars.
+
+     In sphere mode it means nothing.
+
+     In spiral mode it is the number of spirals.
+
+     In spline mode it is the number of points "splined".
+
+     In sproingies mode it is the number of sproingies.
+
+     In stairs mode it is means nothing.
+
+     In star mode it is the number of stars on the screen at
+     once.
+
+     In starfish mode it means nothing.
+
+     In strange mode it means nothing.
+
+     In superquadrics mode its the number of horizontal  and
+     vertical lines in the superquadric.
+
+     In swirl mode it means the number of "knots".
+
+     In swarm mode it is the number of bees.
+
+     In t3d mode it means nothing.
+
+     In tetris mode it means nothing.
+
+     In text3d mode it means nothing.
+
+     In thornbird mode it is the number of points.
+
+     In triangular mode it is the number of mountains.
+
+     In tube mode it is a rectangle (= 1), an ellipse (= 2),
+     or a polygon if greater.
+
+     In turtle mode it means nothing.
+
+     In vines mode it is draw a complete vine  (=  0)  or  a
+     portion (= 1).
+
+     In voters mode it means the number of parties, 2 or 3.
+
+     In wator mode it means the breed time for the fish.
+
+     In wire mode it means the length of the circuit.
+
+     In world mode it is the number of worlds.
+
+     In worm mode it is the number of worms.
+
+     In xcl mode it represents the number of planes.
+
+     In xjack mode it means nothing.
+
+     In blank mode it means nothing.
+
+     In bomb mode it means the number of minutes to  autolo-
+     gout.
+
+     A negative count allows for randomness.  The range from
+     the  minimum allowed nonnegative count for a particular
+     mode to the ABS( count ) (or maximum  allowed  count  ,
+     whichever is less).
+
+-batchcount num
+     The batchcount option is depreciated but  should  still
+     work as count.
+
+-cycles num
+     The cycles option sets the number of cycles until  time
+     out  for  ant, blot, braid, bug, clock, crystal, daisy,
+     deco, demon, dilemma,  discrete,  dragon,  eyes,  flag,
+     flow,  forest,  galaxy,  helix, hop, hyper, ico, laser,
+     life, life1d, life3d, lisa, lissie,  loop,  mandelbrot,
+     mountain, petal, sierpinski, shape, spline +erase, t3d,
+     thornbird, triangle, tube,  voters,  wator,  and  wire.
+     For euler2d and worm it is the length of the lines, for
+     atlantis it is the shark speed, for fadeplot, julia and
+     spiral  it is the length of the trail of dots, munch it
+     is the minimum size of the squares, for  kaleid  it  is
+     the  % of black, for qix it is the number of lines, for
+     spline -erase it means the number of splines * 64  (for
+     compatibility  with +erase), for gears it is the number
+     of degrees to increment the spin of each gear  by,  for
+     glplanet  it  is  the  number  of  hundredth degrees to
+     rotate the planet by, for molecule it is  the  time  in
+     seconds  until  timeout,  for pipes it is the number of
+     systems to draw before clearing the screen,  for  rubik
+     it  is  the  number of steps to complete a 90 move, for
+     sballs it is the sphere speed value, for scooter it  is
+     the speed, for superquadrics it is the number of frames
+     it takes to morph  from  one  shape  to  another.   for
+     text3d  it is the number of times drawing a word before
+     the next one, For others it means nothing.
+
+-size num
+
+     The size option sets the size maximum size of a star in
+     bouboule,  pyro  and  star,  size  of  ball in ball and
+     bounce, size of bat in bat, maximum size of  bubble  in
+     bubble, size of clock in clock, minimum size of rectan-
+     gles in deco, size  of  the  polygons  in  crystal  and
+     tik_tak,  size  of polyhedron in ico, size of lissie in
+     lissie, size of dots of flag, for kaleid it is the sym-
+     metry,  width  of maze hallway, size of side of penrose
+     tile, radius of loop in lisa, radius of ball  in  roll,
+     number  of  corners  in  sierpinski, number of stars in
+     scooter, size of tube in tube, width of worm  in  worm,
+     line  width  in  rotor,  size  of  cells  in  ant, bug,
+     dilemma, dragon, life, life1d, pacman, tetris,  voters,
+     wator,  and wire.  In pipes it is the maximum length of
+     a system.  In atlantis it is the shark size.   A  nega-
+     tive number allows for randomness, similar to count. In
+     fire, gears, sballs and sproingies it is  the  size  of
+     the  screen,  this  is  because on many slow systems it
+     runs too slow when the picture covers the full screen.
+
+-ncolors num
+     The ncolors option sets the maximum number of colors to
+     be used.
+
+-saturation value
+     The saturation option sets saturation of the color ramp
+     used  to  value  .  0  is  grayscale and 1 is very rich
+     color.  0.4 is a nice pastel.
+
+-erasemode modename
+     As of this writing there are over 9  erase  modes  sup-
+     ported  (if  its  not  chosen its assumed random).  The
+     erase modes are random_lines, random_squares, venetian,
+     triple_wipe, quad_wipe, circle_wipe, three_circle_wipe,
+     squaretate, no_fade.
+
+-erasedelay usecs
+     The erasedelay option sets the number  of  microseconds
+     for  steps  of  the  erasemode  (a setting of 0 and the
+     erasemode is bypassed).
+
++/-nolock
+     The nolock option causes xlock to only  draw  the  pat-
+     terns and not lock the display.  A key press or a mouse
+     click will terminate the screen saver.
+
+-/+inwindow
+     Runs xlock in a window, so that you can iconify,  move,
+     or resize it and still use your screen for other stuff.
+     When running in a window, xlock no  longer  locks  your
+     screen, it just looks good.
+
+-/+inroot
+     Runs xlock in your  root  window.   Like  the  inwindow
+     option  it  no  longer  locks the screen, it just looks
+     good.
+
+-/+remote
+     The remote option tells xlock  to  not  stop  you  from
+     locking remote X11 servers.  This option should be used
+     with care and is intended mainly to lock X11  terminals
+     which  cannot  run  xlock locally.  If you lock someone
+     else's workstation, they will have to know  your  pass-
+     word   to  unlock  it.   Using  +remote  overrides  any
+     resource derived values for remote and  prevents  xlock
+     from  being  used  to lock other X11 servers.  (Use `+'
+     instead of `-' to override resources for other  options
+     that can take the `+' modifier similarly.)
+
+-/+mono
+     The mono option causes  xlock  to  display  monochrome,
+     (black  and  white)  pixels  rather  than  the  default
+     colored ones on color displays.
+
+-/+allowaccess
+     This option is required for servers which do not  allow
+     clients  to modify the host access control list.  It is
+     also useful if you need to run x clients  on  a  server
+     which is locked for some reason...  When allowaccess is
+     true, the X11 server is left open for clients to attach
+     and  thus  lowers  the  inherent  security of this lock
+     screen.  A side effect of using this option is that  if
+     xlock  is  killed -KILL, the access control list is not
+     lost.
+
+-vtlock modename
+     This option is used on a XFree86 system  to  manage  VT
+     switching in [off|noswitch|switch|restore] mode.
+
+off       means no VT switch locking.
+
+switch    means VT switch locking + switching  to  xlock  VT
+          when activated.
+
+restore   means VT switch locking + switching  to  xlock  VT
+          when  activated  +  switching  back to previous VT
+          when desactivated.
+
+noswitch  means VT switch locking  only  when  xlock  VT  is
+          active.
+
+-/+allowroot
+     The allowroot option allows the root password to unlock
+     the  server as well as the user who started xlock.  May
+
+     not be able to turn this on and off depending  on  your
+     system and how xlock was configured.
+
+-/+debug
+     Allows xlock to be debugged by doing  all  but  locking
+     the screen.
+
+-/+description
+     The  description  option  causes  xlock  shows  a  mode
+     description  above  password window.  The default is to
+     show this description.
+
+-/+echokeys
+     The echokeys option causes xlock to echo '?' characters
+     for each key typed into the password prompt.  Some con-
+     sider this a security risk, so the default  is  to  not
+     echo anything.
+
+-/+enablesaver
+     By default xlock will disable  the  normal  X  server's
+     screen  saver  since  it is in effect a replacement for
+     it.  Since it is possible to set delay parameters  long
+     enough  to  cause  phosphor burn on some displays, this
+     option will turn back on the default screen saver which
+     is very careful to keep most of the screen black.
+
+-/+resetsaver
+     By default xlock will call XResetScreenSaver.  This may
+     be undesirable with DPMS monitors.
+
+-/+grabmouse
+     The grabmouse option causes xlock to grab the mouse and
+     keyboard,  this is the default.  xlock can not lock the
+     screen without this.
+
+-/+grabserver
+     The grabserver option causes xlock to grab the  server.
+     This  is not usually needed but some unsecure X servers
+     can be defeated without this.
+
+-/+install
+     Allows xlock to install its own colormap if xlock  runs
+     out  of  colors.   May  not  work  on  with some window
+     managers (fvwm) and does  not  work  with  the  -inroot
+     option.
+
+-/+mousemotion
+     Allows you to turn on and off the  sensitivity  to  the
+     mouse to bring up the password window.
+
+-/+sound
+     Allows you to turn on and off sound if  installed  with
+
+     the capability.
+
+-/+timeelapsed
+     Allows you to find out how long a machine is locked  so
+     you  can  complain  to an administrator that someone is
+     hogging a machine.
+
+-/+usefirst
+     The usefirst option causes xlock to use  the  keystroke
+     which got you to the password screen as the first char-
+     acter in the password.  The default is  to  ignore  the
+     first key pressed.
+
+-/+verbose
+     Verbose mode, tells what options it is going to use.
+
+-nice nicelevel
+     The nice option sets system nicelevel of the xlock pro-
+     cess to nicelevel .
+
+-lockdelay seconds
+     The lockdelay option sets the number of seconds  before
+     the  screen  needs a password to be unlocked.  Good for
+     use with an autolocking mechanism like xautolock(1).
+
+-timeout seconds
+     The timeout option sets the number  of  seconds  before
+     the password screen will time out.
+
+-font fontname
+     The font option sets the font to be used on the  prompt
+     screen.
+
+-planfont fontname
+     option sets the font to be used for the  text  that  is
+     displayed in the lower part of the password screen.
+
+-fg color
+     The fg option sets the color of the text on  the  pass-
+     word screen to color .
+
+-bg color
+     The bg option sets the color of the background  on  the
+     password screen to color .
+
+-foreground color
+     The foreground option sets the color of the text on the
+     password screen to color .
+
+-background color
+     The background option sets the color of the  background
+     on the password screen to color .
+
+-username string
+     Text string is shown in front of user name, defaults to
+     "Name: ".
+
+-password string
+     Text string is the password prompt string, defaults  to
+     "Password: ".
+
+-info string
+     Text string is an informational  message  to  tell  the
+     user what to do, defaults to "Enter password to unlock;
+     select icon to lock.".
+
+-validate string
+     Text string is a message  shown  while  validating  the
+     password, defaults to "Validating login..."
+
+-invalid string
+     Text  string  is  a  message  shown  when  password  is
+     invalid, defaults to "Invalid login."
+
+-geometry geom
+     The geometry option sets geom the size  and  offset  of
+     the  lock  window  (normally  the  entire screen).  The
+     entire screen format is still  used  for  entering  the
+     password.  The purpose is to see the screen even though
+     it is locked.  This should be used with  caution  since
+     many of the modes will fail if the windows are far from
+     square or are too small  (size  must  be  greater  than
+     0x0).   This  should  also be used with -enablesaver to
+     protect screen from phosphor burn.
+
+-icongeometry geom
+     The icongeometry option  sets  geom  the  size  of  the
+     iconic  screen  (normally 64x64) seen when entering the
+     password.  This should be used with caution since  many
+     of  the  modes  will  fail  if the windows are far from
+     square or are too small  (size  must  be  greater  than
+     0x0).   The  greatest size is 256x256.  There should be
+     some limit so  users  could  see  who  has  locked  the
+     screen.  Position information of icon is ignored.
+
+-glgeometry geom
+     The glgeometry option sets geom the size of the  screen
+     for gl modes.  Not normally available or needed.
+
+-/+wireframe
+     Turn on/off wireframe, available  on  atlantis,  daisy,
+     fire,  gears, lament, life3d, mountain, sballs, sproin-
+     gies, superquadrics, and triangle.
+
+-/+showfps
+
+     Turn  on/off  frame  per  sec  display,  available   on
+     atlantis,  bubble3d, cage, fire, gears, invert, lament,
+     moebius, morph3d, rubik, sballs, stairs, and  superqua-
+     drics.
+
+-/+fpstop
+     Turn on/off frame per sec display  on  top  of  screen,
+     used if showfps is on.
+
+-fpsfont fontname
+     The fpsfont option sets the font  to  be  used  in  the
+     frame per sec display, used if showfps is on.
+
+-/+use3d
+     Turn on/off 3d view, available on bouboule, pyro, star,
+     and worm.
+
+-delta3d value
+     Space between the center of your 2 eyes for 3d mode.
+
+-none3d color
+     Color used for empty size in 3d mode.
+
+-right3d color
+     Color used for right eye in 3d mode.
+
+-left3d color
+     Color used for left eye in 3d mode.
+
+-both3d color
+     Color used for overlapping images for  left  and  right
+     eye in 3d mode.
+
+-program programname
+     The program option sets the program to be used  as  the
+     fortune generator.  Currently used only for marquee and
+     nose modes.
+
+-messagesfile formatted-filename
+     The messagesfile option sets the file to be used as the
+     fortune  generator.   The  first entry is the number of
+     fortunes, the next line  contains  the  first  fortune.
+     Fortunes  begin  with  a  "%%"  on  a  line  by itself.
+     Currently used only for marquee and nose modes.  If one
+     exists, it takes precedence over the fortune program.
+
+-messagefile filename
+     The messagefile option sets the file whose contents are
+     displayed.   Currently  used  only for marquee and nose
+     modes.  If one exists, it  takes  precedence  over  the
+     fortune program and messagesfile.
+
+-message textstring
+     The message option sets the text to be displayed  in  a
+     mode.   Currently  used only for flag, marquee and nose
+     modes.  If one exists, it  takes  precedence  over  the
+     fortune program, messagesfile and message.
+
+-messagefont fontname
+     The messagefont option sets the font to be used in  the
+     mode.   Currently used only for flag, marquee, and nose
+     modes.
+
+-bitmap filename
+     The bitmap option sets the xbm, xpm, or ras file to  be
+     displayed with flag, image, life, life1d, maze, or puz-
+     zle mode.  For eyes and  pacman  only  a  xbm  file  is
+     accepted.   Certain modes reject the bitmap if too big.
+     /
+
+2 MORE_OPTIONS (these may not be available)
+-cpasswd crypted-password
+     The cpasswd option sets the key to be this text  string
+     to unlock xlock instead of password file.
+
+-forceLogout minutes
+     The forceLogout option sets minutes to auto-logout.
+
+-logoutButtonLabel string
+     Text string is a message  shown  inside  logout  button
+     when logout button is displayed.  Defaults to "Logout".
+
+-logoutButtonHelp string
+     Text string is a message shown  outside  logout  button
+     when  logout  button  is displayed.  Defaults to "Click
+     the \"Logout\" button to log  out  current\n  user  and
+     make workstation available."
+
+-logoutFailedString string
+     Text string  is  a  message  shown  when  a  logout  is
+     attempted  and  fails.   Defaults  to  "Logout  attempt
+     FAILED.\n  Current  user  could  not  be  automatically
+     logged out."
+
+-/+dtsaver
+     Turn on/off CDE Saver Mode.  This option is only avail-
+     able if CDE support was compiled in.
+
+-modulepath path
+     The modulepath option sets the directories  that  xlock
+     searches  for  mode  modules  to  load.   It is a colon
+     separated list of directories to  search.  If  "%S"  is
+     included  in  the  path,  it is replaced by the default
+
+     modulepath.  To add a private module directory  to  the
+     default  path, use something like '%S:~/mymoduledir' as
+     the path.  This option is only available if module sup-
+     port was compiled in.
+
+-locksound string
+     Text string references  sound  to  use  at  lock  time.
+     Default  sound,  male  voice:   "Thank  you,  for  your
+     cooperation."
+
+-infosound string
+     Text string references sound to  use  for  information.
+     Default sound, male voice:  "Identify please."
+
+-validsound string
+     Text string references sound  to  when  a  password  is
+     valid.  Default sound, female voice:  "Complete."
+
+-invalidsound string
+     Text string references sound  to  when  a  password  is
+     invalid.   Default  sound, female voice: "I am not pro-
+     grammed to give you that information."
+
+-startCmd string
+     Text string command  to  execute  when  the  screen  is
+     locked.  Commonly  used instructions include:  "zaway".
+     This command, if still  running  when  the  screensaver
+     exist, will be killed.
+
+-endCmd string
+     Text string command  to  execute  when  the  screen  is
+     unlocked.
+
+-logoutCmd string
+     Text string command to execute when  the  program  logs
+     the  user out (either via the autologout or by pressing
+     the logout button).
+
+-mailCmd string
+     Text string command to  execute  when  the  program  to
+     check mail.
+
+-mailIcon string
+     Text string of file for the "mail arrived" bitmap.
+
+-nomailIcon string
+     Text string of file for the "no mail" bitmap.
+
+-dpmsstandby  seconds
+     Allows one to  set  DPMS  Standby  for  monitor  (0  is
+     defined  as  infinite).   (Horizontal sync on, Vertical
+     sync off, RGB guns off, power supply on, tube filaments
+
+     energized,   (screen  saver  mode).   Typical  17  inch
+     screen...  110 out of 120 watts with a 3  sec  recovery
+     time.)   This  option is only available if DPMS support
+     was compiled in.
+
+-dpmssuspend  seconds
+     Allows one to  set  DPMS  Suspend  for  monitor  (0  is
+     defined  as  infinite).  (Horizontal sync off, Vertical
+     sync on, RGB guns off, power supply off, tube filaments
+     energized.   Typical  17 inch screen ...  15 out of 120
+     watts with a 3 sec recovery time.)  This option is only
+     available if DPMS support was compiled in.
+
+-dpmsoff  seconds
+     Allows one to set DPMS Power  Off  for  monitor  (0  is
+     defined  as  infinite).  (Horizontal sync off, Vertical
+     sync off, Small auxiliary circuit stays on  to  monitor
+     the HS/VS signals to enable power on when data needs to
+     be displayed on the screen.  Typical 17 inch screen ...
+     5  out of 120 watts with a 10 sec recovery time.)  This
+     option is only available if DPMS support  was  compiled
+     in.
+
+2 SPECIAL_MODE DEPENDENT OPTIONS
+-neighbors num
+     The neighbors option sets the number of neighbors of  a
+     cell  to  3,  4,  6,  9 (may not have real mathematical
+     meaning), or 12 for several automata modes  (ant,  bug,
+     demon,  dilemma, life, loop, and wire) (bug and loop do
+     not span this full range).  Setting it to  0  typically
+     randomizes   this,   except   where  bitmaps  are  used
+     (dilemma, life, voters, and wator).
+
+-/+eyes
+     Turn on and off eyes for ant and bug.
+
+-/+cycle
+     Turn on and off colour cycling  in  crystal,  starfish,
+     tetris, and tik_tak.
+
+-/+trackmouse
+     Turn on and off mouse interaction in eyes, fire, julia,
+     solitare,  sballs,  swarm, and tetris. For solitare and
+     tetris this may not be available depending on how xlock
+     was configured.
+
+-/+texture
+     Turn on and off texturing in fire, lament  and  sballs.
+     This  may  not  be available depending on how xlock was
+     configured.
+
+-rule S<neighborhood>/B<neighborhood>
+     Allows one to set the rule for life and life3d. Special
+     parameters:  P, picks a random rule from all rules that
+     have known patterns; G, picks a random  rule  from  all
+     rules that have known gliders.  For life a good example
+     is Conway's rule which  is  S23/B3.   For  life3d  good
+     examples  are  Bay's  rules  which are S45/B5, S567/B6,
+     S56/B5, and S67/B67.
+
+-lifefile filename
+     The lifefile option sets the life and life3d  lifeform.
+     Only  one format is currently supported, similar to the
+     #P xlife format.  For life3d, 2 linefeeds in a row  are
+     assumed to advance the depth.
+
+-whalespeed num
+     Allows one to set the speed of the whales  and  dolphin
+     in atlantis.
+
+-/+truchet
+     Turn on and off Truchet lines (trail) in ant.
+
+-/+boil
+     Turn on and off having the bubbles bubble up in bubble.
+
+-nx num
+     Allows one to set  the  number  of  unit  cells  in  x-
+     direction in crystal.
+
+-ny num
+     Allows one to set  the  number  of  unit  cells  in  y-
+     direction in crystal.
+
+-/+centre
+     Turn on and off the centering on screen in crystal.
+
+-/+maxsize
+     Turn on and off the centering on screen in crystal.
+
+-/+cell
+     Turn on and off the drawing of unit cell in crystal.
+
+-/+grid
+     Turn on and off the drwing of grid of  unit  cells  (if
+     -cell is on) in crystal.
+
+-/+garden
+     Turn off and on garden look in daisy.
+
+-/+popex
+     Turn on and off the  population  explosion  counter  in
+     dclock.
+
+-/+forest
+     Turn on and off the tropical deforest  (hectares/acres)
+     counter in dclock.
+
+-/+hiv
+     Turn on and off the HIV infection counter in dclock.
+
+-/+lab
+     Turn on and off the Animal Research counter in dclock.
+
+-/+veg
+     Turn on and  off  the  Animal  Consumation  counter  in
+     dclock.
+
+-/+y2k
+     Turn on and off the Year 2000 countdown in dclock.
+
+-/+millennium
+     Turn on and off the Second Millennium (January 1, 2001)
+     countdown in dclock.
+
+-bonus value
+     Allows one to set the bonus for cheating... between 1.0
+     and 4.0 in dilemma.
+
+-/+conscious
+     Turn off and on self-awareness in dilemma.
+
+-/+grow
+     Turn  on  and  off  growing  fractals  (else  they  are
+     animated) for drift.
+
+-/+liss
+     Turn on and off using lissajous figures to  get  points
+     for drift.
+
+-/+framerate
+     Turn on and off displaying of the frame rate  for  fire
+     and sballs
+
+-/+fog
+     Turn on and off fog for fire.
+
+-/+shadows
+     Turn on and off shadows for fire.
+
+-trees num
+     Validate the displaying of trees for  fire  if  greater
+     than zero.
+
+-/+invert
+     Turn on and off inverting of the flag.
+
+-/+tracks
+     Turn on and off star tracks in galaxy.
+
+-/+light
+     Turn on and off lighting of the planet for glplanet.
+
+-/+bounce
+     Turn on and off bouncing movement  of  the  planet  for
+     glplanet.
+
+-pimage filename
+     Use the named xbm or xpm file for texturing the  planet
+     for  glplanet.  Use BUILTIN as filename for the builtin
+     image taken from Xearth.
+
+-/+roll
+     Turn on and off rolling of the planet for glplanet.
+
+-/+rotate
+     Turn on and off rotation of the planet for glplanet.
+
+-/+texture
+     Turn on and off texturing of the planet for glplanet.
+
+-/+stars
+     Turn on and off showing stars  in  the  background  for
+     glplanet.
+
+-/+decay
+     Turn on and off decaying orbits for grav.
+
+-/+trail
+     Turn on and off decaying trail of dots for grav.
+
+-/+ellipse
+     Turn on and off ellipse format in helix.
+
+-/+martin
+     Turn on and off  Barry  Martin's  square  root  hop.  -
+     /+popcorn  Turn  on and off Clifford A. Pickover's pop-
+     corn hop.
+
+-/+ejk1...ejk6
+     Turn on and off Ed J. Kubaitis' hops.
+
+-/+rr
+     Turn on and off Renaldo Recuerdo's hop.
+
+-/+jong
+     Turn on and off Jong's hop.
+
+-/+sine
+
+     Turn on and off Barry Martin's sine hop.
+
+-pattern <pattern>
+     Allows one to set the pattern for juggle.
+
+-patterntrace num
+     Allows one to see the trails for juggle.
+
+-/+solid
+     Turn off and on solid color (else its a  4  panel  look
+     (half white)) for juggle.
+
+-/+uni
+     Turn off and on Unicycle for juggle.
+
+-/+disconnected
+     Turn on and off disconnected pen movement in kaleid.
+
+-/+serial
+     Turn on and off  sequential  allocation  of  colors  in
+     kaleid.
+
+-/+alternate
+     Turn on and off alternate rotated display mode kaleid.
+
+-/+quad
+     Turn on and off quad mirrored/rotated mode  similar  to
+     size 4 in kaleid.
+
+-/+oct
+     Turn on and off oct mirrored/rotated  mode  similar  to
+     size 8 in kaleid.
+
+-/+linear
+     Turn on and  off  Cartesian/Polar  coordinate  mode  in
+     kaleid.
+
+-/+callahan
+     Turn on and off  Paul  Callahan's  S2b34/B2a  hexagonal
+     life.
+
+-/+andreen
+     Turn on and off Bob Andreen's S2a2b4a/B2a3a4b hexagonal
+     life.
+
+-/+totalistic
+     Turn on and off totalistic rules for life1d. If this is
+     off  then  it  follows  rules  of  the LCAU collection.
+     These rules may not be symmetric and are more general.
+
+-/+additive
+     Turn on and off additive functions mode in lisa.
+
+-/+noants
+     Turn off and on ants in moebius.
+
+-/+solidmoebius
+     Turn on and off solid Mobius strip in moebius.
+
+-/+atoms
+     Turn on and off the drawing of spheres for the atoms in
+     molecule.
+
+-/+bbox
+     Turn on and off showing the molecules in a blue box  in
+     molecule.
+
+-/+bonds
+     Turn on and off the drawing  of  the  atomic  bonds  in
+     molecule.
+
+-molecule filename
+     Read a molecule structure from a pdb file in molecule.
+
+-/+labels
+     Turn on and off the labeling of the atoms in molecule.
+
+-spin{x|y|z}
+     Set the axis for molecule  rotation  in  molecule.  The
+     default is "XYZ".
+
++spin
+     Turn off the molecule rotation in molecule.
+
+-/+titles
+     Turn on and off the molecule description in molecule.
+
+-/+wander
+     Turn on and off the moving of the molecule on a  sinoid
+     curve in molecule.
+
+-/+ammann
+     Turn on and off lines for penrose.
+
+-increment value
+     Allows fine adjustments to order in mandelbrot.
+
+-/+erase
+     Turn on and off erasing for spline. If this  option  is
+     on,  cycles  is  divided by 64 to compute the number of
+     lines, so as to be compatible when using -fullrandom.
+
+-factory num
+     Number of extra factory parts in pipes.
+
+-/+fisheye
+     Turn on if you want a zoomed-in view of pipes.
+
+-/+tightturns
+     Turn on if you want the pipes to bend more often.
+
+-/+rotatepipes
+     Turn on if you want the pipe system rotated in pipes.
+
+-/+complete
+     Turn on or off complete graph morphing in qix.
+
+-size[xyz] num
+     Number represents the number of cubies on the x, y,  or
+     z  axis.   Negative  numbers offer randomness from 2 to
+     the absolute value of the number.  star.
+
+-/+hideshuffling
+     Turn on or off hidden shuffle phase for rubik.
+
+-/+border
+     Turn on or off borders in shape.
+
+-/+shape
+     Turn on or off shadowing in shape.
+
+-/+shape
+     Turn on or off stippling in shape.
+
+-intensity value
+     Set the brightness (default  2185)  of  the  sierpinski
+     structure for sierpinski3d.
+
+-maxdepth value
+     Set the maximum depth (up  to  10)  of  the  sierpinski
+     structure for sierpinski3d.
+
+-speed value
+     Determines after how much steps the depth  changes  for
+     sierpinski3d.
+
+-trek num
+     If its a high number you will see the  space  ship  all
+     the time in star.
+
+-/+rock
+     Turn on and off rocks for star. If this is  off,  stars
+     will be seen instead.
+
+-/+straight
+     Turn on if star gets you motion sick.
+
+-cyclepeed num
+     Set speed of cycling in starfish.
+
+-rotation num
+     Set rotation velocity in starfish.
+
+-thickness num
+     Set thickness in starfish.
+
+-/+rock
+     Turn on and off blob for starfish.
+
+-spinspeed num
+     Set speed of rotation, in degrees per frame for  super-
+     quadrics.
+
+-/+bonus
+     Turn on in tetris to see 5 square bonus pieces.
+
+-/+well
+     Turn on in tetris to see welltris.
+
+-ttfont filename
+     Sets the True Type font file (or font  directory)  used
+     for text3d
+
+-extrusion num
+     Sets length of the text extrusion for text3d
+
+-rot_amplitude float
+     Sets rotation amplitude value of each letter for text3d
+
+-rot_frequency float
+     Sets rotation frequency for text3d
+
+-/+no_split
+     Turn on and off word splitting for text3d
+
+-ttanimate function_name
+     Sets the animation function used for text3d.  Currently
+     one  of  :  Random  FullRandom  Default  Default2  None
+      Crazy  UpDown  Extrude  RotateXY  RotateYZ   Frequency
+      Amplitude
+
+-speed km/h
+     The speed for all planes in km/h for xcl.
+
+-frametime microseconds
+     The time for one frame on the screen. This time is used
+     to calculate the delay time and depends on the speed of
+     the X server for xcl.
+
+-line_length mm
+     The distance between the pilot and the plane for xcl.
+
+-spectator mm
+     The distance between spectator and pilot. It should  be
+     grater  than the line_length and the half wing width of
+     the plane to be not dangerous  for  the  spectator  for
+     xcl.
+
+-viewmodel
+     Shows an animated view of one model for xcl.
+
+-/+oldcolor
+     Sets the colors for the first two planes fixed  to  red
+     and yellow in xcl.
+
+-xcldebug
+     Shows some additional timing information to  make  sure
+     that the calibrate procedure goes right in xcl.
+
+-automatic
+        The auto scale for automatic fit into the window  is
+        Deactivated with this option for xcl.
+
+-randomstart
+     Use a random start point for models at startup for xcl.
+
+-duration seconds
+     Allows one to set a duration  for  a  mode  in  random.
+     Duration of 0 is defined as infinite.
+
+-/+fullrandom
+     Turn on/off randomness options within modes in  random.
+     Not implemented for all mode options.
+
+-modelist textstring
+     Allows one to pass a list of files to randomly  display
+     to random. "all" will get all files but blank (and bomb
+     if  compiled  in).  "all,blank"  will  get  all  modes.
+     "all,-image bounce,+blank" will get all modes but image
+     and bounce.  "bug wator" will get only bug  and  wator.
+     "allgl"  will  get  only  the  GL modes if compiled in,
+     all-allgl will get all but the GL modes, "allnice" will
+     weed  out  high cpu usage modes (as well as hackers and
+     gl modes).  "allxpm" will get all modes that  use  xpm.
+     "allwrite"  will  get  all modes that take advantage of
+     writable colormaps (not including xpm).   "all3d"  will
+     get all the modes that support this option.  "allmouse"
+     will get all the modes that support mouse  interaction.
+     Similarly,  "allautomata" for automata modes, "allfrac-
+     tal" for  fractal  modes,  "allgeometry"  for  geometry
+     modes,  "allspace"  for  space  modes.  The random mode
+
+     itself can not be referenced.
+
+-/+sequential
+     Turn on non-random random option.
+
+**WARNING**
+xlock can appear to hang if it is  competing  with  a  high-
+priority  process  for  the  CPU.  For  example, if xlock is
+started after a process with  'nice  -20'  (high  priority),
+xlock will take  considerable amount of time to respond.
+
+2 SHADOW_PASSWORDS
+2 If the machine is using a shadow password system, then xlock
+may  not  be  set up to get the real password and so must be
+given one of its own. This can  be  either  on  the  command
+line,   via   the   -cpasswd   option,   or   in   the  file
+$HOME/.xlockrc, with the first taking precedence.   In  both
+cases  an  encrypted  password is expected (see makekey(8)).
+2 If neither is given, then xlock will prompt for  a  password
+and  will  use that, also storing an encrypted version of it
+in $HOME/.xlockrc for future use.
+
+2 BUGS
+"kill -KILL xlock " causes the server that was locked to  be
+unusable, since all hosts (including localhost) were removed
+from the access control list to lock out new X clients,  and
+since  xlock  could  not catch SIGKILL, it terminated before
+restoring the access control list.  This will  leave  the  X
+server  in  a state where "you can no longer connect to that
+server, and this operation cannot  be  reversed  unless  you
+reset  the server."            -From the X11R4 Xlib Documen-
+tation, Chapter 7.
+2 NCD terminals do not allow xlock to  remove  all  the  hosts
+from  the  access  control list.  Therefore you will need to
+use the "-remote" and "-allowaccess" switches.  If you  hap-
+pen  to run without "-allowaccess" on an NCD terminal, xlock
+will not work and you will need to reboot the  terminal,  or
+simply  go into the SETUP menus, under 'Network Parameters',
+and turn off TCP/IP access control.
+
+2 SEE_ALSO
+2 X(1), Xlib Documentation.
+
+2 AUTHOR
+2 Maintained by:
+     David Albert Bagley, <bagleyd@tux.org>
+
+2 The latest version is currently at:
+
+     ftp://ftp.tux.org/pub/tux/bagleyd/xlockmore
+     ftp://ftp.x.org/contrib/applications
+
+2 Original Author:
+     Patrick J. Naughton, <naughton@eng.sun.com>
+     Mailstop 21-14
+     Sun Microsystems Laboratories, Inc.
+     Mountain View, CA  94043
+     415/336-1080
+
+with many additional contributors.
+
+2 COPYRIGHT
+2 Copyright (C) 1991 by Patrick J. Naughton
+2 Copyright (C) 1993-2001 by David A. Bagley
+
+2 Permission  to  use,  copy,  modify,  and  distribute   this
+software  and  its documentation for any purpose and without
+fee is hereby granted, provided  that  the  above  copyright
+notice  appear  in  all  copies and that both that copyright
+notice and this permission notice appear in supporting docu-
+mentation.
+2 The original BSD daemon is Copyright (C) 1988 Marshall  Kirk
+2 McKusick.  All Rights Reserved.
+2 DEC, HP, IBM, Linux, SCO, SGI,  and  Sun  icons  have  their
+respective copyrights.
+
diff --git a/docs/xlock.html b/docs/xlock.html
new file mode 100644 (file)
index 0000000..c980cd6
--- /dev/null
@@ -0,0 +1,1700 @@
+<HTML>
+<BODY>
+<PRE>
+
+</PRE>
+<H2>NAME</H2><PRE>
+     xlock - Locks the  local  X  display  until  a  password  is
+     entered.
+
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+     <STRONG>xlock</STRONG> [ -<STRONG>help</STRONG> ] [ -<STRONG>version</STRONG>  ]  [  -<STRONG>resources</STRONG>  ]  [  -<STRONG>display</STRONG>
+     <EM>displayname</EM>  ] [ -<STRONG>visual</STRONG> <EM>visualname</EM> ] [ -<STRONG>name</STRONG> <EM>resourcename</EM> ]
+     [ -<STRONG>mode</STRONG> <EM>modename</EM> ] [ -<STRONG>delay</STRONG> <EM>usecs</EM> ] [ -<STRONG>batchcount</STRONG>  <EM>num</EM>  ]  [
+     -<STRONG>count</STRONG>  <EM>num</EM> ] [ -<STRONG>cycles</STRONG> <EM>num</EM> ] [ -<STRONG>ncolors</STRONG> <EM>num</EM> ] [ -<STRONG>size</STRONG> <EM>num</EM> ]
+     [ -<STRONG>saturation</STRONG> <EM>value</EM> ] [ -<STRONG>erasemode</STRONG> <EM>modename</EM> ] [  -<STRONG>erasedelay</STRONG>
+     <EM>usecs</EM>  ] [ <STRONG>-/+allowaccess</STRONG> ] [ -<STRONG>vtlock</STRONG> <EM>modename</EM> ] [ <STRONG>-/+nolock</STRONG>
+     ] [ <STRONG>-/+inwindow</STRONG> ] [ <STRONG>-/+inroot</STRONG> ] [ <STRONG>-/+remote</STRONG> ] [ <STRONG>-/+mono</STRONG> ]  [
+     <STRONG>-/+allowroot</STRONG> ] [ <STRONG>-/+debug</STRONG> ] [ <STRONG>-/+description</STRONG> ] [ <STRONG>-/+echokeys</STRONG>
+     ] [ <STRONG>-/+enablesaver</STRONG> ] [ <STRONG>-/+resetsaver</STRONG> ] [ <STRONG>-/+grabmouse</STRONG> ] [  <STRONG>-</STRONG>
+     <STRONG>/+grabserver</STRONG>  ] [ <STRONG>-/+install</STRONG> ] [ <STRONG>-/+mousemotion</STRONG> ] [ <STRONG>-/+sound</STRONG>
+     ] [ <STRONG>-/+timeelapsed</STRONG> ] [ <STRONG>-/+usefirst</STRONG> ] [ <STRONG>-/+verbose</STRONG> ] [  -<STRONG>nice</STRONG>
+     <EM>level</EM>  ] [ -<STRONG>lockdelay</STRONG> <EM>seconds</EM> ] [ -<STRONG>timeout</STRONG> <EM>seconds</EM> ] [ -<STRONG>font</STRONG>
+     <EM>fontname</EM> ] [ -<STRONG>planfont</STRONG> <EM>fontname</EM> ] [ -<STRONG>bg</STRONG> <EM>color</EM> ] [ -<STRONG>fg</STRONG>  <EM>color</EM>
+     ]  [  -<STRONG>background</STRONG>  <EM>color</EM> ] [ -<STRONG>foreground</STRONG> <EM>color</EM> ] [ -<STRONG>username</STRONG>
+     <EM>string</EM> ] [ -<STRONG>password</STRONG> <EM>string</EM> ] [ -<STRONG>info</STRONG> <EM>string</EM> ]  [  -<STRONG>validate</STRONG>
+     <EM>string</EM>   ]  [  -<STRONG>invalid</STRONG>  <EM>string</EM>  ]  [  -<STRONG>geometry</STRONG>  <EM>geom</EM>  ]  [
+     -<STRONG>icongeometry</STRONG> <EM>geom</EM> ] [ -<STRONG>glgeometry</STRONG> <EM>geom</EM> ] [ <STRONG>-/+wireframe</STRONG> ] [
+     <STRONG>-/+showfps</STRONG>  ] [ -<STRONG>fpsfont</STRONG> <EM>fontname</EM> ] [ <STRONG>-/+fpstop</STRONG> ] [ <STRONG>-/+use3d</STRONG>
+     ] [ -<STRONG>delta3d</STRONG> <EM>value</EM> ] [ -<STRONG>none3d</STRONG> <EM>color</EM> ] [ -<STRONG>right3d</STRONG> <EM>color</EM> ]  [
+     -<STRONG>left3d</STRONG> <EM>color</EM> ] [ -<STRONG>both3d</STRONG> <EM>color</EM> ] [ -<STRONG>program</STRONG> <EM>programname</EM> ] [
+     -<STRONG>messagesfile</STRONG> <EM>formatted</EM>-<EM>filename</EM> ] [ -<STRONG>messagefile</STRONG> <EM>filename</EM> ]
+     [  -<STRONG>message</STRONG>  <EM>string</EM>  ]  [  -<STRONG>messagefont</STRONG> <EM>fontname</EM> ] [ -<STRONG>bitmap</STRONG>
+     <EM>filename</EM> ] [  -<STRONG>cpasswd</STRONG>  <EM>crypted</EM>-<EM>password</EM>  ]  [  -<STRONG>forceLogout</STRONG>
+     <EM>minutes</EM>  ]  [  -<STRONG>logoutButtonLabel</STRONG> <EM>textstring</EM> ] [ -<STRONG>logoutBut-</STRONG>
+     <STRONG>tonHelp</STRONG> <EM>textstring</EM> ] [ -<STRONG>logoutFailedString</STRONG> <EM>textstring</EM> ] [  <STRONG>-</STRONG>
+     <STRONG>/+dtsaver</STRONG>  ]  [  -<STRONG>modulepath</STRONG>  <EM>path</EM> ] [ -<STRONG>locksound</STRONG> <EM>string</EM> ] [
+     -<STRONG>infosound</STRONG> <EM>string</EM> ] [ -<STRONG>validsound</STRONG> <EM>string</EM> ]  [  -<STRONG>invalidsound</STRONG>
+     <EM>string</EM>  ]  [  -<STRONG>startCmd</STRONG>  <EM>string</EM>  ]  [  -<STRONG>endCmd</STRONG>  <EM>string</EM>  ]  [
+     -<STRONG>logoutCmd</STRONG> <EM>string</EM> ]
+
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+     <STRONG>xlock</STRONG> locks the X server till the user enters their password
+     at  the  keyboard.   While  <STRONG>xlock</STRONG> is running, all new server
+     connections are refused.  The screen saver is disabled.  The
+     mouse  cursor  is  turned  off.  The screen is blanked and a
+     changing pattern is put on the screen.  If a key or a  mouse
+     button is pressed then the user is prompted for the password
+     of the user who started <STRONG>xlock</STRONG>.
+
+     If the  correct  password  is  typed,  then  the  screen  is
+     unlocked  and  the  X  server  is restored.  When typing the
+     password Control-U and Control-H  are  active  as  kill  and
+     erase  respectively.   To return to the locked screen, click
+     in the small icon version of the changing pattern.
+
+     In  the  lower  part  of  the  password  screen  a  text  is
+     displayed.  This message is taken from the first file of the
+     following that exists:   $HOME/.xlocktext,  $HOME/.plan,  or
+     $HOME/.signature.
+
+     On systems which support new BSD style  authentication,  the
+     password may be prefixed by an authentication style followed
+     by a colon (i.e. "style:password").  See  the  login.conf(5)
+     for more information on authentication styles.
+
+
+
+</PRE>
+<H2>NOTE ON ETIQUETTE</H2><PRE>
+     <EM>Xlock</EM> should not be used on public terminals when there is a
+     high demand for them.
+
+     If you find a  public  terminal  that  has  been  locked  by
+     another user and there are no other terminals available, and
+     the terminal appears to have been  left  idle  for  a  while
+     (normally  more than 15 minutes), it is fair to try to reset
+     the session in some manner.
+
+
+
+</PRE>
+<H2>OPTIONS</H2><PRE>
+     -<STRONG>help</STRONG>
+          Print options and a brief description to standard  out-
+          put.
+
+     -<STRONG>version</STRONG>
+          Print version number (if &gt;= 4.00) to standard output.
+
+     -<STRONG>resources</STRONG>
+          Print default resource file to standard output.
+
+     -<STRONG>display</STRONG> <EM>displayname</EM>
+          The <EM>display</EM> option sets the X11 display to lock.  <STRONG>xlock</STRONG>
+          locks all available screens on a given server, and res-
+          tricts you to locking  only  a  local  server  such  as
+          <STRONG>unix:0,</STRONG>  <STRONG>localhost:0,</STRONG>  or <STRONG>:0</STRONG> unless you set the -<STRONG>remote</STRONG>
+          option.
+
+     -<STRONG>visual</STRONG> <EM>visualname</EM>
+          <EM>visualname</EM> which is one of  "StaticGray",  "GrayScale",
+          "StaticColor",        "PseudoColor",       "TrueColor",
+          "DirectColor", or "default".  default used to  set  the
+          screen's  default  visual  (the visual of the root win-
+          dow).
+
+     -<STRONG>name</STRONG> <EM>resourcename</EM>
+          <EM>resourcename</EM> is used instead of <STRONG>XLock</STRONG> when looking  for
+          resources to configure <STRONG>xlock</STRONG>.
+
+     -<STRONG>mode</STRONG> <EM>modename</EM>
+          As of this writing there are over 90 display modes sup-
+          ported  (plus  one  more for random selection of one of
+          these).
+
+     <STRONG>ant</STRONG>     Shows Langton's and Turk's generalized ants.
+
+     <STRONG>atlantis</STRONG>
+             Shows  moving  sharks/whales/dolphin.   May  not  be
+             available depending on how it was configured.
+
+     <STRONG>ball</STRONG>    Shows bouncing balls.
+
+     <STRONG>bat</STRONG>     Shows bouncing flying bats.
+
+     <STRONG>blot</STRONG>    Shows Rorschach's ink blot test.
+
+     <STRONG>bouboule</STRONG>
+             Shows Mimi's bouboule of moving stars.
+
+     <STRONG>bounce</STRONG>  Shows bouncing footballs.
+
+     <STRONG>braid</STRONG>   Shows random braids and knots.
+
+     <STRONG>bubble</STRONG>  Shows popping bubbles.
+
+     <STRONG>bubble3d</STRONG>
+             Shows Richard Jones's GL bubbles.  May not be avail-
+             able depending on how it was configured.
+
+     <STRONG>bug</STRONG>     Shows Palmiter's bug evolution and a garden of Eden.
+
+     <STRONG>clock</STRONG>   Shows Packard's oclock.
+
+     <STRONG>coral</STRONG>   Shows a coral reef.
+
+     <STRONG>crystal</STRONG> Shows polygons in 2D plane groups.
+
+     <STRONG>daisy</STRONG>   Shows a meadow of daisies.
+
+     <STRONG>dclock</STRONG>  Shows a floating digital clock or message.
+
+     <STRONG>deco</STRONG>    Shows art as ugly as sin.
+
+     <STRONG>demon</STRONG>   Shows Griffeath's cellular automata.
+
+     <STRONG>dilemma</STRONG> Shows Lloyd's Prisoner's Dilemma simulation.
+
+     <STRONG>discrete</STRONG>
+             Shows various discrete maps.
+
+     <STRONG>dragon</STRONG>  Shows Deventer's Hexagonal Dragons Maze.
+
+     <STRONG>drift</STRONG>   Shows cosmic drifting flame fractals.
+
+     <STRONG>cage</STRONG>    Shows the Impossible Cage, an Escher-like GL  scene.
+             May not be available depending on how it was config-
+             ured.
+
+     <STRONG>euler2d</STRONG> Shows a simulation  of  2D  incompressible  inviscid
+             fluid.
+
+     <STRONG>eyes</STRONG>    Shows eyes following a bouncing grelb.
+
+     <STRONG>fadeplot</STRONG>
+             Shows a fading plot of sine squared.
+
+     <STRONG>fire</STRONG>    Shows a 3D fire-like image.  May  not  be  available
+             depending on how it was configured.
+
+     <STRONG>flag</STRONG>    Shows a waving flag image.  This may be  text  or  a
+             graphic  image.   Default  text  is the hostname and
+             operating system.
+
+     <STRONG>flame</STRONG>   Shows cosmic flame fractals.
+
+     <STRONG>flow</STRONG>    Shows dynamic strange attractors.
+
+     <STRONG>forest</STRONG>  Shows binary trees of a fractal forest.
+
+     <STRONG>galaxy</STRONG>  Shows crashing spiral galaxies.
+
+     <STRONG>gears</STRONG>   Shows GL's gears.  May not be available depending on
+             how it was configured.
+
+     <STRONG>glplanet</STRONG>
+             Animates texture mapped sphere (planet)
+
+     <STRONG>goop</STRONG>    Shows goop from a lava lamp.
+
+     <STRONG>grav</STRONG>    Shows orbiting planets.
+
+     <STRONG>helix</STRONG>   Shows string art.
+
+     <STRONG>hop</STRONG>     Shows real plane iterated fractals.
+
+     <STRONG>hyper</STRONG>   Shows spinning n-dimensional hypercubes.
+
+     <STRONG>ico</STRONG>     Shows a bouncing polyhedron.
+
+     <STRONG>ifs</STRONG>     Shows a modified iterated function system.
+
+     <STRONG>image</STRONG>   Shows randomly appearing logos.
+
+     <STRONG>juggle</STRONG>  Shows a Juggler, juggling.
+     <STRONG>julia</STRONG>   Shows the Julia set.
+
+     <STRONG>kaleid</STRONG>  Shows Brewster's Kaleidoscope.
+
+     <STRONG>kumppa</STRONG>  Shows kumppa.
+
+     <STRONG>laser</STRONG>   Shows spinning lasers.
+
+     <STRONG>life</STRONG>    Shows Conway's game of life.
+
+     <STRONG>life1d</STRONG>  Shows Wolfram's game of 1D life.
+
+     <STRONG>life3d</STRONG>  Shows Bays' game of 3D life.
+
+     <STRONG>lightning</STRONG>
+             Shows Keith's fractal lightning bolts.
+
+     <STRONG>lisa</STRONG>    Shows animated lissajous loops.
+
+     <STRONG>lissie</STRONG>  Shows lissajous worms.
+
+     <STRONG>loop</STRONG>    Shows Langton's self-producing loops.
+
+     <STRONG>mandelbrot</STRONG>
+             Shows mandelbrot sets.
+
+     <STRONG>marquee</STRONG> Shows text.
+
+     <STRONG>matrix</STRONG>  Shows the matrix.
+
+     <STRONG>maze</STRONG>    Shows a random maze and a depth first  search  solu-
+             tion.
+
+     <STRONG>moebius</STRONG> Shows the Moebius Strip II, an Escher-like GL  scene
+             with ants.  May not be available depending on how it
+             was configured.
+
+     <STRONG>molecule</STRONG>
+             Draws molecules, based on coordinates from PDB (Pro-
+             tein Data Base) files.
+
+     <STRONG>morph3d</STRONG> Shows GL morphing polyhedra.  May not  be  available
+             depending on how it was configured.
+
+     <STRONG>mountain</STRONG>
+             Shows Papo's mountain range.
+
+     <STRONG>munch</STRONG>   Shows munching squares.
+
+     <STRONG>nose</STRONG>    Shows a man with a big nose runs around spewing  out
+             text.
+
+     <STRONG>pacman</STRONG>  Shows Pacman(tm).
+
+     <STRONG>penrose</STRONG> Shows Penrose's quasiperiodic tilings.
+
+     <STRONG>petal</STRONG>   Shows various GCD Flowers.
+
+     <STRONG>pipes</STRONG>   Shows a  self-building  pipe  system.   May  not  be
+             available depending on how it was configured.
+
+     <STRONG>polyominoes</STRONG>
+             Shows attempts to place polyominoes into  a  rectan-
+             gle.
+
+     <STRONG>puzzle</STRONG>  Shows a puzzle being scrambled and then solved.
+
+     <STRONG>pyro</STRONG>    Shows fireworks.
+
+     <STRONG>qix</STRONG>     Shows spinning lines a la Qix(tm).
+
+     <STRONG>roll</STRONG>    Shows a rolling ball.
+
+     <STRONG>rotor</STRONG>   Shows Tom's Roto-Rooter.
+
+     <STRONG>rubik</STRONG>   Shows an auto-solving  Rubik's  Cube.   May  not  be
+             available depending on how it was configured.
+
+     <STRONG>sballs</STRONG>  Shows balls spinning like crazy in GL.  May  not  be
+             available depending on how it was configured.
+
+     <STRONG>scooter</STRONG> Shows a journey through space tunnel and stars.
+
+     <STRONG>shape</STRONG>   Shows stippled rectangles, ellipses, and triangles.
+
+     <STRONG>sierpinski</STRONG>
+             Shows a Sierpinski's triangle.
+
+     <STRONG>sierpinski3d</STRONG>
+             Shows a Sierpinski's gasket.
+
+     <STRONG>slip</STRONG>    Shows slipping blits.
+
+     <STRONG>solitare</STRONG>
+             Shows Klondike's game of solitare.
+
+     <STRONG>space</STRONG>   Shows a journey into deep space.
+
+     <STRONG>sphere</STRONG>  Shows a bunch of shaded spheres.
+
+     <STRONG>spiral</STRONG>  Shows a helical locus of points.
+
+     <STRONG>spline</STRONG>  Shows colorful moving splines.
+
+     <STRONG>sproingies</STRONG>
+             Shows Sproingies!   Nontoxic.   Safe  for  pets  and
+             small  children.   May not be available depending on
+             how it was configured.
+
+     <STRONG>stairs</STRONG>  Shows Infinite Stairs, an Escher-like GL scene.  May
+             not be available depending on how it was configured.
+
+     <STRONG>star</STRONG>    Shows a star field with a twist.
+
+     <STRONG>starfish</STRONG>
+             Shows starfish.
+
+     <STRONG>strange</STRONG> Shows strange attractors.
+
+     <STRONG>superquadrics</STRONG>
+             Shows 3D mathematical shapes.  May not be  available
+             depending on how it was configured.
+
+     <STRONG>swarm</STRONG>   Shows a swarm of bees following a wasp.
+
+     <STRONG>swirl</STRONG>   Shows animated swirling patterns.
+
+     <STRONG>t3d</STRONG>     Shows a Flying Balls Clock Demo.
+
+     <STRONG>tetris</STRONG>  Shows an autoplaying tetris game.
+
+     <STRONG>text3d</STRONG>  Shows 3D moving texts.
+
+     <STRONG>thornbird</STRONG>
+             Shows an animated Bird in a Thorn Bush fractal map.
+
+     <STRONG>tik_tak</STRONG> Shows rotating polygons.
+
+     <STRONG>triangle</STRONG>
+             Shows a triangular mountain range.
+
+     <STRONG>tube</STRONG>    Shows an animated tube.
+
+     <STRONG>turtle</STRONG>  Shows turtle fractals.
+
+     <STRONG>vines</STRONG>   Shows fractal-like vines.
+
+     <STRONG>voters</STRONG>  Shows Dewdney's Voters.
+
+     <STRONG>wator</STRONG>   Shows  Dewdney's  Water-Torus  planet  of  fish  and
+             sharks.
+
+     <STRONG>wire</STRONG>    Shows a random circuit with 2 electrons.
+
+     <STRONG>world</STRONG>   Shows spinning Earths.
+
+     <STRONG>worm</STRONG>    Shows wiggly worms.
+
+     <STRONG>xjack</STRONG>   Shows Jack having one of those days.
+
+     <STRONG>xcl</STRONG>     Shows a Control Line combat model race
+
+     <STRONG>blank</STRONG>   Shows nothing but a black screen.  Does not show  up
+             in random mode.
+
+     <STRONG>bomb</STRONG>    Shows a bomb and will autologout after a time.  Does
+             not  show  up  in  random  mode and may be available
+             depending on how it was configured.
+
+     <STRONG>random</STRONG>  Shows a random mode from  above  except  blank  (and
+             bomb).
+
+
+     -<STRONG>delay</STRONG> <EM>usecs</EM>
+          The <EM>delay</EM> option sets the speed at which  a  mode  will
+          operate.   It simply sets the number of microseconds to
+          delay between batches of animations.  In blank mode, it
+          is  important  to  set  this  to  some  small number of
+          seconds,  because  the  keyboard  and  mouse  are  only
+          checked  after  each delay, so you cannot set the delay
+          too high, but a delay of zero would needlessly  consume
+          cpu  checking  for  mouse and keyboard input in a tight
+          loop, since blank mode has no work to do.
+
+     -<STRONG>count</STRONG> <EM>num</EM>
+          The <EM>batchcount</EM> option sets number of <EM>things</EM> to  do  per
+          batch to <EM>num</EM> .
+
+          In ant mode this refers the number of ants.
+
+          In atlantis mode it is the number of sharks.
+
+          In ball mode it is the number of balls.
+
+          In bat mode it is the number of  bats,  could  be  less
+          because of conflicts.
+
+          In blot mode this refers to the number of  pixels  ren-
+          dered in the same color.
+
+          In bouboule mode it is the number of stars.
+
+          In bounce mode it is the number of balls, could be less
+          because of conflicts.
+
+          In braid mode it is the upper bound number of strands.
+
+          In bubble mode it is the number of bubbles.
+          In bubble3d mode it is the number of bubbles.
+
+          In bug mode it is the number of  bugs,  could  be  less
+          because of conflicts.
+
+          In cage mode it is means nothing.
+
+          In clock mode it is the percentage of the  screen,  but
+          less than 100%.
+
+          In coral mode it is the number of seeds.
+
+          In crystal mode it is the number of polygons.
+
+          In daisy mode it is the  number  flowers  that  make  a
+          meadow.
+
+          In dclock mode it means nothing.
+
+          In deco mode it is the depth.
+
+          In demon mode this refers the number of colors.
+
+          In dilemma mode  this  refers  the  number  of  initial
+          defectors.
+
+          In discrete mode it is the number of points.
+
+          In drift mode it is the number  of  levels  to  recurse
+          (larger = more complex).
+
+          In dragon mode it means nothing.
+
+          In euler2d mode it is the number of segments.
+
+          In eyes mode it is the number of eyes.
+
+          In fadeplot mode it is the number of steps.
+
+          In fire mode it is the number of fire particles (set it
+          to 0 to have rain).
+
+          In flag mode it means nothing.
+
+          In flame mode it is the number  of  levels  to  recurse
+          (larger = more complex).
+
+          In flow mode it is the number of bees.
+
+          In forest mode it is  the  number  trees  that  make  a
+          forest.
+
+          In galaxy mode it means the number of galaxies.
+
+          In gears mode it is the number of degrees to rotate the
+          set of gears by.
+
+          In glplanet mode it is the number of hundredth  degrees
+          to roll the planet by.
+
+          In goop mode it is the number of blobs per plane.
+
+          In grav mode it is the number of planets.
+
+          In helix mode it means nothing.
+
+          In hop mode this refers to the number  of  pixels  ren-
+          dered in the same color.
+
+          In hyper mode it the number of dimensions.
+
+          In ico mode it is the ith platonic solid.
+
+          In ifs mode it means nothing.
+
+          In image mode it means it is the  number  of  logos  on
+          screen at once.
+
+          In juggle mode it is speed in milliseconds  betewwen  a
+          throw and the next catch.
+
+          In julia mode it is the depth of recursion.
+
+          In kaleid mode it is the number of pens.
+
+          In kumppa mode it means nothing.
+
+          In lament mode it means nothing.
+
+          In laser mode it is the number lasers.
+
+          In life mode it is the number of generations  before  a
+          glider is introduced.
+
+          In life1d mode it means nothing.
+
+          In life3d mode it is the number of generations before a
+          glider is introduced.
+
+          In lisa mode it is the number of loops.
+
+          In lissie mode it is the number of worms.
+
+          In loop mode it is the number of flaws.
+          In mandelbrot mode it is the order.
+
+          In marquee mode it means nothing.
+
+          In matrix mode it means nothing.
+
+          In maze mode it means nothing.
+
+          In moebius mode it is means nothing.
+
+          In molecule mode it means nothing.
+
+          In morph3d mode it is the ith platonic solid.
+
+          In mountain mode it is the number of mountains.
+
+          In munch mode it means nothing.
+
+          In nose mode it means nothing.
+
+          In qix mode it is the number of points.
+
+          In pacman mode it means the number of ghosts.
+
+          In penrose mode it means nothing.
+
+          In petal mode it the greatest random number of petals.
+
+          In pipes mode it shows different joints,  0  random,  1
+          spherical, 2 bolted elbow, 3 elbow, and 4 alternating.
+
+          In polyominoes mode it means nothing.
+
+          In puzzle mode it the number of moves.
+
+          In pyro mode it is the maximum number flying rockets at
+          one time.
+
+          In roll mode it is the number of points.
+
+          In rotor mode it is the number of rotor  thingys  which
+          whirr...
+
+          In rubik mode it is the number of moves.
+
+          In sballs mode it is the number of spheres.
+
+          In scooter mode it is the number of doors.
+
+          In shape mode it means nothing.
+
+          In sierpinski mode it is the number of points.
+          In slip mode it means nothing.
+
+          In solitare mode it means nothing.
+
+          In space mode it is the number of stars.
+
+          In sphere mode it means nothing.
+
+          In spiral mode it is the number of spirals.
+
+          In spline mode it is the number of points "splined".
+
+          In sproingies mode it is the number of sproingies.
+
+          In stairs mode it is means nothing.
+
+          In star mode it is the number of stars on the screen at
+          once.
+
+          In starfish mode it means nothing.
+
+          In strange mode it means nothing.
+
+          In superquadrics mode its the number of horizontal  and
+          vertical lines in the superquadric.
+
+          In swirl mode it means the number of "knots".
+
+          In swarm mode it is the number of bees.
+
+          In t3d mode it means nothing.
+
+          In tetris mode it means nothing.
+
+          In text3d mode it means nothing.
+
+          In thornbird mode it is the number of points.
+
+          In triangular mode it is the number of mountains.
+
+          In tube mode it is a rectangle (= 1), an ellipse (= 2),
+          or a polygon if greater.
+
+          In turtle mode it means nothing.
+
+          In vines mode it is draw a complete vine  (=  0)  or  a
+          portion (= 1).
+
+          In voters mode it means the number of parties, 2 or 3.
+
+          In wator mode it means the breed time for the fish.
+
+          In wire mode it means the length of the circuit.
+
+          In world mode it is the number of worlds.
+
+          In worm mode it is the number of worms.
+
+          In xcl mode it represents the number of planes.
+
+          In xjack mode it means nothing.
+
+          In blank mode it means nothing.
+
+          In bomb mode it means the number of minutes to  autolo-
+          gout.
+
+          A negative <EM>count</EM> allows for randomness.  The range from
+          the  minimum allowed nonnegative <EM>count</EM> for a particular
+          mode to the ABS( <EM>count</EM> ) (or maximum  allowed  <EM>count</EM>  ,
+          whichever is less).
+
+     -<STRONG>batchcount</STRONG> <EM>num</EM>
+          The <EM>batchcount</EM> option is depreciated but  should  still
+          work as <EM>count</EM>.
+
+     -<STRONG>cycles</STRONG> <EM>num</EM>
+          The <EM>cycles</EM> option sets the number of cycles until  time
+          out  for  ant, blot, braid, bug, clock, crystal, daisy,
+          deco, demon, dilemma,  discrete,  dragon,  eyes,  flag,
+          flow,  forest,  galaxy,  helix, hop, hyper, ico, laser,
+          life, life1d, life3d, lisa, lissie,  loop,  mandelbrot,
+          mountain, petal, sierpinski, shape, spline +erase, t3d,
+          thornbird, triangle, tube,  voters,  wator,  and  wire.
+          For euler2d and worm it is the length of the lines, for
+          atlantis it is the shark speed, for fadeplot, julia and
+          spiral  it is the length of the trail of dots, munch it
+          is the minimum size of the squares, for  kaleid  it  is
+          the  % of black, for qix it is the number of lines, for
+          spline -erase it means the number of splines * 64  (for
+          compatibility  with +erase), for gears it is the number
+          of degrees to increment the spin of each gear  by,  for
+          glplanet  it  is  the  number  of  hundredth degrees to
+          rotate the planet by, for molecule it is  the  time  in
+          seconds  until  timeout,  for pipes it is the number of
+          systems to draw before clearing the screen,  for  rubik
+          it  is  the  number of steps to complete a 90 move, for
+          sballs it is the sphere speed value, for scooter it  is
+          the speed, for superquadrics it is the number of frames
+          it takes to morph  from  one  shape  to  another.   for
+          text3d  it is the number of times drawing a word before
+          the next one, For others it means nothing.
+
+     -<STRONG>size</STRONG> <EM>num</EM>
+          The <EM>size</EM> option sets the size maximum size of a star in
+          bouboule,  pyro  and  star,  size  of  ball in ball and
+          bounce, size of bat in bat, maximum size of  bubble  in
+          bubble, size of clock in clock, minimum size of rectan-
+          gles in deco, size  of  the  polygons  in  crystal  and
+          tik_tak,  size  of polyhedron in ico, size of lissie in
+          lissie, size of dots of flag, for kaleid it is the sym-
+          metry,  width  of maze hallway, size of side of penrose
+          tile, radius of loop in lisa, radius of ball  in  roll,
+          number  of  corners  in  sierpinski, number of stars in
+          scooter, size of tube in tube, width of worm  in  worm,
+          line  width  in  rotor,  size  of  cells  in  ant, bug,
+          dilemma, dragon, life, life1d, pacman, tetris,  voters,
+          wator,  and wire.  In pipes it is the maximum length of
+          a system.  In atlantis it is the shark size.   A  nega-
+          tive number allows for randomness, similar to <EM>count</EM>. In
+          fire, gears, sballs and sproingies it is  the  size  of
+          the  screen,  this  is  because on many slow systems it
+          runs too slow when the picture covers the full screen.
+
+     -<STRONG>ncolors</STRONG> <EM>num</EM>
+          The <EM>ncolors</EM> option sets the maximum number of colors to
+          be used.
+
+     -<STRONG>saturation</STRONG> <EM>value</EM>
+          The <EM>saturation</EM> option sets saturation of the color ramp
+          used  to  <EM>value</EM>  .  0  is  grayscale and 1 is very rich
+          color.  0.4 is a nice pastel.
+
+     -<STRONG>erasemode</STRONG> <EM>modename</EM>
+          As of this writing there are over 9  erase  modes  sup-
+          ported  (if  its  not  chosen its assumed random).  The
+          erase modes are random_lines, random_squares, venetian,
+          triple_wipe, quad_wipe, circle_wipe, three_circle_wipe,
+          squaretate, no_fade.
+
+     -<STRONG>erasedelay</STRONG> <EM>usecs</EM>
+          The <EM>erasedelay</EM> option sets the number  of  microseconds
+          for  steps  of  the  <STRONG>erasemode</STRONG>  (a setting of 0 and the
+          <STRONG>erasemode</STRONG> is bypassed).
+
+     <STRONG>+/-nolock</STRONG>
+          The <EM>nolock</EM> option causes <STRONG>xlock</STRONG> to only  draw  the  pat-
+          terns and not lock the display.  A key press or a mouse
+          click will terminate the screen saver.
+
+     <STRONG>-/+inwindow</STRONG>
+          Runs <STRONG>xlock</STRONG> in a window, so that you can iconify,  move,
+          or resize it and still use your screen for other stuff.
+          When running in a window, <STRONG>xlock</STRONG> no  longer  locks  your
+          screen, it just looks good.
+
+     <STRONG>-/+inroot</STRONG>
+          Runs <STRONG>xlock</STRONG> in your  root  window.   Like  the  <EM>inwindow</EM>
+          option  it  no  longer  locks the screen, it just looks
+          good.
+
+     <STRONG>-/+remote</STRONG>
+          The <EM>remote</EM> option tells <STRONG>xlock</STRONG>  to  not  stop  you  from
+          locking remote X11 servers.  This option should be used
+          with care and is intended mainly to lock X11  terminals
+          which  cannot  run  <STRONG>xlock</STRONG> locally.  If you lock someone
+          else's workstation, they will have to know  <STRONG>your</STRONG>  pass-
+          word   to  unlock  it.   Using  +<EM>remote</EM>  overrides  any
+          resource derived values for <EM>remote</EM> and  prevents  <STRONG>xlock</STRONG>
+          from  being  used  to lock other X11 servers.  (Use `+'
+          instead of `-' to override resources for other  options
+          that can take the `+' modifier similarly.)
+
+     <STRONG>-/+mono</STRONG>
+          The <EM>mono</EM> option causes  <STRONG>xlock</STRONG>  to  display  monochrome,
+          (black  and  white)  pixels  rather  than  the  default
+          colored ones on color displays.
+
+     <STRONG>-/+allowaccess</STRONG>
+          This option is required for servers which do not  allow
+          clients  to modify the host access control list.  It is
+          also useful if you need to run x clients  on  a  server
+          which is locked for some reason...  When <EM>allowaccess</EM> is
+          true, the X11 server is left open for clients to attach
+          and  thus  lowers  the  inherent  security of this lock
+          screen.  A side effect of using this option is that  if
+          <STRONG>xlock</STRONG>  is  killed -KILL, the access control list is not
+          lost.
+
+     -<STRONG>vtlock</STRONG> <EM>modename</EM>
+          This option is used on a XFree86 system  to  manage  VT
+          switching in [off|noswitch|switch|restore] mode.
+
+     <EM>off</EM>       means no VT switch locking.
+
+     <EM>switch</EM>    means VT switch locking + switching  to  xlock  VT
+               when activated.
+
+     <EM>restore</EM>   means VT switch locking + switching  to  xlock  VT
+               when  activated  +  switching  back to previous VT
+               when desactivated.
+
+     <EM>noswitch</EM>  means VT switch locking  only  when  xlock  VT  is
+               active.
+
+     <STRONG>-/+allowroot</STRONG>
+          The <EM>allowroot</EM> option allows the root password to unlock
+          the  server as well as the user who started <STRONG>xlock</STRONG>.  May
+          not be able to turn this on and off depending  on  your
+          system and how <STRONG>xlock</STRONG> was configured.
+
+     <STRONG>-/+debug</STRONG>
+          Allows <STRONG>xlock</STRONG> to be debugged by doing  all  but  locking
+          the screen.
+
+     <STRONG>-/+description</STRONG>
+          The  <EM>description</EM>  option  causes  <STRONG>xlock</STRONG>  shows  a  mode
+          description  above  password window.  The default is to
+          show this description.
+
+     <STRONG>-/+echokeys</STRONG>
+          The <EM>echokeys</EM> option causes <STRONG>xlock</STRONG> to echo '?' characters
+          for each key typed into the password prompt.  Some con-
+          sider this a security risk, so the default  is  to  not
+          echo anything.
+
+     <STRONG>-/+enablesaver</STRONG>
+          By default <STRONG>xlock</STRONG> will disable  the  normal  X  server's
+          screen  saver  since  it is in effect a replacement for
+          it.  Since it is possible to set delay parameters  long
+          enough  to  cause  phosphor burn on some displays, this
+          option will turn back on the default screen saver which
+          is very careful to keep most of the screen black.
+
+     <STRONG>-/+resetsaver</STRONG>
+          By default <STRONG>xlock</STRONG> will call XResetScreenSaver.  This may
+          be undesirable with DPMS monitors.
+
+     <STRONG>-/+grabmouse</STRONG>
+          The <EM>grabmouse</EM> option causes <STRONG>xlock</STRONG> to grab the mouse and
+          keyboard,  this is the default.  <STRONG>xlock</STRONG> can not lock the
+          screen without this.
+
+     <STRONG>-/+grabserver</STRONG>
+          The <EM>grabserver</EM> option causes <STRONG>xlock</STRONG> to grab the  server.
+          This  is not usually needed but some unsecure X servers
+          can be defeated without this.
+
+     <STRONG>-/+install</STRONG>
+          Allows <STRONG>xlock</STRONG> to install its own colormap if <STRONG>xlock</STRONG>  runs
+          out  of  colors.   May  not  work  on  with some window
+          managers (fvwm) and does  not  work  with  the  -inroot
+          option.
+
+     <STRONG>-/+mousemotion</STRONG>
+          Allows you to turn on and off the  sensitivity  to  the
+          mouse to bring up the password window.
+
+     <STRONG>-/+sound</STRONG>
+          Allows you to turn on and off sound if  installed  with
+          the capability.
+
+     <STRONG>-/+timeelapsed</STRONG>
+          Allows you to find out how long a machine is locked  so
+          you  can  complain  to an administrator that someone is
+          hogging a machine.
+
+     <STRONG>-/+usefirst</STRONG>
+          The <EM>usefirst</EM> option causes <STRONG>xlock</STRONG> to use  the  keystroke
+          which got you to the password screen as the first char-
+          acter in the password.  The default is  to  ignore  the
+          first key pressed.
+
+     <STRONG>-/+verbose</STRONG>
+          Verbose mode, tells what options it is going to use.
+
+     -<STRONG>nice</STRONG> <EM>nicelevel</EM>
+          The <EM>nice</EM> option sets system nicelevel of the <STRONG>xlock</STRONG> pro-
+          cess to <EM>nicelevel</EM> .
+
+     -<STRONG>lockdelay</STRONG> <EM>seconds</EM>
+          The <EM>lockdelay</EM> option sets the number of <EM>seconds</EM>  before
+          the  screen  needs a password to be unlocked.  Good for
+          use with an autolocking mechanism like xautolock(1).
+
+     -<STRONG>timeout</STRONG> <EM>seconds</EM>
+          The <EM>timeout</EM> option sets the number  of  <EM>seconds</EM>  before
+          the password screen will time out.
+
+     -<STRONG>font</STRONG> <EM>fontname</EM>
+          The <EM>font</EM> option sets the font to be used on the  prompt
+          screen.
+
+     -<STRONG>planfont</STRONG> <EM>fontname</EM>
+          option sets the font to be used for the  text  that  is
+          displayed in the lower part of the password screen.
+
+     -<STRONG>fg</STRONG> <EM>color</EM>
+          The <EM>fg</EM> option sets the color of the text on  the  pass-
+          word screen to <EM>color</EM> .
+
+     -<STRONG>bg</STRONG> <EM>color</EM>
+          The <EM>bg</EM> option sets the color of the background  on  the
+          password screen to <EM>color</EM> .
+
+     -<STRONG>foreground</STRONG> <EM>color</EM>
+          The <EM>foreground</EM> option sets the color of the text on the
+          password screen to <EM>color</EM> .
+
+     -<STRONG>background</STRONG> <EM>color</EM>
+          The <EM>background</EM> option sets the color of the  background
+          on the password screen to <EM>color</EM> .
+
+     -<STRONG>username</STRONG> <EM>string</EM>
+          Text <EM>string</EM> is shown in front of user name, defaults to
+          "Name: ".
+
+     -<STRONG>password</STRONG> <EM>string</EM>
+          Text <EM>string</EM> is the password prompt string, defaults  to
+          "Password: ".
+
+     -<STRONG>info</STRONG> <EM>string</EM>
+          Text <EM>string</EM> is an informational  message  to  tell  the
+          user what to do, defaults to "Enter password to unlock;
+          select icon to lock.".
+
+     -<STRONG>validate</STRONG> <EM>string</EM>
+          Text <EM>string</EM> is a message  shown  while  validating  the
+          password, defaults to "Validating login..."
+
+     -<STRONG>invalid</STRONG> <EM>string</EM>
+          Text  <EM>string</EM>  is  a  message  shown  when  password  is
+          invalid, defaults to "Invalid login."
+
+     -<STRONG>geometry</STRONG> <EM>geom</EM>
+          The <EM>geometry</EM> option sets <EM>geom</EM> the size  and  offset  of
+          the  lock  window  (normally  the  entire screen).  The
+          entire screen format is still  used  for  entering  the
+          password.  The purpose is to see the screen even though
+          it is locked.  This should be used with  caution  since
+          many of the modes will fail if the windows are far from
+          square or are too small  (size  must  be  greater  than
+          0x0).   This  should  also be used with -enablesaver to
+          protect screen from phosphor burn.
+
+     -<STRONG>icongeometry</STRONG> <EM>geom</EM>
+          The <EM>icongeometry</EM> option  sets  <EM>geom</EM>  the  size  of  the
+          iconic  screen  (normally 64x64) seen when entering the
+          password.  This should be used with caution since  many
+          of  the  modes  will  fail  if the windows are far from
+          square or are too small  (size  must  be  greater  than
+          0x0).   The  greatest size is 256x256.  There should be
+          some limit so  users  could  see  who  has  locked  the
+          screen.  Position information of icon is ignored.
+
+     -<STRONG>glgeometry</STRONG> <EM>geom</EM>
+          The <EM>glgeometry</EM> option sets <EM>geom</EM> the size of the  screen
+          for gl modes.  Not normally available or needed.
+
+     <STRONG>-/+wireframe</STRONG>
+          Turn on/off wireframe, available  on  atlantis,  daisy,
+          fire,  gears, lament, life3d, mountain, sballs, sproin-
+          gies, superquadrics, and triangle.
+
+     <STRONG>-/+showfps</STRONG>
+          Turn  on/off  frame  per  sec  display,  available   on
+          atlantis,  bubble3d, cage, fire, gears, invert, lament,
+          moebius, morph3d, rubik, sballs, stairs, and  superqua-
+          drics.
+
+     <STRONG>-/+fpstop</STRONG>
+          Turn on/off frame per sec display  on  top  of  screen,
+          used if showfps is on.
+
+     -<STRONG>fpsfont</STRONG> <EM>fontname</EM>
+          The <EM>fpsfont</EM> option sets the font  to  be  used  in  the
+          frame per sec display, used if showfps is on.
+
+     <STRONG>-/+use3d</STRONG>
+          Turn on/off 3d view, available on bouboule, pyro, star,
+          and worm.
+
+     -<STRONG>delta3d</STRONG> <EM>value</EM>
+          Space between the center of your 2 eyes for 3d mode.
+
+     -<STRONG>none3d</STRONG> <EM>color</EM>
+          Color used for empty size in 3d mode.
+
+     -<STRONG>right3d</STRONG> <EM>color</EM>
+          Color used for right eye in 3d mode.
+
+     -<STRONG>left3d</STRONG> <EM>color</EM>
+          Color used for left eye in 3d mode.
+
+     -<STRONG>both3d</STRONG> <EM>color</EM>
+          Color used for overlapping images for  left  and  right
+          eye in 3d mode.
+
+     -<STRONG>program</STRONG> <EM>programname</EM>
+          The <EM>program</EM> option sets the program to be used  as  the
+          fortune generator.  Currently used only for marquee and
+          nose modes.
+
+     -<STRONG>messagesfile</STRONG> <EM>formatted</EM>-<EM>filename</EM>
+          The <EM>messagesfile</EM> option sets the file to be used as the
+          fortune  generator.   The  first entry is the number of
+          fortunes, the next line  contains  the  first  fortune.
+          Fortunes  begin  with  a  "%%"  on  a  line  by itself.
+          Currently used only for marquee and nose modes.  If one
+          exists, it takes precedence over the fortune program.
+
+     -<STRONG>messagefile</STRONG> <EM>filename</EM>
+          The <EM>messagefile</EM> option sets the file whose contents are
+          displayed.   Currently  used  only for marquee and nose
+          modes.  If one exists, it  takes  precedence  over  the
+          fortune program and messagesfile.
+
+     -<STRONG>message</STRONG> <EM>textstring</EM>
+          The <EM>message</EM> option sets the text to be displayed  in  a
+          mode.   Currently  used only for flag, marquee and nose
+          modes.  If one exists, it  takes  precedence  over  the
+          fortune program, messagesfile and message.
+
+     -<STRONG>messagefont</STRONG> <EM>fontname</EM>
+          The <EM>messagefont</EM> option sets the font to be used in  the
+          mode.   Currently used only for flag, marquee, and nose
+          modes.
+
+     -<STRONG>bitmap</STRONG> <EM>filename</EM>
+          The <EM>bitmap</EM> option sets the xbm, xpm, or ras file to  be
+          displayed with flag, image, life, life1d, maze, or puz-
+          zle mode.  For eyes and  pacman  only  a  xbm  file  is
+          accepted.   Certain modes reject the bitmap if too big.
+          /
+
+
+
+</PRE>
+<H2>MORE OPTIONS (these may not be available)</H2><PRE>
+     -<STRONG>cpasswd</STRONG> <EM>crypted</EM>-<EM>password</EM>
+          The <EM>cpasswd</EM> option sets the key to be this text  string
+          to unlock <STRONG>xlock</STRONG> instead of password file.
+
+     -<STRONG>forceLogout</STRONG> <EM>minutes</EM>
+          The <EM>forceLogout</EM> option sets <EM>minutes</EM> to auto-logout.
+
+     -<STRONG>logoutButtonLabel</STRONG> <EM>string</EM>
+          Text <EM>string</EM> is a message  shown  inside  logout  button
+          when logout button is displayed.  Defaults to "Logout".
+
+     -<STRONG>logoutButtonHelp</STRONG> <EM>string</EM>
+          Text <EM>string</EM> is a message shown  outside  logout  button
+          when  logout  button  is displayed.  Defaults to "Click
+          the \"Logout\" button to log  out  current\n  user  and
+          make workstation available."
+
+     -<STRONG>logoutFailedString</STRONG> <EM>string</EM>
+          Text <EM>string</EM>  is  a  message  shown  when  a  logout  is
+          attempted  and  fails.   Defaults  to  "Logout  attempt
+          FAILED.\n  Current  user  could  not  be  automatically
+          logged out."
+
+     <STRONG>-/+dtsaver</STRONG>
+          Turn on/off CDE Saver Mode.  This option is only avail-
+          able if CDE support was compiled in.
+
+     -<STRONG>modulepath</STRONG> <EM>path</EM>
+          The <EM>modulepath</EM> option sets the <EM>directories</EM>  that  <STRONG>xlock</STRONG>
+          searches  for  mode  modules  to  load.   It is a colon
+          separated list of directories to  search.  If  "%S"  is
+          included  in  the  path,  it is replaced by the default
+          modulepath.  To add a private module directory  to  the
+          default  path, use something like '%S:~/mymoduledir' as
+          the path.  This option is only available if module sup-
+          port was compiled in.
+
+     -<STRONG>locksound</STRONG> <EM>string</EM>
+          Text <EM>string</EM> references  sound  to  use  at  lock  time.
+          Default  sound,  male  voice:   "Thank  you,  for  your
+          cooperation."
+
+     -<STRONG>infosound</STRONG> <EM>string</EM>
+          Text <EM>string</EM> references sound to  use  for  information.
+          Default sound, male voice:  "Identify please."
+
+     -<STRONG>validsound</STRONG> <EM>string</EM>
+          Text <EM>string</EM> references sound  to  when  a  password  is
+          valid.  Default sound, female voice:  "Complete."
+
+     -<STRONG>invalidsound</STRONG> <EM>string</EM>
+          Text <EM>string</EM> references sound  to  when  a  password  is
+          invalid.   Default  sound, female voice: "I am not pro-
+          grammed to give you that information."
+
+     -<STRONG>startCmd</STRONG> <EM>string</EM>
+          Text <EM>string</EM> command  to  execute  when  the  screen  is
+          locked.  Commonly  used instructions include:  "zaway".
+          This command, if still  running  when  the  screensaver
+          exist, will be killed.
+
+     -<STRONG>endCmd</STRONG> <EM>string</EM>
+          Text <EM>string</EM> command  to  execute  when  the  screen  is
+          unlocked.
+
+     -<STRONG>logoutCmd</STRONG> <EM>string</EM>
+          Text <EM>string</EM> command to execute when  the  program  logs
+          the  user out (either via the autologout or by pressing
+          the logout button).
+
+     -<STRONG>mailCmd</STRONG> <EM>string</EM>
+          Text <EM>string</EM> command to  execute  when  the  program  to
+          check mail.
+
+     -<STRONG>mailIcon</STRONG> <EM>string</EM>
+          Text <EM>string</EM> of file for the "mail arrived" bitmap.
+
+     -<STRONG>nomailIcon</STRONG> <EM>string</EM>
+          Text <EM>string</EM> of file for the "no mail" bitmap.
+
+     <STRONG>-dpmsstandby</STRONG>  <STRONG>seconds</STRONG>
+          Allows one to  set  DPMS  Standby  for  monitor  (0  is
+          defined  as  infinite).   (Horizontal sync on, Vertical
+          sync off, RGB guns off, power supply on, tube filaments
+          energized,   (screen  saver  mode).   Typical  17  inch
+          screen...  110 out of 120 watts with a 3  sec  recovery
+          time.)   This  option is only available if DPMS support
+          was compiled in.
+
+     <STRONG>-dpmssuspend</STRONG>  <STRONG>seconds</STRONG>
+          Allows one to  set  DPMS  Suspend  for  monitor  (0  is
+          defined  as  infinite).  (Horizontal sync off, Vertical
+          sync on, RGB guns off, power supply off, tube filaments
+          energized.   Typical  17 inch screen ...  15 out of 120
+          watts with a 3 sec recovery time.)  This option is only
+          available if DPMS support was compiled in.
+
+     <STRONG>-dpmsoff</STRONG>  <STRONG>seconds</STRONG>
+          Allows one to set DPMS Power  Off  for  monitor  (0  is
+          defined  as  infinite).  (Horizontal sync off, Vertical
+          sync off, Small auxiliary circuit stays on  to  monitor
+          the HS/VS signals to enable power on when data needs to
+          be displayed on the screen.  Typical 17 inch screen ...
+          5  out of 120 watts with a 10 sec recovery time.)  This
+          option is only available if DPMS support  was  compiled
+          in.
+
+
+
+</PRE>
+<H2>SPECIAL MODE DEPENDENT OPTIONS</H2><PRE>
+     -<STRONG>neighbors</STRONG> <EM>num</EM>
+          The <EM>neighbors</EM> option sets the number of neighbors of  a
+          cell  to  3,  4,  6,  9 (may not have real mathematical
+          meaning), or 12 for several automata modes  (<EM>ant</EM>,  <EM>bug</EM>,
+          <EM>demon</EM>,  <EM>dilemma</EM>, <EM>life</EM>, <EM>loop</EM>, and <EM>wire</EM>) (<EM>bug</EM> and <EM>loop</EM> do
+          not span this full range).  Setting it to  0  typically
+          randomizes   this,   except   where  bitmaps  are  used
+          (<EM>dilemma</EM>, <EM>life</EM>, <EM>voters</EM>, and <EM>wator</EM>).
+
+     <STRONG>-/+eyes</STRONG>
+          Turn on and off eyes for <EM>ant</EM> and <EM>bug</EM>.
+
+     <STRONG>-/+cycle</STRONG>
+          Turn on and off colour cycling  in  <EM>crystal</EM>,  <EM>starfish</EM>,
+          <EM>tetris</EM>, and <EM>tik</EM>_<EM>tak</EM>.
+
+     <STRONG>-/+trackmouse</STRONG>
+          Turn on and off mouse interaction in <EM>eyes</EM>, <EM>fire</EM>, <EM>julia</EM>,
+          <EM>solitare</EM>,  <EM>sballs</EM>,  <EM>swarm</EM>, and <EM>tetris</EM>. For <EM>solitare</EM> and
+          <EM>tetris</EM> this may not be available depending on how <STRONG>xlock</STRONG>
+          was configured.
+
+     <STRONG>-/+texture</STRONG>
+          Turn on and off texturing in <EM>fire</EM>, <EM>lament</EM>  and  <EM>sballs</EM>.
+          This  may  not  be available depending on how <STRONG>xlock</STRONG> was
+          configured.
+
+     -<STRONG>rule</STRONG> <EM>S</EM>&lt;<EM>neighborhood</EM>&gt;/<EM>B</EM>&lt;<EM>neighborhood</EM>&gt;
+          Allows one to set the rule for <EM>life</EM> and <EM>life3d</EM>. Special
+          parameters:  P, picks a random rule from all rules that
+          have known patterns; G, picks a random  rule  from  all
+          rules that have known gliders.  For <EM>life</EM> a good example
+          is Conway's rule which  is  S23/B3.   For  <EM>life3d</EM>  good
+          examples  are  Bay's  rules  which are S45/B5, S567/B6,
+          S56/B5, and S67/B67.
+
+     -<STRONG>lifefile</STRONG> <EM>filename</EM>
+          The <EM>lifefile</EM> option sets the <EM>life</EM> and <EM>life3d</EM>  lifeform.
+          Only  one format is currently supported, similar to the
+          #P xlife format.  For <EM>life3d</EM>, 2 linefeeds in a row  are
+          assumed to advance the depth.
+
+     -<STRONG>whalespeed</STRONG> <EM>num</EM>
+          Allows one to set the speed of the whales  and  dolphin
+          in <EM>atlantis</EM>.
+
+     <STRONG>-/+truchet</STRONG>
+          Turn on and off Truchet lines (trail) in <EM>ant</EM>.
+
+     <STRONG>-/+boil</STRONG>
+          Turn on and off having the bubbles bubble up in <EM>bubble</EM>.
+
+     -<STRONG>nx</STRONG> <EM>num</EM>
+          Allows one to set  the  number  of  unit  cells  in  x-
+          direction in <EM>crystal</EM>.
+
+     -<STRONG>ny</STRONG> <EM>num</EM>
+          Allows one to set  the  number  of  unit  cells  in  y-
+          direction in <EM>crystal</EM>.
+
+     <STRONG>-/+centre</STRONG>
+          Turn on and off the centering on screen in <EM>crystal</EM>.
+
+     <STRONG>-/+maxsize</STRONG>
+          Turn on and off the centering on screen in <EM>crystal</EM>.
+
+     <STRONG>-/+cell</STRONG>
+          Turn on and off the drawing of unit cell in <EM>crystal</EM>.
+
+     <STRONG>-/+grid</STRONG>
+          Turn on and off the drwing of grid of  unit  cells  (if
+          -cell is on) in <EM>crystal</EM>.
+
+     <STRONG>-/+garden</STRONG>
+          Turn off and on garden look in <EM>daisy</EM>.
+
+     <STRONG>-/+popex</STRONG>
+          Turn on and off the  population  explosion  counter  in
+          <EM>dclock</EM>.
+
+     <STRONG>-/+forest</STRONG>
+          Turn on and off the tropical deforest  (hectares/acres)
+          counter in <EM>dclock</EM>.
+
+     <STRONG>-/+hiv</STRONG>
+          Turn on and off the HIV infection counter in <EM>dclock</EM>.
+
+     <STRONG>-/+lab</STRONG>
+          Turn on and off the Animal Research counter in <EM>dclock</EM>.
+
+     <STRONG>-/+veg</STRONG>
+          Turn on and  off  the  Animal  Consumation  counter  in
+          <EM>dclock</EM>.
+
+     <STRONG>-/+y2k</STRONG>
+          Turn on and off the Year 2000 countdown in <EM>dclock</EM>.
+
+     <STRONG>-/+millennium</STRONG>
+          Turn on and off the Second Millennium (January 1, 2001)
+          countdown in <EM>dclock</EM>.
+
+     -<STRONG>bonus</STRONG> <EM>value</EM>
+          Allows one to set the bonus for cheating... between 1.0
+          and 4.0 in <EM>dilemma</EM>.
+
+     <STRONG>-/+conscious</STRONG>
+          Turn off and on self-awareness in <EM>dilemma</EM>.
+
+     <STRONG>-/+grow</STRONG>
+          Turn  on  and  off  growing  fractals  (else  they  are
+          animated) for <EM>drift</EM>.
+
+     <STRONG>-/+liss</STRONG>
+          Turn on and off using lissajous figures to  get  points
+          for <EM>drift</EM>.
+
+     <STRONG>-/+framerate</STRONG>
+          Turn on and off displaying of the frame rate  for  <EM>fire</EM>
+          and <EM>sballs</EM>
+
+     <STRONG>-/+fog</STRONG>
+          Turn on and off fog for <EM>fire</EM>.
+
+     <STRONG>-/+shadows</STRONG>
+          Turn on and off shadows for <EM>fire</EM>.
+
+     <STRONG>-trees</STRONG> <EM>num</EM>
+          Validate the displaying of trees for  <EM>fire</EM>  if  greater
+          than zero.
+
+     <STRONG>-/+invert</STRONG>
+          Turn on and off inverting of the <EM>flag</EM>.
+
+     <STRONG>-/+tracks</STRONG>
+          Turn on and off star tracks in <EM>galaxy</EM>.
+
+     <STRONG>-/+light</STRONG>
+          Turn on and off lighting of the planet for <EM>glplanet</EM>.
+
+     <STRONG>-/+bounce</STRONG>
+          Turn on and off bouncing movement  of  the  planet  for
+          <EM>glplanet</EM>.
+
+     -<STRONG>pimage</STRONG> <EM>filename</EM>
+          Use the named xbm or xpm file for texturing the  planet
+          for  <EM>glplanet</EM>.  Use BUILTIN as filename for the builtin
+          image taken from Xearth.
+
+     <STRONG>-/+roll</STRONG>
+          Turn on and off rolling of the planet for <EM>glplanet</EM>.
+
+     <STRONG>-/+rotate</STRONG>
+          Turn on and off rotation of the planet for <EM>glplanet</EM>.
+
+     <STRONG>-/+texture</STRONG>
+          Turn on and off texturing of the planet for <EM>glplanet</EM>.
+
+     <STRONG>-/+stars</STRONG>
+          Turn on and off showing stars  in  the  background  for
+          <EM>glplanet</EM>.
+
+     <STRONG>-/+decay</STRONG>
+          Turn on and off decaying orbits for <EM>grav</EM>.
+
+     <STRONG>-/+trail</STRONG>
+          Turn on and off decaying trail of dots for <EM>grav</EM>.
+
+     <STRONG>-/+ellipse</STRONG>
+          Turn on and off ellipse format in <EM>helix</EM>.
+
+     <STRONG>-/+martin</STRONG>
+          Turn on and off  Barry  Martin's  square  root  <EM>hop</EM>.  <STRONG>-</STRONG>
+          <STRONG>/+popcorn</STRONG>  Turn  on and off Clifford A. Pickover's pop-
+          corn <EM>hop</EM>.
+
+     <STRONG>-/+ejk1...ejk6</STRONG>
+          Turn on and off Ed J. Kubaitis' <EM>hops</EM>.
+
+     <STRONG>-/+rr</STRONG>
+          Turn on and off Renaldo Recuerdo's <EM>hop</EM>.
+
+     <STRONG>-/+jong</STRONG>
+          Turn on and off Jong's <EM>hop</EM>.
+
+     <STRONG>-/+sine</STRONG>
+          Turn on and off Barry Martin's sine <EM>hop</EM>.
+
+     -<STRONG>pattern</STRONG> &lt;<EM>pattern</EM>&gt;
+          Allows one to set the pattern for <EM>juggle</EM>.
+
+     -<STRONG>patterntrace</STRONG> <EM>num</EM>
+          Allows one to see the trails for <EM>juggle</EM>.
+
+     <STRONG>-/+solid</STRONG>
+          Turn off and on solid color (else its a  4  panel  look
+          (half white)) for <EM>juggle</EM>.
+
+     <STRONG>-/+uni</STRONG>
+          Turn off and on Unicycle for <EM>juggle</EM>.
+
+     <STRONG>-/+disconnected</STRONG>
+          Turn on and off disconnected pen movement in <EM>kaleid</EM>.
+
+     <STRONG>-/+serial</STRONG>
+          Turn on and off  sequential  allocation  of  colors  in
+          <EM>kaleid</EM>.
+
+     <STRONG>-/+alternate</STRONG>
+          Turn on and off alternate rotated display mode <EM>kaleid</EM>.
+
+     <STRONG>-/+quad</STRONG>
+          Turn on and off quad mirrored/rotated mode  similar  to
+          size 4 in <EM>kaleid</EM>.
+
+     <STRONG>-/+oct</STRONG>
+          Turn on and off oct mirrored/rotated  mode  similar  to
+          size 8 in <EM>kaleid</EM>.
+
+     <STRONG>-/+linear</STRONG>
+          Turn on and  off  Cartesian/Polar  coordinate  mode  in
+          <EM>kaleid</EM>.
+
+     <STRONG>-/+callahan</STRONG>
+          Turn on and off  Paul  Callahan's  S2b34/B2a  hexagonal
+          <EM>life</EM>.
+
+     <STRONG>-/+andreen</STRONG>
+          Turn on and off Bob Andreen's S2a2b4a/B2a3a4b hexagonal
+          <EM>life</EM>.
+
+     <STRONG>-/+totalistic</STRONG>
+          Turn on and off totalistic rules for <EM>life1d</EM>. If this is
+          off  then  it  follows  rules  of  the LCAU collection.
+          These rules may not be symmetric and are more general.
+
+     <STRONG>-/+additive</STRONG>
+          Turn on and off additive functions mode in <EM>lisa</EM>.
+
+     <STRONG>-/+noants</STRONG>
+          Turn off and on ants in <EM>moebius</EM>.
+
+     <STRONG>-/+solidmoebius</STRONG>
+          Turn on and off solid Mobius strip in <EM>moebius</EM>.
+
+     <STRONG>-/+atoms</STRONG>
+          Turn on and off the drawing of spheres for the atoms in
+          <EM>molecule</EM>.
+
+     <STRONG>-/+bbox</STRONG>
+          Turn on and off showing the molecules in a blue box  in
+          <EM>molecule</EM>.
+
+     <STRONG>-/+bonds</STRONG>
+          Turn on and off the drawing  of  the  atomic  bonds  in
+          <EM>molecule</EM>.
+
+     -<STRONG>molecule</STRONG> <EM>filename</EM>
+          Read a molecule structure from a pdb file in <EM>molecule</EM>.
+
+     <STRONG>-/+labels</STRONG>
+          Turn on and off the labeling of the atoms in <EM>molecule</EM>.
+
+     -<STRONG>spin</STRONG>{<EM>x</EM>|<EM>y</EM>|<EM>z</EM>}
+          Set the axis for molecule  rotation  in  <EM>molecule</EM>.  The
+          default is "XYZ".
+
+     <STRONG>+spin</STRONG>
+          Turn off the molecule rotation in <EM>molecule</EM>.
+
+     <STRONG>-/+titles</STRONG>
+          Turn on and off the molecule description in <EM>molecule</EM>.
+
+     <STRONG>-/+wander</STRONG>
+          Turn on and off the moving of the molecule on a  sinoid
+          curve in <EM>molecule</EM>.
+
+     <STRONG>-/+ammann</STRONG>
+          Turn on and off lines for <EM>penrose</EM>.
+
+     -<STRONG>increment</STRONG> <EM>value</EM>
+          Allows fine adjustments to order in <EM>mandelbrot</EM>.
+
+     <STRONG>-/+erase</STRONG>
+          Turn on and off erasing for <EM>spline</EM>. If this  option  is
+          on,  <EM>cycles</EM>  is  divided by 64 to compute the number of
+          lines, so as to be compatible when using -fullrandom.
+
+     -<STRONG>factory</STRONG> <EM>num</EM>
+          Number of extra factory parts in <EM>pipes</EM>.
+
+     <STRONG>-/+fisheye</STRONG>
+          Turn on if you want a zoomed-in view of <EM>pipes</EM>.
+
+     <STRONG>-/+tightturns</STRONG>
+          Turn on if you want the <EM>pipes</EM> to bend more often.
+
+     <STRONG>-/+rotatepipes</STRONG>
+          Turn on if you want the pipe system rotated in <EM>pipes</EM>.
+
+     <STRONG>-/+complete</STRONG>
+          Turn on or off complete graph morphing in <EM>qix</EM>.
+
+     -<STRONG>size[xyz]</STRONG> <EM>num</EM>
+          Number represents the number of cubies on the x, y,  or
+          z  axis.   Negative  numbers offer randomness from 2 to
+          the absolute value of the number.  <EM>star</EM>.
+
+     <STRONG>-/+hideshuffling</STRONG>
+          Turn on or off hidden shuffle phase for <EM>rubik</EM>.
+
+     <STRONG>-/+border</STRONG>
+          Turn on or off borders in <EM>shape</EM>.
+
+     <STRONG>-/+</STRONG><EM>shape</EM>
+          Turn on or off shadowing in <EM>shape</EM>.
+
+     <STRONG>-/+</STRONG><EM>shape</EM>
+          Turn on or off stippling in <EM>shape</EM>.
+
+     -<STRONG>intensity</STRONG> <EM>value</EM>
+          Set the brightness (default  2185)  of  the  sierpinski
+          structure for <EM>sierpinski3d</EM>.
+
+     -<STRONG>maxdepth</STRONG> <EM>value</EM>
+          Set the maximum depth (up  to  10)  of  the  sierpinski
+          structure for <EM>sierpinski3d</EM>.
+
+     -<STRONG>speed</STRONG> <EM>value</EM>
+          Determines after how much steps the depth  changes  for
+          <EM>sierpinski3d</EM>.
+
+     -<STRONG>trek</STRONG> <EM>num</EM>
+          If its a high number you will see the  space  ship  all
+          the time in <EM>star</EM>.
+
+     <STRONG>-/+rock</STRONG>
+          Turn on and off rocks for <EM>star</EM>. If this is  off,  stars
+          will be seen instead.
+
+     <STRONG>-/+straight</STRONG>
+          Turn on if <EM>star</EM> gets you motion sick.
+
+     -<STRONG>cyclepeed</STRONG> <EM>num</EM>
+          Set speed of cycling in <EM>starfish</EM>.
+
+     -<STRONG>rotation</STRONG> <EM>num</EM>
+          Set rotation velocity in <EM>starfish</EM>.
+
+     -<STRONG>thickness</STRONG> <EM>num</EM>
+          Set thickness in <EM>starfish</EM>.
+
+     <STRONG>-/+rock</STRONG>
+          Turn on and off blob for <EM>starfish</EM>.
+
+     -<STRONG>spinspeed</STRONG> <EM>num</EM>
+          Set speed of rotation, in degrees per frame for  <EM>super-</EM>
+          <EM>quadrics</EM>.
+
+     <STRONG>-/+bonus</STRONG>
+          Turn on in <EM>tetris</EM> to see 5 square bonus pieces.
+
+     <STRONG>-/+well</STRONG>
+          Turn on in <EM>tetris</EM> to see welltris.
+
+     -<STRONG>ttfont</STRONG> <EM>filename</EM>
+          Sets the True Type font file (or font  directory)  used
+          for <EM>text3d</EM>
+
+     -<STRONG>extrusion</STRONG> <EM>num</EM>
+          Sets length of the text extrusion for <EM>text3d</EM>
+
+     -<STRONG>rot_amplitude</STRONG> <EM>float</EM>
+          Sets rotation amplitude value of each letter for <EM>text3d</EM>
+
+     -<STRONG>rot_frequency</STRONG> <EM>float</EM>
+          Sets rotation frequency for <EM>text3d</EM>
+
+     <STRONG>-/+no_split</STRONG>
+          Turn on and off word splitting for <EM>text3d</EM>
+
+     -<STRONG>ttanimate</STRONG> <EM>function</EM>_<EM>name</EM>
+          Sets the animation function used for <EM>text3d</EM>.  Currently
+          one  of  :  Random  FullRandom  Default  Default2  None
+           Crazy  UpDown  Extrude  RotateXY  RotateYZ   Frequency
+           Amplitude
+
+     -<STRONG>speed</STRONG> <EM>km</EM>/<EM>h</EM>
+          The speed for all planes in km/h for <EM>xcl</EM>.
+
+     -<STRONG>frametime</STRONG> <EM>microseconds</EM>
+          The time for one frame on the screen. This time is used
+          to calculate the delay time and depends on the speed of
+          the X server for <EM>xcl</EM>.
+
+     -<STRONG>line_length</STRONG> <EM>mm</EM>
+          The distance between the pilot and the plane for <EM>xcl</EM>.
+
+     -<STRONG>spectator</STRONG> <EM>mm</EM>
+          The distance between spectator and pilot. It should  be
+          grater  than the line_length and the half wing width of
+          the plane to be not dangerous  for  the  spectator  for
+          <EM>xcl</EM>.
+
+     -<STRONG>viewmodel</STRONG>
+          Shows an animated view of one model for <EM>xcl</EM>.
+
+     <STRONG>-/+oldcolor</STRONG>
+          Sets the colors for the first two planes fixed  to  red
+          and yellow in <EM>xcl</EM>.
+
+     -<STRONG>xcldebug</STRONG>
+          Shows some additional timing information to  make  sure
+          that the calibrate procedure goes right in <EM>xcl</EM>.
+
+     -<STRONG>automatic</STRONG>
+             The auto scale for automatic fit into the window  is
+             <EM>De</EM>activated with this option for <EM>xcl</EM>.
+
+     -<STRONG>randomstart</STRONG>
+          Use a random start point for models at startup for <EM>xcl</EM>.
+
+     -<STRONG>duration</STRONG> <EM>seconds</EM>
+          Allows one to set a duration  for  a  mode  in  <EM>random</EM>.
+          Duration of 0 is defined as infinite.
+
+     <STRONG>-/+fullrandom</STRONG>
+          Turn on/off randomness options within modes in  <EM>random</EM>.
+          Not implemented for all mode options.
+
+     -<STRONG>modelist</STRONG> <EM>textstring</EM>
+          Allows one to pass a list of files to randomly  display
+          to <EM>random</EM>. "all" will get all files but blank (and bomb
+          if  compiled  in).  "all,blank"  will  get  all  modes.
+          "all,-image bounce,+blank" will get all modes but image
+          and bounce.  "bug wator" will get only bug  and  wator.
+          "allgl"  will  get  only  the  GL modes if compiled in,
+          all-allgl will get all but the GL modes, "allnice" will
+          weed  out  high cpu usage modes (as well as hackers and
+          gl modes).  "allxpm" will get all modes that  use  xpm.
+          "allwrite"  will  get  all modes that take advantage of
+          writable colormaps (not including xpm).   "all3d"  will
+          get all the modes that support this option.  "allmouse"
+          will get all the modes that support mouse  interaction.
+          Similarly,  "allautomata" for automata modes, "allfrac-
+          tal" for  fractal  modes,  "allgeometry"  for  geometry
+          modes,  "allspace"  for  space  modes.  The random mode
+          itself can not be referenced.
+
+     <STRONG>-/+sequential</STRONG>
+          Turn on non-random <EM>random</EM> option.
+
+
+
+</PRE>
+<H2>**WARNING**</H2><PRE>
+     <STRONG>xlock</STRONG> can appear to hang if it is  competing  with  a  high-
+     priority  process  for  the  CPU.  For  example, if <STRONG>xlock</STRONG> is
+     started after a process with  'nice  -20'  (high  priority),
+     <STRONG>xlock</STRONG> will take  considerable amount of time to respond.
+
+
+
+</PRE>
+<H2>SHADOW PASSWORDS</H2><PRE>
+     If the machine is using a shadow password system, then <STRONG>xlock</STRONG>
+     may  not  be  set up to get the real password and so must be
+     given one of its own. This can  be  either  on  the  command
+     line,   via   the   <STRONG>-cpasswd</STRONG>   option,   or   in   the  file
+     <STRONG>$HOME/.xlockrc</STRONG>, with the first taking precedence.   In  both
+     cases  an  encrypted  password is expected (see makekey(8)).
+     If neither is given, then <STRONG>xlock</STRONG> will prompt for  a  password
+     and  will  use that, also storing an encrypted version of it
+     in <STRONG>$HOME/.xlockrc</STRONG> for future use.
+
+
+
+</PRE>
+<H2>BUGS</H2><PRE>
+     "kill -KILL <STRONG>xlock</STRONG> " causes the server that was locked to  be
+     unusable, since all hosts (including localhost) were removed
+     from the access control list to lock out new X clients,  and
+     since  <STRONG>xlock</STRONG>  could  not catch SIGKILL, it terminated before
+     restoring the access control list.  This will  leave  the  X
+     server  in  a state where "<EM>you</EM> <EM>can</EM> <EM>no</EM> <EM>longer</EM> <EM>connect</EM> <EM>to</EM> <EM>that</EM>
+     <EM>server</EM>, <EM>and</EM> <EM>this</EM> <EM>operation</EM> <EM>cannot</EM>  <EM>be</EM>  <EM>reversed</EM>  <EM>unless</EM>  <EM>you</EM>
+     <EM>reset</EM>  <EM>the</EM> <EM>server</EM>."            -From the X11R4 Xlib Documen-
+     tation, Chapter 7.
+     NCD terminals do not allow xlock to  remove  all  the  hosts
+     from  the  access  control list.  Therefore you will need to
+     use the "-remote" and "-allowaccess" switches.  If you  hap-
+     pen  to run without "-allowaccess" on an NCD terminal, <STRONG>xlock</STRONG>
+     will not work and you will need to reboot the  terminal,  or
+     simply  go into the SETUP menus, under 'Network Parameters',
+     and turn off TCP/IP access control.
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+     X(1), Xlib Documentation.
+
+
+
+</PRE>
+<H2>AUTHOR</H2><PRE>
+     Maintained by:
+          David Albert Bagley, &lt;<EM>bagleyd</EM>@<EM>tux</EM>.<EM>org</EM>&gt;
+
+     The latest version is currently at:
+          <EM>ftp</EM>://<EM>ftp</EM>.<EM>tux</EM>.<EM>org</EM>/<EM>pub</EM>/<EM>tux</EM>/<EM>bagleyd</EM>/<EM>xlockmore</EM>
+          <EM>ftp</EM>://<EM>ftp</EM>.<EM>x</EM>.<EM>org</EM>/<EM>contrib</EM>/<EM>applications</EM>
+
+     Original Author:
+          Patrick J. Naughton, &lt;<EM>naughton</EM>@<EM>eng</EM>.<EM>sun</EM>.<EM>com</EM>&gt;
+          Mailstop 21-14
+          Sun Microsystems Laboratories, Inc.
+          Mountain View, CA  94043
+          415/336-1080
+
+     with many additional contributors.
+
+
+
+</PRE>
+<H2>COPYRIGHT</H2><PRE>
+     Copyright (c) 1988-1991 by Patrick J. Naughton
+     Copyright (c) 1993-2001 by David A. Bagley
+
+     Permission  to  use,  copy,  modify,  and  distribute   this
+     software  and  its documentation for any purpose and without
+     fee is hereby granted, provided  that  the  above  copyright
+     notice  appear  in  all  copies and that both that copyright
+     notice and this permission notice appear in supporting docu-
+     mentation.
+     The original BSD daemon is Copyright (c) 1988 Marshall  Kirk
+     McKusick.  All Rights Reserved.
+     DEC, HP, IBM, Linux, SCO, SGI,  and  Sun  icons  have  their
+     respective copyrights.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</PRE>
+</BODY>
+</HTML>
diff --git a/etc/README.etc b/etc/README.etc
new file mode 100644 (file)
index 0000000..e1f9cb1
--- /dev/null
@@ -0,0 +1,55 @@
+These files are just examples of configuration files for xlock and
+other tools which I use.  They are not normally required.
+
+descrip.mms is no longer maintained since I can no longer check it on my
+  VMS system.  make.com should work fine.
+fortune.dat is for those who do not have fortune.
+play.sh is a hack to get sound.
+rplay* are ideas for setting up a more sophisticated sound package.
+system.*wm*rc.xlock files are for fvwm2, fvwm, WindowMaker, openwin
+  (olwm & olvwm) and motif (mwm and dtwm) window managers.
+  By default they include all modes which may not be available depending
+  on your system.  The openwin file can be referenced directly, the others
+  need to be placed in menu files.
+xlock*life.pl stuff is for adding life patterns to life.c not all formats
+  are handled.  However, the major format that is not handled here is close
+  to the format I use already in life.c.
+glider.life and glider.hlife are simple examples of files that can be read
+  into the life mode like:
+     "-lifefile glider.life" (which works with "-neighbors 8 -rule S23/B3")
+     "-lifefile glider.hlife" (which works with "-callahan" or
+             "-neighbors 6 -rule S2b34/B2a")
+  There is a limit of 128 initial live cells set by NUMFILEPTS in life.c.
+glider.3dlife is a simple example of a files that can be read into the
+  life3d mode like:
+     "-life3dfile glider.3dlife" (which works with "-rule3d S45/B5")
+  There is a limit of 84 initial live cells set by NUMFILEPTS in life3d.c.
+xlockrandimage.pl picks a random image.  Does not have to be used since
+  it is built in, one can just give a directory name.  Some really old UNIX
+  systems might not have dirent.h.
+
+Contributed by Charles Vidal <vidalc@club-internet.fr>
+xlock.tcl is another xlock launcher similar to xmlock but using tcl.
+xlock.java and xlockFrame.java is yet another xlock launcher similar to
+  xmlock but this time using java.  Requires at least JDK 1.1.1 to spawn
+  xlock.
+
+Contributed by Igor Markov <imarkov@math.ucla.edu>
+xlocksat.pl  use like "xlock -saturation `xlocksat.pl`"  The idea is that
+  high saturation looks weird at night and low saturation looks weird
+  during the day.  Unfortuantely, as the day progresses the saturation does
+  not change.
+xlockranddur.pl  use like "xlock random -duration `xlockranddur.pl`"
+  This gives a random duration of a mode (providing you have fortune!).
+
+Contributed by R. Cohen-Scali <remi.cohenscali@pobox.com>
+vtswitch       is a command line tool to disable/enable VT switching for Linux.
+               Do "chown root.bin vtswitch; chmod 4755 vtswitch"
+
+Contributed by Michael P. Duane <mduane@metapath.com>
+chkmbox: for those tired of typing in password just to see if you have
+  email.  chkmbox is a sample mailbox check program.  It has only been
+  run on Linux (2.0.27) workstation against a Solaris server with IMAP2.
+  For those using standard UNIX "mail -e" should work fine (Solaris
+  "/usr/ucb/mail -e" and AIX & HPUX "/usr/bin/mail -e")... see
+  xlock/XLock.ad .
diff --git a/etc/chkmbox/Mail.xpm b/etc/chkmbox/Mail.xpm
new file mode 100644 (file)
index 0000000..b901658
--- /dev/null
@@ -0,0 +1,88 @@
+/* XPM */
+static char * image_name[] = {
+"56 46 39 1",
+"      c #FFFFFBEEFFFF",
+".     c #B6DAAEBAB6DA",
+"X     c #082004100820",
+"o     c #9E799A699E79",
+"O     c #8E388A288E38",
+"+     c #38E36DB6A699",
+"@     c #BEFBB6DABEFB",
+"#     c #000000001861",
+"$     c #A69979E78E38",
+"%     c #79E786179E79",
+"&     c #A699A289A699",
+"*     c #AEBAAEBAB6DA",
+"=     c #000008200820",
+"-     c #000000001040",
+";     c #8E38861779E7",
+":     c #A6999E79A699",
+">     c #71C679E78617",
+",     c #AEBA9E795965",
+"<     c #AEBAB2CACF3C",
+"1     c #96589658AEBA",
+"2     c #514471C68E38",
+"3     c #FFFFF3CEFFFF",
+"4     c #C71BBAEAC71B",
+"5     c #CF3CC71BCF3C",
+"6     c #EFBEF3CEF7DE",
+"7     c #69A669A671C6",
+"8     c #FFFFFFFFFFFF",
+"9     c #AEBAA69971C6",
+"0     c #AEBA61856185",
+"q     c #AEBAA699AEBA",
+"w     c #71C675D671C6",
+"e     c #5144A2894924",
+"r     c #861779E78617",
+"t     c #BEFBC30BCF3C",
+"y     c #69A68617BEFB",
+"u     c #A699A699A699",
+"i     c #965896589658",
+"p     c #F7DEB2CAAEBA",
+"a     c #51445555FFFF",
+"                                                       .",
+" ......................................................X",
+" ...............oOO+O+O+O+OOoo.........................X",
+" ........@....OO++++++++++X+X++o...@....@....@....@....X",
+" o@..o@..o.@O++XoOo+#+#+@$%+OXXX+&...o@..o@..o..@o...o@X",
+" ...@.*....O=+X+X+X.O-+=;%$OX+XXXXo*@....*...*@....*@..X",
+" o.o.o@o@o+X+X+:oX+$+++$++.>,#+X+XXo.o@o@o@o@o.o@o@o.o.X",
+" @*@..o.*+X+#+o.O@<*@+$*$*,1>$X+X+XXo.o*...*..o.*.*...oX",
+" o.o.o@o+X+X++@2++O@.*<%@%1%-+>X+-+XXo@o@o@o@1.o@o@o@o@X",
+" @..:*.+X+-+-++++$%..<..O<>,OO#+X+X+XX1.o*..o...o...o*.X",
+" o.o.oOX+X+++++$%. .3..O.O.24O+XXXOX+X+o<o.1.o.o.1@1.o.X",
+" .o.@.X+-+-+-++@  .......*1$O+X+OX++XXX+o.o...o.o.o...oX",
+" o.o.++X++++$56@ . . ..O.O.7<X+XOXX+OXXX.:.o@1.o<o.o@1.X",
+"3@1.o+#+-++O*     . ......O@O%$+X+-+X+XX+.o.o.:.o.o<o.oX",
+" o.1OX+o:O+$3. . . . ....O<;.O+X+X+X+-+XXo.1.o.o.o.o.o.X",
+"3oo.++Xo:*5+  8   . ......>9>$X+X+-+X+X+X+o.:o:.o:o.:ooX",
+" o@%OX+O++3* .8@8. . ..O.O.%.-+-+-+-+-XXX+.o.o.o.o.:.o.X",
+" o10O.X+<++ .8.8. .....@..O.O+-+X+X+X+X+XXoo:oo1oooooooX",
+" o.+OOqX+q3+ .8.8.8.8.@O.O.O.X+X+-+-+XXOXX.1.o.o.1.o.1.X",
+" oo%%*O.X@*@...*......*...%$O+X+X+-+XX XOXoo:oo:ooo1oooX",
+" oq+;O@OO-+$%.. . .....O.O@w<O+-+X+-X   XOoo.e+r<o:o4ooX",
+"3oo+O1O..OX+X+=........<$eOOOOo+-+XX     -%>++3#e$:ooooX",
+" o:+>:.O.X+X+-+X+O.O.O.O.$<O0+2+o+X   .   X+4  @+*:ooo:X",
+" :o+2,ooO+X+X+X+=+@..@O%$;O12o+;+X   . . ..     #e1:$:oX",
+" O1+:O>o:X+-+X+-+X$X.O.O*>O+O+>+X   . ...    .  t+1o1e1X",
+"3oo+O$O%:+X+-+-+X+X+=+%$OO1>,1+X   . ..    ..    #eo::oX",
+" oo0+%+;$%+-+X+-+-+X+X++%+,+2+#   ...    ..  ..  @+$oeqX",
+"3ooy+;1>%O++X+-+X+X+X+#>9>+$+X   ..    ..  ..     ->::oX",
+" eqe$+$+%$>O+X+X+-+-+XO++++++@@..@................@.O0<X",
+" ::q1=0%>,O>u+X+X+X+X+O#36 3 3   888                +>iX",
+" $oOo+++O+2+OX+-+-+-++$X  .. . .  888          upu  X+:X",
+" o%ooo#++>+O>+-+X+XoO%+X  . . .                ;u,  -,OX",
+" ,O%o%;+++$+O-+-+-o+$+>X                       +pp  X+oX",
+" :>o;:$+#++O++X+X++>+++X                       ppp  ->OX",
+" %1Oo%oO++++$#+Xu+;+$++#           O%...            X+:X",
+" >,o$OOo$+#+++-++++++++X                            XOOX",
+" O1Oo%o%qO+++++-++++++-X           O;.O..O...       X+1X",
+" ;$e%;$,2$$++-+++++a+++X                            XOOX",
+" $1$*%OO:%o1q++-+-+X+-+-           $%..O.O;@8       X+oX",
+" %O%O21O%%Oi2$$+-+-+-+-X                88 8        X$OX",
+" ;,>o,$O1%>O:O%;&++X+X+X                 88 8       X+>-",
+"6%$%%>%O>,O0OO%$>O>$$OOX                88 8        X2,X",
+" %o%$%OO%$:%%,>%1,1%;>OO++=X=XX=X=XX=XXXXXXXXX=XX=XXX+>-",
+" i;$e%$%>O%;12OO%$;%1>92$O+O+O+O+O+O+O+O+O+O+O+O+O+O+OOX",
+" $>9$>OOe$>OO01O%%$>,2>1;$>OO$>,>O$>,>O$>,2OO$>,>O$>9>1X",
+".XXX--XX#--X-XXXXXXXX--XXX-X-X-X--X-X--X-X-X-X-X--X-XXXX"};
diff --git a/etc/chkmbox/Makefile b/etc/chkmbox/Makefile
new file mode 100644 (file)
index 0000000..e310776
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Makefile for chkmbox
+#
+
+CC=    gcc
+LN=    gcc
+
+CFLAGS=        -c -O2 -Wall
+
+XMBOX_OBJS=    chkmbox.o imapsocket.o
+
+all:   chkmbox
+
+.c.o:
+       $(CC) $(CFLAGS) $<
+
+chkmbox.o:     imapsocket.h
+
+chkmbox:       $(XMBOX_OBJS)
+       $(LN) -o $@ $(XMBOX_OBJS)
+
diff --git a/etc/chkmbox/NoMail.xpm b/etc/chkmbox/NoMail.xpm
new file mode 100644 (file)
index 0000000..21c69d5
--- /dev/null
@@ -0,0 +1,88 @@
+/* XPM */
+static char * image_name[] = {
+"56 46 39 1",
+"      c #FFFFFBEEFFFF",
+".     c #B6DAAEBAB6DA",
+"X     c #082004100820",
+"o     c #9E799A699E79",
+"O     c #8E388A288E38",
+"+     c #38E36DB6A699",
+"@     c #BEFBB6DABEFB",
+"#     c #000000001861",
+"$     c #A69979E78E38",
+"%     c #79E786179E79",
+"&     c #A699A289A699",
+"*     c #AEBAAEBAB6DA",
+"=     c #000008200820",
+"-     c #000000001040",
+";     c #8E38861779E7",
+":     c #A6999E79A699",
+">     c #71C679E78617",
+",     c #AEBA9E795965",
+"<     c #AEBAB2CACF3C",
+"1     c #96589658AEBA",
+"2     c #514471C68E38",
+"3     c #FFFFF3CEFFFF",
+"4     c #C71BBAEAC71B",
+"5     c #CF3CC71BCF3C",
+"6     c #EFBEF3CEF7DE",
+"7     c #69A669A671C6",
+"8     c #FFFFFFFFFFFF",
+"9     c #AEBAA69971C6",
+"0     c #AEBA61856185",
+"q     c #AEBAA699AEBA",
+"w     c #71C675D671C6",
+"e     c #5144A2894924",
+"r     c #861779E78617",
+"t     c #BEFBC30BCF3C",
+"y     c #69A68617BEFB",
+"u     c #A699A699A699",
+"i     c #965896589658",
+"p     c #F7DEB2CAAEBA",
+"a     c #51445555FFFF",
+"                                                       .",
+" ......................................................X",
+" ...............oOO+O+O+O+OOoo.........................X",
+" ........@....OO++++++++++X+X++o...@....@....@....@....X",
+" o@..o@..o.@O++XoOo+#+#+@$%+OXXX+&...o@..o@..o..@o...o@X",
+" ...@.*....O=+X+X+X.O-+=;%$OX+XXXXo*@....*...*@....*@..X",
+" o.o.o@o@o+X+X+:oX+$+++$++.>,#+X+XXo.o@o@o@o@o.o@o@o.o.X",
+" @*@..o.*+X+#+o.O@<*@+$*$*,1>$X+X+XXo.o*...*..o.*.*...oX",
+" o.o.o@o+X+X++@2++O@.*<%@%1%-+>X+-+XXo@o@o@o@1.o@o@o@o@X",
+" @..:*.+X+-+-++++$%..<..O<>,OO#+X+X+XX1.o*..o...o...o*.X",
+" o.o.oOX+X+++++$%. .3..O.O.24O+XXXOX+X+o<o.1.o.o.1@1.o.X",
+" .o.@.X+-+-+-++@  .......*1$O+X+OX++XXX+o.o...o.o.o...oX",
+" o.o.++X++++$56@ . . ..O.O.7<X+XOXX+OXXX.:.o@1.o<o.o@1.X",
+"3@1.o+#+-++O*     . ......O@O%$+X+-+X+XX+.o.o.:.o.o<o.oX",
+" o.1OX+o:O+$3. . . . ....O<;.O+X+X+X+-+XXo.1.o.o.o.o.o.X",
+"3oo.++Xo:*5+  8   . ......>9>$X+X+-+X+X+Xeo.:o:.o:o.:ooX",
+" o@%OX+O++3* .8@8. . ..O.O.%.-+-+-+-+-XXXi.o.o.o.o.:.o.X",
+" o10O.X+<++ .8.8. .....@..O.O+-+X+X+X+X+XXeo:oo1oooooooX",
+" o.+OOqX+q3+ .8.8.8.8.@O.O.O.X+X+-+-+XXOX+.1.o.o.1.o.1.X",
+" oo%%*O.X@*@...*......*...%$O+X+X+-+XXOX+Xiooo:2ooo:oooX",
+" oq+;O@OO-+$%.. . .....O.O@w<O+-+X+-+-+XX+oo.oo:.@o@4ooX",
+"3oo+O1O..OX+X+=........<$eOOOOo+-+XX-+-+X-o:io:o@::ooooX",
+" o:+>:.O.X+X+-+X+O.O.O.O.$<O0+2+o+$+-XX+Xiqoo:o$q%<oi:oX",
+" :o+2,ooO+X+X+X+=+@..@O%$;O12o+;+++X+X+XX-o:$o*>::oo:@oX",
+" O1+:O>o:X+-+X+-+X$X.O.O*>O+O+>+%++++-X-:eoi:e::oe::oei-",
+"3oo+O$O%:+X+-+-+X+X+=+%$OO1>,1++++++-++X-o:e:oreO$io:iqX",
+" oo0+%+;$%+-+X+-+-+X+X++%+,+2+%++a+-a-++Xoq>>io:+>iOr>o-",
+"3ooy+;1>%O++X+-+X+X+X+#>9>+$+i++++++i++->oeioqoo:eoqoioX",
+" eqe$+$+%$>O+X+X+-+-+XO++++++@++++++++X.e<eoi<@oO.@.O0<X",
+" ::q1=0%>,O>u+X+X+X+X+O#36 3 3   888                +>iX",
+" $oOo+++O+2+OX+-+-+-++$X  .. . .  888          upu  X+:X",
+" o%ooo#++>+O>+-+X+XoO%+X  . . .                ;u,  -,OX",
+" ,O%o%;+++$+O-+-+-o+$+>X                       +pp  X+oX",
+" :>o;:$+#++O++X+X++>+++X                       ppp  ->OX",
+" %1Oo%oO++++$#+Xu+;+$++#           O%...            X+:X",
+" >,o$OOo$+#+++-++++++++X                            XOOX",
+" O1Oo%o%qO+++++-++++++-X           O;.O..O...       X+1X",
+" ;$e%;$,2$$++-+++++a+++X                            XOOX",
+" $1$*%OO:%o1q++-+-+X+-+-           $%..O.O;@8       X+oX",
+" %O%O21O%%Oi2$$+-+-+-+-X                88 8        X$OX",
+" ;,>o,$O1%>O:O%;&++X+X+X                 88 8       X+>-",
+"6%$%%>%O>,O0OO%$>O>$$OOX                88 8        X2,X",
+" %o%$%OO%$:%%,>%1,1%;>OO++=X=XX=X=XX=XXXXXXXXX=XX=XXX+>-",
+" i;$e%$%>O%;12OO%$;%1>92$O+O+O+O+O+O+O+O+O+O+O+O+O+O+OOX",
+" $>9$>OOe$>OO01O%%$>,2>1;$>OO$>,>O$>,>O$>,2OO$>,>O$>9>1X",
+".XXX--XX#--X-XXXXXXXX--XXX-X-X-X--X-X--X-X-X-X-X--X-XXXX"};
diff --git a/etc/chkmbox/chkmbox.c b/etc/chkmbox/chkmbox.c
new file mode 100644 (file)
index 0000000..ea5f519
--- /dev/null
@@ -0,0 +1,63 @@
+/****************************************************************************/
+/*
+ * xmbox.c  -- Module to check for mail using an IMAP socket
+ *
+ *  Logon to an IMAP server and check for unread messages.  Return 0 if
+ *  no RECENT or UNSEEN mail exists in the user's INBOX or > 0 if messages
+ *  exist.
+ *
+ *  Author: Michael P. Duane    mduane@seanet.com
+ *  Date:   August 12, 1997
+ *
+ * Copyright (c) 1997-98 by Michael P. Duane
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ ****************************************************************************/
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "imapsocket.h"
+
+char   dftname         []      = "chkmbox.cfg";
+
+/*************************************************************************/
+int main( int argc, char **argv )
+{
+char   *cfgname;
+int            msgnbr          = -1;
+
+       my_name = GetProgramName( *argv );
+
+       if ( argc >= 2 )
+               cfgname = *(argv+1);
+       else
+               cfgname = dftname;
+
+       RedirectErrLog();
+       GetImapCfgInfo( cfgname );
+       if ( !InitSocketAddr() )
+               if ( !ServerLogin() ) /* Any errors here it will behave as "no mail" */
+                       msgnbr = CheckInbox();
+       ServerLogout();
+
+       return( msgnbr );
+
+} /* main */
diff --git a/etc/chkmbox/chkmbox.cfg b/etc/chkmbox/chkmbox.cfg
new file mode 100644 (file)
index 0000000..439f209
--- /dev/null
@@ -0,0 +1,7 @@
+# Configuration file for chkmbox
+
+Hostname       = <mail host name>
+port           = 143
+User           = <mail user name>
+password       = <mail user password>
+
diff --git a/etc/chkmbox/imapsocket.c b/etc/chkmbox/imapsocket.c
new file mode 100644 (file)
index 0000000..6e46077
--- /dev/null
@@ -0,0 +1,553 @@
+/****************************************************************************/
+/*
+ * imapsocket.c  -- Module to check for mail using an IMAP socket
+ *
+ *     Functions to logon to an IMAP server and check the user's INBOX for
+ *     RECENT or UNSEEN mail.  Errors may be logged to ~/.xsession-errors if
+ *     stderr is redirected by a call to RedirectErrLog(), otherwise they are
+ *     written to stderr.
+ *
+ *     It is intended to be used as a set of library functions by a program
+ *     that displays and icon, lights a keyboard LED or otherwise notifies
+ *     a user that mail is waiting to be read.
+ *
+ *     Author: Michael P. Duane        mduane@seanet.com
+ *     Date:   August 12, 1997
+ *
+ * Copyright (c) 1997-98 by Michael P. Duane
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ ****************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifndef        FALSE
+#define        FALSE   0
+#define        TRUE    ~FALSE
+#endif
+
+#define        MAX_BUFFER_SIZE                 8192
+#define        MAX_BUFFER_LINES                  32
+
+#define        SOCKET_ERROR                    (-1)
+
+char   *my_name        = "";
+
+int                                    fdImap          = (-1);
+struct sockaddr_in     addrImap;
+
+int            seq_num                         = 0;
+char   tag                     [ 8];
+
+char   hostname        [64]    = "";
+short  port                            = 0;
+
+char   user            [64]    = "";
+char   passwd          [64]    = "";
+
+char   recv_buf        [MAX_BUFFER_SIZE];
+char   *line           [MAX_BUFFER_LINES];
+
+/****************************************************************************/
+/*
+ * GetProgramName()
+ *
+ * Extract just the basename from argv[0].  'basename()' doesn't exist
+ * on all systems.
+ */
+char *GetProgramName( char *fullname )
+{
+char    *name;
+
+    return( name = ( (name = strrchr( fullname, '/' )) ? ++name : fullname ) );
+
+} /* GetProgramName */
+
+/****************************************************************************/
+/*
+ * RedirectErrLog()
+ *
+ * Redirect stderr to $HOME/.xsesson-errors.  Create it if it doesn't
+ * exist, append to it if it does.
+ *
+ */
+int RedirectErrLog( void )
+{
+char   *home;
+char   xsesserr        [255];
+int            mode    = (O_CREAT | O_APPEND | O_WRONLY);
+int            fderr;
+
+       if ( (home = getenv( "HOME" )) != NULL ) {
+               strcat( strcpy( xsesserr, home ), "/.xsession-errors" );
+               if ( (fderr = open( xsesserr, mode, 0600 )) > 0 ) {
+                       close( STDERR_FILENO );
+                       if ( dup( fderr ) == STDERR_FILENO )
+                               close( fderr );
+                       }
+               return( 0 );
+               }
+
+       return( -1 );
+
+}/* RedirectErrLog */
+
+/****************************************************************************/
+/*
+ * LogMessage()
+ *
+ * Prepend all error messages with my program name and log the corresponding
+ * errno description string where appropriate.
+ */
+void LogMessage( char *msg, int errval )
+{
+
+       if ( errval )
+               fprintf( stderr, "%s:  %s, %s\n", my_name, msg, strerror( errval ) );
+       else
+               fprintf( stderr, "%s:  %s\n", my_name, msg );
+
+} /* LogMessage */
+
+/****************************************************************************/
+/*
+ * ParseToken()
+ *
+ * Validate the "token = value" sequence to include a known token and
+ * a valid assignment operator.  Store the value in a global on success.
+ */
+static void ParseToken( char *token, char *assign, char *value )
+{
+char   errmsg  [255];
+int            i;
+
+       for ( i=0; i< strlen( token ); i++ )
+               *(token+i) = toupper( *(token+i) );
+
+       if ( strcmp( assign, "=" ) ) {
+               sprintf( errmsg, "\"%s\" missing assignment", token );
+               LogMessage( errmsg, 0 );
+               return;
+               }
+
+       if ( !strcmp( token, "HOSTNAME" ) )
+               strcpy( hostname, value );
+       else if ( !strcmp( token, "PORT" ) )
+               port = (short)strtol( value, (char **)NULL, 0 );
+       else if ( !strcmp( token, "USER" ) )
+               strcpy( user, value );
+       else if ( !strcmp( token, "PASSWORD" ) )
+               strcpy( passwd, value );
+       else {
+               sprintf( errmsg, "Unexpected configuration token: \"%s\"", token );
+               LogMessage( errmsg, 0 );
+               }
+
+} /* ParseToken */
+
+/****************************************************************************/
+static char *GetNextToken( char *str )
+{
+
+       return( strtok( str, " \t\n\r" ) );
+
+} /* GetNextToken */
+
+/****************************************************************************/
+/*
+ * GetImapCfgInfo()
+ *
+ * Reads the program configuration file looking for assignments of the
+ * form "token = value".  '#' begins a comment that contiues to EOL.
+ */
+int GetImapCfgInfo( char *cfgfile )
+{
+FILE   *cfg;
+char   txtbuf          [512];
+char   *txt;
+char   *tok;
+char   *assign;
+char   *val;
+
+       if ( (cfg = fopen( cfgfile, "r" )) != NULL ) {
+               do      {
+                       if ( (txt = fgets( txtbuf, sizeof( txtbuf ), cfg )) != NULL) {
+                               if ( (tok = GetNextToken( txt )) ) {
+                                       assign = val = NULL;
+                                       if ( strlen( tok ) ) {
+                                               if ( strchr( tok, '#' ) )
+                                                       continue;
+                                               assign  = GetNextToken( NULL );
+                                               val             = GetNextToken( NULL );
+                                               GetNextToken( NULL );   /* strip to eol */
+                                               }
+                                       if ( assign && val )
+                                               ParseToken( tok, assign, val );
+                                       }
+                               }
+                       } while( !feof( cfg ) );
+               fclose( cfg );
+               }
+       else {
+               LogMessage( cfgfile, errno );
+               return( -1 );
+               }
+
+       return( 0 );
+
+} /* GetImapCfgInfo */
+
+/****************************************************************************/
+/*
+ * InitSocketAddr()
+ *
+ * Setup and validate the host/port address for the IMAP socket
+ */
+
+int InitSocketAddr( void )
+{
+struct hostent *host_info;
+char                   addr_str        [ 32];
+
+       if ( (host_info = gethostbyname( hostname )) == NULL ) {
+               LogMessage( "Host name error", errno );
+               return( -1 );
+               }
+
+       sprintf( addr_str,"%u.%u.%u.%u",
+                        (unsigned char)host_info->h_addr_list[0][0],
+                        (unsigned char)host_info->h_addr_list[0][1],
+                        (unsigned char)host_info->h_addr_list[0][2],
+                        (unsigned char)host_info->h_addr_list[0][3]
+                        );
+
+       addrImap.sin_family                     = PF_INET;
+       addrImap.sin_addr.s_addr        = inet_addr( addr_str );
+       addrImap.sin_port                       = htons( port );
+
+       if ( addrImap.sin_addr.s_addr == INADDR_NONE ) {
+               LogMessage( "Socket Address Error", errno );
+               return( -1 );
+               }
+
+       return( 0 );
+
+} /* InitSocketAddr */
+
+/****************************************************************************/
+/*
+ * ConnectSocket()
+ *
+ * Open and connect to the IMAP socket
+ */
+
+static int ConnectSocket( struct sockaddr_in *addrImap )
+{
+
+       if ( addrImap->sin_addr.s_addr == INADDR_NONE ) {
+               LogMessage( "Socket Address Error", errno );
+               return( -1 );
+               }
+
+       if ( (fdImap = socket( AF_INET, SOCK_STREAM, 0 )) == SOCKET_ERROR ) {
+               LogMessage( "Error opening socket", errno );
+               return( -1 );
+               }
+
+       if ( connect( fdImap, (struct sockaddr *)addrImap,
+                 sizeof( struct sockaddr )) == SOCKET_ERROR ) {
+               close( fdImap );
+               fdImap = (-1);
+               LogMessage( "Socket Connection error", errno );
+               return( -1 );
+               }
+
+       return( 0 );
+
+} /* ConnectSocket */
+
+/****************************************************************************/
+/*
+ * OpenImapSocket()
+ *
+ * Connect to the IMAP socket and make sure the IMAP service responds.
+ */
+
+static int OpenImapSocket( struct sockaddr_in *addrImap )
+{
+int    i;
+
+       if ( ConnectSocket( addrImap ) )
+               return( -1 );
+
+       seq_num = 0;
+       memset( recv_buf, 0, sizeof( recv_buf ) );
+
+       for( i=0; i<MAX_BUFFER_LINES; i++ )
+               line[i] = NULL;
+
+       if ( recv(  fdImap, (char *)recv_buf,
+                               sizeof( recv_buf ), 0 ) == SOCKET_ERROR ) {
+               close( fdImap );
+               fdImap = (-1);
+               LogMessage( "Socket revc error", errno );
+               return( -1 );
+               }
+
+       if ( strncmp( "* OK", recv_buf, 4 ) == 0 ) {
+               return( 0 );
+               }
+       else {
+               close( fdImap );
+               LogMessage( "IMAP service timeout", 0 );
+               return( -1 );
+               }
+
+} /* OpenImapSocket */
+
+/****************************************************************************/
+/*
+ * ImapCmd()
+ *
+ * Send an IMAP command to the socket. The "tag" is used by the IMAP
+ * protocol to match responses to commands.
+ */
+
+static int ImapCmd( char *fmt, ... )
+{
+char   cmd_buf [128];
+va_list        argp;
+
+       sprintf( tag, "A%3.3d", ++seq_num );
+    sprintf( cmd_buf, "%s ", tag );
+
+    va_start( argp, fmt );
+       vsprintf( &cmd_buf[ strlen( cmd_buf ) ], fmt, argp );
+       va_end( argp );
+
+       if ( send( fdImap, cmd_buf, strlen( cmd_buf ), 0 ) == SOCKET_ERROR ) {
+               close( fdImap );
+               fdImap = (-1);
+               LogMessage( "IMAP send error", errno );
+               return( -1 );
+               }
+
+       return( 0 );
+
+} /* ImapCmd */
+
+/****************************************************************************/
+/*
+ * GetImapMsg()
+ *
+ * Get an IMAP response and check for the tag and for the "OK".
+ */
+
+static int GetImapMsg( char *buf, int size )
+{
+char   tmp     [16];
+
+       memset( buf, 0, size );
+
+       if ( recv( fdImap, (char *)buf, size, 0 ) == SOCKET_ERROR ) {
+               close( fdImap );
+               fdImap = (-1);
+               LogMessage( "IMAP read error", errno );
+               return( -1 );
+               }
+
+       sprintf( tmp, "%s OK", tag );
+
+       if ( strstr( buf, tmp ) != NULL )
+               return( 0 );
+       else {
+               LogMessage( "IMAP command error", 0 );
+               return( -1 );
+       }
+
+} /* GetImapMsg */
+
+/****************************************************************************/
+/*
+ * ServerLogin( void )
+ *
+ * Start the IMAP session to check for new mail
+ * RETURN: 0 for success or -1 for failure
+ */
+
+int ServerLogin( void )
+{
+int status = -1;
+
+       if ( !OpenImapSocket( &addrImap ) ) {
+               if ( !ImapCmd( "LOGIN %s %s\n", user, passwd ) ) {
+                       if ( GetImapMsg( recv_buf, sizeof( recv_buf ) ) )
+                               LogMessage( "IMAP LOGIN error", 0 );
+                       else
+                               status = 0;
+                       }
+               }
+
+       return( status );
+
+} /* ServerLogin */
+
+/****************************************************************************/
+/*
+ * ServerLogout()
+ *
+ * Close the IMAP session
+ * RETURN: none
+ */
+
+void ServerLogout( void )
+{
+
+       if ( !ImapCmd( "LOGOUT\n" ) )
+               GetImapMsg( recv_buf, sizeof( recv_buf ) );
+
+       close( fdImap );
+
+} /* ServerLogout */
+
+/****************************************************************************/
+/*
+ * ParseBufLines()
+ *
+ * Parse the response into single lines.
+ *
+ * ARGS:       b - raw response buffer
+ *                     l - an array char * for the individual lines
+ *
+ * RETURN:     the number of lines
+ *
+ */
+
+static int ParseBufLines( char *b, char *l[] )
+{
+int    i;
+
+       for ( i=0; i<MAX_BUFFER_LINES; i++ )
+               l[i] = NULL;
+
+       if ( (l[0] = strtok( b, "\n" )) == NULL )
+               return( 0 );
+
+       for ( i=1; i<MAX_BUFFER_LINES; i++ ) {
+               if ( (l[i] = strtok( NULL, "\n" )) == NULL )
+               return( i );
+               }
+
+       return( MAX_BUFFER_LINES );
+
+} /* ParseBufLines */
+
+/****************************************************************************/
+/*
+ * CheckRecent()
+ *
+ * This routine looks through an array of lines for the "RECENT" response
+ * and returns the number of "RECENT" message.  If there are no "RECENT"
+ * messages it then checks for any "UNSEEN" messages.
+ *
+ * ARGS:       b - raw response buffer
+ *                     l - an array char * for the individual lines
+ *
+ * RETURN:     number.  0 is no messages.  For messages found with the
+ *          RECENT command number is the count of RECENT messages.  For
+ *          messages found with the UNSEEN command 'number' is the
+ *          message number of an UNSEEN message.
+ */
+
+static int CheckRecent( char *b, char *l[] )
+{
+int    i;
+int    num_msg = -1;
+
+/*
+ *     Check for new messages that have arrived since the last time we looked
+ */
+       if ( !GetImapMsg( recv_buf, sizeof( recv_buf ) ) ) {
+               if ( ParseBufLines( b, l ) > 0 ) {
+                       for( i=0; i<MAX_BUFFER_LINES; i++ ) {
+                               if ( strstr( l[i], "RECENT" ) != NULL )
+                                       break;
+                               }
+                       sscanf( l[i], "%*s %d %*s", &num_msg );
+                       }
+               }
+/*
+ *     If nothing new has arrived check for any messages that may still be
+ *     in the mailbox but have not been read
+ */
+       if ( num_msg <= 0 ) {
+               if ( !ImapCmd( "SEARCH UNSEEN\n" ) ) {
+                       if ( !GetImapMsg( recv_buf, sizeof( recv_buf ) ) ) {
+                               if ( ParseBufLines( b, l ) > 0 ) {
+                                       for( i=0; i<MAX_BUFFER_LINES; i++ ) {
+                                               if ( strstr( l[i], "SEARCH" ) != NULL )
+                                                       break;
+                                               }
+                                       sscanf( l[i], "%*s %*s %d", &num_msg );
+                                       }
+                               }
+                       }
+               }
+/*
+ *     Any non-zero value means there are messages that have not been read.
+ *     This is not a count or an index to the newest message
+ */
+       return( num_msg );
+
+} /* CheckRecent */
+
+/****************************************************************************/
+/*
+ * CheckInbox()
+ *
+ * This is the IMAP session to check for new mail
+ *
+ * RETURN: 1 for no messages, 0 if messages exist. /* Inverted by DAB */
+ */
+
+int CheckInbox( void )
+{
+int status = -1;
+
+       if ( fdImap < 0 ) {
+               if ( ServerLogin() )
+                       return( !status );  /* Inverted by DAB */
+               }
+
+       if ( !ImapCmd( "EXAMINE INBOX\n" ) )
+               status = CheckRecent( recv_buf, line );
+
+       return( !status ); /* Inverted by DAB */
+
+} /* CheckInbox */
+
+/****************************************************************************/
+/* end of imapsocket.c */
diff --git a/etc/chkmbox/imapsocket.h b/etc/chkmbox/imapsocket.h
new file mode 100644 (file)
index 0000000..506eb76
--- /dev/null
@@ -0,0 +1,48 @@
+/****************************************************************************/
+/*
+ * imapsocket.h  -- Module to check for mail using an IMAP socket
+ *
+ *  Functions to logon to an IMAP server and check the user's INBOX for
+ *  RECENT or UNSEEN mail.  Errors may be logged to ~/.xsession-errors if
+ *  stderr is redirected by a call to RedirectErrLog(), otherwise they are
+ *  written to stderr.
+ *
+ *  It is intended to be used as a set of library functions by a program
+ *  that displays and icon, lights a keyboard LED or otherwise notifies
+ *  a user that mail is waiting to be read.
+ *
+ *  Author: Michael P. Duane    mduane@seanet.com
+ *  Date:   August 12, 1997
+ *
+ * Copyright (c) 1997-98 by Michael P. Duane
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ ****************************************************************************/
+
+#ifndef IMAPSOCKET_H
+#define IMAPSOCKET_H
+
+extern char *my_name;
+
+int            RedirectErrLog( void );
+char   *GetProgramName( char *fullname );
+int            GetImapCfgInfo( char *cfgfile );
+int            InitSocketAddr( void );
+int            ServerLogin( void );
+void   ServerLogout( void );
+int            CheckInbox( void );
+
+#endif /* IMAPSOCKET_H */
diff --git a/etc/descrip.mms b/etc/descrip.mms
new file mode 100644 (file)
index 0000000..db5951b
--- /dev/null
@@ -0,0 +1,334 @@
+# This is no longer maintained since I can not test it.
+############################################################
+# Make file to makexlock.exe on a VMS system.
+#
+# Created By J.Jansen         12 February 1996
+#
+# Usage : type MMS in the directory containing the source
+#
+# It automatically detects the existance of the XPM-library and the XVMSUTILS
+# library to use the new (better) features of the program. It is assumed that
+# both libraries if exist are in the directory with logical symbol X11.
+#
+#
+############################################################
+
+# default target
+
+C = .c
+#C++
+#C = .cc
+
+#VMS
+O = .obj
+S = ,
+E = .exe
+A = ;*
+
+all : macro xmlock$(E)
+       @ $(ECHO) ""
+
+macro :
+       @ xvms = f$search("X11:XVMSUTILS.OLB").nes.""
+       @ xpm = f$search("X11:LIBXPM.OLB").nes.""
+       @ axp = f$getsyi("HW_MODEL").ge.1024
+       @ macro = ""
+       @ if axp.or.xvms.or.xpm then macro = "/MACRO=("
+       @ if axp then macro = macro + "__ALPHA__=1,"
+       @ if xpm then macro = macro + "__XPM__=1,"
+       @ if xvms then macro = macro + "__XVMSUTILS__=1,"
+       @ if macro.nes."" then macro = f$extract(0,f$length(macro)-1,macro)+ ")"
+       $(MMS)$(MMSQUALIFIERS)'macro' xlock$(E)
+
+BITMAPDIR = [.bitmaps]
+PIXMAPDIR = [.pixmaps]
+CONFIGDIR = [.config]
+GLDIR = [.glx]
+HACKERDIR = [.hackers]
+
+#CC = gcc -g -Wall -ansi -pedantic
+#CC = gcc -g -Wall
+#CC = g++ -g -Wall
+CC = cc
+#CC = cxx
+
+BITMAPTYPE = x11
+PIXMAPTYPE = x11
+
+# Here is your chance to override the default icon:
+TINYBITMAP = $(BITMAPTYPE)
+TINYBITMAP = t-x11
+SMALLBITMAP = s-$(BITMAPTYPE)
+MEDIUMBITMAP = m-$(BITMAPTYPE)
+LARGEBITMAP = l-$(BITMAPTYPE)
+MEDIUMPIXMAP = m-$(PIXMAPTYPE)
+LARGEPIXMAP = l-$(PIXMAPTYPE)
+
+#EYESBITMAP = $(MEDIUMBITMAP)
+EYESBITMAP = m-grelb
+IMAGEBITMAP = $(MEDIUMBITMAP)
+#IMAGEBITMAP = m-xlock
+#LIFEBITMAP = $(SMALLBITMAP)
+LIFEBITMAP = s-grelb
+LIFE1DBITMAP = $(TINYBITMAP)
+MAZEBITMAP = $(LARGEBITMAP)
+#MAZEBITMAP = m-xlock
+#PACMANBITMAP = $(MEDIUMBITMAP)
+PACMANBITMAP = m-ghost
+#PUZZLEBITMAP = $(LARGEBITMAP)
+PUZZLEBITMAP = l-xlock
+IMAGEPIXMAP = $(MEDIUMPIXMAP)
+#IMAGEPIXMAP = m-xlock
+#PUZZLEPIXMAP = $(LARGEPIXMAP)
+PUZZLEPIXMAP = l-xlock
+
+RM = delete/noconfirm
+RM_S = set file/remove
+ECHO = write sys$output
+BLN_S = set file/enter=[]
+
+.IFDEF __ALPHA__
+#SYSTEMDEF = /standard=vaxc
+SOUNDOBJS = $(S)amd$(O)
+SOUNDSRCS = amd$(C)
+SOUNDDEF = ,VMS_PLAY
+.ENDIF
+.IFDEF __XPM__
+XPMDEF = ,HAVE_XPM
+.ENDIF
+.IFDEF __XVMSUTILS__
+XVMSUTILSDEF = ,HAVE_XVMSUTILS
+.ENDIF
+
+# Add hackers modes as you like.  It may make your xlock unstable.
+# Please do not uncomment for precompiled distributions.
+#HACKERDEF = ,USE_HACKERS
+#XLOCKHACKEROBJS =
+
+
+CFLAGS = /define = (VMS,USE_VROOT,USE_BOMB$(SOUNDDEF)$(XPMDEF)$(XVMSUTILSDEF)$(GLDEF)$(HACKERDEF))$(SYSTEMDEF)
+LDFLAGS =
+
+VER = xlockmore
+DISTVER = xlockmore-4.00
+
+
+####################################################################
+# List of object files
+
+
+XLOCKCOREOBJS =
+XLOCKMODEOBJS =
+XLOCKGLOBJS =
+XLOCKCOREMODEOBJS = blank$(O)$(S)bomb$(O)$(S)random$(O)
+XLOCKOBJS = $(XLOCKCOREOBJS)$(S)$(XLOCKMODEOBJS)$(S)\
+$(XLOCKGLOBJS)$(XLOCKHACKEROBJS)$(S)$(XLOCKCOREMODEOBJS)
+XMLOCKOBJS = option$(O)$(S)xmlock$(O)
+
+####################################################################
+# List of source files
+# Used for lint, and some dependencies.
+
+BITMAPS = eyes.xbm ghost.xbm image.xbm life.xbm life1d.xbm \
+maze.xbm puzzle.xbm
+PIXMAPS = image.xpm puzzle.xpm
+XLOCKHDRS = xlock.h mode.h vroot.h ras.h version.h config.h
+XLOCKCORESRCS =
+XLOCKMODESRCS =
+XLOCKGLSRCS =
+XLOCKCOREMODESRCS = blank$(C) bomb$(C) random$(C)
+XLOCKHACKERSRCS =
+XLOCKSRCS = $(XLOCKCORESRCS) $(XLOCKMODESRCS) $(XLOCKCOREMODESRCS) \
+$(XLOCKGLSRCS) $(XLOCKHACKERSRCS)
+XMLOCKSRCS = option$(C) xmlock$(C)
+
+
+#########################################################################
+
+xlock$(E) : $(XLOCKOBJS)$(S)xlock.opt
+       link/map $(XLOCKOBJS)$(S)xlock.opt/opt
+       @ $(ECHO) "$@ BUILD COMPLETE"
+       @ $(ECHO) ""
+
+xmlock$(E) : $(XMLOCKOBJS)$(S)xmlock.opt
+       link/map $(XMLOCKOBJS)$(S)xmlock.opt/opt
+       @ $(ECHO) "$@ BUILD COMPLETE"
+       @ $(ECHO) ""
+
+xlock.opt :
+       @ close/nolog optf
+       @ open/write optf xlock.opt
+#      @ if .not. axp then write optf "sys$library:vaxcrtl/lib"
+       @ write optf "sys$library:vaxcrtl/lib"
+       @ if axp then write optf "sys$library:ucx$ipc_shr/share"
+       @ if axp then write optf "sys$share:decw$xextlibshr/share"
+       @ if axp then write optf "sys$share:decw$xtlibshrr5/share"
+       @ if .not. axp then write optf "sys$library:ucx$ipc/lib"
+#      @ write optf "sys$share:decw$dxmlibshr/share"
+       @ write optf "sys$share:decw$xmlibshr12/share"
+       @ write optf "sys$share:decw$xlibshr/share"
+       @ close optf
+
+xmlock.opt :
+       @ close/nolog optf
+       @ open/write optf xmlock.opt
+#      @ if .not. axp then write optf "sys$library:vaxcrtl/lib"
+       @ write optf "sys$library:vaxcrtl/lib"
+       @ if axp then write optf "sys$library:ucx$ipc_shr/share"
+       @ if axp then write optf "sys$share:decw$xextlibshr/share"
+       @ if axp then write optf "sys$share:decw$xtlibshrr5/share"
+       @ if .not. axp then write optf "sys$library:ucx$ipc/lib"
+#      @ write optf "sys$share:decw$dxmlibshr/share"
+       @ write optf "sys$share:decw$xmlibshr12/share"
+       @ write optf "sys$share:decw$xlibshr/share"
+       @ close optf
+
+eyes$(O) : eyes$(C) eyes.xbm
+flag$(O) : flag$(C) flag.xbm
+life$(O) : life$(C) life.xbm
+life1d$(O) : life1d$(C) life1d.xbm
+maze$(O) : maze$(C) maze.xbm
+pacman$(O) : pacman$(C) ghost.xbm
+# Do not need xpm files if not using them but not worth figuring out
+image$(O) : image$(C) image.xbm image.xpm
+puzzle$(O) : puzzle$(C) puzzle.xbm puzzle.xpm
+
+eyes.xbm : $(BITMAPDIR)$(EYESBITMAP).xbm
+       $(BLN_S)eyes.xbm $(BITMAPDIR)$(EYESBITMAP).xbm
+
+flag.xbm : $(BITMAPDIR)$(FLAGBITMAP).xbm
+       $(BLN_S)flag.xbm $(FLAGDIR)$(FLAGBITMAP).xbm
+
+image.xbm : $(BITMAPDIR)$(IMAGEBITMAP).xbm
+       $(BLN_S)image.xbm $(BITMAPDIR)$(IMAGEBITMAP).xbm
+
+ghost.xbm : $(BITMAPDIR)$(PACMANBITMAP).xbm
+       $(BLN_S)ghost.xbm $(BITMAPDIR)$(PACMANBITMAP).xbm
+
+life.xbm : $(BITMAPDIR)$(LIFEBITMAP).xbm
+       $(BLN_S)life.xbm $(BITMAPDIR)$(LIFEBITMAP).xbm
+
+life1d.xbm : $(BITMAPDIR)$(LIFE1DBITMAP).xbm
+       $(BLN_S)life1d.xbm $(BITMAPDIR)$(LIFE1DBITMAP).xbm
+
+maze.xbm : $(BITMAPDIR)$(MAZEBITMAP).xbm
+       $(BLN_S)maze.xbm $(BITMAPDIR)$(MAZEBITMAP).xbm
+
+puzzle.xbm : $(BITMAPDIR)$(IMAGEBITMAP).xbm
+       $(BLN_S)puzzle.xbm $(BITMAPDIR)$(IMAGEBITMAP).xbm
+
+image.xpm : $(PIXMAPDIR)$(IMAGEPIXMAP).xpm
+       $(BLN_S)image.xpm $(PIXMAPDIR)$(IMAGEPIXMAP).xpm
+
+puzzle.xpm : $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm
+       $(BLN_S)puzzle.xpm $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm
+
+amd$(C) : $(CONFIGDIR)amd$(C)
+       $(BLN_S)amd$(C) $(CONFIGDIR)amd$(C)
+
+amd.h : $(CONFIGDIR)amd.h
+       $(BLN_S)amd.h $(CONFIGDIR)amd.h
+
+amd$(O) : amd$(C) amd.h
+
+atlantis$(C) : $(GLDIR)atlantis$(C)
+       $(BLN_S) atlantis$(C) $(GLDIR)atlantis$(C)
+
+dolphin$(C) : $(GLDIR)dolphin$(C)
+       $(BLN_S) dolphin$(C) $(GLDIR)dolphin$(C)
+
+shark$(C) : $(GLDIR)shark$(C)
+       $(BLN_S) shark$(C) $(GLDIR)shark$(C)
+
+swim$(C) : $(GLDIR)swim$(C)
+       $(BLN_S) swim$(C) $(GLDIR)swim$(C)
+
+whale$(C) : $(GLDIR)whale$(C)
+       $(BLN_S) whale$(C) $(GLDIR)whale$(C)
+
+cage$(C) : $(GLDIR)cage$(C)
+       $(BLN_S) cage$(C) $(GLDIR)cage$(C)
+
+gears$(C) : $(GLDIR)gears$(C)
+       $(BLN_S) gears$(C) $(GLDIR)gears$(C)
+
+moebius$(C) : $(GLDIR)moebius$(C)
+       $(BLN_S) moebius$(C) $(GLDIR)moebius$(C)
+
+morph3d$(C) : $(GLDIR)morph3d$(C)
+       $(BLN_S) morph3d$(C) $(GLDIR)morph3d$(C)
+
+superquadrics$(C) : $(GLDIR)superquadrics$(C)
+       $(BLN_S) superquadrics$(C) $(GLDIR)superquadrics$(C)
+
+buildlwo$(C) : $(GLDIR)buildlwo$(C)
+       $(BLN_S) buildlwo$(C) $(GLDIR)buildlwo$(C)
+
+pipes$(C) : $(GLDIR)pipes$(C)
+       $(BLN_S) pipes$(C) $(GLDIR)pipes$(C)
+
+pipeobjs$(C) : $(GLDIR)pipeobjs$(C)
+       $(BLN_S) pipeobjs$(C) $(GLDIR)pipeobjs$(C)
+
+sproingies$(C) : $(GLDIR)sproingies$(C)
+       $(BLN_S)sproingies$(C) $(GLDIR)sproingies$(C)
+
+sproingiewrap$(C) : $(GLDIR)sproingiewrap$(C)
+       $(BLN_S)sproingiewrap$(C) $(GLDIR)sproingiewrap$(C)
+
+s1_b$(C) : $(GLDIR)s1_b$(C)
+       $(BLN_S)s1_b$(C) $(GLDIR)s1_b$(C)
+
+s1_1$(C) : $(GLDIR)s1_1$(C)
+       $(BLN_S)s1_1$(C) $(GLDIR)s1_1$(C)
+
+s1_2$(C) : $(GLDIR)s1_2$(C)
+       $(BLN_S)s1_2$(C) $(GLDIR)s1_2$(C)
+
+s1_3$(C) : $(GLDIR)s1_3$(C)
+       $(BLN_S)s1_3$(C) $(GLDIR)s1_3$(C)
+
+s1_4$(C) : $(GLDIR)s1_4$(C)
+       $(BLN_S)s1_4$(C) $(GLDIR)s1_4$(C)
+
+s1_5$(C) : $(GLDIR)s1_5$(C)
+       $(BLN_S)s1_5$(C) $(GLDIR)s1_6$(C)
+
+s1_6$(C) : $(GLDIR)s1_6$(C)
+       $(BLN_S)s1_6$(C) $(GLDIR)s1_6$(C)
+
+################################################################
+
+install :
+
+uninstall :
+
+################################################################
+# Miscellaneous targets
+
+clean :
+       @ close/nolog optf
+       @ purge
+       @ $(RM) *.lis$(A)
+       @ $(RM) *.obj$(A)
+       @ $(RM) *.opt$(A)
+       @ $(RM) *.map$(A)
+       @ $(RM_S) eyes.xbm$(A)
+       @ $(RM_S) flag.xbm$(A)
+       @ $(RM_S) image.xbm$(A)
+       @ $(RM_S) ghost.xbm$(A)
+       @ $(RM_S) life.xbm$(A)
+       @ $(RM_S) life1d.xbm$(A)
+       @ $(RM_S) maze.xbm$(A)
+       @ $(RM_S) puzzle.xbm$(A)
+       @ $(RM_S) image.xpm$(A)
+       @ $(RM_S) puzzle.xpm$(A)
+       @ $(RM_S) amd.h$(A)
+       @ $(RM_S) amd.c$(A)
+
+distclean : clean
+       @ $(RM) xlock$(E)$(A)
+       @ $(RM) xmlock$(E)$(A)
+
+read :
+       more README
diff --git a/etc/dtprofile b/etc/dtprofile
new file mode 100644 (file)
index 0000000..e299a91
--- /dev/null
@@ -0,0 +1,276 @@
+#############################################################################
+###
+###   .dtprofile
+###
+###   user personal environment variables
+###
+###   Common Desktop Environment (CDE)
+###
+###   (c) Copyright 1993, 1994 Hewlett-Packard Company
+###   (c) Copyright 1993, 1994 International Business Machines Corp.
+###   (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
+###   (c) Copyright 1993, 1994 Novell, Inc.
+###
+###
+###   $Revision: 1.7 $
+###
+#############################################################################
+
+
+#############################################################################
+###
+###   Your $HOME/.dtprofile is read each time you login to the Common Desktop
+###   Environment (CDE) and is the place to set or override desktop
+###   environment variables for your session. Environment variables set in
+###   $HOME/.dtprofile are made available to all applications on the desktop.
+###   The desktop will accept either sh or ksh syntax for the commands in
+###   $HOME/.dtprofile.
+###
+#############################################################################
+
+
+#############################################################################
+###
+###   Random stdout and stderr output from apps started by Session Mgr or
+###   by actions via front panel or workspace menu can be directed into
+###   the user's $HOME/.dt/sessionlogs directory.  By default this output
+###   is not recorded.  Instead it is sent off to /dev/null (Unix's "nothing"
+###   device).
+###
+###   If this random application output is wanted (usually only wanted for
+###   debugging purposes), commenting out following "dtstart_sessionlogfile"
+###   lines will send output to your $HOME/.dt/sessionlogs directory.
+###
+###   Alternatively, can change "/dev/null" to "/dev/console" to see this
+###   debugging output on your console device.  Can start a console via the
+###   Workspace programs menu or via Application Mgr's Desktop Tools
+###   "Terminal Console" icon.
+###
+#############################################################################
+
+export dtstart_sessionlogfile="/dev/null"
+
+
+#############################################################################
+###
+###   By default, the desktop does not read your standard $HOME/.profile
+###   or $HOME/.login files. This can be changed by uncommenting the
+###   DTSOURCEPROFILE variable assignment at the end of this file. The
+###   desktop reads .profile if your $SHELL is "sh" or "ksh", or .login
+###   if your $SHELL is "csh".
+###
+###   The desktop reads the .dtprofile and .profile/.login without an
+###   associated terminal emulator such as xterm or dtterm. This means
+###   there is no available command line for interaction with the user.
+###   This being the case, these scripts must avoid using commands that
+###   depend on having an associated terminal emulator or that interact
+###   with the user. Any messages printed in these scripts will not be
+###   seen when you log in and any prompts such as by the 'read' command
+###   will return an empty string to the script. Commands that set a
+###   terminal state, such as "tset" or "stty" should be avoided.
+###
+###   With minor editing, it is possible to adapt your .profile or .login
+###   for use both with and without the desktop.  Group the statements not
+###   appropriate for your desktop session into one section and enclose them
+###   with an "if" statement that checks for the setting of the "DT"
+###   environment variable. When the desktop reads your .profile or .login
+###   file, it will set "DT" to a non-empty value for which your .profile or
+###   .login can test.
+###
+###   example for sh/ksh
+###
+###     if [ ! "$DT" ]; then
+###       #
+###       # commands and environment variables not appropriate for desktop
+###       #
+###       stty ...
+###       tset ...
+###       DISPLAY=mydisplay:0
+###       ...
+###     fi
+###
+###     #
+###     # environment variables common to both desktop and non-desktop
+###     #
+###     PATH=$HOME/bin:$PATH
+###     MYVAR=value
+###     export MYVAR
+###     ...
+###
+###   example for csh
+###
+###     if ( ! ${?DT} ) then
+###       #
+###       # commands and environment variables not appropriate for desktop
+###       #
+###       stty ...
+###       tset ...
+###       setenv DISPLAY mydisplay:0
+###       ...
+###     endif
+###
+###     #
+###     # environment variables common to both desktop and non-desktop
+###     #
+###     setenv PATH $HOME/bin:$PATH
+###     setenv MYVAR value
+###     ...
+###
+###   Errors in .dtprofile or .profile (.login) may prevent a successful
+###   login. If after you login, your session startup terminates and you
+###   are presented with the login screen, this might be the cause. If this
+###   happens, select the Options->Sessions->Failsafe Session item on the
+###   login screen, login and correct the error. The $HOME/.dt/startlog and
+###   $HOME/.dt/errorlog files may be helpful in identifying errors.
+###
+##############################################################################
+
+#
+#  If $HOME/.profile (.login) has been edited as described above, uncomment
+#  the following line.
+#
+DTSOURCEPROFILE=true
+
+#
+# Screen savers.
+#
+#DTSCREENSAVERLIST="\
+#StartDtscreenSwarm \
+#StartDtscreenQix \
+#StartDtscreenFlame \
+#StartDtscreenHop \
+#StartDtscreenImage \
+#StartDtscreenLife \
+#StartDtscreenRotor \
+#StartDtscreenPyro \
+#StartDtscreenWorm \
+#StartDtscreenBlank"
+
+#export DTSCREENSAVERLIST="\
+#$DTSCREENSAVERLIST \
+
+#DTSCREEN="/usr/dt/bin/dtscreen"
+DTSCREEN="/usr/local/bin/xlock -dtsaver"
+export DTSCREEN
+
+DTSCREENSAVERLIST="\
+StartDtscreenAnt \
+StartDtscreenAtlantis \
+StartDtscreenBall \
+StartDtscreenBat \
+StartDtscreenBlot \
+StartDtscreenBouboule \
+StartDtscreenBounce \
+StartDtscreenBraid \
+StartDtscreenBubble \
+StartDtscreenBubble3d \
+StartDtscreenBug \
+StartDtscreenCage \
+StartDtscreenClock \
+StartDtscreenCoral \
+StartDtscreenCrystal \
+StartDtscreenDaisy \
+StartDtscreenDclock \
+StartDtscreenDecay \
+StartDtscreenDeco \
+StartDtscreenDemon \
+StartDtscreenDilemma \
+StartDtscreenDiscrete \
+StartDtscreenDragon \
+StartDtscreenDrift \
+StartDtscreenEuler2d \
+StartDtscreenEyes \
+StartDtscreenFadeplot \
+StartDtscreenFire \
+StartDtscreenFlag \
+StartDtscreenFlame \
+StartDtscreenFlow \
+StartDtscreenForest \
+StartDtscreenGalaxy \
+StartDtscreenGears \
+StartDtscreenGlplanet \
+StartDtscreenGoop \
+StartDtscreenGrav \
+StartDtscreenHelix \
+StartDtscreenHop \
+StartDtscreenHyper \
+StartDtscreenIco \
+StartDtscreenIfs \
+StartDtscreenImage \
+StartDtscreenInvert \
+StartDtscreenJuggle \
+StartDtscreenJulia \
+StartDtscreenKaleid \
+StartDtscreenKumppa \
+StartDtscreenLament \
+StartDtscreenLaser \
+StartDtscreenLife \
+StartDtscreenLife1d \
+StartDtscreenLife3d \
+StartDtscreenLightning \
+StartDtscreenLisa \
+StartDtscreenLissie \
+StartDtscreenLoop \
+StartDtscreenLyapunov \
+StartDtscreenMandelbrot \
+StartDtscreenMarquee \
+StartDtscreenMatrix \
+StartDtscreenMaze \
+StartDtscreenMoebius \
+StartDtscreenMolecule \
+StartDtscreenMorph3d \
+StartDtscreenMountain \
+StartDtscreenMunch \
+StartDtscreenNose \
+StartDtscreenPacman \
+StartDtscreenPenrose \
+StartDtscreenPetal \
+StartDtscreenPipes \
+StartDtscreenPolyominoes \
+StartDtscreenPuzzle \
+StartDtscreenQix \
+StartDtscreenPyro \
+StartDtscreenRoll \
+StartDtscreenRotor \
+StartDtscreenRubik \
+StartDtscreenSballs \
+StartDtscreenScooter \
+StartDtscreenShape \
+StartDtscreenSierpinski \
+StartDtscreenSierpinski3d \
+StartDtscreenSkewb \
+StartDtscreenSlip \
+StartDtscreenSolitare \
+StartDtscreenSpace \
+StartDtscreenSphere \
+StartDtscreenSpiral \
+StartDtscreenSpline \
+StartDtscreenSproingies \
+StartDtscreenStairs \
+StartDtscreenStar \
+StartDtscreenStarfish \
+StartDtscreenStrange \
+StartDtscreenSuperquadrics \
+StartDtscreenSwarm \
+StartDtscreenSwirl \
+StartDtscreenT3d \
+StartDtscreenTetris \
+StartDtscreenText3d \
+StartDtscreenThornbird \
+StartDtscreenTik_Tak \
+StartDtscreenTransparent \
+StartDtscreenTriangle \
+StartDtscreenTube \
+StartDtscreenTurtle \
+StartDtscreenVines \
+StartDtscreenVoters \
+StartDtscreenWator \
+StartDtscreenWire \
+StartDtscreenWorld \
+StartDtscreenWorm \
+StartDtscreenXcl \
+StartDtscreenXjack \
+StartDtscreenBlank \
+StartDtscreenBomb \
+StartDtscreenRandom"
+export DTSCREENSAVERLIST
diff --git a/etc/dtscreen.dt b/etc/dtscreen.dt
new file mode 100644 (file)
index 0000000..4cd4caf
--- /dev/null
@@ -0,0 +1,1123 @@
+###############################################################################
+#
+#     dtscreen.dt
+#
+#     Actions for defining screen savers to the Common Desktop Environment.
+#
+#    (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
+#    (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
+#    (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
+#    (c) Copyright 1993, 1994, 1995 Novell, Inc.
+#
+#     $XConsortium: dtscreen.dt.src /main/cde1_maint/1 1995/07/15 03:07:30 drk $
+#
+###############################################################################
+set DtDbVersion=1.0
+
+###############################################################################
+#
+# WARNING:  This file may be overwritten in subsequent installations of
+#     the Common Desktop Environment (CDE).  Consequently, any system wide
+#     changes should be made to an equivalent database file in
+#     /etc/dt/types and not in this file.
+#
+###############################################################################
+
+###################################################################
+#
+# Actions
+#
+# Note: the following are dtscreen's original action changed to use xlock
+###################################################################
+ACTION StartDtscreenHop
+{
+       LABEL           StartDtscreenHop
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode hop
+       DESCRIPTION     hop: Real plane iterated fractals
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode hop
+#      DESCRIPTION     hop: Hopalong iterated fractals
+
+ACTION StartDtscreenQix
+{
+       LABEL           StartDtscreenQix
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode qix
+       DESCRIPTION     qix: Spinning lines a la Qix(tm)
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode qix
+#      DESCRIPTION     qix: Spinning lines
+
+ACTION StartDtscreenImage
+{
+       LABEL           StartDtscreenImage
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode image
+       DESCRIPTION     image: Randomly appearing logos
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode image
+#      DESCRIPTION     image: Random bouncing image
+
+ACTION StartDtscreenLife
+{
+       LABEL           StartDtscreenLife
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode life
+       DESCRIPTION     life: Conway's game of Life
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode life
+
+ACTION StartDtscreenSwarm
+{
+       LABEL           StartDtscreenSwarm
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode swarm
+       DESCRIPTION     swarm: A swarm of bees following a wasp
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode swarm
+#      DESCRIPTION     swarm: Swarm of bees
+
+ACTION StartDtscreenRotor
+{
+       LABEL           StartDtscreenRotor
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode rotor
+       DESCRIPTION     rotor: Tom's Roto-Rotor
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode rotor
+#      DESCRIPTION     rotor: Rotor
+
+ACTION StartDtscreenPyro
+{
+       LABEL           StartDtscreenPyro
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode pyro
+       DESCRIPTION     pyro: Fireworks
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode pyro
+
+ACTION StartDtscreenFlame
+{
+       LABEL           StartDtscreenFlame
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode flame
+       DESCRIPTION     flame: Cosmic flame fractals
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode flame
+#      DESCRIPTION     flame: Cosmic Flame Fractals
+
+ACTION StartDtscreenWorm
+{
+       LABEL           StartDtscreenWorm
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode worm
+       DESCRIPTION     worm: Wiggly worms
+}
+#      EXEC_STRING     /usr/dt/bin/dtscreen -mode worm
+#      DESCRIPTION     worm: Wiggly Worms
+
+ACTION StartDtscreenBlank
+{
+       LABEL           StartDtscreenBlank
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode blank
+       DESCRIPTION     blank: Nothing but a blank screen
+}
+#      DESCRIPTION     blank: Blank Screen
+
+###################################################################
+#
+# xlock's modes that dtscreen doesn't have.
+#
+###################################################################
+ACTION StartDtscreenAnt
+{
+       LABEL           StartDtscreenAnt
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode ant
+       DESCRIPTION     ant: Langton's and Turk's generalized ants
+}
+
+ACTION StartDtscreenAtlantis
+{
+       LABEL           StartDtscreenAtlantis
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode atlantis
+       DESCRIPTION     atlantis: Moving sharks/whales/dolphin
+}
+
+ACTION StartDtscreenBall
+{
+       LABEL           StartDtscreenBall
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode ball
+       DESCRIPTION     ball: Bouncing balls
+}
+
+ACTION StartDtscreenBat
+{
+       LABEL           StartDtscreenBat
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode bat
+       DESCRIPTION     bat: Bouncing flying bats
+}
+
+ACTION StartDtscreenBlot
+{
+       LABEL           StartDtscreenBlot
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode blot
+       DESCRIPTION     blot: Rorschach's ink blot test
+}
+
+ACTION StartDtscreenBouboule
+{
+       LABEL           StartDtscreenBouboule
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode bouboule
+       DESCRIPTION     bouboule: Mimi's bouboule of moving stars
+}
+
+ACTION StartDtscreenBounce
+{
+       LABEL           StartDtscreenBounce
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode bounce
+       DESCRIPTION     bounce: Bouncing footballs
+}
+
+ACTION StartDtscreenBraid
+{
+       LABEL           StartDtscreenBraid
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode braid
+       DESCRIPTION     braid: Random braids and knots
+}
+
+ACTION StartDtscreenBubble
+{
+       LABEL           StartDtscreenBubble
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode bubble
+       DESCRIPTION     bubble: Popping bubbles
+}
+
+ACTION StartDtscreenBubble3d
+{
+       LABEL           StartDtscreenBubble3d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode bubble3d
+       DESCRIPTION     bubble3d: Richard Jones's GL bubbles
+}
+ACTION StartDtscreenBug
+{
+       LABEL           StartDtscreenBug
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode bug
+       DESCRIPTION     bug: Palmiter's bug evolution and garden of Eden
+}
+
+ACTION StartDtscreenCage
+{
+       LABEL           StartDtscreenCage
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode cage
+       DESCRIPTION     cage: The Impossible Cage, an Escher-like GL scene
+}
+
+ACTION StartDtscreenClock
+{
+       LABEL           StartDtscreenClock
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode clock
+       DESCRIPTION     clock: Packard's clock
+}
+
+ACTION StartDtscreenCoral
+{
+       LABEL           StartDtscreenCoral
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode coral
+       DESCRIPTION     coral: A coral reef
+}
+
+ACTION StartDtscreenCrystal
+{
+       LABEL           StartDtscreenCrystal
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode crystal +install
+       DESCRIPTION     crystal: Polygons in 2D plane groups
+}
+
+ACTION StartDtscreenDaisy
+{
+       LABEL           StartDtscreenDaisy
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode daisy
+       DESCRIPTION     daisy: A meadow of daisies
+}
+
+ACTION StartDtscreenDclock
+{
+       LABEL           StartDtscreenDclock
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode dclock
+       DESCRIPTION     dclock: A floating digital clock or message
+}
+
+ACTION StartDtscreenDecay
+{
+       LABEL           StartDtscreenDecay
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode decay
+       DESCRIPTION     decay: A decaying screen
+}
+
+ACTION StartDtscreenDeco
+{
+       LABEL           StartDtscreenDeco
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode deco
+       DESCRIPTION     deco: Art as ugly as sin
+}
+
+ACTION StartDtscreenDemon
+{
+       LABEL           StartDtscreenDemon
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode demon
+       DESCRIPTION     demon: Griffeath's cellular automata
+}
+
+ACTION StartDtscreenDilemma
+{
+       LABEL           StartDtscreenDilemma
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode dilemma
+       DESCRIPTION     dilemma: Lloyd's Prisoner's Dilemma simulation
+}
+
+ACTION StartDtscreenDiscrete
+{
+       LABEL           StartDtscreenDiscrete
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode discrete
+       DESCRIPTION     discrete: Various discrete maps
+}
+
+ACTION StartDtscreenDragon
+{
+       LABEL           StartDtscreenDragon
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode dragon
+       DESCRIPTION     dragon: Deventer's Hexagonal Dragons Maze
+}
+
+ACTION StartDtscreenDrift
+{
+       LABEL           StartDtscreenDrift
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode drift
+       DESCRIPTION     drift: Cosmic drifting flame fractals
+}
+
+ACTION StartDtscreenEuler2d
+{
+       LABEL           StartDtscreenEuler2d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode euler2d
+       DESCRIPTION     euler2d: A simulation of 2D incompressible inviscid fluid
+}
+
+ACTION StartDtscreenEyes
+{
+       LABEL           StartDtscreenEyes
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode eyes
+       DESCRIPTION     eyes: Eyes following a bouncing grelb
+}
+
+ACTION StartDtscreenFadeplot
+{
+       LABEL           StartDtscreenFadeplot
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode fadeplot
+       DESCRIPTION     fadeplot: A fading plot of sine squared
+}
+
+ACTION StartDtscreenFire
+{
+       LABEL           StartDtscreenFire
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode fire
+       DESCRIPTION     fire: A 3D fire-like image
+}
+
+ACTION StartDtscreenFlag
+{
+       LABEL           StartDtscreenFlag
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode flag
+       DESCRIPTION     flag: A waving flag image
+}
+
+ACTION StartDtscreenFlow
+{
+       LABEL           StartDtscreenFlow
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode flow
+       DESCRIPTION     flow: Dynamic strange attractors
+}
+
+ACTION StartDtscreenForest
+{
+       LABEL           StartDtscreenForest
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode forest
+       DESCRIPTION     forest: Binary trees of a fractal forest
+}
+
+ACTION StartDtscreenGalaxy
+{
+       LABEL           StartDtscreenGalaxy
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode galaxy
+       DESCRIPTION     galaxy: Crashing spiral galaxies
+}
+
+ACTION StartDtscreenGears
+{
+       LABEL           StartDtscreenGears
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode gears
+       DESCRIPTION     gears: GL's gears
+}
+
+ACTION StartDtscreenGlplanet
+{
+       LABEL           StartDtscreenGlplanet
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode glplanet
+       DESCRIPTION     glplanet: GL's planet
+}
+
+ACTION StartDtscreenGoop
+{
+       LABEL           StartDtscreenGoop
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode goop
+       DESCRIPTION     goop: Goop from a lava lamp
+}
+
+ACTION StartDtscreenGrav
+{
+       LABEL           StartDtscreenGrav
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode grav
+       DESCRIPTION     grav: Orbiting planets
+}
+
+ACTION StartDtscreenHelix
+{
+       LABEL           StartDtscreenHelix
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode helix
+       DESCRIPTION     helix: String art
+}
+
+ACTION StartDtscreenHyper
+{
+       LABEL           StartDtscreenHyper
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode hyper
+       DESCRIPTION     hyper: Spinning n-dimensional hypercubes
+}
+
+ACTION StartDtscreenIco
+{
+       LABEL           StartDtscreenIco
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode ico
+       DESCRIPTION     ico: A bouncing polyhedra
+}
+
+ACTION StartDtscreenIfs
+{
+       LABEL           StartDtscreenIfs
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode ifs
+       DESCRIPTION     ifs: A modified iterated function system
+}
+
+ACTION StartDtscreenInvert
+{
+       LABEL           StartDtscreenInvert
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode invert
+       DESCRIPTION     invert: A sphere inverted without wrinkles
+}
+
+ACTION StartDtscreenJuggle
+{
+       LABEL           StartDtscreenJuggle
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode juggle
+       DESCRIPTION     juggle: A Juggler, juggling
+}
+
+ACTION StartDtscreenJulia
+{
+       LABEL           StartDtscreenJulia
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode julia
+       DESCRIPTION     julia: The Julia set
+}
+
+ACTION StartDtscreenKaleid
+{
+       LABEL           StartDtscreenKaleid
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode kaleid
+       DESCRIPTION     kaleid: Brewster's Kaleidoscope
+}
+
+ACTION StartDtscreenKumppa
+{
+       LABEL           StartDtscreenKumppa
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode kumppa +install
+       DESCRIPTION     kumppa: Kumppa
+}
+
+ACTION StartDtscreenLament
+{
+       LABEL           StartDtscreenLament
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode lament
+       DESCRIPTION     lament: Lemarchand's Box
+}
+
+ACTION StartDtscreenLaser
+{
+       LABEL           StartDtscreenLaser
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode laser
+       DESCRIPTION     laser: Spinning lasers
+}
+
+ACTION StartDtscreenLife1d
+{
+       LABEL           StartDtscreenLife1d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode life1d
+       DESCRIPTION     life1d: Wolfram's game of 1D Life
+}
+
+ACTION StartDtscreenLife3d
+{
+       LABEL           StartDtscreenLife3d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode life3d
+       DESCRIPTION     life3d: Bays' game of 3D Life
+}
+
+ACTION StartDtscreenLightning
+{
+       LABEL           StartDtscreenLightning
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode lightning
+       DESCRIPTION     lightning: Keith's fractal lightning bolts
+}
+
+ACTION StartDtscreenLisa
+{
+       LABEL           StartDtscreenLisa
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode lisa
+       DESCRIPTION     lisa: Animated lisajous loops
+}
+
+ACTION StartDtscreenLissie
+{
+       LABEL           StartDtscreenLissie
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode lissie
+       DESCRIPTION     lissie: Lissajous worms
+}
+
+ACTION StartDtscreenLoop
+{
+       LABEL           StartDtscreenLoop
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode loop
+       DESCRIPTION     loop: Langton's self-producing loops
+}
+
+ACTION StartDtscreenLyapunov
+{
+       LABEL           StartDtscreenLyapunov
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode lyapunov
+       DESCRIPTION     lyapunov: lyapunov space
+}
+
+ACTION StartDtscreenMandelbrot
+{
+       LABEL           StartDtscreenMandelbrot
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode mandelbrot
+       DESCRIPTION     mandelbrot: Mandelbrot sets
+}
+
+ACTION StartDtscreenMarquee
+{
+       LABEL           StartDtscreenMarquee
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode marquee
+       DESCRIPTION     marquee: Messages
+}
+
+ACTION StartDtscreenMatrix
+{
+       LABEL           StartDtscreenMatrix
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode matrix
+       DESCRIPTION     matrix: The matrix
+}
+
+ACTION StartDtscreenMaze
+{
+       LABEL           StartDtscreenMaze
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode maze
+       DESCRIPTION     maze: A random maze and a depth first search solution
+}
+
+ACTION StartDtscreenMoebius
+{
+       LABEL           StartDtscreenMoebius
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode moebius
+       DESCRIPTION     moebius: Moebius Strip II, an Escher-like GL scene with ants
+}
+
+ACTION StartDtscreenMolecule
+{
+       LABEL           StartDtscreenMolecule
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode molecule
+       DESCRIPTION     molecule: Draws molecules
+}
+
+ACTION StartDtscreenMorph3d
+{
+       LABEL           StartDtscreenMorph3d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode morph3d
+       DESCRIPTION     morph3d: GL morphing polyhedra
+}
+
+ACTION StartDtscreenMountain
+{
+       LABEL           StartDtscreenMountain
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode mountain
+       DESCRIPTION     mountain: Papo's mountain range
+}
+
+ACTION StartDtscreenMunch
+{
+       LABEL           StartDtscreenMunch
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode munch
+       DESCRIPTION     munch: Munching squares
+}
+
+ACTION StartDtscreenNose
+{
+       LABEL           StartDtscreenNose
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode nose
+       DESCRIPTION     nose: A man with a big nose runs around spewing out messages
+}
+
+ACTION StartDtscreenPacman
+{
+       LABEL           StartDtscreenPacman
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode pacman
+       DESCRIPTION     pacman: Pacman(tm)
+}
+
+ACTION StartDtscreenPenrose
+{
+       LABEL           StartDtscreenPenrose
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode penrose
+       DESCRIPTION     penrose: Penrose's quasiperiodic tilings
+}
+
+ACTION StartDtscreenPetal
+{
+       LABEL           StartDtscreenPetal
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode petal
+       DESCRIPTION     petal: Various GCD Flowers
+}
+
+ACTION StartDtscreenPipes
+{
+       LABEL           StartDtscreenPipes
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode pipes
+       DESCRIPTION     pipes: A selfbuilding pipe system
+}
+
+ACTION StartDtscreenPolyominoes
+{
+       LABEL           StartDtscreenPolyominoes
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode polyominoes
+       DESCRIPTION     polyominoes: Attempts to place polyominoes into a rectangle
+}
+
+ACTION StartDtscreenPuzzle
+{
+       LABEL           StartDtscreenPuzzle
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode puzzle
+       DESCRIPTION     puzzle: A puzzle being scrambled and then solved
+}
+
+ACTION StartDtscreenRoll
+{
+       LABEL           StartDtscreenRoll
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode roll
+       DESCRIPTION     roll: A rolling ball
+}
+
+ACTION StartDtscreenRubik
+{
+       LABEL           StartDtscreenRubik
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode rubik
+       DESCRIPTION     rubik: An auto-solving Rubik's cube
+}
+
+ACTION StartDtscreenSballs
+{
+       LABEL           StartDtscreenSballs
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode sballs
+       DESCRIPTION     sballs: Balls spinning like crazy in OpenGL
+}
+
+ACTION StartDtscreenScooter
+{
+       LABEL           StartDtscreenScooter
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode scooter
+       DESCRIPTION     scooter: A journey through space tunnel and stars
+}
+
+ACTION StartDtscreenShape
+{
+       LABEL           StartDtscreenShape
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode shape
+       DESCRIPTION     shape: Stippled rectangles, ellipses, and triangles
+}
+
+ACTION StartDtscreenSierpinski
+{
+       LABEL           StartDtscreenSierpinski
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode sierpinski
+       DESCRIPTION     sierpinski: Sierpinski's triangle
+}
+
+ACTION StartDtscreenSierpinski3d
+{
+       LABEL           StartDtscreenSierpinski3d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode sierpinski3d
+       DESCRIPTION     sierpinski: Sierpinski's gasket
+}
+
+ACTION StartDtscreenSkewb
+{
+       LABEL           StartDtscreenSkewb
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode skewb
+       DESCRIPTION     skewb: An auto-solving Skewb
+}
+
+ACTION StartDtscreenSlip
+{
+       LABEL           StartDtscreenSlip
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode slip
+       DESCRIPTION     slip: Slipping blits
+}
+
+ACTION StartDtscreenSolitare
+{
+       LABEL           StartDtscreenSolitare
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode solitare
+       DESCRIPTION     solitare: Klondike's game of solitare
+}
+
+ACTION StartDtscreenSpace
+{
+       LABEL           StartDtscreenSpace
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode space
+       DESCRIPTION     space: A journey into deep space
+}
+
+ACTION StartDtscreenSphere
+{
+       LABEL           StartDtscreenSphere
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode sphere
+       DESCRIPTION     sphere: A bunch of shaded spheres
+}
+
+ACTION StartDtscreenSpiral
+{
+       LABEL           StartDtscreenSpiral
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode spiral
+       DESCRIPTION     spiral: Helixes of dots
+}
+
+ACTION StartDtscreenSpline
+{
+       LABEL           StartDtscreenSpline
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode spline
+       DESCRIPTION     spline: Colorful moving splines
+}
+
+ACTION StartDtscreenSproingies
+{
+       LABEL           StartDtscreenSproingies
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode sproingies
+       DESCRIPTION     sproingies: Sproingies! Nontoxic. Safe for pets and small children
+}
+
+ACTION StartDtscreenStairs
+{
+       LABEL           StartDtscreenStairs
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode stairs
+       DESCRIPTION     stairs: Infinite Stairs, an Escher-like GL scene
+}
+
+ACTION StartDtscreenStar
+{
+       LABEL           StartDtscreenStar
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode star
+       DESCRIPTION     star: A star field with a twist
+}
+
+ACTION StartDtscreenStarfish
+{
+       LABEL           StartDtscreenStarfish
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode starfish +install
+       DESCRIPTION     starfish: Starfish
+}
+
+ACTION StartDtscreenStrange
+{
+       LABEL           StartDtscreenStrange
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode strange
+       DESCRIPTION     strange: Strange attractors
+}
+
+ACTION StartDtscreenSuperquadrics
+{
+       LABEL           StartDtscreenSuperquadrics
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode superquadrics
+       DESCRIPTION     superquadrics: 3D mathematical shapes
+}
+
+ACTION StartDtscreenSwirl
+{
+       LABEL           StartDtscreenSwirl
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode swirl
+       DESCRIPTION     swirl: Animated swirling patterns
+}
+
+ACTION StartDtscreenT3d
+{
+       LABEL           StartDtscreenT3d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode t3d +install
+       DESCRIPTION     t3d: Flying Balls Clock Demo
+}
+
+ACTION StartDtscreenTetris
+{
+       LABEL           StartDtscreenTetris
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode tetris +install
+       DESCRIPTION     tetris: Tetris
+}
+
+ACTION StartDtscreenText3d
+{
+       LABEL           StartDtscreenText3d
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode text3d
+       DESCRIPTION     text3d: 3D text
+}
+
+ACTION StartDtscreenThornbird
+{
+       LABEL           StartDtscreenThornbird
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode thornbird
+       DESCRIPTION     thornbird: An animated Bird in a Thorn Bush fractal map
+}
+
+ACTION StartDtscreenTik_Tak
+{
+       LABEL           StartDtscreenTik_Tak
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode tik_tak +install
+       DESCRIPTION     tik_tak: Rotating polygons
+}
+
+ACTION StartDtscreenTransparent
+{
+       LABEL           StartDtscreenTransparent
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode blank -geometry 1x1 -enablesaver
+       DESCRIPTION     transparent: locked but work visible
+}
+
+ACTION StartDtscreenTriangle
+{
+       LABEL           StartDtscreenTriangle
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode triangle
+       DESCRIPTION     triangle: A triangle mountain range
+}
+
+ACTION StartDtscreenTube
+{
+       LABEL           StartDtscreenTube
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode tube
+       DESCRIPTION     tube: An animated tube
+}
+
+ACTION StartDtscreenTurtle
+{
+       LABEL           StartDtscreenTurtle
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode turtle
+       DESCRIPTION     turtle: Turtle fractals
+}
+
+ACTION StartDtscreenVines
+{
+       LABEL           StartDtscreenVines
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode vines
+       DESCRIPTION     vines: Fractals
+}
+
+ACTION StartDtscreenVoters
+{
+       LABEL           StartDtscreenVoters
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode voters
+       DESCRIPTION     voters: Dewdney's Voters
+}
+
+ACTION StartDtscreenWator
+{
+       LABEL           StartDtscreenWator
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode wator
+       DESCRIPTION     wator: Dewdney's Water-Torus planet of fish and sharks
+}
+
+ACTION StartDtscreenWire
+{
+       LABEL           StartDtscreenWire
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode wire
+       DESCRIPTION     wire: A random circuit with 2 electrons
+}
+
+ACTION StartDtscreenWorld
+{
+       LABEL           StartDtscreenWorld
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode world
+       DESCRIPTION     world: Spinning Earths
+}
+
+ACTION StartDtscreenXcl
+{
+       LABEL           StartDtscreenXcl
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode xcl
+       DESCRIPTION     xcl: A control line combat model race
+}
+
+ACTION StartDtscreenXjack
+{
+       LABEL           StartDtscreenXjack
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode xjack
+       DESCRIPTION     xjack: Jack having one of those days
+}
+
+ACTION StartDtscreenBomb
+{
+       LABEL           StartDtscreenBomb
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode bomb
+       DESCRIPTION     bomb: A bomb and will autologout after a time
+}
+
+ACTION StartDtscreenRandom
+{
+       LABEL           StartDtscreenRandom
+       TYPE            COMMAND
+       WINDOW_TYPE     NO_STDIO
+       EXEC_STRING     $DTSCREEN -mode random
+       DESCRIPTION     random: A random mode except blank and bomb
+}
+
diff --git a/etc/ext.life b/etc/ext.life
new file mode 100644 (file)
index 0000000..1b320c7
--- /dev/null
@@ -0,0 +1,24 @@
+#P 0 0
+...........*
+..........**
+..........
+........***
+........***
+.........
+.........
+.......***
+.......**
+......*..***.*
+......**.*...*
+......**.**.**
+......***
+......**
+......*
+......**
+.......*.*
+...........*
+.........*..*
+..........*..*
+..........*
+.............*
+...........***
diff --git a/etc/fortune.dat b/etc/fortune.dat
new file mode 100644 (file)
index 0000000..9d8b067
--- /dev/null
@@ -0,0 +1,4052 @@
+1420
+%%
+(She is loud and stubborn; her feet abide not in her house: 
+Now is she without, now in the streets, and lieth in wait at every corner.) 
+So she caught him, and kissed him, and 
+with an impudent face said unto him, 
+I have peace offerings with me; this day have I payed my vows.
+%%
+* UNIX is a trademark of AT&T Bell Laboratories.
+%%
+1 bulls, 3 cows.
+%%
+10.0 times 0.1 is hardly ever 1.0.
+%%
+A GOOD name is rather to be chosen than great riches, and 
+loving favour rather than silver and gold.
+%%
+A Puritan is someone who is deathly afraid that someone 
+somewhere is having fun.
+%%
+A bad compromise is better than a good battle. -- Russian 
+proverb
+%%
+A bird in hand is worth two in the bush. -- Cervantes
+%%
+A bird in the bush can't relieve itself in your hand.
+%%
+A brother offended is harder to be won than a strong city: 
+and their contentions are like the bars of a castle.
+%%
+A clash of doctrine is not a disaster -- it is an 
+opportunity.
+%%
+A conservative is one who is too cowardly to fight and too 
+fat to run.
+%%
+A continual dropping in a very rainy day and a contentious 
+woman are alike.
+%%
+A divine sentence is in the lips of the king: his mouth 
+transgresseth not in judgment.
+%%
+A faithful man shall abound with blessings: but he that 
+maketh haste to be rich shall not be innocent.
+%%
+A faithful witness will not lie: but a false witness will 
+utter lies.
+%%
+A false balance is abomination to the LORD: but a just 
+weight is his delight.
+%%
+A false witness shall not be unpunished, and he that 
+speaketh lies shall not escape.
+%%
+A false witness shall not be unpunished, and he that 
+speaketh lies shall perish.
+%%
+A fanatic is one who can't change his mind and won't change 
+the subject.
+%%
+A fool despiseth his father's instruction: but he that 
+regardeth reproof is prudent.
+%%
+A fool hath no delight in understanding, but that his heart 
+may discover itself.
+%%
+A fool uttereth all his mind: but a wise man keepeth it in 
+till afterwards.
+%%
+A fool's lips enter into contention, and his mouth calleth 
+for strokes.
+%%
+A fool's mouth is his destruction, and his lips are the 
+snare of his soul.
+%%
+A fool's wrath is presently known: but a prudent man 
+covereth shame.
+%%
+A foolish consistency is the hobgoblin of little minds.
+%%
+A foolish son is a grief to his father, and bitterness to 
+her that bare him.
+%%
+A foolish son is the calamity of his father: and the 
+contentions of a wife are a continual dropping.
+%%
+A foolish woman is clamorous: she is simple, and knoweth 
+nothing.
+%%
+A froward man soweth strife: and a whisperer separateth 
+chief friends.
+%%
+A gift in secret pacifieth anger: and a reward in the bosom 
+strong wrath.
+%%
+A gift is as a precious stone in the eyes of him that hath 
+it: whithersoever it turneth, it prospereth.
+%%
+A gift of flowers will soon be made to you.
+%%
+A good man leaveth an inheritance to his children's 
+children: and the wealth of the sinner is laid up for the just.
+%%
+A good man obtaineth favour of the LORD: but a man of 
+wicked devices will he condemn.
+%%
+A good memory does not equal pale ink.
+%%
+A gracious woman retaineth honour: and strong men retain 
+riches.
+%%
+A great empire, like a great cake, is most easily 
+diminished at the edges.
+%%
+A hammer sometimes misses its mark -- a bouquet never.
+%%
+A handful of friends is worth more than a wagon of gold.
+%%
+A hen is only an egg's way of making another egg.
+%%
+A hermit is a deserter from the army of humanity.
+%%
+A journey of a thousand miles begins with a cash advance.
+%%
+A just weight and balance are the LORD's: all the weights 
+of the bag are his work.
+%%
+A king that sitteth in the throne of judgment scattereth 
+away all evil with his eyes.
+%%
+A king's castle is his home.
+%%
+A lack of leadership is no substitute for inaction.
+%%
+A liberal is someone too poor to be a capitalist and too 
+rich to be a communist.
+%%
+A lying tongue hateth those that are afflicted by it; and a 
+flattering mouth worketh ruin.
+%%
+A man forgives only when he is in the wrong.
+%%
+A man hath joy by the answer of his mouth: and a word 
+spoken in due season, how good is it! The way of life is above 
+to the wise, that he may depart from hell beneath.
+%%
+A man of genius makes no mistakes.  His errors are 
+volitional and are the portals of discovery.
+%%
+A man of great wrath shall suffer punishment: for if thou 
+deliver him, yet thou must do it again.
+%%
+A man paints with his brains and not with his hands.
+%%
+A man shall be commended according to his wisdom: but he 
+that is of a perverse heart shall be despised.
+%%
+A man shall be satisfied with good by the fruit of his 
+mouth: and the recompence of a man's hands shall be rendered 
+unto him.
+%%
+A man shall eat good by the fruit of his mouth: but the 
+soul of the transgressors shall eat violence.
+%%
+A man shall not be established by wickedness: but the root 
+of the righteous shall not be moved.
+%%
+A man that beareth false witness against his neighbour is a 
+maul, and a sword, and a sharp arrow.
+%%
+A man that doeth violence to the blood of any person shall 
+flee to the pit; let no man stay him.
+%%
+A man that flattereth his neighbour spreadeth a net for his 
+feet.
+%%
+A man that hath friends must shew himself friendly: and 
+there is a friend that sticketh closer than a brother.
+%%
+A man void of understanding striketh hands, and becometh 
+surety in the presence of his friend.
+%%
+A man who fishes for marlin in ponds will put his money in 
+Etruscan bonds.
+%%
+A man who turns green has eschewed protein.
+%%
+A man's belly shall be satisfied with the fruit of his 
+mouth; and with the increase of his lips shall he be filled.
+%%
+A man's gift maketh room for him, and bringeth him before 
+great men.
+%%
+A man's heart deviseth his way: but the LORD directeth his 
+steps.
+%%
+A man's pride shall bring him low: but honour shall uphold 
+the humble in spirit.
+%%
+A merry heart doeth good like a medicine: but a broken 
+spirit drieth the bones.
+%%
+A merry heart maketh a cheerful countenance: but by sorrow 
+of the heart the spirit is broken.
+%%
+A naughty person, a wicked man, walketh with a froward 
+mouth.
+%%
+A plucked goose doesn't lay golden eggs.
+%%
+A poor man that oppresseth the poor is like a sweeping rain 
+which leaveth no food.
+%%
+A professor is one who talks in someone else's sleep.
+%%
+A programming language is low-level when its programs 
+require attention to the irrelevant.
+%%
+A programming language that does not affect the way you 
+think about programming is not worth knowing.
+%%
+A prudent man concealeth knowledge: but the heart of fools 
+proclaimeth foolishness.
+%%
+A prudent man foreseeth the evil, and hideth himself: but 
+the simple pass on, and are punished.
+%%
+A prudent man foreseeth the evil, and hideth himself; but 
+the simple pass on, and are punished.
+%%
+A reproof entereth more into a wise man than an hundred 
+stripes into a fool.
+%%
+A righteous man falling down before the wicked is as a 
+troubled fountain, and a corrupt spring.
+%%
+A righteous man hateth lying: but a wicked man is 
+loathsome, and cometh to shame.
+%%
+A righteous man regardeth the life of his beast: but the 
+tender mercies of the wicked are cruel.
+%%
+A scorner seeketh wisdom, and findeth it not: but knowledge 
+is easy unto him that understandeth.
+%%
+A servant will not be corrected by words: for though he 
+understand he will not answer.
+%%
+A slothful man hideth his hand in his bosom, and will not 
+so much as bring it to his mouth again.
+%%
+A soft answer turneth away wrath: but grievous words stir 
+up anger.
+%%
+A soft drink turneth away company.
+%%
+A sound heart is the life of the flesh: but envy the 
+rottenness of the bones.
+%%
+A stone is heavy, and the sand weighty; but a fool's wrath 
+is heavier than them both.
+%%
+A straw vote only shows which way the hot air blows.
+%%
+A talebearer revealeth secrets: but he that is of a 
+faithful spirit concealeth the matter.
+%%
+A thing not worth doing is worth not doing well.
+%%
+A thing worth doing is worth the trouble of asking somebody 
+else to do.
+%%
+A true witness delivereth souls: but a deceitful witness 
+speaketh lies.
+%%
+A truly wise man never plays leapfrog with a Unicorn.
+%%
+A violent man enticeth his neighbour, and leadeth him into 
+the way that is not good.
+%%
+A virtuous woman is a crown to her husband: but she that 
+maketh ashamed is as rottenness in his bones.
+%%
+A visit to a fresh place will bring strange work.
+%%
+A visit to a strange place will bring fresh work.
+%%
+A whip for the horse, a bridle for the ass, and a rod for 
+the fool's back.
+%%
+A wholesome tongue is a tree of life: but perverseness 
+therein is a breach in the spirit.
+%%
+A wicked doer giveth heed to false lips; and a liar giveth 
+ear to a naughty tongue.
+%%
+A wicked man hardeneth his face: but as for the upright, he 
+directeth his way.
+%%
+A wicked man taketh a gift out of the bosom to pervert the 
+ways of judgment.
+%%
+A wicked messenger falleth into mischief: but a faithful 
+ambassador is health.
+%%
+A wise king scattereth the wicked, and bringeth the wheel 
+over them.
+%%
+A wise man feareth, and departeth from evil: but the fool 
+rageth, and is confident.
+%%
+A wise man is strong; yea, a man of knowledge increaseth 
+strength.
+%%
+A wise man scaleth the city of the mighty, and casteth down 
+the strength of the confidence thereof.
+%%
+A wise man will hear, and will increase learning; and a man 
+of understanding shall attain unto wise counsels: To 
+understand a proverb, and the interpretation; the words of the 
+wise, and their dark sayings.
+%%
+A wise servant shall have rule over a son that causeth 
+shame, and shall have part of the inheritance among the 
+brethren.
+%%
+A wise son heareth his father's instruction: but a scorner 
+heareth not rebuke.
+%%
+A wise son maketh a glad father: but a foolish man 
+despiseth his mother.
+%%
+A woman without a man is like a fish without a bicycle.
+%%
+A word fitly spoken is like apples of gold in pictures of 
+silver.
+%%
+A wound and dishonour shall he get; and his reproach shall 
+not be wiped away.
+%%
+A wrathful man stirreth up strife: but he that is slow to 
+anger appeaseth strife.
+%%
+About all some men accomplish in life is to send a son to 
+Harvard.
+%%
+About the only thing on a farm that has an easy time is the 
+dog.
+%%
+Above all things, reverence yourself.
+%%
+Absence makes the heart grow fonder. -- Sextus Aurelius
+%%
+Absolute power corrupts absolutely.
+%%
+Academy: A modern school where football is taught.
+%%
+Accuse not a servant unto his master, lest he curse thee, 
+and thou be found guilty.
+%%
+Actors will happen in the best-regulated families.
+%%
+Add thou not unto his words, lest he reprove thee, and thou 
+be found a liar.
+%%
+Admiration: Our polite recognition of another's resemblance 
+to ourselves.
+%%
+After a number of decimal places, nobody gives a darn.
+%%
+Age and treachery will always overcome youth and skill.
+%%
+Alimony and bribes will engage a large share of your wealth.
+%%
+All great ideas are controversial, or have been at one time.
+%%
+All heiresses are beautiful. -- John Dryden
+%%
+All in all, it's just another brick in the wall ...
+%%
+All that glitters has a high refractive index.
+%%
+All that trembles doesn't fall. -- Russian proverb
+%%
+All the brave men are in prison. -- Russian proverb
+%%
+All the brethren of the poor do hate him: how much more do 
+his friends go far from him? he pursueth them with words, 
+yet they are wanting to him.
+%%
+All the days of the afflicted are evil: but he that is of a 
+merry heart hath a continual feast.
+%%
+All the ways of a man are clean in his own eyes; but the 
+LORD weigheth the spirits.
+%%
+All the words of my mouth are in righteousness; there is 
+nothing froward or perverse in them.
+%%
+All this wheeling and dealing around, why, it isn't for 
+money, it's for fun.  Money's just the way we keep score.
+%%
+Also to punish the just is not good, nor to strike princes 
+for equity.
+%%
+Also, that the soul be without knowledge, it is not good; 
+and he that hasteth with his feet sinneth.
+%%
+Always do right.  This will gratify some people, and 
+astonish the rest.
+%%
+America's best buy for a dime is a telephone call to the 
+right person.
+%%
+An angry man stirreth up strife, and a furious man 
+aboundeth in transgression.
+%%
+An evil man seeketh only rebellion: therefore a cruel 
+messenger shall be sent against him.
+%%
+An expert is a person who avoids the small errors as he 
+sweeps on to the grand fallacy.
+%%
+An eye for an eye, a tooth for a tooth.
+%%
+An high look, and a proud heart, and the plowing of the 
+wicked, is sin.
+%%
+An hypocrite with his mouth destroyeth his neighbour: but 
+through knowledge shall the just be delivered.
+%%
+An idle mind is worth two in the bush.
+%%
+An inheritance may be gotten hastily at the beginning; but 
+the end thereof shall not be blessed.
+%%
+An optimist believes this to be the best of all possible 
+worlds.  A pessimist fears this to be true.
+%%
+An ungodly man diggeth up evil: and in his lips there is as 
+a burning fire.
+%%
+An ungodly witness scorneth judgment: and the mouth of the 
+wicked devoureth iniquity.
+%%
+An unjust man is an abomination to the just: and he that is 
+upright in the way is abomination to the wicked.
+%%
+And they lay wait for their own blood; they lurk privily 
+for their own lives.
+%%
+And thou shalt have goats' milk enough for thy food, for 
+the food of thy household, and for the maintenance for thy 
+maidens.
+%%
+And why wilt thou, my son, be ravished with a strange 
+woman, and embrace the bosom of a stranger? For the ways of man 
+are before the eyes of the LORD, and he pondereth all his goings.
+%%
+Answer a fool according to his folly, lest he be wise in 
+his own conceit.
+%%
+Answer not a fool according to his folly, lest thou also be 
+like unto him.
+%%
+Anticipated events never live up to expectations.
+%%
+Any fool can paint a picture, but it takes a wise man to be 
+able to sell it.
+%%
+Anybody can win, unless there happens to be a second entry.
+%%
+Apply thine heart unto instruction, and thine ears to the 
+words of knowledge.
+%%
+As a bird that wandereth from her nest, so is a man that 
+wandereth from his place.
+%%
+As a dog returneth to his vomit, so a fool returneth to his 
+folly.
+%%
+As a jewel of gold in a swine's snout, so is a fair woman 
+which is without discretion.
+%%
+As a mad man who casteth firebrands, arrows, and death, So 
+is the man that deceiveth his neighbour, and saith, Am not 
+I in sport? Where no wood is, there the fire goeth out: so 
+where there is no talebearer, the strife ceaseth.
+%%
+As a roaring lion, and a ranging bear; so is a wicked ruler 
+over the poor people.
+%%
+As a thorn goeth up into the hand of a drunkard, so is a 
+parable in the mouths of fools.
+%%
+As an earring of gold, and an ornament of fine gold, so is 
+a wise reprover upon an obedient ear.
+%%
+As coals are to burning coals, and wood to fire; so is a 
+contentious man to kindle strife.
+%%
+As cold waters to a thirsty soul, so is good news from a 
+far country.
+%%
+As goatherd learns his trade by goat, so writer learns his 
+trade by wrote.
+%%
+As he that bindeth a stone in a sling, so is he that giveth 
+honour to a fool.
+%%
+As he that taketh away a garment in cold weather, and as 
+vinegar upon nitre, so is he that singeth songs to an heavy 
+heart.
+%%
+As in water face answereth to face, so the heart of man to 
+man.
+%%
+As long as the answer is right, who cares if the question 
+is wrong?
+%%
+As of next week, passwords will be entered in Morse code.
+%%
+As righteousness tendeth to life: so he that pursueth evil 
+pursueth it to his own death.
+%%
+As snow in summer, and as rain in harvest, so honour is not 
+seemly for a fool.
+%%
+As the bird by wandering, as the swallow by flying, so the 
+curse causeless shall not come.
+%%
+As the cold of snow in the time of harvest, so is a 
+faithful messenger to them that send him: for he refresheth the 
+soul of his masters.
+%%
+As the door turneth upon his hinges, so doth the slothful 
+upon his bed.
+%%
+As the fining pot for silver, and the furnace for gold; so 
+is a man to his praise.
+%%
+As the whirlwind passeth, so is the wicked no more: but the 
+righteous is an everlasting foundation.
+%%
+As vinegar to the teeth, and as smoke to the eyes, so is 
+the sluggard to them that send him.
+%%
+At the last it biteth like a serpent, and stingeth like an adder.
+%%
+Audacity, and again audacity, and always audacity.
+-- Georges Jacques Danton
+%%
+Avoid GOTOs completely if you can keep the program readable.
+%%
+Avoid it, pass not by it, turn from it, and pass away.
+%%
+Avoid temporary variables.
+%%
+Avoid the Fortran arithmetic IF.
+%%
+Avoid unnecessary branches.
+%%
+Be careful when a loop exits to the same place from side 
+and bottom.
+%%
+Be careful!  Is it classified?
+%%
+Be friends with the wolf, but keep one hand on your ax. -- 
+Russian proverb
+%%
+Be not a witness against thy neighbour without cause; and 
+deceive not with thy lips.
+%%
+Be not afraid of sudden fear, neither of the desolation of 
+the wicked, when it cometh.
+%%
+Be not among winebibbers; among riotous eaters of flesh: 
+For the drunkard and the glutton shall come to poverty: and 
+drowsiness shall clothe a man with rags.
+%%
+Be not desirous of his dainties: for they are deceitful meat.
+%%
+Be not thou envious against evil men, neither desire to be 
+with them.
+%%
+Be not thou one of them that strike hands, or of them that 
+are sureties for debts.
+%%
+Be not wise in thine own eyes: fear the LORD, and depart 
+from evil.
+%%
+Be prepared to go mad with fixed rule and method. -- Horace
+%%
+Be security conscious -- National Defense is at stake.
+%%
+Be thou diligent to know the state of thy flocks, and look 
+well to thy herds.
+%%
+Because I have called, and ye refused; I have stretched out 
+my hand, and no man regarded; But ye have set at nought 
+all my counsel, and would none of my reproof: I also will 
+laugh at your calamity; I will mock when your fear cometh; 
+When your fear cometh as desolation, and your destruction 
+cometh as a whirlwind; when distress and anguish cometh upon you.
+%%
+Before a fight, two men are boasting; after the fight, only 
+one. -- Russian proverb
+%%
+Before destruction the heart of man is haughty, and before 
+honour is humility.
+%%
+Before the mountains were settled, before the hills was I 
+brought forth: While as yet he had not made the earth, nor 
+the fields, nor the highest part of the dust of the world.
+%%
+Begin in the beginning and go on till you come to the end; 
+then stop. -- Lewis Carroll
+%%
+Behold, the righteous shall be recompensed in the earth: 
+much more the wicked and the sinner.
+%%
+Better is a dinner of herbs where love is, than a stalled 
+ox and hatred therewith.
+%%
+Better is a dry morsel, and quietness therewith, than an 
+house full of sacrifices with strife.
+%%
+Better is a little with righteousness than great revenues 
+without right.
+%%
+Better is little with the fear of the LORD than great 
+treasure and trouble therewith.
+%%
+Better is the poor that walketh in his integrity, than he 
+that is perverse in his lips, and is a fool.
+%%
+Better is the poor that walketh in his uprightness, than he 
+that is perverse in his ways, though he be rich.
+%%
+Better it is to be of an humble spirit with the lowly, than 
+to divide the spoil with the proud.
+%%
+Better living a beggar than buried an emperor.
+%%
+Better the first quarrel than the last. -- Russian proverb
+%%
+Better to light one candle than to curse the darkness.
+%%
+Better turn back than lose your way. -- Russian proverb
+%%
+Beware of Greeks bearing gifts. -- Virgil
+%%
+Beware of a dark-haired man with a loud tie.
+%%
+Beware of a tall dark man with a spoon up his nose.
+%%
+Beware of all enterprises that require new clothes.
+%%
+Beware the new TTY code!
+%%
+Bind them upon thy fingers, write them upon the table of 
+thine heart.
+%%
+Blessed are they that run around in circles, for they shall 
+be known as wheels.
+%%
+Blessed is the man that heareth me, watching daily at my 
+gates, waiting at the posts of my doors.
+%%
+Blessings are upon the head of the just: but violence 
+covereth the mouth of the wicked.
+%%
+Boast not thyself of to morrow; for thou knowest not what a 
+day may bring forth.
+%%
+Bow down thine ear, and hear the words of the wise, and 
+apply thine heart unto my knowledge.
+%%
+Brain fried --
+core dumped
+%%
+Bread of deceit is sweet to a man; but afterwards his mouth 
+shall be filled with gravel.
+%%
+Bullets don't respect uniforms.
+-- Russian proverb
+%%
+Burning lips and a wicked heart are like a potsherd covered 
+with silver dross.
+%%
+Business will be either better or worse. -- Calvin Coolidge
+%%
+But he knoweth not that the dead are there; and that her 
+guests are in the depths of hell.
+%%
+But he that sinneth against me wrongeth his own soul: all 
+they that hate me love death.
+%%
+But the path of the just is as the shining light, that 
+shineth more and more unto the perfect day.
+%%
+But the wicked shall be cut off from the earth, and the 
+transgressors shall be rooted out of it.
+%%
+But whoso committeth adultery with a woman lacketh 
+understanding: he that doeth it destroyeth his own soul.
+%%
+But whoso hearkeneth unto me shall dwell safely, and shall 
+be quiet from fear of evil.
+%%
+Buy the truth, and sell it not; also wisdom, and 
+instruction, and understanding.
+%%
+By failing to prepare, you are preparing to fail.
+%%
+By his knowledge the depths are broken up, and the clouds 
+drop down the dew.
+%%
+By humility and the fear of the LORD are riches, and 
+honour, and life.
+%%
+By long forbearing is a prince persuaded, and a soft tongue 
+breaketh the bone.
+%%
+By me kings reign, and princes decree justice.
+%%
+By me princes rule, and nobles, even all the judges of the 
+earth.
+%%
+By mercy and truth iniquity is purged: and by the fear of 
+the LORD men depart from evil.
+%%
+By the blessing of the upright the city is exalted: but it 
+is overthrown by the mouth of the wicked.
+%%
+Can a man take fire in his bosom, and his clothes not be 
+burned? Can one go upon hot coals, and his feet not be 
+burned? So he that goeth in to his neighbour's wife; whosoever 
+toucheth her shall not be innocent.
+%%
+Can anyone remember when the times were not hard, and money 
+not scarce?
+%%
+Can anything be sadder than work left unfinished?  Yes, 
+work never begun.
+%%
+Cannot open /usr/games/lib/fortunes.
+%%
+Cast out the scorner, and contention shall go out; yea, 
+strife and reproach shall cease.
+%%
+Cease, my son, to hear the instruction that causeth to err 
+from the words of knowledge.
+%%
+Change your thoughts and you change your world.
+%%
+Charity: A thing that begins at home and usually stays 
+there.
+%%
+Chasten thy son while there is hope, and let not thy soul 
+spare for his crying.
+%%
+Children's children are the crown of old men; and the glory 
+of children are their fathers.
+%%
+Chinese saying: He who speak with forked tongue, not need 
+chopsticks.
+%%
+Choose variable names that won't be confused.
+%%
+Civilization is the limitless multiplication of unnecessary 
+necessities.
+%%
+Classified material requires proper storage.
+%%
+Colorless green ideas sleep furiously.
+%%
+Come, let us take our fill of love until the morning: let 
+us solace ourselves with loves.
+%%
+Commit thy works unto the LORD, and thy thoughts shall be 
+established.
+%%
+Common sense is not so common.
+%%
+Complaint is the largest tribute heaven receives, and the 
+sincerest part of our devotion.
+%%
+Confidence in an unfaithful man in time of trouble is like 
+a broken tooth, and a foot out of joint.
+%%
+Conscience doth make cowards of us all. -- William 
+Shakespeare
+%%
+Continental Life.  Why do you ask?
+%%
+Correct thy son, and he shall give thee rest; yea, he shall 
+give delight unto thy soul.
+%%
+Correction is grievous unto him that forsaketh the way: and 
+he that hateth reproof shall die.
+%%
+Could John Wayne have ever taken Normandy, Iwo Jima, Korea, 
+the Gulf of Tonkin, and the entire Wild West on a diet of 
+quiche and salad?
+%%
+Counsel in the heart of man is like deep water; but a man 
+of understanding will draw it out.
+%%
+Counsel is mine, and sound wisdom: I am understanding; I 
+have strength.
+%%
+Courage is grace under pressure.
+%%
+Courage is your greatest present need.
+%%
+Creditors have much better memories than debtors.
+%%
+Culture is the habit of being pleased with the best and 
+knowing why.
+%%
+Death and life are in the power of the tongue: and they 
+that love it shall eat the fruit thereof.
+%%
+Death: To stop sinning suddenly.
+%%
+Debate thy cause with thy neighbour himself; and discover 
+not a secret to another: Lest he that heareth it put thee to 
+shame, and thine infamy turn not away.
+%%
+Deceit is in the heart of them that imagine evil: but to 
+the counsellors of peace is joy.
+%%
+Delight is not seemly for a fool; much less for a servant 
+to have rule over princes.
+%%
+Deliver thyself as a roe from the hand of the hunter, and 
+as a bird from the hand of the fowler.
+%%
+Democracy is the recurrent suspicion that more than half of 
+the people are right more than half of the time.
+%%
+Depression is merely anger without the enthusiasm.
+%%
+Deprive a mirror of its silver and even the Czar won't see 
+his face.
+%%
+Devise not evil against thy neighbour, seeing he dwelleth 
+securely by thee.
+%%
+Disclose classified information only when a NEED TO KNOW 
+exists.
+%%
+Discretion is the better part of valor. -- William 
+Shakespeare
+%%
+Disk crunch -- please clean up.
+%%
+Divers weights are an abomination unto the LORD; and a 
+false balance is not good.
+%%
+Do not clog intellect's sluices with bits of knowledge of 
+questionable uses.
+%%
+Do not merely believe in miracles, rely on them.
+%%
+Do not take life too seriously: you will never get out of 
+it alive.
+%%
+Do not underestimate the power of the Force.
+%%
+Do they not err that devise evil? but mercy and truth shall 
+be to them that devise good.
+%%
+Do this now, my son, and deliver thyself, when thou art 
+come into the hand of thy friend; go, humble thyself, and make 
+sure thy friend.
+%%
+Do you always believe what a computer tells you?
+%%
+Do you really want to know what I think of you?
+%%
+Dogs do not dislike poor families.
+%%
+Don't be humble, you're not that great.
+%%
+Don't comment bad code -- rewrite it.
+%%
+Don't compare floating point numbers solely for equality.
+%%
+Don't despair -- your ideal lover is waiting for you around 
+the corner.
+%%
+Don't diddle code to make it faster -- find a better 
+algorithm.
+%%
+Don't drive your horse with a whip -- use the oat bag. -- 
+Russian proverb
+%%
+Don't force it, use a bigger hammer.
+%%
+Don't get stuck in a closet -- wear yourself out.
+%%
+Don't hit the keys so hard, it hurts.
+%%
+Don't look now, but the man in the moon is laughing at you.
+%%
+Don't look now, but there is a multi-legged creature on 
+your shoulder.
+%%
+Don't patch bad code -- rewrite it.
+%%
+Don't quit now, we might just as well lock the door and 
+throw away the key.
+%%
+Don't stop at one bug.
+%%
+Don't tell me what you dreamt last night for I've been 
+reading Freud.
+%%
+Doth not wisdom cry? and understanding put forth her voice? 
+She standeth in the top of high places, by the way in the 
+places of the paths.
+%%
+Drawing on my fine command of language, I said nothing.
+%%
+Drink waters out of thine own cistern, and running waters 
+out of thine own well.
+%%
+Drugs are for people who can't handle reality.
+%%
+Due to lack of interest, today has been cancelled.
+%%
+Due to popular demand, you have been awarded the day off.
+%%
+Eat thou not the bread of him that hath an evil eye, 
+neither desire thou his dainty meats: For as he thinketh in his 
+heart, so is he: Eat and drink, saith he to thee; but his 
+heart is not with thee.
+%%
+Education helps earning capacity.  Ask any college 
+professor.
+%%
+Enter not into the path of the wicked, and go not in the 
+way of evil men.
+%%
+Envy thou not the oppressor, and choose none of his ways.
+%%
+Eternal nothingness is fine if you're dressed for it.
+%%
+Even a cabbage may look at a king.
+%%
+Even a child is known by his doings, whether his work be 
+pure, and whether it be right.
+%%
+Even a fool, when he holdeth his peace, is counted wise: 
+and he that shutteth his lips is esteemed a man of 
+understanding.
+%%
+Even a hawk is an eagle among crows.
+%%
+Even in laughter the heart is sorrowful; and the end of 
+that mirth is heaviness.
+%%
+Even the boldest zebra fears the hungry lion.
+%%
+Even the smallest candle burns brighter in the dark.
+%%
+Every absurdity has a champion to defend it.
+%%
+Every creature has within itself the wild, uncontrollable 
+urge to punt.
+%%
+Every generation laughs at old fashions, but follows 
+religiously the new.
+%%
+Every man shall kiss his lips that giveth a right answer.
+%%
+Every nation has the government it deserves.
+%%
+Every one that is proud in heart is an abomination to the 
+LORD: though hand join in hand, he shall not be unpunished.
+%%
+Every program has (at least) two purposes: the one for 
+which it was built, and another for which it wasn't.
+%%
+Every program is a part of some other program and rarely 
+fits.
+%%
+Every prudent man dealeth with knowledge: but a fool layeth 
+open his folly.
+%%
+Every purchase has its price.
+%%
+Every purpose is established by counsel: and with good 
+advice make war.
+%%
+Every silver lining has a cloud inside it.
+%%
+Every way of a man is right in his own eyes: but the LORD 
+pondereth the hearts.
+%%
+Every wise woman buildeth her house: but the foolish 
+plucketh it down with her hands.
+%%
+Everybody needs a little love sometime; stop hacking and 
+fall in love!
+%%
+Everybody ought to have a friend.
+%%
+Everyone is enthusiastic about your work.
+%%
+Everyone needs to believe in something; I believe I'll have 
+another beer.
+%%
+Everything should be built top-down, except the first time.
+%%
+Everything should be made as simple as possible, but no 
+simpler.
+%%
+Everything you know is wrong!
+%%
+Evil men understand not judgment: but they that seek the 
+LORD understand all things.
+%%
+Evil pursueth sinners: but to the righteous good shall be 
+repayed.
+%%
+Exalt her, and she shall promote thee: she shall bring thee 
+to honour, when thou dost embrace her.
+%%
+Excellent speech becometh not a fool: much less do lying 
+lips a prince.
+%%
+Facts do not cease to exist because they are ignored.
+%%
+Failure is more frequently from want of energy than want of 
+capital.
+%%
+Faithful are the wounds of a friend; but the kisses of an 
+enemy are deceitful.
+%%
+Far duller than a serpent's tooth it is to spend a quiet 
+youth.
+%%
+Favour is deceitful, and beauty is vain: but a woman that 
+feareth the LORD, she shall be praised.
+%%
+Fear has big eyes. -- Russian proverb
+%%
+Fidelity: A virtue peculiar to those who are about to be 
+betrayed.
+%%
+Finagle's Law: The perversity of the universe tends toward 
+a maximum.
+%%
+Flee at once, all is discovered.
+%%
+Folly is joy to him that is destitute of wisdom: but a man 
+of understanding walketh uprightly.
+%%
+Foolishness is bound in the heart of a child; but the rod 
+of correction shall drive it far from him.
+%%
+Fools ignore complexity.  Pragmatists suffer it.  Geniuses 
+remove it.
+%%
+Fools make a mock at sin: but among the righteous there is 
+favour.
+%%
+Fools rush in where angels fear to tread. -- Alexander Pope
+%%
+Fools shoot, but God directs the bullets. -- Russian 
+proverb
+%%
+For I give you good doctrine, forsake ye not my law.
+%%
+For I was my father's son, tender and only beloved in the 
+sight of my mother.
+%%
+For a whore is a deep ditch; and a strange woman is a 
+narrow pit.
+%%
+For at the window of my house I looked through my casement, 
+And beheld among the simple ones, I discerned among the 
+youths, a young man void of understanding, Passing through 
+the street near her corner; and he went the way to her house, 
+In the twilight, in the evening, in the black and dark 
+night: And, behold, there met him a woman with the attire of 
+an harlot, and subtil of heart.
+%%
+For by me thy days shall be multiplied, and the years of 
+thy life shall be increased.
+%%
+For by means of a whorish woman a man is brought to a piece 
+of bread: and the adultress will hunt for the precious 
+life.
+%%
+For by wise counsel thou shalt make thy war: and in 
+multitude of counsellors there is safety.
+%%
+For her house inclineth unto death, and her paths unto the 
+dead.
+%%
+For it is a pleasant thing if thou keep them within thee; 
+they shall withal be fitted in thy lips.
+%%
+For jealousy is the rage of a man: therefore he will not 
+spare in the day of vengeance.
+%%
+For my mouth shall speak truth; and wickedness is an 
+abomination to my lips.
+%%
+For riches are not for ever: and doth the crown endure to 
+every generation? The hay appeareth, and the tender grass 
+sheweth itself, and herbs of the mountains are gathered.
+%%
+For she hath cast down many wounded: yea, many strong men 
+have been slain by her.
+%%
+For she sitteth at the door of her house, on a seat in the 
+high places of the city, To call passengers who go right on 
+their ways: Whoso is simple, let him turn in hither: and 
+as for him that wanteth understanding, she saith to him, 
+Stolen waters are sweet, and bread eaten in secret is pleasant.
+%%
+For surely there is an end; and thine expectation shall not 
+be cut off.
+%%
+For the LORD giveth wisdom: out of his mouth cometh 
+knowledge and understanding.
+%%
+For the LORD shall be thy confidence, and shall keep thy 
+foot from being taken.
+%%
+For the commandment is a lamp; and the law is light; and 
+reproofs of instruction are the way of life: To keep thee 
+from the evil woman, from the flattery of the tongue of a 
+strange woman.
+%%
+For the froward is abomination to the LORD: but his secret 
+is with the righteous.
+%%
+For the goodman is not at home, he is gone a long journey: 
+He hath taken a bag of money with him, and will come home 
+at the day appointed.
+%%
+For the lips of a strange woman drop as an honeycomb, and 
+her mouth is smoother than oil: But her end is bitter as 
+wormwood, sharp as a two-edged sword.
+%%
+For the merchandise of it is better than the merchandise of 
+silver, and the gain thereof than fine gold.
+%%
+For the transgression of a land many are the princes 
+thereof: but by a man of understanding and knowledge the state 
+thereof shall be prolonged.
+%%
+For the turning away of the simple shall slay them, and the 
+prosperity of fools shall destroy them.
+%%
+For the upright shall dwell in the land, and the perfect 
+shall remain in it.
+%%
+For their heart studieth destruction, and their lips talk 
+of mischief.
+%%
+For they are life unto those that find them, and health to 
+all their flesh.
+%%
+For they eat the bread of wickedness, and drink the wine of 
+violence.
+%%
+For they sleep not, except they have done mischief; and 
+their sleep is taken away, unless they cause some to fall.
+%%
+For three things the earth is disquieted, and for four 
+which it cannot bear: For a servant when he reigneth; and a 
+fool when he is filled with meat; For an odious woman when she 
+is married; and an handmaid that is heir to her mistress.
+%%
+For whoso findeth me findeth life, and shall obtain favour 
+of the LORD.
+%%
+For wisdom is better than rubies; and all the things that 
+may be desired are not to be compared to it.
+%%
+Forgive and forget. -- Cervantes
+%%
+Forsake her not, and she shall preserve thee: love her, and 
+she shall keep thee.
+%%
+Forsake the foolish, and live; and go in the way of 
+understanding.
+%%
+Fret not thyself because of evil men, neither be thou 
+envious at the wicked: For there shall be no reward to the evil 
+man; the candle of the wicked shall be put out.
+%%
+Friends: People who borrow my books and set wet glasses on 
+them.
+%%
+General notions are generally wrong.
+%%
+Genius is the talent of a man who is dead.
+%%
+Get wisdom, get understanding: forget it not; neither 
+decline from the words of my mouth.
+%%
+Give her of the fruit of her hands; and let her own works 
+praise her in the gates.
+%%
+Give instruction to a wise man, and he will be yet wiser: 
+teach a just man, and he will increase in learning.
+%%
+Give not sleep to thine eyes, nor slumber to thine eyelids.
+%%
+Give strong drink unto him that is ready to perish, and 
+wine unto those that be of heavy hearts.
+%%
+Go directly to jail.  Do not pass Go, do not collect $200.
+%%
+Go from the presence of a foolish man, when thou perceivest 
+not in him the lips of knowledge.
+%%
+Go not forth hastily to strive, lest thou know not what to 
+do in the end thereof, when thy neighbour hath put thee to 
+shame.
+%%
+Go to the ant, thou sluggard; consider her ways, and be 
+wise: Which having no guide, overseer, or ruler, Provideth her 
+meat in the summer, and gathereth her food in the harvest.
+%%
+God does not play dice.
+%%
+God gave us two ears and one tongue so that we may listen 
+twice as much as we speak.
+%%
+God helps them that help themselves. -- Benjamin Franklin
+%%
+God is not dead; He is only swapped out.
+%%
+God made the integers; all else is the work of Man.
+%%
+God may be subtle, but He isn't plain mean.
+%%
+God must love the common man: He made so many of them.
+%%
+Good intentions are far more difficult to cope with than 
+malicious behavior.
+%%
+Good intentions randomize behavior.
+%%
+Good understanding giveth favour: but the way of 
+transgressors is hard.
+%%
+Great is Holy Russia, but the sun shines elsewhere, too. -- 
+Old Russian proverb
+%%
+Great spirits have always encountered violent opposition 
+from mediocre minds.
+%%
+Greatness is a transitory experience.  It is never 
+consistent.
+%%
+Hackers of the world, unite!
+%%
+Happiness adds and multiplies as we divide it with others.
+%%
+Happy is the man that feareth alway: but he that hardeneth 
+his heart shall fall into mischief.
+%%
+Happy is the man that findeth wisdom, and the man that 
+getteth understanding.
+%%
+Hast thou found honey? eat so much as is sufficient for 
+thee, lest thou be filled therewith, and vomit it.
+%%
+Haste makes waste.
+%%
+Hatred stirreth up strifes: but love covereth all sins.
+%%
+Have not I written to thee excellent things in counsels and 
+knowledge, That I might make thee know the certainty of 
+the words of truth; that thou mightest answer the words of 
+truth to them that send unto thee? Rob not the poor, because 
+he is poor: neither oppress the afflicted in the gate: For 
+the LORD will plead their cause, and spoil the soul of 
+those that spoiled them.
+%%
+Have you locked your file cabinet?
+%%
+He also that is slothful in his work is brother to him that 
+is a great waster.
+%%
+He becometh poor that dealeth with a slack hand: but the 
+hand of the diligent maketh rich.
+%%
+He coveteth greedily all the day long: but the righteous 
+giveth and spareth not.
+%%
+He goeth after her straightway, as an ox goeth to the 
+slaughter, or as a fool to the correction of the stocks; Till a 
+dart strike through his liver; as a bird hasteth to the 
+snare, and knoweth not that it is for his life.
+%%
+He is considered the most graceful speaker who can say 
+nothing in most words.
+%%
+He is in the way of life that keepeth instruction: but he 
+that refuseth reproof erreth.
+%%
+He is truly wise who gains wisdom from another's mishap.
+%%
+He keepeth the paths of judgment, and preserveth the way of 
+his saints.
+%%
+He layeth up sound wisdom for the righteous: he is a 
+buckler to them that walk uprightly.
+%%
+He looked at me as if I was a side dish he hadn't ordered.
+%%
+He loveth transgression that loveth strife: and he that 
+exalteth his gate seeketh destruction.
+%%
+He shall die without instruction; and in the greatness of 
+his folly he shall go astray.
+%%
+He shutteth his eyes to devise froward things: moving his 
+lips he bringeth evil to pass.
+%%
+He taught me also, and said unto me, Let thine heart retain 
+my words: keep my commandments, and live.
+%%
+He that answereth a matter before he heareth it, it is 
+folly and shame unto him.
+%%
+He that begetteth a fool doeth it to his sorrow: and the 
+father of a fool hath no joy.
+%%
+He that blesseth his friend with a loud voice, rising early 
+in the morning, it shall be counted a curse to him.
+%%
+He that by usury and unjust gain increaseth his substance, 
+he shall gather it for him that will pity the poor.
+%%
+He that covereth a transgression seeketh love; but he that 
+repeateth a matter separateth very friends.
+%%
+He that covereth his sins shall not prosper: but whoso 
+confesseth and forsaketh them shall have mercy.
+%%
+He that delicately bringeth up his servant from a child 
+shall have him become his son at the length.
+%%
+He that despiseth his neighbour sinneth: but he that hath 
+mercy on the poor, happy is he.
+%%
+He that deviseth to do evil shall be called a mischievous 
+person.
+%%
+He that diligently seeketh good procureth favour: but he 
+that seeketh mischief, it shall come unto him.
+%%
+He that followeth after righteousness and mercy findeth 
+life, righteousness, and honour.
+%%
+He that gathereth in summer is a wise son: but he that 
+sleepeth in harvest is a son that causeth shame.
+%%
+He that getteth wisdom loveth his own soul: he that keepeth 
+understanding shall find good.
+%%
+He that giveth unto the poor shall not lack: but he that 
+hideth his eyes shall have many a curse.
+%%
+He that goeth about as a talebearer revealeth secrets: 
+therefore meddle not with him that flattereth with his lips.
+%%
+He that handleth a matter wisely shall find good: and whoso 
+trusteth in the LORD, happy is he.
+%%
+He that hasteth to be rich hath an evil eye, and 
+considereth not that poverty shall come upon him.
+%%
+He that hateth dissembleth with his lips, and layeth up 
+deceit within him; When he speaketh fair, believe him not: for 
+there are seven abominations in his heart.
+%%
+He that hath a bountiful eye shall be blessed; for he 
+giveth of his bread to the poor.
+%%
+He that hath a froward heart findeth no good: and he that 
+hath a perverse tongue falleth into mischief.
+%%
+He that hath knowledge spareth his words: and a man of 
+understanding is of an excellent spirit.
+%%
+He that hath no rule over his own spirit is like a city 
+that is broken down, and without walls.
+%%
+He that hath pity upon the poor lendeth unto the LORD; and 
+that which he hath given will he pay him again.
+%%
+He that hideth hatred with lying lips, and he that uttereth 
+a slander, is a fool.
+%%
+He that is despised, and hath a servant, is better than he 
+that honoureth himself, and lacketh bread.
+%%
+He that is first in his own cause seemeth just; but his 
+neighbour cometh and searcheth him.
+%%
+He that is greedy of gain troubleth his own house; but he 
+that hateth gifts shall live.
+%%
+He that is of a proud heart stirreth up strife: but he that 
+putteth his trust in the LORD shall be made fat.
+%%
+He that is slow to anger is better than the mighty; and he 
+that ruleth his spirit than he that taketh a city.
+%%
+He that is slow to wrath is of great understanding: but he 
+that is hasty of spirit exalteth folly.
+%%
+He that is soon angry dealeth foolishly: and a man of 
+wicked devices is hated.
+%%
+He that is surety for a stranger shall smart for it: and he 
+that hateth suretiship is sure.
+%%
+He that is void of wisdom despiseth his neighbour: but a 
+man of understanding holdeth his peace.
+%%
+He that justifieth the wicked, and he that condemneth the 
+just, even they both are abomination to the LORD.
+%%
+He that keepeth his mouth keepeth his life: but he that 
+openeth wide his lips shall have destruction.
+%%
+He that keepeth the commandment keepeth his own soul; but 
+he that despiseth his ways shall die.
+%%
+He that laboureth laboureth for himself; for his mouth 
+craveth it of him.
+%%
+He that loveth pleasure shall be a poor man: he that loveth 
+wine and oil shall not be rich.
+%%
+He that loveth pureness of heart, for the grace of his lips 
+the king shall be his friend.
+%%
+He that oppresseth the poor reproacheth his Maker: but he 
+that honoureth him hath mercy on the poor.
+%%
+He that oppresseth the poor to increase his riches, and he 
+that giveth to the rich, shall surely come to want.
+%%
+He that passeth by, and meddleth with strife belonging not 
+to him, is like one that taketh a dog by the ears.
+%%
+He that rebuketh a man afterwards shall find more favour 
+than he that flattereth with the tongue.
+%%
+He that refuseth instruction despiseth his own soul: but he 
+that heareth reproof getteth understanding.
+%%
+He that reproveth a scorner getteth to himself shame: and 
+he that rebuketh a wicked man getteth himself a blot.
+%%
+He that saith unto the wicked, Thou are righteous; him 
+shall the people curse, nations shall abhor him: But to them 
+that rebuke him shall be delight, and a good blessing shall 
+come upon them.
+%%
+He that sendeth a message by the hand of a fool cutteth off 
+the feet, and drinketh damage.
+%%
+He that soweth iniquity shall reap vanity: and the rod of 
+his anger shall fail.
+%%
+He that spareth his rod hateth his son: but he that loveth 
+him chasteneth him betimes.
+%%
+He that speaketh truth sheweth forth righteousness: but a 
+false witness deceit.
+%%
+He that tilleth his land shall be satisfied with bread: but 
+he that followeth vain persons is void of understanding.
+%%
+He that tilleth his land shall have plenty of bread: but he 
+that followeth after vain persons shall have poverty 
+enough.
+%%
+He that troubleth his own house shall inherit the wind: and 
+the fool shall be servant to the wise of heart.
+%%
+He that trusteth in his own heart is a fool: but whoso 
+walketh wisely, he shall be delivered.
+%%
+He that trusteth in his riches shall fall; but the 
+righteous shall flourish as a branch.
+%%
+He that turneth away his ear from hearing the law, even his 
+prayer shall be abomination.
+%%
+He that walketh in his uprightness feareth the LORD: but he 
+that is perverse in his ways despiseth him.
+%%
+He that walketh uprightly walketh surely: but he that 
+perverteth his ways shall be known.
+%%
+He that walketh with wise men shall be wise: but a 
+companion of fools shall be destroyed.
+%%
+He that wasteth his father, and chaseth away his mother, is 
+a son that causeth shame, and bringeth reproach.
+%%
+He that winketh with the eye causeth sorrow: but a prating 
+fool shall fall.
+%%
+He that withholdeth corn, the people shall curse him: but 
+blessing shall be upon the head of him that selleth it.
+%%
+He that would govern others, first should be the master of 
+himself.
+%%
+He thinks by infection, catching an opinion like a cold.
+%%
+He walks as if balancing the family tree on his nose.
+%%
+He was so narrow-minded he could see through a keyhole with 
+both eyes.
+%%
+He who has imagination without learning has wings but no 
+feet.
+%%
+He who hates vices hates mankind.
+%%
+He who hesitates is lost.
+%%
+He who hesitates is sometimes saved.
+%%
+He who invents adages for others to peruse takes along 
+rowboat when going on cruise.
+%%
+He who laughs, lasts.
+%%
+He who lives without folly is less wise than he believes.
+%%
+He who spends a storm beneath a tree, takes life with a 
+grain of TNT.
+%%
+He will not regard any ransom; neither will he rest 
+content, though thou givest many gifts.
+%%
+He winketh with his eyes, he speaketh with his feet, he 
+teacheth with his fingers; Frowardness is in his heart, he 
+deviseth mischief continually; he soweth discord.
+%%
+He, that being often reproved hardeneth his neck, shall 
+suddenly be destroyed, and that without remedy.
+%%
+Hear counsel, and receive instruction, that thou mayest be 
+wise in thy latter end.
+%%
+Hear instruction, and be wise, and refuse it not.
+%%
+Hear me now therefore, O ye children, and depart not from 
+the words of my mouth.
+%%
+Hear thou, my son, and be wise, and guide thine heart in 
+the way.
+%%
+Hear, O my son, and receive my sayings; and the years of 
+thy life shall be many.
+%%
+Hear, ye children, the instruction of a father, and attend 
+to know understanding.
+%%
+Hear; for I will speak of excellent things; and the opening 
+of my lips shall be right things.
+%%
+Hearken unto me now therefore, O ye children, and attend to 
+the words of my mouth.
+%%
+Hearken unto thy father that begat thee, and despise not 
+thy mother when she is old.
+%%
+Heaviness in the heart of man maketh it stoop: but a good 
+word maketh it glad.
+%%
+Hell and destruction are before the LORD: how much more 
+then the hearts of the children of men? A scorner loveth not 
+one that reproveth him: neither will he go unto the wise.
+%%
+Hell and destruction are never full; so the eyes of man are 
+never satisfied.
+%%
+Hell is empty and all the devils are here.  [The Tempest]
+%%
+Her children arise up, and call her blessed; her husband 
+also, and he praiseth her.
+%%
+Her feet go down to death; her steps take hold on hell.
+%%
+Her house is the way to hell, going down to the chambers of 
+death.
+%%
+Her husband is known in the gates, when he sitteth among 
+the elders of the land.
+%%
+Her ways are ways of pleasantness, and all her paths are 
+peace.
+%%
+His heart was yours from the first moment that you met.
+%%
+His own iniquities shall take the wicked himself, and he 
+shall be holden with the cords of his sins.
+%%
+Histories are fuller of examples of the fidelity of dogs 
+than of friends.
+%%
+Honi soit la vache qui rit.
+%%
+Honour the LORD with thy substance, and with the 
+firstfruits of all thine increase: So shall thy barns be filled with 
+plenty, and thy presses shall burst out with new wine.
+%%
+Hope deferred maketh the heart sick: but when the desire 
+cometh, it is a tree of life.
+%%
+Houdini's escaping from New Jersey!
+%%
+House and riches are the inheritance of fathers: and a 
+prudent wife is from the LORD.
+%%
+How can you work when the system's so crowded?
+%%
+How long wilt thou sleep, O sluggard? when wilt thou arise 
+out of thy sleep? Yet a little sleep, a little slumber, a 
+little folding of the hands to sleep: So shall thy poverty 
+come as one that travelleth, and thy want as an armed man.
+%%
+How many weeks are there in a light year?
+%%
+How much better is it to get wisdom than gold! and to get 
+understanding rather to be chosen than silver! The highway 
+of the upright is to depart from evil: he that keepeth his 
+way preserveth his soul.
+%%
+How sharper than a hound's tooth it is to have a thankless 
+serpent.
+%%
+How wonderful opera would be if there were no singers.
+%%
+How you look depends on where you go.
+%%
+Humility is the first of the virtues -- for other people. 
+-- Oliver W. Holmes
+%%
+I GOTTA GET OUTTA HERE!
+%%
+I am not arguing with you -- I am telling you.
+%%
+I came to MIT to get an education for myself and a diploma 
+for my mother.
+%%
+I hate quotations. -- Ralph Waldo Emerson
+%%
+I have decked my bed with coverings of tapestry, with 
+carved works, with fine linen of Egypt.
+%%
+I have perfumed my bed with myrrh, aloes, and cinnamon.
+%%
+I have taught thee in the way of wisdom; I have led thee in 
+right paths.
+%%
+I lead in the way of righteousness, in the midst of the 
+paths of judgment: That I may cause those that love me to 
+inherit substance; and I will fill their treasures.
+%%
+I like work; it fascinates me; I can sit and look at it for 
+hours.
+%%
+I love them that love me; and those that seek me early 
+shall find me.
+%%
+I must have slipped a disk; my pack hurts.
+%%
+I neither learned wisdom, nor have the knowledge of the 
+holy.
+%%
+I think we're all Bozos on this bus.
+%%
+I was set up from everlasting, from the beginning, or ever 
+the earth was.
+%%
+I went by the field of the slothful, and by the vineyard of 
+the man void of understanding; And, lo, it was all grown 
+over with thorns, and nettles had covered the face thereof, 
+and the stone wall thereof was broken down.
+%%
+I will never lie to you.
+%%
+I wisdom dwell with prudence, and find out knowledge of 
+witty inventions.
+%%
+I wish you humans would leave me alone.
+%%
+I'm a Hollywood writer; so I put on a sports jacket and 
+take off my brain.
+%%
+I'm not sure how to fly this thing, but I'll give it that 
+old college try!
+%%
+I've done so much with so little for so long that I can do 
+anything with nothing.
+%%
+IKM006 4050303293 CHECK/NOCHECK PREFIX NOT PERMITTED IN 
+THIS CONTEXT.
+%%
+IOT trap -- core dumped
+%%
+IOT trap -- mos dumped
+%%
+If God had wanted you to go around nude, He would have 
+given you bigger hands.
+%%
+If a group of N persons implements a COBOL compiler, there 
+will be N-1 passes: Someone in the group has to be the 
+manager.
+%%
+If a listener nods his head when you are explaining your 
+program, wake him up.
+%%
+If a program manipulates large amounts of data, it does so 
+in a small number of ways.
+%%
+If a ruler hearken to lies, all his servants are wicked.
+%%
+If a wise man contendeth with a foolish man, whether he 
+rage or laugh, there is no rest.
+%%
+If at first you don't succeed, get new batteries.
+%%
+If at first you don't succeed, quit; don't be a nut about 
+success.
+%%
+If at first you don't succeed, try, try again.
+%%
+If it doesn't feel good, don't do it.
+%%
+If the auto industry had done what the computer industry 
+has done in the past 30 years, a Rolls Royce would cost $2.50 
+and would get 2,000,000 miles per gallon.
+%%
+If the path be beautiful, let us not ask where it leads. -- 
+Anatole France
+%%
+If they say, Come with us, let us lay wait for blood, let 
+us lurk privily for the innocent without cause: Let us 
+swallow them up alive as the grave; and whole, as those that go 
+down into the pit: We shall find all precious substance, we 
+shall fill our houses with spoil: Cast in thy lot among 
+us; let us all have one purse: My son, walk not thou in the 
+way with them; refrain thy foot from their path: For their 
+feet run to evil, and make haste to shed blood.
+%%
+If thine enemy be hungry, give him bread to eat; and if he 
+be thirsty, give him water to drink: For thou shalt heap 
+coals of fire upon his head, and the LORD shall reward thee.
+%%
+If thou be wise, thou shalt be wise for thyself: but if 
+thou scornest, thou alone shalt bear it.
+%%
+If thou faint in the day of adversity, thy strength is 
+small.
+%%
+If thou forbear to deliver them that are drawn unto death, 
+and those that are ready to be slain; If thou sayest, 
+Behold, we knew it not; doth not he that pondereth the heart 
+consider it? and he that keepeth thy soul, doth not he know 
+it? and shall not he render to every man according to his 
+works? My son, eat thou honey, because it is good; and the 
+honeycomb, which is sweet to thy taste: So shall the knowledge 
+of wisdom be unto thy soul: when thou hast found it, then 
+there shall be a reward, and thy expectation shall not be cut off.
+%%
+If thou hast done foolishly in lifting up thyself, or if 
+thou hast thought evil, lay thine hand upon thy mouth.
+%%
+If thou hast nothing to pay, why should he take away thy 
+bed from under thee? Remove not the ancient landmark, which 
+thy fathers have set.
+%%
+If we knew where we were going to fall, we could have 
+spread a carpet there. -- Russian proverb
+%%
+If you are a rooster, crow; if you are a hen, shut up and 
+lay eggs. -- Russian proverb
+%%
+If you are tired of a friend, lend him money. -- Russian 
+proverb
+%%
+If you ask how much it is, you can't afford it.
+%%
+If you pick up a starving dog and make him prosperous, he 
+will not bite you.  This is the principal difference between 
+a dog and a man. -- Mark Twain
+%%
+If you suspect a man, don't employ him.
+%%
+If you think before you speak the other guy gets his joke 
+in first.
+%%
+If you tickle yourself, you can laugh when you please. -- 
+Russian proverb
+%%
+If you want a fortune, go to a Chinese restaurant.
+%%
+If you want to know how old a man is, ask his 
+brother-in-law.
+%%
+Ignorance is a lack of knowledge.  Stupidity is ignorance 
+with pride.
+%%
+Ignorance is bliss. -- Thomas Gray
+%%
+Ignorance is when you don't know anything and somebody 
+finds it out.
+%%
+Ignore previous fortune.
+%%
+In all labour there is profit: but the talk of the lips 
+tendeth only to penury.
+%%
+In all thy ways acknowledge him, and he shall direct thy 
+paths.
+%%
+In marriage, as in war, it is permitted to take every 
+advantage of the enemy.
+%%
+In the fear of the LORD is strong confidence: and his 
+children shall have a place of refuge.
+%%
+In the first place, God made idiots; this was for practice; 
+then He made school boards. -- Mark Twain
+%%
+In the house of the righteous is much treasure: but in the 
+revenues of the wicked is trouble.
+%%
+In the light of the king's countenance is life; and his 
+favour is as a cloud of the latter rain.
+%%
+In the lips of him that hath understanding wisdom is found: 
+but a rod is for the back of him that is void of 
+understanding.
+%%
+In the mouth of the foolish is a rod of pride: but the lips 
+of the wise shall preserve them.
+%%
+In the multitude of people is the king's honour: but in the 
+want of people is the destruction of the prince.
+%%
+In the multitude of words there wanteth not sin: but he 
+that refraineth his lips is wise.
+%%
+In the transgression of an evil man there is a snare: but 
+the righteous doth sing and rejoice.
+%%
+In the way of righteousness is life: and in the pathway 
+thereof there is no death.
+%%
+In this world, not everyone with a long knife is a cook. -- 
+Russian proverb
+%%
+In this world, truth can wait; she's used to it.
+%%
+In unanimity there is cowardice and uncritical thinking.
+%%
+In wickedness there is a strong strain toward rationality.
+%%
+Institute: An archaic school where football in not taught.
+%%
+Integrity has no need for rules.
+%%
+Iron sharpeneth iron; so a man sharpeneth the countenance 
+of his friend.
+%%
+Is this really happening?
+%%
+It is a bad plan that admits of no modification. -- 
+Publilius Syrus
+%%
+It is a poor judge who cannot award a prize.
+%%
+It is an abomination to kings to commit wickedness: for the 
+throne is established by righteousness.
+%%
+It is an honour for a man to cease from strife: but every 
+fool will be meddling.
+%%
+It is as sport to a fool to do mischief: but a man of 
+understanding hath wisdom.
+%%
+It is better to die on your feet than to live on your 
+knees.
+%%
+It is better to dwell in a corner of the housetop, than 
+with a brawling woman in a wide house.
+%%
+It is better to dwell in the corner of the housetop, than 
+with a brawling woman and in a wide house.
+%%
+It is better to dwell in the wilderness, than with a 
+contentious and an angry woman.
+%%
+It is better to have loved and lost -- much better.
+%%
+It is better to have loved and lost than just to have lost.
+%%
+It is better to wear out than to rust out.
+%%
+It is easier to change the specification to fit the program 
+than vice versa.
+%%
+It is easier to fight for one's principles than to live up 
+to them.
+%%
+It is easier to run down a hill than up one.
+%%
+It is easier to write an incorrect program than to 
+understand a correct one.
+%%
+It is joy to the just to do judgment: but destruction shall 
+be to the workers of iniquity.
+%%
+It is naught, it is naught, saith the buyer: but when he is 
+gone his way, then he boasteth.
+%%
+It is not for kings, O Lemuel, it is not for kings to drink 
+wine; nor for princes strong drink: Lest they drink, and 
+forget the law, and pervert the judgment of any of the 
+afflicted.
+%%
+It is not good to accept the person of the wicked, to 
+overthrow the righteous in judgment.
+%%
+It is not good to eat much honey: so for men to search 
+their own glory is not glory.
+%%
+It is one thing to praise discipline, and another to submit 
+to it.
+%%
+It is the glory of God to conceal a thing: but the honour 
+of kings is to search out a matter.
+%%
+It is the wise bird who builds his nest in a tree.
+%%
+It seems to make an auto driver mad if he misses you.
+%%
+It shall be health to thy navel, and marrow to thy bones.
+%%
+It was a book to kill time for those who liked it better 
+dead.
+%%
+It's a good thing we don't get all the government we pay 
+for.
+%%
+It's a poor workman who blames his tools.
+%%
+It's all in the mind, ya know.
+%%
+It's better to burn out than to fade away.
+%%
+It's later than you think.
+%%
+It's not reality that's important, but how you perceive 
+things.
+%%
+It's not whether you win or lose, but how you play the 
+game. -- Grantland Rice
+%%
+It's pretty hard to tell what does bring happiness; poverty 
+and wealth have both failed.
+%%
+Journalism will kill you, but it will keep you alive while 
+you're at it.
+%%
+Judgments are prepared for scorners, and stripes for the 
+back of fools.
+%%
+Just because the bells are ringing, it is not necessarily 
+dinner time. -- Russian proverb
+%%
+Keep my commandments, and live; and my law as the apple of 
+thine eye.
+%%
+Keep thy heart with all diligence; for out of it are the 
+issues of life.
+%%
+Kiss your keyboard good-bye!
+%%
+LISP: To call a spade a thpade.
+%%
+Labour not to be rich: cease from thine own wisdom.
+%%
+Large numbers of things are determined, and therefore not 
+subject to change.
+%%
+Last guys don't finish nice.
+%%
+Laugh, and the world ignores you.  Crying doesn't help 
+either.
+%%
+Lay not wait, O wicked man, against the dwelling of the 
+righteous; spoil not his resting place: For a just man falleth 
+seven times, and riseth up again: but the wicked shall 
+fall into mischief.
+%%
+Learn good things -- the bad ones will teach you by 
+themselves. -- Russian proverb
+%%
+Learned men are the cisterns of knowledge, not the 
+fountainheads.
+%%
+Lend money to a bad debtor and he will hate you.
+%%
+Length of days is in her right hand; and in her left hand 
+riches and honour.
+%%
+Lest thou shouldest ponder the path of life, her ways are 
+moveable, that thou canst not know them.
+%%
+Let a bear robbed of her whelps meet a man, rather than a 
+fool in his folly.
+%%
+Let a fool hold his tongue and he will pass for a sage.
+%%
+Let another man praise thee, and not thine own mouth; a 
+stranger, and not thine own lips.
+%%
+Let her be as the loving hind and pleasant roe; let her 
+breasts satisfy thee at all times; and be thou ravished always 
+with her love.
+%%
+Let him drink, and forget his poverty, and remember his 
+misery no more.
+%%
+Let him who takes the Plunge remember to return it by 
+Tuesday.
+%%
+Let not mercy and truth forsake thee: bind them about thy 
+neck; write them upon the table of thine heart: So shalt 
+thou find favour and good understanding in the sight of God 
+and man.
+%%
+Let not the sands of time get in your lunch.
+%%
+Let not thine heart decline to her ways, go not astray in 
+her paths.
+%%
+Let not thine heart envy sinners: but be thou in the fear 
+of the LORD all the day long.
+%%
+Let sleeping dogs lie. -- Charles Dickens
+%%
+Let the machine do the dirty work.
+%%
+Let them be only thine own, and not strangers' with thee.
+%%
+Let them not depart from thine eyes; keep them in the midst 
+of thine heart.
+%%
+Let thine eyes look right on, and let thine eyelids look 
+straight before thee.
+%%
+Let thy fountain be blessed: and rejoice with the wife of 
+thy youth.
+%%
+Let thy fountains be dispersed abroad, and rivers of waters 
+in the streets.
+%%
+Let your conscience be your guide. -- Alexander Pope
+%%
+Liar: One who tells an unpleasant truth.
+%%
+Life as we know it doesn't exist.
+%%
+Life is a game of bridge -- and you've just been finessed.
+%%
+Life is full of little surprises, and you are one of them.
+%%
+Life is like a sewer, what you get out of it depends on 
+what you put into it.
+%%
+Life is like an analogy.
+%%
+Life is unbearable, but death is not so pleasant either. -- 
+Russian proverb
+%%
+Like punning, programming is a play on words.
+%%
+Like winter snow on summer lawn, time past is time gone.
+%%
+Live a clean, healthy life and you will soon die of 
+boredom.
+%%
+Live a hundred years, learn a hundred years, and you'll 
+still die a fool. -- Russian proverb
+%%
+Live and scratch -- when you're dead, the itching will 
+stop. -- Russian proverb
+%%
+Logic is a little bird, sitting in a tree, that smells 
+AWFUL.
+%%
+Long computations that yield zero are probably all for 
+naught.
+%%
+Long life is in store for you.
+%%
+Look before you leap. -- Samuel Butler
+%%
+Look not thou upon the wine when it is red, when it giveth 
+his colour in the cup, when it moveth itself aright.
+%%
+Losing your driver's license is just God's way of saying 
+"BOOGA, BOOGA!"
+%%
+Love and scandal are the best sweeteners of tea.
+%%
+Love conquers all things. -- Virgil
+%%
+Love is in the offing, said the homicidal maniac.
+%%
+Love is in the offing.  Be affectionate to one who adores 
+you.
+%%
+Love is the triumph of imagination over intelligence.
+%%
+Love not sleep, lest thou come to poverty; open thine eyes, 
+and thou shalt be satisfied with bread.
+%%
+Love the sea?  I dote upon it -- from the beach.
+%%
+Lust not after her beauty in thine heart; neither let her 
+take thee with her eyelids.
+%%
+Lying lips are abomination to the LORD: but they that deal 
+truly are his delight.
+%%
+Make input easy to proofread.
+%%
+Make it right before you make it faster.
+%%
+Make no friendship with an angry man; and with a furious 
+man thou shalt not go: Lest thou learn his ways, and get a 
+snare to thy soul.
+%%
+Make sure all variables are initialized before use.
+%%
+Make sure comments and code agree.
+%%
+Make sure your code "does nothing" gracefully.
+%%
+Make yourself into a sheep, and you'll meet a wolf nearby. 
+-- Russian proverb
+%%
+Man alone suffers so excruciatingly in the world that he 
+was compelled to invent laughter.
+%%
+Man who falls in blast furnace is certain to feel 
+overwrought.
+%%
+Man who falls in vat of molten optical glass makes 
+spectacle of self.
+%%
+Man's goings are of the LORD; how can a man then understand 
+his own way? It is a snare to the man who devoureth that 
+which is holy, and after vows to make enquiry.
+%%
+Man's horizons are bounded by his vision.
+%%
+Many are called, few are chosen.  Fewer still get to do the 
+choosing.
+%%
+Many are called, few volunteer.
+%%
+Many are cold, but few are frozen.
+%%
+Many daughters have done virtuously, but thou excellest 
+them all.
+%%
+Many pages make a thick book.
+%%
+Many receive advice, few profit from it.
+%%
+Many seek the ruler's favour; but every man's judgment 
+cometh from the LORD.
+%%
+Many will intreat the favour of the prince: and every man 
+is a friend to him that giveth gifts.
+%%
+Marriage -- a three ring circus: engagement ring, wedding 
+ring, and suffering.
+%%
+Marriage is like sneezing: even when you feel it coming on, 
+you can't stop. -- Russian proverb
+%%
+Mathematics deals exclusively with the relations of 
+concepts to each other without consideration of their relation to 
+experience. -- Albert Einstein
+%%
+Memory should be the starting point of the present.
+%%
+Men do not despise a thief, if he steal to satisfy his soul 
+when he is hungry; But if he be found, he shall restore 
+sevenfold; he shall give all the substance of his house.
+%%
+Men have a much better time of it than women; for one 
+thing, they marry later; for another thing, they die earlier.
+%%
+Men love to wonder, and that is the seed of science.
+%%
+Men use thought only to justify their wrong doings, and 
+speech only to conceal their thoughts.
+%%
+Mercy and truth preserve the king: and his throne is 
+upholden by mercy.
+%%
+Might as well be frank, Monsieur.  It would take a miracle 
+to get you out of Casablanca.
+%%
+Mind your own business, Spock.  I'm sick of your half-breed 
+interference.
+%%
+Mistakes are oft the stepping stones to failure.
+%%
+Moderation is a fatal thing.  Nothing succeeds like excess.
+%%
+Modesty is a vastly overrated virtue.
+%%
+Money may buy friendship but money can not buy love.
+%%
+Money will say more in one moment than the most eloquent 
+lover can in years.
+%%
+Most men will proclaim every one his own goodness: but a 
+faithful man who can find? The just man walketh in his 
+integrity: his children are blessed after him.
+%%
+Most people eat as though they were fattening themselves 
+for market.
+%%
+Most people find the concept of programming obvious, but 
+the doing impossible.
+%%
+Much food is in the tillage of the poor: but there is that 
+is destroyed for want of judgment.
+%%
+My fruit is better than gold, yea, than fine gold; and my 
+revenue than choice silver.
+%%
+My opponent's best move is my best move.
+%%
+My son, attend to my words; incline thine ear unto my 
+sayings.
+%%
+My son, attend unto my wisdom, and bow thine ear to my 
+understanding: That thou mayest regard discretion, and that thy 
+lips may keep knowledge.
+%%
+My son, be wise, and make my heart glad, that I may answer 
+him that reproacheth me.
+%%
+My son, despise not the chastening of the LORD; neither be 
+weary of his correction: For whom the LORD loveth he 
+correcteth; even as a father the son in whom he delighteth.
+%%
+My son, fear thou the LORD and the king: and meddle not 
+with them that are given to change: For their calamity shall 
+rise suddenly; and who knoweth the ruin of them both? These 
+things also belong to the wise. It is not good to have 
+respect of persons in judgment.
+%%
+My son, forget not my law; but let thine heart keep my 
+commandments: For length of days, and long life, and peace, 
+shall they add to thee.
+%%
+My son, give me thine heart, and let thine eyes observe my 
+ways.
+%%
+My son, hear the instruction of thy father, and forsake not 
+the law of thy mother: For they shall be an ornament of 
+grace unto thy head, and chains about thy neck.
+%%
+My son, if sinners entice thee, consent thou not.
+%%
+My son, if thine heart be wise, my heart shall rejoice, 
+even mine.
+%%
+My son, if thou be surety for thy friend, if thou hast 
+stricken thy hand with a stranger, Thou art snared with the 
+words of thy mouth, thou art taken with the words of thy mouth.
+%%
+My son, if thou wilt receive my words, and hide my 
+commandments with thee; So that thou incline thine ear unto wisdom, 
+and apply thine heart to understanding; Yea, if thou 
+criest after knowledge, and liftest up thy voice for 
+understanding; If thou seekest her as silver, and searchest for her as 
+for hid treasures; Then shalt thou understand the fear of 
+the LORD, and find the knowledge of God.
+%%
+My son, keep my words, and lay up my commandments with 
+thee.
+%%
+My son, keep thy father's commandment, and forsake not the 
+law of thy mother: Bind them continually upon thine heart, 
+and tie them about thy neck.
+%%
+My son, let not them depart from thine eyes: keep sound 
+wisdom and discretion: So shall they be life unto thy soul, 
+and grace to thy neck.
+%%
+National security is in your hands -- guard it well.
+%%
+Nature teaches beasts to know their friends.
+%%
+Never give an inch!
+%%
+Never insult an alligator until you have crossed the river.
+%%
+Never look a gift horse in the mouth. -- Saint Jerome
+%%
+Never settle with words what you can accomplish with a 
+flame thrower.
+%%
+Never try to teach a pig to sing: it wastes your time and 
+annoys the pig.
+%%
+Nice guys finish last. -- Leo Durocher
+%%
+No amount of genius can overcome a preoccupation with 
+detail.
+%%
+No civilized person ever goes to bed the same day he gets 
+up.
+%%
+No directory.
+%%
+No evil can happen to a good man. -- Plato
+%%
+No one can feel as helpless as the owner of a sick 
+goldfish.
+%%
+No problem is insoluble in all conceivable circumstances.
+%%
+No use beating a dead horse.
+%%
+Noblemen make promises, but peasants have to keep them. -- 
+Russian proverb
+%%
+Nobody can be as agreeable as an uninvited guest.
+%%
+Nobody expects the Spanish Inquisition!
+%%
+None that go unto her return again, neither take they hold 
+of the paths of life.
+%%
+Nothing astonishes men so much as common sense and plain 
+dealing.
+%%
+Nothing endures like change. -- Heraclitus
+%%
+Nothing in life is to be feared.  It is only to be 
+understood.
+%%
+Nothing so needs reforming as other people's habits.
+%%
+Nothing ventured, nothing gained.
+%%
+Nothing will dispel enthusiasm like a small admission fee.
+%%
+Now and then an innocent man is sent to the Legislature.
+%%
+Now therefore hearken unto me, O ye children: for blessed 
+are they that keep my ways.
+%%
+O ye simple, understand wisdom: and, ye fools, be ye of an 
+understanding heart.
+%%
+O'Toole's dictum: "Murphy was an optimist."
+%%
+Observation, not old age, brings wisdom.
+%%
+Of all forms of caution, caution in love is the most fatal.
+%%
+Oh, Aunty Em, it's so good to be home!
+%%
+Oh, what a tangled web we weave when first we practice to 
+conceive.
+%%
+Ointment and perfume rejoice the heart: so doth the 
+sweetness of a man's friend by hearty counsel.
+%%
+Old MacDonald had an agricultural real estate tax 
+abatement.
+%%
+Old soldiers never die.  Young ones do.
+%%
+Once the word is out of your mouth, you can't swallow it 
+back. -- Russian proverb
+%%
+Once you understand how to write a program, get someone 
+else to write it.
+%%
+One Bell System -- it sometimes works.
+%%
+One Bell System -- it works.
+%%
+One man tells a falsehood, a hundred repeat it as true.
+%%
+One man's constant is another man's variable.
+%%
+Only by pride cometh contention: but with the well advised 
+is wisdom.
+%%
+Only presidents, editors, and people with tapeworms have 
+the right to use the editorial "we."
+%%
+Only those who attempt the absurd achieve the impossible.
+%%
+Open thy mouth for the dumb in the cause of all such as are 
+appointed to destruction.
+%%
+Open thy mouth, judge righteously, and plead the cause of 
+the poor and needy.
+%%
+Opportunity knocks but once.
+%%
+Optimization hinders evolution.
+%%
+Out of sight is out of mind.
+%%
+Paranoia doesn't mean the whole world really isn't out to 
+get you.
+%%
+Password:
+%%
+Passwords are implemented as a result of insecurity.
+%%
+People have declaimed against luxury for 2,000 years ... 
+and people have always delighted in it.
+%%
+People who take cat naps don't usually sleep in a cat's 
+cradle.
+%%
+People will buy anything that's one to a customer.
+%%
+Philosophy: Unintelligible answers to insoluble problems.
+%%
+Pleasant words are as an honeycomb, sweet to the soul, and 
+health to the bones.
+%%
+Please go away.
+%%
+Please update your programs.
+%%
+Ponder the path of thy feet, and let all thy ways be 
+established.
+%%
+Poverty and shame shall be to him that refuseth 
+instruction: but he that regardeth reproof shall be honoured.
+%%
+Power is poison.
+%%
+Pray to God, but keep rowing to shore. -- Russian proverb
+%%
+Prepare thy work without, and make it fit for thyself in 
+the field; and afterwards build thine house.
+%%
+Pride goeth before destruction, and an haughty spirit 
+before a fall.
+%%
+Promptness is its own reward, if one lives by the clock 
+instead of the sword.
+%%
+Proud and haughty scorner is his name, who dealeth in proud 
+wrath.
+%%
+Put away from thee a froward mouth, and perverse lips put 
+far from thee.
+%%
+Put not forth thyself in the presence of the king, and 
+stand not in the place of great men: For better it is that it 
+be said unto thee, Come up hither; than that thou shouldest 
+be put lower in the presence of the prince whom thine eyes 
+have seen.
+%%
+Put not your trust in money, but put your money in trust.
+%%
+Quack!
+%%
+Quantity is no substitute for quality, but it's the only 
+one we've got.
+%%
+Quit work and play for once!
+%%
+Rainy days and Mondays always get me down.
+%%
+Reading is thinking with someone else's head instead of 
+one's own.
+%%
+Reality is for people who can't handle drugs.
+%%
+Receive my instruction, and not silver; and knowledge 
+rather than choice gold.
+%%
+Recursion is the root of computation since it trades 
+description for time.
+%%
+Rejoice not when thine enemy falleth, and let not thine 
+heart be glad when he stumbleth: Lest the LORD see it, and it 
+displease him, and he turn away his wrath from him.
+%%
+Religions revolve madly around sexual questions.
+%%
+Remove not the old landmark; and enter not into the fields 
+of the fatherless: For their redeemer is mighty; he shall 
+plead their cause with thee.
+%%
+Remove thy way far from her, and come not nigh the door of 
+her house: Lest thou give thine honour unto others, and thy 
+years unto the cruel: Lest strangers be filled with thy 
+wealth; and thy labours be in the house of a stranger; And 
+thou mourn at the last, when thy flesh and thy body are 
+consumed, And say, How have I hated instruction, and my heart 
+despised reproof; And have not obeyed the voice of my 
+teachers, nor inclined mine ear to them that instructed me! I was 
+almost in all evil in the midst of the congregation and assembly.
+%%
+Replace repetitive expressions by calls to a common 
+function.
+%%
+Reprove not a scorner, lest he hate thee: rebuke a wise 
+man, and he will love thee.
+%%
+Riches and honour are with me; yea, durable riches and 
+righteousness.
+%%
+Riches profit not in the day of wrath: but righteousness 
+delivereth from death.
+%%
+Righteous lips are the delight of kings; and they love him 
+that speaketh right.
+%%
+Righteousness exalteth a nation: but sin is a reproach to 
+any people.
+%%
+Righteousness keepeth him that is upright in the way: but 
+wickedness overthroweth the sinner.
+%%
+Rotten wood can not be carved. -- Confucius
+%%
+Satire does not look pretty upon a tombstone.
+%%
+Save yourself!  Reboot in 5 seconds!
+%%
+Say not thou, I will recompense evil; but wait on the LORD, 
+and he shall save thee.
+%%
+Say not unto thy neighbour, Go, and come again, and to 
+morrow I will give; when thou hast it by thee.
+%%
+Say not, I will do so to him as he hath done to me: I will 
+render to the man according to his work.
+%%
+Say unto wisdom, Thou art my sister; and call understanding 
+thy kinswoman: That they may keep thee from the strange 
+woman, from the stranger which flattereth with her words.
+%%
+Scornful men bring a city into a snare: but wise men turn 
+away wrath.
+%%
+Security is the individual's responsibility.
+%%
+Security is your responsibility.
+%%
+Seest thou a man diligent in his business? he shall stand 
+before kings; he shall not stand before mean men.
+%%
+Seest thou a man that is hasty in his words? there is more 
+hope of a fool than of him.
+%%
+Seest thou a man wise in his own conceit? there is more 
+hope of a fool than of him.
+%%
+She also lieth in wait as for a prey, and increaseth the 
+transgressors among men.
+%%
+She considereth a field, and buyeth it: with the fruit of 
+her hands she planteth a vineyard.
+%%
+She crieth at the gates, at the entry of the city, at the 
+coming in at the doors.
+%%
+She girdeth her loins with strength, and strengtheneth her 
+arms.
+%%
+She hath sent forth her maidens: she crieth upon the 
+highest places of the city, Whoso is simple, let him turn in 
+hither: as for him that wanteth understanding, she saith to 
+him, Come, eat of my bread, and drink of the wine which I have 
+mingled.
+%%
+She is a tree of life to them that lay hold upon her: and 
+happy is every one that retaineth her.
+%%
+She is like the merchants' ships; she bringeth her food 
+from afar.
+%%
+She is more precious than rubies: and all the things thou 
+canst desire are not to be compared unto her.
+%%
+She is not afraid of the snow for her household: for all 
+her household are clothed with scarlet.
+%%
+She layeth her hands to the spindle, and her hands hold the 
+distaff.
+%%
+She looketh well to the ways of her household, and eateth 
+not the bread of idleness.
+%%
+She maketh fine linen, and selleth it; and delivereth 
+girdles unto the merchant.
+%%
+She maketh herself coverings of tapestry; her clothing is 
+silk and purple.
+%%
+She openeth her mouth with wisdom; and in her tongue is the 
+law of kindness.
+%%
+She perceiveth that her merchandise is good: her candle 
+goeth not out by night.
+%%
+She riseth also while it is yet night, and giveth meat to 
+her household, and a portion to her maidens.
+%%
+She seeketh wool, and flax, and worketh willingly with her 
+hands.
+%%
+She shall give to thine head an ornament of grace: a crown 
+of glory shall she deliver to thee.
+%%
+She stretcheth out her hand to the poor; yea, she reacheth 
+forth her hands to the needy.
+%%
+She will do him good and not evil all the days of her life.
+%%
+Simplicity does not precede complexity, but follows it.
+%%
+Sin has many tools, but a lie is the handle that fits them 
+all.
+%%
+Slang is language that takes off its coat, spits on its 
+hands, and goes to work.
+%%
+Slothfulness casteth into a deep sleep; and an idle soul 
+shall suffer hunger.
+%%
+Smile, it makes the world wonder what you are up to.
+%%
+Smite a scorner, and the simple will beware: and reprove 
+one that hath understanding, and he will understand knowledge.
+%%
+Snow Day -- stay home.
+%%
+So are the ways of every one that is greedy of gain; which 
+taketh away the life of the owners thereof.
+%%
+Soap and education are not as sudden as a massacre, but 
+they are more deadly in the long run.
+%%
+Some men are discovered; others are found out.
+%%
+Some programming languages manage to absorb change but 
+withstand progress.
+%%
+Someone is unenthusiastic about your work.
+%%
+Sooner will men hold fire in their mouths than keep a 
+secret.
+%%
+Speak not in the ears of a fool: for he will despise the 
+wisdom of thy words.
+%%
+Stability itself is nothing else than a more sluggish 
+motion.
+%%
+Standing on head makes smile of frown, but rest of face 
+also upside down.
+%%
+Stop searching forever: happiness is just next to you.
+%%
+Stop searching forever: happiness is unattainable.
+%%
+Strength and honour are her clothing; and she shall rejoice 
+in time to come.
+%%
+Strive not with a man without cause, if he have done thee 
+no harm.
+%%
+Sturgeon's Law: Ninety percent of everything is crud.
+%%
+Success is a journey, not a destination.
+%%
+Such is the way of an adulterous woman; she eateth, and 
+wipeth her mouth, and saith, I have done no wickedness.
+%%
+Surely he scorneth the scorners: but he giveth grace unto 
+the lowly.
+%%
+Surely in vain the net is spread in the sight of any bird.
+%%
+Surely the churning of milk bringeth forth butter, and the 
+wringing of the nose bringeth forth blood: so the forcing 
+of wrath bringeth forth strife.
+%%
+System going down at 1:45 this afternoon for disk crashing.
+%%
+System going down indefinitely, please log off!
+%%
+Tact is the art of making a point without making an enemy.
+%%
+Take away the dross from the silver, and there shall come 
+forth a vessel for the finer.
+%%
+Take away the wicked from before the king, and his throne 
+shall be established in righteousness.
+%%
+Take care of the luxuries and the necessities will take 
+care of themselves.
+%%
+Take fast hold of instruction; let her not go: keep her; 
+for she is thy life.
+%%
+Take his garment that is surety for a stranger, and take a 
+pledge of him for a strange woman.
+%%
+Take his garment that is surety for a stranger: and take a 
+pledge of him for a strange woman.
+%%
+That must be wonderful!  I don't understand it at all.
+%%
+That thou mayest walk in the way of good men, and keep the 
+paths of the righteous.
+%%
+That thy trust may be in the LORD, I have made known to 
+thee this day, even to thee.
+%%
+That which is not good for the swarm, neither is it good 
+for the bee.
+%%
+The LORD by wisdom hath founded the earth; by understanding 
+hath he established the heavens.
+%%
+The LORD hath made all things for himself: yea, even the 
+wicked for the day of evil.
+%%
+The LORD is far from the wicked: but he heareth the prayer 
+of the righteous.
+%%
+The LORD possessed me in the beginning of his way, before 
+his works of old.
+%%
+The LORD will destroy the house of the proud: but he will 
+establish the border of the widow.
+%%
+The LORD will not suffer the soul of the righteous to 
+famish: but he casteth away the substance of the wicked.
+%%
+The Tree of Learning bears the noblest fruit, but noble 
+fruit tastes bad.
+%%
+The attacker must vanquish; the defender need only survive.
+%%
+The backslider in heart shall be filled with his own ways: 
+and a good man shall be satisfied from himself.
+%%
+The beginning of strife is as when one letteth out water: 
+therefore leave off contention, before it be meddled with.
+%%
+The best prophet of the future is the past.
+%%
+The blessing of the LORD, it maketh rich, and he addeth no 
+sorrow with it.
+%%
+The bloodthirsty hate the upright: but the just seek his 
+soul.
+%%
+The blueness of a wound cleanseth away evil: so do stripes 
+the inward parts of the belly.
+%%
+The cow may be black, but the milk comes out white. -- 
+Russian proverb
+%%
+The crown of the wise is their riches: but the foolishness 
+of fools is folly.
+%%
+The curse of the LORD is in the house of the wicked: but he 
+blesseth the habitation of the just.
+%%
+The decision doesn't have to be logical, it was unanimous.
+%%
+The degree of civilization in a society can be judged by 
+entering its prisons.
+%%
+The desire accomplished is sweet to the soul: but it is 
+abomination to fools to depart from evil.
+%%
+The desire of a man is his kindness: and a poor man is 
+better than a liar.
+%%
+The desire of the righteous is only good: but the 
+expectation of the wicked is wrath.
+%%
+The desire of the slothful killeth him; for his hands 
+refuse to labour.
+%%
+The discretion of a man deferreth his anger; and it is his 
+glory to pass over a transgression.
+%%
+The door is the key.
+%%
+The ear that heareth the reproof of life abideth among the 
+wise.
+%%
+The early worm gets the bird.
+%%
+The end of labor is to gain leisure.
+%%
+The ends justify the means.
+%%
+The evil bow before the good; and the wicked at the gates 
+of the righteous.
+%%
+The eye that mocketh at his father, and despiseth to obey 
+his mother, the ravens of the valley shall pick it out, and 
+the young eagles shall eat it.
+%%
+The eyes of the LORD are in every place, beholding the evil 
+and the good.
+%%
+The eyes of the LORD preserve knowledge, and he 
+overthroweth the words of the transgressor.
+%%
+The famous politician was trying to save both his faces.
+%%
+The father of the righteous shall greatly rejoice: and he 
+that begetteth a wise child shall have joy of him.
+%%
+The fear of a king is as the roaring of a lion: whoso 
+provoketh him to anger sinneth against his own soul.
+%%
+The fear of man bringeth a snare: but whoso putteth his 
+trust in the LORD shall be safe.
+%%
+The fear of the LORD is a fountain of life, to depart from 
+the snares of death.
+%%
+The fear of the LORD is the beginning of knowledge: but 
+fools despise wisdom and instruction.
+%%
+The fear of the LORD is the beginning of wisdom: and the 
+knowledge of the holy is understanding.
+%%
+The fear of the LORD is the instruction of wisdom; and 
+before honour is humility.
+%%
+The fear of the LORD is to hate evil: pride, and arrogancy, 
+and the evil way, and the froward mouth, do I hate.
+%%
+The fear of the LORD prolongeth days: but the years of the 
+wicked shall be shortened.
+%%
+The fear of the LORD tendeth to life: and he that hath it 
+shall abide satisfied; he shall not be visited with evil.
+%%
+The fear of the wicked, it shall come upon him: but the 
+desire of the righteous shall be granted.
+%%
+The finest eloquence is that which gets things done.
+%%
+The fining pot is for silver, and the furnace for gold: but 
+the LORD trieth the hearts.
+%%
+The following statement is not true:
+%%
+The foolishness of man perverteth his way: and his heart 
+fretteth against the LORD.
+%%
+The fruit of the righteous is a tree of life; and he that 
+winneth souls is wise.
+%%
+The full soul loatheth an honeycomb; but to the hungry soul 
+every bitter thing is sweet.
+%%
+The future is his who knows how to wait. -- Russian proverb
+%%
+The future isn't what it used to be.  It never was.
+%%
+The gentlemen looked one another over with microscopic 
+carelessness.
+%%
+The getting of treasures by a lying tongue is a vanity 
+tossed to and fro of them that seek death.
+%%
+The glory of young men is their strength: and the beauty of 
+old men is the grey head.
+%%
+The great God that formed all things both rewardeth the 
+fool, and rewardeth transgressors.
+%%
+The greatest of faults is to be conscious of none.
+%%
+The hand of the diligent shall bear rule: but the slothful 
+shall be under tribute.
+%%
+The hearing ear, and the seeing eye, the LORD hath made 
+even both of them.
+%%
+The heart knoweth his own bitterness; and a stranger doth 
+not intermeddle with his joy.
+%%
+The heart of her husband doth safely trust in her, so that 
+he shall have no need of spoil.
+%%
+The heart of him that hath understanding seeketh knowledge: 
+but the mouth of fools feedeth on foolishness.
+%%
+The heart of the righteous studieth to answer: but the 
+mouth of the wicked poureth out evil things.
+%%
+The heart of the wise teacheth his mouth, and addeth 
+learning to his lips.
+%%
+The heaven for height, and the earth for depth, and the 
+heart of kings is unsearchable.
+%%
+The hoary head is a crown of glory, if it be found in the 
+way of righteousness.
+%%
+The hope of the righteous shall be gladness: but the 
+expectation of the wicked shall perish.
+%%
+The horse is prepared against the day of battle: but safety 
+is of the LORD.
+%%
+The horseleach hath two daughters, crying, Give, give. 
+There are three things that are never satisfied, yea, four 
+things say not, It is enough: The grave; and the barren womb; 
+the earth that is not filled with water; and the fire that 
+saith not, It is enough.
+%%
+The house of the wicked shall be overthrown: but the 
+tabernacle of the upright shall flourish.
+%%
+The important thing is not to stop questioning.
+%%
+The integrity of the upright shall guide them: but the 
+perverseness of transgressors shall destroy them.
+%%
+The king by judgment establisheth the land: but he that 
+receiveth gifts overthroweth it.
+%%
+The king that faithfully judgeth the poor, his throne shall 
+be established for ever.
+%%
+The king's favour is toward a wise servant: but his wrath 
+is against him that causeth shame.
+%%
+The king's heart is in the hand of the LORD, as the rivers 
+of water: he turneth it whithersoever he will.
+%%
+The king's wrath is as the roaring of a lion; but his 
+favour is as dew upon the grass.
+%%
+The labour of the righteous tendeth to life: the fruit of 
+the wicked to sin.
+%%
+The lambs are for thy clothing, and the goats are the price 
+of the field.
+%%
+The law of the wise is a fountain of life, to depart from 
+the snares of death.
+%%
+The legs of the lame are not equal: so is a parable in the 
+mouth of fools.
+%%
+The liberal soul shall be made fat: and he that watereth 
+shall be watered also himself.
+%%
+The life that is unexamined is not worth living.
+%%
+The light of the eyes rejoiceth the heart: and a good 
+report maketh the bones fat.
+%%
+The light of the righteous rejoiceth: but the lamp of the 
+wicked shall be put out.
+%%
+The lip of truth shall be established for ever: but a lying 
+tongue is but for a moment.
+%%
+The lips of the righteous feed many: but fools die for want 
+of wisdom.
+%%
+The lips of the righteous know what is acceptable: but the 
+mouth of the wicked speaketh frowardness.
+%%
+The lips of the wise disperse knowledge: but the heart of 
+the foolish doeth not so.
+%%
+The lot causeth contentions to cease, and parteth between 
+the mighty.
+%%
+The lot is cast into the lap; but the whole disposing 
+thereof is of the LORD.
+%%
+The man that wandereth out of the way of understanding 
+shall remain in the congregation of the dead.
+%%
+The man who makes no mistakes does not usually make 
+anything.
+%%
+The memory of the just is blessed: but the name of the 
+wicked shall rot.
+%%
+The merciful man doeth good to his own soul: but he that is 
+cruel troubleth his own flesh.
+%%
+The more things change, the more they remain the same.
+%%
+The morsel which thou hast eaten shalt thou vomit up, and 
+lose thy sweet words.
+%%
+The mouth of a righteous man is a well of life: but 
+violence covereth the mouth of the wicked.
+%%
+The mouth of strange women is a deep pit: he that is 
+abhorred of the LORD shall fall therein.
+%%
+The mouth of the just bringeth forth wisdom: but the 
+froward tongue shall be cut out.
+%%
+The name of the LORD is a strong tower: the righteous 
+runneth into it, and is safe.
+%%
+The north wind driveth away rain: so doth an angry 
+countenance a backbiting tongue.
+%%
+The only difference between a rut and a grave is their 
+size.
+%%
+The only thing to do with good advice is pass it on.  It is 
+never any use to oneself.
+%%
+The only way to amuse some people is to slip and fall on an 
+icy pavement.
+%%
+The plural of spouse is spice.
+%%
+The poor and the deceitful man meet together: the LORD 
+lighteneth both their eyes.
+%%
+The poor is hated even of his own neighbour: but the rich 
+hath many friends.
+%%
+The poor useth intreaties; but the rich answereth roughly.
+%%
+The preparations of the heart in man, and the answer of the 
+tongue, is from the LORD.
+%%
+The price of greatness is responsibility.
+%%
+The prince that wanteth understanding is also a great 
+oppressor: but he that hateth covetousness shall prolong his 
+days.
+%%
+The program is absolutely right; therefore the computer 
+must be wrong.
+%%
+The proverbs of Solomon the son of David, king of Israel; 
+To know wisdom and instruction; to perceive the words of 
+understanding; To receive the instruction of wisdom, justice, 
+and judgment, and equity; To give subtilty to the simple, 
+to the young man knowledge and discretion.
+%%
+The proverbs of Solomon. A wise son maketh a glad father: 
+but a foolish son is the heaviness of his mother.
+%%
+The ransom of a man's life are his riches: but the poor 
+heareth not rebuke.
+%%
+The rich and poor meet together: the LORD is the maker of 
+them all.
+%%
+The rich man is wise in his own conceit; but the poor that 
+hath understanding searcheth him out.
+%%
+The rich man's wealth is his strong city, and as an high 
+wall in his own conceit.
+%%
+The rich man's wealth is his strong city: the destruction 
+of the poor is their poverty.
+%%
+The rich ruleth over the poor, and the borrower is servant 
+to the lender.
+%%
+The righteous considereth the cause of the poor: but the 
+wicked regardeth not to know it.
+%%
+The righteous eateth to the satisfying of his soul: but the 
+belly of the wicked shall want.
+%%
+The righteous is delivered out of trouble, and the wicked 
+cometh in his stead.
+%%
+The righteous is more excellent than his neighbour: but the 
+way of the wicked seduceth them.
+%%
+The righteous man wisely considereth the house of the 
+wicked: but God overthroweth the wicked for their wickedness.
+%%
+The righteous shall never be removed: but the wicked shall 
+not inhabit the earth.
+%%
+The righteousness of the perfect shall direct his way: but 
+the wicked shall fall by his own wickedness.
+%%
+The righteousness of the upright shall deliver them: but 
+transgressors shall be taken in their own naughtiness.
+%%
+The road to ruin is always in good repair, and the 
+travelers pay the expense of it.
+%%
+The robbery of the wicked shall destroy them; because they 
+refuse to do judgment.
+%%
+The rod and reproof give wisdom: but a child left to 
+himself bringeth his mother to shame.
+%%
+The sacrifice of the wicked is abomination: how much more, 
+when he bringeth it with a wicked mind? A false witness 
+shall perish: but the man that heareth speaketh constantly.
+%%
+The sacrifice of the wicked is an abomination to the LORD: 
+but the prayer of the upright is his delight.
+%%
+The shortage will be divided among the poor. -- Russian 
+proverb
+%%
+The simple believeth every word: but the prudent man 
+looketh well to his going.
+%%
+The simple inherit folly: but the prudent are crowned with 
+knowledge.
+%%
+The slothful hideth his hand in his bosom; it grieveth him 
+to bring it again to his mouth.
+%%
+The slothful man roasteth not that which he took in 
+hunting: but the substance of a diligent man is precious.
+%%
+The slothful man saith, There is a lion in the way; a lion 
+is in the streets.
+%%
+The slothful man saith, There is a lion without, I shall be 
+slain in the streets.
+%%
+The slower you drive, the farther you get. -- Russian 
+proverb
+%%
+The sluggard is wiser in his own conceit than seven men 
+that can render a reason.
+%%
+The sluggard will not plow by reason of the cold; therefore 
+shall he beg in harvest, and have nothing.
+%%
+The soul of the sluggard desireth, and hath nothing: but 
+the soul of the diligent shall be made fat.
+%%
+The soul of the wicked desireth evil: his neighbour findeth 
+no favour in his eyes.
+%%
+The soul would have no rainbow had the eyes no tears.
+%%
+The spirit of a man will sustain his infirmity; but a 
+wounded spirit who can bear? The heart of the prudent getteth 
+knowledge; and the ear of the wise seeketh knowledge.
+%%
+The spirit of man is the candle of the LORD, searching all 
+the inward parts of the belly.
+%%
+The sun never sets on the British Empire because the 
+British are scared of the dark.
+%%
+The thought of foolishness is sin: and the scorner is an 
+abomination to men.
+%%
+The thoughts of the diligent tend only to plenteousness; 
+but of every one that is hasty only to want.
+%%
+The thoughts of the righteous are right: but the counsels 
+of the wicked are deceit.
+%%
+The thoughts of the wicked are an abomination to the LORD: 
+but the words of the pure are pleasant words.
+%%
+The time is right to make new friends.
+%%
+The tongue of the just is as choice silver: the heart of 
+the wicked is little worth.
+%%
+The tongue of the wise useth knowledge aright: but the 
+mouth of fools poureth out foolishness.
+%%
+The universe is laughing behind your back.
+%%
+The way of a fool is right in his own eyes: but he that 
+hearkeneth unto counsel is wise.
+%%
+The way of man is froward and strange: but as for the pure, 
+his work is right.
+%%
+The way of the LORD is strength to the upright: but 
+destruction shall be to the workers of iniquity.
+%%
+The way of the slothful man is as an hedge of thorns: but 
+the way of the righteous is made plain.
+%%
+The way of the wicked is an abomination unto the LORD: but 
+he loveth him that followeth after righteousness.
+%%
+The way of the wicked is as darkness: they know not at what 
+they stumble.
+%%
+The wicked are overthrown, and are not: but the house of 
+the righteous shall stand.
+%%
+The wicked desireth the net of evil men: but the root of 
+the righteous yieldeth fruit.
+%%
+The wicked flee when no man pursueth: but the righteous are 
+bold as a lion.
+%%
+The wicked is driven away in his wickedness: but the 
+righteous hath hope in his death.
+%%
+The wicked is snared by the transgression of his lips: but 
+the just shall come out of trouble.
+%%
+The wicked shall be a ransom for the righteous, and the 
+transgressor for the upright.
+%%
+The wicked worketh a deceitful work: but to him that soweth 
+righteousness shall be a sure reward.
+%%
+The wisdom of the prudent is to understand his way: but the 
+folly of fools is deceit.
+%%
+The wise in heart shall be called prudent: and the 
+sweetness of the lips increaseth learning.
+%%
+The wise in heart will receive commandments: but a prating 
+fool shall fall.
+%%
+The wise shall inherit glory: but shame shall be the 
+promotion of fools.
+%%
+The wise shepherd never trusts his flock to a smiling wolf.
+%%
+The words of Agur the son of Jakeh, even the prophecy: the 
+man spake unto Ithiel, even unto Ithiel and Ucal, Surely I 
+am more brutish than any man, and have not the 
+understanding of a man.
+%%
+The words of a man's mouth are as deep waters, and the 
+wellspring of wisdom as a flowing brook.
+%%
+The words of a talebearer are as wounds, and they go down 
+into the innermost parts of the belly.
+%%
+The words of a talebearer are as wounds, and they go down 
+into the innermost parts of the belly.
+%%
+The words of king Lemuel, the prophecy that his mother 
+taught him.
+%%
+The words of the wicked are to lie in wait for blood: but 
+the mouth of the upright shall deliver them.
+%%
+The world is coming to an end ...  SAVE YOUR BUFFERS!!!
+%%
+The wrath of a king is as messengers of death: but a wise 
+man will pacify it.
+%%
+Then I saw, and considered it well: I looked upon it, and 
+received instruction.
+%%
+Then shall they call upon me, but I will not answer; they 
+shall seek me early, but they shall not find me: For that 
+they hated knowledge, and did not choose the fear of the 
+LORD: They would none of my counsel: they despised all my reproof.
+%%
+Then shalt thou understand righteousness, and judgment, and 
+equity; yea, every good path.
+%%
+Then shalt thou walk in thy way safely, and thy foot shall 
+not stumble.
+%%
+There are many devices in a man's heart; nevertheless the 
+counsel of the LORD, that shall stand.
+%%
+There are more old drunkards than old doctors.
+%%
+There are more things in heaven and earth than are dreamt 
+of ... in either.
+%%
+There are people so addicted to exaggeration that they 
+can't tell the truth without lying.
+%%
+There be four things which are little upon the earth, but 
+they are exceeding wise: The ants are a people not strong, 
+yet they prepare their meat in the summer; The conies are 
+but a feeble folk, yet make they their houses in the rocks; 
+The locusts have no king, yet go they forth all of them by 
+bands; The spider taketh hold with her hands, and is in 
+kings' palaces.
+%%
+There be three things which are too wonderful for me, yea, 
+four which I know not: The way of an eagle in the air; the 
+way of a serpent upon a rock; the way of a ship in the 
+midst of the sea; and the way of a man with a maid.
+%%
+There be three things which go well, yea, four are comely 
+in going: A lion which is strongest among beasts, and 
+turneth not away for any; A greyhound; an he goat also; and a 
+king, against whom there is no rising up.
+%%
+There is a generation that are pure in their own eyes, and 
+yet is not washed from their filthiness.
+%%
+There is a generation that curseth their father, and doth 
+not bless their mother.
+%%
+There is a generation, O how lofty are their eyes! and 
+their eyelids are lifted up.
+%%
+There is a generation, whose teeth are as swords, and their 
+jaw teeth as knives, to devour the poor from off the 
+earth, and the needy from among men.
+%%
+There is a way that seemeth right unto a man, but the end 
+thereof are the ways of death.
+%%
+There is a way which seemeth right unto a man, but the end 
+thereof are the ways of death.
+%%
+There is gold, and a multitude of rubies: but the lips of 
+knowledge are a precious jewel.
+%%
+There is no distinctly native American criminal class 
+except Congress. -- Mark Twain
+%%
+There is no heavier burden than a great potential.
+%%
+There is no proverb that is not true. -- Cervantes
+%%
+There is no sadder sight than a young pessimist.
+%%
+There is no sin but ignorance. -- Christopher Marlowe
+%%
+There is no such thing as pure pleasure; some anxiety 
+always goes with it.
+%%
+There is no time like the pleasant.
+%%
+There is no wisdom nor understanding nor counsel against 
+the LORD.
+%%
+There is that maketh himself rich, yet hath nothing: there 
+is that maketh himself poor, yet hath great riches.
+%%
+There is that scattereth, and yet increaseth; and there is 
+that withholdeth more than is meet, but it tendeth to 
+poverty.
+%%
+There is that speaketh like the piercings of a sword: but 
+the tongue of the wise is health.
+%%
+There is treasure to be desired and oil in the dwelling of 
+the wise; but a foolish man spendeth it up.
+%%
+There never was a good war or a bad peace.
+%%
+There shall no evil happen to the just: but the wicked 
+shall be filled with mischief.
+%%
+There's got to be more to life than compile-and-go.
+%%
+There's never time to do the job right, so we must find 
+time to do it again.
+%%
+There's no room in the drug world for amateurs.
+%%
+There's so much to say but your eyes keep interrupting me.
+%%
+Therefore came I forth to meet thee, diligently to seek thy 
+face, and I have found thee.
+%%
+Therefore shall his calamity come suddenly; suddenly shall 
+he be broken without remedy.
+%%
+Therefore shall they eat of the fruit of their own way, and 
+be filled with their own devices.
+%%
+These are also proverbs of Solomon, which the men of 
+Hezekiah king of Judah copied out.
+%%
+These six things doth the LORD hate: yea, seven are an 
+abomination unto him: A proud look, a lying tongue, and hands 
+that shed innocent blood, An heart that deviseth wicked 
+imaginations, feet that be swift in running to mischief, A 
+false witness that speaketh lies, and he that soweth discord 
+among brethren.
+%%
+They are all plain to him that understandeth, and right to 
+them that find knowledge.
+%%
+They have stricken me, shalt thou say, and I was not sick; 
+they have beaten me, and I felt it not: when shall I awake? 
+I will seek it yet again.
+%%
+They that are of a froward heart are abomination to the 
+LORD: but such as are upright in their way are his delight.
+%%
+They that forsake the law praise the wicked: but such as 
+keep the law contend with them.
+%%
+Thine eyes shall behold strange women, and thine heart 
+shall utter perverse things.
+%%
+Thine own friend, and thy father's friend, forsake not; 
+neither go into thy brother's house in the day of thy 
+calamity: for better is a neighbour that is near than a brother far 
+off.
+%%
+This fortune is inoperative.  Please try another.
+%%
+This is a good time to punt work.
+%%
+This login session: $13.99
+%%
+This screen intentionally left blank.
+%%
+Thorns and snares are in the way of the froward: he that 
+doth keep his soul shall be far from them.
+%%
+Those of you who think you know everything are very 
+annoying to us who do.
+%%
+Those who can, do.  Those who can't, program.
+%%
+Those who can, do.  Those who can't, simulate.
+%%
+Those who can, do.  Those who can't, teach.  Those who 
+can't teach, HACK!
+%%
+Those who in quarrels interpose must often wipe a bloody 
+nose.
+%%
+Those who talk, don't know.  Those who don't talk, know.
+%%
+Thou shalt beat him with the rod, and shalt deliver his 
+soul from hell.
+%%
+Though hand join in hand, the wicked shall not be 
+unpunished: but the seed of the righteous shall be delivered.
+%%
+Though this be madness, yet there is method in 't. -- 
+William Shakespeare
+%%
+Though thou shouldest bray a fool in a mortar among wheat 
+with a pestle, yet will not his foolishness depart from him.
+%%
+Through desire a man, having separated himself, seeketh and 
+intermeddleth with all wisdom.
+%%
+Through wisdom is an house builded; and by understanding it 
+is established: And by knowledge shall the chambers be 
+filled with all precious and pleasant riches.
+%%
+Thy father and thy mother shall be glad, and she that bare 
+thee shall rejoice.
+%%
+Time and tide wait for no man.
+%%
+Time flies when you don't know what you're doing.
+%%
+Time for lunch!
+%%
+Time is but the stream I go a-fishing in.
+%%
+Time is nature's way of making sure that everything doesn't 
+happen at once.
+%%
+To be great is to be misunderstood.
+%%
+To criticize the incompetent is easy; it is more difficult 
+to criticize the competent.
+%%
+To do justice and judgment is more acceptable to the LORD 
+than sacrifice.
+%%
+To each his own and to you so long.
+%%
+To have a sense of humor is to be a tragic figure.
+%%
+To have respect of persons is not good: for for a piece of 
+bread that man will transgress.
+%%
+To iterate is human, to recurse, divine.
+%%
+To know thyself is the ultimate form of aggression.
+%%
+To laugh at men of sense is the privilege of fools.
+%%
+To teach is to learn.
+%%
+To understand a program you must become both the machine 
+and the program.
+%%
+Today is a good day to bribe a high-ranking public 
+official.
+%%
+Today is the last day of your life so far.
+%%
+Too clever is dumb. -- Ogden Nash
+%%
+Toto, I have a feeling we're not in Kansas any more!
+%%
+Train up a child in the way he should go: and when he is 
+old, he will not depart from it.
+%%
+Treasures of wickedness profit nothing: but righteousness 
+delivereth from death.
+%%
+Troubles are like babies; they only grow by nursing.
+%%
+Trust in Allah, but tie your camel anyway.
+%%
+Trust in the LORD with all thine heart; and lean not unto 
+thine own understanding.
+%%
+Truthful: Dumb and illiterate.
+%%
+Try "stty 0" -- it works much better.
+%%
+Try the Moo Shu Pork.  It is especially good today.
+%%
+Try to divide your time evenly to keep others happy.
+%%
+Trying to get an education here is like trying to take a 
+drink from a fire hose.
+%%
+Turn not to the right hand nor to the left: remove thy foot 
+from evil.
+%%
+Turn the other cheek. -- Jesus Christ
+%%
+Two men look out through the same bars; one sees mud, and 
+one the stars.
+%%
+Two things have I required of thee; deny me them not before 
+I die: Remove far from me vanity and lies: give me neither 
+poverty nor riches; feed me with food convenient for me: 
+Lest I be full, and deny thee, and say, Who is the LORD? or 
+lest I be poor, and steal, and take the name of my God in vain.
+%%
+Understanding is a wellspring of life unto him that hath 
+it: but the instruction of fools is folly.
+%%
+Unix soit qui mal y pense.
+%%
+Unquestionably, there is progress.  The average American 
+now pays out twice as much in taxes as he formerly got in 
+wages.
+%%
+Unto you, O men, I call; and my voice is to the sons of 
+man.
+%%
+Use GOTOs only to implement a fundamental structure.
+%%
+Use IF...ELSE  IF...ELSE  IF...ELSE... to implement 
+multi-way branches.
+%%
+Use debugging compilers.
+%%
+Use free-form input where possible.
+%%
+Use library functions.
+%%
+Vests are to suits as seat-belts are to cars.
+%%
+Volcano -- a mountain with hiccups.
+%%
+Wag your tongue as much as you please, but don't wave your 
+gun. -- Russian proverb
+%%
+Walk softly and carry a big stick. -- Theodore Roosevelt
+%%
+Wash a pig as much as you like, it'll go right back into 
+the mud puddle. -- Russian proverb
+%%
+Waste not, get your budget cut next year.
+%%
+Watch out for off-by-one errors.
+%%
+We all know that no one understands anything that isn't 
+funny.
+%%
+We always might win ... because the others might lose.
+%%
+We are all related: the same sun dries our rags. -- Russian 
+proverb
+%%
+We are always the same age inside.
+%%
+We could do that, but it would be wrong, that's for sure.
+%%
+We give advice, but we cannot give the wisdom to profit by 
+it.
+%%
+We learn from history that we do not learn anything from 
+history.
+%%
+We must remember the First Amendment which protects any 
+shrill jackass no matter how self-seeking.
+%%
+Wealth gotten by vanity shall be diminished: but he that 
+gathereth by labour shall increase.
+%%
+Wealth maketh many friends; but the poor is separated from 
+his neighbour.
+%%
+What garlic is to salad, insanity is to art.
+%%
+What good is honor on an empty stomach? -- Russian proverb
+%%
+What is wanted is not the will-to-believe, but the 
+wish-to-find-out, which are exact opposites.
+%%
+What sin has not been committed in the name of efficiency?
+%%
+What this country needs is a good five cent microcomputer.
+%%
+What you don't know can't hurt you.
+%%
+What, my son? and what, the son of my womb? and what, the 
+son of my vows? Give not thy strength unto women, nor thy 
+ways to that which destroyeth kings.
+%%
+When a man assumes a public trust, he should consider 
+himself as public property. -- Thomas Jefferson
+%%
+When a man's ways please the LORD, he maketh even his 
+enemies to be at peace with him.
+%%
+When a wicked man dieth, his expectation shall perish: and 
+the hope of unjust men perisheth.
+%%
+When choosing between two evils, always try the one you 
+have never tried before.
+%%
+When he prepared the heavens, I was there: when he set a 
+compass upon the face of the depth: When he established the 
+clouds above: when he strengthened the fountains of the 
+deep: When he gave to the sea his decree, that the waters 
+should not pass his commandment: when he appointed the 
+foundations of the earth: Then I was by him, as one brought up with 
+him: and I was daily his delight, rejoicing always before 
+him; Rejoicing in the habitable part of his earth; and my 
+delights were with the sons of men.
+%%
+When in charge, ponder; when in doubt, mumble; when in 
+trouble, delegate.
+%%
+When in doubt, lead trump.
+%%
+When it goeth well with the righteous, the city rejoiceth: 
+and when the wicked perish, there is shouting.
+%%
+When pride cometh, then cometh shame: but with the lowly is 
+wisdom.
+%%
+When righteous men do rejoice, there is great glory: but 
+when the wicked rise, a man is hidden.
+%%
+When the righteous are in authority, the people rejoice: 
+but when the wicked beareth rule, the people mourn.
+%%
+When the scorner is punished, the simple is made wise: and 
+when the wise is instructed, he receiveth knowledge.
+%%
+When the sheath is broken, you can't hide the sword. -- 
+Russian proverb
+%%
+When the wicked are multiplied, transgression increaseth: 
+but the righteous shall see their fall.
+%%
+When the wicked cometh, then cometh also contempt, and with 
+ignominy reproach.
+%%
+When the wicked rise, men hide themselves: but when they 
+perish, the righteous increase.
+%%
+When the wind is great, bow before it; when the wind is 
+heavy, yield to it.
+%%
+When there were no depths, I was brought forth; when there 
+were no fountains abounding with water.
+%%
+When thou goest, it shall lead thee; when thou sleepest, it 
+shall keep thee; and when thou awakest, it shall talk with 
+thee.
+%%
+When thou goest, thy steps shall not be straitened; and 
+when thou runnest, thou shalt not stumble.
+%%
+When thou liest down, thou shalt not be afraid: yea, thou 
+shalt lie down, and thy sleep shall be sweet.
+%%
+When thou sittest to eat with a ruler, consider diligently 
+what is before thee: And put a knife to thy throat, if thou 
+be a man given to appetite.
+%%
+When we write programs that "learn," it turns out that we 
+do and they don't.
+%%
+When wisdom entereth into thine heart, and knowledge is 
+pleasant unto thy soul; Discretion shall preserve thee, 
+understanding shall keep thee: To deliver thee from the way of 
+the evil man, from the man that speaketh froward things; Who 
+leave the paths of uprightness, to walk in the ways of 
+darkness; Who rejoice to do evil, and delight in the 
+frowardness of the wicked; Whose ways are crooked, and they froward 
+in their paths: To deliver thee from the strange woman, even 
+from the stranger which flattereth with her words; Which 
+forsaketh the guide of her youth, and forgetteth the 
+covenant of her God.
+%%
+When you live close to the graveyard, you can't weep for 
+every funeral. -- Russian proverb
+%%
+When your only tool is a hammer, you tend to treat 
+everything you find like a nail.
+%%
+Where no counsel is, the people fall: but in the multitude 
+of counsellors there is safety.
+%%
+Where no oxen are, the crib is clean: but much increase is 
+by the strength of the ox.
+%%
+Where the system is concerned, you're not allowed to ask 
+"Why?".
+%%
+Where there is no vision, the people perish: but he that 
+keepeth the law, happy is he.
+%%
+Wherefore is there a price in the hand of a fool to get 
+wisdom, seeing he hath no heart to it? A friend loveth at all 
+times, and a brother is born for adversity.
+%%
+Who are you?
+%%
+Who can find a virtuous woman? for her price is far above 
+rubies.
+%%
+Who can say, I have made my heart clean, I am pure from my 
+sin? Divers weights, and divers measures, both of them are 
+alike abomination to the LORD.
+%%
+Who hath ascended up into heaven, or descended? who hath 
+gathered the wind in his fists? who hath bound the waters in 
+a garment? who hath established all the ends of the earth? 
+what is his name, and what is his son's name, if thou canst 
+tell? Every word of God is pure: he is a shield unto them 
+that put their trust in him.
+%%
+Who hath woe? who hath sorrow? who hath contentions? who 
+hath babbling? who hath wounds without cause? who hath 
+redness of eyes? They that tarry long at the wine; they that go 
+to seek mixed wine.
+%%
+Whose hatred is covered by deceit, his wickedness shall be 
+shewed before the whole congregation.
+%%
+Whoso boasteth himself of a false gift is like clouds and 
+wind without rain.
+%%
+Whoso causeth the righteous to go astray in an evil way, he 
+shall fall himself into his own pit: but the upright shall 
+have good things in possession.
+%%
+Whoso curseth his father or his mother, his lamp shall be 
+put out in obscure darkness.
+%%
+Whoso despiseth the word shall be destroyed: but he that 
+feareth the commandment shall be rewarded.
+%%
+Whoso diggeth a pit shall fall therein: and he that rolleth 
+a stone, it will return upon him.
+%%
+Whoso findeth a wife findeth a good thing, and obtaineth 
+favour of the LORD.
+%%
+Whoso is partner with a thief hateth his own soul: he 
+heareth cursing, and bewrayeth it not.
+%%
+Whoso keepeth his mouth and his tongue keepeth his soul 
+from troubles.
+%%
+Whoso keepeth the fig tree shall eat the fruit thereof: so 
+he that waiteth on his master shall be honoured.
+%%
+Whoso keepeth the law is a wise son: but he that is a 
+companion of riotous men shameth his father.
+%%
+Whoso loveth instruction loveth knowledge: but he that 
+hateth reproof is brutish.
+%%
+Whoso loveth wisdom rejoiceth his father: but he that 
+keepeth company with harlots spendeth his substance.
+%%
+Whoso mocketh the poor reproacheth his Maker: and he that 
+is glad at calamities shall not be unpunished.
+%%
+Whoso rewardeth evil for good, evil shall not depart from 
+his house.
+%%
+Whoso robbeth his father or his mother, and saith, It is no 
+transgression; the same is the companion of a destroyer.
+%%
+Whoso stoppeth his ears at the cry of the poor, he also 
+shall cry himself, but shall not be heard.
+%%
+Whoso walketh uprightly shall be saved: but he that is 
+perverse in his ways shall fall at once.
+%%
+Whosoever hideth her hideth the wind, and the ointment of 
+his right hand, which bewrayeth itself.
+%%
+Wilt thou set thine eyes upon that which is not? for riches 
+certainly make themselves wings; they fly away as an eagle 
+toward heaven.
+%%
+Wine is a mocker, strong drink is raging: and whosoever is 
+deceived thereby is not wise.
+%%
+Wisdom crieth without; she uttereth her voice in the 
+streets: She crieth in the chief place of concourse, in the 
+openings of the gates: in the city she uttereth her words, 
+saying, How long, ye simple ones, will ye love simplicity? and 
+the scorners delight in their scorning, and fools hate 
+knowledge? Turn you at my reproof: behold, I will pour out my 
+spirit unto you, I will make known my words unto you.
+%%
+Wisdom hath builded her house, she hath hewn out her seven 
+pillars: She hath killed her beasts; she hath mingled her 
+wine; she hath also furnished her table.
+%%
+Wisdom is before him that hath understanding; but the eyes 
+of a fool are in the ends of the earth.
+%%
+Wisdom is the principal thing; therefore get wisdom: and 
+with all thy getting get understanding.
+%%
+Wisdom is too high for a fool: he openeth not his mouth in 
+the gate.
+%%
+Wisdom resteth in the heart of him that hath understanding: 
+but that which is in the midst of fools is made known.
+%%
+Wise men lay up knowledge: but the mouth of the foolish is 
+near destruction.
+%%
+With clothes the new are best, with friends the old are 
+best.
+%%
+With her much fair speech she caused him to yield, with the 
+flattering of her lips she forced him.
+%%
+Withdraw thy foot from thy neighbour's house; lest he be 
+weary of thee, and so hate thee.
+%%
+Withhold not correction from the child: for if thou beatest 
+him with the rod, he shall not die.
+%%
+Withhold not good from them to whom it is due, when it is 
+in the power of thine hand to do it.
+%%
+Within a computer, natural language is unnatural.
+%%
+Without adventure, civilization is in full decay.
+%%
+Without counsel purposes are disappointed: but in the 
+multitude of counsellors they are established.
+%%
+Words are the voice of the heart.
+%%
+Words must be weighed, not counted.
+%%
+Work is the curse of the drinking class.
+%%
+Wrath is cruel, and anger is outrageous; but who is able to 
+stand before envy? Open rebuke is better than secret love.
+%%
+Writing free verse is like playing tennis with the net 
+down.
+%%
+Yea, my reins shall rejoice, when thy lips speak right 
+things.
+%%
+Yea, thou shalt be as he that lieth down in the midst of 
+the sea, or as he that lieth upon the top of a mast.
+%%
+Yet a little sleep, a little slumber, a little folding of 
+the hands to sleep: So shall thy poverty come as one that 
+travelleth; and thy want as an armed man.
+%%
+You are being paged.
+%%
+You are being swapped.
+%%
+You are clever, but it comes slowly -- all the way from the 
+back of your head. -- Russian proverb
+%%
+You are going to have a new love affair.
+%%
+You are in a maze of twisty little passages, all alike.
+%%
+You attempt things that you do not even plan because of 
+your extreme stupidity.
+%%
+You can do more with a kind word and a gun than you can 
+with only a kind word.
+%%
+You can't depend on the man who made the mess to clean it 
+up. -- Richard Nixon [1952]
+%%
+You can't drive straight on a twisting road. -- Russian 
+proverb
+%%
+You can't go home again, unless you set $HOME.
+%%
+You can't pick a mushroom without bowing. -- Russian 
+proverb
+%%
+You cannot kill time without injuring eternity.
+%%
+You do not have mail.
+%%
+You don't have to rehearse to be yourself.
+%%
+You don't want to know what I know.
+%%
+You fill a much-needed gap.
+%%
+You have a deep interest in all that is artistic.
+%%
+You have a tendency to feel you are superior to most 
+computers.
+%%
+You have an ambitious nature and may make a name for 
+yourself.
+%%
+You have been selected for a secret mission.
+%%
+You have been swapped out.
+%%
+You have mail.
+%%
+You look tired.
+%%
+You never get a hangover from other people's vodka. -- 
+Russian proverb
+%%
+You now have Asian Flu.
+%%
+You should go home.
+%%
+You will attract cultured and artistic people to your home.
+%%
+You will be advanced socially, without any special effort 
+on your part.
+%%
+You will be recognized and honored as a community leader.
+%%
+You will be surprised by a loud noise.
+%%
+You will feel hungry again in another hour.
+%%
+You will live a long, healthy, happy life and make bags of 
+money.
+%%
+You will never know hunger.
+%%
+You will reach the highest possible point in your business 
+or profession.
+%%
+You will step on the night soil of many countries.
+%%
+You'll be called to a post requiring high ability in 
+handling groups of people.
+%%
+You'll be sent to Siberia to count the birches. -- Russian 
+proverb
+%%
+Your business will go through a period of considerable 
+expansion.
+%%
+Your code should be more efficient!
+%%
+Your computer account is overdrawn.  Please reauthorize.
+%%
+Your education begins where what is called your education 
+is over.
+%%
+Your empty file directory has been deleted.
+%%
+Your ignorance cramps my conversation.
+%%
+Your mind understands what you have been taught; your 
+heart, what is true.
+%%
+Your salary will be increased.
+%%
+Your supervisor is thinking about you.
+%%
+Youth is the trustee of posterity.
diff --git a/etc/genlauncher/Makefile b/etc/genlauncher/Makefile
new file mode 100644 (file)
index 0000000..ab3b6b6
--- /dev/null
@@ -0,0 +1,32 @@
+#CC = cc -g
+#CC = cc -Ac -g
+#CC = cc -Xc -g
+#CC = acc -g
+#CC = CC -g
+CC = gcc
+#CC = gcc -g -Wall -ansi -pedantic
+#CC = gcc -g -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wstrict-prototypes
+#CC = g++ -g -Wall
+
+RM = rm -f
+
+LEX = lex # could really be flex
+#LEX = flex
+
+LEXLIB = -ll
+#LEXLIB = -lfl
+
+all : xlockgen
+       perl guibuild.pl
+
+lex.yy.c : xlockgen.lex
+       $(LEX) xlockgen.lex
+
+xlockgen : lex.yy.c
+       $(CC) lex.yy.c -o $@ $(LEXLIB)
+
+clean :
+       $(RM) core *~ *% *.bak *.orig *.rej make.log MakeOut *.patch
+
+distclean : clean
+       $(RM) xlockgen lex.yy.c
diff --git a/etc/genlauncher/README.gui b/etc/genlauncher/README.gui
new file mode 100644 (file)
index 0000000..d92f21c
--- /dev/null
@@ -0,0 +1,18 @@
+This is a facility for the maintainer to populate
+the launchers with all the modes.
+
+Written by Charles Vidal <vidalc@club-internet.fr>
+
+README             This file
+lmode.h            The modes
+genbuild.pl
+xlockgen.lex
+
+To compile xlockgen.lex
+lex xlockgen.lex
+# Lex
+gcc lex.yy.c -o xlockgen -ll
+# Flex
+gcc lex.yy.c -o xlockgen -lfl
+
+Then run genbuild.pl in the genlauncher directory
diff --git a/etc/genlauncher/etc.xlock.java b/etc/genlauncher/etc.xlock.java
new file mode 100644 (file)
index 0000000..22a3cee
--- /dev/null
@@ -0,0 +1,195 @@
+// charles vidal <vidalc@club-internet.fr>
+// the GUI definition and the handler event
+import java.applet.*;
+import java.awt.*;
+import java.lang.Runtime;
+
+public class xlockFrame extends Applet {
+
+public static final int nbcoption=9;
+public static final int nbbooleanopt=14;
+Button blaunch;
+Button blaunchinw;
+Button bquit;
+Choice coptions;
+TextField foroptions;
+ List lst ;
+int    currentOption=0;
+
+MyFrameError mfe;
+
+boolean isinapp=false;
+
+// Array of option name
+String[] nomOption={"Name program",
+"File",
+"Message Password",
+"Message Valid",
+"Message Invalid",
+"Prompt",
+"Fonts",
+"Geometry","Display"};
+
+String[] valueOption={"","","","","","","","",""};
+String[] cmdlineOption={"-program","-messagefile","-password","-validate","-invalid","","-font","-geometry","-display"};
+
+// Array of option boolean name
+String[] booleanOption={
+"-mono ",
+"-nolock ",
+"-remote ",
+"-allowroot ",
+"-enablesaver ",
+"-allowaccess ",
+"-grabmouse ",
+"-echokeys ",
+"-usefirst ",
+"-verbose ",
+"-inroot ",
+"-timeelapsed ",
+"-install ",
+"-wireframe ",
+"-showfps ",
+"-use3d "};
+Checkbox bopt[]=new Checkbox[15];
+ public void init()
+        {
+ Frame theAppWindow = new Frame("xlockFrame");
+ Panel Panel1 = new Panel();
+ Panel Panel2 = new Panel();
+ Panel Panel3 = new Panel();
+ setLayout(new BorderLayout(10,10));
+
+ lst = new List();
+
+coptions=new Choice();
+for (int i=0;i<nbcoption;i++)
+       coptions.addItem(nomOption[i]);
+
+Panel3.add(coptions);
+
+foroptions = new TextField(20);
+Panel3.add(foroptions);
+
+add("North", Panel3);
+
+add("Center",lst);
+$%LISTJAVAlst.addItem("bomb");
+lst.addItem("random");
+lst.select(0);
+
+add("East", Panel1);
+Panel1.setLayout(new GridLayout(15,1));
+for (int i=0;i<nbbooleanopt;i++)
+       { bopt[i]=new Checkbox(booleanOption[i],null,false);
+       Panel1.add(bopt[i]);
+       }
+
+add("South", Panel2);
+blaunch=new Button("Launch");
+blaunchinw=new Button("Launch in window");
+bquit=new Button("Quit");
+Panel2.add(blaunch);
+Panel2.add(blaunchinw);
+Panel2.add(bquit);
+}
+public String getBooleanOption()
+{
+String result="";
+for (int i=0;i<nbbooleanopt;i++)
+       {if (bopt[i].getState()) result=result.concat(booleanOption[i]);
+       }
+       return (result);
+}
+public boolean action (Event evt, Object arg)
+{
+
+Runtime r=Runtime.getRuntime();
+
+
+if (isinapp)
+       mfe=new MyFrameError("An error occured , You can't launch xlock");
+       else
+       mfe=new MyFrameError("An error occured , You can't launch xlock");
+       //mfe=new MyFrameError("You can't launch by a Browser");
+
+mfe.resize(350,150);
+
+if (evt.target == blaunch || evt.target == blaunchinw)
+       {
+       String label= (String) arg;
+       String cmdlinexlock="xlock ";
+       if (evt.target == blaunchinw ) cmdlinexlock=cmdlinexlock.concat("-inwindow ");
+       for (int i=0;i<nbcoption;i++)
+               {
+               if (!valueOption[i].equals(""))
+                       {
+                       cmdlinexlock=cmdlinexlock.concat(cmdlineOption[i]+" "+valueOption[i]+" ");
+                       }
+               }
+       cmdlinexlock=cmdlinexlock.concat(getBooleanOption());
+       cmdlinexlock=cmdlinexlock.concat(" -mode ");
+       cmdlinexlock=cmdlinexlock.concat(lst.getSelectedItem());
+       try {
+  System.out.println(cmdlinexlock);
+       r.getRuntime().exec(cmdlinexlock); }
+                       catch ( Exception e )
+                               {mfe.show();}
+       return true;}
+else
+       if (evt.target == coptions)
+       {
+       String label= (String) arg;
+       valueOption[currentOption]=foroptions.getText();
+       for (int i=0;i<nbcoption;i++)
+               {
+               if (nomOption[i].equals(label))
+                       {foroptions.setText(valueOption[i]);
+                       currentOption=i;
+                       }
+               }
+       }
+else
+       if (evt.target == bquit) {System.exit(0);}
+       else if (evt.target instanceof Checkbox)
+       {
+       return true;
+       }
+else
+       if (evt.target == foroptions)
+       {
+       String label= (String) arg;
+       valueOption[currentOption]=label;
+       return true;
+       }
+       return false;
+  }
+
+public void SetInAppl()
+{
+isinapp=true;
+}
+
+}
+class MyFrameError extends Frame {
+Label l;
+Button b_ok;
+MyFrameError (String erreur) {
+
+       setLayout(new BorderLayout());
+       l=new Label(erreur,Label.CENTER);
+       add("Center",l);
+       b_ok=new Button("Ok");
+       add("South",b_ok);
+       setTitle(erreur);
+       setCursor(HAND_CURSOR);
+       }
+public boolean action (Event evt,Object arj){
+       if (evt.target instanceof Button)
+               {
+               this.hide();
+               return (true);
+               }
+               return (false);
+}
+}
diff --git a/etc/genlauncher/etc.xlock.tcl b/etc/genlauncher/etc.xlock.tcl
new file mode 100644 (file)
index 0000000..59c312f
--- /dev/null
@@ -0,0 +1,668 @@
+#!/usr/X11/bin/wish -f
+
+#charles vidal 1998 <vidalc@club-intenet.fr>
+# update Sun Oct 18 1998
+# Add the menu file with load resources
+# and the exit button
+# Add the load_process procedure loading
+# the ressource file ~/XLock
+#
+
+#function find in demo: mkStyles.tcl
+# The procedure below inserts text into a given text widget and
+# applies one or more tags to that text.  The arguments are:
+#
+# w             Window in which to insert
+# text          Text to insert (it's inserted at the "insert" mark)
+# args          One or more tags to apply to text.  If this is empty
+#               then all tags are removed from the text.
+set bgcolor ""
+set fgcolor ""
+set ftname ""
+set mftname ""
+set usernom ""
+set passmot ""
+set XLock_validate ""
+set XLock_invalid ""
+set XLock_program ""
+set geometrie ""
+set icogeometrie ""
+set XLock_info ""
+set indxhelp ""
+set messagesfile ""
+set messagefile ""
+set bitmap ""
+
+proc openfilesel { var  } {
+upvar $var toto
+set toto [ tk_getOpenFile -parent .]
+return toto
+}
+
+proc insertWithTags {w text args} {
+  set start [$w index insert]
+  $w insert insert $text
+  foreach tag [$w tag names $start] {
+    $w tag remove $tag $start insert
+  }
+  foreach i $args {
+    $w tag add $i $start insert
+  }
+}
+
+# Function for the help
+proc mkHelpCheck { w args } {
+  set nbf 0
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    $w insert insert  "\n"
+    checkbutton $w.c$nbf -variable [lindex $i 0] -text [lindex $i 0]
+    $w window create {end lineend} -window $w.c$nbf
+    $w insert insert  " [lindex $i 1] "
+  }
+}
+
+proc mkHelpEntry { w args } {
+  set nbf 0
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    insertWithTags  $w "\n [lindex $i 0] " underline
+    entry $w.e$nbf -textvariable [lindex $i 1]
+    $w window create {end lineend} -window $w.e$nbf
+    $w insert insert  "\n[lindex $i 2] "
+  }
+}
+
+#
+proc whichcolor { which } {
+  global fgcolor
+  global bgcolor
+  if {$which == "RESETFG"} {set fgcolor ""}
+  if {$which == "RESETBG"} {set bgcolor ""}
+  if ($tk_version>4) then {
+    if {$which== "FG" } {set fgcolor [tk_chooseColor -initialcolor $fgcolor -title "foreground color"];
+      puts $fgcolor
+    }
+  if {$which == "BG"} {set bgcolor [tk_chooseColor -initialcolor $bgcolor -title "background color"];
+      puts $bgcolor
+    }
+  } else
+  {
+    if {$which== "FG" } {set fgcolor [.color.frame.names get [.color.frame.names curselection]];}
+    if {$which == "BG"} {set bgcolor [.color.frame.names get [.color.frame.names curselection]];}
+  }
+}
+
+proc mkColor { what } {
+  if ($tk_version>4) then {
+    whichcolor $what; destroy .color
+  } else
+  {
+    toplevel .color
+    wm title .color "Color"
+    frame .color.frame -borderwidth 10
+    frame .color.frame2 -borderwidth 10
+    set w .color.frame
+    label $w.msg0   -text "Color Options"
+    pack $w.msg0 -side top
+    foreach i {/usr/local/lib/X11/rgb.txt /usr/lib/X11/rgb.txt
+        /X11/R5/lib/X11/rgb.txt /X11/R4/lib/rgb/rgb.txt} {
+      if ![file readable $i] {
+        continue;
+      }
+      set f [open $i]
+      listbox .color.frame.names -yscrollcommand ".color.frame.scroll set" \
+            -relief sunken -borderwidth 2 -exportselection false
+      bind .color.frame.names <Double-1> {
+            .color.test configure -bg [.color.frame.names get [.color.frame.names curselection]]
+      }
+      scrollbar .color.frame.scroll -orient vertical -command ".color.frame.names yview" \
+        -relief sunken -borderwidth 2
+      pack .color.frame.names  -side left
+      pack .color.frame.scroll -side right -fill both
+      pack .color.frame  -fill x
+      while {[gets $f line] >= 0} {
+        if {[llength $line] == 4} {
+          .color.frame.names insert end [lindex $line 3]
+        }
+      }
+      close $f
+      label  .color.test -height 5 -width 20
+      button .color.frame2.cancel -text Cancel -command "destroy .color"
+      button .color.frame2.ok -text OK -command "whichcolor $what; destroy .color"
+      button .color.frame2.reset -text Reset -command "whichcolor RESET$what; destroy .color"
+      pack  .color.test
+      pack .color.frame2.ok .color.frame2.cancel .color.frame2.reset -side left -fill x
+      pack .color.frame2 -fill both
+      break;
+    }
+  }
+}
+
+# moving in text by the list
+proc moveintext { indx } {
+upvar indxhelp t1
+ .help.f.t yview  [ lindex $t1 $indx ]
+
+}
+#----------------------
+# Help ...
+proc Helpxlock {} {
+  global indxhelp
+  toplevel .help
+  wm title .help "Help About Xlock"
+  frame .help.f
+  scrollbar .help.f.s -orient vertical -command {.help.f.t yview}
+  pack .help.f -expand yes -fill both
+  pack .help.f.s -side right -fill y -expand yes
+  text .help.f.t -yscrollcommand {.help.f.s set} -wrap word -width 60 -height 20 \
+    -setgrid 1
+
+  listbox .help.f.names -width 20 -height 20
+
+  bind .help.f.names <Double-1> {
+    set titi [eval .help.f.names curselection]
+    moveintext $titi
+  }
+
+  pack .help.f.names .help.f.t -expand y -fill both -side left
+  set w  .help.f.t
+  $w tag configure big -font -Adobe-Courier-Bold-R-Normal-*-140-*
+
+  foreach i {{"Xlock Help" { Locks the X server still the user enters their pass\
+word at the keyboard.  While xlock  is  running,  all  new\
+server  connections are refused.  The screen saver is dis\
+abled.  The mouse cursor is turned  off.   The  screen  is\
+blanked and a changing pattern is put on the screen.  If a\
+key or a mouse button is pressed then the user is prompted\
+for the password of the user who started xlock.
+If  the  correct  password  is  typed,  then the screen is\
+unlocked and the X server is restored.   When  typing  the\
+password  Control-U  and  Control-H are active as kill and\
+erase respectively.  To return to the locked screen, click\
+in the small icon version of the changing pattern.} 0 }
+    {"Options" {The option sets  the  X11  display  to  lock.\
+xlock  locks all available screens on a given server,\
+and restricts you to locking only a local server such\
+as  unix::00,,  localhost::00,,  or  ::00  unless you set the\
+     -remote option.} 0 }\
+    {"-name" {is used instead of XLock  when  looking for resources to configure xlock.} 1 }
+    {"-mode" {As  of  this  writing there are 100+ display modes supported (plus one more for random selection of one  of the 100+).} 1 }
+    {"-delay"  {It simply sets the number  of  microseconds to  delay
+between  batches  of animations.  In blank mode, it is important to set this to
+some small  number  of  microseconds,  because the keyboard and mouse are only checked after each delay, so you cannot set  the delay  too high, but a delay of
+zero would needlessly consume cpu checking for mouse and keyboard input  in a tight loop, since blank mode has no work to do.} 1 }
+    {"-saturation" {This option sets saturation  of  the  color ramp .  0 is grayscale and 1 is very rich color. 0.4 is a nice pastel.} 1 }
+    {"-username" {text string to use for Name prompt} 1 }\
+    {"-password" {text string to use for Password prompt} 1 }\
+    {"-info" {text string to use for instructions} 1 }\
+    {"-validate" {the message shown  while  validating  the password,
+defaults to \"Validating login...\"} 1 }\
+    {"-invalid" {the  message  shown  when  password  is invalid, defaults to \"Invalid login.\"} 1 }\
+    {"-geometry"  {This option sets the size and offset  of the  lock
+window  (normally the entire screen).  The entire screen format is still used for  entering  the password.   The  purpose  is  to  see the screen even though it is locked.  This should be used  with  caution since many of the modes will fail if the windows are far from square or are too small  (size  must  be greater
+than  0x0).   This  should also be used with esaver to protect screen from phosphor burn.} 1 }\
+    {"-icongeometry" {this option sets  the  size  of  the iconic screen (normally 64x64) seen when entering the password.  This should be  used  with  caution  since many  of  the  modes will fail if the windows are far from square
+or are too small (size  must  be  greater than  0x0).   The  greatest  size  is
+256x256.  There should be some limit  so  users  could  see  who  has locked  the  screen.  Position information of icon is ignored.} 1 }
+    {"-font" { Ths option  sets  the  font  to be used on the prompt screen.} 1 }
+    { "-fg "  { This option sets the color of the text on the password screen.} 1 }
+    {"-bg" { This option sets the color of the background on the password screen.} 1 }
+    {"-forceLogout" { This option sets the  auto-logout.  This  might not be enforced depending how your system is configured.} 1 }} {
+    lappend indxhelp [$w index current]
+    if {  [lindex $i 2] == 1 } then {.help.f.names insert end "    [lindex $i 0]"} else {.help.f.names insert end " [lindex $i 0]"}
+    insertWithTags  $w "[lindex $i 0] " big
+    $w insert end "\n"
+    $w insert end [lindex $i 1]
+    $w insert end "\n"
+  }
+  lappend indxhelp [$w index current]
+  insertWithTags  $w "Options boolean" big
+   $w insert end "\n"
+  .help.f.names insert end "Options boolean"
+  mkHelpCheck $w {XLock_mono {turn on/off monochrome override}}\
+                {nolock {trun on/off no password required mode}}\
+                {remote {turn on/off remote host access}}\
+                {allowroot {turn on/off allow root password mode (ignored)}}\
+                {enablesaver {turn on/off enable X server screen saver}}\
+                {allowaccess {turn on/off access of the terminal X}}\
+                {grabmouse {turn on/off grabbing of mouse and keyboard}}\
+                {echokeys {turn on/off echo \'?\' for each password key}}\
+                {usefirst {turn on/off using the first char typed in password}}\
+                {verbose {turn on/off verbose mode}}\
+                {inwindow {turn on/off making xlock run in a window}}\
+                {inroot {turn on/off making xlock run in the root window}}\
+                {timeelapsed {turn on/off clock}}\
+                {install {whether to use private colormap if needed (yes/no)}}\
+                {sound {whether to use sound if configured for it (yes/no}}\
+                {timeelapsed {turn on/off clock}}\
+                {usefirst {text string to use for Name prompt}}\
+                {trackmouse {turn on/off the mouse interaction}}
+        button .help.ok -text OK -command "destroy .help"
+  pack  .help.ok
+}
+
+# Create toplevel Author and Maintainer.
+proc mkAuthor {} {
+  toplevel .author
+  wm title .author "Author and Maintainer of xlock"
+  frame .author.frame -borderwidth 10
+  set w .author.frame
+
+  label $w.msg0   -text "Author and Maintainer of xlock"
+  label $w.msg1   -text "Maintained by: David A. Bagley (bagleyd@tux.org)"
+  label $w.msg2   -text "Original Author: Patrick J. Naughton (naughton@eng.sun.com)"
+  label $w.msg3   -text "Mailstop 21-14 Sun Microsystems Laboratories,"
+  label $w.msg4   -text "Inc.  Mountain View, CA  94043 15//336-1080"
+  label $w.msg5   -text "with many additional contributors"
+  pack $w.msg0 $w.msg1 $w.msg2 $w.msg3 $w.msg4 $w.msg5 -side top
+
+  label $w.msg6   -text "xlock.tcl\n created by charles VIDAL\n (author of flag mode and xmlock launcher )"
+  pack $w.msg6 -side top
+
+  button .author.ok -text OK -command "destroy .author"
+  pack $w .author.ok
+}
+
+proc mkFileDialog { nom titre args }  {
+  toplevel .$nom
+  wm title .$nom "$titre"
+  frame .$nom.frame -borderwidth 10
+  frame .$nom.frame2 -borderwidth 10
+  frame .$nom.frame.frame4 -borderwidth 10
+  set w .$nom.frame
+  set w2 .$nom.frame2
+  set w4 .$nom.frame.frame4
+  set nbf 0
+
+  label $w.msg0   -text "$titre"
+  pack $w.msg0 -side top
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    frame $w4.f$nbf
+    label $w4.f$nbf.l$nbf -text [lindex $i 0]
+    entry $w4.f$nbf.e$nbf -textvariable [lindex $i 1]
+    button $w4.f$nbf.b$nbf -text "..." -command "openfilesel [lindex $i 1]"
+    pack $w4.f$nbf.l$nbf $w4.f$nbf.e$nbf $w4.f$nbf.b$nbf  -side left -expand yes
+    pack $w4.f$nbf -expand yes
+  }
+  button $w2.ok -text OK -command "destroy .$nom"
+  button $w2.cancel -text Cancel -command "destroy .$nom"
+  pack $w -side top -expand yes
+  pack $w4 -side right -expand yes
+  pack $w2.ok $w2.cancel -side left -fill x -expand yes
+  pack $w2  -side bottom -expand yes
+}
+
+proc mkDialog { nom titre args } {
+  toplevel .$nom
+  wm title .$nom "$titre"
+  frame .$nom.frame -borderwidth 10
+  frame .$nom.frame2 -borderwidth 10
+  frame .$nom.frame.frame3 -borderwidth 10
+  frame .$nom.frame.frame4 -borderwidth 10
+  set w .$nom.frame
+  set w2 .$nom.frame2
+  set w3 .$nom.frame.frame3
+  set w4 .$nom.frame.frame4
+  set nbf 0
+
+  label $w.msg0   -text "$titre"
+  pack $w.msg0 -side top
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    label $w3.l$nbf -text [lindex $i 0]
+    entry $w4.e$nbf -textvariable [lindex $i 1]
+    pack $w3.l$nbf
+    pack $w4.e$nbf
+  }
+  button $w2.ok -text OK -command "destroy .$nom"
+  button $w2.cancel -text Cancel -command "destroy .$nom"
+  pack $w -side top
+  pack $w3 -side left
+  pack $w4 -side right
+  pack $w2.ok $w2.cancel -side left -fill x
+  pack $w2  -side bottom
+}
+
+proc mkMessage {} {
+  global passmot
+  global XLock_validate
+  global XLock_invalid
+  global XLock_info
+  mkDialog message {Message Options} \
+  {"message password" passmot} \
+  {"validate string" XLock_validate} \
+  {"invalid string" XLock_invalid} \
+  {"info string" XLock_info}
+}
+
+proc mkGeometry {} {
+  global geometrie
+  global icogeometrie
+  mkDialog geometry {Geometry Options} \
+  {"geometry" geometrie} \
+  {"icon geometry" icogeometrie}
+}
+
+proc mkFileOption {} {
+  global messagesfile
+  global messagefile
+  global bitmap
+  mkFileDialog fileoption {Files Options} \
+  {"messagesfile" messagesfile} \
+  {"messagefile" messagefile} \
+  {"bitmap" bitmap}
+}
+
+proc whichfont { which } {
+  global ftname
+  global mftname
+ if {$which== "FONT" } {set ftname [.font.frame.names get [.font.frame.names curselection]];}
+ if {$which == "MFONT"} {set mftname [.font.frame.names get [.font.frame.names curselection]];}
+ if {$which == "RESETFONT"} {set ftname ""}
+ if {$which == "RESETMFONT"} {set mftname ""}
+}
+
+#this function should be erase in the newer version...
+proc mkFont { What } {
+  toplevel .font
+  wm title .font "Font Options"
+  label  .font.label -text "ABCDEFGH\nIJKabedfg\nhijkmnopq"
+  frame .font.frame -borderwidth 10
+  frame .font.frame2 -borderwidth 10
+  set w .font.frame
+  label $w.msg0   -text "Font Options"
+  pack $w.msg0 -side top
+  eval exec "xlsfonts \> /tmp/xlsfont.tmp"
+  set f [open "/tmp/xlsfont.tmp"]
+  listbox .font.frame.names -yscrollcommand ".font.frame.scroll set" \
+    -xscrollcommand ".font.scroll2 set"  -setgrid 1 \
+    -exportselection false
+  bind .font.frame.names <Double-1> {
+   .font.test configure -font [.font.frame.names get [.font.frame.names curselection]]
+  }
+  scrollbar .font.frame.scroll -orient vertical -command ".font.frame.names yview" \
+    -relief sunken -borderwidth 2
+  scrollbar .font.scroll2 -orient horizontal -command ".font.frame.names xview" \
+    -relief sunken -borderwidth 2
+  while {[gets $f line] >= 0} {
+    .font.frame.names insert end $line
+  }
+  close $f
+
+  eval exec "/bin/rm -f /tmp/xlsfont.tmp"
+  pack .font.frame.names  -side left -expand y -fill both
+  pack .font.frame.scroll -side right -fill both
+  pack .font.frame  -fill x
+  pack .font.scroll2 -fill both
+  label  .font.test -text "ABCDEFGHIJKabedfghijkmnopq12345"
+  pack .font.test
+
+  button .font.frame2.cancel -text Cancel -command "destroy .font"
+  button .font.frame2.reset -text Reset -command "whichfont RESET$What;destroy .font"
+  button .font.frame2.ok -text OK -command "whichfont $What;destroy .font"
+  pack .font.frame2.ok .font.frame2.cancel .font.frame2.reset -side left -fill both
+  pack .font.frame2 -fill both
+
+  #frame $w.fontname
+  #label $w.fontname.l1 -text "font name"
+  #entry $w.fontname.e1 -relief sunken
+  #frame $w.specfont
+  #label $w.specfont.l2 -text "specifique font name"
+  #entry $w.specfont.e2 -relief sunken
+  #pack $w.fontname $w.specfont
+  #pack $w.fontname.l1 -side left
+  #pack $w.specfont.l2 -side left
+  #pack $w.fontname.e1 $w.specfont.e2  -side top -pady 5 -fill x
+  #button .font.frame2.ok -text OK -command "destroy .font"
+  #button .font.frame2.cancel -text Cancel -command "destroy .font"
+  #pack $w .font.frame2.ok .font.frame2.cancel -side left -fill x
+  #pack .font.frame2 -side bottom
+}
+
+proc mkEntry {} {
+  global usernom
+  global XLock_program
+  mkDialog option {User Options} \
+  {"user name" usernom} \
+  {"program name" XLock_program}
+}
+
+proc Affopts { device } {
+
+#options booleans
+  global XLock_mono
+  global nolock
+  global remote
+  global allowroot
+  global enablesaver
+  global allowaccess
+  global grabmouse
+  global echokeys
+  global usefirst
+  global install
+  global sound
+  global timeelapsed
+  global usefirst
+  global wireframe
+  global showfps
+  global use3d
+  global trackmouse
+
+  global fgcolor
+  global bgcolor
+  global ftname
+  global mftname
+
+  global usernom
+  global passmot
+  global XLock_validate
+  global XLock_invalid
+  global XLock_program
+  global geometrie
+  global icogeometrie
+  global XLock_info
+  global messagesfile
+  global messagefile
+  global bitmap
+
+  set linecommand "xlock "
+
+  if {$device == 1} {append linecommand "-inwindow "} elseif {$device == 2} {append linecommand "-inroot "}
+  if {$bgcolor!=""} {append linecommand "-bg $bgcolor "}
+  if {$fgcolor!=""} {append linecommand "-fg $fgcolor "}
+  if {$ftname!=""} {append linecommand "-font $ftname "}
+  if {$mftname!=""} {append linecommand "-messagefont $mftname "}
+#entry action
+  if {$usernom!=""} {append linecommand "-username $usernom "}
+  if {$passmot!=""} {append linecommand "-password $passmot "}
+  if {$XLock_validate!=""} {append linecommand "-validate $XLock_validate "}
+  if {$XLock_invalid!=""} {append linecommand "-invalid $XLock_invalid "}
+  if {$XLock_program!=""} {append linecommand "-program $XLock_program "}
+  if {$geometrie!=""} {append linecommand "-geometry $geometrie "}
+  if {$icogeometrie!=""} {append linecommand "-icongeometry $icogeometrie "}
+  if {$messagesfile!=""} {append linecommand "-messagesfile $messagesfile "}
+  if {$bitmap!=""} {append linecommand "-bitmap $bitmap "}
+  if {$icogeometrie!=""} {append linecommand "-icongeometry $icogeometrie "}
+  if {$XLock_info!=""} {append linecommand "-info $XLock_info "}
+#check actions
+  if { $XLock_mono == 1 } {append linecommand "-mono "}
+  if { $install == 1 } {append linecommand "-install "}
+  if { $sound == 1 } {append linecommand "-sound "}
+  if { $timeelapsed == 1 } {append linecommand "-timeelapsed "}
+  if { $usefirst == 1 } {append linecommand "-usefirst "}
+  if { $wireframe == 1 } {append linecommand "-wireframe "}
+  if { $showfps == 1 } {append linecommand "-showfps "}
+  if { $use3d == 1 } {append linecommand "-use3d "}
+  if { $trackmouse == 1 } {append linecommand "-trackmouse "}
+  if { $nolock == 1 } {append linecommand "-nolock "}
+  if { $remote == 1 } {append linecommand "-remote "}
+  if { $allowroot == 1 } {append linecommand "-allowroot "}
+  if { $enablesaver == 1 } {append linecommand "-enablesaver "}
+  if { $allowaccess == 1 } {append linecommand "-allowaccess "}
+  if { $grabmouse == 1 } {append linecommand "-grabmouse "}
+  if { $echokeys == 1 } {append linecommand "-echokeys "}
+  if { $usefirst == 1 } {append linecommand "-usefirst "}
+  append linecommand "-mode "
+  append linecommand [.listscrol.list get [eval .listscrol.list curselection]]
+  puts $linecommand
+  eval exec $linecommand
+}
+
+proc load_ressource { } {
+  global XLock_invalid
+  global XLock_validate
+  global XLock_info
+  global XLock_program
+
+set filename ""
+
+openfilesel filename
+
+set f [ open $filename r ]
+while { ! [eof $f ] } {
+       gets $f line
+               switch -regexp $line {
+       {^XLock\.[a-zA-Z]+:} {
+               if { [ regexp -nocase {\: $} tyty ]} {
+               }
+       regsub {^} $line "set " line2
+       regsub {XLock\.} $line2 "XLock_" line3
+       regsub {: } $line3 " \"" line4
+       regsub {on$} $line4 "1" line5
+       regsub {off$} $line4 "0" line5
+       eval "$line5\""
+       }
+       {^XLock\.[a-zA-Z]+\.[a-zA-Z]+:[ \t]*[a-zA-Z0-9]+$} {
+       regsub {^} $line "set " line2
+       regsub {XLock\.} $line2 "XLock_" line3
+       regsub {\.} $line3 "(" line4
+       regsub {: } $line4 ") \"" line5
+       eval "$line5\""
+       }
+}
+}
+}
+
+# Creation of GUI
+
+wm title . "xlock launcher"
+. configure -cursor top_left_arrow
+frame .menu -relief raised -borderwidth 1
+menubutton .menu.button -text "switches" -menu .menu.button.check
+pack .menu -side top -fill x
+
+global XLock_mono
+global sound
+global install
+global nolock
+global remote
+global allowroot
+global enablesaver
+global allowaccess
+global grabmouse
+global echokeys
+global usefirst
+
+global usernom
+global passmot
+global geometrie
+global icogeometrie
+global XLock_info
+
+# Creation of GUI
+
+#Creation of  menu
+set fileressource ""
+
+menubutton .menu.buttonf -text "file" -menu .menu.buttonf.file
+menu .menu.buttonf.file
+set FILE .menu.buttonf.file
+$FILE add command -label "Load ressource" -command "load_ressource"
+$FILE add command -label "exit" -command "exit"
+
+menu .menu.button.check
+set CHECK .menu.button.check
+
+#menu with les check buttons
+$CHECK add check -label "mono" -variable XLock_mono
+$CHECK add check -label "nolock" -variable nolock
+$CHECK add check -label "remote" -variable remote
+$CHECK add check -label "allowroot" -variable allowroot
+$CHECK add check -label "enablesaver" -variable enablesaver
+$CHECK add check -label "allowaccess" -variable allowaccess
+$CHECK add check -label "grabmouse" -variable grabmouse
+$CHECK add check -label "echokeys" -variable echokeys
+$CHECK add check -label "usefirst" -variable usefirst
+$CHECK add check -label "install" -variable install
+$CHECK add check -label "sound" -variable sound
+$CHECK add check -label "timeelapsed" -variable timeelapsed
+$CHECK add check -label "usefirst" -variable usefirst
+$CHECK add check -label "wireframe" -variable wireframe
+$CHECK add check -label "showfps" -variable showfps
+$CHECK add check -label "use3d" -variable use3d
+$CHECK add check -label "trackmouse" -variable trackmouse
+
+menubutton .menu.button2 -text "options" -menu .menu.button2.options
+menu .menu.button2.options
+set OPTIONS .menu.button2.options
+#les options
+$OPTIONS add command -label "generals options" -command "mkEntry"
+$OPTIONS add command -label "font to use for password prompt" -command "mkFont FONT"
+$OPTIONS add command -label "font for a specific mode" -command "mkFont MFONT"
+
+
+$OPTIONS add command -label "geometry options" -command "mkGeometry"
+$OPTIONS add command -label "file options" -command "mkFileOption"
+$OPTIONS add command -label "message options" -command "mkMessage"
+
+#Color
+menubutton .menu.button4 -text "color" -menu .menu.button4.color
+menu .menu.button4.color
+set COLOR .menu.button4.color
+#if {$tk_version < 4} then {
+#$COLOR add command -label "foreground options for password" -command "mkColor FG"
+#$COLOR add command -label "background options for password" -command "mkColor BG"
+#}
+#else {
+$COLOR add command -label "foreground options for password" -command "tk_chooseColor"
+$COLOR add command -label "background options for password" -command "tk_chooseColor"
+#}
+menubutton .menu.button3 -text "help" -menu .menu.button3.help
+menu .menu.button3.help
+set HELP .menu.button3.help
+$HELP add command -label "about xlock" -command "Helpxlock"
+$HELP add command -label "about author" -command "mkAuthor"
+
+pack .menu.buttonf .menu.button  .menu.button2 .menu.button4 -side left
+pack .menu.button3 -side right
+
+#---------------------------
+#creation de la liste
+#---------------------------
+frame .listscrol -borderwidth 4 -relief ridge
+set LISTSCROL .listscrol
+scrollbar $LISTSCROL.scroll -relief sunken -command "$LISTSCROL.list yview"
+listbox $LISTSCROL.list -yscroll  "$LISTSCROL.scroll set"
+
+#---------------------------
+#insert all modes in list
+#---------------------------
+$LISTSCROL.list  insert 0 \
+$%LISTTCLbomb\
+random
+
+pack $LISTSCROL.scroll -side right -fill y
+pack $LISTSCROL.list -side left -expand yes -fill both
+pack $LISTSCROL  -fill both -expand yes
+
+frame .buttons -borderwidth 4 -relief ridge
+set BUTTON .buttons
+button $BUTTON.launch -text "Launch"  -command "Affopts 0"
+button $BUTTON.launchinW -text "Launch in Window" -command "Affopts 1"
+button $BUTTON.launchinR -text "Launch in Root" -command "Affopts 2"
+button $BUTTON.quit -text Quit -command "exit"
+pack  $BUTTON.launch $BUTTON.launchinW $BUTTON.launchinR -side left
+pack $BUTTON.quit -side right
+pack $BUTTON -fill x -side bottom
diff --git a/etc/genlauncher/guibuild.pl b/etc/genlauncher/guibuild.pl
new file mode 100755 (executable)
index 0000000..c973cc8
--- /dev/null
@@ -0,0 +1,296 @@
+#!/usr/bin/perl
+
+#------------------------------------------------------------------------------
+#  @(#)genbuild.pl 4.0 2000/01/21 xlockmore
+#
+#  mode management include file generator for xlock
+#
+#  Originally written in korn shell and lex and yacc by
+#  Charles Vidal (make.launcher)
+#  Copyright (c) by Charles Vidal
+#
+#  See xlock.c for copying information.
+#
+#  Revision History:
+#
+#  21-Jan-2000: converted to perl by David Bagley, for ease adding to list
+#  10-Oct-1999: xglock generation  by Eric Lassauge <lassauge@mail.dotcom.fr>
+#  ??-???-??: Written by Charles Vidal <vidalc@club-internet.fr>
+#
+#------------------------------------------------------------------------------
+
+my(@GUI_LIST) = (
+  "MOTIF,xmlock.modes.tpl,../../xmlock/modes.h,1",
+  "GTK,xglock.modes.tpl,../../xglock/modes.h,1",
+  "TCL,etc.xlock.tcl,../xlock.tcl,0",
+  "JAVA,etc.xlock.java,../xlockFrame.java,0");
+my($GUI_NAME, $GUI_TPL, $GUI_FILE, $GUI_BUILD);
+my($GUI, $PROG, $CMD, $LIB);
+
+$datafile = "lmode.h";
+
+$PROG=xlockgen;
+if (-x "$PROG") {
+  foreach $GUI (@GUI_LIST) {
+    ($GUI_NAME, $GUI_TPL, $GUI_FILE, $GUI_BUILD) = split (/,/, $GUI);
+#    print("$GUI_NAME, $GUI_TPL, $GUI_FILE, $GUI_BUILD\n");
+#    print "make $GUI_NAME in 2 passes:\n";
+    print "generating $GUI_NAME\n";
+    if (-w "$GUI_FILE") {
+      if (-r "$GUI_TPL") {
+        $CMD="cat $GUI_TPL | ./xlockgen > $GUI_FILE";
+        print "$CMD\n";
+        `$CMD`;
+        if ($GUI_BUILD) {
+          print "Can now build $GUI_NAME.\n";
+        } else {
+          print "$GUI_NAME program now configured.\n";
+        }
+      } else {
+        print "Could not open $GUI_TPL for reading\n";
+      }
+    } else {
+      print "Could not open $GUI_FILE for writing\n";
+    }
+  }
+} else {
+  print "Could not execute $PROG, maybe it needs to be compiled?\n";
+  print " using lex: gcc lex.yy.c -o $PROG -ll\n";
+  print " using flex: gcc lex.yy.c -o $PROG -lfl\n";
+}
+
+
+
+exit;
+
+# this other code does the same thing without lex
+foreach $GUI (@GUI_LIST) {
+  ($GUI_NAME, $GUI_TPL, $GUI_FILE, $GUI_BUILD) = split (/,/, $GUI);
+  print "generating $GUI_NAME\n";
+  if (-w "$GUI_FILE") {
+    if (-r "$GUI_TPL") {
+      if ($GUI_NAME eq "MOTIF") {
+        &buildmotif ($GUI_NAME, $GUI_TPL, $datafile, $GUI_FILE,);
+      } elsif ($GUI_NAME eq "GTK") {
+        &buildgtk ($GUI_NAME, $GUI_TPL, $datafile, $GUI_FILE,);
+      } elsif ($GUI_NAME eq "TCL") {
+        &buildtcl ($GUI_NAME, $GUI_TPL, $datafile, $GUI_FILE);
+      } elsif ($GUI_NAME eq "JAVA") {
+        &buildjava ($GUI_NAME, $GUI_TPL, $datafile, $GUI_FILE);
+      }
+      print "can now build $GUI_NAME\n";
+    } else {
+      print "Could not open $GUI_TPL for reading\n";
+    }
+  } else {
+    print "Could not open $GUI_FILE for writing\n";
+  }
+}
+
+# to help adminitration and utils for launcher(s)
+# this file replace token by all modes token :
+# LISTMOTIF, LISTTCL, LISTGTK
+# utils :
+
+@Gui_Types=(
+  "\$\%LISTMOTIF", "\$\%LISTGTK",
+  "\$\%LISTTCL", "\$\%LISTJAVA");
+
+
+sub buildmotif
+{
+  $name = $_[0];
+  $templatefile = $_[1];
+  $datafile = $_[2];
+  $outfile = $_[3];
+
+  open(TEMPLATE, "<$templatefile") || die("Could not open $templatefile for reading");
+  open(OUTFILE, ">$outfile") || die("Could not open $outfile for writing");
+  while (<TEMPLATE>) {
+    if (/^.*LISTMOTIF(.*)/) {
+      $restOfLine = "$1\n";
+      $_ = "$1\n";
+      open(DATA, "<$datafile") || die("Could not open $datafile for reading");
+      $instruct = 0;
+      while(<DATA>) {
+        chop();
+        if ($instruct) {
+          if (/^.*};/) {
+            $instruct = 0;
+          } else {
+            if ($mode == 0) {
+              if (/^\s*{\"(.*)\",/) {
+                $name = $1;
+                $mode++;
+              }
+            } elsif ($mode == 1) {
+              $mode++;
+            } else {
+              if (/^\s*\"(.*)\",.*,\s*"(.*)"}/) {
+                print OUTFILE "\(char \*\) $2\n{\"$name\", \(char \*\) \"$1\"},\n#endif\n";
+              } elsif (/^\s*\"(.*)\",.*,\s*(.*)}/) { #NULL
+                print OUTFILE "{\(char \*\) \"$name\", \(char \*\) \"$1\"},\n";
+              } else {
+                print OUTFILE "#$_#\n";
+              }
+              $mode = 0;
+            }
+          }
+        } else {
+          if (/^.*LockProcs\[\]\s*=/) {
+            $instruct = 1;
+            $mode = 0;
+          }
+        }
+      }
+      close(DATA);
+      $_ = $restOfLine;
+    }
+    print OUTFILE "$_";
+  }
+  close(TEMPLATE);
+  close(OUTFILE);
+}
+
+sub buildgtk
+{
+  $name = $_[0];
+  $templatefile = $_[1];
+  $datafile = $_[2];
+  $outfile = $_[3];
+
+  open(TEMPLATE, "<$templatefile") || die("Could not open $templatefile for reading");
+  open(OUTFILE, ">$outfile") || die("Could not open $outfile for writing");
+  while (<TEMPLATE>) {
+    if (/^.*LISTGTK(.*)/) {
+      $restOfLine = "$1\n";
+      $_ = "$1\n";
+      open(DATA, "<$datafile") || die("Could not open $datafile for reading");
+      $instruct = 0;
+      while(<DATA>) {
+        chop();
+        if ($instruct) {
+          if (/^.*};/) {
+            $instruct = 0;
+          } else {
+            if ($mode == 0) {
+              if (/^\s*{\"(.*)\",/) {
+                $name = $1;
+                $mode++;
+              }
+            } elsif ($mode == 1) {
+              if (/^\s*(.*),\s*(.*),\s(.*),\s*(.*),\s(.*),\s(.*),/) {
+                $delay = $1;
+                $count = $2;
+                $cycles = $3;
+                $saturation = $5;
+              }
+              $mode++;
+            } else {
+              if (/^\s*\"(.*)\",.*,\s*"(.*)"}/) {
+                print OUTFILE "$2\n  {\"$name\",\n";
+                print OUTFILE "   $delay, $count, $cycles, $saturation,\n";
+                print OUTFILE "   \"$1\", (void *) NULL},\n#endif\n";
+              } elsif (/^\s*\"(.*)\",.*,\s*(.*)}/) { #NULL
+                print OUTFILE "  {\"$name\",\n";
+                print OUTFILE "   $delay, $count, $cycles, $saturation,\n";
+                print OUTFILE "   \"$1\", (void *) NULL},\n";
+              } else {
+                print OUTFILE "#$_#\n";
+              }
+              $mode = 0;
+            }
+          }
+        } else {
+          if (/^.*LockProcs\[\]\s*=/) {
+            $instruct = 1;
+            $mode = 0;
+          }
+        }
+      }
+      close(DATA);
+      $_ = $restOfLine;
+    }
+    print OUTFILE "$_";
+  }
+  close(TEMPLATE);
+  close(OUTFILE);
+}
+
+sub buildtcl
+{
+  $name = $_[0];
+  $templatefile = $_[1];
+  $datafile = $_[2];
+  $outfile = $_[3];
+
+  open(TEMPLATE, "<$templatefile") || die("Could not open $templatefile for reading");
+  open(OUTFILE, ">$outfile") || die("Could not open $outfile for writing");
+  while (<TEMPLATE>) {
+    if (/^.*LISTTCL(.*)/) {
+      $restOfLine = "$1\n";
+      $_ = "$1\n";
+      open(DATA, "<$datafile") || die("Could not open $datafile for reading");
+      $instruct = 0;
+      while(<DATA>) {
+        if ($instruct) {
+          if (/^.*};/) {
+            $instruct = 0;
+          } else {
+            if (/^\s*{\"(.*)\",/) {
+              print OUTFILE "$1\\\n";
+            }
+          }
+        } else {
+          if (/^.*LockProcs\[\]\s*=/) {
+            $instruct = 1;
+          }
+        }
+      }
+      close(DATA);
+      $_ = $restOfLine;
+    }
+    print OUTFILE "$_";
+  }
+  close(TEMPLATE);
+  close(OUTFILE);
+}
+
+sub buildjava
+{
+  $name = $_[0];
+  $templatefile = $_[1];
+  $datafile = $_[2];
+  $outfile = $_[3];
+
+  open(TEMPLATE, "<$templatefile") || die("Could not open $templatefile for reading");
+  open(OUTFILE, ">$outfile") || die("Could not open $outfile for writing");
+  while (<TEMPLATE>) {
+    if (/^.*LISTJAVA(.*)/) {
+      $restOfLine = "$1\n";
+      $_ = "$1\n";
+      open(DATA, "<$datafile") || die("Could not open $datafile for reading");
+      $instruct = 0;
+      while(<DATA>) {
+        if ($instruct) {
+          if (/^.*};/) {
+            $instruct = 0;
+          } else {
+            if (/^\s*{\"(.*)\",/) {
+              print OUTFILE "lst.addItem(\"$1\");\n";
+            }
+          }
+        } else {
+          if (/^.*LockProcs\[\]\s*=/) {
+            $instruct = 1;
+          }
+        }
+      }
+      close(DATA);
+      $_ = $restOfLine;
+    }
+    print OUTFILE "$_";
+  }
+  close(TEMPLATE);
+  close(OUTFILE);
+}
diff --git a/etc/genlauncher/lmode.h b/etc/genlauncher/lmode.h
new file mode 100644 (file)
index 0000000..82dc5aa
--- /dev/null
@@ -0,0 +1,457 @@
+/*-
+ * @(#)mode.h 4.00 97/01/01 xlockmore
+ *
+ * mode.h - mode management for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 18-Mar-96: Ron Hitchens <ron@idiom.com>
+ *    Extensive revision to define new data types for
+ *    the new mode calling scheme.
+ * 02-Jun-95: Extracted out of resource.c.
+ *
+ */
+
+/*-
+ * Declare external interface routines for supported screen savers.
+ */
+
+/* -------------------------------------------------------------------- */
+
+#define HAVE_CXX
+#define USE_XPM
+#define USE_GL
+#define USE_UNSTABLE
+#define USE_BOMB
+#define HAVE_TTF
+#define HAVE_GLTT
+
+typedef struct {
+       int      dummy;
+} ModeSpecOpt;
+
+struct LockStruct_s;
+struct ModeInfo_s;
+
+typedef void (ModeHook) (struct ModeInfo_s *);
+typedef void (HookProc) (struct LockStruct_s *, struct ModeInfo_s *);
+
+typedef struct LockStruct_s {
+       char       *cmdline_arg;        /* mode name */
+#if 0
+       char       *init_hook;  /* func to init a mode */
+       char       *callback_hook;      /* func to run (tick) a mode */
+       char       *release_hook;       /* func to shutdown a mode */
+       char       *refresh_hook;       /* tells mode to repaint */
+       char       *change_hook;        /* user wants mode to change */
+       char       *unused_hook;        /* for future expansion */
+       ModeSpecOpt *msopt;     /* this mode's def resources */
+#endif
+       int      def_delay;     /* default delay for mode */
+       int      def_count;
+       int      def_cycles;
+       int      def_size;
+       int      def_ncolors;
+       float       def_saturation;
+       char       *def_bitmap;
+       char       *desc;       /* text description of mode */
+       unsigned int flags;     /* state flags for this mode */
+       void       *userdata;   /* for use by the mode */
+       char       *define;
+} LockStruct;
+
+LockStruct  LockProcs[] =
+{
+       {"ant",
+        1000, -3, 40000, -7, 64, 1.0, "",
+        "Shows Langton's and Turk's generalized ants", 0, NULL, NULL},
+#ifdef USE_GL
+       {"atlantis",
+        18000, 4, 100, 6000, 64, 1.0, "",
+        "Shows moving sharks/whales/dolphin", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"ball",
+        10000, 10, 20, -100, 64, 1.0, "",
+        "Shows bouncing balls", 0, NULL, NULL},
+       {"bat",
+        100000, -8, 1, 0, 64, 1.0, "",
+        "Shows bouncing flying bats", 0, NULL, NULL},
+       {"blot",
+        200000, 6, 30, 1, 64, 0.3, "",
+        "Shows Rorschach's ink blot test", 0, NULL, NULL},
+       {"bouboule",
+        10000, 100, 1, 15, 64, 1.0, "",
+        "Shows Mimi's bouboule of moving stars", 0, NULL, NULL},
+       {"bounce",
+        5000, -10, 1, 0, 64, 1.0, "",
+        "Shows bouncing footballs", 0, NULL, NULL},
+       {"braid",
+        1000, 15, 100, -7, 64, 1.0, "",
+        "Shows random braids and knots", 0, NULL, NULL},
+       {"bubble",
+        100000, 25, 1, 100, 64, 0.6, "",
+        "Shows popping bubbles", 0, NULL, NULL},
+#if defined( USE_GL ) && defined( HAVE_CXX )
+       {"bubble3d",
+        1000, 1, 2, 1, 64, 1.0, "",
+        "Richard Jones's GL bubbles", 0, NULL, "#if defined( USE_GL ) && defined( HAVE_CXX )"},
+#endif
+       {"bug",
+        75000, 10, 32767, -4, 64, 1.0, "",
+        "Shows Palmiter's bug evolution and garden of Eden", 0, NULL, NULL},
+#ifdef USE_GL
+       {"cage",
+        25000, 1, 1, 1, 64, 1.0, "",
+        "Shows the Impossible Cage, an Escher-like GL scene", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"clock",
+        100000, -16, 200, -200, 64, 1.0, "",
+        "Shows Packard's clock", 0, NULL, NULL},
+       {"coral",
+        60000, -3, 1, 35, 64, 0.6, "",
+        "Shows a coral reef", 0, NULL, NULL},
+       {"crystal",
+        60000, -500, 200, -15, 64, 1.0, "",
+        "Shows polygons in 2D plane groups", 0, NULL, NULL},
+       {"daisy",
+        100000, 300, 350, 1, 64, 1.0, "",
+        "Shows a meadow of daisies", 0, NULL, NULL},
+       {"dclock",
+        10000, 1, 10000, 1, 64, 0.3, "",
+        "Shows a floating digital clock or message", 0, NULL, NULL},
+       {"decay",
+        200000, 6, 30, 1, 64, 0.3, "",
+        "Shows a decaying screen", 0, NULL, NULL},
+       {"deco",
+        1000000, -30, 2, -10, 64, 0.6, "",
+        "Shows art as ugly as sin", 0, NULL, NULL},
+       {"demon",
+        50000, 0, 1000, -7, 64, 1.0, "",
+        "Shows Griffeath's cellular automata", 0, NULL, NULL},
+       {"dilemma",
+        200000, -2, 1000, 0, 64, 1.0, "",
+        "Shows Lloyd's Prisoner's Dilemma simulation", 0, NULL, NULL},
+       {"dragon",
+        2000000, 1, 16, -24, 64, 1.0, "",
+        "Shows Deventer's Hexagonal Dragons Maze", 0, NULL, NULL},
+       {"discrete",
+        1000, 4096, 2500, 1, 64, 1.0, "",
+        "Shows various discrete maps", 0, NULL, NULL},
+       {"drift",
+        10000, 30, 1, 1, 64, 1.0, "",
+        "Shows cosmic drifting flame fractals", 0, NULL, NULL},
+       {"euler2d",
+        1000, 1024, 3000, 1, 64, 1.0, "",
+        "Shows a simulation of 2D incompressible inviscid fluid", 0, NULL, NULL},
+       {"eyes",
+        20000, -8, 5, 1, 64, 1.0, "",
+        "Shows eyes following a bouncing grelb", 0, NULL, NULL},
+       {"fadeplot",
+        30000, 10, 1500, 1, 64, 0.6, "",
+        "Shows a fading plot of sine squared", 0, NULL, NULL},
+#ifdef USE_GL
+       {"fire",
+        10000, 800, 1, 1, 64, 1.0, "",
+        "Shows a 3D fire-like image", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"flag",
+        50000, 1, 1000, -7, 64, 1.0, "",
+        "Shows a waving flag image", 0, NULL, NULL},
+       {"flame",
+        750000, 20, 10000, 1, 64, 1.0, "",
+        "Shows cosmic flame fractals", 0, NULL, NULL},
+       {"flow",
+        1000, 1024, 3000, 1, 64, 1.0, "",
+        "Shows dynamic strange attractors", 0, NULL, NULL},
+       {"forest",
+        400000, 100, 200, 1, 64, 1.0, "",
+        "Shows binary trees of a fractal forest", 0, NULL, NULL},
+       {"galaxy",
+        100, -5, 250, -3, 64, 1.0, "",
+        "Shows crashing spiral galaxies", 0, NULL, NULL},
+#ifdef USE_GL
+       {"gears",
+        1000, 1, 2, 1, 64, 1.0, "",
+        "Shows GL's gears", 0, NULL, "#ifdef USE_GL"},
+#endif
+#ifdef USE_GL
+       {"glplanet",
+        1000, 1, 2, 1, 64, 1.0, "",
+        "Animates texture mapped sphere (planet)", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"goop",
+        10000, -12, 1, 1, 64, 1.0, "",
+        "Shows goop from a lava lamp", 0, NULL, NULL},
+       {"grav",
+        10000, -12, 1, 1, 64, 1.0, "",
+        "Shows orbiting planets", 0, NULL, NULL},
+       {"helix",
+        25000, 1, 100, 1, 64, 1.0, "",
+        "Shows string art", 0, NULL, NULL},
+       {"hop",
+        10000, 1000, 2500, 1, 64, 1.0, "",
+        "Shows real plane iterated fractals", 0, NULL, NULL},
+       {"hyper",
+        100000, -6, 300, 1, 64, 1.0, "",
+        "Shows spinning n-dimensional hypercubes", 0, NULL, NULL},
+       {"ico",
+        100000, 0, 400, 0, 64, 1.0, "",
+        "Shows a bouncing polyhedron", 0, NULL, NULL},
+       {"ifs",
+        1000, 1, 1, 1, 64, 1.0, "",
+        "Shows a modified iterated function system", 0, NULL, NULL},
+       {"image",
+        3000000, -20, 1, 1, 64, 1.0, "",
+        "Shows randomly appearing logos", 0, NULL, NULL},
+#if defined( USE_GL ) && defined( HAVE_CXX )
+       {"invert",
+        100, 1, 1, 1, 64, 1.0, "",
+        "Shows a sphere inverted without wrinkles", 0, NULL, "#if defined( USE_GL ) && defined( HAVE_CXX )"},
+#endif
+        {"juggle",
+         10000, 150, 30, 1, 64, 1.0, "",
+         "Shows a Juggler, juggling", 0, NULL, NULL},
+       {"julia",
+        10000, 1000, 20, 1, 64, 1.0, "",
+        "Shows the Julia set", 0, NULL, NULL},
+       {"kaleid",
+        80000, 4, 40, -9, 64, 0.6, "",
+        "Shows a kaleidoscope", 0, NULL, NULL},
+       {"kumppa",
+        10000, 1, 1, 1, 64, 1.0, "",
+        "Shows kumppa", 0, NULL, NULL},
+#ifdef USE_GL
+       {"lament",
+        10000, 1, 1, 1, 64, 1.0, "",
+        "Shows Lemarchand's Box", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"laser",
+        20000, -10, 200, 1, 64, 1.0, "",
+        "Shows spinning lasers", 0, NULL, NULL},
+       {"life",
+        750000, 40, 140, 0, 64, 1.0, "",
+        "Shows Conway's game of Life", 0, NULL, NULL},
+       {"life1d",
+        10000, 1, 10, 0, 64, 1.0, "",
+        "Shows Wolfram's game of 1D Life", 0, NULL, NULL},
+       {"life3d",
+        1000000, 35, 85, 1, 64, 1.0, "",
+        "Shows Bays' game of 3D Life", 0, NULL, NULL},
+       {"lightning",
+        10000, 1, 1, 1, 64, 0.6, "",
+        "Shows Keith's fractal lightning bolts", 0, NULL, NULL},
+       {"lisa",
+        25000, 1, 256, -1, 64, 1.0, "",
+        "Shows animated lisajous loops", 0, NULL, NULL},
+       {"lissie",
+        10000, 1, 2000, -200, 64, 0.6, "",
+        "Shows lissajous worms", 0, NULL, NULL},
+       {"loop",
+        100000, -5, 1600, -12, 64, 1.0, "",
+        "Shows Langton's self-producing loops", 0, NULL, NULL},
+       {"lyapunov",
+        25000, 600, 1, 1, 64, 1.0, "",
+        "Shows lyapunov space", 0, NULL, NULL},
+       {"mandelbrot",
+        25000, -8, 20000, 1, 64, 1.0, "",
+        "Shows mandelbrot sets", 0, NULL, NULL},
+       {"marquee",
+        100000, 1, 1, 1, 64, 1.0, "",
+        "Shows messages", 0, NULL, NULL},
+       {"matrix",
+        100, 1, 1, 1, 64, 1.0, "",
+        "Shows the matrix", 0, NULL, NULL},
+       {"maze",
+        1000, 1, 3000, -40, 64, 1.0, "",
+     "Shows a random maze and a depth first search solution", 0, NULL, NULL},
+#ifdef USE_GL
+       {"moebius",
+        1000, 1, 1, 1, 64, 1.0, "",
+        "Shows Moebius Strip II, an Escher-like GL scene with ants", 0, NULL, "#ifdef USE_GL"},
+       {(char *) "molecule",
+        50000, 1, 20, 1, 64, 1.0, "",
+        "Draws molecules", 0, NULL, "#ifdef USE_GL"},
+       {"morph3d",
+        1000, 0, 1, 1, 64, 1.0, "",
+        "Shows GL morphing polyhedra", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"mountain",
+        1000, 30, 4000, 1, 64, 1.0, "",
+        "Shows Papo's mountain range", 0, NULL, NULL},
+       {"munch",
+        5000, 1, 7, 1, 64, 1.0, "",
+        "Shows munching squares", 0, NULL, NULL},
+       {"nose",
+        100000, 1, 1, 1, 64, 1.0, "",
+        "Shows a man with a big nose runs around spewing out messages", 0, NULL, NULL},
+       {"pacman",
+        100000, 10, 1, 0, 64, 1.0, "",
+        "Shows Pacman(tm)", 0, NULL, NULL},
+       {"penrose",
+        10000, 1, 1, -40, 64, 1.0, "",
+        "Shows Penrose's quasiperiodic tilings", 0, NULL, NULL},
+       {"petal",
+        10000, -500, 400, 1, 64, 1.0, "",
+        "Shows various GCD Flowers", 0, NULL, NULL},
+#ifdef USE_GL
+       {"pipes",
+        1000, 2, 5, 500, 64, 1.0, "",
+        "Shows a selfbuilding pipe system", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"polyominoes",
+        6000, 1, 8192, 1, 64, 1.0, "",
+        "Shows attempts to place polyominoes into a rectangle", 0, NULL, NULL},
+       {"puzzle",
+        10000, 250, 1, 1, 64, 1.0, "",
+        "Shows a puzzle being scrambled and then solved", 0, NULL, NULL},
+       {"pyro",
+        15000, 100, 1, -3, 64, 1.0, "",
+        "Shows fireworks", 0, NULL, NULL},
+       {"qix",
+        30000, -5, 32, 1, 64, 1.0, "",
+        "Shows spinning lines a la Qix(tm)", 0, NULL, NULL},
+       {"roll",
+        100000, 25, 1, -64, 64, 0.6, "",
+        "Shows a rolling ball", 0, NULL, NULL},
+       {"rotor",
+        100, 4, 100, -6, 64, 0.3, "",
+        "Shows Tom's Roto-Rooter", 0, NULL, NULL},
+#ifdef USE_GL
+       {"rubik",
+        10000, -30, 5, -6, 64, 1.0, "",
+        "Shows an auto-solving Rubik's Cube", 0, NULL, "#ifdef USE_GL"},
+#endif
+#ifdef USE_GL
+       {"sballs",
+        10000, 0, 10, 400, 64, 1.0, "",
+        "Balls spinning like crazy in GL", 0, NULL, "#ifdef USE_GL"},
+#endif
+        {"scooter",
+         20000, 24, 3, 100, 64, 1.0, "",
+         "Shows a journey through space tunnel and stars", 0, NULL, NULL},
+       {"shape",
+        10000, 100, 256, 1, 64, 1.0, "",
+        "Shows stippled rectangles, ellipses, and triangles", 0, NULL, NULL},
+       {"sierpinski",
+        400000, 2000, 100, 1, 64, 1.0, "",
+        "Shows Sierpinski's triangle", 0, NULL, NULL},
+#ifdef USE_GL
+       {"sierpinski3d",
+         1000, 1, 2, 1, 64, 1.0, "",
+         "Shows GL's Sierpinski gasket", 0, NULL, "#ifdef USE_GL"},
+#endif
+#if defined(USE_GL) && defined( USE_UNSTABLE )
+       {"skewb",
+        10000, -30, 5, 1, 64, 1.0, "",
+        "Shows an auto-solving Skewb", 0, NULL, "#if defined(USE_GL) && defined( USE_UNSTABLE )"},
+#endif
+       {"slip",
+        50000, 35, 50, 1, 64, 1.0, "",
+        "Shows slipping blits", 0, NULL, NULL},
+#ifdef HAVE_CXX
+       {"solitare",
+        2000000, 1, 1, 1, 64, 1.0, "",
+        "Shows Klondike's game of solitare", 0, NULL, "#ifdef HAVE_CXX"},
+#endif
+       {"space",
+        10000, 100, 1, 15, 64, 1.0, "",
+        "Shows a journey into deep space", 0, NULL, "#ifdef USE_UNSTABLE"},
+       {"sphere",
+        5000, 1, 20, 0, 64, 1.0, "",
+        "Shows a bunch of shaded spheres", 0, NULL, NULL},
+       {"spiral",
+        5000, -40, 350, 1, 64, 1.0, "",
+        "Shows a helical locus of points", 0, NULL, NULL},
+       {"spline",
+        30000, -6, 2048, 1, 64, 0.3, "",
+        "Shows colorful moving splines", 0, NULL, NULL},
+#ifdef USE_GL
+       {"sproingies",
+        1000, 5, 0, 400, 64, 1.0, "",
+        "Shows Sproingies!  Nontoxic.  Safe for pets and small children", 0, NULL, "#ifdef USE_GL"},
+       {"stairs",
+        200000, 0, 1, 1, 64, 1.0, "",
+"Shows some Infinite Stairs, an Escher-like scene", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"star",
+        75000, 100, 1, 100, 64, 0.3, "",
+        "Shows a star field with a twist", 0, NULL, NULL},
+       {"starfish",
+        10000, 1, 1, 1, 64, 1.0, "",
+        "Shows starfish", 0, NULL, NULL},
+       {"strange",
+        1000, 1, 1, 1, 64, 1.0, "",
+        "Shows strange attractors", 0, NULL, NULL},
+#ifdef USE_GL
+       {"superquadrics",
+        1000, 25, 40, 1, 64, 1.0, "",
+        "Shows 3D mathematical shapes", 0, NULL, "#ifdef USE_GL"},
+#endif
+       {"swarm",
+        15000, -100, 1, -100, 64, 1.0, "",
+        "Shows a swarm of bees following a wasp", 0, NULL, NULL},
+       {"swirl",
+        5000, 5, 1, 1, 64, 1.0, "",
+        "Shows animated swirling patterns", 0, NULL, NULL},
+       {"t3d",
+        250000, 1000, 60000, 0, 64, 1.0, "",
+        "Shows a Flying Balls Clock Demo", 0, NULL, NULL},
+       {"tetris",
+        50000, 1, 1, -100, 64, 1.0, "",
+        "Shows an autoplaying tetris game", 0, NULL, NULL},
+#if defined(USE_GL) && defined(HAVE_CXX) && defined( HAVE_TTF ) && defined( HAVE_GLTT ) && defined( USE_UNSTABLE )
+       {"text3d",
+        100000, 1, 1, 1, 64, 1.0, "",
+        "Shows 3D text", 0, NULL, "#if defined(USE_GL) && defined(HAVE_CXX) && defined( HAVE_TTF ) && defined( HAVE_GLTT ) && defined( USE_UNSTABLE )"},
+#endif
+       {"thornbird",
+        1000, 800, 16, 1, 64, 1.0, "",
+        "Shows an animated bird in a thorn bush fractal map", 0, NULL, NULL},
+       {"tik_tak",
+        60000, -20, 200, -1000, 64, 1.0, "",
+        "Shows rotating polygons", 0, NULL, NULL},
+       {"triangle",
+        10000, 1, 1, 1, 64, 1.0, "",
+        "Shows a triangle mountain range", 0, NULL, NULL},
+       {"tube",
+        25000, -9, 20000, -200, 64, 1.0, "",
+        "Shows an animated tube", 0, NULL, NULL},
+       {"turtle",
+        1000000, 1, 20, 1, 64, 1.0, "",
+        "Shows turtle fractals", 0, NULL, NULL},
+       {"vines",
+        200000, 0, 1, 1, 64, 1.0, "",
+        "Shows fractals", 0, NULL, NULL},
+       {"voters",
+        1000, 0, 327670, 0, 64, 1.0, "",
+        "Shows Dewdney's Voters", 0, NULL, NULL},
+       {"wator",
+        750000, 1, 32767, 0, 64, 1.0, "",
+     "Shows Dewdney's Water-Torus planet of fish and sharks", 0, NULL, NULL},
+       {"wire",
+        500000, 1000, 150, -8, 64, 1.0, "",
+        "Shows a random circuit with 2 electrons", 0, NULL, NULL},
+       {"world",
+        100000, -16, 1, 1, 64, 0.3, "",
+        "Shows spinning Earths", 0, NULL, NULL},
+       {"worm",
+        17000, -20, 10, -3, 64, 1.0, "",
+        "Shows wiggly worms", 0, NULL, NULL},
+       {"xcl",
+        20000, -3, 1, 1, 64, 1.0, "",
+        "Shows a control line combat model race", 0, NULL, NULL},
+       {"xjack",
+        50000, 1, 1, 1, 64, 1.0, "",
+        "Shows Jack having one of those days", 0, NULL, NULL},
+
+/* SPECIAL MODES */
+       {"blank",
+        3000000, 1, 1, 1, 64, 1.0, "",
+        "Shows nothing but a black screen", 0, NULL, NULL}
+
+};
diff --git a/etc/genlauncher/xglock.modes.tpl b/etc/genlauncher/xglock.modes.tpl
new file mode 100644 (file)
index 0000000..8cbc66c
--- /dev/null
@@ -0,0 +1,276 @@
+/*-
+ * @(#)modes.h 4.01 2000/01/28 xlockmore
+ *
+ * modes.h - mode management for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 10-Oct-1999: Generated by genlauncher.
+ *              Adapted by Eric Lassauge <lassauge@mail.dotcom.fr>
+ * 08-Jul-1998: Adapted to xglock from mode.h by Remi Cohen-Scali
+ *              <remi.cohenscali@pobox.com>
+ *
+ */
+
+/*-
+ * Declare external interface routines for supported screen savers.
+ */
+
+#ifndef _LMODE_H_
+#define _LMODE_H_
+
+/* -------------------------------------------------------------------- */
+
+typedef struct LockStruct_s {
+       gchar       *cmdline_arg;       /* mode name */
+       gint         def_delay;         /* default delay for mode */
+       gint         def_batchcount;
+       gint         def_cycles;
+       gint         def_size;
+       gfloat       def_saturation;
+       gchar       *desc;              /* text description of mode */
+       void        *userdata;          /* for use by the mode */
+} LockStruct;
+
+LockStruct  LockProcs[] =
+{
+$%LISTGTK#ifdef USE_BOMB
+       {"bomb",
+        100000, 10, 20, 1, 1.0,
+        "Shows a bomb and will autologout after a time", (void *) NULL},
+       {"random",
+        1, 1, 1, 1, 1.0,
+        "Shows a random mode from above except blank and bomb", (void *) NULL},
+#else
+       {"random",
+        1, 1, 1, 1, 1.0,
+        "Shows a random mode from above except blank", (void *) NULL},
+#endif
+};
+
+/* Number of modes (set in main) */
+guint nb_mode = 0;
+
+/* Defaults values available */
+#define DEF_DELAY              0
+#define DEF_BATCHCOUNT         1
+#define DEF_CYCLES             2
+#define DEF_SIZE               3
+#define DEF_SATURATION         4
+#define NB_DEFAULTED_OPTIONS   5
+
+/* Default values options names */
+static gchar *defaulted_options[NB_DEFAULTED_OPTIONS] = {
+  "delay",
+  "batchcount",
+  "cycles",
+  "size",
+  "saturation"};
+
+/* Number of default values options */
+static guint nb_defaultedOptions = NB_DEFAULTED_OPTIONS;
+
+/*------------------------------------*/
+/*       Boolean xlock options        */
+/*------------------------------------*/
+
+/* boolean option entry */
+typedef struct struct_option_bool_s {
+       gchar       *cmdarg;
+       gchar       *label;
+       gchar       *desc;
+       gchar          defval;
+       gchar        value;
+} struct_option_bool;
+
+/* Description of the boolean options */
+struct_option_bool BoolOpt[] =
+{
+  {"mono", "mono", "The mono option causes xlock to display monochrome", '\000', '\000'},
+  {"nolock", "nolock", "The nolock option causes xlock to only draw the patterns and not lock the display", '\000', '\000'},
+  {"remote", "remote", "The remote option causes xlock to not stop you from locking remote X11 server", '\000', '\000'},
+  {"allowroot", "allowroot", "The allowroot option allow the root password to unlock the server", '\000', '\000'},
+  {"enablesaver", "enablesaver", "This option enables the use of the normal Xserver screen saver", '\000', '\000'},
+  {"resetsaver", "resetsaver", "This option enables the call of XResetScreenSaver", '\000', '\000'},
+  {"allowaccess", "allowaccess", "For servers not allowing clients to modify host access, left the X11 server open", '\000', '\000'},
+#ifdef USE_VTLOCK
+  {"lockvt", "lockvt", "This option control the VT switch locking", '\000', '\000'},
+#endif
+  {"mousemotion", "mousemotion", "Allows to turn on/off the mouse sensitivity to bring up pass window", '\001', '\000'},
+  {"grabmouse", "grabmouse", "This option causes xlock to grab mouse and keyboard", '\001', '\000'},
+  {"grabserver", "grabserver", "The grabserver option causes xlock to grab the server", '\001', '\000'},
+  {"echokeys", "echokeys", "This option causes xlock to echo a question mark for each typed character", '\000', '\000'},
+  {"usefirst", "usefirst", "This option enables xlock to use the first keystroke in the password", '\000', '\000'},
+  {"verbose", "verbose", "verbose launch", '\000', '\000'},
+  {"debug", "debug", "This option allows xlock to be locked in a window", '\000', '\000'},
+  {"wireframe", "wireframe", "This option turns on wireframe rendering mode mainly for GL", '\000', '\000'},
+#ifdef USE_GL
+  {"showfps", "showfps", "This option turns on frame per sec display for GL", '\000', '\000'},
+  {"fpstop", "fpstop", "This option turns on top fps display for GL", '\000', '\000'},
+#endif
+  {"install", "install", "Allows xlock to install its own colormap if xlock runs out of colors", '\000', '\000'},
+  {"sound", "sound", "Allows you to turn on and off sound if installed with the capability", '\000', '\000'},
+  {"timeelapsed", "timeelapsed", "Allows you to find out how long a machine is locked", '\000', '\000'},
+  {"fullrandom", "fullrandom", "Turn on/off randomness options within modes", '\000', '\000'},
+  {"use3d", "use3d", "Turn on/off 3d view, available on bouboule, pyro, star, and worm", '\000', '\000'},
+  {"trackmouse", "trackmouse", "Turn on and off mouse interaction in eyes, julia, and swarm", '\000', '\000'},
+#if 0
+  {"dtsaver", "dtsaver", "Turn on/off CDE Saver Mode. Only available if CDE support was compiled in", '\000', '\000'},
+#endif
+};
+
+/* Number of boolean options (set in main) */
+guint nb_boolOpt = 0;
+
+/* Boolean option dialog callback struct */
+typedef struct struct_option_bool_callback_s {
+    GtkWidget          *boolopt_dialog;
+} struct_option_bool_callback;
+
+/*------------------------------------*/
+/*          General options           */
+/*------------------------------------*/
+
+/* Gen option entry struct */
+typedef struct struct_option_gen_s {
+    gchar      *cmdarg;
+    gchar      *label;
+    gchar      *desc;
+    gchar      *help_anchor;
+    GtkWidget  *text_widget;
+} struct_option_gen;
+
+/* Description of the general option */
+struct_option_gen generalOpt[] =
+{
+  {"username", "username", "text string to use for Name prompt", "opt_gen_", (GtkWidget *)NULL},
+  {"password", "password", "text string to use for Password prompt", "gen_opt_", (GtkWidget *)NULL},
+  {"info", "info", "text string to use for instruction", "gen_opt_", (GtkWidget *)NULL},
+  {"validate", "validate", "text string to use for validating password message", "gen_opt_", (GtkWidget *)NULL},
+  {"invalid", "invalidate", "text string to use for invalid password message", "gen_opt_", (GtkWidget *)NULL},
+  {"message", "message", "message to say", "gen_opt_", (GtkWidget *)NULL},
+  {"delay", "delay", "The delay option sets the speed at which a mode will operate", "gen_opt_", (GtkWidget *)NULL},
+  {"batchcount", "batchcount", "This option sets number of things to do per batch to num", "gen_opt_", (GtkWidget *)NULL},
+  {"cycles", "cycles", "This option delay is used for some mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"ncolors", "ncolors", "This option delay is used for some mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"size", "size", "This option delay is used for some mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"saturation", "saturation", "This option delay is used for some GL mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"nice", "nice", "This option sets system nicelevel of the xlock process", "gen_opt_", (GtkWidget *)NULL},
+  {"lockdelay", "lockdelay", "This option set the delay between launch and lock", "gen_opt_", (GtkWidget *)NULL},
+  {"timeout", "timeout", "The timeout option sets the password screen timeout", "gen_opt_", (GtkWidget *)NULL},
+  {"geometry", "geometry", "geometry of mode window", "gen_opt_", (GtkWidget *)NULL},
+  {"icongeometry", "icongeometry", "geometry of mode icon window", "gen_opt_", (GtkWidget *)NULL},
+  {"glgeometry", "geometry", "geometry of GL mode window", "gen_opt_", (GtkWidget *)NULL},
+  {"delta3d", "delta3d", "Turn on/off 3d view, available on bouboule, pyro, star, and worm", "gen_opt_", (GtkWidget *)NULL},
+  {"neighbors", "neighbors", "Sets number of neighbors of cell (3, 4, 6, 9, 12) for automata modes", "gen_opt_", (GtkWidget *)NULL},
+  {"cpasswd", "cpasswd", "Sets the key to be this text string to unlock", "gen_opt_", (GtkWidget *)NULL},
+  {"program", "program", "program used as a fortune generator", "gen_opt_", (GtkWidget *)NULL},
+#ifdef USE_AUTO_LOGOUT
+  {"forceLogout", "forceLogout", "This option sets minutes to auto-logout", "gen_opt_", (GtkWidget *)NULL},
+#endif
+#ifdef USE_BUTTON_LOGOUT
+  {"logoutButtonHelp", "logoutButtonHelp", "Text string is a message shown outside logout", "gen_opt_", (GtkWidget *)NULL},
+  {"logoutButtonLabel", "logoutButtonLabel", "Text string is a message shown inside logout button", "gen_opt_", (GtkWidget *)NULL},
+#endif
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+  {"logoutFailedString", "logoutFailedString", "Text string is shown when a logout is attempted and fails", "gen_opt_", (GtkWidget *)NULL},
+#endif
+  {"startCmd", "startCmd", "Command to execute when the screen is locked", "gen_opt_", (GtkWidget *)NULL},
+  {"endCmd", "endCmd", "Command to execute when the screen is unlocked", "gen_opt_", (GtkWidget *)NULL},
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+  {"logoutCmd", "logoutCmd", "Command to execute when the user is logged out", "gen_opt_", (GtkWidget *)NULL},
+#endif
+  {"mailCmd", "mailCmd", "Command to execute when mails are checked", "gen_opt_", (GtkWidget *)NULL},
+#ifdef USE_DPMS
+  {"dpmsstandby", "dpmsstandby", "Allows one to set DPMS Standby for monitor (0 is infinite)", "gen_opt_", (GtkWidget *)NULL},
+  {"dpmssuspend", "dpmssuspend", "Allows one to set DPMS Suspend for monitor (0 is infinite)", "gen_opt_", (GtkWidget *)NULL},
+  {"dpmsoff", "dpmsoff", "Allows one to set DPMS Power Off for monitor (0 is infinite)", "gen_opt_", (GtkWidget *)NULL},
+#endif
+};
+
+/* Number of general options (set in main) */
+guint nb_genOpt = 0;
+
+/* General option dialog callback struct */
+typedef struct struct_option_gen_callback_s {
+    GtkWidget  *gen_dialog;
+    GtkWidget  *text_widget;
+} struct_option_gen_callback;
+
+/*------------------------------------*/
+/*      Font/File/Color options       */
+/*------------------------------------*/
+
+/* Option type (font/color/file) */
+typedef enum enum_type_option_fntcol_e {
+    TFNTCOL_FONT = 0,
+    TFNTCOL_COLOR,
+    TFNTCOL_FILE
+} enum_type_option_fntcol;
+
+/* Font/Color/File option entry struct */
+typedef struct struct_option_fntcol_s {
+    enum_type_option_fntcol    type;
+    gchar                     *cmdarg;
+    gchar                     *label;
+    gchar                     *desc;
+    gchar                     *help_anchor;
+    GtkWidget                 *entry;
+    GtkWidget                 *drawing_area;
+} struct_option_fntcol;
+
+/* Description of the font and color option */
+struct_option_fntcol fntcolorOpt[] =
+{
+  {TFNTCOL_COLOR, "bg", "background", "background color to use for password prompt", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "fg", "foreground", "foreground color to use for password prompt", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "none3d", "none3d", "color used for empty size in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "right3d", "right3d", "color used for right eye in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "left3d", "left3d", "color used for left eye in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "both3d", "both3d", "color used for overlapping images for left and right eye in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FONT, "font", "font", "font to use for password prompt", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FONT, "messagefont", "msgfont", "font to use for message", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FONT, "planfont", "planfont", "font to use for lower part of password screen", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+#ifdef USE_GL
+  {TFNTCOL_FONT, "fpsfont", "fpsfont", "font to use for FPS display in GL mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+#endif
+  {TFNTCOL_FILE, "messagesfile", "messagesfile", "file to be used as the fortune generator", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "messagefile", "messagefile", "file whose contents are displayed", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "bitmap", "bitmap", "sets the xbm, xpm, or ras file to be displayed with some modes", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "lifefile", "lifefile", "sets the lifeform (only one format: #P xlife format)", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "life3dfile", "life3dfile", "sets the lifeform (only one format similar to #P xlife format)", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+};
+
+/* Number of font/color/file options (set in main) */
+guint nb_fntColorOpt = 0;
+
+/* Font/Color/File option dialog callback struct */
+typedef struct struct_option_fntcol_callback_s {
+    GtkWidget                         *fntcol_dialog;
+    GtkWidget                 *entry;
+    GtkWidget                 *drawing_area;
+} struct_option_fntcol_callback;
+
+/* Colors handling */
+GdkVisual *gdkvisual;
+GdkColormap *gdkcolormap;
+
+#endif /* !_LMODE_H_ */
diff --git a/etc/genlauncher/xlockgen.lex b/etc/genlauncher/xlockgen.lex
new file mode 100644 (file)
index 0000000..44fefba
--- /dev/null
@@ -0,0 +1,121 @@
+/* xlockgen --- generates launcher include file */
+/* @(#)xlockgen.lex     5.0 2000/11/01 xlockmore"
+/*
+/* Copyright (c) Charles Vidal */
+
+/*
+ * to help adminitration and utils for launcher(s)
+ * this file replace token by all modes token :
+ * LISTMOTIF, LISTTCL, LISTGTK
+ * utils :
+ * If you want all modes of xlock:
+ * xlockgen -allmodes
+ * to see all mode : in bash
+ * for i in `./xlockgen -allmodes`
+ * do
+ *   xlock -mode $i
+ * done
+ *
+ * REVISION HISTORY:
+ *       99/10/10: fixes from Eric Lassauge <lassauge@mail.dotcom.fr> :
+ *                 - include "config.h"
+ *                 - new lmode.h
+ *                 - new token LISTGTK
+ *                 - header
+ *
+ */
+
+%{
+#include <stdio.h>
+#include <string.h>
+
+/* #include "../../config.h" */
+#include "lmode.h"
+
+char *Begin="\"";
+char *Sep="\",";
+char *End="\"";
+%}
+
+%%
+"$%LISTMOTIF" {
+  int i;
+  int  numprocs = sizeof (LockProcs) / sizeof (LockProcs[0]);
+
+  for (i = 0; i < numprocs; i++) {
+    if (LockProcs[i].define != NULL)
+      printf("%s\n", LockProcs[i].define);
+    if (i != numprocs - 1) {
+      printf("{(char *) \"%s\", ", LockProcs[i].cmdline_arg);
+      printf("(char *) \"%s\"},\n", LockProcs[i].desc);
+    } else {
+      printf("{(char *) \"%s\", ", LockProcs[i].cmdline_arg);
+      printf("(char *) \"%s\"},\n", LockProcs[i].desc);
+    }
+    if (LockProcs[i].define != NULL)
+      printf("#endif\n");
+  }
+}
+"$%LISTGTK" {
+  int i;
+  int  numprocs = sizeof (LockProcs) / sizeof (LockProcs[0]);
+
+  for (i = 0; i < numprocs; i++) {
+    if (LockProcs[i].define != NULL)
+      printf("%s\n", LockProcs[i].define);
+    printf("\t{\"%s\",\n", LockProcs[i].cmdline_arg);
+    printf("\t %d, %d, %d, %d, %2.2f,\n",
+      LockProcs[i].def_delay,
+      LockProcs[i].def_count,
+      LockProcs[i].def_cycles,
+      LockProcs[i].def_size,
+      LockProcs[i].def_saturation);
+    printf("\t \"%s\", (void *) NULL},\n", LockProcs[i].desc);
+    if (LockProcs[i].define != NULL)
+      printf("#endif\n");
+  }
+}
+"$%LISTTCL" {
+  int i;
+  int  numprocs = sizeof (LockProcs) / sizeof (LockProcs[0]);
+
+  for (i = 0; i < numprocs; i++) {
+    printf("%s\\\n", LockProcs[i].cmdline_arg);
+  }
+}
+"$%LISTJAVA" {
+  int i;
+  int  numprocs = sizeof (LockProcs) / sizeof (LockProcs[0]);
+
+  for (i = 0; i < numprocs; i++) {
+    printf("lst.addItem(\"%s\");\n", LockProcs[i].cmdline_arg);
+  }
+}
+%%
+void usage() {
+  printf("xlockgen :\n");
+  printf("\t-allmodes\n");
+  printf("or to be used in \n");
+}
+
+int main(int argc, char *argv[])
+{
+  if (argc>1) {
+    if (!strcmp("-allmodes", argv[1])) {
+      int i;
+      int numprocs = sizeof (LockProcs) / sizeof (LockProcs[0]);
+
+      for (i = 0; i < numprocs; i++)
+        printf("%s\n", LockProcs[i].cmdline_arg);
+      exit(0);
+    }
+    if (!strcmp("--help", argv[1]) ||
+        !strcmp("-help", argv[1]) ||
+        !strcmp("-?", argv[1]) ||
+        !strcmp("-h", argv[1])) {
+      usage();
+      exit(0);
+    }
+  }
+  yylex();
+}
diff --git a/etc/genlauncher/xmlock.modes.tpl b/etc/genlauncher/xmlock.modes.tpl
new file mode 100644 (file)
index 0000000..0591b98
--- /dev/null
@@ -0,0 +1,19 @@
+typedef struct LockStruct_s
+{
+       char *cmdline_arg;          /* mode name */
+       /* Maybe other things should be added here from xlock? */
+       /* Should read in XLock as well to set defaults */
+       char *desc;                 /* text description of mode */
+} LockStruct;
+
+static LockStruct LockProcs[] =
+{
+$%LISTMOTIF#ifdef USE_BOMB
+{(char *) "bomb", (char *) "Shows a bomb and will autologout after a time"},
+{(char *) "random", (char *) "Shows a random mode (except blank and bomb)"}
+#else
+{(char *) "random", (char *) "Shows a random mode (except blank)"}
+#endif
+};
+
+#define numprocs (sizeof(LockProcs) /sizeof(LockProcs[0]))
diff --git a/etc/gif/README b/etc/gif/README
new file mode 100644 (file)
index 0000000..7b1ada2
--- /dev/null
@@ -0,0 +1,2 @@
+This directory is only for configure.tcl
+The gif format currently does not work with xlock.
diff --git a/etc/gif/deflag.gif b/etc/gif/deflag.gif
new file mode 100644 (file)
index 0000000..66086bd
Binary files /dev/null and b/etc/gif/deflag.gif differ
diff --git a/etc/gif/frflag.gif b/etc/gif/frflag.gif
new file mode 100644 (file)
index 0000000..8b60407
Binary files /dev/null and b/etc/gif/frflag.gif differ
diff --git a/etc/gif/jpflag.gif b/etc/gif/jpflag.gif
new file mode 100644 (file)
index 0000000..03f8ac9
Binary files /dev/null and b/etc/gif/jpflag.gif differ
diff --git a/etc/gif/nlflag.gif b/etc/gif/nlflag.gif
new file mode 100644 (file)
index 0000000..8997e63
Binary files /dev/null and b/etc/gif/nlflag.gif differ
diff --git a/etc/gif/ukflag.gif b/etc/gif/ukflag.gif
new file mode 100644 (file)
index 0000000..2c74822
Binary files /dev/null and b/etc/gif/ukflag.gif differ
diff --git a/etc/glider.3dlife b/etc/glider.3dlife
new file mode 100644 (file)
index 0000000..546110e
--- /dev/null
@@ -0,0 +1,8 @@
+#P -2 -2 -1
+.**.
+*..*
+*..*
+
+....
+.**.
+.**.
diff --git a/etc/glider.hlife b/etc/glider.hlife
new file mode 100644 (file)
index 0000000..debccb2
--- /dev/null
@@ -0,0 +1,7 @@
+#P -2 -2
+    . . O .
+   . . . O
+  O . . O
+ . . . O
+. . . O
+
diff --git a/etc/glider.life b/etc/glider.life
new file mode 100644 (file)
index 0000000..03c4c8a
--- /dev/null
@@ -0,0 +1,4 @@
+#P -1 -1
+***
+..*
+.*.
diff --git a/etc/play.sh b/etc/play.sh
new file mode 100755 (executable)
index 0000000..f055b16
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+[ -c /dev/audio ] && cat $1 > /dev/audio
diff --git a/etc/rplay.conf b/etc/rplay.conf
new file mode 100644 (file)
index 0000000..859b8eb
--- /dev/null
@@ -0,0 +1,4 @@
+/usr/local/sounds/complete.au
+/usr/local/sounds/identify-please.au
+/usr/local/sounds/not-programmed.au
+/usr/local/sounds/thank-you.au
diff --git a/etc/rplay.hosts b/etc/rplay.hosts
new file mode 100644 (file)
index 0000000..72e8ffc
--- /dev/null
@@ -0,0 +1 @@
+*
diff --git a/etc/rplay.servers b/etc/rplay.servers
new file mode 100644 (file)
index 0000000..060fcae
--- /dev/null
@@ -0,0 +1 @@
+*:rwx
diff --git a/etc/showmodes.sh b/etc/showmodes.sh
new file mode 100755 (executable)
index 0000000..7bfc0f9
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/ksh
+
+# or /bin/bash
+
+# Simple script to look all xlock modes supported.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright notice appear in all copies and that
+# both that copyright notice and this permission notice appear in
+# supporting documentation.
+#
+# This file is provided AS IS with no warranties of any kind.  The author
+# shall have no liability with respect to the infringement of copyrights,
+# trade secrets or any patents by this file or any part thereof.  In no
+# event will the author be liable for any lost revenue or profits or
+# other special, indirect and consequential damages.
+#
+# xlock-show-modes Copyright (C)  1998 Andrea Arcangeli
+#              by Andrea Arcangeli <arcangeli@mbox.queen.it>
+#
+# Revision History:
+# 00-Jan-23  erase-modename threw it off, an extra space did the trick
+#            Also works on Sun now.  David Bagley
+
+# awk fails on Solaris but nawk is OK
+if [ `uname` == "SunOS" ] ; then
+       AWK="nawk"
+else
+       AWK="awk"
+fi
+#    gsub(/.*\] \[-mode/, ""); gsub(/\| /, ""); gsub("^ +", ""); \
+# --help is a deliberate mistype...
+function listmodes
+{
+  xlock --help 2>&1 | $AWK '{ \
+    if (!true && match ($0,"-mode ")) { \
+      gsub(/.*-mode /, ""); gsub(/\| /, ""); gsub("^ +", ""); \
+      printf("%s ", $0); true = 1 \
+    } else { if (true && /\|/) { \
+      gsub(/\| /, ""); gsub("^ +", ""); gsub("\]$", ""); \
+      printf("%s ", $0) } \
+    } \
+  }'
+}
+for i in `listmodes`; do echo Trying mode $i; xlock -nolock -mode $i; done
diff --git a/etc/system.fvwm2rc.xlock b/etc/system.fvwm2rc.xlock
new file mode 100644 (file)
index 0000000..f68e59a
--- /dev/null
@@ -0,0 +1,436 @@
+# Add this to your system or personal menu file
+# System: /usr/lib/X11/fvwm2/system.fvwm2rc
+# Personal $HOME/.fvwm2rc
+# Put this in your "Utilities" uncommented.
+# +    "Lock_Saver"    Menu Lock_Saver Close
+
+AddToMenu "Automata-Lock"
++      "Automata-Lock" Title
++      "Ant"           Exec    xlock -mode ant -neighbors 4 +truchet
++      "Ant Truchet"   Exec    xlock -mode ant -neighbors 4 -truchet
++      "Bee"           Exec    xlock -mode ant -neighbors 6 +truchet
++      "Bee Truchet"   Exec    xlock -mode ant -neighbors 6 -truchet
++      "Bug"           Exec    xlock -mode bug
++      "Demon"         Exec    xlock -mode demon
++      "Dilemma"       Exec    xlock -mode dilemma
++      "Life"          Exec    xlock -mode life
++      "Life Callahan" Exec    xlock -mode life -callahan -size 7
++      "Life1d"        Exec    xlock -mode life1d
++      "Life3d"        Exec    xlock -mode life3d
++      "Loop"          Exec    xlock -mode loop
++      "Voters"        Exec    xlock -mode voters
++      "Wator"         Exec    xlock -mode wator
++      "Wire"          Exec    xlock -mode wire
++      "Random"        Exec    xlock -mode random -modelist allautomata -fullrandom -neighbors 0
+
+AddToMenu "Fractal-Lock"
++      "Fractal-Lock"  Title
++      "Coral"         Exec    xlock -mode coral
++      "Discrete"      Exec    xlock -mode discrete
++      "Dragon"        Exec    xlock -mode dragon
++      "Drift"         Exec    xlock -mode drift -fullrandom
++      "Euler2d"       Exec    xlock -mode euler2d
++      "Flame"         Exec    xlock -mode flame
++      "Flow"          Exec    xlock -mode flow
++      "Forest"        Exec    xlock -mode forest
++      "Hop"           Exec    xlock -mode hop -fullrandom
++      "IFS"           Exec    xlock -mode ifs
++      "Julia"         Exec    xlock -mode julia +trackmouse
++      "Juliaptr"      Exec    xlock -mode julia -trackmouse
++      "Kumppa"        Exec    xlock -mode kumppa
++      "Lightning"     Exec    xlock -mode lightning
++      "Lyapunov"      Exec    xlock -mode lyapunov -install
++      "Mandelbrot"    Exec    xlock -mode mandelbrot -install
++      "Mountain"      Exec    xlock -mode mountain
++      "Sierpinski"    Exec    xlock -mode sierpinski
++      "Strange"       Exec    xlock -mode strange
++      "Thornbird"     Exec    xlock -mode thornbird
++      "Triangle"      Exec    xlock -mode triangle
++      "Turtle"        Exec    xlock -mode turtle
++      "Vines"         Exec    xlock -mode vines
++      "Random"        Exec    xlock -mode random -modelist allfractal -fullrandom
+
+AddToMenu "Geometry-Lock"
++      "Geometry-Lock" Title
++      "Braid"         Exec    xlock -mode braid
++      "Fadeplot"      Exec    xlock -mode fadeplot
++      "Helix"         Exec    xlock -mode helix -fullrandom
++      "Hyper"         Exec    xlock -mode hyper
++      "Ico"           Exec    xlock -mode ico
++      "Kaleid"        Exec    xlock -mode kaleid
++      "Laser"         Exec    xlock -mode laser
++      "Lisa"          Exec    xlock -mode lisa
++      "Lissie"        Exec    xlock -mode lissie
++      "Penrose"       Exec    xlock -mode penrose +ammann
++      "Penrose Ammann"        Exec xlock -mode penrose -ammann
++      "Petal"         Exec    xlock -mode petal
++      "Polyominoes"   Exec    xlock -mode polyominoes
++      "Qix"           Exec    xlock -mode qix +complete
++      "Qix complete"  Exec    xlock -mode qix -complete
++      "Rotor"         Exec    xlock -mode rotor
++      "Shape"         Exec    xlock -mode shape
++      "Sphere"        Exec    xlock -mode sphere
++      "Spiral"        Exec    xlock -mode spiral
++      "Spline"        Exec    xlock -mode spline
++      "Tik_Tak"       Exec    xlock -mode tik_tak
++      "Random"        Exec    xlock -mode random -modelist allgeometry -fullrandom
+
+AddToMenu "Space-Lock"
++      "Space-Lock"    Title
++      "Bouboule"      Exec    xlock -mode bouboule +use3d
++      "Bouboule3d"    Exec    xlock -mode bouboule -use3d
++      "Galaxy"        Exec    xlock -mode galaxy
++      "Grav"          Exec    xlock -mode grav +trail +decay
++      "Grav Trail"    Exec    xlock -mode grav -trail
++      "Grav Decay"    Exec    xlock -mode grav -decay
++      "Rock"          Exec    xlock -mode star -rock
++      "Scooter        Exec    xlock -mode scooter
++      "Space"         Exec    xlock -mode space
++      "Star"          Exec    xlock -mode star +rock +use3d +trek 0
++      "Star3d"        Exec    xlock -mode star -use3d
++      "Star Trek"     Exec    xlock -mode star -trek 100
++      "World"         Exec    xlock -mode world
++      "Random Space"  Exec    xlock -mode random -modelist allspace
+
+AddToMenu "Assorted-Lock"
++      "Assorted-Lock" Title
++      "Ball"          Exec    xlock -mode ball
++      "Blot"          Exec    xlock -mode blot
++      "Bounce"        Exec    xlock -mode bounce
++      "Bubble"        Exec    xlock -mode bubble
++      "Clock"         Exec    xlock -mode clock
++      "Crystal"       Exec    xlock -mode crystal
++      "Daisy"         Exec    xlock -mode daisy
++      "Dclock"        Exec    xlock -mode dclock
++      "Deco"          Exec    xlock -mode deco
++      "Decay"         Exec    xlock -mode decay
++      "Eyes"          Exec    xlock -mode eyes +trackmouse
++      "Eyesptr"       Exec    xlock -mode eyes -trackmouse
++      "Goop"          Exec    xlock -mode goop
++      "Juggle"        Exec    xlock -mode juggle
++      "Marquee"       Exec    xlock -mode marquee
++      "Matrix"        Exec    xlock -mode matrix
++      "Munch"         Exec    xlock -mode munch
++      "Nose"          Exec    xlock -mode nose
++      "Pacman"        Exec    xlock -mode pacman
++      "Pyro"          Exec    xlock -mode pyro +use3d
++      "Pyro3d"        Exec    xlock -mode pyro -use3d
++      "Roll"          Exec    xlock -mode roll
++      "Slip"          Exec    xlock -mode slip
++      "Solitare"      Exec    xlock -mode solitare +trackmouse
++      "Solitareptr"   Exec    xlock -mode solitare -trackmouse
++      "Starfish"      Exec    xlock -mode starfish -install
++      "Swarm"         Exec    xlock -mode swarm +trackmouse
++      "Swarmptr"      Exec    xlock -mode swarm -trackmouse
++      "Swirl"         Exec    xlock -mode swirl -install
++      "T3d"           Exec    xlock -mode t3d
++      "Tetris"        Exec    xlock -mode tetris
++      "Tube"          Exec    xlock -mode tube -install
++      "Worm"          Exec    xlock -mode worm +use3d
++      "Worm3d"        Exec    xlock -mode worm -use3d
++      "Xcl"           Exec    xlock -mode xcl
++      "Xjack"         Exec    xlock -mode xjack
+
+AddToMenu "XPM-Lock"
++      "XPM-Lock"      Title
++      "Bat"           Exec    xlock -mode bat
++      "Image"         Exec    xlock -mode image
++      "Flag"          Exec    xlock -mode flag
++      "Life"          Exec    xlock -mode life
++      "Life1d"        Exec    xlock -mode life1d
++      "Maze"          Exec    xlock -mode maze
++      "Puzzle"        Exec    xlock -mode puzzle
++      "Random"        Exec    xlock -mode random -modelist allxpm -fullrandom
+
+AddToMenu "GL-Lock"
++      "GL-Lock"       Title
++      "Atlantis"      Exec    xlock -mode atlantis
++      "Bubble3d"      Exec    xlock -mode bubble3d
++      "Cage"          Exec    xlock -mode cage
++      "Fire"          Exec    xlock -mode fire
++      "Gears"         Exec    xlock -mode gears
++      "GL-Planet"     Exec    xlock -mode glplanet
++      "Invert"        Exec    xlock -mode invert
++      "Lament"        Exec    xlock -mode lament
++      "Moebius"       Exec    xlock -mode moebius
++      "Molecule"      Exec    xlock -mode molecule
++      "Morph3d"       Exec    xlock -mode morph3d
++      "Pipes"         Exec    xlock -mode pipes
++      "Rubik"         Exec    xlock -mode rubik
++      "Sballs"        Exec    xlock -mode sballs
++      "Sierpinski3d"  Exec    xlock -mode sierpinski3d
++      "Sproingies"    Exec    xlock -mode sproingies
++      "Stairs"        Exec    xlock -mode stairs
++      "Superquadrics" Exec    xlock -mode superquadrics
++      "Random"        Exec    xlock -mode random -modelist allgl -fullrandom
+
+AddToMenu "Marquee-Message-Lock"
++      "Message-Lock"  Title
++      "Back Soon"     Exec    xlock -mode marquee -message "$LOGNAME will be back soon."
++      "Overnight"     Exec    xlock -mode marquee -message "$LOGNAME will be back in the morning."
++      "Rude"          Exec    xlock -mode marquee -message "$LOGNAME not here, please go away!"
+
+AddToMenu "Nose-Message-Lock"
++      "Message-Lock"  Title
++      "Back Soon"     Exec    xlock -mode nose -message "$LOGNAME will be back soon."
++      "Overnight"     Exec    xlock -mode nose -message "$LOGNAME will be back in the morning."
++      "Rude"          Exec    xlock -mode nose -message "$LOGNAME not here, please go away!"
+
+AddToMenu "Xjack-Message-Lock"
++      "Xjack-Lock"    Title
++      "Crazy Boy"     Exec    xlock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
++      "Crazy Girl"    Exec    xlock -mode xjack -message "All work and no play makes $LOGNAME a dull girl."
+
+AddToMenu "Special-Lock"
++      "Special-Lock"  Title
++      "Blank"         Exec    xlock -mode blank
++      "Transparent"   Exec    xlock -mode blank -geometry 1x1 -enablesaver
++      "Bomb"          Exec    xlock -mode bomb
++      "Random nice"   Exec    xlock -mode random -modelist allnice -fullrandom -neighbors 0
++      "Random standard"       Exec    xlock -mode random -modelist all-allgl -fullrandom -neighbors 0
++      "Random all"    Exec    xlock -mode random -modelist all -fullrandom -neighbors 0
++      "Random 3d"     Exec    xlock -mode random -modelist all3d -use3d -fullrandom
++      "Random ptr"    Exec    xlock -mode random -modelist allmouse -trackmouse -fullrandom
++      "Random write"  Exec    xlock -mode random -modelist allwrite -install -fullrandom
+
+AddToMenu "Automata-Saver"
++      "Automata-Saver"        Title
++      "Ant"           Exec    xlock -nolock -mode ant -neighbors 4 +truchet
++      "Ant Truchet"   Exec    xlock -nolock -mode ant -neighbors 4 -truchet
++      "Bee"           Exec    xlock -nolock -mode ant -neighbors 6 +truchet
++      "Bee Truchet"   Exec    xlock -nolock -mode ant -neighbors 6 -truchet
++      "Bug"           Exec    xlock -nolock -mode bug
++      "Demon"         Exec    xlock -nolock -mode demon
++      "Dilemma"       Exec    xlock -nolock -mode dilemma
++      "Life"          Exec    xlock -nolock -mode life
++      "Life Callahan" Exec    xlock -nolock -mode life -callahan -size 7
++      "Life1d"        Exec    xlock -nolock -mode life1d
++      "Life3d"        Exec    xlock -nolock -mode life3d
++      "Loop"          Exec    xlock -nolock -mode loop
++      "Voters"        Exec    xlock -nolock -mode voters
++      "Wator"         Exec    xlock -nolock -mode wator
++      "Wire"          Exec    xlock -nolock -mode wire
++      "Random"        Exec    xlock -nolock -mode random -modelist allautomata -fullrandom -neighbors 0
+
+AddToMenu "Fractal-Saver"
++      "Fractal-Saver" Title
++      "Coral"         Exec    xlock -nolock -mode coral
++      "Discrete"      Exec    xlock -nolock -mode discrete
++      "Dragon"        Exec    xlock -nolock -mode dragon
++      "Drift"         Exec    xlock -nolock -mode drift -fullrandom
++      "Euler2d"       Exec    xlock -nolock -mode euler2d
++      "Flame"         Exec    xlock -nolock -mode flame
++      "Flow"          Exec    xlock -nolock -mode flow
++      "Forest"        Exec    xlock -nolock -mode forest
++      "Hop"           Exec    xlock -nolock -mode hop -fullrandom
++      "IFS"           Exec    xlock -nolock -mode ifs
++      "Julia"         Exec    xlock -nolock -mode julia +trackmouse
++      "Juliaptr"      Exec    xlock -nolock -mode julia -trackmouse
++      "Kumppa"        Exec    xlock -nolock -mode kumppa
++      "Lightning"     Exec    xlock -nolock -mode lightning
++      "Lyapunov"      Exec    xlock -nolock -mode lyapunov -install
++      "Mandelbrot"    Exec    xlock -nolock -mode mandelbrot -install
++      "Mountain"      Exec    xlock -nolock -mode mountain
++      "Sierpinski"    Exec    xlock -nolock -mode sierpinski
++      "Strange"       Exec    xlock -nolock -mode strange
++      "Thornbird"     Exec    xlock -nolock -mode thornbird
++      "Triangle"      Exec    xlock -nolock -mode triangle
++      "Turtle"        Exec    xlock -nolock -mode turtle
++      "Vines"         Exec    xlock -nolock -mode vines
++      "Random"        Exec    xlock -nolock -mode random -modelist allfractal -fullrandom
+
+AddToMenu "Geometry-Saver"
++      "Geometry-Saver"        Title
++      "Braid"         Exec    xlock -nolock -mode braid
++      "Fadeplot"      Exec    xlock -nolock -mode fadeplot
++      "Helix"         Exec    xlock -nolock -mode helix -fullrandom
++      "Hyper"         Exec    xlock -nolock -mode hyper
++      "Ico"           Exec    xlock -nolock -mode ico
++      "Kaleid"        Exec    xlock -nolock -mode kaleid
++      "Laser"         Exec    xlock -nolock -mode laser
++      "Lisa"          Exec    xlock -nolock -mode lisa
++      "Lissie"        Exec    xlock -nolock -mode lissie
++      "Penrose"       Exec    xlock -nolock -mode penrose +ammann
++      "Penrose Ammann"        Exec xlock -nolock -mode penrose -ammann
++      "Petal"         Exec    xlock -nolock -mode petal
++      "Polyominoes"   Exec    xlock -nolock -mode polyominoes
++      "Qix"           Exec    xlock -nolock -mode qix +complete
++      "Qix complete"  Exec    xlock -nolock -mode qix -complete
++      "Rotor"         Exec    xlock -nolock -mode rotor
++      "Shape"         Exec    xlock -nolock -mode shape
++      "Sphere"        Exec    xlock -nolock -mode sphere
++      "Spiral"        Exec    xlock -nolock -mode spiral
++      "Spline"        Exec    xlock -nolock -mode spline
++      "Tik_Tak"       Exec    xlock -nolock -mode tik_tak
++      "Random"        Exec    xlock -nolock -mode random -modelist allgeometry
+
+AddToMenu "Space-Saver"
++      "Space-Saver"   Title
++      "Bouboule"      Exec    xlock -nolock -mode bouboule +use3d
++      "Bouboule3d"    Exec    xlock -nolock -mode bouboule -use3d
++      "Galaxy"        Exec    xlock -nolock -mode galaxy
++      "Grav"          Exec    xlock -nolock -mode grav +trail +decay
++      "Grav Trail"    Exec    xlock -nolock -mode grav -trail
++      "Grav Decay"    Exec    xlock -nolock -mode grav -decay
++      "Rock"          Exec    xlock -nolock -mode star -rock
++      "Scooter"       Exec    xlock -nolock -mode scooter
++      "Space"         Exec    xlock -nolock -mode space
++      "Star"          Exec    xlock -nolock -mode star +rock +use3d +trek 0
++      "Star3d"        Exec    xlock -nolock -mode star -use3d
++      "Star Trek"     Exec    xlock -nolock -mode star -trek 100
++      "World"         Exec    xlock -nolock -mode world
++      "Random Space"  Exec    xlock -nolock -mode random -modelist allspace
+
+AddToMenu "Assorted-Saver"
++      "Assorted-Saver"        Title
++      "Ball"          Exec    xlock -nolock -mode ball
++      "Blot"          Exec    xlock -nolock -mode blot
++      "Bounce"        Exec    xlock -nolock -mode bounce
++      "Bubble"        Exec    xlock -nolock -mode bubble
++      "Clock"         Exec    xlock -nolock -mode clock
++      "Crystal"       Exec    xlock -nolock -mode crystal
++      "Daisy"         Exec    xlock -nolock -mode daisy
++      "Dclock"        Exec    xlock -nolock -mode dclock
++      "Deco"          Exec    xlock -nolock -mode deco
++      "Decay"         Exec    xlock -nolock -mode decay
++      "Eyes"          Exec    xlock -nolock -mode eyes +trackmouse
++      "Eyesptr"       Exec    xlock -nolock -mode eyes -trackmouse
++      "Goop"          Exec    xlock -nolock -mode goop
++      "Juggle"        Exec    xlock -nolock -mode juggle
++      "Marquee"       Exec    xlock -nolock -mode marquee
++      "Matrix"        Exec    xlock -nolock -mode matrix
++      "Munch"         Exec    xlock -nolock -mode munch
++      "Nose"          Exec    xlock -nolock -mode nose
++      "Pacman"        Exec    xlock -nolock -mode pacman
++      "Pyro"          Exec    xlock -nolock -mode pyro +use3d
++      "Pyro3d"        Exec    xlock -nolock -mode pyro -use3d
++      "Roll"          Exec    xlock -nolock -mode roll
++      "Slip"          Exec    xlock -nolock -mode slip
++      "Solitare"      Exec    xlock -nolock -mode solitare +trackmouse
++      "Solitareptr"   Exec    xlock -nolock -mode solitare -trackmouse
++      "Starfish"      Exec    xlock -nolock -mode starfish -install
++      "Swarm"         Exec    xlock -nolock -mode swarm +trackmouse
++      "Swarmptr"      Exec    xlock -nolock -mode swarm -trackmouse
++      "Swirl"         Exec    xlock -nolock -mode swirl -install
++      "T3d"           Exec    xlock -nolock -mode t3d
++      "Tetris"        Exec    xlock -nolock -mode tetris
++      "Tube"          Exec    xlock -nolock -mode tube -install
++      "Worm"          Exec    xlock -nolock -mode worm +use3d
++      "Worm3d"        Exec    xlock -nolock -mode worm -use3d
++      "Xcl"           Exec    xlock -nolock -mode xcl
++      "Xjack"         Exec    xlock -nolock -mode xjack
+
+AddToMenu "XPM-Saver"
++      "XPM-Saver"     Title
++      "Bat"           Exec    xlock -nolock -mode bat
++      "Image"         Exec    xlock -nolock -mode image
++      "Flag"          Exec    xlock -nolock -mode flag
++      "Life"          Exec    xlock -nolock -mode life
++      "Life1d"        Exec    xlock -nolock -mode life1d
++      "Maze"          Exec    xlock -nolock -mode maze
++      "Puzzle"        Exec    xlock -nolock -mode puzzle
++ "Random"             Exec    xlock -nolock -mode random -modelist allxpm -fullrandom
+
+AddToMenu "GL-Saver"
++      "GL-Saver"      Title
++      "Atlantis"      Exec    xlock -nolock -mode atlantis
++      "Bubble3d"      Exec    xlock -nolock -mode bubble3d
++      "Cage"          Exec    xlock -nolock -mode cage
++      "Fire"          Exec    xlock -nolock -mode fire
++      "Gears"         Exec    xlock -nolock -mode gears
++      "GL-Planet"     Exec    xlock -nolock -mode glplanet
++      "Lament"        Exec    xlock -nolock -mode lament
++      "Moebius"       Exec    xlock -nolock -mode moebius
++      "Molecule"      Exec    xlock -nolock -mode molecule
++      "Morph3d"       Exec    xlock -nolock -mode morph3d
++      "Pipes"         Exec    xlock -nolock -mode pipes
++      "Rubik"         Exec    xlock -nolock -mode rubik
++      "Sballs"        Exec    xlock -nolock -mode sballs
++      "Sierpinski3d"  Exec    xlock -nolock -mode sierpinski3d
++      "Sproingies"    Exec    xlock -nolock -mode sproingies
++      "Stairs"        Exec    xlock -nolock -mode stairs
++      "Superquadrics" Exec    xlock -nolock -mode superquadrics
++ "Random"   Exec      xlock -nolock -mode random -modelist allgl -fullrandom
+
+AddToMenu "Marquee-Message-Saver"
++      "Marquee-Message"       Title
++      "Brilliant!"    Exec    xlock -nolock -mode marquee -message "WOW! $LOGNAME, You're Brilliant!"
++      "Love You"      Exec    xlock -nolock -mode marquee -message "You know, I Love You $LOGNAME."
++      "Available"     Exec    xlock -nolock -mode marquee -message "Hey, I'm available now!"
+
+AddToMenu "Nose-Message-Saver"
++      "Nose-Message"  Title
++      "Brilliant!"    Exec    xlock -nolock -mode nose -message "WOW! $LOGNAME, You're Brilliant!"
++      "Love You"      Exec    xlock -nolock -mode nose -message "You know, I Love You $LOGNAME."
++      "Available"     Exec    xlock -nolock -mode nose -message "Hey, I'm available now!"
+
+AddToMenu "Xjack-Message-Lock"
++      "Xjack-Lock"    Title
++      "Crazy Boy"             Exec    xlock -nolock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
++      "Crazy Girl"            Exec    xlock -nolock -mode xjack -message "All work and no play makes $LOGNAME a dull girl."
+
+AddToMenu "Special-Saver"
++      "Special-Saver" Title
++      "Blank"         Exec    xlock -nolock -mode blank
++      "Bomb"          Exec    xlock -nolock -mode bomb
++      "Random nice"   Exec    xlock -nolock -mode random -modelist allnice -fullrandom -neighbors 0
++      "Random standard"       Exec    xlock -nolock -mode random -modelist all-allgl -fullrandom -neighbors 0
++      "Random all"    Exec    xlock -nolock -mode random -modelist all -fullrandom -neighbors 0
++      "Random 3d"     Exec    xlock -nolock -mode random -modelist all3d -use3d -fullrandom
++      "Random ptr"    Exec    xlock -nolock -mode random -modelist allmouse -trackmouse -fullrandom
++      "Random write"  Exec    xlock -nolock -mode random -modelist allwrite -fullrandom
+
+AddToMenu Screenlock
++      "Screenlock"            Title
++      "Cellular Automata"     Menu Automata-Lock Close
++       ""                      Nop
++      "Fractal"               Menu Fractal-Lock Close
++       ""                      Nop
++      "Geometry"              Menu Geometry-Lock Close
++       ""                      Nop
++      "Space"                 Menu Space-Lock Close
++       ""                      Nop
++      "Assorted"              Menu Assorted-Lock Close
++       ""                      Nop
++      "XPM"           Menu XPM-Lock Close
++       ""                      Nop
++      "GL"            Menu GL-Lock Close
++       ""                      Nop
++      "Marquee Message"       Menu Marquee-Message-Lock Close
++       ""                      Nop
++      "Nose Message"          Menu Nose-Message-Lock Close
++       ""                      Nop
++      "Xjack Message"         Menu Xjack-Message-Lock Close
++       ""                      Nop
++      "Special"               Menu Special-Lock Close
+
+AddToMenu Screensaver
++      "Screensaver"           Title
++      "Cellular Automata"     Menu Automata-Saver Close
++      ""                      Nop
++      "Fractal"               Menu Fractal-Saver Close
++       ""                     Nop
++      "Geometry"              Menu Geometry-Saver Close
++       ""                     Nop
++      "Space"                 Menu Space-Saver Close
++       ""                     Nop
++      "Assorted"              Menu Assorted-Saver Close
++       ""                     Nop
++      "XPM"           Menu XPM-Saver Close
++       ""                     Nop
++      "GL"            Menu GL-Saver Close
++       ""                     Nop
++      "Marquee Message"       Menu Marquee-Message-Saver Close
++       ""                      Nop
++      "Nose Message"          Menu Nose-Message-Saver Close
++       ""                      Nop
++      "Xjack Message"         Menu Xjack-Message-Saver Close
++       ""                      Nop
++      "Special"               Menu Special-Saver Close
+
+AddToMenu "Lock_Saver"
++      "Lock_Saver"            Title
++      "Screenlock"    Menu Screenlock Close
++      ""                      Nop
++      "Screensaver"           Menu Screensaver Close
+
diff --git a/etc/system.fvwmrc.xlock b/etc/system.fvwmrc.xlock
new file mode 100644 (file)
index 0000000..2624c57
--- /dev/null
@@ -0,0 +1,461 @@
+# Add this to your system or personal menu file
+# System: /usr/lib/X11/fvwm/system.fvwmrc
+# Personal $HOME/.fvwmrc
+# Put this in your "Utilities" uncommented.
+#      Popup   "Lock_Saver"    Lock_Saver
+# This is for fvwm <=1.24r
+# For -install to work right you must disable it before fvwm is compiled
+# see README
+
+Popup "Automata-Lock"
+       Title   "Automata-Lock"
+       Exec    "Ant"           exec xlock -mode ant -neighbors 4 +truchet &
+       Exec    "Ant Truchet"   exec xlock -mode ant -neighbors 4 -truchet &
+       Exec    "Bee"           exec xlock -mode ant -neighbors 6 +truchet &
+       Exec    "Bee Truchet"   exec xlock -mode ant -neighbors 6 -truchet &
+       Exec    "Bug"           exec xlock -mode bug &
+       Exec    "Demon"         exec xlock -mode demon &
+       Exec    "Dilemma"       exec xlock -mode dilemma &
+       Exec    "Life"          exec xlock -mode life &
+       Exec    "Life Callahan" exec xlock -mode life -callahan -size 7 &
+       Exec    "Life1d"        exec xlock -mode life1d &
+       Exec    "Life3d"        exec xlock -mode life3d &
+       Exec    "Loop"          exec xlock -mode loop &
+       Exec    "Voters"        exec xlock -mode voters &
+       Exec    "Wator"         exec xlock -mode wator &
+       Exec    "Wire"          exec xlock -mode wire &
+       Exec    "Random Automata"       exec xlock -mode random -modelist allautomata -fullrandom -neighbors 0 &
+EndPopup
+
+Popup "Fractal-Lock"
+       Title   "Fractal-Lock"
+       Exec    "Coral"         exec xlock -mode coral &
+       Exec    "Discrete"      exec xlock -mode discrete &
+       Exec    "Dragon"        exec xlock -mode dragon &
+       Exec    "Drift"         exec xlock -mode drift -fullrandom &
+       Exec    "Euler2d"       exec xlock -mode euler2d &
+       Exec    "Flame"         exec xlock -mode flame &
+       Exec    "Flow"          exec xlock -mode flow &
+       Exec    "Forest"        exec xlock -mode forest &
+       Exec    "Hop"i          exec xlock -mode hop -fullrandom &
+       Exec    "IFS"           exec xlock -mode ifs &
+       Exec    "Julia"         exec xlock -mode julia +trackmouse &
+       Exec    "Juliaptr"      exec xlock -mode julia -trackmouse &
+       Exec    "Kumppa"        exec xlock -mode kumppa &
+       Exec    "Lightning"     exec xlock -mode lightning &
+       Exec    "Lyapanuv"      exec xlock -mode lyapunov -install &
+       Exec    "Mandelbrot"    exec xlock -mode mandelbrot -install &
+       Exec    "Mountain"      exec xlock -mode mountain &
+       Exec    "Sierpinski"    exec xlock -mode sierpinski &
+       Exec    "Strange"       exec xlock -mode strange &
+       Exec    "Thornbird"     exec xlock -mode thornbird &
+       Exec    "Triangle"      exec xlock -mode triangle &
+       Exec    "Turtle"        exec xlock -mode turtle &
+       Exec    "Vines"         exec xlock -mode vines &
+       Exec    "Random Fractal"        exec xlock -mode random -modelist allfractal -fullrandom &
+EndPopup
+
+Popup "Geometry-Lock"
+       Title   "Geometry-Lock"
+       Exec    "Braid"         exec xlock -mode braid &
+       Exec    "Fadeplot"      exec xlock -mode fadeplot &
+       Exec    "Helix"         exec xlock -mode helix -fullrandom &
+       Exec    "Hyper"         exec xlock -mode hyper &
+       Exec    "Ico"           exec xlock -mode ico &
+       Exec    "Kaleid"        exec xlock -mode kaleid &
+       Exec    "Laser"         exec xlock -mode laser &
+       Exec    "Lisa"          exec xlock -mode lisa &
+       Exec    "Lissie"        exec xlock -mode lissie &
+       Exec    "Penrose"       exec xlock -mode penrose +ammann &
+       Exec    "Penrose Ammann"        exec xlock -mode penrose -ammann &
+       Exec    "Petal"         exec xlock -mode petal &
+       Exec    "Polyominoes"   exec xlock -mode polyominoes &
+       Exec    "Qix"           exec xlock -mode qix +complete &
+       Exec    "Qix complete"  exec xlock -mode qix -complete &
+       Exec    "Rotor"         exec xlock -mode rotor &
+       Exec    "Shape"         exec xlock -mode shape &
+       Exec    "Sphere"        exec xlock -mode sphere &
+       Exec    "Spiral"        exec xlock -mode spiral &
+       Exec    "Spline"        exec xlock -mode spline &
+       Exec    "Tik_Tak"       exec xlock -mode tik_tak &
+       Exec    "Random Geometry"       exec xlock -mode random -modelist allgeometry -fullrandom &
+EndPopup
+
+Popup "Space-Lock"
+       Title   "Space-Lock"
+       Exec    "Bouboule"      exec xlock -mode bouboule +use3d &
+       Exec    "Bouboule3d"    exec xlock -mode bouboule -use3d &
+       Exec    "Galaxy"        exec xlock -mode galaxy &
+       Exec    "Grav"          exec xlock -mode grav +trail +decay &
+       Exec    "Grav Trail"    exec xlock -mode grav -trail &
+       Exec    "Grav Decay"    exec xlock -mode grav -decay &
+       Exec    "Rock"i         exec xlock -mode star -rock &
+       Exec    "Scooter"       exec xlock -mode scooter &
+       Exec    "Space"         exec xlock -mode space &
+       Exec    "Star"          exec xlock -mode star +rock +use3d -trek 0 &
+       Exec    "Star3dk"       exec xlock -mode star -use3d &
+       Exec    "Star Trek"     exec xlock -mode star -trek 100 &
+       Exec    "World"         exec xlock -mode world &
+       Exec    "Random Space"  exec xlock -mode random -modelist allspace -fullrandom &
+EndPopup
+
+Popup "Assorted-Lock"
+       Title   "Assorted-Lock"
+       Exec    "Ball"          exec xlock -mode ball &
+       Exec    "Blot"          exec xlock -mode blot &
+       Exec    "Bounce"        exec xlock -mode bounce &
+       Exec    "Bubble"        exec xlock -mode bubble &
+       Exec    "Clock"         exec xlock -mode clock &
+       Exec    "Crystal"       exec xlock -mode crystal &
+       Exec    "Daisy"         exec xlock -mode daisy &
+       Exec    "Dclock"        exec xlock -mode dclock &
+       Exec    "Decay"         exec xlock -mode decay &
+       Exec    "Deco"          exec xlock -mode deco &
+       Exec    "Eyes"          exec xlock -mode eyes +trackmouse &
+       Exec    "Eyesptr"       exec xlock -mode eyes -trackmouse &
+       Exec    "Goop"          exec xlock -mode goop &
+       Exec    "Juggle"        exec xlock -mode juggle &
+       Exec    "Marquee"       exec xlock -mode marquee &
+       Exec    "Matrix"        exec xlock -mode matrix &
+       Exec    "Munch"         exec xlock -mode munch &
+       Exec    "Nose"          exec xlock -mode nose &
+       Exec    "Pacman"        exec xlock -mode pacman &
+       Exec    "Pyro"          exec xlock -mode pyro +use3d &
+       Exec    "Pyro3d"        exec xlock -mode pyro -use3d &
+       Exec    "Roll"          exec xlock -mode roll &
+       Exec    "Slip"          exec xlock -mode slip &
+       Exec    "Solitare"      exec xlock -mode solitare +trackmouse &
+       Exec    "Solitareptr"   exec xlock -mode solitare -trackmouse &
+       Exec    "Starfish"      exec xlock -mode starfish -install &
+       Exec    "Swarm"         exec xlock -mode swarm +trackmouse &
+       Exec    "Swarmptr"      exec xlock -mode swarm -trackmouse &
+       Exec    "Swirl"         exec xlock -mode swirl -install &
+       Exec    "Tetris"        exec xlock -mode t3d &
+       Exec    "Tetris"        exec xlock -mode tetris &
+       Exec    "Tube"          exec xlock -mode tube -install &
+       Exec    "Worm"          exec xlock -mode worm +use3d &
+       Exec    "Worm3d"        exec xlock -mode worm -use3d &
+       Exec    "Xcl"           exec xlock -mode xcl &
+       Exec    "Xjack"         exec xlock -mode xjack &
+EndPopup
+
+Popup "XPM-Lock"
+       Exec    "Bat"           exec xlock -mode bat &
+       Exec    "Image"         exec xlock -mode image &
+       Exec    "Flag"          exec xlock -mode flag &
+       Exec    "Life"          exec xlock -mode life &
+       Exec    "Life1d"        exec xlock -mode life1d &
+       Exec    "Maze"          exec xlock -mode maze &
+       Exec    "Puzzle"        exec xlock -mode puzzle &
+       Exec    "Random XPM"    exec xlock -mode random -modelist allxpm -fullrandom &
+EndPopup
+
+Popup "GL-Lock"
+       Exec    "Atlantis"      exec xlock -mode atlantis &
+       Exec    "Bubble3d"      exec xlock -mode bubble3d &
+       Exec    "Cage"          exec xlock -mode cage &
+       Exec    "Fire"          exec xlock -mode fire &
+       Exec    "Gears"         exec xlock -mode gears &
+       Exec    "GL-Planet"     exec xlock -mode glplanet &
+       Exec    "Invert"        exec xlock -mode invert &
+       Exec    "Lament"        exec xlock -mode lament &
+       Exec    "Moebius"       exec xlock -mode moebius &
+       Exec    "Molecule"      exec xlock -mode molecule &
+       Exec    "Morph3d"       exec xlock -mode morph3d &
+       Exec    "Pipes"         exec xlock -mode pipes &
+       Exec    "Rubik"         exec xlock -mode rubik &
+       Exec    "Sballs"        exec xlock -mode sballs &
+       Exec    "Sierpinski3d"  exec xlock -mode sierpinski3d &
+       Exec    "Sproingies"    exec xlock -mode sproingies &
+       Exec    "Stairs"        exec xlock -mode stairs &
+       Exec    "Superquadrics" exec xlock -mode superquadrics &
+       Exec    "Random GL"     exec xlock -mode random -modelist allgl -fullrandom &
+EndPopup
+
+Popup "Marquee-Message-Lock"
+       Title   "Marquee-Message-Lock"
+       Exec    "Back Soon"     exec xlock -mode marquee -message "$LOGNAME will be back soon." &
+       Exec    "Overnight"     exec xlock -mode marquee -message "$LOGNAME will be back in the morning." &
+       Exec    "Rude"          exec xlock -mode marquee -message "$LOGNAME not here, please go away! " &
+EndPopup
+
+Popup "Nose-Message-Lock"
+       Title   "Nose-Message-Lock"
+       Exec    "Back Soon"     exec xlock -mode nose -message "$LOGNAME will be back soon."
+       Exec    "Overnight"     exec xlock -mode nose -message "$LOGNAME will be back in the morning." &
+       Exec    "Rude"  exec xlock -mode nose -message "$LOGNAME not here, please go away! " &
+EndPopup
+
+Popup "Xjack-Message-Lock"
+       Title   "Xjack-Message-Lock"
+       Exec    "Crazy Boy"     exec xlock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+       Exec    "Crazy Girl"    exec xlock -mode xjack -message "All work and no play makes $LOGNAME a dull girl." &
+EndPopup
+
+Popup "Special-Lock"
+       Title   "Special-Lock"
+       Exec    "Blank" exec xlock -mode blank &
+       Exec    "Transparent"   exec xlock -mode blank -geometry 1x1 -enablesaver &
+       Exec    "Bomb"  exec xlock -mode bomb &
+       Exec    "Random nice"   exec xlock -mode random -modelist allnice -fullrandom -neighbors 0 &
+       Exec    "Random standard"       exec xlock -mode random -modelist all-allgl -fullrandom -neighbors 0 &
+       Exec    "Random all"    exec xlock -mode random -modelist all -fullrandom -neighbors 0 &
+       Exec    "Random 3d"     exec xlock -mode random -modelist all3d -use3d -fullrandom &
+       Exec    "Random ptr"    exec xlock -mode random -modelist allmouse -trackmouse -fullrandom &
+       Exec    "Random write"  exec xlock -mode random -modelist allwrite -fullrandom &
+EndPopup
+
+Popup "Screenlock"
+       Title   "Screenlock"
+       Popup   "Cellular Automata"     Automata-Lock
+       Nop     ""
+       Popup   "Fractal"       Fractal-Lock
+       Nop     ""
+       Popup   "Geometry"      Geometry-Lock
+       Nop     ""
+       Popup   "Space"         Space-Lock
+       Nop     ""
+       Popup   "Assorted"      Assorted-Lock
+       Nop     ""
+       Popup   "XPM"           XPM-Lock
+       Nop     ""
+       Popup   "GL"            GL-Lock
+       Nop     ""
+       Popup   "Marquee Message"       Marquee-Message-Lock
+       Nop     ""
+       Popup   "Nose Message"  Nose-Message-Lock
+       Nop     ""
+       Popup   "Xjack Message" Xjack-Message-Lock
+       Nop     ""
+       Popup   "Special"       Special-Lock
+EndPopup
+
+Popup "Automata-Saver"
+       Title   "Automata-Saver"
+       Exec    "Ant"           exec xlock -nolock -mode ant -neighbors 4 +truchet &
+       Exec    "Ant Truchet"   exec xlock -nolock -mode ant -neighbors 4 -truchet &
+       Exec    "Bee"           exec xlock -nolock -mode ant -neighbors 6 +truchet &
+       Exec    "Bee Truchet"   exec xlock -nolock -mode ant -neighbors 6 -truchet &
+       Exec    "Bug"           exec xlock -nolock -mode bug &
+       Exec    "Demon"         exec xlock -nolock -mode demon &
+       Exec    "Dilemma"       exec xlock -nolock -mode dilemma &
+       Exec    "Life"          exec xlock -nolock -mode life &
+       Exec    "Life Callahan" exec xlock -nolock -mode life -callahan -size 7 &
+       Exec    "Life1d"        exec xlock -nolock -mode life1d &
+       Exec    "Life3d"        exec xlock -nolock -mode life3d &
+       Exec    "Loop"          exec xlock -nolock -mode loop &
+       Exec    "Voters"        exec xlock -nolock -mode voters &
+       Exec    "Wator"         exec xlock -nolock -mode wator &
+       Exec    "Wire"          exec xlock -nolock -mode wire &
+       Exec    "Random Automata"       exec xlock -nolock -mode random -modelist allautomata -fullrandom -neighbors 0 &
+
+EndPopup
+
+Popup "Fractal-Saver"
+       Title   "Fractal-Saver"
+       Exec    "Coral"         exec xlock -nolock -mode coral &
+       Exec    "Discrete"      exec xlock -nolock -mode discrete &
+       Exec    "Dragon"        exec xlock -nolock -mode dragon &
+       Exec    "Drift"         exec xlock -nolock -mode drift -fullrandom &
+       Exec    "Euler2d"       exec xlock -nolock -mode euler2d &
+       Exec    "Flame"         exec xlock -nolock -mode flame &
+       Exec    "Flow"          exec xlock -nolock -mode flow &
+       Exec    "Forest"        exec xlock -nolock -mode forest &
+       Exec    "Hop"           exec xlock -nolock -mode hop -fullrandom &
+       Exec    "IFS"           exec xlock -nolock -mode ifs &
+       Exec    "Julia"         exec xlock -nolock -mode julia +trackmouse &
+       Exec    "Juliaptr"      exec xlock -nolock -mode julia -trackmouse &
+       Exec    "Kumppa"        exec xlock -nolock -mode kumppa &
+       Exec    "Lightning"     exec xlock -nolock -mode lightning &
+       Exec    "Lyapunov"      exec xlock -nolock -mode lyapunov -install &
+       Exec    "Mandelbrot"    exec xlock -nolock -mode mandelbrot -install &
+       Exec    "Mountain"      exec xlock -nolock -mode mountain &
+       Exec    "Sierpinski"    exec xlock -nolock -mode sierpinski &
+       Exec    "Strange"       exec xlock -nolock -mode strange &
+       Exec    "Thornbird"     exec xlock -nolock -mode thornbird &
+       Exec    "Triangle"      exec xlock -nolock -mode triangle &
+       Exec    "Turtle"        exec xlock -nolock -mode turtle &
+       Exec    "Vines"         exec xlock -nolock -mode vines &
+       Exec    "Random Fractal"        exec xlock -nolock -mode random -modelist allfractal -fullrandom &
+EndPopup
+
+Popup "Geometry-Saver"
+       Title   "Geometry-Saver"
+       Exec    "Braid"         exec xlock -nolock -mode braid &
+       Exec    "Fadeplot"      exec xlock -nolock -mode fadeplot &
+       Exec    "Helix"         exec xlock -nolock -mode helix -fullrandom &
+       Exec    "Hyper"         exec xlock -nolock -mode hyper &
+       Exec    "Ico"           exec xlock -nolock -mode ico &
+       Exec    "Kaleid"        exec xlock -nolock -mode kaleid &
+       Exec    "Laser"         exec xlock -nolock -mode laser &
+       Exec    "Lisa"          exec xlock -nolock -mode lisa &
+       Exec    "Lissiekk"      exec xlock -nolock -mode lissie &
+       Exec    "Penrose"       exec xlock -nolock -mode penrose +ammann &
+       Exec    "Penrose Ammann"        exec xlock -nolock -mode penrose -ammann &
+       Exec    "Petal"         exec xlock -nolock -mode petal &
+       Exec    "Polyominoes"   exec xlock -nolock -mode polyominoes &
+       Exec    "Qix"           exec xlock -nolock -mode qix +complete &
+       Exec    "Qix complete"  exec xlock -nolock -mode qix -complete &
+       Exec    "Rotor"         exec xlock -nolock -mode rotor &
+       Exec    "Shape"         exec xlock -nolock -mode shape &
+       Exec    "Sphere"        exec xlock -nolock -mode sphere &
+       Exec    "Spiral"        exec xlock -nolock -mode spiral &
+       Exec    "Spline"        exec xlock -nolock -mode spline &
+       Exec    "Tik_Tak"       exec xlock -nolock -mode tik_tak &
+       Exec    "Random Geometry"       exec xlock -nolock -mode random -modelist allgeometry -fullrandom &
+EndPopup
+
+Popup "Space-Saver"
+       Title   "Space-Saver"
+       Exec    "Bouboule"      exec xlock -nolock -mode bouboule +use3d &
+       Exec    "Bouboule3d"    exec xlock -nolock -mode bouboule -use3d &
+       Exec    "Galaxy"        exec xlock -nolock -mode galaxy &
+       Exec    "Grav"          exec xlock -nolock -mode grav +trail +decay &
+       Exec    "Grav Trail"    exec xlock -nolock -mode grav -trail &
+       Exec    "Grav Decay"    exec xlock -nolock -mode grav -decay &
+       Exec    "Rock"          exec xlock -nolock -mode star -rock &
+       Exec    "Scooter"       exec xlock -nolock -mode scooter &
+       Exec    "Space"         exec xlock -nolock -mode space &
+       Exec    "Star"          exec xlock -nolock -mode star +rock +use3d +trek 0 &
+       Exec    "Star3d"        exec xlock -nolock -mode star -use3d &
+       Exec    "Star Trek"     exec xlock -nolock -mode star -trek 100 &
+       Exec    "World"         exec xlock -nolock -mode world &
+       Exec    "Random Space"  exec xlock -nolock -mode random -modelist allspace -fullrandom &
+EndPopup
+
+Popup "Assorted-Saver"
+       Title   "Assorted-Saver"
+       Exec    "Ball"          exec xlock -nolock -mode ball &
+       Exec    "Blot"          exec xlock -nolock -mode blot &
+       Exec    "Bounce"        exec xlock -nolock -mode bounce &
+       Exec    "Bubble"        exec xlock -nolock -mode bubble &
+       Exec    "Clock"         exec xlock -nolock -mode clock &
+       Exec    "Crystal"       exec xlock -nolock -mode crystal &
+       Exec    "Daisy"         exec xlock -nolock -mode daisy &
+       Exec    "Dclock"        exec xlock -nolock -mode dclock &
+       Exec    "Decay"         exec xlock -nolock -mode decay &
+       Exec    "Deco"          exec xlock -nolock -mode deco &
+       Exec    "Eyes"          exec xlock -nolock -mode eyes +trackmouse &
+       Exec    "Eyesptr"       exec xlock -nolock -mode eyes -trackmouse &
+       Exec    "Goop"          exec xlock -nolock -mode goop &
+       Exec    "Juggle"        exec xlock -nolock -mode juggle &
+       Exec    "Marquee"       exec xlock -nolock -mode marquee &
+       Exec    "Matrix"        exec xlock -nolock -mode matrix &
+       Exec    "Munch"         exec xlock -nolock -mode munch &
+       Exec    "Nose"          exec xlock -nolock -mode nose &
+       Exec    "Pacman"        exec xlock -nolock -mode pacman &
+       Exec    "Pyro"          exec xlock -nolock -mode pyro +use3d &
+       Exec    "Pyro3d"        exec xlock -nolock -mode pyro -use3d &
+       Exec    "Roll"          exec xlock -nolock -mode roll &
+       Exec    "Slip"          exec xlock -nolock -mode slip &
+       Exec    "Solitare"      exec xlock -nolock -mode solitare +trackmouse &
+       Exec    "Solitareptr"   exec xlock -nolock -mode solitare -trackmouse &
+       Exec    "Starfish"      exec xlock -nolock -mode starfish -install &
+       Exec    "Swarm"         exec xlock -nolock -mode swarm +trackmouse &
+       Exec    "Swarmptr"      exec xlock -nolock -mode swarm -trackmouse &
+       Exec    "Swirl"         exec xlock -nolock -mode swirl -install &
+       Exec    "T3d"           exec xlock -nolock -mode t3d &
+       Exec    "Tetris"        exec xlock -nolock -mode tetris &
+       Exec    "Tube"          exec xlock -nolock -mode tube -install &
+       Exec    "Worm"          exec xlock -nolock -mode worm +use3d &
+       Exec    "Worm3d"        exec xlock -nolock -mode worm -use3d &
+       Exec    "Xcl"           exec xlock -nolock -mode xcl &
+       Exec    "Xjack"         exec xlock -nolock -mode xjack &
+EndPopup
+
+Popup "XPM-Saver"
+       Exec    "Bat"           exec xlock -nolock -mode bat &
+       Exec    "Image"         exec xlock -nolock -mode image &
+       Exec    "Flag"          exec xlock -nolock -mode flag &
+       Exec    "Life"          exec xlock -nolock -mode life &
+       Exec    "Life1d"        exec xlock -nolock -mode life1d &
+       Exec    "Maze"          exec xlock -nolock -mode maze &
+       Exec    "Puzzle"        exec xlock -nolock -mode puzzle &
+       Exec    "Random XPM"    exec xlock -nolock -mode random -modelist allxpm -fullrandom &
+EndPopup
+
+Popup "GL-Saver"
+       Exec    "Atlantis"      exec xlock -nolock -mode atlantis &
+       Exec    "Bubble3d"      exec xlock -nolock -mode bubble3d &
+       Exec    "Cage"          exec xlock -nolock -mode cage &
+       Exec    "Fire"          exec xlock -nolock -mode fire &
+       Exec    "Gears"         exec xlock -nolock -mode gears &
+       Exec    "GL-Planet"     exec xlock -nolock -mode glplanet &
+       Exec    "Invert"        exec xlock -nolock -mode invert &
+       Exec    "Lament"        exec xlock -nolock -mode lament &
+       Exec    "Moebius"       exec xlock -nolock -mode moebius &
+       Exec    "Molecule"      exec xlock -nolock -mode molecule &
+       Exec    "Morph3d"       exec xlock -nolock -mode morph3d &
+       Exec    "Pipes"         exec xlock -nolock -mode pipes &
+       Exec    "Rubik"         exec xlock -nolock -mode rubik &
+       Exec    "Sballs"        exec xlock -nolock -mode sballs &
+       Exec    "Sierpinski3d"  exec xlock -nolock -mode sierpinski3d &
+       Exec    "Sproingies"    exec xlock -nolock -mode sproingies &
+       Exec    "Stairs"        exec xlock -nolock -mode stairs &
+       Exec    "Superquadrics" exec xlock -nolock -mode superquadrics &
+       Exec    "Random GL"     exec xlock -nolock -mode random -modelist allgl -fullrandom &
+EndPopup
+
+Popup "Marquee-Message-Saver"
+       Title   "Marquee-Message-Saver"
+       Exec    "Brilliant"     exec xlock -nolock -mode marquee -message "WOW! $LOGNAME, You are Brilliant! " &
+       Exec    "Love You"      exec xlock -mode marquee -message "You know, I Love You $LOGNAME." &
+       Exec    "Available"     exec xlock -mode marquee -message "Hey, I am available now! " &
+EndPopup
+
+Popup "Nose-Message-Saver"
+       Title   "Nose-Message-Saver"
+       Exec    "Brilliant!"    exec xlock -mode nose -message "WOW! $LOGNAME, You are Briilliant! "
+       Exec    "Love You"      exec xlock -mode nose -message "You know, I Love You $LOGNAME." &
+       Exec    "Available"     exec xlock -mode nose -message "Hey, I am available now! " &
+EndPopup
+
+Popup "Xjack-Message-Saver"
+       Title   "Xjack-Message-Saver"
+       Exec    "Crazy Boy"     exec xlock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+       Exec    "Crazy Girl"    exec xlock -mode xjack -message "All work and no play makes $LOGNAME a dull girl." &
+EndPopup
+
+Popup "Special-Saver"
+       Title   "Special-Saver"
+       Exec    "Blank"         exec xlock -nolock -mode blank &
+       Exec    "Bomb"          exec xlock -nolock -mode bomb &
+       Exec    "Random nice"   exec xlock -nolock -mode random -modelist allnice -fullrandom -neighbors 0 &
+       Exec    "Random standard"       exec xlock -nolock -mode random -modelist all-allgl -fullrandom -neighbors 0 &
+       Exec    "Random all"    exec xlock -nolock -mode random -modelist all -fullrandom -neighbors 0 &
+       Exec    "Random 3d"     exec xlock -nolock -mode random -modelist all3d -use3d -fullrandom &
+       Exec    "Random ptr"    exec xlock -nolock -mode random -modelist allmouse -trackmouse -fullrandom &
+       Exec    "Random write"  exec xlock -nolock -mode random -modelist allwrite -fullrandom &
+EndPopup
+
+Popup "Screensaver"
+       Title   "Screensaver"
+       Popup   "Cellular Automata"     Automata-Saver
+       Nop     ""
+       Popup   "Fractal"       Fractal-Saver
+       Nop     ""
+       Popup   "Geometry"      Geometry-Saver
+       Nop     ""
+       Popup   "Space"         Space-Saver
+       Nop     ""
+       Popup   "Assorted"      Assorted-Saver
+       Nop     ""
+       Popup   "XPM"           XPM-Saver
+       Nop     ""
+       Popup   "GL"            GL-Saver
+       Nop     ""
+       Popup   "Marquee Message"       Marquee-Message-Saver
+       Nop     ""
+       Popup   "Nose Message"  Nose-Message-Saver
+       Nop     ""
+       Popup   "Xjack Message" Xjack-Message-Saver
+       Nop     ""
+       Popup   "Special"       Special-Saver
+EndPopup
+
+Popup "Lock_Saver"
+       Title   "Lock_Saver"
+       Popup   "Screenlock"    Screenlock
+       Nop     ""
+       Popup   "Screensaver"   Screensaver
+EndPopup
diff --git a/etc/system.mwmrc.xlock b/etc/system.mwmrc.xlock
new file mode 100644 (file)
index 0000000..bc4d7d3
--- /dev/null
@@ -0,0 +1,493 @@
+# Add this to your system or personal menu file contents
+# System
+#  Motif file: /usr/lib/X11/system.mwmrc
+#  Desktop file: /usr/dt/config/C/sys.dtwmrc
+# Personal
+#  Motif file: $HOME/.mwmrc
+#  Desktop file: $HOME/.dt/dtwmrc
+# Put this in your RootMenu (mwm) or ProgramsMenu (dtwm) uncommented.
+#  "Lock_Saver"        f.menu Lock_Saver
+# For dt you may have to add the full path of xlock to "xlock" depending
+# whether the location xlock is installed is in a path of DT.
+# See /usr/dt/bin/Xsession look for instances of $PATH for system setup.
+# See supplied dtprofile for personal setup...i.e. DTSOURCEPROFILE=true
+
+Menu Automata-Lock
+{
+       "Automata-Lock" f.title
+       "Ant"           f.exec "xlock -mode ant -neighbors 4 +truchet &"
+       "Ant Truchet"   f.exec "xlock -mode ant -neighbors 4 -truchet &
+       "Bee"           f.exec "xlock -mode ant -neighbors 6 +truchet &"
+       "Bee Truchet"   f.exec "xlock -mode ant -neighbors 6 -truchet &"
+       "Bug"           f.exec "xlock -mode bug &"
+       "Demon"         f.exec "xlock -mode demon &"
+       "Dilemma"       f.exec "xlock -mode dilemma &"
+       "Life"          f.exec "xlock -mode life &"
+       "Life Callahan" f.exec "xlock -mode life -callahan -size 7 &"
+       "Life1d"        f.exec "xlock -mode life1d &"
+       "Life3d"        f.exec "xlock -mode life3d &"
+       "Loop"          f.exec "xlock -mode loop &"
+       "Voters"        f.exec "xlock -mode voters &"
+       "Wator"         f.exec "xlock -mode wator &"
+       "Wire"          f.exec "xlock -mode wire &"
+       "Random Automata"       f.exec "xlock -mode random -modelist allautomata -fullrandom -neighbors 0 &"
+}
+
+Menu Fractal-Lock
+{
+       "Fractal-Lock"  f.title
+       "Coral"         f.exec "xlock -mode coral &"
+       "Discrete"      f.exec "xlock -mode discrete &"
+       "Dragon"        f.exec "xlock -mode dragon &"
+       "Drift"         f.exec "xlock -mode drift -fullrandom &"
+       "Euler2d"       f.exec "xlock -mode euler2d &"
+       "Flame"         f.exec "xlock -mode flame &"
+       "Flow"          f.exec "xlock -mode flow &"
+       "Forest"        f.exec "xlock -mode forest &"
+       "Hop"           f.exec "xlock -mode hop -fullrandom &"
+       "IFS"           f.exec "xlock -mode ifs &"
+       "Julia"         f.exec "xlock -mode julia +trackmouse &"
+       "Juliaptr"      f.exec "xlock -mode julia -trackmouse &"
+       "Kumppa"        f.exec "xlock -mode kumppa &"
+       "Lightning"     f.exec "xlock -mode lightning &"
+       "Lyapunov"      f.exec "xlock -mode lyapunov -install &"
+       "Mandelbrot"    f.exec "xlock -mode mandelbrot -install &"
+       "Mountain"      f.exec "xlock -mode mountain &"
+       "Sierpinski"    f.exec "xlock -mode sierpinski &"
+       "Strange"       f.exec "xlock -mode strange &"
+       "Thornbird"     f.exec "xlock -mode thornbird &"
+       "Triangle"      f.exec "xlock -mode triangle &"
+       "Turtle"        f.exec "xlock -mode turtle &"
+       "Vines"         f.exec "xlock -mode vines &"
+       "Random Fractal"        f.exec "xlock -mode random -modelist allfractal -fullrandom &"
+}
+
+Menu Geometry-Lock
+{
+       "Geometry-Lock" f.title
+       "Braid"         f.exec "xlock -mode braid &"
+       "Fadeplot"      f.exec "xlock -mode fadeplot &"
+       "Helix"         f.exec "xlock -mode helix -fullrandom &"
+       "Hyper"         f.exec "xlock -mode hyper &"
+       "Ico"           f.exec "xlock -mode ico &"
+       "Kaleid"        f.exec "xlock -mode kaleid &"
+       "Laser"         f.exec "xlock -mode laser &"
+       "Lisa"          f.exec "xlock -mode lisa &"
+       "Lissie"        f.exec "xlock -mode lissie &"
+       "Penrose"       f.exec "xlock -mode penrose +ammann &"
+       "Penrose Ammann"        f.exec "xlock -mode penrose -ammann &"
+       "Petal"         f.exec "xlock -mode petal &"
+       "Polyominoes"   f.exec "xlock -mode polyominoes &"
+       "Qix"           f.exec "xlock -mode qix +complete &"
+       "Qix complete"  f.exec "xlock -mode qix -complete &"
+       "Rotor"         f.exec "xlock -mode rotor &"
+       "Shape"         f.exec "xlock -mode shape &"
+       "Sphere"        f.exec "xlock -mode sphere &"
+       "Spiral"        f.exec "xlock -mode spiral &"
+       "Spline"        f.exec "xlock -mode spline &"
+       "Tik_Tak"       f.exec "xlock -mode tik_tak &"
+       "Random Geometry"       f.exec "xlock -mode random -modelist allgeometry -fullrandom &"
+}
+
+Menu Space-Lock
+{
+       "Space-Lock"    f.title
+       "Bouboule"      f.exec "xlock -mode bouboule +use3d &"
+       "Bouboule3d"    f.exec "xlock -mode bouboule -use3d &"
+       "Galaxy"        f.exec "xlock -mode galaxy &"
+       "Grav"          f.exec "xlock -mode grav +trail +decay &"
+       "Grav Trail"    f.exec "xlock -mode grav -trail &"
+       "Grav Decay"    f.exec "xlock -mode grav -decay &"
+       "Rock"          f.exec "xlock -mode star -rock &"
+       "Scooter"       f.exec "xlock -mode scooter &"
+       "Space"         f.exec "xlock -mode space &"
+       "Star"          f.exec "xlock -mode star +rock +use3d -trek 0 &"
+       "Star3d"        f.exec "xlock -mode star -use3d &"
+       "Star Trek"     f.exec "xlock -mode star -trek 100 &"
+       "World"         f.exec "xlock -mode world &"
+       "Random Space"  f.exec "xlock -mode random -modelist allspace -fullrandom &"
+}
+
+Menu Assorted-Lock
+{
+       "Assorted-Lock" f.title
+       "Ball"          f.exec "xlock -mode ball &"
+       "Blot"          f.exec "xlock -mode blot &"
+       "Bounce"        f.exec "xlock -mode bounce &"
+       "Bubble"        f.exec "xlock -mode bubble &"
+       "Clock"         f.exec "xlock -mode clock &"
+       "Crystal"       f.exec "xlock -mode crystal &"
+       "Daisy"         f.exec "xlock -mode daisy &"
+       "Dclock"        f.exec "xlock -mode dclock &"
+       "Decay"         f.exec "xlock -mode decay &"
+       "Deco"          f.exec "xlock -mode deco &"
+       "Eyes"          f.exec "xlock -mode eyes +trackmouse &"
+       "Eyesptr"       f.exec "xlock -mode eyes -trackmouse &"
+       "Goop"          f.exec "xlock -mode goop &"
+       "Juggle"        f.exec "xlock -mode juggle &"
+       "Marquee"       f.exec "xlock -mode marquee &"
+       "Matrix"        f.exec "xlock -mode matrix &"
+       "Munch"         f.exec "xlock -mode munch &"
+       "Nose"          f.exec "xlock -mode nose &"
+       "Pacman"        f.exec "xlock -mode pacman &"
+       "Pyro"          f.exec "xlock -mode pyro +use3d &"
+       "Pyro3d"        f.exec "xlock -mode pyro -use3d &"
+       "Roll"          f.exec "xlock -mode roll &"
+       "Slip"          f.exec "xlock -mode slip &"
+       "Solitare"      f.exec "xlock -mode solitare +trackmouse &"
+       "Solitareptr"   f.exec "xlock -mode solitare -trackmouse &"
+       "Starfish"      f.exec "xlock -mode starfish -install &"
+       "Swarm"         f.exec "xlock -mode swarm +trackmouse &"
+       "Swarmptr"      f.exec "xlock -mode swarm -trackmouse &"
+       "Swirl"         f.exec "xlock -mode swirl -install &"
+       "T3d"           f.exec "xlock -mode t3d &"
+       "Tetris"        f.exec "xlock -mode tetris &"
+       "Tube"          f.exec "xlock -mode tube -install &"
+       "Worm"          f.exec "xlock -mode worm +use3d &"
+       "Worm3d"        f.exec "xlock -mode worm -use3d &"
+       "Xcl"           f.exec "xlock -mode xcl &"
+       "Xjack"         f.exec "xlock -mode xjack &"
+}
+
+Menu XPM-Lock
+{
+       "XPM-Lock" f.title
+       "Bat"           f.exec "xlock -mode bat &"
+       "Image"         f.exec "xlock -mode image &"
+       "Flag"          f.exec "xlock -mode flag &"
+       "Life"          f.exec "xlock -mode life &"
+       "Life1d"        f.exec "xlock -mode life1d &"
+       "Maze"          f.exec "xlock -mode maze &"
+       "Puzzle"        f.exec "xlock -mode puzzle &"
+       "Random XPM"    f.exec "xlock -mode random -modelist allxpm -fullrandom &"
+}
+
+Menu GL-Lock
+{
+       "GL-Lock" f.title
+       "Atlantis"      f.exec "xlock -mode atlantis &"
+       "Bubble3d"      f.exec "xlock -mode bubble3d &"
+       "Cage"          f.exec "xlock -mode cage &"
+       "Fire"          f.exec "xlock -mode fire &"
+       "Gears"         f.exec "xlock -mode gears &"
+       "GL-Planet"     f.exec "xlock -mode glplanet &"
+       "Invert"        f.exec "xlock -mode invert &"
+       "Lament"        f.exec "xlock -mode lament &"
+       "Moebius"       f.exec "xlock -mode moebius &"
+       "Molecule"      f.exec "xlock -mode molecule &"
+       "Morph3d"       f.exec "xlock -mode morph3d &"
+       "Pipes"         f.exec "xlock -mode pipes &"
+       "Rubik"         f.exec "xlock -mode rubik &"
+       "Sballs"        f.exec "xlock -mode sballs &"
+       "Sierpinski3d"  f.exec "xlock -mode sierpinski3d &"
+       "Sproingies"    f.exec "xlock -mode sproingies &"
+       "Stairs"        f.exec "xlock -mode stairs &"
+       "Superquadrics" f.exec "xlock -mode superquadrics &"
+       "Random GL"     f.exec "xlock -mode random -modelist allgl -fullrandom &"
+}
+
+Menu Marquee-Message-Lock
+{
+       "Marquee-Message-Lock"  f.title
+       "Back Soon"     f.exec "xlock -mode marquee -message "$LOGNAME will be back soon." &"
+       "Overnight"     f.exec "xlock -mode marquee -message "$LOGNAME will be back in the morning." &"
+       "Rude"          f.exec "xlock -mode marquee -message "$LOGNAME not here, please go away! " &"
+}
+
+Menu Nose-Message-Lock
+{
+       "Nose-Message-Lock"     f.title
+       "Back Soon"     f.exec "xlock -mode nose -message "$LOGNAME will be back soon."
+       "Overnight"     f.exec "xlock -mode nose -message "$LOGNAME will be back in the morning." &"
+       "Rude"          f.exec "xlock -mode nose -message "$LOGNAME not here, please go away! " &"
+}
+
+Menu Xjack-Message-Lock
+{
+       "Xjack-Message-Lock"    f.title
+       "Crazy Boy"     f.exec "xlock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+       "Crazy Girl"    f.exec "xlock -mode xjack -message "All work and no play makes $LOGNAME a dull girl." &"
+}
+
+Menu Special-Lock
+{
+       "Special-Lock"  f.title
+       "Blank"         f.exec "xlock -mode blank &"
+       "Transparent"   f.exec "xlock -mode blank -geometry 1x1 -enablesaver &"
+       "Bomb"          f.exec "xlock -mode bomb &"
+       "Random nice"   f.exec "xlock -mode random -modelist allnice -fullrandom -neighbors 0 &"
+       "Random standard"       f.exec "xlock -mode random -modelist all-allgl -fullrandom -neighbors 0 &"
+       "Random all"    f.exec "xlock -mode random -modelist all -fullrandom -neighbors 0 &"
+       "Random 3d"     f.exec "xlock -mode random -modelist all3d -use3d -fullrandom &"
+       "Random ptr"    f.exec "xlock -mode random -modelist allmouse -trackmouse -fullrandom &"
+       "Random write"  f.exec "xlock -mode random -modelist allwrite -fullrandom &"
+}
+
+Menu Screenlock
+{
+       "Screenlock" f.title
+       "Cellular Automata"     f.menu Automata-Lock
+       no-label        f.separator
+       "Fractal"       f.menu Fractal-Lock
+       no-label        f.separator
+       "Geometry"      f.menu Geometry-Lock
+       no-label        f.separator
+       "Space"         f.menu Space-Lock
+       no-label        f.separator
+       "Assorted"      f.menu Assorted-Lock
+       no-label        f.separator
+       "XPM"           f.menu XPM-Lock
+       no-label        f.separator
+       "GL"            f.menu GL-Lock
+       no-label        f.separator
+       "Marquee Message"       f.menu Marquee-Message-Lock
+       no-label        f.separator
+       "Nose Message"  f.menu Nose-Message-Lock
+       no-label        f.separator
+       "Xjack Message" f.menu Xjack-Message-Lock
+       no-label        f.separator
+       "Special"       f.menu Special-Lock
+}
+
+Menu Automata-Saver
+{
+       "Automata-Saver"        f.title
+       "Ant"           f.exec "xlock -nolock -mode ant -neighbors 4 +truchet &"
+       "Ant Truchet"   f.exec "xlock -nolock -mode ant -neighbors 4 -truchet &"
+       "Bee"           f.exec "xlock -nolock -mode ant -neighbors 6 +truchet &"
+       "Bee Truchet"   f.exec "xlock -nolock -mode ant -neighbors 6 -truchet &"
+       "Bug"           f.exec "xlock -nolock -mode bug &"
+       "Demon"         f.exec "xlock -nolock -mode demon &"
+       "Dilemma"       f.exec "xlock -nolock -mode dilemma &"
+       "Life"          f.exec "xlock -nolock -mode life &"
+       "Life Callahan" f.exec "xlock -nolock -mode life -callahan -size 7 &"
+       "Life1d"        f.exec "xlock -nolock -mode life1d &"
+       "Life3d"        f.exec "xlock -nolock -mode life3d &"
+       "Loop"          f.exec "xlock -nolock -mode loop &"
+       "Voters"        f.exec "xlock -nolock -mode voters &"
+       "Wator"         f.exec "xlock -nolock -mode wator &"
+       "Wire"          f.exec "xlock -nolock -mode wire &"
+       "Random Automata"       f.exec "xlock -nolock -mode random -modelist allautomata -fullrandom -neighbors 0 &"
+}
+
+Menu Fractal-Saver
+{
+       "Fractal-Saver" f.title
+       "Coral"         f.exec "xlock -nolock -mode coral &"
+       "Discrete"      f.exec "xlock -nolock -mode discrete &"
+       "Dragon"        f.exec "xlock -nolock -mode dragon &"
+       "Drift"         f.exec "xlock -nolock -mode drift -fullrandom &"
+       "Euler2d"       f.exec "xlock -nolock -mode euler2d &"
+       "Flame"         f.exec "xlock -nolock -mode flame &"
+       "Flow"          f.exec "xlock -nolock -mode flow &"
+       "Forest"        f.exec "xlock -nolock -mode forest &"
+       "Hop"           f.exec "xlock -nolock -mode hop -fullrandom &"
+       "IFS"           f.exec "xlock -nolock -mode ifs &"
+       "Julia"         f.exec "xlock -nolock -mode julia +trackmouse &"
+       "Juliaptr"      f.exec "xlock -nolock -mode julia -trackmouse &"
+       "Kumppa"        f.exec "xlock -nolock -mode kumppa &"
+       "Lightning"     f.exec "xlock -nolock -mode lightning &"
+       "Lyapunov"      f.exec "xlock -nolock -mode lyapunov -install &"
+       "Mandelbrot"    f.exec "xlock -nolock -mode mandelbrot -install &"
+       "Mountain"      f.exec "xlock -nolock -mode mountain &"
+       "Sierpinski"    f.exec "xlock -nolock -mode sierpinski &"
+       "Strange"       f.exec "xlock -nolock -mode strange &"
+       "Thornbird"     f.exec "xlock -nolock -mode thornbird &"
+       "Triangle"      f.exec "xlock -nolock -mode triangle &"
+       "Turtle"        f.exec "xlock -nolock -mode turtle &"
+       "Vines"         f.exec "xlock -nolock -mode vines &"
+       "Random Fractal"        f.exec "xlock -nolock -mode random -modelist allfractal -fullrandom &"
+}
+
+Menu Geometry-Saver
+{
+       "Geometry-Saver"        f.title
+       "Braid"         f.exec "xlock -nolock -mode braid &"
+       "Fadeplot"      f.exec "xlock -nolock -mode fadeplot &"
+       "Helix"         f.exec "xlock -nolock -mode helix -fullrandom &"
+       "Hyper"         f.exec "xlock -nolock -mode hyper &"
+       "Ico"           f.exec "xlock -nolock -mode ico &"
+       "Kaleid"        f.exec "xlock -nolock -mode kaleid &"
+       "Laser"         f.exec "xlock -nolock -mode laser &"
+       "Lisa"          f.exec "xlock -nolock -mode lisa &"
+       "Lissie"        f.exec "xlock -nolock -mode lissie &"
+       "Penrose"       f.exec "xlock -nolock -mode penrose +ammann &"
+       "Penrose Ammann"        f.exec "xlock -nolock -mode penrose -ammann &"
+       "Petal"         f.exec "xlock -nolock -mode petal &"
+       "Polyominoes"   f.exec "xlock -nolock -mode polyominoes &"
+       "Qix"           f.exec "xlock -nolock -mode qix +complete &"
+       "Qix complete"  f.exec "xlock -nolock -mode qix -complete &"
+       "Rotor"         f.exec "xlock -nolock -mode rotor &"
+       "Shape"         f.exec "xlock -nolock -mode shape &"
+       "Sphere"        f.exec "xlock -nolock -mode sphere &"
+       "Spiral"        f.exec "xlock -nolock -mode spiral &"
+       "Spline"        f.exec "xlock -nolock -mode spline &"
+       "Tik_Tak"       f.exec "xlock -nolock -mode tik_tak &"
+       "Random Geometry"       f.exec "xlock -nolock -mode random -modelist allgeometry -fullrandom &"
+}
+
+Menu Space-Saver
+{
+       "Space-Saver"   f.title
+       "Bouboule"      f.exec "xlock -nolock -mode bouboule +use3d &"
+       "Bouboule3d"    f.exec "xlock -nolock -mode bouboule -use3d &"
+       "Galaxy"        f.exec "xlock -nolock -mode galaxy &"
+       "Grav"          f.exec "xlock -nolock -mode grav +trail +decay &"
+       "Grav Trail"    f.exec "xlock -nolock -mode grav -trail &"
+       "Grav Decay"    f.exec "xlock -nolock -mode grav -decay &"
+       "Rock"          f.exec "xlock -nolock -mode star -rock &"
+       "Scooter"       f.exec "xlock -nolock -mode scooter &"
+       "Space"         f.exec "xlock -nolock -mode space &"
+       "Star"          f.exec "xlock -nolock -mode star +rock +use3d +trek 0 &"
+       "Star3d"        f.exec "xlock -nolock -mode star -use3d &"
+       "Star Trek"     f.exec "xlock -nolock -mode star -trek 100 &"
+       "World"         f.exec "xlock -nolock -mode world &"
+       "Random Space"  f.exec "xlock -nolock -mode random -modelist allspace -fullrandom &"
+}
+
+Menu Assorted-Saver
+{
+       "Assorted-Saver"        f.title
+       "Ball"          f.exec "xlock -nolock -mode ball &"
+       "Blot"          f.exec "xlock -nolock -mode blot &"
+       "Bounce"        f.exec "xlock -nolock -mode bounce &"
+       "Bubble"        f.exec "xlock -nolock -mode bubble &"
+       "Clock"         f.exec "xlock -nolock -mode clock &"
+       "Crystal"       f.exec "xlock -nolock -mode crystal &"
+       "Daisy"         f.exec "xlock -nolock -mode daisy &"
+       "Dclock"        f.exec "xlock -nolock -mode dclock &"
+       "Decay"         f.exec "xlock -nolock -mode decay &"
+       "Deco"          f.exec "xlock -nolock -mode deco &"
+       "Eyes"          f.exec "xlock -nolock -mode eyes +trackmouse &"
+       "Eyesptr"       f.exec "xlock -nolock -mode eyes -trackmouse &"
+       "Goop"          f.exec "xlock -nolock -mode goop &"
+       "Juggle"        f.exec "xlock -nolock -mode juggle &"
+       "Marquee"       f.exec "xlock -nolock -mode marquee &"
+       "Matrix"        f.exec "xlock -nolock -mode matrix &"
+       "Munch"         f.exec "xlock -nolock -mode munch &"
+       "Nose"          f.exec "xlock -nolock -mode nose &"
+       "Pacman"        f.exec "xlock -nolock -mode pacman &"
+       "Pyro"          f.exec "xlock -nolock -mode pyro +use3d &"
+       "Pyro3d"        f.exec "xlock -nolock -mode pyro -use3d &"
+       "Roll"          f.exec "xlock -nolock -mode roll &"
+       "Slip"          f.exec "xlock -nolock -mode slip &"
+       "Solitare"      f.exec "xlock -nolock -mode solitare +trackmouse &"
+       "Solitareptr"   f.exec "xlock -nolock -mode solitare -trackmouse &"
+       "Starfish"      f.exec "xlock -nolock -mode starfish -install &"
+       "Swarm"         f.exec "xlock -nolock -mode swarm +trackmouse &"
+       "Swarmptr"      f.exec "xlock -nolock -mode swarm -trackmouse &"
+       "Swirl"         f.exec "xlock -nolock -mode swirl -install &"
+       "T3d"           f.exec "xlock -nolock -mode t3d &"
+       "Tetris"        f.exec "xlock -nolock -mode tetris &"
+       "Tube"          f.exec "xlock -nolock -mode tube -install &"
+       "Worm"          f.exec "xlock -nolock -mode worm +use3d &"
+       "Worm3d"        f.exec "xlock -nolock -mode worm -use3d &"
+       "Xcl"           f.exec "xlock -nolock -mode xcl &"
+       "Xjack"         f.exec "xlock -nolock -mode xjack &"
+}
+
+Menu XPM-Saver
+{
+       "XPM-Saver"     f.title
+       "Bat"           f.exec "xlock -nolock -mode bat &"
+       "Image"         f.exec "xlock -nolock -mode image &"
+       "Flag"          f.exec "xlock -nolock -mode flag &"
+       "Life"          f.exec "xlock -nolock -mode life &"
+       "Life1d"        f.exec "xlock -nolock -mode life1d &"
+       "Maze"          f.exec "xlock -nolock -mode maze &"
+       "Puzzle"        f.exec "xlock -nolock -mode puzzle &"
+       "Random XPM"    f.exec "xlock -nolock -mode random -modelist allxpm -fullrandom &"
+}
+
+Menu GL-Saver
+{
+       "GL-Saver"      f.title
+       "Atlantis"      f.exec "xlock -nolock -mode atlantis &"
+       "Bubble3d"      f.exec "xlock -nolock -mode bubble3d &"
+       "Cage"          f.exec "xlock -nolock -mode cage &"
+       "Fire"          f.exec "xlock -nolock -mode fire &"
+       "Gears"         f.exec "xlock -nolock -mode gears &"
+       "GL-Planet"     f.exec "xlock -nolock -mode glplanet &"
+       "Invert"        f.exec "xlock -nolock -mode invert &"
+       "Lament"        f.exec "xlock -nolock -mode lament &"
+       "Moebius"       f.exec "xlock -nolock -mode moebius &"
+       "Molecule"      f.exec "xlock -nolock -mode molecule &"
+       "Morph3d"       f.exec "xlock -nolock -mode morph3d &"
+       "Pipes"         f.exec "xlock -nolock -mode pipes &"
+       "Rubik"         f.exec "xlock -nolock -mode rubik &"
+       "Sballs"        f.exec "xlock -nolock -mode sballs &"
+       "Sierpinski3d"  f.exec "xlock -nolock -mode sierpinski3d &"
+       "Sproingies"    f.exec "xlock -nolock -mode sproingies &"
+       "Stairs"        f.exec "xlock -nolock -mode stairs &"
+       "Superquadrics" f.exec "xlock -nolock -mode superquadrics &"
+       "Random GL"     f.exec "xlock -nolock -mode random -modelist allgl -fullrandom &"
+}
+
+Menu Marquee-Message-Saver
+{
+       "Marquee-Message-Saver" f.title
+       "Brilliant"     f.exec "xlock -nolock -mode marquee -message "WOW! $LOGNAME, You are Brilliant! " &"
+       "Love You"      f.exec "xlock -mode marquee -message "You know, I Love You $LOGNAME." &"
+       "Available"     f.exec "xlock -mode marquee -message "Hey, I am available now! " &"
+}
+
+Menu Nose-Message-Saver
+{
+       "Nose-Message-Saver"    f.title
+       "Brilliant!"    f.exec "xlock -mode nose -message "WOW! $LOGNAME, You are Briilliant! "
+       "Love You"      f.exec "xlock -mode nose -message "You know, I Love You $LOGNAME." &"
+       "Available"     f.exec "xlock -mode nose -message "Hey, I am available now! " &"
+}
+
+Menu Xjack-Message-Saver
+{
+       "Xjack-Message-Saver"   f.title
+       "Crazy Boy"     f.exec "xlock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+       "Crazy Girl"    f.exec "xlock -mode xjack -message "All work and no play makes $LOGNAME a dull girl." &"
+}
+
+Menu Special-Saver
+{
+       "Special-Saver" f.title
+       "Blank"         f.exec "xlock -nolock -mode blank &"
+       "Bomb"          f.exec "xlock -nolock -mode bomb &"
+       "Random nice"   f.exec "xlock -nolock -mode random -modelist allnice -fullrandom -neighbors 0 &"
+       "Random standard"       f.exec "xlock -nolock -mode random -modelist all-allgl -fullrandom -neighbors 0 &"
+       "Random all"    f.exec "xlock -nolock -mode random -modelist all -fullrandom -neighbors 0 &"
+       "Random 3d"     f.exec "xlock -nolock -mode random -modelist all3d -use3d -fullranodm &"
+       "Random ptr"    f.exec "xlock -nolock -mode random -modelist allmouse -trackmouse -fullrandom &"
+       "Random write"  f.exec "xlock -nolock -mode random -modelist allwrite -fullrandom &"
+}
+
+Menu Screensaver
+{
+       "Screensaver"   f.title
+       "Cellular Automata"     f.menu Automata-Saver
+       no-label        f.separator
+       "Fractal"       f.menu Fractal-Saver
+       no-label        f.separator
+       "Geometry"      f.menu Geometry-Saver
+       no-label        f.separator
+       "Space"         f.menu Space-Saver
+       no-label        f.separator
+       "Assorted"      f.menu Assorted-Saver
+       no-label        f.separator
+       "XPM"           f.menu XPM-Saver
+       no-label        f.separator
+       "GL"            f.menu GL-Saver
+       no-label        f.separator
+       "Marquee Message"       f.menu Marquee-Message-Saver
+       no-label        f.separator
+       "Nose Message"  f.menu Nose-Message-Saver
+       no-label        f.separator
+       "Xjack Message" f.menu Xjack-Message-Saver
+       no-label        f.separator
+       "Special"       f.menu Special-Saver
+}
+
+Menu "Lock_Saver"
+{
+       "Lock_Saver"    f.title
+       "Screenlock"    f.menu Screenlock
+       "Screensaver"   f.menu Screensaver
+}
diff --git a/etc/system.olwmrc.xlock b/etc/system.olwmrc.xlock
new file mode 100644 (file)
index 0000000..feaf875
--- /dev/null
@@ -0,0 +1,388 @@
+# Add this to your system or personal menu file
+# System: /usr/openwin/lib/openwin-menu
+# Personal $HOME/.openwin-menu
+# Put this in your menu uncommented.
+# "Lock_Saver" MENU   $THISFILEPATH/system.olwmrc.xlock
+
+# put this in your $OPENWINHOME/lib, usually $OPENWINHOME is /usr/openwin
+
+"Screenlock" MENU
+       "Screenlock" TITLE PIN
+       "Cellular Automata" MENU
+         "Automata" TITLE
+               "Ant"                   exec xlock -mode ant -neighbors 4 +truchet
+               "Ant Truchet"   exec xlock -mode ant -neighbors 4 -truchet
+               "Bee"                   exec xlock -mode ant -neighbors 6 +truchet
+               "Bee Truchet"   exec xlock -mode ant -neighbors 6 -truchet
+               "Bug"                   exec xlock -mode bug
+               "Demon"                 exec xlock -mode demon
+               "Dilemma"               exec xlock -mode dilemma
+               "Life"                  exec xlock -mode life
+               "Life Callahan" exec xlock -mode life -callahan -size 7
+               "Life1d"                exec xlock -mode life1d
+               "Life3d"                exec xlock -mode life3d
+               "Loop"                  exec xlock -mode loop
+               "Voters"                exec xlock -mode voters
+               "Wator"                 exec xlock -mode wator
+               "Wire"                  exec xlock -mode wire
+               "Random Automata"       DEFAULT exec xlock -mode random -modelist allautomata -fullrandom -neighbors 0
+       "Cellular Automata" END
+       "Fractal" MENU
+         "Fractal" TITLE
+               "Coral"                 exec xlock -mode coral
+               "Discrete"              exec xlock -mode discrete
+               "Dragon"                exec xlock -mode dragon
+               "Drift"                 exec xlock -mode drift -fullrandom
+               "Euler2d"               exec xlock -mode euler2d
+               "Flame"                 exec xlock -mode flame
+               "Flow"                  exec xlock -mode flow
+               "Forest"                exec xlock -mode forest
+               "Hop"                   exec xlock -mode hop -fullrandom
+               "IFS"                   exec xlock -mode ifs
+               "Julia"                 exec xlock -mode julia +trackmouse
+               "Juliaptr"              exec xlock -mode julia -trackmouse
+               "Kumppa"                exec xlock -mode kumppa
+               "Lightning"             exec xlock -mode lightning
+               "Lyapunov"              exec xlock -mode lyaponov -install
+               "Mandelbrot"    exec xlock -mode mandelbrot -install
+               "Mountain"              exec xlock -mode mountain
+               "Sierpinski"    exec xlock -mode sierpinski
+               "Strange"               exec xlock -mode strange
+               "Thornbird"             exec xlock -mode thornbird
+               "Triangle"              exec xlock -mode triangle
+               "Turtle"                exec xlock -mode turtle
+               "Vines"                 exec xlock -mode vines
+               "Random Fractal"        DEFAULT exec xlock -mode random -modelist allfractal -fullrandom
+       "Fractal" END
+       "Geometry" MENU
+         "Geometry" TITLE
+               "Braid"                 exec xlock -mode braid
+               "Fadeplot"              exec xlock -mode fadeplot
+               "Helix"                 exec xlock -mode helix -fullrandom
+               "Hyper"                 exec xlock -mode hyper
+               "Ico"                   exec xlock -mode ico
+               "Kaleid"                exec xlock -mode kaleid
+               "Laser"                 exec xlock -mode laser
+               "Lisa"                  exec xlock -mode lisa
+               "Lissie"                exec xlock -mode lissie
+               "Penrose"               exec xlock -mode penrose +ammann
+               "Penrose Ammann"        exec xlock -mode penrose -ammann
+               "Petal"                 exec xlock -mode petal
+               "Polyominoes"           exec xlock -mode polyominoes
+               "Qix"                   exec xlock -mode qix +complete
+               "Qix complete"  exec xlock -mode qix -complete
+               "Shape"                 exec xlock -mode shape
+               "Sphere"                exec xlock -mode sphere
+               "Spiral"                exec xlock -mode spiral
+               "Spline"                exec xlock -mode spline
+               "Tik_Tak"               exec xlock -mode tik_tak
+               "Random Geometry"       DEFAULT exec xlock -mode random -modelist allgeometry -fullrandom
+       "Geometry" END
+       "Space" MENU
+         "Space" TITLE
+               "Bouboule"              exec xlock -mode bouboule +use3d
+               "Bouboule3d"    exec xlock -mode bouboule -use3d
+               "Galaxy"                exec xlock -mode galaxy
+               "Grav"                  exec xlock -mode grav +trail +grav
+               "Grav Trail"    exec xlock -mode grav -trail
+               "Grav Decay"    exec xlock -mode grav -grav
+               "Rock"                  exec xlock -mode star -rock
+               "Scooter"               exec xlock -mode scooter
+               "Space"                 exec xlock -mode space
+               "Star"                  exec xlock -mode star +rock +use3d -trek 0
+               "Star3d"                exec xlock -mode star -use3d
+               "Star Trek"             exec xlock -mode star -trek 100
+               "World"                 exec xlock -mode world
+               "Random Space"  DEFAULT exec xlock -mode random -modelist allspace -fullrandom
+       "Space" END
+       "Assorted" MENU
+         "Assorted" TITLE
+               "Ball"                  exec xlock -mode ball
+               "Blot"                  exec xlock -mode blot
+               "Bounce"                exec xlock -mode bounce
+               "Bubble"                exec xlock -mode bubble
+               "Clock"                 exec xlock -mode clock
+               "Crystal"               DEFAULT exec xlock -mode crystal
+               "Daisy"                 exec xlock -mode daisy
+               "Dclock"                exec xlock -mode dclock
+               "Decay"                 exec xlock -mode decay
+               "Deco"                  exec xlock -mode deco
+               "Eyes"                  exec xlock -mode eyes +trackmouse
+               "Eyesptr"               exec xlock -mode eyes -trackmouse
+               "Goop"                  exec xlock -mode goop
+               "Juggle"                exec xlock -mode juggle
+               "Marquee"               exec xlock -mode marquee
+               "Matrix"                exec xlock -mode matrix
+               "Munch"                 exec xlock -mode munch
+               "Nose"                  exec xlock -mode nose
+               "Pacman"                exec xlock -mode pacman
+               "Pyro"                  exec xlock -mode pyro +use3d
+               "Pyro3d"                exec xlock -mode pyro -use3d
+               "Roll"                  exec xlock -mode roll
+               "Rotor"                 exec xlock -mode rotor
+               "Slip"                  exec xlock -mode slip
+               "Solitare"              exec xlock -mode solitare +trackmouse
+               "Solitareptr"   exec xlock -mode solitare -trackmouse
+               "Starfish"              exec xlock -mode starfish -install
+               "Swarm"                 exec xlock -mode swarm +trackmouse
+               "Swarmptr"              exec xlock -mode swarm -trackmouse
+               "Swirl"                 exec xlock -mode swirl -install
+               "T3d"                   exec xlock -mode t3d
+               "Tetris"                exec xlock -mode tetris
+               "Tube"                  exec xlock -mode tube -install
+               "Worm"                  exec xlock -mode worm +use3d
+               "Worm3d"                exec xlock -mode worm -use3d
+               "Xcl"                   exec xlock -mode xcl
+               "Xjack"                 exec xlock -mode xjack
+       "Assorted" END
+       "XPM" MENU
+               "Bat"                   exec xlock -mode bat
+               "Image"                 exec xlock -mode image
+               "Flag"                  exec xlock -mode flag
+               "Life"                  exec xlock -mode life
+               "Life1d"                exec xlock -mode life1d
+               "Maze"                  exec xlock -mode maze
+               "Puzzle"                exec xlock -mode puzzle
+               "Random XPM"    DEFAULT exec xlock -mode random -modelist allxpm -fullrandom
+       "XPM" END
+       "GL" MENU
+         "GL" TITLE
+               "Atlantis"              exec xlock -mode atlantis
+               "Bubble3d"              exec xlock -mode bubble3d
+               "Cage"                  exec xlock -mode cage
+               "Fire"                  exec xlock -mode fire
+               "Gears"                 exec xlock -mode gears
+               "GL-Planet"             exec xlock -mode glplanet
+               "Invert"                exec xlock -mode invert
+               "Lament"                exec xlock -mode lament
+               "Moebius"               exec xlock -mode moebius
+               "Molecule"              exec xlock -mode molecule
+               "Morph3d"               exec xlock -mode morph3d
+               "Pipes"                 exec xlock -mode pipes
+               "Rubik"                 exec xlock -mode rubik
+               "Sballs"                exec xlock -mode sballs
+               "Sierpinski3d"          exec xlock -mode sierpinski3d
+               "Sproingies"            exec xlock -mode sproingies
+               "Stairs"                exec xlock -mode stairs
+               "Superquadrics"         exec xlock -mode superquadrics
+               "Random GL"             DEFAULT exec xlock -mode random -modelist allgl -fullrandom
+       "GL" END
+       "Marquee Messages" MENU
+         "Marquee Messages" TITLE
+               "Back Soon"             DEFAULT exec xlock -mode marquee -message "$LOGNAME will be back soon."
+               "Overnight"             exec xlock -mode marquee -message "$LOGNAME will be back in the morning."
+               "Rude"                  exec xlock -mode marquee -message "$LOGNAME not here, please go away! "
+       "Marquee Messages" END
+       "Nose Messages" MENU
+         "Nose Messages" TITLE
+               "Back Soon"             DEFAULT exec xlock -mode nose -message "$LOGNAME will be back soon."
+               "Overnight"             exec xlock -mode nose -message "$LOGNAME will be back in the morning."
+               "Rude"                  exec xlock -mode nose -message "$LOGNAME not here, please go away! "
+       "Nose Messages" END
+       "Xjack Messages" MENU
+         "Nose Messages" TITLE
+               "Crazy Boy"             DEFAULT exec xlock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+               "Crazy Girl"            exec xlock -mode xjack -message "All work and no play makes $LOGNAME a dull girl."
+       "Xjack Messages" END
+       "Special" DEFAULT MENU
+         "Special" TITLE
+               "Blank"                 exec xlock -mode blank
+               "Transparent"           exec xlock -mode blank -geometry 1x1 -enablesaver
+               "Bomb"                  exec xlock -mode bomb
+               "Random nice"   exec xlock -mode random -modelist allnice -fullrandom -neighbors 0
+               "Random standard"       exec xlock -mode random -modelist all-allgl -fullrandom -neighbors 0
+               "Random all"    DEFAULT exec xlock -mode random -modelist all -fullrandom -neighbors 0
+               "Random 3d"             exec xlock -modelist all3d -use3d -fullrandom
+               "Random ptr"    exec xlock -modelist allmouse -trackmouse -fullrandom
+               "Random write"  exec xlock -modelist allwrite -fullrandom
+       "Special" END
+"Screenlock" END
+"Screensaver" MENU
+       "Screensaver" TITLE PIN
+       "Cellular-Automata" MENU
+         "Automata" TITLE
+               "Ant"                   exec xlock -nolock -mode ant -neighbors 4 +truchet
+               "Ant Truchet"   exec xlock -nolock -mode ant -neighbors 4 -truchet
+               "Bee"                   exec xlock -nolock -mode ant -neighbors 6 +truchet
+               "Bee Truchet"   exec xlock -nolock -mode ant -neighbors 6 -truchet
+               "Bug"                   exec xlock -nolock -mode bug
+               "Demon"                 exec xlock -nolock -mode demon
+               "Dilemma"               exec xlock -nolock -mode dilemma
+               "Life"                  exec xlock -nolock -mode life
+               "Life Callahan" exec xlock -nolock -mode life -callahan -size 7
+               "Life1d"                exec xlock -nolock -mode life1d
+               "Life3d"                exec xlock -nolock -mode life3d
+               "Loop"                  exec xlock -nolock -mode loop
+               "Voters"                exec xlock -nolock -mode voters
+               "Wator"                 exec xlock -nolock -mode wator
+               "Wire"                  exec xlock -nolock -mode wire
+               "Random Automata"       DEFAULT exec xlock -nolock -mode random -modelist allautomata -fullrandom -neighbors 0
+       "Cellular-Automata" END
+       "Fractal" MENU
+         "Fractal" TITLE
+               "Coral"                 exec xlock -nolock -mode coral
+               "Discrete"              exec xlock -nolock -mode discrete
+               "Dragon"                exec xlock -nolock -mode dragon
+               "Drift"                 exec xlock -nolock -mode drift -fullrandom
+               "Euler2d"               exec xlock -nolock -mode euler2d
+               "Flame"                 exec xlock -nolock -mode flame
+               "Flow"                  exec xlock -nolock -mode flow
+               "Forest"                exec xlock -nolock -mode forest
+               "Hop"                   exec xlock -nolock -mode hop -fullrandom
+               "IFS"                   exec xlock -nolock -mode ifs
+               "Julia"                 exec xlock -nolock -mode julia +trackmouse
+               "Juliaptr"              exec xlock -nolock -mode julia -trackmouse
+               "Kumppa"                exec xlock -nolock -mode kumppa
+               "Lightning"             exec xlock -nolock -mode lightning
+               "Lyapunov"              exec xlock -nolock -mode lyapunov -install
+               "Mandelbrot"    exec xlock -nolock -mode mandelbrot -install
+               "Mountain"              exec xlock -nolock -mode mountain
+               "Sierpinski"    exec xlock -nolock -mode sierpinski
+               "Strange"               exec xlock -nolock -mode strange
+               "Thornbird"             exec xlock -nolock -mode thornbird
+               "Triangle"              exec xlock -nolock -mode triangle
+               "Turtle"                exec xlock -nolock -mode turtle
+               "Vines"                 exec xlock -nolock -mode vines
+               "Random Fractal"        DEFAULT exec xlock -nolock -mode random -modelist allfractal -fullrandom
+       "Fractal" END
+       "Geometry" MENU
+         "Geometry" TITLE
+               "Braid"                 exec xlock -nolock -mode braid
+               "Fadeplot"              exec xlock -nolock -mode fadeplot
+               "Helix"                 exec xlock -nolock -mode helix -fullrandom
+               "Hyper"                 exec xlock -nolock -mode hyper
+               "Ico"                   exec xlock -nolock -mode ico
+               "Kaleid"                exec xlock -nolock -mode kaleid
+               "Laser"                 exec xlock -nolock -mode laser
+               "Lisa"                  exec xlock -nolock -mode lisa
+               "Lissie"                exec xlock -nolock -mode lissie
+               "Penrose"               exec xlock -nolock -mode penrose +ammann
+               "Penrose Ammann"        exec xlock -nolock -mode penrose -ammann
+               "Petal"                 exec xlock -nolock -mode petal
+               "Polyominoes"           exec xlock -nolock -mode polyominoes
+               "Qix"                   exec xlock -nolock -mode qix +complete
+               "Qix complete"  exec xlock -nolock -mode qix -complete
+               "Shape"                 exec xlock -nolock -mode shape
+               "Sphere"                exec xlock -nolock -mode sphere
+               "Spiral"                exec xlock -nolock -mode spiral
+               "Spline"                exec xlock -nolock -mode spline
+               "Tik_Tak"               exec xlock -nolock -mode tik_tak
+               "Random Geometry"       DEFAULT exec xlock -nolock -mode random -modelist allgeometry -fullrandom
+       "Geometry" END
+       "Space" MENU
+         "Space" TITLE
+               "Bouboule"              exec xlock -nolock -mode bouboule +use3d
+               "Bouboule3d"    exec xlock -nolock -mode bouboule -use3d
+               "Galaxy"                exec xlock -nolock -mode galaxy
+               "Grav"                  exec xlock -nolock -mode grav +trail +decay
+               "Grav Trail"    exec xlock -nolock -mode grav -trail
+               "Grav Decay"    exec xlock -nolock -mode grav -decay
+               "Rock"                  exec xlock -nolock -mode star -rock +use3d -trek 0
+               "Scooter"               exec xlock -nolock -mode scooter
+               "Space"                 exec xlock -nolock -mode space
+               "Star"                  exec xlock -nolock -mode star +rock +use3d -trek 0
+               "Star3d"                exec xlock -nolock -mode star -use3d
+               "Star Trek"             exec xlock -nolock -mode star -trek 100
+               "World"                 exec xlock -nolock -mode world
+               "Random Space"  DEFAULT exec xlock -nolock -mode random -modelist allspace -fullrandom
+       "Space" END
+       "Assorted" MENU
+         "Assorted" TITLE
+               "Ball"                  exec xlock -nolock -mode ball
+               "Blot"                  exec xlock -nolock -mode blot
+               "Bounce"                exec xlock -nolock -mode bounce
+               "Bubble"                exec xlock -nolock -mode bubble
+               "Clock"                 exec xlock -nolock -mode clock
+               "Crystal"               DEFAULT exec xlock -nolock -mode crystal
+               "Daisy"                 exec xlock -nolock -mode daisy
+               "Dclock"                exec xlock -nolock -mode dclock
+               "Decay"                 exec xlock -nolock -mode decay
+               "Deco"                  exec xlock -nolock -mode deco
+               "Eyes"                  exec xlock -nolock -mode eyes +trackmouse
+               "Eyesptr"               exec xlock -nolock -mode eyes -trackmouse
+               "Goop"                  exec xlock -nolock -mode goop
+               "Juggle"                exec xlock -nolock -mode juggle
+               "Marquee"               exec xlock -nolock -mode marquee
+               "Matrix"                exec xlock -nolock -mode matrix
+               "Munch"                 exec xlock -nolock -mode munch
+               "Nose"                  exec xlock -nolock -mode nose
+               "Pacman"                exec xlock -nolock -mode pacman
+               "Pyro"                  exec xlock -nolock -mode pyro +use3d
+               "Pyro3d"                exec xlock -nolock -mode pyro -use3d
+               "Roll"                  exec xlock -nolock -mode roll
+               "Rotor"                 exec xlock -nolock -mode rotor
+               "Slip"                  exec xlock -nolock -mode slip
+               "Solitare"              exec xlock -nolock -mode solitare +trackmouse
+               "Solitareptr"   exec xlock -nolock -mode solitare -trackmouse
+               "Starfish"              exec xlock -nolock -mode starfish -install
+               "Swarm"                 exec xlock -nolock -mode swarm +trackmouse
+               "Swarmptr"              exec xlock -nolock -mode swarm -trackmouse
+               "Swirl"                 exec xlock -nolock -mode swirl -install
+               "T3d"                   exec xlock -nolock -mode t3d
+               "Tetris"                exec xlock -nolock -mode tetris
+               "Tube"                  exec xlock -nolock -mode tube -install
+               "Worm"                  exec xlock -nolock -mode worm +use3d
+               "Worm3d"                exec xlock -nolock -mode worm -use3d
+               "Xcl"                   exec xlock -nolock -mode xcl
+               "Xjack"                 exec xlock -nolock -mode xjack
+       "Assorted" END
+       "XPM" MENU
+               "Bat"                   exec xlock -nolock -mode bat
+               "Image"                 exec xlock -nolock -mode image
+               "Flag"                  exec xlock -nolock -mode flag
+               "Life"                  exec xlock -nolock -mode life
+               "Life1d"                exec xlock -nolock -mode life1d
+               "Maze"                  exec xlock -nolock -mode maze
+               "Puzzle"                exec xlock -nolock -mode puzzle
+               "Random XPM"    DEFAULT exec xlock -nolock -mode random -modelist allxpm -fullrandom
+       "XPM" END
+       "GL" MENU
+               "Atlantis"              exec xlock -nolock -mode atlantis
+               "Bubble3d"              exec xlock -nolock -mode bubble3d
+               "Cage"                  exec xlock -nolock -mode cage
+               "Fire"                  exec xlock -nolock -mode fire
+               "Gears"                 exec xlock -nolock -mode gears
+               "GL-Planet"             exec xlock -nolock -mode glplanet
+               "Invert"                exec xlock -nolock -mode invert
+               "Lament"                exec xlock -nolock -mode lament
+               "Moebius"               exec xlock -nolock -mode moebius
+               "Molecule"              exec xlock -nolock -mode molecule
+               "Morph3d"               exec xlock -nolock -mode morph3d
+               "Pipes"                 exec xlock -nolock -mode pipes
+               "Rubik"                 exec xlock -nolock -mode rubik
+               "Sballs"                exec xlock -nolock -mode sballs
+               "Sierpinski3d"          exec xlock -nolock -mode sierpinski3d
+               "Sproingies"            exec xlock -nolock -mode sproingies
+               "Stairs"                exec xlock -nolock -mode stairs
+               "Superquadrics" exec xlock -nolock -mode superquadrics
+               "Random GL"             DEFAULT exec xlock -nolock -mode random -modelist allgl -fullrandom
+       "GL" END
+       "Marquee Messages" MENU
+         "Marquee Messages" TITLE
+               "Brilliant"             exec xlock -nolock -mode marquee -message "WOW! $LOGNAME, You are Brilliant! "
+               "Love You"              exec xlock -nolock -mode marquee -message "You know, I Love You $LOGNAME."
+               "Available"             exec xlock -nolock -mode marquee -message "Hey, I am available now! "
+       "Marquee Messages" END
+       "Nose Messages" MENU
+         "Nose Messages" TITLE
+               "Brilliant"             exec xlock -nolock -mode nose -message "WOW! $LOGNAME, You are Brilliant! "
+               "Love You"              exec xlock -nolock -mode nose -message "You know, I Love You $LOGNAME."
+               "Available"             exec xlock -nolock -mode nose -message "Hey, I am available now! "
+       "Nose Messages" END
+       "Xjack Messages" MENU
+         "Xjack Messages" TITLE
+               "Crazy Boy"             exec xlock -nolock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+               "Crazy Girl"    exec xlock -nolock -mode xjack -message "All work and no play makes $LOGNAME a dull girl."
+       "Xjack Messages" END
+       "Special" DEFAULT MENU
+         "Special" TITLE
+               "Blank"                 exec xlock -nolock -mode blank
+               "Bomb"                  exec xlock -nolock -mode bomb
+               "Random nice"   exec xlock -nolock -mode random -modelist allnice -fullrandom -neighbors 0
+               "Random standard"       exec xlock -nolock -mode random -modelist all-allgl -fullrandom -neighbors 0
+               "Random all"    DEFAULT exec xlock -nolock -mode random -modelist all -fullrandom -neighbors 0
+               "Random 3d"             exec xlock -nolock -modelist all3d -use3d -fullrandom
+               "Random ptr"    exec xlock -nolock -modelist allmouse -trackmouse -fullrandom
+               "Random write"  exec xlock -nolock -modelist allwrite -fullrandom
+       "Special" END
+"Screensaver" END
diff --git a/etc/system.wmrc.xlock b/etc/system.wmrc.xlock
new file mode 100644 (file)
index 0000000..6b36f17
--- /dev/null
@@ -0,0 +1,391 @@
+# Copy this to your personal Library directory for WindowMaker:
+# $HOME/GNUstep/Library/WindowMaker/
+# And add this to $HOME/GNUstep/Library/WindowMaker/menu (or menu.xx)
+# Put this in your "Workspace" menu
+#      "Lock_Saver"    OPEN_MENU system.wmrc.xlock
+
+"Lock_Saver" MENU
+"ScreenLock" MENU
+"Automata" MENU
+       "Ant"           EXEC    xlock -mode ant -neighbors 4 +truchet
+       "Ant Truchet"   EXEC    xlock -mode ant -neighbors 4 -truchet
+       "Bee"           EXEC    xlock -mode ant -neighbors 6 +truchet
+       "Bee Truchet"   EXEC    xlock -mode ant -neighbors 6 -truchet
+       "Bug"           EXEC    xlock -mode bug
+       "Demon"         EXEC    xlock -mode demon
+       "Dilemma"       EXEC    xlock -mode dilemma
+       "Life"          EXEC    xlock -mode life
+       "Life Callahan" EXEC    xlock -mode life -callahan -size 7
+       "Life1d"        EXEC    xlock -mode life1d
+       "Life3d"        EXEC    xlock -mode life3d
+       "Loop"          EXEC    xlock -mode loop
+       "Voters"        EXEC    xlock -mode voters
+       "Wator"         EXEC    xlock -mode wator
+       "Wire"          EXEC    xlock -mode wire
+       "Random"        EXEC    xlock -mode random -modelist allautomata -fullrandom -neighbors 0
+"Automata" END
+
+"Fractal" MENU
+       "Coral"         EXEC    xlock -mode coral
+       "Discrete"      EXEC    xlock -mode discrete
+       "Dragon"        EXEC    xlock -mode dragon
+       "Drift"         EXEC    xlock -mode drift -fullrandom
+       "Euler2d"       EXEC    xlock -mode euler2d
+       "Flame"         EXEC    xlock -mode flame
+       "Flow"          EXEC    xlock -mode flow
+       "Forest"        EXEC    xlock -mode forest
+       "Hop"           EXEC    xlock -mode hop -fullrandom
+       "IFS"           EXEC    xlock -mode ifs
+       "Julia"         EXEC    xlock -mode julia +trackmouse
+       "Juliaptr"      EXEC    xlock -mode julia -trackmouse
+       "Kumppa"        EXEC    xlock -mode kumppa
+       "Lightning"     EXEC    xlock -mode lightning
+       "Lyapunov"      EXEC    xlock -mode lyapunov -install
+       "Mandelbrot"    EXEC    xlock -mode mandelbrot -install
+       "Mountain"      EXEC    xlock -mode mountain
+       "Sierpinski"    EXEC    xlock -mode sierpinski
+       "Strange"       EXEC    xlock -mode strange
+       "Thornbird"     EXEC    xlock -mode thornbird
+       "Triangle"      EXEC    xlock -mode triangle
+       "Turtle"        EXEC    xlock -mode turtle
+       "Vines" EXEC    xlock -mode vines
+       "Random"        EXEC    xlock -mode random -modelist allfractal -fullrandom
+"Fractal" END
+
+"Geometry" MENU
+       "Braid"         EXEC    xlock -mode braid
+       "Fadeplot"      EXEC    xlock -mode fadeplot
+       "Helix"         EXEC    xlock -mode helix -fullrandom
+       "Hyper"         EXEC    xlock -mode hyper
+       "Ico"           EXEC    xlock -mode ico
+       "Kaleid"        EXEC    xlock -mode kaleid
+       "Laser"         EXEC    xlock -mode laser
+       "Lisa"          EXEC    xlock -mode lisa
+       "Lissie"        EXEC    xlock -mode lissie
+       "Penrose"       EXEC    xlock -mode penrose +ammann
+       "Penrose Ammann"        EXEC xlock -mode penrose -ammann
+       "Petal"         EXEC    xlock -mode petal
+       "Polyominoes"   EXEC    xlock -mode polyominoes
+       "Qix"           EXEC    xlock -mode qix +complete
+       "Qix complete"          EXEC    xlock -mode qix -complete
+       "Rotor"         EXEC    xlock -mode rotor
+       "Shape"         EXEC    xlock -mode shape
+       "Sphere"        EXEC    xlock -mode sphere
+       "Spiral"        EXEC    xlock -mode spiral
+       "Spline"        EXEC    xlock -mode spline
+       "Tik_Tak"       EXEC    xlock -mode tik_tak
+       "Random"        EXEC    xlock -mode random -modelist allgeometry -fullrandom
+"Geometry" END
+
+"Space" MENU
+       "Bouboule"      EXEC    xlock -mode bouboule +use3d
+       "Bouboule3d"    EXEC    xlock -mode bouboule -use3d
+       "Galaxy"        EXEC    xlock -mode galaxy
+       "Grav"          EXEC    xlock -mode grav +trail +decay
+       "Grav Trail"    EXEC    xlock -mode grav -trail
+       "Grav Decay"    EXEC    xlock -mode grav -decay
+       "Rock"          EXEC    xlock -mode star -rock
+       "Scooter"       EXEC    xlock -mode scooter
+       "Space"         EXEC    xlock -mode space
+       "Star"          EXEC    xlock -mode star +rock +use3d +trek 0
+       "Star3d"        EXEC    xlock -mode star -use3d
+       "Star Trek"     EXEC    xlock -mode star -trek 100
+       "World"         EXEC    xlock -mode world
+       "Random Space"  EXEC    xlock -mode random -modelist allspace
+"Space" END
+
+"Assorted" MENU
+       "Ball"          EXEC    xlock -mode ball
+       "Blot"          EXEC    xlock -mode blot
+       "Bounce"        EXEC    xlock -mode bounce
+       "Bubble"        EXEC    xlock -mode bubble
+       "Clock"         EXEC    xlock -mode clock
+       "Crystal"       EXEC    xlock -mode crystal
+       "Daisy"         EXEC    xlock -mode daisy
+       "Dclock"        EXEC    xlock -mode dclock
+       "Decay"         EXEC    xlock -mode decay
+       "Deco"          EXEC    xlock -mode deco
+       "Eyes"          EXEC    xlock -mode eyes +trackmouse
+       "Eyesptr"       EXEC    xlock -mode eyes -trackmouse
+       "Goop"          EXEC    xlock -mode goop
+       "Juggle"        EXEC    xlock -mode goop
+       "Marquee"       EXEC    xlock -mode marquee
+       "Matrix"        EXEC    xlock -mode matrix
+       "Munch"         EXEC    xlock -mode munch
+       "Nose"          EXEC    xlock -mode nose
+       "Pacman"        EXEC    xlock -mode pacman
+       "Pyro"          EXEC    xlock -mode pyro +use3d
+       "Pyro3d"        EXEC    xlock -mode pyro -use3d
+       "Roll"          EXEC    xlock -mode roll
+       "Slip"          EXEC    xlock -mode slip
+       "Solitare"      EXEC    xlock -mode solitare +trackmouse
+       "Solitareptr"   EXEC    xlock -mode solitare -trackmouse
+       "Starfish"      EXEC    xlock -mode starfish -install
+       "Swarm"         EXEC    xlock -mode swarm +trackmouse
+       "Swarmptr"      EXEC    xlock -mode swarm -trackmouse
+       "Swirl"         EXEC    xlock -mode swirl -install
+       "T3d"           EXEC    xlock -mode t3d
+       "Tetris"        EXEC    xlock -mode tetris
+       "Tube"          EXEC    xlock -mode tube -install
+       "Worm"          EXEC    xlock -mode worm +use3d
+       "Worm3d"        EXEC    xlock -mode worm -use3d
+       "Xcl"           EXEC    xlock -mode xcl
+       "Xjack"         EXEC    xlock -mode xjack
+"Assorted" END
+
+"XPM" MENU
+       "Bat"           EXEC    xlock -mode bat
+       "Image"         EXEC    xlock -mode image
+       "Flag"          EXEC    xlock -mode flag
+       "Life"          EXEC    xlock -mode life
+       "Life1d"        EXEC    xlock -mode life1d
+       "Maze"          EXEC    xlock -mode maze
+       "Puzzle"        EXEC    xlock -mode puzzle
+       "Random"        EXEC    xlock -mode random -modelist allxpm -fullrandom
+"XPM" END
+
+"GL" MENU
+       "Atlantis"      EXEC    xlock -mode atlantis
+       "Bubble3d"      EXEC    xlock -mode bubble3d
+       "Cage"          EXEC    xlock -mode cage
+       "Fire"          EXEC    xlock -mode fire
+       "Gears"         EXEC    xlock -mode gears
+       "GL-Planet"     EXEC    xlock -mode glplanet
+       "Invert"        EXEC    xlock -mode invert
+       "Lament"        EXEC    xlock -mode lament
+       "Moebius"       EXEC    xlock -mode moebius
+       "Molecule"      EXEC    xlock -mode molecule
+       "Morph3d"       EXEC    xlock -mode morph3d
+       "Pipes"         EXEC    xlock -mode pipes
+       "Rubik"         EXEC    xlock -mode rubik
+       "Sballs"        EXEC    xlock -mode sballs
+       "Sierpinski3d"  EXEC    xlock -mode sierpinski3d
+       "Sproingies"    EXEC    xlock -mode sproingies
+       "Stairs"        EXEC    xlock -mode stairs
+       "Superquadrics" EXEC    xlock -mode superquadrics
+       "Text3d"        EXEC    xlock -mode text3d -message "$LOGNAME"
+       "Random"        EXEC    xlock -mode random -modelist allgl -fullrandom
+"GL" END
+
+"Marquee-Message" MENU
+       "Back Soon"     EXEC    xlock -mode marquee -message "$LOGNAME will be back soon."
+       "Overnight"     EXEC    xlock -mode marquee -message "$LOGNAME will be back in the morning."
+       "Rude"          EXEC    xlock -mode marquee -message "$LOGNAME not here, please go away!"
+"Marquee-Message" END
+
+"Nose-Message" MENU
+       "Back Soon"     EXEC    xlock -mode nose -message "$LOGNAME will be back soon."
+       "Overnight"     EXEC    xlock -mode nose -message "$LOGNAME will be back in the morning."
+       "Rude"          EXEC    xlock -mode nose -message "$LOGNAME not here, please go away!"
+"Nose-Message" END
+
+"Xjack-Message" MENU
+       "Crazy Boy"     EXEC    xlock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+       "Crazy Girl"    EXEC    xlock -mode xjack -message "All work and no play makes $LOGNAME a dull girl."
+"Xjack-Message" END
+
+"Special" MENU
+       "Blank"         EXEC    xlock -mode blank
+       "Transparent"   EXEC    xlock -mode blank -geometry 1x1 -enablesaver
+       "Bomb"          EXEC    xlock -mode bomb
+       "Random nice"   EXEC    xlock -mode random -modelist allnice -fullrandom -neighbors 0
+       "Random standard"       EXEC    xlock -mode random -modelist all-allgl -fullrandom -neighbors 0
+       "Random all"    EXEC    xlock -mode random -modelist all -fullrandom -neighbors 0
+       "Random 3d"     EXEC    xlock -mode random -modelist all3d -use3d -fullrandom
+       "Random ptr"    EXEC    xlock -mode random -modelist allmouse -trackmouse -fullrandom
+       "Random write"  EXEC    xlock -mode random -modelist allwrite -install -fullrandom
+"Special" END
+"ScreenLock" END
+
+"ScreenSaver" MENU
+"Automata" MENU
+       "Ant"           EXEC    xlock -nolock -mode ant -neighbors 4 +truchet
+       "Ant Truchet"   EXEC    xlock -nolock -mode ant -neighbors 4 -truchet
+       "Bee"           EXEC    xlock -nolock -mode ant -neighbors 6 +truchet
+       "Bee Truchet"   EXEC    xlock -nolock -mode ant -neighbors 6 -truchet
+       "Bug"           EXEC    xlock -nolock -mode bug
+       "Demon"         EXEC    xlock -nolock -mode demon
+       "Dilemma"       EXEC    xlock -nolock -mode dilemma
+       "Life"          EXEC    xlock -nolock -mode life
+       "Life Callahan" EXEC    xlock -nolock -mode life -callahan -size 7
+       "Life1d"        EXEC    xlock -nolock -mode life1d
+       "Life3d"        EXEC    xlock -nolock -mode life3d
+       "Loop"          EXEC    xlock -nolock -mode loop
+       "Voters"        EXEC    xlock -nolock -mode voters
+       "Wator"         EXEC    xlock -nolock -mode wator
+       "Wire"          EXEC    xlock -nolock -mode wire
+       "Random"        EXEC    xlock -nolock -mode random -modelist allautomata -fullrandom -neighbors 0
+"Automata" END
+
+"Fractal" MENU
+       "Coral"         EXEC    xlock -nolock -mode coral
+       "Discrete"      EXEC    xlock -nolock -mode discrete
+       "Dragon"        EXEC    xlock -nolock -mode dragon
+       "Drift"         EXEC    xlock -nolock -mode drift -fullrandom
+       "Euler2d"       EXEC    xlock -nolock -mode euler2d
+       "Flame"         EXEC    xlock -nolock -mode flame
+       "Flow"          EXEC    xlock -nolock -mode flow
+       "Forest"        EXEC    xlock -nolock -mode forest
+       "Hop"           EXEC    xlock -nolock -mode hop -fullrandom
+       "IFS"           EXEC    xlock -nolock -mode ifs
+       "Julia"         EXEC    xlock -nolock -mode julia +trackmouse
+       "Juliaptr"      EXEC    xlock -nolock -mode julia -trackmouse
+       "Kumppa"        EXEC    xlock -nolock -mode kumppa
+       "Lightning"     EXEC    xlock -nolock -mode lightning
+       "Lyapunov"      EXEC    xlock -nolock -mode lyapunov -install
+       "Mandelbrot"    EXEC    xlock -nolock -mode mandelbrot -install
+       "Mountain"      EXEC    xlock -nolock -mode mountain
+       "Sierpinski"    EXEC    xlock -nolock -mode sierpinski
+       "Strange"       EXEC    xlock -nolock -mode strange
+       "Thornbird"     EXEC    xlock -nolock -mode thornbird
+       "Triangle"      EXEC    xlock -nolock -mode triangle
+       "Turtle"        EXEC    xlock -nolock -mode turtle
+       "Vines"         EXEC    xlock -nolock -mode vines
+       "Random"        EXEC    xlock -nolock -mode random -modelist allfractal -fullrandom
+"Fractal" END
+
+"Geometry" MENU
+       "Braid"         EXEC    xlock -nolock -mode braid
+       "Fadeplot"      EXEC    xlock -nolock -mode fadeplot
+       "Helix"         EXEC    xlock -nolock -mode helix -fullrandom
+       "Hyper"         EXEC    xlock -nolock -mode hyper
+       "Ico"           EXEC    xlock -nolock -mode ico
+       "Kaleid"        EXEC    xlock -nolock -mode kaleid
+       "Laser"         EXEC    xlock -nolock -mode laser
+       "Lisa"          EXEC    xlock -nolock -mode lisa
+       "Lissie"        EXEC    xlock -nolock -mode lissie
+       "Penrose"       EXEC    xlock -nolock -mode penrose +ammann
+       "Penrose Ammann"        EXEC xlock -nolock -mode penrose -ammann
+       "Petal"         EXEC    xlock -nolock -mode petal
+       "Polyominoes"   EXEC    xlock -nolock -mode polyominoes
+       "Qix"           EXEC    xlock -nolock -mode qix +complete
+       "Qix complete"  EXEC    xlock -nolock -mode qix -complete
+       "Rotor"         EXEC    xlock -nolock -mode rotor
+       "Shape"         EXEC    xlock -nolock -mode shape
+       "Sphere"        EXEC    xlock -nolock -mode sphere
+       "Spiral"        EXEC    xlock -nolock -mode spiral
+       "Spline"        EXEC    xlock -nolock -mode spline
+       "Tik_Tak"       EXEC    xlock -nolock -mode tik_tak
+       "Random"        EXEC    xlock -nolock -mode random -modelist allgeometry
+"Geometry" END
+
+"Space" MENU
+       "Bouboule"      EXEC    xlock -nolock -mode bouboule +use3d
+       "Bouboule3d"    EXEC    xlock -nolock -mode bouboule -use3d
+       "Galaxy"        EXEC    xlock -nolock -mode galaxy
+       "Grav"          EXEC    xlock -nolock -mode grav +trail +decay
+       "Grav Trail"    EXEC    xlock -nolock -mode grav -trail
+       "Grav Decay"    EXEC    xlock -nolock -mode grav -decay
+       "Rock"          EXEC    xlock -nolock -mode star -rock
+       "Scooter"       EXEC    xlock -nolock -mode scooter
+       "Space"         EXEC    xlock -nolock -mode space
+       "Star"          EXEC    xlock -nolock -mode star +rock +use3d +trek 0
+       "Star3d"        EXEC    xlock -nolock -mode star -use3d
+       "Star Trek"     EXEC    xlock -nolock -mode star -trek 100
+       "World"         EXEC    xlock -nolock -mode world
+       "Random Space"  EXEC    xlock -nolock -mode random -modelist allspace
+"Space" END
+
+"Assorted" MENU
+       "Ball"          EXEC    xlock -nolock -mode ball
+       "Blot"          EXEC    xlock -nolock -mode blot
+       "Bounce"        EXEC    xlock -nolock -mode bounce
+       "Bubble"        EXEC    xlock -nolock -mode bubble
+       "Clock"         EXEC    xlock -nolock -mode clock
+       "Crystal"       EXEC    xlock -nolock -mode crystal
+       "Daisy"         EXEC    xlock -nolock -mode daisy
+       "Dclock"        EXEC    xlock -nolock -mode dclock
+       "Decay"         EXEC    xlock -nolock -mode decay
+       "Deco"          EXEC    xlock -nolock -mode deco
+       "Eyes"          EXEC    xlock -nolock -mode eyes +trackmouse
+       "Eyesptr"       EXEC    xlock -nolock -mode eyes -trackmouse
+       "Goop"          EXEC    xlock -nolock -mode goop
+       "Juggle"        EXEC    xlock -nolock -mode goop
+       "Marquee"       EXEC    xlock -nolock -mode marquee
+       "Matrix"        EXEC    xlock -nolock -mode matrix
+       "Munch"         EXEC    xlock -nolock -mode munch
+       "Nose"          EXEC    xlock -nolock -mode nose
+       "Pacman"        EXEC    xlock -nolock -mode pacman
+       "Pyro"          EXEC    xlock -nolock -mode pyro +use3d
+       "Pyro3d"        EXEC    xlock -nolock -mode pyro -use3d
+       "Roll"          EXEC    xlock -nolock -mode roll
+       "Slip"          EXEC    xlock -nolock -mode slip
+       "Solitare"      EXEC    xlock -nolock -mode solitare +trackmouse
+       "Solitareptr"   EXEC    xlock -nolock -mode solitare -trackmouse
+       "Starfish"      EXEC    xlock -nolock -mode starfish -install
+       "Swarm"         EXEC    xlock -nolock -mode swarm +trackmouse
+       "Swarmptr"      EXEC    xlock -nolock -mode swarm -trackmouse
+       "Swirl"         EXEC    xlock -nolock -mode swirl -install
+       "T3d"           EXEC    xlock -nolock -mode t3d
+       "Tetris"        EXEC    xlock -nolock -mode tetris
+       "Tube"          EXEC    xlock -nolock -mode tube -install
+       "Worm"          EXEC    xlock -nolock -mode worm +use3d
+       "Worm3d"        EXEC    xlock -nolock -mode worm -use3d
+       "Xcl"           EXEC    xlock -nolock -mode xcl
+       "Xjack"         EXEC    xlock -nolock -mode xjack
+"Assorted" END
+
+"XPM" MENU
+       "Bat"           EXEC    xlock -nolock -mode bat
+       "Image"         EXEC    xlock -nolock -mode image
+       "Flag"          EXEC    xlock -nolock -mode flag
+       "Life"          EXEC    xlock -nolock -mode life
+       "Life1d"        EXEC    xlock -nolock -mode life1d
+       "Maze"          EXEC    xlock -nolock -mode maze
+       "Puzzle"        EXEC    xlock -nolock -mode puzzle
+       "Random"        EXEC    xlock -nolock -mode random -modelist allxpm -fullrandom
+"XPM" END
+
+"GL" MENU
+       "Atlantis"      EXEC    xlock -nolock -mode atlantis
+       "Bubble3d"      EXEC    xlock -nolock -mode bubble3d
+       "Cage"          EXEC    xlock -nolock -mode cage
+       "Fire"          EXEC    xlock -nolock -mode fire
+       "Gears"         EXEC    xlock -nolock -mode gears
+       "GL-Planet"     EXEC    xlock -nolock -mode glplanet
+       "Invert"        EXEC    xlock -nolock -mode invert
+       "Lament"        EXEC    xlock -nolock -mode lament
+       "Moebius"       EXEC    xlock -nolock -mode moebius
+       "Molecule"      EXEC    xlock -nolock -mode molecule
+       "Morph3d"       EXEC    xlock -nolock -mode morph3d
+       "Pipes"         EXEC    xlock -nolock -mode pipes
+       "Rubik"         EXEC    xlock -nolock -mode rubik
+       "Sballs"        EXEC    xlock -nolock -mode sballs
+       "Sierpinski3d"  EXEC    xlock -nolock -mode sierpinski3d
+       "Sproingies"    EXEC    xlock -nolock -mode sproingies
+       "Stairs"        EXEC    xlock -nolock -mode stairs
+       "Superquadrics" EXEC    xlock -nolock -mode superquadrics
+       "Text3d"        EXEC    xlock -nolock -mode text3d -message "$LOGNAME"
+       "Random"        EXEC    xlock -nolock -mode random -modelist allgl -fullrandom
+"GL" END
+
+"Marquee-Message" MENU
+       "Brilliant!"    EXEC    xlock -nolock -mode marquee -message "WOW! $LOGNAME, You're Brilliant!"
+       "Love You"      EXEC    xlock -nolock -mode marquee -message "You know, I Love You $LOGNAME."
+       "Available"     EXEC    xlock -nolock -mode marquee -message "Hey, I'm available now!"
+"Marquee-Message" END
+
+"Nose-Message" MENU
+       "Brilliant!"    EXEC    xlock -nolock -mode nose -message "WOW! $LOGNAME, You're Brilliant!"
+       "Love You"      EXEC    xlock -nolock -mode nose -message "You know, I Love You $LOGNAME."
+       "Available"     EXEC    xlock -nolock -mode nose -message "Hey, I'm available now!"
+"Nose-Message" END
+
+"Xjack-Message" MENU
+       "Crazy Boy"     EXEC    xlock -nolock -mode xjack -message "All work and no play makes $LOGNAME a dull boy."
+       "Crazy Girl"    EXEC    xlock -nolock -mode xjack -message "All work and no play makes $LOGNAME a dull girl."
+"Xjack-Message" END
+
+"Special" MENU
+       "Blank"         EXEC    xlock -nolock -mode blank
+       "Bomb"          EXEC    xlock -nolock -mode bomb
+       "Random nice"   EXEC    xlock -nolock -mode random -modelist allnice -fullrandom -neighbors 0
+       "Random standard"       EXEC    xlock -nolock -mode random -modelist all-allgl -fullrandom -neighbors 0
+       "Random all"    EXEC    xlock -nolock -mode random -modelist all -fullrandom -neighbors 0
+       "Random 3d"     EXEC    xlock -nolock -mode random -modelist all3d -use3d -fullrandom
+       "Random ptr"    EXEC    xlock -nolock -mode random -modelist allmouse -trackmouse -fullrandom
+       "Random write"  EXEC    xlock -nolock -mode random -modelist allwrite -fullrandom
+"Special" END
+
+"ScreenSaver" END
+"Lock_Saver" END
diff --git a/etc/vtswitch.c b/etc/vtswitch.c
new file mode 100644 (file)
index 0000000..9fcd44b
--- /dev/null
@@ -0,0 +1,122 @@
+/* Copyright (c) R. Cohen-Scali, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * <remi.cohenscali@pobox.com>
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <linux/vt.h>
+
+#define CONSOLE "/dev/console"
+
+static char *progname = NULL;
+static char errmsg[1024];
+
+static void usage( int verb )
+{
+    fprintf( stderr, "%s: usage: %s [-h] <on/off>\n", progname, progname );
+    if ( verb )
+    {
+        fprintf( stderr, "    Allows to enable/disable to VT switching ability\n" );
+        fprintf( stderr, "      -- %s on -- enable VT switching\n", progname );
+        fprintf( stderr, "      -- %s off -- disable VT switching\n", progname );
+        fprintf( stderr, "    Option -h display this message\n" );
+    }
+    fprintf( stderr, "\n", progname, progname );
+}
+
+main( int argc, char **argv )
+{
+    char *cmd = argv[1];
+    int allow = 0, consfd = -1;
+    uid_t uid = -1;
+    struct stat consstat;
+
+    /* Program name */
+    progname =( progname = strrchr( argv[0], '/' ) ) ? progname +1 : argv[0];
+
+    /* Check args */
+    if ( argc != 2 && argc != 3 )
+    {
+        usage( 0 );
+        exit( 1 );
+    }
+
+    /* Process -h */
+    if ( !strcmp( cmd, "-h" ) || !strcmp( cmd, "--help" ) )
+    {
+        usage( 1 );
+        cmd = argv[2];
+        if ( argc == 2 ) exit( 0 );
+    }
+
+    /* Process on/off (case insensitive) */
+    if ( strcasecmp( cmd, "on" ) && strcasecmp( cmd, "off" ) )
+    {
+        usage( 0 );
+        exit( 1 );
+    }
+    allow = !strcasecmp( cmd, "on" );
+
+    /* Check user is allowed to do it */
+    uid = getuid();
+    if ( stat( CONSOLE, &consstat ) == -1 )
+    {
+        sprintf( errmsg, "%s: Cannot stat " CONSOLE, progname );
+        perror( errmsg );
+        exit( 1 );
+    }
+    if ( uid != consstat.st_uid )
+    {
+        fprintf(stderr,
+                "%s: Sorry, you are not allowed to %slock"
+                " VT switching: Operation not permitted\n",
+                progname,
+                allow ? "un" : "" );
+        exit( 1 );
+    }
+    seteuid( 0 );
+
+    /* Open console */
+    if ( ( consfd = open( CONSOLE, O_RDWR ) ) == -1 )
+    {
+        sprintf( errmsg, "%s: Cannot open " CONSOLE, progname );
+        perror( errmsg );
+        seteuid( uid );
+        exit( 1 );
+    }
+
+    /* Do it */
+    if ( ioctl( consfd, allow?VT_UNLOCKSWITCH:VT_LOCKSWITCH ) == -1 )
+    {
+        sprintf( errmsg, "%s: Cannot %slock VT switching for " CONSOLE, progname, allow ? "un" : "" );
+        perror( errmsg );
+        seteuid( uid );
+        exit( 1 );
+    }
+
+    /* Terminate */
+    close( consfd );
+    fprintf( stdout, "VT switching %s\n", allow ? "enabled" : "disabled" );
+    seteuid( uid );
+    exit( 0 );
+}
diff --git a/etc/xlock.java b/etc/xlock.java
new file mode 100644 (file)
index 0000000..03009f3
--- /dev/null
@@ -0,0 +1,28 @@
+// charles vidal 28.08.97 <vidalc@club-internet.fr>
+// the main file , with the main class
+// to compile javac xlock.java
+// to launch java xlock
+// in a browser you could show the GUI but , not launch the program
+
+import java.awt.*;
+import xlockFrame;
+
+class xlock extends java.applet.Applet
+{
+int isapp=0;
+public void init(){
+Frame theAppWindow = new Frame("FrameTest");
+xlockFrame theApplet = new xlockFrame();
+theApplet.init();
+theApplet.start();
+theAppWindow.add("Center",theApplet);
+theAppWindow.resize(350,400);
+theAppWindow.show();
+}
+public static  void main(String args[]) {
+xlock xpj = new xlock();
+xpj.init();
+xpj.start();
+}
+
+}
diff --git a/etc/xlock.sh b/etc/xlock.sh
new file mode 100755 (executable)
index 0000000..693f4e8
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh -
+# Wrapper script to get better performance
+#      by Tim Auckland <Tim.Auckland@Procket.com>
+# It simply suspends all netscape and JAVA applications and resumes them
+# once xlock exits.  These applications poll when idle and that is quite
+# inconsiderate when you need all the cycles you can get for a good
+# screensaver.
+jobs=`ps -u $USER| awk '/jre/||/netscape/{print $1}'`
+[ -n "$jobs" ] && trap 'kill -CONT $jobs' 0 1 2 14 15 && kill -STOP $jobs
+/usr/local/bin/xlock "$@"
diff --git a/etc/xlock.staff b/etc/xlock.staff
new file mode 100644 (file)
index 0000000..ec59a91
--- /dev/null
@@ -0,0 +1,4 @@
+root
+wheel
+bagleyd
+david
diff --git a/etc/xlock.tcl b/etc/xlock.tcl
new file mode 100755 (executable)
index 0000000..09d8f30
--- /dev/null
@@ -0,0 +1,783 @@
+#!/usr/X11/bin/wish -f
+
+#charles vidal 1998 <vidalc@club-intenet.fr>
+# update Sun Oct 18 1998
+# Add the menu file with load resources
+# and the exit button
+# Add the load_process procedure loading
+# the ressource file ~/XLock
+#
+
+#function find in demo: mkStyles.tcl
+# The procedure below inserts text into a given text widget and
+# applies one or more tags to that text.  The arguments are:
+#
+# w             Window in which to insert
+# text          Text to insert (it's inserted at the "insert" mark)
+# args          One or more tags to apply to text.  If this is empty
+#               then all tags are removed from the text.
+set bgcolor ""
+set fgcolor ""
+set ftname ""
+set mftname ""
+set usernom ""
+set passmot ""
+set XLock_validate ""
+set XLock_invalid ""
+set XLock_program ""
+set geometrie ""
+set icogeometrie ""
+set XLock_info ""
+set indxhelp ""
+set messagesfile ""
+set messagefile ""
+set bitmap ""
+
+proc openfilesel { var  } {
+upvar $var toto
+set toto [ tk_getOpenFile -parent .]
+return toto
+}
+
+proc insertWithTags {w text args} {
+  set start [$w index insert]
+  $w insert insert $text
+  foreach tag [$w tag names $start] {
+    $w tag remove $tag $start insert
+  }
+  foreach i $args {
+    $w tag add $i $start insert
+  }
+}
+
+# Function for the help
+proc mkHelpCheck { w args } {
+  set nbf 0
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    $w insert insert  "\n"
+    checkbutton $w.c$nbf -variable [lindex $i 0] -text [lindex $i 0]
+    $w window create {end lineend} -window $w.c$nbf
+    $w insert insert  " [lindex $i 1] "
+  }
+}
+
+proc mkHelpEntry { w args } {
+  set nbf 0
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    insertWithTags  $w "\n [lindex $i 0] " underline
+    entry $w.e$nbf -textvariable [lindex $i 1]
+    $w window create {end lineend} -window $w.e$nbf
+    $w insert insert  "\n[lindex $i 2] "
+  }
+}
+
+#
+proc whichcolor { which } {
+  global fgcolor
+  global bgcolor
+  if {$which == "RESETFG"} {set fgcolor ""}
+  if {$which == "RESETBG"} {set bgcolor ""}
+  if ($tk_version>4) then {
+    if {$which== "FG" } {set fgcolor [tk_chooseColor -initialcolor $fgcolor -title "foreground color"];
+      puts $fgcolor
+    }
+  if {$which == "BG"} {set bgcolor [tk_chooseColor -initialcolor $bgcolor -title "background color"];
+      puts $bgcolor
+    }
+  } else
+  {
+    if {$which== "FG" } {set fgcolor [.color.frame.names get [.color.frame.names curselection]];}
+    if {$which == "BG"} {set bgcolor [.color.frame.names get [.color.frame.names curselection]];}
+  }
+}
+
+proc mkColor { what } {
+  if ($tk_version>4) then {
+    whichcolor $what; destroy .color
+  } else
+  {
+    toplevel .color
+    wm title .color "Color"
+    frame .color.frame -borderwidth 10
+    frame .color.frame2 -borderwidth 10
+    set w .color.frame
+    label $w.msg0   -text "Color Options"
+    pack $w.msg0 -side top
+    foreach i {/usr/local/lib/X11/rgb.txt /usr/lib/X11/rgb.txt
+        /X11/R5/lib/X11/rgb.txt /X11/R4/lib/rgb/rgb.txt} {
+      if ![file readable $i] {
+        continue;
+      }
+      set f [open $i]
+      listbox .color.frame.names -yscrollcommand ".color.frame.scroll set" \
+            -relief sunken -borderwidth 2 -exportselection false
+      bind .color.frame.names <Double-1> {
+            .color.test configure -bg [.color.frame.names get [.color.frame.names curselection]]
+      }
+      scrollbar .color.frame.scroll -orient vertical -command ".color.frame.names yview" \
+        -relief sunken -borderwidth 2
+      pack .color.frame.names  -side left
+      pack .color.frame.scroll -side right -fill both
+      pack .color.frame  -fill x
+      while {[gets $f line] >= 0} {
+        if {[llength $line] == 4} {
+          .color.frame.names insert end [lindex $line 3]
+        }
+      }
+      close $f
+      label  .color.test -height 5 -width 20
+      button .color.frame2.cancel -text Cancel -command "destroy .color"
+      button .color.frame2.ok -text OK -command "whichcolor $what; destroy .color"
+      button .color.frame2.reset -text Reset -command "whichcolor RESET$what; destroy .color"
+      pack  .color.test
+      pack .color.frame2.ok .color.frame2.cancel .color.frame2.reset -side left -fill x
+      pack .color.frame2 -fill both
+      break;
+    }
+  }
+}
+
+# moving in text by the list
+proc moveintext { indx } {
+upvar indxhelp t1
+ .help.f.t yview  [ lindex $t1 $indx ]
+
+}
+#----------------------
+# Help ...
+proc Helpxlock {} {
+  global indxhelp
+  toplevel .help
+  wm title .help "Help About Xlock"
+  frame .help.f
+  scrollbar .help.f.s -orient vertical -command {.help.f.t yview}
+  pack .help.f -expand yes -fill both
+  pack .help.f.s -side right -fill y -expand yes
+  text .help.f.t -yscrollcommand {.help.f.s set} -wrap word -width 60 -height 20 \
+    -setgrid 1
+
+  listbox .help.f.names -width 20 -height 20
+
+  bind .help.f.names <Double-1> {
+    set titi [eval .help.f.names curselection]
+    moveintext $titi
+  }
+
+  pack .help.f.names .help.f.t -expand y -fill both -side left
+  set w  .help.f.t
+  $w tag configure big -font -Adobe-Courier-Bold-R-Normal-*-140-*
+
+  foreach i {{"Xlock Help" { Locks the X server still the user enters their pass\
+word at the keyboard.  While xlock  is  running,  all  new\
+server  connections are refused.  The screen saver is dis\
+abled.  The mouse cursor is turned  off.   The  screen  is\
+blanked and a changing pattern is put on the screen.  If a\
+key or a mouse button is pressed then the user is prompted\
+for the password of the user who started xlock.
+If  the  correct  password  is  typed,  then the screen is\
+unlocked and the X server is restored.   When  typing  the\
+password  Control-U  and  Control-H are active as kill and\
+erase respectively.  To return to the locked screen, click\
+in the small icon version of the changing pattern.} 0 }
+    {"Options" {The option sets  the  X11  display  to  lock.\
+xlock  locks all available screens on a given server,\
+and restricts you to locking only a local server such\
+as  unix::00,,  localhost::00,,  or  ::00  unless you set the\
+     -remote option.} 0 }\
+    {"-name" {is used instead of XLock  when  looking for resources to configure xlock.} 1 }
+    {"-mode" {As  of  this  writing there are 100+ display modes supported (plus one more for random selection of one  of the 100+).} 1 }
+    {"-delay"  {It simply sets the number  of  microseconds to  delay
+between  batches  of animations.  In blank mode, it is important to set this to
+some small  number  of  microseconds,  because the keyboard and mouse are only checked after each delay, so you cannot set  the delay  too high, but a delay of
+zero would needlessly consume cpu checking for mouse and keyboard input  in a tight loop, since blank mode has no work to do.} 1 }
+    {"-saturation" {This option sets saturation  of  the  color ramp .  0 is grayscale and 1 is very rich color. 0.4 is a nice pastel.} 1 }
+    {"-username" {text string to use for Name prompt} 1 }\
+    {"-password" {text string to use for Password prompt} 1 }\
+    {"-info" {text string to use for instructions} 1 }\
+    {"-validate" {the message shown  while  validating  the password,
+defaults to \"Validating login...\"} 1 }\
+    {"-invalid" {the  message  shown  when  password  is invalid, defaults to \"Invalid login.\"} 1 }\
+    {"-geometry"  {This option sets the size and offset  of the  lock
+window  (normally the entire screen).  The entire screen format is still used for  entering  the password.   The  purpose  is  to  see the screen even though it is locked.  This should be used  with  caution since many of the modes will fail if the windows are far from square or are too small  (size  must  be greater
+than  0x0).   This  should also be used with esaver to protect screen from phosphor burn.} 1 }\
+    {"-icongeometry" {this option sets  the  size  of  the iconic screen (normally 64x64) seen when entering the password.  This should be  used  with  caution  since many  of  the  modes will fail if the windows are far from square
+or are too small (size  must  be  greater than  0x0).   The  greatest  size  is
+256x256.  There should be some limit  so  users  could  see  who  has locked  the  screen.  Position information of icon is ignored.} 1 }
+    {"-font" { Ths option  sets  the  font  to be used on the prompt screen.} 1 }
+    { "-fg "  { This option sets the color of the text on the password screen.} 1 }
+    {"-bg" { This option sets the color of the background on the password screen.} 1 }
+    {"-forceLogout" { This option sets the  auto-logout.  This  might not be enforced depending how your system is configured.} 1 }} {
+    lappend indxhelp [$w index current]
+    if {  [lindex $i 2] == 1 } then {.help.f.names insert end "    [lindex $i 0]"} else {.help.f.names insert end " [lindex $i 0]"}
+    insertWithTags  $w "[lindex $i 0] " big
+    $w insert end "\n"
+    $w insert end [lindex $i 1]
+    $w insert end "\n"
+  }
+  lappend indxhelp [$w index current]
+  insertWithTags  $w "Options boolean" big
+   $w insert end "\n"
+  .help.f.names insert end "Options boolean"
+  mkHelpCheck $w {XLock_mono {turn on/off monochrome override}}\
+                {nolock {trun on/off no password required mode}}\
+                {remote {turn on/off remote host access}}\
+                {allowroot {turn on/off allow root password mode (ignored)}}\
+                {enablesaver {turn on/off enable X server screen saver}}\
+                {allowaccess {turn on/off access of the terminal X}}\
+                {grabmouse {turn on/off grabbing of mouse and keyboard}}\
+                {echokeys {turn on/off echo \'?\' for each password key}}\
+                {usefirst {turn on/off using the first char typed in password}}\
+                {verbose {turn on/off verbose mode}}\
+                {inwindow {turn on/off making xlock run in a window}}\
+                {inroot {turn on/off making xlock run in the root window}}\
+                {timeelapsed {turn on/off clock}}\
+                {install {whether to use private colormap if needed (yes/no)}}\
+                {sound {whether to use sound if configured for it (yes/no}}\
+                {timeelapsed {turn on/off clock}}\
+                {usefirst {text string to use for Name prompt}}\
+                {trackmouse {turn on/off the mouse interaction}}
+        button .help.ok -text OK -command "destroy .help"
+  pack  .help.ok
+}
+
+# Create toplevel Author and Maintainer.
+proc mkAuthor {} {
+  toplevel .author
+  wm title .author "Author and Maintainer of xlock"
+  frame .author.frame -borderwidth 10
+  set w .author.frame
+
+  label $w.msg0   -text "Author and Maintainer of xlock"
+  label $w.msg1   -text "Maintained by: David A. Bagley (bagleyd@tux.org)"
+  label $w.msg2   -text "Original Author: Patrick J. Naughton (naughton@eng.sun.com)"
+  label $w.msg3   -text "Mailstop 21-14 Sun Microsystems Laboratories,"
+  label $w.msg4   -text "Inc.  Mountain View, CA  94043 15//336-1080"
+  label $w.msg5   -text "with many additional contributors"
+  pack $w.msg0 $w.msg1 $w.msg2 $w.msg3 $w.msg4 $w.msg5 -side top
+
+  label $w.msg6   -text "xlock.tcl\n created by charles VIDAL\n (author of flag mode and xmlock launcher )"
+  pack $w.msg6 -side top
+
+  button .author.ok -text OK -command "destroy .author"
+  pack $w .author.ok
+}
+
+proc mkFileDialog { nom titre args }  {
+  toplevel .$nom
+  wm title .$nom "$titre"
+  frame .$nom.frame -borderwidth 10
+  frame .$nom.frame2 -borderwidth 10
+  frame .$nom.frame.frame4 -borderwidth 10
+  set w .$nom.frame
+  set w2 .$nom.frame2
+  set w4 .$nom.frame.frame4
+  set nbf 0
+
+  label $w.msg0   -text "$titre"
+  pack $w.msg0 -side top
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    frame $w4.f$nbf
+    label $w4.f$nbf.l$nbf -text [lindex $i 0]
+    entry $w4.f$nbf.e$nbf -textvariable [lindex $i 1]
+    button $w4.f$nbf.b$nbf -text "..." -command "openfilesel [lindex $i 1]"
+    pack $w4.f$nbf.l$nbf $w4.f$nbf.e$nbf $w4.f$nbf.b$nbf  -side left -expand yes
+    pack $w4.f$nbf -expand yes
+  }
+  button $w2.ok -text OK -command "destroy .$nom"
+  button $w2.cancel -text Cancel -command "destroy .$nom"
+  pack $w -side top -expand yes
+  pack $w4 -side right -expand yes
+  pack $w2.ok $w2.cancel -side left -fill x -expand yes
+  pack $w2  -side bottom -expand yes
+}
+
+proc mkDialog { nom titre args } {
+  toplevel .$nom
+  wm title .$nom "$titre"
+  frame .$nom.frame -borderwidth 10
+  frame .$nom.frame2 -borderwidth 10
+  frame .$nom.frame.frame3 -borderwidth 10
+  frame .$nom.frame.frame4 -borderwidth 10
+  set w .$nom.frame
+  set w2 .$nom.frame2
+  set w3 .$nom.frame.frame3
+  set w4 .$nom.frame.frame4
+  set nbf 0
+
+  label $w.msg0   -text "$titre"
+  pack $w.msg0 -side top
+  foreach i $args {
+    set nbf [ expr $nbf +1 ]
+    label $w3.l$nbf -text [lindex $i 0]
+    entry $w4.e$nbf -textvariable [lindex $i 1]
+    pack $w3.l$nbf
+    pack $w4.e$nbf
+  }
+  button $w2.ok -text OK -command "destroy .$nom"
+  button $w2.cancel -text Cancel -command "destroy .$nom"
+  pack $w -side top
+  pack $w3 -side left
+  pack $w4 -side right
+  pack $w2.ok $w2.cancel -side left -fill x
+  pack $w2  -side bottom
+}
+
+proc mkMessage {} {
+  global passmot
+  global XLock_validate
+  global XLock_invalid
+  global XLock_info
+  mkDialog message {Message Options} \
+  {"message password" passmot} \
+  {"validate string" XLock_validate} \
+  {"invalid string" XLock_invalid} \
+  {"info string" XLock_info}
+}
+
+proc mkGeometry {} {
+  global geometrie
+  global icogeometrie
+  mkDialog geometry {Geometry Options} \
+  {"geometry" geometrie} \
+  {"icon geometry" icogeometrie}
+}
+
+proc mkFileOption {} {
+  global messagesfile
+  global messagefile
+  global bitmap
+  mkFileDialog fileoption {Files Options} \
+  {"messagesfile" messagesfile} \
+  {"messagefile" messagefile} \
+  {"bitmap" bitmap}
+}
+
+proc whichfont { which } {
+  global ftname
+  global mftname
+ if {$which== "FONT" } {set ftname [.font.frame.names get [.font.frame.names curselection]];}
+ if {$which == "MFONT"} {set mftname [.font.frame.names get [.font.frame.names curselection]];}
+ if {$which == "RESETFONT"} {set ftname ""}
+ if {$which == "RESETMFONT"} {set mftname ""}
+}
+
+#this function should be erase in the newer version...
+proc mkFont { What } {
+  toplevel .font
+  wm title .font "Font Options"
+  label  .font.label -text "ABCDEFGH\nIJKabedfg\nhijkmnopq"
+  frame .font.frame -borderwidth 10
+  frame .font.frame2 -borderwidth 10
+  set w .font.frame
+  label $w.msg0   -text "Font Options"
+  pack $w.msg0 -side top
+  eval exec "xlsfonts \> /tmp/xlsfont.tmp"
+  set f [open "/tmp/xlsfont.tmp"]
+  listbox .font.frame.names -yscrollcommand ".font.frame.scroll set" \
+    -xscrollcommand ".font.scroll2 set"  -setgrid 1 \
+    -exportselection false
+  bind .font.frame.names <Double-1> {
+   .font.test configure -font [.font.frame.names get [.font.frame.names curselection]]
+  }
+  scrollbar .font.frame.scroll -orient vertical -command ".font.frame.names yview" \
+    -relief sunken -borderwidth 2
+  scrollbar .font.scroll2 -orient horizontal -command ".font.frame.names xview" \
+    -relief sunken -borderwidth 2
+  while {[gets $f line] >= 0} {
+    .font.frame.names insert end $line
+  }
+  close $f
+
+  eval exec "/bin/rm -f /tmp/xlsfont.tmp"
+  pack .font.frame.names  -side left -expand y -fill both
+  pack .font.frame.scroll -side right -fill both
+  pack .font.frame  -fill x
+  pack .font.scroll2 -fill both
+  label  .font.test -text "ABCDEFGHIJKabedfghijkmnopq12345"
+  pack .font.test
+
+  button .font.frame2.cancel -text Cancel -command "destroy .font"
+  button .font.frame2.reset -text Reset -command "whichfont RESET$What;destroy .font"
+  button .font.frame2.ok -text OK -command "whichfont $What;destroy .font"
+  pack .font.frame2.ok .font.frame2.cancel .font.frame2.reset -side left -fill both
+  pack .font.frame2 -fill both
+
+  #frame $w.fontname
+  #label $w.fontname.l1 -text "font name"
+  #entry $w.fontname.e1 -relief sunken
+  #frame $w.specfont
+  #label $w.specfont.l2 -text "specifique font name"
+  #entry $w.specfont.e2 -relief sunken
+  #pack $w.fontname $w.specfont
+  #pack $w.fontname.l1 -side left
+  #pack $w.specfont.l2 -side left
+  #pack $w.fontname.e1 $w.specfont.e2  -side top -pady 5 -fill x
+  #button .font.frame2.ok -text OK -command "destroy .font"
+  #button .font.frame2.cancel -text Cancel -command "destroy .font"
+  #pack $w .font.frame2.ok .font.frame2.cancel -side left -fill x
+  #pack .font.frame2 -side bottom
+}
+
+proc mkEntry {} {
+  global usernom
+  global XLock_program
+  mkDialog option {User Options} \
+  {"user name" usernom} \
+  {"program name" XLock_program}
+}
+
+proc Affopts { device } {
+
+#options booleans
+  global XLock_mono
+  global nolock
+  global remote
+  global allowroot
+  global enablesaver
+  global allowaccess
+  global grabmouse
+  global echokeys
+  global usefirst
+  global install
+  global sound
+  global timeelapsed
+  global usefirst
+  global wireframe
+  global showfps
+  global use3d
+  global trackmouse
+
+  global fgcolor
+  global bgcolor
+  global ftname
+  global mftname
+
+  global usernom
+  global passmot
+  global XLock_validate
+  global XLock_invalid
+  global XLock_program
+  global geometrie
+  global icogeometrie
+  global XLock_info
+  global messagesfile
+  global messagefile
+  global bitmap
+
+  set linecommand "xlock "
+
+  if {$device == 1} {append linecommand "-inwindow "} elseif {$device == 2} {append linecommand "-inroot "}
+  if {$bgcolor!=""} {append linecommand "-bg $bgcolor "}
+  if {$fgcolor!=""} {append linecommand "-fg $fgcolor "}
+  if {$ftname!=""} {append linecommand "-font $ftname "}
+  if {$mftname!=""} {append linecommand "-messagefont $mftname "}
+#entry action
+  if {$usernom!=""} {append linecommand "-username $usernom "}
+  if {$passmot!=""} {append linecommand "-password $passmot "}
+  if {$XLock_validate!=""} {append linecommand "-validate $XLock_validate "}
+  if {$XLock_invalid!=""} {append linecommand "-invalid $XLock_invalid "}
+  if {$XLock_program!=""} {append linecommand "-program $XLock_program "}
+  if {$geometrie!=""} {append linecommand "-geometry $geometrie "}
+  if {$icogeometrie!=""} {append linecommand "-icongeometry $icogeometrie "}
+  if {$messagesfile!=""} {append linecommand "-messagesfile $messagesfile "}
+  if {$bitmap!=""} {append linecommand "-bitmap $bitmap "}
+  if {$icogeometrie!=""} {append linecommand "-icongeometry $icogeometrie "}
+  if {$XLock_info!=""} {append linecommand "-info $XLock_info "}
+#check actions
+  if { $XLock_mono == 1 } {append linecommand "-mono "}
+  if { $install == 1 } {append linecommand "-install "}
+  if { $sound == 1 } {append linecommand "-sound "}
+  if { $timeelapsed == 1 } {append linecommand "-timeelapsed "}
+  if { $usefirst == 1 } {append linecommand "-usefirst "}
+  if { $wireframe == 1 } {append linecommand "-wireframe "}
+  if { $showfps == 1 } {append linecommand "-showfps "}
+  if { $use3d == 1 } {append linecommand "-use3d "}
+  if { $trackmouse == 1 } {append linecommand "-trackmouse "}
+  if { $nolock == 1 } {append linecommand "-nolock "}
+  if { $remote == 1 } {append linecommand "-remote "}
+  if { $allowroot == 1 } {append linecommand "-allowroot "}
+  if { $enablesaver == 1 } {append linecommand "-enablesaver "}
+  if { $allowaccess == 1 } {append linecommand "-allowaccess "}
+  if { $grabmouse == 1 } {append linecommand "-grabmouse "}
+  if { $echokeys == 1 } {append linecommand "-echokeys "}
+  if { $usefirst == 1 } {append linecommand "-usefirst "}
+  append linecommand "-mode "
+  append linecommand [.listscrol.list get [eval .listscrol.list curselection]]
+  puts $linecommand
+  eval exec $linecommand
+}
+
+proc load_ressource { } {
+  global XLock_invalid
+  global XLock_validate
+  global XLock_info
+  global XLock_program
+
+set filename ""
+
+openfilesel filename
+
+set f [ open $filename r ]
+while { ! [eof $f ] } {
+       gets $f line
+               switch -regexp $line {
+       {^XLock\.[a-zA-Z]+:} {
+               if { [ regexp -nocase {\: $} tyty ]} {
+               }
+       regsub {^} $line "set " line2
+       regsub {XLock\.} $line2 "XLock_" line3
+       regsub {: } $line3 " \"" line4
+       regsub {on$} $line4 "1" line5
+       regsub {off$} $line4 "0" line5
+       eval "$line5\""
+       }
+       {^XLock\.[a-zA-Z]+\.[a-zA-Z]+:[ \t]*[a-zA-Z0-9]+$} {
+       regsub {^} $line "set " line2
+       regsub {XLock\.} $line2 "XLock_" line3
+       regsub {\.} $line3 "(" line4
+       regsub {: } $line4 ") \"" line5
+       eval "$line5\""
+       }
+}
+}
+}
+
+# Creation of GUI
+
+wm title . "xlock launcher"
+. configure -cursor top_left_arrow
+frame .menu -relief raised -borderwidth 1
+menubutton .menu.button -text "switches" -menu .menu.button.check
+pack .menu -side top -fill x
+
+global XLock_mono
+global sound
+global install
+global nolock
+global remote
+global allowroot
+global enablesaver
+global allowaccess
+global grabmouse
+global echokeys
+global usefirst
+
+global usernom
+global passmot
+global geometrie
+global icogeometrie
+global XLock_info
+
+# Creation of GUI
+
+#Creation of  menu
+set fileressource ""
+
+menubutton .menu.buttonf -text "file" -menu .menu.buttonf.file
+menu .menu.buttonf.file
+set FILE .menu.buttonf.file
+$FILE add command -label "Load ressource" -command "load_ressource"
+$FILE add command -label "exit" -command "exit"
+
+menu .menu.button.check
+set CHECK .menu.button.check
+
+#menu with les check buttons
+$CHECK add check -label "mono" -variable XLock_mono
+$CHECK add check -label "nolock" -variable nolock
+$CHECK add check -label "remote" -variable remote
+$CHECK add check -label "allowroot" -variable allowroot
+$CHECK add check -label "enablesaver" -variable enablesaver
+$CHECK add check -label "allowaccess" -variable allowaccess
+$CHECK add check -label "grabmouse" -variable grabmouse
+$CHECK add check -label "echokeys" -variable echokeys
+$CHECK add check -label "usefirst" -variable usefirst
+$CHECK add check -label "install" -variable install
+$CHECK add check -label "sound" -variable sound
+$CHECK add check -label "timeelapsed" -variable timeelapsed
+$CHECK add check -label "usefirst" -variable usefirst
+$CHECK add check -label "wireframe" -variable wireframe
+$CHECK add check -label "showfps" -variable showfps
+$CHECK add check -label "use3d" -variable use3d
+$CHECK add check -label "trackmouse" -variable trackmouse
+
+menubutton .menu.button2 -text "options" -menu .menu.button2.options
+menu .menu.button2.options
+set OPTIONS .menu.button2.options
+#les options
+$OPTIONS add command -label "generals options" -command "mkEntry"
+$OPTIONS add command -label "font to use for password prompt" -command "mkFont FONT"
+$OPTIONS add command -label "font for a specific mode" -command "mkFont MFONT"
+
+
+$OPTIONS add command -label "geometry options" -command "mkGeometry"
+$OPTIONS add command -label "file options" -command "mkFileOption"
+$OPTIONS add command -label "message options" -command "mkMessage"
+
+#Color
+menubutton .menu.button4 -text "color" -menu .menu.button4.color
+menu .menu.button4.color
+set COLOR .menu.button4.color
+#if {$tk_version < 4} then {
+#$COLOR add command -label "foreground options for password" -command "mkColor FG"
+#$COLOR add command -label "background options for password" -command "mkColor BG"
+#}
+#else {
+$COLOR add command -label "foreground options for password" -command "tk_chooseColor"
+$COLOR add command -label "background options for password" -command "tk_chooseColor"
+#}
+menubutton .menu.button3 -text "help" -menu .menu.button3.help
+menu .menu.button3.help
+set HELP .menu.button3.help
+$HELP add command -label "about xlock" -command "Helpxlock"
+$HELP add command -label "about author" -command "mkAuthor"
+
+pack .menu.buttonf .menu.button  .menu.button2 .menu.button4 -side left
+pack .menu.button3 -side right
+
+#---------------------------
+#creation de la liste
+#---------------------------
+frame .listscrol -borderwidth 4 -relief ridge
+set LISTSCROL .listscrol
+scrollbar $LISTSCROL.scroll -relief sunken -command "$LISTSCROL.list yview"
+listbox $LISTSCROL.list -yscroll  "$LISTSCROL.scroll set"
+
+#---------------------------
+#insert all modes in list
+#---------------------------
+$LISTSCROL.list  insert 0 \
+ant\
+atlantis\
+ball\
+bat\
+blot\
+bouboule\
+bounce\
+braid\
+bubble\
+bubble3d\
+bug\
+cage\
+clock\
+coral\
+crystal\
+daisy\
+dclock\
+decay\
+deco\
+demon\
+dilemma\
+dragon\
+discrete\
+drift\
+euler2d\
+eyes\
+fadeplot\
+fire\
+flag\
+flame\
+flow\
+forest\
+galaxy\
+gears\
+glplanet\
+goop\
+grav\
+helix\
+hop\
+hyper\
+ico\
+ifs\
+image\
+invert\
+juggle\
+julia\
+kaleid\
+kumppa\
+lament\
+laser\
+life\
+life1d\
+life3d\
+lightning\
+lisa\
+lissie\
+loop\
+lyapunov\
+mandelbrot\
+marquee\
+matrix\
+maze\
+moebius\
+morph3d\
+mountain\
+munch\
+nose\
+pacman\
+penrose\
+petal\
+pipes\
+polyominoes\
+puzzle\
+pyro\
+qix\
+roll\
+rotor\
+rubik\
+sballs\
+scooter\
+shape\
+sierpinski\
+sierpinski3d\
+skewb\
+slip\
+solitare\
+space\
+sphere\
+spiral\
+spline\
+sproingies\
+stairs\
+star\
+starfish\
+strange\
+superquadrics\
+swarm\
+swirl\
+t3d\
+tetris\
+text3d\
+thornbird\
+tik_tak\
+triangle\
+tube\
+turtle\
+vines\
+voters\
+wator\
+wire\
+world\
+worm\
+xcl\
+xjack\
+blank\
+bomb\
+random
+
+pack $LISTSCROL.scroll -side right -fill y
+pack $LISTSCROL.list -side left -expand yes -fill both
+pack $LISTSCROL  -fill both -expand yes
+
+frame .buttons -borderwidth 4 -relief ridge
+set BUTTON .buttons
+button $BUTTON.launch -text "Launch"  -command "Affopts 0"
+button $BUTTON.launchinW -text "Launch in Window" -command "Affopts 1"
+button $BUTTON.launchinR -text "Launch in Root" -command "Affopts 2"
+button $BUTTON.quit -text Quit -command "exit"
+pack  $BUTTON.launch $BUTTON.launchinW $BUTTON.launchinR -side left
+pack $BUTTON.quit -side right
+pack $BUTTON -fill x -side bottom
diff --git a/etc/xlock1.sh b/etc/xlock1.sh
new file mode 100644 (file)
index 0000000..c7b07c9
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# My lil' wrapper routine to execute a program, but only if it's
+# not already running
+# Sometimes xlock crashes when xautlock calls xlock when already running.
+#
+PROG=xlock
+
+TST=`ps aux | grep $PROG | grep -v grep`
+if [ -z "$TST" ]; then
+       $PROG
+fi
diff --git a/etc/xlockFrame.java b/etc/xlockFrame.java
new file mode 100644 (file)
index 0000000..127b12e
--- /dev/null
@@ -0,0 +1,310 @@
+// charles vidal <vidalc@club-internet.fr>
+// the GUI definition and the handler event
+import java.applet.*;
+import java.awt.*;
+import java.lang.Runtime;
+
+public class xlockFrame extends Applet {
+
+public static final int nbcoption=9;
+public static final int nbbooleanopt=14;
+Button blaunch;
+Button blaunchinw;
+Button bquit;
+Choice coptions;
+TextField foroptions;
+ List lst ;
+int    currentOption=0;
+
+MyFrameError mfe;
+
+boolean isinapp=false;
+
+// Array of option name
+String[] nomOption={"Name program",
+"File",
+"Message Password",
+"Message Valid",
+"Message Invalid",
+"Prompt",
+"Fonts",
+"Geometry","Display"};
+
+String[] valueOption={"","","","","","","","",""};
+String[] cmdlineOption={"-program","-messagefile","-password","-validate","-invalid","","-font","-geometry","-display"};
+
+// Array of option boolean name
+String[] booleanOption={
+"-mono ",
+"-nolock ",
+"-remote ",
+"-allowroot ",
+"-enablesaver ",
+"-allowaccess ",
+"-grabmouse ",
+"-echokeys ",
+"-usefirst ",
+"-verbose ",
+"-inroot ",
+"-timeelapsed ",
+"-install ",
+"-wireframe ",
+"-showfps ",
+"-use3d "};
+Checkbox bopt[]=new Checkbox[15];
+ public void init()
+        {
+ Frame theAppWindow = new Frame("xlockFrame");
+ Panel Panel1 = new Panel();
+ Panel Panel2 = new Panel();
+ Panel Panel3 = new Panel();
+ setLayout(new BorderLayout(10,10));
+
+ lst = new List();
+
+coptions=new Choice();
+for (int i=0;i<nbcoption;i++)
+       coptions.addItem(nomOption[i]);
+
+Panel3.add(coptions);
+
+foroptions = new TextField(20);
+Panel3.add(foroptions);
+
+add("North", Panel3);
+
+add("Center",lst);
+lst.addItem("ant");
+lst.addItem("atlantis");
+lst.addItem("ball");
+lst.addItem("bat");
+lst.addItem("blot");
+lst.addItem("bouboule");
+lst.addItem("bounce");
+lst.addItem("braid");
+lst.addItem("bubble");
+lst.addItem("bubble3d");
+lst.addItem("bug");
+lst.addItem("cage");
+lst.addItem("clock");
+lst.addItem("coral");
+lst.addItem("crystal");
+lst.addItem("daisy");
+lst.addItem("dclock");
+lst.addItem("decay");
+lst.addItem("deco");
+lst.addItem("demon");
+lst.addItem("dilemma");
+lst.addItem("dragon");
+lst.addItem("discrete");
+lst.addItem("drift");
+lst.addItem("euler2d");
+lst.addItem("eyes");
+lst.addItem("fadeplot");
+lst.addItem("fire");
+lst.addItem("flag");
+lst.addItem("flame");
+lst.addItem("flow");
+lst.addItem("forest");
+lst.addItem("galaxy");
+lst.addItem("gears");
+lst.addItem("glplanet");
+lst.addItem("goop");
+lst.addItem("grav");
+lst.addItem("helix");
+lst.addItem("hop");
+lst.addItem("hyper");
+lst.addItem("ico");
+lst.addItem("ifs");
+lst.addItem("image");
+lst.addItem("invert");
+lst.addItem("juggle");
+lst.addItem("julia");
+lst.addItem("kaleid");
+lst.addItem("kumppa");
+lst.addItem("lament");
+lst.addItem("laser");
+lst.addItem("life");
+lst.addItem("life1d");
+lst.addItem("life3d");
+lst.addItem("lightning");
+lst.addItem("lisa");
+lst.addItem("lissie");
+lst.addItem("loop");
+lst.addItem("lyapunov");
+lst.addItem("mandelbrot");
+lst.addItem("marquee");
+lst.addItem("matrix");
+lst.addItem("maze");
+lst.addItem("moebius");
+lst.addItem("morph3d");
+lst.addItem("mountain");
+lst.addItem("munch");
+lst.addItem("nose");
+lst.addItem("pacman");
+lst.addItem("penrose");
+lst.addItem("petal");
+lst.addItem("pipes");
+lst.addItem("polyominoes");
+lst.addItem("puzzle");
+lst.addItem("pyro");
+lst.addItem("qix");
+lst.addItem("roll");
+lst.addItem("rotor");
+lst.addItem("rubik");
+lst.addItem("sballs");
+lst.addItem("scooter");
+lst.addItem("shape");
+lst.addItem("sierpinski");
+lst.addItem("sierpinski3d");
+lst.addItem("skewb");
+lst.addItem("slip");
+lst.addItem("solitare");
+lst.addItem("space");
+lst.addItem("sphere");
+lst.addItem("spiral");
+lst.addItem("spline");
+lst.addItem("sproingies");
+lst.addItem("stairs");
+lst.addItem("star");
+lst.addItem("starfish");
+lst.addItem("strange");
+lst.addItem("superquadrics");
+lst.addItem("swarm");
+lst.addItem("swirl");
+lst.addItem("t3d");
+lst.addItem("tetris");
+lst.addItem("text3d");
+lst.addItem("thornbird");
+lst.addItem("tik_tak");
+lst.addItem("triangle");
+lst.addItem("tube");
+lst.addItem("turtle");
+lst.addItem("vines");
+lst.addItem("voters");
+lst.addItem("wator");
+lst.addItem("wire");
+lst.addItem("world");
+lst.addItem("worm");
+lst.addItem("xcl");
+lst.addItem("xjack");
+lst.addItem("blank");
+lst.addItem("bomb");
+lst.addItem("random");
+lst.select(0);
+
+add("East", Panel1);
+Panel1.setLayout(new GridLayout(15,1));
+for (int i=0;i<nbbooleanopt;i++)
+       { bopt[i]=new Checkbox(booleanOption[i],null,false);
+       Panel1.add(bopt[i]);
+       }
+
+add("South", Panel2);
+blaunch=new Button("Launch");
+blaunchinw=new Button("Launch in window");
+bquit=new Button("Quit");
+Panel2.add(blaunch);
+Panel2.add(blaunchinw);
+Panel2.add(bquit);
+}
+public String getBooleanOption()
+{
+String result="";
+for (int i=0;i<nbbooleanopt;i++)
+       {if (bopt[i].getState()) result=result.concat(booleanOption[i]);
+       }
+       return (result);
+}
+public boolean action (Event evt, Object arg)
+{
+
+Runtime r=Runtime.getRuntime();
+
+
+if (isinapp)
+       mfe=new MyFrameError("An error occured , You can't launch xlock");
+       else
+       mfe=new MyFrameError("An error occured , You can't launch xlock");
+       //mfe=new MyFrameError("You can't launch by a Browser");
+
+mfe.resize(350,150);
+
+if (evt.target == blaunch || evt.target == blaunchinw)
+       {
+       String label= (String) arg;
+       String cmdlinexlock="xlock ";
+       if (evt.target == blaunchinw ) cmdlinexlock=cmdlinexlock.concat("-inwindow ");
+       for (int i=0;i<nbcoption;i++)
+               {
+               if (!valueOption[i].equals(""))
+                       {
+                       cmdlinexlock=cmdlinexlock.concat(cmdlineOption[i]+" "+valueOption[i]+" ");
+                       }
+               }
+       cmdlinexlock=cmdlinexlock.concat(getBooleanOption());
+       cmdlinexlock=cmdlinexlock.concat(" -mode ");
+       cmdlinexlock=cmdlinexlock.concat(lst.getSelectedItem());
+       try {
+  System.out.println(cmdlinexlock);
+       r.getRuntime().exec(cmdlinexlock); }
+                       catch ( Exception e )
+                               {mfe.show();}
+       return true;}
+else
+       if (evt.target == coptions)
+       {
+       String label= (String) arg;
+       valueOption[currentOption]=foroptions.getText();
+       for (int i=0;i<nbcoption;i++)
+               {
+               if (nomOption[i].equals(label))
+                       {foroptions.setText(valueOption[i]);
+                       currentOption=i;
+                       }
+               }
+       }
+else
+       if (evt.target == bquit) {System.exit(0);}
+       else if (evt.target instanceof Checkbox)
+       {
+       return true;
+       }
+else
+       if (evt.target == foroptions)
+       {
+       String label= (String) arg;
+       valueOption[currentOption]=label;
+       return true;
+       }
+       return false;
+  }
+
+public void SetInAppl()
+{
+isinapp=true;
+}
+
+}
+class MyFrameError extends Frame {
+Label l;
+Button b_ok;
+MyFrameError (String erreur) {
+
+       setLayout(new BorderLayout());
+       l=new Label(erreur,Label.CENTER);
+       add("Center",l);
+       b_ok=new Button("Ok");
+       add("South",b_ok);
+       setTitle(erreur);
+       setCursor(HAND_CURSOR);
+       }
+public boolean action (Event evt,Object arj){
+       if (evt.target instanceof Button)
+               {
+               this.hide();
+               return (true);
+               }
+               return (false);
+}
+}
diff --git a/etc/xlockhexlife.pl b/etc/xlockhexlife.pl
new file mode 100755 (executable)
index 0000000..96924ec
--- /dev/null
@@ -0,0 +1,82 @@
+#!/usr/bin/perl -T -w
+# This is used  to add life to life
+# This is a QUICK hack to convert life files to xlock's life format.
+# Patterns MUST have <= 64 pts at start for life.c to use the data generated
+# Below is an example of a life file without the first initial #'s
+# Call the file glider.hlife and run it like xlockhexlife.pl < glider.hlife
+#glider.hlife
+##P -2 -2   Treated as a comment, program finds own center
+#       . . O .
+#      . . . O
+#     O . . O
+#    . . . O
+#   . . . O
+
+local($PTS, $X, $Y);
+
+print "
+Drop these points in life.c, within the 'patterns' array.
+Note if the number of points > 64, one must increase points NUMPTS;
+also to fit most screens and especially the iconified window,
+one should have the size < 32x32.\n\n";
+&search;
+print "\npoints = $PTS; size = ${X}x$Y\n";
+
+sub search {
+    local ($row, $col, $firstrow, $firstcol);
+    local ($i, $j, $found, $c, $tempx, $tempy);
+    local (@array);
+
+    $row = $col = 0;
+    $firstrow = -1;
+    $firstcol = 80;
+    $PTS = $X = $Y = 0;
+    while (<>) {
+         if (!($_ =~ /^#/))
+         {
+            @chars = split(//);
+            $col = 0;
+            foreach $c (@chars) {
+                if ($c =~ /[\*0O]/) {
+                       $col++;
+                    if ($firstrow < 0) {
+                        $row = $firstrow = 1;
+                    }
+                    if ($col < $firstcol) {
+                        $firstcol = $col;
+                    }
+                    if ($row > $Y) {
+                        $Y = $row;
+                    }
+                    if ($col > $X) {
+                        $X = $col;
+                    }
+                    $array{$col, $row} = 1;
+                    $PTS++;
+                } elsif ($c =~ /[\.]/) {
+                       $col++;
+                       }
+            }
+            $row++;
+        }
+    }
+    $col = $X - $firstcol + 1;
+    $row = $Y;
+    print "    {\n        ";
+    for ($j = 0; $j <= $Y; $j++) {
+        $found = 0;
+        for ($i = 0; $i <= $X; $i++) {
+            if ($array{$i, $j}) {
+                $found = 1;
+                $tempx = $i - int(($col + 2) / 2) - $firstcol + 1;
+                $tempy = $j - int(($row + 2) / 2);
+                printf "$tempx, $tempy, ";
+            }
+        }
+        if ($found) {
+            print "\n        ";
+        }
+  }
+  print "127\n    },\n";
+  $X = $col;
+}
diff --git a/etc/xlocklife.pl b/etc/xlocklife.pl
new file mode 100755 (executable)
index 0000000..ccd16c1
--- /dev/null
@@ -0,0 +1,83 @@
+#!/usr/bin/perl -T -w
+# This is used  to add life to life
+# This is a QUICK hack to convert life files to xlock's life format.
+# Patterns MUST have <= 64 pts at start for life.c to use the data generated
+# Below is an example of a life file without the first initial #'s
+# Call the file piston.life and run it like xlocklife.pl < piston.life
+#piston.life
+##P -10 -3  Treated as a comment, program finds own center
+#..........*...........
+#..........****........
+#**.........****.......
+#**.........*..*.....**
+#...........****.....**
+#..........****........
+#..........*...........
+
+local($PTS, $X, $Y);
+
+print "
+Drop these points in life.c, within the 'patterns' array.
+Note if the number of points > 64, one must increase points NUMPTS;
+also to fit most screens and especially the iconified window,
+one should have the size < 32x32.\n\n";
+&search;
+print "\npoints = $PTS; size = ${X}x$Y\n";
+
+sub search {
+    local ($row, $col, $firstrow, $firstcol);
+    local ($i, $j, $found, $c, $tempx, $tempy);
+    local (@array);
+
+
+    $row = $col = 0;
+    $firstrow = -1;
+    $firstcol = 80;
+    $PTS = $X = $Y = 0;
+    while (<>) {
+         if (!($_ =~ /^#/))
+         {
+            @chars = split(//);
+            $col = 0;
+            foreach $c (@chars) {
+                $col++;
+                if ($c =~ /[\*0O]/) {
+                    if ($firstrow < 0) {
+                        $row = $firstrow = 1;
+                    }
+                    if ($col < $firstcol) {
+                        $firstcol = $col;
+                    }
+                    if ($row > $Y) {
+                        $Y = $row;
+                    }
+                    if ($col > $X) {
+                        $X = $col;
+                    }
+                    $array{$col, $row} = 1;
+                    $PTS++;
+                }
+            }
+            $row++;
+        }
+    }
+    $col = $X - $firstcol + 1;
+    $row = $Y;
+    print "    {\n             ";
+    for ($j = 0; $j <= $Y; $j++) {
+        $found = 0;
+        for ($i = 0; $i <= $X; $i++) {
+            if ($array{$i, $j}) {
+                $found = 1;
+                $tempx = $i - int(($col + 2) / 2) - $firstcol + 1;
+                $tempy = $j - int(($row + 2) / 2);
+                printf "$tempx, $tempy, ";
+            }
+        }
+        if ($found) {
+            print "\n          ";
+        }
+  }
+  print "127\n },\n";
+  $X = $col;
+}
diff --git a/etc/xlockranddur.pl b/etc/xlockranddur.pl
new file mode 100755 (executable)
index 0000000..c9fd5fe
--- /dev/null
@@ -0,0 +1,6 @@
+#!/usr/bin/perl -w
+# xarand
+open(S,"/usr/games/fortune|wc|");
+local(@numbers) = split(" ",<S>);
+print int $numbers[2]/3;
+close(S);
diff --git a/etc/xlockrandimage.pl b/etc/xlockrandimage.pl
new file mode 100755 (executable)
index 0000000..e9db2e6
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+# This is used if the RANDIMAGEFILE switch does not work so instead of:
+# xlock -imagefile [ DIRECTORY | FILE ] [other xlock options]
+# try
+# randimagefile.pl [DIRECTORY | FILE] [other xlock options]
+# By the way the typical other xlock options that would be used here are
+# -mode [image | puzzle] -install
+
+local($file) = shift(@ARGV);
+if ($file eq "") {
+    print "\nUsage: $0 [DIRECTORY | FILE] [other xlock options]\n";
+    print "\tother xlock options typically are: -mode [image | puzzle] -install\n";
+    exit 1;
+}
+
+getrandfile();
+#printf "xlock -imagefile $file @ARGV\n";
+system "xlock -imagefile $file @ARGV";
+
+sub getrandfile {
+  if (-d $file) { # OK so its not really a file :)
+    opendir(DIR, $file) || die "Can not open $file";
+    local(@filenames) = grep(!/^\.\.?$/, readdir(DIR)); # ls but avoid . && ..
+    closedir(DIR);
+    srand(time); # use time|$$ if security involved
+    $file = splice(@filenames, rand @filenames, 1); # pick one
+  }
+}
diff --git a/etc/xlocksat.pl b/etc/xlocksat.pl
new file mode 100755 (executable)
index 0000000..5460b22
--- /dev/null
@@ -0,0 +1,8 @@
+#!/usr/bin/perl -T -w
+# xlocksat
+require "ctime.pl";
+
+#local($hour) = `/bin/date "+%H:"`;
+local($hour) = (localtime)[2];
+local($saturation) = (12 - abs($hour - 12)) / 12 ;
+printf("%.2f\n", $saturation);
diff --git a/etc/xtermlock.sh b/etc/xtermlock.sh
new file mode 100755 (executable)
index 0000000..93cc1c1
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Runs xlock displaying to the current X terminal emulator window
+# Works well in xterm, but not so well in terminal emulators like
+# dtterm that have menu bars and other junk.
+#
+# All arguments are passed to xlock.
+
+g=`stty -a |
+    sed -ne's/.* ypixels = \([^;]*\); xpixels = \([^;]*\).*/\2x\1/p'`
+exec xlock -inwindow -parent $WINDOWID +install -geometry $g "$@"
diff --git a/etc/xwinlock.sh b/etc/xwinlock.sh
new file mode 100755 (executable)
index 0000000..aee7744
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Runs xlock displaying in another X client's window.
+# use -me to use current terminal emulator window (works in ddterm).
+# use -id <windowid> to display to a specific window.
+# Otherwise select the target window with the cross-hair cursor.
+#
+# All other arguments are passed to xlock.
+
+case $1 in
+-me)if [ "$WINDOWID" ]; then id="-id $WINDOWID"; shift
+    else echo >&2 "WINDOWID not set"; exit 1; fi;;
+-id)if [ $# -gt 1 ]; then id="-id $2"; shift; shift
+    else echo >&2 "ID not specified"; exit 1; fi;;
+esac
+exec xlock  +install -inwindow -parent `xwininfo $id -int |
+    awk '/Window id/{printf "%d", $4};
+         /Width/{printf " -geometry %d", $2};
+         /Height/{printf "x%d", $2}'` "$@"
diff --git a/gettext.tcl b/gettext.tcl
new file mode 100755 (executable)
index 0000000..6b2aaa0
--- /dev/null
@@ -0,0 +1,156 @@
+#
+# gettext like message catalogue system
+#
+# By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
+#
+# $Id: gettext.tcl,v 1.3 2000/07/30 04:44:24 elca Exp $
+
+#
+# How to use
+#
+# 1) Create catalogue file named "language.<$LANG>.tcl".
+#    If your $LANG environment valuable is "ja_JP.eucJP", you make
+#    "language.ja_JP.eucJP.tcl" or "language.ja_JP.tcl" or "language.ja.tcl".
+#    Here is some example for English-Japanese translation.
+#
+#    -------
+#    settext "hello" "¤³¤ó¤Ë¤Á¤Ï"
+#    settext "OK"    "λ²ò"
+#    ...
+#    ------
+#
+# 2) Setup auto-load path. You must make file named "tclIndex" before
+#    use this system. See "auto_mkindex" Tcl command help.
+#
+# 3) Add these lines at top of your tcl script file.
+#
+#    -----
+#    set auto_path [linsert $auto_path end .]  ;# All script files in "."
+#    set_catalogue [set_language]
+#    -----
+#
+# 4) Use "gettext" command for message transration.
+#    You can also use "_" command for easy use.
+#
+#    -----
+#    gettext "hello"   ;# -> "¤³¤ó¤Ë¤Á¤Ï"
+#    _ "OK"            ;# -> "λ²ò"
+#    -----
+#
+
+#####################################################################
+# Internal valueable. Don't use it.
+set g_language "C"
+set g_resource("__dummy__") ""
+
+######################################################################
+# Global functions
+######################################################################
+
+#
+# Select language catarogue file
+#
+# If catalogue file is found, return language string.
+# If not found catalogue file, return "C".
+#
+proc set_language {{lang ""}} {
+    global g_language env
+
+    # If some argument is given, force to set language.
+    if {$lang != ""} then {
+       set g_language $lang
+       return $g_language
+    }
+
+    if {![info exists env(LANG)]} {
+       set g_language "C"
+       return "C"
+    }
+
+    foreach f "$env(LANG) [lang_substr1 $env(LANG)] [lang_substr2 $env(LANG)]" {
+       if {$f == ""} {continue}
+       if {[file exist language.$f.tcl]} {
+           set g_language $f
+       }
+    }
+
+    return $g_language
+}
+
+#
+# Read catalogue file named "language.$lang.tcl".
+#
+proc set_catalogue {lang} {
+    if {$lang == "C"} {return}
+
+    if {[file exist language.$lang.tcl]} {
+       source language.$lang.tcl
+    }
+}
+
+#
+# Get translated string
+#
+proc gettext {string} {
+    global g_resource
+
+    if {[info exist g_resource($string)]} {
+       return $g_resource($string)
+    } else {
+       return $string
+    }
+}
+
+#
+# Set translation catalogue string.
+#
+proc settext {from to} {
+    global g_resource
+
+    set g_resource($from) $to
+}
+
+#
+# For easy use
+#
+proc _ {string} {
+    return [gettext $string]
+}
+
+
+########################################################################
+# Internal functions. Don't use it.
+########################################################################
+
+#
+# "ja_JP.eucJP" -> "ja_JP"
+# "ja_JP"       -> "ja_JP"
+#
+proc lang_substr1 {str} {
+    if {[regexp -nocase {^([a-z]+_[a-z]+)\.[a-z]+$} $str a b]} {
+       return $b
+    } elseif {[regexp -nocase {^([a-z]+_[a-z]+)$} $str a b]} {
+       return $b
+    } else {
+       return ""
+    }
+}
+
+#
+# "ja_JP.eucJP" -> "ja"
+# "ja_JP"       -> "ja"
+# "ja"          -> "ja"
+#
+proc lang_substr2 {str} {
+    if {[regexp -nocase {^([a-z]+)_[a-z]+\.[a-z]+$} $str a b]} {
+       return $b
+    } elseif {[regexp -nocase {^([a-z]+)_[a-z]+$} $str a b]} {
+       return $b
+    } elseif {[regexp -nocase {^([a-z]+)$} $str a b]} {
+       return $b
+    } else {
+       return ""
+    }
+}
+
+# end
diff --git a/iconfig.h b/iconfig.h
new file mode 100644 (file)
index 0000000..f57fbe0
--- /dev/null
+++ b/iconfig.h
@@ -0,0 +1,557 @@
+/* Config file for xlockmore
+ * Many "ideas" taken from xscreensaver-1.34 by Jamie Zawinski.
+ *
+ * This file is included by the various Imakefiles.
+ * After editing this file, you need to execute the commands
+ *
+ *         xmkmf
+ *         make Makefiles
+ *
+ * Substitute #undef with #define to activate option
+ */
+
+XCOMM !!!WARNING!!! Known security hole with MesaGL < 3.0 if setuid root
+XCOMM Define these now or down further below, see below for explaination.
+XCOMM  #define CPPCompiler
+XCOMM  #define XpmLibrary
+XCOMM  #define XmLibrary
+XCOMM  #define GLLibrary
+XCOMM  #define TtfLibrary
+XCOMM  #define GlttLibrary
+XCOMM  #define DtSaverLibrary
+XCOMM  #define DPMSLibrary
+XCOMM  #define RplayLibrary
+XCOMM  #define NasLibrary
+XCOMM  #define Modules
+XCOMM  #define Check
+XCOMM  #define Unstable
+
+N =
+O = .o
+XCOMM  O = .obj
+C = .c
+CX = .cc
+S = $(N) $(N)
+XCOMM  S = ,
+
+XCOMM please define
+XCOMM C as the C source code extension
+XCOMM O as the object extension
+XCOMM S as the separator for object code
+
+XCOMM  CC = cc
+XCOMM  CC = acc
+XCOMM  CC = CC
+XCOMM  CC = gcc -Wall
+XCOMM  CC = g++ -Wall
+XCOMM  CXX = g++ -Wall
+XCOMM  CXX = CC
+
+LN_S = $(LN)
+
+XCOMM   *** BEGIN C++ CONFIG SECTION ***
+
+XCOMM Only the solitare, invert.c, and text3d.cc modes use this.
+XCOMM modes use this.
+XCOMM If your system has libXpm, remove the 'XCOMM  ' from the next line.
+XCOMM  #define CPPCompiler
+
+XCOMM If your system has C++, remove the 'XCOMM  ' from the next line.
+#ifdef CPPCompiler
+CPPDEF = -DHAVE_CXX
+XCOMM Need this to get text3d.cc to work.
+XCOMM If your system has these 2 remove the 'XCOMM  ' from the next 2 lines.
+XCOMM  #define TtfLibrary
+XCOMM  #define GlttLibrary
+
+#ifdef TtfLibrary
+#ifdef GlttLibrary
+CPPDEF += -DHAVE_TTF -DHAVE_GLTT
+GLTTLIB = -L/usr/local/lib -lgltt
+TTFLIB = -L/usr/local/lib -lttf
+#endif
+#endif
+#endif
+
+XCOMM   *** END C++ CONFIG SECTION ***
+
+XCOMM   *** BEGIN XPM CONFIG SECTION ***
+
+XCOMM Only the bat.c, flag.c, image.c, maze.c, and puzzle.c
+XCOMM modes use this.
+XCOMM If your system has libXpm, remove the 'XCOMM  ' from the next line.
+XCOMM  #define XpmLibrary
+
+#ifdef XpmLibrary
+XPMDEF = -DUSE_XPM
+XCOMM Use the following if your xpm.h file is not in an X11 directory
+XCOMM  XPMDEF = -DUSE_XPMINC
+
+XCOMM If you get an error "Cannot find xpm.h" while compiling, set
+XCOMM XPMINC to the directory X11/xpm.h is in.  Below is a guess.
+XPMINC = -I/usr/local/include
+XCOMM SGI's ViewKit (use with -DUSE_XPMINC)
+XCOMM  XPMINC = -I/usr/include/Vk
+
+XCOMM If you get an error "Cannot find libXpm" while linking, set XPMLIBPATH
+XCOMM to the directory libXpm.* is in.  Below is a guess.
+XPMLIB = -L/usr/local/lib -lXpm
+
+#endif
+
+XCOMM   *** END XPM CONFIG SECTION ***
+
+XCOMM   *** BEGIN XM CONFIG SECTION ***
+
+XCOMM Only options.c and xmlock.c uses Motif.
+XCOMM If your system has libXm, remove the 'XCOMM  ' from the next line.
+XCOMM  #define XmLibrary
+
+#ifdef XmLibrary
+XCOMM If its not with your X11 stuff you should set the following
+XCOMM  MOTIFHOME = /usr/local
+XCOMM  MOTIFHOME = /usr/dt
+
+XCOMM If you get an error "Cannot find Xm/PanedW.h" while compiling, set
+XCOMM XMINC to the directory Xm/PanedW.h is in.  Below is a guess.
+XCOMM  XMINC = -I$(MOTIFHOME)/include
+
+XCOMM If you get an error "Cannot find libXm" while linking, set XMLIBPATH
+XCOMM to the directory libXm.* is in.  Below is a guess.
+XCOMM  XMLIB = -L$(MOTIFHOME)/lib -lXm
+XMLIB = -lXm
+
+XCOMM Debugging with editres
+XCOMM  EDITRESDEF = -DUSE_XMU
+XCOMM  EDITRESLIB = -lXmu
+#endif
+
+XCOMM   *** END XM CONFIG SECTION ***
+
+XCOMM   *** BEGIN MESAGL AND OPENGL CONFIG SECTION ***
+
+XCOMM Modes in modes/glx use this.
+XCOMM If your system has libMesaGL & widgets,
+XCOMM remove the 'XCOMM  ' from the next line.
+XCOMM  #define GLLibrary
+
+#ifdef GLLibrary
+GLDEF = -DUSE_GL
+
+XCOMM If you get an error "Cannot find GL/gl.h" while compiling, set
+XCOMM GLINC to the directory GL/gl.h is in.
+GLINC = -I/usr/local/include
+
+XCOMM If you get an error "Cannot find libMesaGL" while linking, set GLLIBPATH
+XCOMM to the directory libMesaGL.* is in.  Below is a guess.
+XCOMM !!!WARNING!!! Known security hole with MesaGL < 3.0 if setuid root
+GLLIB = -L/usr/local/lib -lGL -lGLU
+XCOMM   GLLIB = -L/usr/local/lib -lMesaGL -lMesaGLU
+
+#if SGIArchitecture
+GLLIB = -lGL -lGLU -lgl
+#endif
+#if SunArchitecture
+XCOMM with OGL1.1
+GLDEF += -DSUN_OGL_NO_VERTEX_MACROS
+#endif
+XCOMM 3Dfx card
+XCOMM  GLDEF += -DFX
+XCOMM Threads
+XCOMM  GLLIB += -lpthread
+#endif
+
+XCOMM   *** END MESAGL AND OPENGL CONFIG SECTION ***
+
+XCOMM   *** BEGIN CDE DT CONFIG SECTION ***
+
+XCOMM COMMON DESKTOP ENVIRONMENT
+XCOMM if your system has libDtSvc, remove the 'XCOMM  ' from the next line
+XCOMM  #define DtSaverLibrary
+
+#ifdef DtSaverLibrary
+DTSAVERDEF = -DUSE_DTSAVER
+DTSAVERINC = -I/usr/dt/include
+DTSAVERLIB = -L/usr/dt/lib -lDtSvc
+#endif
+
+XCOMM   *** END CDE DT CONFIG SECTION ***
+
+XCOMM   *** BEGIN DPMS CONFIG SECTION ***
+
+XCOMM DISPLAY POWER MANAGEMENT SIGNALING
+XCOMM if your system has libXdpms, remove the 'XCOMM  ' from the next line
+XCOMM  #define DPMSLibrary
+
+#ifdef DPMSLibrary
+DTSAVERDEF = -DUSE_DPMS
+XCOMM DPMSINC =
+DPMSLIB = -lXdpms
+#endif
+
+XCOMM   *** END DPMS CONFIG SECTION ***
+
+XCOMM   *** BEGIN SOUND CONFIG SECTION ***
+
+XCOMM Only xlock.c and resource.c use this
+XCOMM if your system has these sound libraries, remove the 'XCOMM  '
+XCOMM  #define RplayLibrary
+XCOMM  #define NasLibrary
+
+#ifdef RplayLibrary
+SOUNDDEF = -DUSE_RPLAY
+SOUNDINC = -I/usr/local/include
+XCOMM SOUNDLIB = -L/share/lib -lrplay
+SOUNDLIB = -L/usr/local/lib -lrplay
+#endif
+
+#ifdef NasLibrary
+SOUNDDEF = -DUSE_NAS
+SOUNDINC = -I/usr/X11R6/include
+SOUNDLIB = -L/usr/X11R6/lib -laudio
+#endif
+
+XCOMM system play (optional software)
+XCOMM SUNOS 4.1.3
+XCOMM  DEF_PLAY = "/usr/demo/SOUND/play /usr/local/share/sounds/xlock/"
+XCOMM IRIX 5.3
+XCOMM  DEF_PLAY = "/usr/sbin/sfplay /usr/local/share/sounds/xlock/"
+XCOMM Digital Unix with Multimedia Services installed:
+XCOMM  DEF_PLAY = "/usr/bin/mme/decsound -play /usr/local/share/sounds/xlock/"
+XCOMM LINUX and others (see config directory)
+XCOMM  DEF_PLAY = "/usr/local/bin/play.sh /usr/local/share/sounds/xlock/"
+XCOMM Uncomment line below if you have one of the above
+XCOMM  SOUNDDEF = -DDEF_PLAY=\"$(DEF_PLAY)\"
+
+XCOMM      *** END SOUND CONFIG SECTION ***
+
+XCOMM      *** BEGIN RNG CONFIG SECTION ***
+
+XCOMM Uncomment to use your system's Random Number Generator
+XCOMM They usually come in 3 types
+
+XCOMM Uncomment to use high-precision (but expensive) RNG
+XCOMM  SRANDDEF = -DSRAND=srand48
+XCOMM  LRANDDEF = -DLRAND=lrand48
+
+XCOMM  SRANDDEF = -DSRAND=srandom
+XCOMM  LRANDDEF = -DLRAND=random
+
+XCOMM Least desirable RNG
+XCOMM  SRANDDEF = -DSRAND=srand
+XCOMM  LRANDDEF = -DLRAND=rand
+
+XCOMM Normally use the above with (default)
+XCOMM  MAXRANDDEF = -DMAXRAND=2147483648.0
+XCOMM Use the following if using srand/rand and NOT AIXV3
+XCOMM  MAXRANDDEF = -DMAXRAND=32767.0
+RANDDEF = $(SRANDDEF) $(LRANDDEF) $(MAXRANDDEF)
+
+XCOMM      *** END RNG CONFIG SECTION ***
+
+XCOMM    *** BEGIN MODULES CONFIG SECTION **
+
+XCOMM This is a HIGHLY experimental section.
+XCOMM To use modules, you must have an ELF setup installed, and
+XCOMM libdl.  This was originally written for Linux.
+XCOMM /usr/include/dlfcn.h is not present on all Linux machines.
+XCOMM Also tried to get this running on XCOMM Solaris-2.6 with gcc and gmake.
+XCOMM Do not know if other Unixes support this kind of dynamic loading.
+XCOMM Un-commenting Modules will compile xlock so that all of the modes
+XCOMM are in separate modules which are loaded at runtime.  This means
+XCOMM you can add new modes simply by putting them in your modules
+XCOMM directory.
+XCOMM  #define Modules
+
+#ifdef Modules
+
+XCOMM #define UseElfFormat YES
+
+XCOMM This is the default directory to look in for modules. It can be
+XCOMM a colon separated list of directories.
+DEF_MODULEPATH = $(USRLIBDIR)/X11/xlock_modules
+
+#ifdef LinuxArchitecture
+XCOMM Flag to compile the main program so that global variables will be
+XCOMM available to modules (gives errors on Sun).
+MODULEFLAGS = -rdynamic
+#endif
+
+MODULEDEF = -DDEF_MODULEPATH=\"$(DEF_MODULEPATH)\" -DUSE_MODULES
+
+XCOMM Library necessary to use dynamic loading
+MODULELIB = -ldl
+
+#endif
+
+XCOMM    *** END MODULES CONFIG SECTION ***
+
+XCOMM      *** BEGIN DEBUG CHECK SECTION ***
+
+XCOMM #define Check
+
+#ifdef Check
+XCOMM Very experimental
+CHECKDEF = -DDEBUG
+#endif
+
+XCOMM      *** END DEBUG CHECK SECTION ***
+
+XCOMM      *** BEGIN INTERACTIVE CHECK SECTION ***
+
+#define DisableInteractive
+
+#ifdef DisableInteractive
+XCOMM Can disable interactive modes for production environments
+INTERACTIVEDEF = -DDISABLE_INTERACTIVE
+#endif
+
+XCOMM      *** BEGIN UNSTABLE CHECK SECTION ***
+
+XCOMM #define Unstable
+
+#ifdef Unstable
+XCOMM Experimental modes
+UNSTABLEDEF = -DUSE_UNSTABLE
+#endif
+
+XCOMM      *** END DEBUG CHECK SECTION ***
+
+#ifndef __QNX__
+#ifndef MathLibrary
+#define MathLibrary -lm
+#endif
+#else
+#define MathLibrary
+PASSWDDEF = -DHAVE_SHADOW -Dlinux
+PASSWDLIB = -l/src/util/Lib/util
+#endif
+
+XCOMM KERBEROS Ver. 4
+XCOMM  PASSWDDEF = -DHAVE_KRB4
+XCOMM  PASSWDINC = -I/usr/athena/include
+XCOMM  PASSWDLIB = -L/usr/athena/lib -lkrb -ldes -lresolv
+XCOMM
+XCOMM KERBEROS Ver. 5
+XCOMM  PASSWDDEF = -DHAVE_KRB5
+XCOMM  PASSWDINC = -I/opt/krb5/include
+XCOMM  PASSWDLIB = -L/opt/krb5/lib -lkrb5 -lcrypto -lcom_err
+
+XCOMM DCE authentication (tested only on HP's)
+XCOMM  PASSWDDEF = -DDCE_PASSWD
+XCOMM  PASSWDINC = -I/usr/include/reentrant
+XCOMM  PASSWDLIB = -ldce -lc_r
+
+XCOMM PAM (tested only on Linux)
+XCOMM  PASSWDDEF = -DUSE_PAM
+XCOMM  PASSWDLIB = -lpam -ldl
+
+#ifdef SVR4ix86Architecture
+PASSWDDEF = -DHAVE_SHADOW
+#endif
+
+#ifdef SunArchitecture
+#if SystemV4
+#if OSMajorVersion == 2 && OSMinorVersion < 5
+SYSTEMDEF = -DLESS_THAN_SOLARIS2_5 -DSOLARIS2
+SLEEPDEF = -DHAVE_NANOSLEEP
+#else
+SYSTEMDEF = -DSOLARIS2
+SLEEPDEF = -DHAVE_USLEEP
+#endif
+XCOMM imake is usually not set up right here.
+XCOMM Assume shadowing... usually more correct.
+XCOMM  #if HasShadowPasswd
+XCOMM  PASSWDDEF = -DHAVE_SHADOW
+XCOMM  #endif
+PASSWDDEF = -DHAVE_SHADOW
+
+XCOMM Problems finding libXext.so.0 when sticky bit is set
+EXTRA_LDOPTIONS = -R/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib
+
+#if OSMajorVersion == 2 && OSMinorVersion < 7
+PIXMAPTYPE = sol
+#else
+PIXMAPTYPE = solaris
+#endif
+#else
+SYSTEMDEF = -DSUNOS4 -DUSE_MATHERR
+SLEEPDEF = -DHAVE_USLEEP
+#if HasShadowPasswd
+XCOMM  PASSWDDEF = -DSUNOS_ADJUNCT_PASSWD
+PASSWDDEF = -DHAVE_SHADOW
+#endif
+PIXMAPTYPE = sun
+#endif
+BITMAPTYPE = sun
+#else
+#if HasShadowPasswd
+PASSWDDEF = -DHAVE_SHADOW
+XCOMM  PASSWDLIB = -lshadow
+#endif
+#if defined(HPArchitecture) || defined(ApolloArchitecture)
+#ifdef HPArchitecture
+XCOMM If your site is using Secured Passwords,
+XCOMM  PASSWDDEF = -DHPUX_SECURE_PASSWD
+XCOMM If your site is using Passwd Etc,
+XCOMM  PASSWDDEF = -DHP_PASSWDETC
+XCOMM  PASSWDLIB = -lrgy -lnck -lndbm
+XCOMM  PASSWDLIB = -lrgy -lnck -lndbm -lsec
+CCOPTIONS = -Aa
+SYSTEMDEF = -D_HPUX_SOURCE -DSYSV -DUSE_MATHERR
+#else
+SLEEPDEF = -DHAVE_USLEEP
+#endif
+EXTRA_LIBRARIES = -lXhp11
+BITMAPTYPE = hp
+PIXMAPTYPE = hp
+#else
+#ifdef i386SVR4Architecture
+EXTRA_LIBRARIES = -lsocket -lnsl -lgen
+PASSWDDEF = -DHAVE_SHADOW
+BITMAPTYPE = x11
+PIXMAPTYPE = x11
+#else
+#if defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || defined(i386BsdArchitecture)
+SLEEPDEF = -DHAVE_USLEEP
+BITMAPTYPE = bsd
+PIXMAPTYPE = bsd
+INSTPGMFLAGS = -s -o root -m 4111
+#else
+#ifdef LinuxArchitecture
+SLEEPDEF = -DHAVE_USLEEP
+BITMAPTYPE = linux
+PIXMAPTYPE = linux
+#if HasShadowPasswd && !UseElfFormat
+EXTRA_LIBRARIES = -lgdbm
+#endif
+#else
+#ifdef SGIArchitecture
+BITMAPTYPE = sgi
+PIXMAPTYPE = sgi
+#else
+#ifdef AIXArchitecture
+BITMAPTYPE = ibm
+PIXMAPTYPE = ibm
+XCOMM If AIX 3.1 or less, do not have struct passwd and other things
+#if OSMajorVersion < 3 || (OSMajorVersion == 3 && OSMinorVersion < 2)
+SYSTEMDEF = -DLESS_THAN_AIX3_2
+#endif
+XCOMM Use this if your site is using AFS:
+XCOMM  PASSWDDEF = -DAFS
+XCOMM  Solaris 2.x may need the next line
+XCOMM  PASSWDDEF += -DSHADOW
+XCOMM  PASSWDINC = -I/usr/afsws/include
+XCOMM  PASSWDLIB = -L/usr/afsws/lib -L/usr/afsws/lib/afs -L/usr/afsws/domestic/lib -lkauth -lubik -lprot -lrxkad -lrx -llwp -lauth -lsys -ldes -lcmd -lcom_err /usr/afsws/lib/afs/util.a
+XCOMM  SunOS 4.1.x may need the next line
+XCOMM  PASSWDLIB += /usr/afsws/domestic/lib/librxkad.a
+XCOMM  Solaris 2.x may need the next line
+XCOMM  PASSWDLIB += /usr/afsws/domestic/lib/librxkad.a usr/lib/libsocket.so.1 /usr/lib/libnsl.so.1 /usr/ucblib/libucb.a
+XCOMM You may need this one too.
+XCOMM  EXTRA_LIBRARIES = -laudit
+
+#else
+#ifdef UltrixArchitecture
+BITMAPTYPE = dec
+PIXMAPTYPE = dec
+EXTRA_LIBRARIES = -lauth
+XCOMM Use this if your site is using SIA:
+XCOMM  PASSWDDEF = -DSIA
+XCOMM  PASSWDLIB = -lsecurity 
+#else
+
+#ifdef SCOArchitecture
+PASSWDDEF = -DHAVE_SHADOW -DSVR4
+BITMAPTYPE = sco
+PIXMAPTYPE = sco
+#else
+BITMAPTYPE = x11
+PIXMAPTYPE = x11
+
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+
+XLOCKINC = -I$(top_srcdir) -I. -I$(UTILSDIR)
+
+XCOMM -DUSE_VROOT              Allows xlock to run in root window (some
+XCOMM                          window managers have problems)
+XCOMM -DALWAYS_ALLOW_ROOT      Users can not turn off allowroot
+XCOMM -DUSE_SYSLOG             Paranoid administrator option (a check is also
+XCOMM                          done to see if you have it)
+XCOMM -DUSE_MULTIPLE_USER      Multiple users ... security?
+XCOMM -DUSE_MULTIPLE_ROOT      Multiple root users ... security?
+XCOMM -DUSE_WINDOW_VISIBILITY  Allow a window to be placed over xlock
+XCOMM -DUSE_OLD_EVENT_LOOP     Some machines may still need this (fd_set
+XCOMM                          errors may be a sign)
+XCOMM -DUSE_VMSUTILS           This patches up old __VMS_VER < 70000000
+XCOMM -DUSE_DPMS               DPMS stuff
+XCOMM
+XCOMM For personal use you may want to consider:
+XCOMM -DUSE_XLOCKRC            paranoid admin or unknown shadow passwd alg
+XCOMM
+XCOMM For labs you may want to consider:
+XCOMM -DUSE_AUTO_LOGOUT=240     Enable auto-logout and set deadline (minutes)
+XCOMM -DDEF_AUTO_LOGOUT=\"120\" Set default auto-logout deadline (minutes)
+XCOMM -DUSE_BUTTON_LOGOUT=10    Enable logout button and set appear time (min)
+XCOMM -DDEF_BUTTON_LOGOUT=\"5\" Set default logout button (minutes)
+XCOMM -DUSE_BOMB                Enable automatic logout mode (does not come up
+XCOMM                           in random mode)
+XCOMM -DDISABLE_INTERACTIVE     Disable interactive modes (useful for production
+XCOMM                           enviroments)
+XCOMM -DUSE_UNSTABLE            Enable unstable (alpha) modes
+XCOMM -DCLOSEDOWN_LOGOUT        Use with USE_AUTO_LOGOUT, USE_BUTTON_LOGOUT,
+XCOMM                           USE_BOMB if using xdm
+XCOMM -DSESSION_LOGOUT          Alternate of above
+XCOMM -DSTAFF_FILE=\"/etc/xlock.staff\"  File of staff who are exempt
+XCOMM -DSTAFF_NETGROUP=\"/etc/xlock.netgroup\"  Netgroup that is exempt
+
+XCOMM May have to combine in one long line if "+=" does not work
+OPTDEF = -DUSE_VROOT -DALWAYS_ALLOW_ROOT -DUSE_BOMB
+XCOMM  OPTDEF += -DDISABLE_INTERACTIVE
+XCOMM  OPTDEF += -DUSE_UNSTABLE
+XCOMM  OPTDEF += -DUSE_SYSLOG -DSYSLOG_FACILITY=LOG_AUTH
+XCOMM  OPTDEF += -DSYSLOG_WARNING=LOG_WARNING
+XCOMM  OPTDEF += -DSYSLOG_NOTICE=LOG_NOTICE -DSYSLOG_INFO=LOG_INFO
+XCOMM  OPTDEF += -DUSE_MULTIPLE_USER
+XCOMM  OPTDEF += -DUSE_MULTIPLE_ROOT
+XCOMM  OPTDEF += -DUSE_OLD_EVENT_LOOP
+XCOMM  OPTDEF += -DUSE_XLOCKRC
+XCOMM  OPTDEF += -DUSE_AUTO_LOGOUT=240
+XCOMM  OPTDEF += -DDEF_AUTO_LOGOUT=\"120\"
+XCOMM  OPTDEF += -DUSE_BUTTON_LOGOUT=10
+XCOMM  OPTDEF += -DDEF_BUTTON_LOGOUT=\"5\"
+XCOMM  OPTDEF += -DCLOSEDOWN_LOGOUT
+XCOMM  OPTDEF += -DSESSION_LOGOUT
+XCOMM  OPTDEF += -DSTAFF_FILE=\"/etc/xlock.staff\"
+XCOMM  OPTDEF += -DSTAFF_NETGROUP=\"/etc/xlock.netgroup\"
+
+DEFINES = -DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\" \
+$(SYSTEMDEF) $(EDITRESDEF) $(SLEEPDEF) $(OPTDEF) $(RANDDEF) \
+$(MODULEDEF) $(CHECKDEF) $(INTERACTIVEDEF) $(UNSTABLEDEF) $(PASSWDDEF) \
+$(XMINC) $(XAWINC) $(CPPDEF) $(XPMDEF) $(GLDEF) $(DTSAVERDEF) $(DPMSDEF) \
+$(SOUNDDEF) $(PASSWDINC) $(XPMINC) $(GLINC) $(DTSAVERINC) $(DPMSINC) \
+$(SOUNDINC) $(XLOCKINC)
+
+DEPLIBS = $(DEPXLIB)
+#if SGIArchitecture
+FIRSTLIB = -L/usr/lib32
+#endif
+LOCAL_LIBRARIES = $(FIRSTLIB) $(MODULELIB) $(XLIB) \
+$(XPMLIB) $(GLLIB) $(TTFLIB) $(GLTTLIB) $(DTSAVERLIB) $(DPMSLIB) $(SOUNDLIB)
+MLIBS = $(FIRSTLIB) $(XPMLIB) $(XMLIB) $(EDITRESLIB) -lXt \
+$(XLIB) $(SMLIB) $(ICELIB)
+LINTLIBS = $(LINTXLIB)
+#if HasLibCrypt
+       CRYPTLIB = -lcrypt
+#endif
+SYS_LIBRARIES = $(CRYPTLIB) $(PASSWDLIB) MathLibrary
+
+VER = xlockmore
+DISTVER = xlockmore-4.13
diff --git a/install-sh b/install-sh
new file mode 100755 (executable)
index 0000000..058b26c
--- /dev/null
@@ -0,0 +1,250 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# 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 M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+       -c) instcmd="$cpprog"
+           shift
+           continue;;
+
+       -d) dir_arg=true
+           shift
+           continue;;
+
+       -m) chmodcmd="$chmodprog $2"
+           shift
+           shift
+           continue;;
+
+       -o) chowncmd="$chownprog $2"
+           shift
+           shift
+           continue;;
+
+       -g) chgrpcmd="$chgrpprog $2"
+           shift
+           shift
+           continue;;
+
+       -s) stripcmd="$stripprog"
+           shift
+           continue;;
+
+       -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+           shift
+           continue;;
+
+       -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+           shift
+           continue;;
+
+       *)  if [ x"$src" = x ]
+           then
+               src=$1
+           else
+               # this colon is to work around a 386BSD /bin/sh bug
+               :
+               dst=$1
+           fi
+           shift
+           continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+       echo "install:  no input file specified"
+       exit 1
+else
+       true
+fi
+
+if [ x"$dir_arg" != x ]; then
+       dst=$src
+       src=""
+
+       if [ -d $dst ]; then
+               instcmd=:
+       else
+               instcmd=mkdir
+       fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+       if [ -f $src -o -d $src ]
+       then
+               true
+       else
+               echo "install:  $src does not exist"
+               exit 1
+       fi
+
+       if [ x"$dst" = x ]
+       then
+               echo "install:  no destination specified"
+               exit 1
+       else
+               true
+       fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+       if [ -d $dst ]
+       then
+               dst="$dst"/`basename $src`
+       else
+               true
+       fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+       pathcomp="${pathcomp}${1}"
+       shift
+
+       if [ ! -d "${pathcomp}" ] ;
+        then
+               $mkdirprog "${pathcomp}"
+       else
+               true
+       fi
+
+       pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+       $doit $instcmd $dst &&
+
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+       if [ x"$transformarg" = x ]
+       then
+               dstfile=`basename $dst`
+       else
+               dstfile=`basename $dst $transformbasename |
+                       sed $transformarg`$transformbasename
+       fi
+
+# don't allow the sed command to completely eliminate the filename
+
+       if [ x"$dstfile" = x ]
+       then
+               dstfile=`basename $dst`
+       else
+               true
+       fi
+
+# Make a temp file name in the proper directory.
+
+       dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+       $doit $instcmd $src $dsttmp &&
+
+       trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+       $doit $rmcmd -f $dstdir/$dstfile &&
+       $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/language.ja.tcl b/language.ja.tcl
new file mode 100755 (executable)
index 0000000..1ff7277
--- /dev/null
@@ -0,0 +1,80 @@
+# -*-tcl-*-
+#
+# Japanese language file for gettext.tcl
+#
+# By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
+
+# $Id: language.ja.tcl,v 1.3 2000/07/31 03:36:52 elca Exp $
+
+settext "Wizard configure" "configure ¥¦¥£¥¶¡¼¥É"
+settext "Font Options" "¥Õ¥©¥ó¥È ¥ª¥×¥·¥ç¥ó"
+
+#settext "OK"        "OK"
+settext "Configure" "Configure ¼Â¹Ô"
+settext "Abort"     "Ãæ»ß"
+
+settext "Make"         "make ¤ò¼Â¹Ô"
+settext "Make Install" "make install ¤ò¼Â¹Ô"
+settext "Exit"         "½ªÎ»"
+settext "Go back"      "Ìá¤ë"
+
+settext "Do you really want to launch configure?" "configure ¤ò¼Â¹Ô¤·¤Æ¤è¤í¤·¤¤¤Ç¤¹¤«?"
+settext "Launch Configure" "configure ¼Â¹Ô"
+
+settext -Adobe-Courier-Bold-R-Normal-*-140-* -*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*
+
+settext "File"  "¥Õ¥¡¥¤¥ëÁªÂò"
+settext "Color" "¿§ÁªÂò"
+settext "Font"  "¥Õ¥©¥ó¥ÈÁªÂò"
+
+#settext "ABCDEFGHIJKabedfghijkmnopq12345" "ABCDEFGHIJKabedfghijkmnopq12345"
+
+settext "wizard configure xlockmore" "xlockmore configure ¥¦¥£¥¶¡¼¥É"
+settext "This should help you to build xlockmore" "¤³¤Î¥¦¥£¥¶¡¼¥É¤Ç xlockmore ¤Î¹½ÃÛ¤¬´Êñ¤Ë½ÐÍè¤Þ¤¹"
+
+settext "without gcc    " "gcc     ¤ò»È¤ï¤Ê¤¤"
+settext "with-purify    " "purify  ¤ò»È¤¦    "
+settext "without motif  " "Motif   ¤ò»È¤ï¤Ê¤¤"
+settext "without editres" "editres ¤ò»È¤ï¤Ê¤¤"
+settext "without xpm    " "Xpm     ¤ò»È¤ï¤Ê¤¤"
+settext "without opengl " "OpenGL  ¤ò»È¤ï¤Ê¤¤"
+settext "without mesagl " "MesaGL  ¤ò»È¤ï¤Ê¤¤"
+settext "without dtsaver" "dtsaver ¤ò»È¤ï¤Ê¤¤"
+settext "without dpms   " "dpms    ¤ò»È¤ï¤Ê¤¤"
+
+settext "Wizard configure image path" "²èÁü¤Î¥Ñ¥¹ÀßÄê"
+settext "please enter the image path" "²èÁü¤Î¾ì½ê¤òÆþÎϤ·¤Æ²¼¤µ¤¤"
+
+settext "Bitmap dir"                  "¥Ó¥Ã¥È¥Þ¥Ã¥×¤Î¥Ç¥£¥ì¥¯¥È¥ê"
+settext "Pixmaps dir"                 "¥Ô¥¯¥¹¥Þ¥Ã¥×¤Î¥Ç¥£¥ì¥¯¥È¥ê"
+settext "sound player program"        "²»À¼ºÆÀ¸ÍÑ¤Î¥×¥í¥°¥é¥à̾  "
+settext "enable syslog logging      " "syslog ¤Ç¥í¥°¤ò¼è¤ë                  "
+settext "enable multiple users      " "Ê£¿ô¿Í¤ÎƱ»þ¥í¥Ã¥¯¤òµö²Ä             "
+settext "enable multiple root users " "root ¤â´Þ¤á¤ÆÊ£¿ô¿Í¤ÎƱ»þ¥í¥Ã¥¯¤òµö²Ä"
+settext "enable unstable            " "³«È¯Ãæ¤Î¥â¡¼¥É¤â»È¤¦                 "
+
+settext "Wizard configure include and library path" "¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤È¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥¹ÀßÄê"
+settext "Please enter the path" "¥Ñ¥¹Ì¾¤òÆþÎϤ·¤Æ²¼¤µ¤¤"
+
+settext "path of X include          " "X ¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¥Ñ¥¹      "
+settext "path of X library          " "X ¤Î¥é¥¤¥Ö¥é¥ê¥Ñ¥¹                "
+settext "user executables in        " "¥æ¡¼¥¶ÍÑ¥×¥í¥°¥é¥à¥¤¥ó¥¹¥È¡¼¥ë°ÌÃÖ"
+settext "system admin executables in" "´ÉÍý¼ÔÍÑ¥×¥í¥°¥é¥à¥¤¥ó¥¹¥È¡¼¥ë°ÌÃÖ"
+settext "program executables in     " "Êä½õ¥×¥í¥°¥é¥à¥¤¥ó¥¹¥È¡¼¥ë°ÌÃÖ    "
+settext "info documentation in      " "Info ¥É¥­¥å¥á¥ó¥È¥¤¥ó¥¹¥È¡¼¥ë°ÌÃÖ "
+settext "man documentation in       " "¥Þ¥Ë¥å¥¢¥ë¥¤¥ó¥¹¥È¡¼¥ë°ÌÃÖ        "
+settext "find the sources in        " "¥½¡¼¥¹¥³¡¼¥É¸ºß°ÌÃÖ              "
+
+settext "Wizard configure language" "¸À¸ì»ØÄê"
+settext "Please choice your language " "»ÈÍѤ·¤¿¤¤¸À¸ì¤òÁª¤ó¤Ç²¼¤µ¤¤"
+
+settext "Dutch   " "¥ª¥é¥ó¥À¸ì"
+settext "English " "±Ñ¸ì      "
+settext "French  " "Ê©¸ì      "
+settext "German  " "ÆÈ¸ì      "
+settext "Japanese" "ÆüËܸ젠  "
+
+settext "< Previous" "¢« Á°¹àÌÜ"
+settext "Next >"     "¼¡¹àÌÜ ¢ª"
+
+# end
diff --git a/language.tcl.tmpl b/language.tcl.tmpl
new file mode 100644 (file)
index 0000000..e46db1e
--- /dev/null
@@ -0,0 +1,80 @@
+# -*-tcl-*-
+#
+# Template file for gettext.tcl
+#
+# By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
+
+# $Id: language.tcl.tmpl,v 1.2 2000/07/31 03:36:10 elca Exp $
+
+#settext "Wizard configure" "Wizard configure"
+#settext "Font Options""Font Options"
+
+#settext "OK"        "OK"
+#settext "Configure" "Configure"
+#settext "Abort"     "Abort"
+
+#settext "Make"         "Make"
+#settext "Make Install" "Make Install"
+#settext "Exit"         "Exit"
+#settext "Go back"      "Go back"
+
+#settext "Do you really want to launch configure?" "Do you really want to launch configure?"
+#settext "Launch Configure" "Launch Configure"
+
+#settext -Adobe-Courier-Bold-R-Normal-*-140-* -Adobe-Courier-Bold-R-Normal-*-140-*
+
+#settext "File"  "File"
+#settext "Color" "Color"
+#settext "Font"  "Font"
+
+#settext "ABCDEFGHIJKabedfghijkmnopq12345" "ABCDEFGHIJKabedfghijkmnopq12345"
+
+#settext "wizard configure xlockmore" "wizard configure xlockmore"
+#settext "This should help you to build xlockmore" "This should help you to build xlockmore"
+
+#settext "without gcc    " "without gcc    "
+#settext "with-purify    " "with-purify    "
+#settext "without motif  " "without motif  "
+#settext "without editres" "without editres"
+#settext "without xpm    " "without xpm    "
+#settext "without opengl " "without opengl "
+#settext "without mesagl " "without mesagl "
+#settext "without dtsaver" "without dtsaver"
+#settext "without dpms   " "without dpms   "
+
+#settext "Wizard configure image path" "Wizard configure image path"
+#settext "please enter the image path" "please enter the image path"
+
+#settext "Bitmap dir" "Bitmap dir"
+#settext "Pixmaps dir" "Pixmaps dir"
+#settext "sound player program" "sound player program"
+#settext "enable syslog logging      " "enable syslog logging      "
+#settext "enable multiple users      " "enable multiple users      "
+#settext "enable multiple root users " "enable multiple root users "
+#settext "enable unstable            " "enable unstable            "
+
+#settext "Wizard configure include and library path" "Wizard configure include and library path"
+#settext "Please enter the path" "Please enter the path"
+
+#settext "path of X include          " "path of X include          "
+#settext "path of X library          " "path of X library          "
+#settext "user executables in        " "user executables in        "
+#settext "system admin executables in" "system admin executables in"
+#settext "program executables in     " "program executables in     "
+#settext "info documentation in      " "info documentation in      "
+#settext "man documentation in       " "man documentation in       "
+#settext "find the sources in        " "find the sources in        "
+
+#settext "Wizard configure language" "Wizard configure language"
+#settext "Please choice your language " "Please choice your language "
+
+#settext "Dutch   " "Dutch   "
+#settext "English " "English "
+#settext "French  " "French  "
+#settext "German  " "German  "
+#settext "Japanese" "Japanese"
+
+#settext "< Previous" "< Previous"
+#settext "Next >"     "Next >"
+
+# end
diff --git a/make.com b/make.com
new file mode 100644 (file)
index 0000000..68df1dd
--- /dev/null
+++ b/make.com
@@ -0,0 +1,596 @@
+$ save_verify='f$verify(0)
+$! set ver
+$!
+$!      VMS compile and link for xlockmore
+$!
+$! USAGE:
+$! @make [debug clobber clean]
+$!       debug : compile with degugger switch
+$!       clean : clean all except executable
+$!       clobber : clean all
+$!
+$! If you have
+$!              XPM library
+$!              XVMSUTILS library (VMS6.2 or lower)
+$!              Mesa GL library
+$! insert the correct directory instead of X11 or GL:
+$ xvmsutilsf="X11:XVMSUTILS.OLB"
+$ xpmf="SYS$LIBRARY:LIBXPM.OLB"
+$ glf="GL:LIBMESAGL.OLB"
+$ glf_share="GL:LIBMESAGL.EXE"
+$ gluf="GL:LIBMESAGLU.OLB"
+$ gluf_share="GL:LIBMESAGLU.EXE"
+$ ttff="SYS$LIBRARY:LIBTTF.OLB"
+$ glttf="SYS$LIBRARY:LIBGLTT.OLB"
+$ mmovf="SYS$LIBRARY:MMOV.OLB"
+$ magickf="SYS$LIBRARY:MAGICKSHR.OLB"
+$!
+$! Default for some commands
+$ xl_link=="link"
+$ xl_cc=="cc/name=(as_is,short)"
+$ xl_cxx=="cxx/name=(as_is,short)/assume=(nostdnew,noglobal_array_new"
+$!
+$! Assume C.
+$ deccxx=0
+$! Assume C++ (but may not link on VMS6.2 or lower)
+$! deccxx=1
+$! test on C++.
+$! deccxx=f$search("SYS$SYSTEM:CXX$COMPILER.EXE") .nes. ""
+$!
+$! Already assumes DEC C on Alpha.
+$! Assume VAX C on VAX.
+$! decc=0
+$! Assume DEC C on VAX.
+$! decc=1
+$! test on DEC C.
+$ decc=f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. ""
+$!
+$! if vroot<>0 the use of the root window is enabled
+$ vroot=1
+$! vroot=0
+$!
+$! if bomb<>0 the use bomb mode is included (does not come up in random mode)
+$ bomb=1
+$! bomb=0
+$!
+$! if disable_interactive<>0 then interactive modes are disabled (useful for
+$! production environments)
+$ disable_interactive=0
+$! disable_interactive=1
+$!
+$! if unstable<>0 some of these mode(s) included could be a little buggy
+$! unstable=0
+$ unstable=1
+$!
+$! if sound<>0 sound capability is included (only available on Alpha)
+$! from vms_amd.c and vms_amd.h
+$ sound=1
+$! sound=0
+$!
+$! Memory Check stuff.  Very experimental!
+$ check=0
+$! check=1
+$
+$! Compliant colour map if <>1
+$ complmap=0
+$! complmap=1
+$!
+$!
+$! NOTHING SHOULD BE MODIFIED BELOW
+$!
+$ if p1 .eqs. "CLEAN" then goto Clean
+$ if p1 .eqs. "CLOBBER" then goto Clobber
+$!
+$ defs=="VMS"
+$ dtsaver=f$search("SYS$LIBRARY:CDE$LIBDTSVC.EXE") .nes. ""
+$ xpm=f$search("''xpmf'") .nes. ""
+$ gl=f$search("''glf'") .nes. ""
+$ gl_share=f$search("''glf_share'") .nes. ""
+$ glu=f$search("''gluf'") .nes. ""
+$ glu_share=f$search("''gluf_share'") .nes. ""
+$ gltt=f$search("''glttf'") .nes. ""
+$ ttf=f$search("''ttff'") .nes. ""
+$ mmov=f$search("''mmovf'") .nes. ""
+$ use_magick=f$search("''magickf'") .nes. ""
+$ iscxx=f$search("SYS$SYSTEM:CXX$COMPILER.EXE") .nes. ""
+$ axp=f$getsyi("HW_MODEL") .ge. 1024
+$ sys_ver=f$edit(f$getsyi("version"),"compress")
+$ if f$extract(0,1,sys_ver) .nes. "V"
+$ then
+$   type sys$input
+This script will assume that the operating system version is at least V7.0.
+$!
+$   sys_ver="V7.0"
+$ endif
+$ sys_maj=0+f$extract(1,1,sys_ver)
+$ if sys_maj .lt. 7
+$ then
+$   xvmsutils=f$search("''xvmsutilsf'") .nes. ""
+$ endif
+$!
+$! Create .opt file
+$ close/nolog optf
+$ open/write optf xlock.opt
+$!
+$ if iscxx then defs=="''defs',HAVE_CXX"
+$ if ttf then defs=="''defs',HAVE_TTF"
+$ if gltt then defs=="''defs',HAVE_GLTT"
+$ if use_magick then defs=="''defs',USE_MAGICK"
+$ if iscxx .and. ttf .and. gltt then defs=="''defs',USE_TEXT"
+$ if complmap then defs=="''defs',COMPLIANT_COLORMAP"
+$ if xpm then defs=="''defs',USE_XPM"
+$ if gl .or. gl_share then defs=="''defs',USE_GL,HAVE_GLBINDTEXTURE"
+$ if dtsaver then defs=="''defs',USE_DTSAVER"
+$ if mmov .and. sound
+$ then
+$   defs=="''defs',HAS_MMOV"
+$   if f$search("MMOV.DIR") .eqs. ""
+$   then
+$     create/dir [.mmov]
+$     set def [.mmov]
+$     copy SYS$COMMON:[SYSHLP.EXAMPLES.MMOV.COMMON]*.* []
+$! spawn included to avoid unwanted redefinition of logicals
+$     spawn @build_common
+$     copy SYS$COMMON:[SYSHLP.EXAMPLES.MMOV.VIDEO]readavi.c []
+$     spaw @[-]mmov
+$     set def [-]
+$     endif
+$   endif
+$ if axp .and. sound then defs=="''defs',USE_VMSPLAY"
+$ if sys_maj .lt. 7
+$ then
+$   if xvmsutils then defs=="''defs',USE_XVMSUTILS"
+$ endif
+$ if vroot then defs=="''defs',USE_VROOT"
+$ if bomb then defs=="''defs',USE_BOMB"
+$ if disable_interactive then defs=="''defs',DISABLE_INTERACTIVE"
+$ if unstable then defs=="''defs',USE_UNSTABLE"
+$ if check then defs=="''defs',DEBUG"
+$! The next must be the last one.
+$ if sys_maj .ge. 7
+$ then
+$   defs=="''defs',HAVE_USLEEP"
+$   defs=="''defs',SRAND=""""srand48"""",LRAND=""""lrand48"""",MAXRAND=2147483648.0"
+$ endif
+$!
+$! Establish the Compiling Environment
+$!
+$! Set compiler command
+$! Put in /include=[] for local include file like a pwd.h ...
+$!   not normally required.
+$     xl_cxx=="cxx/name=(as_is,short)/assume=(nostdnew,noglobal_array_new)/include=([],[.xlock])/define=(''defs')"
+$ if deccxx
+$ then
+$   xl_cc=="cxx/name=(as_is,short)/assume=(nostdnew,noglobal_array_new)/include=([],[.xlock])/define=(''defs')"
+$ else
+$   if axp
+$   then
+$     xl_cc=="cc/name=(as_is,short)/include=([],[.xlock])/define=(''defs')"
+$   else
+$     if decc
+$     then
+$!       xl_cc=="cc/decc/standard=vaxc/include=([],[.xlock])/define=(''defs')"
+$       xl_cc=="cc/decc/include=([],[.xlock])/define=(''defs')"
+$     else ! VAX C
+$       xl_cc=="cc/include=([],[.xlock])/define=(''defs')"
+$     endif
+$   endif
+$ endif
+$ if p1 .eqs. "DEBUG" .or. p2 .eqs. "DEBUG" .or. p3 .eqs. "DEBUG"
+$ then
+$   if deccxx
+$   then
+$     xl_cc=="cxx/name=(as_is,short)/assume=(nostdnew,noglobal_array_new)/deb/noopt/include=([],[.xlock])/define=(''defs')/list"
+$   else
+$     if axp
+$     then
+$       xl_cc=="cc/name=(as_is,short)/deb/noopt/include=([],[.xlock])/define=(''defs')/list"
+$     else
+$       if decc
+$       then
+$!         xl_cc=="cc/deb/noopt/decc/standard=vaxc/include=([],[.xlock])/define=(''defs')/list"
+$         xl_cc=="cc/deb/noopt/decc/include=([],[.xlock])/define=(''defs')/list"
+$       else ! VAX C
+$         xl_cc=="cc/deb/noopt/include=([],[.xlock])/define=(''defs')/list"
+$       endif
+$     endif
+$   endif
+$   if iscxx
+$   then
+$     xl_link=="cxxlink/deb"
+$   else
+$     xl_link=="link/deb"
+$   endif
+$ else
+$   if iscxx then xl_link=="cxxlink/notrace"
+$ endif
+$!
+$ if axp .or. .not. decc
+$ then
+$   define/nolog sys sys$library
+$ endif
+$!
+$ write sys$output "Linking Include Files"
+$ call make bat.xbm    "set file/enter=[]bat.xbm [.bitmaps]l-xlock.xbm"   [.bitmaps]l-xlock.xbm
+$ call make bounce.xbm  "set file/enter=[]bounce.xbm [.bitmaps]l-xlock.xbm" [.bitmaps]l-xlock.xbm
+$ call make decay.xbm  "set file/enter=[]decay.xbm [.bitmaps]l-xlock.xbm" [.bitmaps]l-xlock.xbm
+$! call make eyes.xbm  "set file/enter=[]eyes.xbm [.bitmaps]m-dec.xbm"    [.bitmaps]m-dec.xbm
+$ call make eyes.xbm   "set file/enter=[]eyes.xbm [.bitmaps]m-grelb.xbm"  [.bitmaps]m-grelb.xbm
+$ call make eyes2.xbm  "set file/enter=[]eyes2.xbm [.bitmaps]m-grelb-2.xbm" [.bitmaps]m-grelb-2.xbm
+$ call make flag.xbm   "set file/enter=[]flag.xbm [.bitmaps]m-dec.xbm"    [.bitmaps]m-dec.xbm
+$! call make ghost.xbm "set file/enter=[]ghost.xbm [.bitmaps]m-dec.xbm"   [.bitmaps]m-dec.xbm
+$ call make ghost.xbm  "set file/enter=[]ghost.xbm [.bitmaps]m-ghost.xbm" [.bitmaps]m-ghost.xbm
+$ call make image.xbm  "set file/enter=[]image.xbm [.bitmaps]m-dec.xbm"   [.bitmaps]m-dec.xbm
+$ call make life.xbm   "set file/enter=[]life.xbm [.bitmaps]s-grelb.xbm"  [.bitmaps]s-grelb.xbm
+$! call make life.xbm  "set file/enter=[]life.xbm [.bitmaps]s-dec.xbm"    [.bitmaps]s-dec.xbm
+$ call make life2.xbm  "set file/enter=[]life2.xbm [.bitmaps]s-grelb-2.xbm" [.bitmaps]s-grelb-2.xbm
+$ call make life1d.xbm "set file/enter=[]life1d.xbm [.bitmaps]t-x11.xbm"  [.bitmaps]t-x11.xbm
+$ call make maze.xbm   "set file/enter=[]maze.xbm [.bitmaps]l-dec.xbm"    [.bitmaps]l-dec.xbm
+$ call make puzzle.xbm "set file/enter=[]puzzle.xbm [.bitmaps]l-xlock.xbm" [.bitmaps]l-xlock.xbm
+$ if xpm
+$ then
+$   call make bat.xpm    "set file/enter=[]bat.xpm [.pixmaps]l-xlock.xpm"   [.pixmaps]l-xlock.xpm
+$   call make bounce.xpm  "set file/enter=[]bounce.xpm [.pixmaps]l-xlock.xpm" [.pixmaps]l-xlock.xpm
+$   call make decay.xpm  "set file/enter=[]decay.xpm [.pixmaps]l-xlock.xpm" [.pixmaps]m-dec.xpm
+$!   call make decay.xpm  "set file/enter=[]decay.xpm [.pixmaps]m-dec.xpm"   [.pixmaps]m-dec.xpm
+$   call make flag.xpm   "set file/enter=[]flag.xpm [.pixmaps]m-dec.xpm"    [.pixaps]m-dec.xpm
+$   call make image.xpm  "set file/enter=[]image.xpm [.pixmaps]m-dec.xpm"   [.pixmaps]m-dec.xpm
+$   call make maze.xpm   "set file/enter=[]maze.xpm [.pixmaps]m-dec.xpm"    [.pixmaps]m-dec.xpm
+$   call make puzzle.xpm  "set file/enter=[]puzzle.xpm [.pixmaps]l-xlock.xpm" [.pixmaps]l-xlock.xpm
+$!   call make puzzle.xpm "set file/enter=[]puzzle.xpm [.pixmaps]m-dec.xpm" [.pixmaps]m-dec.xpm
+$ endif
+$!
+$ write sys$output "Compiling XLock whith the folowing defines ="
+$ write sys$output "''defs'"
+$ call make [.xlock]xlock.obj     "xl_cc /object=[.xlock] [.xlock]xlock.c"     [.xlock]xlock.c [.xlock]xlock.h [.xlock]mode.h [.xlock]vroot.h
+$ call make [.xlock]passwd.obj    "xl_cc /object=[.xlock] [.xlock]passwd.c"    [.xlock]passwd.c [.xlock]xlock.h
+$ call make [.xlock]resource.obj  "xl_cc /object=[.xlock] [.xlock]resource.c"  [.xlock]resource.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.xlock]parsecmd.obj  "xl_cc /object=[.xlock] [.xlock]parsecmd.c"  [.xlock]parsecmd.c
+$ call make [.xlock]util.obj      "xl_cc /object=[.xlock] [.xlock]util.c"      [.xlock]util.c [.xlock]xlock.h [.xlock]util.h
+$ call make [.xlock]logout.obj    "xl_cc /object=[.xlock] [.xlock]logout.c"    [.xlock]logout.c [.xlock]xlock.h
+$ call make [.xlock]mode.obj      "xl_cc /object=[.xlock] [.xlock]mode.c"      [.xlock]mode.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.xlock]xlockimage.obj "xl_cc /object=[.xlock] [.xlock]xlockimage.c"       [.xlock]xlockimage.c [.xlock]xlock.h [.xlock]xlockimage.c
+$ if use_magick
+$ then
+$   call make [.xlock]magick.obj     "xl_cc /object=[.xlock] [.xlock]magick.c"       [.xlock]magick.c [.xlock]xlock.h [.xlock]magick.h [.xlock]xlockimage.c
+$ else
+$   call make [.xlock]ras.obj       "xl_cc /object=[.xlock] [.xlock]ras.c"       [.xlock]ras.c [.xlock]xlock.h [.xlock]ras.h [.xlock]xlockimage.c
+$   call make [.xlock]xbm.obj       "xl_cc /object=[.xlock] [.xlock]xbm.c"       [.xlock]xbm.c [.xlock]xlock.h
+$ endif
+$ call make [.xlock]vis.obj       "xl_cc /object=[.xlock] [.xlock]vis.c"       [.xlock]vis.c [.xlock]xlock.h [.xlock]vis.h
+$ call make [.xlock]visgl.obj     "xl_cc /object=[.xlock] [.xlock]visgl.c"     [.xlock]visgl.c [.xlock]xlock.h [.xlock]visgl.h
+$ call make [.xlock]color.obj     "xl_cc /object=[.xlock] [.xlock]color.c"     [.xlock]color.c [.xlock]xlock.h [.xlock]color.h
+$ call make [.xlock]random.obj    "xl_cc /object=[.xlock] [.xlock]random.c"    [.xlock]random.c [.xlock]xlock.h [.xlock]random.h
+$ call make [.xlock]iostuff.obj   "xl_cc /object=[.xlock] [.xlock]iostuff.c"   [.xlock]iostuff.c [.xlock]xlock.h [.xlock]iostuff.h
+$ call make [.xlock]automata.obj  "xl_cc /object=[.xlock] [.xlock]automata.c"  [.xlock]automata.c [.xlock]xlock.h [.xlock]automata.h
+$ call make [.xlock]spline.obj    "xl_cc /object=[.xlock] [.xlock]spline.c"    [.xlock]spline.c [.xlock]xlock.h [.xlock]spline.h
+$ call make [.xlock]erase.obj     "xl_cc /object=[.xlock] [.xlock]erase.c"     [.xlock]erase.c [.xlock]xlock.h [.xlock]erase.h [.xlock]erase_debug.h [.xlock]erase_init.h
+$ if check
+$ then
+$   write sys$output "Compiling XLock Memory Check Caution: Experimental!"
+$   call make [.xlock]memcheck.obj     "xl_cc /object=[.xlock] [.xlock]memcheck.c"     [.xlock]memcheck.c [.xlock]xlock.h
+$ endif
+$ if axp .and. sound
+$ then
+$   call make [.xlock]sound.obj     "xl_cc /object=[.xlock] [.xlock]sound.c"     [.xlock]sound.c [.xlock]xlock.h [.xlock]vms_amd.h
+$   call make [.xlock]vms_amd.obj   "xl_cc /object=[.xlock] [.xlock]vms_amd.c"   [.xlock]vms_amd.c [.xlock]vms_amd.h
+$ else
+$   call make [.xlock]sound.obj     "xl_cc /object=[.xlock] [.xlock]sound.c"     [.xlock]sound.c [.xlock]xlock.h
+$ endif
+$ call make [.modes]ant.obj       "xl_cc /object=[.modes] [.modes]ant.c"       [.modes]ant.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]ball.obj      "xl_cc /object=[.modes] [.modes]ball.c"      [.modes]ball.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]bat.obj       "xl_cc /object=[.modes] [.modes]bat.c"       [.modes]bat.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]blot.obj      "xl_cc /object=[.modes] [.modes]blot.c"      [.modes]blot.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]bouboule.obj  "xl_cc /object=[.modes] [.modes]bouboule.c"  [.modes]bouboule.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]bounce.obj    "xl_cc /object=[.modes] [.modes]bounce.c"    [.modes]bounce.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]braid.obj     "xl_cc /object=[.modes] [.modes]braid.c"     [.modes]braid.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]bubble.obj    "xl_cc /object=[.modes] [.modes]bubble.c"    [.modes]bubble.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]bug.obj       "xl_cc /object=[.modes] [.modes]bug.c"       [.modes]bug.c [.xlock]xlock.h [.xlock]mode.h
+$! call make [.modes]cartoon.obj     "xl_cc /object=[.modes] [.modes]cartoon.c"    [.modes]cartoon.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]clock.obj     "xl_cc /object=[.modes] [.modes]clock.c"     [.modes]clock.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]coral.obj     "xl_cc /object=[.modes] [.modes]coral.c"     [.modes]coral.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]crystal.obj   "xl_cc /object=[.modes] [.modes]crystal.c"   [.modes]crystal.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]daisy.obj     "xl_cc /object=[.modes] [.modes]daisy.c"     [.modes]daisy.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]dclock.obj    "xl_cc /object=[.modes] [.modes]dclock.c"    [.modes]dclock.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]decay.obj     "xl_cc /object=[.modes] [.modes]decay.c"     [.modes]decay.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]deco.obj      "xl_cc /object=[.modes] [.modes]deco.c"      [.modes]deco.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]demon.obj     "xl_cc /object=[.modes] [.modes]demon.c"     [.modes]demon.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]dilemma.obj   "xl_cc /object=[.modes] [.modes]dilemma.c"   [.modes]dilemma.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]discrete.obj  "xl_cc /object=[.modes] [.modes]discrete.c"  [.modes]discrete.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]dragon.obj    "xl_cc /object=[.modes] [.modes]dragon.c"    [.modes]dragon.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]drift.obj     "xl_cc /object=[.modes] [.modes]drift.c"     [.modes]drift.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]euler2d.obj   "xl_cc /object=[.modes] [.modes]euler2d.c"   [.modes]euler2d.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]eyes.obj      "xl_cc /object=[.modes] [.modes]eyes.c"      [.modes]eyes.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]fadeplot.obj  "xl_cc /object=[.modes] [.modes]fadeplot.c"  [.modes]fadeplot.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]flag.obj      "xl_cc /object=[.modes] [.modes]flag.c"      [.modes]flag.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]flame.obj     "xl_cc /object=[.modes] [.modes]flame.c"     [.modes]flame.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]flow.obj      "xl_cc /object=[.modes] [.modes]flow.c"      [.modes]flow.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]forest.obj    "xl_cc /object=[.modes] [.modes]forest.c"    [.modes]forest.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]galaxy.obj    "xl_cc /object=[.modes] [.modes]galaxy.c"    [.modes]galaxy.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]goop.obj      "xl_cc /object=[.modes] [.modes]goop.c"      [.modes]goop.c [.xlock]xlock.h [.xlock]mode.h [.xlock]spline.h
+$ call make [.modes]grav.obj      "xl_cc /object=[.modes] [.modes]grav.c"      [.modes]grav.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]helix.obj     "xl_cc /object=[.modes] [.modes]helix.c"     [.modes]helix.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]hop.obj       "xl_cc /object=[.modes] [.modes]hop.c"       [.modes]hop.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]hyper.obj     "xl_cc /object=[.modes] [.modes]hyper.c"     [.modes]hyper.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]ico.obj       "xl_cc /object=[.modes] [.modes]ico.c"       [.modes]ico.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]ifs.obj       "xl_cc /object=[.modes] [.modes]ifs.c"       [.modes]ifs.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]image.obj     "xl_cc /object=[.modes] [.modes]image.c"     [.modes]image.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]juggle.obj    "xl_cc /object=[.modes] [.modes]juggle.c"    [.modes]juggle.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]julia.obj     "xl_cc /object=[.modes] [.modes]julia.c"     [.modes]julia.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]kaleid.obj    "xl_cc /object=[.modes] [.modes]kaleid.c"    [.modes]kaleid.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]kumppa.obj    "xl_cc /object=[.modes] [.modes]kumppa.c"    [.modes]kumppa.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]laser.obj     "xl_cc /object=[.modes] [.modes]laser.c"     [.modes]laser.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]life.obj      "xl_cc /object=[.modes] [.modes]life.c"      [.modes]life.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]life1d.obj    "xl_cc /object=[.modes] [.modes]life1d.c"    [.modes]life1d.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]life3d.obj    "xl_cc /object=[.modes] [.modes]life3d.c"    [.modes]life3d.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]lightning.obj "xl_cc /object=[.modes] [.modes]lightning.c" [.modes]lightning.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]lisa.obj      "xl_cc /object=[.modes] [.modes]lisa.c"      [.modes]lisa.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]lissie.obj    "xl_cc /object=[.modes] [.modes]lissie.c"    [.modes]lissie.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]loop.obj      "xl_cc /object=[.modes] [.modes]loop.c"      [.modes]loop.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]lyapunov.obj  "xl_cc /object=[.modes] [.modes]lyapunov.c"  [.modes]lyapunov.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]mandelbrot.obj "xl_cc /object=[.modes] [.modes]mandelbrot.c" [.modes]mandelbrot.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]marquee.obj   "xl_cc /object=[.modes] [.modes]marquee.c"   [.modes]marquee.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]matrix.obj    "xl_cc /object=[.modes] [.modes]matrix.c"    [.modes]matrix.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]maze.obj      "xl_cc /object=[.modes] [.modes]maze.c"      [.modes]maze.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]mountain.obj  "xl_cc /object=[.modes] [.modes]mountain.c"  [.modes]mountain.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]munch.obj     "xl_cc /object=[.modes] [.modes]munch.c"     [.modes]munch.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]nose.obj      "xl_cc /object=[.modes] [.modes]nose.c"      [.modes]nose.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]qix.obj       "xl_cc /object=[.modes] [.modes]qix.c"       [.modes]qix.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]pacman.obj    "xl_cc /object=[.modes] [.modes]pacman.c"    [.modes]pacman.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]penrose.obj   "xl_cc /object=[.modes] [.modes]penrose.c"   [.modes]penrose.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]petal.obj     "xl_cc /object=[.modes] [.modes]petal.c"     [.modes]petal.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]polyominoes.obj   "xl_cc /object=[.modes] [.modes]polyominoes.c"   [.modes]polyominoes.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]puzzle.obj    "xl_cc /object=[.modes] [.modes]puzzle.c"    [.modes]puzzle.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]pyro.obj      "xl_cc /object=[.modes] [.modes]pyro.c"      [.modes]pyro.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]roll.obj      "xl_cc /object=[.modes] [.modes]roll.c"      [.modes]roll.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]rotor.obj     "xl_cc /object=[.modes] [.modes]rotor.c"     [.modes]rotor.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]scooter.obj   "xl_cc /object=[.modes] [.modes]scooter.c"   [.modes]scooter.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]shape.obj     "xl_cc /object=[.modes] [.modes]shape.c"     [.modes]shape.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]sierpinski.obj "xl_cc /object=[.modes] [.modes]sierpinski.c" [.modes]sierpinski.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]slip.obj      "xl_cc /object=[.modes] [.modes]slip.c"      [.modes]slip.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]space.obj     "xl_cc /object=[.modes] [.modes]space.c"     [.modes]space.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]sphere.obj    "xl_cc /object=[.modes] [.modes]sphere.c"    [.modes]sphere.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]spiral.obj    "xl_cc /object=[.modes] [.modes]spiral.c"    [.modes]spiral.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]spline.obj    "xl_cc /object=[.modes] [.modes]spline.c"    [.modes]spline.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]star.obj      "xl_cc /object=[.modes] [.modes]star.c"      [.modes]star.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]starfish.obj  "xl_cc /object=[.modes] [.modes]starfish.c"  [.modes]starfish.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]strange.obj   "xl_cc /object=[.modes] [.modes]strange.c"   [.modes]strange.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]swarm.obj     "xl_cc /object=[.modes] [.modes]swarm.c"     [.modes]swarm.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]swirl.obj     "xl_cc /object=[.modes] [.modes]swirl.c"     [.modes]swirl.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]t3d.obj       "xl_cc /object=[.modes] [.modes]t3d.c"       [.modes]t3d.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]tetris.obj    "xl_cc /object=[.modes] [.modes]tetris.c"    [.modes]tetris.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]thornbird.obj "xl_cc /object=[.modes] [.modes]thornbird.c" [.modes]thornbird.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]tik_tak.obj   "xl_cc /object=[.modes] [.modes]tik_tak.c"   [.modes]tik_tak.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]triangle.obj  "xl_cc /object=[.modes] [.modes]triangle.c"  [.modes]triangle.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]tube.obj      "xl_cc /object=[.modes] [.modes]tube.c"      [.modes]tube.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]turtle.obj    "xl_cc /object=[.modes] [.modes]turtle.c"    [.modes]turtle.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]vines.obj     "xl_cc /object=[.modes] [.modes]vines.c"     [.modes]vines.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]voters.obj    "xl_cc /object=[.modes] [.modes]voters.c"    [.modes]voters.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]wator.obj     "xl_cc /object=[.modes] [.modes]wator.c"     [.modes]wator.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]wire.obj      "xl_cc /object=[.modes] [.modes]wire.c"      [.modes]wire.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]world.obj     "xl_cc /object=[.modes] [.modes]world.c"     [.modes]world.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]worm.obj      "xl_cc /object=[.modes] [.modes]worm.c"      [.modes]worm.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]xcl.obj       "xl_cc /object=[.modes] [.modes]xcl.c"       [.modes]xcl.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]xjack.obj     "xl_cc /object=[.modes] [.modes]xjack.c"     [.modes]xjack.c [.xlock]xlock.h [.xlock]mode.h
+$ if unstable
+$ then
+$   call make [.modes]run.obj       "xl_cc /object=[.modes] [.modes]run.c"       [.modes]run.c [.xlock]xlock.h [.xlock]mode.h
+$ endif
+$ if iscxx
+$ then
+$   call make [.modes]solitare.obj     "xl_cxx /object=[.modes] [.modes]solitare.cc"     [.modes]solitare.cc [.xlock]xlock.h [.xlock]mode.h
+$ endif
+$ if gl .or. gl_share
+$ then
+$   call make [.modes.glx]cage.obj      "xl_cc /object=[.modes.glx] [.modes.glx]cage.c"     [.modes.glx]cage.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]fire.obj      "xl_cc /object=[.modes.glx] [.modes.glx]fire.c"     [.modes.glx]fire.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]gears.obj     "xl_cc /object=[.modes.glx] [.modes.glx]gears.c"    [.modes.glx]gears.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]tube.obj      "xl_cc /object=[.modes.glx] [.modes.glx]tube.c" [.modes.glx]tube.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]sphere.obj    "xl_cc /object=[.modes.glx] [.modes.glx]sphere.c" [.modes.glx]sphere.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]glplanet.obj  "xl_cc /object=[.modes.glx] [.modes.glx]glplanet.c" [.modes.glx]glplanet.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]lament.obj    "xl_cc /object=[.modes.glx] [.modes.glx]lament.c"   [.modes.glx]lament.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]moebius.obj   "xl_cc /object=[.modes.glx] [.modes.glx]moebius.c"  [.modes.glx]moebius.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]molecule.obj  "xl_cc /object=[.modes.glx] [.modes.glx]molecule.c"    [.modes.glx]molecule.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]morph3d.obj   "xl_cc /object=[.modes.glx] [.modes.glx]morph3d.c"   [.modes.glx]morph3d.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]rubik.obj     "xl_cc /object=[.modes.glx] [.modes.glx]rubik.c"     [.modes.glx]rubik.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]sballs.obj    "xl_cc /object=[.modes.glx] [.modes.glx]sballs.c"     [.modes.glx]sballs.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]sierpinski3d.obj     "xl_cc /object=[.modes.glx] [.modes.glx]sierpinski3d.c"     [.modes.glx]sierpinski3d.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]stairs.obj    "xl_cc /object=[.modes.glx] [.modes.glx]stairs.c" [.modes.glx]stairs.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]superquadrics.obj "xl_cc /object=[.modes.glx] [.modes.glx]superquadrics.c" [.modes.glx]superquadrics.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]xpm-ximage.obj  "xl_cc /object=[.modes.glx] [.modes.glx]xpm-ximage.c"  [.modes.glx]xpm-ximage.c [.xlock]xlock.h [.xlock]xpm-ximage.h
+$   call make [.modes.glx]buildlwo.obj  "xl_cc /object=[.modes.glx] [.modes.glx]buildlwo.c"  [.modes.glx]buildlwo.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]pipes.obj     "xl_cc /object=[.modes.glx] [.modes.glx]pipes.c"     [.modes.glx]pipes.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]pipeobjs.obj  "xl_cc /object=[.modes.glx] [.modes.glx]pipeobjs.c"  [.modes.glx]pipeobjs.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]sproingies.obj "xl_cc /object=[.modes.glx] [.modes.glx]sproingies.c" [.modes.glx]sproingies.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]sproingiewrap.obj "xl_cc /object=[.modes.glx] [.modes.glx]sproingiewrap.c" [.modes.glx]sproingiewrap.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]s1_b.obj      "xl_cc /object=[.modes.glx] [.modes.glx]s1_b.c"      [.modes.glx]s1_b.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]s1_1.obj      "xl_cc /object=[.modes.glx] [.modes.glx]s1_1.c"      [.modes.glx]s1_1.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]s1_2.obj      "xl_cc /object=[.modes.glx] [.modes.glx]s1_2.c"      [.modes.glx]s1_2.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]s1_3.obj      "xl_cc /object=[.modes.glx] [.modes.glx]s1_3.c"      [.modes.glx]s1_3.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]s1_4.obj      "xl_cc /object=[.modes.glx] [.modes.glx]s1_4.c"      [.modes.glx]s1_4.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]s1_5.obj      "xl_cc /object=[.modes.glx] [.modes.glx]s1_5.c"      [.modes.glx]s1_5.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]s1_6.obj      "xl_cc /object=[.modes.glx] [.modes.glx]s1_6.c"      [.modes.glx]s1_6.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]atlantis.obj  "xl_cc /object=[.modes.glx] [.modes.glx]atlantis.c"  [.modes.glx]atlantis.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]dolphin.obj   "xl_cc /object=[.modes.glx] [.modes.glx]dolphin.c"   [.modes.glx]dolphin.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]shark.obj     "xl_cc /object=[.modes.glx] [.modes.glx]shark.c"     [.modes.glx]shark.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]swim.obj      "xl_cc /object=[.modes.glx] [.modes.glx]swim.c"      [.modes.glx]swim.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]whale.obj     "xl_cc /object=[.modes.glx] [.modes.glx]whale.c"     [.modes.glx]whale.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]bubble3d.obj  "xl_cc /object=[.modes.glx] [.modes.glx]bubble3d.c"     [.modes.glx]bubble3d.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]b_draw.obj    "xl_cc /object=[.modes.glx] [.modes.glx]b_draw.c"     [.modes.glx]b_draw.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]b_lockglue.obj "xl_cc /object=[.modes.glx] [.modes.glx]b_lockglue.c"     [.modes.glx]b_lockglue.c [.xlock]xlock.h [.xlock]mode.h
+$   call make [.modes.glx]b_sphere.obj  "xl_cc /object=[.modes.glx] [.modes.glx]b_sphere.c"     [.modes.glx]b_sphere.c [.xlock]xlock.h [.xlock]mode.h
+$   if unstable
+$   then
+$     call make [.modes.glx]skewb.obj     "xl_cc /object=[.modes.glx] [.modes.glx]skewb.c"     [.modes.glx]skewb.c [.xlock]xlock.h [.xlock]mode.h
+$   endif
+$   if iscxx
+$   then
+$     call make [.modes.glx]invert.obj   "xl_cc /object=[.modes.glx] [.modes.glx]invert.c"  [.modes.glx]invert.c [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_figureeight.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_figureeight.cc"  [.modes.glx]i_figureeight.cc [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_linkage.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_linkage.cc"  [.modes.glx]i_linkage.cc [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_sphere.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_sphere.cc"  [.modes.glx]i_sphere.cc [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_spline.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_spline.cc"  [.modes.glx]i_spline.cc [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_threejet.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_threejet.cc"  [.modes.glx]i_threejet.cc [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_threejetvec.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_threejetvec.cc"  [.modes.glx]i_threejetvec.cc [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_twojet.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_twojet.cc"  [.modes.glx]i_twojet.cc [.xlock]xlock.h [.xlock]mode.h
+$     call make [.modes.glx]i_twojetvec.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]i_twojetvec.cc"  [.modes.glx]i_twojetvec.cc [.xlock]xlock.h [.xlock]mode.h
+$     if unstable
+$     then
+$       if ttf .and. gltt
+$       then
+$         call make [.modes.glx]text3d.obj  "xl_cxx /object=[.modes.glx] [.modes.glx]text3d.cc"  [.modes.glx]text3d.cc [.xlock]xlock.h [.xlock]mode.h
+$       endif
+$     endif
+$   endif
+$ endif
+$ if bomb
+$ then
+$   call make [.modes]bomb.obj      "xl_cc /object=[.modes] [.modes]bomb.c"      [.modes]bomb.c [.xlock]xlock.h [.xlock]mode.h
+$ endif
+$ call make [.modes]blank.obj     "xl_cc /object=[.modes] [.modes]blank.c"     [.modes]blank.c [.xlock]xlock.h [.xlock]mode.h
+$ call make [.modes]random.obj    "xl_cc /object=[.modes] [.modes]random.c"    [.modes]random.c [.xlock]xlock.h [.xlock]mode.h
+$!
+$! Get libraries
+$ if use_magick then write optf "''magickf'/lib"
+$ if gltt then write optf "''glttf'/lib"
+$ if ttf then write optf "''ttff'/lib"
+$ if xpm then write optf "''xpmf'/lib"
+$ if gl then write optf "''glf'/lib"
+$ if gl_share then write optf "''glf_share'/share"
+$ if glu then write optf "''gluf'/lib"
+$ if glu_share then write optf "''gluf_share'/share"
+$ if sys_maj .lt. 7
+$ then
+$   if xvmsutils then write optf "''xvmsutilsf'/lib"
+$ endif
+$! if .not. axp then write optf "sys$library:vaxcrtl/lib"
+$ write optf "sys$library:vaxcrtl/lib"
+$ if dtsaver then write optf "sys$library:cde$libdtsvc.exe/share"
+$ if axp then write optf "sys$library:ucx$ipc_shr/share"
+$ if mmov
+$ then
+$   write optf "[.mmov]vms_mmov.obj"
+$   write optf "[.mmov]readavi.obj"
+$   write optf "[.mmov]commonlib.olb/lib"
+$   write optf "sys$library:mmov.olb/lib"
+$   write optf "sys$share:cma$open_rtl.exe/share"
+$   endif
+$ if axp then write optf "sys$share:decw$xextlibshr/share/sel"
+$ if axp then write optf "sys$share:decw$xtlibshrr5/share"
+$ if .not. axp then write optf "sys$library:ucx$ipc/lib"
+$ write optf "sys$share:decw$dxmlibshr/share"
+$ write optf "sys$share:decw$xlibshr/share"
+$ close optf
+$!
+$! LINK
+$ write sys$output "Linking XLock"
+$ xl_link/map/exec=[.xlock] xlock/opt
+$!
+$! Create .opt file
+$ open/write optf xmlock.opt
+$ write sys$output "Compiling XMLock whith the folowing defines ="
+$ write sys$output "''defs'"
+$ call make [.xmlock]option.obj "xl_cc /object=[.xmlock] [.xmlock]option.c" [.xmlock]option.c
+$ call make [.xmlock]xmlock.obj "xl_cc /object=[.xmlock] [.xmlock]xmlock.c" [.xmlock]xmlock.c
+$! Get libraries
+$! if .not. axp then write optf "sys$library:vaxcrtl/lib"
+$ write optf "sys$library:vaxcrtl/lib"
+$ if axp then write optf "sys$library:ucx$ipc_shr/share"
+$ if axp then write optf "sys$share:decw$xextlibshr/share"
+$ if axp then write optf "sys$share:decw$xtlibshrr5/share"
+$ if .not. axp then write optf "sys$library:ucx$ipc/lib"
+$! write optf "sys$share:decw$dxmlibshr/share"
+$ write optf "sys$share:decw$xmlibshr12/share"
+$ write optf "sys$share:decw$xlibshr/share"
+$ close optf
+$!
+$! LINK
+$ write sys$output "Linking XmLock"
+$ xl_link/map/exec=[.xmlock] xmlock/opt
+$!
+$ if mmov
+$ then
+$   write sys$output "NOTE:"
+$   write sys$output "Sound files are played only when the user has the SYSNAM"
+$   write sys$output "as an authorized privilege"
+$ endif
+$ set noverify
+$ exit
+$!
+$Clobber:      ! Delete executables, Purge directory and clean up object files
+$!                and listings
+$ delete/noconfirm [.xlock]xlock.exe;*
+$ delete/noconfirm [.xmlock]xmlock.exe;*
+$!
+$Clean:        ! Purge directory, clean up object files and listings
+$ close/nolog optf
+$ purge [...]
+$ delete/noconfirm [...]*.lis;*
+$ delete/noconfirm [...]*.obj;*
+$ delete/noconfirm [...]*.opt;*
+$ delete/noconfirm [...]*.map;*
+$ set file/remove bat.xbm;*
+$ set file/remove bounce.xbm;*
+$ set file/remove decay.xbm;*
+$ set file/remove eyes.xbm;*
+$ set file/remove eyes2.xbm;*
+$ set file/remove flag.xbm;*
+$ set file/remove image.xbm;*
+$ set file/remove ghost.xbm;*
+$ set file/remove life.xbm;*
+$ set file/remove life2.xbm;*
+$ set file/remove life1d.xbm;*
+$ set file/remove maze.xbm;*
+$ set file/remove puzzle.xbm;*
+$ set file/remove bat.xpm;*
+$ set file/remove bounce.xpm;*
+$ set file/remove decay.xpm;*
+$ set file/remove flag.xpm;*
+$ set file/remove image.xpm;*
+$ set file/remove maze.xpm;*
+$ set file/remove puzzle.xpm;*
+$!
+$ exit
+$!
+! SUBROUTINE TO CHECK DEPENDENCIES
+$ make: subroutine
+$   v='f$verify(0)
+$!   p1       What we are trying to make
+$!   p2       Command to make it
+$!   p3 - p8  What it depends on
+$
+$   if (f$extract(0,6,p2) .eqs. "xl_cc ") then write optf "''p1'"
+$   if (f$extract(0,7,p2) .eqs. "xl_cxx ") then write optf "''p1'"
+$
+$   if f$search(p1) .eqs. "" then goto MakeIt
+$   time=f$cvtime(f$file(p1,"RDT"))
+$   arg=3
+$Loop:
+$   argument=p'arg
+$   if argument .eqs. "" then goto Exit
+$   el=0
+$Loop2:
+$   file=f$element(el," ",argument)
+$   if file .eqs. " " then goto Endl
+$   afile=""
+$Loop3:
+$   ofile=afile
+$   afile=f$search(file)
+$   if afile .eqs. "" .or. afile .eqs. ofile then goto NextEl
+$   if f$cvtime(f$file(afile,"RDT")) .gts. time then goto MakeIt
+$   goto Loop3
+$NextEL:
+$   el=el+1
+$   goto Loop2
+$EndL:
+$   arg=arg+1
+$   if arg .le. 8 then goto Loop
+$   goto Exit
+$
+$MakeIt:
+$   set verify
+$   'p2
+$   vv='f$verify(0)
+$Exit:
+$   if v then set verify
+$ endsubroutine
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755 (executable)
index 0000000..5e1a43e
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+
+for file
+do
+   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+   shift
+
+   pathcomp=
+   for d in ${1+"$@"} ; do
+     pathcomp="$pathcomp$d"
+     case "$pathcomp" in
+       -* ) pathcomp=./$pathcomp ;;
+     esac
+
+     if test ! -d "$pathcomp"; then
+        echo "mkdir $pathcomp" 1>&2
+        mkdir "$pathcomp" || errstatus=$?
+     fi
+
+     pathcomp="$pathcomp/"
+   done
+done
+
+exit $errstatus
diff --git a/mmov.com b/mmov.com
new file mode 100644 (file)
index 0000000..b0c94e9
--- /dev/null
+++ b/mmov.com
@@ -0,0 +1,11 @@
+$ define/nolog machine                    MMOV$INCLUDE:,[]
+$ define/nolog mme                MMOV$INCLUDE:,[]
+$ define/nolog x11                MMOV$INCLUDE:,DECW$INCLUDE
+$ define/nolog decc$user_include   mme,decw$include:
+$ define/nolog sys                decc$user_include
+$ define/nolog decc$system_include decc$user_include
+$ cc/define=(_VMS_V6_SOURCE,__VMS,mme_BLD,IPC_VMS,Long_bit=64,DEC)/-
+    standard=vaxc/nowarn=inform readavi
+$ cc/define=(_VMS_V6_SOURCE,__VMS,mme_BLD,IPC_VMS,Long_bit=64,DEC)/-
+    standard=vaxc [-.xlock]vms_mmov
+$ define/nolog x11                DECW$INCLUDE
diff --git a/modes/Imakefile b/modes/Imakefile
new file mode 100644 (file)
index 0000000..950a044
--- /dev/null
@@ -0,0 +1,488 @@
+#ifndef XCOMM
+#define XCOMM /**/#
+#endif
+XCOMM @(#)Sub Imakefile        xlockmore
+XCOMM
+
+#include "../iconfig.h"
+
+top_srcdir = ..
+BITMAPDIR = $(top_srcdir)/bitmaps/
+PIXMAPDIR = $(top_srcdir)/pixmaps/
+UTILDIR = ../xlock/
+GLDIR = glx/
+UTILOBJDIR = ../xlock/
+GLOBJDIR = glx/
+
+DM =
+DOM =
+DU = $(UTILDIR)
+DOU = $(UTILOBJDIR)
+DG = $(GLDIR)
+DOG = $(GLOBJDIR)
+OM = $(O)$(S)$(DOM)
+OU = $(O)$(S)$(DOU)
+OG = $(O)$(S)$(DOG)
+CM = $(C) $(DM)
+CU = $(C) $(DU)
+CG = $(C) $(DG)
+CG = $(CX) $(DG)
+
+XCOMM  please define
+XCOMM  C as the C source code extension
+XCOMM  O as the object extension
+XCOMM  S as the separator for object code
+
+XCOMM Here is your chance to override the default icon:
+XCOMM TINYBITMAP = $(BITMAPTYPE)
+TINYBITMAP = t-x11
+SMALLBITMAP = s-$(BITMAPTYPE)
+MEDIUMBITMAP = m-$(BITMAPTYPE)
+LARGEBITMAP = l-$(BITMAPTYPE)
+MEDIUMPIXMAP = m-$(PIXMAPTYPE)
+LARGEPIXMAP = l-$(PIXMAPTYPE)
+
+XCOMM BATBITMAP = $(LARGEBITMAP)
+BATBITMAP = l-xlock
+XCOMM BATBITMAP = l-linux
+XCOMM BOUNCEBITMAP = $(LARGEBITMAP)
+BOUNCEBITMAP = l-xlock
+XCOMM BOUNCEBITMAP = l-linux
+XCOMM DECAYBITMAP = $(LARGEBITMAP)
+DECAYBITMAP = l-xlock
+XCOMM DECAYBITMAP = l-linux
+XCOMM EYESBITMAP = $(MEDIUMBITMAP)
+EYESBITMAP = m-grelb
+FLAGBITMAP = $(MEDIUMBITMAP)
+IMAGEBITMAP = $(MEDIUMBITMAP)
+XCOMM IMAGEBITMAP = l-bob #Slackware icon
+XCOMM IMAGEBITMAP = m-xlock #XLock icon
+XCOMM LIFEBITMAP = $(SMALLBITMAP)
+LIFEBITMAP = s-grelb
+LIFE1DBITMAP = $(TINYBITMAP)
+MAZEBITMAP = $(LARGEBITMAP)
+XCOMM MAZEBITMAP = m-xlock
+XCOMM PACMANBITMAP = $(MEDIUMBITMAP)
+PACMANBITMAP = m-ghost
+XCOMM PUZZLEBITMAP = $(LARGEBITMAP)
+PUZZLEBITMAP = l-xlock
+XCOMM PUZZLEBITMAP = l-linux
+XCOMM BATPIXMAP = $(LARGEPIXMAP)
+BATPIXMAP = l-xlock
+XCOMM BATPIXMAP = l-linux
+XCOMM BOUNCEPIXMAP = $(LARGEPIXMAP)
+BOUNCEPIXMAP = l-xlock
+XCOMM BOUNCEPIXMAP = l-linux
+XCOMM DECAYPIXMAP = $(LARGEPIXMAP)
+DECAYPIXMAP = l-xlock
+XCOMM DECAYPIXMAP = l-linux
+FLAGPIXMAP = $(MEDIUMPIXMAP)
+XCOMM FLAGPIXMAP = m-xlock
+IMAGEPIXMAP = $(MEDIUMPIXMAP)
+XCOMM IMAGEPIXMAP = m-xlock
+LIFEPIXMAP = s-grelb
+MAZEPIXMAP = $(MEDIUMPIXMAP)
+XCOMM MAZEPIXMAP = m-xlock
+XCOMM PUZZLEPIXMAP = $(LARGEPIXMAP)
+PUZZLEPIXMAP = l-xlock
+XCOMM PUZZLEPIXMAP = l-linux
+
+XCOMM  List of object files
+XLOCKUTILOBJS = $(DOU)xlock$(OU)passwd$(OU)resource$(OU)parsecmd$(O)$(S)\
+$(DOU)util$(OU)logout$(OU)mode$(OU)xlockimage$(OU)ras$(OU)xbm$(O)$(S)\
+$(DOU)vis$(OU)visgl$(OU)color$(OU)random$(OU)iostuff$(OU)automata$(O)$(S)\
+$(DOU)spline$(OU)erase$(OU)sound$(O)$(S)\
+$(DOU)vtlock$(OU)vtlock_proc$(O)
+#ifdef Check
+XLOCKCHECKOBJS = $(S)memcheck$(O)
+#endif
+XLOCKMODEOBJS = $(DOM)ant$(OM)ball$(OM)bat$(OM)blot$(OM)\
+bouboule$(OM)bounce$(OM)braid$(OM)bubble$(OM)bug$(OM)\
+clock$(OM)coral$(OM)crystal$(OM)\
+daisy$(OM)dclock$(OM)decay$(OM)deco$(OM)demon$(OM)\
+dilemma$(OM)discrete$(OM)dragon$(OM)drift$(OM)euler2d$(OM)eyes$(OM)\
+fadeplot$(OM)flag$(OM)flame$(OM)flow$(OM)forest$(OM)\
+galaxy$(OM)goop$(OM)grav$(OM)\
+helix$(OM)hop$(OM)hyper$(OM)\
+ico$(OM)ifs$(OM)image$(OM)juggle$(OM)julia$(OM)kaleid$(OM)kumppa$(OM)\
+laser$(OM)life$(OM)life1d$(OM)life3d$(OM)\
+lightning$(OM)lisa$(OM)lissie$(OM)loop$(OM)lyapunov$(OM)\
+mandelbrot$(OM)marquee$(OM)matrix$(OM)maze$(OM)\
+mountain$(OM)munch$(OM)nose$(OM)\
+pacman$(OM)penrose$(OM)petal$(OM)polyominoes$(OM)puzzle$(OM)pyro$(OM)\
+qix$(OM)roll$(OM)rotor$(OM)\
+scooter$(OM)shape$(OM)sierpinski$(OM)slip$(OM)\
+space$(OM)sphere$(OM)spiral$(OM)spline$(OM)\
+star$(OM)starfish$(OM)strange$(OM)swarm$(OM)swirl$(OM)\
+t3d$(OM)tetris$(OM)thornbird$(OM)tik_tak$(OM)\
+triangle$(OM)tube$(OM)turtle$(OM)\
+vines$(OM)voters$(OM)\
+wator$(OM)wire$(OM)world$(OM)worm$(OM)xcl$(OM)xjack$(O)
+#ifdef Unstable
+XLOCKUNSTABLEOBJS = $(DOM)run$(O)
+XCOMM CONSTRUCTIONOBJS = $(DOM)billiards(O)
+#endif
+#ifdef CPPCompiler
+XLOCKCPPOBJS = $(DOM)solitare$(O)$(S)$(CONSTRUCTIONOBJS)
+#endif
+#ifdef XpmLibrary
+XLOCKXPMOBJS =
+#endif
+#ifdef GLLibrary
+#ifdef Unstable
+XLOCKUNSTABLEGLOBJS = $(DOG)skewb$(O)
+#endif
+#ifdef CPPCompiler
+INVERTOBJS = $(DOG)i_figureeight$(O)$(S)\
+$(DOG)i_linkage$(OG)i_sphere$(OG)i_spline$(O)$(S)\
+$(DOG)i_threejet$(OG)i_threejetvec$(O)$(S)\
+$(DOG)i_twojet$(OG)i_twojetvec$(O)
+XLOCKDEPCPPGLOBJS = $(INVERTOBJS)
+XLOCKMULTCPPGLOBJS = $(DOG)invert$(O)
+#if defined(TtfLibrary) && defined(GlttLibrary) && defined(Unstable)
+XLOCKUNSTABLETEXTGLOBJS = $(DOG)text3d$(O)
+#endif
+#endif
+SPROINGIESOBJS = $(DOG)buildlwo$(OG)sproingiewrap$(OG)s1_b$(O)$(S)\
+$(DOG)s1_1$(OG)s1_2$(OG)s1_3$(OG)s1_4$(OG)s1_5$(OG)s1_6$(O)
+ATLANTISOBJS = $(DOG)dolphin$(OG)shark$(OG)swim$(OG)whale$(O)
+MOLECULEOBJS = $(DOG)tube$(O)
+BUBBLE3DOBJS = $(DOG)b_draw$(OG)b_sphere$(OG)b_lockglue$(O)
+GLPLANETOBJS = $(DOG)sphere$(O)
+XLOCKDEPGLOBJS = $(DOG)xpm-ximage$(OG)pipeobjs$(O)$(S)\
+$(SPROINGIESOBJS)$(S)$(ATLANTISOBJS)$(S)$(GLPLANETOBJS)$(S)$(BUBBLE3DOBJS)$(S)\
+$(MOLECULEOBJS)$(S)$(XLOCKDEPCPPGLOBJS)
+XLOCKNORMGLOBJS = $(DOG)cage$(OG)gears$(O)$(S)\
+$(DOG)moebius$(OG)morph3d$(O)$(S)\
+$(DOG)rubik$(OG)sierpinski3d$(OG)stairs$(OG)superquadrics$(O)$(S)\
+$(XLOCKUNSTABLEGLOBJS)$(S)$(XLOCKUNSTABLETEXTGLOBJS)
+XLOCKMULTGLOBJS = $(DOG)fire$(OG)lament$(OG)sballs$(OG)molecule$(O)$(S)\
+$(DOG)pipes$(OG)sproingies$(OG)atlantis$(OG)bubble3d$(OG)glplanet$(O)$(S)\
+$(XLOCKMULTCPPGLOBJS)
+XLOCKGLOBJS = $(XLOCKNORMGLOBJS)$(S)\
+$(XLOCKDEPGLOBJS)$(S)$(XLOCKMULTGLOBJS)
+#endif
+#if 1
+XLOCKBOMBOBJS = $(DOM)bomb$(O)
+#endif
+XLOCKUTILMODEOBJS = $(XLOCKBOMBOBJS)$(S)$(DOM)blank$(OM)random$(O)
+XLOCKNORMMODEOBJS = $(XLOCKMODEOBJS)$(S)$(XLOCKUNSTABLEOBJS)$(S)\
+$(XLOCKCPPOBJS)$(S)$(XLOCKXPMOBJS)$(S)$(XLOCKNORMGLOBJS)$(S)\
+$(XLOCKUTILMODEOBJS)
+XLOCKMULTMODEOBJS = $(XLOCKMULTGLOBJS)
+XLOCKALLUTILOBJS = $(XLOCKUTILOBJS)$(XLOCKCHECKOBJS)
+XLOCKOBJS = $(XLOCKALLUTILOBJS)$(S)$(XLOCKNORMMODEOBJS)$(S)\
+$(XLOCKDEPGLOBJS)$(S)$(XLOCKMULTGLOBJS)
+
+XCOMM  List of source files
+BITMAPS = bat.xbm bounce.xbm decay.xbm eyes.xbm eyes2.xbm flag.xbm \
+ghost.xbm image.xbm life.xbm life2.xbm life1d.xbm maze.xbm puzzle.xbm
+PIXMAPS = bat.xpm bounce.xpm decay.xpm flag.xpm image.xpm maze.xpm \
+puzzle.xpm
+XCOMM life.xpm
+XLOCKUTILHDRS = xlock.h mode.h vroot.h xlockimage.h ras.h spline.h \
+version.h config.h
+XLOCKUTILSRCS = $(DU)xlock$(CU)passwd$(CU)resource$(CU)parsecmd$(C) \
+$(DU)util$(CU)logout$(CU)mode$(CU)xlockimage$(CU)ras$(CU)xbm$(C) \
+$(DU)vis$(CU)color$(CU)random$(CU)iostuff$(CU)automata$(C) \
+$(DU)spline$(CU)sound$(CU)erase$(C) \
+$(DU)vtlock$(CU)vtlock_proc$(C)
+XLOCKCHECKSRCS = $(DU)memcheck$(C)
+XLOCKMODESRCS = $(DM)ant$(CM)ball$(CM)bat$(CM)blot$(C) \
+$(DM)bouboule$(CM)bounce$(CM)braid$(CM)bubble$(CM)bug$(C) \
+$(DM)clock$(CM)coral$(CM)crystal$(C) \
+$(DM)daisy$(CM)dclock$(CM)decay$(CM)deco$(CM)demon$(C) \
+$(DM)dilemma$(CM)discrete$(CM)dragon$(CM)drift$(CM)euler2d$(CM)eyes$(C) \
+$(DM)fadeplot$(CM)flag$(CM)flame$(CM)flow$(CM)forest$(C) \
+$(DM)galaxy$(CM)goop$(CM)grav$(C) \
+$(DM)helix$(CM)hop$(CM)hyper$(C) \
+$(DM)ico$(CM)ifs$(CM)image$(CM)juggle$(CM)julia$(CM)kaleid$(CM)kumppa$(C) \
+$(DM)laser$(CM)life$(CM)life1d$(CM)life3d$(C) \
+$(DM)lightning$(CM)lisa$(CM)lissie$(CM)loop$(CM)lyapunov$(C) \
+$(DM)mandelbrot$(CM)marquee$(CM)matrix$(CM)maze$(C) \
+$(DM)mountain$(CM)munch$(CM)nose$(C) \
+$(DM)pacman$(CM)penrose$(CM)petal$(CM)polyominoes$(CM)puzzle$(CM)pyro$(C) \
+$(DM)qix$(CM)roll$(CM)rotor$(C) \
+$(DM)scooter$(CM)shape$(CM)sierpinski$(CM)slip$(C) \
+$(DM)space$(CM)sphere$(CM)spiral$(CM)spline$(C) \
+$(DM)star$(CM)starfish$(CM)strange$(CM)swarm$(CM)swirl$(C) \
+$(DM)t3d$(CM)tetris$(CM)thornbird$(CM)tik_tak$(C) \
+$(DM)triangle$(CM)tube$(CM)turtle$(C) \
+$(DM)vines$(CM)voters$(C) \
+$(DM)wator$(CM)wire$(CM)world$(CM)worm$(CM)xcl$(CM)xjack$(C)
+XLOCKUNSTABLESRCS = $(DM)run$(C)
+XCOMM CONSTRUCTIONSRCS = $(DM)billiards(CX)
+XLOCKCPPSRCS = $(DM)solitare$(CX) $(CONSTRUCTIONSRCS)
+XLOCKXPMSRCS =
+XLOCKGLSRCS = $(DG)cage$(CG)fire$(CG)gears$(C) \
+$(DG)glplanet$(CG)sphere$(CG)lament$(CG)moebius$(CG)morph3d$(C) \
+$(DG)molecule$(CG)tube$(C) \
+$(DG)rubik$(CG)sballs$(CG)skewb$(C) \
+$(DG)sierpinski3d$(CG)stairs$(CG)superquadrics$(C) \
+$(DG)xpm-ximage$(CG)buildlwo$(CG)pipes$(CG)pipeobjs$(C) \
+$(DG)sproingies$(CG)sproingiewrap$(CG)s1_b$(C) \
+$(DG)s1_1$(CG)s1_2$(CG)s1_3$(CG)s1_4$(CG)s1_5$(CG)s1_6$(C) \
+$(DG)atlantis$(CG)dolphin$(CG)shark$(CG)swim$(CG)whale$(C) \
+$(DG)bubble3d$(CG)b_draw$(CG)b_sphere$(CG)b_lockglue$(C) \
+$(DG)invert$(CG)i_figureeight$(CXG)i_linkage$(CX) \
+$(DG)i_sphere$(CXG)i_spline$(CX) \
+$(DG)i_threejet$(CXG)i_threejetvec$(CX) \
+$(DG)i_twojet$(CXG)i_twojetvec$(CXG)text3d$(CX)
+XLOCKBOMBSRCS = $(DM)bomb$(C)
+XLOCKUTILMODESRCS = $(XLOCKBOMBSRCS) $(DM)blank$(CM)random$(C)
+XLOCKSRCS = $(XLOCKUTILSRCS) $(XLOCKCHECKSRCS) $(XLOCKUNSTABLESRCS) \
+$(XLOCKCPPSRCS) $(XLOCKXPMSRCS) $(XLOCKGLSRCS) \
+$(XLOCKMODESRCS) $(XLOCKUTILMODESRCS)
+
+AllTarget($(UTILDIR)xlock)
+#ifdef XpmLibrary
+depend:: $(BITMAPS) $(PIXMAPS)
+#else
+depend:: $(BITMAPS)
+#endif
+
+#ifdef Modules
+
+NORMMODULES = $(XLOCKNORMMODEOBJS:.o=.xlk)
+
+MULTMODULES = $(XLOCKMULTMODEOBJS:.o=.xlk)
+
+MODULES = $(NORMMODULES) $(MULTMODULES)
+
+EXTRA_LDOPTIONS += $(MODULEFLAGS)
+AllTarget($(MODULES) $(UTILDIR)xlock)
+
+NormalProgramTarget($(UTILDIR)xlock, $(XLOCKALLUTILOBJS), $(DEPXLIB), $(LOCAL_LIBRARIES), NullParameter)
+
+InstallMultiple($(MODULES), $(DEF_MODULEPATH))
+
+$(CX)$(O) :
+       $(CXX) -c -o $@ $(CFLAGS) $<
+XCOMM  Sun and gcc
+XCOMM  $(CXX) -c -o $@ -isystem /usr/openwin/include $(CFLAGS) $<
+
+$(NORMMODULES) : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $<
+
+#ifdef GLLibrary
+
+$(DOG)fire.xlk : $(DOG)xpm-ximage.o
+$(DOG)lament.xlk : $(DOG)xpm-ximage.o
+$(DOG)sballs.xlk : $(DOG)xpm-ximage.o
+
+$(DOG)fire.xlk $(DOG)lament.xlk $(DOG)sballs.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(DOG)xpm-ximage.o $<
+
+$(DOG)pipes.xlk : $(DOG)buildlwo.o $(DOG)pipeobjs.o
+
+$(DOG)pipes.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(DOG)buildlwo.o $(DOG)pipeobjs.o $<
+
+$(DOG)sproingies.xlk : $(SPROINGIESOBJS)
+
+$(DOG)sproingies.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(SPROINGIESOBJS) $<
+
+$(DOG)atlantis.xlk : $(ATLANTISOBJS)
+
+$(DOG)atlantis.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(ATLANTISOBJS) $<
+
+$(DOG)bubble3d.xlk : $(BUBBLE3DOBJS)
+
+$(DOG)bubble3d.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(BUBBLE3DOBJS) $<
+
+#ifdef CPPCompiler
+
+$(DOG)invert.xlk : $(INVERTOBJS)
+
+$(DOG)invert.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(INVERTOBJS) $<
+#endif
+
+#endif
+
+clean::
+       $(RM) *.xlk .pure
+
+#else
+
+NormalProgramTarget($(UTILDIR)xlock, $(XLOCKOBJS), $(DEPXLIB), $(LOCAL_LIBRARIES), NullParameter)
+
+#endif
+
+DependTarget()
+LintTarget()
+
+bat$(O) : bat$(C) bat.xbm bat.xpm
+bounce$(O) : bounce$(C) bounce.xbm bounce.xpm
+decay$(O) : decay$(C) decay.xbm decay.xpm
+eyes$(O) : eyes$(C) eyes.xbm eyes2.xbm
+life$(O) : life$(C) life.xbm life2.xbm
+life1d$(O) : life1d$(C) life1d.xbm
+pacman$(O) : pacman$(C) ghost.xbm
+# Do not need xpm files if not using them but not worth figuring out
+flag$(O) : flag$(C) flag.xbm flag.xpm
+image$(O) : image$(C) image.xbm image.xpm
+maze$(O) : maze$(C) maze.xbm maze.xpm
+puzzle$(O) : puzzle$(C) puzzle.xbm puzzle.xpm
+
+bat.xbm : $(BITMAPDIR)$(BATBITMAP).xbm
+       $(RM) bat.xbm ; $(LN_S) $(BITMAPDIR)$(BATBITMAP).xbm bat.xbm
+
+bounce.xbm : $(BITMAPDIR)$(BOUNCEBITMAP).xbm
+       $(RM) bounce.xbm ; $(LN_S) $(BITMAPDIR)$(BOUNCEBITMAP).xbm bounce.xbm
+
+decay.xbm : $(BITMAPDIR)$(DECAYBITMAP).xbm
+       $(RM) decay.xbm ; $(LN_S) $(BITMAPDIR)$(DECAYBITMAP).xbm decay.xbm
+
+earth.xbm : $(BITMAPDIR)$earth.xbm
+       $(RM) earth.xbm ; $(LN_S) $(BITMAPDIR)$earth.xbm earth.xbm
+
+eyes.xbm : $(BITMAPDIR)$(EYESBITMAP).xbm
+       $(RM) eyes.xbm ; $(LN_S) $(BITMAPDIR)$(EYESBITMAP).xbm eyes.xbm
+
+eyes2.xbm : $(BITMAPDIR)m-grelb-2.xbm
+       $(RM) eyes2.xbm ; $(LN_S) $(BITMAPDIR)m-grelb-2.xbm eyes2.xbm
+
+flag.xbm : $(BITMAPDIR)$(FLAGBITMAP).xbm
+       $(RM) flag.xbm ; $(LN_S) $(BITMAPDIR)$(FLAGBITMAP).xbm flag.xbm
+
+image.xbm : $(BITMAPDIR)$(IMAGEBITMAP).xbm
+       $(RM) image.xbm ; $(LN_S) $(BITMAPDIR)$(IMAGEBITMAP).xbm image.xbm
+
+ghost.xbm : $(BITMAPDIR)$(PACMANBITMAP).xbm
+       $(RM) ghost.xbm ; $(LN_S) $(BITMAPDIR)$(PACMANBITMAP).xbm ghost.xbm
+
+life.xbm : $(BITMAPDIR)$(LIFEBITMAP).xbm
+       $(RM) life.xbm ; $(LN_S) $(BITMAPDIR)$(LIFEBITMAP).xbm life.xbm
+
+life2.xbm : $(BITMAPDIR)s-grelb-2.xbm
+       $(RM) life2.xbm ; $(LN_S) $(BITMAPDIR)s-grelb-2.xbm life2.xbm
+
+life1d.xbm : $(BITMAPDIR)$(LIFE1DBITMAP).xbm
+       $(RM) life1d.xbm ; $(LN_S) $(BITMAPDIR)$(LIFE1DBITMAP).xbm life1d.xbm
+
+maze.xbm : $(BITMAPDIR)$(MAZEBITMAP).xbm
+       $(RM) maze.xbm ; $(LN_S) $(BITMAPDIR)$(MAZEBITMAP).xbm maze.xbm
+
+puzzle.xbm : $(BITMAPDIR)$(PUZZLEBITMAP).xbm
+       $(RM) puzzle.xbm ; $(LN_S) $(BITMAPDIR)$(PUZZLEBITMAP).xbm puzzle.xbm
+
+bat.xpm : $(PIXMAPDIR)$(BATPIXMAP).xpm
+       $(RM) bat.xpm ; $(LN_S) $(PIXMAPDIR)$(BATPIXMAP).xpm bat.xpm
+
+bounce.xpm : $(PIXMAPDIR)$(BOUNCEPIXMAP).xpm
+       $(RM) bounce.xpm ; $(LN_S) $(PIXMAPDIR)$(BOUNCEPIXMAP).xpm bounce.xpm
+
+decay.xpm : $(PIXMAPDIR)$(DECAYPIXMAP).xpm
+       $(RM) decay.xpm ; $(LN_S) $(PIXMAPDIR)$(DECAYPIXMAP).xpm decay.xpm
+
+flag.xpm : $(PIXMAPDIR)$(FLAGPIXMAP).xpm
+       $(RM) flag.xpm ; $(LN_S) $(PIXMAPDIR)$(FLAGPIXMAP).xpm flag.xpm
+
+image.xpm : $(PIXMAPDIR)$(IMAGEPIXMAP).xpm
+       $(RM) image.xpm ; $(LN_S) $(PIXMAPDIR)$(IMAGEPIXMAP).xpm image.xpm
+
+life.xpm : $(PIXMAPDIR)$(LIFEPIXMAP).xpm
+       $(RM) life.xpm ; $(LN_S) $(PIXMAPDIR)$(LIFEPIXMAP).xpm life.xpm
+
+maze.xpm : $(PIXMAPDIR)$(MAZEPIXMAP).xpm
+       $(RM) maze.xpm ; $(LN_S) $(PIXMAPDIR)$(MAZEPIXMAP).xpm maze.xpm
+
+puzzle.xpm : $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm
+       $(RM) puzzle.xpm ; $(LN_S) $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm puzzle.xpm
+
+$(UTILOBJDIR)xlock.o : $(UTILDIR)xlock.c
+$(UTILOBJDIR)passwd.o : $(UTILDIR)passwd.c
+$(UTILOBJDIR)resource.o : $(UTILDIR)resource.c
+$(UTILOBJDIR)parsecmd.o : $(UTILDIR)parsecmd.c
+$(UTILOBJDIR)util.o : $(UTILDIR)util.c
+$(UTILOBJDIR)logout.o : $(UTILDIR)logout.c
+$(UTILOBJDIR)mode.o : $(UTILDIR)mode.c
+$(UTILOBJDIR)ras.o : $(UTILDIR)ras.c
+$(UTILOBJDIR)xbm.o : $(UTILDIR)xbm.c
+$(UTILOBJDIR)vis.o : $(UTILDIR)vis.c
+$(UTILOBJDIR)visgl.o : $(UTILDIR)visgl.c
+$(UTILOBJDIR)color.o : $(UTILDIR)color.c
+$(UTILOBJDIR)random.o : $(UTILDIR)random.c
+$(UTILOBJDIR)iostuff.o : $(UTILDIR)iostuff.c
+$(UTILOBJDIR)automata.o : $(UTILDIR)automata.c
+$(UTILOBJDIR)spline.o : $(UTILDIR)spline.c
+$(UTILOBJDIR)sound.o : $(UTILDIR)sound.c
+$(UTILOBJDIR)erase.o : $(UTILDIR)erase.c
+$(UTILOBJDIR)vtlock.o : $(UTILDIR)vtlock.c
+$(UTILOBJDIR)vtlock_proc.o : $(UTILDIR)vtlock_proc.c
+$(UTILOBJDIR)memcheck.o : $(UTILDIR)memcheck.c
+
+$(XLOCKUTILOBJS) :
+       cd $(UTILOBJDIR) ; \
+$(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+$(GLOBJDIR)cage.o : $(GLDIR)cage.c
+$(GLOBJDIR)fire.o : $(GLDIR)fire.c
+$(GLOBJDIR)gears.o : $(GLDIR)gears.c
+$(GLOBJDIR)glplanet.o : $(GLDIR)glplanet.c
+$(GLOBJDIR)sphere.o : $(GLDIR)sphere.c
+$(GLOBJDIR)lament.o : $(GLDIR)lament.c
+$(GLOBJDIR)moebius.o : $(GLDIR)moebius.c
+$(GLOBJDIR)molecule.o : $(GLDIR)molecule.c
+$(GLOBJDIR)tube.o : $(GLDIR)tube.c
+$(GLOBJDIR)morph3d.o : $(GLDIR)morph3d.c
+$(GLOBJDIR)rubik.o : $(GLDIR)rubik.c
+$(GLOBJDIR)sballs.o : $(GLDIR)sballs.c
+$(GLOBJDIR)stairs.o : $(GLDIR)stairs.c
+$(GLOBJDIR)sierpinski3d.o : $(GLDIR)sierpinski3d.c
+$(GLOBJDIR)superquadrics.o : $(GLDIR)superquadrics.c
+$(GLOBJDIR)buildlwo.o : $(GLDIR)buildlwo.c
+$(GLOBJDIR)pipes.o : $(GLDIR)pipes.c
+$(GLOBJDIR)pipeobjs.o : $(GLDIR)pipeobjs.c
+$(GLOBJDIR)sproingies.o : $(GLDIR)sproingies.c
+$(GLOBJDIR)sproingiewrap.o : $(GLDIR)sproingiewrap.c
+$(GLOBJDIR)s1_b.o : $(GLDIR)s1_b.c
+$(GLOBJDIR)s1_1.o : $(GLDIR)s1_1.c
+$(GLOBJDIR)s1_2.o : $(GLDIR)s1_2.c
+$(GLOBJDIR)s1_3.o : $(GLDIR)s1_3.c
+$(GLOBJDIR)s1_4.o : $(GLDIR)s1_4.c
+$(GLOBJDIR)s1_5.o : $(GLDIR)s1_5.c
+$(GLOBJDIR)s1_6.o : $(GLDIR)s1_6.c
+$(GLOBJDIR)atlantis.o : $(GLDIR)atlantis.c
+$(GLOBJDIR)swim.o : $(GLDIR)swim.c
+$(GLOBJDIR)dolphin.o : $(GLDIR)dolphin.c
+$(GLOBJDIR)shark.o : $(GLDIR)shark.c
+$(GLOBJDIR)whale.o : $(GLDIR)whale.c
+$(GLOBJDIR)bubble3d.o : $(GLDIR)bubble3d.c
+$(GLOBJDIR)b_draw.o : $(GLDIR)b_draw.c
+$(GLOBJDIR)b_lockglue.o : $(GLDIR)b_lockglue.c
+$(GLOBJDIR)b_sphere.o : $(GLDIR)b_sphere.c
+$(GLOBJDIR)invert.o : $(GLDIR)invert.c
+$(GLOBJDIR)i_figureeight.o : $(GLDIR)i_figureeight.cc
+$(GLOBJDIR)i_linkage.o : $(GLDIR)i_linkage.cc
+$(GLOBJDIR)i_sphere.o : $(GLDIR)i_sphere.cc
+$(GLOBJDIR)i_spline.o : $(GLDIR)i_spline.cc
+$(GLOBJDIR)i_threejet.o : $(GLDIR)i_threejet.cc
+$(GLOBJDIR)i_threejetvec.o : $(GLDIR)i_threejetvec.cc
+$(GLOBJDIR)i_twojet.o : $(GLDIR)i_twojet.cc
+$(GLOBJDIR)i_twojetvec.o : $(GLDIR)i_twojetvec.cc
+$(GLOBJDIR)skewb.o : $(GLDIR)skewb.c
+$(GLOBJDIR)text3d.o : $(GLDIR)text3d.cc
+
+$(XLOCKGLOBJS) :
+       cd $(GLDIR) ; \
+$(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+XLOCKINC = -I$(top_srcdir) -I. -I$(UTILDIR) -I../$(UTILDIR) -I../..
+
+distclean:: clean
+       $(RM) Makefile $(BITMAPS) $(PIXMAPS) \
+config.status config.cache config.log config.h
+
+clean.all:: distclean
diff --git a/modes/Makefile.in b/modes/Makefile.in
new file mode 100644 (file)
index 0000000..560ecc3
--- /dev/null
@@ -0,0 +1,1608 @@
+# $Id : Makefile.in 4.16 2000/01/17 $
+#
+# xlockmore Makefile.in for autoconf (UNIX/VMS X11 support)
+############################################################
+
+# @SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@/
+BITMAPDIR = @BITMAPDIR@/
+PIXMAPDIR = @PIXMAPDIR@/
+UTILDIR = $(top_srcdir)/xlock/
+GLDIR = $(top_srcdir)/modes/glx/
+UTILOBJDIR = ../xlock/
+GLOBJDIR = glx/
+
+N =
+O = .o
+#O = .obj
+C = .c
+CX = .cc
+S = $(N) $(N)
+#S = ,
+M = .xlk
+
+DM = $(VPATH)
+DOM =
+DU = $(UTILDIR)
+DOU = $(UTILOBJDIR)
+DG = $(GLDIR)
+DOG = $(GLOBJDIR)
+OM = $(O)$(S)$(DOM)
+OU = $(O)$(S)$(DOU)
+OG = $(O)$(S)$(DOG)
+CM = $(C) $(DM)
+CU = $(C) $(DU)
+CG = $(C) $(DG)
+CXM = $(CX) $(DM)
+CXG = $(CX) $(DG)
+
+# please define
+# C as the C source code extension
+# CX as the C++ source code extension
+# O as the object extension
+# S as the separator for object code
+
+# List of object files
+XLOCKUTILOBJS = $(DOU)xlock$(OU)passwd$(OU)resource$(OU)parsecmd$(O)$(S)\
+$(DOU)util$(OU)logout$(OU)mode$(OU)xlockimage$(OU)ras$(OU)xbm$(O)$(S)\
+$(DOU)vis$(OU)visgl$(OU)color$(OU)random$(OU)iostuff$(OU)automata$(O)$(S)\
+$(DOU)spline$(OU)sound$(OU)erase$(OU)magick$(O)$(S)\
+$(DOU)vtlock$(OU)vtlock_proc$(O)
+
+# This debugging is new and is untested on many systems.
+@CHECK@CHECKDEF = -DDEBUG
+@CHECK@CHECKLDFLAG = -g
+@CHECK@XLOCKCHECKOBJS = $(DOU)memcheck$(O)
+
+XLOCKMODEOBJS = $(DOM)ant$(OM)ball$(OM)bat$(OM)blot$(OM)\
+bouboule$(OM)bounce$(OM)braid$(OM)bubble$(OM)bug$(OM)\
+clock$(OM)coral$(OM)crystal$(OM)\
+daisy$(OM)dclock$(OM)decay$(OM)deco$(OM)demon$(OM)\
+dilemma$(OM)discrete$(OM)dragon$(OM)drift$(OM)euler2d$(OM)eyes$(OM)\
+fadeplot$(OM)flag$(OM)flame$(OM)flow$(OM)forest$(OM)\
+galaxy$(OM)goop$(OM)grav$(OM)\
+helix$(OM)hop$(OM)hyper$(OM)\
+ico$(OM)ifs$(OM)image$(OM)juggle$(OM)julia$(OM)kaleid$(OM)kumppa$(OM)\
+laser$(OM)life$(OM)life1d$(OM)life3d$(OM)\
+lightning$(OM)lisa$(OM)lissie$(OM)loop$(OM)lyapunov$(OM)\
+mandelbrot$(OM)marquee$(OM)matrix$(OM)maze$(OM)\
+mountain$(OM)munch$(OM)nose$(OM)\
+pacman$(OM)penrose$(OM)petal$(OM)polyominoes$(OM)puzzle$(OM)pyro$(OM)\
+qix$(OM)roll$(OM)rotor$(OM)\
+scooter$(OM)shape$(OM)sierpinski$(OM)slip$(OM)\
+space$(OM)sphere$(OM)spiral$(OM)spline$(OM)\
+star$(OM)starfish$(OM)strange$(OM)swarm$(OM)swirl$(OM)\
+t3d$(OM)tetris$(OM)thornbird$(OM)tik_tak$(OM)\
+triangle$(OM)tube$(OM)turtle$(OM)\
+vines$(OM)voters$(OM)\
+wator$(OM)wire$(OM)world$(OM)worm$(OM)xcl$(OM)xjack$(O)
+#@UNSTABLE@CONSTRUCTIONOBJS =
+#@UNSTABLE@@CCC@CONSTRUCTIONCPPOBJS = $(DOM)billiards$(O)
+@UNSTABLE@XLOCKUNSTABLEOBJS = $(DOM)run$(O)$(S)$(CONSTRUCTIONOBJS)
+@CCC@XLOCKCPPOBJS = $(DOM)solitare$(O)$(S)$(CONSTRUCTIONCPPOBJS)
+@XPM@XLOCKXPMOBJS =
+#@GL@CONSTRUCTIONGLOBJS =
+@UNSTABLE@@GL@XLOCKUNSTABLEGLOBJS = $(DOG)skewb$(O)$(S)$(CONSTRUCTIONGLOBJS)
+@CCC@@GL@INVERTOBJS = $(DOG)i_figureeight$(O)$(S)\
+@CCC@@GL@$(DOG)i_linkage$(OG)i_sphere$(OG)i_spline$(O)$(S)\
+@CCC@@GL@$(DOG)i_threejet$(OG)i_threejetvec$(O)$(S)\
+@CCC@@GL@$(DOG)i_twojet$(OG)i_twojetvec$(O)
+@CCC@@GL@XLOCKDEPCPPGLOBJS = $(INVERTOBJS)
+@CCC@@GL@XLOCKMULTCPPGLOBJS = $(DOG)invert$(O)
+@UNSTABLE@@CCC@@GL@@GLTT@XLOCKUNSTABLETEXTGLOBJS = $(DOG)text3d$(O)
+@GL@SPROINGIESOBJS = $(DOG)buildlwo$(OG)sproingiewrap$(OG)s1_b$(O)$(S)\
+@GL@$(DOG)s1_1$(OG)s1_2$(OG)s1_3$(OG)s1_4$(OG)s1_5$(OG)s1_6$(O)
+@GL@ATLANTISOBJS = $(DOG)dolphin$(OG)shark$(OG)swim$(OG)whale$(O)
+@GL@MOLECULEOBJS = $(DOG)tube$(O)
+@GL@BUBBLE3DOBJS = $(DOG)b_draw$(OG)b_sphere$(OG)b_lockglue$(O)
+@GL@GLPLANETOBJS = $(DOG)sphere$(O)
+@GL@XLOCKDEPGLOBJS = $(DOG)xpm-ximage$(OG)pipeobjs$(O)$(S)\
+@GL@$(SPROINGIESOBJS)$(S)$(ATLANTISOBJS)$(S)$(GLPLANETOBJS)$(S)$(BUBBLE3DOBJS)$(S)\
+@GL@$(MOLECULEOBJS)$(S)$(XLOCKDEPCPPGLOBJS)
+@GL@XLOCKNORMGLOBJS = $(DOG)cage$(OG)gears$(O)$(S)\
+@GL@$(DOG)moebius$(OG)morph3d$(O)$(S)\
+@GL@$(DOG)rubik$(OG)sierpinski3d$(OG)stairs$(OG)superquadrics$(O)$(S)\
+@GL@$(XLOCKUNSTABLEGLOBJS)$(S)$(XLOCKUNSTABLETEXTGLOBJS)
+@GL@XLOCKMULTGLOBJS = $(DOG)fire$(OG)lament$(OG)sballs$(OG)molecule$(O)$(S)\
+@GL@$(DOG)pipes$(OG)sproingies$(OG)atlantis$(OG)bubble3d$(OG)glplanet$(O)$(S)\
+@GL@$(XLOCKMULTCPPGLOBJS)
+XLOCKGLOBJS = $(XLOCKNORMGLOBJS)$(S)\
+$(XLOCKDEPGLOBJS)$(S)$(XLOCKMULTGLOBJS)
+@BOMB@XLOCKBOMBOBJS = $(DOM)bomb$(O)
+XLOCKUTILMODEOBJS = $(XLOCKBOMBOBJS)$(S)$(DOM)blank$(OM)random$(O)
+XLOCKNORMMODEOBJS = $(XLOCKMODEOBJS)$(S)$(XLOCKUNSTABLEOBJS)$(S)\
+$(XLOCKCPPOBJS)$(S)$(XLOCKXPMOBJS)$(S)$(XLOCKNORMGLOBJS)$(S)\
+$(XLOCKUTILMODEOBJS)
+XLOCKMULTMODEOBJS = $(XLOCKMULTGLOBJS)
+XLOCKALLUTILOBJS = $(XLOCKUTILOBJS)$(S)$(XLOCKCHECKOBJS)
+XLOCKOBJS = $(XLOCKALLUTILOBJS)$(S)$(XLOCKNORMMODEOBJS)$(S)\
+$(XLOCKDEPGLOBJS)$(S)$(XLOCKMULTGLOBJS)
+
+@MODULES@NORMMODULES = $(XLOCKNORMMODEOBJS:.o=.xlk)
+
+@MODULES@MULTMODULES = $(XLOCKMULTMODEOBJS:.o=.xlk)
+
+MODULES = $(NORMMODULES) $(MULTMODULES)
+
+# List of source files
+BITMAPS = bat.xbm bounce.xbm decay.xbm earth.xbm eyes.xbm eyes2.xbm flag.xbm \
+ghost.xbm image.xbm life.xbm life2.xbm life1d.xbm maze.xbm puzzle.xbm
+PIXMAPS = bat.xpm bounce.xpm decay.xpm flag.xpm image.xpm maze.xpm \
+puzzle.xpm
+# life.xpm
+XLOCKUTILHDRS = xlock.h mode.h vroot.h xlockimage.h ras.h \
+version.h config.h
+XLOCKCHECKSRCS = $(DU)memcheck$(C)
+XLOCKUTILSRCS = $(DU)xlock$(CU)passwd$(CU)resource$(CU)parsecmd$(C) \
+$(DU)util$(CU)logout$(CU)mode$(CU)xlockimage$(CU)ras$(CU)xbm$(C) \
+$(DU)vis$(CU)visgl$(CU)color$(CU)random$(CU)iostuff$(CU)automata$(C) \
+$(DU)spline$(CU)sound$(CU)erase$(CU)magick$(C) \
+$(DU)vtlock$(CU)vtlock_proc$(C) $(XLOCKCHECKSRCS)
+
+XLOCKMODESRCS = $(DM)ant$(CM)ball$(CM)bat$(CM)blot$(C) \
+$(DM)bouboule$(CM)bounce$(CM)braid$(CM)bubble$(CM)bug$(C) \
+$(DM)clock$(CM)coral$(CM)crystal$(C) \
+$(DM)daisy$(CM)dclock$(CM)decay$(CM)deco$(CM)demon$(C) \
+$(DM)dilemma$(CM)discrete$(CM)dragon$(CM)drift$(CM)euler2d$(CM)eyes$(C) \
+$(DM)fadeplot$(CM)flag$(CM)flame$(CM)flow$(CM)forest$(C) \
+$(DM)galaxy$(CM)goop$(CM)grav$(C) \
+$(DM)helix$(CM)hop$(CM)hyper$(C) \
+$(DM)ico$(CM)ifs$(CM)image$(CM)juggle$(CM)julia$(CM)kaleid$(CM)kumppa$(C) \
+$(DM)laser$(CM)life$(CM)life1d$(CM)life3d$(C) \
+$(DM)lightning$(CM)lisa$(CM)lissie$(CM)loop$(CM)lyapunov$(C) \
+$(DM)mandelbrot$(CM)marquee$(CM)matrix$(CM)maze$(C) \
+$(DM)mountain$(CM)munch$(CM)nose$(C) \
+$(DM)pacman$(CM)penrose$(CM)petal$(CM)polyominoes$(CM)puzzle$(CM)pyro$(C) \
+$(DM)qix$(CM)roll$(CM)rotor$(C) \
+$(DM)scooter$(CM)shape$(CM)sierpinski$(CM)slip$(C) \
+$(DM)space$(CM)sphere$(CM)spiral$(CM)spline$(C) \
+$(DM)star$(CM)starfish$(CM)strange$(CM)swarm$(CM)swirl$(C) \
+$(DM)t3d$(CM)tetris$(CM)thornbird$(C) \
+$(DM)tik_tak$(CM)triangle$(CM)tube$(CM)turtle$(C) \
+$(DM)vines$(CM)voters$(C) \
+$(DM)wator$(CM)wire$(CM)world$(CM)worm$(CM)xcl$(CM)xjack$(C)
+#CONSTRUCTIONSRCS =
+#CONSTRUCTIONCPPSRCS = $(DM)billiards$(CX)
+@UNSTABLE@XLOCKUNSTABLESRCS = $(DM)space$(CM)run$(C) $(CONTRUCTIONSRCS)
+@CCC@XLOCKCPPSRCS = $(DM)solitare$(CX) $(CONTRUCTIONCPPSRCS)
+@XPM@XLOCKXPMSRCS =
+@GL@XLOCKGLSRCS = $(DG)cage$(CG)fire$(CG)gears$(C) \
+@GL@$(DG)glplanet$(CG)sphere$(CG)lament$(CG)moebius$(CG)morph3d$(C) \
+@GL@$(DG)rubik$(CG)skewb$(CG)sballs$(C) \
+@GL@$(DG)sierpinski3d$(CG)stairs$(CG)superquadrics$(C) \
+@GL@$(DG)molecule$(CG)tube$(C) \
+@GL@$(DG)xpm-ximage$(CG)buildlwo$(CG)pipes$(CG)pipeobjs$(C) \
+@GL@$(DG)sproingies$(CG)sproingiewrap$(CG)s1_b$(C) \
+@GL@$(DG)s1_1$(CG)s1_2$(CG)s1_3$(CG)s1_4$(CG)s1_5$(CG)s1_6$(C) \
+@GL@$(DG)atlantis$(CG)dolphin$(CG)shark$(CG)swim$(CG)whale$(C) \
+@GL@$(DG)bubble3d$(CG)b_draw$(CG)b_sphere$(CG)b_lockglue$(C) \
+@GL@$(DG)invert$(CG)i_figureeight$(CXG)i_linkage$(CX) \
+@GL@$(DG)i_sphere$(CXG)i_spline$(CX) \
+@GL@$(DG)i_threejet$(CXG)i_threejetvec$(CX) \
+@GL@$(DG)i_twojet$(CXG)i_twojetvec$(CXG)text3d$(CX)
+@BOMB@XLOCKBOMBSRCS = $(DM)bomb$(C)
+XLOCKUTILMODESRCS = $(XLOCKBOMBSRCS) $(DM)blank$(CM)random$(C)
+XLOCKSRCS = $(XLOCKUTILSRCS) $(XLOCKCHECKSRCS) $(XLOCKUNSTABLESRCS) \
+$(XLOCKCPPSRCS) $(XLOCKXPMSRCS) $(XLOCKGLSRCS) \
+$(XLOCKMODESRCS) $(XLOCKUTILMODESRCS)
+
+# default target
+all : $(MODULES) $(XLOCKOBJS) $(UTILOBJDIR)xlock
+
+# this tells GNU make not to export variables into the environment
+# But other makes do not understand its significance, so it must
+# not be the first target in the file. So it is here, before
+# any variables are created, but after the default target
+.NOEXPORT :
+
+SHELL = /bin/sh
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+mandir = @mandir@/man1
+xapploaddir = @APPDEFAULTS@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTPGMFLAGS = @INSTPGMFLAGS@
+
+
+#CC = cc -g
+#CC = cc -Ac -g
+#CC = cc -Xc -g
+#CC = acc -g
+#CC = CC -g
+#CC = gcc -g -Wall -ansi -pedantic
+#CC = gcc -g -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wstrict-prototypes
+#CC = g++ -g -Wall
+CC = @CC@
+#CXX = g++ -fpermissive
+CXX = @CXX@
+
+#LINT = lint
+LINT = lint -Ncheck=%all
+#LINT = alint
+
+#DEPEND = makedepend
+DEPEND = @DEPEND@
+DEPEND_FLAGS = @DEPEND_FLAGS@
+DEPEND_DEFINES = @DEPEND_DEFINES@
+
+#BITMAPTYPE = x11
+#PIXMAPTYPE = x11
+BITMAPTYPE = @BITMAPTYPE@
+PIXMAPTYPE = @PIXMAPTYPE@
+
+# Here is your chance to override the default icon:
+TINYBITMAP = $(BITMAPTYPE)
+TINYBITMAP = t-x11
+SMALLBITMAP = s-$(BITMAPTYPE)
+MEDIUMBITMAP = m-$(BITMAPTYPE)
+LARGEBITMAP = l-$(BITMAPTYPE)
+SMALLPIXMAP = m-$(PIXMAPTYPE)
+MEDIUMPIXMAP = m-$(PIXMAPTYPE)
+LARGEPIXMAP = l-$(PIXMAPTYPE)
+
+#BATBITMAP = $(LARGEBITMAP)
+BATBITMAP = l-xlock
+#BATBITMAP = l-linux
+#BOUNCEBITMAP = $(LARGEBITMAP)
+BOUNCEBITMAP = l-xlock
+#BOUNCEBITMAP = l-linux
+#DECAYBITMAP = $(LARGEBITMAP)
+DECAYBITMAP = l-xlock
+#DECAYBITMAP = l-linux
+#EYESBITMAP = $(MEDIUMBITMAP)
+EYESBITMAP = m-grelb
+FLAGBITMAP = $(MEDIUMBITMAP)
+IMAGEBITMAP = $(MEDIUMBITMAP)
+#IMAGEBITMAP = l-bob #Slackware icon
+#IMAGEBITMAP = m-xlock #XLock icon
+#LIFEBITMAP = $(SMALLBITMAP)
+LIFEBITMAP = s-grelb
+LIFE1DBITMAP = $(TINYBITMAP)
+MAZEBITMAP = $(LARGEBITMAP)
+#MAZEBITMAP = m-xlock
+#PACMANBITMAP = $(MEDIUMBITMAP)
+PACMANBITMAP = m-ghost
+#PUZZLEBITMAP = $(LARGEBITMAP)
+PUZZLEBITMAP = l-xlock
+#PUZZLEBITMAP = l-linux
+#BATPIXMAP = $(LARGEPIXMAP)
+BATPIXMAP = l-xlock
+#BATPIXMAP = l-linux
+#BOUNCEPIXMAP = $(LARGEPIXMAP)
+BOUNCEPIXMAP = l-xlock
+#BOUNCEPIXMAP = l-linux
+#DECAYPIXMAP = $(LARGEPIXMAP)
+DECAYPIXMAP = l-xlock
+#DECAYPIXMAP = l-linux
+#FLAGPIXMAP = m-xlock
+FLAGPIXMAP = $(MEDIUMPIXMAP)
+#FLAGPIXMAP = m-xlock
+IMAGEPIXMAP = $(MEDIUMPIXMAP)
+#IMAGEPIXMAP = m-xlock
+LIFEPIXMAP = s-grelb
+MAZEPIXMAP = $(MEDIUMPIXMAP)
+#MAZEPIXMAP = m-xlock
+#PUZZLEPIXMAP = $(LARGEPIXMAP)
+PUZZLEPIXMAP = l-xlock
+#PUZZLEPIXMAP = l-linux
+
+LN_S = @LN_S@
+RM = rm -f
+RM_S = $(RM)
+ECHO = echo
+
+#BLN_S = set file/enter=[]
+#RM = delete/noconfirm/nolog
+#RM_S = set file/remove/nolog
+#ECHO = write sys$output
+
+MODULEFLAGS = @MODULEFLAGS@
+@MODULES@MODULELIB = -ldl
+DEF_MODULEPATH = $(prefix)/lib/xlock_modules
+@MODULES@MODULEDEF = -DDEF_MODULEPATH=\"$(DEF_MODULEPATH)\"
+DEFINES = -DDEF_FILESEARCHPATH=\"$(xapploaddir)/%N%C%S:$(xapploaddir)/%N%S\" $(MODULEDEF) $(CHECKDEF)
+DEFS = @DEFS@ $(DEFINES)
+XLOCKINC = -I. -I.. -I$(UTILDIR) -I../.. @XLOCKINC@
+CFLAGS = @CFLAGS@
+CXXFLAGS = @CXXFLAGS@
+#CFLAGS = -O
+#CFLAGS = -g
+XLOCKLDFLAGS = @XLOCKLDFLAGS@ $(CHECKLDFLAG)
+XLIBS = @XLIBS@
+XLOCKLIBS = $(MODULELIB) @XLOCKLIBS@
+
+####
+#### These might have become not necessary as configure do the job
+#### It check for pthread, svga & glide in MesaGL lib and add each of them
+#### if they was linked against.
+####
+#MesaGL threads
+#XLOCKLIBS = @XLOCKLIBS@ -lpthread
+#MesaGL vga
+#XLOCKLIBS = @XLOCKLIBS@ -lvga
+#3Dfx Glide VooDoo graphics device driver for MesaGL >= 2.3?  _NOT_ tested.
+#XLOCKLIBS = @XLOCKLIBS@ -lglide -ltexus
+####
+####
+
+#SAFEWORD
+#XLOCKLIBS = @XLOCKLIBS@ -lidpb
+#If you have purify, and want to use it, uncomment this definition or
+# run the make as `make PURIFY=purify'
+# or run configure with the --with-purify argument.
+PURIFY = @PURIFY@
+
+@MODULES@$(NORMMODULES) : %.xlk:%.o
+@MODULES@      $(RM) $@
+@MODULES@      $(CXX) $(CXXFLAGS) -shared -o $@ $<
+
+$(DOG)fire.xlk : $(DOG)xpm-ximage.o
+$(DOG)lament.xlk : $(DOG)xpm-ximage.o
+$(DOG)sballs.xlk : $(DOG)xpm-ximage.o
+
+@MODULES@@GL@$(DOG)fire.xlk $(DOG)lament.xlk $(DOG)sballs.xlk : %.xlk:%.o
+@MODULES@@GL@  $(RM) $@
+@MODULES@@GL@  $(CXX) $(CXXFLAGS) -shared -o $@ $(DOG)xpm-ximage.o $<
+
+$(DOG)pipes.xlk : $(DOG)buildlwo.o $(DOG)pipeobjs.o
+
+@MODULES@@GL@$(DOG)pipes.xlk : %.xlk:%.o
+@MODULES@@GL@  $(RM) $@
+@MODULES@@GL@  $(CXX) $(CXXFLAGS) -shared -o $@ $(DOG)buildlwo.o $(DOG)pipeobjs.o $<
+
+$(DOG)sproingies.xlk : $(SPROINGIESOBJS)
+
+@MODULES@@GL@$(DOG)sproingies.xlk : %.xlk:%.o
+@MODULES@@GL@  $(RM) $@
+@MODULES@@GL@  $(CXX) $(CXXFLAGS) -shared -o $@ $(SPROINGIESOBJS) $<
+
+$(DOG)atlantis.xlk : $(ATLANTISOBJS)
+
+@MODULES@@GL@$(DOG)atlantis.xlk : %.xlk:%.o
+@MODULES@@GL@  $(RM) $@
+@MODULES@@GL@  $(CXX) $(CXXFLAGS) -shared -o $@ $(ATLANTISOBJS) $<
+
+$(DOG)bubble3d.xlk : $(BUBBLE3DOBJS)
+
+@MODULES@@GL@$(DOG)bubble3d.xlk : %.xlk:%.o
+@MODULES@@GL@  $(RM) $@
+@MODULES@@GL@  $(CXX) $(CXXFLAGS) -shared -o $@ $(BUBBLE3DOBJS) $<
+
+$(DOG)invert.xlk : $(INVERTOBJS)
+
+@MODULES@@CCC@@GL@$(DOG)invert.xlk : %.xlk:%.o
+@MODULES@@CCC@@GL@     $(RM) $@
+@MODULES@@CCC@@GL@     $(CXX) $(CXXFLAGS) -shared -o $@ $(INVERTOBJS) $<
+
+xlock : $(UTILOBJDIR)xlock
+
+$(UTILOBJDIR)xlock : $(XLOCKOBJS)
+       $(PURIFY) $(CXX) $(CXXFLAGS) -o $@ $(XLOCKOBJS) $(XLOCKLDFLAGS) $(XLOCKLIBS) $(MODULEFLAGS)
+       @ $(ECHO) "$@ BUILD COMPLETE"
+       @ $(ECHO) ""
+
+bat.xbm : $(BITMAPDIR)$(IMAGEBITMAP).xbm
+       $(RM) bat.xbm ; $(LN_S) $(BITMAPDIR)$(BATBITMAP).xbm bat.xbm
+
+bounce.xbm : $(BITMAPDIR)$(IMAGEBITMAP).xbm
+       $(RM) bounce.xbm ; $(LN_S) $(BITMAPDIR)$(BOUNCEBITMAP).xbm bounce.xbm
+
+decay.xbm : $(BITMAPDIR)$(DECAYBITMAP).xbm
+       $(RM) decay.xbm ; $(LN_S) $(BITMAPDIR)$(DECAYBITMAP).xbm decay.xbm
+
+earth.xbm : $(BITMAPDIR)$earth.xbm
+       $(RM) earth.xbm ; $(LN_S) $(BITMAPDIR)$earth.xbm earth.xbm
+
+eyes.xbm : $(BITMAPDIR)$(EYESBITMAP).xbm
+       $(RM) eyes.xbm ; $(LN_S) $(BITMAPDIR)$(EYESBITMAP).xbm eyes.xbm
+
+eyes2.xbm : $(BITMAPDIR)m-grelb-2.xbm
+       $(RM) eyes2.xbm ; $(LN_S) $(BITMAPDIR)m-grelb-2.xbm eyes2.xbm
+
+flag.xbm : $(BITMAPDIR)$(FLAGBITMAP).xbm
+       $(RM) flag.xbm ; $(LN_S) $(BITMAPDIR)$(FLAGBITMAP).xbm flag.xbm
+
+image.xbm : $(BITMAPDIR)$(IMAGEBITMAP).xbm
+       $(RM) image.xbm ; $(LN_S) $(BITMAPDIR)$(IMAGEBITMAP).xbm image.xbm
+
+ghost.xbm : $(BITMAPDIR)$(PACMANBITMAP).xbm
+       $(RM) ghost.xbm ; $(LN_S) $(BITMAPDIR)$(PACMANBITMAP).xbm ghost.xbm
+
+life.xbm : $(BITMAPDIR)$(LIFEBITMAP).xbm
+       $(RM) life.xbm ; $(LN_S) $(BITMAPDIR)$(LIFEBITMAP).xbm life.xbm
+
+life2.xbm : $(BITMAPDIR)s-grelb-2.xbm
+       $(RM) life2.xbm ; $(LN_S) $(BITMAPDIR)s-grelb-2.xbm life2.xbm
+
+life1d.xbm : $(BITMAPDIR)$(LIFE1DBITMAP).xbm
+       $(RM) life1d.xbm ; $(LN_S) $(BITMAPDIR)$(LIFE1DBITMAP).xbm life1d.xbm
+
+maze.xbm : $(BITMAPDIR)$(MAZEBITMAP).xbm
+       $(RM) maze.xbm ; $(LN_S) $(BITMAPDIR)$(MAZEBITMAP).xbm maze.xbm
+
+puzzle.xbm : $(BITMAPDIR)$(PUZZLEBITMAP).xbm
+       $(RM) puzzle.xbm ; $(LN_S) $(BITMAPDIR)$(PUZZLEBITMAP).xbm puzzle.xbm
+
+bat.xpm : $(PIXMAPDIR)$(BATPIXMAP).xpm
+       $(RM) bat.xpm ; $(LN_S) $(PIXMAPDIR)$(BATPIXMAP).xpm bat.xpm
+
+bounce.xpm : $(PIXMAPDIR)$(BOUNCEPIXMAP).xpm
+       $(RM) bounce.xpm ; $(LN_S) $(PIXMAPDIR)$(BOUNCEPIXMAP).xpm bounce.xpm
+
+decay.xpm : $(PIXMAPDIR)$(DECAYPIXMAP).xpm
+       $(RM) decay.xpm ; $(LN_S) $(PIXMAPDIR)$(DECAYPIXMAP).xpm decay.xpm
+
+flag.xpm : $(PIXMAPDIR)$(FLAGPIXMAP).xpm
+       $(RM) flag.xpm ; $(LN_S) $(PIXMAPDIR)$(FLAGPIXMAP).xpm flag.xpm
+
+image.xpm : $(PIXMAPDIR)$(IMAGEPIXMAP).xpm
+       $(RM) image.xpm ; $(LN_S) $(PIXMAPDIR)$(IMAGEPIXMAP).xpm image.xpm
+
+life.xpm : $(PIXMAPDIR)$(LIFEPIXMAP).xpm
+       $(RM) life.xpm ; $(LN_S) $(PIXMAPDIR)$(LIFEPIXMAP).xpm life.xpm
+
+maze.xpm : $(PIXMAPDIR)$(MAZEPIXMAP).xpm
+       $(RM) maze.xpm ; $(LN_S) $(PIXMAPDIR)$(MAZEPIXMAP).xpm maze.xpm
+
+puzzle.xpm : $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm
+       $(RM) puzzle.xpm ; $(LN_S) $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm puzzle.xpm
+
+$(UTILOBJDIR)xlock.o : $(UTILDIR)xlock.c
+$(UTILOBJDIR)passwd.o : $(UTILDIR)passwd.c
+$(UTILOBJDIR)resource.o : $(UTILDIR)resource.c
+$(UTILOBJDIR)parsecmd.o : $(UTILDIR)parsecmd.c
+$(UTILOBJDIR)util.o : $(UTILDIR)util.c
+$(UTILOBJDIR)logout.o : $(UTILDIR)logout.c
+$(UTILOBJDIR)mode.o : $(UTILDIR)mode.c
+$(UTILOBJDIR)ras.o : $(UTILDIR)ras.c
+$(UTILOBJDIR)xbm.o : $(UTILDIR)xbm.c
+$(UTILOBJDIR)vis.o : $(UTILDIR)vis.c
+$(UTILOBJDIR)visgl.o : $(UTILDIR)visgl.c
+$(UTILOBJDIR)color.o : $(UTILDIR)color.c
+$(UTILOBJDIR)random.o : $(UTILDIR)random.c
+$(UTILOBJDIR)iostuff.o : $(UTILDIR)iostuff.c
+$(UTILOBJDIR)automata.o : $(UTILDIR)automata.c
+$(UTILOBJDIR)spline.o : $(UTILDIR)spline.c
+$(UTILOBJDIR)sound.o : $(UTILDIR)sound.c
+$(UTILOBJDIR)erase.o : $(UTILDIR)erase.c
+$(UTILOBJDIR)magick.o : $(UTILDIR)magick.c
+$(UTILOBJDIR)vtlock.o : $(UTILDIR)vtlock.c
+$(UTILOBJDIR)vtlock_proc.o : $(UTILDIR)vtlock_proc.c
+$(UTILOBJDIR)memcheck.o : $(UTILDIR)memcheck.c
+
+#$(XLOCKUTILOBJS) :
+#      cd $(UTILOBJDIR) ; \
+#$(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+$(GLOBJDIR)cage.o : $(GLDIR)cage.c
+$(GLOBJDIR)fire.o : $(GLDIR)fire.c
+$(GLOBJDIR)gears.o : $(GLDIR)gears.c
+$(GLOBJDIR)glplanet.o : $(GLDIR)glplanet.c
+$(GLOBJDIR)sphere.o : $(GLDIR)sphere.c
+$(GLOBJDIR)lament.o : $(GLDIR)lament.c
+$(GLOBJDIR)xpm-ximage.o : $(GLDIR)xpm-ximage.c
+$(GLOBJDIR)moebius.o : $(GLDIR)moebius.c
+$(GLOBJDIR)molecule.o : $(GLDIR)molecule.c
+$(GLOBJDIR)tube.o : $(GLDIR)tube.c
+$(GLOBJDIR)morph3d.o : $(GLDIR)morph3d.c
+$(GLOBJDIR)rubik.o : $(GLDIR)rubik.c
+$(GLOBJDIR)sballs.o : $(GLDIR)sballs.c
+$(GLOBJDIR)sierpinski3d.o : $(GLDIR)sierpinski3d.c
+$(GLOBJDIR)stairs.o : $(GLDIR)stairs.c
+$(GLOBJDIR)superquadrics.o : $(GLDIR)superquadrics.c
+$(GLOBJDIR)buildlwo.o : $(GLDIR)buildlwo.c
+$(GLOBJDIR)pipes.o : $(GLDIR)pipes.c
+$(GLOBJDIR)pipeobjs.o : $(GLDIR)pipeobjs.c
+$(GLOBJDIR)sproingies.o : $(GLDIR)sproingies.c
+$(GLOBJDIR)sproingiewrap.o : $(GLDIR)sproingiewrap.c
+$(GLOBJDIR)s1_b.o : $(GLDIR)s1_b.c
+$(GLOBJDIR)s1_1.o : $(GLDIR)s1_1.c
+$(GLOBJDIR)s1_2.o : $(GLDIR)s1_2.c
+$(GLOBJDIR)s1_3.o : $(GLDIR)s1_3.c
+$(GLOBJDIR)s1_4.o : $(GLDIR)s1_4.c
+$(GLOBJDIR)s1_5.o : $(GLDIR)s1_5.c
+$(GLOBJDIR)s1_6.o : $(GLDIR)s1_6.c
+$(GLOBJDIR)atlantis.o : $(GLDIR)atlantis.c
+$(GLOBJDIR)swim.o : $(GLDIR)swim.c
+$(GLOBJDIR)dolphin.o : $(GLDIR)dolphin.c
+$(GLOBJDIR)shark.o : $(GLDIR)shark.c
+$(GLOBJDIR)whale.o : $(GLDIR)whale.c
+$(GLOBJDIR)bubble3d.o : $(GLDIR)bubble3d.c
+$(GLOBJDIR)b_draw.o : $(GLDIR)b_draw.c
+$(GLOBJDIR)b_lockglue.o : $(GLDIR)b_lockglue.c
+$(GLOBJDIR)b_sphere.o : $(GLDIR)b_sphere.c
+$(GLOBJDIR)invert.o : $(GLDIR)invert.c
+$(GLOBJDIR)i_figureeight.o : $(GLDIR)i_figureeight.cc
+$(GLOBJDIR)i_linkage.o : $(GLDIR)i_linkage.cc
+$(GLOBJDIR)i_sphere.o : $(GLDIR)i_sphere.cc
+$(GLOBJDIR)i_spline.o : $(GLDIR)i_spline.cc
+$(GLOBJDIR)i_threejet.o : $(GLDIR)i_threejet.cc
+$(GLOBJDIR)i_threejetvec.o : $(GLDIR)i_threejetvec.cc
+$(GLOBJDIR)i_twojet.o : $(GLDIR)i_twojet.cc
+$(GLOBJDIR)i_twojetvec.o : $(GLDIR)i_twojetvec.cc
+$(GLOBJDIR)skewb.o : $(GLDIR)skewb.c
+$(GLOBJDIR)text3d.o : $(GLDIR)text3d.cc
+
+#$(XLOCKGLOBJS) :
+#      cd $(GLOBJDIR) ; \
+#$(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+.SUFFIXES : $(C) $(CX) $(O) $(M)
+
+$(C)$(O) :
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEFS) $(XLOCKINC) $(CFLAGS) $<
+
+$(CX)$(O) :
+       $(CXX) -c -o $@ $(CPPFLAGS) $(DEFS) $(XLOCKINC) $(CXXFLAGS) $<
+
+install : install-program install-man install-ad
+       @ $(ECHO) "$@ COMPLETE"
+       @ $(ECHO) ""
+
+install-program : xlock
+       $(top_srcdir)/mkinstalldirs $(bindir)
+       $(INSTALL_PROGRAM) $(INSTPGMFLAGS) $(UTILOBJDIR)xlock $(bindir)
+       @MODULES@mkdir -p $(DEF_MODULEPATH)
+       @MODULES@cp *.xlk $(DEF_MODULEPATH)
+       @MODULES@cp glx/*.xlk $(DEF_MODULEPATH)
+
+install-man :
+       $(top_srcdir)/mkinstalldirs $(mandir)
+       $(INSTALL_DATA) $(UTILDIR)xlock.man $(mandir)/xlock.1
+
+install-ad :
+       $(top_srcdir)/mkinstalldirs $(xapploaddir)
+       $(INSTALL_DATA) $(UTILDIR)XLock.ad $(xapploaddir)/XLock
+
+uninstall : uninstall-program uninstall-man uninstall-ad
+
+uninstall-program :
+       $(RM) $(bindir)/xlock
+
+uninstall-man :
+       $(RM) $(mandir)/xlock.1
+
+uninstall-ad :
+       $(RM) $(xapploaddir)/XLock
+
+install.program : install-program
+
+install.man : install-man
+
+install.ad : install-ad
+
+install.modules : install-modules
+
+uninstall.program : uninstall-program
+
+uninstall.man : uninstall-man
+
+uninstall.ad : uninstall-ad
+
+lint :
+       $(LINT) -ax -DLINT $(DEFS) $(XLOCKINC) $(XLOCKSRCS) -L$(XLIBS) -lX11 -lm
+
+xrdb :
+
+man :
+
+html :
+
+hlp :
+
+clean :
+       $(RM) *.o *.xlk core *~ *% *.bak *.orig *.rej make.log MakeOut *.patch .pure
+
+distclean : clean
+       $(RM) Makefile $(BITMAPS) $(PIXMAPS)
+
+clean.all : distclean
+
+# Adds all current dependencies to Makefile
+depend : $(BITMAPS) $(PIXMAPS)
+       $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
+       $(DEPEND_FLAGS) --                                                  \
+       $(XLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                  \
+       $(XLOCKSRCS)
+
+# Adds some dependencies to Makefile.in -- not totally accurate, but pretty
+# close.  This excludes dependencies on files in /usr/include, etc.  It tries
+# to include only dependencies on files which are themselves a part of this
+# package.
+distdepend :
+       @echo updating dependencies in `pwd`/Makefile.in... ;               \
+       $(DEPEND) -w 0 -f -                                                 \
+       -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
+       $(XLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                  \
+       $(XLOCKSRCS) |                                                      \
+       (                                                                   \
+         awk '/^#.*Id : Makefile.in/,/^# DO .*distdepend/' < Makefile.in ; \
+         sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
+             -e 's@^\.\./xlock@$$(UTILOBJDIR)@'                            \
+             -e 's@^\.\./modes/glx@$$(GLOBJDIR)@'                          \
+             -e 's@\.\./bitmaps@$$(BITMAPDIR)@g'                           \
+             -e 's@\.\./pixmaps@$$(PIXMAPDIR)@g'                           \
+             -e 's@\.\./xlock@$$(UTILDIR)@g'                               \
+             -e 's@\.\./modes/glx@$$(GLDIR)@g' ;                           \
+         echo ''                                                           \
+       ) > /tmp/distdepend.$$$$ &&                                         \
+       mv Makefile.in Makefile.in.bak &&                                   \
+       mv /tmp/distdepend.$$$$ Makefile.in
+
+#            -e 's@ \([^$$]\)@ $$(srcdir)/\1@g'                            \
+#            -e 's@ $$(srcdir)/\(.*config.h\)@ \1@g' ;                     \
+
+##############################################################################
+#
+# DO NOT DELETE: updated by make distdepend
+
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/xlock.o: ../config.h
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/color.h
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/util.h
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/iostuff.h
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/passwd.h
+$(UTILOBJDIR)/xlock.o: $(BITMAPDIR)/mailempty.xbm
+$(UTILOBJDIR)/xlock.o: $(BITMAPDIR)/mailfull.xbm
+$(UTILOBJDIR)/xlock.o: $(UTILDIR)/vroot.h
+$(UTILOBJDIR)/passwd.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/passwd.o: ../config.h
+$(UTILOBJDIR)/passwd.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/passwd.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/passwd.o: $(UTILDIR)/iostuff.h
+$(UTILOBJDIR)/passwd.o: $(UTILDIR)/passwd.h
+$(UTILOBJDIR)/resource.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/resource.o: ../config.h
+$(UTILOBJDIR)/resource.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/resource.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/resource.o: $(UTILDIR)/vis.h
+$(UTILOBJDIR)/resource.o: $(UTILDIR)/visgl.h
+$(UTILOBJDIR)/resource.o: $(UTILDIR)/iostuff.h
+$(UTILOBJDIR)/resource.o: $(UTILDIR)/version.h
+$(UTILOBJDIR)/util.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/util.o: ../config.h
+$(UTILOBJDIR)/util.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/util.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/util.o: $(UTILDIR)/util.h
+$(UTILOBJDIR)/logout.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/logout.o: ../config.h
+$(UTILOBJDIR)/logout.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/logout.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/logout.o: $(UTILDIR)/iostuff.h
+$(UTILOBJDIR)/mode.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/mode.o: ../config.h
+$(UTILOBJDIR)/mode.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/mode.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/xlockimage.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/xlockimage.o: ../config.h
+$(UTILOBJDIR)/xlockimage.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/xlockimage.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/xlockimage.o: $(UTILDIR)/iostuff.h
+$(UTILOBJDIR)/xlockimage.o: $(UTILDIR)/xlockimage.h
+$(UTILOBJDIR)/ras.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/ras.o: ../config.h
+$(UTILOBJDIR)/ras.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/ras.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/ras.o: $(UTILDIR)/iostuff.h
+$(UTILOBJDIR)/ras.o: $(UTILDIR)/ras.h
+$(UTILOBJDIR)/ras.o: $(UTILDIR)/xlockimage.h
+$(UTILOBJDIR)/xbm.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/xbm.o: ../config.h
+$(UTILOBJDIR)/xbm.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/xbm.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/vis.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/vis.o: ../config.h
+$(UTILOBJDIR)/vis.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/vis.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/vis.o: $(UTILDIR)/vis.h
+$(UTILOBJDIR)/vis.o: $(UTILDIR)/visgl.h
+$(UTILOBJDIR)/visgl.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/visgl.o: ../config.h
+$(UTILOBJDIR)/visgl.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/visgl.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/visgl.o: $(UTILDIR)/visgl.h
+$(UTILOBJDIR)/color.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/color.o: ../config.h
+$(UTILOBJDIR)/color.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/color.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/color.o: $(UTILDIR)/color.h
+$(UTILOBJDIR)/color.o: $(UTILDIR)/vis.h
+$(UTILOBJDIR)/color.o: $(UTILDIR)/visgl.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/iostuff.o: ../config.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/vis.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/visgl.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/color.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/iostuff.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/ras.h
+$(UTILOBJDIR)/iostuff.o: $(UTILDIR)/xlockimage.h
+$(UTILOBJDIR)/automata.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/automata.o: ../config.h
+$(UTILOBJDIR)/automata.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/automata.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/automata.o: $(UTILDIR)/automata.h
+$(UTILOBJDIR)/spline.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/spline.o: ../config.h
+$(UTILOBJDIR)/spline.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/spline.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/spline.o: $(UTILDIR)/spline.h
+$(UTILOBJDIR)/sound.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/sound.o: ../config.h
+$(UTILOBJDIR)/sound.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/sound.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/erase.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/erase.o: ../config.h
+$(UTILOBJDIR)/erase.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/erase.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/erase.o: $(UTILDIR)/erase_init.h
+$(UTILOBJDIR)/erase.o: $(UTILDIR)/erase.h
+$(UTILOBJDIR)/erase.o: $(UTILDIR)/erase_debug.h
+$(UTILOBJDIR)/vtlock.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/vtlock.o: ../config.h
+$(UTILOBJDIR)/vtlock.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/vtlock.o: $(UTILDIR)/random.h
+$(UTILOBJDIR)/vtlock_proc.o: $(UTILDIR)/xlock.h
+$(UTILOBJDIR)/vtlock_proc.o: ../config.h
+$(UTILOBJDIR)/vtlock_proc.o: $(UTILDIR)/mode.h
+$(UTILOBJDIR)/vtlock_proc.o: $(UTILDIR)/random.h
+space.o: $(UTILDIR)/xlock.h
+space.o: ../config.h
+space.o: $(UTILDIR)/mode.h
+space.o: $(UTILDIR)/random.h
+run.o: $(UTILDIR)/xlock.h
+run.o: ../config.h
+run.o: $(UTILDIR)/mode.h
+run.o: $(UTILDIR)/random.h
+solitare.o: $(UTILDIR)/xlock.h
+solitare.o: ../config.h
+solitare.o: $(UTILDIR)/mode.h
+solitare.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/cage.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/cage.o: ../config.h
+$(GLOBJDIR)/cage.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/cage.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/cage.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/cage.o: $(GLDIR)/e_textures.h
+$(GLOBJDIR)/fire.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/fire.o: ../config.h
+$(GLOBJDIR)/fire.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/fire.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/fire.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/fire.o: $(UTILDIR)/iostuff.h
+$(GLOBJDIR)/fire.o: $(GLDIR)/xpm-ximage.h
+$(GLOBJDIR)/fire.o: $(PIXMAPDIR)/ground.xpm
+$(GLOBJDIR)/fire.o: $(PIXMAPDIR)/tree.xpm
+$(GLOBJDIR)/gears.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/gears.o: ../config.h
+$(GLOBJDIR)/gears.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/gears.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/gears.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/lament.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/lament.o: ../config.h
+$(GLOBJDIR)/lament.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/lament.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/lament.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/lament.o: $(GLDIR)/xpm-ximage.h
+$(GLOBJDIR)/lament.o: $(PIXMAPDIR)/lament.xpm
+$(GLOBJDIR)/moebius.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/moebius.o: ../config.h
+$(GLOBJDIR)/moebius.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/moebius.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/moebius.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/moebius.o: $(GLDIR)/e_textures.h
+$(GLOBJDIR)/morph3d.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/morph3d.o: ../config.h
+$(GLOBJDIR)/morph3d.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/morph3d.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/morph3d.o: $(UTILDIR)/vis.h
+$(GLOBJDIR)/morph3d.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/rubik.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/rubik.o: ../config.h
+$(GLOBJDIR)/rubik.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/rubik.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/rubik.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/skewb.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/skewb.o: ../config.h
+$(GLOBJDIR)/skewb.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/skewb.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/skewb.o: $(UTILDIR)/vis.h
+$(GLOBJDIR)/skewb.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/sballs.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/sballs.o: ../config.h
+$(GLOBJDIR)/sballs.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/sballs.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/sballs.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/sballs.o: $(UTILDIR)/iostuff.h
+$(GLOBJDIR)/sballs.o: $(GLDIR)/xpm-ximage.h
+$(GLOBJDIR)/sballs.o: $(PIXMAPDIR)/face.xpm
+$(GLOBJDIR)/sballs.o: $(PIXMAPDIR)/back.xpm
+$(GLOBJDIR)/stairs.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/stairs.o: ../config.h
+$(GLOBJDIR)/stairs.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/stairs.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/stairs.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/stairs.o: $(GLDIR)/e_textures.h
+$(GLOBJDIR)/superquadrics.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/superquadrics.o: ../config.h
+$(GLOBJDIR)/superquadrics.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/superquadrics.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/superquadrics.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/xpm-ximage.o: ../config.h
+$(GLOBJDIR)/xpm-ximage.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/xpm-ximage.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/xpm-ximage.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/xpm-ximage.o: $(UTILDIR)/vis.h
+$(GLOBJDIR)/xpm-ximage.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/buildlwo.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/buildlwo.o: ../config.h
+$(GLOBJDIR)/buildlwo.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/buildlwo.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/buildlwo.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/pipes.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/pipes.o: ../config.h
+$(GLOBJDIR)/pipes.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/pipes.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/pipes.o: $(UTILDIR)/vis.h
+$(GLOBJDIR)/pipes.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/pipes.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/pipeobjs.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/pipeobjs.o: ../config.h
+$(GLOBJDIR)/pipeobjs.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/pipeobjs.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/pipeobjs.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/sproingies.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/sproingies.o: ../config.h
+$(GLOBJDIR)/sproingies.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/sproingies.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/sproingies.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/sproingiewrap.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/sproingiewrap.o: ../config.h
+$(GLOBJDIR)/sproingiewrap.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/sproingiewrap.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/sproingiewrap.o: $(UTILDIR)/vis.h
+$(GLOBJDIR)/sproingiewrap.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/s1_b.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/s1_b.o: ../config.h
+$(GLOBJDIR)/s1_b.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/s1_b.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/s1_b.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/s1_1.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/s1_1.o: ../config.h
+$(GLOBJDIR)/s1_1.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/s1_1.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/s1_1.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/s1_2.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/s1_2.o: ../config.h
+$(GLOBJDIR)/s1_2.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/s1_2.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/s1_2.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/s1_3.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/s1_3.o: ../config.h
+$(GLOBJDIR)/s1_3.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/s1_3.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/s1_3.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/s1_4.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/s1_4.o: ../config.h
+$(GLOBJDIR)/s1_4.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/s1_4.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/s1_4.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/s1_5.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/s1_5.o: ../config.h
+$(GLOBJDIR)/s1_5.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/s1_5.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/s1_5.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/s1_6.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/s1_6.o: ../config.h
+$(GLOBJDIR)/s1_6.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/s1_6.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/s1_6.o: $(GLDIR)/buildlwo.h
+$(GLOBJDIR)/atlantis.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/atlantis.o: ../config.h
+$(GLOBJDIR)/atlantis.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/atlantis.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/atlantis.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/atlantis.o: $(GLDIR)/atlantis.h
+$(GLOBJDIR)/dolphin.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/dolphin.o: ../config.h
+$(GLOBJDIR)/dolphin.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/dolphin.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/dolphin.o: $(GLDIR)/atlantis.h
+$(GLOBJDIR)/shark.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/shark.o: ../config.h
+$(GLOBJDIR)/shark.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/shark.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/shark.o: $(GLDIR)/atlantis.h
+$(GLOBJDIR)/swim.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/swim.o: ../config.h
+$(GLOBJDIR)/swim.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/swim.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/swim.o: $(GLDIR)/atlantis.h
+$(GLOBJDIR)/whale.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/whale.o: ../config.h
+$(GLOBJDIR)/whale.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/whale.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/whale.o: $(GLDIR)/atlantis.h
+$(GLOBJDIR)/bubble3d.o: $(GLDIR)/bubble3d.h
+$(GLOBJDIR)/bubble3d.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/bubble3d.o: ../config.h
+$(GLOBJDIR)/bubble3d.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/bubble3d.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/b_draw.o: $(GLDIR)/bubble3d.h
+$(GLOBJDIR)/b_draw.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/b_draw.o: ../config.h
+$(GLOBJDIR)/b_draw.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/b_draw.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/b_sphere.o: $(GLDIR)/bubble3d.h
+$(GLOBJDIR)/b_sphere.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/b_sphere.o: ../config.h
+$(GLOBJDIR)/b_sphere.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/b_sphere.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/b_lockglue.o: $(GLDIR)/bubble3d.h
+$(GLOBJDIR)/b_lockglue.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/b_lockglue.o: ../config.h
+$(GLOBJDIR)/b_lockglue.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/b_lockglue.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/b_lockglue.o: $(UTILDIR)/vis.h
+$(GLOBJDIR)/b_lockglue.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/invert.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/invert.o: ../config.h
+$(GLOBJDIR)/invert.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/invert.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/invert.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/invert.o: $(GLDIR)/i_linkage.h
+$(GLOBJDIR)/i_figureeight.o: $(GLDIR)/i_figureeight.h
+$(GLOBJDIR)/i_figureeight.o: $(GLDIR)/i_threejetvec.h
+$(GLOBJDIR)/i_figureeight.o: $(GLDIR)/i_threejet.h
+$(GLOBJDIR)/i_figureeight.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_figureeight.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_figureeight.o: ../config.h
+$(GLOBJDIR)/i_figureeight.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_figureeight.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/i_figureeight.o: $(GLDIR)/i_twojetvec.h
+$(GLOBJDIR)/i_linkage.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_linkage.o: ../config.h
+$(GLOBJDIR)/i_linkage.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_linkage.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_linkage.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_threejetvec.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_threejet.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_twojetvec.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_figureeight.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_spline.h
+$(GLOBJDIR)/i_linkage.o: $(GLDIR)/i_sphere.h
+$(GLOBJDIR)/i_sphere.o: $(GLDIR)/i_threejetvec.h
+$(GLOBJDIR)/i_sphere.o: $(GLDIR)/i_threejet.h
+$(GLOBJDIR)/i_sphere.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_sphere.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_sphere.o: ../config.h
+$(GLOBJDIR)/i_sphere.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_sphere.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/i_sphere.o: $(GLDIR)/i_twojetvec.h
+$(GLOBJDIR)/i_sphere.o: $(GLDIR)/i_figureeight.h
+$(GLOBJDIR)/i_sphere.o: $(GLDIR)/i_spline.h
+$(GLOBJDIR)/i_sphere.o: $(GLDIR)/i_sphere.h
+$(GLOBJDIR)/i_spline.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_spline.o: ../config.h
+$(GLOBJDIR)/i_spline.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_spline.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/i_spline.o: $(GLDIR)/i_spline.h
+$(GLOBJDIR)/i_spline.o: $(GLDIR)/i_threejetvec.h
+$(GLOBJDIR)/i_spline.o: $(GLDIR)/i_threejet.h
+$(GLOBJDIR)/i_spline.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_spline.o: $(GLDIR)/i_twojetvec.h
+$(GLOBJDIR)/i_spline.o: $(GLDIR)/i_evert.h
+$(GLOBJDIR)/i_threejet.o: $(GLDIR)/i_threejet.h
+$(GLOBJDIR)/i_threejet.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_threejet.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_threejet.o: ../config.h
+$(GLOBJDIR)/i_threejet.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_threejet.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/i_threejetvec.o: $(GLDIR)/i_threejetvec.h
+$(GLOBJDIR)/i_threejetvec.o: $(GLDIR)/i_threejet.h
+$(GLOBJDIR)/i_threejetvec.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_threejetvec.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_threejetvec.o: ../config.h
+$(GLOBJDIR)/i_threejetvec.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_threejetvec.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/i_threejetvec.o: $(GLDIR)/i_twojetvec.h
+$(GLOBJDIR)/i_twojet.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_twojet.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_twojet.o: ../config.h
+$(GLOBJDIR)/i_twojet.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_twojet.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/i_twojetvec.o: $(GLDIR)/i_twojetvec.h
+$(GLOBJDIR)/i_twojetvec.o: $(GLDIR)/i_twojet.h
+$(GLOBJDIR)/i_twojetvec.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/i_twojetvec.o: ../config.h
+$(GLOBJDIR)/i_twojetvec.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/i_twojetvec.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/text3d.o: $(UTILDIR)/xlock.h
+$(GLOBJDIR)/text3d.o: ../config.h
+$(GLOBJDIR)/text3d.o: $(UTILDIR)/mode.h
+$(GLOBJDIR)/text3d.o: $(UTILDIR)/random.h
+$(GLOBJDIR)/text3d.o: $(UTILDIR)/vis.h
+$(GLOBJDIR)/text3d.o: $(UTILDIR)/visgl.h
+$(GLOBJDIR)/text3d.o: $(UTILDIR)/iostuff.h
+$(GLOBJDIR)/text3d.o: $(GLDIR)/text3d.h
+ant.o: $(UTILDIR)/xlock.h
+ant.o: ../config.h
+ant.o: $(UTILDIR)/mode.h
+ant.o: $(UTILDIR)/random.h
+ant.o: $(UTILDIR)/automata.h
+ball.o: $(UTILDIR)/xlock.h
+ball.o: ../config.h
+ball.o: $(UTILDIR)/mode.h
+ball.o: $(UTILDIR)/random.h
+bat.o: $(UTILDIR)/xlock.h
+bat.o: ../config.h
+bat.o: $(UTILDIR)/mode.h
+bat.o: $(UTILDIR)/random.h
+bat.o: $(UTILDIR)/vis.h
+bat.o: $(UTILDIR)/visgl.h
+bat.o: $(UTILDIR)/color.h
+bat.o: $(UTILDIR)/iostuff.h
+bat.o: $(PIXMAPDIR)/bat-0.xpm
+bat.o: $(PIXMAPDIR)/bat-1.xpm
+bat.o: $(PIXMAPDIR)/bat-2.xpm
+bat.o: $(PIXMAPDIR)/bat-3.xpm
+bat.o: $(PIXMAPDIR)/bat-4.xpm
+bat.o: $(BITMAPDIR)/bat-0.xbm
+bat.o: $(BITMAPDIR)/bat-1.xbm
+bat.o: $(BITMAPDIR)/bat-2.xbm
+bat.o: $(BITMAPDIR)/bat-3.xbm
+bat.o: $(BITMAPDIR)/bat-4.xbm
+bat.o: bat.xbm
+bat.o: bat.xpm
+blot.o: $(UTILDIR)/xlock.h
+blot.o: ../config.h
+blot.o: $(UTILDIR)/mode.h
+blot.o: $(UTILDIR)/random.h
+bouboule.o: $(UTILDIR)/xlock.h
+bouboule.o: ../config.h
+bouboule.o: $(UTILDIR)/mode.h
+bouboule.o: $(UTILDIR)/random.h
+bounce.o: $(UTILDIR)/xlock.h
+bounce.o: ../config.h
+bounce.o: $(UTILDIR)/mode.h
+bounce.o: $(UTILDIR)/random.h
+bounce.o: $(UTILDIR)/vis.h
+bounce.o: $(UTILDIR)/visgl.h
+bounce.o: $(UTILDIR)/color.h
+bounce.o: $(UTILDIR)/iostuff.h
+bounce.o: $(BITMAPDIR)/bounce-0.xbm
+bounce.o: $(BITMAPDIR)/bounce-1.xbm
+bounce.o: $(BITMAPDIR)/bounce-2.xbm
+bounce.o: $(BITMAPDIR)/bounce-3.xbm
+bounce.o: $(BITMAPDIR)/bounce-mask.xbm
+bounce.o: bounce.xbm
+bounce.o: bounce.xpm
+braid.o: $(UTILDIR)/xlock.h
+braid.o: ../config.h
+braid.o: $(UTILDIR)/mode.h
+braid.o: $(UTILDIR)/random.h
+bubble.o: $(UTILDIR)/xlock.h
+bubble.o: ../config.h
+bubble.o: $(UTILDIR)/mode.h
+bubble.o: $(UTILDIR)/random.h
+bug.o: $(UTILDIR)/xlock.h
+bug.o: ../config.h
+bug.o: $(UTILDIR)/mode.h
+bug.o: $(UTILDIR)/random.h
+bug.o: $(UTILDIR)/automata.h
+clock.o: $(UTILDIR)/xlock.h
+clock.o: ../config.h
+clock.o: $(UTILDIR)/mode.h
+clock.o: $(UTILDIR)/random.h
+coral.o: $(UTILDIR)/xlock.h
+coral.o: ../config.h
+coral.o: $(UTILDIR)/mode.h
+coral.o: $(UTILDIR)/random.h
+crystal.o: $(UTILDIR)/xlock.h
+crystal.o: ../config.h
+crystal.o: $(UTILDIR)/mode.h
+crystal.o: $(UTILDIR)/random.h
+crystal.o: $(UTILDIR)/color.h
+daisy.o: $(UTILDIR)/xlock.h
+daisy.o: ../config.h
+daisy.o: $(UTILDIR)/mode.h
+daisy.o: $(UTILDIR)/random.h
+dclock.o: $(UTILDIR)/xlock.h
+dclock.o: ../config.h
+dclock.o: $(UTILDIR)/mode.h
+dclock.o: $(UTILDIR)/random.h
+dclock.o: $(UTILDIR)/util.h
+dclock.o: $(UTILDIR)/iostuff.h
+decay.o: $(UTILDIR)/xlock.h
+decay.o: ../config.h
+decay.o: $(UTILDIR)/mode.h
+decay.o: $(UTILDIR)/random.h
+decay.o: $(UTILDIR)/iostuff.h
+decay.o: $(UTILDIR)/color.h
+decay.o: decay.xbm
+decay.o: decay.xpm
+deco.o: $(UTILDIR)/xlock.h
+deco.o: ../config.h
+deco.o: $(UTILDIR)/mode.h
+deco.o: $(UTILDIR)/random.h
+demon.o: $(UTILDIR)/xlock.h
+demon.o: ../config.h
+demon.o: $(UTILDIR)/mode.h
+demon.o: $(UTILDIR)/random.h
+demon.o: $(UTILDIR)/automata.h
+dilemma.o: $(UTILDIR)/xlock.h
+dilemma.o: ../config.h
+dilemma.o: $(UTILDIR)/mode.h
+dilemma.o: $(UTILDIR)/random.h
+dilemma.o: $(UTILDIR)/automata.h
+dilemma.o: $(BITMAPDIR)/cooperat.xbm
+dilemma.o: $(BITMAPDIR)/defect.xbm
+discrete.o: $(UTILDIR)/xlock.h
+discrete.o: ../config.h
+discrete.o: $(UTILDIR)/mode.h
+discrete.o: $(UTILDIR)/random.h
+dragon.o: $(UTILDIR)/xlock.h
+dragon.o: ../config.h
+dragon.o: $(UTILDIR)/mode.h
+dragon.o: $(UTILDIR)/random.h
+dragon.o: $(UTILDIR)/automata.h
+dragon.o: $(BITMAPDIR)/gray1.xbm
+drift.o: $(UTILDIR)/xlock.h
+drift.o: ../config.h
+drift.o: $(UTILDIR)/mode.h
+drift.o: $(UTILDIR)/random.h
+euler2d.o: $(UTILDIR)/xlock.h
+euler2d.o: ../config.h
+euler2d.o: $(UTILDIR)/mode.h
+euler2d.o: $(UTILDIR)/random.h
+eyes.o: $(UTILDIR)/xlock.h
+eyes.o: ../config.h
+eyes.o: $(UTILDIR)/mode.h
+eyes.o: $(UTILDIR)/random.h
+eyes.o: $(UTILDIR)/iostuff.h
+eyes.o: eyes.xbm
+eyes.o: eyes2.xbm
+fadeplot.o: $(UTILDIR)/xlock.h
+fadeplot.o: ../config.h
+fadeplot.o: $(UTILDIR)/mode.h
+fadeplot.o: $(UTILDIR)/random.h
+flag.o: $(UTILDIR)/xlock.h
+flag.o: ../config.h
+flag.o: $(UTILDIR)/mode.h
+flag.o: $(UTILDIR)/random.h
+flag.o: $(UTILDIR)/color.h
+flag.o: $(UTILDIR)/iostuff.h
+flag.o: flag.xbm
+flag.o: flag.xpm
+flame.o: $(UTILDIR)/xlock.h
+flame.o: ../config.h
+flame.o: $(UTILDIR)/mode.h
+flame.o: $(UTILDIR)/random.h
+flow.o: $(UTILDIR)/xlock.h
+flow.o: ../config.h
+flow.o: $(UTILDIR)/mode.h
+flow.o: $(UTILDIR)/random.h
+forest.o: $(UTILDIR)/xlock.h
+forest.o: ../config.h
+forest.o: $(UTILDIR)/mode.h
+forest.o: $(UTILDIR)/random.h
+galaxy.o: $(UTILDIR)/xlock.h
+galaxy.o: ../config.h
+galaxy.o: $(UTILDIR)/mode.h
+galaxy.o: $(UTILDIR)/random.h
+goop.o: $(UTILDIR)/xlock.h
+goop.o: ../config.h
+goop.o: $(UTILDIR)/mode.h
+goop.o: $(UTILDIR)/random.h
+goop.o: $(UTILDIR)/spline.h
+grav.o: $(UTILDIR)/xlock.h
+grav.o: ../config.h
+grav.o: $(UTILDIR)/mode.h
+grav.o: $(UTILDIR)/random.h
+helix.o: $(UTILDIR)/xlock.h
+helix.o: ../config.h
+helix.o: $(UTILDIR)/mode.h
+helix.o: $(UTILDIR)/random.h
+hop.o: $(UTILDIR)/xlock.h
+hop.o: ../config.h
+hop.o: $(UTILDIR)/mode.h
+hop.o: $(UTILDIR)/random.h
+hyper.o: $(UTILDIR)/xlock.h
+hyper.o: ../config.h
+hyper.o: $(UTILDIR)/mode.h
+hyper.o: $(UTILDIR)/random.h
+ico.o: $(UTILDIR)/xlock.h
+ico.o: ../config.h
+ico.o: $(UTILDIR)/mode.h
+ico.o: $(UTILDIR)/random.h
+ico.o: $(UTILDIR)/automata.h
+ifs.o: $(UTILDIR)/xlock.h
+ifs.o: ../config.h
+ifs.o: $(UTILDIR)/mode.h
+ifs.o: $(UTILDIR)/random.h
+image.o: $(UTILDIR)/xlock.h
+image.o: ../config.h
+image.o: $(UTILDIR)/mode.h
+image.o: $(UTILDIR)/random.h
+image.o: $(UTILDIR)/color.h
+image.o: $(UTILDIR)/iostuff.h
+image.o: image.xbm
+image.o: image.xpm
+juggle.o: $(UTILDIR)/xlock.h
+juggle.o: ../config.h
+juggle.o: $(UTILDIR)/mode.h
+juggle.o: $(UTILDIR)/random.h
+julia.o: $(UTILDIR)/xlock.h
+julia.o: ../config.h
+julia.o: $(UTILDIR)/mode.h
+julia.o: $(UTILDIR)/random.h
+kaleid.o: $(UTILDIR)/xlock.h
+kaleid.o: ../config.h
+kaleid.o: $(UTILDIR)/mode.h
+kaleid.o: $(UTILDIR)/random.h
+kumppa.o: $(UTILDIR)/xlock.h
+kumppa.o: ../config.h
+kumppa.o: $(UTILDIR)/mode.h
+kumppa.o: $(UTILDIR)/random.h
+laser.o: $(UTILDIR)/xlock.h
+laser.o: ../config.h
+laser.o: $(UTILDIR)/mode.h
+laser.o: $(UTILDIR)/random.h
+life.o: $(UTILDIR)/xlock.h
+life.o: ../config.h
+life.o: $(UTILDIR)/mode.h
+life.o: $(UTILDIR)/random.h
+life.o: $(UTILDIR)/color.h
+life.o: $(UTILDIR)/iostuff.h
+life.o: $(UTILDIR)/automata.h
+life.o: life.xbm
+life.o: life2.xbm
+life1d.o: $(UTILDIR)/xlock.h
+life1d.o: ../config.h
+life1d.o: $(UTILDIR)/mode.h
+life1d.o: $(UTILDIR)/random.h
+life1d.o: $(UTILDIR)/color.h
+life1d.o: $(UTILDIR)/automata.h
+life1d.o: $(UTILDIR)/iostuff.h
+life1d.o: life1d.xbm
+life3d.o: $(UTILDIR)/xlock.h
+life3d.o: ../config.h
+life3d.o: $(UTILDIR)/mode.h
+life3d.o: $(UTILDIR)/random.h
+life3d.o: $(UTILDIR)/iostuff.h
+lightning.o: $(UTILDIR)/xlock.h
+lightning.o: ../config.h
+lightning.o: $(UTILDIR)/mode.h
+lightning.o: $(UTILDIR)/random.h
+lisa.o: $(UTILDIR)/xlock.h
+lisa.o: ../config.h
+lisa.o: $(UTILDIR)/mode.h
+lisa.o: $(UTILDIR)/random.h
+lissie.o: $(UTILDIR)/xlock.h
+lissie.o: ../config.h
+lissie.o: $(UTILDIR)/mode.h
+lissie.o: $(UTILDIR)/random.h
+loop.o: $(UTILDIR)/xlock.h
+loop.o: ../config.h
+loop.o: $(UTILDIR)/mode.h
+loop.o: $(UTILDIR)/random.h
+loop.o: $(UTILDIR)/automata.h
+lyapunov.o: $(UTILDIR)/xlock.h
+lyapunov.o: ../config.h
+lyapunov.o: $(UTILDIR)/mode.h
+lyapunov.o: $(UTILDIR)/random.h
+lyapunov.o: $(UTILDIR)/vis.h
+lyapunov.o: $(UTILDIR)/visgl.h
+lyapunov.o: $(UTILDIR)/color.h
+mandelbrot.o: $(UTILDIR)/xlock.h
+mandelbrot.o: ../config.h
+mandelbrot.o: $(UTILDIR)/mode.h
+mandelbrot.o: $(UTILDIR)/random.h
+mandelbrot.o: $(UTILDIR)/vis.h
+mandelbrot.o: $(UTILDIR)/visgl.h
+mandelbrot.o: $(UTILDIR)/color.h
+marquee.o: $(UTILDIR)/xlock.h
+marquee.o: ../config.h
+marquee.o: $(UTILDIR)/mode.h
+marquee.o: $(UTILDIR)/random.h
+marquee.o: $(UTILDIR)/iostuff.h
+matrix.o: $(UTILDIR)/xlock.h
+matrix.o: ../config.h
+matrix.o: $(UTILDIR)/mode.h
+matrix.o: $(UTILDIR)/random.h
+maze.o: $(UTILDIR)/xlock.h
+maze.o: ../config.h
+maze.o: $(UTILDIR)/mode.h
+maze.o: $(UTILDIR)/random.h
+maze.o: $(UTILDIR)/color.h
+maze.o: $(UTILDIR)/iostuff.h
+maze.o: $(BITMAPDIR)/gray1.xbm
+maze.o: maze.xbm
+maze.o: maze.xpm
+mountain.o: $(UTILDIR)/xlock.h
+mountain.o: ../config.h
+mountain.o: $(UTILDIR)/mode.h
+mountain.o: $(UTILDIR)/random.h
+munch.o: $(UTILDIR)/xlock.h
+munch.o: ../config.h
+munch.o: $(UTILDIR)/mode.h
+munch.o: $(UTILDIR)/random.h
+nose.o: $(UTILDIR)/xlock.h
+nose.o: ../config.h
+nose.o: $(UTILDIR)/mode.h
+nose.o: $(UTILDIR)/random.h
+nose.o: $(UTILDIR)/iostuff.h
+nose.o: $(BITMAPDIR)/nose-hat.xbm
+nose.o: $(BITMAPDIR)/nose-hatd.xbm
+nose.o: $(BITMAPDIR)/nose-facef.xbm
+nose.o: $(BITMAPDIR)/nose-faced.xbm
+nose.o: $(BITMAPDIR)/nose-facel.xbm
+nose.o: $(BITMAPDIR)/nose-facer.xbm
+nose.o: $(BITMAPDIR)/nose-shoef.xbm
+nose.o: $(BITMAPDIR)/nose-shoel.xbm
+nose.o: $(BITMAPDIR)/nose-shoer.xbm
+nose.o: $(BITMAPDIR)/nose-stepl.xbm
+nose.o: $(BITMAPDIR)/nose-stepr.xbm
+pacman.o: $(UTILDIR)/xlock.h
+pacman.o: ../config.h
+pacman.o: $(UTILDIR)/mode.h
+pacman.o: $(UTILDIR)/random.h
+pacman.o: $(UTILDIR)/iostuff.h
+pacman.o: ghost.xbm
+penrose.o: $(UTILDIR)/xlock.h
+penrose.o: ../config.h
+penrose.o: $(UTILDIR)/mode.h
+penrose.o: $(UTILDIR)/random.h
+petal.o: $(UTILDIR)/xlock.h
+petal.o: ../config.h
+petal.o: $(UTILDIR)/mode.h
+petal.o: $(UTILDIR)/random.h
+polyominoes.o: $(UTILDIR)/xlock.h
+polyominoes.o: ../config.h
+polyominoes.o: $(UTILDIR)/mode.h
+polyominoes.o: $(UTILDIR)/random.h
+puzzle.o: $(UTILDIR)/xlock.h
+puzzle.o: ../config.h
+puzzle.o: $(UTILDIR)/mode.h
+puzzle.o: $(UTILDIR)/random.h
+puzzle.o: $(UTILDIR)/color.h
+puzzle.o: $(UTILDIR)/iostuff.h
+puzzle.o: puzzle.xbm
+puzzle.o: puzzle.xpm
+pyro.o: $(UTILDIR)/xlock.h
+pyro.o: ../config.h
+pyro.o: $(UTILDIR)/mode.h
+pyro.o: $(UTILDIR)/random.h
+qix.o: $(UTILDIR)/xlock.h
+qix.o: ../config.h
+qix.o: $(UTILDIR)/mode.h
+qix.o: $(UTILDIR)/random.h
+roll.o: $(UTILDIR)/xlock.h
+roll.o: ../config.h
+roll.o: $(UTILDIR)/mode.h
+roll.o: $(UTILDIR)/random.h
+rotor.o: $(UTILDIR)/xlock.h
+rotor.o: ../config.h
+rotor.o: $(UTILDIR)/mode.h
+rotor.o: $(UTILDIR)/random.h
+scooter.o: $(UTILDIR)/xlock.h
+scooter.o: ../config.h
+scooter.o: $(UTILDIR)/mode.h
+scooter.o: $(UTILDIR)/random.h
+shape.o: $(UTILDIR)/xlock.h
+shape.o: ../config.h
+shape.o: $(UTILDIR)/mode.h
+shape.o: $(UTILDIR)/random.h
+shape.o: $(BITMAPDIR)/gray1.xbm
+shape.o: $(BITMAPDIR)/gray3.xbm
+shape.o: $(BITMAPDIR)/stipple.xbm
+shape.o: $(BITMAPDIR)/cross_weave.xbm
+shape.o: $(BITMAPDIR)/dimple1.xbm
+shape.o: $(BITMAPDIR)/dimple3.xbm
+shape.o: $(BITMAPDIR)/flipped_gray.xbm
+shape.o: $(BITMAPDIR)/hlines2.xbm
+shape.o: $(BITMAPDIR)/light_gray.xbm
+shape.o: $(BITMAPDIR)/root_weave.xbm
+shape.o: $(BITMAPDIR)/vlines2.xbm
+shape.o: $(BITMAPDIR)/vlines3.xbm
+sierpinski.o: $(UTILDIR)/xlock.h
+sierpinski.o: ../config.h
+sierpinski.o: $(UTILDIR)/mode.h
+sierpinski.o: $(UTILDIR)/random.h
+slip.o: $(UTILDIR)/xlock.h
+slip.o: ../config.h
+slip.o: $(UTILDIR)/mode.h
+slip.o: $(UTILDIR)/random.h
+space.o: $(UTILDIR)/xlock.h
+space.o: ../config.h
+space.o: $(UTILDIR)/mode.h
+space.o: $(UTILDIR)/random.h
+sphere.o: $(UTILDIR)/xlock.h
+sphere.o: ../config.h
+sphere.o: $(UTILDIR)/mode.h
+sphere.o: $(UTILDIR)/random.h
+spiral.o: $(UTILDIR)/xlock.h
+spiral.o: ../config.h
+spiral.o: $(UTILDIR)/mode.h
+spiral.o: $(UTILDIR)/random.h
+spline.o: $(UTILDIR)/xlock.h
+spline.o: ../config.h
+spline.o: $(UTILDIR)/mode.h
+spline.o: $(UTILDIR)/random.h
+star.o: $(UTILDIR)/xlock.h
+star.o: ../config.h
+star.o: $(UTILDIR)/mode.h
+star.o: $(UTILDIR)/random.h
+star.o: $(BITMAPDIR)/enterprise-2.xbm
+star.o: $(BITMAPDIR)/enterprise-3.xbm
+star.o: $(BITMAPDIR)/enterprise-5.xbm
+star.o: $(BITMAPDIR)/enterprise-6.xbm
+starfish.o: $(UTILDIR)/xlock.h
+starfish.o: ../config.h
+starfish.o: $(UTILDIR)/mode.h
+starfish.o: $(UTILDIR)/random.h
+starfish.o: $(UTILDIR)/color.h
+starfish.o: $(UTILDIR)/spline.h
+strange.o: $(UTILDIR)/xlock.h
+strange.o: ../config.h
+strange.o: $(UTILDIR)/mode.h
+strange.o: $(UTILDIR)/random.h
+swarm.o: $(UTILDIR)/xlock.h
+swarm.o: ../config.h
+swarm.o: $(UTILDIR)/mode.h
+swarm.o: $(UTILDIR)/random.h
+swirl.o: $(UTILDIR)/xlock.h
+swirl.o: ../config.h
+swirl.o: $(UTILDIR)/mode.h
+swirl.o: $(UTILDIR)/random.h
+swirl.o: $(UTILDIR)/vis.h
+swirl.o: $(UTILDIR)/visgl.h
+swirl.o: $(UTILDIR)/color.h
+t3d.o: $(UTILDIR)/xlock.h
+t3d.o: ../config.h
+t3d.o: $(UTILDIR)/mode.h
+t3d.o: $(UTILDIR)/random.h
+t3d.o: $(UTILDIR)/color.h
+tetris.o: $(UTILDIR)/xlock.h
+tetris.o: ../config.h
+tetris.o: $(UTILDIR)/mode.h
+tetris.o: $(UTILDIR)/random.h
+tetris.o: $(UTILDIR)/color.h
+thornbird.o: $(UTILDIR)/xlock.h
+thornbird.o: ../config.h
+thornbird.o: $(UTILDIR)/mode.h
+thornbird.o: $(UTILDIR)/random.h
+tik_tak.o: $(UTILDIR)/xlock.h
+tik_tak.o: ../config.h
+tik_tak.o: $(UTILDIR)/mode.h
+tik_tak.o: $(UTILDIR)/random.h
+tik_tak.o: $(UTILDIR)/color.h
+triangle.o: $(UTILDIR)/xlock.h
+triangle.o: ../config.h
+triangle.o: $(UTILDIR)/mode.h
+triangle.o: $(UTILDIR)/random.h
+tube.o: $(UTILDIR)/xlock.h
+tube.o: ../config.h
+tube.o: $(UTILDIR)/mode.h
+tube.o: $(UTILDIR)/random.h
+tube.o: $(UTILDIR)/vis.h
+tube.o: $(UTILDIR)/visgl.h
+tube.o: $(UTILDIR)/color.h
+turtle.o: $(UTILDIR)/xlock.h
+turtle.o: ../config.h
+turtle.o: $(UTILDIR)/mode.h
+turtle.o: $(UTILDIR)/random.h
+vines.o: $(UTILDIR)/xlock.h
+vines.o: ../config.h
+vines.o: $(UTILDIR)/mode.h
+vines.o: $(UTILDIR)/random.h
+voters.o: $(UTILDIR)/xlock.h
+voters.o: ../config.h
+voters.o: $(UTILDIR)/mode.h
+voters.o: $(UTILDIR)/random.h
+voters.o: $(UTILDIR)/automata.h
+voters.o: $(BITMAPDIR)/sickle.xbm
+voters.o: $(BITMAPDIR)/donkey.xbm
+voters.o: $(BITMAPDIR)/elephant.xbm
+wator.o: $(UTILDIR)/xlock.h
+wator.o: ../config.h
+wator.o: $(UTILDIR)/mode.h
+wator.o: $(UTILDIR)/random.h
+wator.o: $(UTILDIR)/automata.h
+wator.o: $(BITMAPDIR)/fish-0.xbm
+wator.o: $(BITMAPDIR)/fish-1.xbm
+wator.o: $(BITMAPDIR)/fish-2.xbm
+wator.o: $(BITMAPDIR)/fish-3.xbm
+wator.o: $(BITMAPDIR)/fish-4.xbm
+wator.o: $(BITMAPDIR)/fish-5.xbm
+wator.o: $(BITMAPDIR)/fish-6.xbm
+wator.o: $(BITMAPDIR)/fish-7.xbm
+wator.o: $(BITMAPDIR)/shark-0.xbm
+wator.o: $(BITMAPDIR)/shark-1.xbm
+wator.o: $(BITMAPDIR)/shark-2.xbm
+wator.o: $(BITMAPDIR)/shark-3.xbm
+wator.o: $(BITMAPDIR)/shark-4.xbm
+wator.o: $(BITMAPDIR)/shark-5.xbm
+wator.o: $(BITMAPDIR)/shark-6.xbm
+wator.o: $(BITMAPDIR)/shark-7.xbm
+wire.o: $(UTILDIR)/xlock.h
+wire.o: ../config.h
+wire.o: $(UTILDIR)/mode.h
+wire.o: $(UTILDIR)/random.h
+wire.o: $(UTILDIR)/automata.h
+world.o: $(UTILDIR)/xlock.h
+world.o: ../config.h
+world.o: $(UTILDIR)/mode.h
+world.o: $(UTILDIR)/random.h
+world.o: $(BITMAPDIR)/terra-00.xbm
+world.o: $(BITMAPDIR)/terra-01.xbm
+world.o: $(BITMAPDIR)/terra-02.xbm
+world.o: $(BITMAPDIR)/terra-03.xbm
+world.o: $(BITMAPDIR)/terra-04.xbm
+world.o: $(BITMAPDIR)/terra-05.xbm
+world.o: $(BITMAPDIR)/terra-06.xbm
+world.o: $(BITMAPDIR)/terra-07.xbm
+world.o: $(BITMAPDIR)/terra-08.xbm
+world.o: $(BITMAPDIR)/terra-09.xbm
+world.o: $(BITMAPDIR)/terra-10.xbm
+world.o: $(BITMAPDIR)/terra-11.xbm
+world.o: $(BITMAPDIR)/terra-12.xbm
+world.o: $(BITMAPDIR)/terra-13.xbm
+world.o: $(BITMAPDIR)/terra-14.xbm
+world.o: $(BITMAPDIR)/terra-15.xbm
+world.o: $(BITMAPDIR)/terra-16.xbm
+world.o: $(BITMAPDIR)/terra-17.xbm
+world.o: $(BITMAPDIR)/terra-18.xbm
+world.o: $(BITMAPDIR)/terra-19.xbm
+world.o: $(BITMAPDIR)/terra-20.xbm
+world.o: $(BITMAPDIR)/terra-21.xbm
+world.o: $(BITMAPDIR)/terra-22.xbm
+world.o: $(BITMAPDIR)/terra-23.xbm
+world.o: $(BITMAPDIR)/terra-24.xbm
+world.o: $(BITMAPDIR)/terra-25.xbm
+world.o: $(BITMAPDIR)/terra-26.xbm
+world.o: $(BITMAPDIR)/terra-27.xbm
+world.o: $(BITMAPDIR)/terra-28.xbm
+world.o: $(BITMAPDIR)/terra-29.xbm
+worm.o: $(UTILDIR)/xlock.h
+worm.o: ../config.h
+worm.o: $(UTILDIR)/mode.h
+worm.o: $(UTILDIR)/random.h
+xcl.o: $(UTILDIR)/xlock.h
+xcl.o: ../config.h
+xcl.o: $(UTILDIR)/mode.h
+xcl.o: $(UTILDIR)/random.h
+xcl.o: xcl.h
+xjack.o: $(UTILDIR)/xlock.h
+xjack.o: ../config.h
+xjack.o: $(UTILDIR)/mode.h
+xjack.o: $(UTILDIR)/random.h
+xjack.o: $(UTILDIR)/iostuff.h
+bomb.o: $(UTILDIR)/xlock.h
+bomb.o: ../config.h
+bomb.o: $(UTILDIR)/mode.h
+bomb.o: $(UTILDIR)/random.h
+bomb.o: $(UTILDIR)/iostuff.h
+blank.o: $(UTILDIR)/xlock.h
+blank.o: ../config.h
+blank.o: $(UTILDIR)/mode.h
+blank.o: $(UTILDIR)/random.h
+random.o: $(UTILDIR)/xlock.h
+random.o: ../config.h
+random.o: $(UTILDIR)/mode.h
+random.o: $(UTILDIR)/random.h
+random.o: $(UTILDIR)/color.h
+random.o: $(UTILDIR)/util.h
diff --git a/modes/Makefile.inxs b/modes/Makefile.inxs
new file mode 100644 (file)
index 0000000..866292b
--- /dev/null
@@ -0,0 +1,1733 @@
+# xlockmore/modes/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# the `../../configure' script generates `xlockmore/modes/Makefile' from this file.
+
+@SET_MAKE@
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+srcdir         = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH          = @srcdir@
+
+install_prefix =
+prefix         = @prefix@
+exec_prefix    = @exec_prefix@
+bindir         = @bindir@
+mandir         = @mandir@
+man1dir                = $(mandir)/man1
+mansuffix      = 1
+
+CC             = @CC@
+CFLAGS         = @CFLAGS@
+LDFLAGS                = @LDFLAGS@
+DEFS           = -DSTANDALONE @DEFS@
+LIBS           = @LIBS@
+
+DEPEND         = @DEPEND@
+DEPEND_FLAGS   = @DEPEND_FLAGS@
+DEPEND_DEFINES = @DEPEND_DEFINES@
+
+SHELL          = /bin/sh
+INSTALL                = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA   = @INSTALL_DATA@
+HACKDIR                = @HACKDIR@
+
+X_CFLAGS       = @X_CFLAGS@
+X_LIBS         = @X_LIBS@
+X_PRE_LIBS     = @X_PRE_LIBS@
+X_EXTRA_LIBS   = @X_EXTRA_LIBS@
+
+HACK_PRE  = $(LIBS) $(X_LIBS) $(X_PRE_LIBS)
+HACK_POST = -lXt -lX11 -lXext $(X_EXTRA_LIBS) -lm
+HACK_LIBS = $(HACK_PRE)            @HACK_LIBS@ $(HACK_POST)
+XPM_LIBS  = $(HACK_PRE) @XPM_LIBS@ @HACK_LIBS@ $(HACK_POST)
+XLOCK_LIBS  = $(HACK_LIBS)
+
+#XS    = $(topdir)
+XS     = $(srcdir)/../..
+HACK_SRC       = $(XS)/hacks
+HACK_BIN       = ../../hacks
+UTILS_SRC      = $(XS)/utils
+UTILS_BIN      = ../../utils
+XLOCK_SRC      = $(XS)/xlockmore/xlock
+XLOCK_BIN      = ../xlock
+
+INCLUDES       = -I$(srcdir) -I$(XLOCK_SRC) -I$(UTILS_SRC) -I$(HACK_SRC) \
+                 -I$(HACK_SRC)/.. -I.. @INCLUDES@
+
+UTIL_SRCS = $(UTILS_SRC)/alpha.c $(UTILS_SRC)/colors.c \
+      $(UTILS_SRC)/grabscreen.c $(UTILS_SRC)/hsv.c \
+      $(UTILS_SRC)/resources.c $(UTILS_SRC)/spline.c \
+      $(UTILS_SRC)/usleep.c $(UTILS_SRC)/visual.c \
+      $(UTILS_SRC)/xroger.c $(UTILS_SRC)/yarandom.c \
+      $(UTILS_SRC)/erase.c $(UTILS_SRC)/sgivideo.c
+
+XLOCKMORE_SRCS = $(XLOCK_SRC)/automata.c $(XLOCK_SRC)/iostuff.c $(XLOCK_SRC)/spline.c $(XLOCK_SRC)/xbm.c
+
+UTIL_OBJS = $(UTILS_BIN)/alpha.o $(UTILS_BIN)/colors.o \
+      $(UTILS_BIN)/grabscreen.o $(UTILS_BIN)/hsv.o \
+      $(UTILS_BIN)/resources.o $(UTILS_BIN)/spline.o \
+      $(UTILS_BIN)/usleep.o $(UTILS_BIN)/visual.o \
+      $(UTILS_BIN)/xroger.o $(UTILS_BIN)/yarandom.o \
+      $(UTILS_BIN)/erase.o $(UTILS_BIN)/sgivideo.o
+
+XLOCKMORE_OBJS = $(XLOCK_BIN)/automata.o $(XLOCK_BIN)/iostuff.o $(XLOCK_BIN)/spline.o $(XLOCK_BIN)/xbm.o
+
+#
+
+XLOCKMODEOBJS = ant.o ball.o bat.o blot.o \
+bouboule.o bounce.o braid.o bubble.o bug.o \
+clock.o coral.o crystal.o \
+daisy.o deco.o dclock.o demon.o dilemma.o discrete.o drift.o \
+eyes.o fadeplot.o flag.o flame.o flow.o forest.o \
+galaxy.o goop.o grav.o \
+helix.o hop.o hyper.o \
+ico.o ifs.o image.o julia.o kaleid.o \
+laser.o life.o life1d.o life3d.o \
+lightning.o lisa.o lissie.o loop.o \
+mandelbrot.o marquee.o maze.o mountain.o munch.o nose.o \
+pacman.o penrose.o petal.o puzzle.o pyro.o \
+qix.o roll.o rotor.o \
+shape.o sierpinski.o slip.o \
+sphere.o spiral.o spline.o \
+star.o strange.o swarm.o swirl.o \
+thornbird.o triangle.o tube.o turtle.o \
+vines.o voters.o \
+wator.o wire.o world.o worm.o xcl.o \
+blank.o bomb.o
+# @XPM@XLOCKXPMOBJS =
+# @BOMB@XLOCKBOMBOBJS = $(DOM)bomb.o
+# XLOCKUTILMODEOBJS = $(XLOCKBOMBOBJS)$(S)$(DOM)blank.o random.o
+XLOCKALLMODEOBJS = $(XLOCKMODEOBJS)$(S)\
+$(XLOCKXPMOBJS)$(S)$(XLOCKGLOBJS)$(S)$(XLOCKUTILMODEOBJS)
+XLOCKALLUTILOBJS = $(XLOCKUTILOBJS)$(XLOCKDEBUGOBJS)
+OBJS = $(XLOCKALLUTILOBJS)$(S)$(XLOCKALLMODEOBJS)
+
+# List of source files
+BITMAPS = eyes.xbm flag.xbm ghost.xbm image.xbm life.xbm life1d.xbm \
+maze.xbm puzzle.xbm
+PIXMAPS = flag.xpm image.xpm maze.xpm puzzle.xpm
+
+XLOCKMODESRCS = ant.c ball.c bat.c blot.c \
+bouboule.c bounce.c braid.c bubble.c bug.c \
+clock.c coral.c crystal.c \
+daisy.c dclock.c deco.c demon.c dilemma.c discrete.c drift.c \
+eyes.c fadeplot.c flag.c flame.c flow.c forest.c \
+galaxy.c goop.c grav.c \
+helix.c hop.c hyper.c \
+ico.c ifs.c image.c julia.c kaleid.c \
+laser.c life.c life1d.c life3d.c \
+lightning.c lisa.c lissie.c loop.c \
+mandelbrot.c marquee.c maze.c mountain.c munch.c nose.c \
+pacman.c penrose.c petal.c puzzle.c pyro.c \
+qix.c roll.c rotor.c \
+shape.c sierpinski.c slip.c \
+sphere.c spiral.c spline.c \
+star.c strange.c swarm.c swirl.c \
+thornbird.c triangle.c tube.c turtle.c \
+vines.c voters.c \
+wator.c wire.c world.c worm.c xcl.c \
+blank.c bomb.c
+# @XPM@XLOCKXPMSRCS =
+# @BOMB@XLOCKBOMBSRCS = bomb.c
+# XLOCKUTILMODESRCS = $(XLOCKBOMBSRCS) blank.c random.c
+SRCS = $(XLOCKUTILSRCS) $(XLOCKXPMSRCS) $(XLOCKGLSRCS) \
+$(XLOCKMODESRCS) $(XLOCKUTILMODESRCS)
+
+XLOCKMODEEXES  = ant ball bat blot \
+bouboule bounce braid bubble bug \
+clock coral crystal \
+daisy dclock deco demon dilemma discrete drift \
+eyes fadeplot flame flag flow forest \
+galaxy goop grav \
+helix hop hyper \
+ico ifs image julia kaleid \
+laser life life1d life3d \
+lightning lisa lissie loop \
+mandelbrot marquee maze mountain munch nose \
+pacman penrose petal puzzle pyro \
+qix roll rotor \
+shape sierpinski slip \
+sphere spiral spline \
+star strange swarm swirl \
+thornbird triangle tube turtle \
+vines voters \
+wator wire world worm xcl \
+blank bomb
+# @XPM@XLOCKXPMEXES =
+# @BOMB@XLOCKBOMBEXES = bomb
+# XLOCKUTILMODEEXES = $(XLOCKBOMBEXES) blank random
+EXES = $(XLOCKUTILEXES) $(XLOCKXPMEXES) $(XLOCKGLEXES) \
+$(XLOCKMODEEXES) $(XLOCKUTILMODEEXES)
+
+HACK_OBJS_1 = $(UTILS_BIN)/resources.o $(UTILS_BIN)/visual.o \
+ $(UTILS_BIN)/usleep.o $(UTILS_BIN)/yarandom.o @XMU_OBJS@
+HACK_OBJS = $(HACK_BIN)/screenhack.o $(HACK_OBJS_1)
+XLOCK_OBJS  = $(HACK_BIN)/screenhack-xlock.o $(XLOCK_BIN)/xlock.o $(COLOR_OBJS) $(HACK_OBJS_1)
+COLOR_OBJS  = $(UTILS_BIN)/hsv.o $(UTILS_BIN)/colors.o
+GRAB_OBJS_1 = $(UTILS_BIN)/grabscreen.o $(SGI_VIDEO_OBJS)
+GRAB_OBJS = $(GRAB_OBJS_1) $(COLOR_OBJS)
+GRAB_LIBS = $(SGI_VIDEO_LIBS)
+
+HDRS           =
+MEN            =
+EXTRAS         = README Makefile.in
+
+TARFILES       = $(SRCS) $(HDRS) $(MEN) $(EXTRAS)
+
+
+all: $(EXES)
+
+install:   install-program   install-man
+uninstall: uninstall-program uninstall-man
+
+install-strip:
+       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
+
+install-program:
+       @exes="$(EXES)" ;                                               \
+       for program in $$exes; do                                       \
+         echo $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ;      \
+         $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ;           \
+       done
+
+install-man:
+       @men="$(MEN)" ;                                                 \
+       for man in $$men; do                                            \
+         instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
+         echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ;  \
+         $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ;       \
+       done
+
+uninstall-program:
+       @for program in $(EXES); do                                     \
+         echo rm -f $(HACKDIR)/$$program ;                             \
+         rm -f $(HACKDIR)/$$program ;                                  \
+       done
+
+uninstall-man:
+       @men="$(MEN)" ;                                                 \
+       for man in $$men; do                                            \
+         instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
+         echo rm -f $(man1dir)/$$instname ;                            \
+         rm -f $(man1dir)/$$instname ;                                 \
+       done
+
+clean:
+       -rm -f *.o a.out core $(EXES)
+
+distclean: clean
+       -rm -f Makefile *~ "#"*
+
+# Adds all current dependencies to Makefile
+depend:
+       $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
+       $(DEPEND_FLAGS) --                                                  \
+       $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
+       $(SRCS)
+
+# Adds some dependencies to Makefile.in -- not totally accurate, but pretty
+# close.  This excludes dependencies on files in /usr/include, etc.  It tries
+# to include only dependencies on files which are themselves a part of this
+# package.
+distdepend:
+       @echo updating dependencies in `pwd`/Makefile.in... ;               \
+       $(DEPEND) -w 0 -f -                                                 \
+       -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
+       $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
+       $(SRCS) |                                                           \
+       (                                                                   \
+         awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
+         sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
+             -e 's@\.\./\.\./utils@$$(UTILS_SRC)@g'                        \
+             -e 's@\.\./glx/@@g'                                           \
+             -e 's@ \.\./@ $$(HACK_SRC)/@g'                                \
+             -e 's@ \([^$$]\)@ $$(srcdir)/\1@g'                            \
+             -e 's@ $$(srcdir)/\(.*config.h\)@ \1@g' ;                     \
+         echo ''                                                           \
+       ) > /tmp/distdepend.$$$$ &&                                         \
+       mv Makefile.in Makefile.in.bak &&                                   \
+       mv /tmp/distdepend.$$$$ Makefile.in
+
+TAGS: tags
+tags:
+       find $(srcdir) -name '*.[chly]' -print | xargs etags -a
+
+echo_tarfiles:
+       @echo $(TARFILES)
+
+BITMAPTYPE = x11
+PIXMAPTYPE = x11
+#BITMAPTYPE = @BITMAPTYPE@
+#PIXMAPTYPE = @PIXMAPTYPE@
+
+# Here is your chance to override the default icon:
+TINYBITMAP = $(BITMAPTYPE)
+TINYBITMAP = t-x11
+SMALLBITMAP = s-$(BITMAPTYPE)
+MEDIUMBITMAP = m-$(BITMAPTYPE)
+LARGEBITMAP = l-$(BITMAPTYPE)
+MEDIUMPIXMAP = m-$(PIXMAPTYPE)
+LARGEPIXMAP = l-$(PIXMAPTYPE)
+
+#EYESBITMAP = $(MEDIUMBITMAP)
+EYESBITMAP = m-grelb
+FLAGBITMAP = $(MEDIUMBITMAP)
+IMAGEBITMAP = $(MEDIUMBITMAP)
+#IMAGEBITMAP = l-bob #Slackware icon
+#IMAGEBITMAP = m-xlock #XLock icon
+LIFEBITMAP = $(TINYBITMAP)
+#LIFEBITMAP = $(SMALLBITMAP)
+#LIFEBITMAP = s-grelb
+LIFE1DBITMAP = $(TINYBITMAP)
+MAZEBITMAP = $(LARGEBITMAP)
+#MAZEBITMAP = m-xlock
+#PACMANBITMAP = $(MEDIUMBITMAP)
+PACMANBITMAP = m-ghost
+#PUZZLEBITMAP = $(LARGEBITMAP)
+PUZZLEBITMAP = l-xlock
+#PUZZLEBITMAP = l-linux
+FLAGPIXMAP = $(MEDIUMPIXMAP)
+#FLAGPIXMAP = m-xlock
+IMAGEPIXMAP = $(MEDIUMPIXMAP)
+#IMAGEPIXMAP = m-xlock
+MAZEPIXMAP = $(MEDIUMPIXMAP)
+#MAZEPIXMAP = m-xlock
+#PUZZLEPIXMAP = $(LARGEPIXMAP)
+PUZZLEPIXMAP = l-xlock
+#PUZZLEPIXMAP = l-linux
+
+eyes.o: eyes.c eyes.xbm
+life.o : life.c life.xbm
+life1d.o : life1d.c life1d.xbm
+pacman.o : pacman.c ghost.xbm
+# Do not need xpm files if not using them but not worth figuring out
+flag.o : flag.c flag.xbm flag.xpm
+image.o : image.c image.xbm image.xpm
+maze.o : maze.c maze.xbm maze.xpm
+puzzle.o : puzzle.c puzzle.xbm puzzle.xpm
+
+BITMAPDIR = $(HACK_SRC)/../xlockmore/bitmaps/
+PIXMAPDIR = $(HACK_SRC)/../xlockmore/pixmaps/
+LN_S = ln -s
+
+eyes.xbm : $(BITMAPDIR)$(EYESBITMAP).xbm
+       $(RM) eyes.xbm ; $(LN_S) $(BITMAPDIR)$(EYESBITMAP).xbm eyes.xbm
+
+flag.xbm : $(BITMAPDIR)$(FLAGBITMAP).xbm
+       $(RM) flag.xbm ; $(LN_S) $(BITMAPDIR)$(FLAGBITMAP).xbm flag.xbm
+
+image.xbm : $(BITMAPDIR)$(IMAGEBITMAP).xbm
+       $(RM) image.xbm ; $(LN_S) $(BITMAPDIR)$(IMAGEBITMAP).xbm image.xbm
+
+ghost.xbm : $(BITMAPDIR)$(PACMANBITMAP).xbm
+       $(RM) ghost.xbm ; $(LN_S) $(BITMAPDIR)$(PACMANBITMAP).xbm ghost.xbm
+
+life.xbm : $(BITMAPDIR)$(LIFEBITMAP).xbm
+       $(RM) life.xbm ; $(LN_S) $(BITMAPDIR)$(LIFEBITMAP).xbm life.xbm
+
+life1d.xbm : $(BITMAPDIR)$(LIFE1DBITMAP).xbm
+       $(RM) life1d.xbm ; $(LN_S) $(BITMAPDIR)$(LIFE1DBITMAP).xbm life1d.xbm
+
+maze.xbm : $(BITMAPDIR)$(MAZEBITMAP).xbm
+       $(RM) maze.xbm ; $(LN_S) $(BITMAPDIR)$(MAZEBITMAP).xbm maze.xbm
+
+puzzle.xbm : $(BITMAPDIR)$(PUZZLEBITMAP).xbm
+       $(RM) puzzle.xbm ; $(LN_S) $(BITMAPDIR)$(PUZZLEBITMAP).xbm puzzle.xbm
+
+flag.xpm : $(PIXMAPDIR)$(FLAGPIXMAP).xpm
+       $(RM) flag.xpm ; $(LN_S) $(PIXMAPDIR)$(FLAGPIXMAP).xpm flag.xpm
+
+image.xpm : $(PIXMAPDIR)$(IMAGEPIXMAP).xpm
+       $(RM) image.xpm ; $(LN_S) $(PIXMAPDIR)$(IMAGEPIXMAP).xpm image.xpm
+
+maze.xpm : $(PIXMAPDIR)$(MAZEPIXMAP).xpm
+       $(RM) maze.xpm ; $(LN_S) $(PIXMAPDIR)$(MAZEPIXMAP).xpm maze.xpm
+
+puzzle.xpm : $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm
+       $(RM) puzzle.xpm ; $(LN_S) $(PIXMAPDIR)$(PUZZLEPIXMAP).xpm puzzle.xpm
+
+# Rules for noticing when the objects from the utils directory are out of
+# date with respect to their sources, and going and building them according
+# to the rules in their own Makefile...
+#
+$(UTILS_BIN)/alpha.o:   $(UTILS_SRC)/alpha.c
+$(UTILS_BIN)/colors.o:    $(UTILS_SRC)/colors.c
+$(UTILS_BIN)/grabscreen.o:  $(UTILS_SRC)/grabscreen.c
+$(UTILS_BIN)/sgivideo.o:  $(UTILS_SRC)/sgivideo.c
+$(UTILS_BIN)/hsv.o:   $(UTILS_SRC)/hsv.c
+$(UTILS_BIN)/resources.o: $(UTILS_SRC)/resources.c
+$(UTILS_BIN)/spline.o:    $(UTILS_SRC)/spline.c
+$(UTILS_BIN)/usleep.o:    $(UTILS_SRC)/usleep.c
+$(UTILS_BIN)/visual.o:    $(UTILS_SRC)/visual.c
+$(UTILS_BIN)/xmu.o:   $(UTILS_SRC)/xmu.c
+$(UTILS_BIN)/xroger.o:    $(UTILS_SRC)/xroger.c
+$(UTILS_BIN)/yarandom.o:  $(UTILS_SRC)/yarandom.c
+$(UTILS_BIN)/erase.o:   $(UTILS_SRC)/erase.c
+
+$(XLOCK_BIN)/automata.o:   $(XLOCK_SRC)/automata.c
+$(XLOCK_BIN)/iostuff.o:   $(XLOCK_SRC)/iostuff.c
+$(XLOCK_BIN)/xbm.o:   $(XLOCK_SRC)/xbm.c
+$(XLOCK_BIN)/spline.o:   $(XLOCK_SRC)/spline.c
+
+$(UTIL_OBJS):
+       cd $(UTILS_BIN) ; \
+       $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+$(XLOCKMORE_OBJS):
+       cd $(XLOCK_BIN) ; \
+       $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+# How we build object files in this directory.
+.c.o:
+       $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
+
+# Some hacks use a slightly-differently-compiled variant of this file.
+# This is how to make the the other .o file from it.
+#
+$(HACK_BIN)/screenhack-xlock.o: $(HACK_SRC)/screenhack.c
+       $(CC) -o $@ -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) \
+ -DXLOCKMORE $(HACK_SRC)/screenhack.c
+
+# Some abbreviations to keep the lines short...
+ALP   = $(HSV) $(UTILS_BIN)/alpha.o
+HSV   = $(UTILS_BIN)/hsv.o
+#SPL   = $(UTILS_BIN)/spline.o
+XROG    = $(UTILS_BIN)/xroger.o $(SPL)
+GRAB    = $(GRAB_OBJS)
+ERASE   = $(UTILS_BIN)/erase.o
+AUTOMATA   = $(XLOCK_BIN)/automata.o
+IOSTUFF   = $(XLOCK_BIN)/iostuff.o $(XLOCK_BIN)/xbm.o
+SPLINE   = $(XLOCK_BIN)/spline.o
+COL   = $(COLOR_OBJS)
+
+$(XLOCK_BIN)/xlock.o: $(XLOCK_SRC)/xlock.c
+       cd $(XLOCK_BIN)  ; $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)"
+
+
+CC_HACK                = $(CC) $(LDFLAGS)
+
+ant:           ant.o   $(XLOCK_OBJS) $(AUTOMATA) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(ERASE) $(HACK_LIBS)
+
+ball:          ball.o  $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+bat:           bat.o   $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(XPM_LIBS)
+
+blank:         blank.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+blot:          blot.o          $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+bomb:          bomb.o          $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(HACK_LIBS)
+
+bouboule:              bouboule.o              $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+bounce:                bounce.o                $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+braid:         braid.o         $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+bubble:                bubble.o                $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+bug:           bug.o           $(XLOCK_OBJS) $(AUTOMATA)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(HACK_LIBS)
+
+clock:         clock.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+coral:         coral.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+crystal:               crystal.o               $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+daisy:         daisy.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+dclock:                dclock.o                $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(HACK_LIBS)
+
+deco:          deco.o          $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+demon:         demon.o         $(XLOCK_OBJS) $(AUTOMATA)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(HACK_LIBS)
+
+dilemma:               dilemma.o               $(XLOCK_OBJS) $(AUTOMATA)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(HACK_LIBS)
+
+discrete:              discrete.o              $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+drift:         drift.o         $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+eyes:          eyes.o          $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(HACK_LIBS)
+
+fadeplot:              fadeplot.o              $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+flag:          flag.o          $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(XPM_LIBS)
+
+flame:         flame.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+flow:          flow.o          $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+forest:                forest.o                $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+galaxy:                galaxy.o                $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+goop:          goop.o          $(XLOCK_OBJS) $(SPLINE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(SPLINE) $(HACK_LIBS)
+
+grav:          grav.o          $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+helix:         helix.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+hop:           hop.o           $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+hyper:         hyper.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+ico:           ico.o           $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+ifs:           ifs.o           $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+image:         image.o         $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(XPM_LIBS)
+
+julia:         julia.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+kaleid:                kaleid.o                $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+laser:         laser.o         $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+life:          life.o          $(XLOCK_OBJS) $(AUTOMATA) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(IOSTUFF) $(HACK_LIBS)
+
+life1d:                life1d.o        $(XLOCK_OBJS) $(AUTOMATA) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(IOSTUFF) $(HACK_LIBS)
+
+life3d:                life3d.o        $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(HACK_LIBS)
+
+lightning:  lightning.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+lisa:   lisa.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+lissie:   lissie.o      $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+loop:   loop.o  $(XLOCK_OBJS) $(AUTOMATA)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(HACK_LIBS)
+
+mandelbrot:   mandelbrot.o      $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+marquee:   marquee.o    $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(HACK_LIBS)
+
+maze:   maze.o  $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(XPM_LIBS)
+
+mountain: mountain.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+munch: munch.o  $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+nose:  nose.o  $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(HACK_LIBS)
+
+pacman:  pacman.o      $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(HACK_LIBS)
+
+penrose:  penrose.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+petal:  petal.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+puzzle:  puzzle.o      $(XLOCK_OBJS) $(IOSTUFF)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(IOSTUFF) $(XPM_LIBS)
+
+pyro:  pyro.o  $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+qix:  qix.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+random:                random.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+roll:  roll.o  $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+rotor:    rotor.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+shape: shape.o  $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+sierpinski: sierpinski.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+slip:   slip.o    $(XLOCK_OBJS) $(GRAB)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(GRAB_OBJS_1) $(HACK_LIBS) $(GRAB_LIBS)
+
+sphere:   sphere.o      $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+spiral:   spiral.o      $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+spline:  spline.o      $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+star:  star.o  $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+strange:  strange.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+swarm:    swarm.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+swirl:    swirl.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+thornbird:             thornbird.o     $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+triangle: triangle.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+tube: tube.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+turtle: turtle.o        $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+vines:    vines.o          $(XLOCK_OBJS) $(ERASE)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+voters:    voters.o        $(XLOCK_OBJS) $(AUTOMATA)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(HACK_LIBS)
+
+wator:   wator.o          $(XLOCK_OBJS) $(AUTOMATA)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(HACK_LIBS)
+
+wire:   wire.o    $(XLOCK_OBJS) $(AUTOMATA)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(AUTOMATA) $(HACK_LIBS)
+
+world:   world.o          $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+worm:   worm.o    $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+xcl:    xcl.o     $(XLOCK_OBJS)
+       $(CC_HACK) -o $@ $@.o   $(XLOCK_OBJS) $(HACK_LIBS)
+
+##############################################################################
+#
+# DO NOT DELETE: updated by make distdepend
+
+ant.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+ant.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+ant.o: $(HACK_SRC)/../config.h
+ant.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+ant.o: $(HACK_SRC)/../hacks/screenhack.h
+ant.o: $(UTILS_SRC)/yarandom.h
+ant.o: $(UTILS_SRC)/usleep.h
+ant.o: $(UTILS_SRC)/resources.h
+ant.o: $(UTILS_SRC)/hsv.h
+ant.o: $(UTILS_SRC)/colors.h
+ant.o: $(UTILS_SRC)/grabscreen.h
+ant.o: $(UTILS_SRC)/visual.h
+ant.o: $(UTILS_SRC)/erase.h
+ant.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+ball.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+ball.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+ball.o: $(HACK_SRC)/../config.h
+ball.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+ball.o: $(HACK_SRC)/../hacks/screenhack.h
+ball.o: $(UTILS_SRC)/yarandom.h
+ball.o: $(UTILS_SRC)/usleep.h
+ball.o: $(UTILS_SRC)/resources.h
+ball.o: $(UTILS_SRC)/hsv.h
+ball.o: $(UTILS_SRC)/colors.h
+ball.o: $(UTILS_SRC)/grabscreen.h
+ball.o: $(UTILS_SRC)/visual.h
+bat.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+bat.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+bat.o: $(HACK_SRC)/../config.h
+bat.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+bat.o: $(HACK_SRC)/../hacks/screenhack.h
+bat.o: $(UTILS_SRC)/yarandom.h
+bat.o: $(UTILS_SRC)/usleep.h
+bat.o: $(UTILS_SRC)/resources.h
+bat.o: $(UTILS_SRC)/hsv.h
+bat.o: $(UTILS_SRC)/colors.h
+bat.o: $(UTILS_SRC)/grabscreen.h
+bat.o: $(UTILS_SRC)/visual.h
+bat.o: $(HACK_SRC)/../xlockmore/bitmaps/bat-0.xbm
+bat.o: $(HACK_SRC)/../xlockmore/bitmaps/bat-1.xbm
+bat.o: $(HACK_SRC)/../xlockmore/bitmaps/bat-2.xbm
+bat.o: $(HACK_SRC)/../xlockmore/bitmaps/bat-3.xbm
+bat.o: $(HACK_SRC)/../xlockmore/bitmaps/bat-4.xbm
+blot.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+blot.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+blot.o: $(HACK_SRC)/../config.h
+blot.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+blot.o: $(HACK_SRC)/../hacks/screenhack.h
+blot.o: $(UTILS_SRC)/yarandom.h
+blot.o: $(UTILS_SRC)/usleep.h
+blot.o: $(UTILS_SRC)/resources.h
+blot.o: $(UTILS_SRC)/hsv.h
+blot.o: $(UTILS_SRC)/colors.h
+blot.o: $(UTILS_SRC)/grabscreen.h
+blot.o: $(UTILS_SRC)/visual.h
+bouboule.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+bouboule.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+bouboule.o: $(HACK_SRC)/../config.h
+bouboule.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+bouboule.o: $(HACK_SRC)/../hacks/screenhack.h
+bouboule.o: $(UTILS_SRC)/yarandom.h
+bouboule.o: $(UTILS_SRC)/usleep.h
+bouboule.o: $(UTILS_SRC)/resources.h
+bouboule.o: $(UTILS_SRC)/hsv.h
+bouboule.o: $(UTILS_SRC)/colors.h
+bouboule.o: $(UTILS_SRC)/grabscreen.h
+bouboule.o: $(UTILS_SRC)/visual.h
+bounce.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+bounce.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+bounce.o: $(HACK_SRC)/../config.h
+bounce.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+bounce.o: $(HACK_SRC)/../hacks/screenhack.h
+bounce.o: $(UTILS_SRC)/yarandom.h
+bounce.o: $(UTILS_SRC)/usleep.h
+bounce.o: $(UTILS_SRC)/resources.h
+bounce.o: $(UTILS_SRC)/hsv.h
+bounce.o: $(UTILS_SRC)/colors.h
+bounce.o: $(UTILS_SRC)/grabscreen.h
+bounce.o: $(UTILS_SRC)/visual.h
+bounce.o: $(HACK_SRC)/../xlockmore/bitmaps/bounce-0.xbm
+bounce.o: $(HACK_SRC)/../xlockmore/bitmaps/bounce-1.xbm
+bounce.o: $(HACK_SRC)/../xlockmore/bitmaps/bounce-2.xbm
+bounce.o: $(HACK_SRC)/../xlockmore/bitmaps/bounce-3.xbm
+bounce.o: $(HACK_SRC)/../xlockmore/bitmaps/bounce-mask.xbm
+braid.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+braid.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+braid.o: $(HACK_SRC)/../config.h
+braid.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+braid.o: $(HACK_SRC)/../hacks/screenhack.h
+braid.o: $(UTILS_SRC)/yarandom.h
+braid.o: $(UTILS_SRC)/usleep.h
+braid.o: $(UTILS_SRC)/resources.h
+braid.o: $(UTILS_SRC)/hsv.h
+braid.o: $(UTILS_SRC)/colors.h
+braid.o: $(UTILS_SRC)/grabscreen.h
+braid.o: $(UTILS_SRC)/visual.h
+braid.o: $(UTILS_SRC)/erase.h
+bubble.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+bubble.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+bubble.o: $(HACK_SRC)/../config.h
+bubble.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+bubble.o: $(HACK_SRC)/../hacks/screenhack.h
+bubble.o: $(UTILS_SRC)/yarandom.h
+bubble.o: $(UTILS_SRC)/usleep.h
+bubble.o: $(UTILS_SRC)/resources.h
+bubble.o: $(UTILS_SRC)/hsv.h
+bubble.o: $(UTILS_SRC)/colors.h
+bubble.o: $(UTILS_SRC)/grabscreen.h
+bubble.o: $(UTILS_SRC)/visual.h
+bug.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+bug.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+bug.o: $(HACK_SRC)/../config.h
+bug.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+bug.o: $(HACK_SRC)/../hacks/screenhack.h
+bug.o: $(UTILS_SRC)/yarandom.h
+bug.o: $(UTILS_SRC)/usleep.h
+bug.o: $(UTILS_SRC)/resources.h
+bug.o: $(UTILS_SRC)/hsv.h
+bug.o: $(UTILS_SRC)/colors.h
+bug.o: $(UTILS_SRC)/grabscreen.h
+bug.o: $(UTILS_SRC)/visual.h
+bug.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+clock.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+clock.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+clock.o: $(HACK_SRC)/../config.h
+clock.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+clock.o: $(HACK_SRC)/../hacks/screenhack.h
+clock.o: $(UTILS_SRC)/yarandom.h
+clock.o: $(UTILS_SRC)/usleep.h
+clock.o: $(UTILS_SRC)/resources.h
+clock.o: $(UTILS_SRC)/hsv.h
+clock.o: $(UTILS_SRC)/colors.h
+clock.o: $(UTILS_SRC)/grabscreen.h
+clock.o: $(UTILS_SRC)/visual.h
+coral.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+coral.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+coral.o: $(HACK_SRC)/../config.h
+coral.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+coral.o: $(HACK_SRC)/../hacks/screenhack.h
+coral.o: $(UTILS_SRC)/yarandom.h
+coral.o: $(UTILS_SRC)/usleep.h
+coral.o: $(UTILS_SRC)/resources.h
+coral.o: $(UTILS_SRC)/hsv.h
+coral.o: $(UTILS_SRC)/colors.h
+coral.o: $(UTILS_SRC)/grabscreen.h
+coral.o: $(UTILS_SRC)/visual.h
+crystal.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+crystal.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+crystal.o: $(HACK_SRC)/../config.h
+crystal.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+crystal.o: $(HACK_SRC)/../hacks/screenhack.h
+crystal.o: $(UTILS_SRC)/yarandom.h
+crystal.o: $(UTILS_SRC)/usleep.h
+crystal.o: $(UTILS_SRC)/resources.h
+crystal.o: $(UTILS_SRC)/hsv.h
+crystal.o: $(UTILS_SRC)/colors.h
+crystal.o: $(UTILS_SRC)/grabscreen.h
+crystal.o: $(UTILS_SRC)/visual.h
+daisy.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+daisy.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+daisy.o: $(HACK_SRC)/../config.h
+daisy.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+daisy.o: $(HACK_SRC)/../hacks/screenhack.h
+daisy.o: $(UTILS_SRC)/yarandom.h
+daisy.o: $(UTILS_SRC)/usleep.h
+daisy.o: $(UTILS_SRC)/resources.h
+daisy.o: $(UTILS_SRC)/hsv.h
+daisy.o: $(UTILS_SRC)/colors.h
+daisy.o: $(UTILS_SRC)/grabscreen.h
+daisy.o: $(UTILS_SRC)/visual.h
+dclock.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+dclock.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+dclock.o: $(HACK_SRC)/../config.h
+dclock.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+dclock.o: $(HACK_SRC)/../hacks/screenhack.h
+dclock.o: $(UTILS_SRC)/yarandom.h
+dclock.o: $(UTILS_SRC)/usleep.h
+dclock.o: $(UTILS_SRC)/resources.h
+dclock.o: $(UTILS_SRC)/hsv.h
+dclock.o: $(UTILS_SRC)/colors.h
+dclock.o: $(UTILS_SRC)/grabscreen.h
+dclock.o: $(UTILS_SRC)/visual.h
+dclock.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+deco.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+deco.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+deco.o: $(HACK_SRC)/../config.h
+deco.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+deco.o: $(HACK_SRC)/../hacks/screenhack.h
+deco.o: $(UTILS_SRC)/yarandom.h
+deco.o: $(UTILS_SRC)/usleep.h
+deco.o: $(UTILS_SRC)/resources.h
+deco.o: $(UTILS_SRC)/hsv.h
+deco.o: $(UTILS_SRC)/colors.h
+deco.o: $(UTILS_SRC)/grabscreen.h
+deco.o: $(UTILS_SRC)/visual.h
+demon.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+demon.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+demon.o: $(HACK_SRC)/../config.h
+demon.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+demon.o: $(HACK_SRC)/../hacks/screenhack.h
+demon.o: $(UTILS_SRC)/yarandom.h
+demon.o: $(UTILS_SRC)/usleep.h
+demon.o: $(UTILS_SRC)/resources.h
+demon.o: $(UTILS_SRC)/hsv.h
+demon.o: $(UTILS_SRC)/colors.h
+demon.o: $(UTILS_SRC)/grabscreen.h
+demon.o: $(UTILS_SRC)/visual.h
+demon.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+dilemma.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+dilemma.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+dilemma.o: $(HACK_SRC)/../config.h
+dilemma.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+dilemma.o: $(HACK_SRC)/../hacks/screenhack.h
+dilemma.o: $(UTILS_SRC)/yarandom.h
+dilemma.o: $(UTILS_SRC)/usleep.h
+dilemma.o: $(UTILS_SRC)/resources.h
+dilemma.o: $(UTILS_SRC)/hsv.h
+dilemma.o: $(UTILS_SRC)/colors.h
+dilemma.o: $(UTILS_SRC)/grabscreen.h
+dilemma.o: $(UTILS_SRC)/visual.h
+dilemma.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+dilemma.o: $(HACK_SRC)/../xlockmore/bitmaps/cooperat.xbm
+dilemma.o: $(HACK_SRC)/../xlockmore/bitmaps/defect.xbm
+discrete.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+discrete.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+discrete.o: $(HACK_SRC)/../config.h
+discrete.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+discrete.o: $(HACK_SRC)/../hacks/screenhack.h
+discrete.o: $(UTILS_SRC)/yarandom.h
+discrete.o: $(UTILS_SRC)/usleep.h
+discrete.o: $(UTILS_SRC)/resources.h
+discrete.o: $(UTILS_SRC)/hsv.h
+discrete.o: $(UTILS_SRC)/colors.h
+discrete.o: $(UTILS_SRC)/grabscreen.h
+discrete.o: $(UTILS_SRC)/visual.h
+discrete.o: $(UTILS_SRC)/erase.h
+drift.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+drift.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+drift.o: $(HACK_SRC)/../config.h
+drift.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+drift.o: $(HACK_SRC)/../hacks/screenhack.h
+drift.o: $(UTILS_SRC)/yarandom.h
+drift.o: $(UTILS_SRC)/usleep.h
+drift.o: $(UTILS_SRC)/resources.h
+drift.o: $(UTILS_SRC)/hsv.h
+drift.o: $(UTILS_SRC)/colors.h
+drift.o: $(UTILS_SRC)/grabscreen.h
+drift.o: $(UTILS_SRC)/visual.h
+drift.o: $(UTILS_SRC)/erase.h
+eyes.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+eyes.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+eyes.o: $(HACK_SRC)/../config.h
+eyes.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+eyes.o: $(HACK_SRC)/../hacks/screenhack.h
+eyes.o: $(UTILS_SRC)/yarandom.h
+eyes.o: $(UTILS_SRC)/usleep.h
+eyes.o: $(UTILS_SRC)/resources.h
+eyes.o: $(UTILS_SRC)/hsv.h
+eyes.o: $(UTILS_SRC)/colors.h
+eyes.o: $(UTILS_SRC)/grabscreen.h
+eyes.o: $(UTILS_SRC)/visual.h
+eyes.o: $(srcdir)/eyes.xbm
+fadeplot.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+fadeplot.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+fadeplot.o: $(HACK_SRC)/../config.h
+fadeplot.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+fadeplot.o: $(HACK_SRC)/../hacks/screenhack.h
+fadeplot.o: $(UTILS_SRC)/yarandom.h
+fadeplot.o: $(UTILS_SRC)/usleep.h
+fadeplot.o: $(UTILS_SRC)/resources.h
+fadeplot.o: $(UTILS_SRC)/hsv.h
+fadeplot.o: $(UTILS_SRC)/colors.h
+fadeplot.o: $(UTILS_SRC)/grabscreen.h
+fadeplot.o: $(UTILS_SRC)/visual.h
+flag.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+flag.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+flag.o: $(HACK_SRC)/../config.h
+flag.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+flag.o: $(HACK_SRC)/../hacks/screenhack.h
+flag.o: $(UTILS_SRC)/yarandom.h
+flag.o: $(UTILS_SRC)/usleep.h
+flag.o: $(UTILS_SRC)/resources.h
+flag.o: $(UTILS_SRC)/hsv.h
+flag.o: $(UTILS_SRC)/colors.h
+flag.o: $(UTILS_SRC)/grabscreen.h
+flag.o: $(UTILS_SRC)/visual.h
+flag.o: $(HACK_SRC)/../hacks/images/bob.xbm
+flame.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+flame.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+flame.o: $(HACK_SRC)/../config.h
+flame.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+flame.o: $(HACK_SRC)/../hacks/screenhack.h
+flame.o: $(UTILS_SRC)/yarandom.h
+flame.o: $(UTILS_SRC)/usleep.h
+flame.o: $(UTILS_SRC)/resources.h
+flame.o: $(UTILS_SRC)/hsv.h
+flame.o: $(UTILS_SRC)/colors.h
+flame.o: $(UTILS_SRC)/grabscreen.h
+flame.o: $(UTILS_SRC)/visual.h
+flow.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+flow.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+flow.o: $(HACK_SRC)/../config.h
+flow.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+flow.o: $(HACK_SRC)/../hacks/screenhack.h
+flow.o: $(UTILS_SRC)/yarandom.h
+flow.o: $(UTILS_SRC)/usleep.h
+flow.o: $(UTILS_SRC)/resources.h
+flow.o: $(UTILS_SRC)/hsv.h
+flow.o: $(UTILS_SRC)/colors.h
+flow.o: $(UTILS_SRC)/grabscreen.h
+flow.o: $(UTILS_SRC)/visual.h
+flow.o: $(UTILS_SRC)/erase.h
+forest.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+forest.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+forest.o: $(HACK_SRC)/../config.h
+forest.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+forest.o: $(HACK_SRC)/../hacks/screenhack.h
+forest.o: $(UTILS_SRC)/yarandom.h
+forest.o: $(UTILS_SRC)/usleep.h
+forest.o: $(UTILS_SRC)/resources.h
+forest.o: $(UTILS_SRC)/hsv.h
+forest.o: $(UTILS_SRC)/colors.h
+forest.o: $(UTILS_SRC)/grabscreen.h
+forest.o: $(UTILS_SRC)/visual.h
+forest.o: $(UTILS_SRC)/erase.h
+galaxy.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+galaxy.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+galaxy.o: $(HACK_SRC)/../config.h
+galaxy.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+galaxy.o: $(HACK_SRC)/../hacks/screenhack.h
+galaxy.o: $(UTILS_SRC)/yarandom.h
+galaxy.o: $(UTILS_SRC)/usleep.h
+galaxy.o: $(UTILS_SRC)/resources.h
+galaxy.o: $(UTILS_SRC)/hsv.h
+galaxy.o: $(UTILS_SRC)/colors.h
+galaxy.o: $(UTILS_SRC)/grabscreen.h
+galaxy.o: $(UTILS_SRC)/visual.h
+goop.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+goop.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+goop.o: $(HACK_SRC)/../config.h
+goop.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+goop.o: $(HACK_SRC)/../hacks/screenhack.h
+goop.o: $(UTILS_SRC)/yarandom.h
+goop.o: $(UTILS_SRC)/usleep.h
+goop.o: $(UTILS_SRC)/resources.h
+goop.o: $(UTILS_SRC)/hsv.h
+goop.o: $(UTILS_SRC)/colors.h
+goop.o: $(UTILS_SRC)/grabscreen.h
+goop.o: $(UTILS_SRC)/visual.h
+goop.o: $(HACK_SRC)/../xlockmore/xlock/spline.h
+grav.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+grav.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+grav.o: $(HACK_SRC)/../config.h
+grav.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+grav.o: $(HACK_SRC)/../hacks/screenhack.h
+grav.o: $(UTILS_SRC)/yarandom.h
+grav.o: $(UTILS_SRC)/usleep.h
+grav.o: $(UTILS_SRC)/resources.h
+grav.o: $(UTILS_SRC)/hsv.h
+grav.o: $(UTILS_SRC)/colors.h
+grav.o: $(UTILS_SRC)/grabscreen.h
+grav.o: $(UTILS_SRC)/visual.h
+helix.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+helix.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+helix.o: $(HACK_SRC)/../config.h
+helix.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+helix.o: $(HACK_SRC)/../hacks/screenhack.h
+helix.o: $(UTILS_SRC)/yarandom.h
+helix.o: $(UTILS_SRC)/usleep.h
+helix.o: $(UTILS_SRC)/resources.h
+helix.o: $(UTILS_SRC)/hsv.h
+helix.o: $(UTILS_SRC)/colors.h
+helix.o: $(UTILS_SRC)/grabscreen.h
+helix.o: $(UTILS_SRC)/visual.h
+hop.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+hop.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+hop.o: $(HACK_SRC)/../config.h
+hop.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+hop.o: $(HACK_SRC)/../hacks/screenhack.h
+hop.o: $(UTILS_SRC)/yarandom.h
+hop.o: $(UTILS_SRC)/usleep.h
+hop.o: $(UTILS_SRC)/resources.h
+hop.o: $(UTILS_SRC)/hsv.h
+hop.o: $(UTILS_SRC)/colors.h
+hop.o: $(UTILS_SRC)/grabscreen.h
+hop.o: $(UTILS_SRC)/visual.h
+hop.o: $(UTILS_SRC)/erase.h
+hyper.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+hyper.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+hyper.o: $(HACK_SRC)/../config.h
+hyper.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+hyper.o: $(HACK_SRC)/../hacks/screenhack.h
+hyper.o: $(UTILS_SRC)/yarandom.h
+hyper.o: $(UTILS_SRC)/usleep.h
+hyper.o: $(UTILS_SRC)/resources.h
+hyper.o: $(UTILS_SRC)/hsv.h
+hyper.o: $(UTILS_SRC)/colors.h
+hyper.o: $(UTILS_SRC)/grabscreen.h
+hyper.o: $(UTILS_SRC)/visual.h
+ico.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+ico.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+ico.o: $(HACK_SRC)/../config.h
+ico.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+ico.o: $(HACK_SRC)/../hacks/screenhack.h
+ico.o: $(UTILS_SRC)/yarandom.h
+ico.o: $(UTILS_SRC)/usleep.h
+ico.o: $(UTILS_SRC)/resources.h
+ico.o: $(UTILS_SRC)/hsv.h
+ico.o: $(UTILS_SRC)/colors.h
+ico.o: $(UTILS_SRC)/grabscreen.h
+ico.o: $(UTILS_SRC)/visual.h
+ifs.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+ifs.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+ifs.o: $(HACK_SRC)/../config.h
+ifs.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+ifs.o: $(HACK_SRC)/../hacks/screenhack.h
+ifs.o: $(UTILS_SRC)/yarandom.h
+ifs.o: $(UTILS_SRC)/usleep.h
+ifs.o: $(UTILS_SRC)/resources.h
+ifs.o: $(UTILS_SRC)/hsv.h
+ifs.o: $(UTILS_SRC)/colors.h
+ifs.o: $(UTILS_SRC)/grabscreen.h
+ifs.o: $(UTILS_SRC)/visual.h
+image.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+image.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+image.o: $(HACK_SRC)/../config.h
+image.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+image.o: $(HACK_SRC)/../hacks/screenhack.h
+image.o: $(UTILS_SRC)/yarandom.h
+image.o: $(UTILS_SRC)/usleep.h
+image.o: $(UTILS_SRC)/resources.h
+image.o: $(UTILS_SRC)/hsv.h
+image.o: $(UTILS_SRC)/colors.h
+image.o: $(UTILS_SRC)/grabscreen.h
+image.o: $(UTILS_SRC)/visual.h
+image.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+image.o: $(srcdir)/image.xbm
+julia.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+julia.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+julia.o: $(HACK_SRC)/../config.h
+julia.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+julia.o: $(HACK_SRC)/../hacks/screenhack.h
+julia.o: $(UTILS_SRC)/yarandom.h
+julia.o: $(UTILS_SRC)/usleep.h
+julia.o: $(UTILS_SRC)/resources.h
+julia.o: $(UTILS_SRC)/hsv.h
+julia.o: $(UTILS_SRC)/colors.h
+julia.o: $(UTILS_SRC)/grabscreen.h
+julia.o: $(UTILS_SRC)/visual.h
+kaleid.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+kaleid.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+kaleid.o: $(HACK_SRC)/../config.h
+kaleid.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+kaleid.o: $(HACK_SRC)/../hacks/screenhack.h
+kaleid.o: $(UTILS_SRC)/yarandom.h
+kaleid.o: $(UTILS_SRC)/usleep.h
+kaleid.o: $(UTILS_SRC)/resources.h
+kaleid.o: $(UTILS_SRC)/hsv.h
+kaleid.o: $(UTILS_SRC)/colors.h
+kaleid.o: $(UTILS_SRC)/grabscreen.h
+kaleid.o: $(UTILS_SRC)/visual.h
+laser.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+laser.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+laser.o: $(HACK_SRC)/../config.h
+laser.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+laser.o: $(HACK_SRC)/../hacks/screenhack.h
+laser.o: $(UTILS_SRC)/yarandom.h
+laser.o: $(UTILS_SRC)/usleep.h
+laser.o: $(UTILS_SRC)/resources.h
+laser.o: $(UTILS_SRC)/hsv.h
+laser.o: $(UTILS_SRC)/colors.h
+laser.o: $(UTILS_SRC)/grabscreen.h
+laser.o: $(UTILS_SRC)/visual.h
+life.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+life.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+life.o: $(HACK_SRC)/../config.h
+life.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+life.o: $(HACK_SRC)/../hacks/screenhack.h
+life.o: $(UTILS_SRC)/yarandom.h
+life.o: $(UTILS_SRC)/usleep.h
+life.o: $(UTILS_SRC)/resources.h
+life.o: $(UTILS_SRC)/hsv.h
+life.o: $(UTILS_SRC)/colors.h
+life.o: $(UTILS_SRC)/grabscreen.h
+life.o: $(UTILS_SRC)/visual.h
+life.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+life.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+life.o: $(srcdir)/life.xbm
+life1d.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+life1d.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+life1d.o: $(HACK_SRC)/../config.h
+life1d.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+life1d.o: $(HACK_SRC)/../hacks/screenhack.h
+life1d.o: $(UTILS_SRC)/yarandom.h
+life1d.o: $(UTILS_SRC)/usleep.h
+life1d.o: $(UTILS_SRC)/resources.h
+life1d.o: $(UTILS_SRC)/hsv.h
+life1d.o: $(UTILS_SRC)/colors.h
+life1d.o: $(UTILS_SRC)/grabscreen.h
+life1d.o: $(UTILS_SRC)/visual.h
+life1d.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+life1d.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+life1d.o: $(srcdir)/life1d.xbm
+life3d.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+life3d.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+life3d.o: $(HACK_SRC)/../config.h
+life3d.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+life3d.o: $(HACK_SRC)/../hacks/screenhack.h
+life3d.o: $(UTILS_SRC)/yarandom.h
+life3d.o: $(UTILS_SRC)/usleep.h
+life3d.o: $(UTILS_SRC)/resources.h
+life3d.o: $(UTILS_SRC)/hsv.h
+life3d.o: $(UTILS_SRC)/colors.h
+life3d.o: $(UTILS_SRC)/grabscreen.h
+life3d.o: $(UTILS_SRC)/visual.h
+life3d.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+lightning.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+lightning.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+lightning.o: $(HACK_SRC)/../config.h
+lightning.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+lightning.o: $(HACK_SRC)/../hacks/screenhack.h
+lightning.o: $(UTILS_SRC)/yarandom.h
+lightning.o: $(UTILS_SRC)/usleep.h
+lightning.o: $(UTILS_SRC)/resources.h
+lightning.o: $(UTILS_SRC)/hsv.h
+lightning.o: $(UTILS_SRC)/colors.h
+lightning.o: $(UTILS_SRC)/grabscreen.h
+lightning.o: $(UTILS_SRC)/visual.h
+lisa.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+lisa.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+lisa.o: $(HACK_SRC)/../config.h
+lisa.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+lisa.o: $(HACK_SRC)/../hacks/screenhack.h
+lisa.o: $(UTILS_SRC)/yarandom.h
+lisa.o: $(UTILS_SRC)/usleep.h
+lisa.o: $(UTILS_SRC)/resources.h
+lisa.o: $(UTILS_SRC)/hsv.h
+lisa.o: $(UTILS_SRC)/colors.h
+lisa.o: $(UTILS_SRC)/grabscreen.h
+lisa.o: $(UTILS_SRC)/visual.h
+lissie.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+lissie.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+lissie.o: $(HACK_SRC)/../config.h
+lissie.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+lissie.o: $(HACK_SRC)/../hacks/screenhack.h
+lissie.o: $(UTILS_SRC)/yarandom.h
+lissie.o: $(UTILS_SRC)/usleep.h
+lissie.o: $(UTILS_SRC)/resources.h
+lissie.o: $(UTILS_SRC)/hsv.h
+lissie.o: $(UTILS_SRC)/colors.h
+lissie.o: $(UTILS_SRC)/grabscreen.h
+lissie.o: $(UTILS_SRC)/visual.h
+loop.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+loop.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+loop.o: $(HACK_SRC)/../config.h
+loop.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+loop.o: $(HACK_SRC)/../hacks/screenhack.h
+loop.o: $(UTILS_SRC)/yarandom.h
+loop.o: $(UTILS_SRC)/usleep.h
+loop.o: $(UTILS_SRC)/resources.h
+loop.o: $(UTILS_SRC)/hsv.h
+loop.o: $(UTILS_SRC)/colors.h
+loop.o: $(UTILS_SRC)/grabscreen.h
+loop.o: $(UTILS_SRC)/visual.h
+loop.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+mandelbrot.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+mandelbrot.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+mandelbrot.o: $(HACK_SRC)/../config.h
+mandelbrot.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+mandelbrot.o: $(HACK_SRC)/../hacks/screenhack.h
+mandelbrot.o: $(UTILS_SRC)/yarandom.h
+mandelbrot.o: $(UTILS_SRC)/usleep.h
+mandelbrot.o: $(UTILS_SRC)/resources.h
+mandelbrot.o: $(UTILS_SRC)/hsv.h
+mandelbrot.o: $(UTILS_SRC)/colors.h
+mandelbrot.o: $(UTILS_SRC)/grabscreen.h
+mandelbrot.o: $(UTILS_SRC)/visual.h
+marquee.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+marquee.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+marquee.o: $(HACK_SRC)/../config.h
+marquee.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+marquee.o: $(HACK_SRC)/../hacks/screenhack.h
+marquee.o: $(UTILS_SRC)/yarandom.h
+marquee.o: $(UTILS_SRC)/usleep.h
+marquee.o: $(UTILS_SRC)/resources.h
+marquee.o: $(UTILS_SRC)/hsv.h
+marquee.o: $(UTILS_SRC)/colors.h
+marquee.o: $(UTILS_SRC)/grabscreen.h
+marquee.o: $(UTILS_SRC)/visual.h
+marquee.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+maze.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+maze.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+maze.o: $(HACK_SRC)/../config.h
+maze.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+maze.o: $(HACK_SRC)/../hacks/screenhack.h
+maze.o: $(UTILS_SRC)/yarandom.h
+maze.o: $(UTILS_SRC)/usleep.h
+maze.o: $(UTILS_SRC)/resources.h
+maze.o: $(UTILS_SRC)/hsv.h
+maze.o: $(UTILS_SRC)/colors.h
+maze.o: $(UTILS_SRC)/grabscreen.h
+maze.o: $(UTILS_SRC)/visual.h
+maze.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+maze.o: $(HACK_SRC)/../xlockmore/bitmaps/gray1.xbm
+maze.o: $(srcdir)/maze.xbm
+mountain.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+mountain.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+mountain.o: $(HACK_SRC)/../config.h
+mountain.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+mountain.o: $(HACK_SRC)/../hacks/screenhack.h
+mountain.o: $(UTILS_SRC)/yarandom.h
+mountain.o: $(UTILS_SRC)/usleep.h
+mountain.o: $(UTILS_SRC)/resources.h
+mountain.o: $(UTILS_SRC)/hsv.h
+mountain.o: $(UTILS_SRC)/colors.h
+mountain.o: $(UTILS_SRC)/grabscreen.h
+mountain.o: $(UTILS_SRC)/visual.h
+munch.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+munch.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+munch.o: $(HACK_SRC)/../config.h
+munch.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+munch.o: $(HACK_SRC)/../hacks/screenhack.h
+munch.o: $(UTILS_SRC)/yarandom.h
+munch.o: $(UTILS_SRC)/usleep.h
+munch.o: $(UTILS_SRC)/resources.h
+munch.o: $(UTILS_SRC)/hsv.h
+munch.o: $(UTILS_SRC)/colors.h
+munch.o: $(UTILS_SRC)/grabscreen.h
+munch.o: $(UTILS_SRC)/visual.h
+nose.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+nose.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+nose.o: $(HACK_SRC)/../config.h
+nose.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+nose.o: $(HACK_SRC)/../hacks/screenhack.h
+nose.o: $(UTILS_SRC)/yarandom.h
+nose.o: $(UTILS_SRC)/usleep.h
+nose.o: $(UTILS_SRC)/resources.h
+nose.o: $(UTILS_SRC)/hsv.h
+nose.o: $(UTILS_SRC)/colors.h
+nose.o: $(UTILS_SRC)/grabscreen.h
+nose.o: $(UTILS_SRC)/visual.h
+nose.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-hat.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-hatd.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-facef.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-faced.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-facel.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-facer.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-shoef.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-shoel.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-shoer.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-stepl.xbm
+nose.o: $(HACK_SRC)/../xlockmore/bitmaps/nose-stepr.xbm
+pacman.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+pacman.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+pacman.o: $(HACK_SRC)/../config.h
+pacman.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+pacman.o: $(HACK_SRC)/../hacks/screenhack.h
+pacman.o: $(UTILS_SRC)/yarandom.h
+pacman.o: $(UTILS_SRC)/usleep.h
+pacman.o: $(UTILS_SRC)/resources.h
+pacman.o: $(UTILS_SRC)/hsv.h
+pacman.o: $(UTILS_SRC)/colors.h
+pacman.o: $(UTILS_SRC)/grabscreen.h
+pacman.o: $(UTILS_SRC)/visual.h
+pacman.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+pacman.o: $(srcdir)/ghost.xbm
+penrose.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+penrose.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+penrose.o: $(HACK_SRC)/../config.h
+penrose.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+penrose.o: $(HACK_SRC)/../hacks/screenhack.h
+penrose.o: $(UTILS_SRC)/yarandom.h
+penrose.o: $(UTILS_SRC)/usleep.h
+penrose.o: $(UTILS_SRC)/resources.h
+penrose.o: $(UTILS_SRC)/hsv.h
+penrose.o: $(UTILS_SRC)/colors.h
+penrose.o: $(UTILS_SRC)/grabscreen.h
+penrose.o: $(UTILS_SRC)/visual.h
+petal.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+petal.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+petal.o: $(HACK_SRC)/../config.h
+petal.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+petal.o: $(HACK_SRC)/../hacks/screenhack.h
+petal.o: $(UTILS_SRC)/yarandom.h
+petal.o: $(UTILS_SRC)/usleep.h
+petal.o: $(UTILS_SRC)/resources.h
+petal.o: $(UTILS_SRC)/hsv.h
+petal.o: $(UTILS_SRC)/colors.h
+petal.o: $(UTILS_SRC)/grabscreen.h
+petal.o: $(UTILS_SRC)/visual.h
+puzzle.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+puzzle.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+puzzle.o: $(HACK_SRC)/../config.h
+puzzle.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+puzzle.o: $(HACK_SRC)/../hacks/screenhack.h
+puzzle.o: $(UTILS_SRC)/yarandom.h
+puzzle.o: $(UTILS_SRC)/usleep.h
+puzzle.o: $(UTILS_SRC)/resources.h
+puzzle.o: $(UTILS_SRC)/hsv.h
+puzzle.o: $(UTILS_SRC)/colors.h
+puzzle.o: $(UTILS_SRC)/grabscreen.h
+puzzle.o: $(UTILS_SRC)/visual.h
+puzzle.o: $(HACK_SRC)/../xlockmore/xlock/iostuff.h
+puzzle.o: $(srcdir)/puzzle.xbm
+pyro.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+pyro.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+pyro.o: $(HACK_SRC)/../config.h
+pyro.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+pyro.o: $(HACK_SRC)/../hacks/screenhack.h
+pyro.o: $(UTILS_SRC)/yarandom.h
+pyro.o: $(UTILS_SRC)/usleep.h
+pyro.o: $(UTILS_SRC)/resources.h
+pyro.o: $(UTILS_SRC)/hsv.h
+pyro.o: $(UTILS_SRC)/colors.h
+pyro.o: $(UTILS_SRC)/grabscreen.h
+pyro.o: $(UTILS_SRC)/visual.h
+qix.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+qix.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+qix.o: $(HACK_SRC)/../config.h
+qix.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+qix.o: $(HACK_SRC)/../hacks/screenhack.h
+qix.o: $(UTILS_SRC)/yarandom.h
+qix.o: $(UTILS_SRC)/usleep.h
+qix.o: $(UTILS_SRC)/resources.h
+qix.o: $(UTILS_SRC)/hsv.h
+qix.o: $(UTILS_SRC)/colors.h
+qix.o: $(UTILS_SRC)/grabscreen.h
+qix.o: $(UTILS_SRC)/visual.h
+roll.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+roll.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+roll.o: $(HACK_SRC)/../config.h
+roll.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+roll.o: $(HACK_SRC)/../hacks/screenhack.h
+roll.o: $(UTILS_SRC)/yarandom.h
+roll.o: $(UTILS_SRC)/usleep.h
+roll.o: $(UTILS_SRC)/resources.h
+roll.o: $(UTILS_SRC)/hsv.h
+roll.o: $(UTILS_SRC)/colors.h
+roll.o: $(UTILS_SRC)/grabscreen.h
+roll.o: $(UTILS_SRC)/visual.h
+rotor.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+rotor.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+rotor.o: $(HACK_SRC)/../config.h
+rotor.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+rotor.o: $(HACK_SRC)/../hacks/screenhack.h
+rotor.o: $(UTILS_SRC)/yarandom.h
+rotor.o: $(UTILS_SRC)/usleep.h
+rotor.o: $(UTILS_SRC)/resources.h
+rotor.o: $(UTILS_SRC)/hsv.h
+rotor.o: $(UTILS_SRC)/colors.h
+rotor.o: $(UTILS_SRC)/grabscreen.h
+rotor.o: $(UTILS_SRC)/visual.h
+shape.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+shape.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+shape.o: $(HACK_SRC)/../config.h
+shape.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+shape.o: $(HACK_SRC)/../hacks/screenhack.h
+shape.o: $(UTILS_SRC)/yarandom.h
+shape.o: $(UTILS_SRC)/usleep.h
+shape.o: $(UTILS_SRC)/resources.h
+shape.o: $(UTILS_SRC)/hsv.h
+shape.o: $(UTILS_SRC)/colors.h
+shape.o: $(UTILS_SRC)/grabscreen.h
+shape.o: $(UTILS_SRC)/visual.h
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/gray1.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/gray3.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/stipple.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/cross_weave.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/dimple1.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/dimple3.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/flipped_gray.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/hlines2.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/light_gray.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/root_weave.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/vlines2.xbm
+shape.o: $(HACK_SRC)/../xlockmore/bitmaps/vlines3.xbm
+sierpinski.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+sierpinski.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+sierpinski.o: $(HACK_SRC)/../config.h
+sierpinski.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+sierpinski.o: $(HACK_SRC)/../hacks/screenhack.h
+sierpinski.o: $(UTILS_SRC)/yarandom.h
+sierpinski.o: $(UTILS_SRC)/usleep.h
+sierpinski.o: $(UTILS_SRC)/resources.h
+sierpinski.o: $(UTILS_SRC)/hsv.h
+sierpinski.o: $(UTILS_SRC)/colors.h
+sierpinski.o: $(UTILS_SRC)/grabscreen.h
+sierpinski.o: $(UTILS_SRC)/visual.h
+slip.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+slip.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+slip.o: $(HACK_SRC)/../config.h
+slip.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+slip.o: $(HACK_SRC)/../hacks/screenhack.h
+slip.o: $(UTILS_SRC)/yarandom.h
+slip.o: $(UTILS_SRC)/usleep.h
+slip.o: $(UTILS_SRC)/resources.h
+slip.o: $(UTILS_SRC)/hsv.h
+slip.o: $(UTILS_SRC)/colors.h
+slip.o: $(UTILS_SRC)/grabscreen.h
+slip.o: $(UTILS_SRC)/visual.h
+sphere.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+sphere.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+sphere.o: $(HACK_SRC)/../config.h
+sphere.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+sphere.o: $(HACK_SRC)/../hacks/screenhack.h
+sphere.o: $(UTILS_SRC)/yarandom.h
+sphere.o: $(UTILS_SRC)/usleep.h
+sphere.o: $(UTILS_SRC)/resources.h
+sphere.o: $(UTILS_SRC)/hsv.h
+sphere.o: $(UTILS_SRC)/colors.h
+sphere.o: $(UTILS_SRC)/grabscreen.h
+sphere.o: $(UTILS_SRC)/visual.h
+spiral.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+spiral.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+spiral.o: $(HACK_SRC)/../config.h
+spiral.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+spiral.o: $(HACK_SRC)/../hacks/screenhack.h
+spiral.o: $(UTILS_SRC)/yarandom.h
+spiral.o: $(UTILS_SRC)/usleep.h
+spiral.o: $(UTILS_SRC)/resources.h
+spiral.o: $(UTILS_SRC)/hsv.h
+spiral.o: $(UTILS_SRC)/colors.h
+spiral.o: $(UTILS_SRC)/grabscreen.h
+spiral.o: $(UTILS_SRC)/visual.h
+spline.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+spline.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+spline.o: $(HACK_SRC)/../config.h
+spline.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+spline.o: $(HACK_SRC)/../hacks/screenhack.h
+spline.o: $(UTILS_SRC)/yarandom.h
+spline.o: $(UTILS_SRC)/usleep.h
+spline.o: $(UTILS_SRC)/resources.h
+spline.o: $(UTILS_SRC)/hsv.h
+spline.o: $(UTILS_SRC)/colors.h
+spline.o: $(UTILS_SRC)/grabscreen.h
+spline.o: $(UTILS_SRC)/visual.h
+star.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+star.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+star.o: $(HACK_SRC)/../config.h
+star.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+star.o: $(HACK_SRC)/../hacks/screenhack.h
+star.o: $(UTILS_SRC)/yarandom.h
+star.o: $(UTILS_SRC)/usleep.h
+star.o: $(UTILS_SRC)/resources.h
+star.o: $(UTILS_SRC)/hsv.h
+star.o: $(UTILS_SRC)/colors.h
+star.o: $(UTILS_SRC)/grabscreen.h
+star.o: $(UTILS_SRC)/visual.h
+star.o: $(HACK_SRC)/../xlockmore/bitmaps/trek-0.xbm
+star.o: $(HACK_SRC)/../xlockmore/bitmaps/trek-1.xbm
+strange.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+strange.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+strange.o: $(HACK_SRC)/../config.h
+strange.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+strange.o: $(HACK_SRC)/../hacks/screenhack.h
+strange.o: $(UTILS_SRC)/yarandom.h
+strange.o: $(UTILS_SRC)/usleep.h
+strange.o: $(UTILS_SRC)/resources.h
+strange.o: $(UTILS_SRC)/hsv.h
+strange.o: $(UTILS_SRC)/colors.h
+strange.o: $(UTILS_SRC)/grabscreen.h
+strange.o: $(UTILS_SRC)/visual.h
+swarm.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+swarm.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+swarm.o: $(HACK_SRC)/../config.h
+swarm.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+swarm.o: $(HACK_SRC)/../hacks/screenhack.h
+swarm.o: $(UTILS_SRC)/yarandom.h
+swarm.o: $(UTILS_SRC)/usleep.h
+swarm.o: $(UTILS_SRC)/resources.h
+swarm.o: $(UTILS_SRC)/hsv.h
+swarm.o: $(UTILS_SRC)/colors.h
+swarm.o: $(UTILS_SRC)/grabscreen.h
+swarm.o: $(UTILS_SRC)/visual.h
+swirl.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+swirl.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+swirl.o: $(HACK_SRC)/../config.h
+swirl.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+swirl.o: $(HACK_SRC)/../hacks/screenhack.h
+swirl.o: $(UTILS_SRC)/yarandom.h
+swirl.o: $(UTILS_SRC)/usleep.h
+swirl.o: $(UTILS_SRC)/resources.h
+swirl.o: $(UTILS_SRC)/hsv.h
+swirl.o: $(UTILS_SRC)/colors.h
+swirl.o: $(UTILS_SRC)/grabscreen.h
+swirl.o: $(UTILS_SRC)/visual.h
+thornbird.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+thornbird.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+thornbird.o: $(HACK_SRC)/../config.h
+thornbird.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+thornbird.o: $(HACK_SRC)/../hacks/screenhack.h
+thornbird.o: $(UTILS_SRC)/yarandom.h
+thornbird.o: $(UTILS_SRC)/usleep.h
+thornbird.o: $(UTILS_SRC)/resources.h
+thornbird.o: $(UTILS_SRC)/hsv.h
+thornbird.o: $(UTILS_SRC)/colors.h
+thornbird.o: $(UTILS_SRC)/grabscreen.h
+thornbird.o: $(UTILS_SRC)/visual.h
+triangle.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+triangle.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+triangle.o: $(HACK_SRC)/../config.h
+triangle.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+triangle.o: $(HACK_SRC)/../hacks/screenhack.h
+triangle.o: $(UTILS_SRC)/yarandom.h
+triangle.o: $(UTILS_SRC)/usleep.h
+triangle.o: $(UTILS_SRC)/resources.h
+triangle.o: $(UTILS_SRC)/hsv.h
+triangle.o: $(UTILS_SRC)/colors.h
+triangle.o: $(UTILS_SRC)/grabscreen.h
+triangle.o: $(UTILS_SRC)/visual.h
+tube.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+tube.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+tube.o: $(HACK_SRC)/../config.h
+tube.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+tube.o: $(HACK_SRC)/../hacks/screenhack.h
+tube.o: $(UTILS_SRC)/yarandom.h
+tube.o: $(UTILS_SRC)/usleep.h
+tube.o: $(UTILS_SRC)/resources.h
+tube.o: $(UTILS_SRC)/hsv.h
+tube.o: $(UTILS_SRC)/colors.h
+tube.o: $(UTILS_SRC)/grabscreen.h
+tube.o: $(UTILS_SRC)/visual.h
+turtle.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+turtle.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+turtle.o: $(HACK_SRC)/../config.h
+turtle.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+turtle.o: $(HACK_SRC)/../hacks/screenhack.h
+turtle.o: $(UTILS_SRC)/yarandom.h
+turtle.o: $(UTILS_SRC)/usleep.h
+turtle.o: $(UTILS_SRC)/resources.h
+turtle.o: $(UTILS_SRC)/hsv.h
+turtle.o: $(UTILS_SRC)/colors.h
+turtle.o: $(UTILS_SRC)/grabscreen.h
+turtle.o: $(UTILS_SRC)/visual.h
+vines.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+vines.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+vines.o: $(HACK_SRC)/../config.h
+vines.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+vines.o: $(HACK_SRC)/../hacks/screenhack.h
+vines.o: $(UTILS_SRC)/yarandom.h
+vines.o: $(UTILS_SRC)/usleep.h
+vines.o: $(UTILS_SRC)/resources.h
+vines.o: $(UTILS_SRC)/hsv.h
+vines.o: $(UTILS_SRC)/colors.h
+vines.o: $(UTILS_SRC)/grabscreen.h
+vines.o: $(UTILS_SRC)/visual.h
+vines.o: $(UTILS_SRC)/erase.h
+voters.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+voters.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+voters.o: $(HACK_SRC)/../config.h
+voters.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+voters.o: $(HACK_SRC)/../hacks/screenhack.h
+voters.o: $(UTILS_SRC)/yarandom.h
+voters.o: $(UTILS_SRC)/usleep.h
+voters.o: $(UTILS_SRC)/resources.h
+voters.o: $(UTILS_SRC)/hsv.h
+voters.o: $(UTILS_SRC)/colors.h
+voters.o: $(UTILS_SRC)/grabscreen.h
+voters.o: $(UTILS_SRC)/visual.h
+voters.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+voters.o: $(HACK_SRC)/../xlockmore/bitmaps/sickle.xbm
+voters.o: $(HACK_SRC)/../xlockmore/bitmaps/donkey.xbm
+voters.o: $(HACK_SRC)/../xlockmore/bitmaps/elephant.xbm
+wator.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+wator.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+wator.o: $(HACK_SRC)/../config.h
+wator.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+wator.o: $(HACK_SRC)/../hacks/screenhack.h
+wator.o: $(UTILS_SRC)/yarandom.h
+wator.o: $(UTILS_SRC)/usleep.h
+wator.o: $(UTILS_SRC)/resources.h
+wator.o: $(UTILS_SRC)/hsv.h
+wator.o: $(UTILS_SRC)/colors.h
+wator.o: $(UTILS_SRC)/grabscreen.h
+wator.o: $(UTILS_SRC)/visual.h
+wator.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-0.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-1.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-2.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-3.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-4.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-5.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-6.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/fish-7.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-0.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-1.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-2.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-3.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-4.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-5.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-6.xbm
+wator.o: $(HACK_SRC)/../xlockmore/bitmaps/shark-7.xbm
+wire.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+wire.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+wire.o: $(HACK_SRC)/../config.h
+wire.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+wire.o: $(HACK_SRC)/../hacks/screenhack.h
+wire.o: $(UTILS_SRC)/yarandom.h
+wire.o: $(UTILS_SRC)/usleep.h
+wire.o: $(UTILS_SRC)/resources.h
+wire.o: $(UTILS_SRC)/hsv.h
+wire.o: $(UTILS_SRC)/colors.h
+wire.o: $(UTILS_SRC)/grabscreen.h
+wire.o: $(UTILS_SRC)/visual.h
+wire.o: $(HACK_SRC)/../xlockmore/xlock/automata.h
+world.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+world.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+world.o: $(HACK_SRC)/../config.h
+world.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+world.o: $(HACK_SRC)/../hacks/screenhack.h
+world.o: $(UTILS_SRC)/yarandom.h
+world.o: $(UTILS_SRC)/usleep.h
+world.o: $(UTILS_SRC)/resources.h
+world.o: $(UTILS_SRC)/hsv.h
+world.o: $(UTILS_SRC)/colors.h
+world.o: $(UTILS_SRC)/grabscreen.h
+world.o: $(UTILS_SRC)/visual.h
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-00.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-01.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-02.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-03.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-04.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-05.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-06.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-07.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-08.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-09.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-10.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-11.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-12.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-13.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-14.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-15.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-16.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-17.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-18.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-19.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-20.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-21.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-22.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-23.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-24.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-25.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-26.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-27.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-28.xbm
+world.o: $(HACK_SRC)/../xlockmore/bitmaps/terra-29.xbm
+worm.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+worm.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+worm.o: $(HACK_SRC)/../config.h
+worm.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+worm.o: $(HACK_SRC)/../hacks/screenhack.h
+worm.o: $(UTILS_SRC)/yarandom.h
+worm.o: $(UTILS_SRC)/usleep.h
+worm.o: $(UTILS_SRC)/resources.h
+worm.o: $(UTILS_SRC)/hsv.h
+worm.o: $(UTILS_SRC)/colors.h
+worm.o: $(UTILS_SRC)/grabscreen.h
+worm.o: $(UTILS_SRC)/visual.h
+xcl.o: $(HACK_SRC)/../xlockmore/xlock/xlockmore.h
+xcl.o: $(HACK_SRC)/../xlockmore/xlock/xlock.h
+xcl.o: $(HACK_SRC)/../config.h
+xcl.o: $(HACK_SRC)/../xlockmore/xlock/mode.h
+xcl.o: $(HACK_SRC)/../hacks/screenhack.h
+xcl.o: $(UTILS_SRC)/yarandom.h
+xcl.o: $(UTILS_SRC)/usleep.h
+xcl.o: $(UTILS_SRC)/resources.h
+xcl.o: $(UTILS_SRC)/hsv.h
+xcl.o: $(UTILS_SRC)/colors.h
+xcl.o: $(UTILS_SRC)/grabscreen.h
+xcl.o: $(UTILS_SRC)/visual.h
+xcl.o: $(UTILS_SRC)/erase.h
diff --git a/modes/ant.c b/modes/ant.c
new file mode 100644 (file)
index 0000000..70c39a1
--- /dev/null
@@ -0,0 +1,1347 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/*-
+ * ant --- Chris Langton's generalized turing machine ants (also known
+ *         as Greg Turk's turmites) whose tape is the screen
+ */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)ant.c        5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 16-Apr-1997: -neighbors 3 and 8 added
+ * 01-Jan-1997: Updated ant.c to handle more kinds of ants.  Thanks to
+ *              J Austin David <Austin.David@tlogic.com>.  Check it out in
+ *              java at http://havoc.gtf.gatech.edu/austin  He thought up the
+ *              new Ladder ant.
+ * 04-Apr-1996: -neighbors 6 runtime-time option added for hexagonal ants
+ *              (bees), coded from an idea of Jim Propp's in Science News,
+ *              Oct 28, 1995 VOL. 148 page 287
+ * 20-Sep-1995: Memory leak in ant fixed.  Now random colors.
+ * 05-Sep-1995: Coded from A.K. Dewdney's "Computer Recreations", Scientific
+ *              American Magazine" Sep 1989 pp 180-183, Mar 1990 p 121
+ *              Also used Ian Stewart's Mathematical Recreations, Scientific
+ *              American Jul 1994 pp 104-107
+ *              also used demon.c and life.c as a guide.
+ */
+
+/*-
+  Species Grid     Number of Neighbors
+  ------- ----     ------------------
+  Ants    Square   4 (or 8)
+  Bees    Hexagon  6
+  Bees    Triangle 3 (or 9, 12)
+
+  Neighbors 6 and neighbors 3 produce the same Turk ants.
+*/
+
+#ifdef STANDALONE
+#define PROGCLASS "Ant"
+#define HACK_INIT init_ant
+#define HACK_DRAW draw_ant
+#define ant_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*count: -3 \n" \
+ "*cycles: 40000 \n" \
+ "*size: -12 \n" \
+ "*ncolors: 64 \n" \
+ "*neighbors: 0 \n" \
+ "*sharpturn: False \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_ant
+
+/*-
+ * neighbors of 0 randomizes it for 3, 4, 6, 8, 12 (last 2 are less likely)
+ */
+
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+#define DEF_TRUCHET  "False"
+#define DEF_EYES  "False"
+#define DEF_SHARPTURN  "False"
+
+static int  neighbors;
+static Bool truchet;
+static Bool eyes;
+static Bool sharpturn;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".ant.neighbors", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-truchet", (char *) ".ant.truchet", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+truchet", (char *) ".ant.truchet", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-eyes", (char *) ".ant.eyes", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+eyes", (char *) ".ant.eyes", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-sharpturn", (char *) ".ant.sharpturn", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+sharpturn", (char *) ".ant.sharpturn", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int},
+       {(caddr_t *) & truchet, (char *) "truchet", (char *) "Truchet", (char *) DEF_TRUCHET, t_Bool},
+       {(caddr_t *) & eyes, (char *) "eyes", (char *) "Eyes", (char *) DEF_EYES, t_Bool},
+   {(caddr_t *) & sharpturn, (char *) "sharpturn", (char *) "SharpTurn", (char *) DEF_SHARPTURN, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3 or 12"},
+       {(char *) "-/+truchet", (char *) "turn on/off Truchet lines"},
+       {(char *) "-/+eyes", (char *) "turn on/off eyes"},
+       {(char *) "-/+sharpturn", (char *) "turn on/off sharp turns (6, 8 or 12 neighbors only)"}
+};
+
+ModeSpecOpt ant_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   ant_description =
+{(char *) "ant",
+ (char *) "init_ant", (char *) "draw_ant", (char *) "release_ant",
+ (char *) "refresh_ant", (char *) "init_ant", NULL, &ant_opts,
+ 1000, -3, 40000, -12, 64, 1.0, (char *) "",
+ (char *) "Shows Langton's and Turk's generalized ants", 0, NULL};
+
+#endif
+
+#define ANTBITS(n,w,h)\
+  if ((ap->pixmaps[ap->init_bits]=\
+  XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
+  free_ant(display,ap); return;} else {ap->init_bits++;}
+
+/* If you change the table you may have to change the following 2 constants */
+#define STATES 2
+#define MINANTS 1
+#define REDRAWSTEP 2000                /* How much tape to draw per cycle */
+#define MINGRIDSIZE 24
+#define MINSIZE 1
+#define MINRANDOMSIZE 5
+#define ANGLES 360
+
+typedef struct {
+       unsigned char color;
+       short       direction;
+       unsigned char next;
+} statestruct;
+
+typedef struct {
+       int         col, row;
+       short       direction;
+       unsigned char state;
+} antstruct;
+
+typedef struct {
+       Bool        painted;
+       int         neighbors;
+       int         generation;
+       int         xs, ys;
+       int         xb, yb;
+       int         init_dir;
+       int         nrows, ncols;
+       int         width, height;
+       unsigned char ncolors, nstates;
+       int         n;
+       int         redrawing, redrawpos;
+       int         truchet;    /* Only for Turk modes */
+       int         eyes;
+       int         sharpturn;
+       statestruct machine[NUMSTIPPLES * STATES];
+       unsigned char *tape;
+       unsigned char *truchet_state;
+       antstruct  *ants;
+       int         init_bits;
+       unsigned char colors[NUMSTIPPLES - 1];
+       GC          stippledGC;
+       Pixmap      pixmaps[NUMSTIPPLES - 1];
+       union {
+               XPoint      hexagon[7];         /* Need more than 6 for truchet */
+               XPoint      triangle[2][4];     /* Need more than 3 for truchet */
+       } shape;
+} antfarmstruct;
+
+static char plots[] =
+{3, 4, 6, 8,
+#ifdef NUMBER_9
+ 9,
+#endif
+ 12};
+
+#define NEIGHBORKINDS ((long) (sizeof plots / sizeof *plots))
+#define GOODNEIGHBORKINDS 3
+
+/* Relative ant moves */
+#define FS 0                   /* Step */
+#define TRS 1                  /* Turn right, then step */
+#define THRS 2                 /* Turn hard right, then step */
+#define TBS 3                  /* Turn back, then step */
+#define THLS 4                 /* Turn hard left, then step */
+#define TLS 5                  /* Turn left, then step */
+#define SF 6                   /* Step */
+#define STR 7                  /* Step then turn right */
+#define STHR 8                 /* Step then turn hard right */
+#define STB 9                  /* Step then turn back */
+#define STHL 10                        /* Step then turn hard left */
+#define STL 11                 /* Step then turn left */
+
+static antfarmstruct *antfarms = NULL;
+
+/* LANGTON'S ANT (10) Chaotic after 500, Builder after 10,000 (104p) */
+/* TURK'S 100 ANT Always chaotic?, tested past 150,000,000 */
+/* TURK'S 101 ANT Always chaotic? */
+/* TURK'S 110 ANT Builder at 150 (18p) */
+/* TURK'S 1000 ANT Always chaotic? */
+/* TURK'S 1100 SYMMETRIC ANT  all even run 1's and 0's are symmetric */
+/* other examples 1001, 110011, 110000, 1001101 */
+/* TURK'S 1101 ANT Builder after 250,000 (388p) */
+/* Once saw a chess horse type builder (i.e. non-45 degree builder) */
+
+/* BEE ONLY */
+/* All alternating 10 appear symmetric, no proof (i.e. 10, 1010, etc) */
+/* Even runs of 0's and 1's are also symmetric */
+/* I have seen Hexagonal builders but they are more rare. */
+
+static unsigned char tables[][3 * NUMSTIPPLES * STATES + 2] =
+{
+#if 0
+  /* Here just so you can figure out notation */
+       {                       /* Langton's ant */
+               2, 1,
+               1, TLS, 0, 0, TRS, 0
+       },
+#else
+  /* First 2 numbers are the size (ncolors, nstates) */
+       {                       /* LADDER BUILDER */
+               4, 1,
+               1, STR, 0, 2, STL, 0, 3, TRS, 0, 0, TLS, 0
+       },
+       {                       /* SPIRALING PATTERN */
+               2, 2,
+               1, TLS, 0, 0, FS, 1,
+               1, TRS, 0, 1, TRS, 0
+       },
+       {                       /* SQUARE (HEXAGON) BUILDER */
+               2, 2,
+               1, TLS, 0, 0, FS, 1,
+               0, TRS, 0, 1, TRS, 0
+       },
+#endif
+};
+
+#define NTABLES   (sizeof tables / sizeof tables[0])
+
+static void
+position_of_neighbor(antfarmstruct * ap, int dir, int *pcol, int *prow)
+{
+       int         col = *pcol, row = *prow;
+
+       if (ap->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                               break;
+                       case 60:
+                               if (!(row & 1))
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                               row = (!row) ? ap->nrows - 1 : row - 1;
+                               break;
+                       case 120:
+                               if (row & 1)
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                               row = (!row) ? ap->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? ap->ncols - 1 : col - 1;
+                               break;
+                       case 240:
+                               if (row & 1)
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                               row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                               break;
+                       case 300:
+                               if (!(row & 1))
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                               row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (ap->neighbors == 4 || ap->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                               break;
+                       case 45:
+                               col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                               row = (!row) ? ap->nrows - 1 : row - 1;
+                               break;
+                       case 90:
+                               row = (!row) ? ap->nrows - 1 : row - 1;
+                               break;
+                       case 135:
+                               col = (!col) ? ap->ncols - 1 : col - 1;
+                               row = (!row) ? ap->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? ap->ncols - 1 : col - 1;
+                               break;
+                       case 225:
+                               col = (!col) ? ap->ncols - 1 : col - 1;
+                               row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                               break;
+                       case 270:
+                               row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                               break;
+                       case 315:
+                               col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                               row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               if ((col + row) % 2) {  /* right */
+                       switch (dir) {
+                               case 0:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       row = (!row) ? ap->nrows - 1 : row - 1;
+                                       break;
+                               case 60:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       if (!row)
+                                               row = ap->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = ap->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (!row)
+                                               row = ap->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = ap->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 120:
+                                       row = (!row) ? ap->nrows - 1 : row - 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       row = (!row) ? ap->nrows - 1 : row - 1;
+                                       break;
+                               case 180:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                                       break;
+                               case 240:
+                                       row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (row + 1 == ap->nrows)
+                                               row = 1;
+                                       else if (row + 2 == ap->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 300:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       if (row + 1 == ap->nrows)
+                                               row = 1;
+                                       else if (row + 2 == ap->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               } else {        /* left */
+                       switch (dir) {
+                               case 0:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                                       break;
+                               case 60:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       if (row + 1 == ap->nrows)
+                                               row = 1;
+                                       else if (row + 2 == ap->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (row + 1 == ap->nrows)
+                                               row = 1;
+                                       else if (row + 2 == ap->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 120:
+                                       row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       row = (row + 1 == ap->nrows) ? 0 : row + 1;
+                                       break;
+                               case 180:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (!col) ? ap->ncols - 1 : col - 1;
+                                       row = (!row) ? ap->nrows - 1 : row - 1;
+                                       break;
+                               case 240:
+                                       row = (!row) ? ap->nrows - 1 : row - 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (!row)
+                                               row = ap->nrows - 2;
+                                       else if (row == 1)
+                                               row = ap->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 300:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       if (!row)
+                                               row = ap->nrows - 2;
+                                       else if (row == 1)
+                                               row = ap->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (col + 1 == ap->ncols) ? 0 : col + 1;
+                                       row = (!row) ? ap->nrows - 1 : row - 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               }
+       }
+       *pcol = col;
+       *prow = row;
+}
+
+static void
+fillcell(ModeInfo * mi, GC gc, int col, int row)
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+
+       if (ap->neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               ap->shape.hexagon[0].x = ap->xb + ccol * ap->xs;
+               ap->shape.hexagon[0].y = ap->yb + crow * ap->ys;
+               if (ap->xs == 1 && ap->ys == 1)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                       ap->shape.hexagon[0].x, ap->shape.hexagon[0].y);
+               else
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                           ap->shape.hexagon, 6, Convex, CoordModePrevious);
+       } else if (ap->neighbors == 4 || ap->neighbors == 8) {
+               XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+               ap->xb + ap->xs * col, ap->yb + ap->ys * row,
+               ap->xs - (ap->xs > 3), ap->ys - (ap->ys > 3));
+       } else {                /* TRI */
+               int         orient = (col + row) % 2;   /* O left 1 right */
+
+               ap->shape.triangle[orient][0].x = ap->xb + col * ap->xs;
+               ap->shape.triangle[orient][0].y = ap->yb + row * ap->ys;
+               if (ap->xs <= 3 || ap->ys <= 3)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                       ((orient) ? -1 : 1) + ap->shape.triangle[orient][0].x,
+                                      ap->shape.triangle[orient][0].y);
+               else {
+                       if (orient)
+                               ap->shape.triangle[orient][0].x += (ap->xs / 2 - 1);
+                       else
+                               ap->shape.triangle[orient][0].x -= (ap->xs / 2 - 1);
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                    ap->shape.triangle[orient], 3, Convex, CoordModePrevious);
+               }
+       }
+}
+
+static void
+truchetcell(ModeInfo * mi, int col, int row, int truchetstate)
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+
+       if (ap->neighbors == 6) {
+
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+               int         side;
+               int         fudge = 7;  /* fudge because the hexagons are not exact */
+               XPoint      hex, hex2;
+
+               if (ap->sharpturn) {
+                       hex.x = ap->xb + ccol * ap->xs - (int) ((double) ap->xs / 2.0) - 1;
+                       hex.y = ap->yb + crow * ap->ys - (int) ((double) ap->ys / 2.0) - 1;
+                       for (side = 0; side < 6; side++) {
+                               if (side) {
+                                       hex.x += ap->shape.hexagon[side].x;
+                                       hex.y += ap->shape.hexagon[side].y;
+                               }
+                               if (truchetstate == side % 2)
+                                       XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                                hex.x, hex.y, ap->xs, ap->ys,
+                                                ((570 - (side * 60) + fudge) % 360) * 64, (120 - 2 * fudge) * 64);
+                       }
+               } else {
+                       /* Very crude approx of Sqrt 3, so it will not cause drawing errors. */
+                       hex.x = ap->xb + ccol * ap->xs - (int) ((double) ap->xs * 1.6 / 2.0) - 1;
+                       hex.y = ap->yb + crow * ap->ys - (int) ((double) ap->ys * 1.6 / 2.0) - 1;
+                       for (side = 0; side < 6; side++) {
+                               if (side) {
+                                       hex.x += ap->shape.hexagon[side].x;
+                                       hex.y += ap->shape.hexagon[side].y;
+                               }
+                               hex2.x = hex.x + ap->shape.hexagon[side + 1].x / 2;
+                               hex2.y = hex.y + ap->shape.hexagon[side + 1].y / 2 + 1;
+                               /* Lots of fudging here */
+                               if (side == 1) {
+                                       hex2.x += (short) (ap->xs * 0.1 + 1);
+                                       hex2.y += (short) (ap->ys * 0.1 - ((ap->ys > 5) ? 1 : 0));
+                               } else if (side == 2) {
+                                       hex2.x += (short) (ap->xs * 0.1);
+                               } else if (side == 4) {
+                                       hex2.x += (short) (ap->xs * 0.1);
+                                       hex2.y += (short) (ap->ys * 0.1 - 1);
+                               } else if (side == 5) {
+                                       hex2.x += (short) (ap->xs * 0.5);
+                                       hex2.y += (short) (-ap->ys * 0.3 + 1);
+                               }
+                               if (truchetstate == side % 3)
+                                       /* Crude approx of 120 deg, so it will not cause drawing errors. */
+                                       XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                                hex2.x, hex2.y,
+                                                (int) ((double) ap->xs * 1.5), (int) ((double) ap->ys * 1.5),
+                                                ((555 - (side * 60)) % 360) * 64, 90 * 64);
+                       }
+               }
+       } else if (ap->neighbors == 4) {
+               if (truchetstate) {
+                       XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                ap->xb + ap->xs * col - ap->xs / 2 + 1,
+                                ap->yb + ap->ys * row + ap->ys / 2 - 1,
+                                ap->xs - 2, ap->ys - 2,
+                                0 * 64, 90 * 64);
+                       XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                ap->xb + ap->xs * col + ap->xs / 2 - 1,
+                                ap->yb + ap->ys * row - ap->ys / 2 + 1,
+                                ap->xs - 2, ap->ys - 2,
+                                -90 * 64, -90 * 64);
+               } else {
+                       XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                ap->xb + ap->xs * col - ap->xs / 2 + 1,
+                                ap->yb + ap->ys * row - ap->ys / 2 + 1,
+                                ap->xs - 2, ap->ys - 2,
+                                0 * 64, -90 * 64);
+                       XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                ap->xb + ap->xs * col + ap->xs / 2 - 1,
+                                ap->yb + ap->ys * row + ap->ys / 2 - 1,
+                                ap->xs - 2, ap->ys - 2,
+                                90 * 64, 90 * 64);
+               }
+       } else if (ap->neighbors == 3) {
+               int         orient = (col + row) % 2;   /* O left 1 right */
+               int         side, ang;
+               int         fudge = 7;  /* fudge because the triangles are not exact */
+               double      fudge2 = 1.18;
+               XPoint      tri;
+
+               tri.x = ap->xb + col * ap->xs;
+               tri.y = ap->yb + row * ap->ys;
+               if (orient) {
+                       tri.x += (ap->xs / 2 - 1);
+               } else {
+                       tri.x -= (ap->xs / 2 - 1);
+               }
+               for (side = 0; side < 3; side++) {
+                       if (side > 0) {
+                               tri.x += ap->shape.triangle[orient][side].x;
+                               tri.y += ap->shape.triangle[orient][side].y;
+                       }
+                       if (truchetstate == side) {
+                               if (orient)
+                                       ang = (510 - side * 120) % 360;         /* Right */
+                               else
+                                       ang = (690 - side * 120) % 360;         /* Left */
+                               XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                 (int) (tri.x - ap->xs * fudge2 / 2),
+          (int) (tri.y - 3 * ap->ys * fudge2 / 4),
+                                 (unsigned int) (ap->xs * fudge2),
+          (unsigned int) (3 * ap->ys * fudge2 / 2),
+                                 (ang + fudge) * 64, (60 - 2 * fudge) * 64);
+                       }
+               }
+       }
+}
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned char color)
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+       GC          gc;
+
+       if (!color) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+               gc = MI_GC(mi);
+       } else if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi),
+                              MI_PIXEL(mi, ap->colors[color - 1]));
+               gc = MI_GC(mi);
+       } else {
+               XGCValues   gcv;
+
+               gcv.stipple = ap->pixmaps[color - 1];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), ap->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = ap->stippledGC;
+       }
+       fillcell(mi, gc, col, row);
+}
+
+static void
+drawtruchet(ModeInfo * mi, int col, int row,
+           unsigned char color, unsigned char truchetstate)
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+
+       if (!color)
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi));
+       else if (MI_NPIXELS(mi) > 2 || color > ap->ncolors / 2)
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+       else
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi));
+       truchetcell(mi, col, row, truchetstate);
+}
+
+static void
+draw_anant(ModeInfo * mi, int direction, int col, int row)
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+
+       XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+       fillcell(mi, MI_GC(mi), col, row);
+       if (ap->eyes) {         /* Draw Eyes */
+               XSetForeground(display, MI_GC(mi), MI_BLACK_PIXEL(mi));
+               if (ap->neighbors == 6) {
+                       int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+                       int         side, ang;
+                       XPoint      hex;
+
+                       if (!(ap->xs > 3 && ap->ys > 3))
+                               return;
+                       hex.x = ap->xb + ccol * ap->xs;
+                       hex.y = ap->yb + crow * ap->ys + ap->ys / 2;
+                       ang = direction * ap->neighbors / ANGLES;
+                       for (side = 0; side < ap->neighbors; side++) {
+                               if (side) {
+                                       hex.x -= ap->shape.hexagon[side].x / 2;
+                                       hex.y += ap->shape.hexagon[side].y / 2;
+                               }
+                               if (side == (ap->neighbors + ang - 2) % ap->neighbors)
+                                       XDrawPoint(display, window, MI_GC(mi), hex.x, hex.y);
+                               if (side == (ap->neighbors + ang - 1) % ap->neighbors)
+                                       XDrawPoint(display, window, MI_GC(mi), hex.x, hex.y);
+                       }
+               } else if (ap->neighbors == 4 || ap->neighbors == 8) {
+                       if (!(ap->xs > 3 && ap->ys > 3))
+                               return;
+                       switch (direction) {
+                               case 0:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * (col + 1) - 3,
+                                               ap->yb + ap->ys * row + ap->ys / 2 - 2);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * (col + 1) - 3,
+                                               ap->yb + ap->ys * row + ap->ys / 2);
+                                       break;
+                               case 45:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * (col + 1) - 4,
+                                               ap->yb + ap->ys * row + 1);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * (col + 1) - 3,
+                                               ap->yb + ap->ys * row + 2);
+                                       break;
+                               case 90:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + ap->xs / 2 - 2,
+                                               ap->yb + ap->ys * row + 1);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + ap->xs / 2,
+                                               ap->yb + ap->ys * row + 1);
+                                       break;
+                               case 135:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + 2,
+                                               ap->yb + ap->ys * row + 1);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + 1,
+                                               ap->yb + ap->ys * row + 2);
+                                       break;
+                               case 180:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + 1,
+                                               ap->yb + ap->ys * row + ap->ys / 2 - 2);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + 1,
+                                               ap->yb + ap->ys * row + ap->ys / 2);
+                                       break;
+                               case 225:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + 2,
+                                               ap->yb + ap->ys * (row + 1) - 3);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + 1,
+                                               ap->yb + ap->ys * (row + 1) - 4);
+                                       break;
+                               case 270:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + ap->xs / 2 - 2,
+                                               ap->yb + ap->ys * (row + 1) - 3);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * col + ap->xs / 2,
+                                               ap->yb + ap->ys * (row + 1) - 3);
+                                       break;
+                               case 315:
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * (col + 1) - 4,
+                                               ap->yb + ap->ys * (row + 1) - 3);
+                                       XDrawPoint(display, window, MI_GC(mi),
+                                               ap->xb + ap->xs * (col + 1) - 3,
+                                               ap->yb + ap->ys * (row + 1) - 4);
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong eyes direction %d for ant eyes\n", direction);
+                       }
+               } else {                /* TRI */
+                       int         orient = (col + row) % 2;   /* O left 1 right */
+                       int         side, ang;
+                       XPoint      tri;
+
+                       if (!(ap->xs > 6 && ap->ys > 6))
+                               return;
+                       tri.x = ap->xb + col * ap->xs;
+                       tri.y = ap->yb + row * ap->ys;
+                       if (orient)
+                               tri.x += (ap->xs / 6 - 1);
+                       else
+                               tri.x -= (ap->xs / 6 - 1);
+                       ang = direction * ap->neighbors / ANGLES;
+                       /* approx... does not work that well for even numbers */
+                       if (
+#ifdef NUMBER_9
+                       ap->neighbors == 9 ||
+#endif
+                       ap->neighbors == 12) {
+#ifdef UNDER_CONSTRUCTION
+                               /* Not sure why this does not work */
+                               ang = ((ang + ap->neighbors / 6) / (ap->neighbors / 3)) % 3;
+#else
+                               return;
+#endif
+                       }
+                       for (side = 0; side < 3; side++) {
+                               if (side) {
+                                       tri.x += ap->shape.triangle[orient][side].x / 3;
+                                       tri.y += ap->shape.triangle[orient][side].y / 3;
+                               }
+                               /* Either you have the eyes in back or one eye in front */
+#if 0
+                               if (side == ang)
+                                       XDrawPoint(display, window, MI_GC(mi), tri.x, tri.y);
+#else
+                               if (side == (ang + 2) % 3)
+                                       XDrawPoint(display, window, MI_GC(mi), tri.x, tri.y);
+                               if (side == (ang + 1) % 3)
+                                       XDrawPoint(display, window, MI_GC(mi), tri.x, tri.y);
+#endif
+                       }
+               }
+       }
+}
+
+#if 0
+static void
+RandomSoup(mi)
+       ModeInfo   *mi;
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+       int         row, col, mrow = 0;
+
+       for (row = 0; row < ap->nrows; ++row) {
+               for (col = 0; col < ap->ncols; ++col) {
+                       ap->old[col + mrow] = (unsigned char) NRAND((int) ap->ncolors);
+                       drawcell(mi, col, row, ap->old[col + mrow]);
+               }
+               mrow += ap->nrows;
+       }
+}
+
+#endif
+
+static short
+fromTableDirection(unsigned char dir, int local_neighbors)
+{
+       /* Crafted to work for odd number of neighbors */
+       switch (dir) {
+               case FS:
+                       return 0;
+               case TLS:
+                       return (ANGLES / local_neighbors);
+               case THLS:
+                       return (2 * ANGLES / local_neighbors);
+               case TBS:
+                       return ((local_neighbors / 2) * ANGLES / local_neighbors);
+               case THRS:
+                       return (ANGLES - 2 * ANGLES / local_neighbors);
+               case TRS:
+                       return (ANGLES - ANGLES / local_neighbors);
+               case SF:
+                       return ANGLES;
+               case STL:
+                       return (ANGLES + ANGLES / local_neighbors);
+               case STHL:
+                       return (ANGLES + 2 * ANGLES / local_neighbors);
+               case STB:
+                       return (ANGLES + (local_neighbors / 2) * ANGLES / local_neighbors);
+               case STHR:
+                       return (2 * ANGLES - 2 * ANGLES / local_neighbors);
+               case STR:
+                       return (2 * ANGLES - ANGLES / local_neighbors);
+               default:
+                       (void) fprintf(stderr, "wrong direction %d from table\n", dir);
+       }
+       return -1;
+}
+
+static void
+getTable(ModeInfo * mi, int i)
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+       int         j, total;
+       unsigned char *patptr;
+
+       patptr = &tables[i][0];
+       ap->ncolors = *patptr++;
+       ap->nstates = *patptr++;
+       total = ap->ncolors * ap->nstates;
+       if (MI_IS_VERBOSE(mi))
+               (void) fprintf(stdout,
+                              "ants %d, neighbors %d, table number %d, colors %d, states %d\n",
+                         ap->n, ap->neighbors, i, ap->ncolors, ap->nstates);
+       for (j = 0; j < total; j++) {
+               ap->machine[j].color = *patptr++;
+               if (ap->sharpturn && ap->neighbors > 4) {
+                       int         k = *patptr++;
+
+                       switch (k) {
+                               case TRS:
+                                       k = THRS;
+                                       break;
+                               case THRS:
+                                       k = TRS;
+                                       break;
+                               case THLS:
+                                       k = TLS;
+                                       break;
+                               case TLS:
+                                       k = THLS;
+                                       break;
+                               case STR:
+                                       k = STHR;
+                                       break;
+                               case STHR:
+                                       k = STR;
+                                       break;
+                               case STHL:
+                                       k = STL;
+                                       break;
+                               case STL:
+                                       k = STHL;
+                                       break;
+                               default:
+                                       break;
+                       }
+                       ap->machine[j].direction = fromTableDirection(k, ap->neighbors);
+               } else {
+                       ap->machine[j].direction = fromTableDirection(*patptr++, ap->neighbors);
+               }
+               ap->machine[j].next = *patptr++;
+       }
+       ap->truchet = False;
+}
+
+static void
+getTurk(ModeInfo * mi, int i)
+{
+       antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
+       int         power2, j, number, total;
+
+       /* To force a number, say <i = 2;> has  i + 2 (or 4) binary digits */
+       power2 = 1 << (i + 1);
+       /* Do not want numbers which in binary are all 1's. */
+       number = NRAND(power2 - 1) + power2;
+       /* To force a particular number, say <number = 10;> */
+
+       ap->ncolors = i + 2;
+       ap->nstates = 1;
+       total = ap->ncolors * ap->nstates;
+       for (j = 0; j < total; j++) {
+               ap->machine[j].color = (j + 1) % total;
+               if (ap->sharpturn && ap->neighbors > 4) {
+                       ap->machine[j].direction = (power2 & number) ?
+                               fromTableDirection(THRS, ap->neighbors) :
+                               fromTableDirection(THLS, ap->neighbors);
+               } else {
+                       ap->machine[j].direction = (power2 & number) ?
+                               fromTableDirection(TRS, ap->neighbors) :
+                               fromTableDirection(TLS, ap->neighbors);
+               }
+               ap->machine[j].next = 0;
+               power2 >>= 1;
+       }
+       ap->truchet = (ap->truchet && ap->xs > 2 && ap->ys > 2 &&
+          (ap->neighbors == 3 || ap->neighbors == 4 || ap->neighbors == 6));
+       if (MI_IS_VERBOSE(mi))
+               (void) fprintf(stdout,
+                     "ants %d, neighbors %d, Turk's number %d, colors %d\n",
+                              ap->n, ap->neighbors, number, ap->ncolors);
+}
+
+static void
+free_ant(Display *display, antfarmstruct *ap)
+{
+       int         shade;
+
+       if (ap->stippledGC != None) {
+               XFreeGC(display, ap->stippledGC);
+               ap->stippledGC = None;
+       }
+       for (shade = 0; shade < ap->init_bits; shade++) {
+               XFreePixmap(display, ap->pixmaps[shade]);
+       }
+       ap->init_bits = 0;
+       if (ap->tape != NULL) {
+               (void) free((void *) ap->tape);
+               ap->tape = NULL;
+       }
+       if (ap->ants != NULL) {
+               (void) free((void *) ap->ants);
+               ap->ants = NULL;
+       }
+       if (ap->truchet_state != NULL) {
+               (void) free((void *) ap->truchet_state);
+               ap->truchet_state = NULL;
+       }
+}
+
+void
+init_ant(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       antfarmstruct *ap;
+       int         col, row, dir;
+       int         i;
+
+       if (antfarms == NULL) {
+               if ((antfarms = (antfarmstruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (antfarmstruct))) == NULL)
+                       return;
+       }
+       ap = &antfarms[MI_SCREEN(mi)];
+
+       ap->redrawing = 0;
+       if (MI_NPIXELS(mi) <= 2) {
+               if (ap->stippledGC == None) {
+                       XGCValues   gcv;
+
+                       gcv.fill_style = FillOpaqueStippled;
+                       if ((ap->stippledGC = XCreateGC(display, window, GCFillStyle,
+                                       &gcv)) == None) {
+                               free_ant(display, ap);
+                               return;
+                       }
+               }
+               if (ap->init_bits == 0) {
+                       for (i = 1; i < NUMSTIPPLES; i++) {
+                               ANTBITS(stipples[i], STIPPLESIZE, STIPPLESIZE);
+                       }
+               }
+       }
+       ap->generation = 0;
+       ap->n = MI_COUNT(mi);
+       if (ap->n < -MINANTS) {
+               /* if ap->n is random ... the size can change */
+               if (ap->ants != NULL) {
+                       (void) free((void *) ap->ants);
+                       ap->ants = NULL;
+               }
+               ap->n = NRAND(-ap->n - MINANTS + 1) + MINANTS;
+       } else if (ap->n < MINANTS)
+               ap->n = MINANTS;
+
+       ap->width = MI_WIDTH(mi);
+       ap->height = MI_HEIGHT(mi);
+
+       for (i = 0; i < NEIGHBORKINDS; i++) {
+               if (neighbors == plots[i]) {
+                       ap->neighbors = plots[i];
+                       break;
+               }
+               if (i == NEIGHBORKINDS - 1) {
+                       if (!NRAND(10)) {
+                               /* Make above 6 rare */
+                               ap->neighbors = plots[NRAND(NEIGHBORKINDS)];
+                       } else {
+                               ap->neighbors = plots[NRAND(GOODNEIGHBORKINDS)];
+                       }
+                       break;
+               }
+       }
+
+       if (ap->neighbors == 6) {
+               int         nccols, ncrows;
+
+               if (ap->width < 2)
+                       ap->width = 2;
+               if (ap->height < 4)
+                       ap->height = 4;
+               if (size < -MINSIZE) {
+                       ap->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(ap->width, ap->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+                       if (ap->ys < MINRANDOMSIZE)
+                               ap->ys = MIN(MINRANDOMSIZE,
+                                            MAX(MINSIZE, MIN(ap->width, ap->height) / MINGRIDSIZE));
+               } else if (size < MINSIZE) {
+                       if (!size)
+                               ap->ys = MAX(MINSIZE, MIN(ap->width, ap->height) / MINGRIDSIZE);
+                       else
+                               ap->ys = MINSIZE;
+               } else
+                       ap->ys = MIN(size, MAX(MINSIZE, MIN(ap->width, ap->height) /
+                                              MINGRIDSIZE));
+               ap->xs = ap->ys;
+               nccols = MAX(ap->width / ap->xs - 2, 2);
+               ncrows = MAX(ap->height / ap->ys - 1, 2);
+               ap->ncols = nccols / 2;
+               ap->nrows = 2 * (ncrows / 4);
+               ap->xb = (ap->width - ap->xs * nccols) / 2 + ap->xs / 2;
+               ap->yb = (ap->height - ap->ys * (ncrows / 2) * 2) / 2 + ap->ys - 2;
+               for (i = 0; i < 6; i++) {
+                       ap->shape.hexagon[i].x = (ap->xs - 1) * hexagonUnit[i].x;
+                       ap->shape.hexagon[i].y = ((ap->ys - 1) * hexagonUnit[i].y / 2) * 4 / 3;
+               }
+               /* Avoid array bounds read of hexagonUnit */
+               ap->shape.hexagon[6].x = 0;
+               ap->shape.hexagon[6].y = 0;
+       } else if (ap->neighbors == 4 || ap->neighbors == 8) {
+               if (size < -MINSIZE) {
+                       ap->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(ap->width, ap->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+                       if (ap->ys < MINRANDOMSIZE)
+                               ap->ys = MIN(MINRANDOMSIZE,
+                                            MAX(MINSIZE, MIN(ap->width, ap->height) / MINGRIDSIZE));
+               } else if (size < MINSIZE) {
+                       if (!size)
+                               ap->ys = MAX(MINSIZE, MIN(ap->width, ap->height) / MINGRIDSIZE);
+                       else
+                               ap->ys = MINSIZE;
+               } else
+                       ap->ys = MIN(size, MAX(MINSIZE, MIN(ap->width, ap->height) /
+                                              MINGRIDSIZE));
+               ap->xs = ap->ys;
+               ap->ncols = MAX(ap->width / ap->xs, 2);
+               ap->nrows = MAX(ap->height / ap->ys, 2);
+               ap->xb = (ap->width - ap->xs * ap->ncols) / 2;
+               ap->yb = (ap->height - ap->ys * ap->nrows) / 2;
+       } else {                /* TRI */
+               int         orient;
+
+               if (ap->width < 2)
+                       ap->width = 2;
+               if (ap->height < 2)
+                       ap->height = 2;
+               if (size < -MINSIZE) {
+                       ap->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(ap->width, ap->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+                       if (ap->ys < MINRANDOMSIZE)
+                               ap->ys = MIN(MINRANDOMSIZE,
+                                            MAX(MINSIZE, MIN(ap->width, ap->height) / MINGRIDSIZE));
+               } else if (size < MINSIZE) {
+                       if (!size)
+                               ap->ys = MAX(MINSIZE, MIN(ap->width, ap->height) / MINGRIDSIZE);
+                       else
+                               ap->ys = MINSIZE;
+               } else
+                       ap->ys = MIN(size, MAX(MINSIZE, MIN(ap->width, ap->height) /
+                                              MINGRIDSIZE));
+               ap->xs = (int) (1.52 * ap->ys);
+               ap->ncols = (MAX(ap->width / ap->xs - 1, 2) / 2) * 2;
+               ap->nrows = (MAX(ap->height / ap->ys - 1, 2) / 2) * 2;
+               ap->xb = (ap->width - ap->xs * ap->ncols) / 2 + ap->xs / 2;
+               ap->yb = (ap->height - ap->ys * ap->nrows) / 2 + ap->ys;
+               for (orient = 0; orient < 2; orient++) {
+                       for (i = 0; i < 3; i++) {
+                               ap->shape.triangle[orient][i].x =
+                                       (ap->xs - 2) * triangleUnit[orient][i].x;
+                               ap->shape.triangle[orient][i].y =
+                                       (ap->ys - 2) * triangleUnit[orient][i].y;
+                       }
+                       /* Avoid array bounds read of triangleUnit */
+                       ap->shape.triangle[orient][3].x = 0;
+                       ap->shape.triangle[orient][3].y = 0;
+               }
+       }
+
+       XSetLineAttributes(display, MI_GC(mi), 1, LineSolid, CapNotLast, JoinMiter);
+       MI_CLEARWINDOW(mi);
+       ap->painted = False;
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               ap->truchet = (Bool) (LRAND() & 1);
+               ap->eyes = (Bool) (LRAND() & 1);
+               ap->sharpturn = (Bool) (LRAND() & 1);
+       } else {
+               ap->truchet = truchet;
+               ap->eyes = eyes;
+               ap->sharpturn = sharpturn;
+       }
+       if (!NRAND(NUMSTIPPLES)) {
+               getTable(mi, (int) (NRAND(NTABLES)));
+       } else
+               getTurk(mi, (int) (NRAND(NUMSTIPPLES - 1)));
+       if (MI_NPIXELS(mi) > 2)
+               for (i = 0; i < (int) ap->ncolors - 1; i++)
+                       ap->colors[i] = (unsigned char) (NRAND(MI_NPIXELS(mi)) +
+                            i * MI_NPIXELS(mi)) / ((int) (ap->ncolors - 1));
+       if (ap->ants == NULL) {
+               if ((ap->ants = (antstruct *) malloc(ap->n * sizeof (antstruct))) ==
+                               NULL) {
+                       free_ant(display, ap);
+                       return;
+               }
+       }
+       if (ap->tape != NULL) 
+               (void) free((void *) ap->tape);
+       if ((ap->tape = (unsigned char *) calloc(ap->ncols * ap->nrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_ant(display, ap);
+               return;
+       }
+       if (ap->truchet_state != NULL)
+               (void) free((void *) ap->truchet_state);
+       if ((ap->truchet_state = (unsigned char *) calloc(ap->ncols * ap->nrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_ant(display, ap);
+               return;
+       }
+
+       row = ap->nrows / 2;
+       col = ap->ncols / 2;
+       if (col > 0 && ((ap->neighbors % 2) || ap->neighbors == 12) && (LRAND() & 1))
+               col--;
+       dir = NRAND(ap->neighbors) * ANGLES / ap->neighbors;
+       ap->init_dir = dir;
+#ifdef NUMBER_9
+       if (ap->neighbors == 9 && !((col + row) & 1))
+               dir = (dir + ANGLES - ANGLES / (ap->neighbors * 2)) % ANGLES;
+#endif
+       /* Have them all start in the same spot, why not? */
+       for (i = 0; i < ap->n; i++) {
+               ap->ants[i].col = col;
+               ap->ants[i].row = row;
+               ap->ants[i].direction = dir;
+               ap->ants[i].state = 0;
+       }
+       draw_anant(mi, dir, col, row);
+}
+
+void
+draw_ant(ModeInfo * mi)
+{
+       antstruct  *anant;
+       statestruct *status;
+       int         i, state_pos, tape_pos;
+       unsigned char color;
+       short       chg_dir, old_dir;
+       antfarmstruct *ap;
+
+       if (antfarms == NULL)
+               return;
+       ap = &antfarms[MI_SCREEN(mi)];
+       if (ap->ants == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       ap->painted = True;
+       for (i = 0; i < ap->n; i++) {
+               anant = &ap->ants[i];
+               tape_pos = anant->col + anant->row * ap->ncols;
+               color = ap->tape[tape_pos];     /* read tape */
+               state_pos = color + anant->state * ap->ncolors;
+               status = &(ap->machine[state_pos]);
+               drawcell(mi, anant->col, anant->row, status->color);
+               ap->tape[tape_pos] = status->color;     /* write on tape */
+
+               /* Find direction of Bees or Ants. */
+               /* Translate relative direction to actual direction */
+               old_dir = anant->direction;
+               chg_dir = (2 * ANGLES - status->direction) % ANGLES;
+               anant->direction = (chg_dir + old_dir) % ANGLES;
+               if (ap->truchet) {
+                       int         a = 0, b;
+
+                       if (ap->neighbors == 6) {
+                               if (ap->sharpturn) {
+                                       a = (((ANGLES + anant->direction - old_dir) % ANGLES) == 240);
+       /* should be some way of getting rid of the init_dir dependency... */
+                                       b = !(ap->init_dir % 120);
+                                       a = ((a && !b) || (b && !a));
+                                       drawtruchet(mi, anant->col, anant->row, status->color, a);
+                               } else {
+                                       a = (old_dir / 60) % 3;
+                                       b = (anant->direction / 60) % 3;
+                                       a = (a + b + 1) % 3;
+                                       drawtruchet(mi, anant->col, anant->row, status->color, a);
+                               }
+                       } else if (ap->neighbors == 4) {
+                               a = old_dir / 180;
+                               b = anant->direction / 180;
+                               a = ((a && !b) || (b && !a));
+                               drawtruchet(mi, anant->col, anant->row, status->color, a);
+                       } else if (ap->neighbors == 3) {
+                               if (chg_dir == 240)
+                                       a = (2 + anant->direction / 120) % 3;
+                               else
+                                       a = (1 + anant->direction / 120) % 3;
+                               drawtruchet(mi, anant->col, anant->row, status->color, a);
+                       }
+                       ap->truchet_state[tape_pos] = a + 1;
+               }
+               anant->state = status->next;
+
+               /* Allow step first and turn */
+               old_dir = ((status->direction < ANGLES) ? anant->direction : old_dir);
+#if DEBUG
+               (void) printf("old_dir %d, col %d, row %d", old_dir, anant->col, anant->row);
+#endif
+               position_of_neighbor(ap, old_dir, &(anant->col), &(anant->row));
+#if DEBUG
+               (void) printf(", ncol %d, nrow %d\n", anant->col, anant->row);
+#endif
+               draw_anant(mi, anant->direction, anant->col, anant->row);
+       }
+       if (++ap->generation > MI_CYCLES(mi)) {
+               init_ant(mi);
+       }
+       if (ap->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       if (ap->tape[ap->redrawpos] ||
+                        (ap->truchet && ap->truchet_state[ap->redrawpos])) {
+                               drawcell(mi, ap->redrawpos % ap->ncols, ap->redrawpos / ap->ncols,
+                                        ap->tape[ap->redrawpos]);
+                               if (ap->truchet)
+                                       drawtruchet(mi, ap->redrawpos % ap->ncols, ap->redrawpos / ap->ncols,
+                                                   ap->tape[ap->redrawpos],
+                                       ap->truchet_state[ap->redrawpos] - 1);
+                       }
+                       if (++(ap->redrawpos) >= ap->ncols * ap->nrows) {
+                               ap->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
+release_ant(ModeInfo * mi)
+{
+       if (antfarms != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_ant(MI_DISPLAY(mi), &antfarms[screen]);
+               (void) free((void *) antfarms);
+               antfarms = NULL;
+       }
+}
+
+void
+refresh_ant(ModeInfo * mi)
+{
+       antfarmstruct *ap;
+
+       if (antfarms == NULL)
+               return;
+       ap = &antfarms[MI_SCREEN(mi)];
+
+       if (ap->painted) {
+               MI_CLEARWINDOW(mi);
+               ap->redrawing = 1;
+               ap->redrawpos = 0;
+       }
+}
+
+#endif /* MODE_ant */
diff --git a/modes/ball.c b/modes/ball.c
new file mode 100644 (file)
index 0000000..a4a19e2
--- /dev/null
@@ -0,0 +1,539 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* ball --- bouncing balls with random drawing functions that leave a trail */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)ball.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by Heath Rice <rice@asl.dl.nec.com>.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Ball"
+#define HACK_INIT init_ball
+#define HACK_DRAW draw_ball
+#define ball_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 10 \n" \
+ "*cycles: 20 \n" \
+ "*size: -100 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_ball
+
+ModeSpecOpt ball_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   ball_description =
+{"ball", "init_ball", "draw_ball", "release_ball",
+ "refresh_ball", "init_ball", NULL, &ball_opts,
+ 10000, 10, 20, -100, 64, 1.0, "",
+ "Shows bouncing balls", 0, NULL};
+
+#endif
+
+#define NONE   0               /* not in a window */
+#define V      1               /* vertical */
+#define H      2               /* horizontal */
+#define B      3               /* ball */
+
+#define MINBALLS 1
+#define MINSIZE 2
+#define MINGRIDSIZE 4
+
+#define DEFNO  6
+#define SPEED  156
+#define SQLIMIT        (SPEED*SPEED/(30*30))   /* square of lower speed limit */
+#define RATE    600
+
+typedef struct {
+       int         x, y;       /* x and y coords */
+       int         dx, dy;     /* x and y velocity */
+       int         rad;
+       int         bounce;
+       int         dyold;
+       int         started;
+       int         def;
+       GC          GcF, GcB;
+} balltype;
+
+typedef struct {
+       Bool        painted;
+       balltype   *bt;
+       int         rad;
+       int         size;
+       int         width, height;
+       int         bounce;
+       int         nballs;
+       int         dispx, dispy;
+} ballstruct;
+
+static ballstruct *balls = NULL;
+
+static void
+collided(ModeInfo * mi, int i, int n, int *dx, int *dy, int td)
+{
+       ballstruct *bp = &balls[MI_SCREEN(mi)];
+       balltype   *bti = &bp->bt[i];
+       balltype   *btn = &bp->bt[n];
+       int         rx1, ry1, rx2, ry2;
+       int         Vx1, Vy1, Vx2, Vy2;
+       int         NVx1, NVy1, NVx2, NVy2;
+
+       float       Ux1, Uy1, Ux2, Uy2;
+       float       mag1, mag2, imp;
+
+       rx1 = bti->x;
+       ry1 = bti->y;
+       Vx1 = bti->dx;
+       Vy1 = bti->dy;
+
+       rx2 = btn->x;
+       ry2 = btn->y;
+       Vx2 = btn->dx;
+       Vy2 = btn->dy;
+
+       Ux1 = rx1 - rx2;
+       Uy1 = ry1 - ry2;
+       mag1 = sqrt(((Ux1 * Ux1) + (Uy1 * Uy1)));
+       Ux1 = Ux1 / mag1;
+       Uy1 = Uy1 / mag1;
+
+       Ux2 = rx2 - rx1;
+       Uy2 = ry2 - ry1;
+       mag2 = sqrt(((Ux2 * Ux2) + (Uy2 * Uy2)));
+       Ux2 = Ux2 / mag2;
+       Uy2 = Uy2 / mag2;
+
+       imp = ((Vx1 * Ux2) + (Vy1 * Uy2)) + ((Vx2 * Ux1) + (Vy2 * Uy1));
+
+       NVx1 = Vx1 + (int) (imp * Ux1);
+       NVy1 = Vy1 + (int) (imp * Uy1);
+
+       NVx2 = Vx2 + (int) (imp * Ux2);
+       NVy2 = Vy2 + (int) (imp * Uy2);
+
+       bti->dx = NVx1;
+       bti->dy = NVy1;
+
+       btn->dx = NVx2;
+       btn->dy = NVy2;
+
+       XFillArc(MI_DISPLAY(mi), MI_WINDOW(mi), btn->GcB,
+                btn->x - (btn->rad / 2), btn->y - (btn->rad / 2),
+                btn->rad, btn->rad, 0, 360 * 64);
+       if (bp->dispx > 100) {
+               *dx = (td * btn->dx) / RATE;
+               *dy = (td * btn->dy) / RATE;
+       } else {
+               *dx = (td * btn->dx) / 150;
+               *dy = (td * btn->dy) / 150;
+       }
+
+       btn->x += (*dx / 2);
+       btn->y += (*dy / 2);
+       XFillArc(MI_DISPLAY(mi), MI_WINDOW(mi), btn->GcF,
+                btn->x - (btn->rad / 2), btn->y - (btn->rad / 2),
+                btn->rad, btn->rad, 0, 360 * 64);
+
+       if (bp->dispx > 100) {
+               *dx = (td * bti->dx) / RATE;
+               *dy = (td * bti->dy) / RATE;
+       } else {
+               *dx = (td * bti->dx) / 150;
+               *dy = (td * bti->dy) / 150;
+       }
+
+       bti->x += (*dx / 2);
+       bti->y += (*dy / 2);
+}
+
+static int
+inwin(ballstruct * bp, int x, int y, int *n, int rad)
+{
+       int         i, diffx, diffy;
+
+       if ((x < 0) || (x > bp->dispx)) {
+               return (V);
+       }
+       if ((y < 0) || (y > bp->dispy)) {
+               return (H);
+       }
+       if (bp->dispx > 100) {
+               for (i = 0; i < bp->nballs; i++) {
+                       if ((i == (*n)) || (!bp->bt[i].def))
+                               continue;
+                       diffx = (bp->bt[i].x - x);
+                       diffy = (bp->bt[i].y - y);
+                       if ((diffx * diffx + diffy * diffy) <
+                           (((rad / 2) * (rad / 2) * 2) +
+                         ((bp->bt[i].rad / 2) * (bp->bt[i].rad / 2) * 2))) {
+                               (*n) = i;
+                               return (B);
+                       }
+               }
+       }
+       return (NONE);
+}
+
+static void
+randomball(ModeInfo * mi, int i)
+{
+       ballstruct *bp = &balls[MI_SCREEN(mi)];
+       balltype   *bti = &bp->bt[i];
+       Display    *display = MI_DISPLAY(mi);
+       int         x, y, bn;
+       int         dum;
+       int         attempts;
+       unsigned long randbg;
+
+       attempts = 0;
+       if (bp->bounce == -2)
+               bn = 30 + NRAND(69L);
+       else
+               bn = bp->bounce;
+
+       if (bn > 100)
+               bn = 100;
+       if (bn < 0)
+               bn = 0;
+       bn = (0 - bn);
+
+       if (bp->dispx > 100) {
+               bti->dx = NRAND(2L * SPEED) + SPEED;
+               bti->dy = NRAND(2L * SPEED) + (SPEED / 2);
+       } else {
+               bti->dx = NRAND(4L * SPEED) + (SPEED / 20);
+               bti->dy = NRAND(2L * SPEED) + (SPEED / 40);
+       }
+
+       switch (NRAND(9L) % 2) {
+               case 0:
+                       break;
+               case 1:
+                       bti->dx = (0 - bti->dx);
+                       break;
+       }
+
+       bti->bounce = bn;
+       bti->dyold = 0;
+       bti->rad = bp->rad;     /* Pretty lame... should be different sizes */
+
+       do {
+               dum = i;
+               x = NRAND((long) bp->dispx);
+               y = 0;
+               attempts++;
+               if (attempts > 5) {
+                       bti->def = 0;
+                       return;
+               }
+       } while ((inwin(bp, x, y, &dum, bti->rad) != NONE) ||
+              (inwin(bp, bti->dx + x, bti->dy + y, &dum, bti->rad) != NONE));
+
+       bti->def = 1;
+       bti->x = x;
+       bti->y = y;
+
+       /* set background color for ball */
+
+       if (MI_NPIXELS(mi) > 2) {
+               randbg = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       } else {
+               randbg = MI_BLACK_PIXEL(mi);
+       }
+       XSetForeground(display, bti->GcB, randbg);
+
+       /* set foreground color for ball */
+
+       if (MI_NPIXELS(mi) > 2) {
+               randbg = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       } else {
+               randbg = MI_WHITE_PIXEL(mi);
+       }
+       XSetForeground(display, bti->GcF, randbg);
+
+       XFillArc(display, MI_WINDOW(mi),
+                bti->GcB, bti->x - (bti->rad / 2), bti->y - (bti->rad / 2),
+                bti->rad, bti->rad, 0, 360 * 64);
+}
+
+static void
+free_ball(Display *display, ballstruct *bp)
+{
+       if (bp->bt != NULL) {
+               int i;
+
+               for (i = 0; i < bp->nballs; i++) {
+                       if (bp->bt[i].GcF != None) {
+                               XFreeGC(display, bp->bt[i].GcF);
+                               bp->bt[i].GcF = None;
+                       }
+                       if (bp->bt[i].GcB != None) {
+                               XFreeGC(display, bp->bt[i].GcB);
+                               bp->bt[i].GcB = None;
+                       }
+               }
+               (void) free((void *) bp->bt);
+               bp->bt = NULL;
+       }
+}
+
+void
+init_ball(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         GcLp, i;
+       int         size = MI_SIZE(mi);
+       ballstruct *bp;
+
+       if (balls == NULL) {
+               if ((balls = (ballstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (ballstruct))) == NULL)
+                       return;
+       }
+       bp = &balls[MI_SCREEN(mi)];
+
+       bp->bounce = 85;
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+
+       bp->nballs = MI_COUNT(mi);
+       if (bp->nballs < -MINBALLS) {
+               /* if bp->nballs is random ... the size can change */
+               if (bp->bt != NULL) {
+                       (void) free((void *) bp->bt);
+                       bp->bt = NULL;
+               }
+               bp->nballs = NRAND(-bp->nballs - MINBALLS + 1) + MINBALLS;
+       } else if (bp->nballs < MINBALLS)
+               bp->nballs = MINBALLS;
+       if (bp->bt == NULL) {
+               if ((bp->bt = (balltype *) calloc(bp->nballs, sizeof (balltype))) ==
+                               NULL) {
+                       free_ball(display, bp);
+                       return;
+               }
+       }
+       if (size == 0 ||
+        MINGRIDSIZE * size > bp->width || MINGRIDSIZE * size > bp->height) {
+               bp->rad = MAX(MINSIZE, MIN(bp->width, bp->height) / MINGRIDSIZE);
+       } else {
+               if (size < -MINSIZE)
+                       bp->rad = NRAND(MIN(-size, MAX(MINSIZE, MIN(bp->width, bp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE)
+                       bp->rad = MINSIZE;
+               else
+                       bp->rad = MIN(size, MAX(MINSIZE, MIN(bp->width, bp->height) /
+                                               MINGRIDSIZE));
+       }
+
+       /* clearballs */
+       MI_CLEARWINDOW(mi);
+       bp->painted = False;
+       XFlush(display);
+       if (bp->nballs <= 0)
+               bp->nballs = 1;
+       if (!bp->bt[0].GcB) {
+               XGCValues   gcv;
+
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               for (GcLp = 0; GcLp < bp->nballs; GcLp++) {
+                       if ((bp->bt[GcLp].GcB = XCreateGC(display, window,
+                                         GCForeground | GCBackground, &gcv)) == NULL) {
+                               free_ball(display, bp);
+                               return;
+                       }
+                       if ((bp->bt[GcLp].GcF = XCreateGC(display, window,
+                                         GCForeground | GCBackground, &gcv)) == NULL) {
+                               free_ball(display, bp);
+                               return;
+                       }
+               }
+       }
+       for (GcLp = 0; GcLp < bp->nballs; GcLp++) {
+               if (MI_NPIXELS(mi) > 2) {
+                       XSetFunction(display, bp->bt[GcLp].GcB, NRAND(16L));
+                       XSetFunction(display, bp->bt[GcLp].GcF, NRAND(16L));
+               } else {
+                       XSetFunction(display, bp->bt[GcLp].GcB, NRAND(8L));
+                       XSetFunction(display, bp->bt[GcLp].GcF, NRAND(8L));
+               }
+       }
+
+       bp->dispx = MI_WIDTH(mi);
+       bp->dispy = MI_HEIGHT(mi);
+
+       XFlush(display);
+       for (i = 0; i < bp->nballs; i++) {
+               randomball(mi, i);
+       }
+}
+
+void
+draw_ball(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i, n;
+       int         td;
+       int         dx, dy;
+       int         redo;
+       ballstruct *bp;
+
+       if (balls == NULL)
+               return;
+       bp = &balls[MI_SCREEN(mi)];
+       if (bp->bt == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       td = 10;
+       bp->painted = True;
+       for (i = 0; i < bp->nballs; i++) {
+               if (!bp->bt[i].def)
+                       randomball(mi, i);
+       }
+
+       for (i = 0; i < bp->nballs; i++) {
+               if (!bp->bt[i].def) {
+                       continue;
+               }
+               XFillArc(display, window, bp->bt[i].GcB,
+                        bp->bt[i].x - (bp->bt[i].rad / 2), bp->bt[i].y - (bp->bt[i].rad / 2),
+                        bp->bt[i].rad, bp->bt[i].rad, 0, 360 * 64);
+               redo = 0;
+               if (((bp->bt[i].dx * bp->bt[i].dx + bp->bt[i].dy * bp->bt[i].dy) <
+                    SQLIMIT) && (bp->bt[i].y >= (bp->dispy - 3))) {
+                       redo = 25;
+               }
+               do {
+                       if (bp->dispx > 100) {
+                               dx = (td * bp->bt[i].dx) / RATE;
+                               dy = (td * bp->bt[i].dy) / RATE;
+                       } else {
+                               dx = (td * bp->bt[i].dx) / 150;
+                               dy = (td * bp->bt[i].dy) / 150;
+                       }
+
+                       if (redo > 5) {
+                               redo = 0;
+                               randomball(mi, i);
+                               if (!bp->bt[i].def)
+                                       continue;
+                               XFillArc(display, window, bp->bt[i].GcF,
+                                        bp->bt[i].x - (bp->bt[i].rad / 2),
+                                        bp->bt[i].y - (bp->bt[i].rad / 2),
+                                 bp->bt[i].rad, bp->bt[i].rad, 0, 360 * 64);
+                       }
+                       n = i;
+                       switch (inwin(bp, dx + bp->bt[i].x, dy + bp->bt[i].y, &n,
+                                     bp->bt[i].rad)) {
+                               case NONE:
+                                       bp->bt[i].x += dx;
+                                       bp->bt[i].y += dy;
+                                       redo = 0;
+                                       break;
+                               case V:
+                                       bp->bt[i].dx = (int) (((float) bp->bt[i].bounce *
+                                       (float) bp->bt[i].dx) / (float) 100);
+                                       redo++;
+                                       break;
+                               case H:
+                                       bp->bt[i].dy = (int) (((float) bp->bt[i].bounce *
+                                       (float) bp->bt[i].dy) / (float) 100);
+                                       if (bp->bt[i].bounce != 100) {
+                                               if ((bp->bt[i].y >= (bp->dispy - 3)) && (bp->bt[i].dy > -250) &&
+                                                   (bp->bt[i].dy < 0)) {
+                                                       redo = 15;
+                                               }
+                                               if ((bp->bt[i].y >= (bp->dispy - 3)) &&
+                                                   (bp->bt[i].dy == bp->bt[i].dyold)) {
+                                                       redo = 10;
+                                               }
+                                               bp->bt[i].dyold = bp->bt[i].dy;
+                                       }
+                                       redo++;
+                                       break;
+                               case B:
+                                       if (redo > 5) {
+                                               if (bp->bt[i].y >= (bp->dispy - 3)) {
+                                                       randomball(mi, i);
+                                                       redo = 0;
+                                               } else if (bp->bt[n].y >= (bp->dispy - 3)) {
+                                                       randomball(mi, n);
+                                                       redo = 0;
+                                               } else
+                                                       redo = 0;
+                                       } else {
+                                               collided(mi, i, n, &dx, &dy, td);
+                                               redo = 0;
+                                       }
+                                       break;
+                       }
+               }
+               while (redo);
+               bp->bt[i].dy += td;
+
+               if (bp->bt[i].def)
+                       XFillArc(display, window, bp->bt[i].GcF,
+                                bp->bt[i].x - (bp->bt[i].rad / 2), bp->bt[i].y - (bp->bt[i].rad / 2),
+                                bp->bt[i].rad, bp->bt[i].rad, 0, 360 * 64);
+       }
+
+       XFlush(display);
+}
+
+void
+release_ball(ModeInfo * mi)
+{
+       if (balls != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_ball(MI_DISPLAY(mi), &balls[screen]);
+               (void) free((void *) balls);
+               balls = NULL;
+       }
+}
+
+void
+refresh_ball(ModeInfo * mi)
+{
+       ballstruct *bp;
+
+       if (balls == NULL)
+               return;
+       bp = &balls[MI_SCREEN(mi)];
+
+       if (bp->painted)
+               MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_ball */
diff --git a/modes/bat.c b/modes/bat.c
new file mode 100644 (file)
index 0000000..4181fad
--- /dev/null
@@ -0,0 +1,717 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* bat --- bouncing bats */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)bat.c        5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1988 by Sun Microsystems
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 18-Sep-1995: 5 bats now in color <patol@info.isbiel.ch>
+ * 20-Sep-1994: 5 bats instead of bouncing balls, based on bounce.c
+ *              <patol@info.isbiel.ch>
+ * 02-Sep-1993: bounce version David Bagley <bagleyd@tux.org>
+ * 1986: Sun Microsystems
+ */
+
+/*-
+ * original copyright
+ * **************************************************************************
+ * Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, 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 Sun or MIT not be used in advertising
+ * or publicity pertaining to distribution of the software without specific
+ * prior written permission. Sun and M.I.T. make no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without any express or implied warranty.
+ *
+ * SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * IN NO EVENT SHALL SUN 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.
+ * ***************************************************************************
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Bat"
+#define HACK_INIT init_bat
+#define HACK_DRAW draw_bat
+#define bat_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: -8 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 200 \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "vis.h"
+#include "color.h"
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_bat
+
+ModeSpecOpt bat_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   bat_description =
+{"bat", "init_bat", "draw_bat", "release_bat",
+ "refresh_bat", "init_bat", NULL, &bat_opts,
+ 100000, -8, 1, 0, 64, 1.0, "",
+ "Shows bouncing flying bats", 0, NULL};
+
+#endif
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#if USE_XPMINC
+#include <xpm.h>
+#else
+#include <X11/xpm.h>           /* Normal spot */
+#endif
+#include "pixmaps/bat-0.xpm"
+#include "pixmaps/bat-1.xpm"
+#include "pixmaps/bat-2.xpm"
+#include "pixmaps/bat-3.xpm"
+#include "pixmaps/bat-4.xpm"
+#endif
+
+#include "bitmaps/bat-0.xbm"
+#include "bitmaps/bat-1.xbm"
+#include "bitmaps/bat-2.xbm"
+#include "bitmaps/bat-3.xbm"
+#include "bitmaps/bat-4.xbm"
+
+/* aliases for vars defined in the bitmap file */
+#define BAT_WIDTH     image_width
+#define BAT_HEIGHT    image_height
+#define BAT_BITS      image_bits
+
+#include "bat.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define BAT_NAME      image_name
+#include "bat.xpm"
+#define DEFAULT_XPM 1
+#endif
+
+#define MAX_STRENGTH 24
+#define FRICTION 15
+#define PENETRATION 0.4
+#define SLIPAGE 4
+#define TIME 32
+#define MINBATS 1
+#define MINSIZE 1
+#define MINGRIDSIZE 3
+
+#define ORIENTS 8
+#define ORIENTCYCLE 32
+#define CCW 1
+#define CW (ORIENTS-1)
+#define DIR(x) (((x)>=0)?CCW:CW)
+#define SIGN(x)        (((x)>=0)?1:-1)
+
+static XImage bimages[] =
+{
+       {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1}
+};
+
+typedef struct {
+       int         x, y, xlast, ylast;
+       int         spincount, spindelay, spindir, orient;
+       int         vx, vy, vang;
+       int         graphics_format;
+       unsigned long color;
+} batstruct;
+
+typedef struct {
+       int         width, height;
+       int         nbats;
+       int         xs, ys;
+       int         floor;
+       int         avgsize;
+       int         restartnum;
+       int         graphics_format;
+       int         pixelmode;
+       GC          backGC;
+       XImage     *logo;
+       Pixmap      pixmap;
+       Colormap    cmap;
+       unsigned long black;
+       batstruct  *bats;
+       XImage     *images[ORIENTS / 2 + 1];
+} bouncestruct;
+
+static bouncestruct *bounces = NULL;
+
+static unsigned char *bits[] =
+{
+       bat0_bits, bat1_bits, bat2_bits, bat3_bits, bat4_bits
+};
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+static char **pixs[] =
+{
+       bat0, bat1, bat2, bat3, bat4
+};
+
+#endif
+
+static void
+checkCollision(bouncestruct * bp, int a_bat)
+{
+       int         i, amount, spin, d, size;
+       double      x, y;
+
+       for (i = 0; i < bp->nbats; i++) {
+               if (i != a_bat) {
+                       x = (double) (bp->bats[i].x - bp->bats[a_bat].x);
+                       y = (double) (bp->bats[i].y - bp->bats[a_bat].y);
+                       d = (int) sqrt(x * x + y * y);
+                       size = bp->avgsize;
+                       if (d > 0 && d < size) {
+                               amount = size - d;
+                               if (amount > PENETRATION * size)
+                                       amount = (int) (PENETRATION * size);
+                               bp->bats[i].vx += (int) ((double) amount * x / d);
+                               bp->bats[i].vy += (int) ((double) amount * y / d);
+                               bp->bats[i].vx -= bp->bats[i].vx / FRICTION;
+                               bp->bats[i].vy -= bp->bats[i].vy / FRICTION;
+                               bp->bats[a_bat].vx -= (int) ((double) amount * x / d);
+                               bp->bats[a_bat].vy -= (int) ((double) amount * y / d);
+                               bp->bats[a_bat].vx -= bp->bats[a_bat].vx / FRICTION;
+                               bp->bats[a_bat].vy -= bp->bats[a_bat].vy / FRICTION;
+                               spin = (bp->bats[i].vang - bp->bats[a_bat].vang) /
+                                       (2 * size * SLIPAGE);
+                               bp->bats[i].vang -= spin;
+                               bp->bats[a_bat].vang += spin;
+                               bp->bats[i].spindir = DIR(bp->bats[i].vang);
+                               bp->bats[a_bat].spindir = DIR(bp->bats[a_bat].vang);
+                               if (!bp->bats[i].vang) {
+                                       bp->bats[i].spindelay = 1;
+                                       bp->bats[i].spindir = 0;
+                               } else
+                                       bp->bats[i].spindelay = (int) ((double) M_PI *
+                                                                      bp->avgsize / (ABS(bp->bats[i].vang))) + 1;
+                               if (!bp->bats[a_bat].vang) {
+                                       bp->bats[a_bat].spindelay = 1;
+                                       bp->bats[a_bat].spindir = 0;
+                               } else
+                                       bp->bats[a_bat].spindelay = (int) ((double) M_PI *
+                                                                          bp->avgsize / (ABS(bp->bats[a_bat].vang))) + 1;
+                               return;
+                       }
+               }
+       }
+}
+
+static void
+drawbat(ModeInfo * mi, batstruct * bat)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+
+       if (bp->pixelmode) {
+               if (bat->xlast != -1) {
+                       XSetForeground(display, bp->backGC, bp->black);
+                       XFillRectangle(display, window, bp->backGC,
+                                    bat->xlast, bat->ylast, bp->xs, bp->ys);
+               }
+               XSetForeground(display, bp->backGC, bat->color);
+               XCopyPlane(display, bp->pixmap, window, bp->backGC,
+                       0, 0, bp->xs, bp->ys, bat->x, bat->y, 1L);
+       } else {
+               XSetForeground(display, bp->backGC, bat->color);
+               if (bp->logo)
+                       (void) XPutImage(display, window, bp->backGC, bp->logo,
+                                0, 0, bat->x, bat->y, bp->xs, bp->ys);
+               else
+/* PURIFY 4.0.1 on SunOS4 and on Solaris 2 reports a 15985 byte memory leak on
+   * the next line. */
+                       (void) XPutImage(display, window, bp->backGC,
+                                bp->images[(bat->orient > ORIENTS / 2) ?
+                                       ORIENTS - bat->orient : bat->orient],
+                                0, 0, bat->x, bat->y, bp->xs, bp->ys);
+               if (bat->xlast != -1) {
+                       XSetForeground(display, bp->backGC, bp->black);
+                       ERASE_IMAGE(display, window, bp->backGC,
+                                   bat->x, bat->y, bat->xlast, bat->ylast, bp->xs, bp->ys);
+               }
+       }
+}
+
+static void
+flapbat(batstruct * bat, int dir, int *vel, int avgsize)
+{
+       *vel -= (int) ((*vel + SIGN(*vel * dir) *
+                bat->spindelay * ORIENTCYCLE / (M_PI * avgsize)) / SLIPAGE);
+       if (*vel) {
+               bat->spindir = DIR(*vel * dir);
+               bat->vang = *vel * ORIENTCYCLE;
+               bat->spindelay = (int) ((double) M_PI * avgsize / (ABS(bat->vang))) + 1;
+       } else
+               bat->spindir = 0;
+}
+
+static void
+movebat(bouncestruct * bp, batstruct * bat)
+{
+       bat->xlast = bat->x;
+       bat->ylast = bat->y;
+       bat->x += bat->vx;
+       if (bat->x > (bp->width - bp->xs)) {
+               /* Bounce off the right edge */
+               bat->x = 2 * (bp->width - bp->xs) - bat->x;
+               bat->vx = -bat->vx + bat->vx / FRICTION;
+               flapbat(bat, 1, &bat->vy, bp->avgsize);
+       } else if (bat->x < 0) {
+               /* Bounce off the left edge */
+               bat->x = -bat->x;
+               bat->vx = -bat->vx + bat->vx / FRICTION;
+               flapbat(bat, -1, &bat->vy, bp->avgsize);
+       }
+       bat->vy++;
+       bat->y += bat->vy;
+       if (bat->y >= (bp->height + bp->floor * bp->ys)) {
+               /* Do not want to see bat bounce */
+               /* Bounce off the bottom edge */
+               bat->y = (bp->height - bp->ys);
+               bat->vy = -bat->vy + bat->vy / FRICTION;
+               flapbat(bat, -1, &bat->vx, bp->avgsize);
+       }
+#if 0
+       else if (bat->y < 0) {
+               /* Bounce off the top edge */
+               bat->y = -bat->y;
+               bat->vy = -bat->vy + bat->vy / FRICTION;
+               flapbat(bat, 1, &bat->vx, bp->avgsize);
+       }
+#endif
+       if (bat->spindir) {
+               bat->spincount--;
+               if (!bat->spincount) {
+                       bat->orient = (bat->spindir + bat->orient) % ORIENTS;
+                       bat->spincount = bat->spindelay;
+               }
+       }
+}
+
+static int
+collide(bouncestruct * bp, int a_bat)
+{
+       int         i, d, x, y;
+
+       for (i = 0; i < a_bat; i++) {
+               x = (bp->bats[i].x - bp->bats[a_bat].x);
+               y = (bp->bats[i].y - bp->bats[a_bat].y);
+               d = (int) sqrt((double) (x * x + y * y));
+               if (d < bp->avgsize)
+                       return i;
+       }
+       return i;
+}
+
+static void
+free_stuff(Display * display, bouncestruct * bp)
+{
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       if (bp->graphics_format == IS_XPM) {
+               int         i;
+
+               for (i = 0; i <= ORIENTS / 2; i++) {
+                       if (bp->images[i]) {
+                               (void) XDestroyImage(bp->images[i]);
+                               bp->images[i] = None;
+                       }
+               }
+               bp->graphics_format = IS_NONE;
+       }
+       if (bp->cmap != None) {
+               XFreeColormap(display, bp->cmap);
+               if (bp->backGC != None) {
+                       XFreeGC(display, bp->backGC);
+                       bp->backGC = None;
+               }
+               bp->cmap = None;
+       } else
+               bp->backGC = None;
+#endif
+       if (bp->logo != None) {
+               destroyImage(&bp->logo, &bp->graphics_format);
+               bp->logo = None;
+       }
+}
+
+static void
+free_bat(Display *display, bouncestruct *bp)
+{
+       free_stuff(display, bp);
+       if (bp->bats != NULL) {
+               (void) free((void *) bp->bats);
+               bp->bats = NULL;
+       }
+       if (bp->pixmap != None) {
+               XFreePixmap(display, bp->pixmap);
+               bp->pixmap = None;
+       }
+               
+}
+
+static Bool
+init_stuff(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+       int i;
+
+       if (MI_BITMAP(mi) && strlen(MI_BITMAP(mi))) {
+               if (bp->logo == None) {
+                getImage(mi, &bp->logo, BAT_WIDTH, BAT_HEIGHT, BAT_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                         DEFAULT_XPM, BAT_NAME,
+#endif
+                         &bp->graphics_format, &bp->cmap, &bp->black);
+                       if (bp->logo == None) {
+                               free_bat(display, bp);
+                               return False;
+                       }
+               }
+       } else {
+       if (!bp->cmap) {
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+               int         total = 0;
+
+               if (!MI_IS_FULLRANDOM(mi) || LRAND() & 1) {
+                       XpmAttributes attrib;
+
+#ifndef STANDALONE
+                       if (!fixedColors(mi)) {
+                               if ((bp->cmap = XCreateColormap(display, window,
+                                               MI_VISUAL(mi), AllocNone)) == None) {
+                                       free_bat(display, bp);
+                                       return False;
+                               }
+                               attrib.colormap = bp->cmap;
+                               reserveColors(mi, bp->cmap, &bp->black);
+                       } else
+#endif /* STANDALONE */
+                               attrib.colormap = MI_COLORMAP(mi);
+
+                       attrib.visual = MI_VISUAL(mi);
+                       attrib.depth = MI_DEPTH(mi);
+                       attrib.valuemask = XpmVisual | XpmColormap | XpmDepth;
+
+                       if (bp->graphics_format == IS_NONE
+#ifndef USE_MONOXPM
+                           && MI_NPIXELS(mi) > 2
+#endif
+                               ) {
+                               for (i = 0; i <= ORIENTS / 2; i++)
+                                       if (XpmSuccess != XpmCreateImageFromData(display, pixs[i],
+                                       &(bp->images[i]), (XImage **) NULL, &attrib))
+                                               break;
+                               bp->graphics_format = IS_XPM;
+                               total = i;
+                               if (total <= ORIENTS / 2) {     /* All or nothing */
+                                       bp->graphics_format = IS_XBM;
+                                       if (MI_IS_VERBOSE(mi))
+                                               (void) fprintf(stderr, "Full color images could not be loaded.\n");
+                                       for (i = 0; i < total; i++) {
+                                               (void) XDestroyImage(bp->images[i]);
+                                               bp->images[i] = None;
+                                       }
+                                       bp->images[total] = None;
+                                       if (bp->cmap != None) {
+                                               XFreeColormap(display, bp->cmap);
+                                               bp->cmap = None;
+                                       }
+                               }
+                       }
+               }
+               if (total <= ORIENTS / 2)
+#endif
+
+               {
+                       if (!bimages[0].data)   /* Only need to do this once */
+                               for (i = 0; i <= ORIENTS / 2; i++) {
+                                       bimages[i].data = (char *) bits[i];
+                                       bimages[i].width = bat0_width;
+                                       bimages[i].height = bat0_height;
+                                       bimages[i].bytes_per_line = (bat0_width + 7) / 8;
+                               }
+                       for (i = 0; i <= ORIENTS / 2; i++)
+                               bp->images[i] = &(bimages[i]);
+               }
+       }
+  }
+       if (bp->cmap != None) {
+
+#ifndef STANDALONE
+               setColormap(display, window, bp->cmap, MI_IS_INWINDOW(mi));
+#endif
+               if (bp->backGC == None) {
+                       XGCValues   xgcv;
+
+                       xgcv.background = bp->black;
+                       if ((bp->backGC = XCreateGC(display, window,
+                                       GCBackground, &xgcv)) == None) {
+                               free_bat(display, bp);
+                               return False;
+                       }
+               }
+       } else {
+               bp->black = MI_BLACK_PIXEL(mi);
+               bp->backGC = MI_GC(mi);
+       }
+       return True;
+}
+
+void
+init_bat(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       int         i, tryagain = 0;
+       bouncestruct *bp;
+
+       if (bounces == NULL) {
+               if ((bounces = (bouncestruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (bouncestruct))) == NULL)
+                       return;
+       }
+       bp = &bounces[MI_SCREEN(mi)];
+
+       free_stuff(display, bp);
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+       if (bp->width < 2)
+               bp->width = 2;
+       if (bp->height < 2)
+               bp->height = 2;
+       bp->restartnum = TIME;
+       bp->floor = NRAND(3) + 2;
+
+       bp->nbats = MI_COUNT(mi);
+       if (bp->nbats < -MINBATS) {
+               /* if bp->nbats is random ... the size can change */
+               if (bp->bats != NULL) {
+                       (void) free((void *) bp->bats);
+                       bp->bats = NULL;
+               }
+               bp->nbats = NRAND(-bp->nbats - MINBATS + 1) + MINBATS;
+       } else if (bp->nbats < MINBATS)
+               bp->nbats = MINBATS;
+       if (!bp->bats) {
+               if ((bp->bats = (batstruct *) malloc(bp->nbats *
+                                sizeof (batstruct))) == NULL) {
+                       free_bat(display, bp);
+                       return;
+               }
+       }
+       if (!init_stuff(mi))
+               return;
+       if (size == 0 ||
+           MINGRIDSIZE * size > bp->width / 2 || MINGRIDSIZE * size > bp->height) {
+               if (bp->logo) {
+                       bp->xs = bp->logo->width;
+                       bp->ys = bp->logo->height;
+               } else {
+                       bp->xs = bat0_width;
+                       bp->ys = bat0_height;
+               }
+               if (bp->width > MINGRIDSIZE * bp->xs &&
+                   bp->height > MINGRIDSIZE * bp->ys) {
+                       bp->pixelmode = False;
+               } else {
+                       bp->pixelmode = True;
+                       bp->ys = MAX(MINSIZE, MIN(bp->width / 2, bp->height) / MINGRIDSIZE);
+                       bp->xs = 2 * bp->ys;
+                       free_stuff(display, bp); /* too big */
+               }
+       } else {
+               bp->pixelmode = True;
+               if (size < -MINSIZE)
+                       bp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(bp->width / 2, bp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE)
+                       bp->ys = MINSIZE;
+               else
+                       bp->ys = MIN(size, MAX(MINSIZE, MIN(bp->width / 2, bp->height) /
+                                              MINGRIDSIZE));
+               bp->xs = 2 * bp->ys;
+       }
+       bp->avgsize = (bp->xs + bp->ys) / 2;
+
+    if (bp->pixelmode) {
+               GC fg_gc, bg_gc;
+               XGCValues gcv;
+
+               if ((bp->pixmap = XCreatePixmap(display, window, bp->xs, bp->ys, 1)) ==
+                               None) {
+                       free_bat(display, bp);
+                       return;
+               }
+               gcv.foreground = 0;
+               gcv.background = 1;
+               if ((bg_gc = XCreateGC(display, bp->pixmap,
+                                GCForeground | GCBackground, &gcv)) == None) {
+                       free_bat(display, bp);
+                       return;
+               }
+               gcv.background = 0;
+               gcv.foreground = 1;
+               if ((fg_gc = XCreateGC(display, bp->pixmap,
+                                GCForeground | GCBackground, &gcv)) == None) {
+                       XFreeGC(display, bg_gc);
+                       free_bat(display, bp);
+                       return;
+               }
+               XFillRectangle(display, bp->pixmap, bg_gc,
+                       0, 0, bp->xs, bp->ys);
+               XFillArc(display, bp->pixmap, fg_gc,
+                       0, 0, bp->xs / 2, 2 * bp->ys,
+                       0, 11520);
+               XFillArc(display, bp->pixmap, fg_gc,
+                       bp->xs / 2, 0, bp->xs / 2, 2 * bp->ys,
+                       0, 11520);
+               XFillRectangle(display, bp->pixmap, fg_gc,
+                       bp->xs / 4, bp->ys / 2,
+               bp->xs / 2, bp->ys / 2);
+               XFillArc(display, bp->pixmap, bg_gc,
+                       0, bp->ys / 2, bp->xs / 2, 2 * bp->ys,
+                       0, 11520);
+               XFillArc(display, bp->pixmap, bg_gc,
+                       bp->xs / 2, bp->ys / 2, bp->xs / 2, 2 * bp->ys,
+                       0, 11520);
+               XFreeGC(display, bg_gc);
+               XFreeGC(display, fg_gc);
+
+               bp->black = MI_BLACK_PIXEL(mi);
+               bp->backGC = MI_GC(mi);
+       }
+
+       i = 0;
+       while (i < bp->nbats) {
+               bp->bats[i].vx = ((LRAND() & 1) ? -1 : 1) * (NRAND(MAX_STRENGTH) + 1);
+               bp->bats[i].x = (bp->bats[i].vx >= 0) ? 0 : bp->width - bp->xs;
+               bp->bats[i].y = NRAND(bp->height / 2);
+               if (i == collide(bp, i) || tryagain >= 8) {
+                       if (MI_NPIXELS(mi) > 2)
+                               bp->bats[i].color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       else
+                               bp->bats[i].color = MI_WHITE_PIXEL(mi);
+                       bp->bats[i].xlast = -1;
+                       bp->bats[i].ylast = 0;
+                       bp->bats[i].spincount = 1;
+                       bp->bats[i].spindelay = 1;
+                       bp->bats[i].vy = ((LRAND() & 1) ? -1 : 1) * NRAND(MAX_STRENGTH);
+                       bp->bats[i].spindir = 0;
+                       bp->bats[i].vang = 0;
+                       bp->bats[i].orient = NRAND(ORIENTS);
+                       i++;
+               } else
+                       tryagain++;
+       }
+       /* don't want any exposure events from XCopyPlane */
+    XSetGraphicsExposures(display, MI_GC(mi), False);
+       MI_CLEARWINDOWCOLORMAP(mi, bp->backGC, bp->black);
+}
+
+void
+draw_bat(ModeInfo * mi)
+{
+       int           i;
+       bouncestruct *bp;
+
+       if (bounces == NULL)
+               return;
+       bp = &bounces[MI_SCREEN(mi)];
+       if (bp->bats == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       for (i = 0; i < bp->nbats; i++) {
+               drawbat(mi, &bp->bats[i]);
+               movebat(bp, &bp->bats[i]);
+       }
+       for (i = 0; i < bp->nbats; i++)
+               checkCollision(bp, i);
+       if (!NRAND(TIME))       /* Put some randomness into the time */
+               bp->restartnum--;
+       if (!bp->restartnum)
+               init_bat(mi);
+}
+
+void
+release_bat(ModeInfo * mi)
+{
+       if (bounces != NULL) {
+               int        screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_bat(MI_DISPLAY(mi), &bounces[screen]);
+               (void) free((void *) bounces);
+               bounces = NULL;
+       }
+}
+
+void
+refresh_bat(ModeInfo * mi)
+{
+       bouncestruct *bp;
+
+       if (bounces == NULL)
+               return;
+       bp = &bounces[MI_SCREEN(mi)];
+       if (bp->bats == NULL)
+               return;
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       /* This is only needed when another program changes the colormap. */
+       if (MI_BITMAP(mi) && strlen(MI_BITMAP(mi))) {
+               init_bat(mi);
+       } else {
+               MI_CLEARWINDOWCOLORMAP(mi, bp->backGC, bp->black);
+               free_stuff(MI_DISPLAY(mi), bp);
+               (void) init_stuff(mi);
+       }
+#else
+       MI_CLEARWINDOWCOLORMAP(mi, bp->backGC, bp->black);
+#endif
+}
+
+#endif /* MODE_bat */
diff --git a/modes/blank.c b/modes/blank.c
new file mode 100644 (file)
index 0000000..7cd4456
--- /dev/null
@@ -0,0 +1,97 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* blank --- blank screen */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)blank.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 10-May-1997: Compatible with xscreensaver :)  OK you probably should not
+ *              use this for xscreensaver but I could not resist.
+ * 21-Mar-1996: Ron Hitchens <ron@idiom.com>
+ *                     Bonehead alert.  Don't blank during password prompting.
+ * 19-Mar-1996: Ron Hitchens <ron@idiom.com>
+ *                     Changed to activate X server's native screensaver.
+ *                     On some devices, this will result in power saving "sleep"
+ *                     mode, or video blanking.
+ * 31-Aug-1990: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Blank"
+#define HACK_INIT init_blank
+#define HACK_DRAW draw_blank
+#define blank_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000000 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+ModeSpecOpt blank_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   blank_description =
+{"blank", "init_blank", "draw_blank", "release_blank",
+ "refresh_blank", "init_blank", NULL, &blank_opts,
+ 3000000, 1, 1, 1, 64, 1.0, "",
+ "Shows nothing but a black screen", 0, NULL};
+
+#endif
+
+extern Bool enablesaver;
+
+void
+init_blank(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+       /* Must set PreferBlanking, or XForceScreenSaver won't work */
+       if (!MI_IS_INWINDOW(mi) && !MI_IS_INROOT(mi) && !enablesaver)
+               XSetScreenSaver(MI_DISPLAY(mi), 0, 0, PreferBlanking, 0);
+}
+
+/* ARGSUSED */
+void
+draw_blank(ModeInfo * mi)
+{
+       /* Leave the lights on while user types password */
+       if (!MI_IS_INWINDOW(mi) && !MI_IS_INROOT(mi) && !enablesaver) {
+               if (MI_IS_ICONIC(mi))
+                       XForceScreenSaver(MI_DISPLAY(mi), ScreenSaverReset);
+               else
+                       XForceScreenSaver(MI_DISPLAY(mi), ScreenSaverActive);
+       }
+}
+
+void
+release_blank(ModeInfo * mi)
+{
+       /* clear screensaver settings, just in case */
+       if (!MI_IS_INWINDOW(mi) && !MI_IS_INROOT(mi) && !enablesaver) {
+               XForceScreenSaver(MI_DISPLAY(mi), ScreenSaverReset);
+               XSetScreenSaver(MI_DISPLAY(mi), 0, 0, 0, 0);
+       }
+}
+
+void
+refresh_blank(ModeInfo * mi)
+{
+       /* Do nothing, it will refresh by itself :) */
+}
diff --git a/modes/blot.c b/modes/blot.c
new file mode 100644 (file)
index 0000000..dd4df17
--- /dev/null
@@ -0,0 +1,215 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* blot --- Rorschach's ink blot test */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)blot.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 05-Jan-1995: patch for Dual-Headed machines from Greg Onufer
+ *              <Greg.Onufer@Eng.Sun.COM>
+ * 07-Dec-1994: now randomly has xsym, ysym, or both.
+ * 02-Sep-1993: xlock version David Bagley <bagleyd@tux.org>
+ * 1992:        xscreensaver version Jamie Zawinski <jwz@jwz.org>
+ */
+
+/*-
+ * original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Blot"
+#define HACK_INIT init_blot
+#define HACK_DRAW draw_blot
+#define blot_opts xlockmore_opts
+#define DEFAULTS "*delay: 2000000 \n" \
+ "*count: 6 \n" \
+ "*cycles: 30 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_blot
+
+ModeSpecOpt blot_opts =
+{0, NULL, 0, NULL, NULL};
+
+#ifdef USE_MODULES
+ModStruct   blot_description =
+{"blot", "init_blot", "draw_blot", "release_blot",
+ "refresh_blot", "init_blot", NULL, &blot_opts,
+ 200000, 6, 30, 1, 64, 0.3, "",
+ "Shows Rorschach's ink blot test", 0, NULL};
+
+#endif
+
+typedef struct {
+       int         width;
+       int         height;
+       int         xmid, ymid;
+       int         offset;
+       int         xsym, ysym;
+       int         size;
+       int         pix;
+       int         count;
+       XPoint     *pointBuffer;
+       unsigned int pointBufferSize;
+} blotstruct;
+
+static blotstruct *blots = NULL;
+
+void
+init_blot(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       blotstruct *bp;
+
+       if (blots == NULL) {
+               if ((blots = (blotstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (blotstruct))) == NULL)
+                       return;
+       }
+       bp = &blots[MI_SCREEN(mi)];
+
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+       bp->xmid = bp->width / 2;
+       bp->ymid = bp->height / 2;
+
+       bp->offset = 4;
+       bp->ysym = (int) LRAND() & 1;
+       bp->xsym = (bp->ysym) ? (int) LRAND() & 1 : 1;
+       if (MI_NPIXELS(mi) > 2)
+               bp->pix = NRAND(MI_NPIXELS(mi));
+       if (bp->offset <= 0)
+               bp->offset = 3;
+       if (MI_COUNT(mi) < 0)
+               bp->size = NRAND(-MI_COUNT(mi) + 1);
+       else
+               bp->size = MI_COUNT(mi);
+
+       /* Fudge the size so it takes up the whole screen */
+       bp->size *= (bp->width / 32 + 1) * (bp->height / 32 + 1);
+       if (!bp->pointBuffer || bp->pointBufferSize < bp->size * sizeof (XPoint)) {
+               if (bp->pointBuffer != NULL)
+                       (void) free((void *) bp->pointBuffer);
+               bp->pointBufferSize = bp->size * sizeof (XPoint);
+               if ((bp->pointBuffer = (XPoint *) malloc(bp->pointBufferSize)) ==
+                               NULL) {
+                       return;
+               }
+       }
+       MI_CLEARWINDOW(mi);
+       XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+       bp->count = 0;
+}
+
+void
+draw_blot(ModeInfo * mi)
+{
+       blotstruct *bp;
+       XPoint     *xp;
+       int         x, y, k;
+
+       if (blots == NULL)
+               return;
+       bp = &blots[MI_SCREEN(mi)];
+       xp = bp->pointBuffer;
+       if (xp == NULL)
+               init_blot(mi);
+
+       MI_IS_DRAWN(mi) = True;
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_PIXEL(mi, bp->pix));
+               if (++bp->pix >= MI_NPIXELS(mi))
+                       bp->pix = 0;
+       }
+       x = bp->xmid;
+       y = bp->ymid;
+       k = bp->size;
+       while (k >= 4) {
+               x += (NRAND(1 + (bp->offset << 1)) - bp->offset);
+               y += (NRAND(1 + (bp->offset << 1)) - bp->offset);
+               k--;
+               xp->x = x;
+               xp->y = y;
+               xp++;
+               if (bp->xsym) {
+                       k--;
+                       xp->x = bp->width - x;
+                       xp->y = y;
+                       xp++;
+               }
+               if (bp->ysym) {
+                       k--;
+                       xp->x = x;
+                       xp->y = bp->height - y;
+                       xp++;
+               }
+               if (bp->xsym && bp->ysym) {
+                       k--;
+                       xp->x = bp->width - x;
+                       xp->y = bp->height - y;
+                       xp++;
+               }
+       }
+       XDrawPoints(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                   bp->pointBuffer, (bp->size - k), CoordModeOrigin);
+       if (++bp->count > MI_CYCLES(mi))
+               init_blot(mi);
+}
+
+
+void
+release_blot(ModeInfo * mi)
+{
+       if (blots != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       blotstruct *bp = &blots[screen];
+
+                       if (bp->pointBuffer != NULL) {
+                               (void) free((void *) bp->pointBuffer);
+                               /* bp->pointBuffer == NULL; */
+                       }
+               }
+               (void) free((void *) blots);
+               blots = NULL;
+       }
+}
+
+void
+refresh_blot(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_blot */
diff --git a/modes/bomb.c b/modes/bomb.c
new file mode 100644 (file)
index 0000000..8b7bc48
--- /dev/null
@@ -0,0 +1,499 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* bomb --- temporary screen */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)bomb.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1994 by Dave Shield
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Made more compatible with xscreensaver :)
+ * 09-Jan-1995: Assorted defines to control various aspects of bomb mode.
+ *              Uncomment, or otherwise define the appropriate line
+ *              to obtain the relevant behaviour, thanks to Dave Shield
+ *              <D.T.Shield@csc.liv.ac.uk>.
+ * 20-Dec-1994: Time patch for multiprocessor machines (ie. Sun10) thanks to
+ *              Nicolas Pioch <pioch@Email.ENST.Fr>.
+ * 1994:        Written.  Dave Shield  Liverpool Computer Science
+ */
+
+/*-
+ * This mode may have limited appeal.  Its good for logging yourself out
+ * if you do not know if your going to be back.  It is no longer to be used
+ * as a way of forcing users in a lab to logout after locking the screen.
+ */
+
+
+#ifdef STANDALONE
+#define USE_BOMB
+#define PROGCLASS "Bomb"
+#define HACK_INIT init_bomb
+#define HACK_DRAW draw_bomb
+#define bomb_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000000 \n" \
+ "*count: 10 \n" \
+ "*cycles: 20 \n" \
+ "*ncolors: 200 \n" \
+ "*verbose: False \n"
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_bomb
+
+ModeSpecOpt bomb_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   bomb_description =
+{"bomb", "init_bomb", "draw_bomb", "release_bomb",
+ "refresh_bomb", "change_bomb", NULL, &bomb_opts,
+ 100000, 10, 20, 1, 64, 1.0, "",
+ "Shows a bomb and will autologout after a time", 0, NULL};
+
+#endif
+
+#include <sys/signal.h>
+
+#if 0
+#define SIMPLE_COUNTDOWN       /* Display a simple integer countdown,     */
+#endif
+                             /*  rather than a "MIN:SEC" format.        */
+#define COLOUR_CHANGE          /* Display cycles through the colour wheel */
+                             /*  rather than staying red throughout.    */
+
+#ifdef USE_MB
+#define FULL_COUNT_FONT         "-adobe-courier-bold-r-*-*-34-*-*-*-*-*-iso8859-1"
+#define ICON_COUNT_FONT         "-misc-fixed-medium-r-normal-*-8-*-*-*-*-*-iso8859-1"
+#else
+#define FULL_COUNT_FONT         "-*-*-*-*-*-*-34-*-*-*-*-*-*-*"
+#define ICON_COUNT_FONT         "-*-*-*-*-*-*-8-*-*-*-*-*-*-*"
+#endif
+#define COUNTDOWN       600    /* No. seconds to lock for */
+#define NDIGITS         4      /* Number of digits in count */
+
+#define MAX_DELAY       1000000        /* Max delay between updates */
+#define NAP_TIME        5      /* Sleep between shutdown attempts */
+#define DELTA           10     /* Border around the digits */
+#define RIVET_RADIUS    6      /* Size of detonator 'rivets' */
+
+#ifdef USE_MB
+#define free_font(d) if (mode_font!=None){XFreeFontSet(d,mode_font); \
+mode_font = None;}
+#else
+#define free_font(d) if (mode_font!=None){XFreeFont(d,mode_font); \
+mode_font = None;}
+#endif
+
+extern XFontStruct *getFont(Display * display);
+
+typedef struct {
+       Bool        painted;
+       int         width, height;
+       int         x, y;
+       XPoint      loc;
+       int         delta;
+       int         color;
+       time_t      countdown;
+       int         startcountdown;
+       int         text_width;
+       int         text_ascent;
+       int         text_descent;
+       int         moveok;
+} bombstruct;
+
+static bombstruct *bombs = NULL;
+
+#ifdef USE_MB
+static XFontSet mode_font = None;
+#else
+static XFontStruct *mode_font = None;
+#endif
+
+static void
+rivet(ModeInfo * mi, int x, int y)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       if (MI_NPIXELS(mi) > 2) {
+               XDrawArc(display, MI_WINDOW(mi), gc, x, y,
+                     2 * RIVET_RADIUS, 2 * RIVET_RADIUS, 270 * 64, 90 * 64);
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               XDrawArc(display, MI_WINDOW(mi), gc, x, y,
+                     2 * RIVET_RADIUS, 2 * RIVET_RADIUS, 70 * 64, 130 * 64);
+       } else
+               XDrawArc(display, MI_WINDOW(mi), gc, x, y,
+                        2 * RIVET_RADIUS, 2 * RIVET_RADIUS, 0, 360 * 64);
+}
+
+static void
+detonator(ModeInfo * mi, int draw)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       bombstruct *bp = &bombs[MI_SCREEN(mi)];
+       int         b_width, b_height;
+
+       b_width = bp->width / 2;
+       b_height = bp->height / 3;
+       if (draw) {
+#ifdef SOLARIS2
+               /*
+                * if this is not done the rectangle is sometimes messed up on
+                * Solaris2 with 24 bit TrueColor (Ultra2)
+                */
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, MI_WINDOW(mi), gc,
+                              bp->loc.x, bp->loc.y, b_width, b_height);
+#endif
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(MI_DISPLAY(mi), MI_GC(mi),
+                                      MI_PIXEL(mi, bp->color));
+               else
+                       XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi));
+               /*XSetForeground(display, gc, allocPixel(display, MI_COLORMAP(mi),
+                  "grey", "white")); */
+               XFillRectangle(display, MI_WINDOW(mi), gc,
+                              bp->loc.x, bp->loc.y, b_width, b_height);
+
+               /*
+                *  If a full size screen (and colour),
+                *      'rivet' the box to it
+                */
+               if (bp->width > 160 && bp->height > 160) {
+                       rivet(mi, bp->loc.x + RIVET_RADIUS, bp->loc.y + RIVET_RADIUS);
+                       rivet(mi, bp->loc.x + RIVET_RADIUS,
+                             bp->loc.y + b_height - 3 * RIVET_RADIUS);
+                       rivet(mi, bp->loc.x + b_width - 3 * RIVET_RADIUS,
+                             bp->loc.y + RIVET_RADIUS);
+                       rivet(mi, bp->loc.x + b_width - 3 * RIVET_RADIUS,
+                             bp->loc.y + b_height - 3 * RIVET_RADIUS);
+               }
+       } else {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, MI_WINDOW(mi), gc,
+                              bp->loc.x, bp->loc.y, b_width, b_height);
+       }
+}
+
+void
+release_bomb(ModeInfo * mi)
+{
+       if (bombs != NULL) {
+               (void) free((void *) bombs);
+               bombs = NULL;
+       }
+       free_font(MI_DISPLAY(mi));
+}
+
+void
+init_bomb(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       bombstruct *bp;
+       char        number[NDIGITS + 2];
+#ifdef USE_MB
+       char **miss, *def;
+       int n_miss;
+       XRectangle ink, log;
+#endif
+
+       if (bombs == NULL) {
+               if ((bombs = (bombstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (bombstruct))) == NULL)
+                       return;
+       }
+       bp = &bombs[MI_SCREEN(mi)];
+
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+
+       if (mode_font != None) {
+#ifdef USE_MB
+               XFreeFontSet(display, mode_font);
+#else
+               XFreeFont(display, mode_font);
+#endif
+               mode_font = None;
+       }
+       /* Set up text font */
+       if (bp->width > 256 && bp->height > 256) {      /* Full screen */
+#ifdef USE_MB
+               mode_font = XCreateFontSet(display, FULL_COUNT_FONT, &miss, &n_miss, &def);
+#else
+               mode_font = XLoadQueryFont(display, FULL_COUNT_FONT);
+#endif
+               bp->delta = DELTA;
+       } else {                /* icon window */
+#ifdef USE_MB
+               mode_font = XCreateFontSet(display, ICON_COUNT_FONT, &miss, &n_miss, &def);
+#else
+               mode_font = XLoadQueryFont(display, ICON_COUNT_FONT);
+#endif
+               bp->delta = 2;
+       }
+       if (mode_font == None) {
+#ifdef USE_MB
+               mode_font = XCreateFontSet(display, "-*-medium-r-normal--14-*", &miss, &n_miss, &def);
+#else
+               mode_font = getFont(display);
+#endif
+       }
+       if (mode_font == None) {
+               release_bomb(mi);
+               return;
+       }
+#ifndef USE_MB
+       XSetFont(display, gc, mode_font->fid);
+#endif
+
+#ifdef SIMPLE_COUNTDOWN
+       (void) sprintf(number, "%0*d", NDIGITS, 0);
+#else
+#ifdef USE_MB
+       (void) sprintf(number, "%.*s:00", NDIGITS - 2, "0000000");
+#else
+       (void) sprintf(number, "%.*s:**", NDIGITS - 2, "*******");
+#endif
+#endif
+       /* if (mode_font == None) bp->text_width = 8; */
+#ifdef USE_MB
+       XmbTextExtents(mode_font, number, strlen(number), &ink, &log);
+       bp->text_width = ink.width;
+       bp->text_ascent = ink.height;
+       bp->text_descent = 0;
+#else
+       bp->text_width = XTextWidth(mode_font, number, NDIGITS + 1);
+       bp->text_ascent = mode_font->max_bounds.ascent;
+       bp->text_descent = mode_font->max_bounds.descent;
+#endif
+
+#ifndef STANDALONE
+       if (MI_DELAY(mi) > MAX_DELAY)
+               MI_DELAY(mi) = MAX_DELAY;       /* Time cannot move slowly */
+#endif /* STANDALONE */
+       if (MI_COUNT(mi) < 1)
+               bp->startcountdown = 1;         /* Do not want an instantaneous logout */
+       bp->startcountdown = MI_COUNT(mi);
+       bp->startcountdown *= 60;
+#if 0                          /* Stricter if uncommented but people do not have to run bomb */
+       if (bp->startcountdown > COUNTDOWN)
+               bp->startcountdown = COUNTDOWN;
+#endif
+       if (bp->countdown == 0) /* <--Stricter if uncommented */
+               bp->countdown = time((time_t *) NULL) + bp->startcountdown;
+       /* Detonator Primed */
+
+       MI_CLEARWINDOW(mi);
+       bp->painted = False;
+
+       /*
+        *  Draw the graphics
+        *      Very simple - detonator box with countdown
+        *
+        *  ToDo:  Improve the graphics
+        *      (e.g. stick of dynamite, with burning fuse?)
+        */
+       bp->loc.x = NRAND(bp->width / 2);
+       bp->loc.y = NRAND(bp->height * 3 / 5);
+       bp->x = bp->loc.x + bp->width / 4 - (bp->text_width / 2);
+       bp->y = bp->loc.y + bp->height / 5;     /* Central-ish */
+       if (MI_NPIXELS(mi) > 2)
+               bp->color = NRAND(MI_NPIXELS(mi));
+       detonator(mi, 1);
+       bp->moveok = 0;
+}
+
+       /*
+        *  Game Over
+        */
+static void
+explode(ModeInfo * mi)
+{
+       bombstruct *bp = &bombs[MI_SCREEN(mi)];
+       char        buff[NDIGITS + 2];
+       extern void logoutUser(Display * display);
+
+#ifdef SunCplusplus
+/* #include <signal.h> */
+       extern int  kill(pid_t, int);
+
+#else
+#if 0
+       extern int  kill(int, int);
+
+#endif
+#endif
+
+       /*
+        *  ToDo:
+        *      Improve the graphics - some sort of explosion?
+        *      (Will need to involve the main X event loop)
+        */
+#ifdef USE_MB
+#ifdef SIMPLE_COUNTDOWN
+       (void) sprintf(buff, "%.*s", NDIGITS, "000000000");
+#else
+       (void) sprintf(buff, "%.*s:00", NDIGITS - 2, "0000000");
+#endif
+#else
+#ifdef SIMPLE_COUNTDOWN
+       (void) sprintf(buff, "%.*s", NDIGITS, "*********");
+#else
+       (void) sprintf(buff, "%.*s:**", NDIGITS - 2, "*******");
+#endif
+#endif
+       XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_PIXEL(mi, 1));
+       (void) XDrawString(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                          bp->x, bp->y, buff, NDIGITS);
+
+       (void) fprintf(stderr, "BOOM!!!!\n");
+#ifndef DEBUG
+       if (MI_IS_INWINDOW(mi) || MI_IS_INROOT(mi) ||
+           MI_IS_NOLOCK(mi) || MI_IS_DEBUG(mi))
+               (void) kill((int) getpid(), SIGTERM);
+       else if ((int) getuid() == 0) {         /* Do not try to logout root! */
+               bp->countdown = 0;
+               init_bomb(mi);
+       } else
+               logoutUser(MI_DISPLAY(mi));
+#else
+       (void) kill(getpid(), SIGTERM);
+#endif
+}
+
+void
+draw_bomb(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       char        number[NDIGITS + 2];
+       unsigned long crayon;
+       int         countleft;
+       bombstruct *bp;
+
+       if (bombs == NULL)
+               return;
+       bp = &bombs[MI_SCREEN(mi)];
+       if (mode_font == None)
+               return;
+
+       countleft = (int) (bp->countdown - time((time_t *) NULL));
+       if (countleft <= 0)
+               explode(mi);    /* Bye, bye.... */
+       else {
+               bp->painted = True;
+#ifdef SIMPLE_COUNTDOWN
+               (void) sprintf(number, "%0*d", NDIGITS, countleft);
+#else
+               (void) sprintf(number, "%0*d:%02d", NDIGITS - 2,
+                              countleft / 60, countleft % 60);
+#endif
+
+               /* Blank out the previous number .... */
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, MI_WINDOW(mi), gc,
+                              bp->x - bp->delta,
+                              (bp->y - bp->text_ascent) - bp->delta,
+                              bp->text_width + (2 * bp->delta),
+                    (bp->text_ascent + bp->text_descent) + (2 * bp->delta));
+
+               /* ... and count down */
+               if (MI_NPIXELS(mi) <= 2)
+                       crayon = MI_WHITE_PIXEL(mi);
+               else
+#ifdef COLOUR_CHANGE           /* Blue to red */
+                       crayon = MI_PIXEL(mi, countleft * MI_NPIXELS(mi) / bp->startcountdown);
+#else
+                       crayon = MI_PIXEL(mi, 1);
+#endif
+               if (!(countleft % 60)) {
+                       if (bp->moveok) {
+                               detonator(mi, 0);
+                               bp->loc.x = NRAND(bp->width / 2);
+                               bp->loc.y = NRAND(bp->height * 3 / 5);
+                               bp->x = bp->loc.x + bp->width / 4 - (bp->text_width / 2);
+                               bp->y = bp->loc.y + bp->height / 5;     /* Central-ish */
+                               if (MI_NPIXELS(mi) > 2)
+                                       bp->color = NRAND(MI_NPIXELS(mi));
+                               detonator(mi, 1);
+                               bp->moveok = 0;
+                       }
+               } else {
+                       bp->moveok = 1;
+               }
+               XSetForeground(display, gc, crayon);
+#ifndef USE_MB
+               (void) XDrawString(display, MI_WINDOW(mi), gc, bp->x, bp->y,
+                                  number, strlen(number));
+#else
+               (void) XmbDrawString(display, MI_WINDOW(mi), mode_font, gc, bp->x, bp->y,
+                                                        number, strlen(number));
+#endif
+       }
+}
+
+void
+refresh_bomb(ModeInfo * mi)
+{
+       bombstruct *bp;
+
+       if (bombs == NULL)
+               return;
+       bp = &bombs[MI_SCREEN(mi)];
+       if (mode_font == None)
+               return;
+
+       if (bp->painted) {
+               MI_CLEARWINDOW(mi);
+               detonator(mi, 1);
+       }
+}
+
+void
+change_bomb(ModeInfo * mi)
+{
+       bombstruct *bp;
+
+       if (bombs == NULL)
+               return;
+       bp = &bombs[MI_SCREEN(mi)];
+       if (mode_font == None)
+               return;
+
+       detonator(mi, 0);
+       bp->painted = False;
+       bp->loc.x = NRAND(bp->width / 2);
+       bp->loc.y = NRAND(bp->height * 3 / 5);
+       bp->x = bp->loc.x + bp->width / 4 - (bp->text_width / 2);
+       bp->y = bp->loc.y + bp->height / 5;     /* Central-ish */
+       if (MI_NPIXELS(mi) > 2)
+               bp->color = NRAND(MI_NPIXELS(mi));
+       detonator(mi, 1);
+       bp->moveok = 0;
+}
+
+#endif  /* MODE_bomb */
diff --git a/modes/bouboule.c b/modes/bouboule.c
new file mode 100644 (file)
index 0000000..864f6d4
--- /dev/null
@@ -0,0 +1,910 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* bouboule --- glob of spheres twisting and changing size */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)bouboule.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright 1996 by Jeremie PETIT <petit@eurecom.fr>, <jpetit@essi.fr>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 15-May-1997: jwz@jwz.org: turned into a standalone program.
+ * 04-Sep-1996: Added 3d support Henrik Theiling <theiling@coli-uni-sb.de>
+ * 20-Feb-1996: Added tests so that already malloced objects are not
+ *              malloced twice, thanks to the report from
+ *              <mccomb@interport.net>
+ * 01-Feb-1996: Patched by Jouk Jansen <joukj@hrem.stm.tudelft.nl> for VMS
+ *              Patched by <bagleyd@tux.org> for TrueColor displays
+ * 30-Jan-1996: Wrote all that I wanted to.
+ *
+ * Sort of starfield with a 3D engine.  For a real starfield, I only scale
+ * the sort of sphere you see to the whole sky and clip the stars to the
+ * camera screen.
+ *
+ * Use: batchcount is the number of stars.
+ *      cycles is the maximum size for a star
+ *
+ * DONE: Build up a XArc list and Draw everything once with XFillArcs
+ *       That idea came from looking at swarm code.
+ * DONE: Add an old arcs list for erasing.
+ * DONE: Make center of starfield SinVariable.
+ * DONE: Add some random in the sinvary() function.
+ * DONE: check time for erasing the stars with the two methods and use the
+ *       better one. Note that sometimes the time difference between
+ *       beginning of erasing and its end is negative! I check this, and
+ *       do not use this result when it occurs. If all values are negative,
+ *       the erasing will continue being done in the currently tested mode.
+ * DONE: Allow stars size customization.
+ * DONE: Make sizey be no less than half sizex or no bigger than twice sizex.
+ *
+ * IDEA: A simple check can be performed to know which stars are "behind"
+ *       and which are "in front". So is possible to very simply change
+ *       the drawing mode for these two sorts of stars. BUT: this would lead
+ *       to a rewrite of the XArc list code because drawing should be done
+ *       in two steps: "behind" stars then "in front" stars. Also, what could
+ *       be the difference between the rendering of these two types of stars?
+ * IDEA: Calculate the distance of each star to the "viewer" and render the
+ *       star accordingly to this distance. Same remarks as for previous
+ *       ideas can be pointed out. This would even lead to reget the old stars
+ *       drawing code, that has been replaced by the XFillArcs. On another
+ *       hand, this would allow particular stars (own color, shape...), as
+ *       far as they would be individually drawn. One should be careful to
+ *       draw them according to their distance, that is not drawing a far
+ *       star after a close one.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Bouboule"
+#define HACK_INIT init_bouboule
+#define HACK_DRAW draw_bouboule
+#define bouboule_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 100 \n" \
+ "*size: 15 \n" \
+ "*ncolors: 64 \n" \
+ "*use3d: False \n" \
+ "*delta3d: 1.5 \n" \
+ "*right3d: red \n" \
+ "*left3d: blue \n" \
+ "*both3d: magenta \n" \
+ "*none3d: black \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_bouboule
+
+ModeSpecOpt bouboule_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   bouboule_description =
+{"bouboule", "init_bouboule", "draw_bouboule", "release_bouboule",
+ "refresh_bouboule", "init_bouboule", NULL, &bouboule_opts,
+ 10000, 100, 1, 15, 64, 1.0, "",
+ "Shows Mimi's bouboule of moving stars", 0, NULL};
+
+#endif
+
+#define USEOLDXARCS  1         /* If 1, we use old xarcs list for erasing.
+                                  * else we just roughly erase the window.
+                                  * This mainly depends on the number of stars,
+                                  * because when they are many, it is faster to
+                                  * erase the whole window than to erase each star
+                                */
+
+#if HAVE_GETTIMEOFDAY
+#define ADAPT_ERASE  1         /* If 1, then we try ADAPT_CHECKS black XFillArcs,
+                                  * and after, ADAPT_CHECKS XFillRectangle.
+                                  * We check which method seems better, knowing that
+                                  * XFillArcs is generally visually better. So we
+                                  * consider that XFillArcs is still better if its time
+                                  * is about XFillRectangle * ADAPT_ARC_PREFERED
+                                  * We need gettimeofday
+                                  * for this... Does it exist on other systems ? Do we
+                                  * have to use another function for others ?
+                                  * This value overrides USEOLDXARCS.
+                                */
+
+#ifdef USE_XVMSUTILS
+#if 0
+#include "../xvmsutils/unix_time.h"
+#else
+#include <X11/unix_time.h>
+#endif
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#endif
+#define ADAPT_CHECKS 50
+#define ADAPT_ARC_PREFERED 150 /* Maybe the value that is the most important
+                                  * for adapting to a system */
+#endif
+
+#define dtor(x)    (((x) * M_PI) / 180.0)      /* Degrees to radians */
+
+#define MINSTARS      1
+#define MINSIZE       1
+#define COLOR_CHANGES 50       /* How often we change colors (1 = always)
+                                  * This value should be tuned accordingly to
+                                  * the number of stars */
+#define MAX_SIZEX_SIZEY 2.     /* This controls whether the sphere can be very
+                                  * very large and have a small height (or the
+                                  * opposite) or no. */
+
+#define THETACANRAND  80       /* percentage of changes for the speed of
+                                  * change of the 3 theta values */
+#define SIZECANRAND   80       /* percentage of changes for the speed of
+                                  * change of the sizex and sizey values */
+#define POSCANRAND    80       /* percentage of changes for the speed of
+                                  * change of the x and y values */
+/*-
+ * Note that these XXXCANRAND values can be 0, that is no rand acceleration
+ * variation.
+ */
+
+#define VARRANDALPHA (NRAND((int) (M_PI * 1000.0))/1000.0)
+#define VARRANDSTEP  (M_PI/(NRAND(100)+100.0))
+#define VARRANDMIN   (-70.0)
+#define VARRANDMAX   70.0
+
+#define MINZVAL   100          /* stars can come this close */
+#define SCREENZ  2000          /* this is where the screen is */
+#define MAXZVAL 10000          /* stars can go this far away */
+
+#define GETZDIFF(z) ((MI_DELTA3D(mi))*20.0*(1.0-(SCREENZ)/(z+1000)))
+#define MAXDIFF  MAX(-GETZDIFF(MINZVAL),GETZDIFF(MAXZVAL))
+
+/*-
+ * These values are the variation parameters of the acceleration variation
+ * of the SinVariables that are randomized.
+ */
+
+/******************************/
+typedef struct SinVariableStruct
+/******************************/
+{
+       double      alpha;      /*
+                                * Alpha is the current state of the sinvariable
+                                * alpha should be initialized to a value between
+                                * 0.0 and 2 * M_PI
+                                */
+       double      step;       /*
+                                * Speed of evolution of alpha. It should be a reasonable
+                                * fraction of 2 * M_PI. This value directly influence
+                                * the variable speed of variation.
+                                */
+       double      minimum;    /* Minimum value for the variable */
+       double      maximum;    /* Maximum value for the variable */
+       double      value;      /* Current value */
+       int         mayrand;    /* Flag for knowing whether some randomization can be
+                                * applied to the variable */
+       struct SinVariableStruct *varrand;      /* Evolving Variable: the variation of
+                                                  * alpha */
+} SinVariable;
+
+/***********************/
+typedef struct StarStruct
+/***********************/
+{
+       double      x, y, z;    /* Position of the star */
+       short       size;       /* Try to guess */
+} Star;
+
+/****************************/
+typedef struct StarFieldStruct
+/****************************/
+{
+       short       width, height;      /* width and height of the starfield window */
+       short       max_star_size;      /* Maximum radius for stars. stars radius will
+                                        * vary from 1 to MAX_STAR_SIZE */
+       SinVariable x;          /* Evolving variables:               */
+       SinVariable y;          /* Center of the field on the screen */
+       SinVariable z;
+       SinVariable sizex;      /* Evolving variable: half width  of the field */
+       SinVariable sizey;      /* Evolving variable: half height of the field */
+       SinVariable thetax;     /* Evolving Variables:              */
+       SinVariable thetay;     /* rotation angles of the starfield */
+       SinVariable thetaz;     /* around x, y and z local axis     */
+       Star       *star;       /* List of stars */
+       XArc       *xarc;       /* Current List of arcs */
+       XArc       *xarcleft;   /* additional list for the left arcs */
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+       XArc       *oldxarc;    /* Old list of arcs */
+       XArc       *oldxarcleft;
+#endif
+       unsigned long color;    /* Current color of the starfield */
+       int         colorp;     /* Pointer to color of the starfield */
+       int         NbStars;    /* Number of stars */
+       short       colorchange;        /* Counter for the color change */
+#if (ADAPT_ERASE == 1)
+       short       hasbeenchecked;
+       long        rect_time;
+       long        xarc_time;
+#endif
+} StarField;
+
+static StarField *starfield = NULL;
+
+/*********/
+static void
+sinvary(SinVariable * v)
+/*********/
+
+{
+       v->value = v->minimum +
+               (v->maximum - v->minimum) * (sin(v->alpha) + 1.0) / 2.0;
+
+       if (v->mayrand == 0)
+               v->alpha += v->step;
+       else {
+               int         vaval = NRAND(100);
+
+               if (vaval <= v->mayrand)
+                       sinvary(v->varrand);
+               v->alpha += (100.0 + (v->varrand->value)) * v->step / 100.0;
+       }
+
+       if (v->alpha > 2 * M_PI)
+               v->alpha -= 2 * M_PI;
+}
+
+/*************************************************/
+static Bool
+sininit(SinVariable * v,
+       double alpha, double step, double minimum, double maximum,
+       short int mayrand)
+{
+       v->alpha = alpha;
+       v->step = step;
+       v->minimum = minimum;
+       v->maximum = maximum;
+       v->mayrand = mayrand;
+       if (mayrand != 0) {
+               if (v->varrand == NULL) {
+                       if ((v->varrand = (SinVariable *) calloc(1,
+                                       sizeof (SinVariable))) == NULL) {
+                               return False;
+                       }
+               }
+               if (!sininit(v->varrand,
+                               VARRANDALPHA,
+                               VARRANDSTEP,
+                               VARRANDMIN,
+                               VARRANDMAX,
+                               0))
+                       return False;
+               sinvary(v->varrand);
+       }
+       /* We calculate the values at least once for initialization */
+       sinvary(v);
+       return True;
+}
+
+static void
+sinfree(SinVariable * point)
+{
+       SinVariable *temp, *next;
+
+       next = point->varrand;
+       while (next) {
+               temp = next;
+               next = temp->varrand;
+               (void) free((void *) temp);
+       }
+}
+
+static void
+free_stars(StarField *sp)
+{
+       if (sp->star != NULL) {
+               (void) free((void *) sp->star);
+               sp->star = NULL;
+       }
+       if (sp->xarc != NULL) {
+               (void) free((void *) sp->xarc);
+               sp->xarc = NULL;
+       }
+       if (sp->xarcleft != NULL) {
+               (void) free((void *) sp->xarcleft);
+               sp->xarcleft = NULL;
+       }
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+       if (sp->oldxarc != NULL) {
+               (void) free((void *) sp->oldxarc);
+               sp->oldxarc = NULL;
+       }
+       if (sp->oldxarcleft != NULL) {
+               (void) free((void *) sp->oldxarcleft);
+               sp->oldxarcleft = NULL;
+       }
+#endif
+}
+
+static void
+free_bouboule(StarField *sp)
+{
+       free_stars(sp);
+       sinfree(&(sp->x));
+       sinfree(&(sp->y));
+       sinfree(&(sp->z));
+       sinfree(&(sp->sizex));
+       sinfree(&(sp->sizey));
+       sinfree(&(sp->thetax));
+       sinfree(&(sp->thetay));
+       sinfree(&(sp->thetaz));
+}
+
+/***************/
+void
+init_bouboule(ModeInfo * mi)
+/***************/
+
+/*-
+ *  The stars init part was first inspirated from the net3d game starfield
+ * code.  But net3d starfield is not really 3d starfield, and I needed real 3d,
+ * so only remains the net3d starfield initialization main idea, that is
+ * the stars distribution on a sphere (theta and omega computing)
+ */
+{
+       StarField  *sp;
+       int         size = MI_SIZE(mi);
+       int         i;
+       double      theta, omega;
+
+       if (starfield == NULL) {
+               if ((starfield = (StarField *) calloc(MI_NUM_SCREENS(mi),
+                                               sizeof (StarField))) == NULL)
+                       return;
+       }
+       sp = &starfield[MI_SCREEN(mi)];
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+
+       /* use the right `black' pixel values: */
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+
+       if (size < -MINSIZE)
+               sp->max_star_size = NRAND(-size - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE)
+               sp->max_star_size = MINSIZE;
+       else
+               sp->max_star_size = size;
+
+       sp->NbStars = MI_COUNT(mi);
+       if (sp->NbStars < -MINSTARS) {
+               free_stars(sp);
+               sp->NbStars = NRAND(-sp->NbStars - MINSTARS + 1) + MINSTARS;
+       } else if (sp->NbStars < MINSTARS)
+               sp->NbStars = MINSTARS;
+
+       /* We get memory for lists of objects */
+       if (sp->star == NULL) {
+               if ((sp->star = (Star *) malloc(sp->NbStars *
+                               sizeof (Star))) == NULL) {
+                       free_bouboule(sp);
+                       return;
+               }
+       }
+       if (sp->xarc == NULL) {
+               if ((sp->xarc = (XArc *) malloc(sp->NbStars *
+                               sizeof (XArc))) == NULL) {
+                       free_bouboule(sp);
+                       return;
+               }
+       }
+       if (MI_IS_USE3D(mi) && sp->xarcleft == NULL) {
+               if ((sp->xarcleft = (XArc *) malloc(sp->NbStars *
+                               sizeof (XArc))) == NULL) {
+                       free_bouboule(sp);
+                       return;
+               }
+       }
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+       if (sp->oldxarc == NULL) {
+               if ((sp->oldxarc = (XArc *) malloc(sp->NbStars *
+                               sizeof (XArc))) == NULL) {
+                       free_bouboule(sp);
+                       return;
+               }
+       }
+       if (MI_IS_USE3D(mi) && sp->oldxarcleft == NULL) {
+               if ((sp->oldxarcleft = (XArc *) malloc(sp->NbStars *
+                               sizeof (XArc))) == NULL) {
+                       free_bouboule(sp);
+                       return;
+               }
+       }
+#endif
+
+       {
+               /* We initialize evolving variables */
+               if (!sininit(&sp->x,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(100) + 100.0),
+                       ((double) sp->width) / 4.0,
+                       3.0 * ((double) sp->width) / 4.0,
+                       POSCANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+               if (!sininit(&sp->y,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(100) + 100.0),
+                       ((double) sp->height) / 4.0,
+                       3.0 * ((double) sp->height) / 4.0,
+                       POSCANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+
+               /* for z, we have to ensure that the bouboule does not get behind */
+               /* the eyes of the viewer.  His/Her eyes are at 0.  Because the */
+               /* bouboule uses the x-radius for the z-radius, too, we have to */
+               /* use the x-values. */
+               if (!sininit(&sp->z,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(100) + 100.0),
+                       ((double) sp->width / 2.0 + MINZVAL),
+                       ((double) sp->width / 2.0 + MAXZVAL),
+                       POSCANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+
+
+               if (!sininit(&sp->sizex,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(100) + 100.0),
+                       MIN(((double) sp->width) - sp->x.value,
+                           sp->x.value) / 5.0,
+                       MIN(((double) sp->width) - sp->x.value,
+                           sp->x.value),
+                       SIZECANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+
+               if (!sininit(&sp->sizey,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(100) + 100.0),
+                       MAX(sp->sizex.value / MAX_SIZEX_SIZEY,
+                           sp->sizey.maximum / 5.0),
+                       MIN(sp->sizex.value * MAX_SIZEX_SIZEY,
+                           MIN(((double) sp->height) -
+                               sp->y.value,
+                               sp->y.value)),
+                       SIZECANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+
+               if (!sininit(&sp->thetax,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(200) + 200.0),
+                       -M_PI, M_PI,
+                       THETACANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+               if (!sininit(&sp->thetay,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(200) + 200.0),
+                       -M_PI, M_PI,
+                       THETACANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+               if (!sininit(&sp->thetaz,
+                       NRAND(3142) / 1000.0, M_PI / (NRAND(400) + 400.0),
+                       -M_PI, M_PI,
+                       THETACANRAND)) {
+                   free_bouboule(sp);
+                   return;
+               }
+       }
+       for (i = 0; i < sp->NbStars; i++) {
+               Star       *star;
+               XArc       *arc, *arcleft = NULL;
+
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+               XArc       *oarc, *oarcleft = NULL;
+
+#endif
+
+               star = &(sp->star[i]);
+               arc = &(sp->xarc[i]);
+               if (MI_IS_USE3D(mi))
+                       arcleft = &(sp->xarcleft[i]);
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+               oarc = &(sp->oldxarc[i]);
+               if (MI_IS_USE3D(mi))
+                       oarcleft = &(sp->oldxarcleft[i]);
+#endif
+               /* Elevation and bearing of the star */
+               theta = dtor((NRAND(1800)) / 10.0 - 90.0);
+               omega = dtor((NRAND(3600)) / 10.0 - 180.0);
+
+               /* Stars coordinates in a 3D space */
+               star->x = cos(theta) * sin(omega);
+               star->y = sin(omega) * sin(theta);
+               star->z = cos(omega);
+
+               /* We set the stars size */
+               star->size = NRAND(2 * sp->max_star_size);
+               if (star->size < sp->max_star_size)
+                       star->size = 0;
+               else
+                       star->size -= sp->max_star_size;
+
+               /* We set default values for the XArc lists elements, but offscreen */
+               arc->x = MI_WIDTH(mi);
+               arc->y = MI_HEIGHT(mi);
+               if (MI_IS_USE3D(mi)) {
+                       arcleft->x = MI_WIDTH(mi);
+                       arcleft->y = MI_HEIGHT(mi);
+               }
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+               oarc->x = MI_WIDTH(mi);
+               oarc->y = MI_HEIGHT(mi);
+               if (MI_IS_USE3D(mi)) {
+                       oarcleft->x = MI_WIDTH(mi);
+                       oarcleft->y = MI_HEIGHT(mi);
+               }
+#endif
+               arc->width = 2 + star->size;
+               arc->height = 2 + star->size;
+               if (MI_IS_USE3D(mi)) {
+                       arcleft->width = 2 + star->size;
+                       arcleft->height = 2 + star->size;
+               }
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+               oarc->width = 2 + star->size;
+               oarc->height = 2 + star->size;
+               if (MI_IS_USE3D(mi)) {
+                       oarcleft->width = 2 + star->size;
+                       oarcleft->height = 2 + star->size;
+               }
+#endif
+
+               arc->angle1 = 0;
+               arc->angle2 = 360 * 64;
+               if (MI_IS_USE3D(mi)) {
+                       arcleft->angle1 = 0;
+                       arcleft->angle2 = 360 * 64;
+               }
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+               oarc->angle1 = 0;
+               oarc->angle2 = 360 * 64;        /* ie. we draw whole disks:
+                                                * from 0 to 360 degrees */
+               if (MI_IS_USE3D(mi)) {
+                       oarcleft->angle1 = 0;
+                       oarcleft->angle2 = 360 * 64;
+               }
+#endif
+       }
+
+       if (MI_NPIXELS(mi) > 2)
+               sp->colorp = NRAND(MI_NPIXELS(mi));
+       /* We set up the starfield color */
+       if (!MI_IS_USE3D(mi) && MI_NPIXELS(mi) > 2)
+               sp->color = MI_PIXEL(mi, sp->colorp);
+       else
+               sp->color = MI_WHITE_PIXEL(mi);
+
+#if (ADAPT_ERASE == 1)
+       /* We initialize the adaptation code for screen erasing */
+       sp->hasbeenchecked = ADAPT_CHECKS * 2;
+       sp->rect_time = 0;
+       sp->xarc_time = 0;
+#endif
+}
+
+/****************/
+void
+draw_bouboule(ModeInfo * mi)
+/****************/
+
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         i, diff = 0;
+       double      CX, CY, CZ, SX, SY, SZ;
+       Star       *star;
+       XArc       *arc, *arcleft = NULL;
+       StarField  *sp;
+
+#if (ADAPT_ERASE == 1)
+       struct timeval tv1;
+       struct timeval tv2;
+
+#endif
+
+#if ((USEOLDXARCS == 0) || (ADAPT_ERASE == 1))
+       short       x_1, y_1, x_2, y_2;
+
+       /* bounding rectangle around the old starfield,
+        * for erasing with the smallest rectangle
+        * instead of filling the whole screen */
+       int         maxdiff = 0;        /* maximal distance between left and right */
+
+       /* star in 3d mode, otherwise 0 */
+#endif
+
+       if (starfield == NULL)
+               return;
+       sp = &starfield[MI_SCREEN(mi)];
+       if (sp->star == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+#if ((USEOLDXARCS == 0) || (ADAPT_ERASE == 1))
+       if (MI_IS_USE3D(mi)) {
+               maxdiff = (int) MAXDIFF;
+       }
+       x_1 = (int) sp->x.value - (int) sp->sizex.value -
+               sp->max_star_size - maxdiff;
+       y_1 = (int) sp->y.value - (int) sp->sizey.value -
+               sp->max_star_size;
+       x_2 = 2 * ((int) sp->sizex.value + sp->max_star_size + maxdiff);
+       y_2 = 2 * ((int) sp->sizey.value + sp->max_star_size);
+#endif
+       /* We make variables vary. */
+       sinvary(&sp->thetax);
+       sinvary(&sp->thetay);
+       sinvary(&sp->thetaz);
+
+       sinvary(&sp->x);
+       sinvary(&sp->y);
+       if (MI_IS_USE3D(mi))
+               sinvary(&sp->z);
+
+       /* A little trick to prevent the bouboule from being
+        * bigger than the screen */
+       sp->sizex.maximum =
+               MIN(((double) sp->width) - sp->x.value,
+                   sp->x.value);
+       sp->sizex.minimum = sp->sizex.maximum / 3.0;
+
+       /* Another trick to make the ball not too flat */
+       sp->sizey.minimum =
+               MAX(sp->sizex.value / MAX_SIZEX_SIZEY,
+                   sp->sizey.maximum / 3.0);
+       sp->sizey.maximum =
+               MIN(sp->sizex.value * MAX_SIZEX_SIZEY,
+                   MIN(((double) sp->height) - sp->y.value,
+                       sp->y.value));
+
+       sinvary(&sp->sizex);
+       sinvary(&sp->sizey);
+
+       /*
+        * We calculate the rotation matrix values. We just make the
+        * rotation on the fly, without using a matrix.
+        * Star positions are recorded as unit vectors pointing in various
+        * directions. We just make them all rotate.
+        */
+       CX = cos(sp->thetax.value);
+       SX = sin(sp->thetax.value);
+       CY = cos(sp->thetay.value);
+       SY = sin(sp->thetay.value);
+       CZ = cos(sp->thetaz.value);
+       SZ = sin(sp->thetaz.value);
+
+       for (i = 0; i < sp->NbStars; i++) {
+               star = &(sp->star[i]);
+               arc = &(sp->xarc[i]);
+               if (MI_IS_USE3D(mi)) {
+                       arcleft = &(sp->xarcleft[i]);
+                       /* to help the eyes, the starfield is always as wide as */
+                       /* deep, so .sizex.value can be used. */
+                       diff = (int) GETZDIFF(sp->sizex.value *
+                                     ((SY * CX) * star->x + (SX) * star->y +
+                                      (CX * CY) * star->z) + sp->z.value);
+               }
+               arc->x = (short) ((sp->sizex.value *
+                                  ((CY * CZ - SX * SY * SZ) * star->x +
+                                   (-CX * SZ) * star->y +
+                                   (SY * CZ + SZ * SX * CY) * star->z) +
+                                  sp->x.value));
+               arc->y = (short) ((sp->sizey.value *
+                                  ((CY * SZ + SX * SY * CZ) * star->x +
+                                   (CX * CZ) * star->y +
+                                   (SY * SZ - SX * CY * CZ) * star->z) +
+                                  sp->y.value));
+
+               if (MI_IS_USE3D(mi)) {
+                       arcleft->x = (short) ((sp->sizex.value *
+                                       ((CY * CZ - SX * SY * SZ) * star->x +
+                                        (-CX * SZ) * star->y +
+                                        (SY * CZ + SZ * SX * CY) * star->z) +
+                                              sp->x.value));
+                       arcleft->y = (short) ((sp->sizey.value *
+                                       ((CY * SZ + SX * SY * CZ) * star->x +
+                                        (CX * CZ) * star->y +
+                                        (SY * SZ - SX * CY * CZ) * star->z) +
+                                              sp->y.value));
+                       arc->x += diff;
+                       arcleft->x -= diff;
+               }
+               if (star->size != 0) {
+                       arc->x -= star->size;
+                       arc->y -= star->size;
+                       if (MI_IS_USE3D(mi)) {
+                               arcleft->x -= star->size;
+                               arcleft->y -= star->size;
+                       }
+               }
+       }
+
+       /* First, we erase the previous starfield */
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi))
+               XSetForeground(display, gc, MI_NONE_COLOR(mi));
+       else
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+#if (ADAPT_ERASE == 1)
+       if (sp->hasbeenchecked == 0) {
+               /* We just calculate which method is the faster and eventually free
+                * the oldxarc list */
+               if (sp->xarc_time >
+                   ADAPT_ARC_PREFERED * sp->rect_time) {
+                       sp->hasbeenchecked = -2;        /* XFillRectangle mode */
+                       (void) free((void *) sp->oldxarc);
+                       sp->oldxarc = NULL;
+                       if (MI_IS_USE3D(mi)) {
+                               (void) free((void *) sp->oldxarcleft);
+                               sp->oldxarcleft = NULL;
+                       }
+               } else {
+                       sp->hasbeenchecked = -1;        /* XFillArcs mode */
+               }
+       }
+       if (sp->hasbeenchecked == -2) {
+               /* Erasing is done with XFillRectangle */
+               XFillRectangle(display, window, gc,
+                              x_1, y_1, x_2, y_2);
+       } else if (sp->hasbeenchecked == -1) {
+               /* Erasing is done with XFillArcs */
+               XFillArcs(display, window, gc,
+                         sp->oldxarc, sp->NbStars);
+               if (MI_IS_USE3D(mi))
+                       XFillArcs(display, window, gc,
+                                 sp->oldxarcleft, sp->NbStars);
+       } else {
+               long        usec;
+
+               if (sp->hasbeenchecked > ADAPT_CHECKS) {
+                       GETTIMEOFDAY(&tv1);
+                       XFillRectangle(display, window, gc,
+                                      x_1, y_1, x_2, y_2);
+                       GETTIMEOFDAY(&tv2);
+                       usec = (tv2.tv_sec - tv1.tv_sec) * 1000000;
+                       if (usec + tv2.tv_usec - tv1.tv_usec > 0) {
+                               sp->rect_time += usec + tv2.tv_usec - tv1.tv_usec;
+                               sp->hasbeenchecked--;
+                       }
+               } else {
+                       GETTIMEOFDAY(&tv1);
+                       XFillArcs(display, window, gc,
+                                 sp->oldxarc, sp->NbStars);
+                       if (MI_IS_USE3D(mi))
+                               XFillArcs(display, window, gc,
+                                         sp->oldxarcleft, sp->NbStars);
+                       GETTIMEOFDAY(&tv2);
+                       usec = (tv2.tv_sec - tv1.tv_sec) * 1000000;
+                       if (usec + tv2.tv_usec - tv1.tv_usec > 0) {
+                               sp->xarc_time += usec + tv2.tv_usec - tv1.tv_usec;
+                               sp->hasbeenchecked--;
+                       }
+               }
+       }
+#else
+#if (USEOLDXARCS == 1)
+       XFillArcs(display, window, gc,
+                 sp->oldxarc, sp->NbStars);
+       if (MI_IS_USE3D(mi))
+               XFillArcs(display, window, gc,
+                         sp->oldxarcleft, sp->NbStars);
+#else
+       XFillRectangle(display, window, gc,
+                      x_1, y_1, x_2, y_2);
+#endif
+#endif
+
+       /* Then we draw the new one */
+       if (MI_IS_USE3D(mi)) {
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXor);
+               XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+               XFillArcs(display, window, gc, sp->xarc, sp->NbStars);
+               XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               XFillArcs(display, window, gc, sp->xarcleft, sp->NbStars);
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXcopy);
+       } else {
+               XSetForeground(display, gc, sp->color);
+               XFillArcs(display, window, gc, sp->xarc, sp->NbStars);
+       }
+
+#if ((USEOLDXARCS == 1) || (ADAPT_ERASE == 1))
+#if (ADAPT_ERASE == 1)
+       if (sp->hasbeenchecked >= -1) {
+               arc = sp->xarc;
+               sp->xarc = sp->oldxarc;
+               sp->oldxarc = arc;
+               if (MI_IS_USE3D(mi)) {
+                       arcleft = sp->xarcleft;
+                       sp->xarcleft = sp->oldxarcleft;
+                       sp->oldxarcleft = arcleft;
+               }
+       }
+#else
+       arc = sp->xarc;
+       sp->xarc = sp->oldxarc;
+       sp->oldxarc = arc;
+       if (MI_IS_USE3D(mi)) {
+               arcleft = sp->xarcleft;
+               sp->xarcleft = sp->oldxarcleft;
+               sp->oldxarcleft = arcleft;
+       }
+#endif
+#endif
+
+       /* We set up the color for the next drawing */
+       if (!MI_IS_USE3D(mi) && MI_NPIXELS(mi) > 2 &&
+           (++sp->colorchange >= COLOR_CHANGES)) {
+               sp->colorchange = 0;
+               if (++sp->colorp >= MI_NPIXELS(mi))
+                       sp->colorp = 0;
+               sp->color = MI_PIXEL(mi, sp->colorp);
+       }
+}
+
+void
+release_bouboule(ModeInfo * mi)
+{
+       if (starfield != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_bouboule(&starfield[screen]);
+               (void) free((void *) starfield);
+               starfield = NULL;
+       }
+}
+
+void
+refresh_bouboule(ModeInfo * mi)
+{
+       /* use the right `black' pixel values: */
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+#endif /* MODE_bouboule */
diff --git a/modes/bounce.c b/modes/bounce.c
new file mode 100644 (file)
index 0000000..d879c8e
--- /dev/null
@@ -0,0 +1,770 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* bounce --- bouncing footballs */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)bounce.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1988 by Sun Microsystems
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 01-Apr-1997: Curtis Larsen <larsen@rtp3.med.utah.edu>
+ *              The modification is only for the inroot option.  It causes
+ *              the balls to see  children of the root window and bounce
+ *              off of the sides of them.  New windows are only recognized
+ *              after every init_bounce, because fvwm did not like xlock
+ *              setting SubstructureNotifyMask on root.  I did not fix the
+ *              initial placement of balls yet, so they can start out
+ *              underneath windows.
+ * 18-Sep-1995: tinkered with it to look like bat.c .
+ * 15-Jul-1994: cleaned up in time for the final match.
+ * 04-Apr-1994: spinning multiple ball version
+ *              (I got a lot of help from with the physics of ball to ball
+ *              collision looking at the source of xpool from Ismail ARIT
+ *              <iarit@tara.mines.colorado.edu>
+ * 22-Mar-1994: got rid of flashing problem by only erasing parts of the
+ *              image that will not be covered up by the next image.
+ * 02-Sep-1993: xlock version David Bagley <bagleyd@tux.org>
+ * 1986: Sun Microsystems
+ */
+
+/*-
+ * original copyright
+ * **************************************************************************
+ * Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, 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 Sun or MIT not be used in advertising
+ * or publicity pertaining to distribution of the software without specific
+ * prior written permission. Sun and M.I.T. make no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without any express or implied warranty.
+ *
+ * SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * IN NO EVENT SHALL SUN 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.
+ * ***************************************************************************
+ */
+
+/*-
+ * Open for improvement:
+ *  include different balls (size and mass)
+ *    how about be real crazy and put in an American/Australian football?
+ *  should only have 1 bitmap for ball, the others should be generated
+ *    as 90 degree rotations.
+ *  multiscreen interaction
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Bounce"
+#define HACK_INIT init_bounce
+#define HACK_DRAW draw_bounce
+#define bounce_opts xlockmore_opts
+#define DEFAULTS "*delay: 5000 \n" \
+ "*count: -10 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "vis.h"
+#include "color.h"
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_bounce
+
+ModeSpecOpt bounce_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   bounce_description =
+{"bounce", "init_bounce", "draw_bounce", "release_bounce",
+ "refresh_bounce", "init_bounce", NULL, &bounce_opts,
+ 5000, -10, 1, 0, 64, 1.0, "",
+ "Shows bouncing footballs", 0, NULL};
+
+#endif
+
+#include "bitmaps/bounce-0.xbm"
+#include "bitmaps/bounce-1.xbm"
+#include "bitmaps/bounce-2.xbm"
+#include "bitmaps/bounce-3.xbm"
+#include "bitmaps/bounce-mask.xbm"
+
+#define BALLBITS(n,w,h)\
+  if ((bp->pixmaps[bp->init_orients]=\
+  XCreateBitmapFromData(display,window,(char *)n,w,h))==None){\
+  free_bounce(display,bp); return False;} else {bp->init_orients++;}
+
+/* aliases for vars defined in the bitmap file */
+#define BOUNCE_WIDTH     image_width
+#define BOUNCE_HEIGHT    image_height
+#define BOUNCE_BITS      image_bits
+
+#include "bounce.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define BOUNCE_NAME      image_name
+#include "bounce.xpm"
+#define DEFAULT_XPM 1
+#endif
+
+#define MAX_STRENGTH 24
+#define FRICTION 24
+#define PENETRATION 0.3
+#define SLIPAGE 4
+#define TIME 32
+#define MINBALLS 1
+#define MINSIZE 1
+#define MINGRIDSIZE 5
+
+#define ORIENTS 4
+#define ORIENTCYCLE 16
+#define CCW 1
+#define CW (ORIENTS-1)
+#define DIR(x) (((x)>=0)?CCW:CW)
+#define SIGN(x)        (((x)>=0)?1:-1)
+
+typedef struct {
+       int         x, y;
+       int         width, height;
+} ballwindow;
+
+typedef struct {
+       int         x, y, xlast, ylast, orientlast;
+       int         spincount, spindelay, spindir, orient;
+       int         vx, vy, vang;
+       unsigned long color;
+} ballstruct;
+
+typedef struct {
+       int         width, height;
+       int         nballs;
+       int         xs, ys, avgsize;
+       int         restartnum;
+       int         pixelmode;
+       ballstruct *balls;
+       int         graphics_format;
+       GC          backGC;
+       XImage     *logo;
+       unsigned long black;
+       Colormap    cmap;
+       GC          stippledGC;
+       Pixmap      pixmaps[ORIENTS + 1];
+       int         init_orients;
+       int         nwindow;
+       ballwindow *windows;
+} bouncestruct;
+
+static bouncestruct *bounces = NULL;
+
+static void
+checkCollision(bouncestruct * bp, int aball)
+{
+       int         i, amount, spin, d, size;
+       double      x, y;
+
+       for (i = 0; i < bp->nballs; i++) {
+               if (i != aball) {
+                       x = (double) (bp->balls[i].x - bp->balls[aball].x);
+                       y = (double) (bp->balls[i].y - bp->balls[aball].y);
+                       d = (int) sqrt(x * x + y * y);
+                       size = bp->avgsize;
+                       if (d > 0 && d < size) {
+                               amount = size - d;
+                               if (amount > PENETRATION * size)
+                                       amount = (int) (PENETRATION * size);
+                               bp->balls[i].vx += (int) ((double) amount * x / d);
+                               bp->balls[i].vy += (int) ((double) amount * y / d);
+                               bp->balls[i].vx -= bp->balls[i].vx / FRICTION;
+                               bp->balls[i].vy -= bp->balls[i].vy / FRICTION;
+                               bp->balls[aball].vx -= (int) ((double) amount * x / d);
+                               bp->balls[aball].vy -= (int) ((double) amount * y / d);
+                               bp->balls[aball].vx -= bp->balls[aball].vx / FRICTION;
+                               bp->balls[aball].vy -= bp->balls[aball].vy / FRICTION;
+                               spin = (bp->balls[i].vang - bp->balls[aball].vang) /
+                                       (2 * size * SLIPAGE);
+                               bp->balls[i].vang -= spin;
+                               bp->balls[aball].vang += spin;
+                               bp->balls[i].spindir = DIR(bp->balls[i].vang);
+                               bp->balls[aball].spindir = DIR(bp->balls[aball].vang);
+                               if (!bp->balls[i].vang) {
+                                       bp->balls[i].spindelay = 1;
+                                       bp->balls[i].spindir = 0;
+                               } else
+                                       bp->balls[i].spindelay = (int) ((double) M_PI *
+                                                                       bp->avgsize / (ABS(bp->balls[i].vang))) + 1;
+                               if (!bp->balls[aball].vang) {
+                                       bp->balls[aball].spindelay = 1;
+                                       bp->balls[aball].spindir = 0;
+                               } else
+                                       bp->balls[aball].spindelay = (int) ((double) M_PI *
+                                                                           bp->avgsize / (ABS(bp->balls[aball].vang))) + 1;
+                               return;
+                       }
+               }
+       }
+}
+
+static void
+drawball(ModeInfo * mi, ballstruct * ball)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+
+       if (ball->xlast != -1) {
+               if (bp->logo && !bp->pixelmode) {
+                       XSetForeground(display, bp->backGC, bp->black);
+#ifdef FLASH
+                       XFillRectangle(display, window, bp->backGC,
+                               ball->xlast, ball->ylast, bp->xs, bp->ys);
+#else
+                       ERASE_IMAGE(display, window, bp->backGC,
+                               ball->x, ball->y, ball->xlast, ball->ylast,
+                               bp->xs, bp->ys);
+#endif
+               } else {
+                       XSetForeground(display, bp->stippledGC, MI_BLACK_PIXEL(mi));
+                       XSetStipple(display, bp->stippledGC,
+                               bp->pixmaps[(bp->pixelmode) ? 0 : ORIENTS]);
+                       XSetFillStyle(display, bp->stippledGC, FillStippled);
+                       XSetTSOrigin(display, bp->stippledGC,
+                               ball->xlast, ball->ylast);
+#ifdef FLASH
+                       XFillRectangle(display, window, bp->stippledGC,
+                               ball->xlast, ball->ylast, bp->xs, bp->ys);
+#else
+                       ERASE_IMAGE(display, window, bp->stippledGC,
+                               ball->x, ball->y, ball->xlast, ball->ylast,
+                               bp->xs, bp->ys);
+#endif
+               }
+       }
+       if (bp->logo && !bp->pixelmode) {
+               XSetForeground(display, bp->backGC, ball->color);
+                if (bp->logo)
+                        (void) XPutImage(display, window, bp->backGC, bp->logo,
+                                 0, 0, ball->x, ball->y, bp->xs, bp->ys);
+       } else {
+               XSetTSOrigin(display, bp->stippledGC, ball->x, ball->y);
+               XSetForeground(display, bp->stippledGC, ball->color);
+               XSetStipple(display, bp->stippledGC,
+                       bp->pixmaps[(bp->pixelmode) ? 0 : ball->orient]);
+#ifdef FLASH
+               XSetFillStyle(display, bp->stippledGC, FillStippled);
+#else
+               XSetFillStyle(display, bp->stippledGC, FillOpaqueStippled);
+#endif
+               XFillRectangle(display, window, bp->stippledGC,
+                       ball->x, ball->y, bp->xs, bp->ys);
+       }
+       XFlush(display);
+}
+
+static void
+spinball(ballstruct * ball, int dir, int *vel, int avgsize)
+{
+       *vel -= (int) ((*vel + SIGN(*vel * dir) *
+               ball->spindelay * ORIENTCYCLE / (M_PI * avgsize)) / SLIPAGE);
+       if (*vel) {
+               ball->spindir = DIR(*vel * dir);
+               ball->vang = *vel * ORIENTCYCLE;
+               ball->spindelay = (int) ((double) M_PI * avgsize / (ABS(ball->vang))) + 1;
+       } else
+               ball->spindir = 0;
+}
+
+#define BETWEEN(x, xmin, xmax) (((x) >= (xmin)) && ((x) <= (xmax)))
+static void
+hit_left_wall(ModeInfo * mi, ballstruct * ball,
+             int ytop, int height, int x, int side)
+{
+       bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+
+       if ((ball->x <= x) && ((ball->xlast >= x) || side) &&
+           BETWEEN(ball->y, ytop - bp->ys, ytop + height)) {
+               /* Bounce off the wall to the left of the ball */
+
+               ball->x = 2 * x - ball->x;
+               ball->vx = (ball->vx - (ball->vx * FRICTION)) / FRICTION;
+               spinball(ball, -1, &ball->vy, bp->avgsize);
+       }
+}
+
+static void
+hit_right_wall(ModeInfo * mi, ballstruct * ball,
+              int ytop, int height, int x, int side)
+{
+       bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+
+       x -= bp->xs;            /* account for ball width */
+
+       if ((ball->x >= x) && ((ball->xlast <= x) || side) &&
+           BETWEEN(ball->y, ytop - bp->ys, ytop + height)) {
+               /* Bounce off the wall to the right of the ball */
+
+               ball->x = 2 * x - ball->x;
+               ball->vx = (ball->vx - (ball->vx * FRICTION)) / FRICTION;
+               spinball(ball, 1, &ball->vy, bp->avgsize);
+       }
+}
+
+static void
+hit_top_wall(bouncestruct * bp, ballstruct * ball, int xleft, int width, int y, int side)
+{
+       if ((ball->y <= y) && ((ball->ylast >= y) || side) &&
+           BETWEEN(ball->x, xleft - bp->xs, xleft + width)) {  /* Bounce off the wall to the top of the ball */
+               ball->y = 2 * y - ball->y;
+               /* HACK to make it look better for iconified mode */
+               if (y == 0) {
+                       ball->vy = 0;
+               } else {
+                       ball->vy = (ball->vy - (FRICTION * ball->vy)) / FRICTION;
+               }
+               spinball(ball, 1, &ball->vx, bp->avgsize);
+       }
+}
+
+
+static void
+hit_bottom_wall(bouncestruct * bp, ballstruct * ball, int xleft, int width, int y, int side)
+{
+       y -= bp->ys;            /* account for ball height */
+
+       if ((ball->y >= y) && ((ball->ylast <= y) || side) &&
+           BETWEEN(ball->x, xleft - bp->xs, xleft + width)) {  /* Bounce off the wall to the bottom of the ball */
+               ball->y = y;
+               ball->vy = (ball->vy - (FRICTION * ball->vy)) / FRICTION;
+               spinball(ball, -1, &ball->vx, bp->avgsize);
+       }
+}
+
+static void
+moveball(ModeInfo * mi, ballstruct * ball)
+{
+       bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+       int         i;
+       ballwindow *win;
+
+       ball->xlast = ball->x;
+       ball->ylast = ball->y;
+       ball->orientlast = ball->orient;
+       ball->x += ball->vx;
+
+       for (i = 0; i < bp->nwindow; i++) {
+               win = &bp->windows[i];
+
+               hit_left_wall(mi, ball, win->y, win->height, win->x + win->width, 0);
+               hit_right_wall(mi, ball, win->y, win->height, win->x, 0);
+       }
+       hit_right_wall(mi, ball, 0, bp->height, bp->width, 1);
+       hit_left_wall(mi, ball, 0, bp->height, 0, 1);
+
+       ball->vy++;
+       ball->y += ball->vy;
+
+       for (i = 0; i < bp->nwindow; i++) {
+               win = &bp->windows[i];
+
+               hit_top_wall(bp, ball, win->x, win->width, win->y + win->height, 0);
+               hit_bottom_wall(bp, ball, win->x, win->width, win->y, 0);
+       }
+       hit_top_wall(bp, ball, 0, bp->width, 0, 1);
+       hit_bottom_wall(bp, ball, 0, bp->width, bp->height, 1);
+
+       if (ball->spindir) {
+               ball->spincount--;
+               if (!ball->spincount) {
+                       ball->orient = (ball->spindir + ball->orient) % ORIENTS;
+                       ball->spincount = ball->spindelay;
+               }
+       }
+}
+
+static int
+collide(bouncestruct * bp, int aball)
+{
+       int         i, d, x, y;
+
+       for (i = 0; i < aball; i++) {
+               x = (bp->balls[i].x - bp->balls[aball].x);
+               y = (bp->balls[i].y - bp->balls[aball].y);
+               d = (int) sqrt((double) (x * x + y * y));
+               if (d < bp->avgsize)
+                       return i;
+       }
+       return i;
+}
+
+static void
+bounce_windows(ModeInfo * mi, bouncestruct * bp)
+{
+       Window      root, parent, *children;
+       unsigned int nchildren;
+       int         i;
+       int         n;
+
+       if (!MI_IS_INROOT(mi)) {
+               bp->nwindow = 0;
+               return;
+       }
+       if (XQueryTree(MI_DISPLAY(mi), MI_WINDOW(mi),
+                      &root, &parent, &children, &nchildren) == 0) {   /* failure */
+               bp->nwindow = 0;
+               return;
+       }
+       bp->nwindow = nchildren;
+       if (bp->windows != NULL)
+               (void) free((void *) bp->windows);
+       if ((bp->windows = (ballwindow *) malloc(bp->nwindow *
+                       sizeof (ballwindow))) == NULL) {
+               XFree((caddr_t) children);
+               bp->nwindow = 0;
+               return; 
+       }
+       for (n = 0, i = 0; i < bp->nwindow; i++) {
+               XWindowAttributes att;
+
+/*-
+   May give
+   X Error of failed request: BadWindow (invalid Window parameter)
+   Major opcode of failed request:  3 (X_GetWindowAttributes)
+ */
+               if (XGetWindowAttributes(MI_DISPLAY(mi), children[i], &att) == 0) {     /* failure */
+                       XFree((caddr_t) children);
+                       bp->nwindow = 0;
+                       (void) free((void *) bp->windows);
+                       bp->windows = NULL;
+                       return;
+               }
+               if ((att.x < 0) || (att.x > bp->width) ||
+                   (att.y < 0) || (att.y > bp->height) ||
+#if defined(__cplusplus) || defined(c_plusplus)
+                   (att.c_class != InputOutput) ||
+#else
+                   (att.class != InputOutput) ||
+#endif
+                   (att.map_state != IsViewable)) {
+                       continue;
+               }
+               bp->windows[n].x = att.x;
+               bp->windows[n].y = att.y;
+               bp->windows[n].width = att.width;
+               bp->windows[n].height = att.height;
+               n++;
+       }
+       bp->nwindow = n;
+       XFree((caddr_t) children);
+       return;
+}
+
+static void
+free_stuff(Display * display, bouncestruct * bp)
+{
+       int bits;
+
+       for (bits = 0; bits < bp->init_orients; bits++) {
+               if (bp->pixmaps[bits] != None) {
+                       XFreePixmap(display, bp->pixmaps[bits]);
+                       bp->pixmaps[bits] = None;
+               }
+       }
+       bp->init_orients = 0;
+       if (bp->cmap != None) {
+               XFreeColormap(display, bp->cmap);
+               if (bp->backGC != None) {
+                       XFreeGC(display, bp->backGC);
+                       bp->backGC = None;
+               }
+               bp->cmap = None;
+       } else
+               bp->backGC = None;
+       if (bp->logo != None) {
+               destroyImage(&bp->logo, &bp->graphics_format);
+               bp->logo = None;
+       }
+}
+
+static void
+free_bounce(Display *display, bouncestruct *bp)
+{
+       if (bp->balls != NULL) {
+               (void) free((void *) bp->balls);
+               bp->balls = NULL;
+       }
+       free_stuff(display, bp);
+       if (bp->stippledGC != None) {
+               XFreeGC(display, bp->stippledGC);
+               bp->stippledGC = None;
+       }
+       if (bp->windows != NULL) {
+               (void) free((void *) bp->windows);
+               bp->windows = NULL;
+       }
+
+}
+static Bool
+init_stuff(ModeInfo * mi)
+{
+        Display    *display = MI_DISPLAY(mi);
+        Window      window = MI_WINDOW(mi);
+        bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+       XGCValues   gcv;
+
+        if (MI_BITMAP(mi) && strlen(MI_BITMAP(mi))) {
+                if (bp->logo == None) {
+                  getImage(mi, &bp->logo, BOUNCE_WIDTH, BOUNCE_HEIGHT, BOUNCE_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                         DEFAULT_XPM, BOUNCE_NAME,
+#endif
+                         &bp->graphics_format, &bp->cmap, &bp->black);
+                       if (bp->logo == None) {
+                               free_bounce(display, bp);
+                               return False;
+                       }
+               }
+       } else {
+               BALLBITS(bounce0_bits, bounce0_width, bounce0_height);
+               BALLBITS(bounce1_bits, bounce1_width, bounce1_height);
+               BALLBITS(bounce2_bits, bounce2_width, bounce2_height);
+               BALLBITS(bounce3_bits, bounce3_width, bounce3_height);
+               BALLBITS(bouncemask_bits, bouncemask_width, bouncemask_height);
+       }
+        if (bp->cmap != None) {
+
+#ifndef STANDALONE
+                setColormap(display, window, bp->cmap, MI_IS_INWINDOW(mi));
+#endif
+                if (bp->backGC == None) {
+                        gcv.background = bp->black;
+                        if ((bp->backGC = XCreateGC(display, window,
+                                       GCBackground, &gcv)) == None) {
+                               free_bounce(display, bp);
+                               return False;
+                       }
+                }
+        } else {
+                bp->black = MI_BLACK_PIXEL(mi);
+                bp->backGC = MI_GC(mi);
+        }
+       return True;
+}
+
+void
+init_bounce(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       bouncestruct *bp;
+       int         i, tryagain = 0;
+       XGCValues   gcv;
+
+       if (bounces == NULL) {
+               if ((bounces = (bouncestruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (bouncestruct))) == NULL)
+                       return;
+       }
+       bp = &bounces[MI_SCREEN(mi)];
+
+       free_stuff(display, bp);
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+       if (bp->width < 2)
+               bp->width = 2;
+       if (bp->height < 2)
+               bp->height = 2;
+       bp->restartnum = TIME;
+       bounce_windows(mi, bp);
+       bp->nballs = MI_COUNT(mi);
+       if (bp->nballs < -MINBALLS) {
+               /* if bp->nballs is random ... the size can change */
+               if (bp->balls != NULL) {
+                       (void) free((void *) bp->balls);
+                       bp->balls = NULL;
+               }
+               bp->nballs = NRAND(-bp->nballs - MINBALLS + 1) + MINBALLS;
+       } else if (bp->nballs < MINBALLS)
+               bp->nballs = MINBALLS;
+       if (bp->balls == NULL) {
+               if ((bp->balls = (ballstruct *) malloc(bp->nballs *
+                               sizeof (ballstruct))) == NULL) {
+                       free_bounce(display, bp);
+                       return;
+               }
+       }
+       if (!init_stuff(mi))
+               return;
+       if (bp->stippledGC == None) {
+               gcv.foreground = MI_BLACK_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((bp->stippledGC = XCreateGC(display, window,
+                        GCForeground | GCBackground, &gcv)) == None) {
+                       free_bounce(display, bp);
+                       return;
+               }
+       }
+       if (size == 0 ||
+        MINGRIDSIZE * size > bp->width || MINGRIDSIZE * size > bp->height) {
+               if (bp->logo) {
+                        bp->xs = bp->logo->width;
+                        bp->ys = bp->logo->height;
+                } else {
+                        bp->xs = bounce0_width;
+                        bp->ys = bounce0_height;
+                }
+               if (bp->width > MINGRIDSIZE * bp->xs &&
+                   bp->height > MINGRIDSIZE * bp->ys) {
+                       bp->pixelmode = False;
+               } else {
+                       bp->pixelmode = True;
+                       bp->ys = MAX(MINSIZE, MIN(bp->width, bp->height) / MINGRIDSIZE);
+                       bp->xs = bp->ys;
+                       free_stuff(display, bp);
+               }
+       } else {
+               bp->pixelmode = True;
+               if (size < -MINSIZE)
+                       bp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(bp->width, bp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE)
+                       bp->ys = MINSIZE;
+               else
+                       bp->ys = MIN(size, MAX(MINSIZE, MIN(bp->width, bp->height) /
+                                              MINGRIDSIZE));
+               bp->xs = bp->ys;
+       }
+       if (bp->pixelmode) {
+               GC fg_gc, bg_gc;
+
+               if ((bp->pixmaps[0] = XCreatePixmap(display, window,
+                               bp->xs, bp->ys, 1)) == None) {
+                       free_bounce(display, bp);
+                       return;
+               }
+               bp->init_orients = 1;
+               gcv.foreground = 0;
+               gcv.background = 1;
+               if ((bg_gc = XCreateGC(display, bp->pixmaps[0],
+                                GCForeground | GCBackground, &gcv)) == None) {
+                       free_bounce(display, bp);
+                       return;
+               }
+               gcv.foreground = 1;
+               gcv.background = 0;
+               if ((fg_gc = XCreateGC(display, bp->pixmaps[0],
+                                GCForeground | GCBackground, &gcv)) == None) {
+                       XFreeGC(display, bg_gc);
+                       free_bounce(display, bp);
+                       return;
+               }
+               XFillRectangle(display, bp->pixmaps[0], bg_gc,
+                       0, 0, bp->xs, bp->ys);
+               XFillArc(display, bp->pixmaps[0], fg_gc,
+                       0, 0, bp->xs, bp->ys, 0, 23040);
+               XFreeGC(display, bg_gc);
+               XFreeGC(display, fg_gc);
+       }
+       bp->avgsize = (bp->xs + bp->ys) / 2;
+       i = 0;
+       while (i < bp->nballs) {
+               bp->balls[i].vx = ((LRAND() & 1) ? -1 : 1) * (NRAND(MAX_STRENGTH) + 1);
+               bp->balls[i].x = (bp->balls[i].vx >= 0) ? 0 : bp->width - bp->xs;
+               bp->balls[i].y = NRAND(bp->height / 2);
+               if (i == collide(bp, i) || tryagain >= 8) {
+                       if (MI_NPIXELS(mi) > 2)
+                               bp->balls[i].color =
+                                       MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       else
+                               bp->balls[i].color = MI_WHITE_PIXEL(mi);
+                       bp->balls[i].xlast = -1;
+                       bp->balls[i].ylast = 0;
+                       bp->balls[i].orientlast = 0;
+                       bp->balls[i].spincount = 1;
+                       bp->balls[i].spindelay = 1;
+                       bp->balls[i].vy = ((LRAND() & 1) ? -1 : 1) * NRAND(MAX_STRENGTH);
+                       bp->balls[i].spindir = 0;
+                       bp->balls[i].vang = 0;
+                       bp->balls[i].orient = NRAND(ORIENTS);
+                       i++;
+               } else
+                       tryagain++;
+       }
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_bounce(ModeInfo * mi)
+{
+       int         i;
+       bouncestruct *bp;
+
+       if (bounces == NULL)
+               return;
+       bp = &bounces[MI_SCREEN(mi)];
+       if (bp->balls == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       for (i = 0; i < bp->nballs; i++) {
+               drawball(mi, &bp->balls[i]);
+               moveball(mi, &bp->balls[i]);
+       }
+       for (i = 0; i < bp->nballs; i++)
+               checkCollision(bp, i);
+       if (!NRAND(TIME))       /* Put some randomness into the time */
+               bp->restartnum--;
+       if (!bp->restartnum)
+               init_bounce(mi);
+}
+
+void
+release_bounce(ModeInfo * mi)
+{
+       if (bounces != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_bounce(MI_DISPLAY(mi), &bounces[screen]);
+               (void) free((void *) bounces);
+               bounces = NULL;
+       }
+}
+
+void
+refresh_bounce(ModeInfo * mi)
+{
+       bouncestruct *bp = &bounces[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       bounce_windows(mi, bp);
+}
+
+#endif /* MODE_bounce */
diff --git a/modes/braid.c b/modes/braid.c
new file mode 100644 (file)
index 0000000..5adc2bf
--- /dev/null
@@ -0,0 +1,450 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/*-
+ * braid --- random braids around a circle and then changes the color in
+ *           a rotational pattern
+ */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)braid.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by John Neil.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Jamie Zawinski <jwz@jwz.org> compatible with xscreensaver
+ * 01-Sep-1995: color knotted components differently, J. Neil.
+ * 29-Aug-1995: Written.  John Neil <neil@math.idbsu.edu>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Braid"
+#define HACK_INIT init_braid
+#define HACK_DRAW draw_braid
+#define braid_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*count: 15 \n" \
+ "*cycles: 100 \n" \
+ "*size: -7 \n" \
+ "*ncolors: 64 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"
+#else /* STANDALONE */
+#include "xlock.h"
+
+#endif /* STANDALONE */
+
+#ifdef MODE_braid
+
+ModeSpecOpt braid_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   braid_description =
+{"braid", "init_braid", "draw_braid", "release_braid",
+ "refresh_braid", "init_braid", NULL, &braid_opts,
+ 1000, 15, 100, 1, 64, 1.0, "",
+ "Shows random braids and knots", 0, NULL};
+
+#endif
+
+#if defined( COLORROUND ) && defined( COLORCOMP )
+#undef COLORROUND
+#undef COLORCOMP
+#endif
+
+#if !defined( COLORROUND ) && !defined( COLORCOMP )
+#if 0
+/* to color in a circular pattern use COLORROUND */
+#define COLORROUND
+#else
+/* to color by component use COLORCOMP */
+#define COLORCOMP
+#endif
+#endif
+
+#define MAXLENGTH  50          /* the maximum length of a braid word */
+#define MINLENGTH  8           /* the minimum length of a braid word */
+#define MAXSTRANDS  15         /* the maximum number of strands in the braid */
+#define MINSTRANDS  3          /* the minimum number of strands in the braid */
+#define SPINRATE  12.0         /* the rate at which the colors spin */
+
+#define INTRAND(min,max) (NRAND((max+1)-(min))+(min))
+#define FLOATRAND(min,max) ((min)+((double) LRAND()/((double) MAXRAND))*((max)-(min)))
+
+typedef struct {
+       int         linewidth;
+       int         braidword[MAXLENGTH];
+       int         components[MAXSTRANDS];
+       int         startcomp[MAXLENGTH][MAXSTRANDS];
+       int         nstrands;
+       int         braidlength;
+       float       startcolor;
+       int         center_x;
+       int         center_y;
+       float       min_radius;
+       float       max_radius;
+       float       top, bottom, left, right;
+       int         age;
+       int         color_direction;
+} braidtype;
+
+static braidtype *braids = NULL;
+
+static int
+applyword(braidtype * braid, int string, int position)
+{
+       int         i, c;
+
+       c = string;
+       for (i = position; i < braid->braidlength; i++) {
+               if (c == ABS(braid->braidword[i]))
+                       c--;
+               else if (c == ABS(braid->braidword[i]) - 1)
+                       c++;
+       }
+       for (i = 0; i < position; i++) {
+               if (c == ABS(braid->braidword[i]))
+                       c--;
+               else if (c == ABS(braid->braidword[i]) - 1)
+                       c++;
+       }
+       return c;
+}
+
+#if 0
+static int
+applywordto(braidtype * braid, int string, int position)
+{
+       int         i, c;
+
+       c = string;
+       for (i = 0; i < position; i++) {
+               if (c == ABS(braid->braidword[i])) {
+                       c--;
+               } else if (c == ABS(braid->braidword[i]) - 1) {
+                       c++;
+               }
+       }
+       return c;
+}
+#endif
+
+static int
+applywordbackto(braidtype * braid, int string, int position)
+{
+       int         i, c;
+
+       c = string;
+       for (i = position - 1; i >= 0; i--) {
+               if (c == ABS(braid->braidword[i])) {
+                       c--;
+               } else if (c == ABS(braid->braidword[i]) - 1) {
+                       c++;
+               }
+       }
+       return c;
+}
+
+void
+init_braid(ModeInfo * mi)
+{
+       braidtype  *braid;
+       int         used[MAXSTRANDS];
+       int         i, count, comp, c;
+       float       min_length;
+
+       if (braids == NULL) {
+               if ((braids = (braidtype *) calloc(MI_NUM_SCREENS(mi),
+                                               sizeof (braidtype))) == NULL)
+                       return;
+       }
+       braid = &braids[MI_SCREEN(mi)];
+
+       braid->center_x = MI_WIDTH(mi) / 2;
+       braid->center_y = MI_HEIGHT(mi) / 2;
+       braid->age = 0;
+
+       /* jwz: go in the other direction sometimes. */
+       braid->color_direction = ((LRAND() & 1) ? 1 : -1);
+
+       MI_CLEARWINDOW(mi);
+
+       min_length = (braid->center_x > braid->center_y) ?
+               braid->center_y : braid->center_x;
+       braid->min_radius = min_length * 0.30;
+       braid->max_radius = min_length * 0.90;
+
+       if (MI_COUNT(mi) < MINSTRANDS)
+               braid->nstrands = MINSTRANDS;
+       else
+               braid->nstrands = INTRAND(MINSTRANDS,
+                                      MAX(MIN(MIN(MAXSTRANDS, MI_COUNT(mi)),
+                                              (int) ((braid->max_radius - braid->min_radius) / 5.0)), MINSTRANDS));
+       braid->braidlength = INTRAND(MINLENGTH, MIN(MAXLENGTH, braid->nstrands * 6));
+
+       for (i = 0; i < braid->braidlength; i++) {
+               braid->braidword[i] =
+                       INTRAND(1, braid->nstrands - 1) * (INTRAND(1, 2) * 2 - 3);
+               if (i > 0)
+                       while (braid->braidword[i] == -braid->braidword[i - 1])
+                               braid->braidword[i] = INTRAND(1, braid->nstrands - 1) * (INTRAND(1, 2) * 2 - 3);
+       }
+
+       while (braid->braidword[0] == -braid->braidword[braid->braidlength - 1])
+               braid->braidword[braid->braidlength - 1] =
+                       INTRAND(1, braid->nstrands - 1) * (INTRAND(1, 2) * 2 - 3);
+
+       do {
+               (void) memset((char *) used, 0, sizeof (used));
+               count = 0;
+               for (i = 0; i < braid->braidlength; i++)
+                       used[ABS(braid->braidword[i])]++;
+               for (i = 0; i < braid->nstrands; i++)
+                       count += (used[i] > 0) ? 1 : 0;
+               if (count < braid->nstrands - 1) {
+                       braid->braidword[braid->braidlength] =
+                               INTRAND(1, braid->nstrands - 1) * (INTRAND(1, 2) * 2 - 3);
+                       while (braid->braidword[braid->braidlength] ==
+                              -braid->braidword[braid->braidlength - 1] &&
+                              braid->braidword[0] == -braid->braidword[braid->braidlength])
+                               braid->braidword[braid->braidlength] =
+                                       INTRAND(1, braid->nstrands - 1) * (INTRAND(1, 2) * 2 - 3);
+                       braid->braidlength++;
+               }
+       } while (count < braid->nstrands - 1 && braid->braidlength < MAXLENGTH);
+
+       braid->startcolor = (MI_NPIXELS(mi) > 2) ?
+               (float) NRAND(MI_NPIXELS(mi)) : 0.0;
+       /* XSetLineAttributes (display, MI_GC(mi), 2, LineSolid, CapRound,
+          JoinRound); */
+
+       (void) memset((char *) braid->components, 0, sizeof (braid->components));
+       c = 1;
+       comp = 0;
+       braid->components[0] = 1;
+       do {
+               i = comp;
+               do {
+                       i = applyword(braid, i, 0);
+                       braid->components[i] = braid->components[comp];
+               } while (i != comp);
+               count = 0;
+               for (i = 0; i < braid->nstrands; i++)
+                       if (braid->components[i] == 0)
+                               count++;
+               if (count > 0) {
+                       for (comp = 0; braid->components[comp] != 0; comp++);
+                       braid->components[comp] = ++c;
+               }
+       } while (count > 0);
+
+       braid->linewidth = MI_SIZE(mi);
+
+       if (braid->linewidth < 0)
+               braid->linewidth = NRAND(-braid->linewidth) + 1;
+       if (braid->linewidth * braid->linewidth * 8 > MIN(MI_WIDTH(mi), MI_HEIGHT(mi)))
+       braid->linewidth = MIN(1, (int) sqrt((double) MIN(MI_WIDTH(mi), MI_HEIGHT(mi)) / 8));
+       for (i = 0; i < braid->nstrands; i++)
+               if (!(braid->components[i] & 1))
+                       braid->components[i] *= -1;
+}
+
+void
+draw_braid(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         num_points = 500;
+       float       t_inc;
+       float       theta, psi;
+       float       t, r_diff;
+       int         i, s;
+       float       x_1, y_1, x_2, y_2, r1, r2;
+       float       color, color_use = 0.0, color_inc;
+       braidtype  *braid;
+
+       if (braids == NULL)
+               return;
+       braid = &braids[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       XSetLineAttributes(display, MI_GC(mi), braid->linewidth,
+                          LineSolid,
+                          (braid->linewidth <= 3 ? CapButt : CapRound),
+                          JoinMiter);
+
+       theta = (2.0 * M_PI) / (float) (braid->braidlength);
+       t_inc = (2.0 * M_PI) / (float) num_points;
+       color_inc = (float) MI_NPIXELS(mi) * braid->color_direction /
+               (float) num_points;
+       braid->startcolor += SPINRATE * color_inc;
+       if (((int) braid->startcolor) >= MI_NPIXELS(mi))
+               braid->startcolor = 0.0;
+
+       r_diff = (braid->max_radius - braid->min_radius) / (float) (braid->nstrands);
+
+       color = braid->startcolor;
+       psi = 0.0;
+       for (i = 0; i < braid->braidlength; i++) {
+               psi += theta;
+               for (t = 0.0; t < theta; t += t_inc) {
+#ifdef COLORROUND
+                       color += color_inc;
+                       if (((int) color) >= MI_NPIXELS(mi))
+                               color = 0.0;
+                       color_use = color;
+#endif
+                       for (s = 0; s < braid->nstrands; s++) {
+                               if (ABS(braid->braidword[i]) == s)
+                                       continue;
+                               if (ABS(braid->braidword[i]) - 1 == s) {
+                                       /* crosSINFg */
+#ifdef COLORCOMP
+                                       if (MI_NPIXELS(mi) > 2) {
+                                               color_use = color + SPINRATE *
+                                                       braid->components[applywordbackto(braid, s, i)] +
+                                                       (psi + t) / 2.0 / M_PI * (float) MI_NPIXELS(mi);
+                                               while (((int) color_use) >= MI_NPIXELS(mi))
+                                                       color_use -= (float) MI_NPIXELS(mi);
+                                               while (((int) color_use) < 0)
+                                                       color_use += (float) MI_NPIXELS(mi);
+                                       }
+#endif
+#ifdef COLORROUND
+                                       if (MI_NPIXELS(mi) > 2) {
+                                               color_use += SPINRATE * color_inc;
+                                               while (((int) color_use) >= MI_NPIXELS(mi))
+                                                       color_use -= (float) MI_NPIXELS(mi);
+                                       }
+#endif
+                                       r1 = braid->min_radius + r_diff * (float) (s);
+                                       r2 = braid->min_radius + r_diff * (float) (s + 1);
+                                       if (braid->braidword[i] > 0 ||
+                                           (FABSF(t - theta / 2.0) > theta / 7.0)) {
+                                               x_1 = ((0.5 * (1.0 + SINF(t / theta * M_PI - M_PI_2)) * r2 +
+                                                       0.5 * (1.0 + SINF((theta - t) / theta * M_PI - M_PI_2)) * r1)) *
+                                                       COSF(t + psi) + braid->center_x;
+                                               y_1 = ((0.5 * (1.0 + SINF(t / theta * M_PI - M_PI_2)) * r2 +
+                                                       0.5 * (1.0 + SINF((theta - t) / theta * M_PI - M_PI_2)) * r1)) *
+                                                       SINF(t + psi) + braid->center_y;
+                                               x_2 = ((0.5 * (1.0 + SINF((t + t_inc) / theta * M_PI - M_PI_2)) * r2 +
+                                                       0.5 * (1.0 + SINF((theta - t - t_inc) / theta * M_PI - M_PI_2)) * r1)) *
+                                                       COSF(t + t_inc + psi) + braid->center_x;
+                                               y_2 = ((0.5 * (1.0 + SINF((t + t_inc) / theta * M_PI - M_PI_2)) * r2 +
+                                                       0.5 * (1.0 + SINF((theta - t - t_inc) / theta * M_PI - M_PI_2)) * r1)) *
+                                                       SINF(t + t_inc + psi) + braid->center_y;
+                                               if (MI_NPIXELS(mi) > 2)
+                                                       XSetForeground(display, MI_GC(mi), MI_PIXEL(mi, (int) color_use));
+                                               else
+                                                       XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+
+                                               XDrawLine(display, window, MI_GC(mi),
+                                                         (int) (x_1), (int) (y_1), (int) (x_2), (int) (y_2));
+                                       }
+#ifdef COLORCOMP
+                                       if (MI_NPIXELS(mi) > 2) {
+                                               color_use = color + SPINRATE *
+                                                       braid->components[applywordbackto(braid, s + 1, i)] +
+                                                       (psi + t) / 2.0 / M_PI * (float) MI_NPIXELS(mi);
+                                               while (((int) color_use) >= MI_NPIXELS(mi))
+                                                       color_use -= (float) MI_NPIXELS(mi);
+                                               while (((int) color_use) < 0)
+                                                       color_use += (float) MI_NPIXELS(mi);
+                                       }
+#endif
+                                       if (braid->braidword[i] < 0 ||
+                                           (FABSF(t - theta / 2.0) > theta / 7.0)) {
+                                               x_1 = ((0.5 * (1.0 + SINF(t / theta * M_PI - M_PI_2)) * r1 +
+                                                       0.5 * (1.0 + SINF((theta - t) / theta * M_PI - M_PI_2)) * r2)) *
+                                                       COSF(t + psi) + braid->center_x;
+                                               y_1 = ((0.5 * (1.0 + SINF(t / theta * M_PI - M_PI_2)) * r1 +
+                                                       0.5 * (1.0 + SINF((theta - t) / theta * M_PI - M_PI_2)) * r2)) *
+                                                       SINF(t + psi) + braid->center_y;
+                                               x_2 = ((0.5 * (1.0 + SINF((t + t_inc) / theta * M_PI - M_PI_2)) * r1 +
+                                                       0.5 * (1.0 + SINF((theta - t - t_inc) / theta * M_PI - M_PI_2)) * r2)) *
+                                                       COSF(t + t_inc + psi) + braid->center_x;
+                                               y_2 = ((0.5 * (1.0 + SINF((t + t_inc) / theta * M_PI - M_PI_2)) * r1 +
+                                                       0.5 * (1.0 + SINF((theta - t - t_inc) / theta * M_PI - M_PI_2)) * r2)) *
+                                                       SINF(t + t_inc + psi) + braid->center_y;
+                                               if (MI_NPIXELS(mi) > 2)
+                                                       XSetForeground(display, MI_GC(mi), MI_PIXEL(mi, (int) color_use));
+                                               else
+                                                       XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+
+                                               XDrawLine(display, window, MI_GC(mi),
+                                                         (int) (x_1), (int) (y_1), (int) (x_2), (int) (y_2));
+                                       }
+                               } else {
+                                       /* no crosSINFg */
+#ifdef COLORCOMP
+                                       if (MI_NPIXELS(mi) > 2) {
+                                               color_use = color + SPINRATE *
+                                                       braid->components[applywordbackto(braid, s, i)] +
+                                                       (psi + t) / 2.0 / M_PI * (float) MI_NPIXELS(mi);
+                                               while (((int) color_use) >= MI_NPIXELS(mi))
+                                                       color_use -= (float) MI_NPIXELS(mi);
+                                               while (((int) color_use) < 0)
+                                                       color_use += (float) MI_NPIXELS(mi);
+                                       }
+#endif
+#ifdef COLORROUND
+                                       if (MI_NPIXELS(mi) > 2) {
+                                               color_use += SPINRATE * color_inc;
+                                               while (((int) color_use) >= MI_NPIXELS(mi))
+                                                       color_use -= (float) MI_NPIXELS(mi);
+                                       }
+#endif
+                                       r1 = braid->min_radius + r_diff * (float) (s);
+                                       x_1 = r1 * COSF(t + psi) + braid->center_x;
+                                       y_1 = r1 * SINF(t + psi) + braid->center_y;
+                                       x_2 = r1 * COSF(t + t_inc + psi) + braid->center_x;
+                                       y_2 = r1 * SINF(t + t_inc + psi) + braid->center_y;
+                                       if (MI_NPIXELS(mi) > 2)
+                                               XSetForeground(display, MI_GC(mi), MI_PIXEL(mi, (int) color_use));
+                                       else
+                                               XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+
+                                       XDrawLine(display, window, MI_GC(mi),
+                                                 (int) (x_1), (int) (y_1), (int) (x_2), (int) (y_2));
+                               }
+                       }
+               }
+       }
+       XSetLineAttributes(display, MI_GC(mi), 1, LineSolid, CapNotLast, JoinRound);
+
+       if (++braid->age > MI_CYCLES(mi)) {
+               init_braid(mi);
+       }
+}
+
+void
+release_braid(ModeInfo * mi)
+{
+       if (braids != NULL) {
+               (void) free((void *) braids);
+               braids = NULL;
+       }
+}
+
+void
+refresh_braid(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_braid */
diff --git a/modes/bubble.c b/modes/bubble.c
new file mode 100644 (file)
index 0000000..b7d86ce
--- /dev/null
@@ -0,0 +1,312 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* bubble --- simple exploding bubbles */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)bubble.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1998 by Charles Vidal <vidalc@club-internet.fr>
+ *         http://www.chez.com/vidalc
+ *         and David Bagley
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-Jan-1998: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Bubble"
+#define HACK_INIT init_bubble
+#define HACK_DRAW draw_bubble
+#define bubble_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: 25 \n" \
+ "*size: 100 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_bubble
+
+#define DEF_BOIL  "False"
+static Bool boil;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-boil", (char *) ".bubble.boil", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+boil", (char *) ".bubble.boil", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & boil, (char *) "boil", (char *) "Boil", (char *) DEF_BOIL, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+boil", (char *) "turn on/off boil"}
+};
+
+ModeSpecOpt bubble_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   bubble_description =
+{"bubble", "init_bubble", "draw_bubble", "release_bubble",
+ "refresh_bubble", "init_bubble", NULL, &bubble_opts,
+ 100000, 25, 1, 100, 64, 0.6, "",
+ "Shows popping bubbles", 0, NULL};
+
+#endif
+
+typedef struct {
+       int         x, y, life;
+} bubbletype;
+
+#define MINSIZE 20
+#define MINBUBBLES 1
+
+typedef struct {
+       int         direction;
+       int         color;
+       int         width, height;
+       int         nbubbles;
+       Bool        boil;
+       bubbletype *bubble;
+       int         d;
+       Pixmap      dbuf;
+       GC          dbuf_gc;
+} bubblestruct;
+
+static bubblestruct *bubbles = NULL;
+
+static void
+updateBubble(ModeInfo * mi, int i)
+{
+       bubblestruct *bp = &bubbles[MI_SCREEN(mi)];
+       int         x, diameter, x4, y4, diameter4;
+
+       if (bp->bubble[i].life + 1 > bp->d - NRAND(16) ||
+           bp->bubble[i].y < 0) {
+               bp->bubble[i].life = 0;
+               return;
+       }
+       ++bp->bubble[i].life;
+       diameter = bp->bubble[i].life;
+       x = bp->bubble[i].x;
+       if (bp->boil) {
+               bp->bubble[i].y -= diameter / 2;
+               x += (int) (cos((double) (diameter +
+                      bp->bubble[i].x) / (M_PI / 5.0)) * (double) diameter);
+       }
+       /* SunOS 4.1.X xnews server may crash without this */
+       if (diameter < 4) {
+               XFillRectangle(MI_DISPLAY(mi), bp->dbuf, bp->dbuf_gc,
+                           x - diameter / 2, bp->bubble[i].y - diameter / 2,
+                              diameter, diameter);
+       } else {
+               XDrawArc(MI_DISPLAY(mi), bp->dbuf, bp->dbuf_gc,
+                        x - diameter / 2, bp->bubble[i].y - diameter / 2,
+                        diameter, diameter, 0, 23040);
+       }
+       diameter4 = diameter / 4;
+       if (diameter4 > 0) {
+               x4 = x - diameter4 / 2 +
+                       ((bp->direction / 2) ? (-1) : 1) * diameter / 6;
+               y4 = bp->bubble[i].y - diameter4 / 2 +
+                       ((bp->direction % 2) ? 1 : (-1)) * diameter / 6;
+               /* SunOS 4.1.X xnews server may crash without this */
+               if (diameter4 < 4) {
+                       XFillRectangle(MI_DISPLAY(mi), bp->dbuf, bp->dbuf_gc,
+                                      x4, y4, diameter4, diameter4);
+               } else {
+                       XFillArc(MI_DISPLAY(mi), bp->dbuf, bp->dbuf_gc,
+                                x4, y4, diameter4, diameter4, 0, 23040);
+               }
+       }
+}
+
+static void
+changeBubble(ModeInfo * mi)
+{
+       bubblestruct *bp = &bubbles[MI_SCREEN(mi)];
+       int         i;
+
+       for (i = 0; i < bp->nbubbles; i++) {
+               if (bp->bubble[i].life != 0)
+                       updateBubble(mi, i);
+       }
+       i = NRAND(bp->nbubbles);
+       if (bp->bubble[i].life == 0) {
+               bp->bubble[i].x = NRAND(bp->width);
+               if (bp->boil)
+                       bp->bubble[i].y = bp->height -
+                               ((bp->height >= 16) ? NRAND(bp->height / 16) : 0);
+               else
+                       bp->bubble[i].y = NRAND(bp->height);
+               updateBubble(mi, i);
+       }
+}
+
+static void
+free_bubble(Display *display, bubblestruct *bp)
+{
+       if (bp->dbuf != None) {
+               XFreePixmap(display, bp->dbuf);
+               bp->dbuf = None;
+       }
+       if (bp->dbuf_gc != None) {
+               XFreeGC(display, bp->dbuf_gc);
+               bp->dbuf_gc = None;
+       }
+       if (bp->bubble != NULL) {
+               (void) free((void *) bp->bubble);
+               bp->bubble = NULL;
+       }
+}
+
+void
+init_bubble(ModeInfo * mi)
+{
+       bubblestruct *bp;
+       int         size = MI_SIZE(mi);
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       XGCValues   gcv;
+
+       if (bubbles == NULL) {
+               if ((bubbles = (bubblestruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (bubblestruct))) == NULL)
+                       return;
+       }
+       bp = &bubbles[MI_SCREEN(mi)];
+
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+       bp->direction = NRAND(4);
+       if (MI_IS_FULLRANDOM(mi))
+               bp->boil = (Bool) (LRAND() & 1);
+       else
+               bp->boil = boil;
+
+       if (size < -MINSIZE)
+               bp->d = NRAND(MIN(-size, MAX(MINSIZE,
+                  MIN(bp->width, bp->height) / 2)) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE) {
+               if (!size)
+                       bp->d = MAX(MINSIZE, MIN(bp->width, bp->height) / 2);
+               else
+                       bp->d = MINSIZE;
+       } else
+               bp->d = MIN(size, MAX(MINSIZE,
+                                     MIN(bp->width, bp->height) / 2));
+       bp->nbubbles = MI_COUNT(mi);
+       if (bp->nbubbles < -MINBUBBLES) {
+               bp->nbubbles = NRAND(-bp->nbubbles - MINBUBBLES + 1) + MINBUBBLES;
+       } else if (bp->nbubbles < MINBUBBLES)
+               bp->nbubbles = MINBUBBLES;
+       if (bp->bubble != NULL)
+               (void) free((void *) bp->bubble);
+       if ((bp->bubble = (bubbletype *) calloc(bp->nbubbles,
+                       sizeof (bubbletype))) == NULL) {
+               free_bubble(display, bp);
+               return;
+       }
+       if (MI_NPIXELS(mi) > 2)
+               bp->color = NRAND(MI_NPIXELS(mi));
+
+       if (bp->dbuf != None)
+               XFreePixmap(display, bp->dbuf);
+       if ((bp->dbuf = XCreatePixmap(display, window, bp->width, bp->height,
+                       1)) == None) {
+               free_bubble(display, bp);
+               return;
+       }
+       /* Do not want any exposure events from XCopyPlane */
+       XSetGraphicsExposures(display, MI_GC(mi), False);
+
+       gcv.foreground = 1;
+       gcv.background = 0;
+       gcv.function = GXcopy;
+       gcv.graphics_exposures = False;
+       gcv.line_width = 2;
+       if (bp->dbuf_gc)
+               XFreeGC(display, bp->dbuf_gc);
+       if ((bp->dbuf_gc = XCreateGC(display, bp->dbuf,
+                       GCForeground | GCBackground | GCLineWidth | GCFunction,
+                       &gcv)) == None) {
+               free_bubble(display, bp);
+               return;
+       }
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_bubble(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       bubblestruct *bp;
+
+       if (bubbles == NULL)
+               return;
+       bp = &bubbles[MI_SCREEN(mi)];
+       if (bp->bubble == NULL)
+               return;
+       
+       MI_IS_DRAWN(mi) = True;
+       if (MI_NPIXELS(mi) <= 2)
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       else {
+               bp->color = (bp->color + 1) % MI_NPIXELS(mi);
+               XSetForeground(display, gc, MI_PIXEL(mi, bp->color));
+       }
+       if (bp->dbuf) {
+               XSetForeground(display, bp->dbuf_gc, 0);
+               XFillRectangle(display, bp->dbuf, bp->dbuf_gc,
+                              0, 0, bp->width, bp->height);
+               XSetForeground(display, bp->dbuf_gc, 1);
+               changeBubble(mi);
+               XCopyPlane(display, bp->dbuf, window, gc,
+                          0, 0, bp->width, bp->height, 0, 0, 1);
+       }
+}
+
+void
+release_bubble(ModeInfo * mi)
+{
+       if (bubbles != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_bubble(MI_DISPLAY(mi), &bubbles[screen]);
+               (void) free((void *) bubbles);
+               bubbles = NULL;
+       }
+}
+
+void
+refresh_bubble(ModeInfo * mi)
+{
+       /* Do nothing, it will refresh by itself */
+}
+
+#endif /* MODE_bubble */
diff --git a/modes/bug.c b/modes/bug.c
new file mode 100644 (file)
index 0000000..0edbfbc
--- /dev/null
@@ -0,0 +1,1428 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* bug --- Michael Palmiter's simulated evolution */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)bug.c        5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 24-Aug-1995: Coded from A.K. Dewdney's, "Computer Recreations", Scientific
+ *              American Magazine" May 1989 pp138-141 and Sept 1989 p 183.
+ *              also used wator.c as a guide.
+ */
+
+/*-
+ * Bugs learn to hunt bacteria (or die) in the Garden of Eden and outside.
+ * They start as jitterbugs and "evolve" to move straight (in the Garden
+ *  they may evolve to twirl around).
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Bug"
+#define HACK_INIT init_bug
+#define HACK_DRAW draw_bug
+#define bug_opts xlockmore_opts
+#define DEFAULTS "*delay: 75000 \n" \
+ "*count: 10 \n" \
+ "*cycles: 32767 \n" \
+ "*size: -4 \n" \
+ "*ncolors: 64 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_bug
+
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+#define DEF_EYES  "False"
+
+static int  neighbors;
+static Bool eyes;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".bug.neighbors", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-eyes", (char *) ".bug.eyes", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+eyes", (char *) ".bug.eyes", XrmoptionNoArg, (caddr_t) "off"},
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int},
+       {(caddr_t *) & eyes, (char *) "eyes", (char *) "Eyes", (char *) DEF_EYES, t_Bool},
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6"},
+       {(char *) "-/+eyes", (char *) "turn on/off eyes"}
+};
+
+ModeSpecOpt bug_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+
+#ifdef USE_MODULES
+ModStruct   bug_description =
+{"bug", "init_bug", "draw_bug", "release_bug",
+ "refresh_bug", "init_bug", NULL, &bug_opts,
+ 75000, 10, 32767, -4, 64, 1.0, "",
+ "Shows Palmiter's bug evolution and garden of Eden", 0, NULL};
+
+#endif
+
+#if DEBUG
+#include <assert.h>
+#endif
+
+#define BUGBITS(n,w,h)\
+  if ((bp->pixmaps[bp->init_bits]=\
+  XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
+  free_bug(display,bp); return;} else {bp->init_bits++;}
+
+#define BACTERIA 0
+#define BUG 1
+
+#define MAXENERGY 1500         /* Max energy storage */
+#define INITENERGY 400         /* Initial energy */
+#define FOODPERCYCLE 1
+#define BACTERIAENERGY 40
+#define STRONG 1000            /* Min energy to breed */
+#define MATURE 800             /* Breeding time of bugs */
+#define MAXGENE 6
+#define MINGENE (-MAXGENE)
+#define REDRAWSTEP 2000                /* How many bacteria to draw per cycle */
+#define MINGRIDSIZE 24
+#define MINSIZE 1
+#define ANGLES 360
+#define MAXNEIGHBORS 12
+
+/* Relative hex bug moves */
+/* Forward, Right, Hard Right, Reverse, Hard Left, Left */
+
+/* Bug data */
+typedef struct {
+       char        direction;
+       int         age, energy;
+       unsigned int color;
+       int         col, row;
+       int         gene[MAXNEIGHBORS];
+       double      gene_prob[MAXNEIGHBORS];
+#if EXTRA_GENES
+       int         lgene[MAXNEIGHBORS];
+       double      lgene_prob[MAXNEIGHBORS];
+#endif
+} bugstruct;
+
+/* Doublely linked list */
+typedef struct _BugList {
+       bugstruct   info;
+       struct _BugList *previous, *next;
+} BugList;
+
+typedef struct {
+       Bool        painted;
+       int         neighbors;
+       int         nbugs;      /* Number of bugs */
+       int         eden;       /* Does the garden exist? */
+       int         generation;
+       int         ncols, nrows;
+       int         width, height;
+       int         edenwidth, edenheight;
+       int         edenstartx, edenstarty;
+       int         xs, ys, xb, yb;
+       int         redrawing, redrawpos;
+       int         eyes;
+       BugList    *currbug, *babybug, *lastbug, *firstbug, *lasttemp, *firsttemp;
+       BugList   **arr;        /* 0=empty or pts to a bug */
+       char       *bacteria;   /* 0=empty or food */
+       int         init_bits;
+       GC          stippledGC;
+       Pixmap      pixmaps[NUMSTIPPLES - 1];
+       union {
+               XPoint      hexagon[6];
+               XPoint      triangle[2][3];
+       } shape;
+} bugfarmstruct;
+
+static double genexp[MAXGENE - MINGENE + 1];
+
+static char plots[] =
+{3, 4, 6, 8,
+#ifdef NUMBER_9
+ 9,
+#endif
+ 12};          /* Neighborhoods */
+
+#define NEIGHBORKINDS (long) (sizeof plots / sizeof *plots)
+
+static bugfarmstruct *bugfarms = NULL;
+
+#if 0
+static void
+position_of_neighbor(bugfarmstruct * bp, int dir, int *pcol, int *prow)
+{
+       int         col = *pcol, row = *prow;
+
+       /* NO WRAPING */
+
+       if (bp->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col = col + 1;
+                               break;
+                       case 60:
+                               if (!(row & 1))
+                                       col = col + 1;
+                               row = row - 1;
+                               break;
+                       case 120:
+                               if (row & 1)
+                                       col = col - 1;
+                               row = row - 1;
+                               break;
+                       case 180:
+                               col = col - 1;
+                               break;
+                       case 240:
+                               if (row & 1)
+                                       col = col - 1;
+                               row = row + 1;
+                               break;
+                       case 300:
+                               if (!(row & 1))
+                                       col = col + 1;
+                               row = row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (bp->neighbors == 4 || bp->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               col = col + 1;
+                               break;
+                       case 45:
+                               col = col + 1;
+                               row = row - 1;
+                               break;
+                       case 90:
+                               row = row - 1;
+                               break;
+                       case 135:
+                               col = col - 1;
+                               row = row - 1;
+                               break;
+                       case 180:
+                               col = col - 1;
+                               break;
+                       case 225:
+                               col = col - 1;
+                               row = row + 1;
+                               break;
+                       case 270:
+                               row = row + 1;
+                               break;
+                       case 315:
+                               col = col + 1;
+                               row = row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               switch (dir) {
+                       case 0:
+                               col = col + 1;
+                               break;
+                       case 20:
+                       case 30:
+                       case 40:
+                               col = col + 1;
+                               row = row - 1;
+                               break;
+                       case 60:
+                               if ((col + row) % 2) {  /* right */
+                                       row = row - 1;
+                               } else { /* left */
+                                       col = col + 1;
+                                       row = row - 2;
+                               }
+                               break;
+                       case 80:
+                       case 90:
+                       case 100:
+                               row = row - 2;
+                               break;
+                       case 120:
+                               if ((col + row) % 2) {  /* right */
+                                       col = col - 1;
+                                       row = row - 2;
+                               } else { /* left */
+                                       row = row - 1;
+                               }
+                               break;
+                       case 140:
+                       case 150:
+                       case 160:
+                               col = col - 1;
+                               row = row - 1;
+                               break;
+                       case 180:
+                               col = col - 1;
+                               break;
+                       case 200:
+                       case 210:
+                       case 220:
+                               col = col - 1;
+                               row = row + 1;
+                               break;
+                       case 240:
+                               if ((col + row) % 2) {  /* right */
+                                       col = col - 1;
+                                       row = row + 2;
+                               } else { /* left */
+                                       row = row + 1;
+                               }
+                               break;
+                       case 260:
+                       case 270:
+                       case 280:
+                               row = row + 2;
+                               break;
+                       case 300:
+                               if ((col + row) % 2) {  /* right */
+                                       row = row + 1;
+                               } else { /* left */
+                                       col = col + 1;
+                                       row = row + 2;
+                               }
+                               break;
+                       case 320:
+                       case 330:
+                       case 340:
+                               col = col + 1;
+                               row = row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       }
+       *pcol = col;
+       *prow = row;
+}
+
+#endif
+
+#if 0
+static void
+screen2grid(bugfarmstruct *bp, int sx, int sy, int x, int y)
+{
+       *y = sy / 2;
+       if (bp->neighbors == 6) {
+               *x = (sx + 1) / 2 - 1;
+       } else if (bp->neighbors == 4 || bp->neighbors == 8) {
+               *x = sx / 2;
+       } else {                /* TRI */
+               /* Wrong but... */
+               *x = sx / 3;
+       }
+}
+
+#endif
+
+static void
+grid2screen(bugfarmstruct *bp, int x, int y, int *sx, int *sy)
+{
+       *sy = y * 2 + 1;
+       if (bp->neighbors == 6) {
+               *sx = 2 * x + 1 + !(y & 1);
+       } else if (bp->neighbors == 4 || bp->neighbors == 8) {
+               *sx = x * 2 + 1;
+       } else {                /* TRI */
+               *sx = x * 3 + 1 + ((y & 1) ? (x & 1) : !(x & 1));
+       }
+}
+
+static char
+dirmove(bugfarmstruct * bp, int x, int y, int dir, int *nx, int *ny)
+{
+       if (bp->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               *ny = y;
+                               *nx = x + 1;
+                               return (*nx < bp->ncols - !(*ny & 1));
+                       case 60:
+                               *ny = y - 1;
+                               *nx = x + (int) !(y & 1);
+                               return (*ny >= 0 && *nx < bp->ncols - !(*ny & 1));
+                       case 120:
+                               *ny = y - 1;
+                               *nx = x - (int) (y & 1);
+                               return (*ny >= 0 && *nx >= 0);
+                       case 180:
+                               *ny = y;
+                               *nx = x - 1;
+                               return (*nx >= 0);
+                       case 240:
+                               *ny = y + 1;
+                               *nx = x - (int) (y & 1);
+                               return (*ny < bp->nrows && *nx >= 0);
+                       case 300:
+                               *ny = y + 1;
+                               *nx = x + (int) !(y & 1);
+                               return (*ny < bp->nrows && *nx < bp->ncols - !(*ny & 1));
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (bp->neighbors == 4 || bp->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               *ny = y;
+                               *nx = x + 1;
+                               return (*nx < bp->ncols);
+                       case 45:
+                               *ny = y - 1;
+                               *nx = x + 1;
+                               return (*ny >= 0 && *nx < bp->ncols);
+                       case 90:
+                               *ny = y - 1;
+                               *nx = x;
+                               return (*ny >= 0);
+                       case 135:
+                               *ny = y - 1;
+                               *nx = x - 1;
+                               return (*ny >= 0 && *nx >= 0);
+                       case 180:
+                               *ny = y;
+                               *nx = x - 1;
+                               return (*nx >= 0);
+                       case 225:
+                               *ny = y + 1;
+                               *nx = x - 1;
+                               return (*ny < bp->nrows && *nx >= 0);
+                       case 270:
+                               *ny = y + 1;
+                               *nx = x;
+                               return (*ny < bp->nrows);
+                       case 315:
+                               *ny = y + 1;
+                               *nx = x + 1;
+                               return (*ny < bp->nrows && *nx < bp->ncols);
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               switch (dir) {
+                       case 0:
+                               *nx = x + 1;
+                               *ny = y;
+                               return (*nx < bp->ncols);
+                       case 20:
+                       case 30:
+                       case 40:
+                               *nx = x + 1;
+                               *ny = y - 1;
+                               return (*nx < bp->ncols && *ny >= 0);
+                       case 60:
+                               if ((x + y) % 2) {  /* right */
+                                       *nx = x;
+                                       *ny = y - 1;
+                                       return (*ny >= 0);
+                               } else { /* left */
+                                       *nx = x + 1;
+                                       *ny = y - 2;
+                                       return (*nx < bp->ncols && *ny >= 0);
+                               }
+                       case 80:
+                       case 90:
+                       case 100:
+                               *nx = x;
+                               *ny = y - 2;
+                               return (*ny >= 0);
+                       case 120:
+                               if ((x + y) % 2) {  /* right */
+                                       *nx = x - 1;
+                                       *ny = y - 2;
+                                       return (*nx >= 0 && *ny >= 0);
+                               } else { /* left */
+                                       *nx = x;
+                                       *ny = y - 1;
+                                       return (*ny >= 0);
+                               }
+                       case 140:
+                       case 150:
+                       case 160:
+                               *nx = x - 1;
+                               *ny = y - 1;
+                               return (*nx >= 0 && *ny >= 0);
+                       case 180:
+                               *nx = x - 1;
+                               *ny = y;
+                               return (*nx >= 0);
+                       case 200:
+                       case 210:
+                       case 220:
+                               *nx = x - 1;
+                               *ny = y + 1;
+                               return (*nx >= 0 && *ny < bp->nrows);
+                       case 240:
+                               if ((x + y) % 2) {  /* right */
+                                       *nx = x - 1;
+                                       *ny = y + 2;
+                                       return (*nx >= 0 && *ny < bp->nrows);
+                               } else { /* left */
+                                       *nx = x;
+                                       *ny = y + 1;
+                                       return (*ny < bp->nrows);
+                               }
+                       case 260:
+                       case 270:
+                       case 280:
+                               *nx = x;
+                               *ny = y + 2;
+                               return (*ny < bp->nrows);
+                       case 300:
+                               if ((x + y) % 2) {  /* right */
+                                       *nx = x;
+                                       *ny = y + 1;
+                                       return (*ny < bp->nrows);
+                               } else { /* left */
+                                       *nx = x + 1;
+                                       *ny = y + 2;
+                                       return (*nx < bp->ncols && *ny < bp->nrows);
+                               }
+                       case 320:
+                       case 330:
+                       case 340:
+                               *nx = x + 1;
+                               *ny = y + 1;
+                               return (*nx < bp->ncols && *ny < bp->nrows);
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       }
+       *nx = -1;
+       *ny = -1;
+       return 0;
+}
+
+/* This keeps bugs from walking over each other and escaping off the screen */
+static int
+has_neighbor(bugfarmstruct * bp, int col, int row)
+{
+       int         colrow = col + row * bp->ncols;
+
+       if (bp->neighbors == 6) {
+               if ((row > 0) && bp->arr[colrow - bp->ncols])
+                       return True;
+               if ((row < bp->nrows - 1) && bp->arr[colrow + bp->ncols])
+                       return True;
+               if (col > 0) {
+                       if (bp->arr[colrow - 1])
+                               return True;
+                       if (row & 1) {
+                               if ((row > 0) && bp->arr[colrow - 1 - bp->ncols])
+                                       return True;
+                               if ((row < bp->nrows - 1) && bp->arr[colrow - 1 + bp->ncols])
+                                       return True;
+                       }
+               }
+               if (col < bp->ncols - 1) {
+                       if (bp->arr[colrow + 1])
+                               return True;
+                       if (!(row & 1)) {
+                               if ((row > 0) && bp->arr[colrow + 1 - bp->ncols])
+                                       return True;
+                               if ((row < bp->nrows - 1) && bp->arr[colrow + 1 + bp->ncols])
+                                       return True;
+                       }
+               }
+       } else if (bp->neighbors == 4 || bp->neighbors == 8) {
+               /* Same for both because the bug square takes up the space regardless */
+               if ((row > 0) && bp->arr[colrow - bp->ncols])
+                       return True;
+               if ((row < bp->nrows - 1) && bp->arr[colrow + bp->ncols])
+                       return True;
+               if ((col > 0) && bp->arr[colrow - 1])
+                       return True;
+               if ((col < bp->ncols - 1) && bp->arr[colrow + 1])
+                       return True;
+               if (row > 0 && col > 0 && bp->arr[colrow - bp->ncols - 1])
+                       return True;
+               if (row > 0 && col < bp->ncols - 1 && bp->arr[colrow - bp->ncols + 1])
+                       return True;
+               if (row < bp->nrows - 1 && col > 0 && bp->arr[colrow + bp->ncols - 1])
+                       return True;
+               if (row < bp->nrows - 1 && col < bp->ncols - 1 && bp->arr[colrow + bp->ncols + 1])
+                       return True;
+       } else {                /* TRI */
+               /* Same for all three neighbor kinds. Only care about 3
+                  adjacent spots because that is all the squares will
+                  overlap.*/
+               if (((row & 1) && (col & 1)) || ((!(row & 1)) && (!(col & 1)))) {
+                       if ((col < bp->ncols - 1) && bp->arr[colrow + 1])
+                               return True;
+               } else {
+                       if ((col > 0) && bp->arr[colrow - 1])
+                               return True;
+               }
+               if ((row > 0) && bp->arr[colrow - bp->ncols])
+                       return True;
+               if ((row < bp->nrows - 1) && bp->arr[colrow + bp->ncols])
+                       return True;
+       }
+       return False;
+}
+
+static void
+drawabacterium(ModeInfo * mi, int col, int row, unsigned char color)
+{
+       bugfarmstruct *bp = &bugfarms[MI_SCREEN(mi)];
+       int         ccol, crow;
+
+       if (color)
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi));
+       else
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+       grid2screen(bp, col, row, &ccol, &crow);
+       XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+              bp->xb + bp->xs * ccol, bp->yb + bp->ys * crow,
+              bp->xs, bp->ys);
+}
+
+static void
+drawabug(ModeInfo * mi, int col, int row, unsigned int color, int direction)
+{
+       bugfarmstruct *bp = &bugfarms[MI_SCREEN(mi)];
+       Display *display = MI_DISPLAY(mi);
+       Window window = MI_WINDOW(mi);
+       int         ccol, crow;
+       GC          gc;
+
+       if (MI_NPIXELS(mi) > 3) {
+               XSetForeground(display, MI_GC(mi), MI_PIXEL(mi, color));
+               gc = MI_GC(mi);
+       } else {
+               XGCValues   gcv;
+
+               gcv.stipple = bp->pixmaps[color];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), bp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = bp->stippledGC;
+       }
+
+       grid2screen(bp, col, row, &ccol, &crow);
+       ccol = bp->xb + bp->xs * (ccol - 1);
+       crow = bp->yb + bp->ys * (crow - 1);
+       XFillRectangle(display, window, gc,
+               ccol, crow, 3 * bp->xs, 3 * bp->ys);
+
+       if (bp->eyes && bp->xs >= 1 && bp->ys >= 1) { /* Draw Eyes */
+               XSetForeground(display, MI_GC(mi), MI_BLACK_PIXEL(mi));
+               switch (direction) {
+                       case 0:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs - 2,
+                                       crow + 3 * bp->ys / 2 - 1);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs - 2,
+                                       crow + 3 * bp->ys / 2 + 1);
+                                       break;
+                       case 20:
+                       case 30:
+                       case 40:
+                       case 45:
+                       case 60:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs - 3,
+                                       crow + 1);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs - 2,
+                                       crow + 2);
+                               break;
+                       case 80:
+                       case 90:
+                       case 100:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs / 2 - 1,
+                                       crow + 1);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs / 2 + 1,
+                                       crow + 1);
+                               break;
+                       case 120:
+                       case 135:
+                       case 140:
+                       case 150:
+                       case 160:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 2,
+                                       crow + 1);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 1,
+                                               crow + 2);
+                               break;
+                       case 180:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 1,
+                                       crow + 3 * bp->ys / 2 - 1);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 1,
+                                       crow + 3 * bp->ys / 2 + 1);
+                               break;
+                       case 200:
+                       case 210:
+                       case 220:
+                       case 225:
+                       case 240:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 2,
+                                       crow + 3 * bp->ys - 2);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 1,
+                                       crow + 3 * bp->ys - 3);
+                               break;
+                       case 260:
+                       case 270:
+                       case 280:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs / 2 - 1,
+                                       crow + 3 * bp->ys - 2);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs / 2 + 1,
+                                       crow + 3 * bp->ys - 2);
+                               break;
+                       case 300:
+                       case 315:
+                       case 320:
+                       case 330:
+                       case 340:
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs - 3,
+                                       crow + 3 * bp->ys - 2);
+                               XDrawPoint(display, window, MI_GC(mi),
+                                       ccol + 3 * bp->xs - 2,
+                                       crow + 3 * bp->ys - 3);
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", direction);
+               }
+       }
+}
+
+static void
+eraseabug(ModeInfo * mi, int col, int row)
+{
+       bugfarmstruct *bp = &bugfarms[MI_SCREEN(mi)];
+       int         ccol, crow;
+
+       XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+       grid2screen(bp, col, row, &ccol, &crow);
+       XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+               bp->xb + bp->xs * (ccol - 1), bp->yb + bp->ys * (crow - 1),
+               3 * bp->xs, 3 * bp->ys);
+}
+
+static void
+flush_buglist(bugfarmstruct * bp)
+{
+       while (bp->lastbug->previous != bp->firstbug) {
+               bp->currbug = bp->lastbug->previous;
+               bp->currbug->previous->next = bp->lastbug;
+               bp->lastbug->previous = bp->currbug->previous;
+               /*bp->arr[bp->currbug->info.col + bp->currbug->info.row * bp->ncols] = 0; */
+               (void) free((void *) bp->currbug);
+       }
+
+       while (bp->lasttemp->previous != bp->firsttemp) {
+               bp->currbug = bp->lasttemp->previous;
+               bp->currbug->previous->next = bp->lasttemp;
+               bp->lasttemp->previous = bp->currbug->previous;
+               /*bp->arr[bp->currbug->info.col + bp->currbug->info.row * bp->ncols] = 0; */
+               (void) free((void *) bp->currbug);
+       }
+}
+
+static void
+free_buglist(bugfarmstruct *bp)
+{
+       if (bp->firstbug != NULL) {
+               flush_buglist(bp);
+               (void) free((void *) bp->firstbug);
+               bp->firstbug = NULL;
+       }
+       if (bp->lastbug != NULL) {
+               (void) free((void *) bp->lastbug);
+               bp->lastbug = NULL;
+       }
+       if (bp->lasttemp != NULL) {
+               (void) free((void *) bp->lasttemp);
+               bp->lasttemp = NULL;
+       }
+       if (bp->firsttemp != NULL) {
+               (void) free((void *) bp->firsttemp);
+               bp->firsttemp = NULL;
+       }
+}
+
+static Bool
+init_buglist(bugfarmstruct * bp)
+{
+       /* Waste some space at the beginning and end of list
+          so we do not have to complicated checks against falling off the ends. */
+       if ((bp->lastbug = (BugList *) malloc(sizeof (BugList))) == NULL) {
+               free_buglist(bp);
+               return False;
+       }
+       if ((bp->firstbug = (BugList *) malloc(sizeof (BugList))) == NULL) {
+               free_buglist(bp);
+               return False;
+       }
+       bp->firstbug->previous = bp->lastbug->next = NULL;
+       bp->firstbug->next = bp->lastbug->previous = NULL;
+       bp->firstbug->next = bp->lastbug;
+       bp->lastbug->previous = bp->firstbug;
+
+       if ((bp->lasttemp = (BugList *) malloc(sizeof (BugList))) == NULL) {
+               free_buglist(bp);
+               return False;
+       }
+       if ((bp->firsttemp = (BugList *) malloc(sizeof (BugList))) == NULL) {
+               free_buglist(bp);
+               return False;
+       }
+       bp->firsttemp->previous = bp->lasttemp->next = NULL;
+       bp->firsttemp->next = bp->lasttemp->previous = NULL;
+       bp->firsttemp->next = bp->lasttemp;
+       bp->lasttemp->previous = bp->firsttemp;
+       return True;
+}
+
+static void
+addto_buglist(bugfarmstruct * bp, bugstruct info)
+{
+       if ((bp->currbug = (BugList *) malloc(sizeof (BugList))) == NULL) {
+               free_buglist(bp);
+               return;
+       }
+       bp->lastbug->previous->next = bp->currbug;
+       bp->currbug->previous = bp->lastbug->previous;
+       bp->currbug->next = bp->lastbug;
+       bp->lastbug->previous = bp->currbug;
+       bp->currbug->info = info;
+}
+
+static void
+removefrom_buglist(bugfarmstruct * bp, BugList * ptr)
+{
+       ptr->previous->next = ptr->next;
+       ptr->next->previous = ptr->previous;
+       bp->arr[ptr->info.col + ptr->info.row * bp->ncols] = 0;
+       (void) free((void *) ptr);
+}
+
+static void
+dupin_buglist(bugfarmstruct * bp)
+{
+       BugList    *temp;
+
+       if ((temp = (BugList *) malloc(sizeof (BugList))) == NULL) {
+               free_buglist(bp);
+               return;
+       }
+       temp->previous = bp->babybug;
+       temp->next = bp->babybug->next;
+       bp->babybug->next = temp;
+       temp->next->previous = temp;
+       temp->info = bp->babybug->info;
+       bp->babybug = temp;
+}
+
+/*-
+ * new bug at end of list, this rotates who goes first, young bugs go last
+ * this most likely will not change the feel to any real degree
+ */
+static void
+cutfrom_buglist(bugfarmstruct * bp)
+{
+       bp->babybug = bp->currbug;
+       bp->currbug = bp->currbug->previous;
+       bp->currbug->next = bp->babybug->next;
+       bp->babybug->next->previous = bp->currbug;
+       bp->babybug->next = bp->lasttemp;
+       bp->babybug->previous = bp->lasttemp->previous;
+       bp->babybug->previous->next = bp->babybug;
+       bp->babybug->next->previous = bp->babybug;
+}
+
+static void
+reattach_buglist(bugfarmstruct * bp)
+{
+       bp->currbug = bp->lastbug->previous;
+       bp->currbug->next = bp->firsttemp->next;
+       bp->currbug->next->previous = bp->currbug;
+       bp->lastbug->previous = bp->lasttemp->previous;
+       bp->lasttemp->previous->next = bp->lastbug;
+       bp->lasttemp->previous = bp->firsttemp;
+       bp->firsttemp->next = bp->lasttemp;
+}
+
+static int
+dirbug(bugstruct * info, int local_neighbors)
+{
+       double      sum = 0.0, prob;
+       int         i;
+
+       prob = (double) LRAND() / MAXRAND;
+#if EXTRA_GENES
+       if ((local_neighbors % 2) && !((info->col + info->row) & 1)) {
+               for (i = 0; i < local_neighbors; i++) {
+                       sum += info->lgene_prob[i];
+                       if (prob < sum)
+                               return i;
+               }
+       } else
+#endif
+       {
+               for (i = 0; i < local_neighbors; i++) {
+                       sum += info->gene_prob[i];
+                       if (prob < sum)
+                               return i;
+               }
+       }
+       return local_neighbors - 1;     /* Could miss due to rounding */
+}
+
+static void
+mutatebug(bugstruct * info, int local_neighbors)
+{
+       double      sum = 0.0;
+       int         gene;
+
+       gene = NRAND(local_neighbors);
+       if (LRAND() & 1) {
+               if (info->gene[gene] == MAXGENE)
+                       return;
+               info->gene[gene]++;
+       } else {
+               if (info->gene[gene] == MINGENE)
+                       return;
+               info->gene[gene]--;
+       }
+       for (gene = 0; gene < local_neighbors; gene++)
+               sum += genexp[info->gene[gene] + MAXGENE];
+       for (gene = 0; gene < local_neighbors; gene++)
+               info->gene_prob[gene] = genexp[info->gene[gene] + MAXGENE] / sum;
+#if EXTRA_GENES
+       if (local_neighbors % 2) {
+               sum = 0.0;
+               gene = NRAND(local_neighbors);
+               if (LRAND() & 1) {
+                       if (info->lgene[gene] == MAXGENE)
+                               return;
+                       info->lgene[gene]++;
+               } else {
+                       if (info->lgene[gene] == MINGENE)
+                               return;
+                       info->lgene[gene]--;
+               }
+               for (gene = 0; gene < local_neighbors; gene++)
+                       sum += genexp[info->lgene[gene] + MAXGENE];
+               for (gene = 0; gene < local_neighbors; gene++)
+                       info->lgene_prob[gene] = genexp[info->lgene[gene] + MAXGENE] / sum;
+       }
+#endif
+}
+
+static void
+makebacteria(ModeInfo * mi,
+            int n, int startx, int starty, int width, int height, Bool draw)
+{
+       int         nbacteria = 0, ntries = 0, col, row, colrow;
+       bugfarmstruct *bp = &bugfarms[MI_SCREEN(mi)];
+
+       /* Make bacteria but if can not, exit */
+       while (nbacteria < n && ntries < 2 * n) {
+               row = NRAND(height) + starty;
+               if (bp->neighbors == 6) {
+                       if (width - (!(row & 1)) > 0)
+                               col = NRAND(width - (!(row & 1))) + startx;
+                       else
+                               col = startx;
+               } else { /* RECT or TRI */
+                       col = NRAND(width) + startx;
+               }
+               colrow = col + row * bp->ncols;
+               ntries++;
+               if (!bp->arr[colrow] && !bp->bacteria[colrow]) {
+                       nbacteria++;
+                       bp->bacteria[colrow] = True;
+                       drawabacterium(mi, col, row, draw);
+               }
+       }
+}
+
+static void
+redrawbacteria(ModeInfo * mi, int colrow)
+{
+       int         col, row;
+       bugfarmstruct *bp = &bugfarms[MI_SCREEN(mi)];
+
+       if (!bp->bacteria[colrow])
+               return;
+
+       row = colrow / bp->ncols;
+       col = colrow % bp->ncols;
+       drawabacterium(mi, col, row, True);
+}
+
+static void
+free_bug(Display *display, bugfarmstruct *bp)
+{
+       int         shade;
+
+       if (bp->stippledGC != None) {
+               XFreeGC(display, bp->stippledGC);
+               bp->stippledGC = None;
+       }
+       for (shade = 0; shade < bp->init_bits; shade++) {
+               if (bp->pixmaps[shade] != None) {
+                       XFreePixmap(display, bp->pixmaps[shade]);
+                       bp->pixmaps[shade] = None;
+               }
+       }
+       bp->init_bits = 0;
+       if (bp->firstbug != NULL) {
+               flush_buglist(bp);
+               (void) free((void *) bp->firstbug);
+               bp->firstbug = NULL;
+       }
+       if (bp->lastbug != NULL) {
+               (void) free((void *) bp->lastbug);
+               bp->lastbug = NULL;
+       }
+       if (bp->lasttemp != NULL) {
+               (void) free((void *) bp->lasttemp);
+               bp->lasttemp = NULL;
+       }
+       if (bp->firsttemp != NULL) {
+               (void) free((void *) bp->firsttemp);
+               bp->firsttemp = NULL;
+       }
+       if (bp->arr != NULL) {
+               (void) free((void *) bp->arr);
+               bp->arr = NULL;
+       }
+       if (bp->bacteria != NULL) {
+               (void) free((void *) bp->bacteria);
+               bp->bacteria = NULL;
+       }
+}
+
+void
+init_bug(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       XGCValues   gcv;
+       int         nbugs = 0, ntries = 0, col = 0, row, gene, colrow, i;
+       int         nccols, ncrows;
+       double      sum;
+       bugstruct   info;
+       bugfarmstruct *bp;
+
+       if (bugfarms == NULL) {
+               if ((bugfarms = (bugfarmstruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (bugfarmstruct))) == NULL)
+                       return;
+       }
+       bp = &bugfarms[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) <= 3) {
+               if (bp->stippledGC == None) {
+                       gcv.fill_style = FillOpaqueStippled;
+                       if ((bp->stippledGC = XCreateGC(display, window,
+                                       GCFillStyle, &gcv)) == None) {
+                               free_bug(display, bp);
+                               return;
+                       }
+               }
+               if (bp->init_bits == 0) {
+                       for (i = 1; i < NUMSTIPPLES; i++) {
+                               BUGBITS(stipples[i], STIPPLESIZE, STIPPLESIZE);
+                       }
+               }
+       }
+       bp->generation = 0;
+       if (bp->firstbug == NULL) {     /* Genesis */
+               /* Set up what will be a 'triply' linked list.
+                  doubly linked list, doubly linked to an array */
+               if (!init_buglist(bp)) {
+                       free_bug(display, bp);
+                       return;
+               }
+               genexp[MAXGENE] = 1;
+               for (i = 1; i <= MAXGENE; i++) {
+                       genexp[MAXGENE + i] = genexp[MAXGENE + i - 1] * M_E;
+                       genexp[MAXGENE - i] = 1.0 / genexp[MAXGENE + i];
+               }
+       } else                  /* Apocolypse now */
+               flush_buglist(bp);
+
+       for (i = 0; i < NEIGHBORKINDS; i++) {
+               if (neighbors == plots[i]) {
+                       bp->neighbors = plots[i];
+                       break;
+               }
+               if (i == NEIGHBORKINDS - 1) {
+                       bp->neighbors = plots[NRAND(NEIGHBORKINDS)];
+                       break;
+               }
+       }
+
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+       if (bp->width < 4)
+               bp->width = 4;
+       if (bp->height < 4)
+               bp->height = 4;
+
+       if (size < -MINSIZE)
+               bp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(bp->width, bp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE) {
+               if (!size)
+                       bp->ys = MAX(MINSIZE, MIN(bp->width, bp->height) / MINGRIDSIZE);
+               else
+                       bp->ys = MINSIZE;
+       } else
+               bp->ys = MIN(size, MAX(MINSIZE, MIN(bp->width, bp->height) /
+                                      MINGRIDSIZE));
+       bp->xs = bp->ys;
+       nccols = MAX(bp->width / bp->xs - 2, 2);
+       ncrows = MAX(bp->height / bp->ys - 1, 2);
+       bp->nrows = ncrows / 2;
+       if ((bp->neighbors % 2) || bp->neighbors == 12) {
+               bp->ncols = nccols / 3;
+               if (bp->ncols & 1)
+                       bp->ncols--;    /* Must be odd for no wrap */
+               if (!(bp->nrows & 1))
+                       bp->nrows--;    /* Must be even for no wrap */
+       } else
+               bp->ncols = nccols / 2;
+       if (bp->neighbors == 6 && !(bp->nrows & 1))
+               bp->nrows--;    /* Must be odd for no wrap */
+       bp->xb = (bp->width - bp->xs * nccols) / 2;
+       bp->yb = (bp->height - bp->ys * ncrows) / 2;
+       if (bp->arr != NULL)
+               (void) free((void *) bp->arr);
+       if ((bp->arr = (BugList **) calloc(bp->ncols * bp->nrows,
+                       sizeof (BugList *))) == NULL) {
+               free_bug(display, bp);
+               return;
+       }
+       if (bp->bacteria != NULL)
+               (void) free((void *) bp->bacteria);
+       if ((bp->bacteria = (char *) calloc(bp->ncols * bp->nrows,
+                       sizeof (char))) == NULL) {
+               free_bug(display, bp);
+               return;
+       }
+       bp->edenheight = bp->nrows / 4;
+       bp->edenwidth = bp->ncols / 4;
+       if ((bp->neighbors % 2) || bp->neighbors == 12) {
+               if (bp->edenwidth & 1)
+                       bp->edenwidth--;
+               if (!(bp->edenheight & 1))
+                       bp->edenheight--;
+       } else if (bp->neighbors == 6 && bp->edenheight && !(bp->edenheight & 1))
+               bp->edenheight--;       /* Make sure its odd */
+       bp->eden = (bp->edenwidth > 1 && bp->edenheight > 1);
+       if (bp->eden) {
+               bp->edenstartx = NRAND(bp->ncols - bp->edenwidth);
+               bp->edenstarty = NRAND(bp->nrows - bp->edenheight);
+               if ((bp->neighbors % 2) || bp->neighbors == 12) {
+                       if (bp->edenstartx & 1) {
+                               bp->edenstartx--;
+                               bp->eden = (bp->edenwidth > 1);
+                       }
+                       if (bp->edenstarty & 1) {
+                               bp->edenstarty--;
+                               bp->eden = (bp->edenheight > 1);
+                       }
+               } else if (bp->neighbors == 6 && (bp->edenstarty & 1)) {
+                       bp->edenstarty--;
+                       bp->eden = (bp->edenheight > 1);
+               }
+       }
+       /* Play G-d with these numbers... the genes */
+       nbugs = MI_COUNT(mi);
+       if (nbugs < 0)
+               nbugs = NRAND(-nbugs) + 1;
+       bp->nbugs = 0;
+
+       MI_CLEARWINDOW(mi);
+       bp->painted = False;
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               bp->eyes = (Bool) (LRAND() & 1);
+       } else {
+               bp->eyes = eyes;
+       }
+       bp->eyes = (bp->eyes && bp->xs > 1 && bp->ys > 1);
+
+       /* Try to make bugs, but if can not, exit */
+       while (bp->nbugs < nbugs && ntries < 2 * nbugs) {
+               row = NRAND(bp->nrows);
+               if (bp->neighbors == 6) {
+                       if (bp->ncols - (!(row & 1)) > 0)
+                               col = NRAND(bp->ncols - (!(row & 1)));
+                       else
+                               col = 0;
+               } else { /* RECT or TRI */
+                       col = NRAND(bp->ncols);
+               }
+               colrow = col + row * bp->ncols;
+               ntries++;
+               if (!bp->arr[colrow] && !has_neighbor(bp, col, row)) {
+                       bp->nbugs++;
+                       info.age = 0;
+                       info.energy = INITENERGY;
+                       info.direction = NRAND(bp->neighbors);
+                       for (gene = 0; gene < bp->neighbors; gene++)
+#if 0
+                               /* Some creationalism, may create gliders or twirlers */
+                               do {
+                                       double      temp = (double) LRAND() / MAXRAND;
+
+                                       info.gene[gene] = ((int) (1.0 / (1.0 - temp * temp)) - 1) *
+                                               ((LRAND() & 1) ? -1 : 1);
+                               } while (info.gene[gene] > MAXGENE / 2 ||
+                                        info.gene[gene] < MINGENE / 2);
+#else /* Jitterbugs, evolve or die */
+                               info.gene[gene] = 0;
+#endif
+                       sum = 0;
+                       for (gene = 0; gene < bp->neighbors; gene++)
+                               sum += genexp[info.gene[gene] + MAXGENE];
+                       for (gene = 0; gene < bp->neighbors; gene++)
+                               info.gene_prob[gene] = genexp[info.gene[gene] + MAXGENE] / sum;
+#if EXTRA_GENES
+                       if (bp->neighbors % 2) {
+                               for (gene = 0; gene < bp->neighbors; gene++)
+#if 0
+                               /* Some creationalism, may create gliders or twirlers */
+                                       do {
+                                               double      temp = (double) LRAND() / MAXRAND;
+
+                                               info.lgene[gene] = ((int) (1.0 / (1.0 - temp * temp)) - 1) *
+                                                       ((LRAND() & 1) ? -1 : 1);
+                                       } while (info.lgene[gene] > MAXGENE / 2 ||
+                                                info.lgene[gene] < MINGENE / 2);
+#else /* Jitterbugs, evolve or die */
+                                       info.lgene[gene] = 0;
+#endif
+                               sum = 0;
+                               for (gene = 0; gene < bp->neighbors; gene++)
+                                       sum += genexp[info.lgene[gene] + MAXGENE];
+                               for (gene = 0; gene < bp->neighbors; gene++)
+                                       info.lgene_prob[gene] = genexp[info.lgene[gene] + MAXGENE] / sum;
+                       }
+#endif
+                       if (MI_NPIXELS(mi) > 3)
+                               info.color = NRAND(MI_NPIXELS(mi));
+                       else
+                               info.color = NRAND(NUMSTIPPLES - 1);
+                       info.col = col;
+                       info.row = row;
+                       addto_buglist(bp, info);
+                       if (bp->firstbug == NULL) {
+                               free_bug(display, bp);
+                               return;
+                       }
+                       bp->arr[colrow] = bp->currbug;
+                       drawabug(mi, col, row, bp->currbug->info.color, (int) bp->currbug->info.direction * ANGLES / bp->neighbors);
+               }
+       }
+       makebacteria(mi, bp->ncols * bp->nrows / 2, 0, 0, bp->ncols, bp->nrows,
+                    False);
+       if (bp->eden)
+               makebacteria(mi, bp->edenwidth * bp->edenheight / 2,
+               bp->edenstartx, bp->edenstarty, bp->edenwidth, bp->edenheight, False);
+       bp->redrawing = 1;
+       bp->redrawpos = 0;
+}
+
+#define ENOUGH 16
+void
+draw_bug(ModeInfo * mi)
+{
+       int         col, row, ncol = -1, nrow = -1, colrow, ncolrow;
+       int         absdir = 0, tryit, dir;
+       bugfarmstruct *bp;
+
+       if (bugfarms == NULL)
+               return;
+       bp = &bugfarms[MI_SCREEN(mi)];
+       if (bp->firstbug == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       bp->painted = True;
+       bp->currbug = bp->firstbug->next;
+       while (bp->currbug != bp->lastbug) {
+               col = bp->currbug->info.col;
+               row = bp->currbug->info.row;
+               colrow = col + row * bp->ncols;
+               if (bp->currbug->info.energy-- < 0) {   /* Time to die, Bug */
+#if DEBUG
+                       assert(bp->currbug == bp->arr[colrow]);
+#endif
+                       /* back up one or else in void */
+                       bp->currbug = bp->currbug->previous;
+                       removefrom_buglist(bp, bp->arr[colrow]);
+#if DEBUG
+                       assert(bp->arr[colrow] == 0);
+#endif
+                       bp->arr[colrow] = 0;
+                       eraseabug(mi, col, row);
+                       bp->nbugs--;
+               } else {        /* try to move */
+                       bp->arr[colrow] = 0;    /* Don't want neighbor to detect itself */
+                       tryit = 0;
+                       do {
+                               if (tryit++ > ENOUGH) {
+                                       break;
+                               }
+                               absdir = (bp->currbug->info.direction +
+                                         dirbug(&bp->currbug->info, bp->neighbors)) % bp->neighbors;
+                               dir = absdir * ANGLES / bp->neighbors;
+                               if (bp->neighbors % 2) {
+                                       if ((col + row) & 1)
+                                               dir = (3 * ANGLES / 2 - dir) % ANGLES;
+                                       else
+                                               dir = (ANGLES - dir) % ANGLES;
+                               }
+                       } while (!dirmove(bp, col, row, dir,
+                         &ncol, &nrow) || has_neighbor(bp, ncol, nrow) ||
+                         bp->arr[ncol + nrow * bp->ncols]);
+                       bp->currbug->info.age++;
+                       bp->currbug->info.energy--;
+                       if (tryit <= ENOUGH) {
+                               ncolrow = ncol + nrow * bp->ncols;
+                               if (bp->bacteria[ncolrow]) {
+                                       bp->currbug->info.energy += BACTERIAENERGY;
+                                       bp->bacteria[ncolrow] = 0;
+                                       if (bp->currbug->info.energy > MAXENERGY)
+                                               bp->currbug->info.energy = MAXENERGY;
+                               }
+                               bp->currbug->info.col = ncol;
+                               bp->currbug->info.row = nrow;
+                               bp->currbug->info.direction = absdir;
+#if DEBUG
+                               assert(bp->arr[ncolrow] == 0);
+#endif
+                               bp->arr[ncolrow] = bp->currbug;
+                               if (bp->currbug->info.energy > STRONG &&
+                                   bp->currbug->info.age > MATURE) {   /* breed */
+                                       drawabug(mi, ncol, nrow, bp->currbug->info.color, (int) bp->currbug->info.direction * ANGLES / bp->neighbors);
+                                       cutfrom_buglist(bp);    /* This rotates out who goes first */
+                                       bp->babybug->info.age = 0;
+                                       bp->babybug->info.energy = INITENERGY;
+                                       dupin_buglist(bp);
+                                       if (bp->firstbug == NULL) {
+                                               free_bug(MI_DISPLAY(mi), bp);
+                                               return;
+                                       }
+                                       mutatebug(&bp->babybug->previous->info, bp->neighbors);
+                                       mutatebug(&bp->babybug->info, bp->neighbors);
+                                       bp->arr[colrow] = bp->babybug;
+                                       bp->babybug->info.col = col;
+                                       bp->babybug->info.row = row;
+                                       bp->nbugs++;
+                               } else {
+                                       eraseabug(mi, col, row);
+                                       drawabug(mi, ncol, nrow, bp->currbug->info.color, (int) bp->currbug->info.direction * ANGLES / bp->neighbors);
+                               }
+                       } else
+                               bp->arr[colrow] = bp->currbug;
+               }
+               bp->currbug = bp->currbug->next;
+       }
+       reattach_buglist(bp);
+       makebacteria(mi, FOODPERCYCLE, 0, 0, bp->ncols, bp->nrows, True);
+       if (bp->eden)
+               makebacteria(mi, FOODPERCYCLE,
+                            bp->edenstartx, bp->edenstarty, bp->edenwidth, bp->edenheight, True);
+       if (!bp->nbugs || bp->generation >= MI_CYCLES(mi))
+               init_bug(mi);
+       bp->generation++;
+       if (bp->redrawing) {
+               int         i;
+
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       if (bp->bacteria[bp->redrawpos])
+                               redrawbacteria(mi, bp->redrawpos);
+                       if (++(bp->redrawpos) >= bp->ncols * bp->nrows) {
+                               bp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
+release_bug(ModeInfo * mi)
+{
+       if (bugfarms != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_bug(MI_DISPLAY(mi), &bugfarms[screen]);
+               (void) free((void *) bugfarms);
+               bugfarms = NULL;
+       }
+}
+
+void
+refresh_bug(ModeInfo * mi)
+{
+       bugfarmstruct *bp;
+
+       if (bugfarms == NULL)
+               return;
+       bp = &bugfarms[MI_SCREEN(mi)];
+
+       if (bp->painted) {
+               MI_CLEARWINDOW(mi);
+               bp->painted = False;
+               bp->redrawing = 1;
+               bp->redrawpos = 0;
+       }
+}
+
+#endif /* MODE_bug */
diff --git a/modes/clock.c b/modes/clock.c
new file mode 100644 (file)
index 0000000..aaeedb9
--- /dev/null
@@ -0,0 +1,476 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* clock --- displays an analog clock */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)clock.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by Jeremie PETIT <petit@aurora.unice.fr>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The design was highly inspirated from 'oclock' but not the code,
+ * which is all mine.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 24-Dec-1995: Ron Hitchens <ron@idiom.com> cycles range and defaults
+ *              changed.
+ * 01-Dec-1995: Clock size changes each time it is displayed.
+ * 01-Jun-1995: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Clock"
+#define HACK_INIT init_clock
+#define HACK_DRAW draw_clock
+#define clock_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: -16 \n" \
+ "*cycles: 200 \n" \
+ "*size: -200 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_clock
+
+ModeSpecOpt clock_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   clock_description =
+{"clock", "init_clock", "draw_clock", "release_clock",
+ "refresh_clock", "init_clock", NULL, &clock_opts,
+ 100000, -16, 200, -200, 64, 1.0, "",
+ "Shows Packard's clock", 0, NULL};
+
+#endif
+
+#ifdef TM_IN_SYS_TIME
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+
+#define MIN_CYCLES     50      /* shortest possible time before moving the clock */
+#define MAX_CYCLES   1000      /* longest possible time before moving the clock */
+#define CLOCK_BORDER    9      /* Percentage of the clock size for the border */
+#define HOURS_SIZE     50      /* Percentage of the clock size for hours length */
+#define MINUTES_SIZE   75      /* Idem for minutes */
+#define SECONDS_SIZE   80      /* Idem for seconds */
+#define HOURS_WIDTH    10      /* Percentage of the clock size for hours width */
+#define MINUTES_WIDTH   5      /* Idem for minutes */
+#define SECONDS_WIDTH   2      /* Idem for seconds */
+#define JEWEL_POSITION 90      /* The relative position of the jewel */
+#define JEWEL_SIZE      9      /* The relative size of the jewel */
+#define MINCLOCKS       1
+#define MINSIZE        16      /* size, minimum */
+
+typedef struct {
+       int         size;       /* length of the hand */
+       int         width;      /* width of the hand */
+       unsigned long color;    /* color of the hand */
+} hand;
+
+typedef struct {
+       hand        hours;      /* the hours hand */
+       hand        minutes;    /* the minutes hand */
+       hand        seconds;    /* the seconds hand */
+       XPoint      pos;
+       int         size;
+       int         radius;
+       int         boxsize;
+       int         jewel_size;
+       int         jewel_position;
+       int         border_width;
+       unsigned long border_color;
+       unsigned long jewel_color;
+       struct tm   dd_time;
+} oclock;
+
+typedef struct {
+       oclock     *oclocks;
+       time_t      d_time;
+       int         clock_count;
+       int         width, height;
+       int         nclocks;
+       int         currentclocks;
+       int         redrawing;
+} clockstruct;
+
+static clockstruct *clocks = NULL;
+
+static int
+myrand(int minimum, int maximum)
+{
+       return ((int) (minimum + (LRAND() / MAXRAND) * (maximum + 1 - minimum)));
+}
+
+static double
+HourToAngle(oclock * oclockp)
+{
+       return ((M_PI * ((double) oclockp->dd_time.tm_hour +
+                        ((double) oclockp->dd_time.tm_min / 60) +
+                  ((double) oclockp->dd_time.tm_sec / 3600))) / 6 - M_PI_2);
+}
+
+static double
+MinutesToAngle(oclock * oclockp)
+{
+       return ((M_PI * ((double) oclockp->dd_time.tm_min +
+                   ((double) oclockp->dd_time.tm_sec / 60))) / 30 - M_PI_2);
+}
+
+static double
+SecondsToAngle(oclock * oclockp)
+{
+       return ((M_PI * ((double) oclockp->dd_time.tm_sec) / 30) - M_PI_2);
+}
+
+static void
+DrawDisk(Display * display, Window window, GC gc,
+        int center_x, int center_y, int diameter)
+{
+       int         radius = diameter / 2;
+
+       if (diameter > 1)
+               XFillArc(display, window, gc,
+                        center_x - radius, center_y - radius,
+                        diameter, diameter,
+                        0, 23040);
+       else
+               XDrawPoint(display, window, gc, center_x, center_y);
+}
+
+static void
+DrawBorder(ModeInfo * mi, int clck, short int mode)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       clockstruct *cp = &clocks[MI_SCREEN(mi)];
+
+
+       if (mode == 0)
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       else
+               XSetForeground(display, gc, cp->oclocks[clck].border_color);
+
+       XSetLineAttributes(display, gc, cp->oclocks[clck].border_width,
+                          LineSolid, CapNotLast, JoinMiter);
+       XDrawArc(display, MI_WINDOW(mi), gc,
+                cp->oclocks[clck].pos.x - cp->oclocks[clck].size / 2,
+                cp->oclocks[clck].pos.y - cp->oclocks[clck].size / 2,
+                cp->oclocks[clck].size, cp->oclocks[clck].size,
+                0, 23040);
+}
+
+static void
+DrawJewel(ModeInfo * mi, int clck, short int mode)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       clockstruct *cp = &clocks[MI_SCREEN(mi)];
+
+       XSetLineAttributes(display, gc, 1, LineSolid, CapNotLast, JoinMiter);
+       if (mode == 0)
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       else
+               XSetForeground(display, gc, cp->oclocks[clck].jewel_color);
+       DrawDisk(display, MI_WINDOW(mi), gc,
+                cp->oclocks[clck].pos.x,
+                cp->oclocks[clck].pos.y - cp->oclocks[clck].jewel_position,
+                cp->oclocks[clck].jewel_size);
+}
+
+static void
+DrawHand(ModeInfo * mi, int clck, hand * h, double angle, short int mode)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       clockstruct *cp = &clocks[MI_SCREEN(mi)];
+       int         cosi, sinj;
+
+       /* mode: 0 for erasing, anything else for drawing */
+       if (mode == 0)
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       else
+               XSetForeground(display, gc, h->color);
+       XSetLineAttributes(display, gc, h->width, LineSolid, CapNotLast, JoinMiter);
+       DrawDisk(display, window, gc,
+                cp->oclocks[clck].pos.x, cp->oclocks[clck].pos.y, h->width);
+       cosi = (int) (cos(angle) * (double) (h->size));
+       sinj = (int) (sin(angle) * (double) (h->size));
+       XDrawLine(display, window, gc,
+                 cp->oclocks[clck].pos.x, cp->oclocks[clck].pos.y,
+            cp->oclocks[clck].pos.x + cosi, cp->oclocks[clck].pos.y + sinj);
+       DrawDisk(display, window, gc,
+             cp->oclocks[clck].pos.x + cosi, cp->oclocks[clck].pos.y + sinj,
+                h->width);
+}
+
+static void
+real_draw_clock(ModeInfo * mi, int clck, short int mode)
+{
+       clockstruct *cp = &clocks[MI_SCREEN(mi)];
+
+       DrawBorder(mi, clck, mode);
+       DrawJewel(mi, clck, mode);
+       DrawHand(mi, clck, &cp->oclocks[clck].hours,
+                HourToAngle(&cp->oclocks[clck]), mode);
+       DrawHand(mi, clck, &cp->oclocks[clck].minutes,
+                MinutesToAngle(&cp->oclocks[clck]), mode);
+       DrawHand(mi, clck, &cp->oclocks[clck].seconds,
+                SecondsToAngle(&cp->oclocks[clck]), mode);
+}
+
+static int
+collide(clockstruct * cp, int clck)
+{
+       int         i, d, x, y;
+
+       for (i = 0; i < clck; i++) {
+               x = (cp->oclocks[i].pos.x - cp->oclocks[clck].pos.x);
+               y = (cp->oclocks[i].pos.y - cp->oclocks[clck].pos.y);
+               d = (int) sqrt((double) (x * x + y * y));
+               if (d < (cp->oclocks[i].size + cp->oclocks[i].border_width +
+               cp->oclocks[clck].size + cp->oclocks[clck].border_width) / 2)
+                       return i;
+       }
+       return clck;
+}
+
+static int
+new_clock_state(ModeInfo * mi, int clck)
+{
+       clockstruct *cp = &clocks[MI_SCREEN(mi)];
+       int         size = MI_SIZE(mi);
+       int         tryit;
+
+       for (tryit = 0; tryit < 8; tryit++) {
+               /* We change the clock size */
+               if (size < -MINSIZE)
+                       cp->oclocks[clck].size = NRAND(MIN(-size, MAX(MINSIZE,
+                       MIN(cp->width, cp->height))) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               cp->oclocks[clck].size = MAX(MINSIZE, MIN(cp->width, cp->height));
+                       else
+                               cp->oclocks[clck].size = MINSIZE;
+               } else
+                       cp->oclocks[clck].size = MIN(size, MAX(MINSIZE,
+                                               MIN(cp->width, cp->height)));
+
+               /* We must compute new attributes for the clock because its size changes */
+               cp->oclocks[clck].hours.size = (cp->oclocks[clck].size * HOURS_SIZE) / 200;
+               cp->oclocks[clck].minutes.size =
+                       (cp->oclocks[clck].size * MINUTES_SIZE) / 200;
+               cp->oclocks[clck].seconds.size =
+                       (cp->oclocks[clck].size * SECONDS_SIZE) / 200;
+               cp->oclocks[clck].jewel_size = (cp->oclocks[clck].size * JEWEL_SIZE) / 200;
+
+               cp->oclocks[clck].border_width =
+                       (cp->oclocks[clck].size * CLOCK_BORDER) / 200;
+               cp->oclocks[clck].hours.width = (cp->oclocks[clck].size * HOURS_WIDTH) / 200;
+               cp->oclocks[clck].minutes.width =
+                       (cp->oclocks[clck].size * MINUTES_WIDTH) / 200;
+               cp->oclocks[clck].seconds.width =
+                       (cp->oclocks[clck].size * SECONDS_WIDTH) / 200;
+
+               cp->oclocks[clck].jewel_position =
+                       (cp->oclocks[clck].size * JEWEL_POSITION) / 200;
+
+               cp->oclocks[clck].radius =
+                       (cp->oclocks[clck].size / 2) + cp->oclocks[clck].border_width + 1;
+
+               /* Here we set new values for the next clock to be displayed */
+               if (MI_NPIXELS(mi) > 2) {
+                       /* New colors */
+                       cp->oclocks[clck].border_color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       cp->oclocks[clck].jewel_color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       cp->oclocks[clck].hours.color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       cp->oclocks[clck].minutes.color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       cp->oclocks[clck].seconds.color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+               }
+               /* A new position for the clock */
+               cp->oclocks[clck].pos.x = myrand(cp->oclocks[clck].radius,
+                                      cp->width - cp->oclocks[clck].radius);
+               cp->oclocks[clck].pos.y = myrand(cp->oclocks[clck].radius,
+                                     cp->height - cp->oclocks[clck].radius);
+               if (clck == collide(cp, clck))
+                       return True;
+       }
+       cp->currentclocks = clck;
+       return False;
+}
+
+static void
+update_clock(ModeInfo * mi, int clck)
+{
+       clockstruct *cp = &clocks[MI_SCREEN(mi)];
+
+       DrawHand(mi, clck, &cp->oclocks[clck].hours,
+                HourToAngle(&cp->oclocks[clck]), 0);
+       DrawHand(mi, clck, &cp->oclocks[clck].minutes,
+                MinutesToAngle(&cp->oclocks[clck]), 0);
+       DrawHand(mi, clck, &cp->oclocks[clck].seconds,
+                SecondsToAngle(&cp->oclocks[clck]), 0);
+       cp->d_time = time((time_t *) 0);
+       (void) memcpy((char *) &cp->oclocks[clck].dd_time,
+                     (char *) localtime(&cp->d_time),
+                     sizeof (cp->oclocks[clck].dd_time));
+       DrawHand(mi, clck, &cp->oclocks[clck].hours,
+                HourToAngle(&cp->oclocks[clck]), 1);
+       DrawHand(mi, clck, &cp->oclocks[clck].minutes,
+                MinutesToAngle(&cp->oclocks[clck]), 1);
+       DrawHand(mi, clck, &cp->oclocks[clck].seconds,
+                SecondsToAngle(&cp->oclocks[clck]), 1);
+}
+
+void
+init_clock(ModeInfo * mi)
+{
+       clockstruct *cp;
+       int         clck;
+
+       if (clocks == NULL) {
+               if ((clocks = (clockstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (clockstruct))) == NULL)
+                       return;
+       }
+       cp = &clocks[MI_SCREEN(mi)];
+
+
+       cp->redrawing = 0;
+       cp->width = MI_WIDTH(mi);
+       cp->height = MI_HEIGHT(mi);
+
+       MI_CLEARWINDOW(mi);
+
+       cp->nclocks = MI_COUNT(mi);
+       if (cp->nclocks < -MINCLOCKS) {
+               /* if cp->nclocks is random ... the size can change */
+               if (cp->oclocks != NULL) {
+                       (void) free((void *) cp->oclocks);
+                       cp->oclocks = NULL;
+               }
+               cp->nclocks = NRAND(-cp->nclocks - MINCLOCKS + 1) + MINCLOCKS;
+       } else if (cp->nclocks < MINCLOCKS)
+               cp->nclocks = MINCLOCKS;
+       if (cp->oclocks == NULL) {
+               if ((cp->oclocks = (oclock *) malloc(cp->nclocks *
+                               sizeof (oclock))) == NULL) {
+                       return;
+               }
+       }
+
+       cp->clock_count = MI_CYCLES(mi);
+       if (cp->clock_count < MIN_CYCLES)
+               cp->clock_count = MIN_CYCLES;
+       if (cp->clock_count > MAX_CYCLES)
+               cp->clock_count = MAX_CYCLES;
+
+       for (clck = 0; clck < cp->nclocks; clck++) {
+               /* By default, we set the clock's colors to white */
+               cp->oclocks[clck].border_color = MI_WHITE_PIXEL(mi);
+               cp->oclocks[clck].jewel_color = MI_WHITE_PIXEL(mi);
+               cp->oclocks[clck].hours.color = MI_WHITE_PIXEL(mi);
+               cp->oclocks[clck].minutes.color = MI_WHITE_PIXEL(mi);
+               cp->oclocks[clck].seconds.color = MI_WHITE_PIXEL(mi);
+               cp->d_time = time((time_t *) 0);
+       }
+       for (clck = 0; clck < cp->nclocks; clck++) {
+               (void) memcpy((char *) &cp->oclocks[clck].dd_time,
+                             (char *) localtime(&cp->d_time),
+                             sizeof (cp->oclocks[clck].dd_time));
+       }
+       cp->currentclocks = cp->nclocks;
+       for (clck = 0; clck < cp->currentclocks; clck++)
+               if (!new_clock_state(mi, clck))
+                       break;
+}
+
+void
+draw_clock(ModeInfo * mi)
+{
+       int         clck;
+       clockstruct *cp;
+
+       if (clocks == NULL)
+               return;
+       cp = &clocks[MI_SCREEN(mi)];
+       if (cp->oclocks == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (++cp->clock_count >= MI_CYCLES(mi)) {
+               cp->clock_count = 0;
+               for (clck = 0; clck < cp->currentclocks; clck++)
+                       real_draw_clock(mi, clck, 0);
+               cp->currentclocks = cp->nclocks;
+               for (clck = 0; clck < cp->currentclocks; clck++)
+                       if (!new_clock_state(mi, clck))
+                               break;
+               for (clck = 0; clck < cp->currentclocks; clck++)
+                       real_draw_clock(mi, clck, 1);
+               cp->redrawing = 0;
+       } else if (cp->d_time != time((time_t *) 0))
+               for (clck = 0; clck < cp->currentclocks; clck++)
+                       update_clock(mi, clck);
+       if (cp->redrawing) {
+               for (clck = 0; clck < cp->currentclocks; clck++)
+                       real_draw_clock(mi, clck, 1);
+               cp->redrawing = 0;
+       }
+}
+
+void
+release_clock(ModeInfo * mi)
+{
+       if (clocks != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       clockstruct *cp = &clocks[screen];
+
+                       if (cp->oclocks != NULL) {
+                               (void) free((void *) cp->oclocks);
+                               /* cp->oclocks = NULL; */
+                       }
+               }
+               (void) free((void *) clocks);
+               clocks = NULL;
+       }
+}
+
+void
+refresh_clock(ModeInfo * mi)
+{
+       clockstruct *cp;
+
+       if (clocks == NULL)
+               return;
+       cp = &clocks[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       cp->redrawing = 1;
+}
+
+#endif /* MODE_clock */
diff --git a/modes/coral.c b/modes/coral.c
new file mode 100644 (file)
index 0000000..3707b3a
--- /dev/null
@@ -0,0 +1,343 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* coral --- a coral reef */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)coral.c      5.00 2000/11/01 xlockmore";
+
+#endif
+/*
+ * Copyright (c) 1997 by "Frederick G.M. Roeber" <roeber@netscape.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 29-Oct-1997: xlock version (David Bagley <bagleyd@tux.org>)
+ * 15-Jul-1997: xscreensaver version Frederick G.M. Roeber
+ *              <roeber@netscape.com>
+ */
+
+/*-
+ * original copyright
+ * Copyright (c) 1997 by "Frederick G.M. Roeber" <roeber@netscape.com>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Coral"
+#define HACK_INIT init_coral
+#define HACK_DRAW draw_coral
+#define coral_opts xlockmore_opts
+#define DEFAULTS "*delay: 60000 \n" \
+ "*batchcount: -3 \n" \
+ "*size: 35 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_coral
+
+ModeSpecOpt coral_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   coral_description =
+{"coral", "init_coral", "draw_coral", "release_coral",
+ "init_coral", "init_coral", NULL, &coral_opts,
+ 60000, -3, 1, 35, 64, 0.6, "",
+ "Shows a coral reef", 0, NULL};
+
+#endif
+
+#define MINSIZE 1
+#define MINSEEDS 1
+#define MAXSIZE 99
+#define MAXPOINTS 200
+#define COLORTHRESH 512
+
+typedef struct {
+       unsigned int default_fg_pixel;
+
+       XPoint     *walkers;
+       XPoint     *pointbuf;
+       unsigned int *reef;
+       int         nwalkers;
+       int         width, widthb;
+       int         height;
+       int         colorindex;
+       int         density;
+       int         seeds;
+} coralstruct;
+
+static coralstruct *reefs = NULL;
+
+#define getdot(x,y) (cp->reef[(y*cp->widthb)+(x>>5)] &  (1<<(x & 31)))
+/* Avoid array bounds reads and writes */
+#define setdot(x,y) (cp->reef[((y*cp->widthb)+(x>>5) >= 0 ? (y*cp->widthb)+(x>>5) : 0)] |= (1<<(x & 31)))
+
+/*-
+ * returns 2 bits of randomness (conserving calls to LRAND()).
+ * This speeds things up a little, but not a lot (5-10% or so.)
+ */
+static int
+rand_2(void)
+{
+       static int  i = 0;
+       static int  r = 0;
+
+       if (i) {
+               i--;
+       } else {
+               i = 15;
+               r = (int) LRAND();
+       }
+
+       {
+               register int j = (r & 3);
+
+               r = r >> 2;
+               return j;
+       }
+}
+
+static void
+free_coral(coralstruct *cp)
+{
+
+       if (cp->reef != NULL) {
+               (void) free((void *) cp->reef);
+               cp->reef = NULL;
+       }
+       if (cp->walkers != NULL) {
+               (void) free((void *) cp->walkers);
+               cp->walkers = NULL;
+       }
+       if (cp->pointbuf != NULL) {
+               (void) free((void *) cp->pointbuf);
+               cp->pointbuf = NULL;
+       }
+}
+
+void
+init_coral(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       coralstruct *cp;
+       int         size = MI_SIZE(mi);
+
+       int         i;
+
+       if (reefs == NULL) {
+               if ((reefs = (coralstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (coralstruct))) == NULL)
+                       return;
+       }
+       cp = &reefs[MI_SCREEN(mi)];
+
+
+       cp->width = MAX(MI_WIDTH(mi), 2);
+       cp->height = MAX(MI_HEIGHT(mi), 2);
+
+       cp->widthb = ((cp->width + 31) >> 5);
+
+       if (cp->reef != NULL)
+               (void) free((void *) cp->reef);
+       if ((cp->reef = (unsigned int *) calloc((cp->widthb + 1) * cp->height,
+                       sizeof (unsigned int))) == NULL) {
+               free_coral(cp);
+               return;
+       }
+
+       if (size < -MINSIZE)
+               cp->density = NRAND(MIN(MAXSIZE, -size) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE)
+               cp->density = MINSIZE;
+       else
+               cp->density = MIN(MAXSIZE, size);
+
+       cp->nwalkers = (cp->width * cp->height * cp->density) / 100;
+       if (cp->walkers != NULL)
+               (void) free((void *) cp->walkers);
+       if ((cp->walkers = (XPoint *) calloc(cp->nwalkers,
+                       sizeof (XPoint))) == NULL) {
+               free_coral(cp);
+               return;
+       }
+
+       cp->seeds = MI_COUNT(mi);
+       if (cp->seeds < -MINSEEDS)
+               cp->seeds = NRAND(-cp->seeds - MINSEEDS + 1) + MINSEEDS;
+       else if (cp->seeds < MINSEEDS)
+               cp->seeds = MINSEEDS;
+
+       MI_CLEARWINDOW(mi);
+
+       if (MI_NPIXELS(mi) > 2) {
+               cp->colorindex = NRAND(MI_NPIXELS(mi) * COLORTHRESH);
+               XSetForeground(display, gc, MI_PIXEL(mi, cp->colorindex / COLORTHRESH));
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       for (i = 0; i < cp->seeds; i++) {
+               int         x, y;
+
+               do {
+                       x = NRAND(cp->width);
+                       y = NRAND(cp->height);
+               } while (getdot(x, y));
+
+               setdot((x - 1), (y - 1));
+               setdot(x, (y - 1));
+               setdot((x + 1), (y - 1));
+               setdot((x - 1), y);
+               setdot(x, y);
+               setdot((x + 1), y);
+               setdot((x - 1), (y + 1));
+               setdot(x, (y + 1));
+               setdot((x + 1), (y + 1));
+               XDrawPoint(display, window, gc, x, y);
+       }
+
+       for (i = 0; i < cp->nwalkers; i++) {
+               cp->walkers[i].x = NRAND(cp->width - 2) + 1;
+               cp->walkers[i].y = NRAND(cp->height - 2) + 1;
+       }
+       if (cp->pointbuf) {
+               (void) free((void *) cp->pointbuf);
+       }
+       if ((cp->pointbuf = (XPoint *) calloc((MAXPOINTS + 2),
+                       sizeof (XPoint))) == NULL) {
+               free_coral(cp);
+               return;
+       }
+}
+
+
+void
+draw_coral(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         npoints = 0;
+       int         i;
+       coralstruct *cp;
+
+       if (reefs == NULL)
+               return;
+       cp = &reefs[MI_SCREEN(mi)];
+       if (cp->reef == NULL)
+               return;
+       
+       MI_IS_DRAWN(mi) = True;
+       for (i = 0; i < cp->nwalkers; i++) {
+               int         x = cp->walkers[i].x;
+               int         y = cp->walkers[i].y;
+
+               if (getdot(x, y)) {
+
+                       /* XDrawPoint(display, window, gc, x, y); */
+                       cp->pointbuf[npoints].x = x;
+                       cp->pointbuf[npoints].y = y;
+                       npoints++;
+
+                       /* Mark the surrounding area as "sticky" */
+                       setdot((x - 1), (y - 1));
+                       setdot(x, (y - 1));
+                       setdot((x + 1), (y - 1));
+                       setdot((x - 1), y);
+                       setdot((x + 1), y);
+                       setdot((x - 1), (y + 1));
+                       setdot(x, (y + 1));
+                       setdot((x + 1), (y + 1));
+                       cp->nwalkers--;
+                       cp->walkers[i].x = cp->walkers[cp->nwalkers].x;
+                       cp->walkers[i].y = cp->walkers[cp->nwalkers].y;
+
+                       if (0 == cp->nwalkers || npoints >= MAXPOINTS) {
+                               XDrawPoints(display, window, gc, cp->pointbuf, npoints,
+                                           CoordModeOrigin);
+                               npoints = 0;
+                       }
+                       if (MI_NPIXELS(mi) > 2) {
+                               XSetForeground(display, gc, MI_PIXEL(mi, cp->colorindex / COLORTHRESH));
+                               if (++cp->colorindex >= MI_NPIXELS(mi) * COLORTHRESH)
+                                       cp->colorindex = 0;
+                       } else
+                               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+                       if (0 == cp->nwalkers) {
+                               if (cp->pointbuf)
+                                       (void) free((void *) cp->pointbuf);
+                               cp->pointbuf = 0;
+                               init_coral(mi);
+                               return;
+                       }
+               } else {
+                       /* move it a notch */
+                       switch (rand_2()) {
+                               case 0:
+                                       if (1 == x)
+                                               continue;
+                                       cp->walkers[i].x--;
+                                       break;
+                               case 1:
+                                       if (cp->width - 2 == x)
+                                               continue;
+                                       cp->walkers[i].x++;
+                                       break;
+                               case 2:
+                                       if (1 == y)
+                                               continue;
+                                       cp->walkers[i].y--;
+                                       break;
+                               default:        /* case 3: */
+                                       if (cp->height - 2 == y)
+                                               continue;
+                                       cp->walkers[i].y++;
+                                       break;
+                       }
+               }
+       }
+
+       if (npoints > 0) {
+               XDrawPoints(display, window, gc, cp->pointbuf, npoints,
+                           CoordModeOrigin);
+       }
+}
+
+void
+release_coral(ModeInfo * mi)
+{
+       if (reefs != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_coral(&reefs[screen]);
+               (void) free((void *) reefs);
+               reefs = NULL;
+       }
+}
+
+#endif /* MODE_coral */
diff --git a/modes/crystal.c b/modes/crystal.c
new file mode 100644 (file)
index 0000000..0ffa331
--- /dev/null
@@ -0,0 +1,1315 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* crystal --- polygons moving according to plane group rules */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)crystal.c    5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The author should like to be notified if changes have been made to the
+ * routine.  Response will only be guaranteed when a VMS version of the
+ * program is available.
+ *
+ * A moving polygon-mode. The polygons obey 2D-planegroup symmetry.
+ *
+ * The groupings of the cells fall in 3 categories:
+ *   oblique groups 1 and 2 where the angle gamma ranges from 60 to 120 degrees
+ *   square groups 3 through 11 where the angle gamma is 90 degrees
+ *   hexagonal groups 12 through 17 where the angle gamma is 120 degrees
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 03-Dec-1998: Random inversion of y-axis included to simulate hexagonal
+ *              groups with an angle of 60 degrees.
+ * 10-Sep-1998: new colour scheme
+ * 24-Feb-1998: added option centre which turns on/off forcing the centre of
+ *              the screen to be used
+ *              added option maxsize which forces the dimensions to be chosen
+ *              in such a way that the largest possible part of the screen is
+ *              used
+ *              When only one unit cell is drawn, it is chosen at random
+ * 18-Feb-1998: added support for negative numbers with -nx and -ny meaning
+ *              "random" choice with given maximum
+ *              added +/-grid option. If -cell is specified this option
+ *              determines if one or all unit cells are drawn.
+ *              -batchcount is now a parameter for all the objects on the
+ *              screen instead of the number of "unique" objects
+ *              The maximum size of the objects now scales with the part
+ *              of the screen used.
+ *              fixed "size" problem. Now very small non-visable objects
+ *              are not allowed
+ * 13-Feb-1998: randomized the unit cell size
+ *              runtime options -/+cell (turn on/off unit cell drawing)
+ *              -nx num (number of translational symmetries in x-direction
+ *              -ny num (idem y-direction but ignored for square and
+ *              hexagonal space groups
+ *              i.e. try xlock -mode crystal -nx 3 -ny 2
+ *              Fullrandom overrules the -/+cell option.
+ * 05-Feb-1998: Revision + bug repairs
+ *              shows unit cell
+ *              use part of the screen for unit cell
+ *              in hexagonal and square groups a&b axis forced to be equal
+ *              cell angle for oblique groups randomly chosen between 60 and 120
+ *              bugs solved: planegroups with cell angles <> 90.0 now work
+ *              properly
+ * 19-Sep-1997: Added remaining hexagonal groups
+ * 12-Jun-1997: Created
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Crystal"
+#define HACK_INIT init_crystal
+#define HACK_DRAW draw_crystal
+#define crystal_opts xlockmore_opts
+#define DEFAULTS "*delay: 60000 \n" \
+ "*count: -500 \n" \
+ "*cycles: 200 \n" \
+ "*size: -15 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+
+#ifdef MODE_crystal
+
+#define DEF_CELL "True"                /* Draw unit cell */
+#define DEF_GRID "False"       /* Draw unit all cell if DEF_CELL is True */
+#define DEF_NX "-3"            /* number of unit cells in x-direction */
+#define DEF_NX1 1              /* number of unit cells in x-direction */
+#define DEF_NY "-3"            /* number of unit cells in y-direction */
+#define DEF_NY1 1              /* number of unit cells in y-direction */
+#define DEF_CENTRE "False"
+#define DEF_MAXSIZE "False"
+#define DEF_CYCLE "True"
+
+#define min(a,b) ((a) <= (b) ? (a) : (b))
+
+static int  nx, ny;
+
+static Bool unit_cell, grid_cell, centre, maxsize, cycle_p;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-nx", (char *) "crystal.nx", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-ny", (char *) "crystal.ny", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-centre", (char *) ".crystal.centre", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+centre", (char *) ".crystal.centre", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-maxsize", (char *) ".crystal.maxsize", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+maxsize", (char *) ".crystal.maxsize", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-cell", (char *) ".crystal.cell", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+cell", (char *) ".crystal.cell", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-grid", (char *) ".crystal.grid", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+grid", (char *) ".crystal.grid", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-cycle", (char *) ".crystal.cycle", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+cycle", (char *) ".crystal.cycle", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & nx, (char *) "nx", (char *) "nx", (char *) DEF_NX, t_Int},
+       {(caddr_t *) & ny, (char *) "ny", (char *) "ny", (char *) DEF_NY, t_Int},
+       {(caddr_t *) & centre, (char *) "centre", (char *) "Centre", (char *) DEF_CENTRE, t_Bool},
+       {(caddr_t *) & maxsize, (char *) "maxsize", (char *) "Maxsize", (char *) DEF_MAXSIZE, t_Bool},
+       {(caddr_t *) & unit_cell, (char *) "cell", (char *) "Cell", (char *) DEF_CELL, t_Bool},
+       {(caddr_t *) & grid_cell, (char *) "grid", (char *) "Grid", (char *) DEF_GRID, t_Bool},
+       {(caddr_t *) & cycle_p, (char *) "cycle", (char *) "Cycle", (char *) DEF_CYCLE, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-nx num", (char *) "Number of unit cells in x-direction"},
+       {(char *) "-ny num", (char *) "Number of unit cells in y-direction"},
+       {(char *) "-/+centre", (char *) "turn on/off centering on screen"},
+       {(char *) "-/+maxsize", (char *) "turn on/off use of maximum part of screen"},
+       {(char *) "-/+cell", (char *) "turn on/off drawing of unit cell"},
+       {(char *) "-/+grid", (char *) "turn on/off drawing of grid of unit cells (if -cell is on)"},
+       {(char *) "-/+cycle", (char *) "turn on/off colour cycling"}
+};
+
+ModeSpecOpt crystal_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   crystal_description =
+{"crystal", "init_crystal", "draw_crystal", "release_crystal",
+ "refresh_crystal", "init_crystal", NULL, &crystal_opts,
+ 60000, -40, 200, -15, 64, 1.0, "",
+ "Shows polygons in 2D plane groups", 0, NULL};
+
+#endif
+
+#define DEF_NUM_ATOM 10
+
+#define DEF_SIZ_ATOM 10
+
+#define PI_RAD (M_PI / 180.0)
+
+static Bool centro[17] =
+{
+       False,
+       True,
+       False,
+       False,
+       False,
+       True,
+       True,
+       True,
+       True,
+       True,
+       True,
+       True,
+       False,
+       False,
+       False,
+       True,
+       True
+};
+
+static Bool primitive[17] =
+{
+       True,
+       True,
+       True,
+       True,
+       False,
+       True,
+       True,
+       True,
+       False,
+       True,
+       True,
+       True,
+       True,
+       True,
+       True,
+       True,
+       True
+};
+
+static short numops[34] =
+{
+       1, 0,
+       1, 0,
+       9, 7,
+       2, 0,
+       9, 7,
+       9, 7,
+       4, 2,
+       5, 3,
+       9, 7,
+       8, 6,
+       10, 6,
+       8, 4,
+       16, 13,
+       19, 13,
+       16, 10,
+       19, 13,
+       19, 13
+};
+
+static short operation[114] =
+{
+       1, 0, 0, 1, 0, 0,
+       -1, 0, 0, 1, 0, 1,
+       -1, 0, 0, 1, 1, 0,
+       1, 0, 0, 1, 0, 0,
+       -1, 0, 0, 1, 1, 1,
+       1, 0, 0, 1, 1, 1,
+       0, -1, 1, 0, 0, 0,
+       1, 0, 0, 1, 0, 0,
+       -1, 0, 0, 1, 0, 0,
+       0, 1, 1, 0, 0, 0,
+       -1, 0, -1, 1, 0, 0,
+       1, -1, 0, -1, 0, 0,
+       0, 1, 1, 0, 0, 0,
+       0, -1, 1, -1, 0, 0,
+       -1, 1, -1, 0, 0, 0,
+       1, 0, 0, 1, 0, 0,
+       0, -1, -1, 0, 0, 0,
+       -1, 1, 0, 1, 0, 0,
+       1, 0, 1, -1, 0, 0
+};
+
+typedef struct {
+       unsigned long colour;
+       int         x0, y0, velocity[2];
+       float       angle, velocity_a;
+       int         num_point, at_type, size_at;
+       XPoint      xy[5];
+} crystalatom;
+
+typedef struct {
+       Bool        painted;
+       int         win_width, win_height, num_atom;
+       int         planegroup, a, b, offset_w, offset_h, nx, ny;
+       float       gamma;
+       crystalatom *atom;
+       GC          gc;
+       Bool        unit_cell, grid_cell;
+       Colormap    cmap;
+       XColor     *colors;
+       int         ncolors;
+       Bool        cycle_p, mono_p, no_colors;
+       unsigned long blackpixel, whitepixel, fg, bg;
+       int         direction , invert;
+       ModeInfo   *mi;
+} crystalstruct;
+
+static crystalstruct *crystals = NULL;
+
+static void
+trans_coor(XPoint * xyp, XPoint * new_xyp, int num_points,
+          float gamma )
+{
+       int         i;
+
+       for (i = 0; i <= num_points; i++) {
+               new_xyp[i].x = xyp[i].x +
+                       (int) (xyp[i].y * sin((gamma - 90.0) * PI_RAD));
+               new_xyp[i].y = (int) (xyp[i].y / cos((gamma - 90.0) * PI_RAD));
+       }
+}
+
+static void
+trans_coor_back(XPoint * xyp, XPoint * new_xyp,
+               int num_points, float gamma, int offset_w, int offset_h ,
+               int winheight , int invert )
+{
+       int         i;
+
+       for (i = 0; i <= num_points; i++) {
+               new_xyp[i].y = (int) (xyp[i].y * cos((gamma - 90) * PI_RAD)) +
+                       offset_h;
+               new_xyp[i].x = xyp[i].x - (int) (xyp[i].y * sin((gamma - 90.0)
+                                                      * PI_RAD)) + offset_w;
+          if ( invert ) new_xyp[i].y = winheight - new_xyp[i].y;
+       }
+}
+
+static void
+crystal_setupatom(crystalatom * atom0, float gamma)
+{
+       XPoint      xy[5];
+       int         x0, y0;
+
+       y0 = (int) (atom0->y0 * cos((gamma - 90) * PI_RAD));
+       x0 = atom0->x0 - (int) (atom0->y0 * sin((gamma - 90.0) * PI_RAD));
+       switch (atom0->at_type) {
+               case 0: /* rectangles */
+                       xy[0].x = x0 + (int) (2 * atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (atom0->size_at * sin(atom0->angle));
+                       xy[0].y = y0 + (int) (atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (2 * atom0->size_at * sin(atom0->angle));
+                       xy[1].x = x0 + (int) (2 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (atom0->size_at * sin(atom0->angle));
+                       xy[1].y = y0 - (int) (atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (2 * atom0->size_at * sin(atom0->angle));
+                       xy[2].x = x0 - (int) (2 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (atom0->size_at * sin(atom0->angle));
+                       xy[2].y = y0 - (int) (atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (2 * atom0->size_at * sin(atom0->angle));
+                       xy[3].x = x0 - (int) (2 * atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (atom0->size_at * sin(atom0->angle));
+                       xy[3].y = y0 + (int) (atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (2 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[4].x = xy[0].x;
+                       xy[4].y = xy[0].y;
+                       trans_coor(xy, atom0->xy, 4, gamma);
+                       return;
+               case 1: /* squares */
+                       xy[0].x = x0 + (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[0].y = y0 + (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[1].x = x0 + (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[1].y = y0 - (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[2].x = x0 - (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[2].y = y0 - (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[3].x = x0 - (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[3].y = y0 + (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[4].x = xy[0].x;
+                       xy[4].y = xy[0].y;
+                       trans_coor(xy, atom0->xy, 4, gamma);
+                       return;
+               case 2: /* triangles */
+                       xy[0].x = x0 + (int) (1.5 * atom0->size_at *
+                                             sin(atom0->angle));
+                       xy[0].y = y0 + (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle));
+                       xy[1].x = x0 + (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[1].y = y0 - (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[2].x = x0 - (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) -
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[2].y = y0 - (int) (1.5 * atom0->size_at *
+                                             cos(atom0->angle)) +
+                               (int) (1.5 * atom0->size_at *
+                                      sin(atom0->angle));
+                       xy[3].x = xy[0].x;
+                       xy[3].y = xy[0].y;
+                       trans_coor(xy, atom0->xy, 3, gamma);
+                       return;
+       }
+}
+
+static void
+crystal_drawatom(ModeInfo * mi, crystalatom * atom0)
+{
+       crystalstruct *cryst;
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         j, k, l, m;
+
+       cryst = &crystals[MI_SCREEN(mi)];
+       for (j = numops[2 * cryst->planegroup + 1];
+            j < numops[2 * cryst->planegroup]; j++) {
+               XPoint      xy[5], new_xy[5];
+               XPoint      xy_1[5];
+               int         xtrans, ytrans;
+
+               xtrans = operation[j * 6] * atom0->x0 + operation[j * 6 + 1] *
+                       atom0->y0 + (int) (operation[j * 6 + 4] * cryst->a /
+                                          2.0);
+               ytrans = operation[j * 6 + 2] * atom0->x0 + operation[j * 6 +
+                              3] * atom0->y0 + (int) (operation[j * 6 + 5] *
+                                                      cryst->b / 2.0);
+               if (xtrans < 0) {
+                       if (xtrans < -cryst->a)
+                               xtrans = 2 * cryst->a;
+                       else
+                               xtrans = cryst->a;
+               } else if (xtrans >= cryst->a)
+                       xtrans = -cryst->a;
+               else
+                       xtrans = 0;
+               if (ytrans < 0)
+                       ytrans = cryst->b;
+               else if (ytrans >= cryst->b)
+                       ytrans = -cryst->b;
+               else
+                       ytrans = 0;
+               for (k = 0; k < atom0->num_point; k++) {
+                       xy[k].x = operation[j * 6] * atom0->xy[k].x +
+                               operation[j * 6 + 1] *
+                               atom0->xy[k].y + (int) (operation[j * 6 + 4] *
+                                                       cryst->a / 2.0) +
+                               xtrans;
+                       xy[k].y = operation[j * 6 + 2] * atom0->xy[k].x +
+                               operation[j * 6 + 3] *
+                               atom0->xy[k].y + (int) (operation[j * 6 + 5] *
+                                                       cryst->b / 2.0) +
+                               ytrans;
+               }
+               xy[atom0->num_point].x = xy[0].x;
+               xy[atom0->num_point].y = xy[0].y;
+               for (l = 0; l < cryst->nx; l++) {
+                       for (m = 0; m < cryst->ny; m++) {
+
+                               for (k = 0; k <= atom0->num_point; k++) {
+                                       xy_1[k].x = xy[k].x + l * cryst->a;
+                                       xy_1[k].y = xy[k].y + m * cryst->b;
+                               }
+                               trans_coor_back(xy_1, new_xy, atom0->num_point,
+                                               cryst->gamma, cryst->offset_w,
+                                               cryst->offset_h ,
+                                               cryst->win_height,
+                                               cryst->invert);
+                               XFillPolygon(display, window, cryst->gc, new_xy,
+                                 atom0->num_point, Convex, CoordModeOrigin);
+                       }
+               }
+               if (centro[cryst->planegroup] == True) {
+                       for (k = 0; k <= atom0->num_point; k++) {
+                               xy[k].x = cryst->a - xy[k].x;
+                               xy[k].y = cryst->b - xy[k].y;
+                       }
+                       for (l = 0; l < cryst->nx; l++) {
+                               for (m = 0; m < cryst->ny; m++) {
+
+                                       for (k = 0; k <= atom0->num_point; k++) {
+                                               xy_1[k].x = xy[k].x + l * cryst->a;
+                                               xy_1[k].y = xy[k].y + m * cryst->b;
+                                       }
+                                       trans_coor_back(xy_1, new_xy, atom0->num_point,
+                                                       cryst->gamma,
+                                                       cryst->offset_w,
+                                                       cryst->offset_h ,
+                                                       cryst->win_height ,
+                                                       cryst->invert);
+                                       XFillPolygon(display, window, cryst->gc,
+                                                    new_xy,
+                                                    atom0->num_point, Convex,
+                                                    CoordModeOrigin);
+                               }
+                       }
+               }
+               if (primitive[cryst->planegroup] == False) {
+                       if (xy[atom0->num_point].x >= (int) (cryst->a / 2.0))
+                               xtrans = (int) (-cryst->a / 2.0);
+                       else
+                               xtrans = (int) (cryst->a / 2.0);
+                       if (xy[atom0->num_point].y >= (int) (cryst->b / 2.0))
+                               ytrans = (int) (-cryst->b / 2.0);
+                       else
+                               ytrans = (int) (cryst->b / 2.0);
+                       for (k = 0; k <= atom0->num_point; k++) {
+                               xy[k].x = xy[k].x + xtrans;
+                               xy[k].y = xy[k].y + ytrans;
+                       }
+                       for (l = 0; l < cryst->nx; l++) {
+                               for (m = 0; m < cryst->ny; m++) {
+
+                                       for (k = 0; k <= atom0->num_point; k++) {
+                                               xy_1[k].x = xy[k].x + l * cryst->a;
+                                               xy_1[k].y = xy[k].y + m * cryst->b;
+                                       }
+                                       trans_coor_back(xy_1, new_xy, atom0->num_point,
+                                                       cryst->gamma,
+                                                       cryst->offset_w,
+                                                       cryst->offset_h ,
+                                                       cryst->win_height,
+                                                       cryst->invert);
+                                       XFillPolygon(display, window, cryst->gc,
+                                                    new_xy,
+                                                    atom0->num_point, Convex,
+                                                    CoordModeOrigin);
+                               }
+                       }
+                       if (centro[cryst->planegroup] == True) {
+                               XPoint      xy1[5];
+
+                               for (k = 0; k <= atom0->num_point; k++) {
+                                       xy1[k].x = cryst->a - xy[k].x;
+                                       xy1[k].y = cryst->b - xy[k].y;
+                               }
+                               for (l = 0; l < cryst->nx; l++) {
+                                       for (m = 0; m < cryst->ny; m++) {
+
+                                               for (k = 0; k <= atom0->num_point; k++) {
+                                                       xy_1[k].x = xy1[k].x + l * cryst->a;
+                                                       xy_1[k].y = xy1[k].y + m * cryst->b;
+                                               }
+                                               trans_coor_back(xy_1, new_xy, atom0->num_point,
+                                                               cryst->gamma,
+                                                               cryst->offset_w,
+                                                               cryst->offset_h ,
+                                                               cryst->win_height,
+                                                               cryst->invert);
+                                               XFillPolygon(display, window,
+                                                            cryst->gc,
+                                                   new_xy, atom0->num_point,
+                                                   Convex, CoordModeOrigin);
+                                       }
+                               }
+                       }
+               }
+       }
+}
+
+static void
+free_crystal(Display *display, crystalstruct *cryst)
+{
+       ModeInfo *mi = cryst->mi;
+
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               MI_WHITE_PIXEL(mi) = cryst->whitepixel;
+               MI_BLACK_PIXEL(mi) = cryst->blackpixel;
+#ifndef STANDALONE
+               MI_FG_PIXEL(mi) = cryst->fg;
+               MI_BG_PIXEL(mi) = cryst->bg;
+#endif
+               if (cryst->colors != NULL) {
+                       if (cryst->ncolors && !cryst->no_colors)
+                               free_colors(display, cryst->cmap, cryst->colors, cryst->ncolors);
+                       (void) free((void *) cryst->colors);
+                       cryst->colors = NULL;
+               }
+               if (cryst->cmap != None) {
+                       XFreeColormap(display, cryst->cmap);
+                       cryst->cmap = None;
+               }
+       }
+       if (cryst->gc != None) {
+               XFreeGC(display, cryst->gc);
+               cryst->gc = None;
+       }
+       if (cryst->atom != NULL) {
+               (void) free((void *) cryst->atom);
+               cryst->atom = NULL;
+       }
+}
+
+void
+init_crystal(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       crystalstruct *cryst;
+       int         i, max_atoms, size_atom, neqv;
+       int         cell_min;
+
+#define MIN_CELL 200
+
+/* initialize */
+       if (crystals == NULL) {
+               if ((crystals = (crystalstruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (crystalstruct))) == NULL)
+                       return;
+       }
+       cryst = &crystals[MI_SCREEN(mi)];
+       cryst->mi = mi;
+
+       if (!cryst->gc) {
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XColor      color;
+
+#ifndef STANDALONE
+                       extern char *background;
+                       extern char *foreground;
+
+                       cryst->fg = MI_FG_PIXEL(mi);
+                       cryst->bg = MI_BG_PIXEL(mi);
+#endif
+                       cryst->blackpixel = MI_BLACK_PIXEL(mi);
+                       cryst->whitepixel = MI_WHITE_PIXEL(mi);
+                       if ((cryst->cmap = XCreateColormap(display, window,
+                                       MI_VISUAL(mi), AllocNone)) == None) {
+                               free_crystal(display, cryst);
+                               return;
+                       }
+                       XSetWindowColormap(display, window, cryst->cmap);
+                       (void) XParseColor(display, cryst->cmap, "black", &color);
+                       (void) XAllocColor(display, cryst->cmap, &color);
+                       MI_BLACK_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, cryst->cmap, "white", &color);
+                       (void) XAllocColor(display, cryst->cmap, &color);
+                       MI_WHITE_PIXEL(mi) = color.pixel;
+#ifndef STANDALONE
+                       (void) XParseColor(display, cryst->cmap, background, &color);
+                       (void) XAllocColor(display, cryst->cmap, &color);
+                       MI_BG_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, cryst->cmap, foreground, &color);
+                       (void) XAllocColor(display, cryst->cmap, &color);
+                       MI_FG_PIXEL(mi) = color.pixel;
+#endif
+                       cryst->colors = NULL;
+                       cryst->ncolors = 0;
+               }
+               if ((cryst->gc = XCreateGC(display, MI_WINDOW(mi),
+                            (unsigned long) 0, (XGCValues *) NULL)) == None) {
+                       free_crystal(display, cryst);
+                       return;
+               }
+       }
+/* Clear Display */
+       MI_CLEARWINDOW(mi);
+       cryst->painted = False;
+
+
+/*Set up crystal data */
+       cryst->direction = (LRAND() & 1) ? 1 : -1;
+       if (MI_IS_FULLRANDOM(mi)) {
+               if (LRAND() & 1)
+                       cryst->unit_cell = True;
+               else
+                       cryst->unit_cell = False;
+       } else
+               cryst->unit_cell = unit_cell;
+       if (cryst->unit_cell) {
+               if (MI_IS_FULLRANDOM(mi)) {
+                       if (LRAND() & 1)
+                               cryst->grid_cell = True;
+                       else
+                               cryst->grid_cell = False;
+               } else
+                       cryst->grid_cell = grid_cell;
+       }
+       cryst->win_width = MI_WIDTH(mi);
+       cryst->win_height = MI_HEIGHT(mi);
+       cell_min = min(cryst->win_width / 2 + 1, MIN_CELL);
+       cell_min = min(cell_min, cryst->win_height / 2 + 1);
+       cryst->planegroup = NRAND(17);
+        cryst->invert = NRAND(2);
+       if (MI_IS_VERBOSE(mi))
+               (void) fprintf(stdout, "Selected plane group no %d\n",
+                              cryst->planegroup + 1);
+       if (cryst->planegroup > 11)
+               cryst->gamma = 120.0;
+       else if (cryst->planegroup < 2)
+               cryst->gamma = 60.0 + NRAND(60);
+       else
+               cryst->gamma = 90.0;
+       neqv = numops[2 * cryst->planegroup] - numops[2 * cryst->planegroup + 1];
+       if (centro[cryst->planegroup] == True)
+               neqv = 2 * neqv;
+       if (primitive[cryst->planegroup] == False)
+               neqv = 2 * neqv;
+
+
+       if (nx > 0)
+               cryst->nx = nx;
+       else if (nx < 0)
+               cryst->nx = NRAND(-nx) + 1;
+       else
+               cryst->nx = DEF_NX1;
+       if (cryst->planegroup > 8)
+               cryst->ny = cryst->nx;
+       else if (ny > 0)
+               cryst->ny = ny;
+       else if (ny < 0)
+               cryst->ny = NRAND(-ny) + 1;
+       else
+               cryst->ny = DEF_NY1;
+       neqv = neqv * cryst->nx * cryst->ny;
+
+       cryst->num_atom = MI_COUNT(mi);
+       max_atoms = MI_COUNT(mi);
+       if (cryst->num_atom == 0) {
+               cryst->num_atom = DEF_NUM_ATOM;
+               max_atoms = DEF_NUM_ATOM;
+       } else if (cryst->num_atom < 0) {
+               max_atoms = -cryst->num_atom;
+               cryst->num_atom = NRAND(-cryst->num_atom) + 1;
+       }
+       if (neqv > 1)
+               cryst->num_atom = cryst->num_atom / neqv + 1;
+
+       if (cryst->atom == NULL)
+               if ((cryst->atom = (crystalatom *) calloc(max_atoms,
+                               sizeof (crystalatom))) == NULL) {
+                       free_crystal(display, cryst);
+                       return;
+               }
+
+       if (maxsize) {
+               if (cryst->planegroup < 13) {
+                       cryst->gamma = 90.0;
+                       cryst->offset_w = 0;
+                       cryst->offset_h = 0;
+                       if (cryst->planegroup < 10) {
+                               cryst->b = cryst->win_height;
+                               cryst->a = cryst->win_width;
+                       } else {
+                               cryst->b = min(cryst->win_height, cryst->win_width);
+                               cryst->a = cryst->b;
+                       }
+               } else {
+                       cryst->gamma = 120.0;
+                       cryst->a = (int) (cryst->win_width * 2.0 / 3.0);
+                       cryst->b = cryst->a;
+                       cryst->offset_h = (int) (cryst->b * 0.25 *
+                                         cos((cryst->gamma - 90) * PI_RAD));
+                       cryst->offset_w = (int) (cryst->b * 0.5);
+               }
+       } else {
+               cryst->offset_w = -1;
+               while (cryst->offset_w < 4 || (int) (cryst->offset_w - cryst->b *
+                                   sin((cryst->gamma - 90) * PI_RAD)) < 4) {
+                       cryst->b = NRAND((int) (cryst->win_height / (cos((cryst->gamma - 90) *
+                                           PI_RAD))) - cell_min) + cell_min;
+                       if (cryst->planegroup > 8)
+                               cryst->a = cryst->b;
+                       else
+                               cryst->a = NRAND(cryst->win_width - cell_min) + cell_min;
+                       cryst->offset_w = (int) ((cryst->win_width - (cryst->a - cryst->b *
+                                                   sin((cryst->gamma - 90) *
+                                                       PI_RAD))) / 2.0);
+               }
+               cryst->offset_h = (int) ((cryst->win_height - cryst->b * cos((
+                                       cryst->gamma - 90) * PI_RAD)) / 2.0);
+               if (!centre) {
+                       if (cryst->offset_h > 0)
+                               cryst->offset_h = NRAND(2 * cryst->offset_h);
+                       cryst->offset_w = (int) (cryst->win_width - cryst->a -
+                                                cryst->b *
+                                   fabs(sin((cryst->gamma - 90) * PI_RAD)));
+                       if (cryst->gamma > 90.0) {
+                               if (cryst->offset_w > 0)
+                                       cryst->offset_w = NRAND(cryst->offset_w) +
+                                               (int) (cryst->b * sin((cryst->gamma - 90) * PI_RAD));
+                               else
+                                       cryst->offset_w = (int) (cryst->b * sin((cryst->gamma - 90) *
+                                                                   PI_RAD));
+                       } else if (cryst->offset_w > 0)
+                               cryst->offset_w = NRAND(cryst->offset_w);
+                       else
+                               cryst->offset_w = 0;
+               }
+       }
+
+       size_atom = min((int) ((float) (cryst->a) / 40.) + 1,
+                       (int) ((float) (cryst->b) / 40.) + 1);
+       if (MI_SIZE(mi) < size_atom) {
+               if (MI_SIZE(mi) < -size_atom)
+                       size_atom = -size_atom;
+               else
+                       size_atom = MI_SIZE(mi);
+       }
+       cryst->a = cryst->a / cryst->nx;
+       cryst->b = cryst->b / cryst->ny;
+       if (cryst->unit_cell) {
+          int y_coor1 , y_coor2;
+
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, cryst->gc, MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+               else
+                       XSetForeground(display, cryst->gc, MI_WHITE_PIXEL(mi));
+               if (cryst->grid_cell) {
+                       int         inx, iny;
+
+                  if ( cryst->invert )
+                    y_coor1 = y_coor2 = cryst->win_height - cryst->offset_h;
+                  else
+                    y_coor1 = y_coor2 = cryst->offset_h;
+                       XDrawLine(display, window, cryst->gc, cryst->offset_w,
+                                 y_coor1, cryst->offset_w + cryst->nx * cryst->a,
+                                 y_coor2);
+                  if ( cryst->invert )
+                    {
+                       y_coor1 = cryst->win_height - cryst->offset_h;
+                       y_coor2 = cryst->win_height - (int) (cryst->ny *
+                                                            cryst->b *
+                                        cos((cryst->gamma - 90) * PI_RAD)) -
+                         cryst->offset_h;
+                    }
+                  else
+                    {
+                       y_coor1 = cryst->offset_h;
+                       y_coor2 = (int) (cryst->ny * cryst->b *
+                                        cos((cryst->gamma - 90) * PI_RAD)) +
+                         cryst->offset_h;
+                    }
+                       XDrawLine(display, window, cryst->gc, cryst->offset_w,
+                                 y_coor1, (int) (cryst->offset_w - cryst->ny * cryst->b *
+                                         sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+                       inx = cryst->nx;
+                       for (iny = 1; iny <= cryst->ny; iny++) {
+                  if ( cryst->invert )
+                    {
+                       y_coor1 = cryst->win_height -
+                         (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+                                                 PI_RAD)) - cryst->offset_h;
+                       y_coor2 = cryst->win_height -
+                         (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+                                                     PI_RAD)) -
+                         cryst->offset_h;
+                    }
+                  else
+                    {
+                       y_coor1 = (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+                                                 PI_RAD)) + cryst->offset_h;
+                       y_coor2 = (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) +
+                                         cryst->offset_h;
+                    }
+                               XDrawLine(display, window, cryst->gc,
+                                         (int) (cryst->offset_w +
+                                    inx * cryst->a - (int) (iny * cryst->b *
+                                        sin((cryst->gamma - 90) * PI_RAD))),
+                                         y_coor1,
+                                   (int) (cryst->offset_w - iny * cryst->b *
+                                          sin((cryst->gamma - 90) * PI_RAD)),
+                                         y_coor2);
+                       }
+                       iny = cryst->ny;
+                       for (inx = 1; inx <= cryst->nx; inx++) {
+                          if ( cryst->invert )
+                            {
+                               y_coor1 =cryst->win_height -
+                                 (int) (iny * cryst->b *
+                                               cos((cryst->gamma - 90) *
+                                                   PI_RAD)) - cryst->offset_h;
+                               y_coor2 =cryst->win_height - cryst->offset_h;
+                            }
+                          else
+                            {
+                               y_coor1 =(int) (iny * cryst->b *
+                                               cos((cryst->gamma - 90) *
+                                                   PI_RAD)) + cryst->offset_h;
+                               y_coor2 =cryst->offset_h;
+                            }
+                               XDrawLine(display, window, cryst->gc,
+                                         (int) (cryst->offset_w +
+                                    inx * cryst->a - (int) (iny * cryst->b *
+                                        sin((cryst->gamma - 90) * PI_RAD))),
+                                         y_coor1,
+                                         cryst->offset_w + inx * cryst->a,
+                                         y_coor2);
+                       }
+               } else {
+                       int         inx, iny;
+
+                       inx = NRAND(cryst->nx);
+                       iny = NRAND(cryst->ny);
+                  if ( cryst->invert )
+                    {
+                       y_coor1 =cryst->win_height -
+                         (int) (iny * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) -
+                         cryst->offset_h;
+                       y_coor2 =cryst->win_height -
+                         (int) ( ( iny + 1 ) * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) -
+                         cryst->offset_h;
+                    }
+                  else
+                    {
+                       y_coor1 =(int) (iny * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) +
+                         cryst->offset_h;
+                       y_coor2 =(int) (( iny + 1 ) * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) +
+                         cryst->offset_h;
+                    }
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1);
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1,
+                                 cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+               }
+       }
+       XSetFunction(display, cryst->gc, GXxor);
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+/* Set up colour map */
+               if (cryst->colors != NULL) {
+                       if (cryst->ncolors && !cryst->no_colors)
+                               free_colors(display, cryst->cmap, cryst->colors, cryst->ncolors);
+                       (void) free((void *) cryst->colors);
+                       cryst->colors = NULL;
+               }
+               cryst->ncolors = MI_NCOLORS(mi);
+               if (cryst->ncolors < 2)
+                       cryst->ncolors = 2;
+               if (cryst->ncolors <= 2)
+                       cryst->mono_p = True;
+               else
+                       cryst->mono_p = False;
+
+               if (cryst->mono_p)
+                       cryst->colors = NULL;
+               else
+                       if ((cryst->colors = (XColor *) malloc(sizeof (*cryst->colors) *
+                                       (cryst->ncolors + 1))) == NULL) {
+                               free_crystal(display, cryst);
+                               return;
+                       }
+               cryst->cycle_p = has_writable_cells(mi);
+               if (cryst->cycle_p) {
+                       if (MI_IS_FULLRANDOM(mi)) {
+                               if (!NRAND(8))
+                                       cryst->cycle_p = False;
+                               else
+                                       cryst->cycle_p = True;
+                       } else {
+                               cryst->cycle_p = cycle_p;
+                       }
+               }
+               if (!cryst->mono_p) {
+                       if (!(LRAND() % 10))
+                               make_random_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                                               cryst->cmap, cryst->colors, &cryst->ncolors,
+                                               True, True, &cryst->cycle_p);
+                       else if (!(LRAND() % 2))
+                               make_uniform_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                  cryst->cmap, cryst->colors, &cryst->ncolors,
+                                                     True, &cryst->cycle_p);
+                       else
+                               make_smooth_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                 cryst->cmap, cryst->colors, &cryst->ncolors,
+                                                    True, &cryst->cycle_p);
+               }
+               XInstallColormap(display, cryst->cmap);
+               if (cryst->ncolors < 2) {
+                       cryst->ncolors = 2;
+                       cryst->no_colors = True;
+               } else
+                       cryst->no_colors = False;
+               if (cryst->ncolors <= 2)
+                       cryst->mono_p = True;
+
+               if (cryst->mono_p)
+                       cryst->cycle_p = False;
+
+       }
+       for (i = 0; i < cryst->num_atom; i++) {
+               crystalatom *atom0;
+
+               atom0 = &cryst->atom[i];
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       if (cryst->ncolors > 2)
+                               atom0->colour = NRAND(cryst->ncolors - 2) + 2;
+                       else
+                               atom0->colour = 1;      /* Just in case */
+                       XSetForeground(display, cryst->gc, cryst->colors[atom0->colour].pixel);
+               } else {
+                       if (MI_NPIXELS(mi) > 2)
+                               atom0->colour = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       else
+                               atom0->colour = 1;      /*Xor'red so WHITE may not be appropriate */
+                       XSetForeground(display, cryst->gc, atom0->colour);
+               }
+               atom0->x0 = NRAND(cryst->a);
+               atom0->y0 = NRAND(cryst->b);
+               atom0->velocity[0] = NRAND(7) - 3;
+               atom0->velocity[1] = NRAND(7) - 3;
+               atom0->velocity_a = (NRAND(7) - 3) * PI_RAD;
+               atom0->angle = NRAND(90) * PI_RAD;
+               atom0->at_type = NRAND(3);
+               if (size_atom == 0)
+                       atom0->size_at = DEF_SIZ_ATOM;
+               else if (size_atom > 0)
+                       atom0->size_at = size_atom;
+               else
+                       atom0->size_at = NRAND(-size_atom) + 1;
+               atom0->size_at++;
+               if (atom0->at_type == 2)
+                       atom0->num_point = 3;
+               else
+                       atom0->num_point = 4;
+               crystal_setupatom(atom0, cryst->gamma);
+               crystal_drawatom(mi, atom0);
+       }
+       XFlush(display);
+       XSetFunction(display, cryst->gc, GXcopy);
+}
+
+void
+draw_crystal(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         i;
+       crystalstruct *cryst;
+
+       if (crystals == NULL)
+               return;
+       cryst = &crystals[MI_SCREEN(mi)];
+       if (cryst->atom == NULL)
+               return;
+
+       if (cryst->no_colors) {
+               free_crystal(display, cryst);
+               init_crystal(mi);
+               return;
+       }
+       cryst->painted = True;
+       MI_IS_DRAWN(mi) = True;
+       XSetFunction(display, cryst->gc, GXxor);
+
+/* Rotate colours */
+       if (cryst->cycle_p) {
+               rotate_colors(display, cryst->cmap, cryst->colors, cryst->ncolors,
+                             cryst->direction);
+               if (!(LRAND() % 1000))
+                       cryst->direction = -cryst->direction;
+       }
+       for (i = 0; i < cryst->num_atom; i++) {
+               crystalatom *atom0;
+
+               atom0 = &cryst->atom[i];
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, cryst->gc, cryst->colors[atom0->colour].pixel);
+               } else {
+                       XSetForeground(display, cryst->gc, atom0->colour);
+               }
+               crystal_drawatom(mi, atom0);
+               atom0->velocity[0] += NRAND(3) - 1;
+               atom0->velocity[0] = MAX(-20, MIN(20, atom0->velocity[0]));
+               atom0->velocity[1] += NRAND(3) - 1;
+               atom0->velocity[1] = MAX(-20, MIN(20, atom0->velocity[1]));
+               atom0->x0 += atom0->velocity[0];
+               /*if (cryst->gamma == 90.0) { */
+               if (atom0->x0 < 0)
+                       atom0->x0 += cryst->a;
+               else if (atom0->x0 >= cryst->a)
+                       atom0->x0 -= cryst->a;
+               atom0->y0 += atom0->velocity[1];
+               if (atom0->y0 < 0)
+                       atom0->y0 += cryst->b;
+               else if (atom0->y0 >= cryst->b)
+                       atom0->y0 -= cryst->b;
+               /*} */
+               atom0->velocity_a += ((float) NRAND(1001) - 500.0) / 2000.0;
+               atom0->angle += atom0->velocity_a;
+               crystal_setupatom(atom0, cryst->gamma);
+               crystal_drawatom(mi, atom0);
+       }
+       XSetFunction(display, cryst->gc, GXcopy);
+}
+
+void
+refresh_crystal(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i;
+       crystalstruct *cryst;
+
+       if (crystals == NULL)
+               return;
+       cryst = &crystals[MI_SCREEN(mi)];
+       if (cryst->atom == NULL)
+               return;
+
+       if (!cryst->painted)
+               return;
+       MI_CLEARWINDOW(mi);
+
+       if (cryst->unit_cell) {
+          int y_coor1 , y_coor2;
+
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, cryst->gc, MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+               else
+                       XSetForeground(display, cryst->gc, MI_WHITE_PIXEL(mi));
+               if (cryst->grid_cell) {
+                       int         inx, iny;
+
+                  if ( cryst->invert )
+                    y_coor1 = y_coor2 = cryst->win_height - cryst->offset_h;
+                  else
+                    y_coor1 = y_coor2 = cryst->offset_h;
+                       XDrawLine(display, window, cryst->gc, cryst->offset_w,
+                                 y_coor1, cryst->offset_w + cryst->nx * cryst->a,
+                                 y_coor2);
+                  if ( cryst->invert )
+                    {
+                       y_coor1 = cryst->win_height - cryst->offset_h;
+                       y_coor2 = cryst->win_height - (int) (cryst->ny *
+                                                            cryst->b *
+                                        cos((cryst->gamma - 90) * PI_RAD)) -
+                         cryst->offset_h;
+                    }
+                  else
+                    {
+                       y_coor1 = cryst->offset_h;
+                       y_coor2 = (int) (cryst->ny * cryst->b *
+                                        cos((cryst->gamma - 90) * PI_RAD)) +
+                         cryst->offset_h;
+                    }
+                       XDrawLine(display, window, cryst->gc, cryst->offset_w,
+                                 y_coor1, (int) (cryst->offset_w - cryst->ny * cryst->b *
+                                         sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+                       inx = cryst->nx;
+                       for (iny = 1; iny <= cryst->ny; iny++) {
+                  if ( cryst->invert )
+                    {
+                       y_coor1 = cryst->win_height -
+                         (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+                                                 PI_RAD)) - cryst->offset_h;
+                       y_coor2 = cryst->win_height -
+                         (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+                                                     PI_RAD)) -
+                         cryst->offset_h;
+                    }
+                  else
+                    {
+                       y_coor1 = (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+                                                 PI_RAD)) + cryst->offset_h;
+                       y_coor2 = (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) +
+                                         cryst->offset_h;
+                    }
+                               XDrawLine(display, window, cryst->gc,
+                                         (int) (cryst->offset_w +
+                                    inx * cryst->a - (int) (iny * cryst->b *
+                                        sin((cryst->gamma - 90) * PI_RAD))),
+                                         y_coor1,
+                                   (int) (cryst->offset_w - iny * cryst->b *
+                                          sin((cryst->gamma - 90) * PI_RAD)),
+                                         y_coor2);
+                       }
+                       iny = cryst->ny;
+                       for (inx = 1; inx <= cryst->nx; inx++) {
+                          if ( cryst->invert )
+                            {
+                               y_coor1 =cryst->win_height -
+                                 (int) (iny * cryst->b *
+                                               cos((cryst->gamma - 90) *
+                                                   PI_RAD)) - cryst->offset_h;
+                               y_coor2 =cryst->win_height - cryst->offset_h;
+                            }
+                          else
+                            {
+                               y_coor1 =(int) (iny * cryst->b *
+                                               cos((cryst->gamma - 90) *
+                                                   PI_RAD)) + cryst->offset_h;
+                               y_coor2 =cryst->offset_h;
+                            }
+                               XDrawLine(display, window, cryst->gc,
+                                         (int) (cryst->offset_w +
+                                    inx * cryst->a - (int) (iny * cryst->b *
+                                        sin((cryst->gamma - 90) * PI_RAD))),
+                                         y_coor1,
+                                         cryst->offset_w + inx * cryst->a,
+                                         y_coor2);
+                       }
+               } else {
+                       int         inx, iny;
+
+                       inx = NRAND(cryst->nx);
+                       iny = NRAND(cryst->ny);
+                  if ( cryst->invert )
+                    {
+                       y_coor1 =cryst->win_height -
+                         (int) (iny * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) -
+                         cryst->offset_h;
+                       y_coor2 =cryst->win_height -
+                         (int) ( ( iny + 1 ) * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) -
+                         cryst->offset_h;
+                    }
+                  else
+                    {
+                       y_coor1 =(int) (iny * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) +
+                         cryst->offset_h;
+                       y_coor2 =(int) (( iny + 1 ) * cryst->b *
+                                                 cos((cryst->gamma - 90) *
+                                                     PI_RAD)) +
+                         cryst->offset_h;
+                    }
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1);
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1,
+                                 cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor1,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+                       XDrawLine(display, window, cryst->gc,
+                                 cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2,
+                                 cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+                                 y_coor2);
+               }
+       }
+       XSetFunction(display, cryst->gc, GXxor);
+       for (i = 0; i < cryst->num_atom; i++) {
+               crystalatom *atom0;
+
+               atom0 = &cryst->atom[i];
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, cryst->gc, cryst->colors[atom0->colour].pixel);
+               } else {
+                       XSetForeground(display, cryst->gc, atom0->colour);
+               }
+               crystal_drawatom(mi, atom0);
+       }
+       XSetFunction(display, cryst->gc, GXcopy);
+}
+
+void
+release_crystal(ModeInfo * mi)
+{
+       if (crystals != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_crystal(MI_DISPLAY(mi), &crystals[screen]);
+               (void) free((void *) crystals);
+               crystals = NULL;
+       }
+}
+
+#endif /* MODE_crystal */
diff --git a/modes/daisy.c b/modes/daisy.c
new file mode 100644 (file)
index 0000000..11a8aae
--- /dev/null
@@ -0,0 +1,322 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* daisy --- flowers in a field */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)daisy.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 07-Aug-1996: written.  Initially copied forest.c and made continual
+ *              refinements, pyro was helpful too.  Based on a program
+ *              I saw on a PC.
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Daisy"
+#define HACK_INIT init_daisy
+#define HACK_DRAW draw_daisy
+#define daisy_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: 300 \n" \
+ "*cycles: 350 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n"
+#define BRIGHT_COLORS
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_daisy
+
+#define DEF_GARDEN  "False"
+
+static Bool garden;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-garden", (char *) ".daisy.garden", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+garden", (char *) ".daisy.garden", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & garden, (char *) "garden", (char *) "Garden", (char *) DEF_GARDEN, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+garden", (char *) "turn on/off garden"}
+};
+
+ModeSpecOpt daisy_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   daisy_description =
+{"daisy", "init_daisy", "draw_daisy", "release_daisy",
+ "refresh_daisy", "init_daisy", NULL, &daisy_opts,
+ 100000, 300, 350, 1, 64, 1.0, "",
+ "Shows a meadow of daisies", 0, NULL};
+
+#endif
+
+#define GREEN  (23 * MI_NPIXELS(mi) / 64)
+#define NOTGREEN       (7 * MI_NPIXELS(mi) / 64)
+#define MINDAISIES   1
+
+#define DROOP 20               /* Percentage x with relation to y */
+#define MINHEIGHT  20          /* Daisy height range */
+#define MAXHEIGHT  40
+
+typedef struct {
+       int         width;
+       int         height;
+       int         time;       /* up time */
+       int         ndaisies;
+       int         meadow_y;
+       Bool        garden;
+       float       step;
+} daisystruct;
+
+static daisystruct *daisies = NULL;
+
+/* always green, straight for now, parabolic later */
+static void
+drawstem(ModeInfo * mi, XPoint start, XPoint stop)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, GREEN));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+#if 1
+       XDrawLine(display, window, gc, start.x, start.y, stop.x, stop.y);
+#else
+       XDrawArc(display, window, gc, stop.x, stop.y,
+                NRAND(50) + 30, start.y - stop.y + 1, 90 * 64, 170 * 64);
+#endif
+}
+
+/* not green */
+static unsigned long
+drawpetals(ModeInfo * mi, XPoint center,
+          int size, int circles, int delta, int offset, int petals)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       unsigned long colour = 0;
+       float       start_angle, inc_angle;
+       XPoint      newcenter;
+       int         petal, inc;
+       float       sine, cosine;
+
+       if (MI_NPIXELS(mi) > GREEN + NOTGREEN) {
+               do {
+                       colour = NRAND(MI_NPIXELS(mi));
+               } while ((long) colour >= GREEN - NOTGREEN &&
+                        (long) colour <= GREEN + NOTGREEN);
+       }
+       start_angle = NRAND(360) * M_PI / 180;
+       inc_angle = 2 * M_PI / petals;
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       if (size > 2)
+               XFillArc(display, window, gc,
+                        center.x - size / 2, center.y - size / 2, size, size,
+                        0, 23040);
+       for (petal = 0; petal < petals; petal++) {
+               sine = SINF(start_angle + petal * inc_angle);
+               cosine = COSF(start_angle + petal * inc_angle);
+               if (size > 2)
+                       if (MI_NPIXELS(mi) <= 2) {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               for (inc = 0; inc < circles; inc++) {
+                                       newcenter.x = center.x + (int) (sine * (offset + delta * inc));
+                                       newcenter.y = center.y + (int) (cosine * (offset + delta * inc));
+                                       XDrawArc(display, window, gc,
+                                                newcenter.x - size / 2, newcenter.y - size / 2, size, size,
+                                                0, 23040);
+                               }
+                       }
+               if (MI_NPIXELS(mi) > 2 && MI_NPIXELS(mi) > GREEN + NOTGREEN)
+                       XSetForeground(display, gc, MI_PIXEL(mi, colour));
+               else
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               for (inc = 0; inc < circles; inc++) {
+                       newcenter.x = center.x + (int) (sine * (offset + delta * inc));
+                       newcenter.y = center.y + (int) (cosine * (offset + delta * inc));
+                       if (size < 2)
+                               XDrawPoint(display, window, gc, newcenter.x, newcenter.y);
+                       else
+                               XFillArc(display, window, gc,
+                                        newcenter.x - size / 2, newcenter.y - size / 2, size, size,
+                                        0, 23040);
+               }
+       }
+       return colour;
+}
+
+/* not green */
+static void
+drawcenter(ModeInfo * mi, XPoint center, int size, unsigned long petalcolour)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       unsigned long colour;
+
+       if (MI_NPIXELS(mi) > GREEN + NOTGREEN) {
+               do {
+                       /* Insure good contrast */
+                       colour = (NRAND(2 * MI_NPIXELS(mi) / 3) + petalcolour +
+                                 MI_NPIXELS(mi) / 6) % MI_NPIXELS(mi);
+               } while ((long) colour >= GREEN - NOTGREEN &&
+                        (long) colour <= GREEN + NOTGREEN);
+               XSetForeground(display, gc, MI_PIXEL(mi, colour));
+       } else
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       if (size < 2)
+               XDrawPoint(display, window, gc, center.x, center.y);
+       else
+               XFillArc(display, window, gc,
+                        center.x - size / 2, center.y - size / 2, size, size, 0, 23040);
+}
+
+static void
+drawdaisy(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       daisystruct *dp = &daisies[MI_SCREEN(mi)];
+       XPoint      stem_start, stem_stop;
+       int         height, droop;
+       unsigned long colour;
+
+       /* Care more about the flower being on the screen rather than the stem */
+#ifdef LINEAR
+       stem_stop.y = dp->meadow_y + dp->time * dp->step;
+       height = (NRAND(MAXHEIGHT - MINHEIGHT + 1) + MINHEIGHT) * dp->height / 300 *
+               2 * (dp->time + 20) / (dp->ndaisies + 20);
+#else
+       stem_stop.y = dp->meadow_y + (int) ((float) dp->time * dp->time *
+                                           dp->step / dp->ndaisies);
+       height = (NRAND(MAXHEIGHT - MINHEIGHT + 1) + MINHEIGHT) * dp->height / 300 *
+               2 * (dp->time * dp->time + 1) / (dp->ndaisies * dp->ndaisies + 1);
+#endif
+       stem_start.y = stem_stop.y + height;
+       if (dp->garden) {
+               stem_stop.x = ((LRAND() & 1) ? 1 : -1) *
+                       NRAND(dp->width / 4 * (dp->time + 1) / (dp->ndaisies + 20) +
+                             dp->width / 4) + dp->width / 2;
+       } else {
+               stem_stop.x = NRAND(dp->width);
+       }
+       /* Give about droop left or right with 25% randomness */
+       droop = ((LRAND() & 1) ? 1 : -1) * DROOP * (NRAND(50) + 75) / 100;
+       stem_start.x = stem_stop.x + droop * height / 100;
+       XSetLineAttributes(display, gc, height / 24 + 1,
+                          LineSolid, CapNotLast, JoinRound);
+       drawstem(mi, stem_start, stem_stop);
+       XSetLineAttributes(display, gc, 1, LineSolid, CapNotLast, JoinRound);
+       colour = drawpetals(mi, stem_stop, height / 6, 5, height / 32 + 1,
+                           height / 7, NRAND(6) + 6);
+       drawcenter(mi, stem_stop, height / 7, colour);
+}
+
+
+void
+init_daisy(ModeInfo * mi)
+{
+       daisystruct *dp;
+
+       if (daisies == NULL) {
+               if ((daisies = (daisystruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (daisystruct))) == NULL)
+                       return;
+       }
+       dp = &daisies[MI_SCREEN(mi)];
+
+       dp->width = MI_WIDTH(mi);
+       dp->height = MI_HEIGHT(mi);
+       dp->time = 0;
+       if (MI_IS_FULLRANDOM(mi))
+               dp->garden = (Bool) (LRAND() & 1);
+       else
+               dp->garden = garden;
+
+       dp->ndaisies = MI_COUNT(mi);
+       if (dp->ndaisies < -MINDAISIES)
+               dp->ndaisies = NRAND(-dp->ndaisies - MINDAISIES + 1) + MINDAISIES;
+       else if (dp->ndaisies < MINDAISIES)
+               dp->ndaisies = MINDAISIES;
+       dp->meadow_y = dp->height / 5;
+       dp->step = (float) (dp->height - 2 * dp->meadow_y) / (dp->ndaisies + 1.0);
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_daisy(ModeInfo * mi)
+{
+       daisystruct *dp;
+
+       if (daisies == NULL)
+               return;
+       dp = &daisies[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (dp->time < dp->ndaisies)
+               drawdaisy(mi);
+       if (++dp->time > MI_CYCLES(mi))
+               init_daisy(mi);
+}
+
+void
+release_daisy(ModeInfo * mi)
+{
+       if (daisies != NULL) {
+               (void) free((void *) daisies);
+               daisies = NULL;
+       }
+}
+
+void
+refresh_daisy(ModeInfo * mi)
+{
+       daisystruct *dp;
+
+       if (daisies == NULL)
+               return;
+       dp = &daisies[MI_SCREEN(mi)];
+
+       if (dp->time < dp->ndaisies) {
+               MI_CLEARWINDOW(mi);
+       } else {
+               init_daisy(mi);
+       }
+}
+
+#endif /* MODE_daisy */
diff --git a/modes/dclock-msg-jp.h b/modes/dclock-msg-jp.h
new file mode 100644 (file)
index 0000000..16b37c5
--- /dev/null
@@ -0,0 +1,40 @@
+/* Japanese messages are separate to another file.             */
+/* Because Japanese EUC-JP encoding is conflict with ISO-8859. */
+/* By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>         */
+
+#ifndef __DCLOCK_MSG_JP_H__
+#define __DCLOCK_MSG_JP_H__
+
+#define POPEX_STRING      "¸½ºß¤ÎÀ¤³¦¿Í¸ý"
+#define PEOPLE_STRING     " ¿Í"
+#define FOREST_STRING     "¸½ºß¤ÎÇ®ÂÓ±«ÎÓ¤ÎÌÌÀÑ"
+#define TROPICAL_STRING   " "
+#define HIV_STRING        "¸½ºß¤Î HIV ´¶À÷¿ô"
+#define CASES_STRING      " ·ï"
+#define LAB_STRING        "º£Ç¯¡¢Æ°Êª¼Â¸³¤Ë¤è¤ê"
+#define VEG_STRING        "º£Ç¯¡¢¿Í´Ö¤Î¿©ÎȤȤ·¤Æ"
+#define YEAR_STRING       " ÂÎ¤ÎÆ°Êª¤¬µ¾À·¤Ë¤Ê¤ê¤Þ¤·¤¿"
+#define Y2K_STRING        "Y2K (2000ǯ1·î1Æü, 0»þ00ʬ00ÉÃ) ¤Þ¤Ç ¤¢¤È"
+#define POST_Y2K_STRING   "Y2K (2000ǯ1·î1Æü, 0»þ00ʬ00ÉÃ) ¤«¤é"
+#define Y2001_STRING      "ÆóÀéǯµª¤Î½ªÎ» (2001ǯ1·î1Æü, 0»þ00ʬ00ÉÃ) ¤Þ¤Ç ¤¢¤È"
+#define POST_Y2001_STRING "»°Àéǯµª¤Î³«»Ï (2001ǯ1·î1Æü, 0»þ00ʬ00ÉÃ) ¤«¤é"
+#define DAY               "Æü"
+#define DAYS              "Æü"
+#define HOUR              "»þ´Ö"
+#define HOURS             "»þ´Ö"
+#define MINUTE            "ʬ"
+#define MINUTES           "ʬ"
+#define SECOND            "ÉÃ"
+#define SECONDS           "ÉÃ"
+
+#ifndef METRIC
+#define METRIC 1
+#endif
+
+#if METRIC
+#define AREA_STRING "¥Ø¥¯¥¿¡¼¥ë"
+#else
+#define AREA_STRING "¥¨¡¼¥«¡¼"
+#endif
+
+#endif
diff --git a/modes/dclock.c b/modes/dclock.c
new file mode 100644 (file)
index 0000000..3a4ae4f
--- /dev/null
@@ -0,0 +1,1217 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* dclock --- floating digital clock or message */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)dclock.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (C) 1995 by Michael Stembera <mrbig@fc.net>.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 07-May-1999: New "savers" added for y2k and second millennium countdowns.
+ *              Tom Schmidt <tschmidt@micron.com>
+ * 04-Dec-1998: New "savers" added for hiv, veg, and lab.
+ *              hiv one due to Kenneth Stailey <kstailey@disclosure.com>
+ * 10-Aug-1998: Population Explosion and Tropical Forest Countdown stuff
+ *              I tried to get precise numbers but they may be off a few
+ *              percent.  Whether or not, its still pretty scary IMHO.
+ *              Although I am a US citizen... I have the default for area in
+ *              metric.  David Bagley <bagleyd@tux.org>
+ * 10-May-1997: Compatible with xscreensaver
+ * 29-Aug-1995: Written.
+ */
+
+/*-
+ *  Some of my calculations laid bare...  (I have a little problem with
+ *  the consistency of the numbers I got at the Bronx Zoo but proportions
+ *  were figured to be 160.70344 people a minute increase not 180 and
+ *  35.303144 hectares (87.198766 acres) a minute decrease not 247 (100 acres).
+ *  So I am going with these more conservative numbers.)
+ *
+ *  Time 0 is 0:00:00 1 Jan 1970 at least according to hard core UNIX fans
+ *  Minutes from 1  Jan 1970 to 21 Jun 1985:  8137440
+ *  Minutes from 21 Jun 1985 to 12 Jul 1988:  6867360
+ *                                    Total: 15004800
+ *
+ *  Population Explosion Saver (popex)
+ *  3,535,369,000 people (figured by extrapolation) 1 Jan 1970
+ *  4,843,083,596 people 21 Jun 1985 (Opening of Wild Asia in the Bronx Zoo)
+ *  5,946,692,000 people 12 Jul 1998 (David Bagley visits zoo ;) )
+ *  180 people a minute increase in global population (I heard 170 also)
+ *  260,000 people a day increase in global population
+ *
+ *  Tropical Forest Countdown Saver (forest)
+ *  1,184,193,000 hectares (figured by extrapolation) 1 Jan 1970
+ *    (2,924,959,000 acres)
+ *  896,916,700 hectares 21 Jun 1985 (Opening of Wild Asia in the Bronx Zoo)
+ *    (2,215,384,320 acres)
+ *  654,477,300 hectares 12 Jul 1998 (David Bagley visits zoo ;) )
+ *    (1,616,559,000 acres)
+ *  247 hectares a minute lost forever (1 hectare = 2.47 acres)
+ *
+ *  HIV Infection Counter Saver (hiv) (stats from http://www.unaids.org/)
+ *  33,600,000 31 Dec 1999 living w/HIV
+ *  16,300,000 31 Dec 1999 dead
+ *  49,900,000 31 Dec 1999 total infections
+ *   5,600,000 new infections in 1999
+ *  10.6545 infections/min
+ *  -118,195,407 virtual cases (figured by extrapolation) 1 Jan 1970
+ *   (this is a result of applying linear tracking to a non-linear event)
+ *
+ *  Animal Research Counter Saver (lab)
+ *  Approximately 17-22 million animals are used in research each year.
+ *  OK so assume 17,000,000 / 525960 = 32.32184957 per minute
+ *  http://www.fcs.uga.edu/~mhulsey/GDB.html
+ *
+ *  Animal Consumation Counter Saver (veg)
+ *  Approximately 5 billion are consumed for food annually.
+ *  OK 5,000,000,000 / 525960 = 9506.426344209 per minute
+ *  http://www.fcs.uga.edu/~mhulsey/GDB.html
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Dclock"
+#define HACK_INIT init_dclock
+#define HACK_DRAW draw_dclock
+#define dclock_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*cycles: 10000 \n" \
+ "*ncolors: 64 \n"
+#define BRIGHT_COLORS
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#include "mode.h"
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "util.h"
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_dclock
+
+#ifndef METRIC
+#define METRIC 1
+#endif
+#if METRIC
+#ifdef NL
+# define AREA_STRING "Hectare"
+#else
+#ifdef JP
+# include "dclock-msg-jp.h"
+#else
+# define AREA_STRING "Hectares"
+#endif
+#endif
+#define AREA_MIN 35.303144
+#define AREA_TIME_START 1184193000.0
+#else
+#ifdef NL
+# define AREA_STRING "Acre"
+#else
+#ifdef JP
+# include "dclock-msg-jp.h"
+#else
+# define AREA_STRING "Acres"
+#endif
+#endif
+#define AREA_MIN 87.198766
+#define AREA_TIME_START 2924959000.0
+#endif
+#define PEOPLE_MIN 160.70344
+#define PEOPLE_TIME_START 3535369000.0
+#define HIV_MIN 10.6545
+#define HIV_TIME_START -118195407.0
+#define LAB_MIN 32.32184957
+#define LAB_TIME_START 0
+#define VEG_MIN 9506.426344209
+#define VEG_TIME_START 0
+/* epoch time at midnight 1 January 2000 UTC */
+#define Y2K_TIME_START (((30 * 365) + 7) * 24 * 60 * 60)
+#define Y2001_TIME_START (Y2K_TIME_START + 366 * 24 * 60 * 60)
+
+#define LED_LEAN 0.2
+#define LED_XS 30.0
+#define LED_YS 45.0
+#define LED_WIDTH (0.15 * LED_YS)
+#define LED_INC (LED_LEAN * LED_XS) /* LEAN and INC do not have to be linked */
+
+#define DEF_LED    "False"
+#define DEF_POPEX  "False"
+#define DEF_FOREST "False"
+#define DEF_HIV    "False"
+#define DEF_LAB    "False"
+#define DEF_VEG    "False"
+#define DEF_Y2K    "False"
+#define DEF_Y2001  "False"
+
+/*- If you remember your Electronics course...
+        a
+        _
+    f / / b
+      -g
+  e /_/ c
+    d
+ */
+
+#define MAX_LEDS 7
+static unsigned char digits[][MAX_LEDS]=
+{
+/* a  b  c  d  e  f  g */
+  {1, 1, 1, 1, 1, 1, 0},  /* 0 */
+  {0, 1, 1, 0, 0, 0, 0},  /* 1 */
+  {1, 1, 0, 1, 1, 0, 1},  /* 2 */
+  {1, 1, 1, 1, 0, 0, 1},  /* 3 */
+  {0, 1, 1, 0, 0, 1, 1},  /* 4 */
+  {1, 0, 1, 1, 0, 1, 1},  /* 5 */
+  {1, 0, 1, 1, 1, 1, 1},  /* 6 */
+  {1, 1, 1, 0, 0, 0, 0},  /* 7 */
+  {1, 1, 1, 1, 1, 1, 1},  /* 8 */
+  {1, 1, 1, 1, 0, 1, 1}  /* 9 */
+#if 0
+  , /* Completeness, we must have completeness */
+  {1, 1, 1, 0, 1, 1, 1},  /* A */
+  {0, 0, 1, 1, 1, 1, 1},  /* b */
+  {1, 0, 0, 1, 1, 1, 0},  /* C */
+  {0, 1, 1, 1, 1, 0, 1},  /* d */
+  {1, 0, 0, 1, 1, 1, 1},  /* E */
+  {1, 0, 0, 0, 1, 1, 1}   /* F */
+#define MAX_DIGITS 16
+#else
+#define MAX_DIGITS 10
+#endif
+};
+
+static Bool led;
+
+/* Create an virtual parallelogram, normal rectangle parameters plus "lean":
+   the amount the start of a will be shifted to the right of the start of d.
+ */
+
+static XPoint parallelogramUnit[4] =
+{
+       {1, 0},
+       {2, 0},
+       {-1, 1},
+       {-2, 0}
+};
+
+static Bool popex;
+static Bool forest;
+static Bool hiv;
+static Bool lab;
+static Bool veg;
+static Bool y2k;
+static Bool millennium;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-led", (char *) ".dclock.led", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+led", (char *) ".dclock.led", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-popex", (char *) ".dclock.popex", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+popex", (char *) ".dclock.popex", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-forest", (char *) ".dclock.forest", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+forest", (char *) ".dclock.forest", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-hiv", (char *) ".dclock.hiv", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+hiv", (char *) ".dclock.hiv", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-lab", (char *) ".dclock.lab", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+lab", (char *) ".dclock.lab", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-veg", (char *) ".dclock.veg", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+veg", (char *) ".dclock.veg", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-y2k", (char *) ".dclock.y2k", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+y2k", (char *) ".dclock.y2k", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-millennium", (char *) ".dclock.millennium", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+millennium", (char *) ".dclock.millennium", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & led, (char *) "led", (char *) "LED", (char *) DEF_LED, t_Bool},
+       {(caddr_t *) & popex, (char *) "popex", (char *) "PopEx", (char *) DEF_POPEX, t_Bool},
+       {(caddr_t *) & forest, (char *) "forest", (char *) "Forest", (char *) DEF_FOREST, t_Bool},
+       {(caddr_t *) & hiv, (char *) "hiv", (char *) "Hiv", (char *) DEF_HIV, t_Bool},
+       {(caddr_t *) & lab, (char *) "lab", (char *) "Lab", (char *) DEF_LAB, t_Bool},
+       {(caddr_t *) & veg, (char *) "veg", (char *) "Veg", (char *) DEF_VEG, t_Bool},
+       {(caddr_t *) & y2k, (char *) "y2k", (char *) "Y2K", (char *) DEF_Y2K, t_Bool},
+       {(caddr_t *) & millennium, (char *) "millennium", (char *) "Millennium", (char *) DEF_Y2001, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+led", (char *) "turn on/off Light Emitting Diode seven segment display"},
+       {(char *) "-/+popex", (char *) "turn on/off population explosion counter"},
+       {(char *) "-/+forest", (char *) "turn on/off tropical forest destruction counter"},
+       {(char *) "-/+hiv", (char *) "turn on/off HIV infection counter"},
+       {(char *) "-/+lab", (char *) "turn on/off Animal Research counter"},
+       {(char *) "-/+veg", (char *) "turn on/off Animal Consumation counter"},
+       {(char *) "-/+y2k", (char *) "turn on/off Year 2000 countdown"},
+       {(char *) "-/+millennium", (char *) "turn on/off 3rd Millennium (1 January 2001) countdown"},
+};
+
+ModeSpecOpt dclock_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   dclock_description =
+{"dclock", "init_dclock", "draw_dclock", "release_dclock",
+ "refresh_dclock", "init_dclock", NULL, &dclock_opts,
+ 10000, 1, 10000, 1, 64, 0.3, "",
+ "Shows a floating digital clock or message", 0, NULL};
+
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <time.h>
+
+#ifdef FR
+#define POPEX_STRING "Population mondiale"
+#define PEOPLE_STRING " personnes"
+#define FOREST_STRING "Taille des forêts tropicales"
+#define TROPICAL_STRING " zones tropicales en "
+#define HIV_STRING "Infections par le SIDA dans le monde"
+#define CASES_STRING " cas"
+#define LAB_STRING "Animaux utilisés dans la recherche"
+#define VEG_STRING "Animaux consommés comme aliments par l'homme"
+#define YEAR_STRING " cette année"
+#define Y2K_STRING "Décompte pour l'an 2000 (1er Janvier 2000)"
+#define POST_Y2K_STRING "Temps depuis l'an 2000 (1er Janvier 2000)"
+#define Y2001_STRING "Décompte pour le Second Millénaire (1er Janvier 2001)"
+#define POST_Y2001_STRING "Temps depuis le Second Millénaire (1er Janvier 2001)"
+#define DAY "jour"
+#define DAYS "jours"
+#define HOUR "heure"
+#define HOURS "heures"
+#define MINUTE "minute"
+#define MINUTES "minutes"
+#define SECOND "seconde"
+#define SECONDS "secondes"
+#else
+#ifdef NL
+#define POPEX_STRING "Wereld populatie"
+#define PEOPLE_STRING " Mensen"
+#define FOREST_STRING "Aantal tropische wouden"
+#define TROPICAL_STRING " Tropisch gebied in "
+#define HIV_STRING "Huidige staat HIV infecties wereldwijd"
+#define CASES_STRING " gevallen"
+#define LAB_STRING "Verbruikt tijdens onderzoek"
+#define VEG_STRING "Opgegeten door de mens"
+#define YEAR_STRING " dieren dit jaar"
+#define Y2K_STRING "Aftellen tot Y2K (1 Januari 2000, 0.00 uur)"
+#define POST_Y2K_STRING "Tijd sinds Y2K (1 Januari 2000)"
+#define Y2001_STRING "Aftellen tot het einde van het tweede Millennium (1 Januari 2001, 0.00 uur)"
+#define POST_Y2001_STRING "Verstreken tijd sinds het begin van het derde Millennium (1 Januari 2001)"
+
+#define Y2001_STRING "Aftellen tot het tweede millennium (1 Januari 2001)"
+#define POST_Y2001_STRING "Tijd sinds het tweede millennium (1 Januari 2001)"
+#define DAY "dag"
+#define DAYS "dagen"
+#define HOUR "uur"
+#define HOURS "uren"
+#define MINUTE "minuut"
+#define MINUTES "minuten"
+#define SECOND "seconde"
+#define SECONDS "seconden"
+#else
+#ifdef JP
+#include "dclock-msg-jp.h"
+#else
+#define POPEX_STRING "World Population"
+#define PEOPLE_STRING " People"
+#define FOREST_STRING "Tropical Forest Countdown"
+#define TROPICAL_STRING " Tropical Forest in "
+#define HIV_STRING "Current HIV Infections World Wide"
+#define CASES_STRING " Cases"
+#define LAB_STRING "Used in research"
+#define VEG_STRING "Consumed for Food by Mankind"
+#define YEAR_STRING " animals this year"
+#define Y2K_STRING "Countdown to Y2K (1 January 2000, 0:00 hour)"
+#define POST_Y2K_STRING "Time since Y2K (1 January 2000)"
+#define Y2001_STRING "Countdown to the end of the Second Millennium (1 January 2001, 0:00 hour)"
+#define POST_Y2001_STRING "Time since the start of the Third Millennium (1 January 2001)"
+#define DAY "day"
+#define DAYS "days"
+#define HOUR "hour"
+#define HOURS "hours"
+#define MINUTE "minute"
+#define MINUTES "minutes"
+#define SECOND "second"
+#define SECONDS "seconds"
+#endif
+#endif
+#endif
+
+#ifdef USE_MB
+static XFontSet mode_font = None;
+static int font_height(XFontSet f)
+{
+  XRectangle ink, log;
+  if (f == None) {
+    return 8;
+  } else {
+      XmbTextExtents(mode_font, "My", strlen("My"), &ink, &log);
+      return log.height;
+  }
+}
+#define DELTA 0.2
+extern XFontSet getFontSet(Display * display);
+#else
+static XFontStruct *mode_font = None;
+#define font_height(f) (f->ascent + f->descent)
+#define DELTA 0
+extern XFontStruct *getFont(Display * display);
+#endif
+
+#ifdef USE_MB
+#define free_font(d) if (mode_font!=None){XFreeFontSet(d,mode_font); \
+mode_font = None;}
+#else
+#define free_font(d) if (mode_font!=None){XFreeFont(d,mode_font); \
+mode_font = None;}
+#endif
+
+#define STRSIZE 50
+
+typedef struct {
+       int         color;
+       short       height, width;
+       char       *str, str1[STRSIZE], str2[STRSIZE], str1old[STRSIZE], str2old[STRSIZE];
+       char       *str1pta, *str2pta, *str1ptb, *str2ptb;
+       time_t      timenew, timeold;
+       int         tzoffset;
+       short       maxx, maxy, clockx, clocky;
+       short       text_height, text_width, text_width1, text_width2;
+       short       text_start1, text_start2;
+       short       text_ascent, text_descent;
+       short       hour;
+       short       dx, dy;
+       int         done;
+       int         pixw, pixh;
+       Pixmap      pixmap;
+       GC          fgGC, bgGC;
+       Bool        popex, forest, hiv, lab, veg, y2k, millennium, led;
+       XPoint      parallelogram[4];
+} dclockstruct;
+
+static dclockstruct *dclocks = NULL;
+
+
+static unsigned long
+timeAtLastNewYear(long timeNow)
+{
+  struct tm *t;
+
+  t = localtime((const time_t *) &timeNow);
+  return (unsigned long)(t->tm_year);
+}
+
+#ifndef HAVE_SNPRINTF
+static double logbase;
+#define BASE 10.0
+#define GROUP 3
+#endif
+
+static void
+convert(double x, char *string)
+{
+#ifdef HAVE_SNPRINTF
+/* Also old C compiler can not accept this syntax, but this syntax awares
+   locale.  Known to work with gcc-2.95.2 and glibc-2.1.3. */
+       (void) snprintf(string, STRSIZE, "%'.0f", x);
+#else
+       
+       int         i, j, k = 0;
+       int         place = (int) (log(x) / logbase);
+       double      divisor = 1.0;
+
+       for (i = 0; i < place; i++)
+               divisor *= BASE;
+
+       for (i = place; i >= 0; i--) {
+               j = (int) (x / divisor);
+               string[k++] = (char) j + '0';
+               x -= j * divisor;
+               divisor /= BASE;
+               if ((i > 0) && (i % GROUP == 0)) {
+                       string[k++] = ',';
+               }
+       }
+       string[k] = '\0';
+#endif
+}
+
+static void
+dayhrminsec(long timeCount, int tzoffset, char *string)
+{
+       int days, hours, minutes, seconds;
+       int bufsize, i;
+
+       timeCount = ABS(timeCount);
+       days = (int) (timeCount / 86400);
+       hours = (int) ((timeCount / 3600) % 24);
+       minutes = (int) ((timeCount / 60) % 60);
+       seconds = (int) (timeCount % 60);
+
+       /* snprintf would make this easier but its not always available */
+       bufsize = 16 + strlen((days==1) ? DAY : DAYS);
+       if (bufsize >= STRSIZE)
+          return;
+       (void) sprintf(string, "%d %s", days, (days==1) ? DAY : DAYS);
+
+       i = strlen(string);
+       bufsize = 4 + strlen((hours==1) ? HOUR : HOURS);
+       if (i + bufsize >= STRSIZE)
+          return;
+       (void) sprintf(&string[i], " %d %s", hours, (hours==1) ? HOUR : HOURS);
+
+       i = strlen(string);
+       bufsize = 4 + strlen((minutes==1) ? MINUTE : MINUTES);
+       if (i + bufsize >= STRSIZE)
+          return;
+       (void) sprintf(&string[i], " %d %s", minutes, (minutes==1) ? MINUTE : MINUTES);
+
+       i = strlen(string);
+       bufsize += 4 + strlen((seconds==1) ? SECOND : SECONDS);
+       if (i + bufsize >= STRSIZE)
+          return;
+       (void) sprintf(&string[i], " %d %s", seconds, (seconds==1) ? SECOND : SECONDS);
+
+       if (!tzoffset) {
+               i = strlen(string);
+               bufsize += 6;  /* strlen(" (UTC)"); */
+               if (i + bufsize >= STRSIZE)
+                       return;
+               (void) strcat(string, " (UTC)");
+       }
+}
+
+static void
+drawaled(ModeInfo * mi, int startx, int starty, int led)
+{
+       Display    *display = MI_DISPLAY(mi);
+       dclockstruct *dp = &dclocks[MI_SCREEN(mi)];
+       int x_1, y_1, x_2, y_2;
+
+       int offset = (int) LED_WIDTH;
+       int offset2 = (int) (LED_WIDTH / 2.0);
+       int leanoffset = (int) (offset2 * LED_LEAN);
+
+       switch (led) {
+               case 0: /* a */
+                       x_1 = startx + dp->parallelogram[0].x;
+                       y_1 = starty + dp->parallelogram[0].y;
+                       x_2 = x_1 + dp->parallelogram[1].x - offset;
+                       y_2 = y_1 + dp->parallelogram[1].y;
+                       x_1 = x_1 + offset;
+                       XDrawLine(display, dp->pixmap, dp->fgGC,
+                               x_1, y_1, x_2, y_2);
+                       break;
+               case 1: /* b */
+                       x_1 = startx + dp->parallelogram[0].x + dp->parallelogram[1].x;
+                       y_1 = starty + dp->parallelogram[0].y + dp->parallelogram[1].y;
+                       x_2 = x_1 + dp->parallelogram[2].x / 2 + leanoffset;
+                       y_2 = y_1 + dp->parallelogram[2].y / 2 - offset2;
+                       x_1 = x_1 - leanoffset;
+                       y_1 = y_1 + offset2;
+                       XDrawLine(display, dp->pixmap, dp->fgGC,
+                               x_1, y_1, x_2, y_2);
+                       break;
+               case 2: /* c */
+                       x_1 = startx + dp->parallelogram[0].x + dp->parallelogram[1].x + dp->parallelogram[2].x;
+                       y_1 = starty + dp->parallelogram[0].y + dp->parallelogram[1].y + dp->parallelogram[2].y;
+                       x_2 = x_1 - dp->parallelogram[2].x / 2 - leanoffset;
+                       y_2 = y_1 - dp->parallelogram[2].y / 2 + offset2;
+                       x_1 = x_1 + leanoffset;
+                       y_1 = y_1 - offset2;
+                       XDrawLine(display, dp->pixmap, dp->fgGC,
+                               x_1, y_1, x_2, y_2);
+                       break;
+               case 3: /* d */
+                       x_1 = startx + dp->parallelogram[0].x + dp->parallelogram[2].x;
+                       y_1 = starty + dp->parallelogram[0].y + dp->parallelogram[2].y;
+                       x_2 = x_1 + dp->parallelogram[1].x - offset;
+                       y_2 = y_1 + dp->parallelogram[1].y;
+                       x_1 = x_1 + offset;
+                       XDrawLine(display, dp->pixmap, dp->fgGC,
+                               x_1, y_1, x_2, y_2);
+                       break;
+               case 4: /* e */
+                       x_1 = startx + dp->parallelogram[0].x + dp->parallelogram[2].x;
+                       y_1 = starty + dp->parallelogram[0].y + dp->parallelogram[2].y;
+                       x_2 = x_1 - dp->parallelogram[2].x / 2 - leanoffset;
+                       y_2 = y_1 - dp->parallelogram[2].y / 2 + offset2;
+                       x_1 = x_1 + leanoffset;
+                       y_1 = y_1 - offset2;
+                       XDrawLine(display, dp->pixmap, dp->fgGC,
+                               x_1, y_1, x_2, y_2);
+                       break;
+               case 5: /* f */
+                       x_1 = startx + dp->parallelogram[0].x;
+                       y_1 = starty + dp->parallelogram[0].y;
+                       x_2 = x_1 + dp->parallelogram[2].x / 2 + leanoffset;
+                       y_2 = y_1 + dp->parallelogram[2].y / 2 - offset2;
+                       x_1 = x_1 - leanoffset;
+                       y_1 = y_1 + offset2;
+                       XDrawLine(display, dp->pixmap, dp->fgGC,
+                               x_1, y_1, x_2, y_2);
+                       break;
+               case 6: /* g */
+                       x_1 = startx + dp->parallelogram[0].x + dp->parallelogram[2].x / 2;
+                       y_1 = starty + dp->parallelogram[0].y + dp->parallelogram[2].y / 2;
+                       x_2 = x_1 + dp->parallelogram[1].x - offset;
+                       y_2 = y_1 + dp->parallelogram[1].y;
+                       x_1 = x_1 + offset;
+                       XDrawLine(display, dp->pixmap, dp->fgGC,
+                               x_1, y_1, x_2, y_2);
+
+       }
+}
+
+static void
+drawacolon(ModeInfo * mi, int startx, int starty)
+{
+       Display    *display = MI_DISPLAY(mi);
+       dclockstruct *dp = &dclocks[MI_SCREEN(mi)];
+       int x_1, y_1, x_2, y_2;
+
+       int offset2 = (int) (LED_WIDTH / 2.0);
+       int leanoffset = (int) (offset2 * LED_LEAN);
+
+       x_1 = startx + dp->parallelogram[0].x +
+               (int) (dp->parallelogram[2].x / 2 - 2.0 * leanoffset);
+       y_1 = starty + dp->parallelogram[0].y + dp->parallelogram[2].y / 2 +
+               (int) (2.0 * offset2);
+       x_2 = x_1 - (int) (2.0 * leanoffset);
+       y_2 = y_1 + (int) (2.0 * offset2);
+       XDrawLine(display, dp->pixmap, dp->fgGC, x_1, y_1, x_2, y_2);
+       x_1 = startx + dp->parallelogram[0].x +
+               dp->parallelogram[2].x / 2 + (int) (2.0 * leanoffset);
+       y_1 = starty + dp->parallelogram[0].y + dp->parallelogram[2].y / 2 -
+               (int) (2.0 * offset2);
+       x_2 = x_1 + (int) (2.0 * leanoffset);
+       y_2 = y_1 - (int) (2.0 * offset2);
+       XDrawLine(display, dp->pixmap, dp->fgGC, x_1, y_1, x_2, y_2);
+}
+
+static void
+drawanumber(ModeInfo * mi, int startx, int starty, int digit)
+{
+       int led;
+
+       for (led = 0; led < MAX_LEDS; led++) {
+               if (digits[digit][led])
+                       drawaled(mi, startx, starty, led);
+       }
+}
+
+static void
+free_dclock(Display *display, dclockstruct *dp)
+{
+       if (dp->fgGC != None) {
+               XFreeGC(display, dp->fgGC);
+               dp->fgGC = None;
+       }
+       if (dp->bgGC) {
+               XFreeGC(display, dp->bgGC);
+               dp->bgGC = None;
+       }
+       if (dp->pixmap) {
+               XFreePixmap(display, dp->pixmap);
+               dp->pixmap = None;
+       }
+}
+
+static void
+drawDclock(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       dclockstruct *dp = &dclocks[MI_SCREEN(mi)];
+       short       xold, yold;
+
+       if (dp->led) {
+               dp->timeold = dp->timenew = time((time_t *) NULL);
+               dp->str = ctime(&dp->timeold);
+       } else if (!dp->popex && !dp->forest && !dp->hiv &&
+           !dp->lab && !dp->veg && !dp->y2k && !dp->millennium) {
+               if (dp->timeold != (dp->timenew = time((time_t *) NULL))) {
+                       /* only parse if time has changed */
+                       dp->timeold = dp->timenew;
+
+                       if (!dp->popex && !dp->forest && !dp->hiv && !dp->lab &&
+                           !dp->veg && !dp->y2k && !dp->millennium) {
+                               (void) strftime(dp->str1pta, STRSIZE, "%I:%M:%S %p", localtime(&(dp->timeold)));
+                       }
+                       (void) strftime(dp->str2pta, STRSIZE, "%a %b %d %Y", localtime(&(dp->timeold)));
+               }
+       } else {
+               long timeNow, timeLocal;
+               timeNow = seconds();
+               timeLocal = timeNow - dp->tzoffset;
+
+               if (dp->popex) {
+                       convert(PEOPLE_TIME_START + (PEOPLE_MIN / 60.0) * timeNow, dp->str2);
+                       (void) strncat(dp->str2, PEOPLE_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->forest) {
+                       convert(AREA_TIME_START - (AREA_MIN / 60.0) * timeNow, dp->str2);
+                       (void) strncat(dp->str2, TROPICAL_STRING, STRSIZE-strlen(dp->str2));
+                       (void) strncat(dp->str2, AREA_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->hiv) {
+                       convert(HIV_TIME_START + (HIV_MIN / 60.0) * timeNow, dp->str2);
+                       (void) strncat(dp->str2, CASES_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->lab) {
+                       convert((LAB_MIN / 60.0) * (timeNow - timeAtLastNewYear(timeNow)),
+                               dp->str2);
+                       (void) strncat(dp->str2, YEAR_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->veg) {
+                       convert((VEG_MIN / 60.0) * (timeNow - timeAtLastNewYear(timeNow)),
+                               dp->str2);
+                       (void) strncat(dp->str2, YEAR_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->y2k) {
+                       if (Y2K_TIME_START >= timeLocal)
+                               dp->str1pta = (char *) Y2K_STRING;
+                       else
+                               dp->str1pta = (char *) POST_Y2K_STRING;
+                       dp->str1ptb = dp->str1pta;
+                       dayhrminsec(Y2K_TIME_START - timeLocal, dp->tzoffset, dp->str2);
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->millennium) {
+                       if (Y2001_TIME_START >= timeLocal)
+                               dp->str1pta = (char *) Y2001_STRING;
+                       else
+                               dp->str1pta = (char *) POST_Y2001_STRING;
+                       dp->str1ptb = dp->str1pta;
+                       dayhrminsec(Y2001_TIME_START - timeLocal, dp->tzoffset, dp->str2);
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               }
+       }
+       /* Recalculate string width since it can change */
+       xold = dp->clockx;
+       yold = dp->clocky;
+       if (!dp->led) {
+#ifdef USE_MB
+               {
+                       XRectangle ink, logical;
+
+                       XmbTextExtents(mode_font, dp->str1pta, strlen(dp->str1pta), &ink, &logical);
+                       dp->text_width1 = logical.width;
+                       XmbTextExtents(mode_font, dp->str2pta, strlen(dp->str2pta), &ink, &logical);
+                       dp->text_width2 = logical.width;
+               }
+#else
+               dp->text_width1 = XTextWidth(mode_font, dp->str1pta, strlen(dp->str1pta));
+               dp->text_width2 = XTextWidth(mode_font, dp->str2pta, strlen(dp->str2pta));
+#endif
+
+               if (dp->text_width1 > dp->text_width2) {
+                       dp->text_width = dp->text_width1;
+                       dp->text_start1 = 0;
+                       dp->text_start2 = (dp->text_width - dp->text_width2) / 2;
+               } else {
+                       dp->text_width = dp->text_width2;
+                       dp->text_start1 = (dp->text_width - dp->text_width1) / 2;
+                       dp->text_start2 = 0;
+               }
+       }
+       dp->width = MI_WIDTH(mi);
+       dp->height = MI_HEIGHT(mi);
+       dp->maxx = dp->width - dp->text_width;
+       dp->maxy = dp->height - dp->text_height - dp->text_descent;
+       dp->clockx += dp->dx;
+       dp->clocky += dp->dy;
+       if (dp->maxx < dp->text_start1) {
+               if (dp->clockx < dp->maxx + dp->text_start1 ||
+                   dp->clockx > dp->text_start1) {
+                       dp->dx = -dp->dx;
+                       dp->clockx += dp->dx;
+               }
+       } else if (dp->maxx > dp->text_start1) {
+               if (dp->clockx >= dp->maxx + dp->text_start1 ||
+                   dp->clockx <= dp->text_start1) {
+                       dp->dx = -dp->dx;
+                       dp->clockx += dp->dx;
+               }
+       }
+       if (dp->maxy < dp->text_ascent) {
+               if (dp->clocky > dp->text_ascent || dp->clocky < dp->maxy) {
+                       dp->dy = -dp->dy;
+                       dp->clocky += dp->dy;
+               }
+       } else if (dp->maxy > dp->text_ascent) {
+               if (dp->clocky > dp->maxy || dp->clocky < dp->text_ascent) {
+                       dp->dy = -dp->dy;
+                       dp->clocky += dp->dy;
+               }
+       }
+       if (dp->pixw != dp->text_width ||
+           dp->pixh != (1 + !dp->led) * dp->text_height) {
+               XGCValues   gcv;
+
+               if (dp->pixmap)
+                       MI_CLEARWINDOWCOLORMAPFAST(mi, gc, MI_BLACK_PIXEL(mi));
+               free_dclock(display, dp);
+               dp->pixw = dp->text_width;
+               if (dp->led)
+                       dp->pixh = dp->text_height;
+               else
+                       dp->pixh = (2 + DELTA) * dp->text_height;
+               if ((dp->pixmap =
+                       XCreatePixmap(display, window, dp->pixw, dp->pixh, 1)) == None) {
+                       free_dclock(display, dp);
+                       dp->pixw = 0;
+                       dp->pixh = 0;
+                       return;
+               }
+#ifndef USE_MB
+               gcv.font = mode_font->fid;
+#endif
+               gcv.background = 0;
+               gcv.foreground = 1;
+               gcv.graphics_exposures = False;
+               if ((dp->fgGC = XCreateGC(display, dp->pixmap,
+                       GCForeground | GCBackground | GCGraphicsExposures
+#ifndef USE_MB
+                       | GCFont
+#endif
+                       , &gcv)) == None) {
+                       free_dclock(display, dp);
+                       dp->pixw = 0;
+                       dp->pixh = 0;
+                       return;
+               }
+               gcv.foreground = 0;
+               if ((dp->bgGC = XCreateGC(display, dp->pixmap,
+                       GCForeground | GCBackground | GCGraphicsExposures
+#ifndef USE_MB
+                       | GCFont
+#endif
+                       , &gcv)) == None) {
+                       free_dclock(display, dp);
+                       dp->pixw = 0;
+                       dp->pixh = 0;
+                       return;
+               }
+               XSetLineAttributes(display, dp->fgGC,
+                 (unsigned int) (LED_WIDTH),
+                 LineSolid, CapButt, JoinMiter);
+       }
+       XFillRectangle(display, dp->pixmap, dp->bgGC, 0, 0, dp->pixw, dp->pixh);
+
+       if (dp->led) {
+               int startx = (int) (LED_WIDTH / 2.0);
+               int starty = (int) (LED_WIDTH / 2.0);
+
+               drawanumber(mi, startx, starty, dp->str[11] - '0');
+               startx += (int) (LED_XS + LED_WIDTH + LED_INC);
+               drawanumber(mi, startx, starty, dp->str[12] - '0');
+               startx += (int) (LED_XS + LED_WIDTH + LED_INC);
+               drawacolon(mi, startx, starty);
+               startx += (int) (LED_WIDTH + LED_INC);
+               drawanumber(mi, startx, starty, dp->str[14] - '0');
+               startx += (int) (LED_XS + LED_WIDTH + LED_INC);
+               drawanumber(mi, startx, starty, dp->str[15] - '0');
+               startx += (int) (LED_XS + LED_WIDTH + LED_INC);
+               drawacolon(mi, startx, starty);
+               startx += (int) (LED_WIDTH + LED_INC);
+               drawanumber(mi, startx, starty, dp->str[17] - '0');
+               startx += (int) (LED_XS + LED_WIDTH + LED_INC);
+               drawanumber(mi, startx, starty, dp->str[18] - '0');
+       } else {
+#ifdef USE_MB
+               (void) XmbDrawString(display, dp->pixmap, mode_font, dp->fgGC,
+                       dp->text_start1, dp->text_ascent,
+                       dp->str1pta, strlen(dp->str1pta));
+               (void) XmbDrawString(display, dp->pixmap, mode_font, dp->fgGC,
+                       dp->text_start2, dp->text_ascent + dp->text_height,
+                       dp->str2pta, strlen(dp->str2pta));
+#else
+               (void) XDrawString(display, dp->pixmap, dp->fgGC,
+                       dp->text_start1, dp->text_ascent,
+                       dp->str1pta, strlen(dp->str1pta));
+               (void) XDrawString(display, dp->pixmap, dp->fgGC,
+                       dp->text_start2, dp->text_ascent + dp->text_height,
+                       dp->str2pta, strlen(dp->str2pta));
+#endif
+       }
+
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       /* This could leave screen dust on the screen if the width changes
+          But that only happens once a day...
+          ... this is solved by the ClearWindow above
+        */
+       ERASE_IMAGE(display, window, gc,
+           (dp->clockx - dp->text_start1), (dp->clocky - dp->text_ascent),
+                   (xold - dp->text_start1), (yold - dp->text_ascent),
+                   dp->pixw, dp->pixh);
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, dp->color));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       XCopyPlane(display, dp->pixmap, window, gc,
+                  0, 0, dp->text_width, (2 + DELTA) * dp->text_height,
+               dp->clockx - dp->text_start1, dp->clocky - dp->text_ascent,
+                  1L);
+}
+
+void
+release_dclock(ModeInfo * mi)
+{
+       if (dclocks != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_dclock(MI_DISPLAY(mi), &dclocks[screen]);
+               (void) free((void *) dclocks);
+               dclocks = NULL;
+       }
+       free_font(MI_DISPLAY(mi));
+}
+
+void
+init_dclock(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       dclockstruct *dp;
+       long timeNow, timeLocal;
+#if defined(HAVE_TZSET) && (!defined(HAVE_TIMELOCAL) || (defined(BSD) && BSD >= 199306))
+       extern long timezone;
+#endif
+
+       if (dclocks == NULL) {
+#ifndef HAVE_SNPRINTF
+               logbase = log(BASE);
+#endif
+               if ((dclocks = (dclockstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (dclockstruct))) == NULL)
+                       return;
+       }
+       dp = &dclocks[MI_SCREEN(mi)];
+
+       dp->width = MI_WIDTH(mi);
+       dp->height = MI_HEIGHT(mi);
+
+       MI_CLEARWINDOW(mi);
+
+       dp->led = False;
+       dp->popex = False;
+       dp->forest = False;
+       dp->hiv = False;
+       dp->lab = False;
+       dp->veg = False;
+       dp->y2k = False;
+       dp->millennium = False;
+#if defined(MODE_dclock_y2k) && defined(MODE_dclock_millennium)
+#define NUM_DCLOCK_MODES 9
+#endif
+#if defined(MODE_dclock_y2k) && !defined(MODE_dclock_millennium)
+#define NUM_DCLOCK_MODES 8
+#endif
+#if !defined(MODE_dclock_y2k) && defined(MODE_dclock_millennium)
+#define NUM_DCLOCK_MODES 8
+#endif
+#if !defined(MODE_dclock_y2k) && !defined(MODE_dclock_millennium)
+#define NUM_DCLOCK_MODES 7
+#endif
+       if (MI_IS_FULLRANDOM(mi)) {
+               switch (NRAND(NUM_DCLOCK_MODES)) {
+                       case 0:
+                               break;
+                       case 1:
+                               dp->led = True;
+                               break;
+                       case 2:
+                               dp->popex = True;
+                               break;
+                       case 3:
+                               dp->forest = True;
+                               break;
+                       case 4:
+                               dp->hiv = True;
+                               break;
+                       case 5:
+                               dp->lab = True;
+                               break;
+                       case 6:
+                               dp->veg = True;
+                               break;
+#if defined(MODE_dclock_y2k) || defined(MODE_dclock_millennium)
+                       case 7:
+#ifdef MODE_dclock_y2k
+                               dp->y2k = True;
+#else
+                               dp->millennium = True;
+#endif
+                               break;
+#if defined(MODE_dclock_y2k) && defined(MODE_dclock_millennium)
+                       case 8:
+                               dp->millennium = True;
+                               break;
+#endif
+#endif
+                       default:
+                               break;
+               }
+       } else { /* first come, first served */
+               dp->led = led;
+               dp->popex = popex;
+               dp->forest = forest;
+               dp->hiv = hiv;
+               dp->lab = lab;
+               dp->veg = veg;
+               dp->y2k = y2k;
+               dp->millennium = millennium;
+       }
+
+       if (mode_font == None) {
+#ifdef USE_MB
+               mode_font = getFontSet(display);
+#else
+               mode_font = getFont(display);
+#endif
+               if (mode_font == None) {
+                       release_dclock(mi);
+                       return;
+               }
+       }
+       if (!dp->done) {
+               dp->done = 1;
+#ifndef USE_MB
+               if (mode_font != None)
+                       XSetFont(display, MI_GC(mi), mode_font->fid);
+#endif
+       }
+       /* (void)time(&dp->timenew); */
+#if defined(HAVE_TZSET) && (!defined(HAVE_TIMELOCAL) || (defined(BSD) && BSD >= 199306))
+       (void) tzset();
+#endif
+       dp->timeold = dp->timenew = time((time_t *) NULL);
+#if defined(HAVE_TIMELOCAL) && !(defined(BSD) && BSD >= 199306)
+       dp->tzoffset = mktime(localtime(&dp->timeold)) -
+               mktime(gmtime(&dp->timeold));
+#else
+#if defined(HAVE_TZSET)
+        dp->tzoffset = (int)timezone;
+#else
+       dp->tzoffset = 0;
+#endif
+#endif
+       if (dp->tzoffset > 86400 || dp->tzoffset < -86400)
+               dp->tzoffset = 0;
+       dp->str = ctime(&dp->timeold);
+       dp->dx = (LRAND() & 1) ? 1 : -1;
+       dp->dy = (LRAND() & 1) ? 1 : -1;
+
+       timeNow = seconds();
+       timeLocal = timeNow - dp->tzoffset;
+       if (dp->led) {
+               int i;
+
+               dp->text_descent = 0;
+               dp->text_ascent = 0;
+               for (i = 0; i < 4; i++) {
+                       if (parallelogramUnit[i].x == 1)
+                               dp->parallelogram[i].x = (short) (LED_XS * LED_LEAN);
+                       else if (parallelogramUnit[i].x == 2)
+                               dp->parallelogram[i].x = (short) LED_XS;
+                       else if (parallelogramUnit[i].x == -1)
+                               dp->parallelogram[i].x = (short) (-LED_XS * LED_LEAN);
+                       else if (parallelogramUnit[i].x == -2)
+                               dp->parallelogram[i].x = (short) (-LED_XS);
+                       else
+                               dp->parallelogram[i].x = 0;
+                       dp->parallelogram[i].y = (short) (LED_YS * parallelogramUnit[i].y);
+               }
+
+               dp->parallelogram[0].x = (short) ((LED_XS * LED_LEAN) + LED_INC);
+               dp->parallelogram[0].y = (short) LED_INC;
+               dp->text_width = (short) (6 * (LED_XS + LED_WIDTH + LED_INC) +
+                 2 * (LED_WIDTH + LED_INC) + LED_XS * LED_LEAN - LED_INC);
+               dp->text_height = (short) (LED_YS + LED_WIDTH + LED_INC);
+               dp->maxy = dp->height - dp->text_height;
+               if (dp->maxy == 0)
+                       dp->clocky = 0;
+               else if (dp->maxy < 0)
+                       dp->clocky = -NRAND(-dp->maxy);
+               else
+                       dp->clocky = NRAND(dp->maxy);
+       } else {
+#ifdef USE_MB
+               dp->text_descent = 0;
+               dp->text_ascent = font_height(mode_font);
+#else
+               dp->text_descent = mode_font->descent;
+               dp->text_ascent = mode_font->ascent;
+#endif
+               if (dp->popex) {
+                       dp->str1pta = (char *) POPEX_STRING;
+                       dp->str1ptb = dp->str1pta;
+               } else if (dp->forest) {
+                       dp->str1pta = (char *) FOREST_STRING;
+                       dp->str1ptb = dp->str1pta;
+               } else if (dp->hiv) {
+                       dp->str1pta = (char *) HIV_STRING;
+                       dp->str1ptb = dp->str1pta;
+               } else if (dp->lab) {
+                       dp->str1pta = (char *) LAB_STRING;
+                       dp->str1ptb = dp->str1pta;
+               } else if (dp->veg) {
+                       dp->str1pta = (char *) VEG_STRING;
+                       dp->str1ptb = dp->str1pta;
+               } else if (dp->y2k) {
+                       if (Y2K_TIME_START >= timeLocal)
+                               dp->str1pta = (char *) Y2K_STRING;
+                       else
+                               dp->str1pta = (char *) POST_Y2K_STRING;
+                       dp->str1ptb = dp->str1pta;
+               } else if (dp->millennium) {
+                       if (Y2001_TIME_START >= timeLocal)
+                               dp->str1pta = (char *) Y2001_STRING;
+                       else
+                               dp->str1pta = (char *) POST_Y2001_STRING;
+                       dp->str1ptb = dp->str1pta;
+               } else {
+                       struct tm *t = localtime((const time_t *) &timeLocal);
+
+                       (void) strftime(dp->str1, STRSIZE, "%I:%M:%S %p", t);
+                       dp->hour = t->tm_hour;
+                       (void) strftime(dp->str2, STRSIZE, "%a %b %d %Y", t);
+
+                       dp->str1pta = dp->str1;
+                       dp->str1ptb = dp->str1old;
+               }
+               if (dp->popex) {
+                       convert(PEOPLE_TIME_START + (PEOPLE_MIN / 60.0) * timeNow, dp->str2);
+                       (void) strncat(dp->str2, PEOPLE_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->forest) {
+                       convert(AREA_TIME_START - (AREA_MIN / 60.0) * timeNow, dp->str2);
+                       (void) strncat(dp->str2, TROPICAL_STRING, STRSIZE-strlen(dp->str2));
+                       (void) strncat(dp->str2, AREA_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->hiv) {
+                       convert(HIV_TIME_START + (HIV_MIN / 60.0) * timeNow, dp->str2);
+                       (void) strncat(dp->str2, CASES_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->lab) {
+                       convert((LAB_MIN / 60.0) * (timeNow - timeAtLastNewYear(timeNow)),
+                               dp->str2);
+                       (void) strncat(dp->str2, YEAR_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2pta;
+               } else if (dp->veg) {
+                       convert((VEG_MIN / 60.0) * (timeNow - timeAtLastNewYear(timeNow)),
+                               dp->str2);
+                       (void) strncat(dp->str2, YEAR_STRING, STRSIZE-strlen(dp->str2));
+                       dp->str2pta = dp->str2;
+               } else if (dp->y2k) {
+                       dayhrminsec(Y2K_TIME_START - timeLocal, dp->tzoffset, dp->str2);
+                       dp->str2pta = dp->str2;
+               } else if (dp->millennium) {
+                       dayhrminsec(Y2001_TIME_START - timeLocal, dp->tzoffset, dp->str2);
+                       dp->str2pta = dp->str2;
+               } else {
+                       dp->str2pta = dp->str2;
+                       dp->str2ptb = dp->str2old;
+               }
+
+               dp->text_height = font_height(mode_font);
+#ifdef USE_MB
+               {
+                       XRectangle ink, logical;
+
+                       XmbTextExtents(mode_font, dp->str1pta, strlen(dp->str1pta), &ink, &logical);
+                       dp->text_width1 = logical.width;
+                       XmbTextExtents(mode_font, dp->str2pta, strlen(dp->str2pta), &ink, &logical);
+                       dp->text_width2 = logical.width;
+               }
+#else
+               dp->text_width1 = XTextWidth(mode_font, dp->str1pta, strlen(dp->str1pta));
+               dp->text_width2 = XTextWidth(mode_font, dp->str2pta, strlen(dp->str2pta));
+#endif
+               if (dp->text_width1 > dp->text_width2) {
+                       dp->text_width = dp->text_width1;
+                       dp->text_start1 = 0;
+                       dp->text_start2 = (dp->text_width - dp->text_width2) / 2;
+               } else {
+                       dp->text_width = dp->text_width2;
+                       dp->text_start1 = (dp->text_width - dp->text_width1) / 2;
+                       dp->text_start2 = 0;
+               }
+               dp->maxy = dp->height - dp->text_height - dp->text_descent;
+               if (dp->maxy - dp->text_ascent == 0)
+                       dp->clocky = dp->text_ascent;
+               else if (dp->maxy - dp->text_ascent < 0)
+                       dp->clocky = -NRAND(dp->text_ascent - dp->maxy) + dp->text_ascent;
+               else
+                       dp->clocky = NRAND(dp->maxy - dp->text_ascent) + dp->text_ascent;
+       }
+       dp->maxx = dp->width - dp->text_width;
+       if (dp->maxx == 0)
+               dp->clockx = dp->text_start1;
+       else if (dp->maxx < 0)
+               dp->clockx = -NRAND(-dp->maxx) + dp->text_start1;
+       else
+               dp->clockx = NRAND(dp->maxx) + dp->text_start1;
+
+       if (MI_NPIXELS(mi) > 2)
+               dp->color = NRAND(MI_NPIXELS(mi));
+
+       /* don't want any exposure events from XCopyPlane */
+       XSetGraphicsExposures(display, MI_GC(mi), False);
+}
+
+void
+draw_dclock(ModeInfo * mi)
+{
+       dclockstruct *dp;
+
+       if (dclocks == NULL)
+               return;
+       dp = &dclocks[MI_SCREEN(mi)];
+       if (mode_font == None)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       drawDclock(mi);
+       if (MI_NPIXELS(mi) > 2) {
+               if (++dp->color >= MI_NPIXELS(mi))
+                       dp->color = 0;
+       }
+}
+
+void
+refresh_dclock(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_dclock */
diff --git a/modes/decay.c b/modes/decay.c
new file mode 100644 (file)
index 0000000..73b12c4
--- /dev/null
@@ -0,0 +1,376 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* decay --- decayscreen */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)decay.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/* xscreensaver, Copyright (c) 1992, 1993, 1994, 1996, 1997
+ * Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+/*
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 17-Mar-1999: Converted from xscreensaver's decayscreen
+ * 
+ * decayscreen
+ *
+ * Based on slidescreen program from the xscreensaver application and the
+ * decay program for Sun framebuffers.  This is the comment from the decay.c
+ * file:
+
+ * decay.c
+ *   find the screen bitmap for the console and make it "decay" by
+ *   randomly shifting random rectangles by one pixelwidth at a time.
+ *
+ *   by David Wald, 1988
+ *        rewritten by Natuerlich!
+ *   based on a similar "utility" on the Apollo ring at Yale.
+
+ * X version by
+ *
+ *  Vivek Khera <khera@cs.duke.edu>
+ *  5-AUG-1993
+ *
+ *  Hacked by jwz, 28-Nov-97 (sped up and added new motion directions)
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Decay"
+#define HACK_INIT init_decay
+#define HACK_DRAW draw_decay
+#define decay_opts xlockmore_opts
+#define DEFAULTS "*delay: 200000 \n" \
+ "*count: 6 \n" \
+ "*cycles: 30 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"    /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"    /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#include "iostuff.h"
+#include "color.h"
+
+#ifdef MODE_decay
+
+extern Bool hide;
+
+ModeSpecOpt decay_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   decay_description =
+{"decay", "init_decay", "draw_decay", "release_decay",
+ "refresh_decay", "init_decay", NULL, &decay_opts,
+ 200000, 6, 30, 1, 64, 0.3, "",
+ "Shows a decaying screen", 0, NULL};
+
+#endif
+
+#define DECAY_WIDTH   image_width
+#define DECAY_HEIGHT    image_height
+#define DECAY_BITS    image_bits
+#include "decay.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define DECAY_NAME    image_name
+#include "decay.xpm"
+#define DEFAULT_XPM 1
+#endif
+
+typedef struct
+{
+       XPoint   windowsize;
+       int      mode;
+
+       XPoint   randompos, randpos;
+       XImage  *logo;
+       GC       backGC;
+       Colormap cmap;
+       int      graphics_format;
+       unsigned long black;
+       Bool     hide;
+} decaystruct;
+
+static decaystruct *   decay_info = NULL;
+
+#define SHUFFLE 0
+#define UP 1
+#define LEFT 2
+#define RIGHT 3
+#define DOWN 4
+#define UPLEFT 5
+#define DOWNLEFT 6
+#define UPRIGHT 7
+#define DOWNRIGHT 8
+#define IN 9
+#define OUT 10
+#define        DEGREE  1
+
+static void
+free_decay(Display * display, decaystruct * dp)
+{
+       if (dp->cmap != None) {
+               XFreeColormap(display, dp->cmap);
+               if (dp->backGC != None) {
+                       XFreeGC(display, dp->backGC);
+                       dp->backGC = None;
+               }
+               dp->cmap = None;
+       } else
+               dp->backGC = None;
+       if (dp->hide && (dp->logo != None)) {
+               destroyImage(&dp->logo, &dp->graphics_format);
+               dp->logo = None;
+       }
+}
+
+static void
+alloc_decay(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       decaystruct *dp = &decay_info[MI_SCREEN(mi)];
+
+       if (dp->hide) {
+               if (dp->logo == None) {
+                       getImage(mi, &dp->logo, DECAY_WIDTH, DECAY_HEIGHT, DECAY_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                               DEFAULT_XPM, DECAY_NAME,
+#endif
+                               &dp->graphics_format, &dp->cmap, &dp->black);
+                       if (dp->logo == None) {
+                               free_decay(display, dp);
+                               return;
+                       }
+               }
+#ifndef STANDALONE
+               if (dp->cmap != None) {
+                       setColormap(display, window, dp->cmap, MI_IS_INWINDOW(mi));
+                       if (dp->backGC == None) {
+                               XGCValues   xgcv;
+
+                               xgcv.background = dp->black;
+                               dp->backGC = XCreateGC(display, window, GCBackground, &xgcv);
+                               if (dp->backGC == None) {
+                                       free_decay(display, dp);
+                                       return;
+                               }
+                       }
+               } else
+#endif /* STANDALONE */
+               {
+                       dp->black = MI_BLACK_PIXEL(mi);
+                       dp->backGC = MI_GC(mi);
+               }
+       }
+#ifndef STANDALONE
+       else {
+               setColormap(display, window, DefaultColormapOfScreen(MI_SCREENPTR(mi)), MI_IS_INWINDOW(mi));
+               dp->backGC = MI_GC(mi);
+       }
+#endif /* STANDALONE */
+}
+
+void
+init_decay(ModeInfo * mi)
+{
+       Display *display = MI_DISPLAY(mi);
+       Window window = MI_WINDOW(mi);
+       decaystruct *dp;
+
+       char *s = (char*) "random";
+
+       if (decay_info == NULL) {
+               if ((decay_info = (decaystruct *) calloc(MI_NUM_SCREENS(mi),
+                                               sizeof(decaystruct))) == NULL)
+                       return;
+       }
+       dp = &decay_info[MI_SCREEN(mi)];
+
+       if      (s && !strcmp(s, "shuffle")) dp->mode = SHUFFLE;
+       else if (s && !strcmp(s, "up")) dp->mode = UP;
+       else if (s && !strcmp(s, "left")) dp->mode = LEFT;
+       else if (s && !strcmp(s, "right")) dp->mode = RIGHT;
+       else if (s && !strcmp(s, "down")) dp->mode = DOWN;
+       else if (s && !strcmp(s, "upleft")) dp->mode = UPLEFT;
+       else if (s && !strcmp(s, "downleft")) dp->mode = DOWNLEFT;
+       else if (s && !strcmp(s, "upright")) dp->mode = UPRIGHT;
+       else if (s && !strcmp(s, "downright")) dp->mode = DOWNRIGHT;
+       else if (s && !strcmp(s, "in")) dp->mode = IN;
+       else if (s && !strcmp(s, "out")) dp->mode = OUT;
+       else {
+               if (s && *s && !!strcmp(s, "random"))
+                       (void) fprintf(stderr, "%s: unknown mode %s\n", ProgramName, s);
+               dp->mode = (int) (LRAND() % (OUT+1));
+       }
+
+       if (MI_IS_FULLRANDOM(mi) && !hide)
+               dp->hide = (Bool) (LRAND() & 1);
+       else
+               dp->hide = hide;
+
+
+       dp->windowsize.x = MI_WIDTH(mi);
+       dp->windowsize.y = MI_HEIGHT(mi);
+       alloc_decay(mi);
+       if (!dp->backGC)
+               return;
+       if (dp->hide) {
+               /* do not want any exposure events from XCopyArea */
+               XSetGraphicsExposures(display, dp->backGC, False);
+               MI_CLEARWINDOWCOLORMAP(mi, dp->backGC, dp->black);
+               dp->randompos.x =
+                       NRAND(MAX((dp->windowsize.x - dp->logo->width), 1));
+                dp->randompos.y =
+                       NRAND(MAX((dp->windowsize.y - dp->logo->height), 1));
+               if (MI_NPIXELS(mi) <= 2)
+                       XSetForeground(display, dp->backGC, MI_WHITE_PIXEL(mi));
+               else
+                       XSetForeground(display, dp->backGC, MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+               (void) XPutImage(display, window, dp->backGC, dp->logo,
+                       (int) (NRAND(MAX(1, (dp->logo->width - dp->windowsize.x)))),
+                       (int) (NRAND(MAX(1, (dp->logo->height - dp->windowsize.y)))),
+                                 dp->randompos.x, dp->randompos.y,
+                                 dp->windowsize.x, dp->windowsize.y);
+
+       } else {
+               XCopyArea (MI_DISPLAY(mi), MI_ROOT_PIXMAP(mi), MI_WINDOW(mi),
+                      dp->backGC, 0, 0, MI_WIDTH(mi), MI_HEIGHT(mi),
+                      0, 0);
+               XFlush(MI_DISPLAY(mi));
+       }
+}
+
+
+/*
+ * perform one iteration of decay
+ */
+void
+draw_decay (ModeInfo * mi)
+{
+    int left, top, width, height, toleft, totop;
+
+#define L 101
+#define R 102
+#define U 103
+#define D 104
+    static int no_bias[]        = { L,L,L,L, R,R,R,R, U,U,U,U, D,D,D,D };
+    static int up_bias[]        = { L,L,L,L, R,R,R,R, U,U,U,U, U,U,D,D };
+    static int down_bias[]      = { L,L,L,L, R,R,R,R, U,U,D,D, D,D,D,D };
+    static int left_bias[]      = { L,L,L,L, L,L,R,R, U,U,U,U, D,D,D,D };
+    static int right_bias[]     = { L,L,R,R, R,R,R,R, U,U,U,U, D,D,D,D };
+
+    static int upleft_bias[]    = { L,L,L,L, L,R,R,R, U,U,U,U, U,D,D,D };
+    static int downleft_bias[]  = { L,L,L,L, L,R,R,R, U,U,U,D, D,D,D,D };
+    static int upright_bias[]   = { L,L,L,R, R,R,R,R, U,U,U,U, U,D,D,D };
+    static int downright_bias[] = { L,L,L,R, R,R,R,R, U,U,U,D, D,D,D,D };
+    static int *bias;
+    decaystruct * dp;
+
+       if (decay_info == NULL)
+               return;
+       dp = &decay_info[MI_SCREEN(mi)];
+       if (dp->backGC == None)
+               return;
+
+    switch (dp->mode) {
+      case SHUFFLE:    bias = no_bias; break;
+      case UP:         bias = up_bias; break;
+      case LEFT:       bias = left_bias; break;
+      case RIGHT:      bias = right_bias; break;
+      case DOWN:       bias = down_bias; break;
+      case UPLEFT:     bias = upleft_bias; break;
+      case DOWNLEFT:   bias = downleft_bias; break;
+      case UPRIGHT:    bias = upright_bias; break;
+      case DOWNRIGHT:  bias = downright_bias; break;
+      case IN:         bias = no_bias; break;
+      case OUT:                bias = no_bias; break;
+      default: abort();
+    }
+
+    left = NRAND(dp->windowsize.x - 1);
+    top = NRAND(dp->windowsize.y);
+    width = NRAND(dp->windowsize.x - left);
+    height = NRAND(dp->windowsize.y - top);
+
+    toleft = left;
+    totop = top;
+
+    if (dp->mode == IN || dp->mode == OUT) {
+      int x = left+(width/2);
+      int y = top+(height/2);
+      int cx = dp->windowsize.x/2;
+      int cy = dp->windowsize.y/2;
+      if (dp->mode == IN) {
+       if      (x > cx && y > cy)   bias = upleft_bias;
+       else if (x < cx && y > cy)   bias = upright_bias;
+       else if (x < cx && y < cy)   bias = downright_bias;
+       else /* (x > cx && y < cy)*/ bias = downleft_bias;
+      } else {
+       if      (x > cx && y > cy)   bias = downright_bias;
+       else if (x < cx && y > cy)   bias = downleft_bias;
+       else if (x < cx && y < cy)   bias = upleft_bias;
+       else /* (x > cx && y < cy)*/ bias = upright_bias;
+      }
+    }
+
+    switch (bias[LRAND() % (sizeof(no_bias)/sizeof(*no_bias))]) {
+      case L: toleft = left-DEGREE; break;
+      case R: toleft = left+DEGREE; break;
+      case U: totop = top-DEGREE; break;
+      case D: totop = top+DEGREE; break;
+      default: abort(); break;
+    }
+
+    XCopyArea (MI_DISPLAY(mi), MI_WINDOW(mi), MI_WINDOW(mi),
+              dp->backGC, left, top, width, height,
+              toleft, totop);
+    XFlush(MI_DISPLAY(mi));
+
+}
+
+void
+refresh_decay(ModeInfo * mi)
+{
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       decaystruct *dp;
+
+       if (decay_info == NULL)
+               return;
+       dp = &decay_info[MI_SCREEN(mi)];
+
+       if (dp->graphics_format >= IS_XPM) {
+               /* This is needed when another program changes the colormap. */
+               free_decay(MI_DISPLAY(mi), dp);
+               init_decay(mi);
+               return;
+       }
+#endif
+}
+
+void
+release_decay(ModeInfo * mi)
+{
+       if (decay_info != NULL) {
+               int     screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_decay(MI_DISPLAY(mi), &decay_info[screen]);
+               (void) free((void *) decay_info);
+               decay_info = NULL;
+       }
+}
+
+#endif /* MODE_decay */
diff --git a/modes/deco.c b/modes/deco.c
new file mode 100644 (file)
index 0000000..fadf381
--- /dev/null
@@ -0,0 +1,191 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* deco --- art as ugly as sin */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)deco.c       5.00 2000/11/01 xlockmore";
+
+#endif
+/*
+ * Copyright (c) 1997 by Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 29-Oct-1997: xlock version (David Bagley <bagleyd@tux.org>)
+ * 1997: xscreensaver version Jamie Zawinski <jwz@jwz.org>
+ */
+
+/*-
+ * original copyright
+ * xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * Concept snarfed from Michael D. Bayne in
+ * http://www.go2net.com/internet/deep/1997/04/16/body.html
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Deco"
+#define HACK_INIT init_deco
+#define HACK_DRAW draw_deco
+#define deco_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000000 \n" \
+ "*count: -30 \n" \
+ "*cycles: 2 \n" \
+ "*size: -10 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_deco
+
+ModeSpecOpt deco_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   deco_description =
+{"deco", "init_deco", "draw_deco", "release_deco",
+ "init_deco", "init_deco", NULL, &deco_opts,
+ 1000000, -30, 2, -10, 64, 0.6, "",
+ "Shows art as ugly as sin", 0, NULL};
+
+#endif
+
+#define MINSIZE 2
+#define MINDEPTH 1
+
+typedef struct {
+       int         max_depth;
+       int         min_height;
+       int         min_width;
+       int         time;
+       int         colorindex;
+       unsigned long bordercolor;
+} decostruct;
+
+static decostruct *decos = NULL;
+
+static void
+deco(ModeInfo * mi, int x, int y, int w, int h, int depth)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       decostruct *dp = &decos[MI_SCREEN(mi)];
+
+       if ((NRAND(dp->max_depth) + 1 < depth) ||
+           (w < dp->min_width) || (h < dp->min_height)) {
+               if (w > 2 && h > 2) {
+                       if (MI_NPIXELS(mi) > 2) {
+                               XSetForeground(display, gc, MI_PIXEL(mi, dp->colorindex));
+                               if (++dp->colorindex >= MI_NPIXELS(mi))
+                                       dp->colorindex = 0;
+                       } else
+                               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                       XFillRectangle(display, window, gc, x + 1, y + 1, w - 2, h - 2);
+               }
+       } else {
+               if (LRAND() & 1) {
+                       deco(mi, x, y, w / 2, h, depth + 1);
+                       deco(mi, x + w / 2, y, w - w / 2, h, depth + 1);
+               } else {
+                       deco(mi, x, y, w, h / 2, depth + 1);
+                       deco(mi, x, y + h / 2, w, h - h / 2, depth + 1);
+               }
+       }
+}
+
+void
+init_deco(ModeInfo * mi)
+{
+       decostruct *dp;
+       int         depth = MI_COUNT(mi);
+       int         size = MI_SIZE(mi);
+
+       if (decos == NULL) {
+               if ((decos = (decostruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (decostruct))) == NULL)
+                       return;
+       }
+       dp = &decos[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) > 2) {
+               dp->bordercolor = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+               dp->colorindex = NRAND(MI_NPIXELS(mi));
+       } else
+               dp->bordercolor = MI_BLACK_PIXEL(mi);
+       if (depth < -MINDEPTH)
+               dp->max_depth = NRAND(-depth - MINDEPTH + 1) + MINDEPTH;
+       else if (depth < MINDEPTH)
+               dp->max_depth = MINDEPTH;
+       else
+               dp->max_depth = depth;
+       if (size < -MINSIZE) {
+               dp->min_width = NRAND(-size - MINSIZE + 1) + MINSIZE;
+               dp->min_height = NRAND(-size - MINSIZE + 1) + MINSIZE;
+       } else if (size < MINDEPTH)
+               dp->min_width = dp->min_height = MINSIZE;
+       else
+               dp->min_width = dp->min_height = size;
+       dp->time = 0;
+}
+
+void
+draw_deco(ModeInfo * mi)
+{
+       decostruct *dp;
+
+       if (decos == NULL)
+               return;
+       dp = &decos[MI_SCREEN(mi)];
+
+       if (dp->time == 0) {
+               /* This fills up holes */
+               MI_CLEARWINDOWCOLOR(mi, dp->bordercolor);
+#ifdef SOLARIS2
+               /*
+                * if this is not done the first rectangle is sometimes messed up on
+                * Solaris2 with 24 bit TrueColor (Ultra2)
+                */
+               XDrawRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                         0, 0, MI_WIDTH(mi) / 2 + 1, MI_HEIGHT(mi) / 2 + 1);
+#endif
+               deco(mi, 0, 0, MI_WIDTH(mi), MI_HEIGHT(mi), 0);
+       }
+       if (++dp->time > MI_CYCLES(mi))
+               init_deco(mi);
+
+       MI_IS_DRAWN(mi) = True;
+
+}
+
+void
+release_deco(ModeInfo * mi)
+{
+       if (decos != NULL) {
+               (void) free((void *) decos);
+               decos = NULL;
+       }
+}
+
+#endif /* MODE_deco */
diff --git a/modes/demon.c b/modes/demon.c
new file mode 100644 (file)
index 0000000..e3fe164
--- /dev/null
@@ -0,0 +1,967 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* demon --- David Griffeath's cellular automata */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)demon.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 16-Apr-1997: -neighbors 3, 9 (not sound mathematically), 12, and 8 added
+ * 30-May-1996: Ron Hitchens <ron@idiom.com>
+ *            Fixed memory management that caused leaks
+ * 14-Apr-1996: -neighbors 6 runtime-time option added
+ * 21-Aug-1995: Coded from A.K. Dewdney's "Computer Recreations", Scientific
+ *              American Magazine" Aug 1989 pp 102-105.  Also very similar
+ *              to hodgepodge machine described in A.K. Dewdney's "Computer
+ *              Recreations", Scientific American Magazine" Aug 1988
+ *              pp 104-107.  Also used life.c as a guide.
+ */
+
+/*-
+ * A cellular universe of 4 phases debris, droplets, defects, and demons.
+ */
+
+/*-
+  Grid     Number of Neighbors
+  ----     ------------------
+  Square   4 or 8
+  Hexagon  6
+  Triangle 3, 9, or 12
+*/
+
+#ifdef STANDALONE
+#define PROGCLASS "Demon"
+#define HACK_INIT init_demon
+#define HACK_DRAW draw_demon
+#define demon_opts xlockmore_opts
+#define DEFAULTS "*delay: 50000 \n" \
+ "*count: 0 \n" \
+ "*cycles: 1000 \n" \
+ "*size: -7 \n" \
+ "*ncolors: 64 \n" \
+ "*neighbors: 0 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_demon
+
+/*-
+ * neighbors of 0 randomizes it between 3, 4, 6, 8, 9, and 12.
+ */
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+
+static int  neighbors;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".demon.neighbors", XrmoptionSepArg, (caddr_t) NULL}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3, 9 or 12"}
+};
+
+ModeSpecOpt demon_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   demon_description =
+{"demon", "init_demon", "draw_demon", "release_demon",
+ "refresh_demon", "init_demon", NULL, &demon_opts,
+ 50000, 0, 1000, -7, 64, 1.0, "",
+ "Shows Griffeath's cellular automata", 0, NULL};
+
+#endif
+
+#define DEMONBITS(n,w,h)\
+  if ((dp->pixmaps[dp->init_bits]=\
+  XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
+  free_demon(display,dp); return;} else {dp->init_bits++;}
+
+#define REDRAWSTEP 2000                /* How many cells to draw per cycle */
+#define MINSTATES 2
+#define MINGRIDSIZE 24
+#define MINSIZE 4
+#define NEIGHBORKINDS 6
+
+/* Singly linked list */
+typedef struct _CellList {
+       XPoint      pt;
+       struct _CellList *next;
+} CellList;
+
+typedef struct {
+       int         generation;
+       int         xs, ys;
+       int         xb, yb;
+       int         nrows, ncols;
+       int         width, height;
+       int         states;
+       int         state;
+       int         redrawing, redrawpos;
+       int        *ncells;
+       CellList  **cellList;
+       unsigned char *oldcell, *newcell;
+       int         neighbors;
+       int         init_bits;
+       GC          stippledGC;
+       Pixmap      pixmaps[NUMSTIPPLES - 1];
+       union {
+               XPoint      hexagon[6];
+               XPoint      triangle[2][3];
+       } shape;
+} demonstruct;
+
+static char plots[2][NEIGHBORKINDS] =
+{
+       {3, 4, 6, 8, 9, 12},    /* Neighborhoods */
+       {12, 16, 18, 20, 22, 24}        /* Number of states */
+};
+
+static demonstruct *demons = NULL;
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned char state)
+{
+       demonstruct *dp = &demons[MI_SCREEN(mi)];
+       GC          gc;
+
+       if (!state) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+               gc = MI_GC(mi);
+       } else if (MI_NPIXELS(mi) >= NUMSTIPPLES) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi),
+                          MI_PIXEL(mi, (((int) state - 1) * MI_NPIXELS(mi) /
+                                        (dp->states - 1)) % MI_NPIXELS(mi)));
+               gc = MI_GC(mi);
+       } else {
+               XGCValues   gcv;
+
+               gcv.stipple = dp->pixmaps[(state - 1) % (NUMSTIPPLES - 1)];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), dp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = dp->stippledGC;
+       }
+       if (dp->neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               dp->shape.hexagon[0].x = dp->xb + ccol * dp->xs;
+               dp->shape.hexagon[0].y = dp->yb + crow * dp->ys;
+               if (dp->xs == 1 && dp->ys == 1)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi),
+                                      gc, dp->shape.hexagon[0].x, dp->shape.hexagon[0].y);
+               else
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                           dp->shape.hexagon, 6, Convex, CoordModePrevious);
+       } else if (dp->neighbors == 4 || dp->neighbors == 8) {
+               XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+               dp->xb + dp->xs * col, dp->yb + dp->ys * row,
+               dp->xs - (dp->xs > 3), dp->ys - (dp->ys > 3));
+       } else {                /* TRI */
+               int         orient = (col + row) % 2;   /* O left 1 right */
+
+               dp->shape.triangle[orient][0].x = dp->xb + col * dp->xs;
+               dp->shape.triangle[orient][0].y = dp->yb + row * dp->ys;
+               if (dp->xs <= 3 || dp->ys <= 3)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                       ((orient) ? -1 : 1) + dp->shape.triangle[orient][0].x,
+                                      dp->shape.triangle[orient][0].y);
+               else {
+                       if (orient)
+                               dp->shape.triangle[orient][0].x += (dp->xs / 2 - 1);
+                       else
+                               dp->shape.triangle[orient][0].x -= (dp->xs / 2 - 1);
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                    dp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+
+               }
+       }
+}
+
+static Bool
+addtolist(ModeInfo * mi, int col, int row, unsigned char state)
+{
+       demonstruct *dp = &demons[MI_SCREEN(mi)];
+       CellList   *current;
+
+       current = dp->cellList[state];
+       if ((dp->cellList[state] = (CellList *)
+               malloc(sizeof (CellList))) == NULL) {
+               return False;
+       }
+       dp->cellList[state]->pt.x = col;
+       dp->cellList[state]->pt.y = row;
+       dp->cellList[state]->next = current;
+       dp->ncells[state]++;
+       return True;
+}
+
+#ifdef DEBUG
+static void
+print_state(ModeInfo * mi, int state)
+{
+       demonstruct *dp = &demons[MI_SCREEN(mi)];
+       CellList   *locallist;
+       int         i = 0;
+
+       locallist = dp->cellList[state];
+       (void) printf("state %d\n", state);
+       while (locallist) {
+               (void) printf("%d       x %d, y %d\n", i,
+                             locallist->pt.x, locallist->pt.y);
+               locallist = locallist->next;
+               i++;
+       }
+}
+
+#endif
+
+static void
+free_state(demonstruct * dp, int state)
+{
+       CellList   *current;
+
+       while (dp->cellList[state]) {
+               current = dp->cellList[state];
+               dp->cellList[state] = dp->cellList[state]->next;
+               (void) free((void *) current);
+       }
+       dp->cellList[state] = NULL;
+       if (dp->ncells != NULL)
+               dp->ncells[state] = 0;
+}
+
+
+static void
+free_list(demonstruct * dp)
+{
+       int         state;
+
+       for (state = 0; state < dp->states; state++)
+               free_state(dp, state);
+       (void) free((void *) dp->cellList);
+       dp->cellList = NULL;
+}
+
+static void
+free_struct(demonstruct * dp)
+{
+       if (dp->cellList != NULL) {
+               free_list(dp);
+       }
+       if (dp->ncells != NULL) {
+               (void) free((void *) dp->ncells);
+               dp->ncells = NULL;
+       }
+       if (dp->oldcell != NULL) {
+               (void) free((void *) dp->oldcell);
+               dp->oldcell = NULL;
+       }
+       if (dp->newcell != NULL) {
+               (void) free((void *) dp->newcell);
+               dp->newcell = NULL;
+       }
+}
+
+static void
+free_demon(Display *display, demonstruct *dp)
+{
+       int         shade;
+
+       if (dp->stippledGC != None) {
+               XFreeGC(display, dp->stippledGC);
+               dp->stippledGC = None;
+       }
+       for (shade = 0; shade < dp->init_bits; shade++) {
+               XFreePixmap(display, dp->pixmaps[shade]);
+       }
+       dp->init_bits = 0;
+       free_struct(dp);
+}
+
+static Bool
+draw_state(ModeInfo * mi, int state)
+{
+       demonstruct *dp = &demons[MI_SCREEN(mi)];
+       GC          gc;
+       XRectangle *rects;
+       CellList   *current;
+
+       if (!state) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+               gc = MI_GC(mi);
+       } else if (MI_NPIXELS(mi) >= NUMSTIPPLES) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi),
+                          MI_PIXEL(mi, (((int) state - 1) * MI_NPIXELS(mi) /
+                                        (dp->states - 1)) % MI_NPIXELS(mi)));
+               gc = MI_GC(mi);
+       } else {
+               XGCValues   gcv;
+
+               gcv.stipple = dp->pixmaps[(state - 1) % (NUMSTIPPLES - 1)];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), dp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = dp->stippledGC;
+       }
+       if (dp->neighbors == 6) {       /* Draw right away, slow */
+               current = dp->cellList[state];
+               while (current) {
+                       int         col, row, ccol, crow;
+
+                       col = current->pt.x;
+                       row = current->pt.y;
+                       ccol = 2 * col + !(row & 1), crow = 2 * row;
+                       dp->shape.hexagon[0].x = dp->xb + ccol * dp->xs;
+                       dp->shape.hexagon[0].y = dp->yb + crow * dp->ys;
+                       if (dp->xs == 1 && dp->ys == 1)
+                               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi),
+                                              gc, dp->shape.hexagon[0].x, dp->shape.hexagon[0].y);
+                       else
+                               XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                            dp->shape.hexagon, 6, Convex, CoordModePrevious);
+                       current = current->next;
+               }
+       } else if (dp->neighbors == 4 || dp->neighbors == 8) {
+               /* Take advantage of XDrawRectangles */
+               int         ncells = 0;
+
+               /* Create Rectangle list from part of the cellList */
+               if ((rects = (XRectangle *) malloc(dp->ncells[state] *
+                        sizeof (XRectangle))) == NULL) {
+                       return False;
+               }
+               current = dp->cellList[state];
+               while (current) {
+                       rects[ncells].x = dp->xb + current->pt.x * dp->xs;
+                       rects[ncells].y = dp->yb + current->pt.y * dp->ys;
+                       rects[ncells].width = dp->xs - (dp->xs > 3);
+                       rects[ncells].height = dp->ys - (dp->ys > 3);
+                       current = current->next;
+                       ncells++;
+               }
+               /* Finally get to draw */
+               XFillRectangles(MI_DISPLAY(mi), MI_WINDOW(mi), gc, rects, ncells);
+               /* Free up rects list and the appropriate part of the cellList */
+               (void) free((void *) rects);
+       } else {                /* TRI */
+               current = dp->cellList[state];
+               while (current) {
+                       int         col, row, orient;
+
+                       col = current->pt.x;
+                       row = current->pt.y;
+                       orient = (col + row) % 2;       /* O left 1 right */
+                       dp->shape.triangle[orient][0].x = dp->xb + col * dp->xs;
+                       dp->shape.triangle[orient][0].y = dp->yb + row * dp->ys;
+                       if (dp->xs <= 3 || dp->ys <= 3)
+                               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                              ((orient) ? -1 : 1) + dp->shape.triangle[orient][0].x,
+                                     dp->shape.triangle[orient][0].y);
+                       else {
+                               if (orient)
+                                       dp->shape.triangle[orient][0].x += (dp->xs / 2 - 1);
+                               else
+                                       dp->shape.triangle[orient][0].x -= (dp->xs / 2 - 1);
+                               XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                            dp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+                       }
+                       current = current->next;
+               }
+       }
+       free_state(dp, state);
+       XFlush(MI_DISPLAY(mi));
+       return True;
+}
+
+static void
+RandomSoup(ModeInfo * mi)
+{
+       demonstruct *dp = &demons[MI_SCREEN(mi)];
+       int         row, col, mrow = 0;
+
+       for (row = 0; row < dp->nrows; ++row) {
+               for (col = 0; col < dp->ncols; ++col) {
+                       dp->oldcell[col + mrow] =
+                               (unsigned char) LRAND() % ((unsigned char) dp->states);
+                       if (!addtolist(mi, col, row, dp->oldcell[col + mrow]))
+                               return; /* sparse soup */
+               }
+               mrow += dp->ncols;
+       }
+}
+
+void
+init_demon(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi), nk;
+       demonstruct *dp;
+
+       if (demons == NULL) {
+               if ((demons = (demonstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (demonstruct))) == NULL)
+                       return;
+       }
+       dp = &demons[MI_SCREEN(mi)];
+
+       dp->generation = 0;
+       dp->redrawing = 0;
+       if (MI_NPIXELS(mi) < NUMSTIPPLES) {
+               if (dp->stippledGC == None) {
+                       XGCValues   gcv;
+
+                       gcv.fill_style = FillOpaqueStippled;
+                       if ((dp->stippledGC = XCreateGC(display, window,
+                                GCFillStyle, &gcv)) == None) {
+                               free_demon(display, dp);
+                               return;
+                       }
+               }
+               if (dp->init_bits == 0) {
+                       int         i;
+
+                       for (i = 1; i < NUMSTIPPLES; i++) {
+                               DEMONBITS(stipples[i], STIPPLESIZE, STIPPLESIZE);
+                       }
+               }
+       }
+       free_struct(dp);
+
+       for (nk = 0; nk < NEIGHBORKINDS; nk++) {
+               if (neighbors == plots[0][nk]) {
+                       dp->neighbors = plots[0][nk];
+                       break;
+               }
+               if (nk == NEIGHBORKINDS - 1) {
+                       nk = NRAND(NEIGHBORKINDS);
+                       dp->neighbors = plots[0][nk];
+                       break;
+               }
+       }
+
+       dp->states = MI_COUNT(mi);
+       if (dp->states < -MINSTATES)
+               dp->states = NRAND(-dp->states - MINSTATES + 1) + MINSTATES;
+       else if (dp->states < MINSTATES)
+               dp->states = plots[1][nk];
+       if ((dp->cellList = (CellList **) calloc(dp->states,
+               sizeof (CellList *))) == NULL) {
+               free_demon(display, dp);
+               return;
+       }
+       if ((dp->ncells = (int *) calloc(dp->states, sizeof (int))) == NULL) {
+               free_demon(display, dp);
+               return;
+       }
+
+       dp->state = 0;
+
+       dp->width = MI_WIDTH(mi);
+       dp->height = MI_HEIGHT(mi);
+
+       if (dp->neighbors == 6) {
+               int         nccols, ncrows, i;
+
+               if (dp->width < 2)
+                       dp->width = 2;
+               if (dp->height < 4)
+                       dp->height = 4;
+               if (size < -MINSIZE)
+                       dp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               dp->ys = MAX(MINSIZE, MIN(dp->width, dp->height) / MINGRIDSIZE);
+                       else
+                               dp->ys = MINSIZE;
+               } else
+                       dp->ys = MIN(size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                              MINGRIDSIZE));
+               dp->xs = dp->ys;
+               nccols = MAX(dp->width / dp->xs - 2, 2);
+               ncrows = MAX(dp->height / dp->ys - 1, 2);
+               dp->ncols = nccols / 2;
+               dp->nrows = 2 * (ncrows / 4);
+               dp->xb = (dp->width - dp->xs * nccols) / 2 + dp->xs / 2;
+               dp->yb = (dp->height - dp->ys * (ncrows / 2) * 2) / 2 + dp->ys - 2;
+               for (i = 0; i < 6; i++) {
+                       dp->shape.hexagon[i].x = (dp->xs - 1) * hexagonUnit[i].x;
+                       dp->shape.hexagon[i].y = ((dp->ys - 1) * hexagonUnit[i].y / 2) * 4 / 3;
+               }
+       } else if (dp->neighbors == 4 || dp->neighbors == 8) {
+               if (size < -MINSIZE)
+                       dp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               dp->ys = MAX(MINSIZE, MIN(dp->width, dp->height) / MINGRIDSIZE);
+                       else
+                               dp->ys = MINSIZE;
+               } else
+                       dp->ys = MIN(size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                              MINGRIDSIZE));
+               dp->xs = dp->ys;
+               dp->ncols = MAX(dp->width / dp->xs, 2);
+               dp->nrows = MAX(dp->height / dp->ys, 2);
+               dp->xb = (dp->width - dp->xs * dp->ncols) / 2;
+               dp->yb = (dp->height - dp->ys * dp->nrows) / 2;
+       } else {                /* TRI */
+               int         orient, i;
+
+               if (dp->width < 2)
+                       dp->width = 2;
+               if (dp->height < 2)
+                       dp->height = 2;
+               if (size < -MINSIZE)
+                       dp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               dp->ys = MAX(MINSIZE, MIN(dp->width, dp->height) / MINGRIDSIZE);
+                       else
+                               dp->ys = MINSIZE;
+               } else
+                       dp->ys = MIN(size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                              MINGRIDSIZE));
+               dp->xs = (int) (1.52 * dp->ys);
+               dp->ncols = (MAX(dp->width / dp->xs - 1, 2) / 2) * 2;
+               dp->nrows = (MAX(dp->height / dp->ys - 1, 2) / 2) * 2;
+               dp->xb = (dp->width - dp->xs * dp->ncols) / 2 + dp->xs / 2;
+               dp->yb = (dp->height - dp->ys * dp->nrows) / 2 + dp->ys / 2;
+               for (orient = 0; orient < 2; orient++) {
+                       for (i = 0; i < 3; i++) {
+                               dp->shape.triangle[orient][i].x =
+                                       (dp->xs - 2) * triangleUnit[orient][i].x;
+                               dp->shape.triangle[orient][i].y =
+                                       (dp->ys - 2) * triangleUnit[orient][i].y;
+                       }
+               }
+       }
+
+       MI_CLEARWINDOW(mi);
+
+       if ((dp->oldcell = (unsigned char *)
+               malloc(dp->ncols * dp->nrows * sizeof (unsigned char))) == NULL) {
+               free_demon(display, dp);
+               return;
+       }
+
+       if ((dp->newcell = (unsigned char *)
+               malloc(dp->ncols * dp->nrows * sizeof (unsigned char))) == NULL) {
+               free_demon(display, dp);
+               return;
+       }
+
+       RandomSoup(mi);
+}
+
+void
+draw_demon(ModeInfo * mi)
+{
+       int         i, j, k, l, mj = 0, ml;
+       demonstruct *dp;
+
+       if (demons == NULL)
+               return;
+       dp = &demons[MI_SCREEN(mi)];
+       if (dp->cellList == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (dp->state >= dp->states) {
+               (void) memcpy((char *) dp->newcell, (char *) dp->oldcell,
+                             dp->ncols * dp->nrows * sizeof (unsigned char));
+
+               if (dp->neighbors == 6) {
+                       for (j = 0; j < dp->nrows; j++) {
+                               for (i = 0; i < dp->ncols; i++) {
+                                       /* NE */
+                                       if (!(j & 1))
+                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                       else
+                                               k = i;
+                                       l = (!j) ? dp->nrows - 1 : j - 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* E */
+                                       k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                       ml = mj;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* SE */
+                                       if (!(j & 1))
+                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                       else
+                                               k = i;
+                                       l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* SW */
+                                       if (j & 1)
+                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                       else
+                                               k = i;
+                                       l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* W */
+                                       k = (!i) ? dp->ncols - 1 : i - 1;
+                                       ml = mj;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* NW */
+                                       if (j & 1)
+                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                       else
+                                               k = i;
+                                       l = (!j) ? dp->nrows - 1 : j - 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                               }
+                               mj += dp->ncols;
+                       }
+               } else if (dp->neighbors == 4 || dp->neighbors == 8) {
+                       for (j = 0; j < dp->nrows; j++) {
+                               for (i = 0; i < dp->ncols; i++) {
+                                       /* N */
+                                       k = i;
+                                       l = (!j) ? dp->nrows - 1 : j - 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* E */
+                                       k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                       ml = mj;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* S */
+                                       k = i;
+                                       l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* W */
+                                       k = (!i) ? dp->ncols - 1 : i - 1;
+                                       l = j;
+                                       ml = mj;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                               }
+                               mj += dp->ncols;
+                       }
+                       if (dp->neighbors == 8) {
+                               mj = 0;
+                               for (j = 0; j < dp->nrows; j++) {
+                                       for (i = 0; i < dp->ncols; i++) {
+                                               /* NE */
+                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                               l = (!j) ? dp->nrows - 1 : j - 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* SE */
+                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                               l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* SW */
+                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                               l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* NW */
+                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                               l = (!j) ? dp->nrows - 1 : j - 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       }
+                                       mj += dp->ncols;
+                               }
+                       }
+               } else if (dp->neighbors == 3 || dp->neighbors == 9 ||
+                          dp->neighbors == 12) {
+                       for (j = 0; j < dp->nrows; j++) {
+                               for (i = 0; i < dp->ncols; i++) {
+                                       if ((i + j) % 2) {      /* right */
+                                               /* W */
+                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                               ml = mj;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       } else {        /* left */
+                                               /* E */
+                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                               ml = mj;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       }
+                                       /* N */
+                                       k = i;
+                                       l = (!j) ? dp->nrows - 1 : j - 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       /* S */
+                                       k = i;
+                                       l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                       ml = l * dp->ncols;
+                                       if (dp->oldcell[k + ml] ==
+                                           (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                               dp->newcell[i + mj] = dp->oldcell[k + ml];
+                               }
+                               mj += dp->ncols;
+                       }
+                       if (dp->neighbors == 9 || dp->neighbors == 12) {
+                               mj = 0;
+                               for (j = 0; j < dp->nrows; j++) {
+                                       for (i = 0; i < dp->ncols; i++) {
+                                               /* NN */
+                                               k = i;
+                                               if (!j)
+                                                       l = dp->nrows - 2;
+                                               else if (!(j - 1))
+                                                       l = dp->nrows - 1;
+                                               else
+                                                       l = j - 2;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* SS */
+                                               k = i;
+                                               if (j + 1 == dp->nrows)
+                                                       l = 1;
+                                               else if (j + 2 == dp->nrows)
+                                                       l = 0;
+                                               else
+                                                       l = j + 2;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* NW */
+                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                               l = (!j) ? dp->nrows - 1 : j - 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* NE */
+                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                               l = (!j) ? dp->nrows - 1 : j - 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* SW */
+                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                               l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                               /* SE */
+                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                               l = (j + 1 == dp->nrows) ? 0 : j + 1;
+                                               ml = l * dp->ncols;
+                                               if (dp->oldcell[k + ml] ==
+                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                       }
+                                       mj += dp->ncols;
+                               }
+                               if (dp->neighbors == 12) {
+                                       mj = 0;
+                                       for (j = 0; j < dp->nrows; j++) {
+                                               for (i = 0; i < dp->ncols; i++) {
+                                                       if ((i + j) % 2) {      /* right */
+                                                               /* NNW */
+                                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                                               if (!j)
+                                                                       l = dp->nrows - 2;
+                                                               else if (!(j - 1))
+                                                                       l = dp->nrows - 1;
+                                                               else
+                                                                       l = j - 2;
+                                                               ml = l * dp->ncols;
+                                                               if (dp->oldcell[k + ml] ==
+                                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                                               /* SSW */
+                                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                                               if (j + 1 == dp->nrows)
+                                                                       l = 1;
+                                                               else if (j + 2 == dp->nrows)
+                                                                       l = 0;
+                                                               else
+                                                                       l = j + 2;
+                                                               ml = l * dp->ncols;
+                                                               if (dp->oldcell[k + ml] ==
+                                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                                               /* EE */
+                                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                                               l = j;
+                                                               ml = mj;
+                                                               if (dp->oldcell[k + ml] ==
+                                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                                       } else {        /* left */
+                                                               /* NNE */
+                                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                                               if (!j)
+                                                                       l = dp->nrows - 2;
+                                                               else if (!(j - 1))
+                                                                       l = dp->nrows - 1;
+                                                               else
+                                                                       l = j - 2;
+                                                               ml = l * dp->ncols;
+                                                               if (dp->oldcell[k + ml] ==
+                                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                                               /* SSE */
+                                                               k = (i + 1 == dp->ncols) ? 0 : i + 1;
+                                                               if (j + 1 == dp->nrows)
+                                                                       l = 1;
+                                                               else if (j + 2 == dp->nrows)
+                                                                       l = 0;
+                                                               else
+                                                                       l = j + 2;
+                                                               ml = l * dp->ncols;
+                                                               if (dp->oldcell[k + ml] ==
+                                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                                               /* WW */
+                                                               k = (!i) ? dp->ncols - 1 : i - 1;
+                                                               l = j;
+                                                               ml = mj;
+                                                               if (dp->oldcell[k + ml] ==
+                                                                   (int) (dp->oldcell[i + mj] + 1) % dp->states)
+                                                                       dp->newcell[i + mj] = dp->oldcell[k + ml];
+                                                       }
+                                               }
+                                               mj += dp->ncols;
+                                       }
+                               }
+                       }
+               }
+               mj = 0;
+               for (j = 0; j < dp->nrows; j++) {
+                       for (i = 0; i < dp->ncols; i++)
+                               if (dp->oldcell[i + mj] != dp->newcell[i + mj]) {
+                                       dp->oldcell[i + mj] = dp->newcell[i + mj];
+                                       if (!addtolist(mi, i, j, dp->oldcell[i + mj])) {
+                                               free_demon(MI_DISPLAY(mi), dp);
+                                               return;
+                                       }
+                               }
+                       mj += dp->ncols;
+               }
+               if (++dp->generation > MI_CYCLES(mi))
+                       init_demon(mi);
+               dp->state = 0;
+       } else {
+               if (dp->ncells[dp->state])
+                       if (!draw_state(mi, dp->state)) {
+                               free_demon(MI_DISPLAY(mi), dp);
+                               return;
+                       }
+               dp->state++;
+       }
+       if (dp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       if (dp->oldcell[dp->redrawpos]) {
+                               drawcell(mi, dp->redrawpos % dp->ncols, dp->redrawpos / dp->ncols,
+                                        dp->oldcell[dp->redrawpos]);
+                       }
+                       if (++(dp->redrawpos) >= dp->ncols * dp->nrows) {
+                               dp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+void
+release_demon(ModeInfo * mi)
+{
+       if (demons != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_demon(MI_DISPLAY(mi), &demons[screen]);
+               (void) free((void *) demons);
+               demons = NULL;
+       }
+}
+
+void
+refresh_demon(ModeInfo * mi)
+{
+       demonstruct *dp;
+
+       if (demons == NULL)
+               return;
+       dp = &demons[MI_SCREEN(mi)];
+
+       dp->redrawing = 1;
+       dp->redrawpos = 0;
+}
+
+#endif /* MODE_demon */
diff --git a/modes/dilemma.c b/modes/dilemma.c
new file mode 100644 (file)
index 0000000..5243e33
--- /dev/null
@@ -0,0 +1,950 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* dilemma --- Lloyd's Prisoner's Dilemma Simulation */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)dilemma.c    5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 20-Oct-1997: Computing Bouts of the Prisoner's Dilemma by Alun L. Lloyd
+ *              Scientific American Magazine June 1995
+ *              Used voters.c as a guide.
+ */
+
+/*-
+ *                      Opponent's Strategy
+ *
+ *                      Cooperate     Defect
+ *                     -----------------------
+ *                    |           |           |
+ *          Cooperate |     1     |     0     |
+ * Player's           |           |           |
+ * Strategy           |-----------+-----------|
+ *                    |           |           |
+ *          Defect    |     b     |     0     |
+ *                    |           |           |
+ *                     -----------------------
+ *
+ *                        The Payoff Matrix
+ *
+ * An interesting value of "b" for a 8 neighbor grid is 1.85
+ * What does b stand for?  "bonus"?
+ * Cells get 1 if they and their opponent cooperates.
+ * Cells get b if they cheat and their opponent cooperates.
+ * Cells get 0 in the 2 other cases.
+ * If b is greater then a cell should always cheat except
+ * they have to live with their neighbor... so on the next go around
+ * their neighbor might not see any benefit in cooperating.
+ * Cells add up the previous results of their neighbors
+ * and decide if its their best strategy is to cheat or not to cheat.
+ *
+ * I have noticed round off errors  I have not as yet tracked them down.
+ * Try
+ * -bonus 1.99 -neighbors 12  -size 10
+ * -bonus 241 -neighbors 6  -size 8
+ * -bonus 1.71 -neighbors 4  -size 4
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Dilemma"
+#define HACK_INIT init_dilemma
+#define HACK_DRAW draw_dilemma
+#define dilemma_opts xlockmore_opts
+#define DEFAULTS "*delay: 200000 \n" \
+ "*batchcount: -2 \n" \
+ "*cycles: 1000 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 6 \n" \
+ "*neighbors: 0 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#define SMOOTH_COLORS
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_dilemma
+
+/*-
+ * neighbors of 0 randomizes it between 3, 4, 6, 8, 9, and 12.
+ */
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+#define DEF_BONUS  "1.85"
+#define DEF_CONSCIOUS  "True"
+
+static int  neighbors;
+static float bonus;
+static Bool conscious;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".dilemma.neighbors", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-bonus", (char *) ".dilemma.bonus", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-conscious", (char *) ".dilemma.conscious", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+conscious", (char *) ".dilemma.conscious", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int},
+       {(caddr_t *) & bonus, (char *) "bonus", (char *) "Bonus", (char *) DEF_BONUS, t_Float},
+   {(caddr_t *) & conscious, (char *) "conscious", (char *) "Conscious", (char *) DEF_CONSCIOUS, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3, 9 or 12"},
+       {(char *) "-bonus value", (char *) "bonus for cheating... between 1.0 and 4.0"},
+       {(char *) "-/+conscious", (char *) "turn on/off self-awareness"}
+};
+
+ModeSpecOpt dilemma_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   dilemma_description =
+{"dilemma", "init_dilemma", "draw_dilemma", "release_dilemma",
+ "refresh_dilemma", "init_dilemma", NULL, &dilemma_opts,
+ 200000, -2, 1000, 0, 64, 1.0, "",
+ "Shows Lloyd's Prisoner's Dilemma simulation", 0, NULL};
+
+#endif
+
+/* Better bitmaps needed :) */
+#include "bitmaps/cooperat.xbm"        /* age > 1 then blue, age = 1 then green */
+#include "bitmaps/defect.xbm"  /* age > 1 then red, age = 1 then yellow */
+
+#define DEFECTOR 0
+#define COOPERATOR 1
+#define COLORS 4
+#define BLUE (45 * MI_NPIXELS(mi) / 64)                /* COOPERATING, was cooperating */
+#define GREEN (23 * MI_NPIXELS(mi) / 64)       /* COOPERATING, was defecting */
+#define YELLOW (MI_NPIXELS(mi) / 6)    /* DEFECTING, was cooperating */
+#define RED    0               /* DEFECTING, was defecting */
+#define MINDEFECT 1
+#define BITMAPS 2
+#define MINGRIDSIZE 16
+#define MINSIZE 10
+#define FACTOR 10
+#define NEIGHBORKINDS 6
+#define REDRAWSTEP 2000                /* How many cells to draw per cycle */
+#define ROUND_FLOAT(x,a) ((float) ((int) ((x) / (a) + 0.5)) * (a))
+
+static XImage logo[BITMAPS] =
+{
+    {0, 0, 0, XYBitmap, (char *) cooperat_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) defect_bits, LSBFirst, 8, LSBFirst, 8, 1},
+};
+
+/* Dilemma data */
+
+/* Singly linked list */
+typedef struct _CellList {
+       XPoint      pt;
+       struct _CellList *next;
+} CellList;
+
+typedef struct {
+       int         defectors;  /* portion of defectors */
+       float       pm[2][2];   /* payoff matrix */
+       unsigned long colors[2][2];
+       CellList   *cellList[COLORS];
+       char       *s, *sn;     /* cell strategies */
+       float      *payoff;
+       int         initialized;
+       int         xs, ys;     /* Size of cooperators and defectors */
+       int         xb, yb;     /* Bitmap offset for cooperators and defectors */
+       int         state;
+       int         redrawing, redrawpos;
+       int         pixelmode;
+       int         generation;
+       int         ncols, nrows;
+       int         npositions;
+       int         width, height;
+       int         neighbors;
+       union {
+               XPoint      hexagon[6];
+               XPoint      triangle[2][3];
+       } shape;
+} dilemmastruct;
+
+static char plots[NEIGHBORKINDS] =
+{
+       3, 4, 6, 8, 9, 12       /* Neighborhoods */
+};
+
+static dilemmastruct *dilemmas = NULL;
+static int  icon_width, icon_height;
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned long color, int bitmap,
+        Bool firstChange)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       dilemmastruct *dp = &dilemmas[MI_SCREEN(mi)];
+       unsigned long colour = (MI_NPIXELS(mi) >= COLORS) ?
+       color : MI_WHITE_PIXEL(mi);
+
+       XSetForeground(display, gc, colour);
+       if (dp->neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               dp->shape.hexagon[0].x = dp->xb + ccol * dp->xs;
+               dp->shape.hexagon[0].y = dp->yb + crow * dp->ys;
+               if (dp->xs == 1 && dp->ys == 1)
+                       XDrawPoint(display, window, gc,
+                       dp->shape.hexagon[0].x, dp->shape.hexagon[0].y);
+               else if (bitmap == BITMAPS - 1)
+                       XFillPolygon(display, window, gc,
+                           dp->shape.hexagon, 6, Convex, CoordModePrevious);
+               else {
+                       if (firstChange) {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XFillPolygon(display, window, gc,
+                                            dp->shape.hexagon, 6, Convex, CoordModePrevious);
+                               XSetForeground(display, gc, colour);
+                       }
+                       if (dp->xs <= 6 || dp->ys <= 2)
+                               XFillRectangle(display, window, gc,
+                                    dp->shape.hexagon[0].x - 3 * dp->xs / 4,
+                                              dp->shape.hexagon[0].y + dp->ys / 4, dp->xs, dp->ys);
+                       else
+                               XFillArc(display, window, gc,
+                                    dp->xb + dp->xs * ccol - 3 * dp->xs / 4,
+                                        dp->yb + dp->ys * crow + dp->ys / 4,
+                                        2 * dp->xs - 6, 2 * dp->ys - 2,
+                                        0, 23040);
+               }
+       } else if (dp->neighbors == 4 || dp->neighbors == 8) {
+               if (dp->pixelmode) {
+                       if (bitmap == BITMAPS - 1 || (dp->xs <= 2 || dp->ys <= 2))
+                               XFillRectangle(display, window, gc,
+                               dp->xb + dp->xs * col, dp->yb + dp->ys * row,
+                               dp->xs - (dp->xs > 3), dp->ys - (dp->ys > 3));
+                       else {
+                               if (firstChange) {
+                                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                                       XFillRectangle(display, window, gc,
+                                                      dp->xb + dp->xs * col, dp->yb + dp->ys * row,
+                                                      dp->xs, dp->ys);
+                                       XSetForeground(display, gc, colour);
+                               }
+                               XFillArc(display, window, gc,
+                                        dp->xb + dp->xs * col, dp->yb + dp->ys * row,
+                                        dp->xs - 1, dp->ys - 1,
+                                        0, 23040);
+                       }
+               } else
+                       (void) XPutImage(display, window, gc,
+                                        &logo[bitmap], 0, 0,
+                               dp->xb + dp->xs * col, dp->yb + dp->ys * row,
+                                        icon_width, icon_height);
+       } else {                /* TRI */
+               int         orient = (col + row) % 2;   /* O left 1 right */
+
+               dp->shape.triangle[orient][0].x = dp->xb + col * dp->xs;
+               dp->shape.triangle[orient][0].y = dp->yb + row * dp->ys;
+               if (dp->xs <= 3 || dp->ys <= 3)
+                       XDrawPoint(display, window, gc,
+                       ((orient) ? -1 : 1) + dp->shape.triangle[orient][0].x,
+                                      dp->shape.triangle[orient][0].y);
+               else {
+                       if (orient)
+                               dp->shape.triangle[orient][0].x += (dp->xs / 2 - 1);
+                       else
+                               dp->shape.triangle[orient][0].x -= (dp->xs / 2 - 1);
+                       if (bitmap == BITMAPS - 1)
+                               XFillPolygon(display, window, gc,
+                                            dp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+                       else {
+                               if (firstChange) {
+                                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                                       XFillPolygon(display, window, gc,
+                                                    dp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+                                       XSetForeground(display, gc, colour);
+                               }
+                               XFillArc(display, window, gc,
+                                    dp->xb + dp->xs * col - 4 * dp->xs / 5 +
+                                   ((orient) ? dp->xs / 3 : 3 * dp->xs / 5),
+                                        dp->yb + dp->ys * row - dp->ys / 2 + 1, dp->ys - 3, dp->ys - 3,
+                                        0, 23040);
+                       }
+               }
+       }
+}
+
+static void
+addtolist(ModeInfo * mi, int col, int row, int state)
+{
+       dilemmastruct *dp = &dilemmas[MI_SCREEN(mi)];
+       CellList   *current;
+
+       current = dp->cellList[state];
+       dp->cellList[state] = (CellList *) malloc(sizeof (CellList));
+       dp->cellList[state]->pt.x = col;
+       dp->cellList[state]->pt.y = row;
+       dp->cellList[state]->next = current;
+}
+
+#ifdef DEBUG
+static void
+print_state(ModeInfo * mi, int state)
+{
+       dilemmastruct *dp = &dilemmas[MI_SCREEN(mi)];
+       CellList   *locallist;
+       int         i = 0;
+
+       locallist = dp->cellList[state];
+       (void) printf("state %d\n", state);
+       while (locallist) {
+               (void) printf("%d x %d, y %d\n", i,
+                             locallist->pt.x, locallist->pt.y);
+               locallist = locallist->next;
+               i++;
+       }
+}
+
+#endif
+
+static void
+free_state(dilemmastruct * dp, int state)
+{
+       CellList   *current;
+
+       while (dp->cellList[state]) {
+               current = dp->cellList[state];
+               dp->cellList[state] = dp->cellList[state]->next;
+               (void) free((void *) current);
+       }
+       dp->cellList[state] = NULL;
+}
+
+
+static void
+free_list(dilemmastruct * dp)
+{
+       int         state;
+
+       for (state = 0; state < COLORS; state++)
+               free_state(dp, state);
+}
+
+static void
+free_dilemma(dilemmastruct *dp)
+{
+       free_list(dp);
+       if (dp->sn != NULL) {
+               (void) free((void *) dp->sn);
+               dp->sn = NULL;
+       }
+       if (dp->s != NULL) {
+               (void) free((void *) dp->s);
+               dp->s = NULL;
+       }
+       if (dp->payoff != NULL) {
+               (void) free((void *) dp->payoff);
+               dp->payoff = NULL;
+       }
+}
+
+static void
+alloc_dilemma(dilemmastruct *dp)
+{
+       if ((dp->s = (char *) calloc(dp->npositions, sizeof (char))) == NULL) {
+               free_dilemma(dp);
+               return;
+       }
+       if ((dp->sn = (char *) calloc(dp->npositions, sizeof (char))) == NULL) {
+               free_dilemma(dp);
+               return;
+       }
+       if ((dp->payoff = (float *) calloc(dp->npositions,
+                       sizeof (float))) == NULL) {
+               free_dilemma(dp);
+               return;
+       }
+}
+
+static int
+neighbor_position(dilemmastruct * dp, int col, int row, int dir)
+{
+       if (dp->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                               break;
+                       case 60:
+                               if (!(row & 1))
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                               row = (!row) ? dp->nrows - 1 : row - 1;
+                               break;
+                       case 120:
+                               if (row & 1)
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                               row = (!row) ? dp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? dp->ncols - 1 : col - 1;
+                               break;
+                       case 240:
+                               if (row & 1)
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                               row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                               break;
+                       case 300:
+                               if (!(row & 1))
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (dp->neighbors == 4 || dp->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                               break;
+                       case 45:
+                               col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                               row = (!row) ? dp->nrows - 1 : row - 1;
+                               break;
+                       case 90:
+                               row = (!row) ? dp->nrows - 1 : row - 1;
+                               break;
+                       case 135:
+                               col = (!col) ? dp->ncols - 1 : col - 1;
+                               row = (!row) ? dp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? dp->ncols - 1 : col - 1;
+                               break;
+                       case 225:
+                               col = (!col) ? dp->ncols - 1 : col - 1;
+                               row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                               break;
+                       case 270:
+                               row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                               break;
+                       case 315:
+                               col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               if ((col + row) % 2) {  /* right */
+                       switch (dir) {
+                               case 0:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 60:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       if (row + 1 == dp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == dp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (row + 1 == dp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == dp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 120:
+                                       row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 180:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? dp->nrows - 1 : row - 1;
+                                       break;
+                               case 240:
+                                       row = (!row) ? dp->nrows - 1 : row - 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (!row)
+                                               row = dp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = dp->nrows - 1;
+                                       else
+                                               row = row - 2;
+
+                                       break;
+                               case 300:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       if (!row)
+                                               row = dp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = dp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       row = (!row) ? dp->nrows - 1 : row - 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               } else {        /* left */
+                       switch (dir) {
+                               case 0:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? dp->nrows - 1 : row - 1;
+                                       break;
+                               case 60:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       if (!row)
+                                               row = dp->nrows - 2;
+                                       else if (row == 1)
+                                               row = dp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (!row)
+                                               row = dp->nrows - 2;
+                                       else if (row == 1)
+                                               row = dp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 120:
+                                       row = (!row) ? dp->nrows - 1 : row - 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       row = (!row) ? dp->nrows - 1 : row - 1;
+                                       break;
+                               case 180:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (!col) ? dp->ncols - 1 : col - 1;
+                                       row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 240:
+                                       row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (row + 1 == dp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == dp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 300:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       if (row + 1 == dp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == dp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (col + 1 == dp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == dp->nrows) ? 0 : row + 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               }
+       }
+
+       return row * dp->ncols + col;
+}
+
+static void
+draw_state(ModeInfo * mi, int state)
+{
+       dilemmastruct *dp = &dilemmas[MI_SCREEN(mi)];
+       CellList   *current;
+
+
+       current = dp->cellList[state];
+       while (current) {
+               int         col = current->pt.x;
+               int         row = current->pt.y;
+               int         colrow = col + row * dp->ncols;
+
+               drawcell(mi, col, row,
+                      dp->colors[(int) dp->sn[colrow]][(int) dp->s[colrow]],
+                        dp->sn[colrow], 1);
+               if (dp->s[colrow] && !dp->sn[colrow])
+                       dp->defectors--;
+               if (!dp->s[colrow] && dp->sn[colrow])
+                       dp->defectors++;
+               dp->s[colrow] = dp->sn[colrow];
+               current = current->next;
+       }
+       free_state(dp, state);
+       XFlush(MI_DISPLAY(mi));
+}
+
+void
+init_dilemma(ModeInfo * mi)
+{
+       int         size = MI_SIZE(mi);
+       int         i, col, row, colrow, mrow;
+       dilemmastruct *dp;
+
+       if (dilemmas == NULL) {
+               if ((dilemmas = (dilemmastruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (dilemmastruct))) == NULL)
+                       return;
+       }
+       dp = &dilemmas[MI_SCREEN(mi)];
+
+       dp->generation = 0;
+       dp->redrawing = 0;
+       dp->state = 0;
+       free_dilemma(dp);
+
+       if (!dp->initialized) { /* Genesis */
+               icon_width = cooperat_width;
+               icon_height = cooperat_height;
+               dp->initialized = 1;
+               for (i = 0; i < BITMAPS; i++) {
+                       logo[i].width = icon_width;
+                       logo[i].height = icon_height;
+                       logo[i].bytes_per_line = (icon_width + 7) / 8;
+               }
+       }
+       dp->width = MI_WIDTH(mi);
+       dp->height = MI_HEIGHT(mi);
+
+       for (i = 0; i < NEIGHBORKINDS; i++) {
+               if (neighbors == plots[i]) {
+                       dp->neighbors = neighbors;
+                       break;
+               }
+               if (i == NEIGHBORKINDS - 1) {
+#if 0
+                       dp->neighbors = plots[NRAND(NEIGHBORKINDS)];
+                       dp->neighbors = (LRAND() & 1) ? 4 : 8;
+#else
+                       dp->neighbors = 8;
+#endif
+                       break;
+               }
+       }
+
+       if (dp->neighbors == 6) {
+               int         nccols, ncrows, sides;
+
+               if (dp->width < 2)
+                       dp->width = 2;
+               if (dp->height < 4)
+                       dp->height = 4;
+               if (size < -MINSIZE)
+                       dp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               dp->ys = MAX(MINSIZE, MIN(dp->width, dp->height) / MINGRIDSIZE);
+                       else
+                               dp->ys = MINSIZE;
+               } else
+                       dp->ys = MIN(size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                              MINGRIDSIZE));
+               dp->xs = dp->ys;
+               dp->pixelmode = True;
+               nccols = MAX(dp->width / dp->xs - 2, 2);
+               ncrows = MAX(dp->height / dp->ys - 1, 2);
+               dp->ncols = nccols / 2;
+               dp->nrows = 2 * (ncrows / 4);
+               dp->xb = (dp->width - dp->xs * nccols) / 2 + dp->xs / 2;
+               dp->yb = (dp->height - dp->ys * (ncrows / 2) * 2) / 2 + dp->ys - 2;
+               for (sides = 0; sides < 6; sides++) {
+                       dp->shape.hexagon[sides].x = (dp->xs - 1) * hexagonUnit[sides].x;
+                       dp->shape.hexagon[sides].y =
+                               ((dp->ys - 1) * hexagonUnit[sides].y / 2) * 4 / 3;
+               }
+       } else if (dp->neighbors == 4 || dp->neighbors == 8) {
+               if (dp->width < 2)
+                       dp->width = 2;
+               if (dp->height < 2)
+                       dp->height = 2;
+               if (size == 0 ||
+                   MINGRIDSIZE * size > dp->width || MINGRIDSIZE * size > dp->height) {
+                       if (dp->width > MINGRIDSIZE * icon_width &&
+                           dp->height > MINGRIDSIZE * icon_height) {
+                               dp->pixelmode = False;
+                               dp->xs = icon_width;
+                               dp->ys = icon_height;
+                       } else {
+                               dp->pixelmode = True;
+                               dp->xs = dp->ys = MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                                     MINGRIDSIZE);
+                       }
+               } else {
+                       dp->pixelmode = True;
+                       if (size < -MINSIZE)
+                               dp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+                       else if (size < MINSIZE)
+                               dp->ys = MINSIZE;
+                       else
+                               dp->ys = MIN(size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                                      MINGRIDSIZE));
+                       dp->xs = dp->ys;
+               }
+               dp->ncols = MAX(dp->width / dp->xs, 2);
+               dp->nrows = MAX(dp->height / dp->ys, 2);
+               dp->xb = (dp->width - dp->xs * dp->ncols) / 2;
+               dp->yb = (dp->height - dp->ys * dp->nrows) / 2;
+       } else {                /* TRI */
+               int         orient, sides;
+
+               if (dp->width < 2)
+                       dp->width = 2;
+               if (dp->height < 2)
+                       dp->height = 2;
+               if (size < -MINSIZE)
+                       dp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               dp->ys = MAX(MINSIZE, MIN(dp->width, dp->height) / MINGRIDSIZE);
+                       else
+                               dp->ys = MINSIZE;
+               } else
+                       dp->ys = MIN(size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                              MINGRIDSIZE));
+               dp->xs = (int) (1.52 * dp->ys);
+               dp->pixelmode = True;
+               dp->ncols = (MAX(dp->width / dp->xs - 1, 2) / 2) * 2;
+               dp->nrows = (MAX(dp->height / dp->ys - 1, 2) / 2) * 2;
+               dp->xb = (dp->width - dp->xs * dp->ncols) / 2 + dp->xs / 2;
+               dp->yb = (dp->height - dp->ys * dp->nrows) / 2 + dp->ys / 2;
+               for (orient = 0; orient < 2; orient++) {
+                       for (sides = 0; sides < 3; sides++) {
+                               dp->shape.triangle[orient][sides].x =
+                                       (dp->xs - 2) * triangleUnit[orient][sides].x;
+                               dp->shape.triangle[orient][sides].y =
+                                       (dp->ys - 2) * triangleUnit[orient][sides].y;
+                       }
+               }
+       }
+
+       dp->npositions = dp->ncols * dp->nrows;
+
+       dp->pm[0][0] = 1, dp->pm[0][1] = 0;
+       if (bonus < 1.0 || bonus > 4.0)
+               dp->pm[1][0] = 1.85;
+       else
+               dp->pm[1][0] = bonus;
+       dp->pm[1][1] = 0;
+
+       if (MI_NPIXELS(mi) >= COLORS) {
+
+               dp->colors[0][0] = MI_PIXEL(mi, BLUE);  /* COOPERATING, was cooperating */
+               dp->colors[0][1] = MI_PIXEL(mi, GREEN);         /* COOPERATING, was defecting */
+               dp->colors[1][0] = MI_PIXEL(mi, YELLOW);        /* DEFECTING, was cooperating */
+               dp->colors[1][1] = MI_PIXEL(mi, RED);   /* DEFECTING, was defecting */
+       } else {
+               dp->colors[0][0] = MI_WHITE_PIXEL(mi);
+               dp->colors[0][1] = MI_WHITE_PIXEL(mi);
+               dp->colors[1][0] = MI_WHITE_PIXEL(mi);
+               dp->colors[1][1] = MI_WHITE_PIXEL(mi);
+       }
+       alloc_dilemma(dp);
+       if (dp->s == NULL)
+               return;
+       MI_CLEARWINDOW(mi);
+
+       dp->defectors = MI_COUNT(mi);
+       if (dp->defectors < -MINDEFECT) {
+               dp->defectors = NRAND(-dp->defectors - MINDEFECT + 1) + MINDEFECT;
+       } else if (dp->defectors < MINDEFECT)
+               dp->defectors = MINDEFECT;
+       if (dp->defectors > dp->npositions)
+               dp->defectors = dp->npositions;
+
+       for (i = 0; i < dp->defectors; i++) {
+               do {
+                       colrow = NRAND(dp->npositions);
+               } while (dp->sn[colrow]);
+               dp->sn[colrow] = 1;
+       }
+#if 0                          /* if p was a float... */
+       mrow = 0;
+       for (row = 0; row < dp->nrows; row++) {
+               for (col = 0; col < dp->ncols; col++) {
+                       dp->sn[col + mrow] = ((float) LRAND() / MAXRAND < dp->p);
+               }
+               mrow += dp->ncols;
+       }
+#endif
+
+       dp->defectors = 0;
+
+       /* Show initial state... real important for debugging */
+       mrow = 0;
+       for (row = 0; row < dp->nrows; ++row) {
+               for (col = 0; col < dp->ncols; ++col) {
+                       addtolist(mi, col, row,
+                          dp->sn[col + mrow] * BITMAPS + dp->s[col + mrow]);
+               }
+               mrow += dp->ncols;
+       }
+}
+
+void
+draw_dilemma(ModeInfo * mi)
+{
+       int         col, row, mrow, colrow, n, i;
+       dilemmastruct *dp;
+
+       if (dilemmas == NULL)
+               return;
+       dp = &dilemmas[MI_SCREEN(mi)];
+       if (dp->s == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (dp->state >= 2 * COLORS) {
+
+               for (col = 0; col < dp->ncols; col++) {
+                       for (row = 0; row < dp->nrows; row++) {
+                               colrow = col + row * dp->ncols;
+                               if (conscious)
+                                       dp->payoff[colrow] =
+                                               dp->pm[(int) dp->s[colrow]][(int) dp->s[colrow]];
+                               else
+                                       dp->payoff[colrow] = 0.0;
+                               for (n = 0; n < dp->neighbors; n++)
+                                       dp->payoff[colrow] +=
+                                               dp->pm[(int) dp->s[colrow]][(int)
+                                                 dp->s[neighbor_position(dp,
+                                       col, row, n * 360 / dp->neighbors)]];
+
+                       }
+               }
+               for (row = 0; row < dp->nrows; row++) {
+                       for (col = 0; col < dp->ncols; col++) {
+                               float       hp;
+                               int         position;
+
+                               colrow = col + row * dp->ncols;
+                               hp = dp->payoff[colrow];
+                               dp->sn[colrow] = dp->s[colrow];
+                               for (n = 0; n < dp->neighbors; n++) {
+                                       position = neighbor_position(dp, col, row, n * 360 / dp->neighbors);
+                                       if (ROUND_FLOAT(dp->payoff[position], 0.001) >
+                                           ROUND_FLOAT(hp, 0.001)) {
+                                               hp = dp->payoff[position];
+                                               dp->sn[colrow] = dp->s[position];
+                                       }
+                               }
+                       }
+               }
+               mrow = 0;
+               for (row = 0; row < dp->nrows; row++) {
+                       for (col = 0; col < dp->ncols; col++) {
+                               addtolist(mi, col, row,
+                                         dp->sn[col + mrow] * BITMAPS + dp->s[col + mrow]);
+                       }
+                       mrow += dp->ncols;
+               }
+
+               if (++dp->generation > MI_CYCLES(mi) ||
+                   dp->defectors == dp->npositions || dp->defectors == 0)
+                       init_dilemma(mi);
+               dp->state = 0;
+       } else {
+               if (dp->state < COLORS) {
+                       draw_state(mi, dp->state);
+               }
+               dp->state++;
+       }
+#if 1
+       if (dp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       drawcell(mi, dp->redrawpos % dp->ncols, dp->redrawpos / dp->ncols,
+                                dp->colors[(int) dp->sn[dp->redrawpos]][(int) dp->s[dp->redrawpos]],
+                                dp->sn[dp->redrawpos], 1);
+                       if (++(dp->redrawpos) >= dp->npositions) {
+                               dp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+#endif
+}
+
+void
+release_dilemma(ModeInfo * mi)
+{
+       if (dilemmas != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_dilemma(&dilemmas[screen]);
+               (void) free((void *) dilemmas);
+               dilemmas = NULL;
+       }
+}
+
+void
+refresh_dilemma(ModeInfo * mi)
+{
+       dilemmastruct *dp = &dilemmas[MI_SCREEN(mi)];
+
+       dp->redrawing = 1;
+       dp->redrawpos = 0;
+}
+
+#endif /* MODE_dilemma */
diff --git a/modes/discrete.c b/modes/discrete.c
new file mode 100644 (file)
index 0000000..87de2fd
--- /dev/null
@@ -0,0 +1,422 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* discrete --- chaotic mappings */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)discrete.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Tim Auckland <Tim.Auckland@Procket.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * "discrete" shows a number of fractals based on the "discrete map"
+ * type of dynamical systems.  They include a different way of looking
+ * at the HOPALONG system, an inverse julia-set iteration, the "Standard
+ * Map" and the "Bird in a Thornbush" fractal.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 31-Jul-1997: Ported to xlockmore-4
+ * 08-Aug-1996: Adapted from hop.c Copyright (c) 1991 by Patrick J. Naughton.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Discrete"
+#define HACK_INIT init_discrete
+#define HACK_DRAW draw_discrete
+#define discrete_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*count: 4096 \n" \
+ "*cycles: 2500 \n" \
+ "*ncolors: 100 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_discrete
+
+ModeSpecOpt discrete_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   discrete_description =
+{"discrete", "init_discrete", "draw_discrete", "release_discrete",
+ "refresh_discrete", "init_discrete", NULL, &discrete_opts,
+ 1000, 4096, 2500, 1, 64, 1.0, "",
+ "Shows various discrete maps", 0, NULL};
+
+#endif
+
+enum ftypes {
+       SQRT, BIRDIE, STANDARD, TRIG, CUBIC, HENON, AILUJ, HSHOE, DELOG
+};
+
+/*#define TEST STANDARD */
+
+#define BIASES 18
+static enum ftypes bias[BIASES] =
+{
+       STANDARD, STANDARD, STANDARD, STANDARD,
+       SQRT, SQRT, SQRT, SQRT,
+       BIRDIE, BIRDIE, BIRDIE,
+       AILUJ, AILUJ, AILUJ,
+       TRIG, TRIG,
+       CUBIC,
+       HENON,
+};
+
+typedef struct {
+       int         maxx;
+       int         maxy;       /* max of the screen */
+       double      a;
+       double      b;
+       double      c;
+       double      d;
+       double      e;
+       double      i;
+       double      j;          /* discrete parameters */
+       double      ic;
+       double      jc;
+       double      is;
+       double      js;
+       int         inc;
+       int         pix;
+       enum ftypes op;
+       int         count;
+       XPoint     *pointBuffer;        /* pointer for XDrawPoints */
+} discretestruct;
+
+static discretestruct *discretes = NULL;
+
+void
+init_discrete(ModeInfo * mi)
+{
+       double      range;
+       discretestruct *hp;
+
+       if (discretes == NULL) {
+               if ((discretes =
+                    (discretestruct *) calloc(MI_NUM_SCREENS(mi),
+                                          sizeof (discretestruct))) == NULL)
+                       return;
+       }
+       hp = &discretes[MI_SCREEN(mi)];
+
+       hp->maxx = MI_WIDTH(mi);
+       hp->maxy = MI_HEIGHT(mi);
+#ifdef TEST
+       hp->op = TEST;
+#else
+       hp->op = bias[LRAND() % BIASES];
+#endif
+       switch (hp->op) {
+               case HSHOE:
+                       hp->ic = 0;
+                       hp->jc = 0;
+                       hp->is = hp->maxx / (4);
+                       hp->js = hp->maxy / (4);
+                       hp->a = 0.5;
+                       hp->b = 0.5;
+                       hp->c = 0.2;
+                       hp->d = -1.25;
+                       hp->e = 1;
+                       hp->i = hp->j = 0.0;
+                       break;
+               case DELOG:
+                       hp->ic = 0.5;
+                       hp->jc = 0.3;
+                       hp->is = hp->maxx / 1.5;
+                       hp->js = hp->maxy / 1.5;
+                       hp->a = 2.176399;
+                       hp->i = hp->j = 0.01;
+                       break;
+               case HENON:
+                       hp->jc = ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.4;
+                       hp->ic = 1.3 * (1 - (hp->jc * hp->jc) / (0.4 * 0.4));
+                       hp->is = hp->maxx;
+                       hp->js = hp->maxy * 1.5;
+                       hp->a = 1;
+                       hp->b = 1.4;
+                       hp->c = 0.3;
+                       hp->i = hp->j = 0;
+                       break;
+               case SQRT:
+                       hp->ic = 0;
+                       hp->jc = 0;
+                       hp->is = 1;
+                       hp->js = 1;
+                       range = sqrt((double) hp->maxx * 2 * hp->maxx * 2 +
+                                    (double) hp->maxy * 2 * hp->maxy * 2) /
+                               (10.0 + LRAND() % 10);
+
+                       hp->a = (LRAND() / MAXRAND) * range - range / 2.0;
+                       hp->b = (LRAND() / MAXRAND) * range - range / 2.0;
+                       hp->c = (LRAND() / MAXRAND) * range - range / 2.0;
+                       if (!(LRAND() % 2))
+                               hp->c = 0.0;
+                       hp->i = hp->j = 0.0;
+                       break;
+               case STANDARD:
+                       hp->ic = M_PI;
+                       hp->jc = M_PI;
+                       hp->is = hp->maxx / (M_PI * 2);
+                       hp->js = hp->maxy / (M_PI * 2);
+                       hp->a = 0;      /* decay */
+                       hp->b = (LRAND() / MAXRAND) * 2.0;
+                       hp->c = 0;
+                       hp->i = M_PI;
+                       hp->j = M_PI;
+                       break;
+               case BIRDIE:
+                       hp->ic = 0;
+                       hp->jc = 0;
+                       hp->is = hp->maxx / 2;
+                       hp->js = hp->maxy / 2;
+                       hp->a = 1.99 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.2;
+                       hp->b = 0;
+                       hp->c = 0.8 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.1;
+                       hp->i = hp->j = 0;
+                       break;
+               case TRIG:
+                       hp->a = 5;
+                       hp->b = 0.5 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.3;
+                       hp->ic = hp->a;
+                       hp->jc = 0;
+                       hp->is = hp->maxx / (hp->b * 20);
+                       hp->js = hp->maxy / (hp->b * 20);
+                       hp->i = hp->j = 0;
+                       break;
+               case CUBIC:
+                       hp->a = 2.77;
+                       hp->b = 0.1 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.1;
+                       hp->ic = 0;
+                       hp->jc = 0;
+                       hp->is = hp->maxx / 4;
+                       hp->js = hp->maxy / 4;
+                       hp->i = hp->j = 0.1;
+                       break;
+               case AILUJ:
+                       {
+                               int         i;
+                               double      x, y, xn, yn;
+
+                               hp->ic = 0;
+                               hp->jc = 0;
+                               hp->is = hp->maxx / 4;
+                               hp->js = hp->maxx / 4;
+                               do {
+                                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * 1.5 - 0.5;
+                                       hp->b = ((LRAND() / MAXRAND) * 2.0 - 1.0) * 1.5;
+                                       x = y = 0;
+#define MAXITER 10
+                                       for (i = 0; i < MAXITER && x * x + y * y < 13; i++) {   /* 'Brot calc */
+                                               xn = x * x - y * y + hp->a;
+                                               yn = 2 * x * y + hp->b;
+                                               x = xn;
+                                               y = yn;
+                                       }
+                               } while (i < MAXITER);  /* wait for a connected set */
+                               hp->i = hp->j = 0.1;
+                               break;
+                       }
+       }
+       hp->pix = 0;
+       hp->inc = 0;
+
+       if (hp->pointBuffer == NULL) {
+               hp->pointBuffer = (XPoint *) malloc(sizeof (XPoint) * MI_COUNT(mi));
+               /* if fails will check later */
+       }
+
+       /* Clear the background. */
+       MI_CLEARWINDOW(mi);
+
+       XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi));
+       hp->count = 0;
+}
+
+
+void
+draw_discrete(ModeInfo * mi)
+{
+       Display    *dsp = MI_DISPLAY(mi);
+       Window      win = MI_WINDOW(mi);
+       double      oldj, oldi;
+       int         count = MI_COUNT(mi);
+       int         cycles = MI_CYCLES(mi);
+       int         k;
+       XPoint     *xp;
+       GC          gc = MI_GC(mi);
+       discretestruct *hp;
+
+       if (discretes == NULL)
+               return;
+       hp = &discretes[MI_SCREEN(mi)];
+       if (hp->pointBuffer == NULL)
+               return;
+
+       k = count;
+       xp = hp->pointBuffer;
+
+       hp->inc++;
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(dsp, gc, MI_PIXEL(mi, hp->pix));
+               if (++hp->pix >= MI_NPIXELS(mi))
+                       hp->pix = 0;
+       }
+       while (k--) {
+               oldj = hp->j;
+               oldi = hp->i;
+               switch (hp->op) {
+                       case HSHOE:
+                               {
+                                       int         i;
+
+#if 0
+                                       if (!k) {
+                                               XSetForeground(dsp, gc, MI_BLACK_PIXEL(mi));
+                                               XFillRectangle(dsp, win, gc, 0, 0, hp->maxx, hp->maxy);
+                                               XSetForeground(dsp, gc, MI_PIXEL(mi, hp->pix));
+                                       } else
+#endif
+#define HD
+#ifdef HD
+                                       if (k < count / 4) {
+                                               hp->i = ((double) k / count) * 8 - 1;
+                                               hp->j = 1;
+                                       } else if (k < count / 2) {
+                                               hp->i = 1;
+                                               hp->j = 3 - ((double) k / count) * 8;
+                                       } else if (k < 3 * count / 4) {
+                                               hp->i = 5 - ((double) k / count) * 8;
+                                               hp->j = -1;
+                                       } else {
+                                               hp->i = -1;
+                                               hp->j = ((double) k / count) * 8 - 7;
+                                       }
+                                       for (i = 1; i < (hp->inc % 15); i++) {
+                                               oldj = hp->j;
+                                               oldi = hp->i;
+#endif
+                                               hp->i = (hp->a * oldi + hp->b) * oldj;
+                                               hp->j = (hp->e - hp->d + hp->c * oldi) * oldj * oldj - hp->c * oldi + hp->d;
+#ifdef HD
+                                       }
+#endif
+                                       break;
+                               }
+                       case DELOG:
+                               hp->j = oldi;
+                               hp->i = hp->a * oldi * (1 - oldj);
+                               break;
+                       case HENON:
+                               hp->i = oldj + hp->a - hp->b * oldi * oldi;
+                               hp->j = hp->c * oldi;
+                               break;
+                       case SQRT:
+                               if (k) {
+                                       hp->j = hp->a + hp->i;
+                                       hp->i = -oldj + (hp->i < 0
+                                       ? sqrt(fabs(hp->b * (hp->i - hp->c)))
+                                                        : -sqrt(fabs(hp->b * (hp->i - hp->c))));
+                               } else {
+                                       static int  s = 1;
+
+                                       hp->i = s * hp->inc * hp->maxx / cycles / 2;
+                                       hp->j = hp->a + hp->i;
+                                       s = -s;
+                               }
+                               break;
+                       case STANDARD:
+                               if (k) {
+                                       hp->j = (1 - hp->a) * oldj + hp->b * sin(oldi) + hp->a * hp->c;
+                                       hp->j = fmod(hp->j + 2 * M_PI, 2 * M_PI);
+                                       hp->i = oldi + hp->j;
+                                       hp->i = fmod(hp->i + 2 * M_PI, 2 * M_PI);
+                               } else {
+                                       static int  s = 1;
+
+                                       hp->j = M_PI + fmod(s * hp->inc * 2 * M_PI / (cycles - 0.5), M_PI);
+                                       hp->i = M_PI;
+                                       s = -s;
+                               }
+                               break;
+                       case BIRDIE:
+                               hp->j = oldi;
+                               hp->i = (1 - hp->c) * cos(M_PI * hp->a * oldj) + hp->c * hp->b;
+                               hp->b = oldj;
+                               break;
+                       case TRIG:
+                               {
+                                       double      r2 = oldi * oldi + oldj * oldj;
+
+                                       hp->i = hp->a + hp->b * (oldi * cos(r2) - oldj * sin(r2));
+                                       hp->j = hp->b * (oldj * cos(r2) + oldi * sin(r2));
+                               }
+                               break;
+                       case CUBIC:
+                               hp->i = oldj;
+                               hp->j = hp->a * oldj - oldj * oldj * oldj - hp->b * oldi;
+                               break;
+                       case AILUJ:
+                               hp->i = ((LRAND() < MAXRAND / 2) ? -1 : 1) *
+                                       sqrt(((oldi - hp->a) +
+                                             sqrt((oldi - hp->a) * (oldi - hp->a) + (oldj - hp->b) * (oldj - hp->b))) / 2);
+                               if (hp->i < 0.00000001 && hp->i > -0.00000001)
+                                       hp->i = (hp->i > 0.0) ? 0.00000001 : -0.00000001;
+                               hp->j = (oldj - hp->b) / (2 * hp->i);
+                               break;
+               }
+               xp->x = hp->maxx / 2 + (int) ((hp->i - hp->ic) * hp->is);
+               xp->y = hp->maxy / 2 - (int) ((hp->j - hp->jc) * hp->js);
+               xp++;
+       }
+       XDrawPoints(dsp, win, gc, hp->pointBuffer, count, CoordModeOrigin);
+       if (++hp->count > cycles) {
+               init_discrete(mi);
+       }
+}
+
+void
+release_discrete(ModeInfo * mi)
+{
+       if (discretes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       discretestruct *hp = &discretes[screen];
+
+                       if (hp->pointBuffer != NULL) {
+                               (void) free((void *) hp->pointBuffer);
+                               /* hp->pointBuffer = NULL; */
+                       }
+               }
+               (void) free((void *) discretes);
+               discretes = NULL;
+       }
+}
+
+void
+refresh_discrete(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_discrete */
diff --git a/modes/dragon.c b/modes/dragon.c
new file mode 100644 (file)
index 0000000..8d58c8d
--- /dev/null
@@ -0,0 +1,533 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* dragon --- Oskar van Deventer's Hexagonal Dragons Maze */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)dragon.c     5.01 2001/03/07 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 2001 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * From "Fractal Garden Maze" by Oskar van Deventer, Cubism For Fun
+ * Issue 54 February 2001 p16, 17.  The maze itself is called a "Hexagonal
+ * Dragons Maze", named after its similarity to the Dragon Curve (see
+ * turtle.c).
+ *
+ * Revision History:
+ * 07-Mar-2001: Started writing, based on demon mode
+ */
+
+/*-
+  Grid     Number of Neighbors
+  ----     ------------------
+  Hexagon  6
+*/
+
+#ifdef STANDALONE
+#define PROGCLASS "Dragon"
+#define HACK_INIT init_dragon
+#define HACK_DRAW draw_dragon
+#define dragon_opts xlockmore_opts
+#define DEFAULTS "*delay: 2000000 \n" \
+ "*cycles: 16 \n" \
+ "*size: -24 \n" \
+ "*ncolors: 64 \n" \
+ "*neighbors: 6 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_dragon
+
+ModeSpecOpt dragon_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   dragon_description =
+{"dragon", "init_dragon", "draw_dragon", "release_dragon",
+ "refresh_dragon", "init_dragon", NULL, &dragon_opts,
+ 2000000, 1, 16, -24, 64, 1.0, "",
+ "Shows Deventer's Hexagonal Dragons Maze", 0, NULL};
+
+#endif
+
+#include "bitmaps/gray1.xbm"
+
+#define STATES 3
+#define LISTS 2
+#define REDRAWSTEP 2000                /* How many cells to draw per cycle */
+#define MINGRIDSIZE 16 
+#define MINSIZE 4
+
+/* Singly linked list */
+typedef struct _CellList {
+       XPoint      pt;
+       struct _CellList *next;
+} CellList;
+
+typedef struct {
+       int         generation;
+       int         xs, ys;
+       int         xb, yb;
+       int         nrows, ncols;
+       int         width, height;
+       int         addlist;
+       int         redrawing, redrawpos;
+       int        *ncells;
+       unsigned long color;
+       CellList  **cellList;
+       unsigned char *oldcell;
+       GC          stippledGC;
+       Pixmap      graypix;
+       XPoint      hexagon[6];
+} dragonstruct;
+
+static dragonstruct *dragons = NULL;
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned char state)
+{
+       dragonstruct *dp = &dragons[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc;
+
+       if (!state) {
+               XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+               gc = MI_GC(mi);
+       } else if (state == 1) {
+               XSetForeground(display, MI_GC(mi), MI_BLACK_PIXEL(mi));
+               gc = MI_GC(mi);
+       } else if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, MI_GC(mi), dp->color);
+               gc = MI_GC(mi);
+       } else {
+               XGCValues   gcv;
+
+               gcv.stipple = dp->graypix;
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(display, dp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = dp->stippledGC;
+       }
+       {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               dp->hexagon[0].x = dp->xb + ccol * dp->xs;
+               dp->hexagon[0].y = dp->yb + crow * dp->ys;
+               if (dp->xs == 1 && dp->ys == 1)
+                       XDrawPoint(display, MI_WINDOW(mi),
+                                      gc, dp->hexagon[0].x, dp->hexagon[0].y);
+               else
+                       XFillPolygon(display, MI_WINDOW(mi), gc,
+                           dp->hexagon, 6, Convex, CoordModePrevious);
+       }
+}
+
+static Bool
+addtolist(ModeInfo * mi, int col, int row)
+{
+       dragonstruct *dp = &dragons[MI_SCREEN(mi)];
+       CellList   *current;
+
+       current = dp->cellList[dp->addlist];
+       if ((dp->cellList[dp->addlist] = (CellList *)
+               malloc(sizeof (CellList))) == NULL) {
+               return False;
+       }
+       dp->cellList[dp->addlist]->pt.x = col;
+       dp->cellList[dp->addlist]->pt.y = row;
+       dp->cellList[dp->addlist]->next = current;
+       dp->ncells[dp->addlist]++;
+       return True;
+}
+
+#ifdef DEBUG
+static void
+print_state(ModeInfo * mi, int state)
+{
+       dragonstruct *dp = &dragons[MI_SCREEN(mi)];
+       CellList   *locallist;
+       int         i = 0;
+
+       locallist = dp->cellList[state];
+       (void) printf("state %d\n", state);
+       while (locallist) {
+               (void) printf("%d       x %d, y %d\n", i,
+                             locallist->pt.x, locallist->pt.y);
+               locallist = locallist->next;
+               i++;
+       }
+}
+
+#endif
+
+static void
+free_alist(dragonstruct * dp, int list)
+{
+       CellList   *current;
+
+       while (dp->cellList[list]) {
+               current = dp->cellList[list];
+               dp->cellList[list] = dp->cellList[list]->next;
+               (void) free((void *) current);
+       }
+       dp->cellList[list] = NULL;
+       if (dp->ncells != NULL)
+               dp->ncells[list] = 0;
+}
+
+
+static void
+free_list(dragonstruct * dp)
+{
+       int         list;
+
+       for (list = 0; list < LISTS; list++)
+               free_alist(dp, list);
+       (void) free((void *) dp->cellList);
+       dp->cellList = NULL;
+       if (dp->ncells != NULL) {
+               (void) free((void *) dp->ncells);
+               dp->ncells = NULL;
+       }
+}
+
+static void
+free_struct(dragonstruct * dp)
+{
+       if (dp->cellList != NULL) {
+               free_list(dp);
+       }
+       if (dp->oldcell != NULL) {
+               (void) free((void *) dp->oldcell);
+               dp->oldcell = NULL;
+       }
+}
+
+static void
+free_dragon(Display *display, dragonstruct *dp)
+{
+       if (dp->stippledGC != None) {
+               XFreeGC(display, dp->stippledGC);
+               dp->stippledGC = None;
+       }
+       if (dp->graypix != None) {
+               XFreePixmap(display, dp->graypix);
+               dp->graypix = None;
+       }
+       free_struct(dp);
+}
+
+#if 0
+static Bool
+draw_state(ModeInfo * mi, int state)
+{
+       dragonstruct *dp = &dragons[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc;
+       CellList   *current;
+
+       if (!state) {
+               XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+               gc = MI_GC(mi);
+       } else if (state == 1) {
+               XSetForeground(display, MI_GC(mi), MI_BLACK_PIXEL(mi));
+               gc = MI_GC(mi);
+       } else if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, MI_GC(mi), dp->color);
+               gc = MI_GC(mi);
+       } else {
+               XGCValues   gcv;
+
+               gcv.stipple = dp->graypix;
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(display, dp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = dp->stippledGC;
+       }
+       {       /* Draw right away, slow */
+               current = dp->cellList[state];
+               while (current) {
+                       int         col, row, ccol, crow;
+
+                       col = current->pt.x;
+                       row = current->pt.y;
+                       ccol = 2 * col + !(row & 1), crow = 2 * row;
+                       dp->hexagon[0].x = dp->xb + ccol * dp->xs;
+                       dp->hexagon[0].y = dp->yb + crow * dp->ys;
+                       if (dp->xs == 1 && dp->ys == 1)
+                               XDrawPoint(display, MI_WINDOW(mi),
+                                              gc, dp->hexagon[0].x, dp->hexagon[0].y);
+                       else
+                               XFillPolygon(display, MI_WINDOW(mi), gc,
+                                            dp->hexagon, 6, Convex, CoordModePrevious);
+                       current = current->next;
+               }
+       }
+       XFlush(MI_DISPLAY(mi));
+       return True;
+}
+#endif
+
+static Bool
+SetSoup(ModeInfo * mi)
+{
+       dragonstruct *dp = &dragons[MI_SCREEN(mi)];
+       int         row, col, mrow = 0;
+
+       for (row = dp->nrows - 1; row >= 0; --row) {
+               for (col = dp->ncols - 1; col >= 0; --col) {
+                       if (!addtolist(mi, col, row))
+                               return False;
+               }
+               mrow += dp->ncols;
+       }
+       dp->addlist = !dp->addlist;
+       return True;
+}
+
+void
+init_dragon(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       dragonstruct *dp;
+
+       if (dragons == NULL) {
+               if ((dragons = (dragonstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (dragonstruct))) == NULL)
+                       return;
+       }
+       dp = &dragons[MI_SCREEN(mi)];
+
+       dp->generation = 0;
+       dp->redrawing = 0;
+       if (MI_NPIXELS(mi) <= 2) {
+               if (dp->stippledGC == None) {
+                       XGCValues   gcv;
+
+                       gcv.fill_style = FillOpaqueStippled;
+                       if ((dp->stippledGC = XCreateGC(display, window,
+                                GCFillStyle, &gcv)) == None) {
+                               free_dragon(display, dp);
+                               return;
+                       }
+               }
+               if (dp->graypix == None) {
+                       if ((dp->graypix = XCreateBitmapFromData(display, window,
+                               (char *) gray1_bits, gray1_width, gray1_height)) == None) {
+                               free_dragon(display, dp);
+                               return;
+                       }
+               }
+       }
+       free_struct(dp);
+       if (MI_NPIXELS(mi) > 2)
+               dp->color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+
+       if ((dp->cellList = (CellList **) calloc(STATES,
+                       sizeof (CellList *))) == NULL) {
+               free_dragon(display, dp);
+               return;
+       }
+       if ((dp->ncells = (int *) calloc(STATES, sizeof (int))) == NULL) {
+               free_dragon(display, dp);
+               return;
+       }
+
+       dp->addlist = 0;
+
+       dp->width = MI_WIDTH(mi);
+       dp->height = MI_HEIGHT(mi);
+
+       {
+               int         nccols, ncrows, i;
+
+               if (dp->width < 2)
+                       dp->width = 2;
+               if (dp->height < 4)
+                       dp->height = 4;
+               if (size < -MINSIZE)
+                       dp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               dp->ys = MAX(MINSIZE, MIN(dp->width, dp->height) / MINGRIDSIZE);
+                       else
+                               dp->ys = MINSIZE;
+               } else
+                       dp->ys = MIN(size, MAX(MINSIZE, MIN(dp->width, dp->height) /
+                                              MINGRIDSIZE));
+               dp->xs = dp->ys;
+               nccols = MAX(dp->width / dp->xs - 2, 2);
+               ncrows = MAX(dp->height / dp->ys - 1, 2);
+               dp->ncols = nccols / 2;
+               dp->nrows = 2 * (ncrows / 4);
+               dp->xb = (dp->width - dp->xs * nccols) / 2 + dp->xs / 2;
+               dp->yb = (dp->height - dp->ys * (ncrows / 2) * 2) / 2 + dp->ys - 2;
+               for (i = 0; i < 6; i++) {
+                       dp->hexagon[i].x = dp->xs * hexagonUnit[i].x;
+                       dp->hexagon[i].y = ((dp->ys + 1) * hexagonUnit[i].y / 2) * 4 / 3;
+               }
+       }
+
+       MI_CLEARWINDOW(mi);
+
+       if ((dp->oldcell = (unsigned char *)
+               calloc(dp->ncols * dp->nrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_dragon(display, dp);
+               return;
+       }
+       if (!SetSoup(mi)) {
+               free_dragon(display, dp);
+               return;
+       }
+}
+
+void
+draw_dragon(ModeInfo * mi)
+{
+       int white, black;
+       int         choose_layer, factor, orient, l;
+       dragonstruct *dp;
+       CellList *locallist;
+       Bool detour = False;
+
+       if (dragons == NULL)
+               return;
+       dp = &dragons[MI_SCREEN(mi)];
+       if (dp->cellList == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       choose_layer= NRAND(6);
+       if (dp->ncells[!dp->addlist] == 1) {
+               /* Since the maze is infinite, it may not get to this last
+                * spot for a while.  Force it to do it right away so it
+                * does not appear to be stuck. */
+               detour = True; 
+               white = black = 0; /* not used but make -Wall happy */
+       } else {
+               white = (choose_layer / 2);
+               black = (choose_layer % 2) ?
+                       ((white + 2) % 3) : ((white + 1) % 3);
+               /* gray = (choose_layer % 2) ?
+                       ((white + 1) % 3) : ((white + 2) % 3); */
+       } 
+       locallist = dp->cellList[!dp->addlist];
+       orient = dp->generation % 2;
+       factor = 1;
+       for (l = 0; l < dp->generation / 2; l++) {
+               factor *= 3;
+       }
+       if (!locallist && dp->generation >= MI_CYCLES(mi)) {
+               init_dragon(mi);
+               return;
+       }       
+
+       while (locallist) {
+               int i, j, k;
+
+               i = locallist->pt.x;
+               j = locallist->pt.y;
+               if (orient) {
+                       k = (j / factor) % 3;
+               } else {
+                       if (j % 2) {
+                               /* Had trouble with this line... */
+                               k = ((i + factor / 2) / factor + 1) % 3;
+                       } else {
+                               k = (i / factor) % 3;
+                       }
+               }
+               if (detour) {
+                       k = (LRAND() & 1) + 1;
+                       dp->oldcell[j * dp->ncols + i] = k;
+                       drawcell(mi, i, j, k);
+               } if (white == k) {
+                       dp->oldcell[j * dp->ncols + i] = 0;
+                       drawcell(mi, i, j, 0);
+                       if (!addtolist(mi, i, j)) {
+                               free_dragon(MI_DISPLAY(mi), dp);
+                               return;
+                       }
+               } else if (black == k) {
+                       dp->oldcell[j * dp->ncols + i] = 1;
+                       drawcell(mi, i, j, 1);
+               } else /* if (gray == k) */ {
+                       dp->oldcell[j * dp->ncols + i] = 2;
+                       drawcell(mi, i, j, 2);
+               }
+               dp->cellList[!dp->addlist] = dp->cellList[!dp->addlist]->next;
+               (void) free((void *) locallist);
+               dp->ncells[!dp->addlist]--;
+               locallist = dp->cellList[!dp->addlist];
+               if ((dp->cellList[!dp->addlist] == NULL) &&
+                   (dp->cellList[dp->addlist] == NULL))
+                       dp->generation = 0;
+       }
+       dp->addlist = !dp->addlist;
+       if (dp->redrawing) {
+               int i;
+
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       if (dp->oldcell[dp->redrawpos] != 1) {
+                               drawcell(mi, dp->redrawpos % dp->ncols, dp->redrawpos / dp->ncols,
+                                        dp->oldcell[dp->redrawpos]);
+                       }
+                       if (++(dp->redrawpos) >= dp->ncols * dp->nrows) {
+                               dp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+       dp->generation++;
+}
+void
+release_dragon(ModeInfo * mi)
+{
+       if (dragons != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_dragon(MI_DISPLAY(mi), &dragons[screen]);
+               (void) free((void *) dragons);
+               dragons = NULL;
+       }
+}
+
+void
+refresh_dragon(ModeInfo * mi)
+{
+       dragonstruct *dp;
+
+       if (dragons == NULL)
+               return;
+       dp = &dragons[MI_SCREEN(mi)];
+
+       dp->redrawing = 1;
+       dp->redrawpos = 0;
+}
+
+#endif /* MODE_dragon */
diff --git a/modes/drift.c b/modes/drift.c
new file mode 100644 (file)
index 0000000..00452b4
--- /dev/null
@@ -0,0 +1,672 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* drift --- drifting recursive fractal cosmic flames */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)drift.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Jamie Zawinski <jwz@jwz.org> compatible with xscreensaver
+ * 01-Jan-1997: Moved new flame to drift.  Compile time options now run time.
+ * 01-Jun-1995: Updated by Scott Draves.
+ * 27-Jun-1991: vary number of functions used.
+ * 24-Jun-1991: fixed portability problem with integer mod (%).
+ * 06-Jun-1991: Written, received from Scott Draves <spot@cs.cmu.edu>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Drift"
+#define HACK_INIT init_drift
+#define HACK_DRAW draw_drift
+#define drift_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 30 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_drift
+
+#define DEF_GROW "False"       /* Grow fractals instead of animating one at a time,
+                                  would then be like flame */
+#define DEF_LISS "False"       /* if this is defined then instead of a point
+                                  bouncing around in a high dimensional sphere, we
+                                  use lissojous figures.  Only makes sense if
+                                  grow is false. */
+
+static Bool grow;
+static Bool liss;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-grow", (char *) ".drift.grow", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+grow", (char *) ".drift.grow", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-liss", (char *) ".drift.trail", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+liss", (char *) ".drift.trail", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & grow, (char *) "grow", (char *) "Grow", (char *) DEF_GROW, t_Bool},
+       {(caddr_t *) & liss, (char *) "liss", (char *) "Liss", (char *) DEF_LISS, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+grow", (char *) "turn on/off growing fractals, else they are animated"},
+       {(char *) "-/+liss", (char *) "turn on/off using lissojous figures to get points"}
+};
+
+ModeSpecOpt drift_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   drift_description =
+{"drift", "init_drift", "draw_drift", "release_drift",
+ "refresh_drift", "init_drift", NULL, &drift_opts,
+ 10000, 30, 1, 1, 64, 1.0, "",
+ "Shows cosmic drifting flame fractals", 0, NULL};
+
+#endif
+
+#define MAXBATCH1      200     /* mono */
+#define MAXBATCH2      20      /* color */
+#define FUSE           10      /* discard this many initial iterations */
+#define NMAJORVARS     7
+#define MAXLEV 10
+
+typedef struct {
+       /* shape of current flame */
+       int         nxforms;
+       double      f[2][3][MAXLEV];    /* a bunch of non-homogeneous xforms */
+       int         variation[10];      /* for each xform */
+
+       /* Animation */
+       double      df[2][3][MAXLEV];
+
+       /* high-level control */
+       int         mode;       /* 0->slow/single 1->fast/many */
+       int         nfractals;  /* draw this many fractals */
+       int         major_variation;
+       int         fractal_len;        /* pts/fractal */
+       int         color;
+       int         rainbow;    /* more than one color per fractal
+                                  1-> computed by adding dimension to fractal */
+
+       int         width, height;      /* of window */
+       int         timer;
+
+       /* draw info about current flame */
+       int         fuse;       /* iterate this many before drawing */
+       int         total_points;       /* draw this many pts before fractal ends */
+       int         npoints;    /* how many we've computed but not drawn */
+       XPoint      pts[MAXBATCH1];     /* here they are */
+       unsigned long pixcol;
+       /* when drawing in color, we have a buffer per color */
+       int        *ncpoints;
+       XPoint     *cpts;
+
+       double      x, y, c;
+       int         liss_time;
+       Bool        grow, liss;
+
+       short       lasthalf;
+       long        saved_random_bits;
+       int         nbits;
+} driftstruct;
+
+static driftstruct *drifts = NULL;
+
+static short
+halfrandom(driftstruct * dp, int mv)
+{
+       unsigned long r;
+
+       if (dp->lasthalf) {
+               r = dp->lasthalf;
+               dp->lasthalf = 0;
+       } else {
+               r = LRAND();
+               dp->lasthalf = (short) (r >> 16);
+       }
+       r = r % mv;
+       return r;
+}
+
+static int
+frandom(driftstruct * dp, int n)
+{
+       int         result;
+
+       if (3 > dp->nbits) {
+               dp->saved_random_bits = LRAND();
+               dp->nbits = 31;
+       }
+       switch (n) {
+               case 2:
+                       result = (int) (dp->saved_random_bits & 1);
+                       dp->saved_random_bits >>= 1;
+                       dp->nbits -= 1;
+                       return result;
+
+               case 3:
+                       result = (int) (dp->saved_random_bits & 3);
+                       dp->saved_random_bits >>= 2;
+                       dp->nbits -= 2;
+                       if (3 == result)
+                               return frandom(dp, 3);
+                       return result;
+
+               case 4:
+                       result = (int) (dp->saved_random_bits & 3);
+                       dp->saved_random_bits >>= 2;
+                       dp->nbits -= 2;
+                       return result;
+
+               case 5:
+                       result = (int) (dp->saved_random_bits & 7);
+                       dp->saved_random_bits >>= 3;
+                       dp->nbits -= 3;
+                       if (4 < result)
+                               return frandom(dp, 5);
+                       return result;
+               default:
+                       (void) fprintf(stderr, "bad arg to frandom\n");
+       }
+       return 0;
+}
+
+#define DISTRIB_A (halfrandom(dp, 7000) + 9000)
+#define DISTRIB_B ((frandom(dp, 3) + 1) * (frandom(dp, 3) + 1) * 120000)
+#define LEN(x) (sizeof(x)/sizeof((x)[0]))
+
+static void
+initmode(ModeInfo * mi, int mode)
+{
+       driftstruct *dp = &drifts[MI_SCREEN(mi)];
+
+#define VARIATION_LEN 14
+
+       dp->mode = mode;
+
+       dp->major_variation = halfrandom(dp, VARIATION_LEN);
+       /*  0, 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 6 */
+       dp->major_variation = ((dp->major_variation >= VARIATION_LEN >> 1) &&
+                              (dp->major_variation < VARIATION_LEN - 1)) ?
+               (dp->major_variation + 1) >> 1 : dp->major_variation >> 1;
+
+       if (dp->grow) {
+               dp->rainbow = 0;
+               if (mode) {
+                       if (!dp->color || halfrandom(dp, 8)) {
+                               dp->nfractals = halfrandom(dp, 30) + 5;
+                               dp->fractal_len = DISTRIB_A;
+                       } else {
+                               dp->nfractals = halfrandom(dp, 5) + 5;
+                               dp->fractal_len = DISTRIB_B;
+                       }
+               } else {
+                       dp->rainbow = dp->color;
+                       dp->nfractals = 1;
+                       dp->fractal_len = DISTRIB_B;
+               }
+       } else {
+               dp->nfractals = 1;
+               dp->rainbow = dp->color;
+               dp->fractal_len = 2000000;
+       }
+       dp->fractal_len = (dp->fractal_len * MI_COUNT(mi)) / 20;
+
+       MI_CLEARWINDOW(mi);
+}
+
+static void
+pick_df_coefs(ModeInfo * mi)
+{
+       driftstruct *dp = &drifts[MI_SCREEN(mi)];
+       int         i, j, k;
+       double      r;
+
+       for (i = 0; i < dp->nxforms; i++) {
+
+               r = 1e-6;
+               for (j = 0; j < 2; j++)
+                       for (k = 0; k < 3; k++) {
+                               dp->df[j][k][i] = ((double) halfrandom(dp, 1000) / 500.0 - 1.0);
+                               r += dp->df[j][k][i] * dp->df[j][k][i];
+                       }
+               r = (3 + halfrandom(dp, 5)) * 0.01 / sqrt(r);
+               for (j = 0; j < 2; j++)
+                       for (k = 0; k < 3; k++)
+                               dp->df[j][k][i] *= r;
+       }
+}
+
+static void
+free_drift(driftstruct *dp)
+{
+       if (dp->ncpoints != NULL) {
+               (void) free((void *) dp->ncpoints);
+               dp->ncpoints = NULL;
+       }
+       if (dp->cpts != NULL) {
+               (void) free((void *) dp->cpts);
+               dp->cpts = NULL;
+       }
+}
+
+static void
+initfractal(ModeInfo * mi)
+{
+       driftstruct *dp = &drifts[MI_SCREEN(mi)];
+       int         i, j, k;
+
+#define XFORM_LEN 9
+
+       dp->fuse = FUSE;
+       dp->total_points = 0;
+
+       if (!dp->ncpoints) {
+               if ((dp->ncpoints = (int *) malloc(sizeof (int) * MI_NCOLORS(mi))) ==
+                       NULL) {
+                       free_drift(dp);
+                       return;
+               }
+       }
+       if (!dp->cpts) {
+               if ((dp->cpts = (XPoint *) malloc(MAXBATCH2 * sizeof (XPoint) *
+                        MI_NCOLORS(mi))) == NULL) {
+                       free_drift(dp);
+                       return;
+               }
+       }
+
+       if (dp->rainbow)
+               for (i = 0; i < MI_NPIXELS(mi); i++)
+                       dp->ncpoints[i] = 0;
+       else
+               dp->npoints = 0;
+       dp->nxforms = halfrandom(dp, XFORM_LEN);
+       /* 2, 2, 2, 3, 3, 3, 4, 4, 5 */
+       dp->nxforms = (dp->nxforms >= XFORM_LEN - 1) + dp->nxforms / 3 + 2;
+
+       dp->c = dp->x = dp->y = 0.0;
+       if (dp->liss && !halfrandom(dp, 10)) {
+               dp->liss_time = 0;
+       }
+       if (!dp->grow)
+               pick_df_coefs(mi);
+       for (i = 0; i < dp->nxforms; i++) {
+               if (NMAJORVARS == dp->major_variation)
+                       dp->variation[i] = halfrandom(dp, NMAJORVARS);
+               else
+                       dp->variation[i] = dp->major_variation;
+               for (j = 0; j < 2; j++)
+                       for (k = 0; k < 3; k++) {
+                               if (dp->liss)
+                                       dp->f[j][k][i] = sin(dp->liss_time * dp->df[j][k][i]);
+                               else
+                                       dp->f[j][k][i] = ((double) halfrandom(dp, 1000) / 500.0 - 1.0);
+                       }
+       }
+       if (dp->color)
+               dp->pixcol = MI_PIXEL(mi, halfrandom(dp, MI_NPIXELS(mi)));
+       else
+               dp->pixcol = MI_WHITE_PIXEL(mi);
+
+}
+
+
+void
+init_drift(ModeInfo * mi)
+{
+       driftstruct *dp;
+
+       if (drifts == NULL) {
+               if ((drifts = (driftstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (driftstruct))) == NULL)
+                       return;
+       }
+       dp = &drifts[MI_SCREEN(mi)];
+
+       dp->width = MI_WIDTH(mi);
+       dp->height = MI_HEIGHT(mi);
+       dp->color = MI_NPIXELS(mi) > 2;
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               if (NRAND(3) == 0)
+                       dp->grow = True;
+               else {
+                       dp->grow = False;
+                       dp->liss = (Bool) (LRAND() & 1);
+               }
+       } else {
+               dp->grow = grow;
+               if (dp->grow)
+                       dp->liss = False;
+               else
+                       dp->liss = liss;
+       }
+       initmode(mi, 1);
+       initfractal(mi);
+}
+
+static void
+iter(driftstruct * dp)
+{
+       int         i = frandom(dp, dp->nxforms);
+       double      nx, ny, nc;
+
+
+       if (i)
+               nc = (dp->c + 1.0) / 2.0;
+       else
+               nc = dp->c / 2.0;
+
+       nx = dp->f[0][0][i] * dp->x + dp->f[0][1][i] * dp->y + dp->f[0][2][i];
+       ny = dp->f[1][0][i] * dp->x + dp->f[1][1][i] * dp->y + dp->f[1][2][i];
+
+
+       switch (dp->variation[i]) {
+               case 1:
+                       /* sinusoidal */
+                       nx = sin(nx);
+                       ny = sin(ny);
+                       break;
+               case 2:
+                       {
+                               /* complex */
+                               double      r2 = nx * nx + ny * ny + 1e-6;
+
+                               nx = nx / r2;
+                               ny = ny / r2;
+                               break;
+                       }
+               case 3:
+                       /* bent */
+                       if (nx < 0.0)
+                               nx = nx * 2.0;
+                       if (ny < 0.0)
+                               ny = ny / 2.0;
+                       break;
+               case 4:
+                       {
+                               /* swirl */
+
+                               double      r = (nx * nx + ny * ny);    /* times k here is fun */
+                               double      c1 = sin(r);
+                               double      c2 = cos(r);
+                               double      t = nx;
+
+                               if (nx > 1e4 || nx < -1e4 || ny > 1e4 || ny < -1e4)
+                                       ny = 1e4;
+                               else
+                                       ny = c2 * t + c1 * ny;
+                               nx = c1 * nx - c2 * ny;
+                               break;
+                       }
+               case 5:
+                       {
+                               /* horseshoe */
+                               double      r, c1, c2, t;
+
+                               /* Avoid atan2: DOMAIN error message */
+                               if (nx == 0.0 && ny == 0.0)
+                                       r = 0.0;
+                               else
+                                       r = atan2(nx, ny);      /* times k here is fun */
+                               c1 = sin(r);
+                               c2 = cos(r);
+                               t = nx;
+
+                               nx = c1 * nx - c2 * ny;
+                               ny = c2 * t + c1 * ny;
+                               break;
+                       }
+               case 6:
+                       {
+                               /* drape */
+                               double      t;
+
+                               /* Avoid atan2: DOMAIN error message */
+                               if (nx == 0.0 && ny == 0.0)
+                                       t = 0.0;
+                               else
+                                       t = atan2(nx, ny) / M_PI;
+
+                               if (nx > 1e4 || nx < -1e4 || ny > 1e4 || ny < -1e4)
+                                       ny = 1e4;
+                               else
+                                       ny = sqrt(nx * nx + ny * ny) - 1.0;
+                               nx = t;
+                               break;
+                       }
+       }
+
+#if 0
+       /* here are some others */
+       {
+               /* broken */
+               if (nx > 1.0)
+                       nx = nx - 1.0;
+               if (nx < -1.0)
+                       nx = nx + 1.0;
+               if (ny > 1.0)
+                       ny = ny - 1.0;
+               if (ny < -1.0)
+                       ny = ny + 1.0;
+               break;
+       }
+       {
+               /* complex sine */
+               double      u = nx, v = ny;
+               double      ev = exp(v);
+               double      emv = exp(-v);
+
+               nx = (ev + emv) * sin(u) / 2.0;
+               ny = (ev - emv) * cos(u) / 2.0;
+       }
+       {
+
+               /* polynomial */
+               if (nx < 0)
+                       nx = -nx * nx;
+               else
+                       nx = nx * nx;
+
+               if (ny < 0)
+                       ny = -ny * ny;
+               else
+                       ny = ny * ny;
+       }
+       {
+               /* spherical */
+               double      r = 0.5 + sqrt(nx * nx + ny * ny + 1e-6);
+
+               nx = nx / r;
+               ny = ny / r;
+       }
+       {
+               nx = atan(nx) / M_PI_2
+                       ny = atan(ny) / M_PI_2
+       }
+#endif
+
+       /* how to check nan too?  some machines don't have finite().
+          don't need to check ny, it'll propogate */
+       if (nx > 1e4 || nx < -1e4) {
+               nx = halfrandom(dp, 1000) / 500.0 - 1.0;
+               ny = halfrandom(dp, 1000) / 500.0 - 1.0;
+               dp->fuse = FUSE;
+       }
+       dp->x = nx;
+       dp->y = ny;
+       dp->c = nc;
+
+}
+
+static void
+draw(ModeInfo * mi, driftstruct * dp, Drawable d)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       double      x = dp->x;
+       double      y = dp->y;
+       int         fixed_x, fixed_y, npix, c, n;
+
+       if (dp->fuse) {
+               dp->fuse--;
+               return;
+       }
+       if (!(x > -1.0 && x < 1.0 && y > -1.0 && y < 1.0))
+               return;
+
+       fixed_x = (int) ((dp->width / 2) * (x + 1.0));
+       fixed_y = (int) ((dp->height / 2) * (y + 1.0));
+
+       if (!dp->rainbow) {
+
+               dp->pts[dp->npoints].x = fixed_x;
+               dp->pts[dp->npoints].y = fixed_y;
+               dp->npoints++;
+               if (dp->npoints == MAXBATCH1) {
+                       XSetForeground(display, gc, dp->pixcol);
+                       XDrawPoints(display, d, gc, dp->pts, dp->npoints, CoordModeOrigin);
+                       dp->npoints = 0;
+               }
+       } else {
+
+               npix = MI_NPIXELS(mi);
+               c = (int) (dp->c * npix);
+
+               if (c < 0)
+                       c = 0;
+               if (c >= npix)
+                       c = npix - 1;
+               n = dp->ncpoints[c];
+               dp->cpts[c * MAXBATCH2 + n].x = fixed_x;
+               dp->cpts[c * MAXBATCH2 + n].y = fixed_y;
+               if (++dp->ncpoints[c] == MAXBATCH2) {
+                       XSetForeground(display, gc, MI_PIXEL(mi, c));
+                       XDrawPoints(display, d, gc, &(dp->cpts[c * MAXBATCH2]),
+                                   dp->ncpoints[c], CoordModeOrigin);
+                       dp->ncpoints[c] = 0;
+               }
+       }
+}
+
+static void
+draw_flush(ModeInfo * mi, driftstruct * dp, Drawable d)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+
+       if (dp->rainbow) {
+               int         npix = MI_NPIXELS(mi);
+               int         i;
+
+               for (i = 0; i < npix; i++) {
+                       if (dp->ncpoints[i]) {
+                               XSetForeground(display, gc, MI_PIXEL(mi, i));
+                               XDrawPoints(display, d, gc, &(dp->cpts[i * MAXBATCH2]),
+                                           dp->ncpoints[i], CoordModeOrigin);
+                               dp->ncpoints[i] = 0;
+                       }
+               }
+       } else {
+               if (dp->npoints)
+                       XSetForeground(display, gc, dp->pixcol);
+               XDrawPoints(display, d, gc, dp->pts,
+                           dp->npoints, CoordModeOrigin);
+               dp->npoints = 0;
+       }
+}
+
+
+void
+draw_drift(ModeInfo * mi)
+{
+       Window      window = MI_WINDOW(mi);
+       driftstruct *dp;
+
+       if (drifts == NULL)
+               return;
+       dp = &drifts[MI_SCREEN(mi)];
+       if (dp->ncpoints == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       dp->timer = 3000;
+       while (dp->timer) {
+               iter(dp);
+               draw(mi, dp, window);
+               if (dp->total_points++ > dp->fractal_len) {
+                       draw_flush(mi, dp, window);
+                       if (0 == --dp->nfractals) {
+                               initmode(mi, frandom(dp, 2));
+                       }
+                       initfractal(mi);
+               }
+               dp->timer--;
+       }
+       if (!dp->grow) {
+               int         i, j, k;
+
+               draw_flush(mi, dp, window);
+               if (dp->liss)
+                       dp->liss_time++;
+               for (i = 0; i < dp->nxforms; i++)
+                       for (j = 0; j < 2; j++)
+                               for (k = 0; k < 3; k++) {
+                                       if (dp->liss)
+                                               dp->f[j][k][i] = sin(dp->liss_time * dp->df[j][k][i]);
+                                       else {
+                                               double      t = dp->f[j][k][i] += dp->df[j][k][i];
+
+                                               if (t < -1.0 || 1.0 < t)
+                                                       dp->df[j][k][i] *= -1.0;
+                                       }
+                               }
+       }
+}
+
+void
+release_drift(ModeInfo * mi)
+{
+       if (drifts != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_drift(&drifts[screen]);
+               (void) free((void *) drifts);
+               drifts = NULL;
+       }
+}
+
+void
+refresh_drift(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_drift */
diff --git a/modes/euler2d.c b/modes/euler2d.c
new file mode 100644 (file)
index 0000000..d0c7a47
--- /dev/null
@@ -0,0 +1,877 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* euler2d --- 2 Dimensional Incompressible Inviscid Fluid Flow */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)euler2d.c    5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*
+ * Copyright (c) 2000 by Stephen Montgomery-Smith <stephen@math.missouri.edu>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 04-Nov-2000: Added an option eulerpower.  This allows for example the
+ *              quasi-geostrophic equation by setting eulerpower to 2.
+ * 01-Nov-2000: Allocation checks.
+ * 10-Sep-2000: Added optimizations, and removed subtle_perturb, by stephen.
+ * 03-Sep-2000: Changed method of solving ode to Adams-Bashforth of order 2.
+ *              Previously used a rather compilcated method of order 4.
+ *              This doubles the speed of the program.  Also it seems
+ *              to have improved numerical stability.  Done by stephen.
+ * 27-Aug-2000: Added rotation of region to maximize screen fill by stephen.
+ * 05-Jun-2000: Adapted from flow.c Copyright (c) 1996 by Tim Auckland
+ * 18-Jul-1996: Adapted from swarm.c Copyright (c) 1991 by Patrick J. Naughton.
+ * 31-Aug-1990: Adapted from xswarm by Jeff Butterworth. (butterwo@ncsc.org)
+ */
+
+/*
+ * The mathematical aspects of this program are discussed in the file
+ * euler2d.tex.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Euler2d"
+#define HACK_INIT init_euler2d
+#define HACK_DRAW draw_euler2d
+#define euler2d_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+"*count: 1024 \n" \
+"*cycles: 3000 \n" \
+"*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_euler2d
+
+#define DEF_EULERTAIL "10"
+
+#define DEBUG_POINTED_REGION    0
+
+static int tail_len;
+static int variable_boundary = 1;
+static float power = 1;
+
+static XrmOptionDescRec opts[] =
+{
+  {(char* ) "-eulertail", (char *) ".euler2d.eulertail",
+   XrmoptionSepArg, (caddr_t) NULL},
+  {(char* ) "-eulerpower", (char *) ".euler2d.eulerpower",
+   XrmoptionSepArg, (caddr_t) NULL},
+};
+static argtype vars[] =
+{
+  {(caddr_t *) &tail_len, (char *) "eulertail",
+   (char *) "EulerTail", (char *) DEF_EULERTAIL, t_Int},
+  {(caddr_t *) &power, (char *) "eulerpower",
+   (char *) "EulerPower", (char *) "1", t_Float},
+};
+static OptionStruct desc[] =
+{
+  {(char *) "-eulertail len", (char *) "Length of Euler2d tails"},
+  {(char *) "-eulerpower power", (char *) "power of interaction law for points for Euler2d"},
+};
+
+ModeSpecOpt euler2d_opts =
+{sizeof opts / sizeof opts[0], opts,
+ sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   euler2d_description = {
+       "euler2d", "init_euler2d", "draw_euler2d", "release_euler2d",
+       "refresh_euler2d", "init_euler2d", NULL, &euler2d_opts,
+       1000, 1024, 3000, 1, 64, 1.0, "",
+       "Simulates 2D incompressible invisid fluid.", 0, NULL
+};
+
+#endif
+
+#define balance_rand(v)        ((LRAND()/MAXRAND*(v))-((v)/2)) /* random around 0 */
+#define positive_rand(v)       (LRAND()/MAXRAND*(v))   /* positive random */
+
+#define number_of_vortex_points 20
+
+#define n_bound_p 500
+#define deg_p 6
+
+static double delta_t;
+
+typedef struct {
+       int        width;
+       int        height;
+       int        count;
+       double     xshift,yshift,scale;
+       double     radius;
+
+        int        N;
+        int        Nvortex;
+
+/*  x[2i+0] = x coord for nth point
+    x[2i+1] = y coord for nth point
+    w[i] = vorticity at nth point
+*/
+       double     *x;
+       double     *w;
+
+       double     *diffx;
+       double     *olddiffx;
+       double     *tempx;
+       double     *tempdiffx;
+/*  (xs[2i+0],xs[2i+1]) is reflection of (x[2i+0],x[2i+1]) about unit circle
+    xs[2i+0] = x[2i+0]/nx
+    xs[2i+1] = x[2i+1]/nx
+    where
+    nx = x[2i+0]*x[2i+0] + x[2i+1]*x[2i+1]
+
+    x_is_zero[i] = (nx < 1e-10)
+*/
+       double     *xs;
+       short      *x_is_zero;
+
+/*  (p[2i+0],p[2i+1]) is image of (x[2i+0],x[2i+1]) under polynomial p.
+    mod_dp2 is |p'(z)|^2 when z = (x[2i+0],x[2i+1]).
+*/
+       double     *p;
+       double     *mod_dp2;
+
+/* Sometimes in our calculations we get overflow or numbers that are too big.  
+   If that happens with the point x[2*i+0], x[2*i+1], we set dead[i].
+*/
+       short      *dead;
+
+       XSegment   *csegs;
+       int         cnsegs;
+       XSegment   *old_segs;
+       int        *nold_segs;
+       int         c_old_seg;
+       int         boundary_color;
+       int         hide_vortex;
+       short      *lastx;
+
+       double      p_coef[2*(deg_p-1)];
+       XSegment   *boundary;
+
+} euler2dstruct;
+
+static euler2dstruct *euler2ds = NULL;
+
+/*
+  If variable_boundary == 1, then we make a variable boundary.
+  The way this is done is to map the unit disk under a 
+  polynomial p, where 
+  p(z) = z + c_2 z^2 + ... + c_n z^n
+  where n = deg_p.  sp->p_coef contains the complex numbers
+  c_2, c_3, ... c_n.
+*/
+
+#define add(a1,a2,b1,b2) (a1)+=(b1);(a2)+=(b2)
+#define mult(a1,a2,b1,b2) temp=(a1)*(b1)-(a2)*(b2); \
+                          (a2)=(a1)*(b2)+(a2)*(b1);(a1)=temp
+
+static void
+calc_p(double *p1, double *p2, double z1, double z2, double p_coef[])
+{
+  int i;
+  double temp;
+
+  *p1=0;
+  *p2=0;
+  for(i=deg_p;i>=2;i--)
+  {
+    add(*p1,*p2,p_coef[(i-2)*2],p_coef[(i-2)*2+1]);
+    mult(*p1,*p2,z1,z2);
+  }
+  add(*p1,*p2,1,0);
+  mult(*p1,*p2,z1,z2);
+}
+
+/* Calculate |p'(z)|^2 */
+static double
+calc_mod_dp2(double z1, double z2, double p_coef[])
+{
+  int i;
+  double temp,mp1,mp2;
+
+  mp1=0;
+  mp2=0;
+  for(i=deg_p;i>=2;i--)
+  {
+    add(mp1,mp2,i*p_coef[(i-2)*2],i*p_coef[(i-2)*2+1]);
+    mult(mp1,mp2,z1,z2);
+  }
+  add(mp1,mp2,1,0);
+  return mp1*mp1+mp2*mp2;
+}
+
+static void
+calc_all_p(euler2dstruct *sp)
+{
+  int i,j;
+  double temp,p1,p2,z1,z2;
+  for(j=(sp->hide_vortex?sp->Nvortex:0);j<sp->N;j++) if(!sp->dead[j])
+  {
+    p1=0;
+    p2=0;
+    z1=sp->x[2*j+0];
+    z2=sp->x[2*j+1];
+    for(i=deg_p;i>=2;i--)
+    {
+      add(p1,p2,sp->p_coef[(i-2)*2],sp->p_coef[(i-2)*2+1]);
+      mult(p1,p2,z1,z2);
+    }
+    add(p1,p2,1,0);
+    mult(p1,p2,z1,z2);
+    sp->p[2*j+0] = p1;
+    sp->p[2*j+1] = p2;
+  }
+}
+
+static void
+calc_all_mod_dp2(double *x, euler2dstruct *sp)
+{
+  int i,j;
+  double temp,mp1,mp2,z1,z2;
+  for(j=0;j<sp->N;j++) if(!sp->dead[j])
+  {
+    mp1=0;
+    mp2=0;
+    z1=x[2*j+0];
+    z2=x[2*j+1];
+    for(i=deg_p;i>=2;i--)
+    {
+      add(mp1,mp2,i*sp->p_coef[(i-2)*2],i*sp->p_coef[(i-2)*2+1]);
+      mult(mp1,mp2,z1,z2);
+    }
+    add(mp1,mp2,1,0);
+    sp->mod_dp2[j] = mp1*mp1+mp2*mp2;
+  }
+}
+
+static void
+derivs(double *x, euler2dstruct *sp)
+{
+  int i,j;
+  double u1,u2,x1,x2,xij1,xij2,nxij;
+  double nx;
+
+  if (variable_boundary)
+    calc_all_mod_dp2(sp->x,sp);
+
+  for (j=0;j<sp->Nvortex;j++) if (!sp->dead[j])
+  {
+    nx = x[2*j+0]*x[2*j+0] + x[2*j+1]*x[2*j+1];
+    if (nx < 1e-10)
+      sp->x_is_zero[j] = 1;
+    else {
+      sp->x_is_zero[j] = 0;
+      sp->xs[2*j+0] = x[2*j+0]/nx;
+      sp->xs[2*j+1] = x[2*j+1]/nx;
+    }
+  }
+
+  (void) memset(sp->diffx,0,sizeof(double)*2*sp->N);
+
+  for (i=0;i<sp->N;i++) if (!sp->dead[i])
+  {
+    x1 = x[2*i+0];
+    x2 = x[2*i+1];
+    for (j=0;j<sp->Nvortex;j++) if (!sp->dead[j])
+    {
+/*
+  Calculate the Biot-Savart kernel, that is, effect of a 
+  vortex point at a = (x[2*j+0],x[2*j+1]) at the point 
+  x = (x1,x2), returning the vector field in (u1,u2).
+
+  In the plane, this is given by the formula
+
+  u = (x-a)/|x-a|^2  or zero if x=a.
+
+  However, in the unit disk we have to subtract from the
+  above:
+
+  (x-as)/|x-as|^2
+
+  where as = a/|a|^2 is the reflection of a about the unit circle.
+
+  If however power != 1, then
+
+  u = (x-a)/|x-a|^(power+1)  -  |a|^(1-power) (x-as)/|x-as|^(power+1)
+
+*/
+
+      xij1 = x1 - x[2*j+0];
+      xij2 = x2 - x[2*j+1];
+      nxij = (power==1.0) ? xij1*xij1+xij2*xij2 : pow(xij1*xij1+xij2*xij2,(power+1)/2.0);
+
+      if(nxij >= 1e-4)  {
+        u1 =  xij2/nxij;
+        u2 = -xij1/nxij;
+      }
+      else
+        u1 = u2 = 0.0;
+
+      if (!sp->x_is_zero[j])
+      {
+        xij1 = x1 - sp->xs[2*j+0];
+        xij2 = x2 - sp->xs[2*j+1];
+        nxij = (power==1.0) ? xij1*xij1+xij2*xij2 : pow(xij1*xij1+xij2*xij2,(power+1)/2.0);
+
+        if (nxij < 1e-5)
+        {
+          sp->dead[i] = 1;
+          u1 = u2 = 0.0;
+        }
+        else
+        {
+          u1 -= xij2/nxij;
+          u2 += xij1/nxij;
+        }
+      }
+
+      if (!sp->dead[i])
+      {
+        sp->diffx[2*i+0] += u1*sp->w[j];
+        sp->diffx[2*i+1] += u2*sp->w[j];
+      }
+    }
+
+    if (!sp->dead[i] && variable_boundary)
+    {
+      if (sp->mod_dp2[i] < 1e-5)
+        sp->dead[i] = 1;
+      else
+      {
+        sp->diffx[2*i+0] /= sp->mod_dp2[i];
+        sp->diffx[2*i+1] /= sp->mod_dp2[i];
+      }
+    }
+  }
+}
+
+/*
+  What perturb does is effectively
+    ret = x + k,
+  where k should be of order delta_t.  
+
+  We have the option to do this more subtly by mapping points x 
+  in the unit disk to points y in the plane, where y = f(|x|) x, 
+  with f(t) = -log(1-t)/t.
+
+  This might reduce (but does not remove) problems where particles near 
+  the edge of the boundary bounce around.
+
+  But it seems to be not that effective, so for now switch it off.
+*/
+
+#define SUBTLE_PERTURB 0
+
+static void
+perturb(double ret[], double x[], double k[], euler2dstruct *sp)
+{
+  int i;
+  double x1,x2,k1,k2;
+
+#if SUBTLE_PERTURB
+  double d1,d2,t1,t2,mag,mag2,mlog1mmag,memmagdmag,xdotk;
+  for (i=0;i<sp->N;i++) if (!sp->dead[i])
+  {
+    x1 = x[2*i+0];
+    x2 = x[2*i+1];
+    k1 = k[2*i+0];
+    k2 = k[2*i+1];
+    mag2 = x1*x1 + x2*x2;
+    if (mag2 < 1e-10)
+    {
+      ret[2*i+0] = x1+k1;
+      ret[2*i+1] = x2+k2;
+    }
+    else if (mag2 > 1-1e-5)
+      sp->dead[i] = 1;
+    else
+    {
+      mag = sqrt(mag2);
+      mlog1mmag = -log(1-mag);
+      xdotk = x1*k1 + x2*k2;
+      t1 = (x1 + k1)*mlog1mmag/mag + x1*xdotk*(1.0/(1-mag)-mlog1mmag/mag)/mag/mag;
+      t2 = (x2 + k2)*mlog1mmag/mag + x2*xdotk*(1.0/(1-mag)-mlog1mmag/mag)/mag/mag;
+      mag = sqrt(t1*t1+t2*t2);
+      if (mag > 11.5 /* log(1e5) */)
+        sp->dead[i] = 1;
+      else
+      {
+        memmagdmag = (mag>1e-5) ? ((1.0-exp(-mag))/mag) : (1-mag/2.0);
+        ret[2*i+0] = t1*memmagdmag;
+        ret[2*i+1] = t2*memmagdmag;
+      }
+    }
+    if (!sp->dead[i])
+    {
+      d1 = ret[2*i+0]-x1;
+      d2 = ret[2*i+1]-x2;
+      if (d1*d1+d2*d2 > 0.1)
+        sp->dead[i] = 1;
+    }
+  }
+
+#else
+
+  for (i=0;i<sp->N;i++) if (!sp->dead[i])
+  {
+    x1 = x[2*i+0];
+    x2 = x[2*i+1];
+    k1 = k[2*i+0];
+    k2 = k[2*i+1];
+    if (k1*k1+k2*k2 > 0.1 || x1*x1+x2*x2 > 1-1e-5)
+      sp->dead[i] = 1;
+    else
+    {
+      ret[2*i+0] = x1+k1;
+      ret[2*i+1] = x2+k2;
+    }
+  }
+#endif
+}
+
+static void
+ode_solve(euler2dstruct *sp)
+{
+  int i;
+  double *temp;
+
+  if (sp->count < 1) {
+    /* midpoint method */
+    derivs(sp->x,sp);
+    (void) memcpy(sp->olddiffx,sp->diffx,sizeof(double)*2*sp->N);
+    for (i=0;i<sp->N;i++) if (!sp->dead[i]) {
+      sp->tempdiffx[2*i+0] = 0.5*delta_t*sp->diffx[2*i+0];
+      sp->tempdiffx[2*i+1] = 0.5*delta_t*sp->diffx[2*i+1];
+    }
+    perturb(sp->tempx,sp->x,sp->tempdiffx,sp);
+    derivs(sp->tempx,sp);
+    for (i=0;i<sp->N;i++) if (!sp->dead[i]) {
+      sp->tempdiffx[2*i+0] = delta_t*sp->diffx[2*i+0];
+      sp->tempdiffx[2*i+1] = delta_t*sp->diffx[2*i+1];
+    }
+    perturb(sp->x,sp->x,sp->tempdiffx,sp);
+  } else {
+    /* Adams Basforth */
+    derivs(sp->x,sp);
+    for (i=0;i<sp->N;i++) if (!sp->dead[i]) {
+      sp->tempdiffx[2*i+0] = delta_t*(1.5*sp->diffx[2*i+0] - 0.5*sp->olddiffx[2*i+0]);
+      sp->tempdiffx[2*i+1] = delta_t*(1.5*sp->diffx[2*i+1] - 0.5*sp->olddiffx[2*i+1]);
+    }
+    perturb(sp->x,sp->x,sp->tempdiffx,sp);
+    temp = sp->olddiffx;
+    sp->olddiffx = sp->diffx;
+    sp->diffx = temp;
+  }
+}
+
+#define deallocate(p) if (p != NULL) {(void) free((void *) p); p = NULL; }
+#define allocate(p,t,s) if ((p=(t*)malloc(sizeof(t)*s))==NULL)\
+{free_euler2d(sp);return;}
+
+static void
+free_euler2d(euler2dstruct *sp)
+{
+       deallocate(sp->csegs);
+       deallocate(sp->old_segs);
+       deallocate(sp->nold_segs);
+       deallocate(sp->lastx);
+       deallocate(sp->x);
+       deallocate(sp->diffx);
+       deallocate(sp->w);
+       deallocate(sp->olddiffx);
+       deallocate(sp->tempdiffx);
+       deallocate(sp->tempx);
+       deallocate(sp->dead);
+       deallocate(sp->boundary);
+       deallocate(sp->xs);
+       deallocate(sp->x_is_zero);
+       deallocate(sp->p);
+       deallocate(sp->mod_dp2);
+}
+
+void
+init_euler2d(ModeInfo * mi)
+{
+#define nr_rotates 18 /* how many rotations to try to fill as much of screen as possible - must be even number */
+       euler2dstruct *sp;
+       int         i,k,n,np;
+       double      r,theta,x,y,w;
+       double      mag,xscale,yscale,p1,p2;
+       double      low[nr_rotates],high[nr_rotates],pp1,pp2,pn1,pn2,angle1,angle2,tempangle,dist,scale,bestscale,temp;
+       int         besti = 0;
+
+        if (power<0.5) power = 0.5;
+        if (power>3.0) power = 3.0;
+       variable_boundary &= power == 1.0;
+       delta_t = 0.001;
+        if (power>1.0) delta_t *= pow(0.1,power-1);
+
+       if (euler2ds == NULL) {
+               if ((euler2ds = (euler2dstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (euler2dstruct))) == NULL)
+                       return;
+       }
+       sp = &euler2ds[MI_SCREEN(mi)];
+
+       sp->boundary_color = NRAND(MI_NPIXELS(mi));
+       sp->hide_vortex = NRAND(4) != 0;
+
+       sp->count = 0;
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+
+       sp->N = MI_COUNT(mi)+number_of_vortex_points;
+       sp->Nvortex = number_of_vortex_points;
+
+       if (tail_len < 1) { /* minimum tail */
+         tail_len = 1;
+       }
+       if (tail_len > MI_CYCLES(mi)) { /* maximum tail */
+         tail_len = MI_CYCLES(mi);
+       }
+
+       /* Clear the background. */
+       MI_CLEARWINDOW(mi);
+        
+       free_euler2d(sp);
+
+       /* Allocate memory. */
+
+       if (sp->csegs == NULL) {
+               allocate(sp->csegs, XSegment, sp->N);
+               allocate(sp->old_segs, XSegment, sp->N * tail_len);
+               allocate(sp->nold_segs, int, tail_len);
+               allocate(sp->lastx, short, sp->N * 2);
+               allocate(sp->x, double, sp->N * 2);
+               allocate(sp->diffx, double, sp->N * 2);
+               allocate(sp->w, double, sp->Nvortex);
+               allocate(sp->olddiffx, double, sp->N * 2);
+               allocate(sp->tempdiffx, double, sp->N * 2);
+               allocate(sp->tempx, double, sp->N * 2);
+               allocate(sp->dead, short, sp->N);
+               allocate(sp->boundary, XSegment, n_bound_p);
+               allocate(sp->xs, double, sp->Nvortex * 2);
+               allocate(sp->x_is_zero, short, sp->Nvortex);
+               allocate(sp->p, double, sp->N * 2);
+               allocate(sp->mod_dp2, double, sp->N);
+       }
+       for (i=0;i<tail_len;i++) {
+               sp->nold_segs[i] = 0;
+       }
+       sp->c_old_seg = 0;
+       (void) memset(sp->dead,0,sp->N*sizeof(short));
+
+       if (variable_boundary)
+       {
+       /* Initialize polynomial p */
+/*
+  The polynomial p(z) = z + c_2 z^2 + ... c_n z^n needs to be
+  a bijection of the unit disk onto its image.  This is achieved
+  by insisting that sum_{k=2}^n k |c_k| <= 1.  Actually we set
+  the inequality to be equality (to get more interesting shapes).
+*/
+               mag = 0;
+               for(k=2;k<=deg_p;k++)
+               {
+                       r = positive_rand(1.0/k);
+                       theta = balance_rand(2*M_PI);
+                       sp->p_coef[2*(k-2)+0]=r*cos(theta);
+                       sp->p_coef[2*(k-2)+1]=r*sin(theta);
+                       mag += k*r;
+               }
+               if (mag > 0.0001) for(k=2;k<=deg_p;k++)
+               {
+                       sp->p_coef[2*(k-2)+0] /= mag;
+                       sp->p_coef[2*(k-2)+1] /= mag;
+               }
+
+#if DEBUG_POINTED_REGION
+               for(k=2;k<=deg_p;k++){
+                       sp->p_coef[2*(k-2)+0]=0;
+                       sp->p_coef[2*(k-2)+1]=0;
+               }
+               sp->p_coef[2*(6-2)+0] = 1.0/6.0;
+#endif
+
+
+/* Here we figure out the best rotation of the domain so that it fills as
+   much of the screen as possible.  The number of angles we look at is determined
+   by nr_rotates (we look every 180/nr_rotates degrees).  
+   While we figure out the best angle to rotate, we also figure out the correct scaling factors.
+*/
+
+               for(k=0;k<nr_rotates;k++) {
+                       low[k] = 1e5;
+                       high[k] = -1e5;
+               }
+
+               for(k=0;k<n_bound_p;k++) {
+                       calc_p(&p1,&p2,cos((double)k/(n_bound_p)*2*M_PI),sin((double)k/(n_bound_p)*2*M_PI),sp->p_coef);
+                       calc_p(&pp1,&pp2,cos((double)(k-1)/(n_bound_p)*2*M_PI),sin((double)(k-1)/(n_bound_p)*2*M_PI),sp->p_coef);
+                       calc_p(&pn1,&pn2,cos((double)(k+1)/(n_bound_p)*2*M_PI),sin((double)(k+1)/(n_bound_p)*2*M_PI),sp->p_coef);
+                       angle1 = nr_rotates/M_PI*atan2(p2-pp2,p1-pp1)-nr_rotates/2;
+                       angle2 = nr_rotates/M_PI*atan2(pn2-p2,pn1-p1)-nr_rotates/2;
+                       while (angle1<0) angle1+=nr_rotates*2;
+                       while (angle2<0) angle2+=nr_rotates*2;
+                       if (angle1>nr_rotates*1.75 && angle2<nr_rotates*0.25) angle2+=nr_rotates*2;
+                       if (angle1<nr_rotates*0.25 && angle2>nr_rotates*1.75) angle1+=nr_rotates*2;
+                        if (angle2<angle1) {
+                               tempangle=angle1;
+                               angle1=angle2;
+                               angle2=tempangle;
+                       }
+                       for(i=(int)floor(angle1);i<(int)ceil(angle2);i++) {
+                               dist = cos((double)i*M_PI/nr_rotates)*p1 + sin((double)i*M_PI/nr_rotates)*p2;
+                               if (i%(nr_rotates*2)<nr_rotates) {
+                                       if (dist>high[i%nr_rotates]) high[i%nr_rotates] = dist;
+                                       if (dist<low[i%nr_rotates]) low[i%nr_rotates] = dist;
+                               }
+                               else {
+                                       if (-dist>high[i%nr_rotates]) high[i%nr_rotates] = -dist;
+                                       if (-dist<low[i%nr_rotates]) low[i%nr_rotates] = -dist;
+                               }
+                       }
+               }
+               bestscale = 0;
+               for (i=0;i<nr_rotates;i++) {
+                       xscale = (sp->width-5.0)/(high[i]-low[i]);
+                       yscale = (sp->height-5.0)/(high[(i+nr_rotates/2)%nr_rotates]-low[(i+nr_rotates/2)%nr_rotates]);
+                       scale = (xscale>yscale) ? yscale : xscale;
+                       if (scale>bestscale) {
+                               bestscale = scale;
+                               besti = i;
+                       }
+               }
+/* Here we do the rotation.  The way we do this is to replace the
+   polynomial p(z) by a^{-1} p(a z) where a = exp(i best_angle).
+*/
+               p1 = 1;
+               p2 = 0;
+               for(k=2;k<=deg_p;k++)
+               {
+                       mult(p1,p2,cos((double)besti*M_PI/nr_rotates),sin((double)besti*M_PI/nr_rotates));
+                       mult(sp->p_coef[2*(k-2)+0],sp->p_coef[2*(k-2)+1],p1,p2);
+               }
+
+               sp->scale = bestscale;
+               sp->xshift = -(low[besti]+high[besti])/2.0*sp->scale+sp->width/2;
+                if (besti<nr_rotates/2)
+                       sp->yshift = -(low[besti+nr_rotates/2]+high[besti+nr_rotates/2])/2.0*sp->scale+sp->height/2;
+               else
+                       sp->yshift = (low[besti-nr_rotates/2]+high[besti-nr_rotates/2])/2.0*sp->scale+sp->height/2;
+
+
+/* Initialize boundary */
+
+               for(k=0;k<n_bound_p;k++)
+               {
+
+                       calc_p(&p1,&p2,cos((double)k/(n_bound_p)*2*M_PI),sin((double)k/(n_bound_p)*2*M_PI),sp->p_coef);
+                       sp->boundary[k].x1 = (short)(p1*sp->scale+sp->xshift);
+                       sp->boundary[k].y1 = (short)(p2*sp->scale+sp->yshift);
+               }
+               for(k=1;k<n_bound_p;k++)
+               {
+                       sp->boundary[k].x2 = sp->boundary[k-1].x1;
+                       sp->boundary[k].y2 = sp->boundary[k-1].y1;
+               }
+               sp->boundary[0].x2 = sp->boundary[n_bound_p-1].x1;
+               sp->boundary[0].y2 = sp->boundary[n_bound_p-1].y1;
+       }
+       else
+       {
+               if (sp->width>sp->height)
+                       sp->radius = sp->height/2.0-5.0;
+               else
+                       sp->radius = sp->width/2.0-5.0;
+       }
+
+       /* Initialize point positions */
+
+       for (i=sp->Nvortex;i<sp->N;i++) {
+               do {
+                       r = sqrt(positive_rand(1.0));
+                       theta = balance_rand(2*M_PI);
+                       sp->x[2*i+0]=r*cos(theta);
+                       sp->x[2*i+1]=r*sin(theta);
+               /* This is to make sure the initial distribution of points is uniform */
+               } while (variable_boundary && 
+                          calc_mod_dp2(sp->x[2*i+0],sp->x[2*i+1],sp->p_coef)
+                          < positive_rand(4));
+       }
+
+       n = NRAND(4)+2;
+       /* number of vortex points with negative vorticity */
+       if (n%2) {
+               np = NRAND(n+1); 
+       }
+       else {
+               /* if n is even make sure that np==n/2 is twice as likely
+                  as the other possibilities. */
+               np = NRAND(n+2);
+               if (np==n+1) np=n/2;
+       }
+       for(k=0;k<n;k++)
+       {
+               r = sqrt(positive_rand(0.77));
+               theta = balance_rand(2*M_PI);
+               x=r*cos(theta);
+               y=r*sin(theta);
+               r = 0.02+positive_rand(0.1);
+               w = (2*(k<np)-1)*2.0/sp->Nvortex;
+               for (i=sp->Nvortex*k/n;i<sp->Nvortex*(k+1)/n;i++) {
+                       theta = balance_rand(2*M_PI);
+                       sp->x[2*i+0]=x + r*cos(theta);
+                       sp->x[2*i+1]=y + r*sin(theta);
+                       sp->w[i]=w;
+               }
+       }
+}
+
+void
+draw_euler2d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         b, col, n_non_vortex_segs;
+       euler2dstruct *sp;
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (euler2ds == NULL)
+               return;
+       sp = &euler2ds[MI_SCREEN(mi)];
+       if (sp->csegs == NULL)
+               return;
+
+       ode_solve(sp);
+       if (variable_boundary)
+               calc_all_p(sp);
+
+       sp->cnsegs = 0;
+       for(b=sp->Nvortex;b<sp->N;b++) if(!sp->dead[b])
+       {
+               sp->csegs[sp->cnsegs].x1 = sp->lastx[2*b+0];
+               sp->csegs[sp->cnsegs].y1 = sp->lastx[2*b+1];
+               if (variable_boundary)
+               {
+                       sp->csegs[sp->cnsegs].x2 = (short)(sp->p[2*b+0]*sp->scale+sp->xshift);
+                       sp->csegs[sp->cnsegs].y2 = (short)(sp->p[2*b+1]*sp->scale+sp->yshift);
+               }
+               else
+               {
+                       sp->csegs[sp->cnsegs].x2 = (short)(sp->x[2*b+0]*sp->radius+sp->width/2);
+                       sp->csegs[sp->cnsegs].y2 = (short)(sp->x[2*b+1]*sp->radius+sp->height/2);
+               }
+               sp->lastx[2*b+0] = sp->csegs[sp->cnsegs].x2;
+               sp->lastx[2*b+1] = sp->csegs[sp->cnsegs].y2;
+               sp->cnsegs++;
+       }
+       n_non_vortex_segs = sp->cnsegs;
+
+       if (!sp->hide_vortex) for(b=0;b<sp->Nvortex;b++) if(!sp->dead[b])
+       {
+               sp->csegs[sp->cnsegs].x1 = sp->lastx[2*b+0];
+               sp->csegs[sp->cnsegs].y1 = sp->lastx[2*b+1];
+               if (variable_boundary)
+               {
+                       sp->csegs[sp->cnsegs].x2 = (short)(sp->p[2*b+0]*sp->scale+sp->xshift);
+                       sp->csegs[sp->cnsegs].y2 = (short)(sp->p[2*b+1]*sp->scale+sp->yshift);
+               }
+               else
+               {
+                       sp->csegs[sp->cnsegs].x2 = (short)(sp->x[2*b+0]*sp->radius+sp->width/2);
+                       sp->csegs[sp->cnsegs].y2 = (short)(sp->x[2*b+1]*sp->radius+sp->height/2);
+               }
+               sp->lastx[2*b+0] = sp->csegs[sp->cnsegs].x2;
+               sp->lastx[2*b+1] = sp->csegs[sp->cnsegs].y2;
+               sp->cnsegs++;
+       }
+
+       if (sp->count) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+               XDrawSegments(display, window, gc, sp->old_segs+sp->c_old_seg*sp->N, sp->nold_segs[sp->c_old_seg]);
+
+               if (MI_NPIXELS(mi) > 2){ /* render colour */
+                       for (col = 0; col < MI_NPIXELS(mi); col++) {
+                         int start = col*n_non_vortex_segs/MI_NPIXELS(mi);
+                         int finish = (col+1)*n_non_vortex_segs/MI_NPIXELS(mi);
+                         XSetForeground(display, gc, MI_PIXEL(mi, col));
+                         XDrawSegments(display, window, gc,sp->csegs+start, finish-start);
+                       }
+                       if (!sp->hide_vortex) {
+                         XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                         XDrawSegments(display, window, gc,sp->csegs+n_non_vortex_segs, sp->cnsegs-n_non_vortex_segs);
+                       }
+
+               } else {                /* render mono */
+                 XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                 XDrawSegments(display, window, gc,
+                                               sp->csegs, sp->cnsegs);
+               }
+
+               if (MI_NPIXELS(mi) > 2) /* render colour */
+                       XSetForeground(display, gc, MI_PIXEL(mi, sp->boundary_color));
+               else
+                       XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi));
+               if (variable_boundary)
+                       XDrawSegments(display, window, gc,
+                                               sp->boundary, n_bound_p);
+               else
+                       XDrawArc(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                                sp->width/2 - (int) sp->radius - 1, sp->height/2 - (int) sp->radius -1,
+                                (int) (2*sp->radius) + 2, (int) (2* sp->radius) + 2, 0, 64*360);
+
+               /* Copy to erase-list */
+               (void) memcpy(sp->old_segs+sp->c_old_seg*sp->N, sp->csegs, sp->cnsegs*sizeof(XSegment));
+               sp->nold_segs[sp->c_old_seg] = sp->cnsegs;
+               sp->c_old_seg++;
+               if (sp->c_old_seg >= tail_len)
+                 sp->c_old_seg = 0;
+       }
+
+       if (++sp->count > MI_CYCLES(mi)) /* pick a new flow */
+               init_euler2d(mi);
+
+}
+
+void
+release_euler2d(ModeInfo * mi)
+{
+       if (euler2ds != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_euler2d(&euler2ds[screen]);
+               (void) free((void *) euler2ds);
+               euler2ds = NULL;
+       }
+}
+
+void
+refresh_euler2d(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_euler2d */
diff --git a/modes/euler2d.tex b/modes/euler2d.tex
new file mode 100644 (file)
index 0000000..700ad31
--- /dev/null
@@ -0,0 +1,337 @@
+\documentclass[12pt]{article}
+
+%\usepackage{fullpage}
+\usepackage{amsmath,amssymb}
+
+\begin{document}
+
+\title{Two Dimensional Euler Simulation}
+
+\author{
+S.J. Montgomery-Smith\\
+Department of Mathematics\\
+University of Missouri\\
+Columbia, MO 65211, U.S.A.\\
+stephen@math.missouri.edu\\
+http://www.math.missouri.edu/\~{}stephen}
+
+\date{September 10, 2000}
+
+\maketitle
+
+This document describes a program I wrote to simulate the 
+two dimensional Euler Equation --- a program that is part
+of the {\tt xlock} screensaver as the {\tt euler2d}
+mode.  A similar explanation may also be found in the
+book by Chorin \cite{C}.
+
+\section{The Euler Equation}
+
+The Euler Equation describes the motion of an incompressible
+fluid that has no viscosity.  If the fluid is contained
+in a domain $\Omega$ with boundary $\partial \Omega$, then
+the equation is in the vector field $u$ (the velocity)
+and the
+scalar field $p$ (the pressure):
+\begin{eqnarray*}
+\frac{\partial}{\partial t} u &=& -u \cdot \nabla u + \nabla p \\
+\nabla \cdot u &=& 0 \\
+u \cdot n &=& 0 \quad \text{on $\partial \Omega$}
+\end{eqnarray*}
+where $n$ is the unit normal to $\partial \Omega$.
+
+\section{Vorticity}
+
+It turns out that it can be easier write these equations
+in terms of the vorticity.  In two dimensions the vorticity
+is the scalar $w = \partial u_2/\partial x - \partial u_1/\partial y$.
+The equation for vorticity becomes
+\[ \frac{\partial}{\partial t} w = -u \cdot \nabla w .\]
+A solution to this equation can be written as follows.  The velocity
+$u$ causes a flow, that is, a function $\varphi(t,x)$ that tells where
+the particle initially at $x$ ends up at time $t$, that is
+\[
+\frac\partial{\partial t} \varphi(t,x)
+= u(t,\varphi(t,x)) .\]
+Then the equation
+for $w$ tells us that the vorticity is ``pushed'' around by the flow,
+that is, $w(t,\varphi(t,x)) = w(0,x)$.
+
+\section{The Biot-Savart Kernel}
+
+Now, once we have the vorticity, we can recover the velocity $u$ by
+solving the equation
+\begin{eqnarray*}
+\partial u_2/\partial x - \partial u_1/\partial y &=& w \\
+\nabla \cdot u &=& 0 \\
+u \cdot n &=& 0 \quad \text{on $\partial \Omega$}.
+\end{eqnarray*}
+This equation is solved by using a Biot-Savart kernel $K(x,y)$:
+$$ u(x) = \int_\Omega K(x,y) w(y) \, dy .$$
+The function $K$ depends upon the choice of domain.  First let us consider
+the case when $\Omega$ is the whole plane (in which case the boundary
+condition $u \cdot n = 0$ is replaced by saying that $u$ decays at infinity).
+Then
+\begin{equation*}
+K(x,y) = K_1(x,y) = c \frac{(x-y)^\perp}{|x-y|^2} .
+\end{equation*}
+Here $x^\perp = (-x_2,x_1)$, and $c$ is a constant, probably something
+like $1/2\pi$.  In any case we will set it to be one, which in effect
+is rescaling the time variable, so we don't need to worry about it.
+
+We can use this as a basis to find $K$ on the unit disk
+$\Omega = \Delta = \{x:|x|<1\}$.  It turns out to be
+\begin{equation*}
+K_2(x,y) = K_1(x,y) - K_1(x,y^*) ,
+\end{equation*}
+where $y^* = y/|y|^2$ is called the reflection of $y$ about the
+boundary of the unit disk.
+
+Another example is if we have a bijective analytic function
+$p:\Delta \to {\mathbb C}$, and we let $\Omega = p(\Delta)$.
+(Here we think of $\Delta$ as a subset of $\mathbb C$, that is,
+we are identifying the plane with the set of complex numbers.)
+In that case we get
+\[ K_p(p(x),p(y)) = K_2(x,y)/|p'(x)|^2 .\]
+Our simulation considers the last case.  Examples of such
+analytic functions include series 
+$p(x) = x + \sum_{n=2}^\infty c_n x^n$, where
+$\sum_{n=2}^\infty n |c_n| \le 1$.
+(Thanks to David Ullrich for pointing this out to me.)
+
+\section{The Simulation}
+
+Now let's get to decribing the simulation.  We assume a rather
+unusual initial distribution for the vorticity --- that the
+vorticity is a finite sum of dirac delta masses.
+\[ w(0,x) = \sum_{k=1}^N w_k \delta(x-x_k(0)) .\]
+Here $x_k(0)$ is the initial place where the points
+of vorticity are concentrated, with values $w_k$.  
+Then at time $t$, the vorticity becomes
+\[ w(t,x) = \sum_{k=1}^N w_k \delta(x-x_k(t)) .\]
+The points of fluid $x_k(t)$ are pushed by the
+flow, that is, $x_k(t) = \varphi(t,x_k(0))$, or
+\[ \frac{\partial}{\partial t} x_k(t) = u(t,x_k(t)) .\]
+Putting this all together, we finally obtain the equations
+\[ \frac{\partial}{\partial t} x_k = \alpha_k \]
+where
+\[ \alpha_k   = \sum_{l=1}^N w_l K(x_k,x_l) .\]
+This is the equation that our simulation solves.
+
+In fact, in our case, where the domain is $p(\Delta)$,
+the points are described by points
+$\tilde x_k$, where $x_k = p(\tilde x_k)$.  Then
+the equations become
+\begin{eqnarray}
+\label{tildex-p1}
+\frac{\partial}{\partial t} \tilde x_k &=& \tilde\alpha_k \\
+\label{tildex-p2}
+\tilde\alpha_k &=& \frac1{|p'(\tilde x_k)|^2}
+     \sum_{l=1}^N w_l K_2(\tilde x_k,\tilde x_l) .
+\end{eqnarray}
+
+We solve this $2N$ system of equations using standard
+numerical methods, in our case, using the second order midpoint method
+for the first step, and thereafter using the second order Adams-Bashforth 
+method.  (See for example the book
+by Burden and Faires \cite{BF}).
+
+\section{The Program - Data Structures}
+
+The computer program solves equation (\ref{tildex-p1}), and displays
+the results on the screen, with a boundary.  All the information
+for solving the equation and displaying the output is countained
+in the structure {\tt euler2dstruct}.  Let us describe some of
+the fields in {\tt euler2dstruct}.  
+The points $\tilde x_k$ are contained 
+in {\tt double *x}: with the coordinates of
+$\tilde x_k$ being the two numbers
+{\tt x[2*k+0]}, {\tt x[2*k+1]}.  The values $w_k$ are contained
+in {\tt double *w}.  The total number of points is
+{\tt int N}.  (But only the first {\tt int Nvortex} points
+have $w_k \ne 0$.)  The coefficients of the analytic function
+(in our case a polynomial) $p$
+are contained in {\tt double p\_coef[2*(deg\_p-1)]} --- here
+{\tt deg\_p} is the degree of $p$, and the real and imaginary
+parts of the coefficient
+$c_n$ is contained in {\tt p\_coef[2*(n-2)+0]} and {\tt p\_coef[2*(n-2)+1]}.
+
+\section{Data Initialization}
+
+The program starts in the function {\tt init\_euler2d}.  After allocating
+the memory for the data, and initialising some of the temporary variables
+required for the numerical solving program, it randomly assigns the
+coefficients of $p$, making sure that $\sum_{n=2}^{\tt deg\_p} n |c_n| = 1$.
+Then the program figures out how to draw the boundary, and what rescaling
+of the data is required to draw it on the screen.  (This uses the
+function {\tt calc\_p} which calculates $p(x)$.)
+
+Next, it randomly assigns the initial values of $\tilde x_k$.  We want
+to do this in such a way so that the points are uniformly spread over the
+domain.  Let us first consider the case when the domain is the unit circle
+$\Delta$.  In that case the proportion of points that we would expect
+inside the circle of radius $r$ would be proportional to $r^2$.  So
+we do it as follows:
+\[ r = \sqrt{R_{0,1}},\quad \theta = R_{-\pi,\pi}, \quad
+   \tilde x_k = r (\cos \theta, \sin \theta) .\]
+Here, and in the rest of this discussion, $R_{a,b}$ is a function
+that returns a random variable uniformly distributed over the interval
+$[a,b]$.
+
+This works fine for $\Delta$, but for $p(\Delta)$, the points 
+$p(\tilde x_k)$ are not uniformly distributed over $p(\Delta)$,
+but are distributed with a density proportional to
+$1/|p'(\tilde x_k)|^2$.  So to restore the uniform density we need
+to reject this value of $\tilde x_k$ with probability proportional
+to $|p'(\tilde x_k)|^2$.  Noticing that the condition 
+$\sum_{n=2}^{\tt deg\_p} n |c_n| = 1$ implies that 
+$|p'(\tilde x_k)| \le 2$, we
+do this by rejecting if $|p'(\tilde x_k)|^2 < R_{0,4}$.
+(This makes use of the function {\tt calc\_mod\_dp2} which calculates
+$|p'(x)|^2$.)
+
+\section{Solving the Equation}
+
+The main loop of the program is in the function {\tt draw\_euler2d}.
+Most of the drawing operations are contained in this function, and
+the numerical aspects are sent to the function {\tt ode\_solve}.
+But there is an aspect of this that I would like
+to discuss in the next section, and so we will look at a simple method for 
+numerically solving differential equations.
+
+The Euler Method
+(nothing to do with the Euler Equation), is as
+follows.  Pick a small number $h$ --- the time step (in
+the program call {\tt delta\_t}).  Then we approximate
+the solution of the equation:
+\begin{equation}
+\label{method-simple}
+\tilde x_k(t+h) = \tilde x_k(t) + h \tilde\alpha_k(t) .
+\end{equation}
+The more sophisticated methods we use are variations of 
+the Euler Method, and so the discussion in the following section
+still applies.
+
+In the program, the quantities $\tilde\alpha_k$, given by
+equations (\ref{tildex-p2}) are calculated by the function
+{\tt derivs}
+(which in turns calls {\tt calc\_all\_mod\_dp2} to
+calculate $|p'(\tilde x_k)|^2$ at all the points).
+
+
+\section{Subtle Perturbation}
+
+Added later: the scheme described here seems to not be that effective,
+so now it is not used.
+
+One problem using a numerical scheme such as the Euler Method occurs
+when the points $\tilde x_k$ get close to the boundary
+of $\Delta$.  In that case, it is possible that the new
+points will be pushed outside of the boundary.  Even if they 
+are not pushed out of the boundary, they may be much closer
+or farther from the boundary than they should be.  
+Our system of equations is very sensitive to how close points
+are to the boundary --- points with non-zero vorticity
+(``vortex points'') that are close to the boundary travel
+at great speed alongside the boundary, with speed that is
+inversely proportional to the distance from the boundary.
+
+A way to try to mitigate this problem is something that I call
+``subtle perturbation.''
+We map the points in 
+the unit disk to points in the plane using the map
+\begin{equation*}
+F(x) = f(|x|) \frac x{|x|} ,
+\end{equation*}
+where $f:[0,1]\to[0,\infty]$ is an increasing continuous
+bijection.  It turns out that a good choice is
+\begin{equation*}
+f(t) = -\log(1-t) .
+\end{equation*}
+(The reason for this is that points close to each other 
+that are a distance
+about $r$ from the boundary will be pushed around so that
+their distance from each other is about multiplied by the
+derivative of $\log r$, that is, $1/r$.)
+Note that the inverse of this function is given by
+\begin{equation*}
+F^{-1}(x) = f^{-1}(|x|) \frac x{|x|} ,
+\end{equation*}
+where 
+\begin{equation*}
+f^{-1}(t) = 1-e^{-t} .
+\end{equation*}
+
+So what we could do is the following: instead of working with
+the points $\tilde x_k$, we could work instead with the points
+$y_k = F(\tilde x_k)$.  In effect this is what we do.
+Instead of performing the computation (\ref{method-simple}),
+we do the calculation
+\begin{equation*}
+y_k = F(\tilde x_k(t)) + h {\cal A}(\tilde x_k) \tilde\alpha_k(t) 
+\end{equation*}
+where
+${\cal A}(x)$ is the matrix of partial derivatives of $F$:
+\begin{equation*}
+{\cal A}(x) = 
+\frac{f(|x|)}{|x|}
+\left[
+\begin{matrix}
+1 & 0\\
+0 & 1
+\end{matrix}
+\right]
++ \frac1{|x|}
+  \left(\frac{f'(|x|)}{|x|} - \frac{f(|x|)}{|x|^2}\right)
+\left[
+\begin{matrix}
+x_{1}^2   & x_{1} x_{2}\\
+x_{1} x_{2} & x_{2}^2
+\end{matrix}
+\right],
+\end{equation*}
+and then compute
+\begin{equation*}
+\tilde x_k(t+h) = F^{-1}(y_k).
+\end{equation*}
+These calculations are done in the function {\tt perturb}, if
+the quantity {\tt SUBTLE\_PERTURB} is set.
+
+\section{Drawing the Points}
+
+As we stated earlier, most of the drawing functions are contained
+in the function {\tt draw\_euler2d}.  If the variable 
+{\tt hide\_vortex} is set (and the function {\tt init\_euler2d}
+will set this with probability $3/4$), then we only display
+the points $\tilde x_k$ for ${\tt Nvortex} < k \le N$.  If 
+{\tt hide\_vortex} is not set, then the ``vortex points''
+$\tilde x_k$ ($1 \le k \le {\tt Nvortex}$) are displayed in white.
+In fact the points $p(\tilde x_k)$ are what are put onto the screen,
+and for this we make use of the function {\tt calc\_all\_p}.
+
+\section{Addition to Program: Changing the Power Law}
+
+A later addition to the program adds an option {\tt eulerpower},
+which allows one to change the power law that describes how
+the vortex points influence other points.  In effect, if this
+option is set with the value $m$, then the Biot-Savart Kernel
+is replace by
+$$ K_1(x,y) = \frac{(x-y)^\perp}{|x-y|^{m+1}}, $$
+and
+$$ K_2(x,y) = K_1(x,y) - |y|^{1-m} K_1(x,y) .$$
+So for example, setting $m=2$ corresponds to the 
+quasi-geostrophic equation.  (I haven't yet figured out
+what $K_p$ should be, so if $m \ne 1$ we use the unit circle
+as the boundary.)
+
+\begin{thebibliography}{9}
+
+\bibitem{BF} Richard L. Burden, J. Douglas Faires, Numerical Analysis,
+sixth edition, Brooks/Cole, 1996.
+
+\bibitem{C} Alexandre J. Chorin, Vorticity and Turbulence,
+Applied Mathematical Sciences, Vol 103, Springer Verlag, 1994.
+
+\end{thebibliography}
+
+\end{document}
diff --git a/modes/eyes.c b/modes/eyes.c
new file mode 100644 (file)
index 0000000..b5f6829
--- /dev/null
@@ -0,0 +1,1112 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* eyes --- follow the bouncing Grelb */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)eyes.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright 1996 by Ron Hitchens <ron@idiom.com>
+ *
+ * Adapted from the ubiquitous xeyes demo supplied by MIT with the
+ * X Window System.
+ * That code is Copyright 1991 Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 04-Sep-1997: Added interactive frobbing with mouse (copied from julia.c)
+ * 10-May-1997: Compatible with xscreensaver
+ * 18-Mar-1996: Changes for new hook calling conventions.  Keep per-screen
+ *              state information.  Remove global accesses.
+ * 21-Feb-1996: Recoded to keep an off-screen image for each pair of eyes,
+ *              and to only paint the changed parts to the screen.
+ *              Allow the Grelb to enter from either side.
+ * 18-Feb-1996: Got the code into mostly working condition.
+ * 15-Feb-1996: Had a brainwave, started hacking the xeyes code.
+ *
+ * Put "random rotations and horizontal shifts in.
+ * At first try make the shifts "random" with a weighting scheme favouring
+ * shifts towards the most empty region.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Eyes"
+#define HACK_INIT init_eyes
+#define HACK_DRAW draw_eyes
+#define eyes_opts xlockmore_opts
+#define DEFAULTS "*delay: 20000 \n" \
+ "*count: -8 \n" \
+ "*cycles: 5 \n" \
+ "*ncolors: 200 \n" \
+ "*bitmap: \n" \
+ "*trackmouse: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_eyes
+
+#define DEF_TRACKMOUSE  "False"
+
+static Bool trackmouse;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-trackmouse", (char *) ".eyes.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+trackmouse", (char *) ".eyes.trackmouse", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"}
+};
+
+ModeSpecOpt eyes_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   eyes_description =
+{"eyes", "init_eyes", "draw_eyes", "release_eyes",
+ "refresh_eyes", "init_eyes", NULL, &eyes_opts,
+ 20000, -8, 5, 1, 64, 1.0, "",
+ "Shows eyes following a bouncing grelb", 0, NULL};
+
+#endif
+
+/* definitions for the xlock version of xeyes */
+#define MAX_EYES               200     /* limit or uses too much memory */
+#define MIN_EYE_SIZE           50      /* smallest size eyes can be */
+#define FLY_ICON_SIZE          5       /* the size of a fly when iconic */
+#define FLY_MAX_SPEED          10      /* max (slowest) delay between steps */
+#define FLY_SIDE_LEFT          0       /* enter and leave by left side */
+#define FLY_SIDE_RIGHT         1       /* enter and leave by right side */
+#define LIFE_MIN               100     /* shortest life, cycles  */
+#define LIFE_RANGE             1000    /* range of possible lifetimes */
+#define MAX_CYCLES             10      /* max value of cycles */
+#define FRICTION               24      /* affects bounciness */
+
+/* definitions from the original MIT xeyes code */
+#define NUM_EYES               2
+#define EYE_X(n)               ((n) * 2.0)
+#define EYE_Y(n)               (0.0)
+#define EYE_OFFSET             (0.1)   /* padding between eyes */
+#define EYE_THICK              (0.175)         /* thickness of eye rim */
+#define BALL_WIDTH             (0.3)
+#define BALL_PAD               (0.05)
+#define EYE_WIDTH              (2.0 - (EYE_THICK + EYE_OFFSET) * 2)
+#define EYE_HEIGHT             EYE_WIDTH
+#define EYE_HWIDTH             (EYE_WIDTH / 2.0)
+#define EYE_HHEIGHT            (EYE_HEIGHT / 2.0)
+#define BALL_HEIGHT            BALL_WIDTH
+#define BALL_DIST              ((EYE_WIDTH - BALL_WIDTH) / 2.0 - BALL_PAD)
+#define W_MIN_X                        (-1.0 + EYE_OFFSET)
+#define W_MAX_X                        (3.0 - EYE_OFFSET)
+#define W_MIN_Y                        (-1.0 + EYE_OFFSET)
+#define W_MAX_Y                        (1.0 - EYE_OFFSET)
+
+/* ---------------------------------------------------------------------- */
+
+/* definitions of matrix math code used by xeyes */
+
+#define TPointEqual(a, b)      ((a).x == (b).x && (a).y == (b).y)
+#define XPointEqual(a, b)      ((a).x == (b).x && (a).y == (b).y)
+
+typedef struct _transform {
+       double      mx, bx;
+       double      my, by;
+} Transform;
+
+typedef struct _TPoint {
+       double      x, y;
+} TPoint;
+
+#define Xx(x,y,t)              ((int)((t)->mx * (x) + (t)->bx + 0.5))
+#define Xy(x,y,t)              ((int)((t)->my * (y) + (t)->by + 0.5))
+#define Xwidth(w,h,t)          ((int)((t)->mx * (w) + 0.5))
+#define Xheight(w,h,t)         ((int)((t)->my * (h) + 0.5))
+#define Tx(x,y,t)              ((((double) (x)) - (t)->bx) / (t)->mx)
+#define Ty(x,y,t)              ((((double) (y)) - (t)->by) / (t)->my)
+#define Twidth(w,h,t)          (((double) (w)) / (t)->mx)
+#define Theight(w,h,t)         (((double) (h)) / (t)->my)
+
+/* ---------------------------------------------------------------------- */
+
+/* aliases for vars defined in the bitmap file */
+#define FLY_WIDTH              image_width
+#define FLY_HEIGHT             image_height
+#define FLY_BITS               image_bits
+
+#include "eyes.xbm"
+#ifdef XBM_GRELB
+#include "eyes2.xbm"
+#define FLY2_WIDTH   image2_width
+#define FLY2_HEIGHT  image2_height
+#define FLY2_BITS    image2_bits
+#endif
+
+typedef struct {               /* info about a "fly" */
+       int         x, y;
+       int         oldx, oldy;
+       int         width, height;
+       int         vx, vy;
+       int         side;
+       unsigned long pixel;
+       int         zero_y;
+} Fly;
+
+typedef struct {               /* info about a pair of eyes */
+       int         x, y;
+       int         width;
+       int         height;
+       int         rectw, recth;
+       int         painted;
+       unsigned long time_to_die;
+       unsigned long eyelid_pixel, eyeball_pixel, pupil_pixel;
+       Pixmap      pixmap;
+       XRectangle  bbox;
+       Transform   transform;
+       TPoint      pupil[2];
+       TPoint      last_pupil[2];
+} Eyes;
+
+typedef struct {               /* per-screen info */
+       Pixmap      flypix;
+       int         flywidth, flyheight;
+#ifdef XBM_GRELB
+       Pixmap      fly2pix;
+       int         fly2width, fly2height;
+#endif
+       int         graphics_format;
+       GC          eyeGC;
+       GC          flyGC;
+       int         num_eyes;
+       Eyes       *eyes;
+       Fly         fly;
+       Cursor      cursor;
+       unsigned long time;
+} EyeScrInfo;
+
+/* ---------------------------------------------------------------------- */
+
+static EyeScrInfo *eye_info = NULL;
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Fill an arc, using a tranformation matrix.  Lifted from xeyes.
+ *      The code to return the bounding box is a local addition.
+ */
+
+static void
+TFillArc(register Display * dpy, Drawable d, GC gc, Transform * t, double x, double y, double width, double height, int angle1, int angle2, XRectangle * rect)
+{
+       int         xx, xy, xw, xh;
+
+       xx = Xx(x, y, t);
+       xy = Xy(x, y, t);
+       xw = Xwidth(width, height, t);
+       xh = Xheight(width, height, t);
+       if (xw < 0) {
+               xx += xw;
+               xw = -xw;
+       }
+       if (xh < 0) {
+               xy += xh;
+               xh = -xh;
+       }
+       XFillArc(dpy, d, gc, xx, xy, xw, xh, angle1, angle2);
+
+       if (rect != NULL) {
+               rect->x = xx;
+               rect->y = xy;
+               rect->width = xw;
+               rect->height = xh;
+       }
+}
+
+
+/*-
+ *    Set a tranform matrix from the given arguments.  Lifted from xeyes.
+ */
+
+static void
+SetTransform(Transform * t, int xx1, int xx2, int xy1, int xy2, double tx1, double tx2, double ty1, double ty2)
+{
+       t->mx = ((double) xx2 - xx1) / (tx2 - tx1);
+       t->bx = ((double) xx1) - t->mx * tx1;
+       t->my = ((double) xy2 - xy1) / (ty2 - ty1);
+       t->by = ((double) xy1) - t->my * ty1;
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Given two rectangles, return the rectangle which encloses both.
+ *      Used to clculate "damage" when the pupil moves, to minimize the
+ *      number of pixels which must be copied out to the screen.
+ */
+
+static void
+join_rects(XRectangle * r1, XRectangle * r2, XRectangle * ret)
+{
+       XRectangle  tmp;
+       int         n1, n2;
+
+       /* find min x and min y */
+       tmp.x = (r1->x <= r2->x) ? r1->x : r2->x;
+       tmp.y = (r1->y <= r2->y) ? r1->y : r2->y;
+       /* find max x, plus one (just past the right side) */
+       n1 = r1->x + r1->width;
+       n2 = r2->x + r2->width;
+       /* compute width, relative to min x (left side) */
+       tmp.width = ((n1 > n2) ? n1 : n2) - tmp.x;
+       /* same for y */
+       n1 = r1->y + r1->height;
+       n2 = r2->y + r2->height;
+       tmp.height = ((n1 > n2) ? n1 : n2) - tmp.y;
+       *ret = tmp;             /* copy out result rectangle */
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Do the math to figure out where the pupil should be drawn.
+ *      This code lifted intact from the xeyes widget.
+ */
+
+#if defined( SVR4 ) || defined( SYSV ) && defined( SYSV386 )
+extern double hypot(double, double);
+
+#endif
+
+static  void
+computePupil(int num, TPoint mouse, TPoint *ret)
+{
+       double      cx, cy;
+       double      dist;
+       double      angle;
+       double      x, y;
+       double      h;
+       double      dx, dy;
+       double      cosa, sina;
+
+       dx = mouse.x - EYE_X(num);
+       dy = mouse.y - EYE_Y(num);
+       if (dx == 0 && dy == 0) {
+               cx = EYE_X(num);
+               cy = EYE_Y(num);
+       } else {
+               /* Avoid atan2: DOMAIN error message */
+               if (dx == 0.0 && dy == 0.0)
+                       angle = 0.0;
+               else
+                       angle = atan2((double) dy, (double) dx);
+               cosa = cos(angle);
+               sina = sin(angle);
+               h = hypot(EYE_HHEIGHT * cosa, EYE_HWIDTH * sina);
+               x = (EYE_HWIDTH * EYE_HHEIGHT) * cosa / h;
+               y = (EYE_HWIDTH * EYE_HHEIGHT) * sina / h;
+               dist = BALL_DIST * hypot(x, y);
+               if (dist > hypot((double) dx, (double) dy)) {
+                       cx = dx + EYE_X(num);
+                       cy = dy + EYE_Y(num);
+               } else {
+                       cx = dist * cosa + EYE_X(num);
+                       cy = dist * sina + EYE_Y(num);
+               }
+       }
+       (*ret).x = cx;
+       (*ret).y = cy;
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Create the eye image, using the data in the structure pointed
+ *      to by "e", in the Drawable "d".  The "full" flag indicates
+ *      whether to create the full eye image, or to just paint the
+ *      pupil in a new position.
+ */
+
+static void
+make_eye(ModeInfo * mi, Drawable d, Eyes * e, int n, int full)
+{
+       EyeScrInfo *ep = &eye_info[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = ep->eyeGC;
+       XRectangle *bbox = &e->bbox;
+       XRectangle  tmp1, tmp2;
+
+       if (full) {
+               /* draw the outer (eyelid) oval */
+               XSetForeground(display, gc, e->eyelid_pixel);
+               TFillArc(display, d, gc, &e->transform,
+                        EYE_X(n) - EYE_HWIDTH - EYE_THICK,
+                        EYE_Y(n) - EYE_HHEIGHT - EYE_THICK,
+                        EYE_WIDTH + EYE_THICK * 2.0,
+                        EYE_HEIGHT + EYE_THICK * 2.0,
+                        90 * 64, 360 * 64, &tmp1);
+
+               /* draw the inner (eyeball) oval */
+               XSetForeground(display, gc, e->eyeball_pixel);
+               TFillArc(display, d, gc, &e->transform,
+                        EYE_X(n) - EYE_HWIDTH, EYE_Y(n) - EYE_HHEIGHT,
+                        EYE_WIDTH, EYE_HEIGHT, 90 * 64, 360 * 64, &tmp2);
+
+               join_rects(&tmp1, &tmp2, &tmp1);
+
+               /* draw the pupil on top of the eyeball oval */
+               XSetForeground(display, gc, e->pupil_pixel);
+               TFillArc(display, d, gc, &e->transform,
+                        e->pupil[n].x - BALL_WIDTH / 2.0,
+                        e->pupil[n].y - BALL_HEIGHT / 2.0,
+                        BALL_WIDTH, BALL_HEIGHT, 90 * 64, 360 * 64, &tmp2);
+
+               join_rects(&tmp1, &tmp2, bbox);
+       } else {
+               /* undraw the pupil */
+               XSetForeground(display, gc, e->eyeball_pixel);
+               TFillArc(display, d, gc, &e->transform,
+                        e->last_pupil[n].x - BALL_WIDTH / 2.0,
+                        e->last_pupil[n].y - BALL_HEIGHT / 2.0,
+                        BALL_WIDTH, BALL_HEIGHT, 90 * 64, 360 * 64, &tmp1);
+
+               /* draw the pupil on top of the eyeball oval */
+               XSetForeground(display, gc, e->pupil_pixel);
+               TFillArc(display, d, gc, &e->transform,
+                        e->pupil[n].x - BALL_WIDTH / 2.0,
+                        e->pupil[n].y - BALL_HEIGHT / 2.0,
+                        BALL_WIDTH, BALL_HEIGHT, 90 * 64, 360 * 64, &tmp2);
+
+               join_rects(&tmp1, &tmp2, bbox);
+       }
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Check to see if the flyer touches this pair of eyes.
+ */
+
+static      Bool
+fly_touches(Fly * f, Eyes * e, int old)
+{
+       int         x = (old) ? f->oldx : f->x;
+       int         y = (old) ? f->oldy : f->y;
+
+       if ((x + f->width) <= e->x)
+               return (False);
+       if (x >= (e->x + e->width))
+               return (False);
+       if ((y + f->height) <= e->y)
+               return (False);
+       if (y >= (e->y + e->height))
+               return (False);
+       return (True);
+}
+
+static      Bool
+fly_touches_eye(Fly * f, Eyes * e)
+{
+       if (fly_touches(f, e, True) || fly_touches(f, e, False)) {
+               return (True);
+       }
+       return (False);
+}
+
+/*-
+ *    Check to see if two pairs of eyes overlap.
+ */
+
+static      Bool
+eyes_overlap(Eyes * e1, Eyes * e2)
+{
+       if ((e1->x + e1->width) < e2->x)
+               return (False);
+       if (e1->x >= (e2->x + e2->width))
+               return (False);
+       if ((e1->y + e1->height) < e2->y)
+               return (False);
+       if (e1->y >= (e2->y + e2->height))
+               return (False);
+       return (True);
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Initialize the flyer.  Called when the window changes, and
+ *      whenever she bounces off the screen.
+ *      In the first version, the eyes followed a "fly", which was
+ *      just a flickering spot that moved at random.  That didn't
+ *      work so well.  It was replaced with a bouncing gelb, but the
+ *      name "fly" has yet to be purged.
+ */
+
+static void
+init_fly(ModeInfo * mi, Fly * f)
+{
+       EyeScrInfo *ep = &eye_info[MI_SCREEN(mi)];
+       int         win_width = MI_WIDTH(mi);
+       int         win_height = MI_HEIGHT(mi);
+
+       (void) memset((char *) f, 0, sizeof (Fly));     /* clear everything to zero */
+
+       f->side = FLY_SIDE_LEFT;
+
+       if (MI_IS_ICONIC(mi)) {
+               /* image is just a dot when iconic */
+               f->width = f->height = FLY_ICON_SIZE;
+               f->vx = NRAND(4) + 1;   /* slower when iconic */
+       } else {
+               f->width = ep->flywidth;
+               f->height = ep->flyheight;
+               f->vx = NRAND(15) + 1;  /* random horiz velocity */
+       }
+
+       f->y = NRAND(win_height);
+       if (f->y > (win_height / 2)) {
+               f->side = FLY_SIDE_RIGHT;       /* change to right side */
+               f->y -= win_height / 2;         /* start in top half */
+               f->x = win_width - f->width;    /* move to right of screen */
+               f->vx = -(f->vx);       /* flip direction */
+       }
+       f->oldx = -(f->width);  /* prevent undraw 1st time */
+
+       if (MI_NPIXELS(mi) <= 2) {
+               f->pixel = MI_WHITE_PIXEL(mi);  /* always white when mono */
+       } else {
+               f->pixel = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       }
+}
+
+/*-
+ *    Unpaint the flyer by painting the image in black.
+ */
+
+static void
+unpaint_fly(ModeInfo * mi, Fly * f)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+
+       if (MI_IS_ICONIC(mi)) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillArc(display, window, gc, f->oldx, f->oldy,
+                        f->width, f->height, 90 * 64, 360 * 64);
+       } else {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+#ifdef FLASH
+               XFillRectangle(display, window, gc,
+                              f->oldx, f->oldy, f->width, f->height);
+#else
+               ERASE_IMAGE(display, window, gc, f->x, f->y,
+                           f->oldx, f->oldy, f->width, f->height);
+#endif
+       }
+}
+
+/*-
+ *    Paint the bouncing grelb on the screen.  If not in iconic
+ *      mode, unpaint the previous image.  When iconic, the fly
+ *      doesn't need to be undrawn, because it will always be on top
+ *      of the eyes, which are repainted before the fly is painted.
+ */
+
+static void
+paint_fly(ModeInfo * mi, Fly * f)
+{
+       EyeScrInfo *ep = &eye_info[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         x = f->x, y = f->y;
+
+       if (MI_IS_ICONIC(mi)) {
+               /* don't need to unpaint when iconic
+                * ep->flyGC has stipple set, don't use when iconic
+                */
+               XSetForeground(display, MI_GC(mi), f->pixel);
+               XFillArc(display, window, MI_GC(mi), x, y,
+                        f->width, f->height, 90 * 64, 360 * 64);
+       } else {
+               unpaint_fly(mi, f);
+               XSetForeground(display, ep->flyGC, f->pixel);
+#ifdef XBM_GRELB
+               if (ep->fly2pix != None) {
+                       XSetStipple(display, ep->flyGC, (f->vy <= 0) ? ep->flypix : ep->fly2pix);
+               } else
+#endif
+                       XSetStipple(display, ep->flyGC, ep->flypix);
+               XSetTSOrigin(display, ep->flyGC, x, y);
+#ifdef FLASH
+               XSetFillStyle(display, ep->flyGC, FillStippled);
+#else
+               XSetFillStyle(display, ep->flyGC, FillOpaqueStippled);
+#endif
+               XFillRectangle(display, window, ep->flyGC,
+                              x, y, f->width, f->height);
+               XFlush(display);
+       }
+}
+
+/*-
+ *    Compute the new position of the fly.  The bouncy-boinginess
+ *      algorithm is borrowed from the "bounce" (soccer ball) mode.
+ */
+
+static void
+move_fly(ModeInfo * mi, Fly * f)
+{
+       int         win_width = MI_WIDTH(mi);
+       int         win_height = MI_HEIGHT(mi);
+       int         left = (f->side == FLY_SIDE_LEFT) ? -(f->width) : 0;
+       int         right = (f->side == FLY_SIDE_RIGHT) ? win_width :
+       win_width - f->width;
+       Bool        track_p = trackmouse;
+       int         cx, cy;
+
+
+       f->oldx = f->x;         /* remember position before moving, */
+       f->oldy = f->y;         /* for unpainting previous image */
+
+       if (track_p) {
+               Window      r, c;
+               int         rx, ry;
+               unsigned int m;
+
+               (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
+                                    &r, &c, &rx, &ry, &cx, &cy, &m);
+               if (cx <= 0 || cy <= 0 ||
+                   cx >= MI_WIDTH(mi) - f->width - 1 ||
+                   cy >= MI_HEIGHT(mi) - f->width - 1) {
+                       track_p = False;
+               }
+       }
+       if (track_p) {
+               f->x = cx;
+               f->y = cy;
+               return;
+       }
+       f->x += f->vx;          /* apply x velocity */
+
+       if (f->x > right) {
+               if (f->side == FLY_SIDE_RIGHT) {
+                       unpaint_fly(mi, f);     /* went off the edge, reset */
+                       init_fly(mi, f);
+               } else {
+                       /* Bounce off the right edge */
+                       f->x = 2 * (win_width - f->width) - f->x;
+                       f->vx = -f->vx + f->vx / FRICTION;
+               }
+       } else if (f->x < left) {
+               if (f->side == FLY_SIDE_LEFT) {
+                       unpaint_fly(mi, f);     /* went off the edge, reset */
+                       init_fly(mi, f);
+               } else {
+                       /* Bounce off the left edge */
+                       f->x = -f->x;
+                       f->vx = -f->vx + f->vx / FRICTION;
+               }
+       }
+       f->vy++;                /* gravity, accelerate in y direction */
+       f->y += f->vy;          /* apply y velocity */
+
+       if (f->y >= (win_height - f->height)) {
+               /* Bounce off the bottom edge */
+               f->y = (win_height - f->height);
+               f->vy = -f->vy + f->vy / FRICTION;
+               /* every once in a while, go apeshit to clean "high lurkers" */
+               if (NRAND(50) == 0) {
+                       f->vy *= 4;
+               }
+       } else if (f->y < 0) {
+               /* Bounce off the top edge */
+               f->y = -f->y;
+               f->vy = -f->vy + f->vy / FRICTION;
+       }
+       /* if he settles to the bottom, move him off quick */
+       if (abs(f->vy) < 2) {
+               if ((f->zero_y++) > 10) {
+                       f->vx += (f->side == FLY_SIDE_LEFT) ? -1 : 1;
+               }
+       } else {
+               f->zero_y = 0;  /* still bouncing */
+       }
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Initialize one pair of eyes
+ */
+
+static void
+create_eyes(ModeInfo * mi, Eyes * e, Eyes * eyes, int num_eyes)
+{
+       EyeScrInfo *ep = &eye_info[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         win_width = MI_WIDTH(mi);
+       int         win_height = MI_HEIGHT(mi);
+       unsigned long black_pixel = MI_BLACK_PIXEL(mi);
+       unsigned long white_pixel = MI_WHITE_PIXEL(mi);
+       Bool        iconic = MI_IS_ICONIC(mi);
+       Pixmap      pix = e->pixmap;    /* preserve pixmap handle */
+       int         w = e->width;       /* remember last w/h */
+       int         h = e->height;
+       int         npixels = MI_NPIXELS(mi);   /* num colors in colormap */
+       int         cycs = MI_CYCLES(mi);       /* affects eye lifetime */
+       int         maxw = win_width / 2;       /* widest eyes can be */
+       int         color, lid_color;
+       int         i;
+
+       (void) memset((char *) e, 0, sizeof (Eyes));    /* wipe everything */
+       e->pixmap = pix;        /* remember Pixmap handle */
+
+       /* sanity check the cycles value */
+       if (cycs < 1)
+               cycs = 1;
+       if (cycs > MAX_CYCLES)
+               cycs = MAX_CYCLES;
+       e->time_to_die = (unsigned long) LIFE_MIN + NRAND(LIFE_RANGE);
+       e->time_to_die *= (unsigned long) cycs;         /* multiply life by cycles */
+       e->time_to_die += ep->time;
+
+       e->pupil_pixel = black_pixel;   /* pupil is always black */
+
+       if (MI_NPIXELS(mi) <= 2) {
+               /* TODO: stipple the eyelid? */
+               e->eyelid_pixel = black_pixel;
+               e->eyeball_pixel = white_pixel;
+       } else {
+               lid_color = NRAND(npixels);
+               e->eyelid_pixel = MI_PIXEL(mi, lid_color);
+
+               while ((color = NRAND(npixels + 5)) == lid_color) {
+                       /* empty */
+               }
+               if (color >= npixels) {
+                       /* give white a little better chance */
+                       e->eyeball_pixel = white_pixel;
+               } else {
+                       e->eyeball_pixel = MI_PIXEL(mi, color);
+               }
+       }
+
+       if (iconic) {
+               /* only one pair of eyes, fills entire window */
+               e->width = win_width;
+               e->height = win_height;
+       } else {
+               if (maxw - MIN_EYE_SIZE > MIN_EYE_SIZE)
+                       e->width = NRAND(maxw - MIN_EYE_SIZE) + MIN_EYE_SIZE;
+               else
+                       e->width = NRAND(MIN_EYE_SIZE) + MIN_EYE_SIZE;
+               e->x = (win_width - e->width > 0) ? NRAND(win_width - e->width) : 0;
+               e->height = NRAND(e->width * 3 / 4) + (e->width / 4);
+               e->y = (win_height - e->height > 0) ? NRAND(win_height - e->height) : 0;
+
+               /* check for overlap with other eyes */
+               for (i = 0; i < num_eyes; i++) {
+                       if (&eyes[i] == e) {    /* that's me */
+                               continue;
+                       }
+                       if (eyes_overlap(e, &eyes[i])) {
+                               /* collision, force retry on next cycle */
+                               e->time_to_die = 0;
+                               break;
+                       }
+               }
+       }
+
+       /* If the Pixmap is smaller than the new size, make it bigger */
+       if ((e->width > w) || (e->height > h)) {
+               if (e->pixmap != None) {
+                       XFreePixmap(display, e->pixmap);
+               }
+               if ((e->pixmap = XCreatePixmap(display, window,
+                                         e->width, e->height, MI_DEPTH(mi))) == None) {
+                       e->width = e->height = 0;
+                       return;
+               }
+       }
+       /* Set the transformation matrix for this set of eyes
+        * If iconic, make the eyes image one pixel shorter and
+        * skinnier, they seem to fit in the icon box better that way.
+        */
+       SetTransform(&e->transform, 0, (iconic) ? e->width - 1 : e->width,
+                    (iconic) ? e->height - 1 : e->height, 0,
+                    W_MIN_X, W_MAX_X, W_MIN_Y, W_MAX_Y);
+
+       /* clear the offscreen pixmap to background color */
+       XSetForeground(display, ep->eyeGC, black_pixel);
+       XFillRectangle(display, e->pixmap, ep->eyeGC, 0, 0, e->width, e->height);
+
+       /* make the full eye images in the offscreen Pixmap */
+       make_eye(mi, e->pixmap, e, 0, True);
+       make_eye(mi, e->pixmap, e, 1, True);
+}
+
+
+/*-
+ *    Paint an eye pair onto the screen.
+ *      This is normally only the change rectangles for each pupil,
+ *      unless in iconic mode, which always repaints the full image.
+ */
+
+static void
+paint_eyes(ModeInfo * mi, Eyes * e, Fly * f, Eyes * eyes, int num_eyes)
+{
+       EyeScrInfo *ep = &eye_info[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = ep->eyeGC;
+       Bool        iconic = MI_IS_ICONIC(mi);
+       int         focusx = (f->x + (f->width / 2)) - e->x;
+       int         focusy = (f->y + (f->height / 2)) - e->y;
+       Pixmap      pix = e->pixmap;
+       TPoint      point;
+       int         i;
+
+       if (pix == None) {
+               e->time_to_die = 0;     /* "should not happen" */
+       }
+       if (ep->time >= e->time_to_die) {
+               /* Sorry Bud, your time is up */
+               if (e->painted) {
+                       /* only unpaint it if previously painted */
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                       XFillRectangle(display, window, gc, e->x, e->y, e->width, e->height);
+               }
+               /* randomly place the eyes elsewhere */
+               create_eyes(mi, e, eyes, num_eyes);
+               pix = e->pixmap;        /* pixmap may have changed */
+       }
+       /* If the bouncer would intersect this pair of eyes, force the
+        * eyes to move.  This simplifies the code, because we do not
+        * have to deal with drawing the bouncer on top of the eyes.
+        * When trying to do so, there was too much annoying flashing
+        * and ghost images from the undraw.  I decided to observe the
+        * KISS principle and keep it simple.  I think the effect is
+        * better also.
+        * We must draw the flyer on the eyes when iconic, but that is
+        * easy because the eyes repaint the whole box each time.
+        */
+       if ((!iconic) && (fly_touches_eye(f, e))) {
+               e->time_to_die = 0;
+       }
+       if (e->time_to_die == 0) {
+               return;         /* collides with something */
+       }
+       /* set the point to look at and compute the pupil position  */
+       point.x = Tx(focusx, focusy, &e->transform);
+       point.y = Ty(focusx, focusy, &e->transform);
+       computePupil(0, point, &(e->pupil[0]));
+       computePupil(1, point, &(e->pupil[1]));
+
+       if (e->painted) {
+               /* if still looking at the same point, do nothing further */
+               if (TPointEqual(e->pupil[0], e->last_pupil[0]) &&
+                   TPointEqual(e->pupil[1], e->last_pupil[1])) {
+                       return;
+               }
+       }
+       for (i = 0; i < 2; i++) {
+               /* update the eye, calculates the changed rectangle */
+               make_eye(mi, pix, e, i, False);
+
+               /* Only blit the change if the full image has been painted */
+               if (e->painted) {
+                       /* copy the changed rectangle out to the screen */
+                       XCopyArea(display, pix, window, gc,
+                                 e->bbox.x, e->bbox.y,
+                                 (int) e->bbox.width, (int) e->bbox.height,
+                                 e->x + e->bbox.x, e->y + e->bbox.y);
+               }
+               /* remember where we're looking, for the next time around */
+               e->last_pupil[i] = e->pupil[i];
+       }
+
+       /* always do full paint when iconic, eliminates need to track fly */
+       if (iconic || (!e->painted)) {
+               XCopyArea(display, pix, window, gc, 0, 0,
+                         e->width, e->height, e->x, e->y);
+       }
+       /* when iconic, pretend to never paint, causes full paint each time */
+       if (!iconic) {
+               e->painted++;   /* note that a paint has been done */
+       }
+}
+
+/* ---------------------------------------------------------------------- */
+
+
+static void
+freePairsOfEyes(Display * display, EyeScrInfo * ep)
+{
+       int         en;
+
+       if (ep->eyes) {
+               for (en = 0; en < ep->num_eyes; en++)
+                       if (ep->eyes[en].pixmap != None)
+                               XFreePixmap(display, ep->eyes[en].pixmap);
+               (void) free((void *) ep->eyes);
+               ep->eyes = NULL;
+       }
+}
+
+static void
+free_eyes(Display * display, EyeScrInfo * ep)
+{
+       if (ep->flyGC != None) {
+               XFreeGC(display, ep->flyGC);
+               ep->flyGC = None;
+       }
+       if (ep->eyeGC != None) {
+               XFreeGC(display, ep->eyeGC);
+               ep->eyeGC = None;
+       }
+       if (ep->flypix != None) {
+               XFreePixmap(display, ep->flypix);
+               ep->flypix = None;
+       }
+#ifdef XBM_GRELB
+       if (ep->fly2pix != None) {
+               XFreePixmap(display, ep->fly2pix);
+               ep->fly2pix = None;
+       }
+#endif
+       freePairsOfEyes(display, ep);
+       if (ep->cursor != None) {
+               XFreeCursor(display, ep->cursor);
+               ep->cursor = None;
+       }
+}
+
+/*-
+ *    Initialize them eyes.  Called each time the window changes.
+ */
+
+void
+init_eyes(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       EyeScrInfo *ep;
+       int         i;
+
+        /*-
+         *    Initialization that only needs to be done once.  If the
+         *      release hook is called, this stuff may be freed and this
+         *      function will have to allocate it again next time the
+         *      init hook is called.
+         */
+       if (eye_info == NULL) {
+               if ((eye_info = (EyeScrInfo *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (EyeScrInfo))) == NULL)
+                       return;
+       }
+       ep = &eye_info[MI_SCREEN(mi)];
+
+       if (ep->flypix == None) {
+               getPixmap(mi, window, FLY_WIDTH, FLY_HEIGHT, FLY_BITS,
+                         &(ep->flywidth), &(ep->flyheight), &(ep->flypix),
+                         &(ep->graphics_format));
+               if (ep->flypix == None) {
+                       free_eyes(display, ep);
+                       return;
+               }
+#ifdef XBM_GRELB
+               if (ep->graphics_format == IS_XBM) {
+                       ep->graphics_format =0;
+                       getPixmap(mi, window,
+                         FLY2_WIDTH, FLY2_HEIGHT, FLY2_BITS,
+                         &(ep->fly2width), &(ep->fly2height), &(ep->fly2pix),
+                         &(ep->graphics_format));
+                       if (ep->fly2pix == None) {
+                               free_eyes(display, ep);
+                               return;
+                       }
+               }
+#endif
+       }
+       if (ep->flyGC == None) {
+               XGCValues   gcv;
+
+               gcv.foreground = MI_BLACK_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((ep->flyGC = XCreateGC(display, window,
+                                GCForeground | GCBackground, &gcv)) == None) {
+                       free_eyes(display, ep);
+                       return;
+               }
+       }
+       if (ep->eyeGC == None) {
+               if ((ep->eyeGC = XCreateGC(display, window,
+                          (unsigned long) 0, (XGCValues *) NULL)) == None) {
+                       free_eyes(display, ep);
+                       return;
+               }
+       }
+       ep->time = 0;
+       /* don't want any exposure events from XCopyArea */
+       XSetGraphicsExposures(display, ep->eyeGC, False);
+
+       freePairsOfEyes(display, ep);
+       if (MI_IS_ICONIC(mi))
+               ep->num_eyes = 1;
+       else {
+               ep->num_eyes = MI_COUNT(mi);
+               /* MAX_EYES is used or one may quickly run out of memory */
+               if (ep->num_eyes > MAX_EYES)
+                       ep->num_eyes = MAX_EYES;
+               if (ep->num_eyes < 0) {
+                       if (ep->num_eyes < -MAX_EYES)
+                               ep->num_eyes = NRAND(MAX_EYES) + 1;
+                       else
+                               ep->num_eyes = NRAND(-ep->num_eyes) + 1;        /* Add 1 so its not too boring */
+               }
+       }
+       if (!ep->eyes) {
+               if ((ep->eyes = (Eyes *) calloc(ep->num_eyes, sizeof (Eyes))) == NULL) {
+                       free_eyes(display, ep);
+                       return;
+               }
+       }
+
+       for (i = 0; i < ep->num_eyes; i++) {    /* place each eye pair */
+               /* don't assume None == 0 */
+               ep->eyes[i].pixmap = None;
+               create_eyes(mi, &(ep->eyes[i]), ep->eyes, ep->num_eyes);
+       }
+
+       init_fly(mi, &(ep->fly));       /* init the bouncer */
+
+       if (trackmouse && !ep->cursor) {        /* Create an invisible cursor */
+               Pixmap      bit;
+               XColor      black;
+
+               black.red = 0;
+               black.green = 0;
+               black.blue = 0;
+               black.flags = DoRed | DoGreen | DoBlue;
+               if ((bit = XCreatePixmapFromBitmapData(display, window,
+                               (char *) "\000", 1, 1, MI_BLACK_PIXEL(mi),
+                               MI_BLACK_PIXEL(mi), 1)) == None) {
+                       free_eyes(display, ep);
+                       return;
+               }
+               if ((ep->cursor = XCreatePixmapCursor(display, bit, bit,
+                               &black, &black, 0, 0)) == None) {
+                       free_eyes(display, ep);
+                       return;
+               }
+               XFreePixmap(display, bit);
+       }
+       XDefineCursor(display, window, ep->cursor);
+
+       MI_CLEARWINDOW(mi);
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Called by the mainline code periodically to update the display.
+ */
+
+void
+draw_eyes(ModeInfo * mi)
+{
+       int         i;
+       EyeScrInfo *ep;
+
+       if (eye_info == NULL)
+               return;
+       ep = &eye_info[MI_SCREEN(mi)];
+       if (ep->flypix == None)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       move_fly(mi, &(ep->fly));
+       ep->time++;
+       for (i = 0; i < ep->num_eyes; i++) {
+               paint_eyes(mi, &(ep->eyes[i]), &(ep->fly), ep->eyes, ep->num_eyes);
+       }
+
+       paint_fly(mi, &(ep->fly));
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    The display is being taken away from us.  Free up malloc'ed
+ *      memory and X resources that we've alloc'ed.  Only called
+ *      once, we must zap everything for every screen.
+ */
+
+void
+release_eyes(ModeInfo * mi)
+{
+       if (eye_info != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_eyes(MI_DISPLAY(mi), &eye_info[screen]);
+               (void) free((void *) eye_info);
+       }
+       eye_info = NULL;
+}
+
+/* ---------------------------------------------------------------------- */
+
+/*-
+ *    Called when the mainline xlock code notices possible window
+ *      damage.  This hook should take steps to repaint the entire
+ *      window (no specific damage area information is provided).
+ */
+
+void
+refresh_eyes(ModeInfo * mi)
+{
+       int         i;
+       EyeScrInfo *ep;
+
+       if (eye_info == NULL)
+               return;
+       ep = &eye_info[MI_SCREEN(mi)];
+       if (ep->eyeGC == None)
+               return;
+
+       MI_CLEARWINDOW(mi);
+
+       /* simply flag all the eyes as not painted, will repaint next time */
+       for (i = 0; i < ep->num_eyes; i++) {
+               ep->eyes[i].painted = False;
+       }
+}
+
+#endif /* MODE_eyes */
diff --git a/modes/fadeplot.c b/modes/fadeplot.c
new file mode 100644 (file)
index 0000000..026ae0b
--- /dev/null
@@ -0,0 +1,235 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* fadeplot --- a fading plot of sine squared */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)fadeplot.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Some easy plotting stuff, by Bas van Gaalen, Holland, PD
+ *
+ * Copyright (c) 1996 by Charles Vidal
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with screensaver
+ * 1996: Written by Charles Vidal based on work by Bas van Gaalen
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Fadeplot"
+#define HACK_INIT init_fadeplot
+#define HACK_DRAW draw_fadeplot
+#define fadeplot_opts xlockmore_opts
+#define DEFAULTS "*delay: 30000 \n" \
+ "*count: 10 \n" \
+ "*cycles: 1500 \n" \
+ "*ncolors: 64 \n"
+#define BRIGHT_COLORS
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_fadeplot
+
+ModeSpecOpt fadeplot_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   fadeplot_description =
+{"fadeplot", "init_fadeplot", "draw_fadeplot", "release_fadeplot",
+ "refresh_fadeplot", "init_fadeplot", NULL, &fadeplot_opts,
+ 30000, 10, 1500, 1, 64, 0.6, "",
+ "Shows a fading plot of sine squared", 0, NULL};
+
+#endif
+
+#define MINSTEPS 1
+
+typedef struct {
+       XPoint      speed, step, factor, st;
+       int         temps, maxpts, nbstep;
+       int         min;
+       int         width, height;
+       int         pix;
+       int         angles;
+       int        *stab;
+       XPoint     *pts;
+} fadeplotstruct;
+
+static fadeplotstruct *fadeplots = NULL;
+
+static void
+free_fadeplot(fadeplotstruct *fp)
+{
+       if (fp->pts != NULL) {
+               (void) free((void *) fp->pts);
+               fp->pts = NULL;
+       }
+       if (fp->stab != NULL) {
+               (void) free((void *) fp->stab);
+               fp->stab = NULL;
+       }
+}
+
+static Bool
+initSintab(ModeInfo * mi)
+{
+       fadeplotstruct *fp = &fadeplots[MI_SCREEN(mi)];
+       int         i;
+       float       x;
+
+       fp->angles = NRAND(950) + 250;
+       if ((fp->stab = (int *) malloc(fp->angles * sizeof (int))) == NULL) {
+               free_fadeplot(fp);
+               return False;
+       }
+       for (i = 0; i < fp->angles; i++) {
+               x = SINF(2.0 * M_PI * i / fp->angles);
+               fp->stab[i] = (int) (x * ABS(x) * fp->min) + fp->min;
+       }
+       return True;
+}
+
+void
+init_fadeplot(ModeInfo * mi)
+{
+       fadeplotstruct *fp;
+
+       if (fadeplots == NULL) {
+               if ((fadeplots = (fadeplotstruct *) calloc(MI_NUM_SCREENS(mi),
+                                          sizeof (fadeplotstruct))) == NULL)
+                       return;
+       }
+       fp = &fadeplots[MI_SCREEN(mi)];
+
+       fp->width = MI_WIDTH(mi);
+       fp->height = MI_HEIGHT(mi);
+       fp->min = MAX(MIN(fp->width, fp->height) / 2, 1);
+
+       fp->speed.x = 8;
+       fp->speed.y = 10;
+       fp->step.x = 1;
+       fp->step.y = 1;
+       fp->temps = 0;
+       fp->factor.x = MAX(fp->width / (2 * fp->min), 1);
+       fp->factor.y = MAX(fp->height / (2 * fp->min), 1);
+
+       fp->nbstep = MI_COUNT(mi);
+       if (fp->nbstep < -MINSTEPS) {
+               fp->nbstep = NRAND(-fp->nbstep - MINSTEPS + 1) + MINSTEPS;
+       } else if (fp->nbstep < MINSTEPS)
+               fp->nbstep = MINSTEPS;
+
+       fp->maxpts = MI_CYCLES(mi);
+       if (fp->maxpts < 1)
+               fp->maxpts = 1;
+
+       if (fp->pts == NULL) {
+               if ((fp->pts = (XPoint *) calloc(fp->maxpts, sizeof (XPoint))) ==
+                                NULL) {
+                       free_fadeplot(fp);
+                       return;
+               }
+       }
+       if (MI_NPIXELS(mi) > 2)
+               fp->pix = NRAND(MI_NPIXELS(mi));
+
+       if (fp->stab != NULL)
+               (void) free((void *) fp->stab);
+       if (!initSintab(mi))
+               return;
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_fadeplot(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         i, j, temp;
+       fadeplotstruct *fp;
+
+       if (fadeplots == NULL)
+               return;
+       fp = &fadeplots[MI_SCREEN(mi)];
+       if (fp->stab == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       XDrawPoints(display, window, gc, fp->pts, fp->maxpts, CoordModeOrigin);
+
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, fp->pix));
+               if (++fp->pix >= MI_NPIXELS(mi))
+                       fp->pix = 0;
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       temp = 0;
+       for (j = 0; j < fp->nbstep; j++) {
+               for (i = 0; i < fp->maxpts / fp->nbstep; i++) {
+                       fp->pts[temp].x =
+                               fp->stab[(fp->st.x + fp->speed.x * j + i * fp->step.x) % fp->angles] *
+                               fp->factor.x + fp->width / 2 - fp->min;
+                       fp->pts[temp].y =
+                               fp->stab[(fp->st.y + fp->speed.y * j + i * fp->step.y) % fp->angles] *
+                               fp->factor.y + fp->height / 2 - fp->min;
+                       temp++;
+               }
+       }
+       XDrawPoints(display, window, gc, fp->pts, temp, CoordModeOrigin);
+       XFlush(display);
+       fp->st.x = (fp->st.x + fp->speed.x) % fp->angles;
+       fp->st.y = (fp->st.y + fp->speed.y) % fp->angles;
+       fp->temps++;
+       if ((fp->temps % (fp->angles / 2)) == 0) {
+               fp->temps = fp->temps % fp->angles * 5;
+               if ((fp->temps % (fp->angles)) == 0)
+                       fp->speed.y = (fp->speed.y++) % 30 + 1;
+               if ((fp->temps % (fp->angles * 2)) == 0)
+                       fp->speed.x = (fp->speed.x) % 20;
+               if ((fp->temps % (fp->angles * 3)) == 0)
+                       fp->step.y = (fp->step.y++) % 2 + 1;
+
+               MI_CLEARWINDOW(mi);
+       }
+}
+void
+refresh_fadeplot(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+void
+release_fadeplot(ModeInfo * mi)
+{
+       if (fadeplots != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_fadeplot(&fadeplots[screen]);
+               (void) free((void *) fadeplots);
+               fadeplots = NULL;
+       }
+}
+
+#endif /* MODE_fadeplot */
diff --git a/modes/flag.c b/modes/flag.c
new file mode 100644 (file)
index 0000000..aee57e9
--- /dev/null
@@ -0,0 +1,656 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* flag --- a waving flag image */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)flag.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Charles Vidal <vidalc@club-internet.fr>
+ *         http://www.chez.com/vidalc
+ *
+ * Thanks to Bas van Gaalen, Holland, PD, for his Pascal source
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks.
+ * 24-Oct-1997: xpm and ras capability added.
+ * 13-May-1997: jwz@jwz.org: turned into a standalone program.
+ *              Made it able to animate arbitrary (runtime) text or bitmaps
+ * 15-May-1996: written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Flag"
+#define HACK_INIT init_flag
+#define HACK_DRAW draw_flag
+#define flag_opts xlockmore_opts
+#define DEFAULTS "*delay: 50000 \n" \
+ "*cycles: 1000 \n" \
+ "*size: -7 \n" \
+ "*ncolors: 200 \n" \
+ "*bitmap: \n" \
+ "*font: \n" \
+ "*text: \n" \
+ "*fullrandom: True \n"
+#define BRIGHT_COLORS
+#define UNIFORM_COLORS
+#define DEF_FONT "-*-helvetica-bold-r-*-240-*"
+#define DEF_TEXT ""
+#include "xlockmore.h"         /* in xscreensaver distribution */
+
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+
+/* This makes me laugh :) */
+#ifdef JWZ
+/*-
+ * 22-Jan-98: jwz: made the flag wigglier; added xpm support.
+ *            (I tried to do this by re-porting from xlockmore, but the
+ *            current xlockmore version is completely inscrutable.)
+ */
+
+#ifdef HAVE_XPM
+#include <X11/xpm.h>
+#ifndef PIXEL_ALREADY_TYPEDEFED
+#define PIXEL_ALREADY_TYPEDEFED        /* Sigh, Xmu/Drawing.h needs this... */
+#endif
+#endif
+
+#ifdef HAVE_XMU
+#ifndef VMS
+#include <X11/Xmu/Drawing.h>
+#else /* VMS */
+#include <Xmu/Drawing.h>
+#endif /* VMS */
+#endif /* HAVE_XMU */
+
+#include "images/bob.xbm"
+#include <string.h>
+#include <X11/Xutil.h>
+#else
+#include "iostuff.h"
+#endif
+
+#ifdef MODE_flag
+
+#define DEF_INVERT  "False"
+
+static Bool invert;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-invert", (char *) ".flag.invert", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+invert", (char *) ".flag.invert", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & invert, (char *) "invert", (char *) "Invert", (char *) DEF_INVERT, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+invert", (char *) "turn on/off inverting of flag"}
+};
+
+ModeSpecOpt flag_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   flag_description =
+{"flag", "init_flag", "draw_flag", "release_flag",
+ "refresh_flag", "init_flag", NULL, &flag_opts,
+ 50000, 1, 1000, -7, 64, 1.0, "",
+ "Shows a waving flag image", 0, NULL};
+
+#endif
+
+/* aliases for vars defined in the bitmap file */
+#define FLAG_WIDTH   image_width
+#define FLAG_HEIGHT    image_height
+#define FLAG_BITS    image_bits
+
+#include "flag.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define FLAG_NAME  image_name
+#include "flag.xpm"
+#define DEFAULT_XPM 0
+#endif
+
+#if !defined( VMS ) || ( __VMS_VER >= 70000000 )
+#include <sys/utsname.h>
+#else
+#if USE_XVMSUTILS
+#if 0
+#include "../xvmsutils/utsname.h"
+#else
+#include <X11/utsname.h>
+#endif
+#endif /* USE_XVMSUTILS */
+#endif
+
+#define MINSIZE 1
+#define MAXSCALE 8
+#define MINSCALE 2
+#define MAXINITSIZE 6
+#define MININITSIZE 2
+#define MINAMP 5
+#define MAXAMP 10
+#define MAXW(fp) (MAXSCALE * (fp)->image->width + 2 * MAXAMP + (fp)->pointsize + 2 * (fp)->sofs)
+#define MAXH(fp) (MAXSCALE * (fp)->image->height+ 2 * MAXAMP + (fp)->pointsize + 2 * (fp)->sofs)
+#define MINW(fp) (MINSCALE * (fp)->image->width + 2 * MINAMP + (fp)->pointsize)
+#define MINH(fp) (MINSCALE * (fp)->image->height+ 2 * MINAMP + (fp)->pointsize)
+#define ANGLES         360
+#define IMAGE_FLAG 0
+#define MESSAGE_FLAG 1
+
+typedef struct {
+       int         samp;
+       int         sofs;
+       int         sidx;
+       int         x_flag, y_flag;
+       int         timer;
+       int         stab[ANGLES];
+       Pixmap      cache;
+       int         width, height;
+       int         pointsize;
+       float       size;
+       float       inctaille;
+       int         startcolor;
+       int         choice;
+       XImage     *image;
+       XImage     *logo;
+       Colormap    cmap;
+       unsigned long black;
+       int         graphics_format;
+       GC          backGC;
+} flagstruct;
+
+static XFontStruct *messagefont = None;
+
+static flagstruct *flags = NULL;
+
+extern XFontStruct *getFont(Display * display);
+
+static int
+random_num(int n)
+{
+       return ((int) (((float) LRAND() / MAXRAND) * (n + 1.0)));
+}
+
+static void
+initSintab(ModeInfo * mi)
+{
+       flagstruct *fp = &flags[MI_SCREEN(mi)];
+       int         i;
+
+  /*-
+   * change the periodicity of the sin formula : the maximum of the
+   * periocity seem to be 16 ( 2^4 ), after the drawing isn't good looking
+   */
+       int         periodicity = random_num(4);
+       int         puissance = 1;
+
+       /* for (i=0;i<periodicity;i++) puissance*=2; */
+       puissance <<= periodicity;
+       for (i = 0; i < ANGLES; i++)
+               fp->stab[i] = (int) (SINF(i * puissance * M_PI / ANGLES) * fp->samp) +
+                       fp->sofs;
+}
+
+static void
+affiche(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         x, y, xp, yp;
+       flagstruct *fp = &flags[MI_SCREEN(mi)];
+
+       for (x = 0; x < fp->image->width; x++)
+               for (y = fp->image->height - 1; y >= 0; y--) {
+                       xp = (int) (fp->size * (float) x) +
+                               fp->stab[(fp->sidx + x + y) % ANGLES];
+                       yp = (int) (fp->size * (float) y) +
+                               fp->stab[(fp->sidx + 4 * x + y + y) % ANGLES];
+                       if (MI_NPIXELS(mi) <= 2 || fp->graphics_format < IS_XPM ||
+                           fp->choice == MESSAGE_FLAG) {
+                               if (((int) !invert) ^ XGetPixel(fp->image, x, y))
+                                       XSetForeground(display, fp->backGC, fp->black);
+                               else if (MI_NPIXELS(mi) <= 2)
+                                       XSetForeground(display, fp->backGC, MI_WHITE_PIXEL(mi));
+                               else
+                                       XSetForeground(display, fp->backGC,
+                                                      MI_PIXEL(mi, (y + x + fp->sidx + fp->startcolor) %
+                                                           MI_NPIXELS(mi)));
+                       } else {
+/*
+ * PURIFY sometimes reports thousands of Array Bounds Reads and Free Memory
+ * Reads on the XGetPixel call on the next line. Appears to do this if image
+ * loaded is small.
+ */
+                               XSetForeground(display, fp->backGC, XGetPixel(fp->image, x, y));
+                       }
+                       if (fp->pointsize <= 1)
+                               XDrawPoint(display, fp->cache, fp->backGC, xp, yp);
+                       else
+#ifndef NOTHREED_EFFECT
+                               XFillRectangle(display, fp->cache, fp->backGC, xp, yp,
+                                              fp->pointsize, fp->pointsize);
+#else
+                       if (fp->pointsize < 6)
+                               XFillRectangle(display, fp->cache, fp->backGC, xp, yp,
+                                              fp->pointsize, fp->pointsize);
+                       else
+                               XFillArc(display, fp->cache, fp->backGC, xp, yp,
+                                 fp->pointsize, fp->pointsize, 0, 360 * 64);
+#endif
+               }
+}
+
+extern char *message;
+
+static Bool
+getText(ModeInfo * mi, XImage ** image)
+{
+       Display    *display = MI_DISPLAY(mi);
+       char       *text1, *text2;
+       char       *line, *token;
+       int         width, height;
+       int         lines;
+       int         margin = 2;
+       XCharStruct overall;
+       XGCValues   gcv;
+       GC          gc;
+       Pixmap      text_pixmap;
+
+
+       if (!message || !*message) {
+#if !defined( VMS ) || ( __VMS_VER >= 70000000 ) || defined( USE_XVMSUTILS )
+               struct utsname uts;
+
+               if (uname(&uts) < 0) {
+                       if ((text1 = (char *) strdup("uname() failed")) == NULL) {
+                               return False;
+                       }
+               } else {
+                       char       *s;
+
+                       if ((s = strchr(uts.nodename, '.')))
+                               *s = 0;
+                       if ((text1 = (char *) malloc(strlen(uts.nodename) +
+                                               strlen(uts.sysname) +
+                                               strlen(uts.release) + 10)) == NULL)
+                               return False;
+#ifdef AIXV3
+                       (void) sprintf(text1, "%s\n%s %s",
+                                      uts.nodename, uts.sysname, "3");
+#else
+                       (void) sprintf(text1, "%s\n%s %s",
+                                    uts.nodename, uts.sysname, uts.release);
+#endif
+               }
+#else
+               /* It says release 0 in my utsname.h */
+               if ((text1 = (char *) strdup("OpenVMS")) == NULL)
+                       return False;
+#endif
+       } else {
+               if ((text1 = (char *) strdup(message)) == NULL)
+                       return False;
+       }
+       while (*text1 && (text1[strlen(text1) - 1] == '\r' ||
+                         text1[strlen(text1) - 1] == '\n'))
+               text1[strlen(text1) - 1] = 0;
+       if ((text2 = (char *) strdup(text1)) == NULL) {
+               (void) free((void *) text1);
+               return False;
+       }
+
+
+       (void) memset(&overall, 0, sizeof (overall));
+       token = text1;
+       lines = 0;
+       while ((line = strtok(token, "\r\n"))) {
+               XCharStruct o2;
+               int         ascent, descent, direction;
+
+               token = 0;
+               (void) XTextExtents(messagefont, line, strlen(line),
+                                   &direction, &ascent, &descent, &o2);
+               overall.lbearing = MAX(overall.lbearing, o2.lbearing);
+               overall.rbearing = MAX(overall.rbearing, o2.rbearing);
+               lines++;
+       }
+
+       width = overall.lbearing + overall.rbearing + margin + margin + 1;
+       height = ((messagefont->ascent + messagefont->descent) * lines) +
+               margin + margin;
+
+       if ((text_pixmap = XCreatePixmap(display, MI_WINDOW(mi),
+                       width, height, 1)) == None) {
+               (void) free((void *) text1);
+               (void) free((void *) text2);
+               return False;
+       }
+
+       gcv.font = messagefont->fid;
+       gcv.foreground = 0;
+       gcv.background = 0;
+       if ((gc = XCreateGC(display, text_pixmap,
+                      GCFont | GCForeground | GCBackground, &gcv)) == None) {
+           XFreePixmap(display, text_pixmap);
+               (void) free((void *) text1);
+               (void) free((void *) text2);
+               return False;
+       }
+       XFillRectangle(display, text_pixmap, gc, 0, 0, width, height);
+       XSetForeground(display, gc, 1);
+
+       token = text2;
+       lines = 0;
+       while ((line = strtok(token, "\r\n"))) {
+               XCharStruct o2;
+               int         ascent, descent, direction, xoff;
+
+               token = 0;
+
+               (void) XTextExtents(messagefont, line, strlen(line),
+                                   &direction, &ascent, &descent, &o2);
+               xoff = ((overall.lbearing + overall.rbearing) -
+                       (o2.lbearing + o2.rbearing)) / 2;
+
+               (void) XDrawString(display, text_pixmap, gc,
+                                  overall.lbearing + margin + xoff,
+                                  ((messagefont->ascent * (lines + 1)) +
+                                   (messagefont->descent * lines) + margin),
+                                  line, strlen(line));
+               lines++;
+       }
+       (void) free((void *) text1);
+       (void) free((void *) text2);
+       /*XUnloadFont(display, messagefont->fid); */
+       XFreeGC(display, gc);
+
+       if ((*image = XGetImage(display, text_pixmap, 0, 0, width, height,
+                          1L, XYPixmap)) == NULL) {
+               XFreePixmap(display, text_pixmap);
+               return False;
+       }
+       XFreePixmap(display, text_pixmap);
+       return True;
+}
+
+static Bool
+init_stuff(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       flagstruct *fp = &flags[MI_SCREEN(mi)];
+
+       if (!fp->logo) {
+               getImage(mi, &fp->logo, FLAG_WIDTH, FLAG_HEIGHT, FLAG_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                        DEFAULT_XPM, FLAG_NAME,
+#endif
+                        &fp->graphics_format, &fp->cmap, &fp->black);
+               if (!fp->logo)
+                       return False;
+       }
+#ifndef STANDALONE
+       if (fp->cmap != None) {
+               setColormap(display, window, fp->cmap, MI_IS_INWINDOW(mi));
+               if (fp->backGC == None) {
+                       XGCValues   xgcv;
+
+                       xgcv.background = fp->black;
+                       if ((fp->backGC = XCreateGC(display, window, GCBackground,
+                                       &xgcv)) == None)
+                               return False;
+               }
+       } else
+#endif /* STANDALONE */
+       {
+               fp->black = MI_BLACK_PIXEL(mi);
+               fp->backGC = MI_GC(mi);
+       }
+       return True;
+}
+
+static void
+free_stuff(Display * display, flagstruct * fp)
+{
+       if (fp->cmap != None) {
+               XFreeColormap(display, fp->cmap);
+               if (fp->backGC != None) {
+                       XFreeGC(display, fp->backGC);
+                       fp->backGC = None;
+               }
+               fp->cmap = None;
+       } else
+               fp->backGC = None;
+}
+
+static void
+free_flag(Display * display, flagstruct * fp)
+{
+       if (fp->cache != None) {
+               XFreePixmap(display, fp->cache);
+               fp->cache = None;
+       }
+       if (fp->image) {
+               if (fp->choice == IMAGE_FLAG)
+                       XFree((caddr_t) fp->image); /* Do not destroy data */
+               else
+                       (void) XDestroyImage(fp->image);
+               fp->image = NULL;
+       }
+       free_stuff(display, fp);
+       if (fp->logo) {
+               destroyImage(&fp->logo, &fp->graphics_format);
+               fp->logo = NULL;
+       }
+}
+
+void
+release_flag(ModeInfo * mi)
+{
+       if (flags != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_flag(MI_DISPLAY(mi), &flags[screen]);
+               (void) free((void *) flags);
+               flags = NULL;
+       }
+       if (messagefont != None) {
+               XFreeFont(MI_DISPLAY(mi), messagefont);
+               messagefont = None;
+       }
+}
+
+void
+init_flag(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         size = MI_SIZE(mi);
+       flagstruct *fp;
+
+       if (flags == NULL) {
+               if ((flags = (flagstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (flagstruct))) == NULL)
+                       return;
+       }
+       fp = &flags[MI_SCREEN(mi)];
+
+       if (messagefont == None) {
+               if ((messagefont = getFont(display)) == None) {
+                       release_flag(mi);
+                       return;
+               }
+       }
+
+       if (!init_stuff(mi)) {
+               free_flag(display, fp);
+               return;
+       }
+
+       fp->width = MI_WIDTH(mi);
+       fp->height = MI_HEIGHT(mi);
+
+       if (fp->image) {
+               if (fp->choice == IMAGE_FLAG)
+                       XFree((caddr_t) fp->image);     /* Do not destroy data */
+               else
+                       (void) XDestroyImage(fp->image);
+               fp->image = NULL;
+       }
+       if (MI_IS_FULLRANDOM(mi) ||
+           (MI_BITMAP(mi) && *(MI_BITMAP(mi)) && message && *message) ||
+       ((!(MI_BITMAP(mi)) || !*(MI_BITMAP(mi))) && (!message || !*message)))
+               fp->choice = (int) (LRAND() & 1);
+       else if (MI_BITMAP(mi) && *(MI_BITMAP(mi)))
+               fp->choice = IMAGE_FLAG;
+       else
+               fp->choice = MESSAGE_FLAG;
+       if (fp->choice == MESSAGE_FLAG) {
+               if (!getText(mi, &fp->image)) {
+                       free_flag(display, fp);
+                       return;
+               }
+       } else {
+               int         depth = MI_DEPTH(mi);
+
+               if (depth >= 24 && depth < 32)
+                       depth = 32;
+               if (fp->graphics_format < IS_XPM)
+                       depth = 1;
+               if ((fp->image = XCreateImage(display, MI_VISUAL(mi), depth,
+                        (fp->graphics_format < IS_XPM) ? XYBitmap : ZPixmap,
+                                        0, fp->logo->data,
+                                        (fp->graphics_format == IS_RASTERFILE && (fp->logo->width & 1)) ?
+                                        fp->logo->width + 1 : fp->logo->width, fp->logo->height, 8, 0)) == None) {
+                       free_flag(display, fp);
+                       return;
+               }
+               fp->image->byte_order = LSBFirst;
+               fp->image->bitmap_bit_order = LSBFirst;
+       }
+       fp->samp = MAXAMP;      /* Amplitude */
+       fp->sofs = 20;          /* ???????? */
+       fp->pointsize = size;
+       if (size < -MINSIZE)
+               fp->pointsize = NRAND(-size - MINSIZE + 1) + MINSIZE;
+       if (fp->pointsize < MINSIZE ||
+           fp->width <= MAXW(fp) || fp->height <= MAXH(fp))
+               fp->pointsize = MINSIZE;
+       fp->size = MAXINITSIZE; /* Initial distance between pts */
+       fp->inctaille = 0.05;
+       fp->timer = 0;
+       fp->sidx = fp->x_flag = fp->y_flag = 0;
+
+       if (fp->cache) {
+               XFreePixmap(display, fp->cache);
+       }
+       if ((fp->cache = XCreatePixmap(display, MI_WINDOW(mi),
+                                       MAXW(fp), MAXH(fp), MI_DEPTH(mi))) == None) {
+               free_flag(display, fp);
+               return;
+       }
+       XSetForeground(display, fp->backGC, fp->black);
+       XSetBackground(display, fp->backGC, fp->black);
+       XFillRectangle(display, fp->cache, fp->backGC,
+                      0, 0, MAXW(fp), MAXH(fp));
+       /* don't want any exposure events from XCopyArea */
+       XSetGraphicsExposures(display, fp->backGC, False);
+       if (MI_NPIXELS(mi) > 2)
+               fp->startcolor = NRAND(MI_NPIXELS(mi));
+       if (fp->width <= MAXW(fp) || fp->height <= MAXH(fp)) {
+               fp->samp = MINAMP;
+               fp->sofs = 0;
+               fp->x_flag = random_num(fp->width - MINW(fp));
+               fp->y_flag = random_num(fp->height - MINH(fp));
+       } else {
+               fp->samp = MAXAMP;
+               fp->sofs = 20;
+               fp->x_flag = random_num(fp->width - MAXW(fp));
+               fp->y_flag = random_num(fp->height - MAXH(fp));
+       }
+
+       initSintab(mi);
+
+       MI_CLEARWINDOWCOLORMAP(mi, fp->backGC, fp->black);
+}
+
+void
+draw_flag(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       flagstruct *fp;
+
+       if (flags == NULL)
+               return;
+       fp = &flags[MI_SCREEN(mi)];
+       if (fp->cache == None)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (fp->width <= MAXW(fp) || fp->height <= MAXH(fp)) {
+               fp->size = MININITSIZE;
+               /* fp->pointsize = MINPOINTSIZE; */
+               XCopyArea(display, fp->cache, window, fp->backGC,
+                         0, 0, MINW(fp), MINH(fp), fp->x_flag, fp->y_flag);
+       } else {
+               if ((fp->size + fp->inctaille) > MAXSCALE)
+                       fp->inctaille = -fp->inctaille;
+               if ((fp->size + fp->inctaille) < MINSCALE)
+                       fp->inctaille = -fp->inctaille;
+               fp->size += fp->inctaille;
+               XCopyArea(display, fp->cache, window, fp->backGC,
+                         0, 0, MAXW(fp), MAXH(fp), fp->x_flag, fp->y_flag);
+       }
+       XSetForeground(MI_DISPLAY(mi), fp->backGC, fp->black);
+       XFillRectangle(display, fp->cache, fp->backGC,
+                      0, 0, MAXW(fp), MAXH(fp));
+       XFlush(display);
+       affiche(mi);
+       fp->sidx += 2;
+       fp->sidx %= (ANGLES * MI_NPIXELS(mi));
+       XFlush(display);
+       fp->timer++;
+       if ((MI_CYCLES(mi) > 0) && (fp->timer >= MI_CYCLES(mi)))
+               init_flag(mi);
+}
+
+void
+refresh_flag(ModeInfo * mi)
+{
+       flagstruct *fp;
+
+       if (flags == NULL)
+               return;
+       fp = &flags[MI_SCREEN(mi)];
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       /* This is needed when another program changes the colormap. */
+       free_flag(MI_DISPLAY(mi), fp);
+       init_flag(mi);
+#endif
+       if (fp->backGC != None)
+               MI_CLEARWINDOWCOLORMAP(mi, fp->backGC, fp->black);
+}
+
+#endif /* MODE_flag */
diff --git a/modes/flame.c b/modes/flame.c
new file mode 100644 (file)
index 0000000..bba21a7
--- /dev/null
@@ -0,0 +1,353 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* flame --- recursive fractal cosmic flames */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)flame.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 11-Aug-1995: Got rid of polynomial since it was crashing xlock on some
+ *              machines.
+ * 01-Jun-1995: This should look more like the original with some updates by
+ *              Scott Draves.
+ * 27-Jun-1991: vary number of functions used.
+ * 24-Jun-1991: fixed portability problem with integer mod (%).
+ * 06-Jun-1991: Written, received from Scott Draves <spot@cs.cmu.edu>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Flame"
+#define HACK_INIT init_flame
+#define HACK_DRAW draw_flame
+#define flame_opts xlockmore_opts
+#define DEFAULTS "*delay: 750000 \n" \
+ "*count: 20 \n" \
+ "*cycles: 10000 \n" \
+ "*ncolors: 200 \n"
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_flame
+
+ModeSpecOpt flame_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   flame_description =
+{"flame", "init_flame", "draw_flame", "release_flame",
+ "refresh_flame", "init_flame", NULL, &flame_opts,
+ 750000, 20, 10000, 1, 64, 1.0, "",
+ "Shows cosmic flame fractals", 0, NULL};
+
+#endif
+
+#define MAXLEV    4
+#define MAXKINDS  9
+#define MAXBATCH  12
+
+typedef struct {
+       double      f[2][3][MAXLEV];    /* three non-homogeneous transforms */
+       int         variation;
+       int         max_levels;
+       int         cur_level;
+       int         snum;
+       int         anum;
+       int         width, height;
+       int         num_points;
+       int         total_points;
+       int         pixcol;
+       int         cycles;
+       int         alt;
+       XPoint      pts[MAXBATCH];
+       short       lasthalf;
+} flamestruct;
+
+static flamestruct *flames = NULL;
+
+static short
+halfrandom(flamestruct * fp, int mv)
+{
+       unsigned long r;
+
+       if (fp->lasthalf) {
+               r = fp->lasthalf;
+               fp->lasthalf = 0;
+       } else {
+               r = LRAND();
+               fp->lasthalf = (short) (r >> 16);
+       }
+       return r % mv;
+}
+
+static      Bool
+recurse(ModeInfo * mi, flamestruct * fp,
+       register double x, register double y, register int l)
+{
+       int         i;
+       double      nx, ny;
+
+       if (l == fp->max_levels) {
+               fp->total_points++;
+               if (fp->total_points > fp->cycles)      /* how long each fractal runs */
+                       return False;
+
+               if (x > -1.0 && x < 1.0 && y > -1.0 && y < 1.0) {
+                       fp->pts[fp->num_points].x = (int) ((fp->width / 2) * (x + 1.0));
+                       fp->pts[fp->num_points].y = (int) ((fp->height / 2) * (y + 1.0));
+                       fp->num_points++;
+                       if (fp->num_points >= MAXBATCH) {       /* point buffer size */
+                               XDrawPoints(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi), fp->pts,
+                                           fp->num_points, CoordModeOrigin);
+                               fp->num_points = 0;
+                       }
+               }
+       } else {
+               for (i = 0; i < fp->snum; i++) {
+                       nx = fp->f[0][0][i] * x + fp->f[0][1][i] * y + fp->f[0][2][i];
+                       ny = fp->f[1][0][i] * x + fp->f[1][1][i] * y + fp->f[1][2][i];
+                       if (i < fp->anum) {
+                               switch (fp->variation) {
+                                       case 0: /* sinusoidal */
+                                               nx = sin(nx);
+                                               ny = sin(ny);
+                                               break;
+                                       case 1: /* complex */
+                                               {
+                                                       double      r2 = nx * nx + ny * ny + 1e-6;
+
+                                                       nx = nx / r2;
+                                                       ny = ny / r2;
+                                               }
+                                               break;
+                                       case 2: /* bent */
+                                               if (nx < 0.0)
+                                                       nx = nx * 2.0;
+                                               if (ny < 0.0)
+                                                       ny = ny / 2.0;
+                                               break;
+                                       case 3: /* swirl */
+                                               {
+                                                       double      r = (nx * nx + ny * ny);    /* times k here is fun */
+                                                       double      c1 = sin(r);
+                                                       double      c2 = cos(r);
+                                                       double      t = nx;
+
+                                                       if (nx > 1e4 || nx < -1e4 || ny > 1e4 || ny < -1e4)
+                                                               ny = 1e4;
+                                                       else
+                                                               ny = c2 * t + c1 * ny;
+                                                       nx = c1 * nx - c2 * ny;
+                                               }
+                                               break;
+                                       case 4: /* horseshoe */
+                                               {
+                                                       double      r, c1,
+                                                                   c2,
+                                                                   t;
+
+                                                       /* Avoid atan2: DOMAIN error message */
+                                                       if (nx == 0.0 && ny == 0.0)
+                                                               r = 0.0;
+                                                       else
+                                                               r = atan2(nx, ny);      /* times k here is fun */
+                                                       c1 = sin(r);
+                                                       c2 = cos(r);
+                                                       t = nx;
+
+                                                       nx = c1 * nx - c2 * ny;
+                                                       ny = c2 * t + c1 * ny;
+                                               }
+                                               break;
+                                       case 5: /* drape */
+                                               {
+                                                       double      t;
+
+                                                       /* Avoid atan2: DOMAIN error message */
+                                                       if (nx == 0.0 && ny == 0.0)
+                                                               t = 0.0;
+                                                       else
+                                                               t = atan2(nx, ny) / M_PI;
+
+                                                       if (nx > 1e4 || nx < -1e4 || ny > 1e4 || ny < -1e4)
+                                                               ny = 1e4;
+                                                       else
+                                                               ny = sqrt(nx * nx + ny * ny) - 1.0;
+                                                       nx = t;
+                                               }
+                                               break;
+                                       case 6: /* broken */
+                                               if (nx > 1.0)
+                                                       nx = nx - 1.0;
+                                               if (nx < -1.0)
+                                                       nx = nx + 1.0;
+                                               if (ny > 1.0)
+                                                       ny = ny - 1.0;
+                                               if (ny < -1.0)
+                                                       ny = ny + 1.0;
+                                               break;
+                                       case 7: /* spherical */
+                                               {
+                                                       double      r = 0.5 + sqrt(nx * nx + ny * ny + 1e-6);
+
+                                                       nx = nx / r;
+                                                       ny = ny / r;
+                                               }
+                                               break;
+                                       case 8: /*  */
+                                               nx = atan(nx) / M_PI_2;
+                                               ny = atan(ny) / M_PI_2;
+                                               break;
+#if 0
+/* core dumps on some machines, why not all? */
+                                       case 9: /* complex sine */
+                                               {
+                                                       double      u = nx,
+                                                                   v = ny;
+                                                       double      ev = exp(v);
+                                                       double      emv = exp(-v);
+
+                                                       nx = (ev + emv) * sin(u) / 2.0;
+                                                       ny = (ev - emv) * cos(u) / 2.0;
+                                               }
+                                               break;
+                                       case 10:        /* polynomial */
+                                               if (nx < 0)
+                                                       nx = -nx * nx;
+                                               else
+                                                       nx = nx * nx;
+                                               if (ny < 0)
+                                                       ny = -ny * ny;
+                                               else
+                                                       ny = ny * ny;
+                                               break;
+#endif
+                                       default:
+                                               nx = sin(nx);
+                                               ny = sin(ny);
+                               }
+                       }
+                       if (!recurse(mi, fp, nx, ny, l + 1))
+                               return False;
+               }
+       }
+       return True;
+}
+
+void
+init_flame(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       flamestruct *fp;
+
+       if (flames == NULL) {
+               if ((flames = (flamestruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (flamestruct))) == NULL)
+                       return;
+       }
+       fp = &flames[MI_SCREEN(mi)];
+
+       fp->width = MI_WIDTH(mi);
+       fp->height = MI_HEIGHT(mi);
+
+       fp->max_levels = MI_COUNT(mi);
+       fp->cycles = MI_CYCLES(mi);
+
+       MI_CLEARWINDOW(mi);
+
+       if (MI_NPIXELS(mi) > 2) {
+               fp->pixcol = halfrandom(fp, MI_NPIXELS(mi));
+               XSetForeground(display, gc, MI_PIXEL(mi, fp->pixcol));
+       } else {
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       }
+       fp->variation = NRAND(MAXKINDS);
+}
+
+void
+draw_flame(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         i, j, k;
+       flamestruct *fp;
+
+       if (flames == NULL)
+               return;
+       fp = &flames[MI_SCREEN(mi)];
+
+       if (!(fp->cur_level++ % fp->max_levels)) {
+               MI_CLEARWINDOW(mi);
+               if (MI_NPIXELS(mi) <= 2)
+                       XSetForeground(display, MI_GC(mi), MI_WHITE_PIXEL(mi));
+               fp->alt = !fp->alt;
+       } else {
+               if (MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, MI_GC(mi), MI_PIXEL(mi, fp->pixcol));
+                       if (--fp->pixcol < 0)
+                               fp->pixcol = MI_NPIXELS(mi) - 1;
+               }
+       }
+
+       MI_IS_DRAWN(mi) = True;
+
+       /* number of functions */
+       fp->snum = 2 + (fp->cur_level % (MAXLEV - 1));
+
+       /* how many of them are of alternate form */
+       if (fp->alt)
+               fp->anum = 0;
+       else
+               fp->anum = halfrandom(fp, fp->snum) + 2;
+
+       /* 6 coefs per function */
+       for (k = 0; k < fp->snum; k++) {
+               for (i = 0; i < 2; i++)
+                       for (j = 0; j < 3; j++)
+                               fp->f[i][j][k] = ((double) (LRAND() & 1023) / 512.0 - 1.0);
+       }
+       fp->num_points = 0;
+       fp->total_points = 0;
+       (void) recurse(mi, fp, 0.0, 0.0, 0);
+       XDrawPoints(display, MI_WINDOW(mi), MI_GC(mi),
+                   fp->pts, fp->num_points, CoordModeOrigin);
+}
+
+void
+release_flame(ModeInfo * mi)
+{
+       if (flames != NULL) {
+               (void) free((void *) flames);
+               flames = NULL;
+       }
+}
+
+void
+refresh_flame(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_flame */
diff --git a/modes/flow.c b/modes/flow.c
new file mode 100644 (file)
index 0000000..fea1c3a
--- /dev/null
@@ -0,0 +1,597 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* flow --- flow of strange bees */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)flow.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Tim Auckland <Tim.Auckland@Procket.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * "flow" shows a variety of continuous phase-space flows around strange
+ * attractors.  It includes the well-known Lorenz mask (the "Butterfly"
+ * of chaos fame), two forms of Rossler's "Folded Band" and Poincare'
+ * sections of the "Birkhoff Bagel" and Duffing's forced occilator.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 28-Jan-1998: This change catches 'lost' bees in flow.c and disables them.
+ *   I chose to disable them rather than reinitialise them because
+ *   reinitialising can produce fake attractors.
+ *   This has allowed me to relax some of the parameters and initial
+ *   conditions slightly to catch some of the more extreme cases.  As a
+ *   result you may see some bees fly away at the start - these are the ones
+ *   that 'missed' the attractor.  If the bee with the camera should fly
+ *   away the mode will restart  :-)
+ * 31-Nov-1998: [TDA] Added Duffing  (what a strange day that was :) DAB)
+ *   Duffing's forced oscillator has been added to the formula list and
+ *   the parameters section has been updated to display it in Poincare'
+ *   section.
+ * 30-Nov-1998: [TDA] Added travelling perspective option
+ *   A more exciting point-of-view has been added to all autonomous flows.
+ *   This views the flow as seen by a particle moving with the flow.  In the
+ *   metaphor of the original code, I've attached a camera to one of the
+ *   trained bees!
+ * 30-Nov-1998: [TDA] Much code cleanup.
+ * 09-Apr-1997: [TDA] Ported to xlockmore-4
+ * 18-Jul-1996: Adapted from swarm.c Copyright (c) 1991 by Patrick J. Naughton.
+ * 31-Aug-1990: Adapted from xswarm by Jeff Butterworth. (butterwo@ncsc.org)
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Flow"
+#define HACK_INIT init_flow
+#define HACK_DRAW draw_flow
+#define flow_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+"*count: 1024 \n" \
+"*cycles: 3000 \n" \
+"*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_flow
+
+ModeSpecOpt flow_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   flow_description = {
+       "flow", "init_flow", "draw_flow", "release_flow",
+       "refresh_flow", "init_flow", NULL, &flow_opts,
+       1000, 1024, 3000, 1, 64, 1.0, "",
+       "Shows dynamic strange attractors", 0, NULL
+};
+
+#endif
+
+typedef struct {
+       double      x;
+       double      y;
+       double      z;
+} dvector;
+
+typedef struct {
+       double      a, b, c;
+} Par;
+
+/* Macros */
+#define X(t,b) (sp->p[t][b].x)
+#define Y(t,b) (sp->p[t][b].y)
+#define Z(t,b) (sp->p[t][b].z)
+#define balance_rand(v)        ((LRAND()/MAXRAND*(v))-((v)/2)) /* random around 0 */
+#define SCALE_X(A) (sp->width/2+sp->width/sp->size*(A))
+#define SCALE_Y(A) (sp->height/2+sp->height/sp->size*(A))
+#define LOST_IN_SPACE (sp->size * 10)
+#define LOST_IN_TIME  1E+40
+
+typedef struct {
+       int         width;
+       int         height;
+       int         count;
+       double      size;
+
+       int         beecount;   /* number of bees */
+       XSegment   *csegs;          /* bee lines */
+       int        *cnsegs;
+       XSegment   *old_segs;   /* old bee lines */
+       int         nold_segs;
+       double      step;
+       dvector     centre;             /* centre */
+       struct {
+               double  depth;
+               double  height;
+       }           view;
+       dvector    *p[2];   /* bee positions x[time][bee#] */
+       struct {
+               double  theta;
+               double  dtheta;
+               double  phi;
+               double  dphi;
+       }           tumble;
+       dvector  (*ODE) (Par par, double x, double y, double z);
+       Par         par;
+} flowstruct;
+
+static flowstruct *flows = NULL;
+
+static dvector
+Lorenz(Par par, double x, double y, double z)
+{
+       dvector d;
+
+       d.x = par.a * (y - x);
+       d.y = x * (par.b - z) - y;
+       d.z = x * y - par.c * z;
+       return d;
+}
+
+static dvector
+Rossler(Par par, double x, double y, double z)
+{
+       dvector d;
+
+       d.x = -(y + par.a * z);
+       d.y = x + y * par.b;
+       d.z = par.c + z * (x - 5.7);
+       return d;
+}
+
+static dvector
+RosslerCone(Par par, double x, double y, double z)
+{
+       dvector d;
+
+       d.x = -(y + par.a * z);
+       d.y = x + y * par.b - z * z * par.c;
+       d.z = 0.2 + z * (x - 5.7);
+       return d;
+}
+
+static dvector
+Birkhoff(Par par, double x, double y, double z)
+{
+       dvector d;
+
+       d.x = -y + par.b * sin(z);
+       d.y = 0.7 * x + par.a * y * (0.1 - x * x);
+       d.z = par.c;
+       return d;
+}
+
+static dvector
+Duffing(Par par, double x, double y, double z)
+{
+       dvector d;
+
+       d.x = -par.a * x - y/2 - y * y * y/8 + par.b * cos(z);
+       d.y = 2*x;
+       d.z = par.c;
+       return d;
+}
+
+static void
+free_flow(flowstruct *sp)
+{
+       if (sp->csegs != NULL) {
+               (void) free((void *) sp->csegs);
+               sp->csegs = NULL;
+       }
+       if (sp->cnsegs != NULL) {
+               (void) free((void *) sp->cnsegs);
+               sp->cnsegs = NULL;
+       }
+       if (sp->old_segs != NULL) {
+               (void) free((void *) sp->old_segs);
+               sp->old_segs = NULL;
+       }
+       if (sp->p[0] != NULL) {
+               (void) free((void *) sp->p[0]);
+               sp->p[0] = NULL;
+       }
+       if (sp->p[1] != NULL) {
+               (void) free((void *) sp->p[1]);
+               sp->p[1] = NULL;
+       }
+}
+
+
+void
+init_flow(ModeInfo * mi)
+{
+       flowstruct *sp;
+       int         b;
+       double      beemult = 1;
+       dvector     range;
+
+       if (flows == NULL) {
+               if ((flows = (flowstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (flowstruct))) == NULL)
+                       return;
+       }
+       sp = &flows[MI_SCREEN(mi)];
+
+       sp->count = 0;
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+
+       sp->tumble.theta = balance_rand(M_PI);
+       sp->tumble.phi = balance_rand(M_PI);
+       sp->tumble.dtheta = 0.002;
+       sp->tumble.dphi = 0.001;
+       sp->view.height = 0;
+       sp->view.depth = 0; /* no perspective view */
+
+       switch (NRAND(8)) {
+       case 0:
+               sp->view.depth = 10;
+               sp->view.height = 0.2;
+               beemult = 3;
+               /* fallthrough */
+       case 1:
+               sp->ODE = Lorenz;
+               sp->step = 0.02;
+               sp->size = 60;
+               sp->centre.x = 0;
+               sp->centre.y = 0;
+               sp->centre.z = 24;
+               range.x = 5;
+               range.y = 5;
+               range.z = 1;
+               sp->par.a = 10 + balance_rand(5);
+               sp->par.b = 28 + balance_rand(5);
+               sp->par.c = 2 + balance_rand(1);
+               break;
+       case 2:
+               sp->view.depth = 10;
+               sp->view.height = 0.1;
+               beemult = 4;
+               /* fallthrough */
+       case 3:
+               sp->ODE = Rossler;
+               sp->step = 0.05;
+               sp->size = 24;
+               sp->centre.x = 0;
+               sp->centre.y = 0;
+               sp->centre.z = 3;
+               range.x = 6;
+               range.y = 6;
+               range.z = 5;
+               sp->par.a = 2 + balance_rand(1);
+               sp->par.b = 0.2 + balance_rand(0.1);
+               sp->par.c = 0.2 + balance_rand(0.1);
+               break;
+       case 4:
+               sp->view.depth = 10;
+               sp->view.height = 0.1;
+               beemult = 3;
+               /* fallthrough */
+       case 5:
+               sp->ODE = RosslerCone;
+               sp->step = 0.05;
+               sp->size = 24;
+               sp->centre.x = 0;
+               sp->centre.y = 0;
+               sp->centre.z = 3;
+               range.x = 6;
+               range.y = 6;
+               range.z = 6;
+               sp->par.a = 2;
+               sp->par.b = 0.2;
+               sp->par.c = 0.331 + balance_rand(0.01);
+               break;
+       case 6:
+               sp->ODE = Birkhoff;
+               sp->step = 0.04;
+               sp->size = 2.6;
+               sp->centre.x = 0;
+               sp->centre.y = 0;
+               sp->centre.z = 0;
+               range.x = 3;
+               range.y = 4;
+               range.z = 0;
+               sp->par.a = 10 + balance_rand(5);
+               sp->par.b = 0.35 + balance_rand(0.25);
+               sp->par.c = 1.57;
+               sp->tumble.theta = 0;
+               sp->tumble.phi = 0;
+               sp->tumble.dtheta = 0;
+               sp->tumble.dphi = 0;
+               break;
+       case 7:
+       default:
+               sp->ODE = Duffing;
+               sp->step = 0.02;
+               sp->size = 30;
+               sp->centre.x = 0;
+               sp->centre.y = 0;
+               sp->centre.z = 0;
+               range.x = 20;
+               range.y = 20;
+               range.z = 0;
+               sp->par.a = 0.2 + balance_rand(0.1);
+               sp->par.b = 27.0 + balance_rand(3.0);
+               sp->par.c = 1.33;
+               sp->tumble.theta = 0;
+               sp->tumble.phi = 0;
+               sp->tumble.dtheta = -NRAND(2)*sp->par.c*sp->step;
+               sp->tumble.dphi = 0;
+               beemult = 0.5;
+               break;
+       }
+
+       free_flow(sp); /* beecount changes with beemult */
+       sp->beecount = (int) (beemult * MI_COUNT(mi));
+       if (sp->beecount < 0) { /* random variations */
+               sp->beecount = NRAND(-sp->beecount) + 1; /* Minimum 1 */
+       }
+
+       /* Clear the background. */
+       MI_CLEARWINDOW(mi);
+
+       /* Allocate memory. */
+       if (((sp->csegs = (XSegment *) malloc(sizeof (XSegment) *
+                       sp->beecount * MI_NPIXELS(mi))) == NULL) ||
+           ((sp->cnsegs = (int *) malloc(sizeof (int) *
+                       MI_NPIXELS(mi))) == NULL) ||
+           ((sp->old_segs = (XSegment *) malloc(sizeof (XSegment) *
+                       sp->beecount)) == NULL) ||
+           ((sp->p[0] = (dvector *) malloc(sizeof (dvector) *
+                       sp->beecount)) == NULL) || 
+           ((sp->p[1] = (dvector *) malloc(sizeof (dvector) *
+                       sp->beecount)) == NULL)) {
+               free_flow(sp);
+               return;
+       }
+
+       /* Initialize point positions, velocities, etc. */
+
+       for (b = 0; b < sp->beecount; b++) {
+               X(1, b) = X(0, b) = balance_rand(range.x);
+               Y(1, b) = Y(0, b) = balance_rand(range.y);
+               Z(1, b) = Z(0, b) = balance_rand(range.z);
+       }
+}
+
+void
+draw_flow(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         b, c, i;
+       int         col, ix;
+       double      M[3][3]; /* transformation matrix */
+       flowstruct *sp;
+
+       if (flows == NULL)
+               return;
+       sp = &flows[MI_SCREEN(mi)];
+       if (sp->csegs == NULL)
+               return;
+
+       if(!sp->view.depth){ /* simple 3D tumble */
+               double      sint, cost, sinp, cosp;
+               sp->tumble.theta += sp->tumble.dtheta;
+               sp->tumble.phi += sp->tumble.dphi;
+               sint = sin(sp->tumble.theta);
+               cost = cos(sp->tumble.theta);
+               sinp = sin(sp->tumble.phi);
+               cosp = cos(sp->tumble.phi);
+               M[0][0]= cost; M[0][1]=-sint*cosp; M[0][2]= sint*sinp;
+               M[1][0]= sint; M[1][1]= cost*cosp; M[1][2]=-cost*sinp;
+               M[2][0]= 0;    M[2][1]= 0;         M[2][2]= 1;
+       } else { /* initialize matrix */
+               M[0][0]= 0; M[0][1]= 0; M[0][2]= 0;
+               M[1][0]= 0; M[1][1]= 0; M[1][2]= 0;
+               M[2][0]= 0; M[2][1]= 0; M[2][2]= 0;
+
+       }
+
+       for (col = 0; col < MI_NPIXELS(mi); col++)
+               sp->cnsegs[col] = 0;
+
+       MI_IS_DRAWN(mi) = True;
+
+       /* <=- Bees -=> */
+       for (b = 0; b < sp->beecount; b++) {
+               if(fabs(X(0, b)) > LOST_IN_SPACE ||
+                  fabs(Y(0, b)) > LOST_IN_SPACE ||
+                  /* if z is always invisible it's probably time */
+                  fabs(Z(0, b)) > ((sp->tumble.dphi!=0 ||
+                                                        sp->tumble.phi!=0)?LOST_IN_SPACE:LOST_IN_TIME)){
+                       if(sp->view.depth && b==0){ /* lost camera - reset */
+                               init_flow(mi);
+                               return;
+                       }
+                       continue;
+               }
+               /* Age the arrays. */
+               X(1, b) = X(0, b);
+               Y(1, b) = Y(0, b);
+               Z(1, b) = Z(0, b);
+
+               /* 2nd order Kunge Kutta */
+               {
+                       dvector     k1, k2;
+
+                       k1 = sp->ODE(sp->par, X(1, b), Y(1, b), Z(1, b));
+                       k1.x *= sp->step;
+                       k1.y *= sp->step;
+                       k1.z *= sp->step;
+                       k2 = sp->ODE(sp->par, X(1, b) + k1.x, Y(1, b) + k1.y, Z(1, b) + k1.z);
+                       k2.x *= sp->step;
+                       k2.y *= sp->step;
+                       k2.z *= sp->step;
+                       X(0, b) = X(1, b) + (k1.x + k2.x) / 2.0;
+                       Y(0, b) = Y(1, b) + (k1.y + k2.y) / 2.0;
+                       Z(0, b) = Z(1, b) + (k1.z + k2.z) / 2.0;
+               }
+
+               /* Colour according to bee */
+               col = b % (MI_NPIXELS(mi) - 1);
+               ix = col * sp->beecount + sp->cnsegs[col];
+
+               /* Fill the segment lists. */
+
+               if(sp->view.depth) { /* perspective view has special points */
+                       if(b==0){ /* point of view */
+                               sp->centre.x=X(0, b);
+                               sp->centre.y=Y(0, b);
+                               sp->centre.z=Z(0, b);
+                       }else if(b==1){ /* neighbour: used to compute local axes */
+                               double x[3], p[3], x2=0, xp=0;
+                               int j;
+
+                               /* forward */
+                               x[0] = X(0, 0) - X(1, 0);
+                               x[1] = Y(0, 0) - Y(1, 0);
+                               x[2] = Z(0, 0) - Z(1, 0);
+
+                               /* neighbour */
+                               p[0] = X(0, 1) - X(1, 0);
+                               p[1] = Y(0, 1) - Y(1, 0);
+                               p[2] = Z(0, 1) - Z(1, 0);
+
+                               for(i=0; i<3; i++){
+                                       x2+= x[i]*x[i];    /* X . X */
+                                       xp+= x[i]*p[i];    /* X . P */
+                                       M[0][i] = x[i];    /* X */
+                               }
+
+                               for(i=0; i<3; i++)               /* (X x P) x X */
+                                       M[1][i] = x2*p[i] - xp*x[i]; /* == (X . X) P - (X . P) X */
+
+                               M[2][0] =  x[1]*p[2] - x[2]*p[1]; /* X x P */
+                               M[2][1] = -x[0]*p[2] + x[2]*p[0];
+                               M[2][2] =  x[0]*p[1] - x[1]*p[0];
+
+                               /* normalise axes */
+                               for(j=0; j<3; j++){
+                                       double A=0;
+                                       for(i=0; i<3; i++) A+=M[j][i]*M[j][i]; /* sum squares */
+                                       A=sqrt(A);
+                                       for(i=0; i<3; i++) M[j][i]/=A;
+                               }
+
+                               X(0, 1)=X(0, 0)+M[1][0]; /* adjust neighbour */
+                               Y(0, 1)=Y(0, 0)+M[1][1];
+                               Z(0, 1)=Z(0, 0)+M[1][2];
+
+#if 0  /* display local axes for testing */
+                               X(1, b)=X(0, 0);
+                               Y(1, b)=Y(0, 0);
+                               Z(1, b)=Z(0, 0);
+                       }else if(b==2){
+                               X(0, b)=X(0, 0)+0.5*M[0][0];
+                               Y(0, b)=Y(0, 0)+0.5*M[0][1];
+                               Z(0, b)=Z(0, 0)+0.5*M[0][2];
+                               X(1, b)=X(0, 0);
+                               Y(1, b)=Y(0, 0);
+                               Z(1, b)=Z(0, 0);
+                       }else if(b==3){
+                               X(0, b)=X(0, 0)+1.5*M[2][0];
+                               Y(0, b)=Y(0, 0)+1.5*M[2][1];
+                               Z(0, b)=Z(0, 0)+1.5*M[2][2];
+                               X(1, b)=X(0, 0);
+                               Y(1, b)=Y(0, 0);
+                               Z(1, b)=Z(0, 0);
+#endif
+                       }
+               }
+
+               for(i=0; i<2; i++){
+                       double x=X(i,b)-sp->centre.x;
+                       double y=Y(i,b)-sp->centre.y;
+                       double z=Z(i,b)-sp->centre.z;
+                       double X=M[0][0]*x + M[0][1]*y + M[0][2]*z;
+                       double Y=M[1][0]*x + M[1][1]*y + M[1][2]*z;
+                       double Z=M[2][0]*x + M[2][1]*y + M[2][2]*z+sp->view.height;
+                       double absx, absy;
+                       if(sp->view.depth){
+                               if(X <= 0) break;
+                               absx=SCALE_X(sp->view.depth*Y/X);
+                               absy=SCALE_Y(sp->view.depth*Z/X);
+                               if(absx < -sp->width || absx > 2*sp->width ||
+                                  absy < -sp->height || absy > 2*sp->height)
+                                       break;
+                       }else{
+                               absx=SCALE_X(X);
+                               absy=SCALE_Y(Y);
+                       }
+                       if(i){
+                               sp->csegs[ix].x1 = (short) absx;
+                               sp->csegs[ix].y1 = (short) absy;
+                       }else{
+                               sp->csegs[ix].x2 = (short) absx;
+                               sp->csegs[ix].y2 = (short) absy;
+                       }
+               }
+               if(i == 2) /* both assigned */
+                       sp->cnsegs[col]++;
+    }
+       if (sp->count) { /* erase */
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XDrawSegments(display, window, gc, sp->old_segs, sp->nold_segs);
+       }
+
+       if (MI_NPIXELS(mi) > 2){ /* render colour */
+               for (col = 0; col < MI_NPIXELS(mi); col++)
+                       if (sp->cnsegs[col] > 0) {
+                               XSetForeground(display, gc, MI_PIXEL(mi, col));
+                               XDrawSegments(display, window, gc,
+                                             sp->csegs + col * sp->beecount, sp->cnsegs[col]);
+                       }
+       } else {                /* render mono */
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               XDrawSegments(display, window, gc,
+                                         sp->csegs + col * sp->beecount, sp->cnsegs[col]);
+       }
+
+       /* Copy to erase-list */
+       for (col = 0, c = 0; col < MI_NPIXELS(mi); col++)
+               for (b = 0; b < sp->cnsegs[col]; b++)
+                       sp->old_segs[c++] = (sp->csegs + col * sp->beecount)[b];
+       sp->nold_segs = c;
+
+       if (++sp->count > MI_CYCLES(mi)) /* pick a new flow */
+               init_flow(mi);
+}
+
+void
+release_flow(ModeInfo * mi)
+{
+       if (flows != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_flow(&flows[screen]);
+               (void) free((void *) flows);
+               flows = NULL;
+       }
+}
+
+void
+refresh_flow(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_flow */
diff --git a/modes/forest.c b/modes/forest.c
new file mode 100644 (file)
index 0000000..1634241
--- /dev/null
@@ -0,0 +1,225 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* forest --- binary trees in a fractal forest */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)forest.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 Pascal Pensa <pensa@aurora.unice.fr>
+ *
+ * Original idea : Guillaume Ramey <ramey@aurora.unice.fr>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Forest"
+#define HACK_INIT init_forest
+#define HACK_DRAW draw_forest
+#define forest_opts xlockmore_opts
+#define DEFAULTS "*delay: 400000 \n" \
+ "*count: 100 \n" \
+ "*cycles: 200 \n" \
+ "*ncolors: 100 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_forest
+
+ModeSpecOpt forest_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   forest_description =
+{"forest", "init_forest", "draw_forest", "release_forest",
+ "refresh_forest", "init_forest", NULL, &forest_opts,
+ 400000, 100, 200, 1, 64, 1.0, "",
+ "Shows binary trees of a fractal forest", 0, NULL};
+
+#endif
+
+#define MINTREES   1
+
+#define MINHEIGHT  20          /* Tree height range */
+#define MAXHEIGHT  40
+
+#define MINANGLE   15          /* (degree) angle between soon */
+#define MAXANGLE   35
+#define RANDANGLE  15          /* (degree) Max random angle from default */
+
+#define REDUCE     90          /* Height % from father */
+
+#define ITERLEVEL  10          /* Tree iteration */
+
+#define COLORSPEED  2          /* Color increment */
+
+/* degree to radian */
+#define DEGTORAD(x) (((float)(x)) * M_PI / 180.0)
+
+#define RANGE_RAND(min,max) ((min) + NRAND((max) - (min)))
+
+typedef struct {
+       int         width;
+       int         height;
+       int         time;       /* up time */
+       int         ntrees;
+} foreststruct;
+
+static foreststruct *forests = NULL;
+
+static void
+draw_tree(ModeInfo * mi,
+         short int x, short int y, short int len,
+         float a, float as, short int c, short int level)
+                               /* Father's end */
+                               /* Length */
+                               /* color */
+                               /* Height level */
+                               /* Father's angle */
+                               /* Father's angle step */
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       short       x_1, y_1, x_2, y_2;
+       float       a1, a2;
+
+       /* left */
+
+       a1 = a + as + DEGTORAD(NRAND(2 * RANDANGLE) - RANDANGLE);
+
+       x_1 = x + (short) (COSF(a1) * ((float) len));
+       y_1 = y + (short) (SINF(a1) * ((float) len));
+
+       /* right */
+
+       a2 = a - as + DEGTORAD(NRAND(2 * RANDANGLE) - RANDANGLE);
+
+       x_2 = x + (short) (COSF(a2) * ((float) len));
+       y_2 = y + (short) (SINF(a2) * ((float) len));
+
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, c));
+               c = (c + COLORSPEED) % MI_NPIXELS(mi);
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       XDrawLine(display, window, gc, x, y, x_1, y_1);
+       XDrawLine(display, window, gc, x, y, x_2, y_2);
+
+       if (level < 2) {
+               XDrawLine(display, window, gc, x + 1, y, x_1 + 1, y_1);
+               XDrawLine(display, window, gc, x + 1, y, x_2 + 1, y_2);
+       }
+       len = (len * REDUCE * 10) / 1000;
+
+       if (level < ITERLEVEL) {
+               draw_tree(mi, x_1, y_1, len, a1, as, c, level + 1);
+               draw_tree(mi, x_2, y_2, len, a2, as, c, level + 1);
+       }
+}
+
+void
+init_forest(ModeInfo * mi)
+{
+       foreststruct *fp;
+
+       if (forests == NULL) {
+               if ((forests = (foreststruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (foreststruct))) == NULL)
+                       return;
+       }
+       fp = &forests[MI_SCREEN(mi)];
+
+       fp->width = MI_WIDTH(mi);
+       fp->height = MI_HEIGHT(mi);
+       fp->time = 0;
+
+       fp->ntrees = MI_COUNT(mi);
+       if (fp->ntrees < -MINTREES)
+               fp->ntrees = NRAND(-fp->ntrees - MINTREES + 1) + MINTREES;
+       else if (fp->ntrees < MINTREES)
+               fp->ntrees = MINTREES;
+
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_forest(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       short       x, y, x_2, y_2, len, c = 0;
+       float       a, as;
+       foreststruct *fp;
+
+       if (forests == NULL)
+               return;
+       fp = &forests[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (fp->time < fp->ntrees) {
+
+               x = RANGE_RAND(0, fp->width);
+               y = RANGE_RAND(0, fp->height + MAXHEIGHT);
+               a = -M_PI / 2.0 + DEGTORAD(NRAND(2 * RANDANGLE) - RANDANGLE);
+               as = DEGTORAD(RANGE_RAND(MINANGLE, MAXANGLE));
+               len = ((RANGE_RAND(MINHEIGHT, MAXHEIGHT) * (fp->width / 20)) / 50) + 2;
+
+               if (MI_NPIXELS(mi) > 2) {
+                       c = NRAND(MI_NPIXELS(mi));
+                       XSetForeground(display, gc, MI_PIXEL(mi, c));
+                       c = (c + COLORSPEED) % MI_NPIXELS(mi);
+               } else
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+               x_2 = x + (short) (COSF(a) * ((float) len));
+               y_2 = y + (short) (SINF(a) * ((float) len));
+
+               XDrawLine(display, MI_WINDOW(mi), gc, x, y, x_2, y_2);
+               XDrawLine(display, MI_WINDOW(mi), gc, x + 1, y, x_2 + 1, y_2);
+
+               draw_tree(mi, x_2, y_2, (len * REDUCE) / 100, a, as, c, 1);
+       }
+       if (++fp->time > MI_CYCLES(mi)) {
+               init_forest(mi);
+       }
+}
+
+void
+release_forest(ModeInfo * mi)
+{
+       if (forests != NULL) {
+               (void) free((void *) forests);
+               forests = NULL;
+       }
+}
+
+void
+refresh_forest(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_forest */
diff --git a/modes/galaxy.c b/modes/galaxy.c
new file mode 100644 (file)
index 0000000..fb994db
--- /dev/null
@@ -0,0 +1,592 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* galaxy --- spinning galaxies */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)galaxy.c     5.01 2001/01/02 xlockmore";
+
+#endif
+
+/*-
+ * Originally done by Uli Siegmund <uli@wombat.okapi.sub.org> on Amiga
+ *   for EGS in Cluster
+ * Port from Cluster/EGS to C/Intuition by Harald Backert
+ * Port to X11 and incorporation into xlockmore by Hubert Feyrer
+ *   <hubert.feyrer@rz.uni-regensburg.de>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 24-Dec-2000: Modified by Richard Loftin <rich@sevenravens.com>
+               fisheye lens view
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 18-Apr-1997: Memory leak fixed by Tom Schmidt <tschmidt@micron.com>
+ * 07-Apr-1997: Modified by Dave Mitchell <davem@magnet.com>
+ *              random star sizes
+ *              colors change depending on velocity
+ * 23-Oct-1994: Modified by David Bagley <bagleyd@tux.org>
+ * 10-Oct-1994: Add colors by Hubert Feyer
+ * 30-Sep-1994: Initial port by Hubert Feyer
+ * 09-Mar-1994: VMS can generate a random number 0.0 which results in a
+ *              division by zero, corrected by Jouk Jansen
+ *              <joukj@hrem.stm.tudelft.nl>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Galaxy"
+#define HACK_INIT init_galaxy
+#define HACK_DRAW draw_galaxy
+#define galaxy_opts xlockmore_opts
+#define DEFAULTS "*delay: 100 \n" \
+ "*count: -5 \n" \
+ "*cycles: 250 \n" \
+ "*size: -3 \n" \
+ "*ncolors: 64 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_galaxy
+
+static Bool fisheye;
+static Bool tracks;
+
+#define DEF_FISHEYE "True"
+#define DEF_TRACKS "False"
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-fisheye", (char *) ".galaxy.fisheye", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+fisheye", (char *) ".galaxy.fisheye", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-tracks", (char *) ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+tracks", (char *) ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & fisheye, (char *) "fisheye", (char *) "FishEye", (char *) DEF_FISHEYE, t_Bool},
+       {(caddr_t *) & tracks, (char *) "tracks", (char *) "Tracks", (char *) DEF_TRACKS, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+fisheye", (char *) "turn on/off fish eye view"},
+       {(char *) "-/+tracks", (char *) "turn on/off star tracks"}
+};
+
+ModeSpecOpt galaxy_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   galaxy_description =
+{"galaxy", "init_galaxy", "draw_galaxy", "release_galaxy",
+ "refresh_galaxy", "init_galaxy", NULL, &galaxy_opts,
+ 100, -5, 250, -3, 64, 1.0, "",
+ "Shows crashing spiral galaxies", 0, NULL};
+
+#endif
+
+#define FLOATRAND ((double) LRAND() / ((double) MAXRAND))
+
+#if 0
+#define WRAP       1           /* Warp around edges */
+#define BOUNCE     1           /* Bounce from borders */
+#endif
+
+#define MINSIZE       1
+#define MINGALAXIES    2
+#define MAX_STARS    300
+#define MAX_IDELTAT    50
+/* These come originally from the Cluster-version */
+#define DEFAULT_GALAXIES  2
+#define DEFAULT_STARS    1000
+#define DEFAULT_HITITERATIONS  7500
+#define DEFAULT_IDELTAT    200 /* 0.02 */
+#define EPSILON 0.00000001
+#define sqrt_EPSILON 0.0001
+
+#define DELTAT (MAX_IDELTAT * 0.0001)
+#define GALAXYRANGESIZE  0.1
+#define GALAXYMINSIZE  0.1
+#define QCONS    0.001
+#define Z_OFFSET 1.25
+
+/*
+ *  The following is enabled, it does not look that good for some.
+ *  (But it looks great for me.)  Maybe velocities should be measured
+ *  relative to their galaxy-centers instead of absolute.
+ */
+#if 0
+#undef NO_VELOCITY_COLORING */ /* different colors for different speeds */
+#endif
+
+#define COLORBASE  (MI_NPIXELS(mi) / COLORS)   /* Colors for stars start here */
+#define GREEN (22 * MI_NPIXELS(mi) / 64)       /* Do green stars exist? */
+#define NOTGREEN  (7 * MI_NPIXELS(mi) / 64)
+#define COLORS 8
+
+#define drawStar(x,y,size) if(size<=1) XDrawPoint(display,drawable,gc,x,y);\
+  else XFillArc(display,drawable,gc,x,y,size,size,0,23040)
+
+typedef struct {
+       double      pos[3], vel[3];
+       int         px, py;
+       int         color;
+       int         size;
+       int         Z_size;
+} Star;
+
+typedef struct {
+       int         mass;
+       int         nstars;
+       Star       *stars;
+       double      pos[3], vel[3];
+       int         galcol;
+} Galaxy;
+
+typedef struct {
+       struct {
+               int         left;       /* x minimum */
+               int         right;      /* x maximum */
+               int         top;        /* y minimum */
+               int         bottom;     /* y maximum */
+       } clip;
+       double      mat[3][3];  /* Movement of stars(?) */
+       double      scale;      /* Scale */
+       int         midx;       /* Middle of screen, x */
+       int         midy;       /* Middle of screen, y */
+       double      size;       /* */
+       double      diff[3];    /* */
+       Galaxy     *galaxies;   /* the Whole Universe */
+       int         ngalaxies;  /* # galaxies */
+       int         f_hititerations;    /* # iterations before restart */
+       int         step;       /* */
+       Bool        tracks, fisheye;
+       double star_scale_Z;
+       Pixmap pixmap;
+} unistruct;
+
+static unistruct *universes = NULL;
+
+static void
+free_galaxies(unistruct * gp)
+{
+       if (gp->galaxies != NULL) {
+               int         i;
+
+               for (i = 0; i < gp->ngalaxies; i++) {
+                       Galaxy     *gt = &gp->galaxies[i];
+
+                       if (gt->stars != NULL)
+                               (void) free((void *) gt->stars);
+               }
+               (void) free((void *) gp->galaxies);
+               gp->galaxies = NULL;
+       }
+}
+
+static void
+free_galaxy(Display *display, unistruct * gp)
+{
+       free_galaxies(gp);
+       if (gp->pixmap != None) {
+               XFreePixmap(display, gp->pixmap);
+               gp->pixmap = None;
+       }
+}
+
+static Bool
+startover(ModeInfo * mi)
+{
+       unistruct  *gp = &universes[MI_SCREEN(mi)];
+       int         size = (int) MI_SIZE(mi);
+       int         i, j;       /* more tmp */
+       double      w1, w2;     /* more tmp */
+       double      d, v, w, h; /* yet more tmp */
+
+       gp->step = 0;
+
+       if (MI_COUNT(mi) < -MINGALAXIES)
+               free_galaxies(gp);
+       gp->ngalaxies = MI_COUNT(mi);
+       if (gp->ngalaxies < -MINGALAXIES)
+               gp->ngalaxies = NRAND(-gp->ngalaxies - MINGALAXIES + 1) + MINGALAXIES;
+       else if (gp->ngalaxies < MINGALAXIES)
+               gp->ngalaxies = MINGALAXIES;
+       if (gp->galaxies == NULL)
+               if ((gp->galaxies = (Galaxy *) calloc(gp->ngalaxies,
+                               sizeof (Galaxy))) == NULL) {
+                       free_galaxy(MI_DISPLAY(mi), gp);
+                       return False;
+       }
+       for (i = 0; i < gp->ngalaxies; ++i) {
+               Galaxy     *gt = &gp->galaxies[i];
+               double      sinw1, sinw2, cosw1, cosw2;
+
+               if (MI_NPIXELS(mi) >= COLORS)
+                       do {
+                               gt->galcol = NRAND(COLORBASE) * COLORS;
+                       } while (gt->galcol + COLORBASE / 2 < GREEN + NOTGREEN &&
+                             gt->galcol + COLORBASE / 2 > GREEN - NOTGREEN);
+               else
+                       gt->galcol = 0;
+               /* Galaxies still may have some green stars but are not all green. */
+
+               if (gt->stars != NULL) {
+                       (void) free((void *) gt->stars);
+                       gt->stars = NULL;
+               }
+               gt->nstars = (NRAND(MAX_STARS / 2)) + MAX_STARS / 2;
+               if ((gt->stars = (Star *) malloc(gt->nstars *
+                               sizeof (Star))) == NULL) {
+                       free_galaxy(MI_DISPLAY(mi), gp);
+                       return False;
+               }
+               w1 = 2.0 * M_PI * FLOATRAND;
+               w2 = 2.0 * M_PI * FLOATRAND;
+               sinw1 = SINF(w1);
+               sinw2 = SINF(w2);
+               cosw1 = COSF(w1);
+               cosw2 = COSF(w2);
+
+               gp->mat[0][0] = cosw2;
+               gp->mat[0][1] = -sinw1 * sinw2;
+               gp->mat[0][2] = cosw1 * sinw2;
+               gp->mat[1][0] = 0.0;
+               gp->mat[1][1] = cosw1;
+               gp->mat[1][2] = sinw1;
+               gp->mat[2][0] = -sinw2;
+               gp->mat[2][1] = -sinw1 * cosw2;
+               gp->mat[2][2] = cosw1 * cosw2;
+
+               gt->vel[0] = FLOATRAND * 2.0 - 1.0;
+               gt->vel[1] = FLOATRAND * 2.0 - 1.0;
+               gt->vel[2] = FLOATRAND * 2.0 - 1.0;
+               gt->pos[0] = -gt->vel[0] * DELTAT *
+                       gp->f_hititerations + FLOATRAND - 0.5;
+               gt->pos[1] = -gt->vel[1] * DELTAT *
+                       gp->f_hititerations + FLOATRAND - 0.5;
+               gt->pos[2] = (-gt->vel[2] * DELTAT *
+                       gp->f_hititerations + FLOATRAND - 0.5) + Z_OFFSET;
+
+               gt->mass = (int) (FLOATRAND * 1000.0) + 1;
+
+               gp->size = GALAXYRANGESIZE * FLOATRAND + GALAXYMINSIZE;
+
+               for (j = 0; j < gt->nstars; ++j) {
+                       Star       *st = &gt->stars[j];
+                       double      sinw, cosw;
+
+                       w = 2.0 * M_PI * FLOATRAND;
+                       sinw = SINF(w);
+                       cosw = COSF(w);
+                       d = FLOATRAND * gp->size;
+                       h = FLOATRAND * exp(-2.0 * (d / gp->size)) / 5.0 * gp->size;
+                       if (FLOATRAND < 0.5)
+                               h = -h;
+                       st->pos[0] = gp->mat[0][0] * d * cosw + gp->mat[1][0] * d * sinw +
+                               gp->mat[2][0] * h + gt->pos[0];
+                       st->pos[1] = gp->mat[0][1] * d * cosw + gp->mat[1][1] * d * sinw +
+                               gp->mat[2][1] * h + gt->pos[1];
+                       st->pos[2] = gp->mat[0][2] * d * cosw + gp->mat[1][2] * d * sinw +
+                               gp->mat[2][2] * h + gt->pos[2];
+
+                       v = sqrt(gt->mass * QCONS / sqrt(d * d + h * h));
+                       st->vel[0] = -gp->mat[0][0] * v * sinw + gp->mat[1][0] * v * cosw +
+                               gt->vel[0];
+                       st->vel[1] = -gp->mat[0][1] * v * sinw + gp->mat[1][1] * v * cosw +
+                               gt->vel[1];
+                       st->vel[2] = -gp->mat[0][2] * v * sinw + gp->mat[1][2] * v * cosw +
+                               gt->vel[2];
+
+                       st->vel[0] *= DELTAT;
+                       st->vel[1] *= DELTAT;
+                       st->vel[2] *= DELTAT;
+
+                       st->px = 0;
+                       st->py = 0;
+
+                       if (size < -MINSIZE)
+                               st->size = NRAND(-size - MINSIZE + 1) + MINSIZE;
+                       else if (size < MINSIZE)
+                               st->size = MINSIZE;
+                       else
+                               st->size = size;
+
+                       st->Z_size = st->size;
+
+               }
+       }
+
+       MI_CLEARWINDOW(mi);
+
+#if 0
+       (void) printf("ngalaxies=%d, f_hititerations=%d\n",
+                     gp->ngalaxies, gp->f_hititerations);
+       (void) printf("f_deltat=%g\n", DELTAT);
+       (void) printf("Screen: ");
+       (void) printf("%dx%d pixel (%d-%d, %d-%d)\n",
+         (gp->clip.right - gp->clip.left), (gp->clip.bottom - gp->clip.top),
+              gp->clip.left, gp->clip.right, gp->clip.top, gp->clip.bottom);
+#endif
+       return True;
+}
+
+void
+init_galaxy(ModeInfo * mi)
+{
+       Display *display = MI_DISPLAY(mi);
+       unistruct  *gp;
+
+       if (universes == NULL) {
+               if ((universes = (unistruct *) calloc(MI_NUM_SCREENS(mi),
+                                               sizeof (unistruct))) == NULL)
+                       return;
+       }
+       gp = &universes[MI_SCREEN(mi)];
+
+       gp->f_hititerations = MI_CYCLES(mi);
+
+       gp->clip.left = 0;
+       gp->clip.top = 0;
+       gp->clip.right = MI_WIDTH(mi);
+       gp->clip.bottom = MI_HEIGHT(mi);
+
+       gp->scale = (double) (gp->clip.right + gp->clip.bottom) / 8.0;
+       gp->midx = gp->clip.right / 2;
+       gp->midy = gp->clip.bottom / 2;
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               gp->fisheye = !(NRAND(3));
+               if (!gp->fisheye)
+                       gp->tracks = (Bool) (LRAND() & 1);
+       } else {
+               gp->fisheye = fisheye;
+               gp->tracks = tracks;
+       }
+
+       if (!startover(mi))
+               return;
+       if (gp->fisheye) {
+               if (gp->pixmap != None)
+                       XFreePixmap(display, gp->pixmap);
+               if ((gp->pixmap = XCreatePixmap(display, MI_WINDOW(mi),
+                               MI_WIDTH(mi), MI_HEIGHT(mi),
+                               MI_DEPTH(mi))) == None) {
+                       gp->fisheye = False;
+               }
+       }
+       if (gp->fisheye) {
+               XSetGraphicsExposures(display, MI_GC(mi), False);
+               gp->scale *= Z_OFFSET;
+               gp->star_scale_Z = (gp->scale  * .005);
+                /* don't want any exposure events from XCopyPlane */
+       }
+
+}
+
+void
+draw_galaxy(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Drawable    drawable;
+       GC          gc = MI_GC(mi);
+       double      d;          /* tmp */
+       int         i, j, k;    /* more tmp */
+       unistruct  *gp;
+       Bool        clipped;
+
+       if (universes == NULL)
+               return;
+       gp = &universes[MI_SCREEN(mi)];
+       if (gp->galaxies == NULL)
+               return;
+
+       if (gp->fisheye)
+               drawable = gp->pixmap;
+       else
+               drawable = MI_WINDOW(mi);
+       MI_IS_DRAWN(mi) = True;
+       for (i = 0; i < gp->ngalaxies; ++i) {
+               Galaxy     *gt = &gp->galaxies[i];
+
+               for (j = 0; j < gp->galaxies[i].nstars; ++j) {
+                       Star       *st = &gt->stars[j];
+                       double      v0 = st->vel[0];
+                       double      v1 = st->vel[1];
+                       double      v2 = st->vel[2];
+
+                       for (k = 0; k < gp->ngalaxies; ++k) {
+                               Galaxy     *gtk = &gp->galaxies[k];
+                               double      d0 = gtk->pos[0] - st->pos[0];
+                               double      d1 = gtk->pos[1] - st->pos[1];
+                               double      d2 = gtk->pos[2] - st->pos[2];
+
+                               d = d0 * d0 + d1 * d1 + d2 * d2;
+                               if (d > EPSILON)
+                                       d = gt->mass / (d * sqrt(d)) * DELTAT * DELTAT * QCONS;
+                               else
+                                       d = gt->mass / (EPSILON * sqrt_EPSILON) * DELTAT * DELTAT * QCONS;
+                               v0 += d0 * d;
+                               v1 += d1 * d;
+                               v2 += d2 * d;
+                       }
+
+                       st->vel[0] = v0;
+                       st->vel[1] = v1;
+                       st->vel[2] = v2;
+
+#ifndef NO_VELOCITY_COLORING
+                       d = (v0 * v0 + v1 * v1 + v2 * v2) / (3.0 * DELTAT * DELTAT);
+                       if (d > (double) COLORBASE)
+                               st->color = gt->galcol + COLORBASE - 1;
+                       else
+                               st->color = gt->galcol + ((int) d) % COLORBASE;
+#endif
+                       st->pos[0] += v0;
+                       st->pos[1] += v1;
+                       st->pos[2] += v2;
+
+                       clipped = True;
+                       if (gp->fisheye) {
+/* clip if star Z position < 0.0 - also avoid divide by zero errors */
+
+                       if(st->pos[2]>0.0)
+                       {
+                       st->px = (int) ((st->pos[0] * gp->scale) / st->pos[2]) + gp->midx;
+                       st->py = (int) ((st->pos[1] * gp->scale) / st->pos[2]) + gp->midy;
+                       st->size = (int) (gp->star_scale_Z / st->pos[2]) + st->Z_size;
+                       if(st->size>12)st->size=12;
+                       clipped = False;
+                       }
+                       } else {
+
+                       if (st->px >= gp->clip.left &&
+                           st->px <= gp->clip.right - st->size &&
+                           st->py >= gp->clip.top &&
+                           st->py <= gp->clip.bottom - st->size) {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               drawStar(st->px, st->py, st->size);
+                       }
+                       st->px = (int) (st->pos[0] * gp->scale) + gp->midx;
+                       st->py = (int) (st->pos[1] * gp->scale) + gp->midy;
+
+
+#ifdef WRAP /* won't WRAP if FISHEYE_LENS */
+                       if (st->px < gp->clip.left) {
+                               (void) printf("wrap l -> r\n");
+                               st->px = gp->clip.right;
+                       }
+                       if (st->px > gp->clip.right) {
+                               (void) printf("wrap r -> l\n");
+                               st->px = gp->clip.left;
+                       }
+                       if (st->py > gp->clip.bottom) {
+                               (void) printf("wrap b -> t\n");
+                               st->py = gp->clip.top;
+                       }
+                       if (st->py < gp->clip.top) {
+                               (void) printf("wrap t -> b\n");
+                               st->py = gp->clip.bottom;
+                       }
+#endif /*WRAP */
+
+
+                       if (st->px >= gp->clip.left &&
+                           st->px <= gp->clip.right - st->size &&
+                           st->py >= gp->clip.top &&
+                                st->py <= gp->clip.bottom - st->size) {
+                       clipped = False;
+                       }
+                       }
+                       if (!clipped) {
+
+                               if (MI_NPIXELS(mi) >= COLORS)
+#ifdef NO_VELOCITY_COLORING
+                                       XSetForeground(display, gc, MI_PIXEL(mi, gt->galcol));
+#else
+                                       XSetForeground(display, gc, MI_PIXEL(mi, st->color));
+#endif
+                               else
+                                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                               if (gp->tracks) {
+                                       drawStar(st->px + 1, st->py, st->size);
+                               } else {
+                                       drawStar(st->px, st->py, st->size);
+                               }
+                       }
+               }
+
+               for (k = i + 1; k < gp->ngalaxies; ++k) {
+                       Galaxy     *gtk = &gp->galaxies[k];
+                       double      d0 = gtk->pos[0] - gt->pos[0];
+                       double      d1 = gtk->pos[1] - gt->pos[1];
+                       double      d2 = gtk->pos[2] - gt->pos[2];
+
+                       d = d0 * d0 + d1 * d1 + d2 * d2;
+                       if (d > EPSILON)
+                               d = gt->mass * gt->mass / (d * sqrt(d)) * DELTAT * QCONS;
+                       else
+                               d = gt->mass * gt->mass / (EPSILON * sqrt_EPSILON) * DELTAT * QCONS;
+                       d0 *= d;
+                       d1 *= d;
+                       d2 *= d;
+                       gt->vel[0] += d0 / gt->mass;
+                       gt->vel[1] += d1 / gt->mass;
+                       gt->vel[2] += d2 / gt->mass;
+                       gtk->vel[0] -= d0 / gtk->mass;
+                       gtk->vel[1] -= d1 / gtk->mass;
+                       gtk->vel[2] -= d2 / gtk->mass;
+               }
+               gt->pos[0] += gt->vel[0] * DELTAT;
+               gt->pos[1] += gt->vel[1] * DELTAT;
+               gt->pos[2] += gt->vel[2] * DELTAT;
+       }
+
+       if (gp->fisheye) {
+               XCopyArea(display, drawable, MI_WINDOW(mi), gc,
+                       0, 0, MI_WIDTH(mi), MI_HEIGHT(mi),0 , 0);
+       
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       
+               XFillRectangle(display, drawable, gc,
+                       0, 0, MI_WIDTH(mi), MI_HEIGHT(mi));
+       }
+       gp->step++;
+       if (gp->step > gp->f_hititerations * 4)
+               (void) startover(mi);
+}
+
+void
+release_galaxy(ModeInfo * mi)
+{
+       if (universes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_galaxy(MI_DISPLAY(mi), &universes[screen]);
+               (void) free((void *) universes);
+               universes = NULL;
+       }
+}
+
+void
+refresh_galaxy(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_galaxy */
diff --git a/modes/glx/Imakefile b/modes/glx/Imakefile
new file mode 100644 (file)
index 0000000..530e309
--- /dev/null
@@ -0,0 +1,146 @@
+#ifndef XCOMM
+#define XCOMM /**/#
+#endif
+XCOMM @(#)Sub Imakefile        xlockmore
+XCOMM
+
+#include "../../iconfig.h"
+
+UTILDIR = $(top_srcdir)/xlock/
+MODEDIR = $(top_srcdir)/modes/
+GLDIR = $(top_srcdir)/modes/glx/
+UTILOBJDIR = ../../xlock/
+MODEOBJDIR = ../
+GLOBJDIR = ./
+
+DM =
+DU = $(UTILDIR)
+DOU = $(UTILOBJDIR)
+DG = $(GLDIR)
+DOG = $(GLOBJDIR)
+OM = $(O)$(S)$(DM)
+OU = $(O)$(S)$(DOU)
+OG = $(O)$(S)$(DOG)
+CM = $(C) $(DM)
+CU = $(C) $(DU)
+CG = $(C) $(DG)
+CXG = $(CX) $(DG)
+
+XCOMM  List of object files
+#ifdef GLLibrary
+#ifdef Unstable
+XLOCKUNSTABLEGLOBJS = $(DOG)skewb$(O)
+#endif
+#ifdef CPPCompiler
+INVERTOBJS = $(DOG)i_figureeight$(O)$(S)\
+$(DOG)i_linkage$(OG)i_sphere$(OG)i_spline$(O)$(S)\
+$(DOG)i_threejet$(OG)i_threejetvec$(O)$(S)\
+$(DOG)i_twojet$(OG)i_twojetvec$(O)
+XLOCKDEPCPPGLOBJS = $(INVERTOBJS)
+XLOCKMULTCPPGLOBJS = $(DOG)invert$(O)
+#if defined(TtfLibrary) && defined(GlttLibrary) && defined(Unstable)
+XLOCKUNSTABLETEXTGLOBJS = $(DOG)text3d$(O)
+#endif
+#endif
+SPROINGIESOBJS = $(DOG)buildlwo$(OG)sproingiewrap$(OG)s1_b$(O)$(S)\
+$(DOG)s1_1$(OG)s1_2$(OG)s1_3$(OG)s1_4$(OG)s1_5$(OG)s1_6$(O)
+ATLANTISOBJS = $(DOG)dolphin$(OG)shark$(OG)swim$(OG)whale$(O)
+GLPLANETOBJS = $(DOG)sphere$(O)
+BUBBLE3DOBJS = $(DOG)b_draw$(OG)b_sphere$(OG)b_lockglue$(O)
+MOLECULEOBJS = $(DOG)tube$(O)
+XLOCKDEPGLOBJS = $(DOG)xpm-ximage$(OG)pipeobjs$(O)$(S)\
+$(SPROINGIESOBJS)$(S)$(ATLANTISOBJS)$(S)$(GLPLANETOBJS)$(S)$(BUBBLE3DOBJS)$(S)\
+$(MOLECULEOBJS)$(S)$(XLOCKDEPCPPGLOBJS)
+XLOCKNORMGLOBJS = $(DOG)cage$(OG)gears$(O)$(S)\
+$(DOG)moebius$(OG)morph3d$(O)$(S)\
+$(DOG)rubik$(OG)sierpinski3d$(OG)stairs$(OG)superquadrics$(O)$(S)\
+$(XLOCKUNSTABLEGLOBJS)$(S)$(XLOCKUNSTABLETEXTGLOBJS)
+XLOCKMULTGLOBJS = $(DOG)fire$(OG)lament$(OG)sballs$(OG)molecule$(O)$(S)\
+$(DOG)pipes$(OG)sproingies$(OG)atlantis$(OG)bubble3d$(OG)glplanet$(O)$(S)\
+$(XLOCKMULTCPPGLOBJS)
+XLOCKGLOBJS = $(XLOCKNORMGLOBJS)$(S)\
+$(XLOCKDEPGLOBJS)$(S)$(XLOCKMULTGLOBJS)
+#endif
+XCOMM default target
+
+#ifdef Modules
+
+NORMMODULES = $(XLOCKNORMMODEOBJS:.o=.xlk)
+
+MULTMODULES = $(XLOCKMULTMODEOBJS:.o=.xlk)
+
+MODULES = $(NORMMODULES) $(MULTMODULES)
+
+EXTRA_LDOPTIONS += $(MODULEFLAGS)
+
+all:: $(XLOCKMODULES)
+
+InstallMultiple($(MODULES), $(DEF_MODULEPATH))
+
+$(CX)$(O) :
+       $(CXX) -c -o $@ $(CFLAGS) $<
+XCOMM  Sun and gcc
+XCOMM  $(CXX) -c -o $@ -isystem /usr/openwin/include $(CFLAGS) $<
+
+$(NORMMODULES) : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $<
+
+$(DOG)fire.xlk : $(DOG)xpm-ximage.o
+$(DOG)lament.xlk : $(DOG)xpm-ximage.o
+$(DOG)sballs.xlk : $(DOG)xpm-ximage.o
+
+$(DOG)fire.xlk $(DOG)lament.xlk $(DOG)sballs.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(DOG)xpm-ximage.o $<
+
+$(DOG)pipes.xlk : $(DOG)buildlwo.o $(DOG)pipeobjs.o
+
+$(DOG)pipes.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(DOG)buildlwo.o $(DOG)pipeobjs.o $<
+
+$(DOG)sproingies.xlk : $(SPROINGIESOBJS)
+
+$(DOG)sproingies.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(SPROINGIESOBJS) $<
+
+$(DOG)atlantis.xlk : $(ATLANTISOBJS)
+
+$(DOG)atlantis.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(ATLANTISOBJS) $<
+
+
+$(DOG)bubble3d.xlk : $(BUBBLE3DOBJS)
+
+$(DOG)bubble3d.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(BUBBLE3DOBJS) $<
+
+#ifdef CPPCompiler
+
+$(DOG)invert.xlk : $(INVERTOBJS)
+
+$(DOG)invert.xlk : %.xlk:%.o
+       $(RM) $@
+       $(CCLINK) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(INVERTOBJS) $<
+#endif
+
+clean::
+       $(RM) *.xlk .pure
+
+#else
+all:: $(XLOCKGLOBJS)
+#endif
+
+XLOCKINC = -I. -I../.. -I../../xlock
+
+DependTarget()
+LintTarget()
+
+distclean::    clean
+       $(RM) Makefile config.status config.cache config.log config.h
+
+clean.all:: distclean
diff --git a/modes/glx/Makefile.in b/modes/glx/Makefile.in
new file mode 100644 (file)
index 0000000..214df97
--- /dev/null
@@ -0,0 +1,219 @@
+# $Id : Makefile.in 4.16 2000/01/17 $
+#
+# xlockmore Makefile.in for autoconf (UNIX/VMS X11 support)
+############################################################
+
+# @SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@/
+PIXMAPDIR = @PIXMAPDIR@/
+UTILDIR = $(top_srcdir)/xlock/
+MODEDIR = $(top_srcdir)/modes/
+GLDIR = $(top_srcdir)/modes/glx/
+UTILOBJDIR = ../../xlock/
+MODEOBJDIR = ../
+GLOBJDIR = ./
+
+N =
+O = .o
+#O = .obj
+C = .c
+CX = .cc
+S = $(N) $(N)
+#S = ,
+M = .xlk
+
+DU = $(UTILDIR)
+DOU = $(UTILOBJDIR)
+DG = $(GLDIR)
+DOG = $(GLOBJDIR)
+OU = $(O)$(S)$(DOU)
+OG = $(O)$(S)$(DOG)
+CU = $(C) $(DU)
+CG = $(C) $(DG)
+CXG = $(CX) $(DG)
+
+# please define
+# C as the C source code extension
+# CX as the C++ source code extension
+# O as the object extension
+# S as the separator for object code
+
+#@GL@CONSTRUCTIONGLOBJS =
+@UNSTABLE@@GL@XLOCKUNSTABLEGLOBJS = $(DOG)skewb$(O)$(S)$(CONSTRUCTIONGLOBJS)
+@CCC@@GL@INVERTOBJS = $(DOG)i_figureeight$(O)$(S)\
+@CCC@@GL@$(DOG)i_linkage$(OG)i_sphere$(OG)i_spline$(O)$(S)\
+@CCC@@GL@$(DOG)i_threejet$(OG)i_threejetvec$(O)$(S)\
+@CCC@@GL@$(DOG)i_twojet$(OG)i_twojetvec$(O)
+@CCC@@GL@XLOCKDEPCPPGLOBJS = $(INVERTOBJS)
+@CCC@@GL@XLOCKMULTCPPGLOBJS = $(DOG)invert$(O)
+@UNSTABLE@@CCC@@GL@@GLTT@XLOCKUNSTABLETEXTGLOBJS = $(DOG)text3d$(O)
+@GL@SPROINGIESOBJS = $(DOG)buildlwo$(OG)sproingiewrap$(OG)s1_b$(O)$(S)\
+@GL@$(DOG)s1_1$(OG)s1_2$(OG)s1_3$(OG)s1_4$(OG)s1_5$(OG)s1_6$(O)
+@GL@ATLANTISOBJS = $(DOG)dolphin$(OG)shark$(OG)swim$(OG)whale$(O)
+@GL@MOLECULEOBJS = $(DOG)tube$(O)
+@GL@BUBBLE3DOBJS = $(DOG)b_draw$(OG)b_sphere$(OG)b_lockglue$(O)
+@GL@GLPLANETOBJS = $(DOG)sphere$(O)
+@GL@XLOCKDEPGLOBJS = $(DOG)xpm-ximage$(OG)pipeobjs$(O)$(S)\
+@GL@$(SPROINGIESOBJS)$(S)$(ATLANTISOBJS)$(S)$(GLPLANETOBJS)$(S)$(BUBBLE3DOBJS)$(S)\
+@GL@$(MOLECULEOBJS)$(S)$(XLOCKDEPCPPGLOBJS)
+@GL@XLOCKNORMGLOBJS = $(DOG)cage$(OG)gears$(O)$(S)\
+@GL@$(DOG)moebius$(OG)morph3d$(O)$(S)\
+@GL@$(DOG)rubik$(OG)sierpinski3d$(OG)stairs$(OG)superquadrics$(O)$(S)\
+@GL@$(XLOCKUNSTABLEGLOBJS)$(S)$(XLOCKUNSTABLETEXTGLOBJS)
+@GL@XLOCKMULTGLOBJS = $(DOG)fire$(OG)lament$(OG)sballs$(OG)molecule$(O)$(S)\
+@GL@$(DOG)pipes$(OG)sproingies$(OG)atlantis$(OG)bubble3d$(OG)glplanet$(O)$(S)\
+@GL@$(XLOCKMULTCPPGLOBJS)
+XLOCKGLOBJS = $(XLOCKNORMGLOBJS)$(S)\
+$(XLOCKDEPGLOBJS)$(S)$(XLOCKMULTGLOBJS)
+# default target
+all : $(XLOCKGLOBJS)
+
+# this tells GNU make not to export variables into the environment
+# But other makes do not understand its significance, so it must
+# not be the first target in the file. So it is here, before
+# any variables are created, but after the default target
+.NOEXPORT :
+
+SHELL = /bin/sh
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+mandir = @mandir@/man1
+xapploaddir = @APPDEFAULTS@
+
+#CC = cc -g
+#CC = cc -Ac -g
+#CC = cc -Xc -g
+#CC = acc -g
+#CC = CC -g
+#CC = gcc -g -Wall -ansi -pedantic
+#CC = gcc -g -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wstrict-prototypes
+#CC = g++ -g -Wall
+CC = @CC@
+#CXX = g++ -fpermissive
+CXX = @CXX@
+
+#LINT = lint
+LINT = lint -Ncheck=%all
+#LINT = alint
+
+#DEPEND = makedepend
+DEPEND = @DEPEND@
+DEPEND_FLAGS = @DEPEND_FLAGS@
+DEPEND_DEFINES = @DEPEND_DEFINES@
+
+LN_S = @LN_S@
+RM = rm -f
+RM_S = $(RM)
+ECHO = echo
+
+#BLN_S = set file/enter=[]
+#RM = delete/noconfirm/nolog
+#RM_S = set file/remove/nolog
+#ECHO = write sys$output
+
+DEFINES = -DDEF_FILESEARCHPATH=\"$(xapploaddir)/%N%C%S:$(xapploaddir)/%N%S\"
+DEFS = @DEFS@ $(DEFINES)
+XLOCKINC = -I. -I.. -I../.. -I$(UTILDIR) -I../../.. @XLOCKINC@
+CFLAGS = @CFLAGS@
+CXXFLAGS = @CXXFLAGS@
+#CXXFLAGS = $(CPPFLAGS) $(DEFS) $(XLOCKINC) $(CFLAGS) # Why ???? The rule doesn't
+#CFLAGS = -O
+#CFLAGS = -g
+
+#If you have purify, and want to use it, uncomment this definition or
+# run the make as `make PURIFY=purify'
+# or run configure with the --with-purify argument.
+PURIFY = @PURIFY@
+
+.SUFFIXES : $(C) $(CX) $(O)
+
+$(C)$(O) :
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEFS) $(XLOCKINC) $(CFLAGS) $<
+
+$(CX)$(O) :
+       $(CXX) -c -o $@ $(CPPFLAGS) $(DEFS) $(XLOCKINC) $(CXXFLAGS) $<
+
+install :
+
+install-program :
+
+install-man :
+
+install-ad :
+
+uninstall :
+
+uninstall-program :
+
+uninstall-man :
+
+uninstall-ad :
+
+install.program : install-program
+
+install.man : install-man
+
+install.ad : install-ad
+
+uninstall.program : uninstall-program
+
+uninstall.man : uninstall-man
+
+uninstall.ad : uninstall-ad
+
+lint :
+
+xrdb :
+
+man :
+
+html :
+
+hlp :
+
+clean :
+       $(RM) *.o *.xlk core *~ *% *.bak *.orig *.rej make.log MakeOut *.patch .pure
+
+distclean : clean
+       $(RM) Makefile
+
+clean.all : distclean
+
+# Adds all current dependencies to Makefile
+depend :
+       $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
+       $(DEPEND_FLAGS) --                                                  \
+       $(XLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                  \
+       $(XLOCKGLSRCS)
+
+# Adds some dependencies to Makefile.in -- not totally accurate, but pretty
+# close.  This excludes dependencies on files in /usr/include, etc.  It tries
+# to include only dependencies on files which are themselves a part of this
+# package.
+distdepend :
+       @echo updating dependencies in `pwd`/Makefile.in... ;               \
+       $(DEPEND) -w 0 -f -                                                 \
+       -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
+       $(XLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                  \
+       $(XLOCKGLSRCS) |                                                    \
+       (                                                                   \
+         awk '/^#.*Id : Makefile.in/,/^# DO .*distdepend/' < Makefile.in ; \
+         sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
+             -e 's@^\.\./\.\./modes/glx@$$(GLOBJDIR)@'                     \
+             -e 's@\.\./\.\./pixmaps@$$(PIXMAPDIR)@g'                      \
+             -e 's@\.\./\.\./xlock@$$(UTILDIR)@g' ;                        \
+         echo ''                                                           \
+       ) > /tmp/distdepend.$$$$ &&                                         \
+       mv Makefile.in Makefile.in.bak &&                                   \
+       mv /tmp/distdepend.$$$$ Makefile.in
+
+##############################################################################
+#
+# DO NOT DELETE: updated by make distdepend
+
diff --git a/modes/glx/atlantis.c b/modes/glx/atlantis.c
new file mode 100644 (file)
index 0000000..52ecf32
--- /dev/null
@@ -0,0 +1,536 @@
+/* atlantis --- Shows moving 3D sea animals */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)atlantis.c   5.01 2001/04/17 xlockmore";
+
+#endif
+
+/* Copyright (c) E. Lassauge, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by Mark J. Kilgard
+ * as a demo for openGL programming.
+ *
+ * Porting it to xlock  was possible by comparing the original Mesa's morph3d
+ * demo with it's ported version to xlock, so thanks for Marcelo F. Vianna
+ * (look at morph3d.c) for his indirect help.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * My e-mail address is lassauge@mail.dotcom.fr
+ *
+ * Eric Lassauge  (May-13-1998)
+ *
+ * REVISION HISTORY:
+ *
+ * Jamie Zawinski, 2-Apr-01:  - The fishies were inside out!  The back faces
+ *                              were being drawn, not the front faces.
+ *                            - Added a texture to simulate light from the
+ *                              surface, like in the SGI version.
+ * 
+ * E.Lassauge - 01/03/01 : Added FPS stuff
+ *
+ * David A. Bagley - 98/06/17 : Add whalespeed option. Global options to
+ *                              initialize local variables are now:
+ *                              XLock.atlantis.cycles: 100      ! SharkSpeed
+ *                              XLock.atlantis.batchcount: 4    ! SharkNum
+ *                              XLock.atlantis.whalespeed: 250  ! WhaleSpeed
+ *                              XLock.atlantis.size: 6000       ! SharkSize
+ *                              Add random direction for whales/dolphins
+ *
+ * E.Lassauge - 98/06/16: Use the following global options to initialize
+ *                        local variables :
+ *                              XLock.atlantis.delay: 100       ! SharkSpeed
+ *                              XLock.atlantis.batchcount: 4    ! SharkNum
+ *                              XLock.atlantis.cycles: 250      ! WhaleSpeed
+ *                              XLock.atlantis.size: 6000       ! SharkSize
+ *                        Add support for -/+ wireframe (t'was so easy to do!)
+ *
+ * TODO :
+ *        - add a sort of background image
+ *        - better handling of sizes and speeds
+ *        - test standalone and module modes
+ *        - purify it (!)
+ */
+
+/* Copyright (c) Mark J. Kilgard, 1994. */
+
+/**
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Atlantis"
+#define HACK_INIT init_atlantis
+#define HACK_DRAW draw_atlantis
+#define atlantis_opts xlockmore_opts
+#define DEFAULTS "*delay: 18000 \n" \
+ "*count: 4 \n" \
+ "*cycles: 100 \n" \
+ "*size: 6000 \n" \
+ "*showFps:    False \n" \
+ "*wireframe:  False \n" \
+ "*whalespeed: 250\n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_atlantis
+
+#include "atlantis.h"
+#include <GL/glu.h>
+#include "xpm-ximage.h"
+
+#ifdef STANDALONE
+#include "../images/sea-texture.xpm"
+#else /* !STANDALONE */
+#include "pixmaps/sea-texture.xpm"
+#endif /* !STANDALONE */
+
+#define DEF_WHALESPEED  "250"
+#define DEF_TEXTURE     "True"
+
+static int  whalespeed;
+static int  do_texture;
+
+static XrmOptionDescRec opts[] =
+{
+     {(char *) "-whalespeed", (char *) ".atlantis.whalespeed", XrmoptionSepArg, (caddr_t) NULL},
+     {(char *) "-texture",    (char *) ".atlantis.texture",    XrmoptionNoArg, (caddr_t)"True"},
+     {(char *) "+texture",    (char *) ".atlantis.texture",    XrmoptionNoArg, (caddr_t)"False"},
+};
+
+static argtype vars[] =
+{
+ {(caddr_t *) & whalespeed, (char *) "whalespeed", (char *) "WhaleSpeed", (char *) DEF_WHALESPEED, t_Int},
+ {(caddr_t *) & do_texture, (char *) "texture",    (char *) "Texture",    (char *) DEF_TEXTURE,    t_Bool},
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-whalespeed num", (char *) "speed of whales and the dolphin"},
+       {(char *) "-texture num",    (char *) "whether to introduce water-like distortion"},
+};
+
+ModeSpecOpt atlantis_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   atlantis_description =
+{"atlantis", "init_atlantis", "draw_atlantis", "release_atlantis",
+ "refresh_atlantis", "change_atlantis", NULL, &atlantis_opts,
+ 18000, NUM_SHARKS, SHARKSPEED, SHARKSIZE, 64, 1.0, "",
+ "Shows moving sharks/whales/dolphin", 0, NULL};
+
+#endif
+
+static atlantisstruct *atlantis = (atlantisstruct *) NULL;
+
+static void
+parse_image_data(ModeInfo *mi)
+{
+  atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
+  ap->texture = xpm_to_ximage (MI_DISPLAY(mi),
+                               MI_VISUAL(mi),
+                               MI_COLORMAP(mi),
+                               sea_texture);
+}
+
+static void
+InitFishs(atlantisstruct * ap)
+{
+       int         i;
+
+       for (i = 0; i < ap->num_sharks; i++) {
+               ap->sharks[i].x = 70000.0 + NRAND(ap->sharksize);
+               ap->sharks[i].y = NRAND(ap->sharksize);
+               ap->sharks[i].z = NRAND(ap->sharksize);
+               ap->sharks[i].psi = NRAND(360) - 180.0;
+               ap->sharks[i].v = 1.0;
+       }
+
+       /* Random whae direction */
+       ap->whaledir = LRAND() & 1;
+
+       ap->dolph.x = 30000.0;
+       ap->dolph.y = 0.0;
+       ap->dolph.z = (float) (ap->sharksize);
+       ap->dolph.psi = (ap->whaledir) ? 90.0 : -90.0;
+       ap->dolph.theta = 0.0;
+       ap->dolph.v = 6.0;
+
+       ap->momWhale.x = 70000.0;
+       ap->momWhale.y = 0.0;
+       ap->momWhale.z = 0.0;
+       ap->momWhale.psi = (ap->whaledir) ? 90.0 : -90.0;
+       ap->momWhale.theta = 0.0;
+       ap->momWhale.v = 3.0;
+
+       ap->babyWhale.x = 60000.0;
+       ap->babyWhale.y = -2000.0;
+       ap->babyWhale.z = -2000.0;
+       ap->babyWhale.psi = (ap->whaledir) ? 90.0 : -90.0;
+       ap->babyWhale.theta = 0.0;
+       ap->babyWhale.v = 3.0;
+}
+
+static void
+Init(ModeInfo * mi)
+{
+        atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
+
+       static float ambient[] =
+       {0.1, 0.1, 0.1, 1.0};
+       static float diffuse[] =
+       {1.0, 1.0, 1.0, 1.0};
+       static float position[] =
+       {0.0, 1.0, 0.0, 0.0};
+       static float mat_shininess[] =
+       {90.0};
+       static float mat_specular[] =
+       {0.8, 0.8, 0.8, 1.0};
+       static float mat_diffuse[] =
+       {0.46, 0.66, 0.795, 1.0};
+       static float mat_ambient[] =
+       {0.0, 0.1, 0.2, 1.0};
+       static float lmodel_ambient[] =
+       {0.4, 0.4, 0.4, 1.0};
+       static float lmodel_localviewer[] =
+       {0.0};
+       float       fblue = 0.0, fgreen;
+
+       glFrontFace(GL_CCW);
+
+        if (ap->wire)
+          {
+            glDisable(GL_DEPTH_TEST);
+            glDisable(GL_CULL_FACE);
+            glDisable(GL_LIGHTING);
+            glDisable(GL_NORMALIZE);
+          }
+        else
+          {
+            glDepthFunc(GL_LEQUAL);
+            glEnable(GL_DEPTH_TEST);
+            glEnable(GL_CULL_FACE);
+            glEnable(GL_NORMALIZE);
+            glShadeModel(GL_SMOOTH);
+
+            glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+            glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+            glLightfv(GL_LIGHT0, GL_POSITION, position);
+            glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+            glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_localviewer);
+            glEnable(GL_LIGHTING);
+            glEnable(GL_LIGHT0);
+
+            glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
+            glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
+            glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse);
+            glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient);
+          }
+
+        if (ap->wire || !do_texture)
+          {
+            glDisable(GL_TEXTURE_2D);
+          }
+        else
+          {
+            GLfloat s_plane[] = { 1, 0, 0, 0 };
+            GLfloat t_plane[] = { 0, 0, 1, 0 };
+            GLfloat scale = 0.0005;
+
+            if (!ap->texture)
+              parse_image_data (mi);
+
+            clear_gl_error();
+            glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                         ap->texture->width, ap->texture->height, 0,
+                         GL_RGBA, GL_UNSIGNED_BYTE,
+                         ap->texture->data);
+            check_gl_error("texture");
+
+            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+            glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+            glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+            glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+            glTexGenfv(GL_S, GL_EYE_PLANE, s_plane);
+            glTexGenfv(GL_T, GL_EYE_PLANE, t_plane);
+
+            glEnable(GL_TEXTURE_GEN_S);
+            glEnable(GL_TEXTURE_GEN_T);
+            glEnable(GL_TEXTURE_2D);
+
+            glMatrixMode(GL_TEXTURE);
+            glLoadIdentity();
+            glScalef(scale, scale, 1);
+            glMatrixMode(GL_MODELVIEW);
+          }
+
+       InitFishs(ap);
+
+       /* Add a little randomness */
+       fblue = ((float) (NRAND(50)) / 100.0) + 0.50;
+       fgreen = fblue * 0.56;
+       glClearColor(0.0, fgreen, fblue, 0.0);
+}
+
+static void
+Reshape(ModeInfo * mi, int width, int height)
+{
+       atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
+
+       glViewport(0, 0, ap->WinW = (GLint) width, ap->WinH = (GLint) height);
+
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       gluPerspective(400.0, (GLdouble) width / (GLdouble) height, 1.0, 2000000.0);
+       glMatrixMode(GL_MODELVIEW);
+}
+
+static void
+Animate(atlantisstruct * ap)
+{
+       int         i;
+
+       for (i = 0; i < ap->num_sharks; i++) {
+               SharkPilot(&(ap->sharks[i]), ap->sharkspeed);
+               SharkMiss(ap, i);
+       }
+       WhalePilot(&(ap->dolph), ap->whalespeed, ap->whaledir);
+       ap->dolph.phi++;
+       WhalePilot(&(ap->momWhale), ap->whalespeed, ap->whaledir);
+       ap->momWhale.phi++;
+       WhalePilot(&(ap->babyWhale), ap->whalespeed, ap->whaledir);
+       ap->babyWhale.phi++;
+}
+
+static void
+AllDisplay(atlantisstruct * ap)
+{
+       int         i;
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       for (i = 0; i < ap->num_sharks; i++) {
+               glPushMatrix();
+               FishTransform(&(ap->sharks[i]));
+               DrawShark(&(ap->sharks[i]), ap->wire);
+               glPopMatrix();
+       }
+
+       glPushMatrix();
+       FishTransform(&(ap->dolph));
+       DrawDolphin(&(ap->dolph), ap->wire);
+       glPopMatrix();
+
+       glPushMatrix();
+       FishTransform(&(ap->momWhale));
+       DrawWhale(&(ap->momWhale), ap->wire);
+       glPopMatrix();
+
+       glPushMatrix();
+       FishTransform(&(ap->babyWhale));
+       glScalef(0.45, 0.45, 0.3);
+       DrawWhale(&(ap->babyWhale), ap->wire);
+       glPopMatrix();
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Xlock hooks.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Initialize atlantis.  Called each time the window changes.
+ *-----------------------------------------------------------------------------
+ */
+
+void
+init_atlantis(ModeInfo * mi)
+{
+       int         screen = MI_SCREEN(mi);
+       atlantisstruct *ap;
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+
+       if (atlantis == NULL) {
+               if ((atlantis = (atlantisstruct *) calloc(MI_NUM_SCREENS(mi),
+                                          sizeof (atlantisstruct))) == NULL)
+                       return;
+       }
+       ap = &atlantis[screen];
+       ap->num_sharks = MI_COUNT(mi);
+       if (ap->sharks == NULL) {
+               if ((ap->sharks = (fishRec *) calloc(ap->num_sharks,
+                                               sizeof (fishRec))) == NULL) {
+                       /* free everything up to now */
+                       (void) free((void *) atlantis);
+                       atlantis = (atlantisstruct *) NULL;
+                       return;
+               }
+       }
+       ap->sharkspeed = MI_CYCLES(mi);         /* has influence on the "width"
+                                                  of the movement */
+       ap->sharksize = MI_SIZE(mi)?MI_SIZE(mi):SHARKSIZE;      /* has influence on the "distance"
+                                                                  of the sharks */
+       ap->whalespeed = whalespeed;
+       ap->wire = MI_IS_WIREFRAME(mi);
+
+       if (MI_IS_DEBUG(mi)) {
+               (void) fprintf(stderr,
+                              "%s:\n\tnum_sharks=%d\n\tsharkspeed=%.1f\n\tsharksize=%d\n\twhalespeed=%.1f\n\twireframe=%s\n",
+                              MI_NAME(mi),
+                              ap->num_sharks,
+                              ap->sharkspeed,
+                              ap->sharksize,
+                              ap->whalespeed,
+                              ap->wire ? "yes" : "no"
+                       );
+       }
+       if ((ap->glx_context = init_GL(mi)) != NULL) {
+
+               Reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               glDrawBuffer(GL_BACK);
+               Init(mi);
+               AllDisplay(ap);
+               glXSwapBuffers(display, window);
+
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Called by the mainline code periodically to update the display.
+ *-----------------------------------------------------------------------------
+ */
+void
+draw_atlantis(ModeInfo * mi)
+{
+       atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
+
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (!ap->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(ap->glx_context));
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       AllDisplay(ap);
+       Animate(ap);
+       if (MI_IS_FPS(mi)) do_fps (mi);
+       glXSwapBuffers(display, window);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    The display is being taken away from us.  Free up malloc'ed
+ *      memory and X resources that we've alloc'ed.  Only called
+ *      once, we must zap everything for every screen.
+ *-----------------------------------------------------------------------------
+ */
+
+void
+release_atlantis(ModeInfo * mi)
+{
+       int         screen;
+
+       if (atlantis != NULL) {
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       atlantisstruct *ap = &atlantis[screen];
+
+                       if (ap->sharks)
+                               (void) free((void *) ap->sharks);
+                       if (ap->texture)
+                       {
+                               XDestroyImage(ap->texture);
+                       }
+               }
+               (void) free((void *) atlantis);
+               atlantis = (atlantisstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+void
+refresh_atlantis(ModeInfo * mi)
+{
+}
+
+void
+change_atlantis(ModeInfo * mi)
+{
+       atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
+
+       if (!ap->glx_context)
+               return;
+
+       glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(ap->glx_context));
+       Init(mi);
+}
+
+#endif /* MODE_atlantis */
diff --git a/modes/glx/atlantis.h b/modes/glx/atlantis.h
new file mode 100644 (file)
index 0000000..58f8915
--- /dev/null
@@ -0,0 +1,116 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident       "@(#)atlantis.h 5.01 2001/04/17 xlockmore" */
+
+#endif
+
+/*-
+ * atlantis stuff --- Shows moving 3D sea animals
+ *
+ * Copyright (c) E. Lassauge, 1998.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by Mark J. Kilgard
+ * as a demo for openGL programming.
+ * 
+ * Porting it to xlock  was possible by comparing the original Mesa's morph3d 
+ * demo with it's ported version to xlock, so thanks for Marcelo F. Vianna 
+ * (look at morph3d.c) for his indirect help.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * My e-mail address is lassauge@mail.dotcom.fr
+ *
+ * Eric Lassauge  (May-13-1998)
+ *
+ */
+
+/**
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+#include <GL/gl.h>
+#include <GL/glx.h>
+
+#define RAD 57.295
+#define RRAD 0.01745
+
+/* default values */
+#define NUM_SHARKS 4
+#define SHARKSPEED 100
+#define SHARKSIZE 6000
+
+typedef struct _fishRec {
+       float       x, y, z, phi, theta, psi, v;
+       float       xt, yt, zt;
+       float       htail, vtail;
+       float       dtheta;
+       int         spurt, attack;
+} fishRec;
+
+typedef struct {
+       GLint       WinH, WinW;
+       GLXContext *glx_context;
+       int         num_sharks;
+       float       sharkspeed, whalespeed;
+       int         sharksize;
+       int         wire;
+       Bool        whaledir;
+       fishRec    *sharks;
+       fishRec     momWhale;
+       fishRec     babyWhale;
+       fishRec     dolph;
+
+        XImage     *texture;      /* water distortion overlay bits */
+} atlantisstruct;
+
+extern void FishTransform(fishRec *);
+extern void WhalePilot(fishRec *, float, Bool);
+extern void SharkPilot(fishRec *, float);
+extern void SharkMiss(atlantisstruct *, int);
+extern void DrawWhale(fishRec *, int);
+extern void DrawShark(fishRec *, int);
+extern void DrawDolphin(fishRec *, int);
diff --git a/modes/glx/b_draw.c b/modes/glx/b_draw.c
new file mode 100644 (file)
index 0000000..359318e
--- /dev/null
@@ -0,0 +1,260 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)b_draw.c  4.11 98/06/16 xlockmore";
+
+#endif
+
+/*-
+ * BUBBLE3D (C) 1998 Richard W.M. Jones.
+ * b_draw.c: This code creates new bubbles, manages them and controls
+ * them as they are drawn on the screen.
+ */
+
+#include "bubble3d.h"
+
+typedef struct draw_context {
+       /* The list of bubbles currently on the screen. */
+       void      **bubble_list;
+       int         nr_bubbles;
+
+       /* When was the last time we created a new bubble? */
+       int         bubble_count;
+} draw_context;
+
+void       *
+glb_draw_init(void)
+{
+       draw_context *c;
+
+       GLfloat     mat_specular[] =
+       {1, 1, 1, 1};
+       GLfloat     mat_emission[] =
+       {0, 0, 0, 1};
+       GLfloat     mat_shininess[] =
+       {100};
+       GLfloat     ambient[] =
+       {0.5, 0.5, 0.5, 1.0};
+       GLfloat     light_position[][4] =
+       {
+               {0, -1, 0, 0},
+               {1, 1, 0, 0},
+               {-1, 0, 1, 0}};
+       GLfloat     light_diffuse[][4] =
+       {
+               {1, 1, 1, 1},
+               {1, 1, 1, 1},
+               {1, 1, 1, 1}};
+       GLfloat     light_specular[][4] =
+       {
+               {1, 1, 1, 1},
+               {1, 1, 1, 1},
+               {1, 1, 1, 1}};
+
+       /* Initialize the context. */
+       c = (struct draw_context *) malloc(sizeof (struct draw_context));
+
+       if (c == 0)
+               return 0;
+       c->bubble_list = 0;
+       c->nr_bubbles = 0;
+       c->bubble_count = glb_config.create_bubbles_every;
+
+       /* Do some GL initialization. */
+       glClearColor(glb_config.bg_colour[0],
+                    glb_config.bg_colour[1],
+                    glb_config.bg_colour[2],
+                    glb_config.bg_colour[3]);
+#if 0
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, glb_config.bubble_colour);
+#else
+       {
+               /*
+                * E. Lassauge - 98/06/29
+                * Yeahh, cool ! Now that I know how to have random colors I
+                * patch this pretty beautiful mode too !!
+                */
+               GLfloat     fred, fgreen, fblue;
+               GLfloat     params[4];
+
+               fred = ((float) (NRAND(100)) / 100.0);
+               fgreen = ((float) (NRAND(100)) / 100.0);
+               /* I keep more blue */
+               fblue = ((float) (NRAND(50)) / 100.0) + 0.50;
+
+               params[0] = fred;
+               params[1] = fgreen;
+               params[2] = fblue;
+               /* For the moment don't play with ALPHA channel */
+               params[3] = glb_config.bubble_colour[3];
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, params);
+       }
+#endif
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, mat_emission);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
+
+#if GLB_USE_BLENDING
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+#endif
+
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_LIGHT2);
+#if GLB_USE_BLENDING
+       glEnable(GL_BLEND);
+#else
+       glEnable(GL_DEPTH_TEST);
+#endif
+       glEnable(GL_AUTO_NORMAL);
+       glEnable(GL_NORMALIZE);
+
+#if GLB_USE_BLENDING
+       glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
+#endif
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT0, GL_POSITION, light_position[0]);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse[0]);
+       glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular[0]);
+       glLightfv(GL_LIGHT1, GL_POSITION, light_position[1]);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse[1]);
+       glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular[1]);
+       glLightfv(GL_LIGHT2, GL_POSITION, light_position[2]);
+       glLightfv(GL_LIGHT2, GL_DIFFUSE, light_diffuse[2]);
+       glLightfv(GL_LIGHT2, GL_SPECULAR, light_specular[2]);
+
+       return c;
+}
+
+static void
+delete_bubble(draw_context * c, int j)
+{
+       int         i;
+
+       glb_bubble_delete(c->bubble_list[j]);
+
+       for (i = j; i < c->nr_bubbles - 1; ++i)
+               c->bubble_list[i] = c->bubble_list[i + 1];
+
+       c->nr_bubbles--;
+}
+
+void
+glb_draw_end(void *cc)
+{
+       draw_context *c = (draw_context *) cc;
+       int         i;
+
+       for (i = 0; i < c->nr_bubbles; ++i) {
+               delete_bubble(c, i);
+               i--;
+       }
+       (void) free((void *) c->bubble_list);
+       (void) free((void *) c);
+}
+
+static int
+create_new_bubbles(draw_context * c)
+{
+       int         n, i;
+       double      r = glb_drand();
+       GLfloat     size, speed, scale_incr, x, y, z;
+       void       *b[4];
+       void      **old_bubble_list;
+
+       /* How many bubbles to make? */
+       if (r < glb_config.p_bubble_group[0])
+               n = 1;
+       else if (r < glb_config.p_bubble_group[1])
+               n = 2;
+       else if (r < glb_config.p_bubble_group[2])
+               n = 3;
+       else
+               n = 4;
+
+       /* Initial position of top-most bubble in group. */
+       x = glb_drand() * 4 - 2;
+       y = glb_config.screen_bottom;
+       z = glb_drand() * 2 - 2;
+
+       /* What size? */
+       size = glb_config.min_size
+               + glb_drand() * (glb_config.max_size - glb_config.min_size);
+
+       /* What speed? */
+       speed = glb_config.min_speed
+               + glb_drand() * (glb_config.max_speed - glb_config.min_speed);
+
+       /* Work out the scaling increment. Bubbles should increase by scale_factor
+        * as they go from bottom to top of screen.
+        */
+       scale_incr = (size * glb_config.scale_factor - size)
+               / ((glb_config.screen_top - glb_config.screen_bottom) / speed);
+
+       /* Create the bubble(s). */
+       for (i = 0; i < n; ++i) {
+               if ((b[i] = glb_bubble_new(x, y, z, size, speed, scale_incr)) == 0) {
+                       /* Out of memory - recover. */
+                       i--;
+                       while (i >= 0)
+                               glb_bubble_delete(b[i]);
+                       return 0;
+               }
+               /* Create the next bubble below the last bubble. */
+               y -= size * 3;
+       }
+
+       /* Add the bubbles to the list. */
+       c->nr_bubbles += n;
+       old_bubble_list = c->bubble_list;
+       if (c->bubble_list == 0) {
+               c->bubble_list = (void **) malloc(c->nr_bubbles * sizeof (void *));
+       } else {
+               c->bubble_list = (void **) realloc(c->bubble_list,
+                                           c->nr_bubbles * sizeof (void *));
+       }
+
+       if (c->bubble_list == 0) {
+               /* Out of memory - recover. */
+               for (i = 0; i < n; ++i)
+                       glb_bubble_delete(b[i]);
+               c->bubble_list = old_bubble_list;
+               c->nr_bubbles -= n;
+               return 0;
+       }
+       for (i = 0; i < n; ++i)
+               c->bubble_list[c->nr_bubbles - i - 1] = b[i];
+
+       return 1;
+}
+
+void
+glb_draw_step(void *cc)
+{
+       draw_context *c = (draw_context *) cc;
+       int         i;
+
+       /* Consider creating a new bubble or bubbles. */
+       if (c->nr_bubbles < glb_config.max_bubbles &&
+           c->bubble_count++ > glb_config.create_bubbles_every) {
+               if (create_new_bubbles(c))
+                       c->bubble_count = 0;
+       }
+       /* Clear the display. */
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       /* XXX Draw the background here ... */
+
+       /* Draw all the bubbles on the display. */
+       for (i = 0; i < c->nr_bubbles; ++i) {
+               void       *b = c->bubble_list[i];
+
+               glb_bubble_step(b);
+               glb_bubble_draw(b);
+
+               /* Has the bubble reached the top of the screen? */
+               if (glb_bubble_get_y(b) >= glb_config.screen_top) {
+                       delete_bubble(c, i);
+                       i--;
+               }
+       }
+}
diff --git a/modes/glx/b_lockglue.c b/modes/glx/b_lockglue.c
new file mode 100644 (file)
index 0000000..047ce26
--- /dev/null
@@ -0,0 +1,189 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)b_lockglue.c  5.01 2001/03/01 xlockmore";
+
+#endif
+
+/*-
+ * BUBBLE3D (C) 1998 Richard W.M. Jones.
+ * b_lockglue.c: Glue to make this all work with xlockmore.
+ *
+ * Revision History:
+ * 01-Mar-2001: Added FPS stuff - Eric Lassauge <lassauge@mail.dotcom.fr>
+ *
+ */
+
+#include "bubble3d.h"
+
+/* XXX This lot should eventually be made configurable using the
+ * options stuff below.
+ */
+struct glb_config glb_config =
+{
+#if GLB_SLOW_GL
+       2,                      /* subdivision_depth */
+#else
+       3,                      /* subdivision_depth */
+#endif
+       5,                      /* nr_nudge_axes */
+       0.3,                    /* nudge_angle_factor */
+       0.15,                   /* nudge_factor */
+       0.1,                    /* rotation_factor */
+       8,                      /* create_bubbles_every */
+       8,                      /* max_bubbles */
+       {0.7, 0.8, 0.9, 1.0},   /* p_bubble_group */
+       0.5,                    /* max_size */
+       0.1,                    /* min_size */
+       0.1,                    /* max_speed */
+       0.03,                   /* min_speed */
+       1.5,                    /* scale_factor */
+       -4,                     /* screen_bottom */
+       4,                      /* screen_top */
+#if 1
+       {0.1, 0.0, 0.4, 0.0},   /* bg_colour */
+#else
+       {0.0, 0.0, 0.0, 0.0},   /* bg_colour */
+#endif
+#if 0
+       {0.7, 0.7, 0.0, 0.3}    /* bubble_colour */
+#else
+       {0.0, 0.0, 0.7, 0.3}    /* bubble_colour */
+#endif
+};
+
+#ifdef STANDALONE
+#define PROGCLASS "Bubble3D"
+#define HACK_INIT init_bubble3d
+#define HACK_DRAW draw_bubble3d
+#define bubble3d_opts xlockmore_opts
+#include "xlockmore.h"
+#else
+#include "xlock.h"
+#include "vis.h"
+#endif
+
+#ifdef MODE_bubble3d
+
+ModeSpecOpt bubble3d_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   bubble3d_description =
+{(char *) "bubble3d", (char *) "init_bubble3d",
+ (char *) "draw_bubble3d", (char *) "release_bubble3d",
+ (char *) "draw_bubble3d", (char *) "change_bubble3d",
+ NULL, &bubble3d_opts,
+ 1000, 1, 2, 1, 64, 1.0, (char *) "",
+ (char *) "Richard Jones's GL bubbles", 0, NULL};
+
+#endif /* USE_MODULES */
+
+struct context {
+       GLXContext *glx_context;
+       void       *draw_context;
+};
+
+static struct context *contexts = 0;
+
+static void
+init(struct context *c)
+{
+       glb_sphere_init();
+       c->draw_context = glb_draw_init();
+}
+
+static void
+reshape(int w, int h)
+{
+       glViewport(0, 0, (GLsizei) w, (GLsizei) h);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       gluPerspective(45, (GLdouble) w / (GLdouble) h, 3, 8);
+       glMatrixMode(GL_MODELVIEW);
+       glLoadIdentity();
+       glTranslatef(0, 0, -5);
+}
+
+static void
+do_display(struct context *c)
+{
+       glb_draw_step(c->draw_context);
+}
+
+void
+init_bubble3d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       struct context *c;
+
+       if (contexts == NULL) {
+               if ((contexts = (struct context *) malloc(sizeof (struct context) *
+                               MI_NUM_SCREENS(mi))) == NULL)
+                       return;
+       }
+       c = &contexts[MI_SCREEN(mi)];
+       if ((c->glx_context = init_GL(mi)) != NULL) {
+               init(c);
+               reshape(MI_WIDTH(mi), MI_HEIGHT(mi));
+               do_display(c);
+               glFinish();
+               glXSwapBuffers(display, window);
+       } else
+               MI_CLEARWINDOW(mi);
+}
+
+void
+draw_bubble3d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       struct context *c;
+
+       if (contexts == NULL)
+               return;
+       c = &contexts[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (!c->glx_context)
+               return;
+
+       glDrawBuffer(GL_BACK);
+       glXMakeCurrent(display, window, *(c->glx_context));
+
+       do_display(c);
+
+       if (MI_IS_FPS(mi)) do_fps (mi);
+       glFinish();
+       glXSwapBuffers(display, window);
+}
+
+void
+change_bubble3d(ModeInfo * mi)
+{
+       /* nothing */
+}
+
+void
+release_bubble3d(ModeInfo * mi)
+{
+
+       if (contexts != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       struct context *c = &contexts[screen];
+
+                       if (c->glx_context) {
+                               glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(c->glx_context));
+                               if (c->draw_context) {
+                                       glb_draw_end(c->draw_context);
+                               }
+                       }
+               }
+               (void) free((void *) contexts);
+               contexts = (struct context *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+#endif /* MODE_bubble3d */
diff --git a/modes/glx/b_sphere.c b/modes/glx/b_sphere.c
new file mode 100644 (file)
index 0000000..e3433e3
--- /dev/null
@@ -0,0 +1,231 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)b_sphere.c  4.11 98/06/16 xlockmore";
+
+#endif
+
+/*-
+ * BUBBLE3D (C) 1998 Richard W.M. Jones.
+ * b_sphere.c: Create a list of vertices and triangles in a
+ * normalized sphere, which is then later used as the basic shape
+ * for all bubbles. This code is run once when the program starts
+ * up.
+ */
+
+#include "bubble3d.h"
+
+/* The list of vertices created. */
+typedef glb_vertex vertex;
+static vertex *vertices = 0;
+static int  nr_vertices = 0, nr_vertices_allocated = 0;
+
+/* The list of triangles created. */
+typedef glb_triangle triangle;
+static triangle *triangles = 0;
+static int  nr_triangles = 0, nr_triangles_allocated = 0;
+
+/* Have we initialized the lists yet? */
+static int  initialized = 0;
+
+#define EPSILON GLB_VERTICES_EPSILON
+
+/* Should be taken care of already... but just in case */
+#if !defined( __GNUC__ ) && !defined(__cplusplus) && !defined(c_plusplus)
+#undef inline
+#define inline                 /* */
+#endif
+static inline int
+close_enough(GLfloat * v1, GLfloat * v2)
+{
+       return fabs((double) (v1[0] - v2[0])) <= EPSILON &&
+               fabs((double) (v1[1] - v2[1])) <= EPSILON &&
+               fabs((double) (v1[2] - v2[2])) <= EPSILON;
+}
+
+#define INCR(n) ((n == 0) ? (n = 1) : (n *= 2))
+#define INCR_ALLOCATION(a, n, t) (a = (t *) realloc (a, INCR (n) * sizeof (t)))
+
+static inline GLuint
+save_vertex(GLfloat * v)
+{
+       int         i;
+
+       /* Inefficient, but we only do this a few times. Check to see if there's
+        * an existing vertex which is `close enough' to this one.
+        */
+       for (i = 0; i < nr_vertices; ++i)
+               if (close_enough(v, vertices[i]))
+                       return i;
+
+       if (nr_vertices_allocated <= nr_vertices) {
+               if (vertices == 0) {
+                       vertices = (vertex *) malloc(INCR(nr_vertices_allocated) * sizeof (vertex));
+               } else {
+                       INCR_ALLOCATION(vertices, nr_vertices_allocated, vertex);
+               }
+       }
+       vertices[nr_vertices][0] = v[0];
+       vertices[nr_vertices][1] = v[1];
+       vertices[nr_vertices][2] = v[2];
+       return nr_vertices++;
+}
+
+static inline GLuint
+save_triangle(GLuint v1, GLuint v2, GLuint v3)
+{
+       if (nr_triangles_allocated <= nr_triangles) {
+               if (triangles == 0) {
+                       triangles = (triangle *) malloc(INCR(nr_triangles_allocated) * sizeof (triangle));
+               } else {
+                       INCR_ALLOCATION(triangles, nr_triangles_allocated, triangle);
+               }
+       }
+       triangles[nr_triangles][0] = v1;
+       triangles[nr_triangles][1] = v2;
+       triangles[nr_triangles][2] = v3;
+       return nr_triangles++;
+}
+
+static inline void
+normalize(GLfloat v[3])
+{
+       GLfloat     d = (GLfloat) sqrt((double) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]));
+
+       if (d != 0) {
+               v[0] /= d;
+               v[1] /= d;
+               v[2] /= d;
+       } else {
+               v[0] = v[1] = v[2] = 0;
+       }
+}
+
+static void
+subdivide(GLfloat * v1, GLuint vi1,
+         GLfloat * v2, GLuint vi2,
+         GLfloat * v3, GLuint vi3,
+         int depth)
+{
+       int         i;
+
+       if (depth == 0) {
+               (void) save_triangle(vi1, vi2, vi3);
+       } else {
+               GLuint      vi12, vi23, vi31;
+               GLfloat     v12[3], v23[3], v31[3];
+
+               for (i = 0; i < 3; ++i) {
+                       v12[i] = v1[i] + v2[i];
+                       v23[i] = v2[i] + v3[i];
+                       v31[i] = v3[i] + v1[i];
+               }
+               normalize(v12);
+               vi12 = save_vertex(v12);
+               normalize(v23);
+               vi23 = save_vertex(v23);
+               normalize(v31);
+               vi31 = save_vertex(v31);
+               subdivide(v1, vi1, v12, vi12, v31, vi31, depth - 1);
+               subdivide(v2, vi2, v23, vi23, v12, vi12, depth - 1);
+               subdivide(v3, vi3, v31, vi31, v23, vi23, depth - 1);
+               subdivide(v12, vi12, v23, vi23, v31, vi31, depth - 1);
+       }
+}
+
+#define ICO_X 0.525731112119133606
+#define ICO_Z 0.850650808352039932
+
+static GLfloat vdata[12][3] =
+{
+       {-ICO_X, 0, ICO_Z},
+       {ICO_X, 0, ICO_Z},
+       {-ICO_X, 0, -ICO_Z},
+       {ICO_X, 0, -ICO_Z},
+       {0, ICO_Z, ICO_X},
+       {0, ICO_Z, -ICO_X},
+       {0, -ICO_Z, ICO_X},
+       {0, -ICO_Z, -ICO_X},
+       {ICO_Z, ICO_X, 0},
+       {-ICO_Z, ICO_X, 0},
+       {ICO_Z, -ICO_X, 0},
+       {-ICO_Z, -ICO_X, 0}
+};
+
+static GLuint tindices[20][3] =
+{
+       {0, 4, 1},
+       {0, 9, 4},
+       {9, 5, 4},
+       {4, 5, 8},
+       {4, 8, 1},
+       {8, 10, 1},
+       {8, 3, 10},
+       {5, 3, 8},
+       {5, 2, 3},
+       {2, 7, 3},
+       {7, 10, 3},
+       {7, 6, 10},
+       {7, 11, 6},
+       {11, 0, 6},
+       {0, 1, 6},
+       {6, 1, 10},
+       {9, 0, 11},
+       {9, 11, 2},
+       {9, 2, 5},
+       {7, 2, 11}
+};
+
+/* Public interface: Create the sphere. */
+void
+glb_sphere_init(void)
+{
+       int         i;
+
+       if (initialized)
+               return;
+
+       for (i = 0; i < 20; ++i) {
+               subdivide(vdata[tindices[i][0]], save_vertex(vdata[tindices[i][0]]),
+                  vdata[tindices[i][1]], save_vertex(vdata[tindices[i][1]]),
+                  vdata[tindices[i][2]], save_vertex(vdata[tindices[i][2]]),
+                         glb_config.subdivision_depth);
+       }
+
+       initialized = 1;
+}
+
+/* Return the vertices list. */
+glb_vertex *
+glb_sphere_get_vertices(int *nr_vertices_ptr)
+{
+       glb_sphere_init();
+       *nr_vertices_ptr = nr_vertices;
+       return vertices;
+}
+
+/* Return the triangles list. */
+glb_triangle *
+glb_sphere_get_triangles(int *nr_triangles_ptr)
+{
+       glb_sphere_init();
+       *nr_triangles_ptr = nr_triangles;
+       return triangles;
+}
+
+/* Free up memory. */
+#if 0
+void
+glb_sphere_end(void)
+{
+       initialized = 0;
+
+       (void) free((void *) vertices);
+       (void) free((void *) triangles);
+
+       vertices = 0;
+       nr_vertices = nr_vertices_allocated = 0;
+
+       triangles = 0;
+       nr_triangles = nr_triangles_allocated = 0;
+}
+
+#endif
diff --git a/modes/glx/bubble3d.c b/modes/glx/bubble3d.c
new file mode 100644 (file)
index 0000000..9d3667f
--- /dev/null
@@ -0,0 +1,261 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* bubble3d.c - 3D bubbles  */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)bubble3d.c  4.11 98/06/16 xlockmore";
+
+#endif
+
+/*-
+ * BUBBLE3D (C) 1998 Richard W.M. Jones.
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 16-Jun-98: Written.
+ *
+ * bubble.c: This code is responsible for creating and managing
+ * bubbles over their lifetime.
+ * The bubbles may be drawn inside out.
+ */
+
+#include "bubble3d.h"
+
+typedef struct bubble {
+       GLfloat    *contributions;      /* List of contributions from each
+                                        * nudge to each vertex. This list has
+                                        * length nr_vertices * nr_nudge_axes.
+                                        */
+       GLfloat     x, y, z;    /* (x,y,z) location of the bubble. */
+       GLfloat     scale;      /* Scaling factor applied to bubble. */
+       GLfloat     y_incr, scale_incr;         /* Change in y and scale each frame. */
+       GLfloat     rotx, roty, rotz;   /* Current rotation. */
+       GLfloat     rotx_incr, roty_incr, rotz_incr;    /* Amount by which we increase
+                                                        * rotation each step.
+                                                        */
+       GLfloat    *nudge_angle;        /* Current angle (radians) of each
+                                        * nudge. This list has length nr_nudge_axes.
+                                        */
+       GLfloat    *nudge_angle_incr;   /* Amount by which we increase each nudge
+                                        * angle in each frame.
+                                        */
+} bubble;
+
+/* Should be taken care of already... but just in case */
+#if !defined( __GNUC__ ) && !defined(__cplusplus) && !defined(c_plusplus)
+#undef inline
+#define inline                 /* */
+#endif
+static inline void
+normalize(GLfloat v[3])
+{
+       GLfloat     d = (GLfloat) sqrt((double) (v[0] * v[0] + v[1] * v[1] +
+                                                v[2] * v[2]));
+
+       if (d != 0) {
+               v[0] /= d;
+               v[1] /= d;
+               v[2] /= d;
+       } else {
+               v[0] = v[1] = v[2] = 0;
+       }
+}
+
+static inline GLfloat
+dotprod(GLfloat * v1, GLfloat * v2)
+{
+       return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
+}
+
+static inline GLfloat
+max(GLfloat a, GLfloat b)
+{
+       return a > b ? a : b;
+}
+
+/* Create a new bubble. */
+void       *
+glb_bubble_new(GLfloat x, GLfloat y, GLfloat z, GLfloat scale,
+              GLfloat y_incr, GLfloat scale_incr)
+{
+       int         i, j;
+
+       /* GLfloat axes [glb_config.nr_nudge_axes][3]; */
+       GLfloat     axes[5][3]; /* HARD CODED for SunCC */
+       int         nr_vertices;
+       glb_vertex *vertices = glb_sphere_get_vertices(&nr_vertices);
+
+       bubble     *b = (bubble *) malloc(sizeof *b);
+
+       if (b == 0)
+               return 0;
+
+       b->contributions = (GLfloat *) malloc(sizeof (GLfloat) * nr_vertices *
+                                             glb_config.nr_nudge_axes);
+       if (b->contributions == 0) {
+               (void) free((void *) b);
+               return 0;
+       }
+       b->nudge_angle = (GLfloat *) malloc(sizeof (GLfloat) * glb_config.nr_nudge_axes);
+       if (b->nudge_angle == 0) {
+               (void) free((void *) b->contributions);
+               (void) free((void *) b);
+               return 0;
+       }
+       b->nudge_angle_incr = (GLfloat *) malloc(sizeof (GLfloat) * glb_config.nr_nudge_axes);
+       if (b->nudge_angle_incr == 0) {
+               (void) free((void *) b->nudge_angle);
+               (void) free((void *) b->contributions);
+               (void) free((void *) b);
+               return 0;
+       }
+       /* Initialize primitive elements. */
+       b->x = x;
+       b->y = y;
+       b->z = z;
+       b->scale = scale;
+       b->y_incr = y_incr;
+       b->scale_incr = scale_incr;
+       b->rotx = b->roty = b->rotz = 0;
+       b->rotx_incr = glb_drand() * glb_config.rotation_factor * 2
+               - glb_config.rotation_factor;
+       b->roty_incr = glb_drand() * glb_config.rotation_factor * 2
+               - glb_config.rotation_factor;
+       b->rotz_incr = glb_drand() * glb_config.rotation_factor * 2
+               - glb_config.rotation_factor;
+
+       /* Initialize the nudge angle arrays. */
+       for (i = 0; i < glb_config.nr_nudge_axes; ++i) {
+               b->nudge_angle[i] = 0;
+               b->nudge_angle_incr[i] = glb_drand() * glb_config.nudge_angle_factor;
+       }
+
+       /* Choose some random nudge axes. */
+       for (i = 0; i < glb_config.nr_nudge_axes; ++i) {
+               axes[i][0] = glb_drand() * 2 - 1;
+               axes[i][1] = glb_drand() * 2 - 1;
+               axes[i][2] = glb_drand() * 2 - 1;
+               normalize(axes[i]);
+       }
+
+       /* Calculate the contribution that each nudge axis has on each vertex. */
+       for (i = 0; i < nr_vertices; ++i)
+               for (j = 0; j < glb_config.nr_nudge_axes; ++j)
+                       b->contributions[i * glb_config.nr_nudge_axes + j]
+                               = max(0.0, dotprod(vertices[i], axes[j]));
+
+       return (void *) b;
+}
+
+/* Delete a bubble and free up all memory. */
+void
+glb_bubble_delete(void *bb)
+{
+       bubble     *b = (bubble *) bb;
+
+       if (b != NULL) {
+               if (b->nudge_angle_incr) {
+                       (void) free((void *) b->nudge_angle_incr);
+               }
+               if (b->nudge_angle) {
+                       (void) free((void *) b->nudge_angle);
+               }
+               if (b->contributions) {
+                       (void) free((void *) b->contributions);
+               }
+               (void) free((void *) b);
+               b = (bubble *) NULL;
+       }
+}
+
+/* Rotate and wobble a bubble by a single step. */
+void
+glb_bubble_step(void *bb)
+{
+       int         i;
+       bubble     *b = (bubble *) bb;
+
+       /* Update the rotation. */
+       b->rotx += b->rotx_incr;
+       b->roty += b->roty_incr;
+       b->rotz += b->rotz_incr;
+
+       /* Update the nudge angles. */
+       for (i = 0; i < glb_config.nr_nudge_axes; ++i)
+               b->nudge_angle[i] += b->nudge_angle_incr[i];
+
+       /* Move it upwards & outwards. */
+       b->y += b->y_incr;
+       b->scale += b->scale_incr;
+}
+
+/* Draw a bubble. */
+void
+glb_bubble_draw(void *bb)
+{
+       int         i, j;
+       bubble     *b = (bubble *) bb;
+       int         nr_vertices;
+       glb_vertex *vertices = glb_sphere_get_vertices(&nr_vertices);
+       int         nr_triangles;
+       glb_triangle *triangles = glb_sphere_get_triangles(&nr_triangles);
+       glb_vertex *new_vertices;
+
+       new_vertices = (glb_vertex *) malloc(sizeof (glb_vertex) * nr_vertices);
+       /* Calculate the vertices of this bubble, factoring in each nudge axis. */
+       for (i = 0; i < nr_vertices; ++i) {
+               GLfloat     s = 0;
+
+               for (j = 0; j < glb_config.nr_nudge_axes; ++j)
+                       s += ((GLfloat) cos((double) (b->nudge_angle[j])) *
+                             glb_config.nudge_factor - glb_config.nudge_factor / 2) *
+                               b->contributions[i * glb_config.nr_nudge_axes + j];
+
+               new_vertices[i][0] = vertices[i][0] * (s + 1);
+               new_vertices[i][1] = vertices[i][1] * (s + 1);
+               new_vertices[i][2] = vertices[i][2] * (s + 1);
+       }
+
+       glPushMatrix();
+
+       /* Apply translation, rotation and scalings. */
+       glTranslatef(b->x, b->y, b->z);
+
+       glRotatef(b->rotx, 1, 0, 0);
+       glRotatef(b->roty, 0, 1, 0);
+       glRotatef(b->rotz, 0, 0, 1);
+
+       glScalef(b->scale, b->scale, b->scale);
+
+       /* Draw the bubble. */
+       glBegin(GL_TRIANGLES);
+       for (i = 0; i < nr_triangles; ++i) {
+               glNormal3fv(new_vertices[triangles[i][0]]);
+               glVertex3fv(new_vertices[triangles[i][0]]);
+               glNormal3fv(new_vertices[triangles[i][1]]);
+               glVertex3fv(new_vertices[triangles[i][1]]);
+               glNormal3fv(new_vertices[triangles[i][2]]);
+               glVertex3fv(new_vertices[triangles[i][2]]);
+       }
+       glEnd();
+       glPopMatrix();
+       (void) free((void *) new_vertices);
+}
+
+/* Return y value. */
+GLfloat
+glb_bubble_get_y(void *bb)
+{
+       bubble     *b = (bubble *) bb;
+
+       return b->y;
+}
diff --git a/modes/glx/bubble3d.h b/modes/glx/bubble3d.h
new file mode 100644 (file)
index 0000000..26abbfb
--- /dev/null
@@ -0,0 +1,95 @@
+#ifndef __bubbles3d_h__
+#define __bubbles3d_h__
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)bubble3d.h 4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Bubble3d stuff
+ *
+ * GLBUBBLES (C) 1998 Richard W.M. Jones.
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+#include "xlock.h"
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+/* Static configuration. */
+#define GLB_SLOW_GL          0 /* Set this if you have a slow GL
+                                  * implementation. If you have an accelerated
+                                  * graphics card, set this to 0.
+                                */
+#define GLB_USE_BLENDING     1 /* Use alpha feature to create see-through
+                                  * bubbles.
+                                */
+#define GLB_VERTICES_EPSILON 0.0005    /* How close are identical vertices? */
+
+/* Configuration structure. */
+struct glb_config {
+       int         subdivision_depth;  /* Controls how many triangles are in
+                                        * each bubble. 2 and 3 are good values.
+                                        */
+       int         nr_nudge_axes;      /* Number of directions in which each
+                                        * bubble gets stretched. Values between
+                                        * 3 and 7 seem to produce good results.
+                                        */
+       GLfloat     nudge_angle_factor;         /* Max. amount of rotation in nudge angles.
+                                                * Controls the amount of `wobble' we see,
+                                                * and 0.3 seems to work well.
+                                                */
+       GLfloat     nudge_factor;       /* Max. displacement of any single nudge.
+                                        * Controls the amount of the wobble. Depends
+                                        * on NR_NUDGE_AXES, and must not exceed
+                                        * 1 / NR_NUDGE_AXES. 0.1 is good.
+                                        */
+       GLfloat     rotation_factor;    /* Max. amount by which bubbles rotate. */
+       int         create_bubbles_every;       /* How often to create new bubbles. */
+       int         max_bubbles;        /* Max. number of bubbles to create. */
+       double      p_bubble_group[4];  /* Probabilities of creating 1, 2, 3, 4
+                                        * bubbles in a group. Cumulative.
+                                        */
+       GLfloat     max_size;   /* Max. size. */
+       GLfloat     min_size;   /* Min. size of bubbles. */
+       GLfloat     max_speed;  /* Max. speed. */
+       GLfloat     min_speed;  /* Min. speed of bubbles. */
+       GLfloat     scale_factor;       /* Factor by which bubbles scale from bottom
+                                        * of screen to top. 1.5 - 2.0 are OK.
+                                        */
+       GLfloat     screen_bottom;      /* Bottom of screen. */
+       GLfloat     screen_top; /* Top of screen. */
+       GLfloat     bg_colour[4];       /* Background colour. */
+       GLfloat     bubble_colour[4];   /* Colour of the bubbles. */
+};
+
+extern struct glb_config glb_config;
+
+#define glb_drand() ((double)LRAND() / (double)MAXRAND)
+
+/*-- From glb_sphere.c. --*/
+typedef GLfloat glb_vertex[3];
+typedef GLuint glb_triangle[3];
+extern void glb_sphere_init(void);
+extern glb_vertex *glb_sphere_get_vertices(int *nr_vertices);
+extern glb_triangle *glb_sphere_get_triangles(int *nr_triangles);
+extern void glb_sphere_end(void);
+
+/*-- From glb_bubble.c. --*/
+extern void *glb_bubble_new(GLfloat x, GLfloat y, GLfloat z, GLfloat scale,
+                           GLfloat y_incr, GLfloat scale_incr);
+extern void glb_bubble_delete(void *);
+extern void glb_bubble_step(void *);
+extern void glb_bubble_draw(void *);
+extern GLfloat glb_bubble_get_y(void *);
+
+/*-- From glb_draw.c. --*/
+extern void *glb_draw_init(void);
+extern void glb_draw_step(void *);
+extern void glb_draw_end(void *);
+
+#endif /* __bubbles3d_h__ */
diff --git a/modes/glx/buildlwo.c b/modes/glx/buildlwo.c
new file mode 100644 (file)
index 0000000..7748b65
--- /dev/null
@@ -0,0 +1,104 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)buildlwo.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * buildlwo.c: Lightwave Object Display List Builder for OpenGL
+ *
+ * This module can be called by any GL mode wishing to use
+ * objects created in NewTek's Lightwave 3D.  The objects must
+ * first be converted to C source with my converter "lw2ogl".
+ * If other people are interested in this, I will put up a
+ * web page for it at http://www.netaxs.com/~emackey/lw2ogl/
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 19-Apr-1997: Written by Ed Mackey
+ *
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef USE_GL
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+GLuint
+BuildLWO(int wireframe, struct lwo *object)
+{
+       GLuint      dl_num;
+       GLfloat    *pnts, *normals, three[3], *grab;
+       unsigned short int *pols;
+       int         p, num_pnts = 0;
+
+       if ((dl_num = glGenLists(1)) == 0)
+               return (0);
+       glNewList(dl_num, GL_COMPILE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(dl_num, 1);
+               return (0);
+       }
+
+       pnts = object->pnts;
+       normals = object->normals;
+       pols = object->pols;
+
+
+       if (!pols) {
+               num_pnts = object->num_pnts;
+               glBegin(GL_POINTS);
+               for (p = 0; p < num_pnts; ++p) {
+                       three[0] = *(pnts++);
+                       three[1] = *(pnts++);
+                       three[2] = *(pnts++);
+                       glVertex3fv(three);
+               }
+               glEnd();
+       } else
+               for (;;) {
+                       if (num_pnts <= 0) {
+                               num_pnts = *pols + 2;
+                               if (num_pnts < 3)
+                                       break;
+                               if (num_pnts == 3) {
+                                       glBegin(GL_POINTS);
+                               } else if (num_pnts == 4) {
+                                       glBegin(GL_LINES);
+                               } else {
+                                       three[0] = *(normals++);
+                                       three[1] = *(normals++);
+                                       three[2] = *(normals++);
+                                       glNormal3fv(three);
+                                       if (wireframe)
+                                               glBegin(GL_LINE_LOOP);
+                                       else
+                                               glBegin(GL_POLYGON);
+                               }
+                       } else if (num_pnts == 1) {
+                               glEnd();
+                       } else {
+                               grab = pnts + ((int) (*pols) * 3);
+                               three[0] = *(grab++);
+                               three[1] = *(grab++);
+                               three[2] = *(grab++);
+                               glVertex3fv(three);
+                       }
+                       --num_pnts;
+                       ++pols;
+               }
+
+       glEndList();
+
+       return (dl_num);
+}
+
+#endif /* USE_GL */
+
+/* End of buildlwo.c */
diff --git a/modes/glx/buildlwo.h b/modes/glx/buildlwo.h
new file mode 100644 (file)
index 0000000..fd9f027
--- /dev/null
@@ -0,0 +1,24 @@
+/*-
+ * buildlwo.h: Header file for Lightwave Object Display List Builder
+ * for OpenGL
+ *
+ * by Ed Mackey, 4/19/97
+ *
+ */
+
+#ifndef __BUILD_LWO_H__
+#define __BUILD_LWO_H__
+
+struct lwo {
+       int         num_pnts;
+       GLfloat    *pnts;
+       GLfloat    *normals;
+       unsigned short int *pols;
+       GLfloat    *smoothnormals;
+};
+
+GLuint      BuildLWO(int wireframe, struct lwo *object);
+
+#endif
+
+/* End of buildlwo.h */
diff --git a/modes/glx/cage.c b/modes/glx/cage.c
new file mode 100644 (file)
index 0000000..cc5281f
--- /dev/null
@@ -0,0 +1,486 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* cage --- the Impossible Cage, an Escher like scene. */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)cage.c       5.01 2001/03/01 xlockmore";
+
+#endif
+
+#undef DEBUG_LISTS
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The RotateAroundU() routine was adapted from the book
+ *    "Computer Graphics Principles and Practice
+ *     Foley - vanDam - Feiner - Hughes
+ *     Second Edition" Pag. 227, exercise 5.15.
+ *
+ * This mode shows some interesting scenes that are impossible OR very
+ * wierd to build in the real universe. Much of the scenes are inspirated
+ * on Mauritz Cornelis Escher's works which derivated the mode's name.
+ * M.C. Escher (1898-1972) was a dutch artist and many people prefer to
+ * say he was a mathematician.
+ *
+ * Thanks goes to Brian Paul for making it possible and inexpensive to use
+ * OpenGL at home.
+ *
+ * Since I'm not a native English speaker, my apologies for any grammatical
+ * mistakes.
+ *
+ * My e-mail address is
+ * m-vianna@usa.net
+ *
+ * Marcelo F. Vianna (Jun-01-1997)
+ *
+ * Revision History:
+ * 01-Mar-2001: Added FPS stuff E.Lassauge <lassauge@mail.dotcom.fr>
+ * 01-Nov-2000: Allocation checks
+ * 01-Jan-1998: Mode separated from escher and renamed
+ * 08-Jun-1997: New scene implemented: "Impossible Cage" based in a M.C.
+ *              Escher's painting with the same name (quite similar). The
+ *              first GL mode to use texture mapping.
+ *              The "Impossible Cage" scene doesn't use DEPTH BUFFER, the
+ *              wood planks are drawn consistently using GL_CULL_FACE, and
+ *              the painter's algorithm is used to sort the planks.
+ *              Marcelo F. Vianna.
+ * 07-Jun-1997: Speed ups in Moebius Strip using GL_CULL_FACE.
+ *              Marcelo F. Vianna.
+ * 03-Jun-1997: Initial Release (Only one scene: "Moebius Strip")
+ *              The Moebius Strip scene was inspirated in a M.C. Escher's
+ *              painting named Moebius Strip II in wich ants walk across a
+ *              Moebius Strip path, sometimes meeting each other and sometimes
+ *              being in "opposite faces" (note that the moebius strip has
+ *              only one face and one edge).
+ *              Marcelo F. Vianna.
+ */
+
+/*-
+ * Texture mapping is only available on RGBA contexts, Mono and color index
+ * visuals DO NOT support texture mapping in OpenGL.
+ *
+ * BUT Mesa do implements RGBA contexts in pseudo color visuals, so texture
+ * mapping shuld work on PseudoColor, DirectColor, TrueColor using Mesa. Mono
+ * is not officially supported for both OpenGL and Mesa, but seems to not crash
+ * Mesa.
+ *
+ * In real OpenGL, PseudoColor DO NOT support texture map (as far as I know).
+ */
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "Cage"
+#define HACK_INIT init_cage
+#define HACK_DRAW draw_cage
+#define cage_opts xlockmore_opts
+#define DEFAULTS "*delay: 25000 \n" \
+ "*showFps  : False \n" \
+ "*wireframe: False \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "visgl.h"
+
+#endif /* !STANDALONE */
+
+#ifdef MODE_cage
+
+
+#include <GL/glu.h>
+#include "e_textures.h"
+
+ModeSpecOpt cage_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   cage_description =
+{"cage", "init_cage", "draw_cage", "release_cage",
+ "draw_cage", "change_cage", NULL, &cage_opts,
+ 25000, 1, 1, 1, 1.0, 4, "",
+ "Shows the Impossible Cage, an Escher-like GL scene", 0, NULL};
+
+#endif
+
+#define Scale4Window               0.3
+#define Scale4Iconic               0.4
+
+#define sqr(A)                     ((A)*(A))
+
+#ifndef Pi
+#define Pi                         M_PI
+#endif
+
+#define ObjWoodPlank    0
+#define MaxObj          1
+
+/*************************************************************************/
+
+typedef struct {
+       GLint       WindH, WindW;
+       GLfloat     step;
+       Bool        AreObjectsDefined[MaxObj];
+       GLXContext *glx_context;
+} cagestruct;
+
+static float front_shininess[] =
+{60.0};
+static float front_specular[] =
+{0.7, 0.7, 0.7, 1.0};
+static float ambient[] =
+{0.0, 0.0, 0.0, 1.0};
+static float diffuse[] =
+{1.0, 1.0, 1.0, 1.0};
+static float position0[] =
+{1.0, 1.0, 1.0, 0.0};
+static float position1[] =
+{-1.0, -1.0, 1.0, 0.0};
+static float lmodel_ambient[] =
+{0.5, 0.5, 0.5, 1.0};
+static float lmodel_twoside[] =
+{GL_TRUE};
+
+static float MaterialWhite[] =
+{0.7, 0.7, 0.7, 1.0};
+
+static cagestruct *cage = (cagestruct *) NULL;
+static GLuint objects = 0;
+
+#define PlankWidth      3.0
+#define PlankHeight     0.35
+#define PlankThickness  0.15
+
+static Bool 
+draw_woodplank(cagestruct * cp)
+{
+       if (!cp->AreObjectsDefined[ObjWoodPlank]) {
+               glNewList(objects + ObjWoodPlank, GL_COMPILE_AND_EXECUTE);
+               if (glGetError() != GL_NO_ERROR) {
+                       return False;
+               }
+               glBegin(GL_QUADS);
+               glNormal3f(0, 0, 1);
+               glTexCoord2f(0, 0);
+               glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
+               glTexCoord2f(1, 0);
+               glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
+               glTexCoord2f(1, 1);
+               glVertex3f(PlankWidth, PlankHeight, PlankThickness);
+               glTexCoord2f(0, 1);
+               glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
+               glNormal3f(0, 0, -1);
+               glTexCoord2f(0, 0);
+               glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
+               glTexCoord2f(1, 0);
+               glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
+               glTexCoord2f(1, 1);
+               glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
+               glTexCoord2f(0, 1);
+               glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
+               glNormal3f(0, 1, 0);
+               glTexCoord2f(0, 0);
+               glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
+               glTexCoord2f(1, 0);
+               glVertex3f(PlankWidth, PlankHeight, PlankThickness);
+               glTexCoord2f(1, 1);
+               glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
+               glTexCoord2f(0, 1);
+               glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
+               glNormal3f(0, -1, 0);
+               glTexCoord2f(0, 0);
+               glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
+               glTexCoord2f(1, 0);
+               glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
+               glTexCoord2f(1, 1);
+               glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
+               glTexCoord2f(0, 1);
+               glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
+               glNormal3f(1, 0, 0);
+               glTexCoord2f(0, 0);
+               glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
+               glTexCoord2f(1, 0);
+               glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
+               glTexCoord2f(1, 1);
+               glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
+               glTexCoord2f(0, 1);
+               glVertex3f(PlankWidth, PlankHeight, PlankThickness);
+               glNormal3f(-1, 0, 0);
+               glTexCoord2f(0, 0);
+               glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
+               glTexCoord2f(1, 0);
+               glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
+               glTexCoord2f(1, 1);
+               glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
+               glTexCoord2f(0, 1);
+               glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
+               glEnd();
+               glEndList();
+               cp->AreObjectsDefined[ObjWoodPlank] = True;
+#ifdef DEBUG_LISTS
+               (void) printf("WoodPlank drawn SLOWLY\n");
+#endif
+       } else {
+               glCallList(objects + ObjWoodPlank);
+#ifdef DEBUG_LISTS
+               (void) printf("WoodPlank drawn quickly\n");
+#endif
+       }
+       return True;
+}
+
+static Bool
+draw_impossiblecage(cagestruct * cp)
+{
+       glPushMatrix();
+       glRotatef(90, 0, 1, 0);
+       glTranslatef(0.0, PlankHeight - PlankWidth, -PlankThickness - PlankWidth);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(90, 0, 0, 1);
+       glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth - PlankThickness);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(90, 0, 1, 0);
+       glTranslatef(0.0, PlankWidth - PlankHeight, -PlankThickness - PlankWidth);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glTranslatef(0.0, PlankWidth - PlankHeight, 3 * PlankThickness - PlankWidth);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(90, 0, 0, 1);
+       glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth - PlankThickness);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth - 3 * PlankThickness);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glTranslatef(0.0, PlankHeight - PlankWidth, 3 * PlankThickness - PlankWidth);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(90, 0, 0, 1);
+       glTranslatef(0.0, PlankHeight - PlankWidth, PlankThickness - PlankWidth);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth - 3 * PlankThickness);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(90, 0, 1, 0);
+       glTranslatef(0.0, PlankHeight - PlankWidth, PlankWidth + PlankThickness);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(90, 0, 0, 1);
+       glTranslatef(0.0, PlankWidth - PlankHeight, PlankThickness - PlankWidth);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(90, 0, 1, 0);
+       glTranslatef(0.0, PlankWidth - PlankHeight, PlankWidth + PlankThickness);
+       if (!draw_woodplank(cp))
+               return False;
+       glPopMatrix();
+       return True;
+}
+
+static void
+reshape(ModeInfo * mi, int width, int height)
+{
+       cagestruct *cp = &cage[MI_SCREEN(mi)];
+       int i;
+
+       glViewport(0, 0, cp->WindW = (GLint) width, cp->WindH = (GLint) height);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
+       glMatrixMode(GL_MODELVIEW);
+       i = width / 512 + 1;
+       glLineWidth(i);
+       glPointSize(i);
+       cp->AreObjectsDefined[ObjWoodPlank] = False;
+}
+
+static void
+pinit(ModeInfo *mi)
+{
+       glClearDepth(1.0);
+       glClearColor(0.0, 0.0, 0.0, 1.0);
+
+       glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT0, GL_POSITION, position0);
+       glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT1, GL_POSITION, position1);
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+       glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_NORMALIZE);
+       glFrontFace(GL_CCW);
+       glCullFace(GL_BACK);
+
+       /* cage */
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+       glShadeModel(GL_FLAT);
+       glDisable(GL_DEPTH_TEST);
+       glEnable(GL_TEXTURE_2D);
+       glEnable(GL_CULL_FACE);
+
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       if (!MI_IS_MONO(mi))
+               gluBuild2DMipmaps(GL_TEXTURE_2D, 3,
+                       WoodTextureWidth, WoodTextureHeight,
+                       GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
+}
+
+void
+release_cage(ModeInfo * mi)
+{
+       if (cage != NULL) {
+               int screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       cagestruct *cp = &cage[screen];
+
+                       if (cp->glx_context) {
+                               if (glIsList(objects)) {
+                                       glDeleteLists(objects, MaxObj);
+                                       objects = 0;
+                               }
+                               cp->glx_context = (GLXContext *) NULL;
+                       }
+               }
+               (void) free((void *) cage);
+               cage = (cagestruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+void
+init_cage(ModeInfo * mi)
+{
+       cagestruct *cp;
+
+       if (cage == NULL) {
+               if ((cage = (cagestruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (cagestruct))) == NULL)
+                       return;
+       }
+       cp = &cage[MI_SCREEN(mi)];
+
+       cp->step = NRAND(90);
+       if ((cp->glx_context = init_GL(mi)) != NULL) {
+
+               reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               glDrawBuffer(GL_BACK);
+               if (!glIsList(objects))
+                       if ((objects = glGenLists(MaxObj)) == 0) {
+                               MI_CLEARWINDOW(mi);
+                               release_cage(mi);
+                               return;
+                       }
+               pinit(mi);
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_cage(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       cagestruct *cp;
+
+       if (cage == NULL)
+               return;
+       cp = &cage[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (!cp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(cp->glx_context));
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, -10.0);
+
+       if (!MI_IS_ICONIC(mi)) {
+               glScalef(Scale4Window * cp->WindH / cp->WindW, Scale4Window, Scale4Window);
+       } else {
+               glScalef(Scale4Iconic * cp->WindH / cp->WindW, Scale4Iconic, Scale4Iconic);
+       }
+
+       /* cage */
+       glRotatef(cp->step * 100, 0, 0, 1);
+       glRotatef(25 + cos(cp->step * 5) * 6, 1, 0, 0);
+       glRotatef(204.5 - sin(cp->step * 5) * 8, 0, 1, 0);
+       if (!draw_impossiblecage(cp)) {
+               release_cage(mi);
+               return;
+       }
+
+       glPopMatrix();
+       if (MI_IS_FPS(mi)) do_fps (mi);
+       glFlush();
+
+       glXSwapBuffers(display, window);
+
+       cp->step += 0.025;
+}
+
+void
+change_cage(ModeInfo * mi)
+{
+       cagestruct *cp = &cage[MI_SCREEN(mi)];
+
+       if (!cp->glx_context)
+               return;
+
+       glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(cp->glx_context));
+       pinit(mi);
+}
+
+#endif
diff --git a/modes/glx/dolphin.c b/modes/glx/dolphin.c
new file mode 100644 (file)
index 0000000..e76d040
--- /dev/null
@@ -0,0 +1,2073 @@
+/* atlantis --- Shows moving 3D sea animals */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)dolphin.c    5.01 2001/04/17 xlockmore";
+
+#endif
+
+/* Copyright (c) E. Lassauge, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by Mark J. Kilgard
+ * as a demo for openGL programming.
+ *
+ * Porting it to xlock  was possible by comparing the original Mesa's morph3d
+ * demo with it's ported version to xlock, so thanks for Marcelo F. Vianna
+ * (look at morph3d.c) for his indirect help.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * My e-mail address is lassauge@dotcom.fr
+ *
+ * Eric Lassauge  (May-13-1998)
+ *
+ */
+
+/**
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_atlantis
+
+#ifdef STANDALONE
+#include <math.h>
+#include <GL/glx.h>
+#endif
+
+#include "atlantis.h"
+/* *INDENT-OFF* */
+static float N001[3] = {-0.005937 ,-0.101998 ,-0.994767};
+static float N002[3] = {0.936780 ,-0.200803 ,0.286569};
+static float N003[3] = {-0.233062 ,0.972058 ,0.028007};
+#if 0
+static float N004[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N005[3] = {0.898117 ,0.360171 ,0.252315};
+static float N006[3] = {-0.915437 ,0.348456 ,0.201378};
+static float N007[3] = {0.602263 ,-0.777527 ,0.180920};
+static float N008[3] = {-0.906912 ,-0.412015 ,0.088061};
+#if 0
+static float N009[3] = {-0.015623 ,0.999878 ,0.000000};
+static float N010[3] = {0.000000 ,-0.992278 ,0.124035};
+static float N011[3] = {0.000000 ,-0.936329 ,-0.351123};
+#endif
+static float N012[3] = {0.884408 ,-0.429417 ,-0.182821};
+static float N013[3] = {0.921121 ,0.311084 ,-0.234016};
+static float N014[3] = {0.382635 ,0.877882 ,-0.287948};
+static float N015[3] = {-0.380046 ,0.888166 ,-0.258316};
+static float N016[3] = {-0.891515 ,0.392238 ,-0.226607};
+static float N017[3] = {-0.901419 ,-0.382002 ,-0.203763};
+static float N018[3] = {-0.367225 ,-0.911091 ,-0.187243};
+static float N019[3] = {0.339539 ,-0.924846 ,-0.171388};
+static float N020[3] = {0.914706 ,-0.378617 ,-0.141290};
+static float N021[3] = {0.950662 ,0.262713 ,-0.164994};
+static float N022[3] = {0.546359 ,0.801460 ,-0.243218};
+static float N023[3] = {-0.315796 ,0.917068 ,-0.243431};
+static float N024[3] = {-0.825687 ,0.532277 ,-0.186875};
+static float N025[3] = {-0.974763 ,-0.155232 ,-0.160435};
+static float N026[3] = {-0.560596 ,-0.816658 ,-0.137119};
+static float N027[3] = {0.380210 ,-0.910817 ,-0.160786};
+static float N028[3] = {0.923772 ,-0.358322 ,-0.135093};
+static float N029[3] = {0.951202 ,0.275053 ,-0.139859};
+static float N030[3] = {0.686099 ,0.702548 ,-0.188932};
+static float N031[3] = {-0.521865 ,0.826719 ,-0.210220};
+static float N032[3] = {-0.923820 ,0.346739 ,-0.162258};
+static float N033[3] = {-0.902095 ,-0.409995 ,-0.134646};
+static float N034[3] = {-0.509115 ,-0.848498 ,-0.144404};
+static float N035[3] = {0.456469 ,-0.880293 ,-0.129305};
+static float N036[3] = {0.873401 ,-0.475489 ,-0.105266};
+static float N037[3] = {0.970825 ,0.179861 ,-0.158584};
+static float N038[3] = {0.675609 ,0.714187 ,-0.183004};
+static float N039[3] = {-0.523574 ,0.830212 ,-0.191360};
+static float N040[3] = {-0.958895 ,0.230808 ,-0.165071};
+static float N041[3] = {-0.918285 ,-0.376803 ,-0.121542};
+static float N042[3] = {-0.622467 ,-0.774167 ,-0.114888};
+static float N043[3] = {0.404497 ,-0.908807 ,-0.102231};
+static float N044[3] = {0.930538 ,-0.365155 ,-0.027588};
+static float N045[3] = {0.921920 ,0.374157 ,-0.100345};
+static float N046[3] = {0.507346 ,0.860739 ,0.041562};
+static float N047[3] = {-0.394646 ,0.918815 ,-0.005730};
+static float N048[3] = {-0.925411 ,0.373024 ,-0.066837};
+static float N049[3] = {-0.945337 ,-0.322309 ,-0.049551};
+static float N050[3] = {-0.660437 ,-0.750557 ,-0.022072};
+static float N051[3] = {0.488835 ,-0.871950 ,-0.027261};
+static float N052[3] = {0.902599 ,-0.421397 ,0.087969};
+static float N053[3] = {0.938636 ,0.322606 ,0.122020};
+static float N054[3] = {0.484605 ,0.871078 ,0.079878};
+static float N055[3] = {-0.353607 ,0.931559 ,0.084619};
+static float N056[3] = {-0.867759 ,0.478564 ,0.134054};
+static float N057[3] = {-0.951583 ,-0.296030 ,0.082794};
+static float N058[3] = {-0.672355 ,-0.730209 ,0.121384};
+static float N059[3] = {0.528336 ,-0.842452 ,0.105525};
+static float N060[3] = {0.786913 ,-0.564760 ,0.248627};
+#if 0
+static float N061[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N062[3] = {0.622098 ,0.765230 ,0.165584};
+static float N063[3] = {-0.631711 ,0.767816 ,0.106773};
+static float N064[3] = {-0.687886 ,0.606351 ,0.398938};
+static float N065[3] = {-0.946327 ,-0.281623 ,0.158598};
+static float N066[3] = {-0.509549 ,-0.860437 ,0.002776};
+static float N067[3] = {0.462594 ,-0.876692 ,0.131977};
+#if 0
+static float N068[3] = {0.000000 ,-0.992278 ,0.124035};
+static float N069[3] = {0.000000 ,-0.970143 ,-0.242536};
+static float N070[3] = {0.015502 ,0.992159 ,-0.124020};
+#endif
+static float N071[3] = {0.000000 ,1.000000 ,0.000000};
+#if 0
+static float N072[3] = {0.000000 ,1.000000 ,0.000000};
+static float N073[3] = {0.000000 ,1.000000 ,0.000000};
+static float N074[3] = {0.000000 ,-1.000000 ,0.000000};
+static float N075[3] = {-0.242536 ,0.000000 ,-0.970143};
+static float N076[3] = {-0.010336 ,-0.992225 ,-0.124028};
+#endif
+static float N077[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N078[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N079[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N080[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N081[3] = {-0.571197 ,0.816173 ,0.087152};
+static float N082[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N083[3] = {-0.571197 ,0.816173 ,0.087152};
+static float N084[3] = {-0.571197 ,0.816173 ,0.087152};
+static float N085[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N086[3] = {-0.571197 ,0.816173 ,0.087152};
+static float N087[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N088[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N089[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N090[3] = {-0.880770 ,0.461448 ,0.106351};
+static float N091[3] = {0.000000 ,1.000000 ,0.000000};
+static float N092[3] = {0.000000 ,1.000000 ,0.000000};
+static float N093[3] = {0.000000 ,1.000000 ,0.000000};
+static float N094[3] = {1.000000 ,0.000000 ,0.000000};
+static float N095[3] = {-1.000000 ,0.000000 ,0.000000};
+#if 0
+static float N096[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N097[3] = {-0.697296 ,0.702881 ,0.140491};
+static float N098[3] = {0.918864 ,0.340821 ,0.198819};
+static float N099[3] = {-0.932737 ,0.201195 ,0.299202};
+static float N100[3] = {0.029517 ,0.981679 ,0.188244};
+#if 0
+static float N101[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N102[3] = {0.813521 ,-0.204936 ,0.544229};
+#if 0
+static float N103[3] = {0.000000 ,1.000000 ,0.000000};
+static float N104[3] = {0.000000 ,1.000000 ,0.000000};
+static float N105[3] = {0.000000 ,1.000000 ,0.000000};
+static float N106[3] = {0.000000 ,1.000000 ,0.000000};
+static float N107[3] = {0.000000 ,1.000000 ,0.000000};
+static float N108[3] = {0.000000 ,1.000000 ,0.000000};
+static float N109[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N110[3] = {-0.781480 ,-0.384779 ,0.491155};
+static float N111[3] = {-0.722243 ,0.384927 ,0.574627};
+static float N112[3] = {-0.752278 ,0.502679 ,0.425901};
+static float N113[3] = {0.547257 ,0.367910 ,0.751766};
+static float N114[3] = {0.725949 ,-0.232568 ,0.647233};
+static float N115[3] = {-0.747182 ,-0.660786 ,0.071280};
+static float N116[3] = {0.931519 ,0.200748 ,0.303270};
+static float N117[3] = {-0.828928 ,0.313757 ,0.463071};
+static float N118[3] = {0.902554 ,-0.370967 ,0.218587};
+static float N119[3] = {-0.879257 ,-0.441851 ,0.177973};
+static float N120[3] = {0.642327 ,0.611901 ,0.461512};
+static float N121[3] = {0.964817 ,-0.202322 ,0.167910};
+static float N122[3] = {0.000000 ,1.000000 ,0.000000};
+#if 0
+static float N123[3] = {-0.980734 ,0.041447 ,0.190900};
+static float N124[3] = {-0.980734 ,0.041447 ,0.190900};
+static float N125[3] = {-0.980734 ,0.041447 ,0.190900};
+static float N126[3] = {0.000000 ,1.000000 ,0.000000};
+static float N127[3] = {0.000000 ,1.000000 ,0.000000};
+static float N128[3] = {0.000000 ,1.000000 ,0.000000};
+static float N129[3] = {0.963250 ,0.004839 ,0.268565};
+static float N130[3] = {0.963250 ,0.004839 ,0.268565};
+static float N131[3] = {0.963250 ,0.004839 ,0.268565};
+static float N132[3] = {0.000000 ,1.000000 ,0.000000};
+static float N133[3] = {0.000000 ,1.000000 ,0.000000};
+static float N134[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float P001[3] = {5.68, -300.95, 1324.70};
+static float P002[3] = {338.69, -219.63, 9677.03};
+static float P003[3] = {12.18, 474.59, 9138.14};
+#if 0
+static float P004[3] = {-7.49, -388.91, 10896.74};
+#endif
+static float P005[3] = {487.51, 198.05, 9350.78};
+static float P006[3] = {-457.61, 68.74, 9427.85};
+static float P007[3] = {156.52, -266.72, 10311.68};
+static float P008[3] = {-185.56, -266.51, 10310.47};
+static float P009[3] = {124.39, -261.46, 1942.34};
+static float P010[3] = {-130.05, -261.46, 1946.03};
+static float P011[3] = {141.07, -320.11, 1239.38};
+static float P012[3] = {156.48, -360.12, 2073.41};
+static float P013[3] = {162.00, -175.88, 2064.44};
+static float P014[3] = {88.16, -87.72, 2064.02};
+static float P015[3] = {-65.21, -96.13, 2064.02};
+static float P016[3] = {-156.48, -180.96, 2064.44};
+static float P017[3] = {-162.00, -368.93, 2082.39};
+static float P018[3] = {-88.16, -439.22, 2082.39};
+static float P019[3] = {65.21, -440.32, 2083.39};
+static float P020[3] = {246.87, -356.02, 2576.95};
+static float P021[3] = {253.17, -111.15, 2567.15};
+static float P022[3] = {132.34, 51.41, 2559.84};
+static float P023[3] = {-97.88, 40.44, 2567.15};
+static float P024[3] = {-222.97, -117.49, 2567.15};
+static float P025[3] = {-252.22, -371.53, 2569.92};
+static float P026[3] = {-108.44, -518.19, 2586.75};
+static float P027[3] = {97.88, -524.79, 2586.75};
+static float P028[3] = {370.03, -421.19, 3419.70};
+static float P029[3] = {351.15, -16.98, 3423.17};
+static float P030[3] = {200.66, 248.46, 3430.37};
+static float P031[3] = {-148.42, 235.02, 3417.91};
+static float P032[3] = {-360.21, -30.27, 3416.84};
+static float P033[3] = {-357.90, -414.89, 3407.04};
+static float P034[3] = {-148.88, -631.35, 3409.90};
+static float P035[3] = {156.38, -632.59, 3419.70};
+static float P036[3] = {462.61, -469.21, 4431.51};
+static float P037[3] = {466.60, 102.25, 4434.98};
+static float P038[3] = {243.05, 474.34, 4562.02};
+static float P039[3] = {-191.23, 474.40, 4554.42};
+static float P040[3] = {-476.12, 111.05, 4451.11};
+static float P041[3] = {-473.36, -470.74, 4444.78};
+static float P042[3] = {-266.95, -748.41, 4447.78};
+static float P043[3] = {211.14, -749.91, 4429.73};
+static float P044[3] = {680.57, -370.27, 5943.46};
+static float P045[3] = {834.01, 363.09, 6360.63};
+static float P046[3] = {371.29, 804.51, 6486.26};
+static float P047[3] = {-291.43, 797.22, 6494.28};
+static float P048[3] = {-784.13, 370.75, 6378.01};
+static float P049[3] = {-743.29, -325.82, 5943.46};
+static float P050[3] = {-383.24, -804.77, 5943.46};
+static float P051[3] = {283.47, -846.09, 5943.46};
+static float iP001[3] = {5.68, -300.95, 1324.70};
+#if 0
+static float iP002[3] = {338.69, -219.63, 9677.03};
+static float iP003[3] = {12.18, 624.93, 8956.39};
+static float iP004[3] = {-7.49, -388.91, 10896.74};
+static float iP005[3] = {487.51, 198.05, 9350.78};
+static float iP006[3] = {-457.61, 199.04, 9353.01};
+static float iP007[3] = {156.52, -266.72, 10311.68};
+static float iP008[3] = {-185.56, -266.51, 10310.47};
+#endif
+static float iP009[3] = {124.39, -261.46, 1942.34};
+static float iP010[3] = {-130.05, -261.46, 1946.03};
+static float iP011[3] = {141.07, -320.11, 1239.38};
+static float iP012[3] = {156.48, -360.12, 2073.41};
+static float iP013[3] = {162.00, -175.88, 2064.44};
+static float iP014[3] = {88.16, -87.72, 2064.02};
+static float iP015[3] = {-65.21, -96.13, 2064.02};
+static float iP016[3] = {-156.48, -180.96, 2064.44};
+static float iP017[3] = {-162.00, -368.93, 2082.39};
+static float iP018[3] = {-88.16, -439.22, 2082.39};
+static float iP019[3] = {65.21, -440.32, 2083.39};
+static float iP020[3] = {246.87, -356.02, 2576.95};
+static float iP021[3] = {253.17, -111.15, 2567.15};
+static float iP022[3] = {132.34, 51.41, 2559.84};
+static float iP023[3] = {-97.88, 40.44, 2567.15};
+static float iP024[3] = {-222.97, -117.49, 2567.15};
+static float iP025[3] = {-252.22, -371.53, 2569.92};
+static float iP026[3] = {-108.44, -518.19, 2586.75};
+static float iP027[3] = {97.88, -524.79, 2586.75};
+static float iP028[3] = {370.03, -421.19, 3419.70};
+static float iP029[3] = {351.15, -16.98, 3423.17};
+static float iP030[3] = {200.66, 248.46, 3430.37};
+static float iP031[3] = {-148.42, 235.02, 3417.91};
+static float iP032[3] = {-360.21, -30.27, 3416.84};
+static float iP033[3] = {-357.90, -414.89, 3407.04};
+static float iP034[3] = {-148.88, -631.35, 3409.90};
+static float iP035[3] = {156.38, -632.59, 3419.70};
+static float iP036[3] = {462.61, -469.21, 4431.51};
+static float iP037[3] = {466.60, 102.25, 4434.98};
+static float iP038[3] = {243.05, 474.34, 4562.02};
+static float iP039[3] = {-191.23, 474.40, 4554.42};
+static float iP040[3] = {-476.12, 111.05, 4451.11};
+static float iP041[3] = {-473.36, -470.74, 4444.78};
+static float iP042[3] = {-266.95, -748.41, 4447.78};
+static float iP043[3] = {211.14, -749.91, 4429.73};
+static float iP044[3] = {680.57, -370.27, 5943.46};
+static float iP045[3] = {834.01, 363.09, 6360.63};
+static float iP046[3] = {371.29, 804.51, 6486.26};
+static float iP047[3] = {-291.43, 797.22, 6494.28};
+static float iP048[3] = {-784.13, 370.75, 6378.01};
+static float iP049[3] = {-743.29, -325.82, 5943.46};
+static float iP050[3] = {-383.24, -804.77, 5943.46};
+static float iP051[3] = {283.47, -846.09, 5943.46};
+static float P052[3] = {599.09, -300.15, 7894.03};
+static float P053[3] = {735.48, 306.26, 7911.92};
+static float P054[3] = {246.22, 558.53, 8460.50};
+static float P055[3] = {-230.41, 559.84, 8473.23};
+static float P056[3] = {-698.66, 320.83, 7902.59};
+static float P057[3] = {-643.29, -299.16, 7902.59};
+static float P058[3] = {-341.47, -719.30, 7902.59};
+static float P059[3] = {252.57, -756.12, 7902.59};
+static float P060[3] = {458.39, -265.31, 9355.44};
+#if 0
+static float P061[3] = {433.38, -161.90, 9503.03};
+#endif
+static float P062[3] = {224.04, 338.75, 9450.30};
+static float P063[3] = {-165.71, 341.04, 9462.35};
+static float P064[3] = {-298.11, 110.13, 10180.37};
+static float P065[3] = {-473.99, -219.71, 9355.44};
+static float P066[3] = {-211.97, -479.87, 9355.44};
+static float P067[3] = {192.86, -491.45, 9348.73};
+static float P068[3] = {-136.29, -319.84, 1228.73};
+static float P069[3] = {1111.17, -314.14, 1314.19};
+static float P070[3] = {-1167.34, -321.61, 1319.45};
+static float P071[3] = {1404.86, -306.66, 1235.45};
+static float P072[3] = {-1409.73, -314.14, 1247.66};
+static float P073[3] = {1254.01, -296.87, 1544.58};
+static float P074[3] = {-1262.09, -291.70, 1504.26};
+static float P075[3] = {965.71, -269.26, 1742.65};
+static float P076[3] = {-900.97, -276.74, 1726.07};
+static float iP068[3] = {-136.29, -319.84, 1228.73};
+static float iP069[3] = {1111.17, -314.14, 1314.19};
+static float iP070[3] = {-1167.34, -321.61, 1319.45};
+static float iP071[3] = {1404.86, -306.66, 1235.45};
+static float iP072[3] = {-1409.73, -314.14, 1247.66};
+static float iP073[3] = {1254.01, -296.87, 1544.58};
+static float iP074[3] = {-1262.09, -291.70, 1504.26};
+static float iP075[3] = {965.71, -269.26, 1742.65};
+static float iP076[3] = {-900.97, -276.74, 1726.07};
+static float P077[3] = {1058.00, -448.81, 8194.66};
+static float P078[3] = {-1016.51, -456.43, 8190.62};
+static float P079[3] = {-1515.96, -676.45, 7754.93};
+static float P080[3] = {1856.75, -830.34, 7296.56};
+static float P081[3] = {1472.16, -497.38, 7399.68};
+static float P082[3] = {-1775.26, -829.51, 7298.46};
+static float P083[3] = {911.09, -252.51, 7510.99};
+static float P084[3] = {-1451.94, -495.62, 7384.30};
+static float P085[3] = {1598.75, -669.26, 7769.90};
+static float P086[3] = {-836.53, -250.08, 7463.25};
+static float P087[3] = {722.87, -158.18, 8006.41};
+static float P088[3] = {-688.86, -162.28, 7993.89};
+static float P089[3] = {-626.92, -185.30, 8364.98};
+static float P090[3] = {647.72, -189.46, 8354.99};
+static float P091[3] = {0.00, 835.01, 5555.62};
+static float P092[3] = {0.00, 1350.18, 5220.86};
+static float P093[3] = {0.00, 1422.94, 5285.27};
+static float P094[3] = {0.00, 1296.75, 5650.19};
+static float P095[3] = {0.00, 795.63, 6493.88};
+static float iP091[3] = {0.00, 835.01, 5555.62};
+static float iP092[3] = {0.00, 1350.18, 5220.86};
+static float iP093[3] = {0.00, 1422.94, 5285.27};
+static float iP094[3] = {0.00, 1296.75, 5650.19};
+static float iP095[3] = {0.00, 795.63, 6493.88};
+#if 0
+static float P096[3] = {-447.38, -165.99, 9499.60};
+#endif
+static float P097[3] = {-194.91, -357.14, 10313.32};
+static float P098[3] = {135.35, -357.66, 10307.94};
+static float iP097[3] = {-194.91, -357.14, 10313.32};
+static float iP098[3] = {135.35, -357.66, 10307.94};
+static float P099[3] = {-380.53, -221.14, 9677.98};
+static float P100[3] = {0.00, 412.99, 9629.33};
+#if 0
+static float P101[3] = {5.70, 567.00, 7862.98};
+#endif
+static float P102[3] = {59.51, -412.55, 10677.58};
+static float iP102[3] = {59.51, -412.55, 10677.58};
+static float P103[3] = {6.50, 484.74, 9009.94};
+#if 0
+static float P104[3] = {-9.86, 567.62, 7858.65};
+#endif
+static float P105[3] = {-41.86, 476.51, 9078.17};
+#if 0
+static float P106[3] = {22.75, 568.13, 7782.83};
+static float P107[3] = {58.93, 568.42, 7775.94};
+#endif
+static float P108[3] = {49.20, 476.83, 9078.24};
+#if 0
+static float P109[3] = {99.21, 566.00, 7858.65};
+#endif
+static float P110[3] = {-187.62, -410.04, 10674.12};
+static float iP110[3] = {-187.62, -410.04, 10674.12};
+static float P111[3] = {-184.25, -318.70, 10723.88};
+static float iP111[3] = {-184.25, -318.70, 10723.88};
+static float P112[3] = {-179.61, -142.81, 10670.26};
+static float P113[3] = {57.43, -147.94, 10675.26};
+static float P114[3] = {54.06, -218.90, 10712.44};
+static float P115[3] = {-186.35, -212.09, 10713.76};
+static float P116[3] = {205.90, -84.61, 10275.97};
+static float P117[3] = {-230.96, -83.26, 10280.09};
+static float iP118[3] = {216.78, -509.17, 10098.94};
+static float iP119[3] = {-313.21, -510.79, 10102.62};
+static float P118[3] = {216.78, -509.17, 10098.94};
+static float P119[3] = {-313.21, -510.79, 10102.62};
+static float P120[3] = {217.95, 96.34, 10161.62};
+static float P121[3] = {71.99, -319.74, 10717.70};
+static float iP121[3] = {71.99, -319.74, 10717.70};
+static float P122[3] = {0.00, 602.74, 5375.84};
+static float iP122[3] = {0.00, 602.74, 5375.84};
+static float P123[3] = {-448.94, -203.14, 9499.60};
+static float P124[3] = {-442.64, -185.20, 9528.07};
+static float P125[3] = {-441.07, -148.05, 9528.07};
+static float P126[3] = {-443.43, -128.84, 9499.60};
+static float P127[3] = {-456.87, -146.78, 9466.67};
+static float P128[3] = {-453.68, -183.93, 9466.67};
+static float P129[3] = {428.43, -124.08, 9503.03};
+static float P130[3] = {419.73, -142.14, 9534.56};
+static float P131[3] = {419.92, -179.96, 9534.56};
+static float P132[3] = {431.20, -199.73, 9505.26};
+static float P133[3] = {442.28, -181.67, 9475.96};
+static float P134[3] = {442.08, -143.84, 9475.96};
+/* *INDENT-ON* */
+
+
+
+static void
+Dolphin001(GLenum cap)
+{
+       glNormal3fv(N071);
+       glBegin(cap);
+       glVertex3fv(P001);
+       glVertex3fv(P068);
+       glVertex3fv(P010);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P068);
+       glVertex3fv(P076);
+       glVertex3fv(P010);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P068);
+       glVertex3fv(P070);
+       glVertex3fv(P076);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P076);
+       glVertex3fv(P070);
+       glVertex3fv(P074);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P070);
+       glVertex3fv(P072);
+       glVertex3fv(P074);
+       glEnd();
+       glNormal3fv(N119);
+       glBegin(cap);
+       glVertex3fv(P072);
+       glVertex3fv(P070);
+       glVertex3fv(P074);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P074);
+       glVertex3fv(P070);
+       glVertex3fv(P076);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P070);
+       glVertex3fv(P068);
+       glVertex3fv(P076);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P076);
+       glVertex3fv(P068);
+       glVertex3fv(P010);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P068);
+       glVertex3fv(P001);
+       glVertex3fv(P010);
+       glEnd();
+}
+
+static void
+Dolphin002(GLenum cap)
+{
+       glNormal3fv(N071);
+       glBegin(cap);
+       glVertex3fv(P011);
+       glVertex3fv(P001);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P075);
+       glVertex3fv(P011);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P069);
+       glVertex3fv(P011);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P069);
+       glVertex3fv(P075);
+       glVertex3fv(P073);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P071);
+       glVertex3fv(P069);
+       glVertex3fv(P073);
+       glEnd();
+       glNormal3fv(N119);
+       glBegin(cap);
+       glVertex3fv(P001);
+       glVertex3fv(P011);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P009);
+       glVertex3fv(P011);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P011);
+       glVertex3fv(P069);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P069);
+       glVertex3fv(P073);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P069);
+       glVertex3fv(P071);
+       glVertex3fv(P073);
+       glEnd();
+}
+
+static void
+Dolphin003(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glEnd();
+}
+
+static void
+Dolphin004(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glEnd();
+}
+
+static void
+Dolphin005(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glEnd();
+}
+
+static void
+Dolphin006(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N093);
+       glVertex3fv(P093);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N093);
+       glVertex3fv(P093);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N091);
+       glVertex3fv(P091);
+       glNormal3fv(N095);
+       glVertex3fv(P095);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N091);
+       glVertex3fv(P091);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glNormal3fv(N095);
+       glVertex3fv(P095);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N122);
+       glVertex3fv(P122);
+       glNormal3fv(N095);
+       glVertex3fv(P095);
+       glNormal3fv(N091);
+       glVertex3fv(P091);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N122);
+       glVertex3fv(P122);
+       glNormal3fv(N091);
+       glVertex3fv(P091);
+       glNormal3fv(N095);
+       glVertex3fv(P095);
+       glEnd();
+}
+
+static void
+Dolphin007(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glEnd();
+}
+
+static void
+Dolphin008(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glEnd();
+}
+
+static void
+Dolphin009(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glEnd();
+}
+
+static void
+Dolphin010(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N080);
+       glVertex3fv(P080);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N090);
+       glVertex3fv(P090);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N080);
+       glVertex3fv(P080);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glNormal3fv(N090);
+       glVertex3fv(P090);
+       glEnd();
+}
+
+static void
+Dolphin011(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N082);
+       glVertex3fv(P082);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N088);
+       glVertex3fv(P088);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glNormal3fv(N088);
+       glVertex3fv(P088);
+       glNormal3fv(N089);
+       glVertex3fv(P089);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N088);
+       glVertex3fv(P088);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N089);
+       glVertex3fv(P089);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N089);
+       glVertex3fv(P089);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N082);
+       glVertex3fv(P082);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+}
+
+static void
+Dolphin012(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glEnd();
+}
+
+static void
+Dolphin013(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N116);
+       glVertex3fv(P116);
+       glNormal3fv(N117);
+       glVertex3fv(P117);
+       glNormal3fv(N112);
+       glVertex3fv(P112);
+       glNormal3fv(N113);
+       glVertex3fv(P113);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N114);
+       glVertex3fv(P114);
+       glNormal3fv(N113);
+       glVertex3fv(P113);
+       glNormal3fv(N112);
+       glVertex3fv(P112);
+       glNormal3fv(N115);
+       glVertex3fv(P115);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N114);
+       glVertex3fv(P114);
+       glNormal3fv(N116);
+       glVertex3fv(P116);
+       glNormal3fv(N113);
+       glVertex3fv(P113);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N114);
+       glVertex3fv(P114);
+       glNormal3fv(N007);
+       glVertex3fv(P007);
+       glNormal3fv(N116);
+       glVertex3fv(P116);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N007);
+       glVertex3fv(P007);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N116);
+       glVertex3fv(P116);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P002);
+       glVertex3fv(P007);
+       glVertex3fv(P008);
+       glVertex3fv(P099);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P007);
+       glVertex3fv(P114);
+       glVertex3fv(P115);
+       glVertex3fv(P008);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N117);
+       glVertex3fv(P117);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N117);
+       glVertex3fv(P117);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glNormal3fv(N112);
+       glVertex3fv(P112);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N112);
+       glVertex3fv(P112);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glNormal3fv(N115);
+       glVertex3fv(P115);
+       glEnd();
+}
+
+static void
+Dolphin014(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N111);
+       glVertex3fv(P111);
+       glNormal3fv(N110);
+       glVertex3fv(P110);
+       glNormal3fv(N102);
+       glVertex3fv(P102);
+       glNormal3fv(N121);
+       glVertex3fv(P121);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N111);
+       glVertex3fv(P111);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glNormal3fv(N110);
+       glVertex3fv(P110);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glNormal3fv(N119);
+       glVertex3fv(P119);
+       glNormal3fv(N110);
+       glVertex3fv(P110);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glNormal3fv(N119);
+       glVertex3fv(P119);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N119);
+       glVertex3fv(P119);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N119);
+       glVertex3fv(P119);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P098);
+       glVertex3fv(P097);
+       glVertex3fv(P111);
+       glVertex3fv(P121);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P002);
+       glVertex3fv(P099);
+       glVertex3fv(P097);
+       glVertex3fv(P098);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N110);
+       glVertex3fv(P110);
+       glNormal3fv(N119);
+       glVertex3fv(P119);
+       glNormal3fv(N118);
+       glVertex3fv(P118);
+       glNormal3fv(N102);
+       glVertex3fv(P102);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N119);
+       glVertex3fv(P119);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glNormal3fv(N118);
+       glVertex3fv(P118);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N118);
+       glVertex3fv(P118);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N118);
+       glVertex3fv(P118);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N098);
+       glVertex3fv(P098);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N118);
+       glVertex3fv(P118);
+       glNormal3fv(N098);
+       glVertex3fv(P098);
+       glNormal3fv(N102);
+       glVertex3fv(P102);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N102);
+       glVertex3fv(P102);
+       glNormal3fv(N098);
+       glVertex3fv(P098);
+       glNormal3fv(N121);
+       glVertex3fv(P121);
+       glEnd();
+}
+
+static void
+Dolphin015(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glNormal3fv(N120);
+       glVertex3fv(P120);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glNormal3fv(N117);
+       glVertex3fv(P117);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N120);
+       glVertex3fv(P120);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glNormal3fv(N117);
+       glVertex3fv(P117);
+       glNormal3fv(N116);
+       glVertex3fv(P116);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N120);
+       glVertex3fv(P120);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N120);
+       glVertex3fv(P120);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N120);
+       glVertex3fv(P120);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N120);
+       glVertex3fv(P120);
+       glNormal3fv(N116);
+       glVertex3fv(P116);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+}
+
+static void
+Dolphin016(GLenum cap)
+{
+
+       glDisable(GL_DEPTH_TEST);
+       glBegin(cap);
+       glVertex3fv(P123);
+       glVertex3fv(P124);
+       glVertex3fv(P125);
+       glVertex3fv(P126);
+       glVertex3fv(P127);
+       glVertex3fv(P128);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P129);
+       glVertex3fv(P130);
+       glVertex3fv(P131);
+       glVertex3fv(P132);
+       glVertex3fv(P133);
+       glVertex3fv(P134);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P103);
+       glVertex3fv(P105);
+       glVertex3fv(P108);
+       glEnd();
+       glEnable(GL_DEPTH_TEST);
+}
+
+void
+DrawDolphin(fishRec * fish, int wire)
+{
+       float       seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7;
+       float       pitch, thrash, chomp;
+       GLenum      cap;
+
+       fish->htail = (int) (fish->htail - (int) (10.0 * fish->v)) % 360;
+
+       thrash = 70.0 * fish->v;
+
+       seg0 = 1.0 * thrash * sin((fish->htail) * RRAD);
+       seg3 = 1.0 * thrash * sin((fish->htail) * RRAD);
+       seg1 = 2.0 * thrash * sin((fish->htail + 4.0) * RRAD);
+       seg2 = 3.0 * thrash * sin((fish->htail + 6.0) * RRAD);
+       seg4 = 4.0 * thrash * sin((fish->htail + 10.0) * RRAD);
+       seg5 = 4.5 * thrash * sin((fish->htail + 15.0) * RRAD);
+       seg6 = 5.0 * thrash * sin((fish->htail + 20.0) * RRAD);
+       seg7 = 6.0 * thrash * sin((fish->htail + 30.0) * RRAD);
+
+       pitch = fish->v * sin((fish->htail + 180.0) * RRAD);
+
+#if 0
+       /* Dead code */
+       if (fish->v > 2.0) {
+               chomp = -(fish->v - 2.0) * 200.0;
+       }
+#endif
+       chomp = 100.0;
+
+       P012[1] = iP012[1] + seg5;
+       P013[1] = iP013[1] + seg5;
+       P014[1] = iP014[1] + seg5;
+       P015[1] = iP015[1] + seg5;
+       P016[1] = iP016[1] + seg5;
+       P017[1] = iP017[1] + seg5;
+       P018[1] = iP018[1] + seg5;
+       P019[1] = iP019[1] + seg5;
+
+       P020[1] = iP020[1] + seg4;
+       P021[1] = iP021[1] + seg4;
+       P022[1] = iP022[1] + seg4;
+       P023[1] = iP023[1] + seg4;
+       P024[1] = iP024[1] + seg4;
+       P025[1] = iP025[1] + seg4;
+       P026[1] = iP026[1] + seg4;
+       P027[1] = iP027[1] + seg4;
+
+       P028[1] = iP028[1] + seg2;
+       P029[1] = iP029[1] + seg2;
+       P030[1] = iP030[1] + seg2;
+       P031[1] = iP031[1] + seg2;
+       P032[1] = iP032[1] + seg2;
+       P033[1] = iP033[1] + seg2;
+       P034[1] = iP034[1] + seg2;
+       P035[1] = iP035[1] + seg2;
+
+       P036[1] = iP036[1] + seg1;
+       P037[1] = iP037[1] + seg1;
+       P038[1] = iP038[1] + seg1;
+       P039[1] = iP039[1] + seg1;
+       P040[1] = iP040[1] + seg1;
+       P041[1] = iP041[1] + seg1;
+       P042[1] = iP042[1] + seg1;
+       P043[1] = iP043[1] + seg1;
+
+       P044[1] = iP044[1] + seg0;
+       P045[1] = iP045[1] + seg0;
+       P046[1] = iP046[1] + seg0;
+       P047[1] = iP047[1] + seg0;
+       P048[1] = iP048[1] + seg0;
+       P049[1] = iP049[1] + seg0;
+       P050[1] = iP050[1] + seg0;
+       P051[1] = iP051[1] + seg0;
+
+       P009[1] = iP009[1] + seg6;
+       P010[1] = iP010[1] + seg6;
+       P075[1] = iP075[1] + seg6;
+       P076[1] = iP076[1] + seg6;
+
+       P001[1] = iP001[1] + seg7;
+       P011[1] = iP011[1] + seg7;
+       P068[1] = iP068[1] + seg7;
+       P069[1] = iP069[1] + seg7;
+       P070[1] = iP070[1] + seg7;
+       P071[1] = iP071[1] + seg7;
+       P072[1] = iP072[1] + seg7;
+       P073[1] = iP073[1] + seg7;
+       P074[1] = iP074[1] + seg7;
+
+       P091[1] = iP091[1] + seg3;
+       P092[1] = iP092[1] + seg3;
+       P093[1] = iP093[1] + seg3;
+       P094[1] = iP094[1] + seg3;
+       P095[1] = iP095[1] + seg3;
+       P122[1] = iP122[1] + seg3 * 1.5;
+
+       P097[1] = iP097[1] + chomp;
+       P098[1] = iP098[1] + chomp;
+       P102[1] = iP102[1] + chomp;
+       P110[1] = iP110[1] + chomp;
+       P111[1] = iP111[1] + chomp;
+       P121[1] = iP121[1] + chomp;
+       P118[1] = iP118[1] + chomp;
+       P119[1] = iP119[1] + chomp;
+
+       glPushMatrix();
+
+       glRotatef(pitch, 1.0, 0.0, 0.0);
+
+       glTranslatef(0.0, 0.0, 7000.0);
+
+       glRotatef(180.0, 0.0, 1.0, 0.0);
+
+       glEnable(GL_CULL_FACE);
+       cap = wire ? GL_LINE_LOOP : GL_POLYGON;
+       Dolphin014(cap);
+       Dolphin010(cap);
+       Dolphin009(cap);
+       Dolphin012(cap);
+       Dolphin013(cap);
+       Dolphin006(cap);
+       Dolphin002(cap);
+       Dolphin001(cap);
+       Dolphin003(cap);
+       Dolphin015(cap);
+       Dolphin004(cap);
+       Dolphin005(cap);
+       Dolphin007(cap);
+       Dolphin008(cap);
+       Dolphin011(cap);
+       Dolphin016(cap);
+       glDisable(GL_CULL_FACE);
+
+       glPopMatrix();
+}
+#endif
diff --git a/modes/glx/e_textures.h b/modes/glx/e_textures.h
new file mode 100644 (file)
index 0000000..7f9457e
--- /dev/null
@@ -0,0 +1,1478 @@
+static unsigned char WoodTextureWidth = 199;
+static unsigned char WoodTextureHeight = 37;
+static unsigned char WoodTextureData[] =
+{
+       84, 30, 12, 84, 26, 12, 108, 42, 28, 100, 38, 28, 108, 42, 28,
+       108, 46, 28, 100, 38, 28, 108, 46, 28, 108, 42, 28, 108, 42, 20,
+       108, 42, 28, 108, 38, 20, 108, 42, 20, 108, 42, 28, 116, 42, 28,
+       108, 42, 20, 108, 46, 28, 100, 34, 12, 108, 42, 20, 108, 42, 20,
+       108, 42, 20, 108, 38, 20, 100, 38, 20, 100, 38, 20, 108, 42, 20,
+       108, 42, 20, 108, 38, 20, 100, 38, 20, 108, 38, 20, 100, 38, 20,
+       108, 42, 20, 108, 42, 20, 108, 42, 28, 108, 42, 20, 108, 42, 20,
+       100, 38, 20, 100, 38, 20, 100, 38, 20, 108, 38, 20, 116, 50, 28,
+       108, 42, 28, 108, 42, 20, 100, 38, 20, 108, 42, 20, 108, 42, 20,
+       108, 46, 28, 108, 42, 20, 108, 42, 20, 108, 42, 20, 100, 38, 20,
+       108, 38, 20, 100, 38, 20, 108, 38, 20, 100, 38, 20, 100, 38, 20,
+       108, 38, 20, 100, 38, 20, 108, 38, 20, 100, 42, 20, 108, 42, 20,
+       108, 42, 28, 108, 42, 20, 100, 38, 20, 108, 42, 20, 100, 38, 20,
+       100, 34, 12, 100, 38, 20, 108, 38, 20, 100, 38, 20, 108, 42, 20,
+       108, 42, 20, 108, 42, 20, 100, 38, 20, 108, 38, 20, 100, 38, 20,
+       100, 34, 12, 100, 38, 20, 108, 38, 20, 100, 38, 20, 108, 42, 20,
+       100, 38, 20, 100, 34, 12, 100, 34, 12, 100, 38, 20, 108, 38, 20,
+       100, 38, 20, 108, 38, 20, 108, 42, 20, 100, 38, 20, 108, 42, 20,
+       108, 42, 28, 108, 46, 20, 108, 38, 20, 108, 42, 20, 108, 46, 28,
+       108, 46, 28, 108, 42, 20, 108, 42, 20, 108, 42, 20, 100, 38, 20,
+       108, 42, 20, 100, 38, 20, 108, 38, 20, 100, 38, 20, 108, 38, 20,
+       108, 42, 20, 108, 46, 28, 116, 50, 28, 116, 54, 36, 116, 54, 36,
+       116, 54, 28, 108, 46, 28, 108, 42, 20, 108, 42, 28, 108, 42, 20,
+       108, 42, 20, 108, 46, 28, 116, 50, 28, 116, 50, 28, 116, 50, 28,
+       116, 46, 28, 108, 42, 28, 116, 50, 36, 116, 50, 36, 100, 38, 20,
+       108, 42, 28, 108, 38, 20, 100, 38, 20, 108, 38, 20, 108, 42, 28,
+       108, 46, 28, 116, 46, 28, 108, 42, 28, 108, 42, 28, 108, 42, 20,
+       108, 46, 28, 116, 50, 28, 116, 50, 28, 116, 50, 28, 116, 50, 28,
+       108, 42, 28, 108, 42, 20, 100, 38, 20, 116, 50, 28, 108, 46, 28,
+       108, 42, 20, 108, 42, 20, 108, 46, 28, 116, 46, 28, 108, 46, 28,
+       108, 46, 28, 108, 46, 20, 108, 46, 28, 116, 46, 28, 108, 46, 28,
+       116, 50, 28, 108, 46, 28, 108, 46, 28, 108, 42, 20, 116, 46, 28,
+       108, 46, 28, 108, 42, 20, 108, 42, 28, 108, 46, 28, 116, 50, 28,
+       116, 50, 28, 116, 50, 36, 124, 54, 36, 116, 54, 36, 116, 54, 28,
+       116, 50, 28, 116, 50, 28, 108, 46, 28, 116, 46, 28, 108, 46, 28,
+       116, 50, 28, 116, 46, 28, 116, 50, 28, 116, 50, 28, 116, 50, 28,
+       116, 50, 28, 108, 46, 28, 108, 46, 20, 124, 50, 36, 116, 54, 28,
+       124, 54, 28, 116, 54, 28, 116, 54, 28, 116, 54, 28, 124, 54, 36,
+       124, 58, 36, 124, 50, 36, 116, 46, 28, 116, 46, 28, 116, 42, 28,
+       116, 50, 36, 124, 66, 44, 108, 58, 36, 84, 30, 12, 100, 42, 20,
+       116, 54, 36, 140, 82, 68, 148, 86, 68, 148, 86, 68, 156, 90, 76,
+       148, 86, 68, 156, 86, 76, 156, 86, 68, 148, 86, 68, 156, 86, 68,
+       156, 86, 68, 156, 86, 68, 156, 86, 68, 156, 90, 68, 156, 86, 68,
+       156, 90, 68, 164, 94, 76, 164, 98, 84, 164, 102, 84, 164, 102, 84,
+       164, 98, 76, 156, 94, 68, 164, 94, 76, 156, 94, 76, 164, 98, 84,
+       164, 98, 76, 164, 98, 76, 156, 94, 76, 164, 98, 76, 164, 98, 76,
+       164, 102, 84, 164, 102, 84, 172, 106, 84, 172, 106, 84, 164, 98, 76,
+       164, 94, 68, 164, 94, 68, 164, 98, 76, 172, 106, 84, 164, 98, 76,
+       164, 98, 76, 164, 94, 68, 164, 94, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 102, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 94, 68, 164, 98, 76, 164, 98, 76, 164, 102, 76,
+       164, 94, 76, 156, 94, 68, 172, 102, 84, 172, 106, 84, 172, 102, 84,
+       164, 98, 76, 164, 102, 76, 172, 102, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 102, 84, 164, 102, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 172, 102, 76, 164, 98, 76,
+       164, 94, 76, 156, 94, 68, 164, 98, 76, 164, 102, 76, 164, 98, 76,
+       164, 98, 76, 164, 94, 76, 156, 94, 68, 164, 94, 76, 164, 102, 76,
+       172, 106, 84, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 102, 76, 172, 102, 84,
+       172, 106, 84, 172, 110, 84, 180, 110, 92, 172, 110, 84, 172, 110, 84,
+     180, 114, 92, 188, 122, 100, 188, 122, 100, 188, 122, 100, 188, 118, 92,
+       180, 110, 92, 172, 106, 84, 172, 106, 84, 172, 106, 84, 180, 114, 92,
+   188, 118, 100, 188, 118, 100, 180, 118, 100, 188, 122, 108, 188, 126, 108,
+   188, 118, 100, 196, 130, 108, 204, 134, 116, 188, 126, 108, 196, 122, 108,
+    180, 118, 100, 180, 110, 92, 180, 114, 100, 180, 118, 100, 188, 118, 100,
+   188, 122, 108, 188, 118, 100, 188, 118, 100, 180, 118, 100, 188, 118, 100,
+     180, 118, 100, 180, 118, 100, 180, 118, 100, 180, 114, 92, 180, 114, 92,
+       172, 110, 92, 172, 106, 84, 180, 114, 92, 172, 106, 92, 172, 102, 84,
+       172, 106, 84, 172, 110, 92, 180, 110, 84, 172, 110, 92, 172, 106, 84,
+       172, 102, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 102, 84,
+       164, 102, 84, 164, 102, 76, 172, 106, 84, 172, 110, 92, 180, 110, 92,
+       172, 110, 84, 172, 114, 92, 180, 114, 92, 180, 110, 92, 172, 110, 92,
+       172, 106, 92, 172, 106, 84, 172, 106, 84, 164, 102, 84, 180, 114, 100,
+      180, 114, 92, 180, 118, 100, 180, 118, 100, 180, 114, 92, 172, 110, 92,
+       172, 106, 84, 172, 106, 84, 180, 110, 92, 180, 114, 92, 180, 114, 92,
+       172, 110, 92, 172, 110, 84, 172, 110, 92, 180, 114, 92, 180, 118, 100,
+   196, 126, 100, 196, 122, 108, 196, 126, 108, 196, 130, 116, 196, 134, 116,
+       204, 142, 124, 164, 106, 84, 100, 42, 20, 84, 26, 4, 132, 78, 68,
+   188, 122, 108, 188, 122, 108, 188, 126, 116, 196, 134, 116, 188, 122, 108,
+   188, 126, 108, 188, 126, 108, 188, 122, 108, 196, 126, 108, 196, 130, 108,
+   188, 126, 108, 188, 122, 100, 196, 126, 108, 196, 126, 108, 188, 126, 108,
+   196, 130, 108, 196, 130, 108, 196, 134, 116, 196, 130, 108, 196, 130, 108,
+   188, 126, 108, 196, 126, 108, 188, 126, 108, 196, 130, 108, 188, 126, 108,
+   188, 126, 108, 196, 126, 108, 188, 126, 108, 196, 130, 108, 196, 130, 108,
+   196, 134, 116, 204, 142, 116, 204, 134, 116, 196, 130, 108, 196, 130, 108,
+   188, 126, 108, 196, 126, 100, 196, 134, 108, 196, 130, 108, 188, 126, 100,
+   188, 122, 100, 188, 126, 108, 196, 126, 100, 188, 126, 108, 196, 126, 100,
+   188, 126, 100, 196, 130, 108, 204, 134, 108, 196, 134, 116, 196, 134, 108,
+   196, 130, 108, 196, 126, 108, 196, 130, 108, 196, 130, 108, 196, 130, 108,
+   188, 126, 108, 196, 126, 108, 196, 134, 108, 196, 130, 108, 196, 130, 108,
+   188, 122, 100, 196, 130, 108, 196, 130, 108, 196, 134, 108, 196, 130, 108,
+   188, 126, 100, 196, 130, 108, 196, 134, 108, 204, 134, 116, 204, 138, 116,
+   204, 138, 116, 204, 134, 116, 196, 130, 108, 196, 130, 108, 196, 134, 108,
+   204, 134, 116, 196, 134, 116, 196, 134, 108, 196, 130, 108, 196, 130, 108,
+   204, 134, 116, 204, 138, 116, 204, 138, 116, 196, 130, 108, 196, 130, 108,
+    188, 122, 100, 180, 118, 92, 188, 118, 100, 196, 130, 108, 196, 130, 108,
+   188, 126, 100, 188, 122, 100, 188, 122, 100, 204, 134, 108, 196, 134, 116,
+   204, 134, 116, 196, 134, 108, 196, 130, 108, 204, 134, 108, 204, 138, 116,
+   204, 138, 116, 212, 142, 124, 204, 142, 116, 204, 134, 116, 204, 138, 116,
+   204, 138, 116, 204, 138, 116, 204, 134, 108, 188, 126, 108, 196, 130, 108,
+   196, 126, 100, 188, 122, 100, 196, 130, 108, 204, 138, 116, 212, 146, 124,
+   204, 142, 116, 204, 138, 116, 212, 146, 124, 212, 142, 124, 204, 138, 124,
+   204, 138, 124, 204, 138, 124, 204, 138, 116, 212, 142, 124, 204, 138, 124,
+   196, 130, 116, 204, 134, 116, 204, 138, 116, 204, 138, 124, 204, 138, 116,
+   204, 138, 124, 204, 134, 116, 204, 138, 124, 212, 142, 124, 204, 138, 116,
+   196, 134, 116, 196, 130, 108, 196, 134, 116, 204, 138, 116, 204, 142, 124,
+   212, 142, 124, 204, 138, 116, 204, 138, 116, 204, 138, 116, 204, 138, 116,
+   204, 138, 124, 204, 142, 124, 204, 142, 116, 204, 138, 124, 196, 134, 108,
+   196, 134, 116, 196, 134, 116, 196, 130, 116, 196, 130, 108, 188, 126, 108,
+   196, 126, 108, 188, 130, 108, 188, 126, 108, 188, 122, 100, 180, 118, 100,
+   188, 118, 100, 188, 126, 108, 196, 130, 108, 196, 126, 108, 188, 126, 108,
+   188, 122, 100, 188, 122, 108, 188, 126, 108, 196, 126, 108, 196, 130, 108,
+   188, 126, 108, 196, 126, 108, 188, 126, 108, 196, 134, 108, 196, 134, 116,
+   196, 134, 108, 196, 130, 108, 196, 126, 108, 188, 122, 108, 188, 122, 100,
+   188, 122, 100, 196, 130, 108, 196, 130, 100, 196, 130, 108, 196, 130, 100,
+   188, 130, 108, 196, 130, 108, 196, 134, 108, 204, 138, 116, 204, 130, 108,
+   204, 134, 116, 204, 134, 116, 204, 134, 116, 204, 138, 124, 204, 146, 124,
+       156, 102, 84, 84, 26, 4, 84, 26, 4, 116, 58, 36, 164, 106, 92,
+       164, 102, 84, 164, 106, 92, 172, 110, 92, 156, 98, 84, 172, 102, 84,
+      172, 102, 84, 180, 110, 92, 180, 118, 100, 180, 118, 100, 180, 110, 92,
+       180, 110, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 172, 106, 92,
+       172, 106, 84, 172, 106, 84, 172, 106, 92, 172, 110, 92, 172, 110, 92,
+       172, 106, 84, 172, 106, 84, 164, 102, 84, 164, 102, 84, 172, 102, 76,
+       164, 102, 84, 172, 106, 84, 172, 106, 84, 172, 110, 92, 172, 110, 84,
+       180, 110, 92, 172, 110, 84, 180, 110, 92, 172, 110, 84, 172, 106, 84,
+       172, 110, 84, 180, 110, 92, 172, 106, 84, 172, 102, 84, 164, 102, 84,
+       172, 102, 76, 172, 102, 84, 172, 102, 84, 164, 102, 76, 164, 94, 76,
+       172, 102, 84, 172, 110, 92, 172, 110, 84, 172, 102, 84, 164, 98, 76,
+       172, 102, 76, 172, 106, 84, 172, 110, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 180, 114, 92, 180, 114, 92, 172, 110, 84, 172, 106, 84,
+       172, 102, 76, 172, 110, 84, 172, 110, 84, 172, 102, 84, 172, 102, 84,
+       172, 106, 84, 180, 110, 92, 172, 110, 84, 180, 118, 92, 180, 114, 92,
+       180, 110, 92, 172, 110, 84, 180, 110, 92, 180, 114, 92, 180, 118, 92,
+      188, 122, 100, 188, 118, 100, 180, 114, 92, 180, 118, 92, 180, 114, 92,
+       180, 118, 92, 188, 118, 100, 180, 118, 92, 180, 114, 92, 180, 118, 92,
+      180, 110, 84, 180, 110, 92, 180, 118, 92, 188, 122, 100, 188, 114, 100,
+     180, 114, 92, 180, 114, 92, 196, 126, 108, 188, 126, 100, 188, 122, 100,
+    188, 118, 100, 180, 118, 100, 180, 114, 92, 188, 118, 100, 188, 122, 100,
+       180, 110, 92, 172, 110, 84, 180, 110, 92, 180, 114, 92, 188, 122, 100,
+      188, 126, 100, 188, 118, 100, 180, 114, 92, 172, 110, 84, 172, 110, 92,
+      180, 114, 92, 180, 114, 92, 180, 118, 92, 188, 118, 100, 188, 122, 100,
+       188, 122, 100, 180, 106, 92, 172, 110, 92, 172, 102, 84, 172, 102, 84,
+       164, 94, 76, 164, 94, 76, 164, 98, 76, 164, 102, 84, 172, 102, 84,
+       172, 106, 84, 180, 110, 92, 180, 110, 92, 180, 110, 92, 172, 106, 92,
+       172, 106, 84, 172, 106, 92, 172, 110, 84, 164, 102, 84, 164, 98, 76,
+       164, 94, 76, 164, 98, 76, 172, 110, 92, 180, 114, 92, 180, 118, 100,
+   180, 118, 100, 188, 122, 100, 180, 122, 108, 188, 122, 100, 188, 122, 100,
+   188, 122, 100, 188, 122, 100, 188, 126, 108, 188, 122, 100, 188, 126, 108,
+     188, 122, 100, 188, 122, 100, 180, 118, 100, 180, 114, 92, 180, 114, 92,
+       180, 118, 100, 180, 110, 92, 172, 110, 92, 172, 106, 84, 180, 110, 92,
+       180, 118, 92, 180, 118, 100, 180, 114, 92, 180, 110, 92, 172, 110, 84,
+       172, 110, 92, 180, 114, 92, 180, 114, 92, 180, 118, 92, 180, 118, 92,
+       180, 114, 92, 180, 118, 92, 180, 110, 92, 180, 110, 92, 180, 114, 92,
+       172, 110, 92, 172, 106, 84, 172, 106, 84, 172, 106, 92, 172, 110, 84,
+       180, 110, 92, 180, 114, 92, 180, 118, 92, 180, 118, 92, 180, 118, 92,
+     180, 118, 92, 188, 118, 100, 188, 122, 100, 180, 114, 100, 180, 110, 92,
+       188, 114, 100, 180, 110, 92, 172, 110, 92, 180, 126, 108, 148, 98, 76,
+       84, 26, 4, 84, 26, 12, 108, 50, 36, 164, 102, 84, 164, 98, 84,
+       156, 94, 76, 164, 98, 84, 148, 86, 68, 156, 90, 76, 156, 94, 84,
+       164, 90, 76, 164, 98, 84, 172, 102, 84, 164, 94, 76, 156, 90, 68,
+       164, 94, 76, 164, 98, 84, 164, 94, 76, 164, 98, 76, 164, 98, 84,
+       164, 98, 76, 172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       164, 102, 84, 164, 94, 68, 164, 94, 76, 156, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 84, 164, 102, 84, 172, 102, 84, 164, 98, 76,
+       164, 98, 76, 172, 102, 84, 172, 106, 84, 172, 106, 84, 180, 106, 84,
+       172, 110, 84, 172, 106, 84, 164, 102, 76, 164, 98, 76, 164, 98, 76,
+       164, 102, 76, 164, 102, 76, 164, 98, 76, 164, 98, 76, 172, 106, 84,
+       180, 110, 84, 172, 106, 84, 164, 98, 76, 164, 98, 76, 172, 106, 84,
+       180, 114, 92, 172, 106, 84, 164, 102, 76, 164, 98, 76, 172, 106, 84,
+       180, 110, 92, 180, 114, 92, 180, 110, 92, 172, 106, 84, 172, 106, 84,
+       180, 114, 92, 188, 118, 100, 180, 114, 92, 172, 110, 84, 180, 114, 92,
+       180, 114, 92, 180, 114, 92, 172, 110, 92, 172, 106, 84, 164, 102, 76,
+       172, 102, 76, 164, 102, 84, 180, 110, 84, 180, 118, 92, 188, 118, 100,
+       188, 122, 100, 180, 118, 92, 180, 110, 92, 180, 110, 84, 172, 106, 92,
+     180, 114, 84, 180, 114, 100, 188, 122, 100, 188, 122, 100, 180, 114, 92,
+       172, 110, 92, 180, 114, 92, 188, 118, 92, 180, 114, 92, 180, 114, 92,
+       180, 118, 92, 164, 102, 84, 172, 102, 84, 172, 106, 84, 172, 102, 76,
+       164, 102, 76, 172, 102, 84, 172, 110, 84, 180, 114, 92, 172, 110, 84,
+       172, 102, 84, 172, 106, 84, 180, 110, 84, 180, 118, 100, 188, 118, 92,
+       180, 110, 92, 172, 106, 84, 172, 106, 84, 180, 110, 92, 188, 118, 92,
+      180, 118, 100, 180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 118, 100,
+     180, 114, 92, 188, 122, 100, 188, 126, 108, 188, 118, 100, 172, 110, 92,
+       172, 102, 84, 172, 106, 84, 180, 106, 92, 164, 98, 76, 172, 102, 84,
+       172, 106, 92, 172, 106, 84, 172, 106, 84, 172, 102, 84, 172, 102, 84,
+       172, 102, 84, 172, 106, 84, 164, 102, 84, 164, 98, 76, 164, 98, 76,
+       172, 106, 84, 172, 110, 92, 180, 114, 92, 180, 114, 92, 180, 118, 100,
+   188, 122, 100, 188, 122, 100, 188, 126, 108, 188, 122, 100, 188, 122, 100,
+    188, 122, 108, 196, 126, 108, 180, 118, 92, 188, 118, 100, 180, 118, 100,
+      180, 118, 100, 180, 114, 92, 180, 110, 92, 180, 114, 92, 180, 118, 100,
+       180, 110, 92, 172, 110, 84, 172, 106, 92, 172, 110, 92, 188, 118, 100,
+       180, 118, 100, 180, 114, 92, 172, 106, 84, 180, 110, 92, 180, 114, 92,
+       172, 110, 92, 180, 114, 92, 180, 114, 100, 180, 114, 92, 172, 110, 92,
+       172, 110, 92, 180, 114, 92, 180, 114, 92, 180, 114, 100, 180, 110, 92,
+       172, 110, 92, 172, 110, 92, 180, 114, 92, 180, 118, 92, 172, 106, 84,
+      180, 110, 84, 180, 118, 92, 188, 122, 100, 180, 118, 100, 180, 118, 92,
+       180, 118, 92, 180, 114, 92, 180, 110, 92, 180, 110, 92, 188, 118, 108,
+       188, 118, 100, 188, 122, 100, 188, 130, 108, 156, 102, 84, 84, 26, 12,
+       84, 30, 12, 108, 46, 28, 140, 82, 68, 156, 90, 76, 156, 94, 84,
+       156, 94, 84, 156, 94, 76, 164, 94, 76, 156, 90, 76, 164, 94, 76,
+       156, 94, 76, 156, 90, 68, 156, 90, 68, 164, 90, 76, 156, 90, 68,
+       148, 82, 60, 148, 78, 60, 164, 98, 76, 164, 94, 76, 156, 90, 68,
+       156, 90, 68, 156, 94, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       156, 90, 68, 148, 86, 68, 156, 90, 68, 156, 90, 68, 156, 90, 76,
+       164, 94, 68, 156, 94, 76, 156, 94, 68, 156, 90, 68, 156, 90, 68,
+       172, 102, 76, 180, 114, 92, 188, 118, 92, 172, 106, 84, 180, 106, 84,
+       172, 106, 84, 164, 98, 76, 164, 94, 68, 164, 98, 76, 172, 102, 84,
+       172, 106, 84, 172, 102, 76, 164, 98, 76, 172, 106, 84, 180, 110, 92,
+       172, 110, 84, 172, 98, 76, 164, 98, 76, 172, 106, 84, 180, 118, 92,
+       180, 106, 84, 180, 106, 84, 172, 106, 84, 172, 110, 84, 180, 110, 92,
+       180, 110, 84, 172, 102, 76, 164, 98, 76, 164, 94, 68, 172, 106, 84,
+       180, 114, 92, 172, 106, 84, 164, 98, 76, 172, 98, 76, 172, 106, 84,
+       172, 106, 84, 180, 106, 84, 180, 110, 84, 172, 110, 84, 180, 110, 92,
+       180, 110, 84, 180, 110, 92, 180, 110, 84, 172, 106, 84, 188, 118, 92,
+       188, 114, 92, 172, 106, 84, 172, 102, 76, 172, 106, 84, 188, 118, 92,
+      188, 122, 100, 188, 118, 100, 188, 118, 92, 180, 110, 92, 180, 114, 84,
+       180, 114, 92, 180, 110, 92, 172, 106, 84, 164, 98, 76, 172, 102, 76,
+       180, 106, 84, 180, 114, 84, 172, 102, 76, 164, 94, 76, 172, 106, 84,
+       180, 110, 84, 172, 106, 84, 172, 106, 84, 188, 122, 100, 188, 118, 92,
+     180, 118, 92, 188, 118, 100, 196, 122, 100, 188, 122, 100, 180, 118, 92,
+       180, 110, 84, 188, 114, 92, 172, 110, 84, 172, 106, 84, 180, 114, 92,
+       188, 114, 92, 180, 114, 92, 180, 114, 84, 180, 114, 92, 180, 110, 92,
+       180, 110, 92, 180, 110, 92, 172, 106, 84, 164, 98, 76, 172, 110, 92,
+     188, 118, 100, 180, 118, 92, 180, 110, 92, 180, 114, 100, 180, 118, 100,
+       172, 106, 84, 164, 94, 76, 164, 98, 76, 172, 102, 76, 164, 102, 84,
+       164, 102, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 172, 106, 92, 180, 118, 92, 180, 118, 100,
+       180, 114, 92, 180, 110, 92, 180, 114, 92, 180, 114, 100, 180, 118, 92,
+    180, 118, 100, 188, 122, 108, 188, 122, 100, 188, 118, 100, 180, 114, 92,
+       180, 114, 92, 172, 110, 92, 172, 110, 92, 172, 106, 84, 188, 122, 100,
+       180, 114, 100, 172, 106, 84, 172, 110, 84, 180, 114, 92, 180, 114, 92,
+       180, 110, 92, 172, 110, 92, 172, 106, 84, 172, 110, 92, 180, 114, 92,
+       180, 118, 100, 180, 114, 92, 172, 110, 92, 172, 110, 92, 180, 110, 92,
+       164, 106, 84, 172, 106, 84, 172, 110, 84, 172, 110, 92, 172, 110, 92,
+       180, 110, 84, 172, 110, 92, 172, 110, 84, 180, 110, 92, 180, 110, 92,
+       180, 114, 92, 180, 118, 92, 180, 118, 92, 180, 118, 100, 188, 118, 92,
+     188, 118, 100, 180, 110, 92, 180, 110, 92, 188, 118, 100, 188, 118, 100,
+       180, 118, 100, 180, 122, 108, 148, 90, 68, 84, 30, 12, 92, 34, 12,
+       116, 58, 44, 156, 90, 76, 156, 94, 76, 156, 94, 76, 156, 90, 76,
+       148, 86, 68, 156, 90, 76, 148, 86, 68, 156, 86, 68, 156, 86, 68,
+       156, 90, 68, 156, 90, 76, 156, 90, 68, 156, 86, 68, 148, 78, 60,
+       140, 74, 52, 148, 82, 68, 148, 82, 60, 148, 86, 68, 156, 90, 68,
+       156, 94, 76, 164, 98, 76, 164, 98, 84, 164, 98, 76, 148, 86, 68,
+       156, 86, 68, 156, 90, 68, 156, 90, 76, 156, 94, 68, 156, 94, 76,
+       164, 94, 76, 164, 98, 76, 172, 102, 76, 164, 98, 76, 172, 102, 76,
+       172, 106, 84, 180, 110, 92, 172, 106, 84, 164, 98, 76, 172, 102, 76,
+       172, 102, 84, 164, 94, 68, 164, 94, 76, 172, 102, 76, 180, 110, 84,
+       180, 110, 92, 164, 98, 76, 172, 102, 76, 172, 106, 84, 172, 102, 76,
+       164, 98, 76, 164, 98, 76, 172, 102, 76, 180, 110, 92, 180, 110, 92,
+       172, 110, 84, 172, 106, 84, 180, 106, 84, 180, 114, 84, 180, 110, 92,
+       172, 102, 84, 164, 98, 76, 156, 94, 68, 172, 106, 84, 188, 114, 92,
+       180, 110, 84, 172, 106, 84, 172, 102, 76, 172, 106, 84, 180, 110, 84,
+       172, 106, 84, 172, 106, 84, 180, 110, 84, 180, 110, 92, 180, 114, 84,
+       172, 110, 84, 172, 106, 84, 172, 106, 84, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 90, 68, 164, 98, 76, 172, 102, 84, 172, 106, 76,
+       172, 102, 76, 172, 106, 84, 172, 106, 84, 180, 110, 84, 180, 114, 92,
+       188, 114, 92, 180, 110, 84, 180, 110, 92, 180, 114, 92, 172, 106, 84,
+       180, 114, 92, 172, 106, 84, 164, 94, 68, 172, 106, 84, 180, 114, 92,
+     188, 118, 92, 196, 126, 100, 188, 122, 100, 188, 122, 100, 188, 118, 92,
+       180, 118, 92, 188, 118, 100, 188, 118, 92, 180, 114, 92, 172, 106, 84,
+       180, 114, 92, 180, 106, 84, 172, 102, 76, 172, 102, 76, 172, 106, 84,
+       172, 102, 84, 172, 106, 84, 180, 110, 84, 172, 102, 84, 164, 102, 84,
+       172, 102, 84, 164, 94, 76, 156, 90, 68, 164, 94, 76, 180, 106, 92,
+       172, 102, 84, 164, 98, 84, 180, 110, 84, 180, 110, 92, 164, 98, 84,
+       164, 94, 76, 164, 98, 76, 164, 98, 84, 172, 98, 76, 164, 102, 84,
+       164, 102, 84, 172, 102, 84, 164, 106, 84, 172, 106, 92, 172, 106, 92,
+     172, 110, 92, 180, 110, 84, 180, 118, 100, 188, 118, 100, 180, 118, 100,
+       180, 114, 92, 172, 114, 92, 180, 110, 92, 180, 110, 92, 180, 114, 92,
+      180, 118, 100, 180, 118, 92, 180, 114, 100, 180, 114, 92, 180, 110, 92,
+       172, 110, 92, 180, 110, 92, 172, 114, 92, 188, 118, 100, 180, 114, 92,
+       172, 110, 92, 172, 106, 84, 172, 110, 92, 172, 110, 92, 172, 110, 84,
+       164, 102, 84, 172, 102, 84, 172, 110, 92, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 180, 110, 92, 172, 106, 84, 172, 106, 84, 172, 110, 92,
+       180, 110, 92, 180, 114, 92, 180, 114, 92, 180, 118, 100, 180, 114, 92,
+       180, 114, 100, 180, 114, 92, 180, 114, 92, 180, 118, 92, 188, 118, 92,
+    188, 122, 92, 180, 122, 100, 188, 122, 100, 180, 122, 100, 188, 118, 100,
+   196, 122, 100, 188, 118, 100, 196, 122, 108, 180, 114, 100, 180, 114, 100,
+       180, 126, 108, 148, 98, 76, 92, 34, 12, 84, 26, 12, 116, 58, 36,
+       148, 90, 76, 148, 90, 76, 140, 82, 68, 148, 82, 68, 140, 78, 60,
+       156, 86, 68, 148, 86, 68, 156, 90, 68, 156, 90, 76, 164, 94, 76,
+       156, 90, 76, 156, 90, 68, 148, 82, 68, 148, 78, 60, 140, 78, 60,
+       156, 86, 68, 148, 86, 68, 156, 86, 68, 156, 90, 68, 156, 94, 76,
+       164, 94, 76, 156, 94, 76, 148, 86, 68, 148, 82, 60, 148, 86, 68,
+       156, 90, 68, 156, 90, 76, 156, 90, 68, 156, 90, 68, 156, 94, 76,
+       164, 102, 76, 172, 102, 84, 172, 102, 76, 172, 106, 84, 180, 110, 84,
+       180, 114, 84, 180, 110, 84, 172, 102, 76, 180, 106, 84, 172, 106, 76,
+       172, 98, 76, 164, 98, 68, 172, 106, 76, 172, 106, 84, 180, 110, 84,
+       172, 98, 76, 180, 106, 84, 180, 110, 84, 180, 110, 84, 172, 98, 76,
+       172, 98, 76, 180, 106, 84, 180, 114, 84, 188, 114, 92, 180, 110, 84,
+       180, 110, 84, 180, 110, 84, 180, 114, 92, 180, 110, 84, 172, 106, 84,
+       164, 98, 68, 164, 94, 68, 180, 106, 84, 188, 118, 92, 180, 114, 92,
+       180, 110, 84, 180, 110, 84, 180, 110, 92, 180, 110, 84, 172, 106, 76,
+       180, 106, 84, 180, 110, 84, 180, 114, 92, 188, 114, 92, 180, 110, 84,
+       180, 106, 84, 172, 106, 76, 180, 106, 84, 188, 114, 92, 180, 114, 84,
+       180, 110, 84, 180, 114, 92, 188, 118, 92, 188, 118, 92, 180, 110, 84,
+       180, 106, 84, 172, 106, 76, 180, 106, 84, 188, 114, 92, 188, 118, 92,
+       180, 118, 92, 188, 118, 92, 196, 122, 100, 172, 106, 84, 188, 114, 84,
+       172, 106, 84, 164, 98, 68, 172, 102, 76, 180, 106, 84, 180, 110, 84,
+       188, 118, 92, 188, 122, 92, 188, 114, 92, 180, 110, 92, 180, 114, 84,
+       188, 118, 92, 188, 118, 92, 180, 110, 84, 172, 102, 84, 188, 122, 92,
+       180, 110, 84, 164, 102, 76, 172, 102, 76, 172, 98, 76, 172, 102, 76,
+       172, 102, 76, 180, 106, 84, 180, 110, 92, 180, 106, 84, 180, 106, 84,
+       172, 102, 76, 164, 90, 76, 172, 98, 76, 180, 110, 92, 172, 102, 76,
+       172, 102, 84, 180, 106, 84, 180, 110, 84, 172, 102, 84, 172, 98, 76,
+       164, 94, 76, 164, 98, 76, 164, 98, 76, 172, 98, 84, 164, 98, 76,
+       164, 102, 84, 172, 106, 84, 172, 106, 84, 172, 110, 92, 180, 114, 92,
+    180, 114, 92, 188, 122, 100, 188, 122, 100, 188, 122, 100, 180, 118, 100,
+       172, 106, 92, 172, 106, 84, 164, 106, 84, 172, 106, 84, 180, 114, 92,
+       180, 110, 92, 172, 110, 84, 172, 110, 92, 180, 110, 92, 172, 110, 92,
+       180, 114, 92, 180, 114, 92, 180, 118, 92, 172, 110, 92, 172, 106, 84,
+       172, 106, 84, 172, 110, 92, 172, 106, 84, 164, 102, 84, 164, 94, 76,
+       164, 98, 76, 172, 110, 92, 180, 114, 92, 172, 106, 92, 172, 106, 92,
+       172, 110, 84, 172, 106, 92, 164, 102, 84, 172, 110, 92, 180, 110, 92,
+       172, 110, 92, 180, 114, 92, 180, 114, 92, 180, 118, 100, 180, 114, 92,
+       180, 118, 92, 180, 114, 92, 188, 114, 92, 180, 118, 92, 180, 118, 100,
+       180, 118, 92, 180, 118, 100, 188, 118, 92, 180, 118, 92, 180, 110, 92,
+       180, 106, 92, 180, 110, 92, 172, 106, 92, 172, 106, 84, 172, 114, 92,
+       140, 90, 68, 84, 26, 12, 84, 30, 12, 116, 58, 44, 156, 90, 76,
+       156, 90, 76, 148, 86, 68, 148, 86, 76, 148, 86, 68, 156, 90, 76,
+       156, 90, 76, 164, 94, 84, 164, 98, 76, 164, 94, 76, 156, 90, 68,
+       156, 86, 68, 156, 86, 60, 156, 90, 68, 156, 90, 76, 164, 94, 76,
+       156, 94, 68, 156, 94, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       156, 94, 76, 156, 94, 68, 148, 78, 60, 148, 86, 68, 156, 90, 68,
+       156, 90, 68, 148, 86, 68, 156, 86, 68, 156, 90, 68, 164, 98, 76,
+       164, 94, 68, 172, 98, 76, 180, 106, 84, 188, 118, 92, 188, 118, 92,
+       188, 118, 100, 180, 114, 92, 180, 114, 84, 180, 106, 84, 172, 102, 76,
+       172, 98, 76, 172, 106, 84, 180, 106, 84, 164, 98, 68, 172, 102, 76,
+       180, 114, 84, 196, 122, 100, 188, 118, 92, 172, 106, 76, 172, 102, 76,
+       180, 110, 84, 188, 122, 92, 188, 118, 92, 188, 114, 92, 180, 110, 84,
+       188, 114, 84, 188, 114, 92, 180, 114, 84, 180, 106, 84, 172, 102, 76,
+       164, 94, 68, 180, 110, 84, 188, 118, 92, 188, 118, 92, 188, 114, 92,
+       180, 114, 92, 188, 114, 84, 180, 114, 92, 180, 106, 84, 180, 110, 84,
+       180, 114, 84, 188, 114, 92, 180, 114, 84, 180, 110, 92, 180, 110, 84,
+       180, 106, 84, 180, 114, 84, 188, 114, 92, 188, 114, 92, 180, 114, 92,
+       188, 118, 92, 196, 122, 100, 188, 122, 92, 180, 114, 92, 188, 114, 92,
+       180, 110, 84, 180, 114, 84, 188, 118, 92, 188, 122, 92, 188, 118, 92,
+       188, 118, 92, 188, 122, 92, 188, 118, 92, 196, 122, 100, 188, 118, 92,
+      188, 114, 92, 188, 122, 100, 196, 126, 100, 188, 118, 92, 188, 114, 92,
+       188, 114, 92, 180, 114, 84, 180, 110, 84, 180, 110, 84, 188, 118, 92,
+       188, 118, 92, 188, 118, 92, 180, 114, 84, 196, 126, 100, 188, 114, 92,
+       180, 106, 84, 172, 106, 76, 172, 102, 76, 172, 102, 76, 172, 106, 76,
+       180, 110, 84, 188, 118, 92, 180, 110, 92, 180, 114, 92, 180, 106, 92,
+       164, 98, 76, 180, 106, 84, 188, 114, 100, 180, 106, 84, 180, 110, 92,
+       180, 110, 92, 188, 114, 92, 180, 110, 92, 172, 106, 84, 172, 98, 76,
+       172, 98, 76, 164, 98, 76, 164, 102, 76, 164, 102, 84, 172, 102, 84,
+      172, 106, 84, 172, 110, 92, 180, 118, 92, 180, 114, 100, 180, 118, 100,
+     188, 122, 108, 188, 126, 100, 188, 118, 100, 180, 114, 92, 172, 106, 84,
+       164, 102, 84, 172, 102, 84, 172, 110, 92, 172, 110, 92, 172, 110, 84,
+       172, 106, 92, 172, 106, 84, 172, 110, 84, 172, 110, 92, 180, 110, 92,
+       180, 114, 92, 180, 110, 92, 172, 110, 92, 172, 110, 92, 180, 110, 92,
+       172, 110, 92, 180, 110, 84, 164, 102, 84, 164, 98, 76, 156, 94, 76,
+       172, 106, 84, 180, 114, 92, 172, 106, 84, 164, 102, 84, 172, 110, 84,
+       172, 106, 84, 164, 98, 76, 172, 102, 84, 164, 106, 84, 172, 106, 84,
+       172, 106, 92, 172, 110, 92, 180, 110, 92, 180, 110, 92, 172, 110, 92,
+       180, 106, 84, 172, 110, 84, 172, 110, 84, 180, 110, 84, 172, 110, 84,
+       172, 110, 84, 172, 106, 84, 172, 106, 84, 180, 106, 92, 180, 106, 84,
+     188, 114, 100, 188, 118, 100, 180, 114, 100, 180, 126, 108, 148, 90, 68,
+       84, 30, 12, 92, 34, 12, 124, 66, 44, 156, 98, 84, 164, 102, 84,
+       164, 98, 84, 164, 98, 84, 156, 94, 76, 164, 98, 84, 164, 98, 76,
+       156, 90, 76, 156, 94, 76, 164, 94, 76, 156, 90, 76, 156, 90, 68,
+       156, 86, 68, 156, 86, 68, 164, 94, 68, 156, 90, 76, 156, 94, 68,
+       156, 90, 76, 164, 98, 76, 164, 102, 84, 172, 106, 84, 172, 106, 84,
+       172, 102, 84, 148, 82, 60, 148, 86, 68, 156, 90, 68, 156, 90, 68,
+       148, 86, 68, 148, 82, 60, 156, 86, 68, 156, 94, 68, 156, 86, 68,
+       164, 98, 68, 180, 110, 84, 188, 118, 92, 196, 122, 92, 196, 122, 100,
+       188, 118, 92, 188, 118, 92, 180, 110, 92, 172, 106, 76, 172, 106, 76,
+       180, 106, 84, 180, 106, 84, 172, 102, 76, 180, 110, 84, 188, 118, 92,
+      196, 126, 100, 188, 118, 100, 180, 110, 84, 172, 106, 84, 188, 114, 84,
+      188, 122, 100, 196, 122, 100, 188, 118, 92, 180, 114, 84, 180, 114, 92,
+       188, 118, 92, 188, 118, 92, 180, 110, 84, 180, 106, 84, 172, 102, 76,
+       180, 110, 84, 196, 122, 100, 188, 122, 92, 188, 118, 92, 188, 118, 92,
+       188, 122, 92, 188, 114, 92, 188, 114, 84, 180, 114, 92, 188, 114, 84,
+       180, 110, 92, 180, 114, 84, 188, 114, 92, 180, 114, 84, 188, 114, 92,
+       180, 114, 92, 188, 114, 92, 180, 114, 84, 180, 110, 84, 180, 110, 84,
+       188, 118, 92, 188, 114, 92, 180, 114, 84, 188, 118, 92, 180, 114, 92,
+       188, 114, 92, 188, 122, 92, 188, 118, 100, 188, 118, 92, 188, 118, 92,
+       196, 122, 100, 180, 114, 92, 188, 118, 92, 180, 110, 84, 180, 110, 84,
+    196, 130, 100, 204, 134, 108, 196, 126, 100, 188, 118, 100, 188, 122, 92,
+      188, 114, 92, 188, 114, 92, 188, 114, 92, 188, 122, 100, 196, 122, 100,
+      196, 122, 100, 188, 118, 92, 188, 118, 100, 188, 118, 92, 180, 110, 84,
+       180, 110, 84, 180, 110, 84, 172, 102, 76, 172, 102, 76, 180, 110, 84,
+       180, 110, 92, 172, 106, 84, 180, 106, 84, 172, 98, 76, 164, 94, 68,
+       172, 106, 84, 180, 110, 92, 172, 106, 84, 180, 110, 84, 180, 110, 84,
+       180, 114, 92, 180, 110, 92, 180, 110, 92, 172, 106, 84, 180, 106, 84,
+       172, 106, 84, 172, 102, 84, 172, 102, 76, 164, 102, 84, 172, 110, 92,
+     180, 114, 92, 188, 118, 100, 188, 122, 100, 188, 118, 92, 188, 126, 108,
+      188, 122, 100, 180, 118, 100, 172, 110, 92, 164, 106, 84, 172, 102, 84,
+       172, 106, 84, 180, 114, 92, 180, 110, 92, 172, 110, 92, 172, 106, 84,
+       172, 106, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 110, 92,
+       172, 110, 92, 172, 110, 92, 172, 110, 84, 180, 110, 92, 172, 114, 92,
+       180, 110, 92, 172, 106, 92, 172, 106, 84, 156, 94, 68, 172, 106, 92,
+       180, 114, 92, 172, 102, 84, 164, 102, 84, 180, 110, 92, 172, 106, 92,
+       164, 98, 76, 164, 102, 84, 172, 102, 84, 164, 102, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 110, 84, 172, 102, 84,
+       172, 106, 84, 172, 106, 84, 172, 110, 84, 172, 106, 84, 164, 106, 84,
+       172, 106, 84, 172, 102, 84, 172, 102, 84, 172, 102, 84, 180, 114, 100,
+       188, 118, 100, 180, 118, 100, 188, 126, 100, 148, 94, 76, 92, 34, 12,
+       92, 34, 12, 116, 62, 44, 156, 94, 76, 164, 94, 84, 156, 94, 76,
+       156, 94, 76, 148, 86, 68, 148, 86, 76, 148, 82, 68, 148, 78, 60,
+       148, 82, 68, 156, 90, 68, 156, 94, 76, 164, 90, 76, 156, 90, 68,
+       148, 82, 68, 148, 82, 60, 164, 94, 76, 156, 94, 76, 156, 94, 68,
+       164, 94, 76, 164, 102, 84, 164, 102, 84, 172, 102, 84, 164, 102, 84,
+       156, 90, 68, 156, 90, 68, 156, 94, 76, 156, 90, 68, 148, 86, 68,
+       148, 86, 68, 156, 90, 68, 156, 90, 68, 164, 98, 76, 172, 106, 84,
+       180, 110, 84, 180, 110, 84, 180, 114, 92, 188, 118, 92, 180, 110, 84,
+       188, 118, 92, 188, 118, 92, 180, 110, 84, 180, 106, 84, 180, 114, 84,
+       180, 114, 84, 180, 114, 92, 188, 114, 84, 180, 114, 92, 188, 114, 84,
+       188, 118, 92, 188, 114, 92, 180, 114, 92, 188, 114, 84, 180, 110, 84,
+       196, 122, 100, 188, 118, 92, 188, 114, 92, 188, 114, 92, 188, 118, 92,
+       188, 118, 92, 188, 118, 92, 180, 110, 84, 172, 106, 84, 188, 114, 92,
+    196, 122, 100, 188, 122, 100, 196, 122, 92, 196, 122, 100, 188, 122, 100,
+       188, 118, 92, 188, 122, 100, 188, 118, 92, 188, 118, 92, 188, 114, 92,
+       188, 118, 92, 188, 114, 92, 188, 118, 92, 188, 122, 92, 196, 122, 100,
+      188, 126, 100, 188, 118, 92, 180, 110, 84, 188, 114, 92, 188, 122, 100,
+      196, 126, 100, 188, 118, 100, 196, 122, 92, 188, 114, 92, 180, 114, 92,
+     196, 122, 92, 188, 122, 100, 188, 118, 92, 196, 122, 100, 196, 126, 100,
+       188, 118, 92, 188, 118, 92, 172, 98, 76, 164, 94, 68, 180, 110, 92,
+      188, 122, 92, 188, 114, 92, 180, 114, 84, 204, 130, 108, 196, 126, 100,
+       188, 118, 92, 188, 122, 92, 196, 122, 100, 188, 122, 92, 188, 122, 92,
+       188, 114, 92, 180, 114, 84, 180, 110, 84, 180, 110, 84, 180, 114, 92,
+       180, 110, 84, 172, 102, 76, 172, 102, 76, 180, 106, 84, 180, 110, 92,
+       180, 106, 84, 172, 102, 76, 172, 98, 76, 164, 94, 76, 180, 106, 84,
+       180, 110, 92, 180, 106, 84, 172, 102, 76, 172, 98, 84, 172, 102, 76,
+       180, 110, 84, 180, 110, 84, 180, 106, 84, 180, 110, 92, 180, 114, 92,
+       172, 110, 92, 172, 106, 92, 172, 106, 84, 180, 110, 92, 180, 118, 100,
+   188, 122, 100, 180, 122, 100, 188, 118, 100, 188, 126, 108, 188, 118, 100,
+       180, 114, 92, 172, 106, 84, 172, 106, 84, 172, 110, 92, 180, 114, 92,
+       180, 114, 92, 172, 114, 92, 180, 110, 92, 172, 106, 84, 164, 102, 84,
+       164, 102, 84, 172, 106, 84, 172, 106, 84, 172, 106, 92, 180, 110, 84,
+       172, 110, 92, 180, 110, 92, 172, 110, 92, 180, 110, 92, 180, 114, 92,
+       172, 114, 92, 180, 110, 92, 164, 98, 76, 172, 110, 92, 180, 114, 92,
+       172, 106, 84, 172, 106, 84, 172, 110, 92, 172, 106, 84, 164, 102, 84,
+       172, 106, 84, 172, 110, 84, 172, 106, 92, 172, 106, 84, 172, 106, 84,
+       172, 110, 92, 172, 110, 92, 180, 110, 84, 172, 106, 84, 172, 106, 84,
+       180, 110, 84, 172, 110, 84, 172, 114, 92, 172, 110, 92, 172, 110, 84,
+       172, 110, 84, 180, 106, 92, 172, 102, 84, 180, 106, 92, 172, 106, 92,
+       172, 106, 92, 180, 122, 100, 148, 98, 76, 92, 34, 12, 100, 42, 28,
+       116, 54, 36, 148, 86, 68, 148, 90, 76, 148, 86, 76, 148, 86, 76,
+       140, 78, 60, 148, 78, 60, 140, 78, 60, 148, 78, 60, 148, 78, 60,
+       148, 82, 60, 156, 86, 68, 156, 90, 68, 156, 90, 68, 156, 90, 68,
+       148, 86, 68, 172, 102, 84, 164, 102, 84, 172, 102, 84, 164, 102, 84,
+       172, 106, 84, 172, 106, 84, 164, 102, 84, 164, 98, 76, 156, 94, 76,
+       164, 98, 76, 156, 94, 76, 164, 98, 76, 164, 94, 76, 164, 94, 76,
+       156, 94, 76, 164, 98, 76, 180, 110, 84, 188, 114, 84, 188, 114, 92,
+       180, 106, 84, 188, 114, 84, 188, 118, 92, 188, 114, 92, 188, 118, 92,
+       188, 118, 92, 188, 114, 92, 180, 110, 84, 188, 114, 92, 188, 118, 92,
+       188, 114, 92, 188, 118, 92, 188, 118, 92, 188, 114, 92, 188, 118, 92,
+       188, 118, 92, 188, 118, 92, 188, 114, 92, 180, 110, 84, 196, 122, 100,
+       188, 118, 92, 180, 114, 84, 188, 114, 92, 188, 122, 92, 196, 122, 100,
+       188, 118, 92, 188, 114, 92, 180, 110, 84, 188, 118, 92, 196, 122, 100,
+       196, 122, 92, 188, 118, 92, 188, 118, 100, 196, 122, 92, 188, 118, 92,
+     196, 122, 100, 196, 122, 92, 196, 122, 100, 188, 122, 92, 196, 122, 100,
+     188, 122, 92, 196, 122, 100, 196, 122, 100, 196, 122, 100, 196, 122, 92,
+       188, 114, 92, 180, 110, 84, 188, 114, 84, 188, 118, 92, 196, 122, 92,
+       188, 118, 92, 188, 122, 92, 188, 118, 92, 188, 114, 92, 188, 118, 92,
+      196, 122, 92, 188, 118, 92, 188, 118, 92, 196, 126, 100, 204, 130, 108,
+       204, 134, 108, 188, 122, 92, 180, 106, 84, 188, 114, 92, 188, 118, 92,
+    188, 118, 92, 196, 122, 100, 204, 134, 108, 196, 130, 100, 196, 122, 100,
+      188, 122, 92, 196, 122, 100, 196, 122, 100, 188, 118, 92, 188, 114, 92,
+       188, 114, 84, 180, 110, 84, 180, 110, 84, 188, 114, 92, 180, 110, 84,
+       180, 106, 84, 180, 106, 84, 188, 114, 92, 188, 118, 92, 188, 114, 92,
+       180, 110, 92, 180, 106, 84, 172, 102, 84, 180, 110, 84, 188, 118, 92,
+       180, 106, 84, 180, 106, 84, 172, 106, 84, 180, 106, 84, 180, 106, 92,
+       188, 114, 92, 180, 110, 92, 180, 110, 84, 188, 114, 92, 188, 114, 100,
+      180, 114, 92, 172, 110, 92, 180, 114, 92, 188, 122, 100, 188, 122, 108,
+    188, 122, 100, 180, 118, 100, 188, 122, 100, 180, 118, 100, 180, 114, 92,
+       180, 110, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 172, 110, 92,
+       180, 110, 92, 172, 110, 84, 172, 106, 84, 164, 102, 84, 172, 102, 84,
+       164, 106, 84, 172, 106, 84, 180, 110, 92, 172, 114, 92, 180, 110, 92,
+       172, 110, 92, 180, 110, 92, 172, 110, 84, 172, 110, 92, 172, 110, 84,
+       180, 110, 92, 164, 102, 84, 172, 110, 92, 180, 114, 92, 180, 114, 92,
+       180, 110, 92, 172, 110, 84, 172, 110, 92, 172, 106, 84, 180, 114, 92,
+       180, 110, 92, 180, 110, 92, 172, 110, 92, 172, 110, 92, 172, 110, 84,
+       172, 110, 92, 180, 110, 92, 172, 110, 92, 180, 110, 84, 180, 114, 92,
+       180, 114, 92, 180, 114, 92, 180, 118, 92, 180, 114, 92, 180, 114, 92,
+    188, 118, 100, 188, 114, 92, 196, 122, 108, 188, 118, 100, 180, 118, 100,
+       188, 130, 108, 156, 106, 84, 100, 42, 28, 84, 30, 12, 116, 54, 36,
+       156, 90, 76, 156, 90, 76, 156, 90, 68, 156, 94, 76, 148, 86, 68,
+       164, 94, 84, 156, 94, 76, 156, 90, 76, 148, 86, 68, 148, 78, 60,
+       148, 78, 60, 148, 86, 68, 164, 94, 76, 164, 94, 76, 172, 98, 84,
+       164, 98, 76, 164, 102, 76, 172, 106, 84, 180, 110, 92, 180, 118, 100,
+       180, 118, 100, 180, 110, 92, 172, 110, 92, 164, 98, 76, 164, 94, 76,
+       164, 98, 76, 164, 98, 84, 164, 102, 76, 164, 102, 84, 172, 102, 84,
+      164, 102, 76, 188, 118, 92, 188, 122, 100, 196, 122, 100, 188, 114, 92,
+      180, 114, 92, 188, 114, 92, 196, 122, 100, 196, 122, 100, 188, 118, 92,
+       188, 114, 92, 188, 118, 92, 188, 118, 92, 188, 118, 92, 180, 110, 84,
+    196, 122, 100, 196, 122, 100, 188, 122, 92, 196, 122, 100, 196, 126, 100,
+      196, 122, 100, 188, 118, 92, 188, 118, 92, 196, 122, 100, 188, 118, 92,
+     188, 114, 92, 188, 118, 92, 196, 122, 100, 196, 126, 100, 196, 122, 100,
+       188, 118, 92, 188, 114, 84, 188, 122, 92, 196, 122, 100, 188, 122, 92,
+      188, 118, 92, 196, 122, 100, 196, 122, 92, 188, 118, 92, 196, 122, 100,
+   196, 126, 100, 196, 122, 100, 196, 126, 100, 196, 126, 100, 196, 126, 100,
+   196, 122, 100, 196, 126, 100, 196, 122, 100, 196, 126, 100, 196, 122, 100,
+    188, 118, 92, 188, 118, 100, 196, 126, 100, 196, 126, 100, 196, 122, 100,
+     196, 126, 100, 196, 122, 100, 188, 118, 92, 188, 122, 100, 196, 122, 92,
+       188, 114, 92, 188, 114, 92, 188, 122, 92, 188, 114, 92, 204, 130, 108,
+      196, 126, 100, 188, 118, 92, 188, 118, 92, 188, 118, 92, 196, 122, 100,
+    196, 126, 100, 204, 130, 108, 196, 126, 100, 196, 122, 100, 188, 118, 92,
+     196, 122, 100, 196, 126, 100, 196, 122, 100, 188, 118, 92, 188, 114, 92,
+       188, 114, 92, 188, 118, 92, 188, 118, 92, 188, 118, 92, 180, 114, 84,
+      188, 114, 92, 196, 126, 100, 196, 122, 100, 188, 114, 92, 180, 110, 84,
+       180, 106, 84, 172, 98, 76, 180, 110, 92, 188, 114, 92, 172, 102, 84,
+       196, 126, 100, 188, 114, 92, 188, 114, 92, 188, 114, 92, 188, 114, 92,
+      180, 110, 84, 188, 114, 92, 188, 114, 92, 188, 122, 100, 180, 118, 100,
+    180, 114, 92, 180, 118, 100, 188, 122, 100, 188, 126, 108, 188, 122, 100,
+    180, 118, 100, 188, 122, 100, 180, 118, 100, 180, 110, 92, 180, 114, 100,
+      180, 118, 100, 188, 118, 100, 172, 114, 92, 172, 106, 84, 172, 110, 92,
+       172, 106, 92, 172, 102, 84, 164, 102, 84, 172, 102, 76, 172, 106, 84,
+       172, 106, 92, 180, 114, 92, 180, 110, 92, 180, 114, 92, 172, 110, 92,
+       172, 110, 84, 172, 106, 84, 172, 106, 84, 172, 106, 92, 172, 110, 84,
+      172, 106, 84, 180, 110, 92, 180, 114, 92, 180, 118, 100, 180, 118, 100,
+       180, 110, 92, 172, 110, 92, 180, 110, 92, 180, 114, 92, 172, 114, 92,
+       172, 110, 92, 172, 106, 84, 172, 106, 84, 172, 106, 92, 172, 110, 84,
+       172, 106, 84, 180, 110, 84, 172, 110, 92, 180, 114, 92, 180, 114, 92,
+       180, 118, 92, 180, 118, 92, 180, 114, 92, 180, 118, 92, 188, 114, 100,
+    180, 110, 92, 188, 122, 108, 188, 122, 100, 180, 118, 108, 188, 126, 108,
+       148, 90, 76, 84, 30, 12, 92, 38, 28, 140, 78, 60, 156, 90, 68,
+       156, 90, 76, 156, 90, 68, 156, 94, 76, 164, 98, 76, 156, 94, 76,
+       164, 94, 76, 156, 94, 68, 156, 94, 76, 156, 90, 68, 156, 86, 68,
+       148, 86, 68, 156, 86, 68, 156, 94, 76, 164, 102, 76, 180, 110, 92,
+       172, 102, 84, 172, 98, 84, 172, 106, 84, 180, 114, 92, 188, 122, 100,
+       188, 114, 92, 172, 110, 92, 172, 102, 84, 164, 98, 76, 156, 90, 68,
+       156, 86, 68, 164, 94, 76, 172, 102, 84, 172, 106, 84, 180, 110, 92,
+      188, 114, 92, 196, 126, 100, 196, 126, 100, 188, 118, 92, 180, 110, 92,
+    188, 118, 92, 196, 130, 108, 196, 126, 100, 196, 122, 100, 188, 126, 100,
+     196, 126, 108, 196, 126, 100, 196, 122, 100, 180, 118, 92, 188, 114, 92,
+     188, 118, 92, 196, 122, 100, 188, 122, 100, 188, 122, 100, 188, 118, 92,
+     188, 118, 92, 188, 118, 92, 196, 126, 100, 188, 122, 100, 196, 122, 100,
+   188, 122, 100, 196, 126, 100, 196, 130, 100, 196, 126, 108, 196, 130, 100,
+   196, 122, 100, 188, 122, 100, 196, 126, 108, 196, 126, 100, 204, 130, 108,
+   196, 130, 100, 196, 130, 108, 196, 130, 108, 188, 122, 100, 196, 126, 100,
+   188, 122, 100, 196, 122, 100, 188, 122, 100, 196, 126, 100, 196, 126, 100,
+   196, 130, 100, 196, 130, 108, 196, 130, 100, 196, 126, 100, 196, 126, 100,
+   204, 130, 108, 196, 130, 100, 196, 126, 108, 188, 126, 100, 196, 122, 100,
+   196, 126, 100, 196, 130, 108, 204, 130, 108, 196, 126, 108, 196, 130, 100,
+   196, 122, 100, 188, 122, 100, 196, 126, 100, 204, 134, 108, 204, 134, 108,
+     196, 126, 100, 188, 114, 92, 188, 118, 92, 188, 122, 100, 196, 126, 100,
+   196, 130, 108, 196, 126, 108, 196, 126, 100, 196, 126, 100, 196, 126, 100,
+    188, 122, 92, 188, 122, 100, 188, 122, 100, 196, 122, 100, 188, 122, 100,
+    196, 122, 100, 188, 122, 100, 196, 122, 100, 188, 122, 100, 188, 118, 92,
+   188, 118, 100, 196, 126, 100, 188, 122, 100, 188, 122, 100, 188, 118, 100,
+       188, 118, 92, 188, 118, 92, 188, 114, 92, 188, 118, 92, 188, 122, 100,
+       188, 114, 92, 180, 114, 92, 180, 114, 84, 172, 102, 84, 172, 106, 84,
+    188, 118, 92, 188, 118, 100, 188, 122, 100, 188, 122, 100, 180, 118, 100,
+   188, 118, 100, 188, 122, 100, 188, 122, 100, 188, 118, 100, 180, 118, 100,
+       196, 130, 108, 180, 114, 92, 172, 106, 84, 172, 110, 92, 180, 114, 92,
+       172, 110, 92, 172, 106, 84, 172, 106, 84, 180, 110, 92, 180, 114, 92,
+       180, 114, 92, 180, 110, 92, 164, 102, 84, 164, 98, 84, 172, 102, 84,
+       172, 106, 84, 172, 106, 92, 172, 106, 84, 172, 106, 84, 180, 106, 92,
+       172, 106, 92, 180, 110, 92, 180, 110, 92, 172, 110, 92, 172, 102, 84,
+       172, 110, 92, 180, 114, 92, 180, 114, 100, 180, 114, 92, 172, 110, 92,
+       180, 114, 92, 172, 110, 92, 180, 114, 92, 180, 114, 92, 180, 110, 92,
+       180, 110, 92, 172, 110, 92, 180, 110, 84, 172, 110, 92, 172, 110, 92,
+       180, 110, 92, 180, 110, 92, 180, 114, 92, 180, 114, 92, 180, 118, 100,
+       180, 118, 100, 180, 114, 92, 180, 114, 92, 172, 102, 84, 172, 102, 84,
+       180, 106, 92, 164, 94, 84, 156, 94, 76, 172, 110, 100, 140, 82, 68,
+       92, 38, 28, 92, 34, 20, 124, 58, 44, 140, 78, 60, 148, 86, 68,
+       156, 90, 68, 156, 94, 76, 164, 94, 76, 148, 90, 68, 156, 90, 68,
+       164, 94, 76, 156, 94, 76, 156, 94, 76, 156, 90, 68, 148, 86, 60,
+       148, 86, 68, 156, 90, 68, 164, 94, 76, 164, 98, 76, 156, 94, 76,
+       156, 94, 76, 172, 98, 84, 180, 110, 92, 180, 118, 100, 188, 114, 100,
+       180, 114, 92, 172, 102, 84, 164, 98, 84, 164, 94, 76, 156, 94, 76,
+       156, 90, 68, 164, 94, 76, 164, 94, 76, 164, 94, 76, 164, 98, 76,
+    180, 110, 92, 196, 126, 100, 196, 126, 108, 204, 130, 100, 196, 126, 108,
+   196, 130, 108, 196, 126, 100, 188, 122, 100, 196, 122, 100, 196, 126, 100,
+    196, 126, 100, 188, 122, 100, 188, 118, 92, 196, 130, 108, 196, 134, 108,
+   204, 134, 108, 204, 134, 108, 196, 130, 108, 196, 130, 108, 196, 126, 108,
+   196, 130, 108, 196, 126, 100, 188, 126, 100, 188, 122, 100, 196, 126, 100,
+   196, 126, 100, 196, 126, 108, 196, 126, 100, 188, 126, 100, 188, 122, 100,
+   196, 126, 100, 188, 122, 100, 188, 122, 100, 188, 122, 100, 196, 122, 100,
+   196, 126, 100, 196, 126, 108, 204, 130, 108, 196, 130, 108, 196, 130, 108,
+   196, 130, 108, 196, 130, 108, 204, 130, 108, 196, 130, 108, 204, 130, 108,
+   196, 130, 108, 196, 126, 100, 188, 126, 108, 196, 126, 100, 196, 126, 108,
+   196, 130, 108, 196, 126, 100, 196, 126, 100, 196, 126, 100, 188, 126, 100,
+   196, 126, 100, 196, 126, 108, 196, 130, 100, 196, 126, 108, 188, 126, 100,
+   196, 122, 100, 188, 126, 100, 196, 130, 108, 196, 130, 108, 188, 122, 100,
+      180, 114, 92, 188, 118, 92, 188, 122, 100, 188, 122, 100, 188, 118, 92,
+    188, 122, 100, 188, 118, 100, 188, 122, 100, 188, 118, 92, 188, 118, 100,
+      188, 118, 92, 188, 122, 100, 188, 118, 92, 188, 122, 92, 188, 118, 100,
+       188, 118, 92, 188, 118, 92, 188, 118, 92, 188, 118, 100, 180, 118, 92,
+      188, 122, 100, 188, 122, 100, 188, 118, 92, 188, 118, 92, 180, 114, 92,
+      180, 114, 92, 180, 114, 92, 188, 118, 92, 196, 126, 100, 188, 118, 100,
+      188, 122, 100, 188, 118, 92, 180, 110, 84, 180, 114, 92, 188, 122, 100,
+       188, 122, 100, 180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92,
+      180, 118, 100, 180, 118, 100, 180, 114, 92, 172, 110, 92, 172, 106, 84,
+       164, 94, 76, 164, 102, 84, 180, 114, 92, 180, 118, 100, 172, 106, 84,
+       164, 98, 76, 164, 98, 84, 164, 98, 76, 164, 98, 84, 172, 102, 84,
+       172, 102, 84, 164, 98, 76, 172, 102, 84, 172, 106, 84, 180, 110, 92,
+       180, 110, 92, 180, 110, 92, 180, 110, 92, 180, 110, 92, 180, 110, 92,
+       180, 110, 92, 172, 110, 92, 180, 110, 92, 172, 106, 84, 172, 110, 92,
+       180, 118, 92, 188, 118, 100, 180, 114, 92, 180, 114, 92, 180, 114, 92,
+    180, 114, 92, 180, 118, 100, 180, 118, 100, 180, 118, 100, 180, 118, 100,
+     188, 118, 92, 180, 118, 100, 180, 118, 100, 188, 118, 100, 180, 110, 92,
+   172, 110, 100, 180, 114, 100, 180, 118, 100, 180, 118, 100, 180, 118, 100,
+     188, 122, 100, 188, 118, 100, 180, 106, 84, 172, 102, 84, 188, 114, 100,
+       164, 98, 76, 164, 98, 84, 172, 110, 100, 132, 78, 68, 92, 34, 20,
+       92, 34, 20, 132, 70, 52, 156, 90, 68, 164, 102, 76, 164, 98, 76,
+       164, 98, 84, 164, 98, 76, 156, 90, 68, 156, 94, 76, 148, 82, 60,
+       148, 86, 68, 148, 82, 60, 148, 82, 60, 148, 82, 60, 148, 78, 60,
+       148, 82, 60, 148, 86, 68, 148, 82, 68, 148, 82, 60, 156, 82, 68,
+       156, 90, 68, 164, 98, 76, 172, 102, 84, 172, 106, 84, 172, 106, 84,
+       164, 102, 76, 172, 98, 84, 164, 98, 76, 156, 90, 76, 156, 82, 60,
+       140, 78, 60, 140, 70, 52, 132, 70, 52, 156, 82, 60, 172, 98, 76,
+    188, 114, 92, 196, 122, 100, 196, 126, 100, 196, 126, 108, 196, 130, 108,
+   196, 130, 108, 196, 126, 100, 188, 126, 100, 196, 126, 100, 188, 126, 100,
+   196, 126, 100, 188, 122, 100, 196, 130, 108, 204, 130, 108, 196, 130, 108,
+   196, 130, 108, 196, 122, 100, 188, 122, 100, 196, 122, 100, 188, 126, 100,
+   196, 126, 100, 196, 122, 100, 188, 122, 100, 188, 122, 100, 196, 122, 100,
+   188, 126, 100, 188, 122, 100, 188, 122, 100, 196, 122, 100, 188, 122, 100,
+    196, 126, 100, 188, 122, 100, 188, 118, 100, 188, 118, 92, 188, 122, 100,
+   188, 126, 100, 196, 126, 100, 196, 126, 100, 196, 130, 108, 196, 126, 100,
+   196, 126, 100, 196, 126, 108, 196, 126, 100, 188, 122, 100, 196, 130, 108,
+   196, 130, 100, 196, 126, 108, 196, 126, 100, 196, 130, 108, 204, 130, 108,
+   196, 130, 108, 196, 126, 108, 196, 130, 108, 204, 134, 108, 196, 130, 108,
+   196, 130, 108, 196, 130, 108, 196, 130, 108, 204, 130, 108, 196, 134, 108,
+   204, 130, 108, 204, 134, 116, 196, 130, 108, 196, 122, 100, 188, 122, 100,
+    196, 126, 108, 196, 126, 100, 196, 126, 100, 188, 118, 100, 188, 118, 92,
+     188, 118, 92, 188, 122, 92, 188, 118, 100, 188, 122, 100, 188, 122, 100,
+    188, 122, 100, 188, 122, 100, 188, 118, 100, 188, 122, 92, 188, 118, 100,
+    188, 122, 100, 188, 122, 100, 188, 122, 100, 188, 122, 100, 188, 118, 92,
+     188, 122, 100, 188, 122, 100, 188, 118, 100, 188, 118, 92, 188, 114, 92,
+    188, 122, 100, 188, 122, 100, 188, 122, 100, 188, 118, 92, 188, 122, 100,
+     188, 122, 100, 180, 110, 92, 180, 114, 92, 188, 122, 100, 188, 122, 100,
+   188, 118, 100, 180, 118, 100, 180, 118, 100, 188, 122, 100, 188, 122, 100,
+       188, 122, 100, 180, 114, 92, 180, 110, 92, 172, 110, 92, 164, 102, 76,
+      164, 102, 84, 188, 118, 100, 180, 118, 100, 172, 106, 84, 164, 102, 84,
+       172, 110, 92, 180, 110, 92, 180, 110, 92, 180, 110, 92, 180, 110, 92,
+       172, 106, 84, 180, 110, 92, 172, 110, 92, 180, 110, 92, 180, 110, 92,
+       180, 114, 92, 180, 110, 92, 180, 114, 92, 172, 110, 92, 180, 110, 84,
+       180, 110, 92, 180, 110, 92, 172, 102, 84, 172, 106, 84, 172, 110, 92,
+       180, 110, 92, 172, 110, 92, 172, 110, 92, 172, 106, 92, 172, 110, 92,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 100,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 110, 100, 180, 114, 92,
+     180, 114, 92, 180, 114, 100, 180, 118, 92, 180, 122, 100, 188, 122, 100,
+     188, 122, 100, 188, 118, 100, 180, 110, 92, 188, 114, 100, 172, 102, 92,
+       172, 106, 92, 180, 118, 100, 132, 78, 68, 92, 34, 20, 92, 34, 20,
+       132, 74, 60, 156, 90, 68, 164, 94, 76, 148, 90, 68, 156, 86, 68,
+       156, 90, 68, 156, 90, 68, 164, 98, 84, 156, 90, 68, 156, 90, 68,
+       156, 90, 76, 156, 94, 76, 164, 98, 76, 164, 98, 84, 164, 102, 76,
+       172, 102, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84, 180, 110, 92,
+       180, 110, 92, 180, 110, 92, 180, 114, 100, 180, 114, 92, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 180, 110, 92, 164, 98, 84, 164, 94, 76,
+       156, 90, 68, 156, 90, 68, 172, 102, 84, 180, 110, 92, 188, 118, 92,
+    196, 122, 100, 196, 122, 100, 188, 122, 100, 188, 122, 100, 188, 118, 92,
+     188, 118, 100, 188, 118, 100, 180, 114, 92, 188, 114, 92, 188, 118, 100,
+    188, 118, 92, 196, 126, 100, 188, 126, 100, 196, 122, 100, 188, 122, 100,
+     180, 118, 92, 188, 118, 92, 188, 122, 100, 196, 122, 100, 196, 126, 108,
+   188, 126, 100, 188, 122, 100, 196, 122, 100, 188, 126, 100, 196, 122, 100,
+       188, 122, 100, 188, 118, 92, 180, 110, 92, 180, 114, 92, 188, 118, 92,
+       180, 114, 92, 180, 110, 84, 172, 110, 84, 180, 114, 92, 188, 114, 92,
+   188, 126, 100, 196, 126, 108, 196, 126, 100, 196, 130, 108, 196, 126, 108,
+   188, 126, 100, 188, 126, 100, 196, 122, 100, 188, 122, 100, 188, 122, 100,
+    188, 118, 92, 188, 122, 100, 188, 122, 100, 188, 126, 100, 188, 122, 100,
+    188, 118, 92, 196, 130, 108, 196, 130, 108, 196, 126, 108, 196, 126, 100,
+   196, 130, 108, 196, 130, 108, 196, 130, 108, 204, 130, 108, 196, 130, 108,
+     196, 130, 100, 196, 122, 100, 180, 118, 92, 188, 118, 92, 188, 122, 100,
+      196, 126, 100, 180, 118, 100, 188, 118, 92, 180, 118, 92, 180, 114, 92,
+       188, 118, 92, 180, 114, 92, 188, 118, 92, 180, 114, 92, 188, 114, 92,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 188, 118, 92,
+       180, 114, 92, 188, 118, 92, 188, 118, 92, 180, 110, 92, 188, 114, 92,
+       188, 122, 92, 180, 118, 92, 180, 110, 92, 180, 110, 92, 180, 118, 92,
+     196, 122, 100, 188, 118, 100, 180, 114, 92, 188, 122, 100, 188, 118, 92,
+      180, 110, 92, 180, 114, 84, 188, 118, 100, 180, 118, 92, 188, 118, 100,
+   188, 122, 100, 188, 122, 100, 188, 122, 108, 188, 122, 100, 188, 122, 100,
+       180, 114, 92, 172, 106, 84, 164, 98, 84, 156, 94, 76, 164, 94, 76,
+       164, 102, 76, 172, 102, 84, 164, 98, 76, 172, 106, 84, 188, 122, 100,
+      188, 118, 100, 188, 118, 100, 180, 114, 92, 180, 114, 92, 180, 110, 92,
+       180, 110, 92, 180, 110, 92, 172, 110, 92, 180, 110, 92, 172, 110, 92,
+       180, 110, 84, 172, 110, 92, 180, 110, 92, 172, 106, 92, 172, 110, 84,
+       172, 106, 92, 172, 102, 84, 172, 106, 84, 172, 110, 92, 172, 110, 84,
+       172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 102, 84,
+       164, 102, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 92,
+       172, 106, 84, 172, 106, 92, 180, 110, 92, 172, 110, 92, 180, 106, 92,
+       172, 110, 92, 172, 110, 92, 180, 114, 92, 180, 118, 92, 180, 118, 92,
+    188, 118, 100, 188, 114, 100, 188, 118, 100, 180, 110, 92, 180, 118, 108,
+       180, 122, 108, 132, 78, 68, 92, 34, 20, 92, 34, 20, 108, 50, 28,
+       132, 66, 52, 140, 74, 52, 132, 70, 52, 140, 74, 52, 140, 78, 60,
+       148, 86, 60, 164, 94, 76, 156, 94, 68, 156, 94, 76, 164, 98, 76,
+       164, 102, 84, 172, 106, 84, 172, 106, 84, 172, 110, 92, 172, 106, 84,
+       180, 110, 92, 180, 110, 92, 180, 114, 92, 180, 110, 92, 180, 110, 92,
+       180, 114, 92, 180, 110, 92, 180, 114, 92, 172, 106, 92, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 180, 110, 92, 180, 114, 92, 188, 114, 100,
+       188, 122, 100, 180, 110, 84, 188, 114, 92, 180, 114, 92, 188, 114, 92,
+       180, 110, 92, 180, 110, 92, 180, 110, 92, 180, 114, 92, 180, 114, 84,
+       180, 114, 92, 180, 110, 84, 180, 110, 92, 172, 110, 84, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 110, 92, 180, 110, 84,
+       180, 110, 92, 188, 118, 92, 188, 122, 100, 180, 114, 84, 180, 110, 92,
+       180, 110, 84, 180, 110, 84, 180, 110, 92, 180, 114, 92, 180, 106, 84,
+       172, 106, 84, 164, 102, 76, 172, 102, 84, 180, 110, 84, 180, 110, 84,
+       172, 110, 92, 180, 106, 84, 180, 110, 84, 180, 110, 92, 180, 118, 92,
+     188, 118, 92, 188, 118, 100, 188, 122, 100, 188, 122, 92, 188, 118, 100,
+       188, 118, 92, 180, 114, 92, 188, 118, 92, 180, 114, 92, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 188, 114, 92, 180, 114, 92, 180, 114, 92,
+       188, 114, 92, 188, 118, 92, 188, 122, 92, 188, 118, 100, 196, 122, 92,
+     188, 122, 100, 188, 118, 100, 188, 122, 92, 188, 118, 100, 188, 118, 92,
+       180, 114, 92, 172, 106, 84, 180, 110, 92, 180, 118, 92, 188, 114, 92,
+       172, 110, 84, 180, 110, 84, 180, 110, 92, 180, 110, 92, 180, 110, 84,
+       172, 110, 84, 180, 106, 84, 172, 106, 84, 172, 106, 84, 172, 102, 84,
+       172, 106, 76, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       180, 110, 84, 172, 106, 84, 172, 102, 76, 172, 106, 84, 180, 110, 84,
+       172, 106, 84, 172, 102, 84, 172, 102, 76, 180, 106, 84, 180, 114, 92,
+       188, 118, 92, 180, 114, 92, 188, 118, 92, 188, 122, 100, 180, 110, 84,
+       180, 110, 92, 188, 118, 92, 180, 114, 92, 180, 114, 92, 172, 114, 92,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 172, 110, 84, 164, 98, 84,
+       156, 94, 76, 140, 74, 52, 140, 78, 60, 148, 86, 68, 156, 90, 68,
+       156, 94, 76, 156, 98, 76, 172, 102, 84, 172, 110, 92, 172, 106, 92,
+       172, 106, 84, 172, 106, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 180, 106, 84, 172, 106, 84, 172, 102, 84, 172, 106, 84,
+       172, 102, 84, 172, 106, 84, 180, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 110, 92, 180, 110, 92, 180, 110, 92, 172, 106, 92,
+       172, 106, 84, 172, 106, 84, 172, 110, 92, 164, 102, 84, 172, 102, 84,
+       164, 106, 84, 172, 106, 84, 172, 106, 92, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 92, 172, 106, 92, 164, 102, 84, 172, 102, 84,
+       164, 106, 84, 164, 102, 84, 172, 106, 84, 172, 106, 84, 180, 110, 92,
+      180, 106, 92, 180, 110, 92, 172, 102, 92, 172, 114, 100, 180, 118, 100,
+       132, 74, 60, 92, 34, 20, 92, 34, 12, 124, 58, 44, 148, 78, 60,
+       148, 90, 68, 156, 86, 68, 156, 94, 76, 156, 94, 76, 156, 90, 68,
+       164, 98, 76, 156, 94, 76, 164, 94, 76, 156, 94, 68, 164, 94, 76,
+       164, 98, 76, 164, 98, 84, 164, 98, 76, 156, 98, 76, 164, 94, 76,
+       164, 98, 76, 164, 98, 84, 164, 98, 84, 172, 102, 76, 164, 102, 84,
+       172, 102, 84, 172, 102, 84, 172, 106, 84, 172, 106, 92, 180, 106, 84,
+       172, 106, 92, 172, 106, 84, 180, 110, 92, 180, 110, 92, 180, 114, 92,
+       180, 110, 92, 180, 106, 84, 180, 114, 92, 188, 118, 92, 188, 118, 92,
+       188, 114, 92, 188, 118, 92, 188, 118, 92, 188, 118, 100, 188, 118, 92,
+      188, 122, 100, 188, 122, 100, 188, 118, 92, 180, 118, 92, 188, 118, 92,
+       188, 118, 100, 188, 118, 92, 180, 118, 92, 188, 114, 92, 180, 118, 92,
+      188, 122, 100, 196, 130, 108, 188, 114, 92, 180, 114, 92, 180, 118, 92,
+       188, 118, 92, 188, 118, 100, 188, 118, 92, 180, 114, 92, 180, 110, 84,
+       180, 110, 92, 180, 114, 84, 180, 114, 92, 180, 114, 92, 188, 118, 92,
+     188, 118, 100, 188, 118, 92, 188, 118, 100, 188, 118, 92, 188, 118, 100,
+    188, 122, 92, 188, 122, 100, 188, 122, 100, 188, 122, 100, 188, 122, 100,
+    196, 122, 100, 188, 126, 100, 188, 122, 100, 188, 122, 92, 188, 122, 100,
+     196, 122, 100, 188, 126, 100, 196, 122, 100, 188, 118, 92, 180, 118, 92,
+    188, 118, 100, 188, 118, 92, 188, 122, 100, 188, 122, 100, 188, 122, 100,
+     188, 122, 100, 188, 122, 100, 188, 118, 92, 188, 118, 100, 180, 114, 92,
+       180, 110, 84, 180, 110, 92, 188, 118, 92, 180, 114, 92, 180, 110, 92,
+       188, 118, 92, 180, 118, 92, 188, 114, 92, 180, 114, 92, 180, 110, 92,
+       180, 110, 84, 180, 110, 84, 180, 110, 84, 180, 110, 84, 180, 110, 84,
+       180, 106, 84, 180, 110, 84, 180, 110, 92, 180, 110, 84, 180, 110, 92,
+       180, 110, 92, 172, 106, 84, 180, 110, 84, 180, 114, 92, 180, 110, 92,
+       172, 110, 84, 172, 110, 84, 180, 110, 92, 188, 118, 92, 188, 118, 92,
+       180, 114, 92, 188, 118, 100, 188, 118, 92, 180, 110, 92, 180, 114, 84,
+       188, 118, 100, 180, 114, 92, 180, 110, 92, 172, 110, 92, 172, 110, 92,
+       172, 110, 92, 172, 110, 92, 172, 102, 84, 164, 98, 76, 156, 94, 76,
+       156, 94, 68, 172, 102, 76, 172, 110, 92, 172, 110, 84, 172, 106, 92,
+       172, 110, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 180, 106, 92,
+       172, 106, 84, 172, 106, 92, 172, 102, 84, 172, 102, 84, 172, 106, 92,
+       172, 106, 84, 172, 102, 84, 172, 102, 84, 172, 102, 84, 172, 102, 84,
+       172, 106, 84, 172, 102, 84, 172, 106, 92, 172, 102, 84, 164, 98, 76,
+       164, 102, 84, 164, 102, 84, 164, 102, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 84, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 102, 84,
+       172, 102, 84, 164, 102, 84, 164, 102, 84, 164, 102, 84, 164, 98, 76,
+       172, 102, 84, 172, 102, 84, 172, 102, 84, 164, 98, 84, 164, 102, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 172, 98, 84, 172, 98, 76,
+       172, 98, 84, 164, 94, 84, 172, 110, 92, 172, 110, 100, 116, 62, 52,
+       92, 34, 12, 92, 34, 20, 148, 90, 68, 172, 106, 84, 172, 110, 92,
+       172, 106, 84, 172, 110, 84, 180, 110, 92, 164, 102, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 164, 102, 84, 172, 106, 84, 172, 106, 84,
+       172, 110, 92, 172, 106, 84, 172, 106, 92, 172, 106, 84, 172, 102, 84,
+       172, 106, 84, 172, 106, 84, 180, 110, 92, 180, 110, 92, 180, 110, 92,
+      180, 110, 92, 188, 118, 100, 188, 114, 100, 180, 114, 92, 180, 110, 92,
+       180, 110, 92, 172, 110, 92, 180, 110, 92, 172, 106, 84, 188, 118, 100,
+    188, 118, 92, 196, 122, 100, 196, 126, 108, 204, 130, 108, 188, 122, 100,
+     188, 118, 100, 180, 118, 92, 180, 114, 92, 188, 122, 100, 196, 122, 100,
+     188, 122, 100, 188, 118, 92, 180, 110, 92, 196, 122, 100, 188, 126, 100,
+   196, 126, 100, 188, 122, 100, 188, 122, 100, 196, 126, 100, 196, 126, 108,
+   196, 130, 108, 196, 130, 108, 196, 126, 100, 196, 126, 108, 196, 130, 108,
+    196, 134, 108, 204, 134, 108, 196, 130, 108, 188, 126, 108, 188, 118, 92,
+       180, 114, 92, 180, 106, 84, 180, 110, 84, 180, 114, 92, 180, 118, 92,
+     188, 118, 92, 180, 118, 92, 188, 126, 100, 188, 122, 100, 196, 126, 100,
+   196, 126, 100, 196, 126, 100, 196, 130, 108, 204, 130, 108, 196, 130, 108,
+    196, 122, 100, 188, 122, 100, 188, 118, 100, 188, 118, 92, 188, 122, 100,
+    188, 122, 100, 188, 122, 100, 188, 118, 100, 180, 118, 100, 188, 118, 92,
+      180, 114, 92, 188, 118, 92, 188, 118, 100, 188, 122, 92, 188, 122, 100,
+       196, 122, 100, 180, 118, 92, 188, 118, 92, 180, 114, 92, 172, 110, 84,
+       180, 110, 84, 180, 114, 92, 188, 118, 92, 180, 114, 92, 180, 118, 92,
+       188, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 180, 110, 92, 180, 114, 92, 180, 110, 92, 180, 114, 92,
+       180, 110, 92, 180, 114, 84, 180, 110, 92, 180, 110, 84, 180, 114, 84,
+       180, 110, 92, 180, 114, 92, 180, 114, 92, 180, 110, 84, 180, 110, 92,
+       180, 114, 84, 180, 114, 92, 180, 118, 92, 180, 110, 92, 172, 106, 84,
+       180, 110, 84, 180, 110, 84, 164, 102, 76, 172, 102, 84, 180, 110, 84,
+       172, 110, 84, 172, 106, 84, 172, 106, 84, 172, 102, 84, 172, 106, 84,
+       172, 110, 84, 172, 106, 92, 172, 106, 84, 164, 98, 76, 180, 118, 100,
+     188, 122, 100, 188, 118, 100, 188, 118, 100, 180, 114, 92, 172, 106, 92,
+       172, 106, 84, 164, 102, 84, 180, 106, 84, 172, 106, 92, 180, 110, 92,
+       172, 106, 84, 172, 102, 84, 172, 102, 84, 172, 102, 84, 172, 106, 92,
+       172, 98, 84, 164, 102, 84, 172, 102, 84, 172, 102, 84, 172, 106, 92,
+       180, 106, 84, 172, 110, 92, 180, 106, 92, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 156, 94, 76, 156, 94, 76, 156, 94, 76,
+       164, 98, 76, 164, 98, 84, 164, 98, 76, 172, 102, 84, 164, 102, 84,
+       172, 102, 84, 164, 102, 84, 164, 98, 76, 156, 94, 76, 172, 102, 84,
+       172, 102, 92, 164, 102, 84, 172, 102, 84, 164, 106, 84, 164, 106, 84,
+       164, 102, 76, 172, 102, 84, 164, 98, 76, 172, 102, 84, 172, 102, 84,
+       164, 94, 84, 172, 106, 92, 164, 106, 92, 116, 62, 52, 92, 34, 20,
+       100, 46, 28, 148, 86, 76, 164, 98, 76, 164, 98, 76, 156, 90, 76,
+       164, 98, 76, 164, 102, 84, 172, 102, 84, 172, 106, 84, 164, 102, 84,
+       164, 102, 84, 164, 98, 76, 164, 98, 84, 172, 106, 84, 172, 110, 92,
+       180, 110, 92, 172, 110, 84, 180, 110, 92, 180, 106, 92, 172, 106, 84,
+       180, 110, 92, 180, 110, 92, 180, 114, 92, 180, 110, 92, 172, 110, 92,
+       172, 106, 84, 172, 102, 84, 164, 102, 84, 172, 106, 84, 180, 106, 92,
+       180, 110, 84, 172, 106, 84, 172, 102, 84, 180, 110, 92, 172, 102, 76,
+       172, 98, 76, 172, 106, 84, 180, 106, 84, 172, 98, 76, 164, 98, 76,
+       164, 94, 76, 164, 98, 76, 172, 102, 76, 172, 110, 84, 172, 106, 84,
+       172, 98, 76, 156, 94, 68, 164, 94, 68, 164, 94, 76, 164, 98, 76,
+       164, 94, 68, 164, 94, 68, 156, 90, 68, 164, 94, 68, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 172, 102, 76, 172, 106, 84,
+       172, 106, 84, 172, 102, 76, 164, 98, 76, 172, 106, 84, 164, 98, 76,
+       148, 86, 60, 148, 82, 60, 156, 90, 68, 164, 94, 76, 164, 98, 76,
+       164, 94, 76, 172, 98, 76, 164, 98, 76, 164, 98, 76, 172, 102, 84,
+       172, 102, 76, 172, 106, 84, 172, 106, 84, 180, 110, 84, 172, 106, 84,
+       172, 102, 76, 172, 102, 76, 172, 102, 76, 172, 106, 84, 172, 106, 84,
+       172, 102, 76, 172, 102, 76, 172, 106, 84, 172, 102, 84, 172, 102, 76,
+       164, 102, 84, 172, 102, 76, 172, 106, 84, 180, 110, 84, 180, 114, 92,
+       172, 102, 76, 172, 106, 84, 172, 102, 84, 164, 94, 76, 164, 98, 76,
+       172, 102, 76, 172, 102, 84, 172, 102, 76, 164, 98, 76, 172, 98, 76,
+       164, 102, 76, 172, 102, 76, 164, 98, 76, 172, 102, 76, 164, 102, 76,
+       172, 102, 76, 172, 102, 76, 164, 102, 76, 172, 102, 76, 164, 102, 76,
+       172, 98, 76, 164, 98, 76, 164, 102, 76, 164, 98, 76, 172, 102, 84,
+       172, 102, 76, 172, 102, 76, 164, 98, 76, 172, 102, 76, 172, 102, 84,
+       172, 102, 76, 172, 102, 84, 172, 102, 76, 164, 98, 76, 164, 98, 76,
+       164, 102, 76, 156, 90, 68, 164, 94, 68, 164, 98, 76, 164, 98, 76,
+       164, 94, 76, 156, 94, 76, 156, 94, 76, 164, 94, 76, 164, 98, 76,
+       164, 102, 84, 164, 102, 76, 164, 98, 84, 164, 94, 76, 156, 90, 68,
+       156, 90, 76, 156, 94, 68, 156, 94, 76, 156, 90, 68, 156, 90, 68,
+       156, 94, 76, 156, 86, 68, 156, 90, 68, 164, 98, 76, 164, 94, 76,
+       164, 94, 76, 164, 98, 76, 172, 102, 84, 180, 114, 92, 164, 102, 76,
+       172, 102, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84, 180, 110, 92,
+       180, 110, 92, 180, 114, 92, 172, 106, 92, 180, 110, 92, 172, 110, 92,
+       180, 110, 92, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 110, 92,
+       172, 110, 84, 172, 110, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92,
+       172, 110, 92, 172, 110, 84, 172, 106, 84, 172, 102, 92, 172, 106, 84,
+       172, 106, 92, 172, 110, 92, 172, 110, 92, 172, 110, 92, 180, 106, 84,
+       172, 106, 84, 180, 106, 92, 180, 110, 92, 180, 110, 100, 172, 102, 84,
+       180, 114, 100, 172, 110, 100, 124, 66, 52, 100, 46, 28, 100, 42, 28,
+       148, 78, 68, 156, 90, 68, 156, 94, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 156, 90, 68, 148, 82, 60, 148, 82, 68, 148, 86, 60,
+       148, 82, 68, 148, 86, 60, 148, 86, 68, 156, 90, 68, 148, 86, 68,
+       156, 90, 68, 156, 90, 68, 164, 94, 76, 164, 98, 84, 164, 98, 76,
+       156, 94, 76, 164, 94, 76, 164, 98, 76, 164, 98, 76, 172, 102, 84,
+       156, 90, 68, 164, 94, 76, 164, 98, 76, 164, 94, 76, 156, 86, 68,
+       156, 94, 76, 180, 110, 92, 172, 98, 76, 172, 102, 76, 172, 102, 84,
+       164, 98, 76, 172, 98, 76, 180, 110, 84, 188, 122, 100, 188, 118, 92,
+      180, 114, 92, 188, 118, 100, 188, 118, 92, 188, 122, 100, 180, 114, 92,
+       180, 110, 92, 172, 102, 76, 172, 106, 84, 188, 118, 92, 188, 122, 100,
+      188, 122, 100, 188, 118, 92, 188, 118, 100, 188, 118, 92, 172, 102, 76,
+       172, 102, 76, 180, 106, 84, 180, 110, 92, 180, 114, 92, 188, 118, 92,
+       188, 114, 92, 180, 114, 92, 188, 114, 92, 188, 118, 100, 188, 118, 92,
+       180, 114, 92, 172, 102, 76, 164, 98, 76, 172, 102, 76, 172, 106, 84,
+       180, 110, 84, 172, 110, 84, 172, 102, 84, 172, 102, 76, 164, 98, 76,
+       172, 102, 76, 172, 106, 76, 172, 102, 84, 172, 102, 76, 172, 106, 84,
+       180, 110, 92, 180, 114, 92, 180, 110, 84, 172, 110, 84, 180, 106, 84,
+       180, 110, 92, 172, 106, 76, 172, 110, 84, 180, 110, 92, 180, 110, 84,
+       180, 106, 84, 172, 106, 84, 180, 106, 84, 172, 110, 84, 180, 110, 84,
+       172, 102, 84, 172, 102, 76, 172, 102, 76, 164, 94, 68, 164, 98, 76,
+       172, 102, 76, 164, 94, 76, 172, 102, 76, 164, 98, 76, 164, 94, 76,
+       164, 98, 76, 172, 102, 76, 172, 102, 84, 172, 102, 76, 164, 98, 76,
+       164, 102, 84, 172, 98, 76, 164, 98, 76, 172, 102, 76, 164, 98, 76,
+       156, 90, 68, 156, 90, 68, 164, 94, 76, 172, 102, 76, 172, 106, 84,
+       172, 106, 84, 164, 98, 76, 164, 98, 76, 172, 102, 76, 172, 102, 76,
+       164, 98, 76, 164, 102, 76, 164, 98, 76, 172, 102, 76, 172, 102, 84,
+       164, 94, 68, 164, 94, 76, 172, 102, 76, 164, 98, 76, 164, 102, 76,
+       164, 94, 76, 156, 90, 68, 156, 94, 76, 164, 98, 76, 156, 94, 76,
+       156, 90, 68, 156, 94, 76, 156, 90, 68, 156, 94, 76, 164, 98, 76,
+       164, 98, 76, 156, 94, 76, 156, 86, 68, 148, 86, 68, 148, 82, 60,
+       156, 86, 68, 156, 86, 68, 156, 86, 68, 156, 86, 68, 156, 82, 60,
+       148, 86, 68, 156, 86, 68, 156, 90, 76, 156, 90, 68, 156, 86, 68,
+       148, 78, 60, 148, 82, 60, 156, 86, 68, 156, 90, 76, 156, 90, 68,
+       156, 86, 68, 148, 86, 60, 156, 86, 68, 148, 86, 68, 148, 86, 68,
+       156, 90, 68, 156, 90, 68, 164, 94, 76, 156, 94, 76, 156, 86, 68,
+       156, 90, 68, 156, 90, 68, 156, 90, 76, 156, 90, 68, 156, 90, 68,
+       156, 86, 68, 148, 86, 68, 156, 86, 68, 156, 86, 68, 156, 90, 68,
+       156, 90, 76, 164, 98, 76, 164, 102, 76, 164, 102, 84, 172, 106, 84,
+       172, 102, 84, 164, 90, 76, 172, 102, 84, 172, 102, 84, 164, 102, 92,
+       164, 102, 92, 124, 70, 60, 100, 42, 28, 84, 30, 12, 132, 70, 52,
+       140, 74, 60, 148, 78, 60, 140, 74, 52, 140, 74, 60, 140, 78, 60,
+       140, 78, 60, 140, 74, 52, 148, 78, 60, 148, 82, 60, 148, 82, 60,
+       148, 82, 68, 156, 86, 60, 156, 90, 68, 156, 90, 68, 156, 90, 76,
+       148, 82, 68, 156, 90, 68, 156, 90, 68, 164, 90, 68, 156, 90, 68,
+       156, 86, 68, 156, 90, 68, 164, 90, 76, 172, 102, 84, 156, 94, 76,
+       156, 90, 68, 172, 98, 84, 164, 102, 84, 164, 94, 76, 164, 94, 76,
+       172, 102, 84, 180, 110, 84, 180, 110, 92, 188, 114, 92, 180, 110, 84,
+       180, 110, 92, 188, 114, 92, 188, 118, 92, 188, 118, 92, 180, 118, 92,
+       188, 114, 92, 188, 118, 92, 180, 118, 92, 180, 114, 92, 180, 110, 84,
+       180, 114, 92, 180, 118, 92, 188, 118, 100, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 188, 118, 92, 188, 122, 100, 180, 114, 92, 180, 114, 92,
+       180, 110, 84, 180, 114, 92, 180, 114, 92, 180, 114, 92, 172, 110, 84,
+       172, 102, 84, 172, 106, 76, 180, 110, 92, 188, 118, 92, 188, 118, 100,
+       188, 118, 92, 180, 114, 92, 180, 110, 92, 180, 114, 92, 180, 110, 84,
+       180, 106, 84, 180, 110, 92, 180, 114, 92, 180, 114, 92, 180, 110, 92,
+       180, 110, 84, 172, 110, 84, 172, 102, 84, 172, 106, 84, 180, 110, 84,
+       180, 114, 92, 180, 110, 92, 180, 114, 92, 180, 110, 84, 180, 110, 92,
+       172, 106, 84, 180, 106, 84, 180, 110, 84, 172, 110, 84, 172, 106, 84,
+       172, 106, 84, 180, 106, 84, 180, 110, 92, 180, 110, 92, 172, 106, 76,
+       172, 106, 84, 172, 106, 84, 164, 94, 76, 164, 98, 76, 172, 106, 84,
+       172, 102, 76, 172, 102, 76, 164, 102, 76, 172, 98, 76, 164, 102, 76,
+       172, 102, 84, 172, 106, 76, 172, 102, 84, 172, 102, 76, 172, 102, 76,
+       164, 102, 84, 172, 102, 76, 172, 102, 84, 172, 102, 76, 164, 94, 68,
+       164, 94, 76, 172, 102, 76, 172, 106, 84, 180, 106, 84, 172, 106, 84,
+       172, 102, 76, 172, 102, 76, 172, 106, 84, 172, 106, 84, 172, 102, 76,
+       172, 102, 76, 164, 98, 76, 172, 102, 84, 172, 106, 76, 164, 94, 76,
+       164, 98, 76, 172, 102, 76, 164, 98, 76, 172, 102, 84, 164, 98, 76,
+       156, 94, 76, 164, 102, 84, 172, 102, 84, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 156, 94, 76, 164, 94, 76, 164, 98, 76, 164, 102, 84,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 102, 84, 164, 94, 76,
+       156, 94, 76, 164, 94, 76, 156, 94, 76, 156, 90, 68, 156, 86, 68,
+       156, 90, 68, 164, 94, 76, 164, 94, 76, 156, 90, 68, 156, 86, 68,
+       156, 86, 68, 156, 94, 76, 164, 98, 76, 164, 94, 76, 156, 90, 76,
+       156, 86, 68, 148, 90, 68, 156, 90, 68, 156, 94, 68, 156, 94, 76,
+       156, 94, 76, 156, 94, 76, 156, 94, 68, 156, 94, 76, 156, 94, 76,
+       164, 94, 76, 156, 98, 76, 164, 94, 76, 156, 94, 76, 156, 90, 68,
+       156, 90, 68, 164, 94, 84, 156, 94, 76, 164, 98, 84, 164, 98, 76,
+       164, 102, 76, 156, 98, 76, 164, 98, 76, 164, 94, 68, 156, 82, 68,
+       132, 66, 44, 140, 70, 52, 148, 78, 68, 156, 90, 76, 156, 102, 84,
+       124, 66, 52, 84, 30, 12, 92, 38, 28, 132, 66, 52, 140, 74, 52,
+       132, 74, 60, 132, 66, 44, 124, 66, 44, 140, 70, 52, 140, 78, 60,
+       148, 82, 60, 148, 82, 68, 148, 86, 60, 148, 86, 68, 156, 86, 68,
+       148, 90, 68, 156, 90, 76, 156, 94, 68, 156, 94, 76, 164, 90, 68,
+       164, 94, 76, 164, 98, 76, 164, 98, 84, 172, 98, 84, 164, 98, 84,
+       172, 98, 76, 164, 102, 84, 172, 102, 84, 172, 98, 84, 164, 98, 76,
+       172, 102, 84, 180, 110, 84, 180, 110, 92, 172, 110, 92, 172, 102, 76,
+       180, 106, 92, 180, 110, 84, 180, 110, 84, 180, 110, 92, 180, 106, 84,
+       172, 102, 84, 180, 118, 92, 188, 114, 92, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 188, 114, 92, 180, 110, 92, 172, 110, 84, 188, 118, 100,
+       188, 118, 92, 188, 114, 92, 180, 114, 92, 180, 110, 84, 180, 110, 92,
+       180, 114, 92, 188, 118, 92, 188, 114, 92, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 180, 114, 92, 180, 110, 84, 172, 102, 84, 172, 102, 76,
+      172, 102, 76, 172, 110, 84, 188, 118, 100, 188, 122, 100, 188, 118, 92,
+      188, 118, 100, 188, 122, 92, 188, 122, 100, 172, 110, 84, 180, 110, 92,
+       180, 114, 84, 180, 114, 92, 188, 114, 92, 180, 118, 92, 188, 114, 92,
+       180, 118, 92, 180, 106, 84, 172, 106, 84, 180, 106, 84, 180, 114, 84,
+       180, 114, 92, 188, 114, 92, 180, 114, 92, 180, 114, 84, 172, 106, 84,
+       180, 106, 84, 172, 110, 92, 180, 110, 84, 180, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 110, 84, 180, 110, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 164, 94, 68, 164, 98, 76, 180, 106, 84, 172, 110, 84,
+       172, 102, 84, 172, 102, 84, 164, 102, 76, 172, 102, 76, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 172, 102, 84, 172, 102, 84, 172, 102, 76,
+       172, 106, 84, 172, 106, 84, 172, 102, 84, 164, 98, 76, 172, 102, 76,
+       172, 106, 84, 180, 110, 84, 180, 114, 92, 180, 110, 84, 172, 106, 84,
+       172, 106, 84, 180, 110, 92, 180, 110, 84, 172, 110, 84, 172, 102, 84,
+       172, 102, 76, 172, 106, 84, 180, 110, 84, 164, 98, 76, 164, 98, 76,
+       172, 106, 84, 164, 102, 76, 172, 102, 84, 164, 98, 84, 164, 98, 76,
+       172, 106, 84, 172, 110, 84, 172, 102, 84, 164, 102, 84, 164, 102, 84,
+       172, 106, 84, 164, 102, 84, 164, 102, 84, 172, 102, 84, 164, 102, 84,
+       156, 94, 76, 164, 98, 76, 172, 106, 84, 172, 102, 76, 164, 98, 84,
+       172, 102, 84, 164, 98, 76, 164, 94, 76, 164, 94, 76, 164, 98, 76,
+       164, 98, 84, 164, 98, 76, 164, 94, 76, 156, 94, 76, 164, 94, 76,
+       172, 102, 84, 172, 102, 84, 164, 98, 76, 164, 94, 76, 156, 86, 68,
+       156, 90, 68, 164, 94, 76, 164, 98, 84, 164, 98, 76, 164, 98, 76,
+       164, 94, 76, 164, 94, 76, 164, 98, 84, 164, 102, 76, 164, 98, 76,
+       164, 102, 84, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 94, 76,
+       164, 98, 84, 172, 102, 84, 172, 102, 84, 172, 106, 92, 164, 102, 84,
+       164, 98, 76, 156, 94, 68, 156, 90, 68, 156, 86, 68, 132, 62, 44,
+       140, 66, 52, 140, 74, 60, 156, 94, 84, 172, 110, 100, 132, 74, 60,
+       92, 38, 28, 116, 58, 44, 164, 106, 84, 180, 114, 92, 180, 114, 92,
+      172, 106, 84, 172, 106, 84, 172, 110, 92, 188, 122, 100, 188, 126, 100,
+       180, 114, 92, 180, 114, 100, 180, 114, 92, 180, 114, 92, 180, 114, 92,
+       180, 110, 92, 172, 110, 92, 180, 110, 92, 164, 102, 84, 172, 106, 84,
+       180, 106, 92, 180, 110, 92, 180, 114, 92, 180, 110, 92, 180, 114, 92,
+       180, 110, 92, 172, 110, 84, 180, 114, 92, 180, 114, 100, 180, 114, 92,
+     180, 114, 100, 188, 122, 100, 188, 122, 100, 188, 114, 92, 180, 114, 92,
+       188, 114, 92, 188, 114, 92, 188, 122, 100, 188, 114, 92, 180, 110, 84,
+       180, 110, 92, 180, 110, 84, 180, 110, 92, 180, 114, 92, 180, 114, 92,
+       180, 110, 84, 180, 110, 92, 180, 110, 84, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 180, 114, 92, 180, 110, 84, 180, 110, 92, 180, 110, 84,
+       180, 110, 92, 172, 110, 84, 172, 106, 84, 180, 106, 84, 180, 110, 84,
+       180, 110, 84, 180, 110, 84, 172, 106, 84, 172, 102, 76, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 110, 84, 180, 114, 92,
+       188, 118, 92, 188, 122, 100, 188, 114, 92, 180, 110, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 180, 110, 84, 180, 114, 92, 188, 118, 92,
+       180, 110, 92, 180, 114, 84, 180, 110, 92, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 180, 110, 84, 172, 106, 84, 172, 102, 84, 172, 106, 76,
+       172, 106, 84, 172, 106, 84, 172, 102, 76, 172, 102, 76, 172, 106, 84,
+       180, 106, 84, 172, 110, 84, 172, 102, 84, 180, 110, 84, 172, 106, 84,
+       164, 94, 68, 164, 98, 76, 172, 106, 84, 180, 110, 84, 172, 106, 84,
+       172, 102, 76, 172, 102, 76, 172, 102, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 76, 172, 102, 76, 172, 102, 84, 164, 102, 76, 172, 102, 84,
+       172, 106, 84, 172, 106, 84, 172, 102, 76, 172, 102, 84, 180, 110, 84,
+       180, 110, 92, 180, 114, 84, 180, 110, 92, 172, 106, 84, 180, 106, 84,
+       172, 110, 84, 180, 106, 84, 172, 110, 92, 180, 106, 84, 172, 106, 84,
+       180, 110, 84, 172, 106, 84, 164, 98, 76, 172, 98, 76, 180, 110, 84,
+       172, 106, 84, 172, 102, 84, 164, 98, 76, 164, 102, 84, 172, 106, 84,
+       172, 110, 92, 172, 106, 84, 172, 102, 84, 164, 102, 84, 172, 106, 84,
+       164, 98, 76, 164, 98, 76, 164, 102, 84, 164, 98, 76, 156, 90, 68,
+       156, 90, 68, 164, 98, 84, 164, 98, 84, 172, 102, 76, 172, 102, 84,
+       164, 102, 84, 164, 98, 76, 164, 98, 84, 172, 102, 84, 172, 106, 84,
+       172, 98, 84, 164, 98, 76, 164, 98, 76, 172, 98, 84, 172, 106, 84,
+       172, 106, 84, 164, 98, 84, 164, 94, 76, 156, 94, 76, 164, 98, 76,
+       164, 98, 76, 164, 102, 76, 164, 102, 84, 164, 98, 76, 164, 98, 76,
+       156, 94, 76, 164, 102, 76, 172, 102, 84, 164, 102, 84, 164, 102, 76,
+       164, 102, 84, 164, 98, 84, 164, 98, 76, 164, 98, 84, 164, 98, 84,
+       164, 98, 84, 172, 102, 84, 164, 102, 84, 172, 106, 84, 164, 102, 84,
+       164, 98, 76, 164, 98, 76, 172, 102, 84, 164, 90, 68, 164, 90, 76,
+       164, 94, 76, 164, 102, 92, 172, 114, 100, 140, 82, 68, 116, 58, 44,
+       116, 62, 52, 148, 86, 68, 164, 98, 76, 164, 102, 84, 164, 98, 76,
+       156, 94, 76, 164, 98, 76, 164, 102, 84, 172, 102, 84, 164, 102, 84,
+       164, 102, 76, 164, 102, 84, 164, 98, 84, 164, 98, 76, 164, 102, 84,
+       164, 98, 76, 164, 98, 76, 172, 102, 84, 172, 102, 84, 172, 106, 84,
+       180, 110, 84, 172, 110, 92, 180, 110, 84, 172, 106, 92, 172, 106, 84,
+       164, 90, 76, 172, 106, 84, 180, 110, 92, 172, 98, 84, 164, 98, 76,
+       172, 106, 84, 180, 110, 92, 180, 114, 92, 180, 110, 92, 180, 110, 84,
+       188, 114, 92, 188, 118, 100, 188, 114, 92, 180, 110, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 180, 110, 84, 180, 110, 84, 180, 114, 92,
+       180, 110, 84, 180, 114, 92, 180, 106, 84, 172, 110, 84, 180, 106, 84,
+       172, 106, 84, 180, 110, 84, 172, 110, 84, 180, 110, 84, 172, 110, 84,
+       172, 102, 76, 172, 102, 76, 172, 102, 76, 172, 102, 84, 172, 110, 92,
+       180, 110, 84, 172, 106, 84, 172, 102, 84, 172, 110, 84, 180, 110, 84,
+       180, 110, 84, 180, 110, 84, 172, 106, 84, 172, 106, 84, 180, 110, 84,
+       180, 110, 92, 180, 114, 92, 180, 114, 92, 172, 106, 84, 172, 102, 84,
+       172, 102, 76, 172, 106, 84, 180, 106, 84, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 180, 110, 84, 180, 110, 84, 180, 110, 92, 180, 114, 84,
+       172, 106, 84, 172, 106, 84, 172, 102, 76, 172, 102, 76, 172, 102, 84,
+       172, 102, 76, 164, 98, 76, 164, 98, 76, 172, 102, 76, 172, 106, 84,
+       172, 102, 84, 172, 102, 76, 172, 106, 84, 172, 102, 76, 156, 90, 68,
+       164, 94, 68, 172, 106, 84, 172, 106, 84, 172, 102, 76, 172, 98, 76,
+       164, 98, 76, 164, 98, 76, 172, 102, 76, 172, 102, 76, 172, 102, 84,
+       164, 102, 76, 172, 102, 76, 164, 98, 76, 172, 102, 76, 180, 106, 84,
+       172, 106, 84, 164, 102, 76, 172, 102, 76, 172, 110, 92, 180, 110, 84,
+       172, 110, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 180, 114, 84, 172, 106, 84, 180, 106, 84,
+       172, 106, 84, 164, 94, 68, 164, 98, 76, 180, 110, 84, 180, 114, 92,
+       164, 98, 84, 156, 98, 76, 164, 98, 76, 172, 106, 84, 172, 110, 92,
+       172, 106, 84, 164, 102, 76, 164, 102, 84, 156, 90, 68, 156, 90, 68,
+       156, 94, 76, 164, 102, 76, 164, 98, 76, 156, 94, 76, 164, 98, 76,
+       164, 102, 84, 164, 98, 76, 164, 98, 76, 164, 98, 84, 172, 98, 76,
+       164, 98, 84, 172, 98, 76, 172, 102, 84, 172, 106, 92, 164, 98, 76,
+       164, 94, 76, 164, 98, 76, 164, 98, 84, 172, 106, 84, 172, 102, 84,
+       164, 98, 76, 156, 90, 68, 164, 98, 76, 164, 98, 76, 164, 98, 84,
+       164, 98, 76, 164, 98, 84, 164, 102, 76, 164, 98, 84, 164, 102, 76,
+       172, 102, 84, 164, 102, 84, 164, 98, 76, 164, 98, 84, 164, 98, 76,
+       164, 98, 76, 164, 102, 76, 164, 98, 76, 164, 98, 84, 172, 98, 84,
+       164, 102, 84, 164, 102, 84, 164, 102, 84, 164, 106, 84, 172, 102, 84,
+       172, 106, 84, 172, 102, 84, 172, 102, 84, 172, 102, 92, 164, 98, 84,
+       164, 102, 92, 156, 98, 84, 132, 74, 60, 116, 62, 52, 116, 58, 44,
+       148, 86, 68, 164, 94, 76, 164, 102, 84, 164, 102, 76, 164, 98, 76,
+       164, 98, 76, 164, 102, 84, 164, 98, 76, 172, 106, 84, 172, 106, 84,
+       172, 106, 92, 172, 110, 84, 172, 110, 92, 180, 110, 92, 180, 114, 92,
+       180, 114, 92, 164, 102, 84, 172, 102, 84, 172, 106, 84, 172, 106, 92,
+       180, 110, 92, 180, 110, 92, 172, 106, 84, 172, 102, 84, 164, 98, 84,
+       180, 114, 92, 188, 122, 100, 180, 114, 92, 172, 102, 84, 180, 106, 92,
+      188, 118, 100, 188, 122, 100, 172, 102, 84, 172, 106, 84, 180, 106, 84,
+       180, 110, 84, 180, 110, 84, 180, 106, 92, 172, 102, 76, 172, 102, 84,
+       180, 110, 84, 180, 110, 84, 180, 110, 92, 180, 110, 84, 180, 114, 92,
+       180, 114, 92, 180, 110, 84, 172, 106, 84, 172, 102, 76, 164, 98, 76,
+       172, 102, 84, 172, 106, 84, 180, 110, 92, 180, 114, 92, 172, 102, 84,
+       172, 102, 84, 172, 106, 84, 172, 106, 84, 180, 106, 84, 172, 106, 84,
+       172, 102, 76, 164, 98, 76, 172, 102, 76, 172, 102, 84, 172, 106, 84,
+       180, 110, 92, 180, 110, 84, 180, 110, 84, 172, 106, 84, 172, 106, 84,
+       180, 110, 84, 180, 114, 92, 180, 114, 92, 188, 114, 92, 180, 114, 92,
+       180, 110, 92, 172, 110, 84, 172, 106, 84, 180, 114, 92, 180, 110, 92,
+       180, 110, 84, 172, 110, 84, 180, 110, 84, 172, 106, 84, 172, 106, 84,
+       172, 102, 76, 172, 102, 84, 172, 102, 84, 172, 106, 76, 164, 98, 76,
+       164, 98, 76, 172, 98, 76, 172, 102, 84, 172, 106, 84, 172, 106, 76,
+       164, 98, 76, 172, 106, 84, 172, 102, 84, 164, 94, 68, 164, 94, 76,
+       172, 102, 76, 172, 102, 76, 164, 102, 84, 172, 102, 76, 164, 98, 76,
+       172, 102, 76, 172, 102, 84, 172, 106, 84, 172, 102, 76, 172, 102, 84,
+       164, 102, 76, 172, 98, 76, 164, 102, 76, 172, 106, 84, 172, 102, 76,
+       172, 102, 76, 172, 102, 84, 180, 110, 84, 180, 110, 84, 172, 102, 84,
+       172, 102, 76, 172, 106, 84, 172, 106, 76, 172, 102, 76, 172, 102, 84,
+       172, 106, 84, 180, 110, 84, 172, 106, 84, 180, 110, 84, 172, 102, 84,
+       156, 90, 68, 164, 94, 68, 172, 110, 84, 180, 114, 92, 172, 102, 76,
+       164, 94, 76, 164, 98, 76, 164, 102, 84, 172, 106, 84, 164, 102, 84,
+       164, 98, 76, 164, 98, 84, 156, 94, 76, 164, 98, 76, 164, 98, 84,
+       164, 102, 84, 164, 98, 76, 164, 98, 84, 164, 102, 76, 164, 102, 84,
+       164, 94, 76, 164, 94, 76, 164, 98, 76, 164, 98, 84, 164, 98, 76,
+       164, 98, 76, 172, 102, 84, 172, 106, 84, 164, 98, 76, 164, 98, 76,
+       164, 94, 76, 164, 98, 76, 172, 102, 84, 172, 102, 84, 164, 94, 76,
+       156, 90, 68, 164, 98, 84, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 84, 164, 102, 84, 172, 102, 84, 164, 102, 84,
+       164, 98, 76, 164, 98, 84, 164, 98, 76, 164, 98, 76, 164, 98, 84,
+       164, 98, 76, 164, 98, 84, 172, 102, 84, 164, 102, 84, 172, 102, 84,
+       164, 98, 84, 164, 102, 76, 164, 98, 76, 164, 102, 76, 164, 98, 76,
+       172, 98, 84, 164, 98, 76, 172, 98, 84, 164, 94, 76, 164, 98, 84,
+       156, 98, 84, 124, 70, 60, 116, 58, 44, 116, 62, 44, 164, 98, 76,
+       164, 102, 84, 172, 106, 84, 164, 98, 84, 164, 102, 84, 172, 102, 84,
+       172, 106, 84, 164, 102, 84, 164, 98, 84, 164, 98, 76, 164, 102, 84,
+       172, 102, 84, 172, 106, 84, 172, 110, 84, 172, 110, 92, 180, 110, 92,
+       172, 110, 92, 180, 110, 92, 180, 110, 92, 180, 114, 92, 180, 114, 92,
+       180, 114, 92, 180, 106, 92, 164, 102, 84, 180, 106, 84, 180, 114, 100,
+     188, 118, 100, 188, 118, 100, 180, 114, 92, 180, 110, 92, 180, 118, 100,
+     188, 118, 100, 188, 114, 92, 188, 118, 100, 188, 118, 92, 188, 118, 100,
+       188, 114, 92, 188, 122, 100, 172, 106, 84, 172, 106, 84, 180, 110, 84,
+       172, 110, 92, 180, 110, 84, 172, 106, 84, 172, 110, 84, 180, 110, 84,
+       180, 114, 92, 172, 106, 84, 172, 102, 84, 172, 102, 76, 172, 106, 84,
+       180, 110, 84, 180, 114, 92, 180, 114, 92, 180, 110, 84, 172, 110, 84,
+       172, 106, 84, 180, 110, 84, 180, 114, 92, 180, 110, 84, 172, 106, 84,
+       172, 102, 76, 172, 106, 84, 172, 106, 84, 180, 110, 84, 180, 114, 92,
+       180, 114, 92, 180, 114, 92, 180, 106, 84, 172, 106, 84, 172, 106, 84,
+       180, 110, 84, 180, 114, 92, 188, 118, 92, 188, 118, 92, 180, 114, 92,
+       180, 110, 84, 172, 106, 84, 180, 106, 84, 172, 106, 84, 180, 106, 84,
+       172, 106, 84, 172, 106, 84, 172, 102, 84, 172, 102, 76, 172, 106, 84,
+       172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 102, 76, 172, 102, 84,
+       172, 102, 76, 172, 106, 84, 180, 110, 84, 180, 106, 84, 172, 102, 76,
+       172, 106, 84, 172, 106, 84, 164, 98, 76, 164, 98, 76, 172, 102, 84,
+       164, 98, 76, 172, 106, 76, 172, 102, 84, 164, 98, 76, 172, 102, 76,
+       172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 102, 76, 172, 102, 84,
+       172, 102, 76, 172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 98, 76,
+       164, 102, 84, 180, 110, 84, 172, 110, 84, 172, 102, 84, 172, 102, 76,
+       172, 106, 84, 172, 106, 84, 172, 98, 76, 172, 102, 76, 172, 106, 84,
+       172, 106, 84, 172, 102, 84, 180, 110, 84, 172, 106, 84, 156, 94, 68,
+       164, 90, 68, 172, 106, 84, 180, 110, 84, 164, 102, 84, 164, 98, 76,
+       164, 98, 76, 164, 102, 84, 172, 106, 84, 164, 98, 84, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 172, 106, 84, 172, 106, 84, 164, 98, 76,
+       164, 94, 76, 164, 98, 76, 164, 98, 84, 164, 98, 76, 164, 98, 76,
+       164, 98, 84, 172, 102, 84, 172, 98, 76, 164, 98, 76, 164, 94, 76,
+       164, 98, 76, 172, 102, 84, 164, 98, 84, 164, 94, 76, 164, 94, 76,
+       164, 94, 76, 164, 98, 84, 164, 98, 76, 164, 94, 76, 156, 86, 68,
+       164, 94, 76, 156, 94, 76, 164, 98, 76, 164, 98, 76, 164, 102, 84,
+       172, 102, 76, 164, 102, 84, 164, 102, 76, 172, 102, 84, 164, 102, 76,
+       164, 102, 84, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 84,
+       164, 102, 76, 164, 102, 84, 172, 98, 84, 164, 102, 84, 164, 98, 76,
+       164, 102, 84, 156, 98, 76, 164, 98, 76, 164, 94, 76, 164, 98, 76,
+       172, 98, 84, 172, 98, 84, 164, 90, 76, 172, 106, 92, 164, 106, 92,
+       132, 70, 60, 116, 62, 44, 116, 58, 44, 164, 98, 84, 164, 98, 76,
+       164, 98, 76, 156, 90, 68, 156, 90, 68, 164, 98, 76, 164, 102, 84,
+       164, 98, 76, 172, 106, 84, 172, 102, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 92, 172, 106, 84, 172, 110, 92, 172, 106, 84, 180, 110, 92,
+       172, 106, 84, 180, 110, 92, 180, 110, 92, 180, 114, 100, 180, 110, 92,
+       172, 106, 84, 164, 98, 76, 180, 110, 92, 180, 110, 92, 180, 114, 92,
+      188, 118, 100, 188, 118, 100, 180, 114, 92, 180, 110, 92, 180, 110, 92,
+       180, 114, 92, 188, 118, 92, 188, 118, 100, 180, 110, 84, 180, 110, 92,
+       188, 118, 92, 172, 106, 84, 180, 110, 84, 180, 114, 92, 180, 110, 92,
+       180, 110, 84, 172, 106, 84, 172, 106, 84, 180, 106, 84, 180, 110, 92,
+       172, 106, 84, 180, 110, 84, 180, 110, 92, 180, 114, 92, 180, 114, 92,
+       180, 110, 92, 180, 106, 84, 172, 110, 84, 180, 106, 84, 180, 110, 92,
+       180, 110, 84, 180, 118, 100, 188, 114, 92, 180, 114, 92, 180, 110, 92,
+      188, 122, 100, 188, 118, 92, 180, 114, 100, 180, 114, 84, 180, 110, 92,
+       180, 110, 84, 180, 110, 92, 180, 110, 84, 172, 106, 84, 172, 110, 84,
+       180, 110, 84, 180, 110, 92, 180, 110, 84, 180, 110, 92, 180, 110, 84,
+       180, 110, 92, 164, 98, 76, 172, 102, 76, 172, 106, 84, 172, 102, 76,
+       172, 102, 76, 172, 102, 76, 172, 106, 84, 180, 106, 84, 180, 110, 84,
+       180, 110, 84, 180, 110, 92, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 110, 84, 180, 114, 92, 180, 110, 92, 172, 106, 84, 180, 106, 84,
+       180, 110, 84, 172, 102, 76, 172, 102, 76, 172, 102, 76, 164, 94, 76,
+       172, 106, 84, 172, 102, 84, 172, 106, 84, 172, 102, 84, 172, 106, 84,
+       180, 110, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 180, 110, 84, 172, 106, 84, 172, 102, 76, 172, 102, 84,
+       180, 110, 84, 180, 110, 92, 172, 106, 76, 172, 102, 84, 172, 106, 84,
+       172, 106, 84, 172, 102, 76, 164, 102, 76, 180, 106, 84, 164, 98, 76,
+       164, 102, 76, 180, 110, 84, 172, 110, 84, 164, 94, 76, 156, 94, 68,
+       172, 102, 84, 172, 106, 84, 172, 106, 92, 164, 102, 84, 164, 98, 76,
+       164, 102, 84, 172, 102, 84, 164, 98, 76, 164, 98, 84, 164, 102, 84,
+       156, 90, 68, 164, 102, 84, 164, 102, 84, 156, 86, 68, 148, 86, 68,
+       172, 102, 84, 172, 110, 84, 172, 102, 84, 172, 102, 84, 172, 102, 84,
+       172, 102, 84, 164, 98, 76, 164, 94, 76, 156, 94, 76, 164, 94, 76,
+       164, 98, 76, 172, 98, 84, 164, 98, 76, 156, 90, 76, 164, 94, 76,
+       172, 98, 76, 164, 98, 84, 164, 94, 76, 156, 90, 68, 148, 90, 68,
+       156, 94, 76, 164, 94, 76, 164, 102, 84, 164, 102, 84, 164, 102, 84,
+       164, 98, 76, 164, 98, 84, 172, 106, 84, 164, 102, 84, 172, 102, 84,
+       164, 98, 76, 164, 98, 84, 164, 98, 76, 164, 102, 76, 164, 98, 84,
+       164, 94, 76, 164, 94, 76, 164, 98, 84, 164, 102, 84, 164, 102, 84,
+       164, 98, 76, 164, 94, 76, 156, 94, 76, 164, 98, 76, 164, 94, 84,
+       164, 98, 84, 156, 94, 76, 164, 106, 92, 164, 102, 92, 124, 66, 52,
+       116, 58, 44, 116, 58, 36, 164, 106, 92, 172, 106, 84, 164, 106, 84,
+       172, 102, 84, 164, 102, 84, 164, 102, 84, 164, 102, 76, 164, 98, 84,
+       172, 106, 84, 172, 106, 84, 172, 110, 92, 172, 110, 84, 172, 106, 92,
+       172, 106, 84, 172, 110, 92, 180, 114, 92, 180, 110, 92, 180, 110, 92,
+      172, 110, 92, 180, 110, 92, 188, 118, 92, 188, 118, 100, 180, 114, 100,
+      180, 114, 92, 180, 114, 92, 180, 114, 92, 188, 118, 100, 180, 114, 100,
+       180, 114, 92, 180, 114, 92, 180, 110, 92, 172, 106, 84, 188, 118, 100,
+       188, 118, 92, 188, 118, 100, 188, 118, 92, 188, 118, 92, 180, 114, 92,
+      180, 106, 92, 180, 114, 92, 188, 118, 100, 180, 114, 100, 180, 110, 92,
+       172, 106, 84, 180, 110, 92, 180, 114, 92, 180, 114, 92, 180, 110, 92,
+      172, 106, 84, 172, 106, 84, 180, 114, 92, 188, 122, 100, 188, 118, 100,
+     180, 118, 92, 188, 114, 100, 180, 118, 92, 188, 118, 100, 188, 118, 100,
+     188, 118, 100, 180, 114, 92, 180, 118, 92, 188, 118, 100, 188, 122, 100,
+      188, 118, 100, 180, 114, 92, 188, 114, 92, 180, 114, 100, 180, 114, 92,
+       180, 110, 92, 172, 106, 84, 188, 118, 92, 180, 114, 92, 172, 110, 84,
+       172, 110, 84, 172, 110, 84, 172, 110, 84, 180, 110, 84, 172, 106, 84,
+       172, 110, 84, 172, 106, 84, 180, 106, 84, 172, 106, 84, 180, 106, 84,
+       172, 102, 84, 180, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       180, 110, 84, 180, 114, 84, 180, 110, 92, 180, 110, 84, 180, 110, 92,
+       180, 110, 84, 172, 106, 84, 172, 106, 76, 172, 102, 84, 164, 102, 76,
+       164, 102, 76, 172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 102, 76,
+       172, 102, 84, 172, 106, 84, 180, 110, 84, 180, 110, 92, 172, 106, 84,
+       172, 106, 84, 172, 102, 84, 180, 106, 84, 172, 106, 84, 180, 106, 92,
+       172, 106, 84, 180, 106, 92, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 172, 110, 84, 180, 110, 84, 172, 110, 84, 172, 98, 76,
+       164, 102, 76, 172, 110, 84, 180, 118, 92, 172, 106, 84, 172, 110, 84,
+       172, 102, 84, 172, 102, 76, 164, 102, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 68, 164, 102, 84, 164, 102, 76, 164, 98, 84, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 102, 76, 164, 102, 84, 164, 98, 76,
+       164, 98, 76, 156, 98, 76, 164, 94, 76, 156, 94, 76, 164, 98, 76,
+       164, 98, 84, 164, 106, 84, 164, 98, 76, 164, 98, 76, 156, 94, 76,
+       156, 94, 76, 164, 94, 76, 164, 98, 76, 172, 102, 84, 164, 102, 84,
+       164, 94, 76, 156, 98, 76, 164, 94, 76, 164, 98, 76, 164, 98, 76,
+       164, 102, 76, 164, 94, 76, 156, 94, 76, 148, 86, 68, 164, 94, 76,
+       164, 102, 84, 164, 102, 76, 164, 94, 76, 156, 94, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 84, 164, 98, 76, 164, 98, 76, 164, 98, 84,
+       164, 94, 84, 164, 90, 76, 164, 94, 76, 164, 98, 84, 164, 98, 84,
+       164, 94, 76, 164, 94, 76, 172, 102, 84, 164, 98, 76, 172, 98, 84,
+       164, 98, 84, 172, 110, 92, 164, 102, 84, 124, 66, 52, 116, 58, 36,
+       108, 46, 28, 180, 110, 92, 180, 110, 92, 172, 110, 92, 172, 110, 84,
+       172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 110, 92,
+       172, 110, 92, 180, 110, 92, 172, 110, 92, 172, 110, 84, 172, 110, 92,
+       180, 114, 92, 180, 118, 100, 180, 110, 92, 172, 106, 84, 180, 110, 92,
+      180, 110, 92, 180, 114, 100, 188, 118, 100, 180, 114, 92, 180, 114, 92,
+      180, 114, 100, 180, 114, 92, 180, 114, 100, 180, 114, 92, 180, 110, 92,
+       180, 110, 92, 172, 106, 92, 180, 106, 84, 180, 114, 92, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 172, 110, 92,
+       180, 110, 92, 188, 118, 100, 180, 114, 92, 180, 110, 92, 172, 106, 84,
+       180, 106, 92, 180, 110, 92, 180, 114, 92, 172, 106, 92, 172, 106, 84,
+      180, 106, 92, 180, 114, 92, 188, 118, 100, 188, 118, 100, 180, 114, 92,
+    180, 110, 92, 180, 114, 100, 188, 118, 100, 188, 118, 100, 180, 118, 100,
+   188, 118, 100, 188, 118, 100, 188, 118, 100, 196, 126, 108, 188, 122, 100,
+   188, 118, 100, 188, 118, 100, 188, 122, 100, 188, 118, 100, 180, 118, 100,
+       180, 114, 92, 188, 118, 100, 180, 118, 92, 180, 110, 84, 180, 110, 92,
+       180, 114, 84, 180, 114, 92, 180, 110, 92, 180, 110, 84, 180, 110, 92,
+       180, 110, 84, 180, 110, 92, 180, 110, 92, 188, 114, 84, 180, 110, 92,
+       180, 110, 84, 188, 114, 92, 188, 114, 92, 180, 118, 92, 188, 118, 100,
+      188, 118, 92, 188, 122, 100, 188, 118, 92, 188, 118, 100, 180, 118, 92,
+       180, 106, 84, 172, 106, 84, 172, 102, 76, 172, 102, 76, 172, 102, 84,
+       172, 102, 76, 172, 106, 84, 172, 106, 84, 172, 102, 84, 164, 102, 84,
+       172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 102, 84, 172, 102, 84,
+       164, 98, 84, 172, 106, 84, 172, 110, 92, 172, 106, 84, 180, 110, 92,
+       172, 106, 84, 172, 110, 92, 180, 106, 92, 172, 110, 92, 180, 110, 84,
+       172, 114, 92, 180, 114, 92, 172, 110, 84, 172, 106, 84, 172, 106, 84,
+       180, 114, 84, 180, 118, 92, 180, 110, 84, 172, 110, 84, 172, 110, 84,
+       172, 106, 84, 164, 102, 76, 172, 102, 76, 164, 102, 76, 164, 102, 84,
+       172, 102, 76, 164, 102, 84, 164, 98, 76, 164, 98, 84, 164, 98, 76,
+       164, 102, 84, 164, 102, 84, 172, 98, 76, 164, 98, 84, 164, 98, 76,
+       164, 94, 76, 156, 94, 68, 164, 94, 76, 164, 98, 76, 164, 98, 76,
+       164, 102, 84, 172, 102, 84, 164, 102, 84, 164, 98, 76, 164, 98, 76,
+       156, 94, 76, 164, 98, 76, 164, 98, 76, 164, 102, 76, 164, 98, 76,
+       164, 98, 76, 156, 94, 76, 164, 98, 76, 164, 102, 84, 164, 98, 84,
+       164, 98, 76, 164, 94, 76, 156, 94, 68, 164, 102, 84, 172, 106, 84,
+       172, 110, 92, 172, 102, 84, 164, 102, 76, 172, 102, 84, 164, 106, 84,
+       164, 98, 84, 164, 98, 76, 164, 98, 84, 156, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 84, 164, 98, 84, 164, 94, 76,
+       164, 94, 76, 164, 94, 76, 164, 98, 84, 164, 98, 84, 164, 98, 84,
+       164, 94, 76, 156, 94, 84, 156, 94, 76, 156, 94, 76, 156, 90, 76,
+       164, 98, 84, 156, 90, 76, 116, 54, 36, 108, 46, 28, 116, 54, 36,
+       172, 110, 92, 172, 110, 92, 180, 110, 92, 172, 110, 92, 172, 106, 84,
+       172, 106, 92, 164, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       172, 110, 84, 172, 106, 92, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       180, 110, 92, 172, 106, 84, 172, 106, 84, 172, 106, 84, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 188, 114, 100, 180, 114, 92, 180, 110, 92,
+       180, 110, 92, 180, 110, 92, 180, 110, 92, 172, 106, 84, 180, 106, 92,
+       172, 110, 84, 172, 106, 92, 180, 110, 84, 180, 110, 92, 180, 110, 92,
+       180, 110, 84, 180, 110, 92, 180, 106, 84, 180, 106, 84, 180, 114, 92,
+       180, 114, 100, 180, 114, 92, 172, 106, 92, 172, 106, 84, 172, 106, 84,
+       172, 106, 92, 180, 110, 92, 172, 106, 84, 172, 102, 84, 172, 106, 84,
+       180, 114, 92, 180, 114, 100, 180, 114, 92, 180, 114, 92, 180, 110, 92,
+     180, 114, 92, 188, 122, 100, 188, 118, 100, 188, 118, 100, 180, 114, 92,
+       180, 114, 92, 180, 114, 92, 180, 110, 92, 172, 106, 92, 172, 106, 84,
+       172, 106, 84, 172, 106, 92, 172, 106, 84, 180, 110, 92, 172, 110, 84,
+       180, 114, 92, 180, 114, 92, 172, 110, 84, 172, 110, 84, 172, 110, 84,
+       180, 110, 92, 180, 114, 84, 172, 110, 84, 172, 102, 84, 172, 106, 76,
+       172, 106, 84, 180, 106, 84, 172, 106, 84, 180, 106, 84, 180, 106, 84,
+       172, 106, 84, 180, 106, 84, 180, 110, 84, 172, 110, 92, 180, 110, 84,
+       180, 110, 92, 172, 110, 84, 180, 110, 84, 172, 106, 84, 172, 106, 84,
+       172, 106, 84, 164, 102, 84, 172, 102, 76, 164, 102, 76, 172, 102, 84,
+       172, 106, 76, 172, 106, 84, 172, 102, 84, 172, 102, 84, 172, 106, 84,
+       180, 106, 84, 172, 106, 92, 172, 106, 84, 172, 102, 84, 172, 102, 84,
+       172, 102, 84, 172, 106, 84, 172, 102, 84, 172, 106, 84, 172, 106, 92,
+       180, 106, 84, 172, 106, 92, 172, 110, 84, 180, 110, 92, 180, 110, 92,
+       172, 114, 92, 180, 110, 84, 172, 114, 92, 180, 110, 84, 172, 114, 92,
+       180, 110, 92, 172, 114, 92, 180, 110, 92, 172, 106, 84, 172, 106, 84,
+       164, 106, 84, 172, 106, 84, 164, 102, 84, 172, 106, 84, 164, 98, 76,
+       164, 98, 76, 164, 98, 84, 164, 102, 76, 164, 102, 84, 164, 98, 76,
+       164, 98, 84, 164, 98, 76, 164, 98, 76, 164, 98, 76, 156, 94, 76,
+       156, 90, 76, 156, 94, 68, 156, 94, 76, 156, 94, 76, 164, 98, 76,
+       164, 102, 84, 164, 102, 76, 164, 98, 76, 156, 94, 76, 156, 94, 76,
+       156, 94, 68, 156, 90, 76, 156, 94, 76, 164, 98, 76, 164, 98, 76,
+       156, 94, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       156, 94, 76, 156, 86, 68, 156, 94, 68, 164, 98, 76, 164, 98, 76,
+       156, 94, 76, 156, 90, 68, 156, 94, 76, 164, 94, 76, 156, 98, 76,
+       164, 94, 76, 156, 98, 76, 164, 94, 76, 164, 98, 76, 156, 94, 76,
+       164, 98, 76, 156, 94, 76, 164, 94, 76, 156, 90, 76, 156, 90, 76,
+       156, 90, 76, 156, 94, 76, 164, 94, 76, 156, 90, 76, 156, 94, 76,
+       164, 98, 84, 164, 94, 76, 164, 98, 84, 156, 94, 76, 164, 102, 84,
+       156, 94, 76, 116, 58, 36, 116, 54, 36, 116, 58, 36, 180, 114, 100,
+       180, 118, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92,
+       180, 110, 92, 172, 110, 92, 180, 114, 92, 180, 114, 100, 180, 114, 92,
+       180, 114, 92, 172, 110, 92, 172, 110, 92, 180, 114, 92, 180, 118, 100,
+    180, 114, 92, 180, 114, 100, 188, 118, 100, 188, 118, 100, 188, 122, 100,
+   196, 126, 108, 188, 122, 108, 196, 126, 100, 188, 122, 108, 188, 122, 100,
+   188, 118, 100, 180, 118, 100, 188, 114, 100, 180, 118, 100, 188, 118, 100,
+   188, 118, 100, 196, 126, 108, 188, 126, 100, 196, 126, 108, 188, 122, 100,
+    180, 114, 100, 180, 114, 92, 188, 122, 100, 196, 122, 108, 196, 126, 108,
+    196, 126, 100, 188, 118, 100, 180, 114, 100, 188, 114, 92, 180, 118, 100,
+   188, 122, 100, 188, 118, 100, 188, 114, 100, 188, 118, 100, 188, 122, 100,
+   196, 122, 108, 188, 126, 108, 188, 122, 100, 196, 126, 108, 196, 130, 108,
+   196, 130, 116, 196, 130, 108, 196, 126, 108, 188, 118, 100, 180, 114, 100,
+       180, 110, 92, 172, 106, 84, 172, 106, 84, 172, 102, 84, 172, 102, 84,
+       172, 106, 84, 180, 106, 92, 180, 114, 92, 180, 114, 92, 180, 118, 92,
+       180, 118, 92, 180, 118, 92, 180, 118, 92, 188, 118, 92, 180, 118, 92,
+       180, 118, 92, 188, 118, 100, 180, 114, 84, 180, 110, 92, 188, 114, 92,
+       180, 110, 92, 188, 114, 92, 188, 118, 92, 188, 118, 100, 188, 118, 92,
+       180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 114, 92, 180, 110, 84,
+       180, 110, 92, 180, 110, 84, 180, 110, 84, 188, 118, 92, 180, 114, 92,
+       180, 114, 92, 180, 110, 84, 180, 110, 92, 180, 114, 92, 180, 114, 92,
+    188, 118, 92, 188, 118, 100, 188, 122, 100, 188, 122, 100, 188, 122, 108,
+    188, 122, 100, 188, 122, 100, 188, 122, 100, 188, 118, 100, 180, 114, 92,
+     180, 114, 92, 180, 114, 100, 188, 114, 92, 180, 118, 100, 188, 118, 100,
+   188, 118, 100, 188, 118, 100, 188, 122, 100, 180, 122, 100, 188, 118, 100,
+    188, 122, 100, 188, 122, 100, 188, 126, 108, 188, 122, 100, 180, 118, 92,
+       172, 106, 84, 172, 110, 84, 172, 106, 84, 164, 102, 84, 172, 102, 76,
+       164, 102, 76, 164, 102, 84, 172, 102, 76, 156, 94, 76, 164, 98, 76,
+       164, 98, 76, 164, 102, 84, 164, 98, 76, 164, 102, 76, 164, 98, 76,
+       156, 98, 76, 164, 98, 84, 164, 98, 76, 156, 94, 76, 164, 94, 68,
+       156, 94, 76, 156, 94, 68, 164, 94, 76, 156, 94, 76, 164, 98, 76,
+       164, 98, 84, 164, 98, 76, 156, 94, 76, 156, 90, 68, 156, 94, 76,
+       156, 90, 68, 156, 94, 76, 164, 94, 76, 156, 94, 76, 164, 94, 76,
+       156, 98, 76, 164, 98, 76, 164, 98, 84, 156, 98, 76, 156, 94, 68,
+       164, 94, 76, 164, 98, 76, 164, 102, 84, 164, 102, 84, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 156, 94, 76, 156, 94, 68,
+       156, 94, 76, 156, 94, 76, 156, 94, 76, 156, 94, 76, 156, 94, 68,
+       156, 94, 76, 172, 98, 84, 164, 98, 84, 172, 98, 76, 164, 94, 84,
+       172, 98, 84, 164, 98, 84, 164, 98, 84, 172, 98, 84, 164, 98, 84,
+       164, 98, 84, 164, 106, 84, 164, 102, 84, 172, 110, 92, 164, 98, 84,
+       124, 66, 44, 116, 58, 36, 116, 50, 36, 172, 106, 84, 164, 102, 84,
+       172, 102, 84, 164, 102, 84, 172, 102, 84, 164, 102, 84, 164, 102, 84,
+       172, 102, 84, 164, 102, 84, 172, 106, 84, 164, 106, 84, 172, 102, 84,
+       164, 102, 76, 172, 102, 84, 164, 102, 84, 172, 106, 84, 172, 102, 84,
+       180, 106, 84, 172, 110, 92, 180, 114, 92, 180, 110, 92, 180, 114, 92,
+       180, 114, 92, 180, 114, 100, 180, 114, 92, 180, 110, 92, 180, 110, 92,
+       172, 106, 84, 180, 110, 84, 172, 106, 84, 180, 110, 92, 180, 110, 92,
+       180, 118, 92, 180, 114, 100, 180, 110, 92, 180, 110, 92, 180, 106, 92,
+       172, 102, 84, 180, 114, 92, 180, 114, 92, 180, 114, 100, 180, 114, 92,
+       180, 110, 92, 180, 106, 92, 172, 106, 84, 172, 106, 84, 180, 106, 92,
+       172, 110, 92, 172, 106, 84, 180, 110, 92, 180, 110, 92, 180, 114, 92,
+      180, 110, 92, 180, 110, 92, 180, 110, 92, 188, 114, 100, 188, 122, 100,
+       188, 118, 100, 180, 110, 92, 172, 106, 84, 172, 102, 84, 164, 98, 76,
+       172, 102, 84, 172, 102, 84, 164, 102, 84, 172, 98, 76, 164, 98, 84,
+       172, 106, 84, 180, 106, 92, 180, 110, 92, 172, 106, 92, 172, 110, 84,
+       172, 106, 84, 172, 110, 92, 172, 106, 84, 172, 110, 92, 180, 106, 84,
+       172, 110, 92, 180, 110, 84, 172, 110, 92, 180, 110, 84, 180, 110, 92,
+       180, 114, 92, 180, 114, 92, 188, 114, 92, 188, 114, 92, 180, 110, 92,
+       180, 110, 92, 180, 110, 92, 180, 110, 84, 180, 110, 92, 172, 110, 84,
+       172, 106, 84, 172, 106, 92, 172, 106, 84, 180, 106, 84, 172, 106, 84,
+       172, 102, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84, 172, 106, 84,
+       180, 110, 92, 180, 110, 92, 180, 110, 92, 180, 114, 92, 180, 114, 100,
+       180, 114, 92, 180, 110, 92, 180, 110, 92, 172, 102, 84, 172, 102, 84,
+       172, 106, 84, 172, 106, 84, 172, 106, 92, 180, 110, 84, 172, 110, 92,
+       180, 110, 92, 172, 106, 92, 172, 106, 84, 172, 106, 84, 172, 110, 92,
+       180, 114, 92, 180, 110, 92, 172, 110, 92, 172, 102, 84, 172, 106, 92,
+       164, 102, 84, 172, 102, 84, 164, 102, 84, 164, 98, 84, 164, 102, 76,
+       164, 98, 84, 164, 102, 84, 164, 98, 76, 164, 98, 76, 164, 98, 84,
+       172, 102, 76, 164, 102, 84, 164, 98, 84, 164, 98, 84, 164, 98, 76,
+       172, 102, 76, 164, 102, 84, 164, 102, 76, 164, 98, 84, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 164, 94, 76, 164, 98, 76, 164, 94, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 102, 84, 164, 102, 84, 164, 98, 76, 156, 94, 76, 164, 98, 76,
+       164, 98, 84, 172, 102, 84, 164, 102, 76, 164, 98, 84, 164, 98, 76,
+       164, 98, 84, 164, 98, 76, 164, 94, 76, 164, 94, 76, 164, 94, 76,
+       156, 94, 76, 164, 94, 68, 164, 94, 76, 164, 94, 76, 156, 94, 76,
+       164, 94, 76, 164, 90, 76, 156, 94, 76, 164, 94, 76, 164, 94, 76,
+       156, 94, 76, 164, 94, 76, 164, 94, 76, 156, 94, 76, 164, 94, 76,
+       164, 102, 84, 164, 102, 84, 172, 106, 92, 156, 94, 76, 124, 62, 44,
+       116, 50, 36, 108, 50, 28, 156, 86, 68, 156, 90, 68, 148, 86, 68,
+       156, 90, 68, 148, 86, 68, 156, 90, 68, 156, 86, 68, 148, 90, 68,
+       156, 90, 68, 156, 90, 76, 156, 94, 76, 156, 90, 68, 148, 86, 68,
+       156, 86, 68, 156, 90, 68, 156, 90, 76, 148, 86, 68, 156, 86, 68,
+       156, 90, 68, 164, 90, 76, 156, 90, 68, 156, 90, 76, 164, 90, 68,
+       156, 90, 76, 164, 90, 68, 156, 90, 76, 156, 90, 68, 156, 90, 68,
+       156, 90, 76, 156, 90, 68, 156, 90, 68, 156, 90, 68, 156, 86, 76,
+       156, 86, 68, 156, 90, 76, 156, 90, 68, 156, 90, 76, 156, 90, 68,
+       164, 90, 76, 164, 94, 76, 164, 94, 76, 156, 94, 76, 156, 90, 68,
+       156, 90, 68, 156, 86, 68, 156, 86, 68, 156, 86, 68, 156, 86, 68,
+       156, 90, 68, 156, 90, 68, 156, 90, 76, 164, 90, 68, 156, 90, 76,
+       156, 90, 68, 148, 86, 68, 156, 86, 68, 164, 94, 76, 164, 94, 76,
+       156, 90, 68, 156, 90, 68, 156, 86, 68, 156, 86, 68, 156, 86, 68,
+       156, 86, 68, 156, 86, 68, 156, 86, 68, 156, 86, 68, 156, 86, 68,
+       156, 90, 68, 164, 94, 76, 156, 90, 68, 156, 94, 76, 164, 98, 76,
+       164, 94, 76, 156, 94, 68, 156, 90, 68, 156, 94, 68, 164, 94, 68,
+       156, 86, 68, 156, 86, 68, 156, 90, 68, 156, 90, 68, 164, 90, 68,
+       164, 90, 76, 164, 90, 68, 164, 90, 76, 164, 94, 76, 156, 94, 68,
+       164, 94, 68, 156, 90, 68, 156, 90, 68, 164, 90, 68, 164, 94, 76,
+       156, 90, 68, 156, 90, 68, 156, 90, 68, 156, 90, 68, 164, 90, 68,
+       156, 90, 68, 156, 90, 68, 164, 90, 68, 156, 90, 68, 156, 90, 76,
+       156, 90, 68, 156, 90, 76, 164, 90, 68, 156, 90, 68, 156, 90, 76,
+       156, 90, 68, 156, 90, 76, 156, 90, 68, 156, 90, 76, 156, 86, 68,
+       164, 90, 76, 156, 90, 68, 164, 90, 76, 156, 94, 68, 164, 94, 76,
+       156, 90, 68, 156, 90, 76, 156, 90, 68, 156, 90, 76, 156, 94, 76,
+       156, 94, 76, 156, 90, 76, 148, 86, 68, 164, 98, 84, 164, 98, 76,
+       164, 98, 76, 156, 94, 76, 164, 94, 76, 156, 94, 76, 164, 94, 76,
+       156, 94, 76, 164, 94, 76, 156, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 94, 76, 164, 98, 76, 156, 94, 76, 156, 94, 76, 164, 98, 76,
+       164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76, 164, 98, 76,
+       164, 98, 76, 156, 94, 76, 156, 94, 76, 156, 90, 68, 156, 94, 76,
+       156, 94, 76, 164, 94, 76, 156, 98, 76, 164, 98, 76, 164, 98, 84,
+       156, 94, 76, 156, 94, 76, 156, 94, 76, 164, 94, 76, 164, 98, 76,
+       164, 98, 76, 164, 94, 76, 156, 90, 76, 156, 90, 68, 156, 90, 68,
+       156, 94, 76, 156, 90, 68, 156, 90, 68, 156, 90, 68, 148, 90, 68,
+       156, 90, 68, 156, 90, 76, 156, 94, 68, 156, 90, 68, 156, 94, 76,
+       156, 90, 68, 156, 94, 76, 156, 90, 68, 156, 94, 68, 156, 82, 68,
+       156, 86, 76, 156, 90, 76, 156, 86, 76, 148, 86, 68, 156, 86, 68,
+       156, 86, 76, 156, 90, 68, 156, 94, 76, 164, 94, 84, 164, 98, 84,
+       156, 94, 76, 156, 98, 76, 148, 86, 68, 116, 54, 36, 108, 50, 28,
+       108, 50, 36, 140, 78, 60, 140, 78, 60, 148, 78, 60, 140, 78, 60,
+       140, 78, 60, 140, 78, 60, 140, 78, 60, 140, 78, 60, 148, 82, 60,
+       148, 82, 60, 148, 82, 60, 148, 78, 60, 140, 74, 52, 140, 74, 52,
+       140, 78, 60, 148, 82, 60, 140, 70, 52, 140, 74, 52, 148, 74, 60,
+       140, 78, 60, 148, 74, 60, 140, 74, 52, 140, 74, 52, 140, 78, 60,
+       140, 74, 52, 148, 78, 60, 140, 74, 60, 148, 78, 60, 148, 74, 60,
+       148, 78, 60, 148, 74, 60, 148, 78, 60, 140, 70, 52, 140, 70, 52,
+       148, 74, 60, 140, 74, 60, 148, 78, 60, 148, 78, 68, 140, 78, 60,
+       148, 78, 60, 140, 78, 60, 148, 78, 60, 148, 78, 60, 148, 74, 60,
+       140, 74, 52, 140, 74, 52, 140, 74, 52, 140, 74, 52, 140, 74, 52,
+       148, 74, 60, 148, 78, 60, 140, 78, 60, 148, 74, 60, 140, 74, 52,
+       140, 70, 52, 140, 74, 52, 140, 78, 60, 148, 78, 60, 148, 78, 60,
+       148, 78, 60, 148, 78, 60, 148, 82, 60, 140, 74, 52, 140, 74, 52,
+       140, 78, 60, 140, 74, 52, 140, 74, 52, 140, 74, 52, 140, 74, 52,
+       140, 78, 60, 140, 82, 60, 148, 82, 60, 148, 86, 68, 148, 86, 60,
+       140, 82, 60, 148, 78, 60, 140, 78, 60, 140, 78, 60, 140, 70, 52,
+       140, 70, 52, 140, 74, 52, 140, 70, 52, 140, 74, 52, 140, 70, 52,
+       140, 74, 52, 140, 74, 52, 140, 78, 60, 148, 74, 60, 140, 74, 52,
+       140, 74, 60, 140, 74, 52, 140, 74, 60, 140, 78, 60, 148, 78, 60,
+       156, 82, 60, 148, 82, 68, 156, 82, 60, 148, 82, 68, 148, 82, 60,
+       156, 82, 68, 148, 82, 60, 148, 82, 68, 148, 82, 60, 148, 82, 60,
+       148, 82, 60, 148, 82, 68, 148, 78, 60, 156, 82, 60, 148, 82, 68,
+       148, 82, 60, 156, 82, 60, 148, 82, 60, 156, 82, 68, 148, 82, 60,
+       156, 86, 68, 148, 82, 60, 156, 82, 68, 148, 82, 60, 148, 82, 68,
+       148, 82, 68, 148, 82, 68, 148, 86, 68, 148, 82, 68, 156, 86, 68,
+       148, 82, 68, 148, 82, 60, 148, 82, 68, 140, 78, 60, 148, 78, 68,
+       140, 78, 60, 148, 78, 60, 140, 78, 60, 148, 78, 60, 140, 78, 60,
+       148, 82, 60, 148, 78, 60, 140, 78, 60, 140, 78, 60, 140, 78, 60,
+       140, 78, 60, 148, 78, 60, 148, 82, 60, 140, 78, 60, 148, 78, 60,
+       140, 78, 60, 148, 78, 60, 140, 78, 60, 140, 78, 60, 148, 78, 60,
+       148, 82, 60, 140, 74, 52, 140, 78, 60, 148, 78, 60, 140, 78, 60,
+       148, 82, 60, 148, 82, 60, 148, 82, 60, 148, 82, 60, 148, 78, 60,
+       148, 78, 60, 140, 78, 60, 140, 78, 60, 148, 82, 60, 148, 82, 60,
+       148, 78, 60, 140, 78, 60, 148, 86, 60, 148, 82, 68, 148, 82, 60,
+       148, 82, 60, 140, 78, 60, 148, 82, 60, 148, 78, 60, 148, 78, 60,
+       140, 78, 60, 140, 78, 60, 140, 78, 60, 140, 78, 60, 140, 78, 60,
+       140, 78, 60, 148, 78, 60, 140, 78, 60, 148, 82, 68, 148, 82, 68,
+       148, 86, 68, 156, 82, 68, 148, 82, 68, 148, 82, 68, 148, 82, 68,
+       148, 86, 68, 148, 82, 68, 148, 78, 60, 140, 82, 60, 140, 74, 60,
+       140, 78, 60, 140, 74, 60, 116, 50, 36, 108, 50, 36, 108, 50, 28,
+       108, 42, 28, 108, 42, 20, 108, 42, 20, 108, 42, 20, 116, 46, 28,
+       108, 42, 20, 116, 46, 28, 108, 42, 20, 108, 46, 28, 108, 46, 28,
+       116, 46, 28, 108, 46, 20, 108, 42, 20, 100, 42, 20, 108, 42, 20,
+       108, 42, 28, 108, 42, 20, 116, 46, 28, 116, 46, 28, 116, 46, 28,
+       108, 42, 20, 108, 38, 20, 108, 42, 28, 116, 42, 28, 108, 42, 20,
+       116, 46, 28, 116, 46, 28, 116, 46, 28, 116, 50, 28, 108, 46, 28,
+       116, 46, 28, 108, 42, 20, 108, 42, 28, 116, 42, 28, 108, 46, 28,
+       116, 46, 28, 116, 46, 28, 108, 46, 28, 116, 42, 28, 108, 42, 20,
+       116, 46, 28, 108, 42, 20, 116, 46, 28, 108, 46, 28, 108, 42, 20,
+       116, 42, 28, 108, 38, 20, 108, 42, 28, 116, 46, 28, 108, 46, 28,
+       116, 46, 28, 108, 42, 20, 108, 42, 20, 116, 42, 28, 116, 46, 28,
+       116, 50, 28, 116, 50, 28, 116, 50, 28, 116, 46, 28, 116, 46, 28,
+       116, 46, 28, 116, 50, 28, 116, 46, 28, 116, 50, 36, 124, 50, 36,
+       116, 50, 28, 116, 46, 28, 116, 46, 28, 116, 46, 28, 116, 46, 28,
+       108, 46, 20, 108, 50, 28, 116, 50, 28, 116, 54, 28, 108, 46, 28,
+       108, 46, 20, 108, 42, 20, 108, 42, 20, 116, 50, 28, 116, 46, 28,
+       116, 46, 28, 116, 46, 28, 116, 46, 28, 108, 46, 28, 116, 46, 28,
+       116, 46, 28, 116, 46, 28, 116, 46, 28, 116, 46, 28, 116, 42, 28,
+       116, 46, 28, 116, 46, 28, 116, 50, 28, 124, 50, 36, 124, 58, 36,
+       124, 58, 36, 124, 58, 36, 124, 58, 36, 124, 58, 44, 124, 58, 36,
+       124, 58, 36, 124, 54, 36, 132, 62, 44, 124, 54, 36, 124, 58, 36,
+       124, 58, 36, 124, 58, 36, 124, 54, 44, 124, 58, 36, 132, 62, 44,
+       124, 54, 36, 124, 58, 36, 124, 58, 36, 124, 58, 36, 124, 58, 36,
+       124, 54, 36, 124, 58, 36, 124, 58, 36, 124, 58, 44, 124, 58, 36,
+       124, 58, 44, 124, 54, 36, 124, 58, 44, 124, 58, 36, 124, 58, 44,
+       124, 58, 44, 132, 62, 44, 124, 62, 44, 132, 62, 44, 124, 58, 44,
+       124, 58, 44, 124, 58, 44, 132, 62, 44, 124, 62, 44, 132, 62, 44,
+       124, 62, 44, 124, 62, 44, 124, 58, 36, 124, 58, 36, 124, 62, 44,
+       124, 62, 44, 132, 62, 44, 116, 58, 36, 124, 58, 36, 124, 58, 44,
+       124, 62, 44, 124, 62, 44, 124, 62, 44, 124, 62, 44, 124, 58, 36,
+       124, 62, 44, 124, 58, 36, 124, 62, 44, 132, 62, 44, 124, 62, 44,
+       132, 62, 44, 124, 66, 44, 132, 62, 44, 124, 62, 44, 124, 58, 36,
+       124, 58, 36, 124, 62, 44, 132, 62, 44, 124, 62, 44, 124, 62, 44,
+       124, 58, 36, 124, 62, 44, 124, 58, 36, 124, 58, 36, 124, 58, 44,
+       124, 58, 36, 124, 58, 36, 116, 58, 36, 124, 58, 36, 124, 58, 36,
+       124, 58, 36, 124, 58, 36, 124, 58, 36, 124, 58, 36, 124, 58, 36,
+       124, 58, 36, 124, 58, 36, 124, 50, 36, 124, 54, 36, 124, 54, 36,
+       124, 54, 36, 116, 54, 36, 116, 50, 36, 124, 54, 36, 124, 54, 44,
+       124, 54, 36, 116, 54, 36, 116, 54, 36, 108, 46, 28, 124, 58, 44,
+       124, 58, 44, 100, 42, 20, 108, 50, 28
+};
diff --git a/modes/glx/fire.c b/modes/glx/fire.c
new file mode 100644 (file)
index 0000000..fd4c701
--- /dev/null
@@ -0,0 +1,1058 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* fire --- 3D fire or rain landscape */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)fire.c       5.01 2001/03/09 xlockmore";
+#endif
+
+/* Copyright (c) E. Lassauge, 2001. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by David Bucciarelli 
+ * (tech.hmw@plus.it) and could be found in the demo package 
+ * of Mesa (Mesa-3.2/3Dfx/demos/). This mode is the result of the merge of
+ * two of the David's demos (fire and rain).
+ *
+ * Eric Lassauge  (October-10-2000) <lassauge@mail.dotcom.fr>
+ *                                 http://lassauge.free.fr/linux.html
+ *
+ * REVISION HISTORY:
+ *
+ * E.Lassauge - 09-Mar-2001:
+ *      - get rid of my framerate options to use showfps
+ *
+ * E.Lassauge - 12-Jan-2001:
+ *      - add rain particules, selected if count=0 (no fire means rain !)
+ *
+ * E.Lassauge - 28-Nov-2000:
+ *      - modified release part to add freeing of GL objects
+ *
+ * E.Lassauge - 14-Nov-2000:
+ *      - use new common xpm_to_ximage function
+ *
+ * E.Lassauge - 25-Oct-2000:
+ *     - add the trees (with a new resource '-trees')
+ *      - corrected handling of color (textured vs untextured)
+ *      - corrected handling of endiannes for the xpm files
+ *      - inverted ground pixmap file
+ *      - use malloc-ed tree array
+ *
+ * TSchmidt - 23-Oct-2000:
+ *     - added size option like used in sproingies mode
+ *
+ * E.Lassauge - 13-Oct-2000:
+ *     - when trackmouse and window is iconified (login screen): stop tracking
+ *     - add pure GLX handling of framerate display (erased GLUT stuff)
+ *     - made count a per screen variable and update it only if framemode
+ *     - changes for no_texture an wireframe modes
+ *     - change no_texture color for the ground
+ *     - add freeing of texture image
+ *     - misc comments and little tweakings
+ *
+ * TODO:
+ *      - perhaps use a user supplied xpm for ground image (or a whatever image
+ *        file using ImageMagick ?)
+ *     - random number of trees ? change trees at change_fire ?
+ *     - fix wireframe mode: it's too CPU intensive.
+ *     - look how we can get the Wheel events (Button4&5).
+ *     - perhaps use an observer programmed movement:
+ *        watch out for the trees !!!
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Fire"
+#define HACK_INIT init_fire
+#define HACK_DRAW draw_fire
+#define fire xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 800 \n" \
+ "*size: 0 \n" \
+ "*trees: 5 \n" \
+ "*showfps: False \n" \
+ "*trackmouse: False \n" \
+ "*wireframe:  False \n"       /* still needs some work */
+
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else                          /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "visgl.h"
+#endif                         /* !STANDALONE */
+#include "iostuff.h"           /* getFont() */
+
+#ifdef MODE_fire
+
+#define MINSIZE 32
+
+#include <GL/gl.h>
+#include <GL/glx.h>
+#include <GL/glu.h>
+
+#include "xpm-ximage.h"
+
+#ifdef STANDALONE
+#include "../images/ground.xpm"
+#include "../images/tree.xpm"
+#else /* !STANDALONE */
+#include "pixmaps/ground.xpm"
+#include "pixmaps/tree.xpm"
+#endif /* !STANDALONE */
+
+/* vector utility macros */
+#define vinit(a,i,j,k) {\
+  (a)[0]=i;\
+  (a)[1]=j;\
+  (a)[2]=k;\
+}
+
+#define vinit4(a,i,j,k,w) {\
+  (a)[0]=i;\
+  (a)[1]=j;\
+  (a)[2]=k;\
+  (a)[3]=w;\
+}
+
+#define vadds(a,dt,b) {\
+  (a)[0]+=(dt)*(b)[0];\
+  (a)[1]+=(dt)*(b)[1];\
+  (a)[2]+=(dt)*(b)[2];\
+}
+
+#define vequ(a,b) {\
+  (a)[0]=(b)[0];\
+  (a)[1]=(b)[1];\
+  (a)[2]=(b)[2];\
+}
+
+#define vinter(a,dt,b,c) {\
+  (a)[0]=(dt)*(b)[0]+(1.0-dt)*(c)[0];\
+  (a)[1]=(dt)*(b)[1]+(1.0-dt)*(c)[1];\
+  (a)[2]=(dt)*(b)[2]+(1.0-dt)*(c)[2];\
+}
+
+#define clamp(a)        ((a) < 0.0 ? 0.0 : ((a) < 1.0 ? (a) : 1.0))
+
+#define vclamp(v) {\
+  (v)[0]=clamp((v)[0]);\
+  (v)[1]=clamp((v)[1]);\
+  (v)[2]=clamp((v)[2]);\
+}
+
+/* Manage option vars */
+#define DEF_TEXTURE    "True"
+#define DEF_FOG                "False"
+#define DEF_SHADOWS    "True"
+#define DEF_FRAMERATE  "False"
+#define DEF_TRACKMOUSE  "False"
+#define DEF_TREES      "5"
+#define MAX_TREES      20
+static Bool do_texture;
+static Bool do_fog;
+static Bool do_shadows;
+static Bool do_trackmouse;
+static int  num_trees;
+static XFontStruct *mode_font = None;
+
+static XrmOptionDescRec opts[] = {
+    {(char *) "-texture", (char *) ".fire.texture", XrmoptionNoArg, (caddr_t) "on"},
+    {(char *) "+texture", (char *) ".fire.texture", XrmoptionNoArg, (caddr_t) "off"},
+    {(char *) "-fog", (char *) ".fire.fog", XrmoptionNoArg, (caddr_t) "on"},
+    {(char *) "+fog", (char *) ".fire.fog", XrmoptionNoArg, (caddr_t) "off"},
+    {(char *) "-shadows", (char *) ".fire.shadows", XrmoptionNoArg, (caddr_t) "on"},
+    {(char *) "+shadows", (char *) ".fire.shadows", XrmoptionNoArg, (caddr_t) "off"},
+    {(char *) "-trackmouse", (char *) ".fire.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+    {(char *) "+trackmouse", (char *) ".fire.trackmouse", XrmoptionNoArg, (caddr_t) "off"},
+    {(char *) "-trees", (char *) ".fire.trees", XrmoptionSepArg, (caddr_t) NULL},
+
+};
+
+static argtype vars[] = {
+    {(caddr_t *) & do_texture, (char *) "texture", (char *) "Texture", (char *) DEF_TEXTURE, t_Bool},
+    {(caddr_t *) & do_fog, (char *) "fog", (char *) "Fog", (char *) DEF_FOG, t_Bool},
+    {(caddr_t *) & do_shadows, (char *) "shadows", (char *) "Shadows", (char *) DEF_SHADOWS, t_Bool},
+    {(caddr_t *) & do_trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool},
+    {(caddr_t *) & num_trees, (char *) "trees", (char *) "Trees", (char *) DEF_TREES, t_Int},
+};
+
+static OptionStruct desc[] = {
+    {(char *) "-/+texture", (char *) "turn on/off texturing"},
+    {(char *) "-/+fog", (char *) "turn on/off fog"},
+    {(char *) "-/+shadows", (char *) "turn on/off shadows"},
+    {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"},
+    {(char *) "-trees num", (char *) "number of trees (0 disables)"},
+};
+
+ModeSpecOpt fire_opts =
+ { sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc };
+
+#ifdef USE_MODULES
+ModStruct fire_description =
+    { "fire", "init_fire", "draw_fire", "release_fire",
+    "draw_fire", "change_fire", NULL, &fire_opts,
+    10000, 800, 1, 400, 64, 1.0, "",
+    "Shows a 3D fire-like image", 0, NULL
+};
+#endif /* USE_MODULES */
+
+/* misc defines */
+#define TREEINR                2.5     /* tree min distance */
+#define TREEOUTR       8.0     /* tree max distance */
+#define FRAME          50      /* frame count interval */
+#define DIMP           20.0    /* dimension of ground */
+#define DIMTP          16.0    /* dimension of ground texture */
+
+#define RIDCOL                 0.4     /* factor for color blending */
+
+#define AGRAV          -9.8    /* gravity */
+
+#define NUMPART                7500    /* rain particles */
+
+/* fire particle struct */
+typedef struct {
+    int age;
+    float p[3][3];
+    float v[3];
+    float c[3][4];
+} part;
+
+/* rain particle struct */
+typedef struct {
+    float age;
+    float acc[3];
+    float vel[3];
+    float pos[3];
+    float partLength;
+    float oldpos[3];
+} rain;
+
+/* colors */
+static float black[3]    = { 0.0, 0.0, 0.0 }; /* shadow color */
+static float partcol1[3] = { 1.0, 0.2, 0.0 }; /* initial color: red-ish */
+static float partcol2[3] = { 1.0, 1.0, 0.0 }; /* blending color: yellow-ish */
+static float fogcolor[4] = { 0.9, 0.9, 1.0, 1.0 };
+
+/* ground */
+static float q[4][3] = {
+    {-DIMP, 0.0, -DIMP},
+    {DIMP, 0.0, -DIMP},
+    {DIMP, 0.0, DIMP},
+    {-DIMP, 0.0, DIMP}
+};
+
+/* ground texture */
+static float qt[4][2] = {
+    {-DIMTP, -DIMTP},
+    {DIMTP, -DIMTP},
+    {DIMTP, DIMTP},
+    {-DIMTP, DIMTP}
+};
+
+/* default values for observer */
+static const float DEF_OBS[3] = { 2.0, 1.0, 0.0 };
+#define DEV_V          0.0
+#define DEF_ALPHA      -90.0
+#define DEF_BETA       90.0
+
+/* tree struct */
+typedef struct {
+    float x,y,z;
+} treestruct;
+
+/* the mode struct, contains all per screen variables */
+typedef struct {
+    GLint WIDTH, HEIGHT;       /* display dimensions */
+    GLXContext *glx_context;
+
+    int np;                    /* number of fire particles : set it through 'count' resource */
+    float eject_r;             /* emission radius */
+    float dt, maxage, eject_vy, eject_vl;
+    float ridtri;              /* fire particle size */
+    Bool shadows;              /* misc booleans: set them through specific resources */
+    Bool fog;
+
+    part *p;                   /* fire particles array */
+    rain *r;                   /* rain particles array */
+
+    XImage *gtexture;          /* ground texture image bits */
+    XImage *ttexture;          /* tree texture image bits */
+    GLuint groundid;           /* ground texture id: GL world */
+    GLuint treeid;             /* tree texture id: GL world */
+    GLuint fontbase;           /* fontbase id: GL world */
+
+    int   num_trees;           /* number of trees: set it through 'trees' resource */
+    treestruct *treepos;       /* trees positions: float treepos[num_trees][3] */
+
+    float min[3];              /* raining area */
+    float max[3];
+
+    float obs[3];              /* observer coordinates */
+    float dir[3];              /* view direction */
+    float v;                   /* observer velocity */
+    float alpha;               /* observer angles */
+    float beta;
+
+    clock_t told;              /* frame timetag */
+    int frcount;               /* frame counter */
+    char frbuf[80];            /* frame value string */
+} firestruct;
+
+/* array of firestruct indexed by screen number */
+static firestruct *fire = (firestruct *) NULL;
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Misc funcs.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+/* utility function for the rain particles */
+static float gettimerain()
+{
+  static clock_t told=0;
+  clock_t tnew,ris;
+
+  tnew=clock();
+
+  ris=tnew-told;
+
+  told=tnew;
+
+  return (ris/(float)CLOCKS_PER_SEC);
+}
+
+/* my RAND */
+static float vrnd(void)
+{
+    return ((float) LRAND() / (float) MAXRAND);
+}
+
+/* initialise new fire particle */
+static void setnewpart(firestruct * fs, part * p)
+{
+    float a, vi[3], *c;
+
+    p->age = 0;
+
+    a = vrnd() * M_PI * 2.0;
+
+    vinit(vi, sin(a) * fs->eject_r * vrnd(), 0.15, cos(a) * fs->eject_r * vrnd());
+    vinit(p->p[0], vi[0] + vrnd() * fs->ridtri, vi[1] + vrnd() * fs->ridtri, vi[2] + vrnd() * fs->ridtri);
+    vinit(p->p[1], vi[0] + vrnd() * fs->ridtri, vi[1] + vrnd() * fs->ridtri, vi[2] + vrnd() * fs->ridtri);
+    vinit(p->p[2], vi[0] + vrnd() * fs->ridtri, vi[1] + vrnd() * fs->ridtri, vi[2] + vrnd() * fs->ridtri);
+
+    vinit(p->v, vi[0] * fs->eject_vl / (fs->eject_r / 2),
+         vrnd() * fs->eject_vy + fs->eject_vy / 2,
+         vi[2] * fs->eject_vl / (fs->eject_r / 2));
+
+    c = partcol1;
+
+    vinit4(p->c[0], c[0] * ((1.0 - RIDCOL) + vrnd() * RIDCOL),
+          c[1] * ((1.0 - RIDCOL) + vrnd() * RIDCOL),
+          c[2] * ((1.0 - RIDCOL) + vrnd() * RIDCOL), 1.0);
+    vinit4(p->c[1], c[0] * ((1.0 - RIDCOL) + vrnd() * RIDCOL),
+          c[1] * ((1.0 - RIDCOL) + vrnd() * RIDCOL),
+          c[2] * ((1.0 - RIDCOL) + vrnd() * RIDCOL), 1.0);
+    vinit4(p->c[2], c[0] * ((1.0 - RIDCOL) + vrnd() * RIDCOL),
+          c[1] * ((1.0 - RIDCOL) + vrnd() * RIDCOL),
+          c[2] * ((1.0 - RIDCOL) + vrnd() * RIDCOL), 1.0);
+}
+
+/* initialise new rain particle */
+static void setnewrain(firestruct * fs, rain * r)
+{
+    r->age=0.0f;
+
+    vinit(r->acc,0.0f,-0.98f,0.0f);
+    vinit(r->vel,0.0f,0.0f,0.0f);
+    
+    r->partLength=0.2f;
+
+    vinit(r->oldpos,fs->min[0]+(fs->max[0]-fs->min[0])*vrnd(),
+                    fs->max[1]+0.2f*fs->max[1]*vrnd(),
+                    fs->min[2]+(fs->max[2]-fs->min[2])*vrnd());
+    vequ(r->pos,r->oldpos);
+    vadds(r->oldpos,-(r->partLength),r->vel);
+
+    r->pos[1]=(fs->max[1]-fs->min[1])*vrnd()+fs->min[1];
+    r->oldpos[1]=r->pos[1]-r->partLength*r->vel[1];
+}
+
+/* set fire particle values */
+static void setpart(firestruct * fs, part * p)
+{
+    float fact;
+
+    if (p->p[0][1] < 0.1) {
+       setnewpart(fs, p);
+       return;
+    }
+
+    p->v[1] += AGRAV * fs->dt;
+
+    vadds(p->p[0], fs->dt, p->v);
+    vadds(p->p[1], fs->dt, p->v);
+    vadds(p->p[2], fs->dt, p->v);
+
+    p->age++;
+
+    if ((p->age) > fs->maxage) {
+       vequ(p->c[0], partcol2);
+       vequ(p->c[1], partcol2);
+       vequ(p->c[2], partcol2);
+    } else {
+       fact = 1.0 / fs->maxage;
+       vadds(p->c[0], fact, partcol2);
+       vclamp(p->c[0]);
+       p->c[0][3] = fact * (fs->maxage - p->age);
+
+       vadds(p->c[1], fact, partcol2);
+       vclamp(p->c[1]);
+       p->c[1][3] = fact * (fs->maxage - p->age);
+
+       vadds(p->c[2], fact, partcol2);
+       vclamp(p->c[2]);
+       p->c[2][3] = fact * (fs->maxage - p->age);
+    }
+}
+
+/* set rain particle values */
+static void setpartrain(firestruct * fs, rain * r, float dt)
+{
+    r->age += dt;
+
+    vadds(r->vel,dt,r->acc);
+    vadds(r->pos,dt,r->vel);
+
+    if(r->pos[0]<fs->min[0])
+       r->pos[0]=fs->max[0]-(fs->min[0]-r->pos[0]);
+    if(r->pos[2]<fs->min[2])
+       r->pos[2]=fs->max[2]-(fs->min[2]-r->pos[2]);
+
+    if(r->pos[0]>fs->max[0])
+       r->pos[0]=fs->min[0]+(r->pos[0]-fs->max[0]);
+    if(r->pos[2]>fs->max[2])
+       r->pos[2]=fs->min[2]+(r->pos[2]-fs->max[2]);
+
+    vequ(r->oldpos,r->pos);
+    vadds(r->oldpos,-(r->partLength),r->vel);
+    if(r->pos[1]<fs->min[1])
+       setnewrain(fs, r);
+}
+
+/* draw a tree */
+static void drawtree(float x, float y, float z)
+{
+    glBegin(GL_QUADS);
+    glTexCoord2f(0.0,0.0);
+    glVertex3f(x-1.5,y+0.0,z);
+
+    glTexCoord2f(1.0,0.0);
+    glVertex3f(x+1.5,y+0.0,z);
+
+    glTexCoord2f(1.0,1.0);
+    glVertex3f(x+1.5,y+3.0,z);
+
+    glTexCoord2f(0.0,1.0);
+    glVertex3f(x-1.5,y+3.0,z);
+
+
+    glTexCoord2f(0.0,0.0);
+    glVertex3f(x,y+0.0,z-1.5);
+
+    glTexCoord2f(1.0,0.0);
+    glVertex3f(x,y+0.0,z+1.5);
+
+    glTexCoord2f(1.0,1.0);
+    glVertex3f(x,y+3.0,z+1.5);
+
+    glTexCoord2f(0.0,1.0);
+    glVertex3f(x,y+3.0,z-1.5);
+
+    glEnd();
+
+}
+
+/* calculate observer position : modified only if trackmouse is used */
+static void calcposobs(firestruct * fs)
+{
+    fs->dir[0] = sin(fs->alpha * M_PI / 180.0);
+    fs->dir[2] =
+       cos(fs->alpha * M_PI / 180.0) * sin(fs->beta * M_PI / 180.0);
+    fs->dir[1] = cos(fs->beta * M_PI / 180.0);
+
+    fs->obs[0] += fs->v * fs->dir[0];
+    fs->obs[1] += fs->v * fs->dir[1];
+    fs->obs[2] += fs->v * fs->dir[2];
+
+    if (!fs->np)
+    {
+       vinit(fs->min,fs->obs[0]-7.0f,-0.2f,fs->obs[2]-7.0f);
+       vinit(fs->max,fs->obs[0]+7.0f,8.0f,fs->obs[2]+7.0f);
+    }
+}
+
+/* track the mouse in a joystick manner : not perfect but it works */
+static void trackmouse(ModeInfo * mi)
+{
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+    /* we keep static values (not per screen) for the mouse stuff: in general you have only one mouse :-> */
+    static int max[2] = { 0, 0 };
+    static int min[2] = { 0x7fffffff, 0x7fffffff }, center[2];
+    Window r, c;
+    int rx, ry, cx, cy;
+    unsigned int m;
+
+    (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
+                        &r, &c, &rx, &ry, &cx, &cy, &m);
+
+    if (max[0] < cx)
+       max[0] = cx;
+    if (min[0] > cx)
+       min[0] = cx;
+    center[0] = (max[0] + min[0]) / 2;
+
+    if (max[1] < cy)
+       max[1] = cy;
+    if (min[1] > cy)
+       min[1] = cy;
+    center[1] = (max[1] + min[1]) / 2;
+
+    if (fabs(center[0] - (float) cx) > 0.1 * (max[0] - min[0]))
+       fs->alpha += 2.5 * (center[0] - (float) cx) / (max[0] - min[0]);
+    if (fabs(center[1] - (float) cy) > 0.1 * (max[1] - min[1]))
+       fs->beta += 2.5 * (center[1] - (float) cy) / (max[1] - min[1]);
+
+    /* oops: can't get those buttons */
+    if (m & Button4Mask)
+       fs->v += 0.01;
+    if (m & Button5Mask)
+       fs->v -= 0.01;
+
+}
+
+/* initialise textures */
+static void inittextures(ModeInfo * mi)
+{
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+    if (do_texture) {
+
+       glGenTextures(1, &fs->groundid);
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, fs->groundid);
+#endif /* HAVE_GLBINDTEXTURE */
+
+        if ((fs->gtexture = xpm_to_ximage(MI_DISPLAY(mi), MI_VISUAL(mi),
+                        MI_COLORMAP(mi), ground)) == None) {
+           (void) fprintf(stderr, "Error reading the ground texture.\n");
+           glDeleteTextures(1, &fs->groundid);
+            do_texture = False;
+           fs->groundid = 0;
+           fs->treeid   = 0;
+           return;
+       }
+
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                    fs->gtexture->width, fs->gtexture->height, 0,
+                    GL_RGBA, GL_UNSIGNED_BYTE, fs->gtexture->data);
+
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
+
+        if (fs->num_trees)
+       {
+           glGenTextures(1, &fs->treeid);
+#ifdef HAVE_GLBINDTEXTURE
+           glBindTexture(GL_TEXTURE_2D,fs->treeid);
+#endif /* HAVE_GLBINDTEXTURE */
+            if ((fs->ttexture = xpm_to_ximage(MI_DISPLAY(mi), MI_VISUAL(mi),
+                        MI_COLORMAP(mi), tree)) == None) {
+             (void)fprintf(stderr,"Error reading tree texture.\n");
+             glDeleteTextures(1, &fs->treeid);
+             fs->treeid    = 0;
+              fs->num_trees = 0; 
+             return;
+           }
+
+           glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                       fs->ttexture->width, fs->ttexture->height, 0,
+                       GL_RGBA, GL_UNSIGNED_BYTE, fs->ttexture->data);
+
+           glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+           glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+
+           glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
+           glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
+
+           glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
+       }
+    }
+    else
+    {
+       fs->groundid = 0;       /* default textures */
+       fs->treeid   = 0;
+    }
+}
+
+/* init tree array and positions */
+static Bool inittree(ModeInfo * mi)
+{
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+    int i;
+    float dist;
+
+    /* allocate treepos array */
+    if ((fs->treepos = (treestruct *) malloc(fs->num_trees *
+                                       sizeof(treestruct))) == NULL) {
+               return False;
+    }
+    /* initialise positions */
+    for(i=0;i<fs->num_trees;i++)
+       do {
+           fs->treepos[i].x =vrnd()*TREEOUTR*2.0-TREEOUTR;
+           fs->treepos[i].y =0.0;
+           fs->treepos[i].z =vrnd()*TREEOUTR*2.0-TREEOUTR;
+           dist=sqrt(fs->treepos[i].x *fs->treepos[i].x +fs->treepos[i].z *fs->treepos[i].z );
+        } while((dist<TREEINR) || (dist>TREEOUTR));
+       return True;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    GL funcs.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+static void Reshape(ModeInfo * mi)
+{
+
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+    int size = MI_SIZE(mi);
+
+    /* Viewport is specified size if size >= MINSIZE && size < screensize */
+    if (size <= 1) {
+        fs->WIDTH = MI_WIDTH(mi);
+        fs->HEIGHT = MI_HEIGHT(mi);
+    } else if (size < MINSIZE) {
+        fs->WIDTH = MINSIZE;
+        fs->HEIGHT = MINSIZE;
+    } else {
+        fs->WIDTH = (size > MI_WIDTH(mi)) ? MI_WIDTH(mi) : size;
+        fs->HEIGHT = (size > MI_HEIGHT(mi)) ? MI_HEIGHT(mi) : size;
+    }
+    glViewport((MI_WIDTH(mi) - fs->WIDTH) / 2, (MI_HEIGHT(mi) - fs->HEIGHT) / 2, fs->WIDTH, fs->HEIGHT);
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    gluPerspective(70.0, fs->WIDTH / (float) fs->HEIGHT, 0.1, 30.0);
+
+    glMatrixMode(GL_MODELVIEW);
+
+}
+
+static void DrawFire(ModeInfo * mi)
+{
+    int j;
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+    Bool wire = MI_IS_WIREFRAME(mi);
+
+    if (do_trackmouse && !MI_IS_ICONIC(mi))
+       trackmouse(mi);
+    glEnable(GL_DEPTH_TEST);
+
+    if (fs->fog)
+       glEnable(GL_FOG);
+    else
+       glDisable(GL_FOG);
+
+    glDepthMask(GL_TRUE);
+    glClearColor(0.5, 0.5, 0.8, 1.0);  /* sky in the distance */
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+    glPushMatrix();
+    calcposobs(fs);
+    gluLookAt(fs->obs[0], fs->obs[1], fs->obs[2],
+             fs->obs[0] + fs->dir[0], fs->obs[1] + fs->dir[1],
+             fs->obs[2] + fs->dir[2], 0.0, 1.0, 0.0);
+
+
+    glEnable(GL_TEXTURE_2D);
+
+    /* draw ground using the computed texture */
+    if (do_texture) {
+       glColor4f(1.0,1.0,1.0,1.0);     /* white to get texture in it's true color */
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, fs->groundid);
+#endif /* HAVE_GLBINDTEXTURE */
+    }
+    else
+        glColor4f(0.54, 0.27, 0.07, 1.0);      /* untextured ground color */
+    glBegin(GL_QUADS);
+    glTexCoord2fv(qt[0]);
+    glVertex3fv(q[0]);
+    glTexCoord2fv(qt[1]);
+    glVertex3fv(q[1]);
+    glTexCoord2fv(qt[2]);
+    glVertex3fv(q[2]);
+    glTexCoord2fv(qt[3]);
+    glVertex3fv(q[3]);
+    glEnd();
+
+    glAlphaFunc(GL_GEQUAL, 0.9);
+    if (fs->num_trees)
+    {
+       /* here do_texture IS True - and color used is white */
+       glEnable(GL_ALPHA_TEST);
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D,fs->treeid);
+#endif /* HAVE_GLBINDTEXTURE */
+       for(j=0;j<fs->num_trees;j++)
+           drawtree(fs->treepos[j].x ,fs->treepos[j].y ,fs->treepos[j].z );
+       glDisable(GL_ALPHA_TEST);
+    }
+    glDisable(GL_TEXTURE_2D);
+    glDepthMask(GL_FALSE);
+
+    if (fs->shadows) {
+       /* draw shadows with black color */
+       glBegin(wire ? GL_LINE_STRIP : GL_TRIANGLES);
+       for (j = 0; j < fs->np; j++) {
+           glColor4f(black[0], black[1], black[2], fs->p[j].c[0][3]);
+           glVertex3f(fs->p[j].p[0][0], 0.1, fs->p[j].p[0][2]);
+
+           glColor4f(black[0], black[1], black[2], fs->p[j].c[1][3]);
+           glVertex3f(fs->p[j].p[1][0], 0.1, fs->p[j].p[1][2]);
+
+           glColor4f(black[0], black[1], black[2], fs->p[j].c[2][3]);
+           glVertex3f(fs->p[j].p[2][0], 0.1, fs->p[j].p[2][2]);
+       }
+       glEnd();
+    }
+
+    glBegin(wire ? GL_LINE_STRIP : GL_TRIANGLES);
+    for (j = 0; j < fs->np; j++) {
+       /* draw particles: colors are computed in setpart */
+       glColor4fv(fs->p[j].c[0]);
+       glVertex3fv(fs->p[j].p[0]);
+
+       glColor4fv(fs->p[j].c[1]);
+       glVertex3fv(fs->p[j].p[1]);
+
+       glColor4fv(fs->p[j].c[2]);
+       glVertex3fv(fs->p[j].p[2]);
+
+       setpart(fs, &fs->p[j]);
+    }
+    glEnd();
+
+    /* draw rain particles if no fire particles */
+    if (!fs->np)
+    {
+        float timeused = gettimerain();
+        glDisable(GL_TEXTURE_2D);
+       glShadeModel(GL_SMOOTH);
+       glBegin(GL_LINES);
+       for (j = 0; j < NUMPART; j++) {
+           glColor4f(0.7f,0.95f,1.0f,0.0f);
+           glVertex3fv(fs->r[j].oldpos);
+           glColor4f(0.3f,0.7f,1.0f,1.0f);
+           glVertex3fv(fs->r[j].pos);
+           setpartrain(fs, &fs->r[j],timeused);
+       }
+       glEnd();
+       glShadeModel(GL_FLAT);
+    }
+
+    glDisable(GL_TEXTURE_2D);
+    glDisable(GL_ALPHA_TEST);
+    glDisable(GL_DEPTH_TEST);
+    glDisable(GL_FOG);
+
+    /* manage framerate display */
+    if (MI_IS_FPS(mi)) do_fps (mi);
+    glPopMatrix();
+}
+
+
+static Bool Init(ModeInfo * mi)
+{
+    int i;
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+
+    /* default settings */
+    fs->eject_r = 0.1 + NRAND(10) * 0.03;
+    fs->dt = 0.015;
+    fs->eject_vy = 4;
+    fs->eject_vl = 1;
+    fs->ridtri = 0.1 + NRAND(10) * 0.005;
+    fs->maxage = 1.0 / fs->dt;
+    fs->frcount = 0;
+    vinit(fs->obs, DEF_OBS[0], DEF_OBS[1], DEF_OBS[2]);
+    fs->v = 0.0;
+    fs->alpha = DEF_ALPHA;
+    fs->beta = DEF_BETA;
+
+    /* initialise texture stuff */
+    if (do_texture)
+       inittextures(mi);
+    else
+    {
+       fs->ttexture = (XImage*) NULL;
+       fs->gtexture = (XImage*) NULL;
+    }
+
+    if (MI_IS_DEBUG(mi)) {
+       (void) fprintf(stderr,
+                      "%s:\n\tnum_part=%d\n\ttrees=%d\n\tfog=%s\n\tshadows=%s\n\teject_r=%.3f\n\tridtri=%.3f\n",
+                      MI_NAME(mi),
+                      fs->np,
+                      fs->num_trees,
+                      fs->fog ? "on" : "off",
+                      fs->shadows ? "on" : "off",
+                      fs->eject_r, fs->ridtri);
+    }
+
+    glShadeModel(GL_FLAT);
+    glEnable(GL_DEPTH_TEST);
+
+    /* makes particles blend with background */
+    if (!MI_IS_WIREFRAME(mi)||(!fs->np))
+    {
+       glEnable(GL_BLEND);
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    }
+
+    /* fog stuff */
+    glEnable(GL_FOG);
+    glFogi(GL_FOG_MODE, GL_EXP);
+    glFogfv(GL_FOG_COLOR, fogcolor);
+    glFogf(GL_FOG_DENSITY, 0.03);
+    glHint(GL_FOG_HINT, GL_NICEST);
+
+    /* initialise particles and trees */
+    for (i = 0; i < fs->np; i++) {
+       setnewpart(fs, &(fs->p[i]));
+    }
+
+    if (fs->num_trees)
+       if (!inittree(mi)) {
+               return False;
+       }
+
+    /* if no fire particles then initialise rain particles */
+    if (!fs->np)
+    {
+       vinit(fs->min,-7.0f,-0.2f,-7.0f);
+       vinit(fs->max,7.0f,8.0f,7.0f);
+       for (i = 0; i < NUMPART; i++) {
+           setnewrain(fs, &(fs->r[i]));
+       }
+    }
+    
+    return True;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Xlock hooks.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+
+static void
+free_fire(firestruct *fs)
+{
+       if (mode_font != None && fs->fontbase != None) {
+               glDeleteLists(fs->fontbase, mode_font->max_char_or_byte2 -
+                       mode_font->min_char_or_byte2 + 1);
+               fs->fontbase = None;
+       }
+
+       if (fs->p != NULL) {
+               (void) free((void *) fs->p);
+               fs->p = (part *) NULL;
+       }
+       if (fs->r != NULL) {
+               (void) free((void *) fs->r);
+               fs->r = (rain *) NULL;
+       }
+       if (fs->treepos != NULL) {
+               (void) free((void *) fs->treepos);
+               fs->treepos = (treestruct *) NULL;
+       }
+       if (fs->ttexture != None) {
+               glDeleteTextures(1, &fs->treeid);
+               XDestroyImage(fs->ttexture);
+               fs->ttexture = None;
+       }
+       if (fs->gtexture != None) {
+               glDeleteTextures(1, &fs->groundid);
+               XDestroyImage(fs->gtexture);
+               fs->gtexture = None;
+       }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Initialize fire.  Called each time the window changes.
+ *-----------------------------------------------------------------------------
+ */
+
+void
+init_fire(ModeInfo * mi)
+{
+    firestruct *fs;
+
+    /* allocate the main fire table if needed */
+    if (fire == NULL) {
+       if ((fire = (firestruct *) calloc(MI_NUM_SCREENS(mi),
+                                         sizeof(firestruct))) == NULL)
+           return;
+    }
+
+    /* initialise the per screen fire structure */
+    fs = &fire[MI_SCREEN(mi)];
+    fs->np = MI_COUNT(mi);
+    fs->fog = do_fog;
+    fs->shadows = do_shadows;
+    /* initialise fire particles if any */
+    if ((fs->np)&&(fs->p == NULL)) {
+       if ((fs->p = (part *) calloc(fs->np, sizeof(part))) == NULL) {
+           free_fire(fs);
+           return;
+       }
+    }
+    else if (fs->r == NULL) {
+        /* initialise rain particles if no fire particles */
+       if ((fs->r = (rain *) calloc(NUMPART, sizeof(part))) == NULL) {
+           free_fire(fs);
+           return;
+       }
+    }
+
+    /* check tree number */
+    if (do_texture)
+       fs->num_trees = (num_trees<MAX_TREES)?num_trees:MAX_TREES;
+    else
+       fs->num_trees = 0;
+
+    /* xlock GL stuff */
+    if ((fs->glx_context = init_GL(mi)) != NULL) {
+
+       Reshape(mi);
+       glDrawBuffer(GL_BACK);
+       if (!Init(mi)) {
+               free_fire(fs);
+               return;
+       }
+    } else {
+       MI_CLEARWINDOW(mi);
+    }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Called by the mainline code periodically to update the display.
+ *-----------------------------------------------------------------------------
+ */
+void draw_fire(ModeInfo * mi)
+{
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+
+    Display *display = MI_DISPLAY(mi);
+    Window window = MI_WINDOW(mi);
+
+    MI_IS_DRAWN(mi) = True;
+
+    if (!fs->glx_context)
+       return;
+
+    glXMakeCurrent(display, window, *(fs->glx_context));
+    DrawFire(mi);
+    Reshape(mi);
+
+    glFinish();
+    glXSwapBuffers(display, window);
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *    The display is being taken away from us.  Free up malloc'ed
+ *      memory and X resources that we've alloc'ed.  Only called
+ *      once, we must zap everything for every screen.
+ *-----------------------------------------------------------------------------
+ */
+
+void release_fire(ModeInfo * mi)
+{
+    if (fire != NULL) {
+    int screen;
+       for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+               free_fire(&fire[screen]);
+       (void) free((void *) fire);
+       fire = (firestruct *) NULL;
+    }
+    if (mode_font != None)
+    {
+       /* only free-ed when there are no more screens used */
+       XFreeFont(MI_DISPLAY(mi), mode_font);
+       mode_font = None;
+    }
+    FreeAllGL(mi);
+}
+
+void change_fire(ModeInfo * mi)
+{
+    firestruct *fs = &fire[MI_SCREEN(mi)];
+
+    if (!fs->glx_context)
+       return;
+
+    glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(fs->glx_context));
+
+    /* if available, randomly change some values */
+    if (do_fog)
+       fs->fog = LRAND() & 1;
+    if (do_shadows)
+       fs->shadows = LRAND() & 1;
+    /* reset observer position */
+    vinit(fs->obs, DEF_OBS[0], DEF_OBS[1], DEF_OBS[2]);
+    fs->v = 0.0;
+    /* particle randomisation */
+    fs->eject_r = 0.1 + NRAND(10) * 0.03;
+    fs->ridtri = 0.1 + NRAND(10) * 0.005;
+
+    if (MI_IS_DEBUG(mi)) {
+       (void) fprintf(stderr,
+                      "%s:\n\tnum_part=%d\n\ttrees=%d\n\tfog=%s\n\tshadows=%s\n\teject_r=%.3f\n\tridtri=%.3f\n",
+                      MI_NAME(mi),
+                      fs->np,
+                      fs->num_trees,
+                      fs->fog ? "on" : "off",
+                      fs->shadows ? "on" : "off",
+                      fs->eject_r, fs->ridtri);
+    }
+}
+#endif /* MODE_fire */
diff --git a/modes/glx/gears.c b/modes/glx/gears.c
new file mode 100644 (file)
index 0000000..386950f
--- /dev/null
@@ -0,0 +1,1188 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* gears --- 3D gear wheels */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)gears.c      5.01 2001/02/22 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 22-Feb-2001: backported from xscreensaver by lassauge@mail.dotcom.fr
+ * 09-Feb-2001: "Planetary" gear system added by jwz@jwz.org.
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 22-Mar-1997: Added support for -mono mode, and monochrome X servers.
+ *              Ed Mackey, emackey@netaxs.com
+ * 13-Mar-1997: Memory leak fix by Tom Schmidt <tschmidt@micron.com>
+ * 1996: "written" by Danny Sung <dannys@ucla.edu>
+ *       Based on 3-D gear wheels by Brian Paul which is in the public domain.
+ */
+
+/*-
+ * PURIFY 3.0a on SunOS4 reports an unitialized memory read on each of
+ * the glCallList() functions below when using MesaGL 2.1.  This has
+ * been fixed in MesaGL 2.2 and later releases.
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+# define PROGCLASS                                     "Gears"
+# define HACK_INIT                                     init_gears
+# define HACK_DRAW                                     draw_gears
+# define HACK_RESHAPE                                  reshape_gears
+# define gears_opts                                    xlockmore_opts
+# define DEFAULTS                      "*count:                1       \n"     \
+                                       "*cycles:               2       \n"     \
+                                       "*delay:                20000   \n"     \
+                                       "*size:                 0       \n"     \
+                                       "*planetary:            False   \n"     \
+                                       "*showFps:              False   \n"     \
+                                       "*wireframe:            False   \n"
+# include "xlockmore.h"                                /* from the xscreensaver distribution */
+#else  /* !STANDALONE */
+# include "xlock.h"                            /* from the xlockmore distribution */
+# include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_gears
+
+#define MINSIZE         32      /* minimal viewport size */
+
+#undef countof
+#define countof(x) (sizeof((x))/sizeof((*x)))
+
+#define DEF_PLANETARY "False"
+#define DEF_PLANETSIZE "400"
+
+static Bool planetary;
+static int planetsize;
+
+static XrmOptionDescRec opts[] = {
+  {(char *) "-planetary", (char *) ".gears.planetary", XrmoptionNoArg, (caddr_t) "true" },
+  {(char *) "+planetary", (char *) ".gears.planetary", XrmoptionNoArg, (caddr_t) "false" },
+ {(char *) "-planetsize", (char *) ".gears.planetsize", XrmoptionSepArg, (caddr_t) NULL}
+};
+
+static argtype vars[] = {
+  {(caddr_t *) &planetary, (char *) "planetary", (char *) "Planetary", DEF_PLANETARY, t_Bool},
+  {(caddr_t *) & planetsize, (char *) "planetsize", (char *) "PlanetSize", (char *) DEF_PLANETSIZE, t_Int}
+};
+
+static OptionStruct desc[] = {
+  {(char *) "-/+planetary", (char *) "turn on/off \"Planetary\" gear system"},
+  {(char *) "-planetsize num", (char *) "size of screen for \"Planetary\" gear system"}
+};
+
+ModeSpecOpt gears_opts = {countof(opts), opts, countof(vars), vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   gears_description =
+{"gears", "init_gears", "draw_gears", "release_gears",
+ "draw_gears", "init_gears", NULL, &gears_opts,
+ 1000, 1, 2, 0, 64, 1.0, "",
+ "Shows GL's gears", 0, NULL};
+
+#endif
+
+typedef struct {
+
+  GLfloat rotx, roty, rotz;       /* current object rotation */
+  GLfloat dx, dy, dz;             /* current rotational velocity */
+  GLfloat ddx, ddy, ddz;          /* current rotational acceleration */
+  GLfloat d_max;                          /* max velocity */
+
+  GLuint      gear1, gear2, gear3;
+  GLuint      gear_inner, gear_outer;
+  GLuint      armature;
+  GLfloat     angle;
+  GLXContext *glx_context;
+  Window      window;
+  Bool        planetary;
+  int         planetsize;
+} gearsstruct;
+
+static gearsstruct *gears = (gearsstruct *) NULL;
+
+/*-
+ * Draw a gear wheel.  You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * Input:  inner_radius - radius of hole at center
+ *         outer_radius - radius at center of teeth
+ *         width - width of gear
+ *         teeth - number of teeth
+ *         tooth_depth - depth of tooth
+ *         wire - true for wireframe mode
+ */
+static void
+gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
+     GLint teeth, GLfloat tooth_depth, Bool wire, Bool invert)
+{
+       GLint       i;
+       GLfloat     r0, r1, r2;
+       GLfloat     angle, da;
+       GLfloat     u, v, len;
+
+    if (!invert)
+      {
+        r0 = inner_radius;
+        r1 = outer_radius - tooth_depth / 2.0;
+        r2 = outer_radius + tooth_depth / 2.0;
+        glFrontFace(GL_CCW);
+      }
+    else
+      {
+        r0 = outer_radius;
+        r2 = inner_radius + tooth_depth / 2.0;
+        r1 = outer_radius - tooth_depth / 2.0;
+        glFrontFace(GL_CW);
+      }
+
+       da = 2.0 * M_PI / teeth / 4.0;
+
+       glShadeModel(GL_FLAT);
+
+       /* This subroutine got kind of messy when I added all the checks
+        * for wireframe mode.  A much cleaner solution that I sometimes
+        * use is to have a variable hold the value GL_LINE_LOOP when
+        * in wireframe mode, or hold the value GL_POLYGON otherwise.
+        * Then I just call glBegin(that_variable), give my polygon
+        * coordinates, and glEnd().  Pretty neat eh?  Too bad I couldn't
+        * integrate that trick here.
+        *                                  --Ed.
+        */
+
+       if (!wire)
+               glNormal3f(0.0, 0.0, 1.0);
+
+       /* draw front face */
+       if (!wire)
+               glBegin(GL_QUAD_STRIP);
+       for (i = 0; i <= teeth; i++) {
+               if (wire)
+                       glBegin(GL_LINES);
+               angle = i * 2.0 * M_PI / teeth;
+               glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+               glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+               if (!wire) {
+                       glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+                       glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
+               } else {
+                       glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
+                       glVertex3f(r1 * cos(angle + 4 * da), r1 * sin(angle + 4 * da), width * 0.5);
+                       glEnd();
+               }
+       }
+       if (!wire)
+               glEnd();
+
+       /* draw front sides of teeth */
+       if (!wire)
+               glBegin(GL_QUADS);
+       da = 2.0 * M_PI / teeth / 4.0;
+       for (i = 0; i < teeth; i++) {
+               angle = i * 2.0 * M_PI / teeth;
+
+               if (wire)
+                       glBegin(GL_LINE_LOOP);
+               glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+               glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
+               glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
+               glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
+               if (wire)
+                       glEnd();
+       }
+       if (!wire)
+               glEnd();
+
+
+       if (!wire)
+               glNormal3f(0.0, 0.0, -1.0);
+
+       /* draw back face */
+       if (!wire)
+               glBegin(GL_QUAD_STRIP);
+       for (i = 0; i <= teeth; i++) {
+               angle = i * 2.0 * M_PI / teeth;
+               if (wire)
+                       glBegin(GL_LINES);
+               glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+               glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+               if (!wire) {
+                       glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
+                       glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+               } else {
+                       glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
+                       glVertex3f(r1 * cos(angle + 4 * da), r1 * sin(angle + 4 * da), -width * 0.5);
+                       glEnd();
+               }
+       }
+       if (!wire)
+               glEnd();
+
+       /* draw back sides of teeth */
+       if (!wire)
+               glBegin(GL_QUADS);
+       da = 2.0 * M_PI / teeth / 4.0;
+       for (i = 0; i < teeth; i++) {
+               angle = i * 2.0 * M_PI / teeth;
+
+               if (wire)
+                       glBegin(GL_LINE_LOOP);
+               glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
+               glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
+               glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
+               glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+               if (wire)
+                       glEnd();
+       }
+       if (!wire)
+               glEnd();
+
+
+       /* draw outward faces of teeth */
+       if (!wire)
+               glBegin(GL_QUAD_STRIP);
+       for (i = 0; i <= teeth; i++) {
+               angle = i * 2.0 * M_PI / teeth;
+
+        if(!invert) {
+          u = r2 * cos(angle + da) - r1 * cos(angle);
+          v = r2 * sin(angle + da) - r1 * sin(angle);
+        } else {
+          u = r2 * cos(angle + da + M_PI/2) - r1 * cos(angle + M_PI/2);
+          v = r2 * sin(angle + da + M_PI/2) - r1 * sin(angle + M_PI/2);
+        }
+
+               len = sqrt(u * u + v * v);
+               u /= len;
+               v /= len;
+               glNormal3f(v, -u, 0.0);
+
+               if (wire)
+                       glBegin(GL_LINES);
+               glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+               glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+
+               glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
+               glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
+
+        if(!invert)
+          glNormal3f(cos(angle), sin(angle), 0.0);
+        else
+          glNormal3f(cos(angle + M_PI/2), sin(angle + M_PI/2), 0.0);
+
+               glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
+               glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
+
+        if(!invert) {
+          u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
+          v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
+        } else {
+          u = r1 * cos(angle + 3 * da + M_PI/2) - r2 * cos(angle + 2 * da + M_PI/2);
+          v = r1 * sin(angle + 3 * da + M_PI/2) - r2 * sin(angle + 2 * da + M_PI/2);
+        }
+
+               glNormal3f(v, -u, 0.0);
+
+               glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
+               glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
+
+        if (!invert)
+          glNormal3f(cos(angle), sin(angle), 0.0);
+        else
+          glNormal3f(cos(angle + M_PI/2), sin(angle + M_PI/2), 0.0);
+
+               if (wire)
+                       glEnd();
+       }
+
+       if (!wire) {
+               glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
+               glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
+               glEnd();
+       }
+       if (!wire)
+               glShadeModel(GL_SMOOTH);
+
+       /* draw inside radius cylinder */
+       if (!wire)
+               glBegin(GL_QUAD_STRIP);
+       for (i = 0; i <= teeth; i++) {
+               angle = i * 2.0 * M_PI / teeth;
+               if (wire)
+                       glBegin(GL_LINES);
+
+        if (!invert)
+          glNormal3f(-cos(angle), -sin(angle), 0.0);
+        else
+          glNormal3f(cos(angle), sin(angle), 0.0);
+
+               glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+               glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+               if (wire) {
+                       glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+                       glVertex3f(r0 * cos(angle + 4 * da), r0 * sin(angle + 4 * da), -width * 0.5);
+                       glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+                       glVertex3f(r0 * cos(angle + 4 * da), r0 * sin(angle + 4 * da), width * 0.5);
+                       glEnd();
+               }
+       }
+       if (!wire)
+               glEnd();
+
+}
+
+
+
+static void
+tube(GLfloat radius, GLfloat width, GLint facets, Bool wire)
+{
+  GLint i;
+  GLfloat da = 2.0 * M_PI / facets / 4.0;
+
+  glFrontFace(GL_CCW);
+
+  /* draw bottom of tube */
+
+  glShadeModel(GL_FLAT);
+  glNormal3f(0, 0, 1);
+  if (!wire)
+    {
+      glBegin(GL_TRIANGLE_FAN);
+      glVertex3f(0, 0, width * 0.5);
+      for (i = 0; i <= facets; i++) {
+        GLfloat angle = i * 2.0 * M_PI / facets;
+        glVertex3f(radius * cos(angle), radius * sin(angle), width * 0.5);
+      }
+      glEnd();
+    }
+
+  /* draw top of tube */
+
+  glShadeModel(GL_FLAT);
+  glNormal3f(0, 0, -1);
+  glFrontFace(GL_CW);
+  if (!wire)
+    {
+      glBegin(GL_TRIANGLE_FAN);
+      glVertex3f(0, 0, -width * 0.5);
+      for (i = 0; i <= facets; i++) {
+        GLfloat angle = i * 2.0 * M_PI / facets;
+        glVertex3f(radius * cos(angle), radius * sin(angle), -width * 0.5);
+      }
+      glEnd();
+    }
+
+  /* draw side of tube */
+  glFrontFace(GL_CW);
+  glShadeModel(GL_SMOOTH);
+
+  if (!wire)
+    glBegin(GL_QUAD_STRIP);
+
+  for (i = 0; i <= facets; i++) {
+    GLfloat angle = i * 2.0 * M_PI / facets;
+    
+    if (wire)
+      glBegin(GL_LINES);
+
+    glNormal3f(cos(angle), sin(angle), 0.0);
+
+    glVertex3f(radius * cos(angle), radius * sin(angle), -width * 0.5);
+    glVertex3f(radius * cos(angle), radius * sin(angle), width * 0.5);
+
+    if (wire) {
+      glVertex3f(radius * cos(angle), radius * sin(angle), -width * 0.5);
+      glVertex3f(radius * cos(angle + 4 * da), radius * sin(angle + 4 * da), -width * 0.5);
+      glVertex3f(radius * cos(angle), radius * sin(angle), width * 0.5);
+      glVertex3f(radius * cos(angle + 4 * da), radius * sin(angle + 4 * da), width * 0.5);
+      glEnd();
+    }
+  }
+
+  if (!wire)
+    glEnd();
+
+  glFrontFace(GL_CCW);
+}
+
+
+static void
+arm(GLfloat length,
+    GLfloat width1, GLfloat height1,
+    GLfloat width2, GLfloat height2,
+    Bool wire)
+{
+  glShadeModel(GL_FLAT);
+
+#if 0  /* don't need these - they're embedded in other objects */
+  /* draw end 1 */
+  glFrontFace(GL_CW);
+  glNormal3f(-1, 0, 0);
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glVertex3f(-length/2, -width1/2, -height1/2);
+  glVertex3f(-length/2,  width1/2, -height1/2);
+  glVertex3f(-length/2,  width1/2,  height1/2);
+  glVertex3f(-length/2, -width1/2,  height1/2);
+  glEnd();
+
+  /* draw end 2 */
+  glFrontFace(GL_CCW);
+  glNormal3f(1, 0, 0);
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glVertex3f(length/2, -width2/2, -height2/2);
+  glVertex3f(length/2,  width2/2, -height2/2);
+  glVertex3f(length/2,  width2/2,  height2/2);
+  glVertex3f(length/2, -width2/2,  height2/2);
+  glEnd();
+#endif
+
+  /* draw top */
+  glFrontFace(GL_CCW);
+  glNormal3f(0, 0, -1);
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glVertex3f(-length/2, -width1/2, -height1/2);
+  glVertex3f(-length/2,  width1/2, -height1/2);
+  glVertex3f( length/2,  width2/2, -height2/2);
+  glVertex3f( length/2, -width2/2, -height2/2);
+  glEnd();
+
+  /* draw bottom */
+  glFrontFace(GL_CW);
+  glNormal3f(0, 0, 1);
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glVertex3f(-length/2, -width1/2, height1/2);
+  glVertex3f(-length/2,  width1/2, height1/2);
+  glVertex3f( length/2,  width2/2, height2/2);
+  glVertex3f( length/2, -width2/2, height2/2);
+  glEnd();
+
+  /* draw left */
+  glFrontFace(GL_CW);
+  glNormal3f(0, -1, 0);
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glVertex3f(-length/2, -width1/2, -height1/2);
+  glVertex3f(-length/2, -width1/2,  height1/2);
+  glVertex3f( length/2, -width2/2,  height2/2);
+  glVertex3f( length/2, -width2/2, -height2/2);
+  glEnd();
+
+  /* draw right */
+  glFrontFace(GL_CCW);
+  glNormal3f(0, 1, 0);
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glVertex3f(-length/2,  width1/2, -height1/2);
+  glVertex3f(-length/2,  width1/2,  height1/2);
+  glVertex3f( length/2,  width2/2,  height2/2);
+  glVertex3f( length/2,  width2/2, -height2/2);
+  glEnd();
+
+  glFrontFace(GL_CCW);
+}
+
+
+static void
+draw(ModeInfo * mi)
+{
+       gearsstruct *gp = &gears[MI_SCREEN(mi)];
+       int         wire = MI_IS_WIREFRAME(mi);
+
+       if (!wire) {
+               glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+       } else {
+               glClear(GL_COLOR_BUFFER_BIT);
+       }
+
+       glPushMatrix();
+
+    {
+      GLfloat x = gp->rotx;
+      GLfloat y = gp->roty;
+      GLfloat z = gp->rotz;
+      if (x < 0) x = 1 - (x + 1);
+      if (y < 0) y = 1 - (y + 1);
+      if (z < 0) z = 1 - (z + 1);
+      glRotatef(x * 360, 1.0, 0.0, 0.0);
+      glRotatef(y * 360, 0.0, 1.0, 0.0);
+      glRotatef(z * 360, 0.0, 0.0, 1.0);
+    }
+
+    if (!gp->planetary) {
+      glPushMatrix();
+      glTranslatef(-3.0, -2.0, 0.0);
+      glRotatef(gp->angle, 0.0, 0.0, 1.0);
+/* PURIFY 4.0.1 reports an unitialized memory read on the next line when using
+   * MesaGL 2.2 and -mono.  This has been fixed in MesaGL 2.3 and later. */
+      glCallList(gp->gear1);
+      glPopMatrix();
+
+      glPushMatrix();
+      glTranslatef(3.1, -2.0, 0.0);
+      glRotatef(-2.0 * gp->angle - 9.0, 0.0, 0.0, 1.0);
+      glCallList(gp->gear2);
+      glPopMatrix();
+
+      glPushMatrix();
+      glTranslatef(-3.1, 4.2, 0.0);
+      glRotatef(-2.0 * gp->angle - 25.0, 0.0, 0.0, 1.0);
+      glCallList(gp->gear3);
+      glPopMatrix();
+
+    } else { /* planetary */
+
+      glScalef(0.8, 0.8, 0.8);
+
+      glPushMatrix();
+      glTranslatef(0.0, 4.2, 0.0);
+      glRotatef(gp->angle - 7.0, 0.0, 0.0, 1.0);
+      glCallList(gp->gear1);
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(120, 0.0, 0.0, 1.0);
+      glTranslatef(0.0, 4.2, 0.0);
+      glRotatef(gp->angle - 7.0, 0.0, 0.0, 1.0);
+      glCallList(gp->gear2);
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(240, 0.0, 0.0, 1.0);
+      glTranslatef(0.0, 4.2, 0.0);
+      glRotatef(gp->angle - 7.0, 0.0, 0.0, 1.0);
+      glCallList(gp->gear3);
+      glPopMatrix();
+
+      glPushMatrix();
+      glTranslatef(0.0, 0.0, 0.0);
+      glRotatef(-gp->angle, 0.0, 0.0, 1.0);
+      glCallList(gp->gear_inner);
+      glPopMatrix();
+
+      glPushMatrix();
+      glTranslatef(0.0, 0.0, 0.0);
+      glRotatef((gp->angle / 3.0) - 7.5, 0.0, 0.0, 1.0);
+      glCallList(gp->gear_outer);
+      glPopMatrix();
+
+      glPushMatrix();
+      glTranslatef(0.0, 0.0, 0.0);
+      glCallList(gp->armature);
+      glPopMatrix();
+    }
+
+       glPopMatrix();
+}
+
+
+
+/* new window size or exposure */
+static void
+reshape_gears(ModeInfo *mi, int width, int height)
+{
+       gearsstruct *gp = &gears[MI_SCREEN(mi)];
+       int size = MI_SIZE(mi), w, h;
+       GLfloat     r = (GLfloat) height / (GLfloat) width;
+
+        if (gp->planetary && !size)
+               size = planetsize;
+
+       /* Viewport is specified size if size >= MINSIZE && size < screensize */
+       if (size <= 1) {
+               w = MI_WIDTH(mi);
+               h = MI_HEIGHT(mi);
+       } else if (size < MINSIZE) {
+               w = MINSIZE;
+               h = MINSIZE;
+       } else {
+               w = (size > MI_WIDTH(mi)) ? MI_WIDTH(mi) : size;
+               h = (size > MI_HEIGHT(mi)) ? MI_HEIGHT(mi) : size;
+       }
+
+       glViewport((MI_WIDTH(mi) - w) / 2, (MI_HEIGHT(mi) - h) / 2, w, h);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -r, r, 5.0, 60.0);
+       glMatrixMode(GL_MODELVIEW);
+       glLoadIdentity();
+       glTranslatef(0.0, 0.0, -40.0);
+
+       /* The depth buffer will be cleared, if needed, before the
+        * next frame.  Right now we just want to black the screen.
+        */
+       glClear(GL_COLOR_BUFFER_BIT);
+
+}
+
+static void
+free_gears(Display *display, gearsstruct *gp)
+{
+       if (gp->glx_context) {
+               /* Display lists MUST be freed while their glXContext is current. */
+               glXMakeCurrent(display, gp->window, *(gp->glx_context));
+               if (glIsList(gp->gear1)) {
+                       glDeleteLists(gp->gear1, 1);
+                       gp->gear1 = 0;
+               }
+               if (glIsList(gp->gear2)) {
+                       glDeleteLists(gp->gear2, 1);
+                       gp->gear2 = 0;
+               }
+               if (glIsList(gp->gear3)) {
+                       glDeleteLists(gp->gear3, 1);
+                       gp->gear3 = 0;
+               }
+               if (glIsList(gp->gear_inner)) {
+                       glDeleteLists(gp->gear_inner, 1);
+                       gp->gear_inner = 0;
+               }
+               if (glIsList(gp->gear_outer)) {
+                       glDeleteLists(gp->gear_outer, 1);
+                       gp->gear_outer = 0;
+               }
+               if (glIsList(gp->armature)) {
+                       glDeleteLists(gp->armature, 1);
+                       gp->armature = 0;
+               }
+               gp->glx_context = (GLXContext *) NULL;
+       }
+}
+
+static Bool
+pinit(ModeInfo * mi)
+{
+       gearsstruct *gp = &gears[MI_SCREEN(mi)];
+       static GLfloat pos[4] =
+       {5.0, 5.0, 10.0, 1.0};
+       static GLfloat red[4] =
+       {0.8, 0.1, 0.0, 1.0};
+       static GLfloat green[4] =
+       {0.0, 0.8, 0.2, 1.0};
+       static GLfloat blue[4] =
+       {0.2, 0.2, 1.0, 1.0};
+       static GLfloat gray[4] =
+       {0.5, 0.5, 0.5, 1.0};
+       static GLfloat white[4] =
+       {1.0, 1.0, 1.0, 1.0};
+       int         wire = MI_IS_WIREFRAME(mi);
+       int         mono = MI_IS_MONO(mi);
+
+       if (!wire) {
+               glLightfv(GL_LIGHT0, GL_POSITION, pos);
+               glEnable(GL_CULL_FACE);
+               glEnable(GL_LIGHTING);
+               glEnable(GL_LIGHT0);
+               glEnable(GL_DEPTH_TEST);
+       }
+#if 0
+/*-
+ * Messes up on multiscreen Pseudocolor:0 StaticGray(monochrome):1
+ * 2nd time mode is run it is Grayscale on PseudoColor.
+ * The code below forces monochrome on TrueColor.
+ */
+       if (MI_IS_MONO(mi)) {
+               red[0] = red[1] = red[2] = 1.0;
+               green[0] = green[1] = green[2] = 1.0;
+               blue[0] = blue[1] = blue[2] = 1.0;
+       }
+#endif
+
+       /* make the gears */
+
+    if (! gp->planetary) {
+
+      if ((gp->gear1 = glGenLists(1)) == 0) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      glNewList(gp->gear1, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(red);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+      }
+
+      gear(1.0, 4.0, 1.0, 20, 0.7, wire, False);
+      glEndList();
+
+      if ((gp->gear2 = glGenLists(1)) == 0) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      glNewList(gp->gear2, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(green);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+      }
+      gear(0.5, 2.0, 2.0, 10, 0.7, wire, False);
+      glEndList();
+
+      if ((gp->gear3 = glGenLists(1)) == 0) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      glNewList(gp->gear3, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(blue);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
+      }
+      gear(1.3, 2.0, 0.5, 10, 0.7, wire, False);
+      glEndList();
+      if (!wire)
+               glEnable(GL_NORMALIZE);
+
+    } else { /* planetary */
+
+      if ((gp->gear1 = glGenLists(1)) == 0) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      glNewList(gp->gear1, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(red);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+      }
+      gear(1.3, 2.0, 2.0, 12, 0.7, wire, False);
+      glEndList();
+
+      if ((gp->gear2 = glGenLists(1)) == 0) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      glNewList(gp->gear2, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+          free_gears(MI_DISPLAY(mi), gp);
+          return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(green);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+      }
+      gear(1.3, 2.0, 2.0, 12, 0.7, wire, False);
+      glEndList();
+
+      if ((gp->gear3 = glGenLists(1)) == 0) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      glNewList(gp->gear3, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(blue);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+      }
+      gear(1.3, 2.0, 2.0, 12, 0.7, wire, False);
+      glEndList();
+      if (!wire)
+               glEnable(GL_NORMALIZE);
+
+
+      if ((gp->gear_inner = glGenLists(1)) == 0) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      glNewList(gp->gear_inner, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(blue);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
+      }
+      gear(1.0, 2.0, 2.0, 12, 0.7, wire, False);
+      glEndList();
+      if (!wire)
+               glEnable(GL_NORMALIZE);
+
+
+      if ((gp->gear_outer = glGenLists(1)) == 0) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      glNewList(gp->gear_outer, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      if (wire) {
+               if (mono)
+          glColor4fv(white);
+               else
+          glColor4fv(blue);
+      } else {
+               if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+               else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+      }
+      gear(5.7, 7.0, 2.0, 36, 0.7, wire, True);
+
+      /* put some nubs on the outer ring, so we can tell how it's moving */
+      glPushMatrix();
+      glTranslatef(7.0, 0, 0);
+      glRotatef(90, 0, 1, 0);
+      tube(0.5, 0.5, 10, wire);   /* nub 1 */
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(120, 0, 0, 1);
+      glTranslatef(7.0, 0, 0);
+      glRotatef(90, 0, 1, 0);
+      tube(0.5, 0.5, 10, wire);   /* nub 2 */
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(240, 0, 0, 1);
+      glTranslatef(7.0, 0, 0);
+      glRotatef(90, 0, 1, 0);
+      tube(0.5, 0.5, 10, wire);   /* nub 3 */
+      glPopMatrix();
+
+
+      glEndList();
+      if (!wire)
+               glEnable(GL_NORMALIZE);
+
+      if ((gp->armature = glGenLists(1)) == 0) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      glNewList(gp->armature, GL_COMPILE);
+      if (glGetError() != GL_NO_ERROR) {
+           free_gears(MI_DISPLAY(mi), gp);
+           return False;
+      }
+      if (wire) {
+        if (mono)
+          glColor4fv(white);
+        else
+          glColor4fv(blue);
+      } else {
+        if (mono)
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+        else
+          glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray);
+      }
+
+      glTranslatef(0, 0, 1.5);
+
+      tube(0.5, 10, 15, wire);       /* center axle */
+
+      glPushMatrix();
+      glTranslatef(0.0, 4.2, -1);
+      tube(0.5, 3, 15, wire);       /* axle 1 */
+      glTranslatef(0, 0, 1.8);
+      tube(0.7, 0.7, 15, wire);
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(120, 0.0, 0.0, 1.0);
+      glTranslatef(0.0, 4.2, -1);
+      tube(0.5, 3, 15, wire);       /* axle 2 */
+      glTranslatef(0, 0, 1.8);
+      tube(0.7, 0.7, 15, wire);
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(240, 0.0, 0.0, 1.0);
+      glTranslatef(0.0, 4.2, -1);
+      tube(0.5, 3, 15, wire);       /* axle 3 */
+      glTranslatef(0, 0, 1.8);
+      tube(0.7, 0.7, 15, wire);
+      glPopMatrix();
+
+      glTranslatef(0, 0, 1.5);      /* center disk */
+      tube(1.5, 2, 20, wire);
+
+      glPushMatrix();
+      glRotatef(270, 0, 0, 1);
+      glRotatef(-10, 0, 1, 0);
+      glTranslatef(-2.2, 0, 0);
+      arm(4.0, 1.0, 0.5, 2.0, 1.0, wire);              /* arm 1 */
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(30, 0, 0, 1);
+      glRotatef(-10, 0, 1, 0);
+      glTranslatef(-2.2, 0, 0);
+      arm(4.0, 1.0, 0.5, 2.0, 1.0, wire);              /* arm 2 */
+      glPopMatrix();
+
+      glPushMatrix();
+      glRotatef(150, 0, 0, 1);
+      glRotatef(-10, 0, 1, 0);
+      glTranslatef(-2.2, 0, 0);
+      arm(4.0, 1.0, 0.5, 2.0, 1.0, wire);              /* arm 3 */
+      glPopMatrix();
+
+      glEndList();
+      if (!wire)
+        glEnable(GL_NORMALIZE);
+    }
+    return True;
+}
+
+
+/* lifted from lament.c */
+#define RANDSIGN() ((LRAND() & 1) ? 1 : -1)
+#define FLOATRAND(a) (((double)LRAND() / (double)MAXRAND) * a)
+
+static void
+rotate(GLfloat *pos, GLfloat *v, GLfloat *dv, GLfloat max_v)
+{
+  double ppos = *pos;
+
+  /* tick position */
+  if (ppos < 0)
+    ppos = -(ppos + *v);
+  else
+    ppos += *v;
+
+  if (ppos > 1.0)
+    ppos -= 1.0;
+  else if (ppos < 0)
+    ppos += 1.0;
+
+  if (ppos < 0) abort();
+  if (ppos > 1.0) abort();
+  *pos = (*pos > 0 ? ppos : -ppos);
+
+  /* accelerate */
+  *v += *dv;
+
+  /* clamp velocity */
+  if (*v > max_v || *v < -max_v)
+    {
+      *dv = -*dv;
+    }
+  /* If it stops, start it going in the other direction. */
+  else if (*v < 0)
+    {
+      if (random() % 4)
+       {
+         *v = 0;
+
+         /* keep going in the same direction */
+         if (random() % 2)
+           *dv = 0;
+         else if (*dv < 0)
+           *dv = -*dv;
+       }
+      else
+       {
+         /* reverse gears */
+         *v = -*v;
+         *dv = -*dv;
+         *pos = -*pos;
+       }
+    }
+
+  /* Alter direction of rotational acceleration randomly. */
+  if (! (random() % 120))
+    *dv = -*dv;
+
+  /* Change acceleration very occasionally. */
+  if (! (random() % 200))
+    {
+      if (*dv == 0)
+       *dv = 0.00001;
+      else if (random() & 1)
+       *dv *= 1.2;
+      else
+       *dv *= 0.8;
+    }
+}
+
+
+void
+init_gears(ModeInfo * mi)
+{
+       /*Colormap    cmap; */
+       /* Boolean     rgba, doublebuffer, cmap_installed; */
+       gearsstruct *gp;
+
+       if (gears == NULL) {
+               if ((gears = (gearsstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (gearsstruct))) == NULL)
+                       return;
+       }
+       gp = &gears[MI_SCREEN(mi)];
+
+       gp->window = MI_WINDOW(mi);
+
+    if (MI_IS_FULLRANDOM(mi)) {
+      gp->planetary = (Bool) (LRAND() & 1);
+    } else {
+      gp->planetary = planetary;
+    }
+
+    gp->rotx = FLOATRAND(1.0) * RANDSIGN();
+    gp->roty = FLOATRAND(1.0) * RANDSIGN();
+    gp->rotz = FLOATRAND(1.0) * RANDSIGN();
+
+    /* bell curve from 0-1.5 degrees, avg 0.75 */
+    gp->dx = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+    gp->dy = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+    gp->dz = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+
+    gp->d_max = gp->dx * 2;
+
+    gp->ddx = 0.00006 + FLOATRAND(0.00003);
+    gp->ddy = 0.00006 + FLOATRAND(0.00003);
+    gp->ddz = 0.00006 + FLOATRAND(0.00003);
+
+    gp->ddx = 0.00001;
+    gp->ddy = 0.00001;
+    gp->ddz = 0.00001;
+
+       if ((gp->glx_context = init_GL(mi)) != NULL) {
+               reshape_gears(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               if (!pinit(mi)) {
+                       MI_CLEARWINDOW(mi);
+               }
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_gears(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         angle_incr = MI_CYCLES(mi) ? MI_CYCLES(mi) : 2;
+       gearsstruct *gp;
+
+    if (gears == NULL)
+       return;
+    gp = &gears[MI_SCREEN(mi)];
+
+    MI_IS_DRAWN(mi) = True;
+    if (gp->planetary)
+      angle_incr *= 3;
+
+       if (!gp->glx_context)
+               return;
+
+       glDrawBuffer(GL_BACK);
+
+       glXMakeCurrent(display, window, *(gp->glx_context));
+       draw(mi);
+
+       /* let's do something so we don't get bored */
+       gp->angle = (int) (gp->angle + angle_incr) % 360;
+
+    rotate(&gp->rotx, &gp->dx, &gp->ddx, gp->d_max);
+    rotate(&gp->roty, &gp->dy, &gp->ddy, gp->d_max);
+    rotate(&gp->rotz, &gp->dz, &gp->ddz, gp->d_max);
+
+    if (MI_IS_FPS(mi)) do_fps (mi);
+       glFinish();
+       glXSwapBuffers(display, window);
+}
+
+void
+release_gears(ModeInfo * mi)
+{
+       if (gears != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_gears(MI_DISPLAY(mi), &gears[screen]);
+               (void) free((void *) gears);
+               gears = (gearsstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+
+/*********************************************************/
+
+#endif
diff --git a/modes/glx/glplanet.c b/modes/glx/glplanet.c
new file mode 100644 (file)
index 0000000..ec04257
--- /dev/null
@@ -0,0 +1,776 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* glplanet --- 3D rotating planet, e.g., Earth. */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)glplanet.c   5.01 01/04/13 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ * 13-Apr-01: rolf@groppe.de Did this on the xlockmore version
+ * (21-Mar-01: jwz@jwz.org   Broke sphere routine out into its own file.
+ *                           Done on the xscreensaver version)
+ *
+ * 5-Apr-01:  rolf@groppe.de    Ported this mode from xscreensaver to xlock.
+ *                              Made smoother roll & rotational movement
+ *                                   configurable by -count and -cycles.
+ *                              Renamed the parameter -image to -pimage
+ *
+ * 9-Oct-98:  dek@cgl.ucsf.edu  Added stars.
+ *
+ * 8-Oct-98:  jwz@jwz.org   Made the 512x512x1 xearth image be built in.
+ *                          Made it possible to load XPM or XBM files.
+ *                          Made the planet bounce and roll around.
+ *
+ * 8-Oct-98: Released initial version of "glplanet"
+ * (David Konerding, dek@cgl.ucsf.edu)
+ *
+ * BUGS:
+ * -bounce is broken
+ * 
+ *   For even more spectacular results, grab the images from the "SSysten"
+ *   package (http://www.msu.edu/user/kamelkev/) and do this:
+ *
+ *     cd ssystem-1.4/hires/
+ *     foreach f ( *.jpg )
+ *       djpeg $f | ppmquant 254 | ppmtoxpm > /tmp/$f:r.xpm
+ *     end
+ *
+ *     cd /tmp
+ *     foreach f ( *.xpm )
+ *       xlock -mode glplanet -pimage $f
+ *     end
+ */
+
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+# define PROGCLASS                                             "Planet"
+# define HACK_INIT                                             init_planet
+# define HACK_DRAW                                             draw_glplanet
+# define HACK_RESHAPE                                  reshape_planet
+# define planet_opts                                   xlockmore_opts
+#define DEFAULTS       "*delay:                        15000   \n"     \
+                                       "*showFPS:                      False   \n" \
+                    "*rotate:           True    \n" \
+                    "*roll:             True    \n" \
+                    "*bounce:           True    \n" \
+                                       "*wireframe:            False   \n"     \
+                                       "*light:                        True    \n"     \
+                                       "*texture:                      True    \n" \
+                                       "*stars:                        True    \n" \
+                                       "*pimage:                       BUILTIN \n" \
+                                       "*imageForeground:      Green   \n" \
+                                       "*imageBackground:      Blue    \n"
+
+# include "xlockmore.h"                                /* from the xscreensaver distribution */
+#else  /* !STANDALONE */
+# include "xlock.h"                                    /* from the xlockmore distribution */
+# include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_glplanet /* whole file */
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#if USE_XPMINC
+#include <xpm.h>
+#else
+#include <X11/xpm.h>            /* Normal spot */
+#endif /* USE_XPMINC */
+# ifndef PIXEL_ALREADY_TYPEDEFED
+#  define PIXEL_ALREADY_TYPEDEFED /* Sigh, Xmu/Drawing.h needs this... */
+# endif
+#endif
+
+#ifdef USE_XMU
+# ifndef VMS
+#  include <X11/Xmu/Drawing.h>
+#else  /* VMS */
+#  include <Xmu/Drawing.h>
+# endif /* VMS */
+#endif
+
+#include "sphere.h" 
+
+#include <GL/glu.h>
+
+#define DEF_ROTATE  "True"
+#define DEF_ROLL    "True"
+#define DEF_BOUNCE  "True"
+#define DEF_TEXTURE "True"
+#define DEF_STARS "True"
+#define DEF_LIGHT   "True"
+#define DEF_IMAGE   "BUILTIN"
+#define MINROLL 1
+#define MINROT 2
+
+#undef countof
+#define countof(x) (sizeof((x))/sizeof((*x)))
+
+static int do_rotate;
+static int do_roll;
+static int do_bounce;
+static int do_texture;
+static int do_stars;
+static int do_light;
+static char *which_image;
+static XrmOptionDescRec opts[] = {
+  {(char *) "-rotate", (char *) ".glplanet.rotate",  XrmoptionNoArg, (caddr_t) "on" },
+  {(char *) "+rotate", (char *) ".glplanet.rotate",  XrmoptionNoArg, (caddr_t) "off" },
+  {(char *) "-roll", (char *) ".glplanet.roll",    XrmoptionNoArg, (caddr_t) "on" },
+  {(char *) "+roll", (char *) ".glplanet.roll",    XrmoptionNoArg, (caddr_t) "off" },
+  {(char *) "-bounce", (char *) ".glplanet.bounce",  XrmoptionNoArg, (caddr_t) "on" },
+  {(char *) "+bounce", (char *) ".glplanet.bounce",  XrmoptionNoArg, (caddr_t) "off" },
+  {(char *) "-texture", (char *) ".glplanet.texture", XrmoptionNoArg, (caddr_t) "on" },
+  {(char *) "+texture", (char *) ".glplanet.texture", XrmoptionNoArg, (caddr_t) "off" },
+  {(char *) "-stars", (char *) ".glplanet.stars",   XrmoptionNoArg, (caddr_t) "on" },
+  {(char *) "+stars", (char *) ".glplanet.stars",   XrmoptionNoArg, (caddr_t) "off" },
+  {(char *) "-light", (char *) ".glplanet.light",   XrmoptionNoArg, (caddr_t) "on" },
+  {(char *) "+light", (char *) ".glplanet.light",   XrmoptionNoArg, (caddr_t) "off" },
+  {(char *) "-pimage", (char *) ".glplanet.pimage",  XrmoptionSepArg, (caddr_t) 0 }
+};
+
+static argtype vars[] = {
+  {(caddr_t *) &do_rotate,   (char *) "rotate",  (char *) "Rotate",  DEF_ROTATE,  t_Bool},
+  {(caddr_t *) &do_roll,     (char *) "roll",    (char *) "Roll",    DEF_ROLL,    t_Bool},
+  {(caddr_t *) &do_bounce,   (char *) "bounce",  (char *) "Bounce",  DEF_BOUNCE,  t_Bool},
+  {(caddr_t *) &do_texture,  (char *) "texture", (char *) "Texture", DEF_TEXTURE, t_Bool},
+  {(caddr_t *) &do_stars,  (char *) "stars", (char *) "Stars", DEF_STARS, t_Bool},
+  {(caddr_t *) &do_light,    (char *) "light",   (char *) "Light",   DEF_LIGHT,   t_Bool},
+  {(caddr_t *) &which_image, (char *) "pimage",   (char *) "Pimage",   DEF_IMAGE,   t_String},
+};
+
+static OptionStruct desc[] = {
+  {(char *) "-/+rotate", (char *) "turn on/off rotatation"},
+  {(char *) "-/+roll", (char *) "turn on/off rolling"},
+  {(char *) "-/+bounce", (char *) "turn on/off bouncing"},
+  {(char *) "-/+texture", (char *) "turn on/off texture mapping"},
+  {(char *) "-/+stars", (char *) "turn on/off stars"},
+  {(char *) "-/+light", (char *) "turn on/off light source"},
+  {(char *) "-pimage", (char *) "set image"},
+};
+
+ModeSpecOpt glplanet_opts = {countof(opts), opts, countof(vars), vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   glplanet_description =
+{"glplanet", "init_glplanet", "draw_glplanet", "release_glplanet",
+ "draw_glplanet", "init_glplanet", NULL, &glplanet_opts,
+ 1000, 1, 2, 1, 64, 1.0, "",
+ "Animates texture mapped sphere (planet)", 0, NULL};
+#endif
+
+#define FLOATRAND(a) (((double)LRAND() / (double)MAXRAND) * a)
+
+#include "bitmaps/earth.xbm"
+#include "xpm-ximage.h"
+
+
+/*-
+ * slices and stacks are used in the sphere parameterization routine.
+ * more slices and stacks will increase the quality of the sphere,
+ * at the expense of rendering speed
+ */
+
+#define NUM_STARS 1000
+#define SLICES 32
+#define STACKS 32
+
+/* radius of the sphere- fairly arbitrary */
+#define RADIUS 4
+
+/* distance away from the sphere model */
+#define DIST 40
+
+
+
+/* structure for holding the planet data */
+typedef struct {
+  GLuint platelist;
+  GLuint starlist;
+  int screen_width, screen_height;
+  GLXContext *glx_context;
+  Window window;
+
+  XColor fg, bg;
+
+  GLfloat tx, ty, tz;
+  GLfloat dtx, dty, dtz;
+  GLfloat xpos, ypos, zpos;
+  GLfloat dx, dy, dz;
+  GLfloat box_width, box_height, box_depth;
+  int roll_div, rot_div;
+  
+} planetstruct;
+
+
+static planetstruct *planets = (planetstruct *) NULL;
+
+#if 0
+static inline void
+normalize(GLfloat v[3])
+{
+       GLfloat     d = (GLfloat) sqrt((double) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]));
+
+       if (d != 0) {
+               v[0] /= d;
+               v[1] /= d;
+               v[2] /= d;
+       } else {
+               v[0] = v[1] = v[2] = 0;
+       }
+}
+#endif
+
+/* Set up and enable texturing on our object */
+static void
+setup_xbm_texture (unsigned char *bits, int width, int height,
+                                  XColor *fgc, XColor *bgc)
+{
+  unsigned int fg = (((fgc->red  >> 8) << 16) |
+                                        ((fgc->green >> 8) << 8) |
+                                        ((fgc->blue >> 8)));
+  unsigned int bg = (((bgc->red  >> 8) << 16) |
+                                        ((bgc->green >> 8) << 8) |
+                                        ((bgc->blue >> 8)));
+
+  unsigned char *data = (unsigned char *)
+       malloc ((width * height * 24) / 8);
+  unsigned char *out = data;
+  int x, y;
+
+  for (y = 0; y < height; y++)
+       for (x = 0; x < width; x++)
+         {
+               unsigned char byte = bits [(y * (width / 8) + (x / 8))];
+               unsigned char bit = (byte & (1 << (x % 8))) >> (x % 8);
+               unsigned int word = (bit ? bg : fg); 
+               *out++ = (word & 0xFF0000) >> 16;
+               *out++ = (word & 0x00FF00) >> 8;
+               *out++ = (word & 0x0000FF);
+         }
+
+  clear_gl_error();
+  glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0,
+                          GL_RGB, GL_UNSIGNED_BYTE, data);
+  check_gl_error("texture");
+
+  /* setup parameters for texturing */
+  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+  if (data != NULL) {
+       (void) free((void *) data);
+  }
+}
+
+
+static void
+setup_file_texture (ModeInfo *mi, char *filename)
+{
+  Display *dpy = MI_DISPLAY(mi);
+  Visual *visual = MI_VISUAL(mi);
+  Colormap cmap = MI_COLORMAP(mi);
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+  {
+       char **xpm_data = 0;
+       int result = XpmReadFileToData (filename, &xpm_data); 
+       switch (result) {
+       case XpmSuccess:
+         {
+               XImage *image = xpm_to_ximage (dpy, visual, cmap, xpm_data);
+
+        clear_gl_error();
+               glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                                        image->width, image->height, 0,
+                                        GL_RGBA, GL_UNSIGNED_BYTE, image->data);
+        check_gl_error("texture");
+
+               /* setup parameters for texturing */
+               glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+               glPixelStorei(GL_UNPACK_ROW_LENGTH, image->width);
+
+               glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+               glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+               glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+               glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+               glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+               return;
+         }
+         break;
+
+       case XpmOpenFailed:
+         fprintf (stderr, "Glplanet: file %s doesn't exist.\n", filename);
+         exit (-1);
+         break;
+
+       case XpmFileInvalid:
+         /* Fall through and try it as an XBM. */
+         break;
+
+       case XpmNoMemory:
+         fprintf (stderr, "Glplanet: XPM: out of memory\n");
+         exit (-1);
+         break;
+
+       default:
+         fprintf (stderr, "Glplanet: XPM: unknown error code %d\n", result);
+         exit (-1);
+         break;
+       }
+  }
+#endif /* HAVE_XPM */
+
+#ifdef USE_XMU
+  {
+       planetstruct *gp = &planets[MI_SCREEN(mi)];
+       unsigned int width = 0;
+       unsigned int height = 0;
+       unsigned char *data = 0;
+       int xhot, yhot;
+       int status = XmuReadBitmapDataFromFile (filename, &width, &height, &data,
+                                                                                       &xhot, &yhot);
+       if (status != Success)
+         {
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+               fprintf (stderr, "Glplanet: not an XPM file: %s\n", filename);
+# endif
+               fprintf (stderr, "Glplanet: not an XBM file: %s\n", filename);
+               exit (1);
+         }
+
+       setup_xbm_texture ((unsigned char *) data, width, height, &gp->fg, &gp->bg);
+  }
+#else  /* !XMU */
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+  fprintf (stderr, "Glplanet: not an XPM file: %s\n", filename);
+# endif
+  fprintf (stderr, "Glplanet: your vendor doesn't ship the standard Xmu library.\n");
+  fprintf (stderr, "Glplanet: we can't load XBM files without it.\n");
+  exit (1);
+#endif /* !XMU */
+}
+
+
+static void
+setup_texture(ModeInfo * mi)
+{
+  planetstruct *gp = &planets[MI_SCREEN(mi)];
+  if (!which_image ||
+         !*which_image ||
+         !strcmp(which_image, "BUILTIN"))
+       setup_xbm_texture (earth_bits, earth_width, earth_height,
+                                          &gp->fg, &gp->bg);
+
+  else
+       setup_file_texture (mi, which_image);
+}
+
+
+/* Set up and enable lighting */
+static void
+setup_light(void)
+{
+  /* set a number of parameters which make the scene look much nicer */
+  glEnable(GL_BLEND);
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+  glShadeModel(GL_SMOOTH);
+}
+
+
+/* Set up and enable face culling so we don't see the inside of the sphere */
+static void
+setup_face(void)
+{
+  glEnable(GL_CULL_FACE);
+  glCullFace(GL_BACK); 
+}
+
+/* lame way to generate some random stars */
+void generate_stars(ModeInfo * mi, int width, int height)
+{
+  int i;
+/*  GLfloat size_range[2], size;*/
+  GLfloat x, y;
+
+  planetstruct *gp = &planets[MI_SCREEN(mi)];
+  
+/*    glGetFloatv(GL_POINT_SIZE_RANGE, size_range); */
+  
+/*    printf("size range: %f\t%f\n", size_range[0], size_range[1]); */
+  gp->starlist = glGenLists(1);
+  glNewList(gp->starlist, GL_COMPILE);
+
+  /* this hackery makes the viewport map one-to-one with Vertex arguments */
+  glMatrixMode(GL_PROJECTION);
+  glPushMatrix();
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+  gluOrtho2D(0, width, 0, height);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+
+  /* disable depth testing for the stars, so they don't obscure the planet */
+  glDisable(GL_DEPTH_TEST);
+  glEnable(GL_POINT_SMOOTH);
+  glEnable(GL_BLEND);
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+  
+  glBegin(GL_POINTS);
+  for(i = 0 ; i < NUM_STARS ; i++)
+       {
+/*       size = ((random()%size_range[0])) * size_range[1]/2.; */
+/*    glPointSize(size); */
+         x = random() % width;
+         y = random() % height;
+         glVertex2f(x,y);
+       }
+  glEnd();
+
+  /* return to original PROJECT and MODELVIEW */
+  glMatrixMode(GL_PROJECTION);
+  glPopMatrix();
+  glMatrixMode(GL_MODELVIEW);
+
+
+  glEndList();
+
+}
+
+/* Initialization function for screen saver */
+static void
+pinit(ModeInfo * mi)
+{
+  Bool wire = MI_IS_WIREFRAME(mi);
+  planetstruct *gp = &planets[MI_SCREEN(mi)];
+
+  if (wire) {
+       glEnable(GL_LINE_SMOOTH);
+       do_texture = False;
+  }
+
+  /* turn on various options we like */
+  if (do_texture)
+       setup_texture(mi);
+  if (do_light)
+       setup_light();
+
+  setup_face();
+
+  if (do_stars) {
+       glEnable(GL_POINT_SMOOTH);
+       generate_stars(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+  }
+
+  gp->platelist=glGenLists(1);
+  glNewList(gp->platelist, GL_COMPILE);
+  glPushMatrix ();
+  glScalef (RADIUS, RADIUS, RADIUS);
+  unit_sphere (STACKS, SLICES, wire);
+  glPopMatrix ();
+  glEndList();
+ }
+
+static void
+draw_sphere_glp(ModeInfo * mi)
+{
+  planetstruct *gp = &planets[MI_SCREEN(mi)];
+
+  glEnable(GL_DEPTH_TEST);
+
+  /* turn on the various attributes for making the sphere look nice */
+  if (do_texture)
+       glEnable(GL_TEXTURE_2D);
+
+  if (do_light)
+       { 
+         glEnable(GL_LIGHTING);
+         glEnable(GL_LIGHT0);
+         glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
+         glEnable(GL_COLOR_MATERIAL);
+       }
+
+  glCallList(gp->platelist);
+
+}
+
+
+#define RANDSIGN() ((random() & 1) ? 1 : -1)
+
+static void
+pick_velocity (ModeInfo * mi)
+{
+  float roll1,roll2,rot1,rot2;
+  planetstruct *gp = &planets[MI_SCREEN(mi)];
+
+  gp->roll_div = MI_COUNT(mi);
+  if (gp->roll_div <= MINROLL) gp->roll_div = MINROLL * 10;
+  gp->rot_div = MI_CYCLES(mi);
+  if (gp->rot_div <= MINROT) gp->rot_div = MINROT * 50;
+  
+  roll1 = gp->roll_div / 100.0;
+  roll2 = roll1 * 0.75;
+  rot1  = gp->rot_div  / 100.0;
+  rot2  = rot1;
+  gp->box_width =  15.0;
+  gp->box_height = 15.0;
+  gp->box_depth =  5.0;
+
+  gp->tx = 0.0;
+  gp->ty = 0.0;
+  gp->tz = FLOATRAND(360);
+
+/* following values changed for smoother rotation */
+  gp->dtx = (FLOATRAND(roll1) + FLOATRAND(roll2)) * RANDSIGN();
+  gp->dty = (FLOATRAND(roll1) + FLOATRAND(roll2)) * RANDSIGN();
+  gp->dtz = (FLOATRAND(rot1) + FLOATRAND(rot2));  /* the sun sets in the west */
+
+/* following values are unused
+  gp->dx = (FLOATRAND(0.2) + FLOATRAND(0.2)) * RANDSIGN();
+  gp->dy = (FLOATRAND(0.2) + FLOATRAND(0.2)) * RANDSIGN();
+  gp->dz = (FLOATRAND(0.2) + FLOATRAND(0.2)) * RANDSIGN(); */ 
+}
+
+
+static void
+rotate_and_move (ModeInfo * mi)
+{
+  planetstruct *gp = &planets[MI_SCREEN(mi)];
+
+  if (do_roll)
+       {
+         gp->tx += gp->dtx;
+         while (gp->tx < 0)   gp->tx += 360;
+         while (gp->tx > 360) gp->tx -= 360;
+
+         gp->ty += gp->dty;
+         while (gp->ty < 0)   gp->ty += 360;
+         while (gp->ty > 360) gp->ty -= 360;
+       }
+
+  if (do_rotate)
+       {
+         gp->tz += gp->dtz;
+         while (gp->tz < 0)   gp->tz += 360;
+         while (gp->tz > 360) gp->tz -= 360;
+       }
+
+  if (do_bounce)
+       {
+      static int frame = 0;
+/*
+#     define SINOID(SCALE,SIZE) \
+        ((((1 + sin((frame * (SCALE)) / 16 * M_PI)) / 2.0) * (SIZE)) - (SIZE)/2)
+      gp->xpos = SINOID(0.031, gp->box_width);
+      gp->ypos = SINOID(0.023, gp->box_height);
+      gp->zpos = SINOID(0.017, gp->box_depth);
+      frame++;
+*/
+/* Original function replaced for faster execution */
+#     define SINOID(SCALE,SIZE) \
+        (sin(frame * (SCALE)) / 2.0) * (SIZE) 
+      gp->xpos = SINOID(0.006086836, gp->box_width);
+      gp->ypos = SINOID(0.004516039, gp->box_height);
+      gp->zpos = SINOID(0.003337942, gp->box_depth);
+      frame++;
+
+       }
+}
+
+
+/* Standard reshape function */
+void
+reshape_planet(ModeInfo *mi, int width, int height)
+{
+  GLfloat light[4];
+  GLfloat h = (GLfloat) height / (GLfloat) width;
+
+  light[0] = -1;
+  light[1] = (int) (((random() % 3) & 0xFF) - 1);
+  light[2] = (int) (((random() % 3) & 0xFF) - 1);
+  light[3] = 0;
+
+  glViewport(0, 0, (GLint) width, (GLint) height);
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+  glFrustum(-1.0, 1.0, -h, h, 5.0, 100.0);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  glTranslatef(0.0, 0.0, -DIST);
+  glLightfv(GL_LIGHT0, GL_POSITION, light);
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+}
+
+
+void
+init_glplanet(ModeInfo * mi)
+{
+  int         screen = MI_SCREEN(mi);
+
+  planetstruct *gp;
+
+  if (planets == NULL) {
+       if ((planets = (planetstruct *) calloc(MI_NUM_SCREENS(mi),
+                 sizeof (planetstruct))) == NULL)
+         return;
+  }
+  gp = &planets[screen];
+
+  pick_velocity (mi);
+
+   {
+/*     char *f = get_string_resource("imageForeground", "Foreground");
+       char *b = get_string_resource("imageBackground", "Background"); */
+        char *f = strdup("Green");
+       char *b = strdup("Blue");
+       char *s;
+       if (!f) f = strdup("white");
+       if (!b) b = strdup("black");
+
+       for (s = f + strlen(f)-1; s > f; s--)
+         if (*s == ' ' || *s == '\t')
+               *s = 0;
+       for (s = b + strlen(b)-1; s > b; s--)
+         if (*s == ' ' || *s == '\t')
+               *s = 0;
+
+    if (!XParseColor(MI_DISPLAY(mi), MI_COLORMAP(mi), f, &gp->fg))
+      {
+               fprintf(stderr, "Glplanet: unparsable color: \"%s\"\n", f);
+               exit(1);
+      }
+    if (!XParseColor(MI_DISPLAY(mi), MI_COLORMAP(mi), b, &gp->bg))
+      {
+               fprintf(stderr, "Glplanet: unparsable color: \"%s\"\n", f);
+               exit(1);
+      }
+
+       (void) free((void *) f);
+       (void) free((void *) b);
+  } 
+
+
+  gp->window = MI_WINDOW(mi);
+  if ((gp->glx_context = init_GL(mi)) != NULL) {
+       reshape_planet(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+       pinit(mi);
+  } else {
+       MI_CLEARWINDOW(mi);
+  }
+}
+
+void
+draw_glplanet(ModeInfo * mi)
+{
+  planetstruct *gp = &planets[MI_SCREEN(mi)];
+  Display    *display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+
+  if (!gp->glx_context)
+       return;
+
+  glDrawBuffer(GL_BACK);
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+  glXMakeCurrent(display, window, *(gp->glx_context));
+
+
+  if (do_stars) {
+       /* protect our modelview matrix and attributes */
+       glPushMatrix();
+       glPushAttrib(GL_ALL_ATTRIB_BITS);
+       {
+         glColor3f(1,1,1);
+         /* draw the star field. */
+         glCallList(gp->starlist);
+
+       }
+       glPopMatrix();
+       glPopAttrib();
+  }
+
+  /* protect our modelview matrix and attributes */
+  glPushMatrix();
+  glPushAttrib(GL_ALL_ATTRIB_BITS);
+  {
+       /* this pair of rotations seem to be necessary to orient the earth correctly */
+       glRotatef(90,0,0,1);
+       glRotatef(90,0,1,0);
+
+       glTranslatef(gp->xpos, gp->ypos, gp->zpos);
+       glRotatef(gp->tx, 1, 0, 0);
+       glRotatef(gp->ty, 0, 1, 0);
+       glRotatef(gp->tz, 0, 0, 1);
+       /* draw the sphere */
+       draw_sphere_glp(mi);
+  }
+  glPopMatrix();
+  glPopAttrib();
+
+
+
+  if (MI_IS_FPS(mi)) do_fps (mi);
+  glFinish();
+  glXSwapBuffers(display, window);
+
+  rotate_and_move (mi);
+}
+
+void
+release_glplanet(ModeInfo * mi)
+{
+  if (planets != NULL) {
+       int         screen;
+
+       for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+         planetstruct *gp = &planets[screen];
+
+         if (gp->glx_context) {
+               /* Display lists MUST be freed while their glXContext is current. */
+               glXMakeCurrent(MI_DISPLAY(mi), gp->window, *(gp->glx_context));
+
+               if (glIsList(gp->platelist))
+                 glDeleteLists(gp->platelist, 1);
+               if (glIsList(gp->starlist))
+                 glDeleteLists(gp->starlist, 1);
+         }
+       }
+       (void) free((void *) planets);
+       planets = (planetstruct *) NULL;
+  }
+  FreeAllGL(mi);
+}
+
+
+#endif
+
diff --git a/modes/glx/i_evert.h b/modes/glx/i_evert.h
new file mode 100644 (file)
index 0000000..2490ea1
--- /dev/null
@@ -0,0 +1,8 @@
+#include <GL/gl.h>
+#include <GL/glx.h>
+
+extern double scale;
+extern double width;
+extern int sphere;
+extern int torscene;
+extern double corrstart, pushstart, twiststart, untwiststart, uncorrstart;
diff --git a/modes/glx/i_figureeight.cc b/modes/glx/i_figureeight.cc
new file mode 100644 (file)
index 0000000..38ac2cd
--- /dev/null
@@ -0,0 +1,34 @@
+#include "i_figureeight.h"
+
+extern int n_strips;
+
+TwoJetVec FigureEight(
+  TwoJetVec w, TwoJetVec h, TwoJetVec bend, TwoJet form, TwoJet v
+) {
+  TwoJet height;
+  v %= 1;
+  height = (Cos (v*2) + -1) * (-1);
+  if (v > 0.25 && v < 0.75)
+    height = height*-1 + 4;
+  height = height*0.6;
+  h = h + bend*(height*height*(1/64.));
+  return
+    w*Sin (v*2) + (h) * (Interpolate((Cos (v) + -1) * (-2), height, form))
+  ;
+}
+
+TwoJetVec AddFigureEight(ThreeJetVec p, ThreeJet u, TwoJet v, ThreeJet form, ThreeJet scale)
+{
+  ThreeJet size = form*scale;
+  form = form*2 + form*form*-1;
+  TwoJetVec dv = AnnihilateVec(D(p, 1), 1);
+  p = AnnihilateVec(p, 1);
+  TwoJetVec du = Normalize(D(p, 0));
+  TwoJetVec h = Normalize(Cross(du, dv))*TwoJet(size);
+  TwoJetVec w = Normalize(Cross(h, du))*(TwoJet(size)*1.1);
+  return RotateZ(
+    TwoJetVec(p) +
+      FigureEight(w, h, du*D(size, 0)*(D(u, 0)^(-1)), form, v),
+    v*(1./n_strips)
+  );
+}
diff --git a/modes/glx/i_figureeight.h b/modes/glx/i_figureeight.h
new file mode 100644 (file)
index 0000000..6079e77
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __FIGUREEIGHT
+#define __FIGUREEIGHT
+#include "i_threejetvec.h"
+#include "i_twojetvec.h"
+
+#define N_STRIPS 8
+
+TwoJetVec FigureEight(
+  TwoJetVec w, TwoJetVec h, TwoJetVec bend,
+  TwoJet form, TwoJet v
+);
+TwoJetVec AddFigureEight(ThreeJetVec p, ThreeJet u, TwoJet v, ThreeJet form, ThreeJet scale);
+
+#endif
diff --git a/modes/glx/i_linkage.cc b/modes/glx/i_linkage.cc
new file mode 100644 (file)
index 0000000..555198b
--- /dev/null
@@ -0,0 +1,125 @@
+#ifdef VMS
+/* Xlib.h for VMS is not (yet) compatible with C++ *
+ * The resulting warnings are switched off here    */
+#pragma message disable nosimpint
+#endif
+#include <X11/Intrinsic.h>
+#ifdef VMS
+#pragma message enable nosimpint
+#endif
+#include "xlock.h"
+
+#include "i_linkage.h"
+#include "i_threejetvec.h"
+#include "i_figureeight.h"
+#include "i_spline.h"
+#include "i_sphere.h"
+
+char *parse_parts(char *parts);
+#define        PART_POS 0x1
+#define        PART_NEG 0x2
+
+double scale = M_PI;
+int scene = 0;
+int bezier = 0;
+char *parts = (char *) NULL;
+int n_strips = N_STRIPS;
+
+Bool
+invert_draw(spherestruct * gp)
+{
+  double umin, vmin, umax, vmax;
+  double du, dv;
+  double time = 0.0;
+  double corrstart, pushstart, twiststart, unpushstart, uncorrstart;
+  int binary = 0;
+  int j, k;
+
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+  glPushMatrix();
+  glRotatef(gp->view_rotx, 1.0, 0.0, 0.0);
+  glRotatef(gp->view_roty, 0.0, 1.0, 0.0);
+  glRotatef(gp->view_rotz, 0.0, 0.0, 1.0);
+
+  /* default parameters */
+
+  corrstart = 0;
+  pushstart = .1;
+  twiststart = .23;
+  unpushstart = .6;
+  uncorrstart = .93;
+
+  vmin = 0.0;
+  umin = 0.0;
+  vmax = 1.0;
+  umax = 1.0;
+  du = dv = 1./12.;
+
+  /* Simple inversion fits our needs perfectly... */
+
+  du = 0.04;
+  dv = 0.04;
+  umax = 2.0;
+  parts = (char *) "+0+1+2+3+4+5+6+7";
+  time = (cos((M_PI*gp->time)/gp->numsteps)+1.0)/2.0;
+  binary = 0;
+
+  /* draw it here */
+
+  if (gp->partlist == NULL)
+    gp->partlist = parse_parts(parts);
+
+  /* Need to compute */
+
+  if (gp->construction) {
+    glNewList(gp->frames+gp->time, GL_COMPILE);
+    if (glGetError() != GL_NO_ERROR) {
+       return False;
+    }
+
+    if (time >= uncorrstart && uncorrstart >= 0)
+      printScene(UnCorrugate, umin, umax, du, vmin, vmax, dv,
+                (time - uncorrstart) / (1.0 - uncorrstart), binary);
+    else if (time >= unpushstart && unpushstart >= 0)
+      printScene(UnPush, umin, umax, du, vmin, vmax, dv,
+                (time - unpushstart) /
+                (((uncorrstart < 0) ? 1.0 : uncorrstart) - unpushstart), binary);
+    else if (time >= twiststart && twiststart >= 0)
+      printScene(Twist, umin, umax, du, vmin, vmax, dv,
+                (time - twiststart) /
+                (((unpushstart < 0) ? 1.0 : unpushstart) - twiststart), binary);
+    else if (time >= pushstart && pushstart >= 0)
+      printScene(PushThrough, umin, umax, du, vmin, vmax, dv,
+                (time - pushstart) /
+                (((twiststart < 0) ? 1.0 : twiststart) - pushstart), binary);
+    else if (time >= corrstart && corrstart >= 0)
+      printScene(Corrugate, umin, umax, du, vmin, vmax, dv,
+                (time - corrstart) /
+                (((pushstart < 0) ? 1.0 : pushstart) - corrstart), binary);
+    glEndList();
+  }
+
+  for(j = -1; j <= 1; j += 2) {
+    for(k = 0; k < n_strips; k++) {
+      if(gp->partlist[k] & (j<0 ? PART_NEG : PART_POS)) {
+       double t = 2*M_PI * (j < 0 ? n_strips-1-k : k) / n_strips;
+       double s = sin(t), c = cos(t);
+
+       GLdouble m[16];
+       m[0] = j*c; m[4] = -s; m[8] =  0; m[12] = 0;
+       m[1] = j*s; m[5] =  c; m[9] =  0, m[13] = 0;
+       m[2] =   0; m[6] =  0; m[10] = j; m[14] = 0;
+       m[3] =   0; m[7] =  0; m[11] = 0; m[15] = 1;
+
+       glPushMatrix();
+       glMultMatrixd(m);
+       glCallList(gp->frames+gp->time);
+       glPopMatrix();
+      }
+    }
+  }
+
+  glPopMatrix();
+  return True;
+}
diff --git a/modes/glx/i_linkage.h b/modes/glx/i_linkage.h
new file mode 100644 (file)
index 0000000..2b60b51
--- /dev/null
@@ -0,0 +1,23 @@
+#include <GL/gl.h>
+#include <GL/glx.h>
+
+typedef struct {
+  GLfloat     view_rotx, view_roty, view_rotz;
+  GLXContext *glx_context;
+  GLuint      frames;
+  int         numsteps;
+  int         construction;
+  int         time;
+  char       *partlist;
+  int         forwards;
+  Window      window;
+} spherestruct;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+  Bool invert_draw(spherestruct *gp);
+#ifdef __cplusplus
+}
+#endif
diff --git a/modes/glx/i_sphere.cc b/modes/glx/i_sphere.cc
new file mode 100644 (file)
index 0000000..d3a838d
--- /dev/null
@@ -0,0 +1,155 @@
+#include "i_threejetvec.h"
+#include "i_figureeight.h"
+#include "i_spline.h"
+#include "i_sphere.h"
+
+ThreeJetVec Arc(ThreeJet u, ThreeJet v, double xsize, double ysize, double zsize) {
+  ThreeJetVec result;
+  u = u*0.25;
+  result.x = Sin (u) * Sin (v) * xsize;
+  result.y = Sin (u) * Cos (v) * ysize;
+  result.z = Cos (u) * zsize;
+  return result;
+}
+
+ThreeJetVec Straight(ThreeJet u, ThreeJet v, double xsize, double ysize, double zsize) {
+  ThreeJetVec result;
+  u = u*0.25;
+#if 0
+  u = (u) * (-0.15915494) + 1; /* 1/2pi */
+#endif
+  result.x = Sin (v) * xsize;
+  result.y = Cos (v) * ysize;
+  result.z = Cos (u) * zsize;
+  return result;
+}
+
+ThreeJet Param1(ThreeJet x) {
+  double offset = 0;
+  x %= 4;
+  if (x > 2) { x = x+(-2); offset = 2; }
+  if (x <= 1) return x*2 + (x^2)*(-1) + offset;
+  else return (x^2) + x*(-2) + (2 + offset);
+}
+
+ThreeJet Param2(ThreeJet x) {
+  double offset = 0;
+  x %= 4;
+  if (x > 2) { x = x+(-2); offset = 2; }
+  if (x <= 1) return (x^2) + offset;
+  else return (x^2)*(-1) + x*4 + (-2 + offset);
+}
+
+static inline ThreeJet TInterp(double x) {
+  return ThreeJet(x,0,0);
+}
+
+ThreeJet UInterp(ThreeJet x) {
+  x %= 2;
+  if (x > 1)
+    x = x*(-1) + 2;
+  return (x^2)*3 + (x^3) * (-2);
+}
+
+#define FFPOW 3
+ThreeJet FFInterp(ThreeJet x) {
+  x %= 2;
+  if (x > 1)
+    x = x*(-1) + 2;
+  x = x*1.06 + -0.05;
+  if (x < 0) return ThreeJet(0, 0, 0);
+  else if (x > 1) return ThreeJet(0, 0, 0) + 1;
+  else return (x ^ (FFPOW-1)) * (FFPOW) + (x^FFPOW) * (-FFPOW+1);
+}
+
+#define FSPOW 3
+ThreeJet FSInterp(ThreeJet x) {
+  x %= 2;
+  if (x > 1)
+    x = x*(-1) + 2;
+  return ((x ^ (FSPOW-1)) * (FSPOW) + (x^FSPOW) * (-FSPOW+1)) * (-0.2);
+}
+
+ThreeJetVec Stage0(ThreeJet u, ThreeJet v) {
+  return Straight(u, v, 1, 1, 1);
+}
+
+ThreeJetVec Stage1(ThreeJet u, ThreeJet v) {
+  return Arc(u, v, 1, 1, 1);
+}
+
+ThreeJetVec Stage2(ThreeJet u, ThreeJet v) {
+  return InterpolateVec(
+    Arc(Param1(u), v, 0.9, 0.9, -1),
+    Arc(Param2(u), v, 1, 1, 0.5),
+    UInterp(u));
+}
+
+ThreeJetVec Stage3(ThreeJet u, ThreeJet v) {
+  return InterpolateVec(
+    Arc(Param1(u), v,-0.9,-0.9,-1),
+    Arc(Param2(u), v,-1, 1,-0.5),
+    UInterp(u));
+}
+
+ThreeJetVec Stage4(ThreeJet u, ThreeJet v) {
+  return Arc(u, v, -1,-1, -1);
+}
+
+ThreeJetVec Scene01(ThreeJet u, ThreeJet v, double t) {
+  return InterpolateVec(Stage0(u,v), Stage1(u,v), TInterp(t));
+}
+
+ThreeJetVec Scene12(ThreeJet u, ThreeJet v, double t) {
+  return InterpolateVec(Stage1(u,v), Stage2(u,v), TInterp(t));
+}
+
+ThreeJetVec Scene23(ThreeJet u, ThreeJet v, double t) {
+  t = TInterp(t) * 0.5;
+  double tt = (u <= 1) ? t : -t;
+  return InterpolateVec(
+    RotateZ(Arc(Param1(u), v, 0.9, 0.9,-1), ThreeJet(tt,0,0)),
+    RotateY(Arc(Param2(u), v, 1, 1, 0.5), ThreeJet(t,0,0)),
+    UInterp(u)
+  );
+}
+
+ThreeJetVec Scene34(ThreeJet u, ThreeJet v, double t) {
+  return InterpolateVec(Stage3(u,v), Stage4(u,v), TInterp(t));
+}
+
+TwoJetVec BendIn(ThreeJet u, ThreeJet v, double t) {
+  t = TInterp(t);
+  return AddFigureEight(
+    Scene01(u, ThreeJet(0, 0, 1), t),
+    u, v, ThreeJet(0, 0, 0), FSInterp(u));
+}
+TwoJetVec Corrugate(ThreeJet u, ThreeJet v, double t) {
+  t = TInterp(t);
+  return AddFigureEight(
+    Stage1(u, ThreeJet(0, 0, 1)),
+    u, v, FFInterp(u) * ThreeJet(t,0,0), FSInterp(u));
+}
+TwoJetVec PushThrough(ThreeJet u, ThreeJet v, double t) {
+  return AddFigureEight(
+    Scene12(u,ThreeJet(0, 0, 1),t),
+    u, v, FFInterp(u), FSInterp(u));
+}
+TwoJetVec Twist(ThreeJet u, ThreeJet v, double t) {
+  return AddFigureEight(
+    Scene23(u,ThreeJet(0, 0, 1),t),
+    u, v, FFInterp(u), FSInterp(u));
+}
+
+TwoJetVec UnPush(ThreeJet u, ThreeJet v, double t) {
+  return AddFigureEight(
+    Scene34(u,ThreeJet(0, 0, 1),t),
+    u, v, FFInterp(u), FSInterp(u));
+}
+
+TwoJetVec UnCorrugate(ThreeJet u, ThreeJet v, double t) {
+  t = TInterp((t) * (-1) + 1);
+  return AddFigureEight(
+    Stage4(u,ThreeJet(0, 0, 1)),
+    u, v, FFInterp(u) * ThreeJet(t,0,0), FSInterp(u));
+}
diff --git a/modes/glx/i_sphere.h b/modes/glx/i_sphere.h
new file mode 100644 (file)
index 0000000..804076f
--- /dev/null
@@ -0,0 +1,8 @@
+#include "i_twojetvec.h"
+#include "i_threejetvec.h"
+TwoJetVec Corrugate(ThreeJet u, ThreeJet v, double t);
+TwoJetVec PushThrough(ThreeJet u, ThreeJet v, double t);
+TwoJetVec Twist(ThreeJet u, ThreeJet v, double t);
+TwoJetVec UnPush(ThreeJet u, ThreeJet v, double t);
+TwoJetVec UnCorrugate(ThreeJet u, ThreeJet v, double t);
+TwoJetVec BendIn(ThreeJet u, ThreeJet v, double t);
diff --git a/modes/glx/i_spline.cc b/modes/glx/i_spline.cc
new file mode 100644 (file)
index 0000000..e99d0f6
--- /dev/null
@@ -0,0 +1,311 @@
+#define XLOCK 1
+#ifdef XLOCK
+#include "xlock.h"
+#endif
+
+#include "i_spline.h"
+#include "i_evert.h"
+extern "C" {
+#include <math.h>
+}
+
+extern int bezier;
+extern char *parts;
+extern int n_strips;
+
+void print_point (FILE *fp, TwoJetVec p, double ps, double pus, double pvs, double puvs, int binary)
+{
+  if(bezier) {
+    float xyz[3];
+    xyz[0] = double(p.x)*ps + p.x.df_du()*pus/3. + p.x.df_dv()*pvs/3.
+             + p.x.d2f_dudv()*puvs/9.;
+    xyz[1] = double(p.y)*ps + p.y.df_du()*pus/3. + p.y.df_dv()*pvs/3.
+             + p.y.d2f_dudv()*puvs/9.;
+    xyz[2] = double(p.z)*ps + p.z.df_du()*pus/3. + p.z.df_dv()*pvs/3.
+             + p.z.d2f_dudv()*puvs/9.;
+    if (binary) {
+      (void) fwrite(&xyz, sizeof(float), 3, fp);
+    } else {
+      (void) fprintf(fp, "%g %g %g\n", xyz[0], xyz[1], xyz[2]);
+    }
+  }
+  else{
+    double x= double(p.x)*ps ;
+    double y= double(p.y)*ps ;
+    double z= double(p.z)*ps ;
+    double nx= p.y.df_du()*p.z.df_dv()-p.z.df_du()*p.y.df_dv();
+    double ny= p.z.df_du()*p.x.df_dv()-p.x.df_du()*p.z.df_dv();
+    double nz= p.x.df_du()*p.y.df_dv()-p.y.df_du()*p.x.df_dv();
+    double s = nx*nx + ny*ny + nz*nz;
+    if(s > 0) s = sqrt(1/s);
+    (void) fprintf(fp, "%f %f %f    %f %f %f\n", x, y, z, nx*s, ny*s, nz*s);
+  }
+}
+
+void printMesh(
+#ifndef XLOCK
+    FILE *fp,
+#endif
+    TwoJetVec p)
+{
+    double x= double(p.x) ;
+    double y= double(p.y) ;
+    double z= double(p.z) ;
+    double nx= p.y.df_du()*p.z.df_dv()-p.z.df_du()*p.y.df_dv();
+    double ny= p.z.df_du()*p.x.df_dv()-p.x.df_du()*p.z.df_dv();
+    double nz= p.x.df_du()*p.y.df_dv()-p.y.df_du()*p.x.df_dv();
+    double s = nx*nx + ny*ny + nz*nz;
+    if(s > 0) s = sqrt(1/s);
+#ifdef XLOCK
+    glNormal3d(nx*s, ny*s, nz*s);
+    glVertex3d(x, y, z);
+#else
+    (void) fprintf(fp, "%f %f %f    %f %f %f\n", x, y, z, nx*s, ny*s, nz*s);
+#endif
+}
+
+void printSpline(FILE *fp, TwoJetVec v00, TwoJetVec v01,
+                          TwoJetVec v10, TwoJetVec v11,
+                          double us, double vs,
+                          double s0, double s1, double t0, double t1, int binary) {
+    if (bezier) {
+    print_point(fp, v00, 1, 0, 0, 0, binary);
+    print_point(fp, v00, 1, us, 0, 0, binary);
+    print_point(fp, v10, 1,-us, 0, 0, binary);
+    print_point(fp, v10, 1, 0, 0, 0, binary);
+
+    print_point(fp, v00, 1, 0, vs, 0, binary);
+    print_point(fp, v00, 1, us, vs, us*vs, binary);
+    print_point(fp, v10, 1,-us, vs,-us*vs, binary);
+    print_point(fp, v10, 1, 0, vs, 0, binary);
+
+    print_point(fp, v01, 1, 0,-vs, 0, binary);
+    print_point(fp, v01, 1, us,-vs,-us*vs, binary);
+    print_point(fp, v11, 1,-us,-vs, us*vs, binary);
+    print_point(fp, v11, 1, 0,-vs, 0, binary);
+
+    print_point(fp, v01, 1, 0, 0, 0, binary);
+    print_point(fp, v01, 1, us, 0, 0, binary);
+    print_point(fp, v11, 1,-us, 0, 0, binary);
+    print_point(fp, v11, 1, 0, 0, 0, binary);
+
+    if (binary) {
+      float sts[8] = {s0,t0, s1,t0, s0,t1, s1,t1};
+      (void) fwrite(&sts, sizeof(float), 8, fp);
+    } else {
+      (void) fprintf(fp, "%g %g  %g %g  %g %g  %g %g\n\n",
+       s0,t0,  s1,t0,  s0,t1, s1,t1);
+    }
+  }
+  else {
+    print_point(fp, v00, 1, us, vs, us*vs, binary);
+    print_point(fp, v10, 1, us, vs, us*vs, binary);
+    print_point(fp, v11, 1, us, vs, us*vs, binary);
+    print_point(fp, v01, 1, us, vs, us*vs, binary);
+    if(!binary)
+       fputc('\n', fp);
+  }
+}
+
+#define sqr(A) ((A)*(A))
+
+static inline double calcSpeedV(TwoJetVec v) {
+  return sqrt(sqr(v.x.df_dv()) + sqr(v.y.df_dv()) + sqr(v.z.df_dv()));
+}
+static inline double calcSpeedU(TwoJetVec v) {
+  return sqrt(sqr(v.x.df_du()) + sqr(v.y.df_du()) + sqr(v.z.df_du()));
+}
+
+#define        PART_POS 0x1
+#define        PART_NEG 0x2
+
+char *parse_parts(char *parts)
+{
+    /* Construct matrices to replicate standard unit (u=0..1, v=0..1) into
+     * complete sphere.
+     */
+    char *partlist = (char *)calloc(n_strips, sizeof(char));
+    char *cp, *ncp, sign;
+    int bits, j;
+
+    for(cp = parts; *cp; ) {
+       while((sign = *cp++) == ' ' || sign == ',')
+           ;
+       if(sign == '+')
+           bits = PART_POS;
+       else if(sign == '-')
+           bits = PART_NEG;
+       else {
+           bits = PART_POS|PART_NEG;
+           cp--;
+       }
+       if(*cp == '*') {
+           for(j = 0; j < n_strips; j++)
+               partlist[j] |= bits;
+           cp++;
+       } else {
+           j = strtol(cp, &ncp, 0);
+           if(cp == ncp) {
+               (void) fprintf(stderr,
+"evert -parts: expected string with alternating signs and strip numbers\n");
+               return (char *) NULL;
+           }
+           if(j < 0 || j >= n_strips) {
+               (void) fprintf(stderr,
+"evert -parts: bad strip number %d; must be in range 0..%d\n", j, n_strips-1);
+               return (char *) NULL;
+           }
+           partlist[j] |= bits;
+           cp = ncp;
+       }
+    }
+    return partlist;
+}
+
+void printScene(
+               SurfaceTimeFunction *func,
+               double umin, double umax, double adu,
+               double vmin, double vmax, double adv,
+               double t, int binary
+               )
+
+{
+  static TwoJetVec **values;
+  int j, k;
+  int jmax = (int) (fabs(umax-umin)/adu+.5);
+  int kmax = (int) (fabs(vmax-vmin)/adv+.5);
+  double u, v, du, dv;
+  FILE *fp = stdout;
+
+  if(jmax == 0) jmax = 1;
+  du = (umax-umin) / jmax;
+  if(kmax == 0) kmax = 1;
+  dv = (vmax-vmin) / kmax;
+  values = (TwoJetVec **) calloc(jmax+1, sizeof(TwoJetVec *));
+  double *speedv = (double *) calloc(jmax+1, sizeof(double));
+  double **speedu = (double **) calloc(jmax+1, sizeof(double *));
+  for (j = 0; j <= jmax; j++) {
+    u = umin + j*du;
+    values[j] = (TwoJetVec *) calloc(kmax+1, sizeof(TwoJetVec));
+    speedu[j] = (double *) calloc(kmax+1, sizeof(double));
+    speedv[j] = calcSpeedV((*func)(ThreeJet(u, 1, 0), ThreeJet(0, 0, 1), t));
+    if(speedv[j] == 0) {
+      /* Perturb a bit, hoping to avoid degeneracy */
+      u += (u<1) ? 1e-9 : -1e-9;
+      speedv[j] = calcSpeedV((*func)(ThreeJet(u, 1, 0), ThreeJet(0, 0, 1), t));
+    }
+    for (k = 0; k <= kmax; k++) {
+      v = vmin + k*dv;
+      values[j][k] = (*func)(
+       ThreeJet(u, 1, 0),
+       ThreeJet(v, 0, 1),
+       t
+      );
+      speedu[j][k] = calcSpeedU(values[j][k]);
+    }
+  }
+#if 0
+  (void) fprintf(fp, "Declare \"speeds\" \"varying float\"\n");
+  (void) fprintf(fp, "Declare \"speedt\" \"varying float\"\n");
+#endif
+#ifndef XLOCK
+  if(parts != NULL) {
+    /* Construct matrices to replicate standard unit (u=0..1, v=0..1) into
+     * complete sphere.
+     */
+    char *partlist = parse_parts(parts);
+
+    if(partlist == NULL)
+       return;
+
+    (void) fprintf(fp, "{ INST transforms { TLIST\n");
+    for(j = -1; j <= 1; j += 2) {
+       for(k = 0; k < n_strips; k++) {
+         if(partlist[k] & (j<0 ? PART_NEG : PART_POS)) {
+           double t = 2*M_PI * (j < 0 ? n_strips-1-k : k) / n_strips;
+           double s = sin(t), c = cos(t);
+
+           (void) fprintf(fp, "# %c%d of %d\n", j<0 ? '-' : '+', k, n_strips);
+           (void) fprintf(fp, "\t%10f %10f %10f %10f\n", j*c, -s,           0., 0.);
+           (void) fprintf(fp, "\t%10f %10f %10f %10f\n", j*s,  c,           0., 0.);
+           (void) fprintf(fp, "\t%10f %10f %10f %10f\n", 0.,   0., (double)j, 0.);
+           (void) fprintf(fp, "\t%10f %10f %10f %10f\n", 0.,   0.,          0., 1.);
+         }
+       }
+    }
+    (void) fprintf(fp, "}\ngeom ");
+  }
+#endif
+
+  if(bezier) {
+    (void) fprintf(fp, "{ STBBP%s\n", binary ? " BINARY" : "");
+    for (j = 0; j < jmax; j++) {
+      u = umin + j*du;
+      for (k = 0; k < kmax; k++) {
+       v = vmin + k*dv;
+       printSpline(fp, values[j][k], values[j][k+1],
+                 values[j+1][k], values[j+1][k+1],
+                 du, dv,
+                 umin+j*du, umin+(j+1)*du,  vmin+k*dv, vmin+(k+1)*dv, binary);
+      }
+    }
+  }
+  else {
+#ifndef XLOCK
+    int nu = kmax+1, nv = jmax+1;
+    (void) fprintf(fp, "{ NMESH%s\n", binary ? " BINARY" : "");
+
+    if(binary) {
+       (void) fwrite(&nu, sizeof(int), 1, stdout);
+       (void) fwrite(&nv, sizeof(int), 1, stdout);
+    } else {
+       (void) fprintf(fp, "%d %d\n", nu, nv);
+    }
+#endif
+
+#ifdef XLOCK
+    for(j = 1; j <= jmax; j++) {
+        glBegin(GL_QUAD_STRIP);
+        for(k = 0; k <= kmax; k++) {
+           printMesh(values[j-1][k]);
+           printMesh(values[j][k]);
+       }
+       glEnd();
+#else
+    for(j = 0; j <= jmax; j++) {
+        for(k = 0; k <= kmax; k++)
+           printMesh(fp, values[j][k]);
+
+       if(!binary)
+           fputc('\n', fp);
+#endif
+
+    }
+  }
+
+#ifndef XLOCK
+  if(parts)
+    (void) fprintf(fp, " }\n");
+  (void) fprintf(fp, "}\n");
+#endif
+
+  for (j = 0; j <= jmax; j++) {
+    if (values[j] != NULL) {
+      (void) free((void *) values[j]);
+      values[j] = (TwoJetVec *) NULL;
+    }
+    if (speedu[j] != NULL) {
+      (void) free((void *) speedu[j]);
+      speedu[j] = (double *) NULL;
+    }
+  }
+  (void) free((void *) values);
+  (void) free((void *) speedu);
+  (void) free((void *) speedv);
+}
+
+void impossible(char *msg) {
+  (void) fprintf(stderr, "%s\n", msg);
+  exit(1);
+}
+
diff --git a/modes/glx/i_spline.h b/modes/glx/i_spline.h
new file mode 100644 (file)
index 0000000..44aee48
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __SPLINE
+#define __SPLINE
+#include "i_threejetvec.h"
+#include "i_twojetvec.h"
+
+typedef TwoJetVec SurfaceTimeFunction(ThreeJet u, ThreeJet v, double t);
+
+void print_point (FILE *fp, TwoJetVec p, double ps, double pus, double pvs, double puvs);
+void printSpline(FILE *fp, TwoJetVec v00, TwoJetVec v01, TwoJetVec v10, TwoJetVec v11, double us, double vs, double s0,double s1,double t0,double t1);
+void printScene(
+  SurfaceTimeFunction *func,
+  double umin, double umax, double du,
+  double vmin, double vmax, double dv,
+  double t, int binary
+);
+void impossible(char *msg);
+#endif
diff --git a/modes/glx/i_threejet.cc b/modes/glx/i_threejet.cc
new file mode 100644 (file)
index 0000000..6335577
--- /dev/null
@@ -0,0 +1,140 @@
+#include "i_threejet.h"
+
+ThreeJet operator+(const ThreeJet x, const ThreeJet y) {
+  ThreeJet result;
+  result.f = x.f + y.f;
+  result.fu = x.fu + y.fu;
+  result.fv = x.fv + y.fv;
+  result.fuu = x.fuu + y.fuu;
+  result.fuv = x.fuv + y.fuv;
+  result.fvv = x.fvv + y.fvv;
+  result.fuuv = x.fuuv + y.fuuv;
+  result.fuvv = x.fuvv + y.fuvv;
+  return result;
+}
+
+ThreeJet operator*(const ThreeJet x, const ThreeJet y) {
+  ThreeJet result;
+  result.f = x.f*y.f;
+  result.fu = x.f*y.fu + x.fu*y.f;
+  result.fv = x.f*y.fv + x.fv*y.f;
+  result.fuu = x.f*y.fuu + 2*x.fu*y.fu + x.fuu*y.f;
+  result.fuv = x.f*y.fuv + x.fu*y.fv + x.fv*y.fu + x.fuv*y.f;
+  result.fvv = x.f*y.fvv + 2*x.fv*y.fv + x.fvv*y.f;
+  result.fuuv = x.f*y.fuuv + 2*x.fu*y.fuv + x.fv*y.fuu
+           + 2*x.fuv*y.fu + x.fuu*y.fv + x.fuuv*y.f;
+  result.fuvv = x.f*y.fuvv + 2*x.fv*y.fuv + x.fu*y.fvv
+           + 2*x.fuv*y.fv + x.fvv*y.fu + x.fuvv*y.f;
+  return result;
+}
+
+ThreeJet operator+(const ThreeJet x, double d) {
+  ThreeJet result;
+  result = x;
+  result.f += d;
+  return result;
+}
+
+ThreeJet operator*(const ThreeJet x, double d) {
+  ThreeJet result;
+  result.f = d*x.f;
+  result.fu = d*x.fu;
+  result.fv = d*x.fv;
+  result.fuu = d*x.fuu;
+  result.fuv = d*x.fuv;
+  result.fvv = d*x.fvv;
+  result.fuuv = d*x.fuuv;
+  result.fuvv = d*x.fuvv;
+  return result;
+}
+
+ThreeJet Sin(const ThreeJet x) {
+  ThreeJet result;
+  ThreeJet t = x*double(2*M_PI);
+  double s = sin(t.f);
+  double c = cos(t.f);
+  result.f = s;
+  result.fu = c*t.fu;
+  result.fv = c*t.fv;
+  result.fuu = c*t.fuu - s*t.fu*t.fu;
+  result.fuv = c*t.fuv - s*t.fu*t.fv;
+  result.fvv = c*t.fvv - s*t.fv*t.fv;
+  result.fuuv = c*t.fuuv - s*(2*t.fu*t.fuv + t.fv*t.fuu) - c*t.fu*t.fu*t.fv;
+  result.fuvv = c*t.fuvv - s*(2*t.fv*t.fuv + t.fu*t.fvv) - c*t.fu*t.fv*t.fv;
+  return result;
+}
+
+ThreeJet Cos(const ThreeJet x) {
+  ThreeJet result;
+  ThreeJet t = x*double(2*M_PI);
+  double s = cos(t.f);
+  double c = -sin(t.f);
+  result.f = s;
+  result.fu = c*t.fu;
+  result.fv = c*t.fv;
+  result.fuu = c*t.fuu - s*t.fu*t.fu;
+  result.fuv = c*t.fuv - s*t.fu*t.fv;
+  result.fvv = c*t.fvv - s*t.fv*t.fv;
+  result.fuuv = c*t.fuuv - s*(2*t.fu*t.fuv + t.fv*t.fuu) - c*t.fu*t.fu*t.fv;
+  result.fuvv = c*t.fuvv - s*(2*t.fv*t.fuv + t.fu*t.fvv) - c*t.fu*t.fv*t.fv;
+  return result;
+}
+
+ThreeJet operator^(const ThreeJet x, double n) {
+  double x0 = pow(x.f, n);
+  double x1 = (x.f == 0) ? 0 : n * x0/x.f;
+  double x2 = (x.f == 0) ? 0 : (n-1) * x1/x.f;
+  double x3 = (x.f == 0) ? 0 : (n-2) * x2/x.f;
+  ThreeJet result;
+  result.f = x0;
+  result.fu = x1*x.fu;
+  result.fv = x1*x.fv;
+  result.fuu = x1*x.fuu + x2*x.fu*x.fu;
+  result.fuv = x1*x.fuv + x2*x.fu*x.fv;
+  result.fvv = x1*x.fvv + x2*x.fv*x.fv;
+  result.fuuv = x1*x.fuuv + x2*(2*x.fu*x.fuv + x.fv*x.fuu) + x3*x.fu*x.fu*x.fv;
+  result.fuvv = x1*x.fuvv + x2*(2*x.fv*x.fuv + x.fu*x.fvv) + x3*x.fu*x.fv*x.fv;
+  return result;
+}
+
+TwoJet D(const ThreeJet x, int index) {
+  TwoJet result;
+  if (index == 0) {
+    result.f = x.fu;
+    result.fu = x.fuu;
+    result.fv = x.fuv;
+    result.fuv = x.fuuv;
+  } else if (index == 1) {
+    result.f = x.fv;
+    result.fu = x.fuv;
+    result.fv = x.fvv;
+    result.fuv = x.fuvv;
+  } else {
+    result.f = result.fu = result.fv =
+    result.fuv = 0;
+  }
+  return result;
+}
+
+ThreeJet Annihilate(const ThreeJet x, int index) {
+  ThreeJet result = ThreeJet(x.f,0,0);
+  if (index == 0) {
+    result.fv = x.fv;
+    result.fvv = x.fvv;
+  } else if (index == 1) {
+    result.fu = x.fu;
+    result.fuu = x.fuu;
+  }
+  return result;
+}
+
+ThreeJet Interpolate(const ThreeJet v1, const ThreeJet v2, const ThreeJet weight) {
+  return (v1) * ((weight) * (-1) + 1) + v2*weight;
+}
+
+void printJet(const ThreeJet v) {
+ (void) printf("%f (%f %f)\n",
+  v.f,
+  v.fu, v.fv
+ );
+}
diff --git a/modes/glx/i_threejet.h b/modes/glx/i_threejet.h
new file mode 100644 (file)
index 0000000..10830b6
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef __THREEJET
+#define __THREEJET
+#include "i_twojet.h"
+
+#define DIM 2
+class ThreeJet {
+  double f;
+  double fu, fv;
+  double fuu, fuv, fvv;
+  double fuuv, fuvv;
+
+  ThreeJet(double d, double du, double dv, double duu, double duv, double dvv,
+   double duuv, double duvv)
+   { f = d; fu = du; fv = dv; fuu = duu; fuv = duv; fvv = dvv;
+     fuuv = duuv; fuvv = duvv; }
+  public:
+  ThreeJet() {}
+  ThreeJet(double d, double du, double dv)
+   { f = d; fu = du; fv = dv; fuu = fuv = fvv = fuuv = fuvv = 0;}
+  operator TwoJet() { return TwoJet(f, fu, fv, fuv); }
+  operator double() { return f; }
+  Bool operator<(double d) { return f < d; }
+  Bool operator<(int d) { return f < d; }
+  Bool operator>(double d) { return f > d; }
+  Bool operator>(int d) { return f > d; }
+  Bool operator<=(double d) { return f <= d; }
+  Bool operator<=(int d) { return f <= d; }
+  Bool operator>=(double d) { return f >= d; }
+  void operator %=(double d)
+   { f = fmod(f, d); if (f < 0) f += d; }
+  friend ThreeJet operator+(const ThreeJet x, const ThreeJet y);
+  friend ThreeJet operator*(const ThreeJet x, const ThreeJet y);
+  friend ThreeJet operator+(const ThreeJet x, double d);
+  friend ThreeJet operator+(const ThreeJet x, int d) {return x+double(d);}
+  friend ThreeJet operator*(const ThreeJet x, double d);
+  friend ThreeJet operator*(const ThreeJet x, int d) {return x*double(d);}
+  friend ThreeJet Sin(const ThreeJet x);
+  friend ThreeJet Cos(const ThreeJet x);
+  friend ThreeJet operator^(const ThreeJet x, double n);
+  friend ThreeJet Annihilate(const ThreeJet x, int index);
+  friend ThreeJet Interpolate(const ThreeJet v1, const ThreeJet v2, const ThreeJet weight);
+  friend void printJet(const ThreeJet);
+  friend class TwoJet D(const class ThreeJet x, int index);
+};
+
+#endif
diff --git a/modes/glx/i_threejetvec.cc b/modes/glx/i_threejetvec.cc
new file mode 100644 (file)
index 0000000..9cfcf35
--- /dev/null
@@ -0,0 +1,104 @@
+#include "i_threejetvec.h"
+ThreeJetVec operator+(ThreeJetVec v, ThreeJetVec w) {
+  ThreeJetVec result;
+  result.x = v.x + w.x;
+  result.y = v.y + w.y;
+  result.z = v.z + w.z;
+  return result;
+}
+
+ThreeJetVec operator*(ThreeJetVec v, ThreeJet  a) {
+  ThreeJetVec result;
+  result.x = v.x*a;
+  result.y = v.y*a;
+  result.z = v.z*a;
+  return result;
+}
+
+ThreeJetVec operator*(ThreeJetVec v, double a) {
+  ThreeJetVec result;
+  result.x = v.x*a;
+  result.y = v.y*a;
+  result.z = v.z*a;
+  return result;
+}
+
+ThreeJetVec AnnihilateVec(ThreeJetVec v, int index) {
+  ThreeJetVec result;
+  result.x = Annihilate(v.x, index);
+  result.y = Annihilate(v.y, index);
+  result.z = Annihilate(v.z, index);
+  return result;
+}
+
+TwoJetVec D(ThreeJetVec x, int index) {
+  TwoJetVec result;
+  result.x = D(x.x, index);
+  result.y = D(x.y, index);
+  result.z = D(x.z, index);
+  return result;
+}
+
+ThreeJetVec Cross(ThreeJetVec v, ThreeJetVec w) {
+  ThreeJetVec result;
+  result.x = v.y*w.z + v.z*w.y*-1;
+  result.y = v.z*w.x + v.x*w.z*-1;
+  result.z = v.x*w.y + v.y*w.x*-1;
+  return result;
+}
+
+ThreeJet Dot(ThreeJetVec v, ThreeJetVec w) {
+  return v.x*w.x + v.y*w.y + v.z*w.z;
+}
+
+ThreeJetVec Normalize(ThreeJetVec v) {
+  ThreeJet a;
+  a = Dot(v,v);
+  if (a > 0)
+    a = a^-0.5;
+  else
+    a = ThreeJet(0, 0, 0);
+  return v*a;
+}
+
+ThreeJetVec RotateZ(ThreeJetVec v, ThreeJet angle) {
+  ThreeJetVec result;
+  ThreeJet s,c;
+  s = Sin (angle);
+  c = Cos (angle);
+  result.x =          v.x*c + v.y*s;
+  result.y = v.x*s*-1 + v.y*c;
+  result.z = v.z;
+  return result;
+}
+
+ThreeJetVec RotateY(ThreeJetVec v, ThreeJet angle) {
+  ThreeJetVec result;
+  ThreeJet s, c;
+  s = Sin (angle);
+  c = Cos (angle);
+  result.x = v.x*c + v.z*s*-1;
+  result.y = v.y;
+  result.z = v.x*s + v.z*c    ;
+  return result;
+}
+
+ThreeJetVec RotateX(ThreeJetVec v, ThreeJet angle) {
+  ThreeJetVec result;
+  ThreeJet s,c;
+  s = Sin (angle);
+  c = Cos (angle);
+  result.x = v.x;
+  result.y = v.y*c + v.z*s;
+  result.z = v.y*s*-1 + v.z*c;
+  return result;
+}
+
+ThreeJetVec InterpolateVec(ThreeJetVec v1, ThreeJetVec v2, ThreeJet weight) {
+  return (v1) * (weight*-1 + 1) + v2*weight;
+}
+
+ThreeJet Length(ThreeJetVec v)
+{
+  return (v.x^2 + v.y^2) ^ (.5);
+}
diff --git a/modes/glx/i_threejetvec.h b/modes/glx/i_threejetvec.h
new file mode 100644 (file)
index 0000000..a57bde1
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __THREEJETVEC
+#define __THREEJETVEC
+#include "i_threejet.h"
+#include "i_twojetvec.h"
+struct ThreeJetVec {
+  ThreeJet x;
+  ThreeJet y;
+  ThreeJet z;
+  operator TwoJetVec() { return TwoJetVec(x,y,z); }
+};
+
+ThreeJetVec operator+(ThreeJetVec v, ThreeJetVec w);
+ThreeJetVec operator*(ThreeJetVec v, ThreeJet  a);
+ThreeJetVec operator*(ThreeJetVec v, double a);
+ThreeJetVec AnnihilateVec(ThreeJetVec v, int index);
+ThreeJetVec Cross(ThreeJetVec v, ThreeJetVec w);
+ThreeJet Dot(ThreeJetVec v, ThreeJetVec w);
+TwoJetVec D(ThreeJetVec x, int index);
+ThreeJetVec Normalize(ThreeJetVec v);
+ThreeJetVec RotateZ(ThreeJetVec v, ThreeJet angle);
+ThreeJetVec RotateY(ThreeJetVec v, ThreeJet angle);
+ThreeJetVec RotateX(ThreeJetVec v, ThreeJet angle);
+ThreeJetVec InterpolateVec(ThreeJetVec v1, ThreeJetVec v2, ThreeJet weight);
+ThreeJet Length(ThreeJetVec v);
+#endif
diff --git a/modes/glx/i_twojet.cc b/modes/glx/i_twojet.cc
new file mode 100644 (file)
index 0000000..7fb65be
--- /dev/null
@@ -0,0 +1,58 @@
+#include "i_twojet.h"
+
+TwoJet operator+(const TwoJet x, const TwoJet y) {
+  return TwoJet(x.f+y.f, x.fu+y.fu, x.fv+y.fv, x.fuv + y.fuv);
+}
+
+TwoJet operator*(const TwoJet x, const TwoJet y) {
+  return TwoJet(
+    x.f*y.f,
+    x.f*y.fu + x.fu*y.f,
+    x.f*y.fv + x.fv*y.f,
+    x.f*y.fuv + x.fu*y.fv + x.fv*y.fu + x.fuv*y.f
+  );
+}
+
+TwoJet operator+(const TwoJet x, double d) {
+  return TwoJet( x.f + d, x.fu, x.fv, x.fuv);
+}
+
+TwoJet operator*(const TwoJet x, double d) {
+  return TwoJet( d*x.f, d*x.fu, d*x.fv, d*x.fuv);
+}
+
+TwoJet Sin(const TwoJet x) {
+  TwoJet t = x*double(2*M_PI);
+  double s = sin(t.f);
+  double c = cos(t.f);
+  return TwoJet(s, c*t.fu, c*t.fv, c*t.fuv - s*t.fu*t.fv);
+}
+
+TwoJet Cos(const TwoJet x) {
+  TwoJet t = x*double(2*M_PI);
+  double s = cos(t.f);
+  double c = -sin(t.f);
+  return TwoJet(s, c*t.fu, c*t.fv, c*t.fuv - s*t.fu*t.fv);
+}
+
+TwoJet operator^(const TwoJet x, double n) {
+  double x0 = pow(x.f, n);
+  double x1 = (x.f == 0) ? 0 : n * x0/x.f;
+  double x2 = (x.f == 0) ? 0 : (n-1)*x1/x.f;
+  return TwoJet(x0, x1*x.fu, x1*x.fv, x1*x.fuv + x2*x.fu*x.fv);
+}
+
+TwoJet Annihilate(const TwoJet x, int index) {
+  return TwoJet(x.f, index == 1 ? x.fu : 0, index == 0 ? x.fv : 0, 0);
+}
+
+TwoJet Interpolate(const TwoJet v1, const TwoJet v2, const TwoJet weight) {
+  return (v1) * ((weight) * (-1) + 1) + v2*weight;
+}
+
+void printJet(const TwoJet v) {
+ (void) printf("%f (%f %f)\n",
+  v.f,
+  v.fu, v.fv
+ );
+}
diff --git a/modes/glx/i_twojet.h b/modes/glx/i_twojet.h
new file mode 100644 (file)
index 0000000..c7833ed
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef __TWOJET
+#define __TWOJET
+
+#ifdef STANDALONE
+#include <math.h>
+#else
+#include "xlock.h"
+#endif
+
+#if 0
+extern "C" {
+#include <stdio.h>
+#include <stdlib.h>
+}
+#endif
+
+class ThreeJet;
+class TwoJet D(const class ThreeJet x, int index);
+class TwoJet {
+  public: /* this is a hack, but needed for now */
+  double f;
+  double fu, fv;
+  double fuv;
+
+  TwoJet() {}
+  TwoJet(double d, double du, double dv)
+   { f = d; fu = du; fv = dv; fuv = 0; }
+  TwoJet(double d, double du, double dv, double duv)
+   { f = d; fu = du; fv = dv; fuv = duv; }
+  operator double() { return f; }
+  Bool operator<(double d) { return f < d; }
+  Bool operator>(double d) { return f > d; }
+  Bool operator>(int d) { return f > d; }
+  Bool operator<=(double d) { return f <= d; }
+  Bool operator>=(double d) { return f >= d; }
+  double df_du() { return fu; }
+  double df_dv() { return fv; }
+  double d2f_dudv() { return fuv; }
+  void operator +=(TwoJet x)
+   { f += x.f; fu += x.fu; fv += x.fv; fuv += x.fuv; }
+  void operator +=(double d)
+   { f += d; }
+  void operator *=(TwoJet x)
+   {
+     fuv = f*x.fuv + fu*x.fv + fv*x.fu + fuv*x.f;
+     fu = f*x.fu + fu*x.f;
+     fv = f*x.fv + fv*x.f;
+     f *= x.f;
+   }
+  void operator *=(double d)
+   { f *= d; fu *= d; fv *= d; fuv *= d; }
+  void operator %=(double d)
+   { f = fmod(f, d); if (f < 0) f += d; }
+  void operator ^=(double n)
+   {
+    if (f > 0) {
+     double x0 = pow(f, n);
+     double x1 = n * x0/f;
+     double x2 = (n-1)*x1/f;
+     fuv = x1*fuv + x2*fu*fv;
+     fu = x1*fu;
+     fv = x1*fv;
+     f = x0;
+    }
+   }
+  void Annihilate(int index)
+   { if (index == 0) fu = 0;
+     else if (index == 1) fv = 0;
+     fuv = 0;
+   }
+  void TakeSin() {
+   *this *= 2*M_PI;
+   double s = sin(f), c = cos(f);
+   f = s; fu = fu*c; fv = fv*c; fuv = c*fuv - s*fu*fv;
+  }
+  void TakeCos() {
+   *this *= 2*M_PI;
+   double s = cos(f), c = -sin(f);
+   f = s; fu = fu*c; fv = fv*c; fuv = c*fuv - s*fu*fv;
+  }
+
+  friend TwoJet operator+(const TwoJet x, const TwoJet y);
+  friend TwoJet operator*(const TwoJet x, const TwoJet y);
+  friend TwoJet operator+(const TwoJet x, double d);
+  friend TwoJet operator+(const TwoJet x, int d) {return x+double(d);}
+  friend TwoJet operator*(const TwoJet x, double d);
+  friend TwoJet operator*(const TwoJet x, int d) {return x*double(d);}
+  friend TwoJet Sin(const TwoJet x);
+  friend TwoJet Cos(const TwoJet x);
+  friend TwoJet operator^(const TwoJet x, double n);
+  friend TwoJet Annihilate(const TwoJet x, int index);
+  friend TwoJet Interpolate(const TwoJet v1, const TwoJet v2, const TwoJet weight);
+  friend void printJet(const TwoJet);
+  friend class TwoJet D(const class ThreeJet x, int index);
+};
+
+#endif
diff --git a/modes/glx/i_twojetvec.cc b/modes/glx/i_twojetvec.cc
new file mode 100644 (file)
index 0000000..48e05b0
--- /dev/null
@@ -0,0 +1,96 @@
+#include "i_twojetvec.h"
+TwoJetVec operator+(TwoJetVec v, TwoJetVec w) {
+  TwoJetVec result;
+  result.x = v.x + w.x;
+  result.y = v.y + w.y;
+  result.z = v.z + w.z;
+  return result;
+}
+
+TwoJetVec operator*(TwoJetVec v, TwoJet  a) {
+  TwoJetVec result;
+  result.x = v.x*a;
+  result.y = v.y*a;
+  result.z = v.z*a;
+  return result;
+}
+
+TwoJetVec operator*(TwoJetVec v, double a) {
+  TwoJetVec result;
+  result.x = v.x*a;
+  result.y = v.y*a;
+  result.z = v.z*a;
+  return result;
+}
+
+TwoJetVec AnnihilateVec(TwoJetVec v, int index) {
+  TwoJetVec result;
+  result.x = Annihilate(v.x, index);
+  result.y = Annihilate(v.y, index);
+  result.z = Annihilate(v.z, index);
+  return result;
+}
+
+TwoJetVec Cross(TwoJetVec v, TwoJetVec w) {
+  TwoJetVec result;
+  result.x = v.y*w.z + v.z*w.y*-1;
+  result.y = v.z*w.x + v.x*w.z*-1;
+  result.z = v.x*w.y + v.y*w.x*-1;
+  return result;
+}
+
+TwoJet Dot(TwoJetVec v, TwoJetVec w) {
+  return v.x*w.x + v.y*w.y + v.z*w.z;
+}
+
+TwoJetVec Normalize(TwoJetVec v) {
+  TwoJet a;
+  a = Dot(v,v);
+  if (a > 0)
+    a = a^-0.5;
+  else
+    a = TwoJet(0, 0, 0);
+  return v*a;
+}
+
+TwoJetVec RotateZ(TwoJetVec v, TwoJet angle) {
+  TwoJetVec result;
+  TwoJet s,c;
+  s = Sin (angle);
+  c = Cos (angle);
+  result.x =          v.x*c + v.y*s;
+  result.y = v.x*s*-1 + v.y*c;
+  result.z = v.z;
+  return result;
+}
+
+TwoJetVec RotateY(TwoJetVec v, TwoJet angle) {
+  TwoJetVec result;
+  TwoJet s, c;
+  s = Sin (angle);
+  c = Cos (angle);
+  result.x = v.x*c + v.z*s*-1;
+  result.y = v.y;
+  result.z = v.x*s + v.z*c    ;
+  return result;
+}
+
+TwoJetVec RotateX(TwoJetVec v, TwoJet angle) {
+  TwoJetVec result;
+  TwoJet s,c;
+  s = Sin (angle);
+  c = Cos (angle);
+  result.x = v.x;
+  result.y = v.y*c + v.z*s;
+  result.z = v.y*s*-1 + v.z*c;
+  return result;
+}
+
+TwoJetVec InterpolateVec(TwoJetVec v1, TwoJetVec v2, TwoJet weight) {
+  return (v1) * (weight*-1 + 1) + v2*weight;
+}
+
+TwoJet Length(TwoJetVec v)
+{
+  return (v.x^2 + v.y^2) ^ (.5);
+}
diff --git a/modes/glx/i_twojetvec.h b/modes/glx/i_twojetvec.h
new file mode 100644 (file)
index 0000000..e578fa4
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __TWOJETVEC
+#define __TWOJETVEC
+#include "i_twojet.h"
+struct TwoJetVec {
+  TwoJet x;
+  TwoJet y;
+  TwoJet z;
+  TwoJetVec() {}
+  TwoJetVec(TwoJet a, TwoJet b, TwoJet c) { x = a; y = b; z = c; }
+};
+
+TwoJetVec operator+(TwoJetVec v, TwoJetVec w);
+TwoJetVec operator*(TwoJetVec v, TwoJet  a);
+TwoJetVec operator*(TwoJetVec v, double a);
+TwoJetVec AnnihilateVec(TwoJetVec v, int index);
+TwoJetVec Cross(TwoJetVec v, TwoJetVec w);
+TwoJet Dot(TwoJetVec v, TwoJetVec w);
+TwoJetVec Normalize(TwoJetVec v);
+TwoJetVec RotateZ(TwoJetVec v, TwoJet angle);
+TwoJetVec RotateY(TwoJetVec v, TwoJet angle);
+TwoJetVec RotateX(TwoJetVec v, TwoJet angle);
+TwoJetVec InterpolateVec(TwoJetVec v1, TwoJetVec v2, TwoJet weight);
+TwoJet Length(TwoJetVec v);
+#endif
diff --git a/modes/glx/invert.c b/modes/glx/invert.c
new file mode 100644 (file)
index 0000000..5e62a6a
--- /dev/null
@@ -0,0 +1,236 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* invert --- shere inversion */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)invert.c     5.01 2001/03/01 xlockmore";
+
+#endif
+
+
+/*-
+ * invert.c - Sphere inversion
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 199?: Written
+ *
+ * Tim Rowley (code from the Geometry Center <URL:http://www.geom.umn.edu/>
+ *
+ * This is a sphere eversion of William P. Thurston which was the subject
+ * of the Geometry Center film "Outside In".  The code is based on the
+ * software which was used to create the RIB files for the film.
+ * Trying to figure it out from the full eversion is difficult.  If you get
+ * a chance to look at the original film, it leads up the eversion nicely.
+ * There is more information about the eversion, including the script from
+ * the film, at: http://www.geom.umn.edu/docs/outreach/oi/
+ *
+ * Demonstration of turning a sphere inside out without creating
+ * any kinks (two surfaces can occupy the same space at the same time).
+ *
+ * Revision History:
+ * 01-Mar-2001: Added FPS stuff E.Lassauge <lassauge@mail.dotcom.fr>
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+#include <X11/Intrinsic.h>
+#include "xlock.h"
+#include "visgl.h"
+
+#ifdef MODE_invert
+
+#include "i_linkage.h"
+#define STEPS 75
+
+ModeSpecOpt invert_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct invert_description =
+{(char *) "invert", (char *) "init_invert",
+ (char *) "draw_invert", (char *) "release_invert",
+ (char *) "draw_invert", (char *) "init_invert",
+ NULL, &invert_opts,
+ 100, 1, 1, 1, 64, 1.0, (char *) "",
+ (char *) "Shows a sphere inverted without wrinkles", 0, NULL};
+
+#endif
+
+
+static spherestruct *spheres = (spherestruct *) NULL;
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+  GLfloat     h = (GLfloat) height / (GLfloat) width;
+
+  glViewport(0, 0, (GLint) width, (GLint) height);
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+  glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  glTranslatef(0.0, 0.0, -10.0);
+
+  /* The depth buffer will be cleared, if needed, before the
+   * next frame.  Right now we just want to black the screen.
+   */
+  glClear(GL_COLOR_BUFFER_BIT);
+}
+
+
+static void
+pinit(void)
+{
+/*
+  GLfloat front_mat[] = {.8, .7, .4, 1.0};
+  GLfloat back_mat[] = {.508, .333, .774, 1.0};
+  */
+
+  GLfloat front_ambient[] = {.16, .14, .08, 1.0};
+  GLfloat front_diffuse[] = {.56, .49, .28, 1.0};
+  GLfloat front_specular[] = {1, 1, 0.8, 1.0};
+
+  GLfloat back_ambient[] = {.1016, .0666, .1548, 1.0};
+  GLfloat back_diffuse[] = {.254, .166, .387, 1.0};
+  GLfloat back_specular[] = {.4, .2, .5, 1.0};
+
+  /* spherestruct *gp = &spheres[MI_SCREEN(mi)]; */
+  static GLfloat pos[4] =
+  {5.0, 5.0, 10.0, 0.0};
+
+  glLightfv(GL_LIGHT0, GL_POSITION, pos);
+  glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
+  glEnable(GL_LIGHTING);
+  glEnable(GL_LIGHT0);
+  glEnable(GL_DEPTH_TEST);
+  glShadeModel(GL_SMOOTH);
+
+  glMaterialfv(GL_FRONT, GL_AMBIENT, front_ambient);
+  glMaterialfv(GL_FRONT, GL_DIFFUSE, front_diffuse);
+  glMaterialfv(GL_FRONT, GL_SPECULAR, front_specular);
+  glMaterialf(GL_FRONT, GL_SHININESS, 32.0);
+
+  glMaterialfv(GL_BACK, GL_AMBIENT, back_ambient);
+  glMaterialfv(GL_BACK, GL_DIFFUSE, back_diffuse);
+  glMaterialfv(GL_BACK, GL_SPECULAR, back_specular);
+  glMaterialf(GL_BACK, GL_SHININESS, 38.0);
+}
+
+static void
+free_invert(Display *display, spherestruct *gp)
+{
+  if (gp->glx_context) {
+    /* Display lists MUST be freed while their glXContext is current. */
+    glXMakeCurrent(display, gp->window, *(gp->glx_context));
+    if (glIsList(gp->frames)) {
+      glDeleteLists(gp->frames, STEPS);
+      gp->frames = 0;
+      /* Don't destroy the glXContext.  init_GL does that. */
+    }
+  }
+  if (gp->partlist != NULL) {
+    (void) free((void *) gp->partlist);
+    gp->partlist = (char *) NULL;
+  }
+}
+
+void
+init_invert(ModeInfo * mi)
+{
+  spherestruct *gp;
+
+  if (spheres == NULL) {
+    if ((spheres = (spherestruct *) calloc(MI_NUM_SCREENS(mi),
+                                          sizeof (spherestruct))) == NULL)
+      return;
+  }
+  gp = &spheres[MI_SCREEN(mi)];
+  gp->window = MI_WINDOW(mi);
+
+  gp->time = 0;
+  gp->construction = 1;
+  gp->partlist = (char *) NULL;
+  gp->numsteps = STEPS;
+  gp->view_rotx = NRAND(360);
+  gp->view_roty = NRAND(360);
+  gp->view_rotz = NRAND(360);
+  if ((gp->glx_context = init_GL(mi)) != NULL) {
+    if ((gp->frames = glGenLists(STEPS)) == 0) {
+      free_invert(MI_DISPLAY(mi), gp);
+      return;
+    }
+    reshape(MI_WIDTH(mi), MI_HEIGHT(mi));
+    pinit();
+  } else {
+    MI_CLEARWINDOW(mi);
+  }
+}
+
+void
+draw_invert(ModeInfo * mi)
+{
+  Display    *display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+  /* int         angle_incr = MI_CYCLES(mi) ? MI_CYCLES(mi) : 2; */
+  int         rot_incr = MI_COUNT(mi) ? MI_COUNT(mi) : 1;
+  spherestruct *gp;
+
+  if (spheres == NULL)
+       return;
+  gp = &spheres[MI_SCREEN(mi)];
+
+  if (!gp->glx_context)
+    return;
+
+  glDrawBuffer(GL_BACK);
+
+  glXMakeCurrent(display, window, *(gp->glx_context));
+  if (!invert_draw(gp)) {
+    free_invert(display, gp);
+    return;
+  }
+
+  /* let's do something so we don't get bored */
+  if (gp->time == STEPS-1)
+    gp->construction = 0;
+  if (gp->time == STEPS-1)
+    gp->forwards = 0;
+  if (gp->time == 0)
+    gp->forwards = 1;
+  if (gp->forwards)
+    gp->time++;
+  else
+    gp->time--;
+  gp->view_rotx = (int) (gp->view_rotx + rot_incr) % 360;
+  gp->view_roty = (int) (gp->view_roty + rot_incr) % 360;
+  gp->view_rotz = (int) (gp->view_rotz + rot_incr) % 360;
+
+  glFinish();
+  if (MI_IS_FPS(mi)) do_fps (mi);
+  glXSwapBuffers(display, window);
+}
+
+void
+release_invert(ModeInfo * mi)
+{
+  if (spheres != NULL) {
+    int         screen;
+
+    for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+       free_invert(MI_DISPLAY(mi), &spheres[screen]);
+    (void) free((void *) spheres);
+    spheres = (spherestruct *) NULL;
+  }
+  FreeAllGL(mi);
+}
+
+
+/*********************************************************/
+
+#endif /* MODE_invert */
diff --git a/modes/glx/lament.c b/modes/glx/lament.c
new file mode 100644 (file)
index 0000000..9212d43
--- /dev/null
@@ -0,0 +1,2460 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* lament --- Shows Lemarchand's Box */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)lament.c     5.01 2001/03/01 xlockmore";
+
+#endif
+
+/* xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
+
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * Revisions:
+ * 01-Mar-2001: Added FPS stuff - Eric Lassauge <lassauge@mail.dotcom.fr>
+ * 01-Nov-2000: Allocation checks
+ * 25-Jul-1998: Written by jwz
+ */
+
+/* Animates Lemarchand's Box, the Lament Configuration.
+
+   TODO:
+
+   *  The "gold" color isn't quite right; it looks more like "yellow" than
+   "gold" to me.
+
+   *  For some reason, the interior surfaces are shinier than the exterior
+   surfaces.  I don't understand why, but this should be remedied.
+
+   *  Perhaps use a slightly-bumpy or oily texture for the interior surfaces?
+
+   *  Some of the edges don't line up perfectly (since the images are not
+   perfectly symetrical.)  Something should be done about this; either
+   making the edges overlap slightly (instead of leaving gaps) or fixing
+   the images so that the edges may be symmetrical.
+
+   *  I want the gold leaf to seem to be raised up from the surface, but I
+   think this isn't possible with OpenGL.  Supposedly, OpenGL only
+   supports Gouraud shading (interpolating edge normals from face normals,
+   and shading smoothly) but bump-maps only work with Phong shading
+   (computing a normal for each rendered pixel.)
+
+   *  As far as I can tell, OpenGL doesn't do shadows.  As a result, the
+   forward-facing interior walls are drawn bright, not dark.  If it was
+   casting shadows properly, it wouldn't matter so much that the edges
+   don't quite line up, because the lines would be black, and thus not
+   visible.  But the edges don't match up, and so the bright interior
+   faces show through, and that sucks.
+
+   But apparently there are tricky ways around this:
+   http://reality.sgi.com/opengl/tips/rts/
+   I think these techniques require GLUT, however, which isn't
+   (currently) required by any other xscreensaver hacks.
+
+   *  There should be strange lighting effects playing across the surface:
+   electric sparks, or little glittery blobs of light.
+   http://reality.sgi.com/opengl/tips/lensflare/ might provide guidance.
+
+   *  Need to add some more modes, to effect the transition from the cube
+   shapes to the "spike" or "leviathan" shapes.  I have extensive notes
+   on how these transformations occur, but unfortunately, due to camera
+   trickery, the transitions require dematerializations which do not
+   preserve object volume.  But I suppose that's allowed, in
+   non-Euclidian or hyperdimensional spaces (since the extra mass could
+   simply be rotated along the axis to which one cannot point.)
+
+   The other hard thing about this is that the "leviathan" shapes contain
+   a much larger number of facets, and I modelled this whole thing by
+   hand, since I don't have any 3d-object-editing tools that I know how
+   to use (or that look like they would take any less than several months
+   to become even marginally proficient with...)
+
+   *  Perhaps there should be a table top, on which it casts a shadow?
+   And then multiple light sources (for multiple shadows)?
+
+   *  Needs music.  ("Hellraiser Themes" by Coil: TORSO CD161; also
+   duplicated on the "Unnatural History 2" compilation, WORLN M04699.)
+
+   *  I'm not totally happy with the spinning motion; I like the
+   acceleration and deceleration, but it often feels like it's going too
+   fast, or not naturally enough, or something.
+
+   *  However, the motion is better than that used by gears, superquadrics,
+   etc.; so maybe I should make them all share the same motion code.
+
+   * E.Lassauge - 28-Nov-2000:  modified release part to add freeing of GL objects
+
+   * E.Lassauge - 21-Nov-2000:  use new common xpm_to_ximage function
+
+ */
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS      "Lament"
+#define HACK_INIT      init_lament
+#define HACK_DRAW      draw_lament
+#define lament_opts    xlockmore_opts
+#define DEFAULTS       "*delay:        10000   \n"     \
+                       "*showFps:      False   \n"     \
+                       "*wireframe:    False   \n"     \
+                       "*texture:      True    \n"
+#include "xlockmore.h"
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_lament
+
+#undef countof
+#define countof(x) ((int)(sizeof((x))/sizeof((*x))))
+
+#define DEF_TEXTURE "True"
+
+static Bool do_texture;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-texture", (char *) ".lament.texture", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+texture", (char *) ".lament.texture", XrmoptionNoArg, (caddr_t) "off"},
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & do_texture, (char *) "texture", (char *) "Texture", (char *) DEF_TEXTURE, t_Bool},
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+texture", (char *) "turn on/off texturing"}
+};
+
+ModeSpecOpt lament_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   lament_description =
+{"lament", "init_lament", "draw_lament", "release_lament",
+ "draw_lament", "change_lament", NULL, &lament_opts,
+ 10000, 1, 1, 1, 64, 1.0, "",
+ "Shows Lemarchand's Box", 0, NULL};
+
+#endif
+
+#include "xpm-ximage.h"
+
+#ifdef STANDALONE
+#include "../images/lament.xpm"
+#else
+#include "pixmaps/lament.xpm"
+#endif
+
+#define RANDSIGN() ((LRAND() & 1) ? 1 : -1)
+#define FLOATRAND(a) (((double)LRAND() / (double)MAXRAND) * a)
+
+typedef enum {
+       LAMENT_BOX,
+
+       LAMENT_STAR_OUT,
+       LAMENT_STAR_ROT,
+       LAMENT_STAR_ROT_IN,
+       LAMENT_STAR_ROT_OUT,
+       LAMENT_STAR_UNROT,
+       LAMENT_STAR_IN,
+
+       LAMENT_TETRA_UNE,
+       LAMENT_TETRA_USW,
+       LAMENT_TETRA_DWN,
+       LAMENT_TETRA_DSE,
+
+       LAMENT_LID_OPEN,
+       LAMENT_LID_CLOSE,
+       LAMENT_LID_ZOOM,
+
+       LAMENT_TASER_OUT,
+       LAMENT_TASER_SLIDE,
+       LAMENT_TASER_SLIDE_IN,
+       LAMENT_TASER_IN
+
+} lament_type;
+
+static GLfloat exterior_color[] =
+{0.70, 0.60, 0.00, 1.00};
+static GLfloat interior_color[] =
+{0.25, 0.25, 0.20, 1.00};
+
+
+typedef struct {
+       GLXContext *glx_context;
+
+       GLuint      box;        /* display list IDs */
+       GLuint      star1, star2;
+       GLuint      tetra_une, tetra_usw, tetra_dwn, tetra_dse, tetra_mid;
+       GLuint      lid_0, lid_1, lid_2, lid_3, lid_4;
+       GLuint      taser_base, taser_lifter, taser_slider;
+
+       GLfloat     rotx, roty, rotz;   /* current object rotation */
+       GLfloat     dx, dy, dz; /* current rotational velocity */
+       GLfloat     ddx, ddy, ddz;      /* current rotational acceleration */
+       GLfloat     d_max;      /* max velocity */
+       XImage     *texture;    /* image bits */
+       GLuint      texids[6];  /* texture map IDs */
+       lament_type type;       /* which mode of the object is current */
+
+       int         anim_pause; /* countdown before animating again */
+       GLfloat     anim_r, anim_y, anim_z;     /* relative position during anims */
+       Window      window;
+} lament_configuration;
+
+static lament_configuration *lcs = (lament_configuration *) NULL;
+
+#define FACE_N 3
+#define FACE_S 2
+#define FACE_E 0
+#define FACE_W 4
+#define FACE_U 5
+#define FACE_D 1
+\f
+
+
+/* Computing normal vectors (thanks to Nat Friedman <ndf@mit.edu>)
+ */
+
+typedef struct vector {
+       GLfloat     x, y, z;
+} vector;
+
+typedef struct plane {
+       vector      p1, p2, p3;
+} plane;
+
+static void
+vector_set(vector * v, GLfloat x, GLfloat y, GLfloat z)
+{
+       v->x = x;
+       v->y = y;
+       v->z = z;
+}
+
+static void
+vector_cross(vector v1, vector v2, vector * v3)
+{
+       v3->x = (v1.y * v2.z) - (v1.z * v2.y);
+       v3->y = (v1.z * v2.x) - (v1.x * v2.z);
+       v3->z = (v1.x * v2.y) - (v1.y * v2.x);
+}
+
+static void
+vector_subtract(vector v1, vector v2, vector * res)
+{
+       res->x = v1.x - v2.x;
+       res->y = v1.y - v2.y;
+       res->z = v1.z - v2.z;
+}
+
+static void
+plane_normal(plane p, vector * n)
+{
+       vector      v1, v2;
+
+       vector_subtract(p.p1, p.p2, &v1);
+       vector_subtract(p.p1, p.p3, &v2);
+       vector_cross(v2, v1, n);
+}
+
+static void
+do_normal(GLfloat x1, GLfloat y1, GLfloat z1,
+         GLfloat x2, GLfloat y2, GLfloat z2,
+         GLfloat x3, GLfloat y3, GLfloat z3)
+{
+       plane       plane;
+       vector      n;
+
+       vector_set(&plane.p1, x1, y1, z1);
+       vector_set(&plane.p2, x2, y2, z2);
+       vector_set(&plane.p3, x3, y3, z3);
+       plane_normal(plane, &n);
+       n.x = -n.x;
+       n.y = -n.y;
+       n.z = -n.z;
+
+       glNormal3f(n.x, n.y, n.z);
+
+#ifdef DEBUG
+       /* Draw a line in the direction of this face's normal. */
+       {
+               GLfloat     ax = n.x > 0 ? n.x : -n.x;
+               GLfloat     ay = n.y > 0 ? n.y : -n.y;
+               GLfloat     az = n.z > 0 ? n.z : -n.z;
+               GLfloat     mx = (x1 + x2 + x3) / 3;
+               GLfloat     my = (y1 + y2 + y3) / 3;
+               GLfloat     mz = (z1 + z2 + z3) / 3;
+               GLfloat     xx, yy, zz;
+
+               GLfloat     max = ax > ay ? ax : ay;
+
+               if (az > max)
+                       max = az;
+               max *= 2;
+               xx = n.x / max;
+               yy = n.y / max;
+               zz = n.z / max;
+
+               glBegin(GL_LINE_LOOP);
+               glVertex3f(mx, my, mz);
+               glVertex3f(mx + xx, my + yy, mz + zz);
+               glEnd();
+       }
+#endif /* DEBUG */
+}
+\f
+
+
+/* Shorthand utilities for making faces, with proper normals.
+ */
+
+static void
+face3(GLint texture, GLfloat * color, Bool wire,
+                 GLfloat s1, GLfloat t1, GLfloat x1, GLfloat y1, GLfloat z1,
+                 GLfloat s2, GLfloat t2, GLfloat x2, GLfloat y2, GLfloat z2,
+                 GLfloat s3, GLfloat t3, GLfloat x3, GLfloat y3, GLfloat z3)
+{
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, texture);
+#endif /* HAVE_GLBINDTEXTURE */
+       glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color);
+       do_normal(x1, y1, z1, x2, y2, z2, x3, y3, z3);
+       glBegin(wire ? GL_LINE_LOOP : GL_TRIANGLES);
+       glTexCoord2f(s1, t1);
+       glVertex3f(x1, y1, z1);
+       glTexCoord2f(s2, t2);
+       glVertex3f(x2, y2, z2);
+       glTexCoord2f(s3, t3);
+       glVertex3f(x3, y3, z3);
+       glEnd();
+}
+
+static void
+face4(GLint texture, GLfloat * color, Bool wire,
+                 GLfloat s1, GLfloat t1, GLfloat x1, GLfloat y1, GLfloat z1,
+                 GLfloat s2, GLfloat t2, GLfloat x2, GLfloat y2, GLfloat z2,
+                 GLfloat s3, GLfloat t3, GLfloat x3, GLfloat y3, GLfloat z3,
+                 GLfloat s4, GLfloat t4, GLfloat x4, GLfloat y4, GLfloat z4)
+{
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, texture);
+#endif /* HAVE_GLBINDTEXTURE */
+       glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color);
+       do_normal(x1, y1, z1, x2, y2, z2, x3, y3, z3);
+       glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+       glTexCoord2f(s1, t1);
+       glVertex3f(x1, y1, z1);
+       glTexCoord2f(s2, t2);
+       glVertex3f(x2, y2, z2);
+       glTexCoord2f(s3, t3);
+       glVertex3f(x3, y3, z3);
+       glTexCoord2f(s4, t4);
+       glVertex3f(x4, y4, z4);
+       glEnd();
+}
+
+static void
+face5(GLint texture, GLfloat * color, Bool wire,
+                 GLfloat s1, GLfloat t1, GLfloat x1, GLfloat y1, GLfloat z1,
+                 GLfloat s2, GLfloat t2, GLfloat x2, GLfloat y2, GLfloat z2,
+                 GLfloat s3, GLfloat t3, GLfloat x3, GLfloat y3, GLfloat z3,
+                 GLfloat s4, GLfloat t4, GLfloat x4, GLfloat y4, GLfloat z4,
+                 GLfloat s5, GLfloat t5, GLfloat x5, GLfloat y5, GLfloat z5)
+{
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, texture);
+#endif /* HAVE_GLBINDTEXTURE */
+       glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color);
+       do_normal(x1, y1, z1, x2, y2, z2, x3, y3, z3);
+       glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+       glTexCoord2f(s1, t1);
+       glVertex3f(x1, y1, z1);
+       glTexCoord2f(s2, t2);
+       glVertex3f(x2, y2, z2);
+       glTexCoord2f(s3, t3);
+       glVertex3f(x3, y3, z3);
+       glTexCoord2f(s4, t4);
+       glVertex3f(x4, y4, z4);
+       glTexCoord2f(s5, t5);
+       glVertex3f(x5, y5, z5);
+       glEnd();
+}
+\f
+
+
+/* Creating object models
+ */
+
+static void
+box(ModeInfo * mi, Bool wire)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+
+       glNewList(lc->box, GL_COMPILE);
+       glShadeModel(GL_SMOOTH);
+
+       /* N */
+       face4(lc->texids[FACE_N], exterior_color, wire,
+             0.0, 0.0, -0.5, 0.5, 0.5,
+             1.0, 0.0, 0.5, 0.5, 0.5,
+             1.0, 1.0, 0.5, 0.5, -0.5,
+             0.0, 1.0, -0.5, 0.5, -0.5);
+
+       /* S */
+       face4(lc->texids[FACE_S], exterior_color, wire,
+             0.0, 0.0, -0.5, -0.5, -0.5,
+             1.0, 0.0, 0.5, -0.5, -0.5,
+             1.0, 1.0, 0.5, -0.5, 0.5,
+             0.0, 1.0, -0.5, -0.5, 0.5);
+
+       /* E */
+       face4(lc->texids[FACE_E], exterior_color, wire,
+             0.0, 0.0, 0.5, -0.5, -0.5,
+             1.0, 0.0, 0.5, 0.5, -0.5,
+             1.0, 1.0, 0.5, 0.5, 0.5,
+             0.0, 1.0, 0.5, -0.5, 0.5);
+
+       /* W */
+       face4(lc->texids[FACE_W], exterior_color, wire,
+             1.0, 1.0, -0.5, -0.5, 0.5,
+             0.0, 1.0, -0.5, 0.5, 0.5,
+             0.0, 0.0, -0.5, 0.5, -0.5,
+             1.0, 0.0, -0.5, -0.5, -0.5);
+
+       /* U */
+       face4(lc->texids[FACE_U], exterior_color, wire,
+             1.0, 0.0, 0.5, -0.5, 0.5,
+             1.0, 1.0, 0.5, 0.5, 0.5,
+             0.0, 1.0, -0.5, 0.5, 0.5,
+             0.0, 0.0, -0.5, -0.5, 0.5);
+
+       /* D */
+       face4(lc->texids[FACE_D], exterior_color, wire,
+             0.0, 1.0, -0.5, -0.5, -0.5,
+             0.0, 0.0, -0.5, 0.5, -0.5,
+             1.0, 0.0, 0.5, 0.5, -0.5,
+             1.0, 1.0, 0.5, -0.5, -0.5);
+
+       glEndList();
+}
+
+
+static void
+star(ModeInfo * mi, Bool top, Bool wire)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+       int         i;
+
+       int         points[][2] =
+       {
+               {  77,  74 }, {  60,  98 }, {   0,  71 }, {   0,   0 },    /* L1 */
+               {  60,  98 }, {  55, 127 }, {   0, 127 }, {   0,  71 },    /* L2 */
+               {  55, 127 }, {  60, 154 }, {   0, 179 }, {   0, 127 },    /* L3 */
+               {  60, 154 }, {  76, 176 }, {   0, 255 }, {   0, 179 },    /* L4 */
+               {  76, 176 }, { 100, 193 }, {  74, 255 }, {   0, 255 },    /* B1 */
+               { 100, 193 }, { 127, 198 }, { 127, 255 }, {  74, 255 },    /* B2 */
+               { 127, 198 }, { 151, 193 }, { 180, 255 }, { 127, 255 },    /* B3 */
+               { 151, 193 }, { 178, 177 }, { 255, 255 }, { 180, 255 },    /* B4 */
+               { 178, 177 }, { 193, 155 }, { 255, 181 }, { 255, 255 },    /* R4 */
+               { 193, 155 }, { 199, 127 }, { 255, 127 }, { 255, 181 },    /* R3 */
+               { 199, 127 }, { 194,  99 }, { 255,  74 }, { 255, 127 },    /* R2 */
+               { 194,  99 }, { 179,  76 }, { 255,   0 }, { 255,  74 },    /* R1 */
+               { 179,  76 }, { 155,  60 }, { 180,   0 }, { 255,   0 },    /* T4 */
+               { 155,  60 }, { 126,  55 }, { 126,   0 }, { 180,   0 },    /* T3 */
+               { 126,  55 }, { 100,  60 }, {  75,   0 }, { 126,   0 },    /* T2 */
+               { 100,  60 }, {  77,  74 }, {   0,   0 }, {  75,   0 },    /* T1 */
+       };
+
+       for (i = 0; i < countof(points); i++)
+               points[i][1] = 255 - points[i][1];
+
+       if (top)
+               glNewList(lc->star1, GL_COMPILE);
+       else
+               glNewList(lc->star2, GL_COMPILE);
+
+       if (!top)
+               glRotatef(-180.0, 1.0, 0.0, 0.0);
+
+       for (i = 0; i < countof(points) / 4; i += 2) {
+               int         j, k;
+
+               /* Top face.
+                */
+
+               GLfloat     s[4], t[4], x[4], y[4], z[4];
+
+               for (j = 3, k = 0; j >= 0; j--, k++) {
+                       GLfloat     xx = points[(i * 4) + j][0] / 255.0L;
+                       GLfloat     yy = points[(i * 4) + j][1] / 255.0L;
+
+                       s[k] = xx;
+                       t[k] = yy;
+                       x[k] = xx - 0.5;
+                       y[k] = yy - 0.5;
+                       z[k] = 0.5;
+               }
+               face4(lc->texids[top ? FACE_U : FACE_D], exterior_color, wire,
+                     s[0], t[0], x[0], y[0], z[0],
+                     s[1], t[1], x[1], y[1], z[1],
+                     s[2], t[2], x[2], y[2], z[2],
+                     s[3], t[3], x[3], y[3], z[3]);
+
+               /* Bottom face.
+                */
+               for (j = 0, k = 0; j < 4; j++, k++) {
+                       GLfloat     xx = points[(i * 4) + j][0] / 255.0L;
+                       GLfloat     yy = points[(i * 4) + j][1] / 255.0L;
+
+                       s[k] = xx;
+                       t[k] = 1.0 - yy;
+                       x[k] = xx - 0.5;
+                       y[k] = yy - 0.5;
+                       z[k] = -0.5;
+               }
+               face4(lc->texids[top ? FACE_U : FACE_D], exterior_color, wire,
+                     s[0], t[0], x[0], y[0], z[0],
+                     s[1], t[1], x[1], y[1], z[1],
+                     s[2], t[2], x[2], y[2], z[2],
+                     s[3], t[3], x[3], y[3], z[3]);
+
+               /* Connecting faces.
+                */
+               for (j = 3; j >= 0; j--) {
+                       int         l = (j == 0 ? 3 : j - 1);
+                       Bool        front_p = (j == 3);
+                       GLfloat     x1 = points[(i * 4) + j][0] / 255.0L;
+                       GLfloat     y1 = points[(i * 4) + j][1] / 255.0L;
+                       GLfloat     x2 = points[(i * 4) + l][0] / 255.0L;
+                       GLfloat     y2 = points[(i * 4) + l][1] / 255.0L;
+
+                       GLfloat     tx1 = 0.0, tx2 = 1.0, ty1 = 0.0, ty2 = 1.0;
+
+                       int         texture = 0;
+                       int         facing = i / 4;
+
+                       facing = (facing + j + 5) % 4;
+
+                       switch (facing) {
+                               case 0:
+                                       texture = FACE_W;
+                                       if (top) {
+                                               tx1 = 1.0 - y1;
+                                               tx2 = 1.0 - y2;
+                                               ty1 = 0.0;
+                                               ty2 = 1.0;
+                                       } else {
+                                               tx1 = y1;
+                                               tx2 = y2;
+                                               ty1 = 1.0;
+                                               ty2 = 0.0;
+                                       }
+                                       break;
+                               case 1:
+                                       texture = top ? FACE_S : FACE_N;
+                                       tx1 = x1;
+                                       tx2 = x2;
+                                       ty1 = 0.0;
+                                       ty2 = 1.0;
+                                       break;
+                               case 2:
+                                       texture = FACE_E;
+                                       if (top) {
+                                               tx1 = y1;
+                                               tx2 = y2;
+                                               ty1 = 0.0;
+                                               ty2 = 1.0;
+                                       } else {
+                                               tx1 = 1.0 - y1;
+                                               tx2 = 1.0 - y2;
+                                               ty1 = 1.0;
+                                               ty2 = 0.0;
+                                       }
+                                       break;
+                               case 3:
+                                       texture = top ? FACE_N : FACE_S;
+                                       tx1 = x1;
+                                       tx2 = x2;
+                                       ty1 = 1.0;
+                                       ty2 = 0.0;
+                                       break;
+                       }
+
+                       x1 -= 0.5;
+                       x2 -= 0.5;
+                       y1 -= 0.5;
+                       y2 -= 0.5;
+
+                       face4(front_p ? lc->texids[texture] : 0,
+                             front_p ? exterior_color : interior_color,
+                             wire,
+                             tx1, ty2, x1, y1, 0.5,
+                             tx1, ty1, x1, y1, -0.5,
+                             tx2, ty1, x2, y2, -0.5,
+                             tx2, ty2, x2, y2, 0.5);
+               }
+       }
+
+
+       /* Central core top cap.
+        */
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, lc->texids[top ? FACE_U : FACE_D]);
+#endif /* HAVE_GLBINDTEXTURE */
+       glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, exterior_color);
+
+       i = 1;
+       do_normal(points[i + 0][0], points[i + 0][1], 0,
+                 points[i + 4][0], points[i + 4][1], 0,
+                 points[i + 8][0], points[i + 8][1], 0);
+       glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+       for (i = 1; i < countof(points); i += 4) {
+               GLfloat     x = points[i][0] / 255.0L;
+               GLfloat     y = points[i][1] / 255.0L;
+
+               glTexCoord2f(x, y);
+               glVertex3f(x - 0.5, y - 0.5, 0.5);
+       }
+       glEnd();
+
+
+       /* Central core bottom cap.
+        */
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, 0);
+#endif /* HAVE_GLBINDTEXTURE */
+       glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, interior_color);
+
+/* Range changed from "countof(points) - 3" to avoid Stack array bounds read */
+       i = countof(points) - 9;
+       do_normal(points[i + 0][0], points[i + 0][1], 0,
+                 points[i + 4][0], points[i + 4][1], 0,
+                 points[i + 8][0], points[i + 8][1], 0);
+
+       glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+       for (i = countof(points) - 3; i >= 0; i -= 4) {
+               GLfloat     x = points[i][0] / 255.0L;
+               GLfloat     y = points[i][1] / 255.0L;
+
+               glVertex3f(x - 0.5, y - 0.5, 0);
+       }
+       glEnd();
+
+
+       /* Central core walls.
+        */
+       for (i = 1; i < countof(points); i += 4) {
+
+               GLfloat     x1 = points[i - 1][0] / 255.0L;
+               GLfloat     y1 = points[i - 1][1] / 255.0L;
+               GLfloat     x2 = points[i][0] / 255.0L;
+               GLfloat     y2 = points[i][1] / 255.0L;
+
+               face4(0, interior_color, wire,
+                     0.0, 0.0, x1 - 0.5, y1 - 0.5, 0.5,
+                     0.0, 0.0, x1 - 0.5, y1 - 0.5, 0.0,
+                     0.0, 0.0, x2 - 0.5, y2 - 0.5, 0.0,
+                     0.0, 0.0, x2 - 0.5, y2 - 0.5, 0.5);
+       }
+
+       glEndList();
+}
+
+
+static void
+tetra(ModeInfo * mi, Bool wire)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+
+       glNewList(lc->tetra_une, GL_COMPILE);
+       {
+               glShadeModel(GL_SMOOTH);
+
+               /* Ua */
+               face3(lc->texids[FACE_U], exterior_color, wire,
+                     1.0, 0.0, 0.5, -0.5, 0.5,
+                     1.0, 1.0, 0.5, 0.5, 0.5,
+                     0.0, 1.0, -0.5, 0.5, 0.5);
+
+               /* Na */
+               face3(lc->texids[FACE_N], exterior_color, wire,
+                     0.0, 0.0, -0.5, 0.5, 0.5,
+                     1.0, 0.0, 0.5, 0.5, 0.5,
+                     1.0, 1.0, 0.5, 0.5, -0.5);
+
+               /* Eb */
+               face3(lc->texids[FACE_E], exterior_color, wire,
+                     1.0, 0.0, 0.5, 0.5, -0.5,
+                     1.0, 1.0, 0.5, 0.5, 0.5,
+                     0.0, 1.0, 0.5, -0.5, 0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, 0.5, 0.5, -0.5,
+                     0.0, 0.0, 0.5, -0.5, 0.5,
+                     0.0, 0.0, -0.5, 0.5, 0.5);
+       }
+       glEndList();
+
+       glNewList(lc->tetra_usw, GL_COMPILE);
+       {
+               /* Ub */
+               face3(lc->texids[FACE_U], exterior_color, wire,
+                     0.0, 1.0, -0.5, 0.5, 0.5,
+                     0.0, 0.0, -0.5, -0.5, 0.5,
+                     1.0, 0.0, 0.5, -0.5, 0.5);
+
+               /* Sb */
+               face3(lc->texids[FACE_S], exterior_color, wire,
+                     1.0, 1.0, 0.5, -0.5, 0.5,
+                     0.0, 1.0, -0.5, -0.5, 0.5,
+                     0.0, 0.0, -0.5, -0.5, -0.5);
+
+               /* Wb */
+               face3(lc->texids[FACE_W], exterior_color, wire,
+                     1.0, 0.0, -0.5, -0.5, -0.5,
+                     1.0, 1.0, -0.5, -0.5, 0.5,
+                     0.0, 1.0, -0.5, 0.5, 0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, -0.5, -0.5, -0.5,
+                     0.0, 0.0, -0.5, 0.5, 0.5,
+                     0.0, 0.0, 0.5, -0.5, 0.5);
+       }
+       glEndList();
+
+       glNewList(lc->tetra_dwn, GL_COMPILE);
+       {
+               /* Db */
+               face3(lc->texids[FACE_D], exterior_color, wire,
+                     0.0, 1.0, -0.5, -0.5, -0.5,
+                     0.0, 0.0, -0.5, 0.5, -0.5,
+                     1.0, 0.0, 0.5, 0.5, -0.5);
+
+               /* Wa */
+               face3(lc->texids[FACE_W], exterior_color, wire,
+                     0.0, 1.0, -0.5, 0.5, 0.5,
+                     0.0, 0.0, -0.5, 0.5, -0.5,
+                     1.0, 0.0, -0.5, -0.5, -0.5);
+
+               /* Nb */
+               face3(lc->texids[FACE_N], exterior_color, wire,
+                     1.0, 1.0, 0.5, 0.5, -0.5,
+                     0.0, 1.0, -0.5, 0.5, -0.5,
+                     0.0, 0.0, -0.5, 0.5, 0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, 0.5, 0.5, -0.5,
+                     0.0, 0.0, -0.5, 0.5, 0.5,
+                     0.0, 0.0, -0.5, -0.5, -0.5);
+       }
+       glEndList();
+
+       glNewList(lc->tetra_dse, GL_COMPILE);
+       {
+               /* Sa */
+               face3(lc->texids[FACE_S], exterior_color, wire,
+                     0.0, 0.0, -0.5, -0.5, -0.5,
+                     1.0, 0.0, 0.5, -0.5, -0.5,
+                     1.0, 1.0, 0.5, -0.5, 0.5);
+
+               /* Ea */
+               face3(lc->texids[FACE_E], exterior_color, wire,
+                     0.0, 1.0, 0.5, -0.5, 0.5,
+                     0.0, 0.0, 0.5, -0.5, -0.5,
+                     1.0, 0.0, 0.5, 0.5, -0.5);
+
+               /* Da */
+               face3(lc->texids[FACE_D], exterior_color, wire,
+                     1.0, 0.0, 0.5, 0.5, -0.5,
+                     1.0, 1.0, 0.5, -0.5, -0.5,
+                     0.0, 1.0, -0.5, -0.5, -0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, 0.5, -0.5, 0.5,
+                     0.0, 0.0, 0.5, 0.5, -0.5,
+                     0.0, 0.0, -0.5, -0.5, -0.5);
+       }
+       glEndList();
+
+       glNewList(lc->tetra_mid, GL_COMPILE);
+       {
+               face3(0, interior_color, wire,
+                     0.0, 0.0, 0.5, -0.5, 0.5,
+                     0.0, 0.0, 0.5, 0.5, -0.5,
+                     0.0, 0.0, -0.5, 0.5, 0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, -0.5, 0.5, 0.5,
+                     0.0, 0.0, -0.5, -0.5, -0.5,
+                     0.0, 0.0, 0.5, -0.5, 0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, -0.5, 0.5, 0.5,
+                     0.0, 0.0, 0.5, 0.5, -0.5,
+                     0.0, 0.0, -0.5, -0.5, -0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, 0.5, 0.5, -0.5,
+                     0.0, 0.0, 0.5, -0.5, 0.5,
+                     0.0, 0.0, -0.5, -0.5, -0.5);
+
+               face3(0, interior_color, wire,
+                     0.0, 0.0, 0.5, -0.5, 0.5,
+                     0.0, 0.0, 0.5, 0.5, -0.5,
+                     0.0, 0.0, -0.5, -0.5, -0.5);
+       }
+       glEndList();
+
+}
+
+static void
+lid(ModeInfo * mi, Bool wire)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+       int         i;
+
+       int         points[][2] =
+       {
+               {128, 20},
+               {21, 129},
+               {0, 129},
+               {0, 0},
+               {128, 0},       /* L1 */
+               {21, 129},
+               {127, 234},
+               {127, 255},
+               {0, 255},
+               {0, 129},       /* L2 */
+               {127, 234},
+               {233, 127},
+               {255, 127},
+               {255, 255},
+               {127, 255},     /* R2 */
+               {233, 127},
+               {128, 20},
+               {128, 0},
+               {255, 0},
+               {255, 127},     /* R1 */
+       };
+
+       for (i = 0; i < countof(points); i++)
+               points[i][1] = 255 - points[i][1];
+
+       glNewList(lc->lid_0, GL_COMPILE);
+       glShadeModel(GL_SMOOTH);
+
+       /* N */
+       face4(lc->texids[FACE_N], exterior_color, wire,
+             0.0, 0.0, -0.5, 0.5, 0.5,
+             1.0, 0.0, 0.5, 0.5, 0.5,
+             1.0, 1.0, 0.5, 0.5, -0.5,
+             0.0, 1.0, -0.5, 0.5, -0.5);
+
+       /* S */
+       face4(lc->texids[FACE_S], exterior_color, wire,
+             0.0, 0.0, -0.5, -0.5, -0.5,
+             1.0, 0.0, 0.5, -0.5, -0.5,
+             1.0, 1.0, 0.5, -0.5, 0.5,
+             0.0, 1.0, -0.5, -0.5, 0.5);
+
+       /* E */
+       face4(lc->texids[FACE_E], exterior_color, wire,
+             0.0, 0.0, 0.5, -0.5, -0.5,
+             1.0, 0.0, 0.5, 0.5, -0.5,
+             1.0, 1.0, 0.5, 0.5, 0.5,
+             0.0, 1.0, 0.5, -0.5, 0.5);
+
+       /* U */
+       face4(lc->texids[FACE_U], exterior_color, wire,
+             1.0, 0.0, 0.5, -0.5, 0.5,
+             1.0, 1.0, 0.5, 0.5, 0.5,
+             0.0, 1.0, -0.5, 0.5, 0.5,
+             0.0, 0.0, -0.5, -0.5, 0.5);
+
+       /* D */
+       face4(lc->texids[FACE_D], exterior_color, wire,
+             0.0, 1.0, -0.5, -0.5, -0.5,
+             0.0, 0.0, -0.5, 0.5, -0.5,
+             1.0, 0.0, 0.5, 0.5, -0.5,
+             1.0, 1.0, 0.5, -0.5, -0.5);
+
+       /* W -- lid_0 */
+       for (i = 0; i < countof(points) / 5; i++) {
+               int         j;
+               GLfloat     s[5], t[5], x[5], y[5], z[5];
+
+               for (j = 0; j < 5; j++) {
+                       GLfloat     xx = points[(i * 5) + j][0] / 255.0L;
+                       GLfloat     yy = points[(i * 5) + j][1] / 255.0L;
+
+                       s[j] = 1.0 - xx;
+                       t[j] = yy;
+                       x[j] = -0.5;
+                       y[j] = xx - 0.5;
+                       z[j] = yy - 0.5;
+               }
+               face5(lc->texids[FACE_W], exterior_color, wire,
+                     s[0], t[0], x[0], y[0], z[0],
+                     s[1], t[1], x[1], y[1], z[1],
+                     s[2], t[2], x[2], y[2], z[2],
+                     s[3], t[3], x[3], y[3], z[3],
+                     s[4], t[4], x[4], y[4], z[4]);
+       }
+       glEndList();
+
+
+       /* W -- lid_1 through lid_4 */
+       for (i = 0; i < 4; i++) {
+               GLfloat     x1, y1, x2, y2, x3, y3;
+
+               glNewList(lc->lid_1 + i, GL_COMPILE);
+               glShadeModel(GL_SMOOTH);
+
+               x1 = points[(i * 5) + 1][0] / 255.0L;
+               y1 = points[(i * 5) + 1][1] / 255.0L;
+               x2 = points[(i * 5)][0] / 255.0L;
+               y2 = points[(i * 5)][1] / 255.0L;
+               x3 = 0.5;
+               y3 = 0.5;
+
+               /* Outer surface */
+               face3(lc->texids[FACE_W], exterior_color, wire,
+                     1.0 - x1, y1, -0.5, x1 - 0.5, y1 - 0.5,
+                     1.0 - x2, y2, -0.5, x2 - 0.5, y2 - 0.5,
+                     1.0 - x3, y3, -0.5, x3 - 0.5, y3 - 0.5);
+
+               /* Inner surface */
+               face3(0, interior_color, wire,
+                     0.0, 0.0, -0.48, x2 - 0.5, y2 - 0.5,
+                     0.0, 0.0, -0.48, x1 - 0.5, y1 - 0.5,
+                     0.0, 0.0, -0.48, x3 - 0.5, y3 - 0.5);
+
+               /* Lip 1 */
+               face4(0, interior_color, wire,
+                     0.0, 0.0, -0.5, x1 - 0.5, y1 - 0.5,
+                     0.0, 0.0, -0.5, x3 - 0.5, y3 - 0.5,
+                     0.0, 0.0, -0.48, x3 - 0.5, y3 - 0.5,
+                     0.0, 0.0, -0.48, x1 - 0.5, y1 - 0.5);
+
+               /* Lip 2 */
+               face4(0, interior_color, wire,
+                     0.0, 0.0, -0.48, x2 - 0.5, y2 - 0.5,
+                     0.0, 0.0, -0.48, x3 - 0.5, y3 - 0.5,
+                     0.0, 0.0, -0.5, x3 - 0.5, y3 - 0.5,
+                     0.0, 0.0, -0.5, x2 - 0.5, y2 - 0.5);
+
+               glEndList();
+       }
+}
+
+static void
+taser(ModeInfo * mi, Bool wire)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+       int         i;
+
+       int         slider_face_points[][2] =
+       {
+               {86, 58},
+               {38, 106},
+               {70, 106},
+               {118, 58},
+               {-1, -1},       /* a */
+               {136, 58},
+               {184, 106},
+               {216, 106},
+               {168, 58},
+               {-1, -1},       /* b */
+               {38, 106},
+               {0, 144},
+               {0, 190},
+               {60, 190},
+               {108, 106},     /* c */
+               {144, 106},
+               {194, 190},
+               {254, 190},
+               {254, 144},
+               {216, 106},     /* d */
+               {98, 124},
+               {60, 190},
+               {92, 190},
+               {126, 158},
+               {126, 124},     /* e */
+               {126, 124},
+               {126, 158},
+               {160, 190},
+               {194, 190},
+               {154, 124},     /* f */
+               {22, 190},
+               {22, 254},
+               {60, 254},
+               {60, 190},
+               {-1, -1},       /* g */
+               {194, 190},
+               {194, 254},
+               {230, 254},
+               {230, 190},
+               {-1, -1},       /* h */
+               {60, 190},
+               {60, 210},
+               {92, 210},
+               {92, 190},
+               {-1, -1},       /* i */
+               {160, 190},
+               {160, 210},
+               {194, 210},
+               {194, 190},
+               {-1, -1},       /* j */
+               {110, 172},
+               {92, 190},
+               {110, 190},
+               {-1, -1},
+               {-1, -1},       /* k */
+               {140, 172},
+               {140, 190},
+               {160, 190},
+               {-1, -1},
+               {-1, -1},       /* l */
+               {110, 172},
+               {140, 172},
+               {126, 156},
+               {-1, -1},
+               {-1, -1},       /* m */
+       };
+
+       int         body_face_points[][2] =
+       {
+               {0, 0},
+               {0, 58},
+               {254, 58},
+               {254, 0},
+               {-1, -1},       /* A */
+               {0, 58},
+               {0, 144},
+               {86, 58},
+               {-1, -1},
+               {-1, -1},       /* B */
+               {168, 58},
+               {254, 144},
+               {254, 58},
+               {-1, -1},
+               {-1, -1},       /* C */
+               {118, 58},
+               {70, 106},
+               {184, 106},
+               {136, 58},
+               {-1, -1},       /* F */
+               {108, 106},
+               {98, 124},
+               {154, 124},
+               {144, 106},
+               {-1, -1},       /* G */
+       };
+
+       int         lifter_face_points[][2] =
+       {
+               {0, 190},
+               {0, 254},
+               {22, 254},
+               {22, 190},
+               {-1, -1},       /* D */
+               {230, 190},
+               {230, 254},
+               {254, 254},
+               {254, 190},
+               {-1, -1},       /* E */
+               {60, 210},
+               {60, 254},
+               {194, 254},
+               {194, 210},
+               {-1, -1},       /* H */
+               {92, 190},
+               {92, 210},
+               {160, 210},
+               {160, 190},
+               {-1, -1},       /* I */
+               {110, 172},
+               {110, 190},
+               {140, 190},
+               {140, 172},
+               {-1, -1},       /* J */
+       };
+
+       int         body_perimiter_points[][2] =
+       {
+               {0, 144},
+               {86, 59},
+               {119, 58},
+               {71, 107},
+               {108, 107},
+               {98, 124},
+               {155, 124},
+               {144, 107},
+               {185, 106},
+               {136, 59},
+               {169, 59},
+               {255, 145},
+               {255, 0},
+               {0, 0},
+       };
+
+       int         slider_perimiter_points[][2] =
+       {
+               {86, 58},
+               {0, 144},
+               {0, 190},
+               {22, 190},
+               {22, 254},
+               {60, 254},
+               {60, 210},
+               {92, 210},
+               {92, 190},
+               {110, 190},
+               {110, 172},
+               {140, 172},
+               {140, 190},
+               {160, 190},
+               {160, 210},
+               {194, 210},
+               {194, 254},
+               {230, 254},
+               {230, 190},
+               {254, 190},
+               {254, 144},
+               {168, 58},
+               {136, 58},
+               {184, 106},
+               {144, 106},
+               {154, 124},
+               {98, 124},
+               {108, 106},
+               {70, 106},
+               {118, 58},
+       };
+
+       int         lifter_perimiter_points_1[][2] =
+       {
+               {0, 189},
+               {0, 254},
+               {22, 255},
+               {23, 190},
+       };
+
+       int         lifter_perimiter_points_2[][2] =
+       {
+               {230, 254},
+               {255, 255},
+               {254, 190},
+               {230, 190},
+       };
+
+       int         lifter_perimiter_points_3[][2] =
+       {
+               {60, 254},
+               {194, 254},
+               {194, 211},
+               {160, 210},
+               {160, 190},
+               {140, 191},
+               {141, 172},
+               {111, 172},
+               {110, 190},
+               {93, 190},
+               {92, 210},
+               {60, 211},
+       };
+
+       for (i = 0; i < countof(slider_face_points); i++)
+               slider_face_points[i][1] = 255 - slider_face_points[i][1];
+       for (i = 0; i < countof(body_face_points); i++)
+               body_face_points[i][1] = 255 - body_face_points[i][1];
+       for (i = 0; i < countof(lifter_face_points); i++)
+               lifter_face_points[i][1] = 255 - lifter_face_points[i][1];
+       for (i = 0; i < countof(body_perimiter_points); i++)
+               body_perimiter_points[i][1] = 255 - body_perimiter_points[i][1];
+       for (i = 0; i < countof(slider_perimiter_points); i++)
+               slider_perimiter_points[i][1] = 255 - slider_perimiter_points[i][1];
+       for (i = 0; i < countof(lifter_perimiter_points_1); i++)
+               lifter_perimiter_points_1[i][1] = 255 - lifter_perimiter_points_1[i][1];
+       for (i = 0; i < countof(lifter_perimiter_points_2); i++)
+               lifter_perimiter_points_2[i][1] = 255 - lifter_perimiter_points_2[i][1];
+       for (i = 0; i < countof(lifter_perimiter_points_3); i++)
+               lifter_perimiter_points_3[i][1] = 255 - lifter_perimiter_points_3[i][1];
+
+       /* -------------------------------------------------------------------- */
+
+       glNewList(lc->taser_base, GL_COMPILE);
+       glShadeModel(GL_SMOOTH);
+
+       /* N */
+       face4(lc->texids[FACE_N], exterior_color, wire,
+             0.0, 0.0, -0.5, 0.5, 0.5,
+             0.75, 0.0, 0.25, 0.5, 0.5,
+             0.75, 0.75, 0.25, 0.5, -0.25,
+             0.0, 0.75, -0.5, 0.5, -0.25);
+
+       /* S */
+       face4(lc->texids[FACE_S], exterior_color, wire,
+             0.0, 0.25, -0.5, -0.5, -0.25,
+             0.75, 0.25, 0.25, -0.5, -0.25,
+             0.75, 1.0, 0.25, -0.5, 0.5,
+             0.0, 1.0, -0.5, -0.5, 0.5);
+
+       /* interior E */
+       face4(0, interior_color, wire,
+             0.0, 0.0, 0.25, -0.5, -0.25,
+             1.0, 0.0, 0.25, 0.5, -0.25,
+             1.0, 1.0, 0.25, 0.5, 0.5,
+             0.0, 1.0, 0.25, -0.5, 0.5);
+
+       /* W */
+       face4(lc->texids[FACE_W], exterior_color, wire,
+             1.0, 1.0, -0.5, -0.5, 0.5,
+             0.0, 1.0, -0.5, 0.5, 0.5,
+             0.0, 0.25, -0.5, 0.5, -0.25,
+             1.0, 0.25, -0.5, -0.5, -0.25);
+
+       /* U */
+       face4(lc->texids[FACE_U], exterior_color, wire,
+             0.75, 0.0, 0.25, -0.5, 0.5,
+             0.75, 1.0, 0.25, 0.5, 0.5,
+             0.0, 1.0, -0.5, 0.5, 0.5,
+             0.0, 0.0, -0.5, -0.5, 0.5);
+
+       /* interior D */
+       face4(0, interior_color, wire,
+             0.0, 1.0, -0.5, -0.5, -0.25,
+             0.0, 0.0, -0.5, 0.5, -0.25,
+             1.0, 0.0, 0.25, 0.5, -0.25,
+             1.0, 1.0, 0.25, -0.5, -0.25);
+
+       /* Top face */
+       for (i = 0; i < countof(body_face_points) / 5; i++) {
+               int         j;
+
+#ifdef HAVE_GLBINDTEXTURE
+               glBindTexture(GL_TEXTURE_2D, lc->texids[FACE_E]);
+#endif /* HAVE_GLBINDTEXTURE */
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, exterior_color);
+
+               do_normal(0, body_face_points[(i * 5) + 0][0], body_face_points[(i * 5) + 0][1],
+                         0, body_face_points[(i * 5) + 1][0], body_face_points[(i * 5) + 1][1],
+                         0, body_face_points[(i * 5) + 2][0], body_face_points[(i * 5) + 2][1]
+                       );
+               glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+               for (j = 0; j < 5; j++) {
+                       int         ix = body_face_points[(i * 5) + j][0];
+                       int         iy = body_face_points[(i * 5) + j][1];
+                       GLfloat     x, y;
+
+                       if (ix == -1)   /* these are padding: ignore them */
+                               continue;
+                       x = ix / 255.0L;
+                       y = iy / 255.0L;
+                       glTexCoord2f(x, y);
+                       glVertex3f(0.5, x - 0.5, y - 0.5);
+               }
+               glEnd();
+       }
+
+       /* Side walls */
+       for (i = 0; i < countof(body_perimiter_points); i++) {
+               int         j = (i + 1 >= countof(body_perimiter_points) ? 0 : i + 1);
+               GLfloat     x1 = body_perimiter_points[i][0] / 255.0;
+               GLfloat     y1 = body_perimiter_points[i][1] / 255.0;
+               GLfloat     x2 = body_perimiter_points[j][0] / 255.0;
+               GLfloat     y2 = body_perimiter_points[j][1] / 255.0;
+               int         texture = -1;
+               GLfloat     s1 = 0, t1 = 0, s2 = 0, t2 = 0, s3 = 0, t3 = 0,
+                           s4 = 0, t4 = 0;
+
+               if (i == 11) {
+                       texture = lc->texids[FACE_N];
+                       s1 = 1.0;
+                       t1 = 0.0;
+                       s2 = 1.0;
+                       t2 = 0.568;
+                       s3 = 0.75, t3 = 0.568;
+                       s4 = 0.75;
+                       t4 = 0.0;
+               } else if (i == 12) {
+                       texture = lc->texids[FACE_U];
+                       s1 = 1.0;
+                       t1 = 0.0;
+                       s2 = 1.0;
+                       t2 = 1.0;
+                       s3 = 0.75, t3 = 1.0;
+                       s4 = 0.75;
+                       t4 = 0.0;
+               } else if (i == 13) {
+                       texture = lc->texids[FACE_S];
+                       s1 = 1.0;
+                       t1 = 0.437;
+                       s2 = 1.0;
+                       t2 = 1.0;
+                       s3 = 0.75;
+                       t3 = 1.0;
+                       s4 = 0.75;
+                       t4 = 0.437;
+               }
+               face4((texture == -1 ? 0 : texture),
+                     (texture == -1 ? interior_color : exterior_color),
+                     wire,
+                     s1, t1, 0.5, x2 - 0.5, y2 - 0.5,
+                     s2, t2, 0.5, x1 - 0.5, y1 - 0.5,
+                     s3, t3, 0.25, x1 - 0.5, y1 - 0.5,
+                     s4, t4, 0.25, x2 - 0.5, y2 - 0.5);
+       }
+
+       glEndList();
+
+       /* -------------------------------------------------------------------- */
+
+       glNewList(lc->taser_lifter, GL_COMPILE);
+       glShadeModel(GL_SMOOTH);
+
+       /* N */
+       face4(lc->texids[FACE_N], exterior_color, wire,
+             0.0, 0.75, -0.5, 0.5, -0.25,
+             0.75, 0.75, 0.25, 0.5, -0.25,
+             0.75, 1.0, 0.25, 0.5, -0.5,
+             0.0, 1.0, -0.5, 0.5, -0.5);
+
+       /* S */
+       face4(lc->texids[FACE_S], exterior_color, wire,
+             0.0, 0.0, -0.5, -0.5, -0.5,
+             0.75, 0.0, 0.25, -0.5, -0.5,
+             0.75, 0.25, 0.25, -0.5, -0.25,
+             0.0, 0.25, -0.5, -0.5, -0.25);
+
+       /* interior E */
+       face4(0, interior_color, wire,
+             0.0, 1.0, 0.25, -0.5, -0.5,
+             1.0, 1.0, 0.25, 0.5, -0.5,
+             1.0, 0.0, 0.25, 0.5, -0.25,
+             0.0, 0.0, 0.25, -0.5, -0.25);
+
+       /* W */
+       face4(lc->texids[FACE_W], exterior_color, wire,
+             1.0, 0.25, -0.5, -0.5, -0.25,
+             0.0, 0.25, -0.5, 0.5, -0.25,
+             0.0, 0.0, -0.5, 0.5, -0.5,
+             1.0, 0.0, -0.5, -0.5, -0.5);
+
+       /* interior U */
+       face4(0, interior_color, wire,
+             1.0, 0.0, 0.25, -0.5, -0.25,
+             1.0, 1.0, 0.25, 0.5, -0.25,
+             0.0, 1.0, -0.5, 0.5, -0.25,
+             0.0, 0.0, -0.5, -0.5, -0.25);
+
+       /* D */
+       face4(lc->texids[FACE_D], exterior_color, wire,
+             0.0, 1.0, -0.5, -0.5, -0.5,
+             0.0, 0.0, -0.5, 0.5, -0.5,
+             0.75, 0.0, 0.25, 0.5, -0.5,
+             0.75, 1.0, 0.25, -0.5, -0.5);
+
+
+       /* Top face */
+       for (i = 0; i < countof(lifter_face_points) / 5; i++) {
+               int         j;
+
+#ifdef HAVE_GLBINDTEXTURE
+               glBindTexture(GL_TEXTURE_2D, lc->texids[FACE_E]);
+#endif /* HAVE_GLBINDTEXTURE */
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, exterior_color);
+
+               do_normal(
+                                0, lifter_face_points[(i * 5) + 0][0], lifter_face_points[(i * 5) + 0][1],
+                                0, lifter_face_points[(i * 5) + 1][0], lifter_face_points[(i * 5) + 1][1],
+                                0, lifter_face_points[(i * 5) + 2][0], lifter_face_points[(i * 5) + 2][1]);
+
+               glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+               for (j = 0; j < 5; j++) {
+                       int         ix = lifter_face_points[(i * 5) + j][0];
+                       int         iy = lifter_face_points[(i * 5) + j][1];
+                       GLfloat     x, y;
+
+                       if (ix == -1)   /* these are padding: ignore them */
+                               continue;
+                       x = ix / 255.0L;
+                       y = iy / 255.0L;
+                       glTexCoord2f(x, y);
+                       glVertex3f(0.5, x - 0.5, y - 0.5);
+               }
+               glEnd();
+       }
+
+       /* Side walls */
+       for (i = 0; i < countof(lifter_perimiter_points_1); i++) {
+               int         j = (i + 1 >= countof(lifter_perimiter_points_1) ? 0 : i + 1);
+               GLfloat     x1 = lifter_perimiter_points_1[i][0] / 255.0;
+               GLfloat     y1 = lifter_perimiter_points_1[i][1] / 255.0;
+               GLfloat     x2 = lifter_perimiter_points_1[j][0] / 255.0;
+               GLfloat     y2 = lifter_perimiter_points_1[j][1] / 255.0;
+               int         texture = -1;
+               GLfloat     s1 = 0, t1 = 0, s2 = 0, t2 = 0, s3 = 0, t3 = 0,
+                           s4 = 0, t4 = 0;
+
+               if (i == 0) {
+                       texture = lc->texids[FACE_S];
+                       s1 = 1.0;
+                       t1 = 0.0;
+                       s2 = 1.0;
+                       t2 = 0.26;
+                       s3 = 0.75, t3 = 0.26;
+                       s4 = 0.75;
+                       t4 = 0.0;
+               } else if (i == 1) {
+                       texture = lc->texids[FACE_D];
+                       s1 = 1.0;
+                       t1 = 0.914;
+                       s2 = 1.0;
+                       t2 = 1.0;
+                       s3 = 0.75;
+                       t3 = 1.0;
+                       s4 = 0.75;
+                       t4 = 0.914;
+               }
+               face4((texture == -1 ? 0 : texture),
+                     (texture == -1 ? interior_color : exterior_color),
+                     wire,
+                     s1, t1, 0.5, x2 - 0.5, y2 - 0.5,
+                     s2, t2, 0.5, x1 - 0.5, y1 - 0.5,
+                     s3, t3, 0.25, x1 - 0.5, y1 - 0.5,
+                     s4, t4, 0.25, x2 - 0.5, y2 - 0.5);
+       }
+
+       for (i = 0; i < countof(lifter_perimiter_points_2); i++) {
+               int         j = (i + 1 >= countof(lifter_perimiter_points_2) ? 0 : i + 1);
+               GLfloat     x1 = lifter_perimiter_points_2[i][0] / 255.0;
+               GLfloat     y1 = lifter_perimiter_points_2[i][1] / 255.0;
+               GLfloat     x2 = lifter_perimiter_points_2[j][0] / 255.0;
+               GLfloat     y2 = lifter_perimiter_points_2[j][1] / 255.0;
+               int         texture = -1;
+               GLfloat     s1 = 0, t1 = 0, s2 = 0, t2 = 0, s3 = 0, t3 = 0,
+                           s4 = 0, t4 = 0;
+
+               if (i == 0) {
+                       texture = lc->texids[FACE_D];
+                       s1 = 1.0;
+                       t1 = 0.0;
+                       s2 = 1.0;
+                       t2 = 0.095;
+                       s3 = 0.75;
+                       t3 = 0.095;
+                       s4 = 0.75;
+                       t4 = 0.0;
+               } else if (i == 1) {
+                       texture = lc->texids[FACE_N];
+                       s1 = 1.0;
+                       t1 = 0.745;
+                       s2 = 1.0;
+                       t2 = 1.0;
+                       s3 = 0.75;
+                       t3 = 1.0;
+                       s4 = 0.75;
+                       t4 = 0.745;
+               }
+               face4((texture == -1 ? 0 : texture),
+                     (texture == -1 ? interior_color : exterior_color),
+                     wire,
+                     s1, t1, 0.5, x2 - 0.5, y2 - 0.5,
+                     s2, t2, 0.5, x1 - 0.5, y1 - 0.5,
+                     s3, t3, 0.25, x1 - 0.5, y1 - 0.5,
+                     s4, t4, 0.25, x2 - 0.5, y2 - 0.5);
+       }
+
+       for (i = 0; i < countof(lifter_perimiter_points_3); i++) {
+               int         j = (i + 1 >= countof(lifter_perimiter_points_3) ? 0 : i + 1);
+               GLfloat     x1 = lifter_perimiter_points_3[i][0] / 255.0;
+               GLfloat     y1 = lifter_perimiter_points_3[i][1] / 255.0;
+               GLfloat     x2 = lifter_perimiter_points_3[j][0] / 255.0;
+               GLfloat     y2 = lifter_perimiter_points_3[j][1] / 255.0;
+               int         texture = -1;
+               GLfloat     s1 = 0, t1 = 0, s2 = 0, t2 = 0, s3 = 0, t3 = 0,
+                           s4 = 0, t4 = 0;
+
+               if (i == 0) {
+                       texture = lc->texids[FACE_D];
+                       s1 = 1.0;
+                       t1 = 0.235;
+                       s2 = 1.0;
+                       t2 = 0.765;
+                       s3 = 0.75;
+                       t3 = 0.765;
+                       s4 = 0.75;
+                       t4 = 0.235;
+               }
+               face4((texture == -1 ? 0 : texture),
+                     (texture == -1 ? interior_color : exterior_color),
+                     wire,
+                     s1, t1, 0.5, x2 - 0.5, y2 - 0.5,
+                     s2, t2, 0.5, x1 - 0.5, y1 - 0.5,
+                     s3, t3, 0.25, x1 - 0.5, y1 - 0.5,
+                     s4, t4, 0.25, x2 - 0.5, y2 - 0.5);
+       }
+
+       glEndList();
+
+       /* -------------------------------------------------------------------- */
+
+       glNewList(lc->taser_slider, GL_COMPILE);
+       glShadeModel(GL_SMOOTH);
+
+       /* Top face */
+       for (i = 0; i < countof(slider_face_points) / 5; i++) {
+               int         j;
+
+#ifdef HAVE_GLBINDTEXTURE
+               glBindTexture(GL_TEXTURE_2D, lc->texids[FACE_E]);
+#endif /* HAVE_GLBINDTEXTURE */
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, exterior_color);
+
+               do_normal(
+                                0, slider_face_points[(i * 5) + 0][0], slider_face_points[(i * 5) + 0][1],
+                                0, slider_face_points[(i * 5) + 1][0], slider_face_points[(i * 5) + 1][1],
+                                0, slider_face_points[(i * 5) + 2][0], slider_face_points[(i * 5) + 2][1]);
+               glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+               for (j = 0; j < 5; j++) {
+                       int         ix = slider_face_points[(i * 5) + j][0];
+                       int         iy = slider_face_points[(i * 5) + j][1];
+                       GLfloat     x, y;
+
+                       if (ix == -1)   /* these are padding: ignore them */
+                               continue;
+                       x = ix / 255.0L;
+                       y = iy / 255.0L;
+                       glTexCoord2f(x, y);
+                       glVertex3f(0.5, x - 0.5, y - 0.5);
+               }
+               glEnd();
+       }
+
+       /* Bottom face */
+       for (i = countof(slider_face_points) / 5 - 1; i >= 0; i--) {
+               int         j;
+
+#ifdef HAVE_GLBINDTEXTURE
+               glBindTexture(GL_TEXTURE_2D, 0);
+#endif /* HAVE_GLBINDTEXTURE */
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, interior_color);
+
+               do_normal(
+                                0, slider_face_points[(i * 5) + 2][0], slider_face_points[(i * 5) + 2][1],
+                                0, slider_face_points[(i * 5) + 1][0], slider_face_points[(i * 5) + 1][1],
+                                0, slider_face_points[(i * 5) + 0][0], slider_face_points[(i * 5) + 0][1]);
+               glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+               for (j = 4; j >= 0; j--) {
+                       int         ix = slider_face_points[(i * 5) + j][0];
+                       int         iy = slider_face_points[(i * 5) + j][1];
+                       GLfloat     x, y;
+
+                       if (ix == -1)   /* these are padding: ignore them */
+                               continue;
+                       x = ix / 255.0L;
+                       y = iy / 255.0L;
+                       glTexCoord2f(x, y);
+                       glVertex3f(0.25, x - 0.5, y - 0.5);
+               }
+               glEnd();
+       }
+
+       /* Side walls */
+       for (i = 0; i < countof(slider_perimiter_points); i++) {
+               int         j = (i + 1 >= countof(slider_perimiter_points) ? 0 : i + 1);
+               GLfloat     x1 = slider_perimiter_points[i][0] / 255.0;
+               GLfloat     y1 = slider_perimiter_points[i][1] / 255.0;
+               GLfloat     x2 = slider_perimiter_points[j][0] / 255.0;
+               GLfloat     y2 = slider_perimiter_points[j][1] / 255.0;
+               int         texture = -1;
+               GLfloat     s1 = 0, t1 = 0, s2 = 0, t2 = 0, s3 = 0, t3 = 0,
+                           s4 = 0, t4 = 0;
+
+               if (i == 1) {
+                       texture = lc->texids[FACE_S];
+                       s1 = 1.0;
+                       t1 = 0.255;
+                       s2 = 1.0;
+                       t2 = 0.435;
+                       s3 = 0.75;
+                       t3 = 0.435;
+                       s4 = 0.75;
+                       t4 = 0.255;
+               } else if (i == 4) {
+                       texture = lc->texids[FACE_D];
+                       s1 = 1.0;
+                       t1 = 0.758;
+                       s2 = 1.0;
+                       t2 = 0.915;
+                       s3 = 0.75;
+                       t3 = 0.915;
+                       s4 = 0.75;
+                       t4 = 0.758;
+               } else if (i == 16) {
+                       texture = lc->texids[FACE_D];
+                       s1 = 1.0;
+                       t1 = 0.095;
+                       s2 = 1.0;
+                       t2 = 0.24;
+                       s3 = 0.75;
+                       t3 = 0.24;
+                       s4 = 0.75;
+                       t4 = 0.095;
+               } else if (i == 19) {
+                       texture = lc->texids[FACE_N];
+                       s1 = 1.0;
+                       t1 = 0.568;
+                       s2 = 1.0;
+                       t2 = 0.742;
+                       s3 = 0.75;
+                       t3 = 0.742;
+                       s4 = 0.75;
+                       t4 = 0.568;
+               }
+               face4((texture == -1 ? 0 : texture),
+                     (texture == -1 ? interior_color : exterior_color),
+                     wire,
+                     s1, t1, 0.5, x2 - 0.5, y2 - 0.5,
+                     s2, t2, 0.5, x1 - 0.5, y1 - 0.5,
+                     s3, t3, 0.25, x1 - 0.5, y1 - 0.5,
+                     s4, t4, 0.25, x2 - 0.5, y2 - 0.5);
+       }
+
+       glEndList();
+}
+\f
+
+
+/* Rendering and animating object models
+ */
+
+static void
+draw(ModeInfo * mi)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+       Bool        wire = MI_IS_WIREFRAME(mi);
+
+       if (!wire)
+               glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+       else
+               glClear(GL_COLOR_BUFFER_BIT);
+
+       glPushMatrix();
+       {
+               GLfloat     x = lc->rotx;
+               GLfloat     y = lc->roty;
+               GLfloat     z = lc->rotz;
+
+#if 0
+               x = 0.75;
+               y = 0;
+               z = 0;
+#endif
+
+               if (x < 0)
+                       x = 1 - (x + 1);
+               if (y < 0)
+                       y = 1 - (y + 1);
+               if (z < 0)
+                       z = 1 - (z + 1);
+
+               /* Make into the screen be +Y right be +X, and up be +Z. */
+               glRotatef(-90.0, 1.0, 0.0, 0.0);
+
+               /* Scale it up. */
+               glScalef(4.0, 4.0, 4.0);
+
+#ifdef DEBUG
+               glPushMatrix();
+               {
+                       /* Shift to the upper left, and draw the vanilla box. */
+                       glTranslatef(-0.6, 0.0, 0.6);
+
+                       /* Apply rotation to the object. */
+                       glRotatef(x * 360, 1.0, 0.0, 0.0);
+                       glRotatef(y * 360, 0.0, 1.0, 0.0);
+                       glRotatef(z * 360, 0.0, 0.0, 1.0);
+
+                       /* Draw it. */
+                       glCallList(lc->box);
+               }
+               glPopMatrix();
+
+               /* Shift to the lower right, and draw the animated object. */
+               glTranslatef(0.6, 0.0, -0.6);
+#endif /* DEBUG */
+
+
+               glPushMatrix();
+               {
+                       /* Apply rotation to the object. */
+                       glRotatef(x * 360, 1.0, 0.0, 0.0);
+                       glRotatef(y * 360, 0.0, 1.0, 0.0);
+                       glRotatef(z * 360, 0.0, 0.0, 1.0);
+
+                       switch (lc->type) {
+                               case LAMENT_BOX:
+                                       glCallList(lc->box);
+                                       break;
+
+                               case LAMENT_STAR_OUT:
+                               case LAMENT_STAR_ROT:
+                               case LAMENT_STAR_ROT_IN:
+                               case LAMENT_STAR_ROT_OUT:
+                               case LAMENT_STAR_UNROT:
+                               case LAMENT_STAR_IN:
+                                       glTranslatef(0.0, 0.0, lc->anim_z / 2);
+                                       glRotatef(lc->anim_r / 2, 0.0, 0.0, 1.0);
+                                       glCallList(lc->star1);
+
+                                       glTranslatef(0.0, 0.0, -lc->anim_z);
+                                       glRotatef(-lc->anim_r, 0.0, 0.0, 1.0);
+                                       glCallList(lc->star2);
+                                       break;
+
+                               case LAMENT_TETRA_UNE:
+                               case LAMENT_TETRA_USW:
+                               case LAMENT_TETRA_DWN:
+                               case LAMENT_TETRA_DSE:
+                                       {
+                                               unsigned int         magic;
+                                               GLfloat     tx, ty, tz;
+
+                                               switch (lc->type) {
+                                                       case LAMENT_TETRA_UNE:
+                                                               magic = lc->tetra_une;
+                                                               tx = 1.0;
+                                                               ty = 1.0;
+                                                               tz = 1.0;
+                                                               break;
+                                                       case LAMENT_TETRA_USW:
+                                                               magic = lc->tetra_usw;
+                                                               tx = 1.0;
+                                                               ty = 1.0;
+                                                               tz = -1.0;
+                                                               break;
+                                                       case LAMENT_TETRA_DWN:
+                                                               magic = lc->tetra_dwn;
+                                                               tx = 1.0;
+                                                               ty = -1.0;
+                                                               tz = 1.0;
+                                                               break;
+                                                       case LAMENT_TETRA_DSE:
+                                                               magic = lc->tetra_dse;
+                                                               tx = -1.0;
+                                                               ty = 1.0;
+                                                               tz = 1.0;
+                                                               break;
+                                                       default:
+                                                               abort();
+                                                               break;
+                                               }
+                                               glCallList(lc->tetra_mid);
+                                               if (magic != lc->tetra_une)
+                                                       glCallList(lc->tetra_une);
+                                               if (magic != lc->tetra_usw)
+                                                       glCallList(lc->tetra_usw);
+                                               if (magic != lc->tetra_dwn)
+                                                       glCallList(lc->tetra_dwn);
+                                               if (magic != lc->tetra_dse)
+                                                       glCallList(lc->tetra_dse);
+                                               glRotatef(lc->anim_r, tx, ty, tz);
+                                               glCallList(magic);
+                                       }
+                                       break;
+
+                               case LAMENT_LID_OPEN:
+                               case LAMENT_LID_CLOSE:
+                               case LAMENT_LID_ZOOM:
+                                       {
+                                               GLfloat     d = 0.417;
+
+                                               glTranslatef(lc->anim_z, 0.0, 0.0);
+
+                                               glCallList(lc->lid_0);
+
+                                               glPushMatrix();
+                                               glTranslatef(-0.5, -d, 0.0);
+                                               glRotatef(-lc->anim_r, 0.0, -1.0, -1.0);
+                                               glTranslatef(0.5, d, 0.0);
+                                               glCallList(lc->lid_1);
+                                               glPopMatrix();
+                                               glPushMatrix();
+                                               glTranslatef(-0.5, -d, 0.0);
+                                               glRotatef(lc->anim_r, 0.0, -1.0, 1.0);
+                                               glTranslatef(0.5, d, 0.0);
+                                               glCallList(lc->lid_2);
+                                               glPopMatrix();
+                                               glPushMatrix();
+                                               glTranslatef(-0.5, d, 0.0);
+                                               glRotatef(lc->anim_r, 0.0, -1.0, -1.0);
+                                               glTranslatef(0.5, -d, 0.0);
+                                               glCallList(lc->lid_3);
+                                               glPopMatrix();
+                                               glPushMatrix();
+                                               glTranslatef(-0.5, d, 0.0);
+                                               glRotatef(-lc->anim_r, 0.0, -1.0, 1.0);
+                                               glTranslatef(0.5, -d, 0.0);
+                                               glCallList(lc->lid_4);
+                                               glPopMatrix();
+                                       }
+                                       break;
+
+                               case LAMENT_TASER_OUT:
+                               case LAMENT_TASER_SLIDE:
+                               case LAMENT_TASER_SLIDE_IN:
+                               case LAMENT_TASER_IN:
+
+                                       glTranslatef(-lc->anim_z / 2, 0.0, 0.0);
+                                       glCallList(lc->taser_base);
+
+                                       glTranslatef(lc->anim_z, 0.0, 0.0);
+                                       glCallList(lc->taser_lifter);
+
+                                       glTranslatef(0.0, 0.0, lc->anim_y);
+                                       glCallList(lc->taser_slider);
+                                       break;
+
+                               default:
+                                       abort();
+                                       break;
+                       }
+               }
+               glPopMatrix();
+
+       }
+       glPopMatrix();
+}
+
+
+static void
+animate(ModeInfo * mi)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+       int         pause1 = 10;
+
+/*  int pause2 = 60; */
+       int         pause3 = 120;
+
+       switch (lc->type) {
+               case LAMENT_BOX:
+                       {
+                               /* Rather than just picking states randomly, pick an ordering randomly,
+                                  do it, and then re-randomize.  That way one can be assured of seeing
+                                  all states in a short time period, though not always in the same
+                                  order (it's frustrating to see it pick the same state 5x in a row.)
+                                */
+                               static lament_type states[] =
+                               {
+                                       LAMENT_STAR_OUT, LAMENT_STAR_OUT,
+                                       LAMENT_TETRA_UNE, LAMENT_TETRA_USW,
+                                       LAMENT_TETRA_DWN, LAMENT_TETRA_DSE,
+                                       LAMENT_LID_OPEN, LAMENT_LID_OPEN, LAMENT_LID_OPEN,
+                                       LAMENT_TASER_OUT, LAMENT_TASER_OUT,
+                                       LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX,
+                                       LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX,
+                               };
+                               static int  state = countof(states);
+
+                               if (state < countof(states)) {
+                                       lc->type = states[state++];
+                               } else {
+                                       int         i;
+
+                                       state = 0;
+                                       for (i = 0; i < countof(states); i++) {
+                                               int         a = LRAND() % countof(states);
+                                               lament_type swap = states[a];
+
+                                               states[a] = states[i];
+                                               states[i] = swap;
+                                       }
+                               }
+
+                               if (lc->type == LAMENT_BOX)
+                                       lc->anim_pause = pause3;
+
+                               lc->anim_r = 0.0;
+                               lc->anim_y = 0.0;
+                               lc->anim_z = 0.0;
+                       }
+                       break;
+
+                       /* -------------------------------------------------------------- */
+
+               case LAMENT_STAR_OUT:
+                       lc->anim_z += 0.01;
+                       if (lc->anim_z >= 1.0) {
+                               lc->anim_z = 1.0;
+                               lc->type = LAMENT_STAR_ROT;
+                               lc->anim_pause = pause1;
+                       }
+                       break;
+
+               case LAMENT_STAR_ROT:
+                       lc->anim_r += 1.0;
+                       if (lc->anim_r >= 45.0) {
+                               lc->anim_r = 45.0;
+                               lc->type = LAMENT_STAR_ROT_IN;
+                               lc->anim_pause = pause1;
+                       }
+                       break;
+
+               case LAMENT_STAR_ROT_IN:
+                       lc->anim_z -= 0.01;
+                       if (lc->anim_z <= 0.0) {
+                               lc->anim_z = 0.0;
+                               lc->type = LAMENT_STAR_ROT_OUT;
+                               lc->anim_pause = pause3 * (1 + (LRAND() % 4) + (LRAND() % 4));
+                       }
+                       break;
+
+               case LAMENT_STAR_ROT_OUT:
+                       lc->anim_z += 0.01;
+                       if (lc->anim_z >= 1.0) {
+                               lc->anim_z = 1.0;
+                               lc->type = LAMENT_STAR_UNROT;
+                               lc->anim_pause = pause1;
+                       }
+                       break;
+
+               case LAMENT_STAR_UNROT:
+                       lc->anim_r -= 1.0;
+                       if (lc->anim_r <= 0.0) {
+                               lc->anim_r = 0.0;
+                               lc->type = LAMENT_STAR_IN;
+                               lc->anim_pause = pause1;
+                       }
+                       break;
+
+               case LAMENT_STAR_IN:
+                       lc->anim_z -= 0.01;
+                       if (lc->anim_z <= 0.0) {
+                               lc->anim_z = 0.0;
+                               lc->type = LAMENT_BOX;
+                               lc->anim_pause = pause3;
+                       }
+                       break;
+
+                       /* -------------------------------------------------------------- */
+
+               case LAMENT_TETRA_UNE:
+               case LAMENT_TETRA_USW:
+               case LAMENT_TETRA_DWN:
+               case LAMENT_TETRA_DSE:
+
+                       lc->anim_r += 1.0;
+                       if (lc->anim_r >= 360.0) {
+                               lc->anim_r = 0.0;
+                               lc->type = LAMENT_BOX;
+                               lc->anim_pause = pause3;
+                       } else if (lc->anim_r > 119.0 && lc->anim_r <= 120.0) {
+                               lc->anim_r = 120.0;
+                               lc->anim_pause = pause1;
+                       } else if (lc->anim_r > 239.0 && lc->anim_r <= 240.0) {
+                               lc->anim_r = 240.0;
+                               lc->anim_pause = pause1;
+                       }
+                       break;
+
+                       /* -------------------------------------------------------------- */
+
+               case LAMENT_LID_OPEN:
+                       lc->anim_r += 1.0;
+
+                       if (lc->anim_r >= 112.0) {
+                               GLfloat     hysteresis = 0.05;
+
+                               lc->anim_r = 112.0;
+                               lc->anim_z = 0.0;
+                               lc->anim_pause = pause3;
+
+                               if (lc->rotx >= -hysteresis &&
+                                   lc->rotx <= hysteresis &&
+                                   ((lc->rotz >= (0.25 - hysteresis) &&
+                                     lc->rotz <= (0.25 + hysteresis)) ||
+                                    (lc->rotz >= (-0.25 - hysteresis) &&
+                                     lc->rotz <= (-0.25 + hysteresis)))) {
+                                       lc->type = LAMENT_LID_ZOOM;
+                                       lc->rotx = 0.00;
+                                       lc->rotz = (lc->rotz < 0 ? -0.25 : 0.25);
+                               } else {
+                                       lc->type = LAMENT_LID_CLOSE;
+                               }
+                       }
+                       break;
+
+               case LAMENT_LID_CLOSE:
+                       lc->anim_r -= 1.0;
+                       if (lc->anim_r <= 0.0) {
+                               lc->anim_r = 0.0;
+                               lc->type = LAMENT_BOX;
+                               lc->anim_pause = pause3;
+                       }
+                       break;
+
+               case LAMENT_LID_ZOOM:
+                       lc->anim_z -= 0.1;
+                       if (lc->anim_z < -50.0) {
+                               lc->anim_r = 0.0;
+                               lc->anim_z = 0.0;
+                               lc->rotx = FLOATRAND(1.0) * RANDSIGN();
+                               lc->roty = FLOATRAND(1.0) * RANDSIGN();
+                               lc->rotz = FLOATRAND(1.0) * RANDSIGN();
+                               lc->type = LAMENT_BOX;
+                       }
+                       break;
+
+                       /* -------------------------------------------------------------- */
+
+               case LAMENT_TASER_OUT:
+                       lc->anim_z += 0.0025;
+                       if (lc->anim_z >= 0.25) {
+                               lc->anim_z = 0.25;
+                               lc->type = LAMENT_TASER_SLIDE;
+                               lc->anim_pause = pause1 * (1 + (LRAND() % 5) + (LRAND() % 5));
+                       }
+                       break;
+
+               case LAMENT_TASER_SLIDE:
+                       lc->anim_y += 0.0025;
+                       if (lc->anim_y >= 0.23) {
+                               lc->anim_y = 0.23;
+                               lc->type = LAMENT_TASER_SLIDE_IN;
+                               lc->anim_pause = pause3 * (1 + (LRAND() % 5) + (LRAND() % 5));
+                       }
+                       break;
+
+               case LAMENT_TASER_SLIDE_IN:
+                       lc->anim_y -= 0.0025;
+                       if (lc->anim_y <= 0.0) {
+                               lc->anim_y = 0.0;
+                               lc->type = LAMENT_TASER_IN;
+                               lc->anim_pause = pause1;
+                       }
+                       break;
+
+               case LAMENT_TASER_IN:
+                       lc->anim_z -= 0.0025;
+                       if (lc->anim_z <= 0.0) {
+                               lc->anim_z = 0.0;
+                               lc->type = LAMENT_BOX;
+                               lc->anim_pause = pause3;
+                       }
+                       break;
+
+               default:
+                       abort();
+                       break;
+       }
+}
+
+
+static void
+rotate(GLfloat * pos, GLfloat * v, GLfloat * dv, GLfloat max_v)
+{
+       double      ppos = *pos;
+
+       /* tick position */
+       if (ppos < 0)
+               ppos = -(ppos + *v);
+       else
+               ppos += *v;
+
+       if (ppos > 1.0)
+               ppos -= 1.0;
+       else if (ppos < 0)
+               ppos += 1.0;
+
+       if (ppos < 0)
+               abort();
+       if (ppos > 1.0)
+               abort();
+       *pos = (*pos > 0 ? ppos : -ppos);
+
+       /* accelerate */
+       *v += *dv;
+
+       /* clamp velocity */
+       if (*v > max_v || *v < -max_v) {
+               *dv = -*dv;
+       }
+       /* If it stops, start it going in the other direction. */
+       else if (*v < 0) {
+               if (LRAND() % 4) {
+                       *v = 0;
+
+                       /* keep going in the same direction */
+                       if (LRAND() % 2)
+                               *dv = 0;
+                       else if (*dv < 0)
+                               *dv = -*dv;
+               } else {
+                       /* reverse gears */
+                       *v = -*v;
+                       *dv = -*dv;
+                       *pos = -*pos;
+               }
+       }
+       /* Alter direction of rotational acceleration randomly. */
+       if (!(LRAND() % 120))
+               *dv = -*dv;
+
+       /* Change acceleration very occasionally. */
+       if (!(LRAND() % 200)) {
+               if (*dv == 0)
+                       *dv = 0.00001;
+               else if (LRAND() & 1)
+                       *dv *= 1.2;
+               else
+                       *dv *= 0.8;
+       }
+}
+\f
+
+
+/* Window management, etc
+ */
+
+static void
+reshape(int width, int height)
+{
+       int         target_size = 180;
+       int         win_size = (width > height ? height : width);
+       GLfloat     h = (GLfloat) height / (GLfloat) width;
+
+       glViewport(0, 0, (GLint) width, (GLint) height);
+
+/*  glViewport(-600, -600, 1800, 1800); */
+
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
+       glMatrixMode(GL_MODELVIEW);
+       glLoadIdentity();
+       glTranslatef(0.0, 0.0, -40.0);
+
+       /* This scale makes the box take up most of the window */
+       glScalef(2.0, 2.0, 2.0);
+
+       /* But if the window is more than a little larger than our target size,
+          scale the object back down, so that the bits drawn on the screen end
+          up rougly target_size across (actually it ends up a little larger.)
+          Note that the image-map bits we have are 128x128.  Therefore, if the
+          image is magnified a lot, it looks pretty blocky.  So it's better to
+          have a 128x128 animation on a 1280x1024 screen that looks good, than
+          a 1024x1024 animation that looks really pixellated.
+        */
+       if (win_size > target_size * 1.5) {
+               GLfloat     ratio = ((GLfloat) target_size / (GLfloat) win_size);
+
+               ratio *= 2.0;
+               glScalef(ratio, ratio, ratio);
+       }
+       /* The depth buffer will be cleared, if needed, before the
+        * next frame.  Right now we just want to black the screen.
+        */
+       glClear(GL_COLOR_BUFFER_BIT);
+}
+
+static void
+free_lament(Display *display, lament_configuration *lc)
+{
+       if (lc->glx_context) {
+               glXMakeCurrent(display, lc->window, *(lc->glx_context));
+               if (glIsList(lc->box)) {
+                       glDeleteLists(lc->box, 16);
+                       lc->box = 0;
+               }
+       }
+       if (lc->texture != NULL) {
+               int i;
+
+               for (i = 0; i < 6; i++)
+                       glDeleteTextures(1, &lc->texids[i]);
+               XDestroyImage(lc->texture);
+               lc->texture = (XImage *) NULL;
+       }
+}
+
+static Bool
+gl_init(ModeInfo * mi)
+{
+       lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+       Bool        wire = MI_IS_WIREFRAME(mi);
+
+       if (wire)
+               do_texture = False;
+
+       if (!wire) {
+               static GLfloat pos0[] =
+               {-4.0, 2.0, 5.0, 1.0};
+               static GLfloat pos1[] =
+               {12.0, 5.0, 1.0, 1.0};
+               static GLfloat local[] =
+               {0.0};
+               static GLfloat ambient[] =
+               {0.3, 0.3, 0.3, 1.0};
+               static GLfloat spec[] =
+               {1.0, 1.0, 1.0, 1.0};
+               static GLfloat shine[] =
+               {100.0};
+
+               glLightfv(GL_LIGHT0, GL_POSITION, pos0);
+               glLightfv(GL_LIGHT1, GL_POSITION, pos1);
+
+               glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+               glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
+
+               glLightfv(GL_LIGHT0, GL_SPECULAR, spec);
+               glLightfv(GL_LIGHT1, GL_SPECULAR, spec);
+
+               glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local);
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, exterior_color);
+               glMaterialfv(GL_FRONT, GL_SPECULAR, spec);
+               glMaterialfv(GL_FRONT, GL_SHININESS, shine);
+
+               glEnable(GL_LIGHTING);
+               glEnable(GL_LIGHT0);
+               glEnable(GL_LIGHT1);
+               glDisable(GL_LIGHT1);
+
+               glEnable(GL_DEPTH_TEST);
+               glEnable(GL_TEXTURE_2D);
+               glEnable(GL_NORMALIZE);
+               glEnable(GL_CULL_FACE);
+       }
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       if (do_texture) {
+#ifdef HAVE_GLBINDTEXTURE
+               int         i;
+#if ((XMESA_MAJOR_VERSION < 3 ) || (( XMESA_MAJOR_VERSION == 3 ) && (XMESA_MINOR_VERSION == 0 )))
+               /* E.Lassauge - 11/23/98
+                * It looks like there's a bug in MESA (up to 3.1beta1) for the
+                * "Default" texture (named '0'). For this texture
+                * I added a glBindTexture and the same glTexParameteri
+                * as for the specific textures. Now it does'nt core
+                * anymore.
+                *
+                * 22-mar-99 for latest version of Mesa this codes wipes
+                * out the structure on the sides of the cube. Leaving the code
+                * out did not crash the mode on my VMS system.
+                *      Jouk
+                */
+               glBindTexture(GL_TEXTURE_2D, 0);
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, interior_color);
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+               glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+               glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+#endif /* MESA */
+
+               for (i = 0; i < 6; i++)
+                       glGenTextures(1, &lc->texids[i]);
+                if ((lc->texture = xpm_to_ximage(MI_DISPLAY(mi), MI_VISUAL(mi),
+                               MI_COLORMAP(mi), lament_faces)) == None) {
+                       (void) fprintf(stderr, "unable to parse xpm data.\n");
+                       for (i = 0; i < 6; i++)
+                               glDeleteTextures(1, &lc->texids[i]);
+                       do_texture = False;
+               }
+               else
+               {
+
+                 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+                 glPixelStorei(GL_UNPACK_ROW_LENGTH, lc->texture->width);
+
+                 for (i = 0; i < 6; i++) {
+                       int         height = lc->texture->width;        /* assume square */
+
+                       glBindTexture(GL_TEXTURE_2D, lc->texids[i]);
+                       glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, exterior_color);
+                       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                                    lc->texture->width, height, 0,
+                                    GL_RGBA, GL_UNSIGNED_BYTE,
+                                    (lc->texture->data +
+                               (lc->texture->bytes_per_line * height * i)));
+
+                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                       glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+                       glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
+                 }
+               }
+
+#else /* !HAVE_GLBINDTEXTURE */
+               (void) fprintf(stderr,
+               "this version of GL does not support multiple texture maps.\n"
+                              "\tGet OpenGL 1.1.\n");
+               return True;
+#endif /* !HAVE_GLBINDTEXTURE */
+       }
+#endif
+       if ((lc->box = glGenLists(16)) == 0) {
+               free_lament(MI_DISPLAY(mi), lc);
+               return False;
+       }
+       lc->star1 = lc->box + 1;
+       lc->star2 = lc->box + 2;
+       lc->tetra_une = lc->box + 3;
+       lc->tetra_usw = lc->box + 4;
+       lc->tetra_dwn = lc->box + 5;
+       lc->tetra_dse = lc->box + 6;
+       lc->tetra_mid = lc->box + 7;
+       lc->lid_0 = lc->box + 8;
+       lc->lid_1 = lc->box + 9;
+       lc->lid_2 = lc->box + 10;
+       lc->lid_3 = lc->box + 11;
+       lc->lid_4 = lc->box + 12;
+       lc->taser_base = lc->box + 13;
+       lc->taser_lifter = lc->box + 14;
+       lc->taser_slider = lc->box + 15;
+
+       box(mi, wire);
+       star(mi, True, wire);
+       star(mi, False, wire);
+       tetra(mi, wire);
+       lid(mi, wire);
+       taser(mi, wire);
+       return True;
+}
+
+
+void
+init_lament(ModeInfo * mi)
+{
+       lament_configuration *lc;
+
+       if (lcs == NULL) {
+               if ((lcs = (lament_configuration *) calloc(MI_NUM_SCREENS(mi),
+                                sizeof (lament_configuration))) == NULL) {
+                       (void) fprintf(stderr, "out of memory\n");
+                       return;
+               }
+       }
+       lc = &lcs[MI_SCREEN(mi)];
+       lc->window = MI_WINDOW(mi);
+
+       lc->rotx = FLOATRAND(1.0) * RANDSIGN();
+       lc->roty = FLOATRAND(1.0) * RANDSIGN();
+       lc->rotz = FLOATRAND(1.0) * RANDSIGN();
+
+       /* bell curve from 0-1.5 degrees, avg 0.75 */
+       lc->dx = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360 * 2);
+       lc->dy = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360 * 2);
+       lc->dz = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360 * 2);
+
+       lc->d_max = lc->dx * 2;
+
+       lc->ddx = 0.00006 + FLOATRAND(0.00003);
+       lc->ddy = 0.00006 + FLOATRAND(0.00003);
+       lc->ddz = 0.00006 + FLOATRAND(0.00003);
+
+       lc->ddx = 0.00001;
+       lc->ddy = 0.00001;
+       lc->ddz = 0.00001;
+
+       lc->type = LAMENT_BOX;
+       lc->anim_pause = 300 + (LRAND() % 100);
+
+       if ((lc->glx_context = init_GL(mi)) != NULL) {
+               reshape(MI_WIDTH(mi), MI_HEIGHT(mi));
+               if (!gl_init(mi)) {
+                       MI_CLEARWINDOW(mi);
+               }
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+
+void
+draw_lament(ModeInfo * mi)
+{
+       static int  tick = 0;
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       lament_configuration *lc;
+
+       if (lcs == NULL)
+               return;
+       lc = &lcs[MI_SCREEN(mi)];
+
+       if (!lc->glx_context)
+               return;
+
+       glDrawBuffer(GL_BACK);
+
+       glXMakeCurrent(display, window, *(lc->glx_context));
+       draw(mi);
+        if (MI_IS_FPS(mi)) do_fps (mi);
+       glFinish();
+       glXSwapBuffers(display, window);
+
+       if (lc->type != LAMENT_LID_ZOOM) {
+               rotate(&lc->rotx, &lc->dx, &lc->ddx, lc->d_max);
+               rotate(&lc->roty, &lc->dy, &lc->ddy, lc->d_max);
+               rotate(&lc->rotz, &lc->dz, &lc->ddz, lc->d_max);
+       }
+       if (lc->anim_pause)
+               lc->anim_pause--;
+       else
+               animate(mi);
+
+       if (++tick > 500) {
+               tick = 0;
+               reshape(MI_WIDTH(mi), MI_HEIGHT(mi));
+       }
+}
+
+void
+change_lament(ModeInfo * mi)
+{
+       lament_configuration *lc;
+
+       if (lcs == NULL)
+               return;
+       lc = &lcs[MI_SCREEN(mi)];
+
+       if (!lc->glx_context)
+               return;
+       /* probably something needs to be added here */
+}
+
+void
+release_lament(ModeInfo * mi)
+{
+       if (lcs != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_lament(MI_DISPLAY(mi), &lcs[screen]);
+               (void) free((void *) lcs);
+               lcs = (lament_configuration *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+#endif
diff --git a/modes/glx/moebius.c b/modes/glx/moebius.c
new file mode 100644 (file)
index 0000000..6728a99
--- /dev/null
@@ -0,0 +1,861 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* moebius --- Moebius Strip II, an Escher-like GL scene with ants. */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)moebius.c    5.01 2001/03/01 xlockmore";
+
+#endif
+
+#undef DEBUG_LISTS
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The RotateAroundU() routine was adapted from the book
+ *    "Computer Graphics Principles and Practice
+ *     Foley - vanDam - Feiner - Hughes
+ *     Second Edition" Pag. 227, exercise 5.15.
+ *
+ * This mode shows some interesting scenes that are impossible OR very
+ * wierd to build in the real universe. Much of the scenes are inspirated
+ * on Mauritz Cornelis Escher's works which derivated the mode's name.
+ * M.C. Escher (1898-1972) was a dutch artist and many people prefer to
+ * say he was a mathematician.
+ *
+ * Thanks goes to Brian Paul for making it possible and inexpensive to use
+ * OpenGL at home.
+ *
+ * Since I'm not a native English speaker, my apologies for any grammatical
+ * mistakes.
+ *
+ * My e-mail address is
+ * m-vianna@usa.net
+ *
+ * Marcelo F. Vianna (Jun-01-1997)
+ *
+ * Revision History:
+ * 01-Mar-2001: backported from xscreensaver by lassauge@mail.dotcom.fr
+ *    Feb-2001: Made motion and rotation be smoother Jamie Zawinski
+ *              <jwz@jwz.org>
+ * 01-Nov-2000: Allocation checks
+ * 01-Jan-1998: Mode separated from escher and renamed
+ * 08-Jun-1997: New scene implemented: "Impossible Cage" based in a M.C.
+ *              Escher's painting with the same name (quite similar). The
+ *              first GL mode to use texture mapping.
+ *              The "Impossible Cage" scene doesn't use DEPTH BUFFER, the
+ *              wood planks are drawn consistently using GL_CULL_FACE, and
+ *              the painter's algorithm is used to sort the planks.
+ *              Marcelo F. Vianna.
+ * 07-Jun-1997: Speed ups in Moebius Strip using GL_CULL_FACE.
+ *              Marcelo F. Vianna.
+ * 03-Jun-1997: Initial Release (Only one scene: "Moebius Strip")
+ *              The Moebius Strip scene was inspirated in a M.C. Escher's
+ *              painting named Moebius Strip II in wich ants walk across a
+ *              Moebius Strip path, sometimes meeting each other and sometimes
+ *              being in "opposite faces" (note that the moebius strip has
+ *              only one face and one edge).
+ *              Marcelo F. Vianna.
+ */
+
+/*-
+ * Texture mapping is only available on RGBA contexts, Mono and color index
+ * visuals DO NOT support texture mapping in OpenGL.
+ *
+ * BUT Mesa do implements RGBA contexts in pseudo color visuals, so texture
+ * mapping shuld work on PseudoColor, DirectColor, TrueColor using Mesa. Mono
+ * is not officially supported for both OpenGL and Mesa, but seems to not crash
+ * Mesa.
+ *
+ * In real OpenGL, PseudoColor DO NOT support texture map (as far as I know).
+ */
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+# define PROGCLASS                     "Moebius"
+# define HACK_INIT                     init_moebius
+# define HACK_DRAW                     draw_moebius
+# define HACK_RESHAPE                  reshape_moebius
+# define moebius_opts                  xlockmore_opts
+# define DEFAULTS                      "*cycles:       1       \n"     \
+                                       "*delay:        20000   \n"     \
+                                       "*showFps:      False   \n"     \
+                                       "*wireframe:    False   \n"
+# include "xlockmore.h"                /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+# include "xlock.h"            /* from the xlockmore distribution */
+# include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_moebius
+
+#include <GL/glu.h>
+#include "e_textures.h"
+
+#define DEF_SOLIDMOEBIUS  "False"
+#define DEF_NOANTS  "False"
+
+static int  solidmoebius;
+static int  noants;
+
+static XrmOptionDescRec opts[] =
+{
+  {(char *) "-solidmoebius", (char *) ".moebius.solidmoebius", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+solidmoebius", (char *) ".moebius.solidmoebius", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-noants", (char *) ".moebius.noants", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+noants", (char *) ".moebius.noants", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+  {(caddr_t *) & solidmoebius, (char *) "solidmoebius", (char *) "Solidmoebius", (char *) DEF_SOLIDMOEBIUS, t_Bool},
+  {(caddr_t *) & noants, (char *) "noants", (char *) "Noants", (char *) DEF_NOANTS, t_Bool}
+
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+solidmoebius", (char *) "select between a SOLID or a NET Moebius Strip"},
+       {(char *) "-/+noants", (char *) "turn on/off walking ants"}
+};
+
+ModeSpecOpt moebius_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   moebius_description =
+{"moebius", "init_moebius", "draw_moebius", "release_moebius",
+ "draw_moebius", "change_moebius", NULL, &moebius_opts,
+ 1000, 1, 1, 1, 4, 1.0, "",
+ "Shows Moebius Strip II, an Escher-like GL scene with ants", 0, NULL};
+
+#endif
+
+#define Scale4Window               0.3
+#define Scale4Iconic               0.4
+
+#define sqr(A)                     ((A)*(A))
+
+#ifndef Pi
+#define Pi                         M_PI
+#endif
+
+#define ObjMoebiusStrip 0
+#define ObjAntBody      1
+#define MaxObj          2
+
+/*************************************************************************/
+
+typedef struct {
+       GLint       WindH, WindW;
+       GLfloat     step;
+       GLfloat     ant_position;
+       Bool        AreObjectsDefined[MaxObj];
+       GLXContext *glx_context;
+
+  GLfloat rotx, roty, rotz;       /* current object rotation */
+  GLfloat dx, dy, dz;             /* current rotational velocity */
+  GLfloat ddx, ddy, ddz;          /* current rotational acceleration */
+  GLfloat d_max;                          /* max velocity */
+
+} moebiusstruct;
+
+static float front_shininess[] =
+{60.0};
+static float front_specular[] =
+{0.7, 0.7, 0.7, 1.0};
+static float ambient[] =
+{0.0, 0.0, 0.0, 1.0};
+static float diffuse[] =
+{1.0, 1.0, 1.0, 1.0};
+static float position0[] =
+{1.0, 1.0, 1.0, 0.0};
+static float position1[] =
+{-1.0, -1.0, 1.0, 0.0};
+static float lmodel_ambient[] =
+{0.5, 0.5, 0.5, 1.0};
+static float lmodel_twoside[] =
+{GL_TRUE};
+
+static float MaterialRed[] =
+{0.7, 0.0, 0.0, 1.0};
+static float MaterialGreen[] =
+{0.1, 0.5, 0.2, 1.0};
+static float MaterialBlue[] =
+{0.0, 0.0, 0.7, 1.0};
+static float MaterialCyan[] =
+{0.2, 0.5, 0.7, 1.0};
+static float MaterialYellow[] =
+{0.7, 0.7, 0.0, 1.0};
+static float MaterialMagenta[] =
+{0.6, 0.2, 0.5, 1.0};
+static float MaterialWhite[] =
+{0.7, 0.7, 0.7, 1.0};
+static float MaterialGray[] =
+{0.2, 0.2, 0.2, 1.0};
+static float MaterialGray5[] =
+{0.5, 0.5, 0.5, 1.0};
+static float MaterialGray6[] =
+{0.6, 0.6, 0.6, 1.0};
+static float MaterialGray8[] =
+{0.8, 0.8, 0.8, 1.0};
+
+static moebiusstruct *moebius = (moebiusstruct *) NULL;
+static GLuint objects = 0;
+
+#define NUM_SCENES      2
+
+static Bool
+mySphere(float radius)
+{
+       GLUquadricObj *quadObj;
+
+       if ((quadObj = gluNewQuadric()) == 0)
+               return False;
+       gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
+       gluSphere(quadObj, radius, 16, 16);
+       gluDeleteQuadric(quadObj);
+       return True;
+}
+
+static Bool
+myCone(float radius)
+{
+       GLUquadricObj *quadObj;
+
+       if ((quadObj = gluNewQuadric()) == 0)
+               return False;
+       gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
+       gluCylinder(quadObj, radius, 0, radius * 3, 8, 1);
+       gluDeleteQuadric(quadObj);
+       return True;
+}
+
+static Bool
+draw_moebius_ant(moebiusstruct * mp, float *Material, int mono)
+{
+       static float ant_step = 0;
+       float       cos1 = cos(ant_step);
+       float       cos2 = cos(ant_step + 2 * Pi / 3);
+       float       cos3 = cos(ant_step + 4 * Pi / 3);
+       float       sin1 = sin(ant_step);
+       float       sin2 = sin(ant_step + 2 * Pi / 3);
+       float       sin3 = sin(ant_step + 4 * Pi / 3);
+
+       if (mono)
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray5);
+       else
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Material);
+       if (!mp->AreObjectsDefined[ObjAntBody]) {
+               glNewList(objects + ObjAntBody, GL_COMPILE_AND_EXECUTE);
+               if (glGetError() != GL_NO_ERROR) {
+                       return False;
+               }
+               glEnable(GL_CULL_FACE);
+               glPushMatrix();
+               glScalef(1, 1.3, 1);
+               if (!mySphere(0.18))
+                       return False;
+               glScalef(1, 1 / 1.3, 1);
+               glTranslatef(0.00, 0.30, 0.00);
+               if (!mySphere(0.2))
+                       return False;
+
+               glTranslatef(-0.05, 0.17, 0.05);
+               glRotatef(-90, 1, 0, 0);
+               glRotatef(-25, 0, 1, 0);
+               if (!myCone(0.05))
+                       return False;
+               glTranslatef(0.00, 0.10, 0.00);
+               if (!myCone(0.05))
+                       return False;
+               glRotatef(25, 0, 1, 0);
+               glRotatef(90, 1, 0, 0);
+
+               glScalef(1, 1.3, 1);
+               glTranslatef(0.15, -0.65, 0.05);
+               if (!mySphere(0.25))
+                       return False;
+               glScalef(1, 1 / 1.3, 1);
+               glPopMatrix();
+               glDisable(GL_CULL_FACE);
+               glEndList();
+               mp->AreObjectsDefined[ObjAntBody] = True;
+#ifdef DEBUG_LISTS
+               (void) printf("Ant drawn SLOWLY\n");
+#endif
+       } else {
+               glCallList(objects + ObjAntBody);
+#ifdef DEBUG_LISTS
+               (void) printf("Ant drawn quickly\n");
+#endif
+       }
+
+       glDisable(GL_LIGHTING);
+       /* ANTENNAS */
+       glBegin(GL_LINES);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, 0.30, 0.00);
+       glColor3fv(MaterialGray);
+       glVertex3f(0.40, 0.70, 0.40);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, 0.30, 0.00);
+       glColor3fv(MaterialGray);
+       glVertex3f(0.40, 0.70, -0.40);
+       glEnd();
+       glBegin(GL_POINTS);
+       if (mono)
+               glColor3fv(MaterialGray6);
+       else
+               glColor3fv(MaterialRed);
+       glVertex3f(0.40, 0.70, 0.40);
+       glVertex3f(0.40, 0.70, -0.40);
+       glEnd();
+
+       /* LEFT-FRONT ARM */
+       glBegin(GL_LINE_STRIP);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, 0.05, 0.18);
+       glVertex3f(0.35 + 0.05 * cos1, 0.15, 0.25);
+       glColor3fv(MaterialGray);
+       glVertex3f(-0.20 + 0.05 * cos1, 0.25 + 0.1 * sin1, 0.45);
+       glEnd();
+
+       /* LEFT-CENTER ARM */
+       glBegin(GL_LINE_STRIP);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, 0.00, 0.18);
+       glVertex3f(0.35 + 0.05 * cos2, 0.00, 0.25);
+       glColor3fv(MaterialGray);
+       glVertex3f(-0.20 + 0.05 * cos2, 0.00 + 0.1 * sin2, 0.45);
+       glEnd();
+
+       /* LEFT-BACK ARM */
+       glBegin(GL_LINE_STRIP);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, -0.05, 0.18);
+       glVertex3f(0.35 + 0.05 * cos3, -0.15, 0.25);
+       glColor3fv(MaterialGray);
+       glVertex3f(-0.20 + 0.05 * cos3, -0.25 + 0.1 * sin3, 0.45);
+       glEnd();
+
+       /* RIGHT-FRONT ARM */
+       glBegin(GL_LINE_STRIP);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, 0.05, -0.18);
+       glVertex3f(0.35 - 0.05 * sin1, 0.15, -0.25);
+       glColor3fv(MaterialGray);
+       glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
+       glEnd();
+
+       /* RIGHT-CENTER ARM */
+       glBegin(GL_LINE_STRIP);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, 0.00, -0.18);
+       glVertex3f(0.35 - 0.05 * sin2, 0.00, -0.25);
+       glColor3fv(MaterialGray);
+       glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
+       glEnd();
+
+       /* RIGHT-BACK ARM */
+       glBegin(GL_LINE_STRIP);
+       if (mono)
+               glColor3fv(MaterialGray5);
+       else
+               glColor3fv(Material);
+       glVertex3f(0.00, -0.05, -0.18);
+       glVertex3f(0.35 - 0.05 * sin3, -0.15, -0.25);
+       glColor3fv(MaterialGray);
+       glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
+       glEnd();
+
+       glBegin(GL_POINTS);
+       if (mono)
+               glColor3fv(MaterialGray8);
+       else
+               glColor3fv(MaterialMagenta);
+       glVertex3f(-0.20 + 0.05 * cos1, 0.25 + 0.1 * sin1, 0.45);
+       glVertex3f(-0.20 + 0.05 * cos2, 0.00 + 0.1 * sin2, 0.45);
+       glVertex3f(-0.20 + 0.05 * cos3, -0.25 + 0.1 * sin3, 0.45);
+       glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
+       glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
+       glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
+       glEnd();
+
+       glEnable(GL_LIGHTING);
+
+       ant_step += 0.3;
+       return True;
+}
+
+static void
+RotateAaroundU(float Ax, float Ay, float Az,
+              float Ux, float Uy, float Uz,
+              float *Cx, float *Cy, float *Cz,
+              float Theta)
+{
+       float       cosO = cos(Theta);
+       float       sinO = sin(Theta);
+       float       one_cosO = 1 - cosO;
+       float       Ux2 = sqr(Ux);
+       float       Uy2 = sqr(Uy);
+       float       Uz2 = sqr(Uz);
+       float       UxUy = Ux * Uy;
+       float       UxUz = Ux * Uz;
+       float       UyUz = Uy * Uz;
+
+       *Cx = (Ux2 + cosO * (1 - Ux2)) * Ax + (UxUy * one_cosO - Uz * sinO) * Ay + (UxUz * one_cosO + Uy * sinO) * Az;
+       *Cy = (UxUy * one_cosO + Uz * sinO) * Ax + (Uy2 + cosO * (1 - Uy2)) * Ay + (UyUz * one_cosO - Ux * sinO) * Az;
+       *Cz = (UxUz * one_cosO - Uy * sinO) * Ax + (UyUz * one_cosO + Ux * sinO) * Ay + (Uz2 + cosO * (1 - Uz2)) * Az;
+}
+
+#define MoebiusDivisions 40
+#define MoebiusTransversals 4
+static Bool
+draw_moebius_strip(ModeInfo * mi)
+{
+       GLfloat     Phi, Theta;
+       GLfloat     cPhi, sPhi;
+       moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
+       int         i, j;
+       int         mono = MI_IS_MONO(mi);
+
+       float       Cx, Cy, Cz;
+
+       if (!mp->AreObjectsDefined[ObjMoebiusStrip]) {
+               glNewList(objects + ObjMoebiusStrip, GL_COMPILE_AND_EXECUTE);
+               if (glGetError() != GL_NO_ERROR) {
+                       return False;
+               }
+
+               if (solidmoebius) {
+                       glBegin(GL_QUAD_STRIP);
+                       Phi = 0;
+                       i = 0;
+                       while (i < (MoebiusDivisions * 2 + 1)) {
+                               Theta = Phi / 2;
+                               cPhi = cos(Phi);
+                               sPhi = sin(Phi);
+
+                               i++;
+                               if (mono)
+                                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+                               else if (i % 2)
+                                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
+                               else
+                                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+
+                               RotateAaroundU(cPhi, sPhi, 0, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
+                               glNormal3f(Cx, Cy, Cz);
+                               RotateAaroundU(0, 0, 1, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
+                               glVertex3f(cPhi * 3 + Cx, sPhi * 3 + Cy, +Cz);
+                               glVertex3f(cPhi * 3 - Cx, sPhi * 3 - Cy, -Cz);
+
+                               Phi += Pi / MoebiusDivisions;
+                       }
+                       glEnd();
+               } else {
+                       for (j = -MoebiusTransversals; j < MoebiusTransversals; j++) {
+                               glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+                               glBegin(GL_QUAD_STRIP);
+                               Phi = 0;
+                               i = 0;
+                               while (i < (MoebiusDivisions * 2 + 1)) {
+                                       Theta = Phi / 2;
+                                       cPhi = cos(Phi);
+                                       sPhi = sin(Phi);
+
+                                       RotateAaroundU(cPhi, sPhi, 0, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
+                                       glNormal3f(Cx, Cy, Cz);
+                                       RotateAaroundU(0, 0, 1, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
+                                       j++;
+                                       if (j == MoebiusTransversals || mono)
+                                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+                                       else if (i % 2)
+                                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
+                                       else
+                                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+                                       glVertex3f(cPhi * 3 + Cx / MoebiusTransversals * j, sPhi * 3 + Cy / MoebiusTransversals * j, +Cz / MoebiusTransversals * j);
+                                       j--;
+                                       if (j == -MoebiusTransversals || mono)
+                                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+                                       else if (i % 2)
+                                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
+                                       else
+                                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+                                       glVertex3f(cPhi * 3 + Cx / MoebiusTransversals * j, sPhi * 3 + Cy / MoebiusTransversals * j, +Cz / MoebiusTransversals * j);
+
+                                       Phi += Pi / MoebiusDivisions;
+                                       i++;
+                               }
+                               glEnd();
+                       }
+                       glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+               }
+
+               glEndList();
+               mp->AreObjectsDefined[ObjMoebiusStrip] = True;
+#ifdef DEBUG_LISTS
+               (void) printf("Strip drawn SLOWLY\n");
+#endif
+       } else {
+               glCallList(objects + ObjMoebiusStrip);
+#ifdef DEBUG_LISTS
+               (void) printf("Strip drawn quickly\n");
+#endif
+       }
+
+       if (!noants) {
+               /* DRAW BLUE ANT */
+               glPushMatrix();
+               glRotatef(mp->ant_position + 180, 0, 0, 1);
+               glTranslatef(3, 0, 0);
+               glRotatef(mp->ant_position / 2 + 90, 0, 1, 0);
+               glTranslatef(0.28, 0, -0.45);
+               if (!draw_moebius_ant(mp, MaterialYellow, mono))
+                       return False;
+               glPopMatrix();
+
+               /* DRAW YELLOW ANT */
+               glPushMatrix();
+               glRotatef(mp->ant_position, 0, 0, 1);
+               glTranslatef(3, 0, 0);
+               glRotatef(mp->ant_position / 2, 0, 1, 0);
+               glTranslatef(0.28, 0, -0.45);
+               if (!draw_moebius_ant(mp, MaterialBlue, mono))
+                       return False;
+               glPopMatrix();
+
+               /* DRAW GREEN ANT */
+               glPushMatrix();
+               glRotatef(-mp->ant_position, 0, 0, 1);
+               glTranslatef(3, 0, 0);
+               glRotatef(-mp->ant_position / 2, 0, 1, 0);
+               glTranslatef(0.28, 0, 0.45);
+               glRotatef(180, 1, 0, 0);
+               if (!draw_moebius_ant(mp, MaterialGreen, mono))
+                       return False;
+               glPopMatrix();
+
+               /* DRAW CYAN ANT */
+               glPushMatrix();
+               glRotatef(-mp->ant_position + 180, 0, 0, 1);
+               glTranslatef(3, 0, 0);
+               glRotatef(-mp->ant_position / 2 + 90, 0, 1, 0);
+               glTranslatef(0.28, 0, 0.45);
+               glRotatef(180, 1, 0, 0);
+               if (!draw_moebius_ant(mp, MaterialCyan, mono))
+                       return False;
+               glPopMatrix();
+       }
+       mp->ant_position += 1;
+       return True;
+}
+#undef MoebiusDivisions
+#undef MoebiusTransversals
+
+static void
+reshape_moebius(ModeInfo * mi, int width, int height)
+{
+       moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
+
+       glViewport(0, 0, mp->WindW = (GLint) width, mp->WindH = (GLint) height);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
+       glMatrixMode(GL_MODELVIEW);
+       if (width >= 1024) {
+               glLineWidth(3);
+               glPointSize(3);
+       } else if (width >= 512) {
+               glLineWidth(2);
+               glPointSize(2);
+       } else {
+               glLineWidth(1);
+               glPointSize(1);
+       }
+       mp->AreObjectsDefined[ObjMoebiusStrip] = False;
+       mp->AreObjectsDefined[ObjAntBody] = False;
+}
+
+static void
+pinit(void)
+{
+       glClearDepth(1.0);
+       glClearColor(0.0, 0.0, 0.0, 1.0);
+
+       glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT0, GL_POSITION, position0);
+       glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT1, GL_POSITION, position1);
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+       glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_NORMALIZE);
+       glFrontFace(GL_CCW);
+       glCullFace(GL_BACK);
+
+       /* moebius */
+       glShadeModel(GL_SMOOTH);
+       glEnable(GL_DEPTH_TEST);
+       glDisable(GL_TEXTURE_2D);
+       glDisable(GL_CULL_FACE);
+
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       gluBuild2DMipmaps(GL_TEXTURE_2D, 3, WoodTextureWidth, WoodTextureHeight,
+                         GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
+}
+
+
+
+/* lifted from lament.c */
+#define RANDSIGN() ((LRAND() & 1) ? 1 : -1)
+#define FLOATRAND(a) (((double)LRAND() / (double)MAXRAND) * a)
+
+static void
+rotate(GLfloat *pos, GLfloat *v, GLfloat *dv, GLfloat max_v)
+{
+  double ppos = *pos;
+
+  /* tick position */
+  if (ppos < 0)
+    ppos = -(ppos + *v);
+  else
+    ppos += *v;
+
+  if (ppos > 1.0)
+    ppos -= 1.0;
+  else if (ppos < 0)
+    ppos += 1.0;
+
+  if (ppos < 0) abort();
+  if (ppos > 1.0) abort();
+  *pos = (*pos > 0 ? ppos : -ppos);
+
+  /* accelerate */
+  *v += *dv;
+
+  /* clamp velocity */
+  if (*v > max_v || *v < -max_v)
+    {
+      *dv = -*dv;
+    }
+  /* If it stops, start it going in the other direction. */
+  else if (*v < 0)
+    {
+      if (random() % 4)
+       {
+         *v = 0;
+
+         /* keep going in the same direction */
+         if (random() % 2)
+           *dv = 0;
+         else if (*dv < 0)
+           *dv = -*dv;
+       }
+      else
+       {
+         /* reverse gears */
+         *v = -*v;
+         *dv = -*dv;
+         *pos = -*pos;
+       }
+    }
+
+  /* Alter direction of rotational acceleration randomly. */
+  if (! (random() % 120))
+    *dv = -*dv;
+
+  /* Change acceleration very occasionally. */
+  if (! (random() % 200))
+    {
+      if (*dv == 0)
+       *dv = 0.00001;
+      else if (random() & 1)
+       *dv *= 1.2;
+      else
+       *dv *= 0.8;
+    }
+}
+
+
+void
+init_moebius(ModeInfo * mi)
+{
+       moebiusstruct *mp;
+
+       if (moebius == NULL) {
+               if ((moebius = (moebiusstruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (moebiusstruct))) == NULL)
+                       return;
+       }
+       mp = &moebius[MI_SCREEN(mi)];
+       mp->step = NRAND(90);
+       mp->ant_position = NRAND(90);
+
+    mp->rotx = FLOATRAND(1.0) * RANDSIGN();
+    mp->roty = FLOATRAND(1.0) * RANDSIGN();
+    mp->rotz = FLOATRAND(1.0) * RANDSIGN();
+
+    /* bell curve from 0-1.5 degrees, avg 0.75 */
+    mp->dx = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+    mp->dy = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+    mp->dz = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+
+    mp->d_max = mp->dx * 2;
+
+    mp->ddx = 0.00006 + FLOATRAND(0.00003);
+    mp->ddy = 0.00006 + FLOATRAND(0.00003);
+    mp->ddz = 0.00006 + FLOATRAND(0.00003);
+
+    mp->ddx = 0.00001;
+    mp->ddy = 0.00001;
+    mp->ddz = 0.00001;
+
+       if ((mp->glx_context = init_GL(mi)) != NULL) {
+
+               reshape_moebius(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               glDrawBuffer(GL_BACK);
+               if (!glIsList(objects))
+                       if ((objects = glGenLists(MaxObj)) == 0) {
+                               MI_CLEARWINDOW(mi);
+                               release_moebius(mi);
+                               return;
+                       }
+               pinit();
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_moebius(ModeInfo * mi)
+{
+       moebiusstruct *mp;
+
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+
+        if (moebius == NULL)
+           return;
+       mp = &moebius[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (!mp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(mp->glx_context));
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, -10.0);
+
+       if (!MI_IS_ICONIC(mi)) {
+               glScalef(Scale4Window * mp->WindH / mp->WindW, Scale4Window, Scale4Window);
+       } else {
+               glScalef(Scale4Iconic * mp->WindH / mp->WindW, Scale4Iconic, Scale4Iconic);
+       }
+
+    {
+      GLfloat x = mp->rotx;
+      GLfloat y = mp->roty;
+      GLfloat z = mp->rotz;
+      if (x < 0) x = 1 - (x + 1);
+      if (y < 0) y = 1 - (y + 1);
+      if (z < 0) z = 1 - (z + 1);
+      glRotatef(x * 360, 1.0, 0.0, 0.0);
+      glRotatef(y * 360, 0.0, 1.0, 0.0);
+      glRotatef(z * 360, 0.0, 0.0, 1.0);
+    }
+
+       /* moebius */
+       if (!draw_moebius_strip(mi)) {
+               release_moebius(mi);
+               return;
+       }
+
+       glPopMatrix();
+
+    rotate(&mp->rotx, &mp->dx, &mp->ddx, mp->d_max);
+    rotate(&mp->roty, &mp->dy, &mp->ddy, mp->d_max);
+    rotate(&mp->rotz, &mp->dz, &mp->ddz, mp->d_max);
+
+    if (MI_IS_FPS(mi)) do_fps (mi);
+       glFlush();
+
+       glXSwapBuffers(display, window);
+
+       mp->step += 0.025;
+}
+
+void
+change_moebius(ModeInfo * mi)
+{
+       moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
+
+       if (!mp->glx_context)
+               return;
+
+       glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(mp->glx_context));
+       pinit();
+}
+
+void
+release_moebius(ModeInfo * mi)
+{
+       if (moebius != NULL) {
+               (void) free((void *) moebius);
+               moebius = (moebiusstruct *) NULL;
+       }
+       if (glIsList(objects)) {
+               glDeleteLists(objects, MaxObj);
+               objects = 0;
+       }
+       FreeAllGL(mi);
+}
+
+#endif
diff --git a/modes/glx/molecule.c b/modes/glx/molecule.c
new file mode 100644 (file)
index 0000000..b43fdda
--- /dev/null
@@ -0,0 +1,1587 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* molecule --- 3D molecules */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)molecule.c   5.01 2001/04/12 xlockmore";
+#endif
+
+/* molecule, Copyright (c) 2001 Jamie Zawinski <jwz@jwz.org>
+ * Draws molecules, based on coordinates from PDB (Protein Data Base) files.
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ *
+ *
+ * Revision History:
+ * 16-May-01:  tschmidt@micron.com
+ *                              Fix remaining memory leaks. Fix occasional SEGV.
+ * 19-Apr-01:  tschmidt@micron.com
+ *                              Fixed most memory leaks
+ * 19-Apr-01:  rolf@groppe.de   fixed some allocation problems
+ *                              Startup message now only at first call
+ * 12-Apr-01:  rolf@groppe.de   Ported this mode from xscreensaver to xlock.
+ *                              Use of parameter -cycles instead of timeout, 
+ *                              when used as xlock module.
+ *                              Some minor changes for better display in
+ *                              iconified state.
+ */
+
+
+/* Documentation on the PDB file format:
+   http://www.rcsb.org/pdb/docs/format/pdbguide2.2/guide2.2_frame.html
+
+   Good source of PDB files:
+   http://www.sci.ouc.bc.ca/chem/molecule/molecule.html
+
+   TO DO:
+
+     - I'm not sure the text labels are being done in the best way;
+       they are sometimes, but not always, occluded by spheres that
+       pass in front of them. 
+ */
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+#include <X11/Intrinsic.h>
+
+#define DEF_TIMEOUT     "20"
+#define DEF_SPIN        "XYZ"
+#define DEF_WANDER      "False"
+#define DEF_LABELS      "True"
+#define DEF_TITLES      "True"
+#define DEF_ATOMS       "True"
+#define DEF_BONDS       "True"
+#define DEF_BBOX        "False"
+#define DEF_MOLECULE    "(default)"
+
+
+#ifdef STANDALONE
+
+#define PROGCLASS      "Molecule"
+#define HACK_INIT      init_molecule
+#define HACK_DRAW      draw_molecule
+#define HACK_RESHAPE   reshape_molecule
+#define molecule_opts  xlockmore_opts
+
+#define DEFAULTS       "*delay:        10000         \n" \
+                       "*timeout:    " DEF_TIMEOUT  "\n" \
+                       "*showFPS:      False         \n" \
+                       "*wireframe:    False         \n" \
+                       "*molecule:   " DEF_MOLECULE "\n" \
+                       "*spin:       " DEF_SPIN     "\n" \
+                       "*wander:     " DEF_WANDER   "\n" \
+                       "*labels:     " DEF_LABELS   "\n" \
+                       "*atoms:      " DEF_ATOMS    "\n" \
+                       "*bonds:      " DEF_BONDS    "\n" \
+                       "*bbox:       " DEF_BBOX     "\n" \
+                       "*atomFont:   -*-times-bold-r-normal-*-240-*\n" \
+                       "*titleFont:  -*-times-bold-r-normal-*-180-*\n" \
+                       "*noLabelThreshold:    30     \n" \
+                       "*wireframeThreshold:  150    \n" \
+
+#include "xlockmore.h"
+#include "colors.h"
+#else  /* !STANDALONE */
+# include "xlock.h"                                    /* from the xlockmore distribution */
+# include "visgl.h"
+#endif /* !STANDALONE */
+#include "sphere.h"
+#include "tube.h"
+
+#undef countof
+#define countof(x) (sizeof((x))/sizeof((*x)))
+
+#ifdef MODE_molecule /* whole file */
+
+#include <ctype.h>
+#include <GL/glu.h>
+#include <time.h>
+
+#define SPHERE_SLICES 16  /* how densely to render spheres */
+#define SPHERE_STACKS 10
+
+#define SMOOTH_TUBE       /* whether to have smooth or faceted tubes */
+
+#ifdef SMOOTH_TUBE
+# define TUBE_FACES  12   /* how densely to render tubes */
+#else
+# define TUBE_FACES  8
+#endif
+
+#define FLOATRAND(a) (((double)LRAND() / (double)MAXRAND) * a)
+
+static int scale_down;
+#define SPHERE_SLICES_2  7
+#define SPHERE_STACKS_2  4
+#define TUBE_FACES_2     3
+
+
+const char * const builtin_pdb_data[] = {
+# include "molecules.h"
+};
+
+
+typedef struct {
+  const char *name;
+  GLfloat size, size2;
+  const char *color;
+  const char *text_color;
+  GLfloat gl_color[8];
+} atom_data;
+
+
+/* These are the traditional colors used to render these atoms,
+   and their approximate size in angstroms.
+ */
+static atom_data all_atom_data[] = {
+  { "H",    1.17,  0,  "White",           "Grey60",        { 0, }},
+  { "C",    1.75,  0,  "Grey50",          "White",         { 0, }},
+  { "N",    1.55,  0,  "RoyalBlue1",      "NavyBlue",      { 0, }},
+  { "O",    1.40,  0,  "Red",             "LightPink",     { 0, }},
+  { "P",    1.28,  0,  "MediumPurple",    "PaleVioletRed", { 0, }},
+  { "S",    1.80,  0,  "Yellow4",         "Yellow1",       { 0, }},
+  { "bond", 0,     0,  "Grey70",          "Yellow1",       { 0, }},
+  { "*",    1.40,  0,  "Green4",          "PaleGreen2",    { 0, }}
+};
+
+
+typedef struct {
+  int id;              /* sequence number in the PDB file */
+  const char *label;   /* The atom name */
+  GLfloat x, y, z;     /* position in 3-space (angstroms) */
+  atom_data *data;     /* computed: which style of atom this is */
+} molecule_atom;
+
+typedef struct {
+  int from, to;                /* atom sequence numbers */
+  int strength;                /* how many bonds are between these two atoms */
+} molecule_bond;
+
+
+typedef struct {
+  const char *label;           /* description of this compound */
+  int natoms, atoms_size;
+  int nbonds, bonds_size;
+  molecule_atom *atoms;
+  molecule_bond *bonds;
+} molecule;
+
+
+typedef struct {
+  GLXContext *glx_context;
+
+  GLfloat rotx, roty, rotz;       /* current object rotation */
+  GLfloat dx, dy, dz;             /* current rotational velocity */
+  GLfloat ddx, ddy, ddz;          /* current rotational acceleration */
+  GLfloat d_max;                  /* max velocity */
+
+  Bool spin_x, spin_y, spin_z;
+
+  GLfloat molecule_size;          /* max dimension of molecule bounding box */
+
+  GLfloat no_label_threshold;     /* Things happen when molecules are huge */
+  GLfloat wireframe_threshold;
+
+  int which;                      /* which of the molecules is being shown */
+  int nmolecules;
+  molecule *molecules;
+
+  GLuint molecule_dlist;
+  XFontStruct *xfont1, *xfont2;
+  GLuint font1_dlist, font2_dlist;
+
+} molecule_configuration;
+
+
+static molecule_configuration *mcs = (molecule_configuration *) NULL;
+static molecule *mols = (molecule *) NULL;
+
+static int timeout;
+static char *molecule_str;
+static char *do_spin;
+static Bool do_wander;
+static Bool do_titles;
+static Bool do_labels;
+static Bool do_atoms;
+static Bool do_bonds;
+static Bool do_bbox;
+
+static Bool orig_do_labels, orig_do_titles, orig_do_bonds, cur_wire, orig_wire; /* saved to reset */
+static Bool not_first_gl = False;
+static Bool firstcall = True;
+
+static XrmOptionDescRec opts[] = {
+  {(char *) "-molecule", (char *) ".molecule.molecule", XrmoptionSepArg, 0 },
+#ifdef STANDALONE
+  {(char *) "-timeout", (char *) ".molecule.timeout",XrmoptionSepArg, 0 },
+#endif
+  {(char *) "-spin",   (char *) ".molecule.spin",   XrmoptionSepArg, 0 },
+  {(char *) "+spin",   (char *) ".molecule.spin",   XrmoptionNoArg, "" },
+  {(char *) "-wander", (char *) ".molecule.wander", XrmoptionNoArg, "on" },
+  {(char *) "+wander", (char *) ".molecule.wander", XrmoptionNoArg, "off" },
+  {(char *) "-labels", (char *) ".molecule.labels", XrmoptionNoArg, "on" },
+  {(char *) "+labels", (char *) ".molecule.labels", XrmoptionNoArg, "off" },
+  {(char *) "-titles", (char *) ".molecule.titles", XrmoptionNoArg, "on" },
+  {(char *) "+titles", (char *) ".molecule.titles", XrmoptionNoArg, "off" },
+  {(char *) "-atoms",  (char *) ".molecule.atoms",  XrmoptionNoArg, "on" },
+  {(char *) "+atoms",  (char *) ".molecule.atoms",  XrmoptionNoArg, "off" },
+  {(char *) "-bonds",  (char *) ".molecule.bonds",  XrmoptionNoArg, "on" },
+  {(char *) "+bonds",  (char *) ".molecule.bonds",  XrmoptionNoArg, "off" },
+  {(char *) "-bbox",   (char *) ".molecule.bbox",  XrmoptionNoArg, "on" },
+  {(char *) "+bbox",   (char *) ".molecule.bbox",  XrmoptionNoArg, "off" },
+};
+
+static argtype vars[] = {
+  {(caddr_t *) &molecule_str, (char *) "molecule",   (char *) "Molecule", DEF_MOLECULE,t_String},
+#ifdef STANDALONE
+  {(caddr_t *) &timeout,   (char *) "timeout",(char *) "Seconds",DEF_TIMEOUT,t_Int},
+#endif
+  {(caddr_t *) &do_spin,   (char *) "spin",   (char *) "Spin",   DEF_SPIN,   t_String},
+  {(caddr_t *) &do_wander, (char *) "wander", (char *) "Wander", DEF_WANDER, t_Bool},
+  {(caddr_t *) &do_labels, (char *) "labels", (char *) "Labels", DEF_LABELS, t_Bool},
+  {(caddr_t *) &do_titles, (char *) "titles", (char *) "Titles", DEF_TITLES, t_Bool},
+  {(caddr_t *) &do_atoms,  (char *) "atoms",  (char *) "Atoms",  DEF_ATOMS,  t_Bool},
+  {(caddr_t *) &do_bonds,  (char *) "bonds",  (char *) "Bonds",  DEF_BONDS,  t_Bool},
+  {(caddr_t *) &do_bbox,   (char *) "bbox",   (char *) "BBox",   DEF_BBOX,   t_Bool},
+};
+
+static OptionStruct desc[] = {
+  {(char *) "-molecule", (char *) "set molecule"},
+#ifdef STANDALONE
+  {(char *) "-timeout", (char *) "set timeout"},
+#endif
+  {(char *) "-/+spin", (char *) "turn on/off spin"},
+  {(char *) "-/+wander", (char *) "turn on/off wander"},
+  {(char *) "-/+labels", (char *) "turn on/off labels"},
+  {(char *) "-/+titles", (char *) "turn on/off titles"},
+  {(char *) "-/+atoms", (char *) "turn on/off atoms"},
+  {(char *) "-/+bonds", (char *) "turn on/off bonds"},
+  {(char *) "-/+bbox", (char *) "turn on/off bbox"},
+};
+
+ModeSpecOpt molecule_opts = {countof(opts), opts, countof(vars), vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   molecule_description =
+{"molecule", "init_molecule", "draw_molecule", "release_molecule",
+ "draw_molecule", "init_molecule", NULL, &molecule_opts,
+ 50000, 1, 20, 1, 64, 1.0, "",
+ "Draws molecules", 0, NULL};
+#endif
+
+static time_t last = 0;
+
+
+/* shapes */
+
+static void
+sphere (GLfloat x, GLfloat y, GLfloat z, GLfloat diameter, Bool wire)
+{
+  int stacks = (scale_down ? SPHERE_STACKS_2 : SPHERE_STACKS);
+  int slices = (scale_down ? SPHERE_SLICES_2 : SPHERE_SLICES);
+
+  glPushMatrix ();
+  glTranslatef (x, y, z);
+  glScalef (diameter, diameter, diameter);
+  unit_sphere (stacks, slices, wire);
+  glPopMatrix ();
+}
+
+
+static void
+load_font (ModeInfo *mi, char *res, XFontStruct **fontP, GLuint *dlistP)
+{
+#ifdef STANDALONE
+  const char *font = get_string_resource (res, "Font"); 
+#else
+  const char *font = res;
+#endif
+  XFontStruct *f;
+  Font id;
+  int first, last;
+
+  if (!font) font = "-*-times-bold-r-normal-*-180-*";
+
+  f = XLoadQueryFont(MI_DISPLAY(mi), font);
+  if (!f) f = XLoadQueryFont(MI_DISPLAY(mi), "fixed");
+
+  id = f->fid;
+  first = f->min_char_or_byte2;
+  last = f->max_char_or_byte2;
+  
+  clear_gl_error ();
+  *dlistP = glGenLists ((GLuint) last+1);
+  check_gl_error ("glGenLists");
+  /*-
+   * PURIFY reports a cumulative memory leak on the next line with Mesa 3.4.1
+   * on Solaris 2.X and SunOS 4.1.X. This can be fixed with a patch to Mesa
+   * 3.4.1. OpenGL on Solaris does not have the memory leak.
+   */
+  glXUseXFont(id, first, last-first+1, *dlistP + first);
+  check_gl_error ("glXUseXFont");
+
+  *fontP = f;
+}
+
+
+static void
+load_fonts (ModeInfo *mi)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+#ifdef STANDALONE
+  load_font (mi, "atomFont",  &mc->xfont1, &mc->font1_dlist);
+  load_font (mi, "titleFont", &mc->xfont2, &mc->font2_dlist);
+#else
+  load_font (mi, "-*-times-bold-r-normal-*-240-*",  &mc->xfont1, &mc->font1_dlist);
+  load_font (mi, "-*-times-bold-r-normal-*-180-*", &mc->xfont2, &mc->font2_dlist);
+#endif
+}
+
+static void
+free_fonts (ModeInfo *mi)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+
+  clear_gl_error ();
+  if (glIsList(mc->molecule_dlist)) {
+       glDeleteLists(mc->molecule_dlist, 1);
+       check_gl_error ("glDeleteLists");
+       mc->molecule_dlist = 0;
+  }
+  if (mc->xfont1) {
+       int last;
+
+       last = mc->xfont1->max_char_or_byte2;
+       clear_gl_error ();
+       if (glIsList(mc->font1_dlist)) {
+               glDeleteLists (mc->font1_dlist,(GLuint) last+1);
+               check_gl_error ("glDeleteLists");
+               mc->font1_dlist = 0;
+       }
+       XFreeFont(MI_DISPLAY(mi),mc->xfont1);
+       mc->xfont1 = (XFontStruct *) NULL;
+  }
+  if (mc->xfont2) {
+       int last;
+
+       last = mc->xfont2->max_char_or_byte2;
+       clear_gl_error ();
+       if (glIsList(mc->font2_dlist)) {
+               glDeleteLists (mc->font2_dlist,(GLuint) last+1);
+               check_gl_error ("glDeleteLists");
+               mc->font2_dlist = 0;
+       }
+       XFreeFont(MI_DISPLAY(mi),mc->xfont2);
+       mc->xfont2 = (XFontStruct *) NULL;
+  }
+}
+
+static int
+string_width (XFontStruct *f, const char *c)
+{
+  int w = 0;
+  while (*c)
+    {
+      int cc = *((unsigned char *) c);
+      w += (f->per_char
+            ? f->per_char[cc-f->min_char_or_byte2].rbearing
+            : f->min_bounds.rbearing);
+      c++;
+    }
+  return w;
+}
+
+
+static atom_data *
+get_atom_data (const char *atom_name)
+{
+  int i;
+  atom_data *d = 0;
+  char *n = strdup (atom_name);
+  char *n2 = n;
+  int L;
+
+  while (!isalpha((int) *n)) n++;
+  L = strlen(n);
+  while (L > 0 && !isalpha((int) n[L-1]))
+    n[--L] = 0;
+
+  for (i = 0; i < (int) countof(all_atom_data); i++)
+    {
+      d = &all_atom_data[i];
+      if (!strcmp (n, all_atom_data[i].name))
+        break;
+    }
+
+  free (n2);
+  return d;
+}
+
+
+static void
+set_atom_color (ModeInfo *mi, molecule_atom *a, Bool font_p)
+{
+  atom_data *d;
+  GLfloat *gl_color;
+
+  if (a)
+    d = a->data;
+  else
+    {
+      static atom_data *def_data = 0;
+      if (!def_data) def_data = get_atom_data ("bond");
+      d = def_data;
+    }
+
+  gl_color = (!font_p ? d->gl_color : (d->gl_color + 4));
+
+  if (gl_color[3] == 0)
+    {
+      const char *string = !font_p ? d->color : d->text_color;
+      XColor xcolor;
+      if (!XParseColor (MI_DISPLAY(mi), MI_COLORMAP(mi), string, &xcolor))
+        {
+          fprintf (stderr, "molecule: unparsable color in %s: %s\n",
+                   (a ? a->label : d->name), string);
+          /* exit (1); */
+        }
+
+      gl_color[0] = xcolor.red   / 65536.0;
+      gl_color[1] = xcolor.green / 65536.0;
+      gl_color[2] = xcolor.blue  / 65536.0;
+      gl_color[3] = 1.0;
+    }
+  
+  if (font_p)
+    glColor3f (gl_color[0], gl_color[1], gl_color[2]);
+  else
+    glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gl_color);
+}
+
+
+static GLfloat
+atom_size (molecule_atom *a)
+{
+  if (do_bonds)
+    {
+      if (a->data->size2 == 0)
+        {
+          /* let the molecules have the same relative sizes, but scale
+             them to a smaller range, so that the bond-tubes are
+             actually visible...
+           */
+          GLfloat bot = 0.4;
+          GLfloat top = 0.6;
+          GLfloat min = 1.17;
+          GLfloat max = 1.80;
+          GLfloat ratio = (a->data->size - min) / (max - min);
+          a->data->size2 = bot + (ratio * (top - bot));
+        }
+      return a->data->size2;
+    }
+  else
+    return a->data->size;
+}
+
+
+static molecule_atom *
+get_atom (molecule_atom *atoms, int natoms, int id)
+{
+  int i;
+
+  /* quick short-circuit */
+  if (id < natoms)
+    {
+      if (atoms[id].id == id)
+        return &atoms[id];
+      if (id > 0 && atoms[id-1].id == id)
+        return &atoms[id-1];
+      if (id < natoms-1 && atoms[id+1].id == id)
+        return &atoms[id+1];
+    }
+
+  for (i = 0; i < natoms; i++)
+    if (id == atoms[i].id)
+      return &atoms[i];
+
+  fprintf (stderr, "molecule: no atom %d\n", id);
+  /* abort(); */
+  return (molecule_atom *) NULL;
+}
+
+
+static void
+molecule_bounding_box (ModeInfo *mi,
+                       GLfloat *x1, GLfloat *y1, GLfloat *z1,
+                       GLfloat *x2, GLfloat *y2, GLfloat *z2)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+  molecule *m = &mc->molecules[mc->which];
+  int i;
+
+  if (m->natoms == 0)
+    {
+      *x1 = *y1 = *z1 = *x2 = *y2 = *z2 = 0;
+    }
+  else
+    {
+      *x1 = *x2 = m->atoms[0].x;
+      *y1 = *y2 = m->atoms[0].y;
+      *z1 = *z2 = m->atoms[0].z;
+    }
+
+  for (i = 1; i < m->natoms; i++)
+    {
+      if (m->atoms[i].x < *x1) *x1 = m->atoms[i].x;
+      if (m->atoms[i].y < *y1) *y1 = m->atoms[i].y;
+      if (m->atoms[i].z < *z1) *z1 = m->atoms[i].z;
+
+      if (m->atoms[i].x > *x2) *x2 = m->atoms[i].x;
+      if (m->atoms[i].y > *y2) *y2 = m->atoms[i].y;
+      if (m->atoms[i].z > *z2) *z2 = m->atoms[i].z;
+    }
+
+  *x1 -= 1;
+  *y1 -= 1;
+  *z1 -= 1;
+  *x2 += 1;
+  *y2 += 1;
+  *z2 += 1;
+}
+
+
+static void
+draw_bounding_box (ModeInfo *mi)
+{
+  static GLfloat c1[4] = { 0.2, 0.2, 0.6, 1.0 };
+  static GLfloat c2[4] = { 1.0, 0.0, 0.0, 1.0 };
+  int wire = cur_wire;
+  GLfloat x1, y1, z1, x2, y2, z2;
+  molecule_bounding_box (mi, &x1, &y1, &z1, &x2, &y2, &z2);
+
+  glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, c1);
+  glFrontFace(GL_CCW);
+
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glNormal3f(0, 1, 0);
+  glVertex3f(x1, y1, z1); glVertex3f(x1, y1, z2);
+  glVertex3f(x2, y1, z2); glVertex3f(x2, y1, z1);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glNormal3f(0, -1, 0);
+  glVertex3f(x2, y2, z1); glVertex3f(x2, y2, z2);
+  glVertex3f(x1, y2, z2); glVertex3f(x1, y2, z1);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glNormal3f(0, 0, 1);
+  glVertex3f(x1, y1, z1); glVertex3f(x2, y1, z1);
+  glVertex3f(x2, y2, z1); glVertex3f(x1, y2, z1);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glNormal3f(0, 0, -1);
+  glVertex3f(x1, y2, z2); glVertex3f(x2, y2, z2);
+  glVertex3f(x2, y1, z2); glVertex3f(x1, y1, z2);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glNormal3f(1, 0, 0);
+  glVertex3f(x1, y2, z1); glVertex3f(x1, y2, z2);
+  glVertex3f(x1, y1, z2); glVertex3f(x1, y1, z1);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_QUADS);
+  glNormal3f(-1, 0, 0);
+  glVertex3f(x2, y1, z1); glVertex3f(x2, y1, z2);
+  glVertex3f(x2, y2, z2); glVertex3f(x2, y2, z1);
+  glEnd();
+
+  glPushAttrib (GL_LIGHTING);
+  glDisable (GL_LIGHTING);
+
+  glColor3f (c2[0], c2[1], c2[2]);
+  glBegin(GL_LINES);
+  if (x1 > 0) x1 = 0; if (x2 < 0) x2 = 0;
+  if (y1 > 0) y1 = 0; if (y2 < 0) y2 = 0;
+  if (z1 > 0) z1 = 0; if (z2 < 0) z2 = 0;
+  glVertex3f(x1, 0,  0);  glVertex3f(x2, 0,  0); 
+  glVertex3f(0 , y1, 0);  glVertex3f(0,  y2, 0); 
+  glVertex3f(0,  0,  z1); glVertex3f(0,  0,  z2); 
+  glEnd();
+
+  glPopAttrib();
+}
+
+
+/* Since PDB files don't always have the molecule centered around the
+   origin, and since some molecules are pretty large, scale and/or
+   translate so that the whole molecule is visible in the window.
+ */
+static void
+ensure_bounding_box_visible (ModeInfo *mi)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+
+  GLfloat x1, y1, z1, x2, y2, z2;
+  GLfloat w, h, d;
+  GLfloat size;
+  GLfloat max_size = 10;  /* don't bother scaling down if the molecule
+                             is already smaller than this */
+
+  molecule_bounding_box (mi, &x1, &y1, &z1, &x2, &y2, &z2);
+  w = x2-x1;
+  h = y2-y1;
+  d = z2-z1;
+
+  size = (w > h ? w : h);
+  size = (size > d ? size : d);
+
+  mc->molecule_size = size;
+
+  scale_down = 0;
+
+  if (size > max_size)
+    {
+      GLfloat scale = max_size / size;
+      glScalef (scale, scale, scale);
+
+      scale_down = scale < 0.3;
+    }
+
+  glTranslatef (-(x1 + w/2),
+                -(y1 + h/2),
+                -(z1 + d/2));
+}
+
+
+static void
+print_title_string (ModeInfo *mi, const char *string,
+                    GLfloat x, GLfloat y, GLfloat line_height)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+  
+  y -= line_height;
+
+  glPushAttrib (GL_LIGHTING | GL_DEPTH_TEST);
+  glDisable (GL_LIGHTING);
+  glDisable (GL_DEPTH_TEST);
+  {
+    glMatrixMode(GL_PROJECTION);
+    glPushMatrix();
+    {
+      glLoadIdentity();
+
+      glMatrixMode(GL_MODELVIEW);
+      glPushMatrix();
+      {
+        int i;
+        glLoadIdentity();
+
+        gluOrtho2D (0, MI_WIDTH(mi), 0, MI_HEIGHT(mi));
+
+        set_atom_color (mi, 0, True);
+
+        glRasterPos2f (x, y);
+        for (i = 0; i < (int) strlen(string); i++)
+          {
+            char c = string[i];
+            if (c == '\n')
+              glRasterPos2f (x, (y -= line_height));
+            else
+              glCallList (mc->font2_dlist + (int)(c));
+          }
+      }
+      glPopMatrix();
+    }
+    glMatrixMode(GL_PROJECTION);
+    glPopMatrix();
+  }
+  glPopAttrib();
+
+  glMatrixMode(GL_MODELVIEW);
+}
+
+
+/* Constructs the GL shapes of the current molecule
+ */
+static void
+build_molecule (ModeInfo *mi)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+  int wire = cur_wire;
+  int i;
+
+  molecule *m = &mc->molecules[mc->which];
+
+  if (wire)
+    {
+      glDisable(GL_CULL_FACE);
+      glDisable(GL_LIGHTING);
+      glDisable(GL_LIGHT0);
+      glDisable(GL_DEPTH_TEST);
+      glDisable(GL_NORMALIZE);
+      glDisable(GL_CULL_FACE);
+    }
+  else
+    {
+      glEnable(GL_CULL_FACE);
+      glEnable(GL_LIGHTING);
+      glEnable(GL_LIGHT0);
+      glEnable(GL_DEPTH_TEST);
+      glEnable(GL_NORMALIZE);
+      glEnable(GL_CULL_FACE);
+    }
+
+  if (!wire)
+    set_atom_color (mi, 0, False);
+
+  if (do_bonds)
+    for (i = 0; i < m->nbonds; i++)
+      {
+        molecule_bond *b = &m->bonds[i];
+        molecule_atom *from = get_atom (m->atoms, m->natoms, b->from);
+        molecule_atom *to   = get_atom (m->atoms, m->natoms, b->to);
+
+        if (wire)
+          {
+            glBegin(GL_LINES);
+            glVertex3f(from->x, from->y, from->z);
+            glVertex3f(to->x,   to->y,   to->z);
+            glEnd();
+          }
+        else
+          {
+            int faces = (scale_down ? TUBE_FACES_2 : TUBE_FACES);
+# ifdef SMOOTH_TUBE
+            int smooth = True;
+# else
+            int smooth = False;
+# endif
+            GLfloat thickness = 0.07 * b->strength;
+            GLfloat cap_size = 0.03;
+            if (thickness > 0.3)
+              thickness = 0.3;
+
+            tube (from->x, from->y, from->z,
+                  to->x,   to->y,   to->z,
+                  thickness, cap_size,
+                  faces, smooth, wire);
+          }
+      }
+
+  for (i = 0; i < m->natoms; i++)
+    {
+      molecule_atom *a = &m->atoms[i];
+      int i;
+
+      if (!wire && do_atoms)
+        {
+          GLfloat size = atom_size (a);
+          set_atom_color (mi, a, False);
+          sphere (a->x, a->y, a->z, size, wire);
+        }
+
+      if (do_labels)
+        {
+          glPushAttrib (GL_LIGHTING | GL_DEPTH_TEST);
+          glDisable (GL_LIGHTING);
+          glDisable (GL_DEPTH_TEST);
+
+          if (!wire)
+            set_atom_color (mi, a, True);
+
+          glRasterPos3f (a->x, a->y, a->z);
+
+          {
+            GLdouble mm[17], pm[17];
+            GLint vp[5];
+            GLdouble wx=-1, wy=-1, wz=-1;
+            glGetDoublev (GL_MODELVIEW_MATRIX, mm);
+            glGetDoublev (GL_PROJECTION_MATRIX, pm);
+            glGetIntegerv (GL_VIEWPORT, vp);
+
+            /* Convert 3D coordinates to window coordinates */
+            gluProject (a->x, a->y, a->z, mm, pm, vp, &wx, &wy, &wz);
+
+            /* Fudge the window coordinates to center the string */
+            wx -= string_width (mc->xfont1, a->label) / 2;
+            wy -= mc->xfont1->descent;
+
+            /* Convert new window coordinates back to 3D coordinates */
+            gluUnProject (wx, wy, wz, mm, pm, vp, &wx, &wy, &wz);
+            glRasterPos3f (wx, wy, wz);
+          }
+
+          for (i = 0; i < (int) strlen(a->label); i++)
+            glCallList (mc->font1_dlist + (int)(a->label[i]));
+
+          glPopAttrib();
+        }
+    }
+
+  if (do_bbox)
+    draw_bounding_box (mi);
+
+  if (do_titles && m->label && *m->label)
+    print_title_string (mi, m->label,
+                        10, MI_HEIGHT(mi) - 10,
+                        mc->xfont2->ascent + mc->xfont2->descent);
+}
+
+
+
+/* loading */
+
+static void
+push_atom (molecule *m,
+           int id, const char *label,
+           GLfloat x, GLfloat y, GLfloat z)
+{
+  m->natoms++;
+  if (m->atoms_size < m->natoms)
+    {
+      m->atoms_size += 20;
+      m->atoms = (molecule_atom *) realloc (m->atoms,
+                                            m->atoms_size * sizeof(*m->atoms));
+    }
+  m->atoms[m->natoms-1].id = id;
+  m->atoms[m->natoms-1].label = label;
+  m->atoms[m->natoms-1].x = x;
+  m->atoms[m->natoms-1].y = y;
+  m->atoms[m->natoms-1].z = z;
+  m->atoms[m->natoms-1].data = get_atom_data (label);
+}
+
+
+static void
+push_bond (molecule *m, int from, int to)
+{
+  int i;
+
+  for (i = 0; i < m->nbonds; i++)
+    if ((m->bonds[i].from == from && m->bonds[i].to   == to) ||
+        (m->bonds[i].to   == from && m->bonds[i].from == to))
+      {
+        m->bonds[i].strength++;
+        return;
+      }
+
+  m->nbonds++;
+  if (m->bonds_size < m->nbonds)
+    {
+      m->bonds_size += 20;
+      m->bonds = (molecule_bond *) realloc (m->bonds,
+                                            m->bonds_size * sizeof(*m->bonds));
+    }
+  m->bonds[m->nbonds-1].from = from;
+  m->bonds[m->nbonds-1].to = to;
+  m->bonds[m->nbonds-1].strength = 1;
+}
+
+
+
+/* This function is crap.
+ */
+static void
+parse_pdb_data (molecule *m, const char *data, const char *filename, int line)
+{
+  const char *s = data;
+  char *ss;
+  while (*s)
+    {
+      if ((!m->label || !*m->label) &&
+          (!strncmp (s, "HEADER", 6) || !strncmp (s, "COMPND", 6)))
+        {
+          char *name = (char *) calloc (1, 100);
+          char *n2 = name;
+          int L = strlen(s);
+          
+          if (L > 99) L = 99;
+
+          strncpy(n2, s, L);
+          n2 += 7;
+          while (isspace((int) *n2)) n2++;
+
+          ss = strchr (n2, '\n');
+          if (ss) *ss = 0;
+          ss = strchr (n2, '\r');
+          if (ss) *ss = 0;
+
+          ss = n2 + strlen(n2)-1;
+          while (isspace((int) *ss) && ss > n2)
+            *ss-- = 0;
+
+          if (strlen(n2) > 4 &&
+              !strcmp (n2 + strlen(n2) - 4, ".pdb"))
+            n2[strlen(n2)-4] = 0;
+
+          if (m->label) free ((char *) m->label);
+          m->label = strdup (n2);
+          free(name);
+        }
+      else if (!strncmp (s, "TITLE ", 6) ||
+               !strncmp (s, "HEADER", 6) ||
+               !strncmp (s, "COMPND", 6) ||
+               !strncmp (s, "AUTHOR", 6) ||
+               !strncmp (s, "REVDAT", 6) ||
+               !strncmp (s, "SOURCE", 6) ||
+               !strncmp (s, "EXPDTA", 6) ||
+               !strncmp (s, "JRNL  ", 6) ||
+               !strncmp (s, "REMARK", 6) ||
+               !strncmp (s, "SEQRES", 6) ||
+               !strncmp (s, "HET   ", 6) ||
+               !strncmp (s, "FORMUL", 6) ||
+               !strncmp (s, "CRYST1", 6) ||
+               !strncmp (s, "ORIGX1", 6) ||
+               !strncmp (s, "ORIGX2", 6) ||
+               !strncmp (s, "ORIGX3", 6) ||
+               !strncmp (s, "SCALE1", 6) ||
+               !strncmp (s, "SCALE2", 6) ||
+               !strncmp (s, "SCALE3", 6) ||
+               !strncmp (s, "MASTER", 6) ||
+               !strncmp (s, "KEYWDS", 6) ||
+               !strncmp (s, "DBREF ", 6) ||
+               !strncmp (s, "HETNAM", 6) ||
+               !strncmp (s, "HETSYN", 6) ||
+               !strncmp (s, "HELIX ", 6) ||
+               !strncmp (s, "LINK  ", 6) ||
+               !strncmp (s, "MTRIX1", 6) ||
+               !strncmp (s, "MTRIX2", 6) ||
+               !strncmp (s, "MTRIX3", 6) ||
+               !strncmp (s, "SHEET ", 6) ||
+               !strncmp (s, "CISPEP", 6) ||
+               !strncmp (s, "GENERATED BY", 12) ||
+               !strncmp (s, "TER ", 4) ||
+               !strncmp (s, "END ", 4) ||
+               !strncmp (s, "TER\n", 4) ||
+               !strncmp (s, "END\n", 4) ||
+               !strncmp (s, "\n", 1))
+        /* ignored. */
+        ;
+      else if (!strncmp (s, "ATOM   ", 7))
+        {
+          int id;
+         /* PURIFY reports a cumulative potential memory leak on the next line */
+          char *name = (char *) calloc (1, 4);
+          GLfloat x = -999, y = -999, z = -999;
+
+          sscanf (s+7, " %d ", &id);
+
+          strncpy (name, s+12, 3);
+          while (isspace((int) *name)) name++;
+          ss = name + strlen(name)-1;
+          while (isspace((int) *ss) && ss > name)
+            *ss-- = 0;
+          sscanf (s + 32, " %f %f %f ", &x, &y, &z);
+/*
+          fprintf (stderr, "molecule: %s: %d: atom: %d \"%s\" %9.4f %9.4f %9.4f\n",
+                   filename, line,
+                   id, name, x, y, z);
+*/
+          push_atom (m, id, name, x, y, z);
+        }
+      else if (!strncmp (s, "HETATM ", 7))
+        {
+          int id;
+         /* PURIFY reports a cumulative potential memory leak on the next line */
+          char *name = (char *) calloc (1, 4);
+          GLfloat x = -999, y = -999, z = -999;
+
+          sscanf (s+7, " %d ", &id);
+
+          strncpy (name, s+12, 3);
+          while (isspace((int) *name)) name++;
+          ss = name + strlen(name)-1;
+          while (isspace((int) *ss) && ss > name)
+            *ss-- = 0;
+          sscanf (s + 30, " %f %f %f ", &x, &y, &z);
+/*
+          fprintf (stderr, "molecule: %s: %d: atom: %d \"%s\" %9.4f %9.4f %9.4f\n",
+                   filename, line,
+                   id, name, x, y, z);
+*/
+          push_atom (m, id, name, x, y, z);
+        }
+      else if (!strncmp (s, "CONECT ", 7))
+        {
+          int atoms[11];
+          int i = sscanf (s + 8, " %d %d %d %d %d %d %d %d %d %d %d %d ",
+                          &atoms[0], &atoms[1], &atoms[2], &atoms[3], 
+                          &atoms[4], &atoms[5], &atoms[6], &atoms[7], 
+                          &atoms[8], &atoms[9], &atoms[10], &atoms[11]);
+          int j;
+          for (j = 1; j < i; j++)
+            if (atoms[j] > 0)
+              {
+/*
+                fprintf (stderr, "molecule: %s: %d: bond: %d %d\n",
+                         filename, line, atoms[0], atoms[j]);
+*/
+                push_bond (m, atoms[0], atoms[j]);
+              }
+        }
+      else
+        {
+          char *s1 = strdup (s);
+          for (ss = s1; *ss && *ss != '\n'; ss++)
+            ;
+          *ss = 0;
+          fprintf (stderr, "molecule: %s: %d: unrecognised line: %s\n",
+                   filename, line, s1);
+        }
+
+      while (*s && *s != '\n')
+        s++;
+      if (*s == '\n')
+        s++;
+      line++;
+    }
+}
+
+
+static void
+parse_pdb_file (molecule *m, const char *name)
+{
+  FILE *in;
+  int buf_size = 40960;
+  char *buf;
+  int line = 1;
+
+  in = fopen(name, "r");
+  if (!in)
+    {
+      char *buf = (char *) malloc(1024 + strlen(name));
+      sprintf(buf, "molecule: error reading \"%s\"", name);
+      perror(buf);
+      /* exit (1); */
+    }
+
+  buf = (char *) malloc (buf_size);
+
+  while (fgets (buf, buf_size-1, in))
+    {
+      char *s;
+      for (s = buf; *s; s++)
+        if (*s == '\r') *s = '\n';
+      parse_pdb_data (m, buf, name, line++);
+    }
+
+  free (buf);
+  fclose (in);
+
+  if (!m->natoms)
+    {
+      fprintf (stderr, "molecule: file %s contains no atomic coordinates!\n",
+               name);
+      /* exit (1); */
+    }
+
+  if (!m->nbonds && do_bonds)
+    {
+      fprintf (stderr, "molecule: warning: file %s contains no atomic bond info.\n",
+               name);
+      do_bonds = 0;
+    }
+}
+
+
+static void
+generate_molecule_formula (molecule *m)
+{
+  char *buf = (char *) malloc (m->natoms * 10);
+  char *s = buf;
+  int i;
+  struct { char *atom; int count; } counts[200];
+  memset (counts, 0, sizeof(counts));
+  *s = 0;
+  for (i = 0; i < m->natoms; i++)
+    {
+      int j = 0;
+      char *a = (char *) m->atoms[i].label;
+      char *e;
+      while (!isalpha((int) *a)) a++;
+      a = strdup (a);
+      for (e = a; isalpha((int) *e); e++);
+      *e = 0;
+      while (counts[j].atom && !!strcmp(a, counts[j].atom))
+        j++;
+      if (counts[j].atom)
+        free (a);
+      else
+        counts[j].atom = a;
+      counts[j].count++;
+    }
+
+  i = 0;
+  while (counts[i].atom)
+    {
+      strcat (s, counts[i].atom);
+      free (counts[i].atom);
+      s += strlen (s);
+      if (counts[i].count > 1)
+        sprintf (s, "(%d)", counts[i].count);
+      s += strlen (s);
+      i++;
+    }
+
+  if (!m->label) m->label = strdup("");
+  s = (char *) malloc (strlen (m->label) + strlen (buf) + 2);
+  strcpy (s, m->label);
+  strcat (s, "\n");
+  strcat (s, buf);
+  free ((char *) m->label);
+  free (buf);
+  m->label = s;
+}
+
+static void
+insert_vertical_whitespace (char *string)
+{
+  while (*string)
+    {
+      if ((string[0] == ',' ||
+           string[0] == ';' ||
+           string[0] == ':') &&
+          string[1] == ' ')
+        string[0] = ' ', string[1] = '\n';
+      string++;
+    }
+}
+
+
+/* Construct the molecule data from either: the builtins; or from
+   the (one) .pdb file specified with -molecule.
+ */
+static void
+load_molecules (ModeInfo *mi)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+  int wire = cur_wire;
+
+  if (!molecule_str || !*molecule_str ||
+      !strcmp(molecule_str, "(default)"))      /* do the builtins */
+    {
+      int i;
+      mc->nmolecules = countof(builtin_pdb_data);
+      if (!mols) {
+        mols = (molecule *) calloc (sizeof (molecule), mc->nmolecules);
+        for (i = 0; i < mc->nmolecules; i++)
+          {
+            char name[100];
+            sprintf (name, "<builtin-%d>", i);
+            parse_pdb_data (&mols[i], builtin_pdb_data[i], name, 1);
+            generate_molecule_formula (&mols[i]);
+            insert_vertical_whitespace ((char *) mols[i].label);
+          }
+      }
+      mc->molecules = mols;
+    }
+  else                                         /* Load a file */
+    {
+      int i = 0;
+      mc->nmolecules = 1;
+      if (!mols) {
+        mols = (molecule *) calloc (sizeof (molecule), mc->nmolecules);
+        parse_pdb_file (&mols[i], molecule_str);
+        generate_molecule_formula (&mols[i]);
+        insert_vertical_whitespace ((char *) mols[i].label);
+
+        if ((wire || !do_atoms) &&
+            !do_labels &&
+            mols[i].nbonds == 0)
+          {
+            /* If we're not drawing atoms (e.g., wireframe mode), and
+               there is no bond info, then make sure labels are turned on,
+               or we'll be looking at a black screen... */
+            fprintf (stderr, "molecule: no bonds: turning -label on.\n");
+            do_labels = 1;
+          }
+       }
+       mc->molecules = mols;
+    }
+}
+
+
+
+/* Window management, etc
+ */
+void
+reshape_molecule (ModeInfo *mi, int width, int height)
+{
+  GLfloat h = (GLfloat) height / (GLfloat) width;
+
+  glViewport (0, 0, (GLint) width, (GLint) height);
+
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+
+  gluPerspective( 30.0, 1/h, 1.0, 100.0 );
+  gluLookAt( 0.0, 0.0, 15.0,
+             0.0, 0.0, 0.0,
+             0.0, 1.0, 0.0);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  glTranslatef(0.0, 0.0, -15.0);
+
+  glClear(GL_COLOR_BUFFER_BIT);
+}
+
+
+static void
+gl_init (ModeInfo *mi)
+{
+  static GLfloat pos[4] = {5.0, 5.0, 10.0, 1.0};
+  glLightfv(GL_LIGHT0, GL_POSITION, pos);
+  if (!not_first_gl)
+   {
+    orig_do_labels = do_labels;
+    orig_do_bonds = do_bonds;
+    orig_wire = cur_wire;
+    orig_do_titles = do_titles;
+    not_first_gl = True;
+   }
+}
+
+
+/* lifted from lament.c */
+#define RAND(n) ((long) ((LRAND() & 0x7fffffff) % ((long) (n))))
+#define RANDSIGN() ((LRAND() & 1) ? 1 : -1)
+
+static void
+rotate(GLfloat *pos, GLfloat *v, GLfloat *dv, GLfloat max_v)
+{
+  double ppos = *pos;
+
+  /* tick position */
+  if (ppos < 0)
+    ppos = -(ppos + *v);
+  else
+    ppos += *v;
+
+  if (ppos > 1.0)
+    ppos -= 1.0;
+  else if (ppos < 0)
+    ppos += 1.0;
+
+  if (ppos < 0) {
+    /* abort(); */
+    fprintf (stderr, "ppos = %g\n", ppos);
+  }
+  if (ppos > 1.0) {
+     /* abort(); */
+    fprintf (stderr, "ppos = %g\n", ppos);
+  }
+  *pos = (*pos > 0 ? ppos : -ppos);
+
+  /* accelerate */
+  *v += *dv;
+
+  /* clamp velocity */
+  if (*v > max_v || *v < -max_v)
+    {
+      *dv = -*dv;
+    }
+  /* If it stops, start it going in the other direction. */
+  else if (*v < 0)
+    {
+      if (random() % 4)
+       {
+         *v = 0;
+
+         /* keep going in the same direction */
+         if (random() % 2)
+           *dv = 0;
+         else if (*dv < 0)
+           *dv = -*dv;
+       }
+      else
+       {
+         /* reverse gears */
+         *v = -*v;
+         *dv = -*dv;
+         *pos = -*pos;
+       }
+    }
+
+  /* Alter direction of rotational acceleration randomly. */
+  if (! (random() % 120))
+    *dv = -*dv;
+
+  /* Change acceleration very occasionally. */
+  if (! (random() % 200))
+    {
+      if (*dv == 0)
+       *dv = 0.00001;
+      else if (random() & 1)
+       *dv *= 1.2;
+      else
+       *dv *= 0.8;
+    }
+}
+
+
+static void
+startup_blurb (ModeInfo *mi)
+{
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+  const char *s = "Constructing molecules...";
+  print_title_string (mi, s,
+                      MI_WIDTH(mi) - (string_width (mc->xfont2, s) + 40),
+                      10 + mc->xfont2->ascent + mc->xfont2->descent,
+                      mc->xfont2->ascent + mc->xfont2->descent);
+  glFinish();
+  glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi));
+  firstcall = False;
+}
+
+void 
+init_molecule (ModeInfo *mi)
+{
+  molecule_configuration *mc;
+  int wire;
+
+#ifndef STANDALONE
+  timeout = MI_CYCLES(mi);
+#endif
+  if (!mcs) {
+    mcs = (molecule_configuration *)
+      calloc (MI_NUM_SCREENS(mi), sizeof (molecule_configuration));
+    if (!mcs) {
+       return;
+    }
+  }
+
+  mc = &mcs[MI_SCREEN(mi)];
+  if (mc->glx_context) {
+       /* Free font stuff */
+       free_fonts (mi);
+  }
+
+  if ((mc->glx_context = init_GL(mi)) != NULL) {
+    gl_init(mi);
+    last = 0;
+    reshape_molecule (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+  }
+
+  load_fonts (mi);
+  if (firstcall)
+  startup_blurb (mi);
+  cur_wire = MI_IS_WIREFRAME(mi);
+  wire = cur_wire;
+
+  mc->rotx = FLOATRAND(1.0) * RANDSIGN();
+  mc->roty = FLOATRAND(1.0) * RANDSIGN();
+  mc->rotz = FLOATRAND(1.0) * RANDSIGN();
+
+  /* bell curve from 0-6 degrees, avg 3 */
+  mc->dx = (FLOATRAND(0.1) + FLOATRAND(0.1) + FLOATRAND(0.1)) / (360/2);
+  mc->dy = (FLOATRAND(0.1) + FLOATRAND(0.1) + FLOATRAND(0.1)) / (360/2);
+  mc->dz = (FLOATRAND(0.1) + FLOATRAND(0.1) + FLOATRAND(0.1)) / (360/2);
+
+  mc->d_max = mc->dx * 8;
+
+  mc->ddx = 0.00006 + FLOATRAND(0.00003);
+  mc->ddy = 0.00006 + FLOATRAND(0.00003);
+  mc->ddz = 0.00006 + FLOATRAND(0.00003);
+
+  {
+    char *s = do_spin;
+    while (*s)
+      {
+        if      (*s == 'x' || *s == 'X') mc->spin_x = 1;
+        else if (*s == 'y' || *s == 'Y') mc->spin_y = 1;
+        else if (*s == 'z' || *s == 'Z') mc->spin_z = 1;
+        else
+          {
+            fprintf (stderr,
+         "molecule: spin must contain only the characters X, Y, or Z (not \"%s\")\n",
+                     do_spin);
+            /* exit (1); */
+          }
+        s++;
+      }
+  }
+
+  mc->molecule_dlist = glGenLists(1);
+
+  load_molecules (mi);
+  mc->which =  NRAND(mc->nmolecules);
+  
+#ifdef STANDALONE
+  mc->no_label_threshold = get_float_resource ("noLabelThreshold",
+                                               "NoLabelThreshold");
+  mc->wireframe_threshold = get_float_resource ("wireframeThreshold",
+                                                "WireframeThreshold");
+#else
+  mc->no_label_threshold = 30;
+  mc->wireframe_threshold = 150;
+#endif
+
+  if (wire)
+    do_bonds = 1;
+}
+
+
+void
+draw_molecule (ModeInfo *mi)
+{
+/*  static time_t last = 0; */
+  time_t now = time ((time_t *) 0);
+  molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
+  Display *dpy = MI_DISPLAY(mi);
+  Window window = MI_WINDOW(mi);
+
+  if (!mc->glx_context)
+    return;
+
+  if (last + timeout <= now)   /* randomize molecules every -timeout seconds */
+    {
+      if (mc->nmolecules == 1)
+        {
+          if (last != 0) goto SKIP;
+          mc->which = 0;
+        }
+      else if (last == 0)
+        {
+          mc->which = NRAND(mc->nmolecules);
+        }
+      else
+        {
+          int n = mc->which;
+          while (n == mc->which)
+            n = NRAND(mc->nmolecules);
+          mc->which = n;
+        }
+
+      last = now;
+
+
+      glNewList (mc->molecule_dlist, GL_COMPILE);
+      ensure_bounding_box_visible (mi);
+      if (MI_IS_ICONIC(mi))
+        {do_labels = False;
+        do_bonds  = True;
+         do_titles = False;
+       }
+      else
+        {
+      do_labels = orig_do_labels;
+      do_bonds = orig_do_bonds;
+      do_titles = orig_do_titles;
+        }
+      cur_wire = orig_wire;
+
+      if (mc->molecule_size > mc->no_label_threshold)
+        do_labels = 0;
+      if (mc->molecule_size > mc->wireframe_threshold)
+        cur_wire = 1;
+
+      if (cur_wire)
+        do_bonds = 1;
+
+      build_molecule (mi);
+
+      glEndList();
+    }
+ SKIP:
+
+  glPushMatrix ();
+  glScalef(1.1, 1.1, 1.1);
+
+  {
+    GLfloat x, y, z;
+
+    if (do_wander)
+      {
+        static int frame = 0;
+
+#       define SINOID(SCALE,SIZE) \
+        ((((1 + sin((frame * (SCALE)) / 2 * M_PI)) / 2.0) * (SIZE)) - (SIZE)/2)
+
+        x = SINOID(0.031, 9.0);
+        y = SINOID(0.023, 9.0);
+        z = SINOID(0.017, 9.0);
+        frame++;
+        glTranslatef(x, y, z);
+      }
+
+    if (mc->spin_x || mc->spin_y || mc->spin_z)
+      {
+        x = mc->rotx;
+        y = mc->roty;
+        z = mc->rotz;
+        if (x < 0) x = 1 - (x + 1);
+        if (y < 0) y = 1 - (y + 1);
+        if (z < 0) z = 1 - (z + 1);
+
+        if (mc->spin_x) glRotatef(x * 360, 1.0, 0.0, 0.0);
+        if (mc->spin_y) glRotatef(y * 360, 0.0, 1.0, 0.0);
+        if (mc->spin_z) glRotatef(z * 360, 0.0, 0.0, 1.0);
+
+        rotate(&mc->rotx, &mc->dx, &mc->ddx, mc->d_max);
+        rotate(&mc->roty, &mc->dy, &mc->ddy, mc->d_max);
+        rotate(&mc->rotz, &mc->dz, &mc->ddz, mc->d_max);
+      }
+  }
+
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+  glCallList (mc->molecule_dlist);
+  glPopMatrix ();
+
+  if (MI_IS_FPS(mi)) do_fps (mi);
+  glFinish();
+
+  glXSwapBuffers(dpy, window);
+}
+
+void
+release_molecule(ModeInfo * mi)
+{
+  if (mcs != NULL) {
+       int         screen;
+
+       for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+         molecule_configuration *mc = &mcs[screen];
+
+#if 0
+       int         i;
+
+         for (i = 0; i < mc->nmolecules; i++) {
+           molecule *m = &mc->molecules[i];
+
+           if (m->atoms) {
+               (void) free ((void *) m->atoms);
+               m->atoms = (molecule_atom *) NULL;
+           }
+           if (m->bonds) {
+               (void) free ((void *) m->bonds);
+               m->bonds = (molecule_bond *) NULL;
+           }
+           if (m->label) {
+               (void) free ((void *) m->label);
+               m->label = (char *) NULL;
+           }
+         }
+         if (mc->molecules) {
+               (void) free ((void *) mc->molecules);
+               mc->molecules = (molecule *) NULL;
+         }
+#endif
+
+         if (mc->glx_context) {
+               /* Display lists MUST be freed while their glXContext is current. */
+               glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(mc->glx_context));
+               /* Free font stuff */
+               free_fonts (mi);
+         }
+       }
+       (void) free((void *) mcs);
+       mcs = (molecule_configuration *) NULL;
+  }
+  FreeAllGL(mi);
+}
+
+#endif /* USE_GL */
diff --git a/modes/glx/molecules.h b/modes/glx/molecules.h
new file mode 100644 (file)
index 0000000..9104ac4
--- /dev/null
@@ -0,0 +1,4538 @@
+"HEADER    Adenine: Vitamin B4; Purine base nucleotide\n"
+"COMPND    jb09aden\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Mon Sep 18 15:35:27 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.394   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.084   1.211   0.000  1.00  0.00 \n"
+"HETATM    4  N           1       1.337   2.342  -0.002  1.00  0.00 \n"
+"HETATM    5  C           1      -0.017   2.313  -0.003  1.00  0.00 \n"
+"HETATM    6  N           1      -0.710   1.149  -0.001  1.00  0.00 \n"
+"HETATM    7  N           1      -0.391  -1.291   0.006  1.00  0.00 \n"
+"HETATM    8  C           1       0.731  -2.049   0.010  1.00  0.00 \n"
+"HETATM    9  N           1       1.843  -1.276   0.007  1.00  0.00 \n"
+"HETATM   10  N           1       3.485   1.257   0.004  1.00  0.00 \n"
+"HETATM   11  H           1      -0.567   3.254  -0.004  1.00  0.00 \n"
+"HETATM   12  H           1      -1.347  -1.630   0.010  1.00  0.00 \n"
+"HETATM   13  H           1       0.738  -3.139   0.017  1.00  0.00 \n"
+"HETATM   14  H           1       3.799   2.220  -0.037  1.00  0.00 \n"
+"HETATM   15  H           1       3.839   0.818   0.847  1.00  0.00 \n"
+"CONECT    1    2    2    6    7\n"
+"CONECT    2    1    1    3    9\n"
+"CONECT    3    2    4    4   10\n"
+"CONECT    4    3    3    5\n"
+"CONECT    5    4    6    6   11\n"
+"CONECT    6    1    5    5\n"
+"CONECT    7    1    8   12\n"
+"CONECT    8    7    9    9   13\n"
+"CONECT    9    2    8    8\n"
+"CONECT   10    3   14   15\n"
+"CONECT   11    5\n"
+"CONECT   12    7\n"
+"CONECT   13    8\n"
+"CONECT   14   10\n"
+"CONECT   15   10\n"
+"MASTER        0    0    0    0    0    0    0    0   15    0   15    0\n"
+"END\n"
+,
+"HEADER    Adrenochrome: a nerve cell transmission inhibitor, and hallucinogen\n"
+"COMPND    adrenochrome\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Tue Aug 29 08:56:34 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.400   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.056   1.235   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.351   2.436  -0.011  1.00  0.00 \n"
+"HETATM    5  C           1      -0.047   2.437  -0.027  1.00  0.00 \n"
+"HETATM    6  C           1      -0.714   1.206  -0.013  1.00  0.00 \n"
+"HETATM    7  O           1      -0.597  -1.046  -0.002  1.00  0.00 \n"
+"HETATM    8  O           1      -1.918   1.181  -0.023  1.00  0.00 \n"
+"HETATM    9  N           1       2.243   3.571  -0.065  1.00  0.00 \n"
+"HETATM   10  C           1       1.825   4.648   0.846  1.00  0.00 \n"
+"HETATM   11  C           1       3.553   3.011   0.321  1.00  0.00 \n"
+"HETATM   12  C           1       3.538   1.506  -0.050  1.00  0.00 \n"
+"HETATM   13  H           1       4.088   0.906   0.675  1.00  0.00 \n"
+"HETATM   14  O           1       4.023   1.295  -1.381  1.00  0.00 \n"
+"HETATM   15  H           1       1.962  -0.934  -0.006  1.00  0.00 \n"
+"HETATM   16  H           1      -0.608   3.370  -0.059  1.00  0.00 \n"
+"HETATM   17  H           1       1.674   4.250   1.849  1.00  0.00 \n"
+"HETATM   18  H           1       0.895   5.089   0.489  1.00  0.00 \n"
+"HETATM   19  H           1       2.596   5.418   0.873  1.00  0.00 \n"
+"HETATM   20  H           1       3.683   3.101   1.400  1.00  0.00 \n"
+"HETATM   21  H           1       4.364   3.531  -0.190  1.00  0.00 \n"
+"HETATM   22  H           1       4.963   1.501  -1.423  1.00  0.00 \n"
+"CONECT    1    2    6    7\n"
+"CONECT    1    7\n"
+"CONECT    2    1    3   15\n"
+"CONECT    2    3\n"
+"CONECT    3    2    4   12\n"
+"CONECT    4    3    5    9\n"
+"CONECT    4    5\n"
+"CONECT    5    4    6   16\n"
+"CONECT    6    1    5    8\n"
+"CONECT    6    8\n"
+"CONECT    7    1\n"
+"CONECT    8    6\n"
+"CONECT    9    4   10   11\n"
+"CONECT   10    9   17   18   19\n"
+"CONECT   11    9   12   20   21\n"
+"CONECT   12    3   11   13   14\n"
+"CONECT   13   12\n"
+"CONECT   14   12   22\n"
+"CONECT   15    2\n"
+"CONECT   16    5\n"
+"CONECT   17   10\n"
+"CONECT   18   10\n"
+"CONECT   19   10\n"
+"CONECT   20   11\n"
+"CONECT   21   11\n"
+"CONECT   22   14\n"
+"MASTER        0    0    0    0    0    0    0    0   22    0   22    0\n"
+"END\n"
+,
+"HEADER    Buckminsterfullerine: Bucky Ball\n"
+"COMPND    bucky\n"
+"AUTHOR\n"
+"GENERATED BY SYMAPPS 1.0\n"
+"ATOM      1  C                   0.994   0.523  -3.137\n"
+"ATOM      2  C                   0.418  -0.689  -3.232\n"
+"ATOM      3  C                   1.239  -1.587  -2.654\n"
+"ATOM      4  C                   2.172   0.376  -2.500\n"
+"ATOM      5  C                   2.323  -0.928  -2.202\n"
+"ATOM      6  C                   1.297  -2.968  -0.779\n"
+"ATOM      7  C                   0.727  -2.610  -1.946\n"
+"ATOM      8  C                  -0.608  -2.733  -1.813\n"
+"ATOM      9  C                  -0.863  -3.172  -0.565\n"
+"ATOM     10  C                   0.315  -3.321   0.074\n"
+"ATOM     11  C                  -1.429  -1.836  -2.393\n"
+"ATOM     12  C                  -0.916  -0.814  -3.106\n"
+"ATOM     13  C                  -1.675   0.277  -2.878\n"
+"ATOM     14  C                  -2.657  -0.070  -2.024\n"
+"ATOM     15  C                  -2.506  -1.376  -1.724\n"
+"ATOM     16  C                  -1.096   1.488  -2.779\n"
+"ATOM     17  C                   0.239   1.614  -2.915\n"
+"ATOM     18  C                   0.658   2.557  -2.049\n"
+"ATOM     19  C                  -0.417   3.018  -1.381\n"
+"ATOM     20  C                  -1.503   2.359  -1.834\n"
+"ATOM     21  C                   1.833   2.405  -1.409\n"
+"ATOM     22  C                   2.596   1.319  -1.640\n"
+"ATOM     23  C                   3.167   0.957  -0.474\n"
+"ATOM     24  C                   2.760   1.823   0.475\n"
+"ATOM     25  C                   1.935   2.717  -0.104\n"
+"ATOM     26  C                   3.314  -0.348  -0.175\n"
+"ATOM     27  C                   2.899  -1.293  -1.041\n"
+"ATOM     28  C                   2.384  -2.314  -0.328\n"
+"ATOM     29  C                   2.486  -2.003   0.979\n"
+"ATOM     30  C                   3.063  -0.788   1.074\n"
+"ATOM     31  C                  -2.321   0.938   2.198\n"
+"ATOM     32  C                  -1.237   1.597   2.651\n"
+"ATOM     33  C                  -0.417   0.699   3.231\n"
+"ATOM     34  C                  -2.170  -0.366   2.497\n"
+"ATOM     35  C                  -0.993  -0.514   3.135\n"
+"ATOM     36  C                   1.671  -0.268   2.871\n"
+"ATOM     37  C                   0.916   0.824   3.104\n"
+"ATOM     38  C                   1.430   1.846   2.390\n"
+"ATOM     39  C                   2.506   1.386   1.722\n"
+"ATOM     40  C                   2.653   0.079   2.018\n"
+"ATOM     41  C                   0.609   2.745   1.813\n"
+"ATOM     42  C                  -0.727   2.622   1.945\n"
+"ATOM     43  C                  -1.298   2.984   0.779\n"
+"ATOM     44  C                  -0.315   3.332  -0.075\n"
+"ATOM     45  C                   0.863   3.183   0.564\n"
+"ATOM     46  C                  -2.378   2.321   0.325\n"
+"ATOM     47  C                  -2.896   1.302   1.038\n"
+"ATOM     48  C                  -3.315   0.358   0.172\n"
+"ATOM     49  C                  -3.062   0.797  -1.076\n"
+"ATOM     50  C                  -2.485   2.012  -0.982\n"
+"ATOM     51  C                  -3.159  -0.945   0.470\n"
+"ATOM     52  C                  -2.593  -1.310   1.637\n"
+"ATOM     53  C                  -1.837  -2.402   1.409\n"
+"ATOM     54  C                  -1.939  -2.714   0.103\n"
+"ATOM     55  C                  -2.759  -1.815  -0.477\n"
+"ATOM     56  C                  -0.658  -2.546   2.045\n"
+"ATOM     57  C                  -0.238  -1.605   2.914\n"
+"ATOM     58  C                   1.097  -1.482   2.780\n"
+"ATOM     59  C                   1.503  -2.349   1.832\n"
+"ATOM     60  C                   0.418  -3.010   1.379\n"
+"CONECT   21   25\n"
+"CONECT   26   27\n"
+"CONECT    2    3\n"
+"CONECT    1    4\n"
+"CONECT    7    8\n"
+"CONECT    8    9\n"
+"CONECT    9   10\n"
+"CONECT   27   28\n"
+"CONECT   28   29\n"
+"CONECT   29   30\n"
+"CONECT   26   30\n"
+"CONECT    6   10\n"
+"CONECT   11   12\n"
+"CONECT    3    7\n"
+"CONECT    8   11\n"
+"CONECT    3    5\n"
+"CONECT    1   17\n"
+"CONECT    5   27\n"
+"CONECT   12   13\n"
+"CONECT   13   14\n"
+"CONECT   14   15\n"
+"CONECT   11   15\n"
+"CONECT   16   17\n"
+"CONECT    6   28\n"
+"CONECT    4    5\n"
+"CONECT   18   21\n"
+"CONECT    1    2\n"
+"CONECT    4   22\n"
+"CONECT   17   18\n"
+"CONECT   18   19\n"
+"CONECT   19   20\n"
+"CONECT   16   20\n"
+"CONECT   21   22\n"
+"CONECT   23   26\n"
+"CONECT    6    7\n"
+"CONECT    2   12\n"
+"CONECT   13   16\n"
+"CONECT   22   23\n"
+"CONECT   23   24\n"
+"CONECT   24   25\n"
+"CONECT   36   40\n"
+"CONECT   41   42\n"
+"CONECT   33   37\n"
+"CONECT   38   41\n"
+"CONECT   33   35\n"
+"CONECT   31   47\n"
+"CONECT   35   57\n"
+"CONECT   42   43\n"
+"CONECT   43   44\n"
+"CONECT   44   45\n"
+"CONECT   41   45\n"
+"CONECT   46   47\n"
+"CONECT   36   58\n"
+"CONECT   34   35\n"
+"CONECT   48   51\n"
+"CONECT   31   32\n"
+"CONECT   34   52\n"
+"CONECT   47   48\n"
+"CONECT   48   49\n"
+"CONECT   49   50\n"
+"CONECT   46   50\n"
+"CONECT   51   52\n"
+"CONECT   53   56\n"
+"CONECT   36   37\n"
+"CONECT   32   42\n"
+"CONECT   43   46\n"
+"CONECT   52   53\n"
+"CONECT   53   54\n"
+"CONECT   54   55\n"
+"CONECT   51   55\n"
+"CONECT   56   57\n"
+"CONECT   32   33\n"
+"CONECT   31   34\n"
+"CONECT   37   38\n"
+"CONECT   38   39\n"
+"CONECT   39   40\n"
+"CONECT   57   58\n"
+"CONECT   58   59\n"
+"CONECT   59   60\n"
+"CONECT   56   60\n"
+"CONECT   10   60\n"
+"CONECT   29   59\n"
+"CONECT   30   40\n"
+"CONECT   24   39\n"
+"CONECT    9   54\n"
+"CONECT   15   55\n"
+"CONECT   14   49\n"
+"CONECT   20   50\n"
+"CONECT   19   44\n"
+"CONECT   25   45\n"
+"MASTER        0    0    0    0    0    0    0    0   60    0    0    0\n"
+"END\n"
+,
+"HEADER    Caffeine: Trimethylxanthine; a cardiac stimulant and diuretic\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep 29 14:53:27 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.392   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  N           1       2.076   1.164   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.373   2.321  -0.003  1.00  0.00 \n"
+"HETATM    5  O           1       1.978   3.365  -0.017  1.00  0.00 \n"
+"HETATM    6  N           1       0.017   2.344   0.003  1.00  0.00 \n"
+"HETATM    7  C           1      -0.710   1.202   0.002  1.00  0.00 \n"
+"HETATM    8  O           1      -1.915   1.218  -0.006  1.00  0.00 \n"
+"HETATM    9  N           1      -0.404  -1.287  -0.019  1.00  0.00 \n"
+"HETATM   10  N           1       1.830  -1.279  -0.020  1.00  0.00 \n"
+"HETATM   11  C           1       0.715  -2.048  -0.031  1.00  0.00 \n"
+"HETATM   12  C           1      -1.795  -1.761  -0.044  1.00  0.00 \n"
+"HETATM   13  C           1       3.546   1.178  -0.016  1.00  0.00 \n"
+"HETATM   14  C           1      -0.690   3.634  -0.013  1.00  0.00 \n"
+"HETATM   15  H           1       0.720  -3.138  -0.055  1.00  0.00 \n"
+"HETATM   16  H           1      -1.813  -2.850  -0.090  1.00  0.00 \n"
+"HETATM   17  H           1      -2.307  -1.428   0.860  1.00  0.00 \n"
+"HETATM   18  H           1      -2.302  -1.352  -0.918  1.00  0.00 \n"
+"HETATM   19  H           1       3.894   1.455  -1.011  1.00  0.00 \n"
+"HETATM   20  H           1       3.929   0.190   0.239  1.00  0.00 \n"
+"HETATM   21  H           1       3.911   1.904   0.710  1.00  0.00 \n"
+"HETATM   22  H           1      -1.557   3.583   0.645  1.00  0.00 \n"
+"HETATM   23  H           1      -0.027   4.428   0.329  1.00  0.00 \n"
+"HETATM   24  H           1      -1.020   3.851  -1.029  1.00  0.00 \n"
+"CONECT    1    2    2    7    9\n"
+"CONECT    2    1    1    3   10\n"
+"CONECT    3    2    4   13\n"
+"CONECT    4    3    5    5    6\n"
+"CONECT    5    4    4\n"
+"CONECT    6    4    7   14\n"
+"CONECT    7    1    6    8    8\n"
+"CONECT    8    7    7\n"
+"CONECT    9    1   11   12\n"
+"CONECT   10    2   11   11\n"
+"CONECT   11    9   10   10   15\n"
+"CONECT   12    9   16   17   18\n"
+"CONECT   13    3   19   20   21\n"
+"CONECT   14    6   22   23   24\n"
+"CONECT   15   11\n"
+"CONECT   16   12\n"
+"CONECT   17   12\n"
+"CONECT   18   12\n"
+"CONECT   19   13\n"
+"CONECT   20   13\n"
+"CONECT   21   13\n"
+"CONECT   22   14\n"
+"CONECT   23   14\n"
+"CONECT   24   14\n"
+"MASTER        0    0    0    0    0    0    0    0   24    0   24    0\n"
+"END\n"
+,
+"HEADER    Chlordecone: Kepone, an insecticide and fungicide\n"
+"COMPND    al1113\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Tue Aug 29 17:54:52 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  O           1       1.206   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1      -0.741   1.303   0.000  1.00  0.00 \n"
+"HETATM    4  C           1      -0.875   1.738  -1.482  1.00  0.00 \n"
+"HETATM    5  C           1      -0.879   0.377  -2.249  1.00  0.00 \n"
+"HETATM    6  C           1      -0.745  -0.666  -1.117  1.00  0.00 \n"
+"HETATM    7  C           1      -2.247   0.958  -0.112  1.00  0.00 \n"
+"HETATM    8  C           1      -2.380   1.999  -1.247  1.00  0.00 \n"
+"HETATM    9  C           1      -2.237  -0.385  -0.887  1.00  0.00 \n"
+"HETATM   10  C           1      -2.379   0.045  -2.350  1.00  0.00 \n"
+"HETATM   11  C           1      -3.162   1.358  -2.394  1.00  0.00 \n"
+"HETATM   12 Cl           1       0.142   3.061  -2.080  1.00  0.00 \n"
+"HETATM   13 Cl           1      -0.299   2.574   1.159  1.00  0.00 \n"
+"HETATM   14 Cl           1      -2.803   3.653  -0.734  1.00  0.00 \n"
+"HETATM   15 Cl           1      -3.272   1.132   1.330  1.00  0.00 \n"
+"HETATM   16 Cl           1      -3.275  -1.723  -0.285  1.00  0.00 \n"
+"HETATM   17 Cl           1      -4.883   1.128  -1.986  1.00  0.00 \n"
+"HETATM   18 Cl           1      -2.936   2.229  -3.931  1.00  0.00 \n"
+"HETATM   19 Cl           1      -2.805  -1.246  -3.509  1.00  0.00 \n"
+"HETATM   20 Cl           1       0.141   0.211  -3.696  1.00  0.00 \n"
+"HETATM   21 Cl           1      -0.301  -2.317  -1.612  1.00  0.00 \n"
+"CONECT    1    2    2    3    6\n"
+"CONECT    2    1    1\n"
+"CONECT    3    1    4    7   13\n"
+"CONECT    4    3    5    8   12\n"
+"CONECT    5    4    6   10   20\n"
+"CONECT    6    1    5    9   21\n"
+"CONECT    7    3    8    9   15\n"
+"CONECT    8    4    7   11   14\n"
+"CONECT    9    6    7   10   16\n"
+"CONECT   10    5    9   11   19\n"
+"CONECT   11    8   10   17   18\n"
+"CONECT   12    4\n"
+"CONECT   13    3\n"
+"CONECT   14    8\n"
+"CONECT   15    7\n"
+"CONECT   16    9\n"
+"CONECT   17   11\n"
+"CONECT   18   11\n"
+"CONECT   19   10\n"
+"CONECT   20    5\n"
+"CONECT   21    6\n"
+"MASTER        0    0    0    0    0    0    0    0   21    0   21    0\n"
+"END\n"
+,
+"HEADER    Cocaine: Carboxylicacid methyl ester, an anesthetic\n"
+"COMPND    al3078\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.399   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.099   1.211   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.400   2.423  -0.002  1.00  0.00 \n"
+"HETATM    5  C           1       0.001   2.423  -0.007  1.00  0.00 \n"
+"HETATM    6  C           1      -0.700   1.213  -0.005  1.00  0.00 \n"
+"HETATM    7  C           1      -2.156   1.218  -0.022  1.00  0.00 \n"
+"HETATM    8  O           1      -2.759   0.175  -0.044  1.00  0.00 \n"
+"HETATM    9  O           1      -2.806   2.379  -0.075  1.00  0.00 \n"
+"HETATM   10  C           1      -4.168   2.239   0.272  1.00  0.00 \n"
+"HETATM   11  C           1      -4.872   3.590   0.031  1.00  0.00 \n"
+"HETATM   12  C           1      -4.061   4.678   0.674  1.00  0.00 \n"
+"HETATM   13  O           1      -4.560   5.346   1.542  1.00  0.00 \n"
+"HETATM   14  O           1      -2.741   4.690   0.497  1.00  0.00 \n"
+"HETATM   15  C           1      -2.091   5.352   1.560  1.00  0.00 \n"
+"HETATM   16  C           1      -6.281   3.587   0.659  1.00  0.00 \n"
+"HETATM   17  N           1      -6.101   3.424   2.109  1.00  0.00 \n"
+"HETATM   18  C           1      -7.084   2.348   0.212  1.00  0.00 \n"
+"HETATM   19  C           1      -6.737   1.277   1.267  1.00  0.00 \n"
+"HETATM   20  C           1      -5.765   1.998   2.226  1.00  0.00 \n"
+"HETATM   21  C           1      -4.304   1.831   1.755  1.00  0.00 \n"
+"HETATM   22  C           1      -7.322   3.768   2.857  1.00  0.00 \n"
+"HETATM   23  H           1      -0.544  -0.944  -0.002  1.00  0.00 \n"
+"HETATM   24  H           1       1.944  -0.944   0.000  1.00  0.00 \n"
+"HETATM   25  H           1       3.189   1.211   0.001  1.00  0.00 \n"
+"HETATM   26  H           1       1.945   3.367  -0.004  1.00  0.00 \n"
+"HETATM   27  H           1      -0.544   3.368  -0.019  1.00  0.00 \n"
+"HETATM   28  H           1      -4.624   1.481  -0.363  1.00  0.00 \n"
+"HETATM   29  H           1      -4.942   3.777  -1.041  1.00  0.00 \n"
+"HETATM   30  H           1      -2.425   6.389   1.609  1.00  0.00 \n"
+"HETATM   31  H           1      -2.320   4.851   2.501  1.00  0.00 \n"
+"HETATM   32  H           1      -1.014   5.330   1.395  1.00  0.00 \n"
+"HETATM   33  H           1      -6.802   4.513   0.416  1.00  0.00 \n"
+"HETATM   34  H           1      -6.806   2.035  -0.795  1.00  0.00 \n"
+"HETATM   35  H           1      -8.152   2.564   0.250  1.00  0.00 \n"
+"HETATM   36  H           1      -6.275   0.397   0.819  1.00  0.00 \n"
+"HETATM   37  H           1      -7.641   0.988   1.803  1.00  0.00 \n"
+"HETATM   38  H           1      -5.872   1.638   3.249  1.00  0.00 \n"
+"HETATM   39  H           1      -3.995   0.793   1.881  1.00  0.00 \n"
+"HETATM   40  H           1      -3.664   2.470   2.364  1.00  0.00 \n"
+"HETATM   41  H           1      -8.166   3.167   2.523  1.00  0.00 \n"
+"HETATM   42  H           1      -7.551   4.823   2.706  1.00  0.00 \n"
+"HETATM   43  H           1      -7.155   3.591   3.920  1.00  0.00 \n"
+"CONECT    1    2    2    6   23\n"
+"CONECT    2    1    1    3   24\n"
+"CONECT    3    2    4    4   25\n"
+"CONECT    4    3    3    5   26\n"
+"CONECT    5    4    6    6   27\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8    8    9\n"
+"CONECT    8    7    7\n"
+"CONECT    9    7   10\n"
+"CONECT   10    9   11   21   28\n"
+"CONECT   11   10   12   16   29\n"
+"CONECT   12   11   13   13   14\n"
+"CONECT   13   12   12\n"
+"CONECT   14   12   15\n"
+"CONECT   15   14   30   31   32\n"
+"CONECT   16   11   17   18   33\n"
+"CONECT   17   16   20   22\n"
+"CONECT   18   16   19   34   35\n"
+"CONECT   19   18   20   36   37\n"
+"CONECT   20   17   19   21   38\n"
+"CONECT   21   10   20   39   40\n"
+"CONECT   22   17   41   42   43\n"
+"CONECT   23    1\n"
+"CONECT   24    2\n"
+"CONECT   25    3\n"
+"CONECT   26    4\n"
+"CONECT   27    5\n"
+"CONECT   28   10\n"
+"CONECT   29   11\n"
+"CONECT   30   15\n"
+"CONECT   31   15\n"
+"CONECT   32   15\n"
+"CONECT   33   16\n"
+"CONECT   34   18\n"
+"CONECT   35   18\n"
+"CONECT   36   19\n"
+"CONECT   37   19\n"
+"CONECT   38   20\n"
+"CONECT   39   21\n"
+"CONECT   40   21\n"
+"CONECT   41   22\n"
+"CONECT   42   22\n"
+"CONECT   43   22\n"
+"MASTER        0    0    0    0    0    0    0    0   43    0   43    0\n"
+"END\n"
+,
+"HEADER    Methylmorphine: Codeine, a cough reflex inhibitor\n"
+"COMPND    al3083\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.400   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.107   1.211   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.445   2.445  -0.038  1.00  0.00 \n"
+"HETATM    5  C           1       0.048   2.457   0.012  1.00  0.00 \n"
+"HETATM    6  C           1      -0.629   1.242   0.047  1.00  0.00 \n"
+"HETATM    7  C           1      -2.076   1.497  -0.256  1.00  0.00 \n"
+"HETATM    8  C           1      -2.718   0.335  -1.023  1.00  0.00 \n"
+"HETATM    9  C           1      -2.362  -0.955  -0.251  1.00  0.00 \n"
+"HETATM   10  C           1      -0.830  -1.234  -0.281  1.00  0.00 \n"
+"HETATM   11  C           1      -1.864   2.827  -1.015  1.00  0.00 \n"
+"HETATM   12  C           1      -2.785   1.642   1.099  1.00  0.00 \n"
+"HETATM   13  C           1      -2.549   0.335   1.888  1.00  0.00 \n"
+"HETATM   14  N           1      -2.944  -0.846   1.100  1.00  0.00 \n"
+"HETATM   15  C           1      -2.815  -2.080   1.892  1.00  0.00 \n"
+"HETATM   16  H           1      -3.800   0.464  -1.011  1.00  0.00 \n"
+"HETATM   17  C           1      -2.286   0.268  -2.470  1.00  0.00 \n"
+"HETATM   18  C           1      -2.002   1.392  -3.142  1.00  0.00 \n"
+"HETATM   19  C           1      -1.354   2.572  -2.453  1.00  0.00 \n"
+"HETATM   20  H           1      -2.774   3.428  -1.022  1.00  0.00 \n"
+"HETATM   21  O           1      -0.789   3.474  -0.352  1.00  0.00 \n"
+"HETATM   22  H           1      -1.514   3.472  -3.047  1.00  0.00 \n"
+"HETATM   23  O           1       0.051   2.305  -2.404  1.00  0.00 \n"
+"HETATM   24  O           1       2.148   3.606  -0.170  1.00  0.00 \n"
+"HETATM   25  H           1       1.942  -0.944  -0.064  1.00  0.00 \n"
+"HETATM   26  H           1       3.196   1.191  -0.044  1.00  0.00 \n"
+"HETATM   27  H           1      -2.856  -1.789  -0.750  1.00  0.00 \n"
+"HETATM   28  H           1      -0.570  -1.581  -1.281  1.00  0.00 \n"
+"HETATM   29  H           1      -0.575  -2.018   0.429  1.00  0.00 \n"
+"HETATM   30  H           1      -3.852   1.800   0.945  1.00  0.00 \n"
+"HETATM   31  H           1      -2.368   2.484   1.653  1.00  0.00 \n"
+"HETATM   32  H           1      -3.143   0.370   2.801  1.00  0.00 \n"
+"HETATM   33  H           1      -1.498   0.252   2.165  1.00  0.00 \n"
+"HETATM   34  H           1      -3.495  -2.034   2.743  1.00  0.00 \n"
+"HETATM   35  H           1      -1.796  -2.189   2.261  1.00  0.00 \n"
+"HETATM   36  H           1      -3.075  -2.943   1.279  1.00  0.00 \n"
+"HETATM   37  H           1      -2.526  -0.630  -3.039  1.00  0.00 \n"
+"HETATM   38  H           1      -1.938   1.338  -4.229  1.00  0.00 \n"
+"HETATM   39  H           1       0.396   2.184  -3.295  1.00  0.00 \n"
+"HETATM   40  C           1       2.068   4.090  -1.493  1.00  0.00 \n"
+"HETATM   41  H           1       2.413   3.325  -2.189  1.00  0.00 \n"
+"HETATM   42  H           1       1.038   4.360  -1.728  1.00  0.00 \n"
+"HETATM   43  H           1       2.699   4.974  -1.590  1.00  0.00 \n"
+"CONECT    1    2    2    6   10\n"
+"CONECT    2    1    1    3   25\n"
+"CONECT    3    2    4    4   26\n"
+"CONECT    4    3    3    5   24\n"
+"CONECT    5    4    6    6   21\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8   11   12\n"
+"CONECT    8    7    9   16   17\n"
+"CONECT    9    8   10   14   27\n"
+"CONECT   10    1    9   28   29\n"
+"CONECT   11    7   19   20   21\n"
+"CONECT   12    7   13   30   31\n"
+"CONECT   13   12   14   32   33\n"
+"CONECT   14    9   13   15\n"
+"CONECT   15   14   34   35   36\n"
+"CONECT   16    8\n"
+"CONECT   17    8   18   18   37\n"
+"CONECT   18   17   17   19   38\n"
+"CONECT   19   11   18   22   23\n"
+"CONECT   20   11\n"
+"CONECT   21    5   11\n"
+"CONECT   22   19\n"
+"CONECT   23   19   39\n"
+"CONECT   24    4   40\n"
+"CONECT   25    2\n"
+"CONECT   26    3\n"
+"CONECT   27    9\n"
+"CONECT   28   10\n"
+"CONECT   29   10\n"
+"CONECT   30   12\n"
+"CONECT   31   12\n"
+"CONECT   32   13\n"
+"CONECT   33   13\n"
+"CONECT   34   15\n"
+"CONECT   35   15\n"
+"CONECT   36   15\n"
+"CONECT   37   17\n"
+"CONECT   38   18\n"
+"CONECT   39   23\n"
+"CONECT   40   24   41   42   43\n"
+"CONECT   41   40\n"
+"CONECT   42   40\n"
+"CONECT   43   40\n"
+"MASTER        0    0    0    0    0    0    0    0   43    0   43    0\n"
+"END\n"
+,
+"HEADER    Cyclohexane: 1,2,3,4,5,6-hexaisopropylcyclohexane\n"
+"COMPND    al3063\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Sun Sep  3 10:20:00 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.565   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.185   1.436   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.565   2.409   1.058  1.00  0.00 \n"
+"HETATM    5  C           1       0.011   2.333   1.199  1.00  0.00 \n"
+"HETATM    6  C           1      -0.636   0.914   1.102  1.00  0.00 \n"
+"HETATM    7  C           1       2.238  -0.920   1.062  1.00  0.00 \n"
+"HETATM    8  C           1       3.676  -1.279   0.632  1.00  0.00 \n"
+"HETATM    9  C           1       1.540  -2.282   1.218  1.00  0.00 \n"
+"HETATM   10  C           1       2.217   2.309   2.471  1.00  0.00 \n"
+"HETATM   11  C           1       1.987   3.605   3.278  1.00  0.00 \n"
+"HETATM   12  C           1       3.745   2.126   2.455  1.00  0.00 \n"
+"HETATM   13  C           1      -0.726   0.166   2.473  1.00  0.00 \n"
+"HETATM   14  C           1      -1.806  -0.942   2.413  1.00  0.00 \n"
+"HETATM   15  C           1      -1.162   1.048   3.662  1.00  0.00 \n"
+"HETATM   16  C           1      -0.814   3.472   0.513  1.00  0.00 \n"
+"HETATM   17  C           1      -0.477   3.821  -0.947  1.00  0.00 \n"
+"HETATM   18  C           1      -0.663   4.782   1.320  1.00  0.00 \n"
+"HETATM   19  C           1      -0.573   0.185  -1.439  1.00  0.00 \n"
+"HETATM   20  C           1      -2.077   0.514  -1.474  1.00  0.00 \n"
+"HETATM   21  C           1      -0.420  -1.124  -2.240  1.00  0.00 \n"
+"HETATM   22  C           1       2.365   2.070  -1.423  1.00  0.00 \n"
+"HETATM   23  C           1       3.380   3.248  -1.378  1.00  0.00 \n"
+"HETATM   24  C           1       2.947   1.067  -2.454  1.00  0.00 \n"
+"HETATM   25  H           1      -0.308  -1.011   0.219  1.00  0.00 \n"
+"HETATM   26  H           1       1.866  -0.481  -0.919  1.00  0.00 \n"
+"HETATM   27  H           1       3.219   1.312   0.276  1.00  0.00 \n"
+"HETATM   28  H           1       1.800   3.418   0.741  1.00  0.00 \n"
+"HETATM   29  H           1      -0.171   2.602   2.221  1.00  0.00 \n"
+"HETATM   30  H           1      -1.683   1.071   0.864  1.00  0.00 \n"
+"HETATM   31  H           1       2.274  -0.432   2.031  1.00  0.00 \n"
+"HETATM   32  H           1       4.296  -0.395   0.523  1.00  0.00 \n"
+"HETATM   33  H           1       3.659  -1.819  -0.314  1.00  0.00 \n"
+"HETATM   34  H           1       4.129  -1.913   1.395  1.00  0.00 \n"
+"HETATM   35  H           1       1.366  -2.731   0.241  1.00  0.00 \n"
+"HETATM   36  H           1       0.598  -2.162   1.743  1.00  0.00 \n"
+"HETATM   37  H           1       2.167  -2.946   1.814  1.00  0.00 \n"
+"HETATM   38  H           1       1.784   1.476   3.021  1.00  0.00 \n"
+"HETATM   39  H           1       0.931   3.795   3.446  1.00  0.00 \n"
+"HETATM   40  H           1       2.426   4.454   2.754  1.00  0.00 \n"
+"HETATM   41  H           1       2.462   3.505   4.254  1.00  0.00 \n"
+"HETATM   42  H           1       4.206   2.819   1.750  1.00  0.00 \n"
+"HETATM   43  H           1       3.992   1.100   2.194  1.00  0.00 \n"
+"HETATM   44  H           1       4.144   2.311   3.452  1.00  0.00 \n"
+"HETATM   45  H           1       0.232  -0.273   2.732  1.00  0.00 \n"
+"HETATM   46  H           1      -1.609  -1.663   1.627  1.00  0.00 \n"
+"HETATM   47  H           1      -2.784  -0.492   2.238  1.00  0.00 \n"
+"HETATM   48  H           1      -1.828  -1.479   3.361  1.00  0.00 \n"
+"HETATM   49  H           1      -1.986   1.697   3.365  1.00  0.00 \n"
+"HETATM   50  H           1      -0.323   1.642   4.019  1.00  0.00 \n"
+"HETATM   51  H           1      -1.487   0.415   4.488  1.00  0.00 \n"
+"HETATM   52  H           1      -1.870   3.206   0.555  1.00  0.00 \n"
+"HETATM   53  H           1      -0.618   2.957  -1.586  1.00  0.00 \n"
+"HETATM   54  H           1       0.544   4.192  -1.014  1.00  0.00 \n"
+"HETATM   55  H           1      -1.151   4.606  -1.289  1.00  0.00 \n"
+"HETATM   56  H           1       0.380   5.094   1.338  1.00  0.00 \n"
+"HETATM   57  H           1      -1.015   4.632   2.341  1.00  0.00 \n"
+"HETATM   58  H           1      -1.262   5.567   0.860  1.00  0.00 \n"
+"HETATM   59  H           1      -0.035   0.957  -1.972  1.00  0.00 \n"
+"HETATM   60  H           1      -2.246   1.523  -1.106  1.00  0.00 \n"
+"HETATM   61  H           1      -2.630  -0.201  -0.864  1.00  0.00 \n"
+"HETATM   62  H           1      -2.439   0.465  -2.501  1.00  0.00 \n"
+"HETATM   63  H           1      -0.991  -1.924  -1.768  1.00  0.00 \n"
+"HETATM   64  H           1       0.625  -1.418  -2.300  1.00  0.00 \n"
+"HETATM   65  H           1      -0.791  -0.971  -3.254  1.00  0.00 \n"
+"HETATM   66  H           1       1.430   2.438  -1.818  1.00  0.00 \n"
+"HETATM   67  H           1       4.327   2.902  -0.962  1.00  0.00 \n"
+"HETATM   68  H           1       3.011   4.079  -0.782  1.00  0.00 \n"
+"HETATM   69  H           1       3.557   3.619  -2.388  1.00  0.00 \n"
+"HETATM   70  H           1       2.183   0.367  -2.790  1.00  0.00 \n"
+"HETATM   71  H           1       3.780   0.521  -2.010  1.00  0.00 \n"
+"HETATM   72  H           1       3.306   1.606  -3.330  1.00  0.00 \n"
+"CONECT    1    2    6   19   25\n"
+"CONECT    2    1    3    7   26\n"
+"CONECT    3    2    4   22   27\n"
+"CONECT    4    3    5   10   28\n"
+"CONECT    5    4    6   16   29\n"
+"CONECT    6    1    5   13   30\n"
+"CONECT    7    2    8    9   31\n"
+"CONECT    8    7   32   33   34\n"
+"CONECT    9    7   35   36   37\n"
+"CONECT   10    4   11   12   38\n"
+"CONECT   11   10   39   40   41\n"
+"CONECT   12   10   42   43   44\n"
+"CONECT   13    6   14   15   45\n"
+"CONECT   14   13   46   47   48\n"
+"CONECT   15   13   49   50   51\n"
+"CONECT   16    5   17   18   52\n"
+"CONECT   17   16   53   54   55\n"
+"CONECT   18   16   56   57   58\n"
+"CONECT   19    1   20   21   59\n"
+"CONECT   20   19   60   61   62\n"
+"CONECT   21   19   63   64   65\n"
+"CONECT   22    3   23   24   66\n"
+"CONECT   23   22   67   68   69\n"
+"CONECT   24   22   70   71   72\n"
+"CONECT   25    1\n"
+"CONECT   26    2\n"
+"CONECT   27    3\n"
+"CONECT   28    4\n"
+"CONECT   29    5\n"
+"CONECT   30    6\n"
+"CONECT   31    7\n"
+"CONECT   32    8\n"
+"CONECT   33    8\n"
+"CONECT   34    8\n"
+"CONECT   35    9\n"
+"CONECT   36    9\n"
+"CONECT   37    9\n"
+"CONECT   38   10\n"
+"CONECT   39   11\n"
+"CONECT   40   11\n"
+"CONECT   41   11\n"
+"CONECT   42   12\n"
+"CONECT   43   12\n"
+"CONECT   44   12\n"
+"CONECT   45   13\n"
+"CONECT   46   14\n"
+"CONECT   47   14\n"
+"CONECT   48   14\n"
+"CONECT   49   15\n"
+"CONECT   50   15\n"
+"CONECT   51   15\n"
+"CONECT   52   16\n"
+"CONECT   53   17\n"
+"CONECT   54   17\n"
+"CONECT   55   17\n"
+"CONECT   56   18\n"
+"CONECT   57   18\n"
+"CONECT   58   18\n"
+"CONECT   59   19\n"
+"CONECT   60   20\n"
+"CONECT   61   20\n"
+"CONECT   62   20\n"
+"CONECT   63   21\n"
+"CONECT   64   21\n"
+"CONECT   65   21\n"
+"CONECT   66   22\n"
+"CONECT   67   23\n"
+"CONECT   68   23\n"
+"CONECT   69   23\n"
+"CONECT   70   24\n"
+"CONECT   71   24\n"
+"CONECT   72   24\n"
+"MASTER        0    0    0    0    0    0    0    0   72    0   72    0\n"
+"END\n"
+,
+"HEADER    Cytosine: Pyrimidine base nucleotide\n"
+"COMPND    jb09cyto\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep 29 12:35:29 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.398   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.070   1.227   0.000  1.00  0.00 \n"
+"HETATM    4  N           1       1.356   2.375   0.001  1.00  0.00 \n"
+"HETATM    5  C           1       0.004   2.350   0.002  1.00  0.00 \n"
+"HETATM    6  N           1      -0.667   1.176   0.001  1.00  0.00 \n"
+"HETATM    7  O           1      -0.611   3.389   0.004  1.00  0.00 \n"
+"HETATM    8  N           1       3.477   1.271   0.003  1.00  0.00 \n"
+"HETATM    9  H           1      -0.548  -0.942   0.000  1.00  0.00 \n"
+"HETATM   10  H           1       1.954  -0.938   0.001  1.00  0.00 \n"
+"HETATM   11  H           1      -1.681   1.178   0.002  1.00  0.00 \n"
+"HETATM   12  H           1       3.791   2.109   0.480  1.00  0.00 \n"
+"HETATM   13  H           1       3.844   0.453   0.477  1.00  0.00 \n"
+"CONECT    1    2    2    6    9\n"
+"CONECT    2    1    1    3   10\n"
+"CONECT    3    2    4    4    8\n"
+"CONECT    4    3    3    5\n"
+"CONECT    5    4    6    7    7\n"
+"CONECT    6    1    5   11\n"
+"CONECT    7    5    5\n"
+"CONECT    8    3   12   13\n"
+"CONECT    9    1\n"
+"CONECT   10    2\n"
+"CONECT   11    6\n"
+"CONECT   12    8\n"
+"CONECT   13    8\n"
+"MASTER        0    0    0    0    0    0    0    0   13    0   13    0\n"
+"END\n"
+,
+"HEADER    DNA: Deoxyribonucleic acid\n"
+"ATOM      1  O   ???     1       4.674  19.391 -10.106\n"
+"ATOM      2  C   ???     1       4.459  17.981  -9.876\n"
+"ATOM      3  C   ???     1       5.288  17.571  -8.673\n"
+"ATOM      4  O   ???     1       4.895  17.956  -7.317\n"
+"ATOM      5  C   ???     1       5.700  16.166  -8.515\n"
+"ATOM      6  O   ???     1       6.993  16.174  -7.868\n"
+"ATOM      7  C   ???     1       4.606  15.591  -7.605\n"
+"ATOM      8  C   ???     1       4.489  16.741  -6.607\n"
+"ATOM      9  N   ???     1       3.143  16.925  -5.903\n"
+"ATOM     10  C   ???     1       3.127  17.319  -4.578\n"
+"ATOM     11  O   ???     1       4.173  17.497  -3.993\n"
+"ATOM     12  N   ???     1       1.955  17.554  -3.958\n"
+"ATOM     13  C   ???     1       0.773  17.466  -4.621\n"
+"ATOM     14  N   ???     1      -0.393  17.691  -3.955\n"
+"ATOM     15  C   ???     1       0.722  17.134  -5.985\n"
+"ATOM     16  C   ???     1       1.945  16.843  -6.625\n"
+"ATOM     17  P   ???     1       7.833  14.873  -7.879\n"
+"ATOM     18  O   ???     1       6.913  13.703  -8.299\n"
+"ATOM     19  O   ???     1       9.116  15.075  -8.639\n"
+"ATOM     20  O   ???     1       8.137  14.505  -6.390\n"
+"ATOM     21  C   ???     1       9.093  15.196  -5.586\n"
+"ATOM     22  C   ???     1       8.913  14.574  -4.231\n"
+"ATOM     23  O   ???     1       7.518  14.735  -3.865\n"
+"ATOM     24  C   ???     1       9.081  13.086  -4.262\n"
+"ATOM     25  O   ???     1      10.078  12.703  -3.397\n"
+"ATOM     26  C   ???     1       7.686  12.473  -4.029\n"
+"ATOM     27  C   ???     1       7.063  13.543  -3.201\n"
+"ATOM     28  N   ???     1       5.563  13.566  -3.134\n"
+"ATOM     29  C   ???     1       4.657  13.394  -4.141\n"
+"ATOM     30  N   ???     1       3.380  13.664  -3.752\n"
+"ATOM     31  C   ???     1       3.485  14.024  -2.465\n"
+"ATOM     32  C   ???     1       2.474  14.525  -1.574\n"
+"ATOM     33  O   ???     1       1.309  14.806  -1.867\n"
+"ATOM     34  N   ???     1       2.958  14.808  -0.289\n"
+"ATOM     35  C   ???     1       4.279  14.700   0.121\n"
+"ATOM     36  N   ???     1       4.596  14.961   1.424\n"
+"ATOM     37  N   ???     1       5.242  14.292  -0.749\n"
+"ATOM     38  C   ???     1       4.801  13.971  -2.035\n"
+"ATOM     39  P   ???     1      10.462  11.185  -3.172\n"
+"ATOM     40  O   ???     1       9.914  10.272  -4.247\n"
+"ATOM     41  O   ???     1      11.949  11.216  -2.975\n"
+"ATOM     42  O   ???     1       9.792  10.862  -1.765\n"
+"ATOM     43  C   ???     1      10.265  11.478  -0.528\n"
+"ATOM     44  C   ???     1       9.204  11.248   0.526\n"
+"ATOM     45  O   ???     1       7.918  11.627   0.016\n"
+"ATOM     46  C   ???     1       9.052   9.838   1.036\n"
+"ATOM     47  O   ???     1       9.614   9.642   2.306\n"
+"ATOM     48  C   ???     1       7.597   9.524   0.982\n"
+"ATOM     49  C   ???     1       6.965  10.887   0.744\n"
+"ATOM     50  N   ???     1       5.832  10.810  -0.183\n"
+"ATOM     51  C   ???     1       4.534  11.009   0.257\n"
+"ATOM     52  O   ???     1       4.306  11.269   1.440\n"
+"ATOM     53  N   ???     1       3.534  10.905  -0.642\n"
+"ATOM     54  C   ???     1       3.770  10.552  -1.926\n"
+"ATOM     55  N   ???     1       2.773  10.591  -2.855\n"
+"ATOM     56  C   ???     1       5.043  10.250  -2.374\n"
+"ATOM     57  C   ???     1       6.091  10.396  -1.479\n"
+"ATOM     58  P   ???     1       9.660   8.226   2.989\n"
+"ATOM     59  O   ???     1       9.518   7.127   1.928\n"
+"ATOM     60  O   ???     1      10.794   8.089   3.999\n"
+"ATOM     61  O   ???     1       8.355   8.291   3.834\n"
+"ATOM     62  C   ???     1       8.139   9.269   4.865\n"
+"ATOM     63  C   ???     1       6.937   8.745   5.644\n"
+"ATOM     64  O   ???     1       5.814   8.819   4.753\n"
+"ATOM     65  C   ???     1       6.948   7.295   6.225\n"
+"ATOM     66  O   ???     1       6.417   7.199   7.512\n"
+"ATOM     67  C   ???     1       6.148   6.464   5.250\n"
+"ATOM     68  C   ???     1       5.222   7.503   4.599\n"
+"ATOM     69  N   ???     1       4.918   7.267   3.140\n"
+"ATOM     70  C   ???     1       5.599   6.623   2.107\n"
+"ATOM     71  N   ???     1       4.919   6.594   0.951\n"
+"ATOM     72  C   ???     1       3.772   7.259   1.254\n"
+"ATOM     73  C   ???     1       2.598   7.558   0.439\n"
+"ATOM     74  O   ???     1       2.404   7.232  -0.737\n"
+"ATOM     75  N   ???     1       1.575   8.214   1.141\n"
+"ATOM     76  C   ???     1       1.613   8.566   2.471\n"
+"ATOM     77  N   ???     1       0.502   9.125   3.046\n"
+"ATOM     78  N   ???     1       2.702   8.309   3.210\n"
+"ATOM     79  C   ???     1       3.753   7.669   2.570\n"
+"ATOM     80  P   ???     1       6.301   5.803   8.277\n"
+"ATOM     81  O   ???     1       6.480   4.589   7.476\n"
+"ATOM     82  O   ???     1       7.156   5.937   9.499\n"
+"ATOM     83  O   ???     1       4.740   5.694   8.620\n"
+"ATOM     84  C   ???     1       3.911   6.858   8.929\n"
+"ATOM     85  C   ???     1       2.515   6.690   8.311\n"
+"ATOM     86  O   ???     1       2.653   6.561   6.911\n"
+"ATOM     87  C   ???     1       1.684   5.487   8.712\n"
+"ATOM     88  O   ???     1       0.539   5.815   9.516\n"
+"ATOM     89  C   ???     1       1.353   4.792   7.399\n"
+"ATOM     90  C   ???     1       1.556   5.869   6.393\n"
+"ATOM     91  N   ???     1       1.967   5.365   5.052\n"
+"ATOM     92  C   ???     1       3.193   4.822   4.658\n"
+"ATOM     93  N   ???     1       3.258   4.448   3.362\n"
+"ATOM     94  C   ???     1       2.043   4.779   2.883\n"
+"ATOM     95  C   ???     1       1.417   4.673   1.562\n"
+"ATOM     96  N   ???     1       2.034   4.100   0.514\n"
+"ATOM     97  N   ???     1       0.156   5.177   1.374\n"
+"ATOM     98  C   ???     1      -0.498   5.699   2.441\n"
+"ATOM     99  N   ???     1      -0.077   5.807   3.720\n"
+"ATOM    100  C   ???     1       1.230   5.336   3.901\n"
+"ATOM    101  P   ???     1      -0.488   4.701  10.028\n"
+"ATOM    102  O   ???     1       0.013   3.297  10.287\n"
+"ATOM    103  O   ???     1      -1.183   5.233  11.229\n"
+"ATOM    104  O   ???     1      -1.483   4.559   8.784\n"
+"ATOM    105  C   ???     1      -2.385   5.609   8.332\n"
+"ATOM    106  C   ???     1      -3.291   4.910   7.309\n"
+"ATOM    107  O   ???     1      -2.610   4.636   6.060\n"
+"ATOM    108  C   ???     1      -3.923   3.568   7.700\n"
+"ATOM    109  O   ???     1      -5.162   3.352   7.126\n"
+"ATOM    110  C   ???     1      -2.961   2.582   7.123\n"
+"ATOM    111  C   ???     1      -2.754   3.200   5.763\n"
+"ATOM    112  N   ???     1      -1.583   2.605   5.066\n"
+"ATOM    113  C   ???     1      -0.368   2.242   5.588\n"
+"ATOM    114  N   ???     1       0.486   1.776   4.665\n"
+"ATOM    115  C   ???     1      -0.189   1.878   3.525\n"
+"ATOM    116  C   ???     1       0.183   1.571   2.180\n"
+"ATOM    117  N   ???     1       1.377   0.958   1.920\n"
+"ATOM    118  N   ???     1      -0.730   1.786   1.174\n"
+"ATOM    119  C   ???     1      -1.964   2.218   1.475\n"
+"ATOM    120  N   ???     1      -2.439   2.500   2.716\n"
+"ATOM    121  C   ???     1      -1.479   2.331   3.718\n"
+"ATOM    122  P   ???     1      -5.924   1.982   7.353\n"
+"ATOM    123  O   ???     1      -5.172   0.938   8.012\n"
+"ATOM    124  O   ???     1      -7.186   2.593   7.897\n"
+"ATOM    125  O   ???     1      -6.252   1.347   5.938\n"
+"ATOM    126  C   ???     1      -6.944   2.135   4.921\n"
+"ATOM    127  C   ???     1      -6.715   1.372   3.651\n"
+"ATOM    128  O   ???     1      -5.286   1.133   3.458\n"
+"ATOM    129  C   ???     1      -7.407   0.057   3.644\n"
+"ATOM    130  O   ???     1      -8.489   0.026   2.771\n"
+"ATOM    131  C   ???     1      -6.310  -0.990   3.438\n"
+"ATOM    132  C   ???     1      -5.156  -0.150   2.865\n"
+"ATOM    133  N   ???     1      -3.757  -0.647   3.037\n"
+"ATOM    134  C   ???     1      -2.979  -0.923   1.905\n"
+"ATOM    135  O   ???     1      -3.374  -0.727   0.747\n"
+"ATOM    136  N   ???     1      -1.687  -1.340   2.116\n"
+"ATOM    137  C   ???     1      -1.144  -1.494   3.381\n"
+"ATOM    138  O   ???     1       0.074  -1.754   3.445\n"
+"ATOM    139  C   ???     1      -1.948  -1.227   4.501\n"
+"ATOM    140  C   ???     1      -1.422  -1.319   5.892\n"
+"ATOM    141  C   ???     1      -3.248  -0.795   4.314\n"
+"ATOM    142  P   ???     1      -9.378  -1.306   2.603\n"
+"ATOM    143  O   ???     1      -9.127  -2.221   3.726\n"
+"ATOM    144  O   ???     1     -10.818  -1.001   2.258\n"
+"ATOM    145  O   ???     1      -8.753  -2.007   1.349\n"
+"ATOM    146  C   ???     1      -8.460  -1.252   0.127\n"
+"ATOM    147  C   ???     1      -7.623  -2.192  -0.688\n"
+"ATOM    148  O   ???     1      -6.477  -2.562   0.073\n"
+"ATOM    149  C   ???     1      -8.255  -3.511  -1.016\n"
+"ATOM    150  O   ???     1      -8.724  -3.527  -2.285\n"
+"ATOM    151  C   ???     1      -7.224  -4.587  -0.757\n"
+"ATOM    152  C   ???     1      -6.004  -3.753  -0.494\n"
+"ATOM    153  N   ???     1      -4.890  -4.263   0.346\n"
+"ATOM    154  C   ???     1      -3.627  -4.303  -0.238\n"
+"ATOM    155  O   ???     1      -3.413  -4.052  -1.439\n"
+"ATOM    156  N   ???     1      -2.559  -4.547   0.575\n"
+"ATOM    157  C   ???     1      -2.672  -4.694   1.927\n"
+"ATOM    158  O   ???     1      -1.603  -4.845   2.510\n"
+"ATOM    159  C   ???     1      -3.962  -4.607   2.537\n"
+"ATOM    160  C   ???     1      -4.169  -4.666   4.067\n"
+"ATOM    161  C   ???     1      -5.072  -4.416   1.690\n"
+"ATOM    162  P   ???     1      -9.083  -4.896  -2.982\n"
+"ATOM    163  O   ???     1      -9.692  -5.915  -2.114\n"
+"ATOM    164  O   ???     1      -9.784  -4.333  -4.195\n"
+"ATOM    165  O   ???     1      -7.769  -5.544  -3.501\n"
+"ATOM    166  C   ???     1      -6.988  -4.787  -4.548\n"
+"ATOM    167  C   ???     1      -5.787  -5.605  -4.680\n"
+"ATOM    168  O   ???     1      -5.186  -5.816  -3.381\n"
+"ATOM    169  C   ???     1      -6.160  -6.983  -5.172\n"
+"ATOM    170  O   ???     1      -5.775  -7.049  -6.554\n"
+"ATOM    171  C   ???     1      -5.475  -7.989  -4.170\n"
+"ATOM    172  C   ???     1      -4.470  -7.095  -3.471\n"
+"ATOM    173  N   ???     1      -4.143  -7.481  -2.064\n"
+"ATOM    174  C   ???     1      -2.880  -7.900  -1.674\n"
+"ATOM    175  O   ???     1      -1.981  -8.028  -2.497\n"
+"ATOM    176  N   ???     1      -2.644  -8.106  -0.357\n"
+"ATOM    177  C   ???     1      -3.593  -7.906   0.580\n"
+"ATOM    178  N   ???     1      -3.294  -8.029   1.897\n"
+"ATOM    179  C   ???     1      -4.887  -7.515   0.234\n"
+"ATOM    180  C   ???     1      -5.144  -7.290  -1.118\n"
+"ATOM    181  P   ???     1      -6.271  -8.185  -7.504\n"
+"ATOM    182  O   ???     1      -7.612  -8.682  -7.077\n"
+"ATOM    183  O   ???     1      -6.109  -7.701  -8.887\n"
+"ATOM    184  O   ???     1      -5.255  -9.348  -7.127\n"
+"ATOM    185  C   ???     1      -3.864  -9.233  -7.443\n"
+"ATOM    186  C   ???     1      -3.265 -10.503  -6.982\n"
+"ATOM    187  O   ???     1      -3.388 -10.408  -5.569\n"
+"ATOM    188  C   ???     1      -3.913 -11.848  -7.400\n"
+"ATOM    189  O   ???     1      -2.906 -12.861  -7.541\n"
+"ATOM    190  C   ???     1      -4.865 -12.134  -6.218\n"
+"ATOM    191  C   ???     1      -3.937 -11.700  -5.115\n"
+"ATOM    192  N   ???     1      -4.370 -11.653  -3.684\n"
+"ATOM    193  C   ???     1      -5.572 -11.359  -3.092\n"
+"ATOM    194  N   ???     1      -5.502 -11.208  -1.750\n"
+"ATOM    195  C   ???     1      -4.184 -11.405  -1.464\n"
+"ATOM    196  C   ???     1      -3.484 -11.398  -0.187\n"
+"ATOM    197  O   ???     1      -3.973 -11.294   0.939\n"
+"ATOM    198  N   ???     1      -2.117 -11.651  -0.293\n"
+"ATOM    199  C   ???     1      -1.432 -11.934  -1.458\n"
+"ATOM    200  N   ???     1      -0.114 -12.247  -1.341\n"
+"ATOM    201  N   ???     1      -2.059 -11.968  -2.664\n"
+"ATOM    202  C   ???     1      -3.452 -11.687  -2.620\n"
+"ATOM    203  P   ???     1      -2.430 -13.413  -8.952\n"
+"ATOM    204  O   ???     1      -3.259 -14.642  -9.185\n"
+"ATOM    205  O   ???     1      -2.433 -12.356 -10.046\n"
+"ATOM    206  O   ???     1      -0.882 -13.756  -8.697\n"
+"ATOM    207  C   ???     1       0.079 -12.685  -8.383\n"
+"ATOM    208  C   ???     1       1.266 -13.194  -7.564\n"
+"ATOM    209  O   ???     1       0.999 -13.349  -6.166\n"
+"ATOM    210  C   ???     1       1.851 -14.504  -7.958\n"
+"ATOM    211  O   ???     1       3.274 -14.536  -7.758\n"
+"ATOM    212  C   ???     1       1.034 -15.479  -7.076\n"
+"ATOM    213  C   ???     1       1.061 -14.732  -5.783\n"
+"ATOM    214  N   ???     1       0.018 -15.063  -4.744\n"
+"ATOM    215  C   ???     1       0.371 -15.193  -3.394\n"
+"ATOM    216  O   ???     1       1.555 -15.059  -3.043\n"
+"ATOM    217  N   ???     1      -0.605 -15.422  -2.469\n"
+"ATOM    218  C   ???     1      -1.903 -15.490  -2.823\n"
+"ATOM    219  N   ???     1      -2.850 -15.626  -1.852\n"
+"ATOM    220  C   ???     1      -2.311 -15.339  -4.167\n"
+"ATOM    221  C   ???     1      -1.315 -15.115  -5.135\n"
+"ATOM    222  P   ???     1       4.029 -15.922  -7.818\n"
+"ATOM    223  O   ???     1       3.416 -16.861  -8.809\n"
+"ATOM    224  O   ???     1       5.487 -15.559  -8.011\n"
+"ATOM    225  O   ???     1       3.714 -16.639  -6.402\n"
+"ATOM    226  C   ???     1       4.699 -16.656  -5.290\n"
+"ATOM    227  C   ???     1       4.464 -17.877  -4.385\n"
+"ATOM    228  O   ???     1       3.153 -17.818  -3.885\n"
+"ATOM    229  C   ???     1       4.685 -19.342  -4.849\n"
+"ATOM    230  O   ???     1       5.420 -20.114  -3.884\n"
+"ATOM    231  C   ???     1       3.295 -19.890  -5.050\n"
+"ATOM    232  C   ???     1       2.531 -19.057  -4.020\n"
+"ATOM    233  N   ???     1       1.056 -18.734  -4.183\n"
+"ATOM    234  C   ???     1       0.273 -18.422  -5.264\n"
+"ATOM    235  N   ???     1      -1.031 -18.317  -4.953\n"
+"ATOM    236  C   ???     1      -1.093 -18.575  -3.620\n"
+"ATOM    237  C   ???     1      -2.226 -18.671  -2.719\n"
+"ATOM    238  O   ???     1      -3.418 -18.578  -2.959\n"
+"ATOM    239  N   ???     1      -1.866 -18.877  -1.414\n"
+"ATOM    240  C   ???     1      -0.581 -18.991  -0.915\n"
+"ATOM    241  N   ???     1      -0.396 -19.286   0.409\n"
+"ATOM    242  N   ???     1       0.472 -18.926  -1.725\n"
+"ATOM    243  C   ???     1       0.163 -18.734  -3.100\n"
+"ATOM    244  O   ???     1      -6.680 -19.825   7.699\n"
+"ATOM    245  C   ???     1      -6.306 -20.194   6.315\n"
+"ATOM    246  C   ???     1      -5.053 -19.445   5.920\n"
+"ATOM    247  O   ???     1      -4.418 -19.699   4.659\n"
+"ATOM    248  C   ???     1      -4.994 -17.972   6.135\n"
+"ATOM    249  O   ???     1      -3.710 -17.604   6.687\n"
+"ATOM    250  C   ???     1      -5.163 -17.510   4.681\n"
+"ATOM    251  C   ???     1      -4.498 -18.548   3.817\n"
+"ATOM    252  N   ???     1      -5.087 -18.713   2.382\n"
+"ATOM    253  C   ???     1      -4.235 -18.653   1.283\n"
+"ATOM    254  O   ???     1      -3.023 -18.634   1.498\n"
+"ATOM    255  N   ???     1      -4.753 -18.618   0.009\n"
+"ATOM    256  C   ???     1      -6.087 -18.707  -0.208\n"
+"ATOM    257  N   ???     1      -6.569 -18.815  -1.491\n"
+"ATOM    258  C   ???     1      -6.991 -18.809   0.869\n"
+"ATOM    259  C   ???     1      -6.468 -18.783   2.177\n"
+"ATOM    260  P   ???     1      -3.519 -16.827   8.069\n"
+"ATOM    261  O   ???     1      -4.231 -15.537   8.035\n"
+"ATOM    262  O   ???     1      -3.821 -17.708   9.240\n"
+"ATOM    263  O   ???     1      -1.956 -16.549   8.073\n"
+"ATOM    264  C   ???     1      -0.947 -17.650   8.003\n"
+"ATOM    265  C   ???     1       0.325 -17.111   7.352\n"
+"ATOM    266  O   ???     1       0.066 -17.132   5.962\n"
+"ATOM    267  C   ???     1       0.613 -15.669   7.661\n"
+"ATOM    268  O   ???     1       1.856 -15.388   8.203\n"
+"ATOM    269  C   ???     1       0.265 -14.853   6.465\n"
+"ATOM    270  C   ???     1       0.285 -15.854   5.380\n"
+"ATOM    271  N   ???     1      -0.824 -15.536   4.452\n"
+"ATOM    272  C   ???     1      -2.113 -15.141   4.752\n"
+"ATOM    273  N   ???     1      -2.810 -14.728   3.684\n"
+"ATOM    274  C   ???     1      -1.957 -14.896   2.652\n"
+"ATOM    275  C   ???     1      -2.142 -14.574   1.260\n"
+"ATOM    276  O   ???     1      -3.179 -14.132   0.774\n"
+"ATOM    277  N   ???     1      -1.001 -14.804   0.451\n"
+"ATOM    278  C   ???     1       0.192 -15.336   0.902\n"
+"ATOM    279  N   ???     1       1.184 -15.515   0.002\n"
+"ATOM    280  N   ???     1       0.382 -15.672   2.205\n"
+"ATOM    281  C   ???     1      -0.729 -15.444   3.059\n"
+"ATOM    282  P   ???     1       2.293 -13.866   8.376\n"
+"ATOM    283  O   ???     1       1.086 -13.042   8.626\n"
+"ATOM    284  O   ???     1       3.396 -13.816   9.377\n"
+"ATOM    285  O   ???     1       2.922 -13.420   7.025\n"
+"ATOM    286  C   ???     1       4.007 -14.108   6.407\n"
+"ATOM    287  C   ???     1       4.054 -13.498   5.013\n"
+"ATOM    288  O   ???     1       2.780 -13.607   4.393\n"
+"ATOM    289  C   ???     1       4.326 -12.019   4.962\n"
+"ATOM    290  O   ???     1       5.715 -11.793   5.178\n"
+"ATOM    291  C   ???     1       3.795 -11.615   3.565\n"
+"ATOM    292  C   ???     1       2.647 -12.603   3.423\n"
+"ATOM    293  N   ???     1       1.244 -12.133   3.536\n"
+"ATOM    294  C   ???     1       0.427 -12.102   2.410\n"
+"ATOM    295  O   ???     1       0.835 -12.492   1.323\n"
+"ATOM    296  N   ???     1      -0.850 -11.713   2.533\n"
+"ATOM    297  C   ???     1      -1.391 -11.421   3.723\n"
+"ATOM    298  N   ???     1      -2.628 -10.831   3.762\n"
+"ATOM    299  C   ???     1      -0.649 -11.574   4.913\n"
+"ATOM    300  C   ???     1       0.708 -11.938   4.796\n"
+"ATOM    301  P   ???     1       6.336 -10.366   5.128\n"
+"ATOM    302  O   ???     1       5.449  -9.428   5.909\n"
+"ATOM    303  O   ???     1       7.745 -10.482   5.620\n"
+"ATOM    304  O   ???     1       6.290 -10.020   3.569\n"
+"ATOM    305  C   ???     1       7.055 -10.811   2.615\n"
+"ATOM    306  C   ???     1       6.734 -10.308   1.217\n"
+"ATOM    307  O   ???     1       5.297 -10.192   1.100\n"
+"ATOM    308  C   ???     1       7.286  -8.975   0.718\n"
+"ATOM    309  O   ???     1       7.393  -8.945  -0.714\n"
+"ATOM    310  C   ???     1       6.225  -7.973   1.221\n"
+"ATOM    311  C   ???     1       4.974  -8.794   0.845\n"
+"ATOM    312  N   ???     1       3.773  -8.455   1.602\n"
+"ATOM    313  C   ???     1       3.640  -7.981   2.890\n"
+"ATOM    314  N   ???     1       2.384  -7.801   3.240\n"
+"ATOM    315  C   ???     1       1.667  -8.192   2.129\n"
+"ATOM    316  C   ???     1       0.216  -8.383   1.898\n"
+"ATOM    317  O   ???     1      -0.692  -8.327   2.724\n"
+"ATOM    318  N   ???     1      -0.115  -8.589   0.569\n"
+"ATOM    319  C   ???     1       0.807  -8.696  -0.461\n"
+"ATOM    320  N   ???     1       0.345  -8.866  -1.749\n"
+"ATOM    321  N   ???     1       2.149  -8.691  -0.209\n"
+"ATOM    322  C   ???     1       2.524  -8.455   1.086\n"
+"ATOM    323  P   ???     1       7.575  -7.564  -1.471\n"
+"ATOM    324  O   ???     1       7.955  -6.449  -0.479\n"
+"ATOM    325  O   ???     1       8.741  -7.728  -2.458\n"
+"ATOM    326  O   ???     1       6.254  -7.373  -2.307\n"
+"ATOM    327  C   ???     1       6.024  -8.272  -3.442\n"
+"ATOM    328  C   ???     1       5.019  -7.727  -4.455\n"
+"ATOM    329  O   ???     1       3.633  -7.467  -4.002\n"
+"ATOM    330  C   ???     1       5.448  -6.462  -5.147\n"
+"ATOM    331  O   ???     1       5.043  -6.461  -6.529\n"
+"ATOM    332  C   ???     1       4.765  -5.380  -4.322\n"
+"ATOM    333  C   ???     1       3.522  -6.055  -3.759\n"
+"ATOM    334  N   ???     1       3.349  -5.765  -2.284\n"
+"ATOM    335  C   ???     1       4.280  -5.485  -1.291\n"
+"ATOM    336  N   ???     1       3.718  -5.218  -0.101\n"
+"ATOM    337  C   ???     1       2.389  -5.311  -0.337\n"
+"ATOM    338  C   ???     1       1.210  -5.068   0.470\n"
+"ATOM    339  N   ???     1       1.297  -4.554   1.713\n"
+"ATOM    340  N   ???     1      -0.018  -5.382  -0.038\n"
+"ATOM    341  C   ???     1      -0.107  -5.816  -1.309\n"
+"ATOM    342  N   ???     1       0.900  -5.988  -2.198\n"
+"ATOM    343  C   ???     1       2.136  -5.713  -1.640\n"
+"ATOM    344  P   ???     1       4.958  -5.104  -7.365\n"
+"ATOM    345  O   ???     1       5.978  -4.099  -6.859\n"
+"ATOM    346  O   ???     1       5.021  -5.615  -8.756\n"
+"ATOM    347  O   ???     1       3.560  -4.533  -7.033\n"
+"ATOM    348  C   ???     1       2.362  -5.321  -7.154\n"
+"ATOM    349  C   ???     1       1.273  -4.376  -6.720\n"
+"ATOM    350  O   ???     1       1.389  -4.141  -5.316\n"
+"ATOM    351  C   ???     1       1.322  -2.993  -7.366\n"
+"ATOM    352  O   ???     1       0.329  -2.831  -8.391\n"
+"ATOM    353  C   ???     1       1.333  -1.991  -6.194\n"
+"ATOM    354  C   ???     1       0.897  -2.852  -5.006\n"
+"ATOM    355  N   ???     1       1.537  -2.528  -3.709\n"
+"ATOM    356  C   ???     1       2.863  -2.388  -3.374\n"
+"ATOM    357  N   ???     1       3.059  -2.100  -2.081\n"
+"ATOM    358  C   ???     1       1.825  -2.100  -1.562\n"
+"ATOM    359  C   ???     1       1.312  -1.785  -0.242\n"
+"ATOM    360  N   ???     1       2.105  -1.419   0.792\n"
+"ATOM    361  N   ???     1      -0.035  -1.681  -0.088\n"
+"ATOM    362  C   ???     1      -0.863  -1.975  -1.112\n"
+"ATOM    363  N   ???     1      -0.516  -2.341  -2.360\n"
+"ATOM    364  C   ???     1       0.871  -2.352  -2.537\n"
+"ATOM    365  P   ???     1       0.096  -1.455  -9.141\n"
+"ATOM    366  O   ???     1       1.403  -0.827  -9.454\n"
+"ATOM    367  O   ???     1      -0.784  -1.681 -10.328\n"
+"ATOM    368  O   ???     1      -0.708  -0.618  -8.042\n"
+"ATOM    369  C   ???     1      -2.026  -1.063  -7.621\n"
+"ATOM    370  C   ???     1      -2.460  -0.283  -6.398\n"
+"ATOM    371  O   ???     1      -1.482  -0.424  -5.323\n"
+"ATOM    372  C   ???     1      -2.702   1.209  -6.627\n"
+"ATOM    373  O   ???     1      -4.034   1.463  -6.980\n"
+"ATOM    374  C   ???     1      -2.262   1.804  -5.316\n"
+"ATOM    375  C   ???     1      -1.039   0.909  -5.075\n"
+"ATOM    376  N   ???     1      -0.210   0.993  -3.836\n"
+"ATOM    377  C   ???     1      -0.736   1.017  -2.546\n"
+"ATOM    378  O   ???     1      -1.957   0.851  -2.314\n"
+"ATOM    379  N   ???     1       0.164   1.108  -1.498\n"
+"ATOM    380  C   ???     1       1.538   1.199  -1.677\n"
+"ATOM    381  O   ???     1       2.250   1.226  -0.672\n"
+"ATOM    382  C   ???     1       2.054   1.179  -2.992\n"
+"ATOM    383  C   ???     1       3.521   1.367  -3.242\n"
+"ATOM    384  C   ???     1       1.153   1.065  -4.071\n"
+"ATOM    385  P   ???     1      -4.609   2.928  -7.269\n"
+"ATOM    386  O   ???     1      -3.623   3.841  -7.848\n"
+"ATOM    387  O   ???     1      -5.862   2.588  -8.032\n"
+"ATOM    388  O   ???     1      -4.884   3.503  -5.838\n"
+"ATOM    389  C   ???     1      -5.822   2.805  -4.954\n"
+"ATOM    390  C   ???     1      -5.829   3.570  -3.680\n"
+"ATOM    391  O   ???     1      -4.506   3.511  -3.227\n"
+"ATOM    392  C   ???     1      -6.172   5.046  -3.735\n"
+"ATOM    393  O   ???     1      -7.441   5.291  -3.123\n"
+"ATOM    394  C   ???     1      -5.006   5.747  -3.052\n"
+"ATOM    395  C   ???     1      -4.274   4.597  -2.370\n"
+"ATOM    396  N   ???     1      -2.767   4.703  -2.324\n"
+"ATOM    397  C   ???     1      -2.085   4.842  -1.117\n"
+"ATOM    398  O   ???     1      -2.678   5.024  -0.043\n"
+"ATOM    399  N   ???     1      -0.697   4.808  -1.172\n"
+"ATOM    400  C   ???     1       0.014   4.669  -2.366\n"
+"ATOM    401  O   ???     1       1.237   4.636  -2.312\n"
+"ATOM    402  C   ???     1      -0.682   4.595  -3.576\n"
+"ATOM    403  C   ???     1       0.027   4.511  -4.924\n"
+"ATOM    404  C   ???     1      -2.079   4.607  -3.526\n"
+"ATOM    405  P   ???     1      -8.018   6.766  -2.948\n"
+"ATOM    406  O   ???     1      -7.635   7.566  -4.152\n"
+"ATOM    407  O   ???     1      -9.476   6.706  -2.680\n"
+"ATOM    408  O   ???     1      -7.320   7.281  -1.652\n"
+"ATOM    409  C   ???     1      -7.634   6.745  -0.332\n"
+"ATOM    410  C   ???     1      -6.740   7.536   0.578\n"
+"ATOM    411  O   ???     1      -5.356   7.300   0.129\n"
+"ATOM    412  C   ???     1      -6.992   9.072   0.483\n"
+"ATOM    413  O   ???     1      -7.500   9.642   1.681\n"
+"ATOM    414  C   ???     1      -5.648   9.640   0.010\n"
+"ATOM    415  C   ???     1      -4.683   8.515   0.475\n"
+"ATOM    416  N   ???     1      -3.379   8.489  -0.149\n"
+"ATOM    417  C   ???     1      -2.166   8.504   0.541\n"
+"ATOM    418  O   ???     1      -2.158   8.517   1.779\n"
+"ATOM    419  N   ???     1      -1.010   8.423  -0.184\n"
+"ATOM    420  C   ???     1      -1.042   8.316  -1.562\n"
+"ATOM    421  N   ???     1       0.083   8.179  -2.370\n"
+"ATOM    422  C   ???     1      -2.249   8.284  -2.244\n"
+"ATOM    423  C   ???     1      -3.426   8.372  -1.520\n"
+"ATOM    424  P   ???     1      -8.072  11.149   1.769\n"
+"ATOM    425  O   ???     1      -8.359  11.946   0.569\n"
+"ATOM    426  O   ???     1      -9.253  11.131   2.697\n"
+"ATOM    427  O   ???     1      -6.842  11.901   2.427\n"
+"ATOM    428  C   ???     1      -6.195  11.442   3.679\n"
+"ATOM    429  C   ???     1      -4.912  12.282   3.817\n"
+"ATOM    430  O   ???     1      -3.876  11.994   2.873\n"
+"ATOM    431  C   ???     1      -5.090  13.728   3.629\n"
+"ATOM    432  O   ???     1      -4.492  14.502   4.643\n"
+"ATOM    433  C   ???     1      -4.542  14.026   2.249\n"
+"ATOM    434  C   ???     1      -3.391  13.126   2.230\n"
+"ATOM    435  N   ???     1      -2.856  12.707   0.897\n"
+"ATOM    436  C   ???     1      -3.473  12.442  -0.319\n"
+"ATOM    437  N   ???     1      -2.637  12.015  -1.293\n"
+"ATOM    438  C   ???     1      -1.436  12.007  -0.688\n"
+"ATOM    439  C   ???     1      -0.127  11.608  -1.179\n"
+"ATOM    440  O   ???     1       0.172  11.212  -2.291\n"
+"ATOM    441  N   ???     1       0.874  11.683  -0.204\n"
+"ATOM    442  C   ???     1       0.686  12.119   1.100\n"
+"ATOM    443  N   ???     1       1.749  12.103   1.939\n"
+"ATOM    444  N   ???     1      -0.519  12.555   1.528\n"
+"ATOM    445  C   ???     1      -1.544  12.446   0.633\n"
+"ATOM    446  P   ???     1      -5.127  15.894   4.858\n"
+"ATOM    447  O   ???     1      -5.425  16.629   3.561\n"
+"ATOM    448  O   ???     1      -6.250  15.527   5.754\n"
+"ATOM    449  O   ???     1      -4.002  16.793   5.584\n"
+"ATOM    450  C   ???     1      -3.238  16.255   6.678\n"
+"ATOM    451  C   ???     1      -1.830  16.039   6.216\n"
+"ATOM    452  O   ???     1      -1.871  15.509   4.883\n"
+"ATOM    453  C   ???     1      -0.873  17.253   6.173\n"
+"ATOM    454  O   ???     1      -0.153  17.520   7.416\n"
+"ATOM    455  C   ???     1       0.090  16.942   5.027\n"
+"ATOM    456  C   ???     1      -0.595  15.819   4.260\n"
+"ATOM    457  N   ???     1      -0.730  16.057   2.785\n"
+"ATOM    458  C   ???     1       0.227  15.578   1.903\n"
+"ATOM    459  O   ???     1       1.293  15.046   2.291\n"
+"ATOM    460  N   ???     1      -0.055  15.614   0.600\n"
+"ATOM    461  C   ???     1      -1.197  16.106   0.107\n"
+"ATOM    462  N   ???     1      -1.457  15.971  -1.213\n"
+"ATOM    463  C   ???     1      -2.157  16.670   0.937\n"
+"ATOM    464  C   ???     1      -1.890  16.634   2.320\n"
+"ATOM    465  P   ???     1       0.085  19.035   7.891\n"
+"ATOM    466  O   ???     1      -1.103  19.918   7.465\n"
+"ATOM    467  O   ???     1       0.455  19.118   9.333\n"
+"ATOM    468  O   ???     1       1.304  19.503   6.967\n"
+"ATOM    469  C   ???     1       2.588  19.092   7.215\n"
+"ATOM    470  C   ???     1       3.346  19.369   5.986\n"
+"ATOM    471  O   ???     1       2.968  18.509   4.924\n"
+"ATOM    472  C   ???     1       3.325  20.751   5.383\n"
+"ATOM    473  O   ???     1       3.907  21.749   6.266\n"
+"ATOM    474  C   ???     1       4.203  20.393   4.162\n"
+"ATOM    475  C   ???     1       3.516  19.074   3.711\n"
+"ATOM    476  N   ???     1       2.407  19.227   2.697\n"
+"ATOM    477  C   ???     1       1.165  19.783   2.799\n"
+"ATOM    478  N   ???     1       0.472  19.784   1.639\n"
+"ATOM    479  C   ???     1       1.290  19.206   0.763\n"
+"ATOM    480  C   ???     1       1.097  18.852  -0.624\n"
+"ATOM    481  O   ???     1       0.123  18.893  -1.321\n"
+"ATOM    482  N   ???     1       2.227  18.334  -1.206\n"
+"ATOM    483  C   ???     1       3.438  18.092  -0.570\n"
+"ATOM    484  N   ???     1       4.500  17.628  -1.280\n"
+"ATOM    485  N   ???     1       3.571  18.322   0.734\n"
+"ATOM    486  C   ???     1       2.483  18.897   1.373\n"
+"CONECT    1    2\n"
+"CONECT    2    1    3\n"
+"CONECT    3    2    4    5\n"
+"CONECT    4    3    8\n"
+"CONECT    5    3    6    7\n"
+"CONECT    6    5   17\n"
+"CONECT    7    5    8\n"
+"CONECT    8    4    7    9\n"
+"CONECT    9    8   10   16\n"
+"CONECT   10    9   11   12\n"
+"CONECT   11   10\n"
+"CONECT   12   10   13\n"
+"CONECT   13   12   14   15\n"
+"CONECT   14   13\n"
+"CONECT   15   13   16\n"
+"CONECT   16    9   15\n"
+"CONECT   17    6   18   19   20\n"
+"CONECT   18   17\n"
+"CONECT   19   17\n"
+"CONECT   20   17   21\n"
+"CONECT   21   20   22\n"
+"CONECT   22   21   23   24\n"
+"CONECT   23   22   27\n"
+"CONECT   24   22   25   26\n"
+"CONECT   25   24   39\n"
+"CONECT   26   24   27\n"
+"CONECT   27   23   26   28\n"
+"CONECT   28   27   29   38\n"
+"CONECT   29   28   30\n"
+"CONECT   30   29   31\n"
+"CONECT   31   30   32   38\n"
+"CONECT   32   31   33   34\n"
+"CONECT   33   32\n"
+"CONECT   34   32   35\n"
+"CONECT   35   34   36   37\n"
+"CONECT   36   35\n"
+"CONECT   37   35   38\n"
+"CONECT   38   28   31   37\n"
+"CONECT   39   25   40   41   42\n"
+"CONECT   40   39\n"
+"CONECT   41   39\n"
+"CONECT   42   39   43\n"
+"CONECT   43   42   44\n"
+"CONECT   44   43   45   46\n"
+"CONECT   45   44   49\n"
+"CONECT   46   44   47   48\n"
+"CONECT   47   46   58\n"
+"CONECT   48   46   49\n"
+"CONECT   49   45   48   50\n"
+"CONECT   50   49   51   57\n"
+"CONECT   51   50   52   53\n"
+"CONECT   52   51\n"
+"CONECT   53   51   54\n"
+"CONECT   54   53   55   56\n"
+"CONECT   55   54\n"
+"CONECT   56   54   57\n"
+"CONECT   57   50   56\n"
+"CONECT   58   47   59   60   61\n"
+"CONECT   59   58\n"
+"CONECT   60   58\n"
+"CONECT   61   58   62\n"
+"CONECT   62   61   63\n"
+"CONECT   63   62   64   65\n"
+"CONECT   64   63   68\n"
+"CONECT   65   63   66   67\n"
+"CONECT   66   65   80\n"
+"CONECT   67   65   68\n"
+"CONECT   68   64   67   69\n"
+"CONECT   69   68   70   79\n"
+"CONECT   70   69   71\n"
+"CONECT   71   70   72\n"
+"CONECT   72   71   73   79\n"
+"CONECT   73   72   74   75\n"
+"CONECT   74   73\n"
+"CONECT   75   73   76\n"
+"CONECT   76   75   77   78\n"
+"CONECT   77   76\n"
+"CONECT   78   76   79\n"
+"CONECT   79   69   72   78\n"
+"CONECT   80   66   81   82   83\n"
+"CONECT   81   80\n"
+"CONECT   82   80\n"
+"CONECT   83   80   84\n"
+"CONECT   84   83   85\n"
+"CONECT   85   84   86   87\n"
+"CONECT   86   85   90\n"
+"CONECT   87   85   88   89\n"
+"CONECT   88   87  101\n"
+"CONECT   89   87   90\n"
+"CONECT   90   86   89   91\n"
+"CONECT   91   90   92  100\n"
+"CONECT   92   91   93\n"
+"CONECT   93   92   94\n"
+"CONECT   94   93   95  100\n"
+"CONECT   95   94   96   97\n"
+"CONECT   96   95\n"
+"CONECT   97   95   98\n"
+"CONECT   98   97   99\n"
+"CONECT   99   98  100\n"
+"CONECT  100   91   94   99\n"
+"CONECT  101   88  102  103  104\n"
+"CONECT  102  101\n"
+"CONECT  103  101\n"
+"CONECT  104  101  105\n"
+"CONECT  105  104  106\n"
+"CONECT  106  105  107  108\n"
+"CONECT  107  106  111\n"
+"CONECT  108  106  109  110\n"
+"CONECT  109  108  122\n"
+"CONECT  110  108  111\n"
+"CONECT  111  107  110  112\n"
+"CONECT  112  111  113  121\n"
+"CONECT  113  112  114\n"
+"CONECT  114  113  115\n"
+"CONECT  115  114  116  121\n"
+"CONECT  116  115  117  118\n"
+"CONECT  117  116\n"
+"CONECT  118  116  119\n"
+"CONECT  119  118  120\n"
+"CONECT  120  119  121\n"
+"CONECT  121  112  115  120\n"
+"CONECT  122  109  123  124  125\n"
+"CONECT  123  122\n"
+"CONECT  124  122\n"
+"CONECT  125  122  126\n"
+"CONECT  126  125  127\n"
+"CONECT  127  126  128  129\n"
+"CONECT  128  127  132\n"
+"CONECT  129  127  130  131\n"
+"CONECT  130  129  142\n"
+"CONECT  131  129  132\n"
+"CONECT  132  128  131  133\n"
+"CONECT  133  132  134  141\n"
+"CONECT  134  133  135  136\n"
+"CONECT  135  134\n"
+"CONECT  136  134  137\n"
+"CONECT  137  136  138  139\n"
+"CONECT  138  137\n"
+"CONECT  139  137  140  141\n"
+"CONECT  140  139\n"
+"CONECT  141  133  139\n"
+"CONECT  142  130  143  145\n"
+"CONECT  143  142\n"
+"CONECT  145  142  146\n"
+"CONECT  146  145  147\n"
+"CONECT  147  146  148  149\n"
+"CONECT  148  147  152\n"
+"CONECT  149  147  150  151\n"
+"CONECT  150  149  162\n"
+"CONECT  151  149  152\n"
+"CONECT  152  148  151  153\n"
+"CONECT  153  152  154  161\n"
+"CONECT  154  153  155  156\n"
+"CONECT  155  154\n"
+"CONECT  156  154  157\n"
+"CONECT  157  156  158  159\n"
+"CONECT  158  157\n"
+"CONECT  159  157  160  161\n"
+"CONECT  160  159\n"
+"CONECT  161  153  159\n"
+"CONECT  162  150  163  164  165\n"
+"CONECT  163  162\n"
+"CONECT  164  162\n"
+"CONECT  165  162  166\n"
+"CONECT  166  165  167\n"
+"CONECT  167  166  168  169\n"
+"CONECT  168  167  172\n"
+"CONECT  169  167  170  171\n"
+"CONECT  170  169  181\n"
+"CONECT  171  169  172\n"
+"CONECT  172  168  171  173\n"
+"CONECT  173  172  174  180\n"
+"CONECT  174  173  175  176\n"
+"CONECT  175  174\n"
+"CONECT  176  174  177\n"
+"CONECT  177  176  178  179\n"
+"CONECT  178  177\n"
+"CONECT  179  177  180\n"
+"CONECT  180  173  179\n"
+"CONECT  181  170  182  183  184\n"
+"CONECT  182  181\n"
+"CONECT  183  181\n"
+"CONECT  184  181  185\n"
+"CONECT  185  184  186\n"
+"CONECT  186  185  187  188\n"
+"CONECT  187  186  191\n"
+"CONECT  188  186  189  190\n"
+"CONECT  189  188  203\n"
+"CONECT  190  188  191\n"
+"CONECT  191  187  190  192\n"
+"CONECT  192  191  193  202\n"
+"CONECT  193  192  194\n"
+"CONECT  194  193  195\n"
+"CONECT  195  194  196  202\n"
+"CONECT  196  195  197  198\n"
+"CONECT  197  196\n"
+"CONECT  198  196  199\n"
+"CONECT  199  198  200  201\n"
+"CONECT  200  199\n"
+"CONECT  201  199  202\n"
+"CONECT  202  192  195  201\n"
+"CONECT  203  189  204  205  206\n"
+"CONECT  204  203\n"
+"CONECT  205  203\n"
+"CONECT  206  203  207\n"
+"CONECT  207  206  208\n"
+"CONECT  208  207  209  210\n"
+"CONECT  209  208  213\n"
+"CONECT  210  208  211  212\n"
+"CONECT  211  210  222\n"
+"CONECT  212  210  213\n"
+"CONECT  213  209  212  214\n"
+"CONECT  214  213  215  221\n"
+"CONECT  215  214  216  217\n"
+"CONECT  216  215\n"
+"CONECT  217  215  218\n"
+"CONECT  218  217  219  220\n"
+"CONECT  219  218\n"
+"CONECT  220  218  221\n"
+"CONECT  221  214  220\n"
+"CONECT  222  211  223  224  225\n"
+"CONECT  223  222\n"
+"CONECT  224  222\n"
+"CONECT  225  222  226\n"
+"CONECT  226  225  227\n"
+"CONECT  227  226  228  229\n"
+"CONECT  228  227  232\n"
+"CONECT  229  227  230  231\n"
+"CONECT  230  229\n"
+"CONECT  231  229  232\n"
+"CONECT  232  228  231  233\n"
+"CONECT  233  232  234  243\n"
+"CONECT  234  233  235\n"
+"CONECT  235  234  236\n"
+"CONECT  236  235  237  243\n"
+"CONECT  237  236  238  239\n"
+"CONECT  238  237\n"
+"CONECT  239  237  240\n"
+"CONECT  240  239  241  242\n"
+"CONECT  241  240\n"
+"CONECT  242  240  243\n"
+"CONECT  243  233  236  242\n"
+"CONECT  244  245\n"
+"CONECT  245  244  246\n"
+"CONECT  246  245  247  248\n"
+"CONECT  247  246  251\n"
+"CONECT  248  246  249  250\n"
+"CONECT  249  248  260\n"
+"CONECT  250  248  251\n"
+"CONECT  251  247  250  252\n"
+"CONECT  252  251  253  259\n"
+"CONECT  253  252  254  255\n"
+"CONECT  254  253\n"
+"CONECT  255  253  256\n"
+"CONECT  256  255  257  258\n"
+"CONECT  257  256\n"
+"CONECT  258  256  259\n"
+"CONECT  259  252  258\n"
+"CONECT  260  249  261  262  263\n"
+"CONECT  261  260\n"
+"CONECT  262  260\n"
+"CONECT  263  260  264\n"
+"CONECT  264  263  265\n"
+"CONECT  265  264  266  267\n"
+"CONECT  266  265  270\n"
+"CONECT  267  265  268  269\n"
+"CONECT  268  267  282\n"
+"CONECT  269  267  270\n"
+"CONECT  270  266  269  271\n"
+"CONECT  271  270  272  281\n"
+"CONECT  272  271  273\n"
+"CONECT  273  272  274\n"
+"CONECT  274  273  275  281\n"
+"CONECT  275  274  276  277\n"
+"CONECT  276  275\n"
+"CONECT  277  275  278\n"
+"CONECT  278  277  279  280\n"
+"CONECT  279  278\n"
+"CONECT  280  278  281\n"
+"CONECT  281  271  274  280\n"
+"CONECT  282  268  283  284  285\n"
+"CONECT  283  282\n"
+"CONECT  284  282\n"
+"CONECT  285  282  286\n"
+"CONECT  286  285  287\n"
+"CONECT  287  286  288  289\n"
+"CONECT  288  287  292\n"
+"CONECT  289  287  290  291\n"
+"CONECT  290  289  301\n"
+"CONECT  291  289  292\n"
+"CONECT  292  288  291  293\n"
+"CONECT  293  292  294  300\n"
+"CONECT  294  293  295  296\n"
+"CONECT  295  294\n"
+"CONECT  296  294  297\n"
+"CONECT  297  296  298  299\n"
+"CONECT  298  297\n"
+"CONECT  299  297  300\n"
+"CONECT  300  293  299\n"
+"CONECT  301  290  302  303  304\n"
+"CONECT  302  301\n"
+"CONECT  303  301\n"
+"CONECT  304  301  305\n"
+"CONECT  305  304  306\n"
+"CONECT  306  305  307  308\n"
+"CONECT  307  306  311\n"
+"CONECT  308  306  309  310\n"
+"CONECT  309  308  323\n"
+"CONECT  310  308  311\n"
+"CONECT  311  307  310  312\n"
+"CONECT  312  311  313  322\n"
+"CONECT  313  312  314\n"
+"CONECT  314  313  315\n"
+"CONECT  315  314  316  322\n"
+"CONECT  316  315  317  318\n"
+"CONECT  317  316\n"
+"CONECT  318  316  319\n"
+"CONECT  319  318  320  321\n"
+"CONECT  320  319\n"
+"CONECT  321  319  322\n"
+"CONECT  322  312  315  321\n"
+"CONECT  323  309  324  325  326\n"
+"CONECT  324  323\n"
+"CONECT  325  323\n"
+"CONECT  326  323  327\n"
+"CONECT  327  326  328\n"
+"CONECT  328  327  329  330\n"
+"CONECT  329  328  333\n"
+"CONECT  330  328  331  332\n"
+"CONECT  331  330  344\n"
+"CONECT  332  330  333\n"
+"CONECT  333  329  332  334\n"
+"CONECT  334  333  335  343\n"
+"CONECT  335  334  336\n"
+"CONECT  336  335  337\n"
+"CONECT  337  336  338  343\n"
+"CONECT  338  337  339  340\n"
+"CONECT  339  338\n"
+"CONECT  340  338  341\n"
+"CONECT  341  340  342\n"
+"CONECT  342  341  343\n"
+"CONECT  343  334  337  342\n"
+"CONECT  344  331  345  346  347\n"
+"CONECT  345  344\n"
+"CONECT  346  344\n"
+"CONECT  347  344  348\n"
+"CONECT  348  347  349\n"
+"CONECT  349  348  350  351\n"
+"CONECT  350  349  354\n"
+"CONECT  351  349  352  353\n"
+"CONECT  352  351  365\n"
+"CONECT  353  351  354\n"
+"CONECT  354  350  353  355\n"
+"CONECT  355  354  356  364\n"
+"CONECT  356  355  357\n"
+"CONECT  357  356  358\n"
+"CONECT  358  357  359  364\n"
+"CONECT  359  358  360  361\n"
+"CONECT  360  359\n"
+"CONECT  361  359  362\n"
+"CONECT  362  361  363\n"
+"CONECT  363  362  364\n"
+"CONECT  364  355  358  363\n"
+"CONECT  365  352  366  367  368\n"
+"CONECT  366  365\n"
+"CONECT  367  365\n"
+"CONECT  368  365  369\n"
+"CONECT  369  368  370\n"
+"CONECT  370  369  371  372\n"
+"CONECT  371  370  375\n"
+"CONECT  372  370  373  374\n"
+"CONECT  373  372  385\n"
+"CONECT  374  372  375\n"
+"CONECT  375  371  374  376\n"
+"CONECT  376  375  377  384\n"
+"CONECT  377  376  378  379\n"
+"CONECT  378  377\n"
+"CONECT  379  377  380\n"
+"CONECT  380  379  381  382\n"
+"CONECT  381  380\n"
+"CONECT  382  380  383  384\n"
+"CONECT  383  382\n"
+"CONECT  384  376  382\n"
+"CONECT  385  373  386  387  388\n"
+"CONECT  386  385\n"
+"CONECT  387  385\n"
+"CONECT  388  385  389\n"
+"CONECT  389  388  390\n"
+"CONECT  390  389  391  392\n"
+"CONECT  391  390  395\n"
+"CONECT  392  390  393  394\n"
+"CONECT  393  392  405\n"
+"CONECT  394  392  395\n"
+"CONECT  395  391  394  396\n"
+"CONECT  396  395  397  404\n"
+"CONECT  397  396  398  399\n"
+"CONECT  398  397\n"
+"CONECT  399  397  400\n"
+"CONECT  400  399  401  402\n"
+"CONECT  401  400\n"
+"CONECT  402  400  403  404\n"
+"CONECT  403  402\n"
+"CONECT  404  396  402\n"
+"CONECT  405  393  406  407  408\n"
+"CONECT  406  405\n"
+"CONECT  407  405\n"
+"CONECT  408  405  409\n"
+"CONECT  409  408  410\n"
+"CONECT  410  409  411  412\n"
+"CONECT  411  410  415\n"
+"CONECT  412  410  413  414\n"
+"CONECT  413  412  424\n"
+"CONECT  414  412  415\n"
+"CONECT  415  411  414  416\n"
+"CONECT  416  415  417  423\n"
+"CONECT  417  416  418  419\n"
+"CONECT  418  417\n"
+"CONECT  419  417  420\n"
+"CONECT  420  419  421  422\n"
+"CONECT  421  420\n"
+"CONECT  422  420  423\n"
+"CONECT  423  416  422\n"
+"CONECT  424  413  425  426  427\n"
+"CONECT  425  424\n"
+"CONECT  426  424\n"
+"CONECT  427  424  428\n"
+"CONECT  428  427  429\n"
+"CONECT  429  428  430  431\n"
+"CONECT  430  429  434\n"
+"CONECT  431  429  432  433\n"
+"CONECT  432  431  446\n"
+"CONECT  433  431  434\n"
+"CONECT  434  430  433  435\n"
+"CONECT  435  434  436  445\n"
+"CONECT  436  435  437\n"
+"CONECT  437  436  438\n"
+"CONECT  438  437  439  445\n"
+"CONECT  439  438  440  441\n"
+"CONECT  440  439\n"
+"CONECT  441  439  442\n"
+"CONECT  442  441  443  444\n"
+"CONECT  443  442\n"
+"CONECT  444  442  445\n"
+"CONECT  445  435  438  444\n"
+"CONECT  446  432  447  448  449\n"
+"CONECT  447  446\n"
+"CONECT  448  446\n"
+"CONECT  449  446  450\n"
+"CONECT  450  449  451\n"
+"CONECT  451  450  452  453\n"
+"CONECT  452  451  456\n"
+"CONECT  453  451  454  455\n"
+"CONECT  454  453  465\n"
+"CONECT  455  453  456\n"
+"CONECT  456  452  455  457\n"
+"CONECT  457  456  458  464\n"
+"CONECT  458  457  459  460\n"
+"CONECT  459  458\n"
+"CONECT  460  458  461\n"
+"CONECT  461  460  462  463\n"
+"CONECT  462  461\n"
+"CONECT  463  461  464\n"
+"CONECT  464  457  463\n"
+"CONECT  465  454  466  467  468\n"
+"CONECT  466  465\n"
+"CONECT  467  465\n"
+"CONECT  468  465  469\n"
+"CONECT  469  468  470\n"
+"CONECT  470  469  471  472\n"
+"CONECT  471  470  475\n"
+"CONECT  472  470  473  474\n"
+"CONECT  473  472\n"
+"CONECT  474  472  475\n"
+"CONECT  475  471  474  476\n"
+"CONECT  476  475  477  486\n"
+"CONECT  477  476  478\n"
+"CONECT  478  477  479\n"
+"CONECT  479  478  480  486\n"
+"CONECT  480  479  481  482\n"
+"CONECT  481  480\n"
+"CONECT  482  480  483\n"
+"CONECT  483  482  484  485\n"
+"CONECT  484  483\n"
+"CONECT  485  483  486\n"
+"CONECT  486  476  479  485\n"
+"END\n"
+,
+"HEADER    Dodecahedrane\n"
+"COMPND    al3056\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Sun Sep  3 10:20:00 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.540   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.016   1.465   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       0.771   2.369   0.000  1.00  0.00 \n"
+"HETATM    5  C           1      -0.476   1.465   0.000  1.00  0.00 \n"
+"HETATM    6  C           1      -0.476  -0.655   1.309  1.00  0.00 \n"
+"HETATM    7  C           1      -1.246   0.404   2.118  1.00  0.00 \n"
+"HETATM    8  C           1      -1.246   1.714   1.309  1.00  0.00 \n"
+"HETATM    9  C           1      -0.476   2.774   2.119  1.00  0.00 \n"
+"HETATM   10  C           1       0.770   3.179   1.310  1.00  0.00 \n"
+"HETATM   11  C           1       2.016   2.774   2.120  1.00  0.00 \n"
+"HETATM   12  C           1       2.786   1.715   1.310  1.00  0.00 \n"
+"HETATM   13  C           1       2.785   0.405   2.120  1.00  0.00 \n"
+"HETATM   14  C           1       2.016  -0.655   1.310  1.00  0.00 \n"
+"HETATM   15  C           1       0.769  -1.059   2.118  1.00  0.00 \n"
+"HETATM   16  C           1       0.770  -0.250   3.428  1.00  0.00 \n"
+"HETATM   17  C           1      -0.476   0.655   3.428  1.00  0.00 \n"
+"HETATM   18  C           1       2.015   0.656   3.429  1.00  0.00 \n"
+"HETATM   19  C           1       0.000   2.119   3.428  1.00  0.00 \n"
+"HETATM   20  C           1       1.539   2.119   3.428  1.00  0.00 \n"
+"HETATM   21  H           1      -0.389  -0.536  -0.866  1.00  0.00 \n"
+"HETATM   22  H           1       1.929  -0.535  -0.866  1.00  0.00 \n"
+"HETATM   23  H           1       2.645   1.669  -0.866  1.00  0.00 \n"
+"HETATM   24  H           1       0.771   3.031  -0.867  1.00  0.00 \n"
+"HETATM   25  H           1      -1.105   1.670  -0.867  1.00  0.00 \n"
+"HETATM   26  H           1      -1.105  -1.521   1.105  1.00  0.00 \n"
+"HETATM   27  H           1      -2.264   0.073   2.321  1.00  0.00 \n"
+"HETATM   28  H           1      -2.264   2.044   1.104  1.00  0.00 \n"
+"HETATM   29  H           1      -1.105   3.639   2.324  1.00  0.00 \n"
+"HETATM   30  H           1       0.771   4.249   1.105  1.00  0.00 \n"
+"HETATM   31  H           1       2.645   3.640   2.327  1.00  0.00 \n"
+"HETATM   32  H           1       3.804   2.046   1.106  1.00  0.00 \n"
+"HETATM   33  H           1       3.803   0.073   2.325  1.00  0.00 \n"
+"HETATM   34  H           1       2.645  -1.522   1.106  1.00  0.00 \n"
+"HETATM   35  H           1       0.769  -2.130   2.322  1.00  0.00 \n"
+"HETATM   36  H           1       0.771  -0.912   4.294  1.00  0.00 \n"
+"HETATM   37  H           1      -1.106   0.451   4.294  1.00  0.00 \n"
+"HETATM   38  H           1       2.644   0.453   4.295  1.00  0.00 \n"
+"HETATM   39  H           1      -0.387   2.655   4.295  1.00  0.00 \n"
+"HETATM   40  H           1       1.928   2.654   4.295  1.00  0.00 \n"
+"CONECT    1    2    5    6   21\n"
+"CONECT    2    1    3   14   22\n"
+"CONECT    3    2    4   12   23\n"
+"CONECT    4    3    5   10   24\n"
+"CONECT    5    1    4    8   25\n"
+"CONECT    6    1    7   15   26\n"
+"CONECT    7    6    8   17   27\n"
+"CONECT    8    5    7    9   28\n"
+"CONECT    9    8   10   19   29\n"
+"CONECT   10    4    9   11   30\n"
+"CONECT   11   10   12   20   31\n"
+"CONECT   12    3   11   13   32\n"
+"CONECT   13   12   14   18   33\n"
+"CONECT   14    2   13   15   34\n"
+"CONECT   15    6   14   16   35\n"
+"CONECT   16   15   17   18   36\n"
+"CONECT   17    7   16   19   37\n"
+"CONECT   18   13   16   20   38\n"
+"CONECT   19    9   17   20   39\n"
+"CONECT   20   11   18   19   40\n"
+"CONECT   21    1\n"
+"CONECT   22    2\n"
+"CONECT   23    3\n"
+"CONECT   24    4\n"
+"CONECT   25    5\n"
+"CONECT   26    6\n"
+"CONECT   27    7\n"
+"CONECT   28    8\n"
+"CONECT   29    9\n"
+"CONECT   30   10\n"
+"CONECT   31   11\n"
+"CONECT   32   12\n"
+"CONECT   33   13\n"
+"CONECT   34   14\n"
+"CONECT   35   15\n"
+"CONECT   36   16\n"
+"CONECT   37   17\n"
+"CONECT   38   18\n"
+"CONECT   39   19\n"
+"CONECT   40   20\n"
+"MASTER        0    0    0    0    0    0    0    0   40    0   40    0\n"
+"END\n"
+,
+"HEADER    Tetrahydrocannabinol: Delta 9-THC, an hallucinogen\n"
+"ATOM      1  O   UNK     0      -1.791  -1.420   0.434\n"
+"ATOM      2  C   UNK     0      -0.536  -1.012   0.033\n"
+"ATOM      3  C   UNK     0       0.565  -1.346   0.828\n"
+"ATOM      4  C   UNK     0       1.855  -0.978   0.446\n"
+"ATOM      5  C   UNK     0       2.038  -0.295  -0.757\n"
+"ATOM      6  C   UNK     0       0.940   0.052  -1.556\n"
+"ATOM      7  C   UNK     0      -0.363  -0.272  -1.148\n"
+"ATOM      8  C   UNK     0      -1.599   0.113  -1.985\n"
+"ATOM      9  C   UNK     0      -1.568   1.523  -2.537\n"
+"ATOM     10  C   UNK     0      -2.681   2.231  -2.781\n"
+"ATOM     11  C   UNK     0      -4.068   1.708  -2.479\n"
+"ATOM     12  C   UNK     0      -4.085   0.222  -2.091\n"
+"ATOM     13  C   UNK     0      -2.892  -0.061  -1.162\n"
+"ATOM     14  C   UNK     0      -2.908  -1.421  -0.435\n"
+"ATOM     15  O   UNK     0       1.151   0.702  -2.747\n"
+"ATOM     16  C   UNK     0      -2.610   3.628  -3.338\n"
+"ATOM     17  C   UNK     0      -2.824  -2.642  -1.364\n"
+"ATOM     18  C   UNK     0      -4.125  -1.570   0.485\n"
+"ATOM     19  C   UNK     0       3.056  -1.332   1.325\n"
+"ATOM     20  C   UNK     0       3.365  -0.156   2.260\n"
+"ATOM     21  C   UNK     0       4.569  -0.467   3.158\n"
+"ATOM     22  C   UNK     0       4.872   0.726   4.074\n"
+"ATOM     23  C   UNK     0       6.079   0.425   4.969\n"
+"ATOM     24  H   UNK     0       0.400  -1.896   1.747\n"
+"ATOM     25  H   UNK     0      -1.626  -0.566  -2.849\n"
+"ATOM     26  H   UNK     0      -4.720   1.866  -3.352\n"
+"ATOM     27  H   UNK     0      -4.004  -0.399  -2.997\n"
+"ATOM     28  H   UNK     0       2.079   0.837  -2.898\n"
+"ATOM     29  H   UNK     0      -3.163   4.315  -2.681\n"
+"ATOM     30  H   UNK     0      -2.839  -3.562  -0.762\n"
+"ATOM     31  H   UNK     0      -3.995  -2.460   1.119\n"
+"ATOM     32  H   UNK     0      -4.210  -0.687   1.134\n"
+"ATOM     33  H   UNK     0       2.828  -2.232   1.917\n"
+"ATOM     34  H   UNK     0       2.480   0.048   2.884\n"
+"ATOM     35  H   UNK     0       4.349  -1.356   3.772\n"
+"ATOM     36  H   UNK     0       3.994   0.938   4.706\n"
+"ATOM     37  H   UNK     0       6.286   1.290   5.618\n"
+"ATOM     38  H   UNK     0       3.036  -0.022  -1.076\n"
+"ATOM     39  H   UNK     0      -0.602   1.973  -2.755\n"
+"ATOM     40  H   UNK     0      -5.037  -0.005  -1.590\n"
+"ATOM     41  H   UNK     0      -2.881   0.709  -0.374\n"
+"ATOM     42  H   UNK     0      -1.565   3.966  -3.407\n"
+"ATOM     43  H   UNK     0      -3.058   3.644  -4.342\n"
+"ATOM     44  H   UNK     0      -1.884  -2.619  -1.933\n"
+"ATOM     45  H   UNK     0      -3.674  -2.652  -2.061\n"
+"ATOM     46  H   UNK     0      -5.048  -1.683  -0.102\n"
+"ATOM     47  H   UNK     0       3.928  -1.546   0.687\n"
+"ATOM     48  H   UNK     0       3.578   0.739   1.654\n"
+"ATOM     49  H   UNK     0       5.449  -0.681   2.531\n"
+"ATOM     50  H   UNK     0       5.086   1.616   3.462\n"
+"ATOM     51  H   UNK     0       5.873  -0.453   5.600\n"
+"ATOM     52  H   UNK     0       6.967   0.224   4.351\n"
+"ATOM     53  H   UNK     0      -4.467   2.295  -1.638\n"
+"CONECT    1    2   14\n"
+"CONECT    2    1    3    7\n"
+"CONECT    3    2    4   24\n"
+"CONECT    4    3    5   19\n"
+"CONECT    5    4    6   38\n"
+"CONECT    6    5    7   15\n"
+"CONECT    7    2    6    8\n"
+"CONECT    8    7    9   13   25\n"
+"CONECT    9    8   10   39\n"
+"CONECT   10    9   11   16\n"
+"CONECT   11   10   12   26   53\n"
+"CONECT   12   11   27   40   13\n"
+"CONECT   13    8   12   41   14\n"
+"CONECT   14    1   13   17   18\n"
+"CONECT   15    6   28\n"
+"CONECT   16   10   29   42   43\n"
+"CONECT   17   14   30   44   45\n"
+"CONECT   18   14   31   32   46\n"
+"CONECT   19    4   20   33   47\n"
+"CONECT   20   19   21   34   48\n"
+"CONECT   21   20   22   35   49\n"
+"CONECT   22   21   23   36   50\n"
+"CONECT   23   22   37   51   52\n"
+"CONECT   24    3\n"
+"CONECT   25    8\n"
+"CONECT   26   11\n"
+"CONECT   27   12\n"
+"CONECT   28   15\n"
+"CONECT   29   16\n"
+"CONECT   30   17\n"
+"CONECT   31   18\n"
+"CONECT   32   18\n"
+"CONECT   33   19\n"
+"CONECT   34   20\n"
+"CONECT   35   21\n"
+"CONECT   36   22\n"
+"CONECT   37   23\n"
+"CONECT   38    5\n"
+"CONECT   39    9\n"
+"CONECT   40   12\n"
+"CONECT   41   13\n"
+"CONECT   42   16\n"
+"CONECT   43   16\n"
+"CONECT   44   17\n"
+"CONECT   45   17\n"
+"CONECT   46   18\n"
+"CONECT   47   19\n"
+"CONECT   48   20\n"
+"CONECT   49   21\n"
+"CONECT   50   22\n"
+"CONECT   51   23\n"
+"CONECT   52   23\n"
+"CONECT   53   11\n"
+,
+"HEADER    Trinitroglycerin: Dynamite, an explosive\n"
+"COMPND    jb09trin\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Tue Sep 19 21:46:02 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.540   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.063   1.449   0.000  1.00  0.00 \n"
+"HETATM    4  O           1       3.467   1.429   0.127  1.00  0.00 \n"
+"HETATM    5  N           1       4.015   2.776  -0.152  1.00  0.00 \n"
+"HETATM    6  O           1       4.998   3.268   0.635  1.00  0.00 \n"
+"HETATM    7  O           1       3.773   3.351  -1.351  1.00  0.00 \n"
+"HETATM    8  O           1       2.004  -0.755   1.098  1.00  0.00 \n"
+"HETATM    9  N           1       2.641  -0.291   2.107  1.00  0.00 \n"
+"HETATM   10  O           1       3.090  -1.154   3.047  1.00  0.00 \n"
+"HETATM   11  O           1       2.879   1.030   2.268  1.00  0.00 \n"
+"HETATM   12  O           1      -0.458  -1.330  -0.079  1.00  0.00 \n"
+"HETATM   13  N           1      -1.911  -1.339  -0.361  1.00  0.00 \n"
+"HETATM   14  O           1      -2.745  -2.029   0.450  1.00  0.00 \n"
+"HETATM   15  O           1      -2.357  -0.902  -1.560  1.00  0.00 \n"
+"HETATM   16  H           1      -0.365   0.561  -0.860  1.00  0.00 \n"
+"HETATM   17  H           1      -0.369   0.458   0.918  1.00  0.00 \n"
+"HETATM   18  H           1       1.886  -0.486  -0.912  1.00  0.00 \n"
+"HETATM   19  H           1       1.620   2.013   0.821  1.00  0.00 \n"
+"HETATM   20  H           1       1.793   1.925  -0.943  1.00  0.00 \n"
+"CONECT    1    2   12   16   17\n"
+"CONECT    2    1    3    8   18\n"
+"CONECT    3    2    4   19   20\n"
+"CONECT    4    3    5\n"
+"CONECT    5    4    6    7\n"
+"CONECT    6    5\n"
+"CONECT    7    5\n"
+"CONECT    8    2    9\n"
+"CONECT    9    8   10   11\n"
+"CONECT   10    9\n"
+"CONECT   11    9\n"
+"CONECT   12    1   13\n"
+"CONECT   13   12   14   15\n"
+"CONECT   14   13\n"
+"CONECT   15   13\n"
+"CONECT   16    1\n"
+"CONECT   17    1\n"
+"CONECT   18    2\n"
+"CONECT   19    3\n"
+"CONECT   20    3\n"
+"MASTER        0    0    0    0    0    0    0    0   20    0   20    0\n"
+"END\n"
+,
+"HEADER    Ethylene Glycol: Ethane-1,2-diol, Anti-freeze\n"
+"COMPND    al2034\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Tue Aug 29 17:54:52 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.542   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  O           1       2.027   1.347   0.000  1.00  0.00 \n"
+"HETATM    4  O           1      -0.485  -1.347  -0.041  1.00  0.00 \n"
+"HETATM    5  H           1      -0.360   0.537  -0.878  1.00  0.00 \n"
+"HETATM    6  H           1      -0.367   0.494   0.900  1.00  0.00 \n"
+"HETATM    7  H           1       1.902  -0.512  -0.893  1.00  0.00 \n"
+"HETATM    8  H           1       1.908  -0.520   0.885  1.00  0.00 \n"
+"HETATM    9  H           1       1.743   1.800   0.802  1.00  0.00 \n"
+"HETATM   10  H           1      -0.202  -1.823   0.747  1.00  0.00 \n"
+"CONECT    1    2    4    5    6\n"
+"CONECT    2    1    3    7    8\n"
+"CONECT    3    2    9\n"
+"CONECT    4    1   10\n"
+"CONECT    5    1\n"
+"CONECT    6    1\n"
+"CONECT    7    2\n"
+"CONECT    8    2\n"
+"CONECT    9    3\n"
+"CONECT   10    4\n"
+"MASTER        0    0    0    0    0    0    0    0   10    0   10    0\n"
+"END\n"
+,
+"HEADER    Guanine: Purine base nucleotide\n"
+"COMPND    jb09guan\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Tue Sep 19 21:46:02 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.392   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.082   1.215   0.000  1.00  0.00 \n"
+"HETATM    4  N           1       1.339   2.346  -0.001  1.00  0.00 \n"
+"HETATM    5  C           1      -0.017   2.313  -0.003  1.00  0.00 \n"
+"HETATM    6  N           1      -0.709   1.149  -0.003  1.00  0.00 \n"
+"HETATM    7  N           1      -0.392  -1.291  -0.028  1.00  0.00 \n"
+"HETATM    8  C           1       0.730  -2.047  -0.044  1.00  0.00 \n"
+"HETATM    9  N           1       1.842  -1.275  -0.028  1.00  0.00 \n"
+"HETATM   10  O           1       3.285   1.253  -0.010  1.00  0.00 \n"
+"HETATM   11  N           1      -0.723   3.523  -0.019  1.00  0.00 \n"
+"HETATM   12  H           1       1.811   3.244  -0.007  1.00  0.00 \n"
+"HETATM   13  H           1      -1.347  -1.629  -0.048  1.00  0.00 \n"
+"HETATM   14  H           1       0.738  -3.137  -0.077  1.00  0.00 \n"
+"HETATM   15  H           1      -1.640   3.377  -0.427  1.00  0.00 \n"
+"HETATM   16  H           1      -0.213   4.205  -0.570  1.00  0.00 \n"
+"CONECT    1    2    2    6    7\n"
+"CONECT    2    1    1    3    9\n"
+"CONECT    3    2    4   10   10\n"
+"CONECT    4    3    5   12\n"
+"CONECT    5    4    6    6   11\n"
+"CONECT    6    1    5    5\n"
+"CONECT    7    1    8   13\n"
+"CONECT    8    7    9    9   14\n"
+"CONECT    9    2    8    8\n"
+"CONECT   10    3    3\n"
+"CONECT   11    5   15   16\n"
+"CONECT   12    4\n"
+"CONECT   13    7\n"
+"CONECT   14    8\n"
+"CONECT   15   11\n"
+"CONECT   16   11\n"
+"MASTER        0    0    0    0    0    0    0    0   16    0   16    0\n"
+"END\n"
+,
+"HEADER    Diacetylmorphine: Heroin, an opiate\n"
+"COMPND    al3084\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.400   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.108   1.210   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.452   2.447  -0.065  1.00  0.00 \n"
+"HETATM    5  C           1       0.055   2.457  -0.018  1.00  0.00 \n"
+"HETATM    6  C           1      -0.624   1.244   0.041  1.00  0.00 \n"
+"HETATM    7  C           1      -2.081   1.501  -0.201  1.00  0.00 \n"
+"HETATM    8  C           1      -2.725   0.343  -0.973  1.00  0.00 \n"
+"HETATM    9  C           1      -2.367  -0.953  -0.210  1.00  0.00 \n"
+"HETATM   10  C           1      -0.836  -1.236  -0.253  1.00  0.00 \n"
+"HETATM   11  C           1      -1.913   2.852  -0.934  1.00  0.00 \n"
+"HETATM   12  C           1      -2.752   1.623   1.177  1.00  0.00 \n"
+"HETATM   13  C           1      -2.503   0.306   1.943  1.00  0.00 \n"
+"HETATM   14  N           1      -2.936  -0.856   1.147  1.00  0.00 \n"
+"HETATM   15  C           1      -2.820  -2.103   1.920  1.00  0.00 \n"
+"HETATM   16  H           1      -3.807   0.473  -0.972  1.00  0.00 \n"
+"HETATM   17  C           1      -2.256   0.283  -2.408  1.00  0.00 \n"
+"HETATM   18  C           1      -1.948   1.398  -3.085  1.00  0.00 \n"
+"HETATM   19  C           1      -1.494   2.675  -2.413  1.00  0.00 \n"
+"HETATM   20  H           1      -2.820   3.452  -0.859  1.00  0.00 \n"
+"HETATM   21  O           1      -0.799   3.480  -0.318  1.00  0.00 \n"
+"HETATM   22  H           1      -1.885   3.520  -2.982  1.00  0.00 \n"
+"HETATM   23  O           1      -0.083   2.674  -2.462  1.00  0.00 \n"
+"HETATM   24  O           1       2.142   3.620  -0.142  1.00  0.00 \n"
+"HETATM   25  H           1       1.942  -0.945  -0.044  1.00  0.00 \n"
+"HETATM   26  H           1       3.198   1.180  -0.006  1.00  0.00 \n"
+"HETATM   27  H           1      -2.866  -1.782  -0.712  1.00  0.00 \n"
+"HETATM   28  H           1      -0.588  -1.599  -1.250  1.00  0.00 \n"
+"HETATM   29  H           1      -0.574  -2.010   0.465  1.00  0.00 \n"
+"HETATM   30  H           1      -3.823   1.785   1.052  1.00  0.00 \n"
+"HETATM   31  H           1      -2.320   2.456   1.731  1.00  0.00 \n"
+"HETATM   32  H           1      -3.068   0.334   2.874  1.00  0.00 \n"
+"HETATM   33  H           1      -1.444   0.211   2.184  1.00  0.00 \n"
+"HETATM   34  H           1      -3.492  -2.057   2.778  1.00  0.00 \n"
+"HETATM   35  H           1      -1.799  -2.234   2.280  1.00  0.00 \n"
+"HETATM   36  H           1      -3.099  -2.953   1.298  1.00  0.00 \n"
+"HETATM   37  H           1      -2.414  -0.639  -2.967  1.00  0.00 \n"
+"HETATM   38  H           1      -1.797   1.313  -4.161  1.00  0.00 \n"
+"HETATM   39  C           1       3.076   3.567  -1.091  1.00  0.00 \n"
+"HETATM   40  O           1       2.786   3.826  -2.230  1.00  0.00 \n"
+"HETATM   41  C           1       4.523   3.509  -0.695  1.00  0.00 \n"
+"HETATM   42  H           1       5.012   2.691  -1.224  1.00  0.00 \n"
+"HETATM   43  H           1       4.600   3.345   0.380  1.00  0.00 \n"
+"HETATM   44  H           1       5.008   4.450  -0.954  1.00  0.00 \n"
+"HETATM   45  C           1       0.390   3.733  -3.117  1.00  0.00 \n"
+"HETATM   46  O           1       0.845   3.595  -4.223  1.00  0.00 \n"
+"HETATM   47  C           1       0.417   5.083  -2.459  1.00  0.00 \n"
+"HETATM   48  H           1       1.199   5.692  -2.913  1.00  0.00 \n"
+"HETATM   49  H           1       0.619   4.970  -1.395  1.00  0.00 \n"
+"HETATM   50  H           1      -0.547   5.574  -2.594  1.00  0.00 \n"
+"CONECT    1    2    2    6   10\n"
+"CONECT    2    1    1    3   25\n"
+"CONECT    3    2    4    4   26\n"
+"CONECT    4    3    3    5   24\n"
+"CONECT    5    4    6    6   21\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8   11   12\n"
+"CONECT    8    7    9   16   17\n"
+"CONECT    9    8   10   14   27\n"
+"CONECT   10    1    9   28   29\n"
+"CONECT   11    7   19   20   21\n"
+"CONECT   12    7   13   30   31\n"
+"CONECT   13   12   14   32   33\n"
+"CONECT   14    9   13   15\n"
+"CONECT   15   14   34   35   36\n"
+"CONECT   16    8\n"
+"CONECT   17    8   18   18   37\n"
+"CONECT   18   17   17   19   38\n"
+"CONECT   19   11   18   22   23\n"
+"CONECT   20   11\n"
+"CONECT   21    5   11\n"
+"CONECT   22   19\n"
+"CONECT   23   19   45\n"
+"CONECT   24    4   39\n"
+"CONECT   25    2\n"
+"CONECT   26    3\n"
+"CONECT   27    9\n"
+"CONECT   28   10\n"
+"CONECT   29   10\n"
+"CONECT   30   12\n"
+"CONECT   31   12\n"
+"CONECT   32   13\n"
+"CONECT   33   13\n"
+"CONECT   34   15\n"
+"CONECT   35   15\n"
+"CONECT   36   15\n"
+"CONECT   37   17\n"
+"CONECT   38   18\n"
+"CONECT   39   24   40   40   41\n"
+"CONECT   40   39   39\n"
+"CONECT   41   39   42   43   44\n"
+"CONECT   42   41\n"
+"CONECT   43   41\n"
+"CONECT   44   41\n"
+"CONECT   45   23   46   46   47\n"
+"CONECT   46   45   45\n"
+"CONECT   47   45   48   49   50\n"
+"CONECT   48   47\n"
+"CONECT   49   47\n"
+"CONECT   50   47\n"
+"MASTER        0    0    0    0    0    0    0    0   50    0   50    0\n"
+"END\n"
+,
+"COMPND    Hexahelicene\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.404   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.104   1.206   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.402   2.413  -0.064  1.00  0.00 \n"
+"HETATM    5  C           1       0.002   2.407  -0.063  1.00  0.00 \n"
+"HETATM    6  C           1      -0.705   1.209   0.071  1.00  0.00 \n"
+"HETATM    7  C           1      -2.102   1.180   0.220  1.00  0.00 \n"
+"HETATM    8  C           1      -2.847   2.295   0.643  1.00  0.00 \n"
+"HETATM    9  C           1      -4.192   2.360   0.266  1.00  0.00 \n"
+"HETATM   10  C           1      -4.858   1.229  -0.190  1.00  0.00 \n"
+"HETATM   11  C           1      -4.166   0.012  -0.273  1.00  0.00 \n"
+"HETATM   12  C           1      -2.782  -0.001  -0.086  1.00  0.00 \n"
+"HETATM   13  C           1      -2.082  -1.204  -0.224  1.00  0.00 \n"
+"HETATM   14  C           1      -0.685  -1.210  -0.107  1.00  0.00 \n"
+"HETATM   15  C           1      -2.318   3.332   1.420  1.00  0.00 \n"
+"HETATM   16  C           1      -1.206   3.177   2.264  1.00  0.00 \n"
+"HETATM   17  C           1      -0.519   4.289   2.729  1.00  0.00 \n"
+"HETATM   18  C           1      -1.052   5.582   2.503  1.00  0.00 \n"
+"HETATM   19  C           1      -2.286   5.716   1.895  1.00  0.00 \n"
+"HETATM   20  C           1      -2.936   4.583   1.371  1.00  0.00 \n"
+"HETATM   21  C           1      -4.216   4.717   0.815  1.00  0.00 \n"
+"HETATM   22  C           1      -4.881   3.585   0.350  1.00  0.00 \n"
+"HETATM   23  C           1      -0.789   1.905   2.707  1.00  0.00 \n"
+"HETATM   24  C           1       0.400   1.759   3.421  1.00  0.00 \n"
+"HETATM   25  C           1       1.155   2.887   3.765  1.00  0.00 \n"
+"HETATM   26  C           1       0.669   4.165   3.443  1.00  0.00 \n"
+"HETATM   27  H           1       1.945  -0.947  -0.019  1.00  0.00 \n"
+"HETATM   28  H           1       3.191   1.206  -0.002  1.00  0.00 \n"
+"HETATM   29  H           1       1.942   3.359  -0.131  1.00  0.00 \n"
+"HETATM   30  H           1      -0.523   3.350  -0.198  1.00  0.00 \n"
+"HETATM   31  H           1      -5.918   1.264  -0.433  1.00  0.00 \n"
+"HETATM   32  H           1      -4.698  -0.901  -0.555  1.00  0.00 \n"
+"HETATM   33  H           1      -2.617  -2.140  -0.409  1.00  0.00 \n"
+"HETATM   34  H           1      -0.142  -2.150  -0.180  1.00  0.00 \n"
+"HETATM   35  H           1      -0.520   6.457   2.886  1.00  0.00 \n"
+"HETATM   36  H           1      -2.751   6.690   1.806  1.00  0.00 \n"
+"HETATM   37  H           1      -4.715   5.680   0.815  1.00  0.00 \n"
+"HETATM   38  H           1      -5.917   3.654   0.008  1.00  0.00 \n"
+"HETATM   39  H           1      -1.407   1.021   2.524  1.00  0.00 \n"
+"HETATM   40  H           1       0.734   0.774   3.725  1.00  0.00 \n"
+"HETATM   41  H           1       2.090   2.777   4.328  1.00  0.00 \n"
+"HETATM   42  H           1       1.225   5.042   3.772  1.00  0.00 \n"
+"CONECT    1    2    2    6   14\n"
+"CONECT    2    1    1    3   27\n"
+"CONECT    3    2    4    4   28\n"
+"CONECT    4    3    3    5   29\n"
+"CONECT    5    4    6    6   30\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8    8   12\n"
+"CONECT    8    7    7    9   15\n"
+"CONECT    9    8   10   10   22\n"
+"CONECT   10    9    9   11   31\n"
+"CONECT   11   10   12   12   32\n"
+"CONECT   12    7   11   11   13\n"
+"CONECT   13   12   14   14   33\n"
+"CONECT   14    1   13   13   34\n"
+"CONECT   15    8   16   16   20\n"
+"CONECT   16   15   15   17   23\n"
+"CONECT   17   16   18   18   26\n"
+"CONECT   18   17   17   19   35\n"
+"CONECT   19   18   20   20   36\n"
+"CONECT   20   15   19   19   21\n"
+"CONECT   21   20   22   22   37\n"
+"CONECT   22    9   21   21   38\n"
+"CONECT   23   16   24   24   39\n"
+"CONECT   24   23   23   25   40\n"
+"CONECT   25   24   26   26   41\n"
+"CONECT   26   17   25   25   42\n"
+"CONECT   27    2\n"
+"CONECT   28    3\n"
+"CONECT   29    4\n"
+"CONECT   30    5\n"
+"CONECT   31   10\n"
+"CONECT   32   11\n"
+"CONECT   33   13\n"
+"CONECT   34   14\n"
+"CONECT   35   18\n"
+"CONECT   36   19\n"
+"CONECT   37   21\n"
+"CONECT   38   22\n"
+"CONECT   39   23\n"
+"CONECT   40   24\n"
+"CONECT   41   25\n"
+"CONECT   42   26\n"
+"MASTER        0    0    0    0    0    0    0    0   42    0   42    0\n"
+"END\n"
+,
+"HEADER    Ibuprofen: Advil/Motrin, an anti-inflammatory\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.399   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.098   1.212   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.391   2.419   0.004  1.00  0.00 \n"
+"HETATM    5  C           1      -0.008   2.417   0.005  1.00  0.00 \n"
+"HETATM    6  C           1      -0.712   1.206  -0.003  1.00  0.00 \n"
+"HETATM    7  C           1      -2.224   1.136  -0.009  1.00  0.00 \n"
+"HETATM    8  C           1      -2.900   2.504  -0.232  1.00  0.00 \n"
+"HETATM    9  C           1       3.611   1.210  -0.042  1.00  0.00 \n"
+"HETATM   10  C           1       4.094   0.909  -1.477  1.00  0.00 \n"
+"HETATM   11  C           1       5.635   0.868  -1.503  1.00  0.00 \n"
+"HETATM   12  C           1       3.590   1.996  -2.450  1.00  0.00 \n"
+"HETATM   13  C           1      -2.686   0.573   1.305  1.00  0.00 \n"
+"HETATM   14  O           1      -3.846   0.297   1.466  1.00  0.00 \n"
+"HETATM   15  O           1      -1.792   0.321   2.277  1.00  0.00 \n"
+"HETATM   16  H           1      -0.539  -0.948  -0.004  1.00  0.00 \n"
+"HETATM   17  H           1       1.943  -0.945  -0.009  1.00  0.00 \n"
+"HETATM   18  H           1       1.930   3.366  -0.006  1.00  0.00 \n"
+"HETATM   19  H           1      -0.533   3.371   0.004  1.00  0.00 \n"
+"HETATM   20  H           1      -2.536   0.461  -0.807  1.00  0.00 \n"
+"HETATM   21  H           1      -2.546   2.944  -1.165  1.00  0.00 \n"
+"HETATM   22  H           1      -2.676   3.171   0.600  1.00  0.00 \n"
+"HETATM   23  H           1      -3.980   2.365  -0.292  1.00  0.00 \n"
+"HETATM   24  H           1       3.986   0.442   0.635  1.00  0.00 \n"
+"HETATM   25  H           1       3.990   2.181   0.277  1.00  0.00 \n"
+"HETATM   26  H           1       3.707  -0.061  -1.792  1.00  0.00 \n"
+"HETATM   27  H           1       5.991   0.094  -0.823  1.00  0.00 \n"
+"HETATM   28  H           1       6.034   1.834  -1.192  1.00  0.00 \n"
+"HETATM   29  H           1       5.978   0.645  -2.513  1.00  0.00 \n"
+"HETATM   30  H           1       3.941   2.975  -2.122  1.00  0.00 \n"
+"HETATM   31  H           1       2.500   1.993  -2.477  1.00  0.00 \n"
+"HETATM   32  H           1       3.970   1.793  -3.451  1.00  0.00 \n"
+"HETATM   33  H           1      -1.689  -0.648   2.383  1.00  0.00 \n"
+"CONECT    1    2    2    6   16\n"
+"CONECT    2    1    1    3   17\n"
+"CONECT    3    2    4    4    9\n"
+"CONECT    4    3    3    5   18\n"
+"CONECT    5    4    6    6   19\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8   13   20\n"
+"CONECT    8    7   21   22   23\n"
+"CONECT    9    3   10   24   25\n"
+"CONECT   10    9   11   12   26\n"
+"CONECT   11   10   27   28   29\n"
+"CONECT   12   10   30   31   32\n"
+"CONECT   13    7   14   14   15\n"
+"CONECT   14   13   13\n"
+"CONECT   15   13   33\n"
+"CONECT   16    1\n"
+"CONECT   17    2\n"
+"CONECT   18    4\n"
+"CONECT   19    5\n"
+"CONECT   20    7\n"
+"CONECT   21    8\n"
+"CONECT   22    8\n"
+"CONECT   23    8\n"
+"CONECT   24    9\n"
+"CONECT   25    9\n"
+"CONECT   26   10\n"
+"CONECT   27   11\n"
+"CONECT   28   11\n"
+"CONECT   29   11\n"
+"CONECT   30   12\n"
+"CONECT   31   12\n"
+"CONECT   32   12\n"
+"CONECT   33   15\n"
+"MASTER        0    0    0    0    0    0    0    0   33    0   33    0\n"
+"END\n"
+,
+"HEADER    Lysergic acid diethylamide, a potent hallucinogen\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.397   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.012   1.258   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.246   2.433  -0.052  1.00  0.00 \n"
+"HETATM    5  C           1      -0.155   2.405  -0.125  1.00  0.00 \n"
+"HETATM    6  C           1      -0.773   1.155  -0.096  1.00  0.00 \n"
+"HETATM    7  N           1      -2.065   0.769  -0.378  1.00  0.00 \n"
+"HETATM    8  C           1      -2.092  -0.602  -0.503  1.00  0.00 \n"
+"HETATM    9  C           1      -0.810  -1.103  -0.242  1.00  0.00 \n"
+"HETATM   10  C           1      -0.159  -2.415  -0.700  1.00  0.00 \n"
+"HETATM   11  C           1       1.178  -2.555   0.075  1.00  0.00 \n"
+"HETATM   12  C           1       2.056  -1.321  -0.019  1.00  0.00 \n"
+"HETATM   13  H           1       0.916  -2.675   1.126  1.00  0.00 \n"
+"HETATM   14  N           1       1.899  -3.768  -0.346  1.00  0.00 \n"
+"HETATM   15  C           1       3.394  -1.430   0.057  1.00  0.00 \n"
+"HETATM   16  C           1       4.101  -2.765   0.134  1.00  0.00 \n"
+"HETATM   17  C           1       3.115  -3.899   0.470  1.00  0.00 \n"
+"HETATM   18  H           1       4.565  -2.960  -0.830  1.00  0.00 \n"
+"HETATM   19  C           1       5.121  -2.704   1.237  1.00  0.00 \n"
+"HETATM   20  O           1       4.720  -2.413   2.335  1.00  0.00 \n"
+"HETATM   21  N           1       6.434  -3.000   1.089  1.00  0.00 \n"
+"HETATM   22  C           1       7.305  -2.925   2.274  1.00  0.00 \n"
+"HETATM   23  C           1       7.755  -4.340   2.686  1.00  0.00 \n"
+"HETATM   24  C           1       7.047  -3.307  -0.215  1.00  0.00 \n"
+"HETATM   25  C           1       6.736  -4.755  -0.646  1.00  0.00 \n"
+"HETATM   26  H           1       3.094   1.350   0.014  1.00  0.00 \n"
+"HETATM   27  H           1       1.757   3.398  -0.079  1.00  0.00 \n"
+"HETATM   28  H           1      -0.732   3.319  -0.249  1.00  0.00 \n"
+"HETATM   29  H           1      -2.858   1.432  -0.658  1.00  0.00 \n"
+"HETATM   30  H           1      -2.917  -1.177  -0.924  1.00  0.00 \n"
+"HETATM   31  H           1       0.025  -2.349  -1.772  1.00  0.00 \n"
+"HETATM   32  H           1      -0.811  -3.260  -0.484  1.00  0.00 \n"
+"HETATM   33  H           1       4.015  -0.538   0.044  1.00  0.00 \n"
+"HETATM   34  H           1       2.844  -3.840   1.524  1.00  0.00 \n"
+"HETATM   35  H           1       3.586  -4.865   0.286  1.00  0.00 \n"
+"HETATM   36  H           1       6.768  -2.468   3.105  1.00  0.00 \n"
+"HETATM   37  H           1       8.181  -2.318   2.047  1.00  0.00 \n"
+"HETATM   38  H           1       8.376  -4.772   1.903  1.00  0.00 \n"
+"HETATM   39  H           1       6.879  -4.969   2.844  1.00  0.00 \n"
+"HETATM   40  H           1       8.332  -4.283   3.609  1.00  0.00 \n"
+"HETATM   41  H           1       8.129  -3.199  -0.132  1.00  0.00 \n"
+"HETATM   42  H           1       6.693  -2.606  -0.971  1.00  0.00 \n"
+"HETATM   43  H           1       5.663  -4.894  -0.765  1.00  0.00 \n"
+"HETATM   44  H           1       7.103  -5.451   0.107  1.00  0.00 \n"
+"HETATM   45  H           1       7.230  -4.962  -1.595  1.00  0.00 \n"
+"HETATM   46  C           1       2.198  -3.813  -1.786  1.00  0.00 \n"
+"HETATM   47  H           1       2.586  -2.854  -2.128  1.00  0.00 \n"
+"HETATM   48  H           1       1.292  -4.053  -2.342  1.00  0.00 \n"
+"HETATM   49  H           1       2.936  -4.591  -1.982  1.00  0.00 \n"
+"CONECT    1    2    2    6    9\n"
+"CONECT    2    1    1    3   12\n"
+"CONECT    3    2    4    4   26\n"
+"CONECT    4    3    3    5   27\n"
+"CONECT    5    4    6    6   28\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8   29\n"
+"CONECT    8    7    9    9   30\n"
+"CONECT    9    1    8    8   10\n"
+"CONECT   10    9   11   31   32\n"
+"CONECT   11   10   12   13   14\n"
+"CONECT   12    2   11   15   15\n"
+"CONECT   13   11\n"
+"CONECT   14   11   17   46\n"
+"CONECT   15   12   12   16   33\n"
+"CONECT   16   15   17   18   19\n"
+"CONECT   17   14   16   34   35\n"
+"CONECT   18   16\n"
+"CONECT   19   16   20   20   21\n"
+"CONECT   20   19   19\n"
+"CONECT   21   19   22   24\n"
+"CONECT   22   21   23   36   37\n"
+"CONECT   23   22   38   39   40\n"
+"CONECT   24   21   25   41   42\n"
+"CONECT   25   24   43   44   45\n"
+"CONECT   26    3\n"
+"CONECT   27    4\n"
+"CONECT   28    5\n"
+"CONECT   29    7\n"
+"CONECT   30    8\n"
+"CONECT   31   10\n"
+"CONECT   32   10\n"
+"CONECT   33   15\n"
+"CONECT   34   17\n"
+"CONECT   35   17\n"
+"CONECT   36   22\n"
+"CONECT   37   22\n"
+"CONECT   38   23\n"
+"CONECT   39   23\n"
+"CONECT   40   23\n"
+"CONECT   41   24\n"
+"CONECT   42   24\n"
+"CONECT   43   25\n"
+"CONECT   44   25\n"
+"CONECT   45   25\n"
+"CONECT   46   14   47   48   49\n"
+"CONECT   47   46\n"
+"CONECT   48   46\n"
+"CONECT   49   46\n"
+"MASTER        0    0    0    0    0    0    0    0   49    0   49    0\n"
+"END\n"
+,
+"HEADER    Menthol: Mentha arvensis oil\n"
+"COMPND    menthol\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  O           1       1.431   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1      -0.501   1.458   0.000  1.00  0.00 \n"
+"HETATM    4  C           1      -2.042   1.485  -0.004  1.00  0.00 \n"
+"HETATM    5  C           1      -2.576   0.746   1.240  1.00  0.00 \n"
+"HETATM    6  C           1      -2.072  -0.710   1.236  1.00  0.00 \n"
+"HETATM    7  C           1      -0.528  -0.726   1.258  1.00  0.00 \n"
+"HETATM    8  C           1      -0.005  -2.181   1.381  1.00  0.00 \n"
+"HETATM    9  C           1       1.486  -2.197   1.780  1.00  0.00 \n"
+"HETATM   10  C           1      -0.183  -2.997   0.081  1.00  0.00 \n"
+"HETATM   11  C           1      -2.539   2.945   0.003  1.00  0.00 \n"
+"HETATM   12  H           1      -0.367  -0.497  -0.898  1.00  0.00 \n"
+"HETATM   13  H           1       1.761   0.410  -0.806  1.00  0.00 \n"
+"HETATM   14  H           1      -0.129   1.968  -0.889  1.00  0.00 \n"
+"HETATM   15  H           1      -0.127   1.969   0.888  1.00  0.00 \n"
+"HETATM   16  H           1      -2.409   0.987  -0.903  1.00  0.00 \n"
+"HETATM   17  H           1      -3.666   0.750   1.224  1.00  0.00 \n"
+"HETATM   18  H           1      -2.229   1.249   2.142  1.00  0.00 \n"
+"HETATM   19  H           1      -2.440  -1.211   0.342  1.00  0.00 \n"
+"HETATM   20  H           1      -2.455  -1.222   2.119  1.00  0.00 \n"
+"HETATM   21  H           1      -0.200  -0.175   2.139  1.00  0.00 \n"
+"HETATM   22  H           1      -0.565  -2.673   2.176  1.00  0.00 \n"
+"HETATM   23  H           1       1.633  -1.600   2.680  1.00  0.00 \n"
+"HETATM   24  H           1       2.100  -1.796   0.975  1.00  0.00 \n"
+"HETATM   25  H           1       1.794  -3.223   1.980  1.00  0.00 \n"
+"HETATM   26  H           1       0.434  -2.578  -0.713  1.00  0.00 \n"
+"HETATM   27  H           1      -1.228  -2.993  -0.228  1.00  0.00 \n"
+"HETATM   28  H           1       0.127  -4.026   0.261  1.00  0.00 \n"
+"HETATM   29  H           1      -2.165   3.462  -0.880  1.00  0.00 \n"
+"HETATM   30  H           1      -2.178   3.451   0.898  1.00  0.00 \n"
+"HETATM   31  H           1      -3.629   2.960  -0.005  1.00  0.00 \n"
+"CONECT    1    2    3    7   12\n"
+"CONECT    2    1   13\n"
+"CONECT    3    1    4   14   15\n"
+"CONECT    4    3    5   11   16\n"
+"CONECT    5    4    6   17   18\n"
+"CONECT    6    5    7   19   20\n"
+"CONECT    7    1    6    8   21\n"
+"CONECT    8    7    9   10   22\n"
+"CONECT    9    8   23   24   25\n"
+"CONECT   10    8   26   27   28\n"
+"CONECT   11    4   29   30   31\n"
+"CONECT   12    1\n"
+"CONECT   13    2\n"
+"CONECT   14    3\n"
+"CONECT   15    3\n"
+"CONECT   16    4\n"
+"CONECT   17    5\n"
+"CONECT   18    5\n"
+"CONECT   19    6\n"
+"CONECT   20    6\n"
+"CONECT   21    7\n"
+"CONECT   22    8\n"
+"CONECT   23    9\n"
+"CONECT   24    9\n"
+"CONECT   25    9\n"
+"CONECT   26   10\n"
+"CONECT   27   10\n"
+"CONECT   28   10\n"
+"CONECT   29   11\n"
+"CONECT   30   11\n"
+"CONECT   31   11\n"
+"MASTER        0    0    0    0    0    0    0    0   31    0   31    0\n"
+"END\n"
+,
+"HEADER    Mescaline: Peyote, an hallucinogen\n"
+"COMPND    jb12mesc\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Sep 20 16:26:54 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.398   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.098   1.213   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.399   2.424  -0.005  1.00  0.00 \n"
+"HETATM    5  C           1      -0.001   2.422   0.013  1.00  0.00 \n"
+"HETATM    6  C           1      -0.700   1.211   0.014  1.00  0.00 \n"
+"HETATM    7  O           1      -2.062   1.209   0.026  1.00  0.00 \n"
+"HETATM    8  C           1      -2.564   1.047  -1.282  1.00  0.00 \n"
+"HETATM    9  O           1      -0.682  -1.180  -0.024  1.00  0.00 \n"
+"HETATM   10  C           1      -0.867  -1.664   1.288  1.00  0.00 \n"
+"HETATM   11  O           1       2.078  -1.180  -0.002  1.00  0.00 \n"
+"HETATM   12  C           1       2.225  -1.657  -1.321  1.00  0.00 \n"
+"HETATM   13  C           1       2.154   3.735  -0.007  1.00  0.00 \n"
+"HETATM   14  C           1       2.388   4.190   1.447  1.00  0.00 \n"
+"HETATM   15  N           1       3.124   5.464   1.464  1.00  0.00 \n"
+"HETATM   16  H           1       3.188   1.207   0.000  1.00  0.00 \n"
+"HETATM   17  H           1      -0.549   3.364   0.023  1.00  0.00 \n"
+"HETATM   18  H           1      -2.231   0.093  -1.690  1.00  0.00 \n"
+"HETATM   19  H           1      -2.208   1.859  -1.916  1.00  0.00 \n"
+"HETATM   20  H           1      -3.653   1.064  -1.252  1.00  0.00 \n"
+"HETATM   21  H           1      -1.432  -0.938   1.873  1.00  0.00 \n"
+"HETATM   22  H           1       0.101  -1.837   1.758  1.00  0.00 \n"
+"HETATM   23  H           1      -1.419  -2.603   1.248  1.00  0.00 \n"
+"HETATM   24  H           1       2.775  -0.929  -1.917  1.00  0.00 \n"
+"HETATM   25  H           1       1.244  -1.825  -1.765  1.00  0.00 \n"
+"HETATM   26  H           1       2.777  -2.597  -1.303  1.00  0.00 \n"
+"HETATM   27  H           1       1.574   4.490  -0.538  1.00  0.00 \n"
+"HETATM   28  H           1       3.114   3.603  -0.507  1.00  0.00 \n"
+"HETATM   29  H           1       2.966   3.432   1.976  1.00  0.00 \n"
+"HETATM   30  H           1       1.427   4.321   1.944  1.00  0.00 \n"
+"HETATM   31  H           1       2.590   6.179   0.982  1.00  0.00 \n"
+"HETATM   32  H           1       4.024   5.350   1.012  1.00  0.00 \n"
+"CONECT    1    2    2    6    9\n"
+"CONECT    2    1    1    3   11\n"
+"CONECT    3    2    4    4   16\n"
+"CONECT    4    3    3    5   13\n"
+"CONECT    5    4    6    6   17\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8\n"
+"CONECT    8    7   18   19   20\n"
+"CONECT    9    1   10\n"
+"CONECT   10    9   21   22   23\n"
+"CONECT   11    2   12\n"
+"CONECT   12   11   24   25   26\n"
+"CONECT   13    4   14   27   28\n"
+"CONECT   14   13   15   29   30\n"
+"CONECT   15   14   31   32\n"
+"CONECT   16    3\n"
+"CONECT   17    5\n"
+"CONECT   18    8\n"
+"CONECT   19    8\n"
+"CONECT   20    8\n"
+"CONECT   21   10\n"
+"CONECT   22   10\n"
+"CONECT   23   10\n"
+"CONECT   24   12\n"
+"CONECT   25   12\n"
+"CONECT   26   12\n"
+"CONECT   27   13\n"
+"CONECT   28   13\n"
+"CONECT   29   14\n"
+"CONECT   30   14\n"
+"CONECT   31   15\n"
+"CONECT   32   15\n"
+"MASTER        0    0    0    0    0    0    0    0   32    0   32    0\n"
+"END\n"
+,
+"HEADER    Methamphetamine: D-Desoxyephedrine\n"
+"ORIGX1      1.000000  0.000000  0.000000        0.00000\n"
+"ORIGX2      0.000000  1.000000  0.000000        0.00000\n"
+"ORIGX3      0.000000  0.000000  1.000000        0.00000\n"
+"SCALE1      0.100000  0.000000  0.000000        0.00000\n"
+"SCALE2      0.000000  0.100000  0.000000        0.00000\n"
+"SCALE3      0.000000  0.000000  0.100000        0.00000\n"
+"ATOM      1  C           1       0.729   4.473  -1.914  1.00  0.00\n"
+"ATOM      2  C           1      -0.451   3.821  -2.014  1.00  0.00\n"
+"ATOM      3  C           1      -0.995   3.421  -3.398  1.00  0.00\n"
+"ATOM      4  C           1      -0.293   3.722  -4.513  1.00  0.00\n"
+"ATOM      5  C           1       1.052   4.465  -4.399  1.00  0.00\n"
+"ATOM      6  C           1       1.529   4.816  -3.184  1.00  0.00\n"
+"ATOM      7  H           1       1.115   4.756  -0.934  1.00  0.00\n"
+"ATOM      8  C           1      -1.251   3.478  -0.743  1.00  0.00\n"
+"ATOM      9  H           1      -1.947   2.896  -3.478  1.00  0.00\n"
+"ATOM     10  H           1      -0.678   3.440  -5.492  1.00  0.00\n"
+"ATOM     11  H           1       1.618   4.708  -5.298  1.00  0.00\n"
+"ATOM     12  H           1       2.481   5.342  -3.104  1.00  0.00\n"
+"ATOM     13  C           1      -0.489   3.986   0.496  1.00  0.00\n"
+"ATOM     14  N           1      -1.279   3.647   1.750  1.00  0.00\n"
+"ATOM     15  H           1      -1.378   2.398  -0.674  1.00  0.00\n"
+"ATOM     19  H           1      -2.229   3.957  -0.790  1.00  0.00\n"
+"ATOM     20  H           1       0.489   3.507   0.542  1.00  0.00\n"
+"ATOM     21  C           1      -0.310   5.512   0.398  1.00  0.00\n"
+"ATOM     22  H           1      -1.403   2.587   1.817  1.00  0.00\n"
+"ATOM     23  C           1      -0.528   4.148   2.972  1.00  0.00\n"
+"ATOM     24  H           1      -0.401   5.229   2.903  1.00  0.00\n"
+"ATOM     25  H           1       0.451   3.670   3.019  1.00  0.00\n"
+"ATOM     26  H           1      -1.094   3.905   3.871  1.00  0.00\n"
+"ATOM     27  H           1       0.229   5.871   1.275  1.00  0.00\n"
+"ATOM     28  H           1      -1.288   5.991   0.352  1.00  0.00\n"
+"ATOM     29  H           1       0.256   5.755  -0.501  1.00  0.00\n"
+"TER      30\n"
+"CONECT    1    2                                                                \n"
+"CONECT    2    1                                                                \n"
+"CONECT    2    3                                                                \n"
+"CONECT    3    2                                                                \n"
+"CONECT    3    4                                                                \n"
+"CONECT    4    3                                                                \n"
+"CONECT    4    5                                                                \n"
+"CONECT    5    4                                                                \n"
+"CONECT    5    6                                                                \n"
+"CONECT    6    5                                                                \n"
+"CONECT    6    1                                                                \n"
+"CONECT    1    6                                                                \n"
+"CONECT    1    7                                                                \n"
+"CONECT    7    1                                                                \n"
+"CONECT    2    8                                                                \n"
+"CONECT    8    2                                                                \n"
+"CONECT    3    9                                                                \n"
+"CONECT    9    3                                                                \n"
+"CONECT    4   10                                                                \n"
+"CONECT   10    4                                                                \n"
+"CONECT    5   11                                                                \n"
+"CONECT   11    5                                                                \n"
+"CONECT    6   12                                                                \n"
+"CONECT   12    6                                                                \n"
+"CONECT    8   13                                                                \n"
+"CONECT   13    8                                                                \n"
+"CONECT   13   14                                                                \n"
+"CONECT   14   13                                                                \n"
+"CONECT    8   15                                                                \n"
+"CONECT   15    8                                                                \n"
+"CONECT    8   19                                                                \n"
+"CONECT   19    8                                                                \n"
+"CONECT   13   20                                                                \n"
+"CONECT   20   13                                                                \n"
+"CONECT   13   21                                                                \n"
+"CONECT   21   13                                                                \n"
+"CONECT   14   22                                                                \n"
+"CONECT   22   14                                                                \n"
+"CONECT   14   23                                                                \n"
+"CONECT   23   14                                                                \n"
+"CONECT   23   24                                                                \n"
+"CONECT   24   23                                                                \n"
+"CONECT   23   25                                                                \n"
+"CONECT   25   23                                                                \n"
+"CONECT   23   26                                                                \n"
+"CONECT   26   23                                                                \n"
+"CONECT   21   27                                                                \n"
+"CONECT   27   21                                                                \n"
+"CONECT   21   28                                                                \n"
+"CONECT   28   21                                                                \n"
+"CONECT   21   29                                                                \n"
+"CONECT   29   21                                                                \n"
+"MASTER        0    0    0    0    0    0    0    6   26    1   52    0\n"
+"END\n"
+,
+"HEADER    Morphine, an opiate\n"
+"COMPND    al3058\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.400   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.106   1.211   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.444   2.446  -0.039  1.00  0.00 \n"
+"HETATM    5  C           1       0.047   2.458   0.013  1.00  0.00 \n"
+"HETATM    6  C           1      -0.629   1.243   0.051  1.00  0.00 \n"
+"HETATM    7  C           1      -2.081   1.500  -0.228  1.00  0.00 \n"
+"HETATM    8  C           1      -2.727   0.342  -0.999  1.00  0.00 \n"
+"HETATM    9  C           1      -2.363  -0.953  -0.239  1.00  0.00 \n"
+"HETATM   10  C           1      -0.832  -1.231  -0.285  1.00  0.00 \n"
+"HETATM   11  C           1      -1.885   2.839  -0.975  1.00  0.00 \n"
+"HETATM   12  C           1      -2.772   1.631   1.137  1.00  0.00 \n"
+"HETATM   13  C           1      -2.525   0.318   1.912  1.00  0.00 \n"
+"HETATM   14  N           1      -2.930  -0.855   1.119  1.00  0.00 \n"
+"HETATM   15  C           1      -2.790  -2.096   1.899  1.00  0.00 \n"
+"HETATM   16  H           1      -3.810   0.470  -0.978  1.00  0.00 \n"
+"HETATM   17  C           1      -2.300   0.287  -2.447  1.00  0.00 \n"
+"HETATM   18  C           1      -2.022   1.415  -3.116  1.00  0.00 \n"
+"HETATM   19  C           1      -1.406   2.612  -2.428  1.00  0.00 \n"
+"HETATM   20  H           1      -2.795   3.439  -0.953  1.00  0.00 \n"
+"HETATM   21  O           1      -0.796   3.478  -0.328  1.00  0.00 \n"
+"HETATM   22  H           1      -1.616   3.510  -3.009  1.00  0.00 \n"
+"HETATM   23  O           1       0.011   2.407  -2.414  1.00  0.00 \n"
+"HETATM   24  O           1       2.143   3.606  -0.184  1.00  0.00 \n"
+"HETATM   25  H           1       1.942  -0.943  -0.066  1.00  0.00 \n"
+"HETATM   26  H           1       3.195   1.192  -0.045  1.00  0.00 \n"
+"HETATM   27  H           1      -2.861  -1.784  -0.739  1.00  0.00 \n"
+"HETATM   28  H           1      -0.580  -1.568  -1.291  1.00  0.00 \n"
+"HETATM   29  H           1      -0.568  -2.021   0.414  1.00  0.00 \n"
+"HETATM   30  H           1      -3.842   1.788   0.997  1.00  0.00 \n"
+"HETATM   31  H           1      -2.350   2.469   1.692  1.00  0.00 \n"
+"HETATM   32  H           1      -3.107   0.346   2.833  1.00  0.00 \n"
+"HETATM   33  H           1      -1.471   0.235   2.174  1.00  0.00 \n"
+"HETATM   34  H           1      -3.461  -2.058   2.757  1.00  0.00 \n"
+"HETATM   35  H           1      -1.767  -2.205   2.257  1.00  0.00 \n"
+"HETATM   36  H           1      -3.054  -2.955   1.282  1.00  0.00 \n"
+"HETATM   37  H           1      -2.529  -0.612  -3.019  1.00  0.00 \n"
+"HETATM   38  H           1      -1.956   1.362  -4.203  1.00  0.00 \n"
+"HETATM   39  H           1       0.343   2.320  -3.313  1.00  0.00 \n"
+"HETATM   40  H           1       2.435   3.917   0.680  1.00  0.00 \n"
+"CONECT    1    2    2    6   10\n"
+"CONECT    2    1    1    3   25\n"
+"CONECT    3    2    4    4   26\n"
+"CONECT    4    3    3    5   24\n"
+"CONECT    5    4    6    6   21\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6    8   11   12\n"
+"CONECT    8    7    9   16   17\n"
+"CONECT    9    8   10   14   27\n"
+"CONECT   10    1    9   28   29\n"
+"CONECT   11    7   19   20   21\n"
+"CONECT   12    7   13   30   31\n"
+"CONECT   13   12   14   32   33\n"
+"CONECT   14    9   13   15\n"
+"CONECT   15   14   34   35   36\n"
+"CONECT   16    8\n"
+"CONECT   17    8   18   18   37\n"
+"CONECT   18   17   17   19   38\n"
+"CONECT   19   11   18   22   23\n"
+"CONECT   20   11\n"
+"CONECT   21    5   11\n"
+"CONECT   22   19\n"
+"CONECT   23   19   39\n"
+"CONECT   24    4   40\n"
+"CONECT   25    2\n"
+"CONECT   26    3\n"
+"CONECT   27    9\n"
+"CONECT   28   10\n"
+"CONECT   29   10\n"
+"CONECT   30   12\n"
+"CONECT   31   12\n"
+"CONECT   32   13\n"
+"CONECT   33   13\n"
+"CONECT   34   15\n"
+"CONECT   35   15\n"
+"CONECT   36   15\n"
+"CONECT   37   17\n"
+"CONECT   38   18\n"
+"CONECT   39   23\n"
+"CONECT   40   24\n"
+"MASTER        0    0    0    0    0    0    0    0   40    0   40    0\n"
+"END\n"
+,
+"HEADER    Nicotine, an insecticide\n"
+"COMPND    nicotine\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.400   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.082   1.223   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.361   2.420  -0.060  1.00  0.00 \n"
+"HETATM    5  C           1      -0.037   2.388  -0.103  1.00  0.00 \n"
+"HETATM    6  N           1      -0.698   1.182  -0.064  1.00  0.00 \n"
+"HETATM    7  C           1       2.135  -1.320   0.103  1.00  0.00 \n"
+"HETATM    8  H           1      -0.543  -0.944   0.043  1.00  0.00 \n"
+"HETATM    9  H           1       3.168   1.256   0.062  1.00  0.00 \n"
+"HETATM   10  H           1       1.886   3.375  -0.067  1.00  0.00 \n"
+"HETATM   11  H           1      -0.604   3.318  -0.148  1.00  0.00 \n"
+"HETATM   12  H           1       2.087  -1.661   1.139  1.00  0.00 \n"
+"HETATM   13  N           1       1.561  -2.374  -0.749  1.00  0.00 \n"
+"HETATM   14  C           1       3.616  -1.255  -0.318  1.00  0.00 \n"
+"HETATM   15  C           1       3.943  -2.708  -0.713  1.00  0.00 \n"
+"HETATM   16  C           1       2.580  -3.434  -0.690  1.00  0.00 \n"
+"HETATM   17  C           1       1.359  -1.946  -2.144  1.00  0.00 \n"
+"HETATM   18  H           1       4.247  -0.910   0.502  1.00  0.00 \n"
+"HETATM   19  H           1       3.736  -0.608  -1.187  1.00  0.00 \n"
+"HETATM   20  H           1       4.627  -3.166   0.001  1.00  0.00 \n"
+"HETATM   21  H           1       4.371  -2.732  -1.715  1.00  0.00 \n"
+"HETATM   22  H           1       2.475  -3.968   0.255  1.00  0.00 \n"
+"HETATM   23  H           1       2.490  -4.135  -1.520  1.00  0.00 \n"
+"HETATM   24  H           1       2.299  -1.632  -2.594  1.00  0.00 \n"
+"HETATM   25  H           1       0.648  -1.122  -2.190  1.00  0.00 \n"
+"HETATM   26  H           1       0.956  -2.781  -2.717  1.00  0.00 \n"
+"CONECT    1    2    2    6    8\n"
+"CONECT    2    1    1    3    7\n"
+"CONECT    3    2    4    4    9\n"
+"CONECT    4    3    3    5   10\n"
+"CONECT    5    4    6    6   11\n"
+"CONECT    6    1    5    5\n"
+"CONECT    7    2   12   13   14\n"
+"CONECT    8    1\n"
+"CONECT    9    3\n"
+"CONECT   10    4\n"
+"CONECT   11    5\n"
+"CONECT   12    7\n"
+"CONECT   13    7   16   17\n"
+"CONECT   14    7   15   18   19\n"
+"CONECT   15   14   16   20   21\n"
+"CONECT   16   13   15   22   23\n"
+"CONECT   17   13   24   25   26\n"
+"CONECT   18   14\n"
+"CONECT   19   14\n"
+"CONECT   20   15\n"
+"CONECT   21   15\n"
+"CONECT   22   16\n"
+"CONECT   23   16\n"
+"CONECT   24   17\n"
+"CONECT   25   17\n"
+"CONECT   26   17\n"
+"MASTER        0    0    0    0    0    0    0    0   26    0   26    0\n"
+"END\n"
+,
+"HEADER    Procaine: Novocaine, a local anesthetic\n"
+"COMPND    al3080\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.399   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.099   1.211   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.398   2.422   0.001  1.00  0.00 \n"
+"HETATM    5  C           1      -0.001   2.421   0.002  1.00  0.00 \n"
+"HETATM    6  C           1      -0.702   1.211   0.002  1.00  0.00 \n"
+"HETATM    7  N           1      -2.104   1.210   0.003  1.00  0.00 \n"
+"HETATM    8  C           1       3.511   1.212   0.000  1.00  0.00 \n"
+"HETATM    9  O           1       4.107   2.255  -0.002  1.00  0.00 \n"
+"HETATM   10  O           1       4.172   0.056   0.011  1.00  0.00 \n"
+"HETATM   11  C           1       5.562   0.269   0.112  1.00  0.00 \n"
+"HETATM   12  C           1       6.275  -1.096   0.162  1.00  0.00 \n"
+"HETATM   13  H           1      -0.542  -0.946   0.000  1.00  0.00 \n"
+"HETATM   14  H           1       1.942  -0.945  -0.001  1.00  0.00 \n"
+"HETATM   15  H           1       1.940   3.368   0.001  1.00  0.00 \n"
+"HETATM   16  H           1      -0.544   3.367   0.004  1.00  0.00 \n"
+"HETATM   17  H           1      -2.613   0.334   0.002  1.00  0.00 \n"
+"HETATM   18  H           1       5.776   0.831   1.021  1.00  0.00 \n"
+"HETATM   19  H           1       5.912   0.827  -0.758  1.00  0.00 \n"
+"HETATM   20  H           1       5.949  -1.682  -0.697  1.00  0.00 \n"
+"HETATM   21  H           1       5.984  -1.614   1.076  1.00  0.00 \n"
+"HETATM   22  N           1       7.741  -0.935   0.107  1.00  0.00 \n"
+"HETATM   23  C           1       8.433  -2.206  -0.184  1.00  0.00 \n"
+"HETATM   24  C           1       8.171  -3.279   0.896  1.00  0.00 \n"
+"HETATM   25  C           1       8.301  -0.239   1.281  1.00  0.00 \n"
+"HETATM   26  C           1       8.683   1.204   0.891  1.00  0.00 \n"
+"HETATM   27  H           1      -2.613   2.087   0.004  1.00  0.00 \n"
+"HETATM   28  H           1       9.505  -2.021  -0.249  1.00  0.00 \n"
+"HETATM   29  H           1       8.091  -2.587  -1.146  1.00  0.00 \n"
+"HETATM   30  H           1       7.118  -3.559   0.896  1.00  0.00 \n"
+"HETATM   31  H           1       8.444  -2.898   1.879  1.00  0.00 \n"
+"HETATM   32  H           1       8.770  -4.162   0.675  1.00  0.00 \n"
+"HETATM   33  H           1       9.205  -0.743   1.624  1.00  0.00 \n"
+"HETATM   34  H           1       7.579  -0.223   2.098  1.00  0.00 \n"
+"HETATM   35  H           1       7.804   1.747   0.546  1.00  0.00 \n"
+"HETATM   36  H           1       9.424   1.176   0.092  1.00  0.00 \n"
+"HETATM   37  H           1       9.105   1.714   1.757  1.00  0.00 \n"
+"CONECT    1    2    2    6   13\n"
+"CONECT    2    1    1    3   14\n"
+"CONECT    3    2    4    4    8\n"
+"CONECT    4    3    3    5   15\n"
+"CONECT    5    4    6    6   16\n"
+"CONECT    6    1    5    5    7\n"
+"CONECT    7    6   17   27\n"
+"CONECT    8    3    9    9   10\n"
+"CONECT    9    8    8\n"
+"CONECT   10    8   11\n"
+"CONECT   11   10   12   18   19\n"
+"CONECT   12   11   20   21   22\n"
+"CONECT   13    1\n"
+"CONECT   14    2\n"
+"CONECT   15    4\n"
+"CONECT   16    5\n"
+"CONECT   17    7\n"
+"CONECT   18   11\n"
+"CONECT   19   11\n"
+"CONECT   20   12\n"
+"CONECT   21   12\n"
+"CONECT   22   12   23   25\n"
+"CONECT   23   22   24   28   29\n"
+"CONECT   24   23   30   31   32\n"
+"CONECT   25   22   26   33   34\n"
+"CONECT   26   25   35   36   37\n"
+"CONECT   27    7\n"
+"CONECT   28   23\n"
+"CONECT   29   23\n"
+"CONECT   30   24\n"
+"CONECT   31   24\n"
+"CONECT   32   24\n"
+"CONECT   33   25\n"
+"CONECT   34   25\n"
+"CONECT   35   26\n"
+"CONECT   36   26\n"
+"CONECT   37   26\n"
+"MASTER        0    0    0    0    0    0    0    0   37    0   37    0\n"
+"END\n"
+,
+"HEADER    Sucrose octaoleate: Olestra-like non-hydrolyzing fat\n"
+"COMPND    jb15oles\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Sep 20 16:26:54 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.543   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.023   1.465   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.448   2.115   1.276  1.00  0.00 \n"
+"HETATM    5  C           1      -0.094   1.986   1.258  1.00  0.00 \n"
+"HETATM    6  O           1      -0.446   0.620   1.189  1.00  0.00 \n"
+"HETATM    7  O           1      -0.682   2.630   0.148  1.00  0.00 \n"
+"HETATM    8  C           1      -0.713   4.011  -0.142  1.00  0.00 \n"
+"HETATM    9  C           1      -1.600   4.135  -1.401  1.00  0.00 \n"
+"HETATM   10  C           1      -1.324   4.924   0.946  1.00  0.00 \n"
+"HETATM   11  O           1       0.576   4.533  -0.389  1.00  0.00 \n"
+"HETATM   12  C           1       0.436   5.938  -0.395  1.00  0.00 \n"
+"HETATM   13  C           1      -0.617   6.269   0.681  1.00  0.00 \n"
+"HETATM   14  C           1       1.756   6.671  -0.084  1.00  0.00 \n"
+"HETATM   15  O           1       2.227   6.278   1.183  1.00  0.00 \n"
+"HETATM   16  O           1      -1.499   7.264   0.209  1.00  0.00 \n"
+"HETATM   17  O           1      -1.029   4.475   2.250  1.00  0.00 \n"
+"HETATM   18  O           1      -1.000   3.465  -2.486  1.00  0.00 \n"
+"HETATM   19  C           1      -0.514  -1.457  -0.089  1.00  0.00 \n"
+"HETATM   20  O           1      -1.922  -1.490   0.008  1.00  0.00 \n"
+"HETATM   21  O           1       2.044  -0.707  -1.115  1.00  0.00 \n"
+"HETATM   22  O           1       3.434   1.488  -0.024  1.00  0.00 \n"
+"HETATM   23  O           1       1.870   3.459   1.361  1.00  0.00 \n"
+"HETATM   24  C           1      -2.482  -2.432  -0.753  1.00  0.00 \n"
+"HETATM   25  O           1      -3.315  -2.099  -1.556  1.00  0.00 \n"
+"HETATM   26  C           1      -2.336  -3.895  -0.434  1.00  0.00 \n"
+"HETATM   27  C           1      -3.583  -4.668  -0.927  1.00  0.00 \n"
+"HETATM   28  C           1      -3.416  -6.194  -0.736  1.00  0.00 \n"
+"HETATM   29  C           1      -4.686  -6.939  -1.212  1.00  0.00 \n"
+"HETATM   30  C           1      -4.492  -8.472  -1.146  1.00  0.00 \n"
+"HETATM   31  C           1      -5.779  -9.194  -1.608  1.00  0.00 \n"
+"HETATM   32  C           1      -5.580 -10.727  -1.651  1.00  0.00 \n"
+"HETATM   33  C           1      -6.868 -11.389  -2.094  1.00  0.00 \n"
+"HETATM   34  C           1      -6.933 -12.683  -2.447  1.00  0.00 \n"
+"HETATM   35  C           1      -5.725 -13.593  -2.433  1.00  0.00 \n"
+"HETATM   36  C           1      -6.164 -15.030  -2.794  1.00  0.00 \n"
+"HETATM   37  C           1      -4.957 -15.993  -2.791  1.00  0.00 \n"
+"HETATM   38  C           1      -5.423 -17.419  -3.153  1.00  0.00 \n"
+"HETATM   39  C           1      -4.225 -18.393  -3.146  1.00  0.00 \n"
+"HETATM   40  C           1      -4.700 -19.818  -3.505  1.00  0.00 \n"
+"HETATM   41  C           1       3.344  -0.983  -0.999  1.00  0.00 \n"
+"HETATM   42  O           1       4.098  -0.665  -1.882  1.00  0.00 \n"
+"HETATM   43  C           1       3.844  -1.849   0.124  1.00  0.00 \n"
+"HETATM   44  C           1       5.081  -2.680  -0.284  1.00  0.00 \n"
+"HETATM   45  C           1       5.532  -3.506   0.946  1.00  0.00 \n"
+"HETATM   46  C           1       6.768  -4.378   0.668  1.00  0.00 \n"
+"HETATM   47  C           1       7.108  -5.157   1.969  1.00  0.00 \n"
+"HETATM   48  C           1       8.283  -6.109   1.808  1.00  0.00 \n"
+"HETATM   49  C           1       8.489  -6.845   3.177  1.00  0.00 \n"
+"HETATM   50  C           1       9.603  -7.867   3.101  1.00  0.00 \n"
+"HETATM   51  C           1       9.838  -8.686   4.139  1.00  0.00 \n"
+"HETATM   52  C           1       8.989  -8.622   5.392  1.00  0.00 \n"
+"HETATM   53  C           1       9.509  -9.601   6.463  1.00  0.00 \n"
+"HETATM   54  C           1       8.612  -9.509   7.718  1.00  0.00 \n"
+"HETATM   55  C           1       9.090 -10.491   8.808  1.00  0.00 \n"
+"HETATM   56  C           1       8.155 -10.395  10.033  1.00  0.00 \n"
+"HETATM   57  C           1       8.599 -11.385  11.130  1.00  0.00 \n"
+"HETATM   58  C           1       3.954   2.643   0.391  1.00  0.00 \n"
+"HETATM   59  O           1       4.364   2.722   1.520  1.00  0.00 \n"
+"HETATM   60  C           1       3.833   3.903  -0.422  1.00  0.00 \n"
+"HETATM   61  C           1       5.113   4.138  -1.254  1.00  0.00 \n"
+"HETATM   62  C           1       5.001   5.470  -2.030  1.00  0.00 \n"
+"HETATM   63  C           1       6.274   5.721  -2.868  1.00  0.00 \n"
+"HETATM   64  C           1       6.142   7.042  -3.658  1.00  0.00 \n"
+"HETATM   65  C           1       7.424   7.302  -4.480  1.00  0.00 \n"
+"HETATM   66  C           1       7.292   8.604  -5.302  1.00  0.00 \n"
+"HETATM   67  C           1       8.567   8.842  -6.080  1.00  0.00 \n"
+"HETATM   68  C           1       8.673   9.819  -6.994  1.00  0.00 \n"
+"HETATM   69  C           1       7.518  10.739  -7.321  1.00  0.00 \n"
+"HETATM   70  C           1       7.962  11.764  -8.388  1.00  0.00 \n"
+"HETATM   71  C           1       6.793  12.704  -8.749  1.00  0.00 \n"
+"HETATM   72  C           1       7.240  13.712  -9.829  1.00  0.00 \n"
+"HETATM   73  C           1       6.069  14.649 -10.192  1.00  0.00 \n"
+"HETATM   74  C           1       6.510  15.654 -11.277  1.00  0.00 \n"
+"HETATM   75  C           1       1.563   4.034   2.524  1.00  0.00 \n"
+"HETATM   76  O           1       0.994   5.094   2.507  1.00  0.00 \n"
+"HETATM   77  C           1       2.204   3.624   3.820  1.00  0.00 \n"
+"HETATM   78  C           1       1.081   3.461   4.864  1.00  0.00 \n"
+"HETATM   79  C           1       1.646   2.985   6.219  1.00  0.00 \n"
+"HETATM   80  C           1       0.495   2.893   7.242  1.00  0.00 \n"
+"HETATM   81  C           1       0.991   2.293   8.574  1.00  0.00 \n"
+"HETATM   82  C           1      -0.180   2.239   9.577  1.00  0.00 \n"
+"HETATM   83  C           1       0.252   1.529  10.878  1.00  0.00 \n"
+"HETATM   84  C           1      -0.909   1.516  11.848  1.00  0.00 \n"
+"HETATM   85  C           1      -1.007   0.609  12.832  1.00  0.00 \n"
+"HETATM   86  C           1       0.023  -0.485  13.013  1.00  0.00 \n"
+"HETATM   87  C           1      -0.255  -1.246  14.326  1.00  0.00 \n"
+"HETATM   88  C           1       0.758  -2.396  14.494  1.00  0.00 \n"
+"HETATM   89  C           1       0.465  -3.168  15.798  1.00  0.00 \n"
+"HETATM   90  C           1       1.443  -4.352  15.937  1.00  0.00 \n"
+"HETATM   91  C           1       1.138  -5.136  17.229  1.00  0.00 \n"
+"HETATM   92  C           1      -1.640   3.717  -3.628  1.00  0.00 \n"
+"HETATM   93  O           1      -1.012   4.078  -4.590  1.00  0.00 \n"
+"HETATM   94  C           1      -3.121   3.488  -3.752  1.00  0.00 \n"
+"HETATM   95  C           1      -3.553   3.549  -5.232  1.00  0.00 \n"
+"HETATM   96  C           1      -5.083   3.368  -5.331  1.00  0.00 \n"
+"HETATM   97  C           1      -5.545   3.449  -6.801  1.00  0.00 \n"
+"HETATM   98  C           1      -7.080   3.295  -6.870  1.00  0.00 \n"
+"HETATM   99  C           1      -7.563   3.372  -8.334  1.00  0.00 \n"
+"HETATM  100  C           1      -9.099   3.230  -8.385  1.00  0.00 \n"
+"HETATM  101  C           1      -9.579   3.302  -9.818  1.00  0.00 \n"
+"HETATM  102  C           1     -10.886   3.239 -10.119  1.00  0.00 \n"
+"HETATM  103  C           1     -11.934   3.095  -9.037  1.00  0.00 \n"
+"HETATM  104  C           1     -13.340   3.036  -9.669  1.00  0.00 \n"
+"HETATM  105  C           1     -14.403   2.883  -8.561  1.00  0.00 \n"
+"HETATM  106  C           1     -15.815   2.830  -9.181  1.00  0.00 \n"
+"HETATM  107  C           1     -16.867   2.668  -8.064  1.00  0.00 \n"
+"HETATM  108  C           1     -18.283   2.619  -8.671  1.00  0.00 \n"
+"HETATM  109  C           1      -2.001   7.975   1.218  1.00  0.00 \n"
+"HETATM  110  O           1      -3.001   7.595   1.768  1.00  0.00 \n"
+"HETATM  111  C           1      -1.156   9.034   1.872  1.00  0.00 \n"
+"HETATM  112  C           1      -1.534  10.432   1.344  1.00  0.00 \n"
+"HETATM  113  C           1      -0.625  11.493   2.001  1.00  0.00 \n"
+"HETATM  114  C           1      -0.976  12.902   1.479  1.00  0.00 \n"
+"HETATM  115  C           1      -0.062  13.955   2.143  1.00  0.00 \n"
+"HETATM  116  C           1      -0.432  15.365   1.636  1.00  0.00 \n"
+"HETATM  117  C           1       0.472  16.432   2.289  1.00  0.00 \n"
+"HETATM  118  C           1       0.070  17.801   1.786  1.00  0.00 \n"
+"HETATM  119  C           1       0.739  18.910   2.133  1.00  0.00 \n"
+"HETATM  120  C           1       1.947  18.864   3.043  1.00  0.00 \n"
+"HETATM  121  C           1       2.466  20.301   3.261  1.00  0.00 \n"
+"HETATM  122  C           1       3.707  20.302   4.178  1.00  0.00 \n"
+"HETATM  123  C           1       4.204  21.750   4.364  1.00  0.00 \n"
+"HETATM  124  C           1       5.448  21.780   5.275  1.00  0.00 \n"
+"HETATM  125  C           1       5.933  23.236   5.440  1.00  0.00 \n"
+"HETATM  126  C           1      -1.676   5.203   3.160  1.00  0.00 \n"
+"HETATM  127  O           1      -1.395   6.362   3.326  1.00  0.00 \n"
+"HETATM  128  C           1      -2.722   4.564   4.031  1.00  0.00 \n"
+"HETATM  129  C           1      -3.529   5.657   4.765  1.00  0.00 \n"
+"HETATM  130  C           1      -4.616   5.007   5.648  1.00  0.00 \n"
+"HETATM  131  C           1      -5.417   6.088   6.405  1.00  0.00 \n"
+"HETATM  132  C           1      -6.505   5.421   7.274  1.00  0.00 \n"
+"HETATM  133  C           1      -7.276   6.485   8.085  1.00  0.00 \n"
+"HETATM  134  C           1      -8.342   5.803   8.967  1.00  0.00 \n"
+"HETATM  135  C           1      -8.999   6.835   9.859  1.00  0.00 \n"
+"HETATM  136  C           1     -10.265   7.250   9.698  1.00  0.00 \n"
+"HETATM  137  C           1     -11.161   6.729   8.595  1.00  0.00 \n"
+"HETATM  138  C           1     -12.519   7.460   8.650  1.00  0.00 \n"
+"HETATM  139  C           1     -13.450   6.941   7.534  1.00  0.00 \n"
+"HETATM  140  C           1     -14.810   7.665   7.610  1.00  0.00 \n"
+"HETATM  141  C           1     -15.745   7.150   6.496  1.00  0.00 \n"
+"HETATM  142  C           1     -17.110   7.866   6.583  1.00  0.00 \n"
+"HETATM  143  C           1       2.842   7.281   1.802  1.00  0.00 \n"
+"HETATM  144  O           1       2.205   8.253   2.118  1.00  0.00 \n"
+"HETATM  145  C           1       4.220   7.092   2.370  1.00  0.00 \n"
+"HETATM  146  C           1       4.473   8.156   3.459  1.00  0.00 \n"
+"HETATM  147  C           1       5.893   8.017   4.051  1.00  0.00 \n"
+"HETATM  148  C           1       6.113   9.105   5.125  1.00  0.00 \n"
+"HETATM  149  C           1       7.536   9.013   5.717  1.00  0.00 \n"
+"HETATM  150  C           1       7.731  10.123   6.772  1.00  0.00 \n"
+"HETATM  151  C           1       9.153  10.065   7.368  1.00  0.00 \n"
+"HETATM  152  C           1       9.319  11.173   8.385  1.00  0.00 \n"
+"HETATM  153  C           1      10.461  11.337   9.067  1.00  0.00 \n"
+"HETATM  154  C           1      11.643  10.413   8.868  1.00  0.00 \n"
+"HETATM  155  C           1      12.819  10.884   9.749  1.00  0.00 \n"
+"HETATM  156  C           1      14.028   9.942   9.572  1.00  0.00 \n"
+"HETATM  157  C           1      15.194  10.418  10.464  1.00  0.00 \n"
+"HETATM  158  C           1      16.397   9.465  10.312  1.00  0.00 \n"
+"HETATM  159  C           1      17.555   9.936  11.217  1.00  0.00 \n"
+"HETATM  160  C           1      18.753   8.973  11.081  1.00  0.00 \n"
+"HETATM  161  C           1      19.907   9.437  11.992  1.00  0.00 \n"
+"HETATM  162  C           1       7.637 -11.294  12.332  1.00  0.00 \n"
+"HETATM  163  C           1       8.066 -12.287  13.432  1.00  0.00 \n"
+"HETATM  164  C           1      -3.503 -20.792  -3.494  1.00  0.00 \n"
+"HETATM  165  C           1      -3.976 -22.215  -3.853  1.00  0.00 \n"
+"HETATM  166  C           1       2.094  -6.341  17.349  1.00  0.00 \n"
+"HETATM  167  C           1       1.786  -7.131  18.637  1.00  0.00 \n"
+"HETATM  168  C           1       5.336  16.589 -11.634  1.00  0.00 \n"
+"HETATM  169  C           1       5.771  17.593 -12.721  1.00  0.00 \n"
+"HETATM  170  C           1       7.177  23.279   6.350  1.00  0.00 \n"
+"HETATM  171  C           1       7.661  24.734   6.509  1.00  0.00 \n"
+"HETATM  172  C           1     -19.327   2.450  -7.548  1.00  0.00 \n"
+"HETATM  173  C           1     -20.747   2.406  -8.149  1.00  0.00 \n"
+"HETATM  174  C           1     -18.044   7.350   5.470  1.00  0.00 \n"
+"HETATM  175  C           1     -19.412   8.057   5.560  1.00  0.00 \n"
+"HETATM  176  H           1      -0.368   0.553  -0.864  1.00  0.00 \n"
+"HETATM  177  H           1       1.874  -0.482   0.920  1.00  0.00 \n"
+"HETATM  178  H           1       1.632   1.978  -0.879  1.00  0.00 \n"
+"HETATM  179  H           1       1.826   1.557   2.131  1.00  0.00 \n"
+"HETATM  180  H           1      -0.503   2.395   2.180  1.00  0.00 \n"
+"HETATM  181  H           1      -1.766   5.183  -1.654  1.00  0.00 \n"
+"HETATM  182  H           1      -2.562   3.672  -1.182  1.00  0.00 \n"
+"HETATM  183  H           1      -2.404   5.015   0.817  1.00  0.00 \n"
+"HETATM  184  H           1       0.079   6.263  -1.372  1.00  0.00 \n"
+"HETATM  185  H           1      -0.107   6.607   1.580  1.00  0.00 \n"
+"HETATM  186  H           1       1.568   7.745  -0.111  1.00  0.00 \n"
+"HETATM  187  H           1       2.495   6.425  -0.844  1.00  0.00 \n"
+"HETATM  188  H           1      -0.089  -2.043   0.726  1.00  0.00 \n"
+"HETATM  189  H           1      -0.191  -1.883  -1.040  1.00  0.00 \n"
+"HETATM  190  H           1      -2.226  -4.025   0.643  1.00  0.00 \n"
+"HETATM  191  H           1      -1.448  -4.280  -0.936  1.00  0.00 \n"
+"HETATM  192  H           1      -3.732  -4.461  -1.987  1.00  0.00 \n"
+"HETATM  193  H           1      -4.457  -4.327  -0.372  1.00  0.00 \n"
+"HETATM  194  H           1      -3.242  -6.413   0.317  1.00  0.00 \n"
+"HETATM  195  H           1      -2.560  -6.535  -1.319  1.00  0.00 \n"
+"HETATM  196  H           1      -4.902  -6.654  -2.241  1.00  0.00 \n"
+"HETATM  197  H           1      -5.527  -6.653  -0.579  1.00  0.00 \n"
+"HETATM  198  H           1      -4.259  -8.767  -0.123  1.00  0.00 \n"
+"HETATM  199  H           1      -3.666  -8.756  -1.799  1.00  0.00 \n"
+"HETATM  200  H           1      -6.047  -8.844  -2.605  1.00  0.00 \n"
+"HETATM  201  H           1      -6.588  -8.955  -0.918  1.00  0.00 \n"
+"HETATM  202  H           1      -5.310 -11.089  -0.659  1.00  0.00 \n"
+"HETATM  203  H           1      -4.783 -10.967  -2.355  1.00  0.00 \n"
+"HETATM  204  H           1      -7.781 -10.795  -2.125  1.00  0.00 \n"
+"HETATM  205  H           1      -7.896 -13.091  -2.754  1.00  0.00 \n"
+"HETATM  206  H           1      -5.275 -13.588  -1.440  1.00  0.00 \n"
+"HETATM  207  H           1      -4.997 -13.243  -3.164  1.00  0.00 \n"
+"HETATM  208  H           1      -6.618 -15.028  -3.785  1.00  0.00 \n"
+"HETATM  209  H           1      -6.898 -15.374  -2.065  1.00  0.00 \n"
+"HETATM  210  H           1      -4.502 -16.000  -1.801  1.00  0.00 \n"
+"HETATM  211  H           1      -4.222 -15.655  -3.522  1.00  0.00 \n"
+"HETATM  212  H           1      -5.875 -17.411  -4.145  1.00  0.00 \n"
+"HETATM  213  H           1      -6.163 -17.753  -2.425  1.00  0.00 \n"
+"HETATM  214  H           1      -3.773 -18.402  -2.155  1.00  0.00 \n"
+"HETATM  215  H           1      -3.486 -18.063  -3.876  1.00  0.00 \n"
+"HETATM  216  H           1      -5.150 -19.810  -4.498  1.00  0.00 \n"
+"HETATM  217  H           1      -5.441 -20.147  -2.777  1.00  0.00 \n"
+"HETATM  218  H           1       3.046  -2.532   0.416  1.00  0.00 \n"
+"HETATM  219  H           1       4.102  -1.216   0.975  1.00  0.00 \n"
+"HETATM  220  H           1       5.884  -2.006  -0.580  1.00  0.00 \n"
+"HETATM  221  H           1       4.829  -3.337  -1.117  1.00  0.00 \n"
+"HETATM  222  H           1       4.717  -4.156   1.264  1.00  0.00 \n"
+"HETATM  223  H           1       5.773  -2.820   1.759  1.00  0.00 \n"
+"HETATM  224  H           1       7.605  -3.757   0.345  1.00  0.00 \n"
+"HETATM  225  H           1       6.511  -5.083  -0.123  1.00  0.00 \n"
+"HETATM  226  H           1       6.244  -5.737   2.294  1.00  0.00 \n"
+"HETATM  227  H           1       7.378  -4.451   2.755  1.00  0.00 \n"
+"HETATM  228  H           1       9.158  -5.517   1.539  1.00  0.00 \n"
+"HETATM  229  H           1       8.056  -6.812   1.007  1.00  0.00 \n"
+"HETATM  230  H           1       7.572  -7.372   3.439  1.00  0.00 \n"
+"HETATM  231  H           1       8.718  -6.129   3.967  1.00  0.00 \n"
+"HETATM  232  H           1      10.222  -7.926   2.206  1.00  0.00 \n"
+"HETATM  233  H           1      10.647  -9.413   4.074  1.00  0.00 \n"
+"HETATM  234  H           1       7.960  -8.886   5.148  1.00  0.00 \n"
+"HETATM  235  H           1       9.015  -7.611   5.799  1.00  0.00 \n"
+"HETATM  236  H           1      10.534  -9.341   6.725  1.00  0.00 \n"
+"HETATM  237  H           1       9.481 -10.616   6.068  1.00  0.00 \n"
+"HETATM  238  H           1       7.586  -9.753   7.443  1.00  0.00 \n"
+"HETATM  239  H           1       8.644  -8.493   8.111  1.00  0.00 \n"
+"HETATM  240  H           1      10.108 -10.239   9.105  1.00  0.00 \n"
+"HETATM  241  H           1       9.070 -11.507   8.415  1.00  0.00 \n"
+"HETATM  242  H           1       7.136 -10.633   9.726  1.00  0.00 \n"
+"HETATM  243  H           1       8.182  -9.380  10.429  1.00  0.00 \n"
+"HETATM  244  H           1       9.611 -11.139  11.453  1.00  0.00 \n"
+"HETATM  245  H           1       8.585 -12.399  10.730  1.00  0.00 \n"
+"HETATM  246  H           1       3.697   4.738   0.262  1.00  0.00 \n"
+"HETATM  247  H           1       2.973   3.837  -1.086  1.00  0.00 \n"
+"HETATM  248  H           1       5.244   3.316  -1.956  1.00  0.00 \n"
+"HETATM  249  H           1       5.973   4.181  -0.585  1.00  0.00 \n"
+"HETATM  250  H           1       4.873   6.289  -1.322  1.00  0.00 \n"
+"HETATM  251  H           1       4.136   5.428  -2.692  1.00  0.00 \n"
+"HETATM  252  H           1       6.415   4.896  -3.567  1.00  0.00 \n"
+"HETATM  253  H           1       7.137   5.781  -2.205  1.00  0.00 \n"
+"HETATM  254  H           1       5.987   7.867  -2.962  1.00  0.00 \n"
+"HETATM  255  H           1       5.288   6.976  -4.332  1.00  0.00 \n"
+"HETATM  256  H           1       7.592   6.466  -5.158  1.00  0.00 \n"
+"HETATM  257  H           1       8.273   7.389  -3.801  1.00  0.00 \n"
+"HETATM  258  H           1       7.117   9.443  -4.629  1.00  0.00 \n"
+"HETATM  259  H           1       6.453   8.510  -5.991  1.00  0.00 \n"
+"HETATM  260  H           1       9.432   8.207  -5.887  1.00  0.00 \n"
+"HETATM  261  H           1       9.620   9.946  -7.519  1.00  0.00 \n"
+"HETATM  262  H           1       7.205  11.266  -6.419  1.00  0.00 \n"
+"HETATM  263  H           1       6.685  10.153  -7.709  1.00  0.00 \n"
+"HETATM  264  H           1       8.285  11.232  -9.283  1.00  0.00 \n"
+"HETATM  265  H           1       8.793  12.353  -8.000  1.00  0.00 \n"
+"HETATM  266  H           1       6.474  13.244  -7.858  1.00  0.00 \n"
+"HETATM  267  H           1       5.958  12.114  -9.129  1.00  0.00 \n"
+"HETATM  268  H           1       7.559  13.171 -10.720  1.00  0.00 \n"
+"HETATM  269  H           1       8.073  14.304  -9.450  1.00  0.00 \n"
+"HETATM  270  H           1       5.753  15.194  -9.302  1.00  0.00 \n"
+"HETATM  271  H           1       5.234  14.057 -10.566  1.00  0.00 \n"
+"HETATM  272  H           1       6.824  15.110 -12.168  1.00  0.00 \n"
+"HETATM  273  H           1       7.346  16.246 -10.905  1.00  0.00 \n"
+"HETATM  274  H           1       2.891   4.405   4.144  1.00  0.00 \n"
+"HETATM  275  H           1       2.753   2.690   3.706  1.00  0.00 \n"
+"HETATM  276  H           1       0.360   2.729   4.502  1.00  0.00 \n"
+"HETATM  277  H           1       0.578   4.420   4.999  1.00  0.00 \n"
+"HETATM  278  H           1       2.396   3.692   6.575  1.00  0.00 \n"
+"HETATM  279  H           1       2.104   2.004   6.094  1.00  0.00 \n"
+"HETATM  280  H           1      -0.293   2.257   6.838  1.00  0.00 \n"
+"HETATM  281  H           1       0.092   3.890   7.420  1.00  0.00 \n"
+"HETATM  282  H           1       1.792   2.910   8.980  1.00  0.00 \n"
+"HETATM  283  H           1       1.366   1.285   8.397  1.00  0.00 \n"
+"HETATM  284  H           1      -1.010   1.689   9.134  1.00  0.00 \n"
+"HETATM  285  H           1      -0.503   3.254   9.807  1.00  0.00 \n"
+"HETATM  286  H           1       1.090   2.062  11.326  1.00  0.00 \n"
+"HETATM  287  H           1       0.555   0.509  10.641  1.00  0.00 \n"
+"HETATM  288  H           1      -1.682   2.279  11.759  1.00  0.00 \n"
+"HETATM  289  H           1      -1.860   0.654  13.508  1.00  0.00 \n"
+"HETATM  290  H           1       1.020  -0.047  13.053  1.00  0.00 \n"
+"HETATM  291  H           1      -0.037  -1.180  12.176  1.00  0.00 \n"
+"HETATM  292  H           1      -1.264  -1.658  14.297  1.00  0.00 \n"
+"HETATM  293  H           1      -0.170  -0.560  15.169  1.00  0.00 \n"
+"HETATM  294  H           1       1.769  -1.990  14.531  1.00  0.00 \n"
+"HETATM  295  H           1       0.675  -3.076  13.646  1.00  0.00 \n"
+"HETATM  296  H           1      -0.557  -3.546  15.772  1.00  0.00 \n"
+"HETATM  297  H           1       0.580  -2.498  16.650  1.00  0.00 \n"
+"HETATM  298  H           1       2.466  -3.977  15.971  1.00  0.00 \n"
+"HETATM  299  H           1       1.331  -5.015  15.078  1.00  0.00 \n"
+"HETATM  300  H           1       0.108  -5.493  17.202  1.00  0.00 \n"
+"HETATM  301  H           1       1.269  -4.481  18.090  1.00  0.00 \n"
+"HETATM  302  H           1      -3.652   4.262  -3.197  1.00  0.00 \n"
+"HETATM  303  H           1      -3.371   2.511  -3.339  1.00  0.00 \n"
+"HETATM  304  H           1      -3.052   2.758  -5.791  1.00  0.00 \n"
+"HETATM  305  H           1      -3.275   4.517  -5.650  1.00  0.00 \n"
+"HETATM  306  H           1      -5.575   4.153  -4.757  1.00  0.00 \n"
+"HETATM  307  H           1      -5.358   2.397  -4.919  1.00  0.00 \n"
+"HETATM  308  H           1      -5.072   2.653  -7.376  1.00  0.00 \n"
+"HETATM  309  H           1      -5.259   4.415  -7.219  1.00  0.00 \n"
+"HETATM  310  H           1      -7.548   4.093  -6.294  1.00  0.00 \n"
+"HETATM  311  H           1      -7.365   2.332  -6.447  1.00  0.00 \n"
+"HETATM  312  H           1      -7.105   2.569  -8.910  1.00  0.00 \n"
+"HETATM  313  H           1      -7.275   4.333  -8.761  1.00  0.00 \n"
+"HETATM  314  H           1      -9.553   4.035  -7.808  1.00  0.00 \n"
+"HETATM  315  H           1      -9.385   2.270  -7.955  1.00  0.00 \n"
+"HETATM  316  H           1      -8.852   3.405 -10.623  1.00  0.00 \n"
+"HETATM  317  H           1     -11.195   3.293 -11.162  1.00  0.00 \n"
+"HETATM  318  H           1     -11.879   3.949  -8.362  1.00  0.00 \n"
+"HETATM  319  H           1     -11.753   2.177  -8.477  1.00  0.00 \n"
+"HETATM  320  H           1     -13.398   2.184 -10.347  1.00  0.00 \n"
+"HETATM  321  H           1     -13.526   3.954 -10.227  1.00  0.00 \n"
+"HETATM  322  H           1     -14.340   3.732  -7.880  1.00  0.00 \n"
+"HETATM  323  H           1     -14.217   1.964  -8.007  1.00  0.00 \n"
+"HETATM  324  H           1     -15.880   1.984  -9.865  1.00  0.00 \n"
+"HETATM  325  H           1     -16.006   3.752  -9.729  1.00  0.00 \n"
+"HETATM  326  H           1     -16.797   3.511  -7.377  1.00  0.00 \n"
+"HETATM  327  H           1     -16.675   1.743  -7.519  1.00  0.00 \n"
+"HETATM  328  H           1     -18.353   1.777  -9.361  1.00  0.00 \n"
+"HETATM  329  H           1     -18.478   3.545  -9.212  1.00  0.00 \n"
+"HETATM  330  H           1      -0.105   8.848   1.652  1.00  0.00 \n"
+"HETATM  331  H           1      -1.308   8.997   2.950  1.00  0.00 \n"
+"HETATM  332  H           1      -2.576  10.642   1.584  1.00  0.00 \n"
+"HETATM  333  H           1      -1.400  10.458   0.262  1.00  0.00 \n"
+"HETATM  334  H           1       0.416  11.272   1.765  1.00  0.00 \n"
+"HETATM  335  H           1      -0.761  11.465   3.082  1.00  0.00 \n"
+"HETATM  336  H           1      -2.016  13.126   1.716  1.00  0.00 \n"
+"HETATM  337  H           1      -0.839  12.933   0.398  1.00  0.00 \n"
+"HETATM  338  H           1       0.978  13.741   1.894  1.00  0.00 \n"
+"HETATM  339  H           1      -0.189  13.915   3.224  1.00  0.00 \n"
+"HETATM  340  H           1      -1.473  15.574   1.885  1.00  0.00 \n"
+"HETATM  341  H           1      -0.309  15.403   0.553  1.00  0.00 \n"
+"HETATM  342  H           1       1.512  16.236   2.027  1.00  0.00 \n"
+"HETATM  343  H           1       0.356  16.395   3.372  1.00  0.00 \n"
+"HETATM  344  H           1      -0.793  17.892   1.125  1.00  0.00 \n"
+"HETATM  345  H           1       0.403  19.871   1.743  1.00  0.00 \n"
+"HETATM  346  H           1       2.729  18.261   2.583  1.00  0.00 \n"
+"HETATM  347  H           1       1.666  18.429   4.003  1.00  0.00 \n"
+"HETATM  348  H           1       1.680  20.901   3.718  1.00  0.00 \n"
+"HETATM  349  H           1       2.733  20.734   2.297  1.00  0.00 \n"
+"HETATM  350  H           1       4.496  19.701   3.725  1.00  0.00 \n"
+"HETATM  351  H           1       3.443  19.879   5.148  1.00  0.00 \n"
+"HETATM  352  H           1       3.412  22.349   4.815  1.00  0.00 \n"
+"HETATM  353  H           1       4.461  22.170   3.391  1.00  0.00 \n"
+"HETATM  354  H           1       6.241  21.182   4.827  1.00  0.00 \n"
+"HETATM  355  H           1       5.192  21.369   6.251  1.00  0.00 \n"
+"HETATM  356  H           1       5.138  23.834   5.886  1.00  0.00 \n"
+"HETATM  357  H           1       6.186  23.646   4.463  1.00  0.00 \n"
+"HETATM  358  H           1      -2.234   3.917   4.760  1.00  0.00 \n"
+"HETATM  359  H           1      -3.391   3.970   3.410  1.00  0.00 \n"
+"HETATM  360  H           1      -3.999   6.312   4.032  1.00  0.00 \n"
+"HETATM  361  H           1      -2.855   6.243   5.391  1.00  0.00 \n"
+"HETATM  362  H           1      -4.143   4.340   6.369  1.00  0.00 \n"
+"HETATM  363  H           1      -5.294   4.431   5.018  1.00  0.00 \n"
+"HETATM  364  H           1      -5.887   6.762   5.689  1.00  0.00 \n"
+"HETATM  365  H           1      -4.741   6.657   7.044  1.00  0.00 \n"
+"HETATM  366  H           1      -6.034   4.719   7.961  1.00  0.00 \n"
+"HETATM  367  H           1      -7.201   4.881   6.631  1.00  0.00 \n"
+"HETATM  368  H           1      -7.762   7.185   7.405  1.00  0.00 \n"
+"HETATM  369  H           1      -6.577   7.027   8.721  1.00  0.00 \n"
+"HETATM  370  H           1      -7.858   5.057   9.599  1.00  0.00 \n"
+"HETATM  371  H           1      -9.075   5.305   8.334  1.00  0.00 \n"
+"HETATM  372  H           1      -8.416   7.259  10.676  1.00  0.00 \n"
+"HETATM  373  H           1     -10.661   7.994  10.389  1.00  0.00 \n"
+"HETATM  374  H           1     -11.324   5.660   8.731  1.00  0.00 \n"
+"HETATM  375  H           1     -10.692   6.909   7.628  1.00  0.00 \n"
+"HETATM  376  H           1     -12.360   8.530   8.520  1.00  0.00 \n"
+"HETATM  377  H           1     -12.985   7.281   9.620  1.00  0.00 \n"
+"HETATM  378  H           1     -13.603   5.869   7.659  1.00  0.00 \n"
+"HETATM  379  H           1     -12.992   7.129   6.563  1.00  0.00 \n"
+"HETATM  380  H           1     -14.657   8.738   7.488  1.00  0.00 \n"
+"HETATM  381  H           1     -15.267   7.476   8.582  1.00  0.00 \n"
+"HETATM  382  H           1     -15.891   6.077   6.614  1.00  0.00 \n"
+"HETATM  383  H           1     -15.293   7.348   5.524  1.00  0.00 \n"
+"HETATM  384  H           1     -16.964   8.939   6.466  1.00  0.00 \n"
+"HETATM  385  H           1     -17.561   7.667   7.556  1.00  0.00 \n"
+"HETATM  386  H           1       4.947   7.200   1.566  1.00  0.00 \n"
+"HETATM  387  H           1       4.294   6.092   2.798  1.00  0.00 \n"
+"HETATM  388  H           1       3.737   8.034   4.255  1.00  0.00 \n"
+"HETATM  389  H           1       4.363   9.148   3.021  1.00  0.00 \n"
+"HETATM  390  H           1       6.629   8.137   3.256  1.00  0.00 \n"
+"HETATM  391  H           1       6.005   7.031   4.501  1.00  0.00 \n"
+"HETATM  392  H           1       5.382   8.976   5.924  1.00  0.00 \n"
+"HETATM  393  H           1       5.977  10.088   4.673  1.00  0.00 \n"
+"HETATM  394  H           1       8.269   9.137   4.920  1.00  0.00 \n"
+"HETATM  395  H           1       7.673   8.038   6.185  1.00  0.00 \n"
+"HETATM  396  H           1       7.001   9.993   7.571  1.00  0.00 \n"
+"HETATM  397  H           1       7.579  11.095   6.302  1.00  0.00 \n"
+"HETATM  398  H           1       9.884  10.192   6.570  1.00  0.00 \n"
+"HETATM  399  H           1       9.304   9.100   7.851  1.00  0.00 \n"
+"HETATM  400  H           1       8.493  11.861   8.565  1.00  0.00 \n"
+"HETATM  401  H           1      10.536  12.152   9.787  1.00  0.00 \n"
+"HETATM  402  H           1      11.947  10.429   7.821  1.00  0.00 \n"
+"HETATM  403  H           1      11.362   9.399   9.150  1.00  0.00 \n"
+"HETATM  404  H           1      12.509  10.880  10.795  1.00  0.00 \n"
+"HETATM  405  H           1      13.103  11.896   9.462  1.00  0.00 \n"
+"HETATM  406  H           1      14.343   9.946   8.529  1.00  0.00 \n"
+"HETATM  407  H           1      13.743   8.930   9.859  1.00  0.00 \n"
+"HETATM  408  H           1      14.872  10.428  11.505  1.00  0.00 \n"
+"HETATM  409  H           1      15.489  11.425  10.168  1.00  0.00 \n"
+"HETATM  410  H           1      16.727   9.459   9.273  1.00  0.00 \n"
+"HETATM  411  H           1      16.099   8.457  10.601  1.00  0.00 \n"
+"HETATM  412  H           1      17.219   9.951  12.254  1.00  0.00 \n"
+"HETATM  413  H           1      17.860  10.940  10.923  1.00  0.00 \n"
+"HETATM  414  H           1      19.093   8.960  10.046  1.00  0.00 \n"
+"HETATM  415  H           1      18.446   7.968  11.372  1.00  0.00 \n"
+"HETATM  416  H           1      19.573   9.448  13.030  1.00  0.00 \n"
+"HETATM  417  H           1      20.221  10.440  11.703  1.00  0.00 \n"
+"HETATM  418  H           1      20.748   8.752  11.891  1.00  0.00 \n"
+"HETATM  419  H           1       6.625 -11.535  12.006  1.00  0.00 \n"
+"HETATM  420  H           1       7.653 -10.282  12.735  1.00  0.00 \n"
+"HETATM  421  H           1       9.075 -12.048  13.767  1.00  0.00 \n"
+"HETATM  422  H           1       8.046 -13.303  13.036  1.00  0.00 \n"
+"HETATM  423  H           1       7.378 -12.215  14.274  1.00  0.00 \n"
+"HETATM  424  H           1      -2.762 -20.465  -4.223  1.00  0.00 \n"
+"HETATM  425  H           1      -3.052 -20.802  -2.502  1.00  0.00 \n"
+"HETATM  426  H           1      -4.423 -22.213  -4.847  1.00  0.00 \n"
+"HETATM  427  H           1      -4.714 -22.551  -3.124  1.00  0.00 \n"
+"HETATM  428  H           1      -3.123 -22.895  -3.842  1.00  0.00 \n"
+"HETATM  429  H           1       3.124  -5.987  17.380  1.00  0.00 \n"
+"HETATM  430  H           1       1.964  -6.995  16.486  1.00  0.00 \n"
+"HETATM  431  H           1       0.758  -7.491  18.610  1.00  0.00 \n"
+"HETATM  432  H           1       1.921  -6.484  19.504  1.00  0.00 \n"
+"HETATM  433  H           1       2.464  -7.981  18.713  1.00  0.00 \n"
+"HETATM  434  H           1       5.023  17.135 -10.744  1.00  0.00 \n"
+"HETATM  435  H           1       4.500  15.996 -12.005  1.00  0.00 \n"
+"HETATM  436  H           1       6.079  17.053 -13.616  1.00  0.00 \n"
+"HETATM  437  H           1       6.604  18.192 -12.354  1.00  0.00 \n"
+"HETATM  438  H           1       4.935  18.248 -12.965  1.00  0.00 \n"
+"HETATM  439  H           1       7.973  22.680   5.906  1.00  0.00 \n"
+"HETATM  440  H           1       6.926  22.873   7.330  1.00  0.00 \n"
+"HETATM  441  H           1       6.871  25.336   6.956  1.00  0.00 \n"
+"HETATM  442  H           1       7.919  25.143   5.532  1.00  0.00 \n"
+"HETATM  443  H           1       8.540  24.757   7.153  1.00  0.00 \n"
+"HETATM  444  H           1     -19.255   3.289  -6.856  1.00  0.00 \n"
+"HETATM  445  H           1     -19.135   1.523  -7.009  1.00  0.00 \n"
+"HETATM  446  H           1     -20.826   1.565  -8.838  1.00  0.00 \n"
+"HETATM  447  H           1     -20.947   3.334  -8.684  1.00  0.00 \n"
+"HETATM  448  H           1     -21.476   2.286  -7.348  1.00  0.00 \n"
+"HETATM  449  H           1     -18.187   6.275   5.583  1.00  0.00 \n"
+"HETATM  450  H           1     -17.597   7.553   4.497  1.00  0.00 \n"
+"HETATM  451  H           1     -19.276   9.132   5.443  1.00  0.00 \n"
+"HETATM  452  H           1     -19.866   7.853   6.529  1.00  0.00 \n"
+"HETATM  453  H           1     -20.065   7.687   4.770  1.00  0.00 \n"
+"CONECT    1    2    6   19  176\n"
+"CONECT    2    1    3   21  177\n"
+"CONECT    3    2    4   22  178\n"
+"CONECT    4    3    5   23  179\n"
+"CONECT    5    4    6    7  180\n"
+"CONECT    6    1    5\n"
+"CONECT    7    5    8\n"
+"CONECT    8    7    9   10   11\n"
+"CONECT    9    8   18  181  182\n"
+"CONECT   10    8   13   17  183\n"
+"CONECT   11    8   12\n"
+"CONECT   12   11   13   14  184\n"
+"CONECT   13   10   12   16  185\n"
+"CONECT   14   12   15  186  187\n"
+"CONECT   15   14  143\n"
+"CONECT   16   13  109\n"
+"CONECT   17   10  126\n"
+"CONECT   18    9   92\n"
+"CONECT   19    1   20  188  189\n"
+"CONECT   20   19   24\n"
+"CONECT   21    2   41\n"
+"CONECT   22    3   58\n"
+"CONECT   23    4   75\n"
+"CONECT   24   20   25   25   26\n"
+"CONECT   25   24   24\n"
+"CONECT   26   24   27  190  191\n"
+"CONECT   27   26   28  192  193\n"
+"CONECT   28   27   29  194  195\n"
+"CONECT   29   28   30  196  197\n"
+"CONECT   30   29   31  198  199\n"
+"CONECT   31   30   32  200  201\n"
+"CONECT   32   31   33  202  203\n"
+"CONECT   33   32   34   34  204\n"
+"CONECT   34   33   33   35  205\n"
+"CONECT   35   34   36  206  207\n"
+"CONECT   36   35   37  208  209\n"
+"CONECT   37   36   38  210  211\n"
+"CONECT   38   37   39  212  213\n"
+"CONECT   39   38   40  214  215\n"
+"CONECT   40   39  164  216  217\n"
+"CONECT   41   21   42   42   43\n"
+"CONECT   42   41   41\n"
+"CONECT   43   41   44  218  219\n"
+"CONECT   44   43   45  220  221\n"
+"CONECT   45   44   46  222  223\n"
+"CONECT   46   45   47  224  225\n"
+"CONECT   47   46   48  226  227\n"
+"CONECT   48   47   49  228  229\n"
+"CONECT   49   48   50  230  231\n"
+"CONECT   50   49   51   51  232\n"
+"CONECT   51   50   50   52  233\n"
+"CONECT   52   51   53  234  235\n"
+"CONECT   53   52   54  236  237\n"
+"CONECT   54   53   55  238  239\n"
+"CONECT   55   54   56  240  241\n"
+"CONECT   56   55   57  242  243\n"
+"CONECT   57   56  162  244  245\n"
+"CONECT   58   22   59   59   60\n"
+"CONECT   59   58   58\n"
+"CONECT   60   58   61  246  247\n"
+"CONECT   61   60   62  248  249\n"
+"CONECT   62   61   63  250  251\n"
+"CONECT   63   62   64  252  253\n"
+"CONECT   64   63   65  254  255\n"
+"CONECT   65   64   66  256  257\n"
+"CONECT   66   65   67  258  259\n"
+"CONECT   67   66   68   68  260\n"
+"CONECT   68   67   67   69  261\n"
+"CONECT   69   68   70  262  263\n"
+"CONECT   70   69   71  264  265\n"
+"CONECT   71   70   72  266  267\n"
+"CONECT   72   71   73  268  269\n"
+"CONECT   73   72   74  270  271\n"
+"CONECT   74   73  168  272  273\n"
+"CONECT   75   23   76   76   77\n"
+"CONECT   76   75   75\n"
+"CONECT   77   75   78  274  275\n"
+"CONECT   78   77   79  276  277\n"
+"CONECT   79   78   80  278  279\n"
+"CONECT   80   79   81  280  281\n"
+"CONECT   81   80   82  282  283\n"
+"CONECT   82   81   83  284  285\n"
+"CONECT   83   82   84  286  287\n"
+"CONECT   84   83   85   85  288\n"
+"CONECT   85   84   84   86  289\n"
+"CONECT   86   85   87  290  291\n"
+"CONECT   87   86   88  292  293\n"
+"CONECT   88   87   89  294  295\n"
+"CONECT   89   88   90  296  297\n"
+"CONECT   90   89   91  298  299\n"
+"CONECT   91   90  166  300  301\n"
+"CONECT   92   18   93   93   94\n"
+"CONECT   93   92   92\n"
+"CONECT   94   92   95  302  303\n"
+"CONECT   95   94   96  304  305\n"
+"CONECT   96   95   97  306  307\n"
+"CONECT   97   96   98  308  309\n"
+"CONECT   98   97   99  310  311\n"
+"CONECT   99   98  100  312  313\n"
+"CONECT  100   99  101  314  315\n"
+"CONECT  101  100  102  102  316\n"
+"CONECT  102  101  101  103  317\n"
+"CONECT  103  102  104  318  319\n"
+"CONECT  104  103  105  320  321\n"
+"CONECT  105  104  106  322  323\n"
+"CONECT  106  105  107  324  325\n"
+"CONECT  107  106  108  326  327\n"
+"CONECT  108  107  172  328  329\n"
+"CONECT  109   16  110  110  111\n"
+"CONECT  110  109  109\n"
+"CONECT  111  109  112  330  331\n"
+"CONECT  112  111  113  332  333\n"
+"CONECT  113  112  114  334  335\n"
+"CONECT  114  113  115  336  337\n"
+"CONECT  115  114  116  338  339\n"
+"CONECT  116  115  117  340  341\n"
+"CONECT  117  116  118  342  343\n"
+"CONECT  118  117  119  119  344\n"
+"CONECT  119  118  118  120  345\n"
+"CONECT  120  119  121  346  347\n"
+"CONECT  121  120  122  348  349\n"
+"CONECT  122  121  123  350  351\n"
+"CONECT  123  122  124  352  353\n"
+"CONECT  124  123  125  354  355\n"
+"CONECT  125  124  170  356  357\n"
+"CONECT  126   17  127  127  128\n"
+"CONECT  127  126  126\n"
+"CONECT  128  126  129  358  359\n"
+"CONECT  129  128  130  360  361\n"
+"CONECT  130  129  131  362  363\n"
+"CONECT  131  130  132  364  365\n"
+"CONECT  132  131  133  366  367\n"
+"CONECT  133  132  134  368  369\n"
+"CONECT  134  133  135  370  371\n"
+"CONECT  135  134  136  136  372\n"
+"CONECT  136  135  135  137  373\n"
+"CONECT  137  136  138  374  375\n"
+"CONECT  138  137  139  376  377\n"
+"CONECT  139  138  140  378  379\n"
+"CONECT  140  139  141  380  381\n"
+"CONECT  141  140  142  382  383\n"
+"CONECT  142  141  174  384  385\n"
+"CONECT  143   15  144  144  145\n"
+"CONECT  144  143  143\n"
+"CONECT  145  143  146  386  387\n"
+"CONECT  146  145  147  388  389\n"
+"CONECT  147  146  148  390  391\n"
+"CONECT  148  147  149  392  393\n"
+"CONECT  149  148  150  394  395\n"
+"CONECT  150  149  151  396  397\n"
+"CONECT  151  150  152  398  399\n"
+"CONECT  152  151  153  153  400\n"
+"CONECT  153  152  152  154  401\n"
+"CONECT  154  153  155  402  403\n"
+"CONECT  155  154  156  404  405\n"
+"CONECT  156  155  157  406  407\n"
+"CONECT  157  156  158  408  409\n"
+"CONECT  158  157  159  410  411\n"
+"CONECT  159  158  160  412  413\n"
+"CONECT  160  159  161  414  415\n"
+"CONECT  161  160  416  417  418\n"
+"CONECT  162   57  163  419  420\n"
+"CONECT  163  162  421  422  423\n"
+"CONECT  164   40  165  424  425\n"
+"CONECT  165  164  426  427  428\n"
+"CONECT  166   91  167  429  430\n"
+"CONECT  167  166  431  432  433\n"
+"CONECT  168   74  169  434  435\n"
+"CONECT  169  168  436  437  438\n"
+"CONECT  170  125  171  439  440\n"
+"CONECT  171  170  441  442  443\n"
+"CONECT  172  108  173  444  445\n"
+"CONECT  173  172  446  447  448\n"
+"CONECT  174  142  175  449  450\n"
+"CONECT  175  174  451  452  453\n"
+"CONECT  176    1\n"
+"CONECT  177    2\n"
+"CONECT  178    3\n"
+"CONECT  179    4\n"
+"CONECT  180    5\n"
+"CONECT  181    9\n"
+"CONECT  182    9\n"
+"CONECT  183   10\n"
+"CONECT  184   12\n"
+"CONECT  185   13\n"
+"CONECT  186   14\n"
+"CONECT  187   14\n"
+"CONECT  188   19\n"
+"CONECT  189   19\n"
+"CONECT  190   26\n"
+"CONECT  191   26\n"
+"CONECT  192   27\n"
+"CONECT  193   27\n"
+"CONECT  194   28\n"
+"CONECT  195   28\n"
+"CONECT  196   29\n"
+"CONECT  197   29\n"
+"CONECT  198   30\n"
+"CONECT  199   30\n"
+"CONECT  200   31\n"
+"CONECT  201   31\n"
+"CONECT  202   32\n"
+"CONECT  203   32\n"
+"CONECT  204   33\n"
+"CONECT  205   34\n"
+"CONECT  206   35\n"
+"CONECT  207   35\n"
+"CONECT  208   36\n"
+"CONECT  209   36\n"
+"CONECT  210   37\n"
+"CONECT  211   37\n"
+"CONECT  212   38\n"
+"CONECT  213   38\n"
+"CONECT  214   39\n"
+"CONECT  215   39\n"
+"CONECT  216   40\n"
+"CONECT  217   40\n"
+"CONECT  218   43\n"
+"CONECT  219   43\n"
+"CONECT  220   44\n"
+"CONECT  221   44\n"
+"CONECT  222   45\n"
+"CONECT  223   45\n"
+"CONECT  224   46\n"
+"CONECT  225   46\n"
+"CONECT  226   47\n"
+"CONECT  227   47\n"
+"CONECT  228   48\n"
+"CONECT  229   48\n"
+"CONECT  230   49\n"
+"CONECT  231   49\n"
+"CONECT  232   50\n"
+"CONECT  233   51\n"
+"CONECT  234   52\n"
+"CONECT  235   52\n"
+"CONECT  236   53\n"
+"CONECT  237   53\n"
+"CONECT  238   54\n"
+"CONECT  239   54\n"
+"CONECT  240   55\n"
+"CONECT  241   55\n"
+"CONECT  242   56\n"
+"CONECT  243   56\n"
+"CONECT  244   57\n"
+"CONECT  245   57\n"
+"CONECT  246   60\n"
+"CONECT  247   60\n"
+"CONECT  248   61\n"
+"CONECT  249   61\n"
+"CONECT  250   62\n"
+"CONECT  251   62\n"
+"CONECT  252   63\n"
+"CONECT  253   63\n"
+"CONECT  254   64\n"
+"CONECT  255   64\n"
+"CONECT  256   65\n"
+"CONECT  257   65\n"
+"CONECT  258   66\n"
+"CONECT  259   66\n"
+"CONECT  260   67\n"
+"CONECT  261   68\n"
+"CONECT  262   69\n"
+"CONECT  263   69\n"
+"CONECT  264   70\n"
+"CONECT  265   70\n"
+"CONECT  266   71\n"
+"CONECT  267   71\n"
+"CONECT  268   72\n"
+"CONECT  269   72\n"
+"CONECT  270   73\n"
+"CONECT  271   73\n"
+"CONECT  272   74\n"
+"CONECT  273   74\n"
+"CONECT  274   77\n"
+"CONECT  275   77\n"
+"CONECT  276   78\n"
+"CONECT  277   78\n"
+"CONECT  278   79\n"
+"CONECT  279   79\n"
+"CONECT  280   80\n"
+"CONECT  281   80\n"
+"CONECT  282   81\n"
+"CONECT  283   81\n"
+"CONECT  284   82\n"
+"CONECT  285   82\n"
+"CONECT  286   83\n"
+"CONECT  287   83\n"
+"CONECT  288   84\n"
+"CONECT  289   85\n"
+"CONECT  290   86\n"
+"CONECT  291   86\n"
+"CONECT  292   87\n"
+"CONECT  293   87\n"
+"CONECT  294   88\n"
+"CONECT  295   88\n"
+"CONECT  296   89\n"
+"CONECT  297   89\n"
+"CONECT  298   90\n"
+"CONECT  299   90\n"
+"CONECT  300   91\n"
+"CONECT  301   91\n"
+"CONECT  302   94\n"
+"CONECT  303   94\n"
+"CONECT  304   95\n"
+"CONECT  305   95\n"
+"CONECT  306   96\n"
+"CONECT  307   96\n"
+"CONECT  308   97\n"
+"CONECT  309   97\n"
+"CONECT  310   98\n"
+"CONECT  311   98\n"
+"CONECT  312   99\n"
+"CONECT  313   99\n"
+"CONECT  314  100\n"
+"CONECT  315  100\n"
+"CONECT  316  101\n"
+"CONECT  317  102\n"
+"CONECT  318  103\n"
+"CONECT  319  103\n"
+"CONECT  320  104\n"
+"CONECT  321  104\n"
+"CONECT  322  105\n"
+"CONECT  323  105\n"
+"CONECT  324  106\n"
+"CONECT  325  106\n"
+"CONECT  326  107\n"
+"CONECT  327  107\n"
+"CONECT  328  108\n"
+"CONECT  329  108\n"
+"CONECT  330  111\n"
+"CONECT  331  111\n"
+"CONECT  332  112\n"
+"CONECT  333  112\n"
+"CONECT  334  113\n"
+"CONECT  335  113\n"
+"CONECT  336  114\n"
+"CONECT  337  114\n"
+"CONECT  338  115\n"
+"CONECT  339  115\n"
+"CONECT  340  116\n"
+"CONECT  341  116\n"
+"CONECT  342  117\n"
+"CONECT  343  117\n"
+"CONECT  344  118\n"
+"CONECT  345  119\n"
+"CONECT  346  120\n"
+"CONECT  347  120\n"
+"CONECT  348  121\n"
+"CONECT  349  121\n"
+"CONECT  350  122\n"
+"CONECT  351  122\n"
+"CONECT  352  123\n"
+"CONECT  353  123\n"
+"CONECT  354  124\n"
+"CONECT  355  124\n"
+"CONECT  356  125\n"
+"CONECT  357  125\n"
+"CONECT  358  128\n"
+"CONECT  359  128\n"
+"CONECT  360  129\n"
+"CONECT  361  129\n"
+"CONECT  362  130\n"
+"CONECT  363  130\n"
+"CONECT  364  131\n"
+"CONECT  365  131\n"
+"CONECT  366  132\n"
+"CONECT  367  132\n"
+"CONECT  368  133\n"
+"CONECT  369  133\n"
+"CONECT  370  134\n"
+"CONECT  371  134\n"
+"CONECT  372  135\n"
+"CONECT  373  136\n"
+"CONECT  374  137\n"
+"CONECT  375  137\n"
+"CONECT  376  138\n"
+"CONECT  377  138\n"
+"CONECT  378  139\n"
+"CONECT  379  139\n"
+"CONECT  380  140\n"
+"CONECT  381  140\n"
+"CONECT  382  141\n"
+"CONECT  383  141\n"
+"CONECT  384  142\n"
+"CONECT  385  142\n"
+"CONECT  386  145\n"
+"CONECT  387  145\n"
+"CONECT  388  146\n"
+"CONECT  389  146\n"
+"CONECT  390  147\n"
+"CONECT  391  147\n"
+"CONECT  392  148\n"
+"CONECT  393  148\n"
+"CONECT  394  149\n"
+"CONECT  395  149\n"
+"CONECT  396  150\n"
+"CONECT  397  150\n"
+"CONECT  398  151\n"
+"CONECT  399  151\n"
+"CONECT  400  152\n"
+"CONECT  401  153\n"
+"CONECT  402  154\n"
+"CONECT  403  154\n"
+"CONECT  404  155\n"
+"CONECT  405  155\n"
+"CONECT  406  156\n"
+"CONECT  407  156\n"
+"CONECT  408  157\n"
+"CONECT  409  157\n"
+"CONECT  410  158\n"
+"CONECT  411  158\n"
+"CONECT  412  159\n"
+"CONECT  413  159\n"
+"CONECT  414  160\n"
+"CONECT  415  160\n"
+"CONECT  416  161\n"
+"CONECT  417  161\n"
+"CONECT  418  161\n"
+"CONECT  419  162\n"
+"CONECT  420  162\n"
+"CONECT  421  163\n"
+"CONECT  422  163\n"
+"CONECT  423  163\n"
+"CONECT  424  164\n"
+"CONECT  425  164\n"
+"CONECT  426  165\n"
+"CONECT  427  165\n"
+"CONECT  428  165\n"
+"CONECT  429  166\n"
+"CONECT  430  166\n"
+"CONECT  431  167\n"
+"CONECT  432  167\n"
+"CONECT  433  167\n"
+"CONECT  434  168\n"
+"CONECT  435  168\n"
+"CONECT  436  169\n"
+"CONECT  437  169\n"
+"CONECT  438  169\n"
+"CONECT  439  170\n"
+"CONECT  440  170\n"
+"CONECT  441  171\n"
+"CONECT  442  171\n"
+"CONECT  443  171\n"
+"CONECT  444  172\n"
+"CONECT  445  172\n"
+"CONECT  446  173\n"
+"CONECT  447  173\n"
+"CONECT  448  173\n"
+"CONECT  449  174\n"
+"CONECT  450  174\n"
+"CONECT  451  175\n"
+"CONECT  452  175\n"
+"CONECT  453  175\n"
+"MASTER        0    0    0    0    0    0    0    0  453    0  453    0\n"
+"END\n"
+,
+"HEADER    Penicillin G, an antibiotic\n"
+"COMPND    al3077\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.542   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       1.415   1.509   0.000  1.00  0.00 \n"
+"HETATM    4  O           1       2.209   2.398  -0.083  1.00  0.00 \n"
+"HETATM    5  N           1       0.066   1.475   0.061  1.00  0.00 \n"
+"HETATM    6  N           1       2.125  -0.528   1.243  1.00  0.00 \n"
+"HETATM    7  C           1       2.235  -1.858   1.457  1.00  0.00 \n"
+"HETATM    8  O           1       2.669  -2.251   2.509  1.00  0.00 \n"
+"HETATM    9  C           1       1.827  -2.860   0.414  1.00  0.00 \n"
+"HETATM   10  C           1       1.446  -4.153   1.098  1.00  0.00 \n"
+"HETATM   11  C           1       0.143  -4.328   1.578  1.00  0.00 \n"
+"HETATM   12  C           1      -0.216  -5.521   2.214  1.00  0.00 \n"
+"HETATM   13  C           1       0.729  -6.540   2.373  1.00  0.00 \n"
+"HETATM   14  C           1       2.034  -6.363   1.902  1.00  0.00 \n"
+"HETATM   15  C           1       2.393  -5.168   1.268  1.00  0.00 \n"
+"HETATM   16  S           1      -0.818  -0.450   1.519  1.00  0.00 \n"
+"HETATM   17  C           1      -1.605   1.127   1.810  1.00  0.00 \n"
+"HETATM   18  C           1      -1.800   1.394   3.317  1.00  0.00 \n"
+"HETATM   19  C           1      -2.966   1.138   1.082  1.00  0.00 \n"
+"HETATM   20  C           1      -0.629   2.147   1.173  1.00  0.00 \n"
+"HETATM   21  C           1      -1.351   3.368   0.682  1.00  0.00 \n"
+"HETATM   22  O           1      -1.537   3.505  -0.499  1.00  0.00 \n"
+"HETATM   23  O           1      -2.048   4.114   1.557  1.00  0.00 \n"
+"HETATM   24  H           1      -0.466  -0.363  -0.916  1.00  0.00 \n"
+"HETATM   25  H           1       1.982  -0.387  -0.919  1.00  0.00 \n"
+"HETATM   26  H           1       2.409   0.115   1.973  1.00  0.00 \n"
+"HETATM   27  H           1       2.660  -3.033  -0.268  1.00  0.00 \n"
+"HETATM   28  H           1       0.971  -2.493  -0.151  1.00  0.00 \n"
+"HETATM   29  H           1      -0.596  -3.536   1.454  1.00  0.00 \n"
+"HETATM   30  H           1      -1.232  -5.657   2.584  1.00  0.00 \n"
+"HETATM   31  H           1       0.449  -7.470   2.868  1.00  0.00 \n"
+"HETATM   32  H           1       2.772  -7.155   2.030  1.00  0.00 \n"
+"HETATM   33  H           1       3.412  -5.032   0.906  1.00  0.00 \n"
+"HETATM   34  H           1      -0.839   1.345   3.829  1.00  0.00 \n"
+"HETATM   35  H           1      -2.470   0.644   3.739  1.00  0.00 \n"
+"HETATM   36  H           1      -2.233   2.384   3.459  1.00  0.00 \n"
+"HETATM   37  H           1      -3.586   0.322   1.454  1.00  0.00 \n"
+"HETATM   38  H           1      -2.811   1.012   0.010  1.00  0.00 \n"
+"HETATM   39  H           1      -3.480   2.082   1.263  1.00  0.00 \n"
+"HETATM   40  H           1       0.108   2.446   1.919  1.00  0.00 \n"
+"HETATM   41  H           1      -2.798   4.548   1.098  1.00  0.00 \n"
+"CONECT    1    2    5   16   24\n"
+"CONECT    2    1    3    6   25\n"
+"CONECT    3    2    4    4    5\n"
+"CONECT    4    3    3\n"
+"CONECT    5    1    3   20\n"
+"CONECT    6    2    7   26\n"
+"CONECT    7    6    8    8    9\n"
+"CONECT    8    7    7\n"
+"CONECT    9    7   10   27   28\n"
+"CONECT   10    9   11   11   15\n"
+"CONECT   11   10   10   12   29\n"
+"CONECT   12   11   13   13   30\n"
+"CONECT   13   12   12   14   31\n"
+"CONECT   14   13   15   15   32\n"
+"CONECT   15   10   14   14   33\n"
+"CONECT   16    1   17\n"
+"CONECT   17   16   18   19   20\n"
+"CONECT   18   17   34   35   36\n"
+"CONECT   19   17   37   38   39\n"
+"CONECT   20    5   17   21   40\n"
+"CONECT   21   20   22   22   23\n"
+"CONECT   22   21   21\n"
+"CONECT   23   21   41\n"
+"CONECT   24    1\n"
+"CONECT   25    2\n"
+"CONECT   26    6\n"
+"CONECT   27    9\n"
+"CONECT   28    9\n"
+"CONECT   29   11\n"
+"CONECT   30   12\n"
+"CONECT   31   13\n"
+"CONECT   32   14\n"
+"CONECT   33   15\n"
+"CONECT   34   18\n"
+"CONECT   35   18\n"
+"CONECT   36   18\n"
+"CONECT   37   19\n"
+"CONECT   38   19\n"
+"CONECT   39   19\n"
+"CONECT   40   20\n"
+"CONECT   41   23\n"
+"MASTER        0    0    0    0    0    0    0    0   41    0   41    0\n"
+"END\n"
+,
+"HEADER    Sarin: S Enantiomer, a chemical warfare agent\n"
+"COMPND    al3023\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  P           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  F           1       1.779   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1      -0.611   1.725   0.000  1.00  0.00 \n"
+"HETATM    4  O           1      -0.599  -0.840   1.463  1.00  0.00 \n"
+"HETATM    5  O           1      -0.599  -0.841  -1.466  1.00  0.00 \n"
+"HETATM    6  C           1      -1.898  -1.369  -1.304  1.00  0.00 \n"
+"HETATM    7  C           1      -1.817  -2.772  -0.672  1.00  0.00 \n"
+"HETATM    8  C           1      -2.555  -1.476  -2.694  1.00  0.00 \n"
+"HETATM    9  H           1      -0.248   2.240  -0.890  1.00  0.00 \n"
+"HETATM   10  H           1      -0.248   2.239   0.891  1.00  0.00 \n"
+"HETATM   11  H           1      -1.701   1.724   0.000  1.00  0.00 \n"
+"HETATM   12  H           1      -2.510  -0.718  -0.679  1.00  0.00 \n"
+"HETATM   13  H           1      -1.372  -2.712   0.320  1.00  0.00 \n"
+"HETATM   14  H           1      -1.203  -3.414  -1.303  1.00  0.00 \n"
+"HETATM   15  H           1      -2.818  -3.194  -0.591  1.00  0.00 \n"
+"HETATM   16  H           1      -1.961  -2.124  -3.339  1.00  0.00 \n"
+"HETATM   17  H           1      -3.561  -1.885  -2.595  1.00  0.00 \n"
+"HETATM   18  H           1      -2.613  -0.482  -3.136  1.00  0.00 \n"
+"CONECT    1    2    3    4    4    5\n"
+"CONECT    2    1\n"
+"CONECT    3    1    9   10   11\n"
+"CONECT    4    1    1\n"
+"CONECT    5    1    6\n"
+"CONECT    6    5    7    8   12\n"
+"CONECT    7    6   13   14   15\n"
+"CONECT    8    6   16   17   18\n"
+"CONECT    9    3\n"
+"CONECT   10    3\n"
+"CONECT   11    3\n"
+"CONECT   12    6\n"
+"CONECT   13    7\n"
+"CONECT   14    7\n"
+"CONECT   15    7\n"
+"CONECT   16    8\n"
+"CONECT   17    8\n"
+"CONECT   18    8\n"
+"MASTER        0    0    0    0    0    0    0    0   18    0   18    0\n"
+"END\n"
+,
+"HEADER    Strychnine: Nux Vomica\n"
+"COMPND    al3061\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Wed Aug 30 12:33:12 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.395   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.124   1.193   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.414   2.398  -0.067  1.00  0.00 \n"
+"HETATM    5  C           1       0.014   2.401  -0.115  1.00  0.00 \n"
+"HETATM    6  C           1      -0.709   1.203  -0.087  1.00  0.00 \n"
+"HETATM    7  C           1       1.911  -1.410   0.160  1.00  0.00 \n"
+"HETATM    8  N           1      -0.471  -1.291  -0.057  1.00  0.00 \n"
+"HETATM    9  C           1      -1.720  -1.604  -0.472  1.00  0.00 \n"
+"HETATM   10  O           1      -2.589  -0.778  -0.359  1.00  0.00 \n"
+"HETATM   11  C           1       0.645  -2.239  -0.189  1.00  0.00 \n"
+"HETATM   12  C           1      -1.941  -2.698  -1.483  1.00  0.00 \n"
+"HETATM   13  C           1      -0.687  -3.549  -1.797  1.00  0.00 \n"
+"HETATM   14  H           1       0.525  -3.093   0.477  1.00  0.00 \n"
+"HETATM   15  C           1       0.573  -2.674  -1.656  1.00  0.00 \n"
+"HETATM   16  H           1      -0.775  -3.908  -2.822  1.00  0.00 \n"
+"HETATM   17  O           1      -0.654  -4.641  -0.904  1.00  0.00 \n"
+"HETATM   18  C           1       0.221  -5.671  -1.313  1.00  0.00 \n"
+"HETATM   19  C           1       1.595  -5.446  -0.726  1.00  0.00 \n"
+"HETATM   20  C           1       2.356  -4.403  -1.088  1.00  0.00 \n"
+"HETATM   21  C           1       3.723  -4.222  -0.464  1.00  0.00 \n"
+"HETATM   22  C           1       1.893  -3.351  -2.072  1.00  0.00 \n"
+"HETATM   23  H           1       0.431  -1.791  -2.279  1.00  0.00 \n"
+"HETATM   24  H           1       1.803  -3.769  -3.074  1.00  0.00 \n"
+"HETATM   25  C           1       2.942  -2.222  -2.062  1.00  0.00 \n"
+"HETATM   26  C           1       3.199  -1.816  -0.595  1.00  0.00 \n"
+"HETATM   27  C           1       2.322  -1.641   1.618  1.00  0.00 \n"
+"HETATM   28  C           1       3.109  -2.956   1.512  1.00  0.00 \n"
+"HETATM   29  N           1       3.783  -2.911   0.202  1.00  0.00 \n"
+"HETATM   30  H           1       3.212   1.188   0.059  1.00  0.00 \n"
+"HETATM   31  H           1       1.957   3.343  -0.078  1.00  0.00 \n"
+"HETATM   32  H           1      -0.520   3.349  -0.172  1.00  0.00 \n"
+"HETATM   33  H           1      -1.798   1.219  -0.127  1.00  0.00 \n"
+"HETATM   34  H           1      -2.263  -2.218  -2.408  1.00  0.00 \n"
+"HETATM   35  H           1      -2.740  -3.355  -1.139  1.00  0.00 \n"
+"HETATM   36  H           1       0.290  -5.733  -2.400  1.00  0.00 \n"
+"HETATM   37  H           1      -0.163  -6.618  -0.935  1.00  0.00 \n"
+"HETATM   38  H           1       1.974  -6.159   0.006  1.00  0.00 \n"
+"HETATM   39  H           1       4.483  -4.272  -1.243  1.00  0.00 \n"
+"HETATM   40  H           1       3.923  -5.012   0.260  1.00  0.00 \n"
+"HETATM   41  H           1       2.578  -1.363  -2.625  1.00  0.00 \n"
+"HETATM   42  H           1       3.871  -2.566  -2.519  1.00  0.00 \n"
+"HETATM   43  H           1       3.898  -0.980  -0.573  1.00  0.00 \n"
+"HETATM   44  H           1       1.464  -1.724   2.285  1.00  0.00 \n"
+"HETATM   45  H           1       2.987  -0.840   1.943  1.00  0.00 \n"
+"HETATM   46  H           1       2.413  -3.794   1.551  1.00  0.00 \n"
+"HETATM   47  H           1       3.833  -3.042   2.322  1.00  0.00 \n"
+"CONECT    1    2    2    6    8\n"
+"CONECT    2    1    1    3    7\n"
+"CONECT    3    2    4    4   30\n"
+"CONECT    4    3    3    5   31\n"
+"CONECT    5    4    6    6   32\n"
+"CONECT    6    1    5    5   33\n"
+"CONECT    7    2   11   26   27\n"
+"CONECT    8    1    9   11\n"
+"CONECT    9    8   10   10   12\n"
+"CONECT   10    9    9\n"
+"CONECT   11    7    8   14   15\n"
+"CONECT   12    9   13   34   35\n"
+"CONECT   13   12   15   16   17\n"
+"CONECT   14   11\n"
+"CONECT   15   11   13   22   23\n"
+"CONECT   16   13\n"
+"CONECT   17   13   18\n"
+"CONECT   18   17   19   36   37\n"
+"CONECT   19   18   20   20   38\n"
+"CONECT   20   19   19   21   22\n"
+"CONECT   21   20   29   39   40\n"
+"CONECT   22   15   20   24   25\n"
+"CONECT   23   15\n"
+"CONECT   24   22\n"
+"CONECT   25   22   26   41   42\n"
+"CONECT   26    7   25   29   43\n"
+"CONECT   27    7   28   44   45\n"
+"CONECT   28   27   29   46   47\n"
+"CONECT   29   21   26   28\n"
+"CONECT   30    3\n"
+"CONECT   31    4\n"
+"CONECT   32    5\n"
+"CONECT   33    6\n"
+"CONECT   34   12\n"
+"CONECT   35   12\n"
+"CONECT   36   18\n"
+"CONECT   37   18\n"
+"CONECT   38   19\n"
+"CONECT   39   21\n"
+"CONECT   40   21\n"
+"CONECT   41   25\n"
+"CONECT   42   25\n"
+"CONECT   43   26\n"
+"CONECT   44   27\n"
+"CONECT   45   27\n"
+"CONECT   46   28\n"
+"CONECT   47   28\n"
+"MASTER        0    0    0    0    0    0    0    0   47    0   47    0\n"
+"END\n"
+,
+"HEADER    Sucrose: Sugar\n"
+"COMPND    nat0013\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.542   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.041   1.457   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.414   2.181   1.207  1.00  0.00 \n"
+"HETATM    5  C           1      -0.117   2.034   1.128  1.00  0.00 \n"
+"HETATM    6  O           1      -0.472   0.668   1.149  1.00  0.00 \n"
+"HETATM    7  H           1      -0.566   2.548   1.978  1.00  0.00 \n"
+"HETATM    8  O           1      -0.572   2.607  -0.076  1.00  0.00 \n"
+"HETATM    9  C           1      -1.867   3.149  -0.193  1.00  0.00 \n"
+"HETATM   10  C           1      -1.993   3.815  -1.579  1.00  0.00 \n"
+"HETATM   11  C           1      -2.960   2.084  -0.002  1.00  0.00 \n"
+"HETATM   12  O           1      -2.117   4.104   0.816  1.00  0.00 \n"
+"HETATM   13  C           1      -3.516   4.220   0.978  1.00  0.00 \n"
+"HETATM   14  C           1      -4.167   2.959   0.369  1.00  0.00 \n"
+"HETATM   15  H           1      -0.368   0.500  -0.896  1.00  0.00 \n"
+"HETATM   16  H           1       1.901  -0.501   0.899  1.00  0.00 \n"
+"HETATM   17  H           1       1.728   1.949  -0.923  1.00  0.00 \n"
+"HETATM   18  H           1       1.774   1.726   2.130  1.00  0.00 \n"
+"HETATM   19  H           1      -1.836   3.065  -2.355  1.00  0.00 \n"
+"HETATM   20  H           1      -2.981   4.259  -1.698  1.00  0.00 \n"
+"HETATM   21  H           1      -3.133   1.511  -0.914  1.00  0.00 \n"
+"HETATM   22  H           1      -3.871   5.100   0.441  1.00  0.00 \n"
+"HETATM   23  H           1      -4.821   2.452   1.081  1.00  0.00 \n"
+"HETATM   24  C           1      -3.859   4.364   2.474  1.00  0.00 \n"
+"HETATM   25  O           1      -5.279   4.442   2.639  1.00  0.00 \n"
+"HETATM   26  O           1      -4.897   3.325  -0.807  1.00  0.00 \n"
+"HETATM   27  O           1      -2.638   1.202   1.079  1.00  0.00 \n"
+"HETATM   28  O           1      -0.995   4.834  -1.694  1.00  0.00 \n"
+"HETATM   29  C           1      -0.513  -1.453   0.003  1.00  0.00 \n"
+"HETATM   30  O           1      -1.944  -1.459  -0.055  1.00  0.00 \n"
+"HETATM   31  O           1       2.039  -0.690  -1.152  1.00  0.00 \n"
+"HETATM   32  O           1       3.468   1.480   0.101  1.00  0.00 \n"
+"HETATM   33  O           1       1.772   3.567   1.189  1.00  0.00 \n"
+"HETATM   34  H           1      -3.396   5.270   2.866  1.00  0.00 \n"
+"HETATM   35  H           1      -3.480   3.504   3.024  1.00  0.00 \n"
+"HETATM   36  H           1      -5.622   5.216   2.180  1.00  0.00 \n"
+"HETATM   37  H           1      -5.302   2.544  -1.199  1.00  0.00 \n"
+"HETATM   38  H           1      -2.661   1.671   1.919  1.00  0.00 \n"
+"HETATM   39  H           1      -1.056   5.255  -2.558  1.00  0.00 \n"
+"HETATM   40  H           1      -0.180  -1.958   0.910  1.00  0.00 \n"
+"HETATM   41  H           1      -0.118  -1.977  -0.868  1.00  0.00 \n"
+"HETATM   42  H           1      -2.305  -1.058   0.741  1.00  0.00 \n"
+"HETATM   43  H           1       1.728  -0.261  -1.956  1.00  0.00 \n"
+"HETATM   44  H           1       3.781   2.391   0.099  1.00  0.00 \n"
+"HETATM   45  H           1       1.428   3.987   0.394  1.00  0.00 \n"
+"CONECT    1    2    6   15   29\n"
+"CONECT    2    1    3   16   31\n"
+"CONECT    3    2    4   17   32\n"
+"CONECT    4    3    5   18   33\n"
+"CONECT    5    4    6    7    8\n"
+"CONECT    6    1    5\n"
+"CONECT    7    5\n"
+"CONECT    8    5    9\n"
+"CONECT    9    8   10   11   12\n"
+"CONECT   10    9   19   20   28\n"
+"CONECT   11    9   14   21   27\n"
+"CONECT   12    9   13\n"
+"CONECT   13   12   14   22   24\n"
+"CONECT   14   11   13   23   26\n"
+"CONECT   15    1\n"
+"CONECT   16    2\n"
+"CONECT   17    3\n"
+"CONECT   18    4\n"
+"CONECT   19   10\n"
+"CONECT   20   10\n"
+"CONECT   21   11\n"
+"CONECT   22   13\n"
+"CONECT   23   14\n"
+"CONECT   24   13   25   34   35\n"
+"CONECT   25   24   36\n"
+"CONECT   26   14   37\n"
+"CONECT   27   11   38\n"
+"CONECT   28   10   39\n"
+"CONECT   29    1   30   40   41\n"
+"CONECT   30   29   42\n"
+"CONECT   31    2   43\n"
+"CONECT   32    3   44\n"
+"CONECT   33    4   45\n"
+"CONECT   34   24\n"
+"CONECT   35   24\n"
+"CONECT   36   25\n"
+"CONECT   37   26\n"
+"CONECT   38   27\n"
+"CONECT   39   28\n"
+"CONECT   40   29\n"
+"CONECT   41   29\n"
+"CONECT   42   30\n"
+"CONECT   43   31\n"
+"CONECT   44   32\n"
+"CONECT   45   33\n"
+"MASTER        0    0    0    0    0    0    0    0   45    0   45    0\n"
+"END\n"
+,
+"HEADER    (S)-Thalidomide, a teratogenic enantiomer\n"
+"COMPND    jb03stha\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Mon Sep 18 15:35:27 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.402   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.128   1.197   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.396   2.389  -0.011  1.00  0.00 \n"
+"HETATM    5  C           1       0.003   2.388  -0.010  1.00  0.00 \n"
+"HETATM    6  C           1      -0.728   1.196   0.001  1.00  0.00 \n"
+"HETATM    7  C           1      -0.415   3.783   0.056  1.00  0.00 \n"
+"HETATM    8  O           1      -1.550   4.177   0.150  1.00  0.00 \n"
+"HETATM    9  N           1       0.698   4.553   0.096  1.00  0.00 \n"
+"HETATM   10  C           1       1.812   3.785   0.053  1.00  0.00 \n"
+"HETATM   11  O           1       2.946   4.181   0.146  1.00  0.00 \n"
+"HETATM   12  C           1       0.702   6.005   0.319  1.00  0.00 \n"
+"HETATM   13  C           1       1.020   6.278   1.801  1.00  0.00 \n"
+"HETATM   14  C           1       1.130   7.799   2.000  1.00  0.00 \n"
+"HETATM   15  C           1       2.180   8.336   1.068  1.00  0.00 \n"
+"HETATM   16  O           1       2.814   9.307   1.391  1.00  0.00 \n"
+"HETATM   17  N           1       2.428   7.747  -0.124  1.00  0.00 \n"
+"HETATM   18  C           1       1.757   6.647  -0.538  1.00  0.00 \n"
+"HETATM   19  O           1       2.022   6.158  -1.607  1.00  0.00 \n"
+"HETATM   20  H           1      -0.535  -0.949   0.010  1.00  0.00 \n"
+"HETATM   21  H           1       1.938  -0.949   0.010  1.00  0.00 \n"
+"HETATM   22  H           1       3.217   1.203   0.020  1.00  0.00 \n"
+"HETATM   23  H           1      -1.817   1.201   0.022  1.00  0.00 \n"
+"HETATM   24  H           1      -0.272   6.423   0.067  1.00  0.00 \n"
+"HETATM   25  H           1       1.968   5.808   2.060  1.00  0.00 \n"
+"HETATM   26  H           1       0.228   5.873   2.432  1.00  0.00 \n"
+"HETATM   27  H           1       1.408   8.016   3.031  1.00  0.00 \n"
+"HETATM   28  H           1       0.173   8.268   1.775  1.00  0.00 \n"
+"HETATM   29  H           1       3.142   8.141  -0.727  1.00  0.00 \n"
+"CONECT    1    2    2    6   20\n"
+"CONECT    2    1    1    3   21\n"
+"CONECT    3    2    4    4   22\n"
+"CONECT    4    3    3    5   10\n"
+"CONECT    5    4    6    6    7\n"
+"CONECT    6    1    5    5   23\n"
+"CONECT    7    5    8    8    9\n"
+"CONECT    8    7    7\n"
+"CONECT    9    7   10   12\n"
+"CONECT   10    4    9   11   11\n"
+"CONECT   11   10   10\n"
+"CONECT   12    9   13   18   24\n"
+"CONECT   13   12   14   25   26\n"
+"CONECT   14   13   15   27   28\n"
+"CONECT   15   14   16   16   17\n"
+"CONECT   16   15   15\n"
+"CONECT   17   15   18   29\n"
+"CONECT   18   12   17   19   19\n"
+"CONECT   19   18   18\n"
+"CONECT   20    1\n"
+"CONECT   21    2\n"
+"CONECT   22    3\n"
+"CONECT   23    6\n"
+"CONECT   24   12\n"
+"CONECT   25   13\n"
+"CONECT   26   13\n"
+"CONECT   27   14\n"
+"CONECT   28   14\n"
+"CONECT   29   17\n"
+"MASTER        0    0    0    0    0    0    0    0   29    0   29    0\n"
+"END\n"
+,
+"HEADER    Thymine: Pyrimidine base nucleotide\n"
+"COMPND    jb09thye\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Tue Sep 19 21:46:02 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.399   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.068   1.228   0.000  1.00  0.00 \n"
+"HETATM    4  N           1       1.356   2.377  -0.004  1.00  0.00 \n"
+"HETATM    5  C           1       0.004   2.350  -0.006  1.00  0.00 \n"
+"HETATM    6  N           1      -0.667   1.176  -0.004  1.00  0.00 \n"
+"HETATM    7  O           1      -0.611   3.385  -0.006  1.00  0.00 \n"
+"HETATM    8  O           1       3.272   1.261   0.006  1.00  0.00 \n"
+"HETATM    9  C           1       2.173  -1.300   0.014  1.00  0.00 \n"
+"HETATM   10  H           1      -0.549  -0.941   0.006  1.00  0.00 \n"
+"HETATM   11  H           1       1.840   3.268  -0.003  1.00  0.00 \n"
+"HETATM   12  H           1      -1.681   1.178  -0.004  1.00  0.00 \n"
+"HETATM   13  H           1       1.632  -2.055  -0.555  1.00  0.00 \n"
+"HETATM   14  H           1       2.293  -1.638   1.044  1.00  0.00 \n"
+"HETATM   15  H           1       3.155  -1.146  -0.433  1.00  0.00 \n"
+"CONECT    1    2    2    6   10\n"
+"CONECT    2    1    1    3    9\n"
+"CONECT    3    2    4    8    8\n"
+"CONECT    4    3    5   11\n"
+"CONECT    5    4    6    7    7\n"
+"CONECT    6    1    5   12\n"
+"CONECT    7    5    5\n"
+"CONECT    8    3    3\n"
+"CONECT    9    2   13   14   15\n"
+"CONECT   10    1\n"
+"CONECT   11    4\n"
+"CONECT   12    6\n"
+"CONECT   13    9\n"
+"CONECT   14    9\n"
+"CONECT   15    9\n"
+"MASTER        0    0    0    0    0    0    0    0   15    0   15    0\n"
+"END\n"
+,
+"COMPND    Viagra\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"REMARK    from a model provided by Dr Eric Walters\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Mon Oct 16 12:17:54 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.398   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.105   1.207   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.417   2.427  -0.037  1.00  0.00 \n"
+"HETATM    5  C           1       0.017   2.422  -0.014  1.00  0.00 \n"
+"HETATM    6  C           1      -0.692   1.216  -0.005  1.00  0.00 \n"
+"HETATM    7  H           1      -0.545  -0.944   0.023  1.00  0.00 \n"
+"HETATM    8  H           1       1.939  -0.946   0.029  1.00  0.00 \n"
+"HETATM    9  H           1      -0.531   3.364  -0.022  1.00  0.00 \n"
+"HETATM   10  C           1       2.100   3.733  -0.053  1.00  0.00 \n"
+"HETATM   11  N           1       3.453   3.848  -0.302  1.00  0.00 \n"
+"HETATM   12  C           1       4.091   5.067  -0.302  1.00  0.00 \n"
+"HETATM   13  C           1       3.259   6.246  -0.033  1.00  0.00 \n"
+"HETATM   14  C           1       1.897   6.080   0.190  1.00  0.00 \n"
+"HETATM   15  N           1       1.310   4.840   0.169  1.00  0.00 \n"
+"HETATM   16  O           1       5.271   5.168  -0.544  1.00  0.00 \n"
+"HETATM   17  H           1       4.029   2.992  -0.569  1.00  0.00 \n"
+"HETATM   18  N           1       3.538   7.572   0.006  1.00  0.00 \n"
+"HETATM   19  N           1       2.406   8.264   0.248  1.00  0.00 \n"
+"HETATM   20  C           1       1.373   7.363   0.369  1.00  0.00 \n"
+"HETATM   21  C           1       4.863   8.163  -0.230  1.00  0.00 \n"
+"HETATM   22  H           1       4.799   9.247  -0.133  1.00  0.00 \n"
+"HETATM   23  H           1       5.200   7.907  -1.235  1.00  0.00 \n"
+"HETATM   24  H           1       5.570   7.774   0.501  1.00  0.00 \n"
+"HETATM   25  C           1      -0.079   7.701   0.624  1.00  0.00 \n"
+"HETATM   26  C           1      -0.226   9.225   0.805  1.00  0.00 \n"
+"HETATM   27  H           1      -0.415   7.190   1.526  1.00  0.00 \n"
+"HETATM   28  H           1      -0.680   7.372  -0.224  1.00  0.00 \n"
+"HETATM   29  C           1      -1.702   9.584   1.072  1.00  0.00 \n"
+"HETATM   30  H           1       0.112   9.732  -0.099  1.00  0.00 \n"
+"HETATM   31  H           1       0.383   9.550   1.649  1.00  0.00 \n"
+"HETATM   32  H           1      -1.796  10.663   1.198  1.00  0.00 \n"
+"HETATM   33  H           1      -2.043   9.083   1.978  1.00  0.00 \n"
+"HETATM   34  H           1      -2.315   9.264   0.229  1.00  0.00 \n"
+"HETATM   35  O           1       3.461   1.164   0.124  1.00  0.00 \n"
+"HETATM   36  C           1       3.859   0.886   1.450  1.00  0.00 \n"
+"HETATM   37  C           1       3.396   1.998   2.414  1.00  0.00 \n"
+"HETATM   38  H           1       4.947   0.824   1.480  1.00  0.00 \n"
+"HETATM   39  H           1       3.443  -0.069   1.771  1.00  0.00 \n"
+"HETATM   40  H           1       3.774   1.788   3.414  1.00  0.00 \n"
+"HETATM   41  H           1       2.307   2.037   2.446  1.00  0.00 \n"
+"HETATM   42  H           1       3.786   2.959   2.077  1.00  0.00 \n"
+"HETATM   43  S           1      -2.443   1.230   0.022  1.00  0.00 \n"
+"HETATM   44  N           1      -3.045  -0.296  -0.555  1.00  0.00 \n"
+"HETATM   45  C           1      -4.498  -0.382  -0.345  1.00  0.00 \n"
+"HETATM   46  C           1      -4.996  -1.765  -0.804  1.00  0.00 \n"
+"HETATM   47  N           1      -4.674  -1.957  -2.227  1.00  0.00 \n"
+"HETATM   48  C           1      -3.222  -1.855  -2.442  1.00  0.00 \n"
+"HETATM   49  C           1      -2.728  -0.471  -1.980  1.00  0.00 \n"
+"HETATM   50  H           1      -5.005   0.395  -0.919  1.00  0.00 \n"
+"HETATM   51  H           1      -4.725  -0.254   0.715  1.00  0.00 \n"
+"HETATM   52  H           1      -6.076  -1.822  -0.662  1.00  0.00 \n"
+"HETATM   53  H           1      -4.513  -2.539  -0.208  1.00  0.00 \n"
+"HETATM   54  H           1      -2.998  -1.979  -3.502  1.00  0.00 \n"
+"HETATM   55  H           1      -2.707  -2.629  -1.872  1.00  0.00 \n"
+"HETATM   56  H           1      -3.222   0.303  -2.569  1.00  0.00 \n"
+"HETATM   57  H           1      -1.651  -0.407  -2.135  1.00  0.00 \n"
+"HETATM   58  O           1      -2.929   2.282  -0.818  1.00  0.00 \n"
+"HETATM   59  O           1      -2.893   1.442   1.364  1.00  0.00 \n"
+"HETATM   60  C           1      -5.177  -3.257  -2.700  1.00  0.00 \n"
+"HETATM   61  H           1      -4.954  -3.372  -3.760  1.00  0.00 \n"
+"HETATM   62  H           1      -6.257  -3.305  -2.557  1.00  0.00 \n"
+"HETATM   63  H           1      -4.703  -4.065  -2.142  1.00  0.00 \n"
+"CONECT    1    2    2    6    7\n"
+"CONECT    2    1    1    3    8\n"
+"CONECT    3    2    4    4   35\n"
+"CONECT    4    3    3    5   10\n"
+"CONECT    5    4    6    6    9\n"
+"CONECT    6    1    5    5   43\n"
+"CONECT    7    1\n"
+"CONECT    8    2\n"
+"CONECT    9    5\n"
+"CONECT   10    4   11   15   15\n"
+"CONECT   11   10   12   17\n"
+"CONECT   12   11   13   16   16\n"
+"CONECT   13   12   14   14   18\n"
+"CONECT   14   13   13   15   20\n"
+"CONECT   15   10   14   14\n"
+"CONECT   16   12   12\n"
+"CONECT   17   11\n"
+"CONECT   18   13   19   21\n"
+"CONECT   19   18   20   20\n"
+"CONECT   20   14   19   19   25\n"
+"CONECT   21   18   22   23   24\n"
+"CONECT   22   21\n"
+"CONECT   23   21\n"
+"CONECT   24   21\n"
+"CONECT   25   20   26   27   28\n"
+"CONECT   26   25   29   30   31\n"
+"CONECT   27   25\n"
+"CONECT   28   25\n"
+"CONECT   29   26   32   33   34\n"
+"CONECT   30   26\n"
+"CONECT   31   26\n"
+"CONECT   32   29\n"
+"CONECT   33   29\n"
+"CONECT   34   29\n"
+"CONECT   35    3   36\n"
+"CONECT   36   35   37   38   39\n"
+"CONECT   37   36   40   41   42\n"
+"CONECT   38   36\n"
+"CONECT   39   36\n"
+"CONECT   40   37\n"
+"CONECT   41   37\n"
+"CONECT   42   37\n"
+"CONECT   43    6   44   58   59\n"
+"CONECT   44   43   45   49\n"
+"CONECT   45   44   46   50   51\n"
+"CONECT   46   45   47   52   53\n"
+"CONECT   47   46   48   60\n"
+"CONECT   48   47   49   54   55\n"
+"CONECT   49   44   48   56   57\n"
+"CONECT   50   45\n"
+"CONECT   51   45\n"
+"CONECT   52   46\n"
+"CONECT   53   46\n"
+"CONECT   54   48\n"
+"CONECT   55   48\n"
+"CONECT   56   49\n"
+"CONECT   57   49\n"
+"CONECT   58   43\n"
+"CONECT   59   43\n"
+"CONECT   60   47   61   62   63\n"
+"CONECT   61   60\n"
+"CONECT   62   60\n"
+"CONECT   63   60\n"
+"MASTER        0    0    0    0    0    0    0    0   63    0   63    0\n"
+"END\n"
+,
+"HEADER    Pyridoxine: Vitamin B6\n"
+"COMPND    c8h11no3\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.399   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       2.095   1.214   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       1.381   2.418   0.018  1.00  0.00 \n"
+"HETATM    5  C           1      -0.018   2.390   0.005  1.00  0.00 \n"
+"HETATM    6  N           1      -0.688   1.189  -0.006  1.00  0.00 \n"
+"HETATM    7  C           1      -0.754  -1.311   0.010  1.00  0.00 \n"
+"HETATM    8  O           1       2.079  -1.180   0.011  1.00  0.00 \n"
+"HETATM    9  C           1       3.608   1.210   0.001  1.00  0.00 \n"
+"HETATM   10  O           1       4.077   1.576   1.303  1.00  0.00 \n"
+"HETATM   11  C           1       2.102   3.747   0.058  1.00  0.00 \n"
+"HETATM   12  O           1       1.197   4.767   0.493  1.00  0.00 \n"
+"HETATM   13  H           1      -0.583   3.322   0.008  1.00  0.00 \n"
+"HETATM   14  H           1      -0.438  -1.905   0.867  1.00  0.00 \n"
+"HETATM   15  H           1      -0.543  -1.858  -0.909  1.00  0.00 \n"
+"HETATM   16  H           1      -1.824  -1.114   0.078  1.00  0.00 \n"
+"HETATM   17  H           1       2.145  -1.522  -0.886  1.00  0.00 \n"
+"HETATM   18  H           1       3.977   1.922  -0.737  1.00  0.00 \n"
+"HETATM   19  H           1       3.973   0.214  -0.250  1.00  0.00 \n"
+"HETATM   20  H           1       5.040   1.579   1.315  1.00  0.00 \n"
+"HETATM   21  H           1       2.472   3.988  -0.939  1.00  0.00 \n"
+"HETATM   22  H           1       2.940   3.690   0.753  1.00  0.00 \n"
+"HETATM   23  H           1       1.650   5.617   0.520  1.00  0.00 \n"
+"CONECT    1    2    6    7\n"
+"CONECT    1    2\n"
+"CONECT    2    1    3    8\n"
+"CONECT    3    2    4    9\n"
+"CONECT    3    4\n"
+"CONECT    4    3    5   11\n"
+"CONECT    5    4    6   13\n"
+"CONECT    5    6\n"
+"CONECT    6    1    5\n"
+"CONECT    7    1   14   15   16\n"
+"CONECT    8    2   17\n"
+"CONECT    9    3   10   18   19\n"
+"CONECT   10    9   20\n"
+"CONECT   11    4   12   21   22\n"
+"CONECT   12   11   23\n"
+"CONECT   13    5\n"
+"CONECT   14    7\n"
+"CONECT   15    7\n"
+"CONECT   16    7\n"
+"CONECT   17    8\n"
+"CONECT   18    9\n"
+"CONECT   19    9\n"
+"CONECT   20   10\n"
+"CONECT   21   11\n"
+"CONECT   22   11\n"
+"CONECT   23   12\n"
+"MASTER        0    0    0    0    0    0    0    0   23    0   23    0\n"
+"END\n"
+,
+"HEADER    Ascorbic Acid: Vitamin C\n"
+"COMPND    vit-c\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.512   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  C           1       1.927   1.264   0.000  1.00  0.00 \n"
+"HETATM    4  C           1       0.730   2.091   0.015  1.00  0.00 \n"
+"HETATM    5  O           1      -0.382   1.359   0.113  1.00  0.00 \n"
+"HETATM    6  O           1       0.759   3.270   0.261  1.00  0.00 \n"
+"HETATM    7  O           1       3.197   1.690   0.245  1.00  0.00 \n"
+"HETATM    8  O           1       2.283  -1.055   0.386  1.00  0.00 \n"
+"HETATM    9  H           1      -0.390  -0.463  -0.907  1.00  0.00 \n"
+"HETATM   10  C           1      -0.565  -0.653   1.264  1.00  0.00 \n"
+"HETATM   11  H           1       0.050  -1.475   1.629  1.00  0.00 \n"
+"HETATM   12  O           1      -0.674   0.397   2.229  1.00  0.00 \n"
+"HETATM   13  C           1      -2.028  -1.077   1.106  1.00  0.00 \n"
+"HETATM   14  O           1      -2.543  -0.906   2.429  1.00  0.00 \n"
+"HETATM   15  H           1       3.383   1.620   1.187  1.00  0.00 \n"
+"HETATM   16  H           1       2.156  -1.784  -0.228  1.00  0.00 \n"
+"HETATM   17  H           1      -0.774   1.222   1.738  1.00  0.00 \n"
+"HETATM   18  H           1      -2.112  -2.110   0.766  1.00  0.00 \n"
+"HETATM   19  H           1      -2.545  -0.402   0.425  1.00  0.00 \n"
+"HETATM   20  H           1      -2.081  -0.175   2.830  1.00  0.00 \n"
+"CONECT    1    2    5    9   10\n"
+"CONECT    2    1    3    8\n"
+"CONECT    3    2    4    7\n"
+"CONECT    4    3    5    6    6\n"
+"CONECT    5    1    4\n"
+"CONECT    6    4    4\n"
+"CONECT    7    3   15\n"
+"CONECT    8    2   16\n"
+"CONECT    9    1\n"
+"CONECT   10    1   11   12   13\n"
+"CONECT   11   10\n"
+"CONECT   12   10   17\n"
+"CONECT   13   10   14   18   19\n"
+"CONECT   14   13   20\n"
+"CONECT   15    7\n"
+"CONECT   16    8\n"
+"CONECT   17   12\n"
+"CONECT   18   13\n"
+"CONECT   19   13\n"
+"CONECT   20   14\n"
+"MASTER        0    0    0    0    0    0    0    0   20    0   20    0\n"
+"END\n"
+,
+"HEADER    VX: a chemical warfare agent, cholinesterase inhibitor\n"
+"COMPND    VX\n"
+"AUTHOR    Created by Dave Woodcock at Okanagan University College\n"
+"AUTHOR    email:woodcock@okanagan.bc.ca\n"
+"AUTHOR    Date revised: Fri Sep  1 09:41:05 2000  GENERATED BY BABEL 1.6 \n"
+"HETATM    1  C           1       0.000   0.000   0.000  1.00  0.00 \n"
+"HETATM    2  C           1       1.541   0.000   0.000  1.00  0.00 \n"
+"HETATM    3  O           1       2.000   1.333   0.000  1.00  0.00 \n"
+"HETATM    4  P           1       3.580   1.768  -0.723  1.00  0.00 \n"
+"HETATM    5  O           1       3.908   3.507  -0.453  1.00  0.00 \n"
+"HETATM    6  C           1       3.536   1.434  -2.522  1.00  0.00 \n"
+"HETATM    7  S           1       5.089   0.633   0.149  1.00  0.00 \n"
+"HETATM    8  C           1       6.652   1.113  -0.581  1.00  0.00 \n"
+"HETATM    9  C           1       7.173   2.394   0.105  1.00  0.00 \n"
+"HETATM   10  N           1       8.475   2.827  -0.436  1.00  0.00 \n"
+"HETATM   11  C           1       9.247   3.677   0.492  1.00  0.00 \n"
+"HETATM   12  C           1       9.948   2.776   1.531  1.00  0.00 \n"
+"HETATM   13  C           1       8.388   4.729   1.230  1.00  0.00 \n"
+"HETATM   14  C           1       8.465   3.210  -1.863  1.00  0.00 \n"
+"HETATM   15  C           1       9.881   3.493  -2.414  1.00  0.00 \n"
+"HETATM   16  C           1       7.562   4.422  -2.181  1.00  0.00 \n"
+"HETATM   17  H           1      -0.362   0.520   0.887  1.00  0.00 \n"
+"HETATM   18  H           1      -0.367  -1.026   0.006  1.00  0.00 \n"
+"HETATM   19  H           1      -0.363   0.510  -0.892  1.00  0.00 \n"
+"HETATM   20  H           1       1.902  -0.524  -0.885  1.00  0.00 \n"
+"HETATM   21  H           1       1.904  -0.507   0.894  1.00  0.00 \n"
+"HETATM   22  H           1       2.728   2.007  -2.976  1.00  0.00 \n"
+"HETATM   23  H           1       3.367   0.370  -2.691  1.00  0.00 \n"
+"HETATM   24  H           1       4.485   1.727  -2.970  1.00  0.00 \n"
+"HETATM   25  H           1       6.489   1.278  -1.644  1.00  0.00 \n"
+"HETATM   26  H           1       7.377   0.311  -0.444  1.00  0.00 \n"
+"HETATM   27  H           1       7.282   2.161   1.162  1.00  0.00 \n"
+"HETATM   28  H           1       6.438   3.191   0.006  1.00  0.00 \n"
+"HETATM   29  H           1      10.030   4.205  -0.044  1.00  0.00 \n"
+"HETATM   30  H           1      10.539   2.021   1.012  1.00  0.00 \n"
+"HETATM   31  H           1       9.216   2.282   2.169  1.00  0.00 \n"
+"HETATM   32  H           1      10.608   3.383   2.151  1.00  0.00 \n"
+"HETATM   33  H           1       9.041   5.368   1.825  1.00  0.00 \n"
+"HETATM   34  H           1       7.675   4.243   1.895  1.00  0.00 \n"
+"HETATM   35  H           1       7.847   5.345   0.515  1.00  0.00 \n"
+"HETATM   36  H           1       8.094   2.362  -2.434  1.00  0.00 \n"
+"HETATM   37  H           1      10.574   2.735  -2.048  1.00  0.00 \n"
+"HETATM   38  H           1      10.223   4.483  -2.116  1.00  0.00 \n"
+"HETATM   39  H           1       9.853   3.454  -3.503  1.00  0.00 \n"
+"HETATM   40  H           1       7.928   5.308  -1.665  1.00  0.00 \n"
+"HETATM   41  H           1       6.533   4.222  -1.886  1.00  0.00 \n"
+"HETATM   42  H           1       7.584   4.609  -3.255  1.00  0.00 \n"
+"CONECT    1    2   17   18   19\n"
+"CONECT    2    1    3   20   21\n"
+"CONECT    3    2    4\n"
+"CONECT    4    3    5    6    7\n"
+"CONECT    4    5\n"
+"CONECT    5    4\n"
+"CONECT    6    4   22   23   24\n"
+"CONECT    7    4    8\n"
+"CONECT    8    7    9   25   26\n"
+"CONECT    9    8   10   27   28\n"
+"CONECT   10    9   11   14\n"
+"CONECT   11   10   12   13   29\n"
+"CONECT   12   11   30   31   32\n"
+"CONECT   13   11   33   34   35\n"
+"CONECT   14   10   15   16   36\n"
+"CONECT   15   14   37   38   39\n"
+"CONECT   16   14   40   41   42\n"
+"CONECT   17    1\n"
+"CONECT   18    1\n"
+"CONECT   19    1\n"
+"CONECT   20    2\n"
+"CONECT   21    2\n"
+"CONECT   22    6\n"
+"CONECT   23    6\n"
+"CONECT   24    6\n"
+"CONECT   25    8\n"
+"CONECT   26    8\n"
+"CONECT   27    9\n"
+"CONECT   28    9\n"
+"CONECT   29   11\n"
+"CONECT   30   12\n"
+"CONECT   31   12\n"
+"CONECT   32   12\n"
+"CONECT   33   13\n"
+"CONECT   34   13\n"
+"CONECT   35   13\n"
+"CONECT   36   14\n"
+"CONECT   37   15\n"
+"CONECT   38   15\n"
+"CONECT   39   15\n"
+"CONECT   40   16\n"
+"CONECT   41   16\n"
+"CONECT   42   16\n"
+"MASTER        0    0    0    0    0    0    0    0   42    0   42    0\n"
+"END\n"
+,
diff --git a/modes/glx/morph3d.c b/modes/glx/morph3d.c
new file mode 100644 (file)
index 0000000..6e3d191
--- /dev/null
@@ -0,0 +1,919 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* morph3d --- Shows 3D morphing objects */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)morph3d.c    5.01 2001/03/01 xlockmore";
+
+#endif
+
+#undef DEBUG_CULL_FACE
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by Marcelo Fernandes Vianna
+ * (me...) and was inspired on a WindowsNT(R)'s screen saver (Flower Box).
+ * It was written from scratch and it was not based on any other source code.
+ *
+ * Porting it to xlock (the final objective of this code since the moment I
+ * decided to create it) was possible by comparing the original Mesa's gear
+ * demo with it's ported version to xlock, so thanks for Danny Sung (look at
+ * gear.c) for his indirect help.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * If you are interested in the original version of this program (not a xlock
+ * mode, please refer to the Mesa package (ftp iris.ssec.wisc.edu on /pub/Mesa)
+ *
+ * Since I'm not a native English speaker, my apologies for any grammatical
+ * mistakes.
+ *
+ * My e-mail address is
+ * m-vianna@usa.net
+ *
+ * Marcelo F. Vianna (Feb-13-1997)
+ *
+ * Revision History:
+ * 01-Mar-2001: Added FPS stuff E.Lassauge <lassauge@mail.dotcom.fr>
+ * 27-Jul-1997: Speed ups by Marcelo F. Vianna.
+ * 08-May-1997: Speed ups by Marcelo F. Vianna.
+ *
+ */
+
+/*-
+ * PURIFY 3.0a on SunOS4 reports an unitialized memory read on each of
+ * the glCallList() functions below when using MesaGL 2.1.  This has
+ * been fixed in MesaGL 2.2 and later releases.
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "Morph3d"
+#define HACK_INIT init_morph3d
+#define HACK_DRAW draw_morph3d
+#define morph3d_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*count: 0 \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_moebius
+
+ModeSpecOpt morph3d_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   morph3d_description =
+{"morph3d", "init_morph3d", "draw_morph3d", "release_morph3d",
+ "draw_morph3d", "change_morph3d", NULL, &morph3d_opts,
+ 1000, 0, 1, 1, 4, 1.0, "",
+ "Shows GL morphing polyhedra", 0, NULL};
+
+#endif
+
+#define Scale4Window               0.3
+#define Scale4Iconic               1.0
+
+#define VectMul(X1,Y1,Z1,X2,Y2,Z2) (Y1)*(Z2)-(Z1)*(Y2),(Z1)*(X2)-(X1)*(Z2),(X1)*(Y2)-(Y1)*(X2)
+#define sqr(A)                     ((A)*(A))
+
+/* Increasing this values produces better image quality, the price is speed. */
+#define tetradivisions             23
+#define cubedivisions              20
+#define octadivisions              21
+#define dodecadivisions            10
+#define icodivisions               15
+
+#define tetraangle                 109.47122063449069174
+#define cubeangle                  90.000000000000000000
+#define octaangle                  109.47122063449069174
+#define dodecaangle                63.434948822922009981
+#define icoangle                   41.810314895778596167
+
+#ifndef Pi
+#define Pi                         M_PI
+#endif
+#define SQRT2                      1.4142135623730951455
+#define SQRT3                      1.7320508075688771932
+#define SQRT5                      2.2360679774997898051
+#define SQRT6                      2.4494897427831778813
+#define SQRT15                     3.8729833462074170214
+#define cossec36_2                 0.8506508083520399322
+#define cos72                      0.3090169943749474241
+#define sin72                      0.9510565162951535721
+#define cos36                      0.8090169943749474241
+#define sin36                      0.5877852522924731292
+
+/*************************************************************************/
+
+typedef struct {
+       GLint       WindH, WindW;
+       GLfloat     step;
+       GLfloat     seno;
+       int         object;
+       int         edgedivisions;
+       int         VisibleSpikes;
+       void        (*draw_object) (ModeInfo * mi);
+       float       Magnitude;
+       float      *MaterialColor[20];
+       GLXContext *glx_context;
+} morph3dstruct;
+
+static float front_shininess[] =
+{60.0};
+static float front_specular[] =
+{0.7, 0.7, 0.7, 1.0};
+static float ambient[] =
+{0.0, 0.0, 0.0, 1.0};
+static float diffuse[] =
+{1.0, 1.0, 1.0, 1.0};
+static float position0[] =
+{1.0, 1.0, 1.0, 0.0};
+static float position1[] =
+{-1.0, -1.0, 1.0, 0.0};
+static float lmodel_ambient[] =
+{0.5, 0.5, 0.5, 1.0};
+static float lmodel_twoside[] =
+{GL_TRUE};
+
+static float MaterialRed[] =
+{0.7, 0.0, 0.0, 1.0};
+static float MaterialGreen[] =
+{0.1, 0.5, 0.2, 1.0};
+static float MaterialBlue[] =
+{0.0, 0.0, 0.7, 1.0};
+static float MaterialCyan[] =
+{0.2, 0.5, 0.7, 1.0};
+static float MaterialYellow[] =
+{0.7, 0.7, 0.0, 1.0};
+static float MaterialMagenta[] =
+{0.6, 0.2, 0.5, 1.0};
+static float MaterialWhite[] =
+{0.7, 0.7, 0.7, 1.0};
+static float MaterialGray[] =
+{0.5, 0.5, 0.5, 1.0};
+
+static morph3dstruct *morph3d = (morph3dstruct *) NULL;
+
+#define TRIANGLE(Edge, Amp, Divisions, Z, VS)                                                                    \
+{                                                                                                                \
+  GLfloat   Xf,Yf,Xa,Yb=0.0,Xf2=0.0,Yf2=0.0,Yf_2=0.0,Yb2,Yb_2;                                                   \
+  GLfloat   Factor=0.0,Factor1,Factor2;                                                                          \
+  GLfloat   VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ;                                               \
+  GLfloat   Ax,Ay;                                                                                               \
+  int       Ri,Ti;                                                                                               \
+  GLfloat   Vr=(Edge)*SQRT3/3;                                                                                   \
+  GLfloat   AmpVr2=(Amp)/sqr(Vr);                                                                                \
+  GLfloat   Zf=(Edge)*(Z);                                                                                       \
+                                                                                                                 \
+  Ax=(Edge)*(+0.5/(Divisions)), Ay=(Edge)*(-SQRT3/(2*Divisions));                                                \
+                                                                                                                 \
+  Yf=Vr+Ay; Yb=Yf+0.001;                                                                                         \
+  for (Ri=1; Ri<=(Divisions); Ri++) {                                                                            \
+    glBegin(GL_TRIANGLE_STRIP);                                                                                  \
+    Xf=(float)Ri*Ax; Xa=Xf+0.001;                                                                                \
+    Yf2=sqr(Yf); Yf_2=sqr(Yf-Ay);                                                                                \
+    Yb2=sqr(Yb); Yb_2=sqr(Yb-Ay);                                                                                \
+    for (Ti=0; Ti<Ri; Ti++) {                                                                                    \
+      Factor=1-(((Xf2=sqr(Xf))+Yf2)*AmpVr2);                                                                     \
+      Factor1=1-((sqr(Xa)+Yf2)*AmpVr2);                                                                          \
+      Factor2=1-((Xf2+Yb2)*AmpVr2);                                                                              \
+      VertX=Factor*Xf;        VertY=Factor*Yf;        VertZ=Factor*Zf;                                           \
+      NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ;                                    \
+      NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                    \
+      glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                             \
+      glVertex3f(VertX, VertY, VertZ);                                                                           \
+                                                                                                                 \
+      Xf-=Ax; Yf-=Ay; Xa-=Ax; Yb-=Ay;                                                                            \
+                                                                                                                 \
+      Factor=1-(((Xf2=sqr(Xf))+Yf_2)*AmpVr2);                                                                    \
+      Factor1=1-((sqr(Xa)+Yf_2)*AmpVr2);                                                                         \
+      Factor2=1-((Xf2+Yb_2)*AmpVr2);                                                                             \
+      VertX=Factor*Xf;        VertY=Factor*Yf;        VertZ=Factor*Zf;                                           \
+      NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ;                                    \
+      NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                    \
+      glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                             \
+      glVertex3f(VertX, VertY, VertZ);                                                                           \
+                                                                                                                 \
+      Xf-=Ax; Yf+=Ay; Xa-=Ax; Yb+=Ay;                                                                            \
+    }                                                                                                            \
+    Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2);                                                             \
+    Factor1=1-((sqr(Xa)+Yf2)*AmpVr2);                                                                            \
+    Factor2=1-((Xf2+sqr(Yb))*AmpVr2);                                                                            \
+    VertX=Factor*Xf;        VertY=Factor*Yf;        VertZ=Factor*Zf;                                             \
+    NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ;                                      \
+    NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                      \
+    glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                               \
+    glVertex3f(VertX, VertY, VertZ);                                                                             \
+    Yf+=Ay; Yb+=Ay;                                                                                              \
+    glEnd();                                                                                                     \
+  }                                                                                                              \
+  VS=(Factor<0);                                                                                                 \
+}
+
+#define SQUARE(Edge, Amp, Divisions, Z, VS)                                                                      \
+{                                                                                                                \
+  int       Xi,Yi;                                                                                               \
+  GLfloat   Xf,Yf,Y,Xf2,Yf2,Y2,Xa,Xa2,Yb;                                                                        \
+  GLfloat   Factor=0.0,Factor1,Factor2;                                                                          \
+  GLfloat   VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ;                                               \
+  GLfloat   Zf=(Edge)*(Z);                                                                                       \
+  GLfloat   AmpVr2=(Amp)/sqr((Edge)*SQRT2/2);                                                                    \
+                                                                                                                 \
+  for (Yi=0; Yi<(Divisions); Yi++) {                                                                             \
+    Yf=-((Edge)/2.0) + ((float)Yi)/(Divisions)*(Edge);                                                           \
+    Yf2=sqr(Yf);                                                                                                 \
+    Y=Yf+1.0/(Divisions)*(Edge);                                                                                 \
+    Y2=sqr(Y);                                                                                                   \
+    glBegin(GL_QUAD_STRIP);                                                                                      \
+    for (Xi=0; Xi<=(Divisions); Xi++) {                                                                          \
+      Xf=-((Edge)/2.0) + ((float)Xi)/(Divisions)*(Edge);                                                         \
+      Xf2=sqr(Xf);                                                                                               \
+                                                                                                                 \
+      Xa=Xf+0.001; Yb=Y+0.001;                                                                                   \
+      Factor=1-((Xf2+Y2)*AmpVr2);                                                                                \
+      Factor1=1-(((Xa2=sqr(Xa))+Y2)*AmpVr2);                                                                     \
+      Factor2=1-((Xf2+sqr(Yb))*AmpVr2);                                                                          \
+      VertX=Factor*Xf;        VertY=Factor*Y;         VertZ=Factor*Zf;                                           \
+      NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Y-VertY;  NeiAZ=Factor1*Zf-VertZ;                                    \
+      NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                    \
+      glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                             \
+      glVertex3f(VertX, VertY, VertZ);                                                                           \
+                                                                                                                 \
+      Yb=Yf+0.001;                                                                                               \
+      Factor=1-((Xf2+Yf2)*AmpVr2);                                                                               \
+      Factor1=1-((Xa2+Yf2)*AmpVr2);                                                                              \
+      Factor2=1-((Xf2+sqr(Yb))*AmpVr2);                                                                          \
+      VertX=Factor*Xf;        VertY=Factor*Yf;        VertZ=Factor*Zf;                                           \
+      NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ;                                    \
+      NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                    \
+      glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                             \
+      glVertex3f(VertX, VertY, VertZ);                                                                           \
+    }                                                                                                            \
+    glEnd();                                                                                                     \
+  }                                                                                                              \
+  VS=(Factor<0);                                                                                                 \
+}
+
+#define PENTAGON(Edge, Amp, Divisions, Z, VS)                                                                    \
+{                                                                                                                \
+  int       Ri,Ti,Fi;                                                                                            \
+  GLfloat   Xf,Yf,Xa,Yb,Xf2,Yf2;                                                                                 \
+  GLfloat   Factor=0.0,Factor1,Factor2;                                                                          \
+  GLfloat   VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ;                                               \
+  GLfloat   Zf=(Edge)*(Z);                                                                                       \
+  GLfloat   AmpVr2=(Amp)/sqr((Edge)*cossec36_2);                                                                 \
+                                                                                                                 \
+  static    GLfloat x[6],y[6];                                                                                   \
+  static    int arrayninit=1;                                                                                    \
+                                                                                                                 \
+  if (arrayninit) {                                                                                              \
+    for(Fi=0;Fi<6;Fi++) {                                                                                        \
+      x[Fi]=-cos( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge);                                             \
+      y[Fi]=sin( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge);                                              \
+    }                                                                                                            \
+    arrayninit=0;                                                                                                \
+  }                                                                                                              \
+                                                                                                                 \
+  for (Ri=1; Ri<=(Divisions); Ri++) {                                                                            \
+    for (Fi=0; Fi<5; Fi++) {                                                                                     \
+      glBegin(GL_TRIANGLE_STRIP);                                                                                \
+      for (Ti=0; Ti<Ri; Ti++) {                                                                                  \
+        Xf=(float)(Ri-Ti)*x[Fi] + (float)Ti*x[Fi+1];                                                             \
+        Yf=(float)(Ri-Ti)*y[Fi] + (float)Ti*y[Fi+1];                                                             \
+        Xa=Xf+0.001; Yb=Yf+0.001;                                                                                \
+       Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2);                                                         \
+       Factor1=1-((sqr(Xa)+Yf2)*AmpVr2);                                                                        \
+       Factor2=1-((Xf2+sqr(Yb))*AmpVr2);                                                                        \
+        VertX=Factor*Xf;        VertY=Factor*Yf;        VertZ=Factor*Zf;                                         \
+        NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ;                                  \
+        NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                  \
+        glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                           \
+       glVertex3f(VertX, VertY, VertZ);                                                                         \
+                                                                                                                 \
+        Xf-=x[Fi]; Yf-=y[Fi]; Xa-=x[Fi]; Yb-=y[Fi];                                                              \
+                                                                                                                 \
+       Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2);                                                         \
+       Factor1=1-((sqr(Xa)+Yf2)*AmpVr2);                                                                        \
+       Factor2=1-((Xf2+sqr(Yb))*AmpVr2);                                                                        \
+        VertX=Factor*Xf;        VertY=Factor*Yf;        VertZ=Factor*Zf;                                         \
+        NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ;                                  \
+        NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                  \
+        glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                           \
+       glVertex3f(VertX, VertY, VertZ);                                                                         \
+                                                                                                                 \
+      }                                                                                                          \
+      Xf=(float)Ri*x[Fi+1];                                                                                      \
+      Yf=(float)Ri*y[Fi+1];                                                                                      \
+      Xa=Xf+0.001; Yb=Yf+0.001;                                                                                  \
+      Factor=1-(((Xf2=sqr(Xf))+(Yf2=sqr(Yf)))*AmpVr2);                                                           \
+      Factor1=1-((sqr(Xa)+Yf2)*AmpVr2);                                                                          \
+      Factor2=1-((Xf2+sqr(Yb))*AmpVr2);                                                                          \
+      VertX=Factor*Xf;        VertY=Factor*Yf;        VertZ=Factor*Zf;                                           \
+      NeiAX=Factor1*Xa-VertX; NeiAY=Factor1*Yf-VertY; NeiAZ=Factor1*Zf-VertZ;                                    \
+      NeiBX=Factor2*Xf-VertX; NeiBY=Factor2*Yb-VertY; NeiBZ=Factor2*Zf-VertZ;                                    \
+      glNormal3f(VectMul(NeiAX, NeiAY, NeiAZ, NeiBX, NeiBY, NeiBZ));                                             \
+      glVertex3f(VertX, VertY, VertZ);                                                                           \
+      glEnd();                                                                                                   \
+    }                                                                                                            \
+  }                                                                                                              \
+  VS=(Factor<0);                                                                                             \
+}
+
+static void
+draw_tetra(ModeInfo * mi)
+{
+       GLuint      list;
+
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
+
+       if ((list = glGenLists(1)) == 0)
+               return;
+       glNewList(list, GL_COMPILE_AND_EXECUTE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(list, 1);
+               return;
+       }
+       TRIANGLE(2, mp->seno, mp->edgedivisions, 0.5 / SQRT6, mp->VisibleSpikes);
+       glEndList();
+
+       glPushMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-tetraangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + tetraangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + tetraangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
+       glCallList(list);
+
+       glDeleteLists(list, 1);
+}
+
+static void
+draw_cube(ModeInfo * mi)
+{
+       GLuint      list;
+
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
+
+       if ((list = glGenLists(1)) == 0)
+               return;
+       glNewList(list, GL_COMPILE_AND_EXECUTE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(list, 1);
+               return;
+       }
+       SQUARE(2, mp->seno, mp->edgedivisions, 0.5, mp->VisibleSpikes)
+               glEndList();
+
+       glRotatef(cubeangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
+       glCallList(list);
+       glRotatef(cubeangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
+       glCallList(list);
+       glRotatef(cubeangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
+       glCallList(list);
+       glRotatef(cubeangle, 0, 1, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
+       glCallList(list);
+       glRotatef(2 * cubeangle, 0, 1, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
+       glCallList(list);
+
+       glDeleteLists(list, 1);
+}
+
+static void
+draw_octa(ModeInfo * mi)
+{
+       GLuint      list;
+
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
+
+       if ((list = glGenLists(1)) == 0)
+               return;
+       glNewList(list, GL_COMPILE_AND_EXECUTE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(list, 1);
+               return;
+       }
+       TRIANGLE(2, mp->seno, mp->edgedivisions, 1 / SQRT6, mp->VisibleSpikes);
+       glEndList();
+
+       glPushMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-180 + octaangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-octaangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-octaangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-180 + octaangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-octaangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[6]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-octaangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[7]);
+       glCallList(list);
+
+       glDeleteLists(list, 1);
+}
+
+static void
+draw_dodeca(ModeInfo * mi)
+{
+       GLuint      list;
+
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+#define TAU ((SQRT5+1)/2)
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
+
+       if ((list = glGenLists(1)) == 0)
+               return;
+       glNewList(list, GL_COMPILE_AND_EXECUTE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(list, 1);
+               return;
+       }
+       PENTAGON(1, mp->seno, mp->edgedivisions, sqr(TAU) * sqrt((TAU + 2) / 5) / 2, mp->VisibleSpikes);
+       glEndList();
+
+       glPushMatrix();
+       glRotatef(180, 0, 0, 1);
+       glPushMatrix();
+       glRotatef(-dodecaangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(-dodecaangle, cos72, sin72, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(-dodecaangle, cos72, -sin72, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(dodecaangle, cos36, -sin36, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(dodecaangle, cos36, sin36, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[6]);
+       glCallList(list);
+       glRotatef(180, 0, 0, 1);
+       glPushMatrix();
+       glRotatef(-dodecaangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[7]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(-dodecaangle, cos72, sin72, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[8]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(-dodecaangle, cos72, -sin72, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[9]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(dodecaangle, cos36, -sin36, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[10]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(dodecaangle, cos36, sin36, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[11]);
+       glCallList(list);
+
+       glDeleteLists(list, 1);
+}
+
+static void
+draw_icosa(ModeInfo * mi)
+{
+       GLuint      list;
+
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[0]);
+
+       if ((list = glGenLists(1)) == 0)
+               return;
+       glNewList(list, GL_COMPILE_AND_EXECUTE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(list, 1);
+               return;
+       }
+       TRIANGLE(1.5, mp->seno, mp->edgedivisions, (3 * SQRT3 + SQRT15) / 12, mp->VisibleSpikes);
+       glEndList();
+
+       glPushMatrix();
+
+       glPushMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-icoangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[1]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[2]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[3]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[4]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[5]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-icoangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[6]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[7]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[8]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-icoangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[9]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[10]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-icoangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[11]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[12]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[13]);
+       glCallList(list);
+       glPopMatrix();
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[14]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[15]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-icoangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[16]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[17]);
+       glCallList(list);
+       glPushMatrix();
+       glRotatef(180, 0, 1, 0);
+       glRotatef(-180 + icoangle, 0.5, -SQRT3 / 2, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[18]);
+       glCallList(list);
+       glPopMatrix();
+       glRotatef(180, 0, 0, 1);
+       glRotatef(-icoangle, 1, 0, 0);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mp->MaterialColor[19]);
+       glCallList(list);
+
+       glDeleteLists(list, 1);
+}
+
+static void
+reshape(ModeInfo * mi, int width, int height)
+{
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+       glViewport(0, 0, mp->WindW = (GLint) width, mp->WindH = (GLint) height);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
+       glMatrixMode(GL_MODELVIEW);
+}
+
+static void
+pinit(ModeInfo * mi)
+{
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+       glClearDepth(1.0);
+       glClearColor(0.0, 0.0, 0.0, 1.0);
+       glColor3f(1.0, 1.0, 1.0);
+
+       glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT0, GL_POSITION, position0);
+       glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT1, GL_POSITION, position1);
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+       glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_DEPTH_TEST);
+       glEnable(GL_NORMALIZE);
+
+       glShadeModel(GL_SMOOTH);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
+
+       switch (mp->object) {
+               case 2:
+                       mp->draw_object = draw_cube;
+                       mp->MaterialColor[0] = MaterialRed;
+                       mp->MaterialColor[1] = MaterialGreen;
+                       mp->MaterialColor[2] = MaterialCyan;
+                       mp->MaterialColor[3] = MaterialMagenta;
+                       mp->MaterialColor[4] = MaterialYellow;
+                       mp->MaterialColor[5] = MaterialBlue;
+                       mp->edgedivisions = cubedivisions;
+                       mp->Magnitude = 2.0;
+                       break;
+               case 3:
+                       mp->draw_object = draw_octa;
+                       mp->MaterialColor[0] = MaterialRed;
+                       mp->MaterialColor[1] = MaterialGreen;
+                       mp->MaterialColor[2] = MaterialBlue;
+                       mp->MaterialColor[3] = MaterialWhite;
+                       mp->MaterialColor[4] = MaterialCyan;
+                       mp->MaterialColor[5] = MaterialMagenta;
+                       mp->MaterialColor[6] = MaterialGray;
+                       mp->MaterialColor[7] = MaterialYellow;
+                       mp->edgedivisions = octadivisions;
+                       mp->Magnitude = 2.5;
+                       break;
+               case 4:
+                       mp->draw_object = draw_dodeca;
+                       mp->MaterialColor[0] = MaterialRed;
+                       mp->MaterialColor[1] = MaterialGreen;
+                       mp->MaterialColor[2] = MaterialCyan;
+                       mp->MaterialColor[3] = MaterialBlue;
+                       mp->MaterialColor[4] = MaterialMagenta;
+                       mp->MaterialColor[5] = MaterialYellow;
+                       mp->MaterialColor[6] = MaterialGreen;
+                       mp->MaterialColor[7] = MaterialCyan;
+                       mp->MaterialColor[8] = MaterialRed;
+                       mp->MaterialColor[9] = MaterialMagenta;
+                       mp->MaterialColor[10] = MaterialBlue;
+                       mp->MaterialColor[11] = MaterialYellow;
+                       mp->edgedivisions = dodecadivisions;
+                       mp->Magnitude = 2.0;
+                       break;
+               case 5:
+                       mp->draw_object = draw_icosa;
+                       mp->MaterialColor[0] = MaterialRed;
+                       mp->MaterialColor[1] = MaterialGreen;
+                       mp->MaterialColor[2] = MaterialBlue;
+                       mp->MaterialColor[3] = MaterialCyan;
+                       mp->MaterialColor[4] = MaterialYellow;
+                       mp->MaterialColor[5] = MaterialMagenta;
+                       mp->MaterialColor[6] = MaterialRed;
+                       mp->MaterialColor[7] = MaterialGreen;
+                       mp->MaterialColor[8] = MaterialBlue;
+                       mp->MaterialColor[9] = MaterialWhite;
+                       mp->MaterialColor[10] = MaterialCyan;
+                       mp->MaterialColor[11] = MaterialYellow;
+                       mp->MaterialColor[12] = MaterialMagenta;
+                       mp->MaterialColor[13] = MaterialRed;
+                       mp->MaterialColor[14] = MaterialGreen;
+                       mp->MaterialColor[15] = MaterialBlue;
+                       mp->MaterialColor[16] = MaterialCyan;
+                       mp->MaterialColor[17] = MaterialYellow;
+                       mp->MaterialColor[18] = MaterialMagenta;
+                       mp->MaterialColor[19] = MaterialGray;
+                       mp->edgedivisions = icodivisions;
+                       mp->Magnitude = 2.5;
+                       break;
+               default:
+                       mp->draw_object = draw_tetra;
+                       mp->MaterialColor[0] = MaterialRed;
+                       mp->MaterialColor[1] = MaterialGreen;
+                       mp->MaterialColor[2] = MaterialBlue;
+                       mp->MaterialColor[3] = MaterialWhite;
+                       mp->edgedivisions = tetradivisions;
+                       mp->Magnitude = 2.5;
+                       break;
+       }
+       if (MI_IS_MONO(mi)) {
+               int         loop;
+
+               for (loop = 0; loop < 20; loop++)
+                       mp->MaterialColor[loop] = MaterialGray;
+       }
+}
+
+void
+init_morph3d(ModeInfo * mi)
+{
+       morph3dstruct *mp;
+
+       if (morph3d == NULL) {
+               if ((morph3d = (morph3dstruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (morph3dstruct))) == NULL)
+                       return;
+       }
+       mp = &morph3d[MI_SCREEN(mi)];
+       mp->step = NRAND(90);
+       mp->VisibleSpikes = 1;
+
+       if ((mp->glx_context = init_GL(mi)) != NULL) {
+
+               reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               glDrawBuffer(GL_BACK);
+               mp->object = MI_COUNT(mi);
+               if (mp->object <= 0 || mp->object > 5)
+                       mp->object = NRAND(5) + 1;
+               pinit(mi);
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_morph3d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       morph3dstruct *mp;
+
+       if (morph3d == NULL)
+               return;
+       mp = &morph3d[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (!mp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(mp->glx_context));
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, -10.0);
+
+       if (!MI_IS_ICONIC(mi)) {
+               glScalef(Scale4Window * mp->WindH / mp->WindW, Scale4Window, Scale4Window);
+               glTranslatef(2.5 * mp->WindW / mp->WindH * sin(mp->step * 1.11), 2.5 * cos(mp->step * 1.25 * 1.11), 0);
+       } else {
+               glScalef(Scale4Iconic * mp->WindH / mp->WindW, Scale4Iconic, Scale4Iconic);
+       }
+
+       glRotatef(mp->step * 100, 1, 0, 0);
+       glRotatef(mp->step * 95, 0, 1, 0);
+       glRotatef(mp->step * 90, 0, 0, 1);
+
+       mp->seno = (sin(mp->step) + 1.0 / 3.0) * (4.0 / 5.0) * mp->Magnitude;
+
+       if (mp->VisibleSpikes) {
+#ifdef DEBUG_CULL_FACE
+               int         loop;
+
+               for (loop = 0; loop < 20; loop++)
+                       mp->MaterialColor[loop] = MaterialGray;
+#endif
+               glDisable(GL_CULL_FACE);
+       } else {
+#ifdef DEBUG_CULL_FACE
+               int         loop;
+
+               for (loop = 0; loop < 20; loop++)
+                       mp->MaterialColor[loop] = MaterialWhite;
+#endif
+               glEnable(GL_CULL_FACE);
+       }
+
+       mp->draw_object(mi);
+
+       glPopMatrix();
+
+       glFlush();
+       if (MI_IS_FPS(mi)) do_fps (mi);
+       glXSwapBuffers(display, window);
+
+       mp->step += 0.05;
+}
+
+void
+change_morph3d(ModeInfo * mi)
+{
+       morph3dstruct *mp = &morph3d[MI_SCREEN(mi)];
+
+       if (!mp->glx_context)
+               return;
+
+       mp->object = (mp->object) % 5 + 1;
+       pinit(mi);
+}
+
+void
+release_morph3d(ModeInfo * mi)
+{
+       if (morph3d != NULL) {
+               (void) free((void *) morph3d);
+               morph3d = (morph3dstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+#endif
diff --git a/modes/glx/pipeobjs.c b/modes/glx/pipeobjs.c
new file mode 100644 (file)
index 0000000..3e2179e
--- /dev/null
@@ -0,0 +1,3267 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)pipeobjs.c   4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points, polygons, and normal vectors to render objects for pipes.
+ *
+ * Generated by lw2ogl.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_pipes
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat BigValve_PNTS[] =
+{
+       (GLfloat) 0.756788, (GLfloat) 0.614672, (GLfloat) - 0.000000,
+       (GLfloat) 0.779498, (GLfloat) 0.599497, (GLfloat) - 0.000000,
+       (GLfloat) 0.794672, (GLfloat) 0.576788, (GLfloat) - 0.000000,
+       (GLfloat) 0.800000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) 0.794672, (GLfloat) 0.523212, (GLfloat) - 0.000000,
+       (GLfloat) 0.779498, (GLfloat) 0.500503, (GLfloat) - 0.000000,
+       (GLfloat) 0.756788, (GLfloat) 0.485328, (GLfloat) - 0.000000,
+       (GLfloat) 0.730000, (GLfloat) 0.480000, (GLfloat) - 0.000000,
+       (GLfloat) 0.703212, (GLfloat) 0.485328, (GLfloat) - 0.000000,
+       (GLfloat) 0.680503, (GLfloat) 0.500503, (GLfloat) - 0.000000,
+       (GLfloat) 0.665328, (GLfloat) 0.523212, (GLfloat) - 0.000000,
+       (GLfloat) 0.660000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) 0.665328, (GLfloat) 0.576788, (GLfloat) - 0.000000,
+       (GLfloat) 0.680503, (GLfloat) 0.599497, (GLfloat) - 0.000000,
+       (GLfloat) 0.703212, (GLfloat) 0.614672, (GLfloat) - 0.000000,
+       (GLfloat) 0.730000, (GLfloat) 0.620000, (GLfloat) - 0.000000,
+       (GLfloat) 0.756788, (GLfloat) 0.602861, (GLfloat) 0.119916,
+       (GLfloat) 0.779498, (GLfloat) 0.587978, (GLfloat) 0.116956,
+       (GLfloat) 0.794672, (GLfloat) 0.565705, (GLfloat) 0.112526,
+       (GLfloat) 0.800000, (GLfloat) 0.539432, (GLfloat) 0.107300,
+       (GLfloat) 0.794672, (GLfloat) 0.513159, (GLfloat) 0.102074,
+       (GLfloat) 0.779498, (GLfloat) 0.490886, (GLfloat) 0.097643,
+       (GLfloat) 0.756788, (GLfloat) 0.476003, (GLfloat) 0.094683,
+       (GLfloat) 0.730000, (GLfloat) 0.470777, (GLfloat) 0.093643,
+       (GLfloat) 0.703212, (GLfloat) 0.476003, (GLfloat) 0.094683,
+       (GLfloat) 0.680503, (GLfloat) 0.490886, (GLfloat) 0.097643,
+       (GLfloat) 0.665328, (GLfloat) 0.513159, (GLfloat) 0.102074,
+       (GLfloat) 0.660000, (GLfloat) 0.539432, (GLfloat) 0.107300,
+       (GLfloat) 0.665328, (GLfloat) 0.565705, (GLfloat) 0.112526,
+       (GLfloat) 0.680503, (GLfloat) 0.587978, (GLfloat) 0.116956,
+       (GLfloat) 0.703212, (GLfloat) 0.602861, (GLfloat) 0.119916,
+       (GLfloat) 0.730000, (GLfloat) 0.608087, (GLfloat) 0.120956,
+       (GLfloat) 0.756788, (GLfloat) 0.567882, (GLfloat) 0.235225,
+       (GLfloat) 0.779498, (GLfloat) 0.553863, (GLfloat) 0.229418,
+       (GLfloat) 0.794672, (GLfloat) 0.532882, (GLfloat) 0.220727,
+       (GLfloat) 0.800000, (GLfloat) 0.508134, (GLfloat) 0.210476,
+       (GLfloat) 0.794672, (GLfloat) 0.483385, (GLfloat) 0.200225,
+       (GLfloat) 0.779498, (GLfloat) 0.462404, (GLfloat) 0.191534,
+       (GLfloat) 0.756788, (GLfloat) 0.448385, (GLfloat) 0.185727,
+       (GLfloat) 0.730000, (GLfloat) 0.443462, (GLfloat) 0.183688,
+       (GLfloat) 0.703212, (GLfloat) 0.448385, (GLfloat) 0.185727,
+       (GLfloat) 0.680503, (GLfloat) 0.462404, (GLfloat) 0.191534,
+       (GLfloat) 0.665328, (GLfloat) 0.483385, (GLfloat) 0.200225,
+       (GLfloat) 0.660000, (GLfloat) 0.508134, (GLfloat) 0.210476,
+       (GLfloat) 0.665328, (GLfloat) 0.532882, (GLfloat) 0.220727,
+       (GLfloat) 0.680503, (GLfloat) 0.553863, (GLfloat) 0.229418,
+       (GLfloat) 0.703212, (GLfloat) 0.567882, (GLfloat) 0.235225,
+       (GLfloat) 0.730000, (GLfloat) 0.572805, (GLfloat) 0.237264,
+       (GLfloat) 0.756788, (GLfloat) 0.511081, (GLfloat) 0.341493,
+       (GLfloat) 0.779498, (GLfloat) 0.498464, (GLfloat) 0.333063,
+       (GLfloat) 0.794672, (GLfloat) 0.479582, (GLfloat) 0.320446,
+       (GLfloat) 0.800000, (GLfloat) 0.457308, (GLfloat) 0.305564,
+       (GLfloat) 0.794672, (GLfloat) 0.435035, (GLfloat) 0.290681,
+       (GLfloat) 0.779498, (GLfloat) 0.416153, (GLfloat) 0.278064,
+       (GLfloat) 0.756788, (GLfloat) 0.403536, (GLfloat) 0.269634,
+       (GLfloat) 0.730000, (GLfloat) 0.399105, (GLfloat) 0.266674,
+       (GLfloat) 0.703212, (GLfloat) 0.403536, (GLfloat) 0.269634,
+       (GLfloat) 0.680503, (GLfloat) 0.416153, (GLfloat) 0.278064,
+       (GLfloat) 0.665328, (GLfloat) 0.435035, (GLfloat) 0.290681,
+       (GLfloat) 0.660000, (GLfloat) 0.457308, (GLfloat) 0.305564,
+       (GLfloat) 0.665328, (GLfloat) 0.479582, (GLfloat) 0.320446,
+       (GLfloat) 0.680503, (GLfloat) 0.498464, (GLfloat) 0.333063,
+       (GLfloat) 0.703212, (GLfloat) 0.511081, (GLfloat) 0.341493,
+       (GLfloat) 0.730000, (GLfloat) 0.515511, (GLfloat) 0.344454,
+       (GLfloat) 0.756788, (GLfloat) 0.434638, (GLfloat) 0.434638,
+       (GLfloat) 0.779498, (GLfloat) 0.423909, (GLfloat) 0.423909,
+       (GLfloat) 0.794672, (GLfloat) 0.407851, (GLfloat) 0.407851,
+       (GLfloat) 0.800000, (GLfloat) 0.388909, (GLfloat) 0.388909,
+       (GLfloat) 0.794672, (GLfloat) 0.369967, (GLfloat) 0.369967,
+       (GLfloat) 0.779498, (GLfloat) 0.353909, (GLfloat) 0.353909,
+       (GLfloat) 0.756788, (GLfloat) 0.343179, (GLfloat) 0.343179,
+       (GLfloat) 0.730000, (GLfloat) 0.339411, (GLfloat) 0.339411,
+       (GLfloat) 0.703212, (GLfloat) 0.343179, (GLfloat) 0.343179,
+       (GLfloat) 0.680503, (GLfloat) 0.353909, (GLfloat) 0.353909,
+       (GLfloat) 0.665328, (GLfloat) 0.369967, (GLfloat) 0.369967,
+       (GLfloat) 0.660000, (GLfloat) 0.388909, (GLfloat) 0.388909,
+       (GLfloat) 0.665328, (GLfloat) 0.407851, (GLfloat) 0.407851,
+       (GLfloat) 0.680503, (GLfloat) 0.423909, (GLfloat) 0.423909,
+       (GLfloat) 0.703212, (GLfloat) 0.434638, (GLfloat) 0.434638,
+       (GLfloat) 0.730000, (GLfloat) 0.438406, (GLfloat) 0.438406,
+       (GLfloat) 0.756788, (GLfloat) 0.341493, (GLfloat) 0.511081,
+       (GLfloat) 0.779498, (GLfloat) 0.333063, (GLfloat) 0.498464,
+       (GLfloat) 0.794672, (GLfloat) 0.320446, (GLfloat) 0.479582,
+       (GLfloat) 0.800000, (GLfloat) 0.305564, (GLfloat) 0.457308,
+       (GLfloat) 0.794672, (GLfloat) 0.290681, (GLfloat) 0.435035,
+       (GLfloat) 0.779498, (GLfloat) 0.278064, (GLfloat) 0.416153,
+       (GLfloat) 0.756788, (GLfloat) 0.269634, (GLfloat) 0.403536,
+       (GLfloat) 0.730000, (GLfloat) 0.266674, (GLfloat) 0.399105,
+       (GLfloat) 0.703212, (GLfloat) 0.269634, (GLfloat) 0.403536,
+       (GLfloat) 0.680503, (GLfloat) 0.278064, (GLfloat) 0.416153,
+       (GLfloat) 0.665328, (GLfloat) 0.290681, (GLfloat) 0.435035,
+       (GLfloat) 0.660000, (GLfloat) 0.305564, (GLfloat) 0.457308,
+       (GLfloat) 0.665328, (GLfloat) 0.320446, (GLfloat) 0.479582,
+       (GLfloat) 0.680503, (GLfloat) 0.333063, (GLfloat) 0.498464,
+       (GLfloat) 0.703212, (GLfloat) 0.341493, (GLfloat) 0.511081,
+       (GLfloat) 0.730000, (GLfloat) 0.344454, (GLfloat) 0.515511,
+       (GLfloat) 0.756788, (GLfloat) 0.235225, (GLfloat) 0.567882,
+       (GLfloat) 0.779498, (GLfloat) 0.229418, (GLfloat) 0.553863,
+       (GLfloat) 0.794672, (GLfloat) 0.220727, (GLfloat) 0.532882,
+       (GLfloat) 0.800000, (GLfloat) 0.210476, (GLfloat) 0.508134,
+       (GLfloat) 0.794672, (GLfloat) 0.200225, (GLfloat) 0.483385,
+       (GLfloat) 0.779498, (GLfloat) 0.191534, (GLfloat) 0.462404,
+       (GLfloat) 0.756788, (GLfloat) 0.185727, (GLfloat) 0.448385,
+       (GLfloat) 0.730000, (GLfloat) 0.183688, (GLfloat) 0.443462,
+       (GLfloat) 0.703212, (GLfloat) 0.185727, (GLfloat) 0.448385,
+       (GLfloat) 0.680503, (GLfloat) 0.191534, (GLfloat) 0.462404,
+       (GLfloat) 0.665328, (GLfloat) 0.200225, (GLfloat) 0.483385,
+       (GLfloat) 0.660000, (GLfloat) 0.210476, (GLfloat) 0.508134,
+       (GLfloat) 0.665328, (GLfloat) 0.220727, (GLfloat) 0.532882,
+       (GLfloat) 0.680503, (GLfloat) 0.229418, (GLfloat) 0.553863,
+       (GLfloat) 0.703212, (GLfloat) 0.235225, (GLfloat) 0.567882,
+       (GLfloat) 0.730000, (GLfloat) 0.237264, (GLfloat) 0.572805,
+       (GLfloat) 0.756788, (GLfloat) 0.119916, (GLfloat) 0.602861,
+       (GLfloat) 0.779498, (GLfloat) 0.116956, (GLfloat) 0.587978,
+       (GLfloat) 0.794672, (GLfloat) 0.112526, (GLfloat) 0.565705,
+       (GLfloat) 0.800000, (GLfloat) 0.107300, (GLfloat) 0.539432,
+       (GLfloat) 0.794672, (GLfloat) 0.102074, (GLfloat) 0.513159,
+       (GLfloat) 0.779498, (GLfloat) 0.097643, (GLfloat) 0.490886,
+       (GLfloat) 0.756788, (GLfloat) 0.094683, (GLfloat) 0.476003,
+       (GLfloat) 0.730000, (GLfloat) 0.093643, (GLfloat) 0.470777,
+       (GLfloat) 0.703212, (GLfloat) 0.094683, (GLfloat) 0.476003,
+       (GLfloat) 0.680503, (GLfloat) 0.097643, (GLfloat) 0.490886,
+       (GLfloat) 0.665328, (GLfloat) 0.102074, (GLfloat) 0.513159,
+       (GLfloat) 0.660000, (GLfloat) 0.107300, (GLfloat) 0.539432,
+       (GLfloat) 0.665328, (GLfloat) 0.112526, (GLfloat) 0.565705,
+       (GLfloat) 0.680503, (GLfloat) 0.116956, (GLfloat) 0.587978,
+       (GLfloat) 0.703212, (GLfloat) 0.119916, (GLfloat) 0.602861,
+       (GLfloat) 0.730000, (GLfloat) 0.120956, (GLfloat) 0.608087,
+       (GLfloat) 0.756788, (GLfloat) 0.000000, (GLfloat) 0.614672,
+       (GLfloat) 0.779498, (GLfloat) 0.000000, (GLfloat) 0.599497,
+       (GLfloat) 0.794672, (GLfloat) 0.000000, (GLfloat) 0.576788,
+       (GLfloat) 0.800000, (GLfloat) 0.000000, (GLfloat) 0.550000,
+       (GLfloat) 0.794672, (GLfloat) 0.000000, (GLfloat) 0.523212,
+       (GLfloat) 0.779498, (GLfloat) 0.000000, (GLfloat) 0.500503,
+       (GLfloat) 0.756788, (GLfloat) 0.000000, (GLfloat) 0.485328,
+       (GLfloat) 0.730000, (GLfloat) 0.000000, (GLfloat) 0.480000,
+       (GLfloat) 0.703212, (GLfloat) 0.000000, (GLfloat) 0.485328,
+       (GLfloat) 0.680503, (GLfloat) 0.000000, (GLfloat) 0.500503,
+       (GLfloat) 0.665328, (GLfloat) 0.000000, (GLfloat) 0.523212,
+       (GLfloat) 0.660000, (GLfloat) 0.000000, (GLfloat) 0.550000,
+       (GLfloat) 0.665328, (GLfloat) 0.000000, (GLfloat) 0.576788,
+       (GLfloat) 0.680503, (GLfloat) 0.000000, (GLfloat) 0.599497,
+       (GLfloat) 0.703212, (GLfloat) 0.000000, (GLfloat) 0.614672,
+       (GLfloat) 0.730000, (GLfloat) 0.000000, (GLfloat) 0.620000,
+       (GLfloat) 0.756788, (GLfloat) - 0.119916, (GLfloat) 0.602861,
+       (GLfloat) 0.779498, (GLfloat) - 0.116956, (GLfloat) 0.587978,
+       (GLfloat) 0.794672, (GLfloat) - 0.112526, (GLfloat) 0.565705,
+       (GLfloat) 0.800000, (GLfloat) - 0.107300, (GLfloat) 0.539432,
+       (GLfloat) 0.794672, (GLfloat) - 0.102074, (GLfloat) 0.513159,
+       (GLfloat) 0.779498, (GLfloat) - 0.097643, (GLfloat) 0.490886,
+       (GLfloat) 0.756788, (GLfloat) - 0.094683, (GLfloat) 0.476003,
+       (GLfloat) 0.730000, (GLfloat) - 0.093643, (GLfloat) 0.470777,
+       (GLfloat) 0.703212, (GLfloat) - 0.094683, (GLfloat) 0.476003,
+       (GLfloat) 0.680503, (GLfloat) - 0.097643, (GLfloat) 0.490886,
+       (GLfloat) 0.665328, (GLfloat) - 0.102074, (GLfloat) 0.513159,
+       (GLfloat) 0.660000, (GLfloat) - 0.107300, (GLfloat) 0.539432,
+       (GLfloat) 0.665328, (GLfloat) - 0.112526, (GLfloat) 0.565705,
+       (GLfloat) 0.680503, (GLfloat) - 0.116956, (GLfloat) 0.587978,
+       (GLfloat) 0.703212, (GLfloat) - 0.119916, (GLfloat) 0.602861,
+       (GLfloat) 0.730000, (GLfloat) - 0.120956, (GLfloat) 0.608087,
+       (GLfloat) 0.756788, (GLfloat) - 0.235225, (GLfloat) 0.567882,
+       (GLfloat) 0.779498, (GLfloat) - 0.229418, (GLfloat) 0.553863,
+       (GLfloat) 0.794672, (GLfloat) - 0.220727, (GLfloat) 0.532882,
+       (GLfloat) 0.800000, (GLfloat) - 0.210476, (GLfloat) 0.508134,
+       (GLfloat) 0.794672, (GLfloat) - 0.200225, (GLfloat) 0.483385,
+       (GLfloat) 0.779498, (GLfloat) - 0.191534, (GLfloat) 0.462404,
+       (GLfloat) 0.756788, (GLfloat) - 0.185727, (GLfloat) 0.448385,
+       (GLfloat) 0.730000, (GLfloat) - 0.183688, (GLfloat) 0.443462,
+       (GLfloat) 0.703212, (GLfloat) - 0.185727, (GLfloat) 0.448385,
+       (GLfloat) 0.680503, (GLfloat) - 0.191534, (GLfloat) 0.462404,
+       (GLfloat) 0.665328, (GLfloat) - 0.200225, (GLfloat) 0.483385,
+       (GLfloat) 0.660000, (GLfloat) - 0.210476, (GLfloat) 0.508134,
+       (GLfloat) 0.665328, (GLfloat) - 0.220727, (GLfloat) 0.532882,
+       (GLfloat) 0.680503, (GLfloat) - 0.229418, (GLfloat) 0.553863,
+       (GLfloat) 0.703212, (GLfloat) - 0.235225, (GLfloat) 0.567882,
+       (GLfloat) 0.730000, (GLfloat) - 0.237264, (GLfloat) 0.572805,
+       (GLfloat) 0.756788, (GLfloat) - 0.341493, (GLfloat) 0.511081,
+       (GLfloat) 0.779498, (GLfloat) - 0.333063, (GLfloat) 0.498464,
+       (GLfloat) 0.794672, (GLfloat) - 0.320446, (GLfloat) 0.479582,
+       (GLfloat) 0.800000, (GLfloat) - 0.305564, (GLfloat) 0.457308,
+       (GLfloat) 0.794672, (GLfloat) - 0.290681, (GLfloat) 0.435035,
+       (GLfloat) 0.779498, (GLfloat) - 0.278064, (GLfloat) 0.416153,
+       (GLfloat) 0.756788, (GLfloat) - 0.269634, (GLfloat) 0.403536,
+       (GLfloat) 0.730000, (GLfloat) - 0.266674, (GLfloat) 0.399105,
+       (GLfloat) 0.703212, (GLfloat) - 0.269634, (GLfloat) 0.403536,
+       (GLfloat) 0.680503, (GLfloat) - 0.278064, (GLfloat) 0.416153,
+       (GLfloat) 0.665328, (GLfloat) - 0.290681, (GLfloat) 0.435035,
+       (GLfloat) 0.660000, (GLfloat) - 0.305564, (GLfloat) 0.457308,
+       (GLfloat) 0.665328, (GLfloat) - 0.320446, (GLfloat) 0.479582,
+       (GLfloat) 0.680503, (GLfloat) - 0.333063, (GLfloat) 0.498464,
+       (GLfloat) 0.703212, (GLfloat) - 0.341493, (GLfloat) 0.511081,
+       (GLfloat) 0.730000, (GLfloat) - 0.344454, (GLfloat) 0.515511,
+       (GLfloat) 0.756788, (GLfloat) - 0.434638, (GLfloat) 0.434638,
+       (GLfloat) 0.779498, (GLfloat) - 0.423909, (GLfloat) 0.423909,
+       (GLfloat) 0.794672, (GLfloat) - 0.407851, (GLfloat) 0.407851,
+       (GLfloat) 0.800000, (GLfloat) - 0.388909, (GLfloat) 0.388909,
+       (GLfloat) 0.794672, (GLfloat) - 0.369967, (GLfloat) 0.369967,
+       (GLfloat) 0.779498, (GLfloat) - 0.353909, (GLfloat) 0.353909,
+       (GLfloat) 0.756788, (GLfloat) - 0.343179, (GLfloat) 0.343179,
+       (GLfloat) 0.730000, (GLfloat) - 0.339411, (GLfloat) 0.339411,
+       (GLfloat) 0.703212, (GLfloat) - 0.343179, (GLfloat) 0.343179,
+       (GLfloat) 0.680503, (GLfloat) - 0.353909, (GLfloat) 0.353909,
+       (GLfloat) 0.665328, (GLfloat) - 0.369967, (GLfloat) 0.369967,
+       (GLfloat) 0.660000, (GLfloat) - 0.388909, (GLfloat) 0.388909,
+       (GLfloat) 0.665328, (GLfloat) - 0.407851, (GLfloat) 0.407851,
+       (GLfloat) 0.680503, (GLfloat) - 0.423909, (GLfloat) 0.423909,
+       (GLfloat) 0.703212, (GLfloat) - 0.434638, (GLfloat) 0.434638,
+       (GLfloat) 0.730000, (GLfloat) - 0.438406, (GLfloat) 0.438406,
+       (GLfloat) 0.756788, (GLfloat) - 0.511081, (GLfloat) 0.341493,
+       (GLfloat) 0.779498, (GLfloat) - 0.498464, (GLfloat) 0.333063,
+       (GLfloat) 0.794672, (GLfloat) - 0.479582, (GLfloat) 0.320446,
+       (GLfloat) 0.800000, (GLfloat) - 0.457308, (GLfloat) 0.305564,
+       (GLfloat) 0.794672, (GLfloat) - 0.435035, (GLfloat) 0.290681,
+       (GLfloat) 0.779498, (GLfloat) - 0.416153, (GLfloat) 0.278064,
+       (GLfloat) 0.756788, (GLfloat) - 0.403536, (GLfloat) 0.269634,
+       (GLfloat) 0.730000, (GLfloat) - 0.399105, (GLfloat) 0.266674,
+       (GLfloat) 0.703212, (GLfloat) - 0.403536, (GLfloat) 0.269634,
+       (GLfloat) 0.680503, (GLfloat) - 0.416153, (GLfloat) 0.278064,
+       (GLfloat) 0.665328, (GLfloat) - 0.435035, (GLfloat) 0.290681,
+       (GLfloat) 0.660000, (GLfloat) - 0.457308, (GLfloat) 0.305564,
+       (GLfloat) 0.665328, (GLfloat) - 0.479582, (GLfloat) 0.320446,
+       (GLfloat) 0.680503, (GLfloat) - 0.498464, (GLfloat) 0.333063,
+       (GLfloat) 0.703212, (GLfloat) - 0.511081, (GLfloat) 0.341493,
+       (GLfloat) 0.730000, (GLfloat) - 0.515511, (GLfloat) 0.344454,
+       (GLfloat) 0.756788, (GLfloat) - 0.567882, (GLfloat) 0.235225,
+       (GLfloat) 0.779498, (GLfloat) - 0.553863, (GLfloat) 0.229418,
+       (GLfloat) 0.794672, (GLfloat) - 0.532882, (GLfloat) 0.220727,
+       (GLfloat) 0.800000, (GLfloat) - 0.508134, (GLfloat) 0.210476,
+       (GLfloat) 0.794672, (GLfloat) - 0.483385, (GLfloat) 0.200225,
+       (GLfloat) 0.779498, (GLfloat) - 0.462404, (GLfloat) 0.191534,
+       (GLfloat) 0.756788, (GLfloat) - 0.448385, (GLfloat) 0.185727,
+       (GLfloat) 0.730000, (GLfloat) - 0.443462, (GLfloat) 0.183688,
+       (GLfloat) 0.703212, (GLfloat) - 0.448385, (GLfloat) 0.185727,
+       (GLfloat) 0.680503, (GLfloat) - 0.462404, (GLfloat) 0.191534,
+       (GLfloat) 0.665328, (GLfloat) - 0.483385, (GLfloat) 0.200225,
+       (GLfloat) 0.660000, (GLfloat) - 0.508134, (GLfloat) 0.210476,
+       (GLfloat) 0.665328, (GLfloat) - 0.532882, (GLfloat) 0.220727,
+       (GLfloat) 0.680503, (GLfloat) - 0.553863, (GLfloat) 0.229418,
+       (GLfloat) 0.703212, (GLfloat) - 0.567882, (GLfloat) 0.235225,
+       (GLfloat) 0.730000, (GLfloat) - 0.572805, (GLfloat) 0.237264,
+       (GLfloat) 0.756788, (GLfloat) - 0.602861, (GLfloat) 0.119916,
+       (GLfloat) 0.779498, (GLfloat) - 0.587978, (GLfloat) 0.116956,
+       (GLfloat) 0.794672, (GLfloat) - 0.565705, (GLfloat) 0.112526,
+       (GLfloat) 0.800000, (GLfloat) - 0.539432, (GLfloat) 0.107300,
+       (GLfloat) 0.794672, (GLfloat) - 0.513159, (GLfloat) 0.102074,
+       (GLfloat) 0.779498, (GLfloat) - 0.490886, (GLfloat) 0.097643,
+       (GLfloat) 0.756788, (GLfloat) - 0.476003, (GLfloat) 0.094683,
+       (GLfloat) 0.730000, (GLfloat) - 0.470777, (GLfloat) 0.093643,
+       (GLfloat) 0.703212, (GLfloat) - 0.476003, (GLfloat) 0.094683,
+       (GLfloat) 0.680503, (GLfloat) - 0.490886, (GLfloat) 0.097643,
+       (GLfloat) 0.665328, (GLfloat) - 0.513159, (GLfloat) 0.102074,
+       (GLfloat) 0.660000, (GLfloat) - 0.539432, (GLfloat) 0.107300,
+       (GLfloat) 0.665328, (GLfloat) - 0.565705, (GLfloat) 0.112526,
+       (GLfloat) 0.680503, (GLfloat) - 0.587978, (GLfloat) 0.116956,
+       (GLfloat) 0.703212, (GLfloat) - 0.602861, (GLfloat) 0.119916,
+       (GLfloat) 0.730000, (GLfloat) - 0.608087, (GLfloat) 0.120956,
+       (GLfloat) 0.756788, (GLfloat) - 0.614672, (GLfloat) 0.000000,
+       (GLfloat) 0.779498, (GLfloat) - 0.599497, (GLfloat) 0.000000,
+       (GLfloat) 0.794672, (GLfloat) - 0.576788, (GLfloat) 0.000000,
+       (GLfloat) 0.800000, (GLfloat) - 0.550000, (GLfloat) 0.000000,
+       (GLfloat) 0.794672, (GLfloat) - 0.523212, (GLfloat) 0.000000,
+       (GLfloat) 0.779498, (GLfloat) - 0.500503, (GLfloat) 0.000000,
+       (GLfloat) 0.756788, (GLfloat) - 0.485328, (GLfloat) 0.000000,
+       (GLfloat) 0.730000, (GLfloat) - 0.480000, (GLfloat) 0.000000,
+       (GLfloat) 0.703212, (GLfloat) - 0.485328, (GLfloat) 0.000000,
+       (GLfloat) 0.680503, (GLfloat) - 0.500503, (GLfloat) 0.000000,
+       (GLfloat) 0.665328, (GLfloat) - 0.523212, (GLfloat) 0.000000,
+       (GLfloat) 0.660000, (GLfloat) - 0.550000, (GLfloat) 0.000000,
+       (GLfloat) 0.665328, (GLfloat) - 0.576788, (GLfloat) 0.000000,
+       (GLfloat) 0.680503, (GLfloat) - 0.599497, (GLfloat) 0.000000,
+       (GLfloat) 0.703212, (GLfloat) - 0.614672, (GLfloat) 0.000000,
+       (GLfloat) 0.730000, (GLfloat) - 0.620000, (GLfloat) 0.000000,
+       (GLfloat) 0.756788, (GLfloat) - 0.602861, (GLfloat) - 0.119916,
+       (GLfloat) 0.779498, (GLfloat) - 0.587978, (GLfloat) - 0.116956,
+       (GLfloat) 0.794672, (GLfloat) - 0.565705, (GLfloat) - 0.112526,
+       (GLfloat) 0.800000, (GLfloat) - 0.539432, (GLfloat) - 0.107300,
+       (GLfloat) 0.794672, (GLfloat) - 0.513159, (GLfloat) - 0.102074,
+       (GLfloat) 0.779498, (GLfloat) - 0.490886, (GLfloat) - 0.097643,
+       (GLfloat) 0.756788, (GLfloat) - 0.476003, (GLfloat) - 0.094683,
+       (GLfloat) 0.730000, (GLfloat) - 0.470777, (GLfloat) - 0.093643,
+       (GLfloat) 0.703212, (GLfloat) - 0.476003, (GLfloat) - 0.094683,
+       (GLfloat) 0.680503, (GLfloat) - 0.490886, (GLfloat) - 0.097643,
+       (GLfloat) 0.665328, (GLfloat) - 0.513159, (GLfloat) - 0.102074,
+       (GLfloat) 0.660000, (GLfloat) - 0.539432, (GLfloat) - 0.107300,
+       (GLfloat) 0.665328, (GLfloat) - 0.565705, (GLfloat) - 0.112526,
+       (GLfloat) 0.680503, (GLfloat) - 0.587978, (GLfloat) - 0.116956,
+       (GLfloat) 0.703212, (GLfloat) - 0.602861, (GLfloat) - 0.119916,
+       (GLfloat) 0.730000, (GLfloat) - 0.608087, (GLfloat) - 0.120956,
+       (GLfloat) 0.756788, (GLfloat) - 0.567882, (GLfloat) - 0.235225,
+       (GLfloat) 0.779498, (GLfloat) - 0.553863, (GLfloat) - 0.229418,
+       (GLfloat) 0.794672, (GLfloat) - 0.532882, (GLfloat) - 0.220727,
+       (GLfloat) 0.800000, (GLfloat) - 0.508134, (GLfloat) - 0.210476,
+       (GLfloat) 0.794672, (GLfloat) - 0.483385, (GLfloat) - 0.200225,
+       (GLfloat) 0.779498, (GLfloat) - 0.462404, (GLfloat) - 0.191534,
+       (GLfloat) 0.756788, (GLfloat) - 0.448385, (GLfloat) - 0.185727,
+       (GLfloat) 0.730000, (GLfloat) - 0.443462, (GLfloat) - 0.183688,
+       (GLfloat) 0.703212, (GLfloat) - 0.448385, (GLfloat) - 0.185727,
+       (GLfloat) 0.680503, (GLfloat) - 0.462404, (GLfloat) - 0.191534,
+       (GLfloat) 0.665328, (GLfloat) - 0.483385, (GLfloat) - 0.200225,
+       (GLfloat) 0.660000, (GLfloat) - 0.508134, (GLfloat) - 0.210476,
+       (GLfloat) 0.665328, (GLfloat) - 0.532882, (GLfloat) - 0.220727,
+       (GLfloat) 0.680503, (GLfloat) - 0.553863, (GLfloat) - 0.229418,
+       (GLfloat) 0.703212, (GLfloat) - 0.567882, (GLfloat) - 0.235225,
+       (GLfloat) 0.730000, (GLfloat) - 0.572805, (GLfloat) - 0.237264,
+       (GLfloat) 0.756788, (GLfloat) - 0.511081, (GLfloat) - 0.341493,
+       (GLfloat) 0.779498, (GLfloat) - 0.498464, (GLfloat) - 0.333063,
+       (GLfloat) 0.794672, (GLfloat) - 0.479582, (GLfloat) - 0.320446,
+       (GLfloat) 0.800000, (GLfloat) - 0.457308, (GLfloat) - 0.305564,
+       (GLfloat) 0.794672, (GLfloat) - 0.435035, (GLfloat) - 0.290681,
+       (GLfloat) 0.779498, (GLfloat) - 0.416153, (GLfloat) - 0.278064,
+       (GLfloat) 0.756788, (GLfloat) - 0.403536, (GLfloat) - 0.269634,
+       (GLfloat) 0.730000, (GLfloat) - 0.399105, (GLfloat) - 0.266674,
+       (GLfloat) 0.703212, (GLfloat) - 0.403536, (GLfloat) - 0.269634,
+       (GLfloat) 0.680503, (GLfloat) - 0.416153, (GLfloat) - 0.278064,
+       (GLfloat) 0.665328, (GLfloat) - 0.435035, (GLfloat) - 0.290681,
+       (GLfloat) 0.660000, (GLfloat) - 0.457308, (GLfloat) - 0.305564,
+       (GLfloat) 0.665328, (GLfloat) - 0.479582, (GLfloat) - 0.320446,
+       (GLfloat) 0.680503, (GLfloat) - 0.498464, (GLfloat) - 0.333063,
+       (GLfloat) 0.703212, (GLfloat) - 0.511081, (GLfloat) - 0.341493,
+       (GLfloat) 0.730000, (GLfloat) - 0.515511, (GLfloat) - 0.344454,
+       (GLfloat) 0.756788, (GLfloat) - 0.434638, (GLfloat) - 0.434638,
+       (GLfloat) 0.779498, (GLfloat) - 0.423909, (GLfloat) - 0.423909,
+       (GLfloat) 0.794672, (GLfloat) - 0.407851, (GLfloat) - 0.407851,
+       (GLfloat) 0.800000, (GLfloat) - 0.388909, (GLfloat) - 0.388909,
+       (GLfloat) 0.794672, (GLfloat) - 0.369967, (GLfloat) - 0.369967,
+       (GLfloat) 0.779498, (GLfloat) - 0.353909, (GLfloat) - 0.353909,
+       (GLfloat) 0.756788, (GLfloat) - 0.343179, (GLfloat) - 0.343179,
+       (GLfloat) 0.730000, (GLfloat) - 0.339411, (GLfloat) - 0.339411,
+       (GLfloat) 0.703212, (GLfloat) - 0.343179, (GLfloat) - 0.343179,
+       (GLfloat) 0.680503, (GLfloat) - 0.353909, (GLfloat) - 0.353909,
+       (GLfloat) 0.665328, (GLfloat) - 0.369967, (GLfloat) - 0.369967,
+       (GLfloat) 0.660000, (GLfloat) - 0.388909, (GLfloat) - 0.388909,
+       (GLfloat) 0.665328, (GLfloat) - 0.407851, (GLfloat) - 0.407851,
+       (GLfloat) 0.680503, (GLfloat) - 0.423909, (GLfloat) - 0.423909,
+       (GLfloat) 0.703212, (GLfloat) - 0.434638, (GLfloat) - 0.434638,
+       (GLfloat) 0.730000, (GLfloat) - 0.438406, (GLfloat) - 0.438406,
+       (GLfloat) 0.756788, (GLfloat) - 0.341493, (GLfloat) - 0.511081,
+       (GLfloat) 0.779498, (GLfloat) - 0.333063, (GLfloat) - 0.498464,
+       (GLfloat) 0.794672, (GLfloat) - 0.320446, (GLfloat) - 0.479582,
+       (GLfloat) 0.800000, (GLfloat) - 0.305564, (GLfloat) - 0.457308,
+       (GLfloat) 0.794672, (GLfloat) - 0.290681, (GLfloat) - 0.435035,
+       (GLfloat) 0.779498, (GLfloat) - 0.278064, (GLfloat) - 0.416153,
+       (GLfloat) 0.756788, (GLfloat) - 0.269634, (GLfloat) - 0.403536,
+       (GLfloat) 0.730000, (GLfloat) - 0.266674, (GLfloat) - 0.399105,
+       (GLfloat) 0.703212, (GLfloat) - 0.269634, (GLfloat) - 0.403536,
+       (GLfloat) 0.680503, (GLfloat) - 0.278064, (GLfloat) - 0.416153,
+       (GLfloat) 0.665328, (GLfloat) - 0.290681, (GLfloat) - 0.435035,
+       (GLfloat) 0.660000, (GLfloat) - 0.305564, (GLfloat) - 0.457308,
+       (GLfloat) 0.665328, (GLfloat) - 0.320446, (GLfloat) - 0.479582,
+       (GLfloat) 0.680503, (GLfloat) - 0.333063, (GLfloat) - 0.498464,
+       (GLfloat) 0.703212, (GLfloat) - 0.341493, (GLfloat) - 0.511081,
+       (GLfloat) 0.730000, (GLfloat) - 0.344454, (GLfloat) - 0.515511,
+       (GLfloat) 0.756788, (GLfloat) - 0.235225, (GLfloat) - 0.567882,
+       (GLfloat) 0.779498, (GLfloat) - 0.229418, (GLfloat) - 0.553863,
+       (GLfloat) 0.794672, (GLfloat) - 0.220727, (GLfloat) - 0.532882,
+       (GLfloat) 0.800000, (GLfloat) - 0.210476, (GLfloat) - 0.508134,
+       (GLfloat) 0.794672, (GLfloat) - 0.200225, (GLfloat) - 0.483385,
+       (GLfloat) 0.779498, (GLfloat) - 0.191534, (GLfloat) - 0.462404,
+       (GLfloat) 0.756788, (GLfloat) - 0.185727, (GLfloat) - 0.448385,
+       (GLfloat) 0.730000, (GLfloat) - 0.183688, (GLfloat) - 0.443462,
+       (GLfloat) 0.703212, (GLfloat) - 0.185727, (GLfloat) - 0.448385,
+       (GLfloat) 0.680503, (GLfloat) - 0.191534, (GLfloat) - 0.462404,
+       (GLfloat) 0.665328, (GLfloat) - 0.200225, (GLfloat) - 0.483385,
+       (GLfloat) 0.660000, (GLfloat) - 0.210476, (GLfloat) - 0.508134,
+       (GLfloat) 0.665328, (GLfloat) - 0.220727, (GLfloat) - 0.532882,
+       (GLfloat) 0.680503, (GLfloat) - 0.229418, (GLfloat) - 0.553863,
+       (GLfloat) 0.703212, (GLfloat) - 0.235225, (GLfloat) - 0.567882,
+       (GLfloat) 0.730000, (GLfloat) - 0.237264, (GLfloat) - 0.572805,
+       (GLfloat) 0.756788, (GLfloat) - 0.119916, (GLfloat) - 0.602861,
+       (GLfloat) 0.779498, (GLfloat) - 0.116956, (GLfloat) - 0.587978,
+       (GLfloat) 0.794672, (GLfloat) - 0.112526, (GLfloat) - 0.565705,
+       (GLfloat) 0.800000, (GLfloat) - 0.107300, (GLfloat) - 0.539432,
+       (GLfloat) 0.794672, (GLfloat) - 0.102074, (GLfloat) - 0.513159,
+       (GLfloat) 0.779498, (GLfloat) - 0.097643, (GLfloat) - 0.490885,
+       (GLfloat) 0.756788, (GLfloat) - 0.094683, (GLfloat) - 0.476003,
+       (GLfloat) 0.730000, (GLfloat) - 0.093643, (GLfloat) - 0.470777,
+       (GLfloat) 0.703212, (GLfloat) - 0.094683, (GLfloat) - 0.476003,
+       (GLfloat) 0.680503, (GLfloat) - 0.097643, (GLfloat) - 0.490885,
+       (GLfloat) 0.665328, (GLfloat) - 0.102074, (GLfloat) - 0.513159,
+       (GLfloat) 0.660000, (GLfloat) - 0.107300, (GLfloat) - 0.539432,
+       (GLfloat) 0.665328, (GLfloat) - 0.112526, (GLfloat) - 0.565705,
+       (GLfloat) 0.680503, (GLfloat) - 0.116956, (GLfloat) - 0.587978,
+       (GLfloat) 0.703212, (GLfloat) - 0.119916, (GLfloat) - 0.602861,
+       (GLfloat) 0.730000, (GLfloat) - 0.120956, (GLfloat) - 0.608087,
+       (GLfloat) 0.756788, (GLfloat) - 0.000000, (GLfloat) - 0.614672,
+       (GLfloat) 0.779498, (GLfloat) - 0.000000, (GLfloat) - 0.599497,
+       (GLfloat) 0.794672, (GLfloat) - 0.000000, (GLfloat) - 0.576788,
+       (GLfloat) 0.800000, (GLfloat) - 0.000000, (GLfloat) - 0.550000,
+       (GLfloat) 0.794672, (GLfloat) - 0.000000, (GLfloat) - 0.523212,
+       (GLfloat) 0.779498, (GLfloat) - 0.000000, (GLfloat) - 0.500503,
+       (GLfloat) 0.756788, (GLfloat) - 0.000000, (GLfloat) - 0.485328,
+       (GLfloat) 0.730000, (GLfloat) - 0.000000, (GLfloat) - 0.480000,
+       (GLfloat) 0.703212, (GLfloat) - 0.000000, (GLfloat) - 0.485328,
+       (GLfloat) 0.680503, (GLfloat) - 0.000000, (GLfloat) - 0.500503,
+       (GLfloat) 0.665328, (GLfloat) - 0.000000, (GLfloat) - 0.523212,
+       (GLfloat) 0.660000, (GLfloat) - 0.000000, (GLfloat) - 0.550000,
+       (GLfloat) 0.665328, (GLfloat) - 0.000000, (GLfloat) - 0.576788,
+       (GLfloat) 0.680503, (GLfloat) - 0.000000, (GLfloat) - 0.599497,
+       (GLfloat) 0.703212, (GLfloat) - 0.000000, (GLfloat) - 0.614672,
+       (GLfloat) 0.730000, (GLfloat) - 0.000000, (GLfloat) - 0.620000,
+       (GLfloat) 0.756788, (GLfloat) 0.119916, (GLfloat) - 0.602861,
+       (GLfloat) 0.779498, (GLfloat) 0.116956, (GLfloat) - 0.587978,
+       (GLfloat) 0.794672, (GLfloat) 0.112526, (GLfloat) - 0.565705,
+       (GLfloat) 0.800000, (GLfloat) 0.107300, (GLfloat) - 0.539432,
+       (GLfloat) 0.794672, (GLfloat) 0.102074, (GLfloat) - 0.513159,
+       (GLfloat) 0.779498, (GLfloat) 0.097643, (GLfloat) - 0.490886,
+       (GLfloat) 0.756788, (GLfloat) 0.094683, (GLfloat) - 0.476003,
+       (GLfloat) 0.730000, (GLfloat) 0.093643, (GLfloat) - 0.470777,
+       (GLfloat) 0.703212, (GLfloat) 0.094683, (GLfloat) - 0.476003,
+       (GLfloat) 0.680503, (GLfloat) 0.097643, (GLfloat) - 0.490886,
+       (GLfloat) 0.665328, (GLfloat) 0.102074, (GLfloat) - 0.513159,
+       (GLfloat) 0.660000, (GLfloat) 0.107300, (GLfloat) - 0.539432,
+       (GLfloat) 0.665328, (GLfloat) 0.112526, (GLfloat) - 0.565705,
+       (GLfloat) 0.680503, (GLfloat) 0.116956, (GLfloat) - 0.587978,
+       (GLfloat) 0.703212, (GLfloat) 0.119916, (GLfloat) - 0.602861,
+       (GLfloat) 0.730000, (GLfloat) 0.120956, (GLfloat) - 0.608087,
+       (GLfloat) 0.756788, (GLfloat) 0.235225, (GLfloat) - 0.567882,
+       (GLfloat) 0.779498, (GLfloat) 0.229418, (GLfloat) - 0.553863,
+       (GLfloat) 0.794672, (GLfloat) 0.220727, (GLfloat) - 0.532882,
+       (GLfloat) 0.800000, (GLfloat) 0.210476, (GLfloat) - 0.508134,
+       (GLfloat) 0.794672, (GLfloat) 0.200225, (GLfloat) - 0.483385,
+       (GLfloat) 0.779498, (GLfloat) 0.191534, (GLfloat) - 0.462404,
+       (GLfloat) 0.756788, (GLfloat) 0.185727, (GLfloat) - 0.448385,
+       (GLfloat) 0.730000, (GLfloat) 0.183688, (GLfloat) - 0.443462,
+       (GLfloat) 0.703212, (GLfloat) 0.185727, (GLfloat) - 0.448385,
+       (GLfloat) 0.680503, (GLfloat) 0.191534, (GLfloat) - 0.462404,
+       (GLfloat) 0.665328, (GLfloat) 0.200225, (GLfloat) - 0.483385,
+       (GLfloat) 0.660000, (GLfloat) 0.210476, (GLfloat) - 0.508134,
+       (GLfloat) 0.665328, (GLfloat) 0.220727, (GLfloat) - 0.532882,
+       (GLfloat) 0.680503, (GLfloat) 0.229418, (GLfloat) - 0.553863,
+       (GLfloat) 0.703212, (GLfloat) 0.235225, (GLfloat) - 0.567882,
+       (GLfloat) 0.730000, (GLfloat) 0.237264, (GLfloat) - 0.572805,
+       (GLfloat) 0.756788, (GLfloat) 0.341493, (GLfloat) - 0.511081,
+       (GLfloat) 0.779498, (GLfloat) 0.333063, (GLfloat) - 0.498464,
+       (GLfloat) 0.794672, (GLfloat) 0.320446, (GLfloat) - 0.479582,
+       (GLfloat) 0.800000, (GLfloat) 0.305564, (GLfloat) - 0.457308,
+       (GLfloat) 0.794672, (GLfloat) 0.290681, (GLfloat) - 0.435035,
+       (GLfloat) 0.779498, (GLfloat) 0.278064, (GLfloat) - 0.416153,
+       (GLfloat) 0.756788, (GLfloat) 0.269634, (GLfloat) - 0.403536,
+       (GLfloat) 0.730000, (GLfloat) 0.266674, (GLfloat) - 0.399105,
+       (GLfloat) 0.703212, (GLfloat) 0.269634, (GLfloat) - 0.403536,
+       (GLfloat) 0.680503, (GLfloat) 0.278064, (GLfloat) - 0.416153,
+       (GLfloat) 0.665328, (GLfloat) 0.290681, (GLfloat) - 0.435035,
+       (GLfloat) 0.660000, (GLfloat) 0.305564, (GLfloat) - 0.457308,
+       (GLfloat) 0.665328, (GLfloat) 0.320446, (GLfloat) - 0.479582,
+       (GLfloat) 0.680503, (GLfloat) 0.333063, (GLfloat) - 0.498464,
+       (GLfloat) 0.703212, (GLfloat) 0.341493, (GLfloat) - 0.511081,
+       (GLfloat) 0.730000, (GLfloat) 0.344454, (GLfloat) - 0.515511,
+       (GLfloat) 0.756788, (GLfloat) 0.434638, (GLfloat) - 0.434638,
+       (GLfloat) 0.779498, (GLfloat) 0.423909, (GLfloat) - 0.423909,
+       (GLfloat) 0.794672, (GLfloat) 0.407851, (GLfloat) - 0.407851,
+       (GLfloat) 0.800000, (GLfloat) 0.388909, (GLfloat) - 0.388909,
+       (GLfloat) 0.794672, (GLfloat) 0.369967, (GLfloat) - 0.369967,
+       (GLfloat) 0.779498, (GLfloat) 0.353909, (GLfloat) - 0.353909,
+       (GLfloat) 0.756788, (GLfloat) 0.343179, (GLfloat) - 0.343179,
+       (GLfloat) 0.730000, (GLfloat) 0.339411, (GLfloat) - 0.339411,
+       (GLfloat) 0.703212, (GLfloat) 0.343179, (GLfloat) - 0.343179,
+       (GLfloat) 0.680503, (GLfloat) 0.353909, (GLfloat) - 0.353909,
+       (GLfloat) 0.665328, (GLfloat) 0.369967, (GLfloat) - 0.369967,
+       (GLfloat) 0.660000, (GLfloat) 0.388909, (GLfloat) - 0.388909,
+       (GLfloat) 0.665328, (GLfloat) 0.407851, (GLfloat) - 0.407851,
+       (GLfloat) 0.680503, (GLfloat) 0.423909, (GLfloat) - 0.423909,
+       (GLfloat) 0.703212, (GLfloat) 0.434638, (GLfloat) - 0.434638,
+       (GLfloat) 0.730000, (GLfloat) 0.438406, (GLfloat) - 0.438406,
+       (GLfloat) 0.756788, (GLfloat) 0.511081, (GLfloat) - 0.341493,
+       (GLfloat) 0.779498, (GLfloat) 0.498464, (GLfloat) - 0.333063,
+       (GLfloat) 0.794672, (GLfloat) 0.479582, (GLfloat) - 0.320446,
+       (GLfloat) 0.800000, (GLfloat) 0.457308, (GLfloat) - 0.305564,
+       (GLfloat) 0.794672, (GLfloat) 0.435035, (GLfloat) - 0.290681,
+       (GLfloat) 0.779498, (GLfloat) 0.416153, (GLfloat) - 0.278064,
+       (GLfloat) 0.756788, (GLfloat) 0.403536, (GLfloat) - 0.269634,
+       (GLfloat) 0.730000, (GLfloat) 0.399105, (GLfloat) - 0.266674,
+       (GLfloat) 0.703212, (GLfloat) 0.403536, (GLfloat) - 0.269634,
+       (GLfloat) 0.680503, (GLfloat) 0.416153, (GLfloat) - 0.278064,
+       (GLfloat) 0.665328, (GLfloat) 0.435035, (GLfloat) - 0.290681,
+       (GLfloat) 0.660000, (GLfloat) 0.457308, (GLfloat) - 0.305564,
+       (GLfloat) 0.665328, (GLfloat) 0.479582, (GLfloat) - 0.320446,
+       (GLfloat) 0.680503, (GLfloat) 0.498464, (GLfloat) - 0.333063,
+       (GLfloat) 0.703212, (GLfloat) 0.511081, (GLfloat) - 0.341493,
+       (GLfloat) 0.730000, (GLfloat) 0.515511, (GLfloat) - 0.344454,
+       (GLfloat) 0.756788, (GLfloat) 0.567882, (GLfloat) - 0.235225,
+       (GLfloat) 0.779498, (GLfloat) 0.553863, (GLfloat) - 0.229418,
+       (GLfloat) 0.794672, (GLfloat) 0.532882, (GLfloat) - 0.220727,
+       (GLfloat) 0.800000, (GLfloat) 0.508134, (GLfloat) - 0.210476,
+       (GLfloat) 0.794672, (GLfloat) 0.483385, (GLfloat) - 0.200225,
+       (GLfloat) 0.779498, (GLfloat) 0.462404, (GLfloat) - 0.191534,
+       (GLfloat) 0.756788, (GLfloat) 0.448385, (GLfloat) - 0.185727,
+       (GLfloat) 0.730000, (GLfloat) 0.443462, (GLfloat) - 0.183688,
+       (GLfloat) 0.703212, (GLfloat) 0.448385, (GLfloat) - 0.185727,
+       (GLfloat) 0.680503, (GLfloat) 0.462404, (GLfloat) - 0.191534,
+       (GLfloat) 0.665328, (GLfloat) 0.483385, (GLfloat) - 0.200225,
+       (GLfloat) 0.660000, (GLfloat) 0.508134, (GLfloat) - 0.210476,
+       (GLfloat) 0.665328, (GLfloat) 0.532882, (GLfloat) - 0.220727,
+       (GLfloat) 0.680503, (GLfloat) 0.553863, (GLfloat) - 0.229418,
+       (GLfloat) 0.703212, (GLfloat) 0.567882, (GLfloat) - 0.235225,
+       (GLfloat) 0.730000, (GLfloat) 0.572805, (GLfloat) - 0.237264,
+       (GLfloat) 0.756788, (GLfloat) 0.602861, (GLfloat) - 0.119916,
+       (GLfloat) 0.779498, (GLfloat) 0.587978, (GLfloat) - 0.116956,
+       (GLfloat) 0.794672, (GLfloat) 0.565705, (GLfloat) - 0.112526,
+       (GLfloat) 0.800000, (GLfloat) 0.539432, (GLfloat) - 0.107300,
+       (GLfloat) 0.794672, (GLfloat) 0.513159, (GLfloat) - 0.102074,
+       (GLfloat) 0.779498, (GLfloat) 0.490885, (GLfloat) - 0.097643,
+       (GLfloat) 0.756788, (GLfloat) 0.476003, (GLfloat) - 0.094683,
+       (GLfloat) 0.730000, (GLfloat) 0.470777, (GLfloat) - 0.093643,
+       (GLfloat) 0.703212, (GLfloat) 0.476003, (GLfloat) - 0.094683,
+       (GLfloat) 0.680503, (GLfloat) 0.490885, (GLfloat) - 0.097643,
+       (GLfloat) 0.665328, (GLfloat) 0.513159, (GLfloat) - 0.102074,
+       (GLfloat) 0.660000, (GLfloat) 0.539432, (GLfloat) - 0.107300,
+       (GLfloat) 0.665328, (GLfloat) 0.565705, (GLfloat) - 0.112526,
+       (GLfloat) 0.680503, (GLfloat) 0.587978, (GLfloat) - 0.116956,
+       (GLfloat) 0.703212, (GLfloat) 0.602861, (GLfloat) - 0.119916,
+       (GLfloat) 0.730000, (GLfloat) 0.608087, (GLfloat) - 0.120956,
+       (GLfloat) 0.420000, (GLfloat) - 0.000000, (GLfloat) - 0.200000,
+       (GLfloat) 0.420000, (GLfloat) 0.051764, (GLfloat) - 0.193185,
+       (GLfloat) 0.420000, (GLfloat) 0.100000, (GLfloat) - 0.173205,
+       (GLfloat) 0.420000, (GLfloat) 0.141421, (GLfloat) - 0.141421,
+       (GLfloat) 0.420000, (GLfloat) 0.173205, (GLfloat) - 0.100000,
+       (GLfloat) 0.420000, (GLfloat) 0.193185, (GLfloat) - 0.051764,
+       (GLfloat) 0.420000, (GLfloat) 0.200000, (GLfloat) - 0.000000,
+       (GLfloat) 0.420000, (GLfloat) 0.193185, (GLfloat) 0.051764,
+       (GLfloat) 0.420000, (GLfloat) 0.173205, (GLfloat) 0.100000,
+       (GLfloat) 0.420000, (GLfloat) 0.141421, (GLfloat) 0.141421,
+       (GLfloat) 0.420000, (GLfloat) 0.100000, (GLfloat) 0.173205,
+       (GLfloat) 0.420000, (GLfloat) 0.051764, (GLfloat) 0.193185,
+       (GLfloat) 0.420000, (GLfloat) 0.000000, (GLfloat) 0.200000,
+       (GLfloat) 0.420000, (GLfloat) - 0.051764, (GLfloat) 0.193185,
+       (GLfloat) 0.420000, (GLfloat) - 0.100000, (GLfloat) 0.173205,
+       (GLfloat) 0.420000, (GLfloat) - 0.141421, (GLfloat) 0.141421,
+       (GLfloat) 0.420000, (GLfloat) - 0.173205, (GLfloat) 0.100000,
+       (GLfloat) 0.420000, (GLfloat) - 0.193185, (GLfloat) 0.051764,
+       (GLfloat) 0.420000, (GLfloat) - 0.200000, (GLfloat) 0.000000,
+       (GLfloat) 0.420000, (GLfloat) - 0.193185, (GLfloat) - 0.051764,
+       (GLfloat) 0.420000, (GLfloat) - 0.173205, (GLfloat) - 0.100000,
+       (GLfloat) 0.420000, (GLfloat) - 0.141421, (GLfloat) - 0.141421,
+       (GLfloat) 0.420000, (GLfloat) - 0.100000, (GLfloat) - 0.173205,
+       (GLfloat) 0.420000, (GLfloat) - 0.051764, (GLfloat) - 0.193185,
+       (GLfloat) 0.540000, (GLfloat) - 0.000000, (GLfloat) - 0.200000,
+       (GLfloat) 0.540000, (GLfloat) 0.051764, (GLfloat) - 0.193185,
+       (GLfloat) 0.540000, (GLfloat) 0.100000, (GLfloat) - 0.173205,
+       (GLfloat) 0.540000, (GLfloat) 0.141421, (GLfloat) - 0.141421,
+       (GLfloat) 0.540000, (GLfloat) 0.173205, (GLfloat) - 0.100000,
+       (GLfloat) 0.540000, (GLfloat) 0.193185, (GLfloat) - 0.051764,
+       (GLfloat) 0.540000, (GLfloat) 0.200000, (GLfloat) - 0.000000,
+       (GLfloat) 0.540000, (GLfloat) 0.193185, (GLfloat) 0.051764,
+       (GLfloat) 0.540000, (GLfloat) 0.173205, (GLfloat) 0.100000,
+       (GLfloat) 0.540000, (GLfloat) 0.141421, (GLfloat) 0.141421,
+       (GLfloat) 0.540000, (GLfloat) 0.100000, (GLfloat) 0.173205,
+       (GLfloat) 0.540000, (GLfloat) 0.051764, (GLfloat) 0.193185,
+       (GLfloat) 0.540000, (GLfloat) 0.000000, (GLfloat) 0.200000,
+       (GLfloat) 0.540000, (GLfloat) - 0.051764, (GLfloat) 0.193185,
+       (GLfloat) 0.540000, (GLfloat) - 0.100000, (GLfloat) 0.173205,
+       (GLfloat) 0.540000, (GLfloat) - 0.141421, (GLfloat) 0.141421,
+       (GLfloat) 0.540000, (GLfloat) - 0.173205, (GLfloat) 0.100000,
+       (GLfloat) 0.540000, (GLfloat) - 0.193185, (GLfloat) 0.051764,
+       (GLfloat) 0.540000, (GLfloat) - 0.200000, (GLfloat) 0.000000,
+       (GLfloat) 0.540000, (GLfloat) - 0.193185, (GLfloat) - 0.051764,
+       (GLfloat) 0.540000, (GLfloat) - 0.173205, (GLfloat) - 0.100000,
+       (GLfloat) 0.540000, (GLfloat) - 0.141421, (GLfloat) - 0.141421,
+       (GLfloat) 0.540000, (GLfloat) - 0.100000, (GLfloat) - 0.173205,
+       (GLfloat) 0.540000, (GLfloat) - 0.051764, (GLfloat) - 0.193185,
+       (GLfloat) 0.790000, (GLfloat) 0.060000, (GLfloat) - 0.000000,
+       (GLfloat) 0.785433, (GLfloat) 0.060000, (GLfloat) - 0.022961,
+       (GLfloat) 0.772426, (GLfloat) 0.060000, (GLfloat) - 0.042426,
+       (GLfloat) 0.752961, (GLfloat) 0.060000, (GLfloat) - 0.055433,
+       (GLfloat) 0.730000, (GLfloat) 0.060000, (GLfloat) - 0.060000,
+       (GLfloat) 0.707039, (GLfloat) 0.060000, (GLfloat) - 0.055433,
+       (GLfloat) 0.687574, (GLfloat) 0.060000, (GLfloat) - 0.042426,
+       (GLfloat) 0.674567, (GLfloat) 0.060000, (GLfloat) - 0.022961,
+       (GLfloat) 0.670000, (GLfloat) 0.060000, (GLfloat) - 0.000000,
+       (GLfloat) 0.674567, (GLfloat) 0.060000, (GLfloat) 0.022961,
+       (GLfloat) 0.687574, (GLfloat) 0.060000, (GLfloat) 0.042426,
+       (GLfloat) 0.707039, (GLfloat) 0.060000, (GLfloat) 0.055433,
+       (GLfloat) 0.730000, (GLfloat) 0.060000, (GLfloat) 0.060000,
+       (GLfloat) 0.752961, (GLfloat) 0.060000, (GLfloat) 0.055433,
+       (GLfloat) 0.772426, (GLfloat) 0.060000, (GLfloat) 0.042426,
+       (GLfloat) 0.785433, (GLfloat) 0.060000, (GLfloat) 0.022961,
+       (GLfloat) 0.790000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) 0.785433, (GLfloat) 0.550000, (GLfloat) - 0.022961,
+       (GLfloat) 0.772426, (GLfloat) 0.550000, (GLfloat) - 0.042426,
+       (GLfloat) 0.752961, (GLfloat) 0.550000, (GLfloat) - 0.055433,
+       (GLfloat) 0.730000, (GLfloat) 0.550000, (GLfloat) - 0.060000,
+       (GLfloat) 0.707039, (GLfloat) 0.550000, (GLfloat) - 0.055433,
+       (GLfloat) 0.687574, (GLfloat) 0.550000, (GLfloat) - 0.042426,
+       (GLfloat) 0.674567, (GLfloat) 0.550000, (GLfloat) - 0.022961,
+       (GLfloat) 0.670000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) 0.674567, (GLfloat) 0.550000, (GLfloat) 0.022961,
+       (GLfloat) 0.687574, (GLfloat) 0.550000, (GLfloat) 0.042426,
+       (GLfloat) 0.707039, (GLfloat) 0.550000, (GLfloat) 0.055433,
+       (GLfloat) 0.730000, (GLfloat) 0.550000, (GLfloat) 0.060000,
+       (GLfloat) 0.752961, (GLfloat) 0.550000, (GLfloat) 0.055433,
+       (GLfloat) 0.772426, (GLfloat) 0.550000, (GLfloat) 0.042426,
+       (GLfloat) 0.785433, (GLfloat) 0.550000, (GLfloat) 0.022961,
+       (GLfloat) 0.790000, (GLfloat) 0.000000, (GLfloat) 0.060000,
+       (GLfloat) 0.785433, (GLfloat) 0.022961, (GLfloat) 0.060000,
+       (GLfloat) 0.772426, (GLfloat) 0.042426, (GLfloat) 0.060000,
+       (GLfloat) 0.752961, (GLfloat) 0.055433, (GLfloat) 0.060000,
+       (GLfloat) 0.707039, (GLfloat) 0.055433, (GLfloat) 0.060000,
+       (GLfloat) 0.687574, (GLfloat) 0.042426, (GLfloat) 0.060000,
+       (GLfloat) 0.674567, (GLfloat) 0.022961, (GLfloat) 0.060000,
+       (GLfloat) 0.670000, (GLfloat) 0.000000, (GLfloat) 0.060000,
+       (GLfloat) 0.674567, (GLfloat) - 0.022961, (GLfloat) 0.060000,
+       (GLfloat) 0.687574, (GLfloat) - 0.042426, (GLfloat) 0.060000,
+       (GLfloat) 0.707039, (GLfloat) - 0.055433, (GLfloat) 0.060000,
+       (GLfloat) 0.730000, (GLfloat) - 0.060000, (GLfloat) 0.060000,
+       (GLfloat) 0.752961, (GLfloat) - 0.055433, (GLfloat) 0.060000,
+       (GLfloat) 0.772426, (GLfloat) - 0.042426, (GLfloat) 0.060000,
+       (GLfloat) 0.785433, (GLfloat) - 0.022961, (GLfloat) 0.060000,
+       (GLfloat) 0.790000, (GLfloat) 0.000000, (GLfloat) 0.550000,
+       (GLfloat) 0.785433, (GLfloat) 0.022961, (GLfloat) 0.550000,
+       (GLfloat) 0.772426, (GLfloat) 0.042426, (GLfloat) 0.550000,
+       (GLfloat) 0.752961, (GLfloat) 0.055433, (GLfloat) 0.550000,
+       (GLfloat) 0.730000, (GLfloat) 0.060000, (GLfloat) 0.550000,
+       (GLfloat) 0.707039, (GLfloat) 0.055433, (GLfloat) 0.550000,
+       (GLfloat) 0.687574, (GLfloat) 0.042426, (GLfloat) 0.550000,
+       (GLfloat) 0.674567, (GLfloat) 0.022961, (GLfloat) 0.550000,
+       (GLfloat) 0.670000, (GLfloat) 0.000000, (GLfloat) 0.550000,
+       (GLfloat) 0.674567, (GLfloat) - 0.022961, (GLfloat) 0.550000,
+       (GLfloat) 0.687574, (GLfloat) - 0.042426, (GLfloat) 0.550000,
+       (GLfloat) 0.707039, (GLfloat) - 0.055433, (GLfloat) 0.550000,
+       (GLfloat) 0.730000, (GLfloat) - 0.060000, (GLfloat) 0.550000,
+       (GLfloat) 0.752961, (GLfloat) - 0.055433, (GLfloat) 0.550000,
+       (GLfloat) 0.772426, (GLfloat) - 0.042426, (GLfloat) 0.550000,
+       (GLfloat) 0.785433, (GLfloat) - 0.022961, (GLfloat) 0.550000,
+       (GLfloat) 0.790000, (GLfloat) - 0.060000, (GLfloat) 0.000000,
+       (GLfloat) 0.785433, (GLfloat) - 0.060000, (GLfloat) 0.022961,
+       (GLfloat) 0.772426, (GLfloat) - 0.060000, (GLfloat) 0.042426,
+       (GLfloat) 0.752961, (GLfloat) - 0.060000, (GLfloat) 0.055433,
+       (GLfloat) 0.707039, (GLfloat) - 0.060000, (GLfloat) 0.055433,
+       (GLfloat) 0.687574, (GLfloat) - 0.060000, (GLfloat) 0.042426,
+       (GLfloat) 0.674567, (GLfloat) - 0.060000, (GLfloat) 0.022961,
+       (GLfloat) 0.670000, (GLfloat) - 0.060000, (GLfloat) 0.000000,
+       (GLfloat) 0.674567, (GLfloat) - 0.060000, (GLfloat) - 0.022961,
+       (GLfloat) 0.687574, (GLfloat) - 0.060000, (GLfloat) - 0.042426,
+       (GLfloat) 0.707039, (GLfloat) - 0.060000, (GLfloat) - 0.055433,
+       (GLfloat) 0.730000, (GLfloat) - 0.060000, (GLfloat) - 0.060000,
+       (GLfloat) 0.752961, (GLfloat) - 0.060000, (GLfloat) - 0.055433,
+       (GLfloat) 0.772426, (GLfloat) - 0.060000, (GLfloat) - 0.042426,
+       (GLfloat) 0.785433, (GLfloat) - 0.060000, (GLfloat) - 0.022961,
+       (GLfloat) 0.790000, (GLfloat) - 0.550000, (GLfloat) 0.000000,
+       (GLfloat) 0.785433, (GLfloat) - 0.550000, (GLfloat) 0.022961,
+       (GLfloat) 0.772426, (GLfloat) - 0.550000, (GLfloat) 0.042426,
+       (GLfloat) 0.752961, (GLfloat) - 0.550000, (GLfloat) 0.055433,
+       (GLfloat) 0.730000, (GLfloat) - 0.550000, (GLfloat) 0.060000,
+       (GLfloat) 0.707039, (GLfloat) - 0.550000, (GLfloat) 0.055433,
+       (GLfloat) 0.687574, (GLfloat) - 0.550000, (GLfloat) 0.042426,
+       (GLfloat) 0.674567, (GLfloat) - 0.550000, (GLfloat) 0.022961,
+       (GLfloat) 0.670000, (GLfloat) - 0.550000, (GLfloat) 0.000000,
+       (GLfloat) 0.674567, (GLfloat) - 0.550000, (GLfloat) - 0.022961,
+       (GLfloat) 0.687574, (GLfloat) - 0.550000, (GLfloat) - 0.042426,
+       (GLfloat) 0.707039, (GLfloat) - 0.550000, (GLfloat) - 0.055433,
+       (GLfloat) 0.730000, (GLfloat) - 0.550000, (GLfloat) - 0.060000,
+       (GLfloat) 0.752961, (GLfloat) - 0.550000, (GLfloat) - 0.055433,
+       (GLfloat) 0.772426, (GLfloat) - 0.550000, (GLfloat) - 0.042426,
+       (GLfloat) 0.785433, (GLfloat) - 0.550000, (GLfloat) - 0.022961,
+       (GLfloat) 0.790000, (GLfloat) - 0.000000, (GLfloat) - 0.060000,
+       (GLfloat) 0.785433, (GLfloat) - 0.022961, (GLfloat) - 0.060000,
+       (GLfloat) 0.772426, (GLfloat) - 0.042426, (GLfloat) - 0.060000,
+       (GLfloat) 0.752961, (GLfloat) - 0.055433, (GLfloat) - 0.060000,
+       (GLfloat) 0.707039, (GLfloat) - 0.055433, (GLfloat) - 0.060000,
+       (GLfloat) 0.687574, (GLfloat) - 0.042426, (GLfloat) - 0.060000,
+       (GLfloat) 0.674567, (GLfloat) - 0.022961, (GLfloat) - 0.060000,
+       (GLfloat) 0.670000, (GLfloat) - 0.000000, (GLfloat) - 0.060000,
+       (GLfloat) 0.674567, (GLfloat) 0.022961, (GLfloat) - 0.060000,
+       (GLfloat) 0.687574, (GLfloat) 0.042426, (GLfloat) - 0.060000,
+       (GLfloat) 0.707039, (GLfloat) 0.055433, (GLfloat) - 0.060000,
+       (GLfloat) 0.752961, (GLfloat) 0.055433, (GLfloat) - 0.060000,
+       (GLfloat) 0.772426, (GLfloat) 0.042426, (GLfloat) - 0.060000,
+       (GLfloat) 0.785433, (GLfloat) 0.022961, (GLfloat) - 0.060000,
+       (GLfloat) 0.790000, (GLfloat) - 0.000000, (GLfloat) - 0.550000,
+       (GLfloat) 0.785433, (GLfloat) - 0.022961, (GLfloat) - 0.550000,
+       (GLfloat) 0.772426, (GLfloat) - 0.042426, (GLfloat) - 0.550000,
+       (GLfloat) 0.752961, (GLfloat) - 0.055433, (GLfloat) - 0.550000,
+       (GLfloat) 0.730000, (GLfloat) - 0.060000, (GLfloat) - 0.550000,
+       (GLfloat) 0.707039, (GLfloat) - 0.055433, (GLfloat) - 0.550000,
+       (GLfloat) 0.687574, (GLfloat) - 0.042426, (GLfloat) - 0.550000,
+       (GLfloat) 0.674567, (GLfloat) - 0.022961, (GLfloat) - 0.550000,
+       (GLfloat) 0.670000, (GLfloat) - 0.000000, (GLfloat) - 0.550000,
+       (GLfloat) 0.674567, (GLfloat) 0.022961, (GLfloat) - 0.550000,
+       (GLfloat) 0.687574, (GLfloat) 0.042426, (GLfloat) - 0.550000,
+       (GLfloat) 0.707039, (GLfloat) 0.055433, (GLfloat) - 0.550000,
+       (GLfloat) 0.730000, (GLfloat) 0.060000, (GLfloat) - 0.550000,
+       (GLfloat) 0.752961, (GLfloat) 0.055433, (GLfloat) - 0.550000,
+       (GLfloat) 0.772426, (GLfloat) 0.042426, (GLfloat) - 0.550000,
+       (GLfloat) 0.785433, (GLfloat) 0.022961, (GLfloat) - 0.550000,
+       (GLfloat) 0.540000, (GLfloat) 0.000000, (GLfloat) - 0.100000,
+       (GLfloat) 0.540000, (GLfloat) 0.038268, (GLfloat) - 0.092388,
+       (GLfloat) 0.540000, (GLfloat) 0.070711, (GLfloat) - 0.070711,
+       (GLfloat) 0.540000, (GLfloat) 0.092388, (GLfloat) - 0.038268,
+       (GLfloat) 0.540000, (GLfloat) 0.100000, (GLfloat) - 0.000000,
+       (GLfloat) 0.540000, (GLfloat) 0.092388, (GLfloat) 0.038268,
+       (GLfloat) 0.540000, (GLfloat) 0.070711, (GLfloat) 0.070711,
+       (GLfloat) 0.540000, (GLfloat) 0.038268, (GLfloat) 0.092388,
+       (GLfloat) 0.540000, (GLfloat) 0.000000, (GLfloat) 0.100000,
+       (GLfloat) 0.540000, (GLfloat) - 0.038268, (GLfloat) 0.092388,
+       (GLfloat) 0.540000, (GLfloat) - 0.070711, (GLfloat) 0.070711,
+       (GLfloat) 0.540000, (GLfloat) - 0.092388, (GLfloat) 0.038268,
+       (GLfloat) 0.540000, (GLfloat) - 0.100000, (GLfloat) 0.000000,
+       (GLfloat) 0.540000, (GLfloat) - 0.092388, (GLfloat) - 0.038268,
+       (GLfloat) 0.540000, (GLfloat) - 0.070711, (GLfloat) - 0.070711,
+       (GLfloat) 0.540000, (GLfloat) - 0.038268, (GLfloat) - 0.092388,
+       (GLfloat) 0.800000, (GLfloat) 0.000000, (GLfloat) - 0.100000,
+       (GLfloat) 0.800000, (GLfloat) 0.038268, (GLfloat) - 0.092388,
+       (GLfloat) 0.800000, (GLfloat) 0.070711, (GLfloat) - 0.070711,
+       (GLfloat) 0.800000, (GLfloat) 0.092388, (GLfloat) - 0.038268,
+       (GLfloat) 0.800000, (GLfloat) 0.100000, (GLfloat) - 0.000000,
+       (GLfloat) 0.800000, (GLfloat) 0.092388, (GLfloat) 0.038268,
+       (GLfloat) 0.800000, (GLfloat) 0.070711, (GLfloat) 0.070711,
+       (GLfloat) 0.800000, (GLfloat) 0.038268, (GLfloat) 0.092388,
+       (GLfloat) 0.800000, (GLfloat) 0.000000, (GLfloat) 0.100000,
+       (GLfloat) 0.800000, (GLfloat) - 0.038268, (GLfloat) 0.092388,
+       (GLfloat) 0.800000, (GLfloat) - 0.070711, (GLfloat) 0.070711,
+       (GLfloat) 0.800000, (GLfloat) - 0.092388, (GLfloat) 0.038268,
+       (GLfloat) 0.800000, (GLfloat) - 0.100000, (GLfloat) 0.000000,
+       (GLfloat) 0.800000, (GLfloat) - 0.092388, (GLfloat) - 0.038268,
+       (GLfloat) 0.800000, (GLfloat) - 0.070711, (GLfloat) - 0.070711,
+       (GLfloat) 0.800000, (GLfloat) - 0.038268, (GLfloat) - 0.092388,
+};
+
+static GLfloat BigValve_normals[] =
+{
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.195090, (GLfloat) - 0.980785,
+       (GLfloat) - 0.000000, (GLfloat) 0.555570, (GLfloat) - 0.831470,
+       (GLfloat) - 0.000000, (GLfloat) 0.831470, (GLfloat) - 0.555570,
+       (GLfloat) - 0.000000, (GLfloat) 0.980785, (GLfloat) - 0.195090,
+       (GLfloat) - 0.000000, (GLfloat) 0.980785, (GLfloat) 0.195090,
+       (GLfloat) - 0.000000, (GLfloat) 0.831470, (GLfloat) 0.555570,
+       (GLfloat) - 0.000000, (GLfloat) 0.555570, (GLfloat) 0.831470,
+       (GLfloat) - 0.000000, (GLfloat) 0.195090, (GLfloat) 0.980785,
+       (GLfloat) - 0.000000, (GLfloat) - 0.195090, (GLfloat) 0.980785,
+       (GLfloat) - 0.000000, (GLfloat) - 0.555570, (GLfloat) 0.831470,
+       (GLfloat) - 0.000000, (GLfloat) - 0.831470, (GLfloat) 0.555570,
+       (GLfloat) - 0.000000, (GLfloat) - 0.980785, (GLfloat) 0.195090,
+       (GLfloat) 0.000000, (GLfloat) - 0.980785, (GLfloat) - 0.195090,
+       (GLfloat) 0.000000, (GLfloat) - 0.831470, (GLfloat) - 0.555570,
+       (GLfloat) 0.000000, (GLfloat) - 0.555570, (GLfloat) - 0.831470,
+       (GLfloat) 0.000000, (GLfloat) - 0.195090, (GLfloat) - 0.980785,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.980785, (GLfloat) - 0.195092, (GLfloat) - 0.000000,
+       (GLfloat) 0.831470, (GLfloat) - 0.555569, (GLfloat) - 0.000000,
+       (GLfloat) 0.555569, (GLfloat) - 0.831470, (GLfloat) - 0.000000,
+       (GLfloat) 0.195091, (GLfloat) - 0.980785, (GLfloat) - 0.000000,
+       (GLfloat) - 0.195090, (GLfloat) - 0.980785, (GLfloat) - 0.000000,
+       (GLfloat) - 0.555570, (GLfloat) - 0.831469, (GLfloat) - 0.000000,
+       (GLfloat) - 0.831469, (GLfloat) - 0.555571, (GLfloat) - 0.000000,
+       (GLfloat) - 0.980785, (GLfloat) - 0.195089, (GLfloat) 0.000000,
+       (GLfloat) - 0.980785, (GLfloat) 0.195089, (GLfloat) - 0.000000,
+       (GLfloat) - 0.831469, (GLfloat) 0.555571, (GLfloat) - 0.000000,
+       (GLfloat) - 0.555570, (GLfloat) 0.831469, (GLfloat) - 0.000000,
+       (GLfloat) - 0.195090, (GLfloat) 0.980785, (GLfloat) - 0.000000,
+       (GLfloat) 0.195091, (GLfloat) 0.980785, (GLfloat) 0.000000,
+       (GLfloat) 0.555569, (GLfloat) 0.831470, (GLfloat) 0.000000,
+       (GLfloat) 0.831470, (GLfloat) 0.555569, (GLfloat) 0.000000,
+       (GLfloat) 0.980785, (GLfloat) 0.195092, (GLfloat) - 0.000000,
+       (GLfloat) 0.980785, (GLfloat) 0.000000, (GLfloat) 0.195092,
+       (GLfloat) 0.831470, (GLfloat) 0.000000, (GLfloat) 0.555569,
+       (GLfloat) 0.555569, (GLfloat) 0.000000, (GLfloat) 0.831470,
+       (GLfloat) 0.195091, (GLfloat) 0.000000, (GLfloat) 0.980785,
+       (GLfloat) - 0.195090, (GLfloat) 0.000000, (GLfloat) 0.980785,
+       (GLfloat) - 0.555570, (GLfloat) 0.000000, (GLfloat) 0.831469,
+       (GLfloat) - 0.831469, (GLfloat) 0.000000, (GLfloat) 0.555571,
+       (GLfloat) - 0.980785, (GLfloat) 0.000000, (GLfloat) 0.195089,
+       (GLfloat) - 0.980785, (GLfloat) - 0.000000, (GLfloat) - 0.195089,
+       (GLfloat) - 0.831469, (GLfloat) - 0.000000, (GLfloat) - 0.555571,
+       (GLfloat) - 0.555570, (GLfloat) - 0.000000, (GLfloat) - 0.831469,
+       (GLfloat) - 0.195090, (GLfloat) - 0.000000, (GLfloat) - 0.980785,
+       (GLfloat) 0.195091, (GLfloat) 0.000000, (GLfloat) - 0.980785,
+       (GLfloat) 0.555569, (GLfloat) 0.000000, (GLfloat) - 0.831470,
+       (GLfloat) 0.831470, (GLfloat) 0.000000, (GLfloat) - 0.555569,
+       (GLfloat) 0.980785, (GLfloat) - 0.000000, (GLfloat) - 0.195092,
+       (GLfloat) 0.980785, (GLfloat) 0.195092, (GLfloat) - 0.000000,
+       (GLfloat) 0.831470, (GLfloat) 0.555569, (GLfloat) - 0.000000,
+       (GLfloat) 0.555569, (GLfloat) 0.831470, (GLfloat) - 0.000000,
+       (GLfloat) 0.195091, (GLfloat) 0.980785, (GLfloat) - 0.000000,
+       (GLfloat) - 0.195090, (GLfloat) 0.980785, (GLfloat) - 0.000000,
+       (GLfloat) - 0.555570, (GLfloat) 0.831469, (GLfloat) - 0.000000,
+       (GLfloat) - 0.831469, (GLfloat) 0.555571, (GLfloat) - 0.000000,
+       (GLfloat) - 0.980785, (GLfloat) 0.195089, (GLfloat) - 0.000000,
+       (GLfloat) - 0.980785, (GLfloat) - 0.195089, (GLfloat) 0.000000,
+       (GLfloat) - 0.831469, (GLfloat) - 0.555571, (GLfloat) 0.000000,
+       (GLfloat) - 0.555570, (GLfloat) - 0.831469, (GLfloat) 0.000000,
+       (GLfloat) - 0.195090, (GLfloat) - 0.980785, (GLfloat) 0.000000,
+       (GLfloat) 0.195091, (GLfloat) - 0.980785, (GLfloat) - 0.000000,
+       (GLfloat) 0.555569, (GLfloat) - 0.831470, (GLfloat) - 0.000000,
+       (GLfloat) 0.831470, (GLfloat) - 0.555569, (GLfloat) - 0.000000,
+       (GLfloat) 0.980785, (GLfloat) - 0.195092, (GLfloat) 0.000000,
+       (GLfloat) 0.980785, (GLfloat) 0.000000, (GLfloat) - 0.195092,
+       (GLfloat) 0.831470, (GLfloat) 0.000000, (GLfloat) - 0.555569,
+       (GLfloat) 0.555569, (GLfloat) 0.000000, (GLfloat) - 0.831470,
+       (GLfloat) 0.195091, (GLfloat) 0.000000, (GLfloat) - 0.980785,
+       (GLfloat) - 0.195090, (GLfloat) 0.000000, (GLfloat) - 0.980785,
+       (GLfloat) - 0.555570, (GLfloat) 0.000000, (GLfloat) - 0.831469,
+       (GLfloat) - 0.831469, (GLfloat) 0.000000, (GLfloat) - 0.555571,
+       (GLfloat) - 0.980785, (GLfloat) 0.000000, (GLfloat) - 0.195089,
+       (GLfloat) - 0.980785, (GLfloat) 0.000000, (GLfloat) 0.195089,
+       (GLfloat) - 0.831469, (GLfloat) 0.000000, (GLfloat) 0.555571,
+       (GLfloat) - 0.555570, (GLfloat) 0.000000, (GLfloat) 0.831469,
+       (GLfloat) - 0.195090, (GLfloat) 0.000000, (GLfloat) 0.980785,
+       (GLfloat) 0.195091, (GLfloat) - 0.000000, (GLfloat) 0.980785,
+       (GLfloat) 0.555569, (GLfloat) - 0.000000, (GLfloat) 0.831470,
+       (GLfloat) 0.831470, (GLfloat) - 0.000000, (GLfloat) 0.555569,
+       (GLfloat) 0.980785, (GLfloat) - 0.000000, (GLfloat) 0.195092,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.130526, (GLfloat) - 0.991445,
+       (GLfloat) - 0.000000, (GLfloat) 0.382684, (GLfloat) - 0.923880,
+       (GLfloat) - 0.000000, (GLfloat) 0.608761, (GLfloat) - 0.793353,
+       (GLfloat) - 0.000000, (GLfloat) 0.793353, (GLfloat) - 0.608761,
+       (GLfloat) - 0.000000, (GLfloat) 0.923880, (GLfloat) - 0.382684,
+       (GLfloat) - 0.000000, (GLfloat) 0.991445, (GLfloat) - 0.130526,
+       (GLfloat) - 0.000000, (GLfloat) 0.991445, (GLfloat) 0.130526,
+       (GLfloat) - 0.000000, (GLfloat) 0.923880, (GLfloat) 0.382684,
+       (GLfloat) - 0.000000, (GLfloat) 0.793353, (GLfloat) 0.608761,
+       (GLfloat) - 0.000000, (GLfloat) 0.608761, (GLfloat) 0.793353,
+       (GLfloat) - 0.000000, (GLfloat) 0.382684, (GLfloat) 0.923880,
+       (GLfloat) - 0.000000, (GLfloat) 0.130526, (GLfloat) 0.991445,
+       (GLfloat) - 0.000000, (GLfloat) - 0.130526, (GLfloat) 0.991445,
+       (GLfloat) - 0.000000, (GLfloat) - 0.382684, (GLfloat) 0.923880,
+       (GLfloat) - 0.000000, (GLfloat) - 0.608761, (GLfloat) 0.793353,
+       (GLfloat) - 0.000000, (GLfloat) - 0.793353, (GLfloat) 0.608761,
+       (GLfloat) - 0.000000, (GLfloat) - 0.923880, (GLfloat) 0.382684,
+       (GLfloat) - 0.000000, (GLfloat) - 0.991445, (GLfloat) 0.130526,
+       (GLfloat) 0.000000, (GLfloat) - 0.991445, (GLfloat) - 0.130526,
+       (GLfloat) 0.000000, (GLfloat) - 0.923880, (GLfloat) - 0.382684,
+       (GLfloat) 0.000000, (GLfloat) - 0.793353, (GLfloat) - 0.608761,
+       (GLfloat) 0.000000, (GLfloat) - 0.608761, (GLfloat) - 0.793353,
+       (GLfloat) 0.000000, (GLfloat) - 0.382684, (GLfloat) - 0.923880,
+       (GLfloat) 0.000000, (GLfloat) - 0.130526, (GLfloat) - 0.991445,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.194185, (GLfloat) 0.976241, (GLfloat) 0.096151,
+       (GLfloat) - 0.194185, (GLfloat) 0.976241, (GLfloat) 0.096151,
+       (GLfloat) - 0.553718, (GLfloat) 0.828695, (GLfloat) 0.081619,
+       (GLfloat) - 0.830228, (GLfloat) 0.554740, (GLfloat) 0.054637,
+       (GLfloat) - 0.980604, (GLfloat) 0.195054, (GLfloat) 0.019211,
+       (GLfloat) - 0.980605, (GLfloat) - 0.195053, (GLfloat) - 0.019211,
+       (GLfloat) - 0.830227, (GLfloat) - 0.554741, (GLfloat) - 0.054637,
+       (GLfloat) - 0.553717, (GLfloat) - 0.828695, (GLfloat) - 0.081619,
+       (GLfloat) - 0.194187, (GLfloat) - 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) 0.194188, (GLfloat) - 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) 0.553716, (GLfloat) - 0.828696, (GLfloat) - 0.081619,
+       (GLfloat) 0.830227, (GLfloat) - 0.554741, (GLfloat) - 0.054637,
+       (GLfloat) 0.980604, (GLfloat) - 0.195053, (GLfloat) - 0.019211,
+       (GLfloat) 0.980604, (GLfloat) 0.195054, (GLfloat) 0.019211,
+       (GLfloat) 0.830228, (GLfloat) 0.554740, (GLfloat) 0.054637,
+       (GLfloat) 0.553717, (GLfloat) 0.828695, (GLfloat) 0.081619,
+       (GLfloat) 0.194186, (GLfloat) 0.938725, (GLfloat) 0.284759,
+       (GLfloat) - 0.194185, (GLfloat) 0.938725, (GLfloat) 0.284759,
+       (GLfloat) - 0.553717, (GLfloat) 0.796849, (GLfloat) 0.241721,
+       (GLfloat) - 0.830228, (GLfloat) 0.533421, (GLfloat) 0.161812,
+       (GLfloat) - 0.980604, (GLfloat) 0.187558, (GLfloat) 0.056895,
+       (GLfloat) - 0.980604, (GLfloat) - 0.187558, (GLfloat) - 0.056895,
+       (GLfloat) - 0.830227, (GLfloat) - 0.533422, (GLfloat) - 0.161812,
+       (GLfloat) - 0.553717, (GLfloat) - 0.796849, (GLfloat) - 0.241722,
+       (GLfloat) - 0.194186, (GLfloat) - 0.938725, (GLfloat) - 0.284759,
+       (GLfloat) 0.194187, (GLfloat) - 0.938724, (GLfloat) - 0.284759,
+       (GLfloat) 0.553716, (GLfloat) - 0.796849, (GLfloat) - 0.241722,
+       (GLfloat) 0.830227, (GLfloat) - 0.533422, (GLfloat) - 0.161812,
+       (GLfloat) 0.980604, (GLfloat) - 0.187558, (GLfloat) - 0.056895,
+       (GLfloat) 0.980604, (GLfloat) 0.187558, (GLfloat) 0.056895,
+       (GLfloat) 0.830228, (GLfloat) 0.533421, (GLfloat) 0.161811,
+       (GLfloat) 0.553716, (GLfloat) 0.796850, (GLfloat) 0.241722,
+       (GLfloat) 0.194186, (GLfloat) 0.865134, (GLfloat) 0.462423,
+       (GLfloat) - 0.194185, (GLfloat) 0.865134, (GLfloat) 0.462424,
+       (GLfloat) - 0.553717, (GLfloat) 0.734380, (GLfloat) 0.392534,
+       (GLfloat) - 0.830228, (GLfloat) 0.491604, (GLfloat) 0.262768,
+       (GLfloat) - 0.980604, (GLfloat) 0.172854, (GLfloat) 0.092393,
+       (GLfloat) - 0.980604, (GLfloat) - 0.172854, (GLfloat) - 0.092393,
+       (GLfloat) - 0.830227, (GLfloat) - 0.491605, (GLfloat) - 0.262768,
+       (GLfloat) - 0.553717, (GLfloat) - 0.734380, (GLfloat) - 0.392534,
+       (GLfloat) - 0.194187, (GLfloat) - 0.865134, (GLfloat) - 0.462424,
+       (GLfloat) 0.194187, (GLfloat) - 0.865134, (GLfloat) - 0.462423,
+       (GLfloat) 0.553716, (GLfloat) - 0.734381, (GLfloat) - 0.392534,
+       (GLfloat) 0.830227, (GLfloat) - 0.491605, (GLfloat) - 0.262768,
+       (GLfloat) 0.980604, (GLfloat) - 0.172854, (GLfloat) - 0.092393,
+       (GLfloat) 0.980604, (GLfloat) 0.172854, (GLfloat) 0.092393,
+       (GLfloat) 0.830228, (GLfloat) 0.491604, (GLfloat) 0.262768,
+       (GLfloat) 0.553716, (GLfloat) 0.734381, (GLfloat) 0.392535,
+       (GLfloat) 0.194186, (GLfloat) 0.758296, (GLfloat) 0.622317,
+       (GLfloat) - 0.194186, (GLfloat) 0.758296, (GLfloat) 0.622318,
+       (GLfloat) - 0.553717, (GLfloat) 0.643690, (GLfloat) 0.528263,
+       (GLfloat) - 0.830228, (GLfloat) 0.430895, (GLfloat) 0.353626,
+       (GLfloat) - 0.980604, (GLfloat) 0.151508, (GLfloat) 0.124340,
+       (GLfloat) - 0.980604, (GLfloat) - 0.151508, (GLfloat) - 0.124339,
+       (GLfloat) - 0.830227, (GLfloat) - 0.430895, (GLfloat) - 0.353627,
+       (GLfloat) - 0.553717, (GLfloat) - 0.643690, (GLfloat) - 0.528263,
+       (GLfloat) - 0.194186, (GLfloat) - 0.758296, (GLfloat) - 0.622317,
+       (GLfloat) 0.194186, (GLfloat) - 0.758296, (GLfloat) - 0.622318,
+       (GLfloat) 0.553716, (GLfloat) - 0.643690, (GLfloat) - 0.528263,
+       (GLfloat) 0.830227, (GLfloat) - 0.430895, (GLfloat) - 0.353627,
+       (GLfloat) 0.980604, (GLfloat) - 0.151508, (GLfloat) - 0.124339,
+       (GLfloat) 0.980604, (GLfloat) 0.151508, (GLfloat) 0.124340,
+       (GLfloat) 0.830228, (GLfloat) 0.430895, (GLfloat) 0.353626,
+       (GLfloat) 0.553716, (GLfloat) 0.643690, (GLfloat) 0.528263,
+       (GLfloat) 0.194186, (GLfloat) 0.622317, (GLfloat) 0.758296,
+       (GLfloat) - 0.194185, (GLfloat) 0.622318, (GLfloat) 0.758296,
+       (GLfloat) - 0.553717, (GLfloat) 0.528263, (GLfloat) 0.643690,
+       (GLfloat) - 0.830228, (GLfloat) 0.353626, (GLfloat) 0.430895,
+       (GLfloat) - 0.980604, (GLfloat) 0.124339, (GLfloat) 0.151508,
+       (GLfloat) - 0.980604, (GLfloat) - 0.124339, (GLfloat) - 0.151508,
+       (GLfloat) - 0.830227, (GLfloat) - 0.353627, (GLfloat) - 0.430895,
+       (GLfloat) - 0.553717, (GLfloat) - 0.528262, (GLfloat) - 0.643689,
+       (GLfloat) - 0.194187, (GLfloat) - 0.622317, (GLfloat) - 0.758296,
+       (GLfloat) 0.194187, (GLfloat) - 0.622317, (GLfloat) - 0.758296,
+       (GLfloat) 0.553716, (GLfloat) - 0.528263, (GLfloat) - 0.643690,
+       (GLfloat) 0.830227, (GLfloat) - 0.353627, (GLfloat) - 0.430895,
+       (GLfloat) 0.980604, (GLfloat) - 0.124339, (GLfloat) - 0.151508,
+       (GLfloat) 0.980604, (GLfloat) 0.124340, (GLfloat) 0.151508,
+       (GLfloat) 0.830228, (GLfloat) 0.353626, (GLfloat) 0.430895,
+       (GLfloat) 0.553716, (GLfloat) 0.528263, (GLfloat) 0.643690,
+       (GLfloat) 0.194186, (GLfloat) 0.462423, (GLfloat) 0.865134,
+       (GLfloat) - 0.194185, (GLfloat) 0.462424, (GLfloat) 0.865134,
+       (GLfloat) - 0.553717, (GLfloat) 0.392534, (GLfloat) 0.734380,
+       (GLfloat) - 0.830228, (GLfloat) 0.262768, (GLfloat) 0.491604,
+       (GLfloat) - 0.980604, (GLfloat) 0.092393, (GLfloat) 0.172855,
+       (GLfloat) - 0.980604, (GLfloat) - 0.092392, (GLfloat) - 0.172854,
+       (GLfloat) - 0.830227, (GLfloat) - 0.262768, (GLfloat) - 0.491605,
+       (GLfloat) - 0.553717, (GLfloat) - 0.392534, (GLfloat) - 0.734380,
+       (GLfloat) - 0.194186, (GLfloat) - 0.462424, (GLfloat) - 0.865134,
+       (GLfloat) 0.194187, (GLfloat) - 0.462423, (GLfloat) - 0.865134,
+       (GLfloat) 0.553716, (GLfloat) - 0.392535, (GLfloat) - 0.734381,
+       (GLfloat) 0.830227, (GLfloat) - 0.262768, (GLfloat) - 0.491605,
+       (GLfloat) 0.980604, (GLfloat) - 0.092392, (GLfloat) - 0.172854,
+       (GLfloat) 0.980604, (GLfloat) 0.092393, (GLfloat) 0.172855,
+       (GLfloat) 0.830228, (GLfloat) 0.262768, (GLfloat) 0.491604,
+       (GLfloat) 0.553716, (GLfloat) 0.392535, (GLfloat) 0.734381,
+       (GLfloat) 0.194185, (GLfloat) 0.284759, (GLfloat) 0.938725,
+       (GLfloat) - 0.194185, (GLfloat) 0.284759, (GLfloat) 0.938725,
+       (GLfloat) - 0.553718, (GLfloat) 0.241721, (GLfloat) 0.796848,
+       (GLfloat) - 0.830228, (GLfloat) 0.161812, (GLfloat) 0.533422,
+       (GLfloat) - 0.980604, (GLfloat) 0.056895, (GLfloat) 0.187558,
+       (GLfloat) - 0.980604, (GLfloat) - 0.056895, (GLfloat) - 0.187558,
+       (GLfloat) - 0.830227, (GLfloat) - 0.161812, (GLfloat) - 0.533423,
+       (GLfloat) - 0.553717, (GLfloat) - 0.241722, (GLfloat) - 0.796849,
+       (GLfloat) - 0.194187, (GLfloat) - 0.284759, (GLfloat) - 0.938725,
+       (GLfloat) 0.194188, (GLfloat) - 0.284759, (GLfloat) - 0.938724,
+       (GLfloat) 0.553716, (GLfloat) - 0.241722, (GLfloat) - 0.796849,
+       (GLfloat) 0.830227, (GLfloat) - 0.161812, (GLfloat) - 0.533423,
+       (GLfloat) 0.980604, (GLfloat) - 0.056895, (GLfloat) - 0.187557,
+       (GLfloat) 0.980604, (GLfloat) 0.056895, (GLfloat) 0.187558,
+       (GLfloat) 0.830228, (GLfloat) 0.161812, (GLfloat) 0.533422,
+       (GLfloat) 0.553717, (GLfloat) 0.241722, (GLfloat) 0.796849,
+       (GLfloat) 0.194186, (GLfloat) 0.096151, (GLfloat) 0.976241,
+       (GLfloat) - 0.194186, (GLfloat) 0.096151, (GLfloat) 0.976241,
+       (GLfloat) - 0.553717, (GLfloat) 0.081619, (GLfloat) 0.828695,
+       (GLfloat) - 0.830228, (GLfloat) 0.054637, (GLfloat) 0.554740,
+       (GLfloat) - 0.980604, (GLfloat) 0.019211, (GLfloat) 0.195054,
+       (GLfloat) - 0.980604, (GLfloat) - 0.019211, (GLfloat) - 0.195054,
+       (GLfloat) - 0.830227, (GLfloat) - 0.054637, (GLfloat) - 0.554741,
+       (GLfloat) - 0.553717, (GLfloat) - 0.081619, (GLfloat) - 0.828695,
+       (GLfloat) - 0.194187, (GLfloat) - 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) 0.194187, (GLfloat) - 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) 0.553716, (GLfloat) - 0.081619, (GLfloat) - 0.828696,
+       (GLfloat) 0.830227, (GLfloat) - 0.054637, (GLfloat) - 0.554741,
+       (GLfloat) 0.980604, (GLfloat) - 0.019211, (GLfloat) - 0.195054,
+       (GLfloat) 0.980604, (GLfloat) 0.019211, (GLfloat) 0.195054,
+       (GLfloat) 0.830228, (GLfloat) 0.054637, (GLfloat) 0.554740,
+       (GLfloat) 0.553716, (GLfloat) 0.081619, (GLfloat) 0.828696,
+       (GLfloat) 0.194185, (GLfloat) - 0.096151, (GLfloat) 0.976241,
+       (GLfloat) - 0.194185, (GLfloat) - 0.096151, (GLfloat) 0.976241,
+       (GLfloat) - 0.553718, (GLfloat) - 0.081619, (GLfloat) 0.828695,
+       (GLfloat) - 0.830228, (GLfloat) - 0.054637, (GLfloat) 0.554740,
+       (GLfloat) - 0.980604, (GLfloat) - 0.019211, (GLfloat) 0.195054,
+       (GLfloat) - 0.980605, (GLfloat) 0.019211, (GLfloat) - 0.195053,
+       (GLfloat) - 0.830227, (GLfloat) 0.054637, (GLfloat) - 0.554741,
+       (GLfloat) - 0.553717, (GLfloat) 0.081619, (GLfloat) - 0.828695,
+       (GLfloat) - 0.194187, (GLfloat) 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) 0.194188, (GLfloat) 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) 0.553716, (GLfloat) 0.081619, (GLfloat) - 0.828696,
+       (GLfloat) 0.830227, (GLfloat) 0.054637, (GLfloat) - 0.554741,
+       (GLfloat) 0.980604, (GLfloat) 0.019211, (GLfloat) - 0.195053,
+       (GLfloat) 0.980604, (GLfloat) - 0.019211, (GLfloat) 0.195054,
+       (GLfloat) 0.830228, (GLfloat) - 0.054637, (GLfloat) 0.554740,
+       (GLfloat) 0.553717, (GLfloat) - 0.081619, (GLfloat) 0.828695,
+       (GLfloat) 0.194186, (GLfloat) - 0.284759, (GLfloat) 0.938725,
+       (GLfloat) - 0.194185, (GLfloat) - 0.284759, (GLfloat) 0.938725,
+       (GLfloat) - 0.553717, (GLfloat) - 0.241721, (GLfloat) 0.796849,
+       (GLfloat) - 0.830228, (GLfloat) - 0.161812, (GLfloat) 0.533421,
+       (GLfloat) - 0.980604, (GLfloat) - 0.056895, (GLfloat) 0.187558,
+       (GLfloat) - 0.980604, (GLfloat) 0.056895, (GLfloat) - 0.187558,
+       (GLfloat) - 0.830227, (GLfloat) 0.161812, (GLfloat) - 0.533422,
+       (GLfloat) - 0.553717, (GLfloat) 0.241722, (GLfloat) - 0.796849,
+       (GLfloat) - 0.194186, (GLfloat) 0.284759, (GLfloat) - 0.938725,
+       (GLfloat) 0.194187, (GLfloat) 0.284759, (GLfloat) - 0.938724,
+       (GLfloat) 0.553716, (GLfloat) 0.241722, (GLfloat) - 0.796849,
+       (GLfloat) 0.830227, (GLfloat) 0.161812, (GLfloat) - 0.533422,
+       (GLfloat) 0.980604, (GLfloat) 0.056895, (GLfloat) - 0.187558,
+       (GLfloat) 0.980604, (GLfloat) - 0.056895, (GLfloat) 0.187558,
+       (GLfloat) 0.830228, (GLfloat) - 0.161811, (GLfloat) 0.533421,
+       (GLfloat) 0.553716, (GLfloat) - 0.241722, (GLfloat) 0.796850,
+       (GLfloat) 0.194186, (GLfloat) - 0.462423, (GLfloat) 0.865134,
+       (GLfloat) - 0.194185, (GLfloat) - 0.462424, (GLfloat) 0.865134,
+       (GLfloat) - 0.553717, (GLfloat) - 0.392534, (GLfloat) 0.734380,
+       (GLfloat) - 0.830228, (GLfloat) - 0.262768, (GLfloat) 0.491604,
+       (GLfloat) - 0.980604, (GLfloat) - 0.092393, (GLfloat) 0.172854,
+       (GLfloat) - 0.980604, (GLfloat) 0.092393, (GLfloat) - 0.172854,
+       (GLfloat) - 0.830227, (GLfloat) 0.262768, (GLfloat) - 0.491605,
+       (GLfloat) - 0.553717, (GLfloat) 0.392534, (GLfloat) - 0.734380,
+       (GLfloat) - 0.194187, (GLfloat) 0.462424, (GLfloat) - 0.865134,
+       (GLfloat) 0.194187, (GLfloat) 0.462423, (GLfloat) - 0.865134,
+       (GLfloat) 0.553716, (GLfloat) 0.392534, (GLfloat) - 0.734381,
+       (GLfloat) 0.830227, (GLfloat) 0.262768, (GLfloat) - 0.491605,
+       (GLfloat) 0.980604, (GLfloat) 0.092393, (GLfloat) - 0.172854,
+       (GLfloat) 0.980604, (GLfloat) - 0.092393, (GLfloat) 0.172854,
+       (GLfloat) 0.830228, (GLfloat) - 0.262768, (GLfloat) 0.491604,
+       (GLfloat) 0.553716, (GLfloat) - 0.392535, (GLfloat) 0.734381,
+       (GLfloat) 0.194186, (GLfloat) - 0.622317, (GLfloat) 0.758296,
+       (GLfloat) - 0.194186, (GLfloat) - 0.622318, (GLfloat) 0.758296,
+       (GLfloat) - 0.553717, (GLfloat) - 0.528263, (GLfloat) 0.643690,
+       (GLfloat) - 0.830228, (GLfloat) - 0.353626, (GLfloat) 0.430895,
+       (GLfloat) - 0.980604, (GLfloat) - 0.124340, (GLfloat) 0.151508,
+       (GLfloat) - 0.980604, (GLfloat) 0.124339, (GLfloat) - 0.151508,
+       (GLfloat) - 0.830227, (GLfloat) 0.353627, (GLfloat) - 0.430895,
+       (GLfloat) - 0.553717, (GLfloat) 0.528263, (GLfloat) - 0.643690,
+       (GLfloat) - 0.194186, (GLfloat) 0.622317, (GLfloat) - 0.758296,
+       (GLfloat) 0.194186, (GLfloat) 0.622318, (GLfloat) - 0.758296,
+       (GLfloat) 0.553716, (GLfloat) 0.528263, (GLfloat) - 0.643690,
+       (GLfloat) 0.830227, (GLfloat) 0.353627, (GLfloat) - 0.430895,
+       (GLfloat) 0.980604, (GLfloat) 0.124339, (GLfloat) - 0.151508,
+       (GLfloat) 0.980604, (GLfloat) - 0.124340, (GLfloat) 0.151508,
+       (GLfloat) 0.830228, (GLfloat) - 0.353626, (GLfloat) 0.430895,
+       (GLfloat) 0.553716, (GLfloat) - 0.528263, (GLfloat) 0.643690,
+       (GLfloat) 0.194186, (GLfloat) - 0.758296, (GLfloat) 0.622317,
+       (GLfloat) - 0.194185, (GLfloat) - 0.758296, (GLfloat) 0.622318,
+       (GLfloat) - 0.553717, (GLfloat) - 0.643690, (GLfloat) 0.528263,
+       (GLfloat) - 0.830228, (GLfloat) - 0.430895, (GLfloat) 0.353626,
+       (GLfloat) - 0.980604, (GLfloat) - 0.151508, (GLfloat) 0.124339,
+       (GLfloat) - 0.980604, (GLfloat) 0.151508, (GLfloat) - 0.124339,
+       (GLfloat) - 0.830227, (GLfloat) 0.430895, (GLfloat) - 0.353627,
+       (GLfloat) - 0.553717, (GLfloat) 0.643689, (GLfloat) - 0.528262,
+       (GLfloat) - 0.194187, (GLfloat) 0.758296, (GLfloat) - 0.622317,
+       (GLfloat) 0.194187, (GLfloat) 0.758296, (GLfloat) - 0.622317,
+       (GLfloat) 0.553716, (GLfloat) 0.643690, (GLfloat) - 0.528263,
+       (GLfloat) 0.830227, (GLfloat) 0.430895, (GLfloat) - 0.353627,
+       (GLfloat) 0.980604, (GLfloat) 0.151508, (GLfloat) - 0.124339,
+       (GLfloat) 0.980604, (GLfloat) - 0.151508, (GLfloat) 0.124340,
+       (GLfloat) 0.830228, (GLfloat) - 0.430895, (GLfloat) 0.353626,
+       (GLfloat) 0.553716, (GLfloat) - 0.643690, (GLfloat) 0.528263,
+       (GLfloat) 0.194186, (GLfloat) - 0.865134, (GLfloat) 0.462423,
+       (GLfloat) - 0.194185, (GLfloat) - 0.865134, (GLfloat) 0.462424,
+       (GLfloat) - 0.553717, (GLfloat) - 0.734380, (GLfloat) 0.392534,
+       (GLfloat) - 0.830228, (GLfloat) - 0.491604, (GLfloat) 0.262768,
+       (GLfloat) - 0.980604, (GLfloat) - 0.172855, (GLfloat) 0.092393,
+       (GLfloat) - 0.980604, (GLfloat) 0.172854, (GLfloat) - 0.092393,
+       (GLfloat) - 0.830227, (GLfloat) 0.491605, (GLfloat) - 0.262768,
+       (GLfloat) - 0.553717, (GLfloat) 0.734380, (GLfloat) - 0.392534,
+       (GLfloat) - 0.194186, (GLfloat) 0.865134, (GLfloat) - 0.462424,
+       (GLfloat) 0.194187, (GLfloat) 0.865134, (GLfloat) - 0.462423,
+       (GLfloat) 0.553716, (GLfloat) 0.734381, (GLfloat) - 0.392535,
+       (GLfloat) 0.830228, (GLfloat) 0.491605, (GLfloat) - 0.262768,
+       (GLfloat) 0.980604, (GLfloat) 0.172854, (GLfloat) - 0.092393,
+       (GLfloat) 0.980604, (GLfloat) - 0.172855, (GLfloat) 0.092393,
+       (GLfloat) 0.830228, (GLfloat) - 0.491604, (GLfloat) 0.262768,
+       (GLfloat) 0.553716, (GLfloat) - 0.734381, (GLfloat) 0.392535,
+       (GLfloat) 0.194185, (GLfloat) - 0.938725, (GLfloat) 0.284759,
+       (GLfloat) - 0.194185, (GLfloat) - 0.938725, (GLfloat) 0.284759,
+       (GLfloat) - 0.553718, (GLfloat) - 0.796848, (GLfloat) 0.241721,
+       (GLfloat) - 0.830228, (GLfloat) - 0.533422, (GLfloat) 0.161812,
+       (GLfloat) - 0.980604, (GLfloat) - 0.187558, (GLfloat) 0.056895,
+       (GLfloat) - 0.980605, (GLfloat) 0.187557, (GLfloat) - 0.056895,
+       (GLfloat) - 0.830227, (GLfloat) 0.533423, (GLfloat) - 0.161812,
+       (GLfloat) - 0.553717, (GLfloat) 0.796849, (GLfloat) - 0.241722,
+       (GLfloat) - 0.194187, (GLfloat) 0.938725, (GLfloat) - 0.284759,
+       (GLfloat) 0.194188, (GLfloat) 0.938724, (GLfloat) - 0.284759,
+       (GLfloat) 0.553716, (GLfloat) 0.796849, (GLfloat) - 0.241722,
+       (GLfloat) 0.830227, (GLfloat) 0.533423, (GLfloat) - 0.161812,
+       (GLfloat) 0.980604, (GLfloat) 0.187557, (GLfloat) - 0.056895,
+       (GLfloat) 0.980604, (GLfloat) - 0.187558, (GLfloat) 0.056895,
+       (GLfloat) 0.830228, (GLfloat) - 0.533422, (GLfloat) 0.161812,
+       (GLfloat) 0.553717, (GLfloat) - 0.796849, (GLfloat) 0.241722,
+       (GLfloat) 0.194186, (GLfloat) - 0.976241, (GLfloat) 0.096151,
+       (GLfloat) - 0.194186, (GLfloat) - 0.976241, (GLfloat) 0.096151,
+       (GLfloat) - 0.553717, (GLfloat) - 0.828695, (GLfloat) 0.081619,
+       (GLfloat) - 0.830228, (GLfloat) - 0.554740, (GLfloat) 0.054637,
+       (GLfloat) - 0.980604, (GLfloat) - 0.195054, (GLfloat) 0.019211,
+       (GLfloat) - 0.980604, (GLfloat) 0.195054, (GLfloat) - 0.019211,
+       (GLfloat) - 0.830227, (GLfloat) 0.554741, (GLfloat) - 0.054637,
+       (GLfloat) - 0.553717, (GLfloat) 0.828695, (GLfloat) - 0.081619,
+       (GLfloat) - 0.194187, (GLfloat) 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) 0.194187, (GLfloat) 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) 0.553716, (GLfloat) 0.828696, (GLfloat) - 0.081619,
+       (GLfloat) 0.830227, (GLfloat) 0.554741, (GLfloat) - 0.054637,
+       (GLfloat) 0.980604, (GLfloat) 0.195054, (GLfloat) - 0.019211,
+       (GLfloat) 0.980604, (GLfloat) - 0.195054, (GLfloat) 0.019211,
+       (GLfloat) 0.830228, (GLfloat) - 0.554740, (GLfloat) 0.054637,
+       (GLfloat) 0.553716, (GLfloat) - 0.828696, (GLfloat) 0.081619,
+       (GLfloat) 0.194185, (GLfloat) - 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) - 0.194185, (GLfloat) - 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) - 0.553718, (GLfloat) - 0.828695, (GLfloat) - 0.081619,
+       (GLfloat) - 0.830228, (GLfloat) - 0.554740, (GLfloat) - 0.054637,
+       (GLfloat) - 0.980604, (GLfloat) - 0.195054, (GLfloat) - 0.019211,
+       (GLfloat) - 0.980605, (GLfloat) 0.195053, (GLfloat) 0.019211,
+       (GLfloat) - 0.830227, (GLfloat) 0.554741, (GLfloat) 0.054637,
+       (GLfloat) - 0.553717, (GLfloat) 0.828695, (GLfloat) 0.081619,
+       (GLfloat) - 0.194187, (GLfloat) 0.976241, (GLfloat) 0.096151,
+       (GLfloat) 0.194188, (GLfloat) 0.976241, (GLfloat) 0.096151,
+       (GLfloat) 0.553716, (GLfloat) 0.828696, (GLfloat) 0.081619,
+       (GLfloat) 0.830227, (GLfloat) 0.554741, (GLfloat) 0.054637,
+       (GLfloat) 0.980604, (GLfloat) 0.195053, (GLfloat) 0.019211,
+       (GLfloat) 0.980604, (GLfloat) - 0.195054, (GLfloat) - 0.019211,
+       (GLfloat) 0.830228, (GLfloat) - 0.554740, (GLfloat) - 0.054637,
+       (GLfloat) 0.553717, (GLfloat) - 0.828695, (GLfloat) - 0.081619,
+       (GLfloat) 0.194186, (GLfloat) - 0.938725, (GLfloat) - 0.284759,
+       (GLfloat) - 0.194185, (GLfloat) - 0.938725, (GLfloat) - 0.284759,
+       (GLfloat) - 0.553717, (GLfloat) - 0.796849, (GLfloat) - 0.241721,
+       (GLfloat) - 0.830228, (GLfloat) - 0.533421, (GLfloat) - 0.161812,
+       (GLfloat) - 0.980604, (GLfloat) - 0.187558, (GLfloat) - 0.056895,
+       (GLfloat) - 0.980604, (GLfloat) 0.187558, (GLfloat) 0.056895,
+       (GLfloat) - 0.830227, (GLfloat) 0.533422, (GLfloat) 0.161812,
+       (GLfloat) - 0.553717, (GLfloat) 0.796849, (GLfloat) 0.241722,
+       (GLfloat) - 0.194186, (GLfloat) 0.938725, (GLfloat) 0.284759,
+       (GLfloat) 0.194187, (GLfloat) 0.938724, (GLfloat) 0.284759,
+       (GLfloat) 0.553716, (GLfloat) 0.796849, (GLfloat) 0.241722,
+       (GLfloat) 0.830227, (GLfloat) 0.533422, (GLfloat) 0.161812,
+       (GLfloat) 0.980604, (GLfloat) 0.187558, (GLfloat) 0.056895,
+       (GLfloat) 0.980604, (GLfloat) - 0.187558, (GLfloat) - 0.056895,
+       (GLfloat) 0.830228, (GLfloat) - 0.533421, (GLfloat) - 0.161811,
+       (GLfloat) 0.553716, (GLfloat) - 0.796850, (GLfloat) - 0.241722,
+       (GLfloat) 0.194186, (GLfloat) - 0.865134, (GLfloat) - 0.462423,
+       (GLfloat) - 0.194185, (GLfloat) - 0.865134, (GLfloat) - 0.462424,
+       (GLfloat) - 0.553717, (GLfloat) - 0.734380, (GLfloat) - 0.392534,
+       (GLfloat) - 0.830228, (GLfloat) - 0.491604, (GLfloat) - 0.262768,
+       (GLfloat) - 0.980604, (GLfloat) - 0.172854, (GLfloat) - 0.092393,
+       (GLfloat) - 0.980604, (GLfloat) 0.172854, (GLfloat) 0.092393,
+       (GLfloat) - 0.830227, (GLfloat) 0.491605, (GLfloat) 0.262768,
+       (GLfloat) - 0.553717, (GLfloat) 0.734380, (GLfloat) 0.392534,
+       (GLfloat) - 0.194187, (GLfloat) 0.865134, (GLfloat) 0.462424,
+       (GLfloat) 0.194187, (GLfloat) 0.865134, (GLfloat) 0.462423,
+       (GLfloat) 0.553716, (GLfloat) 0.734381, (GLfloat) 0.392534,
+       (GLfloat) 0.830227, (GLfloat) 0.491605, (GLfloat) 0.262768,
+       (GLfloat) 0.980604, (GLfloat) 0.172854, (GLfloat) 0.092393,
+       (GLfloat) 0.980604, (GLfloat) - 0.172854, (GLfloat) - 0.092393,
+       (GLfloat) 0.830228, (GLfloat) - 0.491604, (GLfloat) - 0.262768,
+       (GLfloat) 0.553716, (GLfloat) - 0.734381, (GLfloat) - 0.392535,
+       (GLfloat) 0.194186, (GLfloat) - 0.758296, (GLfloat) - 0.622317,
+       (GLfloat) - 0.194186, (GLfloat) - 0.758296, (GLfloat) - 0.622318,
+       (GLfloat) - 0.553717, (GLfloat) - 0.643690, (GLfloat) - 0.528263,
+       (GLfloat) - 0.830228, (GLfloat) - 0.430895, (GLfloat) - 0.353626,
+       (GLfloat) - 0.980604, (GLfloat) - 0.151508, (GLfloat) - 0.124340,
+       (GLfloat) - 0.980604, (GLfloat) 0.151508, (GLfloat) 0.124339,
+       (GLfloat) - 0.830227, (GLfloat) 0.430895, (GLfloat) 0.353627,
+       (GLfloat) - 0.553717, (GLfloat) 0.643690, (GLfloat) 0.528263,
+       (GLfloat) - 0.194186, (GLfloat) 0.758296, (GLfloat) 0.622317,
+       (GLfloat) 0.194186, (GLfloat) 0.758296, (GLfloat) 0.622318,
+       (GLfloat) 0.553716, (GLfloat) 0.643690, (GLfloat) 0.528263,
+       (GLfloat) 0.830227, (GLfloat) 0.430895, (GLfloat) 0.353627,
+       (GLfloat) 0.980604, (GLfloat) 0.151508, (GLfloat) 0.124339,
+       (GLfloat) 0.980604, (GLfloat) - 0.151508, (GLfloat) - 0.124340,
+       (GLfloat) 0.830228, (GLfloat) - 0.430895, (GLfloat) - 0.353626,
+       (GLfloat) 0.553716, (GLfloat) - 0.643690, (GLfloat) - 0.528263,
+       (GLfloat) 0.194186, (GLfloat) - 0.622317, (GLfloat) - 0.758296,
+       (GLfloat) - 0.194185, (GLfloat) - 0.622318, (GLfloat) - 0.758296,
+       (GLfloat) - 0.553717, (GLfloat) - 0.528263, (GLfloat) - 0.643690,
+       (GLfloat) - 0.830228, (GLfloat) - 0.353626, (GLfloat) - 0.430895,
+       (GLfloat) - 0.980604, (GLfloat) - 0.124339, (GLfloat) - 0.151508,
+       (GLfloat) - 0.980604, (GLfloat) 0.124339, (GLfloat) 0.151508,
+       (GLfloat) - 0.830227, (GLfloat) 0.353627, (GLfloat) 0.430895,
+       (GLfloat) - 0.553717, (GLfloat) 0.528262, (GLfloat) 0.643689,
+       (GLfloat) - 0.194187, (GLfloat) 0.622317, (GLfloat) 0.758296,
+       (GLfloat) 0.194187, (GLfloat) 0.622317, (GLfloat) 0.758296,
+       (GLfloat) 0.553716, (GLfloat) 0.528263, (GLfloat) 0.643690,
+       (GLfloat) 0.830227, (GLfloat) 0.353627, (GLfloat) 0.430895,
+       (GLfloat) 0.980604, (GLfloat) 0.124339, (GLfloat) 0.151508,
+       (GLfloat) 0.980604, (GLfloat) - 0.124340, (GLfloat) - 0.151508,
+       (GLfloat) 0.830228, (GLfloat) - 0.353626, (GLfloat) - 0.430895,
+       (GLfloat) 0.553716, (GLfloat) - 0.528263, (GLfloat) - 0.643690,
+       (GLfloat) 0.194186, (GLfloat) - 0.462423, (GLfloat) - 0.865134,
+       (GLfloat) - 0.194185, (GLfloat) - 0.462424, (GLfloat) - 0.865134,
+       (GLfloat) - 0.553717, (GLfloat) - 0.392534, (GLfloat) - 0.734380,
+       (GLfloat) - 0.830228, (GLfloat) - 0.262768, (GLfloat) - 0.491604,
+       (GLfloat) - 0.980604, (GLfloat) - 0.092393, (GLfloat) - 0.172855,
+       (GLfloat) - 0.980604, (GLfloat) 0.092393, (GLfloat) 0.172854,
+       (GLfloat) - 0.830227, (GLfloat) 0.262768, (GLfloat) 0.491605,
+       (GLfloat) - 0.553717, (GLfloat) 0.392534, (GLfloat) 0.734380,
+       (GLfloat) - 0.194186, (GLfloat) 0.462424, (GLfloat) 0.865134,
+       (GLfloat) 0.194187, (GLfloat) 0.462423, (GLfloat) 0.865134,
+       (GLfloat) 0.553716, (GLfloat) 0.392535, (GLfloat) 0.734381,
+       (GLfloat) 0.830228, (GLfloat) 0.262768, (GLfloat) 0.491605,
+       (GLfloat) 0.980604, (GLfloat) 0.092393, (GLfloat) 0.172854,
+       (GLfloat) 0.980604, (GLfloat) - 0.092393, (GLfloat) - 0.172855,
+       (GLfloat) 0.830228, (GLfloat) - 0.262768, (GLfloat) - 0.491604,
+       (GLfloat) 0.553716, (GLfloat) - 0.392535, (GLfloat) - 0.734381,
+       (GLfloat) 0.194185, (GLfloat) - 0.284759, (GLfloat) - 0.938725,
+       (GLfloat) - 0.194185, (GLfloat) - 0.284759, (GLfloat) - 0.938725,
+       (GLfloat) - 0.553718, (GLfloat) - 0.241721, (GLfloat) - 0.796848,
+       (GLfloat) - 0.830228, (GLfloat) - 0.161812, (GLfloat) - 0.533422,
+       (GLfloat) - 0.980604, (GLfloat) - 0.056895, (GLfloat) - 0.187558,
+       (GLfloat) - 0.980605, (GLfloat) 0.056895, (GLfloat) 0.187557,
+       (GLfloat) - 0.830227, (GLfloat) 0.161812, (GLfloat) 0.533422,
+       (GLfloat) - 0.553716, (GLfloat) 0.241722, (GLfloat) 0.796849,
+       (GLfloat) - 0.194187, (GLfloat) 0.284759, (GLfloat) 0.938725,
+       (GLfloat) 0.194188, (GLfloat) 0.284759, (GLfloat) 0.938724,
+       (GLfloat) 0.553716, (GLfloat) 0.241722, (GLfloat) 0.796850,
+       (GLfloat) 0.830227, (GLfloat) 0.161812, (GLfloat) 0.533423,
+       (GLfloat) 0.980604, (GLfloat) 0.056895, (GLfloat) 0.187557,
+       (GLfloat) 0.980604, (GLfloat) - 0.056895, (GLfloat) - 0.187558,
+       (GLfloat) 0.830228, (GLfloat) - 0.161812, (GLfloat) - 0.533422,
+       (GLfloat) 0.553717, (GLfloat) - 0.241722, (GLfloat) - 0.796849,
+       (GLfloat) 0.194186, (GLfloat) - 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) - 0.194186, (GLfloat) - 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) - 0.553717, (GLfloat) - 0.081619, (GLfloat) - 0.828695,
+       (GLfloat) - 0.830228, (GLfloat) - 0.054637, (GLfloat) - 0.554740,
+       (GLfloat) - 0.980604, (GLfloat) - 0.019211, (GLfloat) - 0.195054,
+       (GLfloat) - 0.980604, (GLfloat) 0.019211, (GLfloat) 0.195054,
+       (GLfloat) - 0.830227, (GLfloat) 0.054637, (GLfloat) 0.554741,
+       (GLfloat) - 0.553717, (GLfloat) 0.081619, (GLfloat) 0.828695,
+       (GLfloat) - 0.194187, (GLfloat) 0.096151, (GLfloat) 0.976241,
+       (GLfloat) 0.194187, (GLfloat) 0.096151, (GLfloat) 0.976241,
+       (GLfloat) 0.553716, (GLfloat) 0.081620, (GLfloat) 0.828696,
+       (GLfloat) 0.830227, (GLfloat) 0.054637, (GLfloat) 0.554741,
+       (GLfloat) 0.980604, (GLfloat) 0.019211, (GLfloat) 0.195054,
+       (GLfloat) 0.980604, (GLfloat) - 0.019211, (GLfloat) - 0.195054,
+       (GLfloat) 0.830228, (GLfloat) - 0.054637, (GLfloat) - 0.554740,
+       (GLfloat) 0.553716, (GLfloat) - 0.081619, (GLfloat) - 0.828696,
+       (GLfloat) 0.194185, (GLfloat) 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) - 0.194185, (GLfloat) 0.096151, (GLfloat) - 0.976241,
+       (GLfloat) - 0.553718, (GLfloat) 0.081619, (GLfloat) - 0.828695,
+       (GLfloat) - 0.830228, (GLfloat) 0.054637, (GLfloat) - 0.554740,
+       (GLfloat) - 0.980604, (GLfloat) 0.019211, (GLfloat) - 0.195054,
+       (GLfloat) - 0.980605, (GLfloat) - 0.019211, (GLfloat) 0.195053,
+       (GLfloat) - 0.830227, (GLfloat) - 0.054637, (GLfloat) 0.554741,
+       (GLfloat) - 0.553717, (GLfloat) - 0.081619, (GLfloat) 0.828695,
+       (GLfloat) - 0.194187, (GLfloat) - 0.096151, (GLfloat) 0.976241,
+       (GLfloat) 0.194188, (GLfloat) - 0.096151, (GLfloat) 0.976241,
+       (GLfloat) 0.553716, (GLfloat) - 0.081619, (GLfloat) 0.828696,
+       (GLfloat) 0.830227, (GLfloat) - 0.054637, (GLfloat) 0.554741,
+       (GLfloat) 0.980604, (GLfloat) - 0.019211, (GLfloat) 0.195053,
+       (GLfloat) 0.980604, (GLfloat) 0.019211, (GLfloat) - 0.195054,
+       (GLfloat) 0.830228, (GLfloat) 0.054637, (GLfloat) - 0.554740,
+       (GLfloat) 0.553717, (GLfloat) 0.081619, (GLfloat) - 0.828695,
+       (GLfloat) 0.194186, (GLfloat) 0.284759, (GLfloat) - 0.938725,
+       (GLfloat) - 0.194185, (GLfloat) 0.284759, (GLfloat) - 0.938725,
+       (GLfloat) - 0.553717, (GLfloat) 0.241721, (GLfloat) - 0.796849,
+       (GLfloat) - 0.830228, (GLfloat) 0.161812, (GLfloat) - 0.533421,
+       (GLfloat) - 0.980604, (GLfloat) 0.056895, (GLfloat) - 0.187558,
+       (GLfloat) - 0.980604, (GLfloat) - 0.056895, (GLfloat) 0.187558,
+       (GLfloat) - 0.830227, (GLfloat) - 0.161812, (GLfloat) 0.533422,
+       (GLfloat) - 0.553717, (GLfloat) - 0.241722, (GLfloat) 0.796849,
+       (GLfloat) - 0.194186, (GLfloat) - 0.284759, (GLfloat) 0.938725,
+       (GLfloat) 0.194187, (GLfloat) - 0.284759, (GLfloat) 0.938724,
+       (GLfloat) 0.553716, (GLfloat) - 0.241722, (GLfloat) 0.796849,
+       (GLfloat) 0.830227, (GLfloat) - 0.161812, (GLfloat) 0.533422,
+       (GLfloat) 0.980604, (GLfloat) - 0.056895, (GLfloat) 0.187558,
+       (GLfloat) 0.980604, (GLfloat) 0.056895, (GLfloat) - 0.187558,
+       (GLfloat) 0.830228, (GLfloat) 0.161811, (GLfloat) - 0.533421,
+       (GLfloat) 0.553716, (GLfloat) 0.241722, (GLfloat) - 0.796850,
+       (GLfloat) 0.194186, (GLfloat) 0.462423, (GLfloat) - 0.865134,
+       (GLfloat) - 0.194185, (GLfloat) 0.462424, (GLfloat) - 0.865134,
+       (GLfloat) - 0.553717, (GLfloat) 0.392534, (GLfloat) - 0.734380,
+       (GLfloat) - 0.830228, (GLfloat) 0.262768, (GLfloat) - 0.491604,
+       (GLfloat) - 0.980604, (GLfloat) 0.092393, (GLfloat) - 0.172854,
+       (GLfloat) - 0.980604, (GLfloat) - 0.092393, (GLfloat) 0.172854,
+       (GLfloat) - 0.830227, (GLfloat) - 0.262768, (GLfloat) 0.491605,
+       (GLfloat) - 0.553717, (GLfloat) - 0.392534, (GLfloat) 0.734380,
+       (GLfloat) - 0.194187, (GLfloat) - 0.462424, (GLfloat) 0.865134,
+       (GLfloat) 0.194187, (GLfloat) - 0.462423, (GLfloat) 0.865134,
+       (GLfloat) 0.553716, (GLfloat) - 0.392534, (GLfloat) 0.734381,
+       (GLfloat) 0.830227, (GLfloat) - 0.262768, (GLfloat) 0.491605,
+       (GLfloat) 0.980604, (GLfloat) - 0.092393, (GLfloat) 0.172854,
+       (GLfloat) 0.980604, (GLfloat) 0.092393, (GLfloat) - 0.172854,
+       (GLfloat) 0.830228, (GLfloat) 0.262768, (GLfloat) - 0.491604,
+       (GLfloat) 0.553716, (GLfloat) 0.392535, (GLfloat) - 0.734381,
+       (GLfloat) 0.194186, (GLfloat) 0.622317, (GLfloat) - 0.758296,
+       (GLfloat) - 0.194186, (GLfloat) 0.622318, (GLfloat) - 0.758296,
+       (GLfloat) - 0.553717, (GLfloat) 0.528263, (GLfloat) - 0.643690,
+       (GLfloat) - 0.830228, (GLfloat) 0.353626, (GLfloat) - 0.430895,
+       (GLfloat) - 0.980604, (GLfloat) 0.124340, (GLfloat) - 0.151508,
+       (GLfloat) - 0.980604, (GLfloat) - 0.124339, (GLfloat) 0.151508,
+       (GLfloat) - 0.830227, (GLfloat) - 0.353627, (GLfloat) 0.430895,
+       (GLfloat) - 0.553717, (GLfloat) - 0.528263, (GLfloat) 0.643690,
+       (GLfloat) - 0.194186, (GLfloat) - 0.622317, (GLfloat) 0.758296,
+       (GLfloat) 0.194186, (GLfloat) - 0.622318, (GLfloat) 0.758296,
+       (GLfloat) 0.553716, (GLfloat) - 0.528263, (GLfloat) 0.643690,
+       (GLfloat) 0.830227, (GLfloat) - 0.353627, (GLfloat) 0.430895,
+       (GLfloat) 0.980604, (GLfloat) - 0.124339, (GLfloat) 0.151508,
+       (GLfloat) 0.980604, (GLfloat) 0.124340, (GLfloat) - 0.151508,
+       (GLfloat) 0.830228, (GLfloat) 0.353626, (GLfloat) - 0.430895,
+       (GLfloat) 0.553716, (GLfloat) 0.528263, (GLfloat) - 0.643690,
+       (GLfloat) 0.194186, (GLfloat) 0.758296, (GLfloat) - 0.622317,
+       (GLfloat) - 0.194185, (GLfloat) 0.758296, (GLfloat) - 0.622318,
+       (GLfloat) - 0.553717, (GLfloat) 0.643690, (GLfloat) - 0.528263,
+       (GLfloat) - 0.830228, (GLfloat) 0.430895, (GLfloat) - 0.353626,
+       (GLfloat) - 0.980604, (GLfloat) 0.151508, (GLfloat) - 0.124339,
+       (GLfloat) - 0.980604, (GLfloat) - 0.151508, (GLfloat) 0.124339,
+       (GLfloat) - 0.830227, (GLfloat) - 0.430895, (GLfloat) 0.353627,
+       (GLfloat) - 0.553717, (GLfloat) - 0.643689, (GLfloat) 0.528262,
+       (GLfloat) - 0.194187, (GLfloat) - 0.758296, (GLfloat) 0.622317,
+       (GLfloat) 0.194187, (GLfloat) - 0.758296, (GLfloat) 0.622317,
+       (GLfloat) 0.553716, (GLfloat) - 0.643690, (GLfloat) 0.528263,
+       (GLfloat) 0.830227, (GLfloat) - 0.430895, (GLfloat) 0.353627,
+       (GLfloat) 0.980604, (GLfloat) - 0.151508, (GLfloat) 0.124339,
+       (GLfloat) 0.980604, (GLfloat) 0.151508, (GLfloat) - 0.124340,
+       (GLfloat) 0.830228, (GLfloat) 0.430895, (GLfloat) - 0.353626,
+       (GLfloat) 0.553716, (GLfloat) 0.643690, (GLfloat) - 0.528263,
+       (GLfloat) 0.194186, (GLfloat) 0.865134, (GLfloat) - 0.462423,
+       (GLfloat) - 0.194185, (GLfloat) 0.865134, (GLfloat) - 0.462424,
+       (GLfloat) - 0.553717, (GLfloat) 0.734380, (GLfloat) - 0.392534,
+       (GLfloat) - 0.830228, (GLfloat) 0.491604, (GLfloat) - 0.262768,
+       (GLfloat) - 0.980604, (GLfloat) 0.172855, (GLfloat) - 0.092393,
+       (GLfloat) - 0.980604, (GLfloat) - 0.172854, (GLfloat) 0.092393,
+       (GLfloat) - 0.830227, (GLfloat) - 0.491605, (GLfloat) 0.262768,
+       (GLfloat) - 0.553717, (GLfloat) - 0.734380, (GLfloat) 0.392534,
+       (GLfloat) - 0.194186, (GLfloat) - 0.865134, (GLfloat) 0.462424,
+       (GLfloat) 0.194187, (GLfloat) - 0.865134, (GLfloat) 0.462423,
+       (GLfloat) 0.553716, (GLfloat) - 0.734381, (GLfloat) 0.392535,
+       (GLfloat) 0.830228, (GLfloat) - 0.491605, (GLfloat) 0.262768,
+       (GLfloat) 0.980604, (GLfloat) - 0.172854, (GLfloat) 0.092393,
+       (GLfloat) 0.980604, (GLfloat) 0.172855, (GLfloat) - 0.092393,
+       (GLfloat) 0.830228, (GLfloat) 0.491604, (GLfloat) - 0.262768,
+       (GLfloat) 0.553716, (GLfloat) 0.734381, (GLfloat) - 0.392535,
+       (GLfloat) 0.194185, (GLfloat) 0.938725, (GLfloat) - 0.284759,
+       (GLfloat) - 0.194185, (GLfloat) 0.938725, (GLfloat) - 0.284759,
+       (GLfloat) - 0.553718, (GLfloat) 0.796848, (GLfloat) - 0.241721,
+       (GLfloat) - 0.830228, (GLfloat) 0.533422, (GLfloat) - 0.161812,
+       (GLfloat) - 0.980604, (GLfloat) 0.187558, (GLfloat) - 0.056895,
+       (GLfloat) - 0.980605, (GLfloat) - 0.187557, (GLfloat) 0.056895,
+       (GLfloat) - 0.830227, (GLfloat) - 0.533422, (GLfloat) 0.161812,
+       (GLfloat) - 0.553716, (GLfloat) - 0.796849, (GLfloat) 0.241722,
+       (GLfloat) - 0.194187, (GLfloat) - 0.938725, (GLfloat) 0.284759,
+       (GLfloat) 0.194188, (GLfloat) - 0.938724, (GLfloat) 0.284759,
+       (GLfloat) 0.553716, (GLfloat) - 0.796850, (GLfloat) 0.241722,
+       (GLfloat) 0.830227, (GLfloat) - 0.533423, (GLfloat) 0.161812,
+       (GLfloat) 0.980604, (GLfloat) - 0.187557, (GLfloat) 0.056895,
+       (GLfloat) 0.980604, (GLfloat) 0.187558, (GLfloat) - 0.056895,
+       (GLfloat) 0.830228, (GLfloat) 0.533422, (GLfloat) - 0.161812,
+       (GLfloat) 0.553717, (GLfloat) 0.796849, (GLfloat) - 0.241722,
+       (GLfloat) 0.194186, (GLfloat) 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) - 0.194186, (GLfloat) 0.976241, (GLfloat) - 0.096151,
+       (GLfloat) - 0.553717, (GLfloat) 0.828695, (GLfloat) - 0.081619,
+       (GLfloat) - 0.830228, (GLfloat) 0.554740, (GLfloat) - 0.054637,
+       (GLfloat) - 0.980604, (GLfloat) 0.195054, (GLfloat) - 0.019211,
+       (GLfloat) - 0.980604, (GLfloat) - 0.195054, (GLfloat) 0.019211,
+       (GLfloat) - 0.830227, (GLfloat) - 0.554741, (GLfloat) 0.054637,
+       (GLfloat) - 0.553717, (GLfloat) - 0.828695, (GLfloat) 0.081619,
+       (GLfloat) - 0.194187, (GLfloat) - 0.976241, (GLfloat) 0.096151,
+       (GLfloat) 0.194187, (GLfloat) - 0.976241, (GLfloat) 0.096151,
+       (GLfloat) 0.553716, (GLfloat) - 0.828696, (GLfloat) 0.081620,
+       (GLfloat) 0.830227, (GLfloat) - 0.554741, (GLfloat) 0.054637,
+       (GLfloat) 0.980604, (GLfloat) - 0.195054, (GLfloat) 0.019211,
+       (GLfloat) 0.980604, (GLfloat) 0.195054, (GLfloat) - 0.019211,
+       (GLfloat) 0.830228, (GLfloat) 0.554740, (GLfloat) - 0.054637,
+       (GLfloat) 0.553716, (GLfloat) 0.828696, (GLfloat) - 0.081619,
+};
+
+static unsigned short int BigValve_POLS[] =
+{
+       16, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 1, 4, 700,
+       701, 685, 684, 1, 4, 701, 702, 686, 685, 1, 4, 702, 703, 687, 686, 1, 4, 703, 704, 688,
+       687, 1, 4, 704, 705, 689, 688, 1, 4, 705, 706, 690, 689, 1, 4, 706, 707, 691, 690, 1,
+       4, 707, 708, 692, 691, 1, 4, 708, 709, 693, 692, 1, 4, 709, 710, 694, 693, 1, 4, 710,
+       711, 695, 694, 1, 4, 711, 712, 696, 695, 1, 4, 712, 713, 697, 696, 1, 4, 713, 714, 698,
+       697, 1, 4, 714, 715, 699, 698, 1, 4, 715, 700, 684, 699, 1, 16, 700, 715, 714, 713, 712,
+       711, 710, 709, 708, 707, 706, 705, 704, 703, 702, 701, 1, 4, 668, 669, 655, 654, 1, 4, 669,
+       670, 656, 655, 1, 4, 670, 671, 657, 656, 1, 4, 671, 672, 634, 657, 1, 4, 672, 673, 658,
+       634, 1, 4, 673, 674, 659, 658, 1, 4, 674, 675, 660, 659, 1, 4, 675, 676, 661, 660, 1,
+       4, 676, 677, 662, 661, 1, 4, 677, 678, 663, 662, 1, 4, 678, 679, 664, 663, 1, 4, 679,
+       680, 564, 664, 1, 4, 680, 681, 665, 564, 1, 4, 681, 682, 666, 665, 1, 4, 682, 683, 667,
+       666, 1, 4, 683, 668, 654, 667, 1, 4, 638, 639, 624, 623, 1, 4, 639, 640, 625, 624, 1,
+       4, 640, 641, 626, 625, 1, 4, 641, 642, 603, 626, 1, 4, 642, 643, 627, 603, 1, 4, 643,
+       644, 628, 627, 1, 4, 644, 645, 629, 628, 1, 4, 645, 646, 630, 629, 1, 4, 646, 647, 631,
+       630, 1, 4, 647, 648, 632, 631, 1, 4, 648, 649, 633, 632, 1, 4, 649, 650, 634, 633, 1,
+       4, 650, 651, 635, 634, 1, 4, 651, 652, 636, 635, 1, 4, 652, 653, 637, 636, 1, 4, 653,
+       638, 623, 637, 1, 4, 607, 608, 593, 592, 1, 4, 608, 609, 594, 593, 1, 4, 609, 610, 595,
+       594, 1, 4, 610, 611, 572, 595, 1, 4, 611, 612, 596, 572, 1, 4, 612, 613, 597, 596, 1,
+       4, 613, 614, 598, 597, 1, 4, 614, 615, 599, 598, 1, 4, 615, 616, 600, 599, 1, 4, 616,
+       617, 601, 600, 1, 4, 617, 618, 602, 601, 1, 4, 618, 619, 603, 602, 1, 4, 619, 620, 604,
+       603, 1, 4, 620, 621, 605, 604, 1, 4, 621, 622, 606, 605, 1, 4, 622, 607, 592, 606, 1,
+       4, 576, 577, 561, 560, 1, 4, 577, 578, 562, 561, 1, 4, 578, 579, 563, 562, 1, 4, 579,
+       580, 564, 563, 1, 4, 580, 581, 565, 564, 1, 4, 581, 582, 566, 565, 1, 4, 582, 583, 567,
+       566, 1, 4, 583, 584, 568, 567, 1, 4, 584, 585, 569, 568, 1, 4, 585, 586, 570, 569, 1,
+       4, 586, 587, 571, 570, 1, 4, 587, 588, 572, 571, 1, 4, 588, 589, 573, 572, 1, 4, 589,
+       590, 574, 573, 1, 4, 590, 591, 575, 574, 1, 4, 591, 576, 560, 575, 1, 24, 512, 513, 514,
+       515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534,
+       535, 1, 4, 536, 537, 513, 512, 1, 4, 537, 538, 514, 513, 1, 4, 538, 539, 515, 514, 1,
+       4, 539, 540, 516, 515, 1, 4, 540, 541, 517, 516, 1, 4, 541, 542, 518, 517, 1, 4, 542,
+       543, 519, 518, 1, 4, 543, 544, 520, 519, 1, 4, 544, 545, 521, 520, 1, 4, 545, 546, 522,
+       521, 1, 4, 546, 547, 523, 522, 1, 4, 547, 548, 524, 523, 1, 4, 548, 549, 525, 524, 1,
+       4, 549, 550, 526, 525, 1, 4, 550, 551, 527, 526, 1, 4, 551, 552, 528, 527, 1, 4, 552,
+       553, 529, 528, 1, 4, 553, 554, 530, 529, 1, 4, 554, 555, 531, 530, 1, 4, 555, 556, 532,
+       531, 1, 4, 556, 557, 533, 532, 1, 4, 557, 558, 534, 533, 1, 4, 558, 559, 535, 534, 1,
+       4, 559, 536, 512, 535, 1, 24, 536, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550, 549, 548,
+       547, 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, 1, 4, 16, 31, 15, 0, 1, 4, 31,
+    30, 14, 15, 1, 4, 30, 29, 13, 14, 1, 4, 29, 28, 12, 13, 1, 4, 28, 27, 11,
+       12, 1, 4, 27, 26, 10, 11, 1, 4, 26, 25, 9, 10, 1, 4, 25, 24, 8, 9, 1,
+       4, 24, 23, 7, 8, 1, 4, 23, 22, 6, 7, 1, 4, 22, 21, 5, 6, 1, 4, 21,
+       20, 4, 5, 1, 4, 20, 19, 3, 4, 1, 4, 19, 18, 2, 3, 1, 4, 18, 17, 1,
+       2, 1, 4, 17, 16, 0, 1, 1, 4, 32, 47, 31, 16, 1, 4, 47, 46, 30, 31, 1,
+     4, 46, 45, 29, 30, 1, 4, 45, 44, 28, 29, 1, 4, 44, 43, 27, 28, 1, 4, 43,
+    42, 26, 27, 1, 4, 42, 41, 25, 26, 1, 4, 41, 40, 24, 25, 1, 4, 40, 39, 23,
+     24, 1, 4, 39, 38, 22, 23, 1, 4, 38, 37, 21, 22, 1, 4, 37, 36, 20, 21, 1,
+     4, 36, 35, 19, 20, 1, 4, 35, 34, 18, 19, 1, 4, 34, 33, 17, 18, 1, 4, 33,
+    32, 16, 17, 1, 4, 48, 63, 47, 32, 1, 4, 63, 62, 46, 47, 1, 4, 62, 61, 45,
+     46, 1, 4, 61, 60, 44, 45, 1, 4, 60, 59, 43, 44, 1, 4, 59, 58, 42, 43, 1,
+     4, 58, 57, 41, 42, 1, 4, 57, 56, 40, 41, 1, 4, 56, 55, 39, 40, 1, 4, 55,
+    54, 38, 39, 1, 4, 54, 53, 37, 38, 1, 4, 53, 52, 36, 37, 1, 4, 52, 51, 35,
+     36, 1, 4, 51, 50, 34, 35, 1, 4, 50, 49, 33, 34, 1, 4, 49, 48, 32, 33, 1,
+     4, 64, 79, 63, 48, 1, 4, 79, 78, 62, 63, 1, 4, 78, 77, 61, 62, 1, 4, 77,
+    76, 60, 61, 1, 4, 76, 75, 59, 60, 1, 4, 75, 74, 58, 59, 1, 4, 74, 73, 57,
+     58, 1, 4, 73, 72, 56, 57, 1, 4, 72, 71, 55, 56, 1, 4, 71, 70, 54, 55, 1,
+     4, 70, 69, 53, 54, 1, 4, 69, 68, 52, 53, 1, 4, 68, 67, 51, 52, 1, 4, 67,
+    66, 50, 51, 1, 4, 66, 65, 49, 50, 1, 4, 65, 64, 48, 49, 1, 4, 80, 95, 79,
+     64, 1, 4, 95, 94, 78, 79, 1, 4, 94, 93, 77, 78, 1, 4, 93, 92, 76, 77, 1,
+     4, 92, 91, 75, 76, 1, 4, 91, 90, 74, 75, 1, 4, 90, 89, 73, 74, 1, 4, 89,
+    88, 72, 73, 1, 4, 88, 87, 71, 72, 1, 4, 87, 86, 70, 71, 1, 4, 86, 85, 69,
+     70, 1, 4, 85, 84, 68, 69, 1, 4, 84, 83, 67, 68, 1, 4, 83, 82, 66, 67, 1,
+   4, 82, 81, 65, 66, 1, 4, 81, 80, 64, 65, 1, 4, 96, 111, 95, 80, 1, 4, 111,
+       110, 94, 95, 1, 4, 110, 109, 93, 94, 1, 4, 109, 108, 92, 93, 1, 4, 108, 107, 91,
+92, 1, 4, 107, 106, 90, 91, 1, 4, 106, 105, 89, 90, 1, 4, 105, 104, 88, 89, 1,
+       4, 104, 103, 87, 88, 1, 4, 103, 102, 86, 87, 1, 4, 102, 101, 85, 86, 1, 4, 101,
+  100, 84, 85, 1, 4, 100, 99, 83, 84, 1, 4, 99, 98, 82, 83, 1, 4, 98, 97, 81,
+       82, 1, 4, 97, 96, 80, 81, 1, 4, 112, 127, 111, 96, 1, 4, 127, 126, 110, 111, 1,
+       4, 126, 125, 109, 110, 1, 4, 125, 124, 108, 109, 1, 4, 124, 123, 107, 108, 1, 4, 123,
+       122, 106, 107, 1, 4, 122, 121, 105, 106, 1, 4, 121, 120, 104, 105, 1, 4, 120, 119, 103,
+       104, 1, 4, 119, 118, 102, 103, 1, 4, 118, 117, 101, 102, 1, 4, 117, 116, 100, 101, 1,
+       4, 116, 115, 99, 100, 1, 4, 115, 114, 98, 99, 1, 4, 114, 113, 97, 98, 1, 4, 113,
+       112, 96, 97, 1, 4, 128, 143, 127, 112, 1, 4, 143, 142, 126, 127, 1, 4, 142, 141, 125,
+       126, 1, 4, 141, 140, 124, 125, 1, 4, 140, 139, 123, 124, 1, 4, 139, 138, 122, 123, 1,
+       4, 138, 137, 121, 122, 1, 4, 137, 136, 120, 121, 1, 4, 136, 135, 119, 120, 1, 4, 135,
+       134, 118, 119, 1, 4, 134, 133, 117, 118, 1, 4, 133, 132, 116, 117, 1, 4, 132, 131, 115,
+       116, 1, 4, 131, 130, 114, 115, 1, 4, 130, 129, 113, 114, 1, 4, 129, 128, 112, 113, 1,
+       4, 144, 159, 143, 128, 1, 4, 159, 158, 142, 143, 1, 4, 158, 157, 141, 142, 1, 4, 157,
+       156, 140, 141, 1, 4, 156, 155, 139, 140, 1, 4, 155, 154, 138, 139, 1, 4, 154, 153, 137,
+       138, 1, 4, 153, 152, 136, 137, 1, 4, 152, 151, 135, 136, 1, 4, 151, 150, 134, 135, 1,
+       4, 150, 149, 133, 134, 1, 4, 149, 148, 132, 133, 1, 4, 148, 147, 131, 132, 1, 4, 147,
+       146, 130, 131, 1, 4, 146, 145, 129, 130, 1, 4, 145, 144, 128, 129, 1, 4, 160, 175, 159,
+       144, 1, 4, 175, 174, 158, 159, 1, 4, 174, 173, 157, 158, 1, 4, 173, 172, 156, 157, 1,
+       4, 172, 171, 155, 156, 1, 4, 171, 170, 154, 155, 1, 4, 170, 169, 153, 154, 1, 4, 169,
+       168, 152, 153, 1, 4, 168, 167, 151, 152, 1, 4, 167, 166, 150, 151, 1, 4, 166, 165, 149,
+       150, 1, 4, 165, 164, 148, 149, 1, 4, 164, 163, 147, 148, 1, 4, 163, 162, 146, 147, 1,
+       4, 162, 161, 145, 146, 1, 4, 161, 160, 144, 145, 1, 4, 176, 191, 175, 160, 1, 4, 191,
+       190, 174, 175, 1, 4, 190, 189, 173, 174, 1, 4, 189, 188, 172, 173, 1, 4, 188, 187, 171,
+       172, 1, 4, 187, 186, 170, 171, 1, 4, 186, 185, 169, 170, 1, 4, 185, 184, 168, 169, 1,
+       4, 184, 183, 167, 168, 1, 4, 183, 182, 166, 167, 1, 4, 182, 181, 165, 166, 1, 4, 181,
+       180, 164, 165, 1, 4, 180, 179, 163, 164, 1, 4, 179, 178, 162, 163, 1, 4, 178, 177, 161,
+       162, 1, 4, 177, 176, 160, 161, 1, 4, 192, 207, 191, 176, 1, 4, 207, 206, 190, 191, 1,
+       4, 206, 205, 189, 190, 1, 4, 205, 204, 188, 189, 1, 4, 204, 203, 187, 188, 1, 4, 203,
+       202, 186, 187, 1, 4, 202, 201, 185, 186, 1, 4, 201, 200, 184, 185, 1, 4, 200, 199, 183,
+       184, 1, 4, 199, 198, 182, 183, 1, 4, 198, 197, 181, 182, 1, 4, 197, 196, 180, 181, 1,
+       4, 196, 195, 179, 180, 1, 4, 195, 194, 178, 179, 1, 4, 194, 193, 177, 178, 1, 4, 193,
+       192, 176, 177, 1, 4, 208, 223, 207, 192, 1, 4, 223, 222, 206, 207, 1, 4, 222, 221, 205,
+       206, 1, 4, 221, 220, 204, 205, 1, 4, 220, 219, 203, 204, 1, 4, 219, 218, 202, 203, 1,
+       4, 218, 217, 201, 202, 1, 4, 217, 216, 200, 201, 1, 4, 216, 215, 199, 200, 1, 4, 215,
+       214, 198, 199, 1, 4, 214, 213, 197, 198, 1, 4, 213, 212, 196, 197, 1, 4, 212, 211, 195,
+       196, 1, 4, 211, 210, 194, 195, 1, 4, 210, 209, 193, 194, 1, 4, 209, 208, 192, 193, 1,
+       4, 224, 239, 223, 208, 1, 4, 239, 238, 222, 223, 1, 4, 238, 237, 221, 222, 1, 4, 237,
+       236, 220, 221, 1, 4, 236, 235, 219, 220, 1, 4, 235, 234, 218, 219, 1, 4, 234, 233, 217,
+       218, 1, 4, 233, 232, 216, 217, 1, 4, 232, 231, 215, 216, 1, 4, 231, 230, 214, 215, 1,
+       4, 230, 229, 213, 214, 1, 4, 229, 228, 212, 213, 1, 4, 228, 227, 211, 212, 1, 4, 227,
+       226, 210, 211, 1, 4, 226, 225, 209, 210, 1, 4, 225, 224, 208, 209, 1, 4, 240, 255, 239,
+       224, 1, 4, 255, 254, 238, 239, 1, 4, 254, 253, 237, 238, 1, 4, 253, 252, 236, 237, 1,
+       4, 252, 251, 235, 236, 1, 4, 251, 250, 234, 235, 1, 4, 250, 249, 233, 234, 1, 4, 249,
+       248, 232, 233, 1, 4, 248, 247, 231, 232, 1, 4, 247, 246, 230, 231, 1, 4, 246, 245, 229,
+       230, 1, 4, 245, 244, 228, 229, 1, 4, 244, 243, 227, 228, 1, 4, 243, 242, 226, 227, 1,
+       4, 242, 241, 225, 226, 1, 4, 241, 240, 224, 225, 1, 4, 256, 271, 255, 240, 1, 4, 271,
+       270, 254, 255, 1, 4, 270, 269, 253, 254, 1, 4, 269, 268, 252, 253, 1, 4, 268, 267, 251,
+       252, 1, 4, 267, 266, 250, 251, 1, 4, 266, 265, 249, 250, 1, 4, 265, 264, 248, 249, 1,
+       4, 264, 263, 247, 248, 1, 4, 263, 262, 246, 247, 1, 4, 262, 261, 245, 246, 1, 4, 261,
+       260, 244, 245, 1, 4, 260, 259, 243, 244, 1, 4, 259, 258, 242, 243, 1, 4, 258, 257, 241,
+       242, 1, 4, 257, 256, 240, 241, 1, 4, 272, 287, 271, 256, 1, 4, 287, 286, 270, 271, 1,
+       4, 286, 285, 269, 270, 1, 4, 285, 284, 268, 269, 1, 4, 284, 283, 267, 268, 1, 4, 283,
+       282, 266, 267, 1, 4, 282, 281, 265, 266, 1, 4, 281, 280, 264, 265, 1, 4, 280, 279, 263,
+       264, 1, 4, 279, 278, 262, 263, 1, 4, 278, 277, 261, 262, 1, 4, 277, 276, 260, 261, 1,
+       4, 276, 275, 259, 260, 1, 4, 275, 274, 258, 259, 1, 4, 274, 273, 257, 258, 1, 4, 273,
+       272, 256, 257, 1, 4, 288, 303, 287, 272, 1, 4, 303, 302, 286, 287, 1, 4, 302, 301, 285,
+       286, 1, 4, 301, 300, 284, 285, 1, 4, 300, 299, 283, 284, 1, 4, 299, 298, 282, 283, 1,
+       4, 298, 297, 281, 282, 1, 4, 297, 296, 280, 281, 1, 4, 296, 295, 279, 280, 1, 4, 295,
+       294, 278, 279, 1, 4, 294, 293, 277, 278, 1, 4, 293, 292, 276, 277, 1, 4, 292, 291, 275,
+       276, 1, 4, 291, 290, 274, 275, 1, 4, 290, 289, 273, 274, 1, 4, 289, 288, 272, 273, 1,
+       4, 304, 319, 303, 288, 1, 4, 319, 318, 302, 303, 1, 4, 318, 317, 301, 302, 1, 4, 317,
+       316, 300, 301, 1, 4, 316, 315, 299, 300, 1, 4, 315, 314, 298, 299, 1, 4, 314, 313, 297,
+       298, 1, 4, 313, 312, 296, 297, 1, 4, 312, 311, 295, 296, 1, 4, 311, 310, 294, 295, 1,
+       4, 310, 309, 293, 294, 1, 4, 309, 308, 292, 293, 1, 4, 308, 307, 291, 292, 1, 4, 307,
+       306, 290, 291, 1, 4, 306, 305, 289, 290, 1, 4, 305, 304, 288, 289, 1, 4, 320, 335, 319,
+       304, 1, 4, 335, 334, 318, 319, 1, 4, 334, 333, 317, 318, 1, 4, 333, 332, 316, 317, 1,
+       4, 332, 331, 315, 316, 1, 4, 331, 330, 314, 315, 1, 4, 330, 329, 313, 314, 1, 4, 329,
+       328, 312, 313, 1, 4, 328, 327, 311, 312, 1, 4, 327, 326, 310, 311, 1, 4, 326, 325, 309,
+       310, 1, 4, 325, 324, 308, 309, 1, 4, 324, 323, 307, 308, 1, 4, 323, 322, 306, 307, 1,
+       4, 322, 321, 305, 306, 1, 4, 321, 320, 304, 305, 1, 4, 336, 351, 335, 320, 1, 4, 351,
+       350, 334, 335, 1, 4, 350, 349, 333, 334, 1, 4, 349, 348, 332, 333, 1, 4, 348, 347, 331,
+       332, 1, 4, 347, 346, 330, 331, 1, 4, 346, 345, 329, 330, 1, 4, 345, 344, 328, 329, 1,
+       4, 344, 343, 327, 328, 1, 4, 343, 342, 326, 327, 1, 4, 342, 341, 325, 326, 1, 4, 341,
+       340, 324, 325, 1, 4, 340, 339, 323, 324, 1, 4, 339, 338, 322, 323, 1, 4, 338, 337, 321,
+       322, 1, 4, 337, 336, 320, 321, 1, 4, 352, 367, 351, 336, 1, 4, 367, 366, 350, 351, 1,
+       4, 366, 365, 349, 350, 1, 4, 365, 364, 348, 349, 1, 4, 364, 363, 347, 348, 1, 4, 363,
+       362, 346, 347, 1, 4, 362, 361, 345, 346, 1, 4, 361, 360, 344, 345, 1, 4, 360, 359, 343,
+       344, 1, 4, 359, 358, 342, 343, 1, 4, 358, 357, 341, 342, 1, 4, 357, 356, 340, 341, 1,
+       4, 356, 355, 339, 340, 1, 4, 355, 354, 338, 339, 1, 4, 354, 353, 337, 338, 1, 4, 353,
+       352, 336, 337, 1, 4, 368, 383, 367, 352, 1, 4, 383, 382, 366, 367, 1, 4, 382, 381, 365,
+       366, 1, 4, 381, 380, 364, 365, 1, 4, 380, 379, 363, 364, 1, 4, 379, 378, 362, 363, 1,
+       4, 378, 377, 361, 362, 1, 4, 377, 376, 360, 361, 1, 4, 376, 375, 359, 360, 1, 4, 375,
+       374, 358, 359, 1, 4, 374, 373, 357, 358, 1, 4, 373, 372, 356, 357, 1, 4, 372, 371, 355,
+       356, 1, 4, 371, 370, 354, 355, 1, 4, 370, 369, 353, 354, 1, 4, 369, 368, 352, 353, 1,
+       4, 384, 399, 383, 368, 1, 4, 399, 398, 382, 383, 1, 4, 398, 397, 381, 382, 1, 4, 397,
+       396, 380, 381, 1, 4, 396, 395, 379, 380, 1, 4, 395, 394, 378, 379, 1, 4, 394, 393, 377,
+       378, 1, 4, 393, 392, 376, 377, 1, 4, 392, 391, 375, 376, 1, 4, 391, 390, 374, 375, 1,
+       4, 390, 389, 373, 374, 1, 4, 389, 388, 372, 373, 1, 4, 388, 387, 371, 372, 1, 4, 387,
+       386, 370, 371, 1, 4, 386, 385, 369, 370, 1, 4, 385, 384, 368, 369, 1, 4, 400, 415, 399,
+       384, 1, 4, 415, 414, 398, 399, 1, 4, 414, 413, 397, 398, 1, 4, 413, 412, 396, 397, 1,
+       4, 412, 411, 395, 396, 1, 4, 411, 410, 394, 395, 1, 4, 410, 409, 393, 394, 1, 4, 409,
+       408, 392, 393, 1, 4, 408, 407, 391, 392, 1, 4, 407, 406, 390, 391, 1, 4, 406, 405, 389,
+       390, 1, 4, 405, 404, 388, 389, 1, 4, 404, 403, 387, 388, 1, 4, 403, 402, 386, 387, 1,
+       4, 402, 401, 385, 386, 1, 4, 401, 400, 384, 385, 1, 4, 416, 431, 415, 400, 1, 4, 431,
+       430, 414, 415, 1, 4, 430, 429, 413, 414, 1, 4, 429, 428, 412, 413, 1, 4, 428, 427, 411,
+       412, 1, 4, 427, 426, 410, 411, 1, 4, 426, 425, 409, 410, 1, 4, 425, 424, 408, 409, 1,
+       4, 424, 423, 407, 408, 1, 4, 423, 422, 406, 407, 1, 4, 422, 421, 405, 406, 1, 4, 421,
+       420, 404, 405, 1, 4, 420, 419, 403, 404, 1, 4, 419, 418, 402, 403, 1, 4, 418, 417, 401,
+       402, 1, 4, 417, 416, 400, 401, 1, 4, 432, 447, 431, 416, 1, 4, 447, 446, 430, 431, 1,
+       4, 446, 445, 429, 430, 1, 4, 445, 444, 428, 429, 1, 4, 444, 443, 427, 428, 1, 4, 443,
+       442, 426, 427, 1, 4, 442, 441, 425, 426, 1, 4, 441, 440, 424, 425, 1, 4, 440, 439, 423,
+       424, 1, 4, 439, 438, 422, 423, 1, 4, 438, 437, 421, 422, 1, 4, 437, 436, 420, 421, 1,
+       4, 436, 435, 419, 420, 1, 4, 435, 434, 418, 419, 1, 4, 434, 433, 417, 418, 1, 4, 433,
+       432, 416, 417, 1, 4, 448, 463, 447, 432, 1, 4, 463, 462, 446, 447, 1, 4, 462, 461, 445,
+       446, 1, 4, 461, 460, 444, 445, 1, 4, 460, 459, 443, 444, 1, 4, 459, 458, 442, 443, 1,
+       4, 458, 457, 441, 442, 1, 4, 457, 456, 440, 441, 1, 4, 456, 455, 439, 440, 1, 4, 455,
+       454, 438, 439, 1, 4, 454, 453, 437, 438, 1, 4, 453, 452, 436, 437, 1, 4, 452, 451, 435,
+       436, 1, 4, 451, 450, 434, 435, 1, 4, 450, 449, 433, 434, 1, 4, 449, 448, 432, 433, 1,
+       4, 464, 479, 463, 448, 1, 4, 479, 478, 462, 463, 1, 4, 478, 477, 461, 462, 1, 4, 477,
+       476, 460, 461, 1, 4, 476, 475, 459, 460, 1, 4, 475, 474, 458, 459, 1, 4, 474, 473, 457,
+       458, 1, 4, 473, 472, 456, 457, 1, 4, 472, 471, 455, 456, 1, 4, 471, 470, 454, 455, 1,
+       4, 470, 469, 453, 454, 1, 4, 469, 468, 452, 453, 1, 4, 468, 467, 451, 452, 1, 4, 467,
+       466, 450, 451, 1, 4, 466, 465, 449, 450, 1, 4, 465, 464, 448, 449, 1, 4, 480, 495, 479,
+       464, 1, 4, 495, 494, 478, 479, 1, 4, 494, 493, 477, 478, 1, 4, 493, 492, 476, 477, 1,
+       4, 492, 491, 475, 476, 1, 4, 491, 490, 474, 475, 1, 4, 490, 489, 473, 474, 1, 4, 489,
+       488, 472, 473, 1, 4, 488, 487, 471, 472, 1, 4, 487, 486, 470, 471, 1, 4, 486, 485, 469,
+       470, 1, 4, 485, 484, 468, 469, 1, 4, 484, 483, 467, 468, 1, 4, 483, 482, 466, 467, 1,
+       4, 482, 481, 465, 466, 1, 4, 481, 480, 464, 465, 1, 4, 496, 511, 495, 480, 1, 4, 511,
+       510, 494, 495, 1, 4, 510, 509, 493, 494, 1, 4, 509, 508, 492, 493, 1, 4, 508, 507, 491,
+       492, 1, 4, 507, 506, 490, 491, 1, 4, 506, 505, 489, 490, 1, 4, 505, 504, 488, 489, 1,
+       4, 504, 503, 487, 488, 1, 4, 503, 502, 486, 487, 1, 4, 502, 501, 485, 486, 1, 4, 501,
+       500, 484, 485, 1, 4, 500, 499, 483, 484, 1, 4, 499, 498, 482, 483, 1, 4, 498, 497, 481,
+       482, 1, 4, 497, 496, 480, 481, 1, 4, 0, 15, 511, 496, 1, 4, 15, 14, 510, 511, 1,
+4, 14, 13, 509, 510, 1, 4, 13, 12, 508, 509, 1, 4, 12, 11, 507, 508, 1, 4, 11,
+  10, 506, 507, 1, 4, 10, 9, 505, 506, 1, 4, 9, 8, 504, 505, 1, 4, 8, 7, 503,
+    504, 1, 4, 7, 6, 502, 503, 1, 4, 6, 5, 501, 502, 1, 4, 5, 4, 500, 501, 1,
+      4, 4, 3, 499, 500, 1, 4, 3, 2, 498, 499, 1, 4, 2, 1, 497, 498, 1, 4, 1,
+       0, 496, 497, 1,
+       0
+};
+
+struct lwo  LWO_BigValve =
+{
+       716,                    /* number of points */
+       BigValve_PNTS, BigValve_normals, BigValve_POLS, 0L
+};
+
+static GLfloat Bolts3D_PNTS[] =
+{
+       (GLfloat) - 0.160704, (GLfloat) 0.399000, (GLfloat) 0.600000,
+       (GLfloat) - 0.160704, (GLfloat) 0.399000, (GLfloat) - 0.500000,
+       (GLfloat) - 0.400000, (GLfloat) 0.160257, (GLfloat) 0.600000,
+       (GLfloat) - 0.400000, (GLfloat) 0.160257, (GLfloat) - 0.500000,
+       (GLfloat) - 0.400000, (GLfloat) - 0.170369, (GLfloat) 0.600000,
+       (GLfloat) - 0.400000, (GLfloat) - 0.170369, (GLfloat) - 0.500000,
+       (GLfloat) - 0.153738, (GLfloat) - 0.400000, (GLfloat) 0.600000,
+       (GLfloat) - 0.153738, (GLfloat) - 0.400000, (GLfloat) - 0.500000,
+       (GLfloat) 0.176887, (GLfloat) - 0.400000, (GLfloat) 0.600000,
+       (GLfloat) 0.176887, (GLfloat) - 0.400000, (GLfloat) - 0.500000,
+       (GLfloat) 0.400000, (GLfloat) - 0.163403, (GLfloat) 0.600000,
+       (GLfloat) 0.400000, (GLfloat) - 0.163403, (GLfloat) - 0.500000,
+       (GLfloat) 0.400000, (GLfloat) 0.167223, (GLfloat) 0.600000,
+       (GLfloat) 0.400000, (GLfloat) 0.167223, (GLfloat) - 0.500000,
+       (GLfloat) 0.169922, (GLfloat) 0.399000, (GLfloat) 0.600000,
+       (GLfloat) 0.169922, (GLfloat) 0.399000, (GLfloat) - 0.500000,
+       (GLfloat) - 0.160704, (GLfloat) 0.399000, (GLfloat) 0.500000,
+       (GLfloat) - 0.160704, (GLfloat) 0.399000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.400000, (GLfloat) 0.160257, (GLfloat) - 0.600000,
+       (GLfloat) - 0.400000, (GLfloat) 0.160257, (GLfloat) 0.500000,
+       (GLfloat) - 0.400000, (GLfloat) - 0.170369, (GLfloat) - 0.600000,
+       (GLfloat) - 0.400000, (GLfloat) - 0.170369, (GLfloat) 0.500000,
+       (GLfloat) - 0.153738, (GLfloat) - 0.400000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.153738, (GLfloat) - 0.400000, (GLfloat) 0.500000,
+       (GLfloat) 0.176887, (GLfloat) - 0.400000, (GLfloat) 0.500000,
+       (GLfloat) 0.176887, (GLfloat) - 0.400000, (GLfloat) - 0.600000,
+       (GLfloat) 0.400000, (GLfloat) - 0.163403, (GLfloat) 0.500000,
+       (GLfloat) 0.400000, (GLfloat) - 0.163403, (GLfloat) - 0.600000,
+       (GLfloat) 0.400000, (GLfloat) 0.167223, (GLfloat) - 0.600000,
+       (GLfloat) 0.400000, (GLfloat) 0.167223, (GLfloat) 0.500000,
+       (GLfloat) 0.169922, (GLfloat) 0.399000, (GLfloat) - 0.600000,
+       (GLfloat) 0.169922, (GLfloat) 0.399000, (GLfloat) 0.500000,
+};
+
+static GLfloat Bolts3D_normals[] =
+{
+       (GLfloat) 0.000000, (GLfloat) 1.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.709703, (GLfloat) 0.704502, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.727535, (GLfloat) - 0.686070, (GLfloat) - 0.000000,
+       (GLfloat) 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.681980, (GLfloat) - 0.731370, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.706289, (GLfloat) 0.707924, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 1.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.709703, (GLfloat) 0.704502, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.727535, (GLfloat) - 0.686070, (GLfloat) - 0.000000,
+       (GLfloat) 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.681980, (GLfloat) - 0.731370, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.706289, (GLfloat) 0.707924, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+};
+
+static unsigned short int Bolts3D_POLS[] =
+{
+      4, 16, 31, 14, 0, 1, 4, 31, 29, 12, 14, 1, 4, 29, 26, 10, 12, 1, 4, 26,
+       24, 8, 10, 1, 4, 24, 23, 6, 8, 1, 4, 23, 21, 4, 6, 1, 4, 21, 19, 2,
+       4, 1, 4, 19, 16, 0, 2, 1, 8, 14, 12, 10, 8, 6, 4, 2, 0, 1, 4, 17,
+      30, 15, 1, 1, 4, 30, 28, 13, 15, 1, 4, 28, 27, 11, 13, 1, 4, 27, 25, 9,
+       11, 1, 4, 25, 22, 7, 9, 1, 4, 22, 20, 5, 7, 1, 4, 20, 18, 3, 5, 1,
+       4, 18, 17, 1, 3, 1, 8, 30, 17, 18, 20, 22, 25, 27, 28, 1,
+       0
+};
+
+struct lwo  LWO_Bolts3D =
+{
+       32,                     /* number of points */
+       Bolts3D_PNTS, Bolts3D_normals, Bolts3D_POLS, 0L
+};
+
+static GLfloat GuageConnector_PNTS[] =
+{
+       (GLfloat) 0.200000, (GLfloat) 0.400000, (GLfloat) - 0.000000,
+       (GLfloat) 0.200000, (GLfloat) 0.800000, (GLfloat) - 0.000000,
+       (GLfloat) 0.193185, (GLfloat) 0.400000, (GLfloat) - 0.051764,
+       (GLfloat) 0.193185, (GLfloat) 0.800000, (GLfloat) - 0.051764,
+       (GLfloat) 0.173205, (GLfloat) 0.400000, (GLfloat) - 0.100000,
+       (GLfloat) 0.173205, (GLfloat) 0.800000, (GLfloat) - 0.100000,
+       (GLfloat) 0.141421, (GLfloat) 0.800000, (GLfloat) - 0.141421,
+       (GLfloat) 0.141421, (GLfloat) 0.400000, (GLfloat) - 0.141421,
+       (GLfloat) 0.100000, (GLfloat) 0.400000, (GLfloat) - 0.173205,
+       (GLfloat) 0.100000, (GLfloat) 0.800000, (GLfloat) - 0.173205,
+       (GLfloat) 0.051764, (GLfloat) 0.800000, (GLfloat) - 0.193185,
+       (GLfloat) 0.051764, (GLfloat) 0.400000, (GLfloat) - 0.193185,
+       (GLfloat) 0.000000, (GLfloat) 0.800000, (GLfloat) - 0.200000,
+       (GLfloat) 0.000000, (GLfloat) 0.400000, (GLfloat) - 0.200000,
+       (GLfloat) - 0.051764, (GLfloat) 0.800000, (GLfloat) - 0.193185,
+       (GLfloat) - 0.051764, (GLfloat) 0.400000, (GLfloat) - 0.193185,
+       (GLfloat) - 0.100000, (GLfloat) 0.800000, (GLfloat) - 0.173205,
+       (GLfloat) - 0.100000, (GLfloat) 0.400000, (GLfloat) - 0.173205,
+       (GLfloat) - 0.141421, (GLfloat) 0.400000, (GLfloat) - 0.141421,
+       (GLfloat) - 0.141421, (GLfloat) 0.800000, (GLfloat) - 0.141421,
+       (GLfloat) - 0.173205, (GLfloat) 0.800000, (GLfloat) - 0.100000,
+       (GLfloat) - 0.173205, (GLfloat) 0.400000, (GLfloat) - 0.100000,
+       (GLfloat) - 0.193185, (GLfloat) 0.400000, (GLfloat) - 0.051764,
+       (GLfloat) - 0.193185, (GLfloat) 0.800000, (GLfloat) - 0.051764,
+       (GLfloat) - 0.200000, (GLfloat) 0.400000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.200000, (GLfloat) 0.800000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.193185, (GLfloat) 0.400000, (GLfloat) 0.051764,
+       (GLfloat) - 0.193185, (GLfloat) 0.800000, (GLfloat) 0.051764,
+       (GLfloat) - 0.173205, (GLfloat) 0.400000, (GLfloat) 0.100000,
+       (GLfloat) - 0.173205, (GLfloat) 0.800000, (GLfloat) 0.100000,
+       (GLfloat) - 0.141421, (GLfloat) 0.800000, (GLfloat) 0.141421,
+       (GLfloat) - 0.141421, (GLfloat) 0.400000, (GLfloat) 0.141421,
+       (GLfloat) - 0.100000, (GLfloat) 0.800000, (GLfloat) 0.173205,
+       (GLfloat) - 0.100000, (GLfloat) 0.400000, (GLfloat) 0.173205,
+       (GLfloat) - 0.051764, (GLfloat) 0.800000, (GLfloat) 0.193185,
+       (GLfloat) - 0.051764, (GLfloat) 0.400000, (GLfloat) 0.193185,
+       (GLfloat) - 0.000000, (GLfloat) 0.800000, (GLfloat) 0.200000,
+       (GLfloat) - 0.000000, (GLfloat) 0.400000, (GLfloat) 0.200000,
+       (GLfloat) 0.051764, (GLfloat) 0.800000, (GLfloat) 0.193185,
+       (GLfloat) 0.051764, (GLfloat) 0.400000, (GLfloat) 0.193185,
+       (GLfloat) 0.100000, (GLfloat) 0.400000, (GLfloat) 0.173205,
+       (GLfloat) 0.100000, (GLfloat) 0.800000, (GLfloat) 0.173205,
+       (GLfloat) 0.141421, (GLfloat) 0.400000, (GLfloat) 0.141421,
+       (GLfloat) 0.141421, (GLfloat) 0.800000, (GLfloat) 0.141421,
+       (GLfloat) 0.173205, (GLfloat) 0.800000, (GLfloat) 0.100000,
+       (GLfloat) 0.173205, (GLfloat) 0.400000, (GLfloat) 0.100000,
+       (GLfloat) 0.193185, (GLfloat) 0.400000, (GLfloat) 0.051764,
+       (GLfloat) 0.193185, (GLfloat) 0.800000, (GLfloat) 0.051764,
+       (GLfloat) 0.200000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) 0.193185, (GLfloat) 0.550000, (GLfloat) - 0.051764,
+       (GLfloat) 0.173205, (GLfloat) 0.550000, (GLfloat) - 0.100000,
+       (GLfloat) 0.141421, (GLfloat) 0.550000, (GLfloat) - 0.141421,
+       (GLfloat) 0.100000, (GLfloat) 0.550000, (GLfloat) - 0.173205,
+       (GLfloat) 0.051764, (GLfloat) 0.550000, (GLfloat) - 0.193185,
+       (GLfloat) 0.000000, (GLfloat) 0.550000, (GLfloat) - 0.200000,
+       (GLfloat) - 0.051764, (GLfloat) 0.550000, (GLfloat) - 0.193185,
+       (GLfloat) - 0.100000, (GLfloat) 0.550000, (GLfloat) - 0.173205,
+       (GLfloat) - 0.141421, (GLfloat) 0.550000, (GLfloat) - 0.141421,
+       (GLfloat) - 0.173205, (GLfloat) 0.550000, (GLfloat) - 0.100000,
+       (GLfloat) - 0.193185, (GLfloat) 0.550000, (GLfloat) - 0.051764,
+       (GLfloat) - 0.200000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.193185, (GLfloat) 0.550000, (GLfloat) 0.051764,
+       (GLfloat) - 0.173205, (GLfloat) 0.550000, (GLfloat) 0.100000,
+       (GLfloat) - 0.141421, (GLfloat) 0.550000, (GLfloat) 0.141421,
+       (GLfloat) - 0.100000, (GLfloat) 0.550000, (GLfloat) 0.173205,
+       (GLfloat) - 0.051764, (GLfloat) 0.550000, (GLfloat) 0.193185,
+       (GLfloat) - 0.000000, (GLfloat) 0.550000, (GLfloat) 0.200000,
+       (GLfloat) 0.051764, (GLfloat) 0.550000, (GLfloat) 0.193185,
+       (GLfloat) 0.100000, (GLfloat) 0.550000, (GLfloat) 0.173205,
+       (GLfloat) 0.141421, (GLfloat) 0.550000, (GLfloat) 0.141421,
+       (GLfloat) 0.173205, (GLfloat) 0.550000, (GLfloat) 0.100000,
+       (GLfloat) 0.193185, (GLfloat) 0.550000, (GLfloat) 0.051764,
+       (GLfloat) 0.150000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) 0.144889, (GLfloat) 0.550000, (GLfloat) - 0.038823,
+       (GLfloat) 0.129904, (GLfloat) 0.550000, (GLfloat) - 0.075000,
+       (GLfloat) 0.106066, (GLfloat) 0.550000, (GLfloat) - 0.106066,
+       (GLfloat) 0.075000, (GLfloat) 0.550000, (GLfloat) - 0.129904,
+       (GLfloat) 0.038823, (GLfloat) 0.550000, (GLfloat) - 0.144889,
+       (GLfloat) 0.000000, (GLfloat) 0.550000, (GLfloat) - 0.150000,
+       (GLfloat) - 0.038823, (GLfloat) 0.550000, (GLfloat) - 0.144889,
+       (GLfloat) - 0.075000, (GLfloat) 0.550000, (GLfloat) - 0.129904,
+       (GLfloat) - 0.106066, (GLfloat) 0.550000, (GLfloat) - 0.106066,
+       (GLfloat) - 0.129904, (GLfloat) 0.550000, (GLfloat) - 0.075000,
+       (GLfloat) - 0.144889, (GLfloat) 0.550000, (GLfloat) - 0.038823,
+       (GLfloat) - 0.150000, (GLfloat) 0.550000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.144889, (GLfloat) 0.550000, (GLfloat) 0.038823,
+       (GLfloat) - 0.129904, (GLfloat) 0.550000, (GLfloat) 0.075000,
+       (GLfloat) - 0.106066, (GLfloat) 0.550000, (GLfloat) 0.106066,
+       (GLfloat) - 0.075000, (GLfloat) 0.550000, (GLfloat) 0.129904,
+       (GLfloat) - 0.038823, (GLfloat) 0.550000, (GLfloat) 0.144889,
+       (GLfloat) - 0.000000, (GLfloat) 0.550000, (GLfloat) 0.150000,
+       (GLfloat) 0.038823, (GLfloat) 0.550000, (GLfloat) 0.144889,
+       (GLfloat) 0.075000, (GLfloat) 0.550000, (GLfloat) 0.129904,
+       (GLfloat) 0.106066, (GLfloat) 0.550000, (GLfloat) 0.106066,
+       (GLfloat) 0.129904, (GLfloat) 0.550000, (GLfloat) 0.075000,
+       (GLfloat) 0.144889, (GLfloat) 0.550000, (GLfloat) 0.038823,
+       (GLfloat) 0.150000, (GLfloat) 0.800000, (GLfloat) - 0.000000,
+       (GLfloat) 0.144889, (GLfloat) 0.800000, (GLfloat) - 0.038823,
+       (GLfloat) 0.129904, (GLfloat) 0.800000, (GLfloat) - 0.075000,
+       (GLfloat) 0.106066, (GLfloat) 0.800000, (GLfloat) - 0.106066,
+       (GLfloat) 0.075000, (GLfloat) 0.800000, (GLfloat) - 0.129904,
+       (GLfloat) 0.038823, (GLfloat) 0.800000, (GLfloat) - 0.144889,
+       (GLfloat) 0.000000, (GLfloat) 0.800000, (GLfloat) - 0.150000,
+       (GLfloat) - 0.038823, (GLfloat) 0.800000, (GLfloat) - 0.144889,
+       (GLfloat) - 0.075000, (GLfloat) 0.800000, (GLfloat) - 0.129904,
+       (GLfloat) - 0.106066, (GLfloat) 0.800000, (GLfloat) - 0.106066,
+       (GLfloat) - 0.129904, (GLfloat) 0.800000, (GLfloat) - 0.075000,
+       (GLfloat) - 0.144889, (GLfloat) 0.800000, (GLfloat) - 0.038823,
+       (GLfloat) - 0.150000, (GLfloat) 0.800000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.144889, (GLfloat) 0.800000, (GLfloat) 0.038823,
+       (GLfloat) - 0.129904, (GLfloat) 0.800000, (GLfloat) 0.075000,
+       (GLfloat) - 0.106066, (GLfloat) 0.800000, (GLfloat) 0.106066,
+       (GLfloat) - 0.075000, (GLfloat) 0.800000, (GLfloat) 0.129904,
+       (GLfloat) - 0.038823, (GLfloat) 0.800000, (GLfloat) 0.144889,
+       (GLfloat) - 0.000000, (GLfloat) 0.800000, (GLfloat) 0.150000,
+       (GLfloat) 0.038823, (GLfloat) 0.800000, (GLfloat) 0.144889,
+       (GLfloat) 0.075000, (GLfloat) 0.800000, (GLfloat) 0.129904,
+       (GLfloat) 0.106066, (GLfloat) 0.800000, (GLfloat) 0.106066,
+       (GLfloat) 0.129904, (GLfloat) 0.800000, (GLfloat) 0.075000,
+       (GLfloat) 0.144889, (GLfloat) 0.800000, (GLfloat) 0.038823,
+       (GLfloat) 0.200000, (GLfloat) 0.875988, (GLfloat) - 0.000000,
+       (GLfloat) 0.193185, (GLfloat) 0.872346, (GLfloat) - 0.051764,
+       (GLfloat) 0.191342, (GLfloat) 0.871360, (GLfloat) - 0.056214,
+       (GLfloat) 0.173205, (GLfloat) 0.865859, (GLfloat) - 0.100000,
+       (GLfloat) 0.141421, (GLfloat) 0.856217, (GLfloat) - 0.141421,
+       (GLfloat) 0.100000, (GLfloat) 0.843652, (GLfloat) - 0.173205,
+       (GLfloat) 0.097545, (GLfloat) 0.842907, (GLfloat) - 0.174222,
+       (GLfloat) 0.051764, (GLfloat) 0.838398, (GLfloat) - 0.193185,
+       (GLfloat) 0.000000, (GLfloat) 0.833300, (GLfloat) - 0.200000,
+       (GLfloat) - 0.051764, (GLfloat) 0.838398, (GLfloat) - 0.193185,
+       (GLfloat) - 0.097545, (GLfloat) 0.842907, (GLfloat) - 0.174222,
+       (GLfloat) - 0.100000, (GLfloat) 0.843652, (GLfloat) - 0.173205,
+       (GLfloat) - 0.141421, (GLfloat) 0.856217, (GLfloat) - 0.141421,
+       (GLfloat) - 0.173205, (GLfloat) 0.865859, (GLfloat) - 0.100000,
+       (GLfloat) - 0.191342, (GLfloat) 0.871360, (GLfloat) - 0.056214,
+       (GLfloat) - 0.193185, (GLfloat) 0.872346, (GLfloat) - 0.051764,
+       (GLfloat) - 0.200000, (GLfloat) 0.875988, (GLfloat) - 0.000000,
+       (GLfloat) - 0.193185, (GLfloat) 0.872346, (GLfloat) 0.051764,
+       (GLfloat) - 0.173205, (GLfloat) 0.865859, (GLfloat) 0.100000,
+       (GLfloat) - 0.191342, (GLfloat) 0.871360, (GLfloat) 0.056214,
+       (GLfloat) - 0.141421, (GLfloat) 0.856217, (GLfloat) 0.141421,
+       (GLfloat) - 0.100000, (GLfloat) 0.843652, (GLfloat) 0.173205,
+       (GLfloat) - 0.051764, (GLfloat) 0.838398, (GLfloat) 0.193185,
+       (GLfloat) - 0.097545, (GLfloat) 0.842907, (GLfloat) 0.174222,
+       (GLfloat) - 0.000000, (GLfloat) 0.833300, (GLfloat) 0.200000,
+       (GLfloat) 0.051764, (GLfloat) 0.838398, (GLfloat) 0.193185,
+       (GLfloat) 0.100000, (GLfloat) 0.843652, (GLfloat) 0.173205,
+       (GLfloat) 0.097545, (GLfloat) 0.842907, (GLfloat) 0.174222,
+       (GLfloat) 0.141421, (GLfloat) 0.856217, (GLfloat) 0.141421,
+       (GLfloat) 0.173205, (GLfloat) 0.865859, (GLfloat) 0.100000,
+       (GLfloat) 0.193185, (GLfloat) 0.872346, (GLfloat) 0.051764,
+       (GLfloat) 0.191342, (GLfloat) 0.871360, (GLfloat) 0.056214,
+};
+
+static GLfloat GuageConnector_normals[] =
+{
+       (GLfloat) 0.991445, (GLfloat) 0.000000, (GLfloat) - 0.130526,
+       (GLfloat) 0.923880, (GLfloat) 0.000000, (GLfloat) - 0.382683,
+       (GLfloat) 0.793353, (GLfloat) 0.000000, (GLfloat) - 0.608761,
+       (GLfloat) 0.608761, (GLfloat) 0.000000, (GLfloat) - 0.793353,
+       (GLfloat) 0.382683, (GLfloat) 0.000000, (GLfloat) - 0.923880,
+       (GLfloat) 0.130526, (GLfloat) 0.000000, (GLfloat) - 0.991445,
+       (GLfloat) - 0.130526, (GLfloat) - 0.000000, (GLfloat) - 0.991445,
+       (GLfloat) - 0.382683, (GLfloat) - 0.000000, (GLfloat) - 0.923880,
+       (GLfloat) - 0.608761, (GLfloat) - 0.000000, (GLfloat) - 0.793353,
+       (GLfloat) - 0.793353, (GLfloat) - 0.000000, (GLfloat) - 0.608761,
+       (GLfloat) - 0.923880, (GLfloat) - 0.000000, (GLfloat) - 0.382683,
+       (GLfloat) - 0.991445, (GLfloat) - 0.000000, (GLfloat) - 0.130526,
+       (GLfloat) - 0.991445, (GLfloat) 0.000000, (GLfloat) 0.130526,
+       (GLfloat) - 0.923880, (GLfloat) 0.000000, (GLfloat) 0.382683,
+       (GLfloat) - 0.793353, (GLfloat) 0.000000, (GLfloat) 0.608761,
+       (GLfloat) - 0.608761, (GLfloat) 0.000000, (GLfloat) 0.793353,
+       (GLfloat) - 0.382683, (GLfloat) 0.000000, (GLfloat) 0.923880,
+       (GLfloat) - 0.130526, (GLfloat) 0.000000, (GLfloat) 0.991445,
+       (GLfloat) 0.130526, (GLfloat) 0.000000, (GLfloat) 0.991445,
+       (GLfloat) 0.382683, (GLfloat) 0.000000, (GLfloat) 0.923880,
+       (GLfloat) 0.608761, (GLfloat) 0.000000, (GLfloat) 0.793353,
+       (GLfloat) 0.793353, (GLfloat) 0.000000, (GLfloat) 0.608761,
+       (GLfloat) 0.923880, (GLfloat) 0.000000, (GLfloat) 0.382683,
+       (GLfloat) 0.991445, (GLfloat) 0.000000, (GLfloat) 0.130526,
+       (GLfloat) 0.991445, (GLfloat) 0.000000, (GLfloat) - 0.130526,
+       (GLfloat) 0.923880, (GLfloat) 0.000000, (GLfloat) - 0.382684,
+       (GLfloat) 0.793353, (GLfloat) 0.000000, (GLfloat) - 0.608761,
+       (GLfloat) 0.608761, (GLfloat) 0.000000, (GLfloat) - 0.793353,
+       (GLfloat) 0.382684, (GLfloat) 0.000000, (GLfloat) - 0.923880,
+       (GLfloat) 0.130526, (GLfloat) 0.000000, (GLfloat) - 0.991445,
+       (GLfloat) - 0.130526, (GLfloat) 0.000000, (GLfloat) - 0.991445,
+       (GLfloat) - 0.382684, (GLfloat) 0.000000, (GLfloat) - 0.923880,
+       (GLfloat) - 0.608761, (GLfloat) 0.000000, (GLfloat) - 0.793353,
+       (GLfloat) - 0.793353, (GLfloat) 0.000000, (GLfloat) - 0.608761,
+       (GLfloat) - 0.923880, (GLfloat) 0.000000, (GLfloat) - 0.382684,
+       (GLfloat) - 0.991445, (GLfloat) 0.000000, (GLfloat) - 0.130526,
+       (GLfloat) - 0.991445, (GLfloat) 0.000000, (GLfloat) 0.130526,
+       (GLfloat) - 0.923880, (GLfloat) 0.000000, (GLfloat) 0.382684,
+       (GLfloat) - 0.793353, (GLfloat) 0.000000, (GLfloat) 0.608761,
+       (GLfloat) - 0.608761, (GLfloat) 0.000000, (GLfloat) 0.793353,
+       (GLfloat) - 0.382684, (GLfloat) 0.000000, (GLfloat) 0.923880,
+       (GLfloat) - 0.130526, (GLfloat) 0.000000, (GLfloat) 0.991445,
+       (GLfloat) 0.130526, (GLfloat) - 0.000000, (GLfloat) 0.991445,
+       (GLfloat) 0.382684, (GLfloat) - 0.000000, (GLfloat) 0.923880,
+       (GLfloat) 0.608761, (GLfloat) - 0.000000, (GLfloat) 0.793353,
+       (GLfloat) 0.793353, (GLfloat) - 0.000000, (GLfloat) 0.608761,
+       (GLfloat) 0.923880, (GLfloat) - 0.000000, (GLfloat) 0.382684,
+       (GLfloat) 0.991445, (GLfloat) - 0.000000, (GLfloat) 0.130526,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.991445, (GLfloat) 0.000000, (GLfloat) - 0.130526,
+       (GLfloat) 0.923880, (GLfloat) 0.000000, (GLfloat) - 0.382684,
+       (GLfloat) 0.793353, (GLfloat) 0.000000, (GLfloat) - 0.608761,
+       (GLfloat) 0.608761, (GLfloat) 0.000000, (GLfloat) - 0.793353,
+       (GLfloat) 0.382684, (GLfloat) 0.000000, (GLfloat) - 0.923880,
+       (GLfloat) 0.130526, (GLfloat) 0.000000, (GLfloat) - 0.991445,
+       (GLfloat) - 0.130526, (GLfloat) 0.000000, (GLfloat) - 0.991445,
+       (GLfloat) - 0.382684, (GLfloat) 0.000000, (GLfloat) - 0.923880,
+       (GLfloat) - 0.608761, (GLfloat) 0.000000, (GLfloat) - 0.793353,
+       (GLfloat) - 0.793353, (GLfloat) 0.000000, (GLfloat) - 0.608761,
+       (GLfloat) - 0.923880, (GLfloat) 0.000000, (GLfloat) - 0.382684,
+       (GLfloat) - 0.991445, (GLfloat) 0.000000, (GLfloat) - 0.130526,
+       (GLfloat) - 0.991445, (GLfloat) 0.000000, (GLfloat) 0.130526,
+       (GLfloat) - 0.923880, (GLfloat) 0.000000, (GLfloat) 0.382684,
+       (GLfloat) - 0.793353, (GLfloat) 0.000000, (GLfloat) 0.608761,
+       (GLfloat) - 0.608761, (GLfloat) 0.000000, (GLfloat) 0.793353,
+       (GLfloat) - 0.382684, (GLfloat) 0.000000, (GLfloat) 0.923880,
+       (GLfloat) - 0.130526, (GLfloat) 0.000000, (GLfloat) 0.991445,
+       (GLfloat) 0.130526, (GLfloat) - 0.000000, (GLfloat) 0.991445,
+       (GLfloat) 0.382684, (GLfloat) - 0.000000, (GLfloat) 0.923880,
+       (GLfloat) 0.608761, (GLfloat) - 0.000000, (GLfloat) 0.793353,
+       (GLfloat) 0.793353, (GLfloat) - 0.000000, (GLfloat) 0.608761,
+       (GLfloat) 0.923880, (GLfloat) - 0.000000, (GLfloat) 0.382684,
+       (GLfloat) 0.991445, (GLfloat) - 0.000000, (GLfloat) 0.130526,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+};
+
+static unsigned short int GuageConnector_POLS[] =
+{
+    4, 1, 120, 121, 3, 1, 5, 3, 121, 122, 123, 5, 1, 4, 5, 123, 124, 6, 1, 4,
+6, 124, 125, 9, 1, 5, 9, 125, 126, 127, 10, 1, 4, 10, 127, 128, 12, 1, 4, 14,
+       12, 128, 129, 1, 5, 16, 14, 129, 130, 131, 1, 4, 19, 16, 131, 132, 1, 4, 20, 19,
+       132, 133, 1, 5, 23, 20, 133, 134, 135, 1, 4, 25, 23, 135, 136, 1, 4, 25, 136, 137,
+       27, 1, 5, 27, 137, 139, 138, 29, 1, 4, 29, 138, 140, 30, 1, 4, 30, 140, 141, 32,
+       1, 5, 32, 141, 143, 142, 34, 1, 4, 34, 142, 144, 36, 1, 4, 38, 36, 144, 145, 1,
+       5, 41, 38, 145, 147, 146, 1, 4, 43, 41, 146, 148, 1, 4, 44, 43, 148, 149, 1, 5,
+47, 44, 149, 151, 150, 1, 4, 1, 47, 150, 120, 1, 4, 96, 97, 73, 72, 1, 4, 97,
+ 98, 74, 73, 1, 4, 98, 99, 75, 74, 1, 4, 99, 100, 76, 75, 1, 4, 100, 101, 77,
+76, 1, 4, 101, 102, 78, 77, 1, 4, 102, 103, 79, 78, 1, 4, 103, 104, 80, 79, 1,
+       4, 104, 105, 81, 80, 1, 4, 105, 106, 82, 81, 1, 4, 106, 107, 83, 82, 1, 4, 107,
+       108, 84, 83, 1, 4, 108, 109, 85, 84, 1, 4, 109, 110, 86, 85, 1, 4, 110, 111, 87,
+86, 1, 4, 111, 112, 88, 87, 1, 4, 112, 113, 89, 88, 1, 4, 113, 114, 90, 89, 1,
+       4, 114, 115, 91, 90, 1, 4, 115, 116, 92, 91, 1, 4, 116, 117, 93, 92, 1, 4, 117,
+  118, 94, 93, 1, 4, 118, 119, 95, 94, 1, 4, 119, 96, 72, 95, 1, 24, 1, 3, 5,
+6, 9, 10, 12, 14, 16, 19, 20, 23, 25, 27, 29, 30, 32, 34, 36, 38, 41, 43, 44,
+       47, 1, 4, 48, 49, 2, 0, 1, 4, 49, 50, 4, 2, 1, 4, 50, 51, 7, 4, 1,
+       4, 51, 52, 8, 7, 1, 4, 52, 53, 11, 8, 1, 4, 53, 54, 13, 11, 1, 4, 54,
+    55, 15, 13, 1, 4, 55, 56, 17, 15, 1, 4, 56, 57, 18, 17, 1, 4, 57, 58, 21,
+     18, 1, 4, 58, 59, 22, 21, 1, 4, 59, 60, 24, 22, 1, 4, 60, 61, 26, 24, 1,
+     4, 61, 62, 28, 26, 1, 4, 62, 63, 31, 28, 1, 4, 63, 64, 33, 31, 1, 4, 64,
+    65, 35, 33, 1, 4, 65, 66, 37, 35, 1, 4, 66, 67, 39, 37, 1, 4, 67, 68, 40,
+     39, 1, 4, 68, 69, 42, 40, 1, 4, 69, 70, 45, 42, 1, 4, 70, 71, 46, 45, 1,
+ 4, 71, 48, 0, 46, 1, 24, 48, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60,
+       59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 1,
+       0
+};
+
+struct lwo  LWO_GuageConnector =
+{
+       152,                    /* number of points */
+       GuageConnector_PNTS, GuageConnector_normals, GuageConnector_POLS, 0L
+};
+
+static GLfloat GuageDial_PNTS[] =
+{
+       (GLfloat) 0.000000, (GLfloat) 0.050000, (GLfloat) 0.300000,
+       (GLfloat) 0.019134, (GLfloat) 0.046194, (GLfloat) 0.300000,
+       (GLfloat) 0.035355, (GLfloat) 0.035355, (GLfloat) 0.300000,
+       (GLfloat) 0.046194, (GLfloat) 0.019134, (GLfloat) 0.300000,
+       (GLfloat) 0.050000, (GLfloat) - 0.000000, (GLfloat) 0.300000,
+       (GLfloat) 0.046194, (GLfloat) - 0.019134, (GLfloat) 0.300000,
+       (GLfloat) 0.035355, (GLfloat) - 0.035400, (GLfloat) 0.275000,
+       (GLfloat) 0.035355, (GLfloat) - 0.035400, (GLfloat) 0.300000,
+       (GLfloat) 0.019134, (GLfloat) - 0.046200, (GLfloat) 0.300000,
+       (GLfloat) 0.000000, (GLfloat) - 0.050000, (GLfloat) 0.300000,
+       (GLfloat) - 0.019134, (GLfloat) - 0.046200, (GLfloat) 0.300000,
+       (GLfloat) - 0.035355, (GLfloat) - 0.035400, (GLfloat) 0.275000,
+       (GLfloat) - 0.035355, (GLfloat) - 0.035400, (GLfloat) 0.300000,
+       (GLfloat) - 0.046194, (GLfloat) - 0.019134, (GLfloat) 0.300000,
+       (GLfloat) - 0.050000, (GLfloat) - 0.000000, (GLfloat) 0.300000,
+       (GLfloat) - 0.046194, (GLfloat) 0.019134, (GLfloat) 0.300000,
+       (GLfloat) - 0.035355, (GLfloat) 0.035355, (GLfloat) 0.300000,
+       (GLfloat) - 0.019134, (GLfloat) 0.046194, (GLfloat) 0.300000,
+       (GLfloat) 0.000000, (GLfloat) 0.050000, (GLfloat) 0.200000,
+       (GLfloat) 0.019134, (GLfloat) 0.046194, (GLfloat) 0.200000,
+       (GLfloat) 0.035355, (GLfloat) 0.035355, (GLfloat) 0.200000,
+       (GLfloat) 0.046194, (GLfloat) 0.019134, (GLfloat) 0.200000,
+       (GLfloat) 0.050000, (GLfloat) - 0.000000, (GLfloat) 0.200000,
+       (GLfloat) 0.046194, (GLfloat) - 0.019134, (GLfloat) 0.200000,
+       (GLfloat) 0.035355, (GLfloat) - 0.035355, (GLfloat) 0.200000,
+       (GLfloat) 0.019134, (GLfloat) - 0.046194, (GLfloat) 0.200000,
+       (GLfloat) 0.000000, (GLfloat) - 0.050000, (GLfloat) 0.200000,
+       (GLfloat) - 0.019134, (GLfloat) - 0.046194, (GLfloat) 0.200000,
+       (GLfloat) - 0.035355, (GLfloat) - 0.035355, (GLfloat) 0.200000,
+       (GLfloat) - 0.046194, (GLfloat) - 0.019134, (GLfloat) 0.200000,
+       (GLfloat) - 0.050000, (GLfloat) - 0.000000, (GLfloat) 0.200000,
+       (GLfloat) - 0.046194, (GLfloat) 0.019134, (GLfloat) 0.200000,
+       (GLfloat) - 0.035355, (GLfloat) 0.035355, (GLfloat) 0.200000,
+       (GLfloat) - 0.019134, (GLfloat) 0.046194, (GLfloat) 0.200000,
+       (GLfloat) 0.000000, (GLfloat) - 0.373300, (GLfloat) 0.275000,
+};
+
+static GLfloat GuageDial_normals[] =
+{
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.195089, (GLfloat) 0.980786, (GLfloat) 0.000000,
+       (GLfloat) 0.555570, (GLfloat) 0.831470, (GLfloat) 0.000000,
+       (GLfloat) 0.831470, (GLfloat) 0.555570, (GLfloat) 0.000000,
+       (GLfloat) 0.980785, (GLfloat) 0.195090, (GLfloat) 0.000000,
+       (GLfloat) 0.980785, (GLfloat) - 0.195090, (GLfloat) - 0.000000,
+       (GLfloat) 0.831470, (GLfloat) - 0.555570, (GLfloat) - 0.000248,
+       (GLfloat) 0.555570, (GLfloat) - 0.831470, (GLfloat) - 0.000051,
+       (GLfloat) 0.195089, (GLfloat) - 0.980786, (GLfloat) - 0.000000,
+       (GLfloat) - 0.195089, (GLfloat) - 0.980786, (GLfloat) - 0.000060,
+       (GLfloat) - 0.555570, (GLfloat) - 0.831470, (GLfloat) - 0.000371,
+       (GLfloat) - 0.831470, (GLfloat) - 0.555570, (GLfloat) - 0.000000,
+       (GLfloat) - 0.980785, (GLfloat) - 0.195090, (GLfloat) - 0.000000,
+       (GLfloat) - 0.980785, (GLfloat) 0.195090, (GLfloat) - 0.000000,
+       (GLfloat) - 0.831470, (GLfloat) 0.555570, (GLfloat) - 0.000000,
+       (GLfloat) - 0.555570, (GLfloat) 0.831470, (GLfloat) - 0.000000,
+       (GLfloat) - 0.195089, (GLfloat) 0.980786, (GLfloat) - 0.000000,
+};
+
+static unsigned short int GuageDial_POLS[] =
+{
+       3, 11, 6, 34, 1, 16, 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15,
+       16, 17, 1, 4, 18, 19, 1, 0, 1, 4, 19, 20, 2, 1, 1, 4, 20, 21, 3, 2,
+       1, 4, 21, 22, 4, 3, 1, 4, 22, 23, 5, 4, 1, 4, 23, 24, 7, 5, 1, 4,
+       24, 25, 8, 7, 1, 4, 25, 26, 9, 8, 1, 4, 26, 27, 10, 9, 1, 4, 27, 28,
+    12, 10, 1, 4, 28, 29, 13, 12, 1, 4, 29, 30, 14, 13, 1, 4, 30, 31, 15, 14,
+       1, 4, 31, 32, 16, 15, 1, 4, 32, 33, 17, 16, 1, 4, 33, 18, 0, 17, 1,
+       0
+};
+
+struct lwo  LWO_GuageDial =
+{
+       35,                     /* number of points */
+       GuageDial_PNTS, GuageDial_normals, GuageDial_POLS, 0L
+};
+
+static GLfloat GuageFace_PNTS[] =
+{
+       (GLfloat) 0.000000, (GLfloat) 1.783300, (GLfloat) 0.200000,
+       (GLfloat) - 0.087791, (GLfloat) 1.774653, (GLfloat) 0.200000,
+       (GLfloat) - 0.172208, (GLfloat) 1.749046, (GLfloat) 0.200000,
+       (GLfloat) - 0.250007, (GLfloat) 1.707461, (GLfloat) 0.200000,
+       (GLfloat) - 0.318198, (GLfloat) 1.651498, (GLfloat) 0.200000,
+       (GLfloat) - 0.374161, (GLfloat) 1.583307, (GLfloat) 0.200000,
+       (GLfloat) - 0.415746, (GLfloat) 1.505508, (GLfloat) 0.200000,
+       (GLfloat) - 0.441353, (GLfloat) 1.421091, (GLfloat) 0.200000,
+       (GLfloat) - 0.450000, (GLfloat) 1.333300, (GLfloat) 0.200000,
+       (GLfloat) - 0.441353, (GLfloat) 1.245509, (GLfloat) 0.200000,
+       (GLfloat) - 0.415746, (GLfloat) 1.161092, (GLfloat) 0.200000,
+       (GLfloat) - 0.374161, (GLfloat) 1.083293, (GLfloat) 0.200000,
+       (GLfloat) - 0.318198, (GLfloat) 1.015102, (GLfloat) 0.200000,
+       (GLfloat) - 0.250007, (GLfloat) 0.959139, (GLfloat) 0.200000,
+       (GLfloat) - 0.172208, (GLfloat) 0.917554, (GLfloat) 0.200000,
+       (GLfloat) - 0.087791, (GLfloat) 0.891947, (GLfloat) 0.200000,
+       (GLfloat) 0.000000, (GLfloat) 0.883300, (GLfloat) 0.200000,
+       (GLfloat) 0.087791, (GLfloat) 0.891947, (GLfloat) 0.200000,
+       (GLfloat) 0.172208, (GLfloat) 0.917554, (GLfloat) 0.200000,
+       (GLfloat) 0.250007, (GLfloat) 0.959139, (GLfloat) 0.200000,
+       (GLfloat) 0.318198, (GLfloat) 1.015102, (GLfloat) 0.200000,
+       (GLfloat) 0.374161, (GLfloat) 1.083293, (GLfloat) 0.200000,
+       (GLfloat) 0.415746, (GLfloat) 1.161092, (GLfloat) 0.200000,
+       (GLfloat) 0.441353, (GLfloat) 1.245509, (GLfloat) 0.200000,
+       (GLfloat) 0.450000, (GLfloat) 1.333300, (GLfloat) 0.200000,
+       (GLfloat) 0.441353, (GLfloat) 1.421091, (GLfloat) 0.200000,
+       (GLfloat) 0.415746, (GLfloat) 1.505508, (GLfloat) 0.200000,
+       (GLfloat) 0.374161, (GLfloat) 1.583307, (GLfloat) 0.200000,
+       (GLfloat) 0.318198, (GLfloat) 1.651498, (GLfloat) 0.200000,
+       (GLfloat) 0.250007, (GLfloat) 1.707461, (GLfloat) 0.200000,
+       (GLfloat) 0.172208, (GLfloat) 1.749046, (GLfloat) 0.200000,
+       (GLfloat) 0.087791, (GLfloat) 1.774653, (GLfloat) 0.200000,
+};
+
+static GLfloat GuageFace_normals[] =
+{
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+};
+
+static unsigned short int GuageFace_POLS[] =
+{
+32, 0, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14,
+       13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1,
+       0
+};
+
+struct lwo  LWO_GuageFace =
+{
+       32,                     /* number of points */
+       GuageFace_PNTS, GuageFace_normals, GuageFace_POLS, 0L
+};
+
+static GLfloat GuageHead_PNTS[] =
+{
+       (GLfloat) 0.000000, (GLfloat) 1.833300, (GLfloat) 0.333330,
+       (GLfloat) 0.097545, (GLfloat) 1.823693, (GLfloat) 0.333330,
+       (GLfloat) 0.191342, (GLfloat) 1.795240, (GLfloat) 0.333330,
+       (GLfloat) 0.277785, (GLfloat) 1.749035, (GLfloat) 0.333330,
+       (GLfloat) 0.353553, (GLfloat) 1.686853, (GLfloat) 0.333330,
+       (GLfloat) 0.415735, (GLfloat) 1.611085, (GLfloat) 0.333330,
+       (GLfloat) 0.461940, (GLfloat) 1.524642, (GLfloat) 0.333330,
+       (GLfloat) 0.490393, (GLfloat) 1.430845, (GLfloat) 0.333330,
+       (GLfloat) 0.500000, (GLfloat) 1.333300, (GLfloat) 0.333330,
+       (GLfloat) 0.490393, (GLfloat) 1.235755, (GLfloat) 0.333330,
+       (GLfloat) 0.461940, (GLfloat) 1.141958, (GLfloat) 0.333330,
+       (GLfloat) 0.415735, (GLfloat) 1.055515, (GLfloat) 0.333330,
+       (GLfloat) 0.353553, (GLfloat) 0.979747, (GLfloat) 0.333330,
+       (GLfloat) 0.277785, (GLfloat) 0.917565, (GLfloat) 0.333330,
+       (GLfloat) 0.191342, (GLfloat) 0.871360, (GLfloat) 0.333330,
+       (GLfloat) 0.097545, (GLfloat) 0.842907, (GLfloat) 0.333330,
+       (GLfloat) 0.000000, (GLfloat) 0.833300, (GLfloat) 0.333330,
+       (GLfloat) - 0.097545, (GLfloat) 0.842907, (GLfloat) 0.333330,
+       (GLfloat) - 0.191342, (GLfloat) 0.871360, (GLfloat) 0.333330,
+       (GLfloat) - 0.277785, (GLfloat) 0.917565, (GLfloat) 0.333330,
+       (GLfloat) - 0.353553, (GLfloat) 0.979747, (GLfloat) 0.333330,
+       (GLfloat) - 0.415735, (GLfloat) 1.055515, (GLfloat) 0.333330,
+       (GLfloat) - 0.461940, (GLfloat) 1.141958, (GLfloat) 0.333330,
+       (GLfloat) - 0.490393, (GLfloat) 1.235755, (GLfloat) 0.333330,
+       (GLfloat) - 0.500000, (GLfloat) 1.333300, (GLfloat) 0.333330,
+       (GLfloat) - 0.490393, (GLfloat) 1.430845, (GLfloat) 0.333330,
+       (GLfloat) - 0.461940, (GLfloat) 1.524642, (GLfloat) 0.333330,
+       (GLfloat) - 0.415735, (GLfloat) 1.611085, (GLfloat) 0.333330,
+       (GLfloat) - 0.353553, (GLfloat) 1.686853, (GLfloat) 0.333330,
+       (GLfloat) - 0.277785, (GLfloat) 1.749035, (GLfloat) 0.333330,
+       (GLfloat) - 0.191342, (GLfloat) 1.795240, (GLfloat) 0.333330,
+       (GLfloat) - 0.097545, (GLfloat) 1.823693, (GLfloat) 0.333330,
+       (GLfloat) 0.000000, (GLfloat) 1.833300, (GLfloat) - 0.333330,
+       (GLfloat) 0.097545, (GLfloat) 1.823693, (GLfloat) - 0.333330,
+       (GLfloat) 0.191342, (GLfloat) 1.795240, (GLfloat) - 0.333330,
+       (GLfloat) 0.277785, (GLfloat) 1.749035, (GLfloat) - 0.333330,
+       (GLfloat) 0.353553, (GLfloat) 1.686853, (GLfloat) - 0.333330,
+       (GLfloat) 0.415735, (GLfloat) 1.611085, (GLfloat) - 0.333330,
+       (GLfloat) 0.461940, (GLfloat) 1.524642, (GLfloat) - 0.333330,
+       (GLfloat) 0.490393, (GLfloat) 1.430845, (GLfloat) - 0.333330,
+       (GLfloat) 0.500000, (GLfloat) 1.333300, (GLfloat) - 0.333330,
+       (GLfloat) 0.490393, (GLfloat) 1.235755, (GLfloat) - 0.333330,
+       (GLfloat) 0.461940, (GLfloat) 1.141958, (GLfloat) - 0.333330,
+       (GLfloat) 0.415735, (GLfloat) 1.055515, (GLfloat) - 0.333330,
+       (GLfloat) 0.353553, (GLfloat) 0.979747, (GLfloat) - 0.333330,
+       (GLfloat) 0.277785, (GLfloat) 0.917565, (GLfloat) - 0.333330,
+       (GLfloat) 0.191342, (GLfloat) 0.871360, (GLfloat) - 0.333330,
+       (GLfloat) 0.097545, (GLfloat) 0.842907, (GLfloat) - 0.333330,
+       (GLfloat) 0.000000, (GLfloat) 0.833300, (GLfloat) - 0.333330,
+       (GLfloat) - 0.097545, (GLfloat) 0.842907, (GLfloat) - 0.333330,
+       (GLfloat) - 0.191342, (GLfloat) 0.871360, (GLfloat) - 0.333330,
+       (GLfloat) - 0.277785, (GLfloat) 0.917565, (GLfloat) - 0.333330,
+       (GLfloat) - 0.353553, (GLfloat) 0.979747, (GLfloat) - 0.333330,
+       (GLfloat) - 0.415735, (GLfloat) 1.055515, (GLfloat) - 0.333330,
+       (GLfloat) - 0.461940, (GLfloat) 1.141958, (GLfloat) - 0.333330,
+       (GLfloat) - 0.490393, (GLfloat) 1.235755, (GLfloat) - 0.333330,
+       (GLfloat) - 0.500000, (GLfloat) 1.333300, (GLfloat) - 0.333330,
+       (GLfloat) - 0.490393, (GLfloat) 1.430845, (GLfloat) - 0.333330,
+       (GLfloat) - 0.461940, (GLfloat) 1.524642, (GLfloat) - 0.333330,
+       (GLfloat) - 0.415735, (GLfloat) 1.611085, (GLfloat) - 0.333330,
+       (GLfloat) - 0.353553, (GLfloat) 1.686853, (GLfloat) - 0.333330,
+       (GLfloat) - 0.277785, (GLfloat) 1.749035, (GLfloat) - 0.333330,
+       (GLfloat) - 0.191342, (GLfloat) 1.795240, (GLfloat) - 0.333330,
+       (GLfloat) - 0.097545, (GLfloat) 1.823693, (GLfloat) - 0.333330,
+       (GLfloat) 0.087791, (GLfloat) 1.774653, (GLfloat) 0.333330,
+       (GLfloat) 0.000000, (GLfloat) 1.783300, (GLfloat) 0.333330,
+       (GLfloat) 0.172208, (GLfloat) 1.749046, (GLfloat) 0.333330,
+       (GLfloat) 0.250007, (GLfloat) 1.707461, (GLfloat) 0.333330,
+       (GLfloat) 0.318198, (GLfloat) 1.651498, (GLfloat) 0.333330,
+       (GLfloat) 0.374161, (GLfloat) 1.583307, (GLfloat) 0.333330,
+       (GLfloat) 0.415746, (GLfloat) 1.505508, (GLfloat) 0.333330,
+       (GLfloat) 0.441353, (GLfloat) 1.421091, (GLfloat) 0.333330,
+       (GLfloat) 0.450000, (GLfloat) 1.333300, (GLfloat) 0.333330,
+       (GLfloat) 0.441353, (GLfloat) 1.245509, (GLfloat) 0.333330,
+       (GLfloat) 0.415746, (GLfloat) 1.161092, (GLfloat) 0.333330,
+       (GLfloat) 0.374161, (GLfloat) 1.083293, (GLfloat) 0.333330,
+       (GLfloat) 0.318198, (GLfloat) 1.015102, (GLfloat) 0.333330,
+       (GLfloat) 0.250007, (GLfloat) 0.959139, (GLfloat) 0.333330,
+       (GLfloat) 0.172208, (GLfloat) 0.917554, (GLfloat) 0.333330,
+       (GLfloat) 0.087791, (GLfloat) 0.891947, (GLfloat) 0.333330,
+       (GLfloat) 0.000000, (GLfloat) 0.883300, (GLfloat) 0.333330,
+       (GLfloat) - 0.087791, (GLfloat) 0.891947, (GLfloat) 0.333330,
+       (GLfloat) - 0.172208, (GLfloat) 0.917554, (GLfloat) 0.333330,
+       (GLfloat) - 0.250007, (GLfloat) 0.959139, (GLfloat) 0.333330,
+       (GLfloat) - 0.318198, (GLfloat) 1.015102, (GLfloat) 0.333330,
+       (GLfloat) - 0.374161, (GLfloat) 1.083293, (GLfloat) 0.333330,
+       (GLfloat) - 0.415746, (GLfloat) 1.161092, (GLfloat) 0.333330,
+       (GLfloat) - 0.441353, (GLfloat) 1.245509, (GLfloat) 0.333330,
+       (GLfloat) - 0.450000, (GLfloat) 1.333300, (GLfloat) 0.333330,
+       (GLfloat) - 0.441353, (GLfloat) 1.421091, (GLfloat) 0.333330,
+       (GLfloat) - 0.415746, (GLfloat) 1.505508, (GLfloat) 0.333330,
+       (GLfloat) - 0.374161, (GLfloat) 1.583307, (GLfloat) 0.333330,
+       (GLfloat) - 0.318198, (GLfloat) 1.651498, (GLfloat) 0.333330,
+       (GLfloat) - 0.250007, (GLfloat) 1.707461, (GLfloat) 0.333330,
+       (GLfloat) - 0.172208, (GLfloat) 1.749046, (GLfloat) 0.333330,
+       (GLfloat) - 0.087791, (GLfloat) 1.774653, (GLfloat) 0.333330,
+       (GLfloat) 0.000000, (GLfloat) 1.783300, (GLfloat) 0.200000,
+       (GLfloat) - 0.087791, (GLfloat) 1.774653, (GLfloat) 0.200000,
+       (GLfloat) - 0.172208, (GLfloat) 1.749046, (GLfloat) 0.200000,
+       (GLfloat) - 0.250007, (GLfloat) 1.707461, (GLfloat) 0.200000,
+       (GLfloat) - 0.318198, (GLfloat) 1.651498, (GLfloat) 0.200000,
+       (GLfloat) - 0.374161, (GLfloat) 1.583307, (GLfloat) 0.200000,
+       (GLfloat) - 0.415746, (GLfloat) 1.505508, (GLfloat) 0.200000,
+       (GLfloat) - 0.441353, (GLfloat) 1.421091, (GLfloat) 0.200000,
+       (GLfloat) - 0.450000, (GLfloat) 1.333300, (GLfloat) 0.200000,
+       (GLfloat) - 0.441353, (GLfloat) 1.245509, (GLfloat) 0.200000,
+       (GLfloat) - 0.415746, (GLfloat) 1.161092, (GLfloat) 0.200000,
+       (GLfloat) - 0.374161, (GLfloat) 1.083293, (GLfloat) 0.200000,
+       (GLfloat) - 0.318198, (GLfloat) 1.015102, (GLfloat) 0.200000,
+       (GLfloat) - 0.250007, (GLfloat) 0.959139, (GLfloat) 0.200000,
+       (GLfloat) - 0.172208, (GLfloat) 0.917554, (GLfloat) 0.200000,
+       (GLfloat) - 0.087791, (GLfloat) 0.891947, (GLfloat) 0.200000,
+       (GLfloat) 0.000000, (GLfloat) 0.883300, (GLfloat) 0.200000,
+       (GLfloat) 0.087791, (GLfloat) 0.891947, (GLfloat) 0.200000,
+       (GLfloat) 0.172208, (GLfloat) 0.917554, (GLfloat) 0.200000,
+       (GLfloat) 0.250007, (GLfloat) 0.959139, (GLfloat) 0.200000,
+       (GLfloat) 0.318198, (GLfloat) 1.015102, (GLfloat) 0.200000,
+       (GLfloat) 0.374161, (GLfloat) 1.083293, (GLfloat) 0.200000,
+       (GLfloat) 0.415746, (GLfloat) 1.161092, (GLfloat) 0.200000,
+       (GLfloat) 0.441353, (GLfloat) 1.245509, (GLfloat) 0.200000,
+       (GLfloat) 0.450000, (GLfloat) 1.333300, (GLfloat) 0.200000,
+       (GLfloat) 0.441353, (GLfloat) 1.421091, (GLfloat) 0.200000,
+       (GLfloat) 0.415746, (GLfloat) 1.505508, (GLfloat) 0.200000,
+       (GLfloat) 0.374161, (GLfloat) 1.583307, (GLfloat) 0.200000,
+       (GLfloat) 0.318198, (GLfloat) 1.651498, (GLfloat) 0.200000,
+       (GLfloat) 0.250007, (GLfloat) 1.707461, (GLfloat) 0.200000,
+       (GLfloat) 0.172208, (GLfloat) 1.749046, (GLfloat) 0.200000,
+       (GLfloat) 0.087791, (GLfloat) 1.774653, (GLfloat) 0.200000,
+};
+
+static GLfloat GuageHead_normals[] =
+{
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.098017, (GLfloat) - 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) 0.290285, (GLfloat) - 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) 0.471397, (GLfloat) - 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) 0.634393, (GLfloat) - 0.773010, (GLfloat) - 0.000000,
+       (GLfloat) 0.773011, (GLfloat) - 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) 0.881921, (GLfloat) - 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) 0.956940, (GLfloat) - 0.290284, (GLfloat) - 0.000000,
+       (GLfloat) 0.995185, (GLfloat) - 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) 0.995185, (GLfloat) 0.098017, (GLfloat) 0.000000,
+       (GLfloat) 0.956940, (GLfloat) 0.290284, (GLfloat) 0.000000,
+       (GLfloat) 0.881921, (GLfloat) 0.471397, (GLfloat) 0.000000,
+       (GLfloat) 0.773011, (GLfloat) 0.634393, (GLfloat) 0.000000,
+       (GLfloat) 0.634393, (GLfloat) 0.773011, (GLfloat) 0.000000,
+       (GLfloat) 0.471397, (GLfloat) 0.881921, (GLfloat) 0.000000,
+       (GLfloat) 0.290285, (GLfloat) 0.956940, (GLfloat) 0.000000,
+       (GLfloat) 0.098017, (GLfloat) 0.995185, (GLfloat) 0.000000,
+       (GLfloat) - 0.098017, (GLfloat) 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) - 0.290285, (GLfloat) 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) - 0.471397, (GLfloat) 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) - 0.634393, (GLfloat) 0.773011, (GLfloat) - 0.000000,
+       (GLfloat) - 0.773011, (GLfloat) 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) - 0.881921, (GLfloat) 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) - 0.956940, (GLfloat) 0.290284, (GLfloat) - 0.000000,
+       (GLfloat) - 0.995185, (GLfloat) 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) - 0.995185, (GLfloat) - 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) - 0.956940, (GLfloat) - 0.290284, (GLfloat) - 0.000000,
+       (GLfloat) - 0.881921, (GLfloat) - 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) - 0.773011, (GLfloat) - 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) - 0.634393, (GLfloat) - 0.773010, (GLfloat) - 0.000000,
+       (GLfloat) - 0.471397, (GLfloat) - 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) - 0.290285, (GLfloat) - 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) - 0.098017, (GLfloat) - 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) 0.098017, (GLfloat) 0.995185, (GLfloat) 0.000000,
+       (GLfloat) 0.290285, (GLfloat) 0.956940, (GLfloat) 0.000000,
+       (GLfloat) 0.471397, (GLfloat) 0.881921, (GLfloat) 0.000000,
+       (GLfloat) 0.634393, (GLfloat) 0.773011, (GLfloat) 0.000000,
+       (GLfloat) 0.773011, (GLfloat) 0.634393, (GLfloat) 0.000000,
+       (GLfloat) 0.881921, (GLfloat) 0.471397, (GLfloat) 0.000000,
+       (GLfloat) 0.956940, (GLfloat) 0.290284, (GLfloat) 0.000000,
+       (GLfloat) 0.995185, (GLfloat) 0.098017, (GLfloat) 0.000000,
+       (GLfloat) 0.995185, (GLfloat) - 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) 0.956940, (GLfloat) - 0.290284, (GLfloat) - 0.000000,
+       (GLfloat) 0.881921, (GLfloat) - 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) 0.773011, (GLfloat) - 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) 0.634393, (GLfloat) - 0.773010, (GLfloat) - 0.000000,
+       (GLfloat) 0.471396, (GLfloat) - 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) 0.290285, (GLfloat) - 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) 0.098017, (GLfloat) - 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) - 0.098017, (GLfloat) - 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) - 0.290285, (GLfloat) - 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) - 0.471396, (GLfloat) - 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) - 0.634393, (GLfloat) - 0.773010, (GLfloat) - 0.000000,
+       (GLfloat) - 0.773011, (GLfloat) - 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) - 0.881921, (GLfloat) - 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) - 0.956940, (GLfloat) - 0.290284, (GLfloat) - 0.000000,
+       (GLfloat) - 0.995185, (GLfloat) - 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) - 0.995185, (GLfloat) 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) - 0.956940, (GLfloat) 0.290284, (GLfloat) - 0.000000,
+       (GLfloat) - 0.881921, (GLfloat) 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) - 0.773011, (GLfloat) 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) - 0.634393, (GLfloat) 0.773011, (GLfloat) - 0.000000,
+       (GLfloat) - 0.471397, (GLfloat) 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) - 0.290285, (GLfloat) 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) - 0.098017, (GLfloat) 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+};
+
+static unsigned short int GuageHead_POLS[] =
+{
+       3, 67, 3, 4, 1, 3, 68, 67, 4, 1, 3, 68, 4, 5, 1, 3, 69, 68, 5, 1,
+       3, 70, 69, 5, 1, 3, 70, 5, 6, 1, 3, 70, 6, 7, 1, 3, 71, 70, 7, 1,
+       3, 71, 7, 8, 1, 3, 72, 71, 8, 1, 3, 73, 72, 8, 1, 3, 73, 8, 9, 1,
+       3, 74, 73, 9, 1, 3, 74, 9, 10, 1, 3, 74, 10, 11, 1, 3, 75, 74, 11, 1,
+      3, 76, 75, 11, 1, 3, 76, 11, 12, 1, 3, 76, 12, 13, 1, 3, 77, 76, 13, 1,
+      3, 78, 77, 13, 1, 3, 78, 13, 14, 1, 3, 78, 14, 15, 1, 3, 79, 78, 15, 1,
+      3, 79, 15, 16, 1, 3, 80, 79, 16, 1, 3, 81, 80, 16, 1, 3, 81, 16, 17, 1,
+      3, 82, 81, 17, 1, 3, 82, 17, 18, 1, 3, 82, 18, 19, 1, 3, 83, 82, 19, 1,
+      3, 84, 83, 19, 1, 3, 84, 19, 20, 1, 3, 84, 20, 21, 1, 3, 85, 84, 21, 1,
+      3, 86, 85, 21, 1, 3, 86, 21, 22, 1, 3, 86, 22, 23, 1, 3, 87, 86, 23, 1,
+      3, 87, 23, 24, 1, 3, 88, 87, 24, 1, 3, 89, 88, 24, 1, 3, 89, 24, 25, 1,
+      3, 90, 89, 25, 1, 3, 90, 25, 26, 1, 3, 90, 26, 27, 1, 3, 91, 90, 27, 1,
+      3, 92, 91, 27, 1, 3, 92, 27, 28, 1, 3, 93, 92, 28, 1, 3, 93, 28, 29, 1,
+       3, 2, 3, 67, 1, 3, 2, 67, 66, 1, 3, 1, 2, 66, 1, 3, 1, 66, 64, 1,
+       3, 1, 64, 65, 1, 3, 0, 1, 65, 1, 3, 31, 0, 65, 1, 3, 31, 65, 95, 1,
+      3, 31, 95, 94, 1, 3, 30, 31, 94, 1, 3, 30, 94, 93, 1, 3, 93, 29, 30, 1,
+     4, 96, 97, 95, 65, 1, 4, 97, 98, 94, 95, 1, 4, 98, 99, 93, 94, 1, 4, 99,
+       100, 92, 93, 1, 4, 100, 101, 91, 92, 1, 4, 101, 102, 90, 91, 1, 4, 102, 103, 89,
+90, 1, 4, 103, 104, 88, 89, 1, 4, 104, 105, 87, 88, 1, 4, 105, 106, 86, 87, 1,
+       4, 106, 107, 85, 86, 1, 4, 107, 108, 84, 85, 1, 4, 108, 109, 83, 84, 1, 4, 109,
+       110, 82, 83, 1, 4, 110, 111, 81, 82, 1, 4, 111, 112, 80, 81, 1, 4, 112, 113, 79,
+80, 1, 4, 113, 114, 78, 79, 1, 4, 114, 115, 77, 78, 1, 4, 115, 116, 76, 77, 1,
+       4, 116, 117, 75, 76, 1, 4, 117, 118, 74, 75, 1, 4, 118, 119, 73, 74, 1, 4, 119,
+       120, 72, 73, 1, 4, 120, 121, 71, 72, 1, 4, 121, 122, 70, 71, 1, 4, 122, 123, 69,
+70, 1, 4, 123, 124, 68, 69, 1, 4, 124, 125, 67, 68, 1, 4, 125, 126, 66, 67, 1,
+    4, 126, 127, 64, 66, 1, 4, 127, 96, 65, 64, 1, 4, 32, 33, 1, 0, 1, 4, 33,
+       34, 2, 1, 1, 4, 34, 35, 3, 2, 1, 4, 35, 36, 4, 3, 1, 4, 36, 37, 5,
+       4, 1, 4, 37, 38, 6, 5, 1, 4, 38, 39, 7, 6, 1, 4, 39, 40, 8, 7, 1,
+       4, 40, 41, 9, 8, 1, 4, 41, 42, 10, 9, 1, 4, 42, 43, 11, 10, 1, 4, 43,
+    44, 12, 11, 1, 4, 44, 45, 13, 12, 1, 4, 45, 46, 14, 13, 1, 4, 46, 47, 15,
+     14, 1, 4, 47, 48, 16, 15, 1, 4, 48, 49, 17, 16, 1, 4, 49, 50, 18, 17, 1,
+     4, 50, 51, 19, 18, 1, 4, 51, 52, 20, 19, 1, 4, 52, 53, 21, 20, 1, 4, 53,
+    54, 22, 21, 1, 4, 54, 55, 23, 22, 1, 4, 55, 56, 24, 23, 1, 4, 56, 57, 25,
+     24, 1, 4, 57, 58, 26, 25, 1, 4, 58, 59, 27, 26, 1, 4, 59, 60, 28, 27, 1,
+     4, 60, 61, 29, 28, 1, 4, 61, 62, 30, 29, 1, 4, 62, 63, 31, 30, 1, 4, 63,
+32, 0, 31, 1, 32, 32, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,
+       49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 1,
+       0
+};
+
+struct lwo  LWO_GuageHead =
+{
+       128,                    /* number of points */
+       GuageHead_PNTS, GuageHead_normals, GuageHead_POLS, 0L
+};
+
+static GLfloat PipeBetweenBolts_PNTS[] =
+{
+       (GLfloat) 0.000000, (GLfloat) 0.500000, (GLfloat) 0.500000,
+       (GLfloat) 0.129410, (GLfloat) 0.482963, (GLfloat) 0.500000,
+       (GLfloat) 0.250000, (GLfloat) 0.433013, (GLfloat) 0.500000,
+       (GLfloat) 0.353553, (GLfloat) 0.353553, (GLfloat) 0.500000,
+       (GLfloat) 0.433013, (GLfloat) 0.250000, (GLfloat) 0.500000,
+       (GLfloat) 0.482963, (GLfloat) 0.129410, (GLfloat) 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.500000,
+       (GLfloat) 0.482963, (GLfloat) - 0.129410, (GLfloat) 0.500000,
+       (GLfloat) 0.433013, (GLfloat) - 0.250000, (GLfloat) 0.500000,
+       (GLfloat) 0.353553, (GLfloat) - 0.353553, (GLfloat) 0.500000,
+       (GLfloat) 0.250000, (GLfloat) - 0.433013, (GLfloat) 0.500000,
+       (GLfloat) 0.129410, (GLfloat) - 0.482963, (GLfloat) 0.500000,
+       (GLfloat) 0.000000, (GLfloat) - 0.500000, (GLfloat) 0.500000,
+       (GLfloat) - 0.129410, (GLfloat) - 0.482963, (GLfloat) 0.500000,
+       (GLfloat) - 0.250000, (GLfloat) - 0.433013, (GLfloat) 0.500000,
+       (GLfloat) - 0.353553, (GLfloat) - 0.353553, (GLfloat) 0.500000,
+       (GLfloat) - 0.433013, (GLfloat) - 0.250000, (GLfloat) 0.500000,
+       (GLfloat) - 0.482963, (GLfloat) - 0.129410, (GLfloat) 0.500000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) 0.500000,
+       (GLfloat) - 0.482963, (GLfloat) 0.129410, (GLfloat) 0.500000,
+       (GLfloat) - 0.433013, (GLfloat) 0.250000, (GLfloat) 0.500000,
+       (GLfloat) - 0.353553, (GLfloat) 0.353553, (GLfloat) 0.500000,
+       (GLfloat) - 0.250000, (GLfloat) 0.433013, (GLfloat) 0.500000,
+       (GLfloat) - 0.129410, (GLfloat) 0.482963, (GLfloat) 0.500000,
+       (GLfloat) 0.000000, (GLfloat) 0.500000, (GLfloat) - 0.500000,
+       (GLfloat) 0.129410, (GLfloat) 0.482963, (GLfloat) - 0.500000,
+       (GLfloat) 0.250000, (GLfloat) 0.433013, (GLfloat) - 0.500000,
+       (GLfloat) 0.353553, (GLfloat) 0.353553, (GLfloat) - 0.500000,
+       (GLfloat) 0.433013, (GLfloat) 0.250000, (GLfloat) - 0.500000,
+       (GLfloat) 0.482963, (GLfloat) 0.129410, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.500000,
+       (GLfloat) 0.482963, (GLfloat) - 0.129410, (GLfloat) - 0.500000,
+       (GLfloat) 0.433013, (GLfloat) - 0.250000, (GLfloat) - 0.500000,
+       (GLfloat) 0.353553, (GLfloat) - 0.353553, (GLfloat) - 0.500000,
+       (GLfloat) 0.250000, (GLfloat) - 0.433013, (GLfloat) - 0.500000,
+       (GLfloat) 0.129410, (GLfloat) - 0.482963, (GLfloat) - 0.500000,
+       (GLfloat) 0.000000, (GLfloat) - 0.500000, (GLfloat) - 0.500000,
+       (GLfloat) - 0.129410, (GLfloat) - 0.482963, (GLfloat) - 0.500000,
+       (GLfloat) - 0.250000, (GLfloat) - 0.433013, (GLfloat) - 0.500000,
+       (GLfloat) - 0.353553, (GLfloat) - 0.353553, (GLfloat) - 0.500000,
+       (GLfloat) - 0.433013, (GLfloat) - 0.250000, (GLfloat) - 0.500000,
+       (GLfloat) - 0.482963, (GLfloat) - 0.129410, (GLfloat) - 0.500000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.500000,
+       (GLfloat) - 0.482963, (GLfloat) 0.129410, (GLfloat) - 0.500000,
+       (GLfloat) - 0.433013, (GLfloat) 0.250000, (GLfloat) - 0.500000,
+       (GLfloat) - 0.353553, (GLfloat) 0.353553, (GLfloat) - 0.500000,
+       (GLfloat) - 0.250000, (GLfloat) 0.433013, (GLfloat) - 0.500000,
+       (GLfloat) - 0.129410, (GLfloat) 0.482963, (GLfloat) - 0.500000,
+};
+
+static GLfloat PipeBetweenBolts_normals[] =
+{
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.130526, (GLfloat) 0.991445, (GLfloat) 0.000000,
+       (GLfloat) 0.382683, (GLfloat) 0.923880, (GLfloat) 0.000000,
+       (GLfloat) 0.608761, (GLfloat) 0.793353, (GLfloat) 0.000000,
+       (GLfloat) 0.793353, (GLfloat) 0.608761, (GLfloat) 0.000000,
+       (GLfloat) 0.923880, (GLfloat) 0.382683, (GLfloat) 0.000000,
+       (GLfloat) 0.991445, (GLfloat) 0.130526, (GLfloat) 0.000000,
+       (GLfloat) 0.991445, (GLfloat) - 0.130526, (GLfloat) - 0.000000,
+       (GLfloat) 0.923880, (GLfloat) - 0.382683, (GLfloat) - 0.000000,
+       (GLfloat) 0.793353, (GLfloat) - 0.608761, (GLfloat) - 0.000000,
+       (GLfloat) 0.608761, (GLfloat) - 0.793353, (GLfloat) - 0.000000,
+       (GLfloat) 0.382683, (GLfloat) - 0.923880, (GLfloat) - 0.000000,
+       (GLfloat) 0.130526, (GLfloat) - 0.991445, (GLfloat) - 0.000000,
+       (GLfloat) - 0.130526, (GLfloat) - 0.991445, (GLfloat) - 0.000000,
+       (GLfloat) - 0.382683, (GLfloat) - 0.923880, (GLfloat) - 0.000000,
+       (GLfloat) - 0.608761, (GLfloat) - 0.793353, (GLfloat) - 0.000000,
+       (GLfloat) - 0.793353, (GLfloat) - 0.608761, (GLfloat) - 0.000000,
+       (GLfloat) - 0.923880, (GLfloat) - 0.382683, (GLfloat) - 0.000000,
+       (GLfloat) - 0.991445, (GLfloat) - 0.130526, (GLfloat) - 0.000000,
+       (GLfloat) - 0.991445, (GLfloat) 0.130526, (GLfloat) - 0.000000,
+       (GLfloat) - 0.923880, (GLfloat) 0.382683, (GLfloat) - 0.000000,
+       (GLfloat) - 0.793353, (GLfloat) 0.608761, (GLfloat) - 0.000000,
+       (GLfloat) - 0.608761, (GLfloat) 0.793353, (GLfloat) - 0.000000,
+       (GLfloat) - 0.382683, (GLfloat) 0.923880, (GLfloat) - 0.000000,
+       (GLfloat) - 0.130526, (GLfloat) 0.991445, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+};
+
+static unsigned short int PipeBetweenBolts_POLS[] =
+{
+       24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
+       19, 20, 21, 22, 23, 1, 4, 24, 25, 1, 0, 1, 4, 25, 26, 2, 1, 1, 4, 26,
+       27, 3, 2, 1, 4, 27, 28, 4, 3, 1, 4, 28, 29, 5, 4, 1, 4, 29, 30, 6,
+       5, 1, 4, 30, 31, 7, 6, 1, 4, 31, 32, 8, 7, 1, 4, 32, 33, 9, 8, 1,
+      4, 33, 34, 10, 9, 1, 4, 34, 35, 11, 10, 1, 4, 35, 36, 12, 11, 1, 4, 36,
+    37, 13, 12, 1, 4, 37, 38, 14, 13, 1, 4, 38, 39, 15, 14, 1, 4, 39, 40, 16,
+     15, 1, 4, 40, 41, 17, 16, 1, 4, 41, 42, 18, 17, 1, 4, 42, 43, 19, 18, 1,
+     4, 43, 44, 20, 19, 1, 4, 44, 45, 21, 20, 1, 4, 45, 46, 22, 21, 1, 4, 46,
+  47, 23, 22, 1, 4, 47, 24, 0, 23, 1, 24, 24, 47, 46, 45, 44, 43, 42, 41, 40,
+       39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 1,
+       0
+};
+
+struct lwo  LWO_PipeBetweenBolts =
+{
+       48,                     /* number of points */
+   PipeBetweenBolts_PNTS, PipeBetweenBolts_normals, PipeBetweenBolts_POLS, 0L
+};
+
+static GLfloat ElbowBolts_PNTS[] =
+{
+       (GLfloat) 0.273122, (GLfloat) - 0.600000, (GLfloat) - 0.403061,
+       (GLfloat) 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) 0.273122, (GLfloat) - 0.600000, (GLfloat) - 0.333061,
+       (GLfloat) 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.600000,
+       (GLfloat) 0.212500, (GLfloat) - 0.600000, (GLfloat) - 0.298061,
+       (GLfloat) 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) 0.151878, (GLfloat) - 0.600000, (GLfloat) - 0.333061,
+       (GLfloat) 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) 0.151878, (GLfloat) - 0.600000, (GLfloat) - 0.403061,
+       (GLfloat) 0.212500, (GLfloat) - 0.600000, (GLfloat) - 0.438061,
+       (GLfloat) 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.600000,
+       (GLfloat) 0.273122, (GLfloat) - 0.660000, (GLfloat) - 0.403061,
+       (GLfloat) 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) 0.273122, (GLfloat) - 0.660000, (GLfloat) - 0.333061,
+       (GLfloat) 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.660000,
+       (GLfloat) 0.212500, (GLfloat) - 0.660000, (GLfloat) - 0.298061,
+       (GLfloat) 0.151878, (GLfloat) - 0.660000, (GLfloat) - 0.333061,
+       (GLfloat) 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) 0.151878, (GLfloat) - 0.660000, (GLfloat) - 0.403061,
+       (GLfloat) 0.212500, (GLfloat) - 0.660000, (GLfloat) - 0.438061,
+       (GLfloat) 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.660000,
+       (GLfloat) 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) 0.273122, (GLfloat) - 0.460000, (GLfloat) - 0.403061,
+       (GLfloat) 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) 0.273122, (GLfloat) - 0.460000, (GLfloat) - 0.333061,
+       (GLfloat) 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.460000,
+       (GLfloat) 0.212500, (GLfloat) - 0.460000, (GLfloat) - 0.298061,
+       (GLfloat) 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) 0.151878, (GLfloat) - 0.460000, (GLfloat) - 0.333061,
+       (GLfloat) 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) 0.151878, (GLfloat) - 0.460000, (GLfloat) - 0.403061,
+       (GLfloat) 0.212500, (GLfloat) - 0.460000, (GLfloat) - 0.438061,
+       (GLfloat) 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.460000,
+       (GLfloat) 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) 0.273122, (GLfloat) - 0.520000, (GLfloat) - 0.403061,
+       (GLfloat) 0.273122, (GLfloat) - 0.520000, (GLfloat) - 0.333061,
+       (GLfloat) 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.520000,
+       (GLfloat) 0.212500, (GLfloat) - 0.520000, (GLfloat) - 0.298061,
+       (GLfloat) 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) 0.151878, (GLfloat) - 0.520000, (GLfloat) - 0.333061,
+       (GLfloat) 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) 0.151878, (GLfloat) - 0.520000, (GLfloat) - 0.403061,
+       (GLfloat) 0.212500, (GLfloat) - 0.520000, (GLfloat) - 0.438061,
+       (GLfloat) 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.520000,
+       (GLfloat) 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) 0.485622, (GLfloat) - 0.460000, (GLfloat) 0.035000,
+       (GLfloat) 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.460000,
+       (GLfloat) 0.425000, (GLfloat) - 0.460000, (GLfloat) 0.070000,
+       (GLfloat) 0.364378, (GLfloat) - 0.460000, (GLfloat) 0.035000,
+       (GLfloat) 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) 0.364378, (GLfloat) - 0.460000, (GLfloat) - 0.035000,
+       (GLfloat) 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.460000,
+       (GLfloat) 0.425000, (GLfloat) - 0.460000, (GLfloat) - 0.070000,
+       (GLfloat) 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) 0.485622, (GLfloat) - 0.460000, (GLfloat) - 0.035000,
+       (GLfloat) 0.485622, (GLfloat) - 0.520000, (GLfloat) 0.035000,
+       (GLfloat) 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.520000,
+       (GLfloat) 0.425000, (GLfloat) - 0.520000, (GLfloat) 0.070000,
+       (GLfloat) 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) 0.364378, (GLfloat) - 0.520000, (GLfloat) 0.035000,
+       (GLfloat) 0.364378, (GLfloat) - 0.520000, (GLfloat) - 0.035000,
+       (GLfloat) 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.520000,
+       (GLfloat) 0.425000, (GLfloat) - 0.520000, (GLfloat) - 0.070000,
+       (GLfloat) 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) 0.485622, (GLfloat) - 0.520000, (GLfloat) - 0.035000,
+       (GLfloat) 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) 0.485622, (GLfloat) - 0.600000, (GLfloat) 0.035000,
+       (GLfloat) 0.425000, (GLfloat) - 0.600000, (GLfloat) 0.070000,
+       (GLfloat) 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.600000,
+       (GLfloat) 0.364378, (GLfloat) - 0.600000, (GLfloat) 0.035000,
+       (GLfloat) 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) 0.364378, (GLfloat) - 0.600000, (GLfloat) - 0.035000,
+       (GLfloat) 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.600000,
+       (GLfloat) 0.425000, (GLfloat) - 0.600000, (GLfloat) - 0.070000,
+       (GLfloat) 0.485622, (GLfloat) - 0.600000, (GLfloat) - 0.035000,
+       (GLfloat) 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) 0.485622, (GLfloat) - 0.660000, (GLfloat) 0.035000,
+       (GLfloat) 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) 0.425000, (GLfloat) - 0.660000, (GLfloat) 0.070000,
+       (GLfloat) 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.660000,
+       (GLfloat) 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) 0.364378, (GLfloat) - 0.660000, (GLfloat) 0.035000,
+       (GLfloat) 0.364378, (GLfloat) - 0.660000, (GLfloat) - 0.035000,
+       (GLfloat) 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.660000,
+       (GLfloat) 0.425000, (GLfloat) - 0.660000, (GLfloat) - 0.070000,
+       (GLfloat) 0.485622, (GLfloat) - 0.660000, (GLfloat) - 0.035000,
+       (GLfloat) 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.460000,
+       (GLfloat) 0.212500, (GLfloat) - 0.460000, (GLfloat) 0.438061,
+       (GLfloat) 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) 0.151878, (GLfloat) - 0.460000, (GLfloat) 0.403061,
+       (GLfloat) 0.151878, (GLfloat) - 0.460000, (GLfloat) 0.333061,
+       (GLfloat) 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) 0.212500, (GLfloat) - 0.460000, (GLfloat) 0.298061,
+       (GLfloat) 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.460000,
+       (GLfloat) 0.273122, (GLfloat) - 0.460000, (GLfloat) 0.333061,
+       (GLfloat) 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) 0.273122, (GLfloat) - 0.460000, (GLfloat) 0.403061,
+       (GLfloat) 0.212500, (GLfloat) - 0.520000, (GLfloat) 0.438061,
+       (GLfloat) 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.520000,
+       (GLfloat) 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) 0.151878, (GLfloat) - 0.520000, (GLfloat) 0.403061,
+       (GLfloat) 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) 0.151878, (GLfloat) - 0.520000, (GLfloat) 0.333061,
+       (GLfloat) 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.520000,
+       (GLfloat) 0.212500, (GLfloat) - 0.520000, (GLfloat) 0.298061,
+       (GLfloat) 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) 0.273122, (GLfloat) - 0.520000, (GLfloat) 0.333061,
+       (GLfloat) 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) 0.273122, (GLfloat) - 0.520000, (GLfloat) 0.403061,
+       (GLfloat) 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.600000,
+       (GLfloat) 0.212500, (GLfloat) - 0.600000, (GLfloat) 0.438061,
+       (GLfloat) 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) 0.151878, (GLfloat) - 0.600000, (GLfloat) 0.403061,
+       (GLfloat) 0.151878, (GLfloat) - 0.600000, (GLfloat) 0.333061,
+       (GLfloat) 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.600000,
+       (GLfloat) 0.212500, (GLfloat) - 0.600000, (GLfloat) 0.298061,
+       (GLfloat) 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) 0.273122, (GLfloat) - 0.600000, (GLfloat) 0.333061,
+       (GLfloat) 0.273122, (GLfloat) - 0.600000, (GLfloat) 0.403061,
+       (GLfloat) 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) 0.212500, (GLfloat) - 0.660000, (GLfloat) 0.438061,
+       (GLfloat) 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.660000,
+       (GLfloat) 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) 0.151878, (GLfloat) - 0.660000, (GLfloat) 0.403061,
+       (GLfloat) 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) 0.151878, (GLfloat) - 0.660000, (GLfloat) 0.333061,
+       (GLfloat) 0.212500, (GLfloat) - 0.660000, (GLfloat) 0.298061,
+       (GLfloat) 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.660000,
+       (GLfloat) 0.273122, (GLfloat) - 0.660000, (GLfloat) 0.333061,
+       (GLfloat) 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) 0.273122, (GLfloat) - 0.660000, (GLfloat) 0.403061,
+       (GLfloat) 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.460000, (GLfloat) 0.403061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.460000, (GLfloat) 0.333061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.460000, (GLfloat) 0.298061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.460000, (GLfloat) 0.333061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.460000, (GLfloat) 0.403061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.460000, (GLfloat) 0.438061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.520000, (GLfloat) 0.403061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.520000, (GLfloat) 0.333061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.520000, (GLfloat) 0.298061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.520000, (GLfloat) 0.333061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.520000, (GLfloat) 0.403061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.520000, (GLfloat) 0.438061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.600000, (GLfloat) 0.403061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.600000, (GLfloat) 0.333061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.600000, (GLfloat) 0.298061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.600000, (GLfloat) 0.333061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.600000, (GLfloat) 0.403061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.600000, (GLfloat) 0.438061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.660000, (GLfloat) 0.403061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.660000, (GLfloat) 0.333061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.298061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.660000, (GLfloat) 0.298061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.660000, (GLfloat) 0.333061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.660000, (GLfloat) 0.403061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.438061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.660000, (GLfloat) 0.438061,
+       (GLfloat) - 0.485622, (GLfloat) - 0.460000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) - 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.460000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.460000, (GLfloat) - 0.070000,
+       (GLfloat) - 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.460000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.460000, (GLfloat) 0.035000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.460000, (GLfloat) 0.070000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.460000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.460000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.460000, (GLfloat) 0.035000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.520000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.520000, (GLfloat) - 0.070000,
+       (GLfloat) - 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.520000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.520000, (GLfloat) 0.035000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.520000, (GLfloat) 0.070000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.520000, (GLfloat) 0.035000,
+       (GLfloat) - 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.600000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.600000, (GLfloat) - 0.070000,
+       (GLfloat) - 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.600000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.600000, (GLfloat) 0.035000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.600000, (GLfloat) 0.070000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.600000, (GLfloat) 0.035000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.660000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.485622, (GLfloat) 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.660000, (GLfloat) - 0.070000,
+       (GLfloat) - 0.425000, (GLfloat) 0.070000, (GLfloat) - 0.660000,
+       (GLfloat) - 0.364378, (GLfloat) 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.660000, (GLfloat) - 0.035000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.660000, (GLfloat) 0.035000,
+       (GLfloat) - 0.364378, (GLfloat) - 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.070000, (GLfloat) - 0.660000,
+       (GLfloat) - 0.425000, (GLfloat) - 0.660000, (GLfloat) 0.070000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.660000, (GLfloat) 0.035000,
+       (GLfloat) - 0.485622, (GLfloat) - 0.035000, (GLfloat) - 0.660000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.460000, (GLfloat) - 0.438061,
+       (GLfloat) - 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.460000, (GLfloat) - 0.403061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.460000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.460000, (GLfloat) - 0.298061,
+       (GLfloat) - 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.460000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.273122, (GLfloat) - 0.460000, (GLfloat) - 0.403061,
+       (GLfloat) - 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.460000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.520000, (GLfloat) - 0.438061,
+       (GLfloat) - 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.520000, (GLfloat) - 0.403061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.520000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.520000, (GLfloat) - 0.298061,
+       (GLfloat) - 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.520000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.520000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.520000, (GLfloat) - 0.403061,
+       (GLfloat) - 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.600000, (GLfloat) - 0.438061,
+       (GLfloat) - 0.151878, (GLfloat) - 0.600000, (GLfloat) - 0.403061,
+       (GLfloat) - 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.600000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.212500, (GLfloat) - 0.600000, (GLfloat) - 0.298061,
+       (GLfloat) - 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.600000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.600000, (GLfloat) - 0.403061,
+       (GLfloat) - 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.600000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.660000, (GLfloat) - 0.438061,
+       (GLfloat) - 0.212500, (GLfloat) 0.438061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.660000, (GLfloat) - 0.403061,
+       (GLfloat) - 0.151878, (GLfloat) 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.151878, (GLfloat) - 0.660000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.151878, (GLfloat) 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.212500, (GLfloat) - 0.660000, (GLfloat) - 0.298061,
+       (GLfloat) - 0.212500, (GLfloat) 0.298061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.660000, (GLfloat) - 0.333061,
+       (GLfloat) - 0.273122, (GLfloat) 0.333061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.273122, (GLfloat) 0.403061, (GLfloat) - 0.660000,
+       (GLfloat) - 0.273122, (GLfloat) - 0.660000, (GLfloat) - 0.403061,
+};
+
+static GLfloat ElbowBolts_normals[] =
+{
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866026, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.499999, (GLfloat) 0.866026, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) - 0.499999, (GLfloat) - 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) - 0.866026, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.866025, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.866025, (GLfloat) 0.000000,
+       (GLfloat) 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866026,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.499999, (GLfloat) 0.000000, (GLfloat) - 0.866026,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866026,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866026,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866026,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866026,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.499999, (GLfloat) 0.000000, (GLfloat) 0.866026,
+       (GLfloat) - 1.000000, (GLfloat) - 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866026,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866026,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) 0.000000,
+       (GLfloat) 1.000000, (GLfloat) 0.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866026,
+       (GLfloat) - 0.500000, (GLfloat) 0.000000, (GLfloat) 0.866025,
+       (GLfloat) - 1.000000, (GLfloat) 0.000000, (GLfloat) 0.000000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.866025,
+       (GLfloat) 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+};
+
+static unsigned short int ElbowBolts_POLS[] =
+{
+       6, 241, 242, 245, 246, 248, 251, 1, 4, 253, 254, 242, 241, 1, 4, 254, 257, 245, 242, 1,
+       4, 257, 258, 246, 245, 1, 4, 258, 260, 248, 246, 1, 4, 260, 262, 251, 248, 1, 4, 262,
+       253, 241, 251, 1, 6, 253, 262, 260, 258, 257, 254, 1, 6, 264, 267, 268, 271, 273, 275, 1,
+       4, 277, 279, 267, 264, 1, 4, 279, 281, 268, 267, 1, 4, 281, 283, 271, 268, 1, 4, 283,
+       285, 273, 271, 1, 4, 285, 286, 275, 273, 1, 4, 286, 277, 264, 275, 1, 6, 277, 286, 285,
+       283, 281, 279, 1, 6, 193, 194, 196, 199, 201, 202, 1, 4, 205, 206, 194, 193, 1, 4, 206,
+       208, 196, 194, 1, 4, 208, 210, 199, 196, 1, 4, 210, 213, 201, 199, 1, 4, 213, 214, 202,
+       201, 1, 4, 214, 205, 193, 202, 1, 6, 205, 214, 213, 210, 208, 206, 1, 6, 216, 219, 221,
+       223, 225, 227, 1, 4, 229, 231, 219, 216, 1, 4, 231, 232, 221, 219, 1, 4, 232, 235, 223,
+       221, 1, 4, 235, 236, 225, 223, 1, 4, 236, 239, 227, 225, 1, 4, 239, 229, 216, 227, 1,
+       6, 229, 239, 236, 235, 232, 231, 1, 6, 145, 147, 148, 150, 152, 155, 1, 4, 157, 158, 147,
+       145, 1, 4, 158, 161, 148, 147, 1, 4, 161, 162, 150, 148, 1, 4, 162, 165, 152, 150, 1,
+       4, 165, 167, 155, 152, 1, 4, 167, 157, 145, 155, 1, 6, 157, 167, 165, 162, 161, 158, 1,
+       6, 169, 171, 173, 174, 177, 178, 1, 4, 181, 182, 171, 169, 1, 4, 182, 184, 173, 171, 1,
+       4, 184, 187, 174, 173, 1, 4, 187, 189, 177, 174, 1, 4, 189, 190, 178, 177, 1, 4, 190,
+       181, 169, 178, 1, 6, 181, 190, 189, 187, 184, 182, 1, 6, 96, 98, 101, 103, 105, 106, 1,
+       4, 109, 110, 98, 96, 1, 4, 110, 112, 101, 98, 1, 4, 112, 114, 103, 101, 1, 4, 114,
+       116, 105, 103, 1, 4, 116, 118, 106, 105, 1, 4, 118, 109, 96, 106, 1, 6, 109, 118, 116,
+       114, 112, 110, 1, 6, 120, 122, 125, 126, 128, 131, 1, 4, 133, 134, 122, 120, 1, 4, 134,
+       136, 125, 122, 1, 4, 136, 139, 126, 125, 1, 4, 139, 141, 128, 126, 1, 4, 141, 143, 131,
+       128, 1, 4, 143, 133, 120, 131, 1, 6, 133, 143, 141, 139, 136, 134, 1, 6, 48, 50, 53,
+    54, 56, 58, 1, 4, 61, 62, 50, 48, 1, 4, 62, 64, 53, 50, 1, 4, 64, 67, 54,
+     53, 1, 4, 67, 68, 56, 54, 1, 4, 68, 70, 58, 56, 1, 4, 70, 61, 48, 58, 1,
+   6, 61, 70, 68, 67, 64, 62, 1, 6, 72, 75, 77, 78, 80, 83, 1, 4, 85, 87, 75,
+     72, 1, 4, 87, 88, 77, 75, 1, 4, 88, 91, 78, 77, 1, 4, 91, 92, 80, 78, 1,
+    4, 92, 95, 83, 80, 1, 4, 95, 85, 72, 83, 1, 6, 85, 95, 92, 91, 88, 87, 1,
+    6, 24, 26, 28, 30, 32, 35, 1, 4, 36, 39, 26, 24, 1, 4, 39, 40, 28, 26, 1,
+     4, 40, 42, 30, 28, 1, 4, 42, 44, 32, 30, 1, 4, 44, 47, 35, 32, 1, 4, 47,
+       36, 24, 35, 1, 6, 36, 47, 44, 42, 40, 39, 1, 6, 1, 2, 4, 6, 8, 11, 1,
+       4, 13, 15, 2, 1, 1, 4, 15, 16, 4, 2, 1, 4, 16, 19, 6, 4, 1, 4, 19,
+       20, 8, 6, 1, 4, 20, 23, 11, 8, 1, 4, 23, 13, 1, 11, 1, 6, 13, 23, 20,
+       19, 16, 15, 1, 6, 240, 243, 244, 247, 249, 250, 1, 4, 252, 255, 243, 240, 1, 4, 255,
+       256, 244, 243, 1, 4, 256, 259, 247, 244, 1, 4, 259, 261, 249, 247, 1, 4, 261, 263, 250,
+       249, 1, 4, 263, 252, 240, 250, 1, 6, 252, 263, 261, 259, 256, 255, 1, 6, 265, 266, 269,
+       270, 272, 274, 1, 4, 276, 278, 266, 265, 1, 4, 278, 280, 269, 266, 1, 4, 280, 282, 270,
+       269, 1, 4, 282, 284, 272, 270, 1, 4, 284, 287, 274, 272, 1, 4, 287, 276, 265, 274, 1,
+       6, 276, 287, 284, 282, 280, 278, 1, 6, 192, 195, 197, 198, 200, 203, 1, 4, 204, 207, 195,
+       192, 1, 4, 207, 209, 197, 195, 1, 4, 209, 211, 198, 197, 1, 4, 211, 212, 200, 198, 1,
+       4, 212, 215, 203, 200, 1, 4, 215, 204, 192, 203, 1, 6, 204, 215, 212, 211, 209, 207, 1,
+       6, 217, 218, 220, 222, 224, 226, 1, 4, 228, 230, 218, 217, 1, 4, 230, 233, 220, 218, 1,
+       4, 233, 234, 222, 220, 1, 4, 234, 237, 224, 222, 1, 4, 237, 238, 226, 224, 1, 4, 238,
+       228, 217, 226, 1, 6, 228, 238, 237, 234, 233, 230, 1, 6, 144, 146, 149, 151, 153, 154, 1,
+       4, 156, 159, 146, 144, 1, 4, 159, 160, 149, 146, 1, 4, 160, 163, 151, 149, 1, 4, 163,
+       164, 153, 151, 1, 4, 164, 166, 154, 153, 1, 4, 166, 156, 144, 154, 1, 6, 156, 166, 164,
+       163, 160, 159, 1, 6, 168, 170, 172, 175, 176, 179, 1, 4, 180, 183, 170, 168, 1, 4, 183,
+       185, 172, 170, 1, 4, 185, 186, 175, 172, 1, 4, 186, 188, 176, 175, 1, 4, 188, 191, 179,
+       176, 1, 4, 191, 180, 168, 179, 1, 6, 180, 191, 188, 186, 185, 183, 1, 6, 97, 99, 100,
+       102, 104, 107, 1, 4, 108, 111, 99, 97, 1, 4, 111, 113, 100, 99, 1, 4, 113, 115, 102,
+       100, 1, 4, 115, 117, 104, 102, 1, 4, 117, 119, 107, 104, 1, 4, 119, 108, 97, 107, 1,
+       6, 108, 119, 117, 115, 113, 111, 1, 6, 121, 123, 124, 127, 129, 130, 1, 4, 132, 135, 123,
+       121, 1, 4, 135, 137, 124, 123, 1, 4, 137, 138, 127, 124, 1, 4, 138, 140, 129, 127, 1,
+       4, 140, 142, 130, 129, 1, 4, 142, 132, 121, 130, 1, 6, 132, 142, 140, 138, 137, 135, 1,
+    6, 49, 51, 52, 55, 57, 59, 1, 4, 60, 63, 51, 49, 1, 4, 63, 65, 52, 51, 1,
+     4, 65, 66, 55, 52, 1, 4, 66, 69, 57, 55, 1, 4, 69, 71, 59, 57, 1, 4, 71,
+   60, 49, 59, 1, 6, 60, 71, 69, 66, 65, 63, 1, 6, 73, 74, 76, 79, 81, 82, 1,
+     4, 84, 86, 74, 73, 1, 4, 86, 89, 76, 74, 1, 4, 89, 90, 79, 76, 1, 4, 90,
+    93, 81, 79, 1, 4, 93, 94, 82, 81, 1, 4, 94, 84, 73, 82, 1, 6, 84, 94, 93,
+    90, 89, 86, 1, 6, 25, 27, 29, 31, 33, 34, 1, 4, 37, 38, 27, 25, 1, 4, 38,
+    41, 29, 27, 1, 4, 41, 43, 31, 29, 1, 4, 43, 45, 33, 31, 1, 4, 45, 46, 34,
+       33, 1, 4, 46, 37, 25, 34, 1, 6, 37, 46, 45, 43, 41, 38, 1, 6, 0, 3, 5,
+       7, 9, 10, 1, 4, 12, 14, 3, 0, 1, 4, 14, 17, 5, 3, 1, 4, 17, 18, 7,
+       5, 1, 4, 18, 21, 9, 7, 1, 4, 21, 22, 10, 9, 1, 4, 22, 12, 0, 10, 1,
+       6, 12, 22, 21, 18, 17, 14, 1,
+       0
+};
+
+struct lwo  LWO_ElbowBolts =
+{
+       288,                    /* number of points */
+       ElbowBolts_PNTS, ElbowBolts_normals, ElbowBolts_POLS, 0L
+};
+
+static GLfloat ElbowCoins_PNTS[] =
+{
+       (GLfloat) 0.000000, (GLfloat) - 0.520000, (GLfloat) - 0.500000,
+       (GLfloat) 0.097545, (GLfloat) - 0.520000, (GLfloat) - 0.490393,
+       (GLfloat) 0.191342, (GLfloat) - 0.520000, (GLfloat) - 0.461940,
+       (GLfloat) 0.277785, (GLfloat) - 0.520000, (GLfloat) - 0.415735,
+       (GLfloat) 0.353553, (GLfloat) - 0.520000, (GLfloat) - 0.353553,
+       (GLfloat) 0.415735, (GLfloat) - 0.520000, (GLfloat) - 0.277785,
+       (GLfloat) 0.461940, (GLfloat) - 0.520000, (GLfloat) - 0.191342,
+       (GLfloat) 0.490393, (GLfloat) - 0.520000, (GLfloat) - 0.097545,
+       (GLfloat) 0.500000, (GLfloat) - 0.520000, (GLfloat) - 0.000000,
+       (GLfloat) 0.490393, (GLfloat) - 0.520000, (GLfloat) 0.097545,
+       (GLfloat) 0.461940, (GLfloat) - 0.520000, (GLfloat) 0.191342,
+       (GLfloat) 0.415735, (GLfloat) - 0.520000, (GLfloat) 0.277785,
+       (GLfloat) 0.353553, (GLfloat) - 0.520000, (GLfloat) 0.353553,
+       (GLfloat) 0.277785, (GLfloat) - 0.520000, (GLfloat) 0.415735,
+       (GLfloat) 0.191342, (GLfloat) - 0.520000, (GLfloat) 0.461940,
+       (GLfloat) 0.097545, (GLfloat) - 0.520000, (GLfloat) 0.490393,
+       (GLfloat) 0.000000, (GLfloat) - 0.520000, (GLfloat) 0.500000,
+       (GLfloat) - 0.097545, (GLfloat) - 0.520000, (GLfloat) 0.490393,
+       (GLfloat) - 0.191342, (GLfloat) - 0.520000, (GLfloat) 0.461940,
+       (GLfloat) - 0.277785, (GLfloat) - 0.520000, (GLfloat) 0.415735,
+       (GLfloat) - 0.353553, (GLfloat) - 0.520000, (GLfloat) 0.353553,
+       (GLfloat) - 0.415735, (GLfloat) - 0.520000, (GLfloat) 0.277785,
+       (GLfloat) - 0.461940, (GLfloat) - 0.520000, (GLfloat) 0.191342,
+       (GLfloat) - 0.490393, (GLfloat) - 0.520000, (GLfloat) 0.097545,
+       (GLfloat) - 0.500000, (GLfloat) - 0.520000, (GLfloat) 0.000000,
+       (GLfloat) - 0.490393, (GLfloat) - 0.520000, (GLfloat) - 0.097545,
+       (GLfloat) - 0.461940, (GLfloat) - 0.520000, (GLfloat) - 0.191342,
+       (GLfloat) - 0.415735, (GLfloat) - 0.520000, (GLfloat) - 0.277785,
+       (GLfloat) - 0.353553, (GLfloat) - 0.520000, (GLfloat) - 0.353553,
+       (GLfloat) - 0.277785, (GLfloat) - 0.520000, (GLfloat) - 0.415735,
+       (GLfloat) - 0.191342, (GLfloat) - 0.520000, (GLfloat) - 0.461940,
+       (GLfloat) - 0.097545, (GLfloat) - 0.520000, (GLfloat) - 0.490393,
+       (GLfloat) 0.000000, (GLfloat) - 0.600000, (GLfloat) - 0.500000,
+       (GLfloat) 0.097545, (GLfloat) - 0.600000, (GLfloat) - 0.490393,
+       (GLfloat) 0.191342, (GLfloat) - 0.600000, (GLfloat) - 0.461940,
+       (GLfloat) 0.277785, (GLfloat) - 0.600000, (GLfloat) - 0.415735,
+       (GLfloat) 0.353553, (GLfloat) - 0.600000, (GLfloat) - 0.353553,
+       (GLfloat) 0.415735, (GLfloat) - 0.600000, (GLfloat) - 0.277785,
+       (GLfloat) 0.461940, (GLfloat) - 0.600000, (GLfloat) - 0.191342,
+       (GLfloat) 0.490393, (GLfloat) - 0.600000, (GLfloat) - 0.097545,
+       (GLfloat) 0.500000, (GLfloat) - 0.600000, (GLfloat) - 0.000000,
+       (GLfloat) 0.490393, (GLfloat) - 0.600000, (GLfloat) 0.097545,
+       (GLfloat) 0.461940, (GLfloat) - 0.600000, (GLfloat) 0.191342,
+       (GLfloat) 0.415735, (GLfloat) - 0.600000, (GLfloat) 0.277785,
+       (GLfloat) 0.353553, (GLfloat) - 0.600000, (GLfloat) 0.353553,
+       (GLfloat) 0.277785, (GLfloat) - 0.600000, (GLfloat) 0.415735,
+       (GLfloat) 0.191342, (GLfloat) - 0.600000, (GLfloat) 0.461940,
+       (GLfloat) 0.097545, (GLfloat) - 0.600000, (GLfloat) 0.490393,
+       (GLfloat) 0.000000, (GLfloat) - 0.600000, (GLfloat) 0.500000,
+       (GLfloat) - 0.097545, (GLfloat) - 0.600000, (GLfloat) 0.490393,
+       (GLfloat) - 0.191342, (GLfloat) - 0.600000, (GLfloat) 0.461940,
+       (GLfloat) - 0.277785, (GLfloat) - 0.600000, (GLfloat) 0.415735,
+       (GLfloat) - 0.353553, (GLfloat) - 0.600000, (GLfloat) 0.353553,
+       (GLfloat) - 0.415735, (GLfloat) - 0.600000, (GLfloat) 0.277785,
+       (GLfloat) - 0.461940, (GLfloat) - 0.600000, (GLfloat) 0.191342,
+       (GLfloat) - 0.490393, (GLfloat) - 0.600000, (GLfloat) 0.097545,
+       (GLfloat) - 0.500000, (GLfloat) - 0.600000, (GLfloat) 0.000000,
+       (GLfloat) - 0.490393, (GLfloat) - 0.600000, (GLfloat) - 0.097545,
+       (GLfloat) - 0.461940, (GLfloat) - 0.600000, (GLfloat) - 0.191342,
+       (GLfloat) - 0.415735, (GLfloat) - 0.600000, (GLfloat) - 0.277785,
+       (GLfloat) - 0.353553, (GLfloat) - 0.600000, (GLfloat) - 0.353553,
+       (GLfloat) - 0.277785, (GLfloat) - 0.600000, (GLfloat) - 0.415735,
+       (GLfloat) - 0.191342, (GLfloat) - 0.600000, (GLfloat) - 0.461940,
+       (GLfloat) - 0.097545, (GLfloat) - 0.600000, (GLfloat) - 0.490393,
+       (GLfloat) 0.000000, (GLfloat) 0.500000, (GLfloat) - 0.520000,
+       (GLfloat) 0.097545, (GLfloat) 0.490393, (GLfloat) - 0.520000,
+       (GLfloat) 0.191342, (GLfloat) 0.461940, (GLfloat) - 0.520000,
+       (GLfloat) 0.277785, (GLfloat) 0.415735, (GLfloat) - 0.520000,
+       (GLfloat) 0.353553, (GLfloat) 0.353553, (GLfloat) - 0.520000,
+       (GLfloat) 0.415735, (GLfloat) 0.277785, (GLfloat) - 0.520000,
+       (GLfloat) 0.461940, (GLfloat) 0.191342, (GLfloat) - 0.520000,
+       (GLfloat) 0.490393, (GLfloat) 0.097545, (GLfloat) - 0.520000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.520000,
+       (GLfloat) 0.490393, (GLfloat) - 0.097545, (GLfloat) - 0.520000,
+       (GLfloat) 0.461940, (GLfloat) - 0.191342, (GLfloat) - 0.520000,
+       (GLfloat) 0.415735, (GLfloat) - 0.277785, (GLfloat) - 0.520000,
+       (GLfloat) 0.353553, (GLfloat) - 0.353553, (GLfloat) - 0.520000,
+       (GLfloat) 0.277785, (GLfloat) - 0.415735, (GLfloat) - 0.520000,
+       (GLfloat) 0.191342, (GLfloat) - 0.461940, (GLfloat) - 0.520000,
+       (GLfloat) 0.097545, (GLfloat) - 0.490393, (GLfloat) - 0.520000,
+       (GLfloat) 0.000000, (GLfloat) - 0.500000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.097545, (GLfloat) - 0.490393, (GLfloat) - 0.520000,
+       (GLfloat) - 0.191342, (GLfloat) - 0.461940, (GLfloat) - 0.520000,
+       (GLfloat) - 0.277785, (GLfloat) - 0.415735, (GLfloat) - 0.520000,
+       (GLfloat) - 0.353553, (GLfloat) - 0.353553, (GLfloat) - 0.520000,
+       (GLfloat) - 0.415735, (GLfloat) - 0.277785, (GLfloat) - 0.520000,
+       (GLfloat) - 0.461940, (GLfloat) - 0.191342, (GLfloat) - 0.520000,
+       (GLfloat) - 0.490393, (GLfloat) - 0.097545, (GLfloat) - 0.520000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.520000,
+       (GLfloat) - 0.490393, (GLfloat) 0.097545, (GLfloat) - 0.520000,
+       (GLfloat) - 0.461940, (GLfloat) 0.191342, (GLfloat) - 0.520000,
+       (GLfloat) - 0.415735, (GLfloat) 0.277785, (GLfloat) - 0.520000,
+       (GLfloat) - 0.353553, (GLfloat) 0.353553, (GLfloat) - 0.520000,
+       (GLfloat) - 0.277785, (GLfloat) 0.415735, (GLfloat) - 0.520000,
+       (GLfloat) - 0.191342, (GLfloat) 0.461940, (GLfloat) - 0.520000,
+       (GLfloat) - 0.097545, (GLfloat) 0.490393, (GLfloat) - 0.520000,
+       (GLfloat) 0.000000, (GLfloat) 0.500000, (GLfloat) - 0.600000,
+       (GLfloat) 0.097545, (GLfloat) 0.490393, (GLfloat) - 0.600000,
+       (GLfloat) 0.191342, (GLfloat) 0.461940, (GLfloat) - 0.600000,
+       (GLfloat) 0.277785, (GLfloat) 0.415735, (GLfloat) - 0.600000,
+       (GLfloat) 0.353553, (GLfloat) 0.353553, (GLfloat) - 0.600000,
+       (GLfloat) 0.415735, (GLfloat) 0.277785, (GLfloat) - 0.600000,
+       (GLfloat) 0.461940, (GLfloat) 0.191342, (GLfloat) - 0.600000,
+       (GLfloat) 0.490393, (GLfloat) 0.097545, (GLfloat) - 0.600000,
+       (GLfloat) 0.500000, (GLfloat) 0.000000, (GLfloat) - 0.600000,
+       (GLfloat) 0.490393, (GLfloat) - 0.097545, (GLfloat) - 0.600000,
+       (GLfloat) 0.461940, (GLfloat) - 0.191342, (GLfloat) - 0.600000,
+       (GLfloat) 0.415735, (GLfloat) - 0.277785, (GLfloat) - 0.600000,
+       (GLfloat) 0.353553, (GLfloat) - 0.353553, (GLfloat) - 0.600000,
+       (GLfloat) 0.277785, (GLfloat) - 0.415735, (GLfloat) - 0.600000,
+       (GLfloat) 0.191342, (GLfloat) - 0.461940, (GLfloat) - 0.600000,
+       (GLfloat) 0.097545, (GLfloat) - 0.490393, (GLfloat) - 0.600000,
+       (GLfloat) 0.000000, (GLfloat) - 0.500000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.097545, (GLfloat) - 0.490393, (GLfloat) - 0.600000,
+       (GLfloat) - 0.191342, (GLfloat) - 0.461940, (GLfloat) - 0.600000,
+       (GLfloat) - 0.277785, (GLfloat) - 0.415735, (GLfloat) - 0.600000,
+       (GLfloat) - 0.353553, (GLfloat) - 0.353553, (GLfloat) - 0.600000,
+       (GLfloat) - 0.415735, (GLfloat) - 0.277785, (GLfloat) - 0.600000,
+       (GLfloat) - 0.461940, (GLfloat) - 0.191342, (GLfloat) - 0.600000,
+       (GLfloat) - 0.490393, (GLfloat) - 0.097545, (GLfloat) - 0.600000,
+       (GLfloat) - 0.500000, (GLfloat) - 0.000000, (GLfloat) - 0.600000,
+       (GLfloat) - 0.490393, (GLfloat) 0.097545, (GLfloat) - 0.600000,
+       (GLfloat) - 0.461940, (GLfloat) 0.191342, (GLfloat) - 0.600000,
+       (GLfloat) - 0.415735, (GLfloat) 0.277785, (GLfloat) - 0.600000,
+       (GLfloat) - 0.353553, (GLfloat) 0.353553, (GLfloat) - 0.600000,
+       (GLfloat) - 0.277785, (GLfloat) 0.415735, (GLfloat) - 0.600000,
+       (GLfloat) - 0.191342, (GLfloat) 0.461940, (GLfloat) - 0.600000,
+       (GLfloat) - 0.097545, (GLfloat) 0.490393, (GLfloat) - 0.600000,
+};
+
+static GLfloat ElbowCoins_normals[] =
+{
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) 1.000000,
+       (GLfloat) 0.098017, (GLfloat) 0.995185, (GLfloat) 0.000000,
+       (GLfloat) 0.290285, (GLfloat) 0.956940, (GLfloat) 0.000000,
+       (GLfloat) 0.471397, (GLfloat) 0.881921, (GLfloat) 0.000000,
+       (GLfloat) 0.634393, (GLfloat) 0.773010, (GLfloat) 0.000000,
+       (GLfloat) 0.773010, (GLfloat) 0.634393, (GLfloat) 0.000000,
+       (GLfloat) 0.881921, (GLfloat) 0.471397, (GLfloat) 0.000000,
+       (GLfloat) 0.956940, (GLfloat) 0.290285, (GLfloat) 0.000000,
+       (GLfloat) 0.995185, (GLfloat) 0.098017, (GLfloat) 0.000000,
+       (GLfloat) 0.995185, (GLfloat) - 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) 0.956940, (GLfloat) - 0.290285, (GLfloat) - 0.000000,
+       (GLfloat) 0.881921, (GLfloat) - 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) 0.773010, (GLfloat) - 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) 0.634393, (GLfloat) - 0.773010, (GLfloat) - 0.000000,
+       (GLfloat) 0.471397, (GLfloat) - 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) 0.290285, (GLfloat) - 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) 0.098017, (GLfloat) - 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) - 0.098017, (GLfloat) - 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) - 0.290285, (GLfloat) - 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) - 0.471397, (GLfloat) - 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) - 0.634393, (GLfloat) - 0.773010, (GLfloat) - 0.000000,
+       (GLfloat) - 0.773010, (GLfloat) - 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) - 0.881921, (GLfloat) - 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) - 0.956940, (GLfloat) - 0.290285, (GLfloat) - 0.000000,
+       (GLfloat) - 0.995185, (GLfloat) - 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) - 0.995185, (GLfloat) 0.098017, (GLfloat) - 0.000000,
+       (GLfloat) - 0.956940, (GLfloat) 0.290285, (GLfloat) - 0.000000,
+       (GLfloat) - 0.881921, (GLfloat) 0.471397, (GLfloat) - 0.000000,
+       (GLfloat) - 0.773010, (GLfloat) 0.634393, (GLfloat) - 0.000000,
+       (GLfloat) - 0.634393, (GLfloat) 0.773010, (GLfloat) - 0.000000,
+       (GLfloat) - 0.471397, (GLfloat) 0.881921, (GLfloat) - 0.000000,
+       (GLfloat) - 0.290285, (GLfloat) 0.956940, (GLfloat) - 0.000000,
+       (GLfloat) - 0.098017, (GLfloat) 0.995185, (GLfloat) - 0.000000,
+       (GLfloat) - 0.000000, (GLfloat) 0.000000, (GLfloat) - 1.000000,
+       (GLfloat) - 0.000000, (GLfloat) 1.000000, (GLfloat) - 0.000000,
+       (GLfloat) 0.098017, (GLfloat) 0.000000, (GLfloat) - 0.995185,
+       (GLfloat) 0.290285, (GLfloat) 0.000000, (GLfloat) - 0.956940,
+       (GLfloat) 0.471397, (GLfloat) 0.000000, (GLfloat) - 0.881921,
+       (GLfloat) 0.634393, (GLfloat) 0.000000, (GLfloat) - 0.773010,
+       (GLfloat) 0.773010, (GLfloat) 0.000000, (GLfloat) - 0.634393,
+       (GLfloat) 0.881921, (GLfloat) 0.000000, (GLfloat) - 0.471397,
+       (GLfloat) 0.956940, (GLfloat) 0.000000, (GLfloat) - 0.290285,
+       (GLfloat) 0.995185, (GLfloat) 0.000000, (GLfloat) - 0.098017,
+       (GLfloat) 0.995185, (GLfloat) 0.000000, (GLfloat) 0.098017,
+       (GLfloat) 0.956940, (GLfloat) 0.000000, (GLfloat) 0.290285,
+       (GLfloat) 0.881921, (GLfloat) 0.000000, (GLfloat) 0.471397,
+       (GLfloat) 0.773010, (GLfloat) 0.000000, (GLfloat) 0.634393,
+       (GLfloat) 0.634393, (GLfloat) 0.000000, (GLfloat) 0.773010,
+       (GLfloat) 0.471397, (GLfloat) 0.000000, (GLfloat) 0.881921,
+       (GLfloat) 0.290285, (GLfloat) 0.000000, (GLfloat) 0.956940,
+       (GLfloat) 0.098017, (GLfloat) 0.000000, (GLfloat) 0.995185,
+       (GLfloat) - 0.098017, (GLfloat) 0.000000, (GLfloat) 0.995185,
+       (GLfloat) - 0.290285, (GLfloat) 0.000000, (GLfloat) 0.956940,
+       (GLfloat) - 0.471397, (GLfloat) 0.000000, (GLfloat) 0.881921,
+       (GLfloat) - 0.634393, (GLfloat) 0.000000, (GLfloat) 0.773010,
+       (GLfloat) - 0.773010, (GLfloat) 0.000000, (GLfloat) 0.634393,
+       (GLfloat) - 0.881921, (GLfloat) 0.000000, (GLfloat) 0.471397,
+       (GLfloat) - 0.956940, (GLfloat) 0.000000, (GLfloat) 0.290285,
+       (GLfloat) - 0.995185, (GLfloat) - 0.000000, (GLfloat) 0.098017,
+       (GLfloat) - 0.995185, (GLfloat) - 0.000000, (GLfloat) - 0.098017,
+       (GLfloat) - 0.956940, (GLfloat) - 0.000000, (GLfloat) - 0.290285,
+       (GLfloat) - 0.881921, (GLfloat) - 0.000000, (GLfloat) - 0.471397,
+       (GLfloat) - 0.773010, (GLfloat) - 0.000000, (GLfloat) - 0.634393,
+       (GLfloat) - 0.634393, (GLfloat) - 0.000000, (GLfloat) - 0.773010,
+       (GLfloat) - 0.471397, (GLfloat) - 0.000000, (GLfloat) - 0.881921,
+       (GLfloat) - 0.290285, (GLfloat) - 0.000000, (GLfloat) - 0.956940,
+       (GLfloat) - 0.098017, (GLfloat) - 0.000000, (GLfloat) - 0.995185,
+       (GLfloat) - 0.000000, (GLfloat) - 1.000000, (GLfloat) - 0.000000,
+};
+
+static unsigned short int ElbowCoins_POLS[] =
+{
+       32, 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, 1, 4, 96, 97, 65, 64, 1,
+   4, 97, 98, 66, 65, 1, 4, 98, 99, 67, 66, 1, 4, 99, 100, 68, 67, 1, 4, 100,
+       101, 69, 68, 1, 4, 101, 102, 70, 69, 1, 4, 102, 103, 71, 70, 1, 4, 103, 104, 72,
+71, 1, 4, 104, 105, 73, 72, 1, 4, 105, 106, 74, 73, 1, 4, 106, 107, 75, 74, 1,
+       4, 107, 108, 76, 75, 1, 4, 108, 109, 77, 76, 1, 4, 109, 110, 78, 77, 1, 4, 110,
+       111, 79, 78, 1, 4, 111, 112, 80, 79, 1, 4, 112, 113, 81, 80, 1, 4, 113, 114, 82,
+81, 1, 4, 114, 115, 83, 82, 1, 4, 115, 116, 84, 83, 1, 4, 116, 117, 85, 84, 1,
+       4, 117, 118, 86, 85, 1, 4, 118, 119, 87, 86, 1, 4, 119, 120, 88, 87, 1, 4, 120,
+       121, 89, 88, 1, 4, 121, 122, 90, 89, 1, 4, 122, 123, 91, 90, 1, 4, 123, 124, 92,
+91, 1, 4, 124, 125, 93, 92, 1, 4, 125, 126, 94, 93, 1, 4, 126, 127, 95, 94, 1,
+       4, 127, 96, 64, 95, 1, 32, 96, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116,
+       115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 1,
+       32, 0, 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, 1, 4, 32, 33, 1, 0, 1,
+       4, 33, 34, 2, 1, 1, 4, 34, 35, 3, 2, 1, 4, 35, 36, 4, 3, 1, 4, 36,
+       37, 5, 4, 1, 4, 37, 38, 6, 5, 1, 4, 38, 39, 7, 6, 1, 4, 39, 40, 8,
+       7, 1, 4, 40, 41, 9, 8, 1, 4, 41, 42, 10, 9, 1, 4, 42, 43, 11, 10, 1,
+     4, 43, 44, 12, 11, 1, 4, 44, 45, 13, 12, 1, 4, 45, 46, 14, 13, 1, 4, 46,
+    47, 15, 14, 1, 4, 47, 48, 16, 15, 1, 4, 48, 49, 17, 16, 1, 4, 49, 50, 18,
+     17, 1, 4, 50, 51, 19, 18, 1, 4, 51, 52, 20, 19, 1, 4, 52, 53, 21, 20, 1,
+     4, 53, 54, 22, 21, 1, 4, 54, 55, 23, 22, 1, 4, 55, 56, 24, 23, 1, 4, 56,
+    57, 25, 24, 1, 4, 57, 58, 26, 25, 1, 4, 58, 59, 27, 26, 1, 4, 59, 60, 28,
+     27, 1, 4, 60, 61, 29, 28, 1, 4, 61, 62, 30, 29, 1, 4, 62, 63, 31, 30, 1,
+ 4, 63, 32, 0, 31, 1, 32, 32, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52,
+51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 1,
+       0
+};
+
+struct lwo  LWO_ElbowCoins =
+{
+       128,                    /* number of points */
+       ElbowCoins_PNTS, ElbowCoins_normals, ElbowCoins_POLS, 0L
+};
+
+#endif /* MODE_pipes */
+
+/* End of pipeobjs.c */
diff --git a/modes/glx/pipes.c b/modes/glx/pipes.c
new file mode 100644 (file)
index 0000000..ff9fd16
--- /dev/null
@@ -0,0 +1,1080 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* pipes --- 3D selfbuiding pipe system */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)pipes.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * This program was inspired on a WindowsNT(R)'s screen saver. It was written
+ * from scratch and it was not based on any other source code.
+ *
+ * ==========================================================================
+ * The routine myElbow is derivated from the doughnut routine from the MesaGL
+ * library (more especifically the Mesaaux library) written by Brian Paul.
+ * ==========================================================================
+ *
+ * Thanks goes to Brian Paul for making it possible and inexpensive to use
+ * OpenGL at home.
+ *
+ * Since I'm not a native English speaker, my apologies for any grammatical
+ * mistakes.
+ *
+ * My e-mail addresses is
+ * m-vianna@usa.net
+ *
+ * Marcelo F. Vianna (Apr-09-1997)
+ *
+ * Revision History:
+ * 29-Apr-97: Factory equipment by Ed Mackey.  Productive day today, eh?
+ * 29-Apr-97: Less tight turns Jeff Epler <jepler@inetnebr.com>
+ * 29-Apr-97: Efficiency speed-ups by Marcelo F. Vianna
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "Pipes"
+#define HACK_INIT init_pipes
+#define HACK_DRAW draw_pipes
+#define pipes_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*count: 2 \n" \
+ "*cycles: 5 \n" \
+ "*size: 500 \n" \
+ "*fisheye: True \n" \
+ "*tightturns: False \n" \
+ "*rotatepipes: True \n" \
+ "*noBuffer: True \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_pipes
+
+#include <GL/glu.h>
+#include "buildlwo.h"
+
+#define DEF_FACTORY     "2"
+#define DEF_FISHEYE     "True"
+#define DEF_TIGHTTURNS  "False"
+#define DEF_ROTATEPIPES "True"
+#define NofSysTypes     3
+
+static int  factory;
+static Bool fisheye, tightturns, rotatepipes;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-factory", (char *) ".pipes.factory", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-fisheye", (char *) ".pipes.fisheye", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+fisheye", (char *) ".pipes.fisheye", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-tightturns", (char *) ".pipes.tightturns", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+tightturns", (char *) ".pipes.tightturns", XrmoptionNoArg, (caddr_t) "off"},
+      {(char *) "-rotatepipes", (char *) ".pipes.rotatepipes", XrmoptionNoArg, (caddr_t) "on"},
+      {(char *) "+rotatepipes", (char *) ".pipes.rotatepipes", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & factory, (char *) "factory", (char *) "Factory", (char *) DEF_FACTORY, t_Int},
+       {(caddr_t *) & fisheye, (char *) "fisheye", (char *) "Fisheye", (char *) DEF_FISHEYE, t_Bool},
+       {(caddr_t *) & tightturns, (char *) "tightturns", (char *) "Tightturns", (char *) DEF_TIGHTTURNS, t_Bool},
+       {(caddr_t *) & rotatepipes, (char *) "rotatepipes", (char *) "Rotatepipes", (char *) DEF_ROTATEPIPES, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-factory num", (char *) "how much extra equipment in pipes (0 for none)"},
+       {(char *) "-/+fisheye", (char *) "turn on/off zoomed-in view of pipes"},
+       {(char *) "-/+tightturns", (char *) "turn on/off tight turns"},
+       {(char *) "-/+rotatepipes", (char *) "turn on/off pipe system rotation per screenful"}
+};
+
+ModeSpecOpt pipes_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   pipes_description =
+{"pipes", "init_pipes", "draw_pipes", "release_pipes",
+#if defined( MESA ) && defined( SLOW )
+ "draw_pipes",
+#else
+ "change_pipes",
+#endif
+ "change_pipes", NULL, &pipes_opts,
+ 1000, 2, 5, 500, 4, 1.0, "",
+ "Shows a selfbuilding pipe system", 0, NULL};
+
+#endif
+
+#define Scale4Window               0.1
+#define Scale4Iconic               0.07
+
+#define one_third                  0.3333333333333333333
+
+#define dirNone -1
+#define dirUP 0
+#define dirDOWN 1
+#define dirLEFT 2
+#define dirRIGHT 3
+#define dirNEAR 4
+#define dirFAR 5
+
+#define HCELLS 33
+#define VCELLS 25
+#define DEFINEDCOLORS 7
+#define elbowradius 0.5
+
+/*************************************************************************/
+
+typedef struct {
+#if defined( MESA ) && defined( SLOW )
+       int         flip;
+#endif
+       GLint       WindH, WindW;
+       int         Cells[HCELLS][VCELLS][HCELLS];
+       int         usedcolors[DEFINEDCOLORS];
+       int         directions[6];
+       int         ndirections;
+       int         nowdir, olddir;
+       int         system_number;
+       int         counter;
+       int         PX, PY, PZ;
+       int         number_of_systems;
+       int         system_type;
+       int         system_length;
+       int         turncounter;
+       int         factory;
+       Window      window;
+       float      *system_color;
+       GLfloat     initial_rotation;
+       GLuint      valve, bolts, betweenbolts, elbowbolts, elbowcoins;
+       GLuint      guagehead, guageface, guagedial, guageconnector;
+       GLXContext *glx_context;
+} pipesstruct;
+
+extern struct lwo LWO_BigValve, LWO_PipeBetweenBolts, LWO_Bolts3D;
+extern struct lwo LWO_GuageHead, LWO_GuageFace, LWO_GuageDial, LWO_GuageConnector;
+extern struct lwo LWO_ElbowBolts, LWO_ElbowCoins;
+
+static float front_shininess[] =
+{60.0};
+static float front_specular[] =
+{0.7, 0.7, 0.7, 1.0};
+static float ambient0[] =
+{0.4, 0.4, 0.4, 1.0};
+static float diffuse0[] =
+{1.0, 1.0, 1.0, 1.0};
+static float ambient1[] =
+{0.2, 0.2, 0.2, 1.0};
+static float diffuse1[] =
+{0.5, 0.5, 0.5, 1.0};
+static float position0[] =
+{1.0, 1.0, 1.0, 0.0};
+static float position1[] =
+{-1.0, -1.0, 1.0, 0.0};
+static float lmodel_ambient[] =
+{0.5, 0.5, 0.5, 1.0};
+static float lmodel_twoside[] =
+{GL_TRUE};
+
+static float MaterialRed[] =
+{0.7, 0.0, 0.0, 1.0};
+static float MaterialGreen[] =
+{0.1, 0.5, 0.2, 1.0};
+static float MaterialBlue[] =
+{0.0, 0.0, 0.7, 1.0};
+static float MaterialCyan[] =
+{0.2, 0.5, 0.7, 1.0};
+static float MaterialYellow[] =
+{0.7, 0.7, 0.0, 1.0};
+static float MaterialMagenta[] =
+{0.6, 0.2, 0.5, 1.0};
+static float MaterialWhite[] =
+{0.7, 0.7, 0.7, 1.0};
+static float MaterialGray[] =
+{0.2, 0.2, 0.2, 1.0};
+
+static pipesstruct *pipes = (pipesstruct *) NULL;
+
+
+static void
+MakeTube(int direction)
+{
+       float       an;
+       float       SINan_3, COSan_3;
+
+       /*dirUP    = 00000000 */
+       /*dirDOWN  = 00000001 */
+       /*dirLEFT  = 00000010 */
+       /*dirRIGHT = 00000011 */
+       /*dirNEAR  = 00000100 */
+       /*dirFAR   = 00000101 */
+
+       if (!(direction & 4)) {
+               glRotatef(90.0, (direction & 2) ? 0.0 : 1.0,
+                         (direction & 2) ? 1.0 : 0.0, 0.0);
+       }
+       glBegin(GL_QUAD_STRIP);
+       for (an = 0.0; an <= 2.0 * M_PI; an += M_PI / 12.0) {
+               glNormal3f((COSan_3 = cos(an) / 3.0), (SINan_3 = sin(an) / 3.0), 0.0);
+               glVertex3f(COSan_3, SINan_3, one_third);
+               glVertex3f(COSan_3, SINan_3, -one_third);
+       }
+       glEnd();
+}
+
+static Bool
+mySphere(float radius)
+{
+       GLUquadricObj *quadObj;
+
+       if ((quadObj = gluNewQuadric()) == 0)
+               return False;
+       gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
+       gluSphere(quadObj, radius, 16, 16);
+       gluDeleteQuadric(quadObj);
+       return True;
+}
+
+static void
+myElbow(ModeInfo * mi, int bolted)
+{
+#define nsides 25
+#define rings 25
+#define r one_third
+#define R one_third
+
+       pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+
+       int         i, j;
+       GLfloat     p0[3], p1[3], p2[3], p3[3];
+       GLfloat     n0[3], n1[3], n2[3], n3[3];
+       GLfloat     COSphi, COSphi1, COStheta, COStheta1;
+       GLfloat     _SINtheta, _SINtheta1;
+
+       for (i = 0; i <= rings / 4; i++) {
+               GLfloat     theta, theta1;
+
+               theta = (GLfloat) i *2.0 * M_PI / rings;
+
+               theta1 = (GLfloat) (i + 1) * 2.0 * M_PI / rings;
+               for (j = 0; j < nsides; j++) {
+                       GLfloat     phi, phi1;
+
+                       phi = (GLfloat) j *2.0 * M_PI / nsides;
+
+                       phi1 = (GLfloat) (j + 1) * 2.0 * M_PI / nsides;
+
+                       p0[0] = (COStheta = cos(theta)) * (R + r * (COSphi = cos(phi)));
+                       p0[1] = (_SINtheta = -sin(theta)) * (R + r * COSphi);
+
+                       p1[0] = (COStheta1 = cos(theta1)) * (R + r * COSphi);
+                       p1[1] = (_SINtheta1 = -sin(theta1)) * (R + r * COSphi);
+
+                       p2[0] = COStheta1 * (R + r * (COSphi1 = cos(phi1)));
+                       p2[1] = _SINtheta1 * (R + r * COSphi1);
+
+                       p3[0] = COStheta * (R + r * COSphi1);
+                       p3[1] = _SINtheta * (R + r * COSphi1);
+
+                       n0[0] = COStheta * COSphi;
+                       n0[1] = _SINtheta * COSphi;
+
+                       n1[0] = COStheta1 * COSphi;
+                       n1[1] = _SINtheta1 * COSphi;
+
+                       n2[0] = COStheta1 * COSphi1;
+                       n2[1] = _SINtheta1 * COSphi1;
+
+                       n3[0] = COStheta * COSphi1;
+                       n3[1] = _SINtheta * COSphi1;
+
+                       p0[2] = p1[2] = r * (n0[2] = n1[2] = sin(phi));
+                       p2[2] = p3[2] = r * (n2[2] = n3[2] = sin(phi1));
+
+                       glBegin(GL_QUADS);
+                       glNormal3fv(n3);
+                       glVertex3fv(p3);
+                       glNormal3fv(n2);
+                       glVertex3fv(p2);
+                       glNormal3fv(n1);
+                       glVertex3fv(p1);
+                       glNormal3fv(n0);
+                       glVertex3fv(p0);
+                       glEnd();
+               }
+       }
+
+       if (pp->factory > 0 && bolted) {
+               /* Bolt the elbow onto the pipe system */
+               glFrontFace(GL_CW);
+               glPushMatrix();
+               glRotatef(90.0, 0.0, 0.0, -1.0);
+               glRotatef(90.0, 0.0, 1.0, 0.0);
+               glTranslatef(0.0, one_third, one_third);
+               glCallList(pp->elbowcoins);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+               glCallList(pp->elbowbolts);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pp->system_color);
+               glPopMatrix();
+               glFrontFace(GL_CCW);
+       }
+#undef r
+#undef R
+#undef nsides
+#undef rings
+}
+
+static void
+FindNeighbors(ModeInfo * mi)
+{
+       pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+
+       pp->ndirections = 0;
+       pp->directions[dirUP] = (!pp->Cells[pp->PX][pp->PY + 1][pp->PZ]) ? 1 : 0;
+       pp->ndirections += pp->directions[dirUP];
+       pp->directions[dirDOWN] = (!pp->Cells[pp->PX][pp->PY - 1][pp->PZ]) ? 1 : 0;
+       pp->ndirections += pp->directions[dirDOWN];
+       pp->directions[dirLEFT] = (!pp->Cells[pp->PX - 1][pp->PY][pp->PZ]) ? 1 : 0;
+       pp->ndirections += pp->directions[dirLEFT];
+       pp->directions[dirRIGHT] = (!pp->Cells[pp->PX + 1][pp->PY][pp->PZ]) ? 1 : 0;
+       pp->ndirections += pp->directions[dirRIGHT];
+       pp->directions[dirFAR] = (!pp->Cells[pp->PX][pp->PY][pp->PZ - 1]) ? 1 : 0;
+       pp->ndirections += pp->directions[dirFAR];
+       pp->directions[dirNEAR] = (!pp->Cells[pp->PX][pp->PY][pp->PZ + 1]) ? 1 : 0;
+       pp->ndirections += pp->directions[dirNEAR];
+}
+
+static int
+SelectNeighbor(ModeInfo * mi)
+{
+       pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+       int         dirlist[6];
+       int         i, j;
+
+       for (i = 0, j = 0; i < 6; i++) {
+               if (pp->directions[i]) {
+                       dirlist[j] = i;
+                       j++;
+               }
+       }
+
+       return dirlist[NRAND(pp->ndirections)];
+}
+
+static void
+MakeValve(ModeInfo * mi, int newdir)
+{
+       pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+
+       /* There is a glPopMatrix() right after this subroutine returns. */
+       switch (newdir) {
+               case dirUP:
+               case dirDOWN:
+                       glRotatef(90.0, 1.0, 0.0, 0.0);
+                       glRotatef(NRAND(3) * 90.0, 0.0, 0.0, 1.0);
+                       break;
+               case dirLEFT:
+               case dirRIGHT:
+                       glRotatef(90.0, 0.0, -1.0, 0.0);
+                       glRotatef((NRAND(3) * 90.0) - 90.0, 0.0, 0.0, 1.0);
+                       break;
+               case dirNEAR:
+               case dirFAR:
+                       glRotatef(NRAND(4) * 90.0, 0.0, 0.0, 1.0);
+                       break;
+       }
+       glFrontFace(GL_CW);
+       glCallList(pp->betweenbolts);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+       glCallList(pp->bolts);
+       if (!MI_IS_MONO(mi)) {
+               if (pp->system_color == MaterialRed) {
+                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, NRAND(2) ? MaterialYellow : MaterialBlue);
+               } else if (pp->system_color == MaterialBlue) {
+                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, NRAND(2) ? MaterialRed : MaterialYellow);
+               } else if (pp->system_color == MaterialYellow) {
+                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, NRAND(2) ? MaterialBlue : MaterialRed);
+               } else {
+                       switch ((NRAND(3))) {
+                               case 0:
+                                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
+                                       break;
+                               case 1:
+                                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialBlue);
+                                       break;
+                               case 2:
+                                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialYellow);
+                       }
+               }
+       }
+       glRotatef((GLfloat) (NRAND(90)), 1.0, 0.0, 0.0);
+       glCallList(pp->valve);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pp->system_color);
+       glFrontFace(GL_CCW);
+}
+
+static int
+MakeGuage(ModeInfo * mi, int newdir)
+{
+       pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+
+       /* Can't have a guage on a vertical pipe. */
+       if ((newdir == dirUP) || (newdir == dirDOWN))
+               return (0);
+
+       /* Is there space above this pipe for a guage? */
+       if (!pp->directions[dirUP])
+               return (0);
+
+       /* Yes!  Mark the space as used. */
+       pp->Cells[pp->PX][pp->PY + 1][pp->PZ] = 1;
+
+       glFrontFace(GL_CW);
+       glPushMatrix();
+       if ((newdir == dirLEFT) || (newdir == dirRIGHT))
+               glRotatef(90.0, 0.0, 1.0, 0.0);
+       glCallList(pp->betweenbolts);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+       glCallList(pp->bolts);
+       glPopMatrix();
+
+       glCallList(pp->guageconnector);
+       glPushMatrix();
+       glTranslatef(0.0, 1.33333, 0.0);
+       /* Do not change the above to 1 + ONE_THIRD, because */
+       /* the object really is centered on 1.3333300000. */
+       glRotatef(NRAND(270) + 45.0, 0.0, 0.0, -1.0);
+       /* Random rotation for the dial.  I love it. */
+       glCallList(pp->guagedial);
+       glPopMatrix();
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pp->system_color);
+       glCallList(pp->guagehead);
+
+       /* GuageFace is drawn last, in case of low-res depth buffers. */
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+       glCallList(pp->guageface);
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pp->system_color);
+       glFrontFace(GL_CCW);
+
+       return (1);
+}
+
+static void
+MakeShape(ModeInfo * mi, int newdir)
+{
+       switch (NRAND(2)) {
+               case 1:
+                       if (!MakeGuage(mi, newdir))
+                               MakeTube(newdir);
+                       break;
+               default:
+                       MakeValve(mi, newdir);
+                       break;
+       }
+}
+
+static void
+reshape(ModeInfo * mi, int width, int height)
+{
+       pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+
+       glViewport(0, 0, pp->WindW = (GLint) width, pp->WindH = (GLint) height);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       /*glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0); */
+       gluPerspective(65.0, (GLfloat) width / (GLfloat) height, 0.1, 20.0);
+       glMatrixMode(GL_MODELVIEW);
+}
+
+static void
+pinit(ModeInfo * mi, int zera)
+{
+       pipesstruct *pp = &pipes[MI_SCREEN(mi)];
+       int         X, Y, Z;
+
+       glClearDepth(1.0);
+       glClearColor(0.0, 0.0, 0.0, 1.0);
+       glColor3f(1.0, 1.0, 1.0);
+
+       glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0);
+       glLightfv(GL_LIGHT0, GL_POSITION, position0);
+       glLightfv(GL_LIGHT1, GL_AMBIENT, ambient1);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse1);
+       glLightfv(GL_LIGHT1, GL_POSITION, position1);
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+       glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_DEPTH_TEST);
+       glEnable(GL_NORMALIZE);
+       glEnable(GL_CULL_FACE);
+
+       glShadeModel(GL_SMOOTH);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
+
+       if (zera) {
+               pp->system_number = 1;
+               glDrawBuffer(GL_FRONT_AND_BACK);
+               glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+               (void) memset(pp->Cells, 0, sizeof (pp->Cells));
+               for (X = 0; X < HCELLS; X++) {
+                       for (Y = 0; Y < VCELLS; Y++) {
+                               pp->Cells[X][Y][0] = 1;
+                               pp->Cells[X][Y][HCELLS - 1] = 1;
+                               pp->Cells[0][Y][X] = 1;
+                               pp->Cells[HCELLS - 1][Y][X] = 1;
+                       }
+               }
+               for (X = 0; X < HCELLS; X++) {
+                       for (Z = 0; Z < HCELLS; Z++) {
+                               pp->Cells[X][0][Z] = 1;
+                               pp->Cells[X][VCELLS - 1][Z] = 1;
+                       }
+               }
+               (void) memset(pp->usedcolors, 0, sizeof (pp->usedcolors));
+               if ((pp->initial_rotation += 10.0) > 45.0) {
+                       pp->initial_rotation -= 90.0;
+               }
+       }
+       pp->counter = 0;
+       pp->turncounter = 0;
+
+       if (!MI_IS_MONO(mi)) {
+               int         collist[DEFINEDCOLORS];
+               int         i, j, lower = 1000;
+
+               /* Avoid repeating colors on the same screen unless necessary */
+               for (i = 0; i < DEFINEDCOLORS; i++) {
+                       if (lower > pp->usedcolors[i])
+                               lower = pp->usedcolors[i];
+               }
+               for (i = 0, j = 0; i < DEFINEDCOLORS; i++) {
+                       if (pp->usedcolors[i] == lower) {
+                               collist[j] = i;
+                               j++;
+                       }
+               }
+               i = collist[NRAND(j)];
+               pp->usedcolors[i]++;
+               switch (i) {
+                       case 0:
+                               pp->system_color = MaterialRed;
+                               break;
+                       case 1:
+                               pp->system_color = MaterialGreen;
+                               break;
+                       case 2:
+                               pp->system_color = MaterialBlue;
+                               break;
+                       case 3:
+                               pp->system_color = MaterialCyan;
+                               break;
+                       case 4:
+                               pp->system_color = MaterialYellow;
+                               break;
+                       case 5:
+                               pp->system_color = MaterialMagenta;
+                               break;
+                       case 6:
+                               pp->system_color = MaterialWhite;
+                               break;
+               }
+       } else {
+               pp->system_color = MaterialGray;
+       }
+
+       do {
+               pp->PX = NRAND((HCELLS - 1)) + 1;
+               pp->PY = NRAND((VCELLS - 1)) + 1;
+               pp->PZ = NRAND((HCELLS - 1)) + 1;
+       } while (pp->Cells[pp->PX][pp->PY][pp->PZ] ||
+                (pp->Cells[pp->PX + 1][pp->PY][pp->PZ] && pp->Cells[pp->PX - 1][pp->PY][pp->PZ] &&
+                 pp->Cells[pp->PX][pp->PY + 1][pp->PZ] && pp->Cells[pp->PX][pp->PY - 1][pp->PZ] &&
+                 pp->Cells[pp->PX][pp->PY][pp->PZ + 1] && pp->Cells[pp->PX][pp->PY][pp->PZ - 1]));
+       pp->Cells[pp->PX][pp->PY][pp->PZ] = 1;
+       pp->olddir = dirNone;
+
+       FindNeighbors(mi);
+
+       pp->nowdir = SelectNeighbor(mi);
+}
+
+static void
+free_factory(Display *display, pipesstruct *pp)
+{
+       if (pp->glx_context) {
+               /* Display lists MUST be freed while their glXContext is current. */
+               glXMakeCurrent(display, pp->window, *(pp->glx_context));
+               if (pp->valve != 0) {
+                       glDeleteLists(pp->valve, 1);
+                       pp->valve = 0;
+               }
+               if (pp->bolts != 0) {
+                       glDeleteLists(pp->bolts, 1);
+                       pp->bolts = 0;
+               }
+               if (pp->betweenbolts != 0) {
+                       glDeleteLists(pp->betweenbolts, 1);
+                       pp->betweenbolts = 0;
+               }
+               if (pp->elbowbolts != 0) {
+                       glDeleteLists(pp->elbowbolts, 1);
+                       pp->elbowbolts = 0;
+               }
+               if (pp->elbowcoins != 0) {
+                       glDeleteLists(pp->elbowcoins, 1);
+                       pp->elbowcoins = 0;
+               }
+               if (pp->guagehead != 0) {
+                       glDeleteLists(pp->guagehead, 1);
+                       pp->guagehead = 0;
+               }
+               if (pp->guageface != 0) {
+                       glDeleteLists(pp->guageface, 1);
+                       pp->guageface = 0;
+               }
+               if (pp->guagedial != 0) {
+                       glDeleteLists(pp->guagedial, 1);
+                       pp->guagedial = 0;
+               }
+               if (pp->guageconnector != 0) {
+                       glDeleteLists(pp->guageconnector, 1);
+                       pp->guageconnector = 0;
+               }
+       }
+}
+
+void
+release_pipes(ModeInfo * mi)
+{
+       if (pipes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_factory(MI_DISPLAY(mi), &pipes[screen]);
+               (void) free((void *) pipes);
+               pipes = (pipesstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+void
+init_pipes(ModeInfo * mi)
+{
+       pipesstruct *pp;
+
+       if (pipes == NULL) {
+               if ((pipes = (pipesstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (pipesstruct))) == NULL)
+                       return;
+       }
+       pp = &pipes[MI_SCREEN(mi)];
+
+       pp->window = MI_WINDOW(mi);
+       pp->factory = factory;
+       if ((pp->glx_context = init_GL(mi)) != NULL) {
+
+               reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               pp->initial_rotation = -10.0;
+               pinit(mi, 1);
+
+               if (pp->factory > 0) {
+                       if (((pp->valve = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_BigValve)) == 0) ||
+                           ((pp->bolts = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_Bolts3D)) == 0) ||
+                           ((pp->betweenbolts = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_PipeBetweenBolts)) == 0) ||
+                           ((pp->elbowbolts = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_ElbowBolts)) == 0) ||
+                           ((pp->elbowcoins = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_ElbowCoins)) == 0) ||
+                           ((pp->guagehead = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_GuageHead)) == 0) ||
+                           ((pp->guageface = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_GuageFace)) == 0) ||
+                           ((pp->guagedial = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_GuageDial)) == 0) ||
+                           ((pp->guageconnector = BuildLWO(MI_IS_WIREFRAME(mi),
+                               &LWO_GuageConnector)) == 0)) {
+                               free_factory(MI_DISPLAY(mi), pp);
+                               pp->factory = 0;
+                       }
+               }
+               /* else they are all 0, thanks to calloc(). */
+
+               if (MI_COUNT(mi) < 1 || MI_COUNT(mi) > NofSysTypes + 1) {
+                       pp->system_type = NRAND(NofSysTypes) + 1;
+               } else {
+                       pp->system_type = MI_COUNT(mi);
+               }
+
+               if (MI_CYCLES(mi) > 0 && MI_CYCLES(mi) < 11) {
+                       pp->number_of_systems = MI_CYCLES(mi);
+               } else {
+                       pp->number_of_systems = 5;
+               }
+
+               if (MI_SIZE(mi) < 10) {
+                       pp->system_length = 10;
+               } else if (MI_SIZE(mi) > 1000) {
+                       pp->system_length = 1000;
+               } else {
+                       pp->system_length = MI_SIZE(mi);
+               }
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_pipes(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         newdir;
+       int         OPX, OPY, OPZ;
+       pipesstruct *pp;
+
+       if (pipes == NULL)
+               return;
+       pp = &pipes[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (!pp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(pp->glx_context));
+
+#if defined( MESA ) && defined( SLOW )
+       glDrawBuffer(GL_BACK);
+#else
+       glDrawBuffer(GL_FRONT);
+#endif
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, fisheye ? -3.8 : -4.8);
+       if (rotatepipes)
+               glRotatef(pp->initial_rotation, 0.0, 1.0, 0.0);
+
+       if (!MI_IS_ICONIC(mi)) {
+               /* Width/height ratio handled by gluPerspective() now. */
+               glScalef(Scale4Window, Scale4Window, Scale4Window);
+       } else {
+               glScalef(Scale4Iconic, Scale4Iconic, Scale4Iconic);
+       }
+
+       FindNeighbors(mi);
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, pp->system_color);
+
+       /* If it's the begining of a system, draw a sphere */
+       if (pp->olddir == dirNone) {
+               glPushMatrix();
+               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0);
+               if (!mySphere(0.6)) {
+                       release_pipes(mi);
+                       return;
+               }
+               glPopMatrix();
+       }
+       /* Check for stop conditions */
+       if (pp->ndirections == 0 || pp->counter > pp->system_length) {
+               glPushMatrix();
+               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0);
+               /* Finish the system with another sphere */
+               if (!mySphere(0.6)) {
+                       release_pipes(mi);
+                       return;
+               }
+#if defined( MESA ) && defined( SLOW )
+               glXSwapBuffers(display, window);
+#endif
+               glPopMatrix();
+
+               /* If the maximum number of system was drawn, restart (clearing the screen), */
+               /* else start a new system. */
+               if (++pp->system_number > pp->number_of_systems) {
+                       (void) sleep(1);
+                       pinit(mi, 1);
+               } else {
+                       pinit(mi, 0);
+               }
+
+               glPopMatrix();
+               return;
+       }
+       pp->counter++;
+       pp->turncounter++;
+
+       /* Do will the direction change? if so, determine the new one */
+       newdir = pp->nowdir;
+       if (!pp->directions[newdir]) {  /* cannot proceed in the current direction */
+               newdir = SelectNeighbor(mi);
+       } else {
+               if (tightturns) {
+                       /* random change (20% chance) */
+                       if ((pp->counter > 1) && (NRAND(100) < 20)) {
+                               newdir = SelectNeighbor(mi);
+                       }
+               } else {
+                       /* Chance to turn increases after each length of pipe drawn */
+                       if ((pp->counter > 1) && NRAND(50) < NRAND(pp->turncounter + 1)) {
+                               newdir = SelectNeighbor(mi);
+                               pp->turncounter = 0;
+                       }
+               }
+       }
+
+       /* Has the direction changed? */
+       if (newdir == pp->nowdir) {
+               /* If not, draw the cell's center pipe */
+               glPushMatrix();
+               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0);
+               /* Chance of factory shape here, if enabled. */
+               if ((pp->counter > 1) && (NRAND(100) < pp->factory)) {
+                       MakeShape(mi, newdir);
+               } else {
+                       MakeTube(newdir);
+               }
+               glPopMatrix();
+       } else {
+               /* If so, draw the cell's center elbow/sphere */
+               int         sysT = pp->system_type;
+
+               if (sysT == NofSysTypes + 1) {
+                       sysT = ((pp->system_number - 1) % NofSysTypes) + 1;
+               }
+               glPushMatrix();
+
+               switch (sysT) {
+                       case 1:
+                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0);
+                               if (!mySphere(elbowradius)) {
+                                       release_pipes(mi);
+                                       return;
+                               }
+                               break;
+                       case 2:
+                       case 3:
+                               switch (pp->nowdir) {
+                                       case dirUP:
+                                               switch (newdir) {
+                                                       case dirLEFT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               glRotatef(180.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                                       case dirRIGHT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               glRotatef(180.0, 1.0, 0.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirFAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(90.0, 0.0, 1.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 0.0, 1.0);
+                                                               break;
+                                                       case dirNEAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(90.0, 0.0, 1.0, 0.0);
+                                                               glRotatef(180.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                               }
+                                               break;
+                                       case dirDOWN:
+                                               switch (newdir) {
+                                                       case dirLEFT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               break;
+                                                       case dirRIGHT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               glRotatef(180.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirFAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(270.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirNEAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(90.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                               }
+                                               break;
+                                       case dirLEFT:
+                                               switch (newdir) {
+                                                       case dirUP:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               glRotatef(180.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirDOWN:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               glRotatef(180.0, 1.0, 0.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirFAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(270.0, 1.0, 0.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirNEAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(270.0, 1.0, 0.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 0.0, 1.0);
+                                                               break;
+                                               }
+                                               break;
+                                       case dirRIGHT:
+                                               switch (newdir) {
+                                                       case dirUP:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               break;
+                                                       case dirDOWN:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0);
+                                                               glRotatef(180.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                                       case dirFAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(270.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                                       case dirNEAR:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(90.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                               }
+                                               break;
+                                       case dirNEAR:
+                                               switch (newdir) {
+                                                       case dirLEFT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(270.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                                       case dirRIGHT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(270.0, 1.0, 0.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirUP:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(270.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirDOWN:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0 - (one_third));
+                                                               glRotatef(90.0, 0.0, 1.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 0.0, 1.0);
+                                                               break;
+                                               }
+                                               break;
+                                       case dirFAR:
+                                               switch (newdir) {
+                                                       case dirUP:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 + (one_third), (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(90.0, 0.0, 1.0, 0.0);
+                                                               break;
+                                                       case dirDOWN:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0 - (one_third), (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(90.0, 0.0, 1.0, 0.0);
+                                                               glRotatef(180.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                                       case dirLEFT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 - (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(90.0, 1.0, 0.0, 0.0);
+                                                               break;
+                                                       case dirRIGHT:
+                                                               glTranslatef((pp->PX - 16) / 3.0 * 4.0 + (one_third), (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0 + (one_third));
+                                                               glRotatef(270.0, 1.0, 0.0, 0.0);
+                                                               glRotatef(180.0, 0.0, 0.0, 1.0);
+                                                               break;
+                                               }
+                                               break;
+                               }
+                               myElbow(mi, (sysT == 2));
+                               break;
+               }
+               glPopMatrix();
+       }
+
+       OPX = pp->PX;
+       OPY = pp->PY;
+       OPZ = pp->PZ;
+       pp->olddir = pp->nowdir;
+       pp->nowdir = newdir;
+       switch (pp->nowdir) {
+               case dirUP:
+                       pp->PY++;
+                       break;
+               case dirDOWN:
+                       pp->PY--;
+                       break;
+               case dirLEFT:
+                       pp->PX--;
+                       break;
+               case dirRIGHT:
+                       pp->PX++;
+                       break;
+               case dirNEAR:
+                       pp->PZ++;
+                       break;
+               case dirFAR:
+                       pp->PZ--;
+                       break;
+       }
+       pp->Cells[pp->PX][pp->PY][pp->PZ] = 1;
+
+       /* Cells'face pipe */
+       glTranslatef(((pp->PX + OPX) / 2.0 - 16) / 3.0 * 4.0, ((pp->PY + OPY) / 2.0 - 12) / 3.0 * 4.0, ((pp->PZ + OPZ) / 2.0 - 16) / 3.0 * 4.0);
+       MakeTube(newdir);
+
+       glPopMatrix();
+
+       glFlush();
+
+#if defined( MESA ) && defined( SLOW )
+       pp->flip = !pp->flip;
+       if (pp->flip)
+               glXSwapBuffers(display, window);
+#endif
+}
+
+void
+change_pipes(ModeInfo * mi)
+{
+       pipesstruct *pp;
+
+       if (pipes == NULL)
+               return;
+       pp = &pipes[MI_SCREEN(mi)];
+
+       if (!pp->glx_context)
+               return;
+
+       glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(pp->glx_context));
+       pinit(mi, 1);
+}
+
+#endif
diff --git a/modes/glx/rubik.c b/modes/glx/rubik.c
new file mode 100644 (file)
index 0000000..2283bba
--- /dev/null
@@ -0,0 +1,2145 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* rubik --- Shows an auto-solving Rubik's cube */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)rubik.c      5.01 2001/03/01 xlockmore";
+
+#endif
+
+#undef DEBUG_LISTS
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * This mode shows an auto-solving rubik's cube "puzzle". If somebody
+ * intends to make a game or something based on this code, please let me
+ * know first, my e-mail address is provided in this comment. Marcelo.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * Since I'm not a native English speaker, my apologies for any grammatical
+ * mistakes.
+ *
+ * My e-mail address is
+ * m-vianna@usa.net
+ *
+ * Marcelo F. Vianna (Jul-31-1997)
+ *
+ * Revision History:
+ * 01-Mar-2001: Added FPS stuff - Eric Lassauge <lassauge@mail.dotcom.fr>
+ * 01-Nov-2000: Allocation checks
+ * 27-Apr-1999: LxMxN stuff added.
+ * 26-Sep-1998: Added some more movement (the cube does not stay in the screen
+ *              center anymore. Also fixed the scale problem immediately after
+ *              shuffling when the puzzle is solved.
+ * 08-Aug-1997: Now has some internals from xrubik by David Bagley
+ *              This should make it easier to add features.
+ * 02-Aug-1997: Now behaves more like puzzle.c: first show the cube being
+ *              shuffled and then being solved. A mode specific option was
+ *              added:
+ *              "+/-hideshuffling" to provide the original behavior (in which
+ *              only the solution is shown).
+ *              The color labels corners are now rounded.
+ *              Optimized the cubit() routine using glLists.
+ * 01-Aug-1997: Shuffling now avoids movements that undoes the previous
+ *              movement and three consecutive identical moves (which is
+ *              pretty stupid).
+ *              improved the "cycles" option in replacement of David's hack,
+ *              now rp->anglestep is a GLfloat, so this option selects the
+ *              "exact" number of frames that a rotation (movement) takes to
+ *              complete.
+ * 30-Jul-1997: Initial release, there is no algorithm to solve the puzzle,
+ *              instead, it randomly shuffle the cube and then make the
+ *              movements in the reverse order.
+ *              The mode was written in 1 day (I got sick and had the day off).
+ *              There was not much to do since I could not leave home... :)
+ */
+
+/*-
+ * Color labels mapping:
+ * =====================
+ *
+ *             +-----------+
+ *             |0-->       |
+ *             ||          |
+ *             |v  TOP(0)  |
+ *             |           |
+ *             |          8|
+ * +-----------+-----------+-----------+
+ * |0-->       |0-->       |0-->       |
+ * ||          ||          ||          |
+ * |v  LEFT(1) |v FRONT(2) |v RIGHT(3) |
+ * |           |           |           |
+ * |          8|          8|          8|
+ * +-----------+-----------+-----------+
+ *             |0-->       |
+ *             ||          |
+ *             |v BOTTOM(4)|
+ *             |           |
+ *             |          8|
+ *             +-----------+             +---+---+---+
+ *             |0-->       |             | 0 | 1 | 2 |
+ *             ||          |             |--xxxxx(N)-+
+ *             |v  BACK(5) |             | 3 | 4 | 5 |
+ *             |           |             +---+---+---+
+ *             |          8|             | 6 | 7 | 8 |
+ *             +-----------+             +---+---+---+
+ *
+ *  Map to 3d
+ *  FRONT  => X, Y
+ *  BACK   => X, Y
+ *  LEFT   => Z, Y
+ *  RIGHT  => Z, Y
+ *  TOP    => X, Z
+ *  BOTTOM => X, Z
+ */
+
+/*-
+ * PURIFY 3.0a on SunOS4 reports an unitialized memory read on each of
+ * the glCallList() functions below when using MesaGL 2.1.  This has
+ * been fixed in MesaGL 2.2 and later releases.
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "Rubik"
+#define HACK_INIT init_rubik
+#define HACK_DRAW draw_rubik
+#define rubik_opts xlockmore_opts
+#define DEFAULTS "*delay: 40000 \n" \
+ "*count: -30 \n" \
+ "*showFps: False \n" \
+ "*cycles: 5 \n" \
+ "*size: -6 \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_rubik
+
+#define DEF_SIZEX     "0"
+#define DEF_SIZEY     "0"
+#define DEF_SIZEZ     "0"
+#define DEF_HIDESHUFFLING     "False"
+
+static int sizex;
+static int sizey;
+static int sizez;
+static Bool hideshuffling;
+
+static XrmOptionDescRec opts[] =
+{
+        {(char *) "-sizex", (char *) ".rubik.sizex", XrmoptionSepArg, (caddr_t) NULL},
+        {(char *) "-sizey", (char *) ".rubik.sizey", XrmoptionSepArg, (caddr_t) NULL},
+        {(char *) "-sizez", (char *) ".rubik.sizez", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-hideshuffling", (char *) ".rubik.hideshuffling", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+hideshuffling", (char *) ".rubik.hideshuffling", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & sizex, (char *) "sizex", (char *) "SizeX", (char *) DEF_SIZEX, t_Int},
+       {(caddr_t *) & sizey, (char *) "sizey", (char *) "SizeY", (char *) DEF_SIZEY, t_Int},
+       {(caddr_t *) & sizez, (char *) "sizez", (char *) "SizeZ", (char *) DEF_SIZEZ, t_Int},
+       {(caddr_t *) & hideshuffling, (char *) "hideshuffling", (char *) "Hideshuffling", (char *) DEF_HIDESHUFFLING, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-sizex num", (char *) "number of cubies along x axis (overrides size)"},
+       {(char *) "-sizey num", (char *) "number of cubies along y axis (overrides size)"},
+       {(char *) "-sizez num", (char *) "number of cubies along z axis (overrides size)"},
+       {(char *) "-/+hideshuffling", (char *) "turn on/off hidden shuffle phase"}
+};
+
+ModeSpecOpt rubik_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   rubik_description =
+{"rubik", "init_rubik", "draw_rubik", "release_rubik",
+ "draw_rubik", "change_rubik", NULL, &rubik_opts,
+ 10000, -30, 5, -6, 64, 1.0, "",
+ "Shows an auto-solving Rubik's Cube", 0, NULL};
+
+#endif
+
+#define VectMul(X1,Y1,Z1,X2,Y2,Z2) (Y1)*(Z2)-(Z1)*(Y2),(Z1)*(X2)-(X1)*(Z2),(X1)*(Y2)-(Y1)*(X2)
+#define sqr(A)                     ((A)*(A))
+
+#ifndef Pi
+#define Pi                         M_PI
+#endif
+
+
+#define ACTION_SOLVE    1
+#define ACTION_SHUFFLE  0
+
+#define DELAY_AFTER_SHUFFLING  5
+#define DELAY_AFTER_SOLVING   20
+
+/*************************************************************************/
+
+#define MINSIZE 2
+#define MAXSIZEX (rp->sizex)
+#define MAXSIZEY (rp->sizey)
+#define MAXSIZEZ (rp->sizez)
+#define AVSIZE ((rp->sizex+rp->sizey+rp->sizez)/3.0)     /* Use of this should be minimized */
+#define MAXMAXSIZE (MAX(MAXSIZEX,MAX(MAXSIZEY,MAXSIZEZ)))
+#define MAXSIZEXY (MAXSIZEX*MAXSIZEY)
+#define MAXSIZEYZ (MAXSIZEY*MAXSIZEZ)
+#define MAXSIZEZX (MAXSIZEZ*MAXSIZEX)
+#define LASTX (MAXSIZEX-1)
+#define LASTY (MAXSIZEY-1)
+#define LASTZ (MAXSIZEZ-1)
+/* These are not likely to change but... */
+#define FIRSTX 0
+#define FIRSTY 0
+#define FIRSTZ 0
+
+#define Scale4Window               (0.9/AVSIZE)
+#define Scale4Iconic               (2.1/AVSIZE)
+
+#define MAXORIENT 4            /* Number of orientations of a square */
+#define MAXFACES 6             /* Number of faces */
+
+/* Directions relative to the face of a cubie */
+#define TOP 0
+#define RIGHT 1
+#define BOTTOM 2
+#define LEFT 3
+#define CW (MAXORIENT+1)
+#define HALF (MAXORIENT+2)
+#define CCW (2*MAXORIENT-1)
+
+#define TOP_FACE 0
+#define LEFT_FACE 1
+#define FRONT_FACE 2
+#define RIGHT_FACE 3
+#define BOTTOM_FACE 4
+#define BACK_FACE 5
+#define NO_FACE (MAXFACES)
+#define NO_ROTATION (2*MAXORIENT)
+#define NO_DEPTH MAXMAXSIZE
+
+#define REVX(a) (MAXSIZEX - a - 1)
+#define REVY(a) (MAXSIZEY - a - 1)
+#define REVZ(a) (MAXSIZEZ - a - 1)
+
+#define CUBELEN 0.50
+#define CUBEROUND (CUBELEN-0.05)
+#define STICKERLONG (CUBEROUND-0.05)
+#define STICKERSHORT (STICKERLONG-0.05)
+#define STICKERDEPTH (CUBELEN+0.01)
+
+#define ObjCubit        0
+#define MaxObj          1
+typedef struct _RubikLoc {
+       int         face;
+       int         rotation;   /* Not used yet */
+} RubikLoc;
+
+typedef struct _RubikRowNext {
+       int         face, direction, sideFace;
+} RubikRowNext;
+
+typedef struct _RubikMove {
+       int         face, direction;
+       int         position;
+} RubikMove;
+
+typedef struct _RubikSlice {
+       int         face, rotation;
+       int         depth;
+} RubikSlice;
+
+/*-
+ * Pick a face and a direction on face the next face and orientation
+ * is then known.
+ */
+static RubikLoc slideNextRow[MAXFACES][MAXORIENT] =
+{
+       {
+               {5, TOP},
+               {3, RIGHT},
+               {2, TOP},
+               {1, LEFT}},
+       {
+               {0, RIGHT},
+               {2, TOP},
+               {4, LEFT},
+               {5, BOTTOM}},
+       {
+               {0, TOP},
+               {3, TOP},
+               {4, TOP},
+               {1, TOP}},
+       {
+               {0, LEFT},
+               {5, BOTTOM},
+               {4, RIGHT},
+               {2, TOP}},
+       {
+               {2, TOP},
+               {3, LEFT},
+               {5, TOP},
+               {1, RIGHT}},
+       {
+               {4, TOP},
+               {3, BOTTOM},
+               {0, TOP},
+               {1, BOTTOM}}
+};
+
+/*-
+ * Examine cubie 0 on each face, its 4 movements (well only 2 since the
+ * other 2 will be opposites) and translate it into slice movements).
+ * CW = DEEP Depth CCW == SHALLOW Depth with reference to faces 0, 1, and 2
+ */
+static RubikLoc rotateSlice[MAXFACES][MAXORIENT / 2] =
+{
+       {
+               {1, CCW},
+               {2, CW},
+       },
+       {
+               {2, CW},
+               {0, CCW},
+       },
+       {
+               {1, CCW},
+               {0, CCW},
+       },
+       {
+               {2, CCW},
+               {0, CCW},
+       },
+       {
+               {1, CCW},
+               {2, CCW},
+       },
+       {
+               {1, CCW},
+               {0, CW},
+       }
+};
+
+/*-
+ * Rotate face clockwise by a number of orients, then the top of the
+ * face then points to this face
+ */
+static int  rowToRotate[MAXFACES][MAXORIENT] =
+{
+       {3, 2, 1, 5},
+       {2, 4, 5, 0},
+       {3, 4, 1, 0},
+       {5, 4, 2, 0},
+       {3, 5, 1, 2},
+       {3, 0, 1, 4}
+};
+
+/*
+ * This translates a clockwise move to something more manageable
+ */
+static RubikRowNext rotateToRow[MAXFACES] =    /*CW to min face */
+{
+       {1, LEFT, TOP},
+       {0, BOTTOM, RIGHT},
+       {0, RIGHT, BOTTOM},
+       {0, TOP, LEFT},
+       {1, RIGHT, BOTTOM},
+       {0, LEFT, TOP}
+};
+
+typedef struct {
+       GLint       WindH, WindW;
+       GLfloat     step;
+       RubikMove  *moves;
+       int         storedmoves;
+       int         degreeTurn;
+       int         shufflingmoves;
+       int         sizex, sizey, sizez;
+       float       avsize, avsizeSq;
+       int         action;
+       int         done;
+       GLfloat     anglestep;
+       RubikLoc   *cubeLoc[MAXFACES];
+       RubikLoc   *rowLoc[MAXORIENT];
+       RubikMove   movement;
+       GLfloat     rotatestep;
+       GLfloat     PX, PY, VX, VY;
+       GLXContext *glx_context;
+       Bool        AreObjectsDefined[MaxObj];
+} rubikstruct;
+
+static float front_shininess[] =
+{60.0};
+static float front_specular[] =
+{0.7, 0.7, 0.7, 1.0};
+static float ambient[] =
+{0.0, 0.0, 0.0, 1.0};
+static float diffuse[] =
+{1.0, 1.0, 1.0, 1.0};
+static float position0[] =
+{1.0, 1.0, 1.0, 0.0};
+static float position1[] =
+{-1.0, -1.0, 1.0, 0.0};
+static float lmodel_ambient[] =
+{0.5, 0.5, 0.5, 1.0};
+static float lmodel_twoside[] =
+{GL_TRUE};
+
+static float MaterialRed[] =
+{0.5, 0.0, 0.0, 1.0};
+static float MaterialGreen[] =
+{0.0, 0.5, 0.0, 1.0};
+static float MaterialBlue[] =
+{0.0, 0.0, 0.5, 1.0};
+static float MaterialYellow[] =
+{0.7, 0.7, 0.0, 1.0};
+static float MaterialOrange[] =
+{0.9, 0.45, 0.36, 1.0};
+
+#if 0
+static float MaterialMagenta[] =
+{0.7, 0.0, 0.7, 1.0};
+static float MaterialCyan[] =
+{0.0, 0.7, 0.7, 1.0};
+
+#endif
+static float MaterialWhite[] =
+{0.8, 0.8, 0.8, 1.0};
+static float MaterialGray[] =
+{0.2, 0.2, 0.2, 1.0};
+static float MaterialGray3[] =
+{0.3, 0.3, 0.3, 1.0};
+static float MaterialGray4[] =
+{0.4, 0.4, 0.4, 1.0};
+static float MaterialGray5[] =
+{0.5, 0.5, 0.5, 1.0};
+static float MaterialGray6[] =
+{0.6, 0.6, 0.6, 1.0};
+static float MaterialGray7[] =
+{0.7, 0.7, 0.7, 1.0};
+
+static rubikstruct *rubik = (rubikstruct *) NULL;
+static GLuint objects = 0;
+
+
+static void
+pickcolor(int C, int mono)
+{
+       switch (C) {
+               case TOP_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray3);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
+                       break;
+               case LEFT_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray6);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialYellow);
+                       break;
+               case FRONT_FACE:
+                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+                       break;
+               case RIGHT_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray4);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGreen);
+                       break;
+               case BOTTOM_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray7);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialOrange);
+                       break;
+               case BACK_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray5);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialBlue);
+                       break;
+#if 0
+                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialCyan);
+                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialMagenta);
+#endif
+       }
+}
+
+static void
+faceSizes(rubikstruct * rp, int face, int * sizeOfRow, int * sizeOfColumn)
+{
+       switch (face) {
+               case 0: /* TOP */
+               case 4: /* BOTTOM */
+                       *sizeOfRow = MAXSIZEX;
+                       *sizeOfColumn = MAXSIZEZ;
+                       break;
+               case 1: /* LEFT */
+               case 3: /* RIGHT */
+                       *sizeOfRow = MAXSIZEZ;
+                       *sizeOfColumn = MAXSIZEY;
+                       break;
+               case 2: /* FRONT */
+               case 5: /* BACK */
+                       *sizeOfRow = MAXSIZEX;
+                       *sizeOfColumn = MAXSIZEY;
+                       break;
+       }
+}
+
+static Bool
+checkFaceSquare(rubikstruct * rp, int face)
+{
+       int sizeOfRow, sizeOfColumn;
+
+       faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+       return (sizeOfRow == sizeOfColumn);
+       /* Cubes can be made square with a 4x2 face where 90 degree turns
+        * should be permitted but that is kind of complicated for me.
+        * This can be done in 2 ways where the side of the cubies are
+        * the same size and one where one side (the side with half the
+        * number of cubies) is twice the size of the other.  The first is
+        * complicated because faces of cubies can go under other faces.
+        * The second way is similar to "banded cubes" where scotch tape
+        * restricts the moves of some cubes.  Here you have to keep track
+        * of the restrictions and show banded cubies graphically as one
+        * cube.
+        */
+}
+
+static int
+sizeFace(rubikstruct * rp, int face)
+{
+       int sizeOfRow, sizeOfColumn;
+
+       faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+       return (sizeOfRow * sizeOfColumn);
+}
+
+static int
+sizeRow(rubikstruct * rp, int face)
+{
+       int sizeOfRow, sizeOfColumn;  /* sizeOfColumn not used */
+
+       faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+       return sizeOfRow;
+}
+
+static Bool
+draw_stickerless_cubit(rubikstruct *rp)
+{
+       if (!rp->AreObjectsDefined[ObjCubit]) {
+               glNewList(objects + ObjCubit, GL_COMPILE_AND_EXECUTE);
+               if (glGetError() != GL_NO_ERROR) {
+                       return False;
+               }
+               glBegin(GL_QUADS);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+               /* Put sticker here */
+               glNormal3f(0.00, 0.00, 1.00);
+               glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+               glNormal3f(0.00, 0.00, -1.00);
+               glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+               glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+               glNormal3f(-1.00, 0.00, 0.00);
+               glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+               glNormal3f(1.00, 0.00, 0.00);
+               glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+               glNormal3f(0.00, -1.00, 0.00);
+               glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+               glNormal3f(0.00, 1.00, 0.00);
+               glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+
+               /* Edges of cubit */
+               glNormal3f(-1.00, -1.00, 0.00);
+               glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+               glNormal3f(1.00, 1.00, 0.00);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+               glNormal3f(-1.00, 1.00, 0.00);
+               glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+               glNormal3f(1.00, -1.00, 0.00);
+               glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+               glNormal3f(0.00, -1.00, -1.00);
+               glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+               glNormal3f(0.00, 1.00, 1.00);
+               glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glNormal3f(0.00, -1.00, 1.00);
+               glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+               glNormal3f(0.00, 1.00, -1.00);
+               glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+               glNormal3f(-1.00, 0.00, -1.00);
+               glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+               glNormal3f(1.00, 0.00, 1.00);
+               glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+               glNormal3f(1.00, 0.00, -1.00);
+               glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+               glNormal3f(-1.00, 0.00, 1.00);
+               glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+               glEnd();
+               glBegin(GL_TRIANGLES);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+               /* Corners of cubit */
+               glNormal3f(1.00, 1.00, 1.00);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glNormal3f(-1.00, -1.00, -1.00);
+               glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+               glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+               glNormal3f(-1.00, 1.00, 1.00);
+               glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+               glNormal3f(1.00, -1.00, -1.00);
+               glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+               glNormal3f(1.00, -1.00, 1.00);
+               glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+               glNormal3f(-1.00, 1.00, -1.00);
+               glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+               glNormal3f(-1.00, -1.00, 1.00);
+               glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+               glNormal3f(1.00, 1.00, -1.00);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+               glEnd();
+               glEndList();
+               rp->AreObjectsDefined[ObjCubit] = True;
+#ifdef DEBUG_LISTS
+               (void) printf("Cubit drawn SLOWLY\n");
+#endif
+       } else {
+               glCallList(objects + ObjCubit);
+#ifdef DEBUG_LISTS
+               (void) printf("Cubit drawn quickly\n");
+#endif
+       }
+       return True;
+}
+
+static Bool
+draw_cubit(ModeInfo * mi,
+          int back, int front, int left, int right, int bottom, int top)
+{
+       rubikstruct *rp = &rubik[MI_SCREEN(mi)];
+       int         mono = MI_IS_MONO(mi);
+
+       if (!draw_stickerless_cubit(rp))
+               return False;
+       if (back != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(back, mono);
+               glNormal3f(0.00, 0.00, -1.00);
+               glVertex3f(-STICKERSHORT, STICKERLONG, -STICKERDEPTH);
+               glVertex3f(STICKERSHORT, STICKERLONG, -STICKERDEPTH);
+               glVertex3f(STICKERLONG, STICKERSHORT, -STICKERDEPTH);
+               glVertex3f(STICKERLONG, -STICKERSHORT, -STICKERDEPTH);
+               glVertex3f(STICKERSHORT, -STICKERLONG, -STICKERDEPTH);
+               glVertex3f(-STICKERSHORT, -STICKERLONG, -STICKERDEPTH);
+               glVertex3f(-STICKERLONG, -STICKERSHORT, -STICKERDEPTH);
+               glVertex3f(-STICKERLONG, STICKERSHORT, -STICKERDEPTH);
+               glEnd();
+       }
+       if (front != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(front, mono);
+               glNormal3f(0.00, 0.00, 1.00);
+               glVertex3f(-STICKERSHORT, -STICKERLONG, STICKERDEPTH);
+               glVertex3f(STICKERSHORT, -STICKERLONG, STICKERDEPTH);
+               glVertex3f(STICKERLONG, -STICKERSHORT, STICKERDEPTH);
+               glVertex3f(STICKERLONG, STICKERSHORT, STICKERDEPTH);
+               glVertex3f(STICKERSHORT, STICKERLONG, STICKERDEPTH);
+               glVertex3f(-STICKERSHORT, STICKERLONG, STICKERDEPTH);
+               glVertex3f(-STICKERLONG, STICKERSHORT, STICKERDEPTH);
+               glVertex3f(-STICKERLONG, -STICKERSHORT, STICKERDEPTH);
+               glEnd();
+       }
+       if (left != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(left, mono);
+               glNormal3f(-1.00, 0.00, 0.00);
+               glVertex3f(-STICKERDEPTH, -STICKERSHORT, STICKERLONG);
+               glVertex3f(-STICKERDEPTH, STICKERSHORT, STICKERLONG);
+               glVertex3f(-STICKERDEPTH, STICKERLONG, STICKERSHORT);
+               glVertex3f(-STICKERDEPTH, STICKERLONG, -STICKERSHORT);
+               glVertex3f(-STICKERDEPTH, STICKERSHORT, -STICKERLONG);
+               glVertex3f(-STICKERDEPTH, -STICKERSHORT, -STICKERLONG);
+               glVertex3f(-STICKERDEPTH, -STICKERLONG, -STICKERSHORT);
+               glVertex3f(-STICKERDEPTH, -STICKERLONG, STICKERSHORT);
+               glEnd();
+       }
+       if (right != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(right, mono);
+               glNormal3f(1.00, 0.00, 0.00);
+               glVertex3f(STICKERDEPTH, -STICKERSHORT, -STICKERLONG);
+               glVertex3f(STICKERDEPTH, STICKERSHORT, -STICKERLONG);
+               glVertex3f(STICKERDEPTH, STICKERLONG, -STICKERSHORT);
+               glVertex3f(STICKERDEPTH, STICKERLONG, STICKERSHORT);
+               glVertex3f(STICKERDEPTH, STICKERSHORT, STICKERLONG);
+               glVertex3f(STICKERDEPTH, -STICKERSHORT, STICKERLONG);
+               glVertex3f(STICKERDEPTH, -STICKERLONG, STICKERSHORT);
+               glVertex3f(STICKERDEPTH, -STICKERLONG, -STICKERSHORT);
+               glEnd();
+       }
+       if (bottom != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(bottom, mono);
+               glNormal3f(0.00, -1.00, 0.00);
+               glVertex3f(STICKERLONG, -STICKERDEPTH, -STICKERSHORT);
+               glVertex3f(STICKERLONG, -STICKERDEPTH, STICKERSHORT);
+               glVertex3f(STICKERSHORT, -STICKERDEPTH, STICKERLONG);
+               glVertex3f(-STICKERSHORT, -STICKERDEPTH, STICKERLONG);
+               glVertex3f(-STICKERLONG, -STICKERDEPTH, STICKERSHORT);
+               glVertex3f(-STICKERLONG, -STICKERDEPTH, -STICKERSHORT);
+               glVertex3f(-STICKERSHORT, -STICKERDEPTH, -STICKERLONG);
+               glVertex3f(STICKERSHORT, -STICKERDEPTH, -STICKERLONG);
+               glEnd();
+       }
+       if (top != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(top, mono);
+               glNormal3f(0.00, 1.00, 0.00);
+               glVertex3f(-STICKERLONG, STICKERDEPTH, -STICKERSHORT);
+               glVertex3f(-STICKERLONG, STICKERDEPTH, STICKERSHORT);
+               glVertex3f(-STICKERSHORT, STICKERDEPTH, STICKERLONG);
+               glVertex3f(STICKERSHORT, STICKERDEPTH, STICKERLONG);
+               glVertex3f(STICKERLONG, STICKERDEPTH, STICKERSHORT);
+               glVertex3f(STICKERLONG, STICKERDEPTH, -STICKERSHORT);
+               glVertex3f(STICKERSHORT, STICKERDEPTH, -STICKERLONG);
+               glVertex3f(-STICKERSHORT, STICKERDEPTH, -STICKERLONG);
+               glEnd();
+       }
+       return True;
+}
+
+/* Convert move to weird general notation */
+static void
+convertMove(rubikstruct * rp, RubikMove move, RubikSlice * slice)
+{
+       RubikLoc    plane;
+       int         sizeOfRow, sizeOfColumn;
+
+       plane = rotateSlice[(int) move.face][move.direction % 2];
+       (*slice).face = plane.face;
+       (*slice).rotation = plane.rotation;
+
+       faceSizes(rp, move.face, &sizeOfRow, &sizeOfColumn);
+       if (plane.face == 1 || /* VERTICAL */
+           (plane.face == 2 && (move.face == 1 || move.face == 3))) {
+               if ((*slice).rotation == CW)
+                       (*slice).depth = sizeOfRow - 1 - move.position %
+                               sizeOfRow;
+               else
+                       (*slice).depth = move.position % sizeOfRow;
+       } else { /* (plane.face == 0 ||  *//* HORIZONTAL *//*
+               (plane.face == 2 && (move.face == 0 || move.face == 4))) */
+               if ((*slice).rotation == CW)
+                       (*slice).depth = sizeOfColumn - 1 - move.position /
+                               sizeOfRow;
+               else
+                       (*slice).depth = move.position / sizeOfRow;
+       }
+       /* If (*slice).depth = 0 then face 0, face 1, or face 2 moves */
+       if (move.direction / 2)
+               (*slice).rotation = ((*slice).rotation == CW) ? CCW : CW;
+}
+
+/* Assume the size is at least 2, or its just not challenging... */
+static Bool
+draw_cube(ModeInfo * mi)
+{
+#define S1 1
+#define SX ((GLint)S1*(MAXSIZEX-1))
+#define SY ((GLint)S1*(MAXSIZEY-1))
+#define SZ ((GLint)S1*(MAXSIZEZ-1))
+#define HALFX (((GLfloat)MAXSIZEX-1.0)/2.0)
+#define HALFY (((GLfloat)MAXSIZEY-1.0)/2.0)
+#define HALFZ (((GLfloat)MAXSIZEZ-1.0)/2.0)
+#define MIDX(a) (((GLfloat)(2*a-MAXSIZEX+1))/2.0)
+#define MIDY(a) (((GLfloat)(2*a-MAXSIZEY+1))/2.0)
+#define MIDZ(a) (((GLfloat)(2*a-MAXSIZEZ+1))/2.0)
+#define DRAW_CUBIT(mi,b,f,l,r,bm,t) if (!draw_cubit(mi,b,f,l,r,bm,t)) return False
+       rubikstruct *rp = &rubik[MI_SCREEN(mi)];
+       RubikSlice  slice;
+       GLfloat     rotatestep;
+       int         i, j, k;
+
+       if (rp->movement.face == NO_FACE) {
+               slice.face = NO_FACE;
+               slice.rotation = NO_ROTATION;
+               slice.depth = NO_DEPTH;
+       } else {
+               convertMove(rp, rp->movement, &slice);
+       }
+       rotatestep = (slice.rotation == CCW) ? rp->rotatestep : -rp->rotatestep;
+
+
+/*-
+ * The glRotatef() routine transforms the coordinate system for every future
+ * vertex specification (this is not so simple, but by now comprehending this
+ * is sufficient). So if you want to rotate the inner slice, you can draw
+ * one slice, rotate the anglestep for the centerslice, draw the inner slice,
+ * rotate reversely and draw the other slice.
+ * There is a sequence for drawing cubies for each axis being moved...
+ */
+       switch (slice.face) {
+               case NO_FACE:
+               case TOP_FACE:  /* BOTTOM_FACE too */
+                       glPushMatrix();
+                       if (slice.depth == MAXSIZEY - 1)
+                               glRotatef(rotatestep, 0, HALFY, 0);
+
+                       glTranslatef(-HALFX, -HALFY, -HALFZ);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                  rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * LASTZ].face, NO_FACE);
+                       for (k = 1; k < MAXSIZEZ - 1; k++) {
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * LASTY].face, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                       }
+                       glTranslatef(0, 0, S1);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * LASTY].face,
+                                  rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       for (i = 1; i < MAXSIZEX - 1; i++) {
+                               glTranslatef(S1, 0, -SZ);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][i + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * LASTZ].face, NO_FACE);
+                               for (k = 1; k < MAXSIZEZ - 1; k++) {
+                                       glTranslatef(0, 0, S1);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                               }
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * LASTY].face,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       }
+                       glTranslatef(S1, 0, -SZ);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * LASTY].face,
+                                  rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * LASTZ].face, NO_FACE);
+                       for (k = 1; k < MAXSIZEZ - 1; k++) {
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * LASTY].face,
+                                          rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                       }
+                       glTranslatef(0, 0, S1);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * LASTY].face,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * LASTY].face,
+                                  rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       glPopMatrix();
+                       for (j = 1; j < MAXSIZEY - 1; j++) {
+                               glPushMatrix();
+                               if (slice.depth == REVY(j))
+                                       glRotatef(rotatestep, 0, HALFY, 0);
+                               glTranslatef(-HALFX, MIDY(j), -HALFZ);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * j].face, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                          NO_FACE, NO_FACE);
+                               for (k = 1; k < MAXSIZEZ - 1; k++) {
+                                       glTranslatef(0, 0, S1);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * REVY(j)].face,
+                                          rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                          NO_FACE, NO_FACE);
+                               for (i = 1; i < MAXSIZEX - 1; i++) {
+                                       glTranslatef(1, 0, -SZ);
+                                       DRAW_CUBIT(mi,
+                                                  rp->cubeLoc[BACK_FACE][i + MAXSIZEX * j].face, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                                       /* Center */
+                                       glTranslatef(0, 0, SZ);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * REVY(j)].face,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(S1, 0, -SZ);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * j].face, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * REVY(j)].face,
+                                          NO_FACE, NO_FACE);
+                               for (k = 1; k < MAXSIZEZ - 1; k++) {
+                                       glTranslatef(0, 0, S1);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * REVY(j)].face,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * REVY(j)].face,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * REVY(j)].face,
+                                          NO_FACE, NO_FACE);
+                               glPopMatrix();
+                       }
+                       if (slice.depth == 0)
+                               glRotatef(rotatestep, 0, HALFY, 0);
+
+                       glTranslatef(-HALFX, HALFY, -HALFZ);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * FIRSTZ].face);
+                       for (k = 1; k < MAXSIZEZ - 1; k++) {
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * k].face);
+                       }
+                       glTranslatef(0, 0, S1);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * FIRSTY].face,
+                                  rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * LASTZ].face);
+                       for (i = 1; i < MAXSIZEX - 1; i++) {
+                               glTranslatef(S1, 0, -SZ);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][i + MAXSIZEX * LASTY].face, NO_FACE,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * FIRSTZ].face);
+                               for (k = 1; k < MAXSIZEZ - 1; k++) {
+                                       glTranslatef(0, 0, S1);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * k].face);
+                               }
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * FIRSTY].face,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * LASTZ].face);
+                       }
+                       glTranslatef(S1, 0, -SZ);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * LASTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * FIRSTZ].face);
+                       for (k = 1; k < MAXSIZEZ - 1; k++) {
+                               glTranslatef(0, 0, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * FIRSTY].face,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * k].face);
+                       }
+                       glTranslatef(0, 0, S1);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * LASTZ].face);
+                       break;
+               case LEFT_FACE: /* RIGHT_FACE too */
+                       /* rotatestep is negative because the RIGHT face is the default here */
+                       glPushMatrix();
+                       if (slice.depth == 0)
+                               glRotatef(-rotatestep, HALFX, 0, 0);
+
+                       glTranslatef(-HALFX, -HALFY, -HALFZ);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                  rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * LASTZ].face, NO_FACE);
+                       for (j = 1; j < MAXSIZEY - 1; j++) {
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * j].face, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                          NO_FACE, NO_FACE);
+                       }
+                       glTranslatef(0, S1, 0);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * FIRSTZ].face);
+                       for (k = 1; k < MAXSIZEZ - 1; k++) {
+                               glTranslatef(0, -SY, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * LASTY].face, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                               for (j = 1; j < MAXSIZEY - 1; j++) {
+                                       glTranslatef(0, S1, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * k].face);
+                       }
+                       glTranslatef(0, -SY, S1);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * LASTY].face,
+                                  rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       for (j = 1; j < MAXSIZEY - 1; j++) {
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * REVY(j)].face,
+                                          rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                          NO_FACE, NO_FACE);
+                       }
+                       glTranslatef(0, S1, 0);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * FIRSTY].face,
+                                  rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * LASTZ].face);
+                       glPopMatrix();
+                       for (i = 1; i < MAXSIZEX - 1; i++) {
+                               glPushMatrix();
+                               if (slice.depth == i)
+                                       glRotatef(-rotatestep, HALFX, 0, 0);
+                               glTranslatef(MIDX(i), -HALFY, -HALFZ);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][i + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * LASTZ].face, NO_FACE);
+                               for (j = 1; j < MAXSIZEY - 1; j++) {
+                                       glTranslatef(0, S1, 0);
+                                       DRAW_CUBIT(mi,
+                                                  rp->cubeLoc[BACK_FACE][i + MAXSIZEX * j].face, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][i + MAXSIZEX * LASTY].face, NO_FACE,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * FIRSTZ].face);
+                               for (k = 1; k < MAXSIZEZ - 1; k++) {
+                                       glTranslatef(0, -SY, S1);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                                       /* Center */
+                                       glTranslatef(0, SY, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * k].face);
+                               }
+                               glTranslatef(0, -SY, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * LASTY].face,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                               for (j = 1; j < MAXSIZEY - 1; j++) {
+                                       glTranslatef(0, S1, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * REVY(j)].face,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * FIRSTY].face,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * LASTZ].face);
+                               glPopMatrix();
+                       }
+                       if (slice.depth == MAXSIZEX - 1)
+                               glRotatef(-rotatestep, HALFX, 0, 0);
+                       glTranslatef(HALFX, -HALFY, -HALFZ);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * LASTY].face,
+                                  rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * LASTZ].face, NO_FACE);
+                       for (j = 1; j < MAXSIZEY - 1; j++) {
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * j].face, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * REVY(j)].face,
+                                          NO_FACE, NO_FACE);
+                       }
+                       glTranslatef(0, S1, 0);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * LASTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * FIRSTZ].face);
+                       for (k = 1; k < MAXSIZEZ - 1; k++) {
+                               glTranslatef(0, -SY, S1);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * LASTY].face,
+                                          rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                               for (j = 1; j < MAXSIZEY - 1; j++) {
+                                       glTranslatef(0, S1, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * REVY(j)].face,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * FIRSTY].face,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * k].face);
+                       }
+                       glTranslatef(0, -SY, S1);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * LASTY].face,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * LASTY].face,
+                                  rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       for (j = 1; j < MAXSIZEY - 1; j++) {
+                               glTranslatef(0, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * REVY(j)].face,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * REVY(j)].face,
+                                          NO_FACE, NO_FACE);
+                       }
+                       glTranslatef(0, S1, 0);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * LASTZ].face);
+                       break;
+               case FRONT_FACE:        /* BACK_FACE too */
+                       glPushMatrix();
+                       if (slice.depth == MAXSIZEZ - 1)
+                               glRotatef(rotatestep, 0, 0, HALFZ);
+
+                       glTranslatef(-HALFX, -HALFY, -HALFZ);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                  rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * LASTZ].face, NO_FACE);
+                       for (i = 1; i < MAXSIZEX - 1; i++) {
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][i + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * LASTZ].face, NO_FACE);
+                       }
+                       glTranslatef(S1, 0, 0);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * LASTY].face,
+                                  rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * LASTZ].face, NO_FACE);
+                       for (j = 1; j < MAXSIZEY - 1; j++) {
+                               glTranslatef(-SX, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * j].face, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                          NO_FACE, NO_FACE);
+                               for (i = 1; i < MAXSIZEX - 1; i++) {
+                                       glTranslatef(S1, 0, 0);
+                                       DRAW_CUBIT(mi,
+                                                  rp->cubeLoc[BACK_FACE][i + MAXSIZEX * j].face, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * j].face, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * REVY(j)].face,
+                                          NO_FACE, NO_FACE);
+                       }
+                       glTranslatef(-SX, S1, 0);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][FIRSTX + MAXSIZEX * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[LEFT_FACE][FIRSTZ + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * FIRSTZ].face);
+                       for (i = 1; i < MAXSIZEX - 1; i++) {
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          rp->cubeLoc[BACK_FACE][i + MAXSIZEX * LASTY].face, NO_FACE,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * FIRSTZ].face);
+                       }
+                       glTranslatef(S1, 0, 0);
+                       DRAW_CUBIT(mi,
+                                  rp->cubeLoc[BACK_FACE][LASTX + MAXSIZEX * LASTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][LASTZ + MAXSIZEZ * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * FIRSTZ].face);
+                       glPopMatrix();
+                       for (k = 1; k < MAXSIZEZ - 1; k++) {
+                               glPushMatrix();
+                               if (slice.depth == REVZ(k))
+                                       glRotatef(rotatestep, 0, 0, HALFZ);
+                               glTranslatef(-HALFX, -HALFY, MIDZ(k));
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * LASTY].face, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                               for (i = 1; i < MAXSIZEX - 1; i++) {
+                                       glTranslatef(S1, 0, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                               }
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * LASTY].face,
+                                          rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * REVZ(k)].face, NO_FACE);
+                               for (j = 1; j < MAXSIZEY - 1; j++) {
+                                       glTranslatef(-SX, S1, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                                       /* Center */
+                                       glTranslatef(SX, 0, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * REVY(j)].face,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(-SX, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[LEFT_FACE][k + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * k].face);
+                               for (i = 1; i < MAXSIZEX - 1; i++) {
+                                       glTranslatef(S1, 0, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * k].face);
+                               }
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][REVZ(k) + MAXSIZEZ * FIRSTY].face,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * k].face);
+                               glPopMatrix();
+                       }
+                       if (slice.depth == 0)
+                               glRotatef(rotatestep, 0, 0, HALFZ);
+                       glTranslatef(-HALFX, -HALFY, HALFZ);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * LASTY].face,
+                                  rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * LASTY].face, NO_FACE,
+                                  rp->cubeLoc[BOTTOM_FACE][FIRSTX + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       for (i = 1; i < MAXSIZEX - 1; i++) {
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * LASTY].face,
+                                          NO_FACE, NO_FACE,
+                                          rp->cubeLoc[BOTTOM_FACE][i + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       }
+                       glTranslatef(S1, 0, 0);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * LASTY].face,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * LASTY].face,
+                                  rp->cubeLoc[BOTTOM_FACE][LASTX + MAXSIZEX * FIRSTZ].face, NO_FACE);
+                       for (j = 1; j < MAXSIZEY - 1; j++) {
+                               glTranslatef(-SX, S1, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * REVY(j)].face,
+                                          rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * REVY(j)].face, NO_FACE,
+                                          NO_FACE, NO_FACE);
+                               for (i = 1; i < MAXSIZEX - 1; i++) {
+                                       glTranslatef(S1, 0, 0);
+                                       DRAW_CUBIT(mi,
+                                                  NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * REVY(j)].face,
+                                                  NO_FACE, NO_FACE,
+                                                  NO_FACE, NO_FACE);
+                               }
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * REVY(j)].face,
+                                          NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * REVY(j)].face,
+                                          NO_FACE, NO_FACE);
+                       }
+                       glTranslatef(-SX, S1, 0);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][FIRSTX + MAXSIZEX * FIRSTY].face,
+                                  rp->cubeLoc[LEFT_FACE][LASTZ + MAXSIZEZ * FIRSTY].face, NO_FACE,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][FIRSTX + MAXSIZEX * LASTZ].face);
+                       for (i = 1; i < MAXSIZEX - 1; i++) {
+                               glTranslatef(S1, 0, 0);
+                               DRAW_CUBIT(mi,
+                                          NO_FACE, rp->cubeLoc[FRONT_FACE][i + MAXSIZEX * FIRSTY].face,
+                                          NO_FACE, NO_FACE,
+                                          NO_FACE, rp->cubeLoc[TOP_FACE][i + MAXSIZEX * LASTZ].face);
+                       }
+                       glTranslatef(S1, 0, 0);
+                       DRAW_CUBIT(mi,
+                                  NO_FACE, rp->cubeLoc[FRONT_FACE][LASTX + MAXSIZEX * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[RIGHT_FACE][FIRSTZ + MAXSIZEZ * FIRSTY].face,
+                                  NO_FACE, rp->cubeLoc[TOP_FACE][LASTX + MAXSIZEX * LASTZ].face);
+                       break;
+       }
+       return True;
+#undef S1
+}
+
+/* From David Bagley's xrubik.  Used by permission. ;)  */
+static void
+readRC(rubikstruct * rp, int face, int dir, int h, int orient, int size)
+{
+       int         g, sizeOfRow;
+
+       sizeOfRow = sizeRow(rp, face);
+       if (dir == TOP || dir == BOTTOM)
+               for (g = 0; g < size; g++)
+                       rp->rowLoc[orient][g] =
+                               rp->cubeLoc[face][g * sizeOfRow + h];
+       else                    /* dir == RIGHT || dir == LEFT */
+               for (g = 0; g < size; g++)
+                       rp->rowLoc[orient][g] =
+                               rp->cubeLoc[face][h * sizeOfRow + g];
+}
+
+static void
+rotateRC(rubikstruct * rp, int rotate, int orient, int size)
+{
+       int         g;
+
+       for (g = 0; g < size; g++)
+               rp->rowLoc[orient][g].rotation =
+                       (rp->rowLoc[orient][g].rotation + rotate) % MAXORIENT;
+}
+
+static void
+reverseRC(rubikstruct * rp, int orient, int size)
+{
+       int         g;
+       RubikLoc    temp;
+
+       for (g = 0; g < size / 2; g++) {
+               temp = rp->rowLoc[orient][size - 1 - g];
+               rp->rowLoc[orient][size - 1 - g] = rp->rowLoc[orient][g];
+               rp->rowLoc[orient][g] = temp;
+       }
+}
+
+static void
+writeRC(rubikstruct * rp, int face, int dir, int h, int orient, int size)
+{
+       int         g, position, sizeOfRow;
+
+       sizeOfRow = sizeRow(rp, face);
+       if (dir == TOP || dir == BOTTOM) {
+               for (g = 0; g < size; g++) {
+                       position = g * sizeOfRow + h;
+                       rp->cubeLoc[face][position] = rp->rowLoc[orient][g];
+                       /* DrawSquare(face, position); */
+               }
+       } else {                /* dir == RIGHT || dir == LEFT */
+               for (g = 0; g < size; g++) {
+                       position = h * sizeOfRow + g;
+                       rp->cubeLoc[face][position] = rp->rowLoc[orient][g];
+                       /* DrawSquare(face, position); */
+               }
+       }
+}
+
+static Bool
+rotateFace(rubikstruct * rp, int face, int direction)
+{
+       int         position, i, j, sizeOfRow, sizeOfColumn, sizeOnPlane;
+       RubikLoc   *faceLoc;
+
+       faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+       sizeOnPlane = sizeOfRow * sizeOfColumn;
+       if ((faceLoc = (RubikLoc *) malloc(sizeOnPlane *
+                       sizeof (RubikLoc))) == NULL) {
+               return False;
+       }
+       /* Read Face */
+       for (position = 0; position < sizeOnPlane; position++)
+               faceLoc[position] = rp->cubeLoc[face][position];
+       /* Write Face */
+       for (position = 0; position < sizeOnPlane; position++) {
+               i = position % sizeOfRow;
+               j = position / sizeOfRow;
+               if (direction == CW)
+                       rp->cubeLoc[face][position] =
+                               faceLoc[(sizeOfRow - i - 1) * sizeOfRow + j];
+               else if (direction == CCW)
+                       rp->cubeLoc[face][position] =
+                               faceLoc[i * sizeOfRow + sizeOfColumn - j - 1];
+               else /* (direction == HALF) */
+                       rp->cubeLoc[face][position] =
+                               faceLoc[sizeOfRow - i - 1 + (sizeOfColumn - j - 1) * sizeOfRow];
+               rp->cubeLoc[face][position].rotation =
+                       (rp->cubeLoc[face][position].rotation +
+                               direction - MAXORIENT) % MAXORIENT;
+               /* DrawSquare(face, position); */
+       }
+       if (faceLoc != NULL)
+               (void) free((void *) faceLoc);
+       return True;
+}
+
+/* Yeah this is big and ugly */
+static void
+slideRC(int face, int direction, int h, int sizeOnOppAxis,
+       int *newFace, int *newDirection, int *newH,
+       int *rotate, Bool *reverse)
+{
+       *newFace = slideNextRow[face][direction].face;
+       *rotate = slideNextRow[face][direction].rotation;
+       *newDirection = (*rotate + direction) % MAXORIENT;
+       switch (*rotate) {
+               case TOP:
+                       *newH = h;
+                       *reverse = False;
+                       break;
+               case RIGHT:
+                       if (*newDirection == TOP || *newDirection == BOTTOM) {
+                               *newH = sizeOnOppAxis - 1 - h;
+                               *reverse = False;
+                       } else {        /* *newDirection == RIGHT || *newDirection == LEFT */
+                               *newH = h;
+                               *reverse = True;
+                       }
+                               break;
+               case BOTTOM:
+                       *newH = sizeOnOppAxis - 1 - h;
+                       *reverse = True;
+                       break;
+               case LEFT:
+                       if (*newDirection == TOP || *newDirection == BOTTOM) {
+                               *newH = h;
+                               *reverse = True;
+                       } else {        /* *newDirection == RIGHT || *newDirection == LEFT */
+                               *newH = sizeOnOppAxis - 1 - h;
+                               *reverse = False;
+                       }
+                       break;
+               default:
+                       (void) printf("slideRC: rotate %d\n", *rotate);
+                       *newH = 0;
+                       *reverse = False;
+       }
+}
+
+static Bool
+moveRubik(rubikstruct * rp, int face, int direction, int position)
+{
+       int         newFace, newDirection, rotate, reverse; 
+       int         h, k, newH;
+       int         i, j, sizeOfRow, sizeOfColumn, sizeOnAxis, sizeOnOppAxis;
+
+       faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+       if (direction == CW || direction == CCW) {
+               direction = (direction == CCW) ?
+                       (rotateToRow[face].direction + 2) % MAXORIENT :
+                       rotateToRow[face].direction;
+               if (rotateToRow[face].sideFace == RIGHT) {
+                       i = j = sizeOfColumn - 1;
+               } else if (rotateToRow[face].sideFace == BOTTOM) {
+                       i = j = sizeOfRow - 1;
+               } else {
+                       i = j = 0;
+               }
+               face = rotateToRow[face].face;
+               position = j * sizeOfRow + i;
+       }
+       i = position % sizeOfRow;
+       j = position / sizeOfRow;
+       h = (direction == TOP || direction == BOTTOM) ? i : j;
+       if (direction == TOP || direction == BOTTOM) {
+               sizeOnAxis = sizeOfColumn;
+               sizeOnOppAxis = sizeOfRow;
+       } else {
+               sizeOnAxis = sizeOfRow;
+               sizeOnOppAxis = sizeOfColumn;
+       }
+       /* rotate sides CW or CCW or HALF) */
+
+       if (h == sizeOnOppAxis - 1) {
+               newDirection = (direction == TOP || direction == BOTTOM) ?
+                       TOP : RIGHT;
+               if (rp->degreeTurn == 180) {
+                       if (!rotateFace(rp, rowToRotate[face][newDirection], HALF))
+                               return False;
+               } else if (direction == TOP || direction == RIGHT) {
+                       if (!rotateFace(rp, rowToRotate[face][newDirection], CW))
+                               return False;
+               } else {                /* direction == BOTTOM || direction == LEFT */
+                       if (!rotateFace(rp, rowToRotate[face][newDirection], CCW))
+                               return False;
+               }
+       }
+       if (h == 0) {
+               newDirection = (direction == TOP || direction == BOTTOM) ?
+                       BOTTOM : LEFT;
+               if (rp->degreeTurn == 180) {
+                       if (!rotateFace(rp, rowToRotate[face][newDirection], HALF))
+                               return False;
+               } else if (direction == TOP || direction == RIGHT) {
+                       if (!rotateFace(rp, rowToRotate[face][newDirection], CCW))
+                               return False;
+               } else {                /* direction == BOTTOM  || direction == LEFT */
+                       if (!rotateFace(rp, rowToRotate[face][newDirection], CW))
+                               return False;
+               }
+       }
+       /* Slide rows or columns */
+       readRC(rp, face, direction, h, 0, sizeOnAxis);
+       if (rp->degreeTurn == 180) {
+               int sizeOnDepthAxis;
+
+               slideRC(face, direction, h, sizeOnOppAxis,
+                       &newFace, &newDirection, &newH, &rotate, &reverse);
+               sizeOnDepthAxis = sizeFace(rp, newFace) / sizeOnOppAxis;
+               readRC(rp, newFace, newDirection, newH, 1, sizeOnDepthAxis);
+               rotateRC(rp, rotate, 0, sizeOnAxis);
+               if (reverse == True)
+                       reverseRC(rp, 0, sizeOnAxis);
+               face = newFace;
+               direction = newDirection;
+               h = newH;
+               for (k = 2; k <= MAXORIENT + 1; k++) {
+                       slideRC(face, direction, h, sizeOnOppAxis,
+                               &newFace, &newDirection, &newH, &rotate, &reverse);
+                       if (k != MAXORIENT && k != MAXORIENT + 1)
+                               readRC(rp, newFace, newDirection, newH, k,
+                                       (k % 2) ? sizeOnDepthAxis : sizeOnAxis);
+                       rotateRC(rp, rotate, k - 2,
+                                       (k % 2) ? sizeOnDepthAxis : sizeOnAxis);
+                       if (k != MAXORIENT + 1)
+                               rotateRC(rp, rotate, k - 1,
+                                       (k % 2) ? sizeOnAxis : sizeOnDepthAxis);
+                       if (reverse == True) {
+                               reverseRC(rp, k - 2,
+                                       (k % 2) ? sizeOnDepthAxis : sizeOnAxis);
+                               if (k != MAXORIENT + 1)
+                                       reverseRC(rp, k - 1,
+                                               (k % 2) ? sizeOnAxis : sizeOnDepthAxis);
+                       }
+                       writeRC(rp, newFace, newDirection, newH, k - 2,
+                               (k % 2) ? sizeOnDepthAxis : sizeOnAxis);
+                       face = newFace;
+                       direction = newDirection;
+                       h = newH;
+               }
+       } else {
+               for (k = 1; k <= MAXORIENT; k++) {
+                       slideRC(face, direction, h, sizeOnOppAxis,
+                               &newFace, &newDirection, &newH, &rotate, &reverse);
+                       if (k != MAXORIENT)
+                               readRC(rp, newFace, newDirection, newH, k, sizeOnAxis);
+                       rotateRC(rp, rotate, k - 1, sizeOnAxis);
+                       if (reverse == True)
+                               reverseRC(rp, k - 1, sizeOnAxis);
+                       writeRC(rp, newFace, newDirection, newH, k - 1, sizeOnAxis);
+                       face = newFace;
+                       direction = newDirection;
+                       h = newH;
+               }
+       }       
+       return True;
+}
+
+#ifdef DEBUG
+void
+printCube(rubikstruct * rp)
+{
+       int         face, position, sizeOfRow, sizeOfColumn;
+
+       for (face = 0; face < MAXFACES; face++) {
+               faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+               for (position = 0; position < sizeOfRow * sizeOfColumn; position++) {
+                       (void) printf("%d %d  ", rp->cubeLoc[face][position].face,
+                                     rp->cubeLoc[face][position].rotation);
+                       if (!((position + 1) % sizeOfRow))
+                               (void) printf("\n");
+               }
+               (void) printf("\n");
+       }
+       (void) printf("\n");
+}
+
+#endif
+
+static Bool
+evalmovement(ModeInfo * mi, RubikMove movement)
+{
+       rubikstruct *rp = &rubik[MI_SCREEN(mi)];
+
+#ifdef DEBUG
+       printCube(rp);
+#endif
+       if (movement.face < 0 || movement.face >= MAXFACES)
+               return True;
+       if (!moveRubik(rp, movement.face, movement.direction, movement.position))
+               return False;
+       return True;
+}
+
+static      Bool
+compare_moves(rubikstruct * rp, RubikMove move1, RubikMove move2, Bool opp)
+{
+       RubikSlice  slice1, slice2;
+
+       convertMove(rp, move1, &slice1);
+       convertMove(rp, move2, &slice2);
+       if (slice1.face == slice2.face &&
+           slice1.depth == slice2.depth) {
+               if (slice1.rotation == slice2.rotation) {       /* CW or CCW */
+                       if (!opp)
+                               return True;
+               } else {
+                       if (opp)
+                               return True;
+               }
+       }
+       return False;
+}
+
+static Bool
+shuffle(ModeInfo * mi)
+{
+       rubikstruct *rp = &rubik[MI_SCREEN(mi)];
+       int         i, face, position;
+       RubikMove   move;
+
+       if (sizex)
+               i = sizex;
+       else
+               i = MI_SIZE(mi);
+       if (i < -MINSIZE)
+               i = NRAND(-i - MINSIZE + 1) + MINSIZE;
+       else if (i < MINSIZE)
+               i = MINSIZE;
+
+       if (LRAND() % 2 && !sizey && !sizez) { /* Make normal (NxNxN) cubes more likely */
+               MAXSIZEX = MAXSIZEY = MAXSIZEZ = i;
+       } else {
+               MAXSIZEX = i;
+               if (sizey)
+                       i = sizey;
+               else
+                       i = MI_SIZE(mi);
+               if (i < -MINSIZE)
+                       i = NRAND(-i - MINSIZE + 1) + MINSIZE;
+               else if (i < MINSIZE)
+                       i = MINSIZE;
+               if (LRAND() % 2 && !sizez) { /* Make more MxNxN more likely than LxMxN */
+                       MAXSIZEY = MAXSIZEZ = i;
+               } else {
+                       MAXSIZEY = i;
+                       if (sizez)
+                               i = sizez;
+                       else
+                               i = MI_SIZE(mi);
+                       if (i < -MINSIZE)
+                               i = NRAND(-i - MINSIZE + 1) + MINSIZE;
+                       else if (i < MINSIZE)
+                               i = MINSIZE;
+                       MAXSIZEZ = i;
+               }
+       }
+
+       for (face = 0; face < MAXFACES; face++) {
+               if (rp->cubeLoc[face] != NULL)
+                       (void) free((void *) rp->cubeLoc[face]);
+               if ((rp->cubeLoc[face] = (RubikLoc *) malloc(sizeFace(rp, face) *
+                               sizeof (RubikLoc))) == NULL) {
+                       return False;
+               }
+               for (position = 0; position < sizeFace(rp, face); position++) {
+                       rp->cubeLoc[face][position].face = face;
+                       rp->cubeLoc[face][position].rotation = TOP;
+               }
+       }
+       for (i = 0; i < MAXORIENT; i++) {
+               if (rp->rowLoc[i] != NULL)
+                       (void) free((void *) rp->rowLoc[i]);
+               /* The following is reused so make it the biggest size */
+               if ((rp->rowLoc[i] = (RubikLoc *) malloc(MAXMAXSIZE *
+                               sizeof (RubikLoc))) == NULL) {
+                       return False;
+               }
+       }
+       rp->storedmoves = MI_COUNT(mi);
+       if (rp->storedmoves < 0) {
+               if (rp->moves != NULL)
+                       (void) free((void *) rp->moves);
+               rp->moves = (RubikMove *) NULL;
+               rp->storedmoves = NRAND(-rp->storedmoves) + 1;
+       }
+       if ((rp->storedmoves) && (rp->moves == NULL))
+               if ((rp->moves = (RubikMove *) calloc(rp->storedmoves + 1,
+                                sizeof (RubikMove))) == NULL) {
+                       return False;
+               }
+       if (MI_CYCLES(mi) <= 1) {
+               rp->anglestep = 90.0;
+       } else {
+               rp->anglestep = 90.0 / (GLfloat) (MI_CYCLES(mi));
+       }
+
+       for (i = 0; i < rp->storedmoves; i++) {
+               Bool condition;
+
+               do {
+                       move.face = NRAND(MAXFACES);
+                       move.direction = NRAND(MAXORIENT);      /* Exclude CW and CCW, its ok */
+                       move.position = NRAND(sizeFace(rp, move.face));
+                       rp->degreeTurn = (checkFaceSquare(rp,
+                               rowToRotate[move.face][move.direction])) ? 90 : 180;
+                       condition = True;
+                       if (i > 0) {    /* avoid immediate undoing moves */
+                               if (compare_moves(rp, move, rp->moves[i - 1], True))
+                                       condition = False;
+                               if (rp->degreeTurn == 180 &&
+                                   compare_moves(rp, move, rp->moves[i - 1], False))
+                                       condition = False;
+                       }
+                       if (i > 1)      /* avoid 3 consecutive identical moves */
+                               if (compare_moves(rp, move, rp->moves[i - 1], False) &&
+                                   compare_moves(rp, move, rp->moves[i - 2], False))
+                                       condition = False;
+                       /*
+                        * Still some silly moves being made....
+                        */
+               } while (!condition);
+               if (hideshuffling)
+                       if (!evalmovement(mi, move))
+                               return False;
+               rp->moves[i] = move;
+       }
+       rp->VX = 0.05;
+       if (NRAND(100) < 50)
+               rp->VX *= -1;
+       rp->VY = 0.05;
+       if (NRAND(100) < 50)
+               rp->VY *= -1;
+       rp->movement.face = NO_FACE;
+       rp->rotatestep = 0;
+       rp->action = hideshuffling ? ACTION_SOLVE : ACTION_SHUFFLE;
+       rp->shufflingmoves = 0;
+       rp->done = 0;
+       return True;
+}
+
+static void
+reshape(ModeInfo * mi, int width, int height)
+{
+       rubikstruct *rp = &rubik[MI_SCREEN(mi)];
+
+       glViewport(0, 0, rp->WindW = (GLint) width, rp->WindH = (GLint) height);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
+       glMatrixMode(GL_MODELVIEW);
+
+       rp->AreObjectsDefined[ObjCubit] = False;
+}
+
+static Bool
+pinit(ModeInfo * mi)
+{
+       glClearDepth(1.0);
+       glClearColor(0.0, 0.0, 0.0, 1.0);
+       glColor3f(1.0, 1.0, 1.0);
+
+       glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT0, GL_POSITION, position0);
+       glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT1, GL_POSITION, position1);
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+       glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_DEPTH_TEST);
+       glEnable(GL_NORMALIZE);
+       glEnable(GL_CULL_FACE);
+
+       glShadeModel(GL_FLAT);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
+
+       return (shuffle(mi));
+}
+
+static void
+free_rubik(rubikstruct *rp)
+{
+       int         i;
+
+       for (i = 0; i < MAXFACES; i++)
+               if (rp->cubeLoc[i] != NULL) {
+                       (void) free((void *) rp->cubeLoc[i]);
+                       rp->cubeLoc[i] = (RubikLoc *) NULL;
+               }
+       for (i = 0; i < MAXORIENT; i++)
+               if (rp->rowLoc[i] != NULL) {
+                       (void) free((void *) rp->rowLoc[i]);
+                       rp->rowLoc[i] = (RubikLoc *) NULL;
+               }
+       if (rp->moves != NULL) {
+               (void) free((void *) rp->moves);
+               rp->moves = (RubikMove *) NULL;
+       }
+}
+
+void
+release_rubik(ModeInfo * mi)
+{
+       if (rubik != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       rubikstruct *rp = &rubik[screen];
+
+                       free_rubik(rp);
+                       if (rp->glx_context) {
+                               if (glIsList(objects)) {
+                                       glDeleteLists(objects, MaxObj);
+                                       objects = 0;
+                               }
+                       }
+               }
+               (void) free((void *) rubik);
+               rubik = (rubikstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+void
+init_rubik(ModeInfo * mi)
+{
+       rubikstruct *rp;
+
+       if (rubik == NULL) {
+               if ((rubik = (rubikstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (rubikstruct))) == NULL)
+                       return;
+       }
+       rp = &rubik[MI_SCREEN(mi)];
+       rp->step = NRAND(90);
+       rp->PX = ((float) LRAND() / (float) MAXRAND) * 2.0 - 1.0;
+       rp->PY = ((float) LRAND() / (float) MAXRAND) * 2.0 - 1.0;
+
+       if ((rp->glx_context = init_GL(mi)) != NULL) {
+
+               reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               glDrawBuffer(GL_BACK);
+               if (!glIsList(objects))
+                       if ((objects = glGenLists(MaxObj)) == 0) {
+                               MI_CLEARWINDOW(mi);
+                               release_rubik(mi);
+                               return;
+                       }
+               if (!pinit(mi)) {
+                       free_rubik(rp);
+                       if (MI_IS_VERBOSE(mi)) {
+                               (void) fprintf(stderr,
+                                       "Could not allocate memory for rubik\n");
+                       }
+                       return;
+               }
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_rubik(ModeInfo * mi)
+{
+       Bool bounced = False;
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       rubikstruct *rp;
+
+       if (rubik == NULL)
+               return;
+       rp = &rubik[MI_SCREEN(mi)];
+       if (rp->cubeLoc[0] == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (!rp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(rp->glx_context));
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, -10.0);
+
+       rp->PX += rp->VX;
+       rp->PY += rp->VY;
+
+       if (rp->PY < -1) {
+               rp->PY += (-1) - (rp->PY);
+               rp->VY = -rp->VY;
+               bounced = True;
+       }
+       if (rp->PY > 1) {
+               rp->PY -= (rp->PY) - 1;
+               rp->VY = -rp->VY;
+               bounced = True;
+       }
+       if (rp->PX < -1) {
+               rp->PX += (-1) - (rp->PX);
+               rp->VX = -rp->VX;
+               bounced = True;
+       }
+       if (rp->PX > 1) {
+               rp->PX -= (rp->PX) - 1;
+               rp->VX = -rp->VX;
+               bounced = True;
+       }
+       if (bounced) {
+               rp->VX += ((float) LRAND() / (float) MAXRAND) * 0.02 - 0.01;
+               rp->VX += ((float) LRAND() / (float) MAXRAND) * 0.02 - 0.01;
+               if (rp->VX > 0.06)
+                       rp->VX = 0.06;
+               if (rp->VY > 0.06)
+                       rp->VY = 0.06;
+               if (rp->VX < -0.06)
+                       rp->VX = -0.06;
+               if (rp->VY < -0.06)
+                       rp->VY = -0.06;
+       }
+       if (!MI_IS_ICONIC(mi)) {
+               glTranslatef(rp->PX, rp->PY, 0);
+               glScalef(Scale4Window * rp->WindH / rp->WindW, Scale4Window, Scale4Window);
+       } else {
+               glScalef(Scale4Iconic * rp->WindH / rp->WindW, Scale4Iconic, Scale4Iconic);
+       }
+
+       glRotatef(rp->step * 100, 1, 0, 0);
+       glRotatef(rp->step * 95, 0, 1, 0);
+       glRotatef(rp->step * 90, 0, 0, 1);
+
+       if (!draw_cube(mi)) {
+               release_rubik(mi);
+               return;
+       }
+        if (MI_IS_FPS(mi)) do_fps (mi);
+       glXSwapBuffers(display, window);
+
+       if (rp->action == ACTION_SHUFFLE) {
+               if (rp->done) {
+                       if (++rp->rotatestep > DELAY_AFTER_SHUFFLING) {
+                               rp->movement.face = NO_FACE;
+                               rp->rotatestep = 0;
+                               rp->action = ACTION_SOLVE;
+                               rp->done = 0;
+                       }
+               } else {
+                       if (rp->movement.face == NO_FACE) {
+                               if (rp->shufflingmoves < rp->storedmoves) {
+                                       rp->rotatestep = 0;
+                                       rp->movement = rp->moves[rp->shufflingmoves];
+                               } else {
+                                       rp->rotatestep = 0;
+                                       rp->done = 1;
+                               }
+                       } else {
+                               if (rp->rotatestep == 0) {
+                                       if (rp->movement.direction == CW || rp->movement.direction == CCW)
+                                               rp->degreeTurn = (checkFaceSquare(rp, rp->movement.face)) ? 90 : 180;
+                                       else
+                                               rp->degreeTurn = (checkFaceSquare(rp, rowToRotate[rp->movement.face][rp->movement.direction])) ? 90 : 180;
+                               }
+                               rp->rotatestep += rp->anglestep;
+                               if (rp->rotatestep > rp->degreeTurn) {
+                                       if (!evalmovement(mi, rp->movement)) {
+                                               free_rubik(rp);
+                                               if (MI_IS_VERBOSE(mi)) {
+                                                       (void) fprintf(stderr,
+                                                               "Could not allocate memory for rubik\n");
+                                               }
+                                               return;
+                                       }
+                                       rp->shufflingmoves++;
+                                       rp->movement.face = NO_FACE;
+                               }
+                       }
+               }
+       } else {
+               if (rp->done) {
+                       if (++rp->rotatestep > DELAY_AFTER_SOLVING)
+                               if (!shuffle(mi)) {
+                                       free_rubik(rp);
+                                       if (MI_IS_VERBOSE(mi)) {
+                                               (void) fprintf(stderr,
+                                                       "Could not allocate memory for rubik\n");
+                                       }
+                                       return;
+                               }
+               } else {
+                       if (rp->movement.face == NO_FACE) {
+                               if (rp->storedmoves > 0) {
+                                       rp->rotatestep = 0;
+                                       rp->movement = rp->moves[rp->storedmoves - 1];
+                                       rp->movement.direction = (rp->movement.direction +
+                                               (MAXORIENT / 2)) % MAXORIENT;
+                               } else {
+                                       rp->rotatestep = 0;
+                                       rp->done = 1;
+                               }
+                       } else {
+                               if (rp->rotatestep == 0) {
+                                       if (rp->movement.direction == CW || rp->movement.direction == CCW)
+                                               rp->degreeTurn = (checkFaceSquare(rp, rp->movement.face)) ? 90 : 180;
+                                       else
+                                               rp->degreeTurn = (checkFaceSquare(rp, rowToRotate[rp->movement.face][rp->movement.direction])) ? 90 : 180;
+                               }
+                               rp->rotatestep += rp->anglestep;
+                               if (rp->rotatestep > rp->degreeTurn) {
+                                       if (!evalmovement(mi, rp->movement)) {
+                                               free_rubik(rp);
+                                               if (MI_IS_VERBOSE(mi)) {
+                                                       (void) fprintf(stderr,
+                                                               "Could not allocate memory for rubik\n");
+                                               }
+                                               return;
+                                       }
+                                       rp->storedmoves--;
+                                       rp->movement.face = NO_FACE;
+                               }
+                       }
+               }
+       }
+
+       glPopMatrix();
+
+       glFlush();
+
+       rp->step += 0.05;
+}
+
+void
+change_rubik(ModeInfo * mi)
+{
+       rubikstruct *rp;
+
+       if (rubik == NULL)
+               return;
+       rp = &rubik[MI_SCREEN(mi)];
+
+       if (!rp->glx_context)
+               return;
+       if (!pinit(mi)) {
+               free_rubik(rp);
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr,
+                               "Could not allocate memory for rubik\n");
+               }
+               return;
+       }
+}
+
+#endif
diff --git a/modes/glx/s1_1.c b/modes/glx/s1_1.c
new file mode 100644 (file)
index 0000000..fb3001f
--- /dev/null
@@ -0,0 +1,1057 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)s1_1.c       4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points, polygons, and normal vectors to render "s1_1" in 3D.
+ *
+ * Generated by lw2ogl.  Link this with your program but do
+ * not edit by hand.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_sproingies
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat s1_1_PNTS[] =
+{
+       (GLfloat) 0.332422, (GLfloat) 0.132531, (GLfloat) - 0.332422,
+       (GLfloat) 0.332422, (GLfloat) 0.132531, (GLfloat) - 0.667578,
+       (GLfloat) 0.667578, (GLfloat) 0.132531, (GLfloat) - 0.332422,
+       (GLfloat) 0.667578, (GLfloat) 0.132531, (GLfloat) - 0.667578,
+       (GLfloat) 0.638667, (GLfloat) 0.007537, (GLfloat) - 0.638667,
+       (GLfloat) 0.361333, (GLfloat) 0.007537, (GLfloat) - 0.638667,
+       (GLfloat) 0.361333, (GLfloat) 0.007537, (GLfloat) - 0.361333,
+       (GLfloat) 0.638667, (GLfloat) 0.007537, (GLfloat) - 0.361333,
+       (GLfloat) 0.653656, (GLfloat) 0.494688, (GLfloat) - 0.653656,
+       (GLfloat) 0.346344, (GLfloat) 0.494688, (GLfloat) - 0.653656,
+       (GLfloat) 0.346344, (GLfloat) 0.494688, (GLfloat) - 0.346344,
+       (GLfloat) 0.653656, (GLfloat) 0.494688, (GLfloat) - 0.346344,
+       (GLfloat) 0.667578, (GLfloat) 0.838781, (GLfloat) - 0.667578,
+       (GLfloat) 0.667578, (GLfloat) 0.838781, (GLfloat) - 0.332422,
+       (GLfloat) 0.638667, (GLfloat) 0.958463, (GLfloat) - 0.361333,
+       (GLfloat) 0.638667, (GLfloat) 0.958463, (GLfloat) - 0.638667,
+       (GLfloat) 0.332422, (GLfloat) 0.838781, (GLfloat) - 0.332422,
+       (GLfloat) 0.361333, (GLfloat) 0.958463, (GLfloat) - 0.361333,
+       (GLfloat) 0.332422, (GLfloat) 0.838781, (GLfloat) - 0.667578,
+       (GLfloat) 0.361333, (GLfloat) 0.958463, (GLfloat) - 0.638667,
+       (GLfloat) 0.738539, (GLfloat) 0.926712, (GLfloat) - 0.500000,
+       (GLfloat) 0.714805, (GLfloat) 0.686547, (GLfloat) - 0.500000,
+       (GLfloat) 0.728516, (GLfloat) 0.838781, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.926712, (GLfloat) - 0.261461,
+       (GLfloat) 0.674539, (GLfloat) 0.926104, (GLfloat) - 0.325461,
+       (GLfloat) 0.500000, (GLfloat) 0.976924, (GLfloat) - 0.500000,
+       (GLfloat) 0.677562, (GLfloat) 0.965162, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.926712, (GLfloat) - 0.738539,
+       (GLfloat) 0.674539, (GLfloat) 0.926104, (GLfloat) - 0.674539,
+       (GLfloat) 0.500000, (GLfloat) 0.686547, (GLfloat) - 0.285195,
+       (GLfloat) 0.500000, (GLfloat) 0.838781, (GLfloat) - 0.271484,
+       (GLfloat) 0.261461, (GLfloat) 0.926712, (GLfloat) - 0.500000,
+       (GLfloat) 0.325461, (GLfloat) 0.926104, (GLfloat) - 0.325461,
+       (GLfloat) 0.500000, (GLfloat) 0.965162, (GLfloat) - 0.322437,
+       (GLfloat) 0.285195, (GLfloat) 0.686547, (GLfloat) - 0.500000,
+       (GLfloat) 0.271484, (GLfloat) 0.838781, (GLfloat) - 0.500000,
+       (GLfloat) 0.325461, (GLfloat) 0.926104, (GLfloat) - 0.674539,
+       (GLfloat) 0.322437, (GLfloat) 0.965162, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.686547, (GLfloat) - 0.714805,
+       (GLfloat) 0.500000, (GLfloat) 0.838781, (GLfloat) - 0.728516,
+       (GLfloat) 0.500000, (GLfloat) 0.965162, (GLfloat) - 0.677562,
+       (GLfloat) 0.657523, (GLfloat) 0.686547, (GLfloat) - 0.657523,
+       (GLfloat) 0.714805, (GLfloat) 0.295922, (GLfloat) - 0.500000,
+       (GLfloat) 0.709531, (GLfloat) 0.494688, (GLfloat) - 0.500000,
+       (GLfloat) 0.657523, (GLfloat) 0.686547, (GLfloat) - 0.342477,
+       (GLfloat) 0.342477, (GLfloat) 0.686547, (GLfloat) - 0.657523,
+       (GLfloat) 0.500000, (GLfloat) 0.295922, (GLfloat) - 0.714805,
+       (GLfloat) 0.500000, (GLfloat) 0.494688, (GLfloat) - 0.709531,
+       (GLfloat) 0.500000, (GLfloat) 0.295922, (GLfloat) - 0.285195,
+       (GLfloat) 0.500000, (GLfloat) 0.494688, (GLfloat) - 0.290469,
+       (GLfloat) 0.342477, (GLfloat) 0.686547, (GLfloat) - 0.342477,
+       (GLfloat) 0.285195, (GLfloat) 0.295922, (GLfloat) - 0.500000,
+       (GLfloat) 0.290469, (GLfloat) 0.494688, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.039819, (GLfloat) - 0.738539,
+       (GLfloat) 0.500000, (GLfloat) 0.132531, (GLfloat) - 0.728516,
+       (GLfloat) 0.657523, (GLfloat) 0.295922, (GLfloat) - 0.657523,
+       (GLfloat) 0.342477, (GLfloat) 0.295922, (GLfloat) - 0.657523,
+       (GLfloat) 0.342477, (GLfloat) 0.295922, (GLfloat) - 0.342477,
+       (GLfloat) 0.261461, (GLfloat) 0.039819, (GLfloat) - 0.500000,
+       (GLfloat) 0.271484, (GLfloat) 0.132531, (GLfloat) - 0.500000,
+       (GLfloat) 0.657523, (GLfloat) 0.295922, (GLfloat) - 0.342477,
+       (GLfloat) 0.500000, (GLfloat) 0.039819, (GLfloat) - 0.261461,
+       (GLfloat) 0.500000, (GLfloat) 0.132531, (GLfloat) - 0.271484,
+       (GLfloat) 0.738539, (GLfloat) 0.039819, (GLfloat) - 0.500000,
+       (GLfloat) 0.728516, (GLfloat) 0.132531, (GLfloat) - 0.500000,
+       (GLfloat) 0.674539, (GLfloat) 0.040427, (GLfloat) - 0.674539,
+       (GLfloat) 0.500000, (GLfloat) - 0.010924, (GLfloat) - 0.500000,
+       (GLfloat) 0.677562, (GLfloat) 0.000839, (GLfloat) - 0.500000,
+       (GLfloat) 0.674539, (GLfloat) 0.040427, (GLfloat) - 0.325461,
+       (GLfloat) 0.325461, (GLfloat) 0.040427, (GLfloat) - 0.674539,
+       (GLfloat) 0.500000, (GLfloat) 0.000839, (GLfloat) - 0.677562,
+       (GLfloat) 0.325461, (GLfloat) 0.040427, (GLfloat) - 0.325461,
+       (GLfloat) 0.322437, (GLfloat) 0.000839, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.000839, (GLfloat) - 0.322437,
+       (GLfloat) 0.721812, (GLfloat) 0.890313, (GLfloat) - 0.595062,
+       (GLfloat) 0.706063, (GLfloat) 0.769563, (GLfloat) - 0.588313,
+       (GLfloat) 0.713281, (GLfloat) 0.838781, (GLfloat) - 0.591406,
+       (GLfloat) 0.721812, (GLfloat) 0.890313, (GLfloat) - 0.404938,
+       (GLfloat) 0.737656, (GLfloat) 0.890313, (GLfloat) - 0.500000,
+       (GLfloat) 0.706000, (GLfloat) 0.949319, (GLfloat) - 0.587500,
+       (GLfloat) 0.722453, (GLfloat) 0.926408, (GLfloat) - 0.595141,
+       (GLfloat) 0.595062, (GLfloat) 0.890313, (GLfloat) - 0.721812,
+       (GLfloat) 0.674281, (GLfloat) 0.890313, (GLfloat) - 0.674281,
+       (GLfloat) 0.595062, (GLfloat) 0.890313, (GLfloat) - 0.278187,
+       (GLfloat) 0.674281, (GLfloat) 0.890313, (GLfloat) - 0.325719,
+       (GLfloat) 0.706000, (GLfloat) 0.949319, (GLfloat) - 0.412500,
+       (GLfloat) 0.722453, (GLfloat) 0.926408, (GLfloat) - 0.404859,
+       (GLfloat) 0.706063, (GLfloat) 0.769563, (GLfloat) - 0.411687,
+       (GLfloat) 0.713281, (GLfloat) 0.838781, (GLfloat) - 0.408594,
+       (GLfloat) 0.590500, (GLfloat) 0.971195, (GLfloat) - 0.409500,
+       (GLfloat) 0.664625, (GLfloat) 0.962948, (GLfloat) - 0.417500,
+       (GLfloat) 0.721500, (GLfloat) 0.950535, (GLfloat) - 0.500000,
+       (GLfloat) 0.587500, (GLfloat) 0.949319, (GLfloat) - 0.294000,
+       (GLfloat) 0.660875, (GLfloat) 0.948104, (GLfloat) - 0.339125,
+       (GLfloat) 0.587500, (GLfloat) 0.949319, (GLfloat) - 0.706000,
+       (GLfloat) 0.660875, (GLfloat) 0.948104, (GLfloat) - 0.660875,
+       (GLfloat) 0.590500, (GLfloat) 0.971195, (GLfloat) - 0.590500,
+       (GLfloat) 0.664625, (GLfloat) 0.962948, (GLfloat) - 0.582500,
+       (GLfloat) 0.588313, (GLfloat) 0.769563, (GLfloat) - 0.293938,
+       (GLfloat) 0.591406, (GLfloat) 0.838781, (GLfloat) - 0.286719,
+       (GLfloat) 0.404938, (GLfloat) 0.890313, (GLfloat) - 0.278187,
+       (GLfloat) 0.500000, (GLfloat) 0.890313, (GLfloat) - 0.262344,
+       (GLfloat) 0.595141, (GLfloat) 0.926408, (GLfloat) - 0.277547,
+       (GLfloat) 0.278187, (GLfloat) 0.890313, (GLfloat) - 0.404938,
+       (GLfloat) 0.325719, (GLfloat) 0.890313, (GLfloat) - 0.325719,
+       (GLfloat) 0.412500, (GLfloat) 0.949319, (GLfloat) - 0.294000,
+       (GLfloat) 0.404859, (GLfloat) 0.926408, (GLfloat) - 0.277547,
+       (GLfloat) 0.411687, (GLfloat) 0.769563, (GLfloat) - 0.293938,
+       (GLfloat) 0.408594, (GLfloat) 0.838781, (GLfloat) - 0.286719,
+       (GLfloat) 0.409500, (GLfloat) 0.971195, (GLfloat) - 0.409500,
+       (GLfloat) 0.417500, (GLfloat) 0.962948, (GLfloat) - 0.335375,
+       (GLfloat) 0.500000, (GLfloat) 0.950535, (GLfloat) - 0.278500,
+       (GLfloat) 0.294000, (GLfloat) 0.949319, (GLfloat) - 0.412500,
+       (GLfloat) 0.339125, (GLfloat) 0.948104, (GLfloat) - 0.339125,
+       (GLfloat) 0.582500, (GLfloat) 0.962948, (GLfloat) - 0.335375,
+       (GLfloat) 0.293938, (GLfloat) 0.769563, (GLfloat) - 0.411687,
+       (GLfloat) 0.286719, (GLfloat) 0.838781, (GLfloat) - 0.408594,
+       (GLfloat) 0.278187, (GLfloat) 0.890313, (GLfloat) - 0.595062,
+       (GLfloat) 0.262344, (GLfloat) 0.890313, (GLfloat) - 0.500000,
+       (GLfloat) 0.277547, (GLfloat) 0.926408, (GLfloat) - 0.404859,
+       (GLfloat) 0.404938, (GLfloat) 0.890313, (GLfloat) - 0.721812,
+       (GLfloat) 0.325719, (GLfloat) 0.890313, (GLfloat) - 0.674281,
+       (GLfloat) 0.294000, (GLfloat) 0.949319, (GLfloat) - 0.587500,
+       (GLfloat) 0.277547, (GLfloat) 0.926408, (GLfloat) - 0.595141,
+       (GLfloat) 0.293938, (GLfloat) 0.769563, (GLfloat) - 0.588313,
+       (GLfloat) 0.286719, (GLfloat) 0.838781, (GLfloat) - 0.591406,
+       (GLfloat) 0.409500, (GLfloat) 0.971195, (GLfloat) - 0.590500,
+       (GLfloat) 0.335375, (GLfloat) 0.962948, (GLfloat) - 0.582500,
+       (GLfloat) 0.278500, (GLfloat) 0.950535, (GLfloat) - 0.500000,
+       (GLfloat) 0.412500, (GLfloat) 0.949319, (GLfloat) - 0.706000,
+       (GLfloat) 0.339125, (GLfloat) 0.948104, (GLfloat) - 0.660875,
+       (GLfloat) 0.335375, (GLfloat) 0.962948, (GLfloat) - 0.417500,
+       (GLfloat) 0.411687, (GLfloat) 0.769563, (GLfloat) - 0.706063,
+       (GLfloat) 0.408594, (GLfloat) 0.838781, (GLfloat) - 0.713281,
+       (GLfloat) 0.500000, (GLfloat) 0.890313, (GLfloat) - 0.737656,
+       (GLfloat) 0.404859, (GLfloat) 0.926408, (GLfloat) - 0.722453,
+       (GLfloat) 0.595141, (GLfloat) 0.926408, (GLfloat) - 0.722453,
+       (GLfloat) 0.588313, (GLfloat) 0.769563, (GLfloat) - 0.706063,
+       (GLfloat) 0.591406, (GLfloat) 0.838781, (GLfloat) - 0.713281,
+       (GLfloat) 0.582500, (GLfloat) 0.962948, (GLfloat) - 0.664625,
+       (GLfloat) 0.500000, (GLfloat) 0.950535, (GLfloat) - 0.721500,
+       (GLfloat) 0.417500, (GLfloat) 0.962948, (GLfloat) - 0.664625,
+       (GLfloat) 0.500000, (GLfloat) 0.973972, (GLfloat) - 0.402250,
+       (GLfloat) 0.597750, (GLfloat) 0.973972, (GLfloat) - 0.500000,
+       (GLfloat) 0.402250, (GLfloat) 0.973972, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.973972, (GLfloat) - 0.597750,
+       (GLfloat) 0.661906, (GLfloat) 0.769563, (GLfloat) - 0.661906,
+       (GLfloat) 0.696875, (GLfloat) 0.593625, (GLfloat) - 0.584375,
+       (GLfloat) 0.700484, (GLfloat) 0.686547, (GLfloat) - 0.585922,
+       (GLfloat) 0.720781, (GLfloat) 0.769563, (GLfloat) - 0.500000,
+       (GLfloat) 0.696875, (GLfloat) 0.393625, (GLfloat) - 0.584375,
+       (GLfloat) 0.695563, (GLfloat) 0.494688, (GLfloat) - 0.583813,
+       (GLfloat) 0.696875, (GLfloat) 0.593625, (GLfloat) - 0.415625,
+       (GLfloat) 0.710938, (GLfloat) 0.593625, (GLfloat) - 0.500000,
+       (GLfloat) 0.584375, (GLfloat) 0.593625, (GLfloat) - 0.696875,
+       (GLfloat) 0.654688, (GLfloat) 0.593625, (GLfloat) - 0.654688,
+       (GLfloat) 0.584375, (GLfloat) 0.593625, (GLfloat) - 0.303125,
+       (GLfloat) 0.654688, (GLfloat) 0.593625, (GLfloat) - 0.345313,
+       (GLfloat) 0.700484, (GLfloat) 0.686547, (GLfloat) - 0.414078,
+       (GLfloat) 0.696875, (GLfloat) 0.393625, (GLfloat) - 0.415625,
+       (GLfloat) 0.695563, (GLfloat) 0.494688, (GLfloat) - 0.416187,
+       (GLfloat) 0.661906, (GLfloat) 0.769563, (GLfloat) - 0.338094,
+       (GLfloat) 0.338094, (GLfloat) 0.769563, (GLfloat) - 0.661906,
+       (GLfloat) 0.415625, (GLfloat) 0.593625, (GLfloat) - 0.696875,
+       (GLfloat) 0.414078, (GLfloat) 0.686547, (GLfloat) - 0.700484,
+       (GLfloat) 0.500000, (GLfloat) 0.769563, (GLfloat) - 0.720781,
+       (GLfloat) 0.415625, (GLfloat) 0.393625, (GLfloat) - 0.696875,
+       (GLfloat) 0.416187, (GLfloat) 0.494688, (GLfloat) - 0.695563,
+       (GLfloat) 0.500000, (GLfloat) 0.593625, (GLfloat) - 0.710938,
+       (GLfloat) 0.303125, (GLfloat) 0.593625, (GLfloat) - 0.584375,
+       (GLfloat) 0.345313, (GLfloat) 0.593625, (GLfloat) - 0.654688,
+       (GLfloat) 0.585922, (GLfloat) 0.686547, (GLfloat) - 0.700484,
+       (GLfloat) 0.584375, (GLfloat) 0.393625, (GLfloat) - 0.696875,
+       (GLfloat) 0.583813, (GLfloat) 0.494688, (GLfloat) - 0.695563,
+       (GLfloat) 0.500000, (GLfloat) 0.769563, (GLfloat) - 0.279219,
+       (GLfloat) 0.415625, (GLfloat) 0.593625, (GLfloat) - 0.303125,
+       (GLfloat) 0.414078, (GLfloat) 0.686547, (GLfloat) - 0.299516,
+       (GLfloat) 0.338094, (GLfloat) 0.769563, (GLfloat) - 0.338094,
+       (GLfloat) 0.585922, (GLfloat) 0.686547, (GLfloat) - 0.299516,
+       (GLfloat) 0.584375, (GLfloat) 0.393625, (GLfloat) - 0.303125,
+       (GLfloat) 0.583813, (GLfloat) 0.494688, (GLfloat) - 0.304437,
+       (GLfloat) 0.500000, (GLfloat) 0.593625, (GLfloat) - 0.289063,
+       (GLfloat) 0.303125, (GLfloat) 0.593625, (GLfloat) - 0.415625,
+       (GLfloat) 0.345313, (GLfloat) 0.593625, (GLfloat) - 0.345313,
+       (GLfloat) 0.415625, (GLfloat) 0.393625, (GLfloat) - 0.303125,
+       (GLfloat) 0.416187, (GLfloat) 0.494688, (GLfloat) - 0.304437,
+       (GLfloat) 0.279219, (GLfloat) 0.769563, (GLfloat) - 0.500000,
+       (GLfloat) 0.299516, (GLfloat) 0.686547, (GLfloat) - 0.585922,
+       (GLfloat) 0.299516, (GLfloat) 0.686547, (GLfloat) - 0.414078,
+       (GLfloat) 0.303125, (GLfloat) 0.393625, (GLfloat) - 0.415625,
+       (GLfloat) 0.304437, (GLfloat) 0.494688, (GLfloat) - 0.416187,
+       (GLfloat) 0.289063, (GLfloat) 0.593625, (GLfloat) - 0.500000,
+       (GLfloat) 0.303125, (GLfloat) 0.393625, (GLfloat) - 0.584375,
+       (GLfloat) 0.304437, (GLfloat) 0.494688, (GLfloat) - 0.583813,
+       (GLfloat) 0.411687, (GLfloat) 0.207062, (GLfloat) - 0.706063,
+       (GLfloat) 0.404938, (GLfloat) 0.077813, (GLfloat) - 0.721812,
+       (GLfloat) 0.408594, (GLfloat) 0.132531, (GLfloat) - 0.713281,
+       (GLfloat) 0.588313, (GLfloat) 0.207062, (GLfloat) - 0.706063,
+       (GLfloat) 0.500000, (GLfloat) 0.207062, (GLfloat) - 0.720781,
+       (GLfloat) 0.414078, (GLfloat) 0.295922, (GLfloat) - 0.700484,
+       (GLfloat) 0.293938, (GLfloat) 0.207062, (GLfloat) - 0.588313,
+       (GLfloat) 0.338094, (GLfloat) 0.207062, (GLfloat) - 0.661906,
+       (GLfloat) 0.706063, (GLfloat) 0.207062, (GLfloat) - 0.588313,
+       (GLfloat) 0.661906, (GLfloat) 0.207062, (GLfloat) - 0.661906,
+       (GLfloat) 0.585922, (GLfloat) 0.295922, (GLfloat) - 0.700484,
+       (GLfloat) 0.595062, (GLfloat) 0.077813, (GLfloat) - 0.721812,
+       (GLfloat) 0.591406, (GLfloat) 0.132531, (GLfloat) - 0.713281,
+       (GLfloat) 0.500000, (GLfloat) 0.393625, (GLfloat) - 0.710938,
+       (GLfloat) 0.654688, (GLfloat) 0.393625, (GLfloat) - 0.654688,
+       (GLfloat) 0.345313, (GLfloat) 0.393625, (GLfloat) - 0.654688,
+       (GLfloat) 0.299516, (GLfloat) 0.295922, (GLfloat) - 0.585922,
+       (GLfloat) 0.293938, (GLfloat) 0.207062, (GLfloat) - 0.411687,
+       (GLfloat) 0.279219, (GLfloat) 0.207062, (GLfloat) - 0.500000,
+       (GLfloat) 0.278187, (GLfloat) 0.077813, (GLfloat) - 0.595062,
+       (GLfloat) 0.286719, (GLfloat) 0.132531, (GLfloat) - 0.591406,
+       (GLfloat) 0.289063, (GLfloat) 0.393625, (GLfloat) - 0.500000,
+       (GLfloat) 0.345313, (GLfloat) 0.393625, (GLfloat) - 0.345313,
+       (GLfloat) 0.299516, (GLfloat) 0.295922, (GLfloat) - 0.414078,
+       (GLfloat) 0.278187, (GLfloat) 0.077813, (GLfloat) - 0.404938,
+       (GLfloat) 0.286719, (GLfloat) 0.132531, (GLfloat) - 0.408594,
+       (GLfloat) 0.411687, (GLfloat) 0.207062, (GLfloat) - 0.293938,
+       (GLfloat) 0.338094, (GLfloat) 0.207062, (GLfloat) - 0.338094,
+       (GLfloat) 0.414078, (GLfloat) 0.295922, (GLfloat) - 0.299516,
+       (GLfloat) 0.588313, (GLfloat) 0.207062, (GLfloat) - 0.293938,
+       (GLfloat) 0.500000, (GLfloat) 0.207062, (GLfloat) - 0.279219,
+       (GLfloat) 0.404938, (GLfloat) 0.077813, (GLfloat) - 0.278187,
+       (GLfloat) 0.408594, (GLfloat) 0.132531, (GLfloat) - 0.286719,
+       (GLfloat) 0.500000, (GLfloat) 0.393625, (GLfloat) - 0.289063,
+       (GLfloat) 0.654688, (GLfloat) 0.393625, (GLfloat) - 0.345313,
+       (GLfloat) 0.585922, (GLfloat) 0.295922, (GLfloat) - 0.299516,
+       (GLfloat) 0.595062, (GLfloat) 0.077813, (GLfloat) - 0.278187,
+       (GLfloat) 0.591406, (GLfloat) 0.132531, (GLfloat) - 0.286719,
+       (GLfloat) 0.706063, (GLfloat) 0.207062, (GLfloat) - 0.411687,
+       (GLfloat) 0.661906, (GLfloat) 0.207062, (GLfloat) - 0.338094,
+       (GLfloat) 0.700484, (GLfloat) 0.295922, (GLfloat) - 0.414078,
+       (GLfloat) 0.720781, (GLfloat) 0.207062, (GLfloat) - 0.500000,
+       (GLfloat) 0.721812, (GLfloat) 0.077813, (GLfloat) - 0.404938,
+       (GLfloat) 0.713281, (GLfloat) 0.132531, (GLfloat) - 0.408594,
+       (GLfloat) 0.710938, (GLfloat) 0.393625, (GLfloat) - 0.500000,
+       (GLfloat) 0.700484, (GLfloat) 0.295922, (GLfloat) - 0.585922,
+       (GLfloat) 0.721812, (GLfloat) 0.077813, (GLfloat) - 0.595062,
+       (GLfloat) 0.713281, (GLfloat) 0.132531, (GLfloat) - 0.591406,
+       (GLfloat) 0.737656, (GLfloat) 0.077813, (GLfloat) - 0.500000,
+       (GLfloat) 0.706000, (GLfloat) 0.016681, (GLfloat) - 0.412500,
+       (GLfloat) 0.722453, (GLfloat) 0.040123, (GLfloat) - 0.404859,
+       (GLfloat) 0.674281, (GLfloat) 0.077813, (GLfloat) - 0.325719,
+       (GLfloat) 0.674281, (GLfloat) 0.077813, (GLfloat) - 0.674281,
+       (GLfloat) 0.706000, (GLfloat) 0.016681, (GLfloat) - 0.587500,
+       (GLfloat) 0.722453, (GLfloat) 0.040123, (GLfloat) - 0.595141,
+       (GLfloat) 0.590500, (GLfloat) - 0.005194, (GLfloat) - 0.590500,
+       (GLfloat) 0.664625, (GLfloat) 0.003052, (GLfloat) - 0.582500,
+       (GLfloat) 0.721500, (GLfloat) 0.015465, (GLfloat) - 0.500000,
+       (GLfloat) 0.587500, (GLfloat) 0.016681, (GLfloat) - 0.706000,
+       (GLfloat) 0.660875, (GLfloat) 0.017896, (GLfloat) - 0.660875,
+       (GLfloat) 0.587500, (GLfloat) 0.016681, (GLfloat) - 0.294000,
+       (GLfloat) 0.660875, (GLfloat) 0.017896, (GLfloat) - 0.339125,
+       (GLfloat) 0.590500, (GLfloat) - 0.005194, (GLfloat) - 0.409500,
+       (GLfloat) 0.664625, (GLfloat) 0.003052, (GLfloat) - 0.417500,
+       (GLfloat) 0.500000, (GLfloat) 0.077813, (GLfloat) - 0.737656,
+       (GLfloat) 0.595141, (GLfloat) 0.040123, (GLfloat) - 0.722453,
+       (GLfloat) 0.325719, (GLfloat) 0.077813, (GLfloat) - 0.674281,
+       (GLfloat) 0.412500, (GLfloat) 0.016681, (GLfloat) - 0.706000,
+       (GLfloat) 0.404859, (GLfloat) 0.040123, (GLfloat) - 0.722453,
+       (GLfloat) 0.409500, (GLfloat) - 0.005194, (GLfloat) - 0.590500,
+       (GLfloat) 0.417500, (GLfloat) 0.003052, (GLfloat) - 0.664625,
+       (GLfloat) 0.500000, (GLfloat) 0.015465, (GLfloat) - 0.721500,
+       (GLfloat) 0.294000, (GLfloat) 0.016681, (GLfloat) - 0.587500,
+       (GLfloat) 0.339125, (GLfloat) 0.017896, (GLfloat) - 0.660875,
+       (GLfloat) 0.582500, (GLfloat) 0.003052, (GLfloat) - 0.664625,
+       (GLfloat) 0.262344, (GLfloat) 0.077813, (GLfloat) - 0.500000,
+       (GLfloat) 0.277547, (GLfloat) 0.040123, (GLfloat) - 0.595141,
+       (GLfloat) 0.325719, (GLfloat) 0.077813, (GLfloat) - 0.325719,
+       (GLfloat) 0.294000, (GLfloat) 0.016681, (GLfloat) - 0.412500,
+       (GLfloat) 0.277547, (GLfloat) 0.040123, (GLfloat) - 0.404859,
+       (GLfloat) 0.409500, (GLfloat) - 0.005194, (GLfloat) - 0.409500,
+       (GLfloat) 0.335375, (GLfloat) 0.003052, (GLfloat) - 0.417500,
+       (GLfloat) 0.278500, (GLfloat) 0.015465, (GLfloat) - 0.500000,
+       (GLfloat) 0.412500, (GLfloat) 0.016681, (GLfloat) - 0.294000,
+       (GLfloat) 0.339125, (GLfloat) 0.017896, (GLfloat) - 0.339125,
+       (GLfloat) 0.335375, (GLfloat) 0.003052, (GLfloat) - 0.582500,
+       (GLfloat) 0.500000, (GLfloat) 0.077813, (GLfloat) - 0.262344,
+       (GLfloat) 0.404859, (GLfloat) 0.040123, (GLfloat) - 0.277547,
+       (GLfloat) 0.595141, (GLfloat) 0.040123, (GLfloat) - 0.277547,
+       (GLfloat) 0.582500, (GLfloat) 0.003052, (GLfloat) - 0.335375,
+       (GLfloat) 0.500000, (GLfloat) 0.015465, (GLfloat) - 0.278500,
+       (GLfloat) 0.417500, (GLfloat) 0.003052, (GLfloat) - 0.335375,
+       (GLfloat) 0.500000, (GLfloat) - 0.007972, (GLfloat) - 0.597750,
+       (GLfloat) 0.597750, (GLfloat) - 0.007972, (GLfloat) - 0.500000,
+       (GLfloat) 0.402250, (GLfloat) - 0.007972, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) - 0.007972, (GLfloat) - 0.402250,
+};
+
+static GLfloat s1_1_normals[] =
+{
+       (GLfloat) 0.844155, (GLfloat) - 0.175691, (GLfloat) - 0.506493,
+       (GLfloat) 0.844155, (GLfloat) - 0.175690, (GLfloat) - 0.506493,
+       (GLfloat) 0.971634, (GLfloat) - 0.172349, (GLfloat) - 0.161939,
+       (GLfloat) 0.971634, (GLfloat) - 0.172348, (GLfloat) - 0.161939,
+       (GLfloat) 0.985737, (GLfloat) - 0.023907, (GLfloat) - 0.166587,
+       (GLfloat) 0.986237, (GLfloat) - 0.017860, (GLfloat) - 0.164373,
+       (GLfloat) 0.856157, (GLfloat) - 0.009890, (GLfloat) - 0.516621,
+       (GLfloat) 0.857379, (GLfloat) - 0.016331, (GLfloat) - 0.514427,
+       (GLfloat) 0.844155, (GLfloat) - 0.175690, (GLfloat) 0.506493,
+       (GLfloat) 0.844155, (GLfloat) - 0.175690, (GLfloat) 0.506493,
+       (GLfloat) 0.856157, (GLfloat) - 0.009889, (GLfloat) 0.516621,
+       (GLfloat) 0.857379, (GLfloat) - 0.016331, (GLfloat) 0.514427,
+       (GLfloat) 0.985737, (GLfloat) - 0.023907, (GLfloat) 0.166587,
+       (GLfloat) 0.986237, (GLfloat) - 0.017860, (GLfloat) 0.164373,
+       (GLfloat) 0.971634, (GLfloat) - 0.172348, (GLfloat) 0.161939,
+       (GLfloat) 0.971634, (GLfloat) - 0.172348, (GLfloat) 0.161939,
+       (GLfloat) 0.283621, (GLfloat) 0.936578, (GLfloat) 0.205866,
+       (GLfloat) 0.264056, (GLfloat) 0.947923, (GLfloat) 0.178092,
+       (GLfloat) 0.315105, (GLfloat) 0.946548, (GLfloat) 0.068965,
+       (GLfloat) 0.304029, (GLfloat) 0.949849, (GLfloat) 0.073162,
+       (GLfloat) 0.783125, (GLfloat) 0.607180, (GLfloat) 0.134346,
+       (GLfloat) 0.804111, (GLfloat) 0.575131, (GLfloat) 0.150431,
+       (GLfloat) 0.650208, (GLfloat) 0.649088, (GLfloat) 0.394860,
+       (GLfloat) 0.665312, (GLfloat) 0.617634, (GLfloat) 0.419391,
+       (GLfloat) 0.264056, (GLfloat) 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) 0.283621, (GLfloat) 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) 0.650207, (GLfloat) 0.649089, (GLfloat) - 0.394860,
+       (GLfloat) 0.665311, (GLfloat) 0.617634, (GLfloat) - 0.419391,
+       (GLfloat) 0.804111, (GLfloat) 0.575131, (GLfloat) - 0.150431,
+       (GLfloat) 0.783125, (GLfloat) 0.607180, (GLfloat) - 0.134346,
+       (GLfloat) 0.304029, (GLfloat) 0.949849, (GLfloat) - 0.073162,
+       (GLfloat) 0.315105, (GLfloat) 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) 0.506493, (GLfloat) - 0.175691, (GLfloat) 0.844155,
+       (GLfloat) 0.506493, (GLfloat) - 0.175691, (GLfloat) 0.844155,
+       (GLfloat) 0.161939, (GLfloat) - 0.172349, (GLfloat) 0.971633,
+       (GLfloat) 0.161939, (GLfloat) - 0.172349, (GLfloat) 0.971633,
+       (GLfloat) 0.166587, (GLfloat) - 0.023907, (GLfloat) 0.985737,
+       (GLfloat) 0.164373, (GLfloat) - 0.017860, (GLfloat) 0.986237,
+       (GLfloat) 0.516622, (GLfloat) - 0.009888, (GLfloat) 0.856157,
+       (GLfloat) 0.514427, (GLfloat) - 0.016331, (GLfloat) 0.857379,
+       (GLfloat) - 0.506493, (GLfloat) - 0.175691, (GLfloat) 0.844155,
+       (GLfloat) - 0.506493, (GLfloat) - 0.175691, (GLfloat) 0.844155,
+       (GLfloat) - 0.516622, (GLfloat) - 0.009887, (GLfloat) 0.856157,
+       (GLfloat) - 0.514427, (GLfloat) - 0.016331, (GLfloat) 0.857379,
+       (GLfloat) - 0.166587, (GLfloat) - 0.023907, (GLfloat) 0.985737,
+       (GLfloat) - 0.164373, (GLfloat) - 0.017860, (GLfloat) 0.986237,
+       (GLfloat) - 0.161939, (GLfloat) - 0.172349, (GLfloat) 0.971633,
+       (GLfloat) - 0.161939, (GLfloat) - 0.172349, (GLfloat) 0.971633,
+       (GLfloat) - 0.205866, (GLfloat) 0.936578, (GLfloat) 0.283621,
+       (GLfloat) - 0.178092, (GLfloat) 0.947923, (GLfloat) 0.264055,
+       (GLfloat) - 0.068965, (GLfloat) 0.946548, (GLfloat) 0.315105,
+       (GLfloat) - 0.073162, (GLfloat) 0.949849, (GLfloat) 0.304029,
+       (GLfloat) - 0.134346, (GLfloat) 0.607180, (GLfloat) 0.783125,
+       (GLfloat) - 0.150431, (GLfloat) 0.575131, (GLfloat) 0.804111,
+       (GLfloat) - 0.394861, (GLfloat) 0.649087, (GLfloat) 0.650209,
+       (GLfloat) - 0.419390, (GLfloat) 0.617634, (GLfloat) 0.665312,
+       (GLfloat) 0.178092, (GLfloat) 0.947923, (GLfloat) 0.264056,
+       (GLfloat) 0.205866, (GLfloat) 0.936578, (GLfloat) 0.283621,
+       (GLfloat) 0.394861, (GLfloat) 0.649087, (GLfloat) 0.650208,
+       (GLfloat) 0.419390, (GLfloat) 0.617634, (GLfloat) 0.665312,
+       (GLfloat) 0.150431, (GLfloat) 0.575131, (GLfloat) 0.804111,
+       (GLfloat) 0.134346, (GLfloat) 0.607180, (GLfloat) 0.783125,
+       (GLfloat) 0.073162, (GLfloat) 0.949849, (GLfloat) 0.304029,
+       (GLfloat) 0.068965, (GLfloat) 0.946548, (GLfloat) 0.315105,
+       (GLfloat) - 0.844155, (GLfloat) - 0.175691, (GLfloat) 0.506493,
+       (GLfloat) - 0.844155, (GLfloat) - 0.175691, (GLfloat) 0.506493,
+       (GLfloat) - 0.971633, (GLfloat) - 0.172349, (GLfloat) 0.161939,
+       (GLfloat) - 0.971633, (GLfloat) - 0.172349, (GLfloat) 0.161939,
+       (GLfloat) - 0.985737, (GLfloat) - 0.023907, (GLfloat) 0.166587,
+       (GLfloat) - 0.986237, (GLfloat) - 0.017860, (GLfloat) 0.164373,
+       (GLfloat) - 0.856157, (GLfloat) - 0.009887, (GLfloat) 0.516622,
+       (GLfloat) - 0.857379, (GLfloat) - 0.016331, (GLfloat) 0.514427,
+       (GLfloat) - 0.844155, (GLfloat) - 0.175691, (GLfloat) - 0.506493,
+       (GLfloat) - 0.844155, (GLfloat) - 0.175691, (GLfloat) - 0.506493,
+       (GLfloat) - 0.856157, (GLfloat) - 0.009888, (GLfloat) - 0.516622,
+       (GLfloat) - 0.857379, (GLfloat) - 0.016331, (GLfloat) - 0.514427,
+       (GLfloat) - 0.985737, (GLfloat) - 0.023907, (GLfloat) - 0.166587,
+       (GLfloat) - 0.986237, (GLfloat) - 0.017860, (GLfloat) - 0.164373,
+       (GLfloat) - 0.971633, (GLfloat) - 0.172349, (GLfloat) - 0.161939,
+       (GLfloat) - 0.971633, (GLfloat) - 0.172349, (GLfloat) - 0.161939,
+       (GLfloat) - 0.283621, (GLfloat) 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) - 0.264056, (GLfloat) 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) - 0.315105, (GLfloat) 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) - 0.304029, (GLfloat) 0.949849, (GLfloat) - 0.073162,
+       (GLfloat) - 0.783125, (GLfloat) 0.607180, (GLfloat) - 0.134346,
+       (GLfloat) - 0.804111, (GLfloat) 0.575131, (GLfloat) - 0.150431,
+       (GLfloat) - 0.650208, (GLfloat) 0.649087, (GLfloat) - 0.394861,
+       (GLfloat) - 0.665312, (GLfloat) 0.617634, (GLfloat) - 0.419390,
+       (GLfloat) - 0.264055, (GLfloat) 0.947923, (GLfloat) 0.178092,
+       (GLfloat) - 0.283621, (GLfloat) 0.936578, (GLfloat) 0.205866,
+       (GLfloat) - 0.650209, (GLfloat) 0.649087, (GLfloat) 0.394861,
+       (GLfloat) - 0.665312, (GLfloat) 0.617634, (GLfloat) 0.419390,
+       (GLfloat) - 0.804111, (GLfloat) 0.575131, (GLfloat) 0.150431,
+       (GLfloat) - 0.783125, (GLfloat) 0.607180, (GLfloat) 0.134346,
+       (GLfloat) - 0.304029, (GLfloat) 0.949849, (GLfloat) 0.073162,
+       (GLfloat) - 0.315105, (GLfloat) 0.946548, (GLfloat) 0.068965,
+       (GLfloat) - 0.506493, (GLfloat) - 0.175690, (GLfloat) - 0.844155,
+       (GLfloat) - 0.506493, (GLfloat) - 0.175690, (GLfloat) - 0.844155,
+       (GLfloat) - 0.161939, (GLfloat) - 0.172348, (GLfloat) - 0.971634,
+       (GLfloat) - 0.161939, (GLfloat) - 0.172348, (GLfloat) - 0.971634,
+       (GLfloat) - 0.166587, (GLfloat) - 0.023907, (GLfloat) - 0.985737,
+       (GLfloat) - 0.164373, (GLfloat) - 0.017860, (GLfloat) - 0.986237,
+       (GLfloat) - 0.516621, (GLfloat) - 0.009889, (GLfloat) - 0.856157,
+       (GLfloat) - 0.514427, (GLfloat) - 0.016331, (GLfloat) - 0.857379,
+       (GLfloat) 0.506493, (GLfloat) - 0.175690, (GLfloat) - 0.844155,
+       (GLfloat) 0.506493, (GLfloat) - 0.175691, (GLfloat) - 0.844155,
+       (GLfloat) 0.516621, (GLfloat) - 0.009890, (GLfloat) - 0.856157,
+       (GLfloat) 0.514427, (GLfloat) - 0.016331, (GLfloat) - 0.857379,
+       (GLfloat) 0.166587, (GLfloat) - 0.023907, (GLfloat) - 0.985737,
+       (GLfloat) 0.164373, (GLfloat) - 0.017860, (GLfloat) - 0.986237,
+       (GLfloat) 0.161939, (GLfloat) - 0.172349, (GLfloat) - 0.971634,
+       (GLfloat) 0.161939, (GLfloat) - 0.172348, (GLfloat) - 0.971634,
+       (GLfloat) 0.205866, (GLfloat) 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) 0.178092, (GLfloat) 0.947923, (GLfloat) - 0.264056,
+       (GLfloat) 0.068965, (GLfloat) 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) 0.073162, (GLfloat) 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) 0.134346, (GLfloat) 0.607180, (GLfloat) - 0.783125,
+       (GLfloat) 0.150431, (GLfloat) 0.575131, (GLfloat) - 0.804111,
+       (GLfloat) 0.394860, (GLfloat) 0.649089, (GLfloat) - 0.650207,
+       (GLfloat) 0.419391, (GLfloat) 0.617634, (GLfloat) - 0.665311,
+       (GLfloat) - 0.178092, (GLfloat) 0.947923, (GLfloat) - 0.264056,
+       (GLfloat) - 0.205866, (GLfloat) 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) - 0.394860, (GLfloat) 0.649088, (GLfloat) - 0.650208,
+       (GLfloat) - 0.419391, (GLfloat) 0.617634, (GLfloat) - 0.665312,
+       (GLfloat) - 0.150431, (GLfloat) 0.575131, (GLfloat) - 0.804111,
+       (GLfloat) - 0.134346, (GLfloat) 0.607180, (GLfloat) - 0.783125,
+       (GLfloat) - 0.073162, (GLfloat) 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) - 0.068965, (GLfloat) 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) 0.135802, (GLfloat) 0.982944, (GLfloat) 0.124011,
+       (GLfloat) 0.124011, (GLfloat) 0.982944, (GLfloat) 0.135802,
+       (GLfloat) 0.043834, (GLfloat) 0.993006, (GLfloat) 0.109621,
+       (GLfloat) 0.039656, (GLfloat) 0.992607, (GLfloat) 0.114709,
+       (GLfloat) 0.030163, (GLfloat) 0.998998, (GLfloat) 0.033079,
+       (GLfloat) 0.033079, (GLfloat) 0.998998, (GLfloat) 0.030163,
+       (GLfloat) 0.109621, (GLfloat) 0.993006, (GLfloat) 0.043834,
+       (GLfloat) 0.114709, (GLfloat) 0.992607, (GLfloat) 0.039656,
+       (GLfloat) - 0.124011, (GLfloat) 0.982944, (GLfloat) 0.135803,
+       (GLfloat) - 0.135803, (GLfloat) 0.982944, (GLfloat) 0.124011,
+       (GLfloat) - 0.109621, (GLfloat) 0.993006, (GLfloat) 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) 0.992607, (GLfloat) 0.039656,
+       (GLfloat) - 0.033079, (GLfloat) 0.998998, (GLfloat) 0.030163,
+       (GLfloat) - 0.030163, (GLfloat) 0.998998, (GLfloat) 0.033079,
+       (GLfloat) - 0.043834, (GLfloat) 0.993006, (GLfloat) 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) 0.992607, (GLfloat) 0.114709,
+       (GLfloat) - 0.135802, (GLfloat) 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) - 0.124011, (GLfloat) 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) - 0.043834, (GLfloat) 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) - 0.030163, (GLfloat) 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) - 0.033079, (GLfloat) 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) - 0.109621, (GLfloat) 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) 0.124011, (GLfloat) 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) 0.135802, (GLfloat) 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) 0.109621, (GLfloat) 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) 0.114709, (GLfloat) 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) 0.033079, (GLfloat) 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) 0.030163, (GLfloat) 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) 0.043834, (GLfloat) 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) 0.039656, (GLfloat) 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) 0.852125, (GLfloat) - 0.111720, (GLfloat) - 0.511275,
+       (GLfloat) 0.852125, (GLfloat) - 0.111718, (GLfloat) - 0.511276,
+       (GLfloat) 0.855252, (GLfloat) - 0.072245, (GLfloat) - 0.513151,
+       (GLfloat) 0.855252, (GLfloat) - 0.072244, (GLfloat) - 0.513152,
+       (GLfloat) 0.983916, (GLfloat) - 0.070836, (GLfloat) - 0.163986,
+       (GLfloat) 0.983916, (GLfloat) - 0.070836, (GLfloat) - 0.163986,
+       (GLfloat) 0.980457, (GLfloat) - 0.109554, (GLfloat) - 0.163409,
+       (GLfloat) 0.980457, (GLfloat) - 0.109553, (GLfloat) - 0.163410,
+       (GLfloat) 0.857405, (GLfloat) - 0.014299, (GLfloat) - 0.514444,
+       (GLfloat) 0.857405, (GLfloat) - 0.014300, (GLfloat) - 0.514443,
+       (GLfloat) 0.986297, (GLfloat) - 0.014019, (GLfloat) - 0.164382,
+       (GLfloat) 0.986297, (GLfloat) - 0.014019, (GLfloat) - 0.164382,
+       (GLfloat) 0.985564, (GLfloat) - 0.041017, (GLfloat) - 0.164261,
+       (GLfloat) 0.985564, (GLfloat) - 0.041017, (GLfloat) - 0.164260,
+       (GLfloat) 0.856742, (GLfloat) - 0.041836, (GLfloat) - 0.514045,
+       (GLfloat) 0.856742, (GLfloat) - 0.041836, (GLfloat) - 0.514045,
+       (GLfloat) 0.857405, (GLfloat) - 0.014299, (GLfloat) 0.514443,
+       (GLfloat) 0.857405, (GLfloat) - 0.014299, (GLfloat) 0.514444,
+       (GLfloat) 0.856742, (GLfloat) - 0.041836, (GLfloat) 0.514045,
+       (GLfloat) 0.856742, (GLfloat) - 0.041836, (GLfloat) 0.514045,
+       (GLfloat) 0.985564, (GLfloat) - 0.041017, (GLfloat) 0.164260,
+       (GLfloat) 0.985564, (GLfloat) - 0.041017, (GLfloat) 0.164261,
+       (GLfloat) 0.986297, (GLfloat) - 0.014019, (GLfloat) 0.164382,
+       (GLfloat) 0.986297, (GLfloat) - 0.014019, (GLfloat) 0.164382,
+       (GLfloat) 0.852125, (GLfloat) - 0.111719, (GLfloat) 0.511275,
+       (GLfloat) 0.852125, (GLfloat) - 0.111718, (GLfloat) 0.511276,
+       (GLfloat) 0.980457, (GLfloat) - 0.109553, (GLfloat) 0.163410,
+       (GLfloat) 0.980457, (GLfloat) - 0.109554, (GLfloat) 0.163409,
+       (GLfloat) 0.983916, (GLfloat) - 0.070836, (GLfloat) 0.163986,
+       (GLfloat) 0.983916, (GLfloat) - 0.070836, (GLfloat) 0.163986,
+       (GLfloat) 0.855252, (GLfloat) - 0.072244, (GLfloat) 0.513152,
+       (GLfloat) 0.855252, (GLfloat) - 0.072245, (GLfloat) 0.513151,
+       (GLfloat) - 0.511275, (GLfloat) - 0.111719, (GLfloat) - 0.852125,
+       (GLfloat) - 0.511276, (GLfloat) - 0.111718, (GLfloat) - 0.852125,
+       (GLfloat) - 0.513151, (GLfloat) - 0.072245, (GLfloat) - 0.855252,
+       (GLfloat) - 0.513152, (GLfloat) - 0.072244, (GLfloat) - 0.855252,
+       (GLfloat) - 0.163986, (GLfloat) - 0.070836, (GLfloat) - 0.983916,
+       (GLfloat) - 0.163986, (GLfloat) - 0.070836, (GLfloat) - 0.983916,
+       (GLfloat) - 0.163409, (GLfloat) - 0.109554, (GLfloat) - 0.980457,
+       (GLfloat) - 0.163410, (GLfloat) - 0.109553, (GLfloat) - 0.980457,
+       (GLfloat) - 0.514444, (GLfloat) - 0.014299, (GLfloat) - 0.857405,
+       (GLfloat) - 0.514443, (GLfloat) - 0.014299, (GLfloat) - 0.857405,
+       (GLfloat) - 0.164382, (GLfloat) - 0.014019, (GLfloat) - 0.986297,
+       (GLfloat) - 0.164382, (GLfloat) - 0.014019, (GLfloat) - 0.986297,
+       (GLfloat) - 0.164261, (GLfloat) - 0.041017, (GLfloat) - 0.985564,
+       (GLfloat) - 0.164260, (GLfloat) - 0.041017, (GLfloat) - 0.985564,
+       (GLfloat) - 0.514045, (GLfloat) - 0.041836, (GLfloat) - 0.856742,
+       (GLfloat) - 0.514045, (GLfloat) - 0.041836, (GLfloat) - 0.856742,
+       (GLfloat) 0.514443, (GLfloat) - 0.014300, (GLfloat) - 0.857405,
+       (GLfloat) 0.514444, (GLfloat) - 0.014299, (GLfloat) - 0.857405,
+       (GLfloat) 0.514045, (GLfloat) - 0.041836, (GLfloat) - 0.856742,
+       (GLfloat) 0.514045, (GLfloat) - 0.041836, (GLfloat) - 0.856742,
+       (GLfloat) 0.164260, (GLfloat) - 0.041017, (GLfloat) - 0.985564,
+       (GLfloat) 0.164261, (GLfloat) - 0.041017, (GLfloat) - 0.985564,
+       (GLfloat) 0.164382, (GLfloat) - 0.014019, (GLfloat) - 0.986297,
+       (GLfloat) 0.164382, (GLfloat) - 0.014019, (GLfloat) - 0.986297,
+       (GLfloat) 0.511275, (GLfloat) - 0.111720, (GLfloat) - 0.852125,
+       (GLfloat) 0.511276, (GLfloat) - 0.111718, (GLfloat) - 0.852125,
+       (GLfloat) 0.163410, (GLfloat) - 0.109553, (GLfloat) - 0.980457,
+       (GLfloat) 0.163409, (GLfloat) - 0.109554, (GLfloat) - 0.980457,
+       (GLfloat) 0.163986, (GLfloat) - 0.070836, (GLfloat) - 0.983916,
+       (GLfloat) 0.163986, (GLfloat) - 0.070836, (GLfloat) - 0.983916,
+       (GLfloat) 0.513152, (GLfloat) - 0.072244, (GLfloat) - 0.855252,
+       (GLfloat) 0.513151, (GLfloat) - 0.072245, (GLfloat) - 0.855252,
+       (GLfloat) - 0.511275, (GLfloat) - 0.111719, (GLfloat) 0.852125,
+       (GLfloat) - 0.511275, (GLfloat) - 0.111719, (GLfloat) 0.852125,
+       (GLfloat) - 0.163410, (GLfloat) - 0.109554, (GLfloat) 0.980457,
+       (GLfloat) - 0.163409, (GLfloat) - 0.109555, (GLfloat) 0.980457,
+       (GLfloat) - 0.163986, (GLfloat) - 0.070835, (GLfloat) 0.983916,
+       (GLfloat) - 0.163986, (GLfloat) - 0.070835, (GLfloat) 0.983916,
+       (GLfloat) - 0.513151, (GLfloat) - 0.072244, (GLfloat) 0.855252,
+       (GLfloat) - 0.513151, (GLfloat) - 0.072245, (GLfloat) 0.855252,
+       (GLfloat) 0.511275, (GLfloat) - 0.111719, (GLfloat) 0.852125,
+       (GLfloat) 0.511275, (GLfloat) - 0.111719, (GLfloat) 0.852125,
+       (GLfloat) 0.513151, (GLfloat) - 0.072245, (GLfloat) 0.855252,
+       (GLfloat) 0.513151, (GLfloat) - 0.072244, (GLfloat) 0.855252,
+       (GLfloat) 0.163986, (GLfloat) - 0.070835, (GLfloat) 0.983916,
+       (GLfloat) 0.163986, (GLfloat) - 0.070835, (GLfloat) 0.983916,
+       (GLfloat) 0.163409, (GLfloat) - 0.109555, (GLfloat) 0.980457,
+       (GLfloat) 0.163410, (GLfloat) - 0.109554, (GLfloat) 0.980457,
+       (GLfloat) 0.514444, (GLfloat) - 0.014299, (GLfloat) 0.857405,
+       (GLfloat) 0.514443, (GLfloat) - 0.014299, (GLfloat) 0.857405,
+       (GLfloat) 0.164383, (GLfloat) - 0.014019, (GLfloat) 0.986297,
+       (GLfloat) 0.164383, (GLfloat) - 0.014019, (GLfloat) 0.986297,
+       (GLfloat) 0.164261, (GLfloat) - 0.041017, (GLfloat) 0.985564,
+       (GLfloat) 0.164261, (GLfloat) - 0.041017, (GLfloat) 0.985564,
+       (GLfloat) 0.514045, (GLfloat) - 0.041836, (GLfloat) 0.856742,
+       (GLfloat) 0.514045, (GLfloat) - 0.041836, (GLfloat) 0.856742,
+       (GLfloat) - 0.514443, (GLfloat) - 0.014299, (GLfloat) 0.857405,
+       (GLfloat) - 0.514443, (GLfloat) - 0.014299, (GLfloat) 0.857405,
+       (GLfloat) - 0.514045, (GLfloat) - 0.041836, (GLfloat) 0.856742,
+       (GLfloat) - 0.514045, (GLfloat) - 0.041836, (GLfloat) 0.856742,
+       (GLfloat) - 0.164261, (GLfloat) - 0.041017, (GLfloat) 0.985564,
+       (GLfloat) - 0.164261, (GLfloat) - 0.041017, (GLfloat) 0.985564,
+       (GLfloat) - 0.164383, (GLfloat) - 0.014019, (GLfloat) 0.986297,
+       (GLfloat) - 0.164383, (GLfloat) - 0.014019, (GLfloat) 0.986297,
+       (GLfloat) - 0.852125, (GLfloat) - 0.111719, (GLfloat) - 0.511275,
+       (GLfloat) - 0.852125, (GLfloat) - 0.111719, (GLfloat) - 0.511275,
+       (GLfloat) - 0.980457, (GLfloat) - 0.109554, (GLfloat) - 0.163410,
+       (GLfloat) - 0.980457, (GLfloat) - 0.109555, (GLfloat) - 0.163409,
+       (GLfloat) - 0.983916, (GLfloat) - 0.070835, (GLfloat) - 0.163986,
+       (GLfloat) - 0.983916, (GLfloat) - 0.070835, (GLfloat) - 0.163986,
+       (GLfloat) - 0.855252, (GLfloat) - 0.072244, (GLfloat) - 0.513151,
+       (GLfloat) - 0.855252, (GLfloat) - 0.072245, (GLfloat) - 0.513151,
+       (GLfloat) - 0.852125, (GLfloat) - 0.111719, (GLfloat) 0.511275,
+       (GLfloat) - 0.852125, (GLfloat) - 0.111719, (GLfloat) 0.511275,
+       (GLfloat) - 0.855252, (GLfloat) - 0.072245, (GLfloat) 0.513151,
+       (GLfloat) - 0.855252, (GLfloat) - 0.072244, (GLfloat) 0.513151,
+       (GLfloat) - 0.983916, (GLfloat) - 0.070835, (GLfloat) 0.163986,
+       (GLfloat) - 0.983916, (GLfloat) - 0.070835, (GLfloat) 0.163986,
+       (GLfloat) - 0.980457, (GLfloat) - 0.109555, (GLfloat) 0.163409,
+       (GLfloat) - 0.980457, (GLfloat) - 0.109554, (GLfloat) 0.163410,
+       (GLfloat) - 0.857405, (GLfloat) - 0.014299, (GLfloat) 0.514443,
+       (GLfloat) - 0.857405, (GLfloat) - 0.014299, (GLfloat) 0.514443,
+       (GLfloat) - 0.986297, (GLfloat) - 0.014019, (GLfloat) 0.164383,
+       (GLfloat) - 0.986297, (GLfloat) - 0.014019, (GLfloat) 0.164383,
+       (GLfloat) - 0.985564, (GLfloat) - 0.041017, (GLfloat) 0.164261,
+       (GLfloat) - 0.985564, (GLfloat) - 0.041017, (GLfloat) 0.164261,
+       (GLfloat) - 0.856742, (GLfloat) - 0.041836, (GLfloat) 0.514045,
+       (GLfloat) - 0.856742, (GLfloat) - 0.041836, (GLfloat) 0.514045,
+       (GLfloat) - 0.857405, (GLfloat) - 0.014299, (GLfloat) - 0.514443,
+       (GLfloat) - 0.857405, (GLfloat) - 0.014299, (GLfloat) - 0.514444,
+       (GLfloat) - 0.856742, (GLfloat) - 0.041836, (GLfloat) - 0.514045,
+       (GLfloat) - 0.856742, (GLfloat) - 0.041836, (GLfloat) - 0.514045,
+       (GLfloat) - 0.985564, (GLfloat) - 0.041017, (GLfloat) - 0.164261,
+       (GLfloat) - 0.985564, (GLfloat) - 0.041017, (GLfloat) - 0.164261,
+       (GLfloat) - 0.986297, (GLfloat) - 0.014019, (GLfloat) - 0.164383,
+       (GLfloat) - 0.986297, (GLfloat) - 0.014019, (GLfloat) - 0.164383,
+       (GLfloat) - 0.511714, (GLfloat) 0.103845, (GLfloat) - 0.852857,
+       (GLfloat) - 0.511715, (GLfloat) 0.103844, (GLfloat) - 0.852857,
+       (GLfloat) - 0.163545, (GLfloat) 0.101829, (GLfloat) - 0.981267,
+       (GLfloat) - 0.163544, (GLfloat) 0.101829, (GLfloat) - 0.981267,
+       (GLfloat) - 0.164038, (GLfloat) 0.066199, (GLfloat) - 0.984230,
+       (GLfloat) - 0.164039, (GLfloat) 0.066198, (GLfloat) - 0.984230,
+       (GLfloat) - 0.513322, (GLfloat) 0.067516, (GLfloat) - 0.855536,
+       (GLfloat) - 0.513322, (GLfloat) 0.067517, (GLfloat) - 0.855536,
+       (GLfloat) 0.511714, (GLfloat) 0.103845, (GLfloat) - 0.852857,
+       (GLfloat) 0.511715, (GLfloat) 0.103844, (GLfloat) - 0.852857,
+       (GLfloat) 0.513322, (GLfloat) 0.067517, (GLfloat) - 0.855536,
+       (GLfloat) 0.513322, (GLfloat) 0.067516, (GLfloat) - 0.855536,
+       (GLfloat) 0.164038, (GLfloat) 0.066199, (GLfloat) - 0.984230,
+       (GLfloat) 0.164039, (GLfloat) 0.066198, (GLfloat) - 0.984230,
+       (GLfloat) 0.163544, (GLfloat) 0.101829, (GLfloat) - 0.981267,
+       (GLfloat) 0.163545, (GLfloat) 0.101829, (GLfloat) - 0.981267,
+       (GLfloat) 0.514446, (GLfloat) 0.013998, (GLfloat) - 0.857409,
+       (GLfloat) 0.514445, (GLfloat) 0.013999, (GLfloat) - 0.857409,
+       (GLfloat) 0.164383, (GLfloat) 0.013724, (GLfloat) - 0.986301,
+       (GLfloat) 0.164383, (GLfloat) 0.013724, (GLfloat) - 0.986301,
+       (GLfloat) 0.164274, (GLfloat) 0.039013, (GLfloat) - 0.985643,
+       (GLfloat) 0.164273, (GLfloat) 0.039013, (GLfloat) - 0.985643,
+       (GLfloat) 0.514088, (GLfloat) 0.039792, (GLfloat) - 0.856814,
+       (GLfloat) 0.514088, (GLfloat) 0.039792, (GLfloat) - 0.856814,
+       (GLfloat) - 0.514445, (GLfloat) 0.013999, (GLfloat) - 0.857409,
+       (GLfloat) - 0.514446, (GLfloat) 0.013998, (GLfloat) - 0.857409,
+       (GLfloat) - 0.514088, (GLfloat) 0.039792, (GLfloat) - 0.856814,
+       (GLfloat) - 0.514088, (GLfloat) 0.039792, (GLfloat) - 0.856814,
+       (GLfloat) - 0.164273, (GLfloat) 0.039013, (GLfloat) - 0.985643,
+       (GLfloat) - 0.164274, (GLfloat) 0.039013, (GLfloat) - 0.985643,
+       (GLfloat) - 0.164383, (GLfloat) 0.013724, (GLfloat) - 0.986301,
+       (GLfloat) - 0.164383, (GLfloat) 0.013724, (GLfloat) - 0.986301,
+       (GLfloat) - 0.852857, (GLfloat) 0.103845, (GLfloat) - 0.511714,
+       (GLfloat) - 0.852857, (GLfloat) 0.103845, (GLfloat) - 0.511714,
+       (GLfloat) - 0.855536, (GLfloat) 0.067516, (GLfloat) - 0.513322,
+       (GLfloat) - 0.855536, (GLfloat) 0.067516, (GLfloat) - 0.513322,
+       (GLfloat) - 0.984230, (GLfloat) 0.066198, (GLfloat) - 0.164038,
+       (GLfloat) - 0.984230, (GLfloat) 0.066198, (GLfloat) - 0.164039,
+       (GLfloat) - 0.981266, (GLfloat) 0.101830, (GLfloat) - 0.163544,
+       (GLfloat) - 0.981266, (GLfloat) 0.101829, (GLfloat) - 0.163545,
+       (GLfloat) - 0.857409, (GLfloat) 0.013998, (GLfloat) - 0.514446,
+       (GLfloat) - 0.857409, (GLfloat) 0.013999, (GLfloat) - 0.514445,
+       (GLfloat) - 0.986301, (GLfloat) 0.013724, (GLfloat) - 0.164383,
+       (GLfloat) - 0.986301, (GLfloat) 0.013724, (GLfloat) - 0.164383,
+       (GLfloat) - 0.985643, (GLfloat) 0.039013, (GLfloat) - 0.164274,
+       (GLfloat) - 0.985643, (GLfloat) 0.039013, (GLfloat) - 0.164274,
+       (GLfloat) - 0.856814, (GLfloat) 0.039792, (GLfloat) - 0.514088,
+       (GLfloat) - 0.856814, (GLfloat) 0.039792, (GLfloat) - 0.514088,
+       (GLfloat) - 0.857409, (GLfloat) 0.013999, (GLfloat) 0.514445,
+       (GLfloat) - 0.857409, (GLfloat) 0.013998, (GLfloat) 0.514446,
+       (GLfloat) - 0.856814, (GLfloat) 0.039792, (GLfloat) 0.514088,
+       (GLfloat) - 0.856814, (GLfloat) 0.039792, (GLfloat) 0.514088,
+       (GLfloat) - 0.985643, (GLfloat) 0.039013, (GLfloat) 0.164274,
+       (GLfloat) - 0.985643, (GLfloat) 0.039013, (GLfloat) 0.164274,
+       (GLfloat) - 0.986301, (GLfloat) 0.013724, (GLfloat) 0.164383,
+       (GLfloat) - 0.986301, (GLfloat) 0.013724, (GLfloat) 0.164383,
+       (GLfloat) - 0.852857, (GLfloat) 0.103845, (GLfloat) 0.511714,
+       (GLfloat) - 0.852857, (GLfloat) 0.103845, (GLfloat) 0.511714,
+       (GLfloat) - 0.981266, (GLfloat) 0.101829, (GLfloat) 0.163545,
+       (GLfloat) - 0.981266, (GLfloat) 0.101830, (GLfloat) 0.163544,
+       (GLfloat) - 0.984230, (GLfloat) 0.066198, (GLfloat) 0.164038,
+       (GLfloat) - 0.984230, (GLfloat) 0.066198, (GLfloat) 0.164039,
+       (GLfloat) - 0.855536, (GLfloat) 0.067516, (GLfloat) 0.513322,
+       (GLfloat) - 0.855536, (GLfloat) 0.067516, (GLfloat) 0.513322,
+       (GLfloat) - 0.511714, (GLfloat) 0.103845, (GLfloat) 0.852857,
+       (GLfloat) - 0.511714, (GLfloat) 0.103845, (GLfloat) 0.852857,
+       (GLfloat) - 0.513322, (GLfloat) 0.067516, (GLfloat) 0.855536,
+       (GLfloat) - 0.513322, (GLfloat) 0.067516, (GLfloat) 0.855536,
+       (GLfloat) - 0.164038, (GLfloat) 0.066198, (GLfloat) 0.984230,
+       (GLfloat) - 0.164039, (GLfloat) 0.066198, (GLfloat) 0.984230,
+       (GLfloat) - 0.163544, (GLfloat) 0.101830, (GLfloat) 0.981266,
+       (GLfloat) - 0.163545, (GLfloat) 0.101829, (GLfloat) 0.981266,
+       (GLfloat) - 0.514446, (GLfloat) 0.013998, (GLfloat) 0.857409,
+       (GLfloat) - 0.514445, (GLfloat) 0.013999, (GLfloat) 0.857409,
+       (GLfloat) - 0.164383, (GLfloat) 0.013724, (GLfloat) 0.986301,
+       (GLfloat) - 0.164383, (GLfloat) 0.013724, (GLfloat) 0.986301,
+       (GLfloat) - 0.164274, (GLfloat) 0.039013, (GLfloat) 0.985643,
+       (GLfloat) - 0.164274, (GLfloat) 0.039013, (GLfloat) 0.985643,
+       (GLfloat) - 0.514088, (GLfloat) 0.039792, (GLfloat) 0.856814,
+       (GLfloat) - 0.514088, (GLfloat) 0.039792, (GLfloat) 0.856814,
+       (GLfloat) 0.514445, (GLfloat) 0.013999, (GLfloat) 0.857409,
+       (GLfloat) 0.514446, (GLfloat) 0.013998, (GLfloat) 0.857409,
+       (GLfloat) 0.514088, (GLfloat) 0.039792, (GLfloat) 0.856814,
+       (GLfloat) 0.514088, (GLfloat) 0.039792, (GLfloat) 0.856814,
+       (GLfloat) 0.164274, (GLfloat) 0.039013, (GLfloat) 0.985643,
+       (GLfloat) 0.164274, (GLfloat) 0.039013, (GLfloat) 0.985643,
+       (GLfloat) 0.164383, (GLfloat) 0.013724, (GLfloat) 0.986301,
+       (GLfloat) 0.164383, (GLfloat) 0.013724, (GLfloat) 0.986301,
+       (GLfloat) 0.511714, (GLfloat) 0.103845, (GLfloat) 0.852857,
+       (GLfloat) 0.511714, (GLfloat) 0.103845, (GLfloat) 0.852857,
+       (GLfloat) 0.163545, (GLfloat) 0.101829, (GLfloat) 0.981266,
+       (GLfloat) 0.163544, (GLfloat) 0.101830, (GLfloat) 0.981266,
+       (GLfloat) 0.164038, (GLfloat) 0.066198, (GLfloat) 0.984230,
+       (GLfloat) 0.164039, (GLfloat) 0.066198, (GLfloat) 0.984230,
+       (GLfloat) 0.513322, (GLfloat) 0.067516, (GLfloat) 0.855536,
+       (GLfloat) 0.513322, (GLfloat) 0.067516, (GLfloat) 0.855536,
+       (GLfloat) 0.852857, (GLfloat) 0.103845, (GLfloat) 0.511714,
+       (GLfloat) 0.852857, (GLfloat) 0.103844, (GLfloat) 0.511715,
+       (GLfloat) 0.855536, (GLfloat) 0.067517, (GLfloat) 0.513322,
+       (GLfloat) 0.855536, (GLfloat) 0.067516, (GLfloat) 0.513322,
+       (GLfloat) 0.984230, (GLfloat) 0.066199, (GLfloat) 0.164038,
+       (GLfloat) 0.984230, (GLfloat) 0.066198, (GLfloat) 0.164039,
+       (GLfloat) 0.981267, (GLfloat) 0.101829, (GLfloat) 0.163544,
+       (GLfloat) 0.981267, (GLfloat) 0.101829, (GLfloat) 0.163545,
+       (GLfloat) 0.857409, (GLfloat) 0.013998, (GLfloat) 0.514446,
+       (GLfloat) 0.857409, (GLfloat) 0.013999, (GLfloat) 0.514445,
+       (GLfloat) 0.986301, (GLfloat) 0.013724, (GLfloat) 0.164383,
+       (GLfloat) 0.986301, (GLfloat) 0.013724, (GLfloat) 0.164383,
+       (GLfloat) 0.985643, (GLfloat) 0.039013, (GLfloat) 0.164274,
+       (GLfloat) 0.985643, (GLfloat) 0.039013, (GLfloat) 0.164273,
+       (GLfloat) 0.856814, (GLfloat) 0.039792, (GLfloat) 0.514088,
+       (GLfloat) 0.856814, (GLfloat) 0.039792, (GLfloat) 0.514088,
+       (GLfloat) 0.857409, (GLfloat) 0.013999, (GLfloat) - 0.514445,
+       (GLfloat) 0.857409, (GLfloat) 0.013998, (GLfloat) - 0.514446,
+       (GLfloat) 0.856814, (GLfloat) 0.039792, (GLfloat) - 0.514088,
+       (GLfloat) 0.856814, (GLfloat) 0.039792, (GLfloat) - 0.514088,
+       (GLfloat) 0.985643, (GLfloat) 0.039013, (GLfloat) - 0.164273,
+       (GLfloat) 0.985643, (GLfloat) 0.039013, (GLfloat) - 0.164274,
+       (GLfloat) 0.986301, (GLfloat) 0.013724, (GLfloat) - 0.164383,
+       (GLfloat) 0.986301, (GLfloat) 0.013724, (GLfloat) - 0.164383,
+       (GLfloat) 0.852857, (GLfloat) 0.103845, (GLfloat) - 0.511714,
+       (GLfloat) 0.852857, (GLfloat) 0.103844, (GLfloat) - 0.511715,
+       (GLfloat) 0.981267, (GLfloat) 0.101829, (GLfloat) - 0.163545,
+       (GLfloat) 0.981267, (GLfloat) 0.101829, (GLfloat) - 0.163544,
+       (GLfloat) 0.984230, (GLfloat) 0.066199, (GLfloat) - 0.164038,
+       (GLfloat) 0.984230, (GLfloat) 0.066198, (GLfloat) - 0.164039,
+       (GLfloat) 0.855536, (GLfloat) 0.067516, (GLfloat) - 0.513322,
+       (GLfloat) 0.855536, (GLfloat) 0.067517, (GLfloat) - 0.513322,
+       (GLfloat) 0.845633, (GLfloat) 0.165745, (GLfloat) 0.507379,
+       (GLfloat) 0.845633, (GLfloat) 0.165745, (GLfloat) 0.507379,
+       (GLfloat) 0.973270, (GLfloat) 0.162582, (GLfloat) 0.162211,
+       (GLfloat) 0.973270, (GLfloat) 0.162582, (GLfloat) 0.162212,
+       (GLfloat) 0.985759, (GLfloat) 0.022905, (GLfloat) 0.166594,
+       (GLfloat) 0.986250, (GLfloat) 0.017105, (GLfloat) 0.164375,
+       (GLfloat) 0.856160, (GLfloat) 0.009467, (GLfloat) 0.516625,
+       (GLfloat) 0.857388, (GLfloat) 0.015640, (GLfloat) 0.514433,
+       (GLfloat) 0.845633, (GLfloat) 0.165745, (GLfloat) - 0.507380,
+       (GLfloat) 0.845633, (GLfloat) 0.165745, (GLfloat) - 0.507379,
+       (GLfloat) 0.856160, (GLfloat) 0.009468, (GLfloat) - 0.516624,
+       (GLfloat) 0.857388, (GLfloat) 0.015640, (GLfloat) - 0.514433,
+       (GLfloat) 0.985759, (GLfloat) 0.022905, (GLfloat) - 0.166594,
+       (GLfloat) 0.986250, (GLfloat) 0.017105, (GLfloat) - 0.164375,
+       (GLfloat) 0.973270, (GLfloat) 0.162582, (GLfloat) - 0.162211,
+       (GLfloat) 0.973270, (GLfloat) 0.162582, (GLfloat) - 0.162212,
+       (GLfloat) 0.283621, (GLfloat) - 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) 0.264056, (GLfloat) - 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) 0.315105, (GLfloat) - 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) 0.304029, (GLfloat) - 0.949849, (GLfloat) - 0.073162,
+       (GLfloat) 0.789686, (GLfloat) - 0.598377, (GLfloat) - 0.135427,
+       (GLfloat) 0.809934, (GLfloat) - 0.566659, (GLfloat) - 0.151344,
+       (GLfloat) 0.656717, (GLfloat) - 0.640092, (GLfloat) - 0.398754,
+       (GLfloat) 0.671170, (GLfloat) - 0.608876, (GLfloat) - 0.422849,
+       (GLfloat) 0.264055, (GLfloat) - 0.947923, (GLfloat) 0.178092,
+       (GLfloat) 0.283621, (GLfloat) - 0.936578, (GLfloat) 0.205866,
+       (GLfloat) 0.656718, (GLfloat) - 0.640092, (GLfloat) 0.398754,
+       (GLfloat) 0.671170, (GLfloat) - 0.608876, (GLfloat) 0.422849,
+       (GLfloat) 0.809934, (GLfloat) - 0.566659, (GLfloat) 0.151344,
+       (GLfloat) 0.789686, (GLfloat) - 0.598377, (GLfloat) 0.135427,
+       (GLfloat) 0.304029, (GLfloat) - 0.949849, (GLfloat) 0.073162,
+       (GLfloat) 0.315105, (GLfloat) - 0.946548, (GLfloat) 0.068965,
+       (GLfloat) 0.507379, (GLfloat) 0.165745, (GLfloat) - 0.845633,
+       (GLfloat) 0.507380, (GLfloat) 0.165745, (GLfloat) - 0.845633,
+       (GLfloat) 0.162211, (GLfloat) 0.162582, (GLfloat) - 0.973270,
+       (GLfloat) 0.162212, (GLfloat) 0.162582, (GLfloat) - 0.973270,
+       (GLfloat) 0.166594, (GLfloat) 0.022905, (GLfloat) - 0.985759,
+       (GLfloat) 0.164375, (GLfloat) 0.017105, (GLfloat) - 0.986250,
+       (GLfloat) 0.516624, (GLfloat) 0.009468, (GLfloat) - 0.856160,
+       (GLfloat) 0.514433, (GLfloat) 0.015640, (GLfloat) - 0.857388,
+       (GLfloat) - 0.507379, (GLfloat) 0.165745, (GLfloat) - 0.845633,
+       (GLfloat) - 0.507379, (GLfloat) 0.165745, (GLfloat) - 0.845633,
+       (GLfloat) - 0.516625, (GLfloat) 0.009467, (GLfloat) - 0.856160,
+       (GLfloat) - 0.514433, (GLfloat) 0.015640, (GLfloat) - 0.857388,
+       (GLfloat) - 0.166594, (GLfloat) 0.022905, (GLfloat) - 0.985759,
+       (GLfloat) - 0.164375, (GLfloat) 0.017105, (GLfloat) - 0.986250,
+       (GLfloat) - 0.162211, (GLfloat) 0.162582, (GLfloat) - 0.973270,
+       (GLfloat) - 0.162212, (GLfloat) 0.162582, (GLfloat) - 0.973270,
+       (GLfloat) - 0.205866, (GLfloat) - 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) - 0.178092, (GLfloat) - 0.947923, (GLfloat) - 0.264055,
+       (GLfloat) - 0.068965, (GLfloat) - 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) - 0.073162, (GLfloat) - 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) - 0.135427, (GLfloat) - 0.598377, (GLfloat) - 0.789686,
+       (GLfloat) - 0.151344, (GLfloat) - 0.566659, (GLfloat) - 0.809934,
+       (GLfloat) - 0.398754, (GLfloat) - 0.640092, (GLfloat) - 0.656718,
+       (GLfloat) - 0.422849, (GLfloat) - 0.608876, (GLfloat) - 0.671170,
+       (GLfloat) 0.178092, (GLfloat) - 0.947923, (GLfloat) - 0.264056,
+       (GLfloat) 0.205866, (GLfloat) - 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) 0.398754, (GLfloat) - 0.640092, (GLfloat) - 0.656717,
+       (GLfloat) 0.422849, (GLfloat) - 0.608876, (GLfloat) - 0.671170,
+       (GLfloat) 0.151344, (GLfloat) - 0.566659, (GLfloat) - 0.809934,
+       (GLfloat) 0.135427, (GLfloat) - 0.598377, (GLfloat) - 0.789686,
+       (GLfloat) 0.073162, (GLfloat) - 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) 0.068965, (GLfloat) - 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) - 0.845633, (GLfloat) 0.165746, (GLfloat) - 0.507379,
+       (GLfloat) - 0.845632, (GLfloat) 0.165746, (GLfloat) - 0.507380,
+       (GLfloat) - 0.973270, (GLfloat) 0.162582, (GLfloat) - 0.162211,
+       (GLfloat) - 0.973270, (GLfloat) 0.162582, (GLfloat) - 0.162212,
+       (GLfloat) - 0.985759, (GLfloat) 0.022905, (GLfloat) - 0.166594,
+       (GLfloat) - 0.986250, (GLfloat) 0.017105, (GLfloat) - 0.164375,
+       (GLfloat) - 0.856160, (GLfloat) 0.009467, (GLfloat) - 0.516625,
+       (GLfloat) - 0.857388, (GLfloat) 0.015640, (GLfloat) - 0.514433,
+       (GLfloat) - 0.845633, (GLfloat) 0.165746, (GLfloat) 0.507379,
+       (GLfloat) - 0.845632, (GLfloat) 0.165746, (GLfloat) 0.507380,
+       (GLfloat) - 0.856159, (GLfloat) 0.009466, (GLfloat) 0.516625,
+       (GLfloat) - 0.857388, (GLfloat) 0.015640, (GLfloat) 0.514433,
+       (GLfloat) - 0.985759, (GLfloat) 0.022905, (GLfloat) 0.166594,
+       (GLfloat) - 0.986250, (GLfloat) 0.017105, (GLfloat) 0.164375,
+       (GLfloat) - 0.973270, (GLfloat) 0.162582, (GLfloat) 0.162211,
+       (GLfloat) - 0.973270, (GLfloat) 0.162582, (GLfloat) 0.162212,
+       (GLfloat) - 0.283620, (GLfloat) - 0.936578, (GLfloat) 0.205866,
+       (GLfloat) - 0.264055, (GLfloat) - 0.947923, (GLfloat) 0.178091,
+       (GLfloat) - 0.315105, (GLfloat) - 0.946548, (GLfloat) 0.068965,
+       (GLfloat) - 0.304029, (GLfloat) - 0.949849, (GLfloat) 0.073162,
+       (GLfloat) - 0.789686, (GLfloat) - 0.598377, (GLfloat) 0.135427,
+       (GLfloat) - 0.809934, (GLfloat) - 0.566659, (GLfloat) 0.151344,
+       (GLfloat) - 0.656718, (GLfloat) - 0.640090, (GLfloat) 0.398755,
+       (GLfloat) - 0.671170, (GLfloat) - 0.608876, (GLfloat) 0.422848,
+       (GLfloat) - 0.264055, (GLfloat) - 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) - 0.283620, (GLfloat) - 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) - 0.656718, (GLfloat) - 0.640091, (GLfloat) - 0.398755,
+       (GLfloat) - 0.671170, (GLfloat) - 0.608876, (GLfloat) - 0.422848,
+       (GLfloat) - 0.809934, (GLfloat) - 0.566659, (GLfloat) - 0.151344,
+       (GLfloat) - 0.789686, (GLfloat) - 0.598377, (GLfloat) - 0.135427,
+       (GLfloat) - 0.304029, (GLfloat) - 0.949849, (GLfloat) - 0.073163,
+       (GLfloat) - 0.315105, (GLfloat) - 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) - 0.507380, (GLfloat) 0.165746, (GLfloat) 0.845632,
+       (GLfloat) - 0.507379, (GLfloat) 0.165746, (GLfloat) 0.845633,
+       (GLfloat) - 0.162211, (GLfloat) 0.162582, (GLfloat) 0.973270,
+       (GLfloat) - 0.162212, (GLfloat) 0.162582, (GLfloat) 0.973270,
+       (GLfloat) - 0.166594, (GLfloat) 0.022905, (GLfloat) 0.985759,
+       (GLfloat) - 0.164375, (GLfloat) 0.017105, (GLfloat) 0.986250,
+       (GLfloat) - 0.516625, (GLfloat) 0.009466, (GLfloat) 0.856159,
+       (GLfloat) - 0.514433, (GLfloat) 0.015640, (GLfloat) 0.857388,
+       (GLfloat) 0.507380, (GLfloat) 0.165746, (GLfloat) 0.845632,
+       (GLfloat) 0.507379, (GLfloat) 0.165746, (GLfloat) 0.845633,
+       (GLfloat) 0.516625, (GLfloat) 0.009467, (GLfloat) 0.856160,
+       (GLfloat) 0.514433, (GLfloat) 0.015640, (GLfloat) 0.857388,
+       (GLfloat) 0.166594, (GLfloat) 0.022905, (GLfloat) 0.985759,
+       (GLfloat) 0.164375, (GLfloat) 0.017105, (GLfloat) 0.986250,
+       (GLfloat) 0.162211, (GLfloat) 0.162582, (GLfloat) 0.973270,
+       (GLfloat) 0.162212, (GLfloat) 0.162582, (GLfloat) 0.973270,
+       (GLfloat) 0.205866, (GLfloat) - 0.936578, (GLfloat) 0.283620,
+       (GLfloat) 0.178092, (GLfloat) - 0.947923, (GLfloat) 0.264055,
+       (GLfloat) 0.068965, (GLfloat) - 0.946548, (GLfloat) 0.315105,
+       (GLfloat) 0.073163, (GLfloat) - 0.949849, (GLfloat) 0.304029,
+       (GLfloat) 0.135427, (GLfloat) - 0.598377, (GLfloat) 0.789686,
+       (GLfloat) 0.151344, (GLfloat) - 0.566659, (GLfloat) 0.809934,
+       (GLfloat) 0.398755, (GLfloat) - 0.640091, (GLfloat) 0.656718,
+       (GLfloat) 0.422848, (GLfloat) - 0.608876, (GLfloat) 0.671170,
+       (GLfloat) - 0.178091, (GLfloat) - 0.947923, (GLfloat) 0.264055,
+       (GLfloat) - 0.205866, (GLfloat) - 0.936578, (GLfloat) 0.283620,
+       (GLfloat) - 0.398755, (GLfloat) - 0.640090, (GLfloat) 0.656718,
+       (GLfloat) - 0.422848, (GLfloat) - 0.608876, (GLfloat) 0.671170,
+       (GLfloat) - 0.151344, (GLfloat) - 0.566659, (GLfloat) 0.809934,
+       (GLfloat) - 0.135427, (GLfloat) - 0.598377, (GLfloat) 0.789686,
+       (GLfloat) - 0.073162, (GLfloat) - 0.949849, (GLfloat) 0.304029,
+       (GLfloat) - 0.068965, (GLfloat) - 0.946548, (GLfloat) 0.315105,
+       (GLfloat) 0.135802, (GLfloat) - 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) 0.124011, (GLfloat) - 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) 0.043834, (GLfloat) - 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) 0.039656, (GLfloat) - 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) 0.030163, (GLfloat) - 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) 0.033079, (GLfloat) - 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) 0.109621, (GLfloat) - 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) 0.114709, (GLfloat) - 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) - 0.124011, (GLfloat) - 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) - 0.135802, (GLfloat) - 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) - 0.109621, (GLfloat) - 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) - 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) - 0.033079, (GLfloat) - 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) - 0.030163, (GLfloat) - 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) - 0.043834, (GLfloat) - 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) - 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) - 0.135802, (GLfloat) - 0.982944, (GLfloat) 0.124011,
+       (GLfloat) - 0.124011, (GLfloat) - 0.982944, (GLfloat) 0.135802,
+       (GLfloat) - 0.043834, (GLfloat) - 0.993006, (GLfloat) 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) - 0.992607, (GLfloat) 0.114709,
+       (GLfloat) - 0.030163, (GLfloat) - 0.998998, (GLfloat) 0.033079,
+       (GLfloat) - 0.033079, (GLfloat) - 0.998998, (GLfloat) 0.030163,
+       (GLfloat) - 0.109621, (GLfloat) - 0.993006, (GLfloat) 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) - 0.992607, (GLfloat) 0.039656,
+       (GLfloat) 0.124011, (GLfloat) - 0.982944, (GLfloat) 0.135802,
+       (GLfloat) 0.135802, (GLfloat) - 0.982944, (GLfloat) 0.124011,
+       (GLfloat) 0.109621, (GLfloat) - 0.993006, (GLfloat) 0.043834,
+       (GLfloat) 0.114709, (GLfloat) - 0.992607, (GLfloat) 0.039656,
+       (GLfloat) 0.033079, (GLfloat) - 0.998998, (GLfloat) 0.030163,
+       (GLfloat) 0.030163, (GLfloat) - 0.998998, (GLfloat) 0.033079,
+       (GLfloat) 0.043834, (GLfloat) - 0.993006, (GLfloat) 0.109621,
+       (GLfloat) 0.039656, (GLfloat) - 0.992607, (GLfloat) 0.114709,
+};
+
+static unsigned short int s1_1_POLS[] =
+{
+      3, 12, 76, 74, 1, 3, 12, 74, 82, 1, 3, 76, 22, 78, 1, 3, 78, 74, 76, 1,
+      3, 78, 20, 80, 1, 3, 80, 74, 78, 1, 3, 80, 28, 82, 1, 3, 82, 74, 80, 1,
+      3, 13, 84, 77, 1, 3, 13, 77, 88, 1, 3, 84, 24, 86, 1, 3, 86, 77, 84, 1,
+      3, 86, 20, 78, 1, 3, 78, 77, 86, 1, 3, 78, 22, 88, 1, 3, 88, 77, 78, 1,
+      3, 14, 90, 85, 1, 3, 14, 85, 93, 1, 3, 26, 91, 85, 1, 3, 26, 85, 90, 1,
+      3, 20, 86, 85, 1, 3, 20, 85, 91, 1, 3, 86, 24, 93, 1, 3, 93, 85, 86, 1,
+      3, 15, 95, 79, 1, 3, 15, 79, 97, 1, 3, 95, 28, 80, 1, 3, 80, 79, 95, 1,
+      3, 20, 91, 79, 1, 3, 20, 79, 80, 1, 3, 26, 97, 79, 1, 3, 26, 79, 91, 1,
+    3, 13, 99, 83, 1, 3, 13, 83, 84, 1, 3, 99, 30, 101, 1, 3, 101, 83, 99, 1,
+3, 101, 23, 102, 1, 3, 102, 83, 101, 1, 3, 102, 24, 84, 1, 3, 84, 83, 102, 1,
+       3, 16, 104, 100, 1, 3, 16, 100, 108, 1, 3, 104, 32, 106, 1, 3, 106, 100, 104, 1,
+       3, 106, 23, 101, 1, 3, 101, 100, 106, 1, 3, 101, 30, 108, 1, 3, 108, 100, 101, 1,
+       3, 17, 110, 105, 1, 3, 17, 105, 113, 1, 3, 33, 111, 105, 1, 3, 33, 105, 110, 1,
+       3, 23, 106, 105, 1, 3, 23, 105, 111, 1, 3, 106, 32, 113, 1, 3, 113, 105, 106, 1,
+   3, 14, 93, 92, 1, 3, 14, 92, 114, 1, 3, 93, 24, 102, 1, 3, 102, 92, 93, 1,
+  3, 23, 111, 92, 1, 3, 23, 92, 102, 1, 3, 33, 114, 92, 1, 3, 33, 92, 111, 1,
+       3, 16, 116, 103, 1, 3, 16, 103, 104, 1, 3, 116, 35, 118, 1, 3, 118, 103, 116, 1,
+       3, 118, 31, 119, 1, 3, 119, 103, 118, 1, 3, 119, 32, 104, 1, 3, 104, 103, 119, 1,
+       3, 18, 121, 117, 1, 3, 18, 117, 125, 1, 3, 121, 36, 123, 1, 3, 123, 117, 121, 1,
+       3, 123, 31, 118, 1, 3, 118, 117, 123, 1, 3, 118, 35, 125, 1, 3, 125, 117, 118, 1,
+       3, 19, 127, 122, 1, 3, 19, 122, 130, 1, 3, 37, 128, 122, 1, 3, 37, 122, 127, 1,
+       3, 31, 123, 122, 1, 3, 31, 122, 128, 1, 3, 123, 36, 130, 1, 3, 130, 122, 123, 1,
+       3, 17, 113, 112, 1, 3, 17, 112, 131, 1, 3, 113, 32, 119, 1, 3, 119, 112, 113, 1,
+       3, 31, 128, 112, 1, 3, 31, 112, 119, 1, 3, 37, 131, 112, 1, 3, 37, 112, 128, 1,
+       3, 18, 133, 120, 1, 3, 18, 120, 121, 1, 3, 133, 39, 134, 1, 3, 134, 120, 133, 1,
+       3, 134, 27, 135, 1, 3, 135, 120, 134, 1, 3, 135, 36, 121, 1, 3, 121, 120, 135, 1,
+   3, 12, 82, 81, 1, 3, 12, 81, 138, 1, 3, 82, 28, 136, 1, 3, 136, 81, 82, 1,
+       3, 136, 27, 134, 1, 3, 134, 81, 136, 1, 3, 134, 39, 138, 1, 3, 138, 81, 134, 1,
+   3, 15, 139, 94, 1, 3, 15, 94, 95, 1, 3, 40, 140, 94, 1, 3, 40, 94, 139, 1,
+  3, 27, 136, 94, 1, 3, 27, 94, 140, 1, 3, 136, 28, 95, 1, 3, 95, 94, 136, 1,
+       3, 19, 130, 129, 1, 3, 19, 129, 141, 1, 3, 130, 36, 135, 1, 3, 135, 129, 130, 1,
+       3, 27, 140, 129, 1, 3, 27, 129, 135, 1, 3, 40, 141, 129, 1, 3, 40, 129, 140, 1,
+ 3, 14, 114, 89, 1, 3, 14, 89, 90, 1, 3, 114, 33, 142, 1, 3, 142, 89, 114, 1,
+  3, 25, 143, 89, 1, 3, 25, 89, 142, 1, 3, 143, 26, 90, 1, 3, 90, 89, 143, 1,
+       3, 17, 131, 109, 1, 3, 17, 109, 110, 1, 3, 131, 37, 144, 1, 3, 144, 109, 131, 1,
+       3, 25, 142, 109, 1, 3, 25, 109, 144, 1, 3, 142, 33, 110, 1, 3, 110, 109, 142, 1,
+       3, 19, 141, 126, 1, 3, 19, 126, 127, 1, 3, 141, 40, 145, 1, 3, 145, 126, 141, 1,
+       3, 25, 144, 126, 1, 3, 25, 126, 145, 1, 3, 144, 37, 127, 1, 3, 127, 126, 144, 1,
+   3, 15, 97, 96, 1, 3, 15, 96, 139, 1, 3, 97, 26, 143, 1, 3, 143, 96, 97, 1,
+3, 25, 145, 96, 1, 3, 25, 96, 143, 1, 3, 145, 40, 139, 1, 3, 139, 96, 145, 1,
+  3, 76, 12, 146, 1, 3, 146, 75, 76, 1, 3, 41, 148, 75, 1, 3, 41, 75, 146, 1,
+ 3, 148, 21, 149, 1, 3, 149, 75, 148, 1, 3, 22, 76, 75, 1, 3, 22, 75, 149, 1,
+3, 8, 151, 147, 1, 3, 8, 147, 155, 1, 3, 151, 43, 153, 1, 3, 153, 147, 151, 1,
+       3, 21, 148, 147, 1, 3, 21, 147, 153, 1, 3, 148, 41, 155, 1, 3, 155, 147, 148, 1,
+       3, 11, 157, 152, 1, 3, 11, 152, 160, 1, 3, 157, 44, 158, 1, 3, 158, 152, 157, 1,
+       3, 21, 153, 152, 1, 3, 21, 152, 158, 1, 3, 153, 43, 160, 1, 3, 160, 152, 153, 1,
+   3, 161, 13, 88, 1, 3, 88, 87, 161, 1, 3, 22, 149, 87, 1, 3, 22, 87, 88, 1,
+3, 149, 21, 158, 1, 3, 158, 87, 149, 1, 3, 44, 161, 87, 1, 3, 44, 87, 158, 1,
+       3, 133, 18, 162, 1, 3, 162, 132, 133, 1, 3, 45, 164, 132, 1, 3, 45, 132, 162, 1,
+       3, 164, 38, 165, 1, 3, 165, 132, 164, 1, 3, 39, 133, 132, 1, 3, 39, 132, 165, 1,
+3, 9, 167, 163, 1, 3, 9, 163, 170, 1, 3, 167, 47, 168, 1, 3, 168, 163, 167, 1,
+       3, 38, 164, 163, 1, 3, 38, 163, 168, 1, 3, 164, 45, 170, 1, 3, 170, 163, 164, 1,
+3, 8, 155, 154, 1, 3, 8, 154, 173, 1, 3, 155, 41, 171, 1, 3, 171, 154, 155, 1,
+       3, 38, 168, 154, 1, 3, 38, 154, 171, 1, 3, 168, 47, 173, 1, 3, 173, 154, 168, 1,
+       3, 146, 12, 138, 1, 3, 138, 137, 146, 1, 3, 39, 165, 137, 1, 3, 39, 137, 138, 1,
+       3, 165, 38, 171, 1, 3, 171, 137, 165, 1, 3, 41, 146, 137, 1, 3, 41, 137, 171, 1,
+       3, 177, 16, 108, 1, 3, 108, 107, 177, 1, 3, 30, 174, 107, 1, 3, 30, 107, 108, 1,
+       3, 174, 29, 176, 1, 3, 176, 107, 174, 1, 3, 50, 177, 107, 1, 3, 50, 107, 176, 1,
+  3, 99, 13, 161, 1, 3, 161, 98, 99, 1, 3, 44, 178, 98, 1, 3, 44, 98, 161, 1,
+ 3, 178, 29, 174, 1, 3, 174, 98, 178, 1, 3, 30, 99, 98, 1, 3, 30, 98, 174, 1,
+       3, 11, 180, 156, 1, 3, 11, 156, 157, 1, 3, 180, 49, 181, 1, 3, 181, 156, 180, 1,
+       3, 29, 178, 156, 1, 3, 29, 156, 181, 1, 3, 178, 44, 157, 1, 3, 157, 156, 178, 1,
+       3, 10, 183, 175, 1, 3, 10, 175, 185, 1, 3, 183, 50, 176, 1, 3, 176, 175, 183, 1,
+       3, 29, 181, 175, 1, 3, 29, 175, 176, 1, 3, 181, 49, 185, 1, 3, 185, 175, 181, 1,
+       3, 162, 18, 125, 1, 3, 125, 124, 162, 1, 3, 35, 186, 124, 1, 3, 35, 124, 125, 1,
+       3, 186, 34, 187, 1, 3, 187, 124, 186, 1, 3, 45, 162, 124, 1, 3, 45, 124, 187, 1,
+       3, 116, 16, 177, 1, 3, 177, 115, 116, 1, 3, 50, 188, 115, 1, 3, 50, 115, 177, 1,
+       3, 188, 34, 186, 1, 3, 186, 115, 188, 1, 3, 35, 116, 115, 1, 3, 35, 115, 186, 1,
+       3, 10, 190, 182, 1, 3, 10, 182, 183, 1, 3, 190, 52, 191, 1, 3, 191, 182, 190, 1,
+       3, 34, 188, 182, 1, 3, 34, 182, 191, 1, 3, 188, 50, 183, 1, 3, 183, 182, 188, 1,
+3, 9, 170, 169, 1, 3, 9, 169, 193, 1, 3, 170, 45, 187, 1, 3, 187, 169, 170, 1,
+       3, 34, 191, 169, 1, 3, 34, 169, 187, 1, 3, 191, 52, 193, 1, 3, 193, 169, 191, 1,
+       3, 201, 1, 196, 1, 3, 196, 194, 201, 1, 3, 54, 198, 194, 1, 3, 54, 194, 196, 1,
+       3, 198, 46, 199, 1, 3, 199, 194, 198, 1, 3, 56, 201, 194, 1, 3, 56, 194, 199, 1,
+       3, 206, 3, 203, 1, 3, 203, 197, 206, 1, 3, 55, 204, 197, 1, 3, 55, 197, 203, 1,
+       3, 204, 46, 198, 1, 3, 198, 197, 204, 1, 3, 54, 206, 197, 1, 3, 54, 197, 198, 1,
+3, 8, 173, 172, 1, 3, 8, 172, 208, 1, 3, 173, 47, 207, 1, 3, 207, 172, 173, 1,
+       3, 46, 204, 172, 1, 3, 46, 172, 207, 1, 3, 204, 55, 208, 1, 3, 208, 172, 204, 1,
+3, 9, 209, 166, 1, 3, 9, 166, 167, 1, 3, 209, 56, 199, 1, 3, 199, 166, 209, 1,
+       3, 46, 207, 166, 1, 3, 46, 166, 199, 1, 3, 207, 47, 167, 1, 3, 167, 166, 207, 1,
+       3, 214, 1, 201, 1, 3, 201, 200, 214, 1, 3, 56, 210, 200, 1, 3, 56, 200, 201, 1,
+       3, 210, 51, 212, 1, 3, 212, 200, 210, 1, 3, 59, 214, 200, 1, 3, 59, 200, 212, 1,
+3, 9, 193, 192, 1, 3, 9, 192, 209, 1, 3, 193, 52, 215, 1, 3, 215, 192, 193, 1,
+       3, 51, 210, 192, 1, 3, 51, 192, 215, 1, 3, 210, 56, 209, 1, 3, 209, 192, 210, 1,
+       3, 10, 216, 189, 1, 3, 10, 189, 190, 1, 3, 216, 57, 217, 1, 3, 217, 189, 216, 1,
+       3, 51, 215, 189, 1, 3, 51, 189, 217, 1, 3, 215, 52, 190, 1, 3, 190, 189, 215, 1,
+       3, 221, 0, 219, 1, 3, 219, 211, 221, 1, 3, 59, 212, 211, 1, 3, 59, 211, 219, 1,
+       3, 212, 51, 217, 1, 3, 217, 211, 212, 1, 3, 57, 221, 211, 1, 3, 57, 211, 217, 1,
+       3, 226, 0, 221, 1, 3, 221, 220, 226, 1, 3, 57, 222, 220, 1, 3, 57, 220, 221, 1,
+       3, 222, 48, 224, 1, 3, 224, 220, 222, 1, 3, 62, 226, 220, 1, 3, 62, 220, 224, 1,
+       3, 10, 185, 184, 1, 3, 10, 184, 216, 1, 3, 185, 49, 227, 1, 3, 227, 184, 185, 1,
+       3, 48, 222, 184, 1, 3, 48, 184, 227, 1, 3, 222, 57, 216, 1, 3, 216, 184, 222, 1,
+       3, 11, 228, 179, 1, 3, 11, 179, 180, 1, 3, 228, 60, 229, 1, 3, 229, 179, 228, 1,
+       3, 48, 227, 179, 1, 3, 48, 179, 229, 1, 3, 227, 49, 180, 1, 3, 180, 179, 227, 1,
+       3, 233, 2, 231, 1, 3, 231, 223, 233, 1, 3, 62, 224, 223, 1, 3, 62, 223, 231, 1,
+       3, 224, 48, 229, 1, 3, 229, 223, 224, 1, 3, 60, 233, 223, 1, 3, 60, 223, 229, 1,
+       3, 237, 2, 233, 1, 3, 233, 232, 237, 1, 3, 60, 234, 232, 1, 3, 60, 232, 233, 1,
+       3, 234, 42, 235, 1, 3, 235, 232, 234, 1, 3, 64, 237, 232, 1, 3, 64, 232, 235, 1,
+       3, 11, 160, 159, 1, 3, 11, 159, 228, 1, 3, 160, 43, 238, 1, 3, 238, 159, 160, 1,
+       3, 42, 234, 159, 1, 3, 42, 159, 238, 1, 3, 234, 60, 228, 1, 3, 228, 159, 234, 1,
+3, 8, 208, 150, 1, 3, 8, 150, 151, 1, 3, 208, 55, 239, 1, 3, 239, 150, 208, 1,
+       3, 42, 238, 150, 1, 3, 42, 150, 239, 1, 3, 238, 43, 151, 1, 3, 151, 150, 238, 1,
+       3, 203, 3, 241, 1, 3, 241, 202, 203, 1, 3, 64, 235, 202, 1, 3, 64, 202, 241, 1,
+       3, 235, 42, 239, 1, 3, 239, 202, 235, 1, 3, 55, 203, 202, 1, 3, 55, 202, 239, 1,
+3, 2, 237, 236, 1, 3, 2, 236, 245, 1, 3, 237, 64, 242, 1, 3, 242, 236, 237, 1,
+       3, 242, 63, 244, 1, 3, 244, 236, 242, 1, 3, 244, 68, 245, 1, 3, 245, 236, 244, 1,
+3, 3, 246, 240, 1, 3, 3, 240, 241, 1, 3, 246, 65, 248, 1, 3, 248, 240, 246, 1,
+       3, 248, 63, 242, 1, 3, 242, 240, 248, 1, 3, 242, 64, 241, 1, 3, 241, 240, 242, 1,
+3, 4, 250, 247, 1, 3, 4, 247, 253, 1, 3, 67, 251, 247, 1, 3, 67, 247, 250, 1,
+       3, 63, 248, 247, 1, 3, 63, 247, 251, 1, 3, 248, 65, 253, 1, 3, 253, 247, 248, 1,
+3, 7, 255, 243, 1, 3, 7, 243, 257, 1, 3, 255, 68, 244, 1, 3, 244, 243, 255, 1,
+       3, 63, 251, 243, 1, 3, 63, 243, 244, 1, 3, 67, 257, 243, 1, 3, 67, 243, 251, 1,
+3, 3, 206, 205, 1, 3, 3, 205, 246, 1, 3, 206, 54, 258, 1, 3, 258, 205, 206, 1,
+       3, 258, 53, 259, 1, 3, 259, 205, 258, 1, 3, 259, 65, 246, 1, 3, 246, 205, 259, 1,
+3, 1, 260, 195, 1, 3, 1, 195, 196, 1, 3, 260, 69, 262, 1, 3, 262, 195, 260, 1,
+       3, 262, 53, 258, 1, 3, 258, 195, 262, 1, 3, 258, 54, 196, 1, 3, 196, 195, 258, 1,
+3, 5, 264, 261, 1, 3, 5, 261, 267, 1, 3, 70, 265, 261, 1, 3, 70, 261, 264, 1,
+       3, 53, 262, 261, 1, 3, 53, 261, 265, 1, 3, 262, 69, 267, 1, 3, 267, 261, 262, 1,
+3, 4, 253, 252, 1, 3, 4, 252, 268, 1, 3, 253, 65, 259, 1, 3, 259, 252, 253, 1,
+       3, 53, 265, 252, 1, 3, 53, 252, 259, 1, 3, 70, 268, 252, 1, 3, 70, 252, 265, 1,
+3, 1, 214, 213, 1, 3, 1, 213, 260, 1, 3, 214, 59, 269, 1, 3, 269, 213, 214, 1,
+       3, 269, 58, 270, 1, 3, 270, 213, 269, 1, 3, 270, 69, 260, 1, 3, 260, 213, 270, 1,
+3, 0, 271, 218, 1, 3, 0, 218, 219, 1, 3, 271, 71, 273, 1, 3, 273, 218, 271, 1,
+       3, 273, 58, 269, 1, 3, 269, 218, 273, 1, 3, 269, 59, 219, 1, 3, 219, 218, 269, 1,
+3, 6, 275, 272, 1, 3, 6, 272, 278, 1, 3, 72, 276, 272, 1, 3, 72, 272, 275, 1,
+       3, 58, 273, 272, 1, 3, 58, 272, 276, 1, 3, 273, 71, 278, 1, 3, 278, 272, 273, 1,
+3, 5, 267, 266, 1, 3, 5, 266, 279, 1, 3, 267, 69, 270, 1, 3, 270, 266, 267, 1,
+       3, 58, 276, 266, 1, 3, 58, 266, 270, 1, 3, 72, 279, 266, 1, 3, 72, 266, 276, 1,
+3, 0, 226, 225, 1, 3, 0, 225, 271, 1, 3, 226, 62, 280, 1, 3, 280, 225, 226, 1,
+       3, 280, 61, 281, 1, 3, 281, 225, 280, 1, 3, 281, 71, 271, 1, 3, 271, 225, 281, 1,
+3, 2, 245, 230, 1, 3, 2, 230, 231, 1, 3, 245, 68, 282, 1, 3, 282, 230, 245, 1,
+       3, 282, 61, 280, 1, 3, 280, 230, 282, 1, 3, 280, 62, 231, 1, 3, 231, 230, 280, 1,
+3, 7, 283, 254, 1, 3, 7, 254, 255, 1, 3, 73, 284, 254, 1, 3, 73, 254, 283, 1,
+       3, 61, 282, 254, 1, 3, 61, 254, 284, 1, 3, 282, 68, 255, 1, 3, 255, 254, 282, 1,
+3, 6, 278, 277, 1, 3, 6, 277, 285, 1, 3, 278, 71, 281, 1, 3, 281, 277, 278, 1,
+       3, 61, 284, 277, 1, 3, 61, 277, 281, 1, 3, 73, 285, 277, 1, 3, 73, 277, 284, 1,
+3, 4, 268, 249, 1, 3, 4, 249, 250, 1, 3, 268, 70, 286, 1, 3, 286, 249, 268, 1,
+       3, 66, 287, 249, 1, 3, 66, 249, 286, 1, 3, 287, 67, 250, 1, 3, 250, 249, 287, 1,
+3, 5, 279, 263, 1, 3, 5, 263, 264, 1, 3, 279, 72, 288, 1, 3, 288, 263, 279, 1,
+       3, 66, 286, 263, 1, 3, 66, 263, 288, 1, 3, 286, 70, 264, 1, 3, 264, 263, 286, 1,
+3, 6, 285, 274, 1, 3, 6, 274, 275, 1, 3, 285, 73, 289, 1, 3, 289, 274, 285, 1,
+       3, 66, 288, 274, 1, 3, 66, 274, 289, 1, 3, 288, 72, 275, 1, 3, 275, 274, 288, 1,
+3, 7, 257, 256, 1, 3, 7, 256, 283, 1, 3, 257, 67, 287, 1, 3, 287, 256, 257, 1,
+       3, 66, 289, 256, 1, 3, 66, 256, 287, 1, 3, 289, 73, 283, 1, 3, 283, 256, 289, 1,
+
+       0
+};
+
+struct lwo  LWO_s1_1 =
+{
+       290,                    /* number of points */
+       s1_1_PNTS, s1_1_normals, s1_1_POLS, 0L
+};
+
+#endif /* MODE_sproingies */
+
+/* End of s1_1.c */
diff --git a/modes/glx/s1_2.c b/modes/glx/s1_2.c
new file mode 100644 (file)
index 0000000..1517acf
--- /dev/null
@@ -0,0 +1,1057 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)s1_2.c       4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points, polygons, and normal vectors to render "s1_2" in 3D.
+ *
+ * Generated by lw2ogl.  Link this with your program but do
+ * not edit by hand.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_sproingies
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat s1_2_PNTS[] =
+{
+       (GLfloat) 0.316229, (GLfloat) 0.114342, (GLfloat) - 0.309219,
+       (GLfloat) 0.316229, (GLfloat) 0.114342, (GLfloat) - 0.690781,
+       (GLfloat) 0.697100, (GLfloat) 0.103031, (GLfloat) - 0.309219,
+       (GLfloat) 0.697100, (GLfloat) 0.103031, (GLfloat) - 0.690781,
+       (GLfloat) 0.638667, (GLfloat) 0.007537, (GLfloat) - 0.638667,
+       (GLfloat) 0.361333, (GLfloat) 0.007537, (GLfloat) - 0.638667,
+       (GLfloat) 0.361333, (GLfloat) 0.007537, (GLfloat) - 0.361333,
+       (GLfloat) 0.638667, (GLfloat) 0.007537, (GLfloat) - 0.361333,
+       (GLfloat) 0.813840, (GLfloat) 0.310563, (GLfloat) - 0.755750,
+       (GLfloat) 0.308193, (GLfloat) 0.377118, (GLfloat) - 0.755750,
+       (GLfloat) 0.308193, (GLfloat) 0.377118, (GLfloat) - 0.244250,
+       (GLfloat) 0.813840, (GLfloat) 0.310563, (GLfloat) - 0.244250,
+       (GLfloat) 0.865458, (GLfloat) 0.513412, (GLfloat) - 0.690781,
+       (GLfloat) 0.865458, (GLfloat) 0.513412, (GLfloat) - 0.309219,
+       (GLfloat) 0.858509, (GLfloat) 0.615264, (GLfloat) - 0.361333,
+       (GLfloat) 0.858509, (GLfloat) 0.615264, (GLfloat) - 0.638667,
+       (GLfloat) 0.500319, (GLfloat) 0.618731, (GLfloat) - 0.309219,
+       (GLfloat) 0.596285, (GLfloat) 0.705555, (GLfloat) - 0.361333,
+       (GLfloat) 0.500319, (GLfloat) 0.618731, (GLfloat) - 0.690781,
+       (GLfloat) 0.596285, (GLfloat) 0.705555, (GLfloat) - 0.638667,
+       (GLfloat) 0.945338, (GLfloat) 0.554869, (GLfloat) - 0.500000,
+       (GLfloat) 0.927845, (GLfloat) 0.404808, (GLfloat) - 0.500000,
+       (GLfloat) 0.931847, (GLfloat) 0.494263, (GLfloat) - 0.500000,
+       (GLfloat) 0.716506, (GLfloat) 0.632271, (GLfloat) - 0.258297,
+       (GLfloat) 0.883750, (GLfloat) 0.575062, (GLfloat) - 0.323141,
+       (GLfloat) 0.733407, (GLfloat) 0.677865, (GLfloat) - 0.500000,
+       (GLfloat) 0.897467, (GLfloat) 0.608935, (GLfloat) - 0.500000,
+       (GLfloat) 0.716506, (GLfloat) 0.632271, (GLfloat) - 0.741703,
+       (GLfloat) 0.883750, (GLfloat) 0.575062, (GLfloat) - 0.676859,
+       (GLfloat) 0.622584, (GLfloat) 0.465571, (GLfloat) - 0.187109,
+       (GLfloat) 0.682889, (GLfloat) 0.566071, (GLfloat) - 0.239844,
+       (GLfloat) 0.487673, (GLfloat) 0.709673, (GLfloat) - 0.500000,
+       (GLfloat) 0.548866, (GLfloat) 0.688331, (GLfloat) - 0.323141,
+       (GLfloat) 0.729578, (GLfloat) 0.666743, (GLfloat) - 0.322437,
+       (GLfloat) 0.317323, (GLfloat) 0.526334, (GLfloat) - 0.500000,
+       (GLfloat) 0.433930, (GLfloat) 0.637880, (GLfloat) - 0.500000,
+       (GLfloat) 0.548866, (GLfloat) 0.688331, (GLfloat) - 0.676859,
+       (GLfloat) 0.561689, (GLfloat) 0.724552, (GLfloat) - 0.500000,
+       (GLfloat) 0.622584, (GLfloat) 0.465571, (GLfloat) - 0.812891,
+       (GLfloat) 0.682889, (GLfloat) 0.566071, (GLfloat) - 0.760156,
+       (GLfloat) 0.729578, (GLfloat) 0.666743, (GLfloat) - 0.677562,
+       (GLfloat) 0.846442, (GLfloat) 0.421012, (GLfloat) - 0.729453,
+       (GLfloat) 0.835067, (GLfloat) 0.192357, (GLfloat) - 0.500000,
+       (GLfloat) 0.905776, (GLfloat) 0.298462, (GLfloat) - 0.500000,
+       (GLfloat) 0.846442, (GLfloat) 0.421012, (GLfloat) - 0.270547,
+       (GLfloat) 0.398726, (GLfloat) 0.510130, (GLfloat) - 0.729453,
+       (GLfloat) 0.523830, (GLfloat) 0.217409, (GLfloat) - 0.812891,
+       (GLfloat) 0.561017, (GLfloat) 0.343841, (GLfloat) - 0.848750,
+       (GLfloat) 0.523830, (GLfloat) 0.217409, (GLfloat) - 0.187109,
+       (GLfloat) 0.561017, (GLfloat) 0.343841, (GLfloat) - 0.151250,
+       (GLfloat) 0.398726, (GLfloat) 0.510130, (GLfloat) - 0.270547,
+       (GLfloat) 0.212593, (GLfloat) 0.242461, (GLfloat) - 0.500000,
+       (GLfloat) 0.216258, (GLfloat) 0.389219, (GLfloat) - 0.500000,
+       (GLfloat) 0.500666, (GLfloat) 0.037435, (GLfloat) - 0.741703,
+       (GLfloat) 0.506665, (GLfloat) 0.108686, (GLfloat) - 0.760156,
+       (GLfloat) 0.752070, (GLfloat) 0.199038, (GLfloat) - 0.729453,
+       (GLfloat) 0.295589, (GLfloat) 0.235781, (GLfloat) - 0.729453,
+       (GLfloat) 0.295589, (GLfloat) 0.235781, (GLfloat) - 0.270547,
+       (GLfloat) 0.259010, (GLfloat) 0.038206, (GLfloat) - 0.500000,
+       (GLfloat) 0.246980, (GLfloat) 0.116398, (GLfloat) - 0.500000,
+       (GLfloat) 0.752070, (GLfloat) 0.199038, (GLfloat) - 0.270547,
+       (GLfloat) 0.500666, (GLfloat) 0.037435, (GLfloat) - 0.258297,
+       (GLfloat) 0.506665, (GLfloat) 0.108686, (GLfloat) - 0.239844,
+       (GLfloat) 0.742322, (GLfloat) 0.036664, (GLfloat) - 0.500000,
+       (GLfloat) 0.766349, (GLfloat) 0.100974, (GLfloat) - 0.500000,
+       (GLfloat) 0.677491, (GLfloat) 0.037477, (GLfloat) - 0.676859,
+       (GLfloat) 0.500000, (GLfloat) - 0.010924, (GLfloat) - 0.500000,
+       (GLfloat) 0.677562, (GLfloat) 0.000839, (GLfloat) - 0.500000,
+       (GLfloat) 0.677491, (GLfloat) 0.037477, (GLfloat) - 0.323141,
+       (GLfloat) 0.323842, (GLfloat) 0.038608, (GLfloat) - 0.676859,
+       (GLfloat) 0.500000, (GLfloat) 0.000839, (GLfloat) - 0.677562,
+       (GLfloat) 0.323842, (GLfloat) 0.038608, (GLfloat) - 0.323141,
+       (GLfloat) 0.322437, (GLfloat) 0.000839, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) 0.000839, (GLfloat) - 0.322437,
+       (GLfloat) 0.925000, (GLfloat) 0.532253, (GLfloat) - 0.600125,
+       (GLfloat) 0.911045, (GLfloat) 0.457192, (GLfloat) - 0.613625,
+       (GLfloat) 0.915250, (GLfloat) 0.499050, (GLfloat) - 0.604062,
+       (GLfloat) 0.925000, (GLfloat) 0.532253, (GLfloat) - 0.399875,
+       (GLfloat) 0.940858, (GLfloat) 0.527164, (GLfloat) - 0.500000,
+       (GLfloat) 0.919197, (GLfloat) 0.584697, (GLfloat) - 0.587500,
+       (GLfloat) 0.929810, (GLfloat) 0.559801, (GLfloat) - 0.596406,
+       (GLfloat) 0.798138, (GLfloat) 0.572966, (GLfloat) - 0.733625,
+       (GLfloat) 0.877427, (GLfloat) 0.547520, (GLfloat) - 0.683563,
+       (GLfloat) 0.798138, (GLfloat) 0.572966, (GLfloat) - 0.266375,
+       (GLfloat) 0.877427, (GLfloat) 0.547520, (GLfloat) - 0.316437,
+       (GLfloat) 0.919197, (GLfloat) 0.584697, (GLfloat) - 0.412500,
+       (GLfloat) 0.929810, (GLfloat) 0.559801, (GLfloat) - 0.403594,
+       (GLfloat) 0.911045, (GLfloat) 0.457192, (GLfloat) - 0.386375,
+       (GLfloat) 0.915250, (GLfloat) 0.499050, (GLfloat) - 0.395938,
+       (GLfloat) 0.817112, (GLfloat) 0.642984, (GLfloat) - 0.409500,
+       (GLfloat) 0.884513, (GLfloat) 0.611054, (GLfloat) - 0.417500,
+       (GLfloat) 0.934249, (GLfloat) 0.580800, (GLfloat) - 0.500000,
+       (GLfloat) 0.807153, (GLfloat) 0.623277, (GLfloat) - 0.294000,
+       (GLfloat) 0.876135, (GLfloat) 0.598240, (GLfloat) - 0.339125,
+       (GLfloat) 0.807153, (GLfloat) 0.623277, (GLfloat) - 0.706000,
+       (GLfloat) 0.876135, (GLfloat) 0.598240, (GLfloat) - 0.660875,
+       (GLfloat) 0.817112, (GLfloat) 0.642984, (GLfloat) - 0.590500,
+       (GLfloat) 0.884513, (GLfloat) 0.611054, (GLfloat) - 0.582500,
+       (GLfloat) 0.764624, (GLfloat) 0.492766, (GLfloat) - 0.234875,
+       (GLfloat) 0.782472, (GLfloat) 0.537348, (GLfloat) - 0.257187,
+       (GLfloat) 0.607846, (GLfloat) 0.634036, (GLfloat) - 0.266375,
+       (GLfloat) 0.702992, (GLfloat) 0.603501, (GLfloat) - 0.249687,
+       (GLfloat) 0.807680, (GLfloat) 0.601112, (GLfloat) - 0.274594,
+       (GLfloat) 0.480984, (GLfloat) 0.674750, (GLfloat) - 0.399875,
+       (GLfloat) 0.528557, (GLfloat) 0.659482, (GLfloat) - 0.316437,
+       (GLfloat) 0.641688, (GLfloat) 0.680252, (GLfloat) - 0.294000,
+       (GLfloat) 0.625134, (GLfloat) 0.662855, (GLfloat) - 0.274594,
+       (GLfloat) 0.544994, (GLfloat) 0.546127, (GLfloat) - 0.234875,
+       (GLfloat) 0.583305, (GLfloat) 0.594795, (GLfloat) - 0.257187,
+       (GLfloat) 0.645973, (GLfloat) 0.701912, (GLfloat) - 0.409500,
+       (GLfloat) 0.650852, (GLfloat) 0.691510, (GLfloat) - 0.335375,
+       (GLfloat) 0.724816, (GLfloat) 0.652913, (GLfloat) - 0.278500,
+       (GLfloat) 0.529644, (GLfloat) 0.718831, (GLfloat) - 0.412500,
+       (GLfloat) 0.571915, (GLfloat) 0.702991, (GLfloat) - 0.339125,
+       (GLfloat) 0.806863, (GLfloat) 0.637791, (GLfloat) - 0.335375,
+       (GLfloat) 0.398573, (GLfloat) 0.581701, (GLfloat) - 0.386375,
+       (GLfloat) 0.450527, (GLfloat) 0.633092, (GLfloat) - 0.395938,
+       (GLfloat) 0.480984, (GLfloat) 0.674750, (GLfloat) - 0.600125,
+       (GLfloat) 0.465127, (GLfloat) 0.679839, (GLfloat) - 0.500000,
+       (GLfloat) 0.503003, (GLfloat) 0.704166, (GLfloat) - 0.403594,
+       (GLfloat) 0.607846, (GLfloat) 0.634036, (GLfloat) - 0.733625,
+       (GLfloat) 0.528557, (GLfloat) 0.659482, (GLfloat) - 0.683563,
+       (GLfloat) 0.529644, (GLfloat) 0.718831, (GLfloat) - 0.587500,
+       (GLfloat) 0.503003, (GLfloat) 0.704166, (GLfloat) - 0.596406,
+       (GLfloat) 0.398573, (GLfloat) 0.581701, (GLfloat) - 0.613625,
+       (GLfloat) 0.450527, (GLfloat) 0.633092, (GLfloat) - 0.604062,
+       (GLfloat) 0.645973, (GLfloat) 0.701912, (GLfloat) - 0.590500,
+       (GLfloat) 0.573201, (GLfloat) 0.718247, (GLfloat) - 0.582500,
+       (GLfloat) 0.515384, (GLfloat) 0.725027, (GLfloat) - 0.500000,
+       (GLfloat) 0.641688, (GLfloat) 0.680252, (GLfloat) - 0.706000,
+       (GLfloat) 0.571915, (GLfloat) 0.702991, (GLfloat) - 0.660875,
+       (GLfloat) 0.573201, (GLfloat) 0.718247, (GLfloat) - 0.417500,
+       (GLfloat) 0.544994, (GLfloat) 0.546127, (GLfloat) - 0.765125,
+       (GLfloat) 0.583305, (GLfloat) 0.594795, (GLfloat) - 0.742813,
+       (GLfloat) 0.702992, (GLfloat) 0.603501, (GLfloat) - 0.750313,
+       (GLfloat) 0.625134, (GLfloat) 0.662855, (GLfloat) - 0.725406,
+       (GLfloat) 0.807680, (GLfloat) 0.601112, (GLfloat) - 0.725406,
+       (GLfloat) 0.764624, (GLfloat) 0.492766, (GLfloat) - 0.765125,
+       (GLfloat) 0.782472, (GLfloat) 0.537348, (GLfloat) - 0.742813,
+       (GLfloat) 0.806863, (GLfloat) 0.637791, (GLfloat) - 0.664625,
+       (GLfloat) 0.724816, (GLfloat) 0.652913, (GLfloat) - 0.721500,
+       (GLfloat) 0.650852, (GLfloat) 0.691510, (GLfloat) - 0.664625,
+       (GLfloat) 0.732447, (GLfloat) 0.675074, (GLfloat) - 0.402250,
+       (GLfloat) 0.824871, (GLfloat) 0.643250, (GLfloat) - 0.500000,
+       (GLfloat) 0.640022, (GLfloat) 0.706898, (GLfloat) - 0.500000,
+       (GLfloat) 0.732447, (GLfloat) 0.675074, (GLfloat) - 0.597750,
+       (GLfloat) 0.856137, (GLfloat) 0.470533, (GLfloat) - 0.708313,
+       (GLfloat) 0.899707, (GLfloat) 0.356231, (GLfloat) - 0.635000,
+       (GLfloat) 0.907494, (GLfloat) 0.408859, (GLfloat) - 0.625156,
+       (GLfloat) 0.929348, (GLfloat) 0.452746, (GLfloat) - 0.500000,
+       (GLfloat) 0.851860, (GLfloat) 0.246808, (GLfloat) - 0.635000,
+       (GLfloat) 0.882792, (GLfloat) 0.301487, (GLfloat) - 0.639500,
+       (GLfloat) 0.899707, (GLfloat) 0.356231, (GLfloat) - 0.365000,
+       (GLfloat) 0.921826, (GLfloat) 0.352648, (GLfloat) - 0.500000,
+       (GLfloat) 0.722756, (GLfloat) 0.384892, (GLfloat) - 0.815000,
+       (GLfloat) 0.833350, (GLfloat) 0.366979, (GLfloat) - 0.747500,
+       (GLfloat) 0.722756, (GLfloat) 0.384892, (GLfloat) - 0.185000,
+       (GLfloat) 0.833350, (GLfloat) 0.366979, (GLfloat) - 0.252500,
+       (GLfloat) 0.907494, (GLfloat) 0.408859, (GLfloat) - 0.374844,
+       (GLfloat) 0.851860, (GLfloat) 0.246808, (GLfloat) - 0.365000,
+       (GLfloat) 0.882792, (GLfloat) 0.301487, (GLfloat) - 0.360500,
+       (GLfloat) 0.856137, (GLfloat) 0.470533, (GLfloat) - 0.291687,
+       (GLfloat) 0.453481, (GLfloat) 0.568361, (GLfloat) - 0.708313,
+       (GLfloat) 0.457330, (GLfloat) 0.427884, (GLfloat) - 0.815000,
+       (GLfloat) 0.500479, (GLfloat) 0.489876, (GLfloat) - 0.792031,
+       (GLfloat) 0.654809, (GLfloat) 0.519447, (GLfloat) - 0.784063,
+       (GLfloat) 0.405397, (GLfloat) 0.294044, (GLfloat) - 0.815000,
+       (GLfloat) 0.423113, (GLfloat) 0.361992, (GLfloat) - 0.825500,
+       (GLfloat) 0.590043, (GLfloat) 0.406388, (GLfloat) - 0.837500,
+       (GLfloat) 0.280379, (GLfloat) 0.456545, (GLfloat) - 0.635000,
+       (GLfloat) 0.346736, (GLfloat) 0.445797, (GLfloat) - 0.747500,
+       (GLfloat) 0.744688, (GLfloat) 0.441266, (GLfloat) - 0.792031,
+       (GLfloat) 0.673275, (GLfloat) 0.265703, (GLfloat) - 0.815000,
+       (GLfloat) 0.698920, (GLfloat) 0.325689, (GLfloat) - 0.825500,
+       (GLfloat) 0.654809, (GLfloat) 0.519447, (GLfloat) - 0.215937,
+       (GLfloat) 0.457330, (GLfloat) 0.427884, (GLfloat) - 0.185000,
+       (GLfloat) 0.500479, (GLfloat) 0.489876, (GLfloat) - 0.207969,
+       (GLfloat) 0.453481, (GLfloat) 0.568361, (GLfloat) - 0.291687,
+       (GLfloat) 0.744688, (GLfloat) 0.441266, (GLfloat) - 0.207969,
+       (GLfloat) 0.673275, (GLfloat) 0.265703, (GLfloat) - 0.185000,
+       (GLfloat) 0.698920, (GLfloat) 0.325689, (GLfloat) - 0.174500,
+       (GLfloat) 0.590043, (GLfloat) 0.406388, (GLfloat) - 0.162500,
+       (GLfloat) 0.280379, (GLfloat) 0.456545, (GLfloat) - 0.365000,
+       (GLfloat) 0.346736, (GLfloat) 0.445797, (GLfloat) - 0.252500,
+       (GLfloat) 0.405397, (GLfloat) 0.294044, (GLfloat) - 0.185000,
+       (GLfloat) 0.423113, (GLfloat) 0.361992, (GLfloat) - 0.174500,
+       (GLfloat) 0.380271, (GLfloat) 0.586148, (GLfloat) - 0.500000,
+       (GLfloat) 0.337674, (GLfloat) 0.522283, (GLfloat) - 0.625156,
+       (GLfloat) 0.337674, (GLfloat) 0.522283, (GLfloat) - 0.374844,
+       (GLfloat) 0.226812, (GLfloat) 0.312938, (GLfloat) - 0.365000,
+       (GLfloat) 0.239242, (GLfloat) 0.386194, (GLfloat) - 0.360500,
+       (GLfloat) 0.258260, (GLfloat) 0.460127, (GLfloat) - 0.500000,
+       (GLfloat) 0.226812, (GLfloat) 0.312938, (GLfloat) - 0.635000,
+       (GLfloat) 0.239242, (GLfloat) 0.386194, (GLfloat) - 0.639500,
+       (GLfloat) 0.400082, (GLfloat) 0.165542, (GLfloat) - 0.765125,
+       (GLfloat) 0.402616, (GLfloat) 0.069508, (GLfloat) - 0.733625,
+       (GLfloat) 0.402791, (GLfloat) 0.111771, (GLfloat) - 0.742813,
+       (GLfloat) 0.626577, (GLfloat) 0.153203, (GLfloat) - 0.765125,
+       (GLfloat) 0.513329, (GLfloat) 0.159372, (GLfloat) - 0.784063,
+       (GLfloat) 0.399335, (GLfloat) 0.227430, (GLfloat) - 0.792031,
+       (GLfloat) 0.249085, (GLfloat) 0.173768, (GLfloat) - 0.613625,
+       (GLfloat) 0.305709, (GLfloat) 0.170683, (GLfloat) - 0.708313,
+       (GLfloat) 0.777574, (GLfloat) 0.144976, (GLfloat) - 0.613625,
+       (GLfloat) 0.720950, (GLfloat) 0.148061, (GLfloat) - 0.708313,
+       (GLfloat) 0.648325, (GLfloat) 0.207388, (GLfloat) - 0.792031,
+       (GLfloat) 0.602715, (GLfloat) 0.067041, (GLfloat) - 0.733625,
+       (GLfloat) 0.610539, (GLfloat) 0.105601, (GLfloat) - 0.742813,
+       (GLfloat) 0.539336, (GLfloat) 0.279873, (GLfloat) - 0.837500,
+       (GLfloat) 0.784890, (GLfloat) 0.253894, (GLfloat) - 0.747500,
+       (GLfloat) 0.293781, (GLfloat) 0.305853, (GLfloat) - 0.747500,
+       (GLfloat) 0.233342, (GLfloat) 0.240791, (GLfloat) - 0.625156,
+       (GLfloat) 0.249085, (GLfloat) 0.173768, (GLfloat) - 0.386375,
+       (GLfloat) 0.230210, (GLfloat) 0.174796, (GLfloat) - 0.500000,
+       (GLfloat) 0.269217, (GLfloat) 0.071154, (GLfloat) - 0.600125,
+       (GLfloat) 0.264292, (GLfloat) 0.115884, (GLfloat) - 0.604062,
+       (GLfloat) 0.204489, (GLfloat) 0.315300, (GLfloat) - 0.500000,
+       (GLfloat) 0.293781, (GLfloat) 0.305853, (GLfloat) - 0.252500,
+       (GLfloat) 0.233342, (GLfloat) 0.240791, (GLfloat) - 0.374844,
+       (GLfloat) 0.269217, (GLfloat) 0.071154, (GLfloat) - 0.399875,
+       (GLfloat) 0.264292, (GLfloat) 0.115884, (GLfloat) - 0.395938,
+       (GLfloat) 0.400082, (GLfloat) 0.165542, (GLfloat) - 0.234875,
+       (GLfloat) 0.305709, (GLfloat) 0.170683, (GLfloat) - 0.291687,
+       (GLfloat) 0.399335, (GLfloat) 0.227430, (GLfloat) - 0.207969,
+       (GLfloat) 0.626577, (GLfloat) 0.153203, (GLfloat) - 0.234875,
+       (GLfloat) 0.513329, (GLfloat) 0.159372, (GLfloat) - 0.215937,
+       (GLfloat) 0.402616, (GLfloat) 0.069508, (GLfloat) - 0.266375,
+       (GLfloat) 0.402791, (GLfloat) 0.111771, (GLfloat) - 0.257187,
+       (GLfloat) 0.539336, (GLfloat) 0.279873, (GLfloat) - 0.162500,
+       (GLfloat) 0.784890, (GLfloat) 0.253894, (GLfloat) - 0.252500,
+       (GLfloat) 0.648325, (GLfloat) 0.207388, (GLfloat) - 0.207969,
+       (GLfloat) 0.602715, (GLfloat) 0.067041, (GLfloat) - 0.266375,
+       (GLfloat) 0.610539, (GLfloat) 0.105601, (GLfloat) - 0.257187,
+       (GLfloat) 0.777574, (GLfloat) 0.144976, (GLfloat) - 0.386375,
+       (GLfloat) 0.720950, (GLfloat) 0.148061, (GLfloat) - 0.291687,
+       (GLfloat) 0.814318, (GLfloat) 0.194027, (GLfloat) - 0.374844,
+       (GLfloat) 0.796449, (GLfloat) 0.143948, (GLfloat) - 0.500000,
+       (GLfloat) 0.736115, (GLfloat) 0.065395, (GLfloat) - 0.399875,
+       (GLfloat) 0.749037, (GLfloat) 0.101488, (GLfloat) - 0.395938,
+       (GLfloat) 0.874183, (GLfloat) 0.244447, (GLfloat) - 0.500000,
+       (GLfloat) 0.814318, (GLfloat) 0.194027, (GLfloat) - 0.625156,
+       (GLfloat) 0.736115, (GLfloat) 0.065395, (GLfloat) - 0.600125,
+       (GLfloat) 0.749037, (GLfloat) 0.101488, (GLfloat) - 0.604062,
+       (GLfloat) 0.752790, (GLfloat) 0.065190, (GLfloat) - 0.500000,
+       (GLfloat) 0.706000, (GLfloat) 0.016681, (GLfloat) - 0.412500,
+       (GLfloat) 0.726029, (GLfloat) 0.037019, (GLfloat) - 0.403594,
+       (GLfloat) 0.686090, (GLfloat) 0.066012, (GLfloat) - 0.316437,
+       (GLfloat) 0.686090, (GLfloat) 0.066012, (GLfloat) - 0.683563,
+       (GLfloat) 0.706000, (GLfloat) 0.016681, (GLfloat) - 0.587500,
+       (GLfloat) 0.726029, (GLfloat) 0.037019, (GLfloat) - 0.596406,
+       (GLfloat) 0.590500, (GLfloat) - 0.005194, (GLfloat) - 0.590500,
+       (GLfloat) 0.664625, (GLfloat) 0.003052, (GLfloat) - 0.582500,
+       (GLfloat) 0.721500, (GLfloat) 0.015465, (GLfloat) - 0.500000,
+       (GLfloat) 0.587500, (GLfloat) 0.016681, (GLfloat) - 0.706000,
+       (GLfloat) 0.660875, (GLfloat) 0.017896, (GLfloat) - 0.660875,
+       (GLfloat) 0.587500, (GLfloat) 0.016681, (GLfloat) - 0.294000,
+       (GLfloat) 0.660875, (GLfloat) 0.017896, (GLfloat) - 0.339125,
+       (GLfloat) 0.590500, (GLfloat) - 0.005194, (GLfloat) - 0.409500,
+       (GLfloat) 0.664625, (GLfloat) 0.003052, (GLfloat) - 0.417500,
+       (GLfloat) 0.502666, (GLfloat) 0.068274, (GLfloat) - 0.750313,
+       (GLfloat) 0.597054, (GLfloat) 0.037430, (GLfloat) - 0.725406,
+       (GLfloat) 0.319242, (GLfloat) 0.070537, (GLfloat) - 0.683563,
+       (GLfloat) 0.412500, (GLfloat) 0.016681, (GLfloat) - 0.706000,
+       (GLfloat) 0.404279, (GLfloat) 0.038047, (GLfloat) - 0.725406,
+       (GLfloat) 0.409500, (GLfloat) - 0.005194, (GLfloat) - 0.590500,
+       (GLfloat) 0.417500, (GLfloat) 0.003052, (GLfloat) - 0.664625,
+       (GLfloat) 0.500000, (GLfloat) 0.015465, (GLfloat) - 0.721500,
+       (GLfloat) 0.294000, (GLfloat) 0.016681, (GLfloat) - 0.587500,
+       (GLfloat) 0.339125, (GLfloat) 0.017896, (GLfloat) - 0.660875,
+       (GLfloat) 0.582500, (GLfloat) 0.003052, (GLfloat) - 0.664625,
+       (GLfloat) 0.252542, (GLfloat) 0.071359, (GLfloat) - 0.500000,
+       (GLfloat) 0.275304, (GLfloat) 0.038459, (GLfloat) - 0.596406,
+       (GLfloat) 0.319242, (GLfloat) 0.070537, (GLfloat) - 0.316437,
+       (GLfloat) 0.294000, (GLfloat) 0.016681, (GLfloat) - 0.412500,
+       (GLfloat) 0.275304, (GLfloat) 0.038459, (GLfloat) - 0.403594,
+       (GLfloat) 0.409500, (GLfloat) - 0.005194, (GLfloat) - 0.409500,
+       (GLfloat) 0.335375, (GLfloat) 0.003052, (GLfloat) - 0.417500,
+       (GLfloat) 0.278500, (GLfloat) 0.015465, (GLfloat) - 0.500000,
+       (GLfloat) 0.412500, (GLfloat) 0.016681, (GLfloat) - 0.294000,
+       (GLfloat) 0.339125, (GLfloat) 0.017896, (GLfloat) - 0.339125,
+       (GLfloat) 0.335375, (GLfloat) 0.003052, (GLfloat) - 0.582500,
+       (GLfloat) 0.502666, (GLfloat) 0.068274, (GLfloat) - 0.249687,
+       (GLfloat) 0.404279, (GLfloat) 0.038047, (GLfloat) - 0.274594,
+       (GLfloat) 0.597054, (GLfloat) 0.037430, (GLfloat) - 0.274594,
+       (GLfloat) 0.582500, (GLfloat) 0.003052, (GLfloat) - 0.335375,
+       (GLfloat) 0.500000, (GLfloat) 0.015465, (GLfloat) - 0.278500,
+       (GLfloat) 0.417500, (GLfloat) 0.003052, (GLfloat) - 0.335375,
+       (GLfloat) 0.500000, (GLfloat) - 0.007972, (GLfloat) - 0.597750,
+       (GLfloat) 0.597750, (GLfloat) - 0.007972, (GLfloat) - 0.500000,
+       (GLfloat) 0.402250, (GLfloat) - 0.007972, (GLfloat) - 0.500000,
+       (GLfloat) 0.500000, (GLfloat) - 0.007972, (GLfloat) - 0.402250,
+};
+
+static GLfloat s1_2_normals[] =
+{
+       (GLfloat) 0.838584, (GLfloat) - 0.185505, (GLfloat) - 0.512216,
+       (GLfloat) 0.838560, (GLfloat) - 0.185860, (GLfloat) - 0.512127,
+       (GLfloat) 0.951437, (GLfloat) - 0.260566, (GLfloat) - 0.163932,
+       (GLfloat) 0.951618, (GLfloat) - 0.260024, (GLfloat) - 0.163738,
+       (GLfloat) 0.973663, (GLfloat) - 0.157463, (GLfloat) - 0.164880,
+       (GLfloat) 0.975548, (GLfloat) - 0.148474, (GLfloat) - 0.162053,
+       (GLfloat) 0.859322, (GLfloat) - 0.074133, (GLfloat) - 0.506033,
+       (GLfloat) 0.859277, (GLfloat) - 0.081888, (GLfloat) - 0.504914,
+       (GLfloat) 0.838560, (GLfloat) - 0.185860, (GLfloat) 0.512127,
+       (GLfloat) 0.838584, (GLfloat) - 0.185505, (GLfloat) 0.512216,
+       (GLfloat) 0.859322, (GLfloat) - 0.074133, (GLfloat) 0.506034,
+       (GLfloat) 0.859277, (GLfloat) - 0.081888, (GLfloat) 0.504914,
+       (GLfloat) 0.973663, (GLfloat) - 0.157463, (GLfloat) 0.164880,
+       (GLfloat) 0.975548, (GLfloat) - 0.148474, (GLfloat) 0.162053,
+       (GLfloat) 0.951618, (GLfloat) - 0.260024, (GLfloat) 0.163738,
+       (GLfloat) 0.951437, (GLfloat) - 0.260566, (GLfloat) 0.163932,
+       (GLfloat) 0.573088, (GLfloat) 0.793214, (GLfloat) 0.205867,
+       (GLfloat) 0.558283, (GLfloat) 0.810311, (GLfloat) 0.178092,
+       (GLfloat) 0.606103, (GLfloat) 0.792390, (GLfloat) 0.068965,
+       (GLfloat) 0.596705, (GLfloat) 0.799118, (GLfloat) 0.073163,
+       (GLfloat) 0.896389, (GLfloat) 0.425982, (GLfloat) 0.122582,
+       (GLfloat) 0.910488, (GLfloat) 0.389376, (GLfloat) 0.139274,
+       (GLfloat) 0.787435, (GLfloat) 0.503715, (GLfloat) 0.355272,
+       (GLfloat) 0.794681, (GLfloat) 0.474299, (GLfloat) 0.378844,
+       (GLfloat) 0.558283, (GLfloat) 0.810311, (GLfloat) - 0.178092,
+       (GLfloat) 0.573088, (GLfloat) 0.793214, (GLfloat) - 0.205866,
+       (GLfloat) 0.787434, (GLfloat) 0.503716, (GLfloat) - 0.355272,
+       (GLfloat) 0.794681, (GLfloat) 0.474299, (GLfloat) - 0.378844,
+       (GLfloat) 0.910488, (GLfloat) 0.389376, (GLfloat) - 0.139274,
+       (GLfloat) 0.896389, (GLfloat) 0.425982, (GLfloat) - 0.122583,
+       (GLfloat) 0.596705, (GLfloat) 0.799118, (GLfloat) - 0.073163,
+       (GLfloat) 0.606103, (GLfloat) 0.792390, (GLfloat) - 0.068965,
+       (GLfloat) 0.528377, (GLfloat) - 0.013430, (GLfloat) 0.848903,
+       (GLfloat) 0.532136, (GLfloat) - 0.007543, (GLfloat) 0.846625,
+       (GLfloat) 0.209439, (GLfloat) 0.141946, (GLfloat) 0.967464,
+       (GLfloat) 0.218070, (GLfloat) 0.152719, (GLfloat) 0.963910,
+       (GLfloat) 0.237428, (GLfloat) 0.197257, (GLfloat) 0.951166,
+       (GLfloat) 0.225804, (GLfloat) 0.180417, (GLfloat) 0.957320,
+       (GLfloat) 0.549711, (GLfloat) 0.076255, (GLfloat) 0.831867,
+       (GLfloat) 0.550775, (GLfloat) 0.056452, (GLfloat) 0.832742,
+       (GLfloat) - 0.393177, (GLfloat) 0.417558, (GLfloat) 0.819181,
+       (GLfloat) - 0.379656, (GLfloat) 0.429289, (GLfloat) 0.819495,
+       (GLfloat) - 0.366688, (GLfloat) 0.451901, (GLfloat) 0.813219,
+       (GLfloat) - 0.369492, (GLfloat) 0.449132, (GLfloat) 0.813484,
+       (GLfloat) - 0.064014, (GLfloat) 0.313584, (GLfloat) 0.947400,
+       (GLfloat) - 0.066684, (GLfloat) 0.310439, (GLfloat) 0.948252,
+       (GLfloat) - 0.086424, (GLfloat) 0.278029, (GLfloat) 0.956677,
+       (GLfloat) - 0.074037, (GLfloat) 0.290647, (GLfloat) 0.953962,
+       (GLfloat) 0.110270, (GLfloat) 0.952576, (GLfloat) 0.283620,
+       (GLfloat) 0.140226, (GLfloat) 0.954260, (GLfloat) 0.264054,
+       (GLfloat) 0.237331, (GLfloat) 0.918949, (GLfloat) 0.314972,
+       (GLfloat) 0.245773, (GLfloat) 0.920155, (GLfloat) 0.304813,
+       (GLfloat) 0.105329, (GLfloat) 0.694128, (GLfloat) 0.712104,
+       (GLfloat) 0.087202, (GLfloat) 0.678641, (GLfloat) 0.729275,
+       (GLfloat) - 0.104644, (GLfloat) 0.803491, (GLfloat) 0.586048,
+       (GLfloat) - 0.129358, (GLfloat) 0.790652, (GLfloat) 0.598444,
+       (GLfloat) 0.490179, (GLfloat) 0.834739, (GLfloat) 0.250869,
+       (GLfloat) 0.486736, (GLfloat) 0.825366, (GLfloat) 0.286109,
+       (GLfloat) 0.575458, (GLfloat) 0.546427, (GLfloat) 0.608494,
+       (GLfloat) 0.582377, (GLfloat) 0.582433, (GLfloat) 0.567105,
+       (GLfloat) 0.347588, (GLfloat) 0.580631, (GLfloat) 0.736241,
+       (GLfloat) 0.339131, (GLfloat) 0.624243, (GLfloat) 0.703783,
+       (GLfloat) 0.378417, (GLfloat) 0.874281, (GLfloat) 0.304028,
+       (GLfloat) 0.373374, (GLfloat) 0.872526, (GLfloat) 0.315104,
+       (GLfloat) - 0.678225, (GLfloat) 0.555239, (GLfloat) 0.481373,
+       (GLfloat) - 0.681792, (GLfloat) 0.544639, (GLfloat) 0.488393,
+       (GLfloat) - 0.792737, (GLfloat) 0.589393, (GLfloat) 0.155511,
+       (GLfloat) - 0.790738, (GLfloat) 0.592627, (GLfloat) 0.153380,
+       (GLfloat) - 0.787611, (GLfloat) 0.595240, (GLfloat) 0.159243,
+       (GLfloat) - 0.781477, (GLfloat) 0.604504, (GLfloat) 0.154495,
+       (GLfloat) - 0.659940, (GLfloat) 0.576523, (GLfloat) 0.481768,
+       (GLfloat) - 0.666748, (GLfloat) 0.561105, (GLfloat) 0.490519,
+       (GLfloat) - 0.678225, (GLfloat) 0.555239, (GLfloat) - 0.481374,
+       (GLfloat) - 0.681792, (GLfloat) 0.544639, (GLfloat) - 0.488393,
+       (GLfloat) - 0.666748, (GLfloat) 0.561105, (GLfloat) - 0.490519,
+       (GLfloat) - 0.659940, (GLfloat) 0.576523, (GLfloat) - 0.481768,
+       (GLfloat) - 0.787611, (GLfloat) 0.595240, (GLfloat) - 0.159243,
+       (GLfloat) - 0.781477, (GLfloat) 0.604504, (GLfloat) - 0.154495,
+       (GLfloat) - 0.790738, (GLfloat) 0.592627, (GLfloat) - 0.153380,
+       (GLfloat) - 0.792737, (GLfloat) 0.589393, (GLfloat) - 0.155511,
+       (GLfloat) 0.036752, (GLfloat) 0.977890, (GLfloat) - 0.205867,
+       (GLfloat) 0.058945, (GLfloat) 0.982247, (GLfloat) - 0.178091,
+       (GLfloat) 0.010229, (GLfloat) 0.997567, (GLfloat) - 0.068965,
+       (GLfloat) 0.021776, (GLfloat) 0.997082, (GLfloat) - 0.073162,
+       (GLfloat) - 0.480804, (GLfloat) 0.867725, (GLfloat) - 0.126022,
+       (GLfloat) - 0.442857, (GLfloat) 0.886381, (GLfloat) - 0.134932,
+       (GLfloat) - 0.305505, (GLfloat) 0.879128, (GLfloat) - 0.365788,
+       (GLfloat) - 0.350437, (GLfloat) 0.860755, (GLfloat) - 0.369182,
+       (GLfloat) 0.058946, (GLfloat) 0.982247, (GLfloat) 0.178091,
+       (GLfloat) 0.036752, (GLfloat) 0.977890, (GLfloat) 0.205867,
+       (GLfloat) - 0.350437, (GLfloat) 0.860755, (GLfloat) 0.369182,
+       (GLfloat) - 0.305505, (GLfloat) 0.879128, (GLfloat) 0.365788,
+       (GLfloat) - 0.480804, (GLfloat) 0.867725, (GLfloat) 0.126022,
+       (GLfloat) - 0.442857, (GLfloat) 0.886381, (GLfloat) 0.134932,
+       (GLfloat) 0.021776, (GLfloat) 0.997082, (GLfloat) 0.073162,
+       (GLfloat) 0.010229, (GLfloat) 0.997567, (GLfloat) 0.068965,
+       (GLfloat) - 0.393178, (GLfloat) 0.417557, (GLfloat) - 0.819181,
+       (GLfloat) - 0.379655, (GLfloat) 0.429290, (GLfloat) - 0.819495,
+       (GLfloat) - 0.074037, (GLfloat) 0.290648, (GLfloat) - 0.953961,
+       (GLfloat) - 0.086424, (GLfloat) 0.278030, (GLfloat) - 0.956677,
+       (GLfloat) - 0.064013, (GLfloat) 0.313585, (GLfloat) - 0.947400,
+       (GLfloat) - 0.066684, (GLfloat) 0.310439, (GLfloat) - 0.948252,
+       (GLfloat) - 0.369492, (GLfloat) 0.449132, (GLfloat) - 0.813484,
+       (GLfloat) - 0.366688, (GLfloat) 0.451901, (GLfloat) - 0.813219,
+       (GLfloat) 0.532135, (GLfloat) - 0.007544, (GLfloat) - 0.846626,
+       (GLfloat) 0.528378, (GLfloat) - 0.013430, (GLfloat) - 0.848903,
+       (GLfloat) 0.550775, (GLfloat) 0.056452, (GLfloat) - 0.832742,
+       (GLfloat) 0.549711, (GLfloat) 0.076255, (GLfloat) - 0.831867,
+       (GLfloat) 0.225804, (GLfloat) 0.180419, (GLfloat) - 0.957320,
+       (GLfloat) 0.237428, (GLfloat) 0.197257, (GLfloat) - 0.951166,
+       (GLfloat) 0.209439, (GLfloat) 0.141946, (GLfloat) - 0.967464,
+       (GLfloat) 0.218070, (GLfloat) 0.152720, (GLfloat) - 0.963910,
+       (GLfloat) 0.490179, (GLfloat) 0.834739, (GLfloat) - 0.250870,
+       (GLfloat) 0.486736, (GLfloat) 0.825366, (GLfloat) - 0.286109,
+       (GLfloat) 0.373374, (GLfloat) 0.872526, (GLfloat) - 0.315104,
+       (GLfloat) 0.378417, (GLfloat) 0.874281, (GLfloat) - 0.304029,
+       (GLfloat) 0.339131, (GLfloat) 0.624243, (GLfloat) - 0.703783,
+       (GLfloat) 0.347588, (GLfloat) 0.580630, (GLfloat) - 0.736241,
+       (GLfloat) 0.582377, (GLfloat) 0.582434, (GLfloat) - 0.567105,
+       (GLfloat) 0.575458, (GLfloat) 0.546427, (GLfloat) - 0.608494,
+       (GLfloat) 0.140225, (GLfloat) 0.954260, (GLfloat) - 0.264055,
+       (GLfloat) 0.110270, (GLfloat) 0.952576, (GLfloat) - 0.283620,
+       (GLfloat) - 0.104644, (GLfloat) 0.803491, (GLfloat) - 0.586047,
+       (GLfloat) - 0.129358, (GLfloat) 0.790652, (GLfloat) - 0.598444,
+       (GLfloat) 0.087202, (GLfloat) 0.678640, (GLfloat) - 0.729276,
+       (GLfloat) 0.105329, (GLfloat) 0.694128, (GLfloat) - 0.712104,
+       (GLfloat) 0.237332, (GLfloat) 0.918949, (GLfloat) - 0.314972,
+       (GLfloat) 0.245773, (GLfloat) 0.920155, (GLfloat) - 0.304813,
+       (GLfloat) 0.448419, (GLfloat) 0.885179, (GLfloat) 0.124011,
+       (GLfloat) 0.437269, (GLfloat) 0.889018, (GLfloat) 0.135803,
+       (GLfloat) 0.364737, (GLfloat) 0.924635, (GLfloat) 0.109622,
+       (GLfloat) 0.360657, (GLfloat) 0.925618, (GLfloat) 0.114709,
+       (GLfloat) 0.353761, (GLfloat) 0.934751, (GLfloat) 0.033079,
+       (GLfloat) 0.356519, (GLfloat) 0.933801, (GLfloat) 0.030163,
+       (GLfloat) 0.426940, (GLfloat) 0.903217, (GLfloat) 0.043834,
+       (GLfloat) 0.431621, (GLfloat) 0.901183, (GLfloat) 0.039656,
+       (GLfloat) 0.202761, (GLfloat) 0.969766, (GLfloat) 0.135803,
+       (GLfloat) 0.191612, (GLfloat) 0.973605, (GLfloat) 0.124011,
+       (GLfloat) 0.219643, (GLfloat) 0.974595, (GLfloat) 0.043834,
+       (GLfloat) 0.214702, (GLfloat) 0.975874, (GLfloat) 0.039656,
+       (GLfloat) 0.293965, (GLfloat) 0.955340, (GLfloat) 0.030163,
+       (GLfloat) 0.296722, (GLfloat) 0.954391, (GLfloat) 0.033079,
+       (GLfloat) 0.281846, (GLfloat) 0.953177, (GLfloat) 0.109622,
+       (GLfloat) 0.285665, (GLfloat) 0.951439, (GLfloat) 0.114709,
+       (GLfloat) 0.191612, (GLfloat) 0.973605, (GLfloat) - 0.124011,
+       (GLfloat) 0.202761, (GLfloat) 0.969766, (GLfloat) - 0.135803,
+       (GLfloat) 0.281846, (GLfloat) 0.953177, (GLfloat) - 0.109622,
+       (GLfloat) 0.285665, (GLfloat) 0.951439, (GLfloat) - 0.114709,
+       (GLfloat) 0.296722, (GLfloat) 0.954391, (GLfloat) - 0.033079,
+       (GLfloat) 0.293965, (GLfloat) 0.955340, (GLfloat) - 0.030163,
+       (GLfloat) 0.219643, (GLfloat) 0.974595, (GLfloat) - 0.043834,
+       (GLfloat) 0.214702, (GLfloat) 0.975874, (GLfloat) - 0.039656,
+       (GLfloat) 0.437270, (GLfloat) 0.889018, (GLfloat) - 0.135802,
+       (GLfloat) 0.448419, (GLfloat) 0.885179, (GLfloat) - 0.124011,
+       (GLfloat) 0.426940, (GLfloat) 0.903217, (GLfloat) - 0.043834,
+       (GLfloat) 0.431621, (GLfloat) 0.901183, (GLfloat) - 0.039656,
+       (GLfloat) 0.356519, (GLfloat) 0.933801, (GLfloat) - 0.030163,
+       (GLfloat) 0.353761, (GLfloat) 0.934751, (GLfloat) - 0.033079,
+       (GLfloat) 0.364737, (GLfloat) 0.924635, (GLfloat) - 0.109622,
+       (GLfloat) 0.360657, (GLfloat) 0.925618, (GLfloat) - 0.114709,
+       (GLfloat) 0.865947, (GLfloat) 0.016137, (GLfloat) - 0.499875,
+       (GLfloat) 0.868761, (GLfloat) 0.025708, (GLfloat) - 0.494564,
+       (GLfloat) 0.864411, (GLfloat) 0.044558, (GLfloat) - 0.500808,
+       (GLfloat) 0.867101, (GLfloat) 0.054429, (GLfloat) - 0.495149,
+       (GLfloat) 0.986611, (GLfloat) - 0.030929, (GLfloat) - 0.160132,
+       (GLfloat) 0.986294, (GLfloat) - 0.033936, (GLfloat) - 0.161472,
+       (GLfloat) 0.985351, (GLfloat) - 0.059326, (GLfloat) - 0.159886,
+       (GLfloat) 0.984981, (GLfloat) - 0.062150, (GLfloat) - 0.161092,
+       (GLfloat) 0.832885, (GLfloat) - 0.213353, (GLfloat) - 0.510669,
+       (GLfloat) 0.832050, (GLfloat) - 0.215053, (GLfloat) - 0.511318,
+       (GLfloat) 0.946090, (GLfloat) - 0.280224, (GLfloat) - 0.162447,
+       (GLfloat) 0.946491, (GLfloat) - 0.279128, (GLfloat) - 0.161996,
+       (GLfloat) 0.980117, (GLfloat) - 0.113104, (GLfloat) - 0.163030,
+       (GLfloat) 0.979875, (GLfloat) - 0.114395, (GLfloat) - 0.163582,
+       (GLfloat) 0.859139, (GLfloat) - 0.037704, (GLfloat) - 0.510352,
+       (GLfloat) 0.860908, (GLfloat) - 0.032422, (GLfloat) - 0.507727,
+       (GLfloat) 0.832885, (GLfloat) - 0.213353, (GLfloat) 0.510669,
+       (GLfloat) 0.832049, (GLfloat) - 0.215054, (GLfloat) 0.511318,
+       (GLfloat) 0.860908, (GLfloat) - 0.032422, (GLfloat) 0.507727,
+       (GLfloat) 0.859138, (GLfloat) - 0.037705, (GLfloat) 0.510352,
+       (GLfloat) 0.980117, (GLfloat) - 0.113104, (GLfloat) 0.163030,
+       (GLfloat) 0.979875, (GLfloat) - 0.114395, (GLfloat) 0.163582,
+       (GLfloat) 0.946491, (GLfloat) - 0.279128, (GLfloat) 0.161996,
+       (GLfloat) 0.946090, (GLfloat) - 0.280224, (GLfloat) 0.162447,
+       (GLfloat) 0.868761, (GLfloat) 0.025708, (GLfloat) 0.494563,
+       (GLfloat) 0.865947, (GLfloat) 0.016137, (GLfloat) 0.499875,
+       (GLfloat) 0.985351, (GLfloat) - 0.059326, (GLfloat) 0.159886,
+       (GLfloat) 0.984981, (GLfloat) - 0.062149, (GLfloat) 0.161092,
+       (GLfloat) 0.986294, (GLfloat) - 0.033936, (GLfloat) 0.161472,
+       (GLfloat) 0.986611, (GLfloat) - 0.030929, (GLfloat) 0.160132,
+       (GLfloat) 0.864411, (GLfloat) 0.044558, (GLfloat) 0.500808,
+       (GLfloat) 0.867101, (GLfloat) 0.054428, (GLfloat) 0.495149,
+       (GLfloat) - 0.329624, (GLfloat) 0.568782, (GLfloat) - 0.753548,
+       (GLfloat) - 0.303532, (GLfloat) 0.584080, (GLfloat) - 0.752808,
+       (GLfloat) - 0.337233, (GLfloat) 0.584915, (GLfloat) - 0.737664,
+       (GLfloat) - 0.311968, (GLfloat) 0.599454, (GLfloat) - 0.737110,
+       (GLfloat) - 0.032356, (GLfloat) 0.486520, (GLfloat) - 0.873070,
+       (GLfloat) - 0.057628, (GLfloat) 0.467531, (GLfloat) - 0.882096,
+       (GLfloat) - 0.019804, (GLfloat) 0.465587, (GLfloat) - 0.884780,
+       (GLfloat) - 0.045819, (GLfloat) 0.445898, (GLfloat) - 0.893910,
+       (GLfloat) - 0.451403, (GLfloat) 0.351833, (GLfloat) - 0.820029,
+       (GLfloat) - 0.442643, (GLfloat) 0.360683, (GLfloat) - 0.820960,
+       (GLfloat) - 0.125959, (GLfloat) 0.231940, (GLfloat) - 0.964540,
+       (GLfloat) - 0.133424, (GLfloat) 0.223158, (GLfloat) - 0.965608,
+       (GLfloat) - 0.071940, (GLfloat) 0.416419, (GLfloat) - 0.906322,
+       (GLfloat) - 0.089763, (GLfloat) 0.400364, (GLfloat) - 0.911949,
+       (GLfloat) - 0.381140, (GLfloat) 0.522054, (GLfloat) - 0.763015,
+       (GLfloat) - 0.362693, (GLfloat) 0.535129, (GLfloat) - 0.762949,
+       (GLfloat) 0.514033, (GLfloat) - 0.052564, (GLfloat) - 0.856158,
+       (GLfloat) 0.512829, (GLfloat) - 0.054517, (GLfloat) - 0.856758,
+       (GLfloat) 0.539192, (GLfloat) 0.146366, (GLfloat) - 0.829367,
+       (GLfloat) 0.531981, (GLfloat) 0.133703, (GLfloat) - 0.836133,
+       (GLfloat) 0.204167, (GLfloat) 0.278037, (GLfloat) - 0.938622,
+       (GLfloat) 0.217587, (GLfloat) 0.294489, (GLfloat) - 0.930555,
+       (GLfloat) 0.177512, (GLfloat) 0.093824, (GLfloat) - 0.979636,
+       (GLfloat) 0.182065, (GLfloat) 0.100184, (GLfloat) - 0.978170,
+       (GLfloat) 0.561737, (GLfloat) 0.205535, (GLfloat) - 0.801378,
+       (GLfloat) 0.550517, (GLfloat) 0.186829, (GLfloat) - 0.813650,
+       (GLfloat) 0.237090, (GLfloat) 0.326380, (GLfloat) - 0.915022,
+       (GLfloat) 0.257400, (GLfloat) 0.348104, (GLfloat) - 0.901426,
+       (GLfloat) 0.225204, (GLfloat) 0.351522, (GLfloat) - 0.908689,
+       (GLfloat) 0.244915, (GLfloat) 0.372788, (GLfloat) - 0.895012,
+       (GLfloat) 0.553162, (GLfloat) 0.233132, (GLfloat) - 0.799789,
+       (GLfloat) 0.542289, (GLfloat) 0.214487, (GLfloat) - 0.812354,
+       (GLfloat) - 0.303532, (GLfloat) 0.584080, (GLfloat) 0.752808,
+       (GLfloat) - 0.329624, (GLfloat) 0.568782, (GLfloat) 0.753548,
+       (GLfloat) - 0.019804, (GLfloat) 0.465588, (GLfloat) 0.884780,
+       (GLfloat) - 0.045820, (GLfloat) 0.445898, (GLfloat) 0.893910,
+       (GLfloat) - 0.057628, (GLfloat) 0.467531, (GLfloat) 0.882096,
+       (GLfloat) - 0.032356, (GLfloat) 0.486520, (GLfloat) 0.873070,
+       (GLfloat) - 0.337233, (GLfloat) 0.584915, (GLfloat) 0.737664,
+       (GLfloat) - 0.311968, (GLfloat) 0.599453, (GLfloat) 0.737110,
+       (GLfloat) 0.561737, (GLfloat) 0.205535, (GLfloat) 0.801378,
+       (GLfloat) 0.550517, (GLfloat) 0.186829, (GLfloat) 0.813650,
+       (GLfloat) 0.542289, (GLfloat) 0.214487, (GLfloat) 0.812354,
+       (GLfloat) 0.553162, (GLfloat) 0.233132, (GLfloat) 0.799789,
+       (GLfloat) 0.225204, (GLfloat) 0.351522, (GLfloat) 0.908689,
+       (GLfloat) 0.244915, (GLfloat) 0.372788, (GLfloat) 0.895012,
+       (GLfloat) 0.257400, (GLfloat) 0.348104, (GLfloat) 0.901426,
+       (GLfloat) 0.237091, (GLfloat) 0.326380, (GLfloat) 0.915021,
+       (GLfloat) 0.512829, (GLfloat) - 0.054517, (GLfloat) 0.856758,
+       (GLfloat) 0.514033, (GLfloat) - 0.052564, (GLfloat) 0.856158,
+       (GLfloat) 0.177512, (GLfloat) 0.093824, (GLfloat) 0.979636,
+       (GLfloat) 0.182065, (GLfloat) 0.100184, (GLfloat) 0.978170,
+       (GLfloat) 0.217587, (GLfloat) 0.294488, (GLfloat) 0.930555,
+       (GLfloat) 0.204167, (GLfloat) 0.278037, (GLfloat) 0.938622,
+       (GLfloat) 0.539192, (GLfloat) 0.146365, (GLfloat) 0.829367,
+       (GLfloat) 0.531981, (GLfloat) 0.133703, (GLfloat) 0.836133,
+       (GLfloat) - 0.451403, (GLfloat) 0.351833, (GLfloat) 0.820029,
+       (GLfloat) - 0.442643, (GLfloat) 0.360683, (GLfloat) 0.820960,
+       (GLfloat) - 0.362693, (GLfloat) 0.535129, (GLfloat) 0.762949,
+       (GLfloat) - 0.381140, (GLfloat) 0.522054, (GLfloat) 0.763015,
+       (GLfloat) - 0.071940, (GLfloat) 0.416419, (GLfloat) 0.906322,
+       (GLfloat) - 0.089763, (GLfloat) 0.400364, (GLfloat) 0.911949,
+       (GLfloat) - 0.133424, (GLfloat) 0.223158, (GLfloat) 0.965608,
+       (GLfloat) - 0.125959, (GLfloat) 0.231940, (GLfloat) 0.964540,
+       (GLfloat) - 0.574082, (GLfloat) 0.688221, (GLfloat) - 0.443601,
+       (GLfloat) - 0.590248, (GLfloat) 0.678175, (GLfloat) - 0.437821,
+       (GLfloat) - 0.687359, (GLfloat) 0.712967, (GLfloat) - 0.138621,
+       (GLfloat) - 0.682813, (GLfloat) 0.716686, (GLfloat) - 0.141874,
+       (GLfloat) - 0.682597, (GLfloat) 0.718360, (GLfloat) - 0.134243,
+       (GLfloat) - 0.678253, (GLfloat) 0.721849, (GLfloat) - 0.137502,
+       (GLfloat) - 0.574037, (GLfloat) 0.696240, (GLfloat) - 0.430966,
+       (GLfloat) - 0.589571, (GLfloat) 0.686777, (GLfloat) - 0.425139,
+       (GLfloat) - 0.574082, (GLfloat) 0.688221, (GLfloat) 0.443601,
+       (GLfloat) - 0.590248, (GLfloat) 0.678175, (GLfloat) 0.437821,
+       (GLfloat) - 0.589571, (GLfloat) 0.686777, (GLfloat) 0.425139,
+       (GLfloat) - 0.574037, (GLfloat) 0.696240, (GLfloat) 0.430966,
+       (GLfloat) - 0.682597, (GLfloat) 0.718360, (GLfloat) 0.134243,
+       (GLfloat) - 0.678253, (GLfloat) 0.721849, (GLfloat) 0.137502,
+       (GLfloat) - 0.682813, (GLfloat) 0.716686, (GLfloat) 0.141874,
+       (GLfloat) - 0.687359, (GLfloat) 0.712967, (GLfloat) 0.138621,
+       (GLfloat) - 0.741041, (GLfloat) 0.473108, (GLfloat) 0.476473,
+       (GLfloat) - 0.742406, (GLfloat) 0.464975, (GLfloat) 0.482319,
+       (GLfloat) - 0.850293, (GLfloat) 0.503676, (GLfloat) 0.152681,
+       (GLfloat) - 0.849127, (GLfloat) 0.506180, (GLfloat) 0.150879,
+       (GLfloat) - 0.738717, (GLfloat) 0.659007, (GLfloat) 0.141447,
+       (GLfloat) - 0.736283, (GLfloat) 0.662408, (GLfloat) 0.138214,
+       (GLfloat) - 0.631960, (GLfloat) 0.635245, (GLfloat) 0.443948,
+       (GLfloat) - 0.643540, (GLfloat) 0.626686, (GLfloat) 0.439455,
+       (GLfloat) - 0.741041, (GLfloat) 0.473108, (GLfloat) - 0.476473,
+       (GLfloat) - 0.742406, (GLfloat) 0.464975, (GLfloat) - 0.482319,
+       (GLfloat) - 0.631960, (GLfloat) 0.635245, (GLfloat) - 0.443948,
+       (GLfloat) - 0.643541, (GLfloat) 0.626686, (GLfloat) - 0.439455,
+       (GLfloat) - 0.738717, (GLfloat) 0.659007, (GLfloat) - 0.141447,
+       (GLfloat) - 0.736283, (GLfloat) 0.662408, (GLfloat) - 0.138214,
+       (GLfloat) - 0.849127, (GLfloat) 0.506180, (GLfloat) - 0.150879,
+       (GLfloat) - 0.850293, (GLfloat) 0.503676, (GLfloat) - 0.152681,
+       (GLfloat) - 0.489320, (GLfloat) - 0.355167, (GLfloat) - 0.796506,
+       (GLfloat) - 0.498398, (GLfloat) - 0.341072, (GLfloat) - 0.797038,
+       (GLfloat) - 0.172289, (GLfloat) - 0.401583, (GLfloat) - 0.899471,
+       (GLfloat) - 0.163102, (GLfloat) - 0.385135, (GLfloat) - 0.908333,
+       (GLfloat) - 0.182727, (GLfloat) - 0.410657, (GLfloat) - 0.893293,
+       (GLfloat) - 0.172422, (GLfloat) - 0.394484, (GLfloat) - 0.902581,
+       (GLfloat) - 0.506086, (GLfloat) - 0.336560, (GLfloat) - 0.794106,
+       (GLfloat) - 0.496896, (GLfloat) - 0.351037, (GLfloat) - 0.793642,
+       (GLfloat) 0.421643, (GLfloat) - 0.514114, (GLfloat) - 0.746930,
+       (GLfloat) 0.435781, (GLfloat) - 0.498195, (GLfloat) - 0.749598,
+       (GLfloat) 0.399104, (GLfloat) - 0.548391, (GLfloat) - 0.734836,
+       (GLfloat) 0.414969, (GLfloat) - 0.532774, (GLfloat) - 0.737532,
+       (GLfloat) 0.122126, (GLfloat) - 0.459168, (GLfloat) - 0.879915,
+       (GLfloat) 0.107835, (GLfloat) - 0.476533, (GLfloat) - 0.872518,
+       (GLfloat) 0.135473, (GLfloat) - 0.437168, (GLfloat) - 0.889118,
+       (GLfloat) 0.122726, (GLfloat) - 0.454818, (GLfloat) - 0.882088,
+       (GLfloat) 0.451859, (GLfloat) - 0.350279, (GLfloat) - 0.820444,
+       (GLfloat) 0.459996, (GLfloat) - 0.340221, (GLfloat) - 0.820154,
+       (GLfloat) 0.139327, (GLfloat) - 0.217141, (GLfloat) - 0.966146,
+       (GLfloat) 0.132987, (GLfloat) - 0.225779, (GLfloat) - 0.965059,
+       (GLfloat) 0.121571, (GLfloat) - 0.389814, (GLfloat) - 0.912834,
+       (GLfloat) 0.109716, (GLfloat) - 0.404550, (GLfloat) - 0.907910,
+       (GLfloat) 0.409974, (GLfloat) - 0.496912, (GLfloat) - 0.764852,
+       (GLfloat) 0.423414, (GLfloat) - 0.483036, (GLfloat) - 0.766418,
+       (GLfloat) - 0.517051, (GLfloat) 0.005478, (GLfloat) - 0.855937,
+       (GLfloat) - 0.518557, (GLfloat) 0.003075, (GLfloat) - 0.855038,
+       (GLfloat) - 0.515705, (GLfloat) - 0.236965, (GLfloat) - 0.823344,
+       (GLfloat) - 0.521517, (GLfloat) - 0.225403, (GLfloat) - 0.822930,
+       (GLfloat) - 0.189726, (GLfloat) - 0.318770, (GLfloat) - 0.928649,
+       (GLfloat) - 0.181223, (GLfloat) - 0.305795, (GLfloat) - 0.934691,
+       (GLfloat) - 0.179422, (GLfloat) - 0.111097, (GLfloat) - 0.977479,
+       (GLfloat) - 0.175584, (GLfloat) - 0.105473, (GLfloat) - 0.978798,
+       (GLfloat) - 0.822110, (GLfloat) - 0.303411, (GLfloat) - 0.481743,
+       (GLfloat) - 0.821692, (GLfloat) - 0.296307, (GLfloat) - 0.486851,
+       (GLfloat) - 0.829019, (GLfloat) - 0.285105, (GLfloat) - 0.481086,
+       (GLfloat) - 0.828324, (GLfloat) - 0.278227, (GLfloat) - 0.486280,
+       (GLfloat) - 0.955809, (GLfloat) - 0.248857, (GLfloat) - 0.156521,
+       (GLfloat) - 0.955462, (GLfloat) - 0.251102, (GLfloat) - 0.155051,
+       (GLfloat) - 0.949299, (GLfloat) - 0.272604, (GLfloat) - 0.156583,
+       (GLfloat) - 0.948870, (GLfloat) - 0.274919, (GLfloat) - 0.155132,
+       (GLfloat) - 0.850734, (GLfloat) 0.112614, (GLfloat) - 0.513391,
+       (GLfloat) - 0.850654, (GLfloat) 0.112793, (GLfloat) - 0.513484,
+       (GLfloat) - 0.974222, (GLfloat) 0.155109, (GLfloat) - 0.163808,
+       (GLfloat) - 0.974191, (GLfloat) 0.155230, (GLfloat) - 0.163874,
+       (GLfloat) - 0.980876, (GLfloat) - 0.109137, (GLfloat) - 0.161159,
+       (GLfloat) - 0.980855, (GLfloat) - 0.110647, (GLfloat) - 0.160255,
+       (GLfloat) - 0.853630, (GLfloat) - 0.150462, (GLfloat) - 0.498675,
+       (GLfloat) - 0.852599, (GLfloat) - 0.145646, (GLfloat) - 0.501859,
+       (GLfloat) - 0.850734, (GLfloat) 0.112614, (GLfloat) 0.513391,
+       (GLfloat) - 0.850654, (GLfloat) 0.112793, (GLfloat) 0.513484,
+       (GLfloat) - 0.852599, (GLfloat) - 0.145647, (GLfloat) 0.501859,
+       (GLfloat) - 0.853630, (GLfloat) - 0.150462, (GLfloat) 0.498676,
+       (GLfloat) - 0.980876, (GLfloat) - 0.109137, (GLfloat) 0.161159,
+       (GLfloat) - 0.980855, (GLfloat) - 0.110647, (GLfloat) 0.160255,
+       (GLfloat) - 0.974191, (GLfloat) 0.155230, (GLfloat) 0.163874,
+       (GLfloat) - 0.974222, (GLfloat) 0.155109, (GLfloat) 0.163808,
+       (GLfloat) - 0.821692, (GLfloat) - 0.296307, (GLfloat) 0.486851,
+       (GLfloat) - 0.822110, (GLfloat) - 0.303411, (GLfloat) 0.481743,
+       (GLfloat) - 0.949299, (GLfloat) - 0.272604, (GLfloat) 0.156583,
+       (GLfloat) - 0.948870, (GLfloat) - 0.274919, (GLfloat) 0.155132,
+       (GLfloat) - 0.955462, (GLfloat) - 0.251102, (GLfloat) 0.155051,
+       (GLfloat) - 0.955809, (GLfloat) - 0.248857, (GLfloat) 0.156520,
+       (GLfloat) - 0.829019, (GLfloat) - 0.285105, (GLfloat) 0.481086,
+       (GLfloat) - 0.828324, (GLfloat) - 0.278227, (GLfloat) 0.486280,
+       (GLfloat) - 0.498398, (GLfloat) - 0.341071, (GLfloat) 0.797038,
+       (GLfloat) - 0.489320, (GLfloat) - 0.355167, (GLfloat) 0.796507,
+       (GLfloat) - 0.506086, (GLfloat) - 0.336560, (GLfloat) 0.794106,
+       (GLfloat) - 0.496896, (GLfloat) - 0.351037, (GLfloat) 0.793642,
+       (GLfloat) - 0.182728, (GLfloat) - 0.410657, (GLfloat) 0.893293,
+       (GLfloat) - 0.172423, (GLfloat) - 0.394484, (GLfloat) 0.902581,
+       (GLfloat) - 0.163101, (GLfloat) - 0.385135, (GLfloat) 0.908333,
+       (GLfloat) - 0.172289, (GLfloat) - 0.401584, (GLfloat) 0.899470,
+       (GLfloat) - 0.518557, (GLfloat) 0.003076, (GLfloat) 0.855038,
+       (GLfloat) - 0.517051, (GLfloat) 0.005478, (GLfloat) 0.855937,
+       (GLfloat) - 0.179422, (GLfloat) - 0.111097, (GLfloat) 0.977479,
+       (GLfloat) - 0.175584, (GLfloat) - 0.105473, (GLfloat) 0.978798,
+       (GLfloat) - 0.181223, (GLfloat) - 0.305795, (GLfloat) 0.934691,
+       (GLfloat) - 0.189727, (GLfloat) - 0.318770, (GLfloat) 0.928649,
+       (GLfloat) - 0.521517, (GLfloat) - 0.225402, (GLfloat) 0.822930,
+       (GLfloat) - 0.515705, (GLfloat) - 0.236965, (GLfloat) 0.823344,
+       (GLfloat) 0.451859, (GLfloat) - 0.350279, (GLfloat) 0.820444,
+       (GLfloat) 0.459996, (GLfloat) - 0.340221, (GLfloat) 0.820154,
+       (GLfloat) 0.423414, (GLfloat) - 0.483036, (GLfloat) 0.766418,
+       (GLfloat) 0.409975, (GLfloat) - 0.496912, (GLfloat) 0.764853,
+       (GLfloat) 0.121571, (GLfloat) - 0.389814, (GLfloat) 0.912834,
+       (GLfloat) 0.109716, (GLfloat) - 0.404550, (GLfloat) 0.907911,
+       (GLfloat) 0.132987, (GLfloat) - 0.225779, (GLfloat) 0.965059,
+       (GLfloat) 0.139327, (GLfloat) - 0.217140, (GLfloat) 0.966146,
+       (GLfloat) 0.435780, (GLfloat) - 0.498195, (GLfloat) 0.749598,
+       (GLfloat) 0.421643, (GLfloat) - 0.514113, (GLfloat) 0.746930,
+       (GLfloat) 0.135473, (GLfloat) - 0.437169, (GLfloat) 0.889118,
+       (GLfloat) 0.122726, (GLfloat) - 0.454818, (GLfloat) 0.882088,
+       (GLfloat) 0.107835, (GLfloat) - 0.476534, (GLfloat) 0.872518,
+       (GLfloat) 0.122126, (GLfloat) - 0.459168, (GLfloat) 0.879915,
+       (GLfloat) 0.399104, (GLfloat) - 0.548391, (GLfloat) 0.734836,
+       (GLfloat) 0.414969, (GLfloat) - 0.532773, (GLfloat) 0.737532,
+       (GLfloat) 0.709825, (GLfloat) - 0.548164, (GLfloat) 0.442339,
+       (GLfloat) 0.706858, (GLfloat) - 0.559116, (GLfloat) 0.433291,
+       (GLfloat) 0.678133, (GLfloat) - 0.593660, (GLfloat) 0.433248,
+       (GLfloat) 0.674632, (GLfloat) - 0.604835, (GLfloat) 0.423140,
+       (GLfloat) 0.774649, (GLfloat) - 0.617973, (GLfloat) 0.134272,
+       (GLfloat) 0.777074, (GLfloat) - 0.614312, (GLfloat) 0.137026,
+       (GLfloat) 0.811265, (GLfloat) - 0.568214, (GLfloat) 0.137773,
+       (GLfloat) 0.813383, (GLfloat) - 0.564575, (GLfloat) 0.140223,
+       (GLfloat) 0.750611, (GLfloat) - 0.453426, (GLfloat) 0.480612,
+       (GLfloat) 0.748687, (GLfloat) - 0.462619, (GLfloat) 0.474817,
+       (GLfloat) 0.853444, (GLfloat) - 0.499176, (GLfloat) 0.149855,
+       (GLfloat) 0.854917, (GLfloat) - 0.496116, (GLfloat) 0.151614,
+       (GLfloat) 0.791852, (GLfloat) - 0.594634, (GLfloat) 0.139213,
+       (GLfloat) 0.794008, (GLfloat) - 0.591177, (GLfloat) 0.141637,
+       (GLfloat) 0.694144, (GLfloat) - 0.562907, (GLfloat) 0.448664,
+       (GLfloat) 0.690998, (GLfloat) - 0.573547, (GLfloat) 0.439961,
+       (GLfloat) 0.750611, (GLfloat) - 0.453426, (GLfloat) - 0.480612,
+       (GLfloat) 0.748687, (GLfloat) - 0.462620, (GLfloat) - 0.474817,
+       (GLfloat) 0.690999, (GLfloat) - 0.573546, (GLfloat) - 0.439961,
+       (GLfloat) 0.694144, (GLfloat) - 0.562907, (GLfloat) - 0.448664,
+       (GLfloat) 0.791852, (GLfloat) - 0.594634, (GLfloat) - 0.139213,
+       (GLfloat) 0.794008, (GLfloat) - 0.591177, (GLfloat) - 0.141637,
+       (GLfloat) 0.854917, (GLfloat) - 0.496116, (GLfloat) - 0.151614,
+       (GLfloat) 0.853444, (GLfloat) - 0.499176, (GLfloat) - 0.149855,
+       (GLfloat) 0.706858, (GLfloat) - 0.559116, (GLfloat) - 0.433291,
+       (GLfloat) 0.709825, (GLfloat) - 0.548164, (GLfloat) - 0.442339,
+       (GLfloat) 0.811265, (GLfloat) - 0.568214, (GLfloat) - 0.137773,
+       (GLfloat) 0.813383, (GLfloat) - 0.564575, (GLfloat) - 0.140223,
+       (GLfloat) 0.777074, (GLfloat) - 0.614312, (GLfloat) - 0.137026,
+       (GLfloat) 0.774649, (GLfloat) - 0.617973, (GLfloat) - 0.134272,
+       (GLfloat) 0.678133, (GLfloat) - 0.593660, (GLfloat) - 0.433248,
+       (GLfloat) 0.674631, (GLfloat) - 0.604835, (GLfloat) - 0.423139,
+       (GLfloat) 0.805725, (GLfloat) - 0.334902, (GLfloat) 0.488515,
+       (GLfloat) 0.805089, (GLfloat) - 0.341176, (GLfloat) 0.485212,
+       (GLfloat) 0.923877, (GLfloat) - 0.350079, (GLfloat) 0.154583,
+       (GLfloat) 0.924516, (GLfloat) - 0.347968, (GLfloat) 0.155526,
+       (GLfloat) 0.927012, (GLfloat) - 0.340158, (GLfloat) 0.157929,
+       (GLfloat) 0.924342, (GLfloat) - 0.348817, (GLfloat) 0.154657,
+       (GLfloat) 0.800744, (GLfloat) - 0.354688, (GLfloat) 0.482707,
+       (GLfloat) 0.801658, (GLfloat) - 0.348585, (GLfloat) 0.485626,
+       (GLfloat) 0.805725, (GLfloat) - 0.334902, (GLfloat) - 0.488516,
+       (GLfloat) 0.805089, (GLfloat) - 0.341176, (GLfloat) - 0.485212,
+       (GLfloat) 0.801658, (GLfloat) - 0.348585, (GLfloat) - 0.485626,
+       (GLfloat) 0.800744, (GLfloat) - 0.354688, (GLfloat) - 0.482707,
+       (GLfloat) 0.927012, (GLfloat) - 0.340158, (GLfloat) - 0.157929,
+       (GLfloat) 0.924342, (GLfloat) - 0.348818, (GLfloat) - 0.154657,
+       (GLfloat) 0.924516, (GLfloat) - 0.347968, (GLfloat) - 0.155526,
+       (GLfloat) 0.923877, (GLfloat) - 0.350079, (GLfloat) - 0.154583,
+       (GLfloat) 0.283621, (GLfloat) - 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) 0.264056, (GLfloat) - 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) 0.315105, (GLfloat) - 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) 0.304029, (GLfloat) - 0.949849, (GLfloat) - 0.073162,
+       (GLfloat) 0.681274, (GLfloat) - 0.722487, (GLfloat) - 0.117805,
+       (GLfloat) 0.706887, (GLfloat) - 0.694350, (GLfloat) - 0.134864,
+       (GLfloat) 0.560017, (GLfloat) - 0.754527, (GLfloat) - 0.342154,
+       (GLfloat) 0.577334, (GLfloat) - 0.729313, (GLfloat) - 0.367135,
+       (GLfloat) 0.264055, (GLfloat) - 0.947923, (GLfloat) 0.178092,
+       (GLfloat) 0.283621, (GLfloat) - 0.936578, (GLfloat) 0.205866,
+       (GLfloat) 0.560017, (GLfloat) - 0.754527, (GLfloat) 0.342155,
+       (GLfloat) 0.577334, (GLfloat) - 0.729313, (GLfloat) 0.367135,
+       (GLfloat) 0.706888, (GLfloat) - 0.694350, (GLfloat) 0.134864,
+       (GLfloat) 0.681274, (GLfloat) - 0.722487, (GLfloat) 0.117805,
+       (GLfloat) 0.304029, (GLfloat) - 0.949849, (GLfloat) 0.073162,
+       (GLfloat) 0.315105, (GLfloat) - 0.946548, (GLfloat) 0.068965,
+       (GLfloat) 0.484153, (GLfloat) - 0.303994, (GLfloat) - 0.820478,
+       (GLfloat) 0.489225, (GLfloat) - 0.294821, (GLfloat) - 0.820816,
+       (GLfloat) 0.156385, (GLfloat) - 0.248336, (GLfloat) - 0.955967,
+       (GLfloat) 0.151648, (GLfloat) - 0.258100, (GLfloat) - 0.954142,
+       (GLfloat) 0.160268, (GLfloat) - 0.275037, (GLfloat) - 0.947981,
+       (GLfloat) 0.153877, (GLfloat) - 0.291476, (GLfloat) - 0.944120,
+       (GLfloat) 0.481923, (GLfloat) - 0.335378, (GLfloat) - 0.809489,
+       (GLfloat) 0.489881, (GLfloat) - 0.318876, (GLfloat) - 0.811378,
+       (GLfloat) - 0.511124, (GLfloat) - 0.173861, (GLfloat) - 0.841739,
+       (GLfloat) - 0.507919, (GLfloat) - 0.180984, (GLfloat) - 0.842177,
+       (GLfloat) - 0.502437, (GLfloat) - 0.243295, (GLfloat) - 0.829678,
+       (GLfloat) - 0.501146, (GLfloat) - 0.246358, (GLfloat) - 0.829554,
+       (GLfloat) - 0.162122, (GLfloat) - 0.255565, (GLfloat) - 0.953102,
+       (GLfloat) - 0.162682, (GLfloat) - 0.257426, (GLfloat) - 0.952505,
+       (GLfloat) - 0.167026, (GLfloat) - 0.217710, (GLfloat) - 0.961616,
+       (GLfloat) - 0.163395, (GLfloat) - 0.208930, (GLfloat) - 0.964184,
+       (GLfloat) - 0.205866, (GLfloat) - 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) - 0.178092, (GLfloat) - 0.947923, (GLfloat) - 0.264055,
+       (GLfloat) - 0.068965, (GLfloat) - 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) - 0.073162, (GLfloat) - 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) - 0.124478, (GLfloat) - 0.692921, (GLfloat) - 0.710188,
+       (GLfloat) - 0.138779, (GLfloat) - 0.668059, (GLfloat) - 0.731052,
+       (GLfloat) - 0.361212, (GLfloat) - 0.721974, (GLfloat) - 0.590152,
+       (GLfloat) - 0.383785, (GLfloat) - 0.697396, (GLfloat) - 0.605267,
+       (GLfloat) 0.178092, (GLfloat) - 0.947923, (GLfloat) - 0.264056,
+       (GLfloat) 0.205866, (GLfloat) - 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) 0.341480, (GLfloat) - 0.751054, (GLfloat) - 0.565075,
+       (GLfloat) 0.372366, (GLfloat) - 0.719604, (GLfloat) - 0.586101,
+       (GLfloat) 0.138114, (GLfloat) - 0.672674, (GLfloat) - 0.726935,
+       (GLfloat) 0.117913, (GLfloat) - 0.706722, (GLfloat) - 0.697597,
+       (GLfloat) 0.073162, (GLfloat) - 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) 0.068965, (GLfloat) - 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) - 0.850324, (GLfloat) - 0.141983, (GLfloat) - 0.506744,
+       (GLfloat) - 0.849870, (GLfloat) - 0.138328, (GLfloat) - 0.508515,
+       (GLfloat) - 0.979216, (GLfloat) - 0.120924, (GLfloat) - 0.162831,
+       (GLfloat) - 0.979161, (GLfloat) - 0.122085, (GLfloat) - 0.162295,
+       (GLfloat) - 0.968183, (GLfloat) - 0.188900, (GLfloat) - 0.164128,
+       (GLfloat) - 0.966893, (GLfloat) - 0.198288, (GLfloat) - 0.160620,
+       (GLfloat) - 0.836326, (GLfloat) - 0.225408, (GLfloat) - 0.499751,
+       (GLfloat) - 0.836389, (GLfloat) - 0.213159, (GLfloat) - 0.504991,
+       (GLfloat) - 0.850324, (GLfloat) - 0.141983, (GLfloat) 0.506744,
+       (GLfloat) - 0.849870, (GLfloat) - 0.138328, (GLfloat) 0.508515,
+       (GLfloat) - 0.836389, (GLfloat) - 0.213159, (GLfloat) 0.504991,
+       (GLfloat) - 0.836326, (GLfloat) - 0.225408, (GLfloat) 0.499751,
+       (GLfloat) - 0.968183, (GLfloat) - 0.188900, (GLfloat) 0.164128,
+       (GLfloat) - 0.966894, (GLfloat) - 0.198288, (GLfloat) 0.160620,
+       (GLfloat) - 0.979161, (GLfloat) - 0.122085, (GLfloat) 0.162295,
+       (GLfloat) - 0.979216, (GLfloat) - 0.120924, (GLfloat) 0.162831,
+       (GLfloat) - 0.283620, (GLfloat) - 0.936578, (GLfloat) 0.205866,
+       (GLfloat) - 0.264055, (GLfloat) - 0.947923, (GLfloat) 0.178091,
+       (GLfloat) - 0.315105, (GLfloat) - 0.946548, (GLfloat) 0.068965,
+       (GLfloat) - 0.304029, (GLfloat) - 0.949849, (GLfloat) 0.073162,
+       (GLfloat) - 0.727074, (GLfloat) - 0.675149, (GLfloat) 0.124651,
+       (GLfloat) - 0.751597, (GLfloat) - 0.644138, (GLfloat) 0.142086,
+       (GLfloat) - 0.595577, (GLfloat) - 0.717790, (GLfloat) 0.360647,
+       (GLfloat) - 0.614268, (GLfloat) - 0.686473, (GLfloat) 0.389139,
+       (GLfloat) - 0.264055, (GLfloat) - 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) - 0.283620, (GLfloat) - 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) - 0.595576, (GLfloat) - 0.717790, (GLfloat) - 0.360646,
+       (GLfloat) - 0.614268, (GLfloat) - 0.686473, (GLfloat) - 0.389139,
+       (GLfloat) - 0.751597, (GLfloat) - 0.644138, (GLfloat) - 0.142087,
+       (GLfloat) - 0.727074, (GLfloat) - 0.675149, (GLfloat) - 0.124651,
+       (GLfloat) - 0.304029, (GLfloat) - 0.949849, (GLfloat) - 0.073163,
+       (GLfloat) - 0.315105, (GLfloat) - 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) - 0.511124, (GLfloat) - 0.173862, (GLfloat) 0.841739,
+       (GLfloat) - 0.507920, (GLfloat) - 0.180984, (GLfloat) 0.842177,
+       (GLfloat) - 0.167026, (GLfloat) - 0.217709, (GLfloat) 0.961616,
+       (GLfloat) - 0.163395, (GLfloat) - 0.208930, (GLfloat) 0.964184,
+       (GLfloat) - 0.162682, (GLfloat) - 0.257426, (GLfloat) 0.952505,
+       (GLfloat) - 0.162122, (GLfloat) - 0.255564, (GLfloat) 0.953102,
+       (GLfloat) - 0.501146, (GLfloat) - 0.246358, (GLfloat) 0.829554,
+       (GLfloat) - 0.502437, (GLfloat) - 0.243295, (GLfloat) 0.829677,
+       (GLfloat) 0.484153, (GLfloat) - 0.303994, (GLfloat) 0.820478,
+       (GLfloat) 0.489225, (GLfloat) - 0.294820, (GLfloat) 0.820816,
+       (GLfloat) 0.489881, (GLfloat) - 0.318876, (GLfloat) 0.811378,
+       (GLfloat) 0.481923, (GLfloat) - 0.335378, (GLfloat) 0.809489,
+       (GLfloat) 0.160269, (GLfloat) - 0.275036, (GLfloat) 0.947982,
+       (GLfloat) 0.153877, (GLfloat) - 0.291476, (GLfloat) 0.944120,
+       (GLfloat) 0.151647, (GLfloat) - 0.258100, (GLfloat) 0.954142,
+       (GLfloat) 0.156385, (GLfloat) - 0.248335, (GLfloat) 0.955967,
+       (GLfloat) 0.205866, (GLfloat) - 0.936578, (GLfloat) 0.283620,
+       (GLfloat) 0.178092, (GLfloat) - 0.947923, (GLfloat) 0.264055,
+       (GLfloat) 0.068965, (GLfloat) - 0.946548, (GLfloat) 0.315105,
+       (GLfloat) 0.073163, (GLfloat) - 0.949849, (GLfloat) 0.304029,
+       (GLfloat) 0.117913, (GLfloat) - 0.706722, (GLfloat) 0.697597,
+       (GLfloat) 0.138114, (GLfloat) - 0.672674, (GLfloat) 0.726935,
+       (GLfloat) 0.341480, (GLfloat) - 0.751053, (GLfloat) 0.565076,
+       (GLfloat) 0.372365, (GLfloat) - 0.719604, (GLfloat) 0.586101,
+       (GLfloat) - 0.178091, (GLfloat) - 0.947923, (GLfloat) 0.264055,
+       (GLfloat) - 0.205866, (GLfloat) - 0.936578, (GLfloat) 0.283620,
+       (GLfloat) - 0.361213, (GLfloat) - 0.721973, (GLfloat) 0.590152,
+       (GLfloat) - 0.383785, (GLfloat) - 0.697396, (GLfloat) 0.605267,
+       (GLfloat) - 0.138779, (GLfloat) - 0.668060, (GLfloat) 0.731052,
+       (GLfloat) - 0.124478, (GLfloat) - 0.692921, (GLfloat) 0.710188,
+       (GLfloat) - 0.073162, (GLfloat) - 0.949849, (GLfloat) 0.304029,
+       (GLfloat) - 0.068965, (GLfloat) - 0.946548, (GLfloat) 0.315105,
+       (GLfloat) 0.135802, (GLfloat) - 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) 0.124011, (GLfloat) - 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) 0.043834, (GLfloat) - 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) 0.039656, (GLfloat) - 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) 0.030163, (GLfloat) - 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) 0.033079, (GLfloat) - 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) 0.109621, (GLfloat) - 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) 0.114709, (GLfloat) - 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) - 0.124011, (GLfloat) - 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) - 0.135802, (GLfloat) - 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) - 0.109621, (GLfloat) - 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) - 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) - 0.033079, (GLfloat) - 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) - 0.030163, (GLfloat) - 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) - 0.043834, (GLfloat) - 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) - 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) - 0.135802, (GLfloat) - 0.982944, (GLfloat) 0.124011,
+       (GLfloat) - 0.124011, (GLfloat) - 0.982944, (GLfloat) 0.135802,
+       (GLfloat) - 0.043834, (GLfloat) - 0.993006, (GLfloat) 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) - 0.992607, (GLfloat) 0.114709,
+       (GLfloat) - 0.030163, (GLfloat) - 0.998998, (GLfloat) 0.033079,
+       (GLfloat) - 0.033079, (GLfloat) - 0.998998, (GLfloat) 0.030163,
+       (GLfloat) - 0.109621, (GLfloat) - 0.993006, (GLfloat) 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) - 0.992607, (GLfloat) 0.039656,
+       (GLfloat) 0.124011, (GLfloat) - 0.982944, (GLfloat) 0.135802,
+       (GLfloat) 0.135802, (GLfloat) - 0.982944, (GLfloat) 0.124011,
+       (GLfloat) 0.109621, (GLfloat) - 0.993006, (GLfloat) 0.043834,
+       (GLfloat) 0.114709, (GLfloat) - 0.992607, (GLfloat) 0.039656,
+       (GLfloat) 0.033079, (GLfloat) - 0.998998, (GLfloat) 0.030163,
+       (GLfloat) 0.030163, (GLfloat) - 0.998998, (GLfloat) 0.033079,
+       (GLfloat) 0.043834, (GLfloat) - 0.993006, (GLfloat) 0.109621,
+       (GLfloat) 0.039656, (GLfloat) - 0.992607, (GLfloat) 0.114709,
+};
+
+static unsigned short int s1_2_POLS[] =
+{
+      3, 12, 76, 74, 1, 3, 12, 74, 82, 1, 3, 22, 78, 74, 1, 3, 22, 74, 76, 1,
+      3, 78, 20, 80, 1, 3, 80, 74, 78, 1, 3, 80, 28, 82, 1, 3, 82, 74, 80, 1,
+      3, 13, 84, 77, 1, 3, 13, 77, 88, 1, 3, 84, 24, 86, 1, 3, 86, 77, 84, 1,
+      3, 86, 20, 78, 1, 3, 78, 77, 86, 1, 3, 22, 88, 77, 1, 3, 22, 77, 78, 1,
+      3, 14, 90, 85, 1, 3, 14, 85, 93, 1, 3, 26, 91, 85, 1, 3, 26, 85, 90, 1,
+      3, 20, 86, 85, 1, 3, 20, 85, 91, 1, 3, 86, 24, 93, 1, 3, 93, 85, 86, 1,
+      3, 15, 95, 79, 1, 3, 15, 79, 97, 1, 3, 95, 28, 80, 1, 3, 80, 79, 95, 1,
+      3, 20, 91, 79, 1, 3, 20, 79, 80, 1, 3, 26, 97, 79, 1, 3, 26, 79, 91, 1,
+    3, 13, 99, 83, 1, 3, 13, 83, 84, 1, 3, 99, 30, 101, 1, 3, 101, 83, 99, 1,
+   3, 23, 102, 83, 1, 3, 23, 83, 101, 1, 3, 24, 84, 83, 1, 3, 24, 83, 102, 1,
+       3, 108, 16, 104, 1, 3, 104, 100, 108, 1, 3, 32, 106, 100, 1, 3, 32, 100, 104, 1,
+       3, 106, 23, 101, 1, 3, 101, 100, 106, 1, 3, 30, 108, 100, 1, 3, 30, 100, 101, 1,
+       3, 17, 110, 105, 1, 3, 17, 105, 113, 1, 3, 110, 33, 111, 1, 3, 111, 105, 110, 1,
+       3, 23, 106, 105, 1, 3, 23, 105, 111, 1, 3, 106, 32, 113, 1, 3, 113, 105, 106, 1,
+   3, 114, 14, 93, 1, 3, 93, 92, 114, 1, 3, 24, 102, 92, 1, 3, 24, 92, 93, 1,
+  3, 23, 111, 92, 1, 3, 23, 92, 102, 1, 3, 33, 114, 92, 1, 3, 33, 92, 111, 1,
+       3, 104, 16, 116, 1, 3, 116, 103, 104, 1, 3, 35, 118, 103, 1, 3, 35, 103, 116, 1,
+       3, 118, 31, 119, 1, 3, 119, 103, 118, 1, 3, 32, 104, 103, 1, 3, 32, 103, 119, 1,
+       3, 125, 18, 121, 1, 3, 121, 117, 125, 1, 3, 36, 123, 117, 1, 3, 36, 117, 121, 1,
+       3, 123, 31, 118, 1, 3, 118, 117, 123, 1, 3, 35, 125, 117, 1, 3, 35, 117, 118, 1,
+       3, 19, 127, 122, 1, 3, 19, 122, 130, 1, 3, 37, 128, 122, 1, 3, 37, 122, 127, 1,
+       3, 128, 31, 123, 1, 3, 123, 122, 128, 1, 3, 36, 130, 122, 1, 3, 36, 122, 123, 1,
+       3, 17, 113, 112, 1, 3, 17, 112, 131, 1, 3, 32, 119, 112, 1, 3, 32, 112, 113, 1,
+       3, 119, 31, 128, 1, 3, 128, 112, 119, 1, 3, 37, 131, 112, 1, 3, 37, 112, 128, 1,
+       3, 121, 18, 133, 1, 3, 133, 120, 121, 1, 3, 39, 134, 120, 1, 3, 39, 120, 133, 1,
+       3, 134, 27, 135, 1, 3, 135, 120, 134, 1, 3, 36, 121, 120, 1, 3, 36, 120, 135, 1,
+    3, 12, 82, 81, 1, 3, 12, 81, 138, 1, 3, 28, 136, 81, 1, 3, 28, 81, 82, 1,
+3, 27, 134, 81, 1, 3, 27, 81, 136, 1, 3, 134, 39, 138, 1, 3, 138, 81, 134, 1,
+  3, 95, 15, 139, 1, 3, 139, 94, 95, 1, 3, 40, 140, 94, 1, 3, 40, 94, 139, 1,
+   3, 27, 136, 94, 1, 3, 27, 94, 140, 1, 3, 28, 95, 94, 1, 3, 28, 94, 136, 1,
+       3, 19, 130, 129, 1, 3, 19, 129, 141, 1, 3, 130, 36, 135, 1, 3, 135, 129, 130, 1,
+       3, 27, 140, 129, 1, 3, 27, 129, 135, 1, 3, 140, 40, 141, 1, 3, 141, 129, 140, 1,
+ 3, 14, 114, 89, 1, 3, 14, 89, 90, 1, 3, 114, 33, 142, 1, 3, 142, 89, 114, 1,
+  3, 25, 143, 89, 1, 3, 25, 89, 142, 1, 3, 143, 26, 90, 1, 3, 90, 89, 143, 1,
+       3, 17, 131, 109, 1, 3, 17, 109, 110, 1, 3, 131, 37, 144, 1, 3, 144, 109, 131, 1,
+       3, 25, 142, 109, 1, 3, 25, 109, 144, 1, 3, 142, 33, 110, 1, 3, 110, 109, 142, 1,
+       3, 19, 141, 126, 1, 3, 19, 126, 127, 1, 3, 141, 40, 145, 1, 3, 145, 126, 141, 1,
+       3, 25, 144, 126, 1, 3, 25, 126, 145, 1, 3, 144, 37, 127, 1, 3, 127, 126, 144, 1,
+   3, 15, 97, 96, 1, 3, 15, 96, 139, 1, 3, 97, 26, 143, 1, 3, 143, 96, 97, 1,
+3, 25, 145, 96, 1, 3, 25, 96, 143, 1, 3, 145, 40, 139, 1, 3, 139, 96, 145, 1,
+ 3, 12, 146, 75, 1, 3, 12, 75, 76, 1, 3, 146, 41, 148, 1, 3, 148, 75, 146, 1,
+  3, 21, 149, 75, 1, 3, 21, 75, 148, 1, 3, 149, 22, 76, 1, 3, 76, 75, 149, 1,
+       3, 155, 8, 151, 1, 3, 151, 147, 155, 1, 3, 43, 153, 147, 1, 3, 43, 147, 151, 1,
+       3, 153, 21, 148, 1, 3, 148, 147, 153, 1, 3, 41, 155, 147, 1, 3, 41, 147, 148, 1,
+       3, 160, 11, 157, 1, 3, 157, 152, 160, 1, 3, 44, 158, 152, 1, 3, 44, 152, 157, 1,
+       3, 158, 21, 153, 1, 3, 153, 152, 158, 1, 3, 43, 160, 152, 1, 3, 43, 152, 153, 1,
+   3, 13, 88, 87, 1, 3, 13, 87, 161, 1, 3, 88, 22, 149, 1, 3, 149, 87, 88, 1,
+3, 21, 158, 87, 1, 3, 21, 87, 149, 1, 3, 158, 44, 161, 1, 3, 161, 87, 158, 1,
+       3, 18, 162, 132, 1, 3, 18, 132, 133, 1, 3, 162, 45, 164, 1, 3, 164, 132, 162, 1,
+       3, 38, 165, 132, 1, 3, 38, 132, 164, 1, 3, 165, 39, 133, 1, 3, 133, 132, 165, 1,
+       3, 170, 9, 167, 1, 3, 167, 163, 170, 1, 3, 47, 168, 163, 1, 3, 47, 163, 167, 1,
+       3, 168, 38, 164, 1, 3, 164, 163, 168, 1, 3, 45, 170, 163, 1, 3, 45, 163, 164, 1,
+3, 8, 155, 154, 1, 3, 8, 154, 173, 1, 3, 155, 41, 171, 1, 3, 171, 154, 155, 1,
+       3, 38, 168, 154, 1, 3, 38, 154, 171, 1, 3, 168, 47, 173, 1, 3, 173, 154, 168, 1,
+       3, 146, 12, 138, 1, 3, 138, 137, 146, 1, 3, 39, 165, 137, 1, 3, 39, 137, 138, 1,
+       3, 165, 38, 171, 1, 3, 171, 137, 165, 1, 3, 41, 146, 137, 1, 3, 41, 137, 171, 1,
+       3, 16, 108, 107, 1, 3, 16, 107, 177, 1, 3, 108, 30, 174, 1, 3, 174, 107, 108, 1,
+       3, 29, 176, 107, 1, 3, 29, 107, 174, 1, 3, 176, 50, 177, 1, 3, 177, 107, 176, 1,
+  3, 99, 13, 161, 1, 3, 161, 98, 99, 1, 3, 44, 178, 98, 1, 3, 44, 98, 161, 1,
+ 3, 178, 29, 174, 1, 3, 174, 98, 178, 1, 3, 30, 99, 98, 1, 3, 30, 98, 174, 1,
+       3, 11, 180, 156, 1, 3, 11, 156, 157, 1, 3, 180, 49, 181, 1, 3, 181, 156, 180, 1,
+       3, 29, 178, 156, 1, 3, 29, 156, 181, 1, 3, 178, 44, 157, 1, 3, 157, 156, 178, 1,
+       3, 185, 10, 183, 1, 3, 183, 175, 185, 1, 3, 50, 176, 175, 1, 3, 50, 175, 183, 1,
+       3, 176, 29, 181, 1, 3, 181, 175, 176, 1, 3, 49, 185, 175, 1, 3, 49, 175, 181, 1,
+       3, 162, 18, 125, 1, 3, 125, 124, 162, 1, 3, 35, 186, 124, 1, 3, 35, 124, 125, 1,
+       3, 186, 34, 187, 1, 3, 187, 124, 186, 1, 3, 45, 162, 124, 1, 3, 45, 124, 187, 1,
+       3, 116, 16, 177, 1, 3, 177, 115, 116, 1, 3, 50, 188, 115, 1, 3, 50, 115, 177, 1,
+       3, 188, 34, 186, 1, 3, 186, 115, 188, 1, 3, 35, 116, 115, 1, 3, 35, 115, 186, 1,
+       3, 183, 10, 190, 1, 3, 190, 182, 183, 1, 3, 52, 191, 182, 1, 3, 52, 182, 190, 1,
+       3, 191, 34, 188, 1, 3, 188, 182, 191, 1, 3, 188, 50, 183, 1, 3, 183, 182, 188, 1,
+       3, 193, 9, 170, 1, 3, 170, 169, 193, 1, 3, 170, 45, 187, 1, 3, 187, 169, 170, 1,
+       3, 187, 34, 191, 1, 3, 191, 169, 187, 1, 3, 52, 193, 169, 1, 3, 52, 169, 191, 1,
+3, 1, 196, 194, 1, 3, 1, 194, 201, 1, 3, 54, 198, 194, 1, 3, 54, 194, 196, 1,
+       3, 198, 46, 199, 1, 3, 199, 194, 198, 1, 3, 199, 56, 201, 1, 3, 201, 194, 199, 1,
+3, 3, 203, 197, 1, 3, 3, 197, 206, 1, 3, 203, 55, 204, 1, 3, 204, 197, 203, 1,
+       3, 46, 198, 197, 1, 3, 46, 197, 204, 1, 3, 198, 54, 206, 1, 3, 206, 197, 198, 1,
+       3, 208, 8, 173, 1, 3, 173, 172, 208, 1, 3, 47, 207, 172, 1, 3, 47, 172, 173, 1,
+       3, 207, 46, 204, 1, 3, 204, 172, 207, 1, 3, 55, 208, 172, 1, 3, 55, 172, 204, 1,
+3, 9, 209, 166, 1, 3, 9, 166, 167, 1, 3, 56, 199, 166, 1, 3, 56, 166, 209, 1,
+       3, 46, 207, 166, 1, 3, 46, 166, 199, 1, 3, 207, 47, 167, 1, 3, 167, 166, 207, 1,
+3, 1, 201, 200, 1, 3, 1, 200, 214, 1, 3, 201, 56, 210, 1, 3, 210, 200, 201, 1,
+       3, 51, 212, 200, 1, 3, 51, 200, 210, 1, 3, 212, 59, 214, 1, 3, 214, 200, 212, 1,
+       3, 209, 9, 193, 1, 3, 193, 192, 209, 1, 3, 52, 215, 192, 1, 3, 52, 192, 193, 1,
+       3, 215, 51, 210, 1, 3, 210, 192, 215, 1, 3, 56, 209, 192, 1, 3, 56, 192, 210, 1,
+       3, 190, 10, 216, 1, 3, 216, 189, 190, 1, 3, 57, 217, 189, 1, 3, 57, 189, 216, 1,
+       3, 217, 51, 215, 1, 3, 215, 189, 217, 1, 3, 52, 190, 189, 1, 3, 52, 189, 215, 1,
+3, 0, 219, 211, 1, 3, 0, 211, 221, 1, 3, 219, 59, 212, 1, 3, 212, 211, 219, 1,
+       3, 51, 217, 211, 1, 3, 51, 211, 212, 1, 3, 217, 57, 221, 1, 3, 221, 211, 217, 1,
+3, 0, 221, 220, 1, 3, 0, 220, 226, 1, 3, 221, 57, 222, 1, 3, 222, 220, 221, 1,
+       3, 222, 48, 224, 1, 3, 224, 220, 222, 1, 3, 62, 226, 220, 1, 3, 62, 220, 224, 1,
+       3, 10, 185, 184, 1, 3, 10, 184, 216, 1, 3, 185, 49, 227, 1, 3, 227, 184, 185, 1,
+       3, 48, 222, 184, 1, 3, 48, 184, 227, 1, 3, 57, 216, 184, 1, 3, 57, 184, 222, 1,
+       3, 180, 11, 228, 1, 3, 228, 179, 180, 1, 3, 60, 229, 179, 1, 3, 60, 179, 228, 1,
+       3, 229, 48, 227, 1, 3, 227, 179, 229, 1, 3, 49, 180, 179, 1, 3, 49, 179, 227, 1,
+3, 2, 231, 223, 1, 3, 2, 223, 233, 1, 3, 231, 62, 224, 1, 3, 224, 223, 231, 1,
+       3, 48, 229, 223, 1, 3, 48, 223, 224, 1, 3, 229, 60, 233, 1, 3, 233, 223, 229, 1,
+3, 2, 233, 232, 1, 3, 2, 232, 237, 1, 3, 233, 60, 234, 1, 3, 234, 232, 233, 1,
+       3, 42, 235, 232, 1, 3, 42, 232, 234, 1, 3, 235, 64, 237, 1, 3, 237, 232, 235, 1,
+       3, 228, 11, 160, 1, 3, 160, 159, 228, 1, 3, 43, 238, 159, 1, 3, 43, 159, 160, 1,
+       3, 238, 42, 234, 1, 3, 234, 159, 238, 1, 3, 60, 228, 159, 1, 3, 60, 159, 234, 1,
+       3, 151, 8, 208, 1, 3, 208, 150, 151, 1, 3, 55, 239, 150, 1, 3, 55, 150, 208, 1,
+       3, 239, 42, 238, 1, 3, 238, 150, 239, 1, 3, 43, 151, 150, 1, 3, 43, 150, 238, 1,
+3, 3, 241, 202, 1, 3, 3, 202, 203, 1, 3, 241, 64, 235, 1, 3, 235, 202, 241, 1,
+       3, 42, 239, 202, 1, 3, 42, 202, 235, 1, 3, 239, 55, 203, 1, 3, 203, 202, 239, 1,
+       3, 245, 2, 237, 1, 3, 237, 236, 245, 1, 3, 64, 242, 236, 1, 3, 64, 236, 237, 1,
+       3, 242, 63, 244, 1, 3, 244, 236, 242, 1, 3, 68, 245, 236, 1, 3, 68, 236, 244, 1,
+       3, 241, 3, 246, 1, 3, 246, 240, 241, 1, 3, 65, 248, 240, 1, 3, 65, 240, 246, 1,
+       3, 248, 63, 242, 1, 3, 242, 240, 248, 1, 3, 64, 241, 240, 1, 3, 64, 240, 242, 1,
+3, 4, 250, 247, 1, 3, 4, 247, 253, 1, 3, 67, 251, 247, 1, 3, 67, 247, 250, 1,
+       3, 63, 248, 247, 1, 3, 63, 247, 251, 1, 3, 248, 65, 253, 1, 3, 253, 247, 248, 1,
+3, 7, 255, 243, 1, 3, 7, 243, 257, 1, 3, 255, 68, 244, 1, 3, 244, 243, 255, 1,
+       3, 63, 251, 243, 1, 3, 63, 243, 244, 1, 3, 67, 257, 243, 1, 3, 67, 243, 251, 1,
+       3, 246, 3, 206, 1, 3, 206, 205, 246, 1, 3, 54, 258, 205, 1, 3, 54, 205, 206, 1,
+       3, 258, 53, 259, 1, 3, 259, 205, 258, 1, 3, 65, 246, 205, 1, 3, 65, 205, 259, 1,
+       3, 196, 1, 260, 1, 3, 260, 195, 196, 1, 3, 69, 262, 195, 1, 3, 69, 195, 260, 1,
+       3, 53, 258, 195, 1, 3, 53, 195, 262, 1, 3, 258, 54, 196, 1, 3, 196, 195, 258, 1,
+3, 5, 264, 261, 1, 3, 5, 261, 267, 1, 3, 70, 265, 261, 1, 3, 70, 261, 264, 1,
+       3, 53, 262, 261, 1, 3, 53, 261, 265, 1, 3, 262, 69, 267, 1, 3, 267, 261, 262, 1,
+3, 4, 253, 252, 1, 3, 4, 252, 268, 1, 3, 253, 65, 259, 1, 3, 259, 252, 253, 1,
+       3, 53, 265, 252, 1, 3, 53, 252, 259, 1, 3, 70, 268, 252, 1, 3, 70, 252, 265, 1,
+       3, 260, 1, 214, 1, 3, 214, 213, 260, 1, 3, 59, 269, 213, 1, 3, 59, 213, 214, 1,
+       3, 269, 58, 270, 1, 3, 270, 213, 269, 1, 3, 69, 260, 213, 1, 3, 69, 213, 270, 1,
+       3, 219, 0, 271, 1, 3, 271, 218, 219, 1, 3, 71, 273, 218, 1, 3, 71, 218, 271, 1,
+       3, 273, 58, 269, 1, 3, 269, 218, 273, 1, 3, 59, 219, 218, 1, 3, 59, 218, 269, 1,
+3, 6, 275, 272, 1, 3, 6, 272, 278, 1, 3, 72, 276, 272, 1, 3, 72, 272, 275, 1,
+       3, 58, 273, 272, 1, 3, 58, 272, 276, 1, 3, 273, 71, 278, 1, 3, 278, 272, 273, 1,
+3, 5, 267, 266, 1, 3, 5, 266, 279, 1, 3, 267, 69, 270, 1, 3, 270, 266, 267, 1,
+       3, 58, 276, 266, 1, 3, 58, 266, 270, 1, 3, 72, 279, 266, 1, 3, 72, 266, 276, 1,
+       3, 271, 0, 226, 1, 3, 226, 225, 271, 1, 3, 226, 62, 280, 1, 3, 280, 225, 226, 1,
+       3, 61, 281, 225, 1, 3, 61, 225, 280, 1, 3, 71, 271, 225, 1, 3, 71, 225, 281, 1,
+       3, 231, 2, 245, 1, 3, 245, 230, 231, 1, 3, 68, 282, 230, 1, 3, 68, 230, 245, 1,
+       3, 282, 61, 280, 1, 3, 280, 230, 282, 1, 3, 62, 231, 230, 1, 3, 62, 230, 280, 1,
+3, 7, 283, 254, 1, 3, 7, 254, 255, 1, 3, 73, 284, 254, 1, 3, 73, 254, 283, 1,
+       3, 61, 282, 254, 1, 3, 61, 254, 284, 1, 3, 282, 68, 255, 1, 3, 255, 254, 282, 1,
+3, 6, 278, 277, 1, 3, 6, 277, 285, 1, 3, 278, 71, 281, 1, 3, 281, 277, 278, 1,
+       3, 61, 284, 277, 1, 3, 61, 277, 281, 1, 3, 73, 285, 277, 1, 3, 73, 277, 284, 1,
+3, 4, 268, 249, 1, 3, 4, 249, 250, 1, 3, 268, 70, 286, 1, 3, 286, 249, 268, 1,
+       3, 66, 287, 249, 1, 3, 66, 249, 286, 1, 3, 287, 67, 250, 1, 3, 250, 249, 287, 1,
+3, 5, 279, 263, 1, 3, 5, 263, 264, 1, 3, 279, 72, 288, 1, 3, 288, 263, 279, 1,
+       3, 66, 286, 263, 1, 3, 66, 263, 288, 1, 3, 286, 70, 264, 1, 3, 264, 263, 286, 1,
+3, 6, 285, 274, 1, 3, 6, 274, 275, 1, 3, 285, 73, 289, 1, 3, 289, 274, 285, 1,
+       3, 66, 288, 274, 1, 3, 66, 274, 289, 1, 3, 288, 72, 275, 1, 3, 275, 274, 288, 1,
+3, 7, 257, 256, 1, 3, 7, 256, 283, 1, 3, 257, 67, 287, 1, 3, 287, 256, 257, 1,
+       3, 66, 289, 256, 1, 3, 66, 256, 287, 1, 3, 289, 73, 283, 1, 3, 283, 256, 289, 1,
+
+       0
+};
+
+struct lwo  LWO_s1_2 =
+{
+       290,                    /* number of points */
+       s1_2_PNTS, s1_2_normals, s1_2_POLS, 0L
+};
+
+#endif /* MODE_sproingies */
+
+/* End of s1_2.c */
diff --git a/modes/glx/s1_3.c b/modes/glx/s1_3.c
new file mode 100644 (file)
index 0000000..8bf3039
--- /dev/null
@@ -0,0 +1,1057 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)s1_3.c       4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points, polygons, and normal vectors to render "s1_3" in 3D.
+ *
+ * Generated by lw2ogl.  Link this with your program but do
+ * not edit by hand.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_sproingies
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat s1_3_PNTS[] =
+{
+       (GLfloat) 0.386176, (GLfloat) 0.201223, (GLfloat) - 0.326853,
+       (GLfloat) 0.386176, (GLfloat) 0.201223, (GLfloat) - 0.673147,
+       (GLfloat) 0.704261, (GLfloat) 0.116939, (GLfloat) - 0.326853,
+       (GLfloat) 0.704261, (GLfloat) 0.116939, (GLfloat) - 0.673147,
+       (GLfloat) 0.642426, (GLfloat) 0.035438, (GLfloat) - 0.638667,
+       (GLfloat) 0.369306, (GLfloat) 0.083596, (GLfloat) - 0.638667,
+       (GLfloat) 0.369306, (GLfloat) 0.083596, (GLfloat) - 0.361333,
+       (GLfloat) 0.642426, (GLfloat) 0.035438, (GLfloat) - 0.361333,
+       (GLfloat) 0.845007, (GLfloat) 0.268518, (GLfloat) - 0.678159,
+       (GLfloat) 0.620074, (GLfloat) 0.472355, (GLfloat) - 0.678159,
+       (GLfloat) 0.620074, (GLfloat) 0.472355, (GLfloat) - 0.321841,
+       (GLfloat) 0.845007, (GLfloat) 0.268518, (GLfloat) - 0.321841,
+       (GLfloat) 1.115671, (GLfloat) 0.352342, (GLfloat) - 0.673147,
+       (GLfloat) 1.115671, (GLfloat) 0.352342, (GLfloat) - 0.326853,
+       (GLfloat) 1.204957, (GLfloat) 0.421449, (GLfloat) - 0.361333,
+       (GLfloat) 1.204957, (GLfloat) 0.421449, (GLfloat) - 0.638667,
+       (GLfloat) 0.937575, (GLfloat) 0.636550, (GLfloat) - 0.326853,
+       (GLfloat) 1.066291, (GLfloat) 0.661627, (GLfloat) - 0.361333,
+       (GLfloat) 0.937575, (GLfloat) 0.636550, (GLfloat) - 0.673147,
+       (GLfloat) 1.066291, (GLfloat) 0.661627, (GLfloat) - 0.638667,
+       (GLfloat) 1.227578, (GLfloat) 0.320768, (GLfloat) - 0.500000,
+       (GLfloat) 1.017091, (GLfloat) 0.274757, (GLfloat) - 0.500000,
+       (GLfloat) 1.148052, (GLfloat) 0.300668, (GLfloat) - 0.500000,
+       (GLfloat) 1.107591, (GLfloat) 0.526937, (GLfloat) - 0.260702,
+       (GLfloat) 1.194861, (GLfloat) 0.375780, (GLfloat) - 0.324904,
+       (GLfloat) 1.151611, (GLfloat) 0.550768, (GLfloat) - 0.500000,
+       (GLfloat) 1.230206, (GLfloat) 0.391113, (GLfloat) - 0.500000,
+       (GLfloat) 1.107591, (GLfloat) 0.526937, (GLfloat) - 0.739298,
+       (GLfloat) 1.194861, (GLfloat) 0.375780, (GLfloat) - 0.675096,
+       (GLfloat) 0.885754, (GLfloat) 0.445570, (GLfloat) - 0.261655,
+       (GLfloat) 1.026623, (GLfloat) 0.494446, (GLfloat) - 0.263891,
+       (GLfloat) 0.987605, (GLfloat) 0.733106, (GLfloat) - 0.500000,
+       (GLfloat) 1.019270, (GLfloat) 0.677486, (GLfloat) - 0.324904,
+       (GLfloat) 1.141425, (GLfloat) 0.544887, (GLfloat) - 0.322437,
+       (GLfloat) 0.754416, (GLfloat) 0.616383, (GLfloat) - 0.500000,
+       (GLfloat) 0.905194, (GLfloat) 0.688224, (GLfloat) - 0.500000,
+       (GLfloat) 1.019270, (GLfloat) 0.677486, (GLfloat) - 0.675096,
+       (GLfloat) 1.052644, (GLfloat) 0.698661, (GLfloat) - 0.500000,
+       (GLfloat) 0.885754, (GLfloat) 0.445570, (GLfloat) - 0.738345,
+       (GLfloat) 1.026623, (GLfloat) 0.494446, (GLfloat) - 0.736109,
+       (GLfloat) 1.141425, (GLfloat) 0.544887, (GLfloat) - 0.677562,
+       (GLfloat) 0.982068, (GLfloat) 0.320307, (GLfloat) - 0.674787,
+       (GLfloat) 0.801608, (GLfloat) 0.169177, (GLfloat) - 0.500000,
+       (GLfloat) 0.885904, (GLfloat) 0.231457, (GLfloat) - 0.500000,
+       (GLfloat) 0.982068, (GLfloat) 0.320307, (GLfloat) - 0.325213,
+       (GLfloat) 0.789439, (GLfloat) 0.570833, (GLfloat) - 0.674787,
+       (GLfloat) 0.617093, (GLfloat) 0.264045, (GLfloat) - 0.738345,
+       (GLfloat) 0.732540, (GLfloat) 0.370437, (GLfloat) - 0.742944,
+       (GLfloat) 0.617093, (GLfloat) 0.264045, (GLfloat) - 0.261655,
+       (GLfloat) 0.732540, (GLfloat) 0.370437, (GLfloat) - 0.257056,
+       (GLfloat) 0.789439, (GLfloat) 0.570833, (GLfloat) - 0.325213,
+       (GLfloat) 0.432577, (GLfloat) 0.358913, (GLfloat) - 0.500000,
+       (GLfloat) 0.579177, (GLfloat) 0.509417, (GLfloat) - 0.500000,
+       (GLfloat) 0.513237, (GLfloat) 0.088956, (GLfloat) - 0.739298,
+       (GLfloat) 0.545218, (GLfloat) 0.159081, (GLfloat) - 0.736109,
+       (GLfloat) 0.752404, (GLfloat) 0.194475, (GLfloat) - 0.674787,
+       (GLfloat) 0.481782, (GLfloat) 0.333615, (GLfloat) - 0.674787,
+       (GLfloat) 0.481782, (GLfloat) 0.333615, (GLfloat) - 0.325213,
+       (GLfloat) 0.279139, (GLfloat) 0.132156, (GLfloat) - 0.500000,
+       (GLfloat) 0.328343, (GLfloat) 0.216547, (GLfloat) - 0.500000,
+       (GLfloat) 0.752404, (GLfloat) 0.194475, (GLfloat) - 0.325213,
+       (GLfloat) 0.513237, (GLfloat) 0.088956, (GLfloat) - 0.260702,
+       (GLfloat) 0.545218, (GLfloat) 0.159081, (GLfloat) - 0.263891,
+       (GLfloat) 0.747335, (GLfloat) 0.045755, (GLfloat) - 0.500000,
+       (GLfloat) 0.762094, (GLfloat) 0.101615, (GLfloat) - 0.500000,
+       (GLfloat) 0.684631, (GLfloat) 0.057942, (GLfloat) - 0.675096,
+       (GLfloat) 0.502661, (GLfloat) 0.041337, (GLfloat) - 0.500000,
+       (GLfloat) 0.679568, (GLfloat) 0.022087, (GLfloat) - 0.500000,
+       (GLfloat) 0.684631, (GLfloat) 0.057942, (GLfloat) - 0.324904,
+       (GLfloat) 0.342054, (GLfloat) 0.121167, (GLfloat) - 0.675096,
+       (GLfloat) 0.504703, (GLfloat) 0.052920, (GLfloat) - 0.677562,
+       (GLfloat) 0.342054, (GLfloat) 0.121167, (GLfloat) - 0.324904,
+       (GLfloat) 0.329838, (GLfloat) 0.083754, (GLfloat) - 0.500000,
+       (GLfloat) 0.504703, (GLfloat) 0.052920, (GLfloat) - 0.322437,
+       (GLfloat) 1.188046, (GLfloat) 0.322006, (GLfloat) - 0.596277,
+       (GLfloat) 1.077742, (GLfloat) 0.301825, (GLfloat) - 0.594388,
+       (GLfloat) 1.139957, (GLfloat) 0.313586, (GLfloat) - 0.594444,
+       (GLfloat) 1.188046, (GLfloat) 0.322006, (GLfloat) - 0.403722,
+       (GLfloat) 1.196159, (GLfloat) 0.308395, (GLfloat) - 0.500000,
+       (GLfloat) 1.230706, (GLfloat) 0.358565, (GLfloat) - 0.587500,
+       (GLfloat) 1.219224, (GLfloat) 0.334520, (GLfloat) - 0.595444,
+       (GLfloat) 1.123141, (GLfloat) 0.430895, (GLfloat) - 0.724648,
+       (GLfloat) 1.163707, (GLfloat) 0.362839, (GLfloat) - 0.676509,
+       (GLfloat) 1.123141, (GLfloat) 0.430895, (GLfloat) - 0.275352,
+       (GLfloat) 1.163707, (GLfloat) 0.362839, (GLfloat) - 0.323491,
+       (GLfloat) 1.230706, (GLfloat) 0.358565, (GLfloat) - 0.412500,
+       (GLfloat) 1.219224, (GLfloat) 0.334520, (GLfloat) - 0.404556,
+       (GLfloat) 1.077742, (GLfloat) 0.301825, (GLfloat) - 0.405612,
+       (GLfloat) 1.139957, (GLfloat) 0.313586, (GLfloat) - 0.405556,
+       (GLfloat) 1.191900, (GLfloat) 0.469528, (GLfloat) - 0.409500,
+       (GLfloat) 1.221821, (GLfloat) 0.401211, (GLfloat) - 0.417500,
+       (GLfloat) 1.239508, (GLfloat) 0.345749, (GLfloat) - 0.500000,
+       (GLfloat) 1.171456, (GLfloat) 0.461189, (GLfloat) - 0.294000,
+       (GLfloat) 1.207091, (GLfloat) 0.397037, (GLfloat) - 0.339125,
+       (GLfloat) 1.171456, (GLfloat) 0.461189, (GLfloat) - 0.706000,
+       (GLfloat) 1.207091, (GLfloat) 0.397037, (GLfloat) - 0.660875,
+       (GLfloat) 1.191900, (GLfloat) 0.469528, (GLfloat) - 0.590500,
+       (GLfloat) 1.221821, (GLfloat) 0.401211, (GLfloat) - 0.582500,
+       (GLfloat) 1.011218, (GLfloat) 0.399402, (GLfloat) - 0.279763,
+       (GLfloat) 1.075195, (GLfloat) 0.416935, (GLfloat) - 0.279631,
+       (GLfloat) 1.025784, (GLfloat) 0.594229, (GLfloat) - 0.275352,
+       (GLfloat) 1.074463, (GLfloat) 0.512562, (GLfloat) - 0.259306,
+       (GLfloat) 1.155185, (GLfloat) 0.444556, (GLfloat) - 0.276838,
+       (GLfloat) 0.960879, (GLfloat) 0.703118, (GLfloat) - 0.403722,
+       (GLfloat) 0.985218, (GLfloat) 0.662285, (GLfloat) - 0.323491,
+       (GLfloat) 1.083956, (GLfloat) 0.612743, (GLfloat) - 0.294000,
+       (GLfloat) 1.059471, (GLfloat) 0.609015, (GLfloat) - 0.276838,
+       (GLfloat) 0.911431, (GLfloat) 0.545768, (GLfloat) - 0.279763,
+       (GLfloat) 0.978052, (GLfloat) 0.571957, (GLfloat) - 0.279631,
+       (GLfloat) 1.101400, (GLfloat) 0.626279, (GLfloat) - 0.409500,
+       (GLfloat) 1.098258, (GLfloat) 0.615227, (GLfloat) - 0.335375,
+       (GLfloat) 1.128758, (GLfloat) 0.537574, (GLfloat) - 0.278500,
+       (GLfloat) 1.024706, (GLfloat) 0.715367, (GLfloat) - 0.412500,
+       (GLfloat) 1.046216, (GLfloat) 0.675680, (GLfloat) - 0.339125,
+       (GLfloat) 1.180758, (GLfloat) 0.472333, (GLfloat) - 0.335375,
+       (GLfloat) 0.844907, (GLfloat) 0.643346, (GLfloat) - 0.405612,
+       (GLfloat) 0.913289, (GLfloat) 0.675305, (GLfloat) - 0.405556,
+       (GLfloat) 0.960879, (GLfloat) 0.703118, (GLfloat) - 0.596277,
+       (GLfloat) 0.952766, (GLfloat) 0.716730, (GLfloat) - 0.500000,
+       (GLfloat) 0.995432, (GLfloat) 0.719051, (GLfloat) - 0.404556,
+       (GLfloat) 1.025784, (GLfloat) 0.594229, (GLfloat) - 0.724648,
+       (GLfloat) 0.985218, (GLfloat) 0.662285, (GLfloat) - 0.676509,
+       (GLfloat) 1.024706, (GLfloat) 0.715367, (GLfloat) - 0.587500,
+       (GLfloat) 0.995432, (GLfloat) 0.719051, (GLfloat) - 0.595444,
+       (GLfloat) 0.844907, (GLfloat) 0.643346, (GLfloat) - 0.594388,
+       (GLfloat) 0.913289, (GLfloat) 0.675305, (GLfloat) - 0.594444,
+       (GLfloat) 1.101400, (GLfloat) 0.626279, (GLfloat) - 0.590500,
+       (GLfloat) 1.057196, (GLfloat) 0.686350, (GLfloat) - 0.582500,
+       (GLfloat) 1.018008, (GLfloat) 0.729398, (GLfloat) - 0.500000,
+       (GLfloat) 1.083956, (GLfloat) 0.612743, (GLfloat) - 0.706000,
+       (GLfloat) 1.046216, (GLfloat) 0.675680, (GLfloat) - 0.660875,
+       (GLfloat) 1.057196, (GLfloat) 0.686350, (GLfloat) - 0.417500,
+       (GLfloat) 0.911431, (GLfloat) 0.545768, (GLfloat) - 0.720237,
+       (GLfloat) 0.978052, (GLfloat) 0.571957, (GLfloat) - 0.720369,
+       (GLfloat) 1.074463, (GLfloat) 0.512562, (GLfloat) - 0.740694,
+       (GLfloat) 1.059471, (GLfloat) 0.609015, (GLfloat) - 0.723162,
+       (GLfloat) 1.155185, (GLfloat) 0.444556, (GLfloat) - 0.723162,
+       (GLfloat) 1.011218, (GLfloat) 0.399402, (GLfloat) - 0.720237,
+       (GLfloat) 1.075195, (GLfloat) 0.416935, (GLfloat) - 0.720369,
+       (GLfloat) 1.180758, (GLfloat) 0.472333, (GLfloat) - 0.664625,
+       (GLfloat) 1.128758, (GLfloat) 0.537574, (GLfloat) - 0.721500,
+       (GLfloat) 1.098258, (GLfloat) 0.615227, (GLfloat) - 0.664625,
+       (GLfloat) 1.149055, (GLfloat) 0.549292, (GLfloat) - 0.402250,
+       (GLfloat) 1.197930, (GLfloat) 0.464638, (GLfloat) - 0.500000,
+       (GLfloat) 1.100180, (GLfloat) 0.633946, (GLfloat) - 0.500000,
+       (GLfloat) 1.149055, (GLfloat) 0.549292, (GLfloat) - 0.597750,
+       (GLfloat) 1.052796, (GLfloat) 0.338416, (GLfloat) - 0.673044,
+       (GLfloat) 0.938670, (GLfloat) 0.265970, (GLfloat) - 0.596525,
+       (GLfloat) 1.008335, (GLfloat) 0.286145, (GLfloat) - 0.595338,
+       (GLfloat) 1.086058, (GLfloat) 0.289628, (GLfloat) - 0.500000,
+       (GLfloat) 0.826297, (GLfloat) 0.209826, (GLfloat) - 0.596525,
+       (GLfloat) 0.875679, (GLfloat) 0.240722, (GLfloat) - 0.597178,
+       (GLfloat) 0.938670, (GLfloat) 0.265970, (GLfloat) - 0.403475,
+       (GLfloat) 0.948068, (GLfloat) 0.255539, (GLfloat) - 0.500000,
+       (GLfloat) 0.863485, (GLfloat) 0.349410, (GLfloat) - 0.725225,
+       (GLfloat) 0.910476, (GLfloat) 0.297260, (GLfloat) - 0.676962,
+       (GLfloat) 0.863485, (GLfloat) 0.349410, (GLfloat) - 0.274775,
+       (GLfloat) 0.910476, (GLfloat) 0.297260, (GLfloat) - 0.323037,
+       (GLfloat) 1.008335, (GLfloat) 0.286145, (GLfloat) - 0.404662,
+       (GLfloat) 0.826297, (GLfloat) 0.209826, (GLfloat) - 0.403475,
+       (GLfloat) 0.875679, (GLfloat) 0.240722, (GLfloat) - 0.402822,
+       (GLfloat) 1.052796, (GLfloat) 0.338416, (GLfloat) - 0.326956,
+       (GLfloat) 0.869854, (GLfloat) 0.606754, (GLfloat) - 0.673044,
+       (GLfloat) 0.750708, (GLfloat) 0.474572, (GLfloat) - 0.725225,
+       (GLfloat) 0.833218, (GLfloat) 0.513896, (GLfloat) - 0.722456,
+       (GLfloat) 0.961325, (GLfloat) 0.472585, (GLfloat) - 0.735969,
+       (GLfloat) 0.601974, (GLfloat) 0.366500, (GLfloat) - 0.725225,
+       (GLfloat) 0.671195, (GLfloat) 0.426029, (GLfloat) - 0.726748,
+       (GLfloat) 0.807096, (GLfloat) 0.411991, (GLfloat) - 0.741313,
+       (GLfloat) 0.675523, (GLfloat) 0.558012, (GLfloat) - 0.596525,
+       (GLfloat) 0.703717, (GLfloat) 0.526722, (GLfloat) - 0.676962,
+       (GLfloat) 0.938289, (GLfloat) 0.377245, (GLfloat) - 0.722456,
+       (GLfloat) 0.736568, (GLfloat) 0.272496, (GLfloat) - 0.725225,
+       (GLfloat) 0.793886, (GLfloat) 0.314845, (GLfloat) - 0.726748,
+       (GLfloat) 0.961325, (GLfloat) 0.472585, (GLfloat) - 0.264031,
+       (GLfloat) 0.750708, (GLfloat) 0.474572, (GLfloat) - 0.274775,
+       (GLfloat) 0.833218, (GLfloat) 0.513896, (GLfloat) - 0.277544,
+       (GLfloat) 0.869854, (GLfloat) 0.606754, (GLfloat) - 0.326956,
+       (GLfloat) 0.938289, (GLfloat) 0.377245, (GLfloat) - 0.277544,
+       (GLfloat) 0.736568, (GLfloat) 0.272496, (GLfloat) - 0.274775,
+       (GLfloat) 0.793886, (GLfloat) 0.314845, (GLfloat) - 0.273252,
+       (GLfloat) 0.807096, (GLfloat) 0.411991, (GLfloat) - 0.258687,
+       (GLfloat) 0.675523, (GLfloat) 0.558012, (GLfloat) - 0.403475,
+       (GLfloat) 0.703717, (GLfloat) 0.526722, (GLfloat) - 0.323037,
+       (GLfloat) 0.601974, (GLfloat) 0.366500, (GLfloat) - 0.274775,
+       (GLfloat) 0.671195, (GLfloat) 0.426029, (GLfloat) - 0.273252,
+       (GLfloat) 0.836591, (GLfloat) 0.655543, (GLfloat) - 0.500000,
+       (GLfloat) 0.763171, (GLfloat) 0.604996, (GLfloat) - 0.595338,
+       (GLfloat) 0.763171, (GLfloat) 0.604996, (GLfloat) - 0.404662,
+       (GLfloat) 0.512245, (GLfloat) 0.429169, (GLfloat) - 0.403475,
+       (GLfloat) 0.589401, (GLfloat) 0.500151, (GLfloat) - 0.402822,
+       (GLfloat) 0.666125, (GLfloat) 0.568442, (GLfloat) - 0.500000,
+       (GLfloat) 0.512245, (GLfloat) 0.429169, (GLfloat) - 0.596525,
+       (GLfloat) 0.589401, (GLfloat) 0.500151, (GLfloat) - 0.597178,
+       (GLfloat) 0.495371, (GLfloat) 0.238512, (GLfloat) - 0.720237,
+       (GLfloat) 0.432817, (GLfloat) 0.138665, (GLfloat) - 0.724648,
+       (GLfloat) 0.458468, (GLfloat) 0.182068, (GLfloat) - 0.720369,
+       (GLfloat) 0.656244, (GLfloat) 0.179386, (GLfloat) - 0.720237,
+       (GLfloat) 0.575807, (GLfloat) 0.208949, (GLfloat) - 0.735969,
+       (GLfloat) 0.543287, (GLfloat) 0.301992, (GLfloat) - 0.722456,
+       (GLfloat) 0.388123, (GLfloat) 0.277930, (GLfloat) - 0.594388,
+       (GLfloat) 0.428341, (GLfloat) 0.263148, (GLfloat) - 0.673044,
+       (GLfloat) 0.763492, (GLfloat) 0.139968, (GLfloat) - 0.594388,
+       (GLfloat) 0.723274, (GLfloat) 0.154750, (GLfloat) - 0.673044,
+       (GLfloat) 0.690899, (GLfloat) 0.226098, (GLfloat) - 0.722456,
+       (GLfloat) 0.617440, (GLfloat) 0.099959, (GLfloat) - 0.724648,
+       (GLfloat) 0.631969, (GLfloat) 0.136095, (GLfloat) - 0.720369,
+       (GLfloat) 0.669271, (GLfloat) 0.319498, (GLfloat) - 0.741313,
+       (GLfloat) 0.792649, (GLfloat) 0.233327, (GLfloat) - 0.676962,
+       (GLfloat) 0.545894, (GLfloat) 0.405668, (GLfloat) - 0.676962,
+       (GLfloat) 0.444878, (GLfloat) 0.352588, (GLfloat) - 0.595338,
+       (GLfloat) 0.388123, (GLfloat) 0.277930, (GLfloat) - 0.405612,
+       (GLfloat) 0.374717, (GLfloat) 0.282857, (GLfloat) - 0.500000,
+       (GLfloat) 0.309735, (GLfloat) 0.164469, (GLfloat) - 0.596277,
+       (GLfloat) 0.342801, (GLfloat) 0.212716, (GLfloat) - 0.594444,
+       (GLfloat) 0.501029, (GLfloat) 0.437003, (GLfloat) - 0.500000,
+       (GLfloat) 0.545894, (GLfloat) 0.405668, (GLfloat) - 0.323037,
+       (GLfloat) 0.444878, (GLfloat) 0.352588, (GLfloat) - 0.404662,
+       (GLfloat) 0.309735, (GLfloat) 0.164469, (GLfloat) - 0.403722,
+       (GLfloat) 0.342801, (GLfloat) 0.212716, (GLfloat) - 0.405556,
+       (GLfloat) 0.495371, (GLfloat) 0.238512, (GLfloat) - 0.279763,
+       (GLfloat) 0.428341, (GLfloat) 0.263148, (GLfloat) - 0.326956,
+       (GLfloat) 0.543287, (GLfloat) 0.301992, (GLfloat) - 0.277544,
+       (GLfloat) 0.656244, (GLfloat) 0.179386, (GLfloat) - 0.279763,
+       (GLfloat) 0.575807, (GLfloat) 0.208949, (GLfloat) - 0.264031,
+       (GLfloat) 0.432817, (GLfloat) 0.138665, (GLfloat) - 0.275352,
+       (GLfloat) 0.458468, (GLfloat) 0.182068, (GLfloat) - 0.279631,
+       (GLfloat) 0.669271, (GLfloat) 0.319498, (GLfloat) - 0.258687,
+       (GLfloat) 0.792649, (GLfloat) 0.233327, (GLfloat) - 0.323037,
+       (GLfloat) 0.690899, (GLfloat) 0.226098, (GLfloat) - 0.277544,
+       (GLfloat) 0.617440, (GLfloat) 0.099959, (GLfloat) - 0.275352,
+       (GLfloat) 0.631969, (GLfloat) 0.136095, (GLfloat) - 0.279631,
+       (GLfloat) 0.763492, (GLfloat) 0.139968, (GLfloat) - 0.405612,
+       (GLfloat) 0.723274, (GLfloat) 0.154750, (GLfloat) - 0.326956,
+       (GLfloat) 0.789307, (GLfloat) 0.175501, (GLfloat) - 0.404662,
+       (GLfloat) 0.776898, (GLfloat) 0.135041, (GLfloat) - 0.500000,
+       (GLfloat) 0.740522, (GLfloat) 0.074155, (GLfloat) - 0.403722,
+       (GLfloat) 0.747636, (GLfloat) 0.105446, (GLfloat) - 0.405556,
+       (GLfloat) 0.837513, (GLfloat) 0.201992, (GLfloat) - 0.500000,
+       (GLfloat) 0.789307, (GLfloat) 0.175501, (GLfloat) - 0.595338,
+       (GLfloat) 0.740522, (GLfloat) 0.074155, (GLfloat) - 0.596277,
+       (GLfloat) 0.747636, (GLfloat) 0.105446, (GLfloat) - 0.594444,
+       (GLfloat) 0.755907, (GLfloat) 0.070930, (GLfloat) - 0.500000,
+       (GLfloat) 0.710325, (GLfloat) 0.032750, (GLfloat) - 0.412500,
+       (GLfloat) 0.731601, (GLfloat) 0.048967, (GLfloat) - 0.404556,
+       (GLfloat) 0.694366, (GLfloat) 0.083832, (GLfloat) - 0.323491,
+       (GLfloat) 0.694366, (GLfloat) 0.083832, (GLfloat) - 0.676509,
+       (GLfloat) 0.710325, (GLfloat) 0.032750, (GLfloat) - 0.587500,
+       (GLfloat) 0.731601, (GLfloat) 0.048967, (GLfloat) - 0.595444,
+       (GLfloat) 0.592781, (GLfloat) 0.031264, (GLfloat) - 0.590500,
+       (GLfloat) 0.667212, (GLfloat) 0.026513, (GLfloat) - 0.582500,
+       (GLfloat) 0.725378, (GLfloat) 0.028862, (GLfloat) - 0.500000,
+       (GLfloat) 0.593625, (GLfloat) 0.053327, (GLfloat) - 0.706000,
+       (GLfloat) 0.666096, (GLfloat) 0.041783, (GLfloat) - 0.660875,
+       (GLfloat) 0.593625, (GLfloat) 0.053327, (GLfloat) - 0.294000,
+       (GLfloat) 0.666096, (GLfloat) 0.041783, (GLfloat) - 0.339125,
+       (GLfloat) 0.592781, (GLfloat) 0.031264, (GLfloat) - 0.409500,
+       (GLfloat) 0.667212, (GLfloat) 0.026513, (GLfloat) - 0.417500,
+       (GLfloat) 0.525128, (GLfloat) 0.119312, (GLfloat) - 0.740694,
+       (GLfloat) 0.606658, (GLfloat) 0.072023, (GLfloat) - 0.723162,
+       (GLfloat) 0.355891, (GLfloat) 0.154793, (GLfloat) - 0.676509,
+       (GLfloat) 0.421284, (GLfloat) 0.083716, (GLfloat) - 0.706000,
+       (GLfloat) 0.419921, (GLfloat) 0.106487, (GLfloat) - 0.723162,
+       (GLfloat) 0.414531, (GLfloat) 0.062694, (GLfloat) - 0.590500,
+       (GLfloat) 0.423841, (GLfloat) 0.069426, (GLfloat) - 0.664625,
+       (GLfloat) 0.507243, (GLfloat) 0.067325, (GLfloat) - 0.721500,
+       (GLfloat) 0.304584, (GLfloat) 0.104293, (GLfloat) - 0.587500,
+       (GLfloat) 0.349234, (GLfloat) 0.097654, (GLfloat) - 0.660875,
+       (GLfloat) 0.586334, (GLfloat) 0.040774, (GLfloat) - 0.664625,
+       (GLfloat) 0.294350, (GLfloat) 0.167695, (GLfloat) - 0.500000,
+       (GLfloat) 0.294978, (GLfloat) 0.129544, (GLfloat) - 0.595444,
+       (GLfloat) 0.355891, (GLfloat) 0.154793, (GLfloat) - 0.323491,
+       (GLfloat) 0.304584, (GLfloat) 0.104293, (GLfloat) - 0.412500,
+       (GLfloat) 0.294978, (GLfloat) 0.129544, (GLfloat) - 0.404556,
+       (GLfloat) 0.414531, (GLfloat) 0.062694, (GLfloat) - 0.409500,
+       (GLfloat) 0.342964, (GLfloat) 0.083687, (GLfloat) - 0.417500,
+       (GLfloat) 0.289108, (GLfloat) 0.105788, (GLfloat) - 0.500000,
+       (GLfloat) 0.421284, (GLfloat) 0.083716, (GLfloat) - 0.294000,
+       (GLfloat) 0.349234, (GLfloat) 0.097654, (GLfloat) - 0.339125,
+       (GLfloat) 0.342964, (GLfloat) 0.083687, (GLfloat) - 0.582500,
+       (GLfloat) 0.525128, (GLfloat) 0.119312, (GLfloat) - 0.259306,
+       (GLfloat) 0.419921, (GLfloat) 0.106487, (GLfloat) - 0.276838,
+       (GLfloat) 0.606658, (GLfloat) 0.072023, (GLfloat) - 0.276838,
+       (GLfloat) 0.586334, (GLfloat) 0.040774, (GLfloat) - 0.335375,
+       (GLfloat) 0.507243, (GLfloat) 0.067325, (GLfloat) - 0.278500,
+       (GLfloat) 0.423841, (GLfloat) 0.069426, (GLfloat) - 0.335375,
+       (GLfloat) 0.503173, (GLfloat) 0.044243, (GLfloat) - 0.597750,
+       (GLfloat) 0.599438, (GLfloat) 0.027269, (GLfloat) - 0.500000,
+       (GLfloat) 0.406908, (GLfloat) 0.061217, (GLfloat) - 0.500000,
+       (GLfloat) 0.503173, (GLfloat) 0.044243, (GLfloat) - 0.402250,
+};
+
+static GLfloat s1_3_normals[] =
+{
+       (GLfloat) 0.156072, (GLfloat) - 0.866199, (GLfloat) - 0.474700,
+       (GLfloat) 0.133323, (GLfloat) - 0.866325, (GLfloat) - 0.481359,
+       (GLfloat) 0.156764, (GLfloat) - 0.975995, (GLfloat) - 0.151191,
+       (GLfloat) 0.165110, (GLfloat) - 0.975177, (GLfloat) - 0.147543,
+       (GLfloat) 0.361485, (GLfloat) - 0.917862, (GLfloat) - 0.163883,
+       (GLfloat) 0.371348, (GLfloat) - 0.914502, (GLfloat) - 0.160580,
+       (GLfloat) 0.350149, (GLfloat) - 0.787582, (GLfloat) - 0.507060,
+       (GLfloat) 0.331724, (GLfloat) - 0.792390, (GLfloat) - 0.511934,
+       (GLfloat) 0.156072, (GLfloat) - 0.866199, (GLfloat) 0.474700,
+       (GLfloat) 0.133323, (GLfloat) - 0.866325, (GLfloat) 0.481359,
+       (GLfloat) 0.331724, (GLfloat) - 0.792390, (GLfloat) 0.511934,
+       (GLfloat) 0.350149, (GLfloat) - 0.787582, (GLfloat) 0.507061,
+       (GLfloat) 0.361485, (GLfloat) - 0.917862, (GLfloat) 0.163883,
+       (GLfloat) 0.371348, (GLfloat) - 0.914502, (GLfloat) 0.160580,
+       (GLfloat) 0.165110, (GLfloat) - 0.975177, (GLfloat) 0.147543,
+       (GLfloat) 0.156764, (GLfloat) - 0.975995, (GLfloat) 0.151191,
+       (GLfloat) 0.952910, (GLfloat) 0.222669, (GLfloat) 0.205865,
+       (GLfloat) 0.952953, (GLfloat) 0.245285, (GLfloat) 0.178091,
+       (GLfloat) 0.977287, (GLfloat) 0.200386, (GLfloat) 0.068964,
+       (GLfloat) 0.974607, (GLfloat) 0.211631, (GLfloat) 0.073163,
+       (GLfloat) 0.910741, (GLfloat) - 0.389976, (GLfloat) 0.135901,
+       (GLfloat) 0.891878, (GLfloat) - 0.425931, (GLfloat) 0.152106,
+       (GLfloat) 0.882467, (GLfloat) - 0.235214, (GLfloat) 0.407340,
+       (GLfloat) 0.868268, (GLfloat) - 0.279083, (GLfloat) 0.410151,
+       (GLfloat) 0.952953, (GLfloat) 0.245285, (GLfloat) - 0.178091,
+       (GLfloat) 0.952910, (GLfloat) 0.222669, (GLfloat) - 0.205865,
+       (GLfloat) 0.868268, (GLfloat) - 0.279083, (GLfloat) - 0.410151,
+       (GLfloat) 0.882468, (GLfloat) - 0.235213, (GLfloat) - 0.407340,
+       (GLfloat) 0.891878, (GLfloat) - 0.425931, (GLfloat) - 0.152106,
+       (GLfloat) 0.910741, (GLfloat) - 0.389976, (GLfloat) - 0.135901,
+       (GLfloat) 0.974607, (GLfloat) 0.211631, (GLfloat) - 0.073163,
+       (GLfloat) 0.977287, (GLfloat) 0.200386, (GLfloat) - 0.068964,
+       (GLfloat) 0.086707, (GLfloat) - 0.551974, (GLfloat) 0.829341,
+       (GLfloat) 0.062265, (GLfloat) - 0.551355, (GLfloat) 0.831944,
+       (GLfloat) - 0.014960, (GLfloat) - 0.207986, (GLfloat) 0.978017,
+       (GLfloat) - 0.026687, (GLfloat) - 0.208021, (GLfloat) 0.977760,
+       (GLfloat) 0.102710, (GLfloat) - 0.133733, (GLfloat) 0.985681,
+       (GLfloat) 0.099775, (GLfloat) - 0.134244, (GLfloat) 0.985913,
+       (GLfloat) 0.231521, (GLfloat) - 0.464011, (GLfloat) 0.855039,
+       (GLfloat) 0.236951, (GLfloat) - 0.462930, (GLfloat) 0.854137,
+       (GLfloat) - 0.295570, (GLfloat) 0.436154, (GLfloat) 0.849946,
+       (GLfloat) - 0.280583, (GLfloat) 0.437172, (GLfloat) 0.854490,
+       (GLfloat) - 0.178752, (GLfloat) 0.492834, (GLfloat) 0.851565,
+       (GLfloat) - 0.184330, (GLfloat) 0.491982, (GLfloat) 0.850868,
+       (GLfloat) - 0.033888, (GLfloat) 0.173633, (GLfloat) 0.984227,
+       (GLfloat) - 0.032872, (GLfloat) 0.173792, (GLfloat) 0.984234,
+       (GLfloat) - 0.140362, (GLfloat) 0.111822, (GLfloat) 0.983765,
+       (GLfloat) - 0.136701, (GLfloat) 0.111911, (GLfloat) 0.984271,
+       (GLfloat) 0.725871, (GLfloat) 0.640449, (GLfloat) 0.250870,
+       (GLfloat) 0.717328, (GLfloat) 0.635281, (GLfloat) 0.286109,
+       (GLfloat) 0.785252, (GLfloat) 0.532999, (GLfloat) 0.315105,
+       (GLfloat) 0.786013, (GLfloat) 0.538285, (GLfloat) 0.304028,
+       (GLfloat) 0.473766, (GLfloat) 0.428968, (GLfloat) 0.769111,
+       (GLfloat) 0.445991, (GLfloat) 0.427917, (GLfloat) 0.786117,
+       (GLfloat) 0.380921, (GLfloat) 0.670539, (GLfloat) 0.636613,
+       (GLfloat) 0.351469, (GLfloat) 0.675507, (GLfloat) 0.648198,
+       (GLfloat) 0.909972, (GLfloat) 0.319731, (GLfloat) 0.264053,
+       (GLfloat) 0.914034, (GLfloat) 0.290005, (GLfloat) 0.283618,
+       (GLfloat) 0.764793, (GLfloat) - 0.009035, (GLfloat) 0.644213,
+       (GLfloat) 0.748359, (GLfloat) - 0.049564, (GLfloat) 0.661439,
+       (GLfloat) 0.584615, (GLfloat) 0.165625, (GLfloat) 0.794225,
+       (GLfloat) 0.606922, (GLfloat) 0.199970, (GLfloat) 0.769193,
+       (GLfloat) 0.856780, (GLfloat) 0.408314, (GLfloat) 0.314973,
+       (GLfloat) 0.856353, (GLfloat) 0.416833, (GLfloat) 0.304811,
+       (GLfloat) - 0.450621, (GLfloat) 0.737913, (GLfloat) 0.502419,
+       (GLfloat) - 0.436449, (GLfloat) 0.741403, (GLfloat) 0.509739,
+       (GLfloat) - 0.507433, (GLfloat) 0.846833, (GLfloat) 0.159329,
+       (GLfloat) - 0.502539, (GLfloat) 0.849165, (GLfloat) 0.162398,
+       (GLfloat) - 0.409636, (GLfloat) 0.897074, (GLfloat) 0.165699,
+       (GLfloat) - 0.419809, (GLfloat) 0.893103, (GLfloat) 0.161638,
+       (GLfloat) - 0.332199, (GLfloat) 0.791771, (GLfloat) 0.512584,
+       (GLfloat) - 0.350779, (GLfloat) 0.787278, (GLfloat) 0.507097,
+       (GLfloat) - 0.436449, (GLfloat) 0.741403, (GLfloat) - 0.509738,
+       (GLfloat) - 0.450621, (GLfloat) 0.737913, (GLfloat) - 0.502419,
+       (GLfloat) - 0.332198, (GLfloat) 0.791771, (GLfloat) - 0.512584,
+       (GLfloat) - 0.350779, (GLfloat) 0.787278, (GLfloat) - 0.507097,
+       (GLfloat) - 0.419809, (GLfloat) 0.893103, (GLfloat) - 0.161638,
+       (GLfloat) - 0.409636, (GLfloat) 0.897074, (GLfloat) - 0.165699,
+       (GLfloat) - 0.507433, (GLfloat) 0.846833, (GLfloat) - 0.159329,
+       (GLfloat) - 0.502539, (GLfloat) 0.849165, (GLfloat) - 0.162398,
+       (GLfloat) 0.669290, (GLfloat) 0.713912, (GLfloat) - 0.205866,
+       (GLfloat) 0.688897, (GLfloat) 0.702641, (GLfloat) - 0.178093,
+       (GLfloat) 0.661903, (GLfloat) 0.745850, (GLfloat) - 0.074780,
+       (GLfloat) 0.670351, (GLfloat) 0.738996, (GLfloat) - 0.067190,
+       (GLfloat) 0.158706, (GLfloat) 0.978584, (GLfloat) - 0.131091,
+       (GLfloat) 0.119709, (GLfloat) 0.981678, (GLfloat) - 0.148253,
+       (GLfloat) 0.261869, (GLfloat) 0.885538, (GLfloat) - 0.383728,
+       (GLfloat) 0.223051, (GLfloat) 0.883291, (GLfloat) - 0.412366,
+       (GLfloat) 0.688897, (GLfloat) 0.702640, (GLfloat) 0.178092,
+       (GLfloat) 0.669290, (GLfloat) 0.713912, (GLfloat) 0.205867,
+       (GLfloat) 0.261868, (GLfloat) 0.885538, (GLfloat) 0.383728,
+       (GLfloat) 0.223050, (GLfloat) 0.883291, (GLfloat) 0.412366,
+       (GLfloat) 0.119709, (GLfloat) 0.981678, (GLfloat) 0.148253,
+       (GLfloat) 0.158706, (GLfloat) 0.978584, (GLfloat) 0.131091,
+       (GLfloat) 0.661903, (GLfloat) 0.745850, (GLfloat) 0.074780,
+       (GLfloat) 0.670351, (GLfloat) 0.738996, (GLfloat) 0.067190,
+       (GLfloat) - 0.295570, (GLfloat) 0.436154, (GLfloat) - 0.849946,
+       (GLfloat) - 0.280583, (GLfloat) 0.437172, (GLfloat) - 0.854490,
+       (GLfloat) - 0.136701, (GLfloat) 0.111911, (GLfloat) - 0.984271,
+       (GLfloat) - 0.140362, (GLfloat) 0.111822, (GLfloat) - 0.983765,
+       (GLfloat) - 0.033889, (GLfloat) 0.173633, (GLfloat) - 0.984227,
+       (GLfloat) - 0.032872, (GLfloat) 0.173792, (GLfloat) - 0.984234,
+       (GLfloat) - 0.184329, (GLfloat) 0.491983, (GLfloat) - 0.850868,
+       (GLfloat) - 0.178752, (GLfloat) 0.492834, (GLfloat) - 0.851565,
+       (GLfloat) 0.062265, (GLfloat) - 0.551355, (GLfloat) - 0.831944,
+       (GLfloat) 0.086707, (GLfloat) - 0.551973, (GLfloat) - 0.829342,
+       (GLfloat) 0.231522, (GLfloat) - 0.464010, (GLfloat) - 0.855039,
+       (GLfloat) 0.236951, (GLfloat) - 0.462929, (GLfloat) - 0.854137,
+       (GLfloat) 0.099774, (GLfloat) - 0.134244, (GLfloat) - 0.985913,
+       (GLfloat) 0.102710, (GLfloat) - 0.133733, (GLfloat) - 0.985681,
+       (GLfloat) - 0.014960, (GLfloat) - 0.207986, (GLfloat) - 0.978017,
+       (GLfloat) - 0.026687, (GLfloat) - 0.208021, (GLfloat) - 0.977760,
+       (GLfloat) 0.914034, (GLfloat) 0.290005, (GLfloat) - 0.283618,
+       (GLfloat) 0.909972, (GLfloat) 0.319730, (GLfloat) - 0.264054,
+       (GLfloat) 0.856780, (GLfloat) 0.408314, (GLfloat) - 0.314973,
+       (GLfloat) 0.856353, (GLfloat) 0.416833, (GLfloat) - 0.304811,
+       (GLfloat) 0.606923, (GLfloat) 0.199970, (GLfloat) - 0.769193,
+       (GLfloat) 0.584616, (GLfloat) 0.165625, (GLfloat) - 0.794224,
+       (GLfloat) 0.764793, (GLfloat) - 0.009035, (GLfloat) - 0.644213,
+       (GLfloat) 0.748360, (GLfloat) - 0.049564, (GLfloat) - 0.661439,
+       (GLfloat) 0.725871, (GLfloat) 0.640449, (GLfloat) - 0.250871,
+       (GLfloat) 0.717328, (GLfloat) 0.635281, (GLfloat) - 0.286109,
+       (GLfloat) 0.380922, (GLfloat) 0.670539, (GLfloat) - 0.636613,
+       (GLfloat) 0.351469, (GLfloat) 0.675507, (GLfloat) - 0.648197,
+       (GLfloat) 0.445992, (GLfloat) 0.427917, (GLfloat) - 0.786116,
+       (GLfloat) 0.473767, (GLfloat) 0.428968, (GLfloat) - 0.769111,
+       (GLfloat) 0.786013, (GLfloat) 0.538285, (GLfloat) - 0.304029,
+       (GLfloat) 0.785252, (GLfloat) 0.532999, (GLfloat) - 0.315105,
+       (GLfloat) 0.919156, (GLfloat) 0.373864, (GLfloat) 0.124010,
+       (GLfloat) 0.913260, (GLfloat) 0.384076, (GLfloat) 0.135802,
+       (GLfloat) 0.881886, (GLfloat) 0.458542, (GLfloat) 0.109621,
+       (GLfloat) 0.879452, (GLfloat) 0.461960, (GLfloat) 0.114709,
+       (GLfloat) 0.880239, (GLfloat) 0.473377, (GLfloat) 0.033080,
+       (GLfloat) 0.881697, (GLfloat) 0.470851, (GLfloat) 0.030163,
+       (GLfloat) 0.914779, (GLfloat) 0.401569, (GLfloat) 0.043834,
+       (GLfloat) 0.916978, (GLfloat) 0.396963, (GLfloat) 0.039657,
+       (GLfloat) 0.789250, (GLfloat) 0.598868, (GLfloat) 0.135802,
+       (GLfloat) 0.783354, (GLfloat) 0.609080, (GLfloat) 0.124010,
+       (GLfloat) 0.805159, (GLfloat) 0.591437, (GLfloat) 0.043834,
+       (GLfloat) 0.802269, (GLfloat) 0.595644, (GLfloat) 0.039656,
+       (GLfloat) 0.848617, (GLfloat) 0.528147, (GLfloat) 0.030163,
+       (GLfloat) 0.850075, (GLfloat) 0.525621, (GLfloat) 0.033079,
+       (GLfloat) 0.838052, (GLfloat) 0.534464, (GLfloat) 0.109621,
+       (GLfloat) 0.839795, (GLfloat) 0.530647, (GLfloat) 0.114709,
+       (GLfloat) 0.783354, (GLfloat) 0.609080, (GLfloat) - 0.124010,
+       (GLfloat) 0.789250, (GLfloat) 0.598868, (GLfloat) - 0.135802,
+       (GLfloat) 0.838052, (GLfloat) 0.534464, (GLfloat) - 0.109621,
+       (GLfloat) 0.839795, (GLfloat) 0.530647, (GLfloat) - 0.114709,
+       (GLfloat) 0.850075, (GLfloat) 0.525621, (GLfloat) - 0.033079,
+       (GLfloat) 0.848617, (GLfloat) 0.528147, (GLfloat) - 0.030163,
+       (GLfloat) 0.805159, (GLfloat) 0.591437, (GLfloat) - 0.043834,
+       (GLfloat) 0.802269, (GLfloat) 0.595644, (GLfloat) - 0.039656,
+       (GLfloat) 0.913260, (GLfloat) 0.384076, (GLfloat) - 0.135802,
+       (GLfloat) 0.919156, (GLfloat) 0.373864, (GLfloat) - 0.124010,
+       (GLfloat) 0.914779, (GLfloat) 0.401569, (GLfloat) - 0.043834,
+       (GLfloat) 0.916978, (GLfloat) 0.396963, (GLfloat) - 0.039657,
+       (GLfloat) 0.881697, (GLfloat) 0.470851, (GLfloat) - 0.030163,
+       (GLfloat) 0.880239, (GLfloat) 0.473377, (GLfloat) - 0.033080,
+       (GLfloat) 0.881886, (GLfloat) 0.458542, (GLfloat) - 0.109621,
+       (GLfloat) 0.879452, (GLfloat) 0.461960, (GLfloat) - 0.114709,
+       (GLfloat) 0.190919, (GLfloat) - 0.865460, (GLfloat) - 0.463172,
+       (GLfloat) 0.162958, (GLfloat) - 0.864281, (GLfloat) - 0.475881,
+       (GLfloat) 0.232098, (GLfloat) - 0.863386, (GLfloat) - 0.447991,
+       (GLfloat) 0.201152, (GLfloat) - 0.862208, (GLfloat) - 0.464904,
+       (GLfloat) 0.208595, (GLfloat) - 0.967433, (GLfloat) - 0.143393,
+       (GLfloat) 0.220092, (GLfloat) - 0.966009, (GLfloat) - 0.135597,
+       (GLfloat) 0.173391, (GLfloat) - 0.973662, (GLfloat) - 0.148045,
+       (GLfloat) 0.183752, (GLfloat) - 0.972679, (GLfloat) - 0.141883,
+       (GLfloat) 0.370543, (GLfloat) - 0.826392, (GLfloat) - 0.423998,
+       (GLfloat) 0.337718, (GLfloat) - 0.831172, (GLfloat) - 0.441702,
+       (GLfloat) 0.357949, (GLfloat) - 0.923976, (GLfloat) - 0.134692,
+       (GLfloat) 0.370172, (GLfloat) - 0.920284, (GLfloat) - 0.126690,
+       (GLfloat) 0.265644, (GLfloat) - 0.954091, (GLfloat) - 0.138357,
+       (GLfloat) 0.277857, (GLfloat) - 0.951799, (GLfloat) - 0.129901,
+       (GLfloat) 0.288098, (GLfloat) - 0.854015, (GLfloat) - 0.433195,
+       (GLfloat) 0.255240, (GLfloat) - 0.854757, (GLfloat) - 0.451932,
+       (GLfloat) 0.370543, (GLfloat) - 0.826392, (GLfloat) 0.423998,
+       (GLfloat) 0.337718, (GLfloat) - 0.831172, (GLfloat) 0.441701,
+       (GLfloat) 0.255240, (GLfloat) - 0.854757, (GLfloat) 0.451932,
+       (GLfloat) 0.288099, (GLfloat) - 0.854015, (GLfloat) 0.433195,
+       (GLfloat) 0.265644, (GLfloat) - 0.954091, (GLfloat) 0.138357,
+       (GLfloat) 0.277857, (GLfloat) - 0.951799, (GLfloat) 0.129901,
+       (GLfloat) 0.370172, (GLfloat) - 0.920284, (GLfloat) 0.126690,
+       (GLfloat) 0.357949, (GLfloat) - 0.923976, (GLfloat) 0.134692,
+       (GLfloat) 0.162958, (GLfloat) - 0.864281, (GLfloat) 0.475881,
+       (GLfloat) 0.190920, (GLfloat) - 0.865460, (GLfloat) 0.463172,
+       (GLfloat) 0.173391, (GLfloat) - 0.973662, (GLfloat) 0.148045,
+       (GLfloat) 0.183752, (GLfloat) - 0.972679, (GLfloat) 0.141883,
+       (GLfloat) 0.220093, (GLfloat) - 0.966009, (GLfloat) 0.135597,
+       (GLfloat) 0.208595, (GLfloat) - 0.967433, (GLfloat) 0.143394,
+       (GLfloat) 0.232098, (GLfloat) - 0.863386, (GLfloat) 0.447991,
+       (GLfloat) 0.201153, (GLfloat) - 0.862208, (GLfloat) 0.464904,
+       (GLfloat) - 0.220569, (GLfloat) 0.498423, (GLfloat) - 0.838406,
+       (GLfloat) - 0.196440, (GLfloat) 0.495475, (GLfloat) - 0.846118,
+       (GLfloat) - 0.216090, (GLfloat) 0.523731, (GLfloat) - 0.824021,
+       (GLfloat) - 0.187439, (GLfloat) 0.518039, (GLfloat) - 0.834567,
+       (GLfloat) - 0.035834, (GLfloat) 0.186611, (GLfloat) - 0.981780,
+       (GLfloat) - 0.049583, (GLfloat) 0.189912, (GLfloat) - 0.980548,
+       (GLfloat) - 0.057093, (GLfloat) 0.164206, (GLfloat) - 0.984772,
+       (GLfloat) - 0.067095, (GLfloat) 0.165750, (GLfloat) - 0.983883,
+       (GLfloat) - 0.313656, (GLfloat) 0.500321, (GLfloat) - 0.807031,
+       (GLfloat) - 0.288105, (GLfloat) 0.497578, (GLfloat) - 0.818176,
+       (GLfloat) - 0.079226, (GLfloat) 0.180632, (GLfloat) - 0.980355,
+       (GLfloat) - 0.092817, (GLfloat) 0.182734, (GLfloat) - 0.978771,
+       (GLfloat) - 0.045426, (GLfloat) 0.193014, (GLfloat) - 0.980144,
+       (GLfloat) - 0.060897, (GLfloat) 0.196689, (GLfloat) - 0.978573,
+       (GLfloat) - 0.250277, (GLfloat) 0.526446, (GLfloat) - 0.812537,
+       (GLfloat) - 0.220552, (GLfloat) 0.520843, (GLfloat) - 0.824669,
+       (GLfloat) 0.247012, (GLfloat) - 0.528860, (GLfloat) - 0.811968,
+       (GLfloat) 0.280618, (GLfloat) - 0.529785, (GLfloat) - 0.800363,
+       (GLfloat) 0.197390, (GLfloat) - 0.535630, (GLfloat) - 0.821059,
+       (GLfloat) 0.231067, (GLfloat) - 0.540483, (GLfloat) - 0.809003,
+       (GLfloat) 0.104568, (GLfloat) - 0.158183, (GLfloat) - 0.981857,
+       (GLfloat) 0.094460, (GLfloat) - 0.156029, (GLfloat) - 0.983225,
+       (GLfloat) 0.111854, (GLfloat) - 0.162201, (GLfloat) - 0.980398,
+       (GLfloat) 0.101426, (GLfloat) - 0.160983, (GLfloat) - 0.981732,
+       (GLfloat) 0.117566, (GLfloat) - 0.537019, (GLfloat) - 0.835338,
+       (GLfloat) 0.146549, (GLfloat) - 0.540970, (GLfloat) - 0.828175,
+       (GLfloat) 0.055888, (GLfloat) - 0.173264, (GLfloat) - 0.983288,
+       (GLfloat) 0.045018, (GLfloat) - 0.171643, (GLfloat) - 0.984130,
+       (GLfloat) 0.088354, (GLfloat) - 0.160681, (GLfloat) - 0.983044,
+       (GLfloat) 0.078052, (GLfloat) - 0.158368, (GLfloat) - 0.984290,
+       (GLfloat) 0.157434, (GLfloat) - 0.535002, (GLfloat) - 0.830053,
+       (GLfloat) 0.189212, (GLfloat) - 0.540730, (GLfloat) - 0.819640,
+       (GLfloat) - 0.196440, (GLfloat) 0.495475, (GLfloat) 0.846118,
+       (GLfloat) - 0.220568, (GLfloat) 0.498423, (GLfloat) 0.838406,
+       (GLfloat) - 0.057093, (GLfloat) 0.164206, (GLfloat) 0.984772,
+       (GLfloat) - 0.067095, (GLfloat) 0.165750, (GLfloat) 0.983883,
+       (GLfloat) - 0.049583, (GLfloat) 0.189912, (GLfloat) 0.980548,
+       (GLfloat) - 0.035834, (GLfloat) 0.186611, (GLfloat) 0.981780,
+       (GLfloat) - 0.216090, (GLfloat) 0.523731, (GLfloat) 0.824021,
+       (GLfloat) - 0.187439, (GLfloat) 0.518039, (GLfloat) 0.834567,
+       (GLfloat) 0.117567, (GLfloat) - 0.537019, (GLfloat) 0.835337,
+       (GLfloat) 0.146549, (GLfloat) - 0.540970, (GLfloat) 0.828176,
+       (GLfloat) 0.189212, (GLfloat) - 0.540730, (GLfloat) 0.819640,
+       (GLfloat) 0.157434, (GLfloat) - 0.535002, (GLfloat) 0.830053,
+       (GLfloat) 0.088354, (GLfloat) - 0.160681, (GLfloat) 0.983044,
+       (GLfloat) 0.078052, (GLfloat) - 0.158368, (GLfloat) 0.984290,
+       (GLfloat) 0.045018, (GLfloat) - 0.171643, (GLfloat) 0.984130,
+       (GLfloat) 0.055888, (GLfloat) - 0.173264, (GLfloat) 0.983288,
+       (GLfloat) 0.280617, (GLfloat) - 0.529785, (GLfloat) 0.800363,
+       (GLfloat) 0.247012, (GLfloat) - 0.528861, (GLfloat) 0.811968,
+       (GLfloat) 0.111853, (GLfloat) - 0.162201, (GLfloat) 0.980398,
+       (GLfloat) 0.101425, (GLfloat) - 0.160983, (GLfloat) 0.981732,
+       (GLfloat) 0.094460, (GLfloat) - 0.156028, (GLfloat) 0.983225,
+       (GLfloat) 0.104568, (GLfloat) - 0.158182, (GLfloat) 0.981857,
+       (GLfloat) 0.197390, (GLfloat) - 0.535630, (GLfloat) 0.821059,
+       (GLfloat) 0.231068, (GLfloat) - 0.540483, (GLfloat) 0.809003,
+       (GLfloat) - 0.313656, (GLfloat) 0.500320, (GLfloat) 0.807031,
+       (GLfloat) - 0.288106, (GLfloat) 0.497578, (GLfloat) 0.818175,
+       (GLfloat) - 0.220552, (GLfloat) 0.520843, (GLfloat) 0.824669,
+       (GLfloat) - 0.250276, (GLfloat) 0.526446, (GLfloat) 0.812537,
+       (GLfloat) - 0.045425, (GLfloat) 0.193015, (GLfloat) 0.980144,
+       (GLfloat) - 0.060896, (GLfloat) 0.196690, (GLfloat) 0.978573,
+       (GLfloat) - 0.092818, (GLfloat) 0.182733, (GLfloat) 0.978771,
+       (GLfloat) - 0.079226, (GLfloat) 0.180631, (GLfloat) 0.980355,
+       (GLfloat) - 0.349743, (GLfloat) 0.793198, (GLfloat) - 0.498515,
+       (GLfloat) - 0.370416, (GLfloat) 0.791707, (GLfloat) - 0.485790,
+       (GLfloat) - 0.425027, (GLfloat) 0.892201, (GLfloat) - 0.152739,
+       (GLfloat) - 0.418180, (GLfloat) 0.894483, (GLfloat) - 0.158197,
+       (GLfloat) - 0.425590, (GLfloat) 0.893099, (GLfloat) - 0.145761,
+       (GLfloat) - 0.418336, (GLfloat) 0.895388, (GLfloat) - 0.152561,
+       (GLfloat) - 0.348153, (GLfloat) 0.802874, (GLfloat) - 0.483924,
+       (GLfloat) - 0.370992, (GLfloat) 0.802293, (GLfloat) - 0.467643,
+       (GLfloat) - 0.349743, (GLfloat) 0.793198, (GLfloat) 0.498515,
+       (GLfloat) - 0.370416, (GLfloat) 0.791707, (GLfloat) 0.485790,
+       (GLfloat) - 0.370992, (GLfloat) 0.802293, (GLfloat) 0.467643,
+       (GLfloat) - 0.348153, (GLfloat) 0.802874, (GLfloat) 0.483924,
+       (GLfloat) - 0.425590, (GLfloat) 0.893099, (GLfloat) 0.145761,
+       (GLfloat) - 0.418336, (GLfloat) 0.895388, (GLfloat) 0.152561,
+       (GLfloat) - 0.418180, (GLfloat) 0.894483, (GLfloat) 0.158197,
+       (GLfloat) - 0.425027, (GLfloat) 0.892201, (GLfloat) 0.152739,
+       (GLfloat) - 0.497325, (GLfloat) 0.745242, (GLfloat) 0.444165,
+       (GLfloat) - 0.479548, (GLfloat) 0.747889, (GLfloat) 0.459017,
+       (GLfloat) - 0.556394, (GLfloat) 0.819599, (GLfloat) 0.136684,
+       (GLfloat) - 0.551239, (GLfloat) 0.822088, (GLfloat) 0.142503,
+       (GLfloat) - 0.465768, (GLfloat) 0.872611, (GLfloat) 0.147004,
+       (GLfloat) - 0.472480, (GLfloat) 0.870146, (GLfloat) 0.140027,
+       (GLfloat) - 0.394421, (GLfloat) 0.789665, (GLfloat) 0.469959,
+       (GLfloat) - 0.416499, (GLfloat) 0.788420, (GLfloat) 0.452684,
+       (GLfloat) - 0.479547, (GLfloat) 0.747889, (GLfloat) - 0.459017,
+       (GLfloat) - 0.497325, (GLfloat) 0.745242, (GLfloat) - 0.444165,
+       (GLfloat) - 0.394421, (GLfloat) 0.789665, (GLfloat) - 0.469959,
+       (GLfloat) - 0.416498, (GLfloat) 0.788420, (GLfloat) - 0.452684,
+       (GLfloat) - 0.472480, (GLfloat) 0.870146, (GLfloat) - 0.140027,
+       (GLfloat) - 0.465768, (GLfloat) 0.872611, (GLfloat) - 0.147004,
+       (GLfloat) - 0.556394, (GLfloat) 0.819599, (GLfloat) - 0.136684,
+       (GLfloat) - 0.551239, (GLfloat) 0.822088, (GLfloat) - 0.142503,
+       (GLfloat) - 0.459423, (GLfloat) 0.314205, (GLfloat) - 0.830786,
+       (GLfloat) - 0.469135, (GLfloat) 0.308642, (GLfloat) - 0.827438,
+       (GLfloat) - 0.156023, (GLfloat) 0.098476, (GLfloat) - 0.982832,
+       (GLfloat) - 0.151547, (GLfloat) 0.101367, (GLfloat) - 0.983239,
+       (GLfloat) - 0.168365, (GLfloat) 0.083796, (GLfloat) - 0.982157,
+       (GLfloat) - 0.160419, (GLfloat) 0.086730, (GLfloat) - 0.983231,
+       (GLfloat) - 0.460048, (GLfloat) 0.328491, (GLfloat) - 0.824894,
+       (GLfloat) - 0.469062, (GLfloat) 0.325364, (GLfloat) - 0.821048,
+       (GLfloat) 0.495554, (GLfloat) - 0.246920, (GLfloat) - 0.832741,
+       (GLfloat) 0.477125, (GLfloat) - 0.265003, (GLfloat) - 0.837929,
+       (GLfloat) 0.446738, (GLfloat) - 0.363453, (GLfloat) - 0.817512,
+       (GLfloat) 0.441753, (GLfloat) - 0.366614, (GLfloat) - 0.818809,
+       (GLfloat) 0.138045, (GLfloat) - 0.145699, (GLfloat) - 0.979651,
+       (GLfloat) 0.135385, (GLfloat) - 0.146968, (GLfloat) - 0.979832,
+       (GLfloat) 0.154178, (GLfloat) - 0.091800, (GLfloat) - 0.983769,
+       (GLfloat) 0.160344, (GLfloat) - 0.086930, (GLfloat) - 0.983226,
+       (GLfloat) 0.316237, (GLfloat) - 0.497953, (GLfloat) - 0.807488,
+       (GLfloat) 0.343267, (GLfloat) - 0.493329, (GLfloat) - 0.799246,
+       (GLfloat) 0.113533, (GLfloat) - 0.172349, (GLfloat) - 0.978471,
+       (GLfloat) 0.101829, (GLfloat) - 0.173041, (GLfloat) - 0.979636,
+       (GLfloat) 0.123751, (GLfloat) - 0.168767, (GLfloat) - 0.977856,
+       (GLfloat) 0.114456, (GLfloat) - 0.171068, (GLfloat) - 0.978589,
+       (GLfloat) 0.385418, (GLfloat) - 0.444520, (GLfloat) - 0.808613,
+       (GLfloat) 0.397936, (GLfloat) - 0.439743, (GLfloat) - 0.805154,
+       (GLfloat) - 0.398435, (GLfloat) 0.428657, (GLfloat) - 0.810865,
+       (GLfloat) - 0.386943, (GLfloat) 0.429063, (GLfloat) - 0.816198,
+       (GLfloat) - 0.443045, (GLfloat) 0.369548, (GLfloat) - 0.816790,
+       (GLfloat) - 0.444436, (GLfloat) 0.369300, (GLfloat) - 0.816146,
+       (GLfloat) - 0.163680, (GLfloat) 0.101509, (GLfloat) - 0.981277,
+       (GLfloat) - 0.158806, (GLfloat) 0.102320, (GLfloat) - 0.981994,
+       (GLfloat) - 0.135291, (GLfloat) 0.136613, (GLfloat) - 0.981343,
+       (GLfloat) - 0.139056, (GLfloat) 0.136609, (GLfloat) - 0.980817,
+       (GLfloat) - 0.727675, (GLfloat) 0.496263, (GLfloat) - 0.473510,
+       (GLfloat) - 0.726249, (GLfloat) 0.505128, (GLfloat) - 0.466270,
+       (GLfloat) - 0.710606, (GLfloat) 0.534378, (GLfloat) - 0.457688,
+       (GLfloat) - 0.711650, (GLfloat) 0.528248, (GLfloat) - 0.463150,
+       (GLfloat) - 0.787870, (GLfloat) 0.599385, (GLfloat) - 0.141417,
+       (GLfloat) - 0.788753, (GLfloat) 0.597790, (GLfloat) - 0.143234,
+       (GLfloat) - 0.812157, (GLfloat) 0.564556, (GLfloat) - 0.147234,
+       (GLfloat) - 0.810846, (GLfloat) 0.567072, (GLfloat) - 0.144768,
+       (GLfloat) - 0.599894, (GLfloat) 0.659162, (GLfloat) - 0.453468,
+       (GLfloat) - 0.607958, (GLfloat) 0.656733, (GLfloat) - 0.446194,
+       (GLfloat) - 0.673258, (GLfloat) 0.726567, (GLfloat) - 0.137198,
+       (GLfloat) - 0.671022, (GLfloat) 0.728096, (GLfloat) - 0.140020,
+       (GLfloat) - 0.744575, (GLfloat) 0.652826, (GLfloat) - 0.139376,
+       (GLfloat) - 0.744638, (GLfloat) 0.652728, (GLfloat) - 0.139500,
+       (GLfloat) - 0.673012, (GLfloat) 0.585174, (GLfloat) - 0.452357,
+       (GLfloat) - 0.673042, (GLfloat) 0.585047, (GLfloat) - 0.452476,
+       (GLfloat) - 0.599894, (GLfloat) 0.659162, (GLfloat) 0.453468,
+       (GLfloat) - 0.607958, (GLfloat) 0.656733, (GLfloat) 0.446194,
+       (GLfloat) - 0.673012, (GLfloat) 0.585174, (GLfloat) 0.452357,
+       (GLfloat) - 0.673042, (GLfloat) 0.585047, (GLfloat) 0.452476,
+       (GLfloat) - 0.744638, (GLfloat) 0.652728, (GLfloat) 0.139500,
+       (GLfloat) - 0.744575, (GLfloat) 0.652826, (GLfloat) 0.139376,
+       (GLfloat) - 0.671022, (GLfloat) 0.728096, (GLfloat) 0.140020,
+       (GLfloat) - 0.673258, (GLfloat) 0.726567, (GLfloat) 0.137198,
+       (GLfloat) - 0.727676, (GLfloat) 0.496263, (GLfloat) 0.473510,
+       (GLfloat) - 0.726250, (GLfloat) 0.505128, (GLfloat) 0.466269,
+       (GLfloat) - 0.810846, (GLfloat) 0.567072, (GLfloat) 0.144768,
+       (GLfloat) - 0.812157, (GLfloat) 0.564556, (GLfloat) 0.147234,
+       (GLfloat) - 0.787870, (GLfloat) 0.599385, (GLfloat) 0.141417,
+       (GLfloat) - 0.788753, (GLfloat) 0.597789, (GLfloat) 0.143234,
+       (GLfloat) - 0.711650, (GLfloat) 0.528248, (GLfloat) 0.463150,
+       (GLfloat) - 0.710607, (GLfloat) 0.534378, (GLfloat) 0.457688,
+       (GLfloat) - 0.459423, (GLfloat) 0.314205, (GLfloat) 0.830786,
+       (GLfloat) - 0.469134, (GLfloat) 0.308642, (GLfloat) 0.827438,
+       (GLfloat) - 0.469062, (GLfloat) 0.325364, (GLfloat) 0.821048,
+       (GLfloat) - 0.460048, (GLfloat) 0.328491, (GLfloat) 0.824894,
+       (GLfloat) - 0.168365, (GLfloat) 0.083796, (GLfloat) 0.982157,
+       (GLfloat) - 0.160419, (GLfloat) 0.086730, (GLfloat) 0.983231,
+       (GLfloat) - 0.151547, (GLfloat) 0.101367, (GLfloat) 0.983239,
+       (GLfloat) - 0.156023, (GLfloat) 0.098476, (GLfloat) 0.982832,
+       (GLfloat) - 0.386943, (GLfloat) 0.429064, (GLfloat) 0.816198,
+       (GLfloat) - 0.398435, (GLfloat) 0.428657, (GLfloat) 0.810865,
+       (GLfloat) - 0.135291, (GLfloat) 0.136613, (GLfloat) 0.981343,
+       (GLfloat) - 0.139055, (GLfloat) 0.136609, (GLfloat) 0.980817,
+       (GLfloat) - 0.158806, (GLfloat) 0.102320, (GLfloat) 0.981994,
+       (GLfloat) - 0.163680, (GLfloat) 0.101509, (GLfloat) 0.981277,
+       (GLfloat) - 0.443045, (GLfloat) 0.369548, (GLfloat) 0.816790,
+       (GLfloat) - 0.444437, (GLfloat) 0.369300, (GLfloat) 0.816145,
+       (GLfloat) 0.316237, (GLfloat) - 0.497952, (GLfloat) 0.807488,
+       (GLfloat) 0.343268, (GLfloat) - 0.493329, (GLfloat) 0.799246,
+       (GLfloat) 0.397936, (GLfloat) - 0.439744, (GLfloat) 0.805154,
+       (GLfloat) 0.385418, (GLfloat) - 0.444521, (GLfloat) 0.808613,
+       (GLfloat) 0.123751, (GLfloat) - 0.168768, (GLfloat) 0.977856,
+       (GLfloat) 0.114455, (GLfloat) - 0.171068, (GLfloat) 0.978589,
+       (GLfloat) 0.101830, (GLfloat) - 0.173040, (GLfloat) 0.979637,
+       (GLfloat) 0.113533, (GLfloat) - 0.172348, (GLfloat) 0.978471,
+       (GLfloat) 0.477126, (GLfloat) - 0.265003, (GLfloat) 0.837929,
+       (GLfloat) 0.495553, (GLfloat) - 0.246921, (GLfloat) 0.832741,
+       (GLfloat) 0.154178, (GLfloat) - 0.091800, (GLfloat) 0.983769,
+       (GLfloat) 0.160344, (GLfloat) - 0.086930, (GLfloat) 0.983226,
+       (GLfloat) 0.135385, (GLfloat) - 0.146968, (GLfloat) 0.979832,
+       (GLfloat) 0.138045, (GLfloat) - 0.145699, (GLfloat) 0.979651,
+       (GLfloat) 0.446739, (GLfloat) - 0.363453, (GLfloat) 0.817512,
+       (GLfloat) 0.441753, (GLfloat) - 0.366614, (GLfloat) 0.818809,
+       (GLfloat) 0.786198, (GLfloat) - 0.394047, (GLfloat) 0.476047,
+       (GLfloat) 0.792547, (GLfloat) - 0.363224, (GLfloat) 0.489834,
+       (GLfloat) 0.707476, (GLfloat) - 0.538845, (GLfloat) 0.457301,
+       (GLfloat) 0.711142, (GLfloat) - 0.529032, (GLfloat) 0.463037,
+       (GLfloat) 0.801588, (GLfloat) - 0.580242, (GLfloat) 0.144141,
+       (GLfloat) 0.799043, (GLfloat) - 0.584300, (GLfloat) 0.141857,
+       (GLfloat) 0.903357, (GLfloat) - 0.400085, (GLfloat) 0.154524,
+       (GLfloat) 0.898654, (GLfloat) - 0.412515, (GLfloat) 0.149172,
+       (GLfloat) 0.471890, (GLfloat) - 0.763546, (GLfloat) 0.440814,
+       (GLfloat) 0.497278, (GLfloat) - 0.754424, (GLfloat) 0.428437,
+       (GLfloat) 0.515315, (GLfloat) - 0.846316, (GLfloat) 0.134909,
+       (GLfloat) 0.524719, (GLfloat) - 0.841405, (GLfloat) 0.129258,
+       (GLfloat) 0.671646, (GLfloat) - 0.728471, (GLfloat) 0.134984,
+       (GLfloat) 0.668271, (GLfloat) - 0.731195, (GLfloat) 0.136994,
+       (GLfloat) 0.610971, (GLfloat) - 0.657561, (GLfloat) 0.440826,
+       (GLfloat) 0.601302, (GLfloat) - 0.663396, (GLfloat) 0.445356,
+       (GLfloat) 0.497278, (GLfloat) - 0.754424, (GLfloat) - 0.428437,
+       (GLfloat) 0.471890, (GLfloat) - 0.763546, (GLfloat) - 0.440814,
+       (GLfloat) 0.610971, (GLfloat) - 0.657561, (GLfloat) - 0.440826,
+       (GLfloat) 0.601301, (GLfloat) - 0.663396, (GLfloat) - 0.445356,
+       (GLfloat) 0.668271, (GLfloat) - 0.731195, (GLfloat) - 0.136994,
+       (GLfloat) 0.671646, (GLfloat) - 0.728471, (GLfloat) - 0.134984,
+       (GLfloat) 0.515315, (GLfloat) - 0.846316, (GLfloat) - 0.134909,
+       (GLfloat) 0.524719, (GLfloat) - 0.841405, (GLfloat) - 0.129258,
+       (GLfloat) 0.792547, (GLfloat) - 0.363225, (GLfloat) - 0.489834,
+       (GLfloat) 0.786198, (GLfloat) - 0.394046, (GLfloat) - 0.476047,
+       (GLfloat) 0.903357, (GLfloat) - 0.400085, (GLfloat) - 0.154524,
+       (GLfloat) 0.898654, (GLfloat) - 0.412515, (GLfloat) - 0.149172,
+       (GLfloat) 0.799043, (GLfloat) - 0.584299, (GLfloat) - 0.141858,
+       (GLfloat) 0.801588, (GLfloat) - 0.580242, (GLfloat) - 0.144141,
+       (GLfloat) 0.707476, (GLfloat) - 0.538845, (GLfloat) - 0.457301,
+       (GLfloat) 0.711142, (GLfloat) - 0.529031, (GLfloat) - 0.463037,
+       (GLfloat) 0.844921, (GLfloat) - 0.202233, (GLfloat) 0.495188,
+       (GLfloat) 0.846624, (GLfloat) - 0.162790, (GLfloat) 0.506682,
+       (GLfloat) 0.967461, (GLfloat) - 0.195075, (GLfloat) 0.161136,
+       (GLfloat) 0.965076, (GLfloat) - 0.210256, (GLfloat) 0.156272,
+       (GLfloat) 0.933716, (GLfloat) - 0.317920, (GLfloat) 0.164623,
+       (GLfloat) 0.928870, (GLfloat) - 0.334244, (GLfloat) 0.159632,
+       (GLfloat) 0.801028, (GLfloat) - 0.328506, (GLfloat) 0.500438,
+       (GLfloat) 0.805814, (GLfloat) - 0.302226, (GLfloat) 0.509238,
+       (GLfloat) 0.844921, (GLfloat) - 0.202233, (GLfloat) - 0.495188,
+       (GLfloat) 0.846624, (GLfloat) - 0.162790, (GLfloat) - 0.506682,
+       (GLfloat) 0.805814, (GLfloat) - 0.302226, (GLfloat) - 0.509238,
+       (GLfloat) 0.801028, (GLfloat) - 0.328507, (GLfloat) - 0.500438,
+       (GLfloat) 0.933716, (GLfloat) - 0.317920, (GLfloat) - 0.164623,
+       (GLfloat) 0.928870, (GLfloat) - 0.334244, (GLfloat) - 0.159632,
+       (GLfloat) 0.965076, (GLfloat) - 0.210256, (GLfloat) - 0.156272,
+       (GLfloat) 0.967461, (GLfloat) - 0.195075, (GLfloat) - 0.161136,
+       (GLfloat) 0.116677, (GLfloat) - 0.971600, (GLfloat) - 0.205866,
+       (GLfloat) 0.095439, (GLfloat) - 0.979375, (GLfloat) - 0.178092,
+       (GLfloat) 0.145951, (GLfloat) - 0.986885, (GLfloat) - 0.068965,
+       (GLfloat) 0.134470, (GLfloat) - 0.988213, (GLfloat) - 0.073162,
+       (GLfloat) 0.572548, (GLfloat) - 0.810794, (GLfloat) - 0.121664,
+       (GLfloat) 0.603894, (GLfloat) - 0.784891, (GLfloat) - 0.138773,
+       (GLfloat) 0.437036, (GLfloat) - 0.822210, (GLfloat) - 0.364650,
+       (GLfloat) 0.472429, (GLfloat) - 0.800503, (GLfloat) - 0.368789,
+       (GLfloat) 0.095438, (GLfloat) - 0.979375, (GLfloat) 0.178092,
+       (GLfloat) 0.116677, (GLfloat) - 0.971600, (GLfloat) 0.205866,
+       (GLfloat) 0.472430, (GLfloat) - 0.800503, (GLfloat) 0.368789,
+       (GLfloat) 0.437036, (GLfloat) - 0.822210, (GLfloat) 0.364650,
+       (GLfloat) 0.603894, (GLfloat) - 0.784891, (GLfloat) 0.138773,
+       (GLfloat) 0.572548, (GLfloat) - 0.810794, (GLfloat) 0.121664,
+       (GLfloat) 0.134470, (GLfloat) - 0.988213, (GLfloat) 0.073162,
+       (GLfloat) 0.145951, (GLfloat) - 0.986885, (GLfloat) 0.068965,
+       (GLfloat) 0.531733, (GLfloat) - 0.073239, (GLfloat) - 0.843739,
+       (GLfloat) 0.511681, (GLfloat) - 0.104754, (GLfloat) - 0.852766,
+       (GLfloat) 0.176179, (GLfloat) 0.024438, (GLfloat) - 0.984055,
+       (GLfloat) 0.188717, (GLfloat) 0.040307, (GLfloat) - 0.981204,
+       (GLfloat) 0.150895, (GLfloat) - 0.104293, (GLfloat) - 0.983033,
+       (GLfloat) 0.147932, (GLfloat) - 0.109363, (GLfloat) - 0.982932,
+       (GLfloat) 0.481880, (GLfloat) - 0.227373, (GLfloat) - 0.846223,
+       (GLfloat) 0.480166, (GLfloat) - 0.230321, (GLfloat) - 0.846400,
+       (GLfloat) - 0.443443, (GLfloat) 0.349023, (GLfloat) - 0.825555,
+       (GLfloat) - 0.447255, (GLfloat) 0.345654, (GLfloat) - 0.824916,
+       (GLfloat) - 0.494732, (GLfloat) 0.167751, (GLfloat) - 0.852701,
+       (GLfloat) - 0.499143, (GLfloat) 0.160727, (GLfloat) - 0.851483,
+       (GLfloat) - 0.167121, (GLfloat) 0.020158, (GLfloat) - 0.985730,
+       (GLfloat) - 0.166487, (GLfloat) 0.021208, (GLfloat) - 0.985815,
+       (GLfloat) - 0.129817, (GLfloat) 0.178023, (GLfloat) - 0.975426,
+       (GLfloat) - 0.132948, (GLfloat) 0.174752, (GLfloat) - 0.975595,
+       (GLfloat) - 0.353563, (GLfloat) - 0.901143, (GLfloat) - 0.250869,
+       (GLfloat) - 0.351628, (GLfloat) - 0.891347, (GLfloat) - 0.286110,
+       (GLfloat) - 0.232284, (GLfloat) - 0.920192, (GLfloat) - 0.315104,
+       (GLfloat) - 0.236990, (GLfloat) - 0.922714, (GLfloat) - 0.304029,
+       (GLfloat) - 0.244093, (GLfloat) - 0.592931, (GLfloat) - 0.767366,
+       (GLfloat) - 0.249996, (GLfloat) - 0.572960, (GLfloat) - 0.780525,
+       (GLfloat) - 0.510472, (GLfloat) - 0.553764, (GLfloat) - 0.657848,
+       (GLfloat) - 0.520671, (GLfloat) - 0.533495, (GLfloat) - 0.666547,
+       (GLfloat) 0.010781, (GLfloat) - 0.964447, (GLfloat) - 0.264055,
+       (GLfloat) 0.040104, (GLfloat) - 0.958098, (GLfloat) - 0.283621,
+       (GLfloat) 0.223629, (GLfloat) - 0.775786, (GLfloat) - 0.590040,
+       (GLfloat) 0.262682, (GLfloat) - 0.745474, (GLfloat) - 0.612590,
+       (GLfloat) 0.033849, (GLfloat) - 0.640593, (GLfloat) - 0.767134,
+       (GLfloat) 0.004138, (GLfloat) - 0.677809, (GLfloat) - 0.735226,
+       (GLfloat) - 0.092889, (GLfloat) - 0.948124, (GLfloat) - 0.304029,
+       (GLfloat) - 0.096449, (GLfloat) - 0.944143, (GLfloat) - 0.315104,
+       (GLfloat) - 0.719211, (GLfloat) 0.510808, (GLfloat) - 0.470968,
+       (GLfloat) - 0.720697, (GLfloat) 0.504519, (GLfloat) - 0.475454,
+       (GLfloat) - 0.811897, (GLfloat) 0.564936, (GLfloat) - 0.147209,
+       (GLfloat) - 0.813044, (GLfloat) 0.562871, (GLfloat) - 0.148783,
+       (GLfloat) - 0.910433, (GLfloat) 0.380820, (GLfloat) - 0.161519,
+       (GLfloat) - 0.907768, (GLfloat) 0.388545, (GLfloat) - 0.158079,
+       (GLfloat) - 0.804000, (GLfloat) 0.309508, (GLfloat) - 0.507729,
+       (GLfloat) - 0.801647, (GLfloat) 0.326768, (GLfloat) - 0.500584,
+       (GLfloat) - 0.720697, (GLfloat) 0.504519, (GLfloat) 0.475454,
+       (GLfloat) - 0.719210, (GLfloat) 0.510808, (GLfloat) 0.470968,
+       (GLfloat) - 0.804000, (GLfloat) 0.309509, (GLfloat) 0.507729,
+       (GLfloat) - 0.801647, (GLfloat) 0.326768, (GLfloat) 0.500585,
+       (GLfloat) - 0.907768, (GLfloat) 0.388545, (GLfloat) 0.158079,
+       (GLfloat) - 0.910433, (GLfloat) 0.380820, (GLfloat) 0.161519,
+       (GLfloat) - 0.811897, (GLfloat) 0.564936, (GLfloat) 0.147209,
+       (GLfloat) - 0.813044, (GLfloat) 0.562871, (GLfloat) 0.148783,
+       (GLfloat) - 0.441947, (GLfloat) - 0.873099, (GLfloat) 0.205867,
+       (GLfloat) - 0.424648, (GLfloat) - 0.887670, (GLfloat) 0.178091,
+       (GLfloat) - 0.474684, (GLfloat) - 0.877450, (GLfloat) 0.068965,
+       (GLfloat) - 0.464350, (GLfloat) - 0.882625, (GLfloat) 0.073162,
+       (GLfloat) - 0.909934, (GLfloat) - 0.390292, (GLfloat) 0.140328,
+       (GLfloat) - 0.923715, (GLfloat) - 0.349249, (GLfloat) 0.157405,
+       (GLfloat) - 0.775101, (GLfloat) - 0.483039, (GLfloat) 0.407299,
+       (GLfloat) - 0.785487, (GLfloat) - 0.436754, (GLfloat) 0.438470,
+       (GLfloat) - 0.424649, (GLfloat) - 0.887669, (GLfloat) - 0.178092,
+       (GLfloat) - 0.441947, (GLfloat) - 0.873099, (GLfloat) - 0.205866,
+       (GLfloat) - 0.775100, (GLfloat) - 0.483039, (GLfloat) - 0.407299,
+       (GLfloat) - 0.785487, (GLfloat) - 0.436754, (GLfloat) - 0.438470,
+       (GLfloat) - 0.923715, (GLfloat) - 0.349249, (GLfloat) - 0.157405,
+       (GLfloat) - 0.909934, (GLfloat) - 0.390292, (GLfloat) - 0.140328,
+       (GLfloat) - 0.464350, (GLfloat) - 0.882625, (GLfloat) - 0.073162,
+       (GLfloat) - 0.474684, (GLfloat) - 0.877450, (GLfloat) - 0.068965,
+       (GLfloat) - 0.447255, (GLfloat) 0.345654, (GLfloat) 0.824916,
+       (GLfloat) - 0.443443, (GLfloat) 0.349023, (GLfloat) 0.825555,
+       (GLfloat) - 0.129817, (GLfloat) 0.178023, (GLfloat) 0.975426,
+       (GLfloat) - 0.132949, (GLfloat) 0.174752, (GLfloat) 0.975595,
+       (GLfloat) - 0.166487, (GLfloat) 0.021208, (GLfloat) 0.985815,
+       (GLfloat) - 0.167121, (GLfloat) 0.020158, (GLfloat) 0.985730,
+       (GLfloat) - 0.494732, (GLfloat) 0.167753, (GLfloat) 0.852701,
+       (GLfloat) - 0.499144, (GLfloat) 0.160728, (GLfloat) 0.851482,
+       (GLfloat) 0.531733, (GLfloat) - 0.073239, (GLfloat) 0.843739,
+       (GLfloat) 0.511681, (GLfloat) - 0.104754, (GLfloat) 0.852765,
+       (GLfloat) 0.480166, (GLfloat) - 0.230321, (GLfloat) 0.846400,
+       (GLfloat) 0.481881, (GLfloat) - 0.227371, (GLfloat) 0.846223,
+       (GLfloat) 0.150895, (GLfloat) - 0.104294, (GLfloat) 0.983033,
+       (GLfloat) 0.147933, (GLfloat) - 0.109363, (GLfloat) 0.982932,
+       (GLfloat) 0.188717, (GLfloat) 0.040307, (GLfloat) 0.981204,
+       (GLfloat) 0.176179, (GLfloat) 0.024438, (GLfloat) 0.984055,
+       (GLfloat) 0.040104, (GLfloat) - 0.958098, (GLfloat) 0.283620,
+       (GLfloat) 0.010781, (GLfloat) - 0.964447, (GLfloat) 0.264055,
+       (GLfloat) - 0.096449, (GLfloat) - 0.944143, (GLfloat) 0.315104,
+       (GLfloat) - 0.092889, (GLfloat) - 0.948124, (GLfloat) 0.304029,
+       (GLfloat) 0.004138, (GLfloat) - 0.677808, (GLfloat) 0.735227,
+       (GLfloat) 0.033849, (GLfloat) - 0.640593, (GLfloat) 0.767135,
+       (GLfloat) 0.223629, (GLfloat) - 0.775785, (GLfloat) 0.590040,
+       (GLfloat) 0.262682, (GLfloat) - 0.745474, (GLfloat) 0.612591,
+       (GLfloat) - 0.353563, (GLfloat) - 0.901143, (GLfloat) 0.250868,
+       (GLfloat) - 0.351627, (GLfloat) - 0.891347, (GLfloat) 0.286109,
+       (GLfloat) - 0.510472, (GLfloat) - 0.553764, (GLfloat) 0.657848,
+       (GLfloat) - 0.520671, (GLfloat) - 0.533495, (GLfloat) 0.666547,
+       (GLfloat) - 0.249996, (GLfloat) - 0.572959, (GLfloat) 0.780525,
+       (GLfloat) - 0.244093, (GLfloat) - 0.592931, (GLfloat) 0.767367,
+       (GLfloat) - 0.236991, (GLfloat) - 0.922714, (GLfloat) 0.304029,
+       (GLfloat) - 0.232284, (GLfloat) - 0.920192, (GLfloat) 0.315104,
+       (GLfloat) - 0.036947, (GLfloat) - 0.991593, (GLfloat) - 0.124011,
+       (GLfloat) - 0.048560, (GLfloat) - 0.989545, (GLfloat) - 0.135802,
+       (GLfloat) - 0.129266, (GLfloat) - 0.985532, (GLfloat) - 0.109621,
+       (GLfloat) - 0.133311, (GLfloat) - 0.984414, (GLfloat) - 0.114709,
+       (GLfloat) - 0.143769, (GLfloat) - 0.989058, (GLfloat) - 0.033079,
+       (GLfloat) - 0.140897, (GLfloat) - 0.989565, (GLfloat) - 0.030163,
+       (GLfloat) - 0.064478, (GLfloat) - 0.996956, (GLfloat) - 0.043834,
+       (GLfloat) - 0.059398, (GLfloat) - 0.997446, (GLfloat) - 0.039656,
+       (GLfloat) - 0.292813, (GLfloat) - 0.946477, (GLfloat) - 0.135802,
+       (GLfloat) - 0.304426, (GLfloat) - 0.944429, (GLfloat) - 0.124011,
+       (GLfloat) - 0.280390, (GLfloat) - 0.958885, (GLfloat) - 0.043834,
+       (GLfloat) - 0.285331, (GLfloat) - 0.957608, (GLfloat) - 0.039656,
+       (GLfloat) - 0.206051, (GLfloat) - 0.978076, (GLfloat) - 0.030163,
+       (GLfloat) - 0.203179, (GLfloat) - 0.978583, (GLfloat) - 0.033079,
+       (GLfloat) - 0.215602, (GLfloat) - 0.970309, (GLfloat) - 0.109621,
+       (GLfloat) - 0.211418, (GLfloat) - 0.970641, (GLfloat) - 0.114709,
+       (GLfloat) - 0.304426, (GLfloat) - 0.944429, (GLfloat) 0.124011,
+       (GLfloat) - 0.292813, (GLfloat) - 0.946477, (GLfloat) 0.135803,
+       (GLfloat) - 0.215602, (GLfloat) - 0.970309, (GLfloat) 0.109621,
+       (GLfloat) - 0.211418, (GLfloat) - 0.970641, (GLfloat) 0.114709,
+       (GLfloat) - 0.203179, (GLfloat) - 0.978583, (GLfloat) 0.033079,
+       (GLfloat) - 0.206051, (GLfloat) - 0.978076, (GLfloat) 0.030163,
+       (GLfloat) - 0.280390, (GLfloat) - 0.958885, (GLfloat) 0.043834,
+       (GLfloat) - 0.285331, (GLfloat) - 0.957608, (GLfloat) 0.039656,
+       (GLfloat) - 0.048560, (GLfloat) - 0.989545, (GLfloat) 0.135802,
+       (GLfloat) - 0.036947, (GLfloat) - 0.991593, (GLfloat) 0.124011,
+       (GLfloat) - 0.064478, (GLfloat) - 0.996956, (GLfloat) 0.043834,
+       (GLfloat) - 0.059398, (GLfloat) - 0.997446, (GLfloat) 0.039656,
+       (GLfloat) - 0.140897, (GLfloat) - 0.989565, (GLfloat) 0.030163,
+       (GLfloat) - 0.143769, (GLfloat) - 0.989058, (GLfloat) 0.033079,
+       (GLfloat) - 0.129266, (GLfloat) - 0.985532, (GLfloat) 0.109621,
+       (GLfloat) - 0.133311, (GLfloat) - 0.984414, (GLfloat) 0.114709,
+};
+
+static unsigned short int s1_3_POLS[] =
+{
+      3, 82, 12, 76, 1, 3, 76, 74, 82, 1, 3, 22, 78, 74, 1, 3, 22, 74, 76, 1,
+      3, 78, 20, 80, 1, 3, 80, 74, 78, 1, 3, 28, 82, 74, 1, 3, 28, 74, 80, 1,
+      3, 88, 13, 84, 1, 3, 84, 77, 88, 1, 3, 24, 86, 77, 1, 3, 24, 77, 84, 1,
+      3, 86, 20, 78, 1, 3, 78, 77, 86, 1, 3, 22, 88, 77, 1, 3, 22, 77, 78, 1,
+      3, 14, 90, 85, 1, 3, 14, 85, 93, 1, 3, 26, 91, 85, 1, 3, 26, 85, 90, 1,
+      3, 20, 86, 85, 1, 3, 20, 85, 91, 1, 3, 24, 93, 85, 1, 3, 24, 85, 86, 1,
+      3, 15, 95, 79, 1, 3, 15, 79, 97, 1, 3, 28, 80, 79, 1, 3, 28, 79, 95, 1,
+      3, 20, 91, 79, 1, 3, 20, 79, 80, 1, 3, 26, 97, 79, 1, 3, 26, 79, 91, 1,
+    3, 13, 99, 83, 1, 3, 13, 83, 84, 1, 3, 99, 30, 101, 1, 3, 101, 83, 99, 1,
+  3, 23, 102, 83, 1, 3, 23, 83, 101, 1, 3, 102, 24, 84, 1, 3, 84, 83, 102, 1,
+       3, 108, 16, 104, 1, 3, 104, 100, 108, 1, 3, 32, 106, 100, 1, 3, 32, 100, 104, 1,
+       3, 106, 23, 101, 1, 3, 101, 100, 106, 1, 3, 30, 108, 100, 1, 3, 30, 100, 101, 1,
+       3, 113, 17, 110, 1, 3, 110, 105, 113, 1, 3, 33, 111, 105, 1, 3, 33, 105, 110, 1,
+       3, 23, 106, 105, 1, 3, 23, 105, 111, 1, 3, 106, 32, 113, 1, 3, 113, 105, 106, 1,
+   3, 14, 93, 92, 1, 3, 14, 92, 114, 1, 3, 93, 24, 102, 1, 3, 102, 92, 93, 1,
+3, 23, 111, 92, 1, 3, 23, 92, 102, 1, 3, 111, 33, 114, 1, 3, 114, 92, 111, 1,
+       3, 16, 116, 103, 1, 3, 16, 103, 104, 1, 3, 116, 35, 118, 1, 3, 118, 103, 116, 1,
+       3, 31, 119, 103, 1, 3, 31, 103, 118, 1, 3, 119, 32, 104, 1, 3, 104, 103, 119, 1,
+       3, 18, 121, 117, 1, 3, 18, 117, 125, 1, 3, 121, 36, 123, 1, 3, 123, 117, 121, 1,
+       3, 31, 118, 117, 1, 3, 31, 117, 123, 1, 3, 118, 35, 125, 1, 3, 125, 117, 118, 1,
+       3, 19, 127, 122, 1, 3, 19, 122, 130, 1, 3, 127, 37, 128, 1, 3, 128, 122, 127, 1,
+       3, 31, 123, 122, 1, 3, 31, 122, 128, 1, 3, 123, 36, 130, 1, 3, 130, 122, 123, 1,
+       3, 17, 113, 112, 1, 3, 17, 112, 131, 1, 3, 113, 32, 119, 1, 3, 119, 112, 113, 1,
+       3, 31, 128, 112, 1, 3, 31, 112, 119, 1, 3, 128, 37, 131, 1, 3, 131, 112, 128, 1,
+       3, 121, 18, 133, 1, 3, 133, 120, 121, 1, 3, 39, 134, 120, 1, 3, 39, 120, 133, 1,
+       3, 134, 27, 135, 1, 3, 135, 120, 134, 1, 3, 36, 121, 120, 1, 3, 36, 120, 135, 1,
+   3, 12, 82, 81, 1, 3, 12, 81, 138, 1, 3, 82, 28, 136, 1, 3, 136, 81, 82, 1,
+3, 27, 134, 81, 1, 3, 27, 81, 136, 1, 3, 134, 39, 138, 1, 3, 138, 81, 134, 1,
+ 3, 15, 139, 94, 1, 3, 15, 94, 95, 1, 3, 139, 40, 140, 1, 3, 140, 94, 139, 1,
+  3, 27, 136, 94, 1, 3, 27, 94, 140, 1, 3, 136, 28, 95, 1, 3, 95, 94, 136, 1,
+       3, 141, 19, 130, 1, 3, 130, 129, 141, 1, 3, 130, 36, 135, 1, 3, 135, 129, 130, 1,
+       3, 27, 140, 129, 1, 3, 27, 129, 135, 1, 3, 40, 141, 129, 1, 3, 40, 129, 140, 1,
+ 3, 14, 114, 89, 1, 3, 14, 89, 90, 1, 3, 114, 33, 142, 1, 3, 142, 89, 114, 1,
+  3, 25, 143, 89, 1, 3, 25, 89, 142, 1, 3, 143, 26, 90, 1, 3, 90, 89, 143, 1,
+       3, 17, 131, 109, 1, 3, 17, 109, 110, 1, 3, 131, 37, 144, 1, 3, 144, 109, 131, 1,
+       3, 25, 142, 109, 1, 3, 25, 109, 144, 1, 3, 142, 33, 110, 1, 3, 110, 109, 142, 1,
+       3, 19, 141, 126, 1, 3, 19, 126, 127, 1, 3, 141, 40, 145, 1, 3, 145, 126, 141, 1,
+       3, 25, 144, 126, 1, 3, 25, 126, 145, 1, 3, 144, 37, 127, 1, 3, 127, 126, 144, 1,
+   3, 15, 97, 96, 1, 3, 15, 96, 139, 1, 3, 97, 26, 143, 1, 3, 143, 96, 97, 1,
+3, 25, 145, 96, 1, 3, 25, 96, 143, 1, 3, 145, 40, 139, 1, 3, 139, 96, 145, 1,
+ 3, 12, 146, 75, 1, 3, 12, 75, 76, 1, 3, 146, 41, 148, 1, 3, 148, 75, 146, 1,
+  3, 21, 149, 75, 1, 3, 21, 75, 148, 1, 3, 149, 22, 76, 1, 3, 76, 75, 149, 1,
+       3, 155, 8, 151, 1, 3, 151, 147, 155, 1, 3, 43, 153, 147, 1, 3, 43, 147, 151, 1,
+       3, 153, 21, 148, 1, 3, 148, 147, 153, 1, 3, 41, 155, 147, 1, 3, 41, 147, 148, 1,
+       3, 160, 11, 157, 1, 3, 157, 152, 160, 1, 3, 44, 158, 152, 1, 3, 44, 152, 157, 1,
+       3, 158, 21, 153, 1, 3, 153, 152, 158, 1, 3, 43, 160, 152, 1, 3, 43, 152, 153, 1,
+   3, 13, 88, 87, 1, 3, 13, 87, 161, 1, 3, 88, 22, 149, 1, 3, 149, 87, 88, 1,
+3, 21, 158, 87, 1, 3, 21, 87, 149, 1, 3, 158, 44, 161, 1, 3, 161, 87, 158, 1,
+       3, 18, 162, 132, 1, 3, 18, 132, 133, 1, 3, 162, 45, 164, 1, 3, 164, 132, 162, 1,
+       3, 38, 165, 132, 1, 3, 38, 132, 164, 1, 3, 165, 39, 133, 1, 3, 133, 132, 165, 1,
+       3, 170, 9, 167, 1, 3, 167, 163, 170, 1, 3, 47, 168, 163, 1, 3, 47, 163, 167, 1,
+       3, 168, 38, 164, 1, 3, 164, 163, 168, 1, 3, 45, 170, 163, 1, 3, 45, 163, 164, 1,
+3, 8, 155, 154, 1, 3, 8, 154, 173, 1, 3, 155, 41, 171, 1, 3, 171, 154, 155, 1,
+       3, 38, 168, 154, 1, 3, 38, 154, 171, 1, 3, 168, 47, 173, 1, 3, 173, 154, 168, 1,
+       3, 146, 12, 138, 1, 3, 138, 137, 146, 1, 3, 39, 165, 137, 1, 3, 39, 137, 138, 1,
+       3, 165, 38, 171, 1, 3, 171, 137, 165, 1, 3, 41, 146, 137, 1, 3, 41, 137, 171, 1,
+       3, 16, 108, 107, 1, 3, 16, 107, 177, 1, 3, 108, 30, 174, 1, 3, 174, 107, 108, 1,
+       3, 29, 176, 107, 1, 3, 29, 107, 174, 1, 3, 176, 50, 177, 1, 3, 177, 107, 176, 1,
+  3, 99, 13, 161, 1, 3, 161, 98, 99, 1, 3, 44, 178, 98, 1, 3, 44, 98, 161, 1,
+ 3, 178, 29, 174, 1, 3, 174, 98, 178, 1, 3, 30, 99, 98, 1, 3, 30, 98, 174, 1,
+       3, 11, 180, 156, 1, 3, 11, 156, 157, 1, 3, 180, 49, 181, 1, 3, 181, 156, 180, 1,
+       3, 29, 178, 156, 1, 3, 29, 156, 181, 1, 3, 178, 44, 157, 1, 3, 157, 156, 178, 1,
+       3, 185, 10, 183, 1, 3, 183, 175, 185, 1, 3, 50, 176, 175, 1, 3, 50, 175, 183, 1,
+       3, 176, 29, 181, 1, 3, 181, 175, 176, 1, 3, 49, 185, 175, 1, 3, 49, 175, 181, 1,
+       3, 162, 18, 125, 1, 3, 125, 124, 162, 1, 3, 35, 186, 124, 1, 3, 35, 124, 125, 1,
+       3, 186, 34, 187, 1, 3, 187, 124, 186, 1, 3, 45, 162, 124, 1, 3, 45, 124, 187, 1,
+       3, 116, 16, 177, 1, 3, 177, 115, 116, 1, 3, 50, 188, 115, 1, 3, 50, 115, 177, 1,
+       3, 188, 34, 186, 1, 3, 186, 115, 188, 1, 3, 35, 116, 115, 1, 3, 35, 115, 186, 1,
+       3, 10, 190, 182, 1, 3, 10, 182, 183, 1, 3, 190, 52, 191, 1, 3, 191, 182, 190, 1,
+       3, 34, 188, 182, 1, 3, 34, 182, 191, 1, 3, 188, 50, 183, 1, 3, 183, 182, 188, 1,
+3, 9, 170, 169, 1, 3, 9, 169, 193, 1, 3, 170, 45, 187, 1, 3, 187, 169, 170, 1,
+       3, 34, 191, 169, 1, 3, 34, 169, 187, 1, 3, 191, 52, 193, 1, 3, 193, 169, 191, 1,
+       3, 201, 1, 196, 1, 3, 196, 194, 201, 1, 3, 54, 198, 194, 1, 3, 54, 194, 196, 1,
+       3, 198, 46, 199, 1, 3, 199, 194, 198, 1, 3, 56, 201, 194, 1, 3, 56, 194, 199, 1,
+3, 3, 203, 197, 1, 3, 3, 197, 206, 1, 3, 203, 55, 204, 1, 3, 204, 197, 203, 1,
+       3, 46, 198, 197, 1, 3, 46, 197, 204, 1, 3, 198, 54, 206, 1, 3, 206, 197, 198, 1,
+       3, 208, 8, 173, 1, 3, 173, 172, 208, 1, 3, 47, 207, 172, 1, 3, 47, 172, 173, 1,
+       3, 207, 46, 204, 1, 3, 204, 172, 207, 1, 3, 55, 208, 172, 1, 3, 55, 172, 204, 1,
+3, 9, 209, 166, 1, 3, 9, 166, 167, 1, 3, 209, 56, 199, 1, 3, 199, 166, 209, 1,
+       3, 46, 207, 166, 1, 3, 46, 166, 199, 1, 3, 207, 47, 167, 1, 3, 167, 166, 207, 1,
+       3, 214, 1, 201, 1, 3, 201, 200, 214, 1, 3, 56, 210, 200, 1, 3, 56, 200, 201, 1,
+       3, 210, 51, 212, 1, 3, 212, 200, 210, 1, 3, 59, 214, 200, 1, 3, 59, 200, 212, 1,
+       3, 209, 9, 193, 1, 3, 193, 192, 209, 1, 3, 52, 215, 192, 1, 3, 52, 192, 193, 1,
+       3, 51, 210, 192, 1, 3, 51, 192, 215, 1, 3, 210, 56, 209, 1, 3, 209, 192, 210, 1,
+       3, 190, 10, 216, 1, 3, 216, 189, 190, 1, 3, 216, 57, 217, 1, 3, 217, 189, 216, 1,
+       3, 51, 215, 189, 1, 3, 51, 189, 217, 1, 3, 52, 190, 189, 1, 3, 52, 189, 215, 1,
+       3, 221, 0, 219, 1, 3, 219, 211, 221, 1, 3, 59, 212, 211, 1, 3, 59, 211, 219, 1,
+       3, 212, 51, 217, 1, 3, 217, 211, 212, 1, 3, 57, 221, 211, 1, 3, 57, 211, 217, 1,
+       3, 226, 0, 221, 1, 3, 221, 220, 226, 1, 3, 57, 222, 220, 1, 3, 57, 220, 221, 1,
+       3, 222, 48, 224, 1, 3, 224, 220, 222, 1, 3, 62, 226, 220, 1, 3, 62, 220, 224, 1,
+       3, 10, 185, 184, 1, 3, 10, 184, 216, 1, 3, 185, 49, 227, 1, 3, 227, 184, 185, 1,
+       3, 48, 222, 184, 1, 3, 48, 184, 227, 1, 3, 222, 57, 216, 1, 3, 216, 184, 222, 1,
+       3, 180, 11, 228, 1, 3, 228, 179, 180, 1, 3, 60, 229, 179, 1, 3, 60, 179, 228, 1,
+       3, 229, 48, 227, 1, 3, 227, 179, 229, 1, 3, 49, 180, 179, 1, 3, 49, 179, 227, 1,
+3, 2, 231, 223, 1, 3, 2, 223, 233, 1, 3, 231, 62, 224, 1, 3, 224, 223, 231, 1,
+       3, 48, 229, 223, 1, 3, 48, 223, 224, 1, 3, 229, 60, 233, 1, 3, 233, 223, 229, 1,
+3, 2, 233, 232, 1, 3, 2, 232, 237, 1, 3, 233, 60, 234, 1, 3, 234, 232, 233, 1,
+       3, 42, 235, 232, 1, 3, 42, 232, 234, 1, 3, 235, 64, 237, 1, 3, 237, 232, 235, 1,
+       3, 11, 160, 159, 1, 3, 11, 159, 228, 1, 3, 160, 43, 238, 1, 3, 238, 159, 160, 1,
+       3, 42, 234, 159, 1, 3, 42, 159, 238, 1, 3, 234, 60, 228, 1, 3, 228, 159, 234, 1,
+3, 8, 208, 150, 1, 3, 8, 150, 151, 1, 3, 208, 55, 239, 1, 3, 239, 150, 208, 1,
+       3, 42, 238, 150, 1, 3, 42, 150, 239, 1, 3, 238, 43, 151, 1, 3, 151, 150, 238, 1,
+3, 3, 241, 202, 1, 3, 3, 202, 203, 1, 3, 241, 64, 235, 1, 3, 235, 202, 241, 1,
+       3, 42, 239, 202, 1, 3, 42, 202, 235, 1, 3, 239, 55, 203, 1, 3, 203, 202, 239, 1,
+       3, 245, 2, 237, 1, 3, 237, 236, 245, 1, 3, 64, 242, 236, 1, 3, 64, 236, 237, 1,
+       3, 242, 63, 244, 1, 3, 244, 236, 242, 1, 3, 68, 245, 236, 1, 3, 68, 236, 244, 1,
+       3, 241, 3, 246, 1, 3, 246, 240, 241, 1, 3, 65, 248, 240, 1, 3, 65, 240, 246, 1,
+       3, 248, 63, 242, 1, 3, 242, 240, 248, 1, 3, 64, 241, 240, 1, 3, 64, 240, 242, 1,
+3, 4, 250, 247, 1, 3, 4, 247, 253, 1, 3, 67, 251, 247, 1, 3, 67, 247, 250, 1,
+       3, 63, 248, 247, 1, 3, 63, 247, 251, 1, 3, 65, 253, 247, 1, 3, 65, 247, 248, 1,
+3, 7, 255, 243, 1, 3, 7, 243, 257, 1, 3, 68, 244, 243, 1, 3, 68, 243, 255, 1,
+       3, 63, 251, 243, 1, 3, 63, 243, 244, 1, 3, 67, 257, 243, 1, 3, 67, 243, 251, 1,
+       3, 246, 3, 206, 1, 3, 206, 205, 246, 1, 3, 54, 258, 205, 1, 3, 54, 205, 206, 1,
+       3, 258, 53, 259, 1, 3, 259, 205, 258, 1, 3, 65, 246, 205, 1, 3, 65, 205, 259, 1,
+3, 1, 260, 195, 1, 3, 1, 195, 196, 1, 3, 260, 69, 262, 1, 3, 262, 195, 260, 1,
+       3, 53, 258, 195, 1, 3, 53, 195, 262, 1, 3, 258, 54, 196, 1, 3, 196, 195, 258, 1,
+       3, 267, 5, 264, 1, 3, 264, 261, 267, 1, 3, 70, 265, 261, 1, 3, 70, 261, 264, 1,
+       3, 53, 262, 261, 1, 3, 53, 261, 265, 1, 3, 262, 69, 267, 1, 3, 267, 261, 262, 1,
+3, 4, 253, 252, 1, 3, 4, 252, 268, 1, 3, 253, 65, 259, 1, 3, 259, 252, 253, 1,
+       3, 53, 265, 252, 1, 3, 53, 252, 259, 1, 3, 70, 268, 252, 1, 3, 70, 252, 265, 1,
+3, 1, 214, 213, 1, 3, 1, 213, 260, 1, 3, 214, 59, 269, 1, 3, 269, 213, 214, 1,
+       3, 58, 270, 213, 1, 3, 58, 213, 269, 1, 3, 270, 69, 260, 1, 3, 260, 213, 270, 1,
+3, 0, 271, 218, 1, 3, 0, 218, 219, 1, 3, 271, 71, 273, 1, 3, 273, 218, 271, 1,
+       3, 58, 269, 218, 1, 3, 58, 218, 273, 1, 3, 269, 59, 219, 1, 3, 219, 218, 269, 1,
+3, 6, 275, 272, 1, 3, 6, 272, 278, 1, 3, 72, 276, 272, 1, 3, 72, 272, 275, 1,
+       3, 58, 273, 272, 1, 3, 58, 272, 276, 1, 3, 273, 71, 278, 1, 3, 278, 272, 273, 1,
+3, 5, 267, 266, 1, 3, 5, 266, 279, 1, 3, 267, 69, 270, 1, 3, 270, 266, 267, 1,
+       3, 58, 276, 266, 1, 3, 58, 266, 270, 1, 3, 72, 279, 266, 1, 3, 72, 266, 276, 1,
+3, 0, 226, 225, 1, 3, 0, 225, 271, 1, 3, 226, 62, 280, 1, 3, 280, 225, 226, 1,
+       3, 61, 281, 225, 1, 3, 61, 225, 280, 1, 3, 281, 71, 271, 1, 3, 271, 225, 281, 1,
+       3, 231, 2, 245, 1, 3, 245, 230, 231, 1, 3, 68, 282, 230, 1, 3, 68, 230, 245, 1,
+       3, 282, 61, 280, 1, 3, 280, 230, 282, 1, 3, 62, 231, 230, 1, 3, 62, 230, 280, 1,
+3, 7, 283, 254, 1, 3, 7, 254, 255, 1, 3, 73, 284, 254, 1, 3, 73, 254, 283, 1,
+       3, 61, 282, 254, 1, 3, 61, 254, 284, 1, 3, 282, 68, 255, 1, 3, 255, 254, 282, 1,
+       3, 285, 6, 278, 1, 3, 278, 277, 285, 1, 3, 278, 71, 281, 1, 3, 281, 277, 278, 1,
+       3, 61, 284, 277, 1, 3, 61, 277, 281, 1, 3, 73, 285, 277, 1, 3, 73, 277, 284, 1,
+3, 4, 268, 249, 1, 3, 4, 249, 250, 1, 3, 268, 70, 286, 1, 3, 286, 249, 268, 1,
+       3, 66, 287, 249, 1, 3, 66, 249, 286, 1, 3, 287, 67, 250, 1, 3, 250, 249, 287, 1,
+3, 5, 279, 263, 1, 3, 5, 263, 264, 1, 3, 279, 72, 288, 1, 3, 288, 263, 279, 1,
+       3, 66, 286, 263, 1, 3, 66, 263, 288, 1, 3, 286, 70, 264, 1, 3, 264, 263, 286, 1,
+3, 6, 285, 274, 1, 3, 6, 274, 275, 1, 3, 285, 73, 289, 1, 3, 289, 274, 285, 1,
+       3, 66, 288, 274, 1, 3, 66, 274, 289, 1, 3, 288, 72, 275, 1, 3, 275, 274, 288, 1,
+3, 7, 257, 256, 1, 3, 7, 256, 283, 1, 3, 257, 67, 287, 1, 3, 287, 256, 257, 1,
+       3, 66, 289, 256, 1, 3, 66, 256, 287, 1, 3, 289, 73, 283, 1, 3, 283, 256, 289, 1,
+
+       0
+};
+
+struct lwo  LWO_s1_3 =
+{
+       290,                    /* number of points */
+       s1_3_PNTS, s1_3_normals, s1_3_POLS, 0L
+};
+
+#endif /* MODE_sproingies */
+
+/* End of s1_3.c */
diff --git a/modes/glx/s1_4.c b/modes/glx/s1_4.c
new file mode 100644 (file)
index 0000000..cfff3a6
--- /dev/null
@@ -0,0 +1,1057 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)s1_4.c       4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points, polygons, and normal vectors to render "s1_4" in 3D.
+ *
+ * Generated by lw2ogl.  Link this with your program but do
+ * not edit by hand.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_sproingies
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat s1_4_PNTS[] =
+{
+       (GLfloat) 0.691977, (GLfloat) 0.424648, (GLfloat) - 0.335934,
+       (GLfloat) 0.691977, (GLfloat) 0.424648, (GLfloat) - 0.664066,
+       (GLfloat) 0.910107, (GLfloat) 0.206343, (GLfloat) - 0.335934,
+       (GLfloat) 0.910107, (GLfloat) 0.206343, (GLfloat) - 0.664066,
+       (GLfloat) 0.820528, (GLfloat) 0.154011, (GLfloat) - 0.638667,
+       (GLfloat) 0.608078, (GLfloat) 0.332278, (GLfloat) - 0.638667,
+       (GLfloat) 0.608078, (GLfloat) 0.332278, (GLfloat) - 0.361333,
+       (GLfloat) 0.820528, (GLfloat) 0.154011, (GLfloat) - 0.361333,
+       (GLfloat) 1.065609, (GLfloat) 0.289676, (GLfloat) - 0.638205,
+       (GLfloat) 1.074101, (GLfloat) 0.505017, (GLfloat) - 0.638205,
+       (GLfloat) 1.074101, (GLfloat) 0.505017, (GLfloat) - 0.361795,
+       (GLfloat) 1.065609, (GLfloat) 0.289676, (GLfloat) - 0.361795,
+       (GLfloat) 1.235562, (GLfloat) 0.083949, (GLfloat) - 0.664066,
+       (GLfloat) 1.235562, (GLfloat) 0.083949, (GLfloat) - 0.335934,
+       (GLfloat) 1.331736, (GLfloat) 0.017726, (GLfloat) - 0.361333,
+       (GLfloat) 1.331736, (GLfloat) 0.017726, (GLfloat) - 0.638667,
+       (GLfloat) 1.431839, (GLfloat) 0.331232, (GLfloat) - 0.335934,
+       (GLfloat) 1.517309, (GLfloat) 0.223825, (GLfloat) - 0.361333,
+       (GLfloat) 1.431839, (GLfloat) 0.331232, (GLfloat) - 0.664066,
+       (GLfloat) 1.517309, (GLfloat) 0.223825, (GLfloat) - 0.638667,
+       (GLfloat) 1.243033, (GLfloat) - 0.034453, (GLfloat) - 0.500000,
+       (GLfloat) 1.136909, (GLfloat) 0.161755, (GLfloat) - 0.500000,
+       (GLfloat) 1.199875, (GLfloat) 0.038989, (GLfloat) - 0.500000,
+       (GLfloat) 1.400739, (GLfloat) 0.142695, (GLfloat) - 0.261940,
+       (GLfloat) 1.284897, (GLfloat) 0.013483, (GLfloat) - 0.325812,
+       (GLfloat) 1.438241, (GLfloat) 0.108423, (GLfloat) - 0.500000,
+       (GLfloat) 1.310688, (GLfloat) - 0.015661, (GLfloat) - 0.500000,
+       (GLfloat) 1.400739, (GLfloat) 0.142695, (GLfloat) - 0.738060,
+       (GLfloat) 1.284897, (GLfloat) 0.013483, (GLfloat) - 0.674188,
+       (GLfloat) 1.216443, (GLfloat) 0.317256, (GLfloat) - 0.300040,
+       (GLfloat) 1.333700, (GLfloat) 0.207591, (GLfloat) - 0.276273,
+       (GLfloat) 1.558444, (GLfloat) 0.319842, (GLfloat) - 0.500000,
+       (GLfloat) 1.515677, (GLfloat) 0.272720, (GLfloat) - 0.325812,
+       (GLfloat) 1.429500, (GLfloat) 0.116294, (GLfloat) - 0.322437,
+       (GLfloat) 1.295978, (GLfloat) 0.472757, (GLfloat) - 0.500000,
+       (GLfloat) 1.467526, (GLfloat) 0.376193, (GLfloat) - 0.500000,
+       (GLfloat) 1.515677, (GLfloat) 0.272720, (GLfloat) - 0.674188,
+       (GLfloat) 1.548313, (GLfloat) 0.248248, (GLfloat) - 0.500000,
+       (GLfloat) 1.216443, (GLfloat) 0.317256, (GLfloat) - 0.699960,
+       (GLfloat) 1.333700, (GLfloat) 0.207591, (GLfloat) - 0.723727,
+       (GLfloat) 1.429500, (GLfloat) 0.116294, (GLfloat) - 0.677562,
+       (GLfloat) 1.158118, (GLfloat) 0.203222, (GLfloat) - 0.646637,
+       (GLfloat) 0.998811, (GLfloat) 0.235426, (GLfloat) - 0.500000,
+       (GLfloat) 1.064065, (GLfloat) 0.250523, (GLfloat) - 0.500000,
+       (GLfloat) 1.158118, (GLfloat) 0.203222, (GLfloat) - 0.353363,
+       (GLfloat) 1.274769, (GLfloat) 0.431290, (GLfloat) - 0.646637,
+       (GLfloat) 0.920924, (GLfloat) 0.379919, (GLfloat) - 0.699960,
+       (GLfloat) 1.069855, (GLfloat) 0.397346, (GLfloat) - 0.688461,
+       (GLfloat) 0.920924, (GLfloat) 0.379919, (GLfloat) - 0.300040,
+       (GLfloat) 1.069855, (GLfloat) 0.397346, (GLfloat) - 0.311539,
+       (GLfloat) 1.274769, (GLfloat) 0.431290, (GLfloat) - 0.353363,
+       (GLfloat) 0.843038, (GLfloat) 0.524412, (GLfloat) - 0.500000,
+       (GLfloat) 1.075645, (GLfloat) 0.544169, (GLfloat) - 0.500000,
+       (GLfloat) 0.735693, (GLfloat) 0.265534, (GLfloat) - 0.738060,
+       (GLfloat) 0.801042, (GLfloat) 0.315496, (GLfloat) - 0.723727,
+       (GLfloat) 0.978041, (GLfloat) 0.273957, (GLfloat) - 0.646637,
+       (GLfloat) 0.863808, (GLfloat) 0.485881, (GLfloat) - 0.646637,
+       (GLfloat) 0.863808, (GLfloat) 0.485881, (GLfloat) - 0.353363,
+       (GLfloat) 0.555594, (GLfloat) 0.419060, (GLfloat) - 0.500000,
+       (GLfloat) 0.652318, (GLfloat) 0.464340, (GLfloat) - 0.500000,
+       (GLfloat) 0.978041, (GLfloat) 0.273957, (GLfloat) - 0.353363,
+       (GLfloat) 0.735693, (GLfloat) 0.265534, (GLfloat) - 0.261940,
+       (GLfloat) 0.801042, (GLfloat) 0.315496, (GLfloat) - 0.276273,
+       (GLfloat) 0.915792, (GLfloat) 0.112008, (GLfloat) - 0.500000,
+       (GLfloat) 0.949767, (GLfloat) 0.166652, (GLfloat) - 0.500000,
+       (GLfloat) 0.867858, (GLfloat) 0.153664, (GLfloat) - 0.674188,
+       (GLfloat) 0.702437, (GLfloat) 0.229003, (GLfloat) - 0.500000,
+       (GLfloat) 0.846018, (GLfloat) 0.123878, (GLfloat) - 0.500000,
+       (GLfloat) 0.867858, (GLfloat) 0.153664, (GLfloat) - 0.325812,
+       (GLfloat) 0.604310, (GLfloat) 0.378335, (GLfloat) - 0.674188,
+       (GLfloat) 0.709997, (GLfloat) 0.238013, (GLfloat) - 0.677562,
+       (GLfloat) 0.604310, (GLfloat) 0.378335, (GLfloat) - 0.325812,
+       (GLfloat) 0.573976, (GLfloat) 0.352148, (GLfloat) - 0.500000,
+       (GLfloat) 0.709997, (GLfloat) 0.238013, (GLfloat) - 0.322437,
+       (GLfloat) 1.231827, (GLfloat) 0.004686, (GLfloat) - 0.594296,
+       (GLfloat) 1.178115, (GLfloat) 0.109780, (GLfloat) - 0.584482,
+       (GLfloat) 1.208797, (GLfloat) 0.050229, (GLfloat) - 0.589491,
+       (GLfloat) 1.231827, (GLfloat) 0.004686, (GLfloat) - 0.405704,
+       (GLfloat) 1.221734, (GLfloat) - 0.007055, (GLfloat) - 0.500000,
+       (GLfloat) 1.279887, (GLfloat) - 0.026194, (GLfloat) - 0.587500,
+       (GLfloat) 1.253444, (GLfloat) - 0.022303, (GLfloat) - 0.594949,
+       (GLfloat) 1.312568, (GLfloat) 0.098620, (GLfloat) - 0.720025,
+       (GLfloat) 1.262105, (GLfloat) 0.039911, (GLfloat) - 0.672877,
+       (GLfloat) 1.312568, (GLfloat) 0.098620, (GLfloat) - 0.279975,
+       (GLfloat) 1.262105, (GLfloat) 0.039911, (GLfloat) - 0.327123,
+       (GLfloat) 1.279887, (GLfloat) - 0.026194, (GLfloat) - 0.412500,
+       (GLfloat) 1.253444, (GLfloat) - 0.022303, (GLfloat) - 0.405051,
+       (GLfloat) 1.178115, (GLfloat) 0.109780, (GLfloat) - 0.415518,
+       (GLfloat) 1.208797, (GLfloat) 0.050229, (GLfloat) - 0.410509,
+       (GLfloat) 1.373428, (GLfloat) 0.045002, (GLfloat) - 0.409500,
+       (GLfloat) 1.317700, (GLfloat) - 0.004566, (GLfloat) - 0.417500,
+       (GLfloat) 1.270418, (GLfloat) - 0.038526, (GLfloat) - 0.500000,
+       (GLfloat) 1.359179, (GLfloat) 0.061869, (GLfloat) - 0.294000,
+       (GLfloat) 1.309178, (GLfloat) 0.008154, (GLfloat) - 0.339125,
+       (GLfloat) 1.359179, (GLfloat) 0.061869, (GLfloat) - 0.706000,
+       (GLfloat) 1.309178, (GLfloat) 0.008154, (GLfloat) - 0.660875,
+       (GLfloat) 1.373428, (GLfloat) 0.045002, (GLfloat) - 0.590500,
+       (GLfloat) 1.317700, (GLfloat) - 0.004566, (GLfloat) - 0.582500,
+       (GLfloat) 1.236552, (GLfloat) 0.195985, (GLfloat) - 0.302876,
+       (GLfloat) 1.280170, (GLfloat) 0.140150, (GLfloat) - 0.291188,
+       (GLfloat) 1.433681, (GLfloat) 0.239521, (GLfloat) - 0.279975,
+       (GLfloat) 1.373124, (GLfloat) 0.169070, (GLfloat) - 0.264259,
+       (GLfloat) 1.337615, (GLfloat) 0.072243, (GLfloat) - 0.277994,
+       (GLfloat) 1.514422, (GLfloat) 0.333454, (GLfloat) - 0.405704,
+       (GLfloat) 1.484144, (GLfloat) 0.298229, (GLfloat) - 0.327123,
+       (GLfloat) 1.476277, (GLfloat) 0.191919, (GLfloat) - 0.294000,
+       (GLfloat) 1.463411, (GLfloat) 0.213552, (GLfloat) - 0.277994,
+       (GLfloat) 1.324207, (GLfloat) 0.325294, (GLfloat) - 0.302876,
+       (GLfloat) 1.387230, (GLfloat) 0.275032, (GLfloat) - 0.291188,
+       (GLfloat) 1.494540, (GLfloat) 0.179511, (GLfloat) - 0.409500,
+       (GLfloat) 1.483059, (GLfloat) 0.179084, (GLfloat) - 0.335375,
+       (GLfloat) 1.418631, (GLfloat) 0.126081, (GLfloat) - 0.278500,
+       (GLfloat) 1.555568, (GLfloat) 0.279982, (GLfloat) - 0.412500,
+       (GLfloat) 1.524471, (GLfloat) 0.247261, (GLfloat) - 0.339125,
+       (GLfloat) 1.372652, (GLfloat) 0.056465, (GLfloat) - 0.335375,
+       (GLfloat) 1.382643, (GLfloat) 0.411500, (GLfloat) - 0.415518,
+       (GLfloat) 1.458604, (GLfloat) 0.364953, (GLfloat) - 0.410509,
+       (GLfloat) 1.514422, (GLfloat) 0.333454, (GLfloat) - 0.594296,
+       (GLfloat) 1.524515, (GLfloat) 0.345196, (GLfloat) - 0.500000,
+       (GLfloat) 1.547582, (GLfloat) 0.308099, (GLfloat) - 0.405051,
+       (GLfloat) 1.433681, (GLfloat) 0.239521, (GLfloat) - 0.720025,
+       (GLfloat) 1.484144, (GLfloat) 0.298229, (GLfloat) - 0.672877,
+       (GLfloat) 1.555568, (GLfloat) 0.279982, (GLfloat) - 0.587500,
+       (GLfloat) 1.547582, (GLfloat) 0.308099, (GLfloat) - 0.594949,
+       (GLfloat) 1.382643, (GLfloat) 0.411500, (GLfloat) - 0.584482,
+       (GLfloat) 1.458604, (GLfloat) 0.364953, (GLfloat) - 0.589491,
+       (GLfloat) 1.494540, (GLfloat) 0.179511, (GLfloat) - 0.590500,
+       (GLfloat) 1.538011, (GLfloat) 0.240115, (GLfloat) - 0.582500,
+       (GLfloat) 1.566843, (GLfloat) 0.290687, (GLfloat) - 0.500000,
+       (GLfloat) 1.476277, (GLfloat) 0.191919, (GLfloat) - 0.706000,
+       (GLfloat) 1.524471, (GLfloat) 0.247261, (GLfloat) - 0.660875,
+       (GLfloat) 1.538011, (GLfloat) 0.240115, (GLfloat) - 0.417500,
+       (GLfloat) 1.324207, (GLfloat) 0.325294, (GLfloat) - 0.697124,
+       (GLfloat) 1.387230, (GLfloat) 0.275032, (GLfloat) - 0.708812,
+       (GLfloat) 1.373124, (GLfloat) 0.169070, (GLfloat) - 0.735741,
+       (GLfloat) 1.463411, (GLfloat) 0.213552, (GLfloat) - 0.722006,
+       (GLfloat) 1.337615, (GLfloat) 0.072243, (GLfloat) - 0.722006,
+       (GLfloat) 1.236552, (GLfloat) 0.195985, (GLfloat) - 0.697124,
+       (GLfloat) 1.280170, (GLfloat) 0.140150, (GLfloat) - 0.708812,
+       (GLfloat) 1.372652, (GLfloat) 0.056465, (GLfloat) - 0.664625,
+       (GLfloat) 1.418631, (GLfloat) 0.126081, (GLfloat) - 0.721500,
+       (GLfloat) 1.483059, (GLfloat) 0.179084, (GLfloat) - 0.664625,
+       (GLfloat) 1.436048, (GLfloat) 0.110398, (GLfloat) - 0.402250,
+       (GLfloat) 1.370641, (GLfloat) 0.037756, (GLfloat) - 0.500000,
+       (GLfloat) 1.501456, (GLfloat) 0.183040, (GLfloat) - 0.500000,
+       (GLfloat) 1.436048, (GLfloat) 0.110398, (GLfloat) - 0.597750,
+       (GLfloat) 1.200029, (GLfloat) 0.142107, (GLfloat) - 0.654883,
+       (GLfloat) 1.103513, (GLfloat) 0.226037, (GLfloat) - 0.576713,
+       (GLfloat) 1.142211, (GLfloat) 0.172121, (GLfloat) - 0.579984,
+       (GLfloat) 1.170811, (GLfloat) 0.099004, (GLfloat) - 0.500000,
+       (GLfloat) 1.027452, (GLfloat) 0.263727, (GLfloat) - 0.576713,
+       (GLfloat) 1.064451, (GLfloat) 0.260311, (GLfloat) - 0.575384,
+       (GLfloat) 1.103513, (GLfloat) 0.226037, (GLfloat) - 0.423287,
+       (GLfloat) 1.100538, (GLfloat) 0.216006, (GLfloat) - 0.500000,
+       (GLfloat) 1.127320, (GLfloat) 0.306289, (GLfloat) - 0.678998,
+       (GLfloat) 1.112441, (GLfloat) 0.256132, (GLfloat) - 0.640641,
+       (GLfloat) 1.127320, (GLfloat) 0.306289, (GLfloat) - 0.321002,
+       (GLfloat) 1.112441, (GLfloat) 0.256132, (GLfloat) - 0.359359,
+       (GLfloat) 1.142211, (GLfloat) 0.172121, (GLfloat) - 0.420016,
+       (GLfloat) 1.027452, (GLfloat) 0.263727, (GLfloat) - 0.423287,
+       (GLfloat) 1.064451, (GLfloat) 0.260311, (GLfloat) - 0.424615,
+       (GLfloat) 1.200029, (GLfloat) 0.142107, (GLfloat) - 0.345117,
+       (GLfloat) 1.360730, (GLfloat) 0.379173, (GLfloat) - 0.654883,
+       (GLfloat) 1.163029, (GLfloat) 0.426667, (GLfloat) - 0.678998,
+       (GLfloat) 1.248257, (GLfloat) 0.379456, (GLfloat) - 0.686629,
+       (GLfloat) 1.280379, (GLfloat) 0.260640, (GLfloat) - 0.711204,
+       (GLfloat) 0.979330, (GLfloat) 0.456830, (GLfloat) - 0.678998,
+       (GLfloat) 1.072171, (GLfloat) 0.456076, (GLfloat) - 0.675897,
+       (GLfloat) 1.145175, (GLfloat) 0.366478, (GLfloat) - 0.691783,
+       (GLfloat) 1.186836, (GLfloat) 0.506919, (GLfloat) - 0.576713,
+       (GLfloat) 1.177908, (GLfloat) 0.476825, (GLfloat) - 0.640641,
+       (GLfloat) 1.184630, (GLfloat) 0.255055, (GLfloat) - 0.686629,
+       (GLfloat) 1.008203, (GLfloat) 0.340968, (GLfloat) - 0.678998,
+       (GLfloat) 1.067539, (GLfloat) 0.338617, (GLfloat) - 0.675897,
+       (GLfloat) 1.280379, (GLfloat) 0.260640, (GLfloat) - 0.288796,
+       (GLfloat) 1.163029, (GLfloat) 0.426667, (GLfloat) - 0.321002,
+       (GLfloat) 1.248257, (GLfloat) 0.379456, (GLfloat) - 0.313371,
+       (GLfloat) 1.360730, (GLfloat) 0.379173, (GLfloat) - 0.345117,
+       (GLfloat) 1.184630, (GLfloat) 0.255055, (GLfloat) - 0.313371,
+       (GLfloat) 1.008203, (GLfloat) 0.340968, (GLfloat) - 0.321002,
+       (GLfloat) 1.067539, (GLfloat) 0.338617, (GLfloat) - 0.324103,
+       (GLfloat) 1.145175, (GLfloat) 0.366478, (GLfloat) - 0.308217,
+       (GLfloat) 1.186836, (GLfloat) 0.506919, (GLfloat) - 0.423287,
+       (GLfloat) 1.177908, (GLfloat) 0.476825, (GLfloat) - 0.359359,
+       (GLfloat) 0.979330, (GLfloat) 0.456830, (GLfloat) - 0.321002,
+       (GLfloat) 1.072171, (GLfloat) 0.456076, (GLfloat) - 0.324103,
+       (GLfloat) 1.389948, (GLfloat) 0.422275, (GLfloat) - 0.500000,
+       (GLfloat) 1.290676, (GLfloat) 0.462390, (GLfloat) - 0.579984,
+       (GLfloat) 1.290676, (GLfloat) 0.462390, (GLfloat) - 0.420016,
+       (GLfloat) 0.960081, (GLfloat) 0.534071, (GLfloat) - 0.423287,
+       (GLfloat) 1.075259, (GLfloat) 0.534381, (GLfloat) - 0.424615,
+       (GLfloat) 1.189812, (GLfloat) 0.516951, (GLfloat) - 0.500000,
+       (GLfloat) 0.960081, (GLfloat) 0.534071, (GLfloat) - 0.576713,
+       (GLfloat) 1.075259, (GLfloat) 0.534381, (GLfloat) - 0.575384,
+       (GLfloat) 0.808756, (GLfloat) 0.407522, (GLfloat) - 0.697124,
+       (GLfloat) 0.693423, (GLfloat) 0.349037, (GLfloat) - 0.720025,
+       (GLfloat) 0.741552, (GLfloat) 0.375033, (GLfloat) - 0.708812,
+       (GLfloat) 0.901933, (GLfloat) 0.290859, (GLfloat) - 0.697124,
+       (GLfloat) 0.855345, (GLfloat) 0.349190, (GLfloat) - 0.711204,
+       (GLfloat) 0.889770, (GLfloat) 0.437716, (GLfloat) - 0.686629,
+       (GLfloat) 0.746638, (GLfloat) 0.485298, (GLfloat) - 0.584482,
+       (GLfloat) 0.769932, (GLfloat) 0.456132, (GLfloat) - 0.654883,
+       (GLfloat) 0.964051, (GLfloat) 0.213083, (GLfloat) - 0.584482,
+       (GLfloat) 0.940757, (GLfloat) 0.242249, (GLfloat) - 0.654883,
+       (GLfloat) 0.952079, (GLfloat) 0.322122, (GLfloat) - 0.686629,
+       (GLfloat) 0.830643, (GLfloat) 0.226200, (GLfloat) - 0.720025,
+       (GLfloat) 0.860532, (GLfloat) 0.255958, (GLfloat) - 0.708812,
+       (GLfloat) 0.993766, (GLfloat) 0.398899, (GLfloat) - 0.691783,
+       (GLfloat) 1.020234, (GLfloat) 0.292692, (GLfloat) - 0.640641,
+       (GLfloat) 0.967299, (GLfloat) 0.505105, (GLfloat) - 0.640641,
+       (GLfloat) 0.848231, (GLfloat) 0.514780, (GLfloat) - 0.579984,
+       (GLfloat) 0.746638, (GLfloat) 0.485298, (GLfloat) - 0.415518,
+       (GLfloat) 0.738873, (GLfloat) 0.495020, (GLfloat) - 0.500000,
+       (GLfloat) 0.601944, (GLfloat) 0.430927, (GLfloat) - 0.594296,
+       (GLfloat) 0.662233, (GLfloat) 0.454417, (GLfloat) - 0.589491,
+       (GLfloat) 0.957675, (GLfloat) 0.543726, (GLfloat) - 0.500000,
+       (GLfloat) 0.967299, (GLfloat) 0.505105, (GLfloat) - 0.359359,
+       (GLfloat) 0.848231, (GLfloat) 0.514780, (GLfloat) - 0.420016,
+       (GLfloat) 0.601944, (GLfloat) 0.430927, (GLfloat) - 0.405704,
+       (GLfloat) 0.662233, (GLfloat) 0.454417, (GLfloat) - 0.410509,
+       (GLfloat) 0.808756, (GLfloat) 0.407522, (GLfloat) - 0.302876,
+       (GLfloat) 0.769932, (GLfloat) 0.456132, (GLfloat) - 0.345117,
+       (GLfloat) 0.889770, (GLfloat) 0.437716, (GLfloat) - 0.313371,
+       (GLfloat) 0.901933, (GLfloat) 0.290859, (GLfloat) - 0.302876,
+       (GLfloat) 0.855345, (GLfloat) 0.349190, (GLfloat) - 0.288796,
+       (GLfloat) 0.693423, (GLfloat) 0.349037, (GLfloat) - 0.279975,
+       (GLfloat) 0.741552, (GLfloat) 0.375033, (GLfloat) - 0.291188,
+       (GLfloat) 0.993766, (GLfloat) 0.398899, (GLfloat) - 0.308217,
+       (GLfloat) 1.020234, (GLfloat) 0.292692, (GLfloat) - 0.359359,
+       (GLfloat) 0.952079, (GLfloat) 0.322122, (GLfloat) - 0.313371,
+       (GLfloat) 0.830643, (GLfloat) 0.226200, (GLfloat) - 0.279975,
+       (GLfloat) 0.860532, (GLfloat) 0.255958, (GLfloat) - 0.291188,
+       (GLfloat) 0.964051, (GLfloat) 0.213083, (GLfloat) - 0.415518,
+       (GLfloat) 0.940757, (GLfloat) 0.242249, (GLfloat) - 0.345117,
+       (GLfloat) 0.993618, (GLfloat) 0.245059, (GLfloat) - 0.420016,
+       (GLfloat) 0.971816, (GLfloat) 0.203361, (GLfloat) - 0.500000,
+       (GLfloat) 0.922122, (GLfloat) 0.144310, (GLfloat) - 0.405704,
+       (GLfloat) 0.939852, (GLfloat) 0.176575, (GLfloat) - 0.410509,
+       (GLfloat) 1.029858, (GLfloat) 0.254072, (GLfloat) - 0.500000,
+       (GLfloat) 0.993618, (GLfloat) 0.245059, (GLfloat) - 0.579984,
+       (GLfloat) 0.922122, (GLfloat) 0.144310, (GLfloat) - 0.594296,
+       (GLfloat) 0.939852, (GLfloat) 0.176575, (GLfloat) - 0.589491,
+       (GLfloat) 0.933557, (GLfloat) 0.134073, (GLfloat) - 0.500000,
+       (GLfloat) 0.877985, (GLfloat) 0.117734, (GLfloat) - 0.412500,
+       (GLfloat) 0.903840, (GLfloat) 0.122594, (GLfloat) - 0.405051,
+       (GLfloat) 0.887817, (GLfloat) 0.175019, (GLfloat) - 0.327123,
+       (GLfloat) 0.887817, (GLfloat) 0.175019, (GLfloat) - 0.672877,
+       (GLfloat) 0.877985, (GLfloat) 0.117734, (GLfloat) - 0.587500,
+       (GLfloat) 0.903840, (GLfloat) 0.122594, (GLfloat) - 0.594949,
+       (GLfloat) 0.775446, (GLfloat) 0.175219, (GLfloat) - 0.590500,
+       (GLfloat) 0.837530, (GLfloat) 0.133890, (GLfloat) - 0.582500,
+       (GLfloat) 0.889078, (GLfloat) 0.106840, (GLfloat) - 0.500000,
+       (GLfloat) 0.787209, (GLfloat) 0.193905, (GLfloat) - 0.706000,
+       (GLfloat) 0.844199, (GLfloat) 0.147671, (GLfloat) - 0.660875,
+       (GLfloat) 0.787209, (GLfloat) 0.193905, (GLfloat) - 0.294000,
+       (GLfloat) 0.844199, (GLfloat) 0.147671, (GLfloat) - 0.339125,
+       (GLfloat) 0.775446, (GLfloat) 0.175219, (GLfloat) - 0.409500,
+       (GLfloat) 0.837530, (GLfloat) 0.133890, (GLfloat) - 0.417500,
+       (GLfloat) 0.762033, (GLfloat) 0.287619, (GLfloat) - 0.735741,
+       (GLfloat) 0.807717, (GLfloat) 0.204533, (GLfloat) - 0.722006,
+       (GLfloat) 0.636249, (GLfloat) 0.400218, (GLfloat) - 0.672877,
+       (GLfloat) 0.653151, (GLfloat) 0.306393, (GLfloat) - 0.706000,
+       (GLfloat) 0.664060, (GLfloat) 0.327000, (GLfloat) - 0.722006,
+       (GLfloat) 0.636792, (GLfloat) 0.291564, (GLfloat) - 0.590500,
+       (GLfloat) 0.648221, (GLfloat) 0.292739, (GLfloat) - 0.664625,
+       (GLfloat) 0.719399, (GLfloat) 0.249218, (GLfloat) - 0.721500,
+       (GLfloat) 0.562375, (GLfloat) 0.382563, (GLfloat) - 0.587500,
+       (GLfloat) 0.597724, (GLfloat) 0.354488, (GLfloat) - 0.660875,
+       (GLfloat) 0.774619, (GLfloat) 0.186679, (GLfloat) - 0.664625,
+       (GLfloat) 0.590509, (GLfloat) 0.441164, (GLfloat) - 0.500000,
+       (GLfloat) 0.567937, (GLfloat) 0.408940, (GLfloat) - 0.594949,
+       (GLfloat) 0.636249, (GLfloat) 0.400218, (GLfloat) - 0.327123,
+       (GLfloat) 0.562375, (GLfloat) 0.382563, (GLfloat) - 0.412500,
+       (GLfloat) 0.567937, (GLfloat) 0.408940, (GLfloat) - 0.405051,
+       (GLfloat) 0.636792, (GLfloat) 0.291564, (GLfloat) - 0.409500,
+       (GLfloat) 0.585310, (GLfloat) 0.345528, (GLfloat) - 0.417500,
+       (GLfloat) 0.549720, (GLfloat) 0.391595, (GLfloat) - 0.500000,
+       (GLfloat) 0.653151, (GLfloat) 0.306393, (GLfloat) - 0.294000,
+       (GLfloat) 0.597724, (GLfloat) 0.354488, (GLfloat) - 0.339125,
+       (GLfloat) 0.585310, (GLfloat) 0.345528, (GLfloat) - 0.582500,
+       (GLfloat) 0.762033, (GLfloat) 0.287619, (GLfloat) - 0.264259,
+       (GLfloat) 0.664060, (GLfloat) 0.327000, (GLfloat) - 0.277994,
+       (GLfloat) 0.807717, (GLfloat) 0.204533, (GLfloat) - 0.277994,
+       (GLfloat) 0.774619, (GLfloat) 0.186679, (GLfloat) - 0.335375,
+       (GLfloat) 0.719399, (GLfloat) 0.249218, (GLfloat) - 0.278500,
+       (GLfloat) 0.648221, (GLfloat) 0.292739, (GLfloat) - 0.335375,
+       (GLfloat) 0.704334, (GLfloat) 0.231264, (GLfloat) - 0.597750,
+       (GLfloat) 0.779215, (GLfloat) 0.168431, (GLfloat) - 0.500000,
+       (GLfloat) 0.629453, (GLfloat) 0.294096, (GLfloat) - 0.500000,
+       (GLfloat) 0.704334, (GLfloat) 0.231264, (GLfloat) - 0.402250,
+};
+
+static GLfloat s1_4_normals[] =
+{
+       (GLfloat) - 0.797489, (GLfloat) - 0.388285, (GLfloat) - 0.461786,
+       (GLfloat) - 0.806184, (GLfloat) - 0.357959, (GLfloat) - 0.471096,
+       (GLfloat) - 0.893364, (GLfloat) - 0.424111, (GLfloat) - 0.148429,
+       (GLfloat) - 0.889195, (GLfloat) - 0.434532, (GLfloat) - 0.143226,
+       (GLfloat) - 0.778943, (GLfloat) - 0.605569, (GLfloat) - 0.162894,
+       (GLfloat) - 0.772426, (GLfloat) - 0.614820, (GLfloat) - 0.159231,
+       (GLfloat) - 0.666558, (GLfloat) - 0.549876, (GLfloat) - 0.503327,
+       (GLfloat) - 0.677911, (GLfloat) - 0.530666, (GLfloat) - 0.508753,
+       (GLfloat) - 0.797489, (GLfloat) - 0.388284, (GLfloat) 0.461786,
+       (GLfloat) - 0.806184, (GLfloat) - 0.357959, (GLfloat) 0.471097,
+       (GLfloat) - 0.677911, (GLfloat) - 0.530666, (GLfloat) 0.508753,
+       (GLfloat) - 0.666558, (GLfloat) - 0.549876, (GLfloat) 0.503327,
+       (GLfloat) - 0.778943, (GLfloat) - 0.605569, (GLfloat) 0.162893,
+       (GLfloat) - 0.772426, (GLfloat) - 0.614820, (GLfloat) 0.159231,
+       (GLfloat) - 0.889195, (GLfloat) - 0.434532, (GLfloat) 0.143226,
+       (GLfloat) - 0.893364, (GLfloat) - 0.424111, (GLfloat) 0.148429,
+       (GLfloat) 0.506235, (GLfloat) - 0.837464, (GLfloat) 0.205866,
+       (GLfloat) 0.527758, (GLfloat) - 0.830515, (GLfloat) 0.178091,
+       (GLfloat) 0.492576, (GLfloat) - 0.867532, (GLfloat) 0.068965,
+       (GLfloat) 0.502441, (GLfloat) - 0.861510, (GLfloat) 0.073162,
+       (GLfloat) - 0.106119, (GLfloat) - 0.984780, (GLfloat) 0.137644,
+       (GLfloat) - 0.145376, (GLfloat) - 0.977399, (GLfloat) 0.153482,
+       (GLfloat) 0.021131, (GLfloat) - 0.914284, (GLfloat) 0.404523,
+       (GLfloat) - 0.012401, (GLfloat) - 0.903702, (GLfloat) 0.427982,
+       (GLfloat) 0.527757, (GLfloat) - 0.830515, (GLfloat) - 0.178092,
+       (GLfloat) 0.506235, (GLfloat) - 0.837464, (GLfloat) - 0.205866,
+       (GLfloat) 0.021132, (GLfloat) - 0.914284, (GLfloat) - 0.404523,
+       (GLfloat) - 0.012401, (GLfloat) - 0.903702, (GLfloat) - 0.427983,
+       (GLfloat) - 0.145376, (GLfloat) - 0.977399, (GLfloat) - 0.153482,
+       (GLfloat) - 0.106119, (GLfloat) - 0.984780, (GLfloat) - 0.137645,
+       (GLfloat) 0.502441, (GLfloat) - 0.861510, (GLfloat) - 0.073162,
+       (GLfloat) 0.492576, (GLfloat) - 0.867532, (GLfloat) - 0.068965,
+       (GLfloat) - 0.548436, (GLfloat) - 0.209256, (GLfloat) 0.809586,
+       (GLfloat) - 0.557133, (GLfloat) - 0.173326, (GLfloat) 0.812134,
+       (GLfloat) - 0.281454, (GLfloat) 0.011196, (GLfloat) 0.959509,
+       (GLfloat) - 0.287811, (GLfloat) 0.033884, (GLfloat) 0.957087,
+       (GLfloat) - 0.161493, (GLfloat) - 0.079455, (GLfloat) 0.983670,
+       (GLfloat) - 0.160469, (GLfloat) - 0.081504, (GLfloat) 0.983670,
+       (GLfloat) - 0.417652, (GLfloat) - 0.317957, (GLfloat) 0.851158,
+       (GLfloat) - 0.412553, (GLfloat) - 0.327906, (GLfloat) 0.849869,
+       (GLfloat) 0.183686, (GLfloat) 0.514678, (GLfloat) 0.837476,
+       (GLfloat) 0.191133, (GLfloat) 0.514047, (GLfloat) 0.836196,
+       (GLfloat) 0.305019, (GLfloat) 0.420960, (GLfloat) 0.854258,
+       (GLfloat) 0.309443, (GLfloat) 0.419398, (GLfloat) 0.853434,
+       (GLfloat) 0.070662, (GLfloat) 0.160554, (GLfloat) 0.984494,
+       (GLfloat) 0.072116, (GLfloat) 0.157712, (GLfloat) 0.984848,
+       (GLfloat) - 0.043552, (GLfloat) 0.248570, (GLfloat) 0.967634,
+       (GLfloat) - 0.045553, (GLfloat) 0.254642, (GLfloat) 0.965962,
+       (GLfloat) 0.833765, (GLfloat) - 0.473703, (GLfloat) 0.283620,
+       (GLfloat) 0.823611, (GLfloat) - 0.501937, (GLfloat) 0.264054,
+       (GLfloat) 0.753164, (GLfloat) - 0.577527, (GLfloat) 0.314971,
+       (GLfloat) 0.750976, (GLfloat) - 0.585768, (GLfloat) 0.304813,
+       (GLfloat) 0.524744, (GLfloat) - 0.282162, (GLfloat) 0.803137,
+       (GLfloat) 0.515479, (GLfloat) - 0.259037, (GLfloat) 0.816812,
+       (GLfloat) 0.731077, (GLfloat) - 0.100383, (GLfloat) 0.674870,
+       (GLfloat) 0.725771, (GLfloat) - 0.074391, (GLfloat) 0.683903,
+       (GLfloat) 0.576854, (GLfloat) - 0.777370, (GLfloat) 0.250869,
+       (GLfloat) 0.569572, (GLfloat) - 0.770539, (GLfloat) 0.286108,
+       (GLfloat) 0.204307, (GLfloat) - 0.721596, (GLfloat) 0.661481,
+       (GLfloat) 0.158422, (GLfloat) - 0.717392, (GLfloat) 0.678418,
+       (GLfloat) 0.308874, (GLfloat) - 0.483661, (GLfloat) 0.818944,
+       (GLfloat) 0.351163, (GLfloat) - 0.495655, (GLfloat) 0.794362,
+       (GLfloat) 0.653090, (GLfloat) - 0.688670, (GLfloat) 0.314971,
+       (GLfloat) 0.661058, (GLfloat) - 0.685633, (GLfloat) 0.304812,
+       (GLfloat) 0.403257, (GLfloat) 0.770775, (GLfloat) 0.493244,
+       (GLfloat) 0.393266, (GLfloat) 0.772882, (GLfloat) 0.497991,
+       (GLfloat) 0.471763, (GLfloat) 0.867363, (GLfloat) 0.158497,
+       (GLfloat) 0.475196, (GLfloat) 0.865916, (GLfloat) 0.156134,
+       (GLfloat) 0.590364, (GLfloat) 0.790041, (GLfloat) 0.165246,
+       (GLfloat) 0.597402, (GLfloat) 0.785461, (GLfloat) 0.161746,
+       (GLfloat) 0.528711, (GLfloat) 0.679696, (GLfloat) 0.508407,
+       (GLfloat) 0.514728, (GLfloat) 0.686399, (GLfloat) 0.513723,
+       (GLfloat) 0.403257, (GLfloat) 0.770775, (GLfloat) - 0.493244,
+       (GLfloat) 0.393266, (GLfloat) 0.772882, (GLfloat) - 0.497991,
+       (GLfloat) 0.514728, (GLfloat) 0.686399, (GLfloat) - 0.513723,
+       (GLfloat) 0.528711, (GLfloat) 0.679696, (GLfloat) - 0.508407,
+       (GLfloat) 0.590364, (GLfloat) 0.790041, (GLfloat) - 0.165246,
+       (GLfloat) 0.597402, (GLfloat) 0.785461, (GLfloat) - 0.161746,
+       (GLfloat) 0.475196, (GLfloat) 0.865916, (GLfloat) - 0.156134,
+       (GLfloat) 0.471763, (GLfloat) 0.867363, (GLfloat) - 0.158497,
+       (GLfloat) 0.885792, (GLfloat) - 0.415923, (GLfloat) - 0.205866,
+       (GLfloat) 0.881131, (GLfloat) - 0.438054, (GLfloat) - 0.178091,
+       (GLfloat) 0.914268, (GLfloat) - 0.399196, (GLfloat) - 0.068966,
+       (GLfloat) 0.909310, (GLfloat) - 0.409637, (GLfloat) - 0.073163,
+       (GLfloat) 0.961663, (GLfloat) 0.236259, (GLfloat) - 0.139234,
+       (GLfloat) 0.949193, (GLfloat) 0.273441, (GLfloat) - 0.155762,
+       (GLfloat) 0.901801, (GLfloat) 0.090517, (GLfloat) - 0.422565,
+       (GLfloat) 0.894672, (GLfloat) 0.141897, (GLfloat) - 0.423589,
+       (GLfloat) 0.881131, (GLfloat) - 0.438054, (GLfloat) 0.178091,
+       (GLfloat) 0.885792, (GLfloat) - 0.415923, (GLfloat) 0.205866,
+       (GLfloat) 0.894672, (GLfloat) 0.141897, (GLfloat) 0.423589,
+       (GLfloat) 0.901801, (GLfloat) 0.090518, (GLfloat) 0.422565,
+       (GLfloat) 0.949193, (GLfloat) 0.273441, (GLfloat) 0.155762,
+       (GLfloat) 0.961663, (GLfloat) 0.236259, (GLfloat) 0.139234,
+       (GLfloat) 0.909310, (GLfloat) - 0.409637, (GLfloat) 0.073163,
+       (GLfloat) 0.914268, (GLfloat) - 0.399196, (GLfloat) 0.068966,
+       (GLfloat) 0.191133, (GLfloat) 0.514047, (GLfloat) - 0.836196,
+       (GLfloat) 0.183686, (GLfloat) 0.514678, (GLfloat) - 0.837476,
+       (GLfloat) - 0.045553, (GLfloat) 0.254642, (GLfloat) - 0.965962,
+       (GLfloat) - 0.043552, (GLfloat) 0.248570, (GLfloat) - 0.967634,
+       (GLfloat) 0.070662, (GLfloat) 0.160554, (GLfloat) - 0.984494,
+       (GLfloat) 0.072116, (GLfloat) 0.157712, (GLfloat) - 0.984848,
+       (GLfloat) 0.305019, (GLfloat) 0.420960, (GLfloat) - 0.854258,
+       (GLfloat) 0.309443, (GLfloat) 0.419398, (GLfloat) - 0.853434,
+       (GLfloat) - 0.557133, (GLfloat) - 0.173326, (GLfloat) - 0.812134,
+       (GLfloat) - 0.548436, (GLfloat) - 0.209256, (GLfloat) - 0.809586,
+       (GLfloat) - 0.417652, (GLfloat) - 0.317957, (GLfloat) - 0.851158,
+       (GLfloat) - 0.412553, (GLfloat) - 0.327906, (GLfloat) - 0.849869,
+       (GLfloat) - 0.160469, (GLfloat) - 0.081504, (GLfloat) - 0.983670,
+       (GLfloat) - 0.161493, (GLfloat) - 0.079455, (GLfloat) - 0.983670,
+       (GLfloat) - 0.281454, (GLfloat) 0.011196, (GLfloat) - 0.959509,
+       (GLfloat) - 0.287811, (GLfloat) 0.033884, (GLfloat) - 0.957088,
+       (GLfloat) 0.576854, (GLfloat) - 0.777370, (GLfloat) - 0.250869,
+       (GLfloat) 0.569572, (GLfloat) - 0.770539, (GLfloat) - 0.286108,
+       (GLfloat) 0.653090, (GLfloat) - 0.688670, (GLfloat) - 0.314971,
+       (GLfloat) 0.661058, (GLfloat) - 0.685633, (GLfloat) - 0.304812,
+       (GLfloat) 0.351164, (GLfloat) - 0.495655, (GLfloat) - 0.794362,
+       (GLfloat) 0.308874, (GLfloat) - 0.483661, (GLfloat) - 0.818944,
+       (GLfloat) 0.204308, (GLfloat) - 0.721597, (GLfloat) - 0.661480,
+       (GLfloat) 0.158422, (GLfloat) - 0.717393, (GLfloat) - 0.678418,
+       (GLfloat) 0.823611, (GLfloat) - 0.501936, (GLfloat) - 0.264055,
+       (GLfloat) 0.833765, (GLfloat) - 0.473703, (GLfloat) - 0.283621,
+       (GLfloat) 0.731077, (GLfloat) - 0.100384, (GLfloat) - 0.674869,
+       (GLfloat) 0.725771, (GLfloat) - 0.074392, (GLfloat) - 0.683902,
+       (GLfloat) 0.515479, (GLfloat) - 0.259037, (GLfloat) - 0.816812,
+       (GLfloat) 0.524744, (GLfloat) - 0.282163, (GLfloat) - 0.803136,
+       (GLfloat) 0.753164, (GLfloat) - 0.577527, (GLfloat) - 0.314971,
+       (GLfloat) 0.750976, (GLfloat) - 0.585768, (GLfloat) - 0.304813,
+       (GLfloat) 0.639601, (GLfloat) - 0.758638, (GLfloat) 0.124011,
+       (GLfloat) 0.647491, (GLfloat) - 0.749875, (GLfloat) 0.135802,
+       (GLfloat) 0.708617, (GLfloat) - 0.697026, (GLfloat) 0.109621,
+       (GLfloat) 0.711116, (GLfloat) - 0.693654, (GLfloat) 0.114709,
+       (GLfloat) 0.722217, (GLfloat) - 0.690875, (GLfloat) 0.033080,
+       (GLfloat) 0.720265, (GLfloat) - 0.693043, (GLfloat) 0.030163,
+       (GLfloat) 0.664597, (GLfloat) - 0.745915, (GLfloat) 0.043834,
+       (GLfloat) 0.660896, (GLfloat) - 0.749429, (GLfloat) 0.039656,
+       (GLfloat) 0.813450, (GLfloat) - 0.565559, (GLfloat) 0.135803,
+       (GLfloat) 0.821340, (GLfloat) - 0.556796, (GLfloat) 0.124011,
+       (GLfloat) 0.811298, (GLfloat) - 0.582987, (GLfloat) 0.043835,
+       (GLfloat) 0.814407, (GLfloat) - 0.578938, (GLfloat) 0.039656,
+       (GLfloat) 0.764534, (GLfloat) - 0.643877, (GLfloat) 0.030163,
+       (GLfloat) 0.762583, (GLfloat) - 0.646044, (GLfloat) 0.033079,
+       (GLfloat) 0.767278, (GLfloat) - 0.631876, (GLfloat) 0.109621,
+       (GLfloat) 0.764186, (GLfloat) - 0.634714, (GLfloat) 0.114709,
+       (GLfloat) 0.821340, (GLfloat) - 0.556796, (GLfloat) - 0.124011,
+       (GLfloat) 0.813450, (GLfloat) - 0.565559, (GLfloat) - 0.135803,
+       (GLfloat) 0.767278, (GLfloat) - 0.631876, (GLfloat) - 0.109621,
+       (GLfloat) 0.764186, (GLfloat) - 0.634714, (GLfloat) - 0.114709,
+       (GLfloat) 0.762583, (GLfloat) - 0.646044, (GLfloat) - 0.033079,
+       (GLfloat) 0.764534, (GLfloat) - 0.643877, (GLfloat) - 0.030163,
+       (GLfloat) 0.811298, (GLfloat) - 0.582987, (GLfloat) - 0.043835,
+       (GLfloat) 0.814407, (GLfloat) - 0.578938, (GLfloat) - 0.039656,
+       (GLfloat) 0.647491, (GLfloat) - 0.749875, (GLfloat) - 0.135802,
+       (GLfloat) 0.639601, (GLfloat) - 0.758638, (GLfloat) - 0.124011,
+       (GLfloat) 0.664597, (GLfloat) - 0.745915, (GLfloat) - 0.043834,
+       (GLfloat) 0.660896, (GLfloat) - 0.749429, (GLfloat) - 0.039656,
+       (GLfloat) 0.720265, (GLfloat) - 0.693043, (GLfloat) - 0.030163,
+       (GLfloat) 0.722217, (GLfloat) - 0.690875, (GLfloat) - 0.033080,
+       (GLfloat) 0.708617, (GLfloat) - 0.697026, (GLfloat) - 0.109621,
+       (GLfloat) 0.711116, (GLfloat) - 0.693654, (GLfloat) - 0.114709,
+       (GLfloat) - 0.795834, (GLfloat) - 0.416890, (GLfloat) - 0.439148,
+       (GLfloat) - 0.804928, (GLfloat) - 0.376107, (GLfloat) - 0.458949,
+       (GLfloat) - 0.777496, (GLfloat) - 0.478056, (GLfloat) - 0.408610,
+       (GLfloat) - 0.791178, (GLfloat) - 0.423850, (GLfloat) - 0.440894,
+       (GLfloat) - 0.871703, (GLfloat) - 0.470947, (GLfloat) - 0.135440,
+       (GLfloat) - 0.863971, (GLfloat) - 0.488878, (GLfloat) - 0.120637,
+       (GLfloat) - 0.890766, (GLfloat) - 0.431382, (GLfloat) - 0.142987,
+       (GLfloat) - 0.885536, (GLfloat) - 0.445027, (GLfloat) - 0.133330,
+       (GLfloat) - 0.626883, (GLfloat) - 0.701314, (GLfloat) - 0.339376,
+       (GLfloat) - 0.543140, (GLfloat) - 0.727904, (GLfloat) - 0.418515,
+       (GLfloat) - 0.684101, (GLfloat) - 0.722860, (GLfloat) - 0.097361,
+       (GLfloat) - 0.656897, (GLfloat) - 0.743919, (GLfloat) - 0.122761,
+       (GLfloat) - 0.823965, (GLfloat) - 0.552405, (GLfloat) - 0.126218,
+       (GLfloat) - 0.810821, (GLfloat) - 0.575485, (GLfloat) - 0.106707,
+       (GLfloat) - 0.722436, (GLfloat) - 0.581233, (GLfloat) - 0.374506,
+       (GLfloat) - 0.749781, (GLfloat) - 0.512777, (GLfloat) - 0.418197,
+       (GLfloat) - 0.543140, (GLfloat) - 0.727904, (GLfloat) 0.418515,
+       (GLfloat) - 0.626883, (GLfloat) - 0.701314, (GLfloat) 0.339376,
+       (GLfloat) - 0.749781, (GLfloat) - 0.512777, (GLfloat) 0.418197,
+       (GLfloat) - 0.722436, (GLfloat) - 0.581233, (GLfloat) 0.374506,
+       (GLfloat) - 0.823965, (GLfloat) - 0.552405, (GLfloat) 0.126218,
+       (GLfloat) - 0.810821, (GLfloat) - 0.575485, (GLfloat) 0.106707,
+       (GLfloat) - 0.684101, (GLfloat) - 0.722860, (GLfloat) 0.097361,
+       (GLfloat) - 0.656897, (GLfloat) - 0.743919, (GLfloat) 0.122761,
+       (GLfloat) - 0.804928, (GLfloat) - 0.376106, (GLfloat) 0.458949,
+       (GLfloat) - 0.795834, (GLfloat) - 0.416890, (GLfloat) 0.439148,
+       (GLfloat) - 0.890766, (GLfloat) - 0.431382, (GLfloat) 0.142986,
+       (GLfloat) - 0.885536, (GLfloat) - 0.445027, (GLfloat) 0.133330,
+       (GLfloat) - 0.863971, (GLfloat) - 0.488878, (GLfloat) 0.120637,
+       (GLfloat) - 0.871703, (GLfloat) - 0.470947, (GLfloat) 0.135440,
+       (GLfloat) - 0.777496, (GLfloat) - 0.478056, (GLfloat) 0.408610,
+       (GLfloat) - 0.791178, (GLfloat) - 0.423850, (GLfloat) 0.440894,
+       (GLfloat) 0.229002, (GLfloat) 0.499702, (GLfloat) - 0.835378,
+       (GLfloat) 0.231853, (GLfloat) 0.486589, (GLfloat) - 0.842304,
+       (GLfloat) 0.233876, (GLfloat) 0.516110, (GLfloat) - 0.823973,
+       (GLfloat) 0.237238, (GLfloat) 0.494666, (GLfloat) - 0.836076,
+       (GLfloat) 0.010383, (GLfloat) 0.206054, (GLfloat) - 0.978486,
+       (GLfloat) 0.010515, (GLfloat) 0.204402, (GLfloat) - 0.978831,
+       (GLfloat) - 0.008079, (GLfloat) 0.222043, (GLfloat) - 0.975003,
+       (GLfloat) - 0.007459, (GLfloat) 0.217610, (GLfloat) - 0.976007,
+       (GLfloat) 0.144536, (GLfloat) 0.600180, (GLfloat) - 0.786698,
+       (GLfloat) 0.157013, (GLfloat) 0.570113, (GLfloat) - 0.806423,
+       (GLfloat) 0.037521, (GLfloat) 0.196979, (GLfloat) - 0.979689,
+       (GLfloat) 0.033902, (GLfloat) 0.207800, (GLfloat) - 0.977584,
+       (GLfloat) 0.024105, (GLfloat) 0.197695, (GLfloat) - 0.979967,
+       (GLfloat) 0.023654, (GLfloat) 0.201010, (GLfloat) - 0.979303,
+       (GLfloat) 0.210423, (GLfloat) 0.553707, (GLfloat) - 0.805687,
+       (GLfloat) 0.216765, (GLfloat) 0.524423, (GLfloat) - 0.823404,
+       (GLfloat) - 0.387850, (GLfloat) - 0.484551, (GLfloat) - 0.784081,
+       (GLfloat) - 0.344102, (GLfloat) - 0.564354, (GLfloat) - 0.750399,
+       (GLfloat) - 0.507279, (GLfloat) - 0.348613, (GLfloat) - 0.788123,
+       (GLfloat) - 0.488679, (GLfloat) - 0.433878, (GLfloat) - 0.756930,
+       (GLfloat) - 0.209869, (GLfloat) - 0.143196, (GLfloat) - 0.967187,
+       (GLfloat) - 0.216489, (GLfloat) - 0.097461, (GLfloat) - 0.971408,
+       (GLfloat) - 0.125932, (GLfloat) - 0.202782, (GLfloat) - 0.971092,
+       (GLfloat) - 0.140256, (GLfloat) - 0.165750, (GLfloat) - 0.976143,
+       (GLfloat) - 0.549569, (GLfloat) - 0.208003, (GLfloat) - 0.809141,
+       (GLfloat) - 0.543770, (GLfloat) - 0.257592, (GLfloat) - 0.798724,
+       (GLfloat) - 0.260213, (GLfloat) - 0.033756, (GLfloat) - 0.964961,
+       (GLfloat) - 0.263665, (GLfloat) - 0.004051, (GLfloat) - 0.964606,
+       (GLfloat) - 0.243217, (GLfloat) - 0.082726, (GLfloat) - 0.966438,
+       (GLfloat) - 0.245939, (GLfloat) - 0.044154, (GLfloat) - 0.968279,
+       (GLfloat) - 0.539327, (GLfloat) - 0.261873, (GLfloat) - 0.800343,
+       (GLfloat) - 0.532344, (GLfloat) - 0.329385, (GLfloat) - 0.779818,
+       (GLfloat) 0.231853, (GLfloat) 0.486589, (GLfloat) 0.842304,
+       (GLfloat) 0.229002, (GLfloat) 0.499702, (GLfloat) 0.835378,
+       (GLfloat) - 0.008079, (GLfloat) 0.222044, (GLfloat) 0.975003,
+       (GLfloat) - 0.007460, (GLfloat) 0.217609, (GLfloat) 0.976008,
+       (GLfloat) 0.010515, (GLfloat) 0.204402, (GLfloat) 0.978830,
+       (GLfloat) 0.010383, (GLfloat) 0.206054, (GLfloat) 0.978486,
+       (GLfloat) 0.233876, (GLfloat) 0.516110, (GLfloat) 0.823973,
+       (GLfloat) 0.237238, (GLfloat) 0.494666, (GLfloat) 0.836076,
+       (GLfloat) - 0.549569, (GLfloat) - 0.208003, (GLfloat) 0.809141,
+       (GLfloat) - 0.543770, (GLfloat) - 0.257592, (GLfloat) 0.798724,
+       (GLfloat) - 0.532344, (GLfloat) - 0.329384, (GLfloat) 0.779818,
+       (GLfloat) - 0.539327, (GLfloat) - 0.261873, (GLfloat) 0.800343,
+       (GLfloat) - 0.243217, (GLfloat) - 0.082726, (GLfloat) 0.966438,
+       (GLfloat) - 0.245939, (GLfloat) - 0.044154, (GLfloat) 0.968279,
+       (GLfloat) - 0.263665, (GLfloat) - 0.004051, (GLfloat) 0.964606,
+       (GLfloat) - 0.260214, (GLfloat) - 0.033755, (GLfloat) 0.964961,
+       (GLfloat) - 0.344101, (GLfloat) - 0.564354, (GLfloat) 0.750399,
+       (GLfloat) - 0.387850, (GLfloat) - 0.484551, (GLfloat) 0.784081,
+       (GLfloat) - 0.125932, (GLfloat) - 0.202782, (GLfloat) 0.971093,
+       (GLfloat) - 0.140255, (GLfloat) - 0.165749, (GLfloat) 0.976143,
+       (GLfloat) - 0.216489, (GLfloat) - 0.097462, (GLfloat) 0.971408,
+       (GLfloat) - 0.209869, (GLfloat) - 0.143196, (GLfloat) 0.967187,
+       (GLfloat) - 0.507278, (GLfloat) - 0.348612, (GLfloat) 0.788123,
+       (GLfloat) - 0.488678, (GLfloat) - 0.433878, (GLfloat) 0.756930,
+       (GLfloat) 0.144536, (GLfloat) 0.600181, (GLfloat) 0.786697,
+       (GLfloat) 0.157013, (GLfloat) 0.570113, (GLfloat) 0.806423,
+       (GLfloat) 0.216765, (GLfloat) 0.524422, (GLfloat) 0.823404,
+       (GLfloat) 0.210423, (GLfloat) 0.553707, (GLfloat) 0.805687,
+       (GLfloat) 0.024105, (GLfloat) 0.197695, (GLfloat) 0.979967,
+       (GLfloat) 0.023654, (GLfloat) 0.201010, (GLfloat) 0.979304,
+       (GLfloat) 0.033902, (GLfloat) 0.207800, (GLfloat) 0.977584,
+       (GLfloat) 0.037522, (GLfloat) 0.196978, (GLfloat) 0.979690,
+       (GLfloat) 0.429831, (GLfloat) 0.754772, (GLfloat) - 0.495545,
+       (GLfloat) 0.445178, (GLfloat) 0.753116, (GLfloat) - 0.484389,
+       (GLfloat) 0.504382, (GLfloat) 0.849100, (GLfloat) - 0.156932,
+       (GLfloat) 0.509098, (GLfloat) 0.847167, (GLfloat) - 0.152075,
+       (GLfloat) 0.473721, (GLfloat) 0.868820, (GLfloat) - 0.144012,
+       (GLfloat) 0.467781, (GLfloat) 0.870761, (GLfloat) - 0.151512,
+       (GLfloat) 0.426275, (GLfloat) 0.776501, (GLfloat) - 0.464043,
+       (GLfloat) 0.405841, (GLfloat) 0.776082, (GLfloat) - 0.482690,
+       (GLfloat) 0.445178, (GLfloat) 0.753116, (GLfloat) 0.484389,
+       (GLfloat) 0.429830, (GLfloat) 0.754772, (GLfloat) 0.495545,
+       (GLfloat) 0.426275, (GLfloat) 0.776501, (GLfloat) 0.464043,
+       (GLfloat) 0.405841, (GLfloat) 0.776082, (GLfloat) 0.482690,
+       (GLfloat) 0.467781, (GLfloat) 0.870761, (GLfloat) 0.151512,
+       (GLfloat) 0.473721, (GLfloat) 0.868820, (GLfloat) 0.144012,
+       (GLfloat) 0.504382, (GLfloat) 0.849100, (GLfloat) 0.156932,
+       (GLfloat) 0.509098, (GLfloat) 0.847167, (GLfloat) 0.152075,
+       (GLfloat) 0.229278, (GLfloat) 0.880155, (GLfloat) 0.415643,
+       (GLfloat) 0.209637, (GLfloat) 0.873049, (GLfloat) 0.440270,
+       (GLfloat) 0.229791, (GLfloat) 0.963838, (GLfloat) 0.134951,
+       (GLfloat) 0.235661, (GLfloat) 0.963590, (GLfloat) 0.126323,
+       (GLfloat) 0.380317, (GLfloat) 0.913635, (GLfloat) 0.143628,
+       (GLfloat) 0.386968, (GLfloat) 0.912260, (GLfloat) 0.134303,
+       (GLfloat) 0.360099, (GLfloat) 0.823680, (GLfloat) 0.438041,
+       (GLfloat) 0.336980, (GLfloat) 0.819830, (GLfloat) 0.462950,
+       (GLfloat) 0.229278, (GLfloat) 0.880155, (GLfloat) - 0.415643,
+       (GLfloat) 0.209637, (GLfloat) 0.873049, (GLfloat) - 0.440270,
+       (GLfloat) 0.336980, (GLfloat) 0.819830, (GLfloat) - 0.462951,
+       (GLfloat) 0.360099, (GLfloat) 0.823680, (GLfloat) - 0.438041,
+       (GLfloat) 0.380318, (GLfloat) 0.913635, (GLfloat) - 0.143628,
+       (GLfloat) 0.386968, (GLfloat) 0.912260, (GLfloat) - 0.134303,
+       (GLfloat) 0.235661, (GLfloat) 0.963590, (GLfloat) - 0.126323,
+       (GLfloat) 0.229791, (GLfloat) 0.963838, (GLfloat) - 0.134951,
+       (GLfloat) - 0.140641, (GLfloat) 0.581880, (GLfloat) - 0.801022,
+       (GLfloat) - 0.142183, (GLfloat) 0.582121, (GLfloat) - 0.800574,
+       (GLfloat) 0.051917, (GLfloat) 0.273318, (GLfloat) - 0.960522,
+       (GLfloat) 0.034217, (GLfloat) 0.274901, (GLfloat) - 0.960864,
+       (GLfloat) 0.048940, (GLfloat) 0.249448, (GLfloat) - 0.967151,
+       (GLfloat) 0.029460, (GLfloat) 0.256714, (GLfloat) - 0.966038,
+       (GLfloat) - 0.118911, (GLfloat) 0.595461, (GLfloat) - 0.794536,
+       (GLfloat) - 0.119035, (GLfloat) 0.595511, (GLfloat) - 0.794479,
+       (GLfloat) 0.515773, (GLfloat) - 0.229138, (GLfloat) - 0.825515,
+       (GLfloat) 0.492630, (GLfloat) - 0.312368, (GLfloat) - 0.812245,
+       (GLfloat) 0.432249, (GLfloat) - 0.426645, (GLfloat) - 0.794440,
+       (GLfloat) 0.467347, (GLfloat) - 0.336981, (GLfloat) - 0.817332,
+       (GLfloat) 0.202207, (GLfloat) - 0.074217, (GLfloat) - 0.976526,
+       (GLfloat) 0.254570, (GLfloat) - 0.084963, (GLfloat) - 0.963315,
+       (GLfloat) 0.231800, (GLfloat) - 0.012060, (GLfloat) - 0.972689,
+       (GLfloat) 0.278802, (GLfloat) - 0.009127, (GLfloat) - 0.960305,
+       (GLfloat) 0.001969, (GLfloat) - 0.610219, (GLfloat) - 0.792230,
+       (GLfloat) 0.016464, (GLfloat) - 0.619478, (GLfloat) - 0.784841,
+       (GLfloat) 0.038477, (GLfloat) - 0.206205, (GLfloat) - 0.977752,
+       (GLfloat) 0.042684, (GLfloat) - 0.210618, (GLfloat) - 0.976636,
+       (GLfloat) 0.147830, (GLfloat) - 0.145929, (GLfloat) - 0.978188,
+       (GLfloat) 0.187657, (GLfloat) - 0.166867, (GLfloat) - 0.967957,
+       (GLfloat) 0.332157, (GLfloat) - 0.490109, (GLfloat) - 0.805894,
+       (GLfloat) 0.291047, (GLfloat) - 0.549638, (GLfloat) - 0.783064,
+       (GLfloat) 0.018324, (GLfloat) 0.624772, (GLfloat) - 0.780593,
+       (GLfloat) 0.031411, (GLfloat) 0.609093, (GLfloat) - 0.792477,
+       (GLfloat) - 0.068754, (GLfloat) 0.615108, (GLfloat) - 0.785439,
+       (GLfloat) - 0.063190, (GLfloat) 0.611137, (GLfloat) - 0.788999,
+       (GLfloat) 0.050001, (GLfloat) 0.227113, (GLfloat) - 0.972584,
+       (GLfloat) 0.031314, (GLfloat) 0.240630, (GLfloat) - 0.970112,
+       (GLfloat) 0.046887, (GLfloat) 0.207201, (GLfloat) - 0.977174,
+       (GLfloat) 0.034344, (GLfloat) 0.223544, (GLfloat) - 0.974089,
+       (GLfloat) - 0.289358, (GLfloat) 0.846699, (GLfloat) - 0.446512,
+       (GLfloat) - 0.282981, (GLfloat) 0.846581, (GLfloat) - 0.450803,
+       (GLfloat) - 0.237609, (GLfloat) 0.869708, (GLfloat) - 0.432607,
+       (GLfloat) - 0.232787, (GLfloat) 0.868834, (GLfloat) - 0.436964,
+       (GLfloat) - 0.269102, (GLfloat) 0.953677, (GLfloat) - 0.134480,
+       (GLfloat) - 0.270832, (GLfloat) 0.953476, (GLfloat) - 0.132414,
+       (GLfloat) - 0.330792, (GLfloat) 0.933242, (GLfloat) - 0.140129,
+       (GLfloat) - 0.333075, (GLfloat) 0.932754, (GLfloat) - 0.137953,
+       (GLfloat) 0.010415, (GLfloat) 0.905793, (GLfloat) - 0.423593,
+       (GLfloat) 0.002305, (GLfloat) 0.910958, (GLfloat) - 0.412492,
+       (GLfloat) - 0.003726, (GLfloat) 0.991671, (GLfloat) - 0.128743,
+       (GLfloat) - 0.001231, (GLfloat) 0.992167, (GLfloat) - 0.124913,
+       (GLfloat) - 0.164759, (GLfloat) 0.977931, (GLfloat) - 0.128473,
+       (GLfloat) - 0.164919, (GLfloat) 0.977933, (GLfloat) - 0.128255,
+       (GLfloat) - 0.141914, (GLfloat) 0.895522, (GLfloat) - 0.421783,
+       (GLfloat) - 0.142144, (GLfloat) 0.895607, (GLfloat) - 0.421525,
+       (GLfloat) 0.010415, (GLfloat) 0.905793, (GLfloat) 0.423593,
+       (GLfloat) 0.002305, (GLfloat) 0.910958, (GLfloat) 0.412492,
+       (GLfloat) - 0.142144, (GLfloat) 0.895607, (GLfloat) 0.421525,
+       (GLfloat) - 0.141914, (GLfloat) 0.895522, (GLfloat) 0.421783,
+       (GLfloat) - 0.164759, (GLfloat) 0.977931, (GLfloat) 0.128473,
+       (GLfloat) - 0.164919, (GLfloat) 0.977933, (GLfloat) 0.128255,
+       (GLfloat) - 0.003726, (GLfloat) 0.991671, (GLfloat) 0.128743,
+       (GLfloat) - 0.001231, (GLfloat) 0.992167, (GLfloat) 0.124913,
+       (GLfloat) - 0.282980, (GLfloat) 0.846581, (GLfloat) 0.450803,
+       (GLfloat) - 0.289358, (GLfloat) 0.846699, (GLfloat) 0.446512,
+       (GLfloat) - 0.330792, (GLfloat) 0.933242, (GLfloat) 0.140129,
+       (GLfloat) - 0.333075, (GLfloat) 0.932754, (GLfloat) 0.137953,
+       (GLfloat) - 0.270832, (GLfloat) 0.953476, (GLfloat) 0.132414,
+       (GLfloat) - 0.269102, (GLfloat) 0.953677, (GLfloat) 0.134480,
+       (GLfloat) - 0.237609, (GLfloat) 0.869708, (GLfloat) 0.432607,
+       (GLfloat) - 0.232787, (GLfloat) 0.868834, (GLfloat) 0.436964,
+       (GLfloat) - 0.140641, (GLfloat) 0.581880, (GLfloat) 0.801022,
+       (GLfloat) - 0.142183, (GLfloat) 0.582121, (GLfloat) 0.800574,
+       (GLfloat) - 0.119034, (GLfloat) 0.595511, (GLfloat) 0.794479,
+       (GLfloat) - 0.118911, (GLfloat) 0.595461, (GLfloat) 0.794536,
+       (GLfloat) 0.048939, (GLfloat) 0.249448, (GLfloat) 0.967151,
+       (GLfloat) 0.029461, (GLfloat) 0.256714, (GLfloat) 0.966038,
+       (GLfloat) 0.034217, (GLfloat) 0.274901, (GLfloat) 0.960863,
+       (GLfloat) 0.051918, (GLfloat) 0.273319, (GLfloat) 0.960521,
+       (GLfloat) 0.031411, (GLfloat) 0.609093, (GLfloat) 0.792477,
+       (GLfloat) 0.018324, (GLfloat) 0.624772, (GLfloat) 0.780593,
+       (GLfloat) 0.046887, (GLfloat) 0.207200, (GLfloat) 0.977174,
+       (GLfloat) 0.034344, (GLfloat) 0.223543, (GLfloat) 0.974089,
+       (GLfloat) 0.031314, (GLfloat) 0.240631, (GLfloat) 0.970111,
+       (GLfloat) 0.050002, (GLfloat) 0.227113, (GLfloat) 0.972584,
+       (GLfloat) - 0.068754, (GLfloat) 0.615108, (GLfloat) 0.785440,
+       (GLfloat) - 0.063191, (GLfloat) 0.611137, (GLfloat) 0.788999,
+       (GLfloat) 0.001969, (GLfloat) - 0.610219, (GLfloat) 0.792230,
+       (GLfloat) 0.016464, (GLfloat) - 0.619478, (GLfloat) 0.784841,
+       (GLfloat) 0.332157, (GLfloat) - 0.490109, (GLfloat) 0.805894,
+       (GLfloat) 0.291047, (GLfloat) - 0.549638, (GLfloat) 0.783064,
+       (GLfloat) 0.147831, (GLfloat) - 0.145929, (GLfloat) 0.978188,
+       (GLfloat) 0.187656, (GLfloat) - 0.166866, (GLfloat) 0.967957,
+       (GLfloat) 0.042684, (GLfloat) - 0.210618, (GLfloat) 0.976636,
+       (GLfloat) 0.038477, (GLfloat) - 0.206204, (GLfloat) 0.977752,
+       (GLfloat) 0.515773, (GLfloat) - 0.229138, (GLfloat) 0.825515,
+       (GLfloat) 0.492630, (GLfloat) - 0.312368, (GLfloat) 0.812245,
+       (GLfloat) 0.231801, (GLfloat) - 0.012059, (GLfloat) 0.972689,
+       (GLfloat) 0.278802, (GLfloat) - 0.009127, (GLfloat) 0.960305,
+       (GLfloat) 0.254571, (GLfloat) - 0.084963, (GLfloat) 0.963315,
+       (GLfloat) 0.202207, (GLfloat) - 0.074217, (GLfloat) 0.976527,
+       (GLfloat) 0.467347, (GLfloat) - 0.336981, (GLfloat) 0.817332,
+       (GLfloat) 0.432250, (GLfloat) - 0.426645, (GLfloat) 0.794440,
+       (GLfloat) 0.731946, (GLfloat) - 0.508941, (GLfloat) 0.453029,
+       (GLfloat) 0.760718, (GLfloat) - 0.438585, (GLfloat) 0.478489,
+       (GLfloat) 0.696013, (GLfloat) - 0.585025, (GLfloat) 0.416308,
+       (GLfloat) 0.630794, (GLfloat) - 0.620580, (GLfloat) 0.465810,
+       (GLfloat) 0.757142, (GLfloat) - 0.637420, (GLfloat) 0.142942,
+       (GLfloat) 0.737097, (GLfloat) - 0.663598, (GLfloat) 0.127771,
+       (GLfloat) 0.847507, (GLfloat) - 0.509047, (GLfloat) 0.150342,
+       (GLfloat) 0.834151, (GLfloat) - 0.533962, (GLfloat) 0.138115,
+       (GLfloat) - 0.068175, (GLfloat) - 0.903325, (GLfloat) 0.423504,
+       (GLfloat) - 0.038664, (GLfloat) - 0.911816, (GLfloat) 0.408775,
+       (GLfloat) - 0.102320, (GLfloat) - 0.986404, (GLfloat) 0.128602,
+       (GLfloat) - 0.086898, (GLfloat) - 0.988753, (GLfloat) 0.121719,
+       (GLfloat) 0.488656, (GLfloat) - 0.861887, (GLfloat) 0.135524,
+       (GLfloat) 0.510932, (GLfloat) - 0.850761, (GLfloat) 0.123102,
+       (GLfloat) 0.415769, (GLfloat) - 0.794938, (GLfloat) 0.441826,
+       (GLfloat) 0.471036, (GLfloat) - 0.782278, (GLfloat) 0.407634,
+       (GLfloat) - 0.038664, (GLfloat) - 0.911816, (GLfloat) - 0.408775,
+       (GLfloat) - 0.068174, (GLfloat) - 0.903325, (GLfloat) - 0.423504,
+       (GLfloat) 0.415769, (GLfloat) - 0.794938, (GLfloat) - 0.441826,
+       (GLfloat) 0.471037, (GLfloat) - 0.782278, (GLfloat) - 0.407634,
+       (GLfloat) 0.510932, (GLfloat) - 0.850761, (GLfloat) - 0.123102,
+       (GLfloat) 0.488656, (GLfloat) - 0.861887, (GLfloat) - 0.135524,
+       (GLfloat) - 0.102320, (GLfloat) - 0.986404, (GLfloat) - 0.128602,
+       (GLfloat) - 0.086898, (GLfloat) - 0.988753, (GLfloat) - 0.121719,
+       (GLfloat) 0.760718, (GLfloat) - 0.438585, (GLfloat) - 0.478489,
+       (GLfloat) 0.731946, (GLfloat) - 0.508941, (GLfloat) - 0.453029,
+       (GLfloat) 0.847507, (GLfloat) - 0.509047, (GLfloat) - 0.150343,
+       (GLfloat) 0.834151, (GLfloat) - 0.533962, (GLfloat) - 0.138115,
+       (GLfloat) 0.737097, (GLfloat) - 0.663599, (GLfloat) - 0.127771,
+       (GLfloat) 0.757142, (GLfloat) - 0.637420, (GLfloat) - 0.142942,
+       (GLfloat) 0.630794, (GLfloat) - 0.620580, (GLfloat) - 0.465810,
+       (GLfloat) 0.696012, (GLfloat) - 0.585025, (GLfloat) - 0.416309,
+       (GLfloat) 0.774435, (GLfloat) - 0.417338, (GLfloat) 0.475479,
+       (GLfloat) 0.793442, (GLfloat) - 0.363272, (GLfloat) 0.488348,
+       (GLfloat) 0.884471, (GLfloat) - 0.440088, (GLfloat) 0.155030,
+       (GLfloat) 0.875885, (GLfloat) - 0.459272, (GLfloat) 0.147967,
+       (GLfloat) 0.768156, (GLfloat) - 0.618465, (GLfloat) 0.165642,
+       (GLfloat) 0.757446, (GLfloat) - 0.632850, (GLfloat) 0.160551,
+       (GLfloat) 0.645602, (GLfloat) - 0.572394, (GLfloat) 0.505533,
+       (GLfloat) 0.663605, (GLfloat) - 0.543212, (GLfloat) 0.514343,
+       (GLfloat) 0.774435, (GLfloat) - 0.417338, (GLfloat) - 0.475479,
+       (GLfloat) 0.793442, (GLfloat) - 0.363271, (GLfloat) - 0.488348,
+       (GLfloat) 0.663604, (GLfloat) - 0.543213, (GLfloat) - 0.514343,
+       (GLfloat) 0.645602, (GLfloat) - 0.572394, (GLfloat) - 0.505533,
+       (GLfloat) 0.768156, (GLfloat) - 0.618465, (GLfloat) - 0.165643,
+       (GLfloat) 0.757446, (GLfloat) - 0.632850, (GLfloat) - 0.160551,
+       (GLfloat) 0.875885, (GLfloat) - 0.459272, (GLfloat) - 0.147967,
+       (GLfloat) 0.884471, (GLfloat) - 0.440088, (GLfloat) - 0.155030,
+       (GLfloat) - 0.384755, (GLfloat) - 0.899768, (GLfloat) - 0.205866,
+       (GLfloat) - 0.407035, (GLfloat) - 0.895883, (GLfloat) - 0.178092,
+       (GLfloat) - 0.367045, (GLfloat) - 0.927643, (GLfloat) - 0.068965,
+       (GLfloat) - 0.377652, (GLfloat) - 0.923053, (GLfloat) - 0.073163,
+       (GLfloat) 0.147492, (GLfloat) - 0.980758, (GLfloat) - 0.127908,
+       (GLfloat) 0.187942, (GLfloat) - 0.971451, (GLfloat) - 0.144776,
+       (GLfloat) 0.017404, (GLfloat) - 0.922933, (GLfloat) - 0.384567,
+       (GLfloat) 0.060977, (GLfloat) - 0.919535, (GLfloat) - 0.388250,
+       (GLfloat) - 0.407035, (GLfloat) - 0.895883, (GLfloat) 0.178092,
+       (GLfloat) - 0.384755, (GLfloat) - 0.899768, (GLfloat) 0.205866,
+       (GLfloat) 0.060977, (GLfloat) - 0.919535, (GLfloat) 0.388250,
+       (GLfloat) 0.017405, (GLfloat) - 0.922933, (GLfloat) 0.384568,
+       (GLfloat) 0.187942, (GLfloat) - 0.971451, (GLfloat) 0.144776,
+       (GLfloat) 0.147492, (GLfloat) - 0.980758, (GLfloat) 0.127908,
+       (GLfloat) - 0.377652, (GLfloat) - 0.923053, (GLfloat) 0.073163,
+       (GLfloat) - 0.367045, (GLfloat) - 0.927643, (GLfloat) 0.068965,
+       (GLfloat) 0.525096, (GLfloat) - 0.217383, (GLfloat) - 0.822811,
+       (GLfloat) 0.542855, (GLfloat) - 0.154089, (GLfloat) - 0.825569,
+       (GLfloat) 0.263018, (GLfloat) 0.047234, (GLfloat) - 0.963634,
+       (GLfloat) 0.298263, (GLfloat) 0.059374, (GLfloat) - 0.952635,
+       (GLfloat) 0.152826, (GLfloat) - 0.078814, (GLfloat) - 0.985105,
+       (GLfloat) 0.157225, (GLfloat) - 0.076313, (GLfloat) - 0.984610,
+       (GLfloat) 0.407888, (GLfloat) - 0.328946, (GLfloat) - 0.851717,
+       (GLfloat) 0.393565, (GLfloat) - 0.338248, (GLfloat) - 0.854807,
+       (GLfloat) - 0.131636, (GLfloat) 0.588079, (GLfloat) - 0.798019,
+       (GLfloat) - 0.131727, (GLfloat) 0.588071, (GLfloat) - 0.798011,
+       (GLfloat) - 0.280070, (GLfloat) 0.459269, (GLfloat) - 0.842990,
+       (GLfloat) - 0.285882, (GLfloat) 0.456692, (GLfloat) - 0.842439,
+       (GLfloat) - 0.064116, (GLfloat) 0.179568, (GLfloat) - 0.981654,
+       (GLfloat) - 0.067311, (GLfloat) 0.177967, (GLfloat) - 0.981732,
+       (GLfloat) 0.071348, (GLfloat) 0.308885, (GLfloat) - 0.948419,
+       (GLfloat) 0.056168, (GLfloat) 0.305937, (GLfloat) - 0.950393,
+       (GLfloat) - 0.756765, (GLfloat) - 0.603631, (GLfloat) - 0.250870,
+       (GLfloat) - 0.750192, (GLfloat) - 0.596115, (GLfloat) - 0.286110,
+       (GLfloat) - 0.661260, (GLfloat) - 0.680768, (GLfloat) - 0.315104,
+       (GLfloat) - 0.666597, (GLfloat) - 0.680599, (GLfloat) - 0.304029,
+       (GLfloat) - 0.487239, (GLfloat) - 0.360038, (GLfloat) - 0.795595,
+       (GLfloat) - 0.481713, (GLfloat) - 0.339088, (GLfloat) - 0.808067,
+       (GLfloat) - 0.706427, (GLfloat) - 0.186136, (GLfloat) - 0.682872,
+       (GLfloat) - 0.704353, (GLfloat) - 0.163662, (GLfloat) - 0.690726,
+       (GLfloat) - 0.472887, (GLfloat) - 0.840626, (GLfloat) - 0.264056,
+       (GLfloat) - 0.444319, (GLfloat) - 0.849789, (GLfloat) - 0.283620,
+       (GLfloat) - 0.155246, (GLfloat) - 0.767829, (GLfloat) - 0.621561,
+       (GLfloat) - 0.107581, (GLfloat) - 0.759164, (GLfloat) - 0.641947,
+       (GLfloat) - 0.262880, (GLfloat) - 0.545316, (GLfloat) - 0.795943,
+       (GLfloat) - 0.306478, (GLfloat) - 0.563718, (GLfloat) - 0.767002,
+       (GLfloat) - 0.550890, (GLfloat) - 0.772860, (GLfloat) - 0.314972,
+       (GLfloat) - 0.559203, (GLfloat) - 0.770962, (GLfloat) - 0.304813,
+       (GLfloat) - 0.296632, (GLfloat) 0.840312, (GLfloat) - 0.453745,
+       (GLfloat) - 0.291339, (GLfloat) 0.841021, (GLfloat) - 0.455856,
+       (GLfloat) - 0.347498, (GLfloat) 0.926752, (GLfloat) - 0.142743,
+       (GLfloat) - 0.349577, (GLfloat) 0.926172, (GLfloat) - 0.141427,
+       (GLfloat) - 0.528222, (GLfloat) 0.834354, (GLfloat) - 0.157592,
+       (GLfloat) - 0.534297, (GLfloat) 0.830965, (GLfloat) - 0.154997,
+       (GLfloat) - 0.477964, (GLfloat) 0.727109, (GLfloat) - 0.492812,
+       (GLfloat) - 0.464577, (GLfloat) 0.733270, (GLfloat) - 0.496471,
+       (GLfloat) - 0.296632, (GLfloat) 0.840312, (GLfloat) 0.453745,
+       (GLfloat) - 0.291339, (GLfloat) 0.841021, (GLfloat) 0.455856,
+       (GLfloat) - 0.464577, (GLfloat) 0.733270, (GLfloat) 0.496471,
+       (GLfloat) - 0.477964, (GLfloat) 0.727109, (GLfloat) 0.492812,
+       (GLfloat) - 0.528222, (GLfloat) 0.834354, (GLfloat) 0.157592,
+       (GLfloat) - 0.534297, (GLfloat) 0.830965, (GLfloat) 0.154997,
+       (GLfloat) - 0.349577, (GLfloat) 0.926172, (GLfloat) 0.141427,
+       (GLfloat) - 0.347498, (GLfloat) 0.926752, (GLfloat) 0.142743,
+       (GLfloat) - 0.819286, (GLfloat) - 0.535153, (GLfloat) 0.205866,
+       (GLfloat) - 0.811591, (GLfloat) - 0.556420, (GLfloat) 0.178092,
+       (GLfloat) - 0.849813, (GLfloat) - 0.522553, (GLfloat) 0.068965,
+       (GLfloat) - 0.843450, (GLfloat) - 0.532202, (GLfloat) 0.073162,
+       (GLfloat) - 0.975674, (GLfloat) 0.164943, (GLfloat) 0.144407,
+       (GLfloat) - 0.965143, (GLfloat) 0.206428, (GLfloat) 0.160894,
+       (GLfloat) - 0.906538, (GLfloat) 0.014845, (GLfloat) 0.421862,
+       (GLfloat) - 0.890094, (GLfloat) 0.060087, (GLfloat) 0.451800,
+       (GLfloat) - 0.811591, (GLfloat) - 0.556419, (GLfloat) - 0.178092,
+       (GLfloat) - 0.819286, (GLfloat) - 0.535153, (GLfloat) - 0.205865,
+       (GLfloat) - 0.906538, (GLfloat) 0.014844, (GLfloat) - 0.421862,
+       (GLfloat) - 0.890094, (GLfloat) 0.060087, (GLfloat) - 0.451800,
+       (GLfloat) - 0.965143, (GLfloat) 0.206428, (GLfloat) - 0.160894,
+       (GLfloat) - 0.975674, (GLfloat) 0.164943, (GLfloat) - 0.144407,
+       (GLfloat) - 0.843450, (GLfloat) - 0.532202, (GLfloat) - 0.073162,
+       (GLfloat) - 0.849813, (GLfloat) - 0.522553, (GLfloat) - 0.068965,
+       (GLfloat) - 0.131727, (GLfloat) 0.588071, (GLfloat) 0.798011,
+       (GLfloat) - 0.131636, (GLfloat) 0.588079, (GLfloat) 0.798019,
+       (GLfloat) 0.071348, (GLfloat) 0.308886, (GLfloat) 0.948419,
+       (GLfloat) 0.056168, (GLfloat) 0.305937, (GLfloat) 0.950393,
+       (GLfloat) - 0.067311, (GLfloat) 0.177967, (GLfloat) 0.981732,
+       (GLfloat) - 0.064116, (GLfloat) 0.179568, (GLfloat) 0.981654,
+       (GLfloat) - 0.280070, (GLfloat) 0.459269, (GLfloat) 0.842990,
+       (GLfloat) - 0.285882, (GLfloat) 0.456692, (GLfloat) 0.842439,
+       (GLfloat) 0.542855, (GLfloat) - 0.154089, (GLfloat) 0.825569,
+       (GLfloat) 0.525096, (GLfloat) - 0.217383, (GLfloat) 0.822811,
+       (GLfloat) 0.393565, (GLfloat) - 0.338248, (GLfloat) 0.854807,
+       (GLfloat) 0.407888, (GLfloat) - 0.328946, (GLfloat) 0.851717,
+       (GLfloat) 0.152826, (GLfloat) - 0.078814, (GLfloat) 0.985105,
+       (GLfloat) 0.157225, (GLfloat) - 0.076313, (GLfloat) 0.984610,
+       (GLfloat) 0.298263, (GLfloat) 0.059374, (GLfloat) 0.952635,
+       (GLfloat) 0.263018, (GLfloat) 0.047234, (GLfloat) 0.963634,
+       (GLfloat) - 0.444319, (GLfloat) - 0.849789, (GLfloat) 0.283620,
+       (GLfloat) - 0.472887, (GLfloat) - 0.840626, (GLfloat) 0.264055,
+       (GLfloat) - 0.550890, (GLfloat) - 0.772861, (GLfloat) 0.314972,
+       (GLfloat) - 0.559203, (GLfloat) - 0.770962, (GLfloat) 0.304813,
+       (GLfloat) - 0.306478, (GLfloat) - 0.563718, (GLfloat) 0.767003,
+       (GLfloat) - 0.262880, (GLfloat) - 0.545316, (GLfloat) 0.795943,
+       (GLfloat) - 0.155245, (GLfloat) - 0.767828, (GLfloat) 0.621562,
+       (GLfloat) - 0.107581, (GLfloat) - 0.759164, (GLfloat) 0.641947,
+       (GLfloat) - 0.756765, (GLfloat) - 0.603631, (GLfloat) 0.250869,
+       (GLfloat) - 0.750192, (GLfloat) - 0.596115, (GLfloat) 0.286110,
+       (GLfloat) - 0.706427, (GLfloat) - 0.186135, (GLfloat) 0.682873,
+       (GLfloat) - 0.704352, (GLfloat) - 0.163662, (GLfloat) 0.690726,
+       (GLfloat) - 0.481713, (GLfloat) - 0.339088, (GLfloat) 0.808067,
+       (GLfloat) - 0.487239, (GLfloat) - 0.360037, (GLfloat) 0.795595,
+       (GLfloat) - 0.666597, (GLfloat) - 0.680599, (GLfloat) 0.304029,
+       (GLfloat) - 0.661260, (GLfloat) - 0.680768, (GLfloat) 0.315104,
+       (GLfloat) - 0.527794, (GLfloat) - 0.840271, (GLfloat) - 0.124011,
+       (GLfloat) - 0.536826, (GLfloat) - 0.832691, (GLfloat) - 0.135802,
+       (GLfloat) - 0.604714, (GLfloat) - 0.788863, (GLfloat) - 0.109621,
+       (GLfloat) - 0.607657, (GLfloat) - 0.785872, (GLfloat) - 0.114709,
+       (GLfloat) - 0.619037, (GLfloat) - 0.784665, (GLfloat) - 0.033079,
+       (GLfloat) - 0.616803, (GLfloat) - 0.786539, (GLfloat) - 0.030163,
+       (GLfloat) - 0.554318, (GLfloat) - 0.831150, (GLfloat) - 0.043834,
+       (GLfloat) - 0.550163, (GLfloat) - 0.834115, (GLfloat) - 0.039656,
+       (GLfloat) - 0.726822, (GLfloat) - 0.673266, (GLfloat) - 0.135802,
+       (GLfloat) - 0.735855, (GLfloat) - 0.665687, (GLfloat) - 0.124011,
+       (GLfloat) - 0.722267, (GLfloat) - 0.690224, (GLfloat) - 0.043834,
+       (GLfloat) - 0.725908, (GLfloat) - 0.686648, (GLfloat) - 0.039656,
+       (GLfloat) - 0.667483, (GLfloat) - 0.744014, (GLfloat) - 0.030163,
+       (GLfloat) - 0.665249, (GLfloat) - 0.745888, (GLfloat) - 0.033079,
+       (GLfloat) - 0.671871, (GLfloat) - 0.732511, (GLfloat) - 0.109621,
+       (GLfloat) - 0.668414, (GLfloat) - 0.734891, (GLfloat) - 0.114709,
+       (GLfloat) - 0.735855, (GLfloat) - 0.665687, (GLfloat) 0.124011,
+       (GLfloat) - 0.726822, (GLfloat) - 0.673266, (GLfloat) 0.135802,
+       (GLfloat) - 0.671871, (GLfloat) - 0.732511, (GLfloat) 0.109621,
+       (GLfloat) - 0.668414, (GLfloat) - 0.734891, (GLfloat) 0.114709,
+       (GLfloat) - 0.665249, (GLfloat) - 0.745888, (GLfloat) 0.033079,
+       (GLfloat) - 0.667483, (GLfloat) - 0.744014, (GLfloat) 0.030163,
+       (GLfloat) - 0.722267, (GLfloat) - 0.690224, (GLfloat) 0.043834,
+       (GLfloat) - 0.725908, (GLfloat) - 0.686648, (GLfloat) 0.039656,
+       (GLfloat) - 0.536826, (GLfloat) - 0.832691, (GLfloat) 0.135802,
+       (GLfloat) - 0.527794, (GLfloat) - 0.840271, (GLfloat) 0.124011,
+       (GLfloat) - 0.554318, (GLfloat) - 0.831150, (GLfloat) 0.043834,
+       (GLfloat) - 0.550163, (GLfloat) - 0.834115, (GLfloat) 0.039656,
+       (GLfloat) - 0.616803, (GLfloat) - 0.786539, (GLfloat) 0.030163,
+       (GLfloat) - 0.619037, (GLfloat) - 0.784665, (GLfloat) 0.033079,
+       (GLfloat) - 0.604714, (GLfloat) - 0.788863, (GLfloat) 0.109621,
+       (GLfloat) - 0.607657, (GLfloat) - 0.785872, (GLfloat) 0.114709,
+};
+
+static unsigned short int s1_4_POLS[] =
+{
+      3, 82, 12, 76, 1, 3, 76, 74, 82, 1, 3, 22, 78, 74, 1, 3, 22, 74, 76, 1,
+      3, 78, 20, 80, 1, 3, 80, 74, 78, 1, 3, 28, 82, 74, 1, 3, 28, 74, 80, 1,
+      3, 88, 13, 84, 1, 3, 84, 77, 88, 1, 3, 24, 86, 77, 1, 3, 24, 77, 84, 1,
+      3, 86, 20, 78, 1, 3, 78, 77, 86, 1, 3, 22, 88, 77, 1, 3, 22, 77, 78, 1,
+      3, 14, 90, 85, 1, 3, 14, 85, 93, 1, 3, 26, 91, 85, 1, 3, 26, 85, 90, 1,
+      3, 20, 86, 85, 1, 3, 20, 85, 91, 1, 3, 86, 24, 93, 1, 3, 93, 85, 86, 1,
+      3, 15, 95, 79, 1, 3, 15, 79, 97, 1, 3, 95, 28, 80, 1, 3, 80, 79, 95, 1,
+      3, 20, 91, 79, 1, 3, 20, 79, 80, 1, 3, 26, 97, 79, 1, 3, 26, 79, 91, 1,
+    3, 13, 99, 83, 1, 3, 13, 83, 84, 1, 3, 99, 30, 101, 1, 3, 101, 83, 99, 1,
+  3, 23, 102, 83, 1, 3, 23, 83, 101, 1, 3, 102, 24, 84, 1, 3, 84, 83, 102, 1,
+       3, 16, 104, 100, 1, 3, 16, 100, 108, 1, 3, 104, 32, 106, 1, 3, 106, 100, 104, 1,
+       3, 106, 23, 101, 1, 3, 101, 100, 106, 1, 3, 30, 108, 100, 1, 3, 30, 100, 101, 1,
+       3, 17, 110, 105, 1, 3, 17, 105, 113, 1, 3, 110, 33, 111, 1, 3, 111, 105, 110, 1,
+       3, 23, 106, 105, 1, 3, 23, 105, 111, 1, 3, 106, 32, 113, 1, 3, 113, 105, 106, 1,
+  3, 114, 14, 93, 1, 3, 93, 92, 114, 1, 3, 93, 24, 102, 1, 3, 102, 92, 93, 1,
+3, 23, 111, 92, 1, 3, 23, 92, 102, 1, 3, 111, 33, 114, 1, 3, 114, 92, 111, 1,
+       3, 104, 16, 116, 1, 3, 116, 103, 104, 1, 3, 35, 118, 103, 1, 3, 35, 103, 116, 1,
+       3, 118, 31, 119, 1, 3, 119, 103, 118, 1, 3, 32, 104, 103, 1, 3, 32, 103, 119, 1,
+       3, 125, 18, 121, 1, 3, 121, 117, 125, 1, 3, 36, 123, 117, 1, 3, 36, 117, 121, 1,
+       3, 123, 31, 118, 1, 3, 118, 117, 123, 1, 3, 35, 125, 117, 1, 3, 35, 117, 118, 1,
+       3, 19, 127, 122, 1, 3, 19, 122, 130, 1, 3, 37, 128, 122, 1, 3, 37, 122, 127, 1,
+       3, 31, 123, 122, 1, 3, 31, 122, 128, 1, 3, 36, 130, 122, 1, 3, 36, 122, 123, 1,
+       3, 17, 113, 112, 1, 3, 17, 112, 131, 1, 3, 32, 119, 112, 1, 3, 32, 112, 113, 1,
+       3, 31, 128, 112, 1, 3, 31, 112, 119, 1, 3, 37, 131, 112, 1, 3, 37, 112, 128, 1,
+       3, 18, 133, 120, 1, 3, 18, 120, 121, 1, 3, 39, 134, 120, 1, 3, 39, 120, 133, 1,
+       3, 134, 27, 135, 1, 3, 135, 120, 134, 1, 3, 135, 36, 121, 1, 3, 121, 120, 135, 1,
+   3, 12, 82, 81, 1, 3, 12, 81, 138, 1, 3, 82, 28, 136, 1, 3, 136, 81, 82, 1,
+3, 27, 134, 81, 1, 3, 27, 81, 136, 1, 3, 134, 39, 138, 1, 3, 138, 81, 134, 1,
+3, 95, 15, 139, 1, 3, 139, 94, 95, 1, 3, 139, 40, 140, 1, 3, 140, 94, 139, 1,
+  3, 27, 136, 94, 1, 3, 27, 94, 140, 1, 3, 136, 28, 95, 1, 3, 95, 94, 136, 1,
+       3, 19, 130, 129, 1, 3, 19, 129, 141, 1, 3, 130, 36, 135, 1, 3, 135, 129, 130, 1,
+       3, 27, 140, 129, 1, 3, 27, 129, 135, 1, 3, 140, 40, 141, 1, 3, 141, 129, 140, 1,
+ 3, 14, 114, 89, 1, 3, 14, 89, 90, 1, 3, 114, 33, 142, 1, 3, 142, 89, 114, 1,
+  3, 25, 143, 89, 1, 3, 25, 89, 142, 1, 3, 143, 26, 90, 1, 3, 90, 89, 143, 1,
+       3, 17, 131, 109, 1, 3, 17, 109, 110, 1, 3, 131, 37, 144, 1, 3, 144, 109, 131, 1,
+       3, 25, 142, 109, 1, 3, 25, 109, 144, 1, 3, 142, 33, 110, 1, 3, 110, 109, 142, 1,
+       3, 19, 141, 126, 1, 3, 19, 126, 127, 1, 3, 141, 40, 145, 1, 3, 145, 126, 141, 1,
+       3, 25, 144, 126, 1, 3, 25, 126, 145, 1, 3, 144, 37, 127, 1, 3, 127, 126, 144, 1,
+   3, 15, 97, 96, 1, 3, 15, 96, 139, 1, 3, 97, 26, 143, 1, 3, 143, 96, 97, 1,
+3, 25, 145, 96, 1, 3, 25, 96, 143, 1, 3, 145, 40, 139, 1, 3, 139, 96, 145, 1,
+ 3, 12, 146, 75, 1, 3, 12, 75, 76, 1, 3, 146, 41, 148, 1, 3, 148, 75, 146, 1,
+  3, 21, 149, 75, 1, 3, 21, 75, 148, 1, 3, 149, 22, 76, 1, 3, 76, 75, 149, 1,
+3, 8, 151, 147, 1, 3, 8, 147, 155, 1, 3, 151, 43, 153, 1, 3, 153, 147, 151, 1,
+       3, 153, 21, 148, 1, 3, 148, 147, 153, 1, 3, 41, 155, 147, 1, 3, 41, 147, 148, 1,
+       3, 11, 157, 152, 1, 3, 11, 152, 160, 1, 3, 44, 158, 152, 1, 3, 44, 152, 157, 1,
+       3, 158, 21, 153, 1, 3, 153, 152, 158, 1, 3, 153, 43, 160, 1, 3, 160, 152, 153, 1,
+   3, 13, 88, 87, 1, 3, 13, 87, 161, 1, 3, 88, 22, 149, 1, 3, 149, 87, 88, 1,
+3, 21, 158, 87, 1, 3, 21, 87, 149, 1, 3, 158, 44, 161, 1, 3, 161, 87, 158, 1,
+       3, 18, 162, 132, 1, 3, 18, 132, 133, 1, 3, 162, 45, 164, 1, 3, 164, 132, 162, 1,
+       3, 38, 165, 132, 1, 3, 38, 132, 164, 1, 3, 165, 39, 133, 1, 3, 133, 132, 165, 1,
+       3, 170, 9, 167, 1, 3, 167, 163, 170, 1, 3, 47, 168, 163, 1, 3, 47, 163, 167, 1,
+       3, 168, 38, 164, 1, 3, 164, 163, 168, 1, 3, 45, 170, 163, 1, 3, 45, 163, 164, 1,
+3, 8, 155, 154, 1, 3, 8, 154, 173, 1, 3, 155, 41, 171, 1, 3, 171, 154, 155, 1,
+       3, 38, 168, 154, 1, 3, 38, 154, 171, 1, 3, 168, 47, 173, 1, 3, 173, 154, 168, 1,
+       3, 146, 12, 138, 1, 3, 138, 137, 146, 1, 3, 39, 165, 137, 1, 3, 39, 137, 138, 1,
+       3, 165, 38, 171, 1, 3, 171, 137, 165, 1, 3, 41, 146, 137, 1, 3, 41, 137, 171, 1,
+       3, 16, 108, 107, 1, 3, 16, 107, 177, 1, 3, 108, 30, 174, 1, 3, 174, 107, 108, 1,
+       3, 29, 176, 107, 1, 3, 29, 107, 174, 1, 3, 176, 50, 177, 1, 3, 177, 107, 176, 1,
+  3, 99, 13, 161, 1, 3, 161, 98, 99, 1, 3, 44, 178, 98, 1, 3, 44, 98, 161, 1,
+ 3, 178, 29, 174, 1, 3, 174, 98, 178, 1, 3, 30, 99, 98, 1, 3, 30, 98, 174, 1,
+       3, 11, 180, 156, 1, 3, 11, 156, 157, 1, 3, 180, 49, 181, 1, 3, 181, 156, 180, 1,
+       3, 29, 178, 156, 1, 3, 29, 156, 181, 1, 3, 178, 44, 157, 1, 3, 157, 156, 178, 1,
+       3, 185, 10, 183, 1, 3, 183, 175, 185, 1, 3, 50, 176, 175, 1, 3, 50, 175, 183, 1,
+       3, 176, 29, 181, 1, 3, 181, 175, 176, 1, 3, 49, 185, 175, 1, 3, 49, 175, 181, 1,
+       3, 18, 125, 124, 1, 3, 18, 124, 162, 1, 3, 125, 35, 186, 1, 3, 186, 124, 125, 1,
+       3, 34, 187, 124, 1, 3, 34, 124, 186, 1, 3, 187, 45, 162, 1, 3, 162, 124, 187, 1,
+       3, 16, 177, 115, 1, 3, 16, 115, 116, 1, 3, 177, 50, 188, 1, 3, 188, 115, 177, 1,
+       3, 34, 186, 115, 1, 3, 34, 115, 188, 1, 3, 186, 35, 116, 1, 3, 116, 115, 186, 1,
+       3, 183, 10, 190, 1, 3, 190, 182, 183, 1, 3, 52, 191, 182, 1, 3, 52, 182, 190, 1,
+       3, 191, 34, 188, 1, 3, 188, 182, 191, 1, 3, 50, 183, 182, 1, 3, 50, 182, 188, 1,
+       3, 193, 9, 170, 1, 3, 170, 169, 193, 1, 3, 45, 187, 169, 1, 3, 45, 169, 170, 1,
+       3, 187, 34, 191, 1, 3, 191, 169, 187, 1, 3, 52, 193, 169, 1, 3, 52, 169, 191, 1,
+       3, 201, 1, 196, 1, 3, 196, 194, 201, 1, 3, 54, 198, 194, 1, 3, 54, 194, 196, 1,
+       3, 198, 46, 199, 1, 3, 199, 194, 198, 1, 3, 56, 201, 194, 1, 3, 56, 194, 199, 1,
+       3, 206, 3, 203, 1, 3, 203, 197, 206, 1, 3, 55, 204, 197, 1, 3, 55, 197, 203, 1,
+       3, 46, 198, 197, 1, 3, 46, 197, 204, 1, 3, 198, 54, 206, 1, 3, 206, 197, 198, 1,
+       3, 208, 8, 173, 1, 3, 173, 172, 208, 1, 3, 47, 207, 172, 1, 3, 47, 172, 173, 1,
+       3, 207, 46, 204, 1, 3, 204, 172, 207, 1, 3, 204, 55, 208, 1, 3, 208, 172, 204, 1,
+3, 9, 209, 166, 1, 3, 9, 166, 167, 1, 3, 209, 56, 199, 1, 3, 199, 166, 209, 1,
+       3, 46, 207, 166, 1, 3, 46, 166, 199, 1, 3, 207, 47, 167, 1, 3, 167, 166, 207, 1,
+3, 1, 201, 200, 1, 3, 1, 200, 214, 1, 3, 201, 56, 210, 1, 3, 210, 200, 201, 1,
+       3, 51, 212, 200, 1, 3, 51, 200, 210, 1, 3, 212, 59, 214, 1, 3, 214, 200, 212, 1,
+       3, 209, 9, 193, 1, 3, 193, 192, 209, 1, 3, 193, 52, 215, 1, 3, 215, 192, 193, 1,
+       3, 215, 51, 210, 1, 3, 210, 192, 215, 1, 3, 56, 209, 192, 1, 3, 56, 192, 210, 1,
+       3, 190, 10, 216, 1, 3, 216, 189, 190, 1, 3, 57, 217, 189, 1, 3, 57, 189, 216, 1,
+       3, 217, 51, 215, 1, 3, 215, 189, 217, 1, 3, 215, 52, 190, 1, 3, 190, 189, 215, 1,
+3, 0, 219, 211, 1, 3, 0, 211, 221, 1, 3, 219, 59, 212, 1, 3, 212, 211, 219, 1,
+       3, 51, 217, 211, 1, 3, 51, 211, 212, 1, 3, 217, 57, 221, 1, 3, 221, 211, 217, 1,
+       3, 226, 0, 221, 1, 3, 221, 220, 226, 1, 3, 57, 222, 220, 1, 3, 57, 220, 221, 1,
+       3, 222, 48, 224, 1, 3, 224, 220, 222, 1, 3, 62, 226, 220, 1, 3, 62, 220, 224, 1,
+       3, 10, 185, 184, 1, 3, 10, 184, 216, 1, 3, 185, 49, 227, 1, 3, 227, 184, 185, 1,
+       3, 48, 222, 184, 1, 3, 48, 184, 227, 1, 3, 222, 57, 216, 1, 3, 216, 184, 222, 1,
+       3, 180, 11, 228, 1, 3, 228, 179, 180, 1, 3, 228, 60, 229, 1, 3, 229, 179, 228, 1,
+       3, 229, 48, 227, 1, 3, 227, 179, 229, 1, 3, 49, 180, 179, 1, 3, 49, 179, 227, 1,
+       3, 233, 2, 231, 1, 3, 231, 223, 233, 1, 3, 231, 62, 224, 1, 3, 224, 223, 231, 1,
+       3, 48, 229, 223, 1, 3, 48, 223, 224, 1, 3, 60, 233, 223, 1, 3, 60, 223, 229, 1,
+3, 2, 233, 232, 1, 3, 2, 232, 237, 1, 3, 60, 234, 232, 1, 3, 60, 232, 233, 1,
+       3, 42, 235, 232, 1, 3, 42, 232, 234, 1, 3, 235, 64, 237, 1, 3, 237, 232, 235, 1,
+       3, 11, 160, 159, 1, 3, 11, 159, 228, 1, 3, 160, 43, 238, 1, 3, 238, 159, 160, 1,
+       3, 42, 234, 159, 1, 3, 42, 159, 238, 1, 3, 234, 60, 228, 1, 3, 228, 159, 234, 1,
+3, 8, 208, 150, 1, 3, 8, 150, 151, 1, 3, 208, 55, 239, 1, 3, 239, 150, 208, 1,
+       3, 42, 238, 150, 1, 3, 42, 150, 239, 1, 3, 238, 43, 151, 1, 3, 151, 150, 238, 1,
+3, 3, 241, 202, 1, 3, 3, 202, 203, 1, 3, 241, 64, 235, 1, 3, 235, 202, 241, 1,
+       3, 42, 239, 202, 1, 3, 42, 202, 235, 1, 3, 55, 203, 202, 1, 3, 55, 202, 239, 1,
+       3, 245, 2, 237, 1, 3, 237, 236, 245, 1, 3, 64, 242, 236, 1, 3, 64, 236, 237, 1,
+       3, 242, 63, 244, 1, 3, 244, 236, 242, 1, 3, 68, 245, 236, 1, 3, 68, 236, 244, 1,
+       3, 241, 3, 246, 1, 3, 246, 240, 241, 1, 3, 65, 248, 240, 1, 3, 65, 240, 246, 1,
+       3, 248, 63, 242, 1, 3, 242, 240, 248, 1, 3, 64, 241, 240, 1, 3, 64, 240, 242, 1,
+3, 4, 250, 247, 1, 3, 4, 247, 253, 1, 3, 67, 251, 247, 1, 3, 67, 247, 250, 1,
+       3, 63, 248, 247, 1, 3, 63, 247, 251, 1, 3, 65, 253, 247, 1, 3, 65, 247, 248, 1,
+3, 7, 255, 243, 1, 3, 7, 243, 257, 1, 3, 68, 244, 243, 1, 3, 68, 243, 255, 1,
+       3, 63, 251, 243, 1, 3, 63, 243, 244, 1, 3, 67, 257, 243, 1, 3, 67, 243, 251, 1,
+3, 3, 206, 205, 1, 3, 3, 205, 246, 1, 3, 54, 258, 205, 1, 3, 54, 205, 206, 1,
+       3, 258, 53, 259, 1, 3, 259, 205, 258, 1, 3, 65, 246, 205, 1, 3, 65, 205, 259, 1,
+3, 1, 260, 195, 1, 3, 1, 195, 196, 1, 3, 260, 69, 262, 1, 3, 262, 195, 260, 1,
+       3, 53, 258, 195, 1, 3, 53, 195, 262, 1, 3, 258, 54, 196, 1, 3, 196, 195, 258, 1,
+       3, 267, 5, 264, 1, 3, 264, 261, 267, 1, 3, 70, 265, 261, 1, 3, 70, 261, 264, 1,
+       3, 53, 262, 261, 1, 3, 53, 261, 265, 1, 3, 262, 69, 267, 1, 3, 267, 261, 262, 1,
+3, 4, 253, 252, 1, 3, 4, 252, 268, 1, 3, 253, 65, 259, 1, 3, 259, 252, 253, 1,
+       3, 53, 265, 252, 1, 3, 53, 252, 259, 1, 3, 265, 70, 268, 1, 3, 268, 252, 265, 1,
+       3, 260, 1, 214, 1, 3, 214, 213, 260, 1, 3, 59, 269, 213, 1, 3, 59, 213, 214, 1,
+       3, 269, 58, 270, 1, 3, 270, 213, 269, 1, 3, 69, 260, 213, 1, 3, 69, 213, 270, 1,
+       3, 219, 0, 271, 1, 3, 271, 218, 219, 1, 3, 71, 273, 218, 1, 3, 71, 218, 271, 1,
+       3, 273, 58, 269, 1, 3, 269, 218, 273, 1, 3, 59, 219, 218, 1, 3, 59, 218, 269, 1,
+3, 6, 275, 272, 1, 3, 6, 272, 278, 1, 3, 72, 276, 272, 1, 3, 72, 272, 275, 1,
+       3, 58, 273, 272, 1, 3, 58, 272, 276, 1, 3, 273, 71, 278, 1, 3, 278, 272, 273, 1,
+3, 5, 267, 266, 1, 3, 5, 266, 279, 1, 3, 267, 69, 270, 1, 3, 270, 266, 267, 1,
+       3, 58, 276, 266, 1, 3, 58, 266, 270, 1, 3, 72, 279, 266, 1, 3, 72, 266, 276, 1,
+3, 0, 226, 225, 1, 3, 0, 225, 271, 1, 3, 226, 62, 280, 1, 3, 280, 225, 226, 1,
+       3, 61, 281, 225, 1, 3, 61, 225, 280, 1, 3, 281, 71, 271, 1, 3, 271, 225, 281, 1,
+3, 2, 245, 230, 1, 3, 2, 230, 231, 1, 3, 68, 282, 230, 1, 3, 68, 230, 245, 1,
+       3, 282, 61, 280, 1, 3, 280, 230, 282, 1, 3, 62, 231, 230, 1, 3, 62, 230, 280, 1,
+3, 7, 283, 254, 1, 3, 7, 254, 255, 1, 3, 283, 73, 284, 1, 3, 284, 254, 283, 1,
+       3, 61, 282, 254, 1, 3, 61, 254, 284, 1, 3, 282, 68, 255, 1, 3, 255, 254, 282, 1,
+       3, 285, 6, 278, 1, 3, 278, 277, 285, 1, 3, 278, 71, 281, 1, 3, 281, 277, 278, 1,
+       3, 61, 284, 277, 1, 3, 61, 277, 281, 1, 3, 73, 285, 277, 1, 3, 73, 277, 284, 1,
+3, 4, 268, 249, 1, 3, 4, 249, 250, 1, 3, 268, 70, 286, 1, 3, 286, 249, 268, 1,
+       3, 66, 287, 249, 1, 3, 66, 249, 286, 1, 3, 287, 67, 250, 1, 3, 250, 249, 287, 1,
+3, 5, 279, 263, 1, 3, 5, 263, 264, 1, 3, 279, 72, 288, 1, 3, 288, 263, 279, 1,
+       3, 66, 286, 263, 1, 3, 66, 263, 288, 1, 3, 286, 70, 264, 1, 3, 264, 263, 286, 1,
+3, 6, 285, 274, 1, 3, 6, 274, 275, 1, 3, 285, 73, 289, 1, 3, 289, 274, 285, 1,
+       3, 66, 288, 274, 1, 3, 66, 274, 289, 1, 3, 288, 72, 275, 1, 3, 275, 274, 288, 1,
+3, 7, 257, 256, 1, 3, 7, 256, 283, 1, 3, 257, 67, 287, 1, 3, 287, 256, 257, 1,
+       3, 66, 289, 256, 1, 3, 66, 256, 287, 1, 3, 289, 73, 283, 1, 3, 283, 256, 289, 1,
+
+       0
+};
+
+struct lwo  LWO_s1_4 =
+{
+       290,                    /* number of points */
+       s1_4_PNTS, s1_4_normals, s1_4_POLS, 0L
+};
+
+#endif /* MODE_sproingies */
+
+/* End of s1_4.c */
diff --git a/modes/glx/s1_5.c b/modes/glx/s1_5.c
new file mode 100644 (file)
index 0000000..f858d66
--- /dev/null
@@ -0,0 +1,1057 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)s1_5.c       4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points, polygons, and normal vectors to render "s1_5" in 3D.
+ *
+ * Generated by lw2ogl.  Link this with your program but do
+ * not edit by hand.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_sproingies
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat s1_5_PNTS[] =
+{
+       (GLfloat) 1.333479, (GLfloat) - 0.188456, (GLfloat) - 0.340079,
+       (GLfloat) 1.333479, (GLfloat) - 0.188456, (GLfloat) - 0.659921,
+       (GLfloat) 1.633195, (GLfloat) - 0.090616, (GLfloat) - 0.340079,
+       (GLfloat) 1.633195, (GLfloat) - 0.090616, (GLfloat) - 0.659921,
+       (GLfloat) 1.670754, (GLfloat) - 0.221475, (GLfloat) - 0.638667,
+       (GLfloat) 1.402870, (GLfloat) - 0.293254, (GLfloat) - 0.638667,
+       (GLfloat) 1.402870, (GLfloat) - 0.293254, (GLfloat) - 0.361333,
+       (GLfloat) 1.670754, (GLfloat) - 0.221475, (GLfloat) - 0.361333,
+       (GLfloat) 1.332183, (GLfloat) 0.266938, (GLfloat) - 0.619965,
+       (GLfloat) 1.190836, (GLfloat) 0.100363, (GLfloat) - 0.619965,
+       (GLfloat) 1.190836, (GLfloat) 0.100363, (GLfloat) - 0.380035,
+       (GLfloat) 1.332183, (GLfloat) 0.266938, (GLfloat) - 0.380035,
+       (GLfloat) 0.995497, (GLfloat) 0.593044, (GLfloat) - 0.659921,
+       (GLfloat) 0.995497, (GLfloat) 0.593044, (GLfloat) - 0.340079,
+       (GLfloat) 0.874620, (GLfloat) 0.619745, (GLfloat) - 0.361333,
+       (GLfloat) 0.874620, (GLfloat) 0.619745, (GLfloat) - 0.638667,
+       (GLfloat) 0.974692, (GLfloat) 0.281188, (GLfloat) - 0.340079,
+       (GLfloat) 0.874620, (GLfloat) 0.342412, (GLfloat) - 0.361333,
+       (GLfloat) 0.974692, (GLfloat) 0.281188, (GLfloat) - 0.659921,
+       (GLfloat) 0.874620, (GLfloat) 0.342412, (GLfloat) - 0.638667,
+       (GLfloat) 0.906869, (GLfloat) 0.713633, (GLfloat) - 0.500000,
+       (GLfloat) 1.161726, (GLfloat) 0.497346, (GLfloat) - 0.500000,
+       (GLfloat) 0.999280, (GLfloat) 0.649745, (GLfloat) - 0.500000,
+       (GLfloat) 0.905451, (GLfloat) 0.476683, (GLfloat) - 0.262505,
+       (GLfloat) 0.907098, (GLfloat) 0.650057, (GLfloat) - 0.326227,
+       (GLfloat) 0.856159, (GLfloat) 0.481079, (GLfloat) - 0.500000,
+       (GLfloat) 0.867922, (GLfloat) 0.658641, (GLfloat) - 0.500000,
+       (GLfloat) 0.905451, (GLfloat) 0.476683, (GLfloat) - 0.737495,
+       (GLfloat) 0.907098, (GLfloat) 0.650057, (GLfloat) - 0.673773,
+       (GLfloat) 1.114357, (GLfloat) 0.334395, (GLfloat) - 0.317564,
+       (GLfloat) 0.985095, (GLfloat) 0.437116, (GLfloat) - 0.281926,
+       (GLfloat) 0.904032, (GLfloat) 0.239732, (GLfloat) - 0.500000,
+       (GLfloat) 0.905018, (GLfloat) 0.303308, (GLfloat) - 0.326227,
+       (GLfloat) 0.867922, (GLfloat) 0.481079, (GLfloat) - 0.322437,
+       (GLfloat) 1.066987, (GLfloat) 0.171444, (GLfloat) - 0.500000,
+       (GLfloat) 0.970910, (GLfloat) 0.224487, (GLfloat) - 0.500000,
+       (GLfloat) 0.905018, (GLfloat) 0.303308, (GLfloat) - 0.673773,
+       (GLfloat) 0.867922, (GLfloat) 0.303516, (GLfloat) - 0.500000,
+       (GLfloat) 1.114357, (GLfloat) 0.334395, (GLfloat) - 0.682436,
+       (GLfloat) 0.985095, (GLfloat) 0.437116, (GLfloat) - 0.718074,
+       (GLfloat) 0.867922, (GLfloat) 0.481079, (GLfloat) - 0.677562,
+       (GLfloat) 1.149095, (GLfloat) 0.453892, (GLfloat) - 0.633787,
+       (GLfloat) 1.544380, (GLfloat) 0.092162, (GLfloat) - 0.500000,
+       (GLfloat) 1.357882, (GLfloat) 0.297224, (GLfloat) - 0.500000,
+       (GLfloat) 1.149095, (GLfloat) 0.453892, (GLfloat) - 0.366213,
+       (GLfloat) 1.079619, (GLfloat) 0.214898, (GLfloat) - 0.633787,
+       (GLfloat) 1.391060, (GLfloat) 0.010509, (GLfloat) - 0.682436,
+       (GLfloat) 1.261509, (GLfloat) 0.183650, (GLfloat) - 0.663589,
+       (GLfloat) 1.391060, (GLfloat) 0.010509, (GLfloat) - 0.317564,
+       (GLfloat) 1.261509, (GLfloat) 0.183650, (GLfloat) - 0.336411,
+       (GLfloat) 1.079619, (GLfloat) 0.214898, (GLfloat) - 0.366213,
+       (GLfloat) 1.237741, (GLfloat) - 0.071143, (GLfloat) - 0.500000,
+       (GLfloat) 1.165137, (GLfloat) 0.070077, (GLfloat) - 0.500000,
+       (GLfloat) 1.526344, (GLfloat) - 0.226473, (GLfloat) - 0.737495,
+       (GLfloat) 1.483337, (GLfloat) - 0.139536, (GLfloat) - 0.718074,
+       (GLfloat) 1.503495, (GLfloat) 0.070388, (GLfloat) - 0.633787,
+       (GLfloat) 1.278626, (GLfloat) - 0.049369, (GLfloat) - 0.633787,
+       (GLfloat) 1.278626, (GLfloat) - 0.049369, (GLfloat) - 0.366213,
+       (GLfloat) 1.297571, (GLfloat) - 0.288968, (GLfloat) - 0.500000,
+       (GLfloat) 1.278985, (GLfloat) - 0.206245, (GLfloat) - 0.500000,
+       (GLfloat) 1.503495, (GLfloat) 0.070388, (GLfloat) - 0.366213,
+       (GLfloat) 1.526344, (GLfloat) - 0.226473, (GLfloat) - 0.262505,
+       (GLfloat) 1.483337, (GLfloat) - 0.139536, (GLfloat) - 0.281926,
+       (GLfloat) 1.755118, (GLfloat) - 0.163978, (GLfloat) - 0.500000,
+       (GLfloat) 1.687689, (GLfloat) - 0.072827, (GLfloat) - 0.500000,
+       (GLfloat) 1.693578, (GLfloat) - 0.180157, (GLfloat) - 0.673773,
+       (GLfloat) 1.541590, (GLfloat) - 0.275196, (GLfloat) - 0.500000,
+       (GLfloat) 1.710058, (GLfloat) - 0.217878, (GLfloat) - 0.500000,
+       (GLfloat) 1.693578, (GLfloat) - 0.180157, (GLfloat) - 0.326227,
+       (GLfloat) 1.358796, (GLfloat) - 0.271614, (GLfloat) - 0.673773,
+       (GLfloat) 1.538546, (GLfloat) - 0.263835, (GLfloat) - 0.677562,
+       (GLfloat) 1.358796, (GLfloat) - 0.271614, (GLfloat) - 0.326227,
+       (GLfloat) 1.367033, (GLfloat) - 0.309791, (GLfloat) - 0.500000,
+       (GLfloat) 1.538546, (GLfloat) - 0.263835, (GLfloat) - 0.322437,
+       (GLfloat) 0.944384, (GLfloat) 0.679375, (GLfloat) - 0.593392,
+       (GLfloat) 1.071585, (GLfloat) 0.569561, (GLfloat) - 0.579959,
+       (GLfloat) 0.998334, (GLfloat) 0.635570, (GLfloat) - 0.587230,
+       (GLfloat) 0.944384, (GLfloat) 0.679375, (GLfloat) - 0.406608,
+       (GLfloat) 0.944762, (GLfloat) 0.694795, (GLfloat) - 0.500000,
+       (GLfloat) 0.883764, (GLfloat) 0.687079, (GLfloat) - 0.587500,
+       (GLfloat) 0.907078, (GLfloat) 0.697653, (GLfloat) - 0.594723,
+       (GLfloat) 0.941357, (GLfloat) 0.556014, (GLfloat) - 0.717914,
+       (GLfloat) 0.943249, (GLfloat) 0.633115, (GLfloat) - 0.671218,
+       (GLfloat) 0.941357, (GLfloat) 0.556014, (GLfloat) - 0.282086,
+       (GLfloat) 0.943249, (GLfloat) 0.633115, (GLfloat) - 0.328782,
+       (GLfloat) 0.883764, (GLfloat) 0.687079, (GLfloat) - 0.412500,
+       (GLfloat) 0.907078, (GLfloat) 0.697653, (GLfloat) - 0.405277,
+       (GLfloat) 1.071585, (GLfloat) 0.569561, (GLfloat) - 0.420041,
+       (GLfloat) 0.998334, (GLfloat) 0.635570, (GLfloat) - 0.412770,
+       (GLfloat) 0.861889, (GLfloat) 0.571579, (GLfloat) - 0.409500,
+       (GLfloat) 0.870135, (GLfloat) 0.645704, (GLfloat) - 0.417500,
+       (GLfloat) 0.882548, (GLfloat) 0.702579, (GLfloat) - 0.500000,
+       (GLfloat) 0.883764, (GLfloat) 0.568579, (GLfloat) - 0.294000,
+       (GLfloat) 0.884979, (GLfloat) 0.641954, (GLfloat) - 0.339125,
+       (GLfloat) 0.883764, (GLfloat) 0.568579, (GLfloat) - 0.706000,
+       (GLfloat) 0.884979, (GLfloat) 0.641954, (GLfloat) - 0.660875,
+       (GLfloat) 0.861889, (GLfloat) 0.571579, (GLfloat) - 0.590500,
+       (GLfloat) 0.870135, (GLfloat) 0.645704, (GLfloat) - 0.582500,
+       (GLfloat) 1.056455, (GLfloat) 0.468757, (GLfloat) - 0.313428,
+       (GLfloat) 0.990769, (GLfloat) 0.522168, (GLfloat) - 0.296464,
+       (GLfloat) 0.936818, (GLfloat) 0.370973, (GLfloat) - 0.282086,
+       (GLfloat) 0.939088, (GLfloat) 0.463494, (GLfloat) - 0.266520,
+       (GLfloat) 0.906322, (GLfloat) 0.571188, (GLfloat) - 0.278521,
+       (GLfloat) 0.933792, (GLfloat) 0.247612, (GLfloat) - 0.406608,
+       (GLfloat) 0.934927, (GLfloat) 0.293873, (GLfloat) - 0.328782,
+       (GLfloat) 0.883764, (GLfloat) 0.393579, (GLfloat) - 0.294000,
+       (GLfloat) 0.905187, (GLfloat) 0.382177, (GLfloat) - 0.278521,
+       (GLfloat) 1.033759, (GLfloat) 0.317550, (GLfloat) - 0.313428,
+       (GLfloat) 0.979421, (GLfloat) 0.352064, (GLfloat) - 0.296464,
+       (GLfloat) 0.861889, (GLfloat) 0.390579, (GLfloat) - 0.409500,
+       (GLfloat) 0.870135, (GLfloat) 0.398579, (GLfloat) - 0.335375,
+       (GLfloat) 0.882548, (GLfloat) 0.481079, (GLfloat) - 0.278500,
+       (GLfloat) 0.883764, (GLfloat) 0.275079, (GLfloat) - 0.412500,
+       (GLfloat) 0.884979, (GLfloat) 0.320204, (GLfloat) - 0.339125,
+       (GLfloat) 0.870135, (GLfloat) 0.563579, (GLfloat) - 0.335375,
+       (GLfloat) 1.018628, (GLfloat) 0.216746, (GLfloat) - 0.420041,
+       (GLfloat) 0.971855, (GLfloat) 0.238662, (GLfloat) - 0.412770,
+       (GLfloat) 0.933792, (GLfloat) 0.247612, (GLfloat) - 0.593392,
+       (GLfloat) 0.933414, (GLfloat) 0.232192, (GLfloat) - 0.500000,
+       (GLfloat) 0.904430, (GLfloat) 0.255712, (GLfloat) - 0.405277,
+       (GLfloat) 0.936818, (GLfloat) 0.370973, (GLfloat) - 0.717914,
+       (GLfloat) 0.934927, (GLfloat) 0.293873, (GLfloat) - 0.671218,
+       (GLfloat) 0.883764, (GLfloat) 0.275079, (GLfloat) - 0.587500,
+       (GLfloat) 0.904430, (GLfloat) 0.255712, (GLfloat) - 0.594723,
+       (GLfloat) 1.018628, (GLfloat) 0.216746, (GLfloat) - 0.579959,
+       (GLfloat) 0.971855, (GLfloat) 0.238662, (GLfloat) - 0.587230,
+       (GLfloat) 0.861889, (GLfloat) 0.390579, (GLfloat) - 0.590500,
+       (GLfloat) 0.870135, (GLfloat) 0.316454, (GLfloat) - 0.582500,
+       (GLfloat) 0.882548, (GLfloat) 0.259579, (GLfloat) - 0.500000,
+       (GLfloat) 0.883764, (GLfloat) 0.393579, (GLfloat) - 0.706000,
+       (GLfloat) 0.884979, (GLfloat) 0.320204, (GLfloat) - 0.660875,
+       (GLfloat) 0.870135, (GLfloat) 0.316454, (GLfloat) - 0.417500,
+       (GLfloat) 1.033759, (GLfloat) 0.317550, (GLfloat) - 0.686572,
+       (GLfloat) 0.979421, (GLfloat) 0.352064, (GLfloat) - 0.703536,
+       (GLfloat) 0.939088, (GLfloat) 0.463494, (GLfloat) - 0.733480,
+       (GLfloat) 0.905187, (GLfloat) 0.382177, (GLfloat) - 0.721479,
+       (GLfloat) 0.906322, (GLfloat) 0.571188, (GLfloat) - 0.721479,
+       (GLfloat) 1.056455, (GLfloat) 0.468757, (GLfloat) - 0.686572,
+       (GLfloat) 0.990769, (GLfloat) 0.522168, (GLfloat) - 0.703536,
+       (GLfloat) 0.870135, (GLfloat) 0.563579, (GLfloat) - 0.664625,
+       (GLfloat) 0.882548, (GLfloat) 0.481079, (GLfloat) - 0.721500,
+       (GLfloat) 0.870135, (GLfloat) 0.398579, (GLfloat) - 0.664625,
+       (GLfloat) 0.859111, (GLfloat) 0.481079, (GLfloat) - 0.402250,
+       (GLfloat) 0.859111, (GLfloat) 0.578829, (GLfloat) - 0.500000,
+       (GLfloat) 0.859111, (GLfloat) 0.383329, (GLfloat) - 0.500000,
+       (GLfloat) 0.859111, (GLfloat) 0.481079, (GLfloat) - 0.597750,
+       (GLfloat) 1.065911, (GLfloat) 0.531759, (GLfloat) - 0.646592,
+       (GLfloat) 1.253715, (GLfloat) 0.391468, (GLfloat) - 0.567669,
+       (GLfloat) 1.158568, (GLfloat) 0.486483, (GLfloat) - 0.572975,
+       (GLfloat) 1.073477, (GLfloat) 0.582162, (GLfloat) - 0.500000,
+       (GLfloat) 1.446226, (GLfloat) 0.186168, (GLfloat) - 0.567669,
+       (GLfloat) 1.351457, (GLfloat) 0.289652, (GLfloat) - 0.565436,
+       (GLfloat) 1.253715, (GLfloat) 0.391468, (GLfloat) - 0.432331,
+       (GLfloat) 1.258403, (GLfloat) 0.400600, (GLfloat) - 0.500000,
+       (GLfloat) 1.216209, (GLfloat) 0.318418, (GLfloat) - 0.657894,
+       (GLfloat) 1.239650, (GLfloat) 0.364075, (GLfloat) - 0.624059,
+       (GLfloat) 1.216209, (GLfloat) 0.318418, (GLfloat) - 0.342106,
+       (GLfloat) 1.239650, (GLfloat) 0.364075, (GLfloat) - 0.375941,
+       (GLfloat) 1.158568, (GLfloat) 0.486483, (GLfloat) - 0.427025,
+       (GLfloat) 1.446226, (GLfloat) 0.186168, (GLfloat) - 0.432331,
+       (GLfloat) 1.351457, (GLfloat) 0.289652, (GLfloat) - 0.434564,
+       (GLfloat) 1.065911, (GLfloat) 0.531759, (GLfloat) - 0.353408,
+       (GLfloat) 1.024302, (GLfloat) 0.254547, (GLfloat) - 0.646592,
+       (GLfloat) 1.159950, (GLfloat) 0.208844, (GLfloat) - 0.657894,
+       (GLfloat) 1.095409, (GLfloat) 0.269215, (GLfloat) - 0.670274,
+       (GLfloat) 1.045107, (GLfloat) 0.393153, (GLfloat) - 0.699898,
+       (GLfloat) 1.280017, (GLfloat) 0.059132, (GLfloat) - 0.657894,
+       (GLfloat) 1.222960, (GLfloat) 0.138221, (GLfloat) - 0.652683,
+       (GLfloat) 1.188080, (GLfloat) 0.263631, (GLfloat) - 0.669172,
+       (GLfloat) 1.122445, (GLfloat) 0.135794, (GLfloat) - 0.567669,
+       (GLfloat) 1.136509, (GLfloat) 0.163187, (GLfloat) - 0.624059,
+       (GLfloat) 1.133305, (GLfloat) 0.399575, (GLfloat) - 0.670274,
+       (GLfloat) 1.379742, (GLfloat) 0.135354, (GLfloat) - 0.657894,
+       (GLfloat) 1.300058, (GLfloat) 0.229080, (GLfloat) - 0.652683,
+       (GLfloat) 1.045107, (GLfloat) 0.393153, (GLfloat) - 0.300102,
+       (GLfloat) 1.159950, (GLfloat) 0.208844, (GLfloat) - 0.342106,
+       (GLfloat) 1.095409, (GLfloat) 0.269215, (GLfloat) - 0.329726,
+       (GLfloat) 1.024302, (GLfloat) 0.254547, (GLfloat) - 0.353408,
+       (GLfloat) 1.133305, (GLfloat) 0.399575, (GLfloat) - 0.329726,
+       (GLfloat) 1.379742, (GLfloat) 0.135354, (GLfloat) - 0.342106,
+       (GLfloat) 1.300058, (GLfloat) 0.229080, (GLfloat) - 0.347317,
+       (GLfloat) 1.188080, (GLfloat) 0.263631, (GLfloat) - 0.330828,
+       (GLfloat) 1.122445, (GLfloat) 0.135794, (GLfloat) - 0.432331,
+       (GLfloat) 1.136509, (GLfloat) 0.163187, (GLfloat) - 0.375941,
+       (GLfloat) 1.280017, (GLfloat) 0.059132, (GLfloat) - 0.342106,
+       (GLfloat) 1.222960, (GLfloat) 0.138221, (GLfloat) - 0.347317,
+       (GLfloat) 1.016736, (GLfloat) 0.204145, (GLfloat) - 0.500000,
+       (GLfloat) 1.070145, (GLfloat) 0.182308, (GLfloat) - 0.572975,
+       (GLfloat) 1.070145, (GLfloat) 0.182308, (GLfloat) - 0.427025,
+       (GLfloat) 1.213533, (GLfloat) 0.008318, (GLfloat) - 0.432331,
+       (GLfloat) 1.171562, (GLfloat) 0.077649, (GLfloat) - 0.434564,
+       (GLfloat) 1.117756, (GLfloat) 0.126662, (GLfloat) - 0.500000,
+       (GLfloat) 1.213533, (GLfloat) 0.008318, (GLfloat) - 0.567669,
+       (GLfloat) 1.171562, (GLfloat) 0.077649, (GLfloat) - 0.565436,
+       (GLfloat) 1.370721, (GLfloat) - 0.099359, (GLfloat) - 0.686572,
+       (GLfloat) 1.420971, (GLfloat) - 0.216460, (GLfloat) - 0.717914,
+       (GLfloat) 1.401596, (GLfloat) - 0.166219, (GLfloat) - 0.703536,
+       (GLfloat) 1.515124, (GLfloat) - 0.041541, (GLfloat) - 0.686572,
+       (GLfloat) 1.442923, (GLfloat) - 0.070450, (GLfloat) - 0.699898,
+       (GLfloat) 1.329732, (GLfloat) - 0.022152, (GLfloat) - 0.670274,
+       (GLfloat) 1.274453, (GLfloat) - 0.137904, (GLfloat) - 0.579959,
+       (GLfloat) 1.310553, (GLfloat) - 0.123450, (GLfloat) - 0.646592,
+       (GLfloat) 1.611392, (GLfloat) - 0.002996, (GLfloat) - 0.579959,
+       (GLfloat) 1.575292, (GLfloat) - 0.017451, (GLfloat) - 0.646592,
+       (GLfloat) 1.452388, (GLfloat) 0.043170, (GLfloat) - 0.670274,
+       (GLfloat) 1.599377, (GLfloat) - 0.164832, (GLfloat) - 0.717914,
+       (GLfloat) 1.565078, (GLfloat) - 0.112852, (GLfloat) - 0.703536,
+       (GLfloat) 1.329879, (GLfloat) 0.097243, (GLfloat) - 0.669172,
+       (GLfloat) 1.421294, (GLfloat) 0.167113, (GLfloat) - 0.624059,
+       (GLfloat) 1.238464, (GLfloat) 0.027373, (GLfloat) - 0.624059,
+       (GLfloat) 1.247962, (GLfloat) - 0.065700, (GLfloat) - 0.572975,
+       (GLfloat) 1.274453, (GLfloat) - 0.137904, (GLfloat) - 0.420041,
+       (GLfloat) 1.262419, (GLfloat) - 0.142723, (GLfloat) - 0.500000,
+       (GLfloat) 1.302034, (GLfloat) - 0.250880, (GLfloat) - 0.593392,
+       (GLfloat) 1.292609, (GLfloat) - 0.201797, (GLfloat) - 0.587230,
+       (GLfloat) 1.205222, (GLfloat) 0.001966, (GLfloat) - 0.500000,
+       (GLfloat) 1.238464, (GLfloat) 0.027373, (GLfloat) - 0.375941,
+       (GLfloat) 1.247962, (GLfloat) - 0.065700, (GLfloat) - 0.427025,
+       (GLfloat) 1.302034, (GLfloat) - 0.250880, (GLfloat) - 0.406608,
+       (GLfloat) 1.292609, (GLfloat) - 0.201797, (GLfloat) - 0.412770,
+       (GLfloat) 1.370721, (GLfloat) - 0.099359, (GLfloat) - 0.313428,
+       (GLfloat) 1.310553, (GLfloat) - 0.123450, (GLfloat) - 0.353408,
+       (GLfloat) 1.329732, (GLfloat) - 0.022152, (GLfloat) - 0.329726,
+       (GLfloat) 1.515124, (GLfloat) - 0.041541, (GLfloat) - 0.313428,
+       (GLfloat) 1.442923, (GLfloat) - 0.070450, (GLfloat) - 0.300102,
+       (GLfloat) 1.420971, (GLfloat) - 0.216460, (GLfloat) - 0.282086,
+       (GLfloat) 1.401596, (GLfloat) - 0.166219, (GLfloat) - 0.296464,
+       (GLfloat) 1.329879, (GLfloat) 0.097243, (GLfloat) - 0.330828,
+       (GLfloat) 1.421294, (GLfloat) 0.167113, (GLfloat) - 0.375941,
+       (GLfloat) 1.452388, (GLfloat) 0.043170, (GLfloat) - 0.329726,
+       (GLfloat) 1.599377, (GLfloat) - 0.164832, (GLfloat) - 0.282086,
+       (GLfloat) 1.565078, (GLfloat) - 0.112852, (GLfloat) - 0.296464,
+       (GLfloat) 1.611392, (GLfloat) - 0.002996, (GLfloat) - 0.420041,
+       (GLfloat) 1.575292, (GLfloat) - 0.017451, (GLfloat) - 0.353408,
+       (GLfloat) 1.534158, (GLfloat) 0.086718, (GLfloat) - 0.427025,
+       (GLfloat) 1.623426, (GLfloat) 0.001822, (GLfloat) - 0.500000,
+       (GLfloat) 1.718314, (GLfloat) - 0.130413, (GLfloat) - 0.406608,
+       (GLfloat) 1.674065, (GLfloat) - 0.077274, (GLfloat) - 0.412770,
+       (GLfloat) 1.454536, (GLfloat) 0.192520, (GLfloat) - 0.500000,
+       (GLfloat) 1.534158, (GLfloat) 0.086718, (GLfloat) - 0.572975,
+       (GLfloat) 1.718314, (GLfloat) - 0.130413, (GLfloat) - 0.593392,
+       (GLfloat) 1.674065, (GLfloat) - 0.077274, (GLfloat) - 0.587230,
+       (GLfloat) 1.733181, (GLfloat) - 0.126110, (GLfloat) - 0.500000,
+       (GLfloat) 1.733426, (GLfloat) - 0.195216, (GLfloat) - 0.412500,
+       (GLfloat) 1.739610, (GLfloat) - 0.167898, (GLfloat) - 0.405277,
+       (GLfloat) 1.673712, (GLfloat) - 0.143320, (GLfloat) - 0.328782,
+       (GLfloat) 1.673712, (GLfloat) - 0.143320, (GLfloat) - 0.671218,
+       (GLfloat) 1.733426, (GLfloat) - 0.195216, (GLfloat) - 0.587500,
+       (GLfloat) 1.739610, (GLfloat) - 0.167898, (GLfloat) - 0.594723,
+       (GLfloat) 1.627523, (GLfloat) - 0.246239, (GLfloat) - 0.590500,
+       (GLfloat) 1.696988, (GLfloat) - 0.219088, (GLfloat) - 0.582500,
+       (GLfloat) 1.748713, (GLfloat) - 0.192378, (GLfloat) - 0.500000,
+       (GLfloat) 1.618964, (GLfloat) - 0.225886, (GLfloat) - 0.706000,
+       (GLfloat) 1.689524, (GLfloat) - 0.205721, (GLfloat) - 0.660875,
+       (GLfloat) 1.618964, (GLfloat) - 0.225886, (GLfloat) - 0.294000,
+       (GLfloat) 1.689524, (GLfloat) - 0.205721, (GLfloat) - 0.339125,
+       (GLfloat) 1.627523, (GLfloat) - 0.246239, (GLfloat) - 0.409500,
+       (GLfloat) 1.696988, (GLfloat) - 0.219088, (GLfloat) - 0.417500,
+       (GLfloat) 1.510174, (GLfloat) - 0.190646, (GLfloat) - 0.733480,
+       (GLfloat) 1.617509, (GLfloat) - 0.201252, (GLfloat) - 0.721479,
+       (GLfloat) 1.346635, (GLfloat) - 0.237972, (GLfloat) - 0.671218,
+       (GLfloat) 1.449927, (GLfloat) - 0.271179, (GLfloat) - 0.706000,
+       (GLfloat) 1.435022, (GLfloat) - 0.251106, (GLfloat) - 0.721479,
+       (GLfloat) 1.452691, (GLfloat) - 0.293085, (GLfloat) - 0.590500,
+       (GLfloat) 1.458284, (GLfloat) - 0.283049, (GLfloat) - 0.664625,
+       (GLfloat) 1.534760, (GLfloat) - 0.249706, (GLfloat) - 0.721500,
+       (GLfloat) 1.335465, (GLfloat) - 0.301849, (GLfloat) - 0.587500,
+       (GLfloat) 1.378738, (GLfloat) - 0.288996, (GLfloat) - 0.660875,
+       (GLfloat) 1.617662, (GLfloat) - 0.240344, (GLfloat) - 0.664625,
+       (GLfloat) 1.287166, (GLfloat) - 0.255182, (GLfloat) - 0.500000,
+       (GLfloat) 1.312921, (GLfloat) - 0.284460, (GLfloat) - 0.594723,
+       (GLfloat) 1.346635, (GLfloat) - 0.237972, (GLfloat) - 0.328782,
+       (GLfloat) 1.335465, (GLfloat) - 0.301849, (GLfloat) - 0.412500,
+       (GLfloat) 1.312921, (GLfloat) - 0.284460, (GLfloat) - 0.405277,
+       (GLfloat) 1.452691, (GLfloat) - 0.293085, (GLfloat) - 0.409500,
+       (GLfloat) 1.378957, (GLfloat) - 0.304305, (GLfloat) - 0.417500,
+       (GLfloat) 1.320807, (GLfloat) - 0.307035, (GLfloat) - 0.500000,
+       (GLfloat) 1.449927, (GLfloat) - 0.271179, (GLfloat) - 0.294000,
+       (GLfloat) 1.378738, (GLfloat) - 0.288996, (GLfloat) - 0.339125,
+       (GLfloat) 1.378957, (GLfloat) - 0.304305, (GLfloat) - 0.582500,
+       (GLfloat) 1.510174, (GLfloat) - 0.190646, (GLfloat) - 0.266520,
+       (GLfloat) 1.435022, (GLfloat) - 0.251106, (GLfloat) - 0.278521,
+       (GLfloat) 1.617509, (GLfloat) - 0.201252, (GLfloat) - 0.278521,
+       (GLfloat) 1.617662, (GLfloat) - 0.240344, (GLfloat) - 0.335375,
+       (GLfloat) 1.534760, (GLfloat) - 0.249706, (GLfloat) - 0.278500,
+       (GLfloat) 1.458284, (GLfloat) - 0.283049, (GLfloat) - 0.335375,
+       (GLfloat) 1.540826, (GLfloat) - 0.272345, (GLfloat) - 0.597750,
+       (GLfloat) 1.635245, (GLfloat) - 0.247046, (GLfloat) - 0.500000,
+       (GLfloat) 1.446407, (GLfloat) - 0.297645, (GLfloat) - 0.500000,
+       (GLfloat) 1.540826, (GLfloat) - 0.272345, (GLfloat) - 0.402250,
+};
+
+static GLfloat s1_5_normals[] =
+{
+       (GLfloat) 0.600201, (GLfloat) 0.679955, (GLfloat) - 0.421211,
+       (GLfloat) 0.608958, (GLfloat) 0.677912, (GLfloat) - 0.411832,
+       (GLfloat) 0.631502, (GLfloat) 0.764222, (GLfloat) - 0.131036,
+       (GLfloat) 0.633915, (GLfloat) 0.762655, (GLfloat) - 0.128491,
+       (GLfloat) 0.439368, (GLfloat) 0.885949, (GLfloat) - 0.148491,
+       (GLfloat) 0.440253, (GLfloat) 0.885591, (GLfloat) - 0.148004,
+       (GLfloat) 0.401172, (GLfloat) 0.784782, (GLfloat) - 0.472417,
+       (GLfloat) 0.401344, (GLfloat) 0.784757, (GLfloat) - 0.472314,
+       (GLfloat) 0.608958, (GLfloat) 0.677912, (GLfloat) 0.411832,
+       (GLfloat) 0.600202, (GLfloat) 0.679955, (GLfloat) 0.421211,
+       (GLfloat) 0.401173, (GLfloat) 0.784782, (GLfloat) 0.472416,
+       (GLfloat) 0.401344, (GLfloat) 0.784757, (GLfloat) 0.472314,
+       (GLfloat) 0.440253, (GLfloat) 0.885591, (GLfloat) 0.148004,
+       (GLfloat) 0.439368, (GLfloat) 0.885949, (GLfloat) 0.148491,
+       (GLfloat) 0.631502, (GLfloat) 0.764222, (GLfloat) 0.131036,
+       (GLfloat) 0.633915, (GLfloat) 0.762655, (GLfloat) 0.128491,
+       (GLfloat) - 0.936578, (GLfloat) 0.283620, (GLfloat) 0.205866,
+       (GLfloat) - 0.947923, (GLfloat) 0.264055, (GLfloat) 0.178092,
+       (GLfloat) - 0.946548, (GLfloat) 0.315105, (GLfloat) 0.068965,
+       (GLfloat) - 0.949849, (GLfloat) 0.304029, (GLfloat) 0.073162,
+       (GLfloat) - 0.446501, (GLfloat) 0.882153, (GLfloat) 0.149808,
+       (GLfloat) - 0.408128, (GLfloat) 0.897939, (GLfloat) 0.164731,
+       (GLfloat) - 0.523643, (GLfloat) 0.729794, (GLfloat) 0.439543,
+       (GLfloat) - 0.481115, (GLfloat) 0.743166, (GLfloat) 0.465009,
+       (GLfloat) - 0.947923, (GLfloat) 0.264056, (GLfloat) - 0.178092,
+       (GLfloat) - 0.936578, (GLfloat) 0.283620, (GLfloat) - 0.205866,
+       (GLfloat) - 0.523644, (GLfloat) 0.729794, (GLfloat) - 0.439543,
+       (GLfloat) - 0.481115, (GLfloat) 0.743165, (GLfloat) - 0.465009,
+       (GLfloat) - 0.408128, (GLfloat) 0.897939, (GLfloat) - 0.164732,
+       (GLfloat) - 0.446501, (GLfloat) 0.882153, (GLfloat) - 0.149808,
+       (GLfloat) - 0.949849, (GLfloat) 0.304029, (GLfloat) - 0.073162,
+       (GLfloat) - 0.946548, (GLfloat) 0.315105, (GLfloat) - 0.068965,
+       (GLfloat) 0.509419, (GLfloat) 0.426080, (GLfloat) 0.747629,
+       (GLfloat) 0.498886, (GLfloat) 0.439986, (GLfloat) 0.746676,
+       (GLfloat) 0.381490, (GLfloat) 0.130964, (GLfloat) 0.915048,
+       (GLfloat) 0.367056, (GLfloat) 0.145561, (GLfloat) 0.918739,
+       (GLfloat) 0.169535, (GLfloat) 0.163155, (GLfloat) 0.971925,
+       (GLfloat) 0.178255, (GLfloat) 0.158993, (GLfloat) 0.971054,
+       (GLfloat) 0.289187, (GLfloat) 0.493355, (GLfloat) 0.820349,
+       (GLfloat) 0.295492, (GLfloat) 0.489598, (GLfloat) 0.820352,
+       (GLfloat) 0.072844, (GLfloat) - 0.526213, (GLfloat) 0.847227,
+       (GLfloat) 0.057982, (GLfloat) - 0.518213, (GLfloat) 0.853284,
+       (GLfloat) - 0.086528, (GLfloat) - 0.515478, (GLfloat) 0.852523,
+       (GLfloat) - 0.089419, (GLfloat) - 0.514364, (GLfloat) 0.852898,
+       (GLfloat) 0.052047, (GLfloat) - 0.167008, (GLfloat) 0.984581,
+       (GLfloat) 0.051822, (GLfloat) - 0.166918, (GLfloat) 0.984608,
+       (GLfloat) 0.242298, (GLfloat) - 0.179154, (GLfloat) 0.953517,
+       (GLfloat) 0.225634, (GLfloat) - 0.167006, (GLfloat) 0.959791,
+       (GLfloat) - 0.936578, (GLfloat) - 0.205866, (GLfloat) 0.283621,
+       (GLfloat) - 0.947923, (GLfloat) - 0.178092, (GLfloat) 0.264055,
+       (GLfloat) - 0.946548, (GLfloat) - 0.068965, (GLfloat) 0.315105,
+       (GLfloat) - 0.949849, (GLfloat) - 0.073162, (GLfloat) 0.304029,
+       (GLfloat) - 0.624880, (GLfloat) - 0.128758, (GLfloat) 0.770030,
+       (GLfloat) - 0.585268, (GLfloat) - 0.149307, (GLfloat) 0.796975,
+       (GLfloat) - 0.702251, (GLfloat) - 0.367360, (GLfloat) 0.609828,
+       (GLfloat) - 0.666949, (GLfloat) - 0.398310, (GLfloat) 0.629705,
+       (GLfloat) - 0.947923, (GLfloat) 0.178092, (GLfloat) 0.264055,
+       (GLfloat) - 0.936578, (GLfloat) 0.205866, (GLfloat) 0.283621,
+       (GLfloat) - 0.567140, (GLfloat) 0.430351, (GLfloat) 0.702247,
+       (GLfloat) - 0.540648, (GLfloat) 0.447171, (GLfloat) 0.712557,
+       (GLfloat) - 0.547735, (GLfloat) 0.144705, (GLfloat) 0.824043,
+       (GLfloat) - 0.571109, (GLfloat) 0.150867, (GLfloat) 0.806892,
+       (GLfloat) - 0.949849, (GLfloat) 0.073162, (GLfloat) 0.304029,
+       (GLfloat) - 0.946548, (GLfloat) 0.068965, (GLfloat) 0.315105,
+       (GLfloat) - 0.119299, (GLfloat) - 0.854945, (GLfloat) 0.504814,
+       (GLfloat) - 0.127336, (GLfloat) - 0.851794, (GLfloat) 0.508166,
+       (GLfloat) - 0.198715, (GLfloat) - 0.967024, (GLfloat) 0.159301,
+       (GLfloat) - 0.201251, (GLfloat) - 0.966323, (GLfloat) 0.160367,
+       (GLfloat) - 0.255603, (GLfloat) - 0.953134, (GLfloat) 0.161871,
+       (GLfloat) - 0.245412, (GLfloat) - 0.956309, (GLfloat) 0.158892,
+       (GLfloat) - 0.220327, (GLfloat) - 0.834921, (GLfloat) 0.504344,
+       (GLfloat) - 0.208789, (GLfloat) - 0.839323, (GLfloat) 0.501940,
+       (GLfloat) - 0.127336, (GLfloat) - 0.851794, (GLfloat) - 0.508166,
+       (GLfloat) - 0.119299, (GLfloat) - 0.854945, (GLfloat) - 0.504814,
+       (GLfloat) - 0.220327, (GLfloat) - 0.834921, (GLfloat) - 0.504344,
+       (GLfloat) - 0.208789, (GLfloat) - 0.839323, (GLfloat) - 0.501940,
+       (GLfloat) - 0.245412, (GLfloat) - 0.956309, (GLfloat) - 0.158892,
+       (GLfloat) - 0.255603, (GLfloat) - 0.953134, (GLfloat) - 0.161871,
+       (GLfloat) - 0.198715, (GLfloat) - 0.967024, (GLfloat) - 0.159301,
+       (GLfloat) - 0.201251, (GLfloat) - 0.966323, (GLfloat) - 0.160367,
+       (GLfloat) - 0.936578, (GLfloat) - 0.283621, (GLfloat) - 0.205866,
+       (GLfloat) - 0.947923, (GLfloat) - 0.264056, (GLfloat) - 0.178092,
+       (GLfloat) - 0.946548, (GLfloat) - 0.315105, (GLfloat) - 0.068965,
+       (GLfloat) - 0.949849, (GLfloat) - 0.304029, (GLfloat) - 0.073162,
+       (GLfloat) - 0.700995, (GLfloat) - 0.702740, (GLfloat) - 0.121503,
+       (GLfloat) - 0.672056, (GLfloat) - 0.727490, (GLfloat) - 0.138204,
+       (GLfloat) - 0.726368, (GLfloat) - 0.580019, (GLfloat) - 0.368737,
+       (GLfloat) - 0.700623, (GLfloat) - 0.608968, (GLfloat) - 0.371867,
+       (GLfloat) - 0.947923, (GLfloat) - 0.264056, (GLfloat) 0.178092,
+       (GLfloat) - 0.936578, (GLfloat) - 0.283621, (GLfloat) 0.205866,
+       (GLfloat) - 0.700623, (GLfloat) - 0.608968, (GLfloat) 0.371867,
+       (GLfloat) - 0.726368, (GLfloat) - 0.580019, (GLfloat) 0.368738,
+       (GLfloat) - 0.672055, (GLfloat) - 0.727490, (GLfloat) 0.138204,
+       (GLfloat) - 0.700994, (GLfloat) - 0.702740, (GLfloat) 0.121503,
+       (GLfloat) - 0.949849, (GLfloat) - 0.304029, (GLfloat) 0.073162,
+       (GLfloat) - 0.946548, (GLfloat) - 0.315105, (GLfloat) 0.068965,
+       (GLfloat) 0.072844, (GLfloat) - 0.526213, (GLfloat) - 0.847227,
+       (GLfloat) 0.057982, (GLfloat) - 0.518214, (GLfloat) - 0.853284,
+       (GLfloat) 0.225635, (GLfloat) - 0.167007, (GLfloat) - 0.959790,
+       (GLfloat) 0.242298, (GLfloat) - 0.179154, (GLfloat) - 0.953517,
+       (GLfloat) 0.052045, (GLfloat) - 0.167008, (GLfloat) - 0.984581,
+       (GLfloat) 0.051820, (GLfloat) - 0.166918, (GLfloat) - 0.984608,
+       (GLfloat) - 0.089420, (GLfloat) - 0.514364, (GLfloat) - 0.852897,
+       (GLfloat) - 0.086529, (GLfloat) - 0.515478, (GLfloat) - 0.852523,
+       (GLfloat) 0.498887, (GLfloat) 0.439986, (GLfloat) - 0.746675,
+       (GLfloat) 0.509419, (GLfloat) 0.426080, (GLfloat) - 0.747628,
+       (GLfloat) 0.289186, (GLfloat) 0.493355, (GLfloat) - 0.820349,
+       (GLfloat) 0.295491, (GLfloat) 0.489598, (GLfloat) - 0.820353,
+       (GLfloat) 0.178253, (GLfloat) 0.158994, (GLfloat) - 0.971054,
+       (GLfloat) 0.169534, (GLfloat) 0.163155, (GLfloat) - 0.971925,
+       (GLfloat) 0.381491, (GLfloat) 0.130963, (GLfloat) - 0.915048,
+       (GLfloat) 0.367056, (GLfloat) 0.145561, (GLfloat) - 0.918739,
+       (GLfloat) - 0.936578, (GLfloat) 0.205866, (GLfloat) - 0.283621,
+       (GLfloat) - 0.947923, (GLfloat) 0.178092, (GLfloat) - 0.264056,
+       (GLfloat) - 0.946548, (GLfloat) 0.068965, (GLfloat) - 0.315105,
+       (GLfloat) - 0.949849, (GLfloat) 0.073162, (GLfloat) - 0.304029,
+       (GLfloat) - 0.547736, (GLfloat) 0.144705, (GLfloat) - 0.824043,
+       (GLfloat) - 0.571109, (GLfloat) 0.150867, (GLfloat) - 0.806892,
+       (GLfloat) - 0.567141, (GLfloat) 0.430351, (GLfloat) - 0.702246,
+       (GLfloat) - 0.540648, (GLfloat) 0.447171, (GLfloat) - 0.712557,
+       (GLfloat) - 0.947923, (GLfloat) - 0.178092, (GLfloat) - 0.264056,
+       (GLfloat) - 0.936578, (GLfloat) - 0.205866, (GLfloat) - 0.283621,
+       (GLfloat) - 0.702251, (GLfloat) - 0.367360, (GLfloat) - 0.609828,
+       (GLfloat) - 0.666949, (GLfloat) - 0.398310, (GLfloat) - 0.629705,
+       (GLfloat) - 0.585269, (GLfloat) - 0.149307, (GLfloat) - 0.796974,
+       (GLfloat) - 0.624880, (GLfloat) - 0.128758, (GLfloat) - 0.770030,
+       (GLfloat) - 0.949849, (GLfloat) - 0.073162, (GLfloat) - 0.304029,
+       (GLfloat) - 0.946548, (GLfloat) - 0.068965, (GLfloat) - 0.315105,
+       (GLfloat) - 0.982944, (GLfloat) 0.135802, (GLfloat) 0.124011,
+       (GLfloat) - 0.982944, (GLfloat) 0.124011, (GLfloat) 0.135802,
+       (GLfloat) - 0.993006, (GLfloat) 0.043834, (GLfloat) 0.109621,
+       (GLfloat) - 0.992607, (GLfloat) 0.039656, (GLfloat) 0.114709,
+       (GLfloat) - 0.998998, (GLfloat) 0.030163, (GLfloat) 0.033079,
+       (GLfloat) - 0.998998, (GLfloat) 0.033079, (GLfloat) 0.030163,
+       (GLfloat) - 0.993006, (GLfloat) 0.109621, (GLfloat) 0.043834,
+       (GLfloat) - 0.992607, (GLfloat) 0.114709, (GLfloat) 0.039656,
+       (GLfloat) - 0.982944, (GLfloat) - 0.124011, (GLfloat) 0.135803,
+       (GLfloat) - 0.982944, (GLfloat) - 0.135802, (GLfloat) 0.124011,
+       (GLfloat) - 0.993006, (GLfloat) - 0.109621, (GLfloat) 0.043834,
+       (GLfloat) - 0.992607, (GLfloat) - 0.114709, (GLfloat) 0.039656,
+       (GLfloat) - 0.998998, (GLfloat) - 0.033079, (GLfloat) 0.030163,
+       (GLfloat) - 0.998998, (GLfloat) - 0.030163, (GLfloat) 0.033079,
+       (GLfloat) - 0.993006, (GLfloat) - 0.043834, (GLfloat) 0.109621,
+       (GLfloat) - 0.992607, (GLfloat) - 0.039656, (GLfloat) 0.114709,
+       (GLfloat) - 0.982944, (GLfloat) - 0.135802, (GLfloat) - 0.124011,
+       (GLfloat) - 0.982944, (GLfloat) - 0.124011, (GLfloat) - 0.135802,
+       (GLfloat) - 0.993006, (GLfloat) - 0.043834, (GLfloat) - 0.109621,
+       (GLfloat) - 0.992607, (GLfloat) - 0.039656, (GLfloat) - 0.114709,
+       (GLfloat) - 0.998998, (GLfloat) - 0.030163, (GLfloat) - 0.033079,
+       (GLfloat) - 0.998998, (GLfloat) - 0.033079, (GLfloat) - 0.030163,
+       (GLfloat) - 0.993006, (GLfloat) - 0.109621, (GLfloat) - 0.043834,
+       (GLfloat) - 0.992607, (GLfloat) - 0.114709, (GLfloat) - 0.039656,
+       (GLfloat) - 0.982944, (GLfloat) 0.124011, (GLfloat) - 0.135802,
+       (GLfloat) - 0.982944, (GLfloat) 0.135802, (GLfloat) - 0.124011,
+       (GLfloat) - 0.993006, (GLfloat) 0.109621, (GLfloat) - 0.043834,
+       (GLfloat) - 0.992607, (GLfloat) 0.114709, (GLfloat) - 0.039656,
+       (GLfloat) - 0.998998, (GLfloat) 0.033079, (GLfloat) - 0.030163,
+       (GLfloat) - 0.998998, (GLfloat) 0.030163, (GLfloat) - 0.033079,
+       (GLfloat) - 0.993006, (GLfloat) 0.043834, (GLfloat) - 0.109621,
+       (GLfloat) - 0.992607, (GLfloat) 0.039656, (GLfloat) - 0.114709,
+       (GLfloat) 0.642600, (GLfloat) 0.650149, (GLfloat) - 0.405429,
+       (GLfloat) 0.629315, (GLfloat) 0.651735, (GLfloat) - 0.423326,
+       (GLfloat) 0.650102, (GLfloat) 0.622930, (GLfloat) - 0.435116,
+       (GLfloat) 0.644794, (GLfloat) 0.639958, (GLfloat) - 0.417963,
+       (GLfloat) 0.686498, (GLfloat) 0.714292, (GLfloat) - 0.136042,
+       (GLfloat) 0.690339, (GLfloat) 0.711978, (GLfloat) - 0.128528,
+       (GLfloat) 0.670965, (GLfloat) 0.730702, (GLfloat) - 0.126017,
+       (GLfloat) 0.667564, (GLfloat) 0.732887, (GLfloat) - 0.131284,
+       (GLfloat) 0.646461, (GLfloat) 0.595725, (GLfloat) - 0.476656,
+       (GLfloat) 0.646365, (GLfloat) 0.610461, (GLfloat) - 0.457766,
+       (GLfloat) 0.713253, (GLfloat) 0.686364, (GLfloat) - 0.142034,
+       (GLfloat) 0.714947, (GLfloat) 0.683066, (GLfloat) - 0.149235,
+       (GLfloat) 0.700923, (GLfloat) 0.700421, (GLfloat) - 0.134601,
+       (GLfloat) 0.703355, (GLfloat) 0.696368, (GLfloat) - 0.142698,
+       (GLfloat) 0.650658, (GLfloat) 0.606520, (GLfloat) - 0.456922,
+       (GLfloat) 0.648063, (GLfloat) 0.624636, (GLfloat) - 0.435712,
+       (GLfloat) 0.646461, (GLfloat) 0.595725, (GLfloat) 0.476655,
+       (GLfloat) 0.646365, (GLfloat) 0.610461, (GLfloat) 0.457766,
+       (GLfloat) 0.648063, (GLfloat) 0.624636, (GLfloat) 0.435712,
+       (GLfloat) 0.650658, (GLfloat) 0.606520, (GLfloat) 0.456922,
+       (GLfloat) 0.700923, (GLfloat) 0.700421, (GLfloat) 0.134601,
+       (GLfloat) 0.703355, (GLfloat) 0.696368, (GLfloat) 0.142698,
+       (GLfloat) 0.714947, (GLfloat) 0.683066, (GLfloat) 0.149235,
+       (GLfloat) 0.713253, (GLfloat) 0.686364, (GLfloat) 0.142034,
+       (GLfloat) 0.642600, (GLfloat) 0.650149, (GLfloat) 0.405428,
+       (GLfloat) 0.629314, (GLfloat) 0.651735, (GLfloat) 0.423326,
+       (GLfloat) 0.667564, (GLfloat) 0.732887, (GLfloat) 0.131284,
+       (GLfloat) 0.670965, (GLfloat) 0.730702, (GLfloat) 0.126017,
+       (GLfloat) 0.686498, (GLfloat) 0.714292, (GLfloat) 0.136042,
+       (GLfloat) 0.690339, (GLfloat) 0.711978, (GLfloat) 0.128528,
+       (GLfloat) 0.650102, (GLfloat) 0.622930, (GLfloat) 0.435116,
+       (GLfloat) 0.644795, (GLfloat) 0.639958, (GLfloat) 0.417963,
+       (GLfloat) - 0.056496, (GLfloat) - 0.528883, (GLfloat) - 0.846813,
+       (GLfloat) - 0.064290, (GLfloat) - 0.519887, (GLfloat) - 0.851812,
+       (GLfloat) - 0.173805, (GLfloat) - 0.513816, (GLfloat) - 0.840110,
+       (GLfloat) - 0.175837, (GLfloat) - 0.508498, (GLfloat) - 0.842918,
+       (GLfloat) 0.089052, (GLfloat) - 0.185853, (GLfloat) - 0.978534,
+       (GLfloat) 0.093599, (GLfloat) - 0.208853, (GLfloat) - 0.973458,
+       (GLfloat) 0.164361, (GLfloat) - 0.176843, (GLfloat) - 0.970418,
+       (GLfloat) 0.176320, (GLfloat) - 0.196482, (GLfloat) - 0.964524,
+       (GLfloat) - 0.389065, (GLfloat) - 0.390805, (GLfloat) - 0.834206,
+       (GLfloat) - 0.391186, (GLfloat) - 0.409817, (GLfloat) - 0.824029,
+       (GLfloat) - 0.093477, (GLfloat) - 0.154476, (GLfloat) - 0.983565,
+       (GLfloat) - 0.093921, (GLfloat) - 0.156341, (GLfloat) - 0.983228,
+       (GLfloat) 0.000626, (GLfloat) - 0.183607, (GLfloat) - 0.983000,
+       (GLfloat) - 0.000487, (GLfloat) - 0.201385, (GLfloat) - 0.979512,
+       (GLfloat) - 0.285892, (GLfloat) - 0.471460, (GLfloat) - 0.834261,
+       (GLfloat) - 0.285514, (GLfloat) - 0.475831, (GLfloat) - 0.831905,
+       (GLfloat) 0.435732, (GLfloat) 0.380700, (GLfloat) - 0.815601,
+       (GLfloat) 0.428982, (GLfloat) 0.354155, (GLfloat) - 0.830993,
+       (GLfloat) 0.473609, (GLfloat) 0.392091, (GLfloat) - 0.788643,
+       (GLfloat) 0.469979, (GLfloat) 0.356952, (GLfloat) - 0.807283,
+       (GLfloat) 0.244505, (GLfloat) 0.073495, (GLfloat) - 0.966859,
+       (GLfloat) 0.248781, (GLfloat) 0.107298, (GLfloat) - 0.962598,
+       (GLfloat) 0.172068, (GLfloat) 0.089497, (GLfloat) - 0.981011,
+       (GLfloat) 0.177919, (GLfloat) 0.109952, (GLfloat) - 0.977883,
+       (GLfloat) 0.511512, (GLfloat) 0.425325, (GLfloat) - 0.746629,
+       (GLfloat) 0.520411, (GLfloat) 0.400470, (GLfloat) - 0.754185,
+       (GLfloat) 0.360534, (GLfloat) 0.109169, (GLfloat) - 0.926336,
+       (GLfloat) 0.349374, (GLfloat) 0.135180, (GLfloat) - 0.927181,
+       (GLfloat) 0.311593, (GLfloat) 0.086000, (GLfloat) - 0.946316,
+       (GLfloat) 0.308233, (GLfloat) 0.120081, (GLfloat) - 0.943702,
+       (GLfloat) 0.500412, (GLfloat) 0.409092, (GLfloat) - 0.763041,
+       (GLfloat) 0.503536, (GLfloat) 0.376115, (GLfloat) - 0.777811,
+       (GLfloat) - 0.064290, (GLfloat) - 0.519886, (GLfloat) 0.851813,
+       (GLfloat) - 0.056496, (GLfloat) - 0.528883, (GLfloat) 0.846813,
+       (GLfloat) 0.164361, (GLfloat) - 0.176843, (GLfloat) 0.970418,
+       (GLfloat) 0.176319, (GLfloat) - 0.196482, (GLfloat) 0.964524,
+       (GLfloat) 0.093599, (GLfloat) - 0.208853, (GLfloat) 0.973458,
+       (GLfloat) 0.089052, (GLfloat) - 0.185852, (GLfloat) 0.978534,
+       (GLfloat) - 0.173805, (GLfloat) - 0.513817, (GLfloat) 0.840110,
+       (GLfloat) - 0.175837, (GLfloat) - 0.508498, (GLfloat) 0.842918,
+       (GLfloat) 0.511512, (GLfloat) 0.425325, (GLfloat) 0.746629,
+       (GLfloat) 0.520411, (GLfloat) 0.400470, (GLfloat) 0.754186,
+       (GLfloat) 0.503536, (GLfloat) 0.376115, (GLfloat) 0.777810,
+       (GLfloat) 0.500412, (GLfloat) 0.409092, (GLfloat) 0.763041,
+       (GLfloat) 0.311592, (GLfloat) 0.086000, (GLfloat) 0.946316,
+       (GLfloat) 0.308233, (GLfloat) 0.120080, (GLfloat) 0.943702,
+       (GLfloat) 0.349373, (GLfloat) 0.135180, (GLfloat) 0.927181,
+       (GLfloat) 0.360533, (GLfloat) 0.109169, (GLfloat) 0.926336,
+       (GLfloat) 0.428982, (GLfloat) 0.354155, (GLfloat) 0.830993,
+       (GLfloat) 0.435731, (GLfloat) 0.380700, (GLfloat) 0.815602,
+       (GLfloat) 0.172068, (GLfloat) 0.089497, (GLfloat) 0.981011,
+       (GLfloat) 0.177918, (GLfloat) 0.109951, (GLfloat) 0.977883,
+       (GLfloat) 0.248781, (GLfloat) 0.107298, (GLfloat) 0.962598,
+       (GLfloat) 0.244505, (GLfloat) 0.073494, (GLfloat) 0.966859,
+       (GLfloat) 0.473609, (GLfloat) 0.392091, (GLfloat) 0.788643,
+       (GLfloat) 0.469979, (GLfloat) 0.356951, (GLfloat) 0.807283,
+       (GLfloat) - 0.389065, (GLfloat) - 0.390805, (GLfloat) 0.834206,
+       (GLfloat) - 0.391186, (GLfloat) - 0.409816, (GLfloat) 0.824029,
+       (GLfloat) - 0.285514, (GLfloat) - 0.475832, (GLfloat) 0.831905,
+       (GLfloat) - 0.285892, (GLfloat) - 0.471460, (GLfloat) 0.834261,
+       (GLfloat) 0.000626, (GLfloat) - 0.183607, (GLfloat) 0.983000,
+       (GLfloat) - 0.000486, (GLfloat) - 0.201385, (GLfloat) 0.979512,
+       (GLfloat) - 0.093921, (GLfloat) - 0.156340, (GLfloat) 0.983228,
+       (GLfloat) - 0.093477, (GLfloat) - 0.154476, (GLfloat) 0.983565,
+       (GLfloat) - 0.306817, (GLfloat) - 0.816247, (GLfloat) - 0.489494,
+       (GLfloat) - 0.306526, (GLfloat) - 0.816474, (GLfloat) - 0.489298,
+       (GLfloat) - 0.401007, (GLfloat) - 0.903402, (GLfloat) - 0.151850,
+       (GLfloat) - 0.400054, (GLfloat) - 0.903928, (GLfloat) - 0.151230,
+       (GLfloat) - 0.539523, (GLfloat) - 0.829080, (GLfloat) - 0.146769,
+       (GLfloat) - 0.536423, (GLfloat) - 0.831619, (GLfloat) - 0.143741,
+       (GLfloat) - 0.439125, (GLfloat) - 0.764873, (GLfloat) - 0.471315,
+       (GLfloat) - 0.443186, (GLfloat) - 0.759550, (GLfloat) - 0.476099,
+       (GLfloat) - 0.306817, (GLfloat) - 0.816247, (GLfloat) 0.489494,
+       (GLfloat) - 0.306526, (GLfloat) - 0.816474, (GLfloat) 0.489298,
+       (GLfloat) - 0.443186, (GLfloat) - 0.759550, (GLfloat) 0.476099,
+       (GLfloat) - 0.439125, (GLfloat) - 0.764873, (GLfloat) 0.471315,
+       (GLfloat) - 0.539523, (GLfloat) - 0.829080, (GLfloat) 0.146769,
+       (GLfloat) - 0.536423, (GLfloat) - 0.831619, (GLfloat) 0.143741,
+       (GLfloat) - 0.400054, (GLfloat) - 0.903928, (GLfloat) 0.151230,
+       (GLfloat) - 0.401007, (GLfloat) - 0.903402, (GLfloat) 0.151850,
+       (GLfloat) - 0.663042, (GLfloat) - 0.578347, (GLfloat) 0.475278,
+       (GLfloat) - 0.658558, (GLfloat) - 0.599157, (GLfloat) 0.455315,
+       (GLfloat) - 0.758279, (GLfloat) - 0.634927, (GLfloat) 0.147920,
+       (GLfloat) - 0.753882, (GLfloat) - 0.642163, (GLfloat) 0.138885,
+       (GLfloat) - 0.655091, (GLfloat) - 0.742671, (GLfloat) 0.138907,
+       (GLfloat) - 0.649182, (GLfloat) - 0.746545, (GLfloat) 0.145716,
+       (GLfloat) - 0.547340, (GLfloat) - 0.690985, (GLfloat) 0.472185,
+       (GLfloat) - 0.565022, (GLfloat) - 0.687356, (GLfloat) 0.456390,
+       (GLfloat) - 0.658558, (GLfloat) - 0.599157, (GLfloat) - 0.455315,
+       (GLfloat) - 0.663042, (GLfloat) - 0.578347, (GLfloat) - 0.475278,
+       (GLfloat) - 0.565022, (GLfloat) - 0.687356, (GLfloat) - 0.456390,
+       (GLfloat) - 0.547340, (GLfloat) - 0.690985, (GLfloat) - 0.472185,
+       (GLfloat) - 0.655091, (GLfloat) - 0.742671, (GLfloat) - 0.138907,
+       (GLfloat) - 0.649182, (GLfloat) - 0.746545, (GLfloat) - 0.145716,
+       (GLfloat) - 0.758279, (GLfloat) - 0.634927, (GLfloat) - 0.147920,
+       (GLfloat) - 0.753882, (GLfloat) - 0.642163, (GLfloat) - 0.138885,
+       (GLfloat) - 0.531808, (GLfloat) - 0.030854, (GLfloat) - 0.846303,
+       (GLfloat) - 0.547325, (GLfloat) - 0.021478, (GLfloat) - 0.836644,
+       (GLfloat) - 0.214400, (GLfloat) 0.129290, (GLfloat) - 0.968151,
+       (GLfloat) - 0.232550, (GLfloat) 0.136923, (GLfloat) - 0.962898,
+       (GLfloat) - 0.234685, (GLfloat) 0.079911, (GLfloat) - 0.968781,
+       (GLfloat) - 0.210181, (GLfloat) 0.075599, (GLfloat) - 0.974735,
+       (GLfloat) - 0.528653, (GLfloat) - 0.081793, (GLfloat) - 0.844888,
+       (GLfloat) - 0.538319, (GLfloat) - 0.109397, (GLfloat) - 0.835610,
+       (GLfloat) 0.375279, (GLfloat) 0.445115, (GLfloat) - 0.813043,
+       (GLfloat) 0.363044, (GLfloat) 0.448595, (GLfloat) - 0.816677,
+       (GLfloat) 0.362957, (GLfloat) 0.428038, (GLfloat) - 0.827675,
+       (GLfloat) 0.375627, (GLfloat) 0.426947, (GLfloat) - 0.822570,
+       (GLfloat) 0.060176, (GLfloat) 0.247143, (GLfloat) - 0.967109,
+       (GLfloat) 0.080139, (GLfloat) 0.245230, (GLfloat) - 0.966147,
+       (GLfloat) 0.077981, (GLfloat) 0.282100, (GLfloat) - 0.956211,
+       (GLfloat) 0.061364, (GLfloat) 0.287374, (GLfloat) - 0.955851,
+       (GLfloat) 0.394264, (GLfloat) 0.386154, (GLfloat) - 0.833931,
+       (GLfloat) 0.391969, (GLfloat) 0.379827, (GLfloat) - 0.837909,
+       (GLfloat) 0.108284, (GLfloat) 0.149184, (GLfloat) - 0.982863,
+       (GLfloat) 0.106809, (GLfloat) 0.145488, (GLfloat) - 0.983578,
+       (GLfloat) 0.087165, (GLfloat) 0.199761, (GLfloat) - 0.975960,
+       (GLfloat) 0.069423, (GLfloat) 0.198484, (GLfloat) - 0.977642,
+       (GLfloat) 0.378360, (GLfloat) 0.405238, (GLfloat) - 0.832242,
+       (GLfloat) 0.371158, (GLfloat) 0.404730, (GLfloat) - 0.835725,
+       (GLfloat) - 0.478648, (GLfloat) - 0.265386, (GLfloat) - 0.836939,
+       (GLfloat) - 0.486707, (GLfloat) - 0.296995, (GLfloat) - 0.821529,
+       (GLfloat) - 0.514523, (GLfloat) - 0.162550, (GLfloat) - 0.841929,
+       (GLfloat) - 0.525278, (GLfloat) - 0.195128, (GLfloat) - 0.828256,
+       (GLfloat) - 0.217558, (GLfloat) - 0.004195, (GLfloat) - 0.976038,
+       (GLfloat) - 0.206190, (GLfloat) 0.022881, (GLfloat) - 0.978244,
+       (GLfloat) - 0.182077, (GLfloat) - 0.080752, (GLfloat) - 0.979963,
+       (GLfloat) - 0.175153, (GLfloat) - 0.061621, (GLfloat) - 0.982611,
+       (GLfloat) - 0.843975, (GLfloat) - 0.195207, (GLfloat) - 0.499600,
+       (GLfloat) - 0.842535, (GLfloat) - 0.181717, (GLfloat) - 0.507064,
+       (GLfloat) - 0.827895, (GLfloat) - 0.272019, (GLfloat) - 0.490506,
+       (GLfloat) - 0.826118, (GLfloat) - 0.254451, (GLfloat) - 0.502777,
+       (GLfloat) - 0.933235, (GLfloat) - 0.321752, (GLfloat) - 0.159836,
+       (GLfloat) - 0.932223, (GLfloat) - 0.327025, (GLfloat) - 0.154968,
+       (GLfloat) - 0.954881, (GLfloat) - 0.249025, (GLfloat) - 0.161829,
+       (GLfloat) - 0.954307, (GLfloat) - 0.253099, (GLfloat) - 0.158871,
+       (GLfloat) - 0.754729, (GLfloat) - 0.466616, (GLfloat) - 0.461144,
+       (GLfloat) - 0.755670, (GLfloat) - 0.441894, (GLfloat) - 0.483419,
+       (GLfloat) - 0.851851, (GLfloat) - 0.501342, (GLfloat) - 0.151677,
+       (GLfloat) - 0.848780, (GLfloat) - 0.509248, (GLfloat) - 0.142264,
+       (GLfloat) - 0.902458, (GLfloat) - 0.401405, (GLfloat) - 0.156347,
+       (GLfloat) - 0.900638, (GLfloat) - 0.408254, (GLfloat) - 0.148931,
+       (GLfloat) - 0.801108, (GLfloat) - 0.337187, (GLfloat) - 0.494500,
+       (GLfloat) - 0.802422, (GLfloat) - 0.359565, (GLfloat) - 0.476269,
+       (GLfloat) - 0.754729, (GLfloat) - 0.466616, (GLfloat) 0.461144,
+       (GLfloat) - 0.755670, (GLfloat) - 0.441893, (GLfloat) 0.483419,
+       (GLfloat) - 0.802422, (GLfloat) - 0.359565, (GLfloat) 0.476269,
+       (GLfloat) - 0.801108, (GLfloat) - 0.337187, (GLfloat) 0.494500,
+       (GLfloat) - 0.902457, (GLfloat) - 0.401405, (GLfloat) 0.156348,
+       (GLfloat) - 0.900638, (GLfloat) - 0.408254, (GLfloat) 0.148931,
+       (GLfloat) - 0.848780, (GLfloat) - 0.509248, (GLfloat) 0.142264,
+       (GLfloat) - 0.851851, (GLfloat) - 0.501342, (GLfloat) 0.151677,
+       (GLfloat) - 0.842535, (GLfloat) - 0.181718, (GLfloat) 0.507064,
+       (GLfloat) - 0.843975, (GLfloat) - 0.195207, (GLfloat) 0.499600,
+       (GLfloat) - 0.954881, (GLfloat) - 0.249025, (GLfloat) 0.161829,
+       (GLfloat) - 0.954306, (GLfloat) - 0.253099, (GLfloat) 0.158871,
+       (GLfloat) - 0.932223, (GLfloat) - 0.327025, (GLfloat) 0.154968,
+       (GLfloat) - 0.933235, (GLfloat) - 0.321752, (GLfloat) 0.159836,
+       (GLfloat) - 0.827895, (GLfloat) - 0.272019, (GLfloat) 0.490506,
+       (GLfloat) - 0.826118, (GLfloat) - 0.254451, (GLfloat) 0.502777,
+       (GLfloat) - 0.547325, (GLfloat) - 0.021478, (GLfloat) 0.836644,
+       (GLfloat) - 0.531808, (GLfloat) - 0.030854, (GLfloat) 0.846303,
+       (GLfloat) - 0.538320, (GLfloat) - 0.109397, (GLfloat) 0.835610,
+       (GLfloat) - 0.528653, (GLfloat) - 0.081793, (GLfloat) 0.844888,
+       (GLfloat) - 0.210181, (GLfloat) 0.075599, (GLfloat) 0.974735,
+       (GLfloat) - 0.234685, (GLfloat) 0.079911, (GLfloat) 0.968781,
+       (GLfloat) - 0.214400, (GLfloat) 0.129290, (GLfloat) 0.968151,
+       (GLfloat) - 0.232550, (GLfloat) 0.136923, (GLfloat) 0.962898,
+       (GLfloat) - 0.486707, (GLfloat) - 0.296995, (GLfloat) 0.821529,
+       (GLfloat) - 0.478647, (GLfloat) - 0.265386, (GLfloat) 0.836939,
+       (GLfloat) - 0.182076, (GLfloat) - 0.080752, (GLfloat) 0.979963,
+       (GLfloat) - 0.175152, (GLfloat) - 0.061621, (GLfloat) 0.982611,
+       (GLfloat) - 0.206190, (GLfloat) 0.022882, (GLfloat) 0.978244,
+       (GLfloat) - 0.217558, (GLfloat) - 0.004194, (GLfloat) 0.976038,
+       (GLfloat) - 0.514523, (GLfloat) - 0.162550, (GLfloat) 0.841928,
+       (GLfloat) - 0.525277, (GLfloat) - 0.195127, (GLfloat) 0.828257,
+       (GLfloat) 0.394264, (GLfloat) 0.386154, (GLfloat) 0.833931,
+       (GLfloat) 0.391969, (GLfloat) 0.379827, (GLfloat) 0.837909,
+       (GLfloat) 0.378360, (GLfloat) 0.405238, (GLfloat) 0.832241,
+       (GLfloat) 0.371157, (GLfloat) 0.404730, (GLfloat) 0.835725,
+       (GLfloat) 0.069422, (GLfloat) 0.198484, (GLfloat) 0.977642,
+       (GLfloat) 0.087165, (GLfloat) 0.199761, (GLfloat) 0.975960,
+       (GLfloat) 0.106809, (GLfloat) 0.145488, (GLfloat) 0.983578,
+       (GLfloat) 0.108284, (GLfloat) 0.149183, (GLfloat) 0.982863,
+       (GLfloat) 0.375279, (GLfloat) 0.445115, (GLfloat) 0.813043,
+       (GLfloat) 0.363044, (GLfloat) 0.448594, (GLfloat) 0.816678,
+       (GLfloat) 0.061364, (GLfloat) 0.287374, (GLfloat) 0.955851,
+       (GLfloat) 0.077981, (GLfloat) 0.282099, (GLfloat) 0.956211,
+       (GLfloat) 0.060176, (GLfloat) 0.247143, (GLfloat) 0.967109,
+       (GLfloat) 0.080138, (GLfloat) 0.245229, (GLfloat) 0.966147,
+       (GLfloat) 0.375627, (GLfloat) 0.426947, (GLfloat) 0.822570,
+       (GLfloat) 0.362957, (GLfloat) 0.428038, (GLfloat) 0.827675,
+       (GLfloat) 0.646717, (GLfloat) 0.598054, (GLfloat) 0.473381,
+       (GLfloat) 0.647128, (GLfloat) 0.592930, (GLfloat) 0.479227,
+       (GLfloat) 0.644233, (GLfloat) 0.592287, (GLfloat) 0.483900,
+       (GLfloat) 0.644394, (GLfloat) 0.596473, (GLfloat) 0.478515,
+       (GLfloat) 0.743754, (GLfloat) 0.650774, (GLfloat) 0.152720,
+       (GLfloat) 0.743300, (GLfloat) 0.651663, (GLfloat) 0.151130,
+       (GLfloat) 0.748383, (GLfloat) 0.646124, (GLfloat) 0.149823,
+       (GLfloat) 0.749100, (GLfloat) 0.644879, (GLfloat) 0.151594,
+       (GLfloat) 0.643063, (GLfloat) 0.599196, (GLfloat) 0.476900,
+       (GLfloat) 0.642570, (GLfloat) 0.593487, (GLfloat) 0.484641,
+       (GLfloat) 0.726590, (GLfloat) 0.670731, (GLfloat) 0.148951,
+       (GLfloat) 0.727257, (GLfloat) 0.669291, (GLfloat) 0.152139,
+       (GLfloat) 0.736367, (GLfloat) 0.659214, (GLfloat) 0.152315,
+       (GLfloat) 0.736367, (GLfloat) 0.659216, (GLfloat) 0.152312,
+       (GLfloat) 0.642386, (GLfloat) 0.594552, (GLfloat) 0.483578,
+       (GLfloat) 0.642311, (GLfloat) 0.593780, (GLfloat) 0.484626,
+       (GLfloat) 0.642570, (GLfloat) 0.593487, (GLfloat) - 0.484641,
+       (GLfloat) 0.643063, (GLfloat) 0.599196, (GLfloat) - 0.476900,
+       (GLfloat) 0.642386, (GLfloat) 0.594552, (GLfloat) - 0.483577,
+       (GLfloat) 0.642311, (GLfloat) 0.593780, (GLfloat) - 0.484626,
+       (GLfloat) 0.736367, (GLfloat) 0.659216, (GLfloat) - 0.152312,
+       (GLfloat) 0.736367, (GLfloat) 0.659214, (GLfloat) - 0.152315,
+       (GLfloat) 0.726590, (GLfloat) 0.670731, (GLfloat) - 0.148951,
+       (GLfloat) 0.727257, (GLfloat) 0.669291, (GLfloat) - 0.152139,
+       (GLfloat) 0.646717, (GLfloat) 0.598054, (GLfloat) - 0.473381,
+       (GLfloat) 0.647128, (GLfloat) 0.592931, (GLfloat) - 0.479227,
+       (GLfloat) 0.749100, (GLfloat) 0.644879, (GLfloat) - 0.151594,
+       (GLfloat) 0.748383, (GLfloat) 0.646124, (GLfloat) - 0.149823,
+       (GLfloat) 0.743754, (GLfloat) 0.650774, (GLfloat) - 0.152720,
+       (GLfloat) 0.743300, (GLfloat) 0.651663, (GLfloat) - 0.151130,
+       (GLfloat) 0.644394, (GLfloat) 0.596473, (GLfloat) - 0.478515,
+       (GLfloat) 0.644234, (GLfloat) 0.592287, (GLfloat) - 0.483900,
+       (GLfloat) 0.648818, (GLfloat) 0.595244, (GLfloat) 0.474046,
+       (GLfloat) 0.647885, (GLfloat) 0.598960, (GLfloat) 0.470630,
+       (GLfloat) 0.751896, (GLfloat) 0.641953, (GLfloat) 0.150159,
+       (GLfloat) 0.751280, (GLfloat) 0.642895, (GLfloat) 0.149213,
+       (GLfloat) 0.855755, (GLfloat) 0.491872, (GLfloat) 0.160454,
+       (GLfloat) 0.854316, (GLfloat) 0.494902, (GLfloat) 0.158798,
+       (GLfloat) 0.746074, (GLfloat) 0.437172, (GLfloat) 0.502249,
+       (GLfloat) 0.745147, (GLfloat) 0.441097, (GLfloat) 0.500189,
+       (GLfloat) 0.647885, (GLfloat) 0.598960, (GLfloat) - 0.470630,
+       (GLfloat) 0.648818, (GLfloat) 0.595244, (GLfloat) - 0.474046,
+       (GLfloat) 0.746074, (GLfloat) 0.437172, (GLfloat) - 0.502249,
+       (GLfloat) 0.745147, (GLfloat) 0.441097, (GLfloat) - 0.500189,
+       (GLfloat) 0.854316, (GLfloat) 0.494902, (GLfloat) - 0.158798,
+       (GLfloat) 0.855755, (GLfloat) 0.491872, (GLfloat) - 0.160454,
+       (GLfloat) 0.751896, (GLfloat) 0.641953, (GLfloat) - 0.150159,
+       (GLfloat) 0.751280, (GLfloat) 0.642895, (GLfloat) - 0.149213,
+       (GLfloat) 0.516361, (GLfloat) - 0.831259, (GLfloat) - 0.205866,
+       (GLfloat) 0.500398, (GLfloat) - 0.847281, (GLfloat) - 0.178091,
+       (GLfloat) 0.549353, (GLfloat) - 0.832739, (GLfloat) - 0.068965,
+       (GLfloat) 0.539508, (GLfloat) - 0.838796, (GLfloat) - 0.073163,
+       (GLfloat) 0.955872, (GLfloat) - 0.254974, (GLfloat) - 0.145934,
+       (GLfloat) 0.962750, (GLfloat) - 0.217125, (GLfloat) - 0.161151,
+       (GLfloat) 0.832302, (GLfloat) - 0.349186, (GLfloat) - 0.430515,
+       (GLfloat) 0.834893, (GLfloat) - 0.309370, (GLfloat) - 0.455242,
+       (GLfloat) 0.500398, (GLfloat) - 0.847281, (GLfloat) 0.178091,
+       (GLfloat) 0.516361, (GLfloat) - 0.831259, (GLfloat) 0.205867,
+       (GLfloat) 0.832302, (GLfloat) - 0.349186, (GLfloat) 0.430515,
+       (GLfloat) 0.834893, (GLfloat) - 0.309369, (GLfloat) 0.455242,
+       (GLfloat) 0.962750, (GLfloat) - 0.217125, (GLfloat) 0.161151,
+       (GLfloat) 0.955872, (GLfloat) - 0.254973, (GLfloat) 0.145934,
+       (GLfloat) 0.539508, (GLfloat) - 0.838796, (GLfloat) 0.073163,
+       (GLfloat) 0.549353, (GLfloat) - 0.832739, (GLfloat) 0.068965,
+       (GLfloat) 0.365166, (GLfloat) 0.464177, (GLfloat) - 0.806966,
+       (GLfloat) 0.373210, (GLfloat) 0.459657, (GLfloat) - 0.805872,
+       (GLfloat) 0.064151, (GLfloat) 0.318725, (GLfloat) - 0.945674,
+       (GLfloat) 0.075117, (GLfloat) 0.311589, (GLfloat) - 0.947243,
+       (GLfloat) 0.127864, (GLfloat) 0.159455, (GLfloat) - 0.978890,
+       (GLfloat) 0.122956, (GLfloat) 0.165169, (GLfloat) - 0.978571,
+       (GLfloat) 0.446081, (GLfloat) 0.299065, (GLfloat) - 0.843547,
+       (GLfloat) 0.442539, (GLfloat) 0.302925, (GLfloat) - 0.844035,
+       (GLfloat) - 0.541197, (GLfloat) 0.047754, (GLfloat) - 0.839539,
+       (GLfloat) - 0.545743, (GLfloat) 0.029212, (GLfloat) - 0.837443,
+       (GLfloat) - 0.504199, (GLfloat) - 0.116458, (GLfloat) - 0.855699,
+       (GLfloat) - 0.503751, (GLfloat) - 0.117103, (GLfloat) - 0.855875,
+       (GLfloat) - 0.180218, (GLfloat) 0.028848, (GLfloat) - 0.983203,
+       (GLfloat) - 0.179757, (GLfloat) 0.028254, (GLfloat) - 0.983305,
+       (GLfloat) - 0.230218, (GLfloat) 0.184662, (GLfloat) - 0.955458,
+       (GLfloat) - 0.218138, (GLfloat) 0.174858, (GLfloat) - 0.960125,
+       (GLfloat) 0.043553, (GLfloat) - 0.957947, (GLfloat) - 0.283621,
+       (GLfloat) 0.073317, (GLfloat) - 0.961717, (GLfloat) - 0.264055,
+       (GLfloat) 0.178370, (GLfloat) - 0.932145, (GLfloat) - 0.315104,
+       (GLfloat) 0.175170, (GLfloat) - 0.936420, (GLfloat) - 0.304029,
+       (GLfloat) 0.021724, (GLfloat) - 0.600335, (GLfloat) - 0.799453,
+       (GLfloat) - 0.006371, (GLfloat) - 0.568607, (GLfloat) - 0.822585,
+       (GLfloat) - 0.212402, (GLfloat) - 0.727671, (GLfloat) - 0.652212,
+       (GLfloat) - 0.248701, (GLfloat) - 0.700487, (GLfloat) - 0.668929,
+       (GLfloat) 0.430757, (GLfloat) - 0.866899, (GLfloat) - 0.250869,
+       (GLfloat) 0.427975, (GLfloat) - 0.857309, (GLfloat) - 0.286110,
+       (GLfloat) 0.561354, (GLfloat) - 0.442015, (GLfloat) - 0.699646,
+       (GLfloat) 0.571558, (GLfloat) - 0.412112, (GLfloat) - 0.709567,
+       (GLfloat) 0.286734, (GLfloat) - 0.470609, (GLfloat) - 0.834453,
+       (GLfloat) 0.281923, (GLfloat) - 0.498471, (GLfloat) - 0.819784,
+       (GLfloat) 0.316508, (GLfloat) - 0.898548, (GLfloat) - 0.304029,
+       (GLfloat) 0.311600, (GLfloat) - 0.896446, (GLfloat) - 0.315104,
+       (GLfloat) - 0.857077, (GLfloat) - 0.113037, (GLfloat) - 0.502635,
+       (GLfloat) - 0.855920, (GLfloat) - 0.100677, (GLfloat) - 0.507214,
+       (GLfloat) - 0.973550, (GLfloat) - 0.162756, (GLfloat) - 0.160346,
+       (GLfloat) - 0.972585, (GLfloat) - 0.166359, (GLfloat) - 0.162491,
+       (GLfloat) - 0.942363, (GLfloat) - 0.290210, (GLfloat) - 0.166522,
+       (GLfloat) - 0.940343, (GLfloat) - 0.298398, (GLfloat) - 0.163441,
+       (GLfloat) - 0.819387, (GLfloat) - 0.257298, (GLfloat) - 0.512252,
+       (GLfloat) - 0.820563, (GLfloat) - 0.245585, (GLfloat) - 0.516105,
+       (GLfloat) - 0.857077, (GLfloat) - 0.113037, (GLfloat) 0.502635,
+       (GLfloat) - 0.855920, (GLfloat) - 0.100677, (GLfloat) 0.507214,
+       (GLfloat) - 0.820564, (GLfloat) - 0.245585, (GLfloat) 0.516104,
+       (GLfloat) - 0.819387, (GLfloat) - 0.257297, (GLfloat) 0.512252,
+       (GLfloat) - 0.942363, (GLfloat) - 0.290210, (GLfloat) 0.166522,
+       (GLfloat) - 0.940343, (GLfloat) - 0.298398, (GLfloat) 0.163441,
+       (GLfloat) - 0.973550, (GLfloat) - 0.162756, (GLfloat) 0.160346,
+       (GLfloat) - 0.972585, (GLfloat) - 0.166359, (GLfloat) 0.162491,
+       (GLfloat) - 0.031552, (GLfloat) - 0.978072, (GLfloat) 0.205866,
+       (GLfloat) - 0.009717, (GLfloat) - 0.983966, (GLfloat) 0.178091,
+       (GLfloat) - 0.059383, (GLfloat) - 0.995850, (GLfloat) 0.068965,
+       (GLfloat) - 0.047830, (GLfloat) - 0.996172, (GLfloat) 0.073163,
+       (GLfloat) - 0.608137, (GLfloat) - 0.782136, (GLfloat) 0.135767,
+       (GLfloat) - 0.575039, (GLfloat) - 0.805344, (GLfloat) 0.144053,
+       (GLfloat) - 0.440882, (GLfloat) - 0.803158, (GLfloat) 0.400699,
+       (GLfloat) - 0.474682, (GLfloat) - 0.782654, (GLfloat) 0.402654,
+       (GLfloat) - 0.009717, (GLfloat) - 0.983966, (GLfloat) - 0.178092,
+       (GLfloat) - 0.031552, (GLfloat) - 0.978072, (GLfloat) - 0.205866,
+       (GLfloat) - 0.474681, (GLfloat) - 0.782654, (GLfloat) - 0.402654,
+       (GLfloat) - 0.440881, (GLfloat) - 0.803159, (GLfloat) - 0.400699,
+       (GLfloat) - 0.608137, (GLfloat) - 0.782136, (GLfloat) - 0.135767,
+       (GLfloat) - 0.575039, (GLfloat) - 0.805344, (GLfloat) - 0.144053,
+       (GLfloat) - 0.047830, (GLfloat) - 0.996172, (GLfloat) - 0.073163,
+       (GLfloat) - 0.059383, (GLfloat) - 0.995850, (GLfloat) - 0.068965,
+       (GLfloat) - 0.545743, (GLfloat) 0.029212, (GLfloat) 0.837443,
+       (GLfloat) - 0.541197, (GLfloat) 0.047754, (GLfloat) 0.839539,
+       (GLfloat) - 0.218137, (GLfloat) 0.174858, (GLfloat) 0.960125,
+       (GLfloat) - 0.230218, (GLfloat) 0.184662, (GLfloat) 0.955458,
+       (GLfloat) - 0.180219, (GLfloat) 0.028850, (GLfloat) 0.983203,
+       (GLfloat) - 0.179757, (GLfloat) 0.028256, (GLfloat) 0.983305,
+       (GLfloat) - 0.503751, (GLfloat) - 0.117102, (GLfloat) 0.855875,
+       (GLfloat) - 0.504199, (GLfloat) - 0.116456, (GLfloat) 0.855699,
+       (GLfloat) 0.373209, (GLfloat) 0.459657, (GLfloat) 0.805872,
+       (GLfloat) 0.365166, (GLfloat) 0.464177, (GLfloat) 0.806966,
+       (GLfloat) 0.446081, (GLfloat) 0.299065, (GLfloat) 0.843547,
+       (GLfloat) 0.442539, (GLfloat) 0.302926, (GLfloat) 0.844035,
+       (GLfloat) 0.122955, (GLfloat) 0.165170, (GLfloat) 0.978571,
+       (GLfloat) 0.127864, (GLfloat) 0.159456, (GLfloat) 0.978889,
+       (GLfloat) 0.064151, (GLfloat) 0.318724, (GLfloat) 0.945674,
+       (GLfloat) 0.075117, (GLfloat) 0.311589, (GLfloat) 0.947243,
+       (GLfloat) 0.430757, (GLfloat) - 0.866899, (GLfloat) 0.250868,
+       (GLfloat) 0.427975, (GLfloat) - 0.857309, (GLfloat) 0.286110,
+       (GLfloat) 0.311600, (GLfloat) - 0.896446, (GLfloat) 0.315104,
+       (GLfloat) 0.316508, (GLfloat) - 0.898548, (GLfloat) 0.304029,
+       (GLfloat) 0.281923, (GLfloat) - 0.498471, (GLfloat) 0.819784,
+       (GLfloat) 0.286734, (GLfloat) - 0.470608, (GLfloat) 0.834453,
+       (GLfloat) 0.561354, (GLfloat) - 0.442014, (GLfloat) 0.699647,
+       (GLfloat) 0.571558, (GLfloat) - 0.412112, (GLfloat) 0.709567,
+       (GLfloat) 0.073318, (GLfloat) - 0.961717, (GLfloat) 0.264055,
+       (GLfloat) 0.043553, (GLfloat) - 0.957947, (GLfloat) 0.283620,
+       (GLfloat) - 0.212402, (GLfloat) - 0.727670, (GLfloat) 0.652213,
+       (GLfloat) - 0.248701, (GLfloat) - 0.700487, (GLfloat) 0.668929,
+       (GLfloat) - 0.006371, (GLfloat) - 0.568606, (GLfloat) 0.822585,
+       (GLfloat) 0.021725, (GLfloat) - 0.600335, (GLfloat) 0.799453,
+       (GLfloat) 0.175170, (GLfloat) - 0.936420, (GLfloat) 0.304028,
+       (GLfloat) 0.178370, (GLfloat) - 0.932145, (GLfloat) 0.315104,
+       (GLfloat) 0.385580, (GLfloat) - 0.914303, (GLfloat) - 0.124011,
+       (GLfloat) 0.374190, (GLfloat) - 0.917355, (GLfloat) - 0.135802,
+       (GLfloat) 0.299349, (GLfloat) - 0.947826, (GLfloat) - 0.109621,
+       (GLfloat) 0.295210, (GLfloat) - 0.948521, (GLfloat) - 0.114709,
+       (GLfloat) 0.287695, (GLfloat) - 0.957151, (GLfloat) - 0.033079,
+       (GLfloat) 0.290512, (GLfloat) - 0.956396, (GLfloat) - 0.030163,
+       (GLfloat) 0.362895, (GLfloat) - 0.930799, (GLfloat) - 0.043834,
+       (GLfloat) 0.367706, (GLfloat) - 0.929096, (GLfloat) - 0.039656,
+       (GLfloat) 0.134619, (GLfloat) - 0.981547, (GLfloat) - 0.135802,
+       (GLfloat) 0.123230, (GLfloat) - 0.984599, (GLfloat) - 0.124011,
+       (GLfloat) 0.151123, (GLfloat) - 0.987543, (GLfloat) - 0.043834,
+       (GLfloat) 0.146105, (GLfloat) - 0.988474, (GLfloat) - 0.039656,
+       (GLfloat) 0.226607, (GLfloat) - 0.973519, (GLfloat) - 0.030163,
+       (GLfloat) 0.229424, (GLfloat) - 0.972764, (GLfloat) - 0.033079,
+       (GLfloat) 0.214669, (GLfloat) - 0.970516, (GLfloat) - 0.109621,
+       (GLfloat) 0.218601, (GLfloat) - 0.969049, (GLfloat) - 0.114709,
+       (GLfloat) 0.123230, (GLfloat) - 0.984599, (GLfloat) 0.124011,
+       (GLfloat) 0.134619, (GLfloat) - 0.981547, (GLfloat) 0.135802,
+       (GLfloat) 0.214669, (GLfloat) - 0.970516, (GLfloat) 0.109621,
+       (GLfloat) 0.218601, (GLfloat) - 0.969049, (GLfloat) 0.114709,
+       (GLfloat) 0.229424, (GLfloat) - 0.972764, (GLfloat) 0.033079,
+       (GLfloat) 0.226607, (GLfloat) - 0.973519, (GLfloat) 0.030163,
+       (GLfloat) 0.151123, (GLfloat) - 0.987543, (GLfloat) 0.043834,
+       (GLfloat) 0.146105, (GLfloat) - 0.988474, (GLfloat) 0.039656,
+       (GLfloat) 0.374190, (GLfloat) - 0.917355, (GLfloat) 0.135803,
+       (GLfloat) 0.385580, (GLfloat) - 0.914303, (GLfloat) 0.124011,
+       (GLfloat) 0.362895, (GLfloat) - 0.930799, (GLfloat) 0.043834,
+       (GLfloat) 0.367706, (GLfloat) - 0.929096, (GLfloat) 0.039656,
+       (GLfloat) 0.290512, (GLfloat) - 0.956396, (GLfloat) 0.030163,
+       (GLfloat) 0.287695, (GLfloat) - 0.957151, (GLfloat) 0.033079,
+       (GLfloat) 0.299349, (GLfloat) - 0.947826, (GLfloat) 0.109621,
+       (GLfloat) 0.295210, (GLfloat) - 0.948521, (GLfloat) 0.114709,
+};
+
+static unsigned short int s1_5_POLS[] =
+{
+      3, 12, 76, 74, 1, 3, 12, 74, 82, 1, 3, 76, 22, 78, 1, 3, 78, 74, 76, 1,
+      3, 20, 80, 74, 1, 3, 20, 74, 78, 1, 3, 80, 28, 82, 1, 3, 82, 74, 80, 1,
+      3, 13, 84, 77, 1, 3, 13, 77, 88, 1, 3, 84, 24, 86, 1, 3, 86, 77, 84, 1,
+      3, 20, 78, 77, 1, 3, 20, 77, 86, 1, 3, 78, 22, 88, 1, 3, 88, 77, 78, 1,
+      3, 14, 90, 85, 1, 3, 14, 85, 93, 1, 3, 26, 91, 85, 1, 3, 26, 85, 90, 1,
+      3, 20, 86, 85, 1, 3, 20, 85, 91, 1, 3, 86, 24, 93, 1, 3, 93, 85, 86, 1,
+      3, 15, 95, 79, 1, 3, 15, 79, 97, 1, 3, 95, 28, 80, 1, 3, 80, 79, 95, 1,
+      3, 20, 91, 79, 1, 3, 20, 79, 80, 1, 3, 26, 97, 79, 1, 3, 26, 79, 91, 1,
+    3, 13, 99, 83, 1, 3, 13, 83, 84, 1, 3, 99, 30, 101, 1, 3, 101, 83, 99, 1,
+  3, 23, 102, 83, 1, 3, 23, 83, 101, 1, 3, 102, 24, 84, 1, 3, 84, 83, 102, 1,
+       3, 108, 16, 104, 1, 3, 104, 100, 108, 1, 3, 32, 106, 100, 1, 3, 32, 100, 104, 1,
+       3, 106, 23, 101, 1, 3, 101, 100, 106, 1, 3, 30, 108, 100, 1, 3, 30, 100, 101, 1,
+       3, 17, 110, 105, 1, 3, 17, 105, 113, 1, 3, 33, 111, 105, 1, 3, 33, 105, 110, 1,
+       3, 23, 106, 105, 1, 3, 23, 105, 111, 1, 3, 106, 32, 113, 1, 3, 113, 105, 106, 1,
+   3, 14, 93, 92, 1, 3, 14, 92, 114, 1, 3, 93, 24, 102, 1, 3, 102, 92, 93, 1,
+3, 102, 23, 111, 1, 3, 111, 92, 102, 1, 3, 33, 114, 92, 1, 3, 33, 92, 111, 1,
+       3, 16, 116, 103, 1, 3, 16, 103, 104, 1, 3, 116, 35, 118, 1, 3, 118, 103, 116, 1,
+       3, 31, 119, 103, 1, 3, 31, 103, 118, 1, 3, 119, 32, 104, 1, 3, 104, 103, 119, 1,
+       3, 18, 121, 117, 1, 3, 18, 117, 125, 1, 3, 121, 36, 123, 1, 3, 123, 117, 121, 1,
+       3, 31, 118, 117, 1, 3, 31, 117, 123, 1, 3, 118, 35, 125, 1, 3, 125, 117, 118, 1,
+       3, 19, 127, 122, 1, 3, 19, 122, 130, 1, 3, 37, 128, 122, 1, 3, 37, 122, 127, 1,
+       3, 31, 123, 122, 1, 3, 31, 122, 128, 1, 3, 36, 130, 122, 1, 3, 36, 122, 123, 1,
+       3, 17, 113, 112, 1, 3, 17, 112, 131, 1, 3, 32, 119, 112, 1, 3, 32, 112, 113, 1,
+       3, 31, 128, 112, 1, 3, 31, 112, 119, 1, 3, 37, 131, 112, 1, 3, 37, 112, 128, 1,
+       3, 121, 18, 133, 1, 3, 133, 120, 121, 1, 3, 39, 134, 120, 1, 3, 39, 120, 133, 1,
+       3, 134, 27, 135, 1, 3, 135, 120, 134, 1, 3, 36, 121, 120, 1, 3, 36, 120, 135, 1,
+   3, 12, 82, 81, 1, 3, 12, 81, 138, 1, 3, 82, 28, 136, 1, 3, 136, 81, 82, 1,
+3, 27, 134, 81, 1, 3, 27, 81, 136, 1, 3, 134, 39, 138, 1, 3, 138, 81, 134, 1,
+   3, 15, 139, 94, 1, 3, 15, 94, 95, 1, 3, 40, 140, 94, 1, 3, 40, 94, 139, 1,
+3, 140, 27, 136, 1, 3, 136, 94, 140, 1, 3, 136, 28, 95, 1, 3, 95, 94, 136, 1,
+       3, 19, 130, 129, 1, 3, 19, 129, 141, 1, 3, 130, 36, 135, 1, 3, 135, 129, 130, 1,
+       3, 27, 140, 129, 1, 3, 27, 129, 135, 1, 3, 40, 141, 129, 1, 3, 40, 129, 140, 1,
+ 3, 14, 114, 89, 1, 3, 14, 89, 90, 1, 3, 114, 33, 142, 1, 3, 142, 89, 114, 1,
+  3, 25, 143, 89, 1, 3, 25, 89, 142, 1, 3, 143, 26, 90, 1, 3, 90, 89, 143, 1,
+       3, 17, 131, 109, 1, 3, 17, 109, 110, 1, 3, 131, 37, 144, 1, 3, 144, 109, 131, 1,
+       3, 25, 142, 109, 1, 3, 25, 109, 144, 1, 3, 142, 33, 110, 1, 3, 110, 109, 142, 1,
+       3, 19, 141, 126, 1, 3, 19, 126, 127, 1, 3, 141, 40, 145, 1, 3, 145, 126, 141, 1,
+       3, 25, 144, 126, 1, 3, 25, 126, 145, 1, 3, 144, 37, 127, 1, 3, 127, 126, 144, 1,
+   3, 15, 97, 96, 1, 3, 15, 96, 139, 1, 3, 97, 26, 143, 1, 3, 143, 96, 97, 1,
+3, 25, 145, 96, 1, 3, 25, 96, 143, 1, 3, 145, 40, 139, 1, 3, 139, 96, 145, 1,
+3, 76, 12, 146, 1, 3, 146, 75, 76, 1, 3, 146, 41, 148, 1, 3, 148, 75, 146, 1,
+ 3, 148, 21, 149, 1, 3, 149, 75, 148, 1, 3, 22, 76, 75, 1, 3, 22, 75, 149, 1,
+       3, 155, 8, 151, 1, 3, 151, 147, 155, 1, 3, 43, 153, 147, 1, 3, 43, 147, 151, 1,
+       3, 153, 21, 148, 1, 3, 148, 147, 153, 1, 3, 41, 155, 147, 1, 3, 41, 147, 148, 1,
+       3, 160, 11, 157, 1, 3, 157, 152, 160, 1, 3, 44, 158, 152, 1, 3, 44, 152, 157, 1,
+       3, 158, 21, 153, 1, 3, 153, 152, 158, 1, 3, 43, 160, 152, 1, 3, 43, 152, 153, 1,
+   3, 161, 13, 88, 1, 3, 88, 87, 161, 1, 3, 22, 149, 87, 1, 3, 22, 87, 88, 1,
+       3, 149, 21, 158, 1, 3, 158, 87, 149, 1, 3, 158, 44, 161, 1, 3, 161, 87, 158, 1,
+       3, 18, 162, 132, 1, 3, 18, 132, 133, 1, 3, 162, 45, 164, 1, 3, 164, 132, 162, 1,
+       3, 38, 165, 132, 1, 3, 38, 132, 164, 1, 3, 165, 39, 133, 1, 3, 133, 132, 165, 1,
+       3, 170, 9, 167, 1, 3, 167, 163, 170, 1, 3, 47, 168, 163, 1, 3, 47, 163, 167, 1,
+       3, 168, 38, 164, 1, 3, 164, 163, 168, 1, 3, 45, 170, 163, 1, 3, 45, 163, 164, 1,
+3, 8, 155, 154, 1, 3, 8, 154, 173, 1, 3, 155, 41, 171, 1, 3, 171, 154, 155, 1,
+       3, 38, 168, 154, 1, 3, 38, 154, 171, 1, 3, 168, 47, 173, 1, 3, 173, 154, 168, 1,
+       3, 146, 12, 138, 1, 3, 138, 137, 146, 1, 3, 39, 165, 137, 1, 3, 39, 137, 138, 1,
+       3, 165, 38, 171, 1, 3, 171, 137, 165, 1, 3, 41, 146, 137, 1, 3, 41, 137, 171, 1,
+       3, 16, 108, 107, 1, 3, 16, 107, 177, 1, 3, 108, 30, 174, 1, 3, 174, 107, 108, 1,
+       3, 29, 176, 107, 1, 3, 29, 107, 174, 1, 3, 176, 50, 177, 1, 3, 177, 107, 176, 1,
+  3, 99, 13, 161, 1, 3, 161, 98, 99, 1, 3, 44, 178, 98, 1, 3, 44, 98, 161, 1,
+ 3, 178, 29, 174, 1, 3, 174, 98, 178, 1, 3, 30, 99, 98, 1, 3, 30, 98, 174, 1,
+       3, 11, 180, 156, 1, 3, 11, 156, 157, 1, 3, 180, 49, 181, 1, 3, 181, 156, 180, 1,
+       3, 29, 178, 156, 1, 3, 29, 156, 181, 1, 3, 178, 44, 157, 1, 3, 157, 156, 178, 1,
+       3, 185, 10, 183, 1, 3, 183, 175, 185, 1, 3, 50, 176, 175, 1, 3, 50, 175, 183, 1,
+       3, 176, 29, 181, 1, 3, 181, 175, 176, 1, 3, 49, 185, 175, 1, 3, 49, 175, 181, 1,
+       3, 162, 18, 125, 1, 3, 125, 124, 162, 1, 3, 35, 186, 124, 1, 3, 35, 124, 125, 1,
+       3, 186, 34, 187, 1, 3, 187, 124, 186, 1, 3, 45, 162, 124, 1, 3, 45, 124, 187, 1,
+       3, 116, 16, 177, 1, 3, 177, 115, 116, 1, 3, 50, 188, 115, 1, 3, 50, 115, 177, 1,
+       3, 188, 34, 186, 1, 3, 186, 115, 188, 1, 3, 35, 116, 115, 1, 3, 35, 115, 186, 1,
+       3, 10, 190, 182, 1, 3, 10, 182, 183, 1, 3, 190, 52, 191, 1, 3, 191, 182, 190, 1,
+       3, 191, 34, 188, 1, 3, 188, 182, 191, 1, 3, 50, 183, 182, 1, 3, 50, 182, 188, 1,
+3, 9, 170, 169, 1, 3, 9, 169, 193, 1, 3, 45, 187, 169, 1, 3, 45, 169, 170, 1,
+       3, 187, 34, 191, 1, 3, 191, 169, 187, 1, 3, 191, 52, 193, 1, 3, 193, 169, 191, 1,
+3, 1, 196, 194, 1, 3, 1, 194, 201, 1, 3, 196, 54, 198, 1, 3, 198, 194, 196, 1,
+       3, 46, 199, 194, 1, 3, 46, 194, 198, 1, 3, 56, 201, 194, 1, 3, 56, 194, 199, 1,
+       3, 206, 3, 203, 1, 3, 203, 197, 206, 1, 3, 55, 204, 197, 1, 3, 55, 197, 203, 1,
+       3, 204, 46, 198, 1, 3, 198, 197, 204, 1, 3, 54, 206, 197, 1, 3, 54, 197, 198, 1,
+       3, 208, 8, 173, 1, 3, 173, 172, 208, 1, 3, 47, 207, 172, 1, 3, 47, 172, 173, 1,
+       3, 46, 204, 172, 1, 3, 46, 172, 207, 1, 3, 204, 55, 208, 1, 3, 208, 172, 204, 1,
+3, 9, 209, 166, 1, 3, 9, 166, 167, 1, 3, 209, 56, 199, 1, 3, 199, 166, 209, 1,
+       3, 46, 207, 166, 1, 3, 46, 166, 199, 1, 3, 207, 47, 167, 1, 3, 167, 166, 207, 1,
+3, 1, 201, 200, 1, 3, 1, 200, 214, 1, 3, 201, 56, 210, 1, 3, 210, 200, 201, 1,
+       3, 51, 212, 200, 1, 3, 51, 200, 210, 1, 3, 212, 59, 214, 1, 3, 214, 200, 212, 1,
+       3, 209, 9, 193, 1, 3, 193, 192, 209, 1, 3, 52, 215, 192, 1, 3, 52, 192, 193, 1,
+       3, 215, 51, 210, 1, 3, 210, 192, 215, 1, 3, 192, 210, 56, 1, 3, 56, 209, 192, 1,
+       3, 190, 10, 216, 1, 3, 216, 189, 190, 1, 3, 189, 216, 57, 1, 3, 57, 217, 189, 1,
+       3, 217, 51, 215, 1, 3, 215, 189, 217, 1, 3, 52, 190, 189, 1, 3, 52, 189, 215, 1,
+3, 0, 219, 211, 1, 3, 0, 211, 221, 1, 3, 219, 59, 212, 1, 3, 212, 211, 219, 1,
+       3, 51, 217, 211, 1, 3, 51, 211, 212, 1, 3, 217, 57, 221, 1, 3, 221, 211, 217, 1,
+3, 0, 221, 220, 1, 3, 0, 220, 226, 1, 3, 57, 222, 220, 1, 3, 57, 220, 221, 1,
+       3, 48, 224, 220, 1, 3, 48, 220, 222, 1, 3, 224, 62, 226, 1, 3, 226, 220, 224, 1,
+       3, 10, 185, 184, 1, 3, 10, 184, 216, 1, 3, 185, 49, 227, 1, 3, 227, 184, 185, 1,
+       3, 48, 222, 184, 1, 3, 48, 184, 227, 1, 3, 222, 57, 216, 1, 3, 216, 184, 222, 1,
+       3, 180, 11, 228, 1, 3, 228, 179, 180, 1, 3, 228, 60, 229, 1, 3, 229, 179, 228, 1,
+       3, 48, 227, 179, 1, 3, 48, 179, 229, 1, 3, 49, 180, 179, 1, 3, 49, 179, 227, 1,
+       3, 233, 2, 231, 1, 3, 231, 223, 233, 1, 3, 62, 224, 223, 1, 3, 62, 223, 231, 1,
+       3, 224, 48, 229, 1, 3, 229, 223, 224, 1, 3, 60, 233, 223, 1, 3, 60, 223, 229, 1,
+       3, 237, 2, 233, 1, 3, 233, 232, 237, 1, 3, 60, 234, 232, 1, 3, 60, 232, 233, 1,
+       3, 234, 42, 235, 1, 3, 235, 232, 234, 1, 3, 64, 237, 232, 1, 3, 64, 232, 235, 1,
+       3, 11, 160, 159, 1, 3, 11, 159, 228, 1, 3, 160, 43, 238, 1, 3, 238, 159, 160, 1,
+       3, 42, 234, 159, 1, 3, 42, 159, 238, 1, 3, 234, 60, 228, 1, 3, 228, 159, 234, 1,
+3, 8, 208, 150, 1, 3, 8, 150, 151, 1, 3, 208, 55, 239, 1, 3, 239, 150, 208, 1,
+       3, 42, 238, 150, 1, 3, 42, 150, 239, 1, 3, 238, 43, 151, 1, 3, 151, 150, 238, 1,
+       3, 203, 3, 241, 1, 3, 241, 202, 203, 1, 3, 64, 235, 202, 1, 3, 64, 202, 241, 1,
+       3, 235, 42, 239, 1, 3, 239, 202, 235, 1, 3, 55, 203, 202, 1, 3, 55, 202, 239, 1,
+3, 2, 237, 236, 1, 3, 2, 236, 245, 1, 3, 237, 64, 242, 1, 3, 242, 236, 237, 1,
+       3, 63, 244, 236, 1, 3, 63, 236, 242, 1, 3, 244, 68, 245, 1, 3, 245, 236, 244, 1,
+3, 3, 246, 240, 1, 3, 3, 240, 241, 1, 3, 246, 65, 248, 1, 3, 248, 240, 246, 1,
+       3, 63, 242, 240, 1, 3, 63, 240, 248, 1, 3, 242, 64, 241, 1, 3, 241, 240, 242, 1,
+3, 4, 250, 247, 1, 3, 4, 247, 253, 1, 3, 67, 251, 247, 1, 3, 67, 247, 250, 1,
+       3, 63, 248, 247, 1, 3, 63, 247, 251, 1, 3, 248, 65, 253, 1, 3, 253, 247, 248, 1,
+3, 7, 255, 243, 1, 3, 7, 243, 257, 1, 3, 255, 68, 244, 1, 3, 244, 243, 255, 1,
+       3, 63, 251, 243, 1, 3, 63, 243, 244, 1, 3, 67, 257, 243, 1, 3, 67, 243, 251, 1,
+3, 3, 206, 205, 1, 3, 3, 205, 246, 1, 3, 206, 54, 258, 1, 3, 258, 205, 206, 1,
+       3, 53, 259, 205, 1, 3, 53, 205, 258, 1, 3, 259, 65, 246, 1, 3, 246, 205, 259, 1,
+3, 1, 260, 195, 1, 3, 1, 195, 196, 1, 3, 69, 262, 195, 1, 3, 69, 195, 260, 1,
+       3, 262, 53, 258, 1, 3, 258, 195, 262, 1, 3, 54, 196, 195, 1, 3, 54, 195, 258, 1,
+3, 5, 264, 261, 1, 3, 5, 261, 267, 1, 3, 70, 265, 261, 1, 3, 70, 261, 264, 1,
+       3, 53, 262, 261, 1, 3, 53, 261, 265, 1, 3, 262, 69, 267, 1, 3, 267, 261, 262, 1,
+       3, 268, 4, 253, 1, 3, 253, 252, 268, 1, 3, 253, 65, 259, 1, 3, 259, 252, 253, 1,
+       3, 53, 265, 252, 1, 3, 53, 252, 259, 1, 3, 70, 268, 252, 1, 3, 70, 252, 265, 1,
+       3, 260, 1, 214, 1, 3, 214, 213, 260, 1, 3, 214, 59, 269, 1, 3, 269, 213, 214, 1,
+       3, 269, 58, 270, 1, 3, 270, 213, 269, 1, 3, 69, 260, 213, 1, 3, 69, 213, 270, 1,
+       3, 219, 0, 271, 1, 3, 271, 218, 219, 1, 3, 71, 273, 218, 1, 3, 71, 218, 271, 1,
+       3, 273, 58, 269, 1, 3, 269, 218, 273, 1, 3, 269, 59, 219, 1, 3, 219, 218, 269, 1,
+3, 6, 275, 272, 1, 3, 6, 272, 278, 1, 3, 72, 276, 272, 1, 3, 72, 272, 275, 1,
+       3, 276, 58, 273, 1, 3, 273, 272, 276, 1, 3, 71, 278, 272, 1, 3, 71, 272, 273, 1,
+3, 5, 267, 266, 1, 3, 5, 266, 279, 1, 3, 69, 270, 266, 1, 3, 69, 266, 267, 1,
+       3, 270, 58, 276, 1, 3, 276, 266, 270, 1, 3, 72, 279, 266, 1, 3, 72, 266, 276, 1,
+3, 0, 226, 225, 1, 3, 0, 225, 271, 1, 3, 62, 280, 225, 1, 3, 62, 225, 226, 1,
+       3, 280, 61, 281, 1, 3, 281, 225, 280, 1, 3, 71, 271, 225, 1, 3, 71, 225, 281, 1,
+3, 2, 245, 230, 1, 3, 2, 230, 231, 1, 3, 245, 68, 282, 1, 3, 282, 230, 245, 1,
+       3, 61, 280, 230, 1, 3, 61, 230, 282, 1, 3, 280, 62, 231, 1, 3, 231, 230, 280, 1,
+       3, 255, 7, 283, 1, 3, 283, 254, 255, 1, 3, 73, 284, 254, 1, 3, 73, 254, 283, 1,
+       3, 61, 282, 254, 1, 3, 61, 254, 284, 1, 3, 282, 68, 255, 1, 3, 255, 254, 282, 1,
+3, 6, 278, 277, 1, 3, 6, 277, 285, 1, 3, 278, 71, 281, 1, 3, 281, 277, 278, 1,
+       3, 61, 284, 277, 1, 3, 61, 277, 281, 1, 3, 73, 285, 277, 1, 3, 73, 277, 284, 1,
+3, 4, 268, 249, 1, 3, 4, 249, 250, 1, 3, 268, 70, 286, 1, 3, 286, 249, 268, 1,
+       3, 66, 287, 249, 1, 3, 66, 249, 286, 1, 3, 287, 67, 250, 1, 3, 250, 249, 287, 1,
+3, 5, 279, 263, 1, 3, 5, 263, 264, 1, 3, 279, 72, 288, 1, 3, 288, 263, 279, 1,
+       3, 66, 286, 263, 1, 3, 66, 263, 288, 1, 3, 286, 70, 264, 1, 3, 264, 263, 286, 1,
+3, 6, 285, 274, 1, 3, 6, 274, 275, 1, 3, 285, 73, 289, 1, 3, 289, 274, 285, 1,
+       3, 66, 288, 274, 1, 3, 66, 274, 289, 1, 3, 288, 72, 275, 1, 3, 275, 274, 288, 1,
+3, 7, 257, 256, 1, 3, 7, 256, 283, 1, 3, 257, 67, 287, 1, 3, 287, 256, 257, 1,
+       3, 66, 289, 256, 1, 3, 66, 256, 287, 1, 3, 289, 73, 283, 1, 3, 283, 256, 289, 1,
+
+       0
+};
+
+struct lwo  LWO_s1_5 =
+{
+       290,                    /* number of points */
+       s1_5_PNTS, s1_5_normals, s1_5_POLS, 0L
+};
+
+#endif /* MODE_sproingies */
+
+/* End of s1_5.c */
diff --git a/modes/glx/s1_6.c b/modes/glx/s1_6.c
new file mode 100644 (file)
index 0000000..cdd589f
--- /dev/null
@@ -0,0 +1,1057 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)s1_6.c       4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points, polygons, and normal vectors to render "s1_6" in 3D.
+ *
+ * Generated by lw2ogl.  Link this with your program but do
+ * not edit by hand.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_sproingies
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat s1_6_PNTS[] =
+{
+       (GLfloat) 1.339151, (GLfloat) - 0.510672, (GLfloat) - 0.339151,
+       (GLfloat) 1.339151, (GLfloat) - 0.510672, (GLfloat) - 0.660849,
+       (GLfloat) 1.660849, (GLfloat) - 0.510672, (GLfloat) - 0.339151,
+       (GLfloat) 1.660849, (GLfloat) - 0.510672, (GLfloat) - 0.660849,
+       (GLfloat) 1.638667, (GLfloat) - 0.642463, (GLfloat) - 0.638667,
+       (GLfloat) 1.361333, (GLfloat) - 0.642463, (GLfloat) - 0.638667,
+       (GLfloat) 1.361333, (GLfloat) - 0.642463, (GLfloat) - 0.361333,
+       (GLfloat) 1.638667, (GLfloat) - 0.642463, (GLfloat) - 0.361333,
+       (GLfloat) 1.589301, (GLfloat) - 0.085107, (GLfloat) - 0.624049,
+       (GLfloat) 1.356947, (GLfloat) - 0.122198, (GLfloat) - 0.624049,
+       (GLfloat) 1.356947, (GLfloat) - 0.122198, (GLfloat) - 0.375951,
+       (GLfloat) 1.589301, (GLfloat) - 0.085107, (GLfloat) - 0.375951,
+       (GLfloat) 1.460394, (GLfloat) 0.412133, (GLfloat) - 0.660849,
+       (GLfloat) 1.460394, (GLfloat) 0.412133, (GLfloat) - 0.339151,
+       (GLfloat) 1.370035, (GLfloat) 0.524394, (GLfloat) - 0.361333,
+       (GLfloat) 1.370035, (GLfloat) 0.524394, (GLfloat) - 0.638667,
+       (GLfloat) 1.226863, (GLfloat) 0.204423, (GLfloat) - 0.339151,
+       (GLfloat) 1.177383, (GLfloat) 0.324897, (GLfloat) - 0.361333,
+       (GLfloat) 1.226863, (GLfloat) 0.204423, (GLfloat) - 0.660849,
+       (GLfloat) 1.177383, (GLfloat) 0.324897, (GLfloat) - 0.638667,
+       (GLfloat) 1.460683, (GLfloat) 0.568581, (GLfloat) - 0.500000,
+       (GLfloat) 1.564666, (GLfloat) 0.208184, (GLfloat) - 0.500000,
+       (GLfloat) 1.502855, (GLfloat) 0.449898, (GLfloat) - 0.500000,
+       (GLfloat) 1.294932, (GLfloat) 0.399266, (GLfloat) - 0.262379,
+       (GLfloat) 1.416649, (GLfloat) 0.522728, (GLfloat) - 0.326134,
+       (GLfloat) 1.260429, (GLfloat) 0.437469, (GLfloat) - 0.500000,
+       (GLfloat) 1.392236, (GLfloat) 0.557026, (GLfloat) - 0.500000,
+       (GLfloat) 1.294932, (GLfloat) 0.399266, (GLfloat) - 0.737621,
+       (GLfloat) 1.416649, (GLfloat) 0.522728, (GLfloat) - 0.673866,
+       (GLfloat) 1.412872, (GLfloat) 0.126752, (GLfloat) - 0.313640,
+       (GLfloat) 1.343629, (GLfloat) 0.308278, (GLfloat) - 0.280660,
+       (GLfloat) 1.129180, (GLfloat) 0.229952, (GLfloat) - 0.500000,
+       (GLfloat) 1.174088, (GLfloat) 0.274960, (GLfloat) - 0.326134,
+       (GLfloat) 1.268890, (GLfloat) 0.429299, (GLfloat) - 0.322437,
+       (GLfloat) 1.261078, (GLfloat) 0.045321, (GLfloat) - 0.500000,
+       (GLfloat) 1.184403, (GLfloat) 0.166658, (GLfloat) - 0.500000,
+       (GLfloat) 1.174088, (GLfloat) 0.274960, (GLfloat) - 0.673866,
+       (GLfloat) 1.145545, (GLfloat) 0.301571, (GLfloat) - 0.500000,
+       (GLfloat) 1.412872, (GLfloat) 0.126752, (GLfloat) - 0.686360,
+       (GLfloat) 1.343629, (GLfloat) 0.308278, (GLfloat) - 0.719340,
+       (GLfloat) 1.268890, (GLfloat) 0.429299, (GLfloat) - 0.677562,
+       (GLfloat) 1.524188, (GLfloat) 0.186469, (GLfloat) - 0.636664,
+       (GLfloat) 1.682599, (GLfloat) - 0.328303, (GLfloat) - 0.500000,
+       (GLfloat) 1.631547, (GLfloat) - 0.078363, (GLfloat) - 0.500000,
+       (GLfloat) 1.524188, (GLfloat) 0.186469, (GLfloat) - 0.363336,
+       (GLfloat) 1.301556, (GLfloat) 0.067036, (GLfloat) - 0.636664,
+       (GLfloat) 1.497312, (GLfloat) - 0.330832, (GLfloat) - 0.686360,
+       (GLfloat) 1.473124, (GLfloat) - 0.103652, (GLfloat) - 0.669158,
+       (GLfloat) 1.497312, (GLfloat) - 0.330832, (GLfloat) - 0.313640,
+       (GLfloat) 1.473124, (GLfloat) - 0.103652, (GLfloat) - 0.330842,
+       (GLfloat) 1.301556, (GLfloat) 0.067036, (GLfloat) - 0.363336,
+       (GLfloat) 1.312026, (GLfloat) - 0.333361, (GLfloat) - 0.500000,
+       (GLfloat) 1.314701, (GLfloat) - 0.128942, (GLfloat) - 0.500000,
+       (GLfloat) 1.500000, (GLfloat) - 0.609501, (GLfloat) - 0.737621,
+       (GLfloat) 1.500000, (GLfloat) - 0.510672, (GLfloat) - 0.719340,
+       (GLfloat) 1.633189, (GLfloat) - 0.328978, (GLfloat) - 0.636664,
+       (GLfloat) 1.361436, (GLfloat) - 0.332687, (GLfloat) - 0.636664,
+       (GLfloat) 1.361436, (GLfloat) - 0.332687, (GLfloat) - 0.363336,
+       (GLfloat) 1.262379, (GLfloat) - 0.609501, (GLfloat) - 0.500000,
+       (GLfloat) 1.280660, (GLfloat) - 0.510672, (GLfloat) - 0.500000,
+       (GLfloat) 1.633189, (GLfloat) - 0.328978, (GLfloat) - 0.363336,
+       (GLfloat) 1.500000, (GLfloat) - 0.609501, (GLfloat) - 0.262379,
+       (GLfloat) 1.500000, (GLfloat) - 0.510672, (GLfloat) - 0.280660,
+       (GLfloat) 1.737621, (GLfloat) - 0.609501, (GLfloat) - 0.500000,
+       (GLfloat) 1.719340, (GLfloat) - 0.510672, (GLfloat) - 0.500000,
+       (GLfloat) 1.673866, (GLfloat) - 0.608893, (GLfloat) - 0.673866,
+       (GLfloat) 1.500000, (GLfloat) - 0.660924, (GLfloat) - 0.500000,
+       (GLfloat) 1.677562, (GLfloat) - 0.649161, (GLfloat) - 0.500000,
+       (GLfloat) 1.673866, (GLfloat) - 0.608893, (GLfloat) - 0.326134,
+       (GLfloat) 1.326134, (GLfloat) - 0.608893, (GLfloat) - 0.673866,
+       (GLfloat) 1.500000, (GLfloat) - 0.649161, (GLfloat) - 0.677562,
+       (GLfloat) 1.326134, (GLfloat) - 0.608893, (GLfloat) - 0.326134,
+       (GLfloat) 1.322438, (GLfloat) - 0.649161, (GLfloat) - 0.500000,
+       (GLfloat) 1.500000, (GLfloat) - 0.649161, (GLfloat) - 0.322437,
+       (GLfloat) 1.470529, (GLfloat) 0.515074, (GLfloat) - 0.593594,
+       (GLfloat) 1.521298, (GLfloat) 0.332708, (GLfloat) - 0.580972,
+       (GLfloat) 1.492239, (GLfloat) 0.440457, (GLfloat) - 0.587736,
+       (GLfloat) 1.470529, (GLfloat) 0.515074, (GLfloat) - 0.406406,
+       (GLfloat) 1.481548, (GLfloat) 0.525864, (GLfloat) - 0.500000,
+       (GLfloat) 1.423386, (GLfloat) 0.566478, (GLfloat) - 0.587500,
+       (GLfloat) 1.449724, (GLfloat) 0.556950, (GLfloat) - 0.594774,
+       (GLfloat) 1.382377, (GLfloat) 0.428753, (GLfloat) - 0.718387,
+       (GLfloat) 1.437472, (GLfloat) 0.482703, (GLfloat) - 0.671590,
+       (GLfloat) 1.382377, (GLfloat) 0.428753, (GLfloat) - 0.281613,
+       (GLfloat) 1.437472, (GLfloat) 0.482703, (GLfloat) - 0.328410,
+       (GLfloat) 1.423386, (GLfloat) 0.566478, (GLfloat) - 0.412500,
+       (GLfloat) 1.449724, (GLfloat) 0.556950, (GLfloat) - 0.405226,
+       (GLfloat) 1.521298, (GLfloat) 0.332708, (GLfloat) - 0.419028,
+       (GLfloat) 1.492239, (GLfloat) 0.440457, (GLfloat) - 0.412264,
+       (GLfloat) 1.327417, (GLfloat) 0.498590, (GLfloat) - 0.409500,
+       (GLfloat) 1.384841, (GLfloat) 0.546182, (GLfloat) - 0.417500,
+       (GLfloat) 1.433279, (GLfloat) 0.578472, (GLfloat) - 0.500000,
+       (GLfloat) 1.341069, (GLfloat) 0.481236, (GLfloat) - 0.294000,
+       (GLfloat) 1.392914, (GLfloat) 0.533174, (GLfloat) - 0.339125,
+       (GLfloat) 1.341069, (GLfloat) 0.481236, (GLfloat) - 0.706000,
+       (GLfloat) 1.392914, (GLfloat) 0.533174, (GLfloat) - 0.660875,
+       (GLfloat) 1.327417, (GLfloat) 0.498590, (GLfloat) - 0.590500,
+       (GLfloat) 1.384841, (GLfloat) 0.546182, (GLfloat) - 0.582500,
+       (GLfloat) 1.438984, (GLfloat) 0.272283, (GLfloat) - 0.311066,
+       (GLfloat) 1.407319, (GLfloat) 0.364926, (GLfloat) - 0.295283,
+       (GLfloat) 1.250150, (GLfloat) 0.299272, (GLfloat) - 0.281613,
+       (GLfloat) 1.316263, (GLfloat) 0.364012, (GLfloat) - 0.266014,
+       (GLfloat) 1.361260, (GLfloat) 0.466583, (GLfloat) - 0.278403,
+       (GLfloat) 1.161998, (GLfloat) 0.212951, (GLfloat) - 0.406406,
+       (GLfloat) 1.195055, (GLfloat) 0.245321, (GLfloat) - 0.328410,
+       (GLfloat) 1.219504, (GLfloat) 0.355352, (GLfloat) - 0.294000,
+       (GLfloat) 1.229040, (GLfloat) 0.331527, (GLfloat) - 0.278403,
+       (GLfloat) 1.315513, (GLfloat) 0.181646, (GLfloat) - 0.311066,
+       (GLfloat) 1.279939, (GLfloat) 0.251630, (GLfloat) - 0.295283,
+       (GLfloat) 1.201684, (GLfloat) 0.368389, (GLfloat) - 0.409500,
+       (GLfloat) 1.213173, (GLfloat) 0.368416, (GLfloat) - 0.335375,
+       (GLfloat) 1.279412, (GLfloat) 0.419138, (GLfloat) - 0.278500,
+       (GLfloat) 1.137187, (GLfloat) 0.270110, (GLfloat) - 0.412500,
+       (GLfloat) 1.169407, (GLfloat) 0.301726, (GLfloat) - 0.339125,
+       (GLfloat) 1.327792, (GLfloat) 0.487107, (GLfloat) - 0.335375,
+       (GLfloat) 1.233200, (GLfloat) 0.121222, (GLfloat) - 0.419028,
+       (GLfloat) 1.195018, (GLfloat) 0.176099, (GLfloat) - 0.412264,
+       (GLfloat) 1.161998, (GLfloat) 0.212951, (GLfloat) - 0.593594,
+       (GLfloat) 1.150979, (GLfloat) 0.202161, (GLfloat) - 0.500000,
+       (GLfloat) 1.140576, (GLfloat) 0.241160, (GLfloat) - 0.405226,
+       (GLfloat) 1.250150, (GLfloat) 0.299272, (GLfloat) - 0.718387,
+       (GLfloat) 1.195055, (GLfloat) 0.245321, (GLfloat) - 0.671590,
+       (GLfloat) 1.137187, (GLfloat) 0.270110, (GLfloat) - 0.587500,
+       (GLfloat) 1.140576, (GLfloat) 0.241160, (GLfloat) - 0.594774,
+       (GLfloat) 1.233200, (GLfloat) 0.121222, (GLfloat) - 0.580972,
+       (GLfloat) 1.195018, (GLfloat) 0.176099, (GLfloat) - 0.587736,
+       (GLfloat) 1.201684, (GLfloat) 0.368389, (GLfloat) - 0.590500,
+       (GLfloat) 1.156124, (GLfloat) 0.309340, (GLfloat) - 0.582500,
+       (GLfloat) 1.125545, (GLfloat) 0.259804, (GLfloat) - 0.500000,
+       (GLfloat) 1.219504, (GLfloat) 0.355352, (GLfloat) - 0.706000,
+       (GLfloat) 1.169407, (GLfloat) 0.301726, (GLfloat) - 0.660875,
+       (GLfloat) 1.156124, (GLfloat) 0.309340, (GLfloat) - 0.417500,
+       (GLfloat) 1.315513, (GLfloat) 0.181646, (GLfloat) - 0.688934,
+       (GLfloat) 1.279939, (GLfloat) 0.251630, (GLfloat) - 0.704717,
+       (GLfloat) 1.316263, (GLfloat) 0.364012, (GLfloat) - 0.733986,
+       (GLfloat) 1.229040, (GLfloat) 0.331527, (GLfloat) - 0.721597,
+       (GLfloat) 1.361260, (GLfloat) 0.466583, (GLfloat) - 0.721597,
+       (GLfloat) 1.438984, (GLfloat) 0.272283, (GLfloat) - 0.688934,
+       (GLfloat) 1.407319, (GLfloat) 0.364926, (GLfloat) - 0.704717,
+       (GLfloat) 1.327792, (GLfloat) 0.487107, (GLfloat) - 0.664625,
+       (GLfloat) 1.279412, (GLfloat) 0.419138, (GLfloat) - 0.721500,
+       (GLfloat) 1.213173, (GLfloat) 0.368416, (GLfloat) - 0.664625,
+       (GLfloat) 1.262552, (GLfloat) 0.435419, (GLfloat) - 0.402250,
+       (GLfloat) 1.330455, (GLfloat) 0.505735, (GLfloat) - 0.500000,
+       (GLfloat) 1.194650, (GLfloat) 0.365104, (GLfloat) - 0.500000,
+       (GLfloat) 1.262552, (GLfloat) 0.435419, (GLfloat) - 0.597750,
+       (GLfloat) 1.490430, (GLfloat) 0.310049, (GLfloat) - 0.648448,
+       (GLfloat) 1.588828, (GLfloat) 0.061527, (GLfloat) - 0.569694,
+       (GLfloat) 1.554547, (GLfloat) 0.202755, (GLfloat) - 0.574544,
+       (GLfloat) 1.531587, (GLfloat) 0.340261, (GLfloat) - 0.500000,
+       (GLfloat) 1.647861, (GLfloat) - 0.211045, (GLfloat) - 0.569694,
+       (GLfloat) 1.620986, (GLfloat) - 0.080049, (GLfloat) - 0.567663,
+       (GLfloat) 1.588828, (GLfloat) 0.061527, (GLfloat) - 0.430306,
+       (GLfloat) 1.599013, (GLfloat) 0.064899, (GLfloat) - 0.500000,
+       (GLfloat) 1.507354, (GLfloat) 0.034552, (GLfloat) - 0.662619,
+       (GLfloat) 1.558275, (GLfloat) 0.051411, (GLfloat) - 0.627772,
+       (GLfloat) 1.507354, (GLfloat) 0.034552, (GLfloat) - 0.337381,
+       (GLfloat) 1.558275, (GLfloat) 0.051411, (GLfloat) - 0.372228,
+       (GLfloat) 1.554547, (GLfloat) 0.202755, (GLfloat) - 0.425456,
+       (GLfloat) 1.647861, (GLfloat) - 0.211045, (GLfloat) - 0.430306,
+       (GLfloat) 1.620986, (GLfloat) - 0.080049, (GLfloat) - 0.432337,
+       (GLfloat) 1.490430, (GLfloat) 0.310049, (GLfloat) - 0.351552,
+       (GLfloat) 1.264067, (GLfloat) 0.143881, (GLfloat) - 0.648448,
+       (GLfloat) 1.385142, (GLfloat) - 0.005911, (GLfloat) - 0.662619,
+       (GLfloat) 1.352154, (GLfloat) 0.094180, (GLfloat) - 0.673936,
+       (GLfloat) 1.377249, (GLfloat) 0.226965, (GLfloat) - 0.702430,
+       (GLfloat) 1.421273, (GLfloat) - 0.224532, (GLfloat) - 0.662619,
+       (GLfloat) 1.409755, (GLfloat) - 0.113768, (GLfloat) - 0.657881,
+       (GLfloat) 1.446248, (GLfloat) 0.014320, (GLfloat) - 0.674234,
+       (GLfloat) 1.303667, (GLfloat) - 0.032887, (GLfloat) - 0.569694,
+       (GLfloat) 1.334220, (GLfloat) - 0.022771, (GLfloat) - 0.627772,
+       (GLfloat) 1.473590, (GLfloat) 0.159325, (GLfloat) - 0.673936,
+       (GLfloat) 1.557226, (GLfloat) - 0.216440, (GLfloat) - 0.662619,
+       (GLfloat) 1.536493, (GLfloat) - 0.093537, (GLfloat) - 0.657881,
+       (GLfloat) 1.377249, (GLfloat) 0.226965, (GLfloat) - 0.297570,
+       (GLfloat) 1.385142, (GLfloat) - 0.005911, (GLfloat) - 0.337381,
+       (GLfloat) 1.352154, (GLfloat) 0.094180, (GLfloat) - 0.326064,
+       (GLfloat) 1.264067, (GLfloat) 0.143881, (GLfloat) - 0.351552,
+       (GLfloat) 1.473590, (GLfloat) 0.159325, (GLfloat) - 0.326064,
+       (GLfloat) 1.557226, (GLfloat) - 0.216440, (GLfloat) - 0.337381,
+       (GLfloat) 1.536493, (GLfloat) - 0.093537, (GLfloat) - 0.342119,
+       (GLfloat) 1.446248, (GLfloat) 0.014320, (GLfloat) - 0.325766,
+       (GLfloat) 1.303667, (GLfloat) - 0.032887, (GLfloat) - 0.430306,
+       (GLfloat) 1.334220, (GLfloat) - 0.022771, (GLfloat) - 0.372228,
+       (GLfloat) 1.421273, (GLfloat) - 0.224532, (GLfloat) - 0.337381,
+       (GLfloat) 1.409755, (GLfloat) - 0.113768, (GLfloat) - 0.342119,
+       (GLfloat) 1.222911, (GLfloat) 0.113669, (GLfloat) - 0.500000,
+       (GLfloat) 1.271198, (GLfloat) 0.050750, (GLfloat) - 0.574544,
+       (GLfloat) 1.271198, (GLfloat) 0.050750, (GLfloat) - 0.425456,
+       (GLfloat) 1.330638, (GLfloat) - 0.229927, (GLfloat) - 0.430306,
+       (GLfloat) 1.325262, (GLfloat) - 0.127256, (GLfloat) - 0.432337,
+       (GLfloat) 1.293483, (GLfloat) - 0.036258, (GLfloat) - 0.500000,
+       (GLfloat) 1.330638, (GLfloat) - 0.229927, (GLfloat) - 0.569694,
+       (GLfloat) 1.325262, (GLfloat) - 0.127256, (GLfloat) - 0.567663,
+       (GLfloat) 1.419028, (GLfloat) - 0.429344, (GLfloat) - 0.688934,
+       (GLfloat) 1.406406, (GLfloat) - 0.569469, (GLfloat) - 0.718387,
+       (GLfloat) 1.412264, (GLfloat) - 0.510672, (GLfloat) - 0.704717,
+       (GLfloat) 1.580972, (GLfloat) - 0.429344, (GLfloat) - 0.688934,
+       (GLfloat) 1.500000, (GLfloat) - 0.429344, (GLfloat) - 0.702430,
+       (GLfloat) 1.423198, (GLfloat) - 0.331844, (GLfloat) - 0.673936,
+       (GLfloat) 1.311066, (GLfloat) - 0.429344, (GLfloat) - 0.580972,
+       (GLfloat) 1.351552, (GLfloat) - 0.429344, (GLfloat) - 0.648448,
+       (GLfloat) 1.688934, (GLfloat) - 0.429344, (GLfloat) - 0.580972,
+       (GLfloat) 1.648448, (GLfloat) - 0.429344, (GLfloat) - 0.648448,
+       (GLfloat) 1.571427, (GLfloat) - 0.329821, (GLfloat) - 0.673936,
+       (GLfloat) 1.593594, (GLfloat) - 0.569469, (GLfloat) - 0.718387,
+       (GLfloat) 1.587736, (GLfloat) - 0.510672, (GLfloat) - 0.704717,
+       (GLfloat) 1.489249, (GLfloat) - 0.220486, (GLfloat) - 0.674234,
+       (GLfloat) 1.613873, (GLfloat) - 0.213068, (GLfloat) - 0.627772,
+       (GLfloat) 1.364627, (GLfloat) - 0.227904, (GLfloat) - 0.627772,
+       (GLfloat) 1.324378, (GLfloat) - 0.333193, (GLfloat) - 0.574544,
+       (GLfloat) 1.311066, (GLfloat) - 0.429344, (GLfloat) - 0.419028,
+       (GLfloat) 1.297570, (GLfloat) - 0.429344, (GLfloat) - 0.500000,
+       (GLfloat) 1.281613, (GLfloat) - 0.569469, (GLfloat) - 0.593594,
+       (GLfloat) 1.295283, (GLfloat) - 0.510672, (GLfloat) - 0.587736,
+       (GLfloat) 1.319309, (GLfloat) - 0.230602, (GLfloat) - 0.500000,
+       (GLfloat) 1.364627, (GLfloat) - 0.227904, (GLfloat) - 0.372228,
+       (GLfloat) 1.324378, (GLfloat) - 0.333193, (GLfloat) - 0.425456,
+       (GLfloat) 1.281613, (GLfloat) - 0.569469, (GLfloat) - 0.406406,
+       (GLfloat) 1.295283, (GLfloat) - 0.510672, (GLfloat) - 0.412264,
+       (GLfloat) 1.419028, (GLfloat) - 0.429344, (GLfloat) - 0.311066,
+       (GLfloat) 1.351552, (GLfloat) - 0.429344, (GLfloat) - 0.351552,
+       (GLfloat) 1.423198, (GLfloat) - 0.331844, (GLfloat) - 0.326064,
+       (GLfloat) 1.580972, (GLfloat) - 0.429344, (GLfloat) - 0.311066,
+       (GLfloat) 1.500000, (GLfloat) - 0.429344, (GLfloat) - 0.297570,
+       (GLfloat) 1.406406, (GLfloat) - 0.569469, (GLfloat) - 0.281613,
+       (GLfloat) 1.412264, (GLfloat) - 0.510672, (GLfloat) - 0.295283,
+       (GLfloat) 1.489249, (GLfloat) - 0.220486, (GLfloat) - 0.325766,
+       (GLfloat) 1.613873, (GLfloat) - 0.213068, (GLfloat) - 0.372228,
+       (GLfloat) 1.571427, (GLfloat) - 0.329821, (GLfloat) - 0.326064,
+       (GLfloat) 1.593594, (GLfloat) - 0.569469, (GLfloat) - 0.281613,
+       (GLfloat) 1.587736, (GLfloat) - 0.510672, (GLfloat) - 0.295283,
+       (GLfloat) 1.688934, (GLfloat) - 0.429344, (GLfloat) - 0.419028,
+       (GLfloat) 1.648448, (GLfloat) - 0.429344, (GLfloat) - 0.351552,
+       (GLfloat) 1.670246, (GLfloat) - 0.328472, (GLfloat) - 0.425456,
+       (GLfloat) 1.702430, (GLfloat) - 0.429344, (GLfloat) - 0.500000,
+       (GLfloat) 1.718387, (GLfloat) - 0.569469, (GLfloat) - 0.406406,
+       (GLfloat) 1.704717, (GLfloat) - 0.510672, (GLfloat) - 0.412264,
+       (GLfloat) 1.659190, (GLfloat) - 0.210370, (GLfloat) - 0.500000,
+       (GLfloat) 1.670246, (GLfloat) - 0.328472, (GLfloat) - 0.574544,
+       (GLfloat) 1.718387, (GLfloat) - 0.569469, (GLfloat) - 0.593594,
+       (GLfloat) 1.704717, (GLfloat) - 0.510672, (GLfloat) - 0.587736,
+       (GLfloat) 1.733986, (GLfloat) - 0.569469, (GLfloat) - 0.500000,
+       (GLfloat) 1.706000, (GLfloat) - 0.633319, (GLfloat) - 0.412500,
+       (GLfloat) 1.721597, (GLfloat) - 0.609197, (GLfloat) - 0.405226,
+       (GLfloat) 1.671590, (GLfloat) - 0.569469, (GLfloat) - 0.328410,
+       (GLfloat) 1.671590, (GLfloat) - 0.569469, (GLfloat) - 0.671590,
+       (GLfloat) 1.706000, (GLfloat) - 0.633319, (GLfloat) - 0.587500,
+       (GLfloat) 1.721597, (GLfloat) - 0.609197, (GLfloat) - 0.594774,
+       (GLfloat) 1.590500, (GLfloat) - 0.655194, (GLfloat) - 0.590500,
+       (GLfloat) 1.664625, (GLfloat) - 0.646948, (GLfloat) - 0.582500,
+       (GLfloat) 1.721500, (GLfloat) - 0.634535, (GLfloat) - 0.500000,
+       (GLfloat) 1.587500, (GLfloat) - 0.633319, (GLfloat) - 0.706000,
+       (GLfloat) 1.660875, (GLfloat) - 0.632104, (GLfloat) - 0.660875,
+       (GLfloat) 1.587500, (GLfloat) - 0.633319, (GLfloat) - 0.294000,
+       (GLfloat) 1.660875, (GLfloat) - 0.632104, (GLfloat) - 0.339125,
+       (GLfloat) 1.590500, (GLfloat) - 0.655194, (GLfloat) - 0.409500,
+       (GLfloat) 1.664625, (GLfloat) - 0.646948, (GLfloat) - 0.417500,
+       (GLfloat) 1.500000, (GLfloat) - 0.569469, (GLfloat) - 0.733986,
+       (GLfloat) 1.594774, (GLfloat) - 0.609197, (GLfloat) - 0.721597,
+       (GLfloat) 1.328410, (GLfloat) - 0.569469, (GLfloat) - 0.671590,
+       (GLfloat) 1.412500, (GLfloat) - 0.633319, (GLfloat) - 0.706000,
+       (GLfloat) 1.405226, (GLfloat) - 0.609197, (GLfloat) - 0.721597,
+       (GLfloat) 1.409500, (GLfloat) - 0.655194, (GLfloat) - 0.590500,
+       (GLfloat) 1.417500, (GLfloat) - 0.646948, (GLfloat) - 0.664625,
+       (GLfloat) 1.500000, (GLfloat) - 0.634535, (GLfloat) - 0.721500,
+       (GLfloat) 1.294000, (GLfloat) - 0.633319, (GLfloat) - 0.587500,
+       (GLfloat) 1.339125, (GLfloat) - 0.632104, (GLfloat) - 0.660875,
+       (GLfloat) 1.582500, (GLfloat) - 0.646948, (GLfloat) - 0.664625,
+       (GLfloat) 1.266014, (GLfloat) - 0.569469, (GLfloat) - 0.500000,
+       (GLfloat) 1.278403, (GLfloat) - 0.609197, (GLfloat) - 0.594774,
+       (GLfloat) 1.328410, (GLfloat) - 0.569469, (GLfloat) - 0.328410,
+       (GLfloat) 1.294000, (GLfloat) - 0.633319, (GLfloat) - 0.412500,
+       (GLfloat) 1.278403, (GLfloat) - 0.609197, (GLfloat) - 0.405226,
+       (GLfloat) 1.409500, (GLfloat) - 0.655194, (GLfloat) - 0.409500,
+       (GLfloat) 1.335375, (GLfloat) - 0.646948, (GLfloat) - 0.417500,
+       (GLfloat) 1.278500, (GLfloat) - 0.634535, (GLfloat) - 0.500000,
+       (GLfloat) 1.412500, (GLfloat) - 0.633319, (GLfloat) - 0.294000,
+       (GLfloat) 1.339125, (GLfloat) - 0.632104, (GLfloat) - 0.339125,
+       (GLfloat) 1.335375, (GLfloat) - 0.646948, (GLfloat) - 0.582500,
+       (GLfloat) 1.500000, (GLfloat) - 0.569469, (GLfloat) - 0.266014,
+       (GLfloat) 1.405226, (GLfloat) - 0.609197, (GLfloat) - 0.278403,
+       (GLfloat) 1.594774, (GLfloat) - 0.609197, (GLfloat) - 0.278403,
+       (GLfloat) 1.582500, (GLfloat) - 0.646948, (GLfloat) - 0.335375,
+       (GLfloat) 1.500000, (GLfloat) - 0.634535, (GLfloat) - 0.278500,
+       (GLfloat) 1.417500, (GLfloat) - 0.646948, (GLfloat) - 0.335375,
+       (GLfloat) 1.500000, (GLfloat) - 0.657972, (GLfloat) - 0.597750,
+       (GLfloat) 1.597750, (GLfloat) - 0.657972, (GLfloat) - 0.500000,
+       (GLfloat) 1.402250, (GLfloat) - 0.657972, (GLfloat) - 0.500000,
+       (GLfloat) 1.500000, (GLfloat) - 0.657972, (GLfloat) - 0.402250,
+};
+
+static GLfloat s1_6_normals[] =
+{
+       (GLfloat) 0.863661, (GLfloat) 0.210849, (GLfloat) - 0.457857,
+       (GLfloat) 0.863729, (GLfloat) 0.215548, (GLfloat) - 0.455534,
+       (GLfloat) 0.952947, (GLfloat) 0.267284, (GLfloat) - 0.143006,
+       (GLfloat) 0.953156, (GLfloat) 0.266032, (GLfloat) - 0.143950,
+       (GLfloat) 0.887569, (GLfloat) 0.433517, (GLfloat) - 0.155833,
+       (GLfloat) 0.886526, (GLfloat) 0.436070, (GLfloat) - 0.154645,
+       (GLfloat) 0.784332, (GLfloat) 0.380163, (GLfloat) - 0.490203,
+       (GLfloat) 0.785458, (GLfloat) 0.376379, (GLfloat) - 0.491319,
+       (GLfloat) 0.863661, (GLfloat) 0.210849, (GLfloat) 0.457857,
+       (GLfloat) 0.863729, (GLfloat) 0.215548, (GLfloat) 0.455534,
+       (GLfloat) 0.785458, (GLfloat) 0.376379, (GLfloat) 0.491319,
+       (GLfloat) 0.784333, (GLfloat) 0.380162, (GLfloat) 0.490203,
+       (GLfloat) 0.887569, (GLfloat) 0.433517, (GLfloat) 0.155833,
+       (GLfloat) 0.886526, (GLfloat) 0.436070, (GLfloat) 0.154645,
+       (GLfloat) 0.953156, (GLfloat) 0.266032, (GLfloat) 0.143950,
+       (GLfloat) 0.952947, (GLfloat) 0.267284, (GLfloat) 0.143006,
+       (GLfloat) - 0.476698, (GLfloat) 0.854621, (GLfloat) 0.205866,
+       (GLfloat) - 0.498450, (GLfloat) 0.848428, (GLfloat) 0.178092,
+       (GLfloat) - 0.462000, (GLfloat) 0.884194, (GLfloat) 0.068965,
+       (GLfloat) - 0.472068, (GLfloat) 0.878521, (GLfloat) 0.073162,
+       (GLfloat) 0.299348, (GLfloat) 0.942240, (GLfloat) 0.150245,
+       (GLfloat) 0.334834, (GLfloat) 0.927714, (GLfloat) 0.165022,
+       (GLfloat) 0.146237, (GLfloat) 0.884155, (GLfloat) 0.443716,
+       (GLfloat) 0.183286, (GLfloat) 0.864289, (GLfloat) 0.468413,
+       (GLfloat) - 0.498450, (GLfloat) 0.848429, (GLfloat) - 0.178092,
+       (GLfloat) - 0.476698, (GLfloat) 0.854621, (GLfloat) - 0.205865,
+       (GLfloat) 0.146237, (GLfloat) 0.884155, (GLfloat) - 0.443716,
+       (GLfloat) 0.183286, (GLfloat) 0.864289, (GLfloat) - 0.468413,
+       (GLfloat) 0.334834, (GLfloat) 0.927714, (GLfloat) - 0.165022,
+       (GLfloat) 0.299348, (GLfloat) 0.942240, (GLfloat) - 0.150245,
+       (GLfloat) - 0.472068, (GLfloat) 0.878521, (GLfloat) - 0.073162,
+       (GLfloat) - 0.462000, (GLfloat) 0.884194, (GLfloat) - 0.068965,
+       (GLfloat) 0.601151, (GLfloat) 0.064321, (GLfloat) 0.796542,
+       (GLfloat) 0.602133, (GLfloat) 0.074603, (GLfloat) 0.794903,
+       (GLfloat) 0.305416, (GLfloat) - 0.098916, (GLfloat) 0.947067,
+       (GLfloat) 0.305705, (GLfloat) - 0.083664, (GLfloat) 0.948443,
+       (GLfloat) 0.204663, (GLfloat) 0.031235, (GLfloat) 0.978334,
+       (GLfloat) 0.206924, (GLfloat) 0.024347, (GLfloat) 0.978054,
+       (GLfloat) 0.503723, (GLfloat) 0.214462, (GLfloat) 0.836821,
+       (GLfloat) 0.504738, (GLfloat) 0.210719, (GLfloat) 0.837160,
+       (GLfloat) - 0.295242, (GLfloat) - 0.450841, (GLfloat) 0.842363,
+       (GLfloat) - 0.299933, (GLfloat) - 0.431633, (GLfloat) 0.850725,
+       (GLfloat) - 0.391261, (GLfloat) - 0.341115, (GLfloat) 0.854725,
+       (GLfloat) - 0.390827, (GLfloat) - 0.342109, (GLfloat) 0.854527,
+       (GLfloat) - 0.083295, (GLfloat) - 0.151964, (GLfloat) 0.984870,
+       (GLfloat) - 0.083124, (GLfloat) - 0.152402, (GLfloat) 0.984817,
+       (GLfloat) 0.015860, (GLfloat) - 0.266588, (GLfloat) 0.963680,
+       (GLfloat) 0.013989, (GLfloat) - 0.247700, (GLfloat) 0.968736,
+       (GLfloat) - 0.816724, (GLfloat) 0.502516, (GLfloat) 0.283619,
+       (GLfloat) - 0.805591, (GLfloat) 0.530375, (GLfloat) 0.264055,
+       (GLfloat) - 0.732550, (GLfloat) 0.603459, (GLfloat) 0.314971,
+       (GLfloat) - 0.730076, (GLfloat) 0.611620, (GLfloat) 0.304811,
+       (GLfloat) - 0.516849, (GLfloat) 0.314381, (GLfloat) 0.796261,
+       (GLfloat) - 0.502724, (GLfloat) 0.272837, (GLfloat) 0.820261,
+       (GLfloat) - 0.744687, (GLfloat) 0.181500, (GLfloat) 0.642261,
+       (GLfloat) - 0.739362, (GLfloat) 0.135764, (GLfloat) 0.659478,
+       (GLfloat) - 0.549371, (GLfloat) 0.797029, (GLfloat) 0.250869,
+       (GLfloat) - 0.542332, (GLfloat) 0.789948, (GLfloat) 0.286109,
+       (GLfloat) - 0.086395, (GLfloat) 0.693389, (GLfloat) 0.715365,
+       (GLfloat) - 0.059539, (GLfloat) 0.687907, (GLfloat) 0.723353,
+       (GLfloat) - 0.265868, (GLfloat) 0.473566, (GLfloat) 0.839672,
+       (GLfloat) - 0.289224, (GLfloat) 0.481874, (GLfloat) 0.827131,
+       (GLfloat) - 0.628658, (GLfloat) 0.711043, (GLfloat) 0.314972,
+       (GLfloat) - 0.636726, (GLfloat) 0.708286, (GLfloat) 0.304813,
+       (GLfloat) - 0.602622, (GLfloat) - 0.619862, (GLfloat) 0.502612,
+       (GLfloat) - 0.608832, (GLfloat) - 0.607495, (GLfloat) 0.510170,
+       (GLfloat) - 0.718752, (GLfloat) - 0.676658, (GLfloat) 0.159776,
+       (GLfloat) - 0.721882, (GLfloat) - 0.672658, (GLfloat) 0.162535,
+       (GLfloat) - 0.782122, (GLfloat) - 0.600854, (GLfloat) 0.165107,
+       (GLfloat) - 0.776469, (GLfloat) - 0.609074, (GLfloat) 0.161631,
+       (GLfloat) - 0.682182, (GLfloat) - 0.521915, (GLfloat) 0.512086,
+       (GLfloat) - 0.675579, (GLfloat) - 0.534280, (GLfloat) 0.508073,
+       (GLfloat) - 0.608832, (GLfloat) - 0.607495, (GLfloat) - 0.510170,
+       (GLfloat) - 0.602622, (GLfloat) - 0.619862, (GLfloat) - 0.502612,
+       (GLfloat) - 0.682182, (GLfloat) - 0.521915, (GLfloat) - 0.512086,
+       (GLfloat) - 0.675579, (GLfloat) - 0.534280, (GLfloat) - 0.508073,
+       (GLfloat) - 0.776469, (GLfloat) - 0.609074, (GLfloat) - 0.161631,
+       (GLfloat) - 0.782122, (GLfloat) - 0.600854, (GLfloat) - 0.165107,
+       (GLfloat) - 0.718752, (GLfloat) - 0.676658, (GLfloat) - 0.159776,
+       (GLfloat) - 0.721882, (GLfloat) - 0.672658, (GLfloat) - 0.162535,
+       (GLfloat) - 0.870738, (GLfloat) 0.446582, (GLfloat) - 0.205866,
+       (GLfloat) - 0.865307, (GLfloat) 0.468537, (GLfloat) - 0.178091,
+       (GLfloat) - 0.899779, (GLfloat) 0.430861, (GLfloat) - 0.068965,
+       (GLfloat) - 0.894461, (GLfloat) 0.441120, (GLfloat) - 0.073162,
+       (GLfloat) - 0.988176, (GLfloat) - 0.083362, (GLfloat) - 0.128682,
+       (GLfloat) - 0.982213, (GLfloat) - 0.119589, (GLfloat) - 0.144763,
+       (GLfloat) - 0.919779, (GLfloat) 0.029098, (GLfloat) - 0.391357,
+       (GLfloat) - 0.919364, (GLfloat) - 0.008818, (GLfloat) - 0.393310,
+       (GLfloat) - 0.865307, (GLfloat) 0.468537, (GLfloat) 0.178091,
+       (GLfloat) - 0.870738, (GLfloat) 0.446582, (GLfloat) 0.205866,
+       (GLfloat) - 0.919364, (GLfloat) - 0.008818, (GLfloat) 0.393310,
+       (GLfloat) - 0.919779, (GLfloat) 0.029098, (GLfloat) 0.391357,
+       (GLfloat) - 0.982213, (GLfloat) - 0.119589, (GLfloat) 0.144763,
+       (GLfloat) - 0.988176, (GLfloat) - 0.083362, (GLfloat) 0.128682,
+       (GLfloat) - 0.894461, (GLfloat) 0.441120, (GLfloat) 0.073162,
+       (GLfloat) - 0.899779, (GLfloat) 0.430861, (GLfloat) 0.068965,
+       (GLfloat) - 0.295242, (GLfloat) - 0.450841, (GLfloat) - 0.842362,
+       (GLfloat) - 0.299933, (GLfloat) - 0.431632, (GLfloat) - 0.850725,
+       (GLfloat) 0.013989, (GLfloat) - 0.247700, (GLfloat) - 0.968736,
+       (GLfloat) 0.015860, (GLfloat) - 0.266588, (GLfloat) - 0.963680,
+       (GLfloat) - 0.083295, (GLfloat) - 0.151964, (GLfloat) - 0.984870,
+       (GLfloat) - 0.083124, (GLfloat) - 0.152402, (GLfloat) - 0.984817,
+       (GLfloat) - 0.390828, (GLfloat) - 0.342108, (GLfloat) - 0.854527,
+       (GLfloat) - 0.391261, (GLfloat) - 0.341115, (GLfloat) - 0.854725,
+       (GLfloat) 0.602133, (GLfloat) 0.074603, (GLfloat) - 0.794903,
+       (GLfloat) 0.601151, (GLfloat) 0.064322, (GLfloat) - 0.796542,
+       (GLfloat) 0.503722, (GLfloat) 0.214463, (GLfloat) - 0.836821,
+       (GLfloat) 0.504737, (GLfloat) 0.210719, (GLfloat) - 0.837161,
+       (GLfloat) 0.206924, (GLfloat) 0.024347, (GLfloat) - 0.978054,
+       (GLfloat) 0.204663, (GLfloat) 0.031235, (GLfloat) - 0.978334,
+       (GLfloat) 0.305416, (GLfloat) - 0.098916, (GLfloat) - 0.947067,
+       (GLfloat) 0.305705, (GLfloat) - 0.083664, (GLfloat) - 0.948443,
+       (GLfloat) - 0.549371, (GLfloat) 0.797029, (GLfloat) - 0.250870,
+       (GLfloat) - 0.542332, (GLfloat) 0.789948, (GLfloat) - 0.286110,
+       (GLfloat) - 0.628658, (GLfloat) 0.711043, (GLfloat) - 0.314972,
+       (GLfloat) - 0.636726, (GLfloat) 0.708286, (GLfloat) - 0.304813,
+       (GLfloat) - 0.289225, (GLfloat) 0.481875, (GLfloat) - 0.827131,
+       (GLfloat) - 0.265869, (GLfloat) 0.473567, (GLfloat) - 0.839672,
+       (GLfloat) - 0.086396, (GLfloat) 0.693390, (GLfloat) - 0.715365,
+       (GLfloat) - 0.059540, (GLfloat) 0.687907, (GLfloat) - 0.723352,
+       (GLfloat) - 0.805592, (GLfloat) 0.530374, (GLfloat) - 0.264056,
+       (GLfloat) - 0.816724, (GLfloat) 0.502516, (GLfloat) - 0.283619,
+       (GLfloat) - 0.744687, (GLfloat) 0.181500, (GLfloat) - 0.642260,
+       (GLfloat) - 0.739363, (GLfloat) 0.135764, (GLfloat) - 0.659478,
+       (GLfloat) - 0.502724, (GLfloat) 0.272838, (GLfloat) - 0.820261,
+       (GLfloat) - 0.516850, (GLfloat) 0.314382, (GLfloat) - 0.796260,
+       (GLfloat) - 0.732550, (GLfloat) 0.603460, (GLfloat) - 0.314971,
+       (GLfloat) - 0.730076, (GLfloat) 0.611620, (GLfloat) - 0.304812,
+       (GLfloat) - 0.612735, (GLfloat) 0.780498, (GLfloat) 0.124010,
+       (GLfloat) - 0.620926, (GLfloat) 0.772016, (GLfloat) 0.135801,
+       (GLfloat) - 0.683860, (GLfloat) 0.721331, (GLfloat) 0.109621,
+       (GLfloat) - 0.686475, (GLfloat) 0.718049, (GLfloat) 0.114708,
+       (GLfloat) - 0.697666, (GLfloat) 0.715659, (GLfloat) 0.033080,
+       (GLfloat) - 0.695640, (GLfloat) 0.717757, (GLfloat) 0.030164,
+       (GLfloat) - 0.638159, (GLfloat) 0.768656, (GLfloat) 0.043833,
+       (GLfloat) - 0.634338, (GLfloat) 0.772038, (GLfloat) 0.039657,
+       (GLfloat) - 0.793216, (GLfloat) 0.593605, (GLfloat) 0.135802,
+       (GLfloat) - 0.801406, (GLfloat) 0.585123, (GLfloat) 0.124011,
+       (GLfloat) - 0.790459, (GLfloat) 0.610945, (GLfloat) 0.043833,
+       (GLfloat) - 0.793705, (GLfloat) 0.607008, (GLfloat) 0.039656,
+       (GLfloat) - 0.741597, (GLfloat) 0.670167, (GLfloat) 0.030164,
+       (GLfloat) - 0.739572, (GLfloat) 0.672265, (GLfloat) 0.033079,
+       (GLfloat) - 0.744759, (GLfloat) 0.658269, (GLfloat) 0.109621,
+       (GLfloat) - 0.741569, (GLfloat) 0.660997, (GLfloat) 0.114710,
+       (GLfloat) - 0.801406, (GLfloat) 0.585123, (GLfloat) - 0.124011,
+       (GLfloat) - 0.793216, (GLfloat) 0.593605, (GLfloat) - 0.135802,
+       (GLfloat) - 0.744759, (GLfloat) 0.658269, (GLfloat) - 0.109621,
+       (GLfloat) - 0.741569, (GLfloat) 0.660997, (GLfloat) - 0.114710,
+       (GLfloat) - 0.739572, (GLfloat) 0.672265, (GLfloat) - 0.033079,
+       (GLfloat) - 0.741597, (GLfloat) 0.670167, (GLfloat) - 0.030164,
+       (GLfloat) - 0.790459, (GLfloat) 0.610945, (GLfloat) - 0.043833,
+       (GLfloat) - 0.793705, (GLfloat) 0.607008, (GLfloat) - 0.039656,
+       (GLfloat) - 0.620926, (GLfloat) 0.772016, (GLfloat) - 0.135801,
+       (GLfloat) - 0.612735, (GLfloat) 0.780498, (GLfloat) - 0.124010,
+       (GLfloat) - 0.638159, (GLfloat) 0.768656, (GLfloat) - 0.043833,
+       (GLfloat) - 0.634338, (GLfloat) 0.772038, (GLfloat) - 0.039657,
+       (GLfloat) - 0.695640, (GLfloat) 0.717757, (GLfloat) - 0.030164,
+       (GLfloat) - 0.697666, (GLfloat) 0.715659, (GLfloat) - 0.033080,
+       (GLfloat) - 0.683860, (GLfloat) 0.721331, (GLfloat) - 0.109621,
+       (GLfloat) - 0.686475, (GLfloat) 0.718049, (GLfloat) - 0.114708,
+       (GLfloat) 0.864441, (GLfloat) 0.198220, (GLfloat) - 0.462008,
+       (GLfloat) 0.865832, (GLfloat) 0.204848, (GLfloat) - 0.456478,
+       (GLfloat) 0.861398, (GLfloat) 0.190399, (GLfloat) - 0.470894,
+       (GLfloat) 0.864411, (GLfloat) 0.198309, (GLfloat) - 0.462024,
+       (GLfloat) 0.959873, (GLfloat) 0.240404, (GLfloat) - 0.144397,
+       (GLfloat) 0.959903, (GLfloat) 0.238290, (GLfloat) - 0.147664,
+       (GLfloat) 0.957414, (GLfloat) 0.250909, (GLfloat) - 0.142837,
+       (GLfloat) 0.957562, (GLfloat) 0.249145, (GLfloat) - 0.144919,
+       (GLfloat) 0.850599, (GLfloat) 0.179835, (GLfloat) - 0.494106,
+       (GLfloat) 0.855506, (GLfloat) 0.187394, (GLfloat) - 0.482693,
+       (GLfloat) 0.963921, (GLfloat) 0.218904, (GLfloat) - 0.151448,
+       (GLfloat) 0.963730, (GLfloat) 0.216664, (GLfloat) - 0.155826,
+       (GLfloat) 0.961835, (GLfloat) 0.230558, (GLfloat) - 0.147363,
+       (GLfloat) 0.961732, (GLfloat) 0.228244, (GLfloat) - 0.151580,
+       (GLfloat) 0.856249, (GLfloat) 0.184340, (GLfloat) - 0.482552,
+       (GLfloat) 0.860720, (GLfloat) 0.192749, (GLfloat) - 0.471178,
+       (GLfloat) 0.850599, (GLfloat) 0.179835, (GLfloat) 0.494106,
+       (GLfloat) 0.855506, (GLfloat) 0.187394, (GLfloat) 0.482693,
+       (GLfloat) 0.860720, (GLfloat) 0.192749, (GLfloat) 0.471179,
+       (GLfloat) 0.856249, (GLfloat) 0.184340, (GLfloat) 0.482552,
+       (GLfloat) 0.961835, (GLfloat) 0.230558, (GLfloat) 0.147363,
+       (GLfloat) 0.961732, (GLfloat) 0.228244, (GLfloat) 0.151580,
+       (GLfloat) 0.963730, (GLfloat) 0.216664, (GLfloat) 0.155826,
+       (GLfloat) 0.963921, (GLfloat) 0.218904, (GLfloat) 0.151448,
+       (GLfloat) 0.865832, (GLfloat) 0.204848, (GLfloat) 0.456478,
+       (GLfloat) 0.864441, (GLfloat) 0.198220, (GLfloat) 0.462008,
+       (GLfloat) 0.957414, (GLfloat) 0.250909, (GLfloat) 0.142837,
+       (GLfloat) 0.957562, (GLfloat) 0.249144, (GLfloat) 0.144919,
+       (GLfloat) 0.959903, (GLfloat) 0.238290, (GLfloat) 0.147664,
+       (GLfloat) 0.959873, (GLfloat) 0.240404, (GLfloat) 0.144397,
+       (GLfloat) 0.861398, (GLfloat) 0.190399, (GLfloat) 0.470894,
+       (GLfloat) 0.864411, (GLfloat) 0.198309, (GLfloat) 0.462024,
+       (GLfloat) - 0.368470, (GLfloat) - 0.398468, (GLfloat) - 0.839912,
+       (GLfloat) - 0.366469, (GLfloat) - 0.378022, (GLfloat) - 0.850177,
+       (GLfloat) - 0.433076, (GLfloat) - 0.339336, (GLfloat) - 0.835043,
+       (GLfloat) - 0.426924, (GLfloat) - 0.323639, (GLfloat) - 0.844390,
+       (GLfloat) - 0.078376, (GLfloat) - 0.184951, (GLfloat) - 0.979617,
+       (GLfloat) - 0.089636, (GLfloat) - 0.204692, (GLfloat) - 0.974714,
+       (GLfloat) - 0.031836, (GLfloat) - 0.216104, (GLfloat) - 0.975851,
+       (GLfloat) - 0.037496, (GLfloat) - 0.237942, (GLfloat) - 0.970555,
+       (GLfloat) - 0.516334, (GLfloat) - 0.149595, (GLfloat) - 0.843220,
+       (GLfloat) - 0.522141, (GLfloat) - 0.155987, (GLfloat) - 0.838473,
+       (GLfloat) - 0.160863, (GLfloat) - 0.078983, (GLfloat) - 0.983811,
+       (GLfloat) - 0.162216, (GLfloat) - 0.080222, (GLfloat) - 0.983489,
+       (GLfloat) - 0.124313, (GLfloat) - 0.142798, (GLfloat) - 0.981914,
+       (GLfloat) - 0.134702, (GLfloat) - 0.155051, (GLfloat) - 0.978680,
+       (GLfloat) - 0.485511, (GLfloat) - 0.259251, (GLfloat) - 0.834906,
+       (GLfloat) - 0.481803, (GLfloat) - 0.253626, (GLfloat) - 0.838773,
+       (GLfloat) 0.539229, (GLfloat) 0.099743, (GLfloat) - 0.836232,
+       (GLfloat) 0.527244, (GLfloat) 0.088685, (GLfloat) - 0.845073,
+       (GLfloat) 0.560111, (GLfloat) 0.087128, (GLfloat) - 0.823823,
+       (GLfloat) 0.546849, (GLfloat) 0.072324, (GLfloat) - 0.834101,
+       (GLfloat) 0.201167, (GLfloat) - 0.045810, (GLfloat) - 0.978485,
+       (GLfloat) 0.215853, (GLfloat) - 0.030110, (GLfloat) - 0.975962,
+       (GLfloat) 0.175573, (GLfloat) - 0.002365, (GLfloat) - 0.984464,
+       (GLfloat) 0.184916, (GLfloat) 0.005715, (GLfloat) - 0.982738,
+       (GLfloat) 0.593439, (GLfloat) 0.077285, (GLfloat) - 0.801160,
+       (GLfloat) 0.587937, (GLfloat) 0.063575, (GLfloat) - 0.806405,
+       (GLfloat) 0.272897, (GLfloat) - 0.086428, (GLfloat) - 0.958153,
+       (GLfloat) 0.279890, (GLfloat) - 0.067483, (GLfloat) - 0.957657,
+       (GLfloat) 0.236530, (GLfloat) - 0.071307, (GLfloat) - 0.969004,
+       (GLfloat) 0.249518, (GLfloat) - 0.051953, (GLfloat) - 0.966975,
+       (GLfloat) 0.579087, (GLfloat) 0.080825, (GLfloat) - 0.811250,
+       (GLfloat) 0.568834, (GLfloat) 0.065408, (GLfloat) - 0.819847,
+       (GLfloat) - 0.366469, (GLfloat) - 0.378021, (GLfloat) 0.850177,
+       (GLfloat) - 0.368470, (GLfloat) - 0.398468, (GLfloat) 0.839912,
+       (GLfloat) - 0.031836, (GLfloat) - 0.216104, (GLfloat) 0.975851,
+       (GLfloat) - 0.037496, (GLfloat) - 0.237942, (GLfloat) 0.970555,
+       (GLfloat) - 0.089636, (GLfloat) - 0.204692, (GLfloat) 0.974714,
+       (GLfloat) - 0.078376, (GLfloat) - 0.184951, (GLfloat) 0.979617,
+       (GLfloat) - 0.433076, (GLfloat) - 0.339336, (GLfloat) 0.835043,
+       (GLfloat) - 0.426924, (GLfloat) - 0.323639, (GLfloat) 0.844389,
+       (GLfloat) 0.593439, (GLfloat) 0.077284, (GLfloat) 0.801160,
+       (GLfloat) 0.587937, (GLfloat) 0.063575, (GLfloat) 0.806405,
+       (GLfloat) 0.568834, (GLfloat) 0.065408, (GLfloat) 0.819847,
+       (GLfloat) 0.579087, (GLfloat) 0.080825, (GLfloat) 0.811249,
+       (GLfloat) 0.236530, (GLfloat) - 0.071307, (GLfloat) 0.969004,
+       (GLfloat) 0.249518, (GLfloat) - 0.051953, (GLfloat) 0.966975,
+       (GLfloat) 0.279890, (GLfloat) - 0.067483, (GLfloat) 0.957657,
+       (GLfloat) 0.272897, (GLfloat) - 0.086428, (GLfloat) 0.958153,
+       (GLfloat) 0.527244, (GLfloat) 0.088685, (GLfloat) 0.845073,
+       (GLfloat) 0.539229, (GLfloat) 0.099743, (GLfloat) 0.836232,
+       (GLfloat) 0.175573, (GLfloat) - 0.002365, (GLfloat) 0.984464,
+       (GLfloat) 0.184916, (GLfloat) 0.005715, (GLfloat) 0.982738,
+       (GLfloat) 0.215853, (GLfloat) - 0.030110, (GLfloat) 0.975962,
+       (GLfloat) 0.201167, (GLfloat) - 0.045810, (GLfloat) 0.978485,
+       (GLfloat) 0.560111, (GLfloat) 0.087128, (GLfloat) 0.823823,
+       (GLfloat) 0.546849, (GLfloat) 0.072324, (GLfloat) 0.834101,
+       (GLfloat) - 0.516334, (GLfloat) - 0.149595, (GLfloat) 0.843220,
+       (GLfloat) - 0.522141, (GLfloat) - 0.155986, (GLfloat) 0.838473,
+       (GLfloat) - 0.481803, (GLfloat) - 0.253626, (GLfloat) 0.838773,
+       (GLfloat) - 0.485511, (GLfloat) - 0.259250, (GLfloat) 0.834906,
+       (GLfloat) - 0.124313, (GLfloat) - 0.142798, (GLfloat) 0.981914,
+       (GLfloat) - 0.134702, (GLfloat) - 0.155051, (GLfloat) 0.978680,
+       (GLfloat) - 0.162216, (GLfloat) - 0.080222, (GLfloat) 0.983489,
+       (GLfloat) - 0.160863, (GLfloat) - 0.078982, (GLfloat) 0.983811,
+       (GLfloat) - 0.686861, (GLfloat) - 0.525025, (GLfloat) - 0.502564,
+       (GLfloat) - 0.684324, (GLfloat) - 0.536936, (GLfloat) - 0.493357,
+       (GLfloat) - 0.799089, (GLfloat) - 0.580700, (GLfloat) - 0.155709,
+       (GLfloat) - 0.801122, (GLfloat) - 0.576989, (GLfloat) - 0.159016,
+       (GLfloat) - 0.862913, (GLfloat) - 0.481876, (GLfloat) - 0.152238,
+       (GLfloat) - 0.863678, (GLfloat) - 0.479780, (GLfloat) - 0.154502,
+       (GLfloat) - 0.750556, (GLfloat) - 0.441554, (GLfloat) - 0.491625,
+       (GLfloat) - 0.750719, (GLfloat) - 0.448983, (GLfloat) - 0.484598,
+       (GLfloat) - 0.686861, (GLfloat) - 0.525025, (GLfloat) 0.502564,
+       (GLfloat) - 0.684324, (GLfloat) - 0.536936, (GLfloat) 0.493357,
+       (GLfloat) - 0.750719, (GLfloat) - 0.448983, (GLfloat) 0.484598,
+       (GLfloat) - 0.750556, (GLfloat) - 0.441554, (GLfloat) 0.491625,
+       (GLfloat) - 0.862913, (GLfloat) - 0.481876, (GLfloat) 0.152238,
+       (GLfloat) - 0.863678, (GLfloat) - 0.479780, (GLfloat) 0.154503,
+       (GLfloat) - 0.801122, (GLfloat) - 0.576990, (GLfloat) 0.159016,
+       (GLfloat) - 0.799089, (GLfloat) - 0.580700, (GLfloat) 0.155709,
+       (GLfloat) - 0.845506, (GLfloat) - 0.204102, (GLfloat) 0.493419,
+       (GLfloat) - 0.849139, (GLfloat) - 0.212205, (GLfloat) 0.483666,
+       (GLfloat) - 0.962881, (GLfloat) - 0.220433, (GLfloat) 0.155789,
+       (GLfloat) - 0.962834, (GLfloat) - 0.223594, (GLfloat) 0.151516,
+       (GLfloat) - 0.918492, (GLfloat) - 0.365350, (GLfloat) 0.151297,
+       (GLfloat) - 0.918584, (GLfloat) - 0.364876, (GLfloat) 0.151885,
+       (GLfloat) - 0.806201, (GLfloat) - 0.341087, (GLfloat) 0.483425,
+       (GLfloat) - 0.806184, (GLfloat) - 0.341015, (GLfloat) 0.483504,
+       (GLfloat) - 0.849139, (GLfloat) - 0.212204, (GLfloat) - 0.483666,
+       (GLfloat) - 0.845506, (GLfloat) - 0.204102, (GLfloat) - 0.493419,
+       (GLfloat) - 0.806201, (GLfloat) - 0.341087, (GLfloat) - 0.483425,
+       (GLfloat) - 0.806184, (GLfloat) - 0.341015, (GLfloat) - 0.483504,
+       (GLfloat) - 0.918584, (GLfloat) - 0.364876, (GLfloat) - 0.151885,
+       (GLfloat) - 0.918492, (GLfloat) - 0.365350, (GLfloat) - 0.151297,
+       (GLfloat) - 0.962881, (GLfloat) - 0.220433, (GLfloat) - 0.155789,
+       (GLfloat) - 0.962834, (GLfloat) - 0.223594, (GLfloat) - 0.151516,
+       (GLfloat) - 0.503594, (GLfloat) 0.204765, (GLfloat) - 0.839324,
+       (GLfloat) - 0.503594, (GLfloat) 0.204765, (GLfloat) - 0.839324,
+       (GLfloat) - 0.161047, (GLfloat) 0.200914, (GLfloat) - 0.966280,
+       (GLfloat) - 0.161047, (GLfloat) 0.200914, (GLfloat) - 0.966280,
+       (GLfloat) - 0.165393, (GLfloat) 0.154386, (GLfloat) - 0.974069,
+       (GLfloat) - 0.162365, (GLfloat) 0.156806, (GLfloat) - 0.974192,
+       (GLfloat) - 0.508257, (GLfloat) 0.155255, (GLfloat) - 0.847095,
+       (GLfloat) - 0.512203, (GLfloat) 0.151943, (GLfloat) - 0.845318,
+       (GLfloat) 0.503594, (GLfloat) 0.204765, (GLfloat) - 0.839324,
+       (GLfloat) 0.503594, (GLfloat) 0.204765, (GLfloat) - 0.839324,
+       (GLfloat) 0.506875, (GLfloat) 0.175794, (GLfloat) - 0.843904,
+       (GLfloat) 0.506455, (GLfloat) 0.176110, (GLfloat) - 0.844091,
+       (GLfloat) 0.160943, (GLfloat) 0.163176, (GLfloat) - 0.973381,
+       (GLfloat) 0.162221, (GLfloat) 0.162243, (GLfloat) - 0.973325,
+       (GLfloat) 0.161047, (GLfloat) 0.200914, (GLfloat) - 0.966280,
+       (GLfloat) 0.161047, (GLfloat) 0.200914, (GLfloat) - 0.966280,
+       (GLfloat) 0.521791, (GLfloat) 0.120579, (GLfloat) - 0.844509,
+       (GLfloat) 0.514604, (GLfloat) 0.123502, (GLfloat) - 0.848487,
+       (GLfloat) 0.164688, (GLfloat) 0.065494, (GLfloat) - 0.984169,
+       (GLfloat) 0.164274, (GLfloat) 0.065656, (GLfloat) - 0.984227,
+       (GLfloat) 0.162599, (GLfloat) 0.118143, (GLfloat) - 0.979594,
+       (GLfloat) 0.160323, (GLfloat) 0.119382, (GLfloat) - 0.979819,
+       (GLfloat) 0.509344, (GLfloat) 0.149891, (GLfloat) - 0.847409,
+       (GLfloat) 0.511715, (GLfloat) 0.148557, (GLfloat) - 0.846214,
+       (GLfloat) - 0.523595, (GLfloat) - 0.008036, (GLfloat) - 0.851929,
+       (GLfloat) - 0.537099, (GLfloat) - 0.019782, (GLfloat) - 0.843287,
+       (GLfloat) - 0.515557, (GLfloat) 0.088028, (GLfloat) - 0.852322,
+       (GLfloat) - 0.525730, (GLfloat) 0.079884, (GLfloat) - 0.846892,
+       (GLfloat) - 0.173169, (GLfloat) 0.095066, (GLfloat) - 0.980293,
+       (GLfloat) - 0.165823, (GLfloat) 0.100484, (GLfloat) - 0.981023,
+       (GLfloat) - 0.177991, (GLfloat) 0.018184, (GLfloat) - 0.983864,
+       (GLfloat) - 0.169802, (GLfloat) 0.024484, (GLfloat) - 0.985174,
+       (GLfloat) - 0.839324, (GLfloat) 0.204765, (GLfloat) - 0.503594,
+       (GLfloat) - 0.839323, (GLfloat) 0.204765, (GLfloat) - 0.503595,
+       (GLfloat) - 0.849441, (GLfloat) 0.151406, (GLfloat) - 0.505496,
+       (GLfloat) - 0.847954, (GLfloat) 0.148744, (GLfloat) - 0.508773,
+       (GLfloat) - 0.975887, (GLfloat) 0.146977, (GLfloat) - 0.161379,
+       (GLfloat) - 0.975827, (GLfloat) 0.145984, (GLfloat) - 0.162638,
+       (GLfloat) - 0.966280, (GLfloat) 0.200913, (GLfloat) - 0.161047,
+       (GLfloat) - 0.966280, (GLfloat) 0.200913, (GLfloat) - 0.161047,
+       (GLfloat) - 0.869115, (GLfloat) - 0.045798, (GLfloat) - 0.492485,
+       (GLfloat) - 0.862005, (GLfloat) - 0.035136, (GLfloat) - 0.505681,
+       (GLfloat) - 0.985988, (GLfloat) - 0.044696, (GLfloat) - 0.160715,
+       (GLfloat) - 0.986683, (GLfloat) - 0.048596, (GLfloat) - 0.155223,
+       (GLfloat) - 0.984333, (GLfloat) 0.067324, (GLfloat) - 0.162959,
+       (GLfloat) - 0.984743, (GLfloat) 0.069793, (GLfloat) - 0.159404,
+       (GLfloat) - 0.856976, (GLfloat) 0.069431, (GLfloat) - 0.510658,
+       (GLfloat) - 0.861737, (GLfloat) 0.075800, (GLfloat) - 0.501660,
+       (GLfloat) - 0.869115, (GLfloat) - 0.045798, (GLfloat) 0.492485,
+       (GLfloat) - 0.862005, (GLfloat) - 0.035136, (GLfloat) 0.505681,
+       (GLfloat) - 0.856976, (GLfloat) 0.069431, (GLfloat) 0.510659,
+       (GLfloat) - 0.861738, (GLfloat) 0.075800, (GLfloat) 0.501660,
+       (GLfloat) - 0.984743, (GLfloat) 0.069793, (GLfloat) 0.159404,
+       (GLfloat) - 0.984333, (GLfloat) 0.067324, (GLfloat) 0.162959,
+       (GLfloat) - 0.986683, (GLfloat) - 0.048596, (GLfloat) 0.155223,
+       (GLfloat) - 0.985988, (GLfloat) - 0.044696, (GLfloat) 0.160715,
+       (GLfloat) - 0.839324, (GLfloat) 0.204766, (GLfloat) 0.503594,
+       (GLfloat) - 0.839323, (GLfloat) 0.204765, (GLfloat) 0.503595,
+       (GLfloat) - 0.966280, (GLfloat) 0.200913, (GLfloat) 0.161047,
+       (GLfloat) - 0.966280, (GLfloat) 0.200913, (GLfloat) 0.161047,
+       (GLfloat) - 0.975887, (GLfloat) 0.146977, (GLfloat) 0.161379,
+       (GLfloat) - 0.975827, (GLfloat) 0.145984, (GLfloat) 0.162638,
+       (GLfloat) - 0.847954, (GLfloat) 0.148744, (GLfloat) 0.508773,
+       (GLfloat) - 0.849441, (GLfloat) 0.151406, (GLfloat) 0.505496,
+       (GLfloat) - 0.503594, (GLfloat) 0.204766, (GLfloat) 0.839324,
+       (GLfloat) - 0.503595, (GLfloat) 0.204765, (GLfloat) 0.839323,
+       (GLfloat) - 0.512203, (GLfloat) 0.151943, (GLfloat) 0.845318,
+       (GLfloat) - 0.508258, (GLfloat) 0.155255, (GLfloat) 0.847095,
+       (GLfloat) - 0.165393, (GLfloat) 0.154386, (GLfloat) 0.974069,
+       (GLfloat) - 0.162365, (GLfloat) 0.156806, (GLfloat) 0.974192,
+       (GLfloat) - 0.161047, (GLfloat) 0.200914, (GLfloat) 0.966280,
+       (GLfloat) - 0.161047, (GLfloat) 0.200914, (GLfloat) 0.966280,
+       (GLfloat) - 0.537099, (GLfloat) - 0.019782, (GLfloat) 0.843287,
+       (GLfloat) - 0.523595, (GLfloat) - 0.008036, (GLfloat) 0.851930,
+       (GLfloat) - 0.177991, (GLfloat) 0.018183, (GLfloat) 0.983864,
+       (GLfloat) - 0.169802, (GLfloat) 0.024484, (GLfloat) 0.985174,
+       (GLfloat) - 0.165823, (GLfloat) 0.100484, (GLfloat) 0.981023,
+       (GLfloat) - 0.173169, (GLfloat) 0.095066, (GLfloat) 0.980293,
+       (GLfloat) - 0.515557, (GLfloat) 0.088028, (GLfloat) 0.852322,
+       (GLfloat) - 0.525730, (GLfloat) 0.079884, (GLfloat) 0.846892,
+       (GLfloat) 0.514604, (GLfloat) 0.123503, (GLfloat) 0.848487,
+       (GLfloat) 0.521791, (GLfloat) 0.120579, (GLfloat) 0.844509,
+       (GLfloat) 0.509344, (GLfloat) 0.149891, (GLfloat) 0.847409,
+       (GLfloat) 0.511715, (GLfloat) 0.148557, (GLfloat) 0.846214,
+       (GLfloat) 0.160323, (GLfloat) 0.119382, (GLfloat) 0.979819,
+       (GLfloat) 0.162599, (GLfloat) 0.118143, (GLfloat) 0.979594,
+       (GLfloat) 0.164688, (GLfloat) 0.065494, (GLfloat) 0.984169,
+       (GLfloat) 0.164275, (GLfloat) 0.065655, (GLfloat) 0.984227,
+       (GLfloat) 0.503594, (GLfloat) 0.204766, (GLfloat) 0.839324,
+       (GLfloat) 0.503595, (GLfloat) 0.204765, (GLfloat) 0.839323,
+       (GLfloat) 0.161047, (GLfloat) 0.200914, (GLfloat) 0.966280,
+       (GLfloat) 0.161047, (GLfloat) 0.200914, (GLfloat) 0.966280,
+       (GLfloat) 0.160943, (GLfloat) 0.163176, (GLfloat) 0.973381,
+       (GLfloat) 0.162221, (GLfloat) 0.162243, (GLfloat) 0.973325,
+       (GLfloat) 0.506455, (GLfloat) 0.176110, (GLfloat) 0.844090,
+       (GLfloat) 0.506875, (GLfloat) 0.175794, (GLfloat) 0.843904,
+       (GLfloat) 0.839324, (GLfloat) 0.204766, (GLfloat) 0.503594,
+       (GLfloat) 0.839323, (GLfloat) 0.204765, (GLfloat) 0.503595,
+       (GLfloat) 0.842767, (GLfloat) 0.188271, (GLfloat) 0.504280,
+       (GLfloat) 0.842301, (GLfloat) 0.187401, (GLfloat) 0.505381,
+       (GLfloat) 0.968491, (GLfloat) 0.190085, (GLfloat) 0.160914,
+       (GLfloat) 0.968481, (GLfloat) 0.189712, (GLfloat) 0.161414,
+       (GLfloat) 0.966280, (GLfloat) 0.200913, (GLfloat) 0.161047,
+       (GLfloat) 0.966280, (GLfloat) 0.200913, (GLfloat) 0.161047,
+       (GLfloat) 0.850151, (GLfloat) 0.182077, (GLfloat) 0.494055,
+       (GLfloat) 0.846712, (GLfloat) 0.177186, (GLfloat) 0.501681,
+       (GLfloat) 0.966795, (GLfloat) 0.202453, (GLfloat) 0.155950,
+       (GLfloat) 0.966634, (GLfloat) 0.200782, (GLfloat) 0.159079,
+       (GLfloat) 0.968271, (GLfloat) 0.191230, (GLfloat) 0.160881,
+       (GLfloat) 0.968343, (GLfloat) 0.192206, (GLfloat) 0.159274,
+       (GLfloat) 0.844217, (GLfloat) 0.179436, (GLfloat) 0.505074,
+       (GLfloat) 0.845886, (GLfloat) 0.181962, (GLfloat) 0.501364,
+       (GLfloat) 0.846712, (GLfloat) 0.177186, (GLfloat) - 0.501682,
+       (GLfloat) 0.850151, (GLfloat) 0.182077, (GLfloat) - 0.494055,
+       (GLfloat) 0.844217, (GLfloat) 0.179436, (GLfloat) - 0.505074,
+       (GLfloat) 0.845886, (GLfloat) 0.181962, (GLfloat) - 0.501365,
+       (GLfloat) 0.968343, (GLfloat) 0.192206, (GLfloat) - 0.159274,
+       (GLfloat) 0.968271, (GLfloat) 0.191230, (GLfloat) - 0.160881,
+       (GLfloat) 0.966795, (GLfloat) 0.202453, (GLfloat) - 0.155950,
+       (GLfloat) 0.966634, (GLfloat) 0.200782, (GLfloat) - 0.159079,
+       (GLfloat) 0.839324, (GLfloat) 0.204765, (GLfloat) - 0.503594,
+       (GLfloat) 0.839323, (GLfloat) 0.204765, (GLfloat) - 0.503595,
+       (GLfloat) 0.966280, (GLfloat) 0.200913, (GLfloat) - 0.161047,
+       (GLfloat) 0.966280, (GLfloat) 0.200913, (GLfloat) - 0.161047,
+       (GLfloat) 0.968491, (GLfloat) 0.190085, (GLfloat) - 0.160914,
+       (GLfloat) 0.968481, (GLfloat) 0.189713, (GLfloat) - 0.161414,
+       (GLfloat) 0.842301, (GLfloat) 0.187401, (GLfloat) - 0.505381,
+       (GLfloat) 0.842767, (GLfloat) 0.188271, (GLfloat) - 0.504280,
+       (GLfloat) 0.831768, (GLfloat) 0.243104, (GLfloat) 0.499061,
+       (GLfloat) 0.831768, (GLfloat) 0.243103, (GLfloat) 0.499062,
+       (GLfloat) 0.957902, (GLfloat) 0.238609, (GLfloat) 0.159651,
+       (GLfloat) 0.957902, (GLfloat) 0.238611, (GLfloat) 0.159650,
+       (GLfloat) 0.982539, (GLfloat) 0.084307, (GLfloat) 0.165861,
+       (GLfloat) 0.982460, (GLfloat) 0.089222, (GLfloat) 0.163743,
+       (GLfloat) 0.853634, (GLfloat) 0.079021, (GLfloat) 0.514845,
+       (GLfloat) 0.854444, (GLfloat) 0.084251, (GLfloat) 0.512667,
+       (GLfloat) 0.831768, (GLfloat) 0.243103, (GLfloat) - 0.499062,
+       (GLfloat) 0.831768, (GLfloat) 0.243104, (GLfloat) - 0.499061,
+       (GLfloat) 0.853634, (GLfloat) 0.079020, (GLfloat) - 0.514845,
+       (GLfloat) 0.854444, (GLfloat) 0.084251, (GLfloat) - 0.512667,
+       (GLfloat) 0.982460, (GLfloat) 0.089222, (GLfloat) - 0.163743,
+       (GLfloat) 0.982539, (GLfloat) 0.084307, (GLfloat) - 0.165861,
+       (GLfloat) 0.957902, (GLfloat) 0.238609, (GLfloat) - 0.159651,
+       (GLfloat) 0.957902, (GLfloat) 0.238611, (GLfloat) - 0.159650,
+       (GLfloat) 0.283620, (GLfloat) - 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) 0.264056, (GLfloat) - 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) 0.315105, (GLfloat) - 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) 0.304029, (GLfloat) - 0.949849, (GLfloat) - 0.073163,
+       (GLfloat) 0.811943, (GLfloat) - 0.566920, (GLfloat) - 0.139104,
+       (GLfloat) 0.830641, (GLfloat) - 0.534923, (GLfloat) - 0.154571,
+       (GLfloat) 0.677706, (GLfloat) - 0.609532, (GLfloat) - 0.411322,
+       (GLfloat) 0.690948, (GLfloat) - 0.577758, (GLfloat) - 0.434496,
+       (GLfloat) 0.264055, (GLfloat) - 0.947923, (GLfloat) 0.178092,
+       (GLfloat) 0.283620, (GLfloat) - 0.936578, (GLfloat) 0.205866,
+       (GLfloat) 0.677707, (GLfloat) - 0.609531, (GLfloat) 0.411322,
+       (GLfloat) 0.690948, (GLfloat) - 0.577758, (GLfloat) 0.434496,
+       (GLfloat) 0.830641, (GLfloat) - 0.534923, (GLfloat) 0.154571,
+       (GLfloat) 0.811943, (GLfloat) - 0.566920, (GLfloat) 0.139104,
+       (GLfloat) 0.304029, (GLfloat) - 0.949849, (GLfloat) 0.073163,
+       (GLfloat) 0.315105, (GLfloat) - 0.946548, (GLfloat) 0.068965,
+       (GLfloat) 0.499061, (GLfloat) 0.243103, (GLfloat) - 0.831768,
+       (GLfloat) 0.499061, (GLfloat) 0.243104, (GLfloat) - 0.831768,
+       (GLfloat) 0.159650, (GLfloat) 0.238610, (GLfloat) - 0.957902,
+       (GLfloat) 0.159651, (GLfloat) 0.238610, (GLfloat) - 0.957902,
+       (GLfloat) 0.165862, (GLfloat) 0.084307, (GLfloat) - 0.982539,
+       (GLfloat) 0.163744, (GLfloat) 0.089222, (GLfloat) - 0.982460,
+       (GLfloat) 0.514845, (GLfloat) 0.079019, (GLfloat) - 0.853634,
+       (GLfloat) 0.512666, (GLfloat) 0.084251, (GLfloat) - 0.854444,
+       (GLfloat) - 0.499061, (GLfloat) 0.243104, (GLfloat) - 0.831768,
+       (GLfloat) - 0.499061, (GLfloat) 0.243103, (GLfloat) - 0.831768,
+       (GLfloat) - 0.514845, (GLfloat) 0.079019, (GLfloat) - 0.853634,
+       (GLfloat) - 0.512666, (GLfloat) 0.084251, (GLfloat) - 0.854444,
+       (GLfloat) - 0.163744, (GLfloat) 0.089222, (GLfloat) - 0.982460,
+       (GLfloat) - 0.165862, (GLfloat) 0.084307, (GLfloat) - 0.982539,
+       (GLfloat) - 0.159650, (GLfloat) 0.238610, (GLfloat) - 0.957902,
+       (GLfloat) - 0.159651, (GLfloat) 0.238610, (GLfloat) - 0.957902,
+       (GLfloat) - 0.205866, (GLfloat) - 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) - 0.178092, (GLfloat) - 0.947923, (GLfloat) - 0.264056,
+       (GLfloat) - 0.068965, (GLfloat) - 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) - 0.073162, (GLfloat) - 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) - 0.139105, (GLfloat) - 0.566920, (GLfloat) - 0.811943,
+       (GLfloat) - 0.154572, (GLfloat) - 0.534923, (GLfloat) - 0.830641,
+       (GLfloat) - 0.411321, (GLfloat) - 0.609532, (GLfloat) - 0.677706,
+       (GLfloat) - 0.434496, (GLfloat) - 0.577758, (GLfloat) - 0.690948,
+       (GLfloat) 0.178092, (GLfloat) - 0.947923, (GLfloat) - 0.264056,
+       (GLfloat) 0.205866, (GLfloat) - 0.936578, (GLfloat) - 0.283621,
+       (GLfloat) 0.411321, (GLfloat) - 0.609532, (GLfloat) - 0.677706,
+       (GLfloat) 0.434496, (GLfloat) - 0.577758, (GLfloat) - 0.690948,
+       (GLfloat) 0.154572, (GLfloat) - 0.534923, (GLfloat) - 0.830641,
+       (GLfloat) 0.139105, (GLfloat) - 0.566920, (GLfloat) - 0.811943,
+       (GLfloat) 0.073162, (GLfloat) - 0.949849, (GLfloat) - 0.304029,
+       (GLfloat) 0.068965, (GLfloat) - 0.946548, (GLfloat) - 0.315105,
+       (GLfloat) - 0.831768, (GLfloat) 0.243104, (GLfloat) - 0.499061,
+       (GLfloat) - 0.831768, (GLfloat) 0.243103, (GLfloat) - 0.499062,
+       (GLfloat) - 0.957902, (GLfloat) 0.238609, (GLfloat) - 0.159651,
+       (GLfloat) - 0.957902, (GLfloat) 0.238611, (GLfloat) - 0.159650,
+       (GLfloat) - 0.982539, (GLfloat) 0.084307, (GLfloat) - 0.165861,
+       (GLfloat) - 0.982460, (GLfloat) 0.089222, (GLfloat) - 0.163743,
+       (GLfloat) - 0.853634, (GLfloat) 0.079020, (GLfloat) - 0.514845,
+       (GLfloat) - 0.854444, (GLfloat) 0.084251, (GLfloat) - 0.512667,
+       (GLfloat) - 0.831768, (GLfloat) 0.243103, (GLfloat) 0.499062,
+       (GLfloat) - 0.831768, (GLfloat) 0.243104, (GLfloat) 0.499061,
+       (GLfloat) - 0.853634, (GLfloat) 0.079021, (GLfloat) 0.514845,
+       (GLfloat) - 0.854444, (GLfloat) 0.084251, (GLfloat) 0.512667,
+       (GLfloat) - 0.982460, (GLfloat) 0.089222, (GLfloat) 0.163743,
+       (GLfloat) - 0.982539, (GLfloat) 0.084307, (GLfloat) 0.165861,
+       (GLfloat) - 0.957902, (GLfloat) 0.238609, (GLfloat) 0.159651,
+       (GLfloat) - 0.957902, (GLfloat) 0.238611, (GLfloat) 0.159650,
+       (GLfloat) - 0.283620, (GLfloat) - 0.936578, (GLfloat) 0.205866,
+       (GLfloat) - 0.264055, (GLfloat) - 0.947923, (GLfloat) 0.178092,
+       (GLfloat) - 0.315105, (GLfloat) - 0.946548, (GLfloat) 0.068965,
+       (GLfloat) - 0.304029, (GLfloat) - 0.949849, (GLfloat) 0.073163,
+       (GLfloat) - 0.811943, (GLfloat) - 0.566920, (GLfloat) 0.139104,
+       (GLfloat) - 0.830641, (GLfloat) - 0.534923, (GLfloat) 0.154571,
+       (GLfloat) - 0.677707, (GLfloat) - 0.609531, (GLfloat) 0.411322,
+       (GLfloat) - 0.690948, (GLfloat) - 0.577758, (GLfloat) 0.434496,
+       (GLfloat) - 0.264056, (GLfloat) - 0.947923, (GLfloat) - 0.178092,
+       (GLfloat) - 0.283620, (GLfloat) - 0.936578, (GLfloat) - 0.205866,
+       (GLfloat) - 0.677706, (GLfloat) - 0.609532, (GLfloat) - 0.411322,
+       (GLfloat) - 0.690948, (GLfloat) - 0.577758, (GLfloat) - 0.434496,
+       (GLfloat) - 0.830641, (GLfloat) - 0.534923, (GLfloat) - 0.154571,
+       (GLfloat) - 0.811943, (GLfloat) - 0.566920, (GLfloat) - 0.139104,
+       (GLfloat) - 0.304029, (GLfloat) - 0.949849, (GLfloat) - 0.073163,
+       (GLfloat) - 0.315105, (GLfloat) - 0.946548, (GLfloat) - 0.068965,
+       (GLfloat) - 0.499061, (GLfloat) 0.243104, (GLfloat) 0.831769,
+       (GLfloat) - 0.499061, (GLfloat) 0.243103, (GLfloat) 0.831768,
+       (GLfloat) - 0.159650, (GLfloat) 0.238610, (GLfloat) 0.957902,
+       (GLfloat) - 0.159651, (GLfloat) 0.238610, (GLfloat) 0.957902,
+       (GLfloat) - 0.165862, (GLfloat) 0.084307, (GLfloat) 0.982539,
+       (GLfloat) - 0.163744, (GLfloat) 0.089222, (GLfloat) 0.982460,
+       (GLfloat) - 0.514844, (GLfloat) 0.079021, (GLfloat) 0.853634,
+       (GLfloat) - 0.512667, (GLfloat) 0.084251, (GLfloat) 0.854444,
+       (GLfloat) 0.499061, (GLfloat) 0.243103, (GLfloat) 0.831768,
+       (GLfloat) 0.499061, (GLfloat) 0.243104, (GLfloat) 0.831769,
+       (GLfloat) 0.514844, (GLfloat) 0.079021, (GLfloat) 0.853634,
+       (GLfloat) 0.512667, (GLfloat) 0.084251, (GLfloat) 0.854444,
+       (GLfloat) 0.163744, (GLfloat) 0.089222, (GLfloat) 0.982460,
+       (GLfloat) 0.165862, (GLfloat) 0.084307, (GLfloat) 0.982539,
+       (GLfloat) 0.159650, (GLfloat) 0.238610, (GLfloat) 0.957902,
+       (GLfloat) 0.159651, (GLfloat) 0.238610, (GLfloat) 0.957902,
+       (GLfloat) 0.205866, (GLfloat) - 0.936578, (GLfloat) 0.283621,
+       (GLfloat) 0.178092, (GLfloat) - 0.947923, (GLfloat) 0.264055,
+       (GLfloat) 0.068965, (GLfloat) - 0.946548, (GLfloat) 0.315105,
+       (GLfloat) 0.073162, (GLfloat) - 0.949849, (GLfloat) 0.304029,
+       (GLfloat) 0.139105, (GLfloat) - 0.566920, (GLfloat) 0.811943,
+       (GLfloat) 0.154572, (GLfloat) - 0.534923, (GLfloat) 0.830641,
+       (GLfloat) 0.411321, (GLfloat) - 0.609531, (GLfloat) 0.677707,
+       (GLfloat) 0.434496, (GLfloat) - 0.577757, (GLfloat) 0.690948,
+       (GLfloat) - 0.178092, (GLfloat) - 0.947923, (GLfloat) 0.264055,
+       (GLfloat) - 0.205866, (GLfloat) - 0.936578, (GLfloat) 0.283621,
+       (GLfloat) - 0.411321, (GLfloat) - 0.609531, (GLfloat) 0.677707,
+       (GLfloat) - 0.434496, (GLfloat) - 0.577757, (GLfloat) 0.690948,
+       (GLfloat) - 0.154572, (GLfloat) - 0.534923, (GLfloat) 0.830641,
+       (GLfloat) - 0.139105, (GLfloat) - 0.566920, (GLfloat) 0.811943,
+       (GLfloat) - 0.073162, (GLfloat) - 0.949849, (GLfloat) 0.304029,
+       (GLfloat) - 0.068965, (GLfloat) - 0.946548, (GLfloat) 0.315105,
+       (GLfloat) 0.135802, (GLfloat) - 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) 0.124011, (GLfloat) - 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) 0.043834, (GLfloat) - 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) 0.039656, (GLfloat) - 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) 0.030163, (GLfloat) - 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) 0.033079, (GLfloat) - 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) 0.109621, (GLfloat) - 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) 0.114709, (GLfloat) - 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) - 0.124011, (GLfloat) - 0.982944, (GLfloat) - 0.135802,
+       (GLfloat) - 0.135802, (GLfloat) - 0.982944, (GLfloat) - 0.124011,
+       (GLfloat) - 0.109621, (GLfloat) - 0.993006, (GLfloat) - 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) - 0.992607, (GLfloat) - 0.039656,
+       (GLfloat) - 0.033079, (GLfloat) - 0.998998, (GLfloat) - 0.030163,
+       (GLfloat) - 0.030163, (GLfloat) - 0.998998, (GLfloat) - 0.033079,
+       (GLfloat) - 0.043834, (GLfloat) - 0.993006, (GLfloat) - 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) - 0.992607, (GLfloat) - 0.114709,
+       (GLfloat) - 0.135803, (GLfloat) - 0.982944, (GLfloat) 0.124011,
+       (GLfloat) - 0.124011, (GLfloat) - 0.982944, (GLfloat) 0.135802,
+       (GLfloat) - 0.043834, (GLfloat) - 0.993006, (GLfloat) 0.109621,
+       (GLfloat) - 0.039656, (GLfloat) - 0.992607, (GLfloat) 0.114709,
+       (GLfloat) - 0.030163, (GLfloat) - 0.998998, (GLfloat) 0.033079,
+       (GLfloat) - 0.033079, (GLfloat) - 0.998998, (GLfloat) 0.030163,
+       (GLfloat) - 0.109621, (GLfloat) - 0.993006, (GLfloat) 0.043834,
+       (GLfloat) - 0.114709, (GLfloat) - 0.992607, (GLfloat) 0.039656,
+       (GLfloat) 0.124011, (GLfloat) - 0.982944, (GLfloat) 0.135802,
+       (GLfloat) 0.135803, (GLfloat) - 0.982944, (GLfloat) 0.124011,
+       (GLfloat) 0.109621, (GLfloat) - 0.993006, (GLfloat) 0.043834,
+       (GLfloat) 0.114709, (GLfloat) - 0.992607, (GLfloat) 0.039656,
+       (GLfloat) 0.033079, (GLfloat) - 0.998998, (GLfloat) 0.030163,
+       (GLfloat) 0.030163, (GLfloat) - 0.998998, (GLfloat) 0.033079,
+       (GLfloat) 0.043834, (GLfloat) - 0.993006, (GLfloat) 0.109621,
+       (GLfloat) 0.039656, (GLfloat) - 0.992607, (GLfloat) 0.114709,
+};
+
+static unsigned short int s1_6_POLS[] =
+{
+      3, 82, 12, 76, 1, 3, 76, 74, 82, 1, 3, 22, 78, 74, 1, 3, 22, 74, 76, 1,
+      3, 78, 20, 80, 1, 3, 80, 74, 78, 1, 3, 28, 82, 74, 1, 3, 28, 74, 80, 1,
+      3, 88, 13, 84, 1, 3, 84, 77, 88, 1, 3, 24, 86, 77, 1, 3, 24, 77, 84, 1,
+      3, 86, 20, 78, 1, 3, 78, 77, 86, 1, 3, 22, 88, 77, 1, 3, 22, 77, 78, 1,
+      3, 14, 90, 85, 1, 3, 14, 85, 93, 1, 3, 26, 91, 85, 1, 3, 26, 85, 90, 1,
+      3, 20, 86, 85, 1, 3, 20, 85, 91, 1, 3, 86, 24, 93, 1, 3, 93, 85, 86, 1,
+      3, 15, 95, 79, 1, 3, 15, 79, 97, 1, 3, 95, 28, 80, 1, 3, 80, 79, 95, 1,
+      3, 20, 91, 79, 1, 3, 20, 79, 80, 1, 3, 26, 97, 79, 1, 3, 26, 79, 91, 1,
+    3, 13, 99, 83, 1, 3, 13, 83, 84, 1, 3, 99, 30, 101, 1, 3, 101, 83, 99, 1,
+  3, 23, 102, 83, 1, 3, 23, 83, 101, 1, 3, 102, 24, 84, 1, 3, 84, 83, 102, 1,
+       3, 108, 16, 104, 1, 3, 104, 100, 108, 1, 3, 32, 106, 100, 1, 3, 32, 100, 104, 1,
+       3, 106, 23, 101, 1, 3, 101, 100, 106, 1, 3, 30, 108, 100, 1, 3, 30, 100, 101, 1,
+       3, 17, 110, 105, 1, 3, 17, 105, 113, 1, 3, 110, 33, 111, 1, 3, 111, 105, 110, 1,
+       3, 23, 106, 105, 1, 3, 23, 105, 111, 1, 3, 106, 32, 113, 1, 3, 113, 105, 106, 1,
+  3, 114, 14, 93, 1, 3, 93, 92, 114, 1, 3, 93, 24, 102, 1, 3, 102, 92, 93, 1,
+3, 23, 111, 92, 1, 3, 23, 92, 102, 1, 3, 111, 33, 114, 1, 3, 114, 92, 111, 1,
+       3, 16, 116, 103, 1, 3, 16, 103, 104, 1, 3, 116, 35, 118, 1, 3, 118, 103, 116, 1,
+       3, 31, 119, 103, 1, 3, 31, 103, 118, 1, 3, 119, 32, 104, 1, 3, 104, 103, 119, 1,
+       3, 18, 121, 117, 1, 3, 18, 117, 125, 1, 3, 121, 36, 123, 1, 3, 123, 117, 121, 1,
+       3, 31, 118, 117, 1, 3, 31, 117, 123, 1, 3, 118, 35, 125, 1, 3, 125, 117, 118, 1,
+       3, 19, 127, 122, 1, 3, 19, 122, 130, 1, 3, 37, 128, 122, 1, 3, 37, 122, 127, 1,
+       3, 31, 123, 122, 1, 3, 31, 122, 128, 1, 3, 36, 130, 122, 1, 3, 36, 122, 123, 1,
+       3, 17, 113, 112, 1, 3, 17, 112, 131, 1, 3, 32, 119, 112, 1, 3, 32, 112, 113, 1,
+       3, 31, 128, 112, 1, 3, 31, 112, 119, 1, 3, 37, 131, 112, 1, 3, 37, 112, 128, 1,
+       3, 121, 18, 133, 1, 3, 133, 120, 121, 1, 3, 39, 134, 120, 1, 3, 39, 120, 133, 1,
+       3, 134, 27, 135, 1, 3, 135, 120, 134, 1, 3, 36, 121, 120, 1, 3, 36, 120, 135, 1,
+   3, 12, 82, 81, 1, 3, 12, 81, 138, 1, 3, 82, 28, 136, 1, 3, 136, 81, 82, 1,
+3, 27, 134, 81, 1, 3, 27, 81, 136, 1, 3, 134, 39, 138, 1, 3, 138, 81, 134, 1,
+3, 95, 15, 139, 1, 3, 139, 94, 95, 1, 3, 139, 40, 140, 1, 3, 140, 94, 139, 1,
+  3, 27, 136, 94, 1, 3, 27, 94, 140, 1, 3, 136, 28, 95, 1, 3, 95, 94, 136, 1,
+       3, 19, 130, 129, 1, 3, 19, 129, 141, 1, 3, 130, 36, 135, 1, 3, 135, 129, 130, 1,
+       3, 27, 140, 129, 1, 3, 27, 129, 135, 1, 3, 140, 40, 141, 1, 3, 141, 129, 140, 1,
+ 3, 14, 114, 89, 1, 3, 14, 89, 90, 1, 3, 114, 33, 142, 1, 3, 142, 89, 114, 1,
+  3, 25, 143, 89, 1, 3, 25, 89, 142, 1, 3, 143, 26, 90, 1, 3, 90, 89, 143, 1,
+       3, 17, 131, 109, 1, 3, 17, 109, 110, 1, 3, 131, 37, 144, 1, 3, 144, 109, 131, 1,
+       3, 25, 142, 109, 1, 3, 25, 109, 144, 1, 3, 142, 33, 110, 1, 3, 110, 109, 142, 1,
+       3, 19, 141, 126, 1, 3, 19, 126, 127, 1, 3, 141, 40, 145, 1, 3, 145, 126, 141, 1,
+       3, 25, 144, 126, 1, 3, 25, 126, 145, 1, 3, 144, 37, 127, 1, 3, 127, 126, 144, 1,
+   3, 15, 97, 96, 1, 3, 15, 96, 139, 1, 3, 97, 26, 143, 1, 3, 143, 96, 97, 1,
+3, 25, 145, 96, 1, 3, 25, 96, 143, 1, 3, 145, 40, 139, 1, 3, 139, 96, 145, 1,
+ 3, 12, 146, 75, 1, 3, 12, 75, 76, 1, 3, 146, 41, 148, 1, 3, 148, 75, 146, 1,
+  3, 21, 149, 75, 1, 3, 21, 75, 148, 1, 3, 149, 22, 76, 1, 3, 76, 75, 149, 1,
+       3, 155, 8, 151, 1, 3, 151, 147, 155, 1, 3, 43, 153, 147, 1, 3, 43, 147, 151, 1,
+       3, 153, 21, 148, 1, 3, 148, 147, 153, 1, 3, 41, 155, 147, 1, 3, 41, 147, 148, 1,
+       3, 160, 11, 157, 1, 3, 157, 152, 160, 1, 3, 44, 158, 152, 1, 3, 44, 152, 157, 1,
+       3, 158, 21, 153, 1, 3, 153, 152, 158, 1, 3, 43, 160, 152, 1, 3, 43, 152, 153, 1,
+   3, 13, 88, 87, 1, 3, 13, 87, 161, 1, 3, 88, 22, 149, 1, 3, 149, 87, 88, 1,
+3, 21, 158, 87, 1, 3, 21, 87, 149, 1, 3, 158, 44, 161, 1, 3, 161, 87, 158, 1,
+       3, 18, 162, 132, 1, 3, 18, 132, 133, 1, 3, 162, 45, 164, 1, 3, 164, 132, 162, 1,
+       3, 38, 165, 132, 1, 3, 38, 132, 164, 1, 3, 165, 39, 133, 1, 3, 133, 132, 165, 1,
+       3, 170, 9, 167, 1, 3, 167, 163, 170, 1, 3, 47, 168, 163, 1, 3, 47, 163, 167, 1,
+       3, 168, 38, 164, 1, 3, 164, 163, 168, 1, 3, 45, 170, 163, 1, 3, 45, 163, 164, 1,
+3, 8, 155, 154, 1, 3, 8, 154, 173, 1, 3, 155, 41, 171, 1, 3, 171, 154, 155, 1,
+       3, 38, 168, 154, 1, 3, 38, 154, 171, 1, 3, 168, 47, 173, 1, 3, 173, 154, 168, 1,
+       3, 146, 12, 138, 1, 3, 138, 137, 146, 1, 3, 39, 165, 137, 1, 3, 39, 137, 138, 1,
+       3, 165, 38, 171, 1, 3, 171, 137, 165, 1, 3, 41, 146, 137, 1, 3, 41, 137, 171, 1,
+       3, 16, 108, 107, 1, 3, 16, 107, 177, 1, 3, 108, 30, 174, 1, 3, 174, 107, 108, 1,
+       3, 29, 176, 107, 1, 3, 29, 107, 174, 1, 3, 176, 50, 177, 1, 3, 177, 107, 176, 1,
+  3, 99, 13, 161, 1, 3, 161, 98, 99, 1, 3, 44, 178, 98, 1, 3, 44, 98, 161, 1,
+ 3, 178, 29, 174, 1, 3, 174, 98, 178, 1, 3, 30, 99, 98, 1, 3, 30, 98, 174, 1,
+       3, 11, 180, 156, 1, 3, 11, 156, 157, 1, 3, 180, 49, 181, 1, 3, 181, 156, 180, 1,
+       3, 29, 178, 156, 1, 3, 29, 156, 181, 1, 3, 178, 44, 157, 1, 3, 157, 156, 178, 1,
+       3, 185, 10, 183, 1, 3, 183, 175, 185, 1, 3, 50, 176, 175, 1, 3, 50, 175, 183, 1,
+       3, 176, 29, 181, 1, 3, 181, 175, 176, 1, 3, 49, 185, 175, 1, 3, 49, 175, 181, 1,
+       3, 162, 18, 125, 1, 3, 125, 124, 162, 1, 3, 35, 186, 124, 1, 3, 35, 124, 125, 1,
+       3, 186, 34, 187, 1, 3, 187, 124, 186, 1, 3, 45, 162, 124, 1, 3, 45, 124, 187, 1,
+       3, 116, 16, 177, 1, 3, 177, 115, 116, 1, 3, 50, 188, 115, 1, 3, 50, 115, 177, 1,
+       3, 188, 34, 186, 1, 3, 186, 115, 188, 1, 3, 35, 116, 115, 1, 3, 35, 115, 186, 1,
+       3, 10, 190, 182, 1, 3, 10, 182, 183, 1, 3, 190, 52, 191, 1, 3, 191, 182, 190, 1,
+       3, 34, 188, 182, 1, 3, 34, 182, 191, 1, 3, 188, 50, 183, 1, 3, 183, 182, 188, 1,
+3, 9, 170, 169, 1, 3, 9, 169, 193, 1, 3, 170, 45, 187, 1, 3, 187, 169, 170, 1,
+       3, 34, 191, 169, 1, 3, 34, 169, 187, 1, 3, 191, 52, 193, 1, 3, 193, 169, 191, 1,
+       3, 201, 1, 196, 1, 3, 196, 194, 201, 1, 3, 54, 198, 194, 1, 3, 54, 194, 196, 1,
+       3, 198, 46, 199, 1, 3, 199, 194, 198, 1, 3, 56, 201, 194, 1, 3, 56, 194, 199, 1,
+       3, 206, 3, 203, 1, 3, 203, 197, 206, 1, 3, 55, 204, 197, 1, 3, 55, 197, 203, 1,
+       3, 204, 46, 198, 1, 3, 198, 197, 204, 1, 3, 54, 206, 197, 1, 3, 54, 197, 198, 1,
+3, 8, 173, 172, 1, 3, 8, 172, 208, 1, 3, 173, 47, 207, 1, 3, 207, 172, 173, 1,
+       3, 46, 204, 172, 1, 3, 46, 172, 207, 1, 3, 204, 55, 208, 1, 3, 208, 172, 204, 1,
+3, 9, 209, 166, 1, 3, 9, 166, 167, 1, 3, 209, 56, 199, 1, 3, 199, 166, 209, 1,
+       3, 46, 207, 166, 1, 3, 46, 166, 199, 1, 3, 207, 47, 167, 1, 3, 167, 166, 207, 1,
+       3, 214, 1, 201, 1, 3, 201, 200, 214, 1, 3, 56, 210, 200, 1, 3, 56, 200, 201, 1,
+       3, 210, 51, 212, 1, 3, 212, 200, 210, 1, 3, 59, 214, 200, 1, 3, 59, 200, 212, 1,
+       3, 209, 9, 193, 1, 3, 193, 192, 209, 1, 3, 52, 215, 192, 1, 3, 52, 192, 193, 1,
+       3, 51, 210, 192, 1, 3, 51, 192, 215, 1, 3, 210, 56, 209, 1, 3, 209, 192, 210, 1,
+       3, 190, 10, 216, 1, 3, 216, 189, 190, 1, 3, 216, 57, 217, 1, 3, 217, 189, 216, 1,
+       3, 51, 215, 189, 1, 3, 51, 189, 217, 1, 3, 52, 190, 189, 1, 3, 52, 189, 215, 1,
+       3, 221, 0, 219, 1, 3, 219, 211, 221, 1, 3, 59, 212, 211, 1, 3, 59, 211, 219, 1,
+       3, 212, 51, 217, 1, 3, 217, 211, 212, 1, 3, 57, 221, 211, 1, 3, 57, 211, 217, 1,
+       3, 226, 0, 221, 1, 3, 221, 220, 226, 1, 3, 57, 222, 220, 1, 3, 57, 220, 221, 1,
+       3, 222, 48, 224, 1, 3, 224, 220, 222, 1, 3, 62, 226, 220, 1, 3, 62, 220, 224, 1,
+       3, 10, 185, 184, 1, 3, 10, 184, 216, 1, 3, 185, 49, 227, 1, 3, 227, 184, 185, 1,
+       3, 48, 222, 184, 1, 3, 48, 184, 227, 1, 3, 222, 57, 216, 1, 3, 216, 184, 222, 1,
+       3, 11, 228, 179, 1, 3, 11, 179, 180, 1, 3, 228, 60, 229, 1, 3, 229, 179, 228, 1,
+       3, 48, 227, 179, 1, 3, 48, 179, 229, 1, 3, 227, 49, 180, 1, 3, 180, 179, 227, 1,
+       3, 233, 2, 231, 1, 3, 231, 223, 233, 1, 3, 62, 224, 223, 1, 3, 62, 223, 231, 1,
+       3, 224, 48, 229, 1, 3, 229, 223, 224, 1, 3, 60, 233, 223, 1, 3, 60, 223, 229, 1,
+       3, 237, 2, 233, 1, 3, 233, 232, 237, 1, 3, 60, 234, 232, 1, 3, 60, 232, 233, 1,
+       3, 234, 42, 235, 1, 3, 235, 232, 234, 1, 3, 64, 237, 232, 1, 3, 64, 232, 235, 1,
+       3, 11, 160, 159, 1, 3, 11, 159, 228, 1, 3, 160, 43, 238, 1, 3, 238, 159, 160, 1,
+       3, 42, 234, 159, 1, 3, 42, 159, 238, 1, 3, 234, 60, 228, 1, 3, 228, 159, 234, 1,
+3, 8, 208, 150, 1, 3, 8, 150, 151, 1, 3, 208, 55, 239, 1, 3, 239, 150, 208, 1,
+       3, 42, 238, 150, 1, 3, 42, 150, 239, 1, 3, 238, 43, 151, 1, 3, 151, 150, 238, 1,
+       3, 203, 3, 241, 1, 3, 241, 202, 203, 1, 3, 64, 235, 202, 1, 3, 64, 202, 241, 1,
+       3, 235, 42, 239, 1, 3, 239, 202, 235, 1, 3, 55, 203, 202, 1, 3, 55, 202, 239, 1,
+3, 2, 237, 236, 1, 3, 2, 236, 245, 1, 3, 237, 64, 242, 1, 3, 242, 236, 237, 1,
+       3, 63, 244, 236, 1, 3, 63, 236, 242, 1, 3, 244, 68, 245, 1, 3, 245, 236, 244, 1,
+3, 3, 246, 240, 1, 3, 3, 240, 241, 1, 3, 246, 65, 248, 1, 3, 248, 240, 246, 1,
+       3, 63, 242, 240, 1, 3, 63, 240, 248, 1, 3, 242, 64, 241, 1, 3, 241, 240, 242, 1,
+3, 4, 250, 247, 1, 3, 4, 247, 253, 1, 3, 67, 251, 247, 1, 3, 67, 247, 250, 1,
+       3, 63, 248, 247, 1, 3, 63, 247, 251, 1, 3, 248, 65, 253, 1, 3, 253, 247, 248, 1,
+3, 7, 255, 243, 1, 3, 7, 243, 257, 1, 3, 255, 68, 244, 1, 3, 244, 243, 255, 1,
+       3, 63, 251, 243, 1, 3, 63, 243, 244, 1, 3, 67, 257, 243, 1, 3, 67, 243, 251, 1,
+3, 3, 206, 205, 1, 3, 3, 205, 246, 1, 3, 206, 54, 258, 1, 3, 258, 205, 206, 1,
+       3, 53, 259, 205, 1, 3, 53, 205, 258, 1, 3, 259, 65, 246, 1, 3, 246, 205, 259, 1,
+3, 1, 260, 195, 1, 3, 1, 195, 196, 1, 3, 260, 69, 262, 1, 3, 262, 195, 260, 1,
+       3, 53, 258, 195, 1, 3, 53, 195, 262, 1, 3, 258, 54, 196, 1, 3, 196, 195, 258, 1,
+3, 5, 264, 261, 1, 3, 5, 261, 267, 1, 3, 70, 265, 261, 1, 3, 70, 261, 264, 1,
+       3, 53, 262, 261, 1, 3, 53, 261, 265, 1, 3, 262, 69, 267, 1, 3, 267, 261, 262, 1,
+3, 4, 253, 252, 1, 3, 4, 252, 268, 1, 3, 253, 65, 259, 1, 3, 259, 252, 253, 1,
+       3, 53, 265, 252, 1, 3, 53, 252, 259, 1, 3, 70, 268, 252, 1, 3, 70, 252, 265, 1,
+3, 1, 214, 213, 1, 3, 1, 213, 260, 1, 3, 214, 59, 269, 1, 3, 269, 213, 214, 1,
+       3, 58, 270, 213, 1, 3, 58, 213, 269, 1, 3, 270, 69, 260, 1, 3, 260, 213, 270, 1,
+3, 0, 271, 218, 1, 3, 0, 218, 219, 1, 3, 271, 71, 273, 1, 3, 273, 218, 271, 1,
+       3, 58, 269, 218, 1, 3, 58, 218, 273, 1, 3, 269, 59, 219, 1, 3, 219, 218, 269, 1,
+3, 6, 275, 272, 1, 3, 6, 272, 278, 1, 3, 72, 276, 272, 1, 3, 72, 272, 275, 1,
+       3, 58, 273, 272, 1, 3, 58, 272, 276, 1, 3, 273, 71, 278, 1, 3, 278, 272, 273, 1,
+3, 5, 267, 266, 1, 3, 5, 266, 279, 1, 3, 267, 69, 270, 1, 3, 270, 266, 267, 1,
+       3, 58, 276, 266, 1, 3, 58, 266, 270, 1, 3, 72, 279, 266, 1, 3, 72, 266, 276, 1,
+3, 0, 226, 225, 1, 3, 0, 225, 271, 1, 3, 226, 62, 280, 1, 3, 280, 225, 226, 1,
+       3, 61, 281, 225, 1, 3, 61, 225, 280, 1, 3, 281, 71, 271, 1, 3, 271, 225, 281, 1,
+3, 2, 245, 230, 1, 3, 2, 230, 231, 1, 3, 245, 68, 282, 1, 3, 282, 230, 245, 1,
+       3, 61, 280, 230, 1, 3, 61, 230, 282, 1, 3, 280, 62, 231, 1, 3, 231, 230, 280, 1,
+3, 7, 283, 254, 1, 3, 7, 254, 255, 1, 3, 73, 284, 254, 1, 3, 73, 254, 283, 1,
+       3, 61, 282, 254, 1, 3, 61, 254, 284, 1, 3, 282, 68, 255, 1, 3, 255, 254, 282, 1,
+3, 6, 278, 277, 1, 3, 6, 277, 285, 1, 3, 278, 71, 281, 1, 3, 281, 277, 278, 1,
+       3, 61, 284, 277, 1, 3, 61, 277, 281, 1, 3, 73, 285, 277, 1, 3, 73, 277, 284, 1,
+3, 4, 268, 249, 1, 3, 4, 249, 250, 1, 3, 268, 70, 286, 1, 3, 286, 249, 268, 1,
+       3, 66, 287, 249, 1, 3, 66, 249, 286, 1, 3, 287, 67, 250, 1, 3, 250, 249, 287, 1,
+3, 5, 279, 263, 1, 3, 5, 263, 264, 1, 3, 279, 72, 288, 1, 3, 288, 263, 279, 1,
+       3, 66, 286, 263, 1, 3, 66, 263, 288, 1, 3, 286, 70, 264, 1, 3, 264, 263, 286, 1,
+3, 6, 285, 274, 1, 3, 6, 274, 275, 1, 3, 285, 73, 289, 1, 3, 289, 274, 285, 1,
+       3, 66, 288, 274, 1, 3, 66, 274, 289, 1, 3, 288, 72, 275, 1, 3, 275, 274, 288, 1,
+3, 7, 257, 256, 1, 3, 7, 256, 283, 1, 3, 257, 67, 287, 1, 3, 287, 256, 257, 1,
+       3, 66, 289, 256, 1, 3, 66, 256, 287, 1, 3, 289, 73, 283, 1, 3, 283, 256, 289, 1,
+
+       0
+};
+
+struct lwo  LWO_s1_6 =
+{
+       290,                    /* number of points */
+       s1_6_PNTS, s1_6_normals, s1_6_POLS, 0L
+};
+
+#endif /* MODE_sproingies */
+
+/* End of s1_6.c */
diff --git a/modes/glx/s1_b.c b/modes/glx/s1_b.c
new file mode 100644 (file)
index 0000000..73a5fef
--- /dev/null
@@ -0,0 +1,537 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)s1_b.c       4.04 97/07/28 xlockmore";
+
+#endif
+
+/*-
+ * Points to render "s1_b" in 3D.
+ *
+ * Generated by lw2ogl.  Link this with your program but do
+ * not edit by hand.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_sproingies
+
+#ifdef STANDALONE
+#include <GL/glx.h>
+#endif
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+static GLfloat s1_b_PNTS[] =
+{
+       (GLfloat) - 0.137893, (GLfloat) 0.043508, (GLfloat) - 0.125711,
+       (GLfloat) - 0.095845, (GLfloat) - 0.165656, (GLfloat) 0.072892,
+       (GLfloat) - 0.093165, (GLfloat) 0.152051, (GLfloat) 0.327744,
+       (GLfloat) - 0.003795, (GLfloat) 0.001470, (GLfloat) - 0.102225,
+       (GLfloat) 0.152845, (GLfloat) - 0.430757, (GLfloat) - 0.031907,
+       (GLfloat) - 0.118828, (GLfloat) 0.399389, (GLfloat) 0.091047,
+       (GLfloat) - 0.169137, (GLfloat) - 0.181241, (GLfloat) - 0.288763,
+       (GLfloat) 0.048660, (GLfloat) 0.018262, (GLfloat) - 0.035049,
+       (GLfloat) 0.008859, (GLfloat) 0.208004, (GLfloat) - 0.059048,
+       (GLfloat) - 0.009212, (GLfloat) - 0.042229, (GLfloat) - 0.000692,
+       (GLfloat) - 0.040025, (GLfloat) 0.115695, (GLfloat) 0.178962,
+       (GLfloat) - 0.198525, (GLfloat) 0.018630, (GLfloat) 0.257202,
+       (GLfloat) 0.205081, (GLfloat) - 0.244569, (GLfloat) 0.136314,
+       (GLfloat) - 0.214336, (GLfloat) - 0.149946, (GLfloat) - 0.006872,
+       (GLfloat) 0.245675, (GLfloat) - 0.227316, (GLfloat) - 0.184201,
+       (GLfloat) - 0.001494, (GLfloat) 0.259139, (GLfloat) - 0.260652,
+       (GLfloat) 0.070243, (GLfloat) 0.038750, (GLfloat) 0.069425,
+       (GLfloat) - 0.033229, (GLfloat) - 0.259151, (GLfloat) 0.298856,
+       (GLfloat) 0.088773, (GLfloat) - 0.065324, (GLfloat) 0.260294,
+       (GLfloat) 0.009195, (GLfloat) 0.078651, (GLfloat) 0.055543,
+       (GLfloat) - 0.090795, (GLfloat) 0.025672, (GLfloat) 0.056988,
+       (GLfloat) - 0.163707, (GLfloat) - 0.011627, (GLfloat) - 0.096395,
+       (GLfloat) 0.068886, (GLfloat) 0.257031, (GLfloat) - 0.264175,
+       (GLfloat) - 0.018086, (GLfloat) - 0.285526, (GLfloat) 0.152989,
+       (GLfloat) - 0.017489, (GLfloat) 0.031671, (GLfloat) 0.000107,
+       (GLfloat) - 0.075583, (GLfloat) - 0.097617, (GLfloat) 0.030074,
+       (GLfloat) 0.129221, (GLfloat) - 0.087628, (GLfloat) 0.171748,
+       (GLfloat) - 0.007530, (GLfloat) - 0.084194, (GLfloat) 0.186045,
+       (GLfloat) 0.474638, (GLfloat) 0.004818, (GLfloat) 0.200460,
+       (GLfloat) 0.016796, (GLfloat) 0.096614, (GLfloat) - 0.221351,
+       (GLfloat) 0.187032, (GLfloat) 0.031017, (GLfloat) 0.039986,
+       (GLfloat) - 0.142119, (GLfloat) - 0.105297, (GLfloat) - 0.100849,
+       (GLfloat) 0.142768, (GLfloat) - 0.313960, (GLfloat) - 0.349716,
+       (GLfloat) - 0.146805, (GLfloat) 0.140482, (GLfloat) 0.035653,
+       (GLfloat) 0.039939, (GLfloat) - 0.051822, (GLfloat) - 0.017672,
+       (GLfloat) 0.057111, (GLfloat) - 0.075686, (GLfloat) - 0.103478,
+       (GLfloat) 0.049696, (GLfloat) - 0.135070, (GLfloat) 0.055097,
+       (GLfloat) 0.030271, (GLfloat) 0.075412, (GLfloat) - 0.103571,
+       (GLfloat) 0.100158, (GLfloat) - 0.022917, (GLfloat) 0.073895,
+       (GLfloat) 0.085544, (GLfloat) - 0.273613, (GLfloat) 0.092456,
+       (GLfloat) 0.077489, (GLfloat) - 0.309836, (GLfloat) - 0.003664,
+       (GLfloat) - 0.017590, (GLfloat) - 0.127869, (GLfloat) 0.153118,
+       (GLfloat) - 0.157014, (GLfloat) - 0.242184, (GLfloat) 0.070478,
+       (GLfloat) - 0.018167, (GLfloat) - 0.133639, (GLfloat) - 0.174937,
+       (GLfloat) - 0.106973, (GLfloat) - 0.189783, (GLfloat) 0.038622,
+       (GLfloat) - 0.000096, (GLfloat) 0.104429, (GLfloat) - 0.032589,
+       (GLfloat) - 0.032036, (GLfloat) - 0.021493, (GLfloat) 0.279829,
+       (GLfloat) - 0.093181, (GLfloat) - 0.058024, (GLfloat) 0.182239,
+       (GLfloat) 0.012941, (GLfloat) - 0.010409, (GLfloat) 0.088080,
+       (GLfloat) 0.256718, (GLfloat) - 0.118137, (GLfloat) - 0.078847,
+       (GLfloat) - 0.113382, (GLfloat) 0.135060, (GLfloat) 0.269946,
+       (GLfloat) 0.175810, (GLfloat) - 0.026321, (GLfloat) 0.013860,
+       (GLfloat) - 0.110606, (GLfloat) - 0.023553, (GLfloat) - 0.255525,
+       (GLfloat) 0.007163, (GLfloat) 0.068674, (GLfloat) 0.010214,
+       (GLfloat) 0.031631, (GLfloat) - 0.170381, (GLfloat) - 0.174604,
+       (GLfloat) 0.117242, (GLfloat) 0.014353, (GLfloat) - 0.021215,
+       (GLfloat) 0.090315, (GLfloat) 0.161755, (GLfloat) 0.074427,
+       (GLfloat) 0.285616, (GLfloat) 0.335824, (GLfloat) - 0.083891,
+       (GLfloat) - 0.145763, (GLfloat) 0.109292, (GLfloat) 0.121340,
+       (GLfloat) - 0.147459, (GLfloat) - 0.041936, (GLfloat) 0.010427,
+       (GLfloat) - 0.082626, (GLfloat) 0.151300, (GLfloat) - 0.030875,
+       (GLfloat) 0.217154, (GLfloat) - 0.288504, (GLfloat) - 0.202483,
+       (GLfloat) 0.026532, (GLfloat) - 0.106796, (GLfloat) 0.121041,
+       (GLfloat) 0.046695, (GLfloat) - 0.033673, (GLfloat) - 0.043721,
+       (GLfloat) 0.135596, (GLfloat) 0.217426, (GLfloat) - 0.219631,
+       (GLfloat) 0.137627, (GLfloat) 0.026335, (GLfloat) - 0.082390,
+       (GLfloat) - 0.031665, (GLfloat) - 0.115897, (GLfloat) 0.077834,
+       (GLfloat) - 0.214922, (GLfloat) - 0.162169, (GLfloat) 0.073035,
+       (GLfloat) - 0.076108, (GLfloat) 0.200481, (GLfloat) 0.036119,
+       (GLfloat) 0.012715, (GLfloat) - 0.161921, (GLfloat) 0.179804,
+       (GLfloat) 0.140409, (GLfloat) - 0.165899, (GLfloat) - 0.005149,
+       (GLfloat) - 0.054606, (GLfloat) 0.011149, (GLfloat) 0.045768,
+       (GLfloat) 0.116640, (GLfloat) - 0.180314, (GLfloat) 0.045320,
+       (GLfloat) 0.342166, (GLfloat) 0.295895, (GLfloat) - 0.049250,
+       (GLfloat) - 0.133242, (GLfloat) 0.129064, (GLfloat) 0.136969,
+       (GLfloat) 0.137520, (GLfloat) - 0.387145, (GLfloat) 0.132137,
+       (GLfloat) 0.023302, (GLfloat) 0.194298, (GLfloat) - 0.066187,
+       (GLfloat) 0.089302, (GLfloat) 0.128683, (GLfloat) - 0.072530,
+       (GLfloat) - 0.141374, (GLfloat) 0.035924, (GLfloat) - 0.079354,
+       (GLfloat) - 0.209233, (GLfloat) 0.018987, (GLfloat) - 0.004193,
+       (GLfloat) 0.156295, (GLfloat) - 0.034087, (GLfloat) 0.344315,
+       (GLfloat) - 0.005946, (GLfloat) 0.039791, (GLfloat) 0.071862,
+       (GLfloat) 0.076043, (GLfloat) - 0.094430, (GLfloat) 0.090122,
+       (GLfloat) 0.127394, (GLfloat) 0.031466, (GLfloat) - 0.028015,
+       (GLfloat) - 0.061000, (GLfloat) 0.169741, (GLfloat) - 0.127635,
+       (GLfloat) - 0.015117, (GLfloat) - 0.160883, (GLfloat) - 0.095443,
+       (GLfloat) - 0.185998, (GLfloat) - 0.182942, (GLfloat) 0.056857,
+       (GLfloat) 0.016499, (GLfloat) - 0.308118, (GLfloat) - 0.075513,
+       (GLfloat) 0.024971, (GLfloat) - 0.301226, (GLfloat) - 0.027251,
+       (GLfloat) - 0.035944, (GLfloat) 0.061566, (GLfloat) 0.013883,
+       (GLfloat) 0.007215, (GLfloat) 0.046198, (GLfloat) - 0.227891,
+       (GLfloat) 0.189165, (GLfloat) 0.079471, (GLfloat) - 0.067849,
+       (GLfloat) 0.026963, (GLfloat) 0.027982, (GLfloat) - 0.050419,
+       (GLfloat) - 0.050896, (GLfloat) 0.069604, (GLfloat) - 0.196938,
+       (GLfloat) 0.064274, (GLfloat) - 0.205263, (GLfloat) 0.297868,
+       (GLfloat) - 0.047543, (GLfloat) 0.147822, (GLfloat) 0.166593,
+       (GLfloat) 0.010318, (GLfloat) - 0.002148, (GLfloat) 0.029434,
+       (GLfloat) 0.036107, (GLfloat) - 0.523568, (GLfloat) - 0.118442,
+       (GLfloat) - 0.199410, (GLfloat) 0.233526, (GLfloat) - 0.161289,
+       (GLfloat) - 0.047441, (GLfloat) - 0.013973, (GLfloat) 0.112998,
+       (GLfloat) - 0.043494, (GLfloat) - 0.181796, (GLfloat) 0.065864,
+       (GLfloat) - 0.074984, (GLfloat) 0.177758, (GLfloat) - 0.156470,
+       (GLfloat) 0.225216, (GLfloat) 0.081058, (GLfloat) - 0.169876,
+       (GLfloat) - 0.041510, (GLfloat) 0.025763, (GLfloat) - 0.231350,
+       (GLfloat) 0.259015, (GLfloat) 0.274641, (GLfloat) 0.018290,
+       (GLfloat) 0.039196, (GLfloat) 0.010028, (GLfloat) 0.072771,
+       (GLfloat) 0.031646, (GLfloat) 0.075290, (GLfloat) 0.039258,
+       (GLfloat) 0.052930, (GLfloat) - 0.034809, (GLfloat) 0.165429,
+       (GLfloat) - 0.072511, (GLfloat) 0.095786, (GLfloat) - 0.222144,
+       (GLfloat) 0.038706, (GLfloat) 0.032296, (GLfloat) - 0.002495,
+       (GLfloat) 0.011675, (GLfloat) - 0.061944, (GLfloat) 0.082555,
+       (GLfloat) - 0.168400, (GLfloat) 0.074113, (GLfloat) 0.049321,
+       (GLfloat) 0.001263, (GLfloat) - 0.207436, (GLfloat) 0.013949,
+       (GLfloat) - 0.027045, (GLfloat) 0.015697, (GLfloat) - 0.047831,
+       (GLfloat) 0.121989, (GLfloat) - 0.043014, (GLfloat) - 0.004426,
+       (GLfloat) 0.238374, (GLfloat) - 0.320060, (GLfloat) - 0.111754,
+       (GLfloat) 0.095077, (GLfloat) 0.014640, (GLfloat) 0.070665,
+       (GLfloat) - 0.084367, (GLfloat) 0.016444, (GLfloat) 0.000788,
+       (GLfloat) - 0.117804, (GLfloat) 0.113550, (GLfloat) 0.087029,
+       (GLfloat) - 0.109080, (GLfloat) - 0.155795, (GLfloat) 0.040085,
+       (GLfloat) - 0.020370, (GLfloat) 0.118787, (GLfloat) 0.101787,
+       (GLfloat) 0.140877, (GLfloat) - 0.144829, (GLfloat) 0.107720,
+       (GLfloat) - 0.247002, (GLfloat) - 0.454632, (GLfloat) 0.070535,
+       (GLfloat) - 0.016278, (GLfloat) - 0.111440, (GLfloat) 0.270110,
+       (GLfloat) - 0.017624, (GLfloat) - 0.146232, (GLfloat) 0.154626,
+       (GLfloat) 0.214030, (GLfloat) 0.041025, (GLfloat) - 0.170250,
+       (GLfloat) 0.010009, (GLfloat) - 0.159290, (GLfloat) - 0.076895,
+       (GLfloat) 0.116168, (GLfloat) 0.156775, (GLfloat) - 0.077935,
+       (GLfloat) 0.199355, (GLfloat) 0.081120, (GLfloat) 0.003352,
+       (GLfloat) 0.054178, (GLfloat) - 0.036863, (GLfloat) - 0.004573,
+       (GLfloat) - 0.015149, (GLfloat) 0.057005, (GLfloat) - 0.008878,
+       (GLfloat) 0.374758, (GLfloat) - 0.007823, (GLfloat) - 0.078051,
+       (GLfloat) - 0.034977, (GLfloat) 0.026837, (GLfloat) 0.035441,
+       (GLfloat) 0.101867, (GLfloat) 0.121954, (GLfloat) 0.040450,
+       (GLfloat) - 0.136911, (GLfloat) 0.010061, (GLfloat) 0.082698,
+       (GLfloat) 0.121665, (GLfloat) - 0.589852, (GLfloat) 0.106401,
+       (GLfloat) - 0.064574, (GLfloat) 0.098679, (GLfloat) 0.059336,
+       (GLfloat) 0.103037, (GLfloat) - 0.075263, (GLfloat) 0.172586,
+       (GLfloat) - 0.217492, (GLfloat) - 0.170584, (GLfloat) - 0.025846,
+       (GLfloat) 0.260366, (GLfloat) 0.002117, (GLfloat) 0.041535,
+       (GLfloat) - 0.024112, (GLfloat) - 0.023437, (GLfloat) - 0.088146,
+       (GLfloat) - 0.007767, (GLfloat) 0.061738, (GLfloat) 0.116208,
+       (GLfloat) 0.253471, (GLfloat) 0.113278, (GLfloat) 0.231012,
+       (GLfloat) - 0.011399, (GLfloat) 0.116962, (GLfloat) - 0.037465,
+       (GLfloat) 0.233898, (GLfloat) 0.226108, (GLfloat) 0.077176,
+       (GLfloat) - 0.004640, (GLfloat) 0.209191, (GLfloat) - 0.091738,
+       (GLfloat) 0.093995, (GLfloat) 0.328937, (GLfloat) 0.245098,
+       (GLfloat) 0.155739, (GLfloat) - 0.327971, (GLfloat) - 0.115265,
+       (GLfloat) 0.125306, (GLfloat) 0.174931, (GLfloat) 0.130030,
+       (GLfloat) 0.005005, (GLfloat) - 0.022310, (GLfloat) 0.120651,
+       (GLfloat) 0.046982, (GLfloat) - 0.058839, (GLfloat) - 0.097958,
+       (GLfloat) - 0.059618, (GLfloat) - 0.068114, (GLfloat) 0.070137,
+       (GLfloat) 0.053184, (GLfloat) - 0.081163, (GLfloat) 0.000020,
+       (GLfloat) 0.188066, (GLfloat) - 0.082942, (GLfloat) - 0.013689,
+       (GLfloat) - 0.161390, (GLfloat) - 0.335891, (GLfloat) - 0.060737,
+       (GLfloat) 0.131189, (GLfloat) 0.036733, (GLfloat) - 0.093511,
+       (GLfloat) - 0.002496, (GLfloat) - 0.059035, (GLfloat) - 0.084055,
+       (GLfloat) 0.109820, (GLfloat) - 0.235531, (GLfloat) 0.130865,
+       (GLfloat) 0.018909, (GLfloat) 0.062351, (GLfloat) 0.111532,
+       (GLfloat) 0.123548, (GLfloat) 0.094008, (GLfloat) 0.056761,
+       (GLfloat) 0.106710, (GLfloat) - 0.049834, (GLfloat) - 0.147748,
+       (GLfloat) 0.102940, (GLfloat) - 0.113169, (GLfloat) 0.191710,
+       (GLfloat) - 0.028647, (GLfloat) 0.128038, (GLfloat) - 0.104189,
+       (GLfloat) 0.107226, (GLfloat) - 0.220633, (GLfloat) - 0.147310,
+       (GLfloat) - 0.205747, (GLfloat) 0.063433, (GLfloat) - 0.026135,
+       (GLfloat) - 0.064614, (GLfloat) 0.096963, (GLfloat) - 0.080108,
+       (GLfloat) - 0.083255, (GLfloat) 0.113008, (GLfloat) - 0.089852,
+       (GLfloat) 0.180961, (GLfloat) - 0.269100, (GLfloat) 0.115523,
+       (GLfloat) 0.044722, (GLfloat) - 0.023285, (GLfloat) 0.024813,
+       (GLfloat) 0.078986, (GLfloat) 0.037242, (GLfloat) 0.005124,
+       (GLfloat) 0.115141, (GLfloat) 0.124478, (GLfloat) - 0.034603,
+       (GLfloat) 0.022454, (GLfloat) 0.155937, (GLfloat) - 0.096183,
+       (GLfloat) 0.175318, (GLfloat) 0.007233, (GLfloat) - 0.138507,
+       (GLfloat) 0.019182, (GLfloat) - 0.037869, (GLfloat) 0.074242,
+       (GLfloat) 0.058218, (GLfloat) 0.212269, (GLfloat) - 0.003886,
+       (GLfloat) - 0.188525, (GLfloat) - 0.075703, (GLfloat) 0.075643,
+       (GLfloat) - 0.029085, (GLfloat) - 0.076746, (GLfloat) - 0.273473,
+       (GLfloat) - 0.105590, (GLfloat) - 0.238524, (GLfloat) - 0.087465,
+       (GLfloat) 0.086122, (GLfloat) - 0.340807, (GLfloat) - 0.192851,
+       (GLfloat) - 0.247936, (GLfloat) - 0.003160, (GLfloat) 0.082106,
+       (GLfloat) 0.137988, (GLfloat) - 0.041876, (GLfloat) - 0.012086,
+       (GLfloat) - 0.140714, (GLfloat) - 0.138827, (GLfloat) - 0.064179,
+       (GLfloat) - 0.059380, (GLfloat) 0.015642, (GLfloat) 0.113841,
+       (GLfloat) - 0.031501, (GLfloat) 0.007130, (GLfloat) - 0.125767,
+       (GLfloat) 0.021294, (GLfloat) - 0.021957, (GLfloat) - 0.069365,
+       (GLfloat) - 0.012419, (GLfloat) 0.019780, (GLfloat) - 0.077459,
+       (GLfloat) 0.085524, (GLfloat) 0.087513, (GLfloat) - 0.107484,
+       (GLfloat) - 0.303263, (GLfloat) 0.263672, (GLfloat) - 0.220649,
+       (GLfloat) - 0.090267, (GLfloat) - 0.376337, (GLfloat) - 0.127634,
+       (GLfloat) 0.087681, (GLfloat) 0.015985, (GLfloat) - 0.029860,
+       (GLfloat) 0.119257, (GLfloat) 0.140347, (GLfloat) 0.194003,
+       (GLfloat) 0.066270, (GLfloat) 0.127178, (GLfloat) - 0.003765,
+       (GLfloat) 0.037563, (GLfloat) - 0.110829, (GLfloat) 0.000382,
+       (GLfloat) 0.034295, (GLfloat) - 0.045737, (GLfloat) 0.045204,
+       (GLfloat) 0.017365, (GLfloat) - 0.072708, (GLfloat) 0.056698,
+       (GLfloat) 0.045238, (GLfloat) 0.187956, (GLfloat) - 0.055878,
+       (GLfloat) - 0.132755, (GLfloat) 0.017969, (GLfloat) - 0.041205,
+       (GLfloat) 0.189702, (GLfloat) - 0.020780, (GLfloat) - 0.077422,
+       (GLfloat) 0.210419, (GLfloat) 0.178041, (GLfloat) - 0.005855,
+       (GLfloat) 0.104527, (GLfloat) - 0.304323, (GLfloat) 0.002581,
+       (GLfloat) 0.043359, (GLfloat) - 0.060695, (GLfloat) - 0.011878,
+       (GLfloat) - 0.000267, (GLfloat) 0.020510, (GLfloat) - 0.046383,
+       (GLfloat) 0.252891, (GLfloat) 0.074246, (GLfloat) - 0.047689,
+       (GLfloat) - 0.069874, (GLfloat) 0.118962, (GLfloat) - 0.052781,
+       (GLfloat) 0.086188, (GLfloat) 0.068354, (GLfloat) - 0.213621,
+       (GLfloat) 0.086637, (GLfloat) - 0.171519, (GLfloat) 0.006447,
+       (GLfloat) 0.196785, (GLfloat) - 0.086044, (GLfloat) - 0.068059,
+       (GLfloat) 0.100401, (GLfloat) 0.243886, (GLfloat) - 0.142258,
+       (GLfloat) 0.173010, (GLfloat) 0.303375, (GLfloat) - 0.060085,
+       (GLfloat) - 0.041181, (GLfloat) - 0.097467, (GLfloat) 0.073776,
+       (GLfloat) - 0.013471, (GLfloat) - 0.133299, (GLfloat) - 0.143570,
+       (GLfloat) - 0.302092, (GLfloat) - 0.158342, (GLfloat) 0.230719,
+       (GLfloat) 0.074434, (GLfloat) - 0.143530, (GLfloat) 0.294895,
+       (GLfloat) - 0.165626, (GLfloat) 0.200869, (GLfloat) - 0.130737,
+       (GLfloat) 0.102444, (GLfloat) 0.277067, (GLfloat) 0.078210,
+       (GLfloat) - 0.183696, (GLfloat) - 0.010502, (GLfloat) - 0.150481,
+       (GLfloat) - 0.070029, (GLfloat) - 0.019635, (GLfloat) - 0.059141,
+       (GLfloat) - 0.005930, (GLfloat) 0.069199, (GLfloat) - 0.013126,
+       (GLfloat) - 0.119333, (GLfloat) - 0.007972, (GLfloat) 0.119489,
+       (GLfloat) 0.033072, (GLfloat) 0.081756, (GLfloat) - 0.034481,
+       (GLfloat) - 0.108282, (GLfloat) - 0.065310, (GLfloat) 0.146009,
+       (GLfloat) 0.080950, (GLfloat) 0.111320, (GLfloat) 0.004291,
+       (GLfloat) 0.071208, (GLfloat) - 0.112941, (GLfloat) 0.028135,
+       (GLfloat) - 0.024632, (GLfloat) 0.190525, (GLfloat) - 0.285626,
+       (GLfloat) - 0.105040, (GLfloat) 0.044008, (GLfloat) 0.020236,
+       (GLfloat) - 0.017815, (GLfloat) - 0.076684, (GLfloat) - 0.065840,
+       (GLfloat) 0.083563, (GLfloat) 0.100873, (GLfloat) - 0.141154,
+       (GLfloat) - 0.062066, (GLfloat) - 0.010894, (GLfloat) 0.066110,
+       (GLfloat) - 0.056763, (GLfloat) 0.024777, (GLfloat) - 0.176209,
+       (GLfloat) - 0.014442, (GLfloat) 0.052861, (GLfloat) 0.013010,
+       (GLfloat) - 0.157546, (GLfloat) - 0.118279, (GLfloat) - 0.237648,
+       (GLfloat) - 0.234497, (GLfloat) - 0.158049, (GLfloat) 0.102635,
+       (GLfloat) 0.061685, (GLfloat) - 0.052695, (GLfloat) - 0.042243,
+       (GLfloat) 0.093961, (GLfloat) - 0.025060, (GLfloat) 0.046602,
+       (GLfloat) 0.004395, (GLfloat) 0.150912, (GLfloat) 0.191784,
+       (GLfloat) 0.067299, (GLfloat) - 0.059575, (GLfloat) 0.161018,
+       (GLfloat) - 0.233155, (GLfloat) - 0.109721, (GLfloat) 0.194653,
+       (GLfloat) 0.217444, (GLfloat) 0.221231, (GLfloat) - 0.201241,
+       (GLfloat) - 0.033689, (GLfloat) - 0.341937, (GLfloat) - 0.099231,
+       (GLfloat) 0.042771, (GLfloat) - 0.028862, (GLfloat) 0.067736,
+       (GLfloat) 0.110240, (GLfloat) 0.274029, (GLfloat) - 0.157689,
+       (GLfloat) - 0.055994, (GLfloat) 0.144729, (GLfloat) 0.090901,
+       (GLfloat) 0.211192, (GLfloat) 0.058165, (GLfloat) - 0.149872,
+       (GLfloat) 0.102735, (GLfloat) - 0.044061, (GLfloat) - 0.044795,
+       (GLfloat) - 0.042153, (GLfloat) - 0.010955, (GLfloat) 0.014341,
+       (GLfloat) - 0.011649, (GLfloat) 0.099072, (GLfloat) - 0.086419,
+       (GLfloat) - 0.018920, (GLfloat) 0.000640, (GLfloat) - 0.031729,
+       (GLfloat) - 0.216886, (GLfloat) - 0.057512, (GLfloat) 0.071195,
+       (GLfloat) - 0.188150, (GLfloat) 0.049292, (GLfloat) 0.258489,
+       (GLfloat) - 0.023494, (GLfloat) 0.021489, (GLfloat) 0.199785,
+       (GLfloat) - 0.045818, (GLfloat) 0.066753, (GLfloat) - 0.035593,
+       (GLfloat) 0.010986, (GLfloat) 0.166767, (GLfloat) 0.275085,
+       (GLfloat) - 0.177039, (GLfloat) 0.010372, (GLfloat) 0.167936,
+       (GLfloat) - 0.423239, (GLfloat) 0.027466, (GLfloat) - 0.126114,
+       (GLfloat) - 0.102035, (GLfloat) 0.282640, (GLfloat) 0.022622,
+       (GLfloat) - 0.023997, (GLfloat) 0.176943, (GLfloat) 0.093272,
+       (GLfloat) - 0.090009, (GLfloat) 0.015338, (GLfloat) 0.250857,
+       (GLfloat) 0.011095, (GLfloat) 0.006703, (GLfloat) 0.057076,
+       (GLfloat) 0.133423, (GLfloat) 0.234639, (GLfloat) - 0.070260,
+       (GLfloat) - 0.295994, (GLfloat) 0.185615, (GLfloat) 0.117148,
+       (GLfloat) 0.235480, (GLfloat) 0.066195, (GLfloat) 0.078641,
+       (GLfloat) - 0.026545, (GLfloat) 0.093931, (GLfloat) 0.008019,
+       (GLfloat) 0.181656, (GLfloat) - 0.088719, (GLfloat) 0.045959,
+       (GLfloat) - 0.076308, (GLfloat) - 0.164584, (GLfloat) 0.018271,
+       (GLfloat) 0.092026, (GLfloat) 0.201866, (GLfloat) - 0.106051,
+       (GLfloat) 0.019876, (GLfloat) 0.050967, (GLfloat) 0.176081,
+       (GLfloat) - 0.018546, (GLfloat) 0.138749, (GLfloat) - 0.008255,
+       (GLfloat) - 0.026049, (GLfloat) - 0.068465, (GLfloat) - 0.055467,
+       (GLfloat) - 0.260245, (GLfloat) 0.221833, (GLfloat) - 0.048541,
+       (GLfloat) - 0.169783, (GLfloat) 0.354992, (GLfloat) - 0.017943,
+       (GLfloat) - 0.306063, (GLfloat) 0.074787, (GLfloat) 0.101971,
+       (GLfloat) 0.215973, (GLfloat) 0.107558, (GLfloat) - 0.008808,
+       (GLfloat) 0.390235, (GLfloat) - 0.275652, (GLfloat) - 0.117085,
+       (GLfloat) 0.033898, (GLfloat) 0.046047, (GLfloat) - 0.108977,
+       (GLfloat) - 0.263507, (GLfloat) - 0.091765, (GLfloat) - 0.250234,
+       (GLfloat) - 0.044613, (GLfloat) 0.149563, (GLfloat) 0.027937,
+       (GLfloat) - 0.015397, (GLfloat) - 0.040254, (GLfloat) 0.065692,
+       (GLfloat) - 0.017531, (GLfloat) - 0.013504, (GLfloat) 0.004021,
+       (GLfloat) 0.054665, (GLfloat) - 0.018996, (GLfloat) - 0.006954,
+       (GLfloat) 0.033068, (GLfloat) 0.219349, (GLfloat) - 0.194079,
+       (GLfloat) - 0.057780, (GLfloat) 0.011881, (GLfloat) 0.084904,
+       (GLfloat) 0.139243, (GLfloat) - 0.109890, (GLfloat) 0.039145,
+       (GLfloat) 0.223272, (GLfloat) 0.208110, (GLfloat) 0.165882,
+       (GLfloat) - 0.008046, (GLfloat) 0.103847, (GLfloat) 0.278718,
+       (GLfloat) - 0.035499, (GLfloat) 0.112662, (GLfloat) - 0.088418,
+       (GLfloat) - 0.053118, (GLfloat) 0.053871, (GLfloat) - 0.054706,
+       (GLfloat) 0.118632, (GLfloat) 0.086431, (GLfloat) - 0.022494,
+       (GLfloat) 0.014943, (GLfloat) 0.039622, (GLfloat) 0.047307,
+       (GLfloat) 0.006570, (GLfloat) 0.093461, (GLfloat) 0.058982,
+       (GLfloat) 0.031448, (GLfloat) 0.325716, (GLfloat) - 0.047305,
+       (GLfloat) - 0.193710, (GLfloat) 0.087226, (GLfloat) 0.051790,
+       (GLfloat) 0.116154, (GLfloat) - 0.080023, (GLfloat) - 0.106643,
+       (GLfloat) 0.156514, (GLfloat) - 0.222710, (GLfloat) 0.275425,
+       (GLfloat) - 0.084294, (GLfloat) - 0.101851, (GLfloat) 0.425222,
+       (GLfloat) 0.030344, (GLfloat) - 0.141370, (GLfloat) - 0.282460,
+       (GLfloat) 0.003022, (GLfloat) 0.108996, (GLfloat) - 0.229152,
+       (GLfloat) - 0.133040, (GLfloat) 0.061025, (GLfloat) - 0.128942,
+       (GLfloat) - 0.077348, (GLfloat) 0.013363, (GLfloat) - 0.072511,
+       (GLfloat) - 0.050317, (GLfloat) 0.452190, (GLfloat) 0.094114,
+       (GLfloat) 0.053309, (GLfloat) - 0.143722, (GLfloat) 0.249884,
+       (GLfloat) - 0.257016, (GLfloat) 0.100544, (GLfloat) 0.012236,
+       (GLfloat) - 0.022056, (GLfloat) - 0.212133, (GLfloat) 0.023533,
+       (GLfloat) 0.153299, (GLfloat) 0.031763, (GLfloat) 0.034577,
+       (GLfloat) 0.161729, (GLfloat) 0.084914, (GLfloat) 0.050770,
+       (GLfloat) 0.320438, (GLfloat) 0.112175, (GLfloat) 0.135015,
+       (GLfloat) - 0.040717, (GLfloat) 0.073400, (GLfloat) 0.080543,
+       (GLfloat) - 0.226004, (GLfloat) 0.143154, (GLfloat) 0.170139,
+       (GLfloat) 0.009756, (GLfloat) 0.068337, (GLfloat) 0.132111,
+       (GLfloat) 0.380191, (GLfloat) 0.233715, (GLfloat) 0.026664,
+       (GLfloat) - 0.018016, (GLfloat) 0.265426, (GLfloat) - 0.110691,
+       (GLfloat) 0.041281, (GLfloat) 0.056674, (GLfloat) - 0.119834,
+       (GLfloat) 0.170794, (GLfloat) - 0.112611, (GLfloat) 0.094839,
+       (GLfloat) 0.216318, (GLfloat) 0.002081, (GLfloat) 0.154653,
+       (GLfloat) - 0.036815, (GLfloat) 0.024332, (GLfloat) 0.172587,
+       (GLfloat) - 0.064554, (GLfloat) 0.160699, (GLfloat) 0.101229,
+       (GLfloat) 0.114451, (GLfloat) 0.016039, (GLfloat) 0.293489,
+       (GLfloat) 0.023010, (GLfloat) - 0.028932, (GLfloat) 0.014800,
+       (GLfloat) - 0.290527, (GLfloat) 0.172553, (GLfloat) 0.129526,
+       (GLfloat) - 0.048159, (GLfloat) - 0.181222, (GLfloat) 0.305871,
+       (GLfloat) 0.065351, (GLfloat) - 0.399962, (GLfloat) - 0.030479,
+       (GLfloat) 0.334123, (GLfloat) - 0.120149, (GLfloat) 0.241310,
+       (GLfloat) - 0.203728, (GLfloat) - 0.155627, (GLfloat) 0.140805,
+       (GLfloat) 0.061022, (GLfloat) - 0.016097, (GLfloat) 0.131688,
+       (GLfloat) 0.045050, (GLfloat) - 0.313782, (GLfloat) - 0.279077,
+       (GLfloat) 0.034252, (GLfloat) - 0.135512, (GLfloat) - 0.087765,
+       (GLfloat) 0.276236, (GLfloat) 0.036449, (GLfloat) 0.418332,
+       (GLfloat) - 0.122146, (GLfloat) 0.050998, (GLfloat) 0.131453,
+       (GLfloat) - 0.087629, (GLfloat) 0.330142, (GLfloat) 0.061353,
+       (GLfloat) 0.228676, (GLfloat) 0.093309, (GLfloat) - 0.009307,
+       (GLfloat) 0.435264, (GLfloat) 0.186185, (GLfloat) - 0.127484,
+       (GLfloat) 0.156565, (GLfloat) 0.013842, (GLfloat) - 0.103874,
+       (GLfloat) - 0.274053, (GLfloat) - 0.084119, (GLfloat) 0.096687,
+       (GLfloat) - 0.027947, (GLfloat) - 0.051152, (GLfloat) - 0.078997,
+       (GLfloat) 0.013399, (GLfloat) 0.194440, (GLfloat) 0.072030,
+       (GLfloat) 0.000082, (GLfloat) 0.130666, (GLfloat) 0.052218,
+       (GLfloat) 0.064984, (GLfloat) - 0.136859, (GLfloat) 0.092204,
+       (GLfloat) 0.109060, (GLfloat) 0.424779, (GLfloat) - 0.111867,
+       (GLfloat) 0.061748, (GLfloat) 0.160827, (GLfloat) - 0.068538,
+       (GLfloat) 0.062960, (GLfloat) 0.059638, (GLfloat) - 0.181514,
+       (GLfloat) 0.018961, (GLfloat) 0.072298, (GLfloat) 0.003517,
+       (GLfloat) - 0.099508, (GLfloat) - 0.225455, (GLfloat) - 0.021791,
+       (GLfloat) 0.001955, (GLfloat) - 0.320555, (GLfloat) 0.159506,
+       (GLfloat) - 0.057735, (GLfloat) - 0.054327, (GLfloat) - 0.095525,
+       (GLfloat) 0.319748, (GLfloat) - 0.146158, (GLfloat) - 0.198384,
+       (GLfloat) - 0.158741, (GLfloat) - 0.265443, (GLfloat) 0.036635,
+       (GLfloat) - 0.093089, (GLfloat) - 0.358379, (GLfloat) - 0.110549,
+       (GLfloat) - 0.049805, (GLfloat) 0.022246, (GLfloat) - 0.036724,
+       (GLfloat) 0.223000, (GLfloat) 0.247522, (GLfloat) - 0.232652,
+       (GLfloat) - 0.249441, (GLfloat) - 0.248325, (GLfloat) - 0.071169,
+       (GLfloat) 0.000369, (GLfloat) 0.094598, (GLfloat) - 0.162153,
+       (GLfloat) - 0.133873, (GLfloat) - 0.188473, (GLfloat) 0.272734,
+       (GLfloat) 0.046594, (GLfloat) 0.069766, (GLfloat) 0.015561,
+       (GLfloat) 0.111582, (GLfloat) - 0.239786, (GLfloat) 0.034658,
+       (GLfloat) 0.093232, (GLfloat) 0.183507, (GLfloat) - 0.011298,
+       (GLfloat) - 0.226805, (GLfloat) 0.514871, (GLfloat) - 0.064144,
+       (GLfloat) 0.085949, (GLfloat) 0.031412, (GLfloat) 0.042790,
+       (GLfloat) - 0.043755, (GLfloat) - 0.290797, (GLfloat) - 0.159142,
+       (GLfloat) 0.056671, (GLfloat) 0.167837, (GLfloat) 0.016536,
+       (GLfloat) - 0.034538, (GLfloat) 0.072185, (GLfloat) 0.066973,
+       (GLfloat) - 0.021211, (GLfloat) 0.064120, (GLfloat) - 0.174756,
+       (GLfloat) 0.090627, (GLfloat) - 0.055253, (GLfloat) 0.109457,
+       (GLfloat) 0.019686, (GLfloat) 0.004469, (GLfloat) - 0.096316,
+       (GLfloat) - 0.038864, (GLfloat) - 0.135083, (GLfloat) 0.244529,
+       (GLfloat) 0.034613, (GLfloat) - 0.069587, (GLfloat) 0.144533,
+       (GLfloat) - 0.100009, (GLfloat) - 0.057516, (GLfloat) - 0.079338,
+       (GLfloat) - 0.178026, (GLfloat) 0.085994, (GLfloat) 0.061804,
+       (GLfloat) - 0.189256, (GLfloat) 0.342739, (GLfloat) 0.043372,
+       (GLfloat) - 0.046206, (GLfloat) 0.168946, (GLfloat) - 0.133904,
+       (GLfloat) 0.015314, (GLfloat) - 0.090127, (GLfloat) - 0.058530,
+       (GLfloat) 0.169657, (GLfloat) - 0.097086, (GLfloat) 0.013746,
+       (GLfloat) 0.185131, (GLfloat) - 0.089445, (GLfloat) 0.347806,
+       (GLfloat) - 0.264432, (GLfloat) - 0.170170, (GLfloat) - 0.335858,
+       (GLfloat) - 0.086511, (GLfloat) 0.248252, (GLfloat) - 0.169698,
+       (GLfloat) 0.002287, (GLfloat) - 0.028338, (GLfloat) - 0.266432,
+       (GLfloat) - 0.085060, (GLfloat) 0.001974, (GLfloat) - 0.032789,
+       (GLfloat) 0.192750, (GLfloat) - 0.007081, (GLfloat) 0.098197,
+       (GLfloat) 0.012577, (GLfloat) 0.034983, (GLfloat) - 0.003058,
+       (GLfloat) - 0.039249, (GLfloat) 0.038498, (GLfloat) 0.067306,
+       (GLfloat) 0.021988, (GLfloat) 0.379705, (GLfloat) - 0.054619,
+       (GLfloat) - 0.151707, (GLfloat) 0.051034, (GLfloat) - 0.016003,
+       (GLfloat) - 0.057048, (GLfloat) 0.075729, (GLfloat) - 0.213397,
+       (GLfloat) - 0.137847, (GLfloat) 0.130600, (GLfloat) 0.046198,
+       (GLfloat) 0.024786, (GLfloat) 0.049556, (GLfloat) - 0.045772,
+       (GLfloat) - 0.082533, (GLfloat) 0.155397, (GLfloat) - 0.096145,
+       (GLfloat) 0.049152, (GLfloat) 0.270979, (GLfloat) - 0.147022,
+       (GLfloat) 0.061153, (GLfloat) - 0.104531, (GLfloat) - 0.103623,
+       (GLfloat) - 0.142997, (GLfloat) - 0.232885, (GLfloat) 0.040538,
+       (GLfloat) 0.048806, (GLfloat) - 0.013095, (GLfloat) - 0.003505,
+       (GLfloat) - 0.095063, (GLfloat) 0.241414, (GLfloat) - 0.202255,
+       (GLfloat) 0.108558, (GLfloat) - 0.147584, (GLfloat) 0.162682,
+       (GLfloat) 0.217105, (GLfloat) 0.252340, (GLfloat) - 0.114830,
+       (GLfloat) - 0.188028, (GLfloat) 0.417252, (GLfloat) - 0.077456,
+       (GLfloat) - 0.112855, (GLfloat) 0.105192, (GLfloat) 0.073968,
+       (GLfloat) - 0.186972, (GLfloat) 0.164022, (GLfloat) - 0.073415,
+       (GLfloat) - 0.074349, (GLfloat) - 0.324874, (GLfloat) - 0.056645,
+       (GLfloat) 0.327855, (GLfloat) - 0.271424, (GLfloat) - 0.141142,
+       (GLfloat) 0.151049, (GLfloat) 0.155239, (GLfloat) - 0.083116,
+       (GLfloat) 0.035395, (GLfloat) - 0.133176, (GLfloat) - 0.095112,
+       (GLfloat) 0.127283, (GLfloat) - 0.011837, (GLfloat) 0.199750,
+       (GLfloat) - 0.120775, (GLfloat) 0.103698, (GLfloat) 0.063302,
+       (GLfloat) 0.014222, (GLfloat) 0.198468, (GLfloat) 0.137537,
+       (GLfloat) - 0.269656, (GLfloat) 0.120644, (GLfloat) - 0.153958,
+       (GLfloat) - 0.136743, (GLfloat) - 0.119817, (GLfloat) - 0.073747,
+       (GLfloat) - 0.068156, (GLfloat) - 0.138484, (GLfloat) 0.033507,
+       (GLfloat) - 0.106835, (GLfloat) 0.114964, (GLfloat) 0.023924,
+       (GLfloat) - 0.222525, (GLfloat) 0.330321, (GLfloat) - 0.007431,
+       (GLfloat) - 0.011739, (GLfloat) 0.095156, (GLfloat) 0.139086,
+       (GLfloat) 0.146766, (GLfloat) 0.037685, (GLfloat) 0.136122,
+       (GLfloat) - 0.086532, (GLfloat) - 0.081295, (GLfloat) 0.009434,
+       (GLfloat) 0.189439, (GLfloat) 0.290592, (GLfloat) - 0.048317,
+       (GLfloat) 0.139152, (GLfloat) 0.224931, (GLfloat) 0.355509,
+       (GLfloat) 0.017162, (GLfloat) - 0.016825, (GLfloat) 0.094198,
+       (GLfloat) - 0.237595, (GLfloat) 0.205475, (GLfloat) - 0.041412,
+       (GLfloat) 0.050511, (GLfloat) 0.094900, (GLfloat) 0.252891,
+       (GLfloat) - 0.012538, (GLfloat) - 0.014082, (GLfloat) 0.064629,
+       (GLfloat) - 0.059810, (GLfloat) 0.020665, (GLfloat) - 0.260979,
+       (GLfloat) 0.073490, (GLfloat) - 0.242270, (GLfloat) 0.085847,
+       (GLfloat) 0.049499, (GLfloat) - 0.045617, (GLfloat) - 0.015894,
+       (GLfloat) - 0.121040, (GLfloat) 0.004350, (GLfloat) 0.381603,
+       (GLfloat) - 0.062798, (GLfloat) 0.055006, (GLfloat) 0.077472,
+       (GLfloat) - 0.156846, (GLfloat) - 0.033342, (GLfloat) 0.035284,
+       (GLfloat) 0.105383, (GLfloat) 0.002776, (GLfloat) - 0.046394,
+       (GLfloat) 0.247612, (GLfloat) 0.310528, (GLfloat) 0.046188,
+       (GLfloat) - 0.144567, (GLfloat) - 0.197996, (GLfloat) 0.083309,
+       (GLfloat) - 0.317845, (GLfloat) - 0.014793, (GLfloat) - 0.041608,
+       (GLfloat) - 0.169858, (GLfloat) 0.102631, (GLfloat) 0.283962,
+       (GLfloat) - 0.168757, (GLfloat) 0.093105, (GLfloat) 0.050325,
+       (GLfloat) - 0.013639, (GLfloat) 0.285100, (GLfloat) 0.047089,
+       (GLfloat) 0.216644, (GLfloat) 0.102018, (GLfloat) 0.031983,
+       (GLfloat) 0.046988, (GLfloat) 0.081482, (GLfloat) 0.021865,
+       (GLfloat) 0.124995, (GLfloat) - 0.193086, (GLfloat) 0.127870,
+       (GLfloat) 0.009153, (GLfloat) 0.178713, (GLfloat) - 0.077949,
+       (GLfloat) - 0.235371, (GLfloat) - 0.046817, (GLfloat) - 0.125764,
+       (GLfloat) - 0.089381, (GLfloat) 0.289172, (GLfloat) - 0.129356,
+       (GLfloat) 0.312993, (GLfloat) 0.120426, (GLfloat) 0.296957,
+       (GLfloat) - 0.106431, (GLfloat) 0.117096, (GLfloat) 0.156971,
+       (GLfloat) 0.030001, (GLfloat) 0.244577, (GLfloat) 0.085119,
+       (GLfloat) 0.002958, (GLfloat) - 0.035469, (GLfloat) - 0.084615,
+       (GLfloat) - 0.052248, (GLfloat) - 0.004298, (GLfloat) - 0.129170,
+       (GLfloat) - 0.158458, (GLfloat) 0.059061, (GLfloat) - 0.041780,
+       (GLfloat) - 0.007117, (GLfloat) - 0.174211, (GLfloat) 0.098819,
+       (GLfloat) - 0.158387, (GLfloat) 0.060840, (GLfloat) - 0.064818,
+       (GLfloat) 0.117241, (GLfloat) - 0.050754, (GLfloat) - 0.027945,
+       (GLfloat) - 0.014301, (GLfloat) 0.146402, (GLfloat) - 0.118414,
+       (GLfloat) 0.186611, (GLfloat) - 0.162182, (GLfloat) - 0.150909,
+       (GLfloat) - 0.106992, (GLfloat) 0.286109, (GLfloat) - 0.055512,
+       (GLfloat) 0.109689, (GLfloat) - 0.346409, (GLfloat) 0.072611,
+       (GLfloat) - 0.009694, (GLfloat) - 0.038102, (GLfloat) 0.098565,
+       (GLfloat) - 0.034598, (GLfloat) 0.323300, (GLfloat) 0.020962,
+       (GLfloat) - 0.149219, (GLfloat) 0.040596, (GLfloat) - 0.114206,
+       (GLfloat) 0.164744, (GLfloat) 0.048081, (GLfloat) 0.105464,
+       (GLfloat) 0.036214, (GLfloat) 0.099523, (GLfloat) 0.038595,
+       (GLfloat) 0.056537, (GLfloat) 0.036271, (GLfloat) 0.003042,
+       (GLfloat) - 0.157110, (GLfloat) 0.001614, (GLfloat) - 0.133994,
+       (GLfloat) - 0.104357, (GLfloat) - 0.032004, (GLfloat) 0.262334,
+       (GLfloat) 0.041215, (GLfloat) - 0.010418, (GLfloat) - 0.037968,
+       (GLfloat) 0.223491, (GLfloat) - 0.387946, (GLfloat) 0.117291,
+       (GLfloat) - 0.344434, (GLfloat) 0.110318, (GLfloat) - 0.031448,
+       (GLfloat) 0.123562, (GLfloat) - 0.315729, (GLfloat) 0.164533,
+       (GLfloat) 0.008207, (GLfloat) 0.042004, (GLfloat) 0.050014,
+       (GLfloat) - 0.191339, (GLfloat) - 0.069291, (GLfloat) - 0.220065,
+       (GLfloat) 0.023845, (GLfloat) 0.009474, (GLfloat) 0.035598,
+       (GLfloat) - 0.173295, (GLfloat) - 0.036604, (GLfloat) - 0.193323,
+       (GLfloat) - 0.040347, (GLfloat) - 0.106063, (GLfloat) - 0.055559,
+       (GLfloat) - 0.071543, (GLfloat) 0.136487, (GLfloat) 0.105697,
+       (GLfloat) - 0.179027, (GLfloat) - 0.071852, (GLfloat) 0.117512,
+       (GLfloat) 0.064769, (GLfloat) - 0.345895, (GLfloat) 0.012833,
+       (GLfloat) 0.044800, (GLfloat) - 0.032357, (GLfloat) - 0.042161,
+       (GLfloat) 0.243586, (GLfloat) 0.392499, (GLfloat) - 0.180641,
+       (GLfloat) - 0.148924, (GLfloat) - 0.181446, (GLfloat) 0.146644,
+       (GLfloat) - 0.042773, (GLfloat) 0.045843, (GLfloat) - 0.176893,
+       (GLfloat) 0.025938, (GLfloat) 0.058109, (GLfloat) 0.242063,
+       (GLfloat) - 0.028489, (GLfloat) - 0.024828, (GLfloat) 0.161289,
+       (GLfloat) 0.073899, (GLfloat) - 0.081205, (GLfloat) - 0.023751,
+       (GLfloat) 0.026149, (GLfloat) 0.051399, (GLfloat) - 0.072348,
+       (GLfloat) 0.024308, (GLfloat) - 0.041819, (GLfloat) - 0.030578,
+       (GLfloat) - 0.077778, (GLfloat) 0.010272, (GLfloat) 0.066967,
+       (GLfloat) - 0.139184, (GLfloat) - 0.018983, (GLfloat) 0.035150,
+       (GLfloat) - 0.061359, (GLfloat) - 0.152358, (GLfloat) - 0.072849,
+       (GLfloat) 0.043101, (GLfloat) 0.028278, (GLfloat) 0.077387,
+       (GLfloat) 0.065599, (GLfloat) - 0.049676, (GLfloat) 0.043708,
+       (GLfloat) - 0.255767, (GLfloat) 0.023510, (GLfloat) - 0.076982,
+       (GLfloat) 0.020468, (GLfloat) - 0.040630, (GLfloat) 0.208424,
+       (GLfloat) 0.044922, (GLfloat) 0.025184, (GLfloat) 0.004764,
+       (GLfloat) 0.107432, (GLfloat) - 0.009356, (GLfloat) 0.239863,
+       (GLfloat) - 0.005475, (GLfloat) 0.158400, (GLfloat) 0.089743,
+       (GLfloat) 0.018352, (GLfloat) 0.134559, (GLfloat) 0.221650,
+       (GLfloat) 0.094423, (GLfloat) 0.129390, (GLfloat) - 0.031274,
+       (GLfloat) 0.048541, (GLfloat) 0.100595, (GLfloat) - 0.155938,
+       (GLfloat) - 0.016298, (GLfloat) - 0.036518, (GLfloat) - 0.149178,
+       (GLfloat) - 0.329953, (GLfloat) - 0.327602, (GLfloat) - 0.150086,
+       (GLfloat) 0.148403, (GLfloat) - 0.363334, (GLfloat) 0.028237,
+       (GLfloat) - 0.305790, (GLfloat) - 0.009844, (GLfloat) - 0.075571,
+       (GLfloat) - 0.045131, (GLfloat) 0.152595, (GLfloat) 0.228720,
+       (GLfloat) 0.039725, (GLfloat) - 0.127469, (GLfloat) 0.066522,
+       (GLfloat) - 0.078576, (GLfloat) - 0.349749, (GLfloat) - 0.146881,
+       (GLfloat) 0.013160, (GLfloat) - 0.040312, (GLfloat) 0.129980,
+       (GLfloat) 0.221142, (GLfloat) - 0.106068, (GLfloat) 0.254967,
+       (GLfloat) 0.180912, (GLfloat) - 0.207357, (GLfloat) - 0.196999,
+       (GLfloat) 0.098219, (GLfloat) 0.085231, (GLfloat) 0.121963,
+};
+
+struct lwo  LWO_s1_b =
+{
+       500,                    /* number of points */
+       s1_b_PNTS, 0L, 0L, 0L
+};
+
+#endif /* MODE_sproingies */
+
+/* End of s1_b.c */
diff --git a/modes/glx/sballs.c b/modes/glx/sballs.c
new file mode 100644 (file)
index 0000000..6286b7b
--- /dev/null
@@ -0,0 +1,852 @@
+/* sballs --- 8 balls spinning like crazy in GL */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)sballs.c     5.01 2001/03/09 xlockmore";
+#endif
+
+/* Copyright (c) E. Lassauge, 2001. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by 
+ * Mustata Bogdan (LoneRunner) <lonerunner@planetquake.com>
+ * and can be found at http://www.cfxweb.net/lonerunner/
+ *
+ * Eric Lassauge  (November-07-2000) <lassauge@mail.dotcom.fr>
+ *                                 http://lassauge.free.fr/linux.html
+ *
+ * REVISION HISTORY:
+ *
+ * E.Lassauge - 09-Mar-2001:
+ *      - get rid of my framerate options to use showfps
+ * E.Lassauge - 28-Nov-2000:
+ *      - add handling of polyhedrons (like in ico)
+ *      - modified release part to add freeing of GL objects
+ * E.Lassauge - 14-Nov-2000:
+ *      - use new common xpm_to_ximage function
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Sballs"
+#define HACK_INIT init_sballs
+#define HACK_DRAW draw_sballs
+#define sballs xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*size: 0 \n" \
+ "*object: 0\n" \      /* random object */
+ "*trackmouse: False \n" \
+ "*showfps: False \n" \
+ "*wireframe:  False \n"
+
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else                          /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "visgl.h"
+#endif                         /* !STANDALONE */
+#include "iostuff.h"            /* getFont() */
+
+#ifdef MODE_sballs
+
+#define MINSIZE        32      /* minimal viewport size */
+#define FRAME           50      /* frame count interval */
+#define MAX_OBJ                8       /* number of 3D objects */
+
+#include <GL/gl.h>
+#include <GL/glx.h>
+#include <GL/glu.h>
+
+#include "xpm-ximage.h"
+
+#ifdef STANDALONE
+#include "../images/face.xpm"
+#include "../images/back.xpm"
+#else /* !STANDALONE */
+#include "pixmaps/face.xpm"
+#include "pixmaps/back.xpm"
+#endif /* !STANDALONE */
+
+/* Manage option vars */
+#define DEF_TEXTURE    "True"
+#define DEF_TRACKMOUSE  "False"
+#define DEF_OBJECT     "2"
+#define DEF_OBJECT_INDX        2
+static Bool do_texture;
+static Bool do_trackmouse;
+static int  object;
+static int  spheres;
+static XFontStruct *mode_font = None;
+
+static XrmOptionDescRec opts[] = {
+    {(char *) "-texture", (char *) ".sballs.texture", XrmoptionNoArg, (caddr_t) "on"},
+    {(char *) "+texture", (char *) ".sballs.texture", XrmoptionNoArg, (caddr_t) "off"},
+    {(char *) "-trackmouse", (char *) ".sballs.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+    {(char *) "+trackmouse", (char *) ".sballs.trackmouse", XrmoptionNoArg, (caddr_t) "off"},
+    {(char *) "-object", (char *) ".sballs.object", XrmoptionSepArg, (caddr_t) NULL},
+
+};
+
+static argtype vars[] = {
+    {(caddr_t *) & do_texture, (char *) "texture", (char *) "Texture", (char *) DEF_TEXTURE, t_Bool},
+    {(caddr_t *) & do_trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool},
+    {(caddr_t *) & object, (char *) "object", (char *) "Object", (char *) DEF_OBJECT, t_Int},
+
+};
+
+static OptionStruct desc[] = {
+    /*{(char *) "-count spheres", (char *) "set number of spheres"},*/
+    /*{(char *) "-cycles speed", (char *) "set ball speed value"},*/
+    {(char *) "-/+texture", (char *) "turn on/off texturing"},
+    {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"},
+    {(char *) "-object num", (char *) "number of the 3D object (0 means random)"},
+};
+
+ModeSpecOpt sballs_opts =
+ { sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc };
+
+#ifdef USE_MODULES
+ModStruct sballs_description =
+    { "sballs", "init_sballs", "draw_sballs", "release_sballs",
+    "draw_sballs", "change_sballs", NULL, &sballs_opts,
+    /*
+    delay,count,cycles,size,ncolors,sat
+     */
+    10000, 0, 10, 400, 64, 1.0, "",
+    "balls spinning like crazy in GL", 0, NULL
+};
+#endif /* USE_MODULES */
+
+/* misc types and defines */
+#define vinit(a,i,j,k) {\
+  (a)[0]=i;\
+  (a)[1]=j;\
+  (a)[2]=k;\
+}
+typedef float vec_t;
+typedef vec_t vec3_t[3];
+
+#define MAX_BALLS      20
+
+/* the mode struct, contains all per screen variables */
+typedef struct {
+    GLint WIDTH, HEIGHT;       /* display dimensions */
+    GLXContext *glx_context;
+
+
+    XImage *btexture;          /* back texture image bits */
+    XImage *ftexture;          /* face texture image bits */
+    GLuint backid;             /* back texture id: GL world */
+    GLuint faceid;             /* face texture id: GL world */
+    GLuint fontbase;            /* fontbase id: GL world */
+
+    vec3_t eye;
+    vec3_t rot;
+    vec3_t rotm;
+    int speed;
+    float radius[MAX_BALLS];
+
+    clock_t told;              /* frame timetag */
+    int frcount;               /* frame counter */
+    char frbuf[80];            /* frame value string */
+} sballsstruct;
+
+/* array of sballsstruct indexed by screen number */
+static sballsstruct *sballs = (sballsstruct *) NULL;
+
+/* lights */
+static float LightAmbient[]=   { 1.0f, 1.0f, 1.0f, 1.0f };
+static float LightDiffuse[]=   { 1.0f, 1.0f, 1.0f, 1.0f };
+static float LightPosition[]=  { 0.0f, 0.0f, 4.0f, 1.0f };
+
+/* structure of the polyhedras */
+typedef struct {
+        char       *longname;   /* long name of object */
+        char       *shortname;  /* short name of object */
+        int         numverts;   /* number of vertices */
+        float      radius;     /* radius */
+        vec3_t      v[MAX_BALLS];/* the vertices */
+} Polyinfo;
+
+static Polyinfo polygons[] =
+{
+
+/* 0: objtetra - structure values for tetrahedron */
+        {
+                "tetrahedron", "tetra",         /* long and short names */
+                4,                             /* number of vertices */
+               0.8,
+                {                              /* vertices (x,y,z) */
+                        /* all points must be within radius 2 of the origin */
+#define T 1.0
+                        {T, T, T},
+                        {T, -T, -T},
+                        {-T, T, -T},
+                        {-T, -T, T},
+#undef T
+                }
+        },
+
+/* 1: objcube - structure values for cube */
+
+        {
+                "hexahedron", "cube",          /* long and short names */
+                8,                             /* number of vertices, edges, and faces */
+               0.6,
+                {                              /* vertices (x,y,z) */
+                        /* all points must be within radius 2 of the origin */
+#define T 1.0
+                        {T, T, T},
+                        {T, T, -T},
+                        {T, -T, -T},
+                        {T, -T, T},
+                        {-T, T, T},
+                        {-T, T, -T},
+                        {-T, -T, -T},
+                        {-T, -T, T},
+#undef T
+                }
+        },
+
+/* 2: objocta - structure values for octahedron */
+
+        {
+                "octahedron", "octa",   /* long and short names */
+                6,                     /* number of vertices */
+               0.6,
+                {                      /* vertices (x,y,z) */
+                        /* all points must be within radius 2 of the origin */
+#define T 1.5
+                        {T, 0, 0},
+                        {-T, 0, 0},
+                        {0, T, 0},
+                        {0, -T, 0},
+                        {0, 0, T},
+                        {0, 0, -T},
+#undef T
+                }
+        },
+/* 3: objdodec - structure values for dodecahedron */
+
+        {
+                "dodecahedron", "dodeca",       /* long and short names */
+                20,                            /* number of vertices */
+               0.35,
+                {                              /* vertices (x,y,z) */
+                        /* all points must be within radius 2 of the origin */
+                        {0.000000, 0.500000, 1.000000},
+                        {0.000000, -0.500000, 1.000000},
+                        {0.000000, -0.500000, -1.000000},
+                        {0.000000, 0.500000, -1.000000},
+                        {1.000000, 0.000000, 0.500000},
+                        {-1.000000, 0.000000, 0.500000},
+                        {-1.000000, 0.000000, -0.500000},
+                        {1.000000, 0.000000, -0.500000},
+                        {0.500000, 1.000000, 0.000000},
+                        {-0.500000, 1.000000, 0.000000},
+                        {-0.500000, -1.000000, 0.000000},
+                        {0.500000, -1.000000, 0.000000},
+                        {0.750000, 0.750000, 0.750000},
+                        {-0.750000, 0.750000, 0.750000},
+                        {-0.750000, -0.750000, 0.750000},
+                        {0.750000, -0.750000, 0.750000},
+                        {0.750000, -0.750000, -0.750000},
+                        {0.750000, 0.750000, -0.750000},
+                        {-0.750000, 0.750000, -0.750000},
+                        {-0.750000, -0.750000, -0.750000},
+                }
+        },
+
+/* 4: objicosa - structure values for icosahedron */
+
+        {
+                "icosahedron", "icosa",         /* long and short names */
+                12,                            /* number of vertices */
+               0.4,
+                {                              /* vertices (x,y,z) */
+                        /* all points must be within radius 2 of the origin */
+                        {0.00000000, 0.00000000, -0.95105650},
+                        {0.00000000, 0.85065080, -0.42532537},
+                        {0.80901698, 0.26286556, -0.42532537},
+                        {0.50000000, -0.68819095, -0.42532537},
+                        {-0.50000000, -0.68819095, -0.42532537},
+                        {-0.80901698, 0.26286556, -0.42532537},
+                        {0.50000000, 0.68819095, 0.42532537},
+                        {0.80901698, -0.26286556, 0.42532537},
+                        {0.00000000, -0.85065080, 0.42532537},
+                        {-0.80901698, -0.26286556, 0.42532537},
+                        {-0.50000000, 0.68819095, 0.42532537},
+                        {0.00000000, 0.00000000, 0.95105650}
+                }
+        },
+
+/* 5: objplane - structure values for plane */
+
+        {
+                "plane", "plane",       /* long and short names */
+                4,                     /* number of vertices */
+               0.7,
+                {                      /* vertices (x,y,z) */
+                        /* all points must be within radius 2 of the origin */
+#define T 1.1
+                        {T, 0, 0},
+                        {-T, 0, 0},
+                        {0, T, 0},
+                        {0, -T, 0},
+#undef T
+                }
+        },
+
+/* 6: objpyr - structure values for pyramid */
+
+        {
+                "pyramid", "pyramid",   /* long and short names */
+                5,                     /* number of vertices */ 
+               0.5,
+                {                      /* vertices (x,y,z) */
+                        /* all points must be within radius 1 of the origin */
+#define T 1.0
+                        {T, 0, 0},
+                        {-T, 0, 0},
+                        {0, T, 0},
+                        {0, -T, 0},
+                        {0, 0, T},
+#undef T
+                }
+        },
+
+/* 7: objstar - structure values for octahedron star (stellated octahedron?) */
+        {
+                "star", "star", /* long and short names */
+                8,             /* number of vertices */
+               0.7,
+                {               /* vertices (x,y,z) */
+                        /* all points must be within radius 1 of the origin */
+#define T 0.9
+                        {T, T, T},
+                        {T, -T, -T},
+                        {-T, T, -T},
+                        {-T, -T, T},
+                        {-T, -T, -T},
+                        {-T, T, T},
+                        {T, -T, T},
+                        {T, T, -T},
+#undef T
+                }
+        },
+
+};
+
+
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Misc funcs.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+static void clamp(vec3_t v)
+{
+    int i;
+
+    for (i = 0; i < 3; i ++)
+        if (v[i] > 360 || v[i] < -360)
+            v[i] = 0;
+}
+
+/* track the mouse in a joystick manner : not perfect but it works */
+static void trackmouse(ModeInfo * mi)
+{
+    sballsstruct *sb = &sballs[MI_SCREEN(mi)];
+    /* we keep static values (not per screen) for the mouse stuff: in general you have only one mouse :-> */
+    static int max[2] = { 0, 0 };
+    static int min[2] = { 0x7fffffff, 0x7fffffff }, center[2];
+    Window r, c;
+    int rx, ry, cx, cy;
+    unsigned int m;
+
+    (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
+                        &r, &c, &rx, &ry, &cx, &cy, &m);
+
+    if (max[0] < cx)
+       max[0] = cx;
+    if (min[0] > cx)
+       min[0] = cx;
+    center[0] = (max[0] + min[0]) / 2;
+
+    if (max[1] < cy)
+       max[1] = cy;
+    if (min[1] > cy)
+       min[1] = cy;
+    center[1] = (max[1] + min[1]) / 2;
+
+    if (fabs(center[0] - (float) cx) > 0.1 * (max[0] - min[0]))
+       sb->rot[0] -= ((center[0] - (float) cx) / (max[0] - min[0]) * 180.0f) / 200.0f;
+    if (fabs(center[1] - (float) cy) > 0.1 * (max[1] - min[1]))
+        sb->rot[1] -= ((center[1] - (float) cy) / (max[1] - min[1]) * 180.0f) / 200.0f;;
+    clamp(sb->rot);
+
+    /* oops: can't get those buttons */
+    if (m & Button4Mask)
+        sb->speed++;
+    if (m & Button5Mask)
+        sb->speed--;
+
+}
+
+/* initialise textures */
+static void inittextures(ModeInfo * mi)
+{
+    sballsstruct *sb = &sballs[MI_SCREEN(mi)];
+    if (do_texture) {
+
+       glGenTextures(1, &sb->backid);
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, sb->backid);
+#endif /* HAVE_GLBINDTEXTURE */
+
+        sb->btexture = xpm_to_ximage(MI_DISPLAY(mi),
+                                     MI_VISUAL(mi),
+                                     MI_COLORMAP(mi),
+                                     back_data);
+       if (!(sb->btexture)) {
+           (void) fprintf(stderr, "Error reading the background texture.\n");
+            glDeleteTextures(1, &sb->backid);
+            do_texture = False;
+            sb->faceid = 0;       /* default textures */
+            sb->backid = 0;
+           return;
+       }
+
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                    sb->btexture->width, sb->btexture->height, 0,
+                    GL_RGBA, GL_UNSIGNED_BYTE, sb->btexture->data);
+
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+       glGenTextures(1, &sb->faceid);
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, sb->faceid);
+#endif /* HAVE_GLBINDTEXTURE */
+
+        sb->ftexture = xpm_to_ximage(MI_DISPLAY(mi),
+                                     MI_VISUAL(mi),
+                                     MI_COLORMAP(mi),
+                                     face_data);
+       if (!(sb->ftexture)) {
+           (void) fprintf(stderr, "Error reading the face texture.\n");
+            glDeleteTextures(1, &sb->faceid);
+           sb->faceid = 0;
+           return;
+       }
+
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+                    sb->ftexture->width, sb->ftexture->height, 0,
+                    GL_RGBA, GL_UNSIGNED_BYTE, sb->ftexture->data);
+
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+    }
+    else
+    {
+        sb->faceid = 0;       /* default textures */
+        sb->backid = 0;
+    }
+
+}
+
+static void drawSphere(ModeInfo * mi,int sphere_num)
+{
+  sballsstruct *sb = &sballs[MI_SCREEN(mi)];
+  float x = polygons[object].v[sphere_num][0];
+  float y = polygons[object].v[sphere_num][1];
+  float z = polygons[object].v[sphere_num][2];
+  int numMajor = 10;
+  int numMinor = 10;
+  float radius = sb->radius[sphere_num];
+  double majorStep = (M_PI / numMajor);
+  double minorStep = (2.0 * M_PI / numMinor);
+  int i, j;
+
+  glPushMatrix();
+  glTranslatef(x, y, z);
+
+  glColor4f(1, 1, 1, 1);
+  for (i = 0; i < numMajor; ++i)
+  {
+    double a = i * majorStep;
+    double b = a + majorStep;
+    double r0 = radius * sin(a);
+    double r1 = radius * sin(b);
+    GLfloat z0 = radius * cos(a);
+    GLfloat z1 = radius * cos(b);
+
+    glBegin(MI_IS_WIREFRAME(mi) ? GL_LINE_STRIP: GL_TRIANGLE_STRIP);
+    for (j = 0; j <= numMinor; ++j)
+        {
+      double c = j * minorStep;
+      GLfloat x = cos(c);
+      GLfloat y = sin(c);
+
+      glNormal3f((x * r0) / radius, (y * r0) / radius, z0 / radius);
+      glTexCoord2f(j / (GLfloat) numMinor, i / (GLfloat) numMajor);
+      glVertex3f(x * r0, y * r0, z0);
+
+      glNormal3f((x * r1) / radius, (y * r1) / radius, z1 / radius);
+      glTexCoord2f(j / (GLfloat) numMinor, (i + 1) / (GLfloat) numMajor);
+      glVertex3f(x * r1, y * r1, z1);
+    }
+    glEnd();
+  }
+
+  glPopMatrix();
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    GL funcs.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+static void Reshape(ModeInfo * mi)
+{
+
+    sballsstruct *sb = &sballs[MI_SCREEN(mi)];
+    int size = MI_SIZE(mi);
+
+    /* Viewport is specified size if size >= MINSIZE && size < screensize */
+    if (size <= 1) {
+        sb->WIDTH = MI_WIDTH(mi);
+        sb->HEIGHT = MI_HEIGHT(mi);
+    } else if (size < MINSIZE) {
+        sb->WIDTH = MINSIZE;
+        sb->HEIGHT = MINSIZE;
+    } else {
+        sb->WIDTH = (size > MI_WIDTH(mi)) ? MI_WIDTH(mi) : size;
+        sb->HEIGHT = (size > MI_HEIGHT(mi)) ? MI_HEIGHT(mi) : size;
+    }
+    glViewport((MI_WIDTH(mi) - sb->WIDTH) / 2, (MI_HEIGHT(mi) - sb->HEIGHT) / 2, sb->WIDTH, sb->HEIGHT);
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    gluPerspective(55.0, (float)sb->WIDTH / (float) sb->HEIGHT, 1.0, 300.0);
+
+    glMatrixMode(GL_MODELVIEW);
+
+}
+
+static void Draw(ModeInfo * mi)
+{
+    sballsstruct *sb = &sballs[MI_SCREEN(mi)];
+    int sphere;
+
+    if (do_trackmouse && !MI_IS_ICONIC(mi))
+       trackmouse(mi);
+
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+    glPushMatrix();
+    glEnable(GL_DEPTH_TEST);
+
+    /* move eyes */
+    glTranslatef (-sb->eye[0], -sb->eye[1], -sb->eye[2]);
+
+    /* draw background */
+    if (do_texture)
+    {
+       glEnable(GL_LIGHTING);
+       glEnable(GL_TEXTURE_2D);
+       glColor3f(1, 1, 1);
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, sb->backid);
+#endif /* HAVE_GLBINDTEXTURE */
+    }
+    else
+    {
+       glColor3f(0, 0, 0);
+    }
+    glBegin(GL_QUAD_STRIP);
+    glNormal3f(0, 0, 1); glTexCoord2f(0,0); glVertex3f(8, 4.1, -4);
+    glNormal3f(0, 0, 1); glTexCoord2f(0,1); glVertex3f(8, -4.1, -4);
+    glNormal3f(0, 0, 1); glTexCoord2f(1,0); glVertex3f(-8, 4.1, -4);
+    glNormal3f(0, 0, 1); glTexCoord2f(1,1); glVertex3f(-8, -4.1, -4);
+    glEnd();
+
+    /* rotate the mouse */
+    glRotatef(sb->rot[0], 1.0f, 0.0f, 0.0f);
+    glRotatef(sb->rot[1], 0.0f, 1.0f, 0.0f);
+    glRotatef(sb->rot[2], 0.0f, 0.0f, 1.0f);
+
+    /* rotate the balls */
+    glRotatef(sb->rotm[0], 1.0f, 0.0f, 0.0f);
+    glRotatef(sb->rotm[1], 0.0f, 1.0f, 0.0f);
+    glRotatef(sb->rotm[2], 0.0f, 0.0f, 1.0f);
+
+    sb->rotm[0] += sb->speed;
+    sb->rotm[1] += -(sb->speed);
+    sb->rotm[2] += 0;
+
+    /* draw the balls */
+    if (do_texture)
+#ifdef HAVE_GLBINDTEXTURE
+       glBindTexture(GL_TEXTURE_2D, sb->faceid);
+#endif /* HAVE_GLBINDTEXTURE */
+    else
+       glEnable(GL_LIGHTING);
+    for (sphere=0;sphere<spheres;sphere++)
+    {
+        drawSphere(mi,sphere);
+    }
+
+    glDisable(GL_TEXTURE_2D);
+    glDisable(GL_DEPTH_TEST);
+    glDisable(GL_LIGHTING);
+
+    /* manage framerate display */
+    if (MI_IS_FPS(mi)) do_fps (mi);
+    glPopMatrix();
+}
+
+
+static void Init(ModeInfo * mi)
+{
+    sballsstruct *sb = &sballs[MI_SCREEN(mi)];
+    int i;
+
+    /* Default settings */
+    if (MI_IS_WIREFRAME(mi))
+       do_texture = False;
+    if (do_texture)
+       inittextures(mi);
+    else
+    {
+       sb->btexture = (XImage*) NULL;
+       sb->ftexture = (XImage*) NULL;
+    }
+
+    vinit(sb->eye   ,0.0f, 0.0f, 6.0f);
+    vinit(sb->rot   ,0.0f, 0.0f, 0.0f);
+    vinit(sb->rotm  ,0.0f, 0.0f, 0.0f);
+    sb->speed = MI_CYCLES(mi);
+
+    /* initialise object number */
+    if (object == 0)
+       object = NRAND(MAX_OBJ);
+    if ((object == 0) || (object > MAX_OBJ))
+       object = DEF_OBJECT_INDX;
+    object--;
+
+    /* initialise sphere number */
+    spheres = MI_COUNT(mi);
+    if (MI_COUNT(mi) > polygons[object].numverts)
+       spheres = polygons[object].numverts;
+    if (MI_COUNT(mi) < 1)
+       spheres = polygons[object].numverts;
+    /* initialise sphere radius */
+    for(i=0; i < spheres;i++)
+    {
+#if RANDOM_RADIUS
+       sb->radius[i] = ((float) LRAND() / (float) MAXRAND);
+       if (sb->radius[i] < 0.3)
+           sb->radius[i] = 0.3;
+       if (sb->radius[i] > 0.7)
+           sb->radius[i] = 0.7;
+#else
+       sb->radius[i] = polygons[object].radius;
+#endif
+    }
+
+    if (MI_IS_DEBUG(mi)) {
+       (void) fprintf(stderr,
+                      "%s:\n\tobject=%s\n\tspheres=%d\n\tspeed=%d\n\ttexture=%s\n",
+                      MI_NAME(mi),
+                      polygons[object].shortname,
+                      spheres,
+                      MI_CYCLES(mi),
+                      do_texture ? "on" : "off"
+                       );
+    }
+
+        glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
+        glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);
+        glLightfv(GL_LIGHT1, GL_POSITION,LightPosition);
+        glEnable(GL_LIGHT1);
+
+        glClearColor(0, 0, 0, 0);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Xlock hooks.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Initialize sballs.  Called each time the window changes.
+ *-----------------------------------------------------------------------------
+ */
+
+void init_sballs(ModeInfo * mi)
+{
+    sballsstruct *sb;
+
+    if (sballs == NULL) {
+       if ((sballs = (sballsstruct *) calloc(MI_NUM_SCREENS(mi),
+                                         sizeof(sballsstruct))) == NULL)
+           return;
+    }
+    sb = &sballs[MI_SCREEN(mi)];
+
+    if ((sb->glx_context = init_GL(mi)) != NULL) {
+
+       Reshape(mi);
+       glDrawBuffer(GL_BACK);
+       Init(mi);
+
+    } else {
+       MI_CLEARWINDOW(mi);
+    }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Called by the mainline code periodically to update the display.
+ *-----------------------------------------------------------------------------
+ */
+void draw_sballs(ModeInfo * mi)
+{
+    Display *display = MI_DISPLAY(mi);
+    Window window = MI_WINDOW(mi);
+    sballsstruct *sb;
+
+    if (sballs == NULL)
+           return;
+    sb = &sballs[MI_SCREEN(mi)];
+
+    MI_IS_DRAWN(mi) = True;
+    if (!sb->glx_context)
+       return;
+
+    glXMakeCurrent(display, window, *(sb->glx_context));
+    Draw(mi);
+    Reshape(mi);
+
+    glFinish();
+    glXSwapBuffers(display, window);
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ *    The display is being taken away from us.  Free up malloc'ed
+ *      memory and X resources that we've alloc'ed.  Only called
+ *      once, we must zap everything for every screen.
+ *-----------------------------------------------------------------------------
+ */
+
+void release_sballs(ModeInfo * mi)
+{
+    int screen;
+
+    if (sballs != NULL) {
+       for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+           sballsstruct *sb = &sballs[screen];
+            if (mode_font != None)
+           {
+               unsigned int first, last;
+               first = mode_font->min_char_or_byte2;
+               last  = mode_font->max_char_or_byte2;
+               glDeleteLists(sb->fontbase,last - first + 1);
+           }
+           if (sb->btexture)
+           {
+               glDeleteTextures(1,&sb->backid);
+               XDestroyImage(sb->btexture);
+           }
+           if (sb->ftexture)
+           {
+               glDeleteTextures(1,&sb->faceid);
+               XDestroyImage(sb->ftexture);
+           }
+       }
+       (void) free((void *) sballs);
+       sballs = (sballsstruct *) NULL;
+    }
+    if (mode_font != None)
+    {
+       /* only free-ed when there is no more screens used */
+       XFreeFont(MI_DISPLAY(mi), mode_font);
+       mode_font = None;
+    }
+    FreeAllGL(mi);
+}
+
+void change_sballs(ModeInfo * mi)
+{
+    sballsstruct *sb;
+
+    if (sballs == NULL)
+           return;
+    sb = &sballs[MI_SCREEN(mi)];
+
+    if (!sb->glx_context)
+       return;
+
+    /* initialise object number */
+    if (object == 0)
+       object = NRAND(MAX_OBJ);
+    if ((object == 0) || (object > MAX_OBJ))
+       object = DEF_OBJECT_INDX;
+    object--;
+
+    /* correct sphere number */
+    spheres = MI_COUNT(mi);
+    if (MI_COUNT(mi) > polygons[object].numverts)
+       spheres = polygons[object].numverts;
+    if (MI_COUNT(mi) < 1)
+       spheres = polygons[object].numverts;
+
+    if (MI_IS_DEBUG(mi)) {
+       (void) fprintf(stderr,
+                      "%s:\n\tobject=%s\n\tspheres=%d\n\tspeed=%d\n\ttexture=%s\n",
+                      MI_NAME(mi),
+                      polygons[object].shortname,
+                      spheres,
+                      MI_CYCLES(mi),
+                      do_texture ? "on" : "off"
+                       );
+    }
+    glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sb->glx_context));
+
+}
+#endif /* MODE_sballs */
diff --git a/modes/glx/shark.c b/modes/glx/shark.c
new file mode 100644 (file)
index 0000000..5e84d7b
--- /dev/null
@@ -0,0 +1,1404 @@
+/* atlantis --- Shows moving 3D sea animals */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)shark.c      5.01 2001/04/17 xlockmore";
+
+#endif
+
+/* Copyright (c) E. Lassauge, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by Mark J. Kilgard
+ * as a demo for openGL programming.
+ *
+ * Porting it to xlock  was possible by comparing the original Mesa's morph3d
+ * demo with it's ported version to xlock, so thanks for Marcelo F. Vianna
+ * (look at morph3d.c) for his indirect help.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * My e-mail address is lassauge@mail.dotcom.fr
+ *
+ * Eric Lassauge  (May-13-1998)
+ *
+ */
+
+/**
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_atlantis
+
+#ifdef STANDALONE
+#include <math.h>
+#include <GL/glx.h>
+#endif
+
+#include "atlantis.h"
+/* *INDENT-OFF* */
+#if 0
+static float N001[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N002[3] = {0.000077 ,-0.020611 ,0.999788};
+static float N003[3] = {0.961425 ,0.258729 ,-0.093390};
+static float N004[3] = {0.510811 ,-0.769633 ,-0.383063};
+static float N005[3] = {0.400123 ,0.855734 ,-0.328055};
+static float N006[3] = {-0.770715 ,0.610204 ,-0.183440};
+static float N007[3] = {-0.915597 ,-0.373345 ,-0.149316};
+static float N008[3] = {-0.972788 ,0.208921 ,-0.100179};
+static float N009[3] = {-0.939713 ,-0.312268 ,-0.139383};
+static float N010[3] = {-0.624138 ,-0.741047 ,-0.247589};
+static float N011[3] = {0.591434 ,-0.768401 ,-0.244471};
+static float N012[3] = {0.935152 ,-0.328495 ,-0.132598};
+static float N013[3] = {0.997102 ,0.074243 ,-0.016593};
+static float N014[3] = {0.969995 ,0.241712 ,-0.026186};
+static float N015[3] = {0.844539 ,0.502628 ,-0.184714};
+static float N016[3] = {-0.906608 ,0.386308 ,-0.169787};
+static float N017[3] = {-0.970016 ,0.241698 ,-0.025516};
+static float N018[3] = {-0.998652 ,0.050493 ,-0.012045};
+static float N019[3] = {-0.942685 ,-0.333051 ,-0.020556};
+static float N020[3] = {-0.660944 ,-0.750276 ,0.015480};
+static float N021[3] = {0.503549 ,-0.862908 ,-0.042749};
+static float N022[3] = {0.953202 ,-0.302092 ,-0.012089};
+static float N023[3] = {0.998738 ,0.023574 ,0.044344};
+static float N024[3] = {0.979297 ,0.193272 ,0.060202};
+static float N025[3] = {0.798300 ,0.464885 ,0.382883};
+static float N026[3] = {-0.756590 ,0.452403 ,0.472126};
+static float N027[3] = {-0.953855 ,0.293003 ,0.065651};
+static float N028[3] = {-0.998033 ,0.040292 ,0.048028};
+static float N029[3] = {-0.977079 ,-0.204288 ,0.059858};
+static float N030[3] = {-0.729117 ,-0.675304 ,0.111140};
+static float N031[3] = {0.598361 ,-0.792753 ,0.116221};
+static float N032[3] = {0.965192 ,-0.252991 ,0.066332};
+static float N033[3] = {0.998201 ,-0.002790 ,0.059892};
+static float N034[3] = {0.978657 ,0.193135 ,0.070207};
+static float N035[3] = {0.718815 ,0.680392 ,0.142733};
+static float N036[3] = {-0.383096 ,0.906212 ,0.178936};
+static float N037[3] = {-0.952831 ,0.292590 ,0.080647};
+static float N038[3] = {-0.997680 ,0.032417 ,0.059861};
+static float N039[3] = {-0.982629 ,-0.169881 ,0.074700};
+static float N040[3] = {-0.695424 ,-0.703466 ,0.146700};
+static float N041[3] = {0.359323 ,-0.915531 ,0.180805};
+static float N042[3] = {0.943356 ,-0.319387 ,0.089842};
+static float N043[3] = {0.998272 ,-0.032435 ,0.048993};
+static float N044[3] = {0.978997 ,0.193205 ,0.065084};
+static float N045[3] = {0.872144 ,0.470094 ,-0.135565};
+static float N046[3] = {-0.664282 ,0.737945 ,-0.119027};
+static float N047[3] = {-0.954508 ,0.288570 ,0.075107};
+static float N048[3] = {-0.998273 ,0.032406 ,0.048993};
+static float N049[3] = {-0.979908 ,-0.193579 ,0.048038};
+static float N050[3] = {-0.858736 ,-0.507202 ,-0.072938};
+static float N051[3] = {0.643545 ,-0.763887 ,-0.048237};
+static float N052[3] = {0.955580 ,-0.288954 ,0.058068};
+#if 0
+static float N053[3] = {0.000000 ,1.000000 ,0.000000};
+static float N054[3] = {0.000000 ,1.000000 ,0.000000};
+static float N055[3] = {0.000000 ,1.000000 ,0.000000};
+static float N056[3] = {0.000000 ,1.000000 ,0.000000};
+static float N057[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N058[3] = {0.000050 ,0.793007 ,-0.609213};
+static float N059[3] = {0.913510 ,0.235418 ,-0.331779};
+static float N060[3] = {-0.807970 ,0.495000 ,-0.319625};
+static float N061[3] = {0.000000 ,0.784687 ,-0.619892};
+static float N062[3] = {0.000000 ,-1.000000 ,0.000000};
+static float N063[3] = {0.000000 ,1.000000 ,0.000000};
+static float N064[3] = {0.000000 ,1.000000 ,0.000000};
+static float N065[3] = {0.000000 ,1.000000 ,0.000000};
+static float N066[3] = {-0.055784 ,0.257059 ,0.964784};
+#if 0
+static float N067[3] = {0.000000 ,1.000000 ,0.000000};
+static float N068[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N069[3] = {-0.000505 ,-0.929775 ,-0.368127};
+static float N070[3] = {0.000000 ,1.000000 ,0.000000};
+#if 0
+static float N071[3] = {-0.987102 ,0.131723 ,-0.090984};
+static float N072[3] = {-0.987102 ,0.131723 ,-0.090984};
+static float N073[3] = {-0.987102 ,0.131723 ,-0.090984};
+static float N074[3] = {0.000000 ,1.000000 ,0.000000};
+static float N075[3] = {0.000000 ,1.000000 ,0.000000};
+static float N076[3] = {0.000000 ,1.000000 ,0.000000};
+static float N077[3] = {0.995210 ,0.071962 ,-0.066168};
+static float N078[3] = {0.995210 ,0.071962 ,-0.066168};
+static float N079[3] = {0.995210 ,0.071962 ,-0.066168};
+static float N080[3] = {0.000000 ,1.000000 ,0.000000};
+static float N081[3] = {0.000000 ,1.000000 ,0.000000};
+static float N082[3] = {0.000000 ,1.000000 ,0.000000};
+static float P001[3] = {0.00, 0.00, 0.00};
+#endif
+static float P002[3] = {0.00, -36.59, 5687.72};
+static float P003[3] = {90.00, 114.73, 724.38};
+static float P004[3] = {58.24, -146.84, 262.35};
+static float P005[3] = {27.81, 231.52, 510.43};
+static float P006[3] = {-27.81, 230.43, 509.76};
+static float P007[3] = {-46.09, -146.83, 265.84};
+static float P008[3] = {-90.00, 103.84, 718.53};
+static float P009[3] = {-131.10, -165.92, 834.85};
+static float P010[3] = {-27.81, -285.31, 500.00};
+static float P011[3] = {27.81, -285.32, 500.00};
+static float P012[3] = {147.96, -170.89, 845.50};
+static float P013[3] = {180.00, 0.00, 2000.00};
+static float P014[3] = {145.62, 352.67, 2000.00};
+static float P015[3] = {55.62, 570.63, 2000.00};
+static float P016[3] = {-55.62, 570.64, 2000.00};
+static float P017[3] = {-145.62, 352.68, 2000.00};
+static float P018[3] = {-180.00, 0.01, 2000.00};
+static float P019[3] = {-178.20, -352.66, 2001.61};
+static float P020[3] = {-55.63, -570.63, 2000.00};
+static float P021[3] = {55.62, -570.64, 2000.00};
+static float P022[3] = {179.91, -352.69, 1998.39};
+static float P023[3] = {150.00, 0.00, 3000.00};
+static float P024[3] = {121.35, 293.89, 3000.00};
+static float P025[3] = {46.35, 502.93, 2883.09};
+static float P026[3] = {-46.35, 497.45, 2877.24};
+static float P027[3] = {-121.35, 293.90, 3000.00};
+static float P028[3] = {-150.00, 0.00, 3000.00};
+static float P029[3] = {-152.21, -304.84, 2858.68};
+static float P030[3] = {-46.36, -475.52, 3000.00};
+static float P031[3] = {46.35, -475.53, 3000.00};
+static float P032[3] = {155.64, -304.87, 2863.50};
+static float P033[3] = {90.00, 0.00, 4000.00};
+static float P034[3] = {72.81, 176.33, 4000.00};
+static float P035[3] = {27.81, 285.32, 4000.00};
+static float P036[3] = {-27.81, 285.32, 4000.00};
+static float P037[3] = {-72.81, 176.34, 4000.00};
+static float P038[3] = {-90.00, 0.00, 4000.00};
+static float P039[3] = {-72.81, -176.33, 4000.00};
+static float P040[3] = {-27.81, -285.31, 4000.00};
+static float P041[3] = {27.81, -285.32, 4000.00};
+static float P042[3] = {72.81, -176.34, 4000.00};
+static float P043[3] = {30.00, 0.00, 5000.00};
+static float P044[3] = {24.27, 58.78, 5000.00};
+static float P045[3] = {9.27, 95.11, 5000.00};
+static float P046[3] = {-9.27, 95.11, 5000.00};
+static float P047[3] = {-24.27, 58.78, 5000.00};
+static float P048[3] = {-30.00, 0.00, 5000.00};
+static float P049[3] = {-24.27, -58.78, 5000.00};
+static float P050[3] = {-9.27, -95.10, 5000.00};
+static float P051[3] = {9.27, -95.11, 5000.00};
+static float P052[3] = {24.27, -58.78, 5000.00};
+#if 0
+static float P053[3] = {0.00, 0.00, 0.00};
+static float P054[3] = {0.00, 0.00, 0.00};
+static float P055[3] = {0.00, 0.00, 0.00};
+static float P056[3] = {0.00, 0.00, 0.00};
+static float P057[3] = {0.00, 0.00, 0.00};
+#endif
+static float P058[3] = {0.00, 1212.72, 2703.08};
+static float P059[3] = {50.36, 0.00, 108.14};
+static float P060[3] = {-22.18, 0.00, 108.14};
+static float P061[3] = {0.00, 1181.61, 6344.65};
+static float P062[3] = {516.45, -887.08, 2535.45};
+static float P063[3] = {-545.69, -879.31, 2555.63};
+static float P064[3] = {618.89, -1005.64, 2988.32};
+static float P065[3] = {-635.37, -1014.79, 2938.68};
+static float P066[3] = {0.00, 1374.43, 3064.18};
+#if 0
+static float P067[3] = {158.49, -11.89, 1401.56};
+static float P068[3] = {-132.08, -17.90, 1394.31};
+#endif
+static float P069[3] = {0.00, -418.25, 5765.04};
+static float P070[3] = {0.00, 1266.91, 6629.60};
+static float P071[3] = {-139.12, -124.96, 997.98};
+static float P072[3] = {-139.24, -110.18, 1020.68};
+static float P073[3] = {-137.33, -94.52, 1022.63};
+static float P074[3] = {-137.03, -79.91, 996.89};
+static float P075[3] = {-135.21, -91.48, 969.14};
+static float P076[3] = {-135.39, -110.87, 968.76};
+static float P077[3] = {150.23, -78.44, 995.53};
+static float P078[3] = {152.79, -92.76, 1018.46};
+static float P079[3] = {154.19, -110.20, 1020.55};
+static float P080[3] = {151.33, -124.15, 993.77};
+static float P081[3] = {150.49, -111.19, 969.86};
+static float P082[3] = {150.79, -92.41, 969.70};
+static float iP002[3] = {0.00, -36.59, 5687.72};
+static float iP004[3] = {58.24, -146.84, 262.35};
+static float iP007[3] = {-46.09, -146.83, 265.84};
+static float iP010[3] = {-27.81, -285.31, 500.00};
+static float iP011[3] = {27.81, -285.32, 500.00};
+static float iP023[3] = {150.00, 0.00, 3000.00};
+static float iP024[3] = {121.35, 293.89, 3000.00};
+static float iP025[3] = {46.35, 502.93, 2883.09};
+static float iP026[3] = {-46.35, 497.45, 2877.24};
+static float iP027[3] = {-121.35, 293.90, 3000.00};
+static float iP028[3] = {-150.00, 0.00, 3000.00};
+static float iP029[3] = {-121.35, -304.84, 2853.86};
+static float iP030[3] = {-46.36, -475.52, 3000.00};
+static float iP031[3] = {46.35, -475.53, 3000.00};
+static float iP032[3] = {121.35, -304.87, 2853.86};
+static float iP033[3] = {90.00, 0.00, 4000.00};
+static float iP034[3] = {72.81, 176.33, 4000.00};
+static float iP035[3] = {27.81, 285.32, 4000.00};
+static float iP036[3] = {-27.81, 285.32, 4000.00};
+static float iP037[3] = {-72.81, 176.34, 4000.00};
+static float iP038[3] = {-90.00, 0.00, 4000.00};
+static float iP039[3] = {-72.81, -176.33, 4000.00};
+static float iP040[3] = {-27.81, -285.31, 4000.00};
+static float iP041[3] = {27.81, -285.32, 4000.00};
+static float iP042[3] = {72.81, -176.34, 4000.00};
+static float iP043[3] = {30.00, 0.00, 5000.00};
+static float iP044[3] = {24.27, 58.78, 5000.00};
+static float iP045[3] = {9.27, 95.11, 5000.00};
+static float iP046[3] = {-9.27, 95.11, 5000.00};
+static float iP047[3] = {-24.27, 58.78, 5000.00};
+static float iP048[3] = {-30.00, 0.00, 5000.00};
+static float iP049[3] = {-24.27, -58.78, 5000.00};
+static float iP050[3] = {-9.27, -95.10, 5000.00};
+static float iP051[3] = {9.27, -95.11, 5000.00};
+static float iP052[3] = {24.27, -58.78, 5000.00};
+#if 0
+static float iP053[3] = {0.00, 0.00, 0.00};
+#endif
+static float iP061[3] = {0.00, 1181.61, 6344.65};
+static float iP069[3] = {0.00, -418.25, 5765.04};
+static float iP070[3] = {0.00, 1266.91, 6629.60};
+/* *INDENT-ON* */
+
+
+
+static void
+Fish001(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N007);
+       glVertex3fv(P007);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N004);
+       glVertex3fv(P004);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glNormal3fv(N007);
+       glVertex3fv(P007);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N004);
+       glVertex3fv(P004);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P071);
+       glVertex3fv(P072);
+       glVertex3fv(P073);
+       glVertex3fv(P074);
+       glVertex3fv(P075);
+       glVertex3fv(P076);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P077);
+       glVertex3fv(P078);
+       glVertex3fv(P079);
+       glVertex3fv(P080);
+       glVertex3fv(P081);
+       glVertex3fv(P082);
+       glEnd();
+}
+
+static void
+Fish002(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+}
+
+static void
+Fish003(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glEnd();
+}
+
+static void
+Fish004(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glNormal3fv(N061);
+       glVertex3fv(P061);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N061);
+       glVertex3fv(P061);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N061);
+       glVertex3fv(P061);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N061);
+       glVertex3fv(P061);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glNormal3fv(N061);
+       glVertex3fv(P061);
+       glEnd();
+}
+
+static void
+Fish005(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+}
+
+static void
+Fish006(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glEnd();
+}
+
+static void
+Fish007(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N064);
+       glVertex3fv(P064);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+}
+
+static void
+Fish008(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+}
+
+static void
+Fish009(GLenum cap)
+{
+       glBegin(cap);
+       glVertex3fv(P059);
+       glVertex3fv(P012);
+       glVertex3fv(P009);
+       glVertex3fv(P060);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P012);
+       glVertex3fv(P004);
+       glVertex3fv(P007);
+       glVertex3fv(P009);
+       glEnd();
+}
+
+static void
+Fish_1(GLenum cap)
+{
+       Fish004(cap);
+       Fish005(cap);
+       Fish003(cap);
+       Fish007(cap);
+       Fish006(cap);
+       Fish002(cap);
+       Fish008(cap);
+       Fish009(cap);
+       Fish001(cap);
+}
+
+static void
+Fish_2(GLenum cap)
+{
+       Fish005(cap);
+       Fish004(cap);
+       Fish003(cap);
+       Fish008(cap);
+       Fish006(cap);
+       Fish002(cap);
+       Fish007(cap);
+       Fish009(cap);
+       Fish001(cap);
+}
+
+static void
+Fish_3(GLenum cap)
+{
+       Fish005(cap);
+       Fish004(cap);
+       Fish007(cap);
+       Fish003(cap);
+       Fish002(cap);
+       Fish008(cap);
+       Fish009(cap);
+       Fish001(cap);
+       Fish006(cap);
+}
+
+static void
+Fish_4(GLenum cap)
+{
+       Fish005(cap);
+       Fish004(cap);
+       Fish008(cap);
+       Fish003(cap);
+       Fish002(cap);
+       Fish007(cap);
+       Fish009(cap);
+       Fish001(cap);
+       Fish006(cap);
+}
+
+static void
+Fish_5(GLenum cap)
+{
+       Fish009(cap);
+       Fish006(cap);
+       Fish007(cap);
+       Fish001(cap);
+       Fish002(cap);
+       Fish003(cap);
+       Fish008(cap);
+       Fish004(cap);
+       Fish005(cap);
+}
+
+static void
+Fish_6(GLenum cap)
+{
+       Fish009(cap);
+       Fish006(cap);
+       Fish008(cap);
+       Fish001(cap);
+       Fish002(cap);
+       Fish007(cap);
+       Fish003(cap);
+       Fish004(cap);
+       Fish005(cap);
+}
+
+static void
+Fish_7(GLenum cap)
+{
+       Fish009(cap);
+       Fish001(cap);
+       Fish007(cap);
+       Fish005(cap);
+       Fish002(cap);
+       Fish008(cap);
+       Fish003(cap);
+       Fish004(cap);
+       Fish006(cap);
+}
+
+static void
+Fish_8(GLenum cap)
+{
+       Fish009(cap);
+       Fish008(cap);
+       Fish001(cap);
+       Fish002(cap);
+       Fish007(cap);
+       Fish003(cap);
+       Fish005(cap);
+       Fish004(cap);
+       Fish006(cap);
+}
+
+void
+DrawShark(fishRec * fish, int wire)
+{
+       float       mat[4][4];
+       int         n;
+       float       seg1, seg2, seg3, seg4, segup;
+       float       thrash, chomp;
+       GLenum      cap;
+
+       fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360;
+
+       thrash = 50.0 * fish->v;
+
+       seg1 = 0.6 * thrash * sin(fish->htail * RRAD);
+       seg2 = 1.8 * thrash * sin((fish->htail + 45.0) * RRAD);
+       seg3 = 3.0 * thrash * sin((fish->htail + 90.0) * RRAD);
+       seg4 = 4.0 * thrash * sin((fish->htail + 110.0) * RRAD);
+
+       chomp = 0.0;
+       if (fish->v > 2.0) {
+               chomp = -(fish->v - 2.0) * 200.0;
+       }
+       P004[1] = iP004[1] + chomp;
+       P007[1] = iP007[1] + chomp;
+       P010[1] = iP010[1] + chomp;
+       P011[1] = iP011[1] + chomp;
+
+       P023[0] = iP023[0] + seg1;
+       P024[0] = iP024[0] + seg1;
+       P025[0] = iP025[0] + seg1;
+       P026[0] = iP026[0] + seg1;
+       P027[0] = iP027[0] + seg1;
+       P028[0] = iP028[0] + seg1;
+       P029[0] = iP029[0] + seg1;
+       P030[0] = iP030[0] + seg1;
+       P031[0] = iP031[0] + seg1;
+       P032[0] = iP032[0] + seg1;
+       P033[0] = iP033[0] + seg2;
+       P034[0] = iP034[0] + seg2;
+       P035[0] = iP035[0] + seg2;
+       P036[0] = iP036[0] + seg2;
+       P037[0] = iP037[0] + seg2;
+       P038[0] = iP038[0] + seg2;
+       P039[0] = iP039[0] + seg2;
+       P040[0] = iP040[0] + seg2;
+       P041[0] = iP041[0] + seg2;
+       P042[0] = iP042[0] + seg2;
+       P043[0] = iP043[0] + seg3;
+       P044[0] = iP044[0] + seg3;
+       P045[0] = iP045[0] + seg3;
+       P046[0] = iP046[0] + seg3;
+       P047[0] = iP047[0] + seg3;
+       P048[0] = iP048[0] + seg3;
+       P049[0] = iP049[0] + seg3;
+       P050[0] = iP050[0] + seg3;
+       P051[0] = iP051[0] + seg3;
+       P052[0] = iP052[0] + seg3;
+       P002[0] = iP002[0] + seg4;
+       P061[0] = iP061[0] + seg4;
+       P069[0] = iP069[0] + seg4;
+       P070[0] = iP070[0] + seg4;
+
+       fish->vtail += ((fish->dtheta - fish->vtail) * 0.1);
+
+       if (fish->vtail > 0.5) {
+               fish->vtail = 0.5;
+       } else if (fish->vtail < -0.5) {
+               fish->vtail = -0.5;
+       }
+       segup = thrash * fish->vtail;
+
+       P023[1] = iP023[1] + segup;
+       P024[1] = iP024[1] + segup;
+       P025[1] = iP025[1] + segup;
+       P026[1] = iP026[1] + segup;
+       P027[1] = iP027[1] + segup;
+       P028[1] = iP028[1] + segup;
+       P029[1] = iP029[1] + segup;
+       P030[1] = iP030[1] + segup;
+       P031[1] = iP031[1] + segup;
+       P032[1] = iP032[1] + segup;
+       P033[1] = iP033[1] + segup * 5.0;
+       P034[1] = iP034[1] + segup * 5.0;
+       P035[1] = iP035[1] + segup * 5.0;
+       P036[1] = iP036[1] + segup * 5.0;
+       P037[1] = iP037[1] + segup * 5.0;
+       P038[1] = iP038[1] + segup * 5.0;
+       P039[1] = iP039[1] + segup * 5.0;
+       P040[1] = iP040[1] + segup * 5.0;
+       P041[1] = iP041[1] + segup * 5.0;
+       P042[1] = iP042[1] + segup * 5.0;
+       P043[1] = iP043[1] + segup * 12.0;
+       P044[1] = iP044[1] + segup * 12.0;
+       P045[1] = iP045[1] + segup * 12.0;
+       P046[1] = iP046[1] + segup * 12.0;
+       P047[1] = iP047[1] + segup * 12.0;
+       P048[1] = iP048[1] + segup * 12.0;
+       P049[1] = iP049[1] + segup * 12.0;
+       P050[1] = iP050[1] + segup * 12.0;
+       P051[1] = iP051[1] + segup * 12.0;
+       P052[1] = iP052[1] + segup * 12.0;
+       P002[1] = iP002[1] + segup * 17.0;
+       P061[1] = iP061[1] + segup * 17.0;
+       P069[1] = iP069[1] + segup * 17.0;
+       P070[1] = iP070[1] + segup * 17.0;
+
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, -3000.0);
+
+       glGetFloatv(GL_MODELVIEW_MATRIX, &mat[0][0]);
+       n = 0;
+       if (mat[0][2] >= 0.0) {
+               n += 1;
+       }
+       if (mat[1][2] >= 0.0) {
+               n += 2;
+       }
+       if (mat[2][2] >= 0.0) {
+               n += 4;
+       }
+       glScalef(2.0, 1.0, 1.0);
+
+       glEnable(GL_CULL_FACE);
+       cap = wire ? GL_LINE_LOOP : GL_POLYGON;
+       switch (n) {
+               case 0:
+                       Fish_1(cap);
+                       break;
+               case 1:
+                       Fish_2(cap);
+                       break;
+               case 2:
+                       Fish_3(cap);
+                       break;
+               case 3:
+                       Fish_4(cap);
+                       break;
+               case 4:
+                       Fish_5(cap);
+                       break;
+               case 5:
+                       Fish_6(cap);
+                       break;
+               case 6:
+                       Fish_7(cap);
+                       break;
+               case 7:
+                       Fish_8(cap);
+                       break;
+       }
+       glDisable(GL_CULL_FACE);
+
+       glPopMatrix();
+}
+#endif
diff --git a/modes/glx/sierpinski3d.c b/modes/glx/sierpinski3d.c
new file mode 100644 (file)
index 0000000..36603fc
--- /dev/null
@@ -0,0 +1,671 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* Sierpinski3D --- 3D sierpinski gasket */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)sierpinski3D.c       00.01 99/11/04 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ * 06-Apr-2001  ported from Xscreensaver by Rolf Groppe <rolf@groppe.de>
+ *
+ * 1999: written by Tim Robinson <the_luggage@bigfoot.com>
+ *       a 3-D representation of the Sierpinski gasket fractal.
+ *
+ * 10-Dec-99  jwz   rewrote to draw a set of tetrahedrons instead of a
+ *                  random scattering of points.
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+# define PROGCLASS                                     "Sierpinski3D"
+# define HACK_INIT                                     init_gasket
+# define HACK_DRAW                                     draw_gasket
+# define HACK_RESHAPE                          refesh_gasket
+# define gasket_opts                           xlockmore_opts
+# define DEFAULTS                                      "*count:                1       \n"                     \
+                                                                       "*cycles:               9999    \n"                     \
+                                                                       "*delay:                20000   \n"                     \
+                                                                       "*maxDepth:             5       \n"                     \
+                                                                       "*speed:                150     \n"                     \
+                                                                       "*showFPS:      False   \n"                     \
+                                                                       "*wireframe:    False   \n"
+# include "xlockmore.h"                /* from the xscreensaver distribution */
+#else  /* !STANDALONE */
+# include "xlock.h"                    /* from the xlockmore distribution */
+#include "visgl.h"
+#include "color.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_sierpinski3d
+
+#undef countof
+#define countof(x) (sizeof((x))/sizeof((*x)))
+
+static int max_depth;
+static int speed;
+static int intensity;
+static float intens_factor;
+
+static XrmOptionDescRec opts[] = {
+  {(char *) "-maxdepth", (char *) ".sierpinski3d.maxdepth", XrmoptionSepArg, (caddr_t) 0 },
+  {(char *) "-speed", (char *) ".sierpinski3d.speed",    XrmoptionSepArg, (caddr_t) 0 },
+  {(char *) "-intensity",(char *) ".sierpinski3d.intensity", XrmoptionSepArg, (caddr_t) 0}
+};
+
+static argtype vars[] = {
+  {(caddr_t *) &max_depth, "maxdepth", "MaxDepth", "5", t_Int},
+  {(caddr_t *) &speed,     "speed",    "Speed",   "150", t_Int},
+  {(caddr_t *) &intensity, "intensity","Intensity","2185", t_Int}
+};
+
+static OptionStruct desc[] = {
+  {(char *) "-maxdepth", (char *) "maximum depth"},
+  {(char *) "-speed", (char *) "speed"},
+  {(char *) "-intensity", (char *) "intensity"}
+};
+
+ModeSpecOpt gasket_opts = {countof(opts), opts, countof(vars), vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   gasket_description =
+{"sierpinski3d", "init_gasket", "draw_gasket", "release_gasket",
+ "draw_gasket", "init_gasket", NULL, &gasket_opts,
+ 1000, 1, 2, 1, 64, 1.0, "",
+ "Shows GL's Sierpinski gasket", 0, NULL};
+
+#endif
+
+#define FLOATRAND(a) (((double)LRAND() / (double)MAXRAND) * a)
+
+typedef struct{
+  GLfloat x;
+  GLfloat y;
+  GLfloat z;
+} GL_VECTOR;
+
+typedef struct {
+  GLfloat rotx, roty, rotz;       /* current object rotation */
+  GLfloat dx, dy, dz;             /* current rotational velocity */
+  GLfloat ddx, ddy, ddz;          /* current rotational acceleration */
+  GLfloat d_max;                          /* max velocity */
+
+  GLfloat     angle;
+  GLuint      gasket1;
+  GLXContext *glx_context;
+  Window      window;
+
+  int current_depth;
+
+  int ncolors;
+  XColor *colors;
+  int ccolor;
+
+} gasketstruct;
+
+static gasketstruct *gasket = (gasketstruct *) NULL;
+
+#include <GL/glu.h>
+
+/* static GLuint limit; */
+
+\f
+/* Computing normal vectors (thanks to Nat Friedman <ndf@mit.edu>)
+ */
+
+typedef struct vector {
+  GLfloat x, y, z;
+} vector;
+
+typedef struct plane {
+  vector p1, p2, p3;
+} plane;
+
+static void
+vector_set(vector *v, GLfloat x, GLfloat y, GLfloat z)
+{
+  v->x = x;
+  v->y = y;
+  v->z = z;
+}
+
+static void
+vector_cross(vector v1, vector v2, vector *v3)
+{
+  v3->x = (v1.y * v2.z) - (v1.z * v2.y);
+  v3->y = (v1.z * v2.x) - (v1.x * v2.z);
+  v3->z = (v1.x * v2.y) - (v1.y * v2.x);
+}
+
+static void
+vector_subtract(vector v1, vector v2, vector *res)
+{
+  res->x = v1.x - v2.x;
+  res->y = v1.y - v2.y;
+  res->z = v1.z - v2.z;
+}
+
+static void
+plane_normal(plane p, vector *n)
+{
+  vector v1, v2;
+  vector_subtract(p.p1, p.p2, &v1);
+  vector_subtract(p.p1, p.p3, &v2);
+  vector_cross(v2, v1, n);
+}
+
+static void
+do_normal(GLfloat x1, GLfloat y1, GLfloat z1,
+         GLfloat x2, GLfloat y2, GLfloat z2,
+         GLfloat x3, GLfloat y3, GLfloat z3)
+{
+  plane plane;
+  vector n;
+  vector_set(&plane.p1, x1, y1, z1);
+  vector_set(&plane.p2, x2, y2, z2);
+  vector_set(&plane.p3, x3, y3, z3);
+  plane_normal(plane, &n);
+  n.x = -n.x; n.y = -n.y; n.z = -n.z;
+
+  glNormal3f(n.x, n.y, n.z);
+
+#ifdef DEBUG
+  /* Draw a line in the direction of this face's normal. */
+  {
+    GLfloat ax = n.x > 0 ? n.x : -n.x;
+    GLfloat ay = n.y > 0 ? n.y : -n.y;
+    GLfloat az = n.z > 0 ? n.z : -n.z;
+    GLfloat mx = (x1 + x2 + x3) / 3;
+    GLfloat my = (y1 + y2 + y3) / 3;
+    GLfloat mz = (z1 + z2 + z3) / 3;
+    GLfloat xx, yy, zz;
+
+    GLfloat max = ax > ay ? ax : ay;
+    if (az > max) max = az;
+    max *= 2;
+    xx = n.x / max;
+    yy = n.y / max;
+    zz = n.z / max;
+
+    glBegin(GL_LINE_LOOP);
+    glVertex3f(mx, my, mz);
+    glVertex3f(mx+xx, my+yy, mz+zz);
+    glEnd();
+  }
+#endif /* DEBUG */
+}
+
+\f
+
+static void
+triangle (GLfloat x1, GLfloat y1, GLfloat z1,
+          GLfloat x2, GLfloat y2, GLfloat z2,
+          GLfloat x3, GLfloat y3, GLfloat z3,
+          Bool wireframe_p)
+{
+  if (wireframe_p)
+    glBegin (GL_LINE_LOOP);
+  else 
+    { 
+      do_normal (x1, y1, z1,  x2, y2, z2,  x3, y3, z3);
+      glBegin (GL_TRIANGLES);
+    }
+  glVertex3f (x1, y1, z1);
+  glVertex3f (x2, y2, z2);
+  glVertex3f (x3, y3, z3);
+  glEnd();
+}
+
+static void
+four_tetras (GL_VECTOR *outer, Bool wireframe_p, int countdown)
+{
+  if (countdown <= 0)
+    {
+      triangle (outer[0].x, outer[0].y, outer[0].z,
+                outer[1].x, outer[1].y, outer[1].z,
+                outer[2].x, outer[2].y, outer[2].z,
+                wireframe_p);
+      triangle (outer[0].x, outer[0].y, outer[0].z,
+                outer[3].x, outer[3].y, outer[3].z,
+                outer[1].x, outer[1].y, outer[1].z,
+                wireframe_p);
+      triangle (outer[0].x, outer[0].y, outer[0].z,
+                outer[2].x, outer[2].y, outer[2].z,
+                outer[3].x, outer[3].y, outer[3].z,
+                wireframe_p);
+      triangle (outer[1].x, outer[1].y, outer[1].z,
+                outer[3].x, outer[3].y, outer[3].z,
+                outer[2].x, outer[2].y, outer[2].z,
+                wireframe_p);
+    }
+  else
+    {
+#     define M01 0
+#     define M02 1
+#     define M03 2
+#     define M12 3
+#     define M13 4
+#     define M23 5
+      GL_VECTOR inner[M23+1];
+      GL_VECTOR corner[4];
+
+      inner[M01].x = (outer[0].x + outer[1].x) / 2.0;
+      inner[M01].y = (outer[0].y + outer[1].y) / 2.0;
+      inner[M01].z = (outer[0].z + outer[1].z) / 2.0;
+
+      inner[M02].x = (outer[0].x + outer[2].x) / 2.0;
+      inner[M02].y = (outer[0].y + outer[2].y) / 2.0;
+      inner[M02].z = (outer[0].z + outer[2].z) / 2.0;
+
+      inner[M03].x = (outer[0].x + outer[3].x) / 2.0;
+      inner[M03].y = (outer[0].y + outer[3].y) / 2.0;
+      inner[M03].z = (outer[0].z + outer[3].z) / 2.0;
+
+      inner[M12].x = (outer[1].x + outer[2].x) / 2.0;
+      inner[M12].y = (outer[1].y + outer[2].y) / 2.0;
+      inner[M12].z = (outer[1].z + outer[2].z) / 2.0;
+
+      inner[M13].x = (outer[1].x + outer[3].x) / 2.0;
+      inner[M13].y = (outer[1].y + outer[3].y) / 2.0;
+      inner[M13].z = (outer[1].z + outer[3].z) / 2.0;
+
+      inner[M23].x = (outer[2].x + outer[3].x) / 2.0;
+      inner[M23].y = (outer[2].y + outer[3].y) / 2.0;
+      inner[M23].z = (outer[2].z + outer[3].z) / 2.0;
+
+      countdown--;
+
+      corner[0] = outer[0];
+      corner[1] = inner[M01];
+      corner[2] = inner[M02];
+      corner[3] = inner[M03];
+      four_tetras (corner, wireframe_p, countdown);
+
+      corner[0] = inner[M01];
+      corner[1] = outer[1];
+      corner[2] = inner[M12];
+      corner[3] = inner[M13];
+      four_tetras (corner, wireframe_p, countdown);
+
+      corner[0] = inner[M02];
+      corner[1] = inner[M12];
+      corner[2] = outer[2];
+      corner[3] = inner[M23];
+      four_tetras (corner, wireframe_p, countdown);
+
+      corner[0] = inner[M03];
+      corner[1] = inner[M13];
+      corner[2] = inner[M23];
+      corner[3] = outer[3];
+      four_tetras (corner, wireframe_p, countdown);
+    }
+}
+
+
+static void
+compile_gasket(ModeInfo *mi)
+{
+  Bool wireframe_p = MI_IS_WIREFRAME(mi);
+  gasketstruct *gp = &gasket[MI_SCREEN(mi)];
+
+  GL_VECTOR   vertex[5];
+
+  /* define verticies */
+  vertex[0].x =  0.5; 
+  vertex[0].y = -(1.0/3.0)*sqrt((2.0/3.0));
+  vertex[0].z = -sqrt(3.0)/6.0;
+
+  vertex[1].x = -0.5; 
+  vertex[1].y = -(1.0/3.0)*sqrt((2.0/3.0)); 
+  vertex[1].z = -sqrt(3.0)/6.0; 
+
+  vertex[2].x = 0.0; 
+  vertex[2].y = (2.0/3.0)*sqrt((2.0/3.0));
+  vertex[2].z = -sqrt(3.0)/6.0; 
+
+  vertex[3].x = 0.0; 
+  vertex[3].y = 0.0; 
+  vertex[3].z = sqrt(3.0)/3.0; 
+
+  vertex[4].x = 0.0;
+  vertex[4].y = 0.0; 
+  vertex[4].z = 0.0;
+  
+  four_tetras (vertex, wireframe_p,
+               (gp->current_depth < 0
+                ? -gp->current_depth : gp->current_depth));
+}
+
+static void
+draw(ModeInfo *mi)
+{
+  Bool wireframe_p = MI_IS_WIREFRAME(mi);
+  gasketstruct *gp = &gasket[MI_SCREEN(mi)];
+  static int tick = 0;
+  
+  static GLfloat pos[4] = {1.0, 1.0, 1.0, 0.0};
+  static float white[]  = {1.0, 1.0, 1.0, 1.0};
+  static float color[]  = {0.0, 0.0, 0.0, 1.0};
+
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+  if (!wireframe_p) 
+    {
+      glColor4fv (white);
+
+      glLightfv(GL_LIGHT0, GL_POSITION,  pos); 
+
+      color[0] = gp->colors[gp->ccolor].red  * intens_factor; 
+      color[1] = gp->colors[gp->ccolor].green * intens_factor;
+      color[2] = gp->colors[gp->ccolor].blue * intens_factor;  
+      gp->ccolor++;
+      if (gp->ccolor >= gp->ncolors) gp->ccolor = 0;
+
+      glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, color);
+
+      glShadeModel(GL_SMOOTH);
+
+      glEnable(GL_LIGHTING);
+      glEnable(GL_LIGHT0); 
+    }
+
+  glEnable(GL_DEPTH_TEST);
+  glEnable(GL_NORMALIZE);
+  glEnable(GL_CULL_FACE);
+
+  glPushMatrix();
+
+  {
+    static int frame = 0;
+    GLfloat x, y, z;
+
+#   define SINOID(SCALE,SIZE) \
+      ((((1 + sin((frame * (SCALE)) / 2 * M_PI)) / 2.0) * (SIZE)) - (SIZE)/2)
+    x = SINOID(0.0071, 8.0);
+    y = SINOID(0.0053, 6.0);
+    z = SINOID(0.0037, 15.0);
+    frame++;
+    glTranslatef(x, y, z);
+
+    x = gp->rotx;
+    y = gp->roty;
+    z = gp->rotz;
+    if (x < 0) x = 1 - (x + 1);
+    if (y < 0) y = 1 - (y + 1);
+    if (z < 0) z = 1 - (z + 1);
+    glRotatef(x * 360, 1.0, 0.0, 0.0);
+    glRotatef(y * 360, 0.0, 1.0, 0.0);
+    glRotatef(z * 360, 0.0, 0.0, 1.0);
+  }
+
+  glScalef( 8.0, 8.0, 8.0 );
+  glCallList(gp->gasket1);
+
+  glPopMatrix();
+
+
+  if (tick++ >= speed)
+    {
+
+      tick = 0;
+      if (gp->current_depth >= max_depth)
+        gp->current_depth = -max_depth;
+      gp->current_depth++;
+
+      glDeleteLists (gp->gasket1, 1);
+      glNewList (gp->gasket1, GL_COMPILE);
+      compile_gasket (mi);
+      glEndList();
+
+    }
+}
+
+
+/* new window size or exposure */
+void
+reshape_gasket(ModeInfo *mi, int width, int height)
+{
+  GLfloat h = (GLfloat) height / (GLfloat) width;
+
+  glViewport(0, 0, (GLint) width, (GLint) height);
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+
+  gluPerspective( 30.0, 1/h, 1.0, 100.0 );
+  gluLookAt( 0.0, 0.0, 15.0,
+             0.0, 0.0, 0.0,
+             0.0, 1.0, 0.0);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  glTranslatef(0.0, 0.0, -15.0);
+  
+  glClear(GL_COLOR_BUFFER_BIT);
+}
+
+static void
+pinit(ModeInfo *mi)
+{
+  gasketstruct *gp = &gasket[MI_SCREEN(mi)];
+
+  /* draw the gasket */
+  gp->gasket1 = glGenLists(1);
+  gp->current_depth = 1;       /* start out at level 1, not 0 */
+  glNewList(gp->gasket1, GL_COMPILE);
+    compile_gasket(mi);
+  glEndList();
+}
+
+
+
+/* lifted from lament.c */
+#define RAND(n) ((long) ((random() & 0x7fffffff) % ((long) (n))))
+#define RANDSIGN() ((random() & 1) ? 1 : -1)
+
+static void
+rotate(GLfloat *pos, GLfloat *v, GLfloat *dv, GLfloat max_v)
+{
+  double ppos = *pos;
+
+  /* tick position */
+  if (ppos < 0)
+    ppos = -(ppos + *v);
+  else
+    ppos += *v;
+
+  if (ppos > 1.0)
+    ppos -= 1.0;
+  else if (ppos < 0)
+    ppos += 1.0;
+
+  if (ppos < 0) abort();
+  if (ppos > 1.0) abort();
+  *pos = (*pos > 0 ? ppos : -ppos);
+
+  /* accelerate */
+  *v += *dv;
+
+  /* clamp velocity */
+  if (*v > max_v || *v < -max_v)
+    {
+      *dv = -*dv;
+    }
+  /* If it stops, start it going in the other direction. */
+  else if (*v < 0)
+    {
+      if (random() % 4)
+       {
+         *v = 0;
+
+         /* keep going in the same direction */
+         if (random() % 2)
+           *dv = 0;
+         else if (*dv < 0)
+           *dv = -*dv;
+       }
+      else
+       {
+         /* reverse gears */
+         *v = -*v;
+         *dv = -*dv;
+         *pos = -*pos;
+       }
+    }
+
+  /* Alter direction of rotational acceleration randomly. */
+  if (! (random() % 120))
+    *dv = -*dv;
+
+  /* Change acceleration very occasionally. */
+  if (! (random() % 200))
+    {
+      if (*dv == 0)
+       *dv = 0.00001;
+      else if (random() & 1)
+       *dv *= 1.2;
+      else
+       *dv *= 0.8;
+    }
+}
+
+
+void
+init_gasket(ModeInfo *mi)
+{
+  int           screen = MI_SCREEN(mi);
+  gasketstruct *gp;
+
+  if (gasket == NULL)
+  {
+    if ((gasket = (gasketstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (gasketstruct))) == NULL)
+       return;
+  }
+  gp = &gasket[screen];
+
+  gp->window = MI_WINDOW(mi);
+
+  gp->rotx = FLOATRAND(1.0) * RANDSIGN();
+  gp->roty = FLOATRAND(1.0) * RANDSIGN();
+  gp->rotz = FLOATRAND(1.0) * RANDSIGN();
+
+  /* bell curve from 0-1.5 degrees, avg 0.75 */
+  gp->dx = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+  gp->dy = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+  gp->dz = (FLOATRAND(1) + FLOATRAND(1) + FLOATRAND(1)) / (360*2);
+
+  gp->d_max = gp->dx * 2;
+
+  gp->ddx = 0.00006 + FLOATRAND(0.00003);
+  gp->ddy = 0.00006 + FLOATRAND(0.00003);
+  gp->ddz = 0.00006 + FLOATRAND(0.00003);
+
+  gp->ddx = 0.00001;
+  gp->ddy = 0.00001;
+  gp->ddz = 0.00001;
+
+  intens_factor = intensity / 65536000.0;
+  gp->ncolors = 255;
+  gp->colors = (XColor *) calloc(gp->ncolors, sizeof(XColor));
+  make_smooth_colormap (mi, 0,
+                        gp->colors, &gp->ncolors,
+                        False, 0);
+
+  if ((gp->glx_context = init_GL(mi)) != NULL)
+  {
+    reshape_gasket(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+    pinit(mi);
+  }
+  else
+  {
+    MI_CLEARWINDOW(mi);
+  }
+}
+
+void
+draw_gasket(ModeInfo * mi)
+{
+  gasketstruct *gp = &gasket[MI_SCREEN(mi)];
+  Display      *display = MI_DISPLAY(mi);
+  Window        window = MI_WINDOW(mi);
+  int           angle_incr = 1;
+
+  if (!gp->glx_context) return;
+
+  glDrawBuffer(GL_BACK);
+
+  if (max_depth > 10)
+    max_depth = 10;
+
+  glXMakeCurrent(display, window, *(gp->glx_context));
+  draw(mi);
+
+  /* rotate */
+  gp->angle = (int) (gp->angle + angle_incr) % 360;
+
+  rotate(&gp->rotx, &gp->dx, &gp->ddx, gp->d_max);
+  rotate(&gp->roty, &gp->dy, &gp->ddy, gp->d_max);
+  rotate(&gp->rotz, &gp->dz, &gp->ddz, gp->d_max);
+
+  /* if (mi->fps_p) do_fps (mi); */
+
+  if (MI_IS_FPS(mi)) do_fps (mi);
+  glFinish();
+  glXSwapBuffers(display, window);
+}
+
+void
+release_gasket(ModeInfo * mi)
+{
+  if (gasket != NULL)
+  {
+    int         screen;
+
+    for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+    {
+      gasketstruct *gp = &gasket[screen];
+
+      if (gp->colors != NULL) {
+       XFree((caddr_t) gp->colors);
+       gp->colors = (XColor *) NULL;
+      }
+      if (gp->glx_context)
+      {
+       /* Display lists MUST be freed while their glXContext is current. */
+        glXMakeCurrent(MI_DISPLAY(mi), gp->window, *(gp->glx_context));
+
+        if (glIsList(gp->gasket1)) glDeleteLists(gp->gasket1, 1);
+      }
+    }
+    (void) free((void *) gasket);
+    gasket = (gasketstruct *) NULL;
+  }
+  FreeAllGL(mi);
+}
+
+
+/*********************************************************/
+
+#endif
diff --git a/modes/glx/skewb.c b/modes/glx/skewb.c
new file mode 100644 (file)
index 0000000..a8f6901
--- /dev/null
@@ -0,0 +1,1648 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* skewb --- Shows an auto-solving Skewb */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)skewb.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+#undef DEBUG_LISTS
+#undef HACK /* I am just doing experiments here to figure it out */
+/* #define HACK */
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * This mode shows an auto-solving a skewb "puzzle".
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * Based on rubik.c by Marcelo F. Vianna
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 27-Apr-2000: Started writing, only have corners drawn and algorithm
+ *              compiled in.
+ */
+
+/*-
+ * Color labels mapping:
+ * =====================
+ *
+ *        +------+
+ *        |3    0|
+ *        |      |
+ *        | TOP  |
+ *        | (0)  |
+ *        |      |
+ *        |2    1|
+ * +------+------+------+
+ * |3    0|3    0|3    0|
+ * |      |      |      |
+ * | LEFT |FRONT |RIGHT |
+ * | (1)  | (2)  | (3)  |
+ * |      |      |      |
+ * |2    1|2    1|2    1|
+ * +------+------+------+
+ *        |3    0|
+ *        |      |
+ *        |BOTTOM|
+ *        | (4)  |
+ *        |      |
+ *        |2    1|
+ *        +------+         +------+
+ *        |3    0|         |3 /\ 0|
+ *        |      |         | /  \ |
+ *        | BACK |         |/xxxx\|
+ *        | (5)  |         |\(N) /|
+ *        |      |         | \  / |
+ *        |2    1|         |2 \/ 1|
+ *        +------+         +------+
+ *
+ *  Map to 3d
+ *  FRONT  => X, Y
+ *  BACK   => X, Y
+ *  LEFT   => Z, Y
+ *  RIGHT  => Z, Y
+ *  TOP    => X, Z
+ *  BOTTOM => X, Z
+ */
+
+/*-
+ * PURIFY 3.0a on SunOS4 reports an unitialized memory read on each of
+ * the glCallList() functions below when using MesaGL 2.1.  This has
+ * been fixed in MesaGL 2.2 and later releases.
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "Skewb"
+#define HACK_INIT init_skewb
+#define HACK_DRAW draw_skewb
+#define skewb_opts xlockmore_opts
+#define DEFAULTS "*delay: 40000 \n" \
+ "*count: -30 \n" \
+ "*cycles: 5 \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_skewb
+
+#define DEF_HIDESHUFFLING     "False"
+
+static Bool hideshuffling;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-hideshuffling", (char *) ".skewb.hideshuffling", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+hideshuffling", (char *) ".skewb.hideshuffling", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & hideshuffling, (char *) "hideshuffling", (char *) "Hideshuffling", (char *) DEF_HIDESHUFFLING, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+hideshuffling", (char *) "turn on/off hidden shuffle phase"}
+};
+
+ModeSpecOpt skewb_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   skewb_description =
+{"skewb", "init_skewb", "draw_skewb", "release_skewb",
+ "draw_skewb", "change_skewb", NULL, &skewb_opts,
+ 10000, -30, 5, 1, 64, 1.0, "",
+ "Shows an auto-solving Skewb", 0, NULL};
+
+#endif
+
+#define VectMul(X1,Y1,Z1,X2,Y2,Z2) (Y1)*(Z2)-(Z1)*(Y2),(Z1)*(X2)-(X1)*(Z2),(X1)*(Y2)-(Y1)*(X2)
+#define sqr(A)                     ((A)*(A))
+
+#ifndef Pi
+#define Pi                         M_PI
+#endif
+
+
+#define ACTION_SOLVE    1
+#define ACTION_SHUFFLE  0
+
+#define DELAY_AFTER_SHUFFLING  5
+#define DELAY_AFTER_SOLVING   20
+
+/*************************************************************************/
+
+#define Scale4Window               (0.9/3.0)
+#define Scale4Iconic               (2.1/3.0)
+
+#define MAXORIENT 4            /* Number of orientations of a square */
+#define MAXFACES 6             /* Number of faces */
+
+/* Directions relative to the face of a cubie */
+#define IGNORE (-1)
+#define TR 0
+#define BR 1
+#define BL 2
+#define TL 3
+#define STRT 4
+#define CW 5
+#define HALF 6
+#define CCW 7
+#define TOP 8
+#define RIGHT 9
+#define BOTTOM 10
+#define LEFT 11
+#define MAXORIENT 4
+#define MAXROTATE 3
+#define MAXCUBES (MAXORIENT+1)
+#define MINOR 0
+#define MAJOR 1
+#define MAXFACES 6
+
+#define TOP_FACE 0
+#define LEFT_FACE 1
+#define FRONT_FACE 2
+#define RIGHT_FACE 3
+#define BOTTOM_FACE 4
+#define BACK_FACE 5
+#define NO_FACE (MAXFACES)
+#define NO_ROTATION (2*MAXORIENT)
+
+#define CUBELEN 0.50
+#define CUBEROUND (CUBELEN-0.05)
+#define STICKERLONG (CUBEROUND-0.05)
+#define STICKERSHORT (STICKERLONG-0.05)
+#define STICKERDEPTH (CUBELEN+0.01)
+
+#define ObjCubit        0
+#define ObjFacit        1
+#define MaxObj          2
+
+typedef struct _SkewbLoc {
+       int         face;
+       int         rotation;   /* Not used yet */
+} SkewbLoc;
+typedef struct _SkewbLocPos {
+        int         face, position, direction;
+} SkewbLocPos;
+typedef struct _RowNext {
+        int         face, direction, sideFace;
+} RowNext;
+typedef struct _SkewbMove {
+        int         face, direction;
+        int         position;
+} SkewbMove;
+
+
+/*-
+ * Pick a face and a direction on face the next face and orientation
+ * is then known.
+ */
+static SkewbLoc slideNextRow[MAXFACES][MAXORIENT][MAXORIENT / 2] =
+{
+       {
+               {
+                       {2, CW},
+                       {1, HALF}},
+               {
+                       {5, CCW},
+                       {1, STRT}},
+               {
+                       {3, STRT},
+                       {5, CW}},
+               {
+                       {3, HALF},
+                       {2, CCW}}
+       },
+       {
+               {
+                       {4, STRT},
+                       {5, CW}},
+               {
+                       {0, STRT},
+                       {5, CCW}},
+               {
+                       {2, CCW},
+                       {0, HALF}},
+               {
+                       {2, CW},
+                       {4, HALF}}
+       },
+       {
+               {
+                       {4, CW},
+                       {1, CCW}},
+               {
+                       {0, CCW},
+                       {1, CW}},
+               {
+                       {3, CCW},
+                       {0, CW}},
+               {
+                       {3, CW},
+                       {4, CCW}}
+       },
+       {
+               {
+                       {4, HALF},
+                       {2, CCW}},
+               {
+                       {0, HALF},
+                       {2, CW}},
+               {
+                       {5, CW},
+                       {0, STRT}},
+               {
+                       {5, CCW},
+                       {4, STRT}}
+       },
+       {
+               {
+                       {5, CW},
+                       {1, STRT}},
+               {
+                       {2, CCW},
+                       {1, HALF}},
+               {
+                       {3, HALF},
+                       {2, CW}},
+               {
+                       {3, STRT},
+                       {5, CCW}}
+       },
+       {
+               {
+                       {0, CW},
+                       {1, CW}},
+               {
+                       {4, CCW},
+                       {1, CCW}},
+               {
+                       {3, CW},
+                       {4, CW}},
+               {
+                       {3, CCW},
+                       {0, CCW}}
+       }
+};
+static SkewbLoc minToMaj[MAXFACES][MAXORIENT] =
+{                              /* other equivalent mappings possible */
+       {
+               {3, CW},
+               {2, STRT},
+               {1, CCW},
+               {5, STRT}},
+       {
+               {2, STRT},
+               {4, CCW},
+               {5, HALF},
+               {0, CW}},
+       {
+               {3, STRT},
+               {4, STRT},
+               {1, STRT},
+               {0, STRT}},
+       {
+               {5, HALF},
+               {4, CW},
+               {2, STRT},
+               {0, CCW}},
+       {
+               {3, CCW},
+               {5, STRT},
+               {1, CW},
+               {2, STRT}},
+       {
+               {3, HALF},
+               {0, STRT},
+               {1, HALF},
+               {4, STRT}}
+};
+
+static SkewbLoc slideNextFace[MAXFACES][MAXORIENT] =
+{
+       {
+               {5, STRT},
+               {3, CW},
+               {2, STRT},
+               {1, CCW}},
+       {
+               {0, CW},
+               {2, STRT},
+               {4, CCW},
+               {5, HALF}},
+       {
+               {0, STRT},
+               {3, STRT},
+               {4, STRT},
+               {1, STRT}},
+       {
+               {0, CCW},
+               {5, HALF},
+               {4, CW},
+               {2, STRT}},
+       {
+               {2, STRT},
+               {3, CCW},
+               {5, STRT},
+               {1, CW}},
+       {
+               {4, STRT},
+               {3, HALF},
+               {0, STRT},
+               {1, HALF}}
+};
+
+static int  faceToRotate[MAXFACES][MAXORIENT] =
+{
+       {3, 2, 1, 5},
+       {2, 4, 5, 0},
+       {3, 4, 1, 0},
+       {5, 4, 2, 0},
+       {3, 5, 1, 2},
+       {3, 0, 1, 4}
+};
+
+#ifdef HACK
+static SkewbLocPos orthToDiag[MAXFACES][MAXORIENT][MAXORIENT] =
+{
+       {
+               {
+                       {3, 0, 1},
+                       {5, 1, 0},
+                       {3, 0, 3},
+                       {5, 1, 2}},
+               {
+                       {3, 3, 0},
+                       {2, 0, 1},
+                       {3, 3, 2},
+                       {2, 0, 3}},
+               {
+                       {1, 0, 3},
+                       {2, 3, 0},
+                       {1, 0, 1},
+                       {2, 3, 2}},
+               {
+                       {1, 3, 2},
+                       {5, 2, 1},
+                       {1, 3, 0},
+                       {5, 2, 3}}
+       },
+       {
+               {
+                       {2, 3, 0},
+                       {0, 2, 1},
+                       {2, 3, 2},
+                       {0, 2, 3}},
+               {
+                       {2, 2, 3},
+                       {4, 3, 0},
+                       {2, 2, 1},
+                       {4, 3, 2}},
+               {
+                       {5, 3, 2},
+                       {4, 2, 3},
+                       {5, 3, 0},
+                       {4, 2, 1}},
+               {
+                       {5, 2, 1},
+                       {0, 3, 2},
+                       {5, 2, 3},
+                       {0, 3, 0}}
+       },
+       {
+               {
+                       {3, 3, 0},
+                       {0, 1, 0},
+                       {3, 3, 2},
+                       {0, 1, 2}},
+               {
+                       {3, 2, 3},
+                       {4, 0, 1},
+                       {3, 2, 1},
+                       {4, 0, 3}},
+               {
+                       {1, 1, 0},
+                       {4, 3, 0},
+                       {1, 1, 2},
+                       {4, 3, 2}},
+               {
+                       {1, 0, 3},
+                       {0, 2, 1},
+                       {1, 0, 1},
+                       {0, 2, 3}}
+       },
+       {
+               {
+                       {5, 1, 2},
+                       {0, 0, 3},
+                       {5, 1, 0},
+                       {0, 0, 1}},
+               {
+                       {5, 0, 1},
+                       {4, 1, 2},
+                       {5, 0, 3},
+                       {4, 1, 0}},
+               {
+                       {2, 1, 0},
+                       {4, 0, 1},
+                       {2, 1, 2},
+                       {4, 0, 3}},
+               {
+                       {2, 0, 3},
+                       {0, 1, 0},
+                       {2, 0, 1},
+                       {0, 1, 2}}
+       },
+       {
+               {
+                       {3, 2, 3},
+                       {2, 1, 0},
+                       {3, 2, 1},
+                       {2, 1, 2}},
+               {
+                       {3, 1, 2},
+                       {5, 0, 1},
+                       {3, 1, 0},
+                       {5, 0, 3}},
+               {
+                       {1, 2, 1},
+                       {5, 3, 0},
+                       {1, 2, 3},
+                       {5, 3, 2}},
+               {
+                       {1, 1, 0},
+                       {2, 2, 1},
+                       {1, 1, 2},
+                       {2, 2, 3}}
+       },
+       {
+               {
+                       {3, 1, 2},
+                       {4, 1, 0},
+                       {3, 1, 0},
+                       {4, 1, 2}},
+               {
+                       {3, 0, 1},
+                       {0, 0, 1},
+                       {3, 0, 3},
+                       {0, 0, 3}},
+               {
+                       {1, 3, 2},
+                       {0, 3, 0},
+                       {1, 3, 0},
+                       {0, 3, 2}},
+               {
+                       {1, 2, 1},
+                       {4, 2, 1},
+                       {1, 2, 3},
+                       {4, 2, 3}}
+       }
+};
+#endif
+
+typedef struct {
+       GLint       WindH, WindW;
+       GLfloat     step;
+       SkewbMove  *moves;
+       int         storedmoves;
+       int         shufflingmoves;
+       int         action;
+       int         done;
+       GLfloat     anglestep;
+       SkewbLoc    cubeLoc[MAXFACES][MAXCUBES];
+       SkewbLoc    rowLoc[MAXORIENT][MAXCUBES];
+       SkewbLoc    minorLoc[MAXORIENT], majorLoc[MAXORIENT][MAXORIENT];
+       SkewbMove   movement;
+       GLfloat     rotatestep;
+       GLfloat     PX, PY, VX, VY;
+       GLXContext *glx_context;
+       Bool        AreObjectsDefined[2];
+} skewbstruct;
+
+static float front_shininess[] =
+{60.0};
+static float front_specular[] =
+{0.7, 0.7, 0.7, 1.0};
+static float ambient[] =
+{0.0, 0.0, 0.0, 1.0};
+static float diffuse[] =
+{1.0, 1.0, 1.0, 1.0};
+static float position0[] =
+{1.0, 1.0, 1.0, 0.0};
+static float position1[] =
+{-1.0, -1.0, 1.0, 0.0};
+static float lmodel_ambient[] =
+{0.5, 0.5, 0.5, 1.0};
+static float lmodel_twoside[] =
+{GL_TRUE};
+
+static float MaterialRed[] =
+{0.5, 0.0, 0.0, 1.0};
+static float MaterialBlue[] =
+{0.0, 0.0, 0.5, 1.0};
+static float MaterialGreen[] =
+{0.0, 0.5, 0.0, 1.0};
+static float MaterialPink[] =
+{0.9, 0.5, 0.5, 1.0};
+static float MaterialYellow[] =
+{0.7, 0.7, 0.0, 1.0};
+
+static float MaterialWhite[] =
+{0.8, 0.8, 0.8, 1.0};
+static float MaterialGray[] =
+{0.2, 0.2, 0.2, 1.0};
+static float MaterialGray3[] =
+{0.3, 0.3, 0.3, 1.0};
+static float MaterialGray4[] =
+{0.4, 0.4, 0.4, 1.0};
+static float MaterialGray5[] =
+{0.5, 0.5, 0.5, 1.0};
+static float MaterialGray6[] =
+{0.6, 0.6, 0.6, 1.0};
+static float MaterialGray7[] =
+{0.7, 0.7, 0.7, 1.0};
+
+static skewbstruct *skewb = (skewbstruct *) NULL;
+static GLuint objects = 0;
+
+
+static void
+pickcolor(int C, int mono)
+{
+       switch (C) {
+               case TOP_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray3);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
+                       break;
+               case LEFT_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray5);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialBlue);
+                       break;
+               case FRONT_FACE:
+                       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+                       break;
+               case RIGHT_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray4);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGreen);
+                       break;
+               case BOTTOM_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray7);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialPink);
+                       break;
+               case BACK_FACE:
+                       if (mono)
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray6);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialYellow);
+                       break;
+       }
+}
+
+static Bool
+draw_stickerless_cubit(skewbstruct * sp)
+{
+       if (!sp->AreObjectsDefined[ObjCubit]) {
+               /* Draw one and rotate it */
+               glNewList(objects + ObjCubit, GL_COMPILE_AND_EXECUTE);
+               if (glGetError() != GL_NO_ERROR) {
+                       return False;
+               }
+               glBegin(GL_QUADS);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+               /* Edge of cubit */
+               glNormal3f(1.00, 1.00, 0.00);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+               glNormal3f(0.00, 1.00, 1.00);
+               glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glNormal3f(1.00, 0.00, 1.00);
+               glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+               glEnd();
+               glBegin(GL_TRIANGLES);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+               /* Put sticker here */
+               glNormal3f(0.00, 0.00, 1.00);
+               glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+               glNormal3f(1.00, 0.00, 0.00);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+               glNormal3f(0.00, 1.00, 0.00);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+               /* Corner of cubit */
+               glNormal3f(1.00, 1.00, 1.00);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+
+               /* Sharper corners of cubit */
+               glNormal3f(-1.00, 1.00, 1.00);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBELEN);
+               glVertex3f(-CUBELEN, CUBELEN, CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+               glNormal3f(1.00, -1.00, 1.00);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBELEN);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(CUBELEN, -CUBELEN, CUBEROUND);
+               glNormal3f(1.00, 1.00, -1.00);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBELEN);
+
+               /* Invisible portion of cubit (FIX: not flush) */
+               glNormal3f(-1.00, 1.00, 1.00);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+               glEnd();
+               glEndList();
+               sp->AreObjectsDefined[ObjCubit] = True;
+#ifdef DEBUG_LISTS
+               (void) printf("Cubit drawn SLOWLY\n");
+#endif
+       } else {
+               glCallList(objects + ObjCubit);
+#ifdef DEBUG_LISTS
+               (void) printf("Cubit drawn quickly\n");
+#endif
+       }
+       return True;
+}
+
+static Bool
+draw_stickerless_facit(skewbstruct * sp)
+{
+       if (!sp->AreObjectsDefined[ObjFacit]) {
+               /* Draw one and rotate it */
+               glNewList(objects + ObjFacit, GL_COMPILE_AND_EXECUTE);
+               if (glGetError() != GL_NO_ERROR) {
+                       return False;
+               }
+               glBegin(GL_QUADS);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialPink);
+               /* Edge of facit */
+#if 0
+               glNormal3f(0.00, 1.00, 1.00);
+               glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+               glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+#endif
+#if 0
+               glNormal3f(0.00, 0.00, -1.00);
+               glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+               glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+               glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+               glNormal3f(-1.00, 0.00, 0.00);
+               glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+               glNormal3f(1.00, 0.00, 0.00);
+               glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+               glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+               glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+               glNormal3f(0.00, -1.00, 0.00);
+               glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+               glNormal3f(0.00, 1.00, 0.00);
+               glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+
+#endif
+#if 0
+               glNormal3f(0.00, 1.00, 0.00);
+               glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+               glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+               glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+#endif
+               glEnd();
+               glEndList();
+               sp->AreObjectsDefined[ObjFacit] = True;
+#ifdef DEBUG_LISTS
+               (void) printf("Facit drawn SLOWLY\n");
+#endif
+       } else {
+               glCallList(objects + ObjFacit);
+#ifdef DEBUG_LISTS
+               (void) printf("Facit drawn quickly\n");
+#endif
+       }
+       return True;
+}
+
+static void
+draw_cubit(ModeInfo * mi,
+          int back, int front, int left, int right, int bottom, int top)
+{
+       /* skewbstruct *sp = &skewb[MI_SCREEN(mi)]; */
+       int         mono = MI_IS_MONO(mi);
+
+       if (back != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(back, mono);
+               glNormal3f(0.00, 0.00, -1.00);
+               if (top != NO_FACE) {
+                       glVertex3f(-STICKERSHORT, STICKERLONG, -STICKERDEPTH);
+                       glVertex3f(STICKERSHORT, STICKERLONG, -STICKERDEPTH);
+               }
+               if (left != NO_FACE) {
+                       glVertex3f(-STICKERLONG, -STICKERSHORT, -STICKERDEPTH);
+                       glVertex3f(-STICKERLONG, STICKERSHORT, -STICKERDEPTH);
+               }
+               if (bottom != NO_FACE) {
+                       glVertex3f(STICKERSHORT, -STICKERLONG, -STICKERDEPTH);
+                       glVertex3f(-STICKERSHORT, -STICKERLONG, -STICKERDEPTH);
+               }
+               if (right != NO_FACE) {
+                       glVertex3f(STICKERLONG, STICKERSHORT, -STICKERDEPTH);
+                       glVertex3f(STICKERLONG, -STICKERSHORT, -STICKERDEPTH);
+               }
+               glEnd();
+       }
+       if (front != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(front, mono);
+               glNormal3f(0.00, 0.00, 1.00);
+               if (top != NO_FACE) {
+                       glVertex3f(STICKERSHORT, STICKERLONG, STICKERDEPTH);
+                       glVertex3f(-STICKERSHORT, STICKERLONG, STICKERDEPTH);
+               }
+               if (left != NO_FACE) {
+                       glVertex3f(-STICKERLONG, STICKERSHORT, STICKERDEPTH);
+                       glVertex3f(-STICKERLONG, -STICKERSHORT, STICKERDEPTH);
+               }
+               if (bottom != NO_FACE) {
+                       glVertex3f(-STICKERSHORT, -STICKERLONG, STICKERDEPTH);
+                       glVertex3f(STICKERSHORT, -STICKERLONG, STICKERDEPTH);
+               }
+               if (right != NO_FACE) {
+                       glVertex3f(STICKERLONG, -STICKERSHORT, STICKERDEPTH);
+                       glVertex3f(STICKERLONG, STICKERSHORT, STICKERDEPTH);
+               }
+               glEnd();
+       }
+       if (left != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(left, mono);
+               glNormal3f(-1.00, 0.00, 0.00);
+               if (front != NO_FACE) {
+                       glVertex3f(-STICKERDEPTH, -STICKERSHORT, STICKERLONG);
+                       glVertex3f(-STICKERDEPTH, STICKERSHORT, STICKERLONG);
+               }
+               if (top != NO_FACE) {
+                       glVertex3f(-STICKERDEPTH, STICKERLONG, STICKERSHORT);
+                       glVertex3f(-STICKERDEPTH, STICKERLONG, -STICKERSHORT);
+               }
+               if (back != NO_FACE) {
+                       glVertex3f(-STICKERDEPTH, STICKERSHORT, -STICKERLONG);
+                       glVertex3f(-STICKERDEPTH, -STICKERSHORT, -STICKERLONG);
+               }
+               if (bottom != NO_FACE) {
+                       glVertex3f(-STICKERDEPTH, -STICKERLONG, -STICKERSHORT);
+                       glVertex3f(-STICKERDEPTH, -STICKERLONG, STICKERSHORT);
+               }
+               glEnd();
+       }
+       if (right != NO_FACE) { /* Green */
+               glBegin(GL_POLYGON);
+               pickcolor(right, mono);
+               glNormal3f(1.00, 0.00, 0.00);
+               if (front != NO_FACE) {
+                       glVertex3f(STICKERDEPTH, STICKERSHORT, STICKERLONG);
+                       glVertex3f(STICKERDEPTH, -STICKERSHORT, STICKERLONG);
+               }
+               if (top != NO_FACE) {
+                       glVertex3f(STICKERDEPTH, STICKERLONG, -STICKERSHORT);
+                       glVertex3f(STICKERDEPTH, STICKERLONG, STICKERSHORT);
+               }
+               if (back != NO_FACE) {
+                       glVertex3f(STICKERDEPTH, -STICKERSHORT, -STICKERLONG);
+                       glVertex3f(STICKERDEPTH, STICKERSHORT, -STICKERLONG);
+               }
+               if (bottom != NO_FACE) {
+                       glVertex3f(STICKERDEPTH, -STICKERLONG, STICKERSHORT);
+                       glVertex3f(STICKERDEPTH, -STICKERLONG, -STICKERSHORT);
+               }
+               glEnd();
+       }
+       if (bottom != NO_FACE) { /* Pink */
+               glBegin(GL_POLYGON);
+               pickcolor(bottom, mono);
+               glNormal3f(0.00, -1.00, 0.00);
+               if (left != NO_FACE) {
+                       glVertex3f(-STICKERLONG, -STICKERDEPTH, STICKERSHORT);
+                       glVertex3f(-STICKERLONG, -STICKERDEPTH, -STICKERSHORT);
+               }
+               if (front != NO_FACE) {
+                       glVertex3f(STICKERSHORT, -STICKERDEPTH, STICKERLONG);
+                       glVertex3f(-STICKERSHORT, -STICKERDEPTH, STICKERLONG);
+               }
+               if (right != NO_FACE) {
+                       glVertex3f(STICKERLONG, -STICKERDEPTH, -STICKERSHORT);
+                       glVertex3f(STICKERLONG, -STICKERDEPTH, STICKERSHORT);
+               }
+               if (back != NO_FACE) {
+                       glVertex3f(-STICKERSHORT, -STICKERDEPTH, -STICKERLONG);
+                       glVertex3f(STICKERSHORT, -STICKERDEPTH, -STICKERLONG);
+               }
+               glEnd();
+       }
+       if (top != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(top, mono);
+               glNormal3f(0.00, 1.00, 0.00);
+               if (left != NO_FACE) {
+                       glVertex3f(-STICKERLONG, STICKERDEPTH, -STICKERSHORT);
+                       glVertex3f(-STICKERLONG, STICKERDEPTH, STICKERSHORT);
+               }
+               if (front != NO_FACE) {
+                       glVertex3f(-STICKERSHORT, STICKERDEPTH, STICKERLONG);
+                       glVertex3f(STICKERSHORT, STICKERDEPTH, STICKERLONG);
+               }
+               if (right != NO_FACE) {
+                       glVertex3f(STICKERLONG, STICKERDEPTH, STICKERSHORT);
+                       glVertex3f(STICKERLONG, STICKERDEPTH, -STICKERSHORT);
+               }
+               if (back != NO_FACE) {
+                       glVertex3f(STICKERSHORT, STICKERDEPTH, -STICKERLONG);
+                       glVertex3f(-STICKERSHORT, STICKERDEPTH, -STICKERLONG);
+               }
+               glEnd();
+       }
+}
+
+#ifdef HACK
+static void
+draw_facit(ModeInfo * mi,
+          int back, int front, int left, int right, int bottom, int top)
+{
+       /* skewbstruct *sp = &skewb[MI_SCREEN(mi)]; */
+       int         mono = MI_IS_MONO(mi);
+
+       if (back != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(back, mono);
+               glNormal3f(0.00, 0.00, -1.00);
+               glEnd();
+       }
+       if (front != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(front, mono);
+               glNormal3f(0.00, 0.00, 1.00);
+               glEnd();
+       }
+       if (left != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(left, mono);
+               glNormal3f(-1.00, 0.00, 0.00);
+               glEnd();
+       }
+       if (right != NO_FACE) { /* Green */
+               glBegin(GL_POLYGON);
+               pickcolor(right, mono);
+               glNormal3f(1.00, 0.00, 0.00);
+               glEnd();
+       }
+       if (bottom != NO_FACE) { /* Pink */
+               glBegin(GL_POLYGON);
+               pickcolor(bottom, mono);
+               glNormal3f(0.00, -1.00, 0.00);
+               glEnd();
+       }
+       if (top != NO_FACE) {
+               glBegin(GL_POLYGON);
+               pickcolor(top, mono);
+               glNormal3f(0.00, 1.00, 0.00);
+               glEnd();
+       }
+}
+#endif
+
+static Bool
+draw_cube(ModeInfo * mi)
+{
+#define S1 1
+#define DRAW_STICKERLESS_FACIT(sp) if (!draw_stickerless_facit(sp)) return False
+#define DRAW_STICKERLESS_CUBIT(sp) if (!draw_stickerless_cubit(sp)) return False
+
+       skewbstruct *sp = &skewb[MI_SCREEN(mi)];
+       SkewbLoc  slice;
+       GLfloat     rotatestep;
+       /* int         i, j, k; */
+
+       if (sp->movement.face == NO_FACE) {
+               slice.face = NO_FACE;
+               slice.rotation = NO_ROTATION;
+       }
+#ifdef FIXME
+        else {
+               convertMove(sp, sp->movement, &slice);
+       }
+#endif
+       rotatestep = (slice.rotation == CCW) ? sp->rotatestep : -sp->rotatestep;
+
+
+/*-
+ * The glRotatef() routine transforms the coordinate system for every future
+ * vertex specification (this is not so simple, but by now comprehending this
+ * is sufficient). So if you want to rotate the inner slice, you can draw
+ * one slice, rotate the anglestep for the centerslice, draw the inner slice,
+ * rotate reversely and draw the other slice.
+ * There is a sequence for drawing cubies for each axis being moved...
+ */
+       switch (slice.face) {
+               case NO_FACE:
+               case TOP_FACE:  /* BOTTOM_FACE too */
+                       glPushMatrix();
+                       glRotatef(rotatestep, 0, 1, 0);
+
+                       glTranslatef(-0.5, -0.5, -0.5);
+                       /* glTranslatef(S1, 0, S1); */
+                       DRAW_STICKERLESS_FACIT(sp);
+                       glPushMatrix();
+                       glRotatef(90.0, 0, 1, 0);
+                       glRotatef(180.0, 1, 0, 0);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       glPopMatrix();
+                       draw_cubit(mi, 0, 6, 2, 6, 4, 6);
+                       glTranslatef(0, 0, S1);
+                       glPushMatrix();
+                       glRotatef(180.0, 0, 0, 1);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       glPopMatrix();
+                       draw_cubit(mi, 6, 1, 2, 6, 4, 6); /* BL */
+                       glTranslatef(S1, 0, -S1);
+                       glPushMatrix();
+                       glRotatef(90.0, 0, 1, 0);
+                       glRotatef(90.0, 1, 0, 0);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       glPopMatrix();
+                       draw_cubit(mi, 0, 6, 6, 3, 4, 6);
+                       glTranslatef(0, 0, S1);
+                       glPushMatrix();
+                       glRotatef(90.0, 1, 0, 0);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       glPopMatrix();
+                       draw_cubit(mi, 6, 1, 6, 3, 4, 6); /* BR */
+                       glPopMatrix();
+                       glPushMatrix();
+                       glTranslatef(-0.5, 0.5, -0.5);
+                       glPushMatrix();
+                       glRotatef(90.0, 0, 1, 0);
+                       glRotatef(90.0, -1, 0, 0);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       glPopMatrix();
+                       draw_cubit(mi, 0, 6, 2, 6, 6, 5);
+                       glTranslatef(0, 0, S1);
+                       glPushMatrix();
+                       glRotatef(90.0, 0, 0, 1);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       glPopMatrix();
+                       draw_cubit(mi, 6, 1, 2, 6, 6, 5); /* UL */
+                       glTranslatef(S1, 0, -S1);
+                       glPushMatrix();
+                       glRotatef(90.0, 0, 1, 0);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       glPopMatrix();
+                       draw_cubit(mi, 0, 6, 6, 3, 6, 5);
+                       glTranslatef(0, 0, S1);
+                       DRAW_STICKERLESS_CUBIT(sp);
+                       draw_cubit(mi, 6, 1, 6, 3, 6, 5); /* UR */
+                       glPopMatrix();
+                       break;
+       }
+       return True;
+#undef S1
+}
+
+/* From David Bagley's xskewb.  Used by permission. ;)  */
+static void
+readDiagonal(skewbstruct *sp, int face, int corner, int orient, int size)
+{
+       int         g;
+
+       if (size == MINOR)
+               sp->minorLoc[orient] = sp->cubeLoc[face][corner];
+       else {                  /* size == MAJOR */
+               for (g = 1; g < MAXORIENT; g++)
+                       sp->majorLoc[orient][g - 1] =
+                               sp->cubeLoc[face][(corner + g) % MAXORIENT];
+               sp->majorLoc[orient][MAXORIENT - 1] =
+                       sp->cubeLoc[face][MAXORIENT];
+       }
+}
+
+static void
+rotateDiagonal(skewbstruct *sp, int rotate, int orient, int size)
+{
+       int         g;
+
+       if (size == MINOR)
+               sp->minorLoc[orient].rotation =
+                       (sp->minorLoc[orient].rotation + rotate) % MAXORIENT;
+       else                    /* size == MAJOR */
+               for (g = 0; g < MAXORIENT; g++)
+                       sp->majorLoc[orient][g].rotation =
+                               (sp->majorLoc[orient][g].rotation + rotate) % MAXORIENT;
+}
+
+static void
+writeDiagonal(skewbstruct *sp, int face, int corner, int orient, int size)
+{
+       int         g, h;
+
+       if (size == MINOR) {
+               sp->cubeLoc[face][corner] = sp->minorLoc[orient];
+               /* DrawTriangle(face, corner); */
+       } else {                /* size == MAJOR */
+               sp->cubeLoc[face][MAXORIENT] =
+                       sp->majorLoc[orient][MAXORIENT - 1];
+               /* DrawDiamond(face); */
+               for (g = 1; g < MAXORIENT; g++) {
+                       h = (corner + g) % MAXORIENT;
+                       sp->cubeLoc[face][h] = sp->majorLoc[orient][g - 1];
+                       /* DrawTriangle(face, h); */
+               }
+       }
+}
+
+static void
+readFace(skewbstruct * sp, int face, int h)
+{
+       int         position;
+
+       for (position = 0; position < MAXCUBES; position++)
+               sp->rowLoc[h][position] = sp->cubeLoc[face][position];
+}
+
+static void
+writeFace(skewbstruct * sp, int face, int rotate, int h)
+{
+       int         corner, newCorner;
+
+       for (corner = 0; corner < MAXORIENT; corner++) {
+               newCorner = (corner + rotate) % MAXORIENT;
+               sp->cubeLoc[face][newCorner] = sp->rowLoc[h][corner];
+               sp->cubeLoc[face][newCorner].rotation =
+                       (sp->cubeLoc[face][newCorner].rotation + rotate) % MAXORIENT;
+               /* DrawTriangle(face, (corner + rotate) % MAXORIENT); */
+       }
+       sp->cubeLoc[face][MAXORIENT] = sp->rowLoc[h][MAXORIENT];
+       sp->cubeLoc[face][MAXORIENT].rotation =
+               (sp->cubeLoc[face][MAXORIENT].rotation + rotate) % MAXORIENT;
+       /* DrawDiamond(face); */
+}
+
+static void
+rotateFace(skewbstruct * sp, int face, int direction)
+{
+       SkewbLoc    faceLoc[MAXCUBES];
+       int         corner;
+
+       /* Read Face */
+       for (corner = 0; corner < MAXORIENT; corner++)
+               faceLoc[corner] = sp->cubeLoc[face][corner];
+       /* Write Face */
+       for (corner = 0; corner < MAXORIENT; corner++) {
+               sp->cubeLoc[face][corner] = (direction == CW) ?
+                       faceLoc[(corner + MAXORIENT - 1) % MAXORIENT] :
+                       faceLoc[(corner + 1) % MAXORIENT];
+               sp->cubeLoc[face][corner].rotation =
+                       (sp->cubeLoc[face][corner].rotation + direction) % MAXORIENT;
+               /* DrawTriangle(face, corner); */
+       }
+       sp->cubeLoc[face][MAXORIENT].rotation =
+               (sp->cubeLoc[face][MAXORIENT].rotation + direction) % MAXORIENT;
+       /* DrawDiamond(face); */ 
+}
+
+#ifdef HACK
+static      Boolean
+checkMoveDir(int position1, int position2, int *direction)
+{
+       if (!((position1 - position2 + MAXORIENT) % 2))
+               return False;
+       switch (position1) {
+               case 0:
+                       *direction = (position2 == 1) ? 2 : 3;
+                       break;
+               case 1:
+                       *direction = (position2 == 2) ? 3 : 0;
+                       break;
+               case 2:
+                       *direction = (position2 == 3) ? 0 : 1;
+                       break;
+               case 3:
+                       *direction = (position2 == 0) ? 1 : 2;
+                       break;
+               default:
+                       return False;
+       }
+       *direction += 2 * MAXORIENT;
+       return True;
+}
+#endif
+
+static void
+moveSkewb(skewbstruct * sp, int face, int direction, int position)
+{
+       int      newFace, newDirection, newCorner, k, size, rotate;
+
+       if (direction < 2 * MAXORIENT) {
+               /* position as MAXORIENT is ambiguous */
+               for (size = MINOR; size <= MAJOR; size++) {
+                       readDiagonal(sp, face, position, 0, size);
+                       for (k = 1; k <= MAXROTATE; k++) {
+                               newFace = slideNextRow[face][position][direction / 2].face;
+                               rotate = slideNextRow[face][position][direction / 2].rotation %
+                                       MAXORIENT;
+                               newDirection = (rotate + direction) % MAXORIENT;
+                               newCorner = (rotate + position) % MAXORIENT;
+                               if (k != MAXROTATE)
+                                       readDiagonal(sp, newFace, newCorner, k, size);
+                               rotateDiagonal(sp, rotate, k - 1, size);
+                               writeDiagonal(sp, newFace, newCorner, k - 1, size);
+                               face = newFace;
+                               position = newCorner;
+                               direction = newDirection;
+                       }
+                       if (size == MINOR) {
+                               newFace = minToMaj[face][position].face;
+                               rotate = minToMaj[face][position].rotation % MAXORIENT;
+                               direction = (rotate + direction) % MAXORIENT;
+                               position = (position + rotate + 2) % MAXORIENT;
+                               face = newFace;
+                       }
+               }
+       } else {
+               rotateFace(sp, faceToRotate[face][direction % MAXORIENT], CW);
+               rotateFace(sp, faceToRotate[face][(direction + 2) % MAXORIENT], CCW);
+               readFace(sp, face, 0);
+               for (k = 1; k <= MAXORIENT; k++) {
+                       newFace = slideNextFace[face][direction % MAXORIENT].face;
+                       rotate = slideNextFace[face][direction % MAXORIENT].rotation;
+                       newDirection = (rotate + direction) % MAXORIENT;
+                       if (k != MAXORIENT)
+                               readFace(sp, newFace, k);
+                       writeFace(sp, newFace, rotate, k - 1);
+                       face = newFace;
+                       direction = newDirection;
+               }
+       }
+}
+
+#ifdef DEBUG
+void
+printCube(skewbstruct * sp)
+{
+       int      face, position;
+
+       for (face = 0; face < MAXFACES; face++) {
+               for (position = 0; position < MAXCUBES; position++)
+                       (void) printf("%d %d  ", sp->cubeLoc[face][position].face,
+                       sp->cubeLoc[face][position].rotation);
+               }
+               (void) printf("\n");
+       }
+       (void) printf("\n");
+}
+
+#endif
+
+static void
+evalmovement(ModeInfo * mi, SkewbMove movement)
+{
+       skewbstruct *sp = &skewb[MI_SCREEN(mi)];
+
+#ifdef DEBUG
+       printCube(sp);
+#endif
+       if (movement.face < 0 || movement.face >= MAXFACES)
+               return;
+
+       moveSkewb(sp, movement.face, movement.direction, movement.position);
+
+}
+
+#ifdef HACK
+static      Bool
+compare_moves(skewbstruct * sp, SkewbMove move1, SkewbMove move2, Bool opp)
+{
+#ifdef FIXME
+       SkewbLoc  slice1, slice2;
+
+       convertMove(sp, move1, &slice1);
+       convertMove(sp, move2, &slice2);
+       if (slice1.face == slice2.face) {
+               if (slice1.rotation == slice2.rotation) { /* CW or CCW */
+                       if (!opp)
+                               return True;
+               } else {
+                       if (opp)
+                               return True;
+               }
+       }
+#endif
+       return False;
+}
+#endif
+
+static Bool
+shuffle(ModeInfo * mi)
+{
+       skewbstruct *sp = &skewb[MI_SCREEN(mi)];
+       int      i, face, position;
+       SkewbMove   move;
+
+       for (face = 0; face < MAXFACES; face++) {
+               for (position = 0; position < MAXCUBES; position++) {
+                       sp->cubeLoc[face][position].face = face;
+                       sp->cubeLoc[face][position].rotation = TOP;
+               }
+       }
+       sp->storedmoves = MI_COUNT(mi);
+       if (sp->storedmoves < 0) {
+               if (sp->moves != NULL)
+                       (void) free((void *) sp->moves);
+               sp->moves = (SkewbMove *) NULL;
+               sp->storedmoves = NRAND(-sp->storedmoves) + 1;
+       }
+       if ((sp->storedmoves) && (sp->moves == NULL))
+               if ((sp->moves = (SkewbMove *) calloc(sp->storedmoves + 1,
+                               sizeof (SkewbMove))) == NULL) {
+                       return False;
+               }
+       if (MI_CYCLES(mi) <= 1) {
+               sp->anglestep = 180.0;
+       } else {
+               sp->anglestep = 180.0 / (GLfloat) (MI_CYCLES(mi));
+       }
+
+       for (i = 0; i < sp->storedmoves; i++) {
+               Bool condition;
+
+               do {
+                       move.face = NRAND(MAXFACES);
+                       move.direction = NRAND(2);
+                       move.position = NRAND(MAXORIENT);
+                       condition = True;
+                       /*
+                        * Some silly moves being made, weed out later....
+                        */
+               } while (!condition);
+               if (hideshuffling)
+                       evalmovement(mi, move);
+               sp->moves[i] = move;
+       }
+       sp->VX = 0.05;
+       if (NRAND(100) < 50)
+               sp->VX *= -1;
+       sp->VY = 0.05;
+       if (NRAND(100) < 50)
+               sp->VY *= -1;
+       sp->movement.face = NO_FACE;
+       sp->rotatestep = 0;
+       sp->action = hideshuffling ? ACTION_SOLVE : ACTION_SHUFFLE;
+       sp->shufflingmoves = 0;
+       sp->done = 0;
+       return True;
+}
+
+static void
+reshape(ModeInfo * mi, int width, int height)
+{
+       skewbstruct *sp = &skewb[MI_SCREEN(mi)];
+
+       glViewport(0, 0, sp->WindW = (GLint) width, sp->WindH = (GLint) height);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
+       glMatrixMode(GL_MODELVIEW);
+
+       sp->AreObjectsDefined[ObjFacit] = False;
+       sp->AreObjectsDefined[ObjCubit] = False;
+}
+
+static Bool
+pinit(ModeInfo * mi)
+{
+       glClearDepth(1.0);
+       glClearColor(0.0, 0.0, 0.0, 1.0);
+       glColor3f(1.0, 1.0, 1.0);
+
+       glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT0, GL_POSITION, position0);
+       glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT1, GL_POSITION, position1);
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+       glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_DEPTH_TEST);
+       glEnable(GL_NORMALIZE);
+       glEnable(GL_CULL_FACE);
+
+       glShadeModel(GL_FLAT);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
+
+       return (shuffle(mi));
+}
+
+static void
+free_skewb(skewbstruct *sp)
+{
+       if (sp->moves != NULL) {
+               (void) free((void *) sp->moves);
+               sp->moves = (SkewbMove *) NULL;
+       }
+}
+
+void
+release_skewb(ModeInfo * mi)
+{
+       if (skewb != NULL) {
+               int      screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       skewbstruct *sp = &skewb[screen];
+
+                       free_skewb(sp);
+                       if (sp->glx_context) {
+                               if (glIsList(objects)) {
+                                       glDeleteLists(objects, MaxObj);
+                                       objects = 0;
+                               }
+                       }
+               }
+               (void) free((void *) skewb);
+               skewb = (skewbstruct *) NULL;
+        }
+       FreeAllGL(mi);
+}
+
+void
+init_skewb(ModeInfo * mi)
+{
+       skewbstruct *sp;
+
+       if (skewb == NULL) {
+               if ((skewb = (skewbstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (skewbstruct))) == NULL)
+                       return;
+       }
+       sp = &skewb[MI_SCREEN(mi)];
+
+       sp->step = NRAND(180);
+       sp->PX = ((float) LRAND() / (float) MAXRAND) * 2.0 - 1.0;
+       sp->PY = ((float) LRAND() / (float) MAXRAND) * 2.0 - 1.0;
+
+       if ((sp->glx_context = init_GL(mi)) != NULL) {
+
+               reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               glDrawBuffer(GL_BACK);
+               if (!glIsList(objects))
+                       if ((objects = glGenLists(MaxObj)) == 0) {
+                               MI_CLEARWINDOW(mi);
+                               release_skewb(mi);
+                               return;
+                       }
+               if (!pinit(mi)) {
+                       free_skewb(sp);
+                       if (MI_IS_VERBOSE(mi)) {
+                                (void) fprintf(stderr,
+                                       "Could not allocate memory for skewb\n");
+                       }
+               }
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_skewb(ModeInfo * mi)
+{
+       Bool bounced = False;
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       skewbstruct *sp;
+
+       if (skewb == NULL)
+               return;
+       sp = &skewb[MI_SCREEN(mi)];
+       if ((sp->storedmoves) && (sp->moves == NULL))
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (!sp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(sp->glx_context));
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, -10.0);
+
+       sp->PX += sp->VX;
+       sp->PY += sp->VY;
+
+       if (sp->PY < -1) {
+               sp->PY += (-1) - (sp->PY);
+               sp->VY = -sp->VY;
+               bounced = True;
+       }
+       if (sp->PY > 1) {
+               sp->PY -= (sp->PY) - 1;
+               sp->VY = -sp->VY;
+               bounced = True;
+       }
+       if (sp->PX < -1) {
+               sp->PX += (-1) - (sp->PX);
+               sp->VX = -sp->VX;
+               bounced = True;
+       }
+       if (sp->PX > 1) {
+               sp->PX -= (sp->PX) - 1;
+               sp->VX = -sp->VX;
+               bounced = True;
+       }
+       if (bounced) {
+               sp->VX += ((float) LRAND() / (float) MAXRAND) * 0.02 - 0.01;
+               sp->VX += ((float) LRAND() / (float) MAXRAND) * 0.02 - 0.01;
+               if (sp->VX > 0.06)
+                       sp->VX = 0.06;
+               if (sp->VY > 0.06)
+                       sp->VY = 0.06;
+               if (sp->VX < -0.06)
+                       sp->VX = -0.06;
+               if (sp->VY < -0.06)
+                       sp->VY = -0.06;
+       }
+       if (!MI_IS_ICONIC(mi)) {
+               glTranslatef(sp->PX, sp->PY, 0);
+               glScalef(Scale4Window * sp->WindH / sp->WindW,
+                       Scale4Window, Scale4Window);
+       } else {
+               glScalef(Scale4Iconic * sp->WindH / sp->WindW,
+                       Scale4Iconic, Scale4Iconic);
+       }
+       glRotatef(sp->step * 100, 1, 0, 0);
+       glRotatef(sp->step * 95, 0, 1, 0);
+       glRotatef(sp->step * 90, 0, 0, 1);
+       if (!draw_cube(mi)) {
+               release_skewb(mi);
+               return;
+       }
+       glXSwapBuffers(display, window);
+
+#if 0
+       if (sp->action == ACTION_SHUFFLE) {
+               if (sp->done) {
+                       if (++sp->rotatestep > DELAY_AFTER_SHUFFLING) {
+                               sp->movement.face = NO_FACE;
+                               sp->rotatestep = 0;
+                               sp->action = ACTION_SOLVE;
+                               sp->done = 0;
+                       }
+               } else {
+                       if (sp->movement.face == NO_FACE) {
+                               if (sp->shufflingmoves < sp->storedmoves) {
+                                       sp->rotatestep = 0;
+                                       sp->movement = sp->moves[sp->shufflingmoves];
+                               } else {
+                                       sp->rotatestep = 0;
+                                       sp->done = 1;
+                               }
+                       } else {
+                               if (sp->rotatestep == 0) {
+                                       ;
+                               }
+                               sp->rotatestep += sp->anglestep;
+                               if (sp->rotatestep > 180) {
+                                       evalmovement(mi, sp->movement);
+                                       sp->shufflingmoves++;
+                                       sp->movement.face = NO_FACE;
+                               }
+                       }
+               }
+       } else {
+               if (sp->done) {
+                       if (++sp->rotatestep > DELAY_AFTER_SOLVING)
+                               if (!shuffle(mi)) {
+                                       free_skewb(sp);
+                                       if (MI_IS_VERBOSE(mi)) {
+                                                (void) fprintf(stderr,
+                                                       "Could not allocate memory for skewb\n");
+                                       }
+                               }
+               } else {
+                       if (sp->movement.face == NO_FACE) {
+                               if (sp->storedmoves > 0) {
+                                       sp->rotatestep = 0;
+                                       sp->movement = sp->moves[sp->storedmoves - 1];
+                                       sp->movement.direction = (sp->movement.direction +
+                                               (MAXORIENT / 2)) % MAXORIENT;
+                               } else {
+                                       sp->rotatestep = 0;
+                                       sp->done = 1;
+                               }
+                       } else {
+                               if (sp->rotatestep == 0) {
+                                       ;
+                               }
+                               sp->rotatestep += sp->anglestep;
+                               if (sp->rotatestep > 180) {
+                                       evalmovement(mi, sp->movement);
+                                       sp->storedmoves--;
+                                       sp->movement.face = NO_FACE;
+                               }
+                       }
+               }
+       }
+#endif
+
+       glPopMatrix();
+
+       glFlush();
+
+       sp->step += 0.05;
+}
+
+void
+change_skewb(ModeInfo * mi)
+{
+       skewbstruct *sp;
+
+       if (skewb == NULL)
+               return;
+       sp = &skewb[MI_SCREEN(mi)];
+
+       if (!sp->glx_context)
+               return;
+       if (!pinit(mi)) {
+               free_skewb(sp);
+               if (MI_IS_VERBOSE(mi)) {
+                        (void) fprintf(stderr,
+                               "Could not allocate memory for skewb\n");
+               }
+       }
+}
+
+#endif
diff --git a/modes/glx/sphere.c b/modes/glx/sphere.c
new file mode 100644 (file)
index 0000000..ed80ea7
--- /dev/null
@@ -0,0 +1,92 @@
+/* sphere, Copyright (c) 1998 David Konerding <dek@cgl.ucsf.edu>
+ * Utility function to create a unit sphere in GL.
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ *
+ *  8-Oct-98: dek           Released initial version of "glplanet"
+ * 21-Mar-01: jwz@jwz.org   Broke sphere routine out into its own file.
+ */
+
+#include "config.h"
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glx.h>
+
+/* Function for determining points on the surface of the sphere */
+static void
+parametric_sphere (float theta, float rho, GLfloat *vector)
+{
+  vector[0] = -sin(theta) * sin(rho);
+  vector[1] = cos(theta) * sin(rho);
+  vector[2] = cos(rho);
+}
+
+
+void
+unit_sphere (int stacks, int slices, Bool wire)
+{
+  int i, j;
+  float drho, dtheta;
+  float rho, theta;
+  GLfloat vector[3];
+  GLfloat ds, dt, t, s;
+
+  if (!wire)
+    glShadeModel(GL_SMOOTH);
+
+  /* Generate a sphere with quadrilaterals.
+   * Quad vertices are determined using a parametric sphere function.
+   * For fun, you could generate practically any parameteric surface and
+   * map an image onto it. 
+   */
+  drho = M_PI / stacks;
+  dtheta = 2.0 * M_PI / slices;
+  ds = 1.0 / slices;
+  dt = 1.0 / stacks;
+
+  glFrontFace(GL_CCW);
+  glBegin (wire ? GL_LINE_LOOP : GL_QUADS);
+
+  t = 0.0;
+  for (i=0; i < stacks; i++) {
+    rho = i * drho;
+    s = 0.0;
+    for (j=0; j < slices; j++) {
+      theta = j * dtheta;
+
+      glTexCoord2f (s,t);
+      parametric_sphere (theta, rho, vector);
+      glNormal3fv (vector);
+      parametric_sphere (theta, rho, vector);
+      glVertex3f (vector[0], vector[1], vector[2]);
+
+      glTexCoord2f (s,t+dt);
+      parametric_sphere (theta, rho+drho, vector);
+      glNormal3fv (vector);
+      parametric_sphere (theta, rho+drho, vector);
+      glVertex3f (vector[0], vector[1], vector[2]);
+
+      glTexCoord2f (s+ds,t+dt);
+      parametric_sphere (theta + dtheta, rho+drho, vector);
+      glNormal3fv (vector);
+      parametric_sphere (theta + dtheta, rho+drho, vector);
+      glVertex3f (vector[0], vector[1], vector[2]);
+
+      glTexCoord2f (s+ds, t);
+      parametric_sphere (theta + dtheta, rho, vector);
+      glNormal3fv (vector);
+      parametric_sphere (theta + dtheta, rho, vector);
+      glVertex3f (vector[0], vector[1], vector[2]);
+
+      s = s + ds;
+    }
+    t = t + dt;
+  }
+  glEnd();
+}
diff --git a/modes/glx/sphere.h b/modes/glx/sphere.h
new file mode 100644 (file)
index 0000000..0a46722
--- /dev/null
@@ -0,0 +1,22 @@
+/* tube, Copyright (c) 2001 Jamie Zawinski <jwz@jwz.org>
+ * Utility function to create a unit sphere in GL.
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ */
+
+#ifndef __SPHERE_H__
+#define __SPHERE_H__
+
+/* Creates a diamteter 1 sphere at 0, 0, 0.
+   stacks = number of north/south divisions (latitude)
+   slices = number of clockwise/counterclockwise divisions (longitude)
+ */
+extern void unit_sphere (int stacks, int slices, Bool wire);
+
+#endif /* __SPHERE_H__ */
diff --git a/modes/glx/sproingies.c b/modes/glx/sproingies.c
new file mode 100644 (file)
index 0000000..fe4a625
--- /dev/null
@@ -0,0 +1,864 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* sproingies.c - 3D sproingies */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)sproingies.c 5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ *  sproingies.c - Copyright 1996 by Ed Mackey, freely distributable.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 07-Dec-1996: Written.
+ */
+
+#ifdef STANDALONE
+#include "xlockmoreI.h"                /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_sproingies
+
+#include <GL/gl.h>
+#include "buildlwo.h"
+
+#define MAXSPROING 100
+#define T_COUNT 40
+#define BOOM_FRAME 50
+
+struct sPosColor {
+       int         x, y, z, frame, life;
+       GLfloat     r, g, b;
+};
+
+typedef struct {
+       int         rotx, roty, dist, wireframe, flatshade, groundlevel,
+                   maxsproingies, mono;
+       int         sframe, target_rx, target_ry, target_dist, target_count;
+       GLuint      sproingies[6], TopsSides, SproingieBoom;
+       struct sPosColor *positions;
+} sp_instance;
+
+static sp_instance *si_list = (sp_instance *) NULL;
+static int  active_screens = 0;
+
+void        SproingieSwap(void);
+
+extern struct lwo LWO_s1_1, LWO_s1_2, LWO_s1_3, LWO_s1_4;
+extern struct lwo LWO_s1_5, LWO_s1_6, LWO_s1_b;
+
+static int
+myrand(int range)
+{
+       return ((int) (((float) range) * LRAND() / (MAXRAND)));
+}
+
+static      GLuint
+build_TopsSides(int wireframe)
+{
+       GLuint      dl_num;
+       GLfloat     mat_color[4] =
+       {0.0, 0.0, 0.0, 1.0};
+
+       if ((dl_num = glGenLists(2)) == 0)
+               return (0);     /* 0 means out of display lists. */
+
+       /* Surface: Tops */
+       glNewList(dl_num, GL_COMPILE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(dl_num, 2);
+               return (0);
+       }
+       mat_color[0] = 0.392157;
+       mat_color[1] = 0.784314;
+       mat_color[2] = 0.941176;
+       if (wireframe)
+               glColor3fv(mat_color);
+       else {
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
+       }
+       glEndList();
+
+       /* Surface: Sides */
+       glNewList(dl_num + 1, GL_COMPILE);
+       if (glGetError() != GL_NO_ERROR) {
+               glDeleteLists(dl_num, 2);
+               return (0);
+       }
+       mat_color[0] = 0.156863;
+       mat_color[1] = 0.156863;
+       mat_color[2] = 0.392157;
+       if (wireframe)
+               glColor3fv(mat_color);
+       else {
+               glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
+       }
+       glEndList();
+       return (dl_num);
+}
+
+static void
+LayGround(int sx, int sy, int sz, int width, int height, sp_instance * si)
+{
+       int         x, y, z, w, h;
+       GLenum      begin_polygon;
+
+       if (si->wireframe)
+               begin_polygon = GL_LINE_LOOP;
+       else
+               begin_polygon = GL_POLYGON;
+
+       if (!si->wireframe) {
+               if (!si->mono)
+                       glCallList(si->TopsSides);      /* Render the tops */
+               glNormal3f(0.0, 1.0, 0.0);
+
+               for (h = 0; h < height; ++h) {
+                       x = sx + h;
+                       y = sy - (h << 1);
+                       z = sz + h;
+                       for (w = 0; w < width; ++w) {
+                               glBegin(begin_polygon);
+                               glVertex3i(x, y, z);
+                               glVertex3i(x, y, z - 1);
+                               glVertex3i(x + 1, y, z - 1);
+                               glVertex3i(x + 1, y, z);
+                               glEnd();
+                               glBegin(begin_polygon);
+                               glVertex3i(x + 1, y - 1, z);
+                               glVertex3i(x + 1, y - 1, z - 1);
+                               glVertex3i(x + 2, y - 1, z - 1);
+                               glVertex3i(x + 2, y - 1, z);
+                               glEnd();
+                               ++x;
+                               --z;
+                       }
+               }
+       }
+       if (!si->mono)
+               glCallList(si->TopsSides + 1);  /* Render the sides */
+       if (!si->wireframe)
+               glNormal3f(0.0, 0.0, 1.0);
+
+       for (h = 0; h < height; ++h) {
+               x = sx + h;
+               y = sy - (h << 1);
+               z = sz + h;
+               for (w = 0; w < width; ++w) {
+                       glBegin(begin_polygon);
+                       glVertex3i(x, y, z);
+                       glVertex3i(x + 1, y, z);
+                       glVertex3i(x + 1, y - 1, z);
+                       glVertex3i(x, y - 1, z);
+                       glEnd();
+                       glBegin(begin_polygon);
+                       glVertex3i(x + 1, y - 1, z);
+                       glVertex3i(x + 2, y - 1, z);
+                       glVertex3i(x + 2, y - 2, z);
+                       glVertex3i(x + 1, y - 2, z);
+/*-
+ * PURIFY 4.0.1 reports an unitialized memory read on the next line when using
+ * MesaGL 2.2 and -mono.  This has been fixed in MesaGL 2.3 and later. */
+                       glEnd();
+                       ++x;
+                       --z;
+               }
+       }
+
+       /* Render the other sides */
+       if (!si->wireframe)
+               glNormal3f(1.0, 0.0, 0.0);
+
+       for (h = 0; h < height; ++h) {
+               x = sx + h;
+               y = sy - (h << 1);
+               z = sz + h;
+               for (w = 0; w < width; ++w) {
+                       glBegin(begin_polygon);
+                       glVertex3i(x + 1, y, z);
+                       glVertex3i(x + 1, y, z - 1);
+                       glVertex3i(x + 1, y - 1, z - 1);
+                       glVertex3i(x + 1, y - 1, z);
+                       glEnd();
+                       glBegin(begin_polygon);
+                       glVertex3i(x + 2, y - 1, z);
+                       glVertex3i(x + 2, y - 1, z - 1);
+                       glVertex3i(x + 2, y - 2, z - 1);
+                       glVertex3i(x + 2, y - 2, z);
+                       glEnd();
+                       ++x;
+                       --z;
+               }
+       }
+
+       if (si->wireframe) {
+               if (!si->mono)
+                       glCallList(si->TopsSides);      /* Render the tops */
+
+               for (h = 0; h < height; ++h) {
+                       x = sx + h;
+                       y = sy - (h << 1);
+                       z = sz + h;
+                       for (w = 0; w < width; ++w) {
+                               glBegin(begin_polygon);
+                               glVertex3i(x, y, z);
+                               glVertex3i(x, y, z - 1);
+                               glVertex3i(x + 1, y, z - 1);
+                               glVertex3i(x + 1, y, z);
+                               glEnd();
+                               glBegin(begin_polygon);
+                               glVertex3i(x + 1, y - 1, z);
+                               glVertex3i(x + 1, y - 1, z - 1);
+                               glVertex3i(x + 2, y - 1, z - 1);
+                               glVertex3i(x + 2, y - 1, z);
+                               glEnd();
+                               ++x;
+                               --z;
+                       }
+               }
+       }
+}
+
+#define RESET_SPROINGIE (-30 + myrand(28))
+
+static void
+AdvanceSproingie(int t, sp_instance * si)
+{
+       int         g_higher, g_back, t2;
+       struct sPosColor *thisSproingie = &(si->positions[t]);
+       struct sPosColor *S2 = &(si->positions[0]);
+
+       if (thisSproingie->life > 0) {
+               if ((++(thisSproingie->frame)) > 11) {
+                       if (thisSproingie->frame >= BOOM_FRAME) {
+                               if ((thisSproingie->r -= 0.08) < 0.0)
+                                       thisSproingie->r = 0.0;
+                               if ((thisSproingie->g -= 0.08) < 0.0)
+                                       thisSproingie->g = 0.0;
+                               if ((thisSproingie->b -= 0.08) < 0.0)
+                                       thisSproingie->b = 0.0;
+                               if ((--(thisSproingie->life)) < 1) {
+                                       thisSproingie->life = RESET_SPROINGIE;
+                               }
+                               return;
+                       }
+                       thisSproingie->x += 1;
+                       thisSproingie->y -= 2;
+                       thisSproingie->z += 1;
+                       thisSproingie->frame = 0;
+
+                       for (t2 = 0; t2 < si->maxsproingies; ++t2) {
+                               if ((t2 != t) && (thisSproingie->x == S2->x) &&
+                                   (thisSproingie->y == S2->y) && (thisSproingie->z == S2->z) &&
+                                   (S2->life > 10) && (S2->frame < 6)) {
+#if 0
+                                       if (thisSproingie->life > S2->life) {
+                                               S2->life = 10;
+                                       } else {
+#endif
+                                               if (thisSproingie->life > 10) {
+                                                       thisSproingie->life = 10;
+                                                       thisSproingie->frame = BOOM_FRAME;
+                                                       if ((thisSproingie->r += 0.5) > 1.0)
+                                                               thisSproingie->r = 1.0;
+                                                       if ((thisSproingie->g += 0.5) > 1.0)
+                                                               thisSproingie->g = 1.0;
+                                                       if ((thisSproingie->b += 0.5) > 1.0)
+                                                               thisSproingie->b = 1.0;
+                                               }
+#if 0
+                                       }
+#endif
+                               }
+                               ++S2;
+                       }
+               }
+               if (!((thisSproingie->life == 10) &&
+                     (thisSproingie->frame > 0) &&
+                     (thisSproingie->frame < BOOM_FRAME))) {
+                       if ((--(thisSproingie->life)) < 1) {
+                               thisSproingie->life = RESET_SPROINGIE;
+                       } else if (thisSproingie->life < 9) {
+                               thisSproingie->frame -= 2;
+                       }
+               }               /* else wait here for frame 0 to come about. */
+       } else if (++(thisSproingie->life) >= 0) {
+               if (t > 1) {
+                       g_higher = -3 + myrand(5);
+                       g_back = -2 + myrand(5);
+               } else if (t == 1) {
+                       g_higher = -2 + myrand(3);
+                       g_back = -1 + myrand(3);
+               } else {
+                       g_higher = -1;
+                       g_back = 0;
+               }
+
+               thisSproingie->x = (-g_higher - g_back);
+               thisSproingie->y = (g_higher << 1);
+               thisSproingie->z = (g_back - g_higher);
+               thisSproingie->life = 40 + myrand(200);
+               thisSproingie->frame = -10;
+               thisSproingie->r = (GLfloat) (40 + myrand(200)) / 255.0;
+               thisSproingie->g = (GLfloat) (40 + myrand(200)) / 255.0;
+               thisSproingie->b = (GLfloat) (40 + myrand(200)) / 255.0;
+
+               for (t2 = 0; t2 < si->maxsproingies; ++t2) {
+                       if ((t2 != t) && (thisSproingie->x == S2->x) &&
+                           (thisSproingie->y == S2->y) && (thisSproingie->z == S2->z) &&
+                           (S2->life > 10) && (S2->frame < 0)) {
+                               /* If one is already being born, just wait. */
+                               thisSproingie->life = -1;
+                       }
+                       ++S2;
+               }
+       }
+}
+
+static void
+NextSproingie(int screen)
+{
+       sp_instance *si = &si_list[screen];
+       int         ddx, t;
+       struct sPosColor *thisSproingie = &(si->positions[0]);
+
+       if (++si->sframe > 11) {
+               si->sframe = 0;
+               for (t = 0; t < si->maxsproingies; ++t) {
+                       thisSproingie->x -= 1;
+                       thisSproingie->y += 2;
+                       thisSproingie->z -= 1;
+                       ++thisSproingie;
+               }
+       }
+       for (t = 0; t < si->maxsproingies; ++t) {
+               AdvanceSproingie(t, si);
+       }
+
+       if (si->target_count < 0) {     /* track to current target */
+               if (si->target_rx < si->rotx)
+                       --si->rotx;
+               else if (si->target_rx > si->rotx)
+                       ++si->rotx;
+
+               if (si->target_ry < si->roty)
+                       --si->roty;
+               else if (si->target_ry > si->roty)
+                       ++si->roty;
+
+               ddx = (si->target_dist - si->dist) / 8;
+               if (ddx)
+                       si->dist += ddx;
+               else if (si->target_dist < si->dist)
+                       --si->dist;
+               else if (si->target_dist > si->dist)
+                       ++si->dist;
+
+               if ((si->target_rx == si->rotx) && (si->target_ry == si->roty) &&
+                   (si->target_dist == si->dist)) {
+                       si->target_count = T_COUNT;
+                       if (si->target_dist <= 32)
+                               si->target_count >>= 2;
+               }
+       } else if (--si->target_count < 0) {    /* make up new target */
+               si->target_rx = myrand(100) - 35;
+               si->target_ry = -myrand(90);
+               si->target_dist = 32 << myrand(2);      /* could be 32, 64, or 128, (previously or 256) */
+
+               if (si->target_dist >= si->dist)        /* no duplicate distances */
+                       si->target_dist <<= 1;
+       }
+       /* Otherwise just hang loose for a while here */
+}
+
+#ifdef __AUXFUNCS__
+void
+PrintEm(void)
+{
+       int         t, count = 0;
+
+       for (t = 0; t < maxsproingies; ++t) {
+               if (positions[t].life > 0)
+                       ++count;
+       }
+       (void) printf("RotX: %d, RotY: %d, Dist: %d.  Targets: X %d, Y %d, D %d.  Visible: %d\n",
+                rotx, roty, dist, target_rx, target_ry, target_dist, count);
+}
+
+void
+ResetEm(void)
+{
+       int         t;
+
+       for (t = 0; t < maxsproingies; ++t) {
+               positions[t].x = 0;
+               positions[t].y = 0;
+               positions[t].z = 0;
+               positions[t].life = -2;
+               positions[t].frame = 0;
+       }
+}
+
+void
+distAdd(void)
+{
+       if (dist < (1 << 16 << 4))
+               dist <<= 1;
+}
+
+void
+distSubtract(void)
+{
+       if (dist > 1)
+               dist >>= 1;
+}
+
+void
+rotxAdd(void)
+{
+       rotx = (rotx + 5) % 360;
+}
+
+void
+rotxSubtract(void)
+{
+       rotx = (rotx - 5) % 360;
+}
+
+void
+rotyAdd(void)
+{
+       roty = (roty + 5) % 360;
+}
+
+void
+rotySubtract(void)
+{
+       roty = (roty - 5) % 360;
+}
+
+void
+rotxBAdd(void)
+{
+       rotx = (rotx + 45) % 360;
+}
+
+void
+rotxBSubtract(void)
+{
+       rotx = (rotx - 45) % 360;
+}
+
+void
+rotyBAdd(void)
+{
+       roty = (roty + 45) % 360;
+}
+
+void
+rotyBSubtract(void)
+{
+       roty = (roty - 45) % 360;
+}
+
+#endif
+
+static void
+RenderSproingie(int t, sp_instance * si)
+{
+       GLfloat     scale, pointsize, mat_color[4] =
+       {0.0, 0.0, 0.0, 1.0};
+       GLdouble    clipplane[4] =
+       {0.0, 1.0, 0.0, 0.0};
+       struct sPosColor *thisSproingie = &(si->positions[t]);
+
+       if (thisSproingie->life < 1)
+               return;
+
+       glPushMatrix();
+
+       if (!si->mono) {
+               mat_color[0] = thisSproingie->r;
+               mat_color[1] = thisSproingie->g;
+               mat_color[2] = thisSproingie->b;
+               if (si->wireframe)
+                       glColor3fv(mat_color);
+               else {
+                       glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
+               }
+       }
+       if (thisSproingie->frame < 0) {
+               glEnable(GL_CLIP_PLANE0);
+               glTranslatef((GLfloat) (thisSproingie->x),
+                            (GLfloat) (thisSproingie->y) +
+                            ((GLfloat) (thisSproingie->frame) / 9.0),
+                            (GLfloat) (thisSproingie->z));
+               clipplane[3] = ((GLdouble) (thisSproingie->frame) / 9.0) +
+                       (si->wireframe ? 0.0 : 0.1);
+               glClipPlane(GL_CLIP_PLANE0, clipplane);
+               glCallList(si->sproingies[0]);
+               glDisable(GL_CLIP_PLANE0);
+       } else if (thisSproingie->frame >= BOOM_FRAME) {
+               glTranslatef((GLfloat) (thisSproingie->x) + 0.5,
+                            (GLfloat) (thisSproingie->y) + 0.5,
+                            (GLfloat) (thisSproingie->z) - 0.5);
+               scale = (GLfloat) (1 << (thisSproingie->frame - BOOM_FRAME));
+               glScalef(scale, scale, scale);
+               if (!si->wireframe) {
+                       if (!si->mono)
+                               glColor3fv(mat_color);
+                       glDisable(GL_LIGHTING);
+               }
+               pointsize = (GLfloat) ((BOOM_FRAME + 8) - thisSproingie->frame) -
+                       (si->dist / 64.0);
+               glPointSize((pointsize < 1.0) ? 1.0 : pointsize);
+/*-
+ * PURIFY 4.0.1 reports an unitialized memory read on the next line when using
+ * MesaGL 2.2.  This has been tracked to MesaGL 2.2 src/points.c line 313. */
+               glCallList(si->SproingieBoom);
+               glPointSize(1.0);
+               if (!si->wireframe) {
+                       glEnable(GL_LIGHTING);
+               }
+       } else if (thisSproingie->frame > 5) {
+               glTranslatef((GLfloat) (thisSproingie->x + 1),
+                            (GLfloat) (thisSproingie->y - 1), (GLfloat) (thisSproingie->z - 1));
+               glRotatef((GLfloat) - 90.0, 0.0, 1.0, 0.0);
+               glCallList(si->sproingies[thisSproingie->frame - 6]);
+       } else {
+               glTranslatef((GLfloat) (thisSproingie->x), (GLfloat) (thisSproingie->y),
+                            (GLfloat) (thisSproingie->z));
+               glCallList(si->sproingies[thisSproingie->frame]);
+       }
+
+       glPopMatrix();
+
+}
+
+static void
+ComputeGround(sp_instance * si)
+{
+       int         g_higher, g_back, g_width, g_height;
+
+       /* higher: x-1, y+2, z-1 */
+       /* back: x-1, y, z+1 */
+
+       if (si->groundlevel == 0) {
+               g_back = 2;
+               g_width = 5;
+       } else if (si->groundlevel == 1) {
+               g_back = 4;
+               g_width = 8;
+       } else {
+               g_back = 8;
+               g_width = 16;
+       }
+
+       if ((g_higher = si->dist >> 3) < 4)
+               g_higher = 4;
+       if (g_higher > 16)
+               g_higher = 16;
+       g_height = g_higher << 1;
+
+       if (si->rotx < -10)
+               g_higher += (g_higher >> 2);
+       else if (si->rotx > 10)
+               g_higher -= (g_higher >> 2);
+
+#if 0
+       if (si->dist > 128) {
+               ++g_higher;
+               ++g_back;
+               g_back <<= 1;
+       } else if (si->dist > 64) {
+               ++g_higher;
+               ++g_back;
+       } else if (si->dist > 32) {
+               /* nothing special */
+       } else {
+               if (g_higher > 2) {
+                       g_higher = g_back = 4;
+               }
+       }
+#endif
+
+       /* startx, starty, startz, width, height */
+       LayGround((-g_higher - g_back), (g_higher << 1), (g_back - g_higher),
+                 (g_width), (g_height), si);
+}
+
+void
+DisplaySproingies(int screen)
+{
+       sp_instance *si = &si_list[screen];
+       int         t;
+       GLfloat     position[] =
+       {8.0, 5.0, -2.0, 0.1};
+
+       if (si->wireframe)
+               glClear(GL_COLOR_BUFFER_BIT);
+       else
+               glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       glPushMatrix();
+       glTranslatef(0.0, 0.0, -(GLfloat) (si->dist) / 16.0);   /* viewing transform  */
+       glRotatef((GLfloat) si->rotx, 1.0, 0.0, 0.0);
+       glRotatef((GLfloat) si->roty, 0.0, 1.0, 0.0);
+
+       if (!si->wireframe)
+               glLightfv(GL_LIGHT0, GL_POSITION, position);
+
+#if 0                          /* Show light pos */
+       glPushMatrix();
+       glTranslatef(position[0], position[1], position[2]);
+       glColor3f(1.0, 1.0, 1.0);
+       if (!si->wireframe) {
+               glDisable(GL_LIGHTING);
+       }
+       glCallList(si->SproingieBoom);
+       if (!si->wireframe) {
+               glEnable(GL_LIGHTING);
+       }
+       glPopMatrix();
+#endif
+
+       glTranslatef((GLfloat) si->sframe * (-1.0 / 12.0) - 0.75,
+                    (GLfloat) si->sframe * (2.0 / 12.0) - 0.5,
+                    (GLfloat) si->sframe * (-1.0 / 12.0) + 0.75);
+
+       if (si->wireframe)
+               ComputeGround(si);
+
+       for (t = 0; t < si->maxsproingies; ++t) {
+               RenderSproingie(t, si);
+       }
+
+       if (!si->wireframe)
+               ComputeGround(si);
+
+       glPopMatrix();
+       glFlush();
+
+       SproingieSwap();
+}
+
+void
+NextSproingieDisplay(int screen)
+{
+       NextSproingie(screen);
+       DisplaySproingies(screen);
+}
+
+#if 0
+#include <GL/glu.h>
+void
+ReshapeSproingies(int w, int h)
+{
+       glViewport(0, 0, w, h);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       gluPerspective(65.0, (GLfloat) w / (GLfloat) h, 0.1, 2000.0);   /* was 200000.0 */
+       glMatrixMode(GL_MODELVIEW);
+       glLoadIdentity();
+}
+
+#endif
+
+void
+CleanupSproingies(int screen)
+{
+       sp_instance *si = &si_list[screen];
+       int         t;
+
+       for (t = 0; t < 6; ++t)
+               if (glIsList(si->sproingies[t])) {
+                       glDeleteLists(si->sproingies[t], 1);
+                       si->sproingies[t] = 0;
+               }
+       if (glIsList(si->TopsSides)) {
+               glDeleteLists(si->TopsSides, 2);
+               si->TopsSides = 0;
+       }
+       if (glIsList(si->SproingieBoom)) {
+               glDeleteLists(si->SproingieBoom, 1);
+               si->SproingieBoom = 0;
+       }
+       if (si->positions) {
+               --active_screens;
+               (void) free((void *) (si->positions));
+               si->positions = (struct sPosColor *) NULL;
+       }
+       if ((active_screens == 0) && si_list) {
+               (void) free((void *) (si_list));
+               si_list = (sp_instance *) NULL;
+       }
+}
+
+Bool
+InitSproingies(int wfmode, int grnd, int mspr, int screen, int numscreens,
+              int mono)
+{
+       GLfloat     ambient[] =
+       {0.2, 0.2, 0.2, 1.0};
+       GLfloat     position[] =
+       {10.0, 1.0, 1.0, 10.0};
+       GLfloat     mat_diffuse[] =
+       {0.6, 0.6, 0.6, 1.0};
+       GLfloat     mat_specular[] =
+       {0.8, 0.8, 0.8, 1.0};
+       GLfloat     mat_shininess[] =
+       {50.0};
+
+       sp_instance *si;
+       int         t;
+
+       if (si_list == NULL) {
+               if ((si_list = (sp_instance *) calloc(numscreens,
+                                             sizeof (sp_instance))) == NULL)
+                       return False;
+       }
+       si = &si_list[screen];
+
+       active_screens++;
+       CleanupSproingies(screen);
+
+       if (mspr < 0)
+               mspr = 0;
+       if (mspr >= MAXSPROING)
+               mspr = MAXSPROING - 1;
+
+       si->rotx = 0;
+       si->roty = -45;
+       si->dist = (16 << 2);
+       si->sframe = 0;
+       si->target_count = 0;
+       si->mono = mono;
+
+       si->wireframe = si->flatshade = 0;
+
+       if (wfmode == 2)
+               si->flatshade = 1;
+       else if (wfmode)
+               si->wireframe = 1;
+
+       si->groundlevel = grnd;
+       si->maxsproingies = mspr;
+
+       if (si->maxsproingies) {
+               if ((si->positions = (struct sPosColor *) calloc(si->maxsproingies,
+                                                 sizeof (struct sPosColor))) == NULL) {
+                       si->maxsproingies = 0;
+                       CleanupSproingies(screen);
+                       return False;
+               }
+       }
+       for (t = 0; t < si->maxsproingies; ++t) {
+               si->positions[t].x = 0;
+               si->positions[t].y = 0;
+               si->positions[t].z = 0;
+               si->positions[t].life = (-t * ((si->maxsproingies > 19) ? 1 : 4)) - 2;
+               si->positions[t].frame = 0;
+       }
+
+#if 0                          /* Test boom */
+       si->positions[0].x = 0;
+       si->positions[0].y = 0;
+       si->positions[0].z = 0;
+       si->positions[0].life = 10;
+       si->positions[0].frame = BOOM_FRAME;
+       si->positions[0].r = 0.656863;
+       si->positions[0].g = 1.0;
+       si->positions[0].b = 0.656863;
+#endif
+
+       if (!(si->TopsSides = build_TopsSides(si->wireframe))) {
+               (void) fprintf(stderr, "build_TopsSides\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+
+       if (!(si->sproingies[0] = BuildLWO(si->wireframe, &LWO_s1_1))) {
+               (void) fprintf(stderr, "BuildLWO - 1\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+       if (!(si->sproingies[1] = BuildLWO(si->wireframe, &LWO_s1_2))) {
+               (void) fprintf(stderr, "BuildLWO - 2\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+       if (!(si->sproingies[2] = BuildLWO(si->wireframe, &LWO_s1_3))) {
+               (void) fprintf(stderr, "BuildLWO - 3\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+       if (!(si->sproingies[3] = BuildLWO(si->wireframe, &LWO_s1_4))) {
+               (void) fprintf(stderr, "BuildLWO - 4\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+       if (!(si->sproingies[4] = BuildLWO(si->wireframe, &LWO_s1_5))) {
+               (void) fprintf(stderr, "BuildLWO - 5\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+       if (!(si->sproingies[5] = BuildLWO(si->wireframe, &LWO_s1_6))) {
+               (void) fprintf(stderr, "BuildLWO - 6\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+       if (!(si->SproingieBoom = BuildLWO(si->wireframe, &LWO_s1_b))) {
+               (void) fprintf(stderr, "BuildLWO - b\n");
+               CleanupSproingies(screen);
+               return False;
+       }
+
+       if (si->wireframe) {
+               glShadeModel(GL_FLAT);
+               glDisable(GL_LIGHTING);
+       } else {
+               if (si->flatshade) {
+                       glShadeModel(GL_FLAT);
+                       position[0] = 1.0;
+                       position[3] = 0.0;
+               }
+               glEnable(GL_LIGHTING);
+               glEnable(GL_LIGHT0);
+               glDepthFunc(GL_LEQUAL);
+               glEnable(GL_DEPTH_TEST);
+
+               glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+               glLightfv(GL_LIGHT0, GL_POSITION, position);
+
+               glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
+
+               /* glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); */
+               glCullFace(GL_BACK);
+               glEnable(GL_CULL_FACE);
+
+               glFrontFace(GL_CW);
+               /* glEnable(GL_NORMALIZE); */
+       }
+       return True;
+}
+
+#endif
+
+/* End of sproingies.c */
diff --git a/modes/glx/sproingiewrap.c b/modes/glx/sproingiewrap.c
new file mode 100644 (file)
index 0000000..8a6fd2b
--- /dev/null
@@ -0,0 +1,255 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* sproingiewrap.c - sproingies wrapper */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)sproingiewrap.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * sproingiewrap.c - Copyright 1996 Sproingie Technologies Incorporated.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ *    Programming:  Ed Mackey, http://www.netaxs.com/~emackey/
+ *    Sproingie 3D objects modeled by:  Al Mackey, al@iam.com
+ *       (using MetaNURBS in NewTek's Lightwave 3D v5).
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 26-Apr-1997: Added glPointSize() calls around explosions, plus other fixes.
+ * 28-Mar-1997: Added size support.
+ * 22-Mar-1997: Updated to use glX interface instead of xmesa one.
+ *              Also, support for multiscreens added.
+ * 20-Mar-1997: Updated for xlockmore v4.02alpha7 and higher, using
+ *              xlockmore's built-in Mesa/OpenGL support instead of
+ *              my own.  Submitted for inclusion in xlockmore.
+ * 09-Dec-1996: Written.
+ */
+
+/*-
+ * The sproingies have six "real" frames, (s1_1 to s1_6) that show a
+ * sproingie jumping off a block, headed down and to the right.  But
+ * the program thinks of sproingies as having twelve "virtual" frames,
+ * with the latter six being copies of the first, only lowered and
+ * rotated by 90 degrees (jumping to the left).  So after going
+ * through 12 frames, a sproingie has gone down two rows but not
+ * moved horizontally.
+ *
+ * To have the sproingies randomly choose left/right jumps at each
+ * block, the program should go back to thinking of only 6 frames,
+ * and jumping down only one row when it is done.  Then it can pick a
+ * direction for the next row.
+ *
+ * (Falling off the end might not be so bad either.  :) )
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Sproingies"
+#define HACK_INIT init_sproingies
+#define HACK_DRAW draw_sproingies
+#define sproingies_opts xlockmore_opts
+#define DEFAULTS "*delay: 100 \n" \
+ "*count: 5 \n" \
+ "*cycles: 0 \n" \
+ "*size: 0 \n" \
+ "*wireframe: False \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_sproingies
+
+ModeSpecOpt sproingies_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   sproingies_description =
+{"sproingies", "init_sproingies", "draw_sproingies", "release_sproingies",
+ "refresh_sproingies", "init_sproingies", NULL, &sproingies_opts,
+ 1000, 5, 0, 400, 64, 1.0, "",
+ "Shows Sproingies!  Nontoxic.  Safe for pets and small children", 0, NULL};
+
+#endif
+
+#define MINSIZE 32
+
+#include <GL/glu.h>
+#include <time.h>
+
+void        NextSproingie(int screen);
+void        NextSproingieDisplay(int screen);
+void        DisplaySproingies(int screen);
+
+#if 0
+void        ReshapeSproingies(int w, int h);
+
+#endif
+void        CleanupSproingies(int screen);
+Bool        InitSproingies(int wfmode, int grnd, int mspr, int screen, int numscreens, int mono);
+
+typedef struct {
+       GLfloat     view_rotx, view_roty, view_rotz;
+       GLint       gear1, gear2, gear3;
+       GLfloat     angle;
+       GLuint      limit;
+       GLuint      count;
+       GLXContext *glx_context;
+       int         mono;
+       Window      window;
+       int         init;
+} sproingiesstruct;
+
+static sproingiesstruct *sproingies = (sproingiesstruct *) NULL;
+
+static Display *swap_display;
+static Window swap_window;
+
+void
+SproingieSwap(void)
+{
+       glFinish();
+       glXSwapBuffers(swap_display, swap_window);
+}
+
+
+void
+init_sproingies(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+
+       int         cycles = MI_CYCLES(mi);
+       int         count = MI_COUNT(mi);
+       int         size = MI_SIZE(mi);
+       int         wfmode = 0, grnd, mspr, w, h;
+       sproingiesstruct *sp;
+
+       if (sproingies == NULL) {
+               if ((sproingies = (sproingiesstruct *) calloc(MI_NUM_SCREENS(mi),
+                                        sizeof (sproingiesstruct))) == NULL)
+                       return;
+       }
+       sp = &sproingies[MI_SCREEN(mi)];
+
+       sp->mono = (MI_IS_MONO(mi) ? 1 : 0);
+       sp->window = window;
+       if ((sp->glx_context = init_GL(mi)) != NULL) {
+
+               if ((cycles & 1) || MI_IS_WIREFRAME(mi))
+                       wfmode = 1;
+               grnd = (cycles >> 1);
+               if (grnd > 2)
+                       grnd = 2;
+
+               mspr = count;
+               if (mspr > 100)
+                       mspr = 100;
+
+               /* wireframe, ground, maxsproingies */
+               if (!InitSproingies(wfmode, grnd, mspr, MI_SCREEN(mi),
+                                MI_NUM_SCREENS(mi), sp->mono)) {
+                       return;
+               }
+               sp->init = True;
+               /* Viewport is specified size if size >= MINSIZE && size < screensize */
+               if (size <= 1) {
+                       w = MI_WIDTH(mi);
+                       h = MI_HEIGHT(mi);
+               } else if (size < MINSIZE) {
+                       w = MINSIZE;
+                       h = MINSIZE;
+               } else {
+                       w = (size > MI_WIDTH(mi)) ? MI_WIDTH(mi) : size;
+                       h = (size > MI_HEIGHT(mi)) ? MI_HEIGHT(mi) : size;
+               }
+
+               glViewport((MI_WIDTH(mi) - w) / 2, (MI_HEIGHT(mi) - h) / 2, w, h);
+               glMatrixMode(GL_PROJECTION);
+               glLoadIdentity();
+               gluPerspective(65.0, (GLfloat) w / (GLfloat) h, 0.1, 2000.0);   /* was 200000.0 */
+               glMatrixMode(GL_MODELVIEW);
+               glLoadIdentity();
+
+               swap_display = display;
+               swap_window = window;
+               DisplaySproingies(MI_SCREEN(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+/* ARGSUSED */
+void
+draw_sproingies(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       sproingiesstruct *sp;
+
+       if (sproingies == NULL)
+               return;
+       sp = &sproingies[MI_SCREEN(mi)];
+       if (!sp->init)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (!sp->glx_context)
+               return;
+
+       glDrawBuffer(GL_BACK);
+       glXMakeCurrent(display, window, *(sp->glx_context));
+
+       swap_display = display;
+       swap_window = window;
+
+       NextSproingieDisplay(MI_SCREEN(mi));    /* It will swap. */
+}
+
+void
+refresh_sproingies(ModeInfo * mi)
+{
+       /* No need to do anything here... The whole screen is updated
+        * every frame anyway.  Otherwise this would be just like
+        * draw_sproingies, above, but replace NextSproingieDisplay(...)
+        * with DisplaySproingies(...).
+        */
+}
+
+void
+release_sproingies(ModeInfo * mi)
+{
+       if (sproingies != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       sproingiesstruct *sp = &sproingies[screen];
+
+                       if (sp->glx_context) {
+
+                               glXMakeCurrent(MI_DISPLAY(mi), sp->window, *(sp->glx_context));
+                               CleanupSproingies(screen);
+                       }
+               }
+
+               (void) free((void *) sproingies);
+               sproingies = (sproingiesstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+#endif
+
+/* End of sproingiewrap.c */
diff --git a/modes/glx/stairs.c b/modes/glx/stairs.c
new file mode 100644 (file)
index 0000000..5ee4766
--- /dev/null
@@ -0,0 +1,516 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* stairs --- Infinite Stairs, and Escher-like scene. */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)stairs.c     5.01 2001/03/01 xlockmore";
+
+#endif
+
+#undef DEBUG_LISTS
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * This mode shows some interesting scenes that are impossible OR very
+ * weird to build in the real universe. Much of the scenes are inspirated
+ * on Mauritz Cornelis stairs's works which derivated the mode's name.
+ * M.C. Escher (1898-1972) was a dutch artist and many people prefer to
+ * say he was a mathematician.
+ *
+ * Thanks goes to Brian Paul for making it possible and inexpensive to use
+ * OpenGL at home.
+ *
+ * Since I'm not a native English speaker, my apologies for any grammatical
+ * mistakes.
+ *
+ * My e-mail address is
+ * m-vianna@usa.net
+ *
+ * Marcelo F. Vianna (Jun-01-1997)
+ *
+ * Revision History:
+ * 01-Mar-2001: Added FPS stuff - Eric Lassauge <lassauge@mail.dotcom.fr>
+ * 01-Nov-2000: Allocation checks
+ * 07-Jan-1998: This would be a scene for the escher mode, but now escher mode
+ *              was splitted in different modes for each scene. This is the
+ *              initial release and is not working yet.
+ *              Marcelo F. Vianna.
+ */
+
+/*-
+ * Texture mapping is only available on RGBA contexts, Mono and color index
+ * visuals DO NOT support texture mapping in OpenGL.
+ *
+ * BUT Mesa do implements RGBA contexts in pseudo color visuals, so texture
+ * mapping shuld work on PseudoColor, DirectColor, TrueColor using Mesa. Mono
+ * is not officially supported for both OpenGL and Mesa, but seems to not crash
+ * Mesa.
+ *
+ * In real OpenGL, PseudoColor DO NOT support texture map (as far as I know).
+ */
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "stairs"
+#define HACK_INIT init_stairs
+#define HACK_DRAW draw_stairs
+#define stairs_opts xlockmore_opts
+#define DEFAULTS "*delay: 200000 \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_stairs
+
+#include <GL/glu.h>
+#include "e_textures.h"
+
+ModeSpecOpt stairs_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   stairs_description =
+{"stairs", "init_stairs", "draw_stairs", "release_stairs",
+ "draw_stairs", "change_stairs", NULL, &stairs_opts,
+ 1000, 1, 1, 1, 4, 1.0, "",
+ "Shows Infinite Stairs, an Escher-like scene", 0, NULL};
+
+#endif
+
+#define Scale4Window               0.3
+#define Scale4Iconic               0.4
+
+#define sqr(A)                     ((A)*(A))
+
+#ifndef Pi
+#define Pi                         M_PI
+#endif
+
+#if 0
+#define ObjSphere    0
+#define MaxObj       1
+#endif
+
+/*************************************************************************/
+
+typedef struct {
+       GLint       WindH, WindW;
+       GLfloat     step;
+       Bool        direction;
+#if 0
+       Bool        AreObjectsDefined[MaxObj];
+#endif
+       int         sphere_position;
+       GLXContext *glx_context;
+} stairsstruct;
+
+static float front_shininess[] =
+{60.0};
+static float front_specular[] =
+{0.7, 0.7, 0.7, 1.0};
+static float ambient[] =
+{0.0, 0.0, 0.0, 1.0};
+static float diffuse[] =
+{1.0, 1.0, 1.0, 1.0};
+static float position0[] =
+{1.0, 1.0, 1.0, 0.0};
+static float position1[] =
+{-1.0, -1.0, 1.0, 0.0};
+static float lmodel_ambient[] =
+{0.5, 0.5, 0.5, 1.0};
+static float lmodel_twoside[] =
+{GL_TRUE};
+
+#if 0
+static float MaterialRed[] =
+{0.7, 0.0, 0.0, 1.0};
+static float MaterialGreen[] =
+{0.1, 0.5, 0.2, 1.0};
+static float MaterialBlue[] =
+{0.0, 0.0, 0.7, 1.0};
+static float MaterialCyan[] =
+{0.2, 0.5, 0.7, 1.0};
+static float MaterialMagenta[] =
+{0.6, 0.2, 0.5, 1.0};
+static float MaterialGray[] =
+{0.2, 0.2, 0.2, 1.0};
+static float MaterialGray5[] =
+{0.5, 0.5, 0.5, 1.0};
+static float MaterialGray6[] =
+{0.6, 0.6, 0.6, 1.0};
+static float MaterialGray8[] =
+{0.8, 0.8, 0.8, 1.0};
+
+#endif
+static float MaterialYellow[] =
+{0.7, 0.7, 0.0, 1.0};
+static float MaterialWhite[] =
+{0.7, 0.7, 0.7, 1.0};
+
+static float positions[] =
+{
+       -2.5, 4.0, 0.0,         /* First one is FUDGED :) */
+       -3.0, 3.25, 1.0,
+       -3.0, 4.4, 1.5,
+       -3.0, 3.05, 2.0,
+       -3.0, 4.2, 2.5,
+
+       -3.0, 2.85, 3.0,
+       -2.5, 4.0, 3.0,
+       -2.0, 2.75, 3.0,
+       -1.5, 3.9, 3.0,
+       -1.0, 2.65, 3.0,
+       -0.5, 3.8, 3.0,
+       0.0, 2.55, 3.0,
+       0.5, 3.7, 3.0,
+       1.0, 2.45, 3.0,
+       1.5, 3.6, 3.0,
+       2.0, 2.35, 3.0,
+
+       2.0, 3.5, 2.5,
+       2.0, 2.25, 2.0,
+       2.0, 3.4, 1.5,
+       2.0, 2.15, 1.0,
+       2.0, 3.3, 0.5,
+       2.0, 2.05, 0.0,
+       2.0, 3.2, -0.5,
+       2.0, 1.95, -1.0,
+       2.0, 3.1, -1.5,
+       2.0, 1.85, -2.0,
+
+       1.5, 2.9, -2.0,
+       1.0, 1.65, -2.0,
+       0.5, 2.7, -2.0,
+       0.0, 1.55, -2.0,
+       -0.5, 2.5, -2.0,
+       -1.0, 1.45, -2.0,
+};
+
+#define NPOSITIONS ((sizeof positions) / (sizeof positions[0]))
+
+static stairsstruct *stairs = (stairsstruct *) NULL;
+#if 0
+static GLuint objects = 0;
+#endif
+
+#define PlankWidth      3.0
+#define PlankHeight     0.35
+#define PlankThickness  0.15
+
+static Bool
+mySphere(float radius)
+{
+       GLUquadricObj *quadObj;
+
+       if ((quadObj = gluNewQuadric()) == 0)
+               return False;
+       gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
+       gluSphere(quadObj, radius, 16, 16);
+       gluDeleteQuadric(quadObj);
+       return True;
+}
+
+static void
+draw_block(GLfloat width, GLfloat height, GLfloat thickness)
+{
+       glBegin(GL_QUADS);
+       glNormal3f(0, 0, 1);
+       glTexCoord2f(0, 0);
+       glVertex3f(-width, -height, thickness);
+       glTexCoord2f(1, 0);
+       glVertex3f(width, -height, thickness);
+       glTexCoord2f(1, 1);
+       glVertex3f(width, height, thickness);
+       glTexCoord2f(0, 1);
+       glVertex3f(-width, height, thickness);
+       glNormal3f(0, 0, -1);
+       glTexCoord2f(0, 0);
+       glVertex3f(-width, height, -thickness);
+       glTexCoord2f(1, 0);
+       glVertex3f(width, height, -thickness);
+       glTexCoord2f(1, 1);
+       glVertex3f(width, -height, -thickness);
+       glTexCoord2f(0, 1);
+       glVertex3f(-width, -height, -thickness);
+       glNormal3f(0, 1, 0);
+       glTexCoord2f(0, 0);
+       glVertex3f(-width, height, thickness);
+       glTexCoord2f(1, 0);
+       glVertex3f(width, height, thickness);
+       glTexCoord2f(1, 1);
+       glVertex3f(width, height, -thickness);
+       glTexCoord2f(0, 1);
+       glVertex3f(-width, height, -thickness);
+       glNormal3f(0, -1, 0);
+       glTexCoord2f(0, 0);
+       glVertex3f(-width, -height, -thickness);
+       glTexCoord2f(1, 0);
+       glVertex3f(width, -height, -thickness);
+       glTexCoord2f(1, 1);
+       glVertex3f(width, -height, thickness);
+       glTexCoord2f(0, 1);
+       glVertex3f(-width, -height, thickness);
+       glNormal3f(1, 0, 0);
+       glTexCoord2f(0, 0);
+       glVertex3f(width, -height, thickness);
+       glTexCoord2f(1, 0);
+       glVertex3f(width, -height, -thickness);
+       glTexCoord2f(1, 1);
+       glVertex3f(width, height, -thickness);
+       glTexCoord2f(0, 1);
+       glVertex3f(width, height, thickness);
+       glNormal3f(-1, 0, 0);
+       glTexCoord2f(0, 0);
+       glVertex3f(-width, height, thickness);
+       glTexCoord2f(1, 0);
+       glVertex3f(-width, height, -thickness);
+       glTexCoord2f(1, 1);
+       glVertex3f(-width, -height, -thickness);
+       glTexCoord2f(0, 1);
+       glVertex3f(-width, -height, thickness);
+       glEnd();
+}
+
+static Bool
+draw_stairs_internal(ModeInfo * mi)
+{
+       stairsstruct *sp = &stairs[MI_SCREEN(mi)];
+       GLfloat     X;
+
+       glPushMatrix();
+       glPushMatrix();
+       glTranslatef(-3.0, 0.1, 2.0);
+       for (X = 0; X < 2; X++) {
+               draw_block(0.5, 2.7 + 0.1 * X, 0.5);
+               glTranslatef(0.0, 0.1, -1.0);
+       }
+       glPopMatrix();
+       glTranslatef(-3.0, 0.0, 3.0);
+       glPushMatrix();
+
+       for (X = 0; X < 6; X++) {
+               draw_block(0.5, 2.6 - 0.1 * X, 0.5);
+               glTranslatef(1.0, -0.1, 0.0);
+       }
+       glTranslatef(-1.0, -0.9, -1.0);
+       for (X = 0; X < 5; X++) {
+               draw_block(0.5, 3.0 - 0.1 * X, 0.5);
+               glTranslatef(0.0, 0.0, -1.0);
+       }
+       glTranslatef(-1.0, -1.1, 1.0);
+       for (X = 0; X < 3; X++) {
+               draw_block(0.5, 3.5 - 0.1 * X, 0.5);
+               glTranslatef(-1.0, -0.1, 0.0);
+       }
+       glPopMatrix();
+       glPopMatrix();
+
+       glPushMatrix();
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialYellow);
+
+       glTranslatef((GLfloat) positions[sp->sphere_position],
+                    (GLfloat) positions[sp->sphere_position + 1],
+                    (GLfloat) positions[sp->sphere_position + 2]);
+       /* FUDGE sphere_position soo its not so obvious */
+       if (!mySphere((sp->sphere_position == 0) ? 0.48 : 0.5))
+               return False;
+       glPopMatrix();
+       sp->sphere_position += 3;
+       if (sp->sphere_position >= (int) NPOSITIONS)
+               sp->sphere_position = 0;
+       return True;
+}
+
+static void
+reshape(ModeInfo * mi, int width, int height)
+{
+       stairsstruct *sp = &stairs[MI_SCREEN(mi)];
+       int i;
+
+       glViewport(0, 0, sp->WindW = (GLint) width, sp->WindH = (GLint) height);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
+       glMatrixMode(GL_MODELVIEW);
+       i = width / 512 + 1;
+       glLineWidth(i);
+       glPointSize(i);
+}
+
+static void
+pinit(void)
+{
+       glClearDepth(1.0);
+       glClearColor(0.0, 0.0, 0.0, 1.0);
+
+       glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT0, GL_POSITION, position0);
+       glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
+       glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
+       glLightfv(GL_LIGHT1, GL_POSITION, position1);
+       glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+       glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+       glEnable(GL_LIGHTING);
+       glEnable(GL_LIGHT0);
+       glEnable(GL_LIGHT1);
+       glEnable(GL_NORMALIZE);
+       glFrontFace(GL_CCW);
+       glCullFace(GL_BACK);
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
+       glShadeModel(GL_FLAT);
+       glEnable(GL_DEPTH_TEST);
+       glEnable(GL_TEXTURE_2D);
+       glEnable(GL_CULL_FACE);
+
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       gluBuild2DMipmaps(GL_TEXTURE_2D, 3, WoodTextureWidth, WoodTextureHeight,
+                         GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
+       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
+}
+
+void
+release_stairs(ModeInfo * mi)
+{
+       if (stairs != NULL) {
+#if 0
+               int screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       stairsstruct *sp = &stairs[screen];
+
+                       if (sp->glx_context) {
+                               if (glIsList(objects)) {
+                                       glDeleteLists(objects, MaxObj);
+                                       objects = 0;
+                               }
+                       }
+               }
+#endif
+               (void) free((void *) stairs);
+               stairs = (stairsstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+void
+init_stairs(ModeInfo * mi)
+{
+       stairsstruct *sp;
+
+       if (stairs == NULL) {
+               if ((stairs = (stairsstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (stairsstruct))) == NULL)
+                       return;
+       }
+       sp = &stairs[MI_SCREEN(mi)];
+
+       sp->step = 0.0;
+       sp->direction = LRAND() & 1;
+       sp->sphere_position = NRAND(NPOSITIONS / 3) * 3;
+
+       if ((sp->glx_context = init_GL(mi)) != NULL) {
+
+               reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+               glDrawBuffer(GL_BACK);
+#if 0
+               if (!glIsList(objects))
+                       if ((objects = glGenLists(MaxObj)) == 0) {
+                               MI_CLEARWINDOW(mi);
+                       }
+#endif
+               pinit();
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_stairs(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       stairsstruct *sp;
+
+       if (stairs == NULL)
+                       return;
+       sp = &stairs[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (!sp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(sp->glx_context));
+
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       glPushMatrix();
+
+       glTranslatef(0.0, 0.0, -10.0);
+
+       if (!MI_IS_ICONIC(mi)) {
+               glScalef(Scale4Window * sp->WindH / sp->WindW, Scale4Window, Scale4Window);
+       } else {
+               glScalef(Scale4Iconic * sp->WindH / sp->WindW, Scale4Iconic, Scale4Iconic);
+       }
+
+       glRotatef(44.5, 1, 0, 0);
+       glRotatef(50 + ((sp->direction) ? 1 : -1) *
+              ((sp->step * 100 > 120) ? sp->step * 100 - 120 : 0), 0, 1, 0);
+       if (sp->step * 100 >= 360 + 120) {      /* stop showing secrets */
+               sp->step = 0;
+               sp->direction = LRAND() & 1;
+       }
+       if (!draw_stairs_internal(mi)) {
+               release_stairs(mi);
+               return;
+       }
+
+       glPopMatrix();
+
+       if (MI_IS_FPS(mi)) do_fps (mi);
+       glFlush();
+
+       glXSwapBuffers(display, window);
+
+       sp->step += 0.025;
+}
+
+void
+change_stairs(ModeInfo * mi)
+{
+       stairsstruct *sp;
+
+       if (stairs == NULL)
+                       return;
+       sp = &stairs[MI_SCREEN(mi)];
+
+       if (!sp->glx_context)
+               return;
+
+       glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sp->glx_context));
+       pinit();
+}
+
+#endif
diff --git a/modes/glx/superquadrics.c b/modes/glx/superquadrics.c
new file mode 100644 (file)
index 0000000..d7b1c65
--- /dev/null
@@ -0,0 +1,788 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* superquadrics --- 3D mathematical shapes */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)superquadrics.c      5.01 2001/03/01 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Superquadrics were invented by Dr. Alan Barr of Caltech University.
+ * They were first published in "Computer Graphics and Applications",
+ * volume 1, number 1, 1981, in the article "Superquadrics and Angle-
+ * Preserving Transformations."  Dr. Barr based the Superquadrics on
+ * Piet Hein's "super ellipses."  Super ellipses are like 2D ellipses,
+ * except that the formula includes an exponent, raising its X and Y
+ * values to a (fractional) power, and allowing them to gradually
+ * change from round to square edges.  Superquadrics extend this
+ * idea into 3 dimensions, using two exponents to modify a
+ * quadric surface in a similar fashion.
+ *
+ * Revision History:
+ * 01-Mar-2001: Added FPS stuff - Eric Lassauge <lassauge@mail.dotcom.fr>
+ * 01-Nov-2000: Allocation checks
+ * 30-Mar-97: Turned into a module for xlockmore 4.02 alpha.  The code
+ *    is almost unrecognizable now from the first revision, except for
+ *    a few remaining two-letter variable names.  I still don't have
+ *    the normal vectors working right (I wrote the buggy normal vector
+ *    code myself, can you tell?)
+ * 07-Jan-97: A legend reborn; Superquadrics make an appearance as a
+ *    real OpenGL program written in C.  I can even render them with
+ *    proper lighting and specular highlights.  Gee, they look almost
+ *    as good now as the original color plates of them that my uncle
+ *    showed me as a child in 1981.  I don't know what computer hardware
+ *    he was using at the time, but it's taken a couple decades for the
+ *    PC clone hardware to catch up to it.
+ * 05-Jan-97: After almost a decade, Superquadrics had almost faded away
+ *    into the myths and folklore of all the things my brother and I played
+ *    with on computers when we were kids with too much time on our hands.
+ *    I had since gotten involved in Unix, OpenGL, and other things.
+ *    A sudden flash of inspiration caused me to dig out the old Pascal
+ *    source code, run it through p2c, and start ripping away the old
+ *    wireframe rendering code, to be replaced by OpenGL.
+ * Late 1989 or early 1990:  Around this time I did the Turbo Pascal
+ *    port of the Superquadrics.  Unfortunately, many of the original variable
+ *    names remained the same from the C= 64 original.  This was unfortunate
+ *    because BASIC on the c64 only allowed 2-letter, global variable names.
+ *    But the speed improvement over BASIC was very impressive at the time.
+ * Thanksgiving, 1987: Written.  My uncle Al, who invented Superquadrics some
+ *    years earlier, came to visit us.  I was a high school kid at the time,
+ *    with nothing more than a Commodore 64.  Somehow we wrote this program,
+ *    (he did the math obviously, I just coded it into BASIC for the c64).
+ *    Yeah, 320x200 resolution, colorless white wireframe, and half an hour
+ *    rendering time per superquadric.  PLOT x,y.  THOSE were the days.
+ *    In the following years I would port Superquadrics to AppleBASIC,
+ *    AmigaBASIC, and then Turbo Pascal for IBM clones.  5 minutes on a 286!
+ *    Talk about fast rendering!  But these days, when my Pentium 166 runs
+ *    the same program, the superquadric will already be waiting on the
+ *    screen before my monitor can change frequency from text to graphics
+ *    mode.  Can't time the number of minutes that way!  Darn ;)
+ *
+ * Ed Mackey
+ */
+
+/*-
+ * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
+ * otherwise caddr_t is not defined correctly
+ */
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+# define PROGCLASS                             "Superquadrics"
+# define HACK_INIT                             init_superquadrics
+# define HACK_DRAW                             draw_superquadrics
+# define superquadrics_opts                    xlockmore_opts
+# define DEFAULTS      "*delay:        40000   \n"     \
+                       "*count:        25      \n"     \
+                       "*cycles:       40      \n"     \
+                       "*showfps:      False   \n"     \
+                       "*wireframe:    False   \n"
+# include "xlockmore.h"                        /* from the xscreensaver distribution */
+#else  /* !STANDALONE */
+# include "xlock.h"                    /* from the xlockmore distribution */
+# include "visgl.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_superquadrics
+
+/*-
+ * Note for low-CPU-speed machines:  If your frame rate is so low that
+ * attempts at animation appear futile, try using "-cycles 1", which puts
+ * Superquadrics into kind of a slide-show mode.  It will still use up
+ * all of your CPU power, but it may look nicer.
+ */
+
+#define DEF_SPINSPEED  "5.0"
+
+static float spinspeed;
+
+static XrmOptionDescRec opts[] =
+{
+  {(char *) "-spinspeed",(char *) ".superquadrics.spinspeed", XrmoptionSepArg, (caddr_t) NULL}
+};
+static argtype vars[] =
+{
+  {(caddr_t *) & spinspeed, (char *) "spinspeed", (char *) "Spinspeed", (char *)DEF_SPINSPEED, t_Float}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-spinspeed num", (char *) "speed of rotation, in degrees per frame"}
+};
+
+ModeSpecOpt superquadrics_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   superquadrics_description =
+{"superquadrics", "init_superquadrics", "draw_superquadrics", "release_superquadrics",
+ "refresh_superquadrics", "init_superquadrics", NULL, &superquadrics_opts,
+ 1000, 25, 40, 1, 4, 1.0, "",
+ "Shows 3D mathematical shapes", 0, NULL};
+
+#endif
+
+#include <GL/glu.h>
+
+#define MaxRes          50
+#define MinRes          5
+
+typedef double dimi[MaxRes + 1];
+
+typedef struct {
+       double      xExponent, yExponent;
+       GLfloat     r[4], g[4], b[4];
+       long        Mode;
+       int         rotx, rotz;
+} state;
+
+typedef struct {
+       GLXContext *glx_context;
+       int         dist, wireframe, flatshade, shownorms, maxcount, maxwait;
+       int         counter, viewcount, viewwait, mono;
+       GLfloat     curmat[4][4], rotx, roty, rotz, spinspeed;
+       /* In dimi: the first letter stands for cosine/sine, the second
+        *          stands for North, South, East, or West.  I think.
+        */
+       dimi        cs, se, sw, sn, ss, ce, cw, cn, Prevxx, Prevyy, Prevzz,
+                   Prevxn, Prevyn, Prevzn;
+       double      xExponent, yExponent, Mode;
+       int         resolution;
+       state       now, later;
+} superquadricsstruct;
+
+static superquadricsstruct *superquadrics = (superquadricsstruct *) NULL;
+
+#define CLIP_NORMALS 10000.0
+
+static void ReshapeSuperquadrics(int w, int h);
+
+static int
+myrand(int range)
+{
+       return ((int) (((float) range) * LRAND() / (MAXRAND)));
+}
+
+static float
+myrandreal(void)
+{
+       return (LRAND() / (MAXRAND));
+}
+
+/* Some old, old, OLD code follows.  Ahh this takes me back..... */
+
+/* Output from p2c, the Pascal-to-C translator */
+/* From input file "squad.pas" */
+
+static double
+XtoY(double x, double y)
+{
+       double      z, a;
+
+       /* This is NOT your typical raise-X-to-the-Y-power function.  Do not attempt
+        * to replace this with a standard exponent function.  If you must, just
+        * replace the "a = exp(y * log(z));" line with something faster.
+        */
+
+       z = fabs(x);
+       if (z < 1e-20) {
+               a = 0.0;
+               return a;
+       }
+       a = exp(y * log(z));
+       if (a > CLIP_NORMALS)
+               a = CLIP_NORMALS;
+       if (x < 0)
+               a = -a;
+       return a;
+}
+
+
+static double
+Sine(double x, double e)
+{
+       /* This is just the sine wave raised to the exponent.  BUT, you can't
+        * raise negative numbers to fractional exponents.  So we have a special
+        * XtoY routune which handles it in a way useful to superquadrics.
+        */
+
+       return (XtoY(sin(x), e));
+}
+
+
+static double
+Cosine(double x, double e)
+{
+       return (XtoY(cos(x), e));
+}
+
+
+static void
+MakeUpStuff(int allstuff, superquadricsstruct * sp)
+{
+       static int  pats[4][4] =
+       {
+               {0, 0, 0, 0},
+               {0, 1, 0, 1},
+               {0, 0, 1, 1},
+               {0, 1, 1, 0}
+       };
+
+       int         dostuff;
+       int         t, pat;
+       GLfloat     r, g, b, r2, g2, b2;
+
+       /* randomize it. */
+
+       if (sp->maxcount < 2)
+               allstuff = 1;
+       dostuff = allstuff * 15;
+       if (!dostuff) {
+               dostuff = myrand(3) + 1;
+               if (myrand(2) || (dostuff & 1))
+                       dostuff |= 4;
+               if (myrand(2))
+                       dostuff |= 8;
+       }
+       if (dostuff & 1) {
+               sp->later.xExponent = (((long) floor(myrandreal() * 250 + 0.5)) / 100.0) + 0.1;
+               sp->later.yExponent = (((long) floor(myrandreal() * 250 + 0.5)) / 100.0) + 0.1;
+
+               /* Increase the 2.0 .. 2.5 range to 2.0 .. 3.0 */
+               if (sp->later.xExponent > 2.0)
+                       sp->later.xExponent = (sp->later.xExponent * 2.0) - 2.0;
+               if (sp->later.yExponent > 2.0)
+                       sp->later.yExponent = (sp->later.yExponent * 2.0) - 2.0;
+       }
+       if (dostuff & 2) {
+               do {
+                       sp->later.Mode = myrand(3L) + 1;
+               } while (!allstuff && (sp->later.Mode == sp->now.Mode));
+               /* On init: make sure it can stay in mode 1 if it feels like it. */
+       }
+       if (dostuff & 4) {
+               if (sp->mono) {
+                       if (sp->wireframe) {
+                               b = g = r = 1.0;
+                               b2 = g2 = r2 = 1.0;
+                       } else {
+                               b = g = r = (GLfloat) (140 + myrand(100)) / 255.0;
+                               b2 = g2 = r2 = ((r > 0.69) ? (1.0 - r) : r);
+                       }
+               } else {
+                       r = (GLfloat) (40 + myrand(200)) / 255.0;
+                       g = (GLfloat) (40 + myrand(200)) / 255.0;
+                       b = (GLfloat) (40 + myrand(200)) / 255.0;
+
+                       r2 = ((myrand(4) && ((r < 0.31) || (r > 0.69))) ? (1.0 - r) : r);
+                       g2 = ((myrand(4) && ((g < 0.31) || (g > 0.69))) ? (1.0 - g) : g);
+                       b2 = ((myrand(4) && ((b < 0.31) || (b > 0.69))) ? (1.0 - b) : b);
+               }
+
+               pat = myrand(4);
+               for (t = 0; t < 4; ++t) {
+                       sp->later.r[t] = pats[pat][t] ? r : r2;
+                       sp->later.g[t] = pats[pat][t] ? g : g2;
+                       sp->later.b[t] = pats[pat][t] ? b : b2;
+               }
+       }
+       if (dostuff & 8) {
+               sp->later.rotx = myrand(360) - 180;
+               sp->later.rotz = myrand(160) - 80;
+       }
+}
+
+static void
+inputs(superquadricsstruct * sp)
+{
+       int         iv;
+       double      u, v, mode3, cn3, inverter2, flatu, flatv;
+
+       if (sp->Mode < 1.000001) {
+               mode3 = 1.0;
+               cn3 = 0.0;
+               inverter2 = 1.0;
+       } else if (sp->Mode < 2.000001) {
+               mode3 = 1.0;
+               cn3 = (sp->Mode - 1.0) * 1.5;
+               inverter2 = (sp->Mode - 1.0) * -2.0 + 1.0;
+       } else {
+               mode3 = (sp->Mode - 1.0);
+               cn3 = (sp->Mode - 2.0) / 2.0 + 1.5;
+               inverter2 = -1.0;
+       }
+
+       if (sp->flatshade) {
+               flatu = M_PI / (sp->resolution - 1);
+               flatv = mode3 * M_PI / ((sp->resolution - 1) * 2);
+       } else {
+               flatu = flatv = 0.0;
+       }
+
+       /* (void) printf("Calculating....\n"); */
+       for (iv = 1; iv <= sp->resolution; iv++) {
+
+               /* u ranges from PI down to -PI */
+               u = (1 - iv) * 2 * M_PI / (sp->resolution - 1) + M_PI;
+
+               /* v ranges from PI/2 down to -PI/2 */
+               v = (1 - iv) * mode3 * M_PI / (sp->resolution - 1) + M_PI * (mode3 / 2.0);
+
+               /* Use of xExponent */
+               sp->se[iv] = Sine(u, sp->xExponent);
+               sp->ce[iv] = Cosine(u, sp->xExponent);
+               sp->sn[iv] = Sine(v, sp->yExponent);
+               sp->cn[iv] = Cosine(v, sp->yExponent) * inverter2 + cn3;
+
+               /* Normal vector computations only */
+               sp->sw[iv] = Sine(u + flatu, 2 - sp->xExponent);
+               sp->cw[iv] = Cosine(u + flatu, 2 - sp->xExponent);
+               sp->ss[iv] = Sine(v + flatv, 2 - sp->yExponent) * inverter2;
+               sp->cs[iv] = Cosine(v + flatv, 2 - sp->yExponent);
+       }                       /* next */
+
+       /* Now fix up the endpoints */
+       sp->se[sp->resolution] = sp->se[1];
+       sp->ce[sp->resolution] = sp->ce[1];
+
+       if (sp->Mode > 2.999999) {
+               sp->sn[sp->resolution] = sp->sn[1];
+               sp->cn[sp->resolution] = sp->cn[1];
+       }
+}
+
+
+static void
+DoneScale(superquadricsstruct * sp)
+{
+       double      xx, yy, zz, xp = 0, yp = 0, zp = 0, xn, yn, zn, xnp = 0,
+                   ynp = 0, znp = 0;
+       int         ih, iv;
+
+       /* Hey don't knock my 2-letter variable names.  Simon's BASIC rules, man! ;-> */
+       /* Just kidding..... */
+       int         toggle = 0;
+
+       for (ih = 1; ih <= sp->resolution; ih++) {
+               toggle ^= 2;
+               for (iv = 1; iv <= sp->resolution; iv++) {
+                       toggle ^= 1;
+                       if (sp->wireframe)
+                               glColor3f(sp->curmat[toggle][0], sp->curmat[toggle][1], sp->curmat[toggle][2]);
+                       else
+                               glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, sp->curmat[toggle]);
+
+                       xx = sp->cn[iv] * sp->ce[ih];
+                       zz = sp->cn[iv] * sp->se[ih];
+                       yy = sp->sn[iv];
+
+                       if (sp->wireframe) {
+                               if ((ih > 1) || (iv > 1)) {
+                                       glBegin(GL_LINES);
+                                       if (ih > 1) {
+                                               glVertex3f(xx, yy, zz);
+                                               glVertex3f(sp->Prevxx[iv], sp->Prevyy[iv], sp->Prevzz[iv]);
+                                       }
+                                       if (iv > 1) {
+                                               glVertex3f(xx, yy, zz);
+                                               glVertex3f(sp->Prevxx[iv - 1], sp->Prevyy[iv - 1], sp->Prevzz[iv - 1]);
+                                       }
+/* PURIFY 4.0.1 reports an unitialized memory read on the next line when using
+   * MesaGL 2.2 and -mono.  This has been fixed in MesaGL 2.3 and later. */
+                                       glEnd();
+                               }
+                       } else {
+                               if ((sp->cs[iv] > 1e+10) || (sp->cs[iv] < -1e+10)) {
+                                       xn = sp->cs[iv];
+                                       zn = sp->cs[iv];
+                                       yn = sp->ss[iv];
+                               } else {
+                                       xn = sp->cs[iv] * sp->cw[ih];
+                                       zn = sp->cs[iv] * sp->sw[ih];
+                                       yn = sp->ss[iv];
+                               }
+                               if ((ih > 1) && (iv > 1)) {
+                                       glNormal3f(xn, yn, zn);
+                                       glBegin(GL_POLYGON);
+                                       glVertex3f(xx, yy, zz);
+                                       if (!sp->flatshade)
+                                               glNormal3f(sp->Prevxn[iv], sp->Prevyn[iv], sp->Prevzn[iv]);
+                                       glVertex3f(sp->Prevxx[iv], sp->Prevyy[iv], sp->Prevzz[iv]);
+                                       if (!sp->flatshade)
+                                               glNormal3f(xnp, ynp, znp);
+                                       glVertex3f(xp, yp, zp);
+                                       if (!sp->flatshade)
+                                               glNormal3f(sp->Prevxn[iv - 1], sp->Prevyn[iv - 1], sp->Prevzn[iv - 1]);
+                                       glVertex3f(sp->Prevxx[iv - 1], sp->Prevyy[iv - 1], sp->Prevzz[iv - 1]);
+                                       glEnd();
+                               }
+                               if (sp->shownorms) {
+                                       if (!sp->flatshade)
+                                               glShadeModel(GL_FLAT);
+                                       glDisable(GL_LIGHTING);
+                                       glBegin(GL_LINES);
+                                       glVertex3f(xx, yy, zz);
+                                       glVertex3f(xx + xn, yy + yn, zz + zn);
+                                       glEnd();
+                                       if (!sp->flatshade)
+                                               glShadeModel(GL_SMOOTH);
+                                       glEnable(GL_LIGHTING);
+                               }
+                               xnp = sp->Prevxn[iv];
+                               ynp = sp->Prevyn[iv];
+                               znp = sp->Prevzn[iv];
+                               sp->Prevxn[iv] = xn;
+                               sp->Prevyn[iv] = yn;
+                               sp->Prevzn[iv] = zn;
+                       }
+
+                       xp = sp->Prevxx[iv];
+                       yp = sp->Prevyy[iv];
+                       zp = sp->Prevzz[iv];
+                       sp->Prevxx[iv] = xx;
+                       sp->Prevyy[iv] = yy;
+                       sp->Prevzz[iv] = zz;
+
+               }               /* next */
+       }                       /* next */
+}
+
+/**** End of really old code ****/
+
+static void
+SetCull(int init, superquadricsstruct * sp)
+{
+       static int  cullmode;
+
+       if (init) {
+               cullmode = 0;
+               return;
+       }
+       if (sp->Mode < 1.0001) {
+               if (cullmode != 1) {
+                       glEnable(GL_CULL_FACE);
+                       glCullFace(GL_BACK);
+                       cullmode = 1;
+               }
+       } else if (sp->Mode > 2.9999) {
+               if (cullmode != 2) {
+                       glEnable(GL_CULL_FACE);
+                       glCullFace(GL_FRONT);
+                       cullmode = 2;
+               }
+       } else {
+               if (cullmode) {
+                       glDisable(GL_CULL_FACE);
+                       cullmode = 0;
+               }
+       }
+}
+
+static void
+SetCurrentShape(superquadricsstruct * sp)
+{
+       int         t;
+
+       sp->xExponent = sp->now.xExponent = sp->later.xExponent;
+       sp->yExponent = sp->now.yExponent = sp->later.yExponent;
+
+       for (t = 0; t < 4; ++t) {
+               sp->curmat[t][0] = sp->now.r[t] = sp->later.r[t];
+               sp->curmat[t][1] = sp->now.g[t] = sp->later.g[t];
+               sp->curmat[t][2] = sp->now.b[t] = sp->later.b[t];
+       }
+
+       sp->Mode = (double) (sp->now.Mode = sp->later.Mode);
+       sp->rotx = sp->now.rotx = sp->later.rotx;
+       sp->rotz = sp->now.rotz = sp->later.rotz;
+
+       sp->counter = -sp->maxwait;
+
+       inputs(sp);
+}
+
+static void
+NextSuperquadric(superquadricsstruct * sp)
+{
+       double      fnow, flater;
+       int         t;
+
+       sp->roty -= sp->spinspeed;
+       while (sp->roty >= 360.0)
+               sp->roty -= 360.0;
+       while (sp->roty < 0.0)
+               sp->roty += 360.0;
+
+       --sp->viewcount;
+
+       if (sp->counter > 0) {
+               if (--sp->counter == 0) {
+                       SetCurrentShape(sp);
+                       if (sp->counter == 0) {         /* Happens if sp->maxwait == 0 */
+                               MakeUpStuff(0, sp);
+                               sp->counter = sp->maxcount;
+                       }
+               } else {
+                       fnow = (double) sp->counter / (double) sp->maxcount;
+                       flater = (double) (sp->maxcount - sp->counter) / (double) sp->maxcount;
+                       sp->xExponent = sp->now.xExponent * fnow + sp->later.xExponent * flater;
+                       sp->yExponent = sp->now.yExponent * fnow + sp->later.yExponent * flater;
+
+                       for (t = 0; t < 4; ++t) {
+                               sp->curmat[t][0] = sp->now.r[t] * fnow + sp->later.r[t] * flater;
+                               sp->curmat[t][1] = sp->now.g[t] * fnow + sp->later.g[t] * flater;
+                               sp->curmat[t][2] = sp->now.b[t] * fnow + sp->later.b[t] * flater;
+                       }
+
+                       sp->Mode = (double) sp->now.Mode * fnow + (double) sp->later.Mode * flater;
+                       sp->rotx = (double) sp->now.rotx * fnow + (double) sp->later.rotx * flater;
+                       sp->rotz = (double) sp->now.rotz * fnow + (double) sp->later.rotz * flater;
+
+                       inputs(sp);
+               }
+       } else {
+               if (++sp->counter >= 0) {
+                       MakeUpStuff(0, sp);
+                       sp->counter = sp->maxcount;
+               }
+       }
+}
+
+static void
+DisplaySuperquadrics(superquadricsstruct * sp)
+{
+       glDrawBuffer(GL_BACK);
+       if (sp->wireframe)
+               glClear(GL_COLOR_BUFFER_BIT);
+       else
+               glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+       if (sp->viewcount < 1) {
+               sp->viewcount = sp->viewwait;
+               ReshapeSuperquadrics(-1, -1);
+       }
+       glPushMatrix();
+       glTranslatef(0.0, 0.0, -((GLfloat) (sp->dist) / 16.0) - (sp->Mode * 3.0 - 1.0));        /* viewing transform  */
+       glRotatef(sp->rotx, 1.0, 0.0, 0.0);     /* pitch */
+       glRotatef(sp->rotz, 0.0, 0.0, 1.0);     /* bank */
+       glRotatef(sp->roty, 0.0, 1.0, 0.0);     /* "spin", like heading but comes after P & B */
+
+       SetCull(0, sp);
+
+       DoneScale(sp);
+
+       glPopMatrix();
+
+       /* Remember to flush & swap the buffers after calling this function! */
+}
+
+static void
+NextSuperquadricDisplay(superquadricsstruct * sp)
+{
+       NextSuperquadric(sp);
+       DisplaySuperquadrics(sp);
+}
+
+#define MINSIZE 200
+static void
+ReshapeSuperquadrics(int w, int h)
+{
+       static int  last_w = 0, last_h = 0;
+       int         maxsize, cursize;
+
+       if (w < 0) {
+               w = last_w;
+               h = last_h;
+       } else {
+               last_w = w;
+               last_h = h;
+       }
+       maxsize = (w < h) ? w : h;
+       if (maxsize <= MINSIZE) {
+               cursize = maxsize;
+       } else {
+               cursize = myrand(maxsize - MINSIZE) + MINSIZE;
+       }
+       if ((w > cursize) && (h > cursize)) {
+               glViewport(myrand(w - cursize), myrand(h - cursize), cursize, cursize);
+               w = h = cursize;
+       } else {
+               glViewport(0, 0, w, h);
+       }
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       gluPerspective(30.0, (GLfloat) w / (GLfloat) h, 0.1, 200.0);
+       glMatrixMode(GL_MODELVIEW);
+       glLoadIdentity();
+}
+
+static void
+InitSuperquadrics(int wfmode, int snorm, int res, int count, float speed, superquadricsstruct * sp)
+{
+       GLfloat     ambient[] =
+       {0.4, 0.4, 0.4, 1.0};
+       GLfloat     position[] =
+       {10.0, 1.0, 1.0, 10.0};
+       GLfloat     mat_diffuse[] =
+       {1.0, 0.5, 0.5, 1.0};
+       GLfloat     mat_specular[] =
+       {0.8, 0.8, 0.8, 1.0};
+       GLfloat     mat_shininess[] =
+       {50.0};
+
+       int         t;
+
+       for (t = 0; t < 4; ++t)
+               sp->curmat[t][3] = 1.0;
+
+       sp->rotx = 35.0;
+       sp->roty = 0.0;
+       sp->rotz = 0.0;
+       sp->dist = (16 << 3);
+       sp->wireframe = sp->flatshade = sp->shownorms = 0;
+       sp->maxcount = count;
+       if (sp->maxcount < 1)
+               sp->maxcount = 1;
+       sp->maxwait = sp->maxcount >> 1;
+       SetCull(1, sp);
+
+       sp->spinspeed = speed;
+       sp->viewcount = sp->viewwait = (sp->maxcount < 2) ? 1 : (sp->maxcount << 3);
+
+       if (res < MinRes)
+               res = MinRes;
+       if (res > MaxRes)
+               res = MaxRes;
+       sp->resolution = res;
+
+       if (wfmode == 2)
+               sp->flatshade = 1;
+       else if (wfmode)
+               sp->wireframe = 1;
+
+       if (snorm)
+               sp->shownorms = 1;
+
+       if (sp->wireframe) {
+               glShadeModel(GL_FLAT);
+               glDisable(GL_LIGHTING);
+               glColor3f(mat_diffuse[0], mat_diffuse[1], mat_diffuse[2]);
+       } else {
+               if (sp->flatshade) {
+                       glShadeModel(GL_FLAT);
+                       position[0] = 1.0;
+                       position[3] = 0.0;
+               }
+               glEnable(GL_LIGHTING);
+               glEnable(GL_LIGHT0);
+               glDepthFunc(GL_LEQUAL);
+               glEnable(GL_DEPTH_TEST);
+
+               glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
+               glLightfv(GL_LIGHT0, GL_POSITION, position);
+
+               /*glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat_diffuse); */
+               glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
+
+               glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
+
+               glFrontFace(GL_CW);
+               glEnable(GL_NORMALIZE);
+       }
+
+       MakeUpStuff(1, sp);
+       SetCurrentShape(sp);
+       MakeUpStuff(1, sp);     /* Initialize it */
+       sp->counter = sp->maxcount;
+}
+
+/* End of superquadrics main functions */
+
+void
+init_superquadrics(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         screen = MI_SCREEN(mi);
+
+       superquadricsstruct *sp;
+
+       if (superquadrics == NULL) {
+               if ((superquadrics = (superquadricsstruct *) calloc(MI_NUM_SCREENS(mi),
+                                     sizeof (superquadricsstruct))) == NULL)
+                       return;
+       }
+       sp = &superquadrics[screen];
+       sp->mono = (MI_IS_MONO(mi) ? 1 : 0);
+
+       if ((sp->glx_context = init_GL(mi)) != NULL) {
+
+               InitSuperquadrics(MI_IS_WIREFRAME(mi), 0,
+                                 MI_COUNT(mi), MI_CYCLES(mi), spinspeed, sp);
+               ReshapeSuperquadrics(MI_WIDTH(mi), MI_HEIGHT(mi));
+
+               DisplaySuperquadrics(sp);
+               glFinish();
+               glXSwapBuffers(display, window);
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_superquadrics(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       superquadricsstruct *sp;
+
+       if (superquadrics == NULL)
+               return;
+       sp = &superquadrics[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (!sp->glx_context)
+               return;
+
+       glXMakeCurrent(display, window, *(sp->glx_context));
+
+       NextSuperquadricDisplay(sp);
+
+       if (MI_IS_FPS(mi)) do_fps (mi);
+       glFinish();
+       glXSwapBuffers(display, window);
+}
+
+void
+refresh_superquadrics(ModeInfo * mi)
+{
+       /* Nothing happens here */
+}
+
+void
+release_superquadrics(ModeInfo * mi)
+{
+       if (superquadrics != NULL) {
+               (void) free((void *) superquadrics);
+               superquadrics = (superquadricsstruct *) NULL;
+       }
+       FreeAllGL(mi);
+}
+
+
+#endif
+
+/* End of superquadrics.c */
diff --git a/modes/glx/swim.c b/modes/glx/swim.c
new file mode 100644 (file)
index 0000000..ead54f4
--- /dev/null
@@ -0,0 +1,233 @@
+/* atlantis --- Shows moving 3D sea animals */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)swim.c       1.4 2000/01/28 xlockmore";
+
+#endif
+
+/* Copyright (c) E. Lassauge, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by Mark J. Kilgard
+ * as a demo for openGL programming.
+ *
+ * Porting it to xlock  was possible by comparing the original Mesa's morph3d
+ * demo with it's ported version to xlock, so thanks for Marcelo F. Vianna
+ * (look at morph3d.c) for his indirect help.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * My e-mail address is lassauge@mail.dotcom.fr
+ *
+ * Eric Lassauge  (May-13-1998)
+ *
+ */
+
+/**
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+
+#ifdef STANDALONE
+#include "xlockmoreI.h"                /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_atlantis
+
+#include "atlantis.h"
+
+void
+FishTransform(fishRec * fish)
+{
+
+       glTranslatef(fish->y, fish->z, -fish->x);
+       glRotatef(-fish->psi, 0.0, 1.0, 0.0);
+       glRotatef(fish->theta, 1.0, 0.0, 0.0);
+       glRotatef(-fish->phi, 0.0, 0.0, 1.0);
+}
+
+void
+WhalePilot(fishRec * fish, float whalespeed, Bool whaledir)
+{
+
+       fish->phi = -20.0;
+       fish->theta = 0.0;
+       fish->psi += ((whaledir) ? -0.5 : 0.5);
+
+       fish->x += whalespeed * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD);
+       fish->y += whalespeed * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD);
+       fish->z += whalespeed * fish->v * sin(fish->theta / RAD);
+}
+
+void
+SharkPilot(fishRec * fish, float sharkspeed)
+{
+       static int  sign = 1;
+       float       X, Y, Z, tpsi, ttheta, thetal;
+
+       fish->xt = 60000.0;
+       fish->yt = 0.0;
+       fish->zt = 0.0;
+
+       X = fish->xt - fish->x;
+       Y = fish->yt - fish->y;
+       Z = fish->zt - fish->z;
+
+       thetal = fish->theta;
+
+       ttheta = RAD * atan(Z / (sqrt(X * X + Y * Y)));
+
+       if (ttheta > fish->theta + 0.25) {
+               fish->theta += 0.5;
+       } else if (ttheta < fish->theta - 0.25) {
+               fish->theta -= 0.5;
+       }
+       if (fish->theta > 90.0) {
+               fish->theta = 90.0;
+       }
+       if (fish->theta < -90.0) {
+               fish->theta = -90.0;
+       }
+       fish->dtheta = fish->theta - thetal;
+
+       tpsi = RAD * atan2(Y, X);
+
+       fish->attack = 0;
+
+       if (fabs(tpsi - fish->psi) < 10.0) {
+               fish->attack = 1;
+       } else if (fabs(tpsi - fish->psi) < 45.0) {
+               if (fish->psi > tpsi) {
+                       fish->psi -= 0.5;
+                       if (fish->psi < -180.0) {
+                               fish->psi += 360.0;
+                       }
+               } else if (fish->psi < tpsi) {
+                       fish->psi += 0.5;
+                       if (fish->psi > 180.0) {
+                               fish->psi -= 360.0;
+                       }
+               }
+       } else {
+               if (NRAND(100) > 98) {
+                       sign = 1 - sign;
+               }
+               fish->psi += sign;
+               if (fish->psi > 180.0) {
+                       fish->psi -= 360.0;
+               }
+               if (fish->psi < -180.0) {
+                       fish->psi += 360.0;
+               }
+       }
+
+       if (fish->attack) {
+               if (fish->v < 1.1) {
+                       fish->spurt = 1;
+               }
+               if (fish->spurt) {
+                       fish->v += 0.2;
+               }
+               if (fish->v > 5.0) {
+                       fish->spurt = 0;
+               }
+               if ((fish->v > 1.0) && (!fish->spurt)) {
+                       fish->v -= 0.2;
+               }
+       } else {
+               if (!(NRAND(400)) && (!fish->spurt)) {
+                       fish->spurt = 1;
+               }
+               if (fish->spurt) {
+                       fish->v += 0.05;
+               }
+               if (fish->v > 3.0) {
+                       fish->spurt = 0;
+               }
+               if ((fish->v > 1.0) && (!fish->spurt)) {
+                       fish->v -= 0.05;
+               }
+       }
+
+       fish->x += sharkspeed * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD);
+       fish->y += sharkspeed * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD);
+       fish->z += sharkspeed * fish->v * sin(fish->theta / RAD);
+}
+
+void
+SharkMiss(atlantisstruct * ap, int i)
+{
+       int         j;
+       float       avoid, thetal;
+       float       X, Y, Z, R;
+
+       for (j = 0; j < ap->num_sharks; j++) {
+               if (j != i) {
+                       X = ap->sharks[j].x - ap->sharks[i].x;
+                       Y = ap->sharks[j].y - ap->sharks[i].y;
+                       Z = ap->sharks[j].z - ap->sharks[i].z;
+
+                       R = sqrt(X * X + Y * Y + Z * Z);
+
+                       avoid = 1.0;
+                       thetal = ap->sharks[i].theta;
+
+                       if (R < ap->sharksize) {
+                               if (Z > 0.0) {
+                                       ap->sharks[i].theta -= avoid;
+                               } else {
+                                       ap->sharks[i].theta += avoid;
+                               }
+                       }
+                       ap->sharks[i].dtheta += (ap->sharks[i].theta - thetal);
+               }
+       }
+}
+#endif
diff --git a/modes/glx/text3d.cc b/modes/glx/text3d.cc
new file mode 100644 (file)
index 0000000..b12c46b
--- /dev/null
@@ -0,0 +1,1269 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* text3d --- Shows moving 3D texts */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)text3d.cc    5.01 2001/03/09 xlockmore";
+
+#endif
+
+/* Copyright (c) E. Lassauge, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * This module is based on a demo of the gltt graphics library
+ * Copyright (C) 1998 Stephane Rehel.
+ *
+ * See the gltt Official Site at http://gltt.sourceforge.net/
+ * May have better luck at http://lassauge.free.fr/xlock/
+ *
+ * My e-mail address changed to lassauge@mail.dotcom.fr
+ * Web site at http://lassauge.free.fr/
+ *
+ * Eric Lassauge  (October-28-1999)
+ *
+ * Revision History:
+ * 09-Mar-2001: Removed an erroneous PushMatrix !!!
+ * 01-Nov-2000: Allocation checks
+ * 28-Oct-1999: fixes from Jouk "I play with every mode" Jansen.
+ *               Option ttanimate added.
+ * 02-Jun-1999: patches for initialization errors of GLTT library.
+ *              Thanks to Jouk Jansen and Scott <mcmillan@cambridge.com>.
+ *              text3d updates for fortunes thanks to Jouk Jansen
+ *              <joukj@hrem.stm.tudelft.nl>
+ *              Option no_split added.
+ * 23-Aug-1998: add better handling of "faulty" fontfile and randomize
+ *              fontfile if '-ttfont' value is a directory.
+ *              Minor changes for AIX from Jouk Jansen
+ *              (joukj@hrem.stm.tudelft.nl).
+ *
+ * TODO :
+ *       Need more animation functions. Help welcome !!
+ *       Light problem with some letters (don't know why they "reflect" more):
+ *       is the problem in gltt or Mesa ???
+ *       SPEED !!!!
+ *       It may sigfault when compiled with -fschedule-insns2
+ *         (i686-pc-linux-gnu)
+ *          
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Text3d"
+#define HACK_INIT init_text3d
+#define HACK_DRAW draw_text3d
+#define text3d_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*ncolors: 64 \n" \
+ "*font: \n" \
+ "*text: \n" \
+ "*filename: \n" \
+ "*fortunefile: \n" \
+ "*program: \n"
+
+extern "C"
+{
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+}
+#else                          /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#ifdef HAS_MMOV
+#undef error
+#endif
+#endif                         /* !STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_text3d
+
+#include <gltt/FTEngine.h>
+#include <gltt/FTFace.h>
+#include <gltt/FTInstance.h>
+#include <gltt/FTGlyph.h>
+#include <gltt/FTFont.h>
+#include <gltt/GLTTOutlineFont.h>
+#include <gltt/GLTTFont.h>
+#include <gltt/GLTTGlyphPolygonizer.h>
+#include <gltt/GLTTGlyphTriangulator.h>
+
+#include "text3d.h"
+#include <GL/glu.h>
+
+/* #define USE_BLANK *//* This is really bad when debugging. */
+#ifdef USE_BLANK       /* if the module cannot create the font struct
+                        * then use blank mode instead
+                        */
+extern "C" { void init_blank(ModeInfo * mi); }
+extern "C" { void draw_blank(ModeInfo * mi); }
+extern "C" { void release_blank(ModeInfo * mi); }
+extern "C" { void refresh_blank(ModeInfo * mi); }
+#endif
+
+/* Yes, it's an ugly mix of 'C' and 'C++' functions */
+extern "C" { void init_text3d(ModeInfo * mi); }
+extern "C" { void draw_text3d(ModeInfo * mi); }
+extern "C" { void change_text3d(ModeInfo * mi); }
+extern "C" { void release_text3d(ModeInfo * mi); }
+extern "C" { void refresh_text3d(ModeInfo * mi); }
+
+/* arial.ttf is not supplied for legal reasons. */
+/* NT and Windows 3.1 in c:\WINDOWS\SYSTEM\ARIAL.TTF */
+/* Windows95 in c:\windows\fonts\arial.ttf */
+
+#ifndef DEF_TTFONT
+#if defined (SOLARIS2) || defined (SUNOS4)
+#if 0
+#define DEF_TTFONT "/usr/share/fonts/xlockmore/arial.ttf"
+#else
+/* Directory of only *.ttf */
+#define DEF_TTFONT "/usr/share/fonts/xlockmore/"
+#endif
+#else
+#if 0
+#define DEF_TTFONT "/usr/X11R6/lib/X11/fonts/TTF/arial.ttf"
+#else
+/* Directory of only *.ttf */
+#define DEF_TTFONT "/usr/X11R6/lib/X11/fonts/TTF/"
+#endif
+#endif
+#endif
+
+#define DEF_EXTRUSION  "25.0"
+#define DEF_ROTAMPL  "1.0"
+#define DEF_ROTFREQ  "0.001"
+#define DEF_FONTSIZE  220
+#define DEF_NOSPLIT    0
+#define DEF_ANIMATE   "Default"
+static float extrusion;
+static float rampl;
+static float rfreq;
+static char *mode_font;
+static int nosplit;
+static char *animate;
+
+/* Manage Option vars */
+
+static XrmOptionDescRec opts[] =
+{
+    {(char *) "-ttfont", (char *) ".text3d.ttfont", XrmoptionSepArg, (caddr_t) NULL},
+    {(char *) "-extrusion", (char *) ".text3d.extrusion", XrmoptionSepArg, (caddr_t) NULL},
+    {(char *) "-rot_amplitude", (char *) ".text3d.rot_amplitude", XrmoptionSepArg, (caddr_t) NULL},
+    {(char *) "-rot_frequency", (char *) ".text3d.rot_frequency", XrmoptionSepArg, (caddr_t) NULL},
+    {(char *) "-no_split", (char *) ".text3d.no_split", XrmoptionNoArg, (caddr_t) "on"},
+    {(char *) "+no_split", (char *) ".text3d.no_split", XrmoptionNoArg, (caddr_t) "off"},
+    {(char *) "-ttanimate", (char *) ".text3d.ttanimate", XrmoptionSepArg, (caddr_t) NULL},
+};
+
+static argtype vars[] =
+{
+    {(caddr_t *) & mode_font, (char *) "ttfont", (char *) "TTFont", (char *) DEF_TTFONT, t_String},
+    {(caddr_t *) & extrusion, (char *) "extrusion", (char *) "Extrusion", (char *) DEF_EXTRUSION, t_Float},
+    {(caddr_t *) & rampl, (char *) "rot_amplitude", (char *) "RotationAmplitude", (char *) DEF_ROTAMPL, t_Float},
+    {(caddr_t *) & rfreq, (char *) "rot_frequency", (char *) "RotationFrequency", (char *) DEF_ROTFREQ, t_Float},
+    {(caddr_t *) & nosplit, (char *) "no_split", (char *) "NoSplit", (char *) DEF_NOSPLIT, t_Bool},
+    {(caddr_t *) & animate, (char *) "ttanimate", (char *) "TTAnimate", (char *) DEF_ANIMATE, t_String},
+};
+
+static OptionStruct desc[] =
+{
+    {(char *) "-ttfont filename", (char *) "Text3d TrueType font file name"},
+    {(char *) "-extrusion float", (char *) "Text3d extrusion length"},
+    {(char *) "-rot_amplitude float", (char *) "Text3d rotation amplitude"},
+    {(char *) "-rot_frequency float", (char *) "Text3d rotation frequency"},
+    {(char *) "-/+no_split", (char *) "Text3d words splitting off/on"},
+    {(char *) "-ttanimate anim_name", (char *) "Text3d animation function"},
+};
+
+ModeSpecOpt text3d_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct text3d_description =
+{"text3d", "init_text3d", "draw_text3d", "release_text3d",
+ "refresh_text3d", "change_text3d", NULL, &text3d_opts,
+ 100000, 1, 1, 1, 64, 1.0, "",
+ "Shows 3D text", 0, NULL};
+#endif
+
+static text3dstruct *text3d = (text3dstruct *) NULL;
+
+const double angle_speed = 2.5 / 180.0 * M_PI;
+
+extern "C" {
+typedef void (*t3dAnimProc) (text3dstruct * tp);
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static void t3d_anim_fullrandom(text3dstruct * tp);
+static void t3d_anim_default(text3dstruct * tp);
+static void t3d_anim_default2(text3dstruct * tp);
+static void t3d_anim_none(text3dstruct * tp);
+static void t3d_anim_crazy(text3dstruct * tp);
+static void t3d_anim_updown(text3dstruct * tp);
+static void t3d_anim_extrusion(text3dstruct * tp);
+static void t3d_anim_rotatexy(text3dstruct * tp);
+static void t3d_anim_rotateyz(text3dstruct * tp);
+static void t3d_anim_frequency(text3dstruct * tp);
+static void t3d_anim_amplitude(text3dstruct * tp);
+static char *fontfile = (char *) NULL;
+
+#ifdef __cplusplus
+}
+#endif
+
+static t3dAnimProc anim_array[] =
+{
+       t3d_anim_fullrandom,
+       t3d_anim_default,
+       t3d_anim_default2,
+       t3d_anim_none,
+       t3d_anim_crazy,
+       t3d_anim_updown,
+       t3d_anim_extrusion,
+       t3d_anim_rotatexy,
+       t3d_anim_rotateyz,
+       t3d_anim_frequency,
+       t3d_anim_amplitude,
+};
+
+static char * anim_names[] =
+{
+       (char *) "Random",
+       (char *) "FullRandom",
+       (char *) "Default",
+       (char *) "Default2",
+       (char *) "None",
+       (char *) "Crazy",
+       (char *) "UpDown",
+       (char *) "Extrude",
+       (char *) "RotateXY",
+       (char *) "RotateYZ",
+       (char *) "Frequency",   /* needs -rot_frequency /= 0.0 */
+       (char *) "Amplitude",   /* and   -rot_amplitude /= 0.0 */
+       (char *) NULL
+};
+
+static int anims=sizeof anim_array / sizeof anim_array[0] ;
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Mode funcs.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Utils.
+ *-----------------------------------------------------------------------------
+ */
+
+
+#ifdef DIFFUSE_COLOR
+static void
+ hsv_to_rgb(double h, double s, double v,
+           double *r, double *g, double *b)
+{
+    double xh = fmod(h * 360., 360) / 60.0,
+          i = floor(xh),
+          f = xh - i,
+          p1 = v * (1 - s),
+          p2 = v * (1 - (s * f)),
+          p3 = v * (1 - (s * (1 - f)));
+
+    switch ((int) i)
+    {
+    case 0:
+       *r = v;
+       *g = p3;
+       *b = p1;
+       break;
+    case 1:
+       *r = p2;
+       *g = v;
+       *b = p1;
+       break;
+    case 2:
+       *r = p1;
+       *g = v;
+       *b = p3;
+       break;
+    case 3:
+       *r = p1;
+       *g = p2;
+       *b = v;
+       break;
+    case 4:
+       *r = p3;
+       *g = p1;
+       *b = v;
+       break;
+    case 5:
+       *r = v;
+       *g = p1;
+       *b = p2;
+       break;
+    }
+}
+#endif                         /* DIFFUSE_COLOR */
+
+/*-------------------------------------------------------------*/
+static void spheric_camera(text3dstruct * tp,
+                          float center_x, float center_y, float center_z,
+                          float phi, float theta, float radius)
+{
+    float x = center_x + cos(phi) * cos(theta) * radius;
+    float y = center_y + sin(phi) * cos(theta) * radius;
+    float z = center_z + sin(theta) * radius;
+
+    float vx = -cos(phi) * sin(theta) * radius;
+    float vy = -sin(phi) * sin(theta) * radius;
+    float vz = cos(theta) * radius;
+
+    glViewport(0, 0, tp->WinW, tp->WinH);
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    gluPerspective(60, GLfloat(tp->WinW) / GLfloat(tp->WinH), 10, 10000);
+
+    glMatrixMode(GL_MODELVIEW);
+    glLoadIdentity();
+    gluLookAt(x, y, z, center_x, center_y, center_z, vx, vy, vz);
+}
+
+/*-------------------------------------------------------------*/
+class GLTTGlyphTriangles:public GLTTGlyphTriangulator
+{
+public:
+    struct Triangle
+    {
+       FTGlyphVectorizer::POINT * p1;
+       FTGlyphVectorizer::POINT * p2;
+       FTGlyphVectorizer::POINT * p3;
+    };
+
+    Triangle *triangles;
+    int nTriangles;
+
+    GLTTboolean count_them;
+
+    GLTTGlyphTriangles(FTGlyphVectorizer * vectorizer):
+       GLTTGlyphTriangulator(vectorizer)
+       {
+           triangles  = 0;
+           nTriangles = 0;
+           count_them = GLTT_TRUE;
+       }
+    virtual ~GLTTGlyphTriangles()
+    {
+       delete[]triangles;
+       triangles = 0;
+    }
+    void alloc()
+    {
+       delete triangles;
+       triangles = new Triangle[nTriangles + 1];
+    }
+    virtual void triangle(FTGlyphVectorizer::POINT * p1,
+                         FTGlyphVectorizer::POINT * p2,
+                         FTGlyphVectorizer::POINT * p3)
+    {
+       if (count_them)
+       {
+           ++nTriangles;
+           return;
+       }
+       triangles[nTriangles].p1 = p1;
+
+       triangles[nTriangles].p2 = p2;
+       triangles[nTriangles].p3 = p3;
+       ++nTriangles;
+    }
+};
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Animation functions.
+ *-----------------------------------------------------------------------------
+ */
+
+#define FAC_CAMERA     1.15
+#define MAX_CAMERA     5.00
+
+#define MIN_EXTRUSION   25.0
+#define MAX_EXTRUSION  305.0
+#define FAC_EXTRUSION    5.0
+
+#define FAC_FREQ       0.15
+#define FAC_AMPL       1.5
+
+#define FAC_RAND       25
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*-------------------------------------------------------------*/
+static void
+ t3d_anim_default(text3dstruct * tp)
+{
+    tp->phi   += tp->direction * angle_speed;
+    tp->theta += tp->direction * angle_speed;
+}
+
+/*-------------------------------------------------------------*/
+static void
+ t3d_anim_default2(text3dstruct * tp)
+{
+    tp->phi   += tp->direction * angle_speed;
+    tp->theta += tp->direction * angle_speed * 2.0 ;
+}
+
+/*-------------------------------------------------------------*/
+static void
+ t3d_anim_none(text3dstruct * tp)
+{
+}
+
+/*-------------------------------------------------------------*/
+static void
+ t3d_anim_crazy(text3dstruct * tp)
+{
+    int key = NRAND(32);
+
+    switch (key)
+    {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+       tp->theta += angle_speed;
+       break;
+    case 4:
+    case 5:
+    case 6:
+    case 7:
+       tp->theta -= angle_speed;
+       break;
+    case 8:
+    case 9:
+    case 10:
+    case 11:
+       tp->phi -= angle_speed;
+       break;
+    case 12:
+    case 13:
+    case 14:
+    case 15:
+       tp->phi += angle_speed;
+
+    case 16:
+    case 17:
+       if (tp->camera_dist / FAC_CAMERA > tp->ref_camera_dist)
+           tp->camera_dist /= FAC_CAMERA;
+       break;
+    case 18:
+    case 19:
+       if (tp->camera_dist * FAC_CAMERA < (tp->ref_camera_dist * MAX_CAMERA))
+           tp->camera_dist *= FAC_CAMERA;
+       break;
+    case 20:
+       if ((tp->extrusion - FAC_EXTRUSION) > MIN_EXTRUSION)
+           tp->extrusion -= FAC_EXTRUSION;
+       break;
+    case 21:
+       if ((tp->extrusion + FAC_EXTRUSION) < MAX_EXTRUSION)
+           tp->extrusion += FAC_EXTRUSION;
+       break;
+    case 22:
+    case 23:
+       tp->rampl /= FAC_AMPL;
+       break;
+    case 24:
+    case 25:
+       tp->rampl *= FAC_AMPL;
+       break;
+    case 26:
+    case 27:
+       tp->rfreq *= FAC_FREQ;
+       break;
+    case 28:
+    case 29:
+       tp->rfreq /= FAC_FREQ;
+       break;
+    }
+}
+
+static void
+ t3d_anim_updown(text3dstruct * tp)
+{
+    if (tp->direction > 0)
+    {
+        if (tp->camera_dist / FAC_CAMERA > tp->ref_camera_dist)
+            tp->camera_dist /= FAC_CAMERA;
+        else
+           tp->direction *=-1;
+    }
+    else
+    {
+        if (tp->camera_dist * FAC_CAMERA < (tp->ref_camera_dist * MAX_CAMERA))
+            tp->camera_dist *= FAC_CAMERA;
+        else
+           tp->direction *=-1;
+    }
+}
+
+static void
+ t3d_anim_extrusion(text3dstruct * tp)
+{
+    if (tp->direction > 0)
+    {
+        if ((tp->extrusion - FAC_EXTRUSION) > MIN_EXTRUSION)
+            tp->extrusion -= FAC_EXTRUSION;
+        else
+            tp->direction *=-1;
+    }
+    else
+    {
+        if ((tp->extrusion + FAC_EXTRUSION) < MAX_EXTRUSION)
+            tp->extrusion += FAC_EXTRUSION;
+        else
+            tp->direction *=-1;
+    }
+}
+
+static void
+ t3d_anim_rotatexy(text3dstruct * tp)
+{
+    tp->phi += tp->direction * angle_speed;
+}
+
+static void
+ t3d_anim_rotateyz(text3dstruct * tp)
+{
+    tp->theta += tp->direction * angle_speed;
+}
+
+static void
+ t3d_anim_frequency(text3dstruct * tp)
+{
+    /* Better visual if freq is a small value < 0.05 */
+    if (tp->direction > 0)
+    {
+        tp->rfreq /= FAC_FREQ;
+    }
+    else
+    {
+        tp->rfreq *= FAC_FREQ;
+    }
+
+    if (NRAND(100) < FAC_RAND )
+            tp->direction *=-1;
+}
+
+static void
+ t3d_anim_amplitude(text3dstruct * tp)
+{
+    if (tp->direction > 0)
+    {
+        tp->rampl /= FAC_AMPL;
+    }
+    else
+    {
+        tp->rampl *= FAC_AMPL;
+    }
+
+    if (NRAND(100) < FAC_RAND )
+            tp->direction *=-1;
+}
+
+static void
+ t3d_anim_fullrandom(text3dstruct * tp)
+{
+    if (NRAND(100) < FAC_RAND || tp->animation == 1)
+    {
+       tp->animation = NRAND(anims);
+    }
+    anim_array[tp->animation](tp);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/*-------------------------------------------------------------*/
+/*-------------------------------------------------------------*/
+/*
+ *-----------------------------------------------------------------------------
+ *    "Main" local funcs.
+ *-----------------------------------------------------------------------------
+ */
+
+static void
+ Reshape(ModeInfo * mi, int width, int height)
+{
+    text3dstruct *tp = &text3d[MI_SCREEN(mi)];
+
+    glViewport(0, 0, tp->WinW = (GLint) width, tp->WinH = (GLint) height);
+
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    gluPerspective(60.0, (GLdouble) width / (GLdouble) height, 10, 10000);
+    glMatrixMode(GL_MODELVIEW);
+}
+
+/*-------------------------------------------------------------*/
+static void
+ Animate(text3dstruct * tp)
+{
+    anim_array[tp->animation](tp);
+}
+
+/*-------------------------------------------------------------*/
+static void
+ Draw(text3dstruct * tp,
+      Display * display,
+      Window window)
+{
+    int text_length;
+    char *c_text;
+
+    if (!nosplit)
+    {
+       text_length = index_dir(tp->words, (char *) " ");
+       if (text_length == 0)
+           text_length = strlen(tp->words);
+       if ((c_text = (char *) malloc(text_length)) != NULL)
+       strncpy(c_text, tp->words, text_length);
+    }
+    else
+    {
+       c_text = tp->words_start;
+       text_length = strlen(tp->words_start);
+    }
+    GLTTFont font(tp->face);
+
+    if (!font.create(DEF_FONTSIZE))
+       return;
+
+    FTGlyphVectorizer *vec = new FTGlyphVectorizer[text_length];
+    GLTTGlyphTriangles **tri = new GLTTGlyphTriangles *[text_length];
+
+    int i;
+
+    for (i = 0; i < text_length; ++i)
+       tri[i] = new GLTTGlyphTriangles(vec + i);
+
+    if (tp->camera_dist == 0.0)
+       /* PURIFY reports an Array Bounds Read on the next line */
+       tp->ref_camera_dist = tp->camera_dist = font.getWidth(c_text) * 0.75;
+    double min_y = 1e20;
+    double max_y = -1e20;
+    double size_x = 0.0;
+
+    for (i = 0; i < text_length; ++i)
+    {
+       int ch = (unsigned char) c_text[i];
+
+#if ((XMESA_MAJOR_VERSION > 3 ) || (( XMESA_MAJOR_VERSION == 3 ) && (XMESA_MINOR_VERSION > 0 )))
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+       glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
+       glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+       glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+       glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+#endif
+
+       FTGlyph *g = font.getFont()->getGlyph(ch);
+
+       if (g == 0)
+           continue;
+       FTGlyphVectorizer & v = vec[i];
+       v.setPrecision(10.0);
+       /* PURIFY reports an Array Bounds Write on the next line */
+       if (!v.init(g))
+           continue;
+
+       size_x += v.getAdvance();
+
+       if (!v.vectorize())
+           continue;
+
+       for (int c = 0; c < v.getNContours(); ++c)
+       {
+           FTGlyphVectorizer::Contour * contour = v.getContour(c);
+           if (contour == 0)
+               continue;
+           for (int j = 0; j < contour->nPoints; ++j)
+           {
+               FTGlyphVectorizer::POINT * point = contour->points + j;
+               if (point->y < min_y)
+                   min_y = point->y;
+               if (point->y > max_y)
+                   max_y = point->y;
+               point->data = (void *) new double[6];
+           }
+       }
+       GLTTGlyphTriangles *t = tri[i];
+
+       if (!t->init(g))
+           continue;
+
+       t->count_them = GLTT_TRUE;
+       t->nTriangles = 0;
+       t->triangulate();
+
+       t->count_them = GLTT_FALSE;
+       t->alloc();
+       t->nTriangles = 0;
+       t->triangulate();
+    }
+
+    if (!nosplit)
+       (void) free((void *) c_text);
+    if (size_x == 0.0)
+    {
+       (void) fprintf(stderr, "Please give something to draw !\n");
+       return;
+    }
+
+    double y_delta = (min_y + max_y) / 2. + min_y + 50;
+
+    for (i = 0; i < text_length; ++i)
+    {
+
+#if ((XMESA_MAJOR_VERSION > 3 ) || (( XMESA_MAJOR_VERSION == 3 ) && (XMESA_MINOR_VERSION > 0 )))
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+       glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
+       glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+       glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+       glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+#endif
+
+       FTGlyphVectorizer & v = vec[i];
+
+       for (int c = 0; c < v.getNContours(); ++c)
+       {
+           FTGlyphVectorizer::Contour * contour = v.getContour(c);
+           if (contour == 0)
+               continue;
+           for (int j = 0; j < contour->nPoints; ++j)
+           {
+               FTGlyphVectorizer::POINT * point = contour->points + j;
+               point->y -= y_delta;
+           }
+       }
+    }
+
+#define TWO_LIGHTS
+#define ALL_STUFF
+
+#ifdef ALL_STUFF
+    float front_emission[4] = {0.1, 0.1, 0.1, 0};
+    float front_ambient[4]  = {0.2, 0.2, 0.2, 0};
+    float front_diffuse[4]  = {0.95, 0.95, 0.8, 0};
+    float back_diffuse[4]   = {0.75, 0.75, 0.95, 0};
+    float front_specular[4] = {0.6, 0.6, 0.6, 0};
+
+    glMaterialfv(GL_FRONT, GL_EMISSION, front_emission);
+    glMaterialfv(GL_FRONT, GL_AMBIENT, front_ambient);
+    glMaterialfv(GL_FRONT, GL_DIFFUSE, front_diffuse);
+    glMaterialfv(GL_FRONT, GL_SPECULAR, front_specular);
+    glMaterialf(GL_FRONT, GL_SHININESS, 32.0);
+#ifdef TWO_LIGHTS
+    float light1_ambient[4]  = {0.3, 0.3, 0.3, 1};
+    float light1_diffuse[4]  = {0.9, 0.9, 0.9, 1};     /* A "white" light */
+    float light1_specular[4] = {0.7, 0.7, 0.7, 1};
+    float light1_position[4] = {-1, 1, 1, 0};
+
+    glLightfv(GL_LIGHT1, GL_AMBIENT, light1_ambient);
+    glLightfv(GL_LIGHT1, GL_DIFFUSE, light1_diffuse);
+    glLightfv(GL_LIGHT1, GL_SPECULAR, light1_specular);
+    glLightfv(GL_LIGHT1, GL_POSITION, light1_position);
+    glEnable(GL_LIGHT1);
+
+    float light2_ambient[4]  = {0.1, 0.1, 0.1, 1};
+    float light2_diffuse[4]  = {0.85, 0.3, 0.3, 1};    /* A "red" light */
+    float light2_specular[4] = {0.6, 0.6, 0.6, 1};
+    float light2_position[4] = {1, -1, -1, 0};
+
+    glLightfv(GL_LIGHT2, GL_AMBIENT, light2_ambient);
+    glLightfv(GL_LIGHT2, GL_DIFFUSE, light2_diffuse);
+    glLightfv(GL_LIGHT2, GL_SPECULAR, light2_specular);
+    glLightfv(GL_LIGHT2, GL_POSITION, light2_position);
+    glEnable(GL_LIGHT2);
+#else
+    GLfloat pos[4] = {-1.0, 1.0, 1.0, 0.0};
+
+    glLightfv(GL_LIGHT0, GL_POSITION, pos);
+    glEnable(GL_LIGHT0);
+#endif                         /* TWO_LIGHTS */
+
+    float back_color[4] = {0.2, 0.2, 0.6, 0};
+
+    glMaterialfv(GL_BACK, GL_DIFFUSE, back_color);
+    glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
+    glCullFace(GL_BACK);
+    glFrontFace(GL_CCW);
+    glEnable(GL_CULL_FACE);
+
+    glColorMaterial(GL_FRONT, GL_DIFFUSE);
+    glEnable(GL_COLOR_MATERIAL);
+#endif                         /* ALL_STUFF */
+
+    spheric_camera(tp, tp->center_x,
+                  tp->center_y + size_x / 2.,
+                  0,
+                  tp->phi, tp->theta + M_PI / 2, tp->camera_dist);
+    glClearColor(0, 0, 0, 0);
+    glEnable(GL_DEPTH_TEST);
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+
+#ifdef ALL_STUFF
+    glEnable(GL_LIGHTING);
+    glShadeModel(GL_SMOOTH);
+    glEnable(GL_NORMALIZE);
+#endif
+
+    double base_x = 0.0;
+
+    for (i = 0; i < text_length; ++i)
+    {
+
+#if ((XMESA_MAJOR_VERSION > 3 ) || (( XMESA_MAJOR_VERSION == 3 ) && (XMESA_MINOR_VERSION > 0 )))
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+       glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
+       glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+       glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+       glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+#endif
+
+       FTGlyphVectorizer & v = vec[i];
+
+       int c;
+
+       for (c = 0; c < v.getNContours(); ++c)
+       {
+           FTGlyphVectorizer::Contour * contour = v.getContour(c);
+           if (contour == 0)
+               continue;
+
+           for (int j = 0; j < contour->nPoints; ++j)
+           {
+               FTGlyphVectorizer::POINT * point = contour->points + j;
+               double cx = -point->y;
+               double cy = base_x + point->x;
+               double phi = sin(cy * tp->rfreq) * tp->rampl * M_PI / 2.;
+               double rcx = cx * cos(phi);
+               double rcz = cx * sin(phi);
+
+               double *p = (double *) point->data;
+               double *n = p + 3;
+
+               p[0] = rcx;
+               p[1] = cy;
+               p[2] = rcz;
+
+               n[0] = -sin(phi);
+               n[1] = 0.;
+               n[2] = cos(phi);
+           }
+       }
+
+       GLTTGlyphTriangles::Triangle * triangles = tri[i]->triangles;
+       int nTriangles = tri[i]->nTriangles;
+
+       glBegin(GL_TRIANGLES);
+
+       for (int j = 0; j < nTriangles; ++j)
+       {
+           GLTTGlyphTriangles::Triangle & t = triangles[j];
+
+           double *p1 = ((double *) t.p1->data);
+           double *p2 = ((double *) t.p2->data);
+           double *p3 = ((double *) t.p3->data);
+           double *n1 = p1 + 3;
+           double *n2 = p2 + 3;
+           double *n3 = p3 + 3;
+
+#ifdef ALL_STUFF
+           glColor4fv(front_diffuse);
+#endif
+
+           glNormal3dv(n1);
+           glVertex3dv(p1);
+           glNormal3dv(n2);
+           glVertex3dv(p2);
+           glNormal3dv(n3);
+           glVertex3dv(p3);
+
+#ifdef ALL_STUFF
+           glColor4fv(back_diffuse);
+#endif
+
+           glNormal3d(-n3[0], 0., -n3[2]);
+           glVertex3d(p3[0] - n3[0] * tp->extrusion,
+                      p3[1],
+                      p3[2] - n3[2] * tp->extrusion);
+           glNormal3d(-n2[0], 0., -n2[2]);
+           glVertex3d(p2[0] - n2[0] * tp->extrusion,
+                      p2[1],
+                      p2[2] - n2[2] * tp->extrusion);
+           glNormal3d(-n1[0], 0., -n1[2]);
+           glVertex3d(p1[0] - n1[0] * tp->extrusion,
+                      p1[1],
+                      p1[2] - n1[2] * tp->extrusion);
+       }
+       glEnd();
+
+       for (c = 0; c < v.getNContours(); ++c)
+       {
+           FTGlyphVectorizer::Contour * contour = v.getContour(c);
+           if (contour == 0)
+               continue;
+           glBegin(GL_QUAD_STRIP);
+           for (int j = 0; j <= contour->nPoints; ++j)
+           {
+               int j1 = (j < contour->nPoints) ? j : 0;
+               int j0 = (j1 == 0) ? (contour->nPoints - 1) : (j1 - 1);
+
+               FTGlyphVectorizer::POINT * point0 = contour->points + j0;
+               FTGlyphVectorizer::POINT * point1 = contour->points + j1;
+               double *p0 = (double *) point0->data;
+               double *p1 = (double *) point1->data;
+               double *e = p0 + 3;
+               double vx = p1[0] - p0[0];
+               double vy = p1[1] - p0[1];
+               double vz = p1[2] - p0[2];
+               double nx = -vy * e[2];
+               double ny = e[2] * vx - vz * e[0];
+               double nz = e[0] * vy;
+#ifdef DIFFUSE_COLOR
+               double u = double ((j * 2) % contour->nPoints) / double (contour->nPoints);
+               double r, g, b;
+
+               hsv_to_rgb(u, 0.7, 0.7, &r, &g, &b);
+               glColor4f(r, g, b, 1);  // diffuse color of material
+#else
+               GLfloat blue[4] = {0.35, 0.35, 1.0, 1.0};
+               glColor4fv(blue);
+#endif
+
+               glNormal3f(nx, ny, nz);
+               glVertex3f(p0[0] - e[0] * tp->extrusion,
+                          p0[1],
+                          p0[2] - e[2] * tp->extrusion);
+               glNormal3f(nx, ny, nz);
+               glVertex3f(p0[0], p0[1], p0[2]);
+           }
+           glEnd();
+       }
+
+       base_x += v.getAdvance();
+    }
+
+#ifdef ALL_STUFF
+    glDisable(GL_NORMALIZE);
+    glDisable(GL_LIGHTING);
+    glShadeModel(GL_FLAT);
+#endif
+    glPopMatrix();
+
+    glXSwapBuffers(display, window);
+
+    for (i = 0; i < text_length; ++i)
+    {
+
+#if ((XMESA_MAJOR_VERSION > 3 ) || (( XMESA_MAJOR_VERSION == 3 ) && (XMESA_MINOR_VERSION > 0 )))
+       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+       glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
+       glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
+       glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
+       glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+       glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+#endif
+
+       delete tri[i];
+
+       FTGlyphVectorizer & v = vec[i];
+       for (int c = 0; c < v.getNContours(); ++c)
+       {
+           FTGlyphVectorizer::Contour * contour = v.getContour(c);
+           if (contour == 0)
+               continue;
+           for (int j = 0; j < contour->nPoints; ++j)
+           {
+               FTGlyphVectorizer::POINT * point = contour->points + j;
+               delete[](double *) point->data;
+               point->data = 0;
+           }
+       }
+    }
+
+    delete[]tri;
+    delete[]vec;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Xlock hooks.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Initialize text3d.  Called each time the window changes.
+ *-----------------------------------------------------------------------------
+ */
+
+void
+ init_text3d(ModeInfo * mi)
+{
+    int i;
+    text3dstruct *tp;
+
+    if (text3d == NULL)
+    {
+       if ((text3d = (text3dstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof(text3dstruct))) == NULL)
+           return;
+    }
+    tp = &text3d[MI_SCREEN(mi)];
+    tp->wire = MI_IS_WIREFRAME(mi);
+    tp->extrusion = extrusion;
+    tp->rampl = rampl;
+    tp->rfreq = rfreq;
+    tp->camera_dist = 0.0;
+
+    /* Get animation function */
+    tp->animation = 0; /* Not found equals "Random" */
+    tp->direction = (LRAND() & 1) ? 1 : -1; /* random direction */
+    tp->rampl *= tp->direction;
+    tp->rfreq *= tp->direction;
+    for(i=0;anim_names[i] != NULL;i++)
+    {
+        if ( !strcmp( anim_names[i], animate ) )
+        {
+               tp->animation = i;
+               break;
+        }
+    }
+    if (!tp->animation)
+    {
+       /* Random !!! */
+       tp->animation = NRAND(anims);
+    }
+    else
+    {
+        tp->animation --;
+    }
+
+    if (MI_IS_DEBUG(mi))
+    {
+       (void) fprintf(stderr,
+                  "%s:\n\ttp->animation[%d]=%s\n",
+                  MI_NAME(mi), tp->animation, anim_names[tp->animation+1]);
+    }
+
+
+    tp->counter = 0;
+
+    if ((tp->glx_context = init_GL(mi)) != NULL)
+    {
+
+       Reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+       /*glDrawBuffer(GL_BACK); */
+       if (MI_IS_DEBUG(mi))
+       {
+           (void) fprintf(stderr,
+                          "%s:\n\tcamera_dist=%.1f\n\ttheta=%.1f\n\tphi=%.1f\n\textrusion=%.1f\n\trampl=%.1f.\n\trfreq=%.1f\n\tdirection=%d\n",
+                          MI_NAME(mi), tp->camera_dist, tp->theta, tp->phi,
+                          tp->extrusion, tp->rampl,tp->rfreq,tp->direction);
+       }
+/*
+       glXSwapBuffers(display, window);
+*/
+
+    }
+    else
+    {
+       MI_CLEARWINDOW(mi);
+    }
+       fontfile = getModeFont(mode_font);
+       if (!fontfile) {
+               release_text3d(mi);
+#ifdef USE_BLANK
+               (void) fprintf(stderr,
+                       "%s: jumping to 'blank' mode.\n", MI_NAME(mi));
+               init_blank(mi);
+#endif
+               return;
+    }
+    tp->face = new FTFace;
+    if (!tp->face || !tp->face->open(fontfile)) {
+               (void) fprintf(stderr, "%s: unable to open True Type font %s !\n", MI_NAME(mi), fontfile);
+       if (tp->face)
+                       delete tp->face;
+               release_text3d(mi);
+#ifdef USE_BLANK
+               (void) fprintf(stderr,
+                               "%s: jumping to 'blank' mode.\n", MI_NAME(mi));
+               init_blank(mi);
+#endif
+               return;
+    }
+    if (MI_IS_DEBUG(mi)) {
+               (void) fprintf(stderr,
+                       "%s:\n\tfontfile=%s .\n", MI_NAME(mi), fontfile);
+    }
+
+    /* Do not free fontfile getModeFont handles potential leak */
+
+    /* Initialize displayed string */
+    tp->words_start = tp->words =
+       getWords(MI_SCREEN(mi), MI_NUM_SCREENS(mi));
+    if (MI_IS_DEBUG(mi))
+    {
+       (void) fprintf(stderr,
+                  "%s words:\n%s\n",
+                  MI_NAME(mi), tp->words);
+    }
+
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Called by the mainline code periodically to update the display.
+ *-----------------------------------------------------------------------------
+ */
+void
+ draw_text3d(ModeInfo * mi)
+{
+    Display *display = MI_DISPLAY(mi);
+    Window window = MI_WINDOW(mi);
+    text3dstruct *tp;
+
+    if (text3d == NULL) {
+#ifdef USE_BLANK
+         draw_blank(mi);
+#endif
+         return;
+       }
+    tp = &text3d[MI_SCREEN(mi)];
+
+    MI_IS_DRAWN(mi) = True;
+    if (!tp->glx_context)
+       return;
+    tp->counter = tp->counter + 1;
+    if (tp->counter > MI_CYCLES(mi) & !nosplit)
+    {
+       int text_length = index_dir(tp->words, (char *) " ");
+
+       /* Every now and then, get a new word */
+       if (text_length == 0)
+           text_length = strlen(tp->words);
+       tp->counter = 0;
+       tp->words += text_length;
+       text_length = strlen(tp->words);
+       if (text_length == 0)
+       {
+           tp->words_start = tp->words =
+               getWords(MI_SCREEN(mi), MI_NUM_SCREENS(mi));
+       }
+    }
+    glDrawBuffer(GL_BACK);
+    glXMakeCurrent(display, window, *(tp->glx_context));
+
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+    Draw(tp, display, window);
+    Animate(tp);
+    if (MI_IS_DEBUG(mi))
+    {
+       (void) fprintf(stderr,
+                      "%s:\n\tcamera_dist=%.1f\n\ttheta=%.1f\n\tphi=%.1f\n\textrusion=%.1f\n\trampl=%.1f\n\trfreq=%.1f\n\tdirection=%d\n",
+                      MI_NAME(mi), tp->camera_dist, tp->theta, tp->phi,
+                      tp->extrusion, tp->rampl,tp->rfreq,tp->direction);
+    }
+
+/*
+    glXSwapBuffers(display, window);
+*/
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    The display is being taken away from us.  Free up malloc'ed
+ *      memory and X resources that we've alloc'ed.  Only called
+ *      once, we must zap everything for every screen.
+ *-----------------------------------------------------------------------------
+ */
+
+void
+ release_text3d(ModeInfo * mi)
+{
+    if (text3d != NULL)
+    {
+       for (int screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+       {
+           text3dstruct *tp = &text3d[screen];
+
+           if (tp->face)
+               delete tp->face;
+       }
+       (void) free((void *) text3d);
+       text3d = (text3dstruct *) NULL;
+    }
+#ifdef USE_BLANK
+    else
+       release_blank(mi);
+#endif
+    FreeAllGL(mi);
+}
+
+void
+ refresh_text3d(ModeInfo * mi)
+{
+    /* Do nothing, it will refresh by itself :) */
+}
+
+void
+ change_text3d(ModeInfo * mi)
+{
+    text3dstruct *tp;
+
+    if (text3d == NULL) {
+#ifdef USE_BLANK
+         refresh_blank(mi);
+#endif
+         return;
+       }
+    tp = &text3d[MI_SCREEN(mi)];
+
+    if (!tp->glx_context)
+       return;
+    glDrawBuffer(GL_BACK);
+    glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(tp->glx_context));
+}
+
+#endif                         /* MODE_text3d */
diff --git a/modes/glx/text3d.h b/modes/glx/text3d.h
new file mode 100644 (file)
index 0000000..53f0d1c
--- /dev/null
@@ -0,0 +1,46 @@
+/* text3d --- Shows moving 3D texts */
+
+/* Copyright (c) E. Lassauge, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * My e-mail address changed to lassauge@mail.dotcom.fr
+ * Web site at http://perso.libertysurf.fr/lassauge/
+ *
+ * Eric Lassauge  (October-28-1999)
+ *
+ */
+
+extern      "C" {
+#include <GL/gl.h>
+#include <GL/glx.h>
+} typedef struct {
+
+       /* global Parameters */
+       int         wire, counter, animation;
+       float       extrusion;
+       float       rampl;
+       float       rfreq;
+       int         direction;
+       char       *words, *words_start;
+       /* per Screen variables */
+       GLint       WinH, WinW;
+       GLXContext *glx_context;
+       FTFace     *face;
+       float       center_x, center_y, center_z;
+       float       phi, theta, radius;
+       double      camera_dist;
+       double      ref_camera_dist;
+
+} text3dstruct;
diff --git a/modes/glx/tube.c b/modes/glx/tube.c
new file mode 100644 (file)
index 0000000..87a8e7f
--- /dev/null
@@ -0,0 +1,211 @@
+/* tube, Copyright (c) 2001 Jamie Zawinski <jwz@jwz.org>
+ * Utility functions to create tubes and cones in GL.
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ */
+
+#include "config.h"
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glx.h>
+
+static void
+unit_tube (int faces, Bool smooth, Bool wire)
+{
+  int i;
+  GLfloat step = M_PI * 2 / faces;
+  GLfloat s2 = step/2;
+  GLfloat th;
+  GLfloat x, y, x0 = 0.0, y0 = 0.0;
+  int z = 0;
+
+  /* side walls
+   */
+  glFrontFace(GL_CCW);
+  glBegin (wire ? GL_LINES : (smooth ? GL_QUAD_STRIP : GL_QUADS));
+
+  th = 0;
+  x = 1;
+  y = 0;
+
+  if (!smooth)
+    {
+      x0 = cos (s2);
+      y0 = sin (s2);
+    }
+
+  if (smooth) faces++;
+
+  for (i = 0; i < faces; i++)
+    {
+      if (smooth)
+        glNormal3f(x, 0, y);
+      else
+        glNormal3f(x0, 0, y0);
+
+      glVertex3f(x, 0, y);
+      glVertex3f(x, 1, y);
+
+      th += step;
+      x  = cos (th);
+      y  = sin (th);
+
+      if (!smooth)
+        {
+          x0 = cos (th + s2);
+          y0 = sin (th + s2);
+
+          glVertex3f(x, 1, y);
+          glVertex3f(x, 0, y);
+        }
+    }
+  glEnd();
+
+  /* End caps
+   */
+  for (z = 0; z <= 1; z++)
+    {
+      glFrontFace(z == 0 ? GL_CCW : GL_CW);
+      glNormal3f(0, (z == 0 ? -1 : 1), 0);
+      glBegin(wire ? GL_LINE_LOOP : GL_TRIANGLE_FAN);
+      if (! wire) glVertex3f(0, z, 0);
+      for (i = 0, th = 0; i <= faces; i++)
+        {
+          GLfloat x = cos (th);
+          GLfloat y = sin (th);
+          glVertex3f(x, z, y);
+          th += step;
+        }
+      glEnd();
+    }
+}
+
+
+static void
+unit_cone (int faces, Bool smooth, Bool wire)
+{
+  int i;
+  GLfloat step = M_PI * 2 / faces;
+  GLfloat s2 = step/2;
+  GLfloat th;
+  GLfloat x, y, x0, y0;
+
+  /* side walls
+   */
+  glFrontFace(GL_CW);
+  glBegin(wire ? GL_LINES : GL_TRIANGLES);
+
+  th = 0;
+  x = 1;
+  y = 0;
+  x0 = cos (s2);
+  y0 = sin (s2);
+
+  for (i = 0; i < faces; i++)
+    {
+      glNormal3f(x0, 0, y0);
+      glVertex3f(0,  1, 0);
+
+      if (smooth) glNormal3f(x, 0, y);
+      glVertex3f(x, 0, y);
+
+      th += step;
+      x0 = cos (th + s2);
+      y0 = sin (th + s2);
+      x  = cos (th);
+      y  = sin (th);
+
+      if (smooth) glNormal3f(x, 0, y);
+      glVertex3f(x, 0, y);
+    }
+  glEnd();
+
+  /* End cap
+   */
+  glFrontFace(GL_CCW);
+  glNormal3f(0, -1, 0);
+  glBegin(wire ? GL_LINE_LOOP : GL_TRIANGLE_FAN);
+  if (! wire) glVertex3f(0, 0, 0);
+  for (i = 0, th = 0; i <= faces; i++)
+    {
+      GLfloat x = cos (th);
+      GLfloat y = sin (th);
+      glVertex3f(x, 0, y);
+      th += step;
+    }
+  glEnd();
+}
+
+
+static void
+tube_1 (GLfloat x1, GLfloat y1, GLfloat z1,
+        GLfloat x2, GLfloat y2, GLfloat z2,
+        GLfloat diameter, GLfloat cap_size,
+        int faces, Bool smooth, Bool wire,
+        Bool cone_p)
+{
+  GLfloat length, angle, a, b, c;
+
+  if (diameter <= 0) abort();
+
+  a = (x2 - x1);
+  b = (y2 - y1);
+  c = (z2 - z1);
+
+  length = sqrt (a*a + b*b + c*c);
+  angle = acos (a / length);
+
+  glPushMatrix();
+  glTranslatef(x1, y1, z1);
+  glScalef (length, length, length);
+
+  if (c == 0 && b == 0)
+    glRotatef (angle / (M_PI / 180), 0, 1, 0);
+  else
+    glRotatef (angle / (M_PI / 180), 0, -c, b);
+
+  glRotatef (-90, 0, 0, 1);
+  glScalef (diameter/length, 1, diameter/length);
+
+  /* extend the endpoints of the tube by the cap size in both directions */
+  if (cap_size != 0)
+    {
+      GLfloat c = cap_size/length;
+      glTranslatef (0, -c, 0);
+      glScalef (1, 1+c+c, 1);
+    }
+
+  if (cone_p)
+    unit_cone (faces, smooth, wire);
+  else
+    unit_tube (faces, smooth, wire);
+  glPopMatrix();
+}
+
+
+void
+tube (GLfloat x1, GLfloat y1, GLfloat z1,
+      GLfloat x2, GLfloat y2, GLfloat z2,
+      GLfloat diameter, GLfloat cap_size,
+      int faces, Bool smooth, Bool wire)
+{
+  tube_1 (x1, y1, z1, x2, y2, z2, diameter, cap_size, faces, smooth, wire,
+          False);
+}
+
+
+void
+cone (GLfloat x1, GLfloat y1, GLfloat z1,
+      GLfloat x2, GLfloat y2, GLfloat z2,
+      GLfloat diameter, GLfloat cap_size,
+      int faces, Bool smooth, Bool wire)
+{
+  tube_1 (x1, y1, z1, x2, y2, z2, diameter, cap_size, faces, smooth, wire,
+          True);
+}
diff --git a/modes/glx/tube.h b/modes/glx/tube.h
new file mode 100644 (file)
index 0000000..1fd065d
--- /dev/null
@@ -0,0 +1,26 @@
+/* tube, Copyright (c) 2001 Jamie Zawinski <jwz@jwz.org>
+ * Utility functions to create tubes and cones in GL.
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ */
+
+#ifndef __TUBE_H__
+#define __TUBE_H__
+
+extern void tube (GLfloat x1, GLfloat y1, GLfloat z1,
+                  GLfloat x2, GLfloat y2, GLfloat z2,
+                  GLfloat diameter, GLfloat cap_size,
+                  int faces, Bool smooth, Bool wire);
+
+extern void cone (GLfloat x1, GLfloat y1, GLfloat z1,
+                  GLfloat x2, GLfloat y2, GLfloat z2,
+                  GLfloat diameter, GLfloat cap_size,
+                  int faces, Bool smooth, Bool wire);
+
+#endif /* __TUBE_H__ */
diff --git a/modes/glx/whale.c b/modes/glx/whale.c
new file mode 100644 (file)
index 0000000..32ff7ea
--- /dev/null
@@ -0,0 +1,1895 @@
+/* atlantis --- Shows moving 3D sea animals */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)whale.c      5.01 2001/04/17 xlockmore";
+
+#endif
+
+/* Copyright (c) E. Lassauge, 1998. */
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for this mode was written by Mark J. Kilgard
+ * as a demo for openGL programming.
+ *
+ * Porting it to xlock  was possible by comparing the original Mesa's morph3d
+ * demo with it's ported version to xlock, so thanks for Marcelo F. Vianna
+ * (look at morph3d.c) for his indirect help.
+ *
+ * Thanks goes also to Brian Paul for making it possible and inexpensive
+ * to use OpenGL at home.
+ *
+ * My e-mail address is lassauge@mail.dotcom.fr
+ *
+ * Eric Lassauge  (May-13-1998)
+ *
+ */
+
+/*-
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+#ifndef STANDALONE
+#include "xlock.h"
+#endif
+
+#ifdef MODE_atlantis
+
+#ifdef STANDALONE
+#include <math.h>
+#include <GL/glx.h>
+#endif
+
+#include "atlantis.h"
+/* *INDENT-OFF* */
+static float N001[3] = {0.019249 ,0.011340 ,-0.999750};
+static float N002[3] = {-0.132579 ,0.954547 ,0.266952};
+static float N003[3] = {-0.196061 ,0.980392 ,-0.019778};
+static float N004[3] = {0.695461 ,0.604704 ,0.388158};
+static float N005[3] = {0.870600 ,0.425754 ,0.246557};
+static float N006[3] = {-0.881191 ,0.392012 ,0.264251};
+#if 0
+static float N007[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N008[3] = {-0.341437 ,0.887477 ,0.309523};
+static float N009[3] = {0.124035 ,-0.992278 ,0.000000};
+static float N010[3] = {0.242536 ,0.000000 ,-0.970143};
+static float N011[3] = {0.588172 ,0.000000 ,0.808736};
+static float N012[3] = {0.929824 ,-0.340623 ,-0.139298};
+static float N013[3] = {0.954183 ,0.267108 ,-0.134865};
+static float N014[3] = {0.495127 ,0.855436 ,-0.151914};
+static float N015[3] = {-0.390199 ,0.906569 ,-0.160867};
+static float N016[3] = {-0.923605 ,0.354581 ,-0.145692};
+static float N017[3] = {-0.955796 ,-0.260667 ,-0.136036};
+static float N018[3] = {-0.501283 ,-0.853462 ,-0.142540};
+static float N019[3] = {0.405300 ,-0.901974 ,-0.148913};
+static float N020[3] = {0.909913 ,-0.392746 ,-0.133451};
+static float N021[3] = {0.936494 ,0.331147 ,-0.115414};
+static float N022[3] = {0.600131 ,0.793724 ,-0.099222};
+static float N023[3] = {-0.231556 ,0.968361 ,-0.093053};
+static float N024[3] = {-0.844369 ,0.525330 ,-0.105211};
+static float N025[3] = {-0.982725 ,-0.136329 ,-0.125164};
+static float N026[3] = {-0.560844 ,-0.822654 ,-0.093241};
+static float N027[3] = {0.263884 ,-0.959981 ,-0.093817};
+static float N028[3] = {0.842057 ,-0.525192 ,-0.122938};
+static float N029[3] = {0.921620 ,0.367565 ,-0.124546};
+static float N030[3] = {0.613927 ,0.784109 ,-0.090918};
+static float N031[3] = {-0.448754 ,0.888261 ,-0.098037};
+static float N032[3] = {-0.891865 ,0.434376 ,-0.126077};
+static float N033[3] = {-0.881447 ,-0.448017 ,-0.149437};
+static float N034[3] = {-0.345647 ,-0.922057 ,-0.174183};
+static float N035[3] = {0.307998 ,-0.941371 ,-0.137688};
+static float N036[3] = {0.806316 ,-0.574647 ,-0.140124};
+static float N037[3] = {0.961346 ,0.233646 ,-0.145681};
+static float N038[3] = {0.488451 ,0.865586 ,-0.110351};
+static float N039[3] = {-0.374290 ,0.921953 ,-0.099553};
+static float N040[3] = {-0.928504 ,0.344533 ,-0.138485};
+static float N041[3] = {-0.918419 ,-0.371792 ,-0.135189};
+static float N042[3] = {-0.520666 ,-0.833704 ,-0.183968};
+static float N043[3] = {0.339204 ,-0.920273 ,-0.195036};
+static float N044[3] = {0.921475 ,-0.387382 ,-0.028636};
+static float N045[3] = {0.842465 ,0.533335 ,-0.076204};
+static float N046[3] = {0.380110 ,0.924939 ,0.002073};
+static float N047[3] = {-0.276128 ,0.961073 ,-0.009579};
+static float N048[3] = {-0.879684 ,0.473001 ,-0.049250};
+static float N049[3] = {-0.947184 ,-0.317614 ,-0.044321};
+static float N050[3] = {-0.642059 ,-0.764933 ,-0.051363};
+static float N051[3] = {0.466794 ,-0.880921 ,-0.077990};
+static float N052[3] = {0.898509 ,-0.432277 ,0.076279};
+static float N053[3] = {0.938985 ,0.328141 ,0.103109};
+static float N054[3] = {0.442420 ,0.895745 ,0.043647};
+static float N055[3] = {-0.255163 ,0.966723 ,0.018407};
+static float N056[3] = {-0.833769 ,0.540650 ,0.111924};
+static float N057[3] = {-0.953653 ,-0.289939 ,0.080507};
+static float N058[3] = {-0.672357 ,-0.730524 ,0.119461};
+static float N059[3] = {0.522249 ,-0.846652 ,0.102157};
+static float N060[3] = {0.885868 ,-0.427631 ,0.179914};
+#if 0
+static float N061[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N062[3] = {0.648942 ,0.743116 ,0.163255};
+static float N063[3] = {-0.578967 ,0.807730 ,0.111219};
+#if 0
+static float N064[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float N065[3] = {-0.909864 ,-0.352202 ,0.219321};
+static float N066[3] = {-0.502541 ,-0.818090 ,0.279610};
+static float N067[3] = {0.322919 ,-0.915358 ,0.240504};
+static float N068[3] = {0.242536 ,0.000000 ,-0.970143};
+static float N069[3] = {0.000000 ,1.000000 ,0.000000};
+static float N070[3] = {0.000000 ,1.000000 ,0.000000};
+static float N071[3] = {0.000000 ,1.000000 ,0.000000};
+static float N072[3] = {0.000000 ,1.000000 ,0.000000};
+static float N073[3] = {0.000000 ,1.000000 ,0.000000};
+static float N074[3] = {0.000000 ,1.000000 ,0.000000};
+static float N075[3] = {0.031220 ,0.999025 ,-0.031220};
+static float N076[3] = {0.000000 ,1.000000 ,0.000000};
+static float N077[3] = {0.446821 ,0.893642 ,0.041889};
+static float N078[3] = {0.863035 ,-0.100980 ,0.494949};
+static float N079[3] = {0.585597 ,-0.808215 ,0.062174};
+static float N080[3] = {0.000000 ,1.000000 ,0.000000};
+static float N081[3] = {1.000000 ,0.000000 ,0.000000};
+static float N082[3] = {0.000000 ,1.000000 ,0.000000};
+static float N083[3] = {-1.000000 ,0.000000 ,0.000000};
+static float N084[3] = {-0.478893 ,0.837129 ,-0.264343};
+static float N085[3] = {0.000000 ,1.000000 ,0.000000};
+static float N086[3] = {0.763909 ,0.539455 ,-0.354163};
+static float N087[3] = {0.446821 ,0.893642 ,0.041889};
+static float N088[3] = {0.385134 ,-0.908288 ,0.163352};
+static float N089[3] = {-0.605952 ,0.779253 ,-0.159961};
+static float N090[3] = {0.000000 ,1.000000 ,0.000000};
+static float N091[3] = {0.000000 ,1.000000 ,0.000000};
+static float N092[3] = {0.000000 ,1.000000 ,0.000000};
+static float N093[3] = {0.000000 ,1.000000 ,0.000000};
+static float N094[3] = {1.000000 ,0.000000 ,0.000000};
+static float N095[3] = {-1.000000 ,0.000000 ,0.000000};
+static float N096[3] = {0.644444 ,-0.621516 ,0.445433};
+static float N097[3] = {-0.760896 ,-0.474416 ,0.442681};
+static float N098[3] = {0.636888 ,-0.464314 ,0.615456};
+static float N099[3] = {-0.710295 ,0.647038 ,0.277168};
+static float N100[3] = {0.009604 ,0.993655 ,0.112063};
+#if 0
+static float N101[3] = {0.000000 ,1.000000 ,0.000000};
+static float N102[3] = {0.000000 ,1.000000 ,0.000000};
+static float N103[3] = {0.000000 ,1.000000 ,0.000000};
+static float N104[3] = {0.031837 ,0.999285 ,0.020415};
+static float N105[3] = {0.031837 ,0.999285 ,0.020415};
+static float N106[3] = {0.031837 ,0.999285 ,0.020415};
+static float N107[3] = {0.014647 ,0.999648 ,0.022115};
+static float N108[3] = {0.014647 ,0.999648 ,0.022115};
+static float N109[3] = {0.014647 ,0.999648 ,0.022115};
+static float N110[3] = {-0.985141 ,0.039475 ,0.167149};
+static float N111[3] = {-0.985141 ,0.039475 ,0.167149};
+static float N112[3] = {-0.985141 ,0.039475 ,0.167149};
+static float N113[3] = {0.000000 ,1.000000 ,0.000000};
+static float N114[3] = {0.000000 ,1.000000 ,0.000000};
+static float N115[3] = {0.000000 ,1.000000 ,0.000000};
+static float N116[3] = {0.000000 ,1.000000 ,0.000000};
+static float N117[3] = {0.000000 ,1.000000 ,0.000000};
+static float N118[3] = {0.000000 ,1.000000 ,0.000000};
+static float N119[3] = {0.000000 ,1.000000 ,0.000000};
+static float N120[3] = {0.000000 ,1.000000 ,0.000000};
+static float N121[3] = {0.000000 ,1.000000 ,0.000000};
+#endif
+static float iP001[3] = {18.74, 13.19, 3.76};
+static float P001[3] = {18.74, 13.19, 3.76};
+static float P002[3] = {0.00, 390.42, 10292.57};
+static float P003[3] = {55.80, 622.31, 8254.35};
+static float P004[3] = {20.80, 247.66, 10652.13};
+static float P005[3] = {487.51, 198.05, 9350.78};
+static float P006[3] = {-457.61, 199.04, 9353.01};
+#if 0
+static float P007[3] = {0.00, 259.00, 10276.27};
+#endif
+static float P008[3] = {-34.67, 247.64, 10663.71};
+static float iP009[3] = {97.46, 67.63, 593.82};
+static float iP010[3] = {-84.33, 67.63, 588.18};
+static float iP011[3] = {118.69, 8.98, -66.91};
+static float P009[3] = {97.46, 67.63, 593.82};
+static float P010[3] = {-84.33, 67.63, 588.18};
+static float P011[3] = {118.69, 8.98, -66.91};
+static float iP012[3] = {156.48, -31.95, 924.54};
+static float iP013[3] = {162.00, 110.22, 924.54};
+static float iP014[3] = {88.16, 221.65, 924.54};
+static float iP015[3] = {-65.21, 231.16, 924.54};
+static float iP016[3] = {-156.48, 121.97, 924.54};
+static float iP017[3] = {-162.00, -23.93, 924.54};
+static float iP018[3] = {-88.16, -139.10, 924.54};
+static float iP019[3] = {65.21, -148.61, 924.54};
+static float iP020[3] = {246.87, -98.73, 1783.04};
+static float iP021[3] = {253.17, 127.76, 1783.04};
+static float iP022[3] = {132.34, 270.77, 1783.04};
+static float iP023[3] = {-97.88, 285.04, 1783.04};
+static float iP024[3] = {-222.97, 139.80, 1783.04};
+static float iP025[3] = {-225.29, -86.68, 1783.04};
+static float iP026[3] = {-108.44, -224.15, 1783.04};
+static float iP027[3] = {97.88, -221.56, 1783.04};
+static float iP028[3] = {410.55, -200.66, 3213.87};
+static float iP029[3] = {432.19, 148.42, 3213.87};
+static float iP030[3] = {200.66, 410.55, 3213.87};
+static float iP031[3] = {-148.42, 432.19, 3213.87};
+static float iP032[3] = {-407.48, 171.88, 3213.87};
+static float iP033[3] = {-432.19, -148.42, 3213.87};
+static float iP034[3] = {-148.88, -309.74, 3213.87};
+static float iP035[3] = {156.38, -320.17, 3213.87};
+static float iP036[3] = {523.39, -303.81, 4424.57};
+static float iP037[3] = {574.66, 276.84, 4424.57};
+static float iP038[3] = {243.05, 492.50, 4424.57};
+static float iP039[3] = {-191.23, 520.13, 4424.57};
+static float iP040[3] = {-523.39, 304.01, 4424.57};
+static float iP041[3] = {-574.66, -231.83, 4424.57};
+static float iP042[3] = {-266.95, -578.17, 4424.57};
+static float iP043[3] = {211.14, -579.67, 4424.57};
+static float iP044[3] = {680.57, -370.27, 5943.46};
+static float iP045[3] = {834.01, 363.09, 5943.46};
+static float iP046[3] = {371.29, 614.13, 5943.46};
+static float iP047[3] = {-291.43, 621.86, 5943.46};
+static float iP048[3] = {-784.13, 362.60, 5943.46};
+static float iP049[3] = {-743.29, -325.82, 5943.46};
+static float iP050[3] = {-383.24, -804.77, 5943.46};
+static float iP051[3] = {283.47, -846.09, 5943.46};
+static float P012[3] = {156.48, -31.95, 924.54};
+static float P013[3] = {162.00, 110.22, 924.54};
+static float P014[3] = {88.16, 221.65, 924.54};
+static float P015[3] = {-65.21, 231.16, 924.54};
+static float P016[3] = {-156.48, 121.97, 924.54};
+static float P017[3] = {-162.00, -23.93, 924.54};
+static float P018[3] = {-88.16, -139.10, 924.54};
+static float P019[3] = {65.21, -148.61, 924.54};
+static float P020[3] = {246.87, -98.73, 1783.04};
+static float P021[3] = {253.17, 127.76, 1783.04};
+static float P022[3] = {132.34, 270.77, 1783.04};
+static float P023[3] = {-97.88, 285.04, 1783.04};
+static float P024[3] = {-222.97, 139.80, 1783.04};
+static float P025[3] = {-225.29, -86.68, 1783.04};
+static float P026[3] = {-108.44, -224.15, 1783.04};
+static float P027[3] = {97.88, -221.56, 1783.04};
+static float P028[3] = {410.55, -200.66, 3213.87};
+static float P029[3] = {432.19, 148.42, 3213.87};
+static float P030[3] = {200.66, 410.55, 3213.87};
+static float P031[3] = {-148.42, 432.19, 3213.87};
+static float P032[3] = {-407.48, 171.88, 3213.87};
+static float P033[3] = {-432.19, -148.42, 3213.87};
+static float P034[3] = {-148.88, -309.74, 3213.87};
+static float P035[3] = {156.38, -320.17, 3213.87};
+static float P036[3] = {523.39, -303.81, 4424.57};
+static float P037[3] = {574.66, 276.84, 4424.57};
+static float P038[3] = {243.05, 492.50, 4424.57};
+static float P039[3] = {-191.23, 520.13, 4424.57};
+static float P040[3] = {-523.39, 304.01, 4424.57};
+static float P041[3] = {-574.66, -231.83, 4424.57};
+static float P042[3] = {-266.95, -578.17, 4424.57};
+static float P043[3] = {211.14, -579.67, 4424.57};
+static float P044[3] = {680.57, -370.27, 5943.46};
+static float P045[3] = {834.01, 363.09, 5943.46};
+static float P046[3] = {371.29, 614.13, 5943.46};
+static float P047[3] = {-291.43, 621.86, 5943.46};
+static float P048[3] = {-784.13, 362.60, 5943.46};
+static float P049[3] = {-743.29, -325.82, 5943.46};
+static float P050[3] = {-383.24, -804.77, 5943.46};
+static float P051[3] = {283.47, -846.09, 5943.46};
+static float P052[3] = {599.09, -332.24, 7902.59};
+static float P053[3] = {735.48, 306.26, 7911.92};
+static float P054[3] = {321.55, 558.53, 7902.59};
+static float P055[3] = {-260.54, 559.84, 7902.59};
+static float P056[3] = {-698.66, 320.83, 7902.59};
+static float P057[3] = {-643.29, -299.16, 7902.59};
+static float P058[3] = {-341.47, -719.30, 7902.59};
+static float P059[3] = {252.57, -756.12, 7902.59};
+static float P060[3] = {458.39, -265.31, 9355.44};
+static float iP061[3] = {353.63, 138.70, 10214.20};
+static float P061[3] = {353.63, 138.70, 10214.20};
+static float P062[3] = {224.04, 438.98, 9364.77};
+static float P063[3] = {-165.71, 441.27, 9355.44};
+static float iP064[3] = {-326.40, 162.04, 10209.54};
+static float P064[3] = {-326.40, 162.04, 10209.54};
+static float P065[3] = {-473.99, -219.71, 9355.44};
+static float P066[3] = {-211.97, -479.87, 9355.44};
+static float P067[3] = {192.86, -504.03, 9355.44};
+static float iP068[3] = {-112.44, 9.25, -64.42};
+static float iP069[3] = {1155.63, 0.00, -182.46};
+static float iP070[3] = {-1143.13, 0.00, -181.54};
+static float iP071[3] = {1424.23, 0.00, -322.09};
+static float iP072[3] = {-1368.01, 0.00, -310.38};
+static float iP073[3] = {1255.57, 2.31, 114.05};
+static float iP074[3] = {-1149.38, 0.00, 117.12};
+static float iP075[3] = {718.36, 0.00, 433.36};
+static float iP076[3] = {-655.90, 0.00, 433.36};
+static float P068[3] = {-112.44, 9.25, -64.42};
+static float P069[3] = {1155.63, 0.00, -182.46};
+static float P070[3] = {-1143.13, 0.00, -181.54};
+static float P071[3] = {1424.23, 0.00, -322.09};
+static float P072[3] = {-1368.01, 0.00, -310.38};
+static float P073[3] = {1255.57, 2.31, 114.05};
+static float P074[3] = {-1149.38, 0.00, 117.12};
+static float P075[3] = {718.36, 0.00, 433.36};
+static float P076[3] = {-655.90, 0.00, 433.36};
+static float P077[3] = {1058.00, -2.66, 7923.51};
+static float P078[3] = {-1016.51, -15.47, 7902.87};
+static float P079[3] = {-1363.99, -484.50, 7593.38};
+static float P080[3] = {1478.09, -861.47, 7098.12};
+static float P081[3] = {1338.06, -284.68, 7024.15};
+static float P082[3] = {-1545.51, -860.64, 7106.60};
+static float P083[3] = {1063.19, -70.46, 7466.60};
+static float P084[3] = {-1369.18, -288.11, 7015.34};
+static float P085[3] = {1348.44, -482.50, 7591.41};
+static float P086[3] = {-1015.45, -96.80, 7474.86};
+static float P087[3] = {731.04, 148.38, 7682.58};
+static float P088[3] = {-697.03, 151.82, 7668.81};
+static float P089[3] = {-686.82, 157.09, 7922.29};
+static float P090[3] = {724.73, 147.75, 7931.39};
+static float iP091[3] = {0.00, 327.10, 2346.55};
+static float iP092[3] = {0.00, 552.28, 2311.31};
+static float iP093[3] = {0.00, 721.16, 2166.41};
+static float iP094[3] = {0.00, 693.42, 2388.80};
+static float iP095[3] = {0.00, 389.44, 2859.97};
+static float P091[3] = {0.00, 327.10, 2346.55};
+static float P092[3] = {0.00, 552.28, 2311.31};
+static float P093[3] = {0.00, 721.16, 2166.41};
+static float P094[3] = {0.00, 693.42, 2388.80};
+static float P095[3] = {0.00, 389.44, 2859.97};
+static float iP096[3] = {222.02, -183.67, 10266.89};
+static float iP097[3] = {-128.90, -182.70, 10266.89};
+static float iP098[3] = {41.04, 88.31, 10659.36};
+static float iP099[3] = {-48.73, 88.30, 10659.36};
+static float P096[3] = {222.02, -183.67, 10266.89};
+static float P097[3] = {-128.90, -182.70, 10266.89};
+static float P098[3] = {41.04, 88.31, 10659.36};
+static float P099[3] = {-48.73, 88.30, 10659.36};
+static float P100[3] = {0.00, 603.42, 9340.68};
+#if 0
+static float P101[3] = {5.70, 567.00, 7862.98};
+static float P102[3] = {521.61, 156.61, 9162.34};
+static float P103[3] = {83.68, 566.67, 7861.26};
+#endif
+static float P104[3] = {-9.86, 567.62, 7858.65};
+static float P105[3] = {31.96, 565.27, 7908.46};
+static float P106[3] = {22.75, 568.13, 7782.83};
+static float P107[3] = {58.93, 568.42, 7775.94};
+static float P108[3] = {55.91, 565.59, 7905.86};
+static float P109[3] = {99.21, 566.00, 7858.65};
+static float P110[3] = {-498.83, 148.14, 9135.10};
+static float P111[3] = {-495.46, 133.24, 9158.48};
+static float P112[3] = {-490.82, 146.23, 9182.76};
+static float P113[3] = {-489.55, 174.11, 9183.66};
+static float P114[3] = {-492.92, 189.00, 9160.28};
+static float P115[3] = {-497.56, 176.02, 9136.00};
+static float P116[3] = {526.54, 169.68, 9137.70};
+static float P117[3] = {523.49, 184.85, 9161.42};
+static float P118[3] = {518.56, 171.78, 9186.06};
+static float P119[3] = {516.68, 143.53, 9186.98};
+static float P120[3] = {519.73, 128.36, 9163.26};
+static float P121[3] = {524.66, 141.43, 9138.62};
+/* *INDENT-ON* */
+
+
+
+static void
+Whale001(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N068);
+       glVertex3fv(P068);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N068);
+       glVertex3fv(P068);
+       glNormal3fv(N076);
+       glVertex3fv(P076);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N068);
+       glVertex3fv(P068);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glNormal3fv(N076);
+       glVertex3fv(P076);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N076);
+       glVertex3fv(P076);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glNormal3fv(N074);
+       glVertex3fv(P074);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glNormal3fv(N072);
+       glVertex3fv(P072);
+       glNormal3fv(N074);
+       glVertex3fv(P074);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N072);
+       glVertex3fv(P072);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glNormal3fv(N074);
+       glVertex3fv(P074);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N074);
+       glVertex3fv(P074);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glNormal3fv(N076);
+       glVertex3fv(P076);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N070);
+       glVertex3fv(P070);
+       glNormal3fv(N068);
+       glVertex3fv(P068);
+       glNormal3fv(N076);
+       glVertex3fv(P076);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N076);
+       glVertex3fv(P076);
+       glNormal3fv(N068);
+       glVertex3fv(P068);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N068);
+       glVertex3fv(P068);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N010);
+       glVertex3fv(P010);
+       glEnd();
+}
+
+static void
+Whale002(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N075);
+       glVertex3fv(P075);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N075);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glNormal3fv(N075);
+       glVertex3fv(P075);
+       glNormal3fv(N073);
+       glVertex3fv(P073);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N071);
+       glVertex3fv(P071);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glNormal3fv(N073);
+       glVertex3fv(P073);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N009);
+       glVertex3fv(P009);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N075);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N011);
+       glVertex3fv(P011);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glNormal3fv(N075);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glNormal3fv(N073);
+       glVertex3fv(P073);
+       glNormal3fv(N075);
+       glVertex3fv(P075);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N069);
+       glVertex3fv(P069);
+       glNormal3fv(N071);
+       glVertex3fv(P071);
+       glNormal3fv(N073);
+       glVertex3fv(P073);
+       glEnd();
+}
+
+static void
+Whale003(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N001);
+       glVertex3fv(P001);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glEnd();
+}
+
+static void
+Whale004(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N015);
+       glVertex3fv(P015);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N016);
+       glVertex3fv(P016);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N017);
+       glVertex3fv(P017);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N014);
+       glVertex3fv(P014);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N013);
+       glVertex3fv(P013);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N018);
+       glVertex3fv(P018);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N019);
+       glVertex3fv(P019);
+       glNormal3fv(N012);
+       glVertex3fv(P012);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glEnd();
+}
+
+static void
+Whale005(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N022);
+       glVertex3fv(P022);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N023);
+       glVertex3fv(P023);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N024);
+       glVertex3fv(P024);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N021);
+       glVertex3fv(P021);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N020);
+       glVertex3fv(P020);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N025);
+       glVertex3fv(P025);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N026);
+       glVertex3fv(P026);
+       glNormal3fv(N027);
+       glVertex3fv(P027);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glEnd();
+}
+
+static void
+Whale006(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N093);
+       glVertex3fv(P093);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N093);
+       glVertex3fv(P093);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N091);
+       glVertex3fv(P091);
+       glNormal3fv(N095);
+       glVertex3fv(P095);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N091);
+       glVertex3fv(P091);
+       glNormal3fv(N092);
+       glVertex3fv(P092);
+       glNormal3fv(N094);
+       glVertex3fv(P094);
+       glNormal3fv(N095);
+       glVertex3fv(P095);
+       glEnd();
+}
+
+static void
+Whale007(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N030);
+       glVertex3fv(P030);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N029);
+       glVertex3fv(P029);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N028);
+       glVertex3fv(P028);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glNormal3fv(N035);
+       glVertex3fv(P035);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N034);
+       glVertex3fv(P034);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N031);
+       glVertex3fv(P031);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N032);
+       glVertex3fv(P032);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N033);
+       glVertex3fv(P033);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glEnd();
+}
+
+static void
+Whale008(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N043);
+       glVertex3fv(P043);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N042);
+       glVertex3fv(P042);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N036);
+       glVertex3fv(P036);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N041);
+       glVertex3fv(P041);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N040);
+       glVertex3fv(P040);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N037);
+       glVertex3fv(P037);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N038);
+       glVertex3fv(P038);
+       glNormal3fv(N039);
+       glVertex3fv(P039);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glEnd();
+}
+
+static void
+Whale009(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N051);
+       glVertex3fv(P051);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N044);
+       glVertex3fv(P044);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N050);
+       glVertex3fv(P050);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N049);
+       glVertex3fv(P049);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N048);
+       glVertex3fv(P048);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N045);
+       glVertex3fv(P045);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N046);
+       glVertex3fv(P046);
+       glNormal3fv(N047);
+       glVertex3fv(P047);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glEnd();
+}
+
+static void
+Whale010(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N080);
+       glVertex3fv(P080);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N090);
+       glVertex3fv(P090);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N080);
+       glVertex3fv(P080);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N081);
+       glVertex3fv(P081);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N085);
+       glVertex3fv(P085);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N083);
+       glVertex3fv(P083);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N087);
+       glVertex3fv(P087);
+       glNormal3fv(N077);
+       glVertex3fv(P077);
+       glNormal3fv(N090);
+       glVertex3fv(P090);
+       glEnd();
+}
+
+static void
+Whale011(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N082);
+       glVertex3fv(P082);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N088);
+       glVertex3fv(P088);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glNormal3fv(N088);
+       glVertex3fv(P088);
+       glNormal3fv(N089);
+       glVertex3fv(P089);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N088);
+       glVertex3fv(P088);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N089);
+       glVertex3fv(P089);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N089);
+       glVertex3fv(P089);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N086);
+       glVertex3fv(P086);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N078);
+       glVertex3fv(P078);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N084);
+       glVertex3fv(P084);
+       glNormal3fv(N082);
+       glVertex3fv(P082);
+       glNormal3fv(N079);
+       glVertex3fv(P079);
+       glEnd();
+}
+
+static void
+Whale012(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N059);
+       glVertex3fv(P059);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N058);
+       glVertex3fv(P058);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N057);
+       glVertex3fv(P057);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N056);
+       glVertex3fv(P056);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N053);
+       glVertex3fv(P053);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N052);
+       glVertex3fv(P052);
+       glEnd();
+}
+
+static void
+Whale013(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glNormal3fv(N096);
+       glVertex3fv(P096);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glNormal3fv(N096);
+       glVertex3fv(P096);
+       glNormal3fv(N098);
+       glVertex3fv(P098);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N066);
+       glVertex3fv(P066);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N067);
+       glVertex3fv(P067);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N096);
+       glVertex3fv(P096);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N060);
+       glVertex3fv(P060);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N096);
+       glVertex3fv(P096);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N096);
+       glVertex3fv(P096);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glNormal3fv(N098);
+       glVertex3fv(P098);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N065);
+       glVertex3fv(P065);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N097);
+       glVertex3fv(P097);
+       glNormal3fv(N099);
+       glVertex3fv(P099);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P005);
+       glVertex3fv(P006);
+       glVertex3fv(P099);
+       glVertex3fv(P098);
+       glEnd();
+}
+
+static void
+Whale014(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N004);
+       glVertex3fv(P004);
+       glNormal3fv(N005);
+       glVertex3fv(P005);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P006);
+       glVertex3fv(P005);
+       glVertex3fv(P004);
+       glVertex3fv(P008);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N006);
+       glVertex3fv(P006);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N008);
+       glVertex3fv(P008);
+       glNormal3fv(N004);
+       glVertex3fv(P004);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N004);
+       glVertex3fv(P004);
+       glEnd();
+}
+
+static void
+Whale015(GLenum cap)
+{
+       glBegin(cap);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N055);
+       glVertex3fv(P055);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N003);
+       glVertex3fv(P003);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N054);
+       glVertex3fv(P054);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N063);
+       glVertex3fv(P063);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glEnd();
+       glBegin(cap);
+       glNormal3fv(N100);
+       glVertex3fv(P100);
+       glNormal3fv(N002);
+       glVertex3fv(P002);
+       glNormal3fv(N062);
+       glVertex3fv(P062);
+       glEnd();
+}
+
+static void
+Whale016(GLenum cap)
+{
+       glBegin(cap);
+       glVertex3fv(P104);
+       glVertex3fv(P105);
+       glVertex3fv(P106);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P107);
+       glVertex3fv(P108);
+       glVertex3fv(P109);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P110);
+       glVertex3fv(P111);
+       glVertex3fv(P112);
+       glVertex3fv(P113);
+       glVertex3fv(P114);
+       glVertex3fv(P115);
+       glEnd();
+       glBegin(cap);
+       glVertex3fv(P116);
+       glVertex3fv(P117);
+       glVertex3fv(P118);
+       glVertex3fv(P119);
+       glVertex3fv(P120);
+       glVertex3fv(P121);
+       glEnd();
+}
+
+void
+DrawWhale(fishRec * fish, int wire)
+{
+       float       seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7;
+       float       pitch, thrash, chomp;
+       GLenum      cap;
+
+       fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360;
+
+       thrash = 70.0 * fish->v;
+
+       seg0 = 1.5 * thrash * sin((fish->htail) * RRAD);
+       seg1 = 2.5 * thrash * sin((fish->htail + 10.0) * RRAD);
+       seg2 = 3.7 * thrash * sin((fish->htail + 15.0) * RRAD);
+       seg3 = 4.8 * thrash * sin((fish->htail + 23.0) * RRAD);
+       seg4 = 6.0 * thrash * sin((fish->htail + 28.0) * RRAD);
+       seg5 = 6.5 * thrash * sin((fish->htail + 35.0) * RRAD);
+       seg6 = 6.5 * thrash * sin((fish->htail + 40.0) * RRAD);
+       seg7 = 6.5 * thrash * sin((fish->htail + 55.0) * RRAD);
+
+       pitch = fish->v * sin((fish->htail - 160.0) * RRAD);
+
+       chomp = 0.0;
+       if (fish->v > 2.0) {
+               chomp = -(fish->v - 2.0) * 200.0;
+       }
+       P012[1] = iP012[1] + seg5;
+       P013[1] = iP013[1] + seg5;
+       P014[1] = iP014[1] + seg5;
+       P015[1] = iP015[1] + seg5;
+       P016[1] = iP016[1] + seg5;
+       P017[1] = iP017[1] + seg5;
+       P018[1] = iP018[1] + seg5;
+       P019[1] = iP019[1] + seg5;
+
+       P020[1] = iP020[1] + seg4;
+       P021[1] = iP021[1] + seg4;
+       P022[1] = iP022[1] + seg4;
+       P023[1] = iP023[1] + seg4;
+       P024[1] = iP024[1] + seg4;
+       P025[1] = iP025[1] + seg4;
+       P026[1] = iP026[1] + seg4;
+       P027[1] = iP027[1] + seg4;
+
+       P028[1] = iP028[1] + seg2;
+       P029[1] = iP029[1] + seg2;
+       P030[1] = iP030[1] + seg2;
+       P031[1] = iP031[1] + seg2;
+       P032[1] = iP032[1] + seg2;
+       P033[1] = iP033[1] + seg2;
+       P034[1] = iP034[1] + seg2;
+       P035[1] = iP035[1] + seg2;
+
+       P036[1] = iP036[1] + seg1;
+       P037[1] = iP037[1] + seg1;
+       P038[1] = iP038[1] + seg1;
+       P039[1] = iP039[1] + seg1;
+       P040[1] = iP040[1] + seg1;
+       P041[1] = iP041[1] + seg1;
+       P042[1] = iP042[1] + seg1;
+       P043[1] = iP043[1] + seg1;
+
+       P044[1] = iP044[1] + seg0;
+       P045[1] = iP045[1] + seg0;
+       P046[1] = iP046[1] + seg0;
+       P047[1] = iP047[1] + seg0;
+       P048[1] = iP048[1] + seg0;
+       P049[1] = iP049[1] + seg0;
+       P050[1] = iP050[1] + seg0;
+       P051[1] = iP051[1] + seg0;
+
+       P009[1] = iP009[1] + seg6;
+       P010[1] = iP010[1] + seg6;
+       P075[1] = iP075[1] + seg6;
+       P076[1] = iP076[1] + seg6;
+
+       P001[1] = iP001[1] + seg7;
+       P011[1] = iP011[1] + seg7;
+       P068[1] = iP068[1] + seg7;
+       P069[1] = iP069[1] + seg7;
+       P070[1] = iP070[1] + seg7;
+       P071[1] = iP071[1] + seg7;
+       P072[1] = iP072[1] + seg7;
+       P073[1] = iP073[1] + seg7;
+       P074[1] = iP074[1] + seg7;
+
+       P091[1] = iP091[1] + seg3 * 1.1;
+       P092[1] = iP092[1] + seg3;
+       P093[1] = iP093[1] + seg3;
+       P094[1] = iP094[1] + seg3;
+       P095[1] = iP095[1] + seg3 * 0.9;
+
+       P099[1] = iP099[1] + chomp;
+       P098[1] = iP098[1] + chomp;
+       P064[1] = iP064[1] + chomp;
+       P061[1] = iP061[1] + chomp;
+       P097[1] = iP097[1] + chomp;
+       P096[1] = iP096[1] + chomp;
+
+       glPushMatrix();
+
+       glRotatef(pitch, 1.0, 0.0, 0.0);
+
+       glTranslatef(0.0, 0.0, 8000.0);
+
+       glRotatef(180.0, 0.0, 1.0, 0.0);
+
+       glScalef(3.0, 3.0, 3.0);
+
+       glEnable(GL_CULL_FACE);
+
+       cap = wire ? GL_LINE_LOOP : GL_POLYGON;
+       Whale001(cap);
+       Whale002(cap);
+       Whale003(cap);
+       Whale004(cap);
+       Whale005(cap);
+       Whale006(cap);
+       Whale007(cap);
+       Whale008(cap);
+       Whale009(cap);
+       Whale010(cap);
+       Whale011(cap);
+       Whale012(cap);
+       Whale013(cap);
+       Whale014(cap);
+       Whale015(cap);
+       Whale016(cap);
+
+       glDisable(GL_CULL_FACE);
+
+       glPopMatrix();
+}
+#endif
diff --git a/modes/glx/xpm-ximage.c b/modes/glx/xpm-ximage.c
new file mode 100644 (file)
index 0000000..4711776
--- /dev/null
@@ -0,0 +1,196 @@
+/* xpm-ximage.c --- converts XPM data to an XImage for use with OpenGL.*/
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)xpm-image.c       5.0 00/11/14 xlockmore";
+
+#endif
+/*
+ * xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ *
+ * Version extracted from xscreensaver 3.26 for xlockmore
+ * by Eric Lassauge <lassauge@mail.dotcom.fr> http://lassauge.free.fr/linux.html
+ * Parts of the code are from Jamie, the rest dealing with alpha channel is from me.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef STANDALONE
+#error "Can't make that standalone !!!"
+#else                           /* !STANDALONE */
+#include "xlock.h"              /* from the xlockmore distribution */
+#include "vis.h"
+#endif                          /* !STANDALONE */
+
+#include <X11/Intrinsic.h>
+
+
+#if defined( USE_XPM ) || defined( USE_XPMINC ) /* whole file */
+#if USE_XPMINC
+#include <xpm.h>
+#else
+#include <X11/xpm.h>            /* Normal spot */
+#endif /* USE_XPMINC */
+
+#include <X11/Xutil.h>
+
+static Bool
+bigendian (void)
+{
+  union { int i; char c[sizeof(int)]; } u;
+  u.i = 1;
+  return !u.c[0];
+}
+
+
+/* Returns an XImage structure containing the bits of the given XPM image.
+   This XImage will be 32 bits per pixel, 8 each per R, G, and B, with the
+   extra byte set to 0xFF or 0x00 dealing with alpha value.
+
+   The Display and Visual arguments are used only for creating the XImage;
+   no bits are pushed to the server.
+
+   The Colormap argument is used just for parsing color names; no colors
+   are allocated.
+ */
+XImage *
+xpm_to_ximage (Display *dpy, Visual *visual, Colormap cmap, char **xpm_data)
+{
+  /* All we want to do is get RGB data out of the XPM file built in to this
+     program.  This is a pain, because there is no way  (as of XPM version
+     4.6, at least) to get libXpm to make an XImage without also allocating
+     colors with XAllocColor.  So, instead, we create an XpmImage and parse
+     out the RGB values of the pixels ourselves; and construct an XImage
+     by hand.  Regardless of the depth of the visual we're using, this
+     XImage will have 32 bits per pixel, 8 each per R, G, and B.  We put
+     0xFF or 0x00 in the fourth slot, as GL will interpret that as "alpha".
+     Alpha is detected using "None" color of XPM file.
+   */
+  XImage *ximage;
+  XpmImage xpm_image;
+  XpmInfo xpm_info;
+  int result, trans_idx = 0;
+  int x, y, i;
+  int bpl, wpl;
+  XColor colors[256];
+
+  memset (&xpm_image, 0, sizeof(xpm_image));
+  memset (&xpm_info, 0, sizeof(xpm_info));
+  result = XpmCreateXpmImageFromData (xpm_data, &xpm_image, &xpm_info);
+  if (result != XpmSuccess)
+  {
+      (void) fprintf(stderr, "Unable to parse xpm data (%d).\n",
+             result);
+      return (XImage *)NULL;
+  }
+
+  if (xpm_image.ncolors > 256)
+  {
+      (void) fprintf(stderr, "Unable to use xpm datas with too much colors (%d).\n",
+             xpm_image.ncolors);
+      return (XImage *)NULL;
+  }
+
+  ximage = XCreateImage (dpy, visual, 32, ZPixmap, 0, 0,
+                        xpm_image.width, xpm_image.height, 32, 0);
+
+  bpl = ximage->bytes_per_line;
+  wpl = bpl/4;
+
+  if ( (ximage->data = (char *) malloc(xpm_image.height * bpl)) == NULL)
+  {
+        /* free everything up to now */
+        XDestroyImage(ximage);
+        return (XImage *)NULL;
+  }
+
+  /* Parse the colors in the XPM into RGB values. */
+  for (i = 0; i < (int) xpm_image.ncolors; i++)
+  {
+    /* Before throwing an error, check if it is the "None" color */
+    if (xpm_image.colorTable[i].c_color && (!strncasecmp(xpm_image.colorTable[i].c_color,"none",4)))
+    {
+       trans_idx = i;
+       colors[trans_idx].red   = 0xFF;
+       colors[trans_idx].green = 0xFF;
+       colors[trans_idx].blue  = 0xFF;
+    }
+    else if (!XParseColor(dpy, cmap, xpm_image.colorTable[i].c_color, &colors[i]))
+    {
+       (void) fprintf(stderr,"Unparsable color: %s\n",
+               xpm_image.colorTable[i].c_color);
+        /* free everything up to now */
+        free(ximage->data);
+        XDestroyImage(ximage);
+        return (XImage *)NULL;
+    }
+  }
+
+  /* Translate the XpmImage to an RGB XImage. */
+  {
+    int rpos, gpos, bpos, apos;  /* bitfield positions */
+
+    /* Note that unlike X, which is endianness-agnostic (since any XImage
+       can have its own specific bit ordering, with the server reversing
+       things as necessary) OpenGL pretends everything is client-side, so
+       we need to pack things in the right order for the client machine.
+     */
+    if (bigendian())
+      rpos = 24, gpos = 16, bpos =  8, apos =  0;
+    else
+      rpos =  0, gpos =  8, bpos = 16, apos = 24;
+
+    for (y = 0; y < (int) xpm_image.height; y++)
+      {
+       int y2 = (xpm_image.height-1-y); /* Texture maps are upside down. */
+
+       unsigned int *oline = (unsigned int *) (ximage->data   + (y  * bpl));
+       unsigned int *iline = (unsigned int *) (xpm_image.data + (y2 * wpl));
+
+       for (x = 0; x < (int) xpm_image.width; x++)
+         {
+           XColor *c = &colors[iline[x]];
+            /* Again, check for transparent color */
+            if ((int) iline[x] == trans_idx)
+              /* pack it as RGBA transparent */
+              oline[x] = (((c->red   >> 8) << rpos) |
+                          ((c->green >> 8) << gpos) |
+                          ((c->blue  >> 8) << bpos) |
+                          (0x00            << apos));
+            else
+              /* pack it as RGBA */
+              oline[x] = (((c->red   >> 8) << rpos) |
+                          ((c->green >> 8) << gpos) |
+                          ((c->blue  >> 8) << bpos) |
+                          (0xFF            << apos));
+         }
+      }
+  }
+
+  /* I sure hope these only free the contents, and not the args. */
+  XpmFreeXpmImage (&xpm_image);
+  XpmFreeXpmInfo (&xpm_info);
+
+  return ximage;
+}
+
+
+#else  /* !HAVE_XPM */
+
+XImage *
+xpm_to_ximage (Display *dpy, Visual *visual, Colormap cmap, char **xpm_data)
+{
+  (void) fprintf(stderr, "Not compiled with XPM support.\n");
+  return (XImage *)NULL;
+}
+
+#endif /* !HAVE_XPM */
diff --git a/modes/glx/xpm-ximage.h b/modes/glx/xpm-ximage.h
new file mode 100644 (file)
index 0000000..a7863c9
--- /dev/null
@@ -0,0 +1,31 @@
+/* xpm-ximage.h --- converts XPM data to an XImage for use with OpenGL.
+ * xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ *
+ * Version extracted from xscreensaver 3.26 for xlockmore 
+ * by Eric Lassauge <lassauge@mail.dotcom.fr> http://lassauge.free.fr/linux.html
+ */
+
+#ifndef _XPM_TEXTURE_H_
+#define _XPM_TEXTURE_H_
+
+/* Returns an XImage structure containing the bits of the given XPM image.
+   This XImage will be 32 bits per pixel, 8 each per R, G, and B, with the
+   extra byte set to the desired alpha value.
+
+   The Display and Visual arguments are used only for creating the XImage;
+   no bits are pushed to the server.
+
+   The Colormap argument is used just for parsing color names; no colors
+   are allocated.
+ */
+extern XImage *xpm_to_ximage (Display *, Visual *, Colormap, char **xpm_data);
+
+#endif /* _XPM_TEXTURE_H_ */
diff --git a/modes/goop.c b/modes/goop.c
new file mode 100644 (file)
index 0000000..8308dbc
--- /dev/null
@@ -0,0 +1,612 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* goop --- goop from a lava lamp */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)goop.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 24-Mar-1998: xlock version David Bagley <bagleyd@tux.org>
+ * 1997: xscreensaver version Jamie Zawinski <jwz@jwz.org>
+ */
+
+/*-
+ * original copyright
+ * xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+/*-
+ * This is pretty compute-intensive, probably due to the large number of
+ * polygon fills.  I tried introducing a scaling factor to make the spline
+ * code emit fewer line segments, but that made the edges very rough.
+ * However, tuning *maxVelocity, *elasticity and *delay can result in much
+ * smoother looking animation.  I tuned these for a 1280x1024 Indy display,
+ * but I don't know whether these values will be reasonable for a slower
+ * machine...
+ *
+ * The more planes the better -- SGIs have a 12-bit pseudocolor display
+ * (4096 colormap cells) which is mostly useless, except for this program,
+ * where it means you can have 11 or 12 mutually-transparent objects instead
+ * of only 7 or 8.  But, if you are using the 12-bit visual, you should crank
+ * down the velocity and elasticity, or server slowness will cause the
+ * animation to look jerky (yes, it's sad but true, SGI's X server is
+ * perceptibly slower when using plane masks on a 12-bit visual than on an
+ * 8-bit visual.)  Using -max-velocity 0.5 -elasticity 0.9 seems to work ok
+ * on my Indy R5k with visual 0x27 and the bottom-of-the-line 24-bit graphics
+ * board.
+ *
+ * It might look better if each blob had an outline, which was a *slightly*
+ * darker color than the center, to give them a bit more definition -- but
+ * that would mean using two planes per blob.  (Or maybe allocating the
+ * outline colors outside of the plane-space?  Then the outlines wouldn't be
+ * transparent, but maybe that wouldn't be so noticeable?)
+ *
+ * Oh, for an alpha channel... maybe I should rewrite this in GL.  Then the
+ * blobs could have thickness, and curved edges with specular reflections...
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Goop"
+#define HACK_INIT init_goop
+#define HACK_DRAW draw_goop
+#define goop_opts xlockmore_opts
+#define DEFAULTS "*delay: 40000 \n" \
+ "*count: 100 \n"
+/*-  Come back to this.
+  "*delay:             12000",
+"*transparent: true",
+"*additive:            true",
+"*xor:         false",
+"*count:               0",
+"*planes:              0",
+"*thickness:           5",
+"*torque:              0.0075",
+"*elasticity:          1.8",
+"*maxVelocity: 1.2",
+ */
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+#include <spline.h>
+
+#ifdef MODE_goop
+
+ModeSpecOpt goop_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   goop_description =
+{"goop", "init_goop", "draw_goop", "release_goop",
+ "init_goop", "init_goop", NULL, &goop_opts,
+ 10000, -12, 1, 1, 64, 1.0, "",
+ "Shows goop from a lava lamp", 0, NULL};
+
+#endif
+
+
+#define SCALE       10000      /* fixed-point math, for sub-pixel motion */
+#define DEF_COUNT   12         /* When planes and count are 0, how many blobs. */
+
+
+#define RANDSIGN() ((LRAND() & 1) ? 1 : -1)
+
+typedef struct {
+       long        x, y;       /* position of midpoint */
+       long        dx, dy;     /* velocity and direction */
+       double      torque;     /* rotational speed */
+       double      th;         /* angle of rotation */
+       long        elasticity; /* how fast they deform */
+       long        max_velocity;       /* speed limit */
+       long        min_r, max_r;       /* radius range */
+       int         npoints;    /* control points */
+       long       *r;          /* radii */
+       spline     *splines;
+} blob;
+
+typedef struct {
+       int         nblobs;     /* number of blops per plane */
+       blob       *blobs;
+       Pixmap      pixmap;
+       unsigned long pixel;
+       GC          gc;
+} layer;
+
+enum goop_mode {
+       transparent,
+       opaque,
+       xored,
+       outline
+};
+
+typedef struct {
+       enum goop_mode mode;
+       int         width, height;
+       int         nlayers;
+       layer      *layers;
+       unsigned long background;
+       Pixmap      pixmap;
+       GC          pixmap_gc;
+} goopstruct;
+
+static goopstruct *goops = NULL;
+
+static Bool
+make_blob(blob * b, int maxx, int maxy, int size)
+{
+       int         i;
+       long        mid;
+
+       maxx *= SCALE;
+       maxy *= SCALE;
+       size *= SCALE;
+
+       b->max_r = size / 2;
+       b->min_r = size / 10;
+
+       if (b->min_r < (5 * SCALE))
+               b->min_r = (5 * SCALE);
+       mid = ((b->min_r + b->max_r) / 2);
+
+       b->torque = 0.0075;     /* torque init */
+       b->elasticity = (long) (SCALE * 1.8);   /* elasticity init */
+       b->max_velocity = (long) (SCALE * 1.2);         /* max_velocity init */
+
+       b->x = NRAND(maxx);
+       b->y = NRAND(maxy);
+
+       b->dx = NRAND(b->max_velocity) * RANDSIGN();
+       b->dy = NRAND(b->max_velocity) * RANDSIGN();
+       b->th = (2.0 * M_PI) * LRAND() / MAXRAND * RANDSIGN();
+       b->npoints = (int) (LRAND() % 5) + 5;
+
+       b->splines = make_spline(b->npoints);
+       if ((b->r = (long *) malloc(sizeof (*b->r) * b->npoints)) == NULL)
+               return False;
+       for (i = 0; i < b->npoints; i++)
+               b->r[i] = ((LRAND() % mid) + (mid / 2)) * RANDSIGN();
+       return True;
+}
+
+static void
+throb_blob(blob * b)
+{
+       int         i;
+       double      frac = ((M_PI + M_PI) / b->npoints);
+
+       for (i = 0; i < b->npoints; i++) {
+               long        r = b->r[i];
+               long        ra = (r > 0 ? r : -r);
+               double      th = (b->th > 0 ? b->th : -b->th);
+               long        x, y;
+
+               /* place control points evenly around perimiter, shifted by theta */
+               x = b->x + (long) (ra * cos(i * frac + th));
+               y = b->y + (long) (ra * sin(i * frac + th));
+
+               b->splines->control_x[i] = x / SCALE;
+               b->splines->control_y[i] = y / SCALE;
+
+               /* alter the radius by a random amount, in the direction in which
+                  it had been going (the sign of the radius indicates direction.) */
+               ra += (NRAND(b->elasticity) * (r > 0 ? 1 : -1));
+               r = ra * (r >= 0 ? 1 : -1);
+
+               /* If we've reached the end (too long or too short) reverse direction. */
+               if ((ra > b->max_r && r >= 0) ||
+                   (ra < b->min_r && r < 0))
+                       r = -r;
+               /* And reverse direction in mid-course once every 50 times. */
+               else if (!(LRAND() % 50))
+                       r = -r;
+
+               b->r[i] = r;
+       }
+}
+
+static void
+move_blob(blob * b, int maxx, int maxy)
+{
+       maxx *= SCALE;
+       maxy *= SCALE;
+
+       b->x += b->dx;
+       b->y += b->dy;
+
+       /* If we've reached the edge of the box, reverse direction. */
+       if ((b->x > maxx && b->dx >= 0) ||
+           (b->x < 0 && b->dx < 0)) {
+               b->dx = -b->dx;
+       }
+       if ((b->y > maxy && b->dy >= 0) ||
+           (b->y < 0 && b->dy < 0)) {
+               b->dy = -b->dy;
+       }
+       /* Alter velocity randomly. */
+       if (!(LRAND() % 10)) {
+               b->dx += (NRAND(b->max_velocity / 2) * RANDSIGN());
+               b->dy += (NRAND(b->max_velocity / 2) * RANDSIGN());
+
+               /* Throttle velocity */
+               if (b->dx > b->max_velocity || b->dx < -b->max_velocity)
+                       b->dx /= 2;
+               if (b->dy > b->max_velocity || b->dy < -b->max_velocity)
+                       b->dy /= 2;
+       } {
+               double      th = b->th;
+               double      d = (b->torque == 0 ? 0 : (b->torque) * LRAND() / MAXRAND);
+
+               if (th < 0)
+                       th = -(th + d);
+               else
+                       th += d;
+
+               if (th > (M_PI + M_PI))
+                       th -= (M_PI + M_PI);
+               else if (th < 0)
+                       th += (M_PI + M_PI);
+
+               b->th = (b->th > 0 ? th : -th);
+       }
+
+       /* Alter direction of rotation randomly. */
+       if (!(LRAND() % 100))
+               b->th *= -1;
+}
+
+
+static void
+draw_blob(Display * display, Drawable drawable, GC gc, blob * b,
+         Bool fill_p)
+{
+       compute_closed_spline(b->splines);
+#ifdef DEBUG
+       {
+               int         i;
+
+               for (i = 0; i < b->npoints; i++)
+                       XDrawLine(display, drawable, gc, b->x / SCALE, b->y / SCALE,
+                        b->splines->control_x[i], b->splines->control_y[i]);
+       }
+#else
+       if (fill_p)
+               XFillPolygon(display, drawable, gc, b->splines->points, b->splines->n_points,
+                            Nonconvex, CoordModeOrigin);
+       else
+#endif
+               XDrawLines(display, drawable, gc, b->splines->points, b->splines->n_points,
+                          CoordModeOrigin);
+}
+
+static Bool
+make_layer(ModeInfo * mi, layer * l, int nblobs)
+{
+       int         i;
+       int         blob_min, blob_max;
+       XGCValues   gcv;
+       int         width = MI_WIDTH(mi), height = MI_HEIGHT(mi);
+
+       l->nblobs = nblobs;
+
+       if ((l->blobs = (blob *) calloc(l->nblobs, sizeof (blob))) == NULL)
+               return False;
+
+       blob_max = (width < height ? width : height) / 2;
+       blob_min = (blob_max * 2) / 3;
+       for (i = 0; i < l->nblobs; i++)
+               if (!make_blob(&(l->blobs[i]), width, height,
+                         (int) (LRAND() % (blob_max - blob_min)) + blob_min))
+                       return False;
+
+       if ((l->pixmap = XCreatePixmap(MI_DISPLAY(mi), MI_WINDOW(mi),
+                       width, height, 1)) == None)
+               return False;
+       if ((l->gc = XCreateGC(MI_DISPLAY(mi), l->pixmap, 0, &gcv)) == None)
+               return False;
+       return True;
+}
+
+static void
+draw_layer_plane(Display * display, layer * layer_plane, int width, int height)
+{
+       int         i;
+
+       XSetForeground(display, layer_plane->gc, 1L);
+       XFillRectangle(display, layer_plane->pixmap, layer_plane->gc,
+     0, 0, width, height);
+       XSetForeground(display, layer_plane->gc, 0L);
+       for (i = 0; i < layer_plane->nblobs; i++) {
+               throb_blob(&(layer_plane->blobs[i]));
+               move_blob(&(layer_plane->blobs[i]), width, height);
+               draw_blob(display, layer_plane->pixmap, layer_plane->gc,
+       &(layer_plane->blobs[i]), True);
+       }
+}
+
+
+static void
+draw_layer_blobs(Display * display, Drawable drawable, GC gc,
+                layer * layer_plane, int width, int height,
+                Bool fill_p)
+{
+       int         i;
+
+       for (i = 0; i < layer_plane->nblobs; i++) {
+               throb_blob(&(layer_plane->blobs[i]));
+               move_blob(&(layer_plane->blobs[i]), width, height);
+               draw_blob(display, drawable, gc, &(layer_plane->blobs[i]), fill_p);
+       }
+}
+
+static void
+free_goop(Display * display, goopstruct * gp)
+{
+       int         l;
+
+       if (gp->layers != NULL) {
+               for (l = 0; l < gp->nlayers; l++) {
+                       if (gp->layers[l].blobs != NULL) {
+                               int         b;
+
+                               for (b = 0; b < gp->layers[l].nblobs; b++) {
+                                       if (gp->layers[l].blobs[b].r != NULL)
+                                               (void) free((void *) gp->layers[l].blobs[b].r);
+                                       free_spline(gp->layers[l].blobs[b].splines);
+                               }
+                               (void) free((void *) gp->layers[l].blobs);
+                       }
+                       if (gp->layers[l].gc != None)
+                               XFreeGC(display, gp->layers[l].gc);
+                       if (gp->layers[l].pixmap != None)
+                               XFreePixmap(display, gp->layers[l].pixmap);
+               }
+               (void) free((void *) gp->layers);
+               gp->layers = NULL;
+       }
+       if (gp->pixmap_gc != None) {
+               XFreeGC(display, gp->pixmap_gc);
+               gp->pixmap_gc = None;
+       }
+       if (gp->pixmap != None) {
+               XFreePixmap(display, gp->pixmap);
+               gp->pixmap = None;
+       }
+}
+
+void
+init_goop(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i;
+       XGCValues   gcv;
+       int         nblobs;
+       unsigned long *plane_masks = 0;
+       unsigned long base_pixel = 0;
+       goopstruct *gp;
+
+       if (goops == NULL) {
+               if ((goops = (goopstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (goopstruct))) == NULL)
+                       return;
+       }
+       gp = &goops[MI_SCREEN(mi)];
+
+       gp->mode = (False /* xor init */ ? xored
+                   : (True /* transparent init */ ? transparent : opaque));
+
+       gp->width = MI_WIDTH(mi);
+       gp->height = MI_HEIGHT(mi);
+
+       free_goop(display, gp);
+
+       gp->nlayers = 0;        /* planes init */
+       if (gp->nlayers <= 0)
+               gp->nlayers = (int) (LRAND() % (MI_DEPTH(mi) - 2)) + 2;
+       if ((gp->layers = (layer *) calloc(gp->nlayers, sizeof (layer))) == NULL) {
+               return; /* free_goop just ran */
+       }
+
+       if ((MI_NPIXELS(mi) < 2) && gp->mode == transparent)
+               gp->mode = opaque;
+
+       /* Try to allocate some color planes before committing to nlayers.
+        */
+#if 0
+       if (gp->mode == transparent) {
+               Bool        additive_p = True;  /* additive init */
+               int         nplanes = gp->nlayers;
+
+               /* allocate_alpha_colors (display, MI_COLORMAP(mi), &nplanes, additive_p, &plane_masks,
+                  &base_pixel); *//* COME BACK */
+               if (nplanes > 1)
+                       gp->nlayers = nplanes;
+               else {
+                       (void) fprintf(stderr,
+                                      "could not allocate any color planes; turning transparency off.\n");
+                       gp->mode = opaque;
+               }
+       }
+#else
+       if (gp->mode == transparent)
+               gp->mode = opaque;
+#endif
+
+       nblobs = MI_COUNT(mi);
+       if (nblobs < 0) {
+               nblobs = NRAND(-nblobs) + 1;    /* Add 1 so its not too boring */
+       } {
+               int        *lblobs;
+               int         total = DEF_COUNT;
+
+               if ((lblobs = (int *) calloc(gp->nlayers,
+                               sizeof (int))) == NULL) {
+                       free_goop(display, gp);
+                       return;
+               }
+               if (nblobs <= 0)
+                       while (total)
+                               for (i = 0; total && i < gp->nlayers; i++)
+                                       lblobs[i]++, total--;
+               for (i = 0; i < gp->nlayers; i++)
+                       if (!make_layer(mi, &(gp->layers[i]),
+                                  (nblobs > 0 ? nblobs : lblobs[i])))
+                               free_goop(display, gp);
+               (void) free((void *) lblobs);
+       }
+
+       if (gp->mode == transparent && plane_masks) {
+               for (i = 0; i < gp->nlayers; i++)
+                       gp->layers[i].pixel = base_pixel | plane_masks[i];
+               gp->background = base_pixel;
+       }
+       if (plane_masks)
+               (void) free((void *) plane_masks);
+
+       if (gp->mode != transparent) {
+               gp->background = 0;     /* init */
+
+               for (i = 0; i < gp->nlayers; i++) {
+                       if (MI_NPIXELS(mi) > 2)
+                               gp->layers[i].pixel = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       else
+                               gp->layers[i].pixel = MI_WHITE_PIXEL(mi);
+               }
+       }
+       if ((gp->pixmap = XCreatePixmap(display, window,
+                       MI_WIDTH(mi), MI_HEIGHT(mi),
+                       (gp->mode == xored ? 1 : MI_DEPTH(mi)))) == None) {
+               free_goop(display, gp);
+               return;
+       }
+
+       gcv.background = gp->background;
+       gcv.foreground = 255;   /* init */
+       gcv.line_width = 5;     /* thickness init */
+       if ((gp->pixmap_gc = XCreateGC(display, gp->pixmap, GCLineWidth,
+                        &gcv)) == None) {
+               free_goop(display, gp);
+               return;
+       }
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_goop(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i;
+       goopstruct *gp;
+
+       if (goops == NULL)
+               return;
+       gp = &goops[MI_SCREEN(mi)];
+       if (gp->layers == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       switch (gp->mode) {
+               case transparent:
+
+                       for (i = 0; i < gp->nlayers; i++)
+                               draw_layer_plane(display, &(gp->layers[i]), gp->width, gp->height);
+
+                       XSetForeground(display, gp->pixmap_gc, gp->background);
+                       XSetPlaneMask(display, gp->pixmap_gc, AllPlanes);
+                       XFillRectangle(display, gp->pixmap, gp->pixmap_gc, 0, 0,
+                                      gp->width, gp->height);
+                       XSetForeground(display, gp->pixmap_gc, ~0L);
+                       for (i = 0; i < gp->nlayers; i++) {
+                               XSetPlaneMask(display, gp->pixmap_gc, gp->layers[i].pixel);
+
+#if 0
+                       XSetForeground (display, gp->pixmap_gc, ~0L);
+                       XFillRectangle (display, gp->pixmap, gp->pixmap_gc, 0, 0,
+                               gp->width, gp->height);
+                       XSetForeground (display, gp->pixmap_gc, 0L);
+#endif
+                               draw_layer_blobs(display, gp->pixmap, gp->pixmap_gc,
+                                    &(gp->layers[i]), gp->width, gp->height,
+                                                True);
+                       }
+                       XCopyArea(display, gp->pixmap, window, MI_GC(mi), 0, 0,
+                                 gp->width, gp->height, 0, 0);
+                       break;
+
+               case xored:
+                       XSetFunction(display, gp->pixmap_gc, GXcopy);
+                       XSetForeground(display, gp->pixmap_gc, 0);
+                       XFillRectangle(display, gp->pixmap, gp->pixmap_gc, 0, 0,
+                                      gp->width, gp->height);
+                       XSetFunction(display, gp->pixmap_gc, GXxor);
+                       XSetForeground(display, gp->pixmap_gc, 1);
+                       for (i = 0; i < gp->nlayers; i++)
+                               draw_layer_blobs(display, gp->pixmap, gp->pixmap_gc,
+                                    &(gp->layers[i]), gp->width, gp->height,
+                                                (gp->mode != outline));
+                       XCopyPlane(display, gp->pixmap, window, MI_GC(mi), 0, 0,
+                                  gp->width, gp->height, 0, 0, 1L);
+                       break;
+
+               case opaque:
+               case outline:
+                       XSetForeground(display, gp->pixmap_gc, MI_BLACK_PIXEL(mi));
+                       XFillRectangle(display, gp->pixmap, gp->pixmap_gc, 0, 0,
+                                      gp->width, gp->height);
+                       for (i = 0; i < gp->nlayers; i++) {
+                               XSetForeground(display, gp->pixmap_gc, gp->layers[i].pixel);
+                               draw_layer_blobs(display, gp->pixmap, gp->pixmap_gc,
+                                    &(gp->layers[i]), gp->width, gp->height,
+                                                (gp->mode != outline));
+                       }
+                       XCopyArea(display, gp->pixmap, window, MI_GC(mi), 0, 0,
+                                 gp->width, gp->height, 0, 0);
+                       break;
+
+               default:
+                       abort();
+                       break;
+       }
+}
+
+void
+release_goop(ModeInfo * mi)
+{
+       if (goops != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_goop(MI_DISPLAY(mi), &goops[screen]);
+               (void) free((void *) goops);
+               goops = NULL;
+       }
+}
+
+#endif /* MODE_goop */
diff --git a/modes/grav.c b/modes/grav.c
new file mode 100644 (file)
index 0000000..db44295
--- /dev/null
@@ -0,0 +1,350 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* grav --- planets spinning around a pulsar */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)grav.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1993 by Greg Boewring <gb@pobox.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 11-Jul-1994: color version
+ * 06-Oct-1993: Written by Greg Bowering <gb@pobox.com>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Grav"
+#define HACK_INIT init_grav
+#define HACK_DRAW draw_grav
+#define grav_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: -12 \n" \
+ "*ncolors: 64 \n"
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_grav
+
+#define DEF_DECAY "False"      /* Damping for decaying orbits */
+#define DEF_TRAIL "False"      /* For trails (works good in mono only) */
+
+static Bool decay;
+static Bool trail;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-decay", (char *) ".grav.decay", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+decay", (char *) ".grav.decay", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-trail", (char *) ".grav.trail", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+trail", (char *) ".grav.trail", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & decay, (char *) "decay", (char *) "Decay", (char *) DEF_DECAY, t_Bool},
+       {(caddr_t *) & trail, (char *) "trail", (char *) "Trail", (char *) DEF_TRAIL, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+decay", (char *) "turn on/off decaying orbits"},
+       {(char *) "-/+trail", (char *) "turn on/off trail dots"}
+};
+
+ModeSpecOpt grav_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   grav_description =
+{"grav", "init_grav", "draw_grav", "release_grav",
+ "refresh_grav", "init_grav", NULL, &grav_opts,
+ 10000, -12, 1, 1, 64, 1.0, "",
+ "Shows orbiting planets", 0, NULL};
+
+#endif
+
+#define GRAV                   -0.02   /* Gravitational constant */
+#define DIST                   16.0
+#define COLLIDE                        0.0001
+#define ALMOST                 15.99
+#define HALF                   0.5
+/* #define INTRINSIC_RADIUS     200.0 */
+#define INTRINSIC_RADIUS       ((float) (gp->height/5))
+#define STARRADIUS             (unsigned int)(gp->height/(2*DIST))
+#define AVG_RADIUS             (INTRINSIC_RADIUS/DIST)
+#define RADIUS                 (unsigned int)(INTRINSIC_RADIUS/(POS(Z)+DIST))
+
+#define XR                     HALF*ALMOST
+#define YR                     HALF*ALMOST
+#define ZR                     HALF*ALMOST
+
+#define VR                     0.04
+
+#define DIMENSIONS             3
+#define X                      0
+#define Y                      1
+#define Z                      2
+
+#define DAMP                   0.999999
+#define MaxA                   0.1     /* Maximum acceleration (w/ damping) */
+
+#define POS(c) planet->P[c]
+#define VEL(c) planet->V[c]
+#define ACC(c) planet->A[c]
+
+#define Planet(x,y)\
+  if ((x) >= 0 && (y) >= 0 && (x) <= gp->width && (y) <= gp->height) {\
+    if (planet->ri < 2)\
+     XDrawPoint(display, window, gc, (x), (y));\
+    else\
+     XFillArc(display, window, gc,\
+      (x) - planet->ri / 2, (y) - planet->ri / 2, planet->ri, planet->ri,\
+      0, 23040);\
+   }
+
+#define FLOATRAND(min,max)     ((min)+(LRAND()/MAXRAND)*((max)-(min)))
+
+typedef struct {
+       double      P[DIMENSIONS], V[DIMENSIONS], A[DIMENSIONS];
+       int         xi, yi, ri;
+       unsigned long colors;
+} planetstruct;
+
+typedef struct {
+       int         width, height;
+       int         x, y, sr, nplanets;
+       unsigned long starcolor;
+       planetstruct *planets;
+} gravstruct;
+
+static gravstruct *gravs = NULL;
+
+static void
+init_planet(ModeInfo * mi, planetstruct * planet)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       gravstruct *gp = &gravs[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) > 2)
+               planet->colors = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       else
+               planet->colors = MI_WHITE_PIXEL(mi);
+       /* Initialize positions */
+       POS(X) = FLOATRAND(-XR, XR);
+       POS(Y) = FLOATRAND(-YR, YR);
+       POS(Z) = FLOATRAND(-ZR, ZR);
+
+       if (POS(Z) > -ALMOST) {
+               planet->xi = (int)
+                       ((double) gp->width * (HALF + POS(X) / (POS(Z) + DIST)));
+               planet->yi = (int)
+                       ((double) gp->height * (HALF + POS(Y) / (POS(Z) + DIST)));
+       } else
+               planet->xi = planet->yi = -1;
+       planet->ri = RADIUS;
+
+       /* Initialize velocities */
+       VEL(X) = FLOATRAND(-VR, VR);
+       VEL(Y) = FLOATRAND(-VR, VR);
+       VEL(Z) = FLOATRAND(-VR, VR);
+
+       /* Draw planets */
+       Planet(planet->xi, planet->yi);
+}
+
+static void
+draw_planet(ModeInfo * mi, planetstruct * planet)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       gravstruct *gp = &gravs[MI_SCREEN(mi)];
+       double      D;          /* A distance variable to work with */
+       register unsigned char cmpt;
+
+       D = POS(X) * POS(X) + POS(Y) * POS(Y) + POS(Z) * POS(Z);
+       if (D < COLLIDE)
+               D = COLLIDE;
+       D = sqrt(D);
+       D = D * D * D;
+       for (cmpt = X; cmpt < DIMENSIONS; cmpt++) {
+               ACC(cmpt) = POS(cmpt) * GRAV / D;
+               if (decay) {
+                       if (ACC(cmpt) > MaxA)
+                               ACC(cmpt) = MaxA;
+                       else if (ACC(cmpt) < -MaxA)
+                               ACC(cmpt) = -MaxA;
+                       VEL(cmpt) = VEL(cmpt) + ACC(cmpt);
+                       VEL(cmpt) *= DAMP;
+               } else {
+                       /* update velocity */
+                       VEL(cmpt) = VEL(cmpt) + ACC(cmpt);
+               }
+               /* update position */
+               POS(cmpt) = POS(cmpt) + VEL(cmpt);
+       }
+
+       gp->x = planet->xi;
+       gp->y = planet->yi;
+
+       if (POS(Z) > -ALMOST) {
+               planet->xi = (int)
+                       ((double) gp->width * (HALF + POS(X) / (POS(Z) + DIST)));
+               planet->yi = (int)
+                       ((double) gp->height * (HALF + POS(Y) / (POS(Z) + DIST)));
+       } else
+               planet->xi = planet->yi = -1;
+
+       /* Mask */
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       Planet(gp->x, gp->y);
+       if (trail) {
+               XSetForeground(display, gc, planet->colors);
+               XDrawPoint(display, MI_WINDOW(mi), gc, gp->x, gp->y);
+       }
+       /* Move */
+       gp->x = planet->xi;
+       gp->y = planet->yi;
+       planet->ri = RADIUS;
+
+       /* Redraw */
+       XSetForeground(display, gc, planet->colors);
+       Planet(gp->x, gp->y);
+}
+
+void
+init_grav(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       unsigned char ball;
+       gravstruct *gp;
+
+       if (gravs == NULL) {
+               if ((gravs = (gravstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (gravstruct))) == NULL)
+                       return;
+       }
+       gp = &gravs[MI_SCREEN(mi)];
+
+       gp->width = MI_WIDTH(mi);
+       gp->height = MI_HEIGHT(mi);
+
+       gp->sr = STARRADIUS;
+
+       gp->nplanets = MI_COUNT(mi);
+       if (gp->nplanets < 0) {
+               if (gp->planets) {
+                       (void) free((void *) gp->planets);
+                       gp->planets = NULL;
+               }
+               gp->nplanets = NRAND(-gp->nplanets) + 1;        /* Add 1 so its not too boring */
+       }
+       if (gp->planets == NULL) {
+               if ((gp->planets = (planetstruct *) calloc(gp->nplanets,
+                               sizeof (planetstruct))) == NULL)
+                       return;
+       }
+
+       MI_CLEARWINDOW(mi);
+
+       if (MI_NPIXELS(mi) > 2)
+               gp->starcolor = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       else
+               gp->starcolor = MI_WHITE_PIXEL(mi);
+       for (ball = 0; ball < (unsigned char) gp->nplanets; ball++)
+               init_planet(mi, &gp->planets[ball]);
+
+       /* Draw centrepoint */
+       XDrawArc(display, MI_WINDOW(mi), gc,
+                gp->width / 2 - gp->sr / 2, gp->height / 2 - gp->sr / 2, gp->sr, gp->sr,
+                0, 23040);
+}
+
+void
+draw_grav(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       register unsigned char ball;
+       gravstruct *gp;
+
+       if (gravs == NULL)
+                       return;
+       gp = &gravs[MI_SCREEN(mi)];
+       if (gp->planets == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       /* Mask centrepoint */
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       XDrawArc(display, window, gc,
+                gp->width / 2 - gp->sr / 2, gp->height / 2 - gp->sr / 2, gp->sr, gp->sr,
+                0, 23040);
+
+       /* Resize centrepoint */
+       switch (NRAND(4)) {
+               case 0:
+                       if (gp->sr < (int) STARRADIUS)
+                               gp->sr++;
+                       break;
+               case 1:
+                       if (gp->sr > 2)
+                               gp->sr--;
+       }
+
+       /* Draw centrepoint */
+       XSetForeground(display, gc, gp->starcolor);
+       XDrawArc(display, window, gc,
+                gp->width / 2 - gp->sr / 2, gp->height / 2 - gp->sr / 2, gp->sr, gp->sr,
+                0, 23040);
+
+       for (ball = 0; ball < (unsigned char) gp->nplanets; ball++)
+               draw_planet(mi, &gp->planets[ball]);
+}
+
+void
+release_grav(ModeInfo * mi)
+{
+       if (gravs != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       gravstruct *gp = &gravs[screen];
+
+                       if (gp->planets)
+                               (void) free((void *) gp->planets);
+               }
+               (void) free((void *) gravs);
+               gravs = NULL;
+       }
+}
+
+void
+refresh_grav(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_grav */
diff --git a/modes/helix.c b/modes/helix.c
new file mode 100644 (file)
index 0000000..a0f8237
--- /dev/null
@@ -0,0 +1,379 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* helix --- string art */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)helix.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 06-Apr-1997: new ellipse code from Dan Stromberg <strombrg@nis.acs.uci.edu>
+ * 11-Aug-1995: found some typos, looks more interesting now
+ * 08-Aug-1995: speed up thanks to Heath A. Kehoe <hakehoe@icaen.uiowa.edu>
+ * 17-Jun-1995: removed sleep statements
+ * 02-Sep-1993: xlock version David Bagley <bagleyd@tux.org>
+ * 1992: xscreensaver version Jamie Zawinski <jwz@jwz.org>
+ */
+
+/*-
+ * original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Helix"
+#define HACK_INIT init_helix
+#define HACK_DRAW draw_helix
+#define helix_opts xlockmore_opts
+#define DEFAULTS "*delay: 25000 \n" \
+ "*cycles: 100 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n"
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_helix
+
+#define DEF_ELLIPSE "False"
+
+static Bool ellipse;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-ellipse", (char *) ".helix.ellipse", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ellipse", (char *) ".helix.ellipse", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & ellipse, (char *) "ellipse", (char *) "Ellipse", (char *) DEF_ELLIPSE, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+ellipse", (char *) "turn on/off ellipse format"}
+};
+
+ModeSpecOpt helix_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   helix_description =
+{"helix", "init_helix", "draw_helix", "release_helix",
+ "refresh_helix", "init_helix", NULL, &helix_opts,
+ 25000, 1, 100, 1, 64, 1.0, "",
+ "Shows string art", 0, NULL};
+
+#endif
+
+#define ANGLES 360
+
+static double cos_array[ANGLES], sin_array[ANGLES];
+
+typedef struct {
+       Bool        painted;
+       int         width, height;
+       int         xmid, ymid;
+       int         color;
+       int         time;
+       int         radius1, radius2, d_angle, factor1, factor2, factor3,
+                   factor4;
+       int         redraw;
+
+       Bool        ellipse;
+       int         d_angle_offset, dir;
+       int         offset;
+       int         density;
+       int         count;
+} helixstruct;
+
+static helixstruct *helixes = NULL;
+
+static int
+gcd(int a, int b)
+{
+       while (b > 0) {
+               int         tmp;
+
+               tmp = a % b;
+               a = b;
+               b = tmp;
+       }
+       return (a < 0 ? -a : a);
+}
+
+static void
+helix(ModeInfo * mi, int radius1, int radius2, int d_angle,
+      int factor1, int factor2, int factor3, int factor4)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       helixstruct *hp = &helixes[MI_SCREEN(mi)];
+       int         x_1, y_1, x_2, y_2, angle, limit;
+       int         i;
+
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, hp->color));
+               if (++hp->color >= MI_NPIXELS(mi))
+                       hp->color = 0;
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       x_2 = hp->xmid;
+       y_2 = hp->ymid + radius1;
+       angle = 0;
+       limit = 1 + (ANGLES / gcd(ANGLES, d_angle));
+
+       for (i = 0; i < limit; i++) {
+               int         tmp;
+
+#define pmod(x,y) (tmp=((x)%(y)),(tmp>=0?tmp:tmp+y))
+               x_1 = hp->xmid + (int) (((double) radius1) *
+                                sin_array[pmod((angle * factor1), ANGLES)]);
+               y_1 = hp->ymid + (int) (((double) radius2) *
+                                cos_array[pmod((angle * factor2), ANGLES)]);
+               if (MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, gc, MI_PIXEL(mi, hp->color));
+                       if (++hp->color >= MI_NPIXELS(mi))
+                               hp->color = 0;
+               }
+               XDrawLine(display, window, gc, x_1, y_1, x_2, y_2);
+               x_2 = hp->xmid + (int) (((double) radius2) *
+                                sin_array[pmod((angle * factor3), ANGLES)]);
+               y_2 = hp->ymid + (int) (((double) radius1) *
+                                cos_array[pmod((angle * factor4), ANGLES)]);
+               if (MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, gc, MI_PIXEL(mi, hp->color));
+                       if (++hp->color >= MI_NPIXELS(mi))
+                               hp->color = 0;
+               }
+               XDrawLine(display, window, gc, x_1, y_1, x_2, y_2);
+               angle += d_angle;
+       }
+}
+
+static void
+trig(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       helixstruct *hp = &helixes[MI_SCREEN(mi)];
+       int         x1, y1, x2, y2;
+       int         tmp, angle;
+
+
+#define pmod(x,y) (tmp=((x)%(y)),(tmp>=0?tmp:tmp+y))
+
+       while (ABS(hp->d_angle) <= ANGLES) {
+               angle = hp->d_angle + hp->d_angle_offset;
+               x1 = (int) (sin_array[pmod(angle * hp->factor1, ANGLES)] * hp->xmid) +
+                       hp->xmid;
+               y1 = (int) (cos_array[pmod(angle * hp->factor1, ANGLES)] * hp->ymid) +
+                       hp->ymid;
+               x2 = (int) (sin_array[pmod(angle * hp->factor2 + hp->offset, ANGLES)] *
+                           hp->xmid) + hp->xmid;
+               y2 = (int) (cos_array[pmod(angle * hp->factor2 + hp->offset, ANGLES)] *
+                           hp->ymid) + hp->ymid;
+               XDrawLine(display, MI_WINDOW(mi), gc, x1, y1, x2, y2);
+               if (MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, gc, MI_PIXEL(mi, hp->color));
+                       if (++hp->color >= MI_NPIXELS(mi))
+                               hp->color = 0;
+               }
+               tmp = (int) ANGLES / (2 * hp->density * hp->factor1 * hp->factor2);
+               if (tmp == 0)   /* Do not want it getting stuck... */
+                       tmp = 1;        /* Would not need if floating point */
+               hp->d_angle += hp->dir * tmp;
+       }
+}
+
+static void
+random_helix(ModeInfo * mi)
+{
+       helixstruct *hp = &helixes[MI_SCREEN(mi)];
+       int         radius;
+       double      divisor;
+
+       radius = MIN(hp->xmid, hp->ymid);
+
+       hp->d_angle = 0;
+       hp->factor1 = 2;
+       hp->factor2 = 2;
+       hp->factor3 = 2;
+       hp->factor4 = 2;
+
+       divisor = ((LRAND() / MAXRAND * 3.0 + 1) * (((LRAND() & 1) * 2) - 1));
+
+       if ((LRAND() & 1) == 0) {
+               hp->radius1 = radius;
+               hp->radius2 = (int) ((double) radius / divisor);
+       } else {
+               hp->radius2 = radius;
+               hp->radius1 = (int) ((double) radius / divisor);
+       }
+
+       while (gcd(ANGLES, hp->d_angle) >= 2)
+               hp->d_angle = NRAND(ANGLES);
+
+#define random_factor()                                \
+  (int) (((NRAND(7)) ? ((LRAND() & 1) + 1) : 3)        * (((LRAND() & 1) * 2) - 1))
+
+       while (gcd(gcd(gcd(hp->factor1, hp->factor2), hp->factor3), hp->factor4)
+              != 1) {
+               hp->factor1 = random_factor();
+               hp->factor2 = random_factor();
+               hp->factor3 = random_factor();
+               hp->factor4 = random_factor();
+       }
+
+       helix(mi, hp->radius1, hp->radius2, hp->d_angle,
+             hp->factor1, hp->factor2, hp->factor3, hp->factor4);
+}
+
+static void
+random_trig(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       helixstruct *hp = &helixes[MI_SCREEN(mi)];
+
+       hp->d_angle = 0;
+       hp->factor1 = NRAND(8) + 1;
+       do
+               hp->factor2 = NRAND(8) + 1;
+       while (hp->factor1 == hp->factor2);
+       hp->dir = (LRAND() & 1) ? 1 : -1;
+       hp->d_angle_offset = NRAND(ANGLES);
+       hp->offset = (NRAND(ANGLES / 4 - 1) + 1) / 4;
+       hp->density = 1 << (NRAND(4) + 4);      /* Higher density, higher ANGLES */
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, hp->color));
+               if (++hp->color >= MI_NPIXELS(mi))
+                       hp->color = 0;
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       trig(mi);
+}
+
+void
+init_helix(ModeInfo * mi)
+{
+       int         i;
+       static int  first = 1;
+       helixstruct *hp;
+
+       if (helixes == NULL) {
+               if ((helixes = (helixstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (helixstruct))) == NULL)
+                       return;
+       }
+       hp = &helixes[MI_SCREEN(mi)];
+
+       if (first) {
+               first = 0;
+               for (i = 0; i < ANGLES; i++) {
+                       cos_array[i] = cos((((double) i) / (double) (ANGLES / 2)) * M_PI);
+                       sin_array[i] = sin((((double) i) / (double) (ANGLES / 2)) * M_PI);;
+               }
+       }
+       hp->ellipse = ellipse;
+       if (MI_IS_FULLRANDOM(mi))
+               hp->ellipse = (Bool) (!NRAND(5));       /* 1:5 chance of running ellipse stuff */
+
+       hp->width = MI_WIDTH(mi);
+       hp->height = MI_HEIGHT(mi);
+       hp->xmid = hp->width / 2;
+       hp->ymid = hp->height / 2;
+       hp->redraw = 0;
+
+       MI_CLEARWINDOW(mi);
+       hp->painted = False;
+
+       if (MI_NPIXELS(mi) > 2)
+               hp->color = NRAND(MI_NPIXELS(mi));
+       hp->time = 0;
+
+       if (hp->ellipse) {
+               random_trig(mi);
+       } else
+               random_helix(mi);
+}
+
+void
+draw_helix(ModeInfo * mi)
+{
+       helixstruct *hp;
+
+       if (helixes == NULL)
+               return;
+       hp = &helixes[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (++hp->time > MI_CYCLES(mi))
+               init_helix(mi);
+       else
+               hp->painted = True;
+       if (hp->redraw) {
+               if (hp->ellipse) {
+                       trig(mi);
+               } else {
+                       helix(mi, hp->radius1, hp->radius2, hp->d_angle,
+                        hp->factor1, hp->factor2, hp->factor3, hp->factor4);
+               }
+               hp->redraw = 0;
+       }
+}
+
+void
+release_helix(ModeInfo * mi)
+{
+       if (helixes != NULL) {
+               (void) free((void *) helixes);
+               helixes = NULL;
+       }
+}
+
+void
+refresh_helix(ModeInfo * mi)
+{
+       helixstruct *hp;
+
+       if (helixes == NULL)
+               return;
+       hp = &helixes[MI_SCREEN(mi)];
+
+       if (hp->painted) {
+               MI_CLEARWINDOW(mi);
+               helix(mi, hp->radius1, hp->radius2, hp->d_angle,
+                     hp->factor1, hp->factor2, hp->factor3, hp->factor4);
+               hp->painted = False;
+       }
+}
+
+#endif /* MODE_helix */
diff --git a/modes/hop.c b/modes/hop.c
new file mode 100644 (file)
index 0000000..adb5a23
--- /dev/null
@@ -0,0 +1,562 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* hop --- real plane fractals */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)hop.c        5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * Changes in xlockmore distribution
+ * 01-Nov-2000: Allocation checks
+ * 24-Jun-1997: EJK and RR functions stolen from xmartin2.2
+ *              Ed Kubaitis <ejk@ux2.cso.uiuc.edu> ejk functions and xmartin
+ *              Renaldo Recuerdo rr function, generalized exponent version
+ *              of the Barry Martin's square root function
+ * 10-May-1997: Compatible with xscreensaver
+ * 27-Jul-1995: added Peter de Jong's hop from Scientific American
+ *              July 87 p. 111.  Sometimes they are amazing but there are a
+ *              few duds (I did not see a pattern in the parameters).
+ * 29-Mar-1995: changed name from hopalong to hop
+ * 09-Dec-1994: added Barry Martin's sine hop
+ * Changes in original xlock
+ * 29-Oct-1990: fix bad (int) cast.
+ * 29-Jul-1990: support for multiple screens.
+ * 08-Jul-1990: new timing and colors and new algorithm for fractals.
+ * 15-Dec-1989: Fix for proper skipping of {White,Black}Pixel() in colors.
+ * 08-Oct-1989: Fixed long standing typo bug in RandomInitHop();
+ *                 Fixed bug in memory allocation in init_hop();
+ *                 Moved seconds() to an extern.
+ *                 Got rid of the % mod since .mod is slow on a sparc.
+ * 20-Sep-1989: Lint.
+ * 31-Aug-1988: Forked from xlock.c for modularity.
+ * 23-Mar-1988: Coded HOPALONG routines from Scientific American Sept. 86 p. 14.
+ *              Hopalong was attributed to Barry Martin of Aston University
+ *              (Birmingham, England)
+ */
+
+
+#ifdef STANDALONE
+#define PROGCLASS "Hop"
+#define HACK_INIT init_hop
+#define HACK_DRAW draw_hop
+#define hop_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 1000 \n" \
+ "*cycles: 2500 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_hop
+
+#define DEF_MARTIN "False"
+#define DEF_POPCORN "False"
+#define DEF_EJK1 "False"
+#define DEF_EJK2 "False"
+#define DEF_EJK3 "False"
+#define DEF_EJK4 "False"
+#define DEF_EJK5 "False"
+#define DEF_EJK6 "False"
+#define DEF_RR "False"
+#define DEF_JONG "False"
+#define DEF_SINE "False"
+
+static Bool martin;
+static Bool popcorn;
+static Bool ejk1;
+static Bool ejk2;
+static Bool ejk3;
+static Bool ejk4;
+static Bool ejk5;
+static Bool ejk6;
+static Bool rr;
+static Bool jong;
+static Bool sine;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-martin", (char *) ".hop.martin", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+martin", (char *) ".hop.martin", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-popcorn", (char *) ".hop.popcorn", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+popcorn", (char *) ".hop.popcorn", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-ejk1", (char *) ".hop.ejk1", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ejk1", (char *) ".hop.ejk1", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-ejk2", (char *) ".hop.ejk2", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ejk2", (char *) ".hop.ejk2", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-ejk3", (char *) ".hop.ejk3", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ejk3", (char *) ".hop.ejk3", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-ejk4", (char *) ".hop.ejk4", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ejk4", (char *) ".hop.ejk4", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-ejk5", (char *) ".hop.ejk5", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ejk5", (char *) ".hop.ejk5", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-ejk6", (char *) ".hop.ejk6", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ejk6", (char *) ".hop.ejk6", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-rr", (char *) ".hop.rr", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+rr", (char *) ".hop.rr", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-jong", (char *) ".hop.jong", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+jong", (char *) ".hop.jong", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-sine", (char *) ".hop.sine", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+sine", (char *) ".hop.sine", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & martin, (char *) "martin", (char *) "Martin", (char *) DEF_MARTIN, t_Bool},
+       {(caddr_t *) & popcorn, (char *) "popcorn", (char *) "Popcorn", (char *) DEF_POPCORN, t_Bool},
+       {(caddr_t *) & ejk1, (char *) "ejk1", (char *) "EJK1", (char *) DEF_EJK1, t_Bool},
+       {(caddr_t *) & ejk2, (char *) "ejk2", (char *) "EJK2", (char *) DEF_EJK2, t_Bool},
+       {(caddr_t *) & ejk3, (char *) "ejk3", (char *) "EJK3", (char *) DEF_EJK3, t_Bool},
+       {(caddr_t *) & ejk4, (char *) "ejk4", (char *) "EJK4", (char *) DEF_EJK4, t_Bool},
+       {(caddr_t *) & ejk5, (char *) "ejk5", (char *) "EJK5", (char *) DEF_EJK5, t_Bool},
+       {(caddr_t *) & ejk6, (char *) "ejk6", (char *) "EJK6", (char *) DEF_EJK6, t_Bool},
+       {(caddr_t *) & rr, (char *) "rr", (char *) "RR", (char *) DEF_RR, t_Bool},
+       {(caddr_t *) & jong, (char *) "jong", (char *) "Jong", (char *) DEF_JONG, t_Bool},
+       {(caddr_t *) & sine, (char *) "sine", (char *) "Sine", (char *) DEF_SINE, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+martin", (char *) "turn on/off sqrt format"},
+       {(char *) "-/+popcorn", (char *) "turn on/off Clifford A. Pickover's popcorn format"},
+       {(char *) "-/+ejk1", (char *) "turn on/off ejk1 format"},
+       {(char *) "-/+ejk2", (char *) "turn on/off ejk2 format"},
+       {(char *) "-/+ejk3", (char *) "turn on/off ejk3 format"},
+       {(char *) "-/+ejk4", (char *) "turn on/off ejk4 format"},
+       {(char *) "-/+ejk5", (char *) "turn on/off ejk5 format"},
+       {(char *) "-/+ejk6", (char *) "turn on/off ejk6 format"},
+       {(char *) "-/+rr", (char *) "turn on/off rr format"},
+       {(char *) "-/+jong", (char *) "turn on/off jong format"},
+       {(char *) "-/+sine", (char *) "turn on/off sine format"}
+};
+
+ModeSpecOpt hop_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   hop_description =
+{"hop", "init_hop", "draw_hop", "release_hop",
+ "refresh_hop", "init_hop", NULL, &hop_opts,
+ 10000, 1000, 2500, 1, 64, 1.0, "",
+ "Shows real plane iterated fractals", 0, NULL};
+
+#endif
+
+#define MARTIN 0
+#define POPCORN 7
+#define SINE 8
+#define EJK1 1
+#define EJK2 2
+#define EJK3 9
+#define EJK4 3
+#define EJK5 4
+#define EJK6 10
+#define RR 5
+#define JONG 6
+#ifdef OFFENDING
+#define OPS 8                  /* 8, 9, 10 might be too close to a swastika for some... */
+#else
+#define OPS 11
+#endif
+
+typedef struct {
+       int         centerx, centery;   /* center of the screen */
+       double      a, b, c, d;
+       double      i, j;       /* hopalong parameters */
+       int         inc;
+       int         pix;
+       int         op;
+       int         count;
+       int         bufsize;
+       XPoint     *pointBuffer;        /* pointer for XDrawPoints */
+} hopstruct;
+
+static hopstruct *hops = NULL;
+
+void
+init_hop(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       double      range;
+       hopstruct  *hp;
+
+       if (hops == NULL) {
+               if ((hops = (hopstruct *) calloc(MI_NUM_SCREENS(mi),
+                                                sizeof (hopstruct))) == NULL)
+                       return;
+       }
+       hp = &hops[MI_SCREEN(mi)];
+
+       hp->centerx = MI_WIDTH(mi) / 2;
+       hp->centery = MI_HEIGHT(mi) / 2;
+       /* Make the other operations less common since they are less interesting */
+       if (MI_IS_FULLRANDOM(mi)) {
+               hp->op = NRAND(OPS);
+       } else {
+               if (martin)
+                       hp->op = MARTIN;
+               else if (popcorn)
+                       hp->op = POPCORN;
+               else if (ejk1)
+                       hp->op = EJK1;
+               else if (ejk2)
+                       hp->op = EJK2;
+               else if (ejk3)
+                       hp->op = EJK3;
+               else if (ejk4)
+                       hp->op = EJK4;
+               else if (ejk5)
+                       hp->op = EJK5;
+               else if (ejk6)
+                       hp->op = EJK6;
+               else if (rr)
+                       hp->op = RR;
+               else if (jong)
+                       hp->op = JONG;
+               else if (sine)
+                       hp->op = SINE;
+               else
+                       hp->op = NRAND(OPS);
+       }
+
+       range = sqrt((double) hp->centerx * hp->centerx +
+            (double) hp->centery * hp->centery) / (1.0 + LRAND() / MAXRAND);
+       hp->i = hp->j = 0.0;
+       hp->inc = (int) ((LRAND() / MAXRAND) * 200) - 100;
+#undef XMARTIN
+       switch (hp->op) {
+               case MARTIN:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 1500.0 + 40.0;
+                       hp->b = (LRAND() / MAXRAND) * 17.0 + 3.0;
+                       hp->c = (LRAND() / MAXRAND) * 3000.0 + 100.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 20.0;
+                       hp->b = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 20.0;
+                       if (LRAND() & 1)
+                               hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 20.0;
+                       else
+                               hp->c = 0.0;
+#endif
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "sqrt a=%g, b=%g, c=%g\n", hp->a, hp->b, hp->c);
+                       break;
+               case EJK1:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 500.0;
+                       hp->c = (LRAND() / MAXRAND) * 100.0 + 10.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 30.0;
+                       hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 40.0;
+#endif
+                       hp->b = (LRAND() / MAXRAND) * 0.4;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "ejk1 a=%g, b=%g, c=%g\n", hp->a, hp->b, hp->c);
+                       break;
+               case EJK2:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 500.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 30.0;
+#endif
+                       hp->b = pow(10.0, 6.0 + (LRAND() / MAXRAND) * 24.0);
+                       if (LRAND() & 1)
+                               hp->b = -hp->b;
+                       hp->c = pow(10.0, (LRAND() / MAXRAND) * 9.0);
+                       if (LRAND() & 1)
+                               hp->c = -hp->c;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "ejk2 a=%g, b=%g, c=%g\n", hp->a, hp->b, hp->c);
+                       break;
+               case EJK3:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 500.0;
+                       hp->c = (LRAND() / MAXRAND) * 80.0 + 30.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 30.0;
+                       hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 70.0;
+#endif
+                       hp->b = (LRAND() / MAXRAND) * 0.35 + 0.5;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "ejk3 a=%g, b=%g, c=%g\n", hp->a, hp->b, hp->c);
+                       break;
+               case EJK4:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 1000.0;
+                       hp->c = (LRAND() / MAXRAND) * 40.0 + 30.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 2.0;
+                       hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 200.0;
+#endif
+                       hp->b = (LRAND() / MAXRAND) * 9.0 + 1.0;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "ejk4 a=%g, b=%g, c=%g\n", hp->a, hp->b, hp->c);
+                       break;
+               case EJK5:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 600.0;
+                       hp->c = (LRAND() / MAXRAND) * 90.0 + 20.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 2.0;
+                       hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 200.0;
+#endif
+                       hp->b = (LRAND() / MAXRAND) * 0.3 + 0.1;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "ejk5 a=%g, b=%g, c=%g\n", hp->a, hp->b, hp->c);
+                       break;
+               case EJK6:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 100.0 + 550.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 30.0;
+#endif
+                       hp->b = (LRAND() / MAXRAND) + 0.5;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "ejk6 a=%g, b=%g\n", hp->a, hp->b);
+                       break;
+               case RR:
+#ifdef XMARTIN
+                       hp->a = (LRAND() / MAXRAND) * 100.0;
+                       hp->b = (LRAND() / MAXRAND) * 20.0;
+                       hp->c = (LRAND() / MAXRAND) * 200.0;
+#else
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 40.0;
+                       hp->b = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 200.0;
+                       hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * range / 20.0;
+#endif
+                       hp->d = (LRAND() / MAXRAND) * 0.9;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "rr a=%g, b=%g, c=%g, d=%g\n",
+                                              hp->a, hp->b, hp->c, hp->d);
+                       break;
+               case POPCORN:
+                       hp->a = 0.0;
+                       hp->b = 0.0;
+                       hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.24 + 0.25;
+                       hp->inc = 100;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "popcorn a=%g, b=%g, c=%g, d=%g\n",
+                                              hp->a, hp->b, hp->c, hp->d);
+                       break;
+               case JONG:
+                       hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * M_PI;
+                       hp->b = ((LRAND() / MAXRAND) * 2.0 - 1.0) * M_PI;
+                       hp->c = ((LRAND() / MAXRAND) * 2.0 - 1.0) * M_PI;
+                       hp->d = ((LRAND() / MAXRAND) * 2.0 - 1.0) * M_PI;
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "jong a=%g, b=%g, c=%g, d=%g\n",
+                                              hp->a, hp->b, hp->c, hp->d);
+                       break;
+               case SINE:      /* MARTIN2 */
+#ifdef XMARTIN
+                       hp->a = M_PI + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.07;
+#else
+                       hp->a = M_PI + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.7;
+#endif
+                       if (MI_IS_VERBOSE(mi))
+                               (void) fprintf(stdout, "sine a=%g\n", hp->a);
+                       break;
+       }
+       if (MI_NPIXELS(mi) > 2)
+               hp->pix = NRAND(MI_NPIXELS(mi));
+       hp->bufsize = MI_COUNT(mi);
+
+       if (hp->pointBuffer == NULL) {
+               if ((hp->pointBuffer = (XPoint *) malloc(hp->bufsize *
+                               sizeof (XPoint))) == NULL)
+                       return;
+       }
+
+       MI_CLEARWINDOW(mi);
+
+       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       hp->count = 0;
+}
+
+
+void
+draw_hop(ModeInfo * mi)
+{
+       double      oldj, oldi;
+       XPoint     *xp;
+       int         k;
+       hopstruct  *hp;
+
+       if (hops == NULL)
+               return;
+       hp = &hops[MI_SCREEN(mi)];
+       if (hp->pointBuffer == NULL)
+               return;
+       xp = hp->pointBuffer;
+       k = hp->bufsize;
+
+       MI_IS_DRAWN(mi) = True;
+       hp->inc++;
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_PIXEL(mi, hp->pix));
+               if (++hp->pix >= MI_NPIXELS(mi))
+                       hp->pix = 0;
+       }
+       while (k--) {
+               oldj = hp->j;
+               switch (hp->op) {
+                       case MARTIN:    /* SQRT, MARTIN1 */
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj + ((hp->i < 0)
+                                          ? sqrt(fabs(hp->b * oldi - hp->c))
+                                       : -sqrt(fabs(hp->b * oldi - hp->c)));
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case EJK1:
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - ((hp->i > 0) ? (hp->b * oldi - hp->c) :
+                                               -(hp->b * oldi - hp->c));
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case EJK2:
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - ((hp->i < 0) ? log(fabs(hp->b * oldi - hp->c)) :
+                                          -log(fabs(hp->b * oldi - hp->c)));
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case EJK3:
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - ((hp->i > 0) ? sin(hp->b * oldi) - hp->c :
+                                               -sin(hp->b * oldi) - hp->c);
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case EJK4:
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - ((hp->i > 0) ? sin(hp->b * oldi) - hp->c :
+                                         -sqrt(fabs(hp->b * oldi - hp->c)));
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case EJK5:
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - ((hp->i > 0) ? sin(hp->b * oldi) - hp->c :
+                                               -(hp->b * oldi - hp->c));
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case EJK6:
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - asin((hp->b * oldi) - (long) (hp->b * oldi));
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case RR:        /* RR1 */
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - ((hp->i < 0) ? -pow(fabs(hp->b * oldi - hp->c), hp->d) :
+                                    pow(fabs(hp->b * oldi - hp->c), hp->d));
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+                       case POPCORN:
+#define HVAL 0.05
+#define INCVAL 50
+                               {
+                                       double      tempi, tempj;
+
+                                       if (hp->inc >= 100)
+                                               hp->inc = 0;
+                                       if (hp->inc == 0) {
+                                               if (hp->a++ >= INCVAL) {
+                                                       hp->a = 0;
+                                                       if (hp->b++ >= INCVAL)
+                                                               hp->b = 0;
+                                               }
+                                               hp->i = (-hp->c * INCVAL / 2 + hp->c * hp->a) * M_PI / 180.0;
+                                               hp->j = (-hp->c * INCVAL / 2 + hp->c * hp->b) * M_PI / 180.0;
+                                       }
+                                       tempi = hp->i - HVAL * sin(hp->j + tan(3.0 * hp->j));
+                                       tempj = hp->j - HVAL * sin(hp->i + tan(3.0 * hp->i));
+                                       xp->x = hp->centerx + (int) (MI_WIDTH(mi) / 40 * tempi);
+                                       xp->y = hp->centery + (int) (MI_HEIGHT(mi) / 40 * tempj);
+                                       hp->i = tempi;
+                                       hp->j = tempj;
+                               }
+                               break;
+                       case JONG:
+                               if (hp->centerx > 0)
+                                       oldi = hp->i + 4 * hp->inc / hp->centerx;
+                               else
+                                       oldi = hp->i;
+                               hp->j = sin(hp->c * hp->i) - cos(hp->d * hp->j);
+                               hp->i = sin(hp->a * oldj) - cos(hp->b * oldi);
+                               xp->x = hp->centerx + (int) (hp->centerx * (hp->i + hp->j) / 4.0);
+                               xp->y = hp->centery - (int) (hp->centery * (hp->i - hp->j) / 4.0);
+                               break;
+                       case SINE:      /* MARTIN2 */
+                               oldi = hp->i + hp->inc;
+                               hp->j = hp->a - hp->i;
+                               hp->i = oldj - sin(oldi);
+                               xp->x = hp->centerx + (int) (hp->i + hp->j);
+                               xp->y = hp->centery - (int) (hp->i - hp->j);
+                               break;
+               }
+               xp++;
+       }
+       XDrawPoints(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                   hp->pointBuffer, hp->bufsize, CoordModeOrigin);
+       if (++hp->count > MI_CYCLES(mi)) {
+               init_hop(mi);
+       }
+}
+
+void
+release_hop(ModeInfo * mi)
+{
+       if (hops != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       hopstruct  *hp = &hops[screen];
+
+                       if (hp->pointBuffer != NULL)
+                               (void) free((void *) hp->pointBuffer);
+               }
+               (void) free((void *) hops);
+               hops = NULL;
+       }
+}
+
+void
+refresh_hop(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_hop */
diff --git a/modes/hyper.c b/modes/hyper.c
new file mode 100644 (file)
index 0000000..10ff027
--- /dev/null
@@ -0,0 +1,1260 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* hyper --- spinning hypercubes, not just for tesseracts any more */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)hyper.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * hyper.c (nee multidico)
+ * Copyright (C) 1992,1998 John Heidemann <johnh@isi.edu>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ ***
+ *
+ * hyper (then called multidico) was originally written for
+ * xscreensaver in 1992.  Unfortunately it didn't make it into that
+ * code because Jamie Zawinski was implementing his own tesseract and
+ * preferred his version (optimized for speed) to my version
+ * (with support for more than 4 dimesnions).
+ *
+ * In 1998 I finally got around to porting it to xlockmore and sending
+ * it off.
+ *
+ * (The implementation is independent of jwz's---I started with ico.)
+ *
+ * Editor's Note... (DAB)
+ * Removed all original Color stuff.  Replaced it so it could do xoring
+ * effectively....  Took move_line from jwz's version.... to make it legal...
+ *
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Check out A.K. Dewdney's "Computer Recreations", Scientific American
+ * Magazine" Apr 1986 pp 14-25 for more info.
+ * Idea on 3d taken from there but does not work yet.  Also a small number of
+ * random chosen planes drawn may be nice.
+ *
+ * Revision History:
+ * 01-Nov-2000: Added "3d" support from Scientific American
+ * 04-Aug-1998: Added "3d" support from Scientific American
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Hyper"
+#define HACK_INIT init_hyper
+#define HACK_DRAW draw_hyper
+#define HACK_CHANGE change_hyper
+#define hyper_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: -6 \n" \
+ "*cycles: 300 \n" \
+ "*ncolors: 200 \n" \
+ "*use3d: False \n" \
+ "*delta3d: 1.5 \n" \
+ "*right3d: red \n" \
+ "*left3d: blue \n" \
+ "*both3d: magenta \n" \
+ "*none3d: black \n" \
+ "*spinDelay:  2 \n" \
+ "*showAxes:   false \n" \
+ "*randomStart:        false \n" \
+ "*debug:      false \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_hyper
+
+static Bool random_start;
+static Bool show_axes;
+static Bool show_planes;
+static int  spin_delay;
+
+extern XFontStruct *getFont(Display * display);
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-randomstart", (char *) ".hyper.randomStart", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+randomstart", (char *) ".hyper.randomStart", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-showaxes", (char *) ".hyper.showAxes", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+showaxes", (char *) ".hyper.showAxes", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-showplanes", (char *) ".hyper.showPlanes", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+showplanes", (char *) ".hyper.showPlanes", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-spindelay", (char *) ".hyper.spinDelay", XrmoptionSepArg, 0},
+};
+static argtype vars[] =
+{
+  {(caddr_t *) & random_start, (char *) "randomStart", (char *) "RandomStart", (char *) "True", t_Bool},
+       {(caddr_t *) & show_axes, (char *) "showAxes", (char *) "ShowAxes", (char *) "True", t_Bool},
+       {(caddr_t *) & show_planes, (char *) "showPlanes", (char *) "ShowPlanes", (char *) "False", t_Bool},
+       {(caddr_t *) & spin_delay, (char *) "spinDelay", (char *) "SpinDelay", (char *) "2", t_Int},
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+randomstart", (char *) "turn on/off begining with random rotations"},
+       {(char *) "-/+showaxes", (char *) "turn on/off showing the axes"},
+       {(char *) "-/+showplanes", (char *) "turn on/off showing the planes"},
+       {(char *) "-spindelay num", (char *) "delay in seconds before chaning spin speed"},
+};
+
+ModeSpecOpt hyper_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   hyper_description =
+{"hyper", "init_hyper", "draw_hyper", "release_hyper",
+ "refresh_hyper", "change_hyper", NULL, &hyper_opts,
+ 100000, -6, 300, 1, 64, 1.0, "",
+ "Shows spinning n-dimensional hypercubes", 0, NULL};
+
+#endif
+
+#if DEBUG
+#include <assert.h>
+#endif
+
+typedef struct {
+       double      x, y;
+} dpoint;
+
+typedef double vector;         /* Was an array of size (MAX_D + 1) */
+typedef double matrix;         /* Was a double array of size (MAX_D + 1) ^ 2 */
+
+#define MIN_D 2
+#define MAX_D 10               /* Memory use goes up exponentially */
+
+/* Normally DELTA3D is not in degrees, but it works here, so why fight it? */
+#define DELDEG (MI_DELTA3D(mi)*M_PI/180.0)
+
+typedef struct {
+       int         from, to;
+       long        color;
+} line_segment;
+
+typedef struct {
+       int         a, b, c, d;
+       long        color;
+} plane_section;
+
+
+typedef struct hyper {
+       GC          gc;
+       Bool        redrawing;
+       Bool        painted;
+       XFontStruct *font;
+
+       int         show_axes;
+       int         show_planes;
+
+       int         maxx, maxy;
+       int         delay;
+       int         spinDelay;
+       Bool        normxor;
+
+       /*
+        * Data storage.
+        */
+       int         num_d;      /* number of dimensions */
+       int         num_mat;
+       int         num_matmat;
+
+       /* there are C(num_d,2) planes */
+       int         num_planes; /* #define max_planes 40 */
+       XPoint     *rotation_planes;
+
+       /* Formerly max_planes arrays */
+       double     *rotations;  /* where we are in each dimension */
+       double     *d_rotations;        /* change in rotation */
+       double     *dd_rotations;       /* change in change in rotation */
+       int        *cdd_rotations;      /* how many turns to apply dd_rotations */
+       matrix     *Trotations;
+       matrix     *Trotationsleft;
+
+       matrix     *Tall;
+       matrix     *Tallleft;
+
+       int         num_points;
+       vector     *points;
+       vector     *pointsleft;
+       int         num_lines;
+       line_segment *lines;
+       plane_section *planes;
+
+       int         point_set;  /* which bank of points are we using */
+       XPoint     *xpoints[2];
+       XPoint     *xpointsleft[2];
+
+       int         num_axis_points;
+
+       /* Formerly an array of (MAX_D + 1) */
+       int        *axis_points;
+
+       /*
+        * Inter-step state:
+        */
+       int         this_set;
+       Bool        stationary;
+} hyperstruct;
+
+
+static hyperstruct *hypers = NULL;
+
+#define allocarray(P,T,N) if((P=(T*)malloc((N)*sizeof(T)))==NULL) \
+ {free_hyper(display,hp);return False;}
+#define callocarray(P,T,N) if((P=(T*)calloc(N,sizeof(T)))==NULL) \
+ {free_hyper(display,hp);return False;}
+
+/*
+ * Matrix handling & 3d transformation routines
+ */
+
+static void
+MatMult(matrix * a, matrix * b, matrix * c, int n)
+       /* c = a * b  for n x n matricies */
+{
+       register int i, j, k;
+       double      temp;
+
+       /* Strassen' method... what's that? */
+       for (i = 0; i < n; i++) /* go through a's rows */
+               for (j = 0; j < n; j++) {       /* go through b's columns */
+                       temp = 0.0;
+                       for (k = 0; k < n; k++)
+                               temp += a[i * n + k] * b[k * n + j];
+                       c[i * n + j] = temp;
+               }
+}
+
+static void
+MatVecMult(matrix * a, vector * b, vector * c, int n)
+       /* c = a * b  for a n x n, b&c 1 x n */
+{
+       register int i, k;
+       double      temp;
+
+       for (i = 0; i < n; i++) {       /* go through a's rows */
+               temp = 0.0;
+               for (k = 0; k < n; k++)
+                       temp += a[i * n + k] * b[k];
+               c[i] = temp;
+       }
+}
+
+static void
+MatCopy(matrix * a, matrix * b, int n)
+       /* b <- a */
+{
+       register int i, j;
+
+       for (i = 0; i < n; i++)
+               for (j = 0; j < n; j++)
+                       b[i * n + j] = a[i * n + j];
+}
+
+static void
+MatZero(matrix * a, int n)
+       /* a = 0 */
+{
+       register int i, j;
+
+       for (i = 0; i < n; i++)
+               for (j = 0; j < n; j++)
+                       a[i * n + j] = 0.0;
+}
+
+static void
+MatIdent(matrix * a, int n)
+       /* a = I */
+{
+       register int i;
+
+       MatZero(a, n);
+       for (i = 0; i < n; i++)
+               a[i * n + i] = 1.0;
+}
+
+static void
+ZeroMultiCounter(int *c, int n)
+{
+       int         i;
+
+       for (i = 0; i < n; i++)
+               c[i] = 0;
+}
+
+
+static int
+RealIncMultiCounter(int *c, int n, int place)
+{
+#define BASE 2
+       if (place >= n)
+               return 0;
+       else if (++c[place] >= BASE) {
+               c[place] = 0;
+               return RealIncMultiCounter(c, n, place + 1);
+       } else
+               return 1;
+}
+
+
+static int
+IncMultiCounter(int *c, int n)
+{
+       return RealIncMultiCounter(c, n, 0);
+}
+
+
+static int
+figure_num_points(int d)
+{
+       return 1 << d;          /* (int)pow(2.0, (double)d); */
+}
+
+static int
+figure_num_lines(int d)
+{
+       return d * figure_num_points(d - 1);
+}
+
+static int
+figure_num_planes(int d)
+{
+       return ((d - 1) * d) / 2;
+}
+
+static void
+free_hyperstuff(hyperstruct * hp)
+{
+       if (hp->axis_points) {
+               (void) free((void *) hp->axis_points);
+               hp->axis_points = NULL;
+       }
+       if (hp->points) {
+               (void) free((void *) hp->points);
+               hp->points = NULL;
+       }
+       if (hp->pointsleft) {
+               (void) free((void *) hp->pointsleft);
+               hp->pointsleft = NULL;
+       }
+       if (hp->lines) {
+               XFree(hp->lines);
+               hp->lines = NULL;
+       }
+       if (hp->planes) {
+               XFree(hp->planes);
+               hp->planes = NULL;
+       }
+       if (hp->rotation_planes) {
+               XFree(hp->rotation_planes);
+               hp->rotation_planes = NULL;
+       }
+       if (hp->rotations) {
+               (void) free((void *) hp->rotations);
+               hp->rotations = NULL;
+       }
+       if (hp->d_rotations) {
+               (void) free((void *) hp->d_rotations);
+               hp->d_rotations = NULL;
+       }
+       if (hp->dd_rotations) {
+               (void) free((void *) hp->dd_rotations);
+               hp->dd_rotations = NULL;
+       }
+       if (hp->cdd_rotations) {
+               (void) free((void *) hp->cdd_rotations);
+               hp->cdd_rotations = NULL;
+       }
+       if (hp->Trotations) {
+               (void) free((void *) hp->Trotations);
+               hp->Trotations = NULL;
+       }
+       if (hp->Trotationsleft) {
+               (void) free((void *) hp->Trotationsleft);
+               hp->Trotationsleft = NULL;
+       }
+       if (hp->Tall) {
+               (void) free((void *) hp->Tall);
+               hp->Tall = NULL;
+       }
+       if (hp->Tallleft) {
+               (void) free((void *) hp->Tallleft);
+               hp->Tallleft = NULL;
+       }
+       if (hp->xpoints[0]) {
+               XFree(hp->xpoints[0]);
+               hp->xpoints[0] = NULL;
+       }
+       if (hp->xpoints[1]) {
+               XFree(hp->xpoints[1]);
+               hp->xpoints[1] = NULL;
+       }
+       if (hp->xpointsleft[0]) {
+               XFree(hp->xpointsleft[0]);
+               hp->xpointsleft[0] = NULL;
+       }
+       if (hp->xpointsleft[1]) {
+               XFree(hp->xpointsleft[1]);
+               hp->xpointsleft[1] = NULL;
+       }
+}
+
+static void
+free_hyper(Display *display, hyperstruct *hp)
+{
+       if (hp->gc != None) {
+               XFreeGC(display, hp->gc);
+               hp->gc = None;
+       }
+       if (hp->font != None) {
+               XFreeFont(display, hp->font);
+               hp->font = None;
+       }
+       free_hyperstuff(hp);
+}
+
+static Bool
+figure_points(ModeInfo * mi)
+{
+       Display *display = MI_DISPLAY(mi);
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+       int         i, j, k, n, d, pix = 0;
+       int        *c;
+
+       /*
+        * First, figure out the points.
+        */
+       hp->num_points = figure_num_points(hp->num_d);
+#if DEBUG
+       assert(hp->num_points <= hp->max_points);
+#endif
+       allocarray(hp->points, vector, hp->num_points * hp->num_mat);
+       allocarray(hp->xpoints[0], XPoint, hp->num_points);
+       allocarray(hp->xpoints[1], XPoint, hp->num_points);
+       if (MI_IS_USE3D(mi)) {
+               allocarray(hp->pointsleft, vector, hp->num_points * hp->num_mat);
+               allocarray(hp->xpointsleft[0], XPoint, hp->num_points);
+               allocarray(hp->xpointsleft[1], XPoint, hp->num_points);
+       }
+       allocarray(c, int, hp->num_points);     /* will be lost, sigh */
+
+       ZeroMultiCounter(c, hp->num_d);
+       n = 0;
+       do {
+               for (i = 0; i < hp->num_d; i++) {
+                       hp->points[n * hp->num_mat + i] = c[i];
+                       if (MI_IS_USE3D(mi))
+                               hp->pointsleft[n * hp->num_mat + i] = c[i];
+               }
+               n++;
+       } while (IncMultiCounter(c, hp->num_d));
+       (void) free((void *) c);
+#if DEBUG
+       assert(hp->num_points == n);
+#endif
+       /*
+        * Next connect them.
+        * We could do this more intelligently, but why bother?
+        *
+        * Connect points that differ by only one coordinate.
+        */
+       if (MI_NPIXELS(mi) > 2)
+               pix = NRAND(MI_NPIXELS(mi));
+
+       hp->num_lines = figure_num_lines(hp->num_d);
+#if DEBUG
+       assert(hp->num_lines <= hp->max_lines);
+#endif
+       allocarray(hp->lines, line_segment, hp->num_lines);
+       for (n = i = 0; i < hp->num_points; i++) {
+               for (j = i + 1; j < hp->num_points; j++) {
+                       for (d = k = 0; k < hp->num_d; k++) {
+                               if (hp->points[i * hp->num_mat + k] != hp->points[j * hp->num_mat + k])
+                                       d++;
+                       }
+                       if (d == 1) {
+                               hp->lines[n].from = i;
+                               hp->lines[n].to = j;
+                               /* (void) printf ("from %x to %x ", i, j); */
+                               if (MI_NPIXELS(mi) > 2) {
+                                       hp->lines[n].color = MI_PIXEL(mi, pix);
+                                       if (++pix >= MI_NPIXELS(mi))
+                                               pix = 0;
+                               } else
+                                       hp->lines[n].color = MI_WHITE_PIXEL(mi);
+                               n++;
+                       }
+               }
+       }
+#if DEBUG
+       assert(hp->num_lines == n);
+#endif
+
+       /*
+        * Now determine the planes of rotation.
+        */
+       hp->num_planes = figure_num_planes(hp->num_d);
+#if DEBUG
+       assert(hp->num_planes <= max_planes);
+#endif
+       hp->show_planes = show_planes;
+
+       if (hp->show_planes) {
+               allocarray(hp->planes, plane_section, hp->num_planes);
+
+               /* Keeping it simple and just drawing planes that touch the
+                * axes.  Still not that simple, have to figure out which pt c is
+                * furthest away and draw it first... yuck.
+                */
+
+               for (n = i = 0; i < hp->num_d; i++) {
+                       for (j = i + 1; j < hp->num_d; j++) {
+                               hp->planes[n].a = 0;
+                               hp->planes[n].b = 1 << i;
+                               hp->planes[n].d = 1 << j;
+                               hp->planes[n].c = hp->planes[n].b + hp->planes[n].d;
+                               /*(void) printf ("a %d, b %d, c %d, d %d\n",
+                                       0, 1 << i, (1 << i) + (1 << j), 1 << j);*/
+                               if (MI_NPIXELS(mi) > 2) {
+                                       hp->planes[n].color = MI_PIXEL(mi, pix);
+                                       if (++pix >= MI_NPIXELS(mi))
+                                               pix = 0;
+                               } else
+                                       hp->planes[n].color = MI_WHITE_PIXEL(mi);
+                               n++;
+                       }
+               }
+       }
+
+       allocarray(hp->axis_points, int, hp->num_d + 1);
+
+       allocarray(hp->rotations, double, hp->num_planes);
+       callocarray(hp->d_rotations, double, hp->num_planes);
+       callocarray(hp->dd_rotations, double, hp->num_planes);
+       callocarray(hp->cdd_rotations, int, hp->num_planes);
+
+       allocarray(hp->Trotations, matrix, hp->num_planes * hp->num_matmat);
+       allocarray(hp->Tall, matrix, hp->num_matmat);
+
+       if (MI_IS_USE3D(mi)) {
+               allocarray(hp->Trotationsleft, matrix, hp->num_planes * hp->num_matmat);
+               allocarray(hp->Tallleft, matrix, hp->num_matmat);
+       }
+       allocarray(hp->rotation_planes, XPoint, hp->num_planes);
+
+       for (n = i = 0; i < hp->num_d; i++)
+               for (j = i + 1; j < hp->num_d; j++) {
+                       hp->rotation_planes[n].x = i;
+                       hp->rotation_planes[n].y = j;
+                       n++;
+               }
+#if DEBUG
+       assert(hp->num_planes == n);
+#endif
+       /*
+        * Potential random initial rotations.
+        */
+#define FRAC (1024*16)
+       if (random_start) {
+               for (i = 0; i < hp->num_planes; i++)
+                       hp->rotations[i] = 2.0 * NRAND(FRAC) * M_PI / FRAC;
+       }
+       return True;
+}
+
+static void
+figure_axis_points(hyperstruct * hp)
+{
+       int         i, j, num_set;
+
+       hp->show_axes = show_axes;
+       for (hp->num_axis_points = i = 0; i < hp->num_points; i++) {
+               for (num_set = j = 0; j < hp->num_d; j++)
+                       if (hp->points[i * hp->num_mat + j] != 0.0)
+                               num_set++;
+               if (num_set <= 1)
+                       hp->axis_points[hp->num_axis_points++] = i;
+       }
+}
+
+static Bool
+init_x_stuff(ModeInfo * mi)
+{
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+       XGCValues   gcv;
+
+       hp->maxx = MI_WIDTH(mi);
+       hp->maxy = MI_HEIGHT(mi);
+
+
+       hp->spinDelay = 10 * spin_delay;
+       if (hp->spinDelay < 0)
+               hp->spinDelay = 0;
+
+       free_hyperstuff(hp);
+       hp->num_d = MI_COUNT(mi);
+       if (hp->num_d < -MAX_D)
+               hp->num_d = -MAX_D;
+       if (hp->num_d > MAX_D)
+               hp->num_d = MAX_D;
+       else if (hp->num_d < -MIN_D) {
+               hp->num_d = NRAND(-hp->num_d - MIN_D + 1) + MIN_D;
+       } else if (hp->num_d < MIN_D)
+               hp->num_d = MIN_D;
+
+       hp->num_mat = hp->num_d + 1;
+       hp->num_matmat = hp->num_mat * hp->num_mat;
+
+       if (hp->font == None) {
+               if ((hp->font = getFont(MI_DISPLAY(mi))) == None)
+                       return False;
+       }
+       if (MI_NPIXELS(mi) <= 2 || MI_IS_USE3D(mi))
+               hp->normxor = False;
+       if ((hp->gc == None) && (MI_NPIXELS(mi) <= 2 || !MI_IS_USE3D(mi))) {
+               long        options;
+
+               if (hp->normxor) {
+                       options = GCForeground | GCFont | GCFunction;
+                       gcv.foreground = MI_WHITE_PIXEL(mi) ^ MI_BLACK_PIXEL(mi);
+                       gcv.function = GXxor;
+               } else {
+                       options = GCForeground | GCBackground | GCFont;
+                       gcv.foreground = MI_WHITE_PIXEL(mi);
+                       gcv.background = MI_BLACK_PIXEL(mi);
+               }
+               gcv.font = hp->font->fid;
+               if ((hp->gc = XCreateGC(MI_DISPLAY(mi), MI_WINDOW(mi), options,
+                               &gcv)) == None)
+                       return False;
+       }
+       return True;
+}
+
+static void
+move_line(ModeInfo * mi, int from, int to, int set, long color)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) <= 2 || !MI_IS_USE3D(mi))
+               gc = hp->gc;
+       if (hp->normxor) {
+               XSetForeground(display, gc, color);
+               if (!hp->redrawing)
+                       XDrawLine(display, window, gc,
+                       hp->xpoints[!set][from].x, hp->xpoints[!set][from].y,
+                          hp->xpoints[!set][to].x, hp->xpoints[!set][to].y);
+               XDrawLine(display, window, gc,
+                         hp->xpoints[set][from].x, hp->xpoints[set][from].y,
+                         hp->xpoints[set][to].x, hp->xpoints[set][to].y);
+       } else {
+               if (!hp->redrawing) {
+                       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi))
+                               XSetForeground(display, gc, MI_NONE_COLOR(mi));
+                       else
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                       XDrawLine(display, window, gc,
+                         hp->xpoints[set][from].x, hp->xpoints[set][from].y,
+                            hp->xpoints[set][to].x, hp->xpoints[set][to].y);
+                       if (MI_IS_USE3D(mi))
+                               XDrawLine(display, window, gc,
+                                         hp->xpointsleft[set][from].x, hp->xpointsleft[set][from].y,
+                                         hp->xpointsleft[set][to].x, hp->xpointsleft[set][to].y);
+               }
+               if (MI_IS_USE3D(mi)) {
+                       if (MI_IS_INSTALL(mi)) {
+                               XSetFunction(display, gc, GXor);
+                       }
+                       XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               } else if (MI_NPIXELS(mi) <= 2)
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               else
+                       XSetForeground(display, gc, color);
+               XDrawLine(display, window, gc,
+                       hp->xpoints[!set][from].x, hp->xpoints[!set][from].y,
+                         hp->xpoints[!set][to].x, hp->xpoints[!set][to].y);
+               if (MI_IS_USE3D(mi)) {
+                       XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+                       XDrawLine(display, window, gc,
+                                 hp->xpointsleft[!set][from].x, hp->xpointsleft[!set][from].y,
+                                 hp->xpointsleft[!set][to].x, hp->xpointsleft[!set][to].y);
+                       if (MI_IS_INSTALL(mi)) {
+                               XSetFunction(display, gc, GXcopy);
+                       }
+               }
+       }
+}
+
+static void
+move_plane(ModeInfo * mi, int a, int b, int c, int d, int set, long color)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+  XPoint rect[4];
+
+       if (MI_NPIXELS(mi) <= 2 || !MI_IS_USE3D(mi))
+               gc = hp->gc;
+       if (hp->normxor) {
+               XSetForeground(display, gc, color);
+               if (!hp->redrawing) {
+                       rect[0].x = hp->xpoints[!set][a].x;
+                       rect[0].y = hp->xpoints[!set][a].y;
+                       rect[1].x = hp->xpoints[!set][b].x;
+                       rect[1].y = hp->xpoints[!set][b].y;
+                       rect[2].x = hp->xpoints[!set][c].x;
+                       rect[2].y = hp->xpoints[!set][c].y;
+                       rect[3].x = hp->xpoints[!set][d].x;
+                       rect[3].y = hp->xpoints[!set][d].y;
+                       XFillPolygon(display, window, gc, rect, 4, Convex, CoordModeOrigin);
+               }
+               rect[0].x = hp->xpoints[set][a].x;
+               rect[0].y = hp->xpoints[set][a].y;
+               rect[1].x = hp->xpoints[set][b].x;
+               rect[1].y = hp->xpoints[set][b].y;
+               rect[2].x = hp->xpoints[set][c].x;
+               rect[2].y = hp->xpoints[set][c].y;
+               rect[3].x = hp->xpoints[set][d].x;
+               rect[3].y = hp->xpoints[set][d].y;
+               XFillPolygon(display, window, gc, rect, 4, Convex, CoordModeOrigin);
+       } else {
+               if (!hp->redrawing) {
+                       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi))
+                               XSetForeground(display, gc, MI_NONE_COLOR(mi));
+                       else
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                       rect[0].x = hp->xpoints[set][a].x;
+                       rect[0].y = hp->xpoints[set][a].y;
+                       rect[1].x = hp->xpoints[set][b].x;
+                       rect[1].y = hp->xpoints[set][b].y;
+                       rect[2].x = hp->xpoints[set][c].x;
+                       rect[2].y = hp->xpoints[set][c].y;
+                       rect[3].x = hp->xpoints[set][d].x;
+                       rect[3].y = hp->xpoints[set][d].y;
+                       XFillPolygon(display, window, gc, rect, 4, Convex, CoordModeOrigin);
+                       if (MI_IS_USE3D(mi)) {
+                               rect[0].x = hp->xpointsleft[set][a].x;
+                               rect[0].y = hp->xpointsleft[set][a].y;
+                               rect[1].x = hp->xpointsleft[set][b].x;
+                               rect[1].y = hp->xpointsleft[set][b].y;
+                               rect[2].x = hp->xpointsleft[set][c].x;
+                               rect[2].y = hp->xpointsleft[set][c].y;
+                               rect[3].x = hp->xpointsleft[set][d].x;
+                               rect[3].y = hp->xpointsleft[set][d].y;
+                               XFillPolygon(display, window, gc, rect, 4, Convex, CoordModeOrigin);
+                       }
+               }
+               if (MI_IS_USE3D(mi)) {
+                       if (MI_IS_INSTALL(mi)) {
+                               XSetFunction(display, gc, GXor);
+                       }
+                       XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               } else if (MI_NPIXELS(mi) <= 2)
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               else
+                       XSetForeground(display, gc, color);
+               rect[0].x = hp->xpoints[!set][a].x;
+               rect[0].y = hp->xpoints[!set][a].y;
+               rect[1].x = hp->xpoints[!set][b].x;
+               rect[1].y = hp->xpoints[!set][b].y;
+               rect[2].x = hp->xpoints[!set][c].x;
+               rect[2].y = hp->xpoints[!set][c].y;
+               rect[3].x = hp->xpoints[!set][d].x;
+               rect[3].y = hp->xpoints[!set][d].y;
+               XFillPolygon(display, window, gc, rect, 4, Convex, CoordModeOrigin);
+               if (MI_IS_USE3D(mi)) {
+                       XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+                       rect[0].x = hp->xpointsleft[!set][a].x;
+                       rect[0].y = hp->xpointsleft[!set][a].y;
+                       rect[1].x = hp->xpointsleft[!set][b].x;
+                       rect[1].y = hp->xpointsleft[!set][b].y;
+                       rect[2].x = hp->xpointsleft[!set][c].x;
+                       rect[2].y = hp->xpointsleft[!set][c].y;
+                       rect[3].x = hp->xpointsleft[!set][d].x;
+                       rect[3].y = hp->xpointsleft[!set][d].y;
+                       XFillPolygon(display, window, gc, rect, 4, Convex, CoordModeOrigin);
+                       if (MI_IS_INSTALL(mi)) {
+                               XSetFunction(display, gc, GXcopy);
+                       }
+               }
+       }
+}
+
+static void
+move_number(ModeInfo * mi, int axis, char *string, int set, long color)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) <= 2 || !MI_IS_USE3D(mi))
+               gc = hp->gc;
+       if (hp->normxor) {
+               XSetForeground(display, gc, color);
+               if (!hp->redrawing)
+                       (void) XDrawString(display, window, gc,
+                       hp->xpoints[!set][axis].x, hp->xpoints[!set][axis].y,
+                                   string, strlen(string));
+               (void) XDrawString(display, window, gc,
+                         hp->xpoints[set][axis].x, hp->xpoints[set][axis].y,
+                           string, strlen(string));
+       } else {
+               if (!hp->redrawing) {
+                       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi))
+                               XSetForeground(display, gc, MI_NONE_COLOR(mi));
+                       else
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                       (void) XDrawString(display, window, gc,
+                         hp->xpoints[set][axis].x, hp->xpoints[set][axis].y,
+                                   string, strlen(string));
+                       if (MI_IS_USE3D(mi))
+                               (void) XDrawString(display, window, gc,
+                                           hp->xpointsleft[set][axis].x, hp->xpointsleft[set][axis].y,
+                                           string, strlen(string));
+               }
+               if (MI_IS_USE3D(mi)) {
+                       if (MI_IS_INSTALL(mi)) {
+                               XSetFunction(display, gc, GXor);
+                       }
+                       XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               } else if (MI_NPIXELS(mi) <= 2)
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               else
+                       XSetForeground(display, gc, color);
+               (void) XDrawString(display, window, gc,
+                       hp->xpoints[!set][axis].x, hp->xpoints[!set][axis].y,
+                           string, strlen(string));
+               if (MI_IS_USE3D(mi)) {
+                       XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+                       (void) XDrawString(display, window, gc,
+                                   hp->xpointsleft[!set][axis].x, hp->xpointsleft[!set][axis].y,
+                                   string, strlen(string));
+                       if (MI_IS_INSTALL(mi)) {
+                               XSetFunction(display, gc, GXcopy);
+                       }
+               }
+       }
+}
+
+static void
+draw_hyper_step(ModeInfo * mi, int set)
+{
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+       int         i;
+       char        tmps[3];
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (!hp->stationary || hp->redrawing) {
+               for (i = 0; i < hp->num_lines; i++) {
+                       move_line(mi, hp->lines[i].from, hp->lines[i].to,
+                               set, hp->lines[i].color);
+               }
+               if (hp->show_planes) {
+                       for (i = 0; i < hp->num_planes; i++) {
+                               move_plane(mi, hp->planes[i].a, hp->planes[i].b, hp->planes[i].c,
+                                       hp->planes[i].d, set, hp->planes[i].color);
+                       }
+               }
+               if (hp->show_axes) {
+                       for (i = 0; i < hp->num_axis_points; i++) {
+                               (void) sprintf(tmps, "%d", i);
+                               move_number(mi, hp->axis_points[i], tmps, set, MI_WHITE_PIXEL(mi));
+                       }
+               }
+       }
+}
+
+static void
+move_hyper(ModeInfo * mi)
+{
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+       int         i;
+
+/* NEEDSWORK: These should be resources */
+#define default_cdd_rotation 10
+#define default_dd_rotation (M_PI/1024.0)
+       int         axis;
+       int         faster;
+
+       hp->stationary = False;
+       if (hp->spinDelay-- <= 0) {
+
+               hp->spinDelay = 10 * spin_delay;
+               /*
+                * Change rotation?
+                *
+                * 66% chance if stationary, 33% if not.
+                */
+               hp->stationary = True;
+               for (i = 0; i < hp->num_planes; i++)
+                       if (hp->d_rotations[i] != 0.0 || hp->cdd_rotations[i]) {
+                               hp->stationary = False;
+                               break;
+                       }
+               if (NRAND(3) < 1 + hp->stationary) {
+                       /* Change!  But what? */
+                       axis = NRAND(hp->num_planes);
+
+                       /*
+                        * And how much?  33% chance faster, 66% slower.
+                        * If stopped, slower doesn't start it moving
+                        * unless we're stationary.
+                        */
+                       hp->cdd_rotations[axis] = default_cdd_rotation +
+                               NRAND(7) - 3;
+                       faster = (NRAND(3) < 1);
+                       if (faster || hp->dd_rotations[axis] != 0.0 || hp->stationary)
+                               hp->dd_rotations[axis] = default_dd_rotation *
+                                       (hp->dd_rotations[axis] >= 0.0 ? 1 : -1) *
+                                       (faster ? 1 : -1);
+                       if (MI_IS_DEBUG(mi))
+                               (void) fprintf(stderr,
+                                              "axis %d made %s\n", axis, faster ? "faster" : "slower");
+               }
+       }
+       /*
+        * Rotate.
+        */
+       for (i = 0; i < hp->num_planes; i++) {
+               if (hp->cdd_rotations[i]) {
+                       hp->cdd_rotations[i]--;
+                       hp->d_rotations[i] += hp->dd_rotations[i];
+               }
+               hp->rotations[i] += hp->d_rotations[i];
+       }
+}
+
+static Bool
+calc_transformation(ModeInfo * mi)
+{
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+       double      cosa, sina;
+       double      cosb = 0.0, sinb = 0.0;
+       int         p1, p2;
+       matrix     *Ttmp;
+       matrix     *Tpre, *Tuser, *Tuserleft = NULL;
+       matrix     *Tpretranspose, *Tscale, *Tposttranspose;
+       int         i;
+       dpoint      scale, range, offset;
+       double      scale_used;
+
+       Ttmp = (matrix *) malloc(hp->num_matmat * sizeof (matrix));
+       Tpre = (matrix *) malloc(hp->num_matmat * sizeof (matrix));
+       Tuser = (matrix *) malloc(hp->num_matmat * sizeof (matrix));
+       Tpretranspose = (matrix *) malloc(hp->num_matmat * sizeof (matrix));
+       Tscale = (matrix *) malloc(hp->num_matmat * sizeof (matrix));
+       Tposttranspose = (matrix *) malloc(hp->num_matmat * sizeof (matrix));
+       if ((Ttmp == NULL) || (Tpre == NULL) || (Tuser == NULL) ||
+                       (Tpretranspose == NULL) || (Tscale == NULL) ||
+                       (Tposttranspose == NULL)) {
+               if (Ttmp == NULL)       
+                       (void) free((void *) Ttmp);
+               if (Tpre == NULL)       
+                       (void) free((void *) Tpre);
+               if (Tuser == NULL)      
+                       (void) free((void *) Tuser);
+               if (Tpretranspose == NULL)      
+                       (void) free((void *) Tpretranspose);
+               if (Tscale == NULL)     
+                       (void) free((void *) Tscale);
+               if (Tposttranspose == NULL)     
+                       (void) free((void *) Tposttranspose);
+               return False;
+       }
+       if (MI_IS_USE3D(mi)) {
+               if ((Tuserleft = (matrix *) malloc(hp->num_matmat *
+                               sizeof (matrix))) == NULL) {
+                       (void) free((void *) Ttmp);
+                       (void) free((void *) Tpre);
+                       (void) free((void *) Tuser);
+                       (void) free((void *) Tpretranspose);
+                       (void) free((void *) Tscale);
+                       (void) free((void *) Tposttranspose);
+                       return False;
+               }
+       }
+
+       /*
+        * Adjust the data.
+        * Since the data goes from 0->1 on each axis,
+        * we shift it by -0.5 here to center the figure.
+        */
+       MatIdent(Tpre, hp->num_mat);
+       for (i = 0; i < hp->num_d; i++) {
+               Tpre[i * hp->num_mat + hp->num_d] = -0.5;
+       }
+
+       /*
+        * Figure the rotation.
+        */
+       MatIdent(Tuser, hp->num_mat);
+       if (MI_IS_USE3D(mi)) {
+               MatIdent(Tuserleft, hp->num_mat);
+       }
+       for (i = 0; i < hp->num_planes; i++) {
+               p1 = hp->rotation_planes[i].x;
+               p2 = hp->rotation_planes[i].y;
+               if (MI_IS_USE3D(mi)) {
+                       sinb = sin(hp->rotations[i] - DELDEG);
+                       cosb = cos(hp->rotations[i] - DELDEG);
+                       sina = sin(hp->rotations[i] + DELDEG);
+                       cosa = cos(hp->rotations[i] + DELDEG);
+               } else {
+                       sina = sin(hp->rotations[i]);
+                       cosa = cos(hp->rotations[i]);
+               }
+
+               MatIdent(&hp->Trotations[i * hp->num_matmat], hp->num_mat);
+               hp->Trotations[i * hp->num_matmat + p1 * hp->num_mat + p1] =
+                       hp->Trotations[i * hp->num_matmat + p2 * hp->num_mat + p2] = cosa;
+               hp->Trotations[i * hp->num_matmat + p1 * hp->num_mat + p2] = sina;
+               hp->Trotations[i * hp->num_matmat + p2 * hp->num_mat + p1] = -sina;
+               MatMult(&hp->Trotations[i * hp->num_matmat], Tuser, Ttmp, hp->num_mat);
+               MatCopy(Ttmp, Tuser, hp->num_mat);
+
+               if (MI_IS_USE3D(mi)) {
+                       MatIdent(&hp->Trotationsleft[i * hp->num_matmat], hp->num_mat);
+                       hp->Trotationsleft[i * hp->num_matmat + p1 * hp->num_mat + p1] =
+                               hp->Trotationsleft[i * hp->num_matmat + p2 * hp->num_mat + p2] = cosb;
+                       hp->Trotationsleft[i * hp->num_matmat + p1 * hp->num_mat + p2] = sinb;
+                       hp->Trotationsleft[i * hp->num_matmat + p2 * hp->num_mat + p1] = -sinb;
+                       MatMult(&hp->Trotationsleft[i * hp->num_matmat], Tuserleft, Ttmp, hp->num_mat);
+                       MatCopy(Ttmp, Tuserleft, hp->num_mat);
+               }
+       }
+
+/* Now calculate the scaling matrix */
+#if 1
+       /*
+        * Calculate the best scale of the two axes.
+        * Multiply by 0.9 to use 90% of the display.
+        * Divide by the sqrt(2.0) because it's bigest when
+        * rotated by 45 degrees.
+        *
+        * This principle generalizes to sqrt(hp->num_d).
+        */
+#define border_width (0.05)
+       range.x = sqrt((double) hp->num_d);
+       range.y = range.x;
+       scale.x = (1.0 - 2 * border_width) * hp->maxx / range.x;
+       scale.y = (1.0 - 2 * border_width) * hp->maxy / range.y;
+       scale_used = ((scale.x < scale.y) ? scale.x : scale.y);
+       offset.x = hp->maxx / 2.0;
+       offset.y = hp->maxy / 2.0;
+
+       /*
+        * Setup & compute the matricies
+        */
+       MatIdent(Tpretranspose, hp->num_mat);
+       Tpretranspose[0 * hp->num_mat + hp->num_d] = 0;
+       Tpretranspose[1 * hp->num_mat + hp->num_d] = 0;
+
+       MatIdent(Tscale, hp->num_mat);
+       Tscale[0 * hp->num_mat + 0] = scale_used;
+       Tscale[1 * hp->num_mat + 1] = -scale_used;
+
+       MatIdent(Tposttranspose, hp->num_mat);
+       Tposttranspose[0 * hp->num_mat + hp->num_d] = offset.x;
+       Tposttranspose[1 * hp->num_mat + hp->num_d] = offset.y;
+
+       MatMult(Tscale, Tpretranspose, Ttmp, hp->num_mat);
+       MatMult(Tposttranspose, Ttmp, Tscale, hp->num_mat);
+#else
+       MatIdent(Tscale, hp->num_mat);
+#endif
+       (void) free((void *) Tpretranspose);
+       (void) free((void *) Tposttranspose);
+
+       /*
+        * Put it all together.
+        */
+       MatMult(Tuser, Tpre, Ttmp, hp->num_mat);
+       MatMult(Tscale, Ttmp, hp->Tall, hp->num_mat);
+       (void) free((void *) Tuser);
+       if (MI_IS_USE3D(mi)) {
+               MatMult(Tuserleft, Tpre, Ttmp, hp->num_mat);
+               MatMult(Tscale, Ttmp, hp->Tallleft, hp->num_mat);
+               (void) free((void *) Tuserleft);
+       }
+       (void) free((void *) Tpre);
+       (void) free((void *) Ttmp);
+       (void) free((void *) Tscale);
+       return True;
+}
+
+
+static Bool
+translate_point(hyperstruct * hp, matrix * Tall, vector * real, XPoint * screen_image)
+{
+       vector     *image;
+
+    if ((image = (vector *) malloc(hp->num_mat * sizeof (vector))) == NULL)
+               return False;
+       MatVecMult(Tall, real, image, hp->num_mat);
+       screen_image->x = (short) image[0];
+       screen_image->y = (short) image[1];
+
+       (void) free((void *) image);
+       return True;
+}
+
+static Bool
+translate_points(ModeInfo * mi, int set)
+{
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+       int         i;
+
+       if (!calc_transformation(mi))
+               return False;
+       for (i = 0; i < hp->num_points; i++) {
+               if (!translate_point(hp, hp->Tall, &hp->points[i * hp->num_mat],
+                               &hp->xpoints[set][i]))
+                       return False;
+               if (MI_IS_USE3D(mi)) {
+                       if (!translate_point(hp, hp->Tallleft,
+                                       &hp->pointsleft[i * hp->num_mat],
+                                       &hp->xpointsleft[set][i]))
+                               return False;
+               }
+       }
+       return True;
+}
+
+void
+refresh_hyper(ModeInfo * mi)
+{
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+
+       if (!hp->painted) {
+               MI_CLEARWINDOW(mi);
+               hp->redrawing = True;
+               draw_hyper_step(mi, hp->this_set);
+               hp->redrawing = False;
+               hp->painted = True;
+       }
+}
+
+void
+init_hyper(ModeInfo * mi)
+{
+       Display *display = MI_DISPLAY(mi);
+       int         i;
+       hyperstruct *hp;
+
+       if (hypers == NULL) {
+               if ((hypers = (hyperstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (hyperstruct))) == NULL)
+                       return;
+       }
+       hp = &hypers[MI_SCREEN(mi)];
+
+       if (!init_x_stuff(mi)) {
+               free_hyper(display, hp);
+               return;
+       }
+
+       if (!figure_points(mi)) {
+               free_hyper(display, hp);
+               return;
+       }
+
+       /*
+        * Fix the d+1 coord of all points.
+        */
+       for (i = 0; i < hp->num_points; i++) {
+               hp->points[i * hp->num_mat + hp->num_d] = 1;
+               if (MI_IS_USE3D(mi))
+                       hp->pointsleft[i * hp->num_mat + hp->num_d] = 1;
+       }
+
+       figure_axis_points(hp);
+
+       hp->this_set = 0;
+       if (!translate_points(mi, !hp->this_set)) {
+               free_hyper(display, hp);
+               return;
+       }
+       if (!translate_points(mi, hp->this_set)) {
+               free_hyper(display, hp);
+               return;
+       }
+       refresh_hyper(mi);
+       hp->painted = True;
+       hp->stationary = True;
+}
+
+
+void
+draw_hyper(ModeInfo * mi)
+{
+       hyperstruct *hp;
+
+       if (hypers == NULL)
+               return;
+       hp = &hypers[MI_SCREEN(mi)];
+       if (hp->axis_points == NULL)
+               return;
+
+       hp->painted = False;
+       draw_hyper_step(mi, hp->this_set);
+
+       /* Set up next place */
+       move_hyper(mi);
+       if (!translate_points(mi, hp->this_set)) {
+               free_hyper(MI_DISPLAY(mi), hp);
+               return;
+       }
+       if (!hp->stationary)
+               hp->this_set = !hp->this_set;
+}
+
+void
+change_hyper(ModeInfo * mi)
+{
+       hyperstruct *hp = &hypers[MI_SCREEN(mi)];
+
+       /* make it change */
+       hp->spinDelay = 0;
+}
+
+void
+release_hyper(ModeInfo * mi)
+{
+       if (hypers != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_hyper(MI_DISPLAY(mi), &hypers[screen]);
+               (void) free((void *) hypers);
+               hypers = NULL;
+       }
+}
+
+#endif /* MODE_hyper */
diff --git a/modes/ico.c b/modes/ico.c
new file mode 100644 (file)
index 0000000..8a7d820
--- /dev/null
@@ -0,0 +1,1148 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* ico --- bouncing polyhedra */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)ico.c        5.00 2000/11/01 xlockmore";
+
+#endif
+/*-
+ * Copyright (c) 1987  X Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 27-Mar-2000: Added double buffering for drawings
+ * 10-May-1997: Compatible with xscreensaver
+ * 25-Mar-1997: David Bagley <bagleyd@tux.org>
+ *              Took ico from the X11R6 distribution.  Stripped out
+ *              anything complicated... to be added back in later.
+ *              added dodecahedron, tetrahedron, and star octahedron.
+ * $XConsortium: ico.c,v 1.47 94/04/17 20:45:15 gildea Exp $
+ */
+
+/*-
+original copyright
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/******************************************************************************
+ * Description
+ *     Display a wire-frame rotating icosahedron, with hidden lines removed
+ *****************************************************************************/
+/*-
+ * Additions by jimmc@sci:
+ *  faces and colors
+ *  double buffering on the display
+ *  additional polyhedra
+ *
+ * multi-thread version by Stephen Gildea, January 1992
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Ico"
+#define HACK_INIT init_ico
+#define HACK_DRAW draw_ico
+#define ico_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: 0 \n" \
+ "*cycles: 300 \n" \
+ "*ncolors: 200 \n"
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_ico
+
+#define DEF_FACES "True"
+#define DEF_EDGES "True"
+#define DEF_OPAQUE "True"
+
+static Bool faces;
+static Bool edges;
+static Bool opaque;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-faces", (char *) ".ico.faces", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+faces", (char *) ".ico.faces", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-edges", (char *) ".ico.edges", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+edges", (char *) ".ico.edges", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-opaque", (char *) ".ico.opaque", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+opaque", (char *) ".ico.opaque", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & faces, (char *) "faces", (char *) "Faces", (char *) DEF_FACES, t_Bool},
+       {(caddr_t *) & edges, (char *) "edges", (char *) "Edges", (char *) DEF_EDGES, t_Bool},
+       {(caddr_t *) & opaque, (char *) "opaque", (char *) "Opaque", (char *) DEF_OPAQUE, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+faces", (char *) "turn on/off drawing of faces"},
+       {(char *) "-/+edges", (char *) "turn on/off drawing of wireframe"},
+       {(char *) "-/+opaque", (char *) "turn on/off drawing of bottom (unless faces true)"}
+};
+
+ModeSpecOpt ico_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   ico_description =
+{"ico", "init_ico", "draw_ico", "release_ico",
+ "refresh_ico", "change_ico", NULL, &ico_opts,
+ 200000, 0, 400, 0, 64, 1.0, "",
+ "Shows a bouncing polyhedron", 0, NULL};
+
+#endif
+
+#define MINSIZE 5
+#define DEFAULT_DELTAX 13
+#define DEFAULT_DELTAY 9
+
+/*-
+ * This is the description of one polyhedron file
+ */
+
+#define MAXVERTS 120
+       /* great rhombicosidodecahedron has 120 vertices */
+#define MAXNV MAXVERTS
+#define MAXFACES 30
+       /* (hexakis icosahedron has 120 faces) */
+#define MAXEDGES 180
+       /* great rhombicosidodecahedron has 180 edges */
+#define MAXEDGESPERPOLY 20
+
+typedef struct {
+       double      x, y, z;
+} Point3D;
+
+/* structure of the include files which define the polyhedra */
+typedef struct {
+#ifdef DEFUNCT
+       char       *longname;   /* long name of object */
+       char       *shortname;  /* short name of object */
+       char       *dual;       /* long name of dual */
+#endif
+       int         numverts;   /* number of vertices */
+       int         numedges;   /* number of edges */
+       int         numfaces;   /* number of faces */
+       Point3D     v[MAXVERTS];        /* the vertices */
+       int         f[MAXEDGES * 2 + MAXFACES];         /* the faces */
+} Polyinfo;
+
+/*-
+ *                              faces/edges/vert Vertex Config   Wythoff Symbol
+ * tetrahedron                  4/6/4            {3,3,3}         3|2 3
+ * cube                         6/12/8           {4,4,4}         3|2 4
+ * octahedron                   8/12/6           {3,3,3,3}       4|2 3
+ * dodecahedron                 12/30/12         {5,5,5}         3|2 5
+ * icosahedron                  20/30/12         {3,3,3,3,3}     5|2 3
+ *Nice additions would be the Kepler-Poinsot Solids:
+ * small stellated dodecahedron 12/30/12      {5/2,5/2,5/2,5/2,5/2}   5|2 5/2
+ * great stellated dodecahedron 12/30/20         {5/2,5/2,5/2}   3|2 5/2
+ * great dodecahedron           12/30/12         {5,5,5,5,5}/2   5/2|2 5
+ * great icosahedron            20/30/12         {3,3,3,3,3}/2   5/2|2 3
+ */
+
+static Polyinfo polygons[] =
+{
+
+/* objtetra - structure values for tetrahedron */
+       {
+#ifdef DEFUNCT
+               "tetrahedron", "tetra",         /* long and short names */
+               "tetrahedron",  /* long name of dual */
+#endif
+               4, 6, 4,        /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 0.57735
+                       {T, T, T},
+                       {T, -T, -T},
+                       {-T, T, -T},
+                       {-T, -T, T},
+#undef T
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                       3, 2, 1, 0,
+                       3, 1, 3, 0,
+                       3, 3, 2, 0,
+                       3, 2, 3, 1,
+               }
+       },
+
+/* objcube - structure values for cube */
+
+       {
+#ifdef DEFUNCT
+               "hexahedron", "cube",   /* long and short names */
+               "octahedron",   /* long name of dual */
+#endif
+               8, 12, 6,       /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 0.57735
+                       {T, T, T},
+                       {T, T, -T},
+                       {T, -T, -T},
+                       {T, -T, T},
+                       {-T, T, T},
+                       {-T, T, -T},
+                       {-T, -T, -T},
+                       {-T, -T, T},
+#undef T
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                       4, 0, 1, 2, 3,
+                       4, 7, 6, 5, 4,
+                       4, 1, 0, 4, 5,
+                       4, 3, 2, 6, 7,
+                       4, 2, 1, 5, 6,
+                       4, 0, 3, 7, 4,
+               }
+       },
+
+/* objocta - structure values for octahedron */
+
+       {
+#ifdef DEFUNCT
+               "octahedron", "octa",   /* long and short names */
+               "hexahedron",   /* long name of dual */
+#endif
+               6, 12, 8,       /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 1.0
+                       {T, 0, 0},
+                       {-T, 0, 0},
+                       {0, T, 0},
+                       {0, -T, 0},
+                       {0, 0, T},
+                       {0, 0, -T},
+#undef T
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                       3, 0, 4, 2,
+                       3, 0, 2, 5,
+                       3, 0, 5, 3,
+                       3, 0, 3, 4,
+                       3, 1, 2, 4,
+                       3, 1, 5, 2,
+                       3, 1, 3, 5,
+                       3, 1, 4, 3,
+               }
+       },
+
+/* objdodec - structure values for dodecahedron */
+
+       {
+#ifdef DEFUNCT
+               "dodecahedron", "dodeca",       /* long and short names */
+               "icosahedron",  /* long name of dual */
+#endif
+               20, 30, 12,     /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+                       {0.000000, 0.309017, 0.809015},
+                       {0.000000, -0.309017, 0.809015},
+                       {0.000000, -0.309017, -0.809015},
+                       {0.000000, 0.309017, -0.809015},
+                       {0.809015, 0.000000, 0.309017},
+                       {-0.809015, 0.000000, 0.309017},
+                       {-0.809015, 0.000000, -0.309017},
+                       {0.809015, 0.000000, -0.309017},
+                       {0.309017, 0.809015, 0.000000},
+                       {-0.309017, 0.809015, 0.000000},
+                       {-0.309017, -0.809015, 0.000000},
+                       {0.309017, -0.809015, 0.000000},
+                       {0.500000, 0.500000, 0.500000},
+                       {-0.500000, 0.500000, 0.500000},
+                       {-0.500000, -0.500000, 0.500000},
+                       {0.500000, -0.500000, 0.500000},
+                       {0.500000, -0.500000, -0.500000},
+                       {0.500000, 0.500000, -0.500000},
+                       {-0.500000, 0.500000, -0.500000},
+                       {-0.500000, -0.500000, -0.500000},
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                       5, 12, 8, 17, 7, 4,
+                       5, 5, 6, 18, 9, 13,
+                       5, 14, 10, 19, 6, 5,
+                       5, 12, 4, 15, 1, 0,
+                       5, 13, 9, 8, 12, 0,
+                       5, 1, 14, 5, 13, 0,
+                       5, 16, 7, 17, 3, 2,
+                       5, 19, 10, 11, 16, 2,
+                       5, 3, 18, 6, 19, 2,
+                       5, 15, 11, 10, 14, 1,
+                       5, 3, 17, 8, 9, 18,
+                       5, 4, 7, 16, 11, 15,
+               }
+       },
+
+/* objicosa - structure values for icosahedron */
+
+       {
+#ifdef DEFUNCT
+               "icosahedron", "icosa",         /* long and short names */
+               "dodecahedron", /* long name of dual */
+#endif
+               12, 30, 20,     /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+                       {0.00000000, 0.00000000, -0.95105650},
+                       {0.00000000, 0.85065080, -0.42532537},
+                       {0.80901698, 0.26286556, -0.42532537},
+                       {0.50000000, -0.68819095, -0.42532537},
+                       {-0.50000000, -0.68819095, -0.42532537},
+                       {-0.80901698, 0.26286556, -0.42532537},
+                       {0.50000000, 0.68819095, 0.42532537},
+                       {0.80901698, -0.26286556, 0.42532537},
+                       {0.00000000, -0.85065080, 0.42532537},
+                       {-0.80901698, -0.26286556, 0.42532537},
+                       {-0.50000000, 0.68819095, 0.42532537},
+                       {0.00000000, 0.00000000, 0.95105650}
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                       3, 0, 2, 1,
+                       3, 0, 3, 2,
+                       3, 0, 4, 3,
+                       3, 0, 5, 4,
+                       3, 0, 1, 5,
+                       3, 1, 6, 10,
+                       3, 1, 2, 6,
+                       3, 2, 7, 6,
+                       3, 2, 3, 7,
+                       3, 3, 8, 7,
+                       3, 3, 4, 8,
+                       3, 4, 9, 8,
+                       3, 4, 5, 9,
+                       3, 5, 10, 9,
+                       3, 5, 1, 10,
+                       3, 10, 6, 11,
+                       3, 6, 7, 11,
+                       3, 7, 8, 11,
+                       3, 8, 9, 11,
+                       3, 9, 10, 11
+               }
+       },
+
+/* objplane - structure values for plane */
+
+       {
+#ifdef DEFUNCT
+               "plane", "plane",       /* long and short names */
+               "plane",        /* long name of dual?? */
+#endif
+               4, 4, 1,        /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 1.0
+                       {T, 0, 0},
+                       {-T, 0, 0},
+                       {0, T, 0},
+                       {0, -T, 0},
+#undef T
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                       4, 0, 2, 1, 3,
+               }
+       },
+
+/* objpyr - structure values for pyramid */
+
+       {
+#ifdef DEFUNCT
+               "pyramid", "pyramid",   /* long and short names */
+               "pyramid",      /* long name of dual */
+#endif
+               5, 8, 5,        /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 1.0
+                       {T, 0, 0},
+                       {-T, 0, 0},
+                       {0, T, 0},
+                       {0, -T, 0},
+                       {0, 0, T},
+               /* {  0,  0, -T }, */
+#undef T
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+                       /*  faces must be specified clockwise from the outside */
+                       3, 0, 4, 2,
+                       /* 3, 0, 2, 5, */
+                       /* 3, 0, 5, 3, */
+                       3, 0, 3, 4,
+                       3, 1, 2, 4,
+                       /* 3, 1, 5, 2, */
+                       /* 3, 1, 3, 5, */
+                       3, 1, 4, 3,
+                       4, 0, 2, 1, 3,
+               }
+       },
+
+/* ico does not draw non-convex polyhedra well. */
+/* objstar - structure values for octahedron star (stellated octahedron?) */
+       {
+#ifdef DEFUNCT
+               "star", "star", /* long and short names */
+               "star",         /* long name of dual */
+#endif
+               8, 12, 8,       /* number of vertices, edges, and faces */
+               {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 0.577
+                       {T, T, T},
+                       {T, -T, -T},
+                       {-T, T, -T},
+                       {-T, -T, T},
+                       {-T, -T, -T},
+                       {-T, T, T},
+                       {T, -T, T},
+                       {T, T, -T},
+#undef T
+               },
+               {               /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                       3, 2, 1, 0,
+                       3, 1, 3, 0,
+                       3, 3, 2, 0,
+                       3, 2, 3, 1,
+                       3, 6, 5, 4,
+                       3, 5, 7, 4,
+                       3, 7, 6, 4,
+                       3, 6, 7, 5,
+               }
+       },
+  /* Needed 4 other 3-D stars */
+
+};
+
+static int  polysize = sizeof (polygons) / sizeof (polygons[0]);
+#define POLYSIZE 5  /* Only the 5 Platonic solids work, why is that? */
+
+#define POLYBITS(n,w,h)\
+  if ((ip->pixmaps[ip->init_bits]=\
+  XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
+  free_ico(display,ip);return;} else {ip->init_bits++;}
+
+typedef double Transform3D[4][4];
+
+/* variables that need to be per-thread */
+
+typedef struct {
+       int         loopcount;
+       int         object;
+       int         width, height;
+       int         linewidth;
+       long        color;
+       Polyinfo   *poly;
+       int         polyW, polyH;
+       int         currX, currY;
+       int         prevX, prevY;
+       int         polyDeltaX, polyDeltaY;
+       int         deltaWidth, deltaHeight;
+       Bool        faces, edges, opaque;
+       char        drawnEdges[MAXNV][MAXNV];
+       char        drawnPoints[MAXNV];
+       int         xv_buffer;
+       Transform3D xform;
+       Point3D     xv[2][MAXNV];
+       double      wo2, ho2;
+       Pixmap      dbuf;
+       GC          dbuf_gc;
+       int         color_offset;
+       int         init_bits;
+       GC          stippledGC;
+       Pixmap      pixmaps[NUMSTIPPLES - 1];
+} icostruct;
+
+static icostruct *icos = NULL;
+
+/*-
+ * variables that are not set except maybe in initialization before
+ * any additional threads are created
+ */
+
+
+static void
+icoClearArea(ModeInfo * mi, int x, int y, int w, int h)
+{
+       Display    *display = MI_DISPLAY(mi);
+
+#if 1
+       /* my monochrome likes this better */
+       XSetForeground(display, MI_GC(mi), MI_BLACK_PIXEL(mi));
+       XFillRectangle(display, MI_WINDOW(mi), MI_GC(mi), x, y, w, h);
+#else
+       XClearArea(display, MI_WINDOW(mi), x, y, w, h, 0);
+#endif
+}
+
+/******************************************************************************
+ * Description
+ *     Format a 4x4 identity matrix.
+ *
+ * Output
+ *     *m              Formatted identity matrix
+ *****************************************************************************/
+static void
+IdentMat(register Transform3D m)
+{
+       register int i;
+       register int j;
+
+       for (i = 3; i >= 0; --i) {
+               for (j = 3; j >= 0; --j)
+                       m[i][j] = 0.0;
+               m[i][i] = 1.0;
+       }
+}
+
+
+
+/******************************************************************************
+ * Description
+ *     Format a matrix that will perform a rotation transformation
+ *     about the specified axis.  The rotation angle is measured
+ *     counterclockwise about the specified axis when looking
+ *     at the origin from the positive axis.
+ *
+ * Input
+ *     axis            Axis ('x', 'y', 'z') about which to perform rotation
+ *     angle           Angle (in radians) of rotation
+ *     A               Pointer to rotation matrix
+ *
+ * Output
+ *     *m              Formatted rotation matrix
+ *****************************************************************************/
+
+static void
+FormatRotateMat(char axis, double angle, register Transform3D m)
+{
+       double      s, c;
+
+       IdentMat(m);
+
+       s = sin(angle);
+       c = cos(angle);
+
+       switch (axis) {
+               case 'x':
+                       m[1][1] = m[2][2] = c;
+                       m[1][2] = s;
+                       m[2][1] = -s;
+                       break;
+               case 'y':
+                       m[0][0] = m[2][2] = c;
+                       m[2][0] = s;
+                       m[0][2] = -s;
+                       break;
+               case 'z':
+                       m[0][0] = m[1][1] = c;
+                       m[0][1] = s;
+                       m[1][0] = -s;
+                       break;
+       }
+}
+
+
+/******************************************************************************
+ * Description
+ *     Concatenate two 4-by-4 transformation matrices.
+ *
+ * Input
+ *     l               multiplicand (left operand)
+ *     r               multiplier (right operand)
+ *
+ * Output
+ *     *m              Result matrix
+ *****************************************************************************/
+
+static void
+ConcatMat(register Transform3D l, register Transform3D r,
+         register Transform3D m)
+{
+       register int i;
+       register int j;
+
+       for (i = 0; i < 4; ++i)
+               for (j = 0; j < 4; ++j)
+                       m[i][j] = l[i][0] * r[0][j]
+                               + l[i][1] * r[1][j]
+                               + l[i][2] * r[2][j]
+                               + l[i][3] * r[3][j];
+}
+
+/* Set up points, transforms, etc.  */
+
+static void
+initPoly(ModeInfo * mi, Polyinfo * poly, int polyW, int polyH, Bool init)
+{
+       icostruct  *ip = &icos[MI_SCREEN(mi)];
+       Point3D    *vertices = poly->v;
+       int         NV = poly->numverts;
+       Transform3D r1;
+       Transform3D r2;
+
+#define ROLL_DEGREES 5
+       if ((ip->polyDeltaX < 0 && ip->polyDeltaY < 0) ||
+           (ip->polyDeltaX > 0 && ip->polyDeltaY > 0)) {
+               FormatRotateMat('x', ((ip->polyDeltaX > 0) ?
+                 -ROLL_DEGREES : ROLL_DEGREES) * M_PI / 180.0, r1);
+               FormatRotateMat('y', ((ip->polyDeltaY < 0) ?
+                 -ROLL_DEGREES : ROLL_DEGREES) * M_PI / 180.0, r2);
+       } else {
+               FormatRotateMat('x', ((ip->polyDeltaX < 0) ?
+                 -ROLL_DEGREES : ROLL_DEGREES) * M_PI / 180.0, r1);
+               FormatRotateMat('y', ((ip->polyDeltaY > 0) ?
+                 -ROLL_DEGREES : ROLL_DEGREES) * M_PI / 180.0, r2);
+       }
+       ConcatMat(r1, r2, ip->xform);
+    if (init) {
+               (void) memcpy((char *) ip->xv[0], (char *) vertices, NV * sizeof (Point3D));
+               ip->xv_buffer = 0;
+               ip->wo2 = polyW / 2.0;
+               ip->ho2 = polyH / 2.0;
+       }
+}
+
+/******************************************************************************
+ * Description
+ *     Perform a partial transform on non-homogeneous points.
+ *     Given an array of non-homogeneous (3-coordinate) input points,
+ *     this routine multiplies them by the 3-by-3 upper left submatrix
+ *     of a standard 4-by-4 transform matrix.  The resulting non-homogeneous
+ *     points are returned.
+ *
+ * Input
+ *     n               number of points to transform
+ *     m               4-by-4 transform matrix
+ *     in              array of non-homogeneous input points
+ *
+ * Output
+ *     *out            array of transformed non-homogeneous output points
+ *****************************************************************************/
+
+static void
+PartialNonHomTransform(int n, register Transform3D m,
+                      register Point3D * in, register Point3D * out)
+{
+       for (; n > 0; --n, ++in, ++out) {
+               out->x = in->x * m[0][0] + in->y * m[1][0] + in->z * m[2][0];
+               out->y = in->x * m[0][1] + in->y * m[1][1] + in->z * m[2][1];
+               out->z = in->x * m[0][2] + in->y * m[1][2] + in->z * m[2][2];
+       }
+}
+
+
+/******************************************************************************
+ * Description
+ *     Undraw previous polyhedron (by erasing its bounding box).
+ *     Rotate and draw the new polyhedron.
+ *
+ * Input
+ *     poly            the polyhedron to draw
+ *     gc              X11 graphics context to be used for drawing
+ *     currX, currY    position of upper left of bounding-box
+ *     polyW, polyH    size of bounding-box
+ *     prevX, prevY    position of previous bounding-box
+ *****************************************************************************/
+
+static void
+drawPoly(ModeInfo * mi, Polyinfo * poly, GC gc,
+        int currX, int currY, int polyW, int polyH, int prevX, int prevY)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       icostruct  *ip = &icos[MI_SCREEN(mi)];
+       int        *f = poly->f;
+       int         NV = poly->numverts;
+       int         NF = poly->numfaces;
+
+       register int p0;
+       register int p1;
+       register XPoint *pv2;
+       XSegment   *pe;
+       XPoint   *pp;
+       register Point3D *pxv;
+       XPoint      v2[MAXNV];
+       XPoint      pts[MAXNV];
+       XSegment    edge_segs[MAXEDGES];
+       register int i;
+       int         j, k;
+       register int *pf;
+       int         facecolor;
+
+       int         pcount = 0;
+       double      pxvz;
+       XPoint      ppts[MAXEDGESPERPOLY];
+       Window      lwindow;
+       GC          lgc;
+
+       /* Switch double-buffer and rotate vertices */
+
+       ip->xv_buffer = !ip->xv_buffer;
+       PartialNonHomTransform(NV, ip->xform,
+                              ip->xv[!ip->xv_buffer], ip->xv[ip->xv_buffer]);
+
+
+       /* Convert 3D coordinates to 2D window coordinates: */
+
+       pxv = ip->xv[ip->xv_buffer];
+       pv2 = v2;
+       for (i = NV - 1; i >= 0; --i) {
+               pv2->x = (int) ((pxv->x + 1.0) * ip->wo2) + currX;
+               pv2->y = (int) ((pxv->y + 1.0) * ip->ho2) + currY;
+               ++pxv;
+               ++pv2;
+       }
+
+
+       /* Accumulate edges to be drawn, eliminating duplicates for speed: */
+
+       pxv = ip->xv[ip->xv_buffer];
+       pv2 = v2;
+       pf = f;
+       pe = edge_segs;
+       pp = pts;
+       (void) memset(ip->drawnEdges, 0, sizeof (ip->drawnEdges));
+       (void) memset(ip->drawnPoints, 0, sizeof (ip->drawnPoints));
+
+       if (ip->dbuf) {
+               XSetForeground(display, ip->dbuf_gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, ip->dbuf, ip->dbuf_gc, 0, 0,
+                       polyW + ip->deltaWidth + ip->linewidth,
+                       polyH + ip->deltaHeight + ip->linewidth);
+               lwindow = ip->dbuf;
+               lgc = ip->dbuf_gc;
+       } else {
+               lwindow = window;
+               lgc = gc;
+               icoClearArea(mi, prevX, prevY, polyW + 1, polyH + 1);
+       }
+       for (i = NF - 1; i >= 0; --i, pf += pcount) {
+
+               pcount = *pf++; /* number of edges for this face */
+               pxvz = 0.0;
+               for (j = 0; j < pcount; j++) {
+                       p0 = pf[j];
+                       pxvz += pxv[p0].z;
+               }
+
+               /* If facet faces away from viewer, don't consider it: */
+               if (pxvz < 0.0 && (ip->faces || ip->opaque))
+                       continue;
+
+               if (ip->faces) {
+                       for (j = 0; j < pcount; j++) {
+                               p0 = pf[j];
+                               ppts[j].x = pv2[p0].x;
+                               ppts[j].y = pv2[p0].y;
+                               if (ip->dbuf) {
+                                       ppts[j].x -= (currX - ip->deltaWidth / 2 - ip->linewidth / 2);
+                                       ppts[j].y -= (currY - ip->deltaHeight / 2 - ip->linewidth / 2);
+                               }
+                       }
+                       if (MI_NPIXELS(mi) > 2) {
+                               facecolor = (i * MI_NPIXELS(mi) / NF + ip->color_offset) % MI_NPIXELS(mi);
+                               XSetForeground(display, lgc, MI_PIXEL(mi, facecolor));
+                       } else {
+                               XGCValues   gcv;
+                               facecolor = (i * (NUMSTIPPLES - 1) / NF + ip->color_offset) % (NUMSTIPPLES - 1);
+                               gcv.stipple = ip->pixmaps[facecolor];
+                               gcv.foreground = MI_WHITE_PIXEL(mi);
+                               gcv.background = MI_BLACK_PIXEL(mi);
+                               XChangeGC(MI_DISPLAY(mi), ip->stippledGC,
+                          GCStipple | GCForeground | GCBackground, &gcv);
+                               lgc = ip->stippledGC;
+                               /* XSetForeground(display, lgc, MI_WHITE_PIXEL(mi)); */
+                       }
+                       XFillPolygon(display, lwindow, lgc,
+                               ppts, pcount, Convex, CoordModeOrigin);
+               }
+               if (ip->edges) {
+                       for (j = 0; j < pcount; j++) {
+                               if (j < pcount - 1)
+                                       k = j + 1;
+                               else
+                                       k = 0;
+                               p0 = pf[j];
+                               p1 = pf[k];
+                               if (!ip->drawnEdges[p0][p1]) {
+                                       ip->drawnEdges[p0][p1] = 1;
+                                       ip->drawnEdges[p1][p0] = 1;
+                                       pe->x1 = pv2[p0].x;
+                                       pe->y1 = pv2[p0].y;
+                                       pe->x2 = pv2[p1].x;
+                                       pe->y2 = pv2[p1].y;
+                                       if (ip->dbuf) {
+                                               pe->x1 -= (currX - ip->deltaWidth / 2 - ip->linewidth / 2);
+                                               pe->y1 -= (currY - ip->deltaHeight / 2 - ip->linewidth / 2);
+                                               pe->x2 -= (currX - ip->deltaWidth / 2 - ip->linewidth / 2);
+                                               pe->y2 -= (currY - ip->deltaHeight / 2 - ip->linewidth / 2);
+                                       }
+                                       ++pe;
+                               }
+                       }
+               } else {
+                       for (j = 0; j < pcount; j++) {
+                               p0 = pf[j];
+                               if (!ip->drawnPoints[p0]) {
+                                       ip->drawnPoints[p0] = 1;
+                                       pp->x = pv2[p0].x;
+                                       pp->y = pv2[p0].y;
+                                       if (ip->dbuf) {
+                                               pp->x -= (currX - ip->deltaWidth / 2 - ip->linewidth / 2);
+                                               pp->y -= (currY - ip->deltaHeight / 2 - ip->linewidth / 2);
+                                       }
+                                       ++pp;
+                               }
+                       }
+               }
+       }
+       /* Erase previous, draw current icosahedrons; sync for smoothness. */
+
+       if (ip->edges) {
+               if (MI_NPIXELS(mi) <= 2)
+                       if (ip->faces) {
+                               XSetForeground(display, lgc, ip->color);
+                       } else {
+                               XSetForeground(display, lgc, MI_WHITE_PIXEL(mi));
+                       }
+               else {
+                       ip->color = (ip->color + 1) % MI_NPIXELS(mi);
+                       XSetForeground(display, lgc, MI_PIXEL(mi, ip->color));
+               }
+               XSetLineAttributes(display, lgc, ip->linewidth,
+                           LineSolid, CapRound, JoinRound);
+               XDrawSegments(display, lwindow, lgc, edge_segs, pe - edge_segs);
+               XSetLineAttributes(display, lgc, 1,
+                           LineSolid, CapNotLast, JoinRound);
+       } else if (!ip->faces) {
+               if (MI_NPIXELS(mi) <= 2)
+                       XSetForeground(display, lgc, MI_WHITE_PIXEL(mi));
+               else {
+                       ip->color = (ip->color + 1) % MI_NPIXELS(mi);
+                       XSetForeground(display, lgc, MI_PIXEL(mi, ip->color));
+               }
+#if 0
+               /* just does not look that good */
+               if (ip->linewidth <= 1)
+                       XDrawPoints(display, lwindow, lgc, pts, pp - pts, CoordModeOrigin);
+               else
+#endif
+               {
+                       for (j = 0; j < pp-pts; j++)
+                       XFillArc(display, lwindow, lgc,
+                         pts[j].x - ip->linewidth / 2, pts[j].y - ip->linewidth / 2, ip->linewidth, ip->linewidth, 0, 23040);
+
+               }
+       }
+       if (ip->dbuf) {
+               XCopyArea(display, ip->dbuf, window, gc, 0, 0,
+                       polyW + 1 + ip->deltaWidth + ip->linewidth,
+                       polyH + 1 + ip->deltaHeight + ip->linewidth,
+                       currX - ip->deltaWidth / 2 - ip->linewidth / 2,
+                       currY - ip->deltaHeight / 2 - ip->linewidth / 2);
+       }
+       XFlush(display);
+}
+
+static void
+free_ico(Display *display, icostruct *ip)
+{
+       int shade;
+
+       if (ip->stippledGC != None) {
+               XFreeGC(display, ip->stippledGC);
+               ip->stippledGC = None;
+       }
+       for (shade = 0; shade < ip->init_bits; shade++) {
+               if (ip->pixmaps[shade] != None) {
+                       XFreePixmap(display, ip->pixmaps[shade]);
+                       ip->pixmaps[shade] = None;
+               }
+       }
+       if (ip->dbuf != None) {
+               XFreePixmap(display, ip->dbuf);
+               ip->dbuf = None;
+       }
+       if (ip->dbuf_gc != None) {
+               XFreeGC(display, ip->dbuf_gc);
+               ip->dbuf_gc = None;
+       }
+}
+
+void
+init_ico(ModeInfo * mi)
+{
+       Display * display = MI_DISPLAY(mi);
+       Window window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       icostruct  *ip;
+
+       if (icos == NULL) {
+               if ((icos = (icostruct *) calloc(MI_NUM_SCREENS(mi),
+                                                sizeof (icostruct))) == NULL)
+                       return;
+       }
+       ip = &icos[MI_SCREEN(mi)];
+
+       ip->width = MI_WIDTH(mi);
+       ip->height = MI_HEIGHT(mi);
+       ip->linewidth = NRAND((ip->width + ip->height) / 200 + 1) + 2;
+
+       if (MI_NPIXELS(mi) <= 2) {
+               if (ip->stippledGC == None) {
+                       XGCValues   gcv;
+
+                       gcv.fill_style = FillOpaqueStippled;
+                       if ((ip->stippledGC = XCreateGC(display, window, GCFillStyle,
+                                        &gcv)) == NULL) {
+                               free_ico(display, ip);
+                               return;
+                       }
+               }
+               if (ip->init_bits == 0) {
+                       int i;
+
+                       for (i = 1; i < NUMSTIPPLES; i++) {
+                               POLYBITS(stipples[i], STIPPLESIZE, STIPPLESIZE);
+                       }
+               }
+       }
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               ip->faces = (Bool) (LRAND() & 1);
+               ip->edges = (Bool) (LRAND() & 1);
+               ip->opaque = (!(NRAND(4) == 0));
+       } else {
+               ip->edges = edges;
+               ip->faces = faces;
+               ip->opaque = opaque;
+       }
+
+       if (size < -MINSIZE)
+               ip->polyW = NRAND(MIN(-size, MAX(MINSIZE,
+                  MIN(ip->width, ip->height) / 4)) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE) {
+               if (!size)
+                       ip->polyW = MAX(MINSIZE, MIN(ip->width, ip->height) / 4);
+               else
+                       ip->polyW = MINSIZE;
+       } else
+               ip->polyW = MIN(size, MAX(MINSIZE,
+                                         MIN(ip->width, ip->height) / 4));
+
+       ip->polyH = ip->polyW;
+       ip->polyDeltaX = ip->polyW / DEFAULT_DELTAY + 1;
+       ip->polyDeltaY = ip->polyH / DEFAULT_DELTAX + 1;
+       ip->currX = NRAND(ip->width - ip->polyW);
+       ip->currY = NRAND(ip->height - ip->polyH);
+
+       /* Bounce the box in the window */
+
+       ip->deltaWidth = ip->polyDeltaX * 2;
+       ip->deltaHeight = ip->polyDeltaY * 2;
+       ip->polyDeltaX *= ((LRAND() & 1) ? 1 : -1);
+       ip->polyDeltaY *= ((LRAND() & 1) ? 1 : -1);
+
+       ip->loopcount = 0;
+
+       ip->object = MI_COUNT(mi) - 1;
+       if (ip->object < 0 || ip->object >= polysize) {
+               /* avoid pyramid and star (drawing errors) count = 7 & 8
+                  also  avoid plane (boring) count = 6
+                  but allow direct access */
+               ip->object = NRAND(POLYSIZE);
+       }
+       ip->poly = polygons + ip->object;
+       if (MI_NPIXELS(mi) > 2)
+               ip->color = NRAND(MI_NPIXELS(mi));
+       else if (ip->faces && ip->edges)
+               ip->color = (LRAND() & 1) ? MI_WHITE_PIXEL(mi) : MI_BLACK_PIXEL(mi);
+
+       ip->color_offset = NRAND(MI_NPIXELS(mi));
+#ifndef NO_DBUF
+       if (ip->dbuf != None)
+               XFreePixmap(display, ip->dbuf);
+       ip->dbuf = XCreatePixmap(display, window,
+               ip->polyW + ip->deltaWidth + ip->linewidth,
+               ip->polyH + ip->deltaHeight + ip->linewidth,
+               MI_DEPTH(mi));
+       /* Allocation checked */
+       if (ip->dbuf != None) {
+               XGCValues   gcv;
+
+               gcv.foreground = 0;
+               gcv.background = 0;
+               gcv.graphics_exposures = False;
+               gcv.function = GXcopy;
+
+               if (ip->dbuf_gc != None)
+                       XFreeGC(display, ip->dbuf_gc);
+               if ((ip->dbuf_gc = XCreateGC(display, ip->dbuf,
+                               GCForeground | GCBackground | GCGraphicsExposures | GCFunction,
+                               &gcv)) == None) {
+                       XFreePixmap(display, ip->dbuf);
+                       ip->dbuf = None;
+               } else {
+                       XFillRectangle(display, ip->dbuf, ip->dbuf_gc,
+                               0, 0, ip->polyW + ip->deltaWidth + ip->linewidth,
+                               ip->polyH + ip->deltaHeight + ip->linewidth);
+                       XSetBackground(display, MI_GC(mi), MI_BLACK_PIXEL(mi));
+                       XSetFunction(display, MI_GC(mi), GXcopy);
+               }
+       }
+#endif
+
+       MI_CLEARWINDOW(mi);
+
+       /* don't want any exposure events from XCopyPlane */
+       XSetGraphicsExposures(display, MI_GC(mi), False);
+
+
+       initPoly(mi, ip->poly, ip->polyW, ip->polyH, True);
+}
+
+void
+draw_ico(ModeInfo * mi)
+{
+       icostruct  *ip;
+
+       if (icos == NULL)
+               return;
+       ip = &icos[MI_SCREEN(mi)];
+       if ((MI_NPIXELS(mi) <= 2) && (ip->stippledGC == None))
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (++ip->loopcount > MI_CYCLES(mi))
+               init_ico(mi);
+
+       ip->prevX = ip->currX;
+       ip->prevY = ip->currY;
+
+       ip->currX += ip->polyDeltaX;
+       if (ip->currX < 0 || ip->currX + ip->polyW > ip->width) {
+
+               ip->currX -= 2 * ip->polyDeltaX;
+               ip->polyDeltaX = -ip->polyDeltaX;
+               /* spin should change after hitting wall */
+               initPoly(mi, ip->poly, ip->polyW, ip->polyH, False);
+       }
+       ip->currY += ip->polyDeltaY;
+       if (ip->currY < 0 || ip->currY + ip->polyH > ip->height) {
+               ip->currY -= 2 * ip->polyDeltaY;
+               ip->polyDeltaY = -ip->polyDeltaY;
+               /* spin should change after hitting wall */
+               initPoly(mi, ip->poly, ip->polyW, ip->polyH, False);
+       }
+       drawPoly(mi, ip->poly, MI_GC(mi),
+          ip->currX, ip->currY, ip->polyW, ip->polyH, ip->prevX, ip->prevY);
+}
+void
+refresh_ico(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+void
+release_ico(ModeInfo * mi)
+{
+       if (icos != NULL) {
+               int screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_ico(MI_DISPLAY(mi), &icos[screen]);
+               (void) free((void *) icos);
+               icos = NULL;
+       }
+}
+
+void
+change_ico(ModeInfo * mi)
+{
+       icostruct  *ip;
+
+       if (icos == NULL)
+               return;
+       ip = &icos[MI_SCREEN(mi)];
+       if (MI_NPIXELS(mi) <= 2 && ip->stippledGC == None)
+               return;
+
+       if (MI_COUNT(mi) <= 0 || MI_COUNT(mi) > POLYSIZE) {
+               ip->object = (ip->object + 1) % (POLYSIZE);
+               ip->poly = polygons + ip->object;
+       }
+       ip->loopcount = 0;
+
+       MI_CLEARWINDOWCOLORMAPFAST(mi, MI_GC(mi), MI_BLACK_PIXEL(mi));
+
+       initPoly(mi, ip->poly, ip->polyW, ip->polyH, True);
+}
+
+#endif /* MODE_ico */
diff --git a/modes/ifs.c b/modes/ifs.c
new file mode 100644 (file)
index 0000000..8941a75
--- /dev/null
@@ -0,0 +1,505 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* ifs --- modified iterated functions system */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)ifs.c        5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by Massimino Pascal <Pascal.Massimon@ens.fr>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * If this mode is weird and you have an old MetroX server, it is buggy.
+ * There is a free SuSE-enhanced MetroX X server that is fine.
+ *
+ * When shown ifs, Diana Rose (4 years old) said, "It looks like dancing."
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: jwz@jwz.org: turned into a standalone program.
+ *              Made it render into an offscreen bitmap and then copy
+ *              that onto the screen, to reduce flicker.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "IFS"
+#define HACK_INIT init_ifs
+#define HACK_DRAW draw_ifs
+#define ifs_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*ncolors: 100 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_ifs
+
+ModeSpecOpt ifs_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   ifs_description =
+{"ifs", "init_ifs", "draw_ifs", "release_ifs",
+ "init_ifs", "init_ifs", NULL, &ifs_opts,
+ 1000, 1, 1, 1, 64, 1.0, "",
+ "Shows a modified iterated function system", 0, NULL};
+
+#endif
+
+/*****************************************************/
+
+typedef float DBL;
+typedef int F_PT;
+
+/* typedef float               F_PT; */
+
+/*****************************************************/
+
+#define FIX 12
+#define UNIT   ( 1<<FIX )
+#define MAX_SIMI  6
+
+   /* settings for a PC 120Mhz... */
+#define MAX_DEPTH_2  10
+#define MAX_DEPTH_3  6
+#define MAX_DEPTH_4  4
+#define MAX_DEPTH_5  3
+
+#define DBL_To_F_PT(x)  (F_PT)( (DBL)(UNIT)*(x) )
+
+typedef struct Similitude_Struct SIMI;
+typedef struct Fractal_Struct FRACTAL;
+
+struct Similitude_Struct {
+
+       DBL         c_x, c_y;
+       DBL         r, r2, A, A2;
+       F_PT        Ct, St, Ct2, St2;
+       F_PT        Cx, Cy;
+       F_PT        R, R2;
+};
+
+struct Fractal_Struct {
+
+       int         Nb_Simi;
+       SIMI        Components[5 * MAX_SIMI];
+       int         Depth, Col;
+       int         Count, Speed;
+       int         Width, Height, Lx, Ly;
+       DBL         r_mean, dr_mean, dr2_mean;
+       int         Cur_Pt, Max_Pt;
+       XPoint     *Buffer1, *Buffer2;
+       Pixmap      dbuf;
+       GC          dbuf_gc;
+};
+
+static FRACTAL *Root = NULL, *Cur_F;
+static XPoint *Buf;
+static int  Cur_Pt;
+
+
+/*****************************************************/
+
+static      DBL
+Gauss_Rand(DBL c, DBL A, DBL S)
+{
+       DBL         y;
+
+       y = (DBL) LRAND() / MAXRAND;
+       y = A * (1.0 - exp(-y * y * S)) / (1.0 - exp(-S));
+       if (NRAND(2))
+               return (c + y);
+       return (c - y);
+}
+
+static      DBL
+Half_Gauss_Rand(DBL c, DBL A, DBL S)
+{
+       DBL         y;
+
+       y = (DBL) LRAND() / MAXRAND;
+       y = A * (1.0 - exp(-y * y * S)) / (1.0 - exp(-S));
+       return (c + y);
+}
+
+static void
+Random_Simis(FRACTAL * F, SIMI * Cur, int i)
+{
+       while (i--) {
+               Cur->c_x = Gauss_Rand(0.0, .8, 4.0);
+               Cur->c_y = Gauss_Rand(0.0, .8, 4.0);
+               Cur->r = Gauss_Rand(F->r_mean, F->dr_mean, 3.0);
+               Cur->r2 = Half_Gauss_Rand(0.0, F->dr2_mean, 2.0);
+               Cur->A = Gauss_Rand(0.0, 360.0, 4.0) * (M_PI / 180.0);
+               Cur->A2 = Gauss_Rand(0.0, 360.0, 4.0) * (M_PI / 180.0);
+               Cur++;
+       }
+}
+
+static void
+free_ifs_buffers(FRACTAL *Fractal)
+{
+       if (Fractal->Buffer1 != NULL) {
+               (void) free((void *) Fractal->Buffer1);
+               Fractal->Buffer1 = NULL;
+       }
+       if (Fractal->Buffer2 != NULL) {
+               (void) free((void *) Fractal->Buffer2);
+               Fractal->Buffer2 = NULL;
+       }
+}
+
+
+static void
+free_ifs(Display *display, FRACTAL *Fractal)
+{
+       free_ifs_buffers(Fractal);
+       if (Fractal->dbuf != None) {
+               XFreePixmap(display, Fractal->dbuf);
+               Fractal->dbuf = None;
+       }
+       if (Fractal->dbuf_gc != None) {
+               XFreeGC(display, Fractal->dbuf_gc);
+               Fractal->dbuf_gc = None;
+       }
+}
+
+/***************************************************************/
+
+void
+init_ifs(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         i;
+       FRACTAL    *Fractal;
+
+       if (Root == NULL) {
+               Root = (FRACTAL *) calloc(
+                                      MI_NUM_SCREENS(mi), sizeof (FRACTAL));
+               if (Root == NULL)
+                       return;
+       }
+       Fractal = &Root[MI_SCREEN(mi)];
+
+       free_ifs_buffers(Fractal);
+       i = (NRAND(4)) + 2;     /* Number of centers */
+       switch (i) {
+               case 3:
+                       Fractal->Depth = MAX_DEPTH_3;
+                       Fractal->r_mean = .6;
+                       Fractal->dr_mean = .4;
+                       Fractal->dr2_mean = .3;
+                       break;
+
+               case 4:
+                       Fractal->Depth = MAX_DEPTH_4;
+                       Fractal->r_mean = .5;
+                       Fractal->dr_mean = .4;
+                       Fractal->dr2_mean = .3;
+                       break;
+
+               case 5:
+                       Fractal->Depth = MAX_DEPTH_5;
+                       Fractal->r_mean = .5;
+                       Fractal->dr_mean = .4;
+                       Fractal->dr2_mean = .3;
+                       break;
+
+               default:
+               case 2:
+                       Fractal->Depth = MAX_DEPTH_2;
+                       Fractal->r_mean = .7;
+                       Fractal->dr_mean = .3;
+                       Fractal->dr2_mean = .4;
+                       break;
+       }
+       /* (void) fprintf( stderr, "N=%d\n", i ); */
+       Fractal->Nb_Simi = i;
+       Fractal->Max_Pt = Fractal->Nb_Simi - 1;
+       for (i = 0; i <= Fractal->Depth + 2; ++i)
+               Fractal->Max_Pt *= Fractal->Nb_Simi;
+
+       if ((Fractal->Buffer1 = (XPoint *) calloc(Fractal->Max_Pt,
+                       sizeof (XPoint))) == NULL) {
+               free_ifs(display, Fractal);
+               return;
+       }
+       if ((Fractal->Buffer2 = (XPoint *) calloc(Fractal->Max_Pt,
+                       sizeof (XPoint))) == NULL) {
+               free_ifs(display, Fractal);
+               return;
+       }
+       Fractal->Speed = 6;
+       Fractal->Width = MI_WIDTH(mi);
+       Fractal->Height = MI_HEIGHT(mi);
+       Fractal->Cur_Pt = 0;
+       Fractal->Count = 0;
+       Fractal->Lx = (Fractal->Width - 1) / 2;
+       Fractal->Ly = (Fractal->Height - 1) / 2;
+       Fractal->Col = NRAND(MI_NPIXELS(mi) - 1) + 1;
+
+       Random_Simis(Fractal, Fractal->Components, 5 * MAX_SIMI);
+
+#ifndef NO_DBUF
+       if (Fractal->dbuf != None)
+               XFreePixmap(display, Fractal->dbuf);
+       Fractal->dbuf = XCreatePixmap(display, window,
+                                     Fractal->Width, Fractal->Height, 1);
+       /* Allocation checked */
+       if (Fractal->dbuf != None) {
+               XGCValues   gcv;
+
+               gcv.foreground = 0;
+               gcv.background = 0;
+               gcv.graphics_exposures = False;
+               gcv.function = GXcopy;
+
+               if (Fractal->dbuf_gc != None)
+                       XFreeGC(display, Fractal->dbuf_gc);
+               if ((Fractal->dbuf_gc = XCreateGC(display, Fractal->dbuf,
+                               GCForeground | GCBackground | GCGraphicsExposures | GCFunction,
+                               &gcv)) == None) {
+                       XFreePixmap(display, Fractal->dbuf);
+                       Fractal->dbuf = None;
+               } else {
+                       XFillRectangle(display, Fractal->dbuf,
+                           Fractal->dbuf_gc, 0, 0, Fractal->Width, Fractal->Height);
+                       XSetBackground(display, gc, MI_BLACK_PIXEL(mi));
+                       XSetFunction(display, gc, GXcopy);
+               }
+       }
+#endif
+       MI_CLEARWINDOW(mi);
+
+       /* don't want any exposure events from XCopyPlane */
+       XSetGraphicsExposures(display, gc, False);
+
+}
+
+
+/***************************************************************/
+
+/* Should be taken care of already... but just in case */
+#if !defined( __GNUC__ ) && !defined(__cplusplus) && !defined(c_plusplus)
+#undef inline
+#define inline                 /* */
+#endif
+static inline void
+Transform(SIMI * Simi, F_PT xo, F_PT yo, F_PT * x, F_PT * y)
+{
+       F_PT        xx, yy;
+
+       xo = xo - Simi->Cx;
+       xo = (xo * Simi->R) / UNIT;
+       yo = yo - Simi->Cy;
+       yo = (yo * Simi->R) / UNIT;
+
+       xx = xo - Simi->Cx;
+       xx = (xx * Simi->R2) / UNIT;
+       yy = -yo - Simi->Cy;
+       yy = (yy * Simi->R2) / UNIT;
+
+       *x = ((xo * Simi->Ct - yo * Simi->St + xx * Simi->Ct2 - yy * Simi->St2) / UNIT) + Simi->Cx;
+       *y = ((xo * Simi->St + yo * Simi->Ct + xx * Simi->St2 + yy * Simi->Ct2) / UNIT) + Simi->Cy;
+}
+
+/***************************************************************/
+
+static void
+Trace(FRACTAL * F, F_PT xo, F_PT yo)
+{
+       F_PT        x, y, i;
+       SIMI       *Cur;
+
+       Cur = Cur_F->Components;
+       for (i = Cur_F->Nb_Simi; i; --i, Cur++) {
+               Transform(Cur, xo, yo, &x, &y);
+               Buf->x = F->Lx + (x * F->Lx / (UNIT * 2));
+               Buf->y = F->Ly - (y * F->Ly / (UNIT * 2));
+               Buf++;
+               Cur_Pt++;
+
+               if (F->Depth && ((x - xo) >> 4) && ((y - yo) >> 4)) {
+                       F->Depth--;
+                       Trace(F, x, y);
+                       F->Depth++;
+               }
+       }
+}
+
+static void
+Draw_Fractal(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       FRACTAL    *F = &Root[MI_SCREEN(mi)];
+       int         i, j;
+       F_PT        x, y, xo, yo;
+       SIMI       *Cur, *Simi;
+
+       for (Cur = F->Components, i = F->Nb_Simi; i; --i, Cur++) {
+               Cur->Cx = DBL_To_F_PT(Cur->c_x);
+               Cur->Cy = DBL_To_F_PT(Cur->c_y);
+
+               Cur->Ct = DBL_To_F_PT(cos(Cur->A));
+               Cur->St = DBL_To_F_PT(sin(Cur->A));
+               Cur->Ct2 = DBL_To_F_PT(cos(Cur->A2));
+               Cur->St2 = DBL_To_F_PT(sin(Cur->A2));
+
+               Cur->R = DBL_To_F_PT(Cur->r);
+               Cur->R2 = DBL_To_F_PT(Cur->r2);
+       }
+
+
+       Cur_Pt = 0;
+       Cur_F = F;
+       Buf = F->Buffer2;
+       for (Cur = F->Components, i = F->Nb_Simi; i; --i, Cur++) {
+               xo = Cur->Cx;
+               yo = Cur->Cy;
+               for (Simi = F->Components, j = F->Nb_Simi; j; --j, Simi++) {
+                       if (Simi == Cur)
+                               continue;
+                       Transform(Simi, xo, yo, &x, &y);
+                       Trace(F, x, y);
+               }
+       }
+
+       /* Erase previous */
+       if (F->Cur_Pt) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               if (F->dbuf != None) {
+                       XSetForeground(display, F->dbuf_gc, 0);
+                       /* XDrawPoints(display, F->dbuf, F->dbuf_gc, F->Buffer1, F->Cur_Pt,
+                               CoordModeOrigin); */
+                       XFillRectangle(display, F->dbuf, F->dbuf_gc, 0, 0,
+                                      F->Width, F->Height);
+               } else
+                       XDrawPoints(display, window, gc, F->Buffer1, F->Cur_Pt, CoordModeOrigin);
+       }
+       if (MI_NPIXELS(mi) < 2)
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       else
+               XSetForeground(display, gc, MI_PIXEL(mi, F->Col % MI_NPIXELS(mi)));
+       if (Cur_Pt) {
+               if (F->dbuf != None) {
+                       XSetForeground(display, F->dbuf_gc, 1);
+                       XDrawPoints(display, F->dbuf, F->dbuf_gc, F->Buffer2, Cur_Pt,
+                                   CoordModeOrigin);
+               } else
+                       XDrawPoints(display, window, gc, F->Buffer2, Cur_Pt, CoordModeOrigin);
+       }
+       if (F->dbuf != None)
+               XCopyPlane(display, F->dbuf, window, gc, 0, 0, F->Width, F->Height, 0, 0, 1);
+
+       F->Cur_Pt = Cur_Pt;
+       Buf = F->Buffer1;
+       F->Buffer1 = F->Buffer2;
+       F->Buffer2 = Buf;
+}
+
+
+void
+draw_ifs(ModeInfo * mi)
+{
+       int         i;
+       DBL         u, uu, v, vv, u0, u1, u2, u3;
+       SIMI       *S, *S1, *S2, *S3, *S4;
+       FRACTAL    *F;
+
+       if (Root == NULL)
+               return;
+       F = &Root[MI_SCREEN(mi)];
+       if (F->Buffer1 == NULL)
+               return;
+
+       u = (DBL) (F->Count) * (DBL) (F->Speed) / 1000.0;
+       uu = u * u;
+       v = 1.0 - u;
+       vv = v * v;
+       u0 = vv * v;
+       u1 = 3.0 * vv * u;
+       u2 = 3.0 * v * uu;
+       u3 = u * uu;
+
+       S = F->Components;
+       S1 = S + F->Nb_Simi;
+       S2 = S1 + F->Nb_Simi;
+       S3 = S2 + F->Nb_Simi;
+       S4 = S3 + F->Nb_Simi;
+
+       for (i = F->Nb_Simi; i; --i, S++, S1++, S2++, S3++, S4++) {
+               S->c_x = u0 * S1->c_x + u1 * S2->c_x + u2 * S3->c_x + u3 * S4->c_x;
+               S->c_y = u0 * S1->c_y + u1 * S2->c_y + u2 * S3->c_y + u3 * S4->c_y;
+               S->r = u0 * S1->r + u1 * S2->r + u2 * S3->r + u3 * S4->r;
+               S->r2 = u0 * S1->r2 + u1 * S2->r2 + u2 * S3->r2 + u3 * S4->r2;
+               S->A = u0 * S1->A + u1 * S2->A + u2 * S3->A + u3 * S4->A;
+               S->A2 = u0 * S1->A2 + u1 * S2->A2 + u2 * S3->A2 + u3 * S4->A2;
+       }
+
+       MI_IS_DRAWN(mi) = True;
+
+       Draw_Fractal(mi);
+
+       if (F->Count >= 1000 / F->Speed) {
+               S = F->Components;
+               S1 = S + F->Nb_Simi;
+               S2 = S1 + F->Nb_Simi;
+               S3 = S2 + F->Nb_Simi;
+               S4 = S3 + F->Nb_Simi;
+
+               for (i = F->Nb_Simi; i; --i, S++, S1++, S2++, S3++, S4++) {
+                       S2->c_x = 2.0 * S4->c_x - S3->c_x;
+                       S2->c_y = 2.0 * S4->c_y - S3->c_y;
+                       S2->r = 2.0 * S4->r - S3->r;
+                       S2->r2 = 2.0 * S4->r2 - S3->r2;
+                       S2->A = 2.0 * S4->A - S3->A;
+                       S2->A2 = 2.0 * S4->A2 - S3->A2;
+
+                       *S1 = *S4;
+               }
+               Random_Simis(F, F->Components + 3 * F->Nb_Simi, F->Nb_Simi);
+
+               Random_Simis(F, F->Components + 4 * F->Nb_Simi, F->Nb_Simi);
+
+               F->Count = 0;
+       } else
+               F->Count++;
+
+       F->Col++;
+}
+
+
+/***************************************************************/
+
+void
+release_ifs(ModeInfo * mi)
+{
+       if (Root != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_ifs(MI_DISPLAY(mi), &Root[screen]);
+               (void) free((void *) Root);
+               Root = NULL;
+       }
+}
+
+#endif /* MODE_ifs */
diff --git a/modes/image.c b/modes/image.c
new file mode 100644 (file)
index 0000000..73ce8e6
--- /dev/null
@@ -0,0 +1,303 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* image --- image bouncer */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)image.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 03-Nov-1995: Patched to add an arbitrary xpm file.
+ * 21-Sep-1995: Patch if xpm fails to load <Markus.Zellner@anu.edu.au>.
+ * 17-Jun-1995: Pixmap stuff of Skip_Burrell@sterling.com added.
+ * 07-Dec-1994: Icons are now better centered if do not exactly fill an area.
+ * 29-Jul-1990: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Image"
+#define HACK_INIT init_image
+#define HACK_DRAW draw_image
+#define image_opts xlockmore_opts
+#define DEFAULTS "*delay: 2000000 \n" \
+ "*count: -10 \n" \
+ "*ncolors: 200 \n" \
+ "*bitmap: \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_image
+
+ModeSpecOpt image_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   image_description =
+{"image", "init_image", "draw_image", "release_image",
+ "refresh_image", "init_image", NULL, &image_opts,
+ 2000000, -10, 1, 1, 64, 1.0, "",
+ "Shows randomly appearing logos", 0, NULL};
+
+#endif
+
+/* aliases for vars defined in the bitmap file */
+#define IMAGE_WIDTH    image_width
+#define IMAGE_HEIGHT   image_height
+#define IMAGE_BITS     image_bits
+
+#include "image.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define IMAGE_NAME     image_name
+#include "image.xpm"
+#define DEFAULT_XPM 1
+#endif
+
+#define MINICONS 1
+
+typedef struct {
+       int         x, y;
+       int         color;
+} imagetype;
+
+typedef struct {
+       int         width, height;
+       int         nrows, ncols;
+       XPoint      image_offset;
+       int         iconcount;
+       imagetype  *icons;
+       int         graphics_format;
+       GC          backGC;
+       XImage     *logo;
+       Colormap    cmap;
+       unsigned long black;
+} imagestruct;
+
+static imagestruct *ims = NULL;
+
+static void
+free_stuff(Display * display, imagestruct * ip)
+{
+       if (ip->cmap != None) {
+               XFreeColormap(display, ip->cmap);
+               if (ip->backGC != None) {
+                       XFreeGC(display, ip->backGC);
+                       ip->backGC = None;
+               }
+               ip->cmap = None;
+       } else
+               ip->backGC = None;
+}
+
+static void
+free_image(Display * display, imagestruct * ip)
+{
+       if (ip->icons != NULL) {
+               (void) free((void *) ip->icons);
+               ip->icons = NULL;
+       }
+       free_stuff(display, ip);
+       if (ip->logo != None) {
+               destroyImage(&ip->logo, &ip->graphics_format);
+               ip->logo = None;
+       }
+}
+
+static Bool
+init_stuff(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       imagestruct *ip = &ims[MI_SCREEN(mi)];
+
+       if (ip->logo == None) {
+               getImage(mi, &ip->logo, IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                        DEFAULT_XPM, IMAGE_NAME,
+#endif
+                        &ip->graphics_format, &ip->cmap, &ip->black);
+               if (ip->logo == None) {
+                       free_image(display, ip);
+                       return False;
+               }
+       }
+#ifndef STANDALONE
+       if (ip->cmap != None) {
+               setColormap(display, window, ip->cmap, MI_IS_INWINDOW(mi));
+               if (ip->backGC == None) {
+                       XGCValues   xgcv;
+
+                       xgcv.background = ip->black;
+                       if ((ip->backGC = XCreateGC(display, window, GCBackground,
+                                       &xgcv)) == None) {
+                               free_image(display, ip);
+                               return False;
+                       }
+               }
+       } else
+#endif /* STANDALONE */
+       {
+               ip->black = MI_BLACK_PIXEL(mi);
+               ip->backGC = MI_GC(mi);
+       }
+       return True;
+}
+
+static void
+drawimages(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       imagestruct *ip = &ims[MI_SCREEN(mi)];
+       int         i;
+
+
+       MI_CLEARWINDOWCOLORMAPFAST(mi, ip->backGC, ip->black);
+       if (MI_NPIXELS(mi) <= 2)
+               XSetForeground(display, ip->backGC, MI_WHITE_PIXEL(mi));
+       for (i = 0; i < ip->iconcount; i++) {
+               if (ip->logo != NULL && ip->icons[i].x >= 0) {
+                       if (MI_NPIXELS(mi) > 2 && ip->graphics_format < IS_XPM)
+                               XSetForeground(display, ip->backGC, MI_PIXEL(mi, ip->icons[i].color));
+                       (void) XPutImage(display, window, ip->backGC, ip->logo, 0, 0,
+                       ip->logo->width * ip->icons[i].x + ip->image_offset.x,
+                                        ip->logo->height * ip->icons[i].y + ip->image_offset.y,
+                                        ip->logo->width, ip->logo->height);
+               }
+       }
+}
+
+void
+init_image(ModeInfo * mi)
+{
+       imagestruct *ip;
+       int         i;
+
+       if (ims == NULL) {
+               if ((ims = (imagestruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (imagestruct))) == NULL)
+                       return;
+       }
+       ip = &ims[MI_SCREEN(mi)];
+
+       if (!init_stuff(mi))
+               return;
+
+       ip->width = MI_WIDTH(mi);
+       ip->height = MI_HEIGHT(mi);
+       if (ip->width > ip->logo->width)
+               ip->ncols = ip->width / ip->logo->width;
+       else
+               ip->ncols = 1;
+       if (ip->height > ip->logo->height)
+               ip->nrows = ip->height / ip->logo->height;
+       else
+               ip->nrows = 1;
+       ip->image_offset.x = (ip->width - ip->ncols * ip->logo->width) / 2;
+       ip->image_offset.y = (ip->height - ip->nrows * ip->logo->height) / 2;
+       ip->iconcount = MI_COUNT(mi);
+       if (ip->iconcount < -MINICONS)
+               ip->iconcount = NRAND(-ip->iconcount - MINICONS + 1) + MINICONS;
+       else if (ip->iconcount < MINICONS)
+               ip->iconcount = MINICONS;
+       if (ip->iconcount > ip->ncols * ip->nrows)
+               ip->iconcount = ip->ncols * ip->nrows;
+       if (ip->icons != NULL)
+               (void) free((void *) ip->icons);
+       if ((ip->icons = (imagetype *) malloc(ip->iconcount *
+                       sizeof (imagetype))) == NULL) {
+               free_image(MI_DISPLAY(mi), ip);
+               return;
+       }
+       for (i = 0; i < ip->iconcount; i++)
+               ip->icons[i].x = -1;
+
+       MI_CLEARWINDOWCOLORMAP(mi, ip->backGC, ip->black);
+}
+
+void
+draw_image(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i;
+       imagestruct *ip;
+
+       if (ims == NULL)
+               return;
+       ip = &ims[MI_SCREEN(mi)];
+       if (ip->icons == NULL)
+               return;
+       
+       MI_IS_DRAWN(mi) = True;
+       XSetForeground(display, ip->backGC, ip->black);
+       for (i = 0; i < ip->iconcount; i++) {
+               if ((ip->ncols * ip->nrows > ip->iconcount) && ip->icons[i].x >= 0)
+                       XFillRectangle(display, window, ip->backGC,
+                       ip->logo->width * ip->icons[i].x + ip->image_offset.x,
+                                      ip->logo->height * ip->icons[i].y + ip->image_offset.y,
+                                      ip->logo->width, ip->logo->height);
+               ip->icons[i].x = NRAND(ip->ncols);
+               ip->icons[i].y = NRAND(ip->nrows);
+               ip->icons[i].color = NRAND(MI_NPIXELS(mi));
+       }
+       drawimages(mi);
+}
+
+void
+release_image(ModeInfo * mi)
+{
+       if (ims != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_image(MI_DISPLAY(mi), &ims[screen]);
+               (void) free((void *) ims);
+               ims = NULL;
+       }
+}
+
+void
+refresh_image(ModeInfo * mi)
+{
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       imagestruct *ip;
+
+       if (ims == NULL)
+               return;
+       ip = &ims[MI_SCREEN(mi)];
+       if (ip->icons == NULL)
+               return;
+
+       if (ip->graphics_format >= IS_XPM) {
+               /* This is needed when another program changes the colormap. */
+               free_image(MI_DISPLAY(mi), ip);
+               init_image(mi);
+               return;
+       }
+#endif
+       drawimages(mi);
+}
+
+#endif /* MODE_image */
diff --git a/modes/juggle.c b/modes/juggle.c
new file mode 100644 (file)
index 0000000..e3b7d9d
--- /dev/null
@@ -0,0 +1,1544 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* juggle */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)juggle.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Tim Auckland <Tim.Auckland@Procket.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History
+ * 01-Nov-2000: Allocation checks
+ * 1996: Written
+ */
+
+/*-
+ * TODO
+ * Fix timing to run at approx same speed on all machines.
+ * Store shorter pattern and refill when required.
+ * Use -cycles and -count in a rational manner.
+ * Merge pattern selector with pattern generator.
+ * Add clubs
+ * Clap when all the balls are in the air
+ */
+
+
+/*-
+Notes on Adam Chalcraft Juggling Notation (used by permission)
+a-> Adam's notation  s-> Site swap (Cambridge) notation
+
+To define a map from a-notation to s-notation
+("site-swap"), both of which look like doubly infinite sequences of natural
+numbers. In s-notation, there is a restriction on what is allowed, namely
+for the sequence s_n, the associated function f(n)=n+s_n must be a
+bijection. In a-notation, there is no restriction.
+
+To go from a-notation to s-notation, you start by mapping each a_n to a
+permutation of N, the natural numbers.
+
+0 -> the identity
+1 -> (10) [i.e. f(1)=0, f(0)=1]
+2 -> (210) [i.e. f(2)=1, f(1)=0, f(0)=2]
+3 -> (3210) [i.e. f(3)=2, f(2)=1, f(1)=0, f(0)=3]
+etc.
+
+Then for each n, you look at how long 0 takes to get back to 0 again and
+you call this t_n. If a_n=0, for example, then since the identity leaves 0
+alone, it gets back to 0 in 1 step, so t_n=1. If a_n=1, then f(0)=1. Now any
+further a_n=0 leave 1 alone, but the next a_n>0 sends 1 back to 0. Hence t_n
+is 2 + the number of 0's following the 1. Finally, set s_n = t_n - 1.
+
+To give some examples, it helps to have a notation for cyclic sequences. By
+(123), for example, I mean ...123123123123... . Now under the a-notation ->
+s-notation mapping we have some familiar examples:
+
+(0)->(0), (1)->(1), (2)->(2) etc.
+(21)->(31), (31)->(51), (41)->(71) etc.
+(10)->(20), (20)->(40), (30)->(60) etc.
+(331)->(441), (312)->(612), (303)->(504), (321)->(531)
+(43)->(53), (434)->(534), (433)->(633)
+(552)->(672)
+
+In general, the number of balls is the *average* of the s-notation, and the
+*maximum* of the a-notation. Another theorem is that the minimum values in
+the a-notation and the s-notation and equal, and preserved in the same
+positions.
+
+The usefulness of a-notation is the fact that there are no restrictions on
+what is allowed. This makes random juggle generation much easier. It also
+makes enumeration very easy. Another handy feature is computing changes.
+Suppose you can do (5) and want a neat change up to (771) in s-notation
+[Mike Day actually needed this example!]. Write them both in a-notation,
+which gives (5) and (551). Now concatenate them (in general, there may be
+more than one way to do this, but not in this example), to get
+...55555555551551551551551...
+Now convert back to s-notation, to get
+...55555566771771771771771...
+So the answer is to do two 6 throws and then go straight into (771).
+Coming back down of course,
+...5515515515515515555555555...
+converts to
+...7717717717716615555555555...
+so the answer is to do a single 661 and then drop straight down to (5).
+
+[The number of balls in the generated pattern occasionally changes.  In
+ order to decrease the number of balls I had to introduce a new symbol
+ into the Adam notation, [*] which means 'lose the current ball'.]
+*/
+
+#ifdef STANDALONE
+#define PROGCLASS "Juggle"
+#define HACK_INIT init_juggle
+#define HACK_DRAW draw_juggle
+#define juggle_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+"*count: 150 \n" \
+"*cycles: 30 \n" \
+"*ncolors: 32 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_juggle
+
+#define DEF_PATTERN "" /* All patterns */
+#define DEF_TRAIL "0" /* No trace */
+#ifdef UNI
+#define DEF_UNI "FALSE" /* No unicycle */ /* Not implemented yet */
+#endif
+#define DEF_SOLID "FALSE" /* Not solid */
+
+static char *pattern;
+static int trail;
+#ifdef UNI
+static Bool uni;
+#endif
+static Bool solid;
+
+static XrmOptionDescRec opts[] =
+{
+  {(char* ) "-pattern", (char *) ".juggle.pattern",
+   XrmoptionSepArg, (caddr_t) NULL},
+  {(char* ) "-trail", (char *) ".juggle.trail",
+   XrmoptionSepArg, (caddr_t) NULL},
+#ifdef UNI
+  {(char *) "-uni", (char *) ".juggle.uni", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+uni", (char *) ".juggle.uni", XrmoptionNoArg, (caddr_t) "off"},
+#endif
+  {(char *) "-solid", (char *) ".juggle.solid", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+solid", (char *) ".juggle.solid", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+  {(caddr_t *) &pattern, (char *) "pattern",
+   (char *) "Pattern", (char *) DEF_PATTERN, t_String},
+  {(caddr_t *) &trail, (char *) "trail",
+   (char *) "Trail", (char *) DEF_TRAIL, t_Int},
+#ifdef UNI
+  {(caddr_t *) &uni, (char *) "uni",
+   (char *) "Uni", (char *) DEF_UNI, t_Bool},
+#endif
+  {(caddr_t *) &solid, (char *) "solid",
+   (char *) "Solid", (char *) DEF_SOLID, t_Bool}
+};
+static OptionStruct desc[] =
+{
+  {(char *) "-pattern string", (char *) "Cambridge Juggling Pattern"},
+  {(char *) "-trail num", (char *) "Trace Juggling Patterns"},
+#ifdef UNI
+  {(char *) "-/+uni", (char *) "Unicycle"},
+#endif
+  {(char *) "-/+solid", (char *) "solid color (else its a 4 panel look (half white))"}
+};
+
+ModeSpecOpt juggle_opts =
+{sizeof opts / sizeof opts[0], opts,
+ sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   juggle_description = {
+       "juggle", "init_juggle", "draw_juggle", "release_juggle",
+       "draw_juggle", "init_juggle", NULL, &juggle_opts,
+       10000, 150, 30, 1, 64, 1.0, "",
+       "Shows a Juggler, juggling", 0, NULL
+};
+
+#endif
+
+#ifdef USE_XVMSUTILS
+#include <X11/unix_time.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#endif
+
+/* Figure */
+#define ARMLENGTH ((int) (40.0 * sp->scale))
+#define ARMWIDTH ((int) (8.0 * sqrt(sp->scale)))
+#define POSE ((int) (10.0 * sp->scale))
+#define SX ((int) (25.0 * sp->scale))
+#define SZ ((int) (25.0 * sp->scale))
+#define SY ((int) (25.0 * sp->scale))
+#define HIPY ((int) (85.0 * sp->scale))
+#define RHIPX ((int) (-15.0 * sp->scale))
+#define LHIPX ((int) (15.0 * sp->scale))
+#define RFX ((int) (-25.0 * sp->scale))
+#define LFX ((int) (25.0 * sp->scale))
+#define FY ((int) (155.0 * sp->scale))
+#define WSTY ((int) (65.0 * sp->scale))
+#define NEY ((int) (15.0 * sp->scale))
+#define HED ((int) (35.0 * sp->scale))
+#define BALLRADIUS ARMWIDTH
+#define FIGURE1 7
+#define FIGURE2 3
+#define TRACE_LENGTH 50
+#define SPIN_DEGREES 750  /* Average spinning between a throw and the next catch */
+
+/* macros */
+
+#ifndef XtNumber
+#define XtNumber(arr)   ((unsigned int) (sizeof(arr) / sizeof(arr[0])))
+#endif
+
+#define GRAVITY(h, t) 4*(double)(h)/((t)*(t))
+
+#define THROW_CATCH_INTERVAL (sp->count)
+#define THROW_NULL_INTERVAL  (sp->count * 0.5)
+#define CATCH_THROW_INTERVAL (sp->count * 0.2)
+#define COR 0.8  /* coeff of restitution of balls (1 = perfect bounce) */
+
+
+/* typedefs */
+
+typedef enum {HEIGHT, ADAM} Notation;
+typedef enum {Empty, Full, Ball} Throwable;
+typedef enum {LEFT, RIGHT} Hand;
+typedef enum {THROW, CATCH} Action; /* DROP is not an option */
+typedef enum {ATCH, THRATCH, ACTION, LINKEDACTION, PTHRATCH, BPREDICTOR,
+       PREDICTOR} TrajectoryStatus;
+
+typedef struct trajectory *TrajectoryPtr;
+
+typedef struct {double a, b, c, d; } Spline;
+
+typedef struct trajectory {
+  TrajectoryPtr prev, next;  /* for building list */
+  TrajectoryStatus status;
+
+  /* Throw */
+  char posn;
+  int height;
+  int adam;
+
+  /* Action */
+  Hand hand;
+  Action action;
+
+  /* LinkedAction */
+  int color;
+  int spin, divisions;
+  double degree_offset;
+  TrajectoryPtr balllink;
+  TrajectoryPtr handlink;
+
+  /* PThratch */
+
+  double dx; /* initial velocity */
+  double dy;
+
+  /* Predictor */
+  Throwable type;
+  int start, finish;
+  Spline xp, yp;
+  int x, y; /* current position */
+} Trajectory;
+
+/* structs */
+
+typedef struct {
+  int         width;
+  int         height;
+  double      scale;
+  int         complexity;
+  int         cx;
+  int         cy;
+  double      Gr;
+  int         pattern;
+  Trajectory  *head;
+  XPoint   figure_path[FIGURE1];
+  XSegment figure_segs[FIGURE2];
+  XPoint      arm[2][3];
+  XPoint      *trace;
+  int         traceindex;
+  int         count;
+  time_t      begintime; /* seconds */
+  int         time; /* millisecond timer */
+  Bool        solid, uni;      
+} jugglestruct;
+
+static jugglestruct *juggles = NULL;
+
+typedef struct {
+  char * pattern;
+  char * name;
+} patternstruct;
+
+#define MINBALLS 2
+#define MAXBALLS 7
+
+typedef struct {
+  int start;
+  int number;
+} PatternIndex;
+
+static PatternIndex* patternindex = NULL;
+
+/* List of popular patterns, in any order */
+static patternstruct portfolio[] = {
+  {(char *) "[+2 1]", (char *) "+3 1, Typical 2 ball juggler"},
+  {(char *) "[2 0]", (char *) "4 0, 2 balls 1 hand"},
+  {(char *) "[2 0 1]", (char *) "5 0 1"},
+  {(char *) "[+2 0 +2 0 0]", (char *) "+5 0 +5 0 0"},
+  {(char *) "[3]", (char *) "3, cascade"},
+  {(char *) "[+3]", (char *) "+3, reverse cascade"},
+  {(char *) "[=3]", (char *) "=3, cascade under arm"},
+  {(char *) "[&3]", (char *) "&3, cascade catching under arm"},
+  {(char *) "[_3]", (char *) "_3, bouncing cascade"},
+  {(char *) "[+3 x3 =3]", (char *) "+3 x3 =3, Mill's mess"},
+  {(char *) "[3 2 1]", (char *) "5 3 1"},
+  {(char *) "[3 3 1]", (char *) "4 4 1"},
+  {(char *) "[3 1 2]", (char *) "6 1 2, See-saw"},
+  {(char *) "[=3 3 1 2]", (char *) "=4 5 1 2"},
+  {(char *) "[=3 2 2 3 1 2]", (char *) "=6 2 2 5 1 2, =4 5 1 2 stretched"},
+  {(char *) "[+3 3 1 3]", (char *) "+4 4 1 3, anemic shower box"},
+  {(char *) "[3 3 1]", (char *) "4 4 1"},
+  {(char *) "[+3 2 3]", (char *) "+4 2 3"},
+  {(char *) "[+3 1]", (char *) "+5 1, 3 shower"},
+  {(char *) "[_3 1]", (char *) "_5 1, bouncing 3 shower"},
+  {(char *) "[3 0 3 0 3]", (char *) "5 0 5 0 5, shake 3 out of 5"},
+  {(char *) "[3 3 3 0 0]", (char *) "5 5 5 0 0, flash 3 out of 5"},
+  {(char *) "[3 3 0]", (char *) "4 5 0, complete waste of a 5 ball juggler"},
+  {(char *) "[3 3 3 0 0 0 0]", (char *) "7 7 7 0 0 0 0, 3 flash"},
+  {(char *) "[+3 0 +3 0 +3 0 0]", (char *) "+7 0 +7 0 +7 0 0"},
+  {(char *) "[4]", (char *) "4, 4 cascade"},
+  {(char *) "[+4 3]", (char *) "+5 3, 4 ball half shower"},
+  {(char *) "[4 4 2]", (char *) "5 5 2"},
+  {(char *) "[+4 4 4 +4]", (char *) "+4 4 4 +4, 4 columns"},
+  {(char *) "[4 3 +4]", (char *) "5 3 +4"},
+  {(char *) "[+4 1]", (char *) "+7 1, 4 shower"},
+  {(char *) "[4 4 4 4 0]", (char *) "5 5 5 5 0, learning 5"},
+  {(char *) "[5]", (char *) "5, 5 cascade"},
+  {(char *) "[_5 _5 _5 _5 _5 5 5 5 5 5]", (char *) "_5 _5 _5 _5 _5 5 5 5 5 5, jump rope"},
+  {(char *) "[+5 x5 =5]", (char *) "+5 x5 =5, Mill's mess for 5"},
+  {(char *) "[6]", (char *) "6, 6 cascade"},
+  {(char *) "[7]", (char *) "7, 7 cascade"},
+  {(char *) "[_7]", (char *) "_7, bouncing 7 cascade"},
+};
+
+/* Private Functions */
+
+/* list management */
+
+/* t receives trajectory to be created.  ot must point to an existing
+   trajectory or be identical to t to start a new list. */
+#define INSERT_AFTER_TOP(t, ot)                                        \
+  if ((t = (Trajectory *)calloc(1, sizeof(Trajectory))) == NULL) \
+    {free_juggle(sp); return;}                                 \
+  (t)->next = (ot)->next;                                      \
+  (t)->prev = (ot);                                            \
+  (ot)->next = (t);                                            \
+  (t)->next->prev = (t)
+#define INSERT_AFTER(t, ot)                                    \
+  if ((t = (Trajectory *)calloc(1, sizeof(Trajectory))) == NULL) \
+    {free_juggle(sp); return False;}                           \
+  (t)->next = (ot)->next;                                      \
+  (t)->prev = (ot);                                            \
+  (ot)->next = (t);                                            \
+  (t)->next->prev = (t)
+
+
+/* t must point to an existing trajectory.  t must not be an
+   expression ending ->next or ->prev */
+#define REMOVE(t)                                              \
+  (t)->next->prev = (t)->prev;                                 \
+  (t)->prev->next = (t)->next;                                 \
+  (void) free((void *) t)
+
+static void
+free_pattern(jugglestruct *sp) {
+       if (sp->head != NULL) {
+               while (sp->head->next != sp->head) {
+                       Trajectory *t = sp->head->next;
+
+                       REMOVE(t); /* don't eliminate t */
+               }
+               (void) free((void *) sp->head);
+               sp->head = NULL;
+       }
+}
+
+static void
+free_juggle(jugglestruct *sp)
+{
+       if (sp->trace != NULL) {
+               (void) free((void *) sp->trace);
+               sp->trace = NULL;
+       }
+       free_pattern(sp);
+}
+
+static Bool
+add_throw(jugglestruct *sp, char type, int h, Notation n)
+{
+  Trajectory *t;
+
+  INSERT_AFTER(t, sp->head->prev);
+  t->posn = type;
+  if (n == ADAM) {
+       t->adam = h;
+       t->status = ATCH;
+  } else {
+       t->height = h;
+       t->status = THRATCH;
+  }
+  return True;
+}
+
+/* add a Thratch to the performance */
+static Bool
+program(ModeInfo *mi, const char *patn, int repeat)
+{
+  jugglestruct *sp = &juggles[MI_SCREEN(mi)];
+  const char *p;
+  int h, i, seen;
+  Notation notation;
+  char type;
+
+  if (MI_IS_VERBOSE(mi)) {
+       (void) fprintf(stderr, "%s x %d\n", patn, repeat);
+  }
+
+  for(i=0; i < repeat; i++) {
+       type=' ';
+       h = 0;
+       seen = 0;
+       notation = HEIGHT;
+       for(p=patn; *p; p++) {
+               if (*p >= '0' && *p <='9') {
+               seen = 1;
+               h = 10*h + (*p - '0');
+         } else {
+               Notation nn = notation;
+               switch (*p) {
+               case '[':            /* begin Adam notation */
+                 notation = ADAM;
+                 break;
+               case '-':            /* Inside throw */
+               case '+':            /* Outside throw */
+               case '=':            /* Cross throw */
+               case '&':            /* Cross catch */
+               case 'x':            /* Cross throw and catch */
+               case '_':            /* Bounce */
+                 type = *p;
+                 break;
+               case '*':            /* Lose ball */
+                 seen = 1;
+                 h = -1;
+                 /* fall through */
+               case ']':             /* end Adam notation */
+                 nn = HEIGHT;
+                 /* fall through */
+               case ' ':
+                 if (seen) {
+                       if (!add_throw(sp, type, h, notation))
+                               return False;
+                       type=' ';
+                       h = 0;
+                       seen = 0;
+                 }
+                 notation = nn;
+                 break;
+               default:
+                 (void) fprintf(stderr, "Unexpected pattern instruction: '%s'\n", p);
+                 break;
+               }
+         }
+       }
+       if (seen) {
+         if (!add_throw(sp, type, h, notation))
+               return False;
+       }
+  }
+       return True;
+}
+
+/*
+ ~~~~\~~~~~\~~~
+ \\~\\~\~\\\~~~
+ \\~\\\\~\\\~\~
+ \\\\\\\\\\\~\\
+
+[33134231334021]
+
+4 4 1 3 12 2 4 1 4 4 13 0 3 1
+
+*/
+#define BOUNCEOVER 10
+
+static void
+adam(jugglestruct *sp)
+{
+  Trajectory *t, *p;
+  for(t = sp->head->next; t != sp->head; t = t->next) {
+       if (t->status == ATCH) {
+         int a = t->adam;
+         t->height = 0;
+         for(p = t->next; a > 0 && p != sp->head; p = p->next) {
+               if (p->status != ATCH || p->adam < 0 || p->adam>= a) {
+                 a--;
+               }
+               t->height++;
+         }
+         if(t->height > BOUNCEOVER && t->posn == ' '){
+               t->posn = '_'; /* high defaults can be bounced */
+         }
+         t->status = THRATCH;
+#if 0
+         (void) fprintf(stderr, "%d\t%d\n", t->adam, t->height);
+#endif
+       }
+  }
+}
+
+/* Split Thratch notation into explicit throws and catches.
+   Usually Catch follows Throw in same hand, but take care of special
+   cases. */
+
+/* ..n1.. -> .. LTn RT1 LC RC .. */
+/* ..nm.. -> .. LTn LC RTm RC .. */
+
+static Bool
+part(jugglestruct *sp)
+{
+  Trajectory *t, *nt, *p;
+  Hand hand = (LRAND() & 1) ? RIGHT : LEFT;
+
+  for (t = sp->head->next; t != sp->head; t = t->next) {
+       if (t->status > THRATCH) {
+         hand = t->hand;
+       } else if (t->status == THRATCH) {
+         char posn = '=';
+
+         /* plausibility check */
+         if (t->height <= 2 && t->posn == '_') {
+               t->posn = ' '; /* no short bounces */
+         }
+         if (t->height <= 1 && (t->posn == '=' || t->posn == '&')) {
+               t->posn = ' '; /* 1's need close catches */
+         }
+
+         switch (t->posn) {
+                 /*         throw          catch    */
+         case ' ': /* fall through */
+         case '-': posn = '-'; t->posn = '+'; break;
+         case '+': posn = '+'; t->posn = '-'; break;
+         case '=': posn = '='; t->posn = '+'; break;
+         case '&': posn = '+'; t->posn = '='; break;
+         case 'x': posn = '='; t->posn = '='; break;
+         case '_': posn = '_'; t->posn = '-'; break;
+         default: (void) fprintf(stderr, "unexpected posn %c\n", t->posn); break;
+         }
+         hand = (Hand) ((hand + 1) % 2);
+         t->status = ACTION;
+         t->hand = hand;
+         p = t->prev;
+
+         if (t->height == 1) {
+               p = p->prev; /* early throw */
+         }
+         t->action = CATCH;
+         INSERT_AFTER(nt, p);
+         nt->status = ACTION;
+         nt->action = THROW;
+         nt->height = t->height;
+         nt->hand = hand;
+         nt->posn = posn;
+       }
+  }
+  return True;
+}
+
+/* Connnect up throws and catches to figure out which ball goes where.
+   Do the same with the juggler's hands. */
+
+static void
+lob(ModeInfo *mi)
+{
+  jugglestruct *sp = &juggles[MI_SCREEN(mi)];
+  Trajectory *t, *p;
+  int h;
+  for (t = sp->head->next; t != sp->head; t = t->next) {
+       if (t->status == ACTION) {
+#if 0
+         (void) fprintf(stderr, (t->action == CATCH) ? "A %c%c%c\n" : "A %c%c%c%d\n",
+                         t->posn,
+                         t->hand ? 'R' : 'L',
+                         (t->action == THROW) ? 'T' : (t->action == CATCH ? 'C' : 'N'),
+                         t->height);
+#endif
+         if (t->action == THROW) {
+               if (t->type == Empty) {
+                 if (MI_NPIXELS(mi) > 2) {
+                       t->color = 1 + NRAND(MI_NPIXELS(mi) - 2);
+                 }
+                 t->spin = NRAND(5) - 2;
+                 t->degree_offset = NRAND(360);
+                 t->divisions = 2 * ((LRAND() & 1) + 1);
+               }
+
+               /* search forward for next hand catch */
+               for (p = t->next; t->handlink == NULL && p != sp->head; p = p->next) {
+                 if (p->action == CATCH) {
+                       if (t->handlink == NULL && p->hand == t->hand) {
+                         t->handlink = p; /* next catch in this hand */
+                       }
+                 }
+               }
+
+               if (t->height > 0) {
+                 h = t->height - 1;
+
+                 /* search forward for next ball catch */
+                 for (p = t->next; t->balllink == NULL&& p != sp->head; p = p->next) {
+                       if (p->action == CATCH) {
+                         if (t->balllink == NULL && --h < 1) { /* caught */
+#if 0
+                               if (p->type == Full) {
+                                 /* dropped */
+                               }
+#endif
+                               t->balllink = p; /* complete trajectory */
+                               p->type = Full;
+                               p->color = t->color; /* accept catch */
+                               p->spin = t->spin;
+                               p->degree_offset = t->degree_offset;
+                               p->divisions = t->divisions;
+                         }
+                       }
+                 }
+               }
+               t->type = Empty; /* thrown */
+         } else if (t->action == CATCH) {
+               /* search forward for next throw from this hand */
+               for (p = t->next; t->handlink == NULL && p != sp->head; p = p->next) {
+                 if (p->action == THROW && p->hand == t->hand) {
+                       p->type = t->type; /* pass ball */
+                       p->color = t->color; /* pass color */
+                       p->spin = NRAND(5) - 2;
+                       p->degree_offset = NRAND(360);
+                       p->divisions = 2 * ((LRAND() & 1) + 1);
+                       t->handlink = p;
+                 }
+               }
+         }
+         t->status = LINKEDACTION;
+       }
+  }
+}
+
+/* Convert hand position symbols into actual time/space coordinates */
+static void
+positions(jugglestruct *sp)
+{
+  Trajectory *t;
+  int now = 0;
+  for (t = sp->head->next; t != sp->head; t = t->next) {
+       if (t->status == PTHRATCH) {
+         now = t->start;
+       } else if (t->status == LINKEDACTION) {
+         int xo = 0, yo;
+
+         /* time */
+         if (t->action == CATCH) {
+               if (t->type == Empty) {
+                 now += (int) THROW_NULL_INTERVAL; /* failed catch is short */
+               } else {
+                 now += THROW_CATCH_INTERVAL;     /* successful catch */
+               }
+         } else {
+               now += (int) CATCH_THROW_INTERVAL;  /* throws are very short */
+         }
+         t->start = now;
+
+         /* space */
+         yo = ARMLENGTH;
+         switch (t->posn) {
+         case '-': xo = SX - POSE; break;
+         case '_':
+         case '+': xo = SX + POSE; break;
+         case '=': xo = - SX - POSE; yo += 2 * POSE; break;
+         default: (void) fprintf(stderr, "unexpected posn %c\n", t->posn); break;
+         }
+         t->x = sp->cx + ((t->hand == LEFT) ? xo : -xo);
+         t->y = sp->cy + yo;
+
+         t->status = PTHRATCH;
+       }
+  }
+}
+
+
+/* Private physics functions */
+
+static Spline
+makeSpline(int x0, double dx0, int t0, int x1, double dx1, int t1)
+{
+  Spline s;
+  double a, b, c, d;
+  int x10;
+  double t10;
+
+  x10 = x1 - x0;
+  t10 = t1 - t0;
+  a = ((dx0 + dx1)*t10 - 2*x10) / (t10*t10*t10);
+  b = (3*x10 - (2*dx0 + dx1)*t10) / (t10*t10);
+  c = dx0;
+  d = x0;
+  s.a = a;
+  s.b = -3*a*t0 + b;
+  s.c = (3*a*t0 - 2*b)*t0 + c;
+  s.d = ((-a*t0 + b)*t0 - c)*t0 +d;
+  return s;
+}
+
+static double
+makeSplinePair(Spline *s1, Spline *s2,
+                          int x0, double dx0, int t0,
+                          int x1, int t1,
+                          int x2, double dx2, int t2)
+{
+  int x10, x21;
+  double t21, t10, t20, dx1;
+  x10 = x1 - x0;
+  x21 = x2 - x1;
+  t21 = t2 - t1;
+  t10 = t1 - t0;
+  t20 = t2 - t0;
+  dx1 = (3*x10*t21*t21 + 3*x21*t10*t10 + 3*dx0*t10*t21*t21
+                - dx2*t10*t10*t21 - 4*dx0*t10*t21*t21) /
+       (2*t10*t21*t20);
+  *s1 = makeSpline(x0, dx0, t0, x1, dx1, t1);
+  *s2 = makeSpline(x1, dx1, t1, x2, dx2, t2);
+  return dx1;
+}
+
+/* Turn abstract timings into physically appropriate ball trajectories. */
+static Bool
+projectile(jugglestruct *sp)
+{
+  Trajectory *t, *n;
+  for (t = sp->head->next; t != sp->head; t = t->next) {
+       if (t->status != PTHRATCH) {
+         continue;
+       }
+       if (t->action == THROW) {
+         if (t->balllink != NULL) {
+               if (t->posn == '_') { /* Bounce once */
+                 double tc, y0, yf, yc, tb, e, i;
+
+                 tc = t->balllink->start - t->start;
+
+                 yf = sp->cy + FY;
+                 y0 = t->y;
+                 yc = t->balllink->y;
+                 e = 1; /* permissible error in yc */
+
+                 /*
+                        tb = time to bounce
+                        yt = height at catch time after one bounce
+                        one or three roots according to timing
+                        find one by interval bisection
+                 */
+                 tb = tc;
+                 for(i = tc / 2; i > 0; i/=2){
+                       double dy, dt, yt;
+                       if(tb == 0){
+                         (void) fprintf(stderr, "div by zero!\n");
+                         break;
+                       }
+                       dy = (yf - y0)/tb + 0.5*sp->Gr*tb;
+                       dt = tc - tb;
+                       yt = -COR*dy*dt + 0.5*sp->Gr*dt*dt + yf;
+                       if(yt > yc + e){
+                         tb-=i;
+                       }else if(yt < yc - e){
+                         tb+=i;
+                       }else{
+                         break;
+                       }
+                 }
+
+                 {
+                       double t0, dy;
+
+                       t->dx = (t->balllink->x - t->x) / tc;
+
+                       /* ball follows parabola down */
+                       INSERT_AFTER(n, t->prev);
+                       n->start = t->start;
+                       n->finish = (int) (t->start + tb);
+                       n->type = Ball;
+                       n->color = t->color;
+                       n->spin = t->spin;
+                       n->degree_offset = t->degree_offset;
+                       n->divisions = t->divisions;
+                       n->status = PREDICTOR;
+
+                       t->dy = (yf - y0)/tb - 0.5*sp->Gr*tb;
+                       t0 = n->start;
+                       /* Represent parabola as a degenerate spline -
+                          linear in x, quadratic in y */
+                       n->xp.a = 0;
+                       n->xp.b = 0;
+                       n->xp.c = t->dx;
+                       n->xp.d = -t->dx*t0 + t->x;
+                       n->yp.a = 0;
+                       n->yp.b = sp->Gr/2;
+                       n->yp.c = -sp->Gr*t0 + t->dy;
+                       n->yp.d = sp->Gr/2*t0*t0 - t->dy*t0 + t->y;
+
+
+                       /* ball follows parabola up */
+                       INSERT_AFTER(n, t->prev);
+                       n->start = (int) (t0 + tb);
+                       n->finish = (int) (t0 + tc);
+                       n->type = Ball;
+                       n->color = t->color;
+                       n->spin = t->spin;
+                       n->degree_offset = t->degree_offset;
+                       n->divisions = t->divisions;
+                       n->status = PREDICTOR;
+
+                       n->xp.a = 0;
+                       n->xp.b = 0;
+                       n->xp.c = t->dx;
+                       n->xp.d = -t->dx*t0 + t->x;
+
+                       dy = (yf - y0)/tb + 0.5*sp->Gr*tb;
+                       t0 = n->start;
+                       /* Represent parabola as a degenerate spline -
+                          linear in x, quadratic in y */
+                       n->yp.a = 0;
+                       n->yp.b = sp->Gr/2;
+                       n->yp.c = -sp->Gr*t0 - COR*dy;
+                       n->yp.d = sp->Gr/2*t0*t0 + COR*dy*t0 + yf;
+                 }
+
+                 t->status = BPREDICTOR;
+
+               } else {
+                 double t0, dt;
+
+                 /* ball follows parabola */
+                 INSERT_AFTER(n, t->prev);
+                 n->start = t->start;
+                 n->finish = t->balllink->start;
+                 n->type = Ball;
+                 n->color = t->color;
+                 n->spin = t->spin;
+                 n->degree_offset = t->degree_offset;
+                 n->divisions = t->divisions;
+                 n->status = PREDICTOR;
+
+                 t0 = n->start;
+                 dt = t->balllink->start - t->start;
+                 t->dx = (t->balllink->x - t->x) / dt;
+                 t->dy = (t->balllink->y - t->y) / dt - sp->Gr/2 * dt;
+
+                 /* Represent parabola as a degenerate spline -
+                        linear in x, quadratic in y */
+                 n->xp.a = 0;
+                 n->xp.b = 0;
+                 n->xp.c = t->dx;
+                 n->xp.d = -t->dx*t0 + t->x;
+                 n->yp.a = 0;
+                 n->yp.b = sp->Gr/2;
+                 n->yp.c = -sp->Gr*t0 + t->dy;
+                 n->yp.d = sp->Gr/2*t0*t0 - t->dy*t0 + t->y;
+
+
+                 t->status = BPREDICTOR;
+               }
+         } else { /* Zero Throw */
+               t->status = BPREDICTOR;
+         }
+       }
+  }
+  return True;
+}
+
+/* Turn abstract hand motions into cubic splines. */
+static void
+hands(jugglestruct *sp)
+{
+  Trajectory *t, *u, *v;
+  for (t = sp->head->next; t != sp->head; t = t->next) {
+       /* no throw => no velocity */
+       if (t->status != BPREDICTOR) {
+         continue;
+       }
+
+       u = t->handlink;
+       if (u == NULL) { /* no next catch */
+         continue;
+       }
+       v = u->handlink;
+       if (v == NULL) { /* no next throw */
+         continue;
+       }
+
+       /* double spline takes hand from throw, thru catch, to
+          next throw */
+
+       t->finish = u->start;
+       t->status = PREDICTOR;
+
+       u->finish = v->start;
+       u->status = PREDICTOR;
+
+       (void) makeSplinePair(&t->xp, &u->xp,
+                                                 t->x, t->dx, t->start,
+                                                 u->x, u->start,
+                                                 v->x, v->dx, v->start);
+       (void) makeSplinePair(&t->yp, &u->yp,
+                                                 t->y, t->dy, t->start,
+                                                 u->y, u->start,
+                                                 v->y, v->dy, v->start);
+
+       t->status = PREDICTOR;
+  }
+}
+
+/* Given target x, y find_elbow puts hand at target if possible,
+ * otherwise makes hand point to the target */
+static void
+find_elbow(jugglestruct *sp, XPoint *h, XPoint *e, int x, int y, int z)
+{
+  double r, h2, t;
+
+  h2 = x*x + y*y + z*z;
+  if (h2 > 4*ARMLENGTH*ARMLENGTH) {
+       t = ARMLENGTH/sqrt(h2);
+       e->x = (short) (t*x);
+       e->y = (short) (t*y);
+       h->x = 2 * e->x;
+       h->y = 2 * e->y;
+  } else {
+       r = sqrt((double)(x*x + z*z));
+       t = sqrt(4 * ARMLENGTH * ARMLENGTH / h2 - 1);
+       e->x = (short) (x*(1 - y*t/r)/2);
+       e->y = (short) ((y + r*t)/2);
+       h->x = x;
+       h->y = y;
+  }
+}
+
+/* NOTE: returned x, y adjusted for arm reach */
+static void
+draw_arm(ModeInfo * mi, Hand side, int *x, int *y)
+{
+  Display *dpy = MI_DISPLAY(mi);
+  Window win = MI_WINDOW(mi);
+  GC gc = MI_GC(mi);
+  jugglestruct *sp = &juggles[MI_SCREEN(mi)];
+
+  int sig = (side == LEFT) ? 1 : -1;
+
+  XSetLineAttributes(dpy, gc,
+               ARMWIDTH, LineSolid, CapRound, JoinRound);
+  if (sp->arm[side][0].x != *x || sp->arm[side][0].y != *y) {
+       XPoint h, e;
+       XSetForeground(dpy, gc, MI_BLACK_PIXEL(mi));
+       find_elbow(sp, &h, &e, *x - sig*SX - sp->cx, *y - SY - sp->cy, SZ);
+       XDrawLines(dpy, win, gc, sp->arm[side], 3, CoordModeOrigin);
+       *x = sp->arm[side][0].x = sp->cx + sig*SX + h.x;
+       *y = sp->arm[side][0].y = sp->cy + SY + h.y;
+       sp->arm[side][1].x = sp->cx + sig*SX + e.x;
+       sp->arm[side][1].y = sp->cy + SY + e.y;
+  }
+  XSetForeground(dpy, gc, MI_WHITE_PIXEL(mi));
+  XDrawLines(dpy, win, gc, sp->arm[side], 3, CoordModeOrigin);
+  XSetLineAttributes(dpy, gc,
+               1, LineSolid, CapNotLast, JoinRound);
+}
+
+static void
+draw_figure(ModeInfo * mi)
+{
+  Display *dpy = MI_DISPLAY(mi);
+  Window win = MI_WINDOW(mi);
+  GC gc = MI_GC(mi);
+  jugglestruct *sp = &juggles[MI_SCREEN(mi)];
+
+  XSetLineAttributes(dpy, gc,
+               ARMWIDTH, LineSolid, CapRound, JoinRound);
+  XSetForeground(dpy, gc, MI_WHITE_PIXEL(mi));
+  XDrawLines(dpy, win, gc, sp->figure_path, FIGURE1, CoordModeOrigin);
+  XDrawSegments(dpy, win, gc, sp->figure_segs, FIGURE2);
+  XDrawArc(dpy, win, gc,
+        sp->cx - HED/2, sp->cy + NEY - HED, HED, HED, 0, 64*360);
+  XSetLineAttributes(dpy, gc,
+               1, LineSolid, CapNotLast, JoinRound);
+}
+
+
+/* dumps a human-readable rendition of the current state of the juggle
+   pipeline to stderr for debugging */
+#ifdef OLDDEBUG
+static void
+dump(jugglestruct *sp)
+{
+  Trajectory *t;
+
+  for (t = sp->head->next; t != sp->head; t = t->next) {
+       switch (t->status) {
+       case THROW:
+         (void) fprintf(stderr, "T %c%d\n", t->posn, t->height);
+         break;
+       case ACTION:
+         (void) fprintf(stderr, t->action == CATCH?"A %c%c%c\n":"A %c%c%c%d\n",
+                         t->posn,
+                         t->hand ? 'R' : 'L',
+                         (t->action == THROW)?'T':(t->action == CATCH?'C':'N'),
+                         t->height);
+         break;
+       case LINKEDACTION:
+         (void) fprintf(stderr, "L %c%c%c%d %d\n",
+                         t->posn,
+                         t->hand?'R':'L',
+                         (t->action == THROW)?'T':(t->action == CATCH?'C':'N'),
+                         t->height, t->color);
+         break;
+       case PTHRATCH:
+         (void) fprintf(stderr, "O %c%c%c%d %d %2d %6d %6d\n", t->posn,
+                         t->hand?'R':'L',
+                         (t->action == THROW)?'T':(t->action == CATCH?'C':'N'),
+                         t->height, t->type, t->color,
+                         t->start, t->finish);
+         break;
+       case PREDICTOR:
+         (void) fprintf(stderr, "P %c      %2d %6d %6d %g\n",
+                         t->type == Ball?'b':t->type == Empty?'e':'f',
+                         t->color,
+                         t->start, t->finish, t->yp.c);
+         break;
+       default:
+         (void) fprintf(stderr, "status %d not implemented\n", t->status);
+         break;
+       }
+  }
+}
+#endif
+
+static int get_num_balls(const char *j)
+{
+  int balls = 0;
+  const char *p;
+  int h = 0;
+  for (p = j; *p; p++) {
+       if (*p >= '0' && *p <='9') { /* digit */
+         h = 10*h + (*p - '0');
+       } else {
+         if (h > balls) {
+               balls = h;
+         }
+         h = 0;
+       }
+  }
+  return balls;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static int compare_num_balls(const void *p1, const void *p2)
+{
+  int i = get_num_balls(((patternstruct*)p1)->pattern);
+  int j = get_num_balls(((patternstruct*)p2)->pattern);
+  if (i > j) {
+       return (1);
+  } else if (i < j) {
+       return (-1);
+  } else {
+       return (0);
+  }
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Public functions */
+
+void
+release_juggle(ModeInfo * mi)
+{
+       if (juggles != NULL) {
+               int screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_juggle(&juggles[screen]);
+               (void) free((void *) juggles);
+               juggles = NULL;
+       }
+       if (patternindex != NULL) {
+               (void) free((void *) patternindex);
+               patternindex = NULL;
+       }
+}
+
+void
+init_juggle(ModeInfo * mi)
+{
+       jugglestruct *sp;
+       int i;
+       XPoint figure1[FIGURE1];
+       XSegment figure2[FIGURE2];
+
+       if (pattern == NULL && patternindex == NULL) {
+         /* pattern list needs indexing */
+         int i;
+         int nelements = sizeof(portfolio)/sizeof(patternstruct);
+         int maxballs;
+         int numpat = 0;
+
+         /* sort according to number of balls */
+         qsort((void*)portfolio, nelements,
+                       sizeof(patternstruct), compare_num_balls);
+
+         /* last pattern has most balls */
+         maxballs = get_num_balls(portfolio[nelements - 1].pattern);
+         /* allocate index */
+         if ((patternindex = (PatternIndex *) calloc(maxballs + 1,
+                               sizeof (PatternIndex))) == NULL) {
+               return;
+         }
+
+         /* run through sorted list, indexing start of each group
+                and number in group */
+         maxballs = 1;
+         for (i = 0; i < nelements; i++) {
+               int b = get_num_balls(portfolio[i].pattern);
+               if (b > maxballs) {
+                 if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "%d %d ball pattern%s\n",
+                                       numpat, maxballs, (numpat == 1) ? "" : "s");
+                 }
+                 patternindex[maxballs].number = numpat;
+                 maxballs = b;
+                 numpat = 1;
+                 patternindex[maxballs].start = i;
+               } else {
+                 numpat++;
+               }
+         }
+         if (MI_IS_VERBOSE(mi)) {
+               (void) fprintf(stderr, "%d %d ball pattern%s\n",
+                               numpat, maxballs, (numpat == 1) ? "" : "s");
+         }
+         patternindex[maxballs].number = numpat;
+       }
+
+       if (juggles == NULL) { /* allocate jugglestruct */
+               if ((juggles = (jugglestruct *) calloc(MI_NUM_SCREENS(mi),
+                              sizeof (jugglestruct))) == NULL) {
+                       release_juggle(mi);
+                       return;
+               }
+       }
+       sp = &juggles[MI_SCREEN(mi)];
+
+       sp->count = 0;
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               sp->solid = (Bool) (LRAND() & 1);
+#ifdef UNI
+               sp->uni = (Bool) (LRAND() & 1);
+#endif
+       } else {
+               sp->solid = solid;
+#ifdef UNI
+               sp->uni = uni;
+#endif
+       }
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+       sp->count = ABS(MI_COUNT(mi));
+       if (sp->count == 0)
+               sp->count = 150;
+       sp->scale = sp->height / 480.0;
+       /* vary x a little so the juggler does not burn the screen */
+       sp->cx = sp->width / 2 + RFX + NRAND(LFX - RFX + 1);
+       sp->cy = sp->height - FY - ((int) sp->uni) * FY / 3; /* raise higher */
+       /* "7" hits top of screen */
+       sp->Gr = GRAVITY(sp->cy, 7 * THROW_CATCH_INTERVAL);
+
+       figure1[0].x = LHIPX, figure1[0].y = HIPY;
+       figure1[1].x = 0, figure1[1].y = WSTY;
+       figure1[2].x = SX, figure1[2].y = SY;
+       figure1[3].x = -SX, figure1[3].y = SY;
+       figure1[4].x = 0, figure1[4].y = WSTY;
+       figure1[5].x = RHIPX, figure1[5].y = HIPY;
+       figure1[6].x = LHIPX, figure1[6].y = HIPY;
+       figure2[0].x1 = 0, figure2[0].y1 = SY,
+         figure2[0].x2 = 0, figure2[0].y2 = NEY;
+       figure2[1].x1 = LHIPX, figure2[1].y1 = HIPY,
+         figure2[1].x2 = LFX, figure2[1].y2 = FY;
+       figure2[2].x1 = RHIPX, figure2[2].y1 = HIPY,
+         figure2[2].x2 = RFX, figure2[2].y2 = FY;
+
+       /* Body Path */
+       for (i = 0; i <  FIGURE1; i++) {
+         sp->figure_path[i].x = figure1[i].x + sp->cx;
+         sp->figure_path[i].y = figure1[i].y + sp->cy;
+       }
+       /* Body Segments */
+       for (i = 0; i < FIGURE2; i++) {
+         sp->figure_segs[i].x1 = figure2[i].x1 + sp->cx;
+         sp->figure_segs[i].y1 = figure2[i].y1 + sp->cy;
+         sp->figure_segs[i].x2 = figure2[i].x2 + sp->cx;
+         sp->figure_segs[i].y2 = figure2[i].y2 + sp->cy;
+       }
+       /* Shoulders */
+       sp->arm[LEFT][2].x = sp->cx + SX;
+       sp->arm[LEFT][2].y = sp->cy + SY;
+       sp->arm[RIGHT][2].x = sp->cx - SX;
+       sp->arm[RIGHT][2].y = sp->cy + SY;
+
+       if (sp->trace == NULL) {
+         if ((sp->trace = (XPoint *)calloc(trail, sizeof(XPoint))) == NULL) {
+               free_juggle(sp);
+               return;
+         }
+       }
+
+       /* Clear the background. */
+       MI_CLEARWINDOW(mi);
+
+       draw_figure(mi);
+
+       /* record start time */
+       sp->begintime = time(NULL);
+
+       free_pattern(sp);
+
+       /* create circular list */
+       INSERT_AFTER_TOP(sp->head, sp->head);
+
+       /* generate pattern */
+       if (pattern == NULL) {
+
+#define MAXPAT 10
+#define MAXREPEAT 30
+#define CHANGE_BIAS 8 /* larger makes num_ball changes less likely */
+#define POSITION_BIAS 20 /* larger makes hand movements less likely */
+
+         int count = 0;
+         int num_balls = MINBALLS + NRAND(MAXBALLS - MINBALLS);
+         while (count < MI_CYCLES(mi)) {
+               char buf[MAXPAT * 3 + 3], *b = buf;
+               int maxseen = 0;
+               int l = NRAND(MAXPAT) + 1;
+               int t = NRAND(MAXREPEAT) + 1;
+
+               { /* vary number of balls */
+                 int new_balls = num_balls;
+                 int change;
+
+                 if (new_balls == 2) /* Do not juggle 2 that often */
+                   change = NRAND(2 + CHANGE_BIAS / 4);
+                 else
+                   change = NRAND(2 + CHANGE_BIAS);
+                 switch (change) {
+                 case 0:
+                       new_balls++;
+                       break;
+                 case 1:
+                       new_balls--;
+                       break;
+                 default:
+                       break; /* NO-OP */
+                 }
+                 if (new_balls < MINBALLS) {
+                       new_balls += 2;
+                 }
+                 if (new_balls > MAXBALLS) {
+                       new_balls -= 2;
+                 }
+                 if (new_balls < num_balls) {
+                       if (!program(mi, "[*]", 1)) /* lose ball */
+                               return;
+                 }
+                 num_balls = new_balls;
+               }
+               count++;
+
+               if (NRAND(2) && patternindex[num_balls].number) {
+                 /* Pick from PortFolio */
+                 if (!program(mi,
+                         portfolio[patternindex[num_balls].start +
+                                 NRAND(patternindex[num_balls].number)].pattern,
+                                 t))
+                       return;
+               } else {
+                 /* Invent a new pattern */
+                 *b++='[';
+                 for(i = 0; i < l; i++){
+                       int n, m;
+                       do { /* Triangular Distribution => high values more likely */
+                         m = NRAND(num_balls + 1);
+                         n = NRAND(num_balls + 1);
+                       } while(m >= n);
+                       if (n == num_balls) {
+                         maxseen = 1;
+                       }
+                       switch(NRAND(6 + POSITION_BIAS)){
+                       case 0:            /* Inside throw */
+                         *b++ = '-'; break;
+                       case 1:            /* Outside throw */
+                         *b++ = '+'; break;
+                       case 2:            /* Cross throw */
+                         *b++ = '='; break;
+                       case 3:            /* Cross catch */
+                         *b++ = '&'; break;
+                       case 4:            /* Cross throw and catch */
+                         *b++ = 'x'; break;
+                       case 5:            /* Bounce */
+                         *b++ = '_'; break;
+                       default:
+                         break; /* NO-OP */
+                       }
+
+                       *b++ = n + '0';
+                       *b++ = ' ';
+                 }
+                 *b++ = ']';
+                 *b = '\0';
+                 if (maxseen) {
+                       if (!program(mi, buf, t))
+                               return;
+                 }
+               }
+         }
+       } else { /* pattern supplied in height or 'a' notation */
+         if (!program(mi, pattern, MI_CYCLES(mi)))
+               return;
+       }
+
+       adam(sp);
+
+       if (!part(sp))
+               return;
+
+       lob(mi);
+
+       positions(sp);
+
+       if (!projectile(sp))
+               return;
+
+       hands(sp);
+
+#ifdef OLDDEBUG
+       dump(sp);
+#endif
+}
+
+#define CUBIC(s, t) ((((s).a * (t) + (s).b) * (t) + (s).c) * (t) + (s).d)
+
+#ifdef SUNOS4
+/*-
+ * Workaround SunOS 4 framebuffer bug which causes balls to leave dust
+ * trace behind when erased
+ */
+#define ERASE_BALL(x,y) \
+       XSetForeground(dpy, gc, MI_BLACK_PIXEL(mi)); \
+       XFillArc(dpy, window, gc, \
+               (x) - BALLRADIUS - 2, (y) - BALLRADIUS - 2, \
+               2*(BALLRADIUS + 2), 2*(BALLRADIUS + 2), 0, 23040)
+#else
+
+#define ERASE_BALL(x,y) \
+       XSetForeground(dpy, gc, MI_BLACK_PIXEL(mi)); \
+       XFillArc(dpy, window, gc, \
+               (x) - BALLRADIUS, (y) - BALLRADIUS, \
+               2*BALLRADIUS, 2*BALLRADIUS, 0, 23040)
+#endif
+
+static void
+draw_juggle_ball(ModeInfo *mi, unsigned long color, int x, int y, double degree_offset, int divisions)
+{
+       Display    *dpy = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       jugglestruct *sp = &juggles[MI_SCREEN(mi)];
+       int offset;
+
+       XSetForeground(dpy, gc, color);
+       if ((color == MI_WHITE_PIXEL(mi)) ||
+           ((divisions != 2) && (divisions != 4)) || sp->solid) {
+               XFillArc(dpy, window, gc,
+                       x - BALLRADIUS, y - BALLRADIUS,
+                       2*BALLRADIUS, 2*BALLRADIUS,
+                       0, 23040);
+               return;
+       }
+       offset = (int) (degree_offset * 64);
+       if (divisions == 4) { /* 90 degree divisions */
+               XFillArc(dpy, window, gc,
+                       x - BALLRADIUS, y - BALLRADIUS,
+                       2*BALLRADIUS, 2*BALLRADIUS,
+                       offset, 5760);
+               XFillArc(dpy, window, gc,
+                       x - BALLRADIUS, y - BALLRADIUS,
+                       2*BALLRADIUS, 2*BALLRADIUS,
+                       (offset + 11520) % 23040, 5760);
+               XSetForeground(dpy, gc, MI_WHITE_PIXEL(mi));
+               XFillArc(dpy, window, gc,
+                       x - BALLRADIUS, y - BALLRADIUS,
+                       2*BALLRADIUS, 2*BALLRADIUS,
+                       (offset + 5760) % 23040, 5760);
+               XFillArc(dpy, window, gc,
+                       x - BALLRADIUS, y - BALLRADIUS,
+                       2*BALLRADIUS, 2*BALLRADIUS,
+                       (offset + 17280) % 23040, 5760);
+       } else { /* 180 degree divisions */
+               XFillArc(dpy, window, gc,
+                       x - BALLRADIUS, y - BALLRADIUS,
+                       2*BALLRADIUS, 2*BALLRADIUS,
+                       offset, 11520);
+               XSetForeground(dpy, gc, MI_WHITE_PIXEL(mi));
+               XFillArc(dpy, window, gc,
+                       x - BALLRADIUS, y - BALLRADIUS,
+                       2*BALLRADIUS, 2*BALLRADIUS,
+                       (offset + 11520) % 23040, 11520);
+       }
+       XFlush(dpy);
+}
+
+void
+draw_juggle(ModeInfo * mi)
+{
+       Display    *dpy = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       Trajectory *traj;
+       int future = 0;
+       int length = 0;
+       jugglestruct *sp;
+
+       if (juggles == NULL)
+               return;
+       sp = &juggles[MI_SCREEN(mi)];
+       if (sp->trace == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       draw_figure(mi);
+
+       {
+         struct timeval tv;
+         (void)gettimeofday(&tv, NULL);
+         sp->time = (int) ((tv.tv_sec - sp->begintime)*1000 + tv.tv_usec/1000);
+       }
+       for (traj = sp->head->next; traj != sp->head; traj = traj->next) {
+         length++;
+         if (traj->status != PREDICTOR) {
+               continue;
+         }
+         if (traj->start > future) {
+               future = traj->start;
+         }
+         if (sp->time < traj->start) { /* early */
+               continue;
+         } else if (sp->time < traj->finish) { /* working */
+               int x = (int) CUBIC(traj->xp, sp->time);
+               int y = (int) CUBIC(traj->yp, sp->time);
+               unsigned long color;
+
+               if (MI_NPIXELS(mi) > 2) {
+                 color = MI_PIXEL(mi, traj->color);
+               } else {
+                 color = MI_WHITE_PIXEL(mi);
+               }
+               if (traj->type == Empty || traj->type == Full) {
+                 draw_arm(mi, traj->hand, &x, &y);
+               }
+               if (traj->type == Ball || traj->type == Full) {
+                 if(trail > 0) {
+                       ERASE_BALL(sp->trace[sp->traceindex].x,
+                               sp->trace[sp->traceindex].y);
+                       sp->trace[sp->traceindex].x = traj->x;
+                       sp->trace[sp->traceindex].y = traj->y;
+                       if (++sp->traceindex >= trail) {
+                         sp->traceindex = 0;
+                       }
+                 } else {
+                       ERASE_BALL(traj->x, traj->y);
+                 }
+                 draw_juggle_ball(mi, color, x, y, traj->degree_offset, traj->divisions);
+                 traj->degree_offset = traj->degree_offset +
+                   SPIN_DEGREES * traj->spin / sp->count;
+                 if (traj->degree_offset < 0.0)
+                       traj->degree_offset += 360.0;
+                 else if (traj->degree_offset >= 360.0)
+                       traj->degree_offset -= 360.0;
+               }
+               traj->x = x;
+               traj->y = y;
+         } else { /* expired */
+               Trajectory *n = traj;
+
+               ERASE_BALL(traj->x, traj->y);
+               traj=traj->prev;
+               REMOVE(n);
+         }
+       }
+
+       /*** FIXME-BEGIN ***/
+       /* pattern generator would refill here when necessary */
+#if 1
+       if (future == 0) {
+#else
+       if (sp->count > MI_CYCLES(mi)) { /* pick a new juggle */
+#endif
+                       init_juggle(mi);
+       }
+       /*** FIXME-END ***/
+
+}
+
+#endif /* MODE_juggle */
diff --git a/modes/julia.c b/modes/julia.c
new file mode 100644 (file)
index 0000000..df5e24d
--- /dev/null
@@ -0,0 +1,467 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* julia --- continuously varying Julia set */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)julia.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 Sean McCullough <bankshot@mailhost.nmt.edu>.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Check out  A.K. Dewdney's "Computer Recreations", Scientific
+ * American Magazine" Nov 1987.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 28-May-1997: jwz@jwz.org: added interactive frobbing with the mouse.
+ * 10-May-1997: jwz@jwz.org: turned into a standalone program.
+ * 02-Dec-1995: snagged boilerplate from hop.c
+ *              used ifs {w0 = sqrt(x-c), w1 = -sqrt(x-c)} with random
+ *              iteration to plot the julia set, and sinusoidially varied
+ *              parameter for set and plotted parameter with a circle.
+ */
+
+/*-
+ * One thing to note is that batchcount is the *depth* of the search tree,
+ * so the number of points computed is 2^batchcount - 1.  I use 8 or 9
+ * on a dx266 and it looks okay.  The sinusoidal variation of the parameter
+ * might not be as interesting as it could, but it still gives an idea of
+ * the effect of the parameter.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Julia"
+#define HACK_INIT init_julia
+#define HACK_DRAW draw_julia
+#define julia_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 1000 \n" \
+ "*cycles: 20 \n" \
+ "*ncolors: 200 \n" \
+ "*mouse: False \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_julia
+
+#define DEF_TRACKMOUSE  "False"
+
+static Bool trackmouse;
+
+static XrmOptionDescRec opts[] =
+{
+        {(char *) "-trackmouse", (char *) ".julia.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+        {(char *) "+trackmouse", (char *) ".julia.trackmouse", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+        {(caddr_t *) & trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+        {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"}
+};
+
+ModeSpecOpt julia_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+
+#ifdef USE_MODULES
+ModStruct   julia_description =
+{"julia", "init_julia", "draw_julia", "release_julia",
+ "refresh_julia", "init_julia", NULL, &julia_opts,
+ 10000, 1000, 20, 1, 64, 1.0, "",
+ "Shows the Julia set", 0, NULL};
+
+#endif
+
+#define numpoints ((0x2<<jp->depth)-1)
+
+typedef struct {
+       int         centerx;
+       int         centery;    /* center of the screen */
+       double      cr;
+       double      ci;         /* julia params */
+       int         depth;
+       int         inc;
+       int         circsize;
+       int         erase;
+       int         pix;
+       long        itree;
+       int         buffer;
+       int         nbuffers;
+       int         redrawing, redrawpos;
+       Pixmap      pixmap;
+       GC          stippledGC;
+       XPoint    **pointBuffer;        /* pointer for XDrawPoints */
+       Cursor      cursor;
+} juliastruct;
+
+static juliastruct *julias = NULL;
+
+/* How many segments to draw per cycle when redrawing */
+#define REDRAWSTEP 3
+
+static void
+apply(juliastruct * jp, register double xr, register double xi, int d)
+{
+       double      theta, r;
+
+       jp->pointBuffer[jp->buffer][jp->itree].x =
+               (int) (0.5 * xr * jp->centerx + jp->centerx);
+       jp->pointBuffer[jp->buffer][jp->itree].y =
+               (int) (0.5 * xi * jp->centery + jp->centery);
+       jp->itree++;
+
+       if (d > 0) {
+               xi -= jp->ci;
+               xr -= jp->cr;
+
+               /* Avoid atan2: DOMAIN error message */
+               theta = (xi == 0.0 && xr == 0.0) ? 0.0 : atan2(xi, xr) / 2.0;
+
+               /*r = pow(xi * xi + xr * xr, 0.25); */
+               r = sqrt(sqrt(xi * xi + xr * xr));      /* 3 times faster */
+
+               xr = r * cos(theta);
+               xi = r * sin(theta);
+
+               d--;
+               apply(jp, xr, xi, d);
+               apply(jp, -xr, -xi, d);
+       }
+}
+
+static void
+incr(ModeInfo * mi, juliastruct * jp)
+{
+       Bool        track_p = trackmouse;
+       int         cx, cy;
+
+       if (track_p) {
+               Window      r, c;
+               int         rx, ry;
+               unsigned int m;
+
+               (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
+                                    &r, &c, &rx, &ry, &cx, &cy, &m);
+               if (cx <= 0 || cy <= 0 ||
+                   cx >= MI_WIDTH(mi) - jp->circsize - 1 ||
+                   cy >= MI_HEIGHT(mi) - jp->circsize - 1)
+                       track_p = False;
+       }
+       if (track_p) {
+               jp->cr = ((double) (cx + 2 - jp->centerx)) * 2 / jp->centerx;
+               jp->ci = ((double) (cy + 2 - jp->centery)) * 2 / jp->centery;
+       } else {
+               jp->cr = 1.5 * (sin(M_PI * (jp->inc / 300.0)) *
+                               sin(jp->inc * M_PI / 200.0));
+               jp->ci = 1.5 * (cos(M_PI * (jp->inc / 300.0)) *
+                               cos(jp->inc * M_PI / 200.0));
+
+               jp->cr += 0.5 * cos(M_PI * jp->inc / 400.0);
+               jp->ci += 0.5 * sin(M_PI * jp->inc / 400.0);
+       }
+}
+
+static void
+free_julia(Display *display, juliastruct *jp)
+{
+       if (jp->pointBuffer != NULL) {
+               int         buffer;
+
+               for (buffer = 0; buffer < jp->nbuffers; buffer++)
+                       if (jp->pointBuffer[buffer] != NULL)
+                               (void) free((void *) jp->pointBuffer[buffer]);
+               (void) free((void *) jp->pointBuffer);
+               jp->pointBuffer = NULL;
+       }
+       if (jp->stippledGC != None) {
+               XFreeGC(display, jp->stippledGC);
+               jp->stippledGC = None;
+       }
+       if (jp->pixmap != None) {
+               XFreePixmap(display, jp->pixmap);
+               jp->pixmap = None;
+       }
+       if (jp->cursor != None) {
+               XFreeCursor(display, jp->cursor);
+               jp->cursor = None;
+       }
+}
+void
+init_julia(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       juliastruct *jp;
+       XGCValues   gcv;
+       int         i, j;
+
+       if (julias == NULL) {
+               if ((julias = (juliastruct *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (juliastruct))) == NULL)
+                       return;
+       }
+       jp = &julias[MI_SCREEN(mi)];
+
+       jp->centerx = MI_WIDTH(mi) / 2;
+       jp->centery = MI_HEIGHT(mi) / 2;
+
+       jp->depth = MI_COUNT(mi);
+       if (jp->depth > 10)
+               jp->depth = 10;
+
+       if (trackmouse && !jp->cursor) {        /* Create an invisible cursor */
+               Pixmap      bit;
+               XColor      black;
+
+               black.red = 0;
+               black.green = 0;
+               black.blue = 0;
+               black.flags = DoRed | DoGreen | DoBlue;
+               if ((bit = XCreatePixmapFromBitmapData(display, window,
+                               (char *) "\000", 1, 1, MI_BLACK_PIXEL(mi),
+                               MI_BLACK_PIXEL(mi), 1)) == None) {
+                       free_julia(display, jp);
+                       return;
+               }
+                       
+               if ((jp->cursor = XCreatePixmapCursor(display, bit, bit,
+                                &black, &black, 0, 0)) == None) {
+                       XFreePixmap(display, bit);
+                       free_julia(display, jp);
+                       return;
+               }
+               XFreePixmap(display, bit);
+       }
+       XDefineCursor(display, window, jp->cursor);
+       if (jp->pixmap != None &&
+           jp->circsize != (MIN(jp->centerx, jp->centery) / 60) * 2 + 1) {
+               XFreePixmap(display, jp->pixmap);
+               jp->pixmap = None;
+       }
+       if (jp->pixmap == None) {
+               GC          fg_gc, bg_gc;
+
+               jp->circsize = (MIN(jp->centerx, jp->centery) / 96) * 2 + 1;
+               if ((jp->pixmap = XCreatePixmap(display, window,
+                               jp->circsize, jp->circsize, 1)) == None) {
+                       free_julia(display, jp);
+                       return;
+               }
+               gcv.foreground = 1;
+               if ((fg_gc = XCreateGC(display, jp->pixmap, GCForeground,
+                               &gcv)) == None) {
+                       free_julia(display, jp);
+                       return;
+               }
+               gcv.foreground = 0;
+               if ((bg_gc = XCreateGC(display, jp->pixmap, GCForeground,
+                               &gcv)) == None) {
+                       XFreeGC(display, fg_gc);
+                       free_julia(display, jp);
+                       return;
+               }
+               XFillRectangle(display, jp->pixmap, bg_gc,
+                              0, 0, jp->circsize, jp->circsize);
+               if (jp->circsize < 2)
+                       XDrawPoint(display, jp->pixmap, fg_gc, 0, 0);
+               else
+                       XFillArc(display, jp->pixmap, fg_gc,
+                                0, 0, jp->circsize, jp->circsize, 0, 23040);
+               XFreeGC(display, fg_gc);
+               XFreeGC(display, bg_gc);
+       }
+       if (!jp->stippledGC) {
+               gcv.foreground = MI_BLACK_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((jp->stippledGC = XCreateGC(display, window,
+                                GCForeground | GCBackground, &gcv)) == None) {
+                       free_julia(display, jp);
+                       return;
+               }
+       }
+       if (MI_NPIXELS(mi) > 2)
+               jp->pix = NRAND(MI_NPIXELS(mi));
+       jp->inc = NRAND(400) - 200;
+       jp->nbuffers = MI_CYCLES(mi) + 1;
+       if (jp->pointBuffer == NULL) {
+               if ((jp->pointBuffer = (XPoint **) calloc(jp->nbuffers,
+                               sizeof (XPoint *))) == NULL) {
+                       free_julia(display, jp);
+                       return;
+               }
+       }
+       for (i = 0; i < jp->nbuffers; ++i) {
+               if (jp->pointBuffer[i] == NULL) {
+                       if ((jp->pointBuffer[i] = (XPoint *) malloc(numpoints *
+                                       sizeof (XPoint))) == NULL) {
+                               free_julia(display, jp);
+                               return;
+                       }
+               }
+               for (j = 0; j < numpoints; j++)
+                       jp->pointBuffer[i][j].x = jp->pointBuffer[i][j].y = -1;         /* move initial point off screen */
+       }
+       jp->buffer = 0;
+       jp->redrawing = 0;
+       jp->erase = 0;
+
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_julia(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       double      r, theta;
+       register double xr = 0.0, xi = 0.0;
+       int         k = 64, rnd = 0, i, j;
+       XPoint     *xp, old_circle, new_circle;
+       juliastruct *jp;
+
+       if (julias == NULL)
+               return;
+       jp = &julias[MI_SCREEN(mi)];
+       if (jp->pointBuffer == NULL)
+               return;
+       xp = jp->pointBuffer[jp->buffer];
+
+       MI_IS_DRAWN(mi) = True;
+       old_circle.x = (int) (jp->centerx * jp->cr / 2) + jp->centerx - 2;
+       old_circle.y = (int) (jp->centery * jp->ci / 2) + jp->centery - 2;
+       incr(mi, jp);
+       new_circle.x = (int) (jp->centerx * jp->cr / 2) + jp->centerx - 2;
+       new_circle.y = (int) (jp->centery * jp->ci / 2) + jp->centery - 2;
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       ERASE_IMAGE(display, window, gc, new_circle.x, new_circle.y,
+                   old_circle.x, old_circle.y, jp->circsize, jp->circsize);
+       /* draw a circle at the c-parameter so you can see it's effect on the
+          structure of the julia set */
+       XSetTSOrigin(display, jp->stippledGC, new_circle.x, new_circle.y);
+       XSetForeground(display, jp->stippledGC, MI_WHITE_PIXEL(mi));
+       XSetStipple(display, jp->stippledGC, jp->pixmap);
+       XSetFillStyle(display, jp->stippledGC, FillOpaqueStippled);
+       XFillRectangle(display, window, jp->stippledGC, new_circle.x, new_circle.y,
+                      jp->circsize, jp->circsize);
+       XFlush(display);
+       if (jp->erase == 1) {
+               XDrawPoints(display, window, gc,
+                   jp->pointBuffer[jp->buffer], numpoints, CoordModeOrigin);
+       }
+       jp->inc++;
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, jp->pix));
+               if (++jp->pix >= MI_NPIXELS(mi))
+                       jp->pix = 0;
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       while (k--) {
+
+               /* save calls to LRAND by using bit shifts over and over on the same
+                  int for 32 iterations, then get a new random int */
+               if (!(k % 32))
+                       rnd = (int) LRAND();
+
+               /* complex sqrt: x^0.5 = radius^0.5*(cos(theta/2) + i*sin(theta/2)) */
+
+               xi -= jp->ci;
+               xr -= jp->cr;
+
+               /* Avoid atan2: DOMAIN error message */
+               if (xi == 0.0 && xr == 0.0)
+                       theta = 0.0;
+               else
+                       theta = atan2(xi, xr) / 2.0;
+
+               /*r = pow(xi * xi + xr * xr, 0.25); */
+               r = sqrt(sqrt(xi * xi + xr * xr));      /* 3 times faster */
+
+               xr = r * cos(theta);
+               xi = r * sin(theta);
+
+               if ((rnd >> (k % 32)) & 0x1) {
+                       xi = -xi;
+                       xr = -xr;
+               }
+               xp->x = jp->centerx + (int) ((jp->centerx >> 1) * xr);
+               xp->y = jp->centery + (int) ((jp->centery >> 1) * xi);
+               xp++;
+       }
+
+       jp->itree = 0;
+       apply(jp, xr, xi, jp->depth);
+
+       XDrawPoints(display, window, gc,
+                   jp->pointBuffer[jp->buffer], numpoints, CoordModeOrigin);
+
+       jp->buffer++;
+       if (jp->buffer > jp->nbuffers - 1) {
+               jp->buffer -= jp->nbuffers;
+               jp->erase = 1;
+       }
+       if (jp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       j = (jp->buffer - jp->redrawpos + jp->nbuffers) % jp->nbuffers;
+                       XDrawPoints(display, window, gc,
+                            jp->pointBuffer[j], numpoints, CoordModeOrigin);
+
+                       if (++(jp->redrawpos) >= jp->nbuffers) {
+                               jp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
+release_julia(ModeInfo * mi)
+{
+       if (julias != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_julia(MI_DISPLAY(mi), &julias[screen]);
+               (void) free((void *) julias);
+               julias = NULL;
+       }
+}
+
+void
+refresh_julia(ModeInfo * mi)
+{
+       juliastruct *jp;
+
+       if (julias == NULL)
+               return;
+       jp = &julias[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       jp->redrawing = 1;
+       jp->redrawpos = 0;
+}
+
+#endif /* MODE_julia */
diff --git a/modes/kaleid.c b/modes/kaleid.c
new file mode 100644 (file)
index 0000000..8665018
--- /dev/null
@@ -0,0 +1,1410 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* kaleid --- Brewster's Kaleidoscope */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)kaleid.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ *
+ *  kaleid.c - Brewster's Kaleidoscope  (Sir David Brewster invented the
+ *     kaleidoscope in 1816 and patented it in 1817.)
+ *
+ *  Copyright (c) 1998 by Robert Adam, II  <raii@comm.net>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 1998: Written
+ *
+ *
+ *  -batchcount n     number of pens [default 4]
+ *
+ *  -cycle n          percentage of black in the pattern (0%-95%)
+ *
+ *  -size n          symmetry mode [default -9]
+ *                         <0     = random from 0 to -number
+ *                         >0     = mirrored                  (-alternate)
+ *                                  rotated                   (+alternate)
+ *
+ *
+ *  -/+disconnected   turn on/off disconnected pen movement
+ *
+ *  -/+serial         turn on/off sequential allocation of colors
+ *
+ *  -/+alternate      turn on/off alternate display mode
+ *
+ *  -/+spiral         turn on/off spiral mode
+ *
+ *  -/+spots          turn on/off spots mode
+ *
+ *  -/+quad           turn on/off quad mirrored/rotated mode similar
+ *                       to size 4, works with alternate
+ *
+ *  -/+oct            turn on/off oct mirrored/rotated moded similar
+ *                       to size 8, works with alternate
+ *
+ *  -/+linear         select Cartesian/Polar coordinate mode. Cartesian
+ *                       uses straight lines similar to -oct and -quad
+ *                       mode instead of the curved lines of Polar mode.
+ *                       [default off]
+ *
+ */
+
+#include <math.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "Kaleid"
+#define HACK_INIT init_kaleid
+#define HACK_DRAW draw_kaleid
+#define kaleid_opts xlockmore_opts
+#define DEFAULTS "*delay: 80000 \n" \
+ "*count: 4 \n" \
+ "*cycles: 40 \n" \
+ "*size: -9 \n" \
+ "*ncolors: 200 \n" \
+ "*disconnected: True \n" \
+ "*serial: False \n" \
+ "*alternate: False \n" \
+ "*spiral: False \n" \
+ "*spots: False \n" \
+ "*linear: False \n" \
+ "*quad: False \n" \
+ "*oct: False \n"
+"*fullrandom: False \n"
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_kaleid
+
+#define DEF_DISCONNECTED  "True"
+#define DEF_SERIAL        "False"
+#define DEF_ALTERNATE     "False"
+#define DEF_QUAD          "False"
+#define DEF_OCT           "False"
+#define DEF_LINEAR        "False"
+#define DEF_SPIRAL        "False"
+#define DEF_SPOTS         "False"
+
+static Bool Disconnected;
+static Bool Serial;
+static Bool Alternate;
+static Bool Quad;
+static Bool Oct;
+static Bool Linear;
+static Bool Spiral;
+static Bool Spots;
+
+static XrmOptionDescRec opts[] =
+{
+   {(char *) "-disconnected", (char *) ".kaleid.disconnected", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+disconnected", (char *) ".kaleid.disconnected", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-serial", (char *) ".kaleid.serial", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+serial", (char *) ".kaleid.serial", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-alternate", (char *) ".kaleid.alternate", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+alternate", (char *) ".kaleid.alternate", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-spiral", (char *) ".kaleid.spiral", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+spiral", (char *) ".kaleid.spiral", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-spots", (char *) ".kaleid.spots", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+spots", (char *) ".kaleid.spots", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-quad", (char *) ".kaleid.quad", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+quad", (char *) ".kaleid.quad", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-oct", (char *) ".kaleid.oct", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+oct", (char *) ".kaleid.oct", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-linear", (char *) ".kaleid.linear", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+linear", (char *) ".kaleid.linear", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & Disconnected, (char *) "disconnected", (char *) "Disconnected", (char *) DEF_DISCONNECTED, t_Bool},
+       {(caddr_t *) & Serial, (char *) "serial", (char *) "Serial", (char *) DEF_SERIAL, t_Bool},
+    {(caddr_t *) & Alternate, (char *) "alternate", (char *) "Alternate", (char *) DEF_ALTERNATE, t_Bool},
+    {(caddr_t *) & Spiral, (char *) "spiral", (char *) "Spiral", (char *) DEF_SPIRAL, t_Bool},
+    {(caddr_t *) & Spots, (char *) "spots", (char *) "Spots", (char *) DEF_SPOTS, t_Bool},
+       {(caddr_t *) & Quad, (char *) "quad", (char *) "Quad", (char *) DEF_QUAD, t_Bool},
+       {(caddr_t *) & Oct, (char *) "oct", (char *) "Oct", (char *) DEF_OCT, t_Bool},
+       {(caddr_t *) & Linear, (char *) "linear", (char *) "Linear", (char *) DEF_LINEAR, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+disconnected", (char *) "turn on/off disconnected pen movement"},
+       {(char *) "-/+serial", (char *) "turn on/off sequential color selection"},
+       {(char *) "-/+alternate", (char *) "turn on/off alternate display mode"},
+       {(char *) "-/+spiral", (char *) "turn on/off angular bounding mode"},
+       {(char *) "-/+spots", (char *) "turn on/off circle mode"},
+       {(char *) "-/+quad", (char *) "turn on/off quad mirrored display mode"},
+       {(char *) "-/+oct", (char *) "turn on/off oct mirrored display mode"},
+       {(char *) "-/+linear", (char *) "select Cartesian/Polar coordinate display mode"}
+};
+
+ModeSpecOpt kaleid_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   kaleid_description =
+{
+       "kaleid", "init_kaleid", "draw_kaleid", "release_kaleid",
+       "refresh_kaleid", "init_kaleid", NULL, &kaleid_opts,
+       80000, 4, 40, -9, 64, 0.6, "",
+       "Shows Brewster's Kaleidoscope", 0, NULL
+};
+
+#endif
+
+#define INTRAND(min,max) (NRAND(((max+1)-(min)))+(min))
+
+#define MINPENS 1
+#define MINSIZE 1
+#define QUAD (-4)
+#define OCT (-8)
+
+#define SpotsMult           3
+
+#define MinVelocity         6
+#define MaxVelocity         4
+
+#define MinRadialVelocity   6
+#define MaxRadialVelocity   30
+
+#define MinAngularVelocity  5
+#define MaxAngularVelocity  3
+
+#define WidthPercent  25
+#define ChangeChance  2
+
+#define ToRadians 0.017453293
+#define ToDegrees 57.29577951
+#define PolarToCartX(r, t) ((r) * cos((t) * ToRadians))
+#define PolarToCartY(r, t) ((r) * sin((t) * ToRadians))
+#define CartToRadius(x, y) (sqrt(((x)*(x)) + ((y)*(y))))
+#define CartToAngle(x,y)   ((((x) == 0.0) && ((y) == 0.0)) ? 0.0 : (atan2((y),(x)) * ToDegrees))
+
+typedef struct {
+       double      cx;
+       double      cy;
+       double      ox;
+       double      oy;
+       double      xv;
+       double      yv;
+       int         curlwidth;
+       int         pix;
+       int         White;
+       Bool        RadiusOut;
+       Bool        AngleOut;
+       Bool        DeferredChange;
+} penstruct;
+
+typedef struct {
+       penstruct  *pen;
+
+
+       int         PercentBlack;
+       int         PenCount;
+       int         maxlwidth;
+       double      width, widthby2;
+       double      height, heightby2;
+       double      radius;
+       double      slice;
+       int         bouncetype;
+       int         modetype;
+       Bool        alternate, disconnected, serial, linear, spiral, spots;
+} kaleidstruct;
+
+static kaleidstruct *kaleids = NULL;
+
+/*-
+ *
+ */
+static void
+QuadMirrored(
+                   kaleidstruct * kp,
+                   int pn,
+                   XSegment segs[4]
+)
+{
+       kp->pen[pn].cx = kp->pen[pn].cx + kp->pen[pn].xv;
+       if (kp->pen[pn].cx < 0.0) {
+               kp->pen[pn].cx = -kp->pen[pn].cx;
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       } else if (kp->pen[pn].cx >= kp->widthby2) {
+               kp->pen[pn].cx = (kp->widthby2 - 1.0)
+                       - (kp->pen[pn].cx - kp->widthby2);
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       }
+       kp->pen[pn].cy = kp->pen[pn].cy + kp->pen[pn].yv;
+       if (kp->pen[pn].cy < 0.0) {
+               kp->pen[pn].cy = -kp->pen[pn].cy;
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       } else if (kp->pen[pn].cy >= kp->heightby2) {
+               kp->pen[pn].cy = (kp->heightby2 - 1.0)
+                       - (kp->pen[pn].cy - kp->heightby2);
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       }
+       segs[0].x1 = (int) kp->pen[pn].ox;
+       segs[0].y1 = (int) kp->pen[pn].oy;
+       segs[0].x2 = (int) kp->pen[pn].cx;
+       segs[0].y2 = (int) kp->pen[pn].cy;
+
+       segs[1].x1 = (int) (kp->width - kp->pen[pn].ox);
+       segs[1].y1 = (int) kp->pen[pn].oy;
+       segs[1].x2 = (int) (kp->width - kp->pen[pn].cx);
+       segs[1].y2 = (int) kp->pen[pn].cy;
+
+       segs[2].x1 = (int) (kp->width - kp->pen[pn].ox);
+       segs[2].y1 = (int) (kp->height - kp->pen[pn].oy);
+       segs[2].x2 = (int) (kp->width - kp->pen[pn].cx);
+       segs[2].y2 = (int) (kp->height - kp->pen[pn].cy);
+
+       segs[3].x1 = (int) kp->pen[pn].ox;
+       segs[3].y1 = (int) (kp->height - kp->pen[pn].oy);
+       segs[3].x2 = (int) kp->pen[pn].cx;
+       segs[3].y2 = (int) (kp->height - kp->pen[pn].cy);
+
+}
+
+/*-
+ *
+ */
+static void
+QuadRotated(
+                  kaleidstruct * kp,
+                  int pn,
+                  XSegment segs[4]
+)
+{
+       double      oxscaled2y;
+       double      oyscaled2x;
+       double      cxscaled2y;
+       double      cyscaled2x;
+
+       kp->pen[pn].cx = kp->pen[pn].cx + kp->pen[pn].xv;
+       if (kp->pen[pn].cx < 0.0) {
+               kp->pen[pn].cx = -kp->pen[pn].cx;
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       } else if (kp->pen[pn].cx >= kp->widthby2) {
+               kp->pen[pn].cx = (kp->widthby2 - 1.0)
+                       - (kp->pen[pn].cx - kp->widthby2);
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       }
+       kp->pen[pn].cy = kp->pen[pn].cy + kp->pen[pn].yv;
+       if (kp->pen[pn].cy < 0.0) {
+               kp->pen[pn].cy = -kp->pen[pn].cy;
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       } else if (kp->pen[pn].cy >= kp->heightby2) {
+               kp->pen[pn].cy = (kp->heightby2 - 1.0)
+                       - (kp->pen[pn].cy - kp->heightby2);
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       }
+       segs[0].x1 = (int) kp->pen[pn].ox;
+       segs[0].y1 = (int) kp->pen[pn].oy;
+       segs[0].x2 = (int) kp->pen[pn].cx;
+       segs[0].y2 = (int) kp->pen[pn].cy;
+
+       oxscaled2y = ((kp->pen[pn].ox * kp->heightby2) / kp->widthby2);
+       oyscaled2x = ((kp->pen[pn].oy * kp->widthby2) / kp->heightby2);
+       cxscaled2y = ((kp->pen[pn].cx * kp->heightby2) / kp->widthby2);
+       cyscaled2x = ((kp->pen[pn].cy * kp->widthby2) / kp->heightby2);
+
+       segs[1].x1 = (int) (kp->width - oyscaled2x);
+       segs[1].y1 = (int) oxscaled2y;
+       segs[1].x2 = (int) (kp->width - cyscaled2x);
+       segs[1].y2 = (int) cxscaled2y;
+
+       segs[2].x1 = (int) (kp->width - kp->pen[pn].ox);
+       segs[2].y1 = (int) (kp->height - kp->pen[pn].oy);
+       segs[2].x2 = (int) (kp->width - kp->pen[pn].cx);
+       segs[2].y2 = (int) (kp->height - kp->pen[pn].cy);
+
+       segs[3].x1 = (int) oyscaled2x;
+       segs[3].y1 = (int) (kp->height - oxscaled2y);
+       segs[3].x2 = (int) cyscaled2x;
+       segs[3].y2 = (int) (kp->height - cxscaled2y);
+
+}
+
+/*-
+ *
+ */
+static void
+GeneralPolarMoveAndBounce(
+                                kaleidstruct * kp,
+                                int pn
+)
+{
+       kp->pen[pn].cx = kp->pen[pn].cx + kp->pen[pn].xv;
+       if (kp->pen[pn].cx < 0.0) {
+           kp->pen[pn].cx = -kp->pen[pn].cx;
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       } else if (kp->pen[pn].cx >= kp->radius) {
+           kp->pen[pn].cx = (kp->radius - 1.0)
+                   - (kp->pen[pn].cx - kp->radius);
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       }
+       switch (kp->bouncetype) {
+               case 0:
+                       {
+                               kp->pen[pn].cy = kp->pen[pn].cy + kp->pen[pn].yv;
+                               break;
+                       }
+               case 1:
+                       {
+                               kp->pen[pn].cy = kp->pen[pn].cy
+                                       + ((kp->pen[pn].yv * kp->pen[pn].cx) / kp->radius);
+                               break;
+                       }
+               case 2:
+                       {
+                               kp->pen[pn].cy = kp->pen[pn].cy
+                                       + ((kp->pen[pn].yv * (kp->radius - kp->pen[pn].cx)) / kp->radius);
+                               break;
+                       }
+               default:
+                       {
+                               kp->pen[pn].cy = kp->slice / 2.0;
+                               kp->pen[pn].cx = kp->radius / 2.0;
+                               break;
+                       }
+       }
+
+       if (kp->pen[pn].cy < 0) {
+           if (kp->spiral) {
+                   kp->pen[pn].RadiusOut = False;
+                   kp->pen[pn].cy = kp->pen[pn].cy + 360.0;
+               } else {
+                   kp->pen[pn].RadiusOut = True;
+                       if (kp->pen[pn].oy >= 0) {
+                           kp->pen[pn].yv = -kp->pen[pn].yv;
+                       }
+               }
+       } else if (kp->spiral) {
+           if (kp->pen[pn].cy > 360.0) {
+                   kp->pen[pn].RadiusOut = False;
+                       kp->pen[pn].cy = kp->pen[pn].cy - 360.0;
+               }
+       } else if (kp->pen[pn].cy >= kp->slice) {
+           kp->pen[pn].RadiusOut = True;
+               if (kp->pen[pn].oy < kp->slice) {
+                   kp->pen[pn].yv = -kp->pen[pn].yv;
+               }
+       } else {
+               kp->pen[pn].RadiusOut = False;
+       }
+
+}
+
+
+/*-
+ *
+ */
+static void
+GeneralRotated(
+                     kaleidstruct * kp,
+                     int pn,
+                     XSegment * segs
+)
+{
+       double      Angle;
+       int         segnum;
+
+
+       GeneralPolarMoveAndBounce(kp, pn);
+
+       Angle = 0.0;
+       for (segnum = 0; segnum < kp->modetype; segnum += 1) {
+           if (! kp->spots) {
+                   segs[segnum].x1 = (int) (PolarToCartX(kp->pen[pn].ox,
+                                                                 kp->pen[pn].oy + Angle
+                                            ) + kp->widthby2
+                       );
+
+                       segs[segnum].y1 = (int) (PolarToCartY(kp->pen[pn].ox,
+                                                                 kp->pen[pn].oy + Angle
+                                                ) + kp->heightby2
+                               );
+               }
+               segs[segnum].x2 = (int) (PolarToCartX(kp->pen[pn].cx,
+                                                     kp->pen[pn].cy + Angle
+                                        ) + kp->widthby2
+                       );
+               segs[segnum].y2 = (int) (PolarToCartY(kp->pen[pn].cx,
+                                                     kp->pen[pn].cy + Angle
+                                        ) + kp->heightby2
+                       );
+
+               if (kp->spots) {
+                   segs[segnum].x1 = segs[segnum].x2;
+                   segs[segnum].y1 = segs[segnum].y2;
+               }
+
+               Angle += kp->slice;
+       }
+}
+
+/*-
+ *
+ */
+static void
+GeneralMirrored(
+                      kaleidstruct * kp,
+                      int pn,
+                      XSegment * segs
+)
+{
+       double      Angle;
+       int         segnum;
+
+       GeneralPolarMoveAndBounce(kp, pn);
+
+       Angle = 0.0;
+       for (segnum = 0; segnum < kp->modetype; segnum += 2) {
+           if (! kp->spots) {
+                   segs[segnum].x1 = (int) (PolarToCartX(kp->pen[pn].ox,
+                                                                 kp->pen[pn].oy + Angle
+                                                ) + kp->widthby2
+                               );
+
+                       segs[segnum].y1 = (int) (PolarToCartY(kp->pen[pn].ox,
+                                                                 kp->pen[pn].oy + Angle
+                                                ) + kp->heightby2
+                               );
+        }
+
+               segs[segnum].x2 = (int) (PolarToCartX(kp->pen[pn].cx,
+                                                     kp->pen[pn].cy + Angle
+                                        ) + kp->widthby2
+                       );
+
+               segs[segnum].y2 = (int) (PolarToCartY(kp->pen[pn].cx,
+                                                     kp->pen[pn].cy + Angle
+                                        ) + kp->heightby2
+                       );
+
+               if (kp->spots) {
+                   segs[segnum].x1 = segs[segnum].x2;
+                   segs[segnum].y1 = segs[segnum].y2;
+               }
+
+               Angle += (2.0 * kp->slice);
+       }
+
+       Angle = 360.0 - kp->slice;
+       for (segnum = 1; segnum < kp->modetype; segnum += 2) {
+           if (! kp->spots) {
+                   segs[segnum].x1 =
+                           (int) (PolarToCartX(kp->pen[pn].ox,
+                                                (kp->slice - kp->pen[pn].oy) + Angle
+                                          ) + kp->widthby2
+                           );
+
+                       segs[segnum].y1 =
+                           (int) (PolarToCartY(kp->pen[pn].ox,
+                                            (kp->slice - kp->pen[pn].oy) + Angle
+                                          ) + kp->heightby2
+                               );
+               }
+
+               segs[segnum].x2 =
+                       (int) (PolarToCartX(kp->pen[pn].cx,
+                                        (kp->slice - kp->pen[pn].cy) + Angle
+                              ) + kp->widthby2
+                       );
+
+               segs[segnum].y2 =
+                       (int) (PolarToCartY(kp->pen[pn].cx,
+                                        (kp->slice - kp->pen[pn].cy) + Angle
+                              ) + kp->heightby2
+                       );
+
+               if (kp->spots) {
+                   segs[segnum].x1 = segs[segnum].x2;
+                   segs[segnum].y1 = segs[segnum].y2;
+               }
+               Angle -= (2.0 * kp->slice);
+       }
+}
+
+/*-
+ *
+ */
+static void
+OctMirrored(
+                  kaleidstruct * kp,
+                  int pn,
+                  XSegment * segs
+)
+{
+       double      xdiag;
+       double      ydiag;
+       double      oxscaled2y, cxscaled2y;
+       double      oyscaled2x, cyscaled2x;
+
+       /*
+        *  I know that the "bounce" is not really accurate, but I like the way
+        * it looks.
+        */
+
+       xdiag = (kp->widthby2 * kp->pen[pn].oy) / kp->heightby2;
+
+       kp->pen[pn].cx = kp->pen[pn].cx + kp->pen[pn].xv;
+       if (kp->pen[pn].cx < xdiag) {
+               kp->pen[pn].cx = xdiag + (xdiag - kp->pen[pn].cx);
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       } else if (kp->pen[pn].cx >= kp->widthby2) {
+               kp->pen[pn].cx = (kp->widthby2 - 1.0)
+                       - (kp->pen[pn].cx - kp->widthby2);
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       }
+       ydiag = (kp->heightby2 * kp->pen[pn].cx) / kp->widthby2;
+
+       kp->pen[pn].cy = kp->pen[pn].cy + kp->pen[pn].yv;
+       if (kp->pen[pn].cy < 0.0) {
+               kp->pen[pn].cy = -kp->pen[pn].cy;
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       } else if (kp->pen[pn].cy > ydiag) {
+               kp->pen[pn].cy = ydiag - (kp->pen[pn].cy - ydiag);
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       }
+       segs[0].x1 = (int) kp->pen[pn].ox;
+       segs[0].y1 = (int) kp->pen[pn].oy;
+       segs[0].x2 = (int) kp->pen[pn].cx;
+       segs[0].y2 = (int) kp->pen[pn].cy;
+
+       segs[1].x1 = (int) (kp->width - kp->pen[pn].ox);
+       segs[1].y1 = (int) kp->pen[pn].oy;
+       segs[1].x2 = (int) (kp->width - kp->pen[pn].cx);
+       segs[1].y2 = (int) kp->pen[pn].cy;
+
+       segs[4].x1 = segs[1].x1;
+       segs[4].y1 = (int) kp->height - segs[0].y1;
+       segs[4].x2 = segs[1].x2;
+       segs[4].y2 = (int) kp->height - segs[0].y2;
+
+       segs[5].x1 = segs[0].x1;
+       segs[5].y1 = (int) kp->height - segs[0].y1;
+       segs[5].x2 = segs[0].x2;
+       segs[5].y2 = (int) kp->height - segs[0].y2;
+
+
+       oxscaled2y = ((kp->pen[pn].ox * kp->heightby2) / kp->widthby2);
+       oyscaled2x = ((kp->pen[pn].oy * kp->widthby2) / kp->heightby2);
+       cxscaled2y = ((kp->pen[pn].cx * kp->heightby2) / kp->widthby2);
+       cyscaled2x = ((kp->pen[pn].cy * kp->widthby2) / kp->heightby2);
+
+
+       segs[7].x1 = (int) oyscaled2x;
+       segs[7].y1 = (int) oxscaled2y;
+       segs[7].x2 = (int) cyscaled2x;
+       segs[7].y2 = (int) cxscaled2y;
+
+
+       segs[2].x1 = (int) kp->width - segs[7].x1;
+       segs[2].y1 = segs[7].y1;
+       segs[2].x2 = (int) kp->width - segs[7].x2;
+       segs[2].y2 = segs[7].y2;
+
+       segs[6].x1 = segs[7].x1;
+       segs[6].y1 = (int) kp->height - segs[7].y1;
+       segs[6].x2 = segs[7].x2;
+       segs[6].y2 = (int) kp->height - segs[7].y2;
+
+       segs[3].x1 = (int) kp->width - segs[7].x1;
+       segs[3].y1 = segs[6].y1;
+       segs[3].x2 = (int) kp->width - segs[7].x2;
+       segs[3].y2 = segs[6].y2;
+
+}
+
+
+
+/*-
+ *
+ */
+#if 0
+static void
+OldOctRotated(
+                    kaleidstruct * kp,
+                    int pn,
+                    XSegment * segs
+)
+{
+       double      angle, radius;
+       double      oangle, oradius;
+       double      rv, av;
+       double      perp, para;
+       int         i;
+
+       /*
+        *  I know that the "bounce" is not really accurate, but I like the way
+        * it looks.
+        */
+
+       kp->pen[pn].cx = kp->pen[pn].cx + kp->pen[pn].xv;
+       kp->pen[pn].cy = kp->pen[pn].cy + kp->pen[pn].yv;
+       angle = CartToAngle(kp->pen[pn].cx, kp->pen[pn].cy);
+       radius = CartToRadius(kp->pen[pn].cx, kp->pen[pn].cy);
+
+       oangle = CartToAngle(kp->pen[pn].ox, kp->pen[pn].oy);
+       oradius = CartToRadius(kp->pen[pn].ox, kp->pen[pn].oy);
+
+       if (radius < 0.0) {
+               if (kp->pen[pn].xv < 0.0) {
+                       kp->pen[pn].xv = -kp->pen[pn].xv;
+               }
+       } else if (radius > kp->radius) {
+               if (kp->pen[pn].xv > 0.0) {
+                       kp->pen[pn].xv = -kp->pen[pn].xv;
+               }
+       }
+       if (angle < 0.0) {
+               if (oangle > 0.0) {
+                       kp->pen[pn].yv = -kp->pen[pn].yv;
+               }
+       } else if (angle > 45.0) {
+               if (oangle < 45.0) {
+                       rv = CartToRadius(kp->pen[pn].xv, kp->pen[pn].yv);
+                       av = CartToAngle(kp->pen[pn].xv, kp->pen[pn].yv);
+
+                       para = PolarToCartX(rv, av - 45.0);
+                       perp = PolarToCartY(rv, av - 45.0);
+
+                       rv = CartToRadius(para, -perp);
+                       av = CartToAngle(para, -perp);
+
+                       kp->pen[pn].xv = PolarToCartX(rv, av + 45.0);
+                       kp->pen[pn].yv = PolarToCartY(rv, av + 45.0);
+               }
+       }
+       for (i = 0; i < 8; i += 1) {
+               segs[i].x1 = (int) (kp->widthby2 + PolarToCartX(oradius, oangle));
+               segs[i].y1 = (int) (kp->heightby2 - PolarToCartY(oradius, oangle));
+               segs[i].x2 = (int) (kp->widthby2 + PolarToCartX(radius, angle));
+               segs[i].y2 = (int) (kp->heightby2 - PolarToCartY(radius, angle));
+
+               oangle += 45.0;
+               angle += 45.0;
+       }
+}
+
+#endif
+
+/*-
+ *
+ */
+static void
+OctRotated(
+                 kaleidstruct * kp,
+                 int pn,
+                 XSegment * segs
+)
+{
+       double      xdiag;
+       double      ydiag;
+       double      radius, angle;
+       double      oradius, oangle;
+       double      ox, oy, cx, cy;
+       double      offset;
+       int         i;
+
+       /*
+        *  I know that the "bounce" is not really accurate, but I like the way
+        * it looks.
+        */
+
+       xdiag = (kp->widthby2 * kp->pen[pn].oy) / kp->heightby2;
+
+       kp->pen[pn].cx = kp->pen[pn].cx + kp->pen[pn].xv;
+       if (kp->pen[pn].cx < xdiag) {
+               kp->pen[pn].cx = xdiag + (xdiag - kp->pen[pn].cx);
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       } else if (kp->pen[pn].cx >= kp->widthby2) {
+               kp->pen[pn].cx = (kp->widthby2 - 1.0)
+                       - (kp->pen[pn].cx - kp->widthby2);
+               kp->pen[pn].xv = -kp->pen[pn].xv;
+       }
+       ydiag = (kp->heightby2 * kp->pen[pn].cx) / kp->widthby2;
+
+       kp->pen[pn].cy = kp->pen[pn].cy + kp->pen[pn].yv;
+       if (kp->pen[pn].cy < 0.0) {
+               kp->pen[pn].cy = -kp->pen[pn].cy;
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       } else if (kp->pen[pn].cy > ydiag) {
+               kp->pen[pn].cy = ydiag - (kp->pen[pn].cy - ydiag);
+               kp->pen[pn].yv = -kp->pen[pn].yv;
+       }
+       offset = CartToRadius(kp->heightby2, kp->widthby2);
+       ox = (kp->pen[pn].ox * offset) / kp->widthby2;
+       oy = (kp->pen[pn].oy * offset) / kp->heightby2;
+       cx = (kp->pen[pn].cx * offset) / kp->widthby2;
+       cy = (kp->pen[pn].cy * offset) / kp->heightby2;
+
+       angle = CartToAngle(cx - offset,
+                           offset - cy
+               ) - 90.0;
+       radius = CartToRadius(cx - offset,
+                             offset - cy
+               );
+
+       oangle = CartToAngle(ox - offset,
+                            offset - oy
+               ) - 90.0;
+       oradius = CartToRadius(ox - offset,
+                              offset - oy
+               );
+
+
+       for (i = 0; i < 8; i += 1) {
+               segs[i].x1 = (int) (kp->widthby2 + PolarToCartX(oradius, oangle));
+               segs[i].y1 = (int) (kp->heightby2 - PolarToCartY(oradius, oangle));
+               segs[i].x2 = (int) (kp->widthby2 + PolarToCartX(radius, angle));
+               segs[i].y2 = (int) (kp->heightby2 - PolarToCartY(radius, angle));
+
+               oangle += 45.0;
+               angle += 45.0;
+       }
+
+}
+
+/*-
+ *
+ */
+static void
+GeneralLinearMoveAndBounce(
+                                 kaleidstruct * kp,
+                                 int pn,
+                                 double *angle,
+                                 double *radius,
+                                 double *oangle,
+                                 double *oradius
+)
+{
+       double      rv, av;
+       double      perp, para;
+
+       kp->pen[pn].cx = kp->pen[pn].cx + kp->pen[pn].xv;
+       kp->pen[pn].cy = kp->pen[pn].cy + kp->pen[pn].yv;
+
+       *angle = CartToAngle(kp->pen[pn].cx, kp->pen[pn].cy);
+       *radius = CartToRadius(kp->pen[pn].cx, kp->pen[pn].cy);
+
+       *oangle = CartToAngle(kp->pen[pn].ox, kp->pen[pn].oy);
+       *oradius = CartToRadius(kp->pen[pn].ox, kp->pen[pn].oy);
+
+       if (*radius < 0.0) {
+               kp->pen[pn].RadiusOut = True;
+               if (*oradius > 0.0) {
+                       rv = CartToRadius(kp->pen[pn].xv, kp->pen[pn].yv);
+                       av = CartToAngle(kp->pen[pn].xv, kp->pen[pn].yv);
+
+                       para = PolarToCartX(rv, av - (*angle + 90.0));
+                       perp = PolarToCartY(rv, av - (*angle + 90.0));
+
+                       rv = CartToRadius(para, -perp);
+                       av = CartToAngle(para, -perp);
+
+                       kp->pen[pn].xv = PolarToCartX(rv, av + (*angle + 90.0));
+                       kp->pen[pn].yv = PolarToCartY(rv, av + (*angle + 90.0));
+               }
+       } else if (*radius > kp->radius) {
+               kp->pen[pn].RadiusOut = True;
+               if (*oradius < kp->radius) {
+                       rv = CartToRadius(kp->pen[pn].xv, kp->pen[pn].yv);
+                       av = CartToAngle(kp->pen[pn].xv, kp->pen[pn].yv);
+
+                       para = PolarToCartX(rv, av - (*angle + 90.0));
+                       perp = PolarToCartY(rv, av - (*angle + 90.0));
+
+                       rv = CartToRadius(para, -perp);
+                       av = CartToAngle(para, -perp);
+
+                       kp->pen[pn].xv = PolarToCartX(rv, av + (*angle + 90.0));
+                       kp->pen[pn].yv = PolarToCartY(rv, av + (*angle + 90.0));
+               }
+       } else {
+               kp->pen[pn].RadiusOut = False;
+       }
+
+
+       if (*angle < 0.0) {
+           if (kp->spiral) {
+                   kp->pen[pn].AngleOut = False;
+                   *angle = *angle + 360.0;
+               } else {
+                   kp->pen[pn].AngleOut = True;
+                         if (*oangle > 0.0) {
+                                 rv = CartToRadius(kp->pen[pn].xv, kp->pen[pn].yv);
+                                 av = CartToAngle(kp->pen[pn].xv, kp->pen[pn].yv);
+
+                                 para = PolarToCartX(rv, av);
+                                 perp = PolarToCartY(rv, av);
+
+                                 rv = CartToRadius(para, -perp);
+                                 av = CartToAngle(para, -perp);
+
+                                 kp->pen[pn].xv = PolarToCartX(rv, av);
+                                 kp->pen[pn].yv = PolarToCartY(rv, av);
+                         }
+               }
+    } else if (kp->spiral) {
+           if (*angle > 360.0) {
+                kp->pen[pn].AngleOut = False;
+                        *angle = *angle - 360.0;
+           }
+       } else if (*angle > kp->slice) {
+               kp->pen[pn].AngleOut = True;
+               if (*oangle < kp->slice) {
+                       rv = CartToRadius(kp->pen[pn].xv, kp->pen[pn].yv);
+                       av = CartToAngle(kp->pen[pn].xv, kp->pen[pn].yv);
+
+                       para = PolarToCartX(rv, av - kp->slice);
+                       perp = PolarToCartY(rv, av - kp->slice);
+
+                       rv = CartToRadius(para, -perp);
+                       av = CartToAngle(para, -perp);
+
+                       kp->pen[pn].xv = PolarToCartX(rv, av + kp->slice);
+                       kp->pen[pn].yv = PolarToCartY(rv, av + kp->slice);
+               }
+       } else {
+               kp->pen[pn].AngleOut = False;
+       }
+}
+
+/*-
+ *
+ */
+static void
+GeneralLinearRotated(
+                           kaleidstruct * kp,
+                           int pn,
+                           XSegment * segs
+)
+{
+       double      angle, radius;
+       double      oangle, oradius;
+       int         i;
+
+       GeneralLinearMoveAndBounce(kp, pn, &angle, &radius, &oangle, &oradius);
+
+       for (i = 0; i < kp->modetype; i += 1) {
+           if (! kp->spots) {
+                   segs[i].x1 = (int) (kp->widthby2 + PolarToCartX(oradius, oangle));
+                       segs[i].y1 = (int) (kp->heightby2 - PolarToCartY(oradius, oangle));
+               }
+
+               segs[i].x2 = (int) (kp->widthby2 + PolarToCartX(radius, angle));
+               segs[i].y2 = (int) (kp->heightby2 - PolarToCartY(radius, angle));
+
+               if (kp->spots) {
+                   segs[i].x1 = segs[i].x2;
+                       segs[i].y1 = segs[i].y2;
+               }
+
+               oangle += kp->slice;
+               angle += kp->slice;
+       }
+}
+
+
+
+/*-
+ *
+ */
+static void
+GeneralLinearMirrored(
+                            kaleidstruct * kp,
+                            int pn,
+                            XSegment * segs
+)
+{
+       double      hangle, angle, radius;
+       double      hoangle, oangle, oradius;
+       int         i;
+
+
+       GeneralLinearMoveAndBounce(kp, pn, &angle, &radius, &oangle, &oradius);
+
+       hoangle = oangle;
+       hangle = angle;
+
+       for (i = 0; i < kp->modetype; i += 2) {
+           if (! kp->spots) {
+                   segs[i].x1 = (int) (kp->widthby2 + PolarToCartX(oradius, oangle));
+                       segs[i].y1 = (int) (kp->heightby2 - PolarToCartY(oradius, oangle));
+               }
+
+               segs[i].x2 = (int) (kp->widthby2 + PolarToCartX(radius, angle));
+               segs[i].y2 = (int) (kp->heightby2 - PolarToCartY(radius, angle));
+
+               if (kp->spots) {
+                   segs[i].x1 = segs[i].x2;
+                       segs[i].y1 = segs[i].y2;
+               }
+
+               oangle += 2.0 * kp->slice;
+               angle += 2.0 * kp->slice;
+       }
+
+       oangle = kp->slice * 2.0;
+       angle = kp->slice * 2.0;
+       for (i = 1; i < kp->modetype; i += 2) {
+           if (! kp->spots) {
+                   segs[i].x1 = (int) (kp->widthby2 + PolarToCartX(oradius, oangle - hoangle));
+                       segs[i].y1 = (int) (kp->heightby2 - PolarToCartY(oradius, oangle - hoangle));
+               }
+
+               segs[i].x2 = (int) (kp->widthby2 + PolarToCartX(radius, angle - hangle));
+               segs[i].y2 = (int) (kp->heightby2 - PolarToCartY(radius, angle - hangle));
+
+               if (kp->spots) {
+                   segs[i].x1 = segs[i].x2;
+                       segs[i].y1 = segs[i].y2;
+               }
+
+               oangle += 2.0 * kp->slice;
+               angle += 2.0 * kp->slice;
+       }
+}
+
+/*-
+ *
+ */
+static void
+random_velocity(kaleidstruct * kp, int i)
+{
+    int tMxRV, tMnRV;
+       int tMxAV, tMnAV;
+    int tMxV,  tMnV;
+       
+       if (kp->spots) {
+           tMxRV = MaxRadialVelocity * SpotsMult;
+           tMnRV = MinRadialVelocity * SpotsMult;
+           tMxAV = MaxAngularVelocity * SpotsMult;
+           tMnAV = MinAngularVelocity * SpotsMult;
+        tMxV  = MaxVelocity * SpotsMult;
+        tMnV  = MinVelocity * SpotsMult;
+       } else {
+           tMxRV = MaxRadialVelocity;
+           tMnRV = MinRadialVelocity;
+           tMxAV = MaxAngularVelocity;
+           tMnAV = MinAngularVelocity;
+        tMxV  = MaxVelocity;
+        tMnV  = MinVelocity;
+       }
+
+
+       if (kp->modetype > 0) {
+               kp->pen[i].xv = INTRAND(-tMxRV, tMxRV);
+               if (kp->pen[i].xv > 0.0) {
+                       kp->pen[i].xv += tMnRV;
+               } else if (kp->pen[i].xv < 0.0) {
+                       kp->pen[i].xv -= tMnRV;
+               }
+               kp->pen[i].yv = INTRAND(-tMxAV, tMxAV);
+               if (kp->pen[i].yv > 0.0) {
+                       kp->pen[i].yv += tMnAV;
+               } else if (kp->pen[i].yv < 0.0) {
+                       kp->pen[i].yv -= tMnAV;
+               }
+       } else {
+               kp->pen[i].xv = INTRAND(-tMxV, tMxV);
+               if (kp->pen[i].xv > 0.0) {
+                       kp->pen[i].xv += tMnV;
+               } else if (kp->pen[i].xv < 0.0) {
+                       kp->pen[i].xv -= tMnV;
+               }
+               kp->pen[i].yv = INTRAND(-tMxV, tMxV);
+               if (kp->pen[i].yv > 0.0) {
+                       kp->pen[i].yv += tMnV;
+               } else if (kp->pen[i].yv < 0.0) {
+                       kp->pen[i].yv -= tMnV;
+               }
+       }
+}
+
+
+static void
+random_position(kaleidstruct * kp, int i)
+{
+
+       if (kp->modetype >= 0) {
+               if (kp->linear) {
+                       double      radius, angle;
+
+                       radius = (double) INTRAND(0, (int) (kp->radius - 1.0));
+                       angle = (double) INTRAND(0, (int) (kp->slice - 1.0));
+
+                       kp->pen[i].cx = PolarToCartX(radius, angle);
+                       kp->pen[i].cy = PolarToCartY(radius, angle);
+               } else {
+                       kp->pen[i].cx = (double) INTRAND(0, (int) (kp->radius - 1.0));
+                       kp->pen[i].cy = (double) INTRAND(0, (int) (kp->slice - 1.0));
+               }
+       } else if (kp->modetype == OCT) {
+               double      radius, angle;
+
+               radius = (double) INTRAND(0, (int) (kp->radius - 1.0));
+               angle = (double) INTRAND(0, 44);
+
+               kp->pen[i].cx = PolarToCartX(radius, angle);
+               kp->pen[i].cy = PolarToCartY(radius, angle);
+       } else {
+               kp->pen[i].cx = (double) INTRAND(0, (int) (kp->widthby2 - 1.0));
+               kp->pen[i].cy = (double) INTRAND(0,
+                    (int) ((kp->heightby2 * kp->pen[i].cx) / kp->widthby2));
+       }
+}
+
+
+/*-
+ *
+ */
+void
+init_kaleid(ModeInfo * mi)
+{
+       int         i;
+       kaleidstruct *kp;
+
+
+       if (kaleids == NULL) {
+               if ((kaleids = (kaleidstruct *) calloc(MI_NUM_SCREENS(mi),
+                              sizeof (kaleidstruct))) == NULL)
+                       return;
+       }
+       kp = &kaleids[MI_SCREEN(mi)];
+
+       kp->PenCount = MI_COUNT(mi);
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               kp->alternate = (Bool) (LRAND() & 1);
+               kp->disconnected = (Bool) (LRAND() & 1);
+               kp->serial = (Bool) (LRAND() & 1);
+               kp->linear = (Bool) (LRAND() & 1);
+               kp->spiral = (Bool) (LRAND() & 1);
+               kp->spots = (Bool) (LRAND() & 1);
+       } else {
+               kp->alternate = Alternate;
+               kp->disconnected = Disconnected;
+               kp->serial = Serial;
+               kp->linear = Linear;
+               kp->spiral = Spiral;
+               kp->spots = Spots;
+       }
+
+       if (kp->PenCount < -MINPENS) {
+               /* if kp->PenCount is random ... the size can change */
+               if (kp->pen != NULL) {
+                       (void) free((void *) kp->pen);
+                       kp->pen = NULL;
+               }
+               kp->PenCount = NRAND(-kp->PenCount - MINPENS + 1) + MINPENS;
+       } else if (kp->PenCount < MINPENS)
+               kp->PenCount = MINPENS;
+
+       if (kp->pen == NULL) {
+               if ((kp->pen = (penstruct *) malloc(kp->PenCount *
+                               sizeof (penstruct))) == NULL)
+                       return;
+       }
+
+       if ((MI_SIZE(mi)) > MINSIZE) {
+               kp->modetype = (!kp->alternate + 1) * MI_SIZE(mi);
+       } else if ((MI_SIZE(mi)) < -MINSIZE) {
+               kp->modetype = (!kp->alternate + 1) * (NRAND(-MI_SIZE(mi) + 1) + MINSIZE);
+       } else {
+               kp->modetype = (!kp->alternate + 1) * MINSIZE;
+       }
+       if (MI_IS_FULLRANDOM(mi)) {
+               int         tmp;
+
+               tmp = NRAND(ABS(MI_SIZE(mi)) + 2);
+               if (tmp == 0)
+                       kp->modetype = OCT;
+               else if (tmp == 1)
+                       kp->modetype = QUAD;
+       } else {
+               if (Oct)
+                       kp->modetype = OCT;
+               else if (Quad)
+                       kp->modetype = QUAD;
+       }
+
+       kp->PercentBlack = (int) MAX(0, MIN(MI_CYCLES(mi), 95));
+
+
+       /* set various size parameters */
+
+       kp->width = (double) MI_WIDTH(mi);
+       kp->height = (double) MI_HEIGHT(mi);
+
+       if (kp->width < 2.0)
+               kp->width = 2.0;
+       if (kp->height < 2.0)
+               kp->height = 2.0;
+
+       kp->radius = sqrt(((kp->width * kp->width) +
+                          (kp->height * kp->height)
+                         ) / 4.0
+               );
+
+
+       if (kp->modetype >= 0) {
+               kp->bouncetype = INTRAND(0, 2);
+
+               kp->slice = 360.0 / (double) kp->modetype;
+
+               kp->widthby2 = kp->width / 2.0;
+               kp->heightby2 = kp->height / 2.0;
+       } else {
+               kp->widthby2 = kp->width / 2.0;
+               kp->heightby2 = kp->height / 2.0;
+       }
+
+       /* set the maximum pen width */
+       if (kp->modetype >= 0) {
+               if ((kp->slice == 360.0) || (kp->slice == 180.0)) {
+                       kp->maxlwidth = (int) ((((double) MIN(kp->widthby2, kp->heightby2)) *
+                                            (double) WidthPercent) / 100.0);
+               } else {
+                       kp->maxlwidth = (int) (((sin(kp->slice * ToRadians) *
+                                         MIN(kp->widthby2, kp->heightby2)) *
+                                            (double) WidthPercent) / 100.0);
+               }
+       } else {
+               kp->maxlwidth = (int) ((MIN(kp->widthby2,
+                                           kp->heightby2
+                                       ) * (double) WidthPercent
+                                      ) / 100.0
+                       );
+       }
+
+       if (kp->spots) {
+           kp->maxlwidth = 2 * kp->maxlwidth;
+       }
+
+       if (kp->maxlwidth <= 0) {
+               kp->maxlwidth = 1;
+       }
+
+       for (i = 0; i < kp->PenCount; i += 1) {
+               if (MI_NPIXELS(mi) > 2) {
+                       kp->pen[i].pix = NRAND(MI_NPIXELS(mi));
+                       kp->pen[i].White = 1;
+               } else {
+                       kp->pen[i].White = 1;
+               }
+
+               kp->pen[i].curlwidth = INTRAND(1, kp->maxlwidth);
+
+               kp->pen[i].RadiusOut = False;
+               kp->pen[i].AngleOut = False;
+
+               random_position(kp, i);
+
+               kp->pen[i].ox = kp->pen[i].cx;
+               kp->pen[i].oy = kp->pen[i].cy;
+               kp->pen[i].DeferredChange = False;
+
+               random_velocity(kp, i);
+       }
+
+       MI_CLEARWINDOW(mi);
+
+}
+
+/*-
+ *
+ */
+static void
+set_pen_attributes(ModeInfo * mi, kaleidstruct * kp, int i)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+
+       if (kp->pen[i].White) {
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, gc, MI_PIXEL(mi, kp->pen[i].pix));
+               else
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       } else {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       }
+       XSetLineAttributes(display, gc,
+                      kp->pen[i].curlwidth, LineSolid, CapRound, JoinRound);
+}
+
+/*-
+ *
+ */
+static void
+change_pen(ModeInfo * mi, kaleidstruct * kp, int i)
+{
+       if (INTRAND(0, 100) < kp->PercentBlack) {
+               kp->pen[i].White = 0;
+       } else {
+               kp->pen[i].White = 1;
+               if (kp->serial) {
+                       if (MI_NPIXELS(mi) > 2) {
+                               if (++kp->pen[i].pix >= MI_NPIXELS(mi))
+                                       kp->pen[i].pix = 0;
+                       }
+               } else {
+                       if (MI_NPIXELS(mi) > 2) {
+                               kp->pen[i].pix = NRAND(MI_NPIXELS(mi));
+                       }
+               }
+       }
+
+       random_velocity(kp, i);
+
+       kp->pen[i].curlwidth = INTRAND(1, kp->maxlwidth);
+
+       if (kp->modetype >= 0) {
+               kp->bouncetype = INTRAND(0, 2);
+       }
+       if (kp->disconnected) {
+               random_position(kp, i);
+               kp->pen[i].ox = kp->pen[i].cx;
+               kp->pen[i].oy = kp->pen[i].cy;
+       }
+}
+
+/*-
+ *
+ */
+void
+draw_kaleid(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       XSegment   *segs;
+       int         NumberOfSegments;
+       int         i;
+       kaleidstruct *kp;
+
+       if (kaleids == NULL)
+                       return;
+       kp = &kaleids[MI_SCREEN(mi)];
+       if (kp->pen == NULL)
+                       return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (kp->modetype == QUAD) {
+               NumberOfSegments = 4;
+       } else if (kp->modetype == OCT) {
+               NumberOfSegments = 8;
+       } else {                /* if (kp->modetype > 0) */
+               NumberOfSegments = kp->modetype;
+       }
+       if ((segs = (XSegment *) malloc(NumberOfSegments *
+                       sizeof (XSegment))) == NULL) {
+               (void) free((void *) kp->pen);
+               kp->pen = NULL;
+               return;
+       }
+
+       for (i = 0; i < kp->PenCount; i++) {
+               set_pen_attributes(mi, kp, i);
+
+               if (kp->modetype == QUAD) {
+                       if (kp->alternate) {
+                               QuadRotated(kp, i, segs);
+                       } else {
+                               QuadMirrored(kp, i, segs);
+                       }
+               } else if (kp->modetype == OCT) {
+                       if (kp->alternate) {
+                               OctRotated(kp, i, segs);
+                       } else {
+                               OctMirrored(kp, i, segs);
+                       }
+               } else {
+                       if (kp->alternate) {      
+
+                               if (kp->linear) {
+                                       GeneralLinearRotated(kp, i, segs);
+                               } else {
+                                       GeneralRotated(kp, i, segs);
+                               }
+                       } else {
+                               if (kp->linear) {
+                                       GeneralLinearMirrored(kp, i, segs);
+                               } else {
+                                       GeneralMirrored(kp, i, segs);
+                               }
+                       }
+               }
+               XDrawSegments(
+                                    display,
+                                    MI_WINDOW(mi),
+                                    gc,
+                                    segs,
+                                    NumberOfSegments
+                       );
+
+               kp->pen[i].ox = kp->pen[i].cx;
+               kp->pen[i].oy = kp->pen[i].cy;
+
+
+               if ((INTRAND(0, 100) < ChangeChance) || kp->pen[i].DeferredChange) {
+                       if (!kp->pen[i].AngleOut && !kp->pen[i].RadiusOut) {
+                               kp->pen[i].DeferredChange = False;
+                               change_pen(mi, kp, i);
+                       } else {
+                               kp->pen[i].DeferredChange = True;
+                       }
+               }
+       }
+         
+
+       XSetLineAttributes(display, gc, 1, LineSolid, CapRound, JoinRound);
+       (void) free((void *) segs);
+}
+
+/*-
+ *
+ */
+void
+release_kaleid(ModeInfo * mi)
+{
+       if (kaleids != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       kaleidstruct *kp = &kaleids[screen];
+
+                       if (kp->pen != NULL)
+                               (void) free((void *) kp->pen);
+               }
+               (void) free((void *) kaleids);
+               kaleids = NULL;
+       }
+}
+
+/*-
+ *
+ */
+void
+refresh_kaleid(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_kaleid */
diff --git a/modes/kumppa.c b/modes/kumppa.c
new file mode 100644 (file)
index 0000000..947fad3
--- /dev/null
@@ -0,0 +1,812 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* kumppa ---  */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)kumppa.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+   Copyright (C) Teemu Suutari (temisu@utu.fi) Feb 1998
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   "Software"), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+
+   Except as contained in this notice, the name of the X Consortium shall
+   not be used in advertising or otherwise to promote the sale, use or
+   other dealings in this Software without prior written authorization
+   from the X Consortium.
+
+   * Revision History:
+   * 01-Nov-2000: Allocation checks
+   * 16-Jul-1998: xlockmore version by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+   * Feb 1998 : original xscreensaver version by Teemu Suutari <temisu@utu.fi>
+ */
+
+/*-
+   *** This is contest-version. Don't look any further, code is *very* ugly.
+ */
+
+
+#if 0
+/* commented out since xlockmore does not support (yet) double buffering */
+#ifdef HAVE_XDBE_EXTENSION
+#include <X11/extensions/Xdbe.h>
+#endif /* HAVE_XDBE_EXTENSION */
+#endif
+
+#ifdef STANDALONE
+#define PROGCLASS "kumppa"
+#define HACK_INIT init_kumppa
+#define HACK_DRAW draw_kumppa
+#define kumppa_opts xlockmore_opts
+#define DEFAULTS "*delay: 0 \n" \
+ "*cycles: 1000 \n" \
+ ".background: black\n",\
+ "*speed: 0.1",\
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_kumppa
+
+#define DEF_COSILINES "True"
+#define DEF_SPEED "0.1"
+
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+#define DEF_USEDOUBLE "False"
+
+static Bool usedouble;
+
+#endif /* HAVE_XDBE_EXTENSION */
+#endif
+
+static Bool cosilines;
+static float speed;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-speed", (char *) ".kumppa.speed", XrmoptionSepArg, (caddr_t) NULL},
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+       {(char *) "-dbuf", (char *) ".kumppa.dbuf", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+dbuf", (char *) ".kumppa.dbuf", XrmoptionNoArg, (caddr_t) "off"},
+#endif                         /* HAVE_XDBE_EXTENSION */
+#endif
+       {(char *) "-rrandom", (char *) ".kumppa.rrandom", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+rrandom", (char *) ".kumppa.rrandom", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & speed, (char *) "speed", (char *) "speed", (char *) DEF_SPEED, t_Float},
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+       {(caddr_t *) & usedouble, (char *) "dbuf", (char *) "dbuf", (char *) DEF_USEDOUBLE, t_Bool},
+#endif                         /* HAVE_XDBE_EXTENSION */
+#endif
+       {(caddr_t *) & cosilines, (char *) "rrandom", (char *) "rrandom", (char *) DEF_COSILINES, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-speed num", (char *) "Speed"},
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+       {(char *) "-/+dbuf", (char *) "turn on/off double buffering"},
+#endif                         /* HAVE_XDBE_EXTENSION */
+#endif
+       {(char *) "-/+rrandom", (char *) "turn on/off random"}
+};
+
+ModeSpecOpt kumppa_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   kumppa_description =
+{"kumppa", "init_kumppa", "draw_kumppa", "release_kumppa",
+ "init_kumppa", "init_kumppa", NULL, &kumppa_opts,
+ 10000, 1, 1000, 1, 64, 1.0, "",
+ "Shows Kumppa", 0, NULL};
+
+#endif
+
+static const unsigned char colors[96] =
+{0, 0, 255, 0, 51, 255, 0, 102, 255, 0, 153, 255, 0, 204, 255,
+ 0, 255, 255, 0, 255, 204, 0, 255, 153, 0, 255, 102, 0, 255, 51,
+ 0, 255, 0, 51, 255, 0, 102, 255, 0, 153, 255, 0, 204, 255, 0,
+ 255, 255, 0, 255, 204, 0, 255, 153, 0, 255, 102, 0, 255, 51, 0,
+ 255, 0, 0, 255, 0, 51, 255, 0, 102, 255, 0, 153, 255, 0, 204,
+ 255, 0, 255, 219, 0, 255, 182, 0, 255, 146, 0, 255, 109, 0, 255,
+ 73, 0, 255, 37, 0, 255};
+
+static const float cosinus[8][6] =
+{
+       {-0.07, 0.12, -0.06, 32, 25, 37},
+       {0.08, -0.03, 0.05, 51, 46, 32},
+       {0.12, 0.07, -0.13, 27, 45, 36},
+       {0.05, -0.04, -0.07, 36, 27, 39},
+       {-0.02, -0.07, 0.1, 21, 43, 42},
+       {-0.11, 0.06, 0.02, 51, 25, 34},
+       {0.04, -0.15, 0.02, 42, 32, 25},
+       {-0.02, -0.04, -0.13, 34, 20, 15}};
+
+static const float acosinus[24] =
+{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const int   ocoords[8] =
+{0, 0, 0, 0, 0, 0, 0, 0};
+
+typedef struct {
+       Colormap    cmap;
+       float      *acosinus;
+       unsigned long blackpixel, whitepixel, fg, bg;
+       int         coords[8];
+       int         ocoords[8];
+
+       GC          fgc[33];
+       GC          cgc;
+       int         sizx, sizy;
+       int         midx, midy;
+
+       int        *Xrotations;
+       int        *Yrotations;
+       int        *Xrottable;
+       int        *Yrottable;
+
+       int        *rotateX;
+       int        *rotateY;
+
+       int         rotsizeX, rotsizeY;
+       int         stateX, stateY;
+       int         dir, time;
+       int         rx, ry;
+       int         c;
+       long        c1;
+       Bool        cosilines;
+       ModeInfo   *mi;
+} kumppastruct;
+
+static kumppastruct *kumppas = NULL;
+
+
+
+static int
+Satnum(int maxi)
+{
+       return (int) (maxi * ((double) NRAND(2500) / 2500.0));
+}
+
+
+static void
+palaRotate(ModeInfo * mi, int x, int y)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         ax, ay, bx, by, cx, cy;
+       kumppastruct *s = &kumppas[MI_SCREEN(mi)];
+
+       ax = s->rotateX[x];
+       ay = s->rotateY[y];
+       bx = s->rotateX[x + 1] + 2;
+       by = s->rotateY[y + 1] + 2;
+       cx = s->rotateX[x] + (x - s->rx) - s->dir * (y - s->ry);
+       cy = s->rotateY[y] + s->dir * (x - s->rx) + (y - s->ry);
+       if (cx < 0) {
+               ax -= cx;
+               cx = 0;
+       }
+       if (cy < 0) {
+               ay -= cy;
+               cy = 0;
+       }
+       if (cx + bx - ax > s->sizx)
+               bx = ax - cx + s->sizx;
+       if (cy + by - ay > s->sizy)
+               by = ay - cy + s->sizy;
+       if (ax < bx && ay < by) {
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XCopyArea(display, window, window, s->cgc, ax, ay, bx - ax, by - ay, cx, cy);
+               } else {
+                       XCopyArea(display, window, window, MI_GC(mi), ax, ay, bx - ax, by - ay, cx, cy);
+               }
+       }
+}
+
+
+static void
+rotate(ModeInfo * mi)
+{
+       int         x, y;
+       int         dx, dy;
+       kumppastruct *s = &kumppas[MI_SCREEN(mi)];
+
+       s->rx = s->Xrottable[s->stateX + 1] - s->Xrottable[s->stateX];
+       s->ry = s->Yrottable[s->stateX + 1] - s->Yrottable[s->stateY];
+
+
+       for (x = 0; x <= s->rx; x++)
+               s->rotateX[x] = (x) ? s->midx - 1 - s->Xrotations[s->Xrottable[s->stateX + 1] - x] : 0;
+       for (x = 0; x <= s->rx; x++)
+               s->rotateX[x + s->rx + 1] = (x == s->rx) ? s->sizx - 1 : s->midx + s->Xrotations[s->Xrottable[s->stateX] + x];
+       for (y = 0; y <= s->ry; y++)
+               s->rotateY[y] = (y) ? s->midy - 1 - s->Yrotations[s->Yrottable[s->stateY + 1] - y] : 0;
+       for (y = 0; y <= s->ry; y++)
+               s->rotateY[y + s->ry + 1] = (y == s->ry) ? s->sizy - 1 : s->midy + s->Yrotations[s->Yrottable[s->stateY] + y];
+
+       x = (s->rx > s->ry) ? s->rx : s->ry;
+       for (dy = 0; dy < (x + 1) << 1; dy++)
+               for (dx = 0; dx < (x + 1) << 1; dx++) {
+                       y = (s->rx > s->ry) ? s->ry - s->rx : 0;
+                       if (dy + y >= 0 && dy < (s->ry + 1) << 1 && dx < (s->rx + 1) << 1)
+                               if (dy + y + dx <= s->ry + s->rx && dy + y - dx <= s->ry - s->rx) {
+                                       palaRotate(mi, (s->rx << 1) + 1 - dx, dy + y);
+                                       palaRotate(mi, dx, (s->ry << 1) + 1 - dy - y);
+                               }
+                       y = (s->ry > s->rx) ? s->rx - s->ry : 0;
+                       if (dy + y >= 0 && dx < (s->ry + 1) << 1 && dy < (s->rx + 1) << 1)
+                               if (dy + y + dx <= s->ry + s->rx && dx - dy - y >= s->ry - s->rx) {
+                                       palaRotate(mi, dy + y, dx);
+                                       palaRotate(mi, (s->rx << 1) + 1 - dy - y, (s->ry << 1) + 1 - dx);
+                               }
+               }
+       s->stateX++;
+       if (s->stateX == s->rotsizeX)
+               s->stateX = 0;
+       s->stateY++;
+       if (s->stateY == s->rotsizeY)
+               s->stateY = 0;
+}
+
+static void
+free_kumppa(Display *display, kumppastruct *s)
+{
+       ModeInfo *mi = s->mi;
+
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               int i;
+
+               MI_WHITE_PIXEL(mi) = s->whitepixel;
+               MI_BLACK_PIXEL(mi) = s->blackpixel;
+#ifndef STANDALONE
+               MI_FG_PIXEL(mi) = s->fg;
+               MI_BG_PIXEL(mi) = s->bg;
+#endif
+               if (s->fgc[32] != None) {
+                       XFreeGC(display, s->fgc[32]);
+                       s->fgc[32] = None;
+               }
+#if 0
+               if (mono_p) {
+                       if (s->fgc[1] != None) {
+                               XFreeGC(display, s->fgc[1]);
+                               s->fgc[1] = None;
+                       }
+               } else
+#endif
+               for (i = 0; i < 32; i++) {
+                       if (s->fgc[i] != None) {
+                               XFreeGC(display, s->fgc[i]);
+                               s->fgc[i] = None;
+                       }
+               }
+               if (s->cgc != None) {
+                       XFreeGC(display, s->cgc);
+                       s->cgc = None;
+               }
+               if (s->cmap != None) {
+                       XFreeColormap(display, s->cmap);
+                       s->cmap = None;
+               }
+       }
+       if (s->acosinus != NULL) {
+               (void) free((void *) s->acosinus);
+               s->acosinus = NULL;
+       }
+       if (s->Xrotations != NULL) {
+               (void) free((void *) s->Xrotations);
+               s->Xrotations = NULL;
+       }
+       if (s->Yrotations != NULL) {
+               (void) free((void *) s->Yrotations);
+               s->Yrotations = NULL;
+       }
+       if (s->Xrottable != NULL) {
+               (void) free((void *) s->Xrottable);
+               s->Xrottable = NULL;
+       }
+       if (s->Yrottable != NULL) {
+               (void) free((void *) s->Yrottable);
+               s->Yrottable = NULL;
+       }
+       if (s->rotateX != NULL) {
+               (void) free((void *) s->rotateX);
+               s->rotateX = NULL;
+       }
+       if (s->rotateY != NULL) {
+               (void) free((void *) s->rotateY);
+               s->rotateY = NULL;
+       }
+}
+
+static void
+make_rots(ModeInfo * mi, double xspeed, double yspeed)
+{
+       int         a, b, c, f, g, j, k = 0, l;
+       double      m, om, ok;
+       double      d, ix, iy;
+       int         maxi;
+       kumppastruct *s = &kumppas[MI_SCREEN(mi)];
+
+       Bool       *chks;
+
+       s->rotsizeX = (int) (2 / xspeed + 1);
+       ix = (double) (s->midx + 1) / (double) (s->rotsizeX);
+       s->rotsizeY = (int) (2 / yspeed + 1);
+       iy = (double) (s->midy + 1) / (double) (s->rotsizeY);
+
+       if (s->Xrotations != NULL)
+               (void) free((void *) s->Xrotations);
+       if (s->Yrotations != NULL)
+               (void) free((void *) s->Yrotations);
+       if (s->Xrottable != NULL)
+               (void) free((void *) s->Xrottable);
+       if (s->Yrottable != NULL)
+               (void) free((void *) s->Yrottable);
+
+       if (((s->Xrotations = (int *) calloc((s->midx + 2),
+                       sizeof (int))) == NULL) ||
+           ((s->Yrotations = (int *) calloc((s->midy + 2),
+                       sizeof (int))) == NULL) ||
+           ((s->Xrottable = (int *) malloc((s->rotsizeX + 1) *
+                       sizeof (int))) == NULL) ||
+           ((s->Yrottable = (int *) malloc((s->rotsizeY + 1) *
+                       sizeof (int))) == NULL) ||
+           ((chks = (Bool *) malloc(((s->midx > s->midy) ? s->midx : s->midy) *
+                       sizeof (Bool))) == NULL)) {
+               free_kumppa(MI_DISPLAY(mi), s);
+               return; 
+       }
+
+
+       maxi = 0;
+       c = 0;
+       d = 0;
+       g = 0;
+       for (a = 0; a < s->midx; a++)
+               chks[a] = True;
+       for (a = 0; a < s->rotsizeX; a++) {
+               s->Xrottable[a] = c;
+               f = (int) (d + ix) - g;         /*viivojen lkm. */
+               g += f;
+               if (g > s->midx) {
+                       f -= g - s->midx;
+                       g = s->midx;
+               }
+               for (b = 0; b < f; b++) {
+                       m = 0;
+                       for (j = 0; j < s->midx; j++) {         /*testi */
+                               if (chks[j]) {
+                                       om = 0;
+                                       ok = 1;
+                                       l = 0;
+                                       while (j + l < s->midx && om + 12 * ok > m) {
+                                               if (j - l >= 0) {
+                                                       if (chks[j - l])
+                                                               om += ok;
+                                               } else if (chks[l - j])
+                                                       om += ok;
+                                               if (chks[j + l])
+                                                       om += ok;
+                                               ok /= 1.5;
+                                               l++;
+                                       }
+                                       if (om >= m) {
+                                               k = j;
+                                               m = om;
+                                       }
+                               }
+                       }
+                       chks[k] = False;
+                       l = c;
+                       while (l >= s->Xrottable[a]) {
+                               if (l != s->Xrottable[a])
+                                       s->Xrotations[l] = s->Xrotations[l - 1];
+                               if (k > s->Xrotations[l] || l == s->Xrottable[a]) {
+                                       s->Xrotations[l] = k;
+                                       c++;
+                                       l = s->Xrottable[a];
+                               }
+                               l--;
+                       }
+               }
+               d += ix;
+               if (maxi < c - s->Xrottable[a])
+                       maxi = c - s->Xrottable[a];
+       }
+       s->Xrottable[a] = c;
+       if (s->rotateX)
+               (void) free((void *) s->rotateX);
+       if ((s->rotateX = (int *) calloc((maxi + 2) << 1,
+                       sizeof (int))) == NULL) {
+               free_kumppa(MI_DISPLAY(mi), s);
+               (void) free((void *) chks);
+               return; 
+       }
+
+       maxi = 0;
+       c = 0;
+       d = 0;
+       g = 0;
+       for (a = 0; a < s->midy; a++)
+               chks[a] = True;
+       for (a = 0; a < s->rotsizeY; a++) {
+               s->Yrottable[a] = c;
+               f = (int) (d + iy) - g;         /*viivojen lkm. */
+               g += f;
+               if (g > s->midy) {
+                       f -= g - s->midy;
+                       g = s->midy;
+               }
+               for (b = 0; b < f; b++) {
+                       m = 0;
+                       for (j = 0; j < s->midy; j++) {         /*testi */
+                               if (chks[j]) {
+                                       om = 0;
+                                       ok = 1;
+                                       l = 0;
+                                       while (j + l < s->midy && om + 12 * ok > m) {
+                                               if (j - l >= 0) {
+                                                       if (chks[j - l])
+                                                               om += ok;
+                                               } else if (chks[l - j])
+                                                       om += ok;
+                                               if (chks[j + l])
+                                                       om += ok;
+                                               ok /= 1.5;
+                                               l++;
+                                       }
+                                       if (om >= m) {
+                                               k = j;
+                                               m = om;
+                                       }
+                               }
+                       }
+                       chks[k] = False;
+                       l = c;
+                       while (l >= s->Yrottable[a]) {
+                               if (l != s->Yrottable[a])
+                                       s->Yrotations[l] = s->Yrotations[l - 1];
+                               if (k > s->Yrotations[l] || l == s->Yrottable[a]) {
+                                       s->Yrotations[l] = k;
+                                       c++;
+                                       l = s->Yrottable[a];
+                               }
+                               l--;
+                       }
+
+               }
+               d += iy;
+               if (maxi < c - s->Yrottable[a])
+                       maxi = c - s->Yrottable[a];
+       }
+       s->Yrottable[a] = c;
+       if (s->rotateY)
+               (void) free((void *) s->rotateY);
+       if ((s->rotateY = (int *) calloc((maxi + 2) << 1,
+                       sizeof (int))) == NULL) {
+               free_kumppa(MI_DISPLAY(mi), s);
+               /* (void) free((void *) chks); */
+               /* return; */
+       }
+
+       (void) free((void *) chks);
+}
+
+
+void
+init_kumppa(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       XGCValues   xgcv;
+       int         n, i;
+       double      rspeed;
+       kumppastruct *s;
+
+       if (kumppas == NULL) {
+               if ((kumppas = (kumppastruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (kumppastruct))) == NULL)
+                       return;
+       }
+       s = &kumppas[MI_SCREEN(mi)];
+       s->mi = mi;
+
+       if (!s->acosinus) {
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XColor      color;
+
+#ifndef STANDALONE
+                       extern char *background;
+                       extern char *foreground;
+
+                       s->fg = MI_FG_PIXEL(mi);
+                       s->bg = MI_BG_PIXEL(mi);
+#endif
+                       s->blackpixel = MI_BLACK_PIXEL(mi);
+                       s->whitepixel = MI_WHITE_PIXEL(mi);
+                       if ((s->cmap = XCreateColormap(display, window,
+                                       MI_VISUAL(mi), AllocNone)) == None) {
+                               free_kumppa(display, s);
+                               return;
+                       }
+
+                       XSetWindowColormap(display, window, s->cmap);
+                       (void) XParseColor(display, s->cmap, "black", &color);
+                       (void) XAllocColor(display, s->cmap, &color);
+                       MI_BLACK_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, s->cmap, "white", &color);
+                       (void) XAllocColor(display, s->cmap, &color);
+                       MI_WHITE_PIXEL(mi) = color.pixel;
+#ifndef STANDALONE
+                       (void) XParseColor(display, s->cmap, background, &color);
+                       (void) XAllocColor(display, s->cmap, &color);
+                       MI_BG_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, s->cmap, foreground, &color);
+                       (void) XAllocColor(display, s->cmap, &color);
+                       MI_FG_PIXEL(mi) = color.pixel;
+#endif
+
+                       xgcv.function = GXcopy;
+                       xgcv.foreground = MI_BLACK_PIXEL(mi);
+                       if ((s->fgc[32] = XCreateGC(display, window,
+                                       GCForeground | GCFunction,
+                                       &xgcv)) == None) {
+                               free_kumppa(display, s);
+                               return;
+                       }
+
+                       n = 0;
+#if 0
+                       if (mono_p) {
+                               s->fgc[0] = s->fgc[32];
+                               xgcv.foreground = MI_BLACK_PIXEL(mi);
+                               if ((s->fgc[1] = XCreateGC(display, window,
+                                               GCForeground | GCFunction,
+                                               &xgcv)) == None) {
+                                       free_kumppa(display, s);
+                                       return;
+                               }
+                               for (i = 0; i < 32; i += 2)
+                                       s->fgc[i] = s->fgc[0];
+                               for (i = 1; i < 32; i += 2)
+                                       s->fgc[i] = s->fgc[1];
+                       } else
+#endif
+                               for (i = 0; i < 32; i++) {
+                                       color.red = colors[n++] * 256;
+                                       color.green = colors[n++] * 256;
+                                       color.blue = colors[n++] * 256;
+                                       color.flags = DoRed | DoGreen | DoBlue;
+                                       (void) XAllocColor(display, s->cmap, &color);
+                                       xgcv.foreground = color.pixel;
+                                       if ((s->fgc[i] = XCreateGC(display, window,
+                                                       GCForeground | GCFunction,
+                                                       &xgcv)) == None) {
+                                               free_kumppa(display, s);
+                                               return;
+                                       }
+                               }
+                       xgcv.foreground = MI_BLACK_PIXEL(mi);
+                       xgcv.function = GXcopy;
+                       if ((s->cgc = XCreateGC(display, window,
+                                       GCForeground | GCFunction,
+                                       &xgcv)) == None) {
+                               free_kumppa(display, s);
+                               return;
+                       }
+               }
+               if ((s->acosinus = (float *) malloc(24 *
+                               sizeof (float))) == NULL) {
+                       free_kumppa(display, s);
+                       return;
+               }
+               (void) memcpy(s->acosinus, acosinus, 24 * sizeof (float));
+               (void) memcpy(s->ocoords, ocoords, 8 * sizeof (int));
+       }
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               if (NRAND(2) == 1)
+                       s->cosilines = False;
+               else
+                       s->cosilines = True;
+       } else {
+               s->cosilines = cosilines;
+       }
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               XInstallColormap(display, s->cmap);
+               XSetGraphicsExposures(display, s->cgc, False);
+       } else {
+               XSetGraphicsExposures(display, MI_GC(mi), False);
+               s->c1 = NRAND(MI_NPIXELS(mi));
+       }
+       s->time = MI_CYCLES(mi) + NRAND(MI_CYCLES(mi));
+
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+       if (get_string_resource("dbuf", "String") != NULL && get_string_resource("dbuf", "String")[0] != 0)
+               usedouble = True;
+       if (usedouble) {
+               XdbeQueryExtension(display, &n, &i);
+               if (n == 0 && i == 0) {
+                       (void) fprintf(stderr, "Double buffer extension not supported!\n");
+                       usedouble = False;
+               }
+       }
+       if (usedouble)
+               win[1] = XdbeAllocateBackBufferName(display, win[0], XdbeUndefined);
+#endif /* HAVE_XDBE_EXTENSION */
+#endif
+
+       rspeed = (double) speed;
+       if (rspeed < 0.0001 || rspeed > 0.2) {
+               (void) fprintf(stderr,
+                  "Speed not in valid range! (0.0001 - 0.2), using 0.1 \n");
+               rspeed = 0.1;
+       }
+       s->sizx = MI_WIDTH(mi);
+       s->sizy = MI_HEIGHT(mi);
+       s->midx = s->sizx >> 1;
+       s->midy = s->sizy >> 1;
+       s->stateX = 0;
+       s->stateY = 0;
+       s->c = 0;
+       s->dir = (LRAND() & 1) ? -1 : 1;
+       MI_CLEARWINDOW(mi);
+
+       make_rots(mi, rspeed, rspeed);
+}
+
+
+void
+draw_kumppa(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc;
+
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+       XdbeSwapInfo xdswp;
+
+#endif /* HAVE_XDBE_EXTENSION */
+#endif
+       int         a, b, e;
+       float       f;
+       kumppastruct *s;
+
+       if (kumppas == NULL)
+               return;
+       s = &kumppas[MI_SCREEN(mi)];
+       if (s->Xrotations == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+       if (usedouble) {
+               xdswp.swap_action = XdbeUndefined;
+               xdswp.swap_window = win[0];
+       } else
+#endif /* HAVE_XDBE_EXTENSION */
+               win[1] = win[0];
+#endif
+
+       if (s->cosilines) {
+               s->c++;
+               for (a = 0; a < 8; a++) {
+                       f = 0;
+                       for (b = 0; b < 3; b++) {
+                               s->acosinus[a * 3 + b] += cosinus[a][b];
+                               f += cosinus[a][b + 3] *
+                                       sin((double) s->acosinus[a * 3 + b]);
+                       }
+                       s->coords[a] = (int) f;
+               }
+               for (a = 0; a < 4; a++) {
+                       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+#if 0
+                               gc = (mono_p) ? s->fgc[1] : s->fgc[((a << 2) + s->c) & 31];
+#endif
+                               gc = s->fgc[((a << 2) + s->c) & 31];
+                       } else {
+                               gc = MI_GC(mi);
+                               if (MI_NPIXELS(mi) <= 2)
+                                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                               else
+                                       XSetForeground(display, gc, MI_PIXEL(mi, ((((a << 2) + s->c) & 31) * MI_NPIXELS(mi) / 32) % MI_NPIXELS(mi)));
+                       }
+                       XDrawLine(display, window, gc,
+                                 s->midx + s->ocoords[a << 1], s->midy + s->ocoords[(a << 1) + 1],
+                                 s->midx + s->coords[a << 1], s->midy + s->coords[(a << 1) + 1]);
+                       s->ocoords[a << 1] = s->coords[a << 1];
+                       s->ocoords[(a << 1) + 1] = s->coords[(a << 1) + 1];
+               }
+
+       } else {
+               for (e = 0; e < 8; e++) {
+                       a = Satnum(50);
+                       if (a >= 32)
+                               a = 32;
+                       b = Satnum(32) - 16 + s->midx;
+                       s->c = Satnum(32) - 16 + s->midy;
+                       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                               gc = s->fgc[a];
+                       } else {
+                               gc = MI_GC(mi);
+                               if (a == 32)
+                                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               else if (MI_NPIXELS(mi) > 2)
+                                       XSetForeground(display, gc, MI_PIXEL(mi, (a * MI_NPIXELS(mi) / 32) % MI_NPIXELS(mi)));
+                               else if (a == 0)
+                                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               else
+                                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                       }
+                       XFillRectangle(display, window, gc, b, s->c, 2, 2);
+               }
+       }
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               gc = s->fgc[32];
+       } else {
+               gc = MI_GC(mi);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       }
+       XFillRectangle(display, window, gc, s->midx - 2, s->midy - 2, 4, 4);
+       rotate(mi);
+#if 0
+#ifdef HAVE_XDBE_EXTENSION
+       if (usedouble)
+               XdbeSwapBuffers(display, &xdswp, 1);
+#endif /* HAVE_XDBE_EXTENSION */
+#endif
+       if (--s->time <= 0) {
+               s->time = MI_CYCLES(mi) + NRAND(MI_CYCLES(mi));
+               s->dir = s->dir * (-1);
+       }
+}
+
+void
+release_kumppa(ModeInfo * mi)
+{
+
+       if (kumppas != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_kumppa(MI_DISPLAY(mi), &kumppas[screen]);
+               (void) free((void *) kumppas);
+               kumppas = NULL;
+       }
+}
+
+#endif /* MODE_kumppa */
diff --git a/modes/laser.c b/modes/laser.c
new file mode 100644 (file)
index 0000000..37c7d64
--- /dev/null
@@ -0,0 +1,361 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* laser --- spinning lasers */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)laser.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 Pascal Pensa <pensa@aurora.unice.fr>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 1995: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Laser"
+#define HACK_INIT init_laser
+#define HACK_DRAW draw_laser
+#define laser_opts xlockmore_opts
+#define DEFAULTS "*delay: 20000 \n" \
+ "*count: -10 \n" \
+ "*cycles: 200 \n" \
+ "*ncolors: 200 \n"
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_laser
+
+ModeSpecOpt laser_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   laser_description =
+{"laser", "init_laser", "draw_laser", "release_laser",
+ "refresh_laser", "init_laser", NULL, &laser_opts,
+ 20000, -10, 200, 1, 64, 1.0, "",
+ "Shows spinning lasers", 0, NULL};
+
+#endif
+
+#define MINREDRAW 3            /* Number of redrawn on each frame */
+#define MAXREDRAW 8
+
+#define MINLASER  1            /* Laser number */
+
+#define MINWIDTH  2            /* Laser ray width range */
+#define MAXWIDTH 40
+
+#define MINSPEED  2            /* Speed range */
+#define MAXSPEED 17
+
+#define MINDIST  10            /* Minimal distance from edges */
+
+#define COLORSTEP 2            /* Laser color step */
+
+#define RANGE_RAND(min,max) (int) ((min) + LRAND() % ((max) - (min)))
+
+typedef enum {
+       TOP, RIGHT, BOTTOM, LEFT
+} border;
+
+typedef struct {
+       int         bx;         /* border x */
+       int         by;         /* border y */
+       border      bn;         /* active border */
+       int         dir;        /* direction */
+       int         speed;      /* laser velocity from MINSPEED to MAXSPEED */
+       int         sx[MAXWIDTH];       /* x stack */
+       int         sy[MAXWIDTH];       /* x stack */
+       XGCValues   gcv;        /* for color */
+} laserstruct;
+
+typedef struct {
+       int         width;
+       int         height;
+       int         cx;         /* center x */
+       int         cy;         /* center y */
+       int         lw;         /* laser width */
+       int         ln;         /* laser number */
+       int         lr;         /* laser redraw */
+       int         sw;         /* stack width */
+       int         so;         /* stack offset */
+       int         time;       /* up time */
+       GC          stippledGC;
+       XGCValues   gcv_black;  /* for black color */
+       laserstruct *laser;
+} lasersstruct;
+
+static lasersstruct *lasers = NULL;
+
+static void
+free_laser(Display *display, lasersstruct *lp)
+{
+       if (lp->laser != NULL) {
+               (void) free((void *) lp->laser);
+               lp->laser = NULL;
+       }
+       if (lp->stippledGC != None) {
+               XFreeGC(display, lp->stippledGC);
+               lp->stippledGC = None;
+       }
+}
+
+void
+init_laser(ModeInfo * mi)
+{
+       Display *display = MI_DISPLAY(mi);
+       int         i, c = 0;
+       lasersstruct *lp;
+
+       if (lasers == NULL) {
+               if ((lasers = (lasersstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (lasersstruct))) == NULL)
+                       return;
+       }
+       lp = &lasers[MI_SCREEN(mi)];
+
+       lp->width = MI_WIDTH(mi);
+       lp->height = MI_HEIGHT(mi);
+       lp->time = 0;
+
+       lp->ln = MI_COUNT(mi);
+       if (lp->ln < -MINLASER) {
+               /* if lp->ln is random ... the size can change */
+               if (lp->laser != NULL) {
+                       (void) free((void *) lp->laser);
+                       lp->laser = NULL;
+               }
+               lp->ln = NRAND(-lp->ln - MINLASER + 1) + MINLASER;
+       } else if (lp->ln < MINLASER)
+               lp->ln = MINLASER;
+
+       if (lp->laser == NULL) {
+               if ((lp->laser = (laserstruct *) malloc(lp->ln *
+                               sizeof (laserstruct))) == NULL) {
+                       free_laser(display, lp);
+                       return;
+               }
+       }
+       if (lp->stippledGC == None) {
+               XGCValues   gcv;
+
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               lp->gcv_black.foreground = MI_BLACK_PIXEL(mi);
+               if ((lp->stippledGC = XCreateGC(display, MI_WINDOW(mi),
+                               GCForeground | GCBackground, &gcv)) == None) {
+                       free_laser(display, lp);
+                       return;
+               }
+       }
+       MI_CLEARWINDOW(mi);
+
+       if (MINDIST < lp->width - MINDIST)
+               lp->cx = RANGE_RAND(MINDIST, lp->width - MINDIST);
+       else
+               lp->cx = RANGE_RAND(0, lp->width);
+       if (MINDIST < lp->height - MINDIST)
+               lp->cy = RANGE_RAND(MINDIST, lp->height - MINDIST);
+       else
+               lp->cy = RANGE_RAND(0, lp->height);
+       lp->lw = RANGE_RAND(MINWIDTH, MAXWIDTH);
+       lp->lr = RANGE_RAND(MINREDRAW, MAXREDRAW);
+       lp->sw = 0;
+       lp->so = 0;
+
+       if (MI_NPIXELS(mi) > 2)
+               c = NRAND(MI_NPIXELS(mi));
+
+       for (i = 0; i < lp->ln; i++) {
+               laserstruct *l = &lp->laser[i];
+
+               l->bn = (border) NRAND(4);
+
+               switch (l->bn) {
+                       case TOP:
+                               l->bx = NRAND(lp->width);
+                               l->by = 0;
+                               break;
+                       case RIGHT:
+                               l->bx = lp->width;
+                               l->by = NRAND(lp->height);
+                               break;
+                       case BOTTOM:
+                               l->bx = NRAND(lp->width);
+                               l->by = lp->height;
+                               break;
+                       case LEFT:
+                               l->bx = 0;
+                               l->by = NRAND(lp->height);
+               }
+
+               l->dir = (int) (LRAND() & 1);
+               l->speed = ((RANGE_RAND(MINSPEED, MAXSPEED) * lp->width) / 1000) + 1;
+               if (MI_NPIXELS(mi) > 2) {
+                       l->gcv.foreground = MI_PIXEL(mi, c);
+                       c = (c + COLORSTEP) % MI_NPIXELS(mi);
+               } else
+                       l->gcv.foreground = MI_WHITE_PIXEL(mi);
+       }
+}
+
+static void
+draw_laser_once(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       lasersstruct *lp = &lasers[MI_SCREEN(mi)];
+       int         i;
+
+       for (i = 0; i < lp->ln; i++) {
+               laserstruct *l = &lp->laser[i];
+
+               if (lp->sw >= lp->lw) {
+                       XChangeGC(display, lp->stippledGC, GCForeground, &(lp->gcv_black));
+                       XDrawLine(display, MI_WINDOW(mi), lp->stippledGC,
+                                 lp->cx, lp->cy,
+                                 l->sx[lp->so], l->sy[lp->so]);
+               }
+               if (l->dir) {
+                       switch (l->bn) {
+                               case TOP:
+                                       l->bx -= l->speed;
+                                       if (l->bx < 0) {
+                                               l->by = -l->bx;
+                                               l->bx = 0;
+                                               l->bn = LEFT;
+                                       }
+                                       break;
+                               case RIGHT:
+                                       l->by -= l->speed;
+                                       if (l->by < 0) {
+                                               l->bx = lp->width + l->by;
+                                               l->by = 0;
+                                               l->bn = TOP;
+                                       }
+                                       break;
+                               case BOTTOM:
+                                       l->bx += l->speed;
+                                       if (l->bx >= lp->width) {
+                                               l->by = lp->height - l->bx % lp->width;
+                                               l->bx = lp->width;
+                                               l->bn = RIGHT;
+                                       }
+                                       break;
+                               case LEFT:
+                                       l->by += l->speed;
+                                       if (l->by >= lp->height) {
+                                               l->bx = l->by % lp->height;
+                                               l->by = lp->height;
+                                               l->bn = BOTTOM;
+                                       }
+                       }
+               } else {
+                       switch (l->bn) {
+                               case TOP:
+                                       l->bx += l->speed;
+                                       if (l->bx >= lp->width) {
+                                               l->by = l->bx % lp->width;
+                                               l->bx = lp->width;
+                                               l->bn = RIGHT;
+                                       }
+                                       break;
+                               case RIGHT:
+                                       l->by += l->speed;
+                                       if (l->by >= lp->height) {
+                                               l->bx = lp->width - l->by % lp->height;
+                                               l->by = lp->height;
+                                               l->bn = BOTTOM;
+                                       }
+                                       break;
+                               case BOTTOM:
+                                       l->bx -= l->speed;
+                                       if (l->bx < 0) {
+                                               l->by = lp->height + l->bx;
+                                               l->bx = 0;
+                                               l->bn = LEFT;
+                                       }
+                                       break;
+                               case LEFT:
+                                       l->by -= l->speed;
+                                       if (l->by < 0) {
+                                               l->bx = -l->bx;
+                                               l->by = 0;
+                                               l->bn = TOP;
+                                       }
+                       }
+               }
+
+               XChangeGC(display, lp->stippledGC, GCForeground, &l->gcv);
+               XDrawLine(display, MI_WINDOW(mi), lp->stippledGC,
+                         lp->cx, lp->cy, l->bx, l->by);
+
+               l->sx[lp->so] = l->bx;
+               l->sy[lp->so] = l->by;
+
+       }
+
+       if (lp->sw < lp->lw)
+               ++lp->sw;
+
+       lp->so = (lp->so + 1) % lp->lw;
+}
+
+void
+draw_laser(ModeInfo * mi)
+{
+       int         i;
+       lasersstruct *lp;
+
+       if (lasers == NULL)
+               return;
+       lp = &lasers[MI_SCREEN(mi)];
+       if (lp->laser == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       for (i = 0; i < lp->lr; i++)
+               draw_laser_once(mi);
+
+       if (++lp->time > MI_CYCLES(mi))
+               init_laser(mi);
+}
+
+void
+release_laser(ModeInfo * mi)
+{
+       if (lasers != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_laser(MI_DISPLAY(mi), &lasers[screen]);
+               (void) free((void *) lasers);
+               lasers = NULL;
+       }
+}
+
+void
+refresh_laser(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_laser */
diff --git a/modes/life.c b/modes/life.c
new file mode 100644 (file)
index 0000000..93d65d2
--- /dev/null
@@ -0,0 +1,3301 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* life --- Conway's game of Life */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)life.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ * Copyright (c) 1997 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 03-Oct-2000: Added more randomness in pattern 90 degree orientation and
+ *              mirror image.
+ * 08-Dec-1997: Paul Callahan's B2a/S2b34 rule added.
+ *              Described on the news site for cellular-automata.
+ *              <ppc997@aber.ac.uk>
+ *   http://www.cs.jhu.edu/~callahan/lifepage.html
+ *   http://www.cs.jhu.edu/~callahan/hexrule.txt
+ *   B2a/S2b34: Birth of x if 2a,
+ *     Survival of x if 2b, 3, or 4 neighbors
+ *     Assume symmetry.
+ *     (2a, 2b, 2c: 2o, 2m, 2p original notation)
+ *           O O            O .            O .
+ *     2a:  . x .     2b:  . x O     2c:  . x .
+ *           . .            . .            . O
+ *     Also Bob Andreen's rule (my own notation for consistency)
+ *     B2a3a4b/S2a2b4a (original notation: 234'B/22'4S)
+ *     <andreen@msmc.edu>
+ *           O O            O O            O .
+ *     3a:  . x O     3b:  . x .     3c:  . x O
+ *           . .            . O            O .
+ *
+ *           O O            O O            O O
+ *     4a:  . x O     4b:  . x O     4c:  . x .
+ *           . O            O .            O O
+ *     Some other rules
+ *     B2a3b3c5/S12b2c3a4b4c6
+ *     B23a3c4b4c6/S12b2c3c4a56
+ *     B2a2c6/S13b
+ * 27-Oct-1997: xpm and ras capability added.
+ * 04-Jun-1997: Removed old algorithm, now use wator's.  I could not
+ *              understand it and had trouble adding more features.
+ *              New algorithm is more efficient iff there lots of blank
+ *              areas (ptr loop rather than a double array loop)
+ * 10-May-1997: Compatible with xscreensaver
+ * 07-May-1997: life neighbor option.  Still have to fix -neighbor 3
+ * 07-Jan-1995: life now has a random soup pattern.
+ * 07-Dec-1994: life now has new organisms.  They are now better centered.
+ *              Some of the nonperiodic forms were removed. New life
+ *              forms were taken from xlife (an AMAZING collection of life
+ *              forms).  life's gliders now come from the edge of the screen
+ *              except when generated by a life form.
+ * 23-Nov-1994: Bug fix for different iconified window sizes
+ * 21-Jul-1994: Took out bzero & bcopy since memset & memcpy is more portable
+ * 10-Jun-1994: Changed name of function 'kill', which is a libc function on
+ *              many systems from Victor Langeveld <vic@mbfys.kun.nl>
+ * Changes in original xlock
+ * 24-May-1991: Added wraparound code from johnson@bugs.comm.mot.com.
+ *              Made old cells stay blue.
+ *              Made batchcount control the number of generations until restart.
+ * 29-Jul-1990: support for multiple screens.
+ * 07-Feb-1990: remove bogus semi-colon after #include line.
+ * 15-Dec-1989: Fix for proper skipping of {White,Black}Pixel() in colors.
+ * 08-Oct-1989: Moved seconds() to an extern.
+ * 20-Sep-1989: Written, life algorithm courtesy of Jim Graham <flar@sun.com>
+ */
+
+/*-
+  Grid     Number of Neighbors
+  ----     ------------------
+  Square   4 or 8
+  Hexagon  6
+  Triangle 3, 9, or 12
+
+  Conway's Life: -neighbors 8 -rule S23/B3
+  Other things to try:
+    -neighbors 4 -rule S234/B2
+    -neighbors 6 -rule S23/B3
+    -neighbors 3 -rule S12/B23
+    -neighbors 6 -rule S2b34/B2a     <CALLAHAN>
+    -neighbors 6 -rule S2a2b4a/B2b3a4b  <ANDREEN>
+*/
+
+#ifdef STANDALONE
+#define PROGCLASS "Life"
+#define HACK_INIT init_life
+#define HACK_DRAW draw_life
+#define life_opts xlockmore_opts
+#define DEFAULTS "*delay: 750000 \n" \
+ "*count: 40 \n" \
+ "*cycles: 140 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 200 \n" \
+ "*bitmap: \n" \
+ "*neighbors: 0 \n" \
+ "*verbose: False \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+#include "iostuff.h"
+#include "automata.h"
+
+#ifdef MODE_life
+
+/*-
+ * neighbors of 0 does not randomize.  All inappropriate
+ * modes will be set at 8.  3, 6, 9, & 12 also available.
+ */
+#define DEF_NEIGHBORS  "0"      /* choose best value (8) */
+
+#if 1
+#define DEF_RULE  "G"          /* All rules with known gliders */
+#else
+#define DEF_RULE  "P"          /* All rules with known patterns */
+#define DEF_RULE  "S23/B3"     /* "B3/S23" */
+#define DEF_RULE  "S2b34/B2a"  /* CALLAHAN */
+#define DEF_RULE  "S2a2b4a/B2b3a4b"    /* ANDREEN */
+#endif
+
+#define DEF_CALLAHAN  "FALSE"
+#define DEF_ANDREEN  "FALSE"
+
+static int  neighbors;
+static char *rule;
+static char *lifefile;
+static Bool callahan;
+static Bool andreen;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".life.neighbors", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-rule", (char *) ".life.rule", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-lifefile", (char *) ".life.lifefile", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-callahan", (char *) ".life.callahan", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+callahan", (char *) ".life.callahan", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-andreen", (char *) ".life.andreen", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+andreen", (char *) ".life.andreen", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int},
+       {(caddr_t *) & rule, (char *) "rule", (char *) "Rule", (char *) DEF_RULE, t_String},
+       {(caddr_t *) & lifefile, (char *) "lifefile", (char *) "LifeFile", (char *) "", t_String},
+  {(caddr_t *) & callahan, (char *) "callahan", (char *) "Callahan", (char *) DEF_CALLAHAN, t_Bool},
+       {(caddr_t *) & andreen, (char *) "andreen", (char *) "Andreen", (char *) DEF_ANDREEN, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3, 9 or 12"},
+       {(char *) "-rule string", (char *) "S<survival_neighborhood>/B<birth_neighborhood> parameters"},
+       {(char *) "-lifefile file", (char *) "life file"},
+       {(char *) "-/+callahan", (char *) "turn on/off Callahan's hex rule B2a/S2b34"},
+       {(char *) "-/+andreen", (char *) "turn on/off Andreen's hex rule B2a3a4b/S2a2m4a"}
+};
+
+ModeSpecOpt life_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   life_description =
+{"life", "init_life", "draw_life", "release_life",
+ "refresh_life", "change_life", NULL, &life_opts,
+ 750000, 40, 140, 0, 64, 1.0, "",
+ "Shows Conway's game of Life", 0, NULL};
+
+#endif
+
+/* aliases for vars defined in the bitmap file */
+#define CELL_WIDTH   image_width
+#define CELL_HEIGHT    image_height
+#define CELL_BITS    image_bits
+
+#include "life.xbm"
+#ifdef XBM_GRELB
+#include "life2.xbm"
+#define CELL2_WIDTH   image2_width
+#define CELL2_HEIGHT  image2_height
+#define CELL2_BITS    image2_bits
+static XImage bimage =
+{
+  0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1
+};
+#endif
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define CELL_NAME image_name
+#if 1
+static char *image_name[] =
+{(char *) ""};
+#else
+/* Kind of boring... */
+#include "life.xpm"
+#endif
+#define DEFAULT_XPM 0
+#endif
+
+#define REDRAWSTEP 2000                /* How many cells to draw per cycle */
+#define MINGRIDSIZE 20
+#define MINSIZE 4
+#define MAXNEIGHBORS 12
+#define MAXGROUPS 3            /* Eventually this may be MAXNEIGHBORS - 3 */
+#define FIRSTGROUP 2           /* Need at least 2 to make a group */
+#define MAXCOUNTNEIGHBORS 9    /* This restriction is because of base 10 */
+#define NEIGHBORKINDS 6
+#define DEAD 0
+#define LIVE 1
+#define STATES 2
+
+#define SetList(c,r) if (!setcell(mi,c,r,LIVE)) return
+
+typedef struct {
+       long        position;
+       unsigned short age;
+       unsigned char state;
+       unsigned char toggle;
+} cellstruct;
+
+/* Singly linked list */
+typedef struct _CellList {
+       cellstruct  info;
+       struct _CellList *previous, *next;
+} CellList;
+
+typedef struct {
+       int         survival, birth;
+       int         survival_group[MAXGROUPS];
+       int         birth_group[MAXGROUPS];
+} paramstruct;
+
+typedef struct {
+       Bool        painted;
+       paramstruct param;
+       int         pattern, patterned_rule;
+       int         pixelmode;
+       int         generation;
+       int         xs, ys, xb, yb;     /* cell size, grid border */
+       int         nrows, ncols, npositions;
+       int         width, height;
+       int         state;
+       int         redrawing, redrawpos;
+       int         ncells[STATES];
+       CellList   *last[STATES], *first[STATES];
+       CellList  **arr;
+       union {
+               XPoint      hexagon[6];
+               XPoint      triangle[2][3];
+       } shape;
+       XImage     *logo;
+#ifdef XBM_GRELB
+       XImage     *logo2;
+#endif
+       Colormap    cmap;
+       unsigned long black;
+       int         graphics_format;
+       GC          backGC;
+       int neighbors;
+       int callahan, andreen;
+       int allPatterns, allGliders;
+       paramstruct input_param;
+
+} lifestruct;
+
+static lifestruct *lifes = NULL;
+
+static char *filePattern = NULL;
+
+static char plots[NEIGHBORKINDS] =
+{
+       3, 4, 6, 8, 9, 12       /* Neighborhoods */
+};
+
+static char maxgroups[NEIGHBORKINDS] =
+{0, 0, 3, 0, 0, 0};
+static char groupnumber[NEIGHBORKINDS][MAXGROUPS] =
+{
+       {0, 0, 0},              /* Triangular */
+       {0, 0, 0},              /* Future improvement */
+       {3, 3, 3},              /* Hexagonal */
+       {0, 0, 0},              /* Maxgroup will expand... */
+       {0, 0, 0},              /* Future improvement */
+       {0, 0, 0}               /* Future improvement */
+};
+
+static char style6[64] =
+{0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0,
+ 0, 1, 2, 1, 1, 2, 1, 1, 0, 1, 1, 2, 0, 1, 0, 0,
+ 0, 0, 1, 0, 2, 1, 1, 0, 1, 1, 2, 1, 1, 2, 1, 0,
+ 0, 0, 1, 0, 1, 1, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0};
+
+
+#define NUMPTS  64
+#define NUMFILEPTS  (2*NUMPTS)
+
+/*-
+ * Patterns have < NUMPTS pts (and should have a size of <= 32x32,
+ * the Glider Gun is an exception)
+ */
+static char patterns_8S23B3[][2 * NUMPTS + 1] =
+{
+       {                       /* GLIDER GUN */
+               6, -4,
+               5, -3, 6, -3,
+               -6, -2, -5, -2, 8, -2, 9, -2, 16, -2,
+               -7, -1, 8, -1, 9, -1, 10, -1, 16, -1, 17, -1,
+               -18, 0, -17, 0, -8, 0, 8, 0, 9, 1,
+               -17, 1, -8, 1, 5, 1, 6, 1,
+               -8, 2, 6, 2,
+               -7, 3,
+               -6, 4, -5, 4,
+               127
+       },
+       {                       /* SHOWER TUB (PART OF OSCILATORS) */
+               -3, -6, -2, -6, 2, -6, 3, -6,
+               -4, -5, -2, -5, 2, -5, 4, -5,
+               -4, -4, 4, -4,
+               -7, -3, -6, -3, -4, -3, -3, -3, 3, -3, 4, -3, 6, -3, 7, -3,
+               -7, -2, -6, -2, -4, -2, 0, -2, 4, -2, 6, -2, 7, -2,
+               -4, -1, -2, -1, 2, -1, 4, -1,
+               -4, 0, -2, 0, 2, 0, 4, 0,
+               -5, 1, -4, 1, -2, 1, 2, 1, 4, 1, 5, 1,
+               -4, 2, -1, 2, 0, 2, 1, 2, 4, 2,
+               -4, 3, 4, 3, 6, 3,
+               -3, 4, -2, 4, -1, 4, 5, 4, 6, 4,
+               -1, 5,
+               127
+       },
+       {                       /* P4 LARGE TOASTER */
+               -5, -3, -4, -3, -2, -3, 2, -3, 4, -3, 5, -3,
+               -5, -2, 5, -2,
+               -4, -1, -3, -1, 3, -1, 4, -1,
+       -7, 0, -6, 0, -5, 0, -2, 0, -1, 0, 0, 0, 1, 0, 2, 0, 5, 0, 6, 0, 7, 0,
+               -7, 1, -4, 1, 4, 1, 7, 1,
+               -6, 2, -5, 2, 5, 2, 6, 2,
+               127
+       },
+       {                       /* STARGATE REPEATER P3 */
+               0, -6,
+               -1, -5, 1, -5,
+               -2, -4, 0, -4, 2, -4,
+               -2, -3, 2, -3,
+               -4, -2, -3, -2, 0, -2, 3, -2, 4, -2,
+               -5, -1, 0, -1, 5, -1,
+               -6, 0, -4, 0, -2, 0, -1, 0, 1, 0, 2, 0, 4, 0, 6, 0,
+               -5, 1, 0, 1, 5, 1,
+               -4, 2, -3, 2, 0, 2, 3, 2, 4, 2,
+               -2, 3, 2, 3,
+               -2, 4, 0, 4, 2, 4,
+               -1, 5, 1, 5,
+               0, 6,
+               127
+       },
+       {                       /* OSCILLATOR 7 (P8) */
+               -4, -2, -3, -2, -2, -2, -1, -2, 4, -2, 5, -2, 6, -2, 7, -2,
+               -9, -1, -8, -1, 0, -1, 8, -1,
+               -9, 0, -8, 0, -5, 0, -4, 0, 0, 0, 3, 0, 4, 0, 8, 0,
+               -5, 1, -4, 1, -1, 1, 3, 1, 4, 1, 7, 1,
+               127
+       },
+       {                       /* P144 */
+               -14, -9, -13, -9, 12, -9, 13, -9,
+               -14, -8, -13, -8, 12, -8, 13, -8,
+               4, -7, 5, -7,
+               3, -6, 6, -6,
+               4, -5, 5, -5,
+               -1, -3, 0, -3, 1, -3,
+               -1, -2, 1, -2,
+               -1, -1, 0, -1, 1, -1,
+               -1, 0, 0, 0,
+               -2, 1, -1, 1, 0, 1,
+               -2, 2, 0, 2,
+               -2, 3, -1, 3, 0, 3,
+               -6, 5, -5, 5,
+               -7, 6, -4, 6,
+               -6, 7, -5, 7,
+               -14, 8, -13, 8, 12, 8, 13, 8,
+               -14, 9, -13, 9, 12, 9, 13, 9,
+               127
+       },
+       {                       /* FIGURE EIGHT */
+               -3, -3, -2, -3, -1, -3,
+               -3, -2, -2, -2, -1, -2,
+               -3, -1, -2, -1, -1, -1,
+               0, 0, 1, 0, 2, 0,
+               0, 1, 1, 1, 2, 1,
+               0, 2, 1, 2, 2, 2,
+               127
+       },
+       {                       /* PULSAR 18-22-20 */
+               0, -4, 1, -4, 2, -4,
+               -1, -2, 4, -2,
+               -2, -1, 0, -1, 4, -1,
+               -4, 0, -3, 0, -2, 0, 1, 0, 4, 0,
+               2, 1,
+               0, 2, 1, 2,
+               0, 3,
+               0, 4,
+               127
+       },
+       {                       /* PULSAR 48-56-72 */
+               -2, -1, -1, -1, 0, -1, 1, -1, 2, -1,
+               -2, 0, 2, 0,
+               127
+       },
+       {                       /* BARBER POLE P2 */
+               -6, -6, -5, -6,
+               -6, -5, -4, -5,
+               -4, -3, -2, -3,
+               -2, -1, 0, -1,
+               0, 1, 2, 1,
+               2, 3, 4, 3,
+               5, 4,
+               4, 5, 5, 5,
+               127
+       },
+       {                       /* ACHIM P5 */
+               -6, -6, -5, -6,
+               -6, -5,
+               -4, -4,
+               -4, -3, -2, -3,
+               -2, -1, 0, -1,
+               0, 1, 2, 1,
+               2, 3, 3, 3,
+               5, 4,
+               4, 5, 5, 5,
+               127
+       },
+       {                       /* HERTZ P4 */
+               -2, -5, -1, -5,
+               -2, -4, -1, -4,
+               -7, -2, -6, -2, -2, -2, -1, -2, 0, -2, 1, -2, 5, -2, 6, -2,
+               -7, -1, -5, -1, -3, -1, 2, -1, 4, -1, 6, -1,
+               -5, 0, -3, 0, -2, 0, 2, 0, 4, 0,
+               -6, 1, -5, 1, -3, 1, 2, 1, 4, 1, 5, 1,
+               -2, 2, -1, 2, 0, 2, 1, 2,
+               -2, 4, -1, 4,
+               -2, 5, -1, 5,
+               127
+       },
+       {                       /* PUMP (TUMBLER, P14) */
+               -2, -3, -1, -3, 1, -3, 2, -3,
+               -2, -2, -1, -2, 1, -2, 2, -2,
+               -1, -1, 1, -1,
+               -3, 0, -1, 0, 1, 0, 3, 0,
+               -3, 1, -1, 1, 1, 1, 3, 1,
+               -3, 2, -2, 2, 2, 2, 3, 2,
+               127
+       },
+       {                       /* SMILEY (P8) */
+               -3, -3, -2, -3, -1, -3, 1, -3, 2, -3, 3, -3,
+               -2, -2, 0, -2, 2, -2,
+               -2, 0, 2, 0,
+               -3, 2, -1, 2, 1, 2, 3, 2,
+               -1, 3, 1, 3,
+               127
+       },
+       {                       /* PULSE1 P4 */
+               0, -3, 1, -3,
+               -2, -2, 0, -2,
+               -3, -1, 3, -1,
+               -2, 0, 2, 0, 3, 0,
+               0, 2, 2, 2,
+               1, 3,
+               127
+       },
+       {                       /* SHINING FLOWER P5 */
+               -1, -4, 0, -4,
+               -2, -3, 1, -3,
+               -3, -2, 2, -2,
+               -4, -1, 3, -1,
+               -4, 0, 3, 0,
+               -3, 1, 2, 1,
+               -2, 2, 1, 2,
+               -1, 3, 0, 3,
+               127
+       },
+       {                       /* PULSE2 P6 */
+               0, -4, 1, -4,
+               -4, -3, -3, -3, -1, -3,
+               -4, -2, -3, -2, 0, -2, 3, -2,
+               1, -1, 3, -1,
+               2, 0,
+               1, 2, 2, 2,
+               1, 3, 2, 3,
+               127
+       },
+       {                       /* PINWHEEL P4 */
+               -2, -6, -1, -6,
+               -2, -5, -1, -5,
+               -2, -3, -1, -3, 0, -3, 1, -3,
+               -3, -2, -1, -2, 2, -2, 4, -2, 5, -2,
+               -3, -1, 1, -1, 2, -1, 4, -1, 5, -1,
+               -6, 0, -5, 0, -3, 0, 0, 0, 2, 0,
+               -6, 1, -5, 1, -3, 1, 2, 1,
+               -2, 2, -1, 2, 0, 2, 1, 2,
+               0, 4, 1, 4,
+               0, 5, 1, 5,
+               127
+       },
+       {                       /* CLOCK P4 */
+               -2, -6, -1, -6,
+               -2, -5, -1, -5,
+               -2, -3, -1, -3, 0, -3, 1, -3,
+               -6, -2, -5, -2, -3, -2, 0, -2, 2, -2,
+               -6, -1, -5, -1, -3, -1, -1, -1, 2, -1,
+               -3, 0, -1, 0, 2, 0, 4, 0, 5, 0,
+               -3, 1, 2, 1, 4, 1, 5, 1,
+               -2, 2, -1, 2, 0, 2, 1, 2,
+               0, 4, 1, 4,
+               0, 5, 1, 5,
+               127
+       },
+       {                       /* CROSS P3 */
+               -2, -4, -1, -4, 0, -4, 1, -4,
+               -2, -3, 1, -3,
+               -4, -2, -3, -2, -2, -2, 1, -2, 2, -2, 3, -2,
+               -4, -1, 3, -1,
+               -4, 0, 3, 0,
+               -4, 1, -3, 1, -2, 1, 1, 1, 2, 1, 3, 1,
+               -2, 2, 1, 2,
+               -2, 3, -1, 3, 0, 3, 1, 3,
+               127
+       },
+       {                       /* BIG CROSS P3 */
+               0, -5,
+               -1, -4, 0, -4, 1, -4,
+               -3, -3, -2, -3, -1, -3, 1, -3, 2, -3, 3, -3,
+               -3, -2, 3, -2,
+               -4, -1, -3, -1, 3, -1, 4, -1,
+               -5, 0, -4, 0, 4, 0, 5, 0,
+               -4, 1, -3, 1, 3, 1, 4, 1,
+               -3, 2, 3, 2,
+               -3, 3, -2, 3, -1, 3, 1, 3, 2, 3, 3, 3,
+               -1, 4, 0, 4, 1, 4,
+               0, 5,
+               127
+       },
+       {                       /* P4 DIAG SYM */
+               -2, -4, 0, -4,
+               -2, -3, 0, -3, 2, -3, 3, -3,
+               -4, -2, -3, -2, 2, -2,
+               0, -1, 1, -1, 2, -1,
+               -4, 0, -3, 0, -1, 0, 2, 0,
+               -1, 1, 2, 1,
+               -3, 2, -2, 2, -1, 2, 0, 2, 1, 2,
+               -3, 3,
+               127
+       },
+       {                       /* P4 ASYM */
+               -4, -4, -2, -4,
+               -4, -3, -1, -3,
+               -1, -2,
+               -2, -1, -1, -1, 0, -1, 3, -1, 4, -1, 5, -1,
+               -5, 0, -4, 0, -3, 0, 0, 0, 1, 0, 2, 0,
+               1, 1,
+               1, 2, 4, 2,
+               2, 3, 4, 3,
+               127
+       },
+       {                       /* P4 ASYM 2 */
+               -3, -3, -1, -3, 2, -3, 4, -3, 5, -3, 6, -3,
+               -4, -2, -1, -2, 1, -2, 3, -2, 5, -2,
+               -4, -1,
+               3, 0,
+               -6, 1, -4, 1, -2, 1, 0, 1, 3, 1,
+               -7, 2, -6, 2, -5, 2, -3, 2, 0, 2, 2, 2,
+               127
+       },
+       {                       /* P8 ASYM */
+               -3, -4, -2, -4,
+               -4, -3,
+               -3, -2, 1, -2,
+               -3, -1, 1, -1, 2, -1,
+               -1, 0, 1, 0,
+               -2, 1, -1, 1, 3, 1,
+               -1, 2, 3, 2,
+               4, 3,
+               2, 4, 3, 4,
+               127
+       },
+       {                       /* P4 SYM */
+               -6, -2, -5, -2, 4, -2, 5, -2,
+               -6, -1, -5, -1, -3, -1, -2, -1, 1, -1, 2, -1, 4, -1, 5, -1,
+               -5, 0, -2, 0, 1, 0, 4, 0,
+               -5, 1, -4, 1, -2, 1, -1, 1, 0, 1, 1, 1, 3, 1, 4, 1,
+               127
+       },
+       {                       /* QUESTION P3 NOSYM */
+               -2, -4, -1, -4, 0, -4,
+               2, -3,
+               -3, -2, 2, -2,
+               1, -1,
+               -2, 0, -1, 0,
+               -2, 1,
+               -2, 2,
+               -2, 3,
+               127
+       },
+       {                       /* WHIRLY THING P12 */
+               -5, -6,
+               -5, -5, -4, -5, -3, -5, 5, -5, 6, -5,
+               -2, -4, 5, -4,
+               -3, -3, -2, -3, 3, -3, 5, -3,
+               3, -2, 4, -2,
+               0, -1, 1, -1,
+               0, 0, 1, 0,
+               0, 1, 1, 1,
+               -4, 2, -3, 2,
+               -5, 3, -3, 3, 2, 3, 3, 3,
+               -5, 4, 2, 4,
+               -6, 5, -5, 5, 3, 5, 4, 5, 5, 5,
+               5, 6,
+               127
+       },
+       {                       /* PENTADECATHOLON P15 */
+            -5, 0, -4, 0, -3, 0, -2, 0, -1, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0,
+               127
+       },
+       {                       /* BALLOON P5 */
+               -1, -3, 0, -3,
+               -3, -2, 2, -2,
+               -3, -1, 2, -1,
+               -3, 0, 2, 0,
+               -2, 1, 1, 1,
+               -4, 2, -2, 2, 1, 2, 3, 2,
+               -4, 3, -3, 3, 2, 3, 3, 3,
+               127
+       },
+       {                       /* FENCEPOST P12 */
+               -11, -3, -9, -3, -7, -3,
+        -11, -2, -9, -2, -7, -2, 5, -2, 6, -2, 7, -2, 9, -2, 10, -2, 11, -2,
+               -11, -1, -7, -1, -3, -1, 1, -1, 8, -1,
+         -10, 0, -8, 0, -3, 0, -2, 0, -1, 0, 1, 0, 5, 0, 6, 0, 10, 0, 11, 0,
+               -11, 1, -7, 1, -3, 1, 1, 1, 8, 1,
+               -11, 2, -9, 2, -7, 2, 5, 2, 6, 2, 7, 2, 9, 2, 10, 2, 11, 2,
+               -11, 3, -9, 3, -7, 3,
+               127
+       },
+       {                       /* PISTON (SHUTTLE) P30 */
+               1, -3, 2, -3,
+               0, -2,
+               -10, -1, -1, -1,
+               -11, 0, -10, 0, -1, 0, 9, 0, 10, 0,
+               -1, 1, 9, 1,
+               0, 2,
+               1, 3, 2, 3,
+               127
+       },
+       {                       /* P30 */
+               -8, -5, 7, -5,
+               -9, -4, -7, -4, 1, -4, 2, -4, 6, -4, 8, -4,
+               -8, -3, 0, -3, 1, -3, 2, -3, 7, -3,
+               1, -2, 2, -2,
+               1, 2, 2, 2,
+               -8, 3, 0, 3, 1, 3, 2, 3, 7, 3,
+               -9, 4, -7, 4, 1, 4, 2, 4, 6, 4, 8, 4,
+               -8, 5, 7, 5,
+               127
+       },
+       {                       /* PISTON2 P46 */
+               -3, -5,
+               -14, -4, -13, -4, -4, -4, -3, -4, 13, -4, 14, -4,
+               -14, -3, -13, -3, -5, -3, -4, -3, 13, -3, 14, -3,
+               -4, -2, -3, -2, 0, -2, 1, -2,
+               -4, 2, -3, 2, 0, 2, 1, 2,
+               -14, 3, -13, 3, -5, 3, -4, 3, 13, 3, 14, 3,
+               -14, 4, -13, 4, -4, 4, -3, 4, 13, 4, 14, 4,
+               -3, 5,
+               127
+       },
+       {                       /* GEARS (gear, flywheel, blinker) P2 */
+               -1, -4,
+               -1, -3, 1, -3,
+               -3, -2,
+               2, -1, 3, -1,
+               -4, 0, -3, 0,
+               2, 1,
+               -2, 2, 0, 2,
+               0, 3,
+
+               5, 3,
+               3, 4, 4, 4,
+               5, 5, 6, 5,
+               4, 6,
+
+               8, 0,
+               8, 1,
+               8, 2,
+               127
+       },
+       {                       /* TURBINE8, KOK'S GALAXY */
+               -4, -4, -3, -4, -2, -4, -1, -4, 0, -4, 1, -4, 3, -4, 4, -4,
+               -4, -3, -3, -3, -2, -3, -1, -3, 0, -3, 1, -3, 3, -3, 4, -3,
+               3, -2, 4, -2,
+               -4, -1, -3, -1, 3, -1, 4, -1,
+               -4, 0, -3, 0, 3, 0, 4, 0,
+               -4, 1, -3, 1, 3, 1, 4, 1,
+               -4, 2, -3, 2,
+               -4, 3, -3, 3, -1, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3,
+               -4, 4, -3, 4, -1, 4, 0, 4, 1, 4, 2, 4, 3, 4, 4, 4,
+               127
+       },
+       {                       /* P16 */
+               -3, -6, 1, -6, 2, -6,
+               -3, -5, 0, -5, 3, -5,
+               3, -4,
+               -5, -3, -4, -3, 1, -3, 2, -3, 5, -3, 6, -3,
+               -6, -2, -3, -2,
+               -6, -1, -3, -1,
+               -5, 0, 5, 0,
+               3, 1, 6, 1,
+               3, 2, 6, 2,
+               -6, 3, -5, 3, -2, 3, -1, 3, 4, 3, 5, 3,
+               -3, 4,
+               -3, 5, 0, 5, 3, 5,
+               -2, 6, -1, 6, 3, 6,
+               127
+       },
+       {                       /* P28 (FLUTTER) */
+               -9, -7, -7, -7, 7, -7, 9, -7,
+               -6, -6, 6, -6,
+               -10, -5, -7, -5, 7, -5, 10, -5,
+               -11, -4, -9, -4, -7, -4, 7, -4, 9, -4, 11, -4,
+               -11, -3, -8, -3, 8, -3, 11, -3,
+               -10, -2, -9, -2, -4, -2, -3, -2, -2, -2,
+               2, -2, 3, -2, 4, -2, 9, -2, 10, -2,
+               -3, -1, 3, -1,
+               -10, 1, -9, 1, 9, 1, 10, 1,
+               -11, 2, -8, 2, 8, 2, 11, 2,
+               -11, 3, -9, 3, -6, 3, 6, 3, 9, 3, 11, 3,
+               -10, 4, 10, 4,
+               -9, 5, -8, 5, -6, 5, 6, 5, 8, 5, 9, 5,
+               -7, 6, 7, 6,
+               127
+       },
+       {                       /* P54 (PISTON3) */
+               -14, -8, -13, -8, 13, -8, 14, -8,
+               -13, -7, 13, -7,
+               -13, -6, -11, -6, 11, -6, 13, -6,
+               -12, -5, -11, -5, -1, -5, 11, -5, 12, -5,
+               0, -4,
+               -6, -3, -5, -3, 1, -3,
+               -6, -2, -5, -2, -2, -2, 0, -2,
+               -1, -1,
+               -1, 1,
+               -6, 2, -5, 2, -2, 2, 0, 2,
+               -6, 3, -5, 3, 1, 3,
+               0, 4,
+               -12, 5, -11, 5, -1, 5, 11, 5, 12, 5,
+               -13, 6, -11, 6, 11, 6, 13, 6,
+               -13, 7, 13, 7,
+               -14, 8, -13, 8, 13, 8, 14, 8,
+               127
+       },
+       {                       /* P88 PI OSCILLATOR (OSC88) */
+               6, -12,
+               4, -11, 5, -11, 6, -11,
+               3, -10,
+               3, -9, 4, -9,
+               -13, -8, -12, -8, 8, -8, 9, -8,
+               -12, -7, 8, -7,
+               -12, -6, -10, -6, 6, -6, 8, -6,
+               -11, -5, -10, -5, 6, -5, 7, -5,
+               0, -3, 1, -3, 2, -3,
+               0, -2, 2, -2,
+               0, -1, 2, -1,
+               -7, 5, -6, 5, 10, 5, 11, 5,
+               -8, 6, -6, 6, 10, 6, 12, 6,
+               -8, 7, 12, 7,
+               -9, 8, -8, 8, 12, 8, 13, 8,
+               -4, 9, -3, 9,
+               -3, 10,
+               -6, 11, -5, 11, -4, 11,
+               -6, 12,
+               127
+       },
+       {                       /* AK47 (ALMOST A GUN) */
+               -12, -6, -11, -6,
+               -12, -5, -11, -5,
+               11, -4, 12, -4,
+               11, -3,
+               3, -2, 4, -2, 5, -2, 9, -2, 11, -2,
+               2, -1, 6, -1, 9, -1, 10, -1,
+               -10, 0, -9, 0, 1, 0, 7, 0,
+               -11, 1, -9, 1, 1, 1, 7, 1,
+               -11, 2, 1, 2, 7, 2,
+               -12, 3, -11, 3, 2, 3, 6, 3,
+               3, 4, 4, 4, 5, 4, 11, 4, 12, 4,
+               11, 5, 12, 5,
+               127
+       },
+       {                       /* SWITCH ENGINE */
+               -12, -3, -10, -3,
+               -13, -2,
+               -12, -1, -9, -1,
+               -10, 0, -9, 0, -8, 0,
+               13, 2, 14, 2,
+               13, 3,
+               127
+       },
+       {                       /* PUFFER TRAIN */
+               1, -9,
+               2, -8,
+               -2, -7, 2, -7,
+               -1, -6, 0, -6, 1, -6, 2, -6,
+               -2, -2,
+               -1, -1, 0, -1,
+               0, 0,
+               0, 1,
+               -1, 2,
+               1, 5,
+               2, 6,
+               -2, 7, 2, 7,
+               -1, 8, 0, 8, 1, 8, 2, 8,
+               127
+       },
+       {                       /* SCHOOL OF FISH (ESCORT) */
+               3, -8,
+               4, -7,
+               -2, -6, 4, -6,
+               -1, -5, 0, -5, 1, -5, 2, -5, 3, -5, 4, -5,
+               -5, -1, -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
+               1, -1, 2, -1, 3, -1, 4, -1, 5, -1, 6, -1,
+               -6, 0, 6, 0,
+               6, 1,
+               5, 2,
+               3, 4,
+               4, 5,
+               -2, 6, 4, 6,
+               -1, 7, 0, 7, 1, 7, 2, 7, 3, 7, 4, 7,
+
+               127
+       },
+       {                       /* DART SPEED 1/3 */
+               3, -7,
+               2, -6, 4, -6,
+               1, -5, 2, -5,
+               4, -4,
+               0, -3, 4, -3,
+               -3, -2, 0, -2,
+               -4, -1, -2, -1, 1, -1, 2, -1, 3, -1, 4, -1,
+               -5, 0, -2, 0,
+               -4, 1, -2, 1, 1, 1, 2, 1, 3, 1, 4, 1,
+               -3, 2, 0, 2,
+               0, 3, 4, 3,
+               4, 4,
+               1, 5, 2, 5,
+               2, 6, 4, 6,
+               3, 7,
+               127
+       },
+       {                       /* PERIOD 4 SPEED 1/2 */
+               -3, -5,
+               -4, -4, -3, -4, -2, -4, -1, -4, 0, -4,
+               -5, -3, -4, -3, 0, -3, 1, -3, 3, -3,
+               -4, -2, 4, -2,
+               -3, -1, -2, -1, 1, -1, 3, -1,
+               -3, 1, -2, 1, 1, 1, 3, 1,
+               -4, 2, 4, 2,
+               -5, 3, -4, 3, 0, 3, 1, 3, 3, 3,
+               -4, 4, -3, 4, -2, 4, -1, 4, 0, 4,
+               -3, 5,
+               127
+       },
+       {                       /* ANOTHER PERIOD 4 SPEED 1/2 */
+               -4, -7, -3, -7, -1, -7, 0, -7, 1, -7, 2, -7, 3, -7, 4, -7,
+               -5, -6, -4, -6, -3, -6, -2, -6, 5, -6,
+               -6, -5, -5, -5,
+               -5, -4, 5, -4,
+               -4, -3, -3, -3, -2, -3, 0, -3,
+               -2, -2,
+               -2, -1,
+               -1, 0,
+               -2, 1,
+               -2, 2,
+               -4, 3, -3, 3, -2, 3, 0, 3,
+               -5, 4, 5, 4,
+               -6, 5, -5, 5,
+               -5, 6, -4, 6, -3, 6, -2, 6, 5, 6,
+               -4, 7, -3, 7, -1, 7, 0, 7, 1, 7, 2, 7, 3, 7, 4, 7,
+               127
+       },
+       {                       /* SMALLEST KNOWN PERIOD 3 SPACESHIP SPEED 1/3 */
+               0, -8,
+               -1, -7, 1, -7,
+               -1, -6, 1, -6,
+               -1, -5,
+               -2, -3, -1, -3,
+               -1, -2, 1, -2,
+               -2, -1, 0, -1,
+               -2, 0, -1, 0, 0, 0,
+               -1, 2, 1, 2,
+               -1, 3, 0, 3,
+               0, 4,
+               0, 5, 2, 5,
+               0, 6, 2, 6,
+               1, 7,
+               127
+       },
+       {                       /* TURTLE SPEED 1/3 */
+               -4, -5, -3, -5, -2, -5, 6, -5,
+               -4, -4, -3, -4, 0, -4, 2, -4, 3, -4, 5, -4, 6, -4,
+               -2, -3, -1, -3, 0, -3, 5, -3,
+               -4, -2, -1, -2, 1, -2, 5, -2,
+               -5, -1, 0, -1, 5, -1,
+               -5, 0, 0, 0, 5, 0,
+               -4, 1, -1, 1, 1, 1, 5, 1,
+               -2, 2, -1, 2, 0, 2, 5, 2,
+               -4, 3, -3, 3, 0, 3, 2, 3, 3, 3, 5, 3, 6, 3,
+               -4, 4, -3, 4, -2, 4, 6, 4,
+               127
+       },
+       {                       /* SMALLEST KNOWN PERIOD 5 SPEED 2/5 */
+               1, -7, 3, -7,
+               -2, -6, 3, -6,
+               -3, -5, -2, -5, -1, -5, 4, -5,
+               -4, -4, -2, -4,
+               -5, -3, -4, -3, -1, -3, 0, -3, 5, -3,
+               -4, -2, -3, -2, 0, -2, 1, -2, 2, -2, 3, -2, 4, -2,
+               -4, 2, -3, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2,
+               -5, 3, -4, 3, -1, 3, 0, 3, 5, 3,
+               -4, 4, -2, 4,
+               -3, 5, -2, 5, -1, 5, 4, 5,
+               -2, 6, 3, 6,
+               1, 7, 3, 7,
+               127
+       },
+       {                       /* SYM PUFFER */
+               1, -4, 2, -4, 3, -4, 4, -4,
+               0, -3, 4, -3,
+               4, -2,
+               -4, -1, -3, -1, 0, -1, 3, -1,
+               -4, 0, -3, 0, -2, 0,
+               -4, 1, -3, 1, 0, 1, 3, 1,
+               4, 2,
+               0, 3, 4, 3,
+               1, 4, 2, 4, 3, 4, 4, 4,
+               127
+       },
+       {                       /* RAKE P20 BACKWARDS */
+               0, -10, 1, -10, 10, -10,
+               -1, -9, 0, -9, 1, -9, 2, -9, 11, -9,
+               -1, -8, 0, -8, 2, -8, 3, -8, 7, -8, 11, -8,
+               1, -7, 2, -7, 8, -7, 9, -7, 10, -7, 11, -7,
+               6, -3, 7, -3,
+               5, -2, 6, -2, 8, -2, 9, -2,
+               6, -1, 9, -1,
+               6, 0, 9, 0,
+               7, 1, 8, 1,
+               10, 4,
+               11, 5,
+               -8, 6, 7, 6, 11, 6,
+               -7, 7, 8, 7, 9, 7, 10, 7, 11, 7,
+               -11, 8, -7, 8,
+               -10, 9, -9, 9, -8, 9, -7, 9,
+               127
+       },
+       {                       /* RAKE P20 FORWARDS */
+               0, -10, 1, -10, 10, -10,
+               -1, -9, 0, -9, 1, -9, 2, -9, 11, -9,
+               -1, -8, 0, -8, 2, -8, 3, -8, 7, -8, 11, -8,
+               1, -7, 2, -7, 8, -7, 9, -7, 10, -7, 11, -7,
+               6, -3, 7, -3,
+               5, -2, 6, -2, 8, -2, 9, -2,
+               6, -1, 9, -1,
+               6, 0, 9, 0,
+               7, 1, 8, 1,
+               10, 4,
+               11, 5,
+               7, 6, 11, 6,
+               -9, 7, -8, 7, -7, 7, -6, 7, 8, 7, 9, 7, 10, 7, 11, 7,
+               -10, 8, -6, 8,
+               -6, 9,
+               -7, 10,
+               127
+       },
+       {                       /* RAKE P24 BACKWARDS */
+               -5, -10,
+               -4, -9,
+               -10, -8, -4, -8,
+               -9, -7, -8, -7, -7, -7, -6, -7, -5, -7, -4, -7,
+               6, -6, 7, -6,
+               5, -5, 6, -5, 7, -5, 8, -5,
+               5, -4, 6, -4, 8, -4, 9, -4,
+               7, -3, 8, -3,
+               0, -2, 2, -2,
+               -1, -1, 2, -1, 3, -1,
+               0, 0, 2, 0,
+               7, 1, 8, 1,
+               5, 2, 6, 2, 8, 2, 9, 2,
+               5, 3, 6, 3, 7, 3, 8, 3,
+               6, 4, 7, 4,
+               -5, 6, -4, 6,
+               -9, 7, -8, 7, -7, 7, -6, 7, -4, 7, -3, 7,
+               -9, 8, -8, 8, -7, 8, -6, 8, -5, 8, -4, 8,
+               -8, 9, -7, 9, -6, 9, -5, 9,
+               127
+       },
+       {                       /* BIG GLIDER 1 */
+               -4, -7, -3, -7,
+               -4, -6, -2, -6,
+               -4, -5,
+               -7, -4, -6, -4, -4, -4,
+               -7, -3, -2, -3,
+               -7, -2, -5, -2, -4, -2, 3, -2, 4, -2, 5, -2,
+               -2, -1, -1, -1, 0, -1, 5, -1, 6, -1,
+               -1, 0, 0, 0, 1, 0, 3, 0, 5, 0,
+               6, 1,
+               -1, 2, 1, 2,
+               -2, 3, -1, 3, 1, 3,
+               -1, 4,
+               -3, 5, -2, 5, 0, 5,
+               0, 6,
+               -2, 7, -1, 7,
+               127
+       },
+       {                       /* BIG GLIDER 2 */
+               0, -9, 1, -9,
+               0, -8, 2, -8,
+               0, -7,
+               1, -6, 2, -6, 3, -6,
+               1, -5, 3, -5, 4, -5, 5, -5,
+               1, -4, 4, -4, 5, -4,
+               3, -3, 5, -3, 7, -3, 8, -3,
+               2, -2, 3, -2, 5, -2, 7, -2,
+               1, -1, 2, -1, 7, -1,
+               -9, 0, -8, 0, -7, 0,
+               -9, 1, -6, 1, -5, 1, -4, 1, -1, 1, 3, 1, 4, 1,
+               -8, 2, -6, 2, -2, 2, -1, 2,
+               -6, 3, -5, 3, -3, 3, -2, 3, 1, 3,
+               -5, 4, -4, 4, 1, 4,
+               -5, 5, -4, 5, -3, 5, -2, 5,
+               -3, 7, -2, 7, -1, 7,
+               -3, 8,
+               127
+       },
+       {                       /* BIG GLIDER 3 */
+               -1, -8,
+               -2, -7, -1, -7,
+               -2, -6, 0, -6,
+               0, -4, 2, -4,
+               -2, -3, 0, -3, 2, -3,
+               -7, -2, -3, -2, -2, -2, 0, -2, 2, -2, 3, -2,
+               -8, -1, -7, -1, -6, -1, -5, -1, -2, -1, 4, -1,
+               -8, 0, -5, 0, -4, 0, -2, 0, -1, 0, 3, 0, 4, 0,
+               -6, 1, -5, 1, 0, 1,
+               -4, 2, -3, 2, 1, 2,
+               -3, 3, -2, 3, -1, 3, 2, 3, 4, 3, 5, 3, 6, 3, 7, 3,
+               -3, 4, 0, 4, 3, 4, 4, 4, 5, 4,
+               -1, 5, 0, 5, 1, 5,
+               1, 6, 2, 6, 3, 6,
+               2, 7, 3, 7,
+               127
+       },
+       {                       /* SMALL C/4 DIAGONAL SPARKER */
+               1, -11,
+               0, -10, 1, -10,
+               -2, -8, -1, -8, 0, -8,
+               -2, -7, -1, -7, 0, -7,
+               -3, -4, -2, -4, -1, -4,
+               -3, -3, -2, -3,
+               -4, -2, -1, -2, 0, -2, 1, -2, 3, -2,
+               -4, -1, -3, -1, -1, -1, 3, -1,
+               -4, 0, -3, 0, -1, 0, 0, 0, 2, 0, 3, 0,
+               -4, 1, -3, 1, -2, 1,
+               -4, 2, -3, 2,
+               -4, 3,
+               -4, 4, -3, 4,
+               -3, 5, -1, 5,
+               1, 6,
+               -1, 7, 2, 7,
+               0, 8, 3, 8,
+               0, 9,
+               3, 10,
+               1, 11, 2, 11, 3, 11,
+               127
+       },
+       {                       /* PI HEPTOMINO (], NEAR SHIP) */
+               -2, -1, -1, -1, 0, -1,
+               1, 0,
+               -2, 1, -1, 1, 0, 1,
+               127
+       },
+       {                       /* R PENTOMINO */
+               0, -1, 1, -1,
+               -1, 0, 0, 0,
+               0, 1,
+               127
+       },
+       {                       /* BUNNIES */
+               -4, -2, 2, -2,
+               -2, -1, 2, -1,
+               -2, 0, 1, 0, 3, 0,
+               -3, 1, -1, 1,
+               127
+       }
+};
+
+
+/*-
+ * This assumes Callahan's "/" notation
+ *    ABC                   A B C
+ *    DEF          ->      D E F
+ *    GHI                 G H I
+ */
+
+/* CALLAHAN */
+static char patterns_6S2b34B2a[][2 * NUMPTS + 1] =
+{
+#if 0
+       {                       /* GLIDER (P4) */
+               0, -2,
+               1, -1,
+               -2, 0, 1, 0,
+               1, 1,
+               1, 2,
+               127
+       },
+#endif
+       {                       /* 3 OSCILLATOR GLIDER GUN (P42) */
+               5, -6, 6, -6,
+               6, -5, 7, -5, 9, -5,
+               6, -4, 8, -4, 9, -4,
+               7, -3, 8, -3, 10, -3, 11, -3,
+               8, -2, 10, -2,
+               8, -1, 10, -1, 11, -1,
+               8, 0, 9, 0, 10, 0, 12, 0,
+               10, 1,
+
+               -10, -5,
+               -11, -4, -10, -4, -8, -4,
+               -12, -3, -11, -3, -9, -3, -8, -3, -7, -3,
+               -10, -2, -8, -2, -6, -2,
+               -10, -1, -9, -1, -7, -1, -6, -1, -5, -1, -4, -1,
+               -10, 0, -8, 0, -7, 0, -5, 0,
+
+               0, -1, 1, -1,
+               1, 0, 2, 0, 3, 0,
+               1, 1, 3, 1,
+               0, 2, 1, 2, 2, 2, 3, 2,
+               0, 3, 4, 3,
+               1, 4, 2, 4, 3, 4, 4, 4, 5, 4,
+               3, 5,
+               3, 6,
+               127
+       },
+       {                       /* ANOTHER GUN (P20) */
+               -2, -7, -1, -7,
+               -2, -6,
+
+               -8, -2,
+               -9, -1, -8, -1, -7, -1, -6, -1, -5, -1,
+               -8, 0, -6, 0, -5, 0,
+               -7, 1, -6, 1,
+               -8, 2, -7, 2,
+               -10, 3, -9, 3, -8, 3,
+               -8, 4,
+               -9, 5, -8, 5, -7, 5,
+               -6, 6,
+
+               4, 0,
+               3, 1, 4, 1, 5, 1, 10, 1,
+               3, 2, 4, 2, 6, 2, 7, 2, 10, 2,
+               5, 3, 6, 3, 8, 3, 9, 3, 10, 3, 11, 3,
+               7, 4, 10, 4, 12, 4,
+               11, 5,
+               127
+       },
+       {                       /* SHIP (P48) */
+               -3, -2, -1, -2,
+               -2, -1, -1, -1,
+               -2, 0, -1, 0, 0, 0, 2, 0,
+               -1, 1, 0, 1, 3, 1,
+               0, 2,
+               127
+       },
+       {                       /* SHIP (P15) */
+               -3, -5, -1, -5,
+               -2, -4, -1, -4, 0, -4,
+               -4, -3, -3, -3, -2, -3, 0, -3,
+               -2, -2, 0, -2,
+               -1, -1, 0, -1,
+               0, 1, 1, 1,
+               0, 2, 2, 2,
+               -1, 3, 0, 3, 1, 3, 3, 3,
+               2, 4, 3, 4, 4, 4,
+               2, 5, 4, 5,
+               127
+       },
+       {                       /* SHIP BY A COLLISION OF 3 GLIDERS (P15) */
+               7, -4,
+               8, -3,
+               8, -2, 10, -2,
+               -11, -1, -10, -1, 1, -1, 2, -1, 3, -1, 4, -1, 9, -1, 11, -1,
+               -9, 0, 1, 0, 10, 0,
+               -8, 1,
+               -7, 2, 5, 2,
+               -9, 3,
+               127
+       },
+       {                       /* STALK (P8) */
+               -2, -4,
+               -3, -3, -2, -3,
+               -3, -2, -1, -2, 0, -2,
+               -3, -1, -2, -1, -1, -1, 1, -1,
+               0, 0, 1, 0,
+               0, 1, 2, 1,
+               0, 2, 1, 2, 2, 2,
+               2, 3, 3, 3, 4, 3,
+               127
+       },
+       {                       /* STALK BY A COLLISION OF 3 GLIDERS */
+               -8, -9,
+               -5, -8,
+               -5, -7,
+               -5, -6,
+               -6, -5, -5, -5,
+               -3, 1,
+               -4, 2, -2, 2,
+               -3, 3, -1, 3,
+               -1, 4,
+               0, 5, 5, 5,
+               5, 6,
+               5, 7, 8, 7,
+               5, 8,
+               6, 9,
+               127
+       },
+       {                       /* STALK BY A COLLISION OF 2 GLIDERS AND EATER */
+               3, -6,
+               3, -5,
+               -5, -4, 4, -4, 7, -4,
+               -4, -3, -3, -3, 5, -3,
+               6, -2,
+               -7, 1, -6, 1,
+               -5, 2,
+               -4, 3,
+               -3, 4,
+               -5, 5,
+               127
+       },
+       {                       /* OSCILLATOR (P42) */
+               -2, -3, -1, -3,
+               -2, -2, 0, -2,
+               -3, -1, -2, -1, -1, -1, 0, -1,
+               -3, 0, 1, 0,
+               -2, 1, -1, 1, 0, 1, 1, 1, 2, 1,
+               0, 2,
+               0, 3,
+               127
+       },
+       {                       /* TENTACLE (P66) */
+               -3, -3, -2, -3,
+               -5, -2, -4, -2, -3, -2, -1, -2,
+               -5, -1, -3, -1, -1, -1,
+               -4, 0, -3, 0, -1, 0, 0, 0,
+               -4, 1, -2, 1, -1, 1, 1, 1, 3, 1,
+               0, 2, 1, 2, 3, 2, 4, 2, 5, 2,
+               2, 3, 3, 3,
+               127
+       },
+       {                       /* ROTATING OSCILLATOR (P42) */
+               0, -2, 1, -2,
+               -1, -1, 0, -1, 1, -1,
+               1, 0,
+               -2, 1, -1, 1, 0, 1, 1, 1,
+               -2, 2, -1, 2,
+               127
+       },
+       {                       /* INTERNAL OSCILLATOR (P7) */
+               -3, -6,
+               -4, -5, -3, -5,
+               -5, -4, -4, -4, -2, -4, -1, -4, 1, -4,
+               -3, -3, -1, -3, 0, -3, 1, -3,
+               -6, -2, -4, -2, -3, -2, -1, -2, 2, -2, 3, -2,
+               -5, -1, -4, -1, -2, -1, 2, -1,
+               -6, 0, -5, 0, -3, 0, -2, 0, -1, 0, 0, 0, 3, 0,
+               -4, 1, -3, 1, 1, 1, 3, 1,
+               -4, 2, -2, 2, 0, 2, 1, 2, 4, 2,
+               -4, 3, -3, 3, -2, 3, 0, 3, 1, 3, 3, 3, 4, 3, 5, 3,
+               -1, 4, 0, 4, 2, 4, 3, 4,
+               1, 5, 2, 5,
+               127
+       },
+       {                       /* OSCILLATOR (P7) */
+               -6, -7,
+               -6, -6,
+               -5, -5, -4, -5,
+               -4, -4, -3, -4, -2, -4,
+               -5, -3, -4, -3, -1, -3, 0, -3, 2, -3,
+               -5, -2, 0, -2, 1, -2, 2, -2,
+               -4, -1, 2, -1,
+               3, 0,
+               2, 1, 3, 1,
+               2, 2,
+               3, 3, 5, 3,
+               2, 4, 3, 4, 4, 4, 5, 4,
+               5, 5,
+               6, 6,
+               127
+       },
+       {                       /* OSCILLATOR (P9) */
+               -2, -6, -1, -6,
+               -4, -5, -3, -5, -2, -5, 0, -5,
+               -3, -4, -1, -4, 0, -4,
+               -3, -3, -2, -3, -1, -3, 1, -3,
+               0, -2, 1, -2,
+               0, -1,
+               -1, 0, 0, 0, 1, 0,
+               -1, 1, 2, 1,
+               -2, 2, -1, 2, 0, 2, 2, 2,
+               -2, 3, 0, 3, 3, 3,
+               -1, 4, 0, 4, 2, 4, 3, 4,
+               1, 5, 2, 5,
+               2, 6,
+               127
+       },
+       {                       /* OSCILLATOR1 (P11) */
+               -4, -5,
+               -5, -4, -4, -4,
+               -4, -3, -3, -3, -1, -3,
+               -6, -2, -5, -2, -4, -2, -2, -2, 0, -2,
+               -4, -1, -2, -1, 1, -1, 2, -1,
+               -4, 0, -3, 0, -2, 0, -1, 0, 0, 0, 1, 0, 3, 0, 4, 0, 5, 0,
+               -4, 1, 0, 1, 1, 1, 4, 1,
+               2, 2, 3, 2, 4, 2,
+               4, 3,
+               5, 4,
+               127
+       },
+       {                       /* OSCILLATOR2 (P11) */
+               -3, -3, -2, -3, 0, -3,
+               -3, -2, 0, -2, 1, -2,
+               -1, -1, 0, -1, 2, -1,
+               -3, 0, -2, 0, -1, 0, 1, 0, 2, 0,
+               -2, 1, 0, 1, 1, 1, 3, 1,
+               -1, 2, 0, 2, 2, 2, 3, 2,
+               1, 3, 2, 3,
+               127
+       },
+       {                       /* OSCILLATOR (P14) */
+               -2, -3, -1, -3, 0, -3,
+               -3, -2, -2, -2, 0, -2,
+               -3, -1, 1, -1, 2, -1,
+               -3, 0, -2, 0, 0, 0, 1, 0,
+               -1, 1, 0, 1, 2, 1, 3, 1,
+               -1, 2, 1, 2, 2, 2,
+               1, 3,
+               127
+       },
+       {                       /* OSCILLATOR (P17) */
+               -3, -6,
+               -3, -5,
+               -5, -4, -4, -4, -3, -4, -2, -4, -1, -4, 0, -4,
+               -3, -3, -1, -3, 0, -3,
+               -2, -2, -1, -2,
+               -2, 0, -1, 0, 2, 0,
+               -3, 1, -2, 1, 0, 1, 1, 1,
+               -3, 2, 0, 2, 2, 2,
+               -2, 3, -1, 3, 1, 3, 2, 3,
+               0, 4, 1, 4, 3, 4, 4, 4,
+               2, 5, 3, 5,
+               2, 6,
+               127
+       },
+       {                       /* OSCILLATOR (P18) */
+               -5, -4, -3, -4,
+               -4, -3, -3, -3, -2, -3,
+               -5, -2, -4, -2, -2, -2,
+               -6, -1, -5, -1, -3, -1, -2, -1, 0, -1, 1, -1, 2, -1, 4, -1,
+               -6, 0, -4, 0, -3, 0, -1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 6, 0,
+               -5, 1, -4, 1, -2, 1, -1, 1, 0, 1, 1, 1, 2, 1, 4, 1, 5, 1,
+               -3, 2, -2, 2, 0, 2, 2, 2, 3, 2, 4, 2, 6, 2,
+               -3, 3, -1, 3, 4, 3,
+               127
+       },
+       {                       /* OSCILLATOR (P19) */
+               -6, -4, -2, -4,
+               -7, -3, -6, -3, -3, -3, -2, -3, -1, -3, 1, -3,
+               -7, -2, -5, -2, -4, -2, -2, -2, 0, -2, 1, -2, 2, -2,
+               -6, -1, -5, -1, -3, -1, -2, -1, -1, -1, 0, -1, 1, -1, 3, -1,
+               -6, 0, -4, 0, -3, 0, 0, 0, 2, 0, 3, 0,
+               -4, 1, -2, 1, 0, 1, 1, 1, 2, 1, 4, 1, 5, 1,
+               0, 2, 1, 2, 3, 2, 4, 2, 5, 2,
+               1, 3, 2, 3, 3, 3, 6, 3,
+               3, 4,
+               127
+       },
+       {                       /* OSCILLATOR (P22) */
+               -5, -5,
+               -4, -4,
+               -6, -3, -5, -3, -4, -3, -3, -3, -2, -3,
+               -4, -2, -2, -2,
+               -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
+               -3, 0, -1, 0, 1, 0, 2, 0,
+               0, 1, 1, 1, 2, 1, 3, 1,
+               0, 2, 1, 2,
+               4, 4,
+               5, 5, 6, 5,
+               127
+       },
+       {                       /* OSCILLATOR (P26) */
+               -5, -7,
+               -5, -6, -3, -6,
+               -6, -5, -5, -5, -4, -5, -3, -5, -2, -5,
+               -5, -4, -3, -4, -1, -4, 0, -4,
+               -5, -3, -2, -3, -1, -3, 1, -3,
+               -3, -2, -2, -2, 1, -2,
+               -1, -1, 0, -1, 1, -1, 2, -1, 3, -1,
+               1, 0, 3, 0,
+               -1, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
+               -4, 2, -3, 2, -1, 2, 1, 2, 3, 2, 5, 2,
+               -2, 3, 0, 3, 1, 3, 3, 3,
+               2, 4, 3, 4, 4, 4,
+               2, 5, 5, 5,
+               5, 6,
+               127
+       },
+       {                       /* OSCILLATOR (P29) */
+               -2, -6,
+               -2, -5, -1, -5,
+               -3, -4, -2, -4, 0, -4, 1, -4,
+               -5, -3, -4, -3, -3, -3, 2, -3, 3, -3, 4, -3,
+               -4, -2, -2, -2, 2, -2, 4, -2,
+               -3, -1, -2, -1, -1, -1, 0, -1, 3, -1, 4, -1, 5, -1,
+               -5, 0, -4, 0, -3, 0, -2, 0, 1, 0, 2, 0, 3, 0,
+               -5, 1, -4, 1, -1, 1, 0, 1, 1, 1, 2, 1,
+               -4, 2, -3, 2, -2, 2, 0, 2, 2, 2,
+               -3, 3, 0, 3,
+               1, 5,
+               127
+       },
+       {                       /* OSCILLATOR (P46) */
+               -2, -4,
+               -2, -3, -1, -3, 0, -3,
+               -4, -2, -3, -2, -2, -2, 0, -2,
+               -5, -1, -3, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1,
+               -4, 0, -3, 0, -2, 0, -1, 0, 0, 0, 3, 0,
+               -3, 1, -1, 1, 1, 1, 4, 1,
+               -4, 2, -3, 2, -2, 2, -1, 2, 0, 2, 1, 2,
+               -1, 3,
+               -1, 4,
+               127
+       },
+};
+
+/* ANDREEN */
+static char patterns_6S2a2b4aB2a3a4b[][2 * NUMPTS + 1] =
+{
+#if 0
+       {                       /* 3 DIFFERENT GLIDERS */
+               -5, -9,
+               -5, -8,
+               -4, -7, -3, -7,
+               -4, -6,
+               -3, -5,
+               -1, -2,
+               -1, -1, 1, -1,
+               -1, 0, 1, 0,
+               0, 1,
+               0, 2,
+               2, 5,
+               2, 6,
+               2, 7,
+               3, 8, 5, 8,
+               3, 9,
+               127
+       },
+#endif
+       {                       /* SYMMETRIC 4 GLIDER GUN */
+               -2, -3, -1, -3, 0, -3,
+               -3, -2, -2, -2, 3, -2,
+               -2, -1, 0, -1, 1, -1,
+               -2, 0, 0, 0, 2, 0, 3, 0,
+               -1, 1,
+               -1, 2,
+               127
+       },
+       {                       /* PUFFER (P18) */
+               -2, -4,
+               -3, -3, -2, -3, -1, -3, 0, -3,
+               -2, -2, 0, -2,
+               -2, -1, 1, -1,
+               -2, 0, 2, 0,
+               -2, 2, 4, 2,
+               -1, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3,
+               0, 4, 1, 4, 3, 4, 4, 4,
+               1, 5, 4, 5,
+               127
+       },
+       {                       /* QUASAR (P10) */
+               -2, -1, -1, -1, 0, -1,
+               -1, 0, 0, 0,
+               0, 1,
+               127
+       },
+};
+
+
+static int  patterns_6rules[] =
+{
+       (sizeof patterns_6S2b34B2a / sizeof patterns_6S2b34B2a[0]),
+       (sizeof patterns_6S2a2b4aB2a3a4b / sizeof patterns_6S2a2b4aB2a3a4b[0])
+};
+
+static int  patterns_8rules[] =
+{
+       (sizeof patterns_8S23B3 / sizeof patterns_8S23B3[0])
+};
+
+static paramstruct param_6rules[] =
+{
+       {
+               0x18, 0x0,
+               {0x2, 0x0, 0x0},
+               {0x1, 0x0, 0x0}
+       },
+       {
+               0x0, 0x0,
+               {0x3, 0x0, 0x1},
+               {0x1, 0x1, 0x2}
+       }
+};
+
+static paramstruct param_8rules[] =
+{
+       {
+               0xC, 0x8,
+               {0x0, 0x0, 0x0},
+               {0x0, 0x0, 0x0}
+       }
+};
+
+#define LIFE_6S2b34B2a 0 /* CALLAHAN */
+#define LIFE_6GLIDERS 1                /* GLIDER rules are first in param_6rules */
+#define LIFE_6S2a2b4aB2a3a4b 1 /* ANDREEN */
+#define LIFE_6RULES (sizeof param_6rules / sizeof param_6rules[0])
+#define LIFE_8S23B3 0 /* CONWAY */
+#define LIFE_8GLIDERS 1                /* GLIDER rules are first in param_8rules */
+#define LIFE_8RULES (sizeof param_8rules / sizeof param_8rules[0])
+
+static int
+invplot(int local_neighbors)
+{
+       switch (local_neighbors) {
+               case 3:
+                       return 0;
+               case 4:
+                       return 1;
+               case 6:
+                       return 2;
+               case 8:
+                       return 3;
+               case 9:
+                       return 4;
+               case 12:
+                       return 5;
+               default:
+                       (void) fprintf(stderr, "no neighborhood like %d known\n", local_neighbors);
+                       return 3;
+       }
+}
+
+static int
+codeToPatternedRule(int local_neighbors, paramstruct param)
+{
+       unsigned int i;
+       int         g, neighbor_kind;
+
+       neighbor_kind = invplot(local_neighbors);
+       switch (local_neighbors) {
+               case 6:
+                       for (i = 0; i < LIFE_6RULES; i++)
+                               if (param_6rules[i].survival == param.survival &&
+                                   param_6rules[i].birth == param.birth) {
+                                       for (g = 0; g < maxgroups[neighbor_kind]; g++) {
+                                               if (param_6rules[i].survival_group[g] !=
+                                                   param.survival_group[g] ||
+                                                   param_6rules[i].birth_group[g] !=
+                                                   param.birth_group[g]) {
+                                                       break;
+                                               }
+                                       }
+                                       if (g == maxgroups[neighbor_kind])
+                                               return i;
+                               }
+                       return LIFE_6RULES;
+               case 8:
+                       for (i = 0; i < LIFE_8RULES; i++)
+                               if (param_8rules[i].survival == param.survival &&
+                                   param_8rules[i].birth == param.birth) {
+                                       for (g = 0; g < maxgroups[neighbor_kind]; g++) {
+                                               if (param_8rules[i].survival_group[g] !=
+                                                   param.survival_group[g] ||
+                                                   param_8rules[i].birth_group[g] !=
+                                                   param.birth_group[g]) {
+                                                       break;
+                                               }
+                                       }
+                                       if (g == maxgroups[neighbor_kind])
+                                               return i;
+                               }
+                       return LIFE_8RULES;
+       }
+       return 0;
+}
+
+static void
+copyFromPatternedRule(int local_neighbors,  paramstruct * param, int patterned_rule)
+{
+       int         i, neighbor_kind;
+
+       neighbor_kind = invplot(local_neighbors);
+       switch (local_neighbors) {
+               case 6:
+                       param->survival = param_6rules[patterned_rule].survival;
+                       param->birth = param_6rules[patterned_rule].birth;
+                       for (i = 0; i < maxgroups[neighbor_kind]; i++) {
+                               param->survival_group[i] =
+                                       param_6rules[patterned_rule].survival_group[i];
+                               param->birth_group[i] =
+                                       param_6rules[patterned_rule].birth_group[i];
+                       }
+                       break;
+               case 8:
+                       param->survival = param_8rules[patterned_rule].survival;
+                       param->birth = param_8rules[patterned_rule].birth;
+                       for (i = 0; i < maxgroups[neighbor_kind]; i++) {
+                               param->survival_group[i] =
+                                       param_8rules[patterned_rule].survival_group[i];
+                               param->birth_group[i] =
+                                       param_8rules[patterned_rule].birth_group[i];
+                       }
+                       break;
+       }
+}
+
+static void
+printRule(int local_neighbors, paramstruct param)
+{
+       int         l, g, neighbor_kind;
+       Bool        found;
+
+       (void) fprintf(stdout, "rule (Survival/Birth neighborhood): S");
+       neighbor_kind = invplot(local_neighbors);
+       for (l = 0; l <= local_neighbors; l++) {
+               if (param.survival & (1 << l))
+                       (void) fprintf(stdout, "%d", l);
+               else if (l >= FIRSTGROUP && l < FIRSTGROUP + maxgroups[neighbor_kind])
+                       for (g = 0; g < groupnumber[neighbor_kind][l - FIRSTGROUP]; g++) {
+                               if (param.survival_group[l - FIRSTGROUP] & (1 << g))
+                                       (void) fprintf(stdout, "%d%c", l, 'a' + g);
+                       }
+       } (void) fprintf(stdout, "/B");
+       for (l = 0; l <= local_neighbors; l++) {
+               if (param.birth & (1 << l))
+                       (void) fprintf(stdout, "%d", l);
+               else if (l >= FIRSTGROUP && l < FIRSTGROUP + maxgroups[neighbor_kind])
+                       for (g = 0; g < groupnumber[neighbor_kind][l - FIRSTGROUP]; g++) {
+                               if (param.birth_group[l - FIRSTGROUP] & (1 << g))
+                                       (void) fprintf(stdout, "%d%c", l, 'a' + g);
+                       }
+       }
+       (void) fprintf(stdout, "\nbinary rule: Survival 0x%X, Birth 0x%X\n",
+                      param.survival, param.birth);
+       found = False;
+       for (l = 0; l <= maxgroups[neighbor_kind]; l++) {
+               if (param.survival_group[l] || param.birth_group[l]) {
+                       found = True;
+                       break;
+               }
+       }
+       if (found)
+               for (l = 0; l < maxgroups[neighbor_kind]; l++) {
+                       (void) fprintf(stdout,
+                                      "groups in neighborhood %d: Survival 0x%X, Birth 0x%X\n",
+                                      l + FIRSTGROUP, param.survival_group[l], param.birth_group[l]);
+               }
+}
+
+static int
+position_of_neighbor(lifestruct * lp, int n, int col, int row)
+{
+       int         dir = n * 360 / lp->neighbors;
+
+       if (lp->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                               break;
+                       case 60:
+                               if (!(row & 1))
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                               row = (!row) ? lp->nrows - 1 : row - 1;
+                               break;
+                       case 120:
+                               if (row & 1)
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                               row = (!row) ? lp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? lp->ncols - 1 : col - 1;
+                               break;
+                       case 240:
+                               if (row & 1)
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                               row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                               break;
+                       case 300:
+                               if (!(row & 1))
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (lp->neighbors == 4 || lp->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                               break;
+                       case 45:
+                               col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                               row = (!row) ? lp->nrows - 1 : row - 1;
+                               break;
+                       case 90:
+                               row = (!row) ? lp->nrows - 1 : row - 1;
+                               break;
+                       case 135:
+                               col = (!col) ? lp->ncols - 1 : col - 1;
+                               row = (!row) ? lp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? lp->ncols - 1 : col - 1;
+                               break;
+                       case 225:
+                               col = (!col) ? lp->ncols - 1 : col - 1;
+                               row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                               break;
+                       case 270:
+                               row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                               break;
+                       case 315:
+                               col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               if ((col + row) % 2) {  /* right */
+                       switch (dir) {
+                               case 0:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 60:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       if (row + 1 == lp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == lp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (row + 1 == lp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == lp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 120:
+                                       row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 180:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? lp->nrows - 1 : row - 1;
+                                       break;
+                               case 240:
+                                       row = (!row) ? lp->nrows - 1 : row - 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (!row)
+                                               row = lp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = lp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 300:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       if (!row)
+                                               row = lp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = lp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       row = (!row) ? lp->nrows - 1 : row - 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               } else {        /* left */
+                       switch (dir) {
+                               case 0:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? lp->nrows - 1 : row - 1;
+                                       break;
+                               case 60:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       if (!row)
+                                               row = lp->nrows - 2;
+                                       else if (row == 1)
+                                               row = lp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (!row)
+                                               row = lp->nrows - 2;
+                                       else if (row == 1)
+                                               row = lp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 120:
+                                       row = (!row) ? lp->nrows - 1 : row - 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       row = (!row) ? lp->nrows - 1 : row - 1;
+                                       break;
+                               case 180:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (!col) ? lp->ncols - 1 : col - 1;
+                                       row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 240:
+                                       row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (row + 1 == lp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == lp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 300:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       if (row + 1 == lp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == lp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (col + 1 == lp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == lp->nrows) ? 0 : row + 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               }
+       }
+
+       return (row * lp->ncols + col);
+}
+
+static void
+parseRule(ModeInfo * mi)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       int         n, g, l, neighbor_kind;
+       char        serving = 0;
+       static Bool found = False;
+
+       if (found)
+               return;
+       lp->input_param.survival = lp->input_param.birth = 0;
+       for (n = 0; n < MAXGROUPS; n++) {
+               lp->input_param.survival_group[n] = lp->input_param.birth_group[n] = 0;
+       }
+       if (lp->callahan) {
+               lp->neighbors = 6;
+               neighbor_kind = 2;
+               found = !MI_IS_FULLRANDOM(mi);
+               lp->input_param.survival = param_6rules[0].survival;
+               lp->input_param.birth = param_6rules[0].birth;
+               for (n = 0; n < maxgroups[neighbor_kind]; n++) {
+                       lp->input_param.survival_group[n] = param_6rules[0].survival_group[n];
+                       lp->input_param.birth_group[n] = param_6rules[0].birth_group[n];
+               }
+               return;
+       } else if (lp->andreen) {
+               lp->neighbors = 6;
+               neighbor_kind = 2;
+               found = !MI_IS_FULLRANDOM(mi);
+               lp->input_param.survival = param_6rules[1].survival;
+               lp->input_param.birth = param_6rules[1].birth;
+               for (n = 0; n < maxgroups[neighbor_kind]; n++) {
+                       lp->input_param.survival_group[n] = param_6rules[1].survival_group[n];
+                       lp->input_param.birth_group[n] = param_6rules[1].birth_group[n];
+               }
+               return;
+       }
+       neighbor_kind = invplot(lp->neighbors);
+       if (rule && !MI_IS_FULLRANDOM(mi)) {
+               n = 0;
+               while (rule[n]) {
+                       if (rule[n] == 'P') {
+                               lp->allPatterns = True;
+                               found = True;
+                               if (MI_IS_VERBOSE(mi))
+                                       (void) fprintf(stdout, "rule: All rules with known patterns\n");
+                               return;
+                       } else if (rule[n] == 'G') {
+                               lp->allGliders = True;
+                               found = True;
+                               if (MI_IS_VERBOSE(mi))
+                                       (void) fprintf(stdout, "rule: All rules with known gliders\n");
+                               return;
+                       } else if (rule[n] == 'S' || rule[n] == 'E' || rule[n] == 'L') {
+                               serving = 'S';
+                       } else if (rule[n] == 'B') {
+                               serving = 'B';
+                       } else {
+                               l = rule[n] - '0';
+                               if (l >= 0 && l <= 9 && l <= lp->neighbors) {           /* no 10, 11, 12 */
+                                       g = rule[n + 1] - 'a';
+                                       if (l >= FIRSTGROUP && l < FIRSTGROUP + maxgroups[neighbor_kind] &&
+                                           g >= 0 && g < groupnumber[neighbor_kind][l]) {      /* Groupings */
+                                               if (serving == 'S') {
+                                                       found = True;
+                                                       lp->input_param.survival_group[l - FIRSTGROUP] |= (1 << g);
+                                               } else if (serving == 'B') {
+                                                       found = True;
+                                                       lp->input_param.birth_group[l - FIRSTGROUP] |= (1 << g);
+                                               }
+                                       } else {
+                                               if (serving == 'S') {
+                                                       found = True;
+                                                       lp->input_param.survival |= (1 << l);
+                                               } else if (serving == 'B') {
+                                                       found = True;
+                                                       lp->input_param.birth |= (1 << l);
+                                               }
+                                       }
+                               }
+                       }
+                       n++;
+               }
+       }
+       if (!found) {           /* Default to Conway's rule if very stupid */
+               lp->allGliders = True;
+               found = !MI_IS_FULLRANDOM(mi);
+               if (MI_IS_VERBOSE(mi))
+                       (void) fprintf(stdout,
+                       "rule: Defaulting to all rules with known gliders\n");
+               return;
+       }
+       if (MI_IS_VERBOSE(mi))
+               printRule(lp->neighbors, lp->input_param);
+}
+
+static void
+parseFile(ModeInfo *mi)
+{
+       FILE       *file;
+       static Bool done = False;
+       int         firstx, x = 0, y = 0, i = 0;
+       int         c;
+       char        line[256];
+
+       if (done)
+               return;
+       done = True;
+       if (MI_IS_FULLRANDOM(mi) || !lifefile || !*lifefile || ((file = my_fopen(lifefile, "r")) == NULL)) {
+               /*(void) fprintf(stderr, "could not read file \"%s\"\n", lifefile); */
+               return;
+       }
+       for (;;) {
+               if (!fgets(line, 256, file)) {
+                       (void) fprintf(stderr, "could not read header of file \"%s\"\n",
+                                      lifefile);
+                       (void) fclose(file);
+                       return;
+               }
+               if (strncmp(line, "#P", (size_t) 2) == 0 &&
+                   sscanf(line, "#P %d %d", &x, &y) == 2)
+                       break;
+       }
+       c = getc(file);
+       while (c != EOF && !(c == '0' || c == 'O' || c == '*' || c == '.')) {
+               c = getc(file);
+       }
+       if (c == EOF || x <= -127 || y <= -127 || x >= 127 || y >= 127) {
+               (void) fprintf(stderr, "corrupt file \"%s\" or file to large\n",
+                              lifefile);
+               (void) fclose(file);
+               return;
+       }
+       firstx = x;
+       if ((filePattern = (char *) malloc((2 * NUMFILEPTS + 1) *
+                       sizeof (char))) == NULL) {
+               (void) fprintf(stderr, "not enough memory\n");
+               (void) fclose(file);
+               return;
+       }
+
+       while (c != EOF && x < 127 && y < 127 && i < 2 * NUMFILEPTS) {
+               if (c == '0' || c == 'O' || c == '*') {
+                       filePattern[i++] = x++;
+                       filePattern[i++] = y;
+               } else if (c == '.') {
+                       x++;
+               } else if (c == '\n') {
+                       x = firstx;
+                       y++;
+               }
+               c = getc(file);
+       }
+       (void) fclose(file);
+       filePattern[i] = 127;
+}
+
+static Bool
+init_list(lifestruct * lp, int state)
+{
+       /* Waste some space at the beginning and end of list
+          so we do not have to complicated checks against falling off the ends. */
+       if ((lp->last[state] = (CellList *) malloc(sizeof (CellList))) == NULL) {
+               return False;
+       }
+       if ((lp->first[state] = (CellList *) malloc(sizeof (CellList))) == NULL) {
+               (void) free((void *) lp->last[state]);
+               lp->last[state] = NULL;
+               return False;
+       }
+       lp->first[state]->previous = lp->last[state]->next = NULL;
+       lp->first[state]->next = lp->last[state]->previous = NULL;
+       lp->first[state]->next = lp->last[state];
+       lp->last[state]->previous = lp->first[state];
+       return True;
+}
+
+static Bool
+addto_list(lifestruct * lp, int state, cellstruct info)
+{
+       CellList   *curr;
+
+       if ((curr = (CellList *) malloc(sizeof (CellList))) == NULL)
+               return False;
+       lp->last[state]->previous->next = curr;
+       curr->previous = lp->last[state]->previous;
+       curr->next = lp->last[state];
+       lp->last[state]->previous = curr;
+       curr->info = info;
+       if (info.position >= 0) {
+               lp->arr[info.position] = curr;
+               lp->ncells[state]++;
+       }
+       return True;
+}
+static void
+removefrom_list(lifestruct * lp, int state, CellList * curr)
+{
+       curr->previous->next = curr->next;
+       curr->next->previous = curr->previous;
+       if (curr->info.position >= 0) {
+               lp->arr[curr->info.position] = NULL;
+               lp->ncells[state]--;
+       }
+       (void) free((void *) curr);
+}
+
+#ifdef DEBUG
+static void
+print_state(ModeInfo * mi, int state)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       CellList   *curr;
+       int         i = 0;
+
+       curr = lp->first[state]->next;
+       (void) printf("state %d\n", state);
+       while (curr != lp->last[state]) {
+               (void) printf("%d: position %ld,        age %d, state %d, toggle %d\n",
+                             i, curr->info.position, curr->info.age,
+                             curr->info.state, curr->info.toggle);
+               curr = curr->next;
+               i++;
+       }
+}
+
+#endif
+
+static void
+flush_list(lifestruct * lp, int state)
+{
+       while (lp->last[state]->previous != lp->first[state]) {
+               CellList   *curr = lp->last[state]->previous;
+
+               curr->previous->next = lp->last[state];
+               lp->last[state]->previous = curr->previous;
+               (void) free((void *) curr);
+       }
+       lp->ncells[state] = 0;
+}
+
+
+static void
+draw_cell(ModeInfo * mi, cellstruct info)
+{
+       Display    *display = MI_DISPLAY(mi);
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       GC          gc = lp->backGC;
+       int         col, row;
+
+       col = (int) (info.position % lp->ncols);
+       row = (int) (info.position / lp->ncols);
+       if (info.state == LIVE) {
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, gc, MI_PIXEL(mi, info.age));
+               else
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       } else
+               XSetForeground(display, gc, lp->black);
+
+       if (lp->neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               lp->shape.hexagon[0].x = lp->xb + ccol * lp->xs;
+               lp->shape.hexagon[0].y = lp->yb + crow * lp->ys;
+               if (lp->xs == 1 && lp->ys == 1)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi),
+                                      lp->backGC, lp->shape.hexagon[0].x, lp->shape.hexagon[0].y);
+               else
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), lp->backGC,
+                           lp->shape.hexagon, 6, Convex, CoordModePrevious);
+       } else if (lp->neighbors == 4 || lp->neighbors == 8) {
+               if (lp->pixelmode || info.state == DEAD)
+                       XFillRectangle(display, MI_WINDOW(mi), gc,
+                                      lp->xb + lp->xs * col, lp->yb + lp->ys * row,
+                                lp->xs - (lp->xs > 3 && lp->pixelmode),
+                                lp->ys - (lp->ys > 3 && lp->pixelmode));
+               else {
+/*-
+ * PURIFY 4.0.1 on SunOS4 and on Solaris 2 reports a 132 byte memory leak on
+ * the next line */
+#ifdef XBM_GRELB
+               if (lp->logo2) {
+                       (void) XPutImage(display, MI_WINDOW(mi), gc,
+                               (LRAND() & 1) ? lp->logo : lp->logo2,
+                         0, 0, lp->xb + lp->xs * col, lp->yb + lp->ys * row,
+                                        lp->logo->width, lp->logo->height);
+               } else
+#endif
+                       (void) XPutImage(display, MI_WINDOW(mi), gc, lp->logo,
+                         0, 0, lp->xb + lp->xs * col, lp->yb + lp->ys * row,
+                                        lp->logo->width, lp->logo->height);
+               }
+       } else {                /* TRI */
+               int         orient = (col + row) % 2;   /* O left 1 right */
+
+               lp->shape.triangle[orient][0].x = lp->xb + col * lp->xs;
+               lp->shape.triangle[orient][0].y = lp->yb + row * lp->ys;
+               if (lp->xs <= 3 || lp->ys <= 3)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), lp->backGC,
+                       ((orient) ? -1 : 1) + lp->shape.triangle[orient][0].x,
+                                      lp->shape.triangle[orient][0].y);
+               else {
+                       if (orient)
+                               lp->shape.triangle[orient][0].x += (lp->xs / 2 - 1);
+                       else
+                               lp->shape.triangle[orient][0].x -= (lp->xs / 2 - 1);
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), lp->backGC,
+                                    lp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+
+               }
+       }
+}
+
+static void
+setcelltoggles(ModeInfo * mi, int col, int row)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       int         position;
+       CellList   *curr;
+
+       position = row * lp->ncols + col;
+       curr = lp->arr[position];
+       if (!curr) {
+               (void) fprintf(stderr, "state toggling but not on list\n");
+               return;
+       }
+       curr->info.toggle = True;
+}
+
+static void
+free_cells(lifestruct * lp)
+{
+       if (lp->arr != NULL) {
+               (void) free((void *) lp->arr);
+               lp->arr = NULL;
+       }
+}
+
+static void
+free_stuff(Display * display, lifestruct * lp)
+{
+       if (lp->cmap != None) {
+               XFreeColormap(display, lp->cmap);
+               if (lp->backGC != None) {
+                       XFreeGC(display, lp->backGC);
+                       lp->backGC = None;
+               }
+               lp->cmap = None;
+       } else
+               lp->backGC = None;
+}
+
+static void
+free_life(Display * display, lifestruct * lp)
+{
+       int         state;
+
+       for (state = 0; state < STATES; state++) {
+               if (lp->first[state])
+                       flush_list(lp, state);
+               if (lp->last[state])
+                       (void) free((void *) lp->last[state]);
+               lp->last[state] = NULL;
+               if (lp->first[state])
+                       (void) free((void *) lp->first[state]);
+               lp->first[state] = NULL;
+       }
+       free_cells(lp);
+       free_stuff(display, lp);
+       if (lp->logo != NULL) {
+               destroyImage(&lp->logo, &lp->graphics_format);
+               lp->logo = NULL;
+       }
+}
+
+static Bool
+setcellfromtoggle(ModeInfo * mi, int col, int row)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       int         neighbor, n, position;
+       cellstruct  info;
+       CellList   *curr, *currn;
+
+       position = row * lp->ncols + col;
+       curr = lp->arr[position];
+       if ((curr && curr->info.state == DEAD && curr->info.toggle) ||
+           (curr && curr->info.state == LIVE && !curr->info.toggle)) {
+               for (n = 0; n < lp->neighbors; n++) {
+                       neighbor = position_of_neighbor(lp, n, col, row);
+                       currn = lp->arr[neighbor];
+                       if (!currn) {
+                               info.position = neighbor;
+                               info.age = 0;
+                               info.state = DEAD;
+                               info.toggle = False;
+                               if (!addto_list(lp, DEAD, info)) {
+                                       free_life(MI_DISPLAY(mi), lp);
+                                       return False;
+                               }
+                       }
+               }
+       }
+       if (curr && curr->info.state == DEAD && curr->info.toggle) {
+               removefrom_list(lp, DEAD, curr);
+               info.age = 0;
+               info.position = position;
+               info.toggle = False;
+               info.state = LIVE;
+               if (!addto_list(lp, LIVE, info)) {
+                       free_life(MI_DISPLAY(mi), lp);
+                       return False;
+               }
+               draw_cell(mi, info);
+       } else if (curr && curr->info.state == LIVE && !curr->info.toggle) {
+               info = curr->info;
+               /* if we aren't up to blue yet, then keep aging the cell. */
+               if ((MI_NPIXELS(mi) > 2) &&
+                   (info.age < (unsigned short) (MI_NPIXELS(mi) * 0.7))) {
+                       ++(info.age);
+                       /* cc: error 1405: "/opt/ansic/lbin/ccom"
+                          terminated abnormally with signal 11.
+                          *** Error exit code 9 */
+                       /* Next 2 line trips up HP cc -g -O, remove a flag */
+                       curr->info.age = info.age;
+                       draw_cell(mi, info);
+               }
+       }
+       return True;
+}
+
+static Bool
+setcell(ModeInfo * mi, int col, int row, int state)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       int         neighbor, n, position;
+       cellstruct  info;
+       CellList   *curr, *currn;
+
+       if (col < 0 || row < 0 || col >= lp->ncols || row >= lp->nrows)
+               return True; /* Actually its a 3rd case */
+
+       position = row * lp->ncols + col;
+       curr = lp->arr[position];
+       /* cc: error 1405: "/opt/ansic/lbin/ccom"
+          terminated abnormally with signal 11.
+          *** Error exit code 9 */
+       /* Following lines trip up HP cc -g -O, remove a flag */
+       if (state == LIVE) {
+               if (curr && curr->info.state == DEAD) {
+                       removefrom_list(lp, DEAD, curr);
+                       curr = NULL;
+               }
+               if (!curr) {
+                       for (n = 0; n < lp->neighbors; n++) {
+                               neighbor = position_of_neighbor(lp, n, col, row);
+                               currn = lp->arr[neighbor];
+                               if (!currn) {
+                                       info.age = 0;
+                                       info.position = neighbor;
+                                       info.state = DEAD;
+                                       info.toggle = False;
+                                       if (!addto_list(lp, DEAD, info)) {
+                                               free_life(MI_DISPLAY(mi), lp);
+                                               return False;
+                                       }
+                               }
+                       }
+                       info.age = 0;
+                       info.position = position;
+                       info.state = LIVE;
+                       info.toggle = False;
+                       if (!addto_list(lp, LIVE, info)) {
+                               free_life(MI_DISPLAY(mi), lp);
+                               return False;
+                       }
+                       draw_cell(mi, info);
+               } else {
+                       info = curr->info;
+                       info.age = 0;
+                       draw_cell(mi, info);
+               }
+       } else if (curr && curr->info.state == LIVE) {
+               info.age = 0;
+               info.position = position;
+               info.state = DEAD;
+               info.toggle = False;
+               removefrom_list(lp, LIVE, curr);        /* Just in case... */
+               if (!addto_list(lp, DEAD, info)) {
+                       free_life(MI_DISPLAY(mi), lp);
+                       return False;
+               }
+               draw_cell(mi, info);
+       }
+       return True;
+}
+
+#if 0
+static int
+n_neighbors(lifestruct * lp, CellList * curr)
+{
+       int         col, row, n, p, count = 0;
+
+       col = curr->info.position % lp->ncols;
+       row = curr->info.position / lp->ncols;
+       for (n = 0; n < lp->neighbors; n++) {
+               p = position_of_neighbor(lp, n, col, row);
+               if (lp->arr[p] && lp->arr[p]->info.state == LIVE) {
+                       count++;
+               }
+       }
+       return count;
+}
+#endif
+
+static int
+ng_neighbors(lifestruct * lp, CellList * curr, int *group)
+{
+       int         col, row, n, p, count = 0, gcount = 0;
+
+       col = (int) (curr->info.position % lp->ncols);
+       row = (int) (curr->info.position / lp->ncols);
+       for (n = 0; n < lp->neighbors; n++) {
+               p = position_of_neighbor(lp, n, col, row);
+               gcount <<= 1;
+               if (lp->arr[p] && lp->arr[p]->info.state == LIVE) {
+                       count++;
+                       gcount++;
+               }
+       }
+       *group = gcount;
+       return count;
+}
+
+static void
+RandomSoup(ModeInfo * mi, int n, int v)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       int         row, col;
+
+       v /= 2;
+       if (v < 1)
+               v = 1;
+       for (row = lp->nrows / 2 - v; row < lp->nrows / 2 + v; ++row)
+               for (col = lp->ncols / 2 - v; col < lp->ncols / 2 + v; ++col)
+                       if (NRAND(100) < n) {
+                               SetList(col, row);
+                       }
+       if (MI_IS_VERBOSE(mi))
+               (void) fprintf(stdout, "random pattern\n");
+}
+
+static void
+GetPattern(ModeInfo * mi, int pattern_rule, int pattern)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       int         row, col, orient, temp;
+       char       *patptr = NULL;
+
+       if (filePattern) {
+               patptr = &filePattern[0];
+       } else {
+               switch (lp->neighbors) {
+                       case 6:
+                               switch (pattern_rule) {
+                                       case LIFE_6S2b34B2a:
+                                               patptr = &patterns_6S2b34B2a[pattern][0];
+                                               break;
+                                       case LIFE_6S2a2b4aB2a3a4b:
+                                               patptr = &patterns_6S2a2b4aB2a3a4b[pattern][0];
+                                               break;
+                               }
+                               break;
+                       case 8:
+                               switch (pattern_rule) {
+                                       case LIFE_8S23B3:
+                                               patptr = &patterns_8S23B3[pattern][0];
+                                               break;
+                               }
+                               break;
+               }
+       }
+       if (lp->neighbors == 6) {
+               orient = NRAND(12);
+       } else {
+               orient = NRAND(8);
+       }
+       while ((col = *patptr++) != 127) {
+               row = *patptr++;
+               if (lp->neighbors == 6) {
+                       if (orient >= 6) {
+                               temp = col;
+                               col = row;
+                               row = temp;
+                       }
+                       /* (a,b) => (b, b-a) */
+                       switch (orient % 6) {
+                               case 0:
+                                       break;
+                               case 1:
+                                       temp = row;
+                                       row = temp - col;
+                                       col = temp;
+                                       break;
+                               case 2:
+                                       temp = -col;
+                                       col = temp + row;
+                                       row = temp;
+                                       break;
+                               case 3:
+                                       col = -col;
+                                       row = -row;
+                                       break;
+                               case 4:
+                                       temp = -row;
+                                       row = temp + col;
+                                       col = temp;
+                                       break;
+                               case 5:
+                                       temp = col;
+                                       col = temp - row;
+                                       row = temp;
+                                       break;
+                       }
+               } else {
+                       if (orient >= 4) {
+                               temp = col;
+                               col = row;
+                               row = temp;
+                       }
+                       /* Could have made it symmetrical with hexagons where
+                        (a,b) => (-b, a), this should be equivalent */
+                       if (orient % 4 >= 2) {
+                               row = -row;
+                       }
+                       if (orient % 2) {
+                               col = -col;
+                       }
+               }
+               col += lp->ncols / 2;
+               if (lp->neighbors == 6) {
+                       if (row < 0)
+                               col += (lp->nrows / 2 % 2) ? -row / 2 : -(row - 1) / 2;
+                       else
+                               col += (lp->nrows / 2 % 2) ? -(row + 1) / 2 : -row / 2;
+               }
+               row += lp->nrows / 2;
+               SetList(col, row);
+       }
+       if (MI_IS_VERBOSE(mi) && !filePattern)
+               (void) fprintf(stdout, "table number %d\n", pattern);
+}
+
+static void
+shooter(ModeInfo * mi)
+{
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+       int         hsp, vsp, hoff = 1, voff = 1, temp;
+
+       /* Generate the glider at the edge of the screen */
+       if (lp->neighbors == 6 && (lp->patterned_rule == LIFE_6S2b34B2a ||
+           lp->patterned_rule == LIFE_6S2a2b4aB2a3a4b)) {
+               int         hhex = 0, diagonal;
+
+               diagonal = NRAND(3);
+               if (diagonal) {
+                       temp = MIN((lp->nrows + lp->ncols) / 3, 18);
+                       temp = NRAND(temp) - temp / 2;
+                       /* Take into account it is a 60 degree angle not 45 */
+                       if ((lp->ncols + temp) * 1.35 > lp->nrows) {
+                               hsp = (int) ((lp->ncols + temp) * 1.35 - lp->nrows) / 2;
+                               vsp = 0;
+                       } else {
+                               hsp = 0;
+                               vsp = (int) (lp->nrows - (lp->ncols - temp) * 1.35) / 2;
+                       }
+                       switch NRAND(4) {
+                               case 0:  /* Upper left */
+                                       break;
+                               case 1:  /* Upper right */
+                                       hhex = -1;
+                                       hoff = -1;
+                                       hsp = lp->ncols - 1 - hsp;
+                                       break;
+                               case 2:  /* Lower left */
+                                       hhex = 1;
+                                       voff = -1;
+                                       vsp = lp->nrows - 1 - vsp;
+                                       break;
+                               case 3:  /* Lower right */
+                                       voff = -1;
+                                       hoff = -1;
+                                       hsp = lp->ncols - 1 - hsp;
+                                       vsp = lp->nrows - 1 - vsp;
+                       }
+               } else {
+                       temp = MIN(lp->nrows / 3, 18);
+                       vsp = lp->nrows / 2 + NRAND(temp) - temp / 2;
+                       if (LRAND() & 1) {
+                               hsp = lp->ncols - 1;
+                               hoff = -1;
+                               hhex = (vsp % 2) ? 0 : hoff;
+                       } else {
+                               hsp = 0;
+                               hhex = (vsp % 2) ? hoff : 0;
+                       }
+                       voff = (LRAND() & 1) ? 1 : -1; /* Mirror image */
+               }
+               if (lp->patterned_rule == LIFE_6S2b34B2a) {
+                       if (diagonal) {
+                               SetList(hsp + hhex, vsp);
+                               if (LRAND() & 1) {
+                                       SetList(hsp + 3 * hoff, vsp + 1 * voff);
+                                       SetList(hsp + 2 * hoff + hhex, vsp + 2 * voff);
+                                       SetList(hsp + 2 * hoff, vsp + 3 * voff);
+                                       SetList(hsp + 1 * hoff + hhex, vsp + 4 * voff);
+                                       SetList(hsp + hhex, vsp + 4 * voff);
+                               } else { /* Mirror image */
+                                       SetList(hsp + 3 * hoff + hhex, vsp + 2 * voff);
+                                       SetList(hsp + 0 * hoff, vsp + 3 * voff);
+                                       SetList(hsp + 1 * hoff, vsp + 3 * voff);
+                                       SetList(hsp + 2 * hoff, vsp + 3 * voff);
+                                       SetList(hsp + 3 * hoff, vsp + 3 * voff);
+                               }
+                       } else {
+                               SetList(hsp + 2 * hoff + hhex, vsp + 2 * voff);
+                               SetList(hsp + 3 * hoff, vsp + 1 * voff);
+                               SetList(hsp + 3 * hoff + hhex, vsp + 0 * voff);
+                               SetList(hsp + 0 * hoff + hhex, vsp + 0 * voff);
+                               SetList(hsp + 4 * hoff, vsp - 1 * voff);
+                               SetList(hsp + 3 * hoff + hhex, vsp - 2 * voff);
+                       }
+               } else /* if (lp->patterned_rule == LIFE_6S2a2b4aB2a3a4b) */ {
+                       if (diagonal) {
+                               switch (NRAND(3)) { /* 3 different gliders */
+                                       case 0:
+                                               /* No mirror image */
+                                               SetList(hsp + 2 * hoff + hhex, vsp + 0 * voff);
+                                               SetList(hsp + 3 * hoff + hhex, vsp + 0 * voff);
+                                               SetList(hsp + 1 * hoff, vsp + 1 * voff);
+                                               SetList(hsp + 2 * hoff, vsp + 1 * voff);
+                                               SetList(hsp + 0 * hoff + hhex, vsp + 2 * voff);
+                                               break;
+                                       case 1:
+                                               if (LRAND() & 1) {
+                                                       SetList(hsp + 0 * hoff + hhex, vsp + 0 * voff);
+                                                       SetList(hsp + 1 * hoff + hhex, vsp + 0 * voff);
+                                                       SetList(hsp + 3 * hoff, vsp + 1 * voff);
+                                                       SetList(hsp + 4 * hoff, vsp + 1 * voff);
+                                                       SetList(hsp + 0 * hoff + hhex, vsp + 2 * voff);
+                                                       SetList(hsp + 1 * hoff + hhex, vsp + 2 * voff);
+                                                       SetList(hsp + 2 * hoff + hhex, vsp + 2 * voff);
+                                               } else {
+                                                       SetList(hsp + 1 * hoff + hhex, vsp + 0 * voff);
+                                                       SetList(hsp + 1 * hoff, vsp + 1 * voff);
+                                                       SetList(hsp + 3 * hoff, vsp + 1 * voff);
+                                                       SetList(hsp + 2 * hoff + hhex, vsp + 2 * voff);
+                                                       SetList(hsp + 1 * hoff, vsp + 3 * voff);
+                                                       SetList(hsp + 2 * hoff, vsp + 3 * voff);
+                                                       SetList(hsp + 0 * hoff + hhex, vsp + 4 * voff);
+                                               }
+                                               break;
+                                       case 2:
+                                               if (LRAND() & 1) {
+                                                       SetList(hsp + 1 * hoff + hhex, vsp + 0 * voff);
+                                                       SetList(hsp + 2 * hoff + hhex, vsp + 2 * voff);
+                                                       SetList(hsp + 3 * hoff + hhex, vsp + 2 * voff);
+                                                       SetList(hsp + 0 * hoff, vsp + 3 * voff);
+                                                       SetList(hsp + 1 * hoff, vsp + 3 * voff);
+                                                       SetList(hsp + 2 * hoff, vsp + 3 * voff);
+                                               } else {
+                                                       SetList(hsp + 0 * hoff + hhex, vsp + 0 * voff);
+                                                       SetList(hsp + 3 * hoff + hhex, vsp + 0 * voff);
+                                                       SetList(hsp + 3 * hoff, vsp + 1 * voff);
+                                                       SetList(hsp + 1 * hoff + hhex, vsp + 2 * voff);
+                                                       SetList(hsp + 2 * hoff + hhex, vsp + 2 * voff);
+                                                       SetList(hsp + 1 * hoff, vsp + 3 * voff);
+                                               }
+                               }
+                       } else {
+                               switch (NRAND(3)) { /* 3 different gliders */
+                                       case 0:
+                                               SetList(hsp + 0 * hoff + hhex, vsp + 0 * voff);
+                                               SetList(hsp + 0 * hoff + hhex, vsp - 2 * voff);
+                                               SetList(hsp + 0 * hoff + hhex, vsp + 2 * voff);
+                                               SetList(hsp + 0 * hoff, vsp - 1 * voff);
+                                               SetList(hsp + 0 * hoff, vsp + 1 * voff);
+                                               break;
+                                       case 1:
+                                               SetList(hsp + 0 * hoff + hhex, vsp + 0 * voff);
+                                               SetList(hsp + 0 * hoff, vsp + 1 * voff);
+                                               SetList(hsp + 1 * hoff + hhex, vsp + 2 * voff);
+                                               SetList(hsp + 2 * hoff + hhex, vsp - 2 * voff);
+                                               SetList(hsp + 2 * hoff, vsp - 1 * voff);
+                                               SetList(hsp + 2 * hoff + hhex, vsp + 0 * voff);
+                                               SetList(hsp + 2 * hoff, vsp + 1 * voff);
+                                               break;
+                                       case 2:
+                                               SetList(hsp + 0 * hoff, vsp - 1 * voff);
+                                               SetList(hsp + 1 * hoff + hhex, vsp + 2 * voff);
+                                               SetList(hsp + 2 * hoff + hhex, vsp - 2 * voff);
+                                               SetList(hsp + 2 * hoff, vsp - 1 * voff);
+                                               SetList(hsp + 2 * hoff + hhex, vsp + 0 * voff);
+                                               SetList(hsp + 2 * hoff, vsp + 1 * voff);
+                               }
+                       }
+               }
+       } else if (lp->neighbors == 8 && lp->patterned_rule == LIFE_8S23B3) {
+               if (LRAND() & 1) {
+                       hsp = (LRAND() & 1) ? 0 : lp->ncols - 1;
+                       vsp = NRAND(lp->nrows);
+               } else {
+                       vsp = (LRAND() & 1) ? 0 : lp->nrows - 1;
+                       hsp = NRAND(lp->ncols);
+               }
+               if (vsp > lp->nrows / 2)
+                       voff = -1;
+               if (hsp > lp->ncols / 2)
+                       hoff = -1;
+               SetList(hsp + 2 * hoff, vsp + 0 * voff);
+               SetList(hsp + 2 * hoff, vsp + 1 * voff);
+               SetList(hsp + 2 * hoff, vsp + 2 * voff);
+               SetList(hsp + 1 * hoff, vsp + 2 * voff);
+               SetList(hsp + 0 * hoff, vsp + 1 * voff);
+       }
+}
+
+static Bool
+init_stuff(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       lifestruct *lp = &lifes[MI_SCREEN(mi)];
+
+       if (lp->logo == NULL) {
+               getImage(mi, &lp->logo, CELL_WIDTH, CELL_HEIGHT, CELL_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                        DEFAULT_XPM, CELL_NAME,
+#endif
+                        &lp->graphics_format, &lp->cmap, &lp->black);
+               if (lp->logo == NULL) {
+                       free_life(display, lp);
+                       return False;
+               }
+#ifdef XBM_GRELB
+    if (lp->cmap == None && lp->graphics_format == IS_XBM) {
+       /* probably do not need the first but I am cautious... */
+                       if (!bimage.data) { /* Only need to do this once */
+                               bimage.data = (char *) CELL2_BITS;
+                               bimage.width = CELL2_WIDTH;
+                               bimage.height = CELL2_HEIGHT;
+                               bimage.bytes_per_line = (CELL2_WIDTH + 7) / 8;
+                       }
+                       lp->logo2 = &bimage;
+               }
+#endif
+       }
+#ifndef STANDALONE
+       if (lp->cmap != None) {
+               setColormap(display, window, lp->cmap, MI_IS_INWINDOW(mi));
+               if (lp->backGC == None) {
+                       XGCValues   xgcv;
+
+                       xgcv.background = lp->black;
+                       xgcv.foreground = lp->black;
+                       if ((lp->backGC = XCreateGC(display, window,
+                                       GCForeground | GCBackground,
+                                       &xgcv)) == NULL) {
+                               free_life(display, lp);
+                               return False;
+                       }
+               }
+       } else
+#endif /* STANDALONE */
+       {
+               lp->black = MI_BLACK_PIXEL(mi);
+               lp->backGC = MI_GC(mi);
+       }
+       return True;
+}
+
+void
+init_life(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         size = MI_SIZE(mi), npats, i;
+       lifestruct *lp;
+
+       if (lifes == NULL) {
+               if ((lifes = (lifestruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (lifestruct))) == NULL)
+                       return;
+       }
+       lp = &lifes[MI_SCREEN(mi)];
+
+       lp->generation = 0;
+       lp->redrawing = 0;
+
+       if (MI_IS_FULLRANDOM(mi)) {
+#if 1
+               lp->neighbors = (NRAND((patterns_6rules[0] + patterns_6rules[1]) / 2 + patterns_8rules[0]) < patterns_8rules[0]) ? 8 : 6;
+#else
+               lp->neighbors = 8;
+#endif
+               if  (lp->neighbors == 6) {
+                       lp->callahan = (NRAND(patterns_6rules[0] + patterns_6rules[1]) < patterns_6rules[0]);
+                       lp->andreen = !lp->callahan;
+               } else {
+                       lp->andreen = lp->callahan = False;
+               }
+       } else {
+               lp->callahan = callahan;
+               lp->andreen = andreen;
+       }
+       if (!lp->neighbors) {
+               for (i = 0; i < NEIGHBORKINDS; i++) {
+                       if (neighbors == plots[i]) {
+                               lp->neighbors = neighbors;
+                               break;
+                       }
+                       if (i == NEIGHBORKINDS - 1) {
+#if 0
+                               lp->neighbors = plots[NRAND(NEIGHBORKINDS)];
+                               lp->neighbors = (LRAND() & 1) ? 4 : 8;
+#else
+                               lp->neighbors = 8;
+#endif
+                               break;
+                       }
+               }
+       }
+       parseRule(mi);
+       parseFile(mi);
+       if (lp->allPatterns) {
+               switch (lp->neighbors) {
+                       case 6:
+                               lp->patterned_rule = NRAND(LIFE_6RULES);
+                               break;
+                       case 8:
+                               lp->patterned_rule = NRAND(LIFE_8RULES);
+                               break;
+               }
+               copyFromPatternedRule(lp->neighbors, &lp->param, lp->patterned_rule);
+               if (MI_IS_VERBOSE(mi))
+                       printRule(lp->neighbors, lp->param);
+       } else if (lp->allGliders) {
+               switch (lp->neighbors) {
+                       case 6:
+                               lp->patterned_rule = NRAND(LIFE_6GLIDERS);
+                               break;
+                       case 8:
+                               lp->patterned_rule = NRAND(LIFE_8GLIDERS);
+                               break;
+               }
+               copyFromPatternedRule(lp->neighbors, &lp->param, lp->patterned_rule);
+               if (MI_IS_VERBOSE(mi))
+                       printRule(lp->neighbors, lp->param);
+       } else {
+               lp->param.survival = lp->input_param.survival;
+               lp->param.birth = lp->input_param.birth;
+               for (i = 0; i < maxgroups[invplot(lp->neighbors)]; i++) {
+                       lp->param.survival_group[i] = lp->input_param.survival_group[i];
+                       lp->param.birth_group[i] = lp->input_param.birth_group[i];
+               }
+               lp->patterned_rule = codeToPatternedRule(lp->neighbors, lp->param);
+       }
+       lp->width = MI_WIDTH(mi);
+       lp->height = MI_HEIGHT(mi);
+
+       if (lp->first[0]) {
+               for (i = 0; i < STATES; i++)
+                       flush_list(lp, i);
+       } else {
+               for (i = 0; i < STATES; i++)
+                       if (!init_list(lp, i)) {
+                               free_life(display, lp);
+                               return;
+                       }
+       }
+       free_cells(lp);
+       free_stuff(display, lp);
+
+       if (lp->neighbors == 6) {
+               int         nccols, ncrows, sides;
+
+               if (lp->width < 2)
+                       lp->width = 2;
+               if (lp->height < 4)
+                       lp->height = 4;
+               if (size < -MINSIZE)
+                       lp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               lp->ys = MAX(MINSIZE, MIN(lp->width, lp->height) / (4 * MINGRIDSIZE));
+                       else
+                               lp->ys = MINSIZE;
+               } else
+                       lp->ys = MIN(size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                              MINGRIDSIZE));
+               lp->xs = lp->ys;
+               nccols = MAX(lp->width / lp->xs - 2, 2);
+               ncrows = MAX(lp->height / lp->ys - 1, 2);
+               lp->ncols = nccols / 2;
+               lp->nrows = 2 * (ncrows / 4);
+               lp->xb = (lp->width - lp->xs * nccols) / 2 + lp->xs / 2;
+               lp->yb = (lp->height - lp->ys * (ncrows / 2) * 2) / 2 + lp->ys - 2;
+               for (sides = 0; sides < 6; sides++) {
+                       lp->shape.hexagon[sides].x = (lp->xs - 1) * hexagonUnit[sides].x;
+                       lp->shape.hexagon[sides].y =
+                               ((lp->ys - 1) * hexagonUnit[sides].y / 2) * 4 / 3;
+               }
+               lp->black = MI_BLACK_PIXEL(mi);
+               lp->backGC = MI_GC(mi);
+       } else if (lp->neighbors == 4 || lp->neighbors == 8) {
+               if (!init_stuff(mi))
+                       return;
+               if (lp->width < 2)
+                       lp->width = 2;
+               if (lp->height < 2)
+                       lp->height = 2;
+#if 0
+               if (size == 0 && !MI_IS_ICONIC(mi)) {
+                       lp->pixelmode = False;
+                       lp->xs = lp->logo->width;
+                       lp->ys = lp->logo->height;
+               }
+#else
+               if (size == 0 ||
+                   MINGRIDSIZE * size > lp->width || MINGRIDSIZE * size > lp->height) {
+                       if (lp->width > MINGRIDSIZE * lp->logo->width &&
+                           lp->height > MINGRIDSIZE * lp->logo->height) {
+                               lp->pixelmode = False;
+                               lp->xs = lp->logo->width;
+                               lp->ys = lp->logo->height;
+                       } else {
+                               lp->pixelmode = True;
+                               lp->xs = lp->ys = MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                                     MINGRIDSIZE);
+                       }
+               }
+#endif
+               else {
+                       lp->pixelmode = True;
+                       if (size < -MINSIZE)
+                               lp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+                       else if (size < MINSIZE)
+                               lp->ys = MINSIZE;
+                       else
+                               lp->ys = MIN(size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                                      MINGRIDSIZE));
+                       lp->xs = lp->ys;
+               }
+               lp->ncols = MAX(lp->width / lp->xs, 4);
+               lp->nrows = MAX(lp->height / lp->ys, 4);
+               lp->xb = (lp->width - lp->xs * lp->ncols) / 2;
+               lp->yb = (lp->height - lp->ys * lp->nrows) / 2;
+       } else {                /* TRI */
+               int         orient, sides;
+
+               lp->black = MI_BLACK_PIXEL(mi);
+               lp->backGC = MI_GC(mi);
+               if (lp->width < 2)
+                       lp->width = 2;
+               if (lp->height < 2)
+                       lp->height = 2;
+               if (size < -MINSIZE)
+                       lp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               lp->ys = MAX(MINSIZE, MIN(lp->width, lp->height) / (4 * MINGRIDSIZE));
+                       else
+                               lp->ys = MINSIZE;
+               } else
+                       lp->ys = MIN(size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                              MINGRIDSIZE));
+               lp->xs = (int) (1.52 * lp->ys);
+               lp->ncols = (MAX(lp->width / lp->xs - 1, 2) / 2) * 2;
+               lp->nrows = (MAX(lp->height / lp->ys - 1, 2) / 2) * 2;
+               lp->xb = (lp->width - lp->xs * lp->ncols) / 2 + lp->xs / 2;
+               lp->yb = (lp->height - lp->ys * lp->nrows) / 2 + lp->ys / 2;
+               for (orient = 0; orient < 2; orient++) {
+                       for (sides = 0; sides < 3; sides++) {
+                               lp->shape.triangle[orient][sides].x =
+                                       (lp->xs - 2) * triangleUnit[orient][sides].x;
+                               lp->shape.triangle[orient][sides].y =
+                                       (lp->ys - 2) * triangleUnit[orient][sides].y;
+                       }
+               }
+       }
+       lp->npositions = lp->nrows * lp->ncols;
+
+       MI_CLEARWINDOWCOLORMAP(mi, lp->backGC, lp->black);
+       lp->painted = False;
+       if ((lp->arr = (CellList **) calloc(lp->npositions,
+                       sizeof (CellList *))) == NULL) {
+               free_life(display, lp);
+               return;
+       }
+
+       lp->patterned_rule = codeToPatternedRule(lp->neighbors, lp->param);
+       npats = 0;
+       switch (lp->neighbors) {
+               case 6:
+                       if ((unsigned) lp->patterned_rule < LIFE_6RULES)
+                               npats = patterns_6rules[lp->patterned_rule];
+                       break;
+               case 8:
+                       if ((unsigned) lp->patterned_rule < LIFE_8RULES)
+                               npats = patterns_8rules[lp->patterned_rule];
+                       break;
+       }
+       lp->pattern = NRAND(npats + 2);
+       if (lp->pattern >= npats && !filePattern)
+               RandomSoup(mi, 30, MAX(2 * MIN(lp->nrows, lp->ncols) / 3, 15));
+       else
+               GetPattern(mi, lp->patterned_rule, lp->pattern);
+}
+
+void
+draw_life(ModeInfo * mi)
+{
+       CellList   *middle[STATES];     /* To distinguish between old and new stuff */
+       CellList   *curr;
+       cellstruct  info;
+       int         i, count, gcount, neighbor_kind;
+       lifestruct *lp;
+
+       if (lifes == NULL)
+               return;
+       lp = &lifes[MI_SCREEN(mi)];
+
+/*-
+ * LIVE list are the on cells
+ * DEAD list are the cells that may go on in the next iteration.
+ * Init plan:
+     Create live list and dead list which border all live cells
+       (no good for rules like 0000 :) )
+ * Big loop plan:
+     Setup toggles, toggle state next iteration?
+     Remove all from dead list except toggled and remove all from live list
+       that are dead (but in this case draw background square)
+     Toggle toggled states, age existing ones, create a new dead list, draw
+ */
+
+       /* Go through dead list to see if anything spawns (generate new lists),
+          then delete the used dead list */
+
+       MI_IS_DRAWN(mi) = True;
+
+       /* Setup toggles */
+       curr = lp->first[DEAD]->next;
+       while (curr != lp->last[DEAD]) {
+               count = ng_neighbors(lp, curr, &gcount);
+               if ((lp->param.birth & (1 << count)) || (count >= FIRSTGROUP &&
+                            count < FIRSTGROUP + maxgroups[invplot(lp->neighbors)] &&
+                                (lp->param.birth_group[count - FIRSTGROUP] &
+                                 (1 << style6[gcount])))) {
+                       setcelltoggles(mi, (int) (curr->info.position % lp->ncols),
+                                   (int) (curr->info.position / lp->ncols));
+               }
+               curr = curr->next;
+       }
+       curr = lp->first[LIVE]->next;
+       neighbor_kind = invplot(lp->neighbors);
+       while (curr != lp->last[LIVE]) {
+               count = ng_neighbors(lp, curr, &gcount);
+               if (!((lp->param.survival & (1 << count)) || (count >= FIRSTGROUP &&
+                            count < FIRSTGROUP + maxgroups[neighbor_kind] &&
+                             (lp->param.survival_group[count - FIRSTGROUP] &
+                              (1 << style6[gcount]))))) {
+                       setcelltoggles(mi, (int) (curr->info.position % lp->ncols),
+                                   (int) (curr->info.position / lp->ncols));
+               }
+               curr = curr->next;
+       }
+
+       /* Bring out your dead! */
+       curr = lp->first[DEAD]->next;
+       while (curr != lp->last[DEAD]) {
+               curr = curr->next;
+               if (!curr->previous->info.toggle)
+                       removefrom_list(lp, DEAD, curr->previous);
+       }
+       curr = lp->first[LIVE]->next;
+       while (curr != lp->last[LIVE]) {
+               if (curr->info.toggle) {
+                       curr->info.state = DEAD;
+                       draw_cell(mi, curr->info);
+                       curr = curr->next;
+                       removefrom_list(lp, LIVE, curr->previous);
+               } else
+                       curr = curr->next;
+       }
+
+       /* Fence off the babies */
+       info.position = -1;     /* dummy value */
+       info.age = 0;           /* dummy value */
+       info.state = 0;         /* dummy value */
+       info.toggle = 0;        /* dummy value */
+       if (!addto_list(lp, DEAD, info)) {
+               free_life(MI_DISPLAY(mi), lp);
+               return;
+       }
+       if (!addto_list(lp, LIVE, info)) {
+               free_life(MI_DISPLAY(mi), lp);
+               return;
+       }
+       middle[DEAD] = lp->last[DEAD]->previous;
+       middle[LIVE] = lp->last[LIVE]->previous;
+
+       /* Toggle toggled states, age existing ones, create a new dead list */
+       while (lp->first[DEAD]->next != middle[DEAD]) {
+               curr = lp->first[DEAD]->next;
+               if (!setcellfromtoggle(mi, (int) (curr->info.position % lp->ncols),
+                                 (int) (curr->info.position / lp->ncols)))
+                       return;
+       }
+       curr = lp->first[LIVE]->next;
+       while (curr != middle[LIVE]) {
+               if (!setcellfromtoggle(mi, (int) (curr->info.position % lp->ncols),
+                                 (int) (curr->info.position / lp->ncols)))
+                       return;
+               curr = curr->next;
+       }
+       removefrom_list(lp, DEAD, middle[DEAD]);
+       removefrom_list(lp, LIVE, middle[LIVE]);
+
+       if (lp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       CellList   *redraw_curr = lp->arr[lp->redrawpos];
+
+                       /* TODO: More efficient to use list rather than array. */
+                       if (redraw_curr && redraw_curr->info.state == LIVE) {
+                               draw_cell(mi, redraw_curr->info);
+                       }
+                       if (++(lp->redrawpos) >= lp->npositions) {
+                               lp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+       if (++lp->generation > MI_CYCLES(mi))
+               init_life(mi);
+       else
+               lp->painted = True;
+
+       /*
+        * generate a randomized shooter aimed roughly toward the center of the
+        * screen after batchcount.
+        */
+
+       if (lp->generation && lp->generation %
+           ((MI_COUNT(mi) < 0) ? 1 : MI_COUNT(mi)) == 0)
+               shooter(mi);
+
+}
+
+void
+release_life(ModeInfo * mi)
+{
+       if (lifes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_life(MI_DISPLAY(mi), &lifes[screen]);
+               (void) free((void *) lifes);
+               lifes = NULL;
+       }
+}
+
+void
+refresh_life(ModeInfo * mi)
+{
+       lifestruct *lp;
+
+       if (lifes == NULL)
+               return;
+       lp = &lifes[MI_SCREEN(mi)];
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       if (lp->graphics_format >= IS_XPM) {
+               /* This is needed when another program changes the colormap. */
+               free_life(MI_DISPLAY(mi), lp);
+               init_life(mi);
+               return;
+       }
+#endif
+       if (lp->painted) {
+               MI_CLEARWINDOWCOLORMAP(mi, lp->backGC, lp->black);
+               lp->redrawing = 1;
+               lp->redrawpos = 0;
+               lp->painted = False;
+       }
+}
+
+void
+change_life(ModeInfo * mi)
+{
+       int         npats, i;
+       lifestruct *lp;
+
+       if (lifes == NULL)
+               return;
+       lp = &lifes[MI_SCREEN(mi)];
+
+       lp->generation = 0;
+       if (lp->first[0]) {
+               for (i = 0; i < STATES; i++)
+                       flush_list(lp, i);
+       } else {
+               for (i = 0; i < STATES; i++)
+                       if (!init_list(lp, i)) {
+                               free_life(MI_DISPLAY(mi), lp);
+                               return;
+                       }
+       }
+       free_cells(lp);
+       if ((lp->arr = (CellList **) calloc(lp->npositions,
+                       sizeof (CellList *))) == NULL) {
+               free_life(MI_DISPLAY(mi), lp);
+               return;
+       }
+
+       MI_CLEARWINDOWCOLORMAP(mi, lp->backGC, lp->black);
+
+       lp->pattern++;
+       lp->patterned_rule = codeToPatternedRule(lp->neighbors, lp->param);
+       npats = 0;
+       switch (lp->neighbors) {
+               case 6:
+                       if ((unsigned) lp->patterned_rule < LIFE_6RULES)
+                               npats = patterns_6rules[lp->patterned_rule];
+                       break;
+               case 8:
+                       if ((unsigned) lp->patterned_rule < LIFE_8RULES)
+                               npats = patterns_8rules[lp->patterned_rule];
+                       break;
+       }
+       if (lp->pattern >= npats + 2) {
+               lp->pattern = 0;
+               if (lp->allPatterns) {
+                       lp->patterned_rule++;
+                       switch (lp->neighbors) {
+                               case 6:
+                                       if ((unsigned) lp->patterned_rule >= LIFE_6RULES)
+                                               lp->patterned_rule = 0;
+                                       break;
+                               case 8:
+                                       if ((unsigned) lp->patterned_rule >= LIFE_8RULES)
+                                               lp->patterned_rule = 0;
+                                       break;
+                       }
+                       copyFromPatternedRule(lp->neighbors, &lp->param, lp->patterned_rule);
+                       if (MI_IS_VERBOSE(mi))
+                               printRule(lp->neighbors, lp->param);
+               } else if (lp->allGliders) {
+                       lp->patterned_rule++;
+                       switch (lp->neighbors) {
+                               case 6:
+                                       if ((unsigned) lp->patterned_rule >= LIFE_6GLIDERS)
+                                               lp->patterned_rule = 0;
+                                       break;
+                               case 8:
+                                       if ((unsigned) lp->patterned_rule >= LIFE_8GLIDERS)
+                                               lp->patterned_rule = 0;
+                                       break;
+                       }
+                       copyFromPatternedRule(lp->neighbors, &lp->param, lp->patterned_rule);
+                       if (MI_IS_VERBOSE(mi))
+                               printRule(lp->neighbors, lp->param);
+               }
+       }
+       if (lp->pattern >= npats)
+               RandomSoup(mi, 30, MAX(2 * MIN(lp->nrows, lp->ncols) / 3, 15));
+       else
+               GetPattern(mi, lp->patterned_rule, lp->pattern);
+}
+
+#endif /* MODE_life */
diff --git a/modes/life1d.c b/modes/life1d.c
new file mode 100644 (file)
index 0000000..6327a33
--- /dev/null
@@ -0,0 +1,919 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* life1d --- Stephen Wolfram's 1d game of Life */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)life1d.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 27-Oct-1997: xpm and ras capability added... it does not make too much
+ *              sense here but ...
+ * 10-May-1997: Compatible with xscreensaver
+ * 27-Jul-1995: written, used life.c as a basis, using totalistic rules
+ *              (default).  Special thanks to Harold V. McIntosh
+ *              <mcintosh@servidor.unam.mx> for providing me with the
+ *              LCAU collection and references.
+ *
+ * References:
+ * Dewdney, A.K., "The Armchair Universe, Computer Recreations from the
+ *   Pages of Scientific American Magazine", W.H. Freedman and Company,
+ *   New York, 1988 (May 1985).
+ * Perry, Kenneth E., "Abstract Mathematical Art", BYTE, December, 1986
+ *   pp. 181-192
+ * Hayes, Brian, "Computer Recreations", Scientific American, March 1984,
+ *   p. 12
+ * Wolfram, Stephen, "Cellular automata as models of complexity", Nature,
+ *   4 October 1984, pp. 419-424
+ * Wolfram, Stephen, "Computer Software in Science and Mathematics",
+ *   Scientific American, September 1984, pp. 188-203
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Life1D"
+#define HACK_INIT init_life1d
+#define HACK_DRAW draw_life1d
+#define life1d_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*cycles: 10 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 200 \n" \
+ "*bitmap: \n" \
+ "*verbose: \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+#include "automata.h"
+#include "iostuff.h"
+
+#ifdef MODE_life1d
+
+#define DEF_TOTALISTIC  "True" /* FALSE is LCAU */
+
+static Bool totalistic;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-totalistic", (char *) ".life1d.totalistic", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+totalistic", (char *) ".life1d.totalistic", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+{(caddr_t *) & totalistic, (char *) "totalistic", (char *) "Totalistic", (char *) DEF_TOTALISTIC, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+totalistic", (char *) "turn on/off totalistic rules (else LCAU rules)"}
+};
+
+ModeSpecOpt life1d_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   life1d_description =
+{"life1d", "init_life1d", "draw_life1d", "release_life1d",
+ "refresh_life1d", "init_life1d", NULL, &life1d_opts,
+ 10000, 1, 10, 0, 64, 1.0, "",
+ "Shows Wolfram's game of 1D Life", 0, NULL};
+
+#endif
+
+#define LIFE1DBITS(n,w,h)\
+  if ((lp->pixmaps[lp->init_bits]=\
+  XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
+  free_life1d(display,lp); return;} else {lp->init_bits++;} 
+
+/* aliases for vars defined in the bitmap file */
+#define CELL_WIDTH   image_width
+#define CELL_HEIGHT    image_height
+#define CELL_BITS    image_bits
+
+#include "life1d.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+static char *image_name[] =
+{(char *) ""};
+
+#define CELL_NAME image_name
+#define DEFAULT_XPM 0
+#endif
+
+static int  maxstates;
+static int  maxradius;
+static int  maxsum_size;
+
+#define MINGRIDSIZE 10
+#define MINSIZE 2              /* 3 may be better here */
+#define MAXSTATES 5
+
+typedef struct {
+       int         init_bits;
+       int         pixelmode;
+       int         xs, ys, xb, yb;     /* cell size, grid border */
+       int         screen_generation, row;
+       int         nrows, ncols, border;
+       int         width, height;
+       int         k, r;
+       long        code;
+       int         repeating;
+       char       *nextstate;
+       int         colors[MAXSTATES];
+       Pixmap      pixmaps[MAXSTATES];
+       GC          stippledGC;
+       unsigned char *newcells;
+       unsigned char *oldcells;
+       unsigned char *buffer;
+       XImage     *logo;
+       Colormap    cmap;
+       unsigned long black;
+       int         graphics_format;
+       GC          backGC;
+       int         busyLoop;
+} life1dstruct;
+
+static life1dstruct *life1ds = NULL;
+
+static int  totalistic_rules[][3] =
+{
+
+  /* Well behaved rules */
+  /* Scientific American (Dewdney) */
+       {2, 2, 20},
+       {2, 2, 52},             /* A bit too prolific but I like it anyway */
+       {2, 3, 88},             /* James K. Park's 1D Gun (1111111111011) */
+       {2, 4, 368},
+
+  /* Nature */
+       {3, 1, 792},
+
+  /* BYTE (Translated to Wolfram's notation) */
+       {4, 1, 39744},
+       {4, 1, 81036},
+       {4, 1, 126092},
+       {4, 1, 147824},
+       {4, 1, 156272},
+       {4, 1, 189468},
+       {4, 1, 176412},
+       {4, 1, 214840},
+       {4, 1, 245028},
+       {4, 1, 267320},
+       {4, 1, 257808},
+       {4, 1, 258596},
+       {4, 1, 260224},
+       {4, 1, 267408},
+       {4, 1, 290960},
+       {4, 1, 330056},
+       {4, 1, 330436},
+       {4, 1, 400192},
+       {4, 1, 433296},
+       {4, 1, 434492},
+       {4, 1, 447368},
+       {4, 1, 453768},
+       {4, 1, 454416},
+       {4, 1, 485488},
+       {4, 1, 505904},
+       {4, 1, 618960},
+       {4, 1, 642948},
+       {4, 1, 680528},
+       {4, 1, 708484},
+       {4, 1, 741004},
+       {4, 1, 749708},
+       {4, 1, 756420},
+       {4, 1, 761356},
+       {4, 1, 769088},
+       {4, 1, 778568},
+       {4, 1, 779792},
+       {4, 1, 797456},
+       {4, 1, 803728},
+       {4, 1, 844092},
+       {4, 1, 874524},
+       {4, 1, 881440},
+       {4, 1, 921476},
+       {4, 1, 936832},
+       {4, 1, 937792},
+       {4, 1, 1004600},
+
+  /* Nature */
+       {5, 1, 580020},
+       {5, 1, 5694390},
+       {5, 1, 59123000},
+
+#if 0                          /* OK but annoying */
+
+  /* BYTE */
+       {4, 1, 10552},
+       {4, 1, 14708},
+       {4, 1, 25284},
+       {4, 1, 42848},
+       {4, 1, 44328},
+       {4, 1, 51788},
+       {4, 1, 107364},
+       {4, 1, 111448},
+       {4, 1, 155848},
+       {4, 1, 173024},
+       {4, 1, 224148},
+       {4, 1, 238372},
+       {4, 1, 241656},
+       {4, 1, 243764},
+       {4, 1, 255856},
+       {4, 1, 259222},
+       {4, 1, 310148},
+       {4, 1, 324148},
+       {4, 1, 346696},
+       {4, 1, 364424},
+       {4, 1, 403652},
+       {4, 1, 436072},
+       {4, 1, 456708},
+       {4, 1, 461912},
+       {4, 1, 534812},
+       {4, 1, 546700},
+       {4, 1, 552708},
+       {4, 1, 569092},
+       {4, 1, 616736},
+       {4, 1, 658564},
+       {4, 1, 717956},
+       {4, 1, 748432},
+       {4, 1, 800964},
+       {4, 1, 800972},
+       {4, 1, 801144},
+       {4, 1, 821116},
+       {4, 1, 840172},
+       {4, 1, 858312},
+       {4, 1, 865394},
+       {4, 1, 914952},
+       {4, 1, 919244},
+       {4, 1, 984296},
+       {4, 1, 997964},
+       {4, 1, 1018488},
+       {4, 1, 1018808},
+       {4, 1, 1023864},
+       {4, 1, 1024472},
+       {4, 1, 1033776},
+       {4, 1, 1033784},
+       {4, 1, 1034552},
+
+  /* Nature */
+       {5, 1, 583330},
+       {5, 1, 672900},
+#endif
+
+#if 0                          /* rejects */
+  /* Nature */
+       {2, 1, 4},
+       {2, 3, 18},
+       {2, 3, 22},
+       {2, 3, 90},
+       {2, 3, 94},
+       {2, 3, 126},
+       {2, 3, 128},
+
+  /* Scientific American (Dewdney) */
+       {2, 3, 54},
+       {3, 2, 66},             /* RIPPLE, Dewdney's personal 1d rule */
+       {3, 1, 257},
+
+  /* BYTE */
+       {4, 1, 16},
+       {4, 1, 56},
+       {4, 1, 4408},
+       {4, 1, 101988},
+       {4, 1, 113688},
+       {4, 1, 227892},
+       {4, 1, 254636},
+       {4, 1, 258598},
+       {4, 1, 294146},
+       {4, 1, 377576},
+       {4, 1, 472095},
+       {4, 1, 538992},
+       {4, 1, 615028},
+       {4, 1, 901544},
+       {4, 1, 911876},
+
+  /* Nature */
+       {5, 1, 10175},
+       {5, 1, 566780},
+       {5, 1, 570090},
+#endif
+};
+
+#define TOTALISTICRULES (sizeof totalistic_rules / sizeof totalistic_rules[0])
+
+#if 0
+static char lcau21_rules[][9] =
+{
+       "00010010",             /* 18 Hollow enlarging triangles */
+       "00110110",             /* 54 Hollow triangles */
+       "01101110",             /* 110 Hollow right triangles */
+       "01111100",             /* 124 Hollow left triangles */
+       "10010011",             /* 147 Solid triangles */
+       "10001001",             /* 137 Solid right triangles */
+       "11000001",             /* 193 Solid left triangles */
+};
+
+#define LCAU2RULES (sizeof lcau21_rules / sizeof lcau21_rules[0])
+#endif
+
+static char lcau31_rules[][28] =
+{
+       "000222111000111222222111000",  /* equal thirds */
+       "002220210110110211110002200",  /* threads on triangles */
+       "001121102222110110111002100",  /* interfaces of 2 vel */
+       "020201010201010102010102020",  /* class iv, sparse */
+       "020201011201011112011112120",  /* blue bground class iv */
+       "021211110211110101110101020",  /* diagonal black gaps */
+       "022221211221211012222111120",  /* macrocell w/ 012 membrane */
+       "100002021002021210021210100",  /* totalistic rule 792 (iv) */
+       "100002200112201200020121200",  /* binary counter */
+       "101021220111100222112102020",  /* two patterns compete #1 */
+       "110001000112221222112221000",  /* reversible rule */
+       "111012101002110122121102120",  /* small blue triangles */
+       "111021210012110202120212122",  /* 2 glider on 1 background */
+       "111111101010202020202010101",  /* motes and triangles */
+       "111220012222012120001221020",  /* black triangles */
+       "112110201012001210101200010",  /* dendrites */
+       "112122000000122112112122000",  /* reversible rule's reverse */
+       "200211020111110002001101210",  /* crocodile skin */
+       "202000200112001200120211100",  /* two slow gliders collide */
+       "202211000201021001100200200",  /* Red Queen's binary counter */
+       "210101012101012120012120200",  /* blue on red background */
+       "212021022100200221201101020",  /* two patterns compete #2 */
+       "220222010220211111000211010",  /* Fisch's cyclic eater */
+       "222022001222211202022120012",  /* macrocell w/ 0122 membrane */
+};
+
+#define LCAU3RULES (sizeof lcau31_rules / sizeof lcau31_rules[0])
+
+static char lcau41_rules[][65] =
+{
+       "0000000313131323232312121213232323231313131101010202020202010101",     /* skewed triangle */
+       "0000020202000000020232220203300000000101020030000100322121003020",     /* slow glider - copies bar */
+       "0000213323132331123303003213323113233123002033211332313233120001",     /* slightly chaotic symmetri */
+       "0000332030033323010020122303001002120210000000100110020220000010",     /* shuttle squeeze */
+       "0100030000030323200323120202001003000203000220001310220100200010",     /* coo gldrs */
+       "0121200113213320110223311213201013131010111011101120012132103210",     /* mixture of types */
+       "0212301103023320313223121332310023203323333231301020023120303020",     /* slo gl w/ many f gl */
+       "0320032100113332112321213211003321233210121032320000321000010200",     /* crosshatching */
+       "0323323323313310323323313310310223313310310210213310310210210210",     /* Perry's 245028 */
+       "0323330023210000121122232322122113310131032101002110122321102120",     /*  */
+       "0332200131100112230221012111210202022013210332120210222311212100",     /* cycles on dgl bgrnd */
+       "0332200131100112230221012111210202022013210332120210222311212300",     /* cycles on dgl bgrnd */
+       "1230320301231030321132211021112010202330101010112312220310311000",     /* very complex glider */
+       "1230320301321030321132211021112010212121232212112312220310311000",     /* nice cross hatching */
+       "2031122112031101123123233000321210301112010303203232213000311000",     /* gliders among stills */
+       "2202003300010200010011010011020003033000032302002203110033010200",     /* bin ctr */
+       "2313032202112320111221023212120203132000233322021310311101010030",     /* diagonal growth on mesh */
+       "2332102112210200233210120311023110322213112123233132331213211212",     /* gliderettes & latice */
+       "3000213323132331123302003213323113233123001033211332313233120000",     /* symmetric rule */
+       "3003003203213211003203213211211303213211211311323211211311321320",     /* Perry's blue background */
+       "3010213223113300321221011010123112301033010221203333211323110100",     /* v. bars w/entanglement */
+       "3111213323132331123313113213323113233123220133211332313233121110",     /* not purely symmetric */
+       "3112001202313030102330122003321023102122030102001210223122203020",     /* slow & fast gliders */
+       "3130123232333201012202313210121032302200211020313130002001103210",     /* crocodile skin */
+       "3230120202031130033311232111223012311113322032103210123012303210",     /* y/o on b/g */
+       "3330333312110010333032222222001033303222121111110000322212110010",     /* Fisch's rule */
+       "3332032303133100221122122213220022000212021022100200221203103020",     /* slow glider */
+       "3333101022220101323201012323101033331010222201013232010123231010",     /* reverse of rvble #22 */
+       "3333111122000022333311112200002233111133002222003311113300222200",     /* reversible Rule 22 */
+};
+
+#define LCAU4RULES (sizeof lcau41_rules / sizeof lcau41_rules[0])
+
+#ifdef LCAU2RULES
+#define LCAURULES (LCAU2RULES + LCAU3RULES + LCAU4RULES)
+#else
+#define LCAURULES (LCAU3RULES + LCAU4RULES)
+#endif
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned int state)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       life1dstruct *lp = &life1ds[MI_SCREEN(mi)];
+       GC          gc = lp->backGC;
+
+       if (!state) {
+               XSetForeground(display, gc, lp->black);
+               XFillRectangle(display, window, gc,
+               lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
+               return;
+       }
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, lp->colors[state - 1]));
+       if (lp->pixelmode || (MI_NPIXELS(mi) <= 2)) {
+               if (MI_NPIXELS(mi) <= 2) {
+                       XGCValues   gcv;
+
+                       gcv.stipple = lp->pixmaps[state - 1];
+                       gcv.foreground = MI_WHITE_PIXEL(mi);
+                       gcv.background = lp->black;
+                       gcv.fill_style = FillOpaqueStippled;
+                       XChangeGC(display, lp->stippledGC,
+                                 GCStipple | GCFillStyle | GCForeground | GCBackground, &gcv);
+                       XFillRectangle(display, window, lp->stippledGC,
+                                      lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
+               } else
+                       XFillRectangle(display, window, gc,
+                                      lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
+       } else {
+               (void) XPutImage(display, window, gc,
+               lp->logo, 0, 0, lp->xb + lp->xs * col, lp->yb + lp->ys * row,
+                                lp->logo->width, lp->logo->height);
+       }
+}
+
+static void
+RandomSoup(life1dstruct * lp, int n, int v)
+{
+       int         col;
+
+       v /= 2;
+       if (v < 1)
+               v = 1;
+       for (col = lp->ncols / 2 - v; col < lp->ncols / 2 + v; ++col)
+               if (NRAND(100) < n && col >= 0 && col < lp->ncols)
+                       lp->newcells[col + lp->border] = (unsigned char) NRAND(lp->k - 1) + 1;
+}
+
+static long
+power(int x, int n)
+{                              /* raise x to the nth power n >= 0 */
+       int         i;
+       long        p = 1;
+
+       for (i = 1; i <= n; ++i)
+               p = p * x;
+       return p;
+}
+
+static void
+GetRule(life1dstruct * lp, int i)
+{
+       long        sum_size, j;
+
+       if (totalistic) {
+               long        code, pow_size;
+
+               lp->k = totalistic_rules[i][0];
+               lp->r = totalistic_rules[i][1];
+               sum_size = (lp->k - 1) * (lp->r * 2 + 1) + 1;
+               code = lp->code = totalistic_rules[i][2];
+
+               pow_size = power(lp->k, (int) (sum_size - 1));  /* Should be < max long */
+               for (j = 0; j < sum_size; j++) {
+                       lp->nextstate[sum_size - 1 - j] = (char) (code / pow_size);
+                       code -= ((long) lp->nextstate[sum_size - 1 - j]) * pow_size;
+                       pow_size /= (long) lp->k;
+               }
+       } else {
+               lp->r = 1;
+#ifdef LCAU2RULES
+               if (i < (int) LCAU2RULES) {
+                       lp->k = 2;
+                       sum_size = power(lp->k, 2 * lp->r + 1);
+                       for (j = 0; j < sum_size; j++)
+                               lp->nextstate[sum_size - 1 - j] = lcau21_rules[i][j] - '0';
+               } else if (i < LCAU2RULES + LCAU3RULES)
+#else
+               if (i < (int) LCAU3RULES)
+#endif
+               {
+                       lp->k = 3;
+                       sum_size = power(lp->k, 2 * lp->r + 1);
+#ifdef LCAU2RULES
+                       i -= LCAU2RULES;
+#endif
+                       for (j = 0; j < sum_size; j++)
+                               lp->nextstate[sum_size - 1 - j] = lcau31_rules[i][j] - '0';
+               } else {
+                       lp->k = 4;
+                       sum_size = power(lp->k, 2 * lp->r + 1);
+#ifdef LCAU2RULES
+                       i -= (LCAU2RULES + LCAU3RULES);
+#else
+                       i -= LCAU3RULES;
+#endif
+                       for (j = 0; j < sum_size; j++)
+                               lp->nextstate[sum_size - 1 - j] = lcau41_rules[i][j] - '0';
+               }
+       }
+}
+
+/* The following sometimes does not detect when there are multiple periodic
+   life forms side by side. */
+static int
+compare(ModeInfo * mi)
+{
+       life1dstruct *lp = &life1ds[MI_SCREEN(mi)];
+       int         row, col, tryagain = False;
+       unsigned char *initl, *cmpr;
+
+       initl = lp->buffer + lp->row * lp->ncols;
+       for (row = lp->row - 1; row >= 0; row--) {
+               cmpr = lp->buffer + row * lp->ncols;
+               for (col = 0; col < lp->ncols; col++) {
+                       tryagain = False;
+                       if (*(initl + col) != *cmpr) {
+                               tryagain = True;
+                               break;
+                       }
+                       cmpr++;
+               }
+               if (!tryagain)
+                       return True;
+       }
+       return False;
+}
+
+static Bool
+init_stuff(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       life1dstruct *lp = &life1ds[MI_SCREEN(mi)];
+
+       if (lp->logo == None) {
+               getImage(mi, &lp->logo, CELL_WIDTH, CELL_HEIGHT, CELL_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                        DEFAULT_XPM, CELL_NAME,
+#endif
+                        &lp->graphics_format, &lp->cmap, &lp->black);
+               if (lp->logo == None) {
+                       return False;
+               }
+       }
+#ifndef STANDALONE
+       if (lp->cmap != None) {
+               setColormap(display, window, lp->cmap, MI_IS_INWINDOW(mi));
+               if (lp->backGC == None) {
+                       XGCValues   xgcv;
+
+                       xgcv.background = lp->black;
+                       if ((lp->backGC = XCreateGC(display, window, GCBackground,
+                                       &xgcv)) == NULL) {
+                               return False;
+                       }
+               }
+       } else
+#endif /* STANDALONE */
+       {
+               lp->black = MI_BLACK_PIXEL(mi);
+               lp->backGC = MI_GC(mi);
+       }
+       return True;
+}
+
+static void
+free_stuff(Display * display, life1dstruct * lp)
+{
+       if (lp->cmap != None) {
+               XFreeColormap(display, lp->cmap);
+               if (lp->backGC != None) {
+                       XFreeGC(display, lp->backGC);
+                       lp->backGC = None;
+               }
+               lp->cmap = None;
+       } else
+               lp->backGC = None;
+}
+
+static void
+free_life1d(Display * display, life1dstruct * lp)
+{
+       int         shade;
+
+       if (lp->stippledGC != NULL) {
+               XFreeGC(display, lp->stippledGC);
+               lp->stippledGC = NULL;
+       }
+       if (lp->init_bits != 0) {
+               for (shade = 0; shade < MAXSTATES; shade++)
+                       XFreePixmap(display, lp->pixmaps[shade]);
+               lp->init_bits = 0;
+       }
+       if (lp->newcells != NULL) {
+               (void) free((void *) lp->newcells);
+               lp->newcells = NULL;
+       }
+       if (lp->oldcells != NULL) {
+               (void) free((void *) lp->oldcells);
+               lp->oldcells = NULL;
+       }
+       if (lp->buffer != NULL) {
+               (void) free((void *) lp->buffer);
+               lp->buffer = NULL;
+       }
+       if (lp->nextstate != NULL) {
+               (void) free((void *) lp->nextstate);
+               lp->nextstate = NULL;
+       }
+       free_stuff(display, lp);
+       if (lp->logo) {
+               destroyImage(&lp->logo, &lp->graphics_format);
+               lp->logo = NULL;
+       }
+}
+
+void
+init_life1d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       int         i;
+       life1dstruct *lp;
+
+       if (life1ds == NULL) {
+               if ((life1ds = (life1dstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (life1dstruct))) == NULL)
+                       return;
+       }
+       lp = &life1ds[MI_SCREEN(mi)];
+
+       if (!init_stuff(mi)) {
+               free_life1d(display, lp);
+               return;
+       }
+
+       lp->screen_generation = 0;
+       lp->row = 0;
+
+       if (totalistic) {
+               maxstates = MAXSTATES;
+               maxradius = 4;
+               maxsum_size = (maxstates - 1) * (maxradius * 2 + 1) + 1;
+       } else {
+               maxstates = MAXSTATES - 1;
+               maxradius = 1;
+               maxsum_size = (int) power(maxstates, (2 * maxradius + 1));
+       }
+       if (lp->nextstate == NULL) {
+               if ((lp->nextstate = (char *) malloc(maxsum_size *
+                               sizeof (char))) == NULL) {
+                       free_life1d(display, lp);
+                       return;
+               }
+       }
+
+       if (lp->init_bits == 0) {
+               XGCValues   gcv;
+
+               gcv.fill_style = FillOpaqueStippled;
+               if ((lp->stippledGC = XCreateGC(display, window, GCFillStyle,
+                               &gcv)) == None) {
+                       free_life1d(display, lp);
+                       return;
+               }
+               for (i = 0; i < MAXSTATES - 1; i++) {
+                       LIFE1DBITS(stipples[i + NUMSTIPPLES - MAXSTATES + 1],
+                                  STIPPLESIZE, STIPPLESIZE);
+               }
+               LIFE1DBITS(stipples[NUMSTIPPLES / 2],
+                          STIPPLESIZE, STIPPLESIZE);   /* grey */
+       }
+       if (lp->newcells != NULL)
+               (void) free((void *) lp->newcells);
+       if (lp->oldcells != NULL)
+               (void) free((void *) lp->oldcells);
+       if (lp->buffer != NULL)
+               (void) free((void *) lp->buffer);
+       lp->width = MI_WIDTH(mi);
+       lp->height = MI_HEIGHT(mi);
+       if (lp->width < 2)
+               lp->width = 2;
+       if (lp->height < 2)
+               lp->height = 2;
+       if (size == 0 ||
+        MINGRIDSIZE * size > lp->width || MINGRIDSIZE * size > lp->height) {
+               if (lp->width > MINGRIDSIZE * lp->logo->width &&
+                   lp->height > MINGRIDSIZE * lp->logo->height) {
+                       lp->pixelmode = False;
+                       lp->xs = lp->logo->width;
+                       lp->ys = lp->logo->height;
+               } else {
+                       lp->pixelmode = True;
+                       lp->xs = lp->ys = MAX(MINSIZE, MIN(lp->width, lp->height) / MINGRIDSIZE);
+               }
+       } else {
+               lp->pixelmode = True;
+               if (size < -MINSIZE)
+                       lp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE)
+                       lp->ys = MINSIZE;
+               else
+                       lp->ys = MIN(size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                              MINGRIDSIZE));
+               lp->xs = lp->ys;
+       }
+       lp->ncols = MAX(lp->width / lp->xs, 2);
+       lp->nrows = MAX(lp->height / lp->ys, 2);
+       lp->border = (lp->nrows / 2 + 1) * MI_CYCLES(mi);
+       if ((lp->newcells = (unsigned char *) calloc(lp->ncols + 2 * lp->border,
+                       sizeof (unsigned char))) == NULL) {
+               free_life1d(display, lp);
+               return;
+       }
+
+       if ((lp->oldcells = (unsigned char *) calloc(lp->ncols + 2 * (maxradius +
+                       lp->border), sizeof (unsigned char))) == NULL) {
+               free_life1d(display, lp);
+               return;
+       }
+
+       if ((lp->buffer = (unsigned char *) calloc(lp->ncols * lp->nrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_life1d(display, lp);
+               return;
+       }
+
+       lp->xb = (lp->width - lp->xs * lp->ncols) / 2;
+       lp->yb = (lp->height - lp->ys * lp->nrows) / 2;
+
+       GetRule(lp, (int) NRAND((totalistic) ? TOTALISTICRULES : LCAURULES));
+       if (MI_IS_VERBOSE(mi)) {
+               (void) fprintf(stdout, "colors %d, radius %d, code %ld, ",
+                              lp->k, lp->r, lp->code);
+               if (totalistic) {
+                       (void) fprintf(stdout, "totalistic rule ");
+                       for (i = (lp->k - 1) * (lp->r * 2 + 1); i >= 0; i--)
+                               (void) fprintf(stdout, "%d", (int) lp->nextstate[i]);
+               } else {
+                       (void) fprintf(stdout, "LCAU rule ");
+                       for (i = (int) power(lp->k, (lp->r * 2 + 1)); i >= 0; i--)
+                               (void) fprintf(stdout, "%d", (int) lp->nextstate[i]);
+               }
+               (void) fprintf(stdout, "\n");
+       }
+       if (MI_NPIXELS(mi) > 2)
+               for (i = 0; i < lp->k - 1; i++)
+                       lp->colors[i] = (NRAND(MI_NPIXELS(mi)) + i * MI_NPIXELS(mi)) /
+                               (lp->k - 1);
+       RandomSoup(lp, 40, 25);
+       (void) memcpy((char *) (lp->oldcells + maxradius + lp->border),
+                     (char *) (lp->newcells + lp->border), lp->ncols);
+       lp->busyLoop = 0;
+
+       MI_CLEARWINDOWCOLORMAP(mi, lp->backGC, lp->black);
+}
+
+void
+draw_life1d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         col;
+       life1dstruct *lp;
+
+       if (life1ds == NULL)
+               return;
+       lp = &life1ds[MI_SCREEN(mi)];
+       if (lp->buffer == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (lp->busyLoop) {
+               if (lp->busyLoop >= 250)
+                       lp->busyLoop = 0;
+               else
+                       lp->busyLoop++;
+               return;
+       }
+       if (lp->row == 0) {
+               lp->repeating = 0;
+               if (lp->screen_generation > MI_CYCLES(mi))
+                       init_life1d(mi);
+
+               for (col = 0; col < lp->ncols; col++)
+                       if (lp->buffer[col] != lp->newcells[col + lp->border])
+                               drawcell(mi, col, 0, lp->newcells[col + lp->border]);
+               (void) memcpy((char *) lp->buffer, (char *) (lp->newcells + lp->border),
+                             lp->ncols);
+       } else {
+               for (col = 0; col < lp->ncols + 2 * lp->border; col++) {
+                       int         sum = 0, m;
+
+                       if (totalistic) {
+                               for (m = col - lp->r; m <= col + lp->r; m++)
+                                       sum += lp->oldcells[m + maxradius];
+                       } else {
+                               int         pow_size = 1;
+
+                               for (m = col + lp->r; m >= col - lp->r; m--) {
+                                       sum += lp->oldcells[m + maxradius] * pow_size;
+                                       pow_size *= lp->k;
+                               }
+                       }
+                       lp->newcells[col] = (unsigned char) lp->nextstate[sum];
+               }
+               (void) memcpy((char *) (lp->oldcells + maxradius),
+                         (char *) lp->newcells, lp->ncols + 2 * lp->border);
+
+               for (col = 0; col < lp->ncols; col++) {
+                       if (lp->buffer[col + lp->row * lp->ncols] !=
+                           lp->newcells[col + lp->border])
+                               drawcell(mi, col, lp->row, lp->newcells[col + lp->border]);
+               }
+               (void) memcpy((char *) (lp->buffer + lp->row * lp->ncols),
+                           (char *) (lp->newcells + lp->border), lp->ncols);
+               {
+                       int         temp = compare(mi);
+
+                       if (temp)
+                               lp->repeating += temp;
+                       else
+                               lp->repeating = 0;
+               }
+               lp->repeating += (lp->row == lp->nrows - 1) ?
+                       (lp->nrows - 1) * compare(mi) : 0;
+       }
+       if (lp->repeating >= 1) {
+               XGCValues   gcv;
+
+               gcv.stipple = lp->pixmaps[MAXSTATES - 1];
+               gcv.fill_style = FillStippled;
+               gcv.foreground = lp->black;
+               XChangeGC(MI_DISPLAY(mi), lp->stippledGC,
+                         GCStipple | GCFillStyle | GCForeground, &gcv);
+               XFillRectangle(display, MI_WINDOW(mi), lp->stippledGC,
+                              0, lp->yb + lp->ys * lp->row,
+                              lp->width, lp->ys);
+       }
+       lp->row++;
+       if (lp->repeating >= lp->nrows - 1) {
+               if (lp->row < lp->nrows) {
+                       XSetForeground(display, lp->backGC, lp->black);
+                       XFillRectangle(display, MI_WINDOW(mi), lp->backGC,
+                                      0, lp->yb + lp->ys * lp->row,
+                         lp->width, lp->height - lp->ys * lp->row - lp->yb);
+               }
+               lp->screen_generation = MI_CYCLES(mi);
+               lp->row = lp->nrows;
+       }
+       if (lp->row >= lp->nrows) {
+               lp->screen_generation++;
+               lp->busyLoop = 1;
+               lp->row = 0;
+       }
+}
+
+void
+release_life1d(ModeInfo * mi)
+{
+       if (life1ds != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_life1d(MI_DISPLAY(mi), &life1ds[screen]);
+               (void) free((void *) life1ds);
+               life1ds = NULL;
+       }
+}
+
+void
+refresh_life1d(ModeInfo * mi)
+{
+       int         row, col, nrow;
+       life1dstruct *lp;
+
+       if (life1ds == NULL)
+               return;
+       lp = &life1ds[MI_SCREEN(mi)];
+       if (lp->buffer == NULL)
+               return;
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+        if (lp->graphics_format >= IS_XPM) {
+               /* This is needed when another program changes the colormap. */
+               free_life1d(MI_DISPLAY(mi), lp);
+               init_life1d(mi);
+               return;
+       }
+#endif
+
+       for (row = 0; row < lp->nrows; row++) {
+               nrow = row * lp->ncols;
+               for (col = 0; col < lp->ncols; col++)
+                       drawcell(mi, col, row, lp->buffer[col + nrow]);
+       }
+}
+
+#endif /* MODE_life1d */
diff --git a/modes/life3d.c b/modes/life3d.c
new file mode 100644 (file)
index 0000000..25d0631
--- /dev/null
@@ -0,0 +1,2334 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* life3d --- Extension to Conway's game of Life, Carter Bays' S45/B5 3d life */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)life3d.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1994 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 18-Apr-1997: Memory leak fixed by Tom Schmidt <tschmidt@micron.com>
+ * 12-Mar-1995: added LIFE_S567B6 compile-time option
+ * 12-Feb-1995: shooting gliders added
+ * 07-Dec-1994: used life.c and a DOS version of 3dlife
+ * Copyright 1993 Anthony Wesley awesley@canb.auug.org.au found at
+ * life.anu.edu.au /pub/complex_systems/alife/3DLIFE.ZIP
+ * There is some flashing that was not in the original.  This is because
+ * the direct video memory access garbage collection was not portable.
+ *
+ *
+ * References:
+ * Dewdney, A.K., "The Armchair Universe, Computer Recreations from the
+ *   Pages of Scientific American Magazine", W.H. Freedman and Company,
+ *   New York, 1988 (February 1987 p 16)
+ * Bays, Carter, "The Game of Three Dimensional Life", 86/11/20
+ *   with (latest?) update from 87/2/1
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Life3D"
+#define HACK_INIT init_life3d
+#define HACK_DRAW draw_life3d
+#define life3d_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000000 \n" \
+ "*count: 35 \n" \
+ "*cycles: 85 \n" \
+ "*ncolors: 200 \n" \
+ "*wireframe: False \n" \
+ "*fullrandom: False \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_life3d
+
+#if 1
+#define DEF_RULE  "G"          /* All rules with gliders */
+#else
+#define DEF_RULE  "P"          /* All rules with known patterns */
+#define DEF_RULE  "S45/B5"     /* "B5/S45" */
+#define DEF_RULE  "S567/B6"    /* "B6/S567" */
+/* There are no known gliders for S56/B5 or S67/B67 */
+#endif
+
+static char *rule;
+static char *lifefile;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-rule", (char *) ".life3d.rule", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-lifefile", (char *) ".life3d.lifefile", XrmoptionSepArg, (caddr_t) NULL}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & rule, (char *) "rule", (char *) "Rule", (char *) DEF_RULE, t_String},
+       {(caddr_t *) & lifefile, (char *) "lifefile", (char *) "LifeFile", (char *) "", t_String}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-rule string", (char *) "S<survial_neighborhood>/B<birth_neighborhood> parameters"},
+       {(char *) "-lifefile file", (char *) "life file"},
+};
+
+ModeSpecOpt life3d_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   life3d_description =
+{"life3d", "init_life3d", "draw_life3d", "release_life3d",
+ "refresh_life3d", "change_life3d", NULL, &life3d_opts,
+ 1000000, 35, 85, 1, 64, 1.0, "",
+ "Shows Bays' game of 3D Life", 0, NULL};
+
+#endif
+
+#define ON 0x40
+#define OFF 0
+
+/* Don't change these numbers without changing the offset() macro below! */
+#define MAXSTACKS 64
+#define        MAXROWS 128
+#define MAXCOLUMNS 128
+#define BASESIZE ((MAXCOLUMNS*MAXROWS*MAXSTACKS)>>6)
+
+#define RT_ANGLE 90
+#define HALFRT_ANGLE 45
+#define MAXNEIGHBORS 27
+
+/* Store state of cell in top bit. Reserve low bits for count of living nbrs */
+#define Set3D(x,y,z) SetMem(lp,(unsigned int)x,(unsigned int)y,(unsigned int)z,ON)
+#define Reset3D(x,y,z) SetMem(lp,(unsigned int)x,(unsigned int)y,(unsigned int)z,OFF)
+
+#define SetList3D(x,y,z) if (!SetMem(lp,(unsigned int)x,(unsigned int)y,(unsigned int)z,ON)) return False; \
+if (!AddToList(lp,(unsigned int)x,(unsigned int)y,(unsigned int)z)) return False;
+
+#define CellState3D(c) ((c)&ON)
+#define CellNbrs3D(c) ((c)&0x1f)       /* 26 <= 31 */
+
+#define EyeToScreen 72.0       /* distance from eye to screen */
+#define HalfScreenD 14.0       /* 1/2 the diameter of screen */
+#define BUCKETSIZE 10
+#define NBUCKETS ((MAXCOLUMNS+MAXROWS+MAXSTACKS)*BUCKETSIZE)
+#define Distance(x1,y1,z1,x2,y2,z2) sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))
+
+#define IP 0.0174533
+
+#define COLORBASE 3
+#define COLORS (COLORBASE + 2)
+#define COLORSTEP (MI_NPIXELS(mi)/COLORBASE)   /* 21 different colors per side */
+
+#define BLACK 0
+#define RED 1
+#define GREEN 2
+#define BLUE 3
+#define WHITE 4
+#define NUMPTS 42
+#define NUMFILEPTS (2*NUMPTS)
+
+typedef struct _CellList {
+       unsigned char x, y, z;  /* Location in world coordinates */
+       char        visible;    /* 1 if the cube is to be displayed */
+       short       dist;       /* dist from cell to eye */
+       struct _CellList *next; /* pointer to next entry on linked list */
+       struct _CellList *prev;
+       struct _CellList *priority;
+} CellList;
+
+typedef struct {
+       int         survival, birth;
+} paramstruct;
+
+typedef struct {
+       Bool        painted;
+       paramstruct param;
+       int         pattern, patterned_rule;
+       int         ox, oy, oz; /* origin */
+       double      vx, vy, vz; /* viewpoint */
+       int         generation;
+       int         nstacks, nrows, ncolumns;
+       int         memstart;
+       char        visible;
+       unsigned char *base[BASESIZE];
+       double      A, B, C, F;
+       int         width, height;
+       unsigned long color[COLORS];
+       int         alt, azm;
+       double      dist;
+       CellList   *ptrhead, *ptrend, eraserhead, eraserend;
+       CellList   *buckethead[NBUCKETS], *bucketend[NBUCKETS];         /* comfortable upper b */
+       Bool        wireframe;
+} life3dstruct;
+
+static life3dstruct *life3ds = NULL;
+
+static paramstruct input_param;
+static Bool allPatterns = False, allGliders = False;
+static char *filePattern = NULL;
+
+/*-
+ * S45/B5 life is probably the best
+ * S567/B6 life has gliders like Conway's 2d S23/B3 life
+ * There are no known gliders for S56/B5 or S67/B67,
+ * so the others may be better
+ */
+
+static char patterns_S45B5[][3 * NUMPTS + 1] =
+{
+#if 0
+/* Still life */
+       {                       /* V */
+               -1, -1, -1, 0, -1, -1,
+               -1, 0, -1, 0, 0, -1,
+
+               -1, -1, 0, 0, -1, 0,
+               127
+       },
+       {                       /* CROSS */
+               0, 0, -1,
+
+               0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               0, 0, 1,
+               127
+       },
+       {                       /* PILLAR */
+               0, -1, -1,
+               -1, 0, -1, 1, 0, -1,
+               0, 1, -1,
+
+               0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+               127
+       },
+#endif
+       {                       /* BLINKER P2 */
+               0, 0, -1,
+
+               0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               -1, 0, 1, 1, 0, 1,
+               127
+       },
+       {                       /* DOUBLE BLINKER P2 */
+               0, -1, -1,
+               0, 1, -1,
+
+               0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               -1, 0, 1, 1, 0, 1,
+               127
+       },
+       {                       /* TRIPLE BLINKER 1 P2 */
+               -1, -1, -2,
+               -1, 0, -2,
+
+               -2, -1, -1,
+               1, 0, -1,
+               -1, 1, -1, 0, 1, -1,
+
+               -1, -2, 0, 0, -2, 0,
+               -2, -1, 0, 1, 0, 0,
+
+               0, -1, 1,
+               0, 0, 1,
+               127
+       },
+       {                       /* TRIPLE BLINKER 2 P2 */
+               -1, -1, -2, 0, -1, -2,
+
+               0, -2, -1,
+               1, -1, -1,
+               1, 0, -1,
+               -1, 1, -1,
+
+               0, -2, 0,
+               -2, -1, 0,
+               -2, 0, 0,
+               -1, 1, 0,
+
+               -1, 0, 1, 0, 0, 1,
+               127
+       },
+       {                       /* THREE HALFS BLINKER  P2 */
+               0, -1, -1,
+               -1, 0, -1, 1, 0, -1,
+
+               -1, -1, 0,
+               1, 0, 0,
+               -1, 1, 0, 0, 1, 0,
+
+               0, -1, 1,
+               0, 0, 1,
+               127
+       },
+       {                       /* PUFFER P4 */
+               0, -1, -1,
+               0, 0, -1,
+
+               0, -2, 0,
+               -1, -1, 0, 1, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+               127
+       },
+       {                       /* PINWHEEL P4 */
+               -1, 1, -1, 0, 1, -1,
+
+               -1, -1, 0, 0, -1, 0,
+               -2, 0, 0, 1, 0, 0,
+
+               -1, 0, 1, 0, 0, 1,
+               -1, 1, 1, 0, 1, 1,
+               127
+       },
+       {                       /* HEART P4 */
+               -1, -1, -1,
+               -1, 0, -1, 0, 0, -1,
+
+               0, -1, 0,
+               -2, 0, 0, 1, 0, 0,
+
+               -1, -1, 1,
+               -1, 1, 1, 0, 1, 1,
+               127
+       },
+       {                       /* ARROW P4 */
+               0, -1, -1,
+               0, 0, -1,
+
+               0, -2, 0,
+               1, -1, 0,
+               1, 0, 0,
+               0, 1, 0,
+
+               -1, -1, 1,
+               -1, 0, 1,
+               127
+       },
+       {                       /* ROTOR P2 */
+               0, -1, -1,
+               0, 0, -1,
+
+               0, -2, 0,
+               -1, -1, 0, 1, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               0, -1, 1,
+               0, 0, 1,
+               127
+       },
+       {                       /* BRONCO P4 */
+               0, -1, -1,
+               0, 0, -1,
+
+               0, -2, 0,
+               -1, -1, 0, 1, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               -1, -1, 1,
+               -1, 0, 1,
+               127
+       },
+       {                       /* TRIPUMP P2 */
+               0, -2, -2,
+               -2, -1, -2, -1, -1, -2, 0, -1, -2,
+
+               0, -2, -1,
+               -2, 0, -1,
+               -2, 1, -1, -1, 1, -1,
+
+               1, -2, 0,
+               1, -1, 0,
+               1, 0, 0,
+               -1, 1, 0,
+
+               0, 0, 1, 1, 0, 1,
+               -1, 1, 1,
+               127
+       },
+       {                       /* WINDSHIELDWIPER (HELICOPTER) P2 */
+               -2, -1, -2, -1, -1, -2,
+               0, 0, -2,
+
+               -1, -2, -1,
+               -2, -1, -1,
+               1, 0, -1,
+               -1, 1, -1, 0, 1, -1, 1, 1, -1,
+
+               0, -2, 0,
+               -2, -1, 0, 1, -1, 0,
+
+               0, -2, 1,
+               0, -1, 1,
+               0, 0, 1,
+               127
+       },
+       {                       /* WALTZER P6 */
+               -2, -1, -1, -1, -1, -1, 0, -1, -1,
+               -2, 0, -1,
+               -1, 1, -1, 0, 1, -1,
+
+               -2, -1, 0,
+               -2, 0, 0, 1, 0, 0,
+               1, 1, 0,
+
+               -1, 0, 1, 0, 0, 1,
+               0, 1, 1,
+               127
+       },
+       {                       /* BIG WALTZER P6 */
+               0, -1, -1, 1, -1, -1,
+               -1, 0, -1, 0, 0, -1,
+               -1, 1, -1,
+
+               0, -2, 0, 1, -2, 0,
+               -2, 0, 0,
+               -2, 1, 0,
+
+               0, -1, 1, 1, -1, 1,
+               -1, 0, 1, 0, 0, 1,
+               -1, 1, 1,
+               127
+       },
+       {                       /* SEESAW P2 */
+               0, 0, -2,
+
+               -2, -1, -1, -1, -1, -1,
+               -2, 0, -1,
+               0, 1, -1,
+
+               -1, -1, 0,
+               1, 0, 0,
+               0, 1, 0, 1, 1, 0,
+
+               -1, 0, 1,
+               127
+       },
+       {                       /* COLLISION -> REDIRECTION */
+               -3, 5, -7, 0, 5, -7,
+               -3, 4, -7, 0, 4, -7,
+               -2, 3, -7, -1, 3, -7,
+
+               -2, 5, -6, -1, 5, -6,
+               -2, 4, -6, -1, 4, -6,
+
+               1, -2, 1,
+
+               1, -3, 2,
+               0, -2, 2, 2, -2, 2,
+               1, -1, 2,
+
+               0, -2, 3, 2, -2, 3,
+               127
+       },
+       {                       /* COLLISION -> SEESAW P2 */
+               -4, -6, -7, -1, -6, -7,
+               -4, -5, -7, -1, -5, -7,
+               -3, -4, -7, -2, -4, -7,
+
+               -3, -6, -6, -2, -6, -6,
+               -3, -5, -6, -2, -5, -6,
+
+               1, 4, 6, 2, 4, 6,
+               0, 5, 6, 3, 5, 6,
+               0, 6, 6, 3, 6, 6,
+
+               1, 5, 5, 2, 5, 5,
+               1, 6, 5, 2, 6, 5,
+               127
+       }
+};
+
+static char patterns_S567B6[][3 * NUMPTS + 1] =
+{
+       {                       /* KNIFE-SWITCH BLINKER */
+               0, -1, -1,
+               -1, 0, -1, 0, 0, -1, 1, 0, -1,
+
+               0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 0, 1,
+               127,
+       },
+       {                       /* CLOCK */
+               0, -1, -2,
+               0, 0, -2,
+
+               -2, -1, -1, 0, -1, -1,
+               -2, 0, -1, 0, 0, -1,
+
+               -1, -1, 0, 1, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+
+               -1, -1, 1,
+               -1, 0, 1,
+               127,
+       },
+       {                       /* HALF BLINKERS */
+               0, -1, -2,
+               0, 0, -2,
+
+               -1, -1, -1, 1, -1, -1,
+               -1, 0, -1, 1, 0, -1,
+               0, 1, -1,
+
+               -1, -2, 0, 0, -2, 0, 1, -2, 0,
+               -2, -1, 0, 2, -1, 0,
+               -2, 0, 0, 2, 0, 0,
+               0, 1, 0,
+
+               -1, -1, 1, 1, -1, 1,
+               -1, 0, 1, 1, 0, 1,
+               0, 1, 1,
+
+               0, -1, 2,
+               0, 0, 2,
+               127,
+       },
+       {                       /* MUTANT HALF BLINKERS */
+               0, -1, -2,
+               0, 0, -2,
+
+               0, -2, -1,
+               -1, -1, -1, 1, -1, -1,
+               -1, 0, -1, 1, 0, -1,
+               0, 1, -1,
+
+               -1, -2, 0, 1, -2, 0,
+               -2, -1, 0, 2, -1, 0,
+               -2, 0, 0, 2, 0, 0,
+               0, 1, 0,
+
+               0, -2, 1, 1, -2, 1,
+               -1, -1, 1, 2, -1, 1,
+               -1, 0, 1, 2, 0, 1,
+               0, 1, 1,
+
+               0, -1, 2, 1, -1, 2,
+               0, 0, 2,
+               127,
+       },
+       {                       /* FUSE */
+               0, 0, 4,
+
+               0, 0, 3,
+
+               0, -2, 2,
+               -1, -1, 2, 1, -1, 2,
+               -2, 0, 2, 2, 0, 2,
+               -1, 1, 2, 1, 1, 2,
+               0, 2, 2,
+
+               0, -2, 1,
+               -1, -1, 1, 1, -1, 1,
+               -2, 0, 1, 2, 0, 1,
+               -1, 1, 1, 1, 1, 1,
+               0, 2, 1,
+
+               0, 0, 0,
+
+               0, 0, -1,
+
+               0, -2, -2,
+               -1, -1, -2, 1, -1, -2,
+               -2, 0, -2, 2, 0, -2,
+               -1, 1, -2, 1, 1, -2,
+               0, 2, -2,
+
+               0, -2, -3,
+               -1, -1, -3, 1, -1, -3,
+               -2, 0, -3, 2, 0, -3,
+               -1, 1, -3, 1, 1, -3,
+               0, 2, -3,
+
+               -1, 0, -4, 0, 0, -4, 1, 0, -4,
+               127,
+       },
+       {                       /* 2 PTS OF STAR OF DAVID */
+               1, 0, -3, 2, 0, -3,
+
+               1, -1, -2, 2, -1, -2,
+               0, 0, -2,
+               1, 1, -2, 2, 1, -2,
+
+               1, 0, -1, 2, 0, -1,
+
+               -2, 0, 0, 0, 0, 0,
+
+               -2, -1, 1,
+               -3, 0, 1, -1, 0, 1,
+               -2, 1, 1,
+
+               -2, -1, 2,
+               -3, 0, 2, -1, 0, 2,
+               -2, 1, 2,
+               127,
+       },
+       {                       /* TRIPLE BLINKER 1 */
+               0, -1, -2,
+               0, 0, -2,
+
+               -1, -1, -1, 1, -1, -1,
+               -2, 0, -1,
+               -1, 1, -1, 0, 1, -1,
+
+               -1, -2, 0, 0, -2, 0,
+               1, -1, 0,
+               -2, 0, 0, 0, 0, 0,
+
+               -1, -1, 1,
+               -1, 0, 1,
+               127,
+       },
+       {                       /* TRIPLE BLINKER 2 */
+               -1, -1, -2, 0, -1, -2,
+
+               -1, -2, -1,
+               -2, -1, -1, -1, -1, -1,
+               -2, 0, -1,
+               0, 1, -1,
+
+               -1, -2, 0,
+               1, -1, 0,
+               0, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               -1, 0, 1, 0, 0, 1,
+               127,
+       },
+       {                       /* TRIKNOT */
+               0, 0, -1, 1, 0, -1,
+
+               -1, -1, 0, 0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               0, 0, 1,
+               0, 1, 1,
+               127,
+       },
+       {                       /* SEARCHLIGHT */
+               -1, -1, -2, 0, -1, -2,
+               -1, 0, -2, 0, 0, -2,
+
+               -1, -2, -1, 0, -2, -1,
+               -2, -1, -1, 1, -1, -1,
+               -2, 0, -1, 1, 0, -1,
+               0, 1, -1,
+
+               -1, -2, 0, 0, -2, 0,
+               1, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               -1, -1, 1, 0, -1, 1,
+               127,
+       },
+       {                       /* POLE DRIVER */
+               -1, -1, -1, 0, -1, -1,
+               -1, 0, -1, 1, 0, -1,
+               0, 1, -1, 1, 1, -1,
+
+               0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0,
+
+               0, 0, 1,
+               127,
+       },
+       {                       /* LITTLE STAR */
+               0, -1, -1,
+               -1, 0, -1, 1, 0, -1,
+               -1, 1, -1, 0, 1, -1, 1, 1, -1,
+
+               -1, -1, 0, 1, -1, 0,
+               -1, 1, 0, 1, 1, 0,
+
+               -1, -1, 1, 0, -1, 1, 1, -1, 1,
+               -1, 0, 1, 1, 0, 1,
+               0, 1, 1,
+               127,
+       },
+       {                       /* JAWS */
+               0, -1, -2,
+               -1, 0, -2, 1, 0, -2,
+               0, 1, -2,
+
+               0, -2, -1,
+               -1, -1, -1, 1, -1, -1,
+               -1, 0, -1, 2, 0, -1,
+               0, 1, -1, 1, 1, -1,
+
+               -1, -2, 0, 1, -2, 0,
+               -1, -1, 0, 2, -1, 0,
+               1, 1, 0, 2, 1, 0,
+
+               0, -2, 1,
+               0, -1, 1, 1, -1, 1,
+               1, 0, 1, 2, 0, 1,
+
+               -2, 1, 1,
+               -2, 2, 1, -1, 2, 1,
+
+               -2, 1, 2, -1, 1, 2,
+               -2, 2, 2, -1, 2, 2,
+               127,
+       },
+       {                       /* NEAR SHIP */
+               -2, -1, -2, -1, -1, -2,
+               -2, 0, -2, -1, 0, -2,
+
+               -2, -1, -1, -1, -1, -1,
+               -2, 0, -1, -1, 0, -1,
+
+               0, -1, 0,
+               0, 0, 0,
+
+               -2, -1, 1, -1, -1, 1,
+               -2, 0, 1, -1, 0, 1,
+
+               -2, -1, 2, -1, -1, 2,
+               -2, 0, 2, -1, 0, 2,
+               127
+       }
+};
+
+/*-
+ * Many names of S56/B5 & S67/B67 are made up by David Bagley.
+ * They are listed in * order given by Carter Bays all p2 except "H"
+ */
+static char patterns_S56B5[][3 * NUMPTS + 1] =
+{
+       {                       /* SEESAW */
+               0, -1, -1,
+               -1, 0, -1, 0, 0, -1,
+
+               0, 0, 0, 1, 0, 0,
+               0, 1, 0,
+               127
+       },
+       {                       /* PROP */
+               -1, 0, -1, 0, 0, -1, 1, 0, -1,
+
+               0, -1, 0,
+               0, 0, 0,
+               0, 1, 0,
+               127
+       },
+       {                       /*  */
+               -1, 0, -1, 0, 0, -1,
+
+               0, -1, 0,
+               0, 0, 0, 1, 0, 0,
+               0, 1, 0,
+               127
+       },
+       {                       /* COLUMN */
+               0, 0, -6,
+
+               0, 0, -5,
+
+               0, -1, -4,
+               -1, 0, -4, 0, 0, -4, 1, 0, -4,
+               0, 1, -4,
+
+               0, -1, -1,
+               -1, 0, -1, 0, 0, -1, 1, 0, -1,
+               0, 1, -1,
+
+               0, 0, 0,
+
+               0, 0, 1,
+
+               0, 0, 2,
+
+               0, 0, 3,
+
+               0, -1, 4,
+               -1, 0, 4, 0, 0, 4, 1, 0, 4,
+               0, 1, 4,
+               127
+       },
+       {                       /* FLIPPING C */
+               -1, 0, -1, 1, 0, -1,
+
+               -1, 0, 0, 0, 0, 0, 1, 0, 0,
+               127
+       },
+       {                       /* SLIDING BLOCKS  */
+               -1, 0, -1, 0, 0, -1,
+               -1, 1, -1, 0, 1, -1,
+
+               -1, -1, 0, 0, -1, 0,
+               0, 0, 0,
+               127
+       },
+       {                       /*  */
+               -1, -1, -1,
+               -1, 1, -1,
+
+               -1, 0, 0, 0, 0, 0, 1, 0, 0,
+
+               -1, -1, 1,
+               -1, 1, 1,
+               127
+       },
+       {                       /* Y */
+               1, -1, -1,
+               -1, 0, -1,
+               0, 1, -1,
+
+               1, -1, 0,
+               -1, 0, 0, 0, 0, 0,
+               0, 1, 0,
+               127
+       },
+       {                       /* PUMP */
+               0, -1, -1,
+               -1, 0, -1, 1, 0, -1,
+               0, 1, -1,
+
+               -1, -1, 0, 0, -1, 0,
+               -1, 0, 0, 1, 0, 0,
+               0, 1, 0, 1, 1, 0,
+               127
+       },
+       {                       /* WALKER */
+               -1, -1, -1, 0, -1, -1,
+               1, 0, -1,
+
+               0, -1, 0, 1, -1, 0,
+               -1, 0, 0, 0, 0, 0,
+               127
+       },
+       {                       /* SWITCH */
+               2, -1, -2,
+               1, 0, -2, 2, 0, -2,
+
+               1, -1, -1, 2, -1, -1,
+               1, 0, -1,
+
+               1, 0, 0,
+
+               -1, -1, 1,
+               -2, 0, 1, -1, 0, 1, 0, 0, 1,
+
+               -2, -1, 2, -1, -1, 2,
+               -2, 0, 2,
+               127
+       },
+       {                       /* HOPPER */
+               -1, -1, -1, 0, -1, -1, 1, -1, -1,
+
+               0, -1, 0,
+               -1, 0, 0, 0, 0, 0, 1, 0, 0,
+               127
+       },
+       {                       /* PUSHUPS */
+               -1, -2, -2,
+
+               -1, -2, -1, 0, -2, -1,
+               -1, -1, -1, 0, -1, -1,
+
+               -1, 0, 0, 0, 0, 0,
+
+               -1, 0, 1, 0, 0, 1,
+               -1, 1, 1,
+               127
+       },
+       {                       /* PUSHER */
+               0, -2, -2,
+               0, -1, -2,
+
+               -1, -2, -1,
+               -1, -1, -1, 0, -1, -1,
+
+               -1, 0, 0, 0, 0, 0,
+               0, 1, 0,
+
+               -1, 0, 1,
+               0, 1, 1,
+               127
+       },
+       {                       /* CAPACITOR */
+               0, -1, -2,
+               -1, 0, -2, 0, 0, -2,
+
+               0, 0, -1, 1, 0, -1,
+               0, 1, -1, 1, 1, -1,
+
+               0, 0, 1, 1, 0, 1,
+               0, 1, 1, 1, 1, 1,
+
+               0, -1, 2,
+               -1, 0, 2, 0, 0, 2,
+               127
+       },
+       {                       /* CORNER 1 */
+               -1, -3, -3,
+               -1, -2, -3, 0, -2, -3,
+               1, -1, -3,
+               1, 0, -3, 2, 0, -3,
+
+               -1, -3, -2,
+               0, -2, -2,
+               1, -1, -2,
+               2, 0, -2,
+
+               -3, -3, -1, -2, -3, -1,
+               -3, -2, -1,
+               2, 1, -1,
+               1, 2, -1, 2, 2, -1,
+
+               -3, -2, 0, -2, -2, 0,
+               1, 1, 0,
+               1, 2, 0,
+
+               -3, -1, 1, -2, -1, 1,
+               -3, 0, 1,
+               0, 1, 1,
+               -1, 2, 1, 0, 2, 1,
+
+               -3, 0, 2, -2, 0, 2,
+               -1, 1, 2,
+               -1, 2, 2,
+               127
+       },
+       {                       /* CORNER 2 */
+               -2, -2, -3, -1, -2, -3,
+               -2, -1, -3,
+               2, 1, -3,
+               1, 2, -3, 2, 2, -3,
+
+               -3, -2, -2, -1, -2, -2,
+               -3, -1, -2, 0, -1, -2,
+               1, 0, -2,
+               2, 1, -2,
+               1, 3, -2, 2, 3, -2,
+
+               -3, -2, -1, -2, -2, -1,
+               0, -1, -1,
+               1, 0, -1,
+               2, 2, -1,
+               2, 3, -1,
+
+               -2, -1, 0, -1, -1, 0,
+               1, 1, 0,
+               1, 2, 0,
+
+               -2, 0, 1, -1, 0, 1,
+               0, 1, 1,
+               -3, 2, 1, 0, 2, 1,
+               -2, 3, 1,
+
+               -3, 1, 2, -2, 1, 2,
+               -3, 2, 2, -1, 2, 2,
+               -2, 3, 2, -1, 3, 2,
+               127
+       },
+       {                       /* RUNNER */
+               -1, -2, -1, 0, -2, -1,
+               0, -1, -1,
+
+               -1, -1, 0, 0, -1, 0,
+
+               -1, 0, 1, 0, 0, 1,
+               0, 1, 1,
+
+               -1, 1, 2, 0, 1, 2,
+               127
+       },
+       {                       /* BACKWARDS RUNNER */
+               -1, -2, -1, 0, -2, -1,
+               0, -1, -1,
+
+               -1, -1, 0, 0, -1, 0,
+
+               -1, 0, 1, 0, 0, 1,
+               -1, 1, 1,
+
+               -1, 0, 2, 0, 0, 2,
+               127
+       },
+       {                       /* FLIPPING H */
+               -1, 0, -1, 1, 0, -1,
+
+               -1, 0, 0, 0, 0, 0, 1, 0, 0,
+
+               -1, 0, 1, 1, 0, 1,
+               127
+       },
+       {                       /* EAGLE */
+               0, -2, -1, 1, -2, -1,
+               0, -1, -1, 1, -1, -1,
+               0, 1, -1, 1, 1, -1,
+               0, 2, -1, 1, 2, -1,
+
+               0, -1, 0,
+               -1, 0, 0,
+               0, 1, 0,
+               127
+       },
+       {                       /* VARIANT 1 */
+               1, -1, -2,
+               0, 0, -2,
+
+               0, -1, -1,
+               0, 0, -1, 1, 0, -1,
+
+               -1, -1, 0,
+
+               0, -1, 1,
+               0, 0, 1, 1, 0, 1,
+
+               1, -1, 2,
+               0, 0, 2,
+               127
+       },
+       {                       /* VARIANT 2 */
+               0, -1, -2,
+               1, 0, -2,
+
+               0, -1, -1, 1, -1, -1,
+               0, 0, -1,
+
+               -1, 0, 0,
+
+               0, -1, 1,
+               0, 0, 1, 1, 0, 1,
+
+               1, -1, 2,
+               0, 0, 2,
+               127
+       },
+       {                       /* VARIANT 3 */
+               1, -1, -2,
+               0, 0, -2,
+
+               0, -1, -1, 1, -1, -1,
+               0, 0, -1,
+
+               -1, -1, 0,
+
+               0, -1, 1,
+               0, 0, 1, 1, 0, 1,
+
+               1, -1, 2,
+               0, 0, 2,
+               127
+       },
+       {                       /* VARIANT 4 */
+               1, -1, -2,
+               0, 0, -2,
+
+               0, -1, -1, 1, -1, -1,
+               0, 0, -1,
+
+               -1, 0, 0,
+
+               0, -1, 1,
+               0, 0, 1, 1, 0, 1,
+
+               1, -1, 2,
+               0, 0, 2,
+               127
+       },
+       {                       /* SQUID */
+               -2, -1, -2, -1, -1, -2,
+               1, 1, -2,
+               1, 2, -2,
+
+               -2, -1, -1, -1, -1, -1, 0, -1, -1,
+               1, 0, -1,
+               1, 1, -1,
+               1, 2, -1,
+
+               -1, -1, 0,
+               1, 1, 0,
+
+               -1, 0, 1,
+               -2, 1, 1, -1, 1, 1, 0, 1, 1,
+               -2, 2, 1, -1, 2, 1,
+               127
+       },
+       {                       /* ROWER */
+               0, 1, -2,
+
+               -1, -1, -1, 1, -1, -1,
+               -2, 0, -1, -1, 0, -1, 1, 0, -1, 2, 0, -1,
+
+               -1, 0, 0, 1, 0, 0,
+               -1, 1, 0, 1, 1, 0,
+
+               0, -1, 1,
+               127
+       },
+       {                       /* FLIP */
+               -1, -2, -2,
+               0, -1, -2,
+               0, 0, -2,
+
+               -1, -2, -1,
+               -2, -1, -1, 1, -1, -1,
+               1, 0, -1,
+               1, 1, -1,
+
+               -1, -2, 0,
+               -2, -1, 0,
+               -1, 1, 0, 0, 1, 0,
+
+               -2, 0, 1, -1, 0, 1, 0, 0, 1,
+               127
+       }
+};
+static char patterns_S67B67[][3 * NUMPTS + 1] =
+{
+       {                       /* WALKING BOX */
+               -1, -1, -2,
+               0, 0, -2,
+
+               -1, -2, -1, 0, -2, -1,
+               -2, -1, -1, 1, -1, -1,
+               -2, 0, -1, 1, 0, -1,
+               -1, 1, -1, 0, 1, -1,
+
+               -1, -2, 0, 0, -2, 0,
+               -2, -1, 0, 1, -1, 0,
+               -2, 0, 0, 1, 0, 0,
+               -1, 1, 0, 0, 1, 0,
+
+               -1, -1, 1,
+               0, 0, 1,
+               127
+       },
+       {                       /* WALKER */
+               0, -1, -1,
+               -1, 0, -1,
+
+               -1, -1, 0, 0, -1, 0,
+               -1, 0, 0, 0, 0, 0,
+
+               0, -1, 1,
+               -1, 0, 1,
+               127
+       },
+       {                       /* S */
+               -1, -1, -1, 0, -1, -1,
+               -1, 0, -1, 0, 0, -1,
+
+               -1, 0, 0, 0, 0, 0,
+               -1, 1, 0, 0, 1, 0,
+               127
+       },
+       {                       /* BACKWARDS ARROW */
+               -1, 0, -1, 0, 0, -1,
+
+               -1, 0, 0, 0, 0, 0,
+               -1, 1, 0, 0, 1, 0,
+
+               -1, -1, 1, 0, -1, 1,
+               127
+       },
+       {                       /* SPINING BOX */
+               -1, -1, -2, 0, -1, -2,
+               -1, 0, -2, 0, 0, -2,
+
+               0, -2, -1,
+               -2, -1, -1, 1, -1, -1,
+               -2, 0, -1,
+               -1, 1, -1, 0, 1, -1,
+
+               -1, -2, 0, 0, -2, 0,
+               -2, -1, 0, 1, -1, 0,
+               -2, 0, 0, 1, 0, 0,
+               -1, 1, 0, 0, 1, 0,
+
+               -1, -1, 1, 0, -1, 1,
+               0, 0, 1,
+               127
+       },
+       {                       /* FLIPPING T */
+               0, 0, -1,
+
+               0, 0, 0,
+
+               0, -1, 1,
+               -1, 0, 1, 0, 0, 1, 1, 0, 1,
+               -1, 1, 1, 0, 1, 1,
+               127
+       }
+};
+
+static int  patterns_rules[] =
+{
+       (sizeof patterns_S45B5 / sizeof patterns_S45B5[0]),
+       (sizeof patterns_S567B6 / sizeof patterns_S567B6[0]),
+       (sizeof patterns_S56B5 / sizeof patterns_S56B5[0]),
+       (sizeof patterns_S67B67 / sizeof patterns_S67B67[0])
+};
+
+static paramstruct param_rules[] =
+{
+       {0x30, 0x20},
+       {0xE0, 0x40},
+       {0x60, 0x20},
+       {0xC0, 0xC0}
+};
+
+#define LIFE_S45B5 0
+#define LIFE_S567B6 1
+#define LIFE_GLIDERS 2         /* GLIDER rules are first in param_rules */
+#define LIFE_S56B5 2
+#define LIFE_S67B67 3
+#define LIFE_RULES (sizeof patterns_rules / sizeof patterns_rules[0])
+
+static int
+codeToPatternedRule(paramstruct param)
+{
+       unsigned int i;
+
+       for (i = 0; i < LIFE_RULES; i++)
+               if (param_rules[i].survival == param.survival &&
+                   param_rules[i].birth == param.birth)
+                       return i;
+       return LIFE_RULES;
+}
+
+static void
+copyFromPatternedRule(paramstruct * param, int patterned_rule)
+{
+       param->survival = param_rules[patterned_rule].survival;
+       param->birth = param_rules[patterned_rule].birth;
+}
+
+static void
+printRule(paramstruct param)
+{
+       int         l;
+
+       (void) fprintf(stdout, "rule (Survival/Birth neighborhood): S");
+       for (l = 0; l <= MAXNEIGHBORS; l++) {
+               if (param.survival & (1 << l))
+                       (void) fprintf(stdout, "%d", l);
+       }
+       (void) fprintf(stdout, "/B");
+       for (l = 0; l <= MAXNEIGHBORS; l++) {
+               if (param.birth & (1 << l))
+                       (void) fprintf(stdout, "%d", l);
+       }
+       (void) fprintf(stdout, "\nbinary rule: Survival 0x%X, Birth 0x%X\n",
+                      param.survival, param.birth);
+}
+
+/*-
+ * This stuff is not good for rules above 9 cubes but it is unlikely that
+ * these modes would be much good anyway....  death assumed.
+ */
+static void
+parseRule(ModeInfo * mi)
+{
+       int         n, l;
+       char        serving = 0;
+       static Bool found = False;
+
+       if (found)
+               return;
+
+       input_param.survival = input_param.birth = 0;
+       if (rule) {
+               n = 0;
+               while (rule[n]) {
+                       if (rule[n] == 'P') {
+                               allPatterns = True;
+                               found = True;
+                               if (MI_IS_VERBOSE(mi))
+                                       (void) fprintf(stdout, "rule: All rules with known patterns\n");
+                               return;
+                       } else if (rule[n] == 'G') {
+                               allGliders = True;
+                               found = True;
+                               if (MI_IS_VERBOSE(mi))
+                                       (void) fprintf(stdout, "rule: All rules with known gliders\n");
+                               return;
+                       } else if (rule[n] == 'S' || rule[n] == 'E' || rule[n] == 'L') {
+                               serving = 'S';
+                       } else if (rule[n] == 'B') {
+                               serving = 'B';
+                       } else {
+                               l = rule[n] - '0';
+                               if (l >= 0 && l <= 9 /*&& l <= MAXNEIGHBORS */ ) {      /* no 10..27 */
+                                       if (serving == 'S') {
+                                               found = True;
+                                               input_param.survival |= (1 << l);
+                                       } else if (serving == 'B') {
+                                               found = True;
+                                               input_param.birth |= (1 << l);
+                                       }
+                               }
+                       }
+                       n++;
+               }
+       }
+       if (!found) {           /* Default to Bays' rules if very stupid */
+               allGliders = True;
+               found = True;
+               if (MI_IS_VERBOSE(mi))
+                       (void) fprintf(stdout,
+                                      "rule: Defaulting to all rules with known gliders\n");
+               return;
+       }
+       if (MI_IS_VERBOSE(mi))
+               printRule(input_param);
+}
+
+static void
+parseFile(void)
+{
+       FILE       *file;
+       static Bool done = False;
+       int         firstx, firsty, x = 0, y = 0, z = 0, i = 0;
+       int         c, cprev = ' ';
+       char        line[256];
+
+       if (done)
+               return;
+       done = True;
+       if (!lifefile || !*lifefile ||
+           ((file = my_fopen(lifefile, "r")) == NULL)) {
+               /*(void) fprintf(stderr, "could not read file \"%s\"\n", lifefile); */
+               return;
+       }
+       for (;;) {
+               if (!fgets(line, 256, file)) {
+                       (void) fprintf(stderr, "could not read header of file \"%s\"\n",
+                                      lifefile);
+                       (void) fclose(file);
+                       return;
+               }
+               if (strncmp(line, "#P", (size_t) 2) == 0 &&
+                   sscanf(line, "#P %d %d %d", &x, &y, &z) == 3)
+                       break;
+       }
+       c = getc(file);
+       while (c != EOF && !(c == '0' || c == 'O' || c == '*' || c == '.')) {
+               c = getc(file);
+       }
+       if (c == EOF || x <= -127 || y <= -127 || z <= -127 ||
+           x >= 127 || y >= 127 || z >= 127) {
+               (void) fprintf(stderr, "corrupt file \"%s\" or file to large\n",
+                              lifefile);
+               (void) fclose(file);
+               return;
+       }
+       firstx = x;
+       firsty = y;
+       if ((filePattern = (char *) malloc((3 * NUMFILEPTS + 1) *
+                        sizeof (char))) == NULL) {
+               (void) fprintf(stderr, "not enough memory\n");
+               (void) fclose(file);
+       }
+
+       while (c != EOF && x < 127 && y < 127 && i < 3 * NUMFILEPTS) {
+               if (c == '0' || c == 'O' || c == '*') {
+                       filePattern[i++] = x++;
+                       filePattern[i++] = y;
+                       filePattern[i++] = z;
+               } else if (c == '.') {
+                       x++;
+               } else if (c == '\n') {
+                       if (cprev == '\n') {
+                               z++;
+                               y = firsty;
+                       } else {
+                               x = firstx;
+                               y++;
+                       }
+               }
+               cprev = c;
+               c = getc(file);
+       }
+       (void) fclose(file);
+       filePattern[i] = 127;
+}
+
+/*--- list ---*/
+/* initialise the state of all cells to OFF */
+static void
+Init3D(life3dstruct * lp)
+{
+       lp->ptrhead = lp->ptrend = NULL;
+       lp->eraserhead.next = &lp->eraserend;
+       lp->eraserend.prev = &lp->eraserhead;
+}
+
+/*-
+ * Function that adds the cell (assumed live) at (x,y,z) onto the search
+ * list so that it is scanned in future generations
+ */
+static Bool
+AddToList(life3dstruct * lp, unsigned int x, unsigned int y, unsigned int z)
+{
+       CellList   *tmp;
+
+       if ((tmp = (CellList *) malloc(sizeof (CellList))) == NULL)
+               return False;
+       tmp->x = x;
+       tmp->y = y;
+       tmp->z = z;
+       if (lp->ptrhead == NULL) {
+               lp->ptrhead = lp->ptrend = tmp;
+               tmp->prev = NULL;
+       } else {
+               lp->ptrend->next = tmp;
+               tmp->prev = lp->ptrend;
+               lp->ptrend = tmp;
+       }
+       lp->ptrend->next = NULL;
+       return True;
+}
+
+static void
+AddToEraseList(life3dstruct * lp, CellList * cell)
+{
+       cell->next = &lp->eraserend;
+       cell->prev = lp->eraserend.prev;
+       lp->eraserend.prev->next = cell;
+       lp->eraserend.prev = cell;
+}
+
+static void
+DelFromList(life3dstruct * lp, CellList * cell)
+{
+       if (cell != lp->ptrhead)
+               cell->prev->next = cell->next;
+       else {
+               lp->ptrhead = cell->next;
+               if (lp->ptrhead != NULL)
+                       lp->ptrhead->prev = NULL;
+       }
+
+       if (cell != lp->ptrend)
+               cell->next->prev = cell->prev;
+       else {
+               lp->ptrend = cell->prev;
+               if (lp->ptrend != NULL)
+                       lp->ptrend->next = NULL;
+       }
+
+       AddToEraseList(lp, cell);
+}
+
+static void
+DelFromEraseList(CellList * cell)
+{
+       cell->next->prev = cell->prev;
+       cell->prev->next = cell->next;
+       (void) free((void *) cell);
+}
+
+/*--- memory ---*/
+/*-
+ * Simulate a large array by dynamically allocating 4x4x4 size cells when
+ * needed.
+ */
+static void
+MemInit(life3dstruct * lp)
+{
+       int         i;
+
+       for (i = 0; i < BASESIZE; ++i) {
+               if (lp->base[i] != NULL) {
+                       (void) free((void *) lp->base[i]);
+                       lp->base[i] = NULL;
+               }
+       }
+       lp->memstart = 0;
+}
+
+#define BASE_OFFSET(x,y,z,b,o) \
+b = ((x & 0x7c) << 7) + ((y & 0x7c) << 2) + ((z & 0x7c) >> 2); \
+o = (x & 3) + ((y & 3) << 2) + ((z & 3) << 4); \
+if (lp->base[b] == NULL) {\
+if ((lp->base[b] = (unsigned char *) calloc(64, sizeof (unsigned char))) == NULL) {return False;}}
+
+
+static Bool
+GetMem(life3dstruct * lp, unsigned int x, unsigned int y, unsigned int z,
+               int *m)
+{
+       int         b, o;
+
+       if (lp->memstart)
+               MemInit(lp);
+       BASE_OFFSET(x, y, z, b, o);
+       *m = lp->base[b][o];
+       return True;
+}
+
+static Bool
+SetMem(life3dstruct * lp,
+       unsigned int x, unsigned int y, unsigned int z, unsigned int val)
+{
+       int         b, o;
+
+       if (lp->memstart)
+               MemInit(lp);
+       BASE_OFFSET(x, y, z, b, o);
+       lp->base[b][o] = val;
+       return True;
+}
+
+static Bool
+ChangeMem(life3dstruct * lp,
+         unsigned int x, unsigned int y, unsigned int z, unsigned int val)
+{
+       int         b, o;
+
+       if (lp->memstart)
+               MemInit(lp);
+       BASE_OFFSET(x, y, z, b, o);
+       lp->base[b][o] += val;
+       return True;
+}
+
+static void
+ClearMem(life3dstruct * lp)
+{
+       int         i, j, count;
+
+       for (i = 0; i < BASESIZE; ++i)
+               if (lp->base[i] != NULL) {
+                       for (count = j = 0; j < 64 && count == 0; ++j)
+                               if (CellState3D(lp->base[i][j]))
+                                       ++count;
+                       if (!count) {
+                               (void) free((void *) lp->base[i]);
+                               lp->base[i] = NULL;
+                       }
+               }
+}
+
+
+/*-
+ * This routine increments the values stored in the 27 cells centred on
+ * (x,y,z) Note that the offset() macro implements wrapping - the world is a
+ * torus.
+ */
+static Bool
+IncrementNbrs3D(life3dstruct * lp, CellList * cell)
+{
+       int         xc, yc, zc, x, y, z;
+
+       xc = cell->x;
+       yc = cell->y;
+       zc = cell->z;
+       for (z = zc - 1; z != zc + 2; ++z)
+               for (y = yc - 1; y != yc + 2; ++y)
+                       for (x = xc - 1; x != xc + 2; ++x)
+                               if (x != xc || y != yc || z != zc)
+                                       if (!ChangeMem(lp,
+                                                 (unsigned int) x, (unsigned int) y, (unsigned int) z, 1))
+                                               return False;
+       return True;
+}
+
+static void
+End3D(life3dstruct * lp)
+{
+       CellList   *ptr;
+
+       while (lp->ptrhead != NULL) {
+               /* SetMem(lp, lp->ptrhead->x, lp->ptrhead->y, lp->ptrhead->z, OFF); */
+               DelFromList(lp, lp->ptrhead);
+       }
+       ptr = lp->eraserhead.next;
+       while (ptr != &lp->eraserend) {
+               DelFromEraseList(ptr);
+               ptr = lp->eraserhead.next;
+       }
+       MemInit(lp);
+}
+
+static Bool
+RunLife3D(life3dstruct * lp)
+{
+       unsigned int x, y, z, xc, yc, zc;
+       int         c;
+       CellList   *ptr, *ptrnextcell;
+
+       /* Step 1 - Add 1 to all neighbours of living cells. */
+       ptr = lp->ptrhead;
+       while (ptr != NULL) {
+               if (!IncrementNbrs3D(lp, ptr))
+                       return False;
+               ptr = ptr->next;
+       }
+
+       /* Step 2 - Scan world and implement Survival rules. We have a list of live
+        * cells, so do the following:
+        * Start at the END of the list and work backwards (so we don't have to worry
+        * about scanning newly created cells since they are appended to the end) and
+        * for every entry, scan its neighbours for new live cells. If found, add them
+        * to the end of the list. If the centre cell is dead, unlink it.
+        * Make sure we do not append multiple copies of cells.
+        */
+       ptr = lp->ptrend;
+       while (ptr != NULL) {
+               ptrnextcell = ptr->prev;
+               xc = ptr->x;
+               yc = ptr->y;
+               zc = ptr->z;
+               for (z = zc - 1; z != zc + 2; ++z)
+                       for (y = yc - 1; y != yc + 2; ++y)
+                               for (x = xc - 1; x != xc + 2; ++x)
+                                       if (x != xc || y != yc || z != zc) {
+                                               if (!GetMem(lp, x, y, z, &c))
+                                                       return False;
+                                               if (c) {
+                                                       if (CellState3D(c) == OFF) {
+                                                               if (lp->param.birth & (1 << CellNbrs3D(c))) {
+                                                                       SetList3D(x, y, z);
+                                                               } else {
+                                                                       if (!Reset3D(x, y, z))
+                                                                               return False;
+                                                               }
+                                                       }
+                                               }
+                                       }
+               if (!GetMem(lp, xc, yc, zc, &c))
+                       return False;
+               if (lp->param.survival & (1 << CellNbrs3D(c))) {
+                       if (!Set3D(xc, yc, zc))
+                               return False;
+               } else {
+                       if (!SetMem(lp, ptr->x, ptr->y, ptr->z, OFF))
+                               return False;
+                       DelFromList(lp, ptr);
+               }
+               ptr = ptrnextcell;
+       }
+       ClearMem(lp);
+       return True;
+}
+
+#if 0
+static int
+CountCells3D(life3dstruct * lp)
+{
+       CellList   *ptr;
+       int         count = 0;
+
+       ptr = lp->ptrhead;
+       while (ptr != NULL) {
+               ++count;
+               ptr = ptr->next;
+       }
+       return count;
+}
+
+void
+DisplayList(life3dstruct * lp)
+{
+       CellList   *ptr;
+       int         count = 0;
+
+       ptr = lp->ptrhead;
+       while (ptr != NULL) {
+               (void) printf("(%x)=[%d,%d,%d] ", (int) ptr, ptr->x, ptr->y, ptr->z);
+               ptr = ptr->next;
+               ++count;
+       }
+       (void) printf("Living cells = %d\n", count);
+}
+
+#endif
+
+static Bool
+RandomSoup(ModeInfo * mi, int n, int v)
+{
+       life3dstruct *lp = &life3ds[MI_SCREEN(mi)];
+       int         x, y, z;
+
+       v /= 2;
+       if (v < 1)
+               v = 1;
+       for (z = lp->nstacks / 2 - v; z < lp->nstacks / 2 + v; ++z)
+               for (y = lp->nrows / 2 - v; y < lp->nrows / 2 + v; ++y)
+                       for (x = lp->ncolumns / 2 - v; x < lp->ncolumns / 2 + v; ++x)
+                               if (NRAND(100) < n) {
+                                       SetList3D(x, y, z);
+                               }
+       if (MI_IS_VERBOSE(mi)) {
+               (void) fprintf(stdout, "random pattern\n");
+       }
+       return True;
+}
+
+static Bool
+GetPattern(ModeInfo * mi, int pattern_rule, int pattern)
+{
+       life3dstruct *lp = &life3ds[MI_SCREEN(mi)];
+       int         x, y, z;
+       char       *patptr = NULL;
+
+       if (filePattern) {
+               patptr = &filePattern[0];
+       } else {
+               switch (pattern_rule) {
+                       case LIFE_S45B5:
+                               patptr = &patterns_S45B5[pattern][0];
+                               break;
+                       case LIFE_S567B6:
+                               patptr = &patterns_S567B6[pattern][0];
+                               break;
+                       case LIFE_S56B5:
+                               patptr = &patterns_S56B5[pattern][0];
+                               break;
+                       case LIFE_S67B67:
+                               patptr = &patterns_S67B67[pattern][0];
+                               break;
+               }
+       }
+       while ((x = *patptr++) != 127) {
+               y = *patptr++;
+               z = *patptr++;
+               x += lp->ncolumns / 2;
+               y += lp->nrows / 2;
+               z += lp->nstacks / 2;
+               if (x >= 0 && y >= 0 && z >= 0 &&
+                   x < lp->ncolumns && y < lp->nrows && z < lp->nstacks) {
+                       SetList3D(x, y, z);
+               }
+       }
+       if (MI_IS_VERBOSE(mi) && !filePattern) {
+               (void) fprintf(stdout, "table number %d\n", pattern);
+       }
+       return True;
+}
+
+static void
+NewViewpoint(life3dstruct * lp, double x, double y, double z)
+{
+       double      k, l, d1, d2;
+
+       k = x * x + y * y;
+       l = sqrt(k + z * z);
+       k = sqrt(k);
+       d1 = (EyeToScreen / HalfScreenD);
+       d2 = EyeToScreen / (HalfScreenD * lp->height / lp->width);
+       lp->A = d1 * l * (lp->width / 2) / k;
+       lp->B = l * l;
+       lp->C = d2 * (lp->height / 2) / k;
+       lp->F = k * k;
+}
+
+static void
+NewPoint(life3dstruct * lp, double x, double y, double z,
+        register XPoint * cubepts)
+{
+       double      p1, E;
+
+       p1 = x * lp->vx + y * lp->vy;
+       E = lp->B - p1 - z * lp->vz;
+       cubepts->x = (int) (lp->width / 2 - lp->A * (lp->vx * y - lp->vy * x) / E);
+       cubepts->y = (int) (lp->height / 2 - lp->C * (z * lp->F - lp->vz * p1) / E);
+}
+
+
+/* Chain together all cells that are at the same distance. These * cannot
+   mutually overlap. */
+static void
+SortList(life3dstruct * lp)
+{
+       short       dist;
+       double      d, x, y, z, rsize;
+       int         i, r;
+       XPoint      point;
+       CellList   *ptr;
+
+       for (i = 0; i < NBUCKETS; ++i)
+               lp->buckethead[i] = lp->bucketend[i] = NULL;
+
+       /* Calculate distances and re-arrange pointers to chain off buckets */
+       ptr = lp->ptrhead;
+       while (ptr != NULL) {
+
+               x = (double) ptr->x - lp->ox;
+               y = (double) ptr->y - lp->oy;
+               z = (double) ptr->z - lp->oz;
+               d = Distance(lp->vx, lp->vy, lp->vz, x, y, z);
+               if (lp->vx * (lp->vx - x) + lp->vy * (lp->vy - y) +
+                   lp->vz * (lp->vz - z) > 0 && d > 1.5)
+                       ptr->visible = 1;
+               else
+                       ptr->visible = 0;
+
+               ptr->dist = (short) d;
+               dist = (short) (d * BUCKETSIZE);
+               if (dist > NBUCKETS - 1)
+                       dist = NBUCKETS - 1;
+
+               if (lp->buckethead[dist] == NULL) {
+                       lp->buckethead[dist] = lp->bucketend[dist] = ptr;
+                       ptr->priority = NULL;
+               } else {
+                       lp->bucketend[dist]->priority = ptr;
+                       lp->bucketend[dist] = ptr;
+                       lp->bucketend[dist]->priority = NULL;
+               }
+               ptr = ptr->next;
+       }
+
+       /* Check for invisibility */
+       rsize = 0.47 * lp->width / ((double) HalfScreenD * 2);
+       i = lp->azm;
+       if (i < 0)
+               i = -i;
+       i = i % RT_ANGLE;
+       if (i > HALFRT_ANGLE)
+               i = RT_ANGLE - i;
+       rsize /= cos(i * IP);
+
+       lp->visible = 0;
+       for (i = 0; i < NBUCKETS; ++i)
+               if (lp->buckethead[i] != NULL) {
+                       ptr = lp->buckethead[i];
+                       while (ptr != NULL) {
+                               if (ptr->visible) {
+                                       x = (double) ptr->x - lp->ox;
+                                       y = (double) ptr->y - lp->oy;
+                                       z = (double) ptr->z - lp->oz;
+                                       NewPoint(lp, x, y, z, &point);
+
+                                       r = (int) (rsize * (double) EyeToScreen / (double) ptr->dist);
+                                       if (point.x + r >= 0 && point.y + r >= 0 &&
+                                           point.x - r < lp->width && point.y - r < lp->height)
+                                               lp->visible = 1;
+                               }
+                               ptr = ptr->priority;
+                       }
+               }
+}
+
+static void
+DrawFace(ModeInfo * mi, int color, XPoint * cubepts,
+        int p1, int p2, int p3, int p4)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       life3dstruct *lp = &life3ds[MI_SCREEN(mi)];
+       XPoint      facepts[5];
+
+       facepts[0] = cubepts[p1];
+       facepts[1] = cubepts[p2];
+       facepts[2] = cubepts[p3];
+       facepts[3] = cubepts[p4];
+       facepts[4] = cubepts[p1];
+
+       if (!lp->wireframe) {
+               XSetForeground(display, gc, lp->color[color]);
+               XFillPolygon(display, MI_WINDOW(mi), gc, facepts, 4,
+                            Convex, CoordModeOrigin);
+       }
+       if (lp->wireframe) {
+               XSetForeground(display, gc, lp->color[color]);
+       } else if (color == BLACK || MI_NPIXELS(mi) <= 2) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       XDrawLines(display, MI_WINDOW(mi), gc, facepts, 5, CoordModeOrigin);
+}
+
+#define LEN 0.45
+#define LEN2 0.9
+
+static int
+DrawCube(ModeInfo * mi, CellList * cell)
+{
+       life3dstruct *lp = &life3ds[MI_SCREEN(mi)];
+       XPoint      cubepts[8]; /* screen coords for point */
+       int         i = 0, out;
+       unsigned int mask;
+       double      x, y, z;
+       double      dx, dy, dz;
+
+       x = (double) cell->x - lp->ox;
+       y = (double) cell->y - lp->oy;
+       z = (double) cell->z - lp->oz;
+       out = 0;
+       for (dz = z - LEN; dz <= z + LEN2; dz += LEN2)
+               for (dy = y - LEN; dy <= y + LEN2; dy += LEN2)
+                       for (dx = x - LEN; dx <= x + LEN2; dx += LEN2) {
+                               NewPoint(lp, dx, dy, dz, &cubepts[i]);
+                               if (cubepts[i].x < 0 || cubepts[i].x >= lp->width ||
+                                   cubepts[i].y < 0 || cubepts[i].y >= lp->height)
+                                       ++out;
+                               ++i;
+                       }
+       if (out == 8)
+               return (0);
+
+       if (cell->visible)
+               mask = 0xFFFF;
+       else
+               mask = 0x0;
+
+       /* Only draw those faces that are visible */
+       dx = lp->vx - x;
+       dy = lp->vy - y;
+       dz = lp->vz - z;
+       if (lp->wireframe) {
+               if (dz <= LEN)
+                       DrawFace(mi, (int) (BLUE & mask), cubepts, 4, 5, 7, 6);
+               else if (dz >= -LEN)
+                       DrawFace(mi, (int) (BLUE & mask), cubepts, 0, 1, 3, 2);
+               if (dx <= LEN)
+                       DrawFace(mi, (int) (GREEN & mask), cubepts, 1, 3, 7, 5);
+               else if (dx >= -LEN)
+                       DrawFace(mi, (int) (GREEN & mask), cubepts, 0, 2, 6, 4);
+               if (dy <= LEN)
+                       DrawFace(mi, (int) (RED & mask), cubepts, 2, 3, 7, 6);
+               else if (dy >= -LEN)
+                       DrawFace(mi, (int) (RED & mask), cubepts, 0, 1, 5, 4);
+       }
+       if (dz > LEN)
+               DrawFace(mi, (int) (BLUE & mask), cubepts, 4, 5, 7, 6);
+       else if (dz < -LEN)
+               DrawFace(mi, (int) (BLUE & mask), cubepts, 0, 1, 3, 2);
+       if (dx > LEN)
+               DrawFace(mi, (int) (GREEN & mask), cubepts, 1, 3, 7, 5);
+       else if (dx < -LEN)
+               DrawFace(mi, (int) (GREEN & mask), cubepts, 0, 2, 6, 4);
+       if (dy > LEN)
+               DrawFace(mi, (int) (RED & mask), cubepts, 2, 3, 7, 6);
+       else if (dy < -LEN)
+               DrawFace(mi, (int) (RED & mask), cubepts, 0, 1, 5, 4);
+       return (1);
+}
+
+static void
+DrawScreen(ModeInfo * mi)
+{
+       life3dstruct *lp = &life3ds[MI_SCREEN(mi)];
+       CellList   *ptr;
+       CellList   *eraserptr;
+       int         i;
+
+       SortList(lp);
+
+       /* Erase dead cubes */
+       eraserptr = lp->eraserhead.next;
+       while (eraserptr != &lp->eraserend) {
+               eraserptr->visible = 0;
+               (void) DrawCube(mi, eraserptr);
+               DelFromEraseList(eraserptr);
+               eraserptr = lp->eraserhead.next;
+       }
+
+       /* draw furthest cubes first */
+       for (i = NBUCKETS - 1; i >= 0; --i) {
+               ptr = lp->buckethead[i];
+               while (ptr != NULL) {
+                       /*if (ptr->visible) */
+                       /* v += */ (void) DrawCube(mi, ptr);
+                       ptr = ptr->priority;
+                       /* ++count; */
+               }
+       }
+#if 0
+       {
+               int         count = 0, v = 0;
+
+
+               (void) printf("Pop=%-4d  Viewpoint (%3d,%3d,%3d)  Origin (%3d,%3d,%3d)  Mode %dx%d\
+(%d,%d) %d\n",
+                    count, (int) (lp->vx + lp->ox), (int) (lp->vy + lp->oy),
+                             (int) (lp->vz + lp->oz), (int) lp->ox, (int) lp->oy, (int) lp->oz,
+                             lp->width, lp->height, lp->alt, lp->azm, v);
+       }
+#endif
+}
+
+static Bool
+shooter(life3dstruct * lp)
+{
+       int         hsp, vsp, asp, hoff = 1, voff = 1, aoff = 1, r, c2,
+                   r2, s2;
+
+       /* Generate the glider at the edge of the screen */
+#define V 10
+#define V2 (V/2)
+       c2 = lp->ncolumns / 2;
+       r2 = lp->nrows / 2;
+       s2 = lp->nstacks / 2;
+       r = NRAND(3);
+       if (!r) {
+               hsp = NRAND(V2) + c2 - V2 / 2;
+               vsp = (LRAND() & 1) ? r2 - V : r2 + V;
+               asp = (LRAND() & 1) ? s2 - V : s2 + V;
+               if (asp > s2)
+                       aoff = -1;
+               if (vsp > r2)
+                       voff = -1;
+               if (hsp > c2)
+                       hoff = -1;
+               if (lp->patterned_rule == LIFE_S45B5) {
+                       SetList3D(hsp + 0 * hoff, vsp + 0 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 1 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 2 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 2 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 3 * hoff, vsp + 0 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 3 * hoff, vsp + 1 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 0 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 0 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+               } else if (lp->patterned_rule == LIFE_S567B6) {
+                       SetList3D(hsp + 0 * hoff, vsp + 1 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 2 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 2 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 0 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 0 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 1 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 2 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 2 * voff, asp + 2 * aoff);
+               }
+       } else if (r == 1) {
+               hsp = (LRAND() & 1) ? c2 - V : c2 + V;
+               vsp = (LRAND() & 1) ? r2 - V : r2 + V;
+               asp = NRAND(V2) + s2 - V2 / 2;
+               if (asp > s2)
+                       aoff = -1;
+               if (vsp > r2)
+                       voff = -1;
+               if (hsp > c2)
+                       hoff = -1;
+               if (lp->patterned_rule == LIFE_S45B5) {
+                       SetList3D(hsp + 0 * hoff, vsp + 0 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 0 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 0 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 0 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 0 * voff, asp + 3 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 0 * voff, asp + 3 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 1 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 2 * aoff);
+               } else if (lp->patterned_rule == LIFE_S567B6) {
+                       SetList3D(hsp + 1 * hoff, vsp + 0 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 0 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 1 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 2 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 2 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 2 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 2 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 2 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 2 * voff, asp + 1 * aoff);
+               }
+       } else {
+               hsp = (LRAND() & 1) ? c2 - V : c2 + V;
+               vsp = NRAND(V2) + r2 - V2 / 2;
+               asp = (LRAND() & 1) ? s2 - V : s2 + V;
+               if (asp > s2)
+                       aoff = -1;
+               if (vsp > r2)
+                       voff = -1;
+               if (hsp > c2)
+                       hoff = -1;
+               if (lp->patterned_rule == LIFE_S45B5) {
+                       SetList3D(hsp + 0 * hoff, vsp + 0 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 0 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 1 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 2 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 3 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 3 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 2 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 2 * voff, asp + 1 * aoff);
+               } else if (lp->patterned_rule == LIFE_S567B6) {
+                       SetList3D(hsp + 0 * hoff, vsp + 0 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 0 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 0 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 1 * hoff, vsp + 1 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 0 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 1 * voff, asp + 0 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 0 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 1 * voff, asp + 1 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 0 * voff, asp + 2 * aoff);
+                       SetList3D(hsp + 2 * hoff, vsp + 1 * voff, asp + 2 * aoff);
+               }
+       }
+       return True;
+}
+
+void
+init_life3d(ModeInfo * mi)
+{
+       int         i, npats;
+       life3dstruct *lp;
+
+       if (life3ds == NULL) {
+               if ((life3ds = (life3dstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (life3dstruct))) == NULL)
+                       return;
+       }
+       lp = &life3ds[MI_SCREEN(mi)];
+
+       lp->generation = 0;
+
+       parseRule(mi);
+       parseFile();
+       if (allPatterns) {
+               lp->patterned_rule = NRAND(LIFE_RULES);
+               copyFromPatternedRule(&lp->param, lp->patterned_rule);
+               if (MI_IS_VERBOSE(mi))
+                       printRule(lp->param);
+       } else if (allGliders) {
+               lp->patterned_rule = NRAND(LIFE_GLIDERS);
+               copyFromPatternedRule(&lp->param, lp->patterned_rule);
+               if (MI_IS_VERBOSE(mi))
+                       printRule(lp->param);
+       } else {
+               lp->param.survival = input_param.survival;
+               lp->param.birth = input_param.birth;
+       }
+       if (lp->eraserhead.next == NULL) {
+               lp->dist = 50.0 /*30.0 */ ;
+               lp->alt = 20 /*30 */ ;
+               lp->azm = 10 /*30 */ ;
+               lp->ncolumns = MAXCOLUMNS;
+               lp->nrows = MAXROWS;
+               lp->nstacks = MAXSTACKS;
+               lp->ox = lp->ncolumns / 2;
+               lp->oy = lp->nrows / 2;
+               lp->oz = lp->nstacks / 2;
+
+               Init3D(lp);
+       } else {
+               End3D(lp);
+       }
+       lp->color[0] = MI_BLACK_PIXEL(mi);
+       if (MI_NPIXELS(mi) > 2) {
+               i = NRAND(3);
+
+               lp->color[i + 1] = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi) / COLORBASE));
+               lp->color[(i + 1) % 3 + 1] = MI_PIXEL(mi,
+                                         NRAND(MI_NPIXELS(mi) / COLORBASE) +
+                                                MI_NPIXELS(mi) / COLORBASE);
+               lp->color[(i + 2) % 3 + 1] = MI_PIXEL(mi,
+                                         NRAND(MI_NPIXELS(mi) / COLORBASE) +
+                                            2 * MI_NPIXELS(mi) / COLORBASE);
+       } else
+               lp->color[1] = lp->color[2] = lp->color[3] = MI_WHITE_PIXEL(mi);
+       lp->color[4] = MI_WHITE_PIXEL(mi);
+       lp->width = MI_WIDTH(mi);
+       lp->height = MI_HEIGHT(mi);
+       lp->memstart = 1;
+       /*lp->tablesMade = 0; */
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               lp->wireframe = (Bool) (LRAND() & 1);
+       } else {
+               lp->wireframe = MI_IS_WIREFRAME(mi);
+       }
+
+       MI_CLEARWINDOW(mi);
+       lp->painted = False;
+
+       if (lp->alt > 89)
+               lp->alt = 89;
+       else if (lp->alt < -89)
+               lp->alt = -89;
+       /* Calculate viewpoint */
+       lp->vx = (sin(lp->azm * IP) * cos(lp->alt * IP) * lp->dist);
+       lp->vy = (cos(lp->azm * IP) * cos(lp->alt * IP) * lp->dist);
+       lp->vz = (sin(lp->alt * IP) * lp->dist);
+       NewViewpoint(lp, lp->vx, lp->vy, lp->vz);
+
+       lp->patterned_rule = codeToPatternedRule(lp->param);
+       if ((unsigned) lp->patterned_rule < LIFE_RULES)
+               npats = patterns_rules[lp->patterned_rule];
+       else
+               npats = 0;
+       lp->pattern = NRAND(npats + 2);
+       if (lp->pattern >= npats && !filePattern) {
+               if (!RandomSoup(mi, 30, 10)) {
+                       if (lp->eraserhead.next != NULL)
+                               End3D(lp);
+                       return;
+               }
+       } else {
+               if (!GetPattern(mi, lp->patterned_rule, lp->pattern)) {
+                       if (lp->eraserhead.next != NULL)
+                               End3D(lp);
+                       return;
+               }
+       }
+
+       DrawScreen(mi);
+}
+
+void
+draw_life3d(ModeInfo * mi)
+{
+       life3dstruct *lp;
+
+       if (life3ds == NULL)
+               return;
+       lp = &life3ds[MI_SCREEN(mi)];
+       if (lp->eraserhead.next == NULL)
+               return;
+
+       if (!RunLife3D(lp)) {
+               if (lp->eraserhead.next != NULL)
+                       End3D(lp);
+               return;
+       }
+       DrawScreen(mi);
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (++lp->generation > MI_CYCLES(mi) || !lp->visible) {
+               /*CountCells3D(lp) == 0) */
+               init_life3d(mi);
+       } else
+               lp->painted = True;
+
+       /*
+        * generate a randomized shooter aimed roughly toward the center of the
+        * screen after batchcount.
+        */
+
+       if (lp->generation && lp->generation %
+           ((MI_COUNT(mi) < 0) ? 1 : MI_COUNT(mi)) == 0)
+               if (!shooter(lp)) {
+                       if (lp->eraserhead.next != NULL)
+                               End3D(lp);
+               }
+}
+
+void
+release_life3d(ModeInfo * mi)
+{
+       if (life3ds != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       life3dstruct *lp = &life3ds[screen];
+
+                       if (lp->eraserhead.next != NULL)
+                               End3D(lp);
+               }
+               (void) free((void *) life3ds);
+               life3ds = NULL;
+       }
+}
+
+void
+refresh_life3d(ModeInfo * mi)
+{
+       life3dstruct *lp;
+
+       if (life3ds == NULL)
+               return;
+       lp = &life3ds[MI_SCREEN(mi)];
+
+       if (lp->painted) {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+change_life3d(ModeInfo * mi)
+{
+       int         npats;
+       life3dstruct *lp;
+
+       if (life3ds == NULL)
+               return;
+       lp = &life3ds[MI_SCREEN(mi)];
+
+       lp->generation = 0;
+
+       if (lp->eraserhead.next != NULL)
+               End3D(lp);
+       /*lp->tablesMade = 0; */
+
+       MI_CLEARWINDOW(mi);
+
+       lp->pattern++;
+       lp->patterned_rule = codeToPatternedRule(lp->param);
+       if ((unsigned) lp->patterned_rule < LIFE_RULES)
+               npats = patterns_rules[lp->patterned_rule];
+       else
+               npats = 0;
+       if (lp->pattern >= npats + 2) {
+               lp->pattern = 0;
+               if (allPatterns) {
+                       lp->patterned_rule++;
+                       if ((unsigned) lp->patterned_rule >= LIFE_RULES)
+                               lp->patterned_rule = 0;
+                       copyFromPatternedRule(&lp->param, lp->patterned_rule);
+                       if (MI_IS_VERBOSE(mi))
+                               printRule(lp->param);
+               } else if (allGliders) {
+                       lp->patterned_rule++;
+                       if (lp->patterned_rule >= LIFE_GLIDERS)
+                               lp->patterned_rule = 0;
+                       copyFromPatternedRule(&lp->param, lp->patterned_rule);
+                       if (MI_IS_VERBOSE(mi))
+                               printRule(lp->param);
+               }
+       }
+       if (lp->pattern >= npats) {
+               if (!RandomSoup(mi, 30, 10)) {
+                       if (lp->eraserhead.next != NULL)
+                               End3D(lp);
+                       return;
+               }
+       } else {
+               if (!GetPattern(mi, lp->patterned_rule, lp->pattern)) {
+                       if (lp->eraserhead.next != NULL)
+                               End3D(lp);
+                       return;
+               }
+       }
+
+       DrawScreen(mi);
+}
+
+#endif /* MODE_life3d */
diff --git a/modes/lightning.c b/modes/lightning.c
new file mode 100644 (file)
index 0000000..3aa9bd0
--- /dev/null
@@ -0,0 +1,611 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* lightning --- fractal lightning bolds */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)lightning.c  5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Keith Romberg <kromberg@saxe.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 14-Jul-1996: Cleaned up code.
+ * 27-Jun-1996: Written and submitted by Keith Romberg <kromberg@saxe.com>.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Lightning"
+#define HACK_INIT init_lightning
+#define HACK_DRAW draw_lightning
+#define lightning_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n"
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_lightning
+
+ModeSpecOpt lightning_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   lightning_description =
+{"lightning", "init_lightning", "draw_lightning", "release_lightning",
+ "refresh_lightning", "init_lightning", NULL, &lightning_opts,
+ 10000, 1, 1, 1, 64, 0.6, "",
+ "Shows Keith's fractal lightning bolts", 0, NULL};
+
+#endif
+
+#define BOLT_NUMBER 4
+#define BOLT_ITERATION 4
+#define LONG_FORK_ITERATION 3
+#define MEDIUM_FORK_ITERATION 2
+#define SMALL_FORK_ITERATION 1
+
+#define WIDTH_VARIATION 30
+#define HEIGHT_VARIATION 15
+
+#define DELAY_TIME_AMOUNT 15
+#define MULTI_DELAY_TIME_BASE 5
+
+#define MAX_WIGGLES 16
+#define WIGGLE_BASE 8
+#define WIGGLE_AMOUNT 14
+
+#define RANDOM_FORK_PROBILITY   4
+
+#define FIRST_LEVEL_STRIKE 0
+#define LEVEL_ONE_STRIKE 1
+#define LEVEL_TWO_STRIKE 2
+
+#define BOLT_VERTICIES ((1<<BOLT_ITERATION)-1)
+  /* BOLT_ITERATION = 4. 2^(BOLT_ITERATION) - 1 = 15 */
+
+#define NUMBER_FORK_VERTICIES 9
+
+#define FLASH_PROBILITY 20
+#define MAX_FLASH_AMOUNT 2     /*  half the total duration of the bolt  */
+
+typedef struct {
+       XPoint      ForkVerticies[NUMBER_FORK_VERTICIES];
+       int         num_used;
+} Fork;
+
+typedef struct {
+       XPoint      end1, end2;
+       XPoint      middle[BOLT_VERTICIES];
+       int         fork_number;
+       int         forks_start[2];
+       Fork        branch[2];
+       int         wiggle_number;
+       int         wiggle_amount;
+       int         delay_time;
+       int         flash;
+       int         flash_begin, flash_stop;
+       int         visible;
+       int         strike_level;
+} Lightning;
+
+typedef struct {
+       Lightning   bolts[BOLT_NUMBER];
+       int         scr_width, scr_height;
+       int         multi_strike;
+       int         give_it_hell;
+       int         draw_time;
+       int         stage;
+       int         busyLoop;
+       unsigned long color;
+} Storm;
+
+static Storm *Helga = NULL;
+
+/*-------------------   function prototypes  ----------------------------*/
+
+static int  distance(XPoint a, XPoint b);
+
+static int  setup_multi_strike(void);
+static int  flashing_strike(void);
+static void flash_duration(int *start, int *end, int total_duration);
+static void random_storm(Storm * st);
+static void generate(XPoint A, XPoint B, int iter, XPoint * verts, int *vert_index);
+static void create_fork(Fork * f, XPoint start, XPoint end, int level);
+
+static void first_strike(Lightning bolt, ModeInfo * mi);
+static void draw_bolt(Lightning * bolt, ModeInfo * mi);
+static void draw_line(ModeInfo * mi, XPoint * p, int number, GC use, int x_offset);
+static void level1_strike(Lightning bolt, ModeInfo * mi);
+static void level2_strike(Lightning bolt, ModeInfo * mi);
+
+static int  storm_active(Storm * st);
+static void update_bolt(Lightning * bolt, int time_now);
+static void wiggle_bolt(Lightning * bolt);
+static void wiggle_line(XPoint * p, int number, int wiggle_amount);
+
+/*-------------------------  functions  ---------------------------------*/
+
+static int
+setup_multi_strike(void)
+{
+       int         result, multi_prob;
+
+       multi_prob = NRAND(100);
+
+       if (multi_prob < 50)
+               result = 1;
+       else if ((multi_prob >= 51) && (multi_prob < 75))
+               result = 2;
+       else if ((multi_prob >= 76) && (multi_prob < 92))
+               result = 3;
+       else
+               result = BOLT_NUMBER;   /* 4 */
+
+       return (result);
+}
+
+/*-------------------------------------------------------------------------*/
+
+static int
+flashing_strike(void)
+{
+       int         tmp = NRAND(FLASH_PROBILITY);
+
+       if (tmp <= FLASH_PROBILITY)
+               return (1);
+       return (0);
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void
+flash_duration(int *start, int *end, int total_duration)
+{
+       int         mid, d;
+
+       mid = total_duration / MAX_FLASH_AMOUNT;
+       d = NRAND(total_duration / MAX_FLASH_AMOUNT) / 2;
+       *start = mid - d;
+       *end = mid + d;
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void
+random_storm(Storm * st)
+{
+       int         i, j, tmp;
+       XPoint      p;
+
+       for (i = 0; i < st->multi_strike; i++) {
+               st->bolts[i].end1.x = NRAND(st->scr_width);
+               st->bolts[i].end1.y = 0;
+               st->bolts[i].end2.x = NRAND(st->scr_width);
+               st->bolts[i].end2.y = st->scr_height;
+               st->bolts[i].wiggle_number = WIGGLE_BASE + NRAND(MAX_WIGGLES);
+               if ((st->bolts[i].flash = flashing_strike()))
+                       flash_duration(&(st->bolts[i].flash_begin), &(st->bolts[i].flash_stop),
+                                      st->bolts[i].wiggle_number);
+               else
+                       st->bolts[i].flash_begin = st->bolts[i].flash_stop = 0;
+               st->bolts[i].wiggle_amount = WIGGLE_AMOUNT;
+               if (i == 0)
+                       st->bolts[i].delay_time = NRAND(DELAY_TIME_AMOUNT);
+               else
+                       st->bolts[i].delay_time = NRAND(DELAY_TIME_AMOUNT) +
+                               (MULTI_DELAY_TIME_BASE * i);
+               st->bolts[i].strike_level = FIRST_LEVEL_STRIKE;
+               tmp = 0;
+               generate(st->bolts[i].end1, st->bolts[i].end2, BOLT_ITERATION,
+                        st->bolts[i].middle, &tmp);
+               st->bolts[i].fork_number = 0;
+               st->bolts[i].visible = 0;
+               for (j = 0; j < BOLT_VERTICIES; j++) {
+                       if (st->bolts[i].fork_number >= 2)
+                               break;
+                       if (NRAND(100) < RANDOM_FORK_PROBILITY) {
+                               p.x = NRAND(st->scr_width);
+                               p.y = st->scr_height;
+                               st->bolts[i].forks_start[st->bolts[i].fork_number] = j;
+                               create_fork(&(st->bolts[i].branch[st->bolts[i].fork_number]),
+                                           st->bolts[i].middle[j], p, j);
+                               st->bolts[i].fork_number++;
+                       }
+               }
+       }
+}
+
+static void
+generate(XPoint A, XPoint B, int iter, XPoint * verts, int *vert_index)
+{
+       XPoint      mid;
+
+       mid.x = (A.x + B.x) / 2 + NRAND(WIDTH_VARIATION) - WIDTH_VARIATION / 2;
+       mid.y = (A.y + B.y) / 2 + NRAND(HEIGHT_VARIATION) - HEIGHT_VARIATION / 2;
+
+       if (!iter) {
+               verts[*vert_index].x = mid.x;
+               verts[*vert_index].y = mid.y;
+               (*vert_index)++;
+               return;
+       }
+       generate(A, mid, iter - 1, verts, vert_index);
+       generate(mid, B, iter - 1, verts, vert_index);
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+create_fork(Fork * f, XPoint start, XPoint end, int level)
+{
+       int         tmp = 1;
+
+       f->ForkVerticies[0].x = start.x;
+       f->ForkVerticies[0].y = start.y;
+
+       if (level <= 6) {
+               generate(start, end, LONG_FORK_ITERATION, f->ForkVerticies, &tmp);
+               f->num_used = 9;
+       } else if ((level > 6) && (level <= 11)) {
+               generate(start, end, MEDIUM_FORK_ITERATION, f->ForkVerticies, &tmp);
+               f->num_used = 5;
+       } else {
+               if (distance(start, end) > 100) {
+                       generate(start, end, MEDIUM_FORK_ITERATION, f->ForkVerticies, &tmp);
+                       f->num_used = 5;
+               } else {
+                       generate(start, end, SMALL_FORK_ITERATION, f->ForkVerticies, &tmp);
+                       f->num_used = 3;
+               }
+       }
+
+       f->ForkVerticies[f->num_used - 1].x = end.x;
+       f->ForkVerticies[f->num_used - 1].y = end.y;
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+update_bolt(Lightning * bolt, int time_now)
+{
+       wiggle_bolt(bolt);
+       if ((bolt->wiggle_amount == 0) && (bolt->wiggle_number > 2))
+               bolt->wiggle_number = 0;
+       if (((time_now % 3) == 0))
+               bolt->wiggle_amount++;
+
+       if (((time_now >= bolt->delay_time) && (time_now < bolt->flash_begin)) ||
+           (time_now > bolt->flash_stop))
+               bolt->visible = 1;
+       else
+               bolt->visible = 0;
+
+       if (time_now == bolt->delay_time)
+               bolt->strike_level = FIRST_LEVEL_STRIKE;
+       else if (time_now == (bolt->delay_time + 1))
+               bolt->strike_level = LEVEL_ONE_STRIKE;
+       else if ((time_now > (bolt->delay_time + 1)) &&
+                (time_now <= (bolt->delay_time + bolt->flash_begin - 2)))
+               bolt->strike_level = LEVEL_TWO_STRIKE;
+       else if (time_now == (bolt->delay_time + bolt->flash_begin - 1))
+               bolt->strike_level = LEVEL_ONE_STRIKE;
+       else if (time_now == (bolt->delay_time + bolt->flash_stop + 1))
+               bolt->strike_level = LEVEL_ONE_STRIKE;
+       else
+               bolt->strike_level = LEVEL_TWO_STRIKE;
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+draw_bolt(Lightning * bolt, ModeInfo * mi)
+{
+       if (bolt->visible) {
+               if (bolt->strike_level == FIRST_LEVEL_STRIKE)
+                       first_strike(*bolt, mi);
+               else if (bolt->strike_level == LEVEL_ONE_STRIKE)
+                       level1_strike(*bolt, mi);
+               else
+                       level2_strike(*bolt, mi);
+       }
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+first_strike(Lightning bolt, ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         i;
+
+       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       XDrawLine(display, window, gc,
+              bolt.end1.x, bolt.end1.y, bolt.middle[0].x, bolt.middle[0].y);
+       draw_line(mi, bolt.middle, BOLT_VERTICIES, gc, 0);
+       XDrawLine(display, window, gc,
+       bolt.middle[BOLT_VERTICIES - 1].x, bolt.middle[BOLT_VERTICIES - 1].y,
+                 bolt.end2.x, bolt.end2.y);
+
+       for (i = 0; i < bolt.fork_number; i++)
+               draw_line(mi, bolt.branch[i].ForkVerticies, bolt.branch[i].num_used,
+                         gc, 0);
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+draw_line(ModeInfo * mi, XPoint * points, int number, GC to_use, int offset)
+{
+       int         i;
+
+       for (i = 0; i < number - 1; i++) {
+               if (points[i].y <= points[i + 1].y)
+                       XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi), to_use, points[i].x + offset,
+                                 points[i].y, points[i + 1].x + offset, points[i + 1].y);
+               else {
+                       if (points[i].x < points[i + 1].x)
+                               XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi), to_use, points[i].x +
+                                         offset, points[i].y + offset, points[i + 1].x + offset,
+                                         points[i + 1].y + offset);
+                       else
+                               XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi), to_use, points[i].x -
+                                         offset, points[i].y + offset, points[i + 1].x - offset,
+                                         points[i + 1].y + offset);
+               }
+       }
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+level1_strike(Lightning bolt, ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       Storm      *st = &Helga[MI_SCREEN(mi)];
+       GC          gc = MI_GC(mi);
+       int         i;
+
+       if (MI_NPIXELS(mi) > 2) /* color */
+               XSetForeground(display, gc, MI_PIXEL(mi, st->color));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       XDrawLine(display, window, gc,
+       bolt.end1.x - 1, bolt.end1.y, bolt.middle[0].x - 1, bolt.middle[0].y);
+       draw_line(mi, bolt.middle, BOLT_VERTICIES, gc, -1);
+       XDrawLine(display, window, gc,
+                 bolt.middle[BOLT_VERTICIES - 1].x - 1,
+           bolt.middle[BOLT_VERTICIES - 1].y, bolt.end2.x - 1, bolt.end2.y);
+       XDrawLine(display, window, gc,
+       bolt.end1.x + 1, bolt.end1.y, bolt.middle[0].x + 1, bolt.middle[0].y);
+       draw_line(mi, bolt.middle, BOLT_VERTICIES, gc, 1);
+       XDrawLine(display, window, gc,
+                 bolt.middle[BOLT_VERTICIES - 1].x + 1,
+           bolt.middle[BOLT_VERTICIES - 1].y, bolt.end2.x + 1, bolt.end2.y);
+
+       for (i = 0; i < bolt.fork_number; i++) {
+               draw_line(mi, bolt.branch[i].ForkVerticies, bolt.branch[i].num_used,
+                         gc, -1);
+               draw_line(mi, bolt.branch[i].ForkVerticies, bolt.branch[i].num_used,
+                         gc, 1);
+       }
+       first_strike(bolt, mi);
+}
+
+/*------------------------------------------------------------------------*/
+
+static int
+distance(XPoint a, XPoint b)
+{
+       return ((int) sqrt((double) (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)));
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+level2_strike(Lightning bolt, ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       Storm      *st = &Helga[MI_SCREEN(mi)];
+       GC          gc = MI_GC(mi);
+       int         i;
+
+       /* This was originally designed to be a little darker then the
+          level1 strike.  This was changed to get it to work on
+          multiscreens and to add more color variety.   I tried
+          stippling but it did not look good. */
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, st->color));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       XDrawLine(display, window, gc,
+       bolt.end1.x - 2, bolt.end1.y, bolt.middle[0].x - 2, bolt.middle[0].y);
+       draw_line(mi, bolt.middle, BOLT_VERTICIES, gc, -2);
+       XDrawLine(display, window, gc,
+                 bolt.middle[BOLT_VERTICIES - 1].x - 2,
+           bolt.middle[BOLT_VERTICIES - 1].y, bolt.end2.x - 2, bolt.end2.y);
+
+       XDrawLine(display, window, gc,
+       bolt.end1.x + 2, bolt.end1.y, bolt.middle[0].x + 2, bolt.middle[0].y);
+       draw_line(mi, bolt.middle, BOLT_VERTICIES, gc, 2);
+       XDrawLine(display, window, gc,
+                 bolt.middle[BOLT_VERTICIES - 1].x + 2,
+           bolt.middle[BOLT_VERTICIES - 1].y, bolt.end2.x + 2, bolt.end2.y);
+
+       for (i = 0; i < bolt.fork_number; i++) {
+               draw_line(mi, bolt.branch[i].ForkVerticies, bolt.branch[i].num_used,
+                         gc, -2);
+               draw_line(mi, bolt.branch[i].ForkVerticies, bolt.branch[i].num_used,
+                         gc, 2);
+       }
+       level1_strike(bolt, mi);
+}
+
+/*------------------------------------------------------------------------*/
+
+static int
+storm_active(Storm * st)
+{
+       int         i, atleast_1 = 0;
+
+       for (i = 0; i < st->multi_strike; i++)
+               if (st->bolts[i].wiggle_number > 0)
+                       atleast_1++;
+
+       return (atleast_1);
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+wiggle_bolt(Lightning * bolt)
+{
+       int         i;
+
+       wiggle_line(bolt->middle, BOLT_VERTICIES, bolt->wiggle_amount);
+       bolt->end2.x += NRAND(bolt->wiggle_amount) - bolt->wiggle_amount / 2;
+       bolt->end2.y += NRAND(bolt->wiggle_amount) - bolt->wiggle_amount / 2;
+
+       for (i = 0; i < bolt->fork_number; i++) {
+               wiggle_line(bolt->branch[i].ForkVerticies, bolt->branch[i].num_used,
+                           bolt->wiggle_amount);
+               bolt->branch[i].ForkVerticies[0].x = bolt->middle[bolt->forks_start[i]].x;
+               bolt->branch[i].ForkVerticies[0].y = bolt->middle[bolt->forks_start[i]].y;
+       }
+
+       if (bolt->wiggle_amount > 1)
+               bolt->wiggle_amount -= 1;
+       else
+               bolt->wiggle_amount = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+static void
+wiggle_line(XPoint * p, int number, int amount)
+{
+       int         i;
+
+       for (i = 0; i < number; i++) {
+               p[i].x += NRAND(amount) - amount / 2;
+               p[i].y += NRAND(amount) - amount / 2;
+       }
+}
+
+/*------------------------------------------------------------------------*/
+
+void
+init_lightning(ModeInfo * mi)
+{
+       Storm      *st;
+
+       if (Helga == NULL) {
+               if ((Helga = (Storm *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (Storm))) == NULL)
+                       return;
+       }
+       st = &Helga[MI_SCREEN(mi)];
+
+       st->scr_width = MI_WIDTH(mi);
+       st->scr_height = MI_HEIGHT(mi);
+
+       st->multi_strike = setup_multi_strike();
+       random_storm(st);
+       st->stage = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+void
+draw_lightning(ModeInfo * mi)
+{
+       int         i;
+       Storm      *st;
+
+       if (Helga == NULL)
+               return;
+       st = &Helga[MI_SCREEN(mi)];
+       MI_IS_DRAWN(mi) = True;
+       switch (st->stage) {
+               case 0:
+                       MI_IS_DRAWN(mi) = False;
+                       MI_CLEARWINDOW(mi);
+                       MI_IS_DRAWN(mi) = True;
+
+                       st->color = NRAND(MI_NPIXELS(mi));
+                       st->draw_time = 0;
+                       if (storm_active(st))
+                               st->stage++;
+                       else
+                               st->stage = 4;
+                       break;
+               case 1:
+                       for (i = 0; i < st->multi_strike; i++) {
+                               if (st->bolts[i].visible)
+                                       draw_bolt(&(st->bolts[i]), mi);
+                               update_bolt(&(st->bolts[i]), st->draw_time);
+                       }
+                       st->draw_time++;
+                       st->stage++;
+                       st->busyLoop = 0;
+                       break;
+               case 2:
+                       if (++st->busyLoop > 6) {
+                               st->stage++;
+                               st->busyLoop = 0;
+                       }
+                       break;
+               case 3:
+                       MI_IS_DRAWN(mi) = False;
+                       MI_CLEARWINDOW(mi);
+                       MI_IS_DRAWN(mi) = True;
+
+                       if (storm_active(st))
+                               st->stage = 1;
+                       else
+                               st->stage++;
+                       break;
+               case 4:
+                       if (++st->busyLoop > 100) {
+                               st->busyLoop = 0;
+                       }
+                       init_lightning(mi);
+                       break;
+       }
+}
+
+void
+release_lightning(ModeInfo * mi)
+{
+       if (Helga != NULL) {
+               (void) free((void *) Helga);
+               Helga = NULL;
+       }
+}
+
+void
+refresh_lightning(ModeInfo * mi)
+{
+       /* Do nothing, it will refresh by itself */
+}
+
+#endif /* MODE_lightning */
diff --git a/modes/lisa.c b/modes/lisa.c
new file mode 100644 (file)
index 0000000..a64980a
--- /dev/null
@@ -0,0 +1,548 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* lisa --- animated full-loop lisajous figures */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)lisa.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by Caleb Cullen.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ *
+ * The inspiration for this program, Lasp, was written by Adam B. Roach
+ * in 1990, assisted by me, Caleb Cullen.  It was written first in C, then
+ * in assembly, and used pre-calculated data tables to graph lisajous
+ * figures on 386 machines and lower.  This version bears only superficial
+ * resemblances to the original Lasp.
+ *
+ * The `lissie' module's source code was studied as an example of how
+ * to incorporate a new module into xlock.  Resemblances to it are
+ * expected, but not intended to be plaigiaristic.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Lisa"
+#define HACK_INIT init_lisa
+#define HACK_DRAW draw_lisa
+#define lisa_opts xlockmore_opts
+#define DEFAULTS "*delay: 25000 \n" \
+ "*count: 1 \n" \
+ "*cycles: 256 \n" \
+ "*size: -1 \n" \
+ "*ncolors: 200 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_lisa
+
+#define  DEF_ADDITIVE     "True"
+
+static Bool additive;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-additive", (char *) ".lisa.additive", XrmoptionNoArg, (caddr_t) "True"},
+       {(char *) "+additive", (char *) ".lisa.additive", XrmoptionNoArg, (caddr_t) "False"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & additive, (char *) "additive", (char *) "Additive", (char *) DEF_ADDITIVE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+additive", (char *) "turn on/off additive functions mode"}
+};
+
+ModeSpecOpt lisa_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   lisa_description =
+{"lisa", "init_lisa", "draw_lisa", "release_lisa",
+ "refresh_lisa", "change_lisa", NULL, &lisa_opts,
+ 25000, 1, 256, -1, 64, 1.0, "",
+ "Shows animated lisajous loops", 0, NULL};
+
+#endif
+
+#define  DRAWLINES    1
+#define  TWOLOOPS     1
+#define  XVMAX        10       /* Maximum velocities */
+#define  YVMAX        10
+#define  LISAMAXFUNCS 2
+#define  NUMSTDFUNCS  10
+#define  MAXCYCLES    3
+#define  MINLISAS     1
+#define  lisasetcolor() \
+if (MI_NPIXELS(mi) > 2) { \
+  XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_PIXEL(mi, loop->color)); \
+  if (++(loop->color) >= (unsigned) MI_NPIXELS(mi)) { loop->color=0; } \
+  } else { XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi)); }
+#define getRadius(context) \
+  ((context->width > context->height)?context->height:context->width) * 3 / 8
+#define checkRadius(loop, context) \
+  if ((context->height / 2 > MI_SIZE(mi)) && (context->width / 2 > MI_SIZE(mi))) \
+      loop->radius = MI_SIZE(mi); \
+  if ((loop->radius < 0) || \
+      (loop->radius > loop->center.x) || \
+      (loop->radius > loop->center.y)) loop->radius = getRadius(context)
+
+
+typedef struct lisafunc_struct {
+       double      xcoeff[2], ycoeff[2];
+       int         nx, ny;
+       int         index;
+} lisafuncs;
+
+typedef struct lisa_struct {
+       unsigned long color;
+       int         radius, dx, dy, nsteps, nfuncs, melting;
+       double      pistep, phi, theta;
+       XPoint      center, *lastpoint;
+       lisafuncs  *function[LISAMAXFUNCS];
+       int         linewidth;
+} lisas;
+
+typedef struct lisacontext_struct {
+       lisas      *lisajous;
+       int         width, height, nlisajous, loopcount;
+       int         maxcycles;
+       Bool        painted;
+} lisacons;
+
+static lisacons *Lisa = NULL;
+
+static lisafuncs Function[NUMSTDFUNCS] =
+{
+       {
+               {1.0, 2.0},
+               {1.0, 2.0}, 2, 2, 0},
+       {
+               {1.0, 2.0},
+               {1.0, 1.0}, 2, 2, 1},
+       {
+               {1.0, 3.0},
+               {1.0, 2.0}, 2, 2, 2},
+       {
+               {1.0, 3.0},
+               {1.0, 3.0}, 2, 2, 3},
+       {
+               {2.0, 4.0},
+               {1.0, 2.0}, 2, 2, 4},
+       {
+               {1.0, 4.0},
+               {1.0, 3.0}, 2, 2, 5},
+       {
+               {1.0, 4.0},
+               {1.0, 4.0}, 2, 2, 6},
+       {
+               {1.0, 5.0},
+               {1.0, 5.0}, 2, 2, 7},
+       {
+               {2.0, 5.0},
+               {2.0, 5.0}, 2, 2, 8},
+       {
+               {1.0, 0.0},
+               {1.0, 0.0}, 1, 1, 9}
+};
+
+static void
+free_lisa(lisacons *lc)
+{
+       while (lc->lisajous) {
+               int    lctr;
+
+               for (lctr = 0; lctr < lc->nlisajous; lctr++) {
+                       (void) free((void *) lc->lisajous[lctr].lastpoint);
+               }
+               (void) free((void *) lc->lisajous);
+               lc->lisajous = NULL;
+       }
+}
+
+static Bool
+drawlisa(ModeInfo * mi, lisas * loop)
+{
+       XPoint     *np;
+       XPoint     *lp = loop->lastpoint;
+       lisacons   *lc = &Lisa[MI_SCREEN(mi)];
+       lisafuncs **lf = loop->function;
+       int         phase = lc->loopcount % loop->nsteps;
+       int         pctr, fctr, xctr, yctr;
+       double      xprod, yprod, xsum, ysum;
+
+       /* Allocate the np array */
+       if ((np = (XPoint *) calloc(loop->nsteps, sizeof (XPoint))) == NULL) {
+               free_lisa(lc);
+               return False;
+       }
+
+       /* Update the center */
+       loop->center.x += loop->dx;
+       loop->center.y += loop->dy;
+       checkRadius(loop, lc);
+       if ((loop->center.x - loop->radius) <= 0) {
+               loop->center.x = loop->radius;
+               loop->dx = NRAND(XVMAX);
+       } else if ((loop->center.x + loop->radius) >= lc->width) {
+               loop->center.x = lc->width - loop->radius;
+               loop->dx = -NRAND(XVMAX);
+       };
+       if ((loop->center.y - loop->radius) <= 0) {
+               loop->center.y = loop->radius;
+               loop->dy = NRAND(YVMAX);
+       } else if ((loop->center.y + loop->radius) >= lc->height) {
+               loop->center.y = lc->height - loop->radius;
+               loop->dy = -NRAND(YVMAX);
+       };
+
+       /* Now draw the points, and erase the ones from the last cycle */
+
+       for (pctr = 0; pctr < loop->nsteps; pctr++) {
+               fctr = loop->nfuncs;
+               loop->phi = (double) (pctr - phase) * loop->pistep;
+               loop->theta = (double) (pctr + phase) * loop->pistep;
+               xsum = ysum = 0;
+               while (fctr--) {
+                       xctr = lf[fctr]->nx;
+                       yctr = lf[fctr]->ny;
+                       if (additive) {
+                               xprod = yprod = 0.0;
+                               while (xctr--)
+                                       xprod += sin(lf[fctr]->xcoeff[xctr] * loop->theta);
+                               while (yctr--)
+                                       yprod += sin(lf[fctr]->ycoeff[yctr] * loop->phi);
+                               if (loop->melting) {
+                                       if (fctr) {
+                                               xsum += xprod * (double) (loop->nsteps - loop->melting) /
+                                                       (double) loop->nsteps;
+                                               ysum += yprod * (double) (loop->nsteps - loop->melting) /
+                                                       (double) loop->nsteps;
+                                       } else {
+                                               xsum += xprod * (double) loop->melting / (double) loop->nsteps;
+                                               ysum += yprod * (double) loop->melting / (double) loop->nsteps;
+                                       }
+                               } else {
+                                       xsum = xprod;
+                                       ysum = yprod;
+                               }
+                               if (!fctr) {
+                                       xsum = xsum * (double) loop->radius / (double) lf[fctr]->nx;
+                                       ysum = ysum * (double) loop->radius / (double) lf[fctr]->ny;
+                               }
+                       } else {
+                               if (loop->melting) {
+                                       if (fctr) {
+                                               yprod = xprod = (double) loop->radius *
+                                                       (double) (loop->nsteps - loop->melting) /
+                                                       (double) (loop->nsteps);
+                                       } else {
+                                               yprod = xprod = (double) loop->radius *
+                                                       (double) (loop->melting) / (double) (loop->nsteps);
+                                       }
+                               } else {
+                                       xprod = yprod = (double) loop->radius;
+                               }
+                               while (xctr--)
+                                       xprod *= sin(lf[fctr]->xcoeff[xctr] * loop->theta);
+                               while (yctr--)
+                                       yprod *= sin(lf[fctr]->ycoeff[yctr] * loop->phi);
+                               xsum += xprod;
+                               ysum += yprod;
+                       }
+               }
+               if ((loop->nfuncs > 1) && (!loop->melting)) {
+                       xsum /= (double) loop->nfuncs;
+                       ysum /= (double) loop->nfuncs;
+               }
+               xsum += (double) loop->center.x;
+               ysum += (double) loop->center.y;
+
+               np[pctr].x = (int) ceil(xsum);
+               np[pctr].y = (int) ceil(ysum);
+       }
+       if (loop->melting) {
+               if (!--loop->melting) {
+                       loop->nfuncs = 1;
+                       loop->function[0] = loop->function[1];
+               }
+       }
+       for (pctr = 0; pctr < loop->nsteps; pctr++) {
+
+#if defined DRAWLINES
+               XSetLineAttributes(MI_DISPLAY(mi), MI_GC(mi), loop->linewidth,
+                                  LineSolid, CapProjecting, JoinMiter);
+               /* erase the last cycle's point */
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+               XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi),
+                         MI_GC(mi), lp[pctr].x, lp[pctr].y,
+                         lp[(pctr + 1) % loop->nsteps].x,
+                         lp[(pctr + 1) % loop->nsteps].y);
+
+               /* Set the new color */
+               lisasetcolor();
+
+               /* plot this cycle's point */
+               XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi),
+                         MI_GC(mi), np[pctr].x, np[pctr].y,
+                         np[(pctr + 1) % loop->nsteps].x,
+                         np[(pctr + 1) % loop->nsteps].y);
+               XSetLineAttributes(MI_DISPLAY(mi), MI_GC(mi), 1,
+                                  LineSolid, CapProjecting, JoinMiter);
+#else
+               /* erase the last cycle's point */
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_BLACK_PIXEL(mi));
+               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi),
+                          MI_GC(mi), lp[pctr].x, lp[pctr].y);
+
+               /* Set the new color */
+               lisasetcolor();
+
+               /* plot this cycle's point */
+               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi),
+                          MI_GC(mi), np[pctr].x, np[pctr].y);
+#endif
+       }
+       (void) free((void *) lp);
+       loop->lastpoint = np;
+       return True;
+}
+
+static Bool 
+initlisa(ModeInfo * mi, lisas * loop)
+{
+       lisacons   *lc = &Lisa[MI_SCREEN(mi)];
+       lisafuncs **lf = loop->function;
+       XPoint     *lp;
+       int         phase, pctr, fctr, xctr, yctr;
+       double      xprod, yprod, xsum, ysum;
+
+       if (MI_NPIXELS(mi) > 2) {
+               loop->color = 0;
+       } else
+               loop->color = MI_WHITE_PIXEL(mi);
+       loop->nsteps = MI_CYCLES(mi);
+       if (loop->nsteps == 0)
+               loop->nsteps = 1;
+       lc->maxcycles = (MAXCYCLES * loop->nsteps) - 1;
+       loop->melting = 0;
+       loop->nfuncs = 1;
+       loop->pistep = 2.0 * M_PI / (double) loop->nsteps;
+       loop->center.x = lc->width / 2;
+       loop->center.y = lc->height / 2;
+       loop->radius = (int) MI_SIZE(mi);
+       checkRadius(loop, lc);
+       loop->dx = NRAND(XVMAX);
+       loop->dy = NRAND(YVMAX);
+       loop->dx++;
+       loop->dy++;
+       lf[0] = &Function[lc->loopcount % NUMSTDFUNCS];
+       if ((lp = loop->lastpoint = (XPoint *)
+            calloc(loop->nsteps, sizeof (XPoint))) == NULL) {
+               free_lisa(lc);
+               return False;
+       }
+       phase = lc->loopcount % loop->nsteps;
+
+       for (pctr = 0; pctr < loop->nsteps; pctr++) {
+               loop->phi = (double) (pctr - phase) * loop->pistep;
+               loop->theta = (double) (pctr + phase) * loop->pistep;
+               fctr = loop->nfuncs;
+               xsum = ysum = 0.0;
+               while (fctr--) {
+                       xprod = yprod = (double) loop->radius;
+                       xctr = lf[fctr]->nx;
+                       yctr = lf[fctr]->ny;
+                       while (xctr--)
+                               xprod *= sin(lf[fctr]->xcoeff[xctr] * loop->theta);
+                       while (yctr--)
+                               yprod *= sin(lf[fctr]->ycoeff[yctr] * loop->phi);
+                       xsum += xprod;
+                       ysum += yprod;
+               }
+               if (loop->nfuncs > 1) {
+                       xsum /= 2.0;
+                       ysum /= 2.0;
+               }
+               xsum += (double) loop->center.x;
+               ysum += (double) loop->center.y;
+
+               lp[pctr].x = (int) ceil(xsum);
+               lp[pctr].y = (int) ceil(ysum);
+       }
+#if defined DRAWLINES
+       {
+               loop->linewidth = -8;   /* #### make this a resource */
+
+               if (loop->linewidth == 0)
+                       loop->linewidth = 1;
+               if (loop->linewidth < 0)
+                       loop->linewidth = NRAND(-loop->linewidth) + 1;
+               XSetLineAttributes(MI_DISPLAY(mi), MI_GC(mi), loop->linewidth,
+                                  LineSolid, CapProjecting, JoinMiter);
+       }
+#endif
+       for (pctr = 0; pctr < loop->nsteps; pctr++) {
+               /* Set the color */
+               lisasetcolor();
+#if defined DRAWLINES
+               XDrawLine(MI_DISPLAY(mi), MI_WINDOW(mi),
+                         MI_GC(mi), lp[pctr].x, lp[pctr].y,
+                         lp[(pctr + 1) % loop->nsteps].x,
+                         lp[(pctr + 1) % loop->nsteps].y);
+#else
+               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                          lp[pctr].x, lp[pctr].y);
+#endif
+       }
+#if defined DRAWLINES
+       XSetLineAttributes(MI_DISPLAY(mi), MI_GC(mi), 1,
+                          LineSolid, CapProjecting, JoinMiter);
+#endif
+       return True;
+}
+
+static void
+refreshlisa(ModeInfo * mi)
+{
+       lisacons   *lc = &Lisa[MI_SCREEN(mi)];
+       int         lctr;
+
+       for (lctr = 0; lctr < lc->nlisajous; lctr++) {
+               if (!drawlisa(mi, &lc->lisajous[lctr]))
+                       return;
+       }
+}
+
+void
+refresh_lisa(ModeInfo * mi)
+{
+       lisacons   *lc;
+
+       if (Lisa == NULL)
+               return;
+       lc = &Lisa[MI_SCREEN(mi)];
+       if (lc->lisajous == NULL)
+               return;
+
+       if (lc->painted) {
+               lc->painted = False;
+               MI_CLEARWINDOW(mi);
+               refreshlisa(mi);
+       }
+}
+
+void
+change_lisa(ModeInfo * mi)
+{
+       lisas      *loop;
+       int         lctr;
+       lisacons   *lc;
+
+       if (Lisa == NULL)
+               return;
+       lc = &Lisa[MI_SCREEN(mi)];
+       if (lc->lisajous == NULL)
+               return;
+
+       lc->loopcount = 0;
+       for (lctr = 0; lctr < lc->nlisajous; lctr++) {
+               loop = &lc->lisajous[lctr];
+               loop->function[1] = &Function[(loop->function[0]->index + 1) %
+                                             NUMSTDFUNCS];
+               loop->melting = loop->nsteps - 1;
+               loop->nfuncs = 2;
+       }
+}
+
+void
+init_lisa(ModeInfo * mi)
+{
+       int         lctr;
+       lisacons   *lc;
+
+       if (Lisa == NULL) {
+               if ((Lisa = (lisacons *) calloc(MI_NUM_SCREENS(mi),
+                                sizeof (lisacons))) == NULL)
+                       return;
+       }
+       lc = &Lisa[MI_SCREEN(mi)];
+       lc->width = MI_WIDTH(mi);
+       lc->height = MI_HEIGHT(mi);
+       lc->loopcount = 0;
+       lc->nlisajous = MI_COUNT(mi);
+       if (lc->nlisajous <= 0)
+               lc->nlisajous = 1;
+       MI_CLEARWINDOW(mi);
+       lc->painted = False;
+
+       if (lc->lisajous == NULL) {
+               if ((lc->lisajous = (lisas *) calloc(lc->nlisajous,
+                               sizeof (lisas))) == NULL)
+                       return;
+               for (lctr = 0; lctr < lc->nlisajous; lctr++) {
+                       if (!initlisa(mi, &lc->lisajous[lctr]))
+                               return;
+                       lc->loopcount++;
+               }
+       } else {
+               refreshlisa(mi);
+       }
+}
+
+void
+draw_lisa(ModeInfo * mi)
+{
+       lisacons   *lc;
+
+       if (Lisa == NULL)
+               return;
+       lc = &Lisa[MI_SCREEN(mi)];
+       if (lc->lisajous == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       lc->painted = True;
+       if (++lc->loopcount > lc->maxcycles) {
+               change_lisa(mi);
+       }
+       refreshlisa(mi);
+}
+
+void
+release_lisa(ModeInfo * mi)
+{
+       if (Lisa) {
+               int    screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_lisa(&Lisa[screen]);
+               (void) free(Lisa);
+               Lisa = NULL;
+       }
+}
+
+#endif /* MODE_lisa */
diff --git a/modes/lissie.c b/modes/lissie.c
new file mode 100644 (file)
index 0000000..86e8377
--- /dev/null
@@ -0,0 +1,322 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* lissie --- the Lissajous worm */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)lissie.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * lissie.c - The Lissajous worm for xlock, the X Window System
+ *               lockscreen.
+ *
+ * Copyright (c) 1996 by Alexander Jolk <ub9x@rz.uni-karlsruhe.de>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 18-Aug-1996: added refresh-hook.
+ * 01-May-1996: written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Lissie"
+#define HACK_INIT init_lissie
+#define HACK_DRAW draw_lissie
+#define lissie_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 1 \n" \
+ "*cycles: 20000 \n" \
+ "*size: -200 \n" \
+ "*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_lissie
+
+ModeSpecOpt lissie_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   lissie_description =
+{"lissie", "init_lissie", "draw_lissie", "release_lissie",
+ "refresh_lissie", "init_lissie", NULL, &lissie_opts,
+ 10000, 1, 2000, -200, 64, 0.6, "",
+ "Shows lissajous worms", 0, NULL};
+
+#endif
+
+#define MINSIZE 1
+
+#define Lissie(n)\
+       if (lissie->loc[(n)].x > 0 && lissie->loc[(n)].y > 0 &&\
+               lissie->loc[(n)].x <= lp->width && lissie->loc[(n)].y <= lp->height) {\
+               if (lissie->ri < 2)\
+                       XDrawPoint(display, MI_WINDOW(mi),\
+                               gc, lissie->loc[(n)].x, lissie->loc[(n)].y);\
+               else\
+                       XDrawArc(display, MI_WINDOW(mi), gc,\
+                               lissie->loc[(n)].x - lissie->ri / 2,\
+                               lissie->loc[(n)].y - lissie->ri / 2,\
+                               lissie->ri, lissie->ri, 0, 23040);\
+       }
+
+#define FLOATRAND(min,max)     ((min)+(LRAND()/MAXRAND)*((max)-(min)))
+#define INTRAND(min,max)     ((min)+NRAND((max)-(min)+1))
+
+#define MINDT  0.01
+#define MAXDT  0.15
+
+#define MAXLISSIELEN  100
+#define MINLISSIELEN  10
+#define MINLISSIES 1
+
+/* How many segments to draw per cycle when redrawing */
+#define REDRAWSTEP 3
+
+typedef struct {
+       double      tx, ty, dtx, dty;
+       int         xi, yi, ri, rx, ry, len, pos;
+       int         redrawing, redrawpos;
+       XPoint      loc[MAXLISSIELEN];
+       unsigned long color;
+} lissiestruct;
+
+typedef struct {
+       Bool        painted;
+       int         width, height;
+       int         nlissies;
+       lissiestruct *lissie;
+       int         loopcount;
+} lissstruct;
+
+static lissstruct *lisses = NULL;
+
+
+static void
+drawlissie(ModeInfo * mi, lissiestruct * lissie)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       lissstruct *lp = &lisses[MI_SCREEN(mi)];
+       int         p = (++lissie->pos) % MAXLISSIELEN;
+       int         oldp = (lissie->pos - lissie->len + MAXLISSIELEN) % MAXLISSIELEN;
+
+       /* Let time go by ... */
+       lissie->tx += lissie->dtx;
+       lissie->ty += lissie->dty;
+       if (lissie->tx > 2 * M_PI)
+               lissie->tx -= 2 * M_PI;
+       if (lissie->ty > 2 * M_PI)
+               lissie->ty -= 2 * M_PI;
+
+       /* vary both (x/y) speeds by max. 1% */
+       lissie->dtx *= FLOATRAND(0.99, 1.01);
+       lissie->dty *= FLOATRAND(0.99, 1.01);
+       if (lissie->dtx < MINDT)
+               lissie->dtx = MINDT;
+       else if (lissie->dtx > MAXDT)
+               lissie->dtx = MAXDT;
+       if (lissie->dty < MINDT)
+               lissie->dty = MINDT;
+       else if (lissie->dty > MAXDT)
+               lissie->dty = MAXDT;
+
+       lissie->loc[p].x = lissie->xi + (int) (sin(lissie->tx) * lissie->rx);
+       lissie->loc[p].y = lissie->yi + (int) (sin(lissie->ty) * lissie->ry);
+
+       /* Mask */
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       Lissie(oldp);
+
+       /* Redraw */
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, lissie->color));
+               if (++lissie->color >= (unsigned) MI_NPIXELS(mi))
+                       lissie->color = 0;
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       Lissie(p);
+       if (lissie->redrawing) {
+               int         i;
+
+               lissie->redrawpos++;
+               /* This compensates for the changed p
+                  since the last callback. */
+
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       Lissie((p - lissie->redrawpos + MAXLISSIELEN) % MAXLISSIELEN);
+                       if (++(lissie->redrawpos) >= lissie->len) {
+                               lissie->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+static void
+initlissie(ModeInfo * mi, lissiestruct * lissie)
+{
+       lissstruct *lp = &lisses[MI_SCREEN(mi)];
+       int         size = MI_SIZE(mi);
+       int         i;
+
+       if (MI_NPIXELS(mi) > 2)
+               lissie->color = NRAND(MI_NPIXELS(mi));
+       else
+               lissie->color = MI_WHITE_PIXEL(mi);
+       /* Initialize parameters */
+       if (size < -MINSIZE)
+               lissie->ri = NRAND(MIN(-size, MAX(MINSIZE,
+                  MIN(lp->width, lp->height) / 4)) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE) {
+               if (!size)
+                       lissie->ri = MAX(MINSIZE, MIN(lp->width, lp->height) / 4);
+               else
+                       lissie->ri = MINSIZE;
+       } else
+               lissie->ri = MIN(size, MAX(MINSIZE, MIN(lp->width, lp->height) / 4));
+       lissie->xi = INTRAND(lp->width / 4 + lissie->ri,
+                            lp->width * 3 / 4 - lissie->ri);
+       lissie->yi = INTRAND(lp->height / 4 + lissie->ri,
+                            lp->height * 3 / 4 - lissie->ri);
+       lissie->rx = INTRAND(lp->width / 4,
+                  MIN(lp->width - lissie->xi, lissie->xi)) - 2 * lissie->ri;
+       lissie->ry = INTRAND(lp->height / 4,
+                 MIN(lp->height - lissie->yi, lissie->yi)) - 2 * lissie->ri;
+       lissie->len = INTRAND(MINLISSIELEN, MAXLISSIELEN - 1);
+       lissie->pos = 0;
+
+       lissie->redrawing = 0;
+
+       lissie->tx = FLOATRAND(0, 2 * M_PI);
+       lissie->ty = FLOATRAND(0, 2 * M_PI);
+       lissie->dtx = FLOATRAND(MINDT, MAXDT);
+       lissie->dty = FLOATRAND(MINDT, MAXDT);
+
+       for (i = 0; i < MAXLISSIELEN; i++)
+               lissie->loc[i].x = lissie->loc[i].y = 0;
+       /* Draw lissie */
+       drawlissie(mi, lissie);
+}
+
+void
+init_lissie(ModeInfo * mi)
+{
+       lissstruct *lp;
+       unsigned char ball;
+
+       if (lisses == NULL) {
+               if ((lisses = (lissstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (lissstruct))) == NULL)
+                       return;
+       }
+       lp = &lisses[MI_SCREEN(mi)];
+
+       lp->width = MI_WIDTH(mi);
+       lp->height = MI_HEIGHT(mi);
+
+       lp->nlissies = MI_COUNT(mi);
+       if (lp->nlissies < -MINLISSIES) {
+               if (lp->lissie) {
+                       (void) free((void *) lp->lissie);
+                       lp->lissie = NULL;
+               }
+               lp->nlissies = NRAND(-lp->nlissies - MINLISSIES + 1) + MINLISSIES;
+       } else if (lp->nlissies < MINLISSIES)
+               lp->nlissies = MINLISSIES;
+
+       lp->loopcount = 0;
+
+       if (lp->lissie == NULL)
+               if ((lp->lissie = (lissiestruct *) calloc(lp->nlissies,
+                               sizeof (lissiestruct))) == NULL)
+                       return;
+
+       MI_CLEARWINDOW(mi);
+       lp->painted = False;
+
+       for (ball = 0; ball < (unsigned char) lp->nlissies; ball++)
+               initlissie(mi, &lp->lissie[ball]);
+
+}
+
+void
+draw_lissie(ModeInfo * mi)
+{
+       register unsigned char ball;
+       lissstruct *lp;
+
+       if (lisses == NULL)
+               return;
+       lp = &lisses[MI_SCREEN(mi)];
+       if (lp->lissie == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (++lp->loopcount > MI_CYCLES(mi)) {
+               init_lissie(mi);
+       } else {
+               lp->painted = True;
+               for (ball = 0; ball < (unsigned char) lp->nlissies; ball++)
+                       drawlissie(mi, &lp->lissie[ball]);
+       }
+}
+
+void
+release_lissie(ModeInfo * mi)
+{
+       if (lisses != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       lissstruct *lp = &lisses[screen];
+
+                       if (lp->lissie != NULL) {
+                               (void) free((void *) lp->lissie);
+                               /* lp->lissie = NULL; */
+                       }
+               }
+               (void) free((void *) lisses);
+               lisses = NULL;
+       }
+}
+
+void
+refresh_lissie(ModeInfo * mi)
+{
+       int         i;
+       lissstruct *lp;
+
+       if (lisses == NULL)
+               return;
+       lp = &lisses[MI_SCREEN(mi)];
+       if (lp->lissie == NULL)
+               return;
+
+       if (lp->painted) {
+               MI_CLEARWINDOW(mi);
+               for (i = 0; i < lp->nlissies; i++) {
+                       lp->lissie[i].redrawing = 1;
+                       lp->lissie[i].redrawpos = 0;
+               }
+       }
+}
+
+#endif /* MODE_lissie */
diff --git a/modes/loop.c b/modes/loop.c
new file mode 100644 (file)
index 0000000..d7d26dd
--- /dev/null
@@ -0,0 +1,1671 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* loop --- Chris Langton's self-producing loops */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)loop.c       5.01 2000/03/15 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 15-Mar-2001: Added some flaws, random blue wall spots, to liven it up.
+ *              This mod seems to expose a bug where hexagons are erased
+ *              for no apparent reason.
+ * 01-Nov-2000: Allocation checks
+ * 16-Jun-2000: Fully coded the hexagonal rules.  (Rules that end up in
+ *              state zero were not bothered with since a calloc was used
+ *              to set non-explicit rules to zero.  This allows the
+ *              compile-time option RAND_RULES to work here (at least to
+ *              generation 540).)
+ *              Also added compile-time option DELAYDEBUGLOOP for debugging
+ *              life form.  This also turns off the random initial direction
+ *              of the loop.  Set DELAYDEBUGLOOP to be 10 and use with
+ *              something like this:
+ *       xlock -mode loop -neighbors 6 -size 5 -delay 1 -count 540 -nolock
+ * 18-Oct-1998: Started creating a hexagon version.
+ *              It proved not that difficult because I used Langton's Loop
+ *              as a guide, hexagons have more neighbors so there is more
+ *              freedom to program, and the loop will has six sides to
+ *              store its genes (data).
+ *              (Soon after this a triangular version with neighbors = 6
+ *              was attempted but was unsuccessful).
+ * 10-May-1997: Compatible with xscreensaver
+ * 15-Nov-1995: Coded from Chris Langton's Self-Reproduction in Cellular
+ *              Automata Physica 10D 135-144 1984, also used wire.c as a
+ *              guide.
+ */
+
+/*-
+  Grid     Number of Neighbors
+  ----     ------------------
+  Square   4
+  Hexagon  6  (currently in development)
+*/
+
+/*-
+ * From Steven Levy's Artificial Life
+ * Chris Langton's cellular automata "loops" reproduce in the spirit of life.
+ * Beginning from a single organism, the loops from a colony.  As the loops
+ * on the outer fringes reproduce, the inner loops -- blocked by their
+ * daughters -- can no longer produce offspring.  These dead progenitors
+ * provide a base for future generations' expansion, much like the formation
+ * of a coral reef.  This self-organizing behavior emerges spontaneously,
+ * from the bottom up -- a key characteristic of artificial life.
+ */
+
+/*-
+   Don't Panic  --  When the artificial life tries to leave its petri
+   dish (ie. the screen) it will (usually) die...
+   The loops are short of "real" life because a general purpose Turing
+   machine is not contained in the loop.  This is a simplification of
+   von Neumann and Codd's self-producing Turing machine.
+   The data spinning around could be viewed as both its DNA and its internal
+   clock.  The program can be initalized to have the loop spin both ways...
+   but only one way around will work for a given rule.  An open question (at
+   least to me): Is handedness a requirement for (artificial) life?  Here
+   there is handedness at both the initial condition and the transition rule.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "loop"
+#define HACK_INIT init_loop
+#define HACK_DRAW draw_loop
+#define loop_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: -5 \n" \
+ "*cycles: 1600 \n" \
+ "*size: -12 \n" \
+ "*ncolors: 15 \n" \
+ "*neighbors: 0 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_loop
+
+/*-
+ * neighbors of 0 randomizes between 4 and 6.
+ */
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+
+static int  neighbors;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".loop.neighbors", XrmoptionSepArg, (caddr_t) NULL}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or hexagons 6"}
+};
+
+ModeSpecOpt loop_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+
+#ifdef USE_MODULES
+ModStruct   loop_description =
+{"loop", "init_loop", "draw_loop", "release_loop",
+ "refresh_loop", "init_loop", NULL, &loop_opts,
+ 100000, 5, 1600, -12, 64, 1.0, "",
+ "Shows Langton's self-producing loops", 0, NULL};
+
+#endif
+
+#define LOOPBITS(n,w,h)\
+  if ((lp->pixmaps[lp->init_bits]=\
+  XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
+  free_loop(display,lp); return;} else {lp->init_bits++;}
+
+static int  local_neighbors = 0;
+
+#if 0
+/* Used to fast forward to troubled generations, mainly used for debugging.
+   -delay 1 -count 170 -neighbors 6  # divisions starts
+   540 first cell collision
+   1111 mutant being born from 2 parents
+   1156 mutant born 
+ */
+#define DELAYDEBUGLOOP 10
+#endif
+
+#define COLORS 8
+#define REALCOLORS (COLORS-2)
+#define MINLOOPS 1
+#define REDRAWSTEP 2000                /* How many cells to draw per cycle */
+#define ADAM_SIZE 8 /* MIN 5 */
+#if 1
+#define ADAM_LOOPX  (ADAM_SIZE+2)
+#define ADAM_LOOPY  (ADAM_SIZE+2)
+#else
+#define ADAM_LOOPX 16
+#define ADAM_LOOPY 10
+#endif
+#define MINGRIDSIZE (3*ADAM_LOOPX)
+#if 0
+/* TRIA stuff was an attempt to make a triangular lifeform on a
+   hexagonal grid but I got bored.  You may need an additional 7th
+   state for a coherent step by step process of cell separation and
+   initial stem development.
+ */
+#define TRIA 1
+#endif
+#ifdef TRIA
+#define HEX_ADAM_SIZE 3 /* MIN 3 */
+#else
+#define HEX_ADAM_SIZE 5 /* MIN 3 */
+#endif
+#if 1
+#define HEX_ADAM_LOOPX (2*HEX_ADAM_SIZE+1)
+#define HEX_ADAM_LOOPY (2*HEX_ADAM_SIZE+1)
+#else
+#define HEX_ADAM_LOOPX 3
+#define HEX_ADAM_LOOPY 7
+#endif
+#define HEX_MINGRIDSIZE (6*HEX_ADAM_LOOPX)
+#define MINSIZE ((MI_NPIXELS(mi)>=COLORS)?1:(2+(local_neighbors==6)))
+#define NEIGHBORKINDS 2
+#define ANGLES 360
+#define MAXNEIGHBORS 6
+
+/* Singly linked list */
+typedef struct _CellList {
+       XPoint      pt;
+       struct _CellList *next;
+} CellList;
+
+typedef struct {
+       int         init_bits;
+       int         generation;
+       int         xs, ys;
+       int         xb, yb;
+       int         nrows, ncols;
+       int         bx, by, bnrows, bncols;
+       int         mincol, minrow, maxcol, maxrow;
+       int         width, height;
+       int         redrawing, redrawpos;
+       Bool        dead, clockwise;
+       unsigned char *newcells, *oldcells;
+       int         ncells[COLORS];
+       CellList   *cellList[COLORS];
+       unsigned long colors[COLORS];
+       GC          stippledGC;
+       Pixmap      pixmaps[COLORS];
+       union {
+               XPoint      hexagon[6];
+       } shape;
+} loopstruct;
+
+static loopstruct *loops = NULL;
+
+#define TRANSITION(TT,V) V=TT&7;TT>>=3
+#define FINALTRANSITION(TT,V) V=TT&7
+#define TABLE(R,T,L,B) (table[((B)<<9)|((L)<<6)|((T)<<3)|(R)])
+#define HEX_TABLE(R,T,t,l,b,B) (table[((B)<<15)|((b)<<12)|((l)<<9)|((t)<<6)|((T)<<3)|(R)])
+
+#if 0
+/* Instead of setting "unused" state rules to zero it randomizes them.
+   These rules take over when something unexpected happens... like when a
+   cell hits a wall (the end of the screen).
+ */
+#define RAND_RULES
+#endif
+
+#ifdef RAND_RULES
+#define TABLE_IN(C,R,T,L,B,I) (TABLE(R,T,L,B)&=~(7<<((C)*3)));\
+(TABLE(R,T,L,B)|=((I)<<((C)*3)))
+#define HEX_TABLE_IN(C,R,T,t,l,b,B,I) (HEX_TABLE(R,T,t,l,b,B)&=~(7<<((C)*3)));\
+(HEX_TABLE(R,T,t,l,b,B)|=((I)<<((C)*3)))
+#else
+#define TABLE_IN(C,R,T,L,B,I) (TABLE(R,T,L,B)|=((I)<<((C)*3)))
+#define HEX_TABLE_IN(C,R,T,t,l,b,B,I) (HEX_TABLE(R,T,t,l,b,B)|=((I)<<((C)*3)))
+#endif
+#define TABLE_OUT(C,R,T,L,B) ((TABLE(R,T,L,B)>>((C)*3))&7)
+#define HEX_TABLE_OUT(C,R,T,t,l,b,B) ((HEX_TABLE(R,T,t,l,b,B)>>((C)*3))&7)
+
+static unsigned int *table = NULL;     /* 8*8*8*8 = 2^12 = 2^3^4 = 4096 */
+  /* 8*8*8*8*8*8 = 2^18 = 2^3^6 = 262144 = too big? */
+
+static char plots[NEIGHBORKINDS] =
+{
+  4, 6 /* Neighborhoods */
+};
+
+static unsigned int transition_table[] =
+{                              /* Octal  CBLTR->I */
+  /* CBLTRI   CBLTRI   CBLTRI   CBLTRI   CBLTRI */
+    0000000, 0025271, 0113221, 0202422, 0301021,
+    0000012, 0100011, 0122244, 0202452, 0301220,
+    0000020, 0100061, 0122277, 0202520, 0302511,
+    0000030, 0100077, 0122434, 0202552, 0401120,
+    0000050, 0100111, 0122547, 0202622, 0401220,
+    0000063, 0100121, 0123244, 0202722, 0401250,
+    0000071, 0100211, 0123277, 0203122, 0402120,
+    0000112, 0100244, 0124255, 0203216, 0402221,
+    0000122, 0100277, 0124267, 0203226, 0402326,
+    0000132, 0100511, 0125275, 0203422, 0402520,
+    0000212, 0101011, 0200012, 0204222, 0403221,
+    0000220, 0101111, 0200022, 0205122, 0500022,
+    0000230, 0101244, 0200042, 0205212, 0500215,
+    0000262, 0101277, 0200071, 0205222, 0500225,
+    0000272, 0102026, 0200122, 0205521, 0500232,
+    0000320, 0102121, 0200152, 0205725, 0500272,
+    0000525, 0102211, 0200212, 0206222, 0500520,
+    0000622, 0102244, 0200222, 0206722, 0502022,
+    0000722, 0102263, 0200232, 0207122, 0502122,
+    0001022, 0102277, 0200242, 0207222, 0502152,
+    0001120, 0102327, 0200250, 0207422, 0502220,
+    0002020, 0102424, 0200262, 0207722, 0502244,
+    0002030, 0102626, 0200272, 0211222, 0502722,
+    0002050, 0102644, 0200326, 0211261, 0512122,
+    0002125, 0102677, 0200423, 0212222, 0512220,
+    0002220, 0102710, 0200517, 0212242, 0512422,
+    0002322, 0102727, 0200522, 0212262, 0512722,
+    0005222, 0105427, 0200575, 0212272, 0600011,
+    0012321, 0111121, 0200722, 0214222, 0600021,
+    0012421, 0111221, 0201022, 0215222, 0602120,
+    0012525, 0111244, 0201122, 0216222, 0612125,
+    0012621, 0111251, 0201222, 0217222, 0612131,
+    0012721, 0111261, 0201422, 0222272, 0612225,
+    0012751, 0111277, 0201722, 0222442, 0700077,
+    0014221, 0111522, 0202022, 0222462, 0701120,
+    0014321, 0112121, 0202032, 0222762, 0701220,
+    0014421, 0112221, 0202052, 0222772, 0701250,
+    0014721, 0112244, 0202073, 0300013, 0702120,
+    0016251, 0112251, 0202122, 0300022, 0702221,
+    0017221, 0112277, 0202152, 0300041, 0702251,
+    0017255, 0112321, 0202212, 0300076, 0702321,
+    0017521, 0112424, 0202222, 0300123, 0702525,
+    0017621, 0112621, 0202272, 0300421, 0702720,
+    0017721, 0112727, 0202321, 0300622
+};
+
+static unsigned int hex_transition_table[] =
+{                              /* Octal CBbltTR->I */
+  /* CBbltTRI   CBbltTRI   CBbltTRI   CBbltTRI   CBbltTRI */
+
+#ifdef TRIA
+    000000000, 000000020, 000000220, 000002220, 000022220,
+    011122121, 011121221, 011122221, 011221221,
+    011222221, 011112121, 011112221,
+    020021122, 020002122, 020211222, 021111222,
+    020221122, 020027122, 020020722, 020021022,
+    001127221,
+    011122727, 011227227, 010122121, 010222211,
+    021117222, 020112272,
+    070221220,
+    001227221,
+    010221121, 011721221, 011222277,
+    020111222, 020221172,
+    070211220,
+    001217221,
+    010212277, 010221221,
+    020122112,
+    070122220,
+    001722221,
+    010221271,
+    020002022, 021122172,
+    070121220,
+    011122277, 011172121,
+    010212177, 011212277,
+    070112220,
+    001772221,
+    021221772,
+    070121270, 070721220,
+    000112721, 000272211,
+    010022211, 012222277,
+    020072272, 020227122, 020217222,
+    010211121,
+    020002727,
+    070222220,
+    001727721,
+    020021072, 020070722,
+    070002072, 070007022,
+    001772721,
+    070002022,
+    000000070, 000000770, 000072220, 000000270,
+    020110222, 020220272, 020220722,
+    070007071, 070002072, 070007022,
+    000000012, 000000122, 000000212, 001277721,
+    020122072, 020202212,
+    010002121,
+    020001122, 020002112,
+    020021722,
+    020122022, 020027022, 020070122, 020020122,
+    010227027,
+    020101222,
+    010227227, 010227277,
+    021722172,
+    001727221,
+    010222277,
+    020702272,
+    070122020,
+    000172721,
+    010022277, 010202177, 010227127,
+
+    001214221,
+    010202244,
+    020024122, 020020422,
+    040122220,
+    001422221,
+    010221241, 010224224,
+    021122142,
+    040121220,
+    001124221,
+    010224274,
+    020112242, 021422172,
+    040221220,
+    001224221, 001427221,
+    010222244,
+    020227042,
+    040122020,
+    000142721,
+    010022244, 010202144, 010224124,
+    040112220,
+    001442221,
+    021221442,
+    040121240, 040421220,
+    000242211, 000112421,
+    020042242, 020214222, 020021422, 020220242, 020024022,
+    011224224,
+    020224122,
+    020220422,
+    012222244,
+    020002424,
+    040222220,
+    001244421, 000000420, 000000440, 000000240, 000000040,
+    020040121, 020021042,
+    040004022, 040004042, 040002042,
+    010021121,
+    020011122, 020002112,
+    001424421,
+    020040422,
+    001442421,
+    040002022,
+    001724221,
+    010227247,
+    020224072, 021417222,
+    000172421,
+    010021721,
+    020017022,
+    020120212,
+    020271727,
+    070207072, 070701220,
+    000001222,
+    020110122,
+    001277221,
+    001777721,
+    020021222, 020202272, 020120222, 020221722,
+    020027227,
+    070070222,
+    000007220,
+    020101272, 020272172, 020721422, 020721722,
+    020011222, 020202242,
+#if 0
+              {2,2,0,0,2,7,0},
+             {2,0,2,0,2,0,2},
+            {2,4,1,2,2,1,2},
+           {2,1,2,1,2,1,2},
+          {2,0,2,2,1,1,2},
+         {2,7,1,1,1,1,2},
+        {0,2,2,2,2,2,2},
+              {2,2,0,0,7,7,0},
+             {2,1,2,0,2,0,7},
+            {2,0,1,2,2,1,2},
+           {2,4,2,1,2,1,2},
+          {2,1,2,2,1,1,2},
+         {2,0,7,1,1,1,2},
+        {0,2,2,2,2,2,2},
+#endif
+#else
+    000000000, 000000020, 000000220, 000002220,
+    011212121, 011212221, 011221221, 011222221,
+    020002122, 020021122, 020211122,
+
+    010221221, 010222121,
+    020002022, 020021022, 020020122, 020112022,
+
+    010202121,
+    020102022, 020202112,
+
+    000000012, 000000122, 000000212,
+    010002121,
+    020001122, 020002112, 020011122,
+
+
+    001227221, 001272221, 001272721,
+    012212277, 011222727, 011212727,
+    020021722, 020027122, 020020722, 020027022,
+    020211722, 020202172, 020120272,
+    020271122, 020202172, 020207122, 020217122,
+    020120272, 020210722, 020270722,
+    070212220, 070221220, 070212120,
+
+
+    012222277,
+    020002727,
+    070222220,
+
+    001277721, 000000070, 000000270, 000000720, 000000770,
+    020070122, 020021072,
+    070002072, 070007022, 070007071,
+
+    020070722,
+    070002022,
+
+    010227227, 010222727, 010202727,
+    020172022, 020202712,
+
+    001224221, 001242221, 001242421,
+    012212244, 011222424, 011212424,
+    020021422, 020024122, 020020422, 020024022,
+    020211422, 020202142, 020120242,
+    020241122, 020202142, 020204122, 020214122,
+    020120242, 020210422, 020240422,
+    040212220, 040221220, 040212120,
+
+
+    012222244,
+    020002424,
+    040222220,
+
+    001244421, 000000040, 000000240, 000000420, 000000440,
+    020040122, 020021042,
+    040002042,
+    040004021, 040004042,
+
+    020040422,
+    040002022,
+
+    010224224, 010222424, 010202424,
+    020142022, 020202412,
+    020011722, 020112072, 020172072, 020142072,
+
+
+
+    000210225, 000022015, 000022522,
+    011225521,
+    020120525, 020020152, 020005122, 020214255, 020021152,
+    020255242,
+    050215222, 050225121,
+
+    000225220, 001254222,
+    010221250, 011221251, 011225221,
+    020025122, 020152152, 020211252, 020214522, 020511125,
+    050212241, 05221120,
+    040521225,
+
+    000000250, 000000520, 000150220, 000220520, 000222210,
+    001224251,
+    010022152, 010251221, 010522121, 011212151, 011221251,
+    011215221,
+    020000220, 020002152, 020020220, 020022152,
+    020021422, 020022152, 020022522, 020025425, 020050422,
+    020051022, 020051122, 020211122, 020211222, 020215222,
+    020245122,
+    050021125, 050021025, 050011125, 051242221,
+    041225220,
+
+    000220250, 000220520, 001227521, 001275221,
+    011257227, 011522727,
+    020002052, 020002752, 020021052, 020057125,
+    050020722, 050027125,
+    070215220,
+
+    070212255,
+    071225220,
+    020275122,
+    051272521,
+    020055725,
+    020021552,
+    012252277,
+    050002521,
+    020005725,
+
+    050011022,
+    000000155,
+    020050722,
+    001227250,
+    010512727,
+    010002151,
+    020027112,
+    001227251,
+    012227257,
+    050002125,
+    020517122,
+    050002025,
+    020050102,
+    050002725,
+    020570722,
+    001252721,
+    020007051,
+    020102052,
+    020271072,
+    050001122,
+    010002151,
+    011227257,
+    020051722,
+    020057022,
+    020050122,
+
+
+    020051422,
+    011224254,
+    012224254,
+
+    020054022,
+    050002425,
+    040252220,
+    020002454,
+
+
+    000000540,
+    001254425,
+    050004024,
+    040004051,
+
+    000000142,
+    040001522,
+    010002547,
+    020045122,
+    051221240,
+    020002512,
+    020021522,
+
+
+    020020022,
+    021125522,
+    020521122,
+    020025022,
+    020025522,
+    020020522,
+
+    020202222,
+    020212222,
+    021212222,
+    021222722,
+    021222422,
+    020002222,
+    020021222,
+    020022122,
+    020212122,
+    020027222,
+    020024222,
+    020212722,
+    020212422,
+    020202122,
+    001222221,
+    020002522,
+
+    020017125,
+    010022722,
+    020212052,
+
+    020205052,
+    070221250,
+
+    000000050, 000005220, 000002270, 070252220,
+    000000450, 000007220,
+    000220220, 000202220, 000022020, 000020220,
+
+    000222040,
+    000220440,
+    000022040,
+    000040220,
+
+    000252220,
+    050221120, 010221520,
+    002222220,
+
+    000070220, 000220720,
+    000020520, 000070250, 000222070, 000027020,
+    000022070, 000202270, 000024020, 000220420,
+    000220270, 000220240, 000072020, 000042020,
+    000002020, 000002070, 000020270, 000020250,
+    000270270, 000007020, 000040270,
+
+    /* Collision starts (gen 540), not sure to have rules to save it
+       or depend on calloc to intialize remaining rules to 0 so that
+       the mutant will be born
+     */
+    000050220,
+#endif
+};
+
+
+/*-
+Neighborhoods are read as follows (rotations are not listed):
+    T
+  L C R  ==>  I
+    B
+
+   t T
+  l C R  ==>  I
+   b B
+ */
+
+static unsigned char self_reproducing_loop[ADAM_LOOPY][ADAM_LOOPX] =
+{
+/* 10x10 */
+       {0, 2, 2, 2, 2, 2, 2, 2, 2, 0},
+       {2, 4, 0, 1, 4, 0, 1, 1, 1, 2},
+       {2, 1, 2, 2, 2, 2, 2, 2, 1, 2},
+       {2, 0, 2, 0, 0, 0, 0, 2, 1, 2},
+       {2, 7, 2, 0, 0, 0, 0, 2, 7, 2},
+       {2, 1, 2, 0, 0, 0, 0, 2, 0, 2},
+       {2, 0, 2, 0, 0, 0, 0, 2, 1, 2},
+       {2, 7, 2, 2, 2, 2, 2, 2, 7, 2},
+       {2, 1, 0, 6, 1, 0, 7, 1, 0, 2},
+       {0, 2, 2, 2, 2, 2, 2, 2, 2, 0}
+};
+
+static unsigned char hex_self_reproducing_loop[HEX_ADAM_LOOPY][HEX_ADAM_LOOPX] =
+{
+#if 0
+/* Experimental TRIA5:7x7 */
+             {2,2,0,0,0,0,0},
+            {2,1,2,0,2,2,0},
+           {2,0,4,2,2,0,2},
+          {2,7,2,0,2,0,2},
+         {2,1,2,2,1,1,2},
+        {2,0,7,1,0,7,2},
+       {0,2,2,2,2,2,2},
+  /* Stem cells, only "5" will fully reproduce itself */
+/* 3:12x7 */
+             {2,2,2,2,0,0,0,0,0,0,0,0},
+            {2,1,1,1,2,0,0,0,0,0,0,0},
+           {2,1,2,2,1,2,2,2,2,2,2,0},
+          {2,1,2,0,2,7,1,1,1,1,1,2},
+         {0,2,1,2,2,0,2,2,2,2,2,2},
+        {0,0,2,0,4,1,2,0,0,0,0,0},
+       {0,0,0,2,2,2,2,0,0,0,0,0}
+/* 4:14x9 */
+               {2,2,2,2,2,0,0,0,0,0,0,0,0,0},
+              {2,1,1,1,1,2,0,0,0,0,0,0,0,0},
+             {2,1,2,2,2,1,2,0,0,0,0,0,0,0},
+            {2,1,2,0,0,2,1,2,2,2,2,2,2,0},
+           {2,1,2,0,0,0,2,7,1,1,1,1,1,2},
+          {0,2,1,2,0,0,2,0,2,2,2,2,2,2},
+         {0,0,2,0,2,2,2,1,2,0,0,0,0,0},
+        {0,0,0,2,4,1,0,7,2,0,0,0,0,0},
+       {0,0,0,0,2,2,2,2,2,0,0,0,0,0}
+/* 5:16x11 */
+                 {2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0},
+                {2,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0},
+               {2,1,2,2,2,2,1,2,0,0,0,0,0,0,0,0},
+              {2,1,2,0,0,0,2,1,2,0,0,0,0,0,0,0},
+             {2,1,2,0,0,0,0,2,1,2,2,2,2,2,2,0},
+            {2,1,2,0,0,0,0,0,2,7,1,1,1,1,1,2},
+           {0,2,1,2,0,0,0,0,2,0,2,2,2,2,2,2},
+          {0,0,2,0,2,0,0,0,2,1,2,0,0,0,0,0},
+         {0,0,0,2,4,2,2,2,2,7,2,0,0,0,0,0},
+        {0,0,0,0,2,1,0,7,1,0,2,0,0,0,0,0},
+       {0,0,0,0,0,2,2,2,2,2,2,0,0,0,0,0}
+/* test:3x7  (0,4) is blank  ... very strange.
+          init_adam seems ok something after that I guess */
+                    {2,2,0},
+                   {2,0,2},
+                  {0,2,2},
+                 {0,0,0},
+                {2,2,0},
+               {2,1,2},
+              {0,2,2},
+#else /* this might be better for hexagons, spacewise efficient... */
+#ifdef TRIA
+/* Experimental TRIA5:7x7 */
+             {2,2,0,0,2,2,0},
+            {2,4,2,0,2,7,2},
+           {2,1,0,2,2,0,2},
+          {2,0,2,1,2,1,2},
+         {2,7,2,2,7,7,2},
+        {2,1,0,7,1,0,2},
+       {0,2,2,2,2,2,2},
+#else
+/* 5:11x11 */
+                 {2,2,2,2,2,2,0,0,0,0,0},
+                {2,1,1,7,0,1,2,0,0,0,0},
+               {2,1,2,2,2,2,7,2,0,0,0},
+              {2,1,2,0,0,0,2,0,2,0,0},
+             {2,1,2,0,0,0,0,2,1,2,0},
+            {2,1,2,0,0,0,0,0,2,7,2},
+           {0,2,1,2,0,0,0,0,2,0,2},
+          {0,0,2,1,2,0,0,0,2,1,2},
+         {0,0,0,2,1,2,2,2,2,4,2},
+        {0,0,0,0,2,1,1,1,1,5,2},
+       {0,0,0,0,0,2,2,2,2,2,2}
+#endif
+#endif
+};
+
+static void
+position_of_neighbor(int dir, int *pcol, int *prow)
+{
+       int         col = *pcol, row = *prow;
+
+       /* NO WRAPING */
+
+       if (local_neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col++;
+                               break;
+                       case 60:
+                               col += (row & 1);
+                               row--;
+                               break;
+                       case 120:
+                               col -= !(row & 1);
+                               row--;
+                               break;
+                       case 180:
+                               col--;
+                               break;
+                       case 240:
+                               col -= !(row & 1);
+                               row++;
+                               break;
+                       case 300:
+                               col += (row & 1);
+                               row++;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {
+               switch (dir) {
+                       case 0:
+                               col++;
+                               break;
+                       case 90:
+                               row--;
+                               break;
+                       case 180:
+                               col--;
+                               break;
+                       case 270:
+                               row++;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       }
+       *pcol = col;
+       *prow = row;
+}
+
+static      Bool
+withinBounds(loopstruct * lp, int col, int row)
+{
+       return (row >= 1 && row < lp->bnrows - 1 &&
+               col >= 1 && col < lp->bncols - 1 - (local_neighbors == 6 && (row % 2)));
+}
+
+static void
+fillcell(ModeInfo * mi, GC gc, int col, int row)
+{
+       loopstruct *lp = &loops[MI_SCREEN(mi)];
+
+       if (local_neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               lp->shape.hexagon[0].x = lp->xb + ccol * lp->xs;
+               lp->shape.hexagon[0].y = lp->yb + crow * lp->ys;
+               if (lp->xs == 1 && lp->ys == 1)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                               lp->shape.hexagon[0].x, lp->shape.hexagon[0].y);
+               else
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                               lp->shape.hexagon, 6, Convex, CoordModePrevious);
+       } else {
+               XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                       lp->xb + lp->xs * col, lp->yb + lp->ys * row,
+                       lp->xs - (lp->xs > 3), lp->ys - (lp->ys > 3));
+       }
+}
+
+static void
+drawcell(ModeInfo * mi, int col, int row, int state)
+{
+       loopstruct *lp = &loops[MI_SCREEN(mi)];
+       XGCValues   gcv;
+       GC          gc;
+
+       if (MI_NPIXELS(mi) >= COLORS) {
+               gc = MI_GC(mi);
+               XSetForeground(MI_DISPLAY(mi), gc, lp->colors[state]);
+       } else {
+               gcv.stipple = lp->pixmaps[state];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), lp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = lp->stippledGC;
+       }
+       fillcell(mi, gc, col, row);
+}
+
+#ifdef DEBUG
+static void
+print_state(ModeInfo * mi, int state)
+{
+       loopstruct *lp = &loops[MI_SCREEN(mi)];
+       CellList   *locallist = lp->cellList[state];
+       int         i = 0;
+
+       (void) printf("state %d\n", state);
+       while (locallist) {
+               (void) printf("%d x %d, y %d\n", i,
+                             locallist->pt.x, locallist->pt.y);
+               locallist = locallist->next;
+               i++;
+       }
+}
+
+#endif
+
+static void
+free_state(loopstruct * lp, int state)
+{
+       CellList   *current;
+
+       while (lp->cellList[state]) {
+               current = lp->cellList[state];
+               lp->cellList[state] = lp->cellList[state]->next;
+               (void) free((void *) current);
+       }
+       lp->ncells[state] = 0;
+}
+
+static void
+free_list(loopstruct * lp)
+{
+       int         state;
+
+       for (state = 0; state < COLORS; state++)
+               free_state(lp, state);
+}
+
+static void
+free_loop(Display *display, loopstruct * lp)
+{
+       int         shade;
+
+       for (shade = 0; shade < lp->init_bits; shade++)
+               if (lp->pixmaps[shade] != None) {
+                       XFreePixmap(display, lp->pixmaps[shade]);
+                       lp->pixmaps[shade] = None;
+               }
+       if (lp->stippledGC != None) {
+               XFreeGC(display, lp->stippledGC);
+               lp->stippledGC = None;
+       }
+       if (lp->oldcells != NULL) {
+               (void) free((void *) lp->oldcells);
+               lp->oldcells = NULL;
+       }
+       if (lp->newcells != NULL) {
+               (void) free((void *) lp->newcells);
+               lp->newcells = NULL;
+       }
+       free_list(lp);
+}
+
+static Bool
+addtolist(ModeInfo * mi, int col, int row, unsigned char state)
+{
+       loopstruct *lp = &loops[MI_SCREEN(mi)];
+       CellList   *current = lp->cellList[state];
+
+       if ((lp->cellList[state] = (CellList *) malloc(sizeof (CellList))) ==
+                       NULL) {
+               lp->cellList[state] = current;
+               free_loop(MI_DISPLAY(mi), lp);
+               return False;
+       }
+       lp->cellList[state]->pt.x = col;
+       lp->cellList[state]->pt.y = row;
+       lp->cellList[state]->next = current;
+       lp->ncells[state]++;
+       return True;
+}
+
+static Bool
+draw_state(ModeInfo * mi, int state)
+{
+       loopstruct *lp = &loops[MI_SCREEN(mi)];
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc;
+       XGCValues   gcv;
+       CellList   *current = lp->cellList[state];
+
+       if (MI_NPIXELS(mi) >= COLORS) {
+               gc = MI_GC(mi);
+               XSetForeground(display, gc, lp->colors[state]);
+       } else {
+               gcv.stipple = lp->pixmaps[state];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(display, lp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = lp->stippledGC;
+       }
+
+       if (local_neighbors == 6) {       /* Draw right away, slow */
+               while (current) {
+                       int      col, row, ccol, crow;
+
+                       col = current->pt.x;
+                       row = current->pt.y;
+                       ccol = 2 * col + !(row & 1), crow = 2 * row;
+                       lp->shape.hexagon[0].x = lp->xb + ccol * lp->xs;
+                       lp->shape.hexagon[0].y = lp->yb + crow * lp->ys;
+                       if (lp->xs == 1 && lp->ys == 1)
+                               XDrawPoint(display, MI_WINDOW(mi), gc,
+                                       lp->shape.hexagon[0].x, lp->shape.hexagon[0].y);
+                       else
+                               XFillPolygon(display, MI_WINDOW(mi), gc,
+                                       lp->shape.hexagon, 6, Convex, CoordModePrevious);
+                       current = current->next;
+               }
+       } else {
+               /* Take advantage of XFillRectangles */
+               XRectangle *rects;
+               int         nrects = 0;
+
+               /* Create Rectangle list from part of the cellList */
+               if ((rects = (XRectangle *) malloc(lp->ncells[state] *
+                               sizeof (XRectangle))) == NULL) {
+                       return False;
+               }
+
+               while (current) {
+                       rects[nrects].x = lp->xb + current->pt.x * lp->xs;
+                       rects[nrects].y = lp->yb + current->pt.y * lp->ys;
+                       rects[nrects].width = lp->xs - (lp->xs > 3);
+                       rects[nrects].height = lp->ys - (lp->ys > 3);
+                       current = current->next;
+                       nrects++;
+               }
+               /* Finally get to draw */
+               XFillRectangles(display, MI_WINDOW(mi), gc, rects, nrects);
+               /* Free up rects list and the appropriate part of the cellList */
+               (void) free((void *) rects);
+       }
+       free_state(lp, state);
+       XFlush(display);
+       return True;
+}
+
+static Bool
+init_table()
+{
+       if (table == NULL) {
+               int mult = 1;
+               unsigned int tt, c, n[MAXNEIGHBORS], i;
+               int         j, k;
+               int  size_transition_table = sizeof (transition_table) /
+                       sizeof (unsigned int);
+               int  size_hex_transition_table = sizeof (hex_transition_table) /
+                       sizeof (unsigned int);
+
+               for (j = 0; j < local_neighbors; j++)
+                       mult *= 8;
+
+               if ((table = (unsigned int *) calloc(mult, sizeof (unsigned int))) == NULL) {
+                       return False;
+               }
+
+
+#ifdef RAND_RULES
+               /* Here I was interested to see what happens when it hits a wall....
+                  Rules not normally used take over... takes too much time though */
+               /* Each state = 3 bits */
+               if (MAXRAND < 16777216.0) {
+                       for (j = 0; j < mult; j++) {
+                               table[j] = (unsigned int) ((NRAND(4096) << 12) & NRAND(4096));
+                       }
+               } else {
+                       for  (j = 0; j < mult; j++) {
+                               table[j] = (unsigned int) (NRAND(16777216));
+                       }
+               }
+#endif
+               if (local_neighbors == 6) {
+                       for (j = 0; j < size_hex_transition_table; j++) {
+                               tt = hex_transition_table[j];
+                               TRANSITION(tt, i);
+                               for (k = 0; k < local_neighbors; k++) {
+                                       TRANSITION(tt, n[k]);
+                               }
+                               FINALTRANSITION(tt, c);
+                               HEX_TABLE_IN(c, n[0], n[1], n[2], n[3], n[4], n[5], i);
+                               HEX_TABLE_IN(c, n[1], n[2], n[3], n[4], n[5], n[0], i);
+                               HEX_TABLE_IN(c, n[2], n[3], n[4], n[5], n[0], n[1], i);
+                               HEX_TABLE_IN(c, n[3], n[4], n[5], n[0], n[1], n[2], i);
+                               HEX_TABLE_IN(c, n[4], n[5], n[0], n[1], n[2], n[3], i);
+                               HEX_TABLE_IN(c, n[5], n[0], n[1], n[2], n[3], n[4], i);
+                       }
+               } else {
+                       for (j = 0; j < size_transition_table; j++) {
+                               tt = transition_table[j];
+                               TRANSITION(tt, i);
+                               for (k = 0; k < local_neighbors; k++) {
+                                       TRANSITION(tt, n[k]);
+                               }
+                               FINALTRANSITION(tt, c);
+                               TABLE_IN(c, n[0], n[1], n[2], n[3], i);
+                               TABLE_IN(c, n[1], n[2], n[3], n[0], i);
+                               TABLE_IN(c, n[2], n[3], n[0], n[1], i);
+                               TABLE_IN(c, n[3], n[0], n[1], n[2], i);
+                       }
+               }
+       }
+       return True;
+}
+
+static void
+init_flaw(ModeInfo * mi)
+{
+       loopstruct *lp = &loops[MI_SCREEN(mi)];
+       int a, b;
+
+#define        BLUE 2
+       if (lp->bncols <= 3 || lp->bnrows <= 3)
+               return;
+       a = NRAND(lp->bncols - 3);
+       b = NRAND(lp->bnrows - 3);
+       if (lp->mincol > a)
+               lp->mincol = a;
+       if (lp->minrow > b)
+               lp->minrow = b;
+       if (lp->maxcol < a + 2)
+               lp->maxcol = a + 2;
+       if (lp->maxrow < b + 2)
+               lp->maxrow = b + 2;
+
+       if (local_neighbors == 6) {
+               lp->newcells[b * lp->bncols + a + !(b % 2) ] = BLUE;
+               lp->newcells[b * lp->bncols + a + 1 + !(b % 2)] = BLUE;
+               lp->newcells[(b + 1) * lp->bncols + a] = BLUE;
+               lp->newcells[(b + 1) * lp->bncols + a + 2] = BLUE;
+               lp->newcells[(b + 2) * lp->bncols + a + !(b % 2)] = BLUE;
+               lp->newcells[(b + 2) * lp->bncols + a + 1 + !(b % 2)] = BLUE;
+       } else {
+               int orient = NRAND(4);
+               lp->newcells[lp->bncols * (b + 1) + a + 1] = BLUE;
+               if (orient == 0 || orient == 1) {
+                       lp->newcells[lp->bncols * b + a + 1] = BLUE;
+               }
+               if (orient == 1 || orient == 2) {
+                       lp->newcells[lp->bncols * (b + 1) + a + 2] = BLUE;
+               }
+               if (orient == 2 || orient == 3) {
+                       lp->newcells[lp->bncols * (b + 2) + a + 1] = BLUE;
+               }
+               if (orient == 3 || orient == 0) {
+                       lp->newcells[lp->bncols * (b + 1) + a] = BLUE;
+               }
+       }
+}
+
+static void
+init_adam(ModeInfo * mi)
+{
+       loopstruct *lp = &loops[MI_SCREEN(mi)];
+       XPoint      start, dirx, diry;
+       int         i, j, dir;
+
+#ifdef DELAYDEBUGLOOP
+       lp->clockwise = 0;
+       if (!MI_COUNT(mi)) /* Probably doing testing so do not confuse */
+#endif
+       lp->clockwise = (Bool) (LRAND() & 1);
+#ifdef DELAYDEBUGLOOP
+       dir = 0;
+       if (!MI_COUNT(mi)) /* Probably doing testing so do not confuse */
+#endif
+       dir = NRAND(local_neighbors);
+       if (local_neighbors == 6) {
+               int k;
+
+               switch (dir) {
+                       case 0:
+                               start.x = (lp->bncols - HEX_ADAM_LOOPX / 2) / 2;
+                               start.y = (lp->bnrows - HEX_ADAM_LOOPY) / 2;
+                               if (lp->mincol > start.x - 2)
+                                       lp->mincol = start.x - 2;
+                               if (lp->minrow > start.y - 1)
+                                       lp->minrow = start.y - 1;
+                               if (lp->maxcol < start.x + HEX_ADAM_LOOPX + 1)
+                                       lp->maxcol = start.x + HEX_ADAM_LOOPX + 1;
+                               if (lp->maxrow < start.y + HEX_ADAM_LOOPY + 1)
+                                       lp->maxrow = start.y + HEX_ADAM_LOOPY + 1;
+                               for (j = 0; j < HEX_ADAM_LOOPY; j++) {
+                                       for (i = 0; i < HEX_ADAM_LOOPX; i++) {
+                                               k = (((lp->bnrows / 2 + HEX_ADAM_LOOPY / 2) % 2) ? -j / 2 : -(j + 1) / 2);
+                                               lp->newcells[(start.y + j) * lp->bncols + start.x + i + k] =
+                                                       (lp->clockwise) ?
+                                       hex_self_reproducing_loop[i][j] :
+                                       hex_self_reproducing_loop[j][i];
+                                       }
+                               }
+                               break;
+                       case 1:
+                               start.x = (lp->bncols - (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2) / 2;
+                               start.y = (lp->bnrows - HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2;
+                               if (lp->mincol > start.x - 1)
+                                       lp->mincol = start.x - 1;
+                               if (lp->minrow > start.y - HEX_ADAM_LOOPX)
+                                       lp->minrow = start.y - HEX_ADAM_LOOPX;
+                               if (lp->maxcol < start.x + (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2 + 1)
+                                       lp->maxcol = start.x + (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2 + 1;
+                               if (lp->maxrow < start.y + HEX_ADAM_LOOPY + 1)
+                                       lp->maxrow = start.y + HEX_ADAM_LOOPY + 1;
+                               for (j = 0; j < HEX_ADAM_LOOPY; j++) {
+                                       for (i = 0; i < HEX_ADAM_LOOPX; i++) {
+                                               k = (((lp->bnrows / 2 + (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2) % 2)
+              ? -(i + j + 1) / 2 : -(i + j) / 2);
+                                               lp->newcells[(start.y + j - i) * lp->bncols + start.x + i + j + k] =
+                                                       (lp->clockwise) ?
+                                                       hex_self_reproducing_loop[i][j] :
+                                                       hex_self_reproducing_loop[j][i];
+                                       }
+                               }
+                               break;
+                       case 2:
+                               start.x = (lp->bncols - HEX_ADAM_LOOPY / 2) / 2;
+                               start.y = (lp->bnrows - HEX_ADAM_LOOPX) / 2;
+                               if (lp->mincol > start.x - 2)
+                                       lp->mincol = start.x - 2;
+                               if (lp->minrow > start.y - 1)
+                                       lp->minrow = start.y - 1;
+                               if (lp->maxcol < start.x + HEX_ADAM_LOOPX + 1)
+                                       lp->maxcol = start.x + HEX_ADAM_LOOPX + 1;
+                               if (lp->maxrow < start.y + HEX_ADAM_LOOPY + 1)
+                                       lp->maxrow = start.y + HEX_ADAM_LOOPY + 1;
+                               for (j = 0; j < HEX_ADAM_LOOPX; j++) {
+                                       for (i = 0; i < HEX_ADAM_LOOPY; i++) {
+                                               k = (((lp->bnrows / 2 + HEX_ADAM_LOOPX / 2) % 2) ? -(HEX_ADAM_LOOPX - j - 1) / 2 : -(HEX_ADAM_LOOPX - j) / 2);
+                                               lp->newcells[(start.y + j) * lp->bncols + start.x + i + k] =
+                                                       (lp->clockwise) ?
+                                                       hex_self_reproducing_loop[j][HEX_ADAM_LOOPX - i - 1] :
+                                                       hex_self_reproducing_loop[i][HEX_ADAM_LOOPY - j - 1];
+                                       }
+                               }
+                               break;
+                       case 3:
+                               start.x = (lp->bncols - HEX_ADAM_LOOPX / 2) / 2;
+                               start.y = (lp->bnrows - HEX_ADAM_LOOPY) / 2;
+                               if (lp->mincol > start.x - 1)
+                                       lp->mincol = start.x - 1;
+                               if (lp->minrow > start.y - 1)
+                                       lp->minrow = start.y - 1;
+                               if (lp->maxcol < start.x + HEX_ADAM_LOOPX + 1)
+                                       lp->maxcol = start.x + HEX_ADAM_LOOPX + 1;
+                               if (lp->maxrow < start.y + HEX_ADAM_LOOPY + 1)
+                                       lp->maxrow = start.y + HEX_ADAM_LOOPY + 1;
+                               for (j = 0; j < HEX_ADAM_LOOPY; j++) {
+                                       for (i = 0; i < HEX_ADAM_LOOPX; i++) {
+                                               k = (((lp->bnrows / 2 + HEX_ADAM_LOOPY / 2) % 2) ? -j / 2 : -(j + 1) / 2);
+                                               lp->newcells[(start.y + j) * lp->bncols + start.x + i + k] =
+                                                       (lp->clockwise) ?
+                                                       hex_self_reproducing_loop[HEX_ADAM_LOOPX - i - 1][HEX_ADAM_LOOPY - j - 1] :
+                                                       hex_self_reproducing_loop[HEX_ADAM_LOOPY - j - 1][HEX_ADAM_LOOPX - i - 1];
+                                       }
+                               }
+                               break;
+                       case 4:
+                               start.x = (lp->bncols - (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2) / 2;
+                               start.y = (lp->bnrows - HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2;
+                               if (lp->mincol > start.x - 1)
+                                       lp->mincol = start.x - 1;
+                               if (lp->minrow > start.y - HEX_ADAM_LOOPX)
+                                       lp->minrow = start.y - HEX_ADAM_LOOPX;
+                               if (lp->maxcol < start.x + (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2 + 1)
+                                       lp->maxcol = start.x + (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2 + 1;
+                               if (lp->maxrow < start.y + HEX_ADAM_LOOPY + 1)
+                                       lp->maxrow = start.y + HEX_ADAM_LOOPY + 1;
+                               for (j = 0; j < HEX_ADAM_LOOPY; j++) {
+                                       for (i = 0; i < HEX_ADAM_LOOPX; i++) {
+                                               k = (((lp->bnrows / 2 + (HEX_ADAM_LOOPX + HEX_ADAM_LOOPY) / 2) % 2)
+              ? -(i + j + 1) / 2 : -(i + j) / 2);
+                                               lp->newcells[(start.y + j - i) * lp->bncols + start.x + i + j + k] =
+                                                       (lp->clockwise) ?
+                                                       hex_self_reproducing_loop[HEX_ADAM_LOOPX - i - 1][HEX_ADAM_LOOPY - j - 1] :
+                                                       hex_self_reproducing_loop[HEX_ADAM_LOOPY - j - 1][HEX_ADAM_LOOPX - i - 1];
+                                       }
+                               }
+                               break;
+                       case 5:
+                               start.x = (lp->bncols - HEX_ADAM_LOOPY / 2) / 2;
+                               start.y = (lp->bnrows - HEX_ADAM_LOOPX) / 2;
+                               if (lp->mincol > start.x - 2)
+                                       lp->mincol = start.x - 2;
+                               if (lp->minrow > start.y - 1)
+                                       lp->minrow = start.y - 1;
+                               if (lp->maxcol < start.x + HEX_ADAM_LOOPY + 1)
+                                       lp->maxcol = start.x + HEX_ADAM_LOOPY + 1;
+                               if (lp->maxrow < start.y + HEX_ADAM_LOOPX + 1)
+                                       lp->maxrow = start.y + HEX_ADAM_LOOPX + 1;
+                               for (j = 0; j < HEX_ADAM_LOOPX; j++) {
+                                       for (i = 0; i < HEX_ADAM_LOOPY; i++) {
+                                               k = (((lp->bnrows / 2 + HEX_ADAM_LOOPX / 2) % 2) ? -(HEX_ADAM_LOOPX - j - 1) / 2 : -(HEX_ADAM_LOOPX - j) / 2);
+                                               lp->newcells[(start.y + j) * lp->bncols + start.x + i + k] =
+                                                       (lp->clockwise) ?
+                                                       hex_self_reproducing_loop[HEX_ADAM_LOOPY - j - 1][i] :
+                                                       hex_self_reproducing_loop[HEX_ADAM_LOOPX - i - 1][j];
+                                       }
+                               }
+                               break;
+               }
+#if DEBUGTEST
+                               /* (void) printf ("s %d  s %d \n", start.x, start.y); */
+               (void) printf ("%d %d %d %d %d\n",
+     start.x + i + ((lp->bnrows / 2 % 2) ? -j / 2 : -(j + 1) / 2) - lp->bx,
+                start.y + j - lp->by, i, j, hex_self_reproducing_loop[j][i]);
+               /* Draw right away */
+               drawcell(mi, start.x + i + ((lp->bnrows / 2 % 2) ? -j / 2 : -(j + 1) / 2) - lp->bx,
+                start.y + j - lp->by,
+                hex_self_reproducing_loop[j][i]);
+#endif
+  } else {
+               switch (dir) {
+                       case 0:
+                               start.x = (lp->bncols - ADAM_LOOPX) / 2;
+                               start.y = (lp->bnrows - ADAM_LOOPY) / 2;
+                               dirx.x = 1, dirx.y = 0;
+                               diry.x = 0, diry.y = 1;
+                               if (lp->mincol > start.x)
+                                       lp->mincol = start.x;
+                               if (lp->minrow > start.y)
+                                       lp->minrow = start.y;
+                               if (lp->maxcol < start.x + ADAM_LOOPX)
+                                       lp->maxcol = start.x + ADAM_LOOPX;
+                               if (lp->maxrow < start.y + ADAM_LOOPY)
+                                       lp->maxrow = start.y + ADAM_LOOPY;
+                               break;
+                       case 1:
+                               start.x = (lp->bncols + ADAM_LOOPY) / 2;
+                               start.y = (lp->bnrows - ADAM_LOOPX) / 2;
+                               dirx.x = 0, dirx.y = 1;
+                               diry.x = -1, diry.y = 0;
+                               if (lp->mincol > start.x - ADAM_LOOPY)
+                                       lp->mincol = start.x - ADAM_LOOPY;
+                               if (lp->minrow > start.y)
+                                       lp->minrow = start.y;
+                               if (lp->maxcol < start.x)
+                                       lp->maxcol = start.x;
+                               if (lp->maxrow < start.y + ADAM_LOOPX)
+                                       lp->maxrow = start.y + ADAM_LOOPX;
+                               break;
+                       case 2:
+                               start.x = (lp->bncols + ADAM_LOOPX) / 2;
+                               start.y = (lp->bnrows + ADAM_LOOPY) / 2;
+                               dirx.x = -1, dirx.y = 0;
+                               diry.x = 0, diry.y = -1;
+                               if (lp->mincol > start.x - ADAM_LOOPX)
+                                       lp->mincol = start.x - ADAM_LOOPX;
+                               if (lp->minrow > start.y - ADAM_LOOPY)
+                                       lp->minrow = start.y - ADAM_LOOPY;
+                               if (lp->maxcol < start.x)
+                                       lp->maxcol = start.x;
+                               if (lp->maxrow < start.y)
+                                       lp->maxrow = start.y;
+                               break;
+                       case 3:
+                               start.x = (lp->bncols - ADAM_LOOPY) / 2;
+                               start.y = (lp->bnrows + ADAM_LOOPX) / 2;
+                               dirx.x = 0, dirx.y = -1;
+                               diry.x = 1, diry.y = 0;
+                               if (lp->mincol > start.x)
+                                       lp->mincol = start.x;
+                               if (lp->minrow > start.y - ADAM_LOOPX)
+                                       lp->minrow = start.y - ADAM_LOOPX;
+                               if (lp->maxcol < start.x + ADAM_LOOPX)
+                                       lp->maxcol = start.x + ADAM_LOOPX;
+                               if (lp->maxrow < start.y)
+                                       lp->maxrow = start.y;
+                               break;
+               }
+               for (j = 0; j < ADAM_LOOPY; j++)
+                       for (i = 0; i < ADAM_LOOPX; i++)
+                         lp->newcells[lp->bncols * (start.y + dirx.y * i + diry.y * j) +
+                           start.x + dirx.x * i + diry.x * j] =
+                           (lp->clockwise) ?
+                             self_reproducing_loop[j][ADAM_LOOPX - i - 1] :
+                             self_reproducing_loop[j][i];
+#if DEBUG
+               /* Draw right away */
+               drawcell(mi, start.x + dirx.x * i + diry.x * j - lp->bx,
+                start.y + dirx.y * i + diry.y * j - lp->by,
+                (lp->clockwise) ? self_reproducing_loop[j][ADAM_LOOPX - i - i] : self_reproducing_loop[j][i]);
+#endif
+       }
+}
+
+
+static void
+do_gen(loopstruct * lp)
+{
+       int         i, j, k;
+       unsigned char *z;
+       unsigned int n[MAXNEIGHBORS];
+       unsigned int c;
+
+#define LOC(X, Y) (*(lp->oldcells + (X) + ((Y) * lp->bncols)))
+
+       for (j = lp->minrow; j <= lp->maxrow; j++) {
+               for (i = lp->mincol; i <= lp->maxcol; i++) {
+                       z = lp->newcells + i + j * lp->bncols;
+                       c = LOC(i, j);
+                       for (k = 0; k < local_neighbors; k++) {
+                               int         newi = i, newj = j;
+
+                               position_of_neighbor(k * ANGLES / local_neighbors, &newi, &newj);
+                               n[k] = 0;
+                   if (withinBounds(lp, newi, newj)) {
+                                       n[k] = LOC(newi, newj);
+                               }
+                       }
+                       if (local_neighbors == 6) {
+                               *z = (lp->clockwise) ?
+                                       HEX_TABLE_OUT(c, n[5], n[4], n[3], n[2], n[1], n[0]) :
+                                       HEX_TABLE_OUT(c, n[0], n[1], n[2], n[3], n[4], n[5]);
+                       } else {
+                               *z = (lp->clockwise) ?
+                                       TABLE_OUT(c, n[3], n[2], n[1], n[0]) :
+                                       TABLE_OUT(c, n[0], n[1], n[2], n[3]);
+                       }
+               }
+       }
+}
+
+void
+release_loop(ModeInfo * mi)
+{
+       if (loops != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_loop(MI_DISPLAY(mi), &loops[screen]);
+               (void) free((void *) loops);
+               loops = NULL;
+       }
+       if (table != NULL) {
+               (void) free((void *) table);
+               table = NULL;
+       }
+}
+
+void
+init_loop(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i, size = MI_SIZE(mi);
+       loopstruct *lp;
+       XGCValues   gcv;
+
+       if (loops == NULL) {
+               if ((loops = (loopstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (loopstruct))) == NULL)
+                       return;
+       }
+       lp = &loops[MI_SCREEN(mi)];
+
+       lp->redrawing = 0;
+
+       if ((MI_NPIXELS(mi) < COLORS) && (lp->init_bits == 0)) {
+               if (lp->stippledGC == None) {
+                       gcv.fill_style = FillOpaqueStippled;
+                       if ((lp->stippledGC = XCreateGC(display, window,
+                                GCFillStyle, &gcv)) == None) {
+                               free_loop(display, lp);
+                               return;
+                       }
+               }
+               LOOPBITS(stipples[0], STIPPLESIZE, STIPPLESIZE);
+               LOOPBITS(stipples[2], STIPPLESIZE, STIPPLESIZE);
+               LOOPBITS(stipples[3], STIPPLESIZE, STIPPLESIZE);
+               LOOPBITS(stipples[4], STIPPLESIZE, STIPPLESIZE);
+               LOOPBITS(stipples[6], STIPPLESIZE, STIPPLESIZE);
+               LOOPBITS(stipples[7], STIPPLESIZE, STIPPLESIZE);
+               LOOPBITS(stipples[8], STIPPLESIZE, STIPPLESIZE);
+               LOOPBITS(stipples[10], STIPPLESIZE, STIPPLESIZE);
+       }
+       if (MI_NPIXELS(mi) >= COLORS) {
+               /* Maybe these colors should be randomized */
+               lp->colors[0] = MI_BLACK_PIXEL(mi);
+               lp->colors[1] = MI_PIXEL(mi, 0);        /* RED */
+               lp->colors[5] = MI_PIXEL(mi, MI_NPIXELS(mi) / REALCOLORS);      /* YELLOW */
+               lp->colors[4] = MI_PIXEL(mi, 2 * MI_NPIXELS(mi) / REALCOLORS);  /* GREEN */
+               lp->colors[6] = MI_PIXEL(mi, 3 * MI_NPIXELS(mi) / REALCOLORS);  /* CYAN */
+               lp->colors[2] = MI_PIXEL(mi, 4 * MI_NPIXELS(mi) / REALCOLORS);  /* BLUE */
+               lp->colors[3] = MI_PIXEL(mi, 5 * MI_NPIXELS(mi) / REALCOLORS);  /* MAGENTA */
+               lp->colors[7] = MI_WHITE_PIXEL(mi);
+       }
+       free_list(lp);
+       lp->generation = 0;
+       lp->width = MI_WIDTH(mi);
+       lp->height = MI_HEIGHT(mi);
+
+       if (!local_neighbors) {
+               for (i = 0; i < NEIGHBORKINDS; i++) {
+                       if (neighbors == plots[i]) {
+                               local_neighbors = neighbors;
+                               break;
+                       }
+                       if (i == NEIGHBORKINDS - 1) {
+#if 1
+                               local_neighbors = plots[NRAND(NEIGHBORKINDS)];
+#else
+                               local_neighbors = 4;
+#endif
+                               break;
+                       }
+               }
+       }
+
+
+  if (local_neighbors == 6) {
+    int         nccols, ncrows;
+
+    if (lp->width < 4)
+      lp->width = 4;
+    if (lp->height < 4)
+      lp->height = 4;
+    if (size < -MINSIZE) {
+      lp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+              HEX_MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+    } else if (size < MINSIZE) {
+      if (!size)
+        lp->ys = MAX(MINSIZE, MIN(lp->width, lp->height) / HEX_MINGRIDSIZE);
+      else
+        lp->ys = MINSIZE;
+    } else
+      lp->ys = MIN(size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                 HEX_MINGRIDSIZE));
+    lp->xs = lp->ys;
+    nccols = MAX(lp->width / lp->xs - 2, HEX_MINGRIDSIZE);
+    ncrows = MAX(lp->height / lp->ys - 1, HEX_MINGRIDSIZE);
+    lp->ncols = nccols / 2;
+    lp->nrows = ncrows / 2;
+    lp->nrows -= !(lp->nrows & 1);  /* Must be odd */
+    lp->xb = (lp->width - lp->xs * nccols) / 2 + lp->xs;
+    lp->yb = (lp->height - lp->ys * ncrows) / 2 + lp->ys;
+    for (i = 0; i < 6; i++) {
+      lp->shape.hexagon[i].x = (lp->xs - 1) * hexagonUnit[i].x;
+      lp->shape.hexagon[i].y = ((lp->ys - 1) * hexagonUnit[i].y / 2) * 4 / 3;
+    }
+  } else {
+               if (size < -MINSIZE)
+                       lp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                             MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               lp->ys = MAX(MINSIZE, MIN(lp->width, lp->height) / MINGRIDSIZE);
+                       else
+                               lp->ys = MINSIZE;
+               } else
+                       lp->ys = MIN(size, MAX(MINSIZE, MIN(lp->width, lp->height) /
+                                              MINGRIDSIZE));
+               lp->xs = lp->ys;
+               lp->ncols = MAX(lp->width / lp->xs, ADAM_LOOPX + 1);
+               lp->nrows = MAX(lp->height / lp->ys, ADAM_LOOPX + 1);
+               lp->xb = (lp->width - lp->xs * lp->ncols) / 2;
+               lp->yb = (lp->height - lp->ys * lp->nrows) / 2;
+       }
+       lp->bx = 1;
+       lp->by = 1;
+       lp->bncols = lp->ncols + 2 * lp->bx;
+       lp->bnrows = lp->nrows + 2 * lp->by;
+
+       MI_CLEARWINDOW(mi);
+
+       if (lp->oldcells != NULL) {
+               (void) free((void *) lp->oldcells);
+               lp->oldcells = NULL;
+       }
+       if ((lp->oldcells = (unsigned char *) calloc(lp->bncols * lp->bnrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_loop(display, lp);
+               return;
+       }
+       if (lp->newcells != NULL) {
+               (void) free((void *) lp->newcells);
+               lp->newcells = NULL;
+       }
+       if ((lp->newcells = (unsigned char *) calloc(lp->bncols * lp->bnrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_loop(display, lp);
+               return;
+       }
+       if (!init_table()) {
+               release_loop(mi);
+               return;
+       }
+       lp->mincol = lp->bncols - 1;
+       lp->minrow = lp->bnrows - 1;
+       lp->maxcol = 0; 
+       lp->maxrow = 0;
+#ifndef DELAYDEBUGLOOP
+       {
+               int flaws = MI_COUNT(mi);
+
+               if (flaws < 0)
+                       flaws = NRAND(-MI_COUNT(mi) + 1);
+               for (i = 0; i < flaws; i++) {
+                       init_flaw(mi);
+               }
+               /* actual flaws might be less since the adam loop done next */
+       }
+#endif
+       init_adam(mi);
+}
+
+void
+draw_loop(ModeInfo * mi)
+{
+       int         offset, i, j;
+       unsigned char *z, *znew;
+       loopstruct *lp;
+
+       if (loops == NULL)
+               return;
+       lp = &loops[MI_SCREEN(mi)];
+       if (lp->newcells == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       lp->dead = True;
+#ifdef DELAYDEBUGLOOP
+       if (MI_COUNT(mi) && lp->generation > MI_COUNT(mi)) {
+               (void) sleep(DELAYDEBUGLOOP);
+       }
+#endif
+
+       for (j = lp->minrow; j <= lp->maxrow; j++) {
+               for (i = lp->mincol; i <= lp->maxcol; i++) {
+                       offset = j * lp->bncols + i;
+                       z = lp->oldcells + offset;
+                       znew = lp->newcells + offset;
+                       if (*z != *znew) {
+                               lp->dead = False;
+                               *z = *znew;
+                               if (!addtolist(mi, i - lp->bx, j - lp->by, *znew))
+                                       return;
+                               if (i == lp->mincol && i > lp->bx)
+                                       lp->mincol--;
+                               if (j == lp->minrow && j > lp->by)
+                                       lp->minrow--;
+                               if (i == lp->maxcol && i < lp->bncols - 2 * lp->bx)
+                                       lp->maxcol++;
+                               if (j == lp->maxrow && j < lp->bnrows - 2 * lp->by)
+                                       lp->maxrow++;
+                       }
+               }
+       }
+       for (i = 0; i < COLORS; i++)
+               if (!draw_state(mi, i)) {
+                       free_loop(MI_DISPLAY(mi), lp);
+                       return;
+               }
+       if (++lp->generation > MI_CYCLES(mi) || lp->dead) {
+               init_loop(mi);
+               return;
+       } else
+               do_gen(lp);
+
+       if (lp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       if ((*(lp->oldcells + lp->redrawpos))) {
+                               drawcell(mi, lp->redrawpos % lp->bncols - lp->bx,
+                                        lp->redrawpos / lp->bncols - lp->by,
+                                        *(lp->oldcells + lp->redrawpos));
+                       }
+                       if (++(lp->redrawpos) >= lp->bncols * (lp->bnrows - lp->bx)) {
+                               lp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
+refresh_loop(ModeInfo * mi)
+{
+       loopstruct *lp;
+
+       if (loops == NULL)
+               return;
+       lp = &loops[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       lp->redrawing = 1;
+       lp->redrawpos = lp->by * lp->ncols + lp->bx;
+}
+
+#endif /* MODE_loop */
diff --git a/modes/lyapunov.c b/modes/lyapunov.c
new file mode 100644 (file)
index 0000000..8c3250a
--- /dev/null
@@ -0,0 +1,438 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* lyapunov --- animated lyapunov space */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)lyapunov.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Pictures discovered by Mario Markus and Benno Hess while trying to
+ * simulate how enzymes break down carbohydrates.  By adjusting a pair of
+ * parameter's they found they could make the simulated enzymes behave in
+ * either a orderly or chaotic manner.  Images are based on a formula
+ * named after the Russian mathematician Aleksandr M. Lyapunov.
+ * See  A.K. Dewdney's "Computer Recreations", Scientific American
+ * Magazine" Sep 1991 for more info.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 17-Dec-1998: Used mandelbrot.c as basis
+ */
+
+
+#ifdef STANDALONE
+#define PROGCLASS "Lyapunov"
+#define HACK_INIT init_lyapunov
+#define HACK_DRAW draw_lyapunov
+#define lyapunov_opts xlockmore_opts
+#define DEFAULTS "*delay: 25000 \n" \
+ "*count: 600 \n" \
+ "*cycles: 20000 \n" \
+ "*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#define WRITABLE_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#include <X11/Xutil.h>
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#include "color.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_lyapunov
+
+#define MINPOWER 2
+#define DEF_INCREMENT  "1.00"
+/* 4.0 is best for seeing if a point is inside the set, 13 is better if
+** you want to get a pretty corona
+*/
+
+#define FLOATRAND(min,max) ((min)+((double) LRAND()/((double) MAXRAND))*((max)-(min)))
+
+ModeSpecOpt lyapunov_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   lyapunov_description =
+{"lyapunov", "init_lyapunov", "draw_lyapunov", "release_lyapunov",
+ NULL, "init_lyapunov", NULL, &lyapunov_opts,
+ 25000, 600, 20000, 1, 64, 1.0, "",
+ "Shows lyapunov space", 0, NULL};
+
+#endif
+
+#define ROUND_FLOAT(x,a) ((float) ((int) ((x) / (a) + 0.5)) * (a))
+#define MAXPOWER 14 /* (32 - 2) for 32 bit unsigned long */
+
+#ifdef DEBUG
+static int debug;
+#endif
+
+typedef struct {
+       int         column;
+       Bool        backwards, reverse;
+       XColor      fgcol, bgcol;       /* foreground and background colour specs */
+       Bool        fixed_colormap;
+       int         ncolors;
+       XColor      top;
+       XColor      bottom;
+       XColor     *colors;
+       Colormap    cmap;
+       int         usable_colors;
+       unsigned int cur_color;
+       int         screen_width;
+       int         screen_height;
+       float       reptop;
+       unsigned long periodic_forcing;
+       int firstone;
+} lyapstruct;
+
+static lyapstruct *lyaps = NULL;
+#define OFFSET 3.0  /* Slight changes here may have unexpected results! */
+
+static double
+reps(unsigned long periodic_forcing, int firstone, int iter, double a, double b)
+{
+       int         forcing_index = firstone, n;
+       double      x = 0.5, total = 0.0, gamma;
+
+       a += OFFSET, b += OFFSET;
+       for (n = 1; n <= iter; n++) {
+               gamma = (periodic_forcing & (1 << forcing_index)) ? b : a;
+               if (forcing_index == 0)
+                       forcing_index = firstone;
+               else
+                       forcing_index--;
+               x = gamma * x * (1.0 - x);
+               /* Sci. Am. article says this should be a lookup table */
+               total += (log(ABS(gamma * (1.0 - 2.0 * x))) / M_LN2);
+#ifdef DEBUG
+               if (debug)
+                       /* if (!(n % 1000)) */
+                       (void) printf("gamma %g, a %g,  b %g, result %g, n %d, total %g, x %g, index %d\n",
+                        gamma, a, b, total / n, n, total, x, forcing_index);
+#endif
+       }
+       return (total / ((double) iter));
+}
+
+static void
+free_lyapunov(Display *display, lyapstruct *lp)
+{
+       if (lp->cmap != None) {
+               XFreeColormap(display, lp->cmap);
+               lp->cmap = None;
+       }
+       if (lp->colors != NULL) {
+               XFree((caddr_t) lp->colors);
+               lp->colors = NULL;
+       }
+}
+
+void
+init_lyapunov(ModeInfo * mi)
+{
+       int         preserve;
+       Bool        truecolor;
+       unsigned long redmask, greenmask, bluemask;
+       Window      window = MI_WINDOW(mi);
+       Display    *display = MI_DISPLAY(mi);
+       int i = NRAND(MAXPOWER);
+       unsigned long power2;
+       lyapstruct *lp;
+
+       if (lyaps == NULL) {
+               if ((lyaps = (lyapstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (lyapstruct))) == NULL)
+                       return;
+       }
+       lp = &lyaps[MI_SCREEN(mi)];
+
+#ifdef DEBUG
+       debug = MI_IS_DEBUG(mi);
+#endif
+       lp->screen_width = MI_WIDTH(mi);
+       lp->screen_height = MI_HEIGHT(mi);
+       lp->reverse = (Bool) (LRAND() & 1);
+       lp->backwards = (Bool) (LRAND() & 1);
+       if (lp->backwards)
+               lp->column = lp->screen_width - 1;
+       else
+               lp->column = 0;
+
+       MI_CLEARWINDOW(mi);
+
+       lp->reptop = 0.6;
+
+       /* To force a number, say <i = 2;> has  i + 2 (or 4) binary digits */
+  power2 = 1 << (i + 1);
+  /* Do not want numbers which in binary are all 1's. */
+  lp->periodic_forcing = NRAND(power2 - 1) + power2;
+       lp->firstone = 1;
+       for (i = 32 - 2; i >= 1; i--)
+               if (lp->periodic_forcing & (1 << i)) {
+                       lp->firstone = i;
+                       break;
+               }
+
+  if (MI_IS_VERBOSE(mi)) {
+               (void) printf("0x%lx forcing number", lp->periodic_forcing);
+               switch (lp->periodic_forcing) {
+                       case 0x2:
+                               (void) printf(", swallow\n");
+                               break;
+      case 0x34:
+                               (void) printf(", jellyfish\n");
+                               break;
+                       case 0xFC0: /* Yeah, I think it should be "city" too, but its not. */
+                               (void) printf(", zircon zity\n");
+                               break;
+                       default:
+                               (void) printf("\n");
+                               break;
+               }
+       }
+
+#ifndef STANDALONE
+       lp->fixed_colormap = !setupColormap(mi,
+               &(lp->ncolors), &truecolor, &redmask, &greenmask, &bluemask);
+       if (!lp->fixed_colormap) {
+               preserve = preserveColors(MI_BLACK_PIXEL(mi), MI_WHITE_PIXEL(mi),
+                                         MI_BG_PIXEL(mi), MI_FG_PIXEL(mi));
+               lp->bgcol.pixel = MI_BG_PIXEL(mi);
+               lp->fgcol.pixel = MI_FG_PIXEL(mi);
+               XQueryColor(display, MI_COLORMAP(mi), &(lp->bgcol));
+               XQueryColor(display, MI_COLORMAP(mi), &(lp->fgcol));
+
+#define RANGE 65536
+#define DENOM 4
+               /* color in the bottom part */
+               lp->bottom.red = NRAND(RANGE / DENOM);
+               lp->bottom.blue = NRAND(RANGE / DENOM);
+               lp->bottom.green = NRAND(RANGE / DENOM);
+               /* color in the top part */
+               lp->top.red = RANGE - NRAND(((DENOM-1)*RANGE) / DENOM);
+               lp->top.blue = RANGE - NRAND(((DENOM-1)*RANGE) / DENOM);
+               lp->top.green = RANGE - NRAND(((DENOM-1)*RANGE) / DENOM);
+
+               /* allocate colormap, if needed */
+               if (lp->colors == NULL)
+                       if ((lp->colors = (XColor *) malloc(sizeof (XColor) *
+                                       lp->ncolors)) == NULL) {
+                               free_lyapunov(display, lp);
+                               return;
+                       }
+               if (lp->cmap == None)
+                       if ((lp->cmap = XCreateColormap(display, window,
+                                       MI_VISUAL(mi), AllocAll)) == None) {
+                               free_lyapunov(display, lp);
+                               return;
+                       }
+               lp->usable_colors = lp->ncolors - preserve;
+       }
+
+#endif /* !STANDALONE */
+}
+
+#if !defined(OLD_COLOR)
+static unsigned short
+pick_rgb(unsigned short bottom,unsigned short top,
+       int color_ind,int ncolors)
+{
+       /* por == part of range */
+       double por;
+
+       if (color_ind<ncolors/2) {
+               /* going up */
+               por = ((float)color_ind*2) / ncolors;
+       } else {
+               /* going down */
+               por = ((float)(color_ind-ncolors/2)*2) / ncolors;
+       }
+       return ((unsigned short) (bottom + (top - bottom)*por));
+}
+#endif
+
+void
+draw_lyapunov(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         h, j;
+       unsigned int i;
+       lyapstruct *lp;
+
+       if (lyaps == NULL)
+               return;
+       lp = &lyaps[MI_SCREEN(mi)];
+       if (!lp->fixed_colormap && lp->colors == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+#ifndef STANDALONE
+       if (lp->column % 15 == 0) {
+               /* advance "drawing" color */
+               lp->cur_color = (lp->cur_color + 1) % lp->ncolors;
+               if (!lp->fixed_colormap && lp->usable_colors > 2) {
+                       while (lp->cur_color == MI_WHITE_PIXEL(mi) ||
+                              lp->cur_color == MI_BLACK_PIXEL(mi) ||
+                              lp->cur_color == MI_BG_PIXEL(mi) ||
+                              lp->cur_color == MI_FG_PIXEL(mi)) {
+                               lp->cur_color = (lp->cur_color + 1) % lp->ncolors;
+                       }
+               }
+               /* advance colormap */
+               if (!lp->fixed_colormap && lp->usable_colors > 2) {
+                       for (i = 0, j = lp->cur_color;
+                            i < (unsigned int) lp->ncolors; i++) {
+                               if (i == MI_WHITE_PIXEL(mi)) {
+                                       lp->colors[i].pixel = i;
+                                       lp->colors[i].red = 65535;
+                                       lp->colors[i].blue = 65535;
+                                       lp->colors[i].green = 65535;
+                                       lp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                               } else if (i == MI_BLACK_PIXEL(mi)) {
+                                       lp->colors[i].pixel = i;
+                                       lp->colors[i].red = 0;
+                                       lp->colors[i].blue = 0;
+                                       lp->colors[i].green = 0;
+                                       lp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                               } else if (i == MI_BG_PIXEL(mi)) {
+                                       lp->colors[i] = lp->bgcol;
+                               } else if (i == MI_FG_PIXEL(mi)) {
+                                       lp->colors[i] = lp->fgcol;
+                               } else {
+#if defined(OLD_COLOR)
+                                       /* this is known to work well enough. I just wanted
+                                       ** to explore some other possibilities
+                                       */
+                                       double      range;
+                                       lp->colors[i].pixel = i;
+                                       range = ((double) (lp->top.red - lp->bottom.red)) /
+                                               lp->ncolors;
+                                       lp->colors[i].red = (short unsigned int) (range * j +
+                                                            lp->bottom.red);
+                                       range = ((double) (lp->top.green - lp->bottom.green)) /
+                                               lp->ncolors;
+                                       lp->colors[i].green = (short unsigned int) (range * j +
+                                                          lp->bottom.green);
+                                       range = ((double) (lp->top.blue - lp->bottom.blue)) /
+                                               lp->ncolors;
+                                       lp->colors[i].blue = (short unsigned int) (range * j +
+                                                           lp->bottom.blue);
+                                       lp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                                       if (lp->reverse)
+                                               j = (j + 1) % lp->ncolors;
+                                       else
+                                               j = (j - 1 + lp->ncolors) % lp->ncolors;
+#else
+                                       lp->colors[i].pixel = i;
+                                       lp->colors[i].red = pick_rgb(lp->bottom.red,lp->top.red,
+                                               j,lp->ncolors);
+                                       lp->colors[i].green = pick_rgb(lp->bottom.green,lp->top.green,
+                                               j,lp->ncolors);
+                                       lp->colors[i].blue = pick_rgb(lp->bottom.blue,lp->top.blue,
+                                               j,lp->ncolors);
+                                       lp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                                       if (lp->reverse)
+                                               j = (j + 1) % lp->ncolors;
+                                       else
+                                               j = (j - 1 + lp->ncolors) % lp->ncolors;
+#endif
+                               }
+                       }
+                       /* make the entire lyapunov move forward */
+                       XStoreColors(display, lp->cmap, lp->colors, lp->ncolors);
+                       setColormap(display, window, lp->cmap, MI_IS_INWINDOW(mi));
+               }
+       }
+#endif /* !STANDALONE */
+       /* so we iterate columns beyond the width of the physical screen,
+        ** so that we just wait around and show what we've done
+       */
+       if ((!lp->backwards && (lp->column >= 4 * lp->screen_width)) ||
+           (lp->backwards && (lp->column < -3 * lp->screen_width))) {
+               /* reset to left edge of screen */
+               init_lyapunov(mi);
+               return;
+               /* select a new region! */
+       } else if (lp->column >= lp->screen_width || lp->column < 0) {
+               /* delay a while */
+               if (lp->backwards)
+                       lp->column--;
+               else
+                       lp->column++;
+               return;
+       }
+       for (h = 0; h < lp->screen_height; h++) {
+               unsigned int color;
+               double  result;
+
+#define MULT 1.0
+               result = reps(lp->periodic_forcing, lp->firstone, MI_COUNT(mi),
+                       ((double) lp->column) / (MULT * lp->screen_width),
+                       ((double) h) / (MULT * lp->screen_height));
+#ifdef DEBUG
+               if (debug)
+               (void) printf("a %g, b %g, result %g\n",
+                        ((double) lp->column) / lp->screen_width,
+                        ((double) h) / lp->screen_height, result);
+#endif
+               if (result > 0.0)
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               else {
+                       color=(unsigned int) ((MI_NPIXELS(mi) * (float)-result) / lp->reptop);
+                       color = color % MI_NPIXELS(mi);
+#ifndef STANDALONE
+                       if (!lp->fixed_colormap && lp->usable_colors > 2) {
+                               while (color == MI_WHITE_PIXEL(mi) ||
+                                      color == MI_BLACK_PIXEL(mi) ||
+                                      color == MI_BG_PIXEL(mi) ||
+                                      color == MI_FG_PIXEL(mi)) {
+                                       color = (color + 1) % lp->ncolors;
+                               }
+                               XSetForeground(display, gc, color);
+                       } else
+                               XSetForeground(display, gc, MI_PIXEL(mi, color));
+#endif /* !STANDALONE */
+               }
+               /* we no longer have vertical symmetry - so we compute all points
+               ** and do not draw with redundancy
+               */
+               XDrawPoint(display, window, gc, lp->column, h);
+       }
+       if (lp->backwards)
+               lp->column--;
+       else
+               lp->column++;
+}
+
+void
+release_lyapunov(ModeInfo * mi)
+{
+       if (lyaps != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_lyapunov(MI_DISPLAY(mi), &lyaps[screen]);
+               (void) free((void *) lyaps);
+               lyaps = NULL;
+       }
+}
+
+#endif /* MODE_lyapunov */
diff --git a/modes/mandelbrot.c b/modes/mandelbrot.c
new file mode 100644 (file)
index 0000000..25c187b
--- /dev/null
@@ -0,0 +1,670 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* mandelbrot --- animated mandelbrot sets */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)mandelbrot.c 5.00 2000/11/01 xlockmore";
+
+#endif
+
+#define USE_LOG
+
+/*-
+ * Copyright (c) 1997 Dan Stromberg <strombrg@nis.acs.uci.edu>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * See  A.K. Dewdney's "Computer Recreations", Scientific American
+ * Magazine" Aug 1985 for more info.  Also A.K. Dewdney's "Computer
+ * Recreations", Scientific American Magazine" Jul 1989, has some neat
+ * extensions besides z^n + c (n small but >= 2) some of these are:
+ *   z^z + z^n + c
+ *   sin(z) + e^z + c
+ *   sin(z) + z^n + c
+ * These were first explored by a colleague of Mandelbrot, Clifford A.
+ * Pickover.  These would make nice additions to add.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 24-Mar-1999: DEM and Binary decomp options added by Tim Auckland
+ *              <Tim.Auckland@Procket.com>.  Ideas from Peitgen & Saupe's
+ *              "The Science of Fractal Images"
+ * 17-Nov-1998: Many Changes by Stromberg, including selection of
+ *              interesting subregions, more extreme color ranges,
+ *              reduction of possible powers to smaller/more interesting
+ *              range, elimination of some unused code, slower color cycling,
+ *              longer period of color cycling after the drawing is complete.
+ *              Hopefully the longer color cycling period will make the mode
+ *              reasonable even after CPUs are so fast that the drawing
+ *              interval goes by quickly
+ * 20-Oct-1997: Written by Dan Stromberg <strombrg@nis.acs.uci.edu>
+ */
+
+
+#ifdef STANDALONE
+#define PROGCLASS "Mandelbrot"
+#define HACK_INIT init_mandelbrot
+#define HACK_DRAW draw_mandelbrot
+#define mandelbrot_opts xlockmore_opts
+#define DEFAULTS "*delay: 25000 \n" \
+ "*count: -8 \n" \
+ "*cycles: 20000 \n" \
+ "*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#define WRITABLE_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#include <X11/Xutil.h>
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#include "color.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_mandelbrot
+
+#define MINPOWER 2
+#define DEF_INCREMENT  "1.00"
+#define DEF_BINARY     "False"
+#define DEF_DEM        "False"
+/* 4.0 is best for seeing if a point is inside the set, 13 is better if
+** you want to get a pretty corona
+*/
+#define ESCAPE 13.0
+#define FLOATRAND(min,max) ((min)+((double) LRAND()/((double) MAXRAND))*((max)-(min)))
+
+       /* incr also would be nice as a parameter.  It controls how fast
+          the order is advanced.  Non-integral values are not true orders,
+          but it's a somewhat interesting function anyway
+        */
+static float increment;
+static Bool  binary;
+static Bool  dem;
+
+static XrmOptionDescRec opts[] =
+{
+     {(char *) "-increment", (char *) ".mandelbrot.increment", XrmoptionSepArg, (caddr_t) NULL},
+     {(char *) "-binary", (char *) ".mandelbrot.binary", XrmoptionNoArg, (caddr_t) "on"},
+     {(char *) "+binary", (char *) ".mandelbrot.binary", XrmoptionNoArg, (caddr_t) "off"},
+     {(char *) "-dem", (char *) ".mandelbrot.dem", XrmoptionNoArg, (caddr_t) "on"},
+     {(char *) "+dem", (char *) ".mandelbrot.dem", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+ {(caddr_t *) & increment, (char *) "increment", (char *) "Increment", (char *) DEF_INCREMENT, t_Float},
+ {(caddr_t *) & binary, (char *) "binary", (char *) "Binary", (char *) DEF_BINARY, t_Bool},
+ {(caddr_t *) & dem, (char *) "dem", (char *) "Dem", (char *) DEF_DEM, t_Bool},
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-increment value", (char *) "increasing orders"},
+       {(char *) "-/+binary", (char *) "turn on/off Binary Decomposition colour modulation"},
+       {(char *) "-/+dem", (char *) "turn on/off Distance Estimator Method (instead of escape time)"}
+};
+
+ModeSpecOpt mandelbrot_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   mandelbrot_description =
+{"mandelbrot", "init_mandelbrot", "draw_mandelbrot", "release_mandelbrot",
+ NULL, "init_mandelbrot", NULL, &mandelbrot_opts,
+ 25000, -8, 20000, 1, 64, 1.0, "",
+ "Shows mandelbrot sets", 0, NULL};
+
+#endif
+
+#define ROUND_FLOAT(x,a) ((float) ((int) ((x) / (a) + 0.5)) * (a))
+
+typedef struct {
+       double      real, imag;
+} complex;
+
+static void
+add(complex * a, complex b)
+{
+       a->real = a->real + b.real;
+       a->imag = a->imag + b.imag;
+}
+
+static void
+mult(complex * a, complex b)
+{
+       double      tr, ti;
+
+       /* a.real*b.real + i*a.real*b.imag + i*a.imag*b.real + i^2*a.imag*b.imag */
+       tr = a->real * b.real - a->imag * b.imag;
+       ti = a->real * b.imag + a->imag * b.real;
+       a->real = tr;
+       a->imag = ti;
+}
+
+/* Plans for future additions?  a, z complex; x, y real
+   sin(z) = (e^(i * z) - e^(-i * z)) / (2 * i)
+   cos(z) = (e^(i * z) - e^(-i * z)) / 2
+   a^z = e^(z * ln(a))
+   e^z = e^x * (cos(y) + i * sin(y))
+   ln(z) = ln ((x^2 + y^2)^(1/2)) + i * invtan(y/x)
+ */
+
+/* this is a true power function. */
+static void
+ipow(complex * a, int n)
+{
+
+
+       switch (n) {
+               case 1:
+                       return;
+               case 2:
+                       mult(a, *a);
+                       return;
+               default:
+                       {
+                               complex     a2;
+                               int         t2;
+
+                               a2 = *a;        /* Not very efficient to use:  mult(a, ipow(&a2, n-1)); */
+                               t2 = n / 2;
+                               ipow(&a2, t2);
+                               mult(&a2, a2);
+                               if (t2 * 2 != n)        /* if n is odd */
+                                       mult(&a2, *a);
+                               *a = a2;
+                       }
+       }
+}
+
+typedef struct {
+       int         counter;
+       double      power;
+       int         column;
+       Bool        backwards, reverse;
+       XColor      fgcol, bgcol;       /* foreground and background colour specs */
+       Bool        fixed_colormap;
+       int         ncolors;
+       XColor      top;
+       XColor      bottom;
+       XColor     *colors;
+       Colormap    cmap;
+       int         usable_colors;
+       unsigned int cur_color;
+       complex     extreme_ul;
+       complex     extreme_lr;
+       complex     ul;
+       complex     lr;
+       int         screen_width;
+       int         screen_height;
+       int         reptop;
+       Bool        dem;
+       Bool        binary;
+} mandelstruct;
+
+static mandelstruct *mandels = NULL;
+
+/* do the iterations
+ * if binary is true, check halfplane of last iteration.
+ * if demrange is non zero, estimate lower bound of dist(c, M)
+ * Loosely based on  Peitgen & Saupe's "The Science of Fractal Images"
+ */
+static int
+reps(complex c, double p, int r, Bool binary, double demrange)
+{
+       int         rep;
+       int         escaped = 0;
+       complex     t;
+       int escape = (int) ((demrange == 0) ? ESCAPE :
+               ESCAPE*ESCAPE*ESCAPE*ESCAPE); /* 2 more iterations */
+       complex     t1;
+       complex     dt;
+
+       t = c;
+       dt.real = 1; dt.imag = 0;
+       for (rep = 0; rep < r; rep++) {
+           t1 = t;
+               ipow(&t, (int) p);
+               add(&t, c);
+               if (t.real * t.real + t.imag * t.imag >= escape) {
+                       escaped = 1;
+                       break;
+               }
+               if (demrange){
+                       /* compute dt/dc
+                        *               p-1
+                        * dt    =  p * t  * dt + 1
+                        *   k+1         k     k
+                        */
+                       dt.real *= p; dt.imag *= p;
+                       if(p > 2) ipow(&t1, (int) (p - 1));
+                       mult(&dt, t1);
+                       dt.real += 1;
+                       if (dt.real * dt.real + dt.imag * dt.imag >= 1e300) {
+                               escaped = 2;
+                               break;
+                       }
+               }
+       }
+       if (escaped) {
+               if(demrange) {
+                       double mt = sqrt(t1.real * t1.real + t1.imag * t1.imag);
+                        /* distance estimate */
+                       double dist = 0.5 * mt * log(mt) /
+                               sqrt(dt.real * dt.real + dt.imag * dt.imag);
+                       rep = (int) (1 + 10*r*dist/demrange); /* scale for viewing */
+                       if(rep > r-1) rep = r-1; /* chop into color range */
+               } else {
+                       if(binary && t.imag > 0)
+                               rep = (r + rep / 2) % r; /* binary decomp */
+               }
+               return rep;
+       } else
+               return r;
+}
+
+static void
+Select(/* input variables first */
+  complex *extreme_ul, complex *extreme_lr,
+  int width, int height, int power, int top,
+  /* output variables follow */
+  complex *selected_ul,complex *selected_lr)
+{
+       double precision;
+       double s2;
+       int inside;
+       int uninteresting;
+       int found;
+       int tries;
+       found = 0;
+       while (!found) {
+               /* select a precision - be careful with this */
+               precision = pow(2.0,FLOATRAND(-9.0,-18.0));
+               /* (void) printf("precision is %f\n",precision); */
+               for (tries=0;tries<10000&&!found;tries++) {
+                       /* it eventually turned out that this inner loop doesn't always
+                       ** terminate - so we just try 10000 times, and if we don't get
+                       ** anything interesting, we pick a new precision
+                       */
+                       complex temp;
+                       int sample_step = 4;
+                       int row,column;
+                       inside = 0;
+                       uninteresting = 0;
+                       /* pick a random point in the allowable range */
+                       temp.real = FLOATRAND(extreme_ul->real,extreme_lr->real);
+                       temp.imag = FLOATRAND(extreme_ul->imag,extreme_lr->imag);
+                       /* find upper left and lower right points */
+                       selected_ul->real = temp.real - precision * width / 2;
+                       selected_lr->real = temp.real + precision * width / 2;
+                       selected_ul->imag = temp.imag - precision * height / 2;
+                       selected_lr->imag = temp.imag + precision * height / 2;
+                       /* sample the results we'd get from this choice, accept or reject
+                       ** accordingly
+                       */
+                       for (row=0; row<sample_step; row++) {
+                               for (column=0; column<sample_step; column++) {
+                                       int r;
+                                       temp.imag = selected_ul->imag +
+                                               (selected_ul->imag - selected_lr->imag) *
+                                               (((double)row)/sample_step);
+                                       temp.real = selected_ul->real +
+                                               (selected_ul->real - selected_lr->real) *
+                                               (((double)column)/sample_step);
+                                       r = reps(temp,(double) power,top,0,0.0);
+                                       /* Here, we just want to see if the point is in the set,
+                                       ** not if we can make something pretty
+                                       */
+                                       if (r == top) {
+                                               inside++;
+                                       }
+                                       if (r < 2) {
+                                               uninteresting++;
+                                       }
+                               }
+                       }
+                       s2 = sample_step*sample_step;
+                       /* more than 10 percent, but less than 60 percent inside the set */
+                       if (inside >= ceil(s2/10.0) && inside <= s2*6.0/10.0 &&
+                               uninteresting <= s2/10.0) {
+                               /* this one looks interesting */
+                               found = 1;
+                       }
+                       /* else
+                       *** this does not look like a real good combination, so back
+                       *** up to the top of the loop to try another possibility
+                        */
+               }
+       }
+}
+
+
+static void
+free_mandelbrot(Display *display, mandelstruct *mp)
+{
+       if (mp->cmap != None) {
+               XFreeColormap(display, mp->cmap);
+               mp->cmap = None;
+       }
+       if (mp->colors != NULL) {
+               XFree((caddr_t) mp->colors);
+               mp->colors = NULL;
+       }
+}
+
+void
+init_mandelbrot(ModeInfo * mi)
+{
+       int         preserve;
+       Bool        truecolor;
+       unsigned long redmask, greenmask, bluemask;
+       Window      window = MI_WINDOW(mi);
+       Display    *display = MI_DISPLAY(mi);
+       mandelstruct *mp;
+
+       if (mandels == NULL) {
+               if ((mandels = (mandelstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (mandelstruct))) == NULL)
+                       return;
+       }
+       mp = &mandels[MI_SCREEN(mi)];
+
+       mp->screen_width = MI_WIDTH(mi);
+       mp->screen_height = MI_HEIGHT(mi);
+       mp->reverse = (Bool) (LRAND() & 1);
+       mp->backwards = (Bool) (LRAND() & 1);
+       if (mp->backwards)
+               mp->column = mp->screen_width - 1;
+       else
+               mp->column = 0;
+       mp->power = NRAND(3) + MINPOWER;
+       mp->counter = 0;
+
+       MI_CLEARWINDOW(mi);
+
+       if (MI_IS_FULLRANDOM(mi)) {
+         switch(NRAND(3)){
+         case 0: mp->binary = 1; mp->dem = 0; break;
+         case 1: mp->binary = 0; mp->dem = 1; break;
+         default:mp->binary = 0; mp->dem = 0; break;
+         }
+       } else {
+         mp->binary = binary;
+         mp->dem = dem;
+       }
+
+       mp->reptop = 300;
+
+       /* these could be tuned a little closer, but the selection
+       ** process throws out the chaf anyway, it just takes slightly
+       ** longer
+       */
+       mp->extreme_ul.real = -3.0;
+       mp->extreme_ul.imag = -3.0;
+       mp->extreme_lr.real = 3.0;
+       mp->extreme_lr.imag = 3.0;
+
+#ifndef STANDALONE
+       mp->fixed_colormap = !setupColormap(mi,
+               &(mp->ncolors), &truecolor, &redmask, &greenmask, &bluemask);
+       if (!mp->fixed_colormap) {
+               preserve = preserveColors(MI_BLACK_PIXEL(mi), MI_WHITE_PIXEL(mi),
+                                         MI_BG_PIXEL(mi), MI_FG_PIXEL(mi));
+               mp->bgcol.pixel = MI_BG_PIXEL(mi);
+               mp->fgcol.pixel = MI_FG_PIXEL(mi);
+               XQueryColor(display, MI_COLORMAP(mi), &(mp->bgcol));
+               XQueryColor(display, MI_COLORMAP(mi), &(mp->fgcol));
+
+#define RANGE 65536
+#define DENOM 4
+               /* color in the bottom part */
+               mp->bottom.red = NRAND(RANGE / DENOM);
+               mp->bottom.blue = NRAND(RANGE / DENOM);
+               mp->bottom.green = NRAND(RANGE / DENOM);
+               /* color in the top part */
+               mp->top.red = RANGE - NRAND(((DENOM-1)*RANGE) / DENOM);
+               mp->top.blue = RANGE - NRAND(((DENOM-1)*RANGE) / DENOM);
+               mp->top.green = RANGE - NRAND(((DENOM-1)*RANGE) / DENOM);
+
+               /* allocate colormap, if needed */
+               if (mp->colors == NULL)
+                       if ((mp->colors = (XColor *) malloc(sizeof (XColor) *
+                                       mp->ncolors)) == NULL) {
+                               free_mandelbrot(display, mp);
+                               return;
+                       }
+               if (mp->cmap == None)
+                       if ((mp->cmap = XCreateColormap(display, window,
+                                          MI_VISUAL(mi), AllocAll)) == None) {
+                               free_mandelbrot(display, mp);
+                               return;
+                       }
+               mp->usable_colors = mp->ncolors - preserve;
+       }
+       Select(&mp->extreme_ul,&mp->extreme_lr,
+               mp->screen_width,mp->screen_height,
+               (int) mp->power,mp->reptop,
+               &mp->ul,&mp->lr);
+
+#endif /* !STANDALONE */
+}
+
+#if !defined(OLD_COLOR)
+static unsigned short
+pick_rgb(unsigned short bottom,unsigned short top,
+       int color_ind,int ncolors)
+{
+       /* por == part of range */
+       double por;
+       if (color_ind<ncolors/2) {
+               /* going up */
+               por = ((float)color_ind*2) / ncolors;
+       } else {
+               /* going down */
+               por = ((float)(color_ind-ncolors/2)*2) / ncolors;
+       }
+       return ((unsigned short) (bottom + (top - bottom)*por));
+}
+#endif
+
+void
+draw_mandelbrot(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         h;
+       complex     c;
+#if defined(USE_LOG)
+       double      log_top;
+#endif
+       double      demrange;
+       unsigned int i;
+       int         j;
+       mandelstruct *mp;
+
+       if (mandels == NULL)
+               return;
+       mp = &mandels[MI_SCREEN(mi)];
+       if (!mp->fixed_colormap && mp->colors == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+#if defined(USE_LOG)
+       log_top = log((float) mp->reptop);
+#endif
+#ifndef STANDALONE
+       if (mp->counter % 15 == 0) {
+               /* advance "drawing" color */
+               mp->cur_color = (mp->cur_color + 1) % mp->ncolors;
+               if (!mp->fixed_colormap && mp->usable_colors > 2) {
+                       while (mp->cur_color == MI_WHITE_PIXEL(mi) ||
+                              mp->cur_color == MI_BLACK_PIXEL(mi) ||
+                              mp->cur_color == MI_BG_PIXEL(mi) ||
+                              mp->cur_color == MI_FG_PIXEL(mi)) {
+                               mp->cur_color = (mp->cur_color + 1) % mp->ncolors;
+                       }
+               }
+               /* advance colormap */
+               if (!mp->fixed_colormap && mp->usable_colors > 2) {
+                       for (i = 0, j = mp->cur_color;
+                            i < (unsigned int) mp->ncolors; i++) {
+                               if (i == MI_WHITE_PIXEL(mi)) {
+                                       mp->colors[i].pixel = i;
+                                       mp->colors[i].red = 65535;
+                                       mp->colors[i].blue = 65535;
+                                       mp->colors[i].green = 65535;
+                                       mp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                               } else if (i == MI_BLACK_PIXEL(mi)) {
+                                       mp->colors[i].pixel = i;
+                                       mp->colors[i].red = 0;
+                                       mp->colors[i].blue = 0;
+                                       mp->colors[i].green = 0;
+                                       mp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                               } else if (i == MI_BG_PIXEL(mi)) {
+                                       mp->colors[i] = mp->bgcol;
+                               } else if (i == MI_FG_PIXEL(mi)) {
+                                       mp->colors[i] = mp->fgcol;
+                               } else {
+#if defined(OLD_COLOR)
+                                       /* this is known to work well enough. I just wanted
+                                       ** to explore some other possibilities
+                                       */
+                                       double      range;
+                                       mp->colors[i].pixel = i;
+                                       range = ((double) (mp->top.red - mp->bottom.red)) /
+                                               mp->ncolors;
+                                       mp->colors[i].red = (short unsigned int) (range * j +
+                                                            mp->bottom.red);
+                                       range = ((double) (mp->top.green - mp->bottom.green)) /
+                                               mp->ncolors;
+                                       mp->colors[i].green = (short unsigned int) (range * j +
+                                                          mp->bottom.green);
+                                       range = ((double) (mp->top.blue - mp->bottom.blue)) /
+                                               mp->ncolors;
+                                       mp->colors[i].blue = (short unsigned int) (range * j +
+                                                           mp->bottom.blue);
+                                       mp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                                       if (mp->reverse)
+                                               j = (j + 1) % mp->ncolors;
+                                       else
+                                               j = (j - 1 + mp->ncolors) % mp->ncolors;
+#else
+                                       mp->colors[i].pixel = i;
+                                       mp->colors[i].red = pick_rgb(mp->bottom.red,mp->top.red,
+                                               j,mp->ncolors);
+                                       mp->colors[i].green = pick_rgb(mp->bottom.green,mp->top.green,
+                                               j,mp->ncolors);
+                                       mp->colors[i].blue = pick_rgb(mp->bottom.blue,mp->top.blue,
+                                               j,mp->ncolors);
+                                       mp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                                       if (mp->reverse)
+                                               j = (j + 1) % mp->ncolors;
+                                       else
+                                               j = (j - 1 + mp->ncolors) % mp->ncolors;
+#endif
+                               }
+                       }
+                       /* make the entire mandelbrot move forward */
+                       XStoreColors(display, mp->cmap, mp->colors, mp->ncolors);
+                       setColormap(display, window, mp->cmap, MI_IS_INWINDOW(mi));
+               }
+       }
+#endif /* !STANDALONE */
+       /* so we iterate columns beyond the width of the physical screen, so that
+       ** we just wait around and show what we've done
+       */
+       if ((!mp->backwards && (mp->column >= 3 * mp->screen_width)) ||
+           (mp->backwards && (mp->column < -2 * mp->screen_width))) {
+               /* reset to left edge of screen, bump power */
+               mp->backwards = (Bool) (LRAND() & 1);
+               if (mp->backwards)
+                       mp->column = mp->screen_width - 1;
+               else
+                       mp->column = 0;
+               mp->power = NRAND(3) + MINPOWER;
+               /* select a new region! */
+               Select(&mp->extreme_ul,&mp->extreme_lr,
+                       mp->screen_width,mp->screen_height,
+                       (int) mp->power,mp->reptop,
+                       &mp->ul,&mp->lr);
+       } else if (mp->column >= mp->screen_width || mp->column < 0) {
+               /* delay a while */
+               if (mp->backwards)
+                       mp->column--;
+               else
+                       mp->column++;
+               mp->counter++;
+               return;
+       }
+       /* demrange is used to give some idea of scale */
+       demrange = mp->dem ? fabs(mp->ul.real - mp->lr.real) / 2 : 0;
+       for (h = 0; h < mp->screen_height; h++) {
+               unsigned int color;
+               int         result;
+
+               /* c.real = 1.3 - (double) mp->column / mp->screen_width * 3.4; */
+               /* c.imag = -1.6 + (double) h / mp->screen_height * 3.2; */
+               c.real = mp->ul.real +
+                       (mp->ul.real-mp->lr.real)*(((double)(mp->column))/mp->screen_width);
+               c.imag = mp->ul.imag +
+                       (mp->ul.imag - mp->lr.imag)*(((double) h) / mp->screen_height);
+               result = reps(c, mp->power, mp->reptop, mp->binary, demrange);
+               if (result == 0 || result == mp->reptop)
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               else {
+#if defined(USE_LOG)
+                       color=(unsigned int) (MI_NPIXELS(mi) * log((float) result) / log_top);
+#else
+                       color=(unsigned int) ((MI_NPIXELS(mi) * (float)result) / mp->reptop);
+#endif
+#ifndef STANDALONE
+                       if (!mp->fixed_colormap && mp->usable_colors > 2) {
+                               while (color == MI_WHITE_PIXEL(mi) ||
+                                      color == MI_BLACK_PIXEL(mi) ||
+                                      color == MI_BG_PIXEL(mi) ||
+                                      color == MI_FG_PIXEL(mi)) {
+                                       color = (color + 1) % mp->ncolors;
+                               }
+                               XSetForeground(display, gc, color);
+                       } else
+                               XSetForeground(display, gc, MI_PIXEL(mi, color));
+#endif /* !STANDALONE */
+               }
+               /* we no longer have vertical symmetry - so we compute all points
+               ** and don't draw with redundancy
+               */
+               XDrawPoint(display, window, gc, mp->column, h);
+       }
+       if (mp->backwards)
+               mp->column--;
+       else
+               mp->column++;
+
+       mp->counter++;
+       if (mp->counter > MI_CYCLES(mi)) {
+               init_mandelbrot(mi);
+       }
+}
+
+void
+release_mandelbrot(ModeInfo * mi)
+{
+       if (mandels != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_mandelbrot(MI_DISPLAY(mi), &mandels[screen]);
+               (void) free((void *) mandels);
+               mandels = NULL;
+       }
+}
+
+#endif /* MODE_mandelbrot */
diff --git a/modes/marquee.c b/modes/marquee.c
new file mode 100644 (file)
index 0000000..9655a98
--- /dev/null
@@ -0,0 +1,525 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* marquee --- types a text-file or a text ribbon */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)marquee.c    5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by Tobias Gloth and David Bagley
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 03-Nov-1995: Many changes (hopefully good ones) by David Bagley
+ * 01-Oct-1995: Written by Tobias Gloth
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Marquee"
+#define HACK_INIT init_marquee
+#define HACK_DRAW draw_marquee
+#define marquee_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*ncolors: 64 \n" \
+ "*font: \n" \
+ "*text: \n" \
+ "*filename: \n" \
+ "*fortunefile: \n" \
+ "*program: \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_marquee
+
+ModeSpecOpt marquee_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   marquee_description =
+{"marquee", "init_marquee", "draw_marquee", "release_marquee",
+ "init_marquee", "init_marquee", NULL, &marquee_opts,
+ 100000, 1, 1, 1, 64, 1.0, "",
+ "Shows messages", 0, NULL};
+
+#endif
+
+#define font_height(f) ((f==None)?8:f->ascent + f->descent)
+
+extern XFontStruct *getFont(Display * display);
+extern char *getWords(int screen, int screens);
+extern int  isRibbon(void);
+
+typedef struct {
+       int         ascent;
+       int         height;
+       int         win_height;
+       int         win_width;
+       int         x;
+       int         y;
+       int         t;
+       int         startx;
+       int         nonblanks;
+       int         color;
+       int         time;
+       GC          gc;
+       char       *words;
+       char        modwords[256];
+} marqueestruct;
+
+static marqueestruct *marquees = NULL;
+
+static XFontStruct *mode_font = None;
+static int  char_width[256];
+
+static int
+font_width(XFontStruct * font, char ch)
+{
+       int         dummy;
+       XCharStruct xcs;
+
+       (void) XTextExtents(font, &ch, 1, &dummy, &dummy, &dummy, &xcs);
+       return xcs.width;
+}
+
+/* returns 1 if c is a printable char, the test should work for most 8 * bit
+   charsets (e.g. latin1), if we would use isprint, we would * depend of
+   locale settings that are probably incorrect. */
+
+static int
+is_valid_char(char c)
+{
+       return (unsigned char) c >= ' ';
+}
+
+static int
+is_char_back_char(char *s)
+{
+       return is_valid_char(*s) && *(s + 1) == '\b' &&
+               *(s + 2) && is_valid_char(*(s + 2));
+}
+
+static int
+char_back_char_width(char *s)
+{
+       int         w1 = char_width[(int) (unsigned char) *s];
+       int         w2 = char_width[(int) (unsigned char) *(s + 2)];
+
+       return w2 < w1 ? w1 : w2;
+}
+
+
+/*-
+ * fix strings of the form abc^H^H^H123 to a^H1b^H2c^H3, since we only
+ * handle backspace for char, back, char correctly. We do this without
+ * duplicating the string, but I'm not sure if there are conditions
+ * when the string is actually const. (when it is def_message, no ^Hs
+ * are present, I'm not sure about resource strings)
+ */
+
+static char *
+fixup_back(char *s)
+{
+       char       *p, *p1, *p2;
+       char        tmp[1000];
+       char       *t;
+       char       *w;
+
+       /* first of all, check if we have to do anything */
+
+       if (!*s)
+               return s;
+
+       for (p = s + 1; *p; p++)
+               if (*p == '\b' && *(p + 1) == '\b')
+                       break;
+       if (!*p)
+               return s;
+
+       /* now search for runs of the form char*n, back*n, char. */
+
+       for (p = s; *p; p++) {
+               for (p1 = p; *p1 && is_valid_char(*p1); p1++);
+               if (*p1 == '\b') {
+                       for (p2 = p1; *p2 && *p2 == '\b'; p2++);
+
+                       /* do we have `enough' chars for the backspaces? */
+
+                       if (p2 - p1 > 1 && p1 - p >= p2 - p1) {
+                               if (p1 - p > p2 - p1) {
+                                       p = p1 - (p2 - p1);
+                               }
+                               /* the situation is as follows:
+                                  p points to the first char,
+                                  p1 to the first backspace (end first char run),
+                                  p2 to the first char in the 2nd run
+
+                                  Question: how to do that without tmp storage?
+                                */
+                               (void) strncpy(tmp, p, p1 - p);
+                               t = tmp;
+                               w = p;
+                               while (t - tmp < p1 - p && *p2) {
+                                       *w++ = *t++;
+                                       *w++ = '\b';
+                                       *w++ = *p2++;
+                               }
+                               p = p2;
+                       } else {
+                               p = p2;
+                       }
+               } else {
+                       /* we hit some other control char, just continue at this
+                          position */
+                       p = p1;
+               }
+       }
+       return s;
+}
+
+static int
+text_font_width(char *string)
+{
+       int         n = 0, x = 0, t = 0;
+
+       /* The following does not handle a tab or other weird junk */
+       while (*string != '\0') {
+               if (x > n)
+                       n = x;
+               switch (*string) {
+                       case '\v':
+                       case '\f':
+                       case '\n':
+                               x = 0;
+                               t = 0;
+                               break;
+                       case '\b':
+                               /* we handle only char, ^H, char smartly, if
+                                * we have something different, we use the
+                                * (probably wrong) assumption that we have
+                                * a monospaced font. */
+                               if (t) {
+                                       t--;
+                                       x -= char_width[' '];
+                               }
+                               break;
+                       case '\t':
+                               x += char_width[' '] * (8 - (t % 8));
+                               t = ((t + 8) / 8) * 8;
+                               break;
+                       case '\r':
+                               break;
+                       default:
+                               t++;
+                               /* handle char, ^H, char */
+                               if (is_char_back_char(string)) {
+                                       x += char_back_char_width(string);
+                                       string += 2;
+                               } else {
+                                       x += char_width[(int) (unsigned char) *string];
+                               }
+               }
+               string++;
+       }
+       return n;
+}
+
+static int
+text_height(char *string)
+{
+       int         n = 0;
+
+       while (*string != '\0') {
+               if ((*string == '\n') || (*string == '\f') || (*string == '\v'))
+                       n++;
+               string++;
+       }
+       return n;
+}
+
+static int
+add_blanks(marqueestruct * mp)
+{
+       if (mp->t < 251) {
+               mp->modwords[mp->t] = ' ';
+               mp->t++;
+               mp->modwords[mp->t] = ' ';
+               mp->t++;
+               mp->modwords[mp->t] = '\0';
+               (void) strcat(mp->modwords, "  ");
+       }
+       mp->x -= 2 * char_width[' '];
+       if (mp->x <= -char_width[(int) (unsigned char) mp->modwords[0]]) {
+               mp->x += char_width[(int) (unsigned char) mp->modwords[0]];
+               (void) memcpy(mp->modwords, &(mp->modwords[1]), mp->nonblanks);
+               mp->nonblanks--;
+       }
+       return (mp->nonblanks < 0);
+}
+
+static void
+add_letter(marqueestruct * mp, char letter)
+{
+       if (mp->t < 252) {
+               mp->modwords[mp->t] = letter;
+               mp->t++;
+               mp->modwords[mp->t] = '\0';
+               (void) strcat(mp->modwords, "  ");
+       }
+       mp->x -= char_width[(int) letter];
+       if (mp->x <= -char_width[(int) (unsigned char) mp->modwords[0]]) {
+               mp->x += char_width[(int) (unsigned char) mp->modwords[0]];
+               (void) memcpy(mp->modwords, &(mp->modwords[1]), mp->t);
+               mp->modwords[mp->t] = ' ';
+               mp->t--;
+       } else
+               mp->nonblanks = mp->t;
+}
+
+void
+init_marquee(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       marqueestruct *mp;
+       XGCValues   gcv;
+       int         i;
+
+       if (marquees == NULL) {
+               if ((marquees = (marqueestruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (marqueestruct))) == NULL)
+                       return;
+       }
+       mp = &marquees[MI_SCREEN(mi)];
+
+       mp->win_width = MI_WIDTH(mi);
+       mp->win_height = MI_HEIGHT(mi);
+       if (MI_NPIXELS(mi) > 2)
+               mp->color = NRAND(MI_NPIXELS(mi));
+       mp->time = 0;
+       mp->t = 0;
+       mp->nonblanks = 0;
+       mp->x = 0;
+
+       MI_CLEARWINDOW(mi);
+
+       if (mode_font == None)
+               mode_font = getFont(display);
+       if (mp->gc == NULL && mode_font != None) {
+               gcv.font = mode_font->fid;
+               XSetFont(display, MI_GC(mi), mode_font->fid);
+               gcv.graphics_exposures = False;
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((mp->gc = XCreateGC(display, MI_WINDOW(mi),
+                               GCForeground | GCBackground | GCGraphicsExposures | GCFont,
+                               &gcv)) == None) {
+                       return;
+               }
+               mp->ascent = mode_font->ascent;
+               mp->height = font_height(mode_font);
+               for (i = 0; i < 256; i++)
+                       if ((i >= (int) mode_font->min_char_or_byte2) &&
+                           (i <= (int) mode_font->max_char_or_byte2))
+                               char_width[i] = font_width(mode_font, (char) i);
+                       else
+                               char_width[i] = font_width(mode_font, (char) mode_font->default_char);
+       } else if (mode_font == None) {
+               for (i = 0; i < 256; i++)
+                       char_width[i] = 8;
+       }
+       mp->words = fixup_back(getWords(MI_SCREEN(mi), MI_NUM_SCREENS(mi)));
+       mp->y = 0;
+
+       if (isRibbon()) {
+               mp->x = mp->win_width;
+               if (mp->win_height > font_height(mode_font))
+                       mp->y += NRAND(mp->win_height - font_height(mode_font));
+               else if (mp->win_height < font_height(mode_font))
+                       mp->y -= NRAND(font_height(mode_font) - mp->win_height);
+       } else {
+               int         text_ht = text_height(mp->words);
+               int         text_font_wid = text_font_width(mp->words);
+
+               if (mp->win_height > text_ht * font_height(mode_font))
+                       mp->y = NRAND(mp->win_height - text_ht * font_height(mode_font));
+               if (mp->y < 0)
+                       mp->y = 0;
+               mp->x = 0;
+               if (mp->win_width > text_font_wid)
+                       mp->x += NRAND(mp->win_width - text_font_wid);
+               /* else if (mp->win_width < text_font_wid)
+                  mp->x -= NRAND(text_font_wid - mp->win_width); */
+               mp->startx = mp->x;
+       }
+}
+
+void
+draw_marquee(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       char       *space = (char *) "        ";
+       char       *ch;
+       marqueestruct *mp = &marquees[MI_SCREEN(mi)];
+
+       if (marquees == NULL)
+               return;
+       mp = &marquees[MI_SCREEN(mi)];
+       if (mp->gc == None && mode_font != None)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       ch = mp->words;
+       if (isRibbon()) {
+               ch = mp->words;
+               switch (*ch) {
+                       case '\0':
+                               if (add_blanks(mp)) {
+                                       init_marquee(mi);
+                                       return;
+                               }
+                               break;
+                       case '\b':
+                       case '\r':
+                       case '\n':
+                       case '\t':
+                       case '\v':
+                       case '\f':
+                               add_letter(mp, ' ');
+                               mp->words++;
+                               break;
+                       default:
+                               add_letter(mp, *ch);
+                               mp->words++;
+               }
+               if (MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, mp->gc, MI_PIXEL(mi, mp->color));
+                       if (++mp->color == MI_NPIXELS(mi))
+                               mp->color = 0;
+               } else
+                       XSetForeground(display, mp->gc, MI_WHITE_PIXEL(mi));
+               (void) XDrawImageString(display, MI_WINDOW(mi), mp->gc,
+                        mp->x, mp->y + mp->ascent, mp->modwords, mp->t + 2);
+       } else {
+               switch (*ch) {
+                       case '\0':
+                               if (++mp->time > 16)
+                                       init_marquee(mi);
+                               return;
+                       case '\b':
+                               if (mp->t) {
+                                       /* see note in text_font_width */
+                                       mp->t--;
+                                       mp->x -= char_width[' '];
+                               }
+                               break;
+                       case '\v':
+                       case '\f':
+                       case '\n':
+                               mp->x = mp->startx;
+                               mp->t = 0;
+                               mp->y += mp->height;
+                               if (mp->y + mp->height > mp->win_height) {
+                                       XCopyArea(display, window, window, mp->gc,
+                                                 0, mp->height, mp->win_width, mp->y - mp->height, 0, 0);
+                                       XSetForeground(display, mp->gc, MI_BLACK_PIXEL(mi));
+                                       mp->y -= mp->height;
+                                       XFillRectangle(display, window, mp->gc,
+                                       0, mp->y, mp->win_width, mp->height);
+                               }
+                               break;
+                       case '\t':
+                               (void) XDrawString(display, window, mp->gc, mp->x, mp->y + mp->ascent,
+                                                  space, 8 - (mp->t % 8));
+                               mp->x += char_width[' '] * (8 - (mp->t % 8));
+                               mp->t = ((mp->t + 8) / 8) * 8;
+                               break;
+                       case '\r':
+                               break;
+                       default:
+                               if (MI_NPIXELS(mi) > 2) {
+                                       XSetForeground(display, mp->gc, MI_PIXEL(mi, mp->color));
+                                       if (++mp->color == MI_NPIXELS(mi))
+                                               mp->color = 0;
+                               } else
+                                       XSetForeground(display, mp->gc, MI_WHITE_PIXEL(mi));
+                               if (is_char_back_char(ch)) {
+                                       int         xmid = mp->x + (char_back_char_width(ch) + 1) / 2;
+
+                                       (void) XDrawString(display, window, mp->gc,
+                                                          xmid - char_width[(int) (unsigned char) *ch] / 2,
+                                                 mp->y + mp->ascent, ch, 1);
+                                       (void) XDrawString(display, window, mp->gc,
+                                                          xmid - char_width[(int) (unsigned char) *(ch + 2)] / 2,
+                                             mp->y + mp->ascent, ch + 2, 1);
+                                       mp->x += char_back_char_width(ch);
+                                       mp->words += 2;
+                               } else {
+#ifdef USE_MB
+                                       int         mb = (*ch & 0x80) ? 2 : 1;
+
+                                       (void) XDrawString(display, window, mp->gc,
+                                         mp->x, mp->y + mp->ascent, ch, mb);
+                                       if (mb == 1)
+                                               mp->x += char_width[(int) (unsigned char) *ch];
+                                       else {
+                                               XRectangle  rect;
+
+                                               XmbTextExtents(fontset, ch, 2, NULL, &rect);
+                                               mp->x += rect.width;
+                                       }
+#else
+                                       (void) XDrawString(display, window, mp->gc,
+                                          mp->x, mp->y + mp->ascent, ch, 1);
+                                       mp->x += char_width[(int) (unsigned char) *ch];
+#endif
+                               }
+                               mp->t++;
+               }
+#ifdef USE_MB
+               mp->words += (*mp->words & 0x80) ? 2 : 1;
+#else
+               mp->words++;
+#endif
+       }
+}
+
+void
+release_marquee(ModeInfo * mi)
+{
+       if (marquees != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       marqueestruct *mp = &marquees[screen];
+
+                       if (mp->gc != None)
+                               XFreeGC(MI_DISPLAY(mi), mp->gc);
+               }
+               (void) free((void *) marquees);
+               marquees = NULL;
+       }
+       if (mode_font != None) {
+               XFreeFont(MI_DISPLAY(mi), mode_font);
+               mode_font = None;
+       }
+}
+
+#endif /* MODE_marquee */
diff --git a/modes/matrix.c b/modes/matrix.c
new file mode 100644 (file)
index 0000000..5dbcc91
--- /dev/null
@@ -0,0 +1,768 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* matrix --- screensaver inspired by the 1999 sci-fi flick "The Matrix" */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)matrix.c     5.00 2000/11/01 xlockmore";
+#endif
+
+/* Matrix-style screensaver
+ *
+ * Author: Erik O'Shaughnessy (eriko@xenolab.com)  20 Apr 1999
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 23-Jul-1999: Unleashed on an unsuspecting world
+ * 29-Jun-1999: More hacking by Jeremy Buhler (jbuhler@cs.washington.edu)
+ *              - fix memory-related bugs found by xlock maintainer
+ *              - properly reinitialize screen with new size when init()
+ *                is called multiple times
+ *              - reinstate multiple final characters (suggested by
+ *                Joan Touzet)
+ *              - reduce delay to 1 ms (provisionally)
+ *              - decouple pixmap height from screen height, to permit
+ *                less memory use and shorter, more frequent updates
+ *                (for smoother scrolling on slow boxes, but nothing
+ *                will help if the machine is busy.  Also restores
+ *                broken display on very small windows).
+ *              - nevertheless, certain display parameters such as the
+ *                interval between column speed updates should depend on
+ *                the screen height -- enforce this at runtime.
+ *              - fix column spacing to use entire window
+ *              - remove redundant size fields from matrix_t and column_t
+ *                structures -- rely on character size and window size
+ *                instead.
+ *              - consistently use PICK_MATRIX() instead of passing
+ *                mp as a parameter whenever the active screen is
+ *                implicitly required.
+ * 27-Jun-1999: Overhauled by Jeremy Buhler (jbuhler@cs.washington.edu)
+ *              - use screen-to-screen copies as much as possible
+ *              - get by with a single pixmap per column instead of two
+ *              - try to optimize draw_matrix() and new_column() as much
+ *                as humanly possible
+ *              - fixed double-freeing in release_matrix()
+ *              - increased delay to 10 ms to prevent hyperfast scrolling
+ *              - minor cleanups; removed unused or duplicate code/data
+ * 26-Jun-1999: Tweaks by Jeremy Buhler (jbuhler@cs.washington.edu)
+ *              - Use larger Katakana font with numbers
+ *              - tweak character colors
+ *              - change string and gap distributions for lower screen density
+ *              - Matrix strings end with a fixed character
+ *              - fix scrolling artifacts due to gaps between two column
+ *                pixmaps
+ *              - minor code cleanups to allow future parameterization
+ *                of speed, density
+ * 09-Jun-1999: Tweaks by Joan Touzet to look more like the original film's
+ *              effects
+ * 22-Apr-1999: Initial version
+ */
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+
+#include <X11/Intrinsic.h>
+
+#ifdef STANDALONE
+#define PROGCLASS "Matrix"
+#define HACK_INIT init_matrix
+#define HACK_DRAW draw_matrix
+#define matrix_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000\n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+ModeSpecOpt matrix_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   matrix_description =
+{"matrix", "init_matrix", "draw_matrix", "release_matrix",
+ "refresh_matrix", "change_matrix", NULL, &matrix_opts,
+ 1000, 1, 1, 1, 64, 1.0, "",
+ "Shows the Matrix", 0, NULL};
+#endif
+
+
+/*
+ * state associated with a single column of the waterfall display
+ */
+typedef struct {
+       int yPtr;               /* current offset relative to pixmap origin */
+       Pixmap pixmap;
+
+       int strLen;             /* remaining length of current string */
+       int gapLen;             /* remaining length of current gap    */
+       Bool endChar;           /* is the next char an ending char?   */
+
+       int speed;              /* pixels downward per update */
+       int nextSpeedUpdate;    /* time until next change in speed */
+
+} column_t;
+
+
+/*
+ * Matrix display parameters associated with a particular X screen
+ */
+typedef struct {
+       column_t *columns;      /* columns of the Matrix display */
+       int num_cols;           /* number of columns of Matrix data
+                                * (depends on screen width) */
+
+       int charsPerPixmap;     /* height of column pixmaps in characters
+                                * (depends on screen height) */
+
+       int pixmapHeight;       /* height of column pixmaps in pixels
+                                 * (depends on screen height) */
+
+       int speedUpdateInterval; /* number of characters or spaces that
+                                * must be written to column pixmap before
+                                * the column speed is changed
+                                * (depends on screen height) */
+
+       Pixmap kana[2];         /* pixmap containing katakana
+                                * [0] is fg on bg
+                                * [1] is bold on bg */
+
+       Pixel fg;               /* foreground */
+       Pixel bg;               /* background */
+       Pixel bold;             /* standout foreground color */
+} matrix_t;
+
+
+/* These Katakana font bitmaps were taken from the file 12x24rk.bdf
+ * distributed with XFree86 3.3.3.  The numbers were taken from the file
+ * 10x20.bdf, since the 12x24rk numbers were rather large compared to
+ * the other characters.
+ */
+#define katakana_cell_width  12
+#define katakana_cell_height 24
+#define katakana_num_cells   65
+
+#define katakana_width 780
+#define katakana_height 24
+
+static const unsigned char katakana_bits[] = {
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,
+ 0xff,0xfc,0xff,0xff,0xff,0xef,0xff,0xff,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xef,0x9f,0xff,0xff,0x9f,0xff,0xfd,0xef,0xff,0xf9,0xcf,0xff,
+ 0xff,0x7f,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,0xfe,0xfb,0xfc,
+ 0xfc,0x9f,0xff,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xfc,0xff,0x3f,0xf8,0xcf,0xff,0xe7,0xff,0xff,0xfe,0xff,0xff,0xff,0x03,0x3c,
+ 0xc7,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcf,0x9f,0xff,0xff,
+ 0xbf,0xff,0xf9,0xcf,0xff,0xf9,0xcf,0xff,0xff,0x73,0x3e,0xff,0x7b,0xfc,0xfe,
+ 0xfb,0xfc,0xfd,0xff,0xdc,0x9c,0x03,0xfc,0xfc,0x9f,0xff,0xff,0xff,0xff,0xf9,
+ 0x7f,0xfe,0xfb,0xff,0xff,0xdf,0xff,0xff,0xf9,0xff,0x7f,0xf0,0x9f,0xff,0xef,
+ 0xff,0xff,0xfe,0xff,0x9f,0x9f,0x07,0x7c,0xcf,0x9f,0xff,0xff,0xff,0x9f,0xdf,
+ 0xff,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0xf8,0xcf,0x9f,0xff,0xff,0x3f,0xff,0xf9,0xdf,0xff,0xf9,0xcf,
+ 0x9f,0xdf,0x67,0x7e,0xff,0x03,0xf8,0xfc,0xfb,0xf9,0xcd,0x0f,0xdc,0x9d,0x07,
+ 0xff,0xfc,0xbf,0xff,0xff,0x1b,0xfc,0xf9,0xff,0x7c,0xf2,0xf9,0xdf,0x80,0xff,
+ 0xff,0xf9,0xff,0xff,0xc3,0x9f,0xff,0xcf,0xff,0xfe,0xfe,0xff,0x3f,0x80,0xff,
+ 0x7f,0xcf,0x93,0xbf,0xff,0xff,0x1f,0x80,0xf9,0x0f,0x9f,0xff,0xf9,0x0f,0xff,
+ 0xf0,0xff,0x3e,0xc0,0x0f,0x3f,0xc0,0x0f,0xff,0xf0,0x01,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x05,0xf8,0xcf,0x9d,0xbd,
+ 0xc3,0x3f,0xff,0xf9,0xdf,0xff,0xdd,0xef,0x3f,0x80,0x67,0x7e,0xfe,0x87,0xfd,
+ 0xfc,0xf3,0xfd,0xc1,0x03,0x9f,0x9d,0xff,0xff,0xfc,0xbf,0xff,0xff,0x03,0xf8,
+ 0xef,0xff,0xfc,0xf4,0xf3,0x1f,0x80,0xcf,0xff,0xf9,0x3f,0xf8,0x8f,0x9f,0xff,
+ 0xcf,0x03,0xfc,0xfe,0xff,0x3f,0x80,0xff,0x7f,0xcf,0x87,0x3f,0xff,0xfb,0x3d,
+ 0x80,0xfb,0x0f,0x0f,0xff,0xf8,0x67,0x7e,0xe6,0x7f,0x3e,0xff,0x67,0xfe,0xcf,
+ 0x67,0x7e,0xe6,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xc1,0xf9,0xe7,0x01,0x38,0xc0,0x3f,0xff,0x81,0xdf,0xff,0x80,
+ 0xef,0x3f,0x80,0x67,0xfe,0xfe,0xff,0xfd,0xfc,0xf7,0xfd,0xc0,0xa1,0xbf,0x99,
+ 0xff,0xff,0xfc,0xbf,0xff,0xff,0xc7,0xfd,0xe1,0xff,0xfc,0xe4,0xfb,0x3f,0xcf,
+ 0xcf,0xdf,0x01,0x01,0xf0,0x9f,0xdf,0xff,0xcf,0x03,0xff,0x0c,0x7f,0xfe,0x9f,
+ 0xff,0x7f,0xcf,0x97,0x3f,0xff,0x03,0xbc,0xcf,0xf3,0x0f,0x67,0x7e,0xf8,0xf3,
+ 0x3c,0xcf,0x3f,0x3e,0xff,0xf3,0xfe,0xcf,0xf3,0x3c,0xcf,0xff,0xfc,0xff,0x7f,
+ 0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfb,0xfc,0xe7,0x03,
+ 0x3c,0xf8,0x3f,0xdf,0x80,0x1f,0xfc,0x80,0x67,0xf0,0xdf,0x67,0xfe,0x7f,0xff,
+ 0xfc,0xbc,0xe7,0xfc,0xce,0xbf,0x3f,0x99,0xff,0xff,0xfc,0xbf,0x3f,0xc0,0xff,
+ 0xdd,0xe0,0xff,0xfe,0xee,0xfb,0xff,0xcf,0x87,0x1f,0x00,0x81,0xf1,0xff,0xdf,
+ 0xff,0xcf,0xdf,0xff,0x00,0x01,0xfe,0x9f,0xff,0x7f,0xcf,0x97,0x3f,0xff,0x03,
+ 0xbc,0xcf,0xf7,0x0f,0x67,0x3e,0xf9,0xf3,0x3c,0xcf,0x1f,0x3e,0xff,0xf3,0xff,
+ 0xe7,0xf3,0x3c,0xcf,0xff,0xfc,0xc0,0x7f,0xfe,0xf9,0xff,0xff,0xfb,0xef,0xff,
+ 0xff,0xff,0xbf,0xfc,0x5f,0xfe,0xf3,0xfb,0xfc,0xf9,0x3d,0x10,0x98,0x05,0xfc,
+ 0xde,0x07,0xf0,0xdf,0x67,0xd8,0x3f,0xff,0xfe,0x00,0xe7,0x7c,0xee,0xbf,0x3f,
+ 0x99,0x04,0xf0,0xfc,0x3d,0x38,0xe0,0xff,0x1c,0xe4,0x7f,0xfe,0xce,0xfb,0xfc,
+ 0xcf,0xa7,0x1f,0xf8,0xf9,0x39,0xfe,0xcf,0x7f,0xee,0xdf,0xff,0xa0,0x03,0xfe,
+ 0x9f,0x0c,0x78,0xcf,0x97,0x3f,0x7f,0xf3,0xbc,0xcf,0xe7,0x0b,0xf3,0xfc,0xf9,
+ 0xff,0xfc,0xcf,0x4f,0x3e,0xff,0xf3,0xff,0xe7,0xf3,0x3c,0xcf,0xff,0x3c,0xc0,
+ 0xff,0xfe,0xf9,0xff,0xff,0xf3,0xcf,0xff,0xff,0xff,0xbc,0xcd,0x1f,0xfe,0xf3,
+ 0xfb,0xfc,0xf9,0x01,0x10,0x99,0x81,0x7f,0xce,0x07,0xff,0xdf,0x01,0x90,0xbf,
+ 0xff,0x6e,0x80,0xe7,0x7c,0xe6,0xbf,0x3f,0x99,0x01,0xf0,0xf0,0x01,0xf0,0xff,
+ 0xff,0x3c,0xf3,0x7f,0x7e,0xce,0x7b,0xfc,0xcf,0x37,0xff,0xf9,0xff,0x7c,0xf8,
+ 0xcf,0xff,0xec,0xdf,0x1f,0x9c,0x7f,0xfe,0x9f,0x01,0x78,0xcf,0x97,0x3f,0x3f,
+ 0xf3,0xbc,0xcf,0xe7,0x0b,0xf3,0xfc,0xf9,0xff,0xfc,0xe7,0x67,0x3e,0xf1,0x13,
+ 0xff,0xf3,0x67,0x3e,0xcf,0x03,0x3c,0xce,0x7f,0xbe,0xe9,0xff,0xff,0xf3,0xcf,
+ 0xfe,0xff,0x03,0x3c,0xc9,0x1f,0xff,0xf9,0xfb,0xfc,0xf9,0x01,0xff,0x99,0x9b,
+ 0x7f,0xef,0x33,0xff,0xdf,0x01,0x3e,0x9f,0x7f,0x0e,0xdc,0xe7,0x3e,0xe6,0x3f,
+ 0x38,0xdb,0xb9,0xff,0xe0,0x81,0xff,0xff,0xe7,0xfe,0xf3,0x7f,0x7f,0xde,0x1b,
+ 0xff,0xcf,0x73,0x7f,0xf1,0xff,0xfc,0xf0,0x6f,0xff,0xe0,0xdf,0x1f,0xdc,0x7f,
+ 0xfe,0x9f,0xf1,0x79,0xcf,0x97,0x3f,0xbf,0xf3,0xbc,0xcf,0xe7,0x09,0xf3,0xfc,
+ 0xf9,0x7f,0xfe,0xf1,0x73,0x3e,0xe6,0x63,0xfe,0xf3,0x0f,0x7f,0xc6,0x03,0xfc,
+ 0xef,0x3f,0x3f,0xe0,0xff,0xff,0xf3,0x0f,0xfc,0xff,0x07,0x7c,0xcb,0x9f,0xff,
+ 0xf9,0xfb,0xfc,0xf9,0x3f,0xff,0x9d,0x9f,0x3f,0xef,0x3b,0xff,0xdf,0x67,0x7e,
+ 0xde,0x7f,0x9f,0xcc,0xff,0xbe,0xf4,0x05,0xf8,0xcf,0xbf,0xff,0xc4,0x9f,0xff,
+ 0xff,0x4f,0xfe,0xf9,0x3f,0x7f,0x9e,0x83,0xff,0xcf,0x7b,0x7e,0xe9,0x7f,0xfe,
+ 0xe3,0x6f,0xff,0xf1,0x1f,0x98,0xdd,0x7f,0xfe,0x9f,0xff,0x79,0xcf,0x97,0x37,
+ 0x9f,0xf3,0xbc,0xcf,0xff,0x0d,0xf3,0xfc,0xf9,0x1f,0xff,0xe7,0x73,0xfe,0xcf,
+ 0xf3,0xfc,0xf9,0x67,0xfe,0xc8,0xff,0xfc,0xe1,0x3f,0x3f,0xe0,0x03,0x3e,0xc0,
+ 0x0f,0xfc,0xe7,0xff,0x7c,0xcb,0x9f,0xff,0xf8,0xfb,0xfc,0xf9,0x3f,0xff,0x9d,
+ 0x9f,0xbf,0xe7,0x39,0xff,0xdf,0x67,0x7e,0xce,0x3f,0xff,0xec,0x7f,0x9e,0xf0,
+ 0x81,0xff,0xcf,0xbf,0xff,0xcc,0x9f,0xff,0xff,0x4f,0xff,0xf1,0x3f,0x7f,0x9f,
+ 0xc3,0xff,0xe7,0xf9,0x7e,0xc9,0x7b,0xfe,0xc7,0x67,0xfe,0xf3,0x04,0xf8,0xcd,
+ 0x7f,0x3e,0x80,0xff,0x7c,0xcf,0x97,0x33,0xdf,0xf3,0xbc,0xcf,0xff,0x0c,0xf3,
+ 0xfc,0xf9,0xcf,0xff,0xcf,0x03,0xfc,0xcf,0xf3,0xfc,0xf9,0xf3,0xfc,0xcf,0x7f,
+ 0xfe,0xf1,0x1f,0x3f,0xef,0x03,0x3e,0xc0,0xc1,0x7c,0xe0,0xff,0x7c,0xca,0x9f,
+ 0x7f,0xfa,0xfb,0xfc,0xf9,0x1f,0xff,0x9d,0x9f,0x90,0xf7,0x3d,0xff,0xdf,0x67,
+ 0xfe,0xef,0xbf,0xff,0xe4,0x7f,0xdf,0xf1,0x99,0xff,0xcf,0xbf,0xff,0xdc,0x9f,
+ 0xff,0xff,0x1f,0xff,0xe0,0xbf,0x7f,0xbf,0xfb,0xff,0xe7,0xfd,0x3c,0xd9,0x73,
+ 0xff,0xcf,0xe7,0xfe,0xe7,0xc1,0xff,0xed,0x7f,0x7e,0xc0,0xff,0x7c,0xcf,0x97,
+ 0x3b,0xcf,0xf3,0xfc,0xcf,0xff,0x0e,0x67,0xfe,0xf9,0xe7,0x3f,0xcf,0x7f,0xfe,
+ 0xcf,0xf3,0xfc,0xfc,0xf3,0xfc,0xcf,0x7f,0xfe,0xf9,0x0f,0x3f,0xef,0x9f,0xff,
+ 0xf1,0xc3,0x7e,0xe0,0xff,0xfc,0xee,0x9f,0x3f,0xfb,0xfb,0xfe,0xf9,0x5f,0xff,
+ 0x9d,0x0f,0xd0,0xf7,0x3d,0xff,0xcf,0x67,0xfe,0xe7,0x1f,0xfe,0xf4,0x3f,0xff,
+ 0xf3,0x9f,0xff,0xef,0x9f,0xff,0xfc,0x9f,0xff,0xff,0x1f,0x7f,0xc0,0x9f,0x3f,
+ 0xbf,0xfb,0xff,0xf7,0xff,0x3d,0x99,0x27,0xff,0xff,0xe7,0xfc,0xe3,0xd9,0xff,
+ 0xe5,0x7f,0xff,0xdf,0x7f,0x7e,0xcf,0x97,0x39,0xef,0xf3,0xfc,0xef,0x7f,0x0e,
+ 0x67,0xfe,0xf9,0xf3,0x3f,0xcf,0x7f,0x3e,0xcf,0xf3,0xfc,0xfc,0xf3,0x7c,0xcf,
+ 0x7f,0xfe,0xf9,0x0f,0x3f,0xef,0x9f,0xff,0xf1,0x5f,0xfe,0xe7,0x07,0xfc,0xef,
+ 0x9f,0x9f,0xfb,0x7b,0xfe,0xf9,0x4f,0xff,0x9c,0x00,0xff,0xf3,0xbf,0xff,0xcf,
+ 0x67,0xfe,0xf7,0x5f,0xfe,0xf0,0xbf,0xff,0xf1,0x9f,0xff,0xe7,0x9f,0xff,0xfc,
+ 0x9f,0xff,0xff,0x1f,0x3e,0x88,0xdf,0x3f,0xbf,0xfb,0xff,0xf3,0xff,0xb9,0x99,
+ 0x8f,0xff,0xff,0xf7,0xfc,0xcb,0xdf,0xff,0xf1,0x7f,0xff,0xdf,0x7f,0x7e,0xef,
+ 0x97,0x3d,0xe7,0xf3,0xfc,0xe7,0x7f,0x0f,0x0f,0xff,0xf9,0xf3,0x7f,0xe6,0x7f,
+ 0x7e,0xe6,0x67,0x7e,0xfe,0x67,0x7e,0xe6,0x3f,0xff,0xfd,0x27,0x3f,0xe7,0x9f,
+ 0xff,0xf0,0x5f,0xff,0xe7,0x07,0xfe,0xe7,0xdf,0xdf,0xfb,0x7f,0xfe,0xb9,0x6f,
+ 0xff,0xdc,0xa1,0xff,0xfb,0xbf,0xff,0xcf,0x67,0xfe,0xf3,0xcf,0xfc,0xfc,0x9f,
+ 0xff,0xf5,0x9f,0xff,0xf7,0xdf,0xff,0xfc,0xdf,0xff,0xff,0xdf,0x1e,0x99,0xcf,
+ 0xbf,0xbf,0xfb,0xff,0xfb,0xff,0x99,0xb9,0x9f,0x3f,0xfe,0xf3,0xf9,0xd9,0xdf,
+ 0xff,0xf9,0x7f,0xff,0xdf,0x3f,0xff,0xe7,0x97,0x3c,0xf7,0xf3,0xfc,0xe7,0x3f,
+ 0x0f,0x9f,0x3f,0xc0,0x03,0xfc,0xf0,0x7f,0xfe,0xf0,0x0f,0x7f,0xfe,0x0f,0xff,
+ 0xf0,0x3f,0xff,0xfd,0x37,0xff,0xf7,0x9f,0xff,0xf2,0xdf,0xff,0xe7,0xff,0xfe,
+ 0xf7,0xcf,0xff,0xfb,0x3f,0xcf,0x00,0x67,0xff,0xde,0xbf,0xff,0xf9,0x9f,0x1f,
+ 0xc0,0x67,0xff,0xf9,0xef,0xfd,0xfc,0xdf,0xff,0xfc,0xdf,0xff,0xf3,0xcf,0xff,
+ 0xfc,0xdf,0xdf,0x00,0xcf,0x8c,0x39,0xef,0xbf,0xbf,0xfb,0xff,0xf9,0xff,0xc3,
+ 0xb9,0x3f,0x3f,0xf8,0x33,0xf8,0x9d,0xdf,0xff,0xf9,0x7c,0xff,0xdf,0xbf,0xff,
+ 0xe7,0x93,0x3e,0xf3,0x03,0xfc,0xf7,0x9f,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9f,0xff,0xfd,0x3f,0xff,0xf3,
+ 0x9f,0x7f,0xf2,0xdf,0xff,0xe7,0xff,0xfe,0xf3,0xef,0xff,0xfb,0x3f,0x1f,0x00,
+ 0x77,0x7f,0xda,0xbf,0xff,0xfc,0xdf,0x3f,0xc0,0x7f,0xbf,0xfc,0xe7,0xf9,0xfc,
+ 0xcf,0xff,0xfe,0xcf,0xff,0xf9,0xef,0xff,0xfc,0xcf,0x1f,0x00,0xef,0xfd,0x39,
+ 0xe7,0x9f,0x3f,0xfb,0xff,0xfd,0xff,0x43,0xb8,0x3f,0xff,0xf1,0x01,0xf8,0xfc,
+ 0xdf,0xff,0xfb,0x01,0xf0,0xdf,0x9f,0xff,0xe7,0x13,0x3e,0xf9,0x03,0xfc,0xf3,
+ 0x8f,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x9f,0xff,0xfc,0x3f,0xff,0xfb,0x9f,0x7f,0xf3,0x9f,0xff,0xe7,0xff,
+ 0xfe,0xfb,0xe7,0xff,0xfb,0x9f,0x1f,0xff,0x53,0x7f,0xc3,0xbf,0xff,0xfc,0xcf,
+ 0xff,0xff,0x3f,0x3f,0xfc,0xf3,0xf9,0xfc,0xef,0x7f,0xfe,0xef,0xff,0xf9,0xe7,
+ 0xff,0xfc,0xef,0x1f,0xff,0xe7,0xf9,0xf9,0xf7,0xdf,0x3f,0xfb,0xff,0xfc,0xff,
+ 0xf3,0xf8,0x7f,0xfe,0xe3,0xc1,0xf3,0xfe,0xdf,0xff,0xfb,0x01,0x10,0x80,0xdf,
+ 0xff,0xf7,0x1b,0x3e,0xfd,0xf3,0xff,0xfb,0xcb,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcf,0xff,0xfe,0x3f,0xff,
+ 0xf9,0x9f,0x3f,0xf3,0x9f,0xff,0xe7,0xff,0xfe,0xf9,0xf7,0xff,0xfb,0x9f,0xff,
+ 0xff,0x19,0x3f,0xe7,0xbf,0x7f,0xfe,0xef,0xff,0xff,0xbf,0x3f,0xfe,0xf9,0xfb,
+ 0x01,0xe7,0x3f,0xff,0xe7,0xff,0xfc,0xf3,0xff,0xfc,0xe7,0xff,0xff,0xf3,0xf3,
+ 0xf9,0xf3,0xcf,0xff,0xf3,0xf9,0xfe,0xff,0xff,0xf8,0x7f,0xfe,0xc7,0xf9,0x73,
+ 0xfe,0x1f,0xf0,0xfb,0xff,0x1f,0x80,0xcf,0xff,0xf3,0x19,0x3f,0xfc,0xf3,0xff,
+ 0xf9,0xe3,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xe7,0x7f,0xfe,0x3f,0xff,0xfd,0x03,0xb8,0xf1,0x9f,0x1f,0xc0,
+ 0x03,0xfc,0xfc,0xf3,0xff,0xfb,0xcf,0xff,0xff,0x19,0x9f,0xe7,0xbf,0x3f,0xff,
+ 0xe7,0xff,0xff,0x9f,0x7f,0xfe,0xf9,0xff,0x01,0xf7,0x1f,0xff,0xf3,0x7f,0xfe,
+ 0xf3,0xff,0xfc,0xf3,0xff,0xff,0xf9,0xf3,0xf9,0xfb,0xef,0xff,0x03,0x78,0xfe,
+ 0xff,0xff,0xf9,0xff,0xff,0xcf,0xff,0x33,0xff,0x1f,0xf0,0xfb,0xff,0xff,0xff,
+ 0xe7,0xff,0xf8,0x1d,0x3f,0xfe,0xff,0xff,0xfd,0xe3,0x0f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0x7f,0xff,0x3f,
+ 0xff,0xfc,0x03,0xf8,0xfb,0x9f,0x1f,0x80,0x07,0x7c,0xfc,0xfb,0xff,0xfb,0xe7,
+ 0xff,0xff,0x3c,0x9f,0xff,0xbf,0x9f,0xff,0xf7,0xff,0xff,0xcf,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x9f,0xff,0xf3,0x3f,0xff,0xf9,0xff,0xfc,0xff,0xff,0xff,0xf9,
+ 0xff,0xf9,0xf9,0xff,0xff,0x07,0x38,0xff,0xff,0xff,0xfd,0xff,0xff,0xdf,0xff,
+ 0x33,0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xf3,0xff,0xfc,0xbd,0x7f,0xff,0xff,
+ 0xff,0xfc,0xf3,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f
+};
+
+#define PIXMAP_WIDTH katakana_cell_width
+
+#define PICK_MATRIX(mi) (&matrix[MI_SCREEN(mi)])
+#define MATRIX_RANDOM(min, max) (NRAND((max) - (min)) + (min))
+
+/*************************************************************************
+ * CONFIGURABLE DISPLAY OPTIONS
+ *************************************************************************/
+
+/* Defining RANDOMIZE_COLUMNS causes each column pixmap to be regenerated
+ * after scrolling off the screen rather than just repeating
+ * infinitely.  This is a better effect but uses more CPU and will
+ * cause update hesitations (especially on multi-headed machines or
+ * slower hardware).  However, it can be done in relatively little memory
+ * because the pixmaps can be kept short and regenerated frequently.
+ *
+ * Undefining RANDOMIZE_COLUMNS will cause the pixmaps to be generated only
+ * once, which should save a lot of horsepower for whatever else your machine
+ * might be doing.  However, the tradeoff is that the pixmaps are longer
+ * to avoid a really boring display.
+ */
+#define RANDOMIZE_COLUMNS
+
+/*
+ * Speed at which columns move, in pixels per screen update.
+ * Must be <= katakana_cell_height; interesting values range
+ * from one (crawl) to about fifteen (zoom!).
+ * (Note: the distribution of speeds implemented in new_column()
+ *  is slightly biased against very slow scrolling.)
+ */
+#define MATRIX_SPEED  MATRIX_RANDOM(1, 8)
+
+/*
+ * Number of characters in each generated string
+ * (Note: this is not limited by the pixmap size!)
+ */
+#define MATRIX_STRLEN MATRIX_RANDOM(15, 20)
+
+/*
+ * Number of character-heights in each generated gap
+ * (Note: this is not limited by the pixmap size!)
+ */
+#define MATRIX_GAPLEN MATRIX_RANDOM(2, 6)
+
+/* colors used for Matrix characters */
+#define BRIGHTGREEN (28 * MI_NPIXELS(mi) / 64)
+#define GREEN       (26 * MI_NPIXELS(mi) / 64)
+
+/*************************************************************************/
+
+/*
+ * state of the Matrix
+ */
+static matrix_t *matrix = NULL;
+
+
+/* NAME: new_column
+ *
+ * FUNCTION: clears and generates a pixmap of "matrix" data
+ */
+
+static void new_column(const ModeInfo *mi, column_t *c)
+{
+  matrix_t *mp = PICK_MATRIX(mi);
+  int currChar;
+
+  /*
+   * clear the pixmap to get rid of previous data or initialize
+   */
+  XSetForeground(MI_DISPLAY(mi), MI_GC(mi), mp->bg);
+  XFillRectangle(MI_DISPLAY(mi), c->pixmap, MI_GC(mi),
+                                0, 0, PIXMAP_WIDTH, mp->pixmapHeight);
+
+  /*
+   * Write characters into the column pixmap, starting at the
+   * bottom and moving upwards.  Decrement the string length, gap length,
+   * and next-speed-update timers for the column and reinitialize them
+   * if necessary.
+   */
+  for (currChar = mp->charsPerPixmap - 1; currChar >= 0; currChar--) {
+         if (c->nextSpeedUpdate-- == 0) {
+                 c->speed = MATRIX_SPEED;
+                 c->nextSpeedUpdate = mp->speedUpdateInterval;
+
+                 /* tweak to prevent really slow columns from remaining slow */
+                 if (c->speed <= 2)
+                       c->nextSpeedUpdate /= 2;
+         }
+
+         if (c->gapLen > 0) {
+                 c->gapLen--;
+                 continue;
+         } else if (c->strLen == 0) {
+                 /*
+                  * generate a gap of random length in the string, followed
+                  * by a random number of characters.  Set the endChar flag
+                  * to indicate the end of a new string.
+                  */
+                 c->gapLen  = MATRIX_GAPLEN;
+                 c->strLen  = MATRIX_STRLEN;
+                 c->endChar = True;
+         } else {
+                 Pixmap src;
+                 int kOffset;
+
+                 if (c->endChar) {
+                         src = mp->kana[1]; /* a bold, non-numeric character */
+                         kOffset = MATRIX_RANDOM(10, katakana_num_cells);
+                         c->endChar = False;
+                       } else {             /* inside a string - kana or number */
+                         src = mp->kana[0];
+                         kOffset = MATRIX_RANDOM(0, katakana_num_cells);
+                       }
+
+                 XCopyArea(MI_DISPLAY(mi), src, c->pixmap, MI_GC(mi),
+                                       kOffset * katakana_cell_width, 0,
+                                       katakana_cell_width, katakana_cell_height,
+                                       0, currChar * katakana_cell_height);
+
+                 c->strLen--;
+               }
+       }
+}
+
+/* NAME: free_matrix
+ *
+ * FUNCTION: delete the data associated with a single screen.  Be careful
+ * not to do spurious free()s of nonexistent data, and to nullify all
+ * freed pointers that might be reused past the end of this call.
+ */
+static void
+free_matrix(Display *display, matrix_t *mp)
+{
+       if (mp->columns != NULL) {
+         int c;
+
+         for (c = 0; c < mp->num_cols; c++) {
+                 if (mp->columns[c].pixmap)
+                       XFreePixmap(display, mp->columns[c].pixmap);
+         }
+
+         (void) free((void *) mp->columns);
+         mp->columns = NULL;
+       }
+
+       if (mp->kana[0]) {
+         XFreePixmap(display, mp->kana[0]);
+         mp->kana[0] = None;
+       }
+
+       if (mp->kana[1]) {
+         XFreePixmap(display, mp->kana[1]);
+         mp->kana[1] = None;
+       }
+}
+
+/* NAME: setup_matrix()
+ *
+ * FUNCTION: Initialize the Matrix state for the current screen.
+ *           Based on the width and height of the display,
+ *           allocate and initialize column data structures.
+ */
+
+static void setup_matrix(const ModeInfo *mi)
+{
+  matrix_t *mp = PICK_MATRIX(mi);
+  Display *display = MI_DISPLAY(mi);
+  Window window = MI_WINDOW(mi);
+  int c;
+
+  /* screen may have changed size/depth/who-knows-what */
+  free_matrix(display, mp);
+
+  if (MI_NPIXELS(mi) > 2) {
+         mp->fg   = MI_PIXEL(mi, GREEN);
+         mp->bold = MI_PIXEL(mi, BRIGHTGREEN);
+  } else
+       mp->fg = mp->bold = MI_WHITE_PIXEL(mi);
+
+  mp->bg = MI_BLACK_PIXEL(mi);
+
+  if ((mp->kana[0] = XCreatePixmapFromBitmapData(display, window,
+               (char *) katakana_bits, katakana_width, katakana_height,
+               mp->bg, mp->fg, MI_DEPTH(mi))) == None) {
+       free_matrix(display, mp);
+       return;
+  }
+
+  if ((mp->kana[1] = XCreatePixmapFromBitmapData(display, window,
+               (char *) katakana_bits, katakana_width, katakana_height,
+               mp->bg, mp->bold, MI_DEPTH(mi))) == None) {
+       free_matrix(display, mp);
+       return;
+  }
+
+  /*
+   * Using the width of the kana font, determine how many
+   * columns can fit across the current screen (with a little
+   * padding).
+   */
+  mp->num_cols = (int) (MI_WIDTH(mi) / (1.3 * katakana_cell_width));
+
+  if ((mp->columns = (column_t *) calloc(mp->num_cols,
+               sizeof(column_t))) == NULL) {
+       free_matrix(display, mp);
+       return; 
+  }
+
+  /*
+   * If we're randomizing columns, keep the column pixmap height small
+   * to save memory and minimize time for each column update.  Otherwise,
+   * make the height large to maximize variety without updating the pixmaps.
+   */
+#ifdef RANDOMIZE_COLUMNS
+  mp->charsPerPixmap = MI_HEIGHT(mi) / (4 * katakana_cell_height);
+#else
+  mp->charsPerPixmap = MI_HEIGHT(mi) / katakana_cell_height;
+#endif
+
+  if (!mp->charsPerPixmap)  /* sanity check for tiny windows */
+       mp->charsPerPixmap = 1;
+
+  mp->pixmapHeight = mp->charsPerPixmap * katakana_cell_height;
+
+  for (c = 0; c < mp->num_cols; c++)
+       if ((mp->columns[c].pixmap  = XCreatePixmap(display, window,
+                 PIXMAP_WIDTH, mp->pixmapHeight, MI_DEPTH(mi))) == None) {
+               free_matrix(display, mp);
+               return;
+       }
+
+  /* Change the speed of a column after it's covered half the screen */
+  mp->speedUpdateInterval = MI_HEIGHT(mi) / (2 * katakana_cell_height);
+
+  /* initialize the column data */
+  for (c = 0; c < mp->num_cols; c++) {
+         column_t *column = &(mp->columns[c]);
+
+         column->yPtr = mp->pixmapHeight;
+
+         column->nextSpeedUpdate = 0; /* will generate new speed  */
+         column->strLen  = 0;         /* will generate new string */
+
+         new_column(mi, column);
+  }
+}
+
+
+
+/* NAME: init_matrix
+ *
+ * FUNCTION: allocate space for global matrix array
+ *           initialize colors
+ *           initialize dimensions
+ *           allocate a pair of pixmaps containing character set
+ *               (0 is green on black, 1 is bold on black)
+ *           create columns of "matrix" data
+ */
+
+void init_matrix(ModeInfo *mi)
+{
+  if (matrix == NULL) {
+       if ((matrix = (matrix_t *) calloc(MI_NUM_SCREENS(mi),
+                        sizeof(matrix_t))) == NULL)
+               return;
+  }
+
+  /* don't want any exposure events from XCopyArea */
+  XSetGraphicsExposures(MI_DISPLAY(mi), MI_GC(mi), False);
+
+  MI_CLEARWINDOW(mi);
+  setup_matrix(mi);
+}
+
+
+/* NAME: draw_matrix
+ *
+ * FUNCTION: update the matrix waterfall display
+ */
+void draw_matrix(ModeInfo *mi)
+{
+  double xDistance;
+  int i;
+  matrix_t *mp;
+
+  if (matrix == NULL)
+       return;
+  mp = PICK_MATRIX(mi);
+  if (mp->columns == NULL)
+       return;
+
+  MI_IS_DRAWN(mi) = True;
+  xDistance = (double) MI_WIDTH(mi) / (double) mp->num_cols;
+
+  /*
+   * THEORY OF OPERATION
+   *
+   * Screen-to-screen blits occur within the video RAM and are usually
+   * hardware-accelerated, while pixmap-to-screen blits require DMA
+   * between main memory and vRAM.  To make updates as fast as possible,
+   * we scroll down the screen contents in each column by <speed> pixels,
+   * then fill only the top <speed> rows of the column with pixmap data.
+   *
+   * There are two tricky bits to this scheme.  First, we must keep a
+   * pointer (yPtr) to the pixmap contents which should be used to
+   * fill in the top rows of each column.  yPtr is decremented on each
+   * call to draw_matrix(); when it reaches zero, the column's pixmap
+   * may be redrawn to generate new characters for the column.
+   *
+   * Second, the scroll increment corresponding to <speed> need not be a
+   * multiple of the pixmap height. We must special-case the handling of the
+   * last decrement that makes yPtr <= 0 to ensure that the last few pixels
+   * of the old data AND the first few pixels of the new data are both drawn.
+   * It turns out to be quite reasonable to do the pixmap update inline,
+   * between drawing the last few old pixels and the first few new pixels.
+   * Hence, we can achieve smooth scrolling with only one pixmap per column.
+   */
+
+  for (i = 0; i < mp->num_cols; i++) {
+         column_t *c = &(mp->columns[i]);
+         int xOffset = (int) (i * xDistance);
+         int yDelta  = c->speed;
+
+         /* screen-screen blit takes care of most of the column */
+         XCopyArea(MI_DISPLAY(mi), MI_WINDOW(mi),
+                               MI_WINDOW(mi), MI_GC(mi),
+                               xOffset, 0,
+                               PIXMAP_WIDTH, MI_HEIGHT(mi) - yDelta,
+                               xOffset, yDelta);
+
+         c->yPtr -= yDelta;
+
+         if (c->yPtr <= 0) /* we're about to finish the current pixmap */
+               {
+                 /* exhaust the pixels in the current pixmap */
+                 XCopyArea(MI_DISPLAY(mi), c->pixmap,
+                                       MI_WINDOW(mi), MI_GC(mi),
+                                       0, 0,
+                                       PIXMAP_WIDTH, yDelta + c->yPtr,
+                                       xOffset, -(c->yPtr));
+
+#ifdef RANDOMIZE_COLUMNS
+                 /* regenerate the column pixmap with new text */
+                 new_column(mi, c);
+#else
+                 /* speed is normally updated in new_column(), which isn't called,
+                  * so take this opportunity to update the column speed.
+                  */
+                 c->speed = MATRIX_SPEED;
+#endif
+
+                 /* fill in the remainder of the column from the new pixmap */
+                 XCopyArea(MI_DISPLAY(mi), c->pixmap,
+                                       MI_WINDOW(mi), MI_GC(mi),
+                                       0, mp->pixmapHeight + c->yPtr,
+                                       PIXMAP_WIDTH, -(c->yPtr),
+                                       xOffset, 0);
+
+                 c->yPtr += mp->pixmapHeight;
+               }
+         else
+               {
+                 /* fill in the remainder of the column from the pixmap */
+                 XCopyArea(MI_DISPLAY(mi), c->pixmap,
+                                       MI_WINDOW(mi), MI_GC(mi),
+                                       0, c->yPtr,
+                                       PIXMAP_WIDTH, yDelta,
+                                       xOffset, 0);
+               }
+       }
+}
+
+
+/* NAME: release_matrix
+ *
+ * FUNCTION: frees all allocated resources
+ */
+
+void release_matrix(ModeInfo *mi)
+{
+
+  /* If the matrix exists, free all data associated with all screens.
+   * free_matrix() does no harm if given nonexistent screens.
+   */
+  if (matrix != NULL) {
+       int screen;
+
+       for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+               free_matrix(MI_DISPLAY(mi), &matrix[screen]);
+         (void) free((void *) matrix);
+         matrix = NULL;
+  }
+}
+
+
+/* NAME: refresh_matrix
+ *
+ * FUNCTION: refresh the screen
+ */
+
+void refresh_matrix(ModeInfo *mi)
+{
+  int c;
+  matrix_t *mp;
+
+  if (matrix == NULL)
+       return;
+  mp = PICK_MATRIX(mi);
+  if (mp->columns == NULL)
+       return;
+
+  /* We simply clear the whole window and restart the scrolling operation.
+   * In principle, it is possible to restore at least some of the
+   * column pixmap data to the screen, but it's not worth the trouble.
+   */
+  MI_CLEARWINDOW(mi);
+
+  for (c = 0; c < mp->num_cols; c++)
+       mp->columns[c].yPtr = mp->pixmapHeight;
+}
+
+
+/* NAME: change_matrix
+ *
+ * FUNCTION: resets column offsets and speeds and generates new pixmaps
+ */
+
+void change_matrix(ModeInfo *mi)
+{
+  int c;
+  matrix_t *mp;
+
+  if (matrix == NULL)
+       return;
+  mp = PICK_MATRIX(mi);
+  if (mp->columns == NULL)
+       return;
+
+  MI_CLEARWINDOW(mi);
+
+  for (c = 0; c < mp->num_cols; c++) {
+         column_t *column = &(mp->columns[c]);
+
+         column->yPtr = mp->pixmapHeight;
+
+         column->nextSpeedUpdate = 0; /* will generate new speed  */
+         column->strLen  = 0;         /* will generate new string */
+
+         new_column(mi, column);
+  }
+}
diff --git a/modes/maze.c b/modes/maze.c
new file mode 100644 (file)
index 0000000..34c4639
--- /dev/null
@@ -0,0 +1,952 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* maze --- a varying maze */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)maze.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1988 by Sun Microsystems
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 27-Oct-1997: xpm and ras capability added
+ * 10-May-1997: Compatible with xscreensaver
+ * 27-Feb-1996: Add ModeInfo args to init and callback hooks, use new
+ *              ModeInfo handle to specify long pauses (eliminate onepause).
+ *                     Ron Hitchens <ron@idiom.com>
+ * 20-Jul-1995: minimum size fix Peter Schmitzberger <schmitz@coma.sbg.ac.at>
+ * 17-Jun-1995: removed sleep statements
+ * 22-Mar-1995: multidisplay fix Caleb Epstein <epstein_caleb@jpmorgan.com>
+ * 09-Mar-1995: changed how batchcount is used
+ * 27-Feb-1995: patch for VMS
+ * 04-Feb-1995: patch to slow down maze Heath Kehoe <hakehoe@icaen.uiowa.edu>
+ * 17-Jun-1994: HP ANSI C compiler needs a type cast for gray_bits
+ *              Richard Lloyd <R.K.Lloyd@csc.liv.ac.uk>
+ * 02-Sep-1993: xlock version David Bagley <bagleyd@tux.org>
+ * 07-Mar-1993: Good ideas from xscreensaver Jamie Zawinski <jwz@jwz.org>
+ * 06-Jun-1985: Martin Weiss Sun Microsystems
+ */
+
+/*-
+ * original copyright
+ * **************************************************************************
+ * Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, 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 Sun or MIT not be used in advertising
+ * or publicity pertaining to distribution of the software without specific
+ * prior written permission. Sun and M.I.T. make no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without any express or implied warranty.
+ *
+ * SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * IN NO EVENT SHALL SUN 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.
+ * ***************************************************************************
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Maze"
+#define HACK_INIT init_maze
+#define HACK_DRAW draw_maze
+#define maze_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*cycles: 3000 \n" \
+ "*size: -40 \n" \
+ "*ncolors: 64 \n" \
+ "*bitmap: \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_maze
+
+ModeSpecOpt maze_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   maze_description =
+{"maze", "init_maze", "draw_maze", "release_maze",
+ "refresh_maze", "init_maze", NULL, &maze_opts,
+ 1000, 1, 3000, -40, 64, 1.0, "",
+ "Shows a random maze and a depth first search solution", 0, NULL};
+
+#endif
+
+#include "bitmaps/gray1.xbm"
+
+/* aliases for vars defined in the bitmap file */
+#define ICON_WIDTH   image_width
+#define ICON_HEIGHT    image_height
+#define ICON_BITS    image_bits
+
+#include "maze.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define ICON_NAME  image_name
+#include "maze.xpm"
+#define DEFAULT_XPM 1
+#endif
+
+#define MINGRIDSIZE    3
+#define MINSIZE        8
+
+#define WALL_TOP       0x8000
+#define WALL_RIGHT     0x4000
+#define WALL_BOTTOM    0x2000
+#define WALL_LEFT      0x1000
+
+#define DOOR_IN_TOP    0x800
+#define DOOR_IN_RIGHT  0x400
+#define DOOR_IN_BOTTOM 0x200
+#define DOOR_IN_LEFT   0x100
+#define DOOR_IN_ANY    0xF00
+
+#define DOOR_OUT_TOP   0x80
+#define DOOR_OUT_RIGHT 0x40
+#define DOOR_OUT_BOTTOM        0x20
+#define DOOR_OUT_LEFT  0x10
+
+#define START_SQUARE   0x2
+#define END_SQUARE     0x1
+
+typedef struct {
+       unsigned char x;
+       unsigned char y;
+       char        dir;
+} paths;
+
+typedef struct {
+       int         ncols, nrows, maze_size, xb, yb;
+       int         sqnum, cur_sq_x, cur_sq_y, path_length;
+       int         start_x, start_y, start_dir, end_x, end_y, end_dir;
+       int         logo_x, logo_y;
+       int         width, height;
+       int         xs, ys, logo_size_x, logo_size_y;
+       int         solving, current_path, stage;
+       int         cycles;
+       unsigned short *maze;
+       paths      *move_list;
+       paths      *save_path, *path;
+       GC          grayGC;
+       Pixmap      graypix;
+       XImage     *logo;
+       Colormap    cmap;
+       unsigned long black, color;
+       int         graphics_format;
+       GC          backGC;
+       int         time;
+} mazestruct;
+
+static mazestruct *mazes = NULL;
+
+static void
+draw_wall(ModeInfo * mi, int i, int j, int dir)
+{                              /* draw a single wall */
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+       GC          gc = mp->backGC;
+
+       switch (dir) {
+               case 0:
+                       XDrawLine(display, window, gc,
+                                 mp->xb + mp->xs * i,
+                                 mp->yb + mp->ys * j,
+                                 mp->xb + mp->xs * (i + 1),
+                                 mp->yb + mp->ys * j);
+                       break;
+               case 1:
+                       XDrawLine(display, window, gc,
+                                 mp->xb + mp->xs * (i + 1),
+                                 mp->yb + mp->ys * j,
+                                 mp->xb + mp->xs * (i + 1),
+                                 mp->yb + mp->ys * (j + 1));
+                       break;
+               case 2:
+                       XDrawLine(display, window, gc,
+                                 mp->xb + mp->xs * i,
+                                 mp->yb + mp->ys * (j + 1),
+                                 mp->xb + mp->xs * (i + 1),
+                                 mp->yb + mp->ys * (j + 1));
+                       break;
+               case 3:
+                       XDrawLine(display, window, gc,
+                                 mp->xb + mp->xs * i,
+                                 mp->yb + mp->ys * j,
+                                 mp->xb + mp->xs * i,
+                                 mp->yb + mp->ys * (j + 1));
+                       break;
+       }
+}                              /* end of draw_wall */
+
+static void
+draw_solid_square(ModeInfo * mi, GC gc,
+                 register int i, register int j, register int dir)
+{                              /* draw a solid square in a square */
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+
+       switch (dir) {
+               case 0:
+                       XFillRectangle(display, window, gc,
+                                      mp->xb + 3 + mp->xs * i,
+                                      mp->yb - 3 + mp->ys * j,
+                                      mp->xs - 6, mp->ys);
+                       break;
+               case 1:
+                       XFillRectangle(display, window, gc,
+                                      mp->xb + 3 + mp->xs * i,
+                                      mp->yb + 3 + mp->ys * j,
+                                      mp->xs, mp->ys - 6);
+                       break;
+               case 2:
+                       XFillRectangle(display, window, gc,
+                                      mp->xb + 3 + mp->xs * i,
+                                      mp->yb + 3 + mp->ys * j,
+                                      mp->xs - 6, mp->ys);
+                       break;
+               case 3:
+                       XFillRectangle(display, window, gc,
+                                      mp->xb - 3 + mp->xs * i,
+                                      mp->yb + 3 + mp->ys * j,
+                                      mp->xs, mp->ys - 6);
+                       break;
+       }
+
+}                              /* end of draw_solid_square() */
+
+static void
+enter_square(ModeInfo * mi, int n)
+{                              /* move into a neighboring square */
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+
+       draw_solid_square(mi, mp->backGC, (int) mp->path[n].x, (int) mp->path[n].y,
+                         (int) mp->path[n].dir);
+
+       mp->path[n + 1].dir = -1;
+       switch (mp->path[n].dir) {
+               case 0:
+                       mp->path[n + 1].x = mp->path[n].x;
+                       mp->path[n + 1].y = mp->path[n].y - 1;
+                       break;
+               case 1:
+                       mp->path[n + 1].x = mp->path[n].x + 1;
+                       mp->path[n + 1].y = mp->path[n].y;
+                       break;
+               case 2:
+                       mp->path[n + 1].x = mp->path[n].x;
+                       mp->path[n + 1].y = mp->path[n].y + 1;
+                       break;
+               case 3:
+                       mp->path[n + 1].x = mp->path[n].x - 1;
+                       mp->path[n + 1].y = mp->path[n].y;
+                       break;
+       }
+
+}                              /* end of enter_square() */
+
+static void
+free_path(mazestruct * mp)
+{
+       if (mp->maze) {
+               (void) free((void *) mp->maze);
+               mp->maze = NULL;
+       }
+       if (mp->move_list) {
+               (void) free((void *) mp->move_list);
+               mp->move_list = NULL;
+       }
+       if (mp->save_path) {
+               (void) free((void *) mp->save_path);
+               mp->save_path = NULL;
+       }
+       if (mp->path) {
+               (void) free((void *) mp->path);
+               mp->path = NULL;
+       }
+}
+
+static void
+free_stuff(Display * display, mazestruct * mp)
+{
+       if (mp->cmap != None) {
+               XFreeColormap(display, mp->cmap);
+               if (mp->backGC != None) {
+                       XFreeGC(display, mp->backGC);
+                       mp->backGC = None;
+               }
+               mp->cmap = None;
+       } else
+               mp->backGC = None;
+}
+
+static void
+free_maze(Display * display, mazestruct * mp)
+{
+       free_path(mp);
+       if (mp->grayGC != None) {
+               XFreeGC(display, mp->grayGC);
+               mp->grayGC = None;
+       }
+       if (mp->graypix != None) {
+               XFreePixmap(display, mp->graypix);
+               mp->graypix = None;
+       }
+       free_stuff(display, mp);
+       if (mp->logo != None) {
+               destroyImage(&mp->logo, &mp->graphics_format);
+               mp->logo = None;
+       }
+}
+
+static Bool
+set_maze_sizes(ModeInfo * mi)
+{
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+       Display *display = MI_DISPLAY(mi);
+       int         size = MI_SIZE(mi);
+
+       if (size < -MINSIZE) {
+               free_path(mp);
+               mp->ys = NRAND(MIN(-size, MAX(MINSIZE, (MIN(mp->width, mp->height) - 1) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+       } else if (size < MINSIZE) {
+               if (!size)
+                       mp->ys = MAX(MINSIZE, (MIN(mp->width, mp->height) - 1) / MINGRIDSIZE);
+               else
+                       mp->ys = MINSIZE;
+       } else
+               mp->ys = MIN(size, MAX(MINSIZE, (MIN(mp->width, mp->height) - 1) /
+                                      MINGRIDSIZE));
+       mp->xs = mp->ys;
+       mp->logo_size_x = mp->logo->width / mp->xs + 1;
+       mp->logo_size_y = mp->logo->height / mp->ys + 1;
+
+       mp->ncols = MAX((mp->width - 1) / mp->xs, MINGRIDSIZE);
+       mp->nrows = MAX((mp->height - 1) / mp->ys, MINGRIDSIZE);
+
+       mp->xb = (mp->width - mp->ncols * mp->xs) / 2;
+       mp->yb = (mp->height - mp->nrows * mp->ys) / 2;
+       mp->maze_size = mp->ncols * mp->nrows;
+       if (!mp->maze)
+               if ((mp->maze = (unsigned short *) calloc(mp->maze_size,
+                                sizeof (unsigned short))) == NULL) {
+                       free_maze(display, mp);
+                       return False;
+               }
+       if (!mp->move_list)
+               if ((mp->move_list = (paths *) calloc(mp->maze_size,
+                               sizeof (paths))) == NULL) {
+                       free_maze(display, mp);
+                       return False;
+               }
+       if (!mp->save_path)
+               if ((mp->save_path = (paths *) calloc(mp->maze_size,
+                               sizeof (paths))) == NULL) {
+                       free_maze(display, mp);
+                       return False;
+               }
+       if (!mp->path)
+               if (( mp->path = (paths *) calloc(mp->maze_size,
+                               sizeof (paths))) == NULL) {
+                       free_maze(display, mp);
+                       return False;
+               }
+       return True;
+}                              /* end of set_maze_sizes */
+
+
+static void
+initialize_maze(ModeInfo * mi)
+{                              /* draw the surrounding wall and start/end squares */
+       Display    *display = MI_DISPLAY(mi);
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+       register int i, j, wall;
+
+       if (MI_NPIXELS(mi) <= 2) {
+               mp->color = MI_WHITE_PIXEL(mi);
+       } else {
+               mp->color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       }
+       XSetForeground(display, mp->backGC, mp->color);
+       XSetForeground(display, mp->grayGC, mp->color);
+       /* initialize all squares */
+       for (i = 0; i < mp->ncols; i++) {
+               for (j = 0; j < mp->nrows; j++) {
+                       mp->maze[i * mp->nrows + j] = 0;
+               }
+       }
+
+       /* top wall */
+       for (i = 0; i < mp->ncols; i++) {
+               mp->maze[i * mp->nrows] |= WALL_TOP;
+       }
+
+       /* right wall */
+       for (j = 0; j < mp->nrows; j++) {
+               mp->maze[(mp->ncols - 1) * mp->nrows + j] |= WALL_RIGHT;
+       }
+
+       /* bottom wall */
+       for (i = 0; i < mp->ncols; i++) {
+               mp->maze[i * mp->nrows + mp->nrows - 1] |= WALL_BOTTOM;
+       }
+
+       /* left wall */
+       for (j = 0; j < mp->nrows; j++) {
+               mp->maze[j] |= WALL_LEFT;
+       }
+
+       /* set start square */
+       wall = NRAND(4);
+       switch (wall) {
+               case 0:
+                       i = NRAND(mp->ncols);
+                       j = 0;
+                       break;
+               case 1:
+                       i = mp->ncols - 1;
+                       j = NRAND(mp->nrows);
+                       break;
+               case 2:
+                       i = NRAND(mp->ncols);
+                       j = mp->nrows - 1;
+                       break;
+               case 3:
+                       i = 0;
+                       j = NRAND(mp->nrows);
+                       break;
+       }
+       mp->maze[i * mp->nrows + j] |= START_SQUARE;
+       mp->maze[i * mp->nrows + j] |= (DOOR_IN_TOP >> wall);
+       mp->maze[i * mp->nrows + j] &= ~(WALL_TOP >> wall);
+       mp->cur_sq_x = i;
+       mp->cur_sq_y = j;
+       mp->start_x = i;
+       mp->start_y = j;
+       mp->start_dir = wall;
+       mp->sqnum = 0;
+
+       /* set end square */
+       wall = (wall + 2) % 4;
+       switch (wall) {
+               case 0:
+                       i = NRAND(mp->ncols);
+                       j = 0;
+                       break;
+               case 1:
+                       i = mp->ncols - 1;
+                       j = NRAND(mp->nrows);
+                       break;
+               case 2:
+                       i = NRAND(mp->ncols);
+                       j = mp->nrows - 1;
+                       break;
+               case 3:
+                       i = 0;
+                       j = NRAND(mp->nrows);
+                       break;
+       }
+       mp->maze[i * mp->nrows + j] |= END_SQUARE;
+       mp->maze[i * mp->nrows + j] |= (DOOR_OUT_TOP >> wall);
+       mp->maze[i * mp->nrows + j] &= ~(WALL_TOP >> wall);
+       mp->end_x = i;
+       mp->end_y = j;
+       mp->end_dir = wall;
+
+       /* set logo */
+       if ((mp->ncols > mp->logo_size_x + 6) &&
+           (mp->nrows > mp->logo_size_y + 6)) {
+               mp->logo_x = NRAND(mp->ncols - mp->logo_size_x - 6) + 3;
+               mp->logo_y = NRAND(mp->nrows - mp->logo_size_y - 6) + 3;
+
+               for (i = 0; i < mp->logo_size_x; i++)
+                       for (j = 0; j < mp->logo_size_y; j++)
+                               mp->maze[(mp->logo_x + i) * mp->nrows + mp->logo_y + j] |=
+                                       DOOR_IN_TOP;
+       } else
+               mp->logo_y = mp->logo_x = -1;
+}
+
+static int
+choose_door(ModeInfo * mi)
+{                              /* pick a new path */
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+       int         candidates[3];
+       register int num_candidates;
+
+       num_candidates = 0;
+
+       /* top wall */
+       if ((!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_IN_TOP)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_OUT_TOP)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              WALL_TOP))) {
+               if (mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y - 1] &
+                   DOOR_IN_ANY) {
+                       mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] |= WALL_TOP;
+                       mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y - 1] |=
+                               WALL_BOTTOM;
+               } else
+                       candidates[num_candidates++] = 0;
+       }
+       /* right wall */
+       if ((!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_IN_RIGHT)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_OUT_RIGHT)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              WALL_RIGHT))) {
+               if (mp->maze[(mp->cur_sq_x + 1) * mp->nrows + mp->cur_sq_y] &
+                   DOOR_IN_ANY) {
+                       mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] |= WALL_RIGHT;
+                       mp->maze[(mp->cur_sq_x + 1) * mp->nrows + mp->cur_sq_y] |=
+                               WALL_LEFT;
+               } else
+                       candidates[num_candidates++] = 1;
+       }
+       /* bottom wall */
+       if ((!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_IN_BOTTOM)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_OUT_BOTTOM)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              WALL_BOTTOM))) {
+               if (mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y + 1] &
+                   DOOR_IN_ANY) {
+                       mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] |= WALL_BOTTOM;
+                       mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y + 1] |= WALL_TOP;
+               } else
+                       candidates[num_candidates++] = 2;
+       }
+       /* left wall */
+       if ((!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_IN_LEFT)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              DOOR_OUT_LEFT)) &&
+           (!(mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] &
+              WALL_LEFT))) {
+               if (mp->maze[(mp->cur_sq_x - 1) * mp->nrows + mp->cur_sq_y] &
+                   DOOR_IN_ANY) {
+                       mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] |= WALL_LEFT;
+                       mp->maze[(mp->cur_sq_x - 1) * mp->nrows + mp->cur_sq_y] |=
+                               WALL_RIGHT;
+               } else
+                       candidates[num_candidates++] = 3;
+       }
+       /* done wall */
+       if (num_candidates == 0)
+               return (-1);
+       if (num_candidates == 1)
+               return (candidates[0]);
+       return (candidates[NRAND(num_candidates)]);
+
+}                              /* end of choose_door() */
+
+static void
+draw_maze_walls(ModeInfo * mi)
+{                              /* pick a new path */
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+       int         i, j, isize;
+
+       MI_IS_DRAWN(mi) = True;
+
+       for (i = 0; i < mp->ncols; i++) {
+               isize = i * mp->nrows;
+               for (j = 0; j < mp->nrows; j++) {
+                       /* Only need to draw half the walls... since they are shared */
+                       /* top wall */
+                       if (    /*(!(mp->maze[isize + j] & DOOR_IN_TOP)) &&
+                                  (!(mp->maze[isize + j] & DOOR_OUT_TOP)) && */
+                                  (mp->maze[isize + j] & WALL_TOP))
+                               draw_wall(mi, i, j, 0);
+                       /* left wall */
+                       if (    /*(!(mp->maze[isize + j] & DOOR_IN_RIGHT)) &&
+                                  (!(mp->maze[isize + j] & DOOR_OUT_RIGHT)) && */
+                                  (mp->maze[isize + j] & WALL_RIGHT))
+                               draw_wall(mi, i, j, 1);
+               }
+       }
+}                              /* end of draw_maze_walls() */
+
+static int
+backup(mazestruct * mp)
+{                              /* back up a move */
+       mp->sqnum--;
+       if (mp->sqnum >= 0) {
+               mp->cur_sq_x = mp->move_list[mp->sqnum].x;
+               mp->cur_sq_y = mp->move_list[mp->sqnum].y;
+       }
+       return (mp->sqnum);
+}                              /* end of backup() */
+
+static void
+create_maze_walls(ModeInfo * mi)
+{                              /* create a maze layout given the intiialized maze */
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+       register int i, newdoor;
+
+       for (;;) {
+               mp->move_list[mp->sqnum].x = mp->cur_sq_x;
+               mp->move_list[mp->sqnum].y = mp->cur_sq_y;
+               mp->move_list[mp->sqnum].dir = -1;
+               while ((newdoor = choose_door(mi)) == -1)       /* pick a door */
+                       if (backup(mp) == -1)   /* no more doors ... backup */
+                               return;         /* done ... return */
+
+               /* mark the out door */
+               mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] |=
+                       (DOOR_OUT_TOP >> newdoor);
+
+               switch (newdoor) {
+                       case 0:
+                               mp->cur_sq_y--;
+                               break;
+                       case 1:
+                               mp->cur_sq_x++;
+                               break;
+                       case 2:
+                               mp->cur_sq_y++;
+                               break;
+                       case 3:
+                               mp->cur_sq_x--;
+                               break;
+               }
+               mp->sqnum++;
+
+               /* mark the in door */
+               mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] |=
+                       (DOOR_IN_TOP >> ((newdoor + 2) % 4));
+
+               /* if end square set path length and save path */
+               if (mp->maze[mp->cur_sq_x * mp->nrows + mp->cur_sq_y] & END_SQUARE) {
+                       mp->path_length = mp->sqnum;
+                       for (i = 0; i < mp->path_length; i++) {
+                               mp->save_path[i].x = mp->move_list[i].x;
+                               mp->save_path[i].y = mp->move_list[i].y;
+                               mp->save_path[i].dir = mp->move_list[i].dir;
+                       }
+               }
+       }
+
+}                              /* end of create_maze_walls() */
+
+static void
+draw_maze_border(ModeInfo * mi)
+{                              /* draw the maze outline */
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+       GC          gc = mp->backGC;
+       register int i, j;
+
+       if (mp->logo_x != -1) {
+               (void) XPutImage(display, window, gc, mp->logo,
+                                0, 0,
+                                mp->xb + mp->xs * mp->logo_x +
+                       (mp->xs * mp->logo_size_x - mp->logo->width + 1) / 2,
+                                mp->yb + mp->ys * mp->logo_y +
+                      (mp->ys * mp->logo_size_y - mp->logo->height + 1) / 2,
+                                mp->logo->width, mp->logo->height);
+       }
+       for (i = 0; i < mp->ncols; i++) {
+               if (mp->maze[i * mp->nrows] & WALL_TOP) {
+                       XDrawLine(display, window, gc,
+                                 mp->xb + mp->xs * i, mp->yb,
+                                 mp->xb + mp->xs * (i + 1), mp->yb);
+               }
+               if ((mp->maze[i * mp->nrows + mp->nrows - 1] & WALL_BOTTOM)) {
+                       XDrawLine(display, window, gc,
+                                 mp->xb + mp->xs * i,
+                                 mp->yb + mp->ys * (mp->nrows),
+                                 mp->xb + mp->xs * (i + 1),
+                                 mp->yb + mp->ys * (mp->nrows));
+               }
+       }
+       for (j = 0; j < mp->nrows; j++) {
+               if (mp->maze[(mp->ncols - 1) * mp->nrows + j] & WALL_RIGHT) {
+                       XDrawLine(display, window, gc,
+                                 mp->xb + mp->xs * mp->ncols,
+                                 mp->yb + mp->ys * j,
+                                 mp->xb + mp->xs * mp->ncols,
+                                 mp->yb + mp->ys * (j + 1));
+               }
+               if (mp->maze[j] & WALL_LEFT) {
+                       XDrawLine(display, window, gc,
+                                 mp->xb, mp->yb + mp->ys * j,
+                                 mp->xb, mp->yb + mp->ys * (j + 1));
+               }
+       }
+
+       draw_solid_square(mi, gc, mp->start_x, mp->start_y, mp->start_dir);
+       draw_solid_square(mi, gc, mp->end_x, mp->end_y, mp->end_dir);
+}                              /* end of draw_maze() */
+
+static void
+solve_maze(ModeInfo * mi)
+{                              /* solve it with graphical feedback */
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+
+       if (!mp->solving) {
+               /* plug up the surrounding wall */
+               mp->maze[mp->start_x * mp->nrows + mp->start_y] |=
+                       (WALL_TOP >> mp->start_dir);
+               mp->maze[mp->end_x * mp->nrows + mp->end_y] |=
+                       (WALL_TOP >> mp->end_dir);
+
+               /* initialize search path */
+               mp->current_path = 0;
+               mp->path[mp->current_path].x = mp->end_x;
+               mp->path[mp->current_path].y = mp->end_y;
+               mp->path[mp->current_path].dir = -1;
+
+               mp->solving = 1;
+       }
+       if (++mp->path[mp->current_path].dir >= 4) {
+               /* This draw is to fill in the dead ends,
+                  it ends up drawing more gray boxes then it needs to. */
+               draw_solid_square(mi, mp->grayGC,
+                                 (int) (mp->path[mp->current_path].x),
+                                 (int) (mp->path[mp->current_path].y),
+                        (int) (mp->path[mp->current_path - 1].dir + 2) % 4);
+
+               mp->current_path--;
+               draw_solid_square(mi, mp->grayGC,
+                                 (int) (mp->path[mp->current_path].x),
+                                 (int) (mp->path[mp->current_path].y),
+                                 (int) (mp->path[mp->current_path].dir));
+       } else if (!(mp->maze[mp->path[mp->current_path].x * mp->nrows +
+                             mp->path[mp->current_path].y] &
+                    (WALL_TOP >> mp->path[mp->current_path].dir)) &&
+                  ((mp->current_path == 0) ||
+                   ((mp->path[mp->current_path].dir !=
+                     (unsigned char) (mp->path[mp->current_path - 1].dir +
+                                      2) % 4)))) {
+               enter_square(mi, mp->current_path);
+               mp->current_path++;
+               if (mp->maze[mp->path[mp->current_path].x * mp->nrows +
+                            mp->path[mp->current_path].y] & START_SQUARE) {
+                       mp->solving = 0;
+                       return;
+               }
+       }
+}                              /* end of solve_maze() */
+
+static Bool
+init_stuff(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       mazestruct *mp = &mazes[MI_SCREEN(mi)];
+
+       if (mp->logo == None) {
+               getImage(mi, &mp->logo, ICON_WIDTH, ICON_HEIGHT, ICON_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                        DEFAULT_XPM, ICON_NAME,
+#endif
+                        &mp->graphics_format, &mp->cmap, &mp->black);
+               if (mp->logo == None) {
+                       free_maze(display, mp);
+                       return False;
+               }
+       }
+#ifndef STANDALONE
+       if (mp->cmap != None) {
+               setColormap(display, window, mp->cmap, MI_IS_INWINDOW(mi));
+               if (mp->backGC == None) {
+                       XGCValues   xgcv;
+
+                       xgcv.background = mp->black;
+                       if ((mp->backGC = XCreateGC(display, window, GCBackground,
+                                        &xgcv)) == None) {
+                               free_maze(display, mp);
+                               return False;
+                       }
+               }
+       } else
+#endif /* STANDALONE */
+       {
+               mp->black = MI_BLACK_PIXEL(mi);
+               mp->backGC = MI_GC(mi);
+       }
+       return True;
+}
+
+void
+init_maze(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       mazestruct *mp;
+
+       if (mazes == NULL) {
+               if ((mazes = (mazestruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (mazestruct))) == NULL)
+                       return;
+       }
+       mp = &mazes[MI_SCREEN(mi)];
+
+       if (!init_stuff(mi))
+               return;
+
+       mp->width = MI_WIDTH(mi);
+       mp->height = MI_HEIGHT(mi);
+       mp->width = (mp->width >= 32) ? mp->width : 32;
+       mp->height = (mp->height >= 32) ? mp->height : 32;
+
+       if (mp->graypix == None)
+               if ((mp->graypix = XCreateBitmapFromData(display, MI_WINDOW(mi),
+                            (char *) gray1_bits, gray1_width, gray1_height)) == None) {
+                       free_maze(display, mp);
+                       return;
+               }
+       if (!mp->grayGC) {
+               if ((mp->grayGC = XCreateGC(display, MI_WINDOW(mi),
+                                0L, (XGCValues *) 0)) == None) {
+                       free_maze(display, mp);
+                       return;
+               }
+               XSetBackground(display, mp->grayGC, mp->black);
+               XSetFillStyle(display, mp->grayGC, FillOpaqueStippled);
+               XSetStipple(display, mp->grayGC, mp->graypix);
+       }
+       mp->solving = 0;
+       mp->stage = 0;
+       mp->time = 0;
+       mp->cycles = MI_CYCLES(mi);
+       if (mp->cycles < 4)
+               mp->cycles = 4;
+}
+
+void
+draw_maze(ModeInfo * mi)
+{
+       mazestruct *mp;
+
+       if (mazes == NULL)
+               return;
+       mp = &mazes[MI_SCREEN(mi)];
+       if (mp->graypix == None)
+               return;
+       if (mp->solving) {
+               solve_maze(mi);
+               return;
+       }
+       switch (mp->stage) {
+               case 0:
+                       MI_CLEARWINDOWCOLORMAP(mi, mp->backGC, mp->black);
+
+                       if (!set_maze_sizes(mi))
+                               return;
+                       initialize_maze(mi);
+                       create_maze_walls(mi);
+                       mp->stage++;
+                       break;
+               case 1:
+                       draw_maze_border(mi);
+                       mp->stage++;
+                       break;
+               case 2:
+                       draw_maze_walls(mi);
+                       mp->stage++;
+                       break;
+               case 3:
+                       if (++mp->time > mp->cycles / 4)
+                               mp->stage++;
+                       break;
+               case 4:
+                       solve_maze(mi);
+                       mp->stage++;
+                       break;
+               case 5:
+                       if (++mp->time > 3 * mp->cycles / 4)
+                               init_maze(mi);
+                       break;
+       }
+}                              /*  end of draw_maze() */
+
+void
+release_maze(ModeInfo * mi)
+{
+       if (mazes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_maze(MI_DISPLAY(mi), &mazes[screen]);
+               (void) free((void *) mazes);
+               mazes = NULL;
+       }
+}
+
+void
+refresh_maze(ModeInfo * mi)
+{
+       mazestruct *mp;
+
+       if (mazes == NULL)
+               return;
+       mp = &mazes[MI_SCREEN(mi)];
+       if (mp->graypix == None)
+               return;
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       if (mp->graphics_format >= IS_XPM) {
+               /* This is needed when another program changes the colormap. */
+               free_maze(MI_DISPLAY(mi), mp);
+               init_maze(mi);
+               return;
+       }
+#endif
+       MI_CLEARWINDOWCOLORMAP(mi, mp->backGC, mp->black);
+       XSetForeground(MI_DISPLAY(mi), mp->backGC, mp->color);
+       if (mp->stage >= 1) {
+               mp->stage = 3;
+               mp->sqnum = 0;
+               mp->cur_sq_x = mp->start_x;
+               mp->cur_sq_y = mp->start_y;
+               mp->maze[mp->start_x * mp->nrows + mp->start_y] |= START_SQUARE;
+               mp->maze[mp->start_x * mp->nrows + mp->start_y] |=
+                       (DOOR_IN_TOP >> mp->start_dir);
+               mp->maze[mp->start_x * mp->nrows + mp->start_y] &=
+                       ~(WALL_TOP >> mp->start_dir);
+               mp->maze[mp->end_x * mp->nrows + mp->end_y] |= END_SQUARE;
+               mp->maze[mp->end_x * mp->nrows + mp->end_y] |=
+                       (DOOR_OUT_TOP >> mp->end_dir);
+               mp->maze[mp->end_x * mp->nrows + mp->end_y] &=
+                       ~(WALL_TOP >> mp->end_dir);
+               draw_maze_border(mi);
+               draw_maze_walls(mi);
+       }
+       mp->solving = 0;
+}
+
+#endif /* MODE_maze */
diff --git a/modes/mountain.c b/modes/mountain.c
new file mode 100644 (file)
index 0000000..ecae0d9
--- /dev/null
@@ -0,0 +1,291 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* mountain -- square grid mountains */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)mountain.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 Pascal Pensa <pensa@aurora.unice.fr>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 1995: Written
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Mountain"
+#define HACK_INIT init_mountain
+#define HACK_DRAW draw_mountain
+#define mountain_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*count: 30 \n" \
+ "*cycles: 4000 \n" \
+ "*ncolors: 64 \n" \
+ "*wireframe: False \n" \
+ "*fullrandom: False \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_mountain
+
+ModeSpecOpt mountain_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   mountain_description =
+{"mountain", "init_mountain", "draw_mountain", "release_mountain",
+ "refresh_mountain", "init_mountain", NULL, &mountain_opts,
+ 1000, 30, 4000, 1, 64, 1.0, "",
+ "Shows Papo's mountain range", 0, NULL};
+
+#endif
+
+/* ~ 5000 Max mountain height (1000 - 10000) */
+#define MAXHEIGHT  (3 * (mp->width + mp->height))
+
+#define WORLDWIDTH 50          /* World size x * y */
+
+#define RANGE_RAND(min,max) ((min) + NRAND((max) - (min)))
+
+typedef struct {
+       int         pixelmode;
+       int         width;
+       int         height;
+       int         x, y;
+       int         offset;
+       int         stage;
+       int         h[WORLDWIDTH][WORLDWIDTH];
+       long        time;       /* up time */
+       Bool        wireframe;
+       Bool        joke;
+       GC          stippledGC;
+} mountainstruct;
+
+static mountainstruct *mountains = NULL;
+
+static void
+spread(int  (*m)[50], int x, int y)
+{
+       int         x2, y2;
+       int         h = m[x][y];
+
+       for (y2 = y - 1; y2 <= y + 1; y2++)
+               for (x2 = x - 1; x2 <= x + 1; x2++)
+                       if (x2 >= 0 && y2 >= 0 && x2 < WORLDWIDTH && y2 < WORLDWIDTH)
+                               m[x2][y2] = (m[x2][y2] + h) / 2;
+}
+
+static void
+drawamountain(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       mountainstruct *mp = &mountains[MI_SCREEN(mi)];
+       int         x2, y2, x3, y3, y4, y5, c = 0;
+       XPoint      p[5];
+
+       if (MI_NPIXELS(mi) > 2) {
+               c = (mp->h[mp->x][mp->y] + mp->h[mp->x + 1][mp->y] +
+                 mp->h[mp->x][mp->y + 1] + mp->h[mp->x + 1][mp->y + 1]) / 4;
+               c = (c / 10 + mp->offset) % MI_NPIXELS(mi);
+       }
+       x2 = mp->x * (2 * mp->width) / (3 * WORLDWIDTH);
+       y2 = mp->y * (2 * mp->height) / (3 * WORLDWIDTH);
+       p[0].x = (x2 - y2 / 2) + (mp->width / 4);
+       p[0].y = (y2 - mp->h[mp->x][mp->y]) + mp->height / 4;
+
+       x3 = (mp->x + 1) * (2 * mp->width) / (3 * WORLDWIDTH);
+       y3 = mp->y * (2 * mp->height) / (3 * WORLDWIDTH);
+       p[1].x = (x3 - y3 / 2) + (mp->width / 4);
+       p[1].y = (y3 - mp->h[mp->x + 1][mp->y]) + mp->height / 4;
+
+       y4 = (mp->y + 1) * (2 * mp->height) / (3 * WORLDWIDTH);
+       p[2].x = (x3 - y4 / 2) + (mp->width / 4);
+       p[2].y = (y4 - mp->h[mp->x + 1][mp->y + 1]) + mp->height / 4;
+
+       y5 = (mp->y + 1) * (2 * mp->height) / (3 * WORLDWIDTH);
+       p[3].x = (x2 - y5 / 2) + (mp->width / 4);
+       p[3].y = (y5 - mp->h[mp->x][mp->y + 1]) + mp->height / 4;
+
+       p[4].x = p[0].x;
+       p[4].y = p[0].y;
+
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, c));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       if (mp->joke) {
+               if ((Bool) (LRAND() & 1))
+                       XDrawLines(display, window, gc, p, 5, CoordModeOrigin);
+               else {
+                       XFillPolygon(display, window, gc, p, 4, Complex, CoordModeOrigin);
+                       if (!mp->pixelmode) {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XDrawLines(display, window, gc, p, 5, CoordModeOrigin);
+                       }
+               }
+       } else {
+               if (mp->wireframe) {
+                       XDrawLines(display, window, gc, p, 5, CoordModeOrigin);
+               } else {
+                       XFillPolygon(display, window, gc, p, 4, Complex, CoordModeOrigin);
+
+                       if (!mp->pixelmode) {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XDrawLines(display, window, gc, p, 5, CoordModeOrigin);
+                       }
+               }
+       }
+       mp->x++;
+       if (mp->x == WORLDWIDTH - 1) {
+               mp->y++;
+               mp->x = 0;
+       }
+       if (mp->y == WORLDWIDTH - 1)
+               mp->stage++;
+}
+
+void
+init_mountain(ModeInfo * mi)
+{
+       int         i, j, x, y;
+       XGCValues   gcv;
+       mountainstruct *mp;
+
+       if (mountains == NULL) {
+               if ((mountains = (mountainstruct *) calloc(MI_NUM_SCREENS(mi),
+                                          sizeof (mountainstruct))) == NULL)
+                       return;
+       }
+       mp = &mountains[MI_SCREEN(mi)];
+
+       mp->width = MI_WIDTH(mi);
+       mp->height = MI_HEIGHT(mi);
+       mp->pixelmode = (mp->width + mp->height < 200);
+       mp->stage = 0;
+       mp->time = 0;
+       mp->x = mp->y = 0;
+       if (MI_IS_FULLRANDOM(mi)) {
+               mp->joke = (Bool) (NRAND(10) == 0);
+               mp->wireframe = (Bool) (LRAND() & 1);
+       } else {
+               mp->joke = False;
+               mp->wireframe = MI_IS_WIREFRAME(mi);
+       }
+
+       if (mp->stippledGC == None) {
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((mp->stippledGC = XCreateGC(MI_DISPLAY(mi), MI_WINDOW(mi),
+                                         GCForeground | GCBackground, &gcv)) == None)
+                       return;
+       }
+       MI_CLEARWINDOW(mi);
+
+       for (y = 0; y < (int) WORLDWIDTH; y++)
+               for (x = 0; x < (int) WORLDWIDTH; x++)
+                       mp->h[x][y] = 0;
+
+       j = MI_COUNT(mi);
+       if (j < 0)
+               j = NRAND(-j) + 1;
+       for (i = 0; i < j; i++)
+               mp->h[RANGE_RAND(1, WORLDWIDTH - 1)][RANGE_RAND(1, WORLDWIDTH - 1)] =
+                       NRAND(MAXHEIGHT);
+
+       for (y = 0; y < WORLDWIDTH; y++)
+               for (x = 0; x < WORLDWIDTH; x++)
+                       spread(mp->h, x, y);
+
+       for (y = 0; y < WORLDWIDTH; y++)
+               for (x = 0; x < WORLDWIDTH; x++) {
+                       mp->h[x][y] = mp->h[x][y] + NRAND(10) - 5;
+                       if (mp->h[x][y] < 10)
+                               mp->h[x][y] = 0;
+               }
+
+       if (MI_NPIXELS(mi) > 2)
+               mp->offset = NRAND(MI_NPIXELS(mi));
+       else
+               mp->offset = 0;
+}
+
+void
+draw_mountain(ModeInfo * mi)
+{
+       mountainstruct *mp;
+
+       if (mountains == NULL)
+                       return;
+       mp = &mountains[MI_SCREEN(mi)];
+       if (mp->stippledGC == NULL)
+                       return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       switch (mp->stage) {
+               case 0:
+                       drawamountain(mi);
+                       break;
+               case 1:
+                       if (++mp->time > MI_CYCLES(mi))
+                               mp->stage++;
+                       break;
+               case 2:
+                       init_mountain(mi);
+                       break;
+       }
+}
+
+void
+release_mountain(ModeInfo * mi)
+{
+       if (mountains != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       mountainstruct *mp = &mountains[screen];
+
+                       if (mp->stippledGC)
+                               XFreeGC(MI_DISPLAY(mi), mp->stippledGC);
+               }
+               (void) free((void *) mountains);
+               mountains = NULL;
+       }
+}
+
+void
+refresh_mountain(ModeInfo * mi)
+{
+       mountainstruct *mp;
+
+       if (mountains == NULL)
+                       return;
+       mp = &mountains[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       mp->x = 0;
+       mp->y = 0;
+}
+
+#endif /* MODE_mountain */
diff --git a/modes/munch.c b/modes/munch.c
new file mode 100644 (file)
index 0000000..fc016b3
--- /dev/null
@@ -0,0 +1,267 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* munch --- munching squares */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)munch.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Tim Showalter <tjs@andrew.cmu.edu>
+ *
+ * Copyright 1997, Tim Showalter
+ * Permission is granted to copy, modify, and use this as long
+ * as this notice remains intact.  No warranties are expressed or implied.
+ * CMU Sucks.
+ *
+ * Some code stolen from / This is meant to work with
+ * xscreensaver, Copyright (c) 1992, 1995, 1996
+ * Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ */
+
+/*-
+ * Munching Squares is this simplistic, silly screen hack (according to
+ * HAKMEM, discovered by Jackson Wright in 1962) where you take Y = X XOR T
+ * and graph it over and over.  According to HAKMEM, it  takes 5 instructions
+ * of PDP-1 assembly.  This is a little more complicated than that, mostly X's
+ *  fault, but it does some other random things.
+ * http://www.inwap.com/pdp10/hbaker/hakmem/hacks.html#item146
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Munch"
+#define HACK_INIT init_munch
+#define HACK_DRAW draw_munch
+#define munch_opts xlockmore_opts
+#define DEFAULTS "*delay: 5000 \n" \
+ "*cycles: 7 \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_munch
+
+ModeSpecOpt munch_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   munch_description =
+{"munch", "init_munch", "draw_munch", "release_munch",
+ "init_munch", "init_munch", NULL, &munch_opts,
+ 5000, 1, 7, 1, 64, 1.0, "",
+ "Shows munching squares", 0, NULL};
+
+#endif
+
+#if DEBUG
+#include <assert.h>
+#endif
+
+/* flags for random things.  Must be < log2(random's maximum), incidentially. */
+#define SHIFT_KX (0x01)
+#define SHIFT_KT (0x02)
+#define SHIFT_KY (0x04)
+#define GRAV     (0x08)
+
+typedef struct {
+       int         width, height;
+       int         logminwidth;
+       int         logmaxwidth;
+       GC          gc;
+       int         thiswidth;
+       int         t;
+       int         atX, atY;
+       int         kX, kT, kY;
+       int         grav;
+} munchstruct;
+
+static munchstruct *munches = NULL;
+
+static void
+munchBit(ModeInfo * mi, int width,     /* pixels */
+        int atX, int atY,      /* pixels */
+        int kX, int kT, int kY,        /* pixels */
+        int grav /* 0 or not */ )
+{
+       munchstruct *mp = &munches[MI_SCREEN(mi)];
+
+       int         x, y;
+       int         drawX, drawY;
+
+#if 0
+       (void) fprintf(stderr, "Doing width %d at %d %d shift %d %d %d grav %d\n",
+                      width, atX, atY, kX, kT, kY, grav);
+#endif
+
+       for (x = 0; x < width; x++) {
+               /* figure out the next point */
+               y = ((x ^ ((mp->t + kT) % width)) + kY) % width;
+
+               drawX = ((x + kX) % width) + atX;
+               drawY = (grav ? y + atY : atY + width - 1 - y);
+
+               /* used to be bugs where it would draw partially offscreen.
+                  while that might be a pretty feature, I didn't want it to do
+                  that yet.  if these trigger, please let me know.
+                */
+#if DEBUG
+               assert(drawX >= 0 && drawX < MI_WIDTH(mi));
+               assert(drawY >= 0 && drawY < MI_HEIGHT(mi));
+#endif
+
+               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), mp->gc, drawX, drawY);
+               /* XXX may want to change this to XDrawPoints,
+                  but it's fast enough without it for the moment. */
+
+       }
+}
+
+/*
+ * dumb way to get # of digits in number.  Probably faster than actually
+ * doing a log and a division, maybe.
+ */
+static int
+dumb_log_2(int k)
+{
+       int         r = -1;
+
+       while (k > 0) {
+               k >>= 1;
+               r++;
+       }
+       return r;
+}
+
+void
+init_munch(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       munchstruct *mp;
+
+       if (munches == NULL) {
+               if ((munches = (munchstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (munchstruct))) == NULL)
+                       return;
+       }
+       mp = &munches[MI_SCREEN(mi)];
+
+       if (mp->gc == None) {
+               if ((mp->gc = XCreateGC(display, MI_WINDOW(mi),
+                            (unsigned long) 0, (XGCValues *) NULL)) == None)
+                       return;
+       }
+       mp->width = MI_WIDTH(mi);
+       mp->height = MI_HEIGHT(mi);
+
+       /* We need a square; limit on screen size? */
+       /* we want a power of 2 for the width or the munch doesn't fill up. */
+       mp->logmaxwidth = (int)
+               dumb_log_2((mp->height < mp->width) ? mp->height : mp->width);
+
+       XSetFunction(display, mp->gc, GXxor);
+
+       mp->logminwidth = MI_CYCLES(mi);
+       if (mp->logminwidth < 2 || MI_IS_ICONIC(mi))
+               mp->logminwidth = 2;
+
+       if (mp->logmaxwidth < mp->logminwidth)
+               mp->logmaxwidth = mp->logminwidth;
+
+       mp->t = 0;
+
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_munch(ModeInfo * mi)
+{
+       munchstruct *mp;
+
+       if (munches == NULL)
+               return;
+       mp = &munches[MI_SCREEN(mi)];
+       if (mp->gc == None)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (!mp->t) {           /* New one */
+               int         randflags = (int) LRAND();
+
+               /* choose size -- power of two */
+               mp->thiswidth = (int) (1 << (mp->logminwidth +
+                      (LRAND() % (1 + mp->logmaxwidth - mp->logminwidth))));
+
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(MI_DISPLAY(mi), mp->gc,
+                                      MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+               else            /* Xor'red so WHITE may not be appropriate */
+                       XSetForeground(MI_DISPLAY(mi), mp->gc, 1);
+
+               mp->atX = (int) (LRAND() %
+                                ((mp->width <= mp->thiswidth) ? 1 : mp->width - mp->thiswidth));
+               mp->atY = (int) (LRAND() %
+                                ((mp->height <= mp->thiswidth) ? 1 : mp->height - mp->thiswidth));
+
+               /* wrap-around by these values; no need to %
+                  as we end up doing that later anyway */
+               mp->kX = (int) ((randflags & SHIFT_KX) ? LRAND() % mp->thiswidth : 0);
+               mp->kT = (int) ((randflags & SHIFT_KT) ? LRAND() % mp->thiswidth : 0);
+               mp->kY = (int) ((randflags & SHIFT_KY) ? LRAND() % mp->thiswidth : 0);
+
+               /* set the gravity of the munch, or rather,
+                  which direction we draw stuff in. */
+               mp->grav = randflags & GRAV;
+       }
+       /* Finally draw this munching square. */
+       munchBit(mi,
+                mp->thiswidth, /* Width, in pixels */
+       /* draw at this location */
+                mp->atX, mp->atY, mp->kX, mp->kT, mp->kY, mp->grav);
+
+       mp->t++;
+       if (mp->t == mp->thiswidth)
+               mp->t = 0;
+}
+
+void
+release_munch(ModeInfo * mi)
+{
+       if (munches != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       munchstruct *mp = &munches[screen];
+
+                       if (mp->gc != NULL)
+                               XFreeGC(MI_DISPLAY(mi), mp->gc);
+               }
+               (void) free((void *) munches);
+               munches = NULL;
+       }
+}
+
+#endif /* MODE_munch */
diff --git a/modes/nose.c b/modes/nose.c
new file mode 100644 (file)
index 0000000..9f9221b
--- /dev/null
@@ -0,0 +1,913 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/*-
+ * nose --- a little guy with a big nose and a hat wanders around
+ *          spewing out messages
+ */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)nose.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 06-Jun-1997: Compatible with xscreensaver and now colorized (idea from
+ *              xscreensaver but colors are random).
+ * 27-Feb-1996: Added new ModeInfo arg to init and callback hooks.  Removed
+ *              references to onepause, now uses MI_PAUSE(mi) interface.
+ *              Ron Hitchens <ron@idiom.com>
+ * 10-Oct-1995: A better way of handling fortunes from a file, thanks to
+ *              Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+ * 21-Sep-1995: font option added, debugged for multiscreens
+ * 12-Aug-1995: xlock version
+ * 1992: xscreensaver version, noseguy (Jamie Zawinski <jwz@jwz.org>)
+ * 1990: X11 version, xnlock (Dan Heller <argv@sun.com>)
+ */
+
+/*-
+ * xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@mcom.com>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Nose"
+#define HACK_INIT init_nose
+#define HACK_DRAW draw_nose
+#define nose_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*ncolors: 64 \n" \
+ "*font: \n" \
+ "*text: \n" \
+ "*filename: \n" \
+ "*fortunefile: \n" \
+ "*program: \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_nose
+
+ModeSpecOpt nose_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   nose_description =
+{"nose", "init_nose", "draw_nose", "release_nose",
+ "refresh_nose", "init_nose", NULL, &nose_opts,
+ 100000, 1, 1, 1, 64, 1.0, "",
+ "Shows a man with a big nose runs around spewing out messages", 0, NULL};
+
+#endif
+
+#include "bitmaps/nose-hat.xbm"
+#include "bitmaps/nose-hatd.xbm"
+#include "bitmaps/nose-facef.xbm"
+#include "bitmaps/nose-faced.xbm"
+#include "bitmaps/nose-facel.xbm"
+#include "bitmaps/nose-facer.xbm"
+#include "bitmaps/nose-shoef.xbm"
+#include "bitmaps/nose-shoel.xbm"
+#include "bitmaps/nose-shoer.xbm"
+#include "bitmaps/nose-stepl.xbm"
+#include "bitmaps/nose-stepr.xbm"
+
+#define L 0
+#define R 1
+#define LSTEP 2
+#define RSTEP 3
+#define LF 4
+#define RF 5
+#define F 6
+#define D 7
+#define PIXMAPS 8
+#define PIXMAP_SIZE 64
+#define MOVE 0
+#define TALK 1
+#define FREEZE 2
+
+#ifndef USE_MB
+extern XFontStruct *getFont(Display * display);
+#else
+extern XFontSet getFontSet(Display * display);
+#endif
+extern char *getWords(int screen, int screens);
+extern int  isRibbon(void);
+
+typedef struct {
+       int         x, y, width, height;
+} window_rect;
+
+typedef struct {
+       int         xs, ys;
+       int         width, height;
+       GC          text_fg_gc, text_bg_gc, noseGC[PIXMAPS];
+       char       *words;
+       int         x, y;
+       int         tinymode;   /* walking or getting passwd */
+       int         length, dir, lastdir;
+       int         up;
+       int         busyLoop;
+       int         frames;
+       int         state;
+       Bool        talking;
+       window_rect s;
+       Pixmap      position[PIXMAPS];
+} nosestruct;
+
+static nosestruct *noses = NULL;
+
+#ifdef USE_MB
+static XFontSet mode_font = None;
+#else
+static XFontStruct *mode_font = None;
+#endif
+
+#ifdef USE_MB
+static int font_height(XFontSet f) {
+  XRectangle ink, log;
+  if (f == None) {
+       return 8;
+  } else {
+       XmbTextExtents(mode_font, "M¤¢", strlen("M¤¢"), &ink, &log);
+       return log.height;
+  }
+}
+#else
+#define font_height(f) ((f == None) ? 8 : f->ascent + f->descent)
+#endif
+
+#define LEFT 001
+#define RIGHT 002
+#define DOWN 004
+#define UP 010
+#define FRONT 020
+#define X_INCR 3
+#define Y_INCR 2
+#define YELLOW (MI_NPIXELS(mi) / 6)
+
+#define COPY(d,g,c,p,np,x,y,w,h) XSetForeground(d,g,c);\
+XSetStipple(d,g,p); XSetTSOrigin(d,g,x,y);\
+XFillRectangle(d,np,g,x,y,w,h)
+
+static void
+free_nose(Display *display, nosestruct *np)
+{
+       int         pix;
+
+       if (np->text_fg_gc != None) {
+               XFreeGC(display, np->text_fg_gc);
+           np->text_fg_gc = None;
+       }
+       if (np->text_bg_gc != None) {
+               XFreeGC(display, np->text_bg_gc);
+           np->text_bg_gc = None;
+       }
+       for (pix = 0; pix < PIXMAPS; pix++) {
+               if (np->position[pix] != None) {
+                       XFreePixmap(display, np->position[pix]);
+                       np->position[pix] = None;
+               }
+               if (np->noseGC[pix] != None) {
+                       XFreeGC(display, np->noseGC[pix]);
+                       np->noseGC[pix] = None;
+               }
+       }
+}
+
+static Bool
+pickClothes(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       nosestruct *np = &noses[MI_SCREEN(mi)];
+       XGCValues   gcv;
+       Pixmap      face_pix, hat_pix, shoe_pix, shoel_pix, shoer_pix;
+       unsigned long hat_color = (MI_NPIXELS(mi) <= 2) ?
+       MI_WHITE_PIXEL(mi) : MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       unsigned long face_color = (MI_NPIXELS(mi) <= 2) ?
+       MI_WHITE_PIXEL(mi) : MI_PIXEL(mi, (YELLOW));    /* Racism? */
+       unsigned long shoe_color = (MI_NPIXELS(mi) <= 2) ?
+       MI_WHITE_PIXEL(mi) : MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       int         i;
+
+       gcv.graphics_exposures = False;
+       gcv.foreground = MI_BLACK_PIXEL(mi);
+       gcv.background = MI_BLACK_PIXEL(mi);
+       for (i = 0; i < PIXMAPS; i++) {
+               if ((np->position[i] = XCreatePixmap(display, window,
+                               PIXMAP_SIZE, PIXMAP_SIZE, MI_DEPTH(mi))) == None)
+                       return False;
+               if ((np->noseGC[i] = XCreateGC(display, np->position[i],
+                               GCForeground | GCBackground | GCGraphicsExposures,
+                               &gcv)) == None)
+                       return False;
+               XFillRectangle(display, np->position[i], np->noseGC[i],
+                              0, 0, PIXMAP_SIZE, PIXMAP_SIZE);
+       }
+       XSetBackground(display, gc, MI_BLACK_PIXEL(mi));
+       XSetFillStyle(display, gc, FillStippled);
+       /* DOWN NOSE GUY */
+       if ((shoe_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_shoe_front_bits,
+                       nose_shoe_front_width, nose_shoe_front_height)) == None){
+               return False;
+       }
+       COPY(display, gc, shoe_color, shoe_pix, np->position[D],
+            (PIXMAP_SIZE - nose_shoe_front_width) / 2,
+            nose_hat_height + nose_face_front_height + 3,
+            nose_shoe_front_width, nose_shoe_front_height);
+       if ((face_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_face_down_bits,
+                       nose_face_down_width, nose_face_down_height)) == None) {
+               XFreePixmap(display, shoe_pix);
+               return False;
+       }
+       COPY(display, gc, face_color, face_pix, np->position[D],
+         (PIXMAP_SIZE - nose_face_down_width) / 2, nose_hat_down_height + 7,
+            nose_face_down_width, nose_face_down_height);
+       XFreePixmap(display, face_pix);
+       if ((hat_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_hat_down_bits,
+                       nose_hat_down_width, nose_hat_down_height)) == None) {
+               XFreePixmap(display, shoe_pix);
+               return False;
+       }
+       COPY(display, gc, hat_color, hat_pix, np->position[D],
+            (PIXMAP_SIZE - nose_hat_down_width) / 2, 7,
+            nose_hat_down_width, nose_hat_down_height);
+       XFreePixmap(display, hat_pix);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[D], gc,
+                              0, nose_hat_down_height + 6, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       /* FRONT NOSE GUY */
+       COPY(display, gc, shoe_color, shoe_pix, np->position[F],
+            (PIXMAP_SIZE - nose_shoe_front_width) / 2,
+            nose_hat_height + nose_face_front_height + 3,
+            nose_shoe_front_width, nose_shoe_front_height);
+       XFreePixmap(display, shoe_pix);
+       if ((hat_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_hat_bits,
+                       nose_hat_width, nose_hat_height)) == None) {
+               return False;
+       }
+       COPY(display, gc, hat_color, hat_pix, np->position[F],
+            (PIXMAP_SIZE - nose_hat_width) / 2, 4,
+            nose_hat_width, nose_hat_height);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[F], gc,
+                              0, nose_hat_height + 3, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       if ((face_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_face_front_bits,
+                       nose_face_front_width, nose_face_front_height)) == None) {
+               XFreePixmap(display, hat_pix);
+               return False;
+       }
+       COPY(display, gc, face_color, face_pix, np->position[F],
+            (PIXMAP_SIZE - nose_face_front_width) / 2, nose_hat_height + 1,
+            nose_face_front_width, nose_face_front_height);
+       /* FRONT LEFT NOSE GUY */
+       if ((shoel_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_shoe_left_bits,
+                       nose_shoe_left_width, nose_shoe_left_height)) == None) {
+               XFreePixmap(display, hat_pix);
+               XFreePixmap(display, face_pix);
+               return False;
+       }
+       COPY(display, gc, shoe_color, shoel_pix, np->position[LF],
+            (PIXMAP_SIZE - nose_shoe_left_width) / 2 - 4,
+            nose_hat_height + nose_face_front_height + 3,
+            nose_shoe_left_width, nose_shoe_left_height);
+       COPY(display, gc, hat_color, hat_pix, np->position[LF],
+            (PIXMAP_SIZE - nose_hat_width) / 2, 4,
+            nose_hat_width, nose_hat_height);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[LF], gc,
+                              0, nose_hat_height + 3, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       COPY(display, gc, face_color, face_pix, np->position[LF],
+            (PIXMAP_SIZE - nose_face_front_width) / 2, nose_hat_height + 1,
+            nose_face_front_width, nose_face_front_height);
+       /* FRONT RIGHT NOSE GUY */
+       if ((shoer_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_shoe_right_bits,
+                       nose_shoe_right_width, nose_shoe_right_height)) == None) {
+               XFreePixmap(display, hat_pix);
+               XFreePixmap(display, shoel_pix);
+               XFreePixmap(display, face_pix);
+               return False;
+       }
+       COPY(display, gc, shoe_color, shoer_pix, np->position[RF],
+            (PIXMAP_SIZE - nose_shoe_right_width) / 2 + 4,
+            nose_hat_height + nose_face_front_height + 3,
+            nose_shoe_right_width, nose_shoe_right_height);
+       COPY(display, gc, hat_color, hat_pix, np->position[RF],
+            (PIXMAP_SIZE - nose_hat_width) / 2, 4,
+            nose_hat_width, nose_hat_height);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[RF], gc,
+                              0, nose_hat_height + 3, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       COPY(display, gc, face_color, face_pix, np->position[RF],
+            (PIXMAP_SIZE - nose_face_front_width) / 2, nose_hat_height + 1,
+            nose_face_front_width, nose_face_front_height);
+       XFreePixmap(display, face_pix);
+       /* LEFT NOSE GUY */
+       COPY(display, gc, shoe_color, shoel_pix, np->position[L],
+            (PIXMAP_SIZE - nose_shoe_left_width) / 2 - 4,
+            nose_hat_height + nose_face_front_height + 3,
+            nose_shoe_left_width, nose_shoe_left_height);
+       XFreePixmap(display, shoel_pix);
+       COPY(display, gc, hat_color, hat_pix, np->position[L],
+            (PIXMAP_SIZE - nose_hat_width) / 2, 4,
+            nose_hat_width, nose_hat_height);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[L], gc,
+                              0, nose_hat_height + 3, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       if ((face_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_face_left_bits,
+                       nose_face_left_width, nose_face_left_height)) == None) {
+               XFreePixmap(display, hat_pix);
+               XFreePixmap(display, shoer_pix);
+               return False;
+       }
+       COPY(display, gc, face_color, face_pix, np->position[L],
+          (PIXMAP_SIZE - nose_face_left_width) / 2 - 4, nose_hat_height + 4,
+            nose_face_left_width, nose_face_left_height);
+       /* LEFT NOSE GUY STEPPING */
+       if ((shoel_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_step_left_bits,
+                       nose_step_left_width, nose_step_left_height)) == None) {
+               XFreePixmap(display, hat_pix);
+               XFreePixmap(display, face_pix);
+               XFreePixmap(display, shoer_pix);
+               return False;
+       }
+       COPY(display, gc, shoe_color, shoel_pix, np->position[LSTEP],
+            (PIXMAP_SIZE - nose_step_left_width) / 2,
+            nose_hat_height + nose_face_front_height - 1,
+            nose_step_left_width, nose_step_left_height);
+       XFreePixmap(display, shoel_pix);
+       COPY(display, gc, hat_color, hat_pix, np->position[LSTEP],
+            (PIXMAP_SIZE - nose_hat_width) / 2, 4,
+            nose_hat_width, nose_hat_height);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[LSTEP], gc,
+                              0, nose_hat_height + 3, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       COPY(display, gc, face_color, face_pix, np->position[LSTEP],
+          (PIXMAP_SIZE - nose_face_left_width) / 2 - 4, nose_hat_height + 4,
+            nose_face_left_width, nose_face_left_height);
+       XFreePixmap(display, face_pix);
+       /* RIGHT NOSE GUY */
+       if ((face_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_face_right_bits,
+                       nose_face_right_width, nose_face_right_height)) == None) {
+               XFreePixmap(display, hat_pix);
+               XFreePixmap(display, shoer_pix);
+               return False;
+       }
+       COPY(display, gc, shoe_color, shoer_pix, np->position[R],
+            (PIXMAP_SIZE - nose_shoe_right_width) / 2 + 4,
+            nose_hat_height + nose_face_front_height + 3,
+            nose_shoe_right_width, nose_shoe_right_height);
+       XFreePixmap(display, shoer_pix);
+       COPY(display, gc, hat_color, hat_pix, np->position[R],
+            (PIXMAP_SIZE - nose_hat_width) / 2, 4,
+            nose_hat_width, nose_hat_height);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[R], gc,
+                              0, nose_hat_height + 3, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       COPY(display, gc, face_color, face_pix, np->position[R],
+         (PIXMAP_SIZE - nose_face_right_width) / 2 + 4, nose_hat_height + 4,
+            nose_face_right_width, nose_face_right_height);
+       /* RIGHT NOSE GUY STEPPING */
+       if ((shoer_pix = XCreateBitmapFromData(display, window,
+                       (char *) nose_step_right_bits,
+                       nose_step_right_width, nose_step_right_height)) == None) {
+               XFreePixmap(display, face_pix);
+               XFreePixmap(display, hat_pix);
+               return False;
+       }
+       COPY(display, gc, shoe_color, shoer_pix, np->position[RSTEP],
+            (PIXMAP_SIZE - nose_step_right_width) / 2,
+            nose_hat_height + nose_face_front_height - 1,
+            nose_step_right_width, nose_step_right_height);
+       XFreePixmap(display, shoer_pix);
+       COPY(display, gc, hat_color, hat_pix, np->position[RSTEP],
+            (PIXMAP_SIZE - nose_hat_width) / 2, 4,
+            nose_hat_width, nose_hat_height);
+       XFreePixmap(display, hat_pix);
+       if (MI_NPIXELS(mi) <= 2) {
+               XSetFillStyle(display, gc, FillSolid);
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, np->position[RSTEP], gc,
+                              0, nose_hat_height + 3, PIXMAP_SIZE, 1);
+               XSetFillStyle(display, gc, FillStippled);
+       }
+       COPY(display, gc, face_color, face_pix, np->position[RSTEP],
+         (PIXMAP_SIZE - nose_face_right_width) / 2 + 4, nose_hat_height + 4,
+            nose_face_right_width, nose_face_right_height);
+       XFreePixmap(display, face_pix);
+       XSetFillStyle(display, gc, FillSolid);
+       return True;
+}
+
+static void
+walk(ModeInfo * mi, register int dir)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       nosestruct *np = &noses[MI_SCREEN(mi)];
+       register int incr = 0;
+
+       if (dir & (LEFT | RIGHT)) {     /* left/right movement (mabye up/down too) */
+               np->up = -np->up;       /* bouncing effect (even if hit a wall) */
+               if (dir & LEFT) {
+                       incr = X_INCR;
+                       np->frames = (np->up < 0) ? L : LSTEP;
+               } else {
+                       incr = -X_INCR;
+                       np->frames = (np->up < 0) ? R : RSTEP;
+               }
+               /* note that maybe neither UP nor DOWN is set! */
+               if (dir & UP && np->y > Y_INCR)
+                       np->y -= Y_INCR;
+               else if (dir & DOWN && np->y < np->height - np->ys)
+                       np->y += Y_INCR;
+       } else if (dir == UP) { /* Explicit up/down movement only (no left/right) */
+               np->y -= Y_INCR;
+               XCopyArea(display, np->position[F], window, np->noseGC[F],
+                         0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y);
+       } else if (dir == DOWN) {
+               np->y += Y_INCR;
+               XCopyArea(display, np->position[D], window, np->noseGC[D],
+                         0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y);
+       } else if (dir == FRONT && np->frames != F) {
+               if (np->up > 0)
+                       np->up = -np->up;
+               if (np->lastdir & LEFT)
+                       np->frames = LF;
+               else if (np->lastdir & RIGHT)
+                       np->frames = RF;
+               else
+                       np->frames = F;
+               XCopyArea(display, np->position[np->frames], window, np->noseGC[np->frames],
+                         0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y);
+       }
+       if (dir & LEFT)
+               while (--incr >= 0) {
+                       --np->x;
+                       XCopyArea(display, np->position[np->frames], window, np->noseGC[np->frames],
+                                 0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y + np->up);
+                       XFlush(display);
+       } else if (dir & RIGHT)
+               while (++incr <= 0) {
+                       ++np->x;
+                       XCopyArea(display, np->position[np->frames], window, np->noseGC[np->frames],
+                                 0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y + np->up);
+                       XFlush(display);
+               }
+       np->lastdir = dir;
+}
+
+static int
+think(ModeInfo * mi)
+{
+       nosestruct *np = &noses[MI_SCREEN(mi)];
+
+       if (LRAND() & 1)
+               walk(mi, FRONT);
+       if (LRAND() & 1) {
+               np->words = getWords(MI_SCREEN(mi), MI_NUM_SCREENS(mi));
+               return 1;
+       }
+       return 0;
+}
+
+#define MAXLINES 40
+#if 0
+#define MAXWIDTH BUFSIZ
+#else
+#define MAXWIDTH 170
+#endif
+
+/*-
+Strange but true:
+On an HP Pa-RISC with gcc MAXLINES * MAXWIDTH should be <=
+around 6800 (40 * 170) or
+
+as: /usr/tmp/cca####.s line#3364 [err#13]
+  (warning) Use of GR3 when frame>=8192 may cause conflict
+
+*/
+
+static void
+talk(ModeInfo * mi, Bool force_erase)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       nosestruct *np = &noses[MI_SCREEN(mi)];
+       int         width = 0, height, Y, Z, total = 0;
+       register char *p, *p2;
+       char        buf[BUFSIZ], args[MAXLINES][MAXWIDTH];
+#ifdef USE_MB
+       XRectangle ink, log;
+#endif
+
+       /* clear what we've written */
+       if (np->talking || force_erase) {
+               if (!np->talking)
+                       return;
+               XFillRectangle(display, window, np->text_bg_gc, np->s.x - 5, np->s.y - 5,
+                              np->s.width + 10, np->s.height + 10);
+               np->talking = False;
+               if (!force_erase)
+                       np->state = MOVE;
+               return;
+       }
+       np->talking = True;
+       walk(mi, FRONT);
+       p = strncpy(buf, np->words, BUFSIZ);
+       if (!(p2 = (char *) strchr(p, '\n')) || !p2[1]) {
+               (void) strncpy(args[0], np->words, MAXWIDTH - 1);
+               total = strlen(args[0]);
+               args[0][MAXWIDTH - 1] = '\0';
+               if (mode_font == None)
+                       width = 8;
+               else {
+#ifdef USE_MB
+                       XmbTextExtents(mode_font, np->words, total, &ink, &log);
+                       width = ink.width;
+#else
+                       width = XTextWidth(mode_font, np->words, total);
+#endif
+               }
+               height = 0;
+       } else
+               /* p2 now points to the first '\n' */
+               for (height = 0; p && height < MAXLINES; height++) {
+                       int         w;
+
+                       *p2 = 0;
+#ifdef USE_MB
+                       XmbTextExtents(mode_font, p, p2 - p, &ink, &log);
+                       if (mode_font != None && (w = log.width) > width)
+                         width = w;
+#else
+                       if (mode_font != None &&
+                                       (w = XTextWidth(mode_font, p, p2 - p)) > width)
+                               width = w;
+#endif
+                       total += p2 - p;        /* total chars; count to determine reading time */
+                       (void) strncpy(args[height], p, MAXWIDTH - 1);
+                       args[height][MAXWIDTH - 1] = '\0';
+                       p = p2 + 1;
+                       if (!(p2 = (char *) strchr(p, '\n')))
+                               break;
+               }
+
+       height++;
+       /*
+        * Figure out the height and width in imagepixels (height, width) extend the
+        * new box by 15 pixels on the sides (30 total) top and bottom.
+        */
+       np->s.width = width + 30;
+       np->s.height = height * font_height(mode_font) + 30;
+       if (np->x - np->s.width - 10 < 5)
+               np->s.x = 5;
+       else if ((np->s.x = np->x + 32 - (np->s.width + 15) / 2)
+                + np->s.width + 15 > np->width - 5)
+               np->s.x = np->width - 15 - np->s.width;
+       if (np->y - np->s.height - 10 < 5)
+               np->s.y = np->y + np->ys + 5;
+       else
+               np->s.y = np->y - 5 - np->s.height;
+
+       XFillRectangle(display, window, np->text_bg_gc,
+                      np->s.x, np->s.y, np->s.width, np->s.height);
+
+       /* make a box that's 5 pixels thick. Then add a thin box inside it */
+       XSetLineAttributes(display, np->text_fg_gc, 5, 0, 0, 0);
+       XDrawRectangle(display, window, np->text_fg_gc,
+                      np->s.x, np->s.y, np->s.width - 1, np->s.height - 1);
+       XSetLineAttributes(display, np->text_fg_gc, 0, 0, 0, 0);
+       XDrawRectangle(display, window, np->text_fg_gc,
+             np->s.x + 7, np->s.y + 7, np->s.width - 15, np->s.height - 15);
+
+       Y = 15 + font_height(mode_font);
+
+       /* now print each string in reverse order (start at bottom of box) */
+       for (Z = 0; Z < height; Z++) {
+#ifdef USE_MB
+               (void) XmbDrawString(display, window, mode_font, np->text_fg_gc,
+                        np->s.x + 15, np->s.y + Y, args[Z], strlen(args[Z]));
+#else
+               (void) XDrawString(display, window, np->text_fg_gc,
+                       np->s.x + 15, np->s.y + Y, args[Z], strlen(args[Z]));
+#endif
+               Y += font_height(mode_font);
+       }
+       np->busyLoop = (total / 15) * 10;
+       if (np->busyLoop < 30)
+               np->busyLoop = 30;
+       np->state = TALK;
+}
+
+static int
+look(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+
+       /*GC          gc = MI_GC(mi); */
+       nosestruct *np = &noses[MI_SCREEN(mi)];
+       int         i;
+
+       if (NRAND(3)) {
+               i = (LRAND() & 1) ? D : F;
+               XCopyArea(display, np->position[i], window, np->noseGC[i],
+                         0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y);
+               return 3;
+       }
+       if (!NRAND(5))
+               return 0;
+       if (NRAND(3)) {
+               i = (LRAND() & 1) ? LF : RF;
+               XCopyArea(display, np->position[i], window, np->noseGC[i],
+                         0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y);
+               return 3;
+       }
+       if (!NRAND(5))
+               return 0;
+       i = (LRAND() & 1) ? L : R;
+       XCopyArea(display, np->position[i], window, np->noseGC[i],
+                 0, 0, PIXMAP_SIZE, PIXMAP_SIZE, np->x, np->y);
+       return 3;
+}
+
+static void
+move(ModeInfo * mi)
+{
+       nosestruct *np = &noses[MI_SCREEN(mi)];
+
+       if (!np->length) {
+               register int tries = 0;
+
+               np->dir = 0;
+               if ((LRAND() & 1) && think(mi)) {
+                       talk(mi, False);        /* sets timeout to itself */
+                       return;
+               }
+               if (!NRAND(3) && (np->busyLoop = look(mi))) {
+                       np->state = MOVE;
+                       return;
+               }
+               np->busyLoop = 3 + NRAND(3);
+               do {
+                       if (!tries)
+                               np->length = np->width / 100 + NRAND(90), tries = 8;
+                       else
+                               tries--;
+                       switch (NRAND(8)) {
+                               case 0:
+                                       if (np->x - X_INCR * np->length >= 5)
+                                               np->dir = LEFT;
+                                       break;
+                               case 1:
+                                       if (np->x + X_INCR * np->length <= np->width - np->xs - 6)
+                                               np->dir = RIGHT;
+                                       break;
+                               case 2:
+                                       if (np->y - (Y_INCR * np->length) >= 5)
+                                               np->dir = UP;
+                                       break;
+                               case 3:
+                                       if (np->y + Y_INCR * np->length <= np->height - np->ys - 6)
+                                               np->dir = DOWN;
+                                       break;
+                               case 4:
+                                       if (np->x - X_INCR * np->length >= 5 &&
+                                         np->y - (Y_INCR * np->length) >= 5)
+                                               np->dir = (LEFT | UP);
+                                       break;
+                               case 5:
+                                       if (np->x + X_INCR * np->length <= np->width - np->xs - 6 &&
+                                           np->y - Y_INCR * np->length >= 5)
+                                               np->dir = (RIGHT | UP);
+                                       break;
+                               case 6:
+                                       if (np->x - X_INCR * np->length >= 5 &&
+                                           np->y + Y_INCR * np->length <= np->height - np->ys - 6)
+                                               np->dir = (LEFT | DOWN);
+                                       break;
+                               case 7:
+                                       if (np->x + X_INCR * np->length <= np->width - np->xs - 6 &&
+                                           np->y + Y_INCR * np->length <= np->height - np->ys - 6)
+                                               np->dir = (RIGHT | DOWN);
+                                       break;
+                               default:
+                                       /* No Defaults */
+                                       break;
+                       }
+               } while (!np->dir);
+       }
+       walk(mi, np->dir);
+       --np->length;
+       np->state = MOVE;
+}
+
+void
+init_nose(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       XGCValues   gcv;
+       nosestruct *np;
+
+       if (noses == NULL) {
+               if ((noses = (nosestruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (nosestruct))) == NULL)
+                       return;
+       }
+       np = &noses[MI_SCREEN(mi)];
+
+       np->width = MI_WIDTH(mi) + 2;
+       np->height = MI_HEIGHT(mi) + 2;
+       np->tinymode = (np->width + np->height < 4 * PIXMAP_SIZE);
+       np->xs = PIXMAP_SIZE;
+       np->ys = PIXMAP_SIZE;
+
+       MI_CLEARWINDOW(mi);
+
+       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       /* do not want any exposure events from XCopyPlane */
+       XSetGraphicsExposures(display, gc, False);
+
+       if (mode_font == None) {
+#ifdef USE_MB
+               mode_font = getFontSet(display);
+#else
+               mode_font = getFont(display);
+#endif
+       }
+       if (np->noseGC[0] == None)
+               if (!pickClothes(mi)) {
+                       free_nose(display, np);
+                       return;
+               }
+       np->words = getWords(MI_SCREEN(mi), MI_NUM_SCREENS(mi));
+       if (np->text_fg_gc == NULL && mode_font != None) {
+#ifndef USE_MB
+               gcv.font = mode_font->fid;
+               XSetFont(display, gc, mode_font->fid);
+#endif
+               gcv.graphics_exposures = False;
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((np->text_fg_gc = XCreateGC(display, window,
+#ifdef USE_MB
+                                GCForeground | GCBackground | GCGraphicsExposures,
+#else
+                                GCForeground | GCBackground | GCGraphicsExposures | GCFont,
+#endif
+                                &gcv)) == None) {
+                       free_nose(display, np);
+                       return;
+               }
+               gcv.foreground = MI_BLACK_PIXEL(mi);
+               gcv.background = MI_WHITE_PIXEL(mi);
+               if ((np->text_bg_gc = XCreateGC(display, window,
+#ifdef USE_MB
+                                GCForeground | GCBackground | GCGraphicsExposures,
+#else
+                                GCForeground | GCBackground | GCGraphicsExposures | GCFont,
+#endif
+                                &gcv)) == None) {
+                       free_nose(display, np);
+                       return;
+               }
+       }
+       np->up = 1;
+       if (np->tinymode) {
+               int pos = NRAND(PIXMAPS);
+
+               np->x = 0;
+               np->y = 0;
+               XCopyArea(display, np->position[pos], window, np->noseGC[pos],
+                         0, 0, PIXMAP_SIZE, PIXMAP_SIZE,
+                         (np->width - PIXMAP_SIZE) / 2,
+                         (np->height - PIXMAP_SIZE) / 2);
+               np->state = FREEZE;
+       } else {
+               np->x = np->width / 2;
+               np->y = np->height / 2;
+               np->state = MOVE;
+       }
+       XFlush(display);
+}
+
+void
+draw_nose(ModeInfo * mi)
+{
+       nosestruct *np;
+
+       if (noses == NULL)
+               return;
+       np = &noses[MI_SCREEN(mi)];
+       if (np->noseGC[0] == None)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (np->busyLoop > 0) {
+               np->busyLoop--;
+               return;
+       }
+       switch (np->state) {
+               case MOVE:
+                       move(mi);
+                       break;
+               case TALK:
+                       talk(mi, 0);
+                       break;
+       }
+}
+
+void
+release_nose(ModeInfo * mi)
+{
+       if (noses != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_nose(MI_DISPLAY(mi), &noses[screen]);
+               (void) free((void *) noses);
+               noses = NULL;
+       }
+       if (mode_font != None) {
+#ifdef USE_MB
+               XFreeFontSet(MI_DISPLAY(mi), mode_font);
+#else
+               XFreeFont(MI_DISPLAY(mi), mode_font);
+#endif
+               mode_font = None;
+       }
+}
+
+void
+refresh_nose(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_nose */
diff --git a/modes/pacman.c b/modes/pacman.c
new file mode 100644 (file)
index 0000000..60913fe
--- /dev/null
@@ -0,0 +1,817 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* pacman --- Mr. Pacman and his ghost friends */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)pacman.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by Heath Rice <rice@asl.dl.nec.com>.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 04-Jun-1997: Compatible with xscreensaver
+ *
+ */
+
+/*-
+ * [Pacman eats screen.  Ghosts put screen back.]
+ * Pacman eats ghosts when he encounters them.
+ * After all ghosts are eaten, pacman continues
+ * eating the screen until all of it is gone. Then
+ * it starts over.
+ * Food dots should be added.  Restart when done eating.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Pacman"
+#define HACK_INIT init_pacman
+#define HACK_DRAW draw_pacman
+#define pacman_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: 10 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 6 \n" \
+ "*bitmap: \n"
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_pacman
+
+ModeSpecOpt pacman_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   pacman_description =
+{"pacman", "init_pacman", "draw_pacman", "release_pacman",
+ "refresh_pacman", "init_pacman", NULL, &pacman_opts,
+ 100000, 10, 1, 0, 64, 1.0, "",
+ "Shows Pacman(tm)", 0, NULL};
+
+#endif
+
+/* aliases for vars defined in the bitmap file */
+#define CELL_WIDTH   image_width
+#define CELL_HEIGHT    image_height
+#define CELL_BITS    image_bits
+
+#include "ghost.xbm"
+
+#define MINGHOSTS 1
+#define MAXMOUTH 11
+#define MINGRIDSIZE 4
+#define MINSIZE 1
+#define NOWHERE 255
+
+#define NONE 0x0000
+#define LT   0x1000
+#define RT   0x0001
+#define RB   0x0010
+#define LB   0x0100
+#define ALL  0x1111
+
+#define YELLOW (MI_NPIXELS(mi) / 6)
+#define GREEN (23 * MI_NPIXELS(mi) / 64)
+#define BLUE (45 * MI_NPIXELS(mi) / 64)
+
+typedef struct {
+       int         col, row;
+       int         nextbox, lastbox, nextcol, nextrow;
+       int         dead;
+       int         mouthstage, mouthdirection;
+       /*int         color; */
+} beingstruct;
+
+typedef struct {
+       int         pixelmode;
+       int         width, height;
+       int         nrows, ncols;
+       int         xs, ys, xb, yb;
+       int         incx, incy;
+       GC          stippledGC;
+       Pixmap      ghostPixmap;
+       int         graphics_format;
+       beingstruct pacman;
+       beingstruct *ghosts;
+       int         nghosts;
+#ifdef DEFUNCT
+       unsigned int *eaten;
+#endif
+       Pixmap      pacmanPixmap[4][MAXMOUTH];
+} pacmangamestruct;
+
+static pacmangamestruct *pacmangames = NULL;
+
+static void
+free_pacman(Display *display, pacmangamestruct *pp)
+{
+       int         dir, mouth;
+
+       if (pp->ghosts != NULL) {
+               (void) free((void *) pp->ghosts);
+               pp->ghosts = NULL;
+       }
+#ifdef DEFUNCT
+       if (pp->eaten != NULL) {
+               (void) free((void *) pp->eaten);
+               pp->eaten = NULL;
+       }
+#endif
+       if (pp->stippledGC != None) {
+               XFreeGC(display, pp->stippledGC);
+               pp->stippledGC = None;
+       }
+       if (pp->ghostPixmap != None) {
+               XFreePixmap(display, pp->ghostPixmap);
+               pp->ghostPixmap = None;
+       }
+       for (dir = 0; dir < 4; dir++)
+               for (mouth = 0; mouth < MAXMOUTH; mouth++)
+                       if (pp->pacmanPixmap[dir][mouth] != None) {
+                               XFreePixmap(display, pp->pacmanPixmap[dir][mouth]);
+                               pp->pacmanPixmap[dir][mouth] = None;
+                       }
+}
+
+#if DEFUNCT
+static void
+clearcorners(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       Window      window = MI_WINDOW(mi);
+       pacmangamestruct *pp = &pacmangames[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, GREEN));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       if ((pp->pacman.nextrow == 0) && (pp->pacman.nextcol == 0)) {
+               XFillRectangle(display, window, gc, 0, 0,
+               ((pp->width / pp->ncols) / 2), ((pp->width / pp->ncols) / 2));
+               pp->eaten[(pp->pacman.nextcol * pp->nrows) + pp->pacman.nextrow] |=
+                       RT | LT | RB | LB;
+       } else if ((pp->pacman.nextrow == pp->nrows - 1) &&
+                  (pp->pacman.nextcol == 0)) {
+               XFillRectangle(display, window, gc,
+                    0, (pp->nrows * pp->ys) - ((pp->width / pp->ncols) / 2),
+               ((pp->width / pp->ncols) / 2), ((pp->width / pp->ncols) / 2));
+               pp->eaten[(pp->pacman.nextcol * pp->nrows) + pp->pacman.nextrow] |=
+                       RT | LT | RB | LB;
+       } else if ((pp->pacman.nextrow == 0) &&
+                  (pp->pacman.nextcol == pp->ncols - 1)) {
+               XFillRectangle(display, window, gc,
+                    (pp->ncols * pp->xs) - ((pp->width / pp->ncols) / 2), 0,
+               ((pp->width / pp->ncols) / 2), ((pp->width / pp->ncols) / 2));
+               pp->eaten[(pp->pacman.nextcol * pp->nrows) + pp->pacman.nextrow] |=
+                       RT | LT | RB | LB;
+       } else if ((pp->pacman.nextrow == pp->nrows - 1) &&
+                  (pp->pacman.nextcol == pp->ncols - 1)) {
+               XFillRectangle(display, window, gc,
+                       (pp->ncols * pp->xs) - ((pp->width / pp->ncols) / 2),
+                       (pp->nrows * pp->ys) - ((pp->width / pp->ncols) / 2),
+               ((pp->width / pp->ncols) / 2), ((pp->width / pp->ncols) / 2));
+               pp->eaten[(pp->pacman.nextcol * pp->nrows) + pp->pacman.nextrow] |=
+                       RT | LT | RB | LB;
+       }
+}
+#endif
+
+static void
+repopulate(ModeInfo * mi)
+{
+       pacmangamestruct *pp = &pacmangames[MI_SCREEN(mi)];
+       int         ghost;
+
+#if DEFUNCT
+       if (pp->eaten)
+               (void) free((void *) pp->eaten);
+       if ((pp->eaten = (unsigned int *) calloc((pp->nrows * pp->ncols),
+                       sizeof (unsigned int))) == NULL)
+               return;
+#endif
+
+       MI_CLEARWINDOW(mi);
+
+       for (ghost = 0; ghost < pp->nghosts; ghost++) {
+               do {
+                       pp->ghosts[ghost].col = NRAND(pp->ncols);
+                       pp->ghosts[ghost].row = NRAND(pp->nrows);
+                       if ((pp->ghosts[ghost].row + pp->ghosts[ghost].col) % 2 !=
+                           (pp->pacman.row + pp->pacman.col) % 2) {
+                               if (pp->ghosts[ghost].col != 0)
+                                       pp->ghosts[ghost].col--;
+                               else
+                                       pp->ghosts[ghost].col++;
+                       }
+               }
+               while ((pp->ghosts[ghost].col == pp->pacman.col) &&
+                      (pp->ghosts[ghost].row == pp->pacman.row));
+               pp->ghosts[ghost].dead = 0;
+               pp->ghosts[ghost].lastbox = -1;
+
+       }
+}
+
+static void
+movepac(ModeInfo * mi)
+{
+       typedef struct {
+               int         cfactor, rfactor;
+               int         cf, rf;
+               int         oldcf, oldrf;
+       } being;
+       being      *g, p;
+
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       pacmangamestruct *pp = &pacmangames[MI_SCREEN(mi)];
+       int         ghost, alldead, dir;
+       XPoint      delta;
+
+       if (pp->pacman.nextcol > pp->pacman.col) {
+               p.cfactor = 1;
+#if DEFUNCT
+               if (pp->eaten) {
+                       pp->eaten[(pp->pacman.col * pp->nrows) + pp->pacman.row] |=
+                               RT | RB;
+                       pp->eaten[((pp->pacman.col + 1) * pp->nrows) + pp->pacman.row] |=
+                               LT | LB;
+               }
+#endif
+       } else if (pp->pacman.col > pp->pacman.nextcol) {
+               p.cfactor = -1;
+#if DEFUNCT
+               if (pp->eaten) {
+                       pp->eaten[(pp->pacman.col * pp->nrows) + pp->pacman.row] |=
+                               LT | LB;
+                       pp->eaten[((pp->pacman.col - 1) * pp->nrows) + pp->pacman.row] |=
+                               RT | RB;
+               }
+#endif
+       } else {
+               p.cfactor = 0;
+       }
+
+       if (pp->pacman.nextrow > pp->pacman.row) {
+               p.rfactor = 1;
+#if DEFUNCT
+               if (pp->eaten) {
+                       pp->eaten[(pp->pacman.col * pp->nrows) + pp->pacman.row] |=
+                               RB | LB;
+                       pp->eaten[(pp->pacman.col * pp->nrows) + (pp->pacman.row + 1)] |=
+                               RT | LT;
+               }
+#endif
+       } else if (pp->pacman.row > pp->pacman.nextrow) {
+               p.rfactor = -1;
+#if DEFUNCT
+               if (pp->eaten) {
+                       pp->eaten[(pp->pacman.col * pp->nrows) + pp->pacman.row] |=
+                               RT | LT;
+                       pp->eaten[(pp->pacman.col * pp->nrows) + (pp->pacman.row - 1)] |=
+                               RB | LB;
+               }
+#endif
+       } else {
+               p.rfactor = 0;
+       }
+
+       p.oldcf = pp->pacman.col * pp->xs + pp->xb;
+       p.oldrf = pp->pacman.row * pp->ys + pp->yb;
+       if ((g = (being *) malloc(pp->nghosts * sizeof (being))) == NULL)
+               return;
+
+       for (ghost = 0; ghost < pp->nghosts; ghost++) {
+               if (pp->ghosts[ghost].dead == 0) {
+#if DEFUNCT
+                       pp->eaten[(pp->ghosts[ghost].col * pp->nrows) +
+                                 pp->ghosts[ghost].row] = NONE;
+#endif
+                       if (pp->ghosts[ghost].nextcol > pp->ghosts[ghost].col) {
+                               g[ghost].cfactor = 1;
+                       } else if (pp->ghosts[ghost].col > pp->ghosts[ghost].nextcol) {
+                               g[ghost].cfactor = -1;
+                       } else {
+                               g[ghost].cfactor = 0;
+                       }
+                       if (pp->ghosts[ghost].nextrow > pp->ghosts[ghost].row) {
+                               g[ghost].rfactor = 1;
+                       } else if (pp->ghosts[ghost].row > pp->ghosts[ghost].nextrow) {
+                               g[ghost].rfactor = -1;
+                       } else {
+                               g[ghost].rfactor = 0;
+                       }
+
+                       g[ghost].oldcf = pp->ghosts[ghost].col * pp->xs +
+                               pp->xb;
+                       g[ghost].oldrf = pp->ghosts[ghost].row * pp->ys +
+                               pp->yb;
+               }
+       }
+       for (delta.x = pp->incx, delta.y = pp->incy;
+            (delta.x < pp->xs + pp->incx) || (delta.y < pp->ys + pp->incy);
+            delta.x += pp->incx, delta.y += pp->incy) {
+               if (delta.x > pp->xs)
+                       delta.x = pp->xs;
+               if (delta.y > pp->ys)
+                       delta.y = pp->ys;
+               p.cf = pp->pacman.col * pp->xs + delta.x * p.cfactor + pp->xb;
+               p.rf = pp->pacman.row * pp->ys + delta.y * p.rfactor + pp->yb;
+
+               dir = (ABS(p.cfactor) * (2 - p.cfactor) +
+                      ABS(p.rfactor) * (1 + p.rfactor)) % 4;
+               XSetForeground(display, pp->stippledGC, MI_BLACK_PIXEL(mi));
+#ifdef FLASH
+               XFillRectangle(display, window, pp->stippledGC,
+                            p.oldcf, p.oldrf, pp->xs, pp->ys);
+#else
+               ERASE_IMAGE(display, window, pp->stippledGC, p.cf, p.rf,
+                           p.oldcf, p.oldrf, pp->xs, pp->ys);
+#endif
+               XSetTSOrigin(display, pp->stippledGC, p.cf, p.rf);
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, pp->stippledGC, MI_PIXEL(mi, YELLOW));
+               else
+                       XSetForeground(display, pp->stippledGC, MI_WHITE_PIXEL(mi));
+
+               XSetStipple(display, pp->stippledGC,
+                           pp->pacmanPixmap[dir][pp->pacman.mouthstage]);
+#ifdef FLASH
+               XSetFillStyle(display, pp->stippledGC, FillStippled);
+#else
+               XSetFillStyle(display, pp->stippledGC, FillOpaqueStippled);
+#endif
+               XFillRectangle(display, window, pp->stippledGC,
+                              p.cf, p.rf, pp->xs, pp->ys);
+               pp->pacman.mouthstage += pp->pacman.mouthdirection;
+               if ((pp->pacman.mouthstage >= MAXMOUTH) ||
+                   (pp->pacman.mouthstage < 0)) {
+                       pp->pacman.mouthdirection *= -1;
+                       pp->pacman.mouthstage += pp->pacman.mouthdirection * 2;
+               }
+               p.oldcf = p.cf;
+               p.oldrf = p.rf;
+
+               for (ghost = 0; ghost < pp->nghosts; ghost++) {
+                       if (!pp->ghosts[ghost].dead) {
+                               g[ghost].cf = pp->ghosts[ghost].col * pp->xs +
+                                       delta.x * g[ghost].cfactor + pp->xb;
+                               g[ghost].rf = pp->ghosts[ghost].row * pp->ys +
+                                       delta.y * g[ghost].rfactor + pp->yb;
+                               XSetForeground(display, pp->stippledGC, MI_BLACK_PIXEL(mi));
+#ifdef FLASH
+                               XFillRectangle(display, window, pp->stippledGC,
+                                   g[ghost].oldcf, g[ghost].oldrf, pp->xs, pp->ys);
+#else
+                               ERASE_IMAGE(display, window, pp->stippledGC,
+                                       g[ghost].cf, g[ghost].rf,
+                                       g[ghost].oldcf, g[ghost].oldrf, pp->xs, pp->ys);
+#endif
+                               XSetTSOrigin(display, pp->stippledGC,
+                                       g[ghost].cf, g[ghost].rf);
+                               if (MI_NPIXELS(mi) > 2)
+                                       XSetForeground(display, pp->stippledGC, MI_PIXEL(mi, BLUE));
+                               else
+                                       XSetForeground(display, pp->stippledGC, MI_WHITE_PIXEL(mi));
+                               XSetStipple(display, pp->stippledGC, pp->ghostPixmap);
+
+#ifdef FLASH
+                               XSetFillStyle(display, pp->stippledGC, FillStippled);
+#else
+                               XSetFillStyle(display, pp->stippledGC, FillOpaqueStippled);
+#endif
+                               XFillRectangle(display, window, pp->stippledGC,
+                              g[ghost].cf, g[ghost].rf, pp->xs, pp->ys);
+                               XFlush(display);
+                               g[ghost].oldcf = g[ghost].cf;
+                               g[ghost].oldrf = g[ghost].rf;
+                       }
+               }
+               XFlush(display);
+       }
+
+#if 0
+       clearcorners(mi);
+#endif
+       (void) free((void *) g);
+
+       alldead = 1;
+       for (ghost = 0; ghost < pp->nghosts; ghost++) {
+               if (pp->ghosts[ghost].dead == 0) {
+#if 0
+                       if ((pp->ghosts[ghost].nextrow >= pp->pacman.nextrow - 1) &&
+                           (pp->ghosts[ghost].nextrow <= pp->pacman.nextrow + 1) &&
+                           (pp->ghosts[ghost].nextcol >= pp->pacman.nextcol - 1) &&
+                           (pp->ghosts[ghost].nextcol <= pp->pacman.nextcol + 1)) {
+                               (void) printf("%d %d\n", pp->ghosts[ghost].nextrow,
+                                             pp->ghosts[ghost].nextcol);
+                       }
+#endif
+                       if (((pp->ghosts[ghost].nextrow == pp->pacman.nextrow) &&
+                       (pp->ghosts[ghost].nextcol == pp->pacman.nextcol)) ||
+                           ((pp->ghosts[ghost].nextrow == pp->pacman.row) &&
+                            (pp->ghosts[ghost].nextcol == pp->pacman.col) &&
+                            (pp->ghosts[ghost].row == pp->pacman.nextrow) &&
+                            (pp->ghosts[ghost].col == pp->pacman.nextcol))) {
+                               pp->ghosts[ghost].dead = 1;
+                               XSetForeground(display, pp->stippledGC, MI_BLACK_PIXEL(mi));
+                               /*XFillRectangle(display, window, gc,
+                                  pp->ghosts[ghost].col * pp->xs + pp->xb,
+                                  pp->ghosts[ghost].row * pp->ys + pp->yb,
+                                  pp->xs, pp->ys); */
+                               XFillRectangle(display, window, pp->stippledGC,
+                                pp->ghosts[ghost].nextcol * pp->xs + pp->xb,
+                                pp->ghosts[ghost].nextrow * pp->ys + pp->yb,
+                                              pp->xs, pp->ys);
+                       } else {
+                               pp->ghosts[ghost].row = pp->ghosts[ghost].nextrow;
+                               pp->ghosts[ghost].col = pp->ghosts[ghost].nextcol;
+                               alldead = 0;
+                       }
+               }
+       }
+       pp->pacman.row = pp->pacman.nextrow;
+       pp->pacman.col = pp->pacman.nextcol;
+
+#if DEFUNCT
+       if (alldead && pp->eaten) {
+               for (ghost = 0; ghost < (pp->nrows * pp->ncols); ghost++)
+                       if (pp->eaten[ghost] != ALL)
+                               break;
+               if (ghost == pp->nrows * pp->ncols)
+                       repopulate(mi);
+       }
+#else
+       if (alldead) {
+               repopulate(mi);
+       }
+#endif
+}
+
+void
+init_pacman(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         size = MI_SIZE(mi);
+       pacmangamestruct *pp;
+       XGCValues   gcv;
+       int         ghost, dir, mouth;
+       GC          fg_gc, bg_gc;
+
+       if (pacmangames == NULL) {
+               if ((pacmangames = (pacmangamestruct *) calloc(MI_NUM_SCREENS(mi),
+                                        sizeof (pacmangamestruct))) == NULL)
+                       return;
+       }
+       pp = &pacmangames[MI_SCREEN(mi)];
+
+       pp->width = MI_WIDTH(mi);
+       pp->height = MI_HEIGHT(mi);
+       if (pp->ghostPixmap != None) {
+               XFreePixmap(display, pp->ghostPixmap);
+               pp->ghostPixmap = None;
+           pp->graphics_format = IS_NONE;
+       }
+       if (size == 0 ||
+               MINGRIDSIZE * size > pp->width ||
+               MINGRIDSIZE * size > pp->height) {
+           int         ghostWidth, ghostHeight;
+
+               ghostWidth = CELL_WIDTH;
+               ghostHeight = CELL_HEIGHT;
+               getPixmap(mi, window, CELL_WIDTH, CELL_HEIGHT, CELL_BITS,
+                       &ghostWidth, &ghostHeight, &(pp->ghostPixmap),
+                       &(pp->graphics_format));
+               pp->xs = ghostWidth;
+               pp->ys = ghostHeight;
+               if (pp->width > MINGRIDSIZE * pp->xs &&
+            pp->height > MINGRIDSIZE * pp->ys) {
+            pp->pixelmode = False;
+        } else {
+                       if (pp->ghostPixmap != None) {
+                               XFreePixmap(display, pp->ghostPixmap);
+                               pp->ghostPixmap = None;
+                           pp->graphics_format = IS_NONE;
+                       }
+            pp->pixelmode = True;
+            pp->ys = MAX(MINSIZE, MIN(pp->width, pp->height) / MINGRIDSIZE);
+            pp->xs = pp->ys;
+        }
+       } else {
+               pp->pixelmode = True;
+               if (size < -MINSIZE)
+                       pp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(pp->width, pp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE)
+                       pp->ys = MINSIZE;
+               else
+                       pp->ys = MIN(size, MAX(MINSIZE, MIN(pp->width, pp->height) /
+                                              MINGRIDSIZE));
+               pp->xs = pp->ys;
+       }
+       pp->incx = pp->xs / 10 + 1;
+       pp->incy = pp->ys / 10 + 1;
+       pp->ncols = MAX(pp->width / pp->xs, 2);
+       pp->nrows = MAX(pp->height / pp->ys, 2);
+       pp->xb = pp->width - pp->ncols * pp->xs;
+       pp->yb = pp->height - pp->nrows * pp->ys;
+
+       if (pp->pixelmode) {
+        if ((pp->ghostPixmap = XCreatePixmap(display, window,
+                       pp->xs, pp->ys, 1)) == None) {
+                       free_pacman(display, pp);
+                       return;
+               }
+        gcv.foreground = 0;
+        gcv.background = 1;
+        if ((bg_gc = XCreateGC(display, pp->ghostPixmap,
+                       GCForeground | GCBackground, &gcv)) == None) {
+                       free_pacman(display, pp);
+                       return;
+               }
+        gcv.foreground = 1;
+        gcv.background = 0;
+        if ((fg_gc = XCreateGC(display, pp->ghostPixmap,
+                       GCForeground | GCBackground, &gcv)) == None) {
+               XFreeGC(display, bg_gc);
+                       free_pacman(display, pp);
+                       return;
+               }
+        XFillRectangle(display, pp->ghostPixmap, bg_gc,
+            0, 0, pp->xs, pp->ys);
+               XFillArc(display, pp->ghostPixmap, fg_gc,
+                       0, 0, pp->xs, pp->ys, 0, 11520);
+               XFillRectangle(display, pp->ghostPixmap, fg_gc,
+                       0, pp->ys / 2, pp->xs, pp->ys / 2);
+        XFreeGC(display, bg_gc);
+        XFreeGC(display, fg_gc);
+    }
+       if (!pp->stippledGC) {
+               gcv.foreground = MI_BLACK_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((pp->stippledGC = XCreateGC(display, window,
+                               GCForeground | GCBackground, &gcv)) == None) {
+                       free_pacman(display, pp);
+                       return;
+               }
+       }
+       if (pp->pacmanPixmap[0][0] != None)
+               for (dir = 0; dir < 4; dir++)
+                       for (mouth = 0; mouth < MAXMOUTH; mouth++)
+                               XFreePixmap(display, pp->pacmanPixmap[dir][mouth]);
+
+       for (dir = 0; dir < 4; dir++)
+               for (mouth = 0; mouth < MAXMOUTH; mouth++) {
+                       if ((pp->pacmanPixmap[dir][mouth] = XCreatePixmap(display,
+                                        MI_WINDOW(mi), pp->xs, pp->ys, 1)) == None) {
+                               free_pacman(display, pp);
+                               return;
+                       }
+                       gcv.foreground = 1;
+               gcv.background = 0;
+                       if ((fg_gc = XCreateGC(display, pp->pacmanPixmap[dir][mouth],
+                                       GCForeground | GCBackground, &gcv)) == None) {
+                               free_pacman(display, pp);
+                               return;
+                       }
+                       gcv.foreground = 0;
+               gcv.background = 0;
+                       if ((bg_gc = XCreateGC(display, pp->pacmanPixmap[dir][mouth],
+                                       GCForeground | GCBackground, &gcv)) == None) {
+                       XFreeGC(display, fg_gc);
+                               free_pacman(display, pp);
+                               return;
+                       }
+                       XFillRectangle(display, pp->pacmanPixmap[dir][mouth], bg_gc,
+                               0, 0, pp->xs, pp->ys);
+                       if (pp->xs == 1 && pp->ys == 1)
+                               XFillRectangle(display, pp->pacmanPixmap[dir][mouth], fg_gc,
+                                       0, 0, pp->xs, pp->ys);
+                       else
+                               XFillArc(display, pp->pacmanPixmap[dir][mouth], fg_gc,
+                                       0, 0, pp->xs, pp->ys,
+                                       ((90 - dir * 90) + mouth * 5) * 64,
+                                       (360 + (-2 * mouth * 5)) * 64);
+                       XFreeGC(display, fg_gc);
+                       XFreeGC(display, bg_gc);
+               }
+       pp->pacman.lastbox = -1;
+       pp->pacman.mouthdirection = 1;
+
+       pp->nghosts = MI_COUNT(mi);
+       if (pp->nghosts < -MINGHOSTS) {
+               /* if pp->nghosts is random ... the size can change */
+               if (pp->ghosts != NULL) {
+                       (void) free((void *) pp->ghosts);
+                       pp->ghosts = NULL;
+               }
+               pp->nghosts = NRAND(-pp->nghosts - MINGHOSTS + 1) + MINGHOSTS;
+       } else if (pp->nghosts < MINGHOSTS)
+               pp->nghosts = MINGHOSTS;
+
+       if (!pp->ghosts)
+               if ((pp->ghosts = (beingstruct *) calloc(pp->nghosts,
+                               sizeof (beingstruct))) == NULL) {
+                       free_pacman(display, pp);
+                       return;
+               }
+       for (ghost = 0; ghost < pp->nghosts; ghost++)
+               pp->ghosts[ghost].nextbox = NOWHERE;
+
+       pp->pacman.row = NRAND(pp->nrows);
+       pp->pacman.col = NRAND(pp->ncols);
+
+       MI_CLEARWINDOW(mi);
+
+       pp->pacman.mouthstage = MAXMOUTH - 1;
+       for (ghost = 0; ghost < pp->nghosts; ghost++) {
+               do {
+                       pp->ghosts[ghost].col = NRAND(pp->ncols);
+                       pp->ghosts[ghost].row = NRAND(pp->nrows);
+               }
+               while ((pp->ghosts[ghost].col == pp->pacman.col) &&
+                      (pp->ghosts[ghost].row == pp->pacman.row));
+               pp->ghosts[ghost].dead = 0;
+               pp->ghosts[ghost].lastbox = -1;
+
+       }
+#if DEFUNCT
+       if (pp->eaten)
+               (void) free((void *) pp->eaten);
+       if ((pp->eaten = (unsigned int *) malloc((pp->nrows * pp->ncols) *
+                                           sizeof (unsigned int))) == NULL) {
+               free_pacman(display, pp);
+               return;
+       }
+
+       if (pp->eaten)
+               for (ghost = 0; ghost < (pp->nrows * pp->ncols); ghost++)
+                       pp->eaten[ghost] = NONE;
+#endif
+}
+
+void
+draw_pacman(ModeInfo * mi)
+{
+       int         g;
+       pacmangamestruct *pp;
+
+       if (pacmangames == NULL)
+               return;
+       pp = &pacmangames[MI_SCREEN(mi)];
+       if (pp->ghosts == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       do {
+               if (NRAND(3) == 2)
+                       pp->pacman.nextbox = NRAND(5);
+
+               switch (pp->pacman.nextbox) {
+                       case 0:
+                               if ((pp->pacman.row == 0) || (pp->pacman.lastbox == 2))
+                                       pp->pacman.nextbox = NOWHERE;
+                               else {
+                                       pp->pacman.nextrow = pp->pacman.row - 1;
+                                       pp->pacman.nextcol = pp->pacman.col;
+                               }
+                               break;
+
+                       case 1:
+                               if ((pp->pacman.col == pp->ncols - 1) ||
+                                   (pp->pacman.lastbox == 3))
+                                       pp->pacman.nextbox = NOWHERE;
+                               else {
+                                       pp->pacman.nextrow = pp->pacman.row;
+                                       pp->pacman.nextcol = pp->pacman.col + 1;
+                               }
+                               break;
+
+                       case 2:
+                               if ((pp->pacman.row == pp->nrows - 1) ||
+                                   (pp->pacman.lastbox == 0))
+                                       pp->pacman.nextbox = NOWHERE;
+                               else {
+                                       pp->pacman.nextrow = pp->pacman.row + 1;
+                                       pp->pacman.nextcol = pp->pacman.col;
+                               }
+                               break;
+
+                       case 3:
+                               if ((pp->pacman.col == 0) || (pp->pacman.lastbox == 1))
+                                       pp->pacman.nextbox = NOWHERE;
+                               else {
+                                       pp->pacman.nextrow = pp->pacman.row;
+                                       pp->pacman.nextcol = pp->pacman.col - 1;
+                               }
+                               break;
+
+                       default:
+                               pp->pacman.nextbox = NOWHERE;
+                               break;
+               }
+       }
+       while (pp->pacman.nextbox == NOWHERE);
+
+
+       for (g = 0; g < pp->nghosts; g++) {
+               if (pp->ghosts[g].dead == 0) {
+                       do {
+                               if (NRAND(3) == 2)
+                                       pp->ghosts[g].nextbox = NRAND(5);
+
+                               switch (pp->ghosts[g].nextbox) {
+                                       case 0:
+                                               if ((pp->ghosts[g].row == 0) || (pp->ghosts[g].lastbox == 2))
+                                                       pp->ghosts[g].nextbox = NOWHERE;
+                                               else {
+                                                       pp->ghosts[g].nextrow = pp->ghosts[g].row - 1;
+                                                       pp->ghosts[g].nextcol = pp->ghosts[g].col;
+                                               }
+                                               break;
+
+                                       case 1:
+                                               if ((pp->ghosts[g].col == pp->ncols - 1) ||
+                                               (pp->ghosts[g].lastbox == 3))
+                                                       pp->ghosts[g].nextbox = NOWHERE;
+                                               else {
+                                                       pp->ghosts[g].nextrow = pp->ghosts[g].row;
+                                                       pp->ghosts[g].nextcol = pp->ghosts[g].col + 1;
+                                               }
+                                               break;
+
+                                       case 2:
+                                               if ((pp->ghosts[g].row == pp->nrows - 1) ||
+                                               (pp->ghosts[g].lastbox == 0))
+                                                       pp->ghosts[g].nextbox = NOWHERE;
+                                               else {
+                                                       pp->ghosts[g].nextrow = pp->ghosts[g].row + 1;
+                                                       pp->ghosts[g].nextcol = pp->ghosts[g].col;
+                                               }
+                                               break;
+
+                                       case 3:
+                                               if ((pp->ghosts[g].col == 0) || (pp->ghosts[g].lastbox == 1))
+                                                       pp->ghosts[g].nextbox = NOWHERE;
+                                               else {
+                                                       pp->ghosts[g].nextrow = pp->ghosts[g].row;
+                                                       pp->ghosts[g].nextcol = pp->ghosts[g].col - 1;
+                                               }
+                                               break;
+
+                                       default:
+                                               pp->ghosts[g].nextbox = NOWHERE;
+                                               break;
+                               }
+                       }
+                       while (pp->ghosts[g].nextbox == NOWHERE);
+                       pp->ghosts[g].lastbox = pp->ghosts[g].nextbox;
+               }
+       }
+       if (pp->pacman.lastbox != pp->pacman.nextbox)
+               pp->pacman.mouthstage = 0;
+       pp->pacman.lastbox = pp->pacman.nextbox;
+       movepac(mi);
+
+}
+
+void
+release_pacman(ModeInfo * mi)
+{
+       if (pacmangames != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_pacman(MI_DISPLAY(mi), &pacmangames[screen]);
+               (void) free((void *) pacmangames);
+               pacmangames = NULL;
+       }
+}
+
+void
+refresh_pacman(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_pacman */
diff --git a/modes/penrose.c b/modes/penrose.c
new file mode 100644 (file)
index 0000000..e603e7a
--- /dev/null
@@ -0,0 +1,1328 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* penrose --- quasiperiodic tilings */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)penrose.c    5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Timo Korvola <tkorvola@dopey.hut.fi>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Jamie Zawinski <jwz@jwz.org> compatible with xscreensaver
+ * 09-Sep-1996: Written.
+ */
+
+/*-
+Be careful, this probably still has a few bugs (many of which may only
+appear with a very low probability).  These are seen with -verbose .
+If one of these are hit penrose will reinitialize.
+*/
+
+/*-
+ * See Onoda, Steinhardt, DiVincenzo and Socolar in
+ * Phys. Rev. Lett. 60, #25, 1988 or
+ * Strandburg in Computers in Physics, Sep/Oct 1991.
+ *
+ * This implementation uses the simpler version of the growth
+ * algorithm, i.e., if there are no forced vertices, a randomly chosen
+ * tile is added to a randomly chosen vertex (no preference for those
+ * 108 degree angles).
+ *
+ * There are two essential differences to the algorithm presented in
+ * the literature: First, we do not allow the tiling to enclose an
+ * untiled area.  Whenever this is in danger of happening, we just
+ * do not add the tile, hoping for a better random choice the next
+ * time.  Second, when choosing a vertex randomly, we will take
+ * one that lies withing the viewport if available.  If this seems to
+ * cause enclosures in the forced rule case, we will allow invisible
+ * vertices to be chosen.
+ *
+ * Tiling is restarted whenever one of the following happens: there
+ * are no incomplete vertices within the viewport or the tiling has
+ * extended a window's length beyond the edge of the window
+ * horizontally or vertically or forced rule choice has failed 100
+ * times due to areas about to become enclosed.
+ *
+ * Introductory info:
+ * Science News March 23 1985 Vol 127, No. 12
+ * Science News July 16 1988 Vol 134, No. 3
+ * The Economist Sept 17 1988 pg. 100
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Penrose"
+#define HACK_INIT init_penrose
+#define HACK_DRAW draw_penrose
+#define penrose_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*size: 40 \n" \
+ "*ncolors: 64 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_penrose
+
+#define DEF_AMMANN  "False"
+
+static Bool ammann;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-ammann", (char *) ".penrose.ammann", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+ammann", (char *) ".penrose.ammann", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & ammann, (char *) "ammann", (char *) "Ammann", (char *) DEF_AMMANN, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+ammann", (char *) "turn on/off Ammann lines"}
+};
+
+ModeSpecOpt penrose_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   penrose_description =
+{"penrose", "init_penrose", "draw_penrose", "release_penrose",
+ "init_penrose", "init_penrose", NULL, &penrose_opts,
+ 10000, 1, 1, -40, 64, 1.0, "",
+ "Shows Penrose's quasiperiodic tilings", 0, NULL};
+
+#endif
+
+/*-
+ * Annoyingly the ANSI C library people have reserved all identifiers
+ * ending with _t for future use.  Hence we use _c as a suffix for
+ * typedefs (c for class, although this is not C++).
+ */
+
+#define MINSIZE 5
+
+/*-
+ * In theory one could fit 10 tiles to a single vertex.  However, the
+ * vertex rules only allow at most seven tiles to meet at a vertex.
+ */
+
+#define CELEBRATE 31415                /* This causes a pause, an error occurred. */
+#define COMPLETION 3141                /* This causes a pause, tiles filled up screen. */
+
+#define MAX_TILES_PER_VERTEX 7
+#define N_VERTEX_RULES 8
+#define ALLOC_NODE(type) (type *)malloc(sizeof (type))
+
+/*-
+ * These are used to specify directions.  They can also be used in bit
+ * masks to specify a combination of directions.
+ */
+#define S_LEFT 1
+#define S_RIGHT 2
+
+
+/*-
+ * We do not actually maintain objects corresponding to the tiles since
+ * we do not really need them and they would only consume memory and
+ * cause additional bookkeeping.  Instead we only have vertices, and
+ * each vertex lists the type of each adjacent tile as well as the
+ * position of the vertex on the tile (hereafter refered to as
+ * "corner").  These positions are numbered in counterclockwise order
+ * so that 0 is where two double arrows meet (see one of the
+ * articles).  The tile type and vertex number are stored in a single
+ * integer (we use char, and even most of it remains unused).
+ *
+ * The primary use of tile objects would be draw traversal, but we do
+ * not currently do redraws at all (we just start over).
+ */
+#define VT_CORNER_MASK 0x3
+#define VT_TYPE_MASK 0x4
+#define VT_THIN 0
+#define VT_THICK 0x4
+#define VT_BITS 3
+#define VT_TOTAL_MASK 0x7
+
+typedef unsigned char vertex_type_c;
+
+/*-
+ * These allow one to compute the types of the other corners of the tile.  If
+ * you are standing at a vertex of type vt looking towards the middle of the
+ * tile, VT_LEFT( vt) is the vertex on your left etc.
+ */
+#define VT_LEFT( vt) ((((vt) - 1) & VT_CORNER_MASK) | (((vt) & VT_TYPE_MASK)))
+#define VT_RIGHT( vt) ((((vt) + 1) & VT_CORNER_MASK) | (((vt) & VT_TYPE_MASK)))
+#define VT_FAR( vt) ((vt) ^ 2)
+
+
+/*-
+ * Since we do not do redraws, we only store the vertices we need.  These are
+ * the ones with still some empty space around them for the growth algorithm
+ * to fill.
+ *
+ * Here we use a doubly chained ring-like structure as vertices often need
+ * to be removed or inserted (they are kept in geometrical order
+ * circling the tiled area counterclockwise).  The ring is refered to by
+ * a pointer to one more or less random node.  When deleting nodes one
+ * must make sure that this pointer continues to refer to a valid
+ * node.  A vertex count is maintained to make it easier to pick
+ * vertices randomly.
+ */
+typedef struct forced_node forced_node_c;
+
+typedef struct fringe_node {
+       struct fringe_node *prev;
+       struct fringe_node *next;
+       /* These are numbered counterclockwise.  The gap, if any, lies
+          between the last and first tiles.  */
+       vertex_type_c tiles[MAX_TILES_PER_VERTEX];
+       int         n_tiles;
+       /* A bit mask used to indicate vertex rules that are still applicable for
+          completing this vertex.  Initialize this to (1 << N_VERTEX_RULES) - 1,
+          i.e., all ones, and the rule matching functions will automatically mask
+          out rules that no longer match. */
+       unsigned char rule_mask;
+       /* If the vertex is on the forced vertex list, this points to the
+          pointer to the appropriate node in the list.  To remove the
+          vertex from the list just set *list_ptr to the next node,
+          deallocate and decrement node count. */
+       struct forced_node **list_ptr;
+       /* Screen coordinates. */
+       XPoint      loc;
+       /* We also keep track of 5D coordinates to avoid rounding errors.
+          These are in units of edge length. */
+       int         fived[5];
+       /* This is used to quickly check if a vertex is visible. */
+       unsigned char off_screen;
+} fringe_node_c;
+
+typedef struct {
+       fringe_node_c *nodes;
+       /* This does not count off-screen nodes. */
+       int         n_nodes;
+} fringe_c;
+
+
+/*-
+ * The forced vertex pool contains vertices where at least one
+ * side of the tiled region can only be extended in one way.  Note
+ * that this does not necessarily mean that there would only be one
+ * applicable rule.  forced_sides are specified using S_LEFT and
+ * S_RIGHT as if looking at the untiled region from the vertex.
+ */
+struct forced_node {
+       fringe_node_c *vertex;
+       unsigned    forced_sides;
+       struct forced_node *next;
+};
+
+typedef struct {
+       forced_node_c *first;
+       int         n_nodes, n_visible;
+} forced_pool_c;
+
+
+/* This is the data related to the tiling of one screen. */
+typedef struct {
+       int         width, height;
+       XPoint      origin;
+       int         edge_length;
+       fringe_c    fringe;
+       forced_pool_c forced;
+       int         done, failures;
+       unsigned long thick_color, thin_color;
+       int         busyLoop;
+       Bool        ammann;
+} tiling_c;
+
+static tiling_c *tilings;      /* = {0} */
+
+
+/* The tiles are listed in counterclockwise order. */
+typedef struct {
+       vertex_type_c tiles[MAX_TILES_PER_VERTEX];
+       int         n_tiles;
+} vertex_rule_c;
+
+static vertex_rule_c vertex_rules[N_VERTEX_RULES] =
+{
+       {
+  {VT_THICK | 2, VT_THICK | 2, VT_THICK | 2, VT_THICK | 2, VT_THICK | 2}, 5},
+       {
+  {VT_THICK | 0, VT_THICK | 0, VT_THICK | 0, VT_THICK | 0, VT_THICK | 0}, 5},
+       {
+               {VT_THICK | 0, VT_THICK | 0, VT_THICK | 0, VT_THIN | 0}, 4},
+       {
+        {VT_THICK | 2, VT_THICK | 2, VT_THIN | 1, VT_THIN | 3, VT_THICK | 2,
+         VT_THIN | 1, VT_THIN | 3}, 7},
+       {
+               {VT_THICK | 2, VT_THICK | 2, VT_THICK | 2, VT_THICK | 2,
+                VT_THIN | 1, VT_THIN | 3}, 6},
+       {
+               {VT_THICK | 1, VT_THICK | 3, VT_THIN | 2}, 3},
+       {
+               {VT_THICK | 0, VT_THIN | 0, VT_THIN | 0}, 3},
+       {
+     {VT_THICK | 2, VT_THIN | 1, VT_THICK | 3, VT_THICK | 1, VT_THIN | 3}, 5}
+};
+
+
+/* Match information returned by match_rules. */
+typedef struct {
+       int         rule;
+       int         pos;
+} rule_match_c;
+
+
+/* Occasionally floating point coordinates are needed. */
+typedef struct {
+       float       x, y;
+} fcoord_c;
+
+
+/* All angles are measured in multiples of 36 degrees. */
+typedef int angle_c;
+
+static angle_c vtype_angles[] =
+{4, 1, 4, 1, 2, 3, 2, 3};
+
+#define vtype_angle( v) (vtype_angles[ v])
+
+
+/* Direction angle of an edge. */
+static      angle_c
+vertex_dir(ModeInfo * mi, fringe_node_c * vertex, unsigned side)
+{
+       tiling_c   *tp = &tilings[MI_SCREEN(mi)];
+       fringe_node_c *v2 =
+       (side == S_LEFT ? vertex->next : vertex->prev);
+       register int i;
+
+       for (i = 0; i < 5; i++)
+               switch (v2->fived[i] - vertex->fived[i]) {
+                       case 1:
+                               return 2 * i;
+                       case -1:
+                               return (2 * i + 5) % 10;
+               }
+       tp->done = True;
+       if (MI_IS_VERBOSE(mi)) {
+               (void) fprintf(stderr,
+                      "Weirdness in vertex_dir (this has been reported)\n");
+               for (i = 0; i < 5; i++)
+                       (void) fprintf(stderr, "v2->fived[%d]=%d, vertex->fived[%d]=%d\n",
+                                      i, v2->fived[i], i, vertex->fived[i]);
+       }
+       tp->busyLoop = CELEBRATE;
+       return 0;
+}
+
+
+/* Move one step to a given direction. */
+static void
+add_unit_vec(angle_c dir, int *fived)
+{
+       static int  dir2i[] =
+       {0, 3, 1, 4, 2};
+
+       while (dir < 0)
+               dir += 10;
+       fived[dir2i[dir % 5]] += (dir % 2 ? -1 : 1);
+}
+
+
+/* For comparing coordinates. */
+#define fived_equal( f1, f2) (!memcmp( (f1), (f2), 5 * sizeof( int)))
+
+
+/*-
+ * This computes screen coordinates from 5D representation.  Note that X
+ * uses left-handed coordinates (y increases downwards).
+ */
+static void
+fived_to_loc(int fived[], tiling_c * tp, XPoint *pt)
+{
+       static fcoord_c fived_table[5] =
+       {
+               {.0, .0}};
+       float       fifth = 8 * atan(1.) / 5;
+       register int i;
+       register float r;
+       register fcoord_c offset;
+
+       *pt = tp->origin;
+       offset.x = 0.0;
+       offset.y = 0.0;
+       if (fived_table[0].x == .0)
+               for (i = 0; i < 5; i++) {
+                       fived_table[i].x = cos(fifth * i);
+                       fived_table[i].y = sin(fifth * i);
+               }
+       for (i = 0; i < 5; i++) {
+               r = fived[i] * tp->edge_length;
+               offset.x += r * fived_table[i].x;
+               offset.y -= r * fived_table[i].y;
+       }
+       (*pt).x += (int) (offset.x + .5);
+       (*pt).y += (int) (offset.y + .5);
+}
+
+
+/* Mop up dynamic data for one screen. */
+static void
+free_penrose(tiling_c * tp)
+{
+       register fringe_node_c *fp1, *fp2;
+       register forced_node_c *lp1, *lp2;
+
+       if (tp->fringe.nodes == NULL)
+               return;
+       fp1 = tp->fringe.nodes;
+       do {
+               fp2 = fp1;
+               fp1 = fp1->next;
+               (void) free((void *) fp2);
+       } while (fp1 != tp->fringe.nodes);
+       tp->fringe.nodes = NULL;
+       for (lp1 = tp->forced.first; lp1 != 0;) {
+               lp2 = lp1;
+               lp1 = lp1->next;
+               (void) free((void *) lp2);
+       }
+       tp->forced.first = 0;
+}
+
+
+/* Called to init the mode. */
+void
+init_penrose(ModeInfo * mi)
+{
+       tiling_c   *tp;
+       fringe_node_c *fp;
+       int         i, size;
+
+       if (tilings == NULL) {
+               if ((tilings = (tiling_c *) calloc(MI_NUM_SCREENS(mi),
+                                                sizeof (tiling_c))) == NULL)
+                       return;
+       }
+       tp = &tilings[MI_SCREEN(mi)];
+
+       if (MI_IS_FULLRANDOM(mi))
+               tp->ammann = (Bool) (LRAND() & 1);
+       else
+               tp->ammann = ammann;
+       tp->done = False;
+       tp->busyLoop = 0;
+       tp->failures = 0;
+       tp->width = MI_WIDTH(mi);
+       tp->height = MI_HEIGHT(mi);
+       if (MI_NPIXELS(mi) > 2) {
+               tp->thick_color = NRAND(MI_NPIXELS(mi));
+               /* Insure good contrast */
+               tp->thin_color = (NRAND(2 * MI_NPIXELS(mi) / 3) + tp->thick_color +
+                                 MI_NPIXELS(mi) / 6) % MI_NPIXELS(mi);
+       }
+       size = MI_SIZE(mi);
+       if (size < -MINSIZE)
+               tp->edge_length = NRAND(MIN(-size, MAX(MINSIZE,
+                  MIN(tp->width, tp->height) / 2)) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE) {
+               if (!size)
+                       tp->edge_length = MAX(MINSIZE, MIN(tp->width, tp->height) / 2);
+               else
+                       tp->edge_length = MINSIZE;
+       } else
+               tp->edge_length = MIN(size, MAX(MINSIZE,
+                                           MIN(tp->width, tp->height) / 2));
+       tp->origin.x = (tp->width / 2 + NRAND(tp->width)) / 2;
+       tp->origin.y = (tp->height / 2 + NRAND(tp->height)) / 2;
+       tp->fringe.n_nodes = 2;
+       if (tp->fringe.nodes != NULL)
+               free_penrose(tp);
+       if (tp->fringe.nodes != NULL || tp->forced.first != 0) {
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in init_penrose()\n");
+                       (void) fprintf(stderr, "tp->fringe.nodes = NULL && tp->forced.first = 0\n");
+               }
+               free_penrose(tp);       /* Try again */
+               tp->done = True;
+       }
+       tp->forced.n_nodes = tp->forced.n_visible = 0;
+       if ((fp = tp->fringe.nodes = ALLOC_NODE(fringe_node_c)) == NULL) {
+               free_penrose(tp);
+               return;
+       }
+       if (fp == 0) {
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in init_penrose()\n");
+                       (void) fprintf(stderr, "fp = 0\n");
+               }
+               if ((fp = tp->fringe.nodes = ALLOC_NODE(fringe_node_c)) == NULL) {
+                       free_penrose(tp);
+                       return;
+               }
+               tp->done = True;
+       }
+       /* First vertex. */
+       fp->rule_mask = (1 << N_VERTEX_RULES) - 1;
+       fp->list_ptr = 0;
+       if  ((fp->prev = fp->next = ALLOC_NODE(fringe_node_c)) == NULL) {
+               free_penrose(tp);
+               return;
+       }
+       if (fp->next == 0) {
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in init_penrose()\n");
+                       (void) fprintf(stderr, "fp->next = 0\n");
+               }
+               if ((fp->prev = fp->next = ALLOC_NODE(fringe_node_c)) == NULL) {
+                       free_penrose(tp);
+                       return;
+               }
+               tp->done = True;
+       }
+       fp->n_tiles = 0;
+       fp->loc = tp->origin;
+       fp->off_screen = False;
+       for (i = 0; i < 5; i++)
+               fp->fived[i] = 0;
+
+       /* Second vertex. */
+       *(fp->next) = *fp;
+       fp->next->prev = fp->next->next = fp;
+       fp = fp->next;
+       i = NRAND(5);
+       fp->fived[i] = 2 * NRAND(2) - 1;
+       fived_to_loc(fp->fived, tp, &(fp->loc));
+       /* That's it!  We have created our first edge. */
+}
+
+/*-
+ * This attempts to match the configuration of vertex with the vertex
+ * rules.   The return value is a total match count.  If matches is
+ * non-null, it will be used to store information about the matches
+ * and must be large enough to contain it.  To play it absolutely
+ * safe, allocate room for MAX_TILES_PER_VERTEX * N_VERTEX_RULES
+ * entries when searching all matches.   The rule mask of vertex will
+ * be applied and rules masked out will not be searched.  Only strict
+ * subsequences match.  If first_only is true, the search stops when
+ * the first match is found.  Otherwise all matches will be found and
+ * the rule_mask of vertex will be updated, which also happens in
+ * single-match mode if no match is found.
+ */
+static int
+match_rules(fringe_node_c * vertex, rule_match_c * matches, int first_only)
+{
+       /* I will assume that I can fit all the relevant bits in vertex->tiles
+          into one unsigned long.  With 3 bits per element and at most 7
+          elements this means 21 bits, which should leave plenty of room.
+          After packing the bits the rest is just integer comparisons and
+          some bit shuffling.  This is essentially Rabin-Karp without
+          congruence arithmetic. */
+       register int i, j;
+       int         hits = 0, good_rules[N_VERTEX_RULES], n_good = 0;
+       unsigned long
+                   vertex_hash = 0, lower_bits_mask = ~(VT_TOTAL_MASK << VT_BITS * (vertex->n_tiles - 1));
+       unsigned    new_rule_mask = 0;
+
+       for (i = 0; i < N_VERTEX_RULES; i++)
+               if (vertex->n_tiles >= vertex_rules[i].n_tiles)
+                       vertex->rule_mask &= ~(1 << i);
+               else if (vertex->rule_mask & 1 << i)
+                       good_rules[n_good++] = i;
+       for (i = 0; i < vertex->n_tiles; i++)
+               vertex_hash |= (unsigned long) vertex->tiles[i] << (VT_BITS * i);
+
+       for (j = 0; j < n_good; j++) {
+               unsigned long rule_hash = 0;
+               vertex_rule_c *vr = vertex_rules + good_rules[j];
+
+               for (i = 0; i < vertex->n_tiles; i++)
+                       rule_hash |= (unsigned long) vr->tiles[i] << (VT_BITS * i);
+               if (rule_hash == vertex_hash) {
+                       if (matches != 0) {
+                               matches[hits].rule = good_rules[j];
+                               matches[hits].pos = 0;
+                       }
+                       hits++;
+                       if (first_only)
+                               return hits;
+                       else
+                               new_rule_mask |= 1 << good_rules[j];
+               }
+               for (i = vr->n_tiles - 1; i > 0; i--) {
+                       rule_hash = vr->tiles[i] | (rule_hash & lower_bits_mask) << VT_BITS;
+                       if (vertex_hash == rule_hash) {
+                               if (matches != 0) {
+                                       matches[hits].rule = good_rules[j];
+                                       matches[hits].pos = i;
+                               }
+                               hits++;
+                               if (first_only)
+                                       return hits;
+                               else
+                                       new_rule_mask |= 1 << good_rules[j];
+                       }
+               }
+       }
+       vertex->rule_mask = new_rule_mask;
+       return hits;
+}
+
+
+/*-
+ * find_completions finds the possible ways to add a tile to a vertex.
+ * The return values is the number of such possibilities.  You must
+ * first call match_rules to produce matches and n_matches.  sides
+ * specifies which side of the vertex to extend and can be S_LEFT or
+ * S_RIGHT.  If results is non-null, it should point to an array large
+ * enough to contain the results, which will be stored there.
+ * MAX_COMPL elements will always suffice.  If first_only is true we
+ * stop as soon as we find one possibility (NOT USED).
+ */
+#define MAX_COMPL 2
+
+static int
+find_completions(fringe_node_c * vertex, rule_match_c * matches, int n_matches,
+              unsigned side, vertex_type_c * results /*, int first_only */ )
+{
+       int         n_res = 0, cont;
+       register int i, j;
+       vertex_type_c buf[MAX_COMPL];
+
+       if (results == 0)
+               results = buf;
+       if (n_matches <= 0)
+               return 0;
+       for (i = 0; i < n_matches; i++) {
+               vertex_rule_c *rule = vertex_rules + matches[i].rule;
+               int         pos = (matches[i].pos
+                  + (side == S_RIGHT ? vertex->n_tiles : rule->n_tiles - 1))
+               % rule->n_tiles;
+               vertex_type_c vtype = rule->tiles[pos];
+
+               cont = 1;
+               for (j = 0; j < n_res; j++)
+                       if (vtype == results[j]) {
+                               cont = 0;
+                               break;
+                       }
+               if (cont)
+                       results[n_res++] = vtype;
+       }
+       return n_res;
+}
+
+
+/*-
+ * Draw a tile on the display.  Vertices must be given in a
+ * counterclockwise order.  vtype is the vertex type of v1 (and thus
+ * also gives the tile type).
+ */
+static void
+draw_tile(fringe_node_c * v1, fringe_node_c * v2,
+         fringe_node_c * v3, fringe_node_c * v4,
+         vertex_type_c vtype, ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       tiling_c   *tp = &tilings[MI_SCREEN(mi)];
+       XPoint      pts[5];
+       vertex_type_c corner = vtype & VT_CORNER_MASK;
+
+       if (v1->off_screen && v2->off_screen && v3->off_screen && v4->off_screen)
+               return;
+       pts[corner] = v1->loc;
+       pts[VT_RIGHT(corner)] = v2->loc;
+       pts[VT_FAR(corner)] = v3->loc;
+       pts[VT_LEFT(corner)] = v4->loc;
+       pts[4] = pts[0];
+       if (MI_NPIXELS(mi) > 2) {
+               if ((vtype & VT_TYPE_MASK) == VT_THICK)
+                       XSetForeground(display, gc, MI_PIXEL(mi, tp->thick_color));
+               else
+                       XSetForeground(display, gc, MI_PIXEL(mi, tp->thin_color));
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       XFillPolygon(display, window, gc, pts, 4, Convex, CoordModeOrigin);
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       XDrawLines(display, window, gc, pts, 5, CoordModeOrigin);
+
+       if (tp->ammann) {
+               /* Draw some Ammann lines for debugging purposes.  This will probably
+                  fail miserably on a b&w display. */
+
+               if ((vtype & VT_TYPE_MASK) == VT_THICK) {
+                       static float r = .0;
+
+                       if (r == .0) {
+                               float       pi10 = 2 * atan(1.) / 5;
+
+                               r = 1 - sin(pi10) / (2 * sin(3 * pi10));
+                       }
+                       if (MI_NPIXELS(mi) > 2)
+                               XSetForeground(display, gc, MI_PIXEL(mi, tp->thin_color));
+                       else {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XSetLineAttributes(display, gc, 1, LineOnOffDash, CapNotLast, JoinMiter);
+                       }
+                       XDrawLine(display, window, gc,
+                             (int) (r * pts[3].x + (1 - r) * pts[0].x + .5),
+                             (int) (r * pts[3].y + (1 - r) * pts[0].y + .5),
+                             (int) (r * pts[1].x + (1 - r) * pts[0].x + .5),
+                            (int) (r * pts[1].y + (1 - r) * pts[0].y + .5));
+                       if (MI_NPIXELS(mi) <= 2)
+                               XSetLineAttributes(display, gc, 1, LineSolid, CapNotLast, JoinMiter);
+               } else {
+                       if (MI_NPIXELS(mi) > 2)
+                               XSetForeground(display, gc, MI_PIXEL(mi, tp->thick_color));
+                       else {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XSetLineAttributes(display, gc, 1, LineOnOffDash, CapNotLast, JoinMiter);
+                       }
+                       XDrawLine(display, window, gc,
+                                 (int) ((pts[3].x + pts[2].x) / 2 + .5),
+                                 (int) ((pts[3].y + pts[2].y) / 2 + .5),
+                                 (int) ((pts[1].x + pts[2].x) / 2 + .5),
+                                 (int) ((pts[1].y + pts[2].y) / 2 + .5));
+                       if (MI_NPIXELS(mi) <= 2)
+                               XSetLineAttributes(display, gc, 1, LineSolid, CapNotLast, JoinMiter);
+               }
+       }
+}
+
+/*-
+ * Update the status of this vertex on the forced vertex queue.  If
+ * the vertex has become untileable set tp->done.  This is supposed
+ * to detect dislocations -- never call this routine with a completely
+ * tiled vertex.
+ *
+ * Check for untileable vertices in check_vertex and stop tiling as
+ * soon as one finds one.  I don't know if it is possible to run out
+ * of forced vertices while untileable vertices exist (or will
+ * cavities inevitably appear).  If this can happen, add_random_tile
+ * might get called with an untileable vertex, causing ( n <= 1).
+ * (This is what the tp->done checks for).
+ *
+ * A delayLoop celebrates the dislocation.
+ */
+static void
+check_vertex(ModeInfo * mi, fringe_node_c * vertex, tiling_c * tp)
+{
+       rule_match_c hits[MAX_TILES_PER_VERTEX * N_VERTEX_RULES];
+       int         n_hits = match_rules(vertex, hits, False);
+       unsigned    forced_sides = 0;
+
+       if (vertex->rule_mask == 0) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Dislocation occurred!\n");
+               }
+               tp->busyLoop = CELEBRATE;       /* Should be able to recover */
+       }
+       if (1 == find_completions(vertex, hits, n_hits, S_LEFT, 0 /*, False */ ))
+               forced_sides |= S_LEFT;
+       if (1 == find_completions(vertex, hits, n_hits, S_RIGHT, 0 /*, False */ ))
+               forced_sides |= S_RIGHT;
+       if (forced_sides == 0) {
+               if (vertex->list_ptr != 0) {
+                       forced_node_c *node = *vertex->list_ptr;
+
+                       *vertex->list_ptr = node->next;
+                       if (node->next != 0)
+                               node->next->vertex->list_ptr = vertex->list_ptr;
+                       (void) free((void *) node);
+                       tp->forced.n_nodes--;
+                       if (!vertex->off_screen)
+                               tp->forced.n_visible--;
+                       vertex->list_ptr = 0;
+               }
+       } else {
+               forced_node_c *node;
+
+               if (vertex->list_ptr == 0) {
+                       if ((node = ALLOC_NODE(forced_node_c)) == NULL)
+                               return;
+                       node->vertex = vertex;
+                       node->next = tp->forced.first;
+                       if (tp->forced.first != 0)
+                               tp->forced.first->vertex->list_ptr = &(node->next);
+                       tp->forced.first = node;
+                       vertex->list_ptr = &(tp->forced.first);
+                       tp->forced.n_nodes++;
+                       if (!vertex->off_screen)
+                               tp->forced.n_visible++;
+               } else
+                       node = *vertex->list_ptr;
+               node->forced_sides = forced_sides;
+       }
+}
+
+
+/*-
+ * Delete this vertex.  If the vertex is a member of the forced vertex queue,
+ * also remove that entry.  We assume that the vertex is no longer
+ * connected to the fringe.  Note that tp->fringe.nodes must not point to
+ * the vertex being deleted.
+ */
+static void
+delete_vertex(ModeInfo * mi, fringe_node_c * vertex, tiling_c * tp)
+{
+       if (tp->fringe.nodes == vertex) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in delete_penrose()\n");
+                       (void) fprintf(stderr, "tp->fringe.nodes == vertex\n");
+               }
+               tp->busyLoop = CELEBRATE;
+       }
+       if (vertex->list_ptr != 0) {
+               forced_node_c *node = *vertex->list_ptr;
+
+               *vertex->list_ptr = node->next;
+               if (node->next != 0)
+                       node->next->vertex->list_ptr = vertex->list_ptr;
+               (void) free((void *) node);
+               tp->forced.n_nodes--;
+               if (!vertex->off_screen)
+                       tp->forced.n_visible--;
+       }
+       if (!vertex->off_screen)
+               tp->fringe.n_nodes--;
+       (void) free((void *) vertex);
+}
+
+
+/*-
+ * Check whether the addition of a tile of type vtype would completely fill
+ * the space available at vertex.
+ */
+static int
+fills_vertex(ModeInfo * mi, vertex_type_c vtype, fringe_node_c * vertex)
+{
+       return
+               (vertex_dir(mi, vertex, S_LEFT) - vertex_dir(mi, vertex, S_RIGHT)
+                - vtype_angle(vtype)) % 10 == 0;
+}
+
+
+/*-
+ * If you were to add a tile of type vtype to a specified side of
+ * vertex, fringe_changes tells you which other vertices it would
+ * attach to.  The addresses of these vertices will be stored in the
+ * last three arguments.  Null is stored if the corresponding vertex
+ * would need to be allocated.
+ *
+ * The function also analyzes which vertices would be swallowed by the tiling
+ * and thus cut off from the fringe.  The result is returned as a bit pattern.
+ */
+#define FC_BAG 1               /* Total enclosure.  Should never occur. */
+#define FC_NEW_RIGHT 2
+#define FC_NEW_FAR 4
+#define FC_NEW_LEFT 8
+#define FC_NEW_MASK 0xe
+#define FC_CUT_THIS 0x10
+#define FC_CUT_RIGHT 0x20
+#define FC_CUT_FAR 0x40
+#define FC_CUT_LEFT 0x80
+#define FC_CUT_MASK 0xf0
+#define FC_TOTAL_MASK 0xff
+
+static unsigned
+fringe_changes(ModeInfo * mi, fringe_node_c * vertex,
+              unsigned side, vertex_type_c vtype,
+              fringe_node_c ** right, fringe_node_c ** far,
+              fringe_node_c ** left)
+{
+       fringe_node_c *v, *f = NULL;
+       unsigned    result = FC_NEW_FAR;        /* We clear this later if necessary. */
+
+       if (far)
+               *far = 0;
+       if (fills_vertex(mi, vtype, vertex)) {
+               result |= FC_CUT_THIS;
+       } else if (side == S_LEFT) {
+               result |= FC_NEW_RIGHT;
+               if (right)
+                       *right = 0;
+       } else {
+               result |= FC_NEW_LEFT;
+               if (left)
+                       *left = 0;
+       }
+
+       if (!(result & FC_NEW_LEFT)) {
+               v = vertex->next;
+               if (left)
+                       *left = v;
+               if (fills_vertex(mi, VT_LEFT(vtype), v)) {
+                       result = (result & ~FC_NEW_FAR) | FC_CUT_LEFT;
+                       f = v->next;
+                       if (far)
+                               *far = f;
+               }
+       }
+       if (!(result & FC_NEW_RIGHT)) {
+               v = vertex->prev;
+               if (right)
+                       *right = v;
+               if (fills_vertex(mi, VT_RIGHT(vtype), v)) {
+                       result = (result & ~FC_NEW_FAR) | FC_CUT_RIGHT;
+                       f = v->prev;
+                       if (far)
+                               *far = f;
+               }
+       }
+       if (!(result & FC_NEW_FAR)
+           && fills_vertex(mi, VT_FAR(vtype), f)) {
+               result |= FC_CUT_FAR;
+               result &= (~FC_NEW_LEFT & ~FC_NEW_RIGHT);
+               if (right && (result & FC_CUT_LEFT))
+                       *right = f->next;
+               if (left && (result & FC_CUT_RIGHT))
+                       *left = f->prev;
+       }
+       if (((result & FC_CUT_LEFT) && (result & FC_CUT_RIGHT))
+           || ((result & FC_CUT_THIS) && (result & FC_CUT_FAR)))
+               result |= FC_BAG;
+       return result;
+}
+
+
+/* A couple of lesser helper functions for add_tile. */
+static void
+add_vtype(fringe_node_c * vertex, unsigned side, vertex_type_c vtype)
+{
+       if (side == S_RIGHT)
+               vertex->tiles[vertex->n_tiles++] = vtype;
+       else {
+               register int i;
+
+               for (i = vertex->n_tiles; i > 0; i--)
+                       vertex->tiles[i] = vertex->tiles[i - 1];
+               vertex->tiles[0] = vtype;
+               vertex->n_tiles++;
+       }
+}
+
+static fringe_node_c *
+alloc_vertex(ModeInfo * mi, angle_c dir, fringe_node_c * from, tiling_c * tp)
+{
+       fringe_node_c *v;
+
+       if ((v = ALLOC_NODE(fringe_node_c)) == NULL) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "No memory in alloc_vertex()\n");
+               }
+               tp->busyLoop = CELEBRATE;
+               return v;
+       }
+       *v = *from;
+       add_unit_vec(dir, v->fived);
+       fived_to_loc(v->fived, tp, &(v->loc));
+       if (v->loc.x < 0 || v->loc.y < 0
+           || v->loc.x >= tp->width || v->loc.y >= tp->height) {
+               v->off_screen = True;
+               if (v->loc.x < -tp->width || v->loc.y < -tp->height
+                 || v->loc.x >= 2 * tp->width || v->loc.y >= 2 * tp->height)
+                       tp->done = True;
+       } else {
+               v->off_screen = False;
+               tp->fringe.n_nodes++;
+       }
+       v->n_tiles = 0;
+       v->rule_mask = (1 << N_VERTEX_RULES) - 1;
+       v->list_ptr = 0;
+       return v;
+}
+
+/*-
+ * Add a tile described by vtype to the side of vertex.  This must be
+ * allowed by the rules -- we do not check it here.  New vertices are
+ * allocated as necessary.  The fringe and the forced vertex pool are updated.
+ * The new tile is drawn on the display.
+ *
+ * One thing we do check here is whether the new tile causes an untiled
+ * area to become enclosed by the tiling.  If this would happen, the tile
+ * is not added.  The return value is true iff a tile was added.
+ */
+static int
+add_tile(ModeInfo * mi,
+        fringe_node_c * vertex, unsigned side, vertex_type_c vtype)
+{
+       tiling_c   *tp = &tilings[MI_SCREEN(mi)];
+
+       fringe_node_c
+               *left = NULL,
+               *right = NULL,
+               *far = NULL,
+               *node;
+       unsigned    fc = fringe_changes(mi, vertex, side, vtype, &right, &far, &left);
+
+       vertex_type_c
+               ltype = VT_LEFT(vtype),
+               rtype = VT_RIGHT(vtype),
+               ftype = VT_FAR(vtype);
+
+       /* By our conventions vertex->next lies to the left of vertex and
+          vertex->prev to the right. */
+
+       /* This should never occur. */
+       if (fc & FC_BAG) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in add_tile()\n");
+                       (void) fprintf(stderr, "fc = %d, FC_BAG = %d\n", fc, FC_BAG);
+               }
+       }
+       if (side == S_LEFT) {
+               if (right == NULL)
+                       if ((right = alloc_vertex(mi, vertex_dir(mi, vertex, S_LEFT) -
+                                       vtype_angle(vtype), vertex, tp)) == NULL)
+                               return False;
+               if (far == NULL)
+                       if ((far = alloc_vertex(mi, vertex_dir(mi, left, S_RIGHT) +
+                                       vtype_angle(ltype), left, tp)) == NULL)
+                               return False;
+       } else {
+               if (left == NULL)
+                       if ((left = alloc_vertex(mi, vertex_dir(mi, vertex, S_RIGHT) +
+                                       vtype_angle(vtype), vertex, tp)) == NULL)
+                               return False;
+               if (far == NULL)
+                       if ((far = alloc_vertex(mi, vertex_dir(mi, right, S_LEFT) -
+                                       vtype_angle(rtype), right, tp)) == NULL)
+                               return False;
+       }
+
+       /* Having allocated the new vertices, but before joining them with
+          the rest of the fringe, check if vertices with same coordinates
+          already exist.  If any such are found, give up. */
+       node = tp->fringe.nodes;
+       do {
+               if (((fc & FC_NEW_LEFT) && fived_equal(node->fived, left->fived))
+                   || ((fc & FC_NEW_RIGHT) && fived_equal(node->fived, right->fived))
+                   || ((fc & FC_NEW_FAR) && fived_equal(node->fived, far->fived))) {
+                       /* Better luck next time. */
+                       if (fc & FC_NEW_LEFT)
+                               delete_vertex(mi, left, tp);
+                       if (fc & FC_NEW_RIGHT)
+                               delete_vertex(mi, right, tp);
+                       if (fc & FC_NEW_FAR)
+                               delete_vertex(mi, far, tp);
+                       return False;
+               }
+               node = node->next;
+       } while (node != tp->fringe.nodes);
+
+       /* Rechain. */
+       if (!(fc & FC_CUT_THIS)) {
+               if (side == S_LEFT) {
+                       vertex->next = right;
+                       right->prev = vertex;
+               } else {
+                       vertex->prev = left;
+                       left->next = vertex;
+               }
+       }
+       if (!(fc & FC_CUT_FAR)) {
+               if (!(fc & FC_CUT_LEFT)) {
+                       far->next = left;
+                       left->prev = far;
+               }
+               if (!(fc & FC_CUT_RIGHT)) {
+                       far->prev = right;
+                       right->next = far;
+               }
+       }
+       draw_tile(vertex, right, far, left, vtype, mi);
+
+       /* Delete vertices that are no longer on the fringe.  Check the others. */
+       if (fc & FC_CUT_THIS) {
+               tp->fringe.nodes = far;
+               delete_vertex(mi, vertex, tp);
+       } else {
+               add_vtype(vertex, side, vtype);
+               check_vertex(mi, vertex, tp);
+               tp->fringe.nodes = vertex;
+       }
+       if (fc & FC_CUT_FAR)
+               delete_vertex(mi, far, tp);
+       else {
+               add_vtype(far, fc & FC_CUT_RIGHT ? S_LEFT : S_RIGHT, ftype);
+               check_vertex(mi, far, tp);
+       }
+       if (fc & FC_CUT_LEFT)
+               delete_vertex(mi, left, tp);
+       else {
+               add_vtype(left, fc & FC_CUT_FAR ? S_LEFT : S_RIGHT, ltype);
+               check_vertex(mi, left, tp);
+       }
+       if (fc & FC_CUT_RIGHT)
+               delete_vertex(mi, right, tp);
+       else {
+               add_vtype(right, fc & FC_CUT_FAR ? S_RIGHT : S_LEFT, rtype);
+               check_vertex(mi, right, tp);
+       }
+       return True;
+}
+
+
+/*-
+ * Add a forced tile to a given forced vertex.  Basically an easy job,
+ * since we know what to add.  But it might fail if adding the tile
+ * would cause some untiled area to become enclosed.  There is also another
+ * more exotic culprit: we might have a dislocation.  Fortunately, they
+ * are very rare (the PRL article reported that perfect tilings of over
+ * 2^50 tiles had been generated).  There is a version of the algorithm
+ * that doesn't produce dislocations, but it's a lot hairier than the
+ * simpler version I used.
+ */
+static int
+add_forced_tile(ModeInfo * mi, forced_node_c * node)
+{
+       tiling_c   *tp = &tilings[MI_SCREEN(mi)];
+       unsigned    side;
+       vertex_type_c vtype;
+       rule_match_c hits[MAX_TILES_PER_VERTEX * N_VERTEX_RULES];
+       int         n;
+
+       if (node->forced_sides == (S_LEFT | S_RIGHT))
+               side = NRAND(2) ? S_LEFT : S_RIGHT;
+       else
+               side = node->forced_sides;
+       n = match_rules(node->vertex, hits, True);
+       n = find_completions(node->vertex, hits, n, side, &vtype /*, True */ );
+       if (n <= 0) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in add_forced_tile()\n");
+                       (void) fprintf(stderr, "n = %d\n", n);
+               }
+       }
+       return add_tile(mi, node->vertex, side, vtype);
+}
+
+
+/*-
+ * Whether the addition of a tile of vtype on the given side of vertex
+ * would conform to the rules.  The efficient way to do this would be
+ * to add the new tile and then use the same type of search as in
+ * match_rules.  However, this function is not a performance
+ * bottleneck (only needed for random tile additions, which are
+ * relatively infrequent), so I will settle for a simpler implementation.
+ */
+static int
+legal_move(fringe_node_c * vertex, unsigned side, vertex_type_c vtype)
+{
+       rule_match_c hits[MAX_TILES_PER_VERTEX * N_VERTEX_RULES];
+       vertex_type_c legal_vt[MAX_COMPL];
+       int         n_hits, n_legal, i;
+
+       n_hits = match_rules(vertex, hits, False);
+       n_legal = find_completions(vertex, hits, n_hits, side, legal_vt /*, False */ );
+       for (i = 0; i < n_legal; i++)
+               if (legal_vt[i] == vtype)
+                       return True;
+       return False;
+}
+
+
+/*-
+ * Add a randomly chosen tile to a given vertex.  This requires more checking
+ * as we must make sure the new tile conforms to the vertex rules at every
+ * vertex it touches. */
+static void
+add_random_tile(fringe_node_c * vertex, ModeInfo * mi)
+{
+       fringe_node_c *right, *left, *far;
+       int         i, j, n, n_hits, n_good;
+       unsigned    side, fc, no_good, s;
+       vertex_type_c vtypes[MAX_COMPL];
+       rule_match_c hits[MAX_TILES_PER_VERTEX * N_VERTEX_RULES];
+       tiling_c   *tp = &tilings[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) > 2) {
+               tp->thick_color = NRAND(MI_NPIXELS(mi));
+               /* Insure good contrast */
+               tp->thin_color = (NRAND(2 * MI_NPIXELS(mi) / 3) + tp->thick_color +
+                                 MI_NPIXELS(mi) / 6) % MI_NPIXELS(mi);
+       } else
+               tp->thick_color = tp->thin_color = MI_WHITE_PIXEL(mi);
+       n_hits = match_rules(vertex, hits, False);
+       side = NRAND(2) ? S_LEFT : S_RIGHT;
+       n = find_completions(vertex, hits, n_hits, side, vtypes /*, False */ );
+       /* One answer would mean a forced tile. */
+       if (n <= 0) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in add_random_tile()\n");
+                       (void) fprintf(stderr, "n = %d\n", n);
+               }
+       }
+       no_good = 0;
+       n_good = n;
+       for (i = 0; i < n; i++) {
+               fc = fringe_changes(mi, vertex, side, vtypes[i], &right, &far, &left);
+               if (fc & FC_BAG) {
+                       tp->done = True;
+                       if (MI_IS_VERBOSE(mi)) {
+                               (void) fprintf(stderr, "Weirdness in add_random_tile()\n");
+                               (void) fprintf(stderr, "fc = %d, FC_BAG = %d\n", fc, FC_BAG);
+                       }
+               }
+               if (right) {
+                       s = (((fc & FC_CUT_FAR) && (fc & FC_CUT_LEFT)) ? S_RIGHT : S_LEFT);
+                       if (!legal_move(right, s, VT_RIGHT(vtypes[i]))) {
+                               no_good |= (1 << i);
+                               n_good--;
+                               continue;
+                       }
+               }
+               if (left) {
+                       s = (((fc & FC_CUT_FAR) && (fc & FC_CUT_RIGHT)) ? S_LEFT : S_RIGHT);
+                       if (!legal_move(left, s, VT_LEFT(vtypes[i]))) {
+                               no_good |= (1 << i);
+                               n_good--;
+                               continue;
+                       }
+               }
+               if (far) {
+                       s = ((fc & FC_CUT_LEFT) ? S_RIGHT : S_LEFT);
+                       if (!legal_move(far, s, VT_FAR(vtypes[i]))) {
+                               no_good |= (1 << i);
+                               n_good--;
+                       }
+               }
+       }
+       if (n_good <= 0) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in add_random_tile()\n");
+                       (void) fprintf(stderr, "n_good = %d\n", n_good);
+               }
+       }
+       n = NRAND(n_good);
+       for (i = j = 0; i <= n; i++, j++)
+               while (no_good & (1 << j))
+                       j++;
+
+       if (!add_tile(mi, vertex, side, vtypes[j - 1])) {
+               tp->done = True;
+               if (MI_IS_VERBOSE(mi)) {
+                       (void) fprintf(stderr, "Weirdness in add_random_tile()\n");
+               }
+               free_penrose(tp);
+       }
+}
+
+/* One step of the growth algorithm. */
+void
+draw_penrose(ModeInfo * mi)
+{
+       int         i = 0, n;
+       forced_node_c *p;
+       tiling_c   *tp;
+
+       if (tilings == NULL)
+               return;
+       tp = &tilings[MI_SCREEN(mi)];
+       if (tp->fringe.nodes == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       p = tp->forced.first;
+       if (tp->busyLoop > 0) {
+               tp->busyLoop--;
+               return;
+       }
+       if (tp->done || tp->failures >= 100) {
+               init_penrose(mi);
+               return;
+       }
+       /* Check for the initial "2-gon". */
+       if (tp->fringe.nodes->prev == tp->fringe.nodes->next) {
+               vertex_type_c vtype = (unsigned char) (VT_TOTAL_MASK & LRAND());
+
+               MI_CLEARWINDOW(mi);
+
+               if (!add_tile(mi, tp->fringe.nodes, S_LEFT, vtype))
+                       free_penrose(tp);
+               return;
+       }
+       /* No visible nodes left. */
+       if (tp->fringe.n_nodes == 0) {
+               tp->done = True;
+               tp->busyLoop = COMPLETION;      /* Just finished drawing */
+               return;
+       }
+       if (tp->forced.n_visible > 0 && tp->failures < 10) {
+               n = NRAND(tp->forced.n_visible);
+               for (;;) {
+                       while (p->vertex->off_screen)
+                               p = p->next;
+                       if (i++ < n)
+                               p = p->next;
+                       else
+                               break;
+               }
+       } else if (tp->forced.n_nodes > 0) {
+               n = NRAND(tp->forced.n_nodes);
+               while (i++ < n)
+                       p = p->next;
+       } else {
+               fringe_node_c *fringe_p = tp->fringe.nodes;
+
+               n = NRAND(tp->fringe.n_nodes);
+               i = 0;
+               for (; i <= n; i++)
+                       do {
+                               fringe_p = fringe_p->next;
+                       } while (fringe_p->off_screen);
+               add_random_tile(fringe_p, mi);
+               tp->failures = 0;
+               return;
+       }
+       if (add_forced_tile(mi, p))
+               tp->failures = 0;
+       else
+               tp->failures++;
+}
+
+
+/* Total clean-up. */
+void
+release_penrose(ModeInfo * mi)
+{
+       if (tilings != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_penrose(&tilings[screen]);
+               (void) free((void *) tilings);
+               tilings = NULL;
+       }
+}
+
+#endif /* MODE_penrose */
diff --git a/modes/petal.c b/modes/petal.c
new file mode 100644 (file)
index 0000000..94771cf
--- /dev/null
@@ -0,0 +1,369 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* petal --- mathematical flowers */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)petal.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 12-Aug-1995: xlock version
+ * Jan-1995: xscreensaver version (Jamie Zawinski <jwz@jwz.org>)
+ * 24-Jun-1994: X11 version (Dale Moore  <Dale.Moore@cs.cmu.edu>)
+ *              Based on a program for some old PDP-11 Graphics
+ *              Display Processors at CMU.
+ */
+
+/*-
+ * original copyright
+ * Copyright \(co 1994, by Carnegie Mellon University.  Permission to use,
+ * copy, modify, distribute, and sell this software and its documentation
+ * for any purpose is hereby granted without fee, provided fnord that the
+ * above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation.
+ * No representations are made about the  suitability of fnord this software
+ * for any purpose.  It is provided "as is" without express or implied
+ * warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Petal"
+#define HACK_INIT init_petal
+#define HACK_DRAW draw_petal
+#define petal_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: -500 \n" \
+ "*cycles: 400 \n" \
+ "*ncolors: 64 \n" \
+ "*wireframe: False \n" \
+ "*fullrandom: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_petal
+
+ModeSpecOpt petal_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   petal_description =
+{"petal", "init_petal", "draw_petal", "release_petal",
+ "refresh_petal", "init_petal", NULL, &petal_opts,
+ 10000, -500, 400, 1, 64, 1.0, "",
+ "Shows various GCD Flowers", 0, NULL};
+
+#endif
+
+#define TWOPI (2.0*M_PI)
+
+/*-
+ * If MAXLINES is too big, we might not be able to get it
+ * to the X server in the 2byte length field.
+ * Must be less * than 16k
+ */
+#define MAXLINES (16*1024)
+
+/*-
+ * If the petal has only this many lines, it must be ugly and we do not
+ * want to see it.
+ */
+#define MINLINES 5
+
+typedef struct {
+       Bool        painted;
+       int         width, height;
+       int         lines;
+       int         time;
+       int         npoints;
+       long        color;
+       XPoint     *points;
+       Bool        wireframe;
+} petalstruct;
+
+static petalstruct *petals = NULL;
+
+/*-
+ * Macro:
+ *   sine
+ *   cosine
+ * Description:
+ *   Assume that degrees is .. oh 360... meaning that
+ *   there are 360 degress in a circle.  Then this function
+ *   would return the sin of the angle in degrees.  But lets
+ *   say that they are really big degrees, with 4 big degrees
+ *   the same as one regular degree.  Then this routine
+ *   would be called mysin(t, 90) and would return sin(t degrees * 4)
+ */
+#define sine(t, degrees) sin(t * TWOPI / (degrees))
+#define cosine(t, degrees) cos(t * TWOPI / (degrees))
+
+/*-
+ * Macro:
+ *   rand_range
+ * Description:
+ *   Return a random number between a inclusive  and b exclusive.
+ *    rand (3, 6) returns 3 or 4 or 5, but not 6.
+ */
+#define rand_range(a, b) (a + NRAND(b - a))
+
+static int
+gcd(int m, int n)
+/*-
+ * Greatest Common Divisor (also Greatest common factor).
+ */
+{
+       int         r;
+
+       for (;;) {
+               r = m % n;
+               if (r == 0)
+                       return (n);
+               m = n;
+               n = r;
+       }
+}
+
+static int
+numlines(int a, int b, int d)
+/*-
+ * Description:
+ *
+ *      Given parameters a and b, how many lines will we have to draw?
+ *
+ * Algorithm:
+ *
+ *      This algorithm assumes that r = sin (theta * a), where we
+ *      evaluate theta on multiples of b.
+ *
+ *      LCM (i, j) = i * j / GCD (i, j);
+ *
+ *      So, at LCM (b, 360) we start over again.  But since we
+ *      got to LCM (b, 360) by steps of b, the number of lines is
+ *      LCM (b, 360) / b.
+ *
+ *      If a is odd, then at 180 we cross over and start the
+ *      negative.  Someone should write up an elegant way of proving
+ *      this.  Why?  Because I'm not convinced of it myself.
+ *
+ */
+{
+#define odd(x) (x & 1)
+#define even(x) (!odd(x))
+       if (odd(a) && odd(b) && even(d))
+               d /= 2;
+       return (d / gcd(d, b));
+#undef odd
+}
+
+static int
+compute_petal(XPoint * points, int lines, int sizex, int sizey)
+/*-
+ * Description:
+ *
+ *    Basically, it's combination spirograph and string art.
+ *    Instead of doing lines, we just use a complex polygon,
+ *    and use an even/odd rule for filling in between.
+ *
+ *    The spirograph, in mathematical terms is a polar
+ *    plot of the form r = sin (theta * c);
+ *    The string art of this is that we evaluate that
+ *    function only on certain multiples of theta.  That is
+ *    we let theta advance in some random increment.  And then
+ *    we draw a straight line between those two adjacent points.
+ *
+ *    Eventually, the lines will start repeating themselves
+ *    if we've evaluated theta on some rational portion of the
+ *    whole.
+ *
+ *    The number of lines generated is limited to the
+ *    ratio of the increment we put on theta to the whole.
+ *    If we say that there are 360 degrees in a circle, then we
+ *    will never have more than 360 lines.
+ *
+ * Return:
+ *
+ *    The number of points.
+ *
+ */
+{
+       int         a, b, d;    /* These describe a unique petal */
+
+       double      r;
+       int         theta = 0;
+       XPoint     *p = points;
+       int         count;
+       int         npoints;
+
+       for (;;) {
+               d = lines;
+
+               a = rand_range(1, d);
+               b = rand_range(1, d);
+               npoints = numlines(a, b, d);
+               if (npoints >= MINLINES)
+                       break;
+       }
+
+       /* it might be nice to try to move as much sin and cos computing
+        * (or at least the argument computing) out of the loop.
+        */
+       for (count = npoints; count--;) {
+               r = sine(theta * a, d);
+
+               /* Convert from polar to cartesian coordinates */
+               /* We could round the results, but coercing seems just fine */
+               p->x = (int) (sine(theta, d) * r * sizex + sizex);
+               p->y = (int) (cosine(theta, d) * r * sizey + sizey);
+
+               /* Advance index into array */
+               p++;
+
+               /* Advance theta */
+               theta += b;
+               theta %= d;
+       }
+       *p = points[0];         /* Tack on another for XDrawLines */
+
+       return (npoints);
+}
+
+static void
+petal(ModeInfo * mi)
+{
+       petalstruct *pp = &petals[MI_SCREEN(mi)];
+
+       XSetForeground(MI_DISPLAY(mi), MI_GC(mi), pp->color);
+       if (pp->wireframe) {
+               XDrawLines(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                          pp->points, pp->npoints + 1, CoordModeOrigin);
+       } else {
+               XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                         pp->points, pp->npoints, Complex, CoordModeOrigin);
+       }
+}
+
+static void
+random_petal(ModeInfo * mi)
+{
+       petalstruct *pp = &petals[MI_SCREEN(mi)];
+
+       pp->npoints = compute_petal(pp->points, pp->lines,
+                                   pp->width / 2, pp->height / 2);
+
+       if (MI_NPIXELS(mi) <= 2)
+               pp->color = MI_WHITE_PIXEL(mi);
+       else
+               pp->color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       petal(mi);
+}
+
+void
+init_petal(ModeInfo * mi)
+{
+       petalstruct *pp;
+
+       if (petals == NULL) {
+               if ((petals = (petalstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (petalstruct))) == NULL)
+                       return;
+       }
+       pp = &petals[MI_SCREEN(mi)];
+
+       pp->lines = MI_COUNT(mi);
+       if (pp->lines > MAXLINES)
+               pp->lines = MAXLINES;
+       else if (pp->lines < -MINLINES) {
+               if (pp->points) {
+                       (void) free((void *) pp->points);
+                       pp->points = NULL;
+               }
+               pp->lines = NRAND(-pp->lines - MINLINES + 1) + MINLINES;
+       } else if (pp->lines < MINLINES)
+               pp->lines = MINLINES;
+       if (!pp->points)
+               if ((pp->points = (XPoint *) malloc((pp->lines + 1) *
+                               sizeof (XPoint))) == NULL) {
+                       return;
+               }
+       pp->width = MI_WIDTH(mi);
+       pp->height = MI_HEIGHT(mi);
+
+       pp->time = 0;
+       if (MI_IS_FULLRANDOM(mi))
+               pp->wireframe = (Bool) (LRAND() & 1);
+       else
+               pp->wireframe = MI_IS_WIREFRAME(mi);
+
+       MI_CLEARWINDOW(mi);
+       pp->painted = False;
+
+       random_petal(mi);
+}
+
+void
+draw_petal(ModeInfo * mi)
+{
+       petalstruct *pp;
+
+       if (petals == NULL)
+               return;
+       pp = &petals[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (++pp->time > MI_CYCLES(mi))
+               init_petal(mi);
+       else
+               pp->painted = True;
+}
+
+void
+release_petal(ModeInfo * mi)
+{
+       if (petals != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       petalstruct *pp = &petals[screen];
+
+                       if (pp->points)
+                               (void) free((void *) pp->points);
+               }
+               (void) free((void *) petals);
+               petals = NULL;
+       }
+}
+
+void
+refresh_petal(ModeInfo * mi)
+{
+       petalstruct *pp;
+
+       if (petals == NULL)
+               return;
+       pp = &petals[MI_SCREEN(mi)];
+
+       if (pp->painted) {
+               MI_CLEARWINDOW(mi);
+               petal(mi);
+               pp->painted = False;
+       }
+}
+
+#endif /* MODE_petal */
diff --git a/modes/polyominoes.c b/modes/polyominoes.c
new file mode 100644 (file)
index 0000000..41ca20e
--- /dev/null
@@ -0,0 +1,2305 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* polyominoes --- Shows attempts to place polyominoes into a rectangle */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)polyominoes.c 5.01 2000/12/18 xlockmore";
+
+#endif
+
+/*
+ * Copyright (c) 2000 by Stephen Montgomery-Smith <stephen@math.missouri.edu>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 07-Jan-2001: Made improvement to the search algorithm for the puzzles
+ *              involving identical polyominoes (via the variable 
+ *              reason_to_not_attach).  By Stephen Montgomery-Smith.
+ * 20-Dec-2000: Added more puzzles at David Bagley's request.
+ * 27-Nov-2000: Adapted from euler2d.c Copyright (c) 2000 by Stephen
+ *              Montgomery-Smith
+ * 05-Jun-2000: Adapted from flow.c Copyright (c) 1996 by Tim Auckland
+ * 18-Jul-1996: Adapted from swarm.c Copyright (c) 1991 by Patrick J. Naughton.
+ * 31-Aug-1990: Adapted from xswarm by Jeff Butterworth. (butterwo@ncsc.org)
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Polyominoes"
+#define HACK_INIT init_polyominoes
+#define HACK_DRAW draw_polyominoes
+#define polyominoes_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+"*count: 1024 \n" \
+"*cycles: 3000 \n" \
+"*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_polyominoes
+#define DEF_IDENTICAL "False"
+#define DEF_PLAIN "False"
+
+static Bool identical;
+static Bool plain;
+
+static XrmOptionDescRec opts[] =
+{
+  {(char *) "-identical", (char *) ".polyominoes.identical", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+identical", (char *) ".polyominoes.identical", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-plain", (char *) ".polyominoes.plain", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+plain", (char *) ".polyominoes.plain", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+  {(caddr_t *) &identical, (char *) "identical", (char *) "Identical", (char *) DEF_IDENTICAL, t_Bool},
+  {(caddr_t *) & plain, (char *) "plain", (char *) "Plain", (char *) DEF_PLAIN, t_Bool}
+};
+static OptionStruct desc[] =
+{
+  {(char *) "-/+identical", (char *) "turn on/off puzzles where the polyomino pieces are identical"},
+  {(char *) "-/+plain", (char *) "turn on/off plain pieces"}
+};
+
+ModeSpecOpt polyominoes_opts =
+{sizeof opts / sizeof opts[0], opts,
+ sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   polyominoes_description = {
+  "polyominoes", "init_polyominoes", "draw_polyominoes", "release_polyominoes",
+  "refresh_polyominoes", "init_polyominoes", NULL, &polyominoes_opts,
+  6000, 1, 8192, 1, 64, 1.0, "",
+  "Shows attempts to place polyominoes into a rectangle", 0, NULL
+};
+
+#endif
+
+/* Each polyomino is described by several quantities:
+   len:             the number of squares in the polyomino;
+   point:           the list of points;
+   tranform_len:    the number of items in transform_list;
+   transform_list:  a list of transformations that need to be done in order
+                    to get all rotations and reflections (see the function
+                    transform below);
+   max_white:       the maximum number of white squares covered if polyomino
+                    is placed on a chess board;
+   color:           it's display color;
+   attached:        whether it is currently attached to the rectangle;
+   attach_point:    point on rectangle where attached;
+   point_no:        the number of the point where it is attached;
+   transform_index: which element of transform_list is currently being used.
+*/
+
+typedef struct {int x,y;} point_type;
+
+typedef struct {int len; point_type *point;
+                int transform_len, transform_list[8], max_white;
+               unsigned long color;
+               int attached;
+               point_type attach_point;
+               int point_no, transform_index;} polyomino_type;
+
+
+typedef struct _polyominoesstruct{
+  int wait;
+
+  int width, height;
+  unsigned border_color;
+  int mono;
+
+  polyomino_type *polyomino;
+  int nr_polyominoes;
+  Bool identical, use3D;
+  int *attach_list;
+  int nr_attached;
+
+/* The array that tells where the polyominoes are attached. */
+  int *array, *changed_array;
+
+/* These specify the dimensions of how things appear on the screen. */
+  int box, x_margin, y_margin;
+
+/* These booleans decide in which way to try to attach the polyominoes. */
+  int left_right, top_bottom;
+
+/* Bitmaps for display purposes. */
+  int use_bitmaps;
+  XImage *bitmaps[256];
+
+/* Structures used for display purposes if there is not enough memory
+   to allocate bitmaps (or if the screen is small). */
+  XSegment *lines;
+  XRectangle *rectangles;
+
+/* A procedure that may be used to see if certain configurations
+   are permissible. */
+  int (*check_ok)(struct _polyominoesstruct *sp);
+
+/* Tells program that solutions are invariant under 180 degree
+   rotation. */
+  int rot180;
+
+/* This is a variable used in the case that all the polyominoes are identical
+   that will further prune the search tree.  Essentially it will be
+   int reason_to_not_attach[nr_polynominoes][nr_polynominoes];
+   Let me first explain the effect it is trying to overcome.  Often
+   in the search process, the computer will first try to fit shapes into
+   a region (call it A), and then into another region (call it B) that is
+   essentially disjoint from A.  But it may be that it just is not possible
+   to fit shapes into region B.  So it fits something into A, and then
+   tries to fit something into B.  Failing it fits something else into A,
+   and then tried again to fit something into B.  Thus the program is trying
+   again and again to fit something into B, when it should have figured out
+   the first time that it was impossible.
+
+   To overcome this, everytime we try to attach a piece, we collect the reasons
+   why it cannot be attached (a boolean for each piece that got in the way).
+   If we see that a piece cannot be attached, we detach the other pieces until
+   we have detached at least one piece for which the boolean reason_to_not_attach
+   is set.
+*/
+  int *reason_to_not_attach;
+
+  int counter;
+} polyominoesstruct;
+
+#define ARRAY(x,y)         (sp->array[(x)*sp->height+(y)])
+#define CHANGED_ARRAY(x,y) (sp->changed_array[(x)*sp->height+(y)])
+#define ARRAY_P(p)         (sp->array[(p).x*sp->height+(p).y])
+#define CHANGED_ARRAY_P(p) (sp->changed_array[(p).x*sp->height+(p).y])
+#define ARR(x,y) (((x)<0||(x)>=sp->width||(y)<0||(y)>=sp->height)?-2:ARRAY(x,y))
+
+#define REASON_TO_NOT_ATTACH(x,y) (sp->reason_to_not_attach[(x)*sp->nr_polyominoes+(y)])
+
+#define ROUND8(n) ((((n)+7)/8)*8)
+
+/* Defines to index the bitmaps.  A set bit indicates that an edge or
+   corner is required. */
+#define LEFT (1<<0)
+#define RIGHT (1<<1)
+#define UP (1<<2)
+#define DOWN (1<<3)
+#define LEFT_UP (1<<4)
+#define LEFT_DOWN (1<<5)
+#define RIGHT_UP (1<<6)
+#define RIGHT_DOWN (1<<7)
+#define IS_LEFT(n) ((n) & LEFT)
+#define IS_RIGHT(n) ((n) & RIGHT)
+#define IS_UP(n) ((n) & UP)
+#define IS_DOWN(n) ((n) & DOWN)
+#define IS_LEFT_UP(n) ((n) & LEFT_UP)
+#define IS_LEFT_DOWN(n) ((n) & LEFT_DOWN)
+#define IS_RIGHT_UP(n) ((n) & RIGHT_UP)
+#define IS_RIGHT_DOWN(n) ((n) & RIGHT_DOWN)
+
+/* Defines to access the bitmaps. */
+#define BITNO(x,y) ((x)+(y)*ROUND8(sp->box))
+#define SETBIT(n,x,y) {data[BITNO(x,y)/8] |= 1<<(BITNO(x,y)%8);}
+#define RESBIT(n,x,y) {data[BITNO(x,y)/8] &= ~(1<<(BITNO(x,y)%8));}
+#define TWOTHIRDSBIT(n,x,y) {if ((x+y-1)%3) SETBIT(n,x,y) else RESBIT(n,x,y)}
+#define HALFBIT(n,x,y) {if ((x-y)%2) SETBIT(n,x,y) else RESBIT(n,x,y)}
+#define THIRDBIT(n,x,y) {if (!((x-y-1)%3)) SETBIT(n,x,y) else RESBIT(n,x,y)}
+#define THREEQUARTERSBIT(n,x,y) \
+  {if ((y%2)||((x+2+y/2+1)%2)) SETBIT(n,x,y) else RESBIT(n,x,y)}
+#define NOTHALFBIT(n,x,y) {if ((x-y)%2) RESBIT(n,x,y) else SETBIT(n,x,y)}
+
+/* Parameters for bitmaps. */
+#define G ((sp->box/45)+1)         /* 1/2 of gap between polyominoes. */
+#define T ((sp->box<=12)?1:(G*2))  /* Thickness of walls of polyominoes. */
+#define R ((sp->box<=12)?1:(G*6))  /* Amount of rounding. */
+#define RT ((sp->box<=12)?1:(G*3)) /* Thickness of wall of rounded parts. 
+                                      Here 3 is an approximation to 2 sqrt(2). */
+#define RR 0   /* Roof ridge thickness */
+
+#if 0
+/* A list of those bitmaps we need to create to display any pentomino. */
+/* (not used right now because it does not seem to work for hexonimoes.) */
+
+static int bitmaps_needed[] =
+{
+ LEFT_UP|LEFT_DOWN|RIGHT_UP|RIGHT_DOWN,
+
+ LEFT|RIGHT_UP|RIGHT_DOWN,
+ RIGHT|LEFT_UP|LEFT_DOWN,
+ UP|LEFT_DOWN|RIGHT_DOWN,
+ DOWN|LEFT_UP|RIGHT_UP,
+ LEFT|RIGHT_UP,
+ RIGHT|LEFT_UP,
+ UP|LEFT_DOWN,
+ DOWN|LEFT_UP,
+ LEFT|RIGHT_DOWN,
+ RIGHT|LEFT_DOWN,
+ UP|RIGHT_DOWN,
+ DOWN|RIGHT_UP,
+
+/* These needed for hexonimoes*/
+ LEFT,
+ RIGHT,
+ UP,
+ DOWN,
+ LEFT_DOWN|RIGHT_UP|RIGHT_DOWN,
+ LEFT_UP|RIGHT_UP|RIGHT_DOWN,
+ LEFT_UP|LEFT_DOWN|RIGHT_DOWN,
+ LEFT_UP|LEFT_DOWN|RIGHT_UP,
+
+ LEFT|UP|RIGHT_DOWN,
+ LEFT|DOWN|RIGHT_UP,
+ RIGHT|UP|LEFT_DOWN,
+ RIGHT|DOWN|LEFT_UP,
+ LEFT|UP,
+ LEFT|DOWN,
+ RIGHT|UP,
+ RIGHT|DOWN,
+
+ LEFT|RIGHT,
+ UP|DOWN,
+
+ RIGHT|UP|DOWN,
+ LEFT|UP|DOWN,
+ LEFT|RIGHT|DOWN,
+ LEFT|RIGHT|UP,
+
+ -1
+};
+
+static int bitmap_needed(int n) {
+  int i;
+
+  for (i=0;bitmaps_needed[i]!=-1;i++)
+    if (n == bitmaps_needed[i])
+      return 1;
+  return 0;
+}
+
+#endif
+
+/* Some debugging routines.
+
+static void print_board(polyominoesstruct *sp) {
+  int x,y;
+  for (y=0;y<sp->height;y++) {
+    for (x=0;x<sp->width;x++)
+      if (ARRAY(x,y) == -1)
+        fprintf(stderr," ");
+      else
+        fprintf(stderr,"%c",'a'+ARRAY(x,y));
+    fprintf(stderr,"\n");
+  }
+  fprintf(stderr,"\n");
+}
+
+static void print_points(point_type *point, int len) {
+  int i;
+
+  for (i=0;i<len;i++)
+    fprintf(stderr,"(%d %d) ",point[i].x,point[i].y);
+}
+
+static void print_polyomino(polyomino_type poly) {
+  int i;
+
+  print_points(poly.point,poly.len);
+  fprintf(stderr,"\n");
+  for (i=0;i<poly.transform_len;i++)
+    fprintf(stderr,"%d ",poly.transform_list[i]);
+  fprintf(stderr,"\n");
+}
+*/
+
+static polyominoesstruct *polyominoeses = NULL;
+
+static
+void random_permutation(int n, int a[]) {
+  int i,j,k,r;
+
+  for (i=0;i<n;i++) a[i] = -1;
+  for (i=0;i<n;i++) {
+    r=NRAND(n-i);
+    k=0;
+    while(a[k]!=-1) k++;
+    for (j=0;j<r;j++) {
+      k++;
+      while(a[k]!=-1) k++;
+    }
+    a[k]=i;
+  }
+}
+
+
+/************************************************************
+These are the routines for manipulating the polyominoes and
+attaching and detaching them from the rectangle.
+************************************************************/
+
+static void transform(point_type in, point_type offset, int transform_no, 
+                      point_type attach_point, point_type *out) {
+  switch (transform_no) {
+    case 0: out->x=in.x-offset.x+attach_point.x;
+            out->y=in.y-offset.y+attach_point.y;
+            break;
+    case 1: out->x=-(in.y-offset.y)+attach_point.x;
+            out->y=in.x-offset.x+attach_point.y;
+            break;
+    case 2: out->x=-(in.x-offset.x)+attach_point.x;
+            out->y=-(in.y-offset.y)+attach_point.y;
+            break;
+    case 3: out->x=in.y-offset.y+attach_point.x;
+            out->y=-(in.x-offset.x)+attach_point.y;
+            break;
+    case 4: out->x=-(in.x-offset.x)+attach_point.x;
+            out->y=in.y-offset.y+attach_point.y;
+            break;
+    case 5: out->x=in.y-offset.y+attach_point.x;
+            out->y=in.x-offset.x+attach_point.y;
+            break;
+    case 6: out->x=in.x-offset.x+attach_point.x;
+            out->y=-(in.y-offset.y)+attach_point.y;
+            break;
+    case 7: out->x=-(in.y-offset.y)+attach_point.x;
+            out->y=-(in.x-offset.x)+attach_point.y;
+            break;
+  }
+}
+
+static int first_poly_no(polyominoesstruct *sp) {
+  int poly_no;
+
+  poly_no = 0;
+  while(poly_no<sp->nr_polyominoes && sp->polyomino[poly_no].attached)
+    poly_no++;
+  return poly_no;
+}
+
+static void next_poly_no(polyominoesstruct *sp, int *poly_no) {
+
+  if (sp->identical) {
+    *poly_no = sp->nr_polyominoes;
+  } else {
+    do {
+      (*poly_no)++;
+    } while (*poly_no<sp->nr_polyominoes && sp->polyomino[*poly_no].attached);
+  }
+}
+
+/* check_all_regions_multiple_of looks for connected regions of 
+   blank spaces, and returns 0 if it finds a connected region containing
+   a number of blanks that is not a multiple of n.
+*/
+
+static void count_adjacent_blanks(polyominoesstruct *sp, int *count, int x, int y, int blank_mark) {
+
+  if (ARRAY(x,y) == -1) {
+    (*count)++;
+    ARRAY(x,y) = blank_mark;
+    if (x>=1) count_adjacent_blanks(sp, count,x-1,y,blank_mark);
+    if (x<sp->width-1) count_adjacent_blanks(sp, count,x+1,y,blank_mark);
+    if (y>=1) count_adjacent_blanks(sp, count,x,y-1,blank_mark);
+    if (y<sp->height-1) count_adjacent_blanks(sp, count,x,y+1,blank_mark);
+  }
+}
+
+static int check_all_regions_multiple_of(polyominoesstruct *sp, int n) {
+  int x,y,count,good = 1;
+
+  for (x=0;x<sp->width && good;x++) for (y=0;y<sp->height && good;y++) {
+    count = 0;
+    count_adjacent_blanks(sp, &count,x,y,-2);
+    good = count%n == 0;
+  }
+
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++)
+    if (ARRAY(x,y) == -2)
+      ARRAY(x,y) = -1;
+
+  return good;
+}
+
+static int check_all_regions_positive_combination_of(polyominoesstruct *sp, int m, int n) {
+  int x,y,count,good = 1;
+
+  for (x=0;x<sp->width && good;x++) for (y=0;y<sp->height && good;y++) {
+    count = 0;
+    count_adjacent_blanks(sp, &count,x,y,-2);
+    good = 0;
+    for (;count>=0 && !good;count-=m)
+      good = count%n == 0;
+  }
+
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++)
+    if (ARRAY(x,y) == -2)
+      ARRAY(x,y) = -1;
+
+  return good;
+}
+
+static int find_smallest_blank_component(polyominoesstruct *sp) {
+  int x,y,size,smallest_size,blank_mark,smallest_mark;
+
+  smallest_mark = blank_mark = -10;
+  smallest_size = 1000000000;
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++) if (ARRAY(x,y) == -1) {
+    size = 0;
+    count_adjacent_blanks(sp, &size,x,y,blank_mark);
+    if (size<smallest_size) {
+      smallest_mark = blank_mark;
+      smallest_size = size;
+    }
+    blank_mark--;
+  }
+
+  return smallest_mark;
+}
+
+/* "Chess board" check - see init_max_whites_list above for more details.
+*/
+/* If the rectangle is alternatively covered by white and black
+   squares (chess board style), then this gives the list of
+   the maximal possible whites covered by each polyomino.  It
+   is used by the function whites_ok which makes sure that the
+   array has a valid number of white or black remaining blanks left.
+*/
+
+static int whites_ok(polyominoesstruct *sp) {
+  int x,y,poly_no,whites=0,blacks=0,max_white=0,min_white=0;
+
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++) {
+    if (ARRAY(x,y) == -1 && (x+y)%2) whites++;
+    if (ARRAY(x,y) == -1 && (x+y+1)%2) blacks++;
+  }
+  for (poly_no=0;poly_no<sp->nr_polyominoes;poly_no++) if (!sp->polyomino[poly_no].attached) {
+    max_white += sp->polyomino[poly_no].max_white;
+    min_white += sp->polyomino[poly_no].len - sp->polyomino[poly_no].max_white;
+  }
+  return (min_white <= blacks && min_white <= whites
+          && blacks <= max_white && whites <= max_white);
+}
+
+/* This routine looks at the point (x,y) and sees how many polyominoes
+   and all their various transforms may be attached there.
+*/
+
+static int
+score_point(polyominoesstruct *sp, int x, int y, int min_score_so_far) {
+  int poly_no, point_no, transform_index, i, attachable;
+  point_type attach_point, target_point;
+  int score = 0;
+
+  if (x>=1 && x<sp->width-1 && y>=1 && y<sp->height-1 &&
+      ARRAY(x-1,y-1)<0 && ARRAY(x-1,y)<0 && ARRAY(x-1,y+1)<0 && 
+      ARRAY(x+1,y-1)<0 && ARRAY(x+1,y)<0 && ARRAY(x+1,y+1)<0 && 
+      ARRAY(x,y-1)<0 && ARRAY(x,y+1)<0)
+    return 10000;
+
+  attach_point.x = x;
+  attach_point.y = y;
+  for (poly_no=first_poly_no(sp);poly_no<sp->nr_polyominoes;next_poly_no(sp,&poly_no))
+  if (!sp->polyomino[poly_no].attached) {
+    for (point_no=0;point_no<sp->polyomino[poly_no].len;point_no++)
+    for (transform_index=0;transform_index<sp->polyomino[poly_no].transform_len;transform_index++) {
+      attachable = 1;
+      for (i=0;i<sp->polyomino[poly_no].len;i++) {
+        transform(sp->polyomino[poly_no].point[i],
+                  sp->polyomino[poly_no].point[point_no],
+                  sp->polyomino[poly_no].transform_list[transform_index], 
+                  attach_point, &target_point);
+        if ( ! ((target_point.x>=0) && (target_point.x<sp->width) 
+                  && (target_point.y>=0) && (target_point.y<sp->height)
+                  && (ARRAY_P(target_point)<0))) {
+          attachable = 0;
+          break;
+        }
+      }
+      if (attachable) {
+        score++;
+        if (score>=min_score_so_far)
+          return score;
+      }
+    }
+  }
+
+  return score;
+}
+
+static void find_blank(polyominoesstruct *sp, point_type *point) {
+  int score, worst_score;
+  int x, y;
+  int blank_mark;
+
+  blank_mark = find_smallest_blank_component(sp);
+
+  worst_score = 1000000;
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++) if (ARRAY(x,y)==blank_mark) {
+    score = 100*score_point(sp,x,y,worst_score);
+    if (score>0) {
+      if (sp->left_right) score += 10*x;
+      else                score += 10*(sp->width-1-x);
+      if (sp->top_bottom) score += y;
+      else                score += (sp->height-1-y);
+    }
+    if (score<worst_score) {
+      point->x = x;
+      point->y = y;
+      worst_score = score;
+    }
+  }
+
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++) 
+    if (ARRAY(x,y)<0) ARRAY(x,y) = -1;
+}
+
+/* Detaches the most recently attached polyomino. */
+
+static
+void detach(polyominoesstruct *sp, int *poly_no, int *point_no, int *transform_index, point_type *attach_point, int rot180) {
+  int i;
+  point_type target_point;
+
+  if (sp->nr_attached == 0) return;
+  sp->nr_attached--;
+  *poly_no = sp->attach_list[sp->nr_attached];
+  *point_no = sp->polyomino[*poly_no].point_no;
+  *transform_index = sp->polyomino[*poly_no].transform_index;
+  *attach_point = sp->polyomino[*poly_no].attach_point;
+  for (i=0;i<sp->polyomino[*poly_no].len;i++) {
+    transform(sp->polyomino[*poly_no].point[i],
+              sp->polyomino[*poly_no].point[*point_no],
+              sp->polyomino[*poly_no].transform_list[*transform_index]^(rot180<<1), 
+              *attach_point, &target_point);
+    ARRAY_P(target_point) = -1;
+    CHANGED_ARRAY_P(target_point) = 1;
+  }
+
+  sp->polyomino[*poly_no].attached = 0;
+}
+
+/* Attempts to attach a polyomino at point (x,y) at the 
+   point_no-th point of that polyomino, using the transform
+   transform_no.  Returns 1 if successful.
+*/
+
+static
+int attach(polyominoesstruct *sp, int poly_no, int point_no, int transform_index, point_type attach_point, int rot180,
+           int *reason_to_not_attach) {
+  point_type target_point;
+  int i;
+  int attachable = 1, worst_reason_not_to_attach = 1000000000;
+
+  if (rot180) {
+    attach_point.x = sp->width-1-attach_point.x;
+    attach_point.y = sp->height-1-attach_point.y;
+  }
+
+  if (sp->polyomino[poly_no].attached)
+    return 0;
+
+  for (i=0;i<sp->polyomino[poly_no].len;i++) {
+    transform(sp->polyomino[poly_no].point[i],
+              sp->polyomino[poly_no].point[point_no],
+              sp->polyomino[poly_no].transform_list[transform_index]^(rot180<<1), 
+              attach_point, &target_point);
+    if ( ! ((target_point.x>=0) && (target_point.x<sp->width) 
+              && (target_point.y>=0) && (target_point.y<sp->height)
+              && (ARRAY_P(target_point) == -1))) {
+      if (sp->identical) {
+        attachable = 0;
+        if ((target_point.x>=0) && (target_point.x<sp->width) 
+           && (target_point.y>=0) && (target_point.y<sp->height) 
+           && (ARRAY_P(target_point) >= 0)
+           && (ARRAY_P(target_point)<worst_reason_not_to_attach))
+          worst_reason_not_to_attach = ARRAY_P(target_point);
+      }
+      else
+        return 0;
+    }
+  }
+
+  if (sp->identical && !attachable) {
+    if (worst_reason_not_to_attach < 1000000000)
+      reason_to_not_attach[worst_reason_not_to_attach] = 1;
+    return 0;
+  }
+
+  for (i=0;i<sp->polyomino[poly_no].len;i++) {
+    transform(sp->polyomino[poly_no].point[i],
+              sp->polyomino[poly_no].point[point_no],
+              sp->polyomino[poly_no].transform_list[transform_index]^(rot180<<1),
+              attach_point, &target_point);
+    ARRAY_P(target_point) = poly_no;
+    CHANGED_ARRAY_P(target_point) = 1;
+  }
+
+  sp->attach_list[sp->nr_attached] = poly_no;
+  sp->nr_attached++;
+
+  sp->polyomino[poly_no].attached = 1;
+  sp->polyomino[poly_no].point_no = point_no;
+  sp->polyomino[poly_no].attach_point = attach_point;
+  sp->polyomino[poly_no].transform_index = transform_index;
+
+  if (!sp->check_ok(sp)) {
+    detach(sp,&poly_no,&point_no,&transform_index,&attach_point,rot180);
+    return 0;
+  }
+
+  return 1;
+}
+
+static
+int next_attach_try(polyominoesstruct *sp, int *poly_no, int *point_no, int *transform_index) {
+
+  (*transform_index)++;
+  if (*transform_index>=sp->polyomino[*poly_no].transform_len) {
+    *transform_index = 0;
+    (*point_no)++;
+    if (*point_no>=sp->polyomino[*poly_no].len) {
+      *point_no = 0;
+      next_poly_no(sp,poly_no);
+      if (*poly_no>=sp->nr_polyominoes) {
+        *poly_no = first_poly_no(sp);
+        return 0;
+      }
+    }
+  }
+  return 1;
+}
+
+
+/*******************************************************
+Display routines.
+*******************************************************/
+
+static void
+draw_without_bitmaps(ModeInfo * mi, polyominoesstruct *sp) {
+  Display *display = MI_DISPLAY(mi);
+  Window  window = MI_WINDOW(mi);
+  GC gc = MI_GC(mi);
+  int x,y,poly_no,nr_lines,nr_rectangles;
+
+  XSetLineAttributes(display,gc,sp->box/10+1,LineSolid,CapRound,JoinRound);
+
+  for (poly_no=-1;poly_no<sp->nr_polyominoes;poly_no++) {
+    nr_rectangles = 0;
+    for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++)
+    if (CHANGED_ARRAY(x,y) && ARRAY(x,y) == poly_no) {
+      sp->rectangles[nr_rectangles].x = sp->x_margin + sp->box*x;
+      sp->rectangles[nr_rectangles].y = sp->y_margin + sp->box*y;
+      sp->rectangles[nr_rectangles].width = sp->box;
+      sp->rectangles[nr_rectangles].height = sp->box;
+      nr_rectangles++;
+    }
+    if (poly_no == -1)
+      XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+    else
+      XSetForeground(display, gc, sp->polyomino[poly_no].color);
+    XFillRectangles(display, window, gc, sp->rectangles, nr_rectangles);
+  }
+
+  XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+  nr_lines = 0;
+  for (x=0;x<sp->width-1;x++) for (y=0;y<sp->height;y++) {
+    if (ARRAY(x,y) == -1 && ARRAY(x+1,y) == -1
+        && (CHANGED_ARRAY(x,y) || CHANGED_ARRAY(x+1,y))) {
+      sp->lines[nr_lines].x1 = sp->x_margin + sp->box*(x+1);
+      sp->lines[nr_lines].y1 = sp->y_margin + sp->box*y;
+      sp->lines[nr_lines].x2 = sp->x_margin + sp->box*(x+1);
+      sp->lines[nr_lines].y2 = sp->y_margin + sp->box*(y+1);
+      nr_lines++;
+    }
+  }
+  XDrawSegments(display, window, gc, sp->lines, nr_lines);
+
+  nr_lines = 0;
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height-1;y++) {
+    if (ARRAY(x,y) == -1 && ARRAY(x,y+1) == -1
+        && (CHANGED_ARRAY(x,y) || CHANGED_ARRAY(x,y+1))) {
+      sp->lines[nr_lines].x1 = sp->x_margin + sp->box*x;
+      sp->lines[nr_lines].y1 = sp->y_margin + sp->box*(y+1);
+      sp->lines[nr_lines].x2 = sp->x_margin + sp->box*(x+1);
+      sp->lines[nr_lines].y2 = sp->y_margin + sp->box*(y+1);
+      nr_lines++;
+    }
+  }
+  XDrawSegments(display, window, gc, sp->lines, nr_lines);
+
+  XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+  XDrawRectangle(display, window, gc, sp->x_margin, sp->y_margin, sp->box*sp->width, sp->box*sp->height);
+
+  XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+  nr_lines = 0;
+  for (x=0;x<sp->width-1;x++) for (y=0;y<sp->height;y++) {
+    if (ARRAY(x+1,y) != ARRAY(x,y)) {
+      sp->lines[nr_lines].x1 = sp->x_margin + sp->box*(x+1);
+      sp->lines[nr_lines].y1 = sp->y_margin + sp->box*y;
+      sp->lines[nr_lines].x2 = sp->x_margin + sp->box*(x+1);
+      sp->lines[nr_lines].y2 = sp->y_margin + sp->box*(y+1);
+      nr_lines++;
+    }
+  }
+  XDrawSegments(display, window, gc, sp->lines, nr_lines);
+
+  nr_lines = 0;
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height-1;y++) {
+    if (ARRAY(x,y+1) != ARRAY(x,y)) {
+      sp->lines[nr_lines].x1 = sp->x_margin + sp->box*x;
+      sp->lines[nr_lines].y1 = sp->y_margin + sp->box*(y+1);
+      sp->lines[nr_lines].x2 = sp->x_margin + sp->box*(x+1);
+      sp->lines[nr_lines].y2 = sp->y_margin + sp->box*(y+1);
+      nr_lines++;
+    }
+  }
+  XDrawSegments(display, window, gc, sp->lines, nr_lines);
+  XSetLineAttributes(display,gc,1,LineSolid,CapRound,JoinRound);
+}
+
+static void create_bitmaps(ModeInfo * mi, polyominoesstruct *sp) {
+  int x,y,n;
+  char *data;
+
+  for (n=0;n<256;n++) {
+
+/* Avoid duplication of identical bitmaps. */
+    if (IS_LEFT_UP(n) && (IS_LEFT(n) || IS_UP(n)))
+      sp->bitmaps[n] = sp->bitmaps[n & ~LEFT_UP];
+    else if (IS_LEFT_DOWN(n) && (IS_LEFT(n) || IS_DOWN(n)))
+      sp->bitmaps[n] = sp->bitmaps[n & ~LEFT_DOWN];
+    else if (IS_RIGHT_UP(n) && (IS_RIGHT(n) || IS_UP(n)))
+      sp->bitmaps[n] = sp->bitmaps[n & ~RIGHT_UP];
+    else if (IS_RIGHT_DOWN(n) && (IS_RIGHT(n) || IS_DOWN(n)))
+      sp->bitmaps[n] = sp->bitmaps[n & ~RIGHT_DOWN];
+
+    else /* if (bitmap_needed(n)) */ {
+      data = (char *) malloc(sizeof(char)*(sp->box*ROUND8(sp->box)/8));
+      if (data == NULL) {
+        sp->use_bitmaps = 0;
+        return;
+      }
+
+      for (y=0;y<sp->box;y++) for (x=0;x<sp->box;x++) {
+        if (!sp->use3D) {
+#ifdef SMALL_BELLYBUTTON
+          if (x >= sp->box / 2 && x <= sp->box / 2 + 1 &&
+              y >= sp->box / 2 && y <= sp->box / 2 + 1)
+            NOTHALFBIT(n,x,y)
+          else
+#endif
+            HALFBIT(n,x,y)
+        } else if ((x>=y && x<=sp->box-y-1 && IS_UP(n))
+            || (x<=y && x<=sp->box-y-1 && y<sp->box/2 && !IS_LEFT(n))
+            || (x>=y && x>=sp->box-y-1 && y<sp->box/2 && !IS_RIGHT(n)))
+          SETBIT(n,x,y)
+        else if ((x<=y && x<=sp->box-y-1 && IS_LEFT(n))
+            || (x>=y && x<=sp->box-y-1 && x<sp->box/2 && !IS_UP(n))
+            || (x<=y && x>=sp->box-y-1 && x<sp->box/2 && !IS_DOWN(n)))
+          TWOTHIRDSBIT(n,x,y)
+        else if ((x>=y && x>=sp->box-y-1 && IS_RIGHT(n))
+            || (x>=y && x<=sp->box-y-1 && x>=sp->box/2 && !IS_UP(n))
+            || (x<=y && x>=sp->box-y-1 && x>=sp->box/2 && !IS_DOWN(n)))
+          HALFBIT(n,x,y)
+        else if ((x<=y && x>=sp->box-y-1 && IS_DOWN(n))
+            || (x<=y && x<=sp->box-y-1 && y>=sp->box/2 && !IS_LEFT(n))
+            || (x>=y && x>=sp->box-y-1 && y>=sp->box/2 && !IS_RIGHT(n)))
+          THIRDBIT(n,x,y)
+      }
+
+      if (IS_LEFT(n)) 
+        for (y=0;y<sp->box;y++) for (x=G;x<G+T;x++)
+          SETBIT(n,x,y)
+      if (IS_RIGHT(n)) 
+        for (y=0;y<sp->box;y++) for (x=G;x<G+T;x++)
+          SETBIT(n,sp->box-1-x,y)
+      if (IS_UP(n))
+        for (x=0;x<sp->box;x++) for (y=G;y<G+T;y++)
+          SETBIT(n,x,y)
+      if (IS_DOWN(n))
+        for (x=0;x<sp->box;x++) for (y=G;y<G+T;y++)
+          SETBIT(n,x,sp->box-1-y)
+      if (IS_LEFT(n)) 
+        for (y=0;y<sp->box;y++) for (x=0;x<G;x++)
+          RESBIT(n,x,y)
+      if (IS_RIGHT(n)) 
+        for (y=0;y<sp->box;y++) for (x=0;x<G;x++)
+          RESBIT(n,sp->box-1-x,y)
+      if (IS_UP(n))
+        for (x=0;x<sp->box;x++) for (y=0;y<G;y++)
+          RESBIT(n,x,y)
+      if (IS_DOWN(n))
+        for (x=0;x<sp->box;x++) for (y=0;y<G;y++)
+          RESBIT(n,x,sp->box-1-y)
+
+      if (IS_LEFT(n) && IS_UP(n))
+        for (x=G;x<=G+R;x++)
+          for (y=G;y<=R+2*G-x;y++) {
+            if (x+y>R+2*G-RT)
+              SETBIT(n,x,y)
+            else
+              RESBIT(n,x,y)
+          }
+      if (IS_LEFT(n) && IS_DOWN(n))
+        for (x=G;x<=G+R;x++)
+          for (y=G;y<=R+2*G-x;y++) {
+            if (x+y>R+2*G-RT)
+              SETBIT(n,x,sp->box-1-y)
+            else
+              RESBIT(n,x,sp->box-1-y)
+          }
+      if (IS_RIGHT(n) && IS_UP(n))
+        for (x=G;x<=G+R;x++)
+          for (y=G;y<=R+2*G-x;y++) {
+            if (x+y>R+2*G-RT)
+              SETBIT(n,sp->box-1-x,y)
+            else
+              RESBIT(n,sp->box-1-x,y)
+          }
+      if (IS_RIGHT(n) && IS_DOWN(n))
+        for (x=G;x<=G+R;x++)
+          for (y=G;y<=R+2*G-x;y++) {
+            if (x+y>R+2*G-RT)
+              SETBIT(n,sp->box-1-x,sp->box-1-y)
+            else
+              RESBIT(n,sp->box-1-x,sp->box-1-y)
+          }
+
+      if (!IS_LEFT(n) && !IS_UP(n) && IS_LEFT_UP(n)) {
+        for (x=0;x<G;x++) for(y=0;y<G;y++)
+          RESBIT(n,x,y)
+        for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+          SETBIT(n,x,y)
+        for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+          SETBIT(n,x,y)
+      }
+      if (!IS_LEFT(n) && !IS_DOWN(n) && IS_LEFT_DOWN(n)) {
+        for (x=0;x<G;x++) for(y=0;y<G;y++)
+          RESBIT(n,x,sp->box-1-y)
+        for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+          SETBIT(n,x,sp->box-1-y)
+        for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+          SETBIT(n,x,sp->box-1-y)
+      }
+      if (!IS_RIGHT(n) && !IS_UP(n) && IS_RIGHT_UP(n)) {
+        for (x=0;x<G;x++) for(y=0;y<G;y++)
+          RESBIT(n,sp->box-1-x,y)
+        for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+          SETBIT(n,sp->box-1-x,y)
+        for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+          SETBIT(n,sp->box-1-x,y)
+      }
+      if (!IS_RIGHT(n) && !IS_DOWN(n) && IS_RIGHT_DOWN(n)) {
+        for (x=0;x<G;x++) for(y=0;y<G;y++)
+          RESBIT(n,sp->box-1-x,sp->box-1-y)
+        for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+          SETBIT(n,sp->box-1-x,sp->box-1-y)
+        for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+          SETBIT(n,sp->box-1-x,sp->box-1-y)
+      }
+
+#ifdef LARGE_BELLYBUTTON
+      if (!sp->use3D) {
+        if (!IS_LEFT(n) && !IS_UP(n) && !IS_LEFT_UP(n))
+          for (x=0;x<G+T;x++) for(y=0;y<G+T;y++)
+            SETBIT(n,x,y)
+        if (!IS_LEFT(n) && !IS_DOWN(n) && !IS_LEFT_DOWN(n))
+          for (x=0;x<G+T;x++) for(y=sp->box-G-T;y<sp->box;y++)
+            SETBIT(n,x,y)
+        if (!IS_RIGHT(n) && !IS_UP(n) && !IS_RIGHT_UP(n))
+          for (x=sp->box-G-T;x<sp->box;x++) for(y=0;y<G+T;y++)
+            SETBIT(n,x,y)
+        if (!IS_RIGHT(n) && !IS_DOWN(n) && !IS_RIGHT_DOWN(n))
+          for (x=sp->box-G-T;x<sp->box;x++) for(y=sp->box-G-T;y<sp->box;y++)
+            SETBIT(n,x,y)
+      } else
+#else
+      if (sp->use3D)
+#endif
+      {
+        if (!IS_LEFT(n) && !IS_UP(n) && !IS_LEFT_UP(n))
+          for (x=0;x<sp->box/2-RR;x++) for(y=0;y<sp->box/2-RR;y++)
+            THREEQUARTERSBIT(n,x,y)
+        if (!IS_LEFT(n) && !IS_DOWN(n) && !IS_LEFT_DOWN(n))
+          for (x=0;x<sp->box/2-RR;x++) for(y=sp->box/2+RR;y<sp->box;y++)
+            THREEQUARTERSBIT(n,x,y)
+        if (!IS_RIGHT(n) && !IS_UP(n) && !IS_RIGHT_UP(n))
+          for (x=sp->box/2+RR;x<sp->box;x++) for(y=0;y<sp->box/2-RR;y++)
+            THREEQUARTERSBIT(n,x,y)
+        if (!IS_RIGHT(n) && !IS_DOWN(n) && !IS_RIGHT_DOWN(n))
+          for (x=sp->box/2+RR;x<sp->box;x++) for(y=sp->box/2+RR;y<sp->box;y++)
+            THREEQUARTERSBIT(n,x,y)
+      }
+
+      sp->bitmaps[n] = XCreateImage(MI_DISPLAY(mi), MI_VISUAL(mi), 1, XYBitmap,
+                                    0, data, sp->box, sp->box, 8, 0);
+      if (sp->bitmaps[n] == None) {
+        free(data);
+        sp->use_bitmaps = 0;
+        return;
+      }
+      sp->bitmaps[n]->byte_order = MSBFirst;
+      sp->bitmaps[n]->bitmap_unit = 8;
+      sp->bitmaps[n]->bitmap_bit_order = LSBFirst;
+    }
+  }
+
+  sp->use_bitmaps = 1;
+}
+
+static void draw_with_bitmaps(ModeInfo * mi, polyominoesstruct *sp) {
+  Display *display = MI_DISPLAY(mi);
+  Window  window = MI_WINDOW(mi);
+  GC gc = MI_GC(mi);
+  int x,y,t,bitmap_index;
+
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++) {
+    if (ARRAY(x,y) == -1) {
+      if (CHANGED_ARRAY(x,y)) {
+        XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+        XFillRectangle(display,window,gc,
+                       sp->x_margin + sp->box*x,
+                       sp->y_margin + sp->box*y,
+                       sp->box,sp->box);
+      }
+    }
+    else {
+      XSetForeground(display, gc, sp->polyomino[ARRAY(x,y)].color);
+      bitmap_index = 0;
+      if (ARR(x,y) != ARR(x-1,y))   bitmap_index |= LEFT;
+      if (ARR(x,y) != ARR(x+1,y))   bitmap_index |= RIGHT;
+      if (ARR(x,y) != ARR(x,y-1))   bitmap_index |= UP;
+      if (ARR(x,y) != ARR(x,y+1))   bitmap_index |= DOWN;
+      if (ARR(x,y) != ARR(x-1,y-1)) bitmap_index |= LEFT_UP;
+      if (ARR(x,y) != ARR(x-1,y+1)) bitmap_index |= LEFT_DOWN;
+      if (ARR(x,y) != ARR(x+1,y-1)) bitmap_index |= RIGHT_UP;
+      if (ARR(x,y) != ARR(x+1,y+1)) bitmap_index |= RIGHT_DOWN;
+      (void) XPutImage(display,window,gc,
+                sp->bitmaps[bitmap_index],
+                0,0,
+                sp->x_margin + sp->box*x,
+                sp->y_margin + sp->box*y,
+                sp->box,sp->box);
+    }
+  }
+
+  XSetForeground(display, gc, sp->border_color);
+  for (t=G;t<G+T;t++)
+    XDrawRectangle(display,window,gc,
+                   sp->x_margin-t-1,sp->y_margin-t-1,
+                   sp->box*sp->width+1+2*t, sp->box*sp->height+1+2*t);
+}
+
+
+/***************************************************
+Routines to initialise and close down polyominoes.
+***************************************************/
+
+static void free_bitmaps(polyominoesstruct *sp) {
+  int n;
+  
+  for (n=0;n<256;n++)
+/* Don't bother to free duplicates */
+    if (IS_LEFT_UP(n) && (IS_LEFT(n) || IS_UP(n)))
+      sp->bitmaps[n] = None;
+    else if (IS_LEFT_DOWN(n) && (IS_LEFT(n) || IS_DOWN(n)))
+      sp->bitmaps[n] = None;
+    else if (IS_RIGHT_UP(n) && (IS_RIGHT(n) || IS_UP(n)))
+      sp->bitmaps[n] = None;
+    else if (IS_RIGHT_DOWN(n) && (IS_RIGHT(n) || IS_DOWN(n)))
+      sp->bitmaps[n] = None;
+
+    else if (sp->bitmaps[n] != None) {
+        XDestroyImage(sp->bitmaps[n]);
+        sp->bitmaps[n] = None;
+    }
+}
+
+#define deallocate(p) if ((p)!=NULL) {free(p); p=NULL;}
+
+static void free_polyominoes(polyominoesstruct *sp) {
+  int n;
+
+  for (n=0;n<sp->nr_polyominoes;n++) {
+    deallocate(sp->polyomino[n].point);
+  }
+
+  deallocate(sp->polyomino);
+  deallocate(sp->attach_list);
+  deallocate(sp->rectangles);
+  deallocate(sp->lines);
+  deallocate(sp->reason_to_not_attach);
+  deallocate(sp->array);
+  deallocate(sp->changed_array);
+
+  free_bitmaps(sp);
+}
+
+#define set_allocate(p,type,size) p = (type *) malloc(size);           \
+                             if ((p)==NULL) {free_polyominoes(sp);return 0;}
+
+#define copy_polyomino(dst,src,new_rand)                               \
+  (dst).len=(src).len;                                                 \
+  (dst).max_white = (src).max_white;                                   \
+  set_allocate((dst).point,point_type,sizeof(point_type)*(src).len);           \
+  (dst).len = (src).len;                                               \
+  if (new_rand)                                                                \
+    random_permutation((src).len,perm_point);                          \
+  for (i=0;i<(src).len;i++)                                            \
+    (dst).point[i] = (src).point[perm_point[i]];                       \
+  (dst).transform_len = (src).transform_len;                           \
+  if (new_rand)                                                                \
+    random_permutation((src).transform_len,perm_transform);            \
+  for (i=0;i<(src).transform_len;i++)                                  \
+    (dst).transform_list[i] = (src).transform_list[perm_transform[i]]; \
+  (dst).attached = 0
+
+
+/***************************************************
+Puzzle specific initialization routines.
+***************************************************/
+
+static
+int check_pentomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_multiple_of(sp, 5) && whites_ok(sp);
+}
+
+static
+int check_hexomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_multiple_of(sp, 6) && whites_ok(sp);
+}
+
+static
+int check_tetr_pentomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_positive_combination_of(sp, 5, 4) && whites_ok(sp);
+}
+
+static
+int check_pent_hexomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_positive_combination_of(sp, 6, 5) && whites_ok(sp);
+}
+
+static
+int check_heptomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_multiple_of(sp, 7) && whites_ok(sp);
+}
+
+static
+int check_octomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_multiple_of(sp, 8) && whites_ok(sp);
+}
+
+static
+int check_dekomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_multiple_of(sp, 10) && whites_ok(sp);
+}
+
+static
+int check_elevenomino_puzzle(polyominoesstruct *sp) {
+  return check_all_regions_multiple_of(sp, 11) && whites_ok(sp);
+}
+
+static struct {int len; point_type point[4];
+               int transform_len, transform_list[8], max_white;} tetromino[5] =
+{
+/*
+xxxx 
+*/
+  {4, {{0,0}, {1,0}, {2,0}, {3,0}},
+   2, {0, 1, -1, -1, -1, -1, -1, -1}, 2},
+/*
+xxx  
+  x  
+*/
+  {4, {{0,0}, {1,0}, {2,0}, {2,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 2},
+/*
+xxx  
+ x   
+*/
+  {4, {{0,0}, {1,0}, {1,1}, {2,0}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+xx   
+ xx  
+*/
+  {4, {{0,0}, {1,0}, {1,1}, {2,1}},
+   4, {0, 1, 4, 5, -1, -1, -1, -1}, 2},
+/*
+xx   
+xx   
+*/
+  {4, {{0,0}, {0,1}, {1,0}, {1,1}},
+   1, {0, -1, -1, -1, -1, -1, -1, -1}, 2}};
+
+
+static struct pentomino_struct {int len; point_type point[5];
+                                int transform_len, transform_list[8], max_white;}
+  pentomino[12] =
+{
+/*
+xxxxx 
+*/
+  {5, {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}},
+   2, {0, 1, -1, -1, -1, -1, -1, -1}, 3},
+/*
+xxxx  
+   x  
+*/
+  {5, {{0,0}, {1,0}, {2,0}, {3,0}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxxx  
+  x   
+*/
+  {5, {{0,0}, {1,0}, {2,0}, {2,1}, {3,0}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+  x   
+xxx   
+  x   
+*/
+  {5, {{0,0}, {1,0}, {2,-1}, {2,0}, {2,1}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+xxx   
+  xx  
+*/
+  {5, {{0,0}, {1,0}, {2,0}, {2,1}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxx   
+ xx   
+*/
+  {5, {{0,0}, {1,0}, {1,1}, {2,0}, {2,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxx   
+  x   
+  x   
+*/
+  {5, {{0,0}, {1,0}, {2,0}, {2,1}, {2,2}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+ x    
+xxx   
+  x   
+*/
+  {5, {{0,0}, {1,-1}, {1,0}, {2,0}, {2,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxx   
+x x   
+*/
+  {5, {{0,0}, {0,1}, {1,0}, {2,0}, {2,1}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+  x   
+xxx   
+x     
+*/
+  {5, {{0,0}, {0,1}, {1,0}, {2,-1}, {2,0}},
+   4, {0, 1, 4, 5, -1, -1, -1, -1}, 3},
+/*
+ x    
+xxx   
+ x    
+*/
+  {5, {{0,0}, {1,-1}, {1,0}, {1,1}, {2,0}},
+   1, {0, -1, -1, -1, -1, -1, -1, -1}, 4},
+/*
+xx    
+ xx   
+  x   
+*/
+  {5, {{0,0}, {1,0}, {1,1}, {2,1}, {2,2}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3}};
+
+
+static struct hexomino_struct {int len; point_type point[6];
+                               int transform_len, transform_list[8], max_white;}
+  hexomino[35] =
+{
+/*
+xxxxxx 
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}},
+   2, {0, 1, -1, -1, -1, -1, -1, -1}, 3},
+/*
+xxxxx  
+    x  
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {4,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxxxx  
+   x   
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {3,0}, {3,1}, {4,0}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4},
+/*
+xxxxx  
+  x    
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {2,1}, {3,0}, {4,0}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+   x   
+xxxx   
+   x   
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {3,-1}, {3,0}, {3,1}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 4},
+/*
+xxxx   
+   xx  
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {3,0}, {3,1}, {4,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxxx   
+  xx   
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {2,1}, {3,0}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxxx   
+   x   
+   x   
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {3,0}, {3,1}, {3,2}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+  x    
+xxxx   
+   x   
+*/
+  {6, {{0,0}, {1,0}, {2,-1}, {2,0}, {3,0}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxxx   
+ x x   
+*/
+  {6, {{0,0}, {1,0}, {1,1}, {2,0}, {3,0}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4},
+/*
+ x     
+xxxx   
+   x   
+*/
+  {6, {{0,0}, {1,-1}, {1,0}, {2,0}, {3,0}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4},
+/*
+xxxx   
+x  x   
+*/
+  {6, {{0,0}, {0,1}, {1,0}, {2,0}, {3,0}, {3,1}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+   x   
+xxxx   
+x      
+*/
+  {6, {{0,0}, {0,1}, {1,0}, {2,0}, {3,-1}, {3,0}},
+   4, {0, 1, 4, 5, -1, -1, -1, -1}, 3},
+/*
+  x    
+xxxx   
+  x    
+*/
+  {6, {{0,0}, {1,0}, {2,-1}, {2,0}, {2,1}, {3,0}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 4},
+/*
+xxxx   
+ xx    
+*/
+  {6, {{0,0}, {1,0}, {1,1}, {2,0}, {2,1}, {3,0}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+xxxx   
+  x    
+  x    
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {2,1}, {2,2}, {3,0}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+ x     
+xxxx   
+  x    
+*/
+  {6, {{0,0}, {1,-1}, {1,0}, {2,0}, {2,1}, {3,0}},
+   4, {0, 1, 4, 5, -1, -1, -1, -1}, 3},
+/*
+  xx   
+xxx    
+  x    
+*/
+  {6, {{0,0}, {1,0}, {2,-1}, {2,0}, {2,1}, {3,-1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+ xx    
+xxx    
+  x    
+*/
+  {6, {{0,0}, {1,-1}, {1,0}, {2,-1}, {2,0}, {2,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+  x    
+xxx    
+x x    
+*/
+  {6, {{0,0}, {0,1}, {1,0}, {2,-1}, {2,0}, {2,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4},
+/*
+xxx    
+  xxx  
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {2,1}, {3,1}, {4,1}},
+   4, {0, 1, 4, 5, -1, -1, -1, -1}, 3},
+/*
+xxx    
+  xx   
+   x   
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {2,1}, {3,1}, {3,2}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxx    
+ xxx   
+*/
+  {6, {{0,0}, {1,0}, {1,1}, {2,0}, {2,1}, {3,1}},
+   4, {0, 1, 4, 5, -1, -1, -1, -1}, 4},
+/*
+xxx    
+  xx   
+  x    
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {2,1}, {2,2}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4},
+/*
+ x     
+xxx    
+  xx   
+*/
+  {6, {{0,0}, {1,-1}, {1,0}, {2,0}, {2,1}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4},
+/*
+xxx    
+x xx   
+*/
+  {6, {{0,0}, {0,1}, {1,0}, {2,0}, {2,1}, {3,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxx    
+ xx    
+  x    
+*/
+  {6, {{0,0}, {1,0}, {1,1}, {2,0}, {2,1}, {2,2}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 4},
+/*
+ x     
+xxx    
+ xx    
+*/
+  {6, {{0,0}, {1,-1}, {1,0}, {1,1}, {2,0}, {2,1}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 4},
+/*
+xxx    
+xxx    
+*/
+  {6, {{0,0}, {0,1}, {1,0}, {1,1}, {2,0}, {2,1}},
+   2, {0, 1, -1, -1, -1, -1, -1, -1}, 3},
+/*
+xxx    
+  x    
+  xx   
+*/
+  {6, {{0,0}, {1,0}, {2,0}, {2,1}, {2,2}, {3,2}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xxx    
+  x    
+ xx    
+*/
+  {6, {{0,0}, {1,0}, {1,2}, {2,0}, {2,1}, {2,2}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+ x     
+xxx    
+x x    
+*/
+  {6, {{0,0}, {0,1}, {1,-1}, {1,0}, {2,0}, {2,1}},
+   4, {0, 1, 2, 3, -1, -1, -1, -1}, 3},
+/*
+  xx   
+xxx    
+x      
+*/
+  {6, {{0,0}, {0,1}, {1,0}, {2,-1}, {2,0}, {3,-1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+ xx    
+xxx    
+x      
+*/
+  {6, {{0,0}, {0,1}, {1,-1}, {1,0}, {2,-1}, {2,0}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3},
+/*
+xx     
+ xx    
+  xx   
+*/
+  {6, {{0,0}, {1,0}, {1,1}, {2,1}, {2,2}, {3,2}},
+   4, {0, 1, 4, 5, -1, -1, -1, -1}, 3}};
+
+static struct pentomino_struct one_sided_pentomino[60];
+
+void make_one_sided_pentomino() {
+  int i,j,t,u;
+
+  j=0;
+  for (i=0;i<18;i++) {
+    one_sided_pentomino[j] = pentomino[i];
+    for (t=0;t<8;t++)
+      if (one_sided_pentomino[j].transform_list[t]>=4) {
+        one_sided_pentomino[j].transform_len = t;
+        j++;
+        one_sided_pentomino[j] = pentomino[i];
+        for (u=t;u<8;u++) one_sided_pentomino[j].transform_list[u-t] = one_sided_pentomino[j].transform_list[u];
+        one_sided_pentomino[j].transform_len -= t;
+        break;
+      }
+    j++;
+  }
+}
+
+static struct hexomino_struct one_sided_hexomino[60];
+
+void make_one_sided_hexomino() {
+  int i,j,t,u;
+
+  j=0;
+  for (i=0;i<35;i++) {
+    one_sided_hexomino[j] = hexomino[i];
+    for (t=0;t<8;t++)
+      if (one_sided_hexomino[j].transform_list[t]>=4) {
+        one_sided_hexomino[j].transform_len = t;
+        j++;
+        one_sided_hexomino[j] = hexomino[i];
+        for (u=t;u<8;u++) one_sided_hexomino[j].transform_list[u-t] = one_sided_hexomino[j].transform_list[u];
+        one_sided_hexomino[j].transform_len -= t;
+        break;
+      }
+    j++;
+  }
+}
+
+/*
+Find all the ways of placing all twelve pentominoes
+into a rectangle whose size is 20x3, 15x4, 12x5 or 10x6.
+*/
+
+static
+int set_pentomino_puzzle(polyominoesstruct *sp) {
+  int perm_poly[12], perm_point[5], perm_transform[8], i, p;
+
+  switch (NRAND(4)) {
+    case 0:
+      sp->width = 20;
+      sp->height = 3;
+      break;
+    case 1:
+      sp->width = 15;
+      sp->height = 4;
+      break;
+    case 2:
+      sp->width = 12;
+      sp->height = 5;
+      break;
+    case 3:
+      sp->width = 10;
+      sp->height = 6;
+      break;
+  }
+
+  sp->nr_polyominoes = 12;
+  set_allocate(sp->polyomino,polyomino_type,12*sizeof(polyomino_type));
+  random_permutation(12,perm_poly);
+  for (p=0;p<12;p++) {
+    copy_polyomino(sp->polyomino[p],pentomino[perm_poly[p]],1);
+  }
+
+  sp->check_ok = check_pentomino_puzzle;
+
+  return 1;
+}
+
+/*
+Many of the following puzzles are inspired by
+http://www.xs4all.nl/~gp/PolyominoSolver/Polyomino.html
+*/
+
+/*
+Find all the ways of placing all eighteen one-sided pentominoes
+into a rectangle.
+*/
+
+static
+int set_one_sided_pentomino_puzzle(polyominoesstruct *sp) {
+  int perm_poly[18], perm_point[5], perm_transform[8], i, p;
+
+  make_one_sided_pentomino();
+
+  switch (NRAND(4)) {
+    case 0:
+      sp->width = 30;
+      sp->height = 3;
+      break;
+    case 1:
+      sp->width = 18;
+      sp->height = 5;
+      break;
+    case 2:
+      sp->width = 15;
+      sp->height = 6;
+      break;
+    case 3:
+      sp->width = 10;
+      sp->height = 9;
+      break;
+  }
+
+  sp->nr_polyominoes = 18;
+  set_allocate(sp->polyomino,polyomino_type,18*sizeof(polyomino_type));
+  random_permutation(18,perm_poly);
+  for (p=0;p<18;p++) {
+    copy_polyomino(sp->polyomino[p],one_sided_pentomino[perm_poly[p]],1);
+  }
+
+  sp->check_ok = check_pentomino_puzzle;
+
+  return 1;
+}
+
+/*
+Find all the ways of placing all sixty one-sided hexominoes
+into a rectangle.
+*/
+
+static
+int set_one_sided_hexomino_puzzle(polyominoesstruct *sp) {
+  int perm_poly[60], perm_point[6], perm_transform[8], i, p;
+
+  make_one_sided_hexomino();
+
+  switch (NRAND(8)) {
+    case 0:
+      sp->width = 20;
+      sp->height = 18;
+      break;
+    case 1:
+      sp->width = 24;
+      sp->height = 15;
+      break;
+    case 2:
+      sp->width = 30;
+      sp->height = 12;
+      break;
+    case 3:
+      sp->width = 36;
+      sp->height = 10;
+      break;
+    case 4:
+      sp->width = 40;
+      sp->height = 9;
+      break;
+    case 5:
+      sp->width = 45;
+      sp->height = 8;
+      break;
+    case 6:
+      sp->width = 60;
+      sp->height = 6;
+      break;
+    case 7:
+      sp->width = 72;
+      sp->height = 5;
+      break;
+  }
+
+  sp->nr_polyominoes = 60;
+  set_allocate(sp->polyomino,polyomino_type,60*sizeof(polyomino_type));
+  random_permutation(60,perm_poly);
+  for (p=0;p<60;p++) {
+    copy_polyomino(sp->polyomino[p],one_sided_hexomino[perm_poly[p]],1);
+  }
+
+  sp->check_ok = check_hexomino_puzzle;
+
+  return 1;
+}
+
+/*
+Find all the ways of placing all five tetrominoes and all twelve
+pentominoes into a rectangle.
+*/
+
+static
+int set_tetr_pentomino_puzzle(polyominoesstruct *sp) {
+  int perm_poly[17], perm_point[5], perm_transform[8], i, p;
+
+  switch (NRAND(3)) {
+    case 0:
+      sp->width = 20;
+      sp->height = 4;
+      break;
+    case 1:
+      sp->width = 16;
+      sp->height = 5;
+      break;
+    case 2:
+      sp->width = 10;
+      sp->height = 8;
+      break;
+  }
+
+  sp->nr_polyominoes = 17;
+  set_allocate(sp->polyomino,polyomino_type,17*sizeof(polyomino_type));
+  random_permutation(17,perm_poly);
+  for (p=0;p<5;p++) {
+    copy_polyomino(sp->polyomino[perm_poly[p]],tetromino[p],1);
+  }
+  for (p=0;p<12;p++) {
+    copy_polyomino(sp->polyomino[perm_poly[p+5]],pentomino[p],1);
+  }
+
+  sp->check_ok = check_tetr_pentomino_puzzle;
+
+  return 1;
+}
+/*
+Find all the ways of placing all twelve pentominoes and all thirty five
+hexominoes into a rectangle whose size is 18x15.
+*/
+
+static
+int set_pent_hexomino_puzzle(polyominoesstruct *sp) {
+  int perm_poly[47], perm_point[6], perm_transform[8], i, p;
+
+  switch (NRAND(5)) {
+    case 0:
+      sp->width = 54;
+      sp->height = 5;
+      break;
+    case 1:
+      sp->width = 45;
+      sp->height = 6;
+      break;
+    case 2:
+      sp->width = 30;
+      sp->height = 9;
+      break;
+    case 3:
+      sp->width = 27;
+      sp->height = 10;
+      break;
+    case 4:
+      sp->width = 18;
+      sp->height = 15;
+      break;
+  }
+
+  sp->nr_polyominoes = 47;
+  set_allocate(sp->polyomino,polyomino_type,47*sizeof(polyomino_type));
+  random_permutation(47,perm_poly);
+  for (p=0;p<12;p++) {
+    copy_polyomino(sp->polyomino[perm_poly[p]],pentomino[p],1);
+  }
+  for (p=0;p<35;p++) {
+    copy_polyomino(sp->polyomino[perm_poly[p+12]],hexomino[p],1);
+  }
+
+  sp->check_ok = check_pent_hexomino_puzzle;
+
+  return 1;
+}
+
+/*
+Other puzzles:
+
+Science News September 20, 1986 Vol 130, No 12
+Science News November 14, 1987 Vol 132, Pg 310
+*/
+
+/*
+
+ *
+**** fills a 10x5 rectangle
+
+*/
+
+static struct {int len; point_type point[5]; 
+               int transform_len, transform_list[8], max_white;} pentomino1 =
+  {5, {{0,0}, {1,0}, {2,0}, {3,0}, {1,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 3};
+
+static
+int set_pentomino_puzzle1(polyominoesstruct *sp) {
+  int perm_point[5], perm_transform[8], i, p;
+
+  sp->width = 10;
+  sp->height =5;
+
+  sp->nr_polyominoes = 10;
+  set_allocate(sp->polyomino,polyomino_type,10*sizeof(polyomino_type));
+  for (p=0;p<10;p++) {
+    copy_polyomino(sp->polyomino[p],pentomino1,1);
+  }
+
+  sp->check_ok = check_pentomino_puzzle;
+
+  return 1;
+}
+
+/*
+
+ *
+***** fills a 24x23 rectangle
+
+*/
+
+static struct {int len; point_type point[6]; 
+               int transform_len, transform_list[8], max_white;} hexomino1 =
+  {6, {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {1,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4};
+
+static
+int set_hexomino_puzzle1(polyominoesstruct *sp) {
+  int perm_point[6], perm_transform[8], i, p;
+
+  sp->width = 24;
+  sp->height =23;
+
+  sp->nr_polyominoes = 92;
+  set_allocate(sp->polyomino,polyomino_type,92*sizeof(polyomino_type));
+  for (p=0;p<92;p++) {
+    copy_polyomino(sp->polyomino[p],hexomino1,1);
+  }
+
+  sp->check_ok = check_hexomino_puzzle;
+
+  return 1;
+}
+
+/*
+
+ **
+***** fills a 21x26 rectangle
+
+(All solutions have 180 degree rotational symmetry)
+
+*/
+
+static struct {int len; point_type point[7]; 
+               int transform_len, transform_list[8], max_white;} heptomino1 =
+  {7, {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {1,1}, {2,1}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 4};
+
+static
+int set_heptomino_puzzle1(polyominoesstruct *sp) {
+  int perm_point[7], perm_transform[8], i, p;
+
+  sp->rot180 = 1;
+
+  sp->width = 26;
+  sp->height =21;
+
+  sp->nr_polyominoes = 78;
+  set_allocate(sp->polyomino,polyomino_type,78*sizeof(polyomino_type));
+  for (p=0;p<78;p+=2) {
+    copy_polyomino(sp->polyomino[p],heptomino1,1);
+    copy_polyomino(sp->polyomino[p+1],heptomino1,0);
+  }
+
+  sp->check_ok = check_heptomino_puzzle;
+
+  return 1;
+}
+
+/* The following puzzles from 
+Polyominoes Puzzles, Patterns, Problems, and Packings Revised (2nd) Edition
+by Solomon W. Golomb   Princeton University Press 1994
+*/
+
+/*
+
+ **
+***** fills a 28x19 rectangle
+
+*/
+static
+int set_heptomino_puzzle2(polyominoesstruct *sp) {
+  int perm_point[7], perm_transform[8], i, p;
+
+  sp->width = 28;
+  sp->height =19;
+
+  sp->nr_polyominoes = 76;
+  set_allocate(sp->polyomino,polyomino_type,76*sizeof(polyomino_type));
+  for (p=0;p<76;p++) {
+    copy_polyomino(sp->polyomino[p],heptomino1,1);
+  }
+
+  sp->check_ok = check_heptomino_puzzle;
+
+  return 1;
+}
+
+/*
+
+***
+**** fills a 25x22 rectangle
+****
+
+*/
+
+static struct {int len; point_type point[11]; 
+               int transform_len, transform_list[8], max_white;} elevenomino1 =
+  {11, {{0,0}, {1,0}, {2,0}, 
+        {0,1}, {1,1}, {2,1}, {3,1},
+        {0,2}, {1,2}, {2,2}, {3,2}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 6};
+
+static
+int set_elevenomino_puzzle1(polyominoesstruct *sp) {
+  int perm_point[11], perm_transform[8], i, p;
+
+  sp->rot180 = 1;
+
+  sp->width = 25;
+  sp->height =22;
+
+  sp->nr_polyominoes = 50;
+  set_allocate(sp->polyomino,polyomino_type,50*sizeof(polyomino_type));
+  for (p=0;p<50;p+=2) {
+    copy_polyomino(sp->polyomino[p],elevenomino1,1);
+    copy_polyomino(sp->polyomino[p+1],elevenomino1,0);
+  }
+
+  sp->check_ok = check_elevenomino_puzzle;
+
+  return 1;
+}
+
+/*
+
+ *
+ *
+**** fills 32 x 30 rectangle
+****
+
+*/
+
+static struct {int len; point_type point[10]; 
+               int transform_len, transform_list[8], max_white;} dekomino1 =
+  {10, {       {1,-1},
+               {1,0}, 
+        {0,1}, {1,1}, {2,1}, {3,1},
+        {0,2}, {1,2}, {2,2}, {3,2}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 5};
+
+static
+int set_dekomino_puzzle1(polyominoesstruct *sp) {
+  int perm_point[10], perm_transform[8], i, p;
+
+  sp->width = 32;
+  sp->height =30;
+
+  sp->nr_polyominoes = 96;
+  set_allocate(sp->polyomino,polyomino_type,96*sizeof(polyomino_type));
+  for (p=0;p<96;p++) {
+    copy_polyomino(sp->polyomino[p],dekomino1,1);
+  }
+
+  sp->check_ok = check_dekomino_puzzle;
+
+  return 1;
+}
+
+/*
+
+ *
+***  fills 96 x 26 rectangle
+****
+
+*/
+
+static struct {int len; point_type point[10]; 
+               int transform_len, transform_list[8], max_white;} octomino1 =
+  {8, {        {1,0}, 
+        {0,1}, {1,1}, {2,1},
+        {0,2}, {1,2}, {2,2}, {3,2}},
+   8, {0, 1, 2, 3, 4, 5, 6, 7}, 5};
+
+static
+int set_octomino_puzzle1(polyominoesstruct *sp) {
+  int perm_point[8], perm_transform[8], i, p;
+
+  sp->width = 96;
+  sp->height =26;
+
+  sp->nr_polyominoes = 312;
+  set_allocate(sp->polyomino,polyomino_type,312*sizeof(polyomino_type));
+  for (p=0;p<312;p++) {
+    copy_polyomino(sp->polyomino[p],octomino1,1);
+  }
+
+  sp->check_ok = check_octomino_puzzle;
+
+  return 1;
+}
+
+/*
+
+ *   fills 15 x 15 rectangle
+****
+
+*/
+
+static
+int set_pentomino_puzzle2(polyominoesstruct *sp) {
+  int perm_point[5], perm_transform[8], i, p;
+
+  sp->width = 15;
+  sp->height =15;
+
+  sp->nr_polyominoes = 45;
+  set_allocate(sp->polyomino,polyomino_type,45*sizeof(polyomino_type));
+  for (p=0;p<45;p++) {
+    copy_polyomino(sp->polyomino[p],pentomino1,1);
+  }
+
+  sp->check_ok = check_pentomino_puzzle;
+
+  return 1;
+}
+
+/*
+
+***
+**** fills a 47x33 rectangle
+****
+
+*/
+
+static
+int set_elevenomino_puzzle2(polyominoesstruct *sp) {
+  int perm_point[11], perm_transform[8], i, p;
+
+  sp->width = 47;
+  sp->height =33;
+
+  sp->nr_polyominoes = 141;
+  set_allocate(sp->polyomino,polyomino_type,141*sizeof(polyomino_type));
+  for (p=0;p<141;p++) {
+    copy_polyomino(sp->polyomino[p],elevenomino1,1);
+  }
+
+  sp->check_ok = check_elevenomino_puzzle;
+
+  return 1;
+}
+
+/**************************************************
+The main functions.
+**************************************************/
+
+#define allocate(p,type,size) p = (type *) malloc(size); if ((p)==NULL) {free_polyominoes(sp); return;}
+
+void
+init_polyominoes(ModeInfo * mi) {
+  polyominoesstruct *sp;
+  int i,x,y, start;
+  int box1, box2;
+  int *perm;
+
+  if (polyominoeses == NULL) {
+    if ((polyominoeses
+         = (polyominoesstruct *) calloc(MI_NUM_SCREENS(mi),sizeof (polyominoesstruct))) 
+        == NULL)
+      return;
+  }
+  sp = &polyominoeses[MI_SCREEN(mi)];
+
+  free_polyominoes(sp);
+
+  sp->rot180 = 0;
+  sp->counter = 0;
+
+  if (MI_IS_FULLRANDOM(mi)) {
+    sp->identical = (Bool) (LRAND() & 1);
+    sp->use3D = (Bool) (NRAND(4));
+  } else {
+    sp->identical = identical; 
+    sp->use3D = !plain;
+  }
+  if (sp->identical) {
+    switch (NRAND(9)) {
+      case 0:
+        if (!set_pentomino_puzzle1(sp))
+          return;
+        break;
+      case 1:
+        if (!set_hexomino_puzzle1(sp))
+          return;
+        break;
+      case 2:
+        if (!set_heptomino_puzzle1(sp))
+          return;
+        break;
+      case 3:
+        if (!set_heptomino_puzzle2(sp))
+          return;
+        break;
+      case 4:
+        if (!set_elevenomino_puzzle1(sp))
+          return;
+        break;
+      case 5:
+        if (!set_dekomino_puzzle1(sp))
+          return;
+        break;
+      case 6:
+        if (!set_octomino_puzzle1(sp))
+          return;
+        break;
+      case 7:
+        if (!set_pentomino_puzzle2(sp))
+          return;
+        break;
+      case 8:
+        if (!set_elevenomino_puzzle2(sp))
+          return;
+        break;
+    }
+  } else {
+    switch (NRAND(5)) {
+      case 0:
+        if (!set_pentomino_puzzle(sp))
+          return;
+        break;
+      case 1:
+        if (!set_one_sided_pentomino_puzzle(sp))
+          return;
+        break;
+      case 2:
+        if (!set_one_sided_hexomino_puzzle(sp))
+          return;
+        break;
+      case 3:
+        if (!set_pent_hexomino_puzzle(sp))
+          return;
+        break;
+      case 4:
+        if (!set_tetr_pentomino_puzzle(sp))
+          return;
+        break;
+    }
+  }
+
+  allocate(sp->attach_list,int,sp->nr_polyominoes*sizeof(int));
+  sp->nr_attached = 0;
+
+  if (sp->identical) {
+    allocate(sp->reason_to_not_attach,int,sp->nr_polyominoes*sp->nr_polyominoes*sizeof(int));
+  }
+
+  allocate(sp->array,int,sp->width*sp->height*sizeof(int));
+  allocate(sp->changed_array,int,sp->width*sp->height*sizeof(int));
+  for (x=0;x<sp->width;x++) for (y=0;y<sp->height;y++) ARRAY(x,y) = -1;
+
+  sp->left_right = NRAND(2);
+  sp->top_bottom = NRAND(2);
+
+  box1 = MI_WIDTH(mi)/(sp->width+2);
+  box2 = MI_HEIGHT(mi)/(sp->height+2);
+  if (box1<box2)
+    sp->box = box1;
+  else
+    sp->box = box2;
+
+  if (sp->box >= 12) {
+    sp->box = (sp->box/12)*12;
+    create_bitmaps(mi,sp);
+    if (!sp->use_bitmaps)
+      free_bitmaps(sp);
+   }
+   else
+     sp->use_bitmaps = 0;
+
+  if (!sp->use_bitmaps) {
+    allocate(sp->rectangles,XRectangle,sp->width*sp->height*sizeof(XRectangle));
+    allocate(sp->lines,XSegment,sp->width*sp->height*sizeof(XSegment));
+  }
+
+  allocate(perm,int,sp->nr_polyominoes*sizeof(int));
+  random_permutation(sp->nr_polyominoes, perm);
+  sp->mono = MI_NPIXELS(mi) < 12;
+  start = NRAND(MI_NPIXELS(mi));
+  for (i=0;i<sp->nr_polyominoes;i++)
+    if (!sp->mono) {
+      sp->polyomino[i].color = MI_PIXEL(mi,(perm[i]*MI_NPIXELS(mi) / sp->nr_polyominoes + start) % MI_NPIXELS(mi));
+      if (sp->rot180) {
+         sp->polyomino[i+1].color = sp->polyomino[i].color;
+         i++;
+      }
+    }
+    else
+      if(sp->use_bitmaps)
+        sp->polyomino[i].color = MI_WHITE_PIXEL(mi);
+      else
+        sp->polyomino[i].color = MI_BLACK_PIXEL(mi);
+  free(perm);
+
+  if (sp->use_bitmaps) {
+    if (sp->mono)
+      sp->border_color = MI_WHITE_PIXEL(mi);
+    else
+      sp->border_color = MI_PIXEL(mi,NRAND(MI_NPIXELS(mi)));
+  }
+
+  sp->x_margin = (MI_WIDTH(mi)-sp->box*sp->width)/2;
+  sp->y_margin = (MI_HEIGHT(mi)-sp->box*sp->height)/2;
+
+  sp->wait = 0;
+
+  /* Clear the background. */
+  MI_CLEARWINDOW(mi);
+  
+}
+
+void
+draw_polyominoes(ModeInfo * mi) {
+  polyominoesstruct *sp;
+  int poly_no,point_no,transform_index,done,another_attachment_try;
+  point_type attach_point;
+  int i,detach_until;
+
+  if (polyominoeses == NULL)
+    return;
+  sp = &polyominoeses[MI_SCREEN(mi)];
+
+  if (MI_CYCLES(mi) != 0) {
+    if (++sp->counter > MI_CYCLES(mi)) {
+      init_polyominoes(mi);
+      return;
+    }
+  }
+
+  if (sp->box == 0) {
+    init_polyominoes(mi);
+    return;
+  }
+
+  MI_IS_DRAWN(mi) = True;
+  sp->wait--;
+  if (sp->wait>0) return;
+
+  memset(sp->changed_array,0,sp->width*sp->height*sizeof(int));
+
+  poly_no = first_poly_no(sp);
+  point_no = 0;
+  transform_index = 0;
+  done = 0;
+  another_attachment_try = 1;
+  find_blank(sp,&attach_point);
+  if (sp->identical && sp->nr_attached < sp->nr_polyominoes)
+    memset(&REASON_TO_NOT_ATTACH(sp->nr_attached,0),0,sp->nr_polyominoes*sizeof(int));
+  while(!done) {
+    if (sp->nr_attached < sp->nr_polyominoes) {
+      while (!done && another_attachment_try) {
+        done = attach(sp,poly_no,point_no,transform_index,attach_point,0,&REASON_TO_NOT_ATTACH(sp->nr_attached,0));
+        if (done && sp->rot180) {
+          poly_no = first_poly_no(sp);
+          done = attach(sp,poly_no,point_no,transform_index,attach_point,1,&REASON_TO_NOT_ATTACH(sp->nr_attached-1,0));
+          if (!done)
+            detach(sp,&poly_no,&point_no,&transform_index,&attach_point,0);
+        }
+        if (!done)
+          another_attachment_try = next_attach_try(sp,&poly_no,&point_no,&transform_index);
+      }
+    }
+
+    if (sp->identical) {
+      if (!done) {
+        if (sp->nr_attached == 0)
+          done = 1;
+        else {
+          detach_until=sp->nr_attached-1;
+          if (sp->nr_attached < sp->nr_polyominoes)
+            while (detach_until>0 && REASON_TO_NOT_ATTACH(sp->nr_attached,detach_until)==0)
+              detach_until--;
+          while (sp->nr_attached>detach_until) {
+            if (sp->rot180)
+              detach(sp,&poly_no,&point_no,&transform_index,&attach_point,1);
+            detach(sp,&poly_no,&point_no,&transform_index,&attach_point,0);
+            if (sp->nr_attached+1+sp->rot180 < sp->nr_polyominoes)
+              for (i=0;i<sp->nr_polyominoes;i++)
+                REASON_TO_NOT_ATTACH(sp->nr_attached,i) |= REASON_TO_NOT_ATTACH(sp->nr_attached+1+sp->rot180,i);
+          }
+          another_attachment_try = next_attach_try(sp,&poly_no,&point_no,&transform_index);
+        }
+      }
+    }
+    else {
+      if (!done) {
+        if (sp->nr_attached == 0)
+          done = 1;
+        else {
+          if (sp->rot180)
+            detach(sp,&poly_no,&point_no,&transform_index,&attach_point,1);
+          detach(sp,&poly_no,&point_no,&transform_index,&attach_point,0);
+        }
+        another_attachment_try = next_attach_try(sp,&poly_no,&point_no,&transform_index);
+      }
+    }
+  }
+
+  if (sp->use_bitmaps)
+    draw_with_bitmaps(mi,sp);
+  else
+    draw_without_bitmaps(mi,sp);
+
+  if (sp->nr_attached == sp->nr_polyominoes)
+    sp->wait = 100;
+  else
+    sp->wait = 0;
+}
+
+void
+release_polyominoes(ModeInfo * mi) {
+  int screen;
+  
+  if (polyominoeses != NULL) {
+    for (screen=0;screen<MI_NUM_SCREENS(mi); screen++)
+      free_polyominoes(&polyominoeses[screen]);
+    (void) free((void *) polyominoeses);
+    polyominoeses = NULL;
+  }
+}
+
+void
+refresh_polyominoes(ModeInfo * mi) {
+  MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_polyominoes */
diff --git a/modes/puzzle.c b/modes/puzzle.c
new file mode 100644 (file)
index 0000000..bec0bbc
--- /dev/null
@@ -0,0 +1,669 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* puzzle --- the familiar Sam Loyd puzzle */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)puzzle.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by Heath Rice <rice@asl.dl.nec.com>.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 20-Mar-1998: Ideas from slip.c and eyes.c, problems with XGetImage when
+ *              image moved off screen (-inwindow or -debug).
+ * 10-May-1997: Compatible with xscreensaver
+ * 15-Mar-1996: cleaned up, NUMBERED compile-time switch is now broken.
+ * Feb-1996: combined with rastering.  Jouk Jansen <joukj@hrem.stm.tudelft.nl>.
+ * Feb-1995: written.  Heath Rice <hrice@netcom.com>
+ */
+
+/*-
+ * Chops up the screen into squares and randomly slides them around
+ * like that game where you try to rearrange the little tiles in their
+ * original order.  After it scrambles the tiles for awhile, it reverses
+ * itself and puts them back like they started.  This mode looks the coolest
+ * if you have a picture on your background.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Puzzle"
+#define HACK_INIT init_puzzle
+#define HACK_DRAW draw_puzzle
+#define puzzle_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 250 \n" \
+ "*ncolors: 64 \n" \
+ "*bitmap: \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+#include "iostuff.h"
+
+#ifdef MODE_puzzle
+
+ModeSpecOpt puzzle_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   puzzle_description =
+{"puzzle", "init_puzzle", "draw_puzzle", "release_puzzle",
+ "init_puzzle", "init_puzzle", NULL, &puzzle_opts,
+ 10000, 250, 1, 1, 64, 1.0, "",
+ "Shows a puzzle being scrambled and then solved", 0, NULL};
+
+#endif
+
+#define PUZZLE_WIDTH   image_width
+#define PUZZLE_HEIGHT    image_height
+#define PUZZLE_BITS    image_bits
+#include "puzzle.xbm"
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#define PUZZLE_NAME    image_name
+#include "puzzle.xpm"
+#define DEFAULT_XPM 1
+#endif
+
+#define NOWAY 255
+
+  /*int storedmoves, *moves, *position, space;  To keep track of puzzle */
+typedef struct {
+       Bool        painted;    /* For debouncing */
+       int         excount;
+       int        *fixbuff;
+       XPoint      count, boxsize, windowsize;
+       XPoint      usablewindow, offsetwindow;
+       XPoint      randompos, randpos;
+       unsigned long black;
+       int         row, col, nextrow, nextcol, nextbox;
+       int         incrementOfMove;
+       int         lastbox;
+       int         forward;
+       int         prev;
+       int         moves;
+
+       /* Delta move stuff */
+       int         movingBox;
+       Pixmap      bufferBox;
+       int         cfactor, rfactor;
+       int         Lp;
+       int         cbs, cbw, rbs, rbw;
+       int         lengthOfMove;
+
+#ifdef NUMBERED
+       XImage     *image;
+       GC          gc;
+       /* Font stuff */
+       int         done;
+       int         ascent, fontWidth, fontHeight;
+#else
+       XImage     *logo;
+       GC          backGC;
+       Colormap    cmap;
+       int         graphics_format;
+#endif
+} puzzlestruct;
+
+static puzzlestruct *puzzles = NULL;
+
+static void
+free_stuff(Display * display, puzzlestruct * pp)
+{
+       if (pp->cmap != None) {
+               XFreeColormap(display, pp->cmap);
+               if (pp->backGC != None) {
+                       XFreeGC(display, pp->backGC);
+                       pp->backGC = None;
+               }
+               pp->cmap = None;
+       } else
+               pp->backGC = None;
+}
+
+static void
+free_puzzle(Display * display, puzzlestruct * pp)
+{
+       if (pp->fixbuff != NULL) {
+               (void) free((void *) pp->fixbuff);
+               pp->fixbuff = NULL;
+       }
+       if (pp->bufferBox != None) {
+               XFreePixmap(display, pp->bufferBox);
+               pp->bufferBox = None;
+       }
+       free_stuff(display, pp);
+       if (pp->logo) {
+               destroyImage(&pp->logo, &pp->graphics_format);
+               pp->logo = NULL;
+       }
+}
+
+#ifdef NUMBERED
+extern XFontStruct *getFont(Display * display);
+
+#define font_height(f) (f->ascent + f->descent)
+static XFontStruct *mode_font = None;
+
+static int
+font_width(XFontStruct * font, char ch)
+{
+       int         dummy;
+       XCharStruct xcs;
+
+       (void) XTextExtents(font, &ch, 1, &dummy, &dummy, &dummy, &xcs);
+       return xcs.width;
+}
+
+static Bool
+NumberScreen(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       puzzlestruct *pp = &puzzles[MI_SCREEN(mi)];
+
+       if (mode_font == None)
+               mode_font = getFont(display);
+       if (!pp->done) {
+               XGCValues   gcv;
+
+               pp->done = 1;
+               gcv.font = mode_font->fid;
+               XSetFont(display, MI_GC(mi), mode_font->fid);
+               gcv.graphics_exposures = False;
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((pp->gc = XCreateGC(display, window,
+                               GCForeground | GCBackground | GCGraphicsExposures | GCFont,
+                               &gcv)) == None) {
+                       free_puzzle(display, pp);
+                       return False;
+               }
+               pp->ascent = mode_font->ascent;
+               pp->fontHeight = font_height(mode_font);
+               pp->fontWidth = font_width(mode_font, '5');
+       }
+       XSetForeground(display, pp->gc, MI_WHITE_PIXEL(mi));
+
+       {
+               XPoint      pos, letter;
+               int         count = 1, digitOffset = 1, temp, letterOffset;
+               int         i, j, mult = pp->count.x * pp->count.y;
+               char        buf[16];
+
+               letter.x = pp->boxsize.x / 2 - 3;
+               letter.y = pp->boxsize.y / 2 + pp->ascent / 2 - 1;
+               letterOffset = pp->fontWidth / 2;
+               pos.y = 0;
+               for (j = 0; j < pp->count.y; j++) {
+                       pos.x = 0;
+                       for (i = 0; i < pp->count.x; i++) {
+                               if (count < mult) {
+                                       if (pp->boxsize.x > 2 * pp->fontWidth &&
+                                           pp->boxsize.y > pp->fontHeight) {
+                                               (void) sprintf(buf, "%d", count);
+                                               (void) XDrawString(display, window, pp->gc,
+                                                                  pos.x + letter.x - letterOffset * digitOffset +
+                                                            pp->randompos.x,
+                                                                  pos.y + letter.y + pp->randompos.y, buf, digitOffset);
+                                       }
+                                       XDrawRectangle(display, window, pp->gc,
+                                                      pos.x + 1 + pp->randompos.x, pos.y + 1 + pp->randompos.y,
+                                       pp->boxsize.x - 3, pp->boxsize.y - 3);
+                                       count++;
+                                       digitOffset = 0;
+                                       temp = count;
+                                       while (temp >= 1) {
+                                               temp /= 10;
+                                               digitOffset++;
+                                       }
+                               }
+                               pos.x += pp->boxsize.x;
+                       }
+                       pos.y += pp->boxsize.y;
+               }
+       }
+       return True;
+}
+#endif
+
+static int
+setupmove(ModeInfo * mi)
+{
+       puzzlestruct *pp = &puzzles[MI_SCREEN(mi)];
+
+       if ((pp->prev == pp->excount) && (pp->excount > 0) && (pp->forward == 1)) {
+               pp->lastbox = -1;
+               pp->forward = 0;
+               pp->prev--;
+       } else if ((pp->prev == -1) && (pp->excount > 0) && (pp->forward == 0)) {
+               pp->lastbox = -1;
+               pp->forward = 1;
+               pp->prev++;
+       }
+       if (pp->forward)
+               pp->nextbox = NRAND(5);
+       else
+               pp->nextbox = pp->fixbuff[pp->prev];
+
+       switch (pp->nextbox) {
+               case 0:
+                       if ((pp->row == 0) || (pp->lastbox == 2))
+                               pp->nextbox = NOWAY;
+                       else {
+                               pp->nextrow = pp->row - 1;
+                               pp->nextcol = pp->col;
+                       }
+                       break;
+               case 1:
+                       if ((pp->col == pp->count.x - 1) || (pp->lastbox == 3))
+                               pp->nextbox = NOWAY;
+                       else {
+                               pp->nextrow = pp->row;
+                               pp->nextcol = pp->col + 1;
+                       }
+                       break;
+               case 2:
+                       if ((pp->row == pp->count.y - 1) || (pp->lastbox == 0))
+                               pp->nextbox = NOWAY;
+                       else {
+                               pp->nextrow = pp->row + 1;
+                               pp->nextcol = pp->col;
+                       }
+                       break;
+               case 3:
+                       if ((pp->col == 0) || (pp->lastbox == 1))
+                               pp->nextbox = NOWAY;
+                       else {
+                               pp->nextrow = pp->row;
+                               pp->nextcol = pp->col - 1;
+                       }
+                       break;
+               default:
+                       pp->nextbox = NOWAY;
+                       break;
+       }
+
+       if (pp->nextbox != NOWAY) {
+               pp->lastbox = pp->nextbox;
+               return True;
+       } else
+               return False;
+}
+
+static void
+setupmovedelta(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       puzzlestruct *pp = &puzzles[MI_SCREEN(mi)];
+
+       if (pp->bufferBox != None) {
+               XFreePixmap(display, pp->bufferBox);
+               pp->bufferBox = None;
+       }
+       if ((pp->bufferBox = XCreatePixmap(display, MI_WINDOW(mi),
+                                pp->boxsize.x, pp->boxsize.y, MI_DEPTH(mi))) == None) {
+               free_puzzle(display, pp);
+               return;
+       }
+       XCopyArea(MI_DISPLAY(mi), MI_WINDOW(mi), pp->bufferBox, pp->backGC,
+                 pp->nextcol * pp->boxsize.x + pp->randompos.x + 1,
+                 pp->nextrow * pp->boxsize.y + pp->randompos.y + 1,
+                 pp->boxsize.x - 2, pp->boxsize.y - 2, 0, 0);
+       XFlush(MI_DISPLAY(mi));
+
+       if (pp->nextcol > pp->col) {
+               pp->cfactor = -1;
+               pp->cbs = pp->boxsize.x;
+               pp->cbw = pp->incrementOfMove;
+       } else if (pp->col > pp->nextcol) {
+               pp->cfactor = 1;
+               pp->cbs = -pp->incrementOfMove;
+               pp->cbw = pp->incrementOfMove;
+       } else {
+               pp->cfactor = 0;
+               pp->cbs = 0;
+               pp->cbw = pp->boxsize.x;
+       }
+       if (pp->nextrow > pp->row) {
+               pp->rfactor = -1;
+               pp->rbs = pp->boxsize.y;
+               pp->rbw = pp->incrementOfMove;
+       } else if (pp->row > pp->nextrow) {
+               pp->rfactor = 1;
+               pp->rbs = -pp->incrementOfMove;
+               pp->rbw = pp->incrementOfMove;
+       } else {
+               pp->rfactor = 0;
+               pp->rbs = 0;
+               pp->rbw = pp->boxsize.y;
+       }
+
+       if (pp->cfactor == 0)
+               pp->lengthOfMove = pp->boxsize.y;
+       else if (pp->rfactor == 0)
+               pp->lengthOfMove = pp->boxsize.x;
+       else
+               pp->lengthOfMove = MIN(pp->boxsize.x, pp->boxsize.y);
+       pp->Lp = pp->incrementOfMove;
+}
+
+static void
+wrapupmove(ModeInfo * mi)
+{
+       puzzlestruct *pp = &puzzles[MI_SCREEN(mi)];
+
+       if (pp->excount) {
+               if (pp->forward) {
+                       pp->fixbuff[pp->prev] = (pp->nextbox + 2) % 4;
+                       pp->prev++;
+               } else
+                       pp->prev--;
+       }
+}
+
+static void
+wrapupmovedelta(ModeInfo * mi)
+{
+       puzzlestruct *pp = &puzzles[MI_SCREEN(mi)];
+
+       if (pp->bufferBox) {
+
+               XCopyArea(MI_DISPLAY(mi), pp->bufferBox, MI_WINDOW(mi), pp->backGC,
+                         0, 0, pp->boxsize.x - 2, pp->boxsize.y - 2,
+                         pp->col * pp->boxsize.x + pp->randompos.x + 1,
+                         pp->row * pp->boxsize.y + pp->randompos.y + 1);
+
+               XFlush(MI_DISPLAY(mi));
+
+               pp->row = pp->nextrow;
+               pp->col = pp->nextcol;
+
+               XFreePixmap(MI_DISPLAY(mi), pp->bufferBox);
+               pp->bufferBox = None;
+       }
+}
+
+static int
+moveboxdelta(ModeInfo * mi)
+{
+       puzzlestruct *pp = &puzzles[MI_SCREEN(mi)];
+       int         cf = pp->nextcol * pp->boxsize.x +
+       pp->Lp * pp->cfactor + pp->randompos.x;
+       int         rf = pp->nextrow * pp->boxsize.y +
+       pp->Lp * pp->rfactor + pp->randompos.y;
+
+       if (pp->Lp <= pp->lengthOfMove) {
+               if (pp->bufferBox) {
+                       XCopyArea(MI_DISPLAY(mi), pp->bufferBox, MI_WINDOW(mi),
+                                 pp->backGC, 0, 0, pp->boxsize.x - 2, pp->boxsize.y - 2,
+                                 cf + 1, rf + 1);
+                       XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), pp->backGC,
+                                      cf + pp->cbs - 1, rf + pp->rbs - 1, pp->cbw + 2, pp->rbw + 2);
+               }
+               if ((pp->Lp + pp->incrementOfMove > pp->lengthOfMove) &&
+                   (pp->Lp != pp->lengthOfMove))
+                       pp->Lp = pp->lengthOfMove - pp->incrementOfMove;
+               pp->Lp += pp->incrementOfMove;
+               return False;
+       } else
+               return True;
+}
+
+static Bool
+init_stuff(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       puzzlestruct *pp = &puzzles[MI_SCREEN(mi)];
+
+       if (pp->logo == None)
+               getImage(mi, &pp->logo, PUZZLE_WIDTH, PUZZLE_HEIGHT, PUZZLE_BITS,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                        DEFAULT_XPM, PUZZLE_NAME,
+#endif
+                        &pp->graphics_format, &pp->cmap, &pp->black);
+               if (pp->logo == None) {
+                       free_puzzle(display, pp);
+                       return False;
+               }
+#ifndef STANDALONE
+       if (pp->cmap != None) {
+               setColormap(display, window, pp->cmap, MI_IS_INWINDOW(mi));
+               if (pp->backGC == None) {
+                       XGCValues   xgcv;
+
+                       xgcv.background = pp->black;
+                       if ((pp->backGC = XCreateGC(display, window, GCBackground,
+                                        &xgcv)) == None) {
+                               free_puzzle(display, pp);
+                               return False;
+                       }
+               }
+       } else
+#endif /* STANDALONE */
+       {
+               pp->black = MI_BLACK_PIXEL(mi);
+               pp->backGC = MI_GC(mi);
+       }
+       return True;
+}
+
+void
+init_puzzle(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       puzzlestruct *pp;
+       int         x, y;
+       XPoint      size;
+
+       if (puzzles == NULL) {
+               if ((puzzles = (puzzlestruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (puzzlestruct))) == NULL)
+                       return;
+       }
+       pp = &puzzles[MI_SCREEN(mi)];
+
+       if (pp->painted && pp->windowsize.x == MI_WIDTH(mi) &&
+           pp->windowsize.y == MI_HEIGHT(mi))
+               return;         /* Debounce since refresh_puzzle is init_puzzle */
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       if (pp->graphics_format >= IS_XPM) {
+               /* This is needed when another program changes the colormap. */
+               free_puzzle(display, pp);
+       }
+#endif
+       if (!init_stuff(mi))
+               return;
+       pp->excount = MI_COUNT(mi);
+       if (pp->excount < 0) {
+               if (pp->fixbuff != NULL) {
+                       (void) free((void *) pp->fixbuff);
+                       pp->fixbuff = NULL;
+               }
+               pp->excount = NRAND(-pp->excount) + 1;
+       }
+       pp->lastbox = -1;
+       pp->moves = 0;
+       pp->movingBox = False;
+
+       pp->windowsize.x = MI_WIDTH(mi);
+       pp->windowsize.y = MI_HEIGHT(mi);
+       if (pp->windowsize.x < 7)
+               pp->windowsize.x = 7;
+       if (pp->windowsize.y < 7)
+               pp->windowsize.y = 7;
+       pp->forward = 1;
+       pp->prev = 0;
+       /* don't want any exposure events from XCopyArea */
+       XSetGraphicsExposures(display, pp->backGC, False);
+
+       MI_CLEARWINDOWCOLORMAP(mi, pp->backGC, pp->black);
+
+       if (pp->logo) {
+               size.x = (pp->logo->width < pp->windowsize.x) ?
+                       pp->logo->width : pp->windowsize.x;
+               size.y = (pp->logo->height < pp->windowsize.y) ?
+                       pp->logo->height : pp->windowsize.y;
+       } else {
+               size.x = pp->windowsize.x;
+               size.y = pp->windowsize.y;
+       }
+       pp->boxsize.y = NRAND(1 + size.y / 4) + 6;
+       pp->boxsize.x = NRAND(1 + size.x / 4) + 6;
+       if ((pp->boxsize.x > 4 * pp->boxsize.y) ||
+           pp->boxsize.y > 4 * pp->boxsize.x)
+               pp->boxsize.x = pp->boxsize.y = 2 * MIN(pp->boxsize.x, pp->boxsize.y);
+       pp->count.x = size.x / pp->boxsize.x;
+       pp->count.y = size.y / pp->boxsize.y;
+
+       if (pp->bufferBox != None) {
+               XFreePixmap(display, pp->bufferBox);
+               pp->bufferBox = None;
+       }
+       pp->usablewindow.x = pp->count.x * pp->boxsize.x;
+       pp->usablewindow.y = pp->count.y * pp->boxsize.y;
+       pp->offsetwindow.x = (pp->windowsize.x - pp->usablewindow.x) / 2;
+       pp->offsetwindow.y = (pp->windowsize.y - pp->usablewindow.y) / 2;
+
+       pp->incrementOfMove = MIN(pp->usablewindow.x, pp->usablewindow.y) / 20;
+       pp->incrementOfMove = MAX(pp->incrementOfMove, 1);
+
+       if (pp->logo) {
+               pp->randompos.x = NRAND(MAX((pp->windowsize.x - pp->logo->width),
+                                           2 * pp->offsetwindow.x + 1));
+               pp->randompos.y = NRAND(MAX((pp->windowsize.y - pp->logo->height),
+                                           2 * pp->offsetwindow.y + 1));
+               if (MI_NPIXELS(mi) <= 2)
+                       XSetForeground(display, pp->backGC, MI_WHITE_PIXEL(mi));
+               else
+                       XSetForeground(display, pp->backGC, MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+               (void) XPutImage(display, window, pp->backGC, pp->logo,
+               (int) (NRAND(MAX(1, (pp->logo->width - pp->usablewindow.x)))),
+                                (int) (NRAND(MAX(1, (pp->logo->height - pp->usablewindow.y)))),
+                                pp->randompos.x, pp->randompos.y,
+                                pp->usablewindow.x, pp->usablewindow.y);
+               XSetForeground(display, pp->backGC, pp->black);
+               for (x = 0; x <= pp->count.x; x++) {
+                       int         tempx = x * pp->boxsize.x;
+
+                       XDrawLine(display, window, pp->backGC,
+                                 tempx + pp->randompos.x, pp->randompos.y,
+                                 tempx + pp->randompos.x, pp->usablewindow.y + pp->randompos.y);
+                       XDrawLine(display, window, pp->backGC,
+                               tempx + pp->randompos.x - 1, pp->randompos.y,
+                                 tempx + pp->randompos.x - 1, pp->usablewindow.y + pp->randompos.y);
+               }
+               for (y = 0; y <= pp->count.y; y++) {
+                       int         tempy = y * pp->boxsize.y;
+
+                       XDrawLine(display, window, pp->backGC,
+                                 pp->randompos.x, tempy + pp->randompos.y,
+                                 pp->usablewindow.x + pp->randompos.x, tempy + pp->randompos.y);
+                       XDrawLine(display, window, pp->backGC,
+                               pp->randompos.x, tempy + pp->randompos.y - 1,
+                                 pp->usablewindow.x + pp->randompos.x, tempy + pp->randompos.y - 1);
+               }
+       }
+#ifdef NUMBERED
+       else {
+               if (pp->image)
+                       (void) XDestroyImage(pp->image);
+               pp->randompos.x = pp->offsetwindow.x;
+               pp->randompos.y = pp->offsetwindow.y;
+               if (!NumberScreen(mi)) {
+                       release_puzzles(mi);
+                       return;
+               }
+               if ((pp->image = XGetImage(display, window,
+                                     pp->offsetwindow.x, pp->offsetwindow.y,
+                                     pp->usablewindow.x, pp->usablewindow.y,
+                                     AllPlanes,
+                                (MI_NPIXELS(mi) <= 2) ? XYPixmap : ZPixmap)) == None) {
+                       free_puzzle(display, pp);
+                       return;
+               }
+       }
+
+       pp->row = pp->count.y - 1;
+       pp->col = pp->count.x - 1;
+#else
+       pp->row = NRAND(pp->count.y);
+       pp->col = NRAND(pp->count.x);
+#endif
+
+       if ((pp->excount) && (pp->fixbuff == NULL))
+               if ((pp->fixbuff = (int *) calloc(pp->excount,
+                               sizeof (int))) == NULL) {
+                       free_puzzle(display, pp);
+                       return;
+               }
+       pp->painted = True;
+}
+
+void
+draw_puzzle(ModeInfo * mi)
+{
+       puzzlestruct *pp;
+
+       if (puzzles == NULL)
+               return;
+       pp = &puzzles[MI_SCREEN(mi)];
+       if (pp->fixbuff == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       pp->painted = False;
+       if (pp->movingBox) {
+               if (moveboxdelta(mi)) {
+                       wrapupmovedelta(mi);
+                       wrapupmove(mi);
+                       pp->movingBox = False;
+                       if (pp->moves++ > 2 * MI_COUNT(mi))
+                               init_puzzle(mi);
+               }
+       } else {
+               if (setupmove(mi)) {
+                       setupmovedelta(mi);
+                       pp->movingBox = True;
+               }
+       }
+}
+
+void
+release_puzzle(ModeInfo * mi)
+{
+       if (puzzles != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_puzzle(MI_DISPLAY(mi), &puzzles[screen]);
+               (void) free((void *) puzzles);
+               puzzles = NULL;
+       }
+#ifdef NUMBERED
+       if (mode_font != None) {
+               XFreeFont(MI_DISPLAY(mi), mode_font);
+               mode_font = None;
+       }
+#endif
+}
+
+#endif /* MODE_puzzle */
diff --git a/modes/pyro.c b/modes/pyro.c
new file mode 100644 (file)
index 0000000..e5ea303
--- /dev/null
@@ -0,0 +1,616 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* pyro --- fireworks */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)pyro.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 15-May-1997: jwz@jwz.org: turned into a standalone program.
+ * 05-Sep-1996: Added 3d support Henrik Theiling <theiling@coli.uni-sb.de>
+ * 16-Mar-1991: Written, received from David Brooks <brooks@osf.org>
+ */
+
+/*-
+ * The physics of the rockets is a little bogus, but it looks OK.  Each is
+ * given an initial velocity impetus.  They decelerate slightly (gravity
+ * overcomes the rocket's impulse) and explode as the rocket's main fuse
+ * gives out (we could add a ballistic stage, maybe).  The individual
+ * stars fan out from the rocket, and they decelerate less quickly.
+ * That's called bouyancy, but really it's again a visual preference.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Pyro"
+#define HACK_INIT init_pyro
+#define HACK_DRAW draw_pyro
+#define pyro_opts xlockmore_opts
+#define DEFAULTS "*delay: 15000 \n" \
+ "*count: 100 \n" \
+ "*size: -3 \n" \
+ "*ncolors: 200 \n" \
+ "*use3d: False \n" \
+ "*delta3d: 1.5 \n" \
+ "*right3d: red \n" \
+ "*left3d: blue \n" \
+ "*both3d: magenta \n" \
+ "*none3d: black \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_pyro
+
+ModeSpecOpt pyro_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   pyro_description =
+{"pyro", "init_pyro", "draw_pyro", "release_pyro",
+ "refresh_pyro", "init_pyro", NULL, &pyro_opts,
+ 15000, 100, 1, -3, 64, 1.0, "",
+ "Shows fireworks", 0, NULL};
+
+#endif
+
+#define ORANGE (MI_NPIXELS(mi) / 16)
+
+#define MINROCKETS 1
+#define MINSIZE 1
+
+#define SILENT 0
+#define REDGLARE 1
+#define BURSTINGINAIR 2
+
+#define CLOUD 0
+#define DOUBLECLOUD 1
+#define COLORCLOUD 2
+/* Clearly other types and other fascinating visual effects could be added... */
+
+/* P_xxx parameters represent the reciprocal of the probability... */
+#define P_IGNITE 5000          /* ...of ignition per cycle */
+#define P_DOUBLECLOUD 10       /* ...of an ignition being double */
+#define P_COLORCLOUD 5         /* ...of an ignition being full color */
+#define P_MULTI 75             /* ...of an ignition being several @ once */
+#define P_FUSILLADE 250                /* ...of an ignition starting a fusillade */
+
+#define ROCKETW 2              /* Dimensions of rocket */
+#define ROCKETH 4
+#define XVELFACTOR 0.0025      /* Max horizontal velocity / screen width */
+#define ZVELFACTOR 0.0025
+#define MINZVAL      250       /* absolute minimum of z values */
+#define MINZVALSTART 300       /* range where they start */
+#define MAXZVALSTART 1000
+#define SCREENZ      400
+/* the z-component still gets too small sometimes */
+#define GETZDIFFAUX(z) (MI_DELTA3D(mi)*20.0*(1.0-(SCREENZ)/(z)))
+#define GETZDIFF(z)    ((z)<MINZVAL?GETZDIFFAUX(MINZVAL):GETZDIFFAUX(z))
+#define MINYVELFACTOR 0.016    /* Min vertical velocity / screen height */
+#define MAXYVELFACTOR 0.018
+#define GRAVFACTOR 0.0002      /* delta v / screen height */
+#define MINFUSE 50             /* range of fuse lengths for rocket */
+#define MAXFUSE 100
+
+#define FUSILFACTOR 10         /* Generate fusillade by reducing P_IGNITE */
+#define FUSILLEN 100           /* Length of fusillade, in ignitions */
+
+#define SVELFACTOR 0.1         /* Max star velocity / yvel */
+#define BOUYANCY 0.2           /* Reduction in grav deceleration for stars */
+#define MAXSTARS 150           /* Number of stars issued from a shell */
+#define MINSTARS 50
+#define MINSFUSE 50            /* Range of fuse lengths for stars */
+#define MAXSFUSE 100
+
+#define INTRAND(min,max) (NRAND((max+1)-(min))+(min))
+#define FLOATRAND(min,max) ((min)+((double) LRAND()/((double) MAXRAND))*((max)-(min)))
+#define INCZ(val,add) if((val)+(add)>MINZVAL) val+=(add)
+#define ADDZ(val,add) (((val)+(add)>MINZVAL)?(val)+(add):(val))
+#define TWOPI (2.0*M_PI)
+
+typedef struct {
+       unsigned long color;
+       float       sx, sy, sz; /* Distance from notional center  */
+       float       sxvel, syvel, szvel;        /* Relative to notional center */
+} star;
+
+typedef struct {
+       int         state;
+       int         shelltype;
+       int         fuse;
+       float       xvel, yvel, zvel;
+       float       x, y, z;
+       unsigned long color[2];
+       int         nstars;
+       XRectangle  Xpoints[2][MAXSTARS];
+       XRectangle  Xpointsleft[2][MAXSTARS];
+       star        stars[MAXSTARS];
+} rocket;
+
+typedef struct {
+       int         p_ignite;
+       unsigned long rockpixel;
+       int         nflying, nrockets;
+       int         fusilcount;
+       int         width, height;
+       int         lmargin, rmargin;
+       int         star_size;
+       float       minvelx, maxvelx;
+       float       minvely, maxvely;
+       float       minvelz, maxvelz;
+       float       maxsvel;
+       float       rockdecel, stardecel;
+       rocket     *rockq;
+} pyrostruct;
+
+static void shootup(ModeInfo * mi, pyrostruct * pp, rocket * rp);
+static void burst(ModeInfo * mi, pyrostruct * pp, rocket * rp);
+
+static pyrostruct *pyros = NULL;
+static int  orig_p_ignite;
+static int  just_started = True;       /* Greet the user right away */
+
+static void
+ignite(ModeInfo * mi, pyrostruct * pp)
+{
+       rocket     *rp;
+       int         multi, shelltype, nstars, fuse, pix;
+       unsigned long color[2];
+       float       xvel, yvel, x, zvel = 0.0, z = 0.0;
+
+       x = NRAND(pp->width);
+       xvel = FLOATRAND(-pp->maxvelx, pp->maxvelx);
+/* All this to stop too many rockets going offscreen: */
+       if ((x < pp->lmargin && xvel < 0.0) || (x > pp->rmargin && xvel > 0.0))
+               xvel = -xvel;
+       yvel = FLOATRAND(pp->minvely, pp->maxvely);
+       if (MI_IS_USE3D(mi)) {
+               z = FLOATRAND(MINZVALSTART, MAXZVALSTART);
+               zvel = FLOATRAND(pp->minvelz, pp->maxvelz);
+       }
+       fuse = INTRAND(MINFUSE, MAXFUSE);
+       nstars = INTRAND(MINSTARS, MAXSTARS);
+       if (MI_NPIXELS(mi) > 2) {
+               pix = NRAND(MI_NPIXELS(mi));
+               color[0] = MI_PIXEL(mi, pix);
+               color[1] = MI_PIXEL(mi,
+                           ((pix + (MI_NPIXELS(mi) / 2)) % MI_NPIXELS(mi)));
+       } else {
+               color[0] = color[1] = MI_WHITE_PIXEL(mi);
+       }
+
+       multi = 1;
+       if (NRAND(P_DOUBLECLOUD) == 0)
+               shelltype = DOUBLECLOUD;
+       else {
+               shelltype = CLOUD;
+               if (NRAND(P_MULTI) == 0)
+                       multi = INTRAND(5, 15);
+       }
+       if (NRAND(P_COLORCLOUD) == 0)
+               shelltype |= COLORCLOUD;
+
+       rp = pp->rockq;
+       while (multi--) {
+               if (pp->nflying >= pp->nrockets)
+                       return;
+               while (rp->state != SILENT)
+                       rp++;
+               pp->nflying++;
+               rp->shelltype = shelltype;
+               rp->state = REDGLARE;
+               rp->color[0] = color[0];
+               rp->color[1] = color[1];
+               rp->xvel = xvel;
+               rp->yvel = FLOATRAND(yvel * 0.97, yvel * 1.03);
+               rp->fuse = INTRAND((fuse * 90) / 100, (fuse * 110) / 100);
+               rp->x = x + FLOATRAND(multi * 7.6, multi * 8.4);
+               rp->y = pp->height - 1;
+               if (MI_IS_USE3D(mi)) {
+                       rp->zvel = FLOATRAND(zvel * 0.97, zvel * 1.03);
+                       rp->z = z;
+               }
+               rp->nstars = nstars;
+       }
+}
+
+static void
+animate(ModeInfo * mi, pyrostruct * pp, rocket * rp)
+{
+       int         starn, diff;
+       float       r, theta;
+
+       if (rp->state == REDGLARE) {
+               shootup(mi, pp, rp);
+
+/* Handle setup for explosion */
+               if (rp->state == BURSTINGINAIR) {
+                       for (starn = 0; starn < rp->nstars; starn++) {
+                               rp->stars[starn].sx = rp->stars[starn].sy = 0.0;
+                               if (MI_IS_USE3D(mi)) {
+                                       rp->stars[starn].sz = 0.0;
+                                       diff = (int) GETZDIFF(rp->z);
+                                       rp->Xpoints[0][starn].x = (int) rp->x + diff;
+                                       rp->Xpointsleft[0][starn].x = (int) rp->x - diff;
+                                       rp->Xpoints[0][starn].y =
+                                               rp->Xpointsleft[0][starn].y = (int) rp->y;
+                                       if (rp->shelltype & DOUBLECLOUD) {
+                                               rp->Xpoints[1][starn].x = (int) rp->x + diff;
+                                               rp->Xpointsleft[1][starn].x = (int) rp->x - diff;
+                                               rp->Xpoints[1][starn].y =
+                                                       rp->Xpointsleft[1][starn].y = (int) rp->y;
+                                       }
+                                       /* this isn't really a 3d direction. it's */
+                                       /* very much the same as in worm. */
+                                       r = FLOATRAND(0.0, pp->maxsvel);
+                                       theta = FLOATRAND(0.0, TWOPI);
+                                       rp->stars[starn].sxvel = r * COSF(theta);
+                                       rp->stars[starn].syvel = r * SINF(theta);
+                                       theta = FLOATRAND(0.0, TWOPI);
+                                       rp->stars[starn].szvel = FLOATRAND(0.0, pp->maxsvel) * SINF(theta);
+                               } else {
+                                       rp->Xpoints[0][starn].x = (int) rp->x;
+                                       rp->Xpoints[0][starn].y = (int) rp->y;
+                                       if ((rp->shelltype & COLORCLOUD) && (MI_NPIXELS(mi) > 2)) {
+                                               if (NRAND(6) < 1)
+                                                       rp->stars[starn].color = MI_WHITE_PIXEL(mi);
+                                               else
+                                                       rp->stars[starn].color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                                       }
+                                       if (rp->shelltype & DOUBLECLOUD) {
+                                               rp->Xpoints[1][starn].x = (int) rp->x;
+                                               rp->Xpoints[1][starn].y = (int) rp->y;
+                                       }
+                                       r = FLOATRAND(0.0, pp->maxsvel);
+                                       theta = FLOATRAND(0.0, TWOPI);
+                                       rp->stars[starn].sxvel = r * COSF(theta);
+                                       rp->stars[starn].syvel = r * SINF(theta);
+                               }
+/* This isn't accurate solid geometry, but it looks OK. */
+                       }
+                       rp->fuse = INTRAND(MINSFUSE, MAXSFUSE);
+               }
+       }
+       if (rp->state == BURSTINGINAIR) {
+               burst(mi, pp, rp);
+       }
+}
+
+static void
+shootup(ModeInfo * mi, pyrostruct * pp, rocket * rp)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         diff, h;
+
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi))
+               XSetForeground(display, gc, MI_NONE_COLOR(mi));
+       else
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       if (MI_IS_USE3D(mi)) {
+               diff = (int) GETZDIFF(rp->z);
+               XFillRectangle(display, window, gc, (int) (rp->x) + diff, (int) (rp->y),
+                              ROCKETW, ROCKETH + 3);
+               XFillRectangle(display, window, gc, (int) (rp->x) - diff, (int) (rp->y),
+                              ROCKETW, ROCKETH + 3);
+       } else
+               XFillRectangle(display, window, gc, (int) (rp->x), (int) (rp->y),
+                              ROCKETW, ROCKETH + 3);
+
+       if (rp->fuse-- <= 0) {
+               rp->state = BURSTINGINAIR;
+               return;
+       }
+       rp->x += rp->xvel;
+       rp->y += rp->yvel;
+       rp->yvel += pp->rockdecel;
+       if (MI_IS_USE3D(mi)) {
+               INCZ(rp->z, rp->zvel);
+               diff = (int) GETZDIFF(rp->z);
+               h = (int) (ROCKETH + NRAND(4));
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXor);
+               XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+               XFillRectangle(display, window, gc, (int) (rp->x) + diff, (int) (rp->y),
+                              ROCKETW, h);
+               XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               XFillRectangle(display, window, gc, (int) (rp->x) - diff, (int) (rp->y),
+                              ROCKETW, h);
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXcopy);
+       } else {
+               XSetForeground(display, gc, pp->rockpixel);
+               XFillRectangle(display, window, gc, (int) (rp->x), (int) (rp->y),
+                              ROCKETW, (int) (ROCKETH + NRAND(4)));
+       }
+}
+
+static void
+burst(ModeInfo * mi, pyrostruct * pp, rocket * rp)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       register int starn;
+       register int nstars, stype;
+       register float rx, ry, rz = 0.0, sd;    /* Help compiler optimize :-) */
+       register float sx, sy, sz;
+       int         diff;
+
+       nstars = rp->nstars;
+       stype = rp->shelltype;
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi))
+               XSetForeground(display, gc, MI_NONE_COLOR(mi));
+       else
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+       XFillRectangles(display, window, gc, rp->Xpoints[0], nstars);
+       if (stype & DOUBLECLOUD)
+               XFillRectangles(display, window, gc, rp->Xpoints[1], nstars);
+       if (MI_IS_USE3D(mi)) {
+               XFillRectangles(display, window, gc, rp->Xpointsleft[0], nstars);
+               if (stype & DOUBLECLOUD)
+                       XFillRectangles(display, window, gc, rp->Xpointsleft[1], nstars);
+       }
+       if (rp->fuse-- <= 0) {
+               rp->state = SILENT;
+               pp->nflying--;
+               return;
+       }
+/* Stagger the stars' decay */
+       if (rp->fuse <= 7) {
+               if ((rp->nstars = nstars = nstars * 90 / 100) == 0)
+                       return;
+       }
+       rx = rp->x;
+       ry = rp->y;
+       if (MI_IS_USE3D(mi)) {
+               rz = rp->z;
+       }
+       sd = pp->stardecel;
+       for (starn = 0; starn < nstars; starn++) {
+               sx = rp->stars[starn].sx += rp->stars[starn].sxvel;
+               sy = rp->stars[starn].sy += rp->stars[starn].syvel;
+               rp->stars[starn].syvel += sd;
+               if (MI_IS_USE3D(mi)) {
+                       if (rz + rp->stars[starn].sz + rp->stars[starn].szvel > MINZVAL)
+                               rp->stars[starn].sz += rp->stars[starn].szvel;
+                       sz = rp->stars[starn].sz;
+                       diff = (int) GETZDIFF(rz + sz);
+                       rp->Xpoints[0][starn].x = (int) (rx + sx + diff);
+                       rp->Xpointsleft[0][starn].x = (int) (rx + sx - diff);
+                       rp->Xpoints[0][starn].y =
+                               rp->Xpointsleft[0][starn].y = (int) (ry + sy);
+                       if (stype & DOUBLECLOUD) {
+                               rp->Xpoints[1][starn].x = (int) (rx + 1.7 * sx) + diff;
+                               rp->Xpointsleft[1][starn].x = (int) (rx + 1.7 * sx) - diff;
+                               rp->Xpoints[1][starn].y =
+                                       rp->Xpointsleft[1][starn].y = (int) (ry + 1.7 * sy);
+                       }
+               } else {
+
+                       rp->Xpoints[0][starn].x = (int) (rx + sx);
+                       rp->Xpoints[0][starn].y = (int) (ry + sy);
+                       if (stype & DOUBLECLOUD) {
+                               rp->Xpoints[1][starn].x = (int) (rx + 1.7 * sx);
+                               rp->Xpoints[1][starn].y = (int) (ry + 1.7 * sy);
+                       }
+               }
+       }
+       rp->x = rx + rp->xvel;
+       rp->y = ry + rp->yvel;
+       if (MI_IS_USE3D(mi)) {
+               rp->z = ADDZ(rz, rp->zvel);
+       }
+       rp->yvel += sd;
+
+       if (MI_IS_USE3D(mi)) {
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXor);
+               XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+               XFillRectangles(display, window, gc, rp->Xpoints[0], nstars);
+               if (stype & DOUBLECLOUD) {
+                       XFillRectangles(display, window, gc, rp->Xpoints[1], nstars);
+               }
+               XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               XFillRectangles(display, window, gc, rp->Xpointsleft[0], nstars);
+               if (stype & DOUBLECLOUD) {
+                       XFillRectangles(display, window, gc, rp->Xpointsleft[1], nstars);
+               }
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXcopy);
+       } else {
+
+               if ((stype & COLORCLOUD) && (MI_NPIXELS(mi) > 2)) {
+                       for (starn = 0; starn < nstars; starn++) {
+                               XSetForeground(display, gc, rp->stars[starn].color);
+                               XFillRectangle(display, window, gc,
+                                              rp->Xpoints[0][starn].x, rp->Xpoints[0][starn].y,
+                                              rp->Xpoints[0][starn].width, rp->Xpoints[0][starn].height);
+                       }
+               } else {
+                       XSetForeground(display, gc, rp->color[0]);
+                       XFillRectangles(display, window, gc, rp->Xpoints[0], nstars);
+               }
+               if (stype & DOUBLECLOUD) {
+                       XSetForeground(display, gc, rp->color[1]);
+                       XFillRectangles(display, window, gc, rp->Xpoints[1], nstars);
+               }
+       }
+}
+
+void
+init_pyro(ModeInfo * mi)
+{
+       int         rockn, starn;
+       int         size = MI_SIZE(mi);
+       rocket     *rp;
+       pyrostruct *pp;
+
+       if (pyros == NULL) {
+               if ((pyros = (pyrostruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (pyrostruct))) == NULL)
+                       return;
+       }
+       pp = &pyros[MI_SCREEN(mi)];
+
+       pp->width = MI_WIDTH(mi);
+       pp->height = MI_HEIGHT(mi);
+       pp->lmargin = pp->width / 16;
+       pp->rmargin = pp->width - pp->lmargin;
+
+       pp->nrockets = MI_COUNT(mi);
+       if (pp->nrockets < -MINROCKETS) {
+               if (pp->rockq) {
+                       (void) free((void *) pp->rockq);
+                       pp->rockq = NULL;
+               }
+               pp->nrockets = NRAND(-pp->nrockets - MINROCKETS + 1) + MINROCKETS;
+       } else if (pp->nrockets < MINROCKETS)
+               pp->nrockets = MINROCKETS;
+       if (size < -MINSIZE)
+               pp->star_size = NRAND(MIN(-size, MAX(MINSIZE,
+                 MIN(pp->width, pp->height) / 64)) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE) {
+               if (!size)
+                       pp->star_size = MAX(MINSIZE, MIN(pp->width, pp->height) / 64);
+               else
+                       pp->star_size = MINSIZE;
+       } else
+               pp->star_size = MIN(size, MAX(MINSIZE, MIN(pp->width, pp->height) / 64));
+       orig_p_ignite = P_IGNITE / pp->nrockets;
+       if (orig_p_ignite <= 0)
+               orig_p_ignite = 1;
+       pp->p_ignite = orig_p_ignite;
+
+       if (!pp->rockq) {
+               if ((pp->rockq = (rocket *) malloc(pp->nrockets *
+                                sizeof (rocket))) == NULL) {
+                       return;
+               }
+       }
+       pp->nflying = pp->fusilcount = 0;
+
+       for (rockn = 0, rp = pp->rockq; rockn < pp->nrockets; rockn++, rp++) {
+               rp->state = SILENT;
+               for (starn = 0; starn < MAXSTARS; starn++) {
+                       rp->Xpoints[0][starn].width = rp->Xpoints[0][starn].height =
+                               rp->Xpoints[1][starn].width = rp->Xpoints[1][starn].height =
+                               pp->star_size;
+                       if (MI_IS_USE3D(mi)) {
+                               rp->Xpointsleft[0][starn].width = rp->Xpointsleft[0][starn].height =
+                                       rp->Xpointsleft[1][starn].width = rp->Xpointsleft[1][starn].height =
+                                       pp->star_size;
+                       }
+               }
+       }
+
+       if (MI_NPIXELS(mi) > 3)
+               pp->rockpixel = MI_PIXEL(mi, ORANGE);
+       else
+               pp->rockpixel = MI_WHITE_PIXEL(mi);
+
+/* Geometry-dependent physical data: */
+       pp->maxvelx = (float) (pp->width) * XVELFACTOR;
+       pp->minvelx = -pp->maxvelx;
+       pp->minvely = -(float) (pp->height) * MINYVELFACTOR;
+       pp->maxvely = -(float) (pp->height) * MAXYVELFACTOR;
+       if (MI_IS_USE3D(mi)) {
+               pp->maxvelz = (float) (MAXZVALSTART - MINZVALSTART) * ZVELFACTOR;
+               pp->minvelz = -pp->maxvelz;
+       }
+       pp->maxsvel = pp->minvely * SVELFACTOR;
+       pp->rockdecel = (float) (pp->height) * GRAVFACTOR;
+       pp->stardecel = pp->rockdecel * BOUYANCY;
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+/* ARGSUSED */
+void
+draw_pyro(ModeInfo * mi)
+{
+       rocket     *rp;
+       int         rockn;
+       pyrostruct *pp;
+
+       if (pyros == NULL)
+               return;
+       pp = &pyros[MI_SCREEN(mi)];
+       if (pp->rockq == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (just_started || (NRAND(pp->p_ignite) == 0)) {
+               just_started = False;
+               if (NRAND(P_FUSILLADE) == 0) {
+                       pp->p_ignite = orig_p_ignite / FUSILFACTOR;
+                       if (pp->p_ignite <= 0)
+                               pp->p_ignite = 1;
+                       pp->fusilcount = INTRAND(FUSILLEN * 9 / 10, FUSILLEN * 11 / 10);
+               }
+               ignite(mi, pp);
+               if (pp->fusilcount > 0) {
+                       if (--pp->fusilcount == 0)
+                               pp->p_ignite = orig_p_ignite;
+               }
+       }
+       for (rockn = pp->nflying, rp = pp->rockq; rockn > 0; rp++) {
+               if (rp->state != SILENT) {
+                       animate(mi, pp, rp);
+                       rockn--;
+               }
+       }
+}
+
+void
+release_pyro(ModeInfo * mi)
+{
+       if (pyros != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       pyrostruct *pp = &pyros[screen];
+
+                       if (pp->rockq != NULL) {
+                               (void) free((void *) pp->rockq);
+                       }
+               }
+               (void) free((void *) pyros);
+               pyros = NULL;
+       }
+}
+
+void
+refresh_pyro(ModeInfo * mi)
+{
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+#endif /* MODE_pyro */
diff --git a/modes/qix.c b/modes/qix.c
new file mode 100644 (file)
index 0000000..bd0f8dd
--- /dev/null
@@ -0,0 +1,419 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* qix --- vector swirl */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)qix.c        5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 03-Mar-1998: Combined with Darrick Brown's "geometry".
+ * 10-May-1997: Compatible with xscreensaver
+ * 29-Jul-1990: support for multiple screens.
+ *                 made check_bounds_?() a macro.
+ *                 fixed initial parameter setup.
+ * 15-Dec-1989: Fix for proper skipping of {White,Black}Pixel() in colors.
+ * 08-Oct-1989: Fixed bug in memory allocation in init_qix().
+ *                 Moved seconds() to an extern.
+ * 23-Sep-1989: Switch to random() and fixed bug w/ less than 4 lines.
+ * 20-Sep-1989: Lint.
+ * 24-Mar-1989: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Qix"
+#define HACK_INIT init_qix
+#define HACK_DRAW draw_qix
+#define qix_opts xlockmore_opts
+#define DEFAULTS "*delay: 30000 \n" \
+ "*count: -5 \n" \
+ "*cycles: 32 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_qix
+
+#define DEF_COMPLETE  "False"
+#define DEF_KALEID  "False"
+
+static Bool complete;
+static Bool kaleid;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-complete", (char *) ".qix.complete", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+complete", (char *) ".qix.complete", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-kaleid", (char *) ".qix.kaleid", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+kaleid", (char *) ".qix.kaleid", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+      {(caddr_t *) & complete, (char *) "complete", (char *) "Complete", (char *) DEF_COMPLETE, t_Bool},
+       {(caddr_t *) & kaleid, (char *) "kaleid", (char *) "Kaleid", (char *) DEF_KALEID, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+complete", (char *) "turn on/off complete morphing graph"},
+       {(char *) "-/+kaleid", (char *) "turn on/off complete kaleidoscope"}
+};
+
+ModeSpecOpt qix_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   qix_description =
+{"qix", "init_qix", "draw_qix", "release_qix",
+ "refresh_qix", "init_qix", NULL, &qix_opts,
+ 30000, -5, 32, 1, 64, 1.0, "",
+ "Shows spinning lines a la Qix(tm)", 0, NULL};
+
+#endif
+
+/* How many segments to draw per cycle when redrawing */
+#define REDRAWSTEP 3
+#define MINPOINTS 2
+/*-
+ * remember when complete: the number of lines to be drawn is 1+2+3+...+N or
+ * N(N+1)/2
+ */
+
+/* I forget now, did Newton discover this as a boy? */
+#define NEWT(n) (n*(n+1)/2)
+
+typedef struct {
+       int         pix;
+       int         first, last;
+       XPoint     *delta, *position;
+       int         npoints;
+       int         offset;
+       int         max_delta;
+       int         width, height, mid, midx, midy;
+       int         nlines, linecount;
+       int         redrawing, redrawpos;
+       XPoint     *lineq;
+       Bool        complete;
+       Bool        kaleid;
+} qixstruct;
+
+static qixstruct *qixs = NULL;
+
+#define check_bounds(qp, val, del, min, max)                           \
+{                                                              \
+    if ((val) < (min)) {                                               \
+       *(del) = NRAND((qp)->max_delta) + (qp)->offset; \
+    } else if ((val) >= (max)) {                                       \
+       *(del) = -(NRAND((qp)->max_delta)) - (qp)->offset;      \
+    }                                                          \
+}
+
+static void
+free_qix(qixstruct *qp)
+{
+       if (qp->lineq != NULL) {
+               (void) free((void *) qp->lineq);
+               qp->lineq = NULL;
+       }
+       if (qp->delta != NULL) {
+               (void) free((void *) qp->delta);
+               qp->delta = NULL;
+       }
+       if (qp->position != NULL) {
+               (void) free((void *) qp->position);
+               qp->position = NULL;
+       }
+}
+
+void
+init_qix(ModeInfo * mi)
+{
+       qixstruct  *qp;
+       int         i;
+
+       if (qixs == NULL) {
+               if ((qixs = (qixstruct *) calloc(MI_NUM_SCREENS(mi),
+                                                sizeof (qixstruct))) == NULL)
+                       return;
+       }
+       qp = &qixs[MI_SCREEN(mi)];
+
+       qp->width = MI_WIDTH(mi);
+       qp->height = MI_HEIGHT(mi);
+       qp->mid = MAX(qp->width, qp->height) / 2;
+       qp->midx = qp->width / 2;
+       qp->midy = qp->height / 2;
+       qp->max_delta = 16;
+       qp->redrawing = 0;
+       qp->linecount = 0;
+
+       if (qp->width < 100) {  /* icon window */
+               qp->max_delta /= 4;
+       }
+       qp->offset = qp->max_delta / 3;
+       qp->last = 0;
+       if (MI_NPIXELS(mi) > 2)
+               qp->pix = NRAND(MI_NPIXELS(mi));
+
+       qp->npoints = MI_COUNT(mi);
+       if (qp->npoints < -MINPOINTS)
+               qp->npoints = NRAND(qp->npoints - MINPOINTS + 1) + MINPOINTS;
+       /* Absolute minimum */
+       if (qp->npoints < MINPOINTS)
+               qp->npoints = MINPOINTS;
+
+       if (MI_IS_FULLRANDOM(mi))
+               qp->complete = (Bool) (LRAND() & 1);
+       else
+               qp->complete = complete;
+
+       if (qp->complete) {
+               qp->kaleid = False;
+       } else {
+               if (MI_IS_FULLRANDOM(mi))
+                       qp->kaleid = (Bool) (LRAND() & 1);
+               else
+                       qp->kaleid = kaleid;
+       }
+       if (qp->delta)
+               (void) free((void *) qp->delta);
+       if (qp->position)
+               (void) free((void *) qp->position);
+
+       if ((qp->delta = (XPoint *) malloc(qp->npoints *
+                       sizeof (XPoint))) == NULL) {
+               free_qix(qp);
+               return;
+       }
+       if ((qp->position = (XPoint *) malloc(qp->npoints *
+                       sizeof (XPoint))) == NULL) {
+               free_qix(qp);
+               return;
+       }
+       for (i = 0; i < qp->npoints; i++) {
+               qp->delta[i].x = NRAND(qp->max_delta) + qp->offset;
+               qp->delta[i].y = NRAND(qp->max_delta) + qp->offset;
+               qp->position[i].x = NRAND(qp->width);
+               qp->position[i].y = NRAND(qp->height);
+       }
+
+       qp->nlines = (qp->npoints == 2) ? (MI_CYCLES(mi) + 1) * 2 :
+               ((MI_CYCLES(mi) + qp->npoints) / qp->npoints) * qp->npoints;
+       if (qp->complete) {
+               qp->max_delta /= 4;
+               qp->nlines = qp->npoints;
+       }
+       if (qp->kaleid) {
+               qp->nlines = MI_CYCLES(mi) * 16;        /* Fudge it so its compatible */
+       }
+       if (qp->lineq) {
+               (void) free((void *) qp->lineq);
+               qp->lineq = NULL;
+       }
+       if (!qp->kaleid) {
+               if ((qp->lineq = (XPoint *) malloc(qp->nlines *
+                               sizeof (XPoint))) == NULL) {
+                       free_qix(qp);
+                       return;
+               }
+               for (i = 0; i < qp->nlines; i++)
+                       qp->lineq[i].x = qp->lineq[i].y = -1;   /* move initial point off screen */
+       }
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_qix(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       qixstruct  *qp = &qixs[MI_SCREEN(mi)];
+       int         i, j, k, l;
+
+       qp->first = (qp->last + qp->npoints) % qp->nlines;
+
+       MI_IS_DRAWN(mi) = True;
+
+       for (i = 0; i < qp->npoints; i++) {
+               qp->position[i].x += qp->delta[i].x;
+               qp->position[i].y += qp->delta[i].y;
+               if (NRAND(20) < 1) {
+                       check_bounds(qp, qp->position[i].x, &qp->delta[i].x,
+                                    qp->width / 3, 2 * qp->width / 3);
+               } else {
+                       check_bounds(qp, qp->position[i].x, &qp->delta[i].x, 0, qp->width);
+               }
+               if (NRAND(20) < 1) {
+                       check_bounds(qp, qp->position[i].y, &qp->delta[i].y,
+                                    qp->height / 3, 2 * qp->height / 3);
+               } else {
+                       check_bounds(qp, qp->position[i].y, &qp->delta[i].y, 0, qp->height);
+               }
+       }
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       if (qp->complete && qp->npoints > 3) {
+               for (i = 0; i < qp->npoints - 1; i++)
+                       for (j = i + 1; j < qp->npoints; j++)
+                               XDrawLine(display, MI_WINDOW(mi), gc,
+                                         qp->lineq[qp->first + i].x, qp->lineq[qp->first + i].y,
+                                         qp->lineq[qp->first + j].x, qp->lineq[qp->first + j].y);
+       } else if (!qp->kaleid) {
+               for (i = 1; i < qp->npoints + ((qp->npoints == 2) ? -1 : 0); i++)
+                       XDrawLine(display, MI_WINDOW(mi), gc,
+                                 qp->lineq[qp->first + i - 1].x, qp->lineq[qp->first + i - 1].y,
+                                 qp->lineq[qp->first + i].x, qp->lineq[qp->first + i].y);
+               XDrawLine(display, MI_WINDOW(mi), gc,
+                         qp->lineq[qp->first].x, qp->lineq[qp->first].y,
+                         qp->lineq[qp->first + qp->npoints - 1].x,
+                         qp->lineq[qp->first + qp->npoints - 1].y);
+       }
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, qp->pix));
+               if (++qp->pix >= MI_NPIXELS(mi))
+                       qp->pix = 0;
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       if (qp->complete && qp->npoints > 3) {
+               for (i = 0; i < qp->npoints - 1; i++)
+                       for (j = i + 1; j < qp->npoints; j++)
+                               XDrawLine(display, MI_WINDOW(mi), gc,
+                                       qp->position[i].x, qp->position[i].y,
+                                      qp->position[j].x, qp->position[j].y);
+       } else if (qp->kaleid) {
+               for (i = 0; i < qp->npoints; i++) {
+                       XSegment    segs[8];
+                       XPoint      small[2];
+
+                       j = (i + 1) % qp->npoints;
+                       small[0].x = ABS(qp->position[i].x - qp->mid);
+                       small[0].y = ABS(qp->position[i].y - qp->mid);
+                       small[1].x = ABS(qp->position[j].x - qp->mid);
+                       small[1].y = ABS(qp->position[j].y - qp->mid);
+                       segs[0].x1 = qp->midx + small[0].x;
+                       segs[0].y1 = qp->midy + small[0].y;
+                       segs[0].x2 = qp->midx + small[1].x;
+                       segs[0].y2 = qp->midy + small[1].y;
+                       segs[1].x1 = qp->midx - small[0].x;
+                       segs[1].y1 = qp->midy + small[0].y;
+                       segs[1].x2 = qp->midx - small[1].x;
+                       segs[1].y2 = qp->midy + small[1].y;
+                       segs[2].x1 = qp->midx - small[0].x;
+                       segs[2].y1 = qp->midy - small[0].y;
+                       segs[2].x2 = qp->midx - small[1].x;
+                       segs[2].y2 = qp->midy - small[1].y;
+                       segs[3].x1 = qp->midx + small[0].x;
+                       segs[3].y1 = qp->midy - small[0].y;
+                       segs[3].x2 = qp->midx + small[1].x;
+                       segs[3].y2 = qp->midy - small[1].y;
+                       segs[4].x1 = qp->midx + small[0].y;
+                       segs[4].y1 = qp->midy + small[0].x;
+                       segs[4].x2 = qp->midx + small[1].y;
+                       segs[4].y2 = qp->midy + small[1].x;
+                       segs[5].x1 = qp->midx + small[0].y;
+                       segs[5].y1 = qp->midy - small[0].x;
+                       segs[5].x2 = qp->midx + small[1].y;
+                       segs[5].y2 = qp->midy - small[1].x;
+                       segs[6].x1 = qp->midx - small[0].y;
+                       segs[6].y1 = qp->midy - small[0].x;
+                       segs[6].x2 = qp->midx - small[1].y;
+                       segs[6].y2 = qp->midy - small[1].x;
+                       segs[7].x1 = qp->midx - small[0].y;
+                       segs[7].y1 = qp->midy + small[0].x;
+                       segs[7].x2 = qp->midx - small[1].y;
+                       segs[7].y2 = qp->midy + small[1].x;
+                       XDrawSegments(display, MI_WINDOW(mi), gc, segs, 8);
+                       if (qp->npoints == 2)   /* do not repeat drawing the same line */
+                               break;
+               }
+               if (++qp->linecount >= qp->nlines) {
+                       qp->linecount = 0;
+                       MI_CLEARWINDOW(mi);
+               }
+       } else {
+               for (i = 1; i < qp->npoints + ((qp->npoints == 2) ? -1 : 0); i++)
+                       XDrawLine(display, MI_WINDOW(mi), gc,
+                               qp->position[i - 1].x, qp->position[i - 1].y,
+                                 qp->position[i].x, qp->position[i].y);
+               XDrawLine(display, MI_WINDOW(mi), gc, qp->position[0].x, qp->position[0].y,
+                         qp->position[qp->npoints - 1].x, qp->position[qp->npoints - 1].y);
+       }
+
+       if (!qp->kaleid)
+               for (i = 0; i < qp->npoints; i++) {
+                       qp->lineq[qp->last].x = qp->position[i].x;
+                       qp->lineq[qp->last].y = qp->position[i].y;
+                       qp->last++;
+                       if (qp->last >= qp->nlines)
+                               qp->last = 0;
+               }
+       if (qp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       j = (qp->first - qp->redrawpos + qp->nlines - qp->npoints) % qp->nlines;
+                       if (qp->complete && qp->npoints > 3) {
+                               for (k = 0; k < qp->npoints - 1; k++)
+                                       for (l = k + 1; l < qp->npoints; l++)
+                                               XDrawLine(display, MI_WINDOW(mi), gc,
+                                                         qp->lineq[j + k].x, qp->lineq[j + k].y,
+                                                         qp->lineq[j + l].x, qp->lineq[j + l].y);
+                       } else if (!qp->kaleid) {
+                               for (k = 1; k < qp->npoints + ((qp->npoints == 2) ? -1 : 0); k++)
+                                       XDrawLine(display, MI_WINDOW(mi), gc,
+                                                 qp->lineq[j + k - 1].x, qp->lineq[j + k - 1].y,
+                                                 qp->lineq[j + k].x, qp->lineq[j + k].y);
+                               XDrawLine(display, MI_WINDOW(mi), gc,
+                                         qp->lineq[j].x, qp->lineq[j].y,
+                                         qp->lineq[j + qp->npoints - 1].x, qp->lineq[j + qp->npoints - 1].y);
+                       }
+                       qp->redrawpos += qp->npoints;
+                       if (qp->redrawpos >= qp->nlines - qp->npoints) {
+                               qp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
+release_qix(ModeInfo * mi)
+{
+       if (qixs != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_qix(&qixs[screen]);
+               (void) free((void *) qixs);
+               qixs = NULL;
+       }
+}
+
+void
+refresh_qix(ModeInfo * mi)
+{
+       qixstruct  *qp = &qixs[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       qp->redrawing = 1;
+       qp->redrawpos = 0;
+}
+
+#endif /* MODE_qix */
diff --git a/modes/random.c b/modes/random.c
new file mode 100644 (file)
index 0000000..125dbb9
--- /dev/null
@@ -0,0 +1,1022 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* random --- run random modes for a certain duration */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)random.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Made more compatible with xscreensaver :)
+ * 18-Mar-1996: Ron Hitchens <ron@idiom.com>
+ *              Re-coded for the ModeInfo calling scheme.  Added the
+ *              change hook.  Get ready for 3.8 release.
+ * 23-Dec-1995: Ron Hitchens <ron@idiom.com>
+ *              Re-coded pickMode() to keep track of the modes, so
+ *              that all modes are tried before there are any repeats.
+ *              Also prevent a mode from being picked twice in a row
+ *              (could happen as first pick after refreshing the list).
+ * 04-Sep-1995: Written by Heath A. Kehoe <hakehoe@icaen.uiowa.edu>.
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Random"
+#define HACK_INIT init_random
+#define HACK_DRAW draw_random
+#define random_opts xlockmore_opts
+#define DEFAULTS "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#include "util.h"
+#endif /* STANDALONE */
+
+#define DEF_DURATION   "60"    /* 0 == infinite duration */
+#define DEF_MODELIST   ""
+#define DEF_SEQUENTIAL "False"
+#define DEF_FULLRANDOM "True"
+
+static int  duration;
+static char *modelist;
+static Bool sequential;
+extern Bool fullrandom;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-duration", (char *) ".random.duration", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-modelist", (char *) ".random.modelist", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-sequential", (char *) ".random.sequential", XrmoptionNoArg, (caddr_t) "on"},
+      {(char *) "+sequential", (char *) ".random.sequential", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-sequential", (char *) ".random.sequential", XrmoptionNoArg, (caddr_t) "on"},
+      {(char *) "+sequential", (char *) ".random.sequential", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-fullrandom", (char *) ".random.fullrandom", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+fullrandom", (char *) ".random.fullrandom", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & duration, (char *) "duration", (char *) "Duration", (char *) DEF_DURATION, t_Int},
+    {(caddr_t *) & modelist, (char *) "modelist", (char *) "Modelist", (char *) DEF_MODELIST, t_String},
+       {(caddr_t *) & sequential, (char *) "sequential", (char *) "Sequential", (char *) DEF_SEQUENTIAL, t_Bool},
+{(caddr_t *) & fullrandom, (char *) "fullrandom", (char *) "FullRandom", (char *) DEF_FULLRANDOM, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-duration num", (char *) "how long a mode runs before changing to another"},
+       {(char *) "-modelist string", (char *) "list of modes to randomly choose from"},
+       {(char *) "-/+sequential", (char *) "turn on/off picking of modes sequentially"},
+       {(char *) "-/+fullrandom", (char *) "turn on/off full random choice of mode-options"}
+};
+
+ModeSpecOpt random_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   random_description =
+{"random", "init_random", "draw_random", "release_random",
+ "refresh_random", "change_random", NULL, &random_opts,
+ 1, 1, 1, 1, 64, 1.0, "",
+#ifdef MODE_run
+#ifdef MODE_bomb
+ "Shows a random mode from above except blank, run, and bomb", 0, NULL};
+#else
+ "Shows a random mode from above except blank and run", 0, NULL};
+#endif
+#else
+#ifdef MODE_bomb
+ "Shows a random mode from above except blank and bomb", 0, NULL};
+#else
+ "Shows a random mode from above except blank", 0, NULL};
+#endif
+#endif
+
+#endif
+
+#define GC_SAVE_VALUES (GCFunction|GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle|GCGraphicsExposures|GCFont|GCSubwindowMode)
+
+extern int  startscreen;
+extern int  delay;
+extern int  count;
+extern int  cycles;
+extern int  size;
+extern int  ncolors;
+extern float saturation;
+extern char *bitmap;
+
+#define MAXMODECHARS 14
+
+static char special_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_bomb
+       "bomb",
+#endif
+#ifdef MODE_run
+       "run",
+#endif
+       "blank", "random"
+};
+
+#define NUMSPECIAL (int) (sizeof (special_modes) / sizeof (special_modes[0]))
+
+#ifdef USE_GL
+static char gl_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_atlantis
+       "atlantis",
+#endif
+#ifdef MODE_bubble3d
+       "bubble3d",
+#endif
+#ifdef MODE_cage
+       "cage",
+#endif
+#ifdef MODE_fire
+       "fire",
+#endif
+#ifdef MODE_gears
+       "gears",
+#endif
+#ifdef MODE_glplanet
+       "glplanet",
+#endif
+#ifdef MODE_invert
+       "invert",
+#endif
+#ifdef MODE_lament
+       "lament",
+#endif
+#ifdef MODE_moebius
+       "moebius",
+#endif
+#ifdef MODE_molecule
+       "molecule",
+#endif
+#ifdef MODE_morph3d
+       "morph3d",
+#endif
+#ifdef MODE_pipes
+       "pipes",
+#endif
+#ifdef MODE_rubik
+       "rubik",
+#endif
+#ifdef MODE_sballs
+       "sballs",
+#endif
+#ifdef MODE_sierpinski3d
+       "sierpinski3d",
+#endif
+#ifdef MODE_skewb
+       "skewb",
+#endif
+#ifdef MODE_sproingies
+       "sproingies",
+#endif
+#ifdef MODE_stairs
+       "stairs",
+#endif
+#ifdef MODE_superquadrics
+       "superquadrics",
+#endif
+#ifdef MODE_text3d
+       "text3d"
+#endif
+};
+
+#define NUMGL (int) (sizeof (gl_modes) / sizeof (gl_modes[0]))
+#else
+static char gl_modes[][MAXMODECHARS] =
+{""};
+
+#define NUMGL 0
+#endif
+
+static char xpm_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_bat
+       "bat",
+#endif
+#ifdef MODE_image
+       "image",
+#endif
+#ifdef MODE_flag
+       "flag",
+#endif
+#ifdef MODE_life
+       "life",
+#endif
+#ifdef MODE_life1d
+       "life1d",
+#endif
+#ifdef MODE_maze
+       "maze",
+#endif
+#ifdef MODE_puzzle
+       "puzzle"
+#endif
+};
+
+#define NUMXPM (int) (sizeof (xpm_modes) / sizeof (xpm_modes[0]))
+
+static char write_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_crystal
+       "crystal",
+#endif
+#ifdef MODE_mandelbrot
+       "mandelbrot",
+#endif
+#ifdef MODE_starfish
+       "starfish",
+#endif
+#ifdef MODE_swirl
+       "swirl",
+#endif
+#ifdef MODE_tetris
+       "tetris",
+#endif
+#ifdef MODE_tik_tak
+       "tik_tak",
+#endif
+#ifdef MODE_tube
+       "tube"
+#endif
+       /* XPM modes are usually writable too ... */
+};
+
+#define NUMWRITE (int) (sizeof (write_modes) / sizeof (write_modes[0]))
+
+static char nice_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_blot
+       "blot",
+#endif
+#ifdef MODE_bouboule
+       "bouboule",
+#endif
+#ifdef MODE_bug
+       "bug",
+#endif
+#ifdef MODE_clock
+       "clock",
+#endif
+#ifdef MODE_crystal
+       "crystal",
+#endif
+#ifdef MODE_daisy
+       "daisy",
+#endif
+#ifdef MODE_dclock
+       "dclock",
+#endif
+#ifdef MODE_demon
+       "demon",
+#endif
+#ifdef MODE_deco
+       "deco",
+#endif
+#ifdef MODE_dragon
+       "dragon",
+#endif
+#ifdef MODE_eyes
+       "eyes",
+#endif
+#ifdef MODE_fadeplot
+       "fadeplot",
+#endif
+#ifdef MODE_flag
+       "flag",
+#endif
+#ifdef MODE_flame
+       "flame",
+#endif
+#ifdef MODE_grav
+       "grav",
+#endif
+#ifdef MODE_helix
+       "helix",
+#endif
+#ifdef MODE_hyper
+       "hyper",
+#endif
+#ifdef MODE_ico
+       "ico",
+#endif
+#ifdef MODE_image
+       "image",
+#endif
+#ifdef MODE_kaleid
+       "kaleid",
+#endif
+#ifdef MODE_laser
+  "laser",
+#endif
+#ifdef MODE_life
+  "life",
+#endif
+#ifdef MODE_life1d
+  "life1d",
+#endif
+#ifdef MODE_life3d
+  "life3d",
+#endif
+#ifdef MODE_lightning
+  "lightning",
+#endif
+#ifdef MODE_lisa
+  "lisa",
+#endif
+#ifdef MODE_lissie
+  "lissie",
+#endif
+#ifdef MODE_loop
+  "loop",
+#endif
+#ifdef MODE_marquee
+       "marquee",
+#endif
+#ifdef MODE_nose
+       "nose",
+#endif
+#ifdef MODE_penrose
+       "penrose",
+#endif
+#ifdef MODE_petal
+       "petal",
+#endif
+#ifdef MODE_puzzle
+       "puzzle",
+#endif
+#ifdef MODE_pyro
+       "pyro",
+#endif
+#ifdef MODE_qix
+       "qix",
+#endif
+#ifdef MODE_roll
+       "roll",
+#endif
+#ifdef MODE_rotor
+       "rotor",
+#endif
+#ifdef MODE_shape
+       "shape",
+#endif
+#ifdef MODE_sierpinski
+       "sierpinski",
+#endif
+#ifdef MODE_solitare
+       "solitare",
+#endif
+#ifdef MODE_spline
+       "spline",
+#endif
+#ifdef MODE_star
+       "star",
+#endif
+#ifdef MODE_swarm
+       "swarm",
+#endif
+#ifdef MODE_triangle
+       "triangle",
+#endif
+#ifdef MODE_tube
+       "tube",
+#endif
+#ifdef MODE_turtle
+       "turtle",
+#endif
+#ifdef MODE_vines
+       "vines",
+#endif
+#ifdef MODE_voters
+       "voters",
+#endif
+#ifdef MODE_wire
+       "wire",
+#endif
+#ifdef MODE_world
+       "world",
+#endif
+#ifdef MODE_worm
+       "worm",
+#endif
+#ifdef MODE_xjack
+       "xjack"
+#endif
+};
+
+#define NUMNICE (int) (sizeof (nice_modes) / sizeof (nice_modes[0]))
+
+static char use3d_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_bouboule
+       "bouboule",
+#endif
+#ifdef MODE_hyper
+       "hyper",
+#endif
+#ifdef MODE_pyro
+       "pyro",
+#endif
+#ifdef MODE_star
+       "star",
+#endif
+#ifdef MODE_worm
+       "worm"
+#endif
+};
+
+#define NUMUSE3D (int) (sizeof (use3d_modes) / sizeof (use3d_modes[0]))
+
+static char mouse_modes[][MAXMODECHARS] =
+{
+#ifndef DISABLE_INTERACTIVE
+#ifdef MODE_solitare
+       "solitare",
+#endif
+#ifdef MODE_tetris
+       "tetris",
+#endif
+#endif
+#ifdef MODE_eyes
+       "eyes",
+#endif
+#ifdef MODE_fire
+       "fire",
+#endif
+#ifdef MODE_julia
+       "julia",
+#endif
+#ifdef MODE_swarm
+       "swarm",
+#endif
+#ifdef MODE_swarm
+       "t3d"
+#endif
+};
+
+#define NUMMOUSE (int) (sizeof (mouse_modes) / sizeof (mouse_modes[0]))
+
+static char automata_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_ant
+       "ant",
+#endif
+#ifdef MODE_bug
+       "bug",
+#endif
+#ifdef MODE_demon
+       "demon",
+#endif
+#ifdef MODE_dilemma
+       "dilemma",
+#endif
+#ifdef MODE_life
+       "life",
+#endif
+#ifdef MODE_life1d
+       "life1d",
+#endif
+#ifdef MODE_life3d
+       "life3d",
+#endif
+#ifdef MODE_loop
+       "loop",
+#endif
+#ifdef MODE_voters
+       "voters",
+#endif
+#ifdef MODE_wator
+       "wator",
+#endif
+#ifdef MODE_wire
+       "wire"
+#endif
+};
+
+#define NUMAUTOMATA (int) (sizeof (automata_modes) / sizeof (automata_modes[0]))
+
+static char fractal_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_coral
+       "coral",
+#endif
+#ifdef MODE_discrete
+       "discrete",
+#endif
+#ifdef MODE_dragon
+       "dragon",
+#endif
+#ifdef MODE_drift
+       "drift",
+#endif
+#ifdef MODE_euler2d
+       "euler2d",
+#endif
+#ifdef MODE_flame
+       "flame",
+#endif
+#ifdef MODE_flow
+       "flow",
+#endif
+#ifdef MODE_forest
+       "forest",
+#endif
+#ifdef MODE_julia
+       "julia",
+#endif
+#ifdef MODE_hop
+       "hop",
+#endif
+#ifdef MODE_ifs
+       "ifs",
+#endif
+#ifdef MODE_lightning
+       "lightning",
+#endif
+#ifdef MODE_mandelbrot
+       "mandelbrot",
+#endif
+#ifdef MODE_mountain
+       "mountain",
+#endif
+#ifdef MODE_sierpinski
+       "sierpinski",
+#endif
+#ifdef MODE_strange
+       "strange",
+#endif
+#ifdef MODE_thornbird
+       "thornbird",
+#endif
+#ifdef MODE_triangle
+       "triangle",
+#endif
+#ifdef MODE_turtle
+       "turtle",
+#endif
+#ifdef MODE_vines
+       "vines"
+#endif
+};
+
+#define NUMFRACTAL (int) (sizeof (fractal_modes) / sizeof (fractal_modes[0]))
+
+
+static char geometry_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_braid
+       "braid",
+#endif
+#ifdef MODE_fadeplot
+       "fadeplot",
+#endif
+#ifdef MODE_helix
+       "helix",
+#endif
+#ifdef MODE_hyper
+       "hyper",
+#endif
+#ifdef MODE_ico
+       "ico",
+#endif
+#ifdef MODE_kaleid
+       "kaleid",
+#endif
+#ifdef MODE_laser
+       "laser",
+#endif
+#ifdef MODE_lisa
+       "lisa",
+#endif
+#ifdef MODE_lissie
+       "lissie",
+#endif
+#ifdef MODE_penrose
+       "penrose",
+#endif
+#ifdef MODE_petal
+       "petal",
+#endif
+#ifdef MODE_polyominoes
+       "polyominoes",
+#endif
+#ifdef MODE_qix
+       "qix",
+#endif
+#ifdef MODE_shape
+       "shape",
+#endif
+#ifdef MODE_sphere
+       "sphere",
+#endif
+#ifdef MODE_spiral
+       "spiral",
+#endif
+#ifdef MODE_spline
+       "spline",
+#endif
+#ifdef MODE_tik_tak
+       "tik_tak"
+#endif
+};
+
+#define NUMGEOMETRY (int) (sizeof (geometry_modes) / sizeof (geometry_modes[0]))
+
+static char space_modes[][MAXMODECHARS] =
+{
+#ifdef MODE_bouboule
+       "bouboule",
+#endif
+#ifdef MODE_galaxy
+       "galaxy",
+#endif
+#ifdef MODE_grav
+       "grav",
+#endif
+#ifdef MODE_star
+       "star",
+#endif
+#ifdef MODE_world
+       "world"
+#endif
+};
+
+#define NUMSPACE (int) (sizeof (space_modes) / sizeof (space_modes[0]))
+
+typedef struct {
+       XGCValues   gcvs;
+       int         fix;
+} randomstruct;
+
+static int  currentmode = -1;
+static int  previousmode = -1;
+static unsigned long starttime;
+static int *modes;
+static int  nmodes;
+static Bool change_now = False;
+
+static randomstruct *randoms;
+
+static int
+pickMode(void)
+{
+       static int *mode_indexes = NULL;
+       static int  mode_count = 0;
+       static int  last_mode = -1, last_index = -1;
+       int         mode, i;
+
+       if (mode_indexes == NULL) {
+               if ((mode_indexes = (int *) calloc(nmodes,
+                               sizeof (int))) == NULL) {
+                       if (sequential)
+                               return modes[0];
+                       else
+                               return modes[NRAND(nmodes)];
+               }
+       }
+       if (mode_count == 0) {
+               for (i = 0; i < nmodes; i++) {
+                       mode_indexes[i] = modes[i];
+               }
+               mode_count = nmodes;
+       }
+       if (mode_count == 1) {
+               /* only one left, let's use that one */
+               last_index = -1;
+               return (last_mode = mode_indexes[--mode_count]);
+       } else {
+               /* pick a random slot in the list, check for last */
+               if (sequential) {
+                       last_index = i = (last_index + 1) % nmodes;
+               } else
+                       while (mode_indexes[i = NRAND(mode_count)] == last_mode);
+       }
+
+       mode = mode_indexes[i]; /* copy out chosen mode */
+       /* move mode at end of list to slot vacated by chosen mode, dec count */
+       mode_indexes[i] = mode_indexes[--mode_count];
+       return (last_mode = mode);      /* remember last mode picked */
+}
+
+static char *
+strpmtok(int *sign, char *str)
+{
+       static int  nextsign = 0;
+       static char *loc;
+       char       *p, *r;
+
+       if (str)
+               loc = str;
+       if (nextsign) {
+               *sign = nextsign;
+               nextsign = 0;
+       }
+       p = loc - 1;
+       for (;;) {
+               switch (*++p) {
+                       case '+':
+                               *sign = 1;
+                               continue;
+                       case '-':
+                               *sign = -1;
+                               continue;
+                       case ' ':
+                       case ',':
+                       case '\t':
+                       case '\n':
+                               continue;
+                       case 0:
+                               loc = p;
+                               return NULL;
+               }
+               break;
+       }
+       r = p;
+
+       for (;;) {
+               switch (*++p) {
+                       case '+':
+                               nextsign = 1;
+                               break;
+                       case '-':
+                               nextsign = -1;
+                               break;
+                       case ' ':
+                       case ',':
+                       case '\t':
+                       case '\n':
+                       case 0:
+                               break;
+                       default:
+                               continue;
+               }
+               break;
+       }
+       if (*p) {
+               *p = 0;
+               loc = p + 1;
+       } else
+               loc = p;
+
+       return r;
+}
+
+static Bool
+parsemodelist(ModeInfo * mi)
+{
+       int         i, sign = 1, j, found;
+       char       *p;
+
+       if ((modes = (int *) calloc(numprocs - 1, sizeof (int))) == NULL) {
+                       return False;
+       }
+       p = strpmtok(&sign, (modelist) ? modelist : (char *) "");
+
+       while (p) {
+               if (!strcmp(p, "all")) {
+                       for (i = 0; i < numprocs; i++) {
+                               found = 0;
+                               for (j = 0; j < NUMSPECIAL; j++)
+                                       if (!strcmp(special_modes[j], LockProcs[i].cmdline_arg)) {
+                                               found = 1; /* if found do not want on list nomatter sign */
+                             break;
+                                       }
+                               if (!found)
+                                       modes[i] = (sign > 0);
+                       }
+               } else if (!strcmp(p, "allgl")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMGL; j++)
+                                       if (!strcmp(gl_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allxpm")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMXPM; j++)
+                                       if (!strcmp(xpm_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allwrite")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMWRITE; j++)
+                                       if (!strcmp(write_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allnice")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMNICE; j++)
+                                       if (!strcmp(nice_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "all3d")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMUSE3D; j++)
+                                       if (!strcmp(use3d_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allmouse")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMMOUSE; j++)
+                                       if (!strcmp(mouse_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allautomata")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMAUTOMATA; j++)
+                                       if (!strcmp(automata_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allfractal")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMFRACTAL; j++)
+                                       if (!strcmp(fractal_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allgeometry")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMGEOMETRY; j++)
+                                       if (!strcmp(geometry_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else if (!strcmp(p, "allspace")) {
+                       for (i = 0; i < numprocs; i++)
+                               for (j = 0; j < NUMSPACE; j++)
+                                       if (!strcmp(space_modes[j], LockProcs[i].cmdline_arg))
+                                               modes[i] = (sign > 0);
+               } else {
+                       for (i = 0; i < numprocs - 1; i++)
+                               if (!strcmp(p, LockProcs[i].cmdline_arg))
+                                       break;
+                       if (i < numprocs - 1)
+                               modes[i] = (sign > 0);
+                       else
+                               (void) fprintf(stderr, "unrecognized mode \"%s\"\n", p);
+               }
+               p = strpmtok(&sign, (char *) NULL);
+       }
+
+       nmodes = 0;
+       for (i = 0; i < numprocs - 1; i++)
+               if (modes[i])
+                       modes[nmodes++] = i;
+       if (!nmodes) {          /* empty list */
+               for (i = 0; i < numprocs; i++) {
+                       found = 0;
+                       for (j = 0; j < NUMSPECIAL; j++)
+                               if (!strcmp(special_modes[j], LockProcs[i].cmdline_arg)) {
+                                       found = 1;
+                     break;
+                               }
+                       if (!found)
+                               modes[i] = i;
+               }
+               nmodes = numprocs - NUMSPECIAL;
+       }
+       if (MI_IS_DEBUG(mi)) {
+               (void) fprintf(stderr, "%d mode%s: ", nmodes, ((nmodes == 1) ? "" : "s"));
+               for (i = 0; i < nmodes; i++)
+                       (void) fprintf(stderr, "%d ", modes[i]);
+               (void) fprintf(stderr, "\n");
+       }
+       return True;
+}
+
+static void
+setMode(ModeInfo * mi, int newmode)
+{
+       randomstruct *rp = &randoms[MI_SCREEN(mi)];
+       int         i;
+
+       previousmode = currentmode;
+       currentmode = newmode;
+
+/* FIX THIS GLOBAL ACCESS */
+       delay = MI_DELAY(mi) = LockProcs[currentmode].def_delay;
+       count = MI_COUNT(mi) = LockProcs[currentmode].def_count;
+       cycles = MI_CYCLES(mi) = LockProcs[currentmode].def_cycles;
+       size = MI_SIZE(mi) = LockProcs[currentmode].def_size;
+       ncolors = MI_NCOLORS(mi) = LockProcs[currentmode].def_ncolors;
+       saturation = MI_SATURATION(mi) = LockProcs[currentmode].def_saturation;
+       bitmap = MI_BITMAP(mi) = LockProcs[currentmode].def_bitmap;
+
+       for (i = startscreen; i < MI_NUM_SCREENS(mi); i++) {
+
+               XChangeGC(MI_DISPLAY(mi), MI_GC(mi), GC_SAVE_VALUES,
+                         &(rp->gcvs));         /* Not sure if this is right for multiscreens */
+               randoms[i].fix = True;
+       }
+       if (MI_IS_VERBOSE(mi))
+               (void) fprintf(stderr, "mode %d: %s\n", currentmode, LockProcs[currentmode].cmdline_arg);
+}
+
+void
+init_random(ModeInfo * mi)
+{
+       randomstruct *rp;
+       int         i;
+
+       if (randoms == NULL) {
+               if ((randoms = (randomstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (randomstruct))) == NULL)
+                       return;
+       }
+       rp = &randoms[MI_SCREEN(mi)];
+
+       MI_SET_FLAG_STATE(mi, WI_FLAG_FULLRANDOM, fullrandom);
+       if (currentmode < 0) {
+               if (!parsemodelist(mi))
+                       return;
+               for (i = startscreen; i < MI_NUM_SCREENS(mi); i++) {
+                       (void) XGetGCValues(MI_DISPLAY(mi), MI_GC(mi),
+                                           GC_SAVE_VALUES, &(rp->gcvs));
+               }
+               setMode(mi, pickMode());
+               starttime = seconds();
+               if (duration < 0)
+                       duration = 0;
+       }
+       if (rp->fix) {
+               fixColormap(mi, MI_NCOLORS(mi),
+                       MI_SATURATION(mi), MI_IS_MONO(mi), MI_IS_INSTALL(mi),
+                   MI_IS_INROOT(mi), MI_IS_INWINDOW(mi), MI_IS_VERBOSE(mi));
+               rp->fix = False;
+       }
+       call_init_hook(&LockProcs[currentmode], mi);
+}
+
+void
+draw_random(ModeInfo * mi)
+{
+       int         scrn = MI_SCREEN(mi);
+       int         newmode;
+       unsigned long now = seconds();
+       int         has_run = (duration == 0) ? 0 : (int) (now - starttime);
+       static int  do_init = 0;
+       randomstruct *rp;
+
+       if (randoms == NULL)
+               return;
+       rp = &randoms[scrn];
+       if (currentmode < 0)
+               return;
+
+       if ((scrn == startscreen) && do_init) {
+               do_init = 0;
+       }
+       if ((scrn == startscreen) && (change_now || (has_run > duration))) {
+               newmode = pickMode();
+
+               MI_CLEARWINDOW(mi);
+
+               setMode(mi, newmode);
+               starttime = now;
+               do_init = 1;
+               change_now = False;
+       }
+       if (rp->fix) {
+               fixColormap(mi, MI_NCOLORS(mi),
+                       MI_SATURATION(mi), MI_IS_MONO(mi), MI_IS_INSTALL(mi),
+                   MI_IS_INROOT(mi), MI_IS_INWINDOW(mi), MI_IS_VERBOSE(mi));
+               rp->fix = False;
+       }
+       if (do_init) {
+               call_init_hook(&LockProcs[currentmode], mi);
+       }
+       call_callback_hook(&LockProcs[currentmode], mi);
+}
+
+void
+refresh_random(ModeInfo * mi)
+{
+       if (currentmode < 0)
+               return;
+       call_refresh_hook(&LockProcs[currentmode], mi);
+}
+
+void
+change_random(ModeInfo * mi)
+{
+       if (currentmode < 0)
+               return;
+       if (MI_SCREEN(mi) == startscreen)
+               change_now = True;      /* force a change on next draw callback */
+       draw_random(mi);
+}
+
+void
+release_random(ModeInfo * mi)
+{
+       if (previousmode >= 0 && previousmode != currentmode)
+               call_release_hook(&LockProcs[previousmode], mi);
+       previousmode = currentmode;
+}
diff --git a/modes/roll.c b/modes/roll.c
new file mode 100644 (file)
index 0000000..290e3a6
--- /dev/null
@@ -0,0 +1,333 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* roll --- rolling ball of points */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)roll.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by Charles Vidal <vidalc@club-internet.fr>
+ *         http://www.chez.com/vidalc
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997:  Compatible with xscreensaver
+ * 1995: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Roll"
+#define HACK_INIT init_roll
+#define HACK_DRAW draw_roll
+#define roll_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: 25 \n" \
+ "*size: -64 \n" \
+ "*ncolors: 200 \n"
+#define BRIGHT_COLORS
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_roll
+
+ModeSpecOpt roll_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   roll_description =
+{"roll", "init_roll", "draw_roll", "release_roll",
+ "refresh_roll", "init_roll", NULL, &roll_opts,
+ 100000, 25, 1, -64, 64, 0.6, "",
+ "Shows a rolling ball", 0, NULL};
+
+#endif
+
+#define MINPTS 1
+#define MINSIZE 8
+#define FACTOR 8.0
+#define SPEED 25.0
+
+typedef struct {
+       float       t, u, v;
+       float       t1, u1, v1;
+} ptsstruct;
+typedef struct {
+       ptsstruct  *pts;
+       XPoint     *p;
+       int         maxpts, npts;
+       float       alpha, theta, phi, r;
+       XPoint      sphere, direction;
+       int         color;
+       int         width, height;
+} rollstruct;
+
+static rollstruct *rolls = NULL;
+
+static void
+createsphere(rollstruct * rp, int n1, int n2)
+{
+       double      i, j;
+       int         n = 0;
+
+       for (i = 0.0; i < FACTOR * M_PI; i += (FACTOR * M_PI) / n1)
+               for (j = 0.0; j < FACTOR * M_PI; j += (FACTOR * M_PI) / n2) {
+                       rp->pts[n].t1 = rp->r * COSF(i) * COSF(j);
+                       rp->pts[n].u1 = rp->r * COSF(i) * SINF(j);
+                       rp->pts[n].v1 = rp->r * SINF(i);
+                       n++;
+               }
+}
+
+static void
+rotation3d(rollstruct * rp)
+{
+       float       c1, c2, c3, c4, c5, c6, c7, c8, c9, x, y, z;
+       float       sintheta, costheta;
+       float       sinphi, cosphi;
+       float       sinalpha, cosalpha;
+       int         i;
+
+       sintheta = SINF(rp->theta);
+       costheta = COSF(rp->theta);
+       sinphi = SINF(rp->phi);
+       cosphi = COSF(rp->phi);
+       sinalpha = SINF(rp->alpha);
+       cosalpha = COSF(rp->alpha);
+
+       c1 = cosphi * costheta;
+       c2 = sinphi * costheta;
+       c3 = -sintheta;
+
+       c4 = cosphi * sintheta * sinalpha - sinphi * cosalpha;
+       c5 = sinphi * sintheta * sinalpha + cosphi * cosalpha;
+       c6 = costheta * sinalpha;
+
+       c7 = cosphi * sintheta * cosalpha + sinphi * sinalpha;
+       c8 = sinphi * sintheta * cosalpha - cosphi * sinalpha;
+       c9 = costheta * cosalpha;
+       for (i = 0; i < rp->maxpts; i++) {
+               x = rp->pts[i].t;
+               y = rp->pts[i].u;
+               z = rp->pts[i].v;
+               rp->pts[i].t = c1 * x + c2 * y + c3 * z;
+               rp->pts[i].u = c4 * x + c5 * y + c6 * z;
+               rp->pts[i].v = c7 * x + c8 * y + c9 * z;
+       }
+}
+
+static void
+project(rollstruct * rp)
+{
+       int         i;
+
+       for (i = 0; i < rp->maxpts; i++) {
+               rp->p[i].x = (short) (2 * rp->pts[i].t);
+               rp->p[i].y = (short) (2 * rp->pts[i].u);
+       }
+}
+
+static void
+free_roll(rollstruct *rp)
+{
+       if (rp->pts != NULL) {
+               (void) free((void *) rp->pts);
+               rp->pts = NULL;
+       }
+       if (rp->p != NULL) {
+               (void) free((void *) rp->p);
+               rp->p = NULL;
+       }
+}
+
+void
+init_roll(ModeInfo * mi)
+{
+       int         i;
+       int         size = MI_SIZE(mi);
+       double      ang;
+       rollstruct *rp;
+
+       if (rolls == NULL) {
+               if ((rolls = (rollstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (rollstruct))) == NULL)
+                       return;
+       }
+       rp = &rolls[MI_SCREEN(mi)];
+
+       ang = (double) NRAND(75) + 7.5;
+       rp->direction.x = (short) ((2 * (LRAND() & 1)) - 1) * (int)
+               (SPEED * SINF(ang * M_PI / 180.0));
+       rp->direction.y = (short) ((2 * (LRAND() & 1)) - 1) * (int)
+               (SPEED * COSF(ang * M_PI / 180.0));
+       rp->width = MI_WIDTH(mi);
+       rp->height = MI_HEIGHT(mi);
+       if (size < -MINSIZE)
+               rp->r = NRAND(MIN(-size, MAX(MINSIZE,
+                  MIN(rp->width, rp->height) / 4)) - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE) {
+               if (!size)
+                       rp->r = MAX(MINSIZE, MIN(rp->width, rp->height) / 4);
+               else
+                       rp->r = MINSIZE;
+       } else
+               rp->r = MIN(size, MAX(MINSIZE,
+                                     MIN(rp->width, rp->height) / 4));
+       rp->sphere.x = NRAND(MAX(1, rp->width - 4 * (int) rp->r)) +
+               2 * (int) rp->r;
+       rp->sphere.y = NRAND(MAX(1, rp->height - 4 * (int) rp->r)) +
+               2 * (int) rp->r;
+       rp->alpha = 0;
+       rp->theta = 0;
+       rp->phi = 0;
+       rp->maxpts = MI_COUNT(mi);
+       if (rp->maxpts < -MINPTS) {
+               /* if rp->maxpts is random ... the size can change */
+               if (rp->pts != NULL) {
+                       (void) free((void *) rp->pts);
+                       rp->pts = NULL;
+               }
+               rp->maxpts = NRAND(-rp->maxpts - MINPTS + 1) + MINPTS;
+       } else if (rp->maxpts < MINPTS)
+               rp->maxpts = MINPTS;
+       i = rp->maxpts;
+       rp->maxpts *= rp->maxpts;
+       rp->npts = 0;
+       if (rp->pts == NULL)
+               if ((rp->pts = (ptsstruct *) malloc(rp->maxpts *
+                               sizeof (ptsstruct))) ==NULL) {
+                       free_roll(rp);
+                       return;
+               }
+       if (rp->p != NULL) {
+               (void) free((void *) rp->p);
+               rp->p = NULL;
+       }
+       if (MI_NPIXELS(mi) > 2)
+               rp->color = NRAND(MI_NPIXELS(mi));
+       createsphere(rp, i, i);
+
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_roll(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         i;
+       rollstruct *rp;
+
+       if (rolls == NULL)
+               return;
+       rp = &rolls[MI_SCREEN(mi)];
+       if (rp->pts == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       for (i = 0; i < rp->maxpts; i++) {
+               rp->pts[i].t = rp->pts[i].t1;
+               rp->pts[i].u = rp->pts[i].u1;
+               rp->pts[i].v = rp->pts[i].v1;
+       }
+       rp->alpha += ((FACTOR * M_PI) / 200.0);
+       rp->theta += ((FACTOR * M_PI) / 200.0);
+       rp->phi += ((FACTOR * M_PI) / 200.0);
+       if (rp->alpha > (FACTOR * M_PI))
+               rp->alpha -= (FACTOR * M_PI);
+       if (rp->theta > (FACTOR * M_PI))
+               rp->theta -= (FACTOR * M_PI);
+       if (rp->phi > (FACTOR * M_PI))
+               rp->phi -= (FACTOR * M_PI);
+
+       if (rp->npts) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XDrawPoints(display, window, gc, rp->p, rp->npts, CoordModeOrigin);
+       } else {
+               if (rp->p)
+                       (void) free((void *) rp->p);
+               if ((rp->p = (XPoint *) malloc(rp->maxpts *
+                               sizeof (XPoint))) == NULL) {
+                       free_roll(rp);
+                       return;
+               }
+       }
+       rotation3d(rp);
+       project(rp);
+       rp->npts = 0;
+       for (i = 0; i < rp->maxpts; i++) {
+               if (rp->pts[i].v > 0.0) {
+                       rp->p[rp->npts].x += rp->sphere.x;
+                       rp->p[rp->npts].y += rp->sphere.y;
+                       rp->npts++;
+               }
+       }
+       if (MI_NPIXELS(mi) <= 2)
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       else {
+               rp->color = (rp->color + 1) % MI_NPIXELS(mi);
+               XSetForeground(display, gc, MI_PIXEL(mi, rp->color));
+       }
+       XDrawPoints(display, window, gc, rp->p, rp->npts, CoordModeOrigin);
+       if (rp->sphere.x >= rp->width - (int) rp->r && rp->direction.x > 0)
+               rp->direction.x = -rp->direction.x;
+       else if (rp->sphere.x <= (int) rp->r && rp->direction.x < 0)
+               rp->direction.x = -rp->direction.x;
+       else if (rp->sphere.x < rp->width - 2 * (int) rp->r ||
+                rp->sphere.x > 2 * (int) rp->r) {
+               if (rp->sphere.x >= rp->width - 2 * (int) rp->r && rp->direction.x > 0)
+                       rp->direction.x = -rp->direction.x;
+               else if (rp->sphere.x <= 2 * (int) rp->r && rp->direction.x < 0)
+                       rp->direction.x = -rp->direction.x;
+       }
+       if (rp->sphere.y >= rp->height - (int) rp->r && rp->direction.y > 0)
+               rp->direction.y = -rp->direction.y;
+       else if (rp->sphere.y <= (int) rp->r && rp->direction.y < 0)
+               rp->direction.y = -rp->direction.y;
+       else if (rp->sphere.y < rp->height - 2 * (int) rp->r ||
+                rp->sphere.y > 2 * (int) rp->r) {
+               if (rp->sphere.y >= rp->height - 2 * (int) rp->r && rp->direction.y > 0)
+                       rp->direction.y = -rp->direction.y;
+               else if (rp->sphere.y <= 2 * (int) rp->r && rp->direction.y < 0)
+                       rp->direction.y = -rp->direction.y;
+       }
+       rp->sphere.x += rp->direction.x;
+       rp->sphere.y += rp->direction.y;
+}
+
+void
+release_roll(ModeInfo * mi)
+{
+       if (rolls != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_roll(&rolls[screen]);
+               (void) free((void *) rolls);
+               rolls = NULL;
+       }
+}
+
+void
+refresh_roll(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_roll */
diff --git a/modes/rotor.c b/modes/rotor.c
new file mode 100644 (file)
index 0000000..40bf3db
--- /dev/null
@@ -0,0 +1,395 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* rotor --- a swirly rotor */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)rotor.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 08-Mar-1995: CAT stuff for ## was tripping up some C compilers.  Removed.
+ * 01-Dec-1993: added patch for AIXV3 from Tom McConnell
+ *              <tmcconne@sedona.intel.com>
+ * 11-Nov-1990: put into xlock by Steve Zellers <zellers@sun.com>
+ * 16-Oct-1990: Received from Tom Lawrence (tcl@cs.brown.edu: 'flight'
+ *               simulator)
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Rotor"
+#define HACK_INIT init_rotor
+#define HACK_DRAW draw_rotor
+#define rotor_opts xlockmore_opts
+#define DEFAULTS "*delay: 100 \n" \
+ "*count: 4 \n" \
+ "*cycles: 100 \n" \
+ "*size: -6 \n" \
+ "*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_rotor
+
+ModeSpecOpt rotor_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   rotor_description =
+{"rotor", "init_rotor", "draw_rotor", "release_rotor",
+ "refresh_rotor", "init_rotor", NULL, &rotor_opts,
+ 100, 4, 100, -6, 64, 0.3, "",
+ "Shows Tom's Roto-Rooter", 0, NULL};
+
+#endif
+
+/*-
+ * A 'batchcount' of 3 or 4 works best!
+ */
+
+#define MAXANGLE       3000.0  /* irrectangular  (was 10000.0) */
+
+/* How many segments to draw per cycle when redrawing */
+#define REDRAWSTEP 3
+
+typedef struct {
+       float       angle;
+       float       radius;
+       float       start_radius;
+       float       end_radius;
+       float       radius_drift_max;
+       float       radius_drift_now;
+
+       float       ratio;
+       float       start_ratio;
+       float       end_ratio;
+       float       ratio_drift_max;
+       float       ratio_drift_now;
+} elem;
+
+typedef struct {
+       int         pix;
+       int         lastx, lasty;
+       int         num, rotor, prev;
+       int         nsave;
+       float       angle;
+       int         centerx, centery;
+       int         prevcenterx, prevcentery;
+       unsigned char firsttime;
+       unsigned char iconifiedscreen;  /* for iconified view */
+       unsigned char forward;
+       unsigned char unused;
+       elem       *elements;
+       XPoint     *save;
+       int         redrawing, redrawpos;
+       int         linewidth;
+} rotorstruct;
+
+static rotorstruct *rotors = NULL;
+
+static void
+free_rotor(rotorstruct *rp)
+{
+       if (rp->elements != NULL) {
+               (void) free((void *) rp->elements);
+               rp->elements = NULL;
+       }
+       if (rp->save != NULL) {
+               (void) free((void *) rp->save);
+               rp->save = NULL;
+       }
+}
+
+void
+init_rotor(ModeInfo * mi)
+{
+       int         x;
+       elem       *pelem;
+       unsigned char wasiconified;
+       rotorstruct *rp;
+
+       if (rotors == NULL) {
+               if ((rotors = (rotorstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (rotorstruct))) == NULL)
+                       return;
+       }
+       rp = &rotors[MI_SCREEN(mi)];
+
+       rp->prevcenterx = rp->centerx;
+       rp->prevcentery = rp->centery;
+
+       rp->centerx = MI_WIDTH(mi) / 2;
+       rp->centery = MI_HEIGHT(mi) / 2;
+
+       rp->redrawing = 0;
+       /*
+        * sometimes, you go into iconified view, only to see a really whizzy pattern
+        * that you would like to look more closely at. Normally, clicking in the
+        * icon reinitializes everything - but I don't, cuz I'm that kind of guy.
+        * HENCE, the wasiconified stuff you see here.
+        */
+
+       wasiconified = rp->iconifiedscreen;
+       rp->iconifiedscreen = MI_IS_ICONIC(mi);
+
+       if (wasiconified && !rp->iconifiedscreen)
+               rp->firsttime = True;
+       else {
+
+               /* This is a fudge is needed since prevcenter may not be set when it comes
+                  from the the random mode and return is pressed (and its not the first
+                  mode that was running). This assumes that the size of the lock screen
+                  window / size of the icon window = 12 */
+               if (!rp->prevcenterx)
+                       rp->prevcenterx = rp->centerx * 12;
+               if (!rp->prevcentery)
+                       rp->prevcentery = rp->centery * 12;
+
+               rp->num = MI_COUNT(mi);
+               if (rp->num < 0) {
+                       rp->num = NRAND(-rp->num) + 1;
+                       if (rp->elements != NULL) {
+                               (void) free((void *) rp->elements);
+                               rp->elements = NULL;
+                       }
+               }
+               if (rp->elements == NULL)
+                       if ((rp->elements = (elem *) calloc(rp->num,
+                                       sizeof (elem))) == NULL) {
+                               free_rotor(rp);
+                               return;
+                       }
+               rp->nsave = MI_CYCLES(mi);
+               if (rp->nsave <= 1)
+                       rp->nsave = 2;
+               if (rp->save == NULL)
+                       if ((rp->save = (XPoint *) malloc(rp->nsave *
+                                       sizeof (XPoint))) == NULL) {
+                               free_rotor(rp);
+                               return;
+                       }
+               for (x = 0; x < rp->nsave; x++) {
+                       rp->save[x].x = rp->centerx;
+                       rp->save[x].y = rp->centery;
+               }
+
+               pelem = rp->elements;
+
+               for (x = rp->num; --x >= 0; pelem++) {
+                       pelem->radius_drift_max = 1.0;
+                       pelem->radius_drift_now = 1.0;
+
+                       pelem->end_radius = 100.0;
+
+                       pelem->ratio_drift_max = 1.0;
+                       pelem->ratio_drift_now = 1.0;
+                       pelem->end_ratio = 10.0;
+               }
+               if (MI_NPIXELS(mi) > 2)
+                       rp->pix = NRAND(MI_NPIXELS(mi));
+
+               rp->rotor = 0;
+               rp->prev = 1;
+               rp->lastx = rp->centerx;
+               rp->lasty = rp->centery;
+               rp->angle = (float) NRAND((long) MAXANGLE) / 3.0;
+               rp->forward = rp->firsttime = True;
+       }
+       rp->linewidth = MI_SIZE(mi);
+
+       if (rp->linewidth == 0)
+               rp->linewidth = 1;
+       if (rp->linewidth < 0)
+               rp->linewidth = NRAND(-rp->linewidth) + 1;
+
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_rotor(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       register elem *pelem;
+       int         thisx, thisy;
+       int         i;
+       int         x_1, y_1, x_2, y_2;
+       rotorstruct *rp;
+
+       if (rotors == NULL)
+               return;
+       rp = &rotors[MI_SCREEN(mi)];
+       if (rp->elements == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (!rp->iconifiedscreen) {
+               thisx = rp->centerx;
+               thisy = rp->centery;
+       } else {
+               thisx = rp->prevcenterx;
+               thisy = rp->prevcentery;
+       }
+       XSetLineAttributes(MI_DISPLAY(mi), MI_GC(mi), rp->linewidth,
+                          LineSolid, CapButt, JoinMiter);
+       for (i = rp->num, pelem = rp->elements; --i >= 0; pelem++) {
+               if (pelem->radius_drift_max <= pelem->radius_drift_now) {
+                       pelem->start_radius = pelem->end_radius;
+                       pelem->end_radius = (float) NRAND(40000) / 100.0 - 200.0;
+                       pelem->radius_drift_max = (float) NRAND(100000) + 10000.0;
+                       pelem->radius_drift_now = 0.0;
+               }
+               if (pelem->ratio_drift_max <= pelem->ratio_drift_now) {
+                       pelem->start_ratio = pelem->end_ratio;
+                       pelem->end_ratio = (float) NRAND(2000) / 100.0 - 10.0;
+                       pelem->ratio_drift_max = (float) NRAND(100000) + 10000.0;
+                       pelem->ratio_drift_now = 0.0;
+               }
+               pelem->ratio = pelem->start_ratio +
+                       (pelem->end_ratio - pelem->start_ratio) /
+                       pelem->ratio_drift_max * pelem->ratio_drift_now;
+               pelem->angle = rp->angle * pelem->ratio;
+               pelem->radius = pelem->start_radius +
+                       (pelem->end_radius - pelem->start_radius) /
+                       pelem->radius_drift_max * pelem->radius_drift_now;
+
+               thisx += (int) (COSF(pelem->angle) * pelem->radius);
+               thisy += (int) (SINF(pelem->angle) * pelem->radius);
+
+               pelem->ratio_drift_now += 1.0;
+               pelem->radius_drift_now += 1.0;
+       }
+       if (rp->firsttime)
+               rp->firsttime = False;
+       else {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+               x_1 = (int) rp->save[rp->rotor].x;
+               y_1 = (int) rp->save[rp->rotor].y;
+               x_2 = (int) rp->save[rp->prev].x;
+               y_2 = (int) rp->save[rp->prev].y;
+
+               if (rp->iconifiedscreen) {
+                       x_1 = x_1 * rp->centerx / rp->prevcenterx;
+                       x_2 = x_2 * rp->centerx / rp->prevcenterx;
+                       y_1 = y_1 * rp->centery / rp->prevcentery;
+                       y_2 = y_2 * rp->centery / rp->prevcentery;
+               }
+               XDrawLine(display, MI_WINDOW(mi), gc, x_1, y_1, x_2, y_2);
+
+               if (MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, gc, MI_PIXEL(mi, rp->pix));
+                       if (++rp->pix >= MI_NPIXELS(mi))
+                               rp->pix = 0;
+               } else
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+               x_1 = rp->lastx;
+               y_1 = rp->lasty;
+               x_2 = thisx;
+               y_2 = thisy;
+
+               if (rp->iconifiedscreen) {
+                       x_1 = x_1 * rp->centerx / rp->prevcenterx;
+                       x_2 = x_2 * rp->centerx / rp->prevcenterx;
+                       y_1 = y_1 * rp->centery / rp->prevcentery;
+                       y_2 = y_2 * rp->centery / rp->prevcentery;
+               }
+               XDrawLine(display, MI_WINDOW(mi), gc, x_1, y_1, x_2, y_2);
+       }
+       rp->save[rp->rotor].x = rp->lastx = thisx;
+       rp->save[rp->rotor].y = rp->lasty = thisy;
+
+       ++rp->rotor;
+       rp->rotor %= rp->nsave;
+       ++rp->prev;
+       rp->prev %= rp->nsave;
+       if (rp->forward) {
+               rp->angle += 0.01;
+               if (rp->angle >= MAXANGLE) {
+                       rp->angle = MAXANGLE;
+                       rp->forward = False;
+               }
+       } else {
+               rp->angle -= 0.1;
+               if (rp->angle <= 0) {
+                       rp->angle = 0.0;
+                       rp->forward = True;
+               }
+       }
+       if (rp->redrawing) {
+               int         j;
+
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       j = (rp->rotor - rp->redrawpos + rp->nsave) % rp->nsave;
+
+                       x_1 = (int) rp->save[j].x;
+                       y_1 = (int) rp->save[j].y;
+                       x_2 = (int) rp->save[(j - 1 + rp->nsave) % rp->nsave].x;
+                       y_2 = (int) rp->save[(j - 1 + rp->nsave) % rp->nsave].y;
+
+                       if (rp->iconifiedscreen) {
+                               x_1 = x_1 * rp->centerx / rp->prevcenterx;
+                               x_2 = x_2 * rp->centerx / rp->prevcenterx;
+                               y_1 = y_1 * rp->centery / rp->prevcentery;
+                               y_2 = y_2 * rp->centery / rp->prevcentery;
+                       }
+                       XDrawLine(display, MI_WINDOW(mi), gc, x_1, y_1, x_2, y_2);
+
+                       if (++(rp->redrawpos) >= rp->nsave) {
+                               rp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+       XSetLineAttributes(MI_DISPLAY(mi), MI_GC(mi), 1,
+                          LineSolid, CapButt, JoinMiter);
+}
+
+void
+release_rotor(ModeInfo * mi)
+{
+       if (rotors != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_rotor(&rotors[screen]);
+               (void) free((void *) rotors);
+               rotors = NULL;
+       }
+}
+
+void
+refresh_rotor(ModeInfo * mi)
+{
+       rotorstruct *rp;
+
+       if (rotors == NULL)
+               return;
+       rp = &rotors[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       rp->redrawing = 1;
+       rp->redrawpos = 1;
+}
+
+#endif /* MODE_rotor */
diff --git a/modes/run.c b/modes/run.c
new file mode 100644 (file)
index 0000000..dc8ee3e
--- /dev/null
@@ -0,0 +1,187 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* run --- run an arbitrary mode */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)run.c        5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 2000 by David Bagley
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 19-Apr-2000: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Run"
+#define HACK_INIT init_run
+#define HACK_DRAW draw_run
+#define run_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000000 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_run
+
+#ifdef VMS
+/* Have to set the Logical VAXC$PATH to point to SYS$SYSTEM */
+#define DEF_RUNPROGRAM "DECW$XCLOCK.EXE"
+#else
+#define DEF_RUNPROGRAM "xclock"
+#endif
+#define DEF_GEOMETRYSTRING "geometry"
+/* some programs do not like "-geometry" but like "-g" */
+
+static char *runprogram;
+static char *geometrystring;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-runprogram", (char *) ".run.runprogram", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-geometrystring", (char *) ".run.geometrystring", XrmoptionSepArg, (caddr_t) NULL}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & runprogram, (char *) "runprogram", (char *) "Runprogram", (char *) DEF_RUNPROGRAM, t_String},
+       {(caddr_t *) & geometrystring, (char *) "geometrystring", (char *) "GeometryString", (char *) DEF_GEOMETRYSTRING, t_String}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-runprogram string", (char *) "program to run (default xclock)"},
+       {(char *) "-geometrystring string", (char *) "geometry string, could be g for -g, none for none"}
+};
+
+ModeSpecOpt run_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   run_description =
+{"run", "init_run", "draw_run", "release_run",
+ "refresh_run", "init_run", NULL, &run_opts,
+ 3000000, 1, 1, 1, 64, 1.0, "",
+ "Shows another xprogram", 0, NULL};
+
+#endif
+
+typedef struct {
+       int numberprocess;
+       int width, height;
+} runstruct;
+
+static runstruct *runs = NULL;
+
+void
+init_run(ModeInfo * mi)
+{
+       char geom_buf[50];
+       char geoms_buf[50];
+       /* char win_buf[50]; */
+       XWindowAttributes xgwa;
+       runstruct *rp;
+
+       if (runs == NULL) {
+               if ((runs = (runstruct *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (runstruct))) == NULL)
+                       return;
+       }
+       rp = &runs[MI_SCREEN(mi)];
+
+       if (rp->numberprocess == 0 && !MI_IS_ICONIC(mi)) {
+               (void) XGetWindowAttributes(MI_DISPLAY(mi),
+                       RootWindowOfScreen(MI_SCREENPTR(mi)), &xgwa);
+#ifdef DEBUG
+               (void) printf("%dx%d\n", xgwa.width, xgwa.height);
+#endif
+               (void) sprintf(geom_buf, "%dx%d", xgwa.width, xgwa.height);
+               (void) sprintf(geoms_buf, "-%s", geometrystring);
+#ifdef VMS
+#define FORK vfork
+#else
+#define FORK fork
+#endif
+               if ((rp->numberprocess = FORK()) == -1)
+                       (void) fprintf(stderr, "Fork error\n");
+               else if (rp->numberprocess == 0) {
+                       if (strcmp(geoms_buf, "-none")) {
+#ifdef DEBUG
+                               (void) printf("running \"%s %s %s\"\n",
+                                       runprogram, geoms_buf, geom_buf);
+#endif
+                               (void) execlp(runprogram, runprogram,
+                                       geoms_buf, geom_buf, 0);
+                       } else {
+#ifdef DEBUG
+                               (void) printf("running \"%s\"\n", runprogram);
+#endif
+
+                               (void) execlp(runprogram, runprogram);
+                       }
+               }
+       }
+}
+
+/* ARGSUSED */
+void
+draw_run(ModeInfo * mi)
+{
+}
+
+#ifdef SunCplusplus
+extern int  kill(pid_t, int);
+extern pid_t  wait(int *);
+#else
+#if 0
+extern int  kill(int, int);
+extern pid_t  wait(int *);
+
+#endif
+#endif
+
+void
+release_run(ModeInfo * mi)
+{
+       if (runs != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       runstruct *rp = &runs[screen];
+
+                       if (rp->numberprocess > 0) {
+                               int n;
+#ifdef DEBUG
+                               (void) printf("killing %d\n",
+                                       rp->numberprocess);
+#endif
+                               (void) kill(rp->numberprocess, SIGKILL);
+                               (void) wait(&n);
+                       }
+               }
+               (void) free((void *) runs);
+               runs = NULL;
+        }
+}
+
+void
+refresh_run(ModeInfo * mi)
+{
+       /* Do nothing, it will refresh by itself :) */
+}
+
+#endif /* MODE_run */
diff --git a/modes/scooter.c b/modes/scooter.c
new file mode 100644 (file)
index 0000000..78fa5c6
--- /dev/null
@@ -0,0 +1,832 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* scooter -- a journey through space tunnel and stars */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)scooter.c    5.01 2001/03/02 xlockmore";
+
+#endif
+
+/*
+ *  scooter.c
+ *
+ *  Copyright (c) 2001 Sven Thoennissen <posse@gmx.net>
+ *
+ *  This program is based on the original "scooter", a blanker module from the
+ *  Nightshift screensaver which is part of EGS (Enhanced Graphics System) on
+ *  the Amiga computer. EGS has been developed by Ingenieurbüro Helfrich.
+ *
+ *
+ *  (now the obligatory stuff)
+ *
+ *  Permission to use, copy, modify, and distribute this software and its
+ *  documentation for any purpose and without fee is hereby granted,
+ *  provided that the above copyright notice appear in all copies and that
+ *  both that copyright notice and this permission notice appear in
+ *  supporting documentation.
+ *
+ *  This file is provided AS IS with no warranties of any kind.  The author
+ *  shall have no liability with respect to the infringement of copyrights,
+ *  trade secrets or any patents by this file or any part thereof.  In no
+ *  event will the author be liable for any lost revenue or profits or
+ *  other special, indirect and consequential damages.
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Scooter"
+#define HACK_INIT init_scooter
+#define HACK_DRAW draw_scooter
+#define scooter_opts xlockmore_opts
+#define DEFAULTS "*delay: 20000 \n" \
+ "*count: 24 \n" \
+ "*cycles: 5 \n" \
+ "*size: 100 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"          /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"              /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_scooter
+
+ModeSpecOpt scooter_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct scooter_description =
+{"scooter", "init_scooter", "draw_scooter", "release_scooter",
+ "refresh_scooter", "change_scooter", NULL, &scooter_opts,
+ 20000, 24, 5, 100, 64, 1.0, "",
+ "Shows a journey through space tunnel and stars", 0, NULL};
+/*
+ *  count = number of doors
+ *  cycles = speed (see MIN/MAX_SPEED below)
+ *  size = number of stars
+ *
+ */
+#endif
+
+struct Vec3D {
+       int x, y, z;
+};
+
+struct Angle3D {
+       int x, y, z;
+};
+
+struct ColorRGB {
+       int r, g, b;
+};
+
+struct Rect {
+       XPoint lefttop, rightbottom;
+};
+
+struct Door {
+       struct Vec3D coords[4]; /* lefttop, righttop, rightbottom, leftbottom */
+       int zelement;
+       unsigned long color;
+       char freecolor;
+       char pad;
+};
+
+struct Star {
+       int xpos, ypos;
+       int width, height;
+       int zelement;
+       short draw;
+};
+
+/* define this to see a pixel for each zelement */
+/*
+#define _DRAW_ZELEMENTS
+*/
+
+struct ZElement {
+       struct Vec3D pos;
+       struct Angle3D angle;
+};
+
+static struct Star *stars = NULL;
+static struct Door *doors = NULL;
+static struct ZElement *zelements = NULL;
+static int doorcount, ztotal, speed, zelements_per_door, zelement_distance, spectator_zelement,
+       projnorm_z, rotationDuration, rotationStep, starcount;
+
+static struct Angle3D currentRotation, rotationDelta;
+
+/* doors color cycling stuff */
+static struct ColorRGB begincolor, endcolor;
+static int colorcount, colorsteps;
+
+/* scale all stars and doors to window dimensions */
+static float aspect_scale;
+
+static char halt_scooter;
+
+
+#define MIN_DOORS 4
+
+#define MIN_SPEED 1
+#define MAX_SPEED 10
+
+#define SPACE_XY_FACTOR 10
+
+#define DOOR_WIDTH  (600*SPACE_XY_FACTOR)
+#define DOOR_HEIGHT (400*SPACE_XY_FACTOR)
+
+/* stars distance from doors center */
+#define STAR_MIN_X  (1000*SPACE_XY_FACTOR)
+#define STAR_MIN_Y  (750*SPACE_XY_FACTOR)
+#define STAR_MAX_X  (10000*SPACE_XY_FACTOR)
+#define STAR_MAX_Y  (7500*SPACE_XY_FACTOR)
+
+/* star size (random) */
+#define STAR_SIZE_MIN (2*SPACE_XY_FACTOR)
+#define STAR_SIZE_MAX (64*SPACE_XY_FACTOR)
+
+/* greater values make scooter run harder curves, smaller values produce calm curves */
+#define DOOR_CURVEDNESS 14
+
+/* 3d->2d projection (greater values create more fish-eye effect) */
+#define PROJECTION_DEGREE 2.4
+
+/*  this is my resolution at which scooter is in its original size, producing a 4:3 aspect ratio.
+ *  all variables in this module are adjusted for this screen size; if scooter is run
+ *  in windows with different size, it knows how to rescale itself.
+ */
+#define ASPECT_SCREENWIDTH 1152
+#define ASPECT_SCREENHEIGHT 864
+
+/* we define our own sin/cos macros to be faaast ;-) (good old Amiga times) */
+#define SINUSTABLE_SIZE 0x8000
+#define SINUSTABLE_MASK 0x7fff
+#define SIN(a) sintable[a & SINUSTABLE_MASK]
+#define COS(a) sintable[(a+(SINUSTABLE_SIZE/4)) & SINUSTABLE_MASK]
+
+/* signum function */
+#define SGN(a) (a < 0 ? -1 : 1)
+
+static float *sintable = NULL;
+
+
+static void initdoorcolors();
+static void nextdoorcolor( struct ModeInfo_s *mi, struct Door *door );
+
+
+void init_scooter( struct ModeInfo_s *mi )
+{
+int i;
+
+       release_scooter(mi);
+
+       doorcount = MAX(MI_COUNT(mi),MIN_DOORS);
+       speed = MI_CYCLES(mi);
+       starcount = MI_SIZE(mi);
+
+       if( speed < MIN_SPEED ) speed = MIN_SPEED;
+       if( speed > MAX_SPEED ) speed = MAX_SPEED;
+       zelements_per_door = 60;
+       zelement_distance = 300;
+       ztotal = doorcount * zelements_per_door;
+       /* z_maxdepth = ztotal * zelement_distance; */
+       if( starcount > ztotal ) starcount = ztotal;
+
+       halt_scooter = 0;
+
+       initdoorcolors();
+
+       if( (doors = (struct Door *) malloc(sizeof(struct Door) * doorcount)) ) {
+
+               if( (zelements = (struct ZElement *) malloc(sizeof(struct ZElement) * ztotal)) ) {
+
+                       for( i=0; i<doorcount; i++ ) {
+                               doors[i].zelement = (zelements_per_door * (i + 1)) - 1;
+                               doors[i].freecolor = 0;
+                               nextdoorcolor(mi,&doors[i]);
+                       }
+
+                       for( i=0; i<ztotal; i++ ) {
+                               zelements[i].angle.x = 0;
+                               zelements[i].angle.y = 0;
+                               zelements[i].angle.z = 0;
+                       }
+               }
+       }
+
+       if( (sintable = (float *) malloc(sizeof(float) * SINUSTABLE_SIZE)) ) {
+               for( i=0; i<SINUSTABLE_SIZE; i++ )
+                       sintable[i] = SINF(M_PI*2/SINUSTABLE_SIZE*i);
+       }
+
+       if( (stars = (struct Star *) malloc(sizeof(struct Star) * starcount)) ) {
+               for( i=0; i<starcount; i++ ) {
+                       stars[i].zelement = ztotal * i / starcount;
+                       stars[i].draw = 0;
+               }
+       }
+
+       projnorm_z = 50 * 240;
+       spectator_zelement = zelements_per_door;
+
+       currentRotation.x = 0;
+       currentRotation.y = 0;
+       currentRotation.z = 0;
+
+       rotationDelta.x = 0;
+       rotationDelta.y = 0;
+       rotationDelta.z = 0;
+
+       rotationDuration = 1;
+       rotationStep = 0;
+}
+
+static void cleardoors( struct ModeInfo_s *mi )
+{
+       MI_CLEARWINDOW(mi);
+}
+
+static inline float projection( int zval )
+{
+       return (projnorm_z / (PROJECTION_DEGREE * zval));
+/* this is another formula. it is not limited to z>0 but it pulls too strong towards the screen center */
+/*      return (projnorm_z * pow(1.22,-(zval/200*PROJ_CURVEDNESS)))*/
+}
+
+/*
+
+ y
+
+ ^
+ |      z
+ |    .
+ |   /
+ |  /
+ | /
+ |/
+-+------------> x
+/|
+
+  rotation angles:
+         a = alpha (x-rotation), b = beta (y-rotation), c = gamma (z-rotation)
+
+  x-axis rotation:
+       (  z  )'  =  ( cos(a) -sin(a) ) (  z  )
+       (  y  )      ( sin(a)  cos(a) ) (  y  )
+
+  y-axis rotation:
+       (  z  )'  =  ( cos(b) -sin(b) ) (  z  )
+       (  x  )      ( sin(b)  cos(b) ) (  x  )
+
+  z-axis rotation:
+       (  x  )'  =  ( cos(c) -sin(c) ) (  x  )
+       (  y  )      ( sin(c)  cos(c) ) (  y  )
+*/
+
+static void rotate_3d( struct Vec3D *src, struct Vec3D *dest, struct Angle3D *angle )
+{
+struct Vec3D tmp;
+float  cosa = COS(angle->x),
+       cosb = COS(angle->y),
+       cosc = COS(angle->z),
+       sina = SIN(angle->x),
+       sinb = SIN(angle->y),
+       sinc = SIN(angle->z);
+
+       /* rotate around X, Y and Z axis (see formulae above) */
+
+       /* X axis */
+       tmp.z = src->z;
+       tmp.y = src->y;
+       dest->z = (int) (tmp.z * cosa - tmp.y * sina);
+       dest->y = (int) (tmp.z * sina + tmp.y * cosa);
+
+       /* Y axis */
+       tmp.z = dest->z;
+       tmp.x = src->x;
+       dest->z = (int) (tmp.z * cosb - tmp.x * sinb);
+       dest->x = (int) (tmp.z * sinb + tmp.x * cosb);
+
+       /* Z axis */
+       tmp.x = dest->x;
+       tmp.y = dest->y;
+       dest->x = (int) (tmp.x * cosc - tmp.y * sinc);
+       dest->y = (int) (tmp.x * sinc + tmp.y * cosc);
+}
+
+static void randomcolor( struct ColorRGB *col )
+{
+unsigned long n;
+
+/*     col->r = NRAND(65536);
+       col->g = NRAND(65536);
+       col->b = NRAND(65536);
+*/
+/*     col->r = LRAND() & 0xffff;
+       col->g = LRAND() & 0xffff;
+       col->b = LRAND() & 0xffff;
+*/
+       /* this seems best */
+       n = NRAND(0x1000000);
+       col->r = (n>>16)<<8;
+       col->g = ((n>>8) & 0xff)<<8;
+       col->b = (n & 0xff)<<8;
+}
+
+static void initdoorcolors()
+{
+       /* prepare initial values for nextdoorcolor() */
+
+       randomcolor(&endcolor);
+
+       colorcount = 0;
+       colorsteps = 0;
+}
+
+static void nextdoorcolor( struct ModeInfo_s *mi, struct Door *door )
+{
+Display *display = MI_DISPLAY(mi);
+XColor xcol;
+
+/* uncomment this to color the doors from xlock's palette (created with saturation value) */
+#if 0
+       if (MI_NPIXELS(mi) > 2) {
+               if( ++colorcount >= MI_NPIXELS(mi) )
+                       colorcount = 0;
+               door->color = MI_PIXEL(mi,colorcount);
+       } else
+               door->color = MI_WHITE_PIXEL(mi);
+       return;
+#endif
+       if( door->freecolor ) {
+               XFreeColors(display, MI_COLORMAP(mi), &(door->color), 1, 0);
+               door->freecolor = 0;
+       }
+       if (MI_NPIXELS(mi) <= 2) {
+               door->color = MI_WHITE_PIXEL(mi);
+               return;
+       }
+
+       if( colorcount >= colorsteps ) {
+
+               /* init next color ramp */
+
+               colorcount = 0;
+               colorsteps = 8 + NRAND(32);
+               begincolor = endcolor;
+               randomcolor(&endcolor);
+       }
+
+       /* compute next color values */
+
+       xcol.red   = begincolor.r + ((endcolor.r - begincolor.r) * colorcount / colorsteps);
+       xcol.green = begincolor.g + ((endcolor.g - begincolor.g) * colorcount / colorsteps);
+       xcol.blue  = begincolor.b + ((endcolor.b - begincolor.b) * colorcount / colorsteps);
+       xcol.pixel = 0;
+       xcol.flags = DoRed | DoGreen | DoBlue;
+
+       colorcount++;
+
+       if( !XAllocColor(display, MI_COLORMAP(mi), &xcol) ) {
+                /* fail safe */
+               door->color = MI_WHITE_PIXEL(mi);
+               door->freecolor = 0;
+       } else {
+               door->color = xcol.pixel;
+               door->freecolor = 1;
+       }
+}
+
+static void calc_new_element( struct ModeInfo_s *mi )
+{
+float rot = SIN((SINUSTABLE_SIZE/2)*rotationStep/rotationDuration);
+
+       /* change current rotation 3D angle */
+
+       if( rotationStep++ >= rotationDuration ) {
+
+               int fps = 1000000/MI_DELAY(mi); /* frames per second as timebase */
+
+               /*  one rotation interval takes 10-30 seconds at speed 1.
+                */
+               rotationDuration = 10*fps + NRAND(20*fps);
+
+               /* -DOOR_CURVEDNESS <= delta <= +DOOR_CURVEDNESS */
+               rotationDelta.x = NRAND(DOOR_CURVEDNESS*2+1) - DOOR_CURVEDNESS;
+               rotationDelta.y = NRAND(DOOR_CURVEDNESS*2+1) - DOOR_CURVEDNESS;
+               rotationDelta.z = NRAND(DOOR_CURVEDNESS*2+1) - DOOR_CURVEDNESS;
+
+               rotationStep = 0;
+       }
+
+       currentRotation.x += (int) (rot * rotationDelta.x);
+       currentRotation.y += (int) (rot * rotationDelta.y);
+       currentRotation.z += (int) (rot * rotationDelta.z);
+
+       currentRotation.x &= SINUSTABLE_MASK;
+       currentRotation.y &= SINUSTABLE_MASK;
+       currentRotation.z &= SINUSTABLE_MASK;
+}
+
+static void shift_elements( struct ModeInfo_s *mi )
+{
+int i, iprev;
+struct Vec3D tmpvec;
+struct Angle3D tmpangle;
+
+       /* shift angles from zelements */
+
+       for( i=speed; i<ztotal; i++ ) {
+               zelements[i-speed].angle = zelements[i].angle;
+       }
+       for( i=ztotal-speed; i<ztotal; i++ ) {
+               calc_new_element(mi);
+               zelements[i].angle = currentRotation;
+       }
+
+       /* calculate new 3D-coords from ALL zelements */
+
+       zelements[spectator_zelement].pos.x = 0;
+       zelements[spectator_zelement].pos.y = 0;
+       zelements[spectator_zelement].pos.z = zelement_distance * spectator_zelement;
+
+       for( i=spectator_zelement-1; i>=0; --i ) {
+               iprev = i + 1;
+
+               tmpvec.x = 0;
+               tmpvec.y = 0;
+               tmpvec.z = - zelement_distance;
+               tmpangle.x = zelements[i].angle.x - zelements[spectator_zelement].angle.x;
+               tmpangle.y = zelements[i].angle.y - zelements[spectator_zelement].angle.y;
+               tmpangle.z = zelements[i].angle.z - zelements[spectator_zelement].angle.z;
+               rotate_3d( &tmpvec, &(zelements[i].pos), &tmpangle );
+               zelements[i].pos.x += zelements[iprev].pos.x;
+               zelements[i].pos.y += zelements[iprev].pos.y;
+               zelements[i].pos.z += zelements[iprev].pos.z;
+       }
+
+       for( i=spectator_zelement+1; i<ztotal; i++ ) {
+               iprev = i - 1;
+
+               tmpvec.x = 0;
+               tmpvec.y = 0;
+               tmpvec.z = zelement_distance;
+               tmpangle.x = zelements[i].angle.x - zelements[spectator_zelement].angle.x;
+               tmpangle.y = zelements[i].angle.y - zelements[spectator_zelement].angle.y;
+               tmpangle.z = zelements[i].angle.z - zelements[spectator_zelement].angle.z;
+               rotate_3d( &tmpvec, &(zelements[i].pos), &tmpangle );
+               zelements[i].pos.x += zelements[iprev].pos.x;
+               zelements[i].pos.y += zelements[iprev].pos.y;
+               zelements[i].pos.z += zelements[iprev].pos.z;
+       }
+
+
+       /* shift doors and wrap around */
+
+       for( i=0; i<doorcount; i++ ) {
+               if( (doors[i].zelement -= speed) < 0 ) {
+                       doors[i].zelement += ztotal;
+                       nextdoorcolor(mi,&doors[i]);
+               }
+       }
+
+       /* shift stars */
+
+       for( i=0; i<starcount; i++ ) {
+               if( (stars[i].zelement -= speed) < 0 ) {
+                       int rnd;
+
+                       stars[i].zelement += ztotal;
+                       stars[i].draw = 1;
+
+                       /* make sure new stars are outside doors */
+
+                       rnd = NRAND(2*(STAR_MAX_X - STAR_MIN_X)) - (STAR_MAX_X - STAR_MIN_X);
+                       stars[i].xpos = rnd + (STAR_MIN_X * SGN(rnd));
+
+                       rnd = NRAND(2*(STAR_MAX_Y - STAR_MIN_Y)) - (STAR_MAX_Y - STAR_MIN_Y);
+                       stars[i].ypos = rnd + (STAR_MIN_Y * SGN(rnd));
+
+                       rnd = NRAND(STAR_SIZE_MAX - STAR_SIZE_MIN) + STAR_SIZE_MIN;
+                       stars[i].width  = rnd;
+                       stars[i].height = rnd * 3 / 4;
+               }
+       }
+}
+
+static void door_3d( struct Door *door )
+{
+struct ZElement *ze = &zelements[door->zelement];
+struct Vec3D src;
+struct Angle3D tmpangle;
+
+       tmpangle.x = ze->angle.x - zelements[spectator_zelement].angle.x;
+       tmpangle.y = ze->angle.y - zelements[spectator_zelement].angle.y;
+       tmpangle.z = ze->angle.z - zelements[spectator_zelement].angle.z;
+
+       /* calculate 3d coords of all 4 edges */
+
+       src.x = -DOOR_WIDTH/2;
+       src.y = DOOR_HEIGHT/2;
+       src.z = 0;
+       rotate_3d( &src, &(door->coords[0]), &tmpangle );
+       door->coords[0].x += ze->pos.x;
+       door->coords[0].y += ze->pos.y;
+       door->coords[0].z += ze->pos.z;
+
+       src.x = DOOR_WIDTH/2;
+       rotate_3d( &src, &(door->coords[1]), &tmpangle );
+       door->coords[1].x += ze->pos.x;
+       door->coords[1].y += ze->pos.y;
+       door->coords[1].z += ze->pos.z;
+
+       src.y = -DOOR_HEIGHT/2;
+       rotate_3d( &src, &(door->coords[2]), &tmpangle );
+       door->coords[2].x += ze->pos.x;
+       door->coords[2].y += ze->pos.y;
+       door->coords[2].z += ze->pos.z;
+
+       src.x = -DOOR_WIDTH/2;
+       rotate_3d( &src, &(door->coords[3]), &tmpangle );
+       door->coords[3].x += ze->pos.x;
+       door->coords[3].y += ze->pos.y;
+       door->coords[3].z += ze->pos.z;
+}
+
+/*
+ *  clip the line p1-p2 at the given rectangle
+ *
+ */
+static int clipline( XPoint *p1, XPoint *p2, struct Rect *rect )
+{
+XPoint new1, new2, tmp;
+float m;
+
+       new1 = *p1;
+       new2 = *p2;
+
+       /* entire line may not need clipping */
+
+       if( ((new1.x >= rect->lefttop.x) && (new1.x <= rect->rightbottom.x))
+        || ((new1.y >= rect->lefttop.y) && (new1.y <= rect->rightbottom.y))
+        || ((new2.x >= rect->lefttop.x) && (new2.x <= rect->rightbottom.x))
+        || ((new2.y >= rect->lefttop.y) && (new2.y <= rect->rightbottom.y))
+        ) return 1;
+
+
+       /* first: clip y dimension */
+
+       /* p1 is above p2 */
+       if( new1.y > new2.y ) {
+               tmp = new1;
+               new1 = new2;
+               new2 = tmp;
+       }
+
+       /* line could be totally out of view */
+       if( (new2.y < rect->lefttop.y) || (new1.y > rect->rightbottom.y) ) return 0;
+
+       m = ( new2.x == new1.x ) ? 0 : ((float)(new2.y - new1.y) / (new2.x - new1.x));
+
+       if( new1.y < rect->lefttop.y ) {
+               if( m ) new1.x += (int) ((rect->lefttop.y - new1.y)/m);
+               new1.y = rect->lefttop.y;
+       }
+       if( new2.y > rect->rightbottom.y ) {
+               if( m ) new2.x -= (int) ((new2.y - rect->rightbottom.y)/m);
+               new2.y = rect->rightbottom.y;
+       }
+
+
+       /* clip x dimension */
+
+       /* p1 is left to p2 */
+       if( new1.x > new2.x ) {
+               tmp = new1;
+               new1 = new2;
+               new2 = tmp;
+       }
+
+       if( (new2.x < rect->lefttop.x) || (new1.x > rect->rightbottom.x) ) return 0;
+
+       m = ( new2.x == new1.x ) ? 0 : ((float)(new2.y - new1.y) / (new2.x - new1.x));
+
+       if( new1.x < rect->lefttop.x ) {
+               new1.y += (int) ((rect->lefttop.y - new1.y)*m);
+               new1.x = rect->lefttop.x;
+       }
+       if( new2.y > rect->rightbottom.y ) {
+               new2.y -= (int) ((new2.y - rect->rightbottom.y)*m);
+               new2.x = rect->rightbottom.x;
+       }
+
+
+       /* push values */
+
+       *p1 = new1;
+       *p2 = new2;
+
+       return 1;
+}
+
+static void drawdoors( struct ModeInfo_s *mi )
+{
+Display *display = MI_DISPLAY(mi);
+Window window = MI_WINDOW(mi);
+GC gc = MI_GC(mi);
+int width = MI_WIDTH(mi), height = MI_HEIGHT(mi),
+    midx = width/2, midy = height/2;
+int i, j;
+struct Rect rect = { {0,0}, {0,0} };
+
+        rect.rightbottom.x = width - 1;
+        rect.rightbottom.y = height - 1;
+       XSetLineAttributes( display, gc, 2, LineSolid, CapNotLast, JoinRound );
+
+#ifdef _DRAW_ZELEMENTS
+        XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+        for( i=spectator_zelement; i<ztotal; i++ ) {
+                register float proj;
+                XPoint p;
+
+                proj = projection(zelements[i].pos.z) * aspect_scale;
+                p.x = midx + (zelements[i].pos.x * proj / SPACE_XY_FACTOR);
+                p.y = midy - (zelements[i].pos.y * proj / SPACE_XY_FACTOR);
+                XDrawPoint( display, window, gc, p.x, p.y );
+        }
+#endif
+
+       for( i=0; i<doorcount; i++ ) {
+
+               register float proj;
+               XPoint lines[4], clip1, clip2;
+
+               door_3d(&doors[i]);
+
+               for( j=0; j<4; j++ ) {
+                       if( doors[i].coords[j].z <= 0 ) break;
+
+                       proj = projection(doors[i].coords[j].z) * aspect_scale;
+                       lines[j].x = midx + (int) (doors[i].coords[j].x *
+                               proj / SPACE_XY_FACTOR);
+                       lines[j].y = midy - (int) (doors[i].coords[j].y *
+                               proj / SPACE_XY_FACTOR);
+               }
+               if( j<4 ) continue;
+
+               XSetForeground(display, gc, doors[i].color);
+
+               for( j=0; j<4; j++ ) {
+                       clip1 = lines[j];
+                       clip2 = lines[(j+1)%4];
+                       if( clipline(&clip1, &clip2, &rect) )
+                               XDrawLine( display, window, gc, clip1.x, clip1.y, clip2.x, clip2.y );
+               }
+       }
+}
+
+static void drawstars( struct ModeInfo_s *mi )
+{
+Display *display = MI_DISPLAY(mi);
+Window window = MI_WINDOW(mi);
+GC gc = MI_GC(mi);
+int width = MI_WIDTH(mi), height = MI_HEIGHT(mi),
+    midx = width/2, midy = height/2;
+int i;
+
+       for( i=0; i<starcount; i++ ) {
+
+               float proj;
+               struct ZElement *ze = &zelements[stars[i].zelement];
+               struct Vec3D tmpvec, coords;
+               struct Angle3D tmpangle;
+               XPoint lefttop, rightbottom;
+
+               if( !stars[i].draw ) continue;
+
+
+               /* rotate star around its z-element, then add its position */
+
+               tmpangle.x = ze->angle.x - zelements[spectator_zelement].angle.x;
+               tmpangle.y = ze->angle.y - zelements[spectator_zelement].angle.y;
+               tmpangle.z = ze->angle.z - zelements[spectator_zelement].angle.z;
+
+               tmpvec.x = stars[i].xpos;
+               tmpvec.y = stars[i].ypos;
+               tmpvec.z = 0;
+               rotate_3d( &tmpvec, &coords, &tmpangle );
+               coords.x += ze->pos.x;
+               coords.y += ze->pos.y;
+               coords.z += ze->pos.z;
+
+               if( coords.z <= 0 ) continue;
+
+
+               /* projection and clipping (trivial for a rectangle) */
+
+               proj = projection(coords.z) * aspect_scale;
+
+               lefttop.x = midx + (int) ((coords.x - stars[i].width/2)  * proj / SPACE_XY_FACTOR);
+               lefttop.y = midy - (int) ((coords.y + stars[i].height/2) * proj / SPACE_XY_FACTOR);
+               if( lefttop.x < 0 ) lefttop.x = 0;
+               else if( lefttop.x >= width ) continue;
+               if( lefttop.y < 0 ) lefttop.y = 0;
+               else if( lefttop.y >= height ) continue;
+
+               rightbottom.x = midx + (int) ((coords.x + stars[i].width/2)  * proj / SPACE_XY_FACTOR);
+               rightbottom.y = midy - (int) ((coords.y - stars[i].height/2) * proj / SPACE_XY_FACTOR);
+               if( rightbottom.x < 0 ) continue;
+               else if( rightbottom.x >= width ) rightbottom.x = width - 1;
+               if( rightbottom.y < 0 ) continue;
+               else if( rightbottom.y >= height ) rightbottom.y = height - 1;
+
+
+               /* in white color, small stars look darker than big stars */
+
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi) );
+
+               if( (lefttop.x == rightbottom.x) && (lefttop.y == rightbottom.y) ) {
+                       /* star is exactly 1 pixel */
+                       XDrawPoint( display, window, gc, lefttop.x, lefttop.y );
+               } else if( (rightbottom.x - lefttop.x) + (rightbottom.y - lefttop.y) == 1 ) {
+                       /* star is 2 pixels wide or high */
+                       XDrawPoint( display, window, gc, lefttop.x,     lefttop.y );
+                       XDrawPoint( display, window, gc, rightbottom.x, rightbottom.y );
+               } else if( (rightbottom.x - lefttop.x == 1) && (rightbottom.y - lefttop.y == 1) ) {
+
+                       /*  star is exactly 2x2 pixels.
+                        *  a 2x2 rectangle should be drawn faster by plotting all 4 pixels
+                        *  than by filling a rectangle (is this really so under X ?)
+                        */
+
+                       XDrawPoint( display, window, gc, lefttop.x,     lefttop.y );
+                       XDrawPoint( display, window, gc, rightbottom.x, lefttop.y );
+                       XDrawPoint( display, window, gc, lefttop.x,     rightbottom.y );
+                       XDrawPoint( display, window, gc, rightbottom.x, rightbottom.y );
+               } else {
+                       XFillRectangle(display, window, gc, lefttop.x, lefttop.y,
+                               rightbottom.x - lefttop.x, rightbottom.y - lefttop.y );
+               }
+       }
+}
+
+void draw_scooter( struct ModeInfo_s *mi )
+{
+       if( !doors || !zelements || !sintable || !stars || halt_scooter ) return;
+
+       cleardoors(mi);
+
+       shift_elements(mi);
+
+       /* With these scale factors, all doors are sized correctly for any window dimension.
+        * If aspect ratio is not 4:3, the smaller part of the window is used, e.g.:
+        *      window = 1000x600
+        *      => door scale factor is like in a 800x600 window (not 1000x750)
+        */
+
+       if( (float)MI_WIDTH(mi)/MI_HEIGHT(mi) >= (float)ASPECT_SCREENWIDTH/ASPECT_SCREENHEIGHT ) {
+               /* window is wider than or equal 4:3 */
+               aspect_scale = (float)MI_HEIGHT(mi) / ASPECT_SCREENHEIGHT;
+       } else {
+               /* window is higher than 4:3 */
+               aspect_scale = (float)MI_WIDTH(mi) / ASPECT_SCREENWIDTH;
+       }
+
+       drawstars(mi);
+
+       drawdoors(mi);
+}
+
+void release_scooter( struct ModeInfo_s *mi )
+{
+       if( doors ) {
+               free(doors);
+               doors = NULL;
+       }
+       if( stars ) {
+               free(stars);
+               stars = NULL;
+       }
+       if( zelements ) {
+               free(zelements);
+               zelements = NULL;
+       }
+       if( sintable ) {
+               free(sintable);
+               sintable = NULL;
+       }
+}
+
+void refresh_scooter( struct ModeInfo_s *mi )
+{
+       MI_CLEARWINDOW(mi);
+}
+
+void change_scooter( struct ModeInfo_s *mi )
+{
+       halt_scooter = 1 - halt_scooter;
+}
+
+#endif /* MODE_scooter */
diff --git a/modes/shape.c b/modes/shape.c
new file mode 100644 (file)
index 0000000..f787656
--- /dev/null
@@ -0,0 +1,428 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* shape --- basic in your face shapes */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)shape.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 12-Mar-1998: Got the idea for shadow from looking at xscreensaver web page.
+ * 10-May-1997: Compatible with xscreensaver
+ * 03-Nov-1995: formerly rect.c
+ * 11-Aug-1995: slight change to initialization of pixmaps
+ * 27-Jun-1995: added ellipses
+ * 27-Feb-1995: patch for VMS
+ * 29-Sep-1994: multidisplay bug fix <epstein_caleb@jpmorgan.com>
+ * 15-Jul-1994: xlock version David Bagley <bagleyd@tux.org>
+ * 1992: xscreensaver version Jamie Zawinski <jwz@jwz.org>
+ */
+
+/*-
+ * original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Shape"
+#define HACK_INIT init_shape
+#define HACK_DRAW draw_shape
+#define shape_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 100 \n" \
+ "*cycles: 256 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_shape
+
+#ifndef STIPPLING
+/*-
+ * For Linux (others, Intel based?) this could be deadly for the client.
+ *   If you have 15/16 bit displays it may want a hard reboot after
+ *   1 minute.  Not true on all systems... may be a XFree86 based problem.
+ *   Also what is it with those corruption lines in some of the shapes?
+ * 3 degrees for STIPPLING ...
+ *     0: absolutely not
+ *     1: if user insists (default for Linux)
+ *     2: permit (also no warning message) (default for other OS's)
+ */
+#ifdef __linux__
+#if 0
+#define STIPPLING 0
+#else
+#define STIPPLING 1
+#endif
+#else
+#define STIPPLING 2
+#endif
+#endif
+
+/*-
+ * "shade" is used over "shadow" because of possible confusion with
+ * password shadowing
+ */
+
+#define DEF_SHADE  "True"
+#define DEF_BORDER  "False"
+#if (STIPPLING > 1)
+#define DEF_STIPPLE  "True"
+#else
+#define DEF_STIPPLE  "False"
+#endif
+
+static Bool shade;
+static Bool border;
+static Bool stipple;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-shade", (char *) ".shape.shade", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+shade", (char *) ".shape.shade", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-border", (char *) ".shape.border", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+border", (char *) ".shape.border", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-stipple", (char *) ".shape.stipple", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+stipple", (char *) ".shape.stipple", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+       {(caddr_t *) & shade, (char *) "shade", (char *) "Shade", (char *) DEF_SHADE, t_Bool},
+       {(caddr_t *) & border, (char *) "border", (char *) "Border", (char *) DEF_BORDER, t_Bool},
+       {(caddr_t *) & stipple, (char *) "stipple", (char *) "Stipple", (char *) DEF_STIPPLE, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+shade", (char *) "turn on/off shape's shadows"},
+       {(char *) "-/+border", (char *) "turn on/off shape's borders"},
+       {(char *) "-/+stipple", (char *) "turn on/off shape's stippling"}
+};
+
+ModeSpecOpt shape_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   shape_description =
+{"shape", "init_shape", "draw_shape", "release_shape",
+ "refresh_shape", "init_shape", NULL, &shape_opts,
+ 10000, 100, 256, 1, 64, 1.0, "",
+ "Shows overlaying rectangles, ellipses, and triangles", 0, NULL};
+
+#endif
+
+#define MAX_SHADE_OFFSET 32
+#define MIN_SHADE_OFFSET 2
+
+#define NBITS 12
+
+#include "bitmaps/gray1.xbm"
+#include "bitmaps/gray3.xbm"
+#include "bitmaps/stipple.xbm"
+#include "bitmaps/cross_weave.xbm"
+#include "bitmaps/dimple1.xbm"
+#include "bitmaps/dimple3.xbm"
+#include "bitmaps/flipped_gray.xbm"
+#include "bitmaps/hlines2.xbm"
+#include "bitmaps/light_gray.xbm"
+#include "bitmaps/root_weave.xbm"
+#include "bitmaps/vlines2.xbm"
+#include "bitmaps/vlines3.xbm"
+#define SHAPEBITS(n,w,h)\
+  if ((sp->pixmaps[sp->init_bits]=\
+  XCreateBitmapFromData(display,window,(char *)n,w,h))==None){\
+  free_shape(display,sp); return;} else {sp->init_bits++;}
+
+typedef struct {
+       int         width;
+       int         height;
+       int         borderx;
+       int         bordery;
+       int         time;
+       int         x, y, w, h;
+       Bool        shade;
+       Bool        border;
+       Bool        stipple;
+       XPoint      shade_offset;
+       int         init_bits;
+       Pixmap      pixmaps[NBITS];
+} shapestruct;
+
+static shapestruct *shapes = NULL;
+
+static void
+free_shape(Display *display, shapestruct *sp)
+{
+       int         bits;
+
+       for (bits = 0; bits < sp->init_bits; bits++)
+               XFreePixmap(display, sp->pixmaps[bits]);
+       sp->init_bits = 0;
+}
+
+void
+init_shape(ModeInfo * mi)
+{
+       shapestruct *sp;
+
+       if (shapes == NULL) {
+               if ((shapes = (shapestruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (shapestruct))) == NULL)
+                       return;
+       }
+       sp = &shapes[MI_SCREEN(mi)];
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+       sp->borderx = sp->width / 20;
+       sp->bordery = sp->height / 20;
+       sp->time = 0;
+
+       if (MI_IS_FULLRANDOM(mi))
+               sp->shade = (Bool) (LRAND() & 1);
+       else
+               sp->shade = shade;
+
+       if (shade) {
+               sp->shade_offset.x = (NRAND(MAX_SHADE_OFFSET - MIN_SHADE_OFFSET) +
+                               MIN_SHADE_OFFSET) * ((LRAND() & 1) ? 1 : -1);
+               sp->shade_offset.y = (NRAND(MAX_SHADE_OFFSET - MIN_SHADE_OFFSET) +
+                               MIN_SHADE_OFFSET) * ((LRAND() & 1) ? 1 : -1);
+       }
+       if (MI_IS_FULLRANDOM(mi))
+               sp->border = (Bool) (LRAND() & 1);
+       else
+               sp->border = border;
+
+#if (STIPPLING > 1)
+       if (MI_IS_FULLRANDOM(mi))
+               sp->stipple = (Bool) (LRAND() & 1);
+       else
+               sp->stipple = stipple;
+#else
+#if (STIPPLING < 1)
+       sp->stipple = False;
+#else
+       sp->stipple = stipple;  /* OK if you insist... could be dangerous */
+#endif
+#endif
+       if (sp->stipple && !sp->init_bits) {
+               Display    *display = MI_DISPLAY(mi);
+               Window      window = MI_WINDOW(mi);
+
+#if defined( __linux__ ) && ( STIPPLING < 2 )
+               if ((MI_IS_VERBOSE(mi) || MI_IS_DEBUG(mi)) &&
+                   (MI_DEPTH(mi) == 15 || MI_DEPTH(mi) == 16))
+                       (void) fprintf(stderr, "This may cause a LOCKUP in seconds!!!\n");
+#endif
+               SHAPEBITS(gray1_bits, gray1_width, gray1_height);
+               SHAPEBITS(gray3_bits, gray3_width, gray3_height);
+               SHAPEBITS(cross_weave_bits, cross_weave_width, cross_weave_height);
+               SHAPEBITS(dimple1_bits, dimple1_width, dimple1_height);
+               SHAPEBITS(dimple3_bits, dimple3_width, dimple3_height);
+               SHAPEBITS(flipped_gray_bits, flipped_gray_width, flipped_gray_height);
+               SHAPEBITS(vlines3_bits, vlines3_width, vlines3_height);
+               SHAPEBITS(stipple_bits, stipple_width, stipple_height);
+               SHAPEBITS(hlines2_bits, hlines2_width, hlines2_height);
+               SHAPEBITS(light_gray_bits, light_gray_width, light_gray_height);
+               SHAPEBITS(root_weave_bits, root_weave_width, root_weave_height);
+               SHAPEBITS(vlines2_bits, vlines2_width, vlines2_height);
+       }
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_shape(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         shape, i;
+       XPoint      shade_offset;
+       shapestruct *sp;
+
+       if (shapes == NULL)
+               return;
+       sp = &shapes[MI_SCREEN(mi)];
+       if (sp->stipple && !sp->init_bits)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       shade_offset.x = 0;
+       shade_offset.y = 0;
+
+       if (sp->stipple) {
+               XSetBackground(display, gc, (MI_NPIXELS(mi) > 2) ?
+                  MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))) : MI_BLACK_PIXEL(mi));
+       }
+       if (sp->border) {
+               XSetLineAttributes(display, gc, 2, LineSolid, CapNotLast, JoinRound);
+       }
+       shape = NRAND(3);
+       if (sp->shade) {
+               i = MAX(ABS(sp->shade_offset.x), ABS(sp->shade_offset.y));
+               shade_offset.x = (short) (((float) NRAND(i) + 2.0) /
+                    ((float) (1.0 + i) * sp->shade_offset.x));
+               /* cc: error 1405: "/opt/ansic/lbin/ccom"
+                  terminated abnormally with signal 11.
+                  *** Error exit code 9 */
+               /* Next line trips up HP cc -g -O, remove a flag */
+               shade_offset.y = (short) (((float) NRAND(i) + 2.0) /
+                    ((float) (1.0 + i) * sp->shade_offset.y));
+               /* This is over-simplistic... it casts the same
+                * length shadow over different depth objects.
+                */
+       }
+       if (shape == 2) {
+               XPoint      triangleList[4];
+               XPoint      triangleShade[3];
+
+               triangleList[0].x = sp->borderx + NRAND(sp->width - 2 * sp->borderx);
+               triangleList[0].y = sp->bordery + NRAND(sp->height - 2 * sp->bordery);
+               triangleList[1].x = sp->borderx + NRAND(sp->width - 2 * sp->borderx);
+               triangleList[1].y = sp->bordery + NRAND(sp->height - 2 * sp->bordery);
+               triangleList[2].x = sp->borderx + NRAND(sp->width - 2 * sp->borderx);
+               triangleList[2].y = sp->bordery + NRAND(sp->height - 2 * sp->bordery);
+               triangleList[3].x = triangleList[0].x;
+               triangleList[3].y = triangleList[0].y;
+               if (sp->shade) {
+                       for (i = 0; i < 3; i++) {
+                               triangleShade[i].x = triangleList[i].x + shade_offset.x;
+                               triangleShade[i].y = triangleList[i].y + shade_offset.y;
+                       }
+                       if (sp->stipple) {
+                               XSetStipple(display, gc, sp->pixmaps[0]);
+                               XSetFillStyle(display, gc, FillStippled);
+                       }
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                       XFillPolygon(display, window, gc, triangleShade, 3,
+                                    Convex, CoordModeOrigin);
+               }
+               if (sp->stipple) {
+                       XSetStipple(display, gc, sp->pixmaps[NRAND(sp->init_bits)]);
+                       XSetFillStyle(display, gc, FillOpaqueStippled);
+               }
+               XSetForeground(display, gc, (MI_NPIXELS(mi) > 2) ?
+                  MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))) : MI_WHITE_PIXEL(mi));
+               XFillPolygon(display, window, gc, triangleList, 3,
+                            Convex, CoordModeOrigin);
+               if (sp->border) {
+                       XSetForeground(display, gc, (MI_NPIXELS(mi) > 2) ?
+                                      MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))) : MI_BLACK_PIXEL(mi));
+                       XDrawLines(display, window, gc, triangleList, 4, CoordModeOrigin);
+               }
+       } else {
+               sp->w = sp->borderx + NRAND(sp->width - 2 * sp->borderx) *
+                       NRAND(sp->width) / sp->width;
+               sp->h = sp->bordery + NRAND(sp->height - 2 * sp->bordery) *
+                       NRAND(sp->height) / sp->height;
+               sp->x = NRAND(sp->width - sp->w);
+               sp->y = NRAND(sp->height - sp->h);
+               if (shape) {
+                       if (sp->shade) {
+                               if (sp->stipple) {
+                                       XSetStipple(display, gc, sp->pixmaps[0]);
+                                       XSetFillStyle(display, gc, FillStippled);
+                               }
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XFillArc(display, window, gc,
+                                        sp->x + shade_offset.x, sp->y + shade_offset.y,
+                                        sp->w, sp->h, 0, 23040);
+                       }
+                       if (sp->stipple) {
+                               XSetStipple(display, gc, sp->pixmaps[NRAND(sp->init_bits)]);
+                               XSetFillStyle(display, gc, FillOpaqueStippled);
+                       }
+                       XSetForeground(display, gc, (MI_NPIXELS(mi) > 2) ?
+                                      MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))) : MI_WHITE_PIXEL(mi));
+                       XFillArc(display, window, gc,
+                                sp->x, sp->y, sp->w, sp->h, 0, 23040);
+                       if (sp->border) {
+                               XSetForeground(display, gc, (MI_NPIXELS(mi) > 2) ?
+                                              MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))) : MI_BLACK_PIXEL(mi));
+                               XDrawArc(display, window, gc,
+                                      sp->x, sp->y, sp->w, sp->h, 0, 23040);
+                       }
+               } else {
+                       if (sp->shade) {
+                               if (sp->stipple) {
+                                       XSetStipple(display, gc, sp->pixmaps[0]);
+                                       XSetFillStyle(display, gc, FillStippled);
+                               }
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XFillRectangle(display, window, gc,
+                                              sp->x + shade_offset.x, sp->y + shade_offset.y, sp->w, sp->h);
+                       }
+                       if (sp->stipple) {
+                               XSetStipple(display, gc, sp->pixmaps[NRAND(sp->init_bits)]);
+                               XSetFillStyle(display, gc, FillOpaqueStippled);
+                       }
+                       XSetForeground(display, gc, (MI_NPIXELS(mi) > 2) ?
+                                      MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))) : MI_WHITE_PIXEL(mi));
+                       XFillRectangle(display, window, gc,
+                                      sp->x, sp->y, sp->w, sp->h);
+                       if (sp->border) {
+                               XSetForeground(display, gc, (MI_NPIXELS(mi) > 2) ?
+                                              MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))) : MI_BLACK_PIXEL(mi));
+                               XDrawRectangle(display, window, gc,
+                                              sp->x, sp->y, sp->w, sp->h);
+                       }
+               }
+       }
+       if (sp->border)
+               XSetLineAttributes(display, gc, 1, LineSolid, CapNotLast, JoinRound);
+       if (sp->stipple)
+               XSetFillStyle(display, gc, FillSolid);
+       if (sp->stipple && MI_NPIXELS(mi) > 2) {
+               XSetBackground(display, gc, MI_BLACK_PIXEL(mi));
+       }
+       XFlush(display);
+       if (++sp->time > MI_CYCLES(mi))
+               init_shape(mi);
+}
+
+void
+release_shape(ModeInfo * mi)
+{
+       if (shapes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_shape(MI_DISPLAY(mi), &shapes[screen]);
+               (void) free((void *) shapes);
+               shapes = NULL;
+       }
+}
+
+void
+refresh_shape(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+#endif /* MODE_shape */
diff --git a/modes/sierpinski.c b/modes/sierpinski.c
new file mode 100644 (file)
index 0000000..fb13d0b
--- /dev/null
@@ -0,0 +1,222 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* sierpinski --- Sierpinski's triangle fractal */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)sierpinski.c 5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Desmond Daignault
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Dots initially appear where they "should not".  Later they get
+ * "focused".  This is correct behavior.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 18-Sep-1997: 3D version Antti Kuntsi <kuntsi@iki.fi>.
+ * 20-May-1997: Changed the name tri to sierpinski for more compatiblity
+ * 10-May-1997: Jamie Zawinski <jwz@jwz.org> compatible with xscreensaver
+ * 05-Sep-1996: Desmond Daignault Datatimes Incorporated
+ *            <tekdd@dtol.datatimes.com> .
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Sierpinski"
+#define HACK_INIT init_sierpinski
+#define HACK_DRAW draw_sierpinski
+#define sierpinski_opts xlockmore_opts
+#define DEFAULTS "*delay: 400000 \n" \
+ "*count: 2000 \n" \
+ "*cycles: 100 \n" \
+ "*ncolors: 64 \n"
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_sierpinski
+
+ModeSpecOpt sierpinski_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   sierpinski_description =
+{"sierpinski", "init_sierpinski", "draw_sierpinski", "release_sierpinski",
+ "refresh_sierpinski", "init_sierpinski", NULL, &sierpinski_opts,
+ 400000, 2000, 100, 1, 64, 1.0, "",
+ "Shows Sierpinski's triangle", 0, NULL};
+
+#endif
+
+#define MAXCORNERS 4
+
+typedef struct {
+       int         width, height;
+       int         time;
+       int         px, py;
+       int         total_npoints;
+       int         corners;
+       int         npoints[MAXCORNERS];
+       unsigned long colors[MAXCORNERS];
+       XPoint     *pointBuffer[MAXCORNERS];
+       XPoint      vertex[MAXCORNERS];
+} sierpinskistruct;
+
+static sierpinskistruct *tris = NULL;
+
+static void
+startover(ModeInfo * mi)
+{
+       int         j;
+       sierpinskistruct *sp = &tris[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) > 2) {
+               if (sp->corners == 3) {
+                       sp->colors[0] = (NRAND(MI_NPIXELS(mi)));
+                       sp->colors[1] = (sp->colors[0] + MI_NPIXELS(mi) / 7 +
+                        NRAND(2 * MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+                       sp->colors[2] = (sp->colors[0] + 4 * MI_NPIXELS(mi) / 7 +
+                        NRAND(2 * MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+               } else if (sp->corners == 4) {
+                       sp->colors[0] = (NRAND(MI_NPIXELS(mi)));
+                       sp->colors[1] = (sp->colors[0] + MI_NPIXELS(mi) / 7 +
+                            NRAND(MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+                       sp->colors[2] = (sp->colors[0] + 3 * MI_NPIXELS(mi) / 7 +
+                            NRAND(MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+                       sp->colors[3] = (sp->colors[0] + 5 * MI_NPIXELS(mi) / 7 +
+                            NRAND(MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+               } else {
+                       (void) fprintf(stderr, "colors not set for %d corners\n", sp->corners);
+               }
+       }
+       for (j = 0; j < sp->corners; j++) {
+               sp->vertex[j].x = NRAND(sp->width);
+               sp->vertex[j].y = NRAND(sp->height);
+       }
+       sp->px = NRAND(sp->width);
+       sp->py = NRAND(sp->height);
+       sp->time = 0;
+
+       MI_CLEARWINDOW(mi);
+}
+
+static void
+free_sierpinski(sierpinskistruct *sp)
+{
+       int corner;
+
+       for (corner = 0; corner < MAXCORNERS; corner++)
+               if (sp->pointBuffer[corner] != NULL) {
+                       (void) free((void *) sp->pointBuffer[corner]);
+                       sp->pointBuffer[corner] = NULL;
+               }
+}
+
+void
+init_sierpinski(ModeInfo * mi)
+{
+       int         i;
+       sierpinskistruct *sp;
+
+       if (tris == NULL) {
+               if ((tris = (sierpinskistruct *) calloc(MI_NUM_SCREENS(mi),
+                                        sizeof (sierpinskistruct))) == NULL)
+                       return;
+       }
+       sp = &tris[MI_SCREEN(mi)];
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+
+       sp->total_npoints = MI_COUNT(mi);
+       if (sp->total_npoints < 1)
+               sp->total_npoints = 1;
+       sp->corners = MI_SIZE(mi);
+       if (sp->corners < 3 || sp->corners > 4) {
+               sp->corners = (int) (LRAND() & 1) + 3;
+       }
+       for (i = 0; i < sp->corners; i++) {
+               if (!sp->pointBuffer[i])
+                       if ((sp->pointBuffer[i] = (XPoint *) malloc(sp->total_npoints *
+                                       sizeof (XPoint))) == NULL) {
+                               free_sierpinski(sp);
+                               return;
+                       }
+       }
+       startover(mi);
+}
+
+void
+draw_sierpinski(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       XPoint     *xp[MAXCORNERS];
+       int         i, v;
+       sierpinskistruct *sp;
+
+       if (tris == NULL)
+               return;
+       sp = &tris[MI_SCREEN(mi)];
+       if (sp->pointBuffer[0] == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (MI_NPIXELS(mi) <= 2)
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       for (i = 0; i < sp->corners; i++)
+               xp[i] = sp->pointBuffer[i];
+       for (i = 0; i < sp->total_npoints; i++) {
+               v = NRAND(sp->corners);
+               sp->px = (sp->px + sp->vertex[v].x) / 2;
+               sp->py = (sp->py + sp->vertex[v].y) / 2;
+               xp[v]->x = sp->px;
+               xp[v]->y = sp->py;
+               xp[v]++;
+               sp->npoints[v]++;
+       }
+       for (i = 0; i < sp->corners; i++) {
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, gc, MI_PIXEL(mi, sp->colors[i]));
+               XDrawPoints(display, MI_WINDOW(mi), gc, sp->pointBuffer[i], sp->npoints[i],
+                           CoordModeOrigin);
+               sp->npoints[i] = 0;
+       }
+       if (++sp->time >= MI_CYCLES(mi))
+               startover(mi);
+}
+
+void
+release_sierpinski(ModeInfo * mi)
+{
+       if (tris != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_sierpinski(&tris[screen]);
+               (void) free((void *) tris);
+               tris = NULL;
+       }
+}
+
+void
+refresh_sierpinski(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_sierpinski */
diff --git a/modes/slip.c b/modes/slip.c
new file mode 100644 (file)
index 0000000..d8241b8
--- /dev/null
@@ -0,0 +1,340 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* slip --- lots of slipping blits */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)slip.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1992 by Scott Draves <spot@cs.cmu.edu>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Jamie Zawinski <jwz@jwz.org> compatible with xscreensaver
+ * 01-Dec-1995: Patched for VMS <joukj@hrem.stm.tudelft.nl>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Slip"
+#define HACK_INIT init_slip
+#define HACK_DRAW draw_slip
+#define slip_opts xlockmore_opts
+#define DEFAULTS "*delay: 50000 \n" \
+ "*count: 35 \n" \
+ "*cycles: 50 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_slip
+
+ModeSpecOpt slip_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   slip_description =
+{"slip", "init_slip", "draw_slip", "release_slip",
+ "init_slip", "init_slip", NULL, &slip_opts,
+ 50000, 35, 50, 1, 64, 1.0, "",
+ "Shows slipping blits", 0, NULL};
+
+#endif
+
+typedef struct {
+       int         width, height;
+       int         nblits_remaining;
+       int         blit_width, blit_height;
+       int         mode;
+       int         first_time;
+       int         backwards;
+       short       lasthalf;
+       int         stage;
+       unsigned long r;
+} slipstruct;
+static slipstruct *slips = NULL;
+
+static short
+halfrandom(slipstruct *sp, int mv)
+{
+       unsigned long r;
+
+       if (sp->lasthalf) {
+               r = sp->lasthalf;
+               sp->lasthalf = 0;
+       } else {
+               r = LRAND();
+               sp->lasthalf = (short) (r >> 16);
+       }
+       return r % mv;
+}
+
+static int
+erandom(slipstruct *sp, int mv)
+{
+       int         res;
+
+       if (0 == sp->stage) {
+               sp->r = LRAND();
+               sp->stage = 7;
+       }
+       res = (int) (sp->r & 0xf);
+       sp->r = sp->r >> 4;
+       sp->stage--;
+       if (res & 8)
+               return res & mv;
+       else
+               return -(res & mv);
+}
+
+static void
+prepare_screen(ModeInfo * mi, slipstruct * sp)
+{
+
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       int         i, n, w = sp->width / 20;
+       int         not_solid = halfrandom(sp, 10);
+
+#ifdef STANDALONE              /* jwz -- sometimes hack the desktop image! */
+       if (halfrandom(sp, 2) == 0) {
+#if 0
+               Pixmap      p =
+#endif
+               grab_screen_image(DefaultScreenOfDisplay(display),
+                                 MI_WINDOW(mi));
+
+#if 0
+               if (p)
+                       XFreePixmap(display, p);
+               return;
+#endif
+       }
+#endif
+
+       sp->backwards = (int) (LRAND() & 1);    /* jwz: go the other way sometimes */
+
+       if (sp->first_time || !halfrandom(sp, 10)) {
+               MI_CLEARWINDOW(mi);
+               n = 300;
+       } else {
+               if (halfrandom(sp, 5))
+                       return;
+               if (halfrandom(sp, 5))
+                       n = 100;
+               else
+                       n = 2000;
+       }
+
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, halfrandom(sp, MI_NPIXELS(mi))));
+       else if (halfrandom(sp, 2))
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       else
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+       for (i = 0; i < n; i++) {
+               int         ww = ((w / 2) + halfrandom(sp, w));
+
+               if (not_solid) {
+                       if (MI_NPIXELS(mi) > 2)
+                               XSetForeground(display, gc, MI_PIXEL(mi, halfrandom(sp, MI_NPIXELS(mi))));
+                       else if (halfrandom(sp, 2))
+                               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+                       else
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               }
+               XFillRectangle(display, MI_WINDOW(mi), gc,
+                              halfrandom(sp, sp->width - ww),
+                              halfrandom(sp, sp->height - ww),
+                              ww, ww);
+       }
+       sp->first_time = 0;
+}
+
+static int
+quantize(double d)
+{
+       int         i = (int) floor(d);
+       double      f = d - i;
+
+       if ((LRAND() & 0xff) < f * 0xff)
+               i++;
+       return i;
+}
+
+void
+init_slip(ModeInfo * mi)
+{
+       slipstruct *sp;
+
+       if (slips == NULL) {
+               if ((slips = (slipstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (slipstruct))) == NULL)
+                       return;
+       }
+       sp = &slips[MI_SCREEN(mi)];
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+
+       sp->blit_width = sp->width / 25;
+       sp->blit_height = sp->height / 25;
+       sp->nblits_remaining = 0;
+       sp->mode = 0;
+       sp->first_time = 1;
+
+       /* no "NoExpose" events from XCopyArea wanted */
+       XSetGraphicsExposures(MI_DISPLAY(mi), MI_GC(mi), False);
+}
+
+void
+draw_slip(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         timer;
+       slipstruct *sp;
+
+       if (slips == NULL)
+               return;
+       sp = &slips[MI_SCREEN(mi)];
+
+       timer = MI_COUNT(mi) * MI_CYCLES(mi);
+
+       MI_IS_DRAWN(mi) = True;
+
+       while (timer--) {
+               int         xi = halfrandom(sp, sp->width - sp->blit_width);
+               int         yi = halfrandom(sp, sp->height - sp->blit_height);
+               double      x, y, dx = 0, dy = 0, t, s1, s2;
+
+               if (0 == sp->nblits_remaining--) {
+                       static int  lut[] =
+                       {0, 0, 0, 1, 1, 1, 2};
+
+                       prepare_screen(mi, sp);
+                       sp->nblits_remaining = MI_COUNT(mi) *
+                               (2000 + halfrandom(sp, 1000) + halfrandom(sp, 1000));
+                       if (sp->mode == 2)
+                               sp->mode = halfrandom(sp, 2);
+                       else
+                               sp->mode = lut[halfrandom(sp, 7)];
+               }
+               x = (2 * xi + sp->blit_width) / (double) sp->width - 1;
+               y = (2 * yi + sp->blit_height) / (double) sp->height - 1;
+
+               /* (x,y) is in biunit square */
+               switch (sp->mode) {
+                       case 0: /* rotor */
+                               dx = x;
+                               dy = y;
+
+                               if (dy < 0) {
+                                       dy += 0.04;
+                                       if (dy > 0)
+                                               dy = 0.00;
+                               }
+                               if (dy > 0) {
+                                       dy -= 0.04;
+                                       if (dy < 0)
+                                               dy = 0.00;
+                               }
+                               t = dx * dx + dy * dy + 1e-10;
+                               s1 = 2 * dx * dx / t - 1;
+                               s2 = 2 * dx * dy / t;
+                               dx = s1 * 5;
+                               dy = s2 * 5;
+
+                               if (sp->backwards) {    /* jwz: go the other way sometimes */
+                                       dx = -dx;
+                                       dy = -dy;
+                               }
+                               break;
+                       case 1: /* shuffle */
+                               dx = erandom(sp, 3);
+                               dy = erandom(sp, 3);
+                               break;
+                       case 2: /* explode */
+                               dx = x * 3;
+                               dy = y * 3;
+                               break;
+               }
+               {
+                       int         qx = xi + quantize(dx), qy = yi + quantize(dy);
+                       int         wrap;
+
+                       if (qx < 0 || qy < 0 ||
+                           qx >= sp->width - sp->blit_width ||
+                           qy >= sp->height - sp->blit_height)
+                               continue;
+
+/*-
+Seems to cause problems using Exceed
+with PseudoColor
+X Error of failed request:  BadGC (invalid GC parameter)
+with TrueColor
+X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
+  Major opcode of failed request:  62 (X_CopyArea)
+ */
+                       XCopyArea(display, window, window, gc, xi, yi,
+                                 sp->blit_width, sp->blit_height,
+                                 qx, qy);
+                       switch (sp->mode) {
+                               case 0:
+                                       /* wrap */
+                                       wrap = sp->width - (2 * sp->blit_width);
+                                       if (qx > wrap ) {
+                                               XCopyArea(display, window, window, gc, qx, qy,
+                                               sp->blit_width, sp->blit_height,
+                                                         qx - wrap, qy);
+                                       }
+                                       if (qx < 2 * sp->blit_width) {
+                                               XCopyArea(display, window, window, gc, qx, qy,
+                                               sp->blit_width, sp->blit_height,
+                                                         qx + wrap, qy);
+                                       }
+                                       wrap = sp->height - (2 * sp->blit_height);
+                                       if (qy > wrap) {
+                                               XCopyArea(display, window, window, gc, qx, qy,
+                                               sp->blit_width, sp->blit_height,
+                                                         qx, qy - wrap);
+                                       }
+                                       if (qy < 2 * sp->blit_height) {
+                                               XCopyArea(display, window, window, gc, qx, qy,
+                                               sp->blit_width, sp->blit_height,
+                                                         qx, qy + wrap);
+                                       }
+                                       break;
+                               case 1:
+                               case 2:
+                                       break;
+                       }
+               }
+       }
+}
+
+void
+release_slip(ModeInfo * mi)
+{
+       if (slips != NULL) {
+               (void) free((void *) slips);
+               slips = NULL;
+       }
+}
+
+#endif /* MODE_slip */
diff --git a/modes/solitare.cc b/modes/solitare.cc
new file mode 100644 (file)
index 0000000..f18f2a6
--- /dev/null
@@ -0,0 +1,1409 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* solitare --- Shows a pointless game, used in the Mandarin Candidate */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)solitare.cc  5.00 2000/11/01 xlockmore";
+
+#endif
+
+/* Copyright (c) D. Bagley, 1999. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * This module is based on Eric Lassauge's text3d and Timothy Budd's
+ * C++ program from 1990 contained in the book "An Introduction to
+ * Object Oriented Programming"  Addison-Wesley Publishing  1991.
+ *
+ * Albert H. Morehead and Geoffrey Mott-Smith, The Complete Book of
+ * Solitaire and Patience Games, Grosset & Dunlap, New York, 1949.
+ *
+ * After I started this I found out about some nice related sites:
+ *   http://www.delorite.com/store/ace
+ *   http://wildsav.idv.uni-linz.ac.at/mfx/psol-cardsets/index.html
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 17-Jan-2000: autoplay, trackmouse, resizing, release
+ * 10-Dec-1999: wanted to do some C++, may end up using GL but not for now.
+ *
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Solitare"
+#define HACK_INIT init_solitare
+#define HACK_DRAW draw_solitare
+#define solitare_opts xlockmore_opts
+#define DEFAULTS "*delay: 2000000 \n" \
+ "*ncolors: 64 \n" \
+ "*mouse: False \n"
+
+extern "C"
+{
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+}
+#else                          /* !STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif                         /* !STANDALONE */
+
+#ifdef MODE_solitare
+
+/*  Methods overridden in subclasses of class cardPile
+           Suit Alternate Deck Discard Deal
+initialize         X       X
+cleanup                                 X
+addCard            X       X      X
+display            X
+select             X       X      X
+canTake     X      X
+ */
+
+#define DEF_TRACKMOUSE  "False"
+
+static Bool trackmouse;
+
+#define MAXCOLORS 2
+#define MAXSUITS 4
+#define MAXRANK 13
+#define MAXALTERNATEPILES 7
+#define MAXPILES (MAXALTERNATEPILES+MAXSUITS+2)
+#define OVERLAP (0.25)
+
+enum Colors {black, red};
+enum Suits {spade, diamond, club, heart};
+
+#ifdef FR
+// Ace => As, Jack => Valet,
+// Queen = Reine (Dame), King = Roi, Joker = Joker
+static const char *RankNames[] = {"", "A",
+       "2", "3", "4", "5", "6", "7", "8", "9", "10",
+       "V", "D", "R"};
+#else
+#ifdef NL
+// Ace => Aas, Jack => Boer (Farmer),
+// Queen = Vrouw (Lady), King = Heer (Gentleman), Joker = Joker
+static const char *RankNames[] = {"", "A",
+       "2", "3", "4", "5", "6", "7", "8", "9", "10",
+       "B", "V", "H"};
+#else
+#ifdef RU
+// Some may be approximations to Cyrillic
+static const char *RankNames[] = {"", "T",
+       "2", "3", "4", "5", "6", "7", "8", "9", "10",
+       "B", "Q", "K"};
+#else
+static const char *RankNames[] = {"", "A",
+       "2", "3", "4", "5", "6", "7", "8", "9", "10",
+       "J", "Q", "K"};
+#endif
+#endif
+#endif
+
+static inline int round(double x) { return int(x + 0.5); }
+
+#ifdef DOFONT
+// Does this really add anything?
+extern XFontStruct *getFont(Display * display);
+static XFontStruct *mode_font = None;
+static int  char_width[256];
+
+static int
+font_width(XFontStruct * font, char ch)
+{
+       int         dummy;
+       XCharStruct xcs;
+
+       (void) XTextExtents(font, &ch, 1, &dummy, &dummy, &dummy, &xcs);
+       return xcs.width;
+}
+#endif
+
+// I am probably not thinking object oriented here...
+void
+drawSuit(ModeInfo * mi, Suits suit, int x, int y, int width, int height)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       XPoint                  polygon[4];
+
+       switch (suit) {
+               case spade:
+                       polygon[0].x =  x + width / 2;
+                       polygon[0].y =  y;
+                       polygon[1].x =  short(float(-width) / 3.0);
+                       polygon[1].y =  height / 3;
+                       polygon[2].x =  short(float(width) / 3.0);
+                       polygon[2].y =  height / 3;
+                       polygon[3].x =  short(float(width) / 3.0) + 1;
+                       polygon[3].y =  -height / 3;
+                       XFillPolygon(display, window, gc,
+                               polygon, 4, Convex, CoordModePrevious);
+                       XFillArc(display, window, gc,
+                               x, y + height / 3, width / 2, height / 2, 0, 23040);
+                       XFillArc(display, window, gc,
+                               x + width / 2, y + height / 3, width / 2, height / 2, 0, 23040);
+                       polygon[0].x =  x + width / 2;
+                       polygon[0].y =  y + height / 2;
+                       polygon[1].x =  -width / 8;
+                       polygon[1].y =  height / 2;
+                       polygon[2].x =  width / 4;
+                       polygon[2].y =  0;
+                       XFillPolygon(display, window, gc,
+                               polygon, 3, Convex, CoordModePrevious);
+                       break;
+               case diamond:
+                       polygon[0].x =  x + width / 2;
+                       polygon[0].y =  y;
+                       polygon[1].x =  -width / 2;
+                       polygon[1].y =  height / 2;
+                       polygon[2].x =  width / 2;
+                       polygon[2].y =  height / 2;
+                       polygon[3].x =  width / 2;
+                       polygon[3].y =  -height / 2;
+                       XFillPolygon(display, window, gc,
+                               polygon, 4, Convex, CoordModePrevious);
+                       break;
+               case club:
+                       XFillArc(display, window, gc,
+                               x, y + short(float(height) / 3.6), width / 2, height / 2, 0, 23040);
+                       XFillArc(display, window, gc,
+                               x + width / 2, y + short(float(height) / 3.6), width / 2, height / 2, 0, 23040);
+                       XFillArc(display, window, gc,
+                               x + width / 4, y, width / 2, height / 2, 0, 23040);
+                       polygon[0].x =  x + width / 2;
+                       polygon[0].y =  y + height / 2 - 1;
+                       polygon[1].x =  -width / 8;
+                       polygon[1].y =  height / 2 + 1;
+                       polygon[2].x =  width / 4;
+                       polygon[2].y =  0;
+                       XFillPolygon(display, window, gc,
+                               polygon, 3, Convex, CoordModePrevious);
+                       break;
+               case heart:
+                       XFillArc(display, window, gc,
+                               x + 1, y, width / 2, height / 2, 0, 23040);
+                       XFillArc(display, window, gc,
+                               x + width / 2 - 1, y, width / 2, height / 2, 0, 23040);
+                       polygon[0].x =  x + width / 2;
+                       polygon[0].y =  y + short(float(height) / 4.1);
+                       polygon[1].x =  short(float(-width) / 2.7);
+                       polygon[1].y =  short(float(height) / 4.1);
+                       polygon[2].x =  short(float(width) / 2.7);
+                       polygon[2].y =  short(float(height) / 2.05);
+                       polygon[3].x =  short(float(width) / 2.7);
+                       polygon[3].y =  short(float(-height) / 2.05);
+                       XFillPolygon(display, window, gc,
+                               polygon, 4, Convex, CoordModePrevious);
+                       break;
+       }
+}
+
+//card.h
+class Card
+{
+private:
+       Suits suit;
+       int rank;
+public:
+       Card(Suits suit, int rank);
+       Suits whichSuit();
+       int whichRank();
+       Colors whichColor();
+};
+inline Card::Card(Suits a_suit, int a_rank) { this->suit = a_suit; this->rank = a_rank;}
+inline Suits Card::whichSuit() { return this->suit;}
+inline int Card::whichRank() { return this->rank;}
+inline Colors Card::whichColor() { return ((whichSuit() % MAXCOLORS) ? red : black);}
+
+
+//cardview.h
+class CardView
+{
+private:
+       ModeInfo *mi;
+       Card * card;
+       Bool faceUp;
+       int locationX, locationY;
+public:
+       CardView(ModeInfo * mi, Card * card);
+       CardView(ModeInfo *mi, Suits suit, int rank);
+       Card * thisCard();
+       void draw();
+       void erase();
+       Bool isFaceUp();
+       void flip();
+       Bool includes(int, int); // mouse interaction
+       int x();
+       int y();
+       int width();
+       int height();
+       void moveTo(int, int);
+};
+
+inline Card* CardView::thisCard() { return card; }
+inline Bool CardView::isFaceUp() { return faceUp; }
+inline void CardView::flip() { faceUp = !faceUp; }
+inline int CardView::x() { return locationX; }
+inline int CardView::y() { return locationY; }
+inline void CardView::moveTo(int lx, int ly) { locationX = lx; locationY = ly; }
+
+//cardview.cc
+CardView::CardView(ModeInfo * a_mi, Card * a_card)
+{
+       this->mi = a_mi;
+       this->card = a_card;
+       faceUp = False;
+       locationX = locationY = 0;
+}
+
+CardView::CardView(ModeInfo * a_mi, Suits suit, int rank)
+{
+       this->mi = a_mi;
+       if ((this->card = new Card(suit, rank)) == NULL) {
+               return;
+       }
+       faceUp = False;
+       locationX = locationY = 0;
+}
+
+void CardView::draw()
+{
+       Display * display = MI_DISPLAY(mi);
+       Window window = MI_WINDOW(mi);
+       GC gc = MI_GC(mi);
+       unsigned long red_pixel = (MI_NPIXELS(mi) > 2) ? MI_PIXEL(mi,0) : MI_BLACK_PIXEL(mi);
+       unsigned long cyan_pixel = (MI_NPIXELS(mi) > 2) ? MI_PIXEL(mi,MI_NPIXELS(mi) / 2) : MI_WHITE_PIXEL(mi);
+
+       if (isFaceUp()) {
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               XFillRectangle(display, window, gc, x(), y(), width(), height());
+               if (card->whichColor() == red) {
+                       XSetForeground(display, gc, red_pixel);
+               } else {
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               }
+               if (width() > 16 && height() > 34) {
+#ifdef CENTERLABEL
+                       XDrawString(display, window, gc,
+                               x() + width() / 2 - strlen(RankNames[card->whichRank()]) * 8,
+                               y() + round(height() * 0.40),
+                               RankNames[card->whichRank()], strlen(RankNames[card->whichRank()]));
+#else
+                       XDrawString(display, window, gc,
+                               x() + 8 - strlen(RankNames[card->whichRank()]) * 8 + width() / 8,
+                               y() + 20,
+                               RankNames[card->whichRank()], strlen(RankNames[card->whichRank()]));
+#endif
+               }
+#ifdef SUITNAMES
+                       char *SuitNames[] = {"Spade", "Diamond", "Club", "Heart"};
+               XDrawString(display, window, gc, x() + 0.2, y() + round(height() * 0.8),
+                       SuitNames[card->whichSuit()], strlen(SuitNames[card->whichSuit()]));
+#endif
+#ifdef CENTERLABEL
+               drawSuit(mi, card->whichSuit(),
+                       x() + round(width() * 0.35), y() + round(height() * 0.55),
+                       round(0.3 * width()), round(0.3 * height()));
+#else
+               if (width() > 16 && height() > 34) {
+                       drawSuit(mi, card->whichSuit(),
+                               x() + 5, y() + 25,
+                               round(0.3 * width()), round(0.3 * height()));
+               } else {
+                       drawSuit(mi, card->whichSuit(),
+                               x() + 2, y() + 2,
+                               round(0.3 * width()), round(0.3 * height()));
+               }
+#endif
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XDrawLine(display, window, gc,
+                       x() + 1, y() + 1, x() + width() - 3, y() + 1);
+               XDrawLine(display, window, gc,
+                       x() + 1, y() + height() - 2, x() + width() - 3, y() + height() - 2);
+               XDrawLine(display, window, gc,
+                       x() + 1, y() + 1, x() + 1, y() + height() - 3);
+               XDrawLine(display, window, gc,
+                       x() + width() - 2, y() + 1, x() + width() - 2, y() + height() - 3);
+       } else {
+               int n;
+
+               XSetForeground(display, gc, cyan_pixel);
+               XFillRectangle(display, window, gc,
+                       x(), y(), width(), height());
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               n = x() + round(round(width() * 0.3));
+               XDrawLine(display, window, gc, n, y() + round(height() * 0.1),
+                       n, y() + round(height() * 0.9));
+               n = x() + round(width() * 0.7);
+               XDrawLine(display, window, gc, n, y() + round(height() * 0.1),
+                       n, y() + round(height() * 0.9));
+               n = y() + round(height() * 0.3);
+               XDrawLine(display, window, gc, x() + round(height() * 0.1), n,
+                       x() + round(width() * 0.9), n);
+               n = y() + round(height() * 0.7);
+               XDrawLine(display, window, gc, x() + round(width() * 0.1), n,
+                       x() + int(width() * 0.9), n);
+       }
+       // Shadow
+#if 1
+       XDrawLine(display, window, gc,
+               x() - 1, y() - 1 , x() + width(), y() - 1);
+       XDrawLine(display, window, gc,
+               x() - 1, y() - 1, x() - 1, y() + height());
+#else
+       XDrawLine(display, window, gc,
+               x() + 1, y() + height(), x() + width(), y() + height());
+       XDrawLine(display, window, gc,
+               x() + width(), y() + 1, x() + width(), y() + height());
+#endif
+}
+
+void CardView::erase()
+{
+       Display * display = MI_DISPLAY(mi);
+       Window window = MI_WINDOW(mi);
+       GC gc = MI_GC(mi);
+
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       XFillRectangle(display, window, gc,
+               x(), y(), width(), height());
+}
+
+//pile.h
+Bool CardView::includes(int a, int b)
+{
+       return (a >= x() && (a <= x() + width()) &&
+               b >= y() && (b <= y() + height()));
+}
+
+class CardLink : public CardView
+{
+public:
+       CardLink(ModeInfo * mi, Suits suit, int rank);
+       CardLink(ModeInfo * mi, Card * card);
+       CardLink * nextCard();
+       void setLink(CardLink * card);
+
+private:
+       CardLink * link;
+};
+
+inline CardLink::CardLink(ModeInfo *a_mi, Suits suit, int rank) : CardView(a_mi, suit, rank) { ; }
+inline CardLink::CardLink(ModeInfo *a_mi, Card * a_card) : CardView(a_mi, a_card) { ; }
+inline CardLink * CardLink::nextCard() { return link; }
+inline void CardLink::setLink(CardLink * a_card) { link = a_card; }
+
+class CardPile
+{
+public:
+       CardPile(ModeInfo *);
+
+       virtual void updateLocation(ModeInfo *);
+       virtual void addCard(CardLink *);
+       virtual Bool canTake(Card *);
+       Bool contains(int, int); // mouse interaction
+       virtual void displayPile();
+       virtual Bool initialize();
+       virtual void cleanup();
+       CardLink * removeCard();
+       virtual Bool select(int, int); // mouse interaction
+       virtual Bool select(Bool); // generator
+
+protected:
+       int x, y;
+       ModeInfo * mi;
+       CardLink *top;
+};
+
+#define nilLink (CardLink *) 0
+
+inline CardPile::CardPile(ModeInfo * a_mi) { this->mi = a_mi; top = nilLink; }
+
+class DealPile : public CardPile
+{
+public:
+       DealPile(ModeInfo *);
+       virtual void cleanup();
+       Bool shuffle(CardPile *);
+};
+inline DealPile::DealPile(ModeInfo * a_mi) : CardPile(a_mi) { ; }
+
+class SuitPile : public CardPile
+{
+public:
+       SuitPile(ModeInfo * a_mi, int s) : CardPile(a_mi) { suit = s; }
+       virtual void updateLocation(ModeInfo *);
+       virtual Bool canTake(Card *);
+private:
+       int suit;
+};
+
+class AlternatePile : public CardPile
+{
+public:
+       AlternatePile(ModeInfo * a_mi, int p) : CardPile(a_mi) { pile = p; }
+       virtual void updateLocation(ModeInfo *);
+       virtual void addCard(CardLink *);
+       virtual Bool canTake(Card *);
+       void copyBuild(CardLink *, CardPile *);
+       virtual void displayPile();
+       virtual Bool select(int, int);
+       virtual Bool select(Bool);
+       virtual Bool initialize();
+private:
+       int pile;
+};
+
+class DeckPile : public CardPile
+{
+public:
+       DeckPile(ModeInfo * a_mi) : CardPile(a_mi) { ; }
+       virtual void updateLocation(ModeInfo *);
+       virtual void addCard(CardLink *);
+       virtual Bool initialize();
+       virtual Bool select(int, int);
+       virtual Bool select(Bool);
+};
+
+class DiscardPile : public CardPile
+{
+public:
+       DiscardPile(ModeInfo * a_mi) : CardPile(a_mi) { ; }
+       virtual void updateLocation(ModeInfo *);
+       virtual void addCard(CardLink *);
+       virtual Bool select(int, int);
+       virtual Bool select(Bool);
+};
+
+//game.h
+class GameTable
+{
+public:
+       GameTable(ModeInfo *);
+       ~GameTable();
+       Bool newGame(ModeInfo *);
+       Bool suitCanAdd(Card *);
+       CardPile * suitAddPile(Card *);
+       Bool alternateCanAdd(Card *);
+       CardPile * alternateAddPile(Card *);
+       void Resize(ModeInfo *);
+       void Redraw(ModeInfo *);
+       Bool HandleMouse(ModeInfo *);
+       Bool HandleGenerate();
+
+       DealPile *dealPile;
+
+       CardPile *deckPile;
+       CardPile *discardPile;
+protected:
+       CardPile * allPiles[MAXALTERNATEPILES + MAXSUITS + 2];
+       CardPile * suitPiles[MAXSUITS];
+       CardPile * alternatePiles[MAXALTERNATEPILES];
+};
+
+// pile.cc
+
+typedef struct {
+       Bool        painted;
+       GameTable * game;
+       int         width, height, cardwidth, cardheight;
+       int         showend;
+#ifdef DOFONT
+       int         fontascent, fontheight;
+#endif
+} solitarestruct;
+
+static solitarestruct *solitare = (solitarestruct *) NULL;
+
+int CardView::width()
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+
+       return bp->cardwidth;
+}
+
+int CardView::height()
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+
+       return bp->cardheight;
+}
+
+void CardPile::addCard(CardLink * card)
+{
+       if (card != nilLink) {
+               card->setLink(top);
+               top = card;
+               top->moveTo(x, y);
+       }
+}
+
+void CardPile::updateLocation(ModeInfo * a_mi)
+{
+       ;
+}
+
+Bool CardPile::canTake(Card * card)
+{
+       return False; // from virtual, card unused
+}
+
+Bool CardPile::contains(int a, int b)
+{
+       for (CardLink *p = top; p!= nilLink; p = p->nextCard())
+               if (p->includes(a, b))
+                       return True;
+       return False;
+}
+
+void CardPile::displayPile()
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       Display * display = MI_DISPLAY(mi);
+       Window window = MI_WINDOW(mi);
+       GC gc = MI_GC(mi);
+
+       if (top == nilLink) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, window, gc,
+                       x, y, bp->cardwidth, bp->cardheight);
+       } else {
+               top->draw();
+       }
+}
+
+Bool CardPile::initialize()
+{
+       top = nilLink;
+       return True;
+}
+
+void CardPile::cleanup()
+{
+       CardLink *p;
+
+       while (top != nilLink) {
+               p = top;
+               top = top->nextCard();
+               delete p;
+       }
+}
+
+CardLink * CardPile::removeCard()
+{
+       CardLink *p;
+
+       if (top == nilLink)
+               return nilLink;
+       p = top;
+       top = top->nextCard();
+       return p;
+}
+
+Bool CardPile::select(int a_x, int a_y)
+{
+       // from virtual, a_x & a_y unused
+       return select(True);
+}
+
+Bool CardPile::select(Bool first)
+{
+       // from virtual, first unused
+       return False;
+}
+
+void DealPile::cleanup()
+{
+       CardLink *p;
+
+  while (top != nilLink) {
+    p = top;
+               top = top->nextCard();
+               delete p->thisCard();
+    delete p;
+   }
+}
+
+Bool DealPile::shuffle(CardPile * pile)
+{
+       CardLink *p, *q;
+       int max, limit, i;
+
+       // first see how many cards we have
+       for (max = 0, p = top; p != nilLink; p = p->nextCard()) {
+               max++;
+               if (p->isFaceUp())
+                       p->flip();
+       }
+       // then pull them out, randomly, one at a time
+       for (; max > 0; max--) {
+               limit = (int) ((LRAND() >> 3) % max) + 1;
+               for ( i= 1, p = top; i <= limit; ) {
+                       while (p->isFaceUp())
+                               p = p->nextCard();
+                       i++;
+                       if (i <= limit)
+                               p = p->nextCard();
+               }
+               if ((q = new CardLink(mi, p->thisCard())) == NULL) {
+                       return False;
+               }
+               pile->addCard(q);
+               p->flip();
+       }
+       return True;
+}
+
+void DeckPile::updateLocation(ModeInfo * a_mi)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(a_mi)];
+
+       //set pile
+       x = round(((bp->cardwidth + 2.0 * MAXSUITS * bp->cardwidth *
+               (MAXALTERNATEPILES + 1.0)) / (2.0 * MAXALTERNATEPILES)) +
+               3 * bp->cardwidth / 4.0);
+       y = round(0.25 * bp->cardheight);
+
+       // set card
+       for (CardLink *p = top; p!= nilLink; p = p->nextCard()) {
+               p->moveTo(x, y);
+       }
+}
+
+Bool DeckPile::initialize()
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+
+       CardPile::initialize();
+       if (!bp->game->dealPile->shuffle(this))
+       return False;
+       return True;
+}
+
+void DeckPile::addCard(CardLink *c)
+{
+       if (c->isFaceUp())
+               c->flip();
+       CardPile::addCard(c);
+}
+
+Bool DeckPile::select(int a_x, int a_y)
+{
+       // from virtual, a_x & a_y unused
+       return select(True);
+}
+
+// turn over a new card
+Bool DeckPile::select(Bool first)
+{
+       // from virtual, first unused
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       CardLink *c;
+       Bool didSomething = False;
+
+       if (top != nilLink) {
+               c = removeCard(); // should not this be 3 at a time
+               if (c != nilLink)
+                       (bp->game->discardPile)->addCard(c);
+               didSomething = True;
+       }
+       displayPile();
+       (bp->game->discardPile)->displayPile();
+       return didSomething;
+}
+
+void DiscardPile::updateLocation(ModeInfo * a_mi)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(a_mi)];
+
+       //set pile
+       x = round(((bp->cardwidth + 2.0 * MAXSUITS * bp->cardwidth *
+               (MAXALTERNATEPILES + 1.0)) / (2.0 * MAXALTERNATEPILES)) +
+               2 * bp->cardwidth);
+       y = round(0.25 * bp->cardheight);
+
+       // set card
+       for (CardLink *p = top; p!= nilLink; p = p->nextCard()) {
+               p->moveTo(x, y);
+       }
+}
+
+void DiscardPile::addCard(CardLink *c)
+{
+       if (!(c->isFaceUp()))
+               c->flip();
+       CardPile::addCard(c);
+}
+
+// play the current face card
+Bool DiscardPile::select(int a_x, int a_y)
+{
+       // from virtual, a_x & a_y unused
+       return select(True);
+}
+
+// play the current face card
+Bool DiscardPile::select(Bool first)
+{
+       // from virtual, first unused
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       CardPile * pile;
+
+       if (top == nilLink)
+               return False;
+       // see if we can move it to a suit pile
+       if (bp->game->suitCanAdd(top->thisCard())) {
+               pile = bp->game->suitAddPile(top->thisCard());
+               pile->addCard(removeCard());
+               displayPile();
+               pile->displayPile();
+               return True;
+       }
+       if (bp->game->alternateCanAdd(top->thisCard())) {
+               pile = bp->game->alternateAddPile(top->thisCard());
+               pile->addCard(removeCard());
+               displayPile();
+               pile->displayPile();
+               return True;
+       }
+       return False;
+}
+
+void SuitPile::updateLocation(ModeInfo * a_mi)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(a_mi)];
+
+       //set pile
+       x = round(((bp->cardwidth + 2.0 * suit * bp->cardwidth *
+               (MAXALTERNATEPILES + 1.0)) / (2.0 * MAXALTERNATEPILES)) +
+               bp->cardwidth / 2.0);
+       y = round(0.25 * bp->cardheight);
+
+       // set card
+       for (CardLink *p = top; p!= nilLink; p = p->nextCard()) {
+               p->moveTo(x, y);
+       }
+}
+
+Bool SuitPile::canTake(Card * card)
+{
+       if (top == nilLink) { // empty so can take ace
+               if (card->whichRank() == 1)
+                       return True;
+               return False;
+       }
+       if ((top->thisCard())->whichSuit() != card->whichSuit())
+               return False;
+       if (((top->thisCard())->whichRank() + 1) == card->whichRank())
+               return True;
+       return False;
+}
+
+void AlternatePile::updateLocation(ModeInfo * a_mi)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(a_mi)];
+       int ty;
+
+       //set pile
+       x = (round((bp->cardwidth + 2.0 * pile * bp->cardwidth *
+        (MAXALTERNATEPILES + 1.0)) / (2.0 * MAXALTERNATEPILES)));
+       y = round(1.5 * bp->cardheight);
+
+       CardLink *bf = nilLink;
+       // set card
+       for (CardLink *p = top; p!= nilLink; p = p->nextCard()) {
+               p->moveTo(x, y);
+               // find bottom faceup card
+               // not setup to work with STRANGE_LAYOUT
+               if (p->isFaceUp())
+                       bf = p;
+       }
+       if (bf != nilLink) {
+               // ok but this is wrong.  Since we only have a singly link
+               // we will do this slightly inefficiently...
+               ty = y;
+               while (bf != top) {
+                       CardLink *sp;
+                       for (sp = top; sp->nextCard() != bf; sp = sp->nextCard());
+                       bf = sp;
+                       ty += round(bp->cardheight * OVERLAP);
+                       sp->moveTo(x, ty);
+               }
+       }
+}
+
+Bool AlternatePile::initialize()
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       int a_pile;
+
+       //put the right number of cards on the alternate
+       (void) CardPile::initialize();
+       for (a_pile = 0; a_pile <= this->pile; a_pile++)
+               addCard((bp->game->deckPile)->removeCard());
+       // flip the last one
+       if (top != nilLink) {
+               top->flip();
+       }
+       return True;
+}
+
+void AlternatePile::addCard(CardLink * card)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       int tx, ty;
+
+       if (top == nilLink)
+               CardPile::addCard(card);
+       else {
+               tx = top->x();
+               ty = top->y();
+
+               // figure out where to place the card
+#ifdef STRANGE_LAYOUT
+               // This was the original logic... does not look right to me.
+               if (!(top->isFaceUp() && top->nextCard() != nilLink &&
+                       (top->nextCard())->isFaceUp()))
+#else
+               if (top->isFaceUp())
+#endif
+                       ty += round(bp->cardheight * OVERLAP);
+               CardPile::addCard(card);
+               top->moveTo(tx, ty);
+       }
+}
+
+Bool AlternatePile::canTake(Card *card)
+{
+       if (top == nilLink) { // can take only kings on an empty pile
+               if (card->whichRank() == MAXRANK) {
+                       return True;
+               }
+               return False;
+       }
+       // see if it is face up, colors are different, and the number is legal
+       if ((top->thisCard())->whichColor() != card->whichColor() &&
+           ((top->thisCard())->whichRank() - 1) == card->whichRank()) {
+               return True;
+       }
+       return False;
+}
+
+void AlternatePile::copyBuild(CardLink *card, CardPile * a_pile)
+{
+       CardLink *tempCard;
+
+       top->erase();
+       tempCard = removeCard();
+       displayPile();
+       if (card != tempCard)
+               copyBuild(card, a_pile);
+       a_pile->addCard(tempCard);
+       a_pile->displayPile();
+}
+
+static void stackDisplay(CardLink *p)
+{
+       if (p->nextCard())
+               stackDisplay(p->nextCard());
+       p->draw();
+}
+
+void AlternatePile::displayPile()
+{
+       // Zero or one cards, can not do any better
+       if (top == nilLink)
+               CardPile::displayPile();
+       else { // otherwise half display all the covered cards
+               stackDisplay(top);
+       }
+}
+
+Bool AlternatePile::select(int a_x, int a_y)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       CardLink *c;
+
+       // no cards, do nothing
+       if (top == nilLink)
+               return False;
+
+       // if top card is not flipped, flip it now
+       if (!top->isFaceUp()) {
+               top->flip();
+               top->draw();
+               return True;
+       }
+
+       // if it was to top card, see if we can move it
+       if (top->includes(a_x, a_y)) {
+               // see if we ca move it to a suit pile
+               if (bp->game->suitCanAdd(top->thisCard())) {
+                       copyBuild(top, bp->game->suitAddPile(top->thisCard()));
+                       return True;
+               }
+               // else see if we can move a alternate pile but only if it is not part of pile
+               if (((top->nextCard() == nilLink) || !((top->nextCard())->isFaceUp())) &&
+                       bp->game->alternateCanAdd(top->thisCard())) {
+                       copyBuild(top, bp->game->alternateAddPile(top->thisCard()));
+                       return True;
+               }
+       }
+
+       // else see if we can move a pile
+       for (c = top->nextCard(); c!= nilLink; c = c->nextCard())
+               if (c->isFaceUp() && c->includes(a_x, a_y)) {
+                       if (bp->game->alternateCanAdd(c->thisCard())) {
+                               copyBuild(c, bp->game->alternateAddPile(c->thisCard()));
+                       }
+                       return True;
+               }
+       return False;
+}
+
+Bool AlternatePile::select(Bool first)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       CardLink *c;
+
+       // no cards, do nothing
+       if (top == nilLink)
+               return False;
+
+       // if top card is not flipped, flip it now
+       if (!top->isFaceUp()) {
+               top->flip();
+               top->draw();
+               return True;
+       }
+       // see if we ca move it to a suit pile
+       if (bp->game->suitCanAdd(top->thisCard())) {
+               copyBuild(top, bp->game->suitAddPile(top->thisCard()));
+               return True;
+       }
+
+       // If all cards are not flipped it could lead to problems...
+       if (first)
+               return False;
+
+       // Other moves may be better but this is stupid
+       // Bouncing may result if one allows to take away moves
+       // find highest faceup card
+       c = top;
+       while (c->nextCard() != nilLink && (c->nextCard())->isFaceUp())
+               c = c->nextCard();
+
+       // if not king see if it can be moved to leave a space (else it will bounce)
+       if (((c->nextCard() != nilLink) ||
+           ((c->thisCard())->whichRank() != MAXRANK)) &&
+           bp->game->alternateCanAdd(c->thisCard())) {
+                               copyBuild(c, bp->game->alternateAddPile(c->thisCard()));
+                               return True;
+       }
+       return False;
+}
+
+GameTable::GameTable(ModeInfo *mi)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       int suit, rank, pile;
+
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+       bp->showend = 0;
+       bp->cardwidth = bp->width / (MAXALTERNATEPILES + 1);
+       bp->cardheight = bp->height / 5;
+       // Create the original (unshuffled) deck (with no cards) ... dah daaah!
+       if ((dealPile = new DealPile(mi)) == NULL) {
+               return;
+       }
+       for (suit = 0; suit < MAXSUITS; suit++)
+               for (rank = 1; rank <= MAXRANK; rank++) {
+            CardLink * deal;
+                       // 52 pickup, creating new cards and creating links
+                       if ((deal = new CardLink(mi, Suits(suit), rank)) == NULL) {
+                               dealPile->cleanup();
+                               delete dealPile;
+                               return;
+                       }
+                       dealPile->addCard(deal);
+               }
+       // create 2 piles the deck and discard piles
+       if ((allPiles[0] = deckPile = new DeckPile(mi)) == NULL) {
+               dealPile->cleanup();
+               delete dealPile;
+               return;
+       }
+       deckPile->updateLocation(mi);
+       if ((allPiles[1] = discardPile = new DiscardPile(mi)) == NULL) {
+               dealPile->cleanup();
+               delete dealPile;
+               delete deckPile;
+               return;
+       }
+       discardPile->updateLocation(mi);
+
+       // create suit piles
+       for (suit = 0; suit < MAXSUITS; suit++) {
+               if ((allPiles[suit + 2] = suitPiles[Suits(suit)] = new SuitPile(mi, suit)) == NULL) {
+                       delete this;
+                       return;
+               }
+               (suitPiles[Suits(suit)])->updateLocation(mi);
+       }
+
+       // create alternate piles
+       for (pile = 0; pile < MAXALTERNATEPILES; pile++) {
+               if ((allPiles[pile + 2 + MAXSUITS] = alternatePiles[pile] =
+                       new AlternatePile(mi, pile)) == NULL) {
+                       delete this;
+                       return;
+               }
+               (alternatePiles[pile])->updateLocation(mi);
+       }
+}
+
+GameTable::~GameTable()
+{
+       for (int pile = 0; pile < MAXPILES; pile++)
+               if (allPiles[pile]) {
+                       allPiles[pile]->cleanup();
+                       delete allPiles[pile];
+               }
+       if (dealPile) {
+               dealPile->cleanup();
+               delete dealPile;
+       }
+}
+
+void GameTable::Resize(ModeInfo *mi)
+{
+       solitarestruct *bp = &solitare[MI_SCREEN(mi)];
+       int suit, pile;
+
+       bp->width = MI_WIDTH(mi);
+       bp->height = MI_HEIGHT(mi);
+       bp->cardwidth = bp->width / (MAXALTERNATEPILES + 1);
+       bp->cardheight = bp->height / 5;
+       deckPile->updateLocation(mi);
+       discardPile->updateLocation(mi);
+
+       // move suit piles
+       for (suit = 0; suit < MAXSUITS; suit++) {
+               (suitPiles[Suits(suit)])->updateLocation(mi);
+       }
+
+       // move alternate piles
+       for (pile = 0; pile < MAXALTERNATEPILES; pile++) {
+               (alternatePiles[pile])->updateLocation(mi);
+       }
+}
+
+Bool GameTable::newGame(ModeInfo * mi)
+{
+       int pile;
+
+       // initialize all the piles
+       for (pile = 0; pile < MAXPILES; pile++)
+               if (!allPiles[pile]->initialize())
+                       return False;
+       // redraw the game window
+       Redraw(mi);
+       return True;
+}
+
+void GameTable::Redraw(ModeInfo * mi)
+{
+       int pile;
+
+       //first clear the entire playing area
+       MI_CLEARWINDOW(mi);
+
+       // then display the piles
+       for (pile = 0; pile < MAXPILES; pile++)
+               allPiles[pile]->displayPile();
+}
+
+// this is where the smarts is/is not
+Bool GameTable::HandleMouse(ModeInfo * mi)
+{
+       Window r, c;
+       int cx, cy, rx, ry;
+       unsigned int m;
+       int pile;
+
+       (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
+         &r, &c, &rx, &ry, &cx, &cy, &m);
+
+       if (cx <= 0  || cy <= 0 ||
+           cx >= MI_WIDTH(mi) - 1 || cy >= MI_HEIGHT(mi) -1) {
+               return HandleGenerate();
+       }
+
+       for (pile = 0; pile < MAXPILES; pile++)
+               if (allPiles[pile]->contains(cx, cy)) {
+                       (void) allPiles[pile]->select(cx, cy);
+                       return True;
+               }
+       return True;
+}
+
+// if done right it looks smart...
+Bool GameTable::HandleGenerate()
+{
+       int pile;
+
+       // Start with the biggest stacks... usually the last ones
+       for (pile = MAXALTERNATEPILES - 1; pile >= 0; pile--)
+               if (alternatePiles[pile]->select(True))
+                       return True;
+       for (pile = MAXALTERNATEPILES - 1; pile >= 0; pile--)
+               if (alternatePiles[pile]->select(False))
+                       return True;
+       // Look for something to do in discard pile
+       if (discardPile->select(True))
+               return True;
+
+       // Get a new card or end it
+       return (deckPile->select(True));
+}
+
+// see if any of the suit piles can add a specific card
+Bool GameTable::suitCanAdd(Card * card)
+{
+       int suit;
+
+       for (suit = 0; suit < MAXSUITS; suit++)
+               if (suitPiles[Suits(suit)]->canTake(card))
+                       return True;
+       return False;
+}
+
+// see if any of the alternate piles can add a specific card
+Bool GameTable::alternateCanAdd(Card * card)
+{
+       int pile;
+
+       for (pile = 0; pile < MAXALTERNATEPILES; pile++)
+               if (alternatePiles[pile]->canTake(card))
+                       return True;
+       return False;
+}
+
+// return which of the suit piles can add a card
+CardPile * GameTable::suitAddPile(Card * card)
+{
+       int suit;
+
+       for (suit = 0; suit < MAXSUITS; suit++)
+               if (suitPiles[Suits(suit)]->canTake(card))
+                       return suitPiles[Suits(suit)];
+       (void) printf("suitAddPile\n");
+       return (CardPile *) NULL; // Hopefully we can not get here
+}
+
+// return which of the alternate piles can add a card
+CardPile * GameTable::alternateAddPile(Card * card)
+{
+       int pile;
+
+       for (pile = 0; pile < MAXPILES; pile++)
+               if (alternatePiles[pile]->canTake(card))
+                       return alternatePiles[pile];
+       (void) printf("alternateAddPile\n");
+       return (CardPile *) NULL; // Hopefully we can not get here
+}
+
+/* Yes, it's an ugly mix of 'C' and 'C++' functions */
+extern "C" { void init_solitare(ModeInfo * mi); }
+extern "C" { void draw_solitare(ModeInfo * mi); }
+extern "C" { void change_solitare(ModeInfo * mi); }
+extern "C" { void release_solitare(ModeInfo * mi); }
+extern "C" { void refresh_solitare(ModeInfo * mi); }
+
+#ifndef DISABLE_INTERACTIVE
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-trackmouse", (char *) ".solitare.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+trackmouse", (char *) ".solitare.trackmouse", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"}
+};
+
+ModeSpecOpt solitare_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+#else
+ModeSpecOpt solitare_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+#endif
+
+#ifdef USE_MODULES
+ModStruct solitare_description =
+{(char *) "solitare", (char *) "init_solitare",
+ (char *) "draw_solitare", (char *) "release_solitare",
+ (char *) "refresh_solitare", (char *) "init_solitare",
+ NULL, &solitare_opts,
+ 2000000, 1, 1, 1, 64, 1.0, (char *) "",
+ (char *) "Shows Klondike's game of solitare", 0, NULL};
+#endif
+
+/*
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ *    Xlock hooks.
+ *-----------------------------------------------------------------------------
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Initialize solitare.  Called each time the window changes.
+ *-----------------------------------------------------------------------------
+ */
+
+void
+init_solitare(ModeInfo * mi)
+{
+       solitarestruct *bp;
+
+       if (solitare == NULL) {
+               if ((solitare = (solitarestruct *) calloc(MI_NUM_SCREENS(mi),
+                                       sizeof(solitarestruct))) == NULL)
+               return;
+       }
+       bp = &solitare[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+#ifdef DOFONT
+       Display    *display = MI_DISPLAY(mi);
+       XGCValues gcv;
+
+        if (mode_font == None)
+               mode_font = getFont(display);
+         if (mode_font != None) {
+                       gcv.font = mode_font->fid;
+                       XSetFont(display, MI_GC(mi), mode_font->fid);
+                       gcv.graphics_exposures = False;
+                       gcv.foreground = MI_WHITE_PIXEL(mi);
+                       gcv.background = MI_BLACK_PIXEL(mi);
+                       if ((mp->gc = XCreateGC(display, MI_WINDOW(mi),
+                         GCForeground | GCBackground | GCGraphicsExposures | GCFont,
+                                       &gcv)) == None) {
+                               return;
+                       }
+                       mp->ascent = mode_font->ascent;
+                       mp->height = font_height(mode_font);
+                       for (i = 0; i < 256; i++)
+                               char_width[i] = 8;
+               }
+#endif
+       if (bp->game) {
+               if (bp->width != MI_WIDTH(mi) || bp->height != MI_HEIGHT(mi)) {
+                       /* Let us not be creative then... */
+                       bp->game->Resize(mi);
+                       bp->painted = True;
+                       refresh_solitare(mi);
+                       return;
+               }
+               delete bp->game;
+       }
+       bp->painted = False;
+       if ((bp->game = new GameTable(mi)) == NULL) {
+               return;
+       }
+       if (!bp->game->newGame(mi)) {
+               delete bp->game;
+       }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    Called by the mainline code periodically to update the display.
+ *-----------------------------------------------------------------------------
+ */
+void
+draw_solitare(ModeInfo * mi)
+{
+       solitarestruct *bp;
+
+       if (solitare == NULL)
+               return;
+       bp = &solitare[MI_SCREEN(mi)];
+       if (!bp->game)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       bp->painted = True;
+       if (bp->showend) {
+               bp->showend++;
+               if (bp->showend >= 10)
+                       init_solitare(mi);
+       } else if (trackmouse) {
+               if (!bp->game->HandleMouse(mi)) {
+                       bp->showend++;
+               }
+       } else if (!bp->game->HandleGenerate()) {
+               bp->showend++;
+       }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ *    The display is being taken away from us.  Free up malloc'ed
+ *      memory and X resources that we've alloc'ed.  Only called
+ *      once, we must zap everything for every screen.
+ *-----------------------------------------------------------------------------
+ */
+
+void
+release_solitare(ModeInfo * mi)
+{
+       if (solitare != NULL) {
+               for (int screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       solitarestruct *bp = &solitare[screen];
+
+                       if (bp->game)
+                               delete bp->game;
+               }
+               (void) free((void *) solitare);
+               solitare = (solitarestruct *) NULL;
+       }
+}
+
+void
+refresh_solitare(ModeInfo * mi)
+{
+       solitarestruct *bp;
+
+       if (solitare == NULL)
+               return;
+       bp = &solitare[MI_SCREEN(mi)];
+       if (!bp->game)
+               return;
+
+       if (bp->painted) {
+               bp->game->Redraw(mi);
+         bp->painted = False;
+       }
+}
+
+#endif /* MODE_solitare */
diff --git a/modes/space.c b/modes/space.c
new file mode 100644 (file)
index 0000000..2ef32a7
--- /dev/null
@@ -0,0 +1,450 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* space --- A journey into deep space */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)space.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1998 by Vincent Caron [Vincent.Caron@ecl1999.ec-lyon.fr]
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 1998: Written.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Space"
+#define HACK_INIT init_space
+#define HACK_DRAW draw_space
+#define space_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*count: 100 \n" \
+ "*ncolors: 64 \n" \
+ "*use3d: False \n" \
+ "*delta3d: 1.5 \n" \
+ "*right3d: red \n" \
+ "*left3d: blue \n" \
+ "*both3d: magenta \n" \
+ "*none3d: black \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_space
+
+ModeSpecOpt space_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   space_description =
+{"space", "init_space", "draw_space", "release_space",
+ "refresh_space", "init_space", NULL, &space_opts,
+ 10000, 100, 1, 1, 64, 1.0, "",
+ "a journey into deep space", 0, NULL};
+
+#endif
+
+#define X_LIMIT 400            /* space coords clipping */
+#define Y_LIMIT 300
+#define Z_MAX   450
+#define Z_MIN   (-330)
+#define Z_L2    200            /* far-distance level */
+#define Z_L3    (-150)         /* close-distance level */
+#define DIST    400            /* observer-starfield distance */
+#define TRANS_X_MAX 3          /* cinetic parameters auto-change : */
+#define TRANS_Y_MAX 3          /*   defines limits for cinetic parameters randomizer */
+#define TRANS_Z_MAX 7          /*   idem  */
+#define ROT_X_MAX 60           /*   idem */
+#define ROT_Y_MAX 80           /*   idem */
+#define ROT_Z_MAX 50           /*   idem */
+#define TIME_MIN 500           /*   idem */
+#define TIME_AMP 800           /*   idem */
+#define DEGREE 0.01/100                /* custom angle unit :) */
+
+typedef struct {
+       int         nb;         /* stars number */
+       int         originX, originY;   /* screen width/2,height/2 */
+       double      zoom;       /* adapt to screen dimensions */
+       double     *starX;      /* star buffer */
+       double     *starY;      /*   holds X,Y,Z coords */
+       double     *starZ;
+       int         ddxn, ddyn, ddzn, daxn, dayn, dazn;         /* counters */
+       double      dx, ddx, dy, ddy, dz, ddz, ax, dax, ay, day, az, daz;       /* cinetic params */
+       int         pixel_nb;   /* number of XPoints in last used pixel buffer */
+       XPoint     *stars1;     /* pixel buffer 1 */
+       XPoint     *stars1copy; /*   left eye or 2D mode */
+       XPoint     *stars1a;    /*   two buffers in stars1a,stars1b */
+       XPoint     *stars1b;
+       XPoint     *stars2;     /* pixel buffer 2 */
+       XPoint     *stars2copy; /*   right eye (3D mode only) */
+       XPoint     *stars2a;    /*   two buffers in stars2a,stars2b */
+       XPoint     *stars2b;
+} SpaceStruct;
+
+static SpaceStruct *spaces = NULL;
+
+static void
+free_space(SpaceStruct *sp)
+{
+       if (sp->starX != NULL) {
+               (void) free((void *) sp->starX);
+               sp->starX = NULL;
+       }
+       if (sp->starY != NULL) {
+               (void) free((void *) sp->starY);
+               sp->starY = NULL;
+       }
+       if (sp->starZ != NULL) {
+               (void) free((void *) sp->starZ);
+               sp->starY = NULL;
+       }
+       if (sp->stars1a != NULL) {
+               (void) free((void *) sp->stars1a);
+               sp->stars1a = NULL;
+       }
+       if (sp->stars1b != NULL) {
+               (void) free((void *) sp->stars1b);
+               sp->stars1b = NULL;
+       }
+       if (sp->stars2a != NULL) {
+               (void) free((void *) sp->stars2a);
+               sp->stars2a = NULL;
+       }
+       if (sp->stars2b != NULL) {
+               (void) free((void *) sp->stars2b);
+               sp->stars2b = NULL;
+       }
+}
+
+void
+init_space(ModeInfo * mi)
+{
+       int         i;
+       SpaceStruct *sp;
+
+       /* allocate a SpaceStruct for every screen */
+       if (spaces == NULL) {
+               if ((spaces = (SpaceStruct *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (SpaceStruct))) == NULL)
+                       return;
+       }
+       sp = &spaces[MI_SCREEN(mi)];
+       /* star density is linked to screen surface */
+       sp->nb = MI_COUNT(mi);
+       sp->originX = MI_WIDTH(mi) / 2;
+       sp->originY = MI_HEIGHT(mi) / 2;
+       sp->zoom = (double) MI_WIDTH(mi) * 0.54 + 40;
+
+       /* allocate stars buffers for current screen */
+       if (((sp->starX = (double *) calloc(sp->nb, sizeof (double))) == NULL) ||
+           ((sp->starY = (double *) calloc(sp->nb, sizeof (double))) == NULL) ||
+           ((sp->starZ = (double *) calloc(sp->nb, sizeof (double))) == NULL)) {
+               free_space(sp);
+               return;
+       }
+
+       /* allocate pixels buffers for current screen */
+       if (((sp->stars1a = (XPoint *) calloc(9 * sp->nb,
+                       sizeof (XPoint))) == NULL) ||
+           ((sp->stars1b = (XPoint *) calloc(9 * sp->nb,
+                       sizeof (XPoint))) == NULL)) {
+               free_space(sp);
+               return;
+       }
+       if (MI_IS_USE3D(mi)) {
+               if (((sp->stars2a = (XPoint *) calloc(9 * sp->nb,
+                               sizeof (XPoint))) == NULL) ||
+                   ((sp->stars2b = (XPoint *) calloc(9 * sp->nb,
+                               sizeof (XPoint))) == NULL)) {
+                       free_space(sp);
+                       return;
+               }
+       }
+       sp->pixel_nb = 0;
+       sp->stars1 = sp->stars1a;
+       sp->stars1copy = sp->stars1b;
+       sp->stars2 = sp->stars2a;
+       sp->stars2copy = sp->stars2b;
+
+       /* place stars randomly */
+       for (i = 0; i < sp->nb; i++) {
+               sp->starX[i] = ((double) NRAND(10000) / 5000 - 1) * X_LIMIT;
+               sp->starY[i] = ((double) NRAND(10000) / 5000 - 1) * Y_LIMIT;
+               sp->starZ[i] = (double) NRAND(10000) / 10000 * (Z_MAX - Z_MIN) + Z_MIN;
+       }
+       sp->dx = 0;
+       sp->ddxn = 0;
+       sp->dy = 0;
+       sp->ddyn = 0;
+       sp->dz = 3;
+       sp->ddzn = 0;
+       sp->ax = 0;
+       sp->daxn = 0;
+       sp->ay = 0;
+       sp->dayn = 0;
+       sp->az = 0;
+       sp->dazn = 0;
+
+       /* clear screen */
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_space(ModeInfo * mi)
+{
+       int         i, n, originX, originY, x, x2 = 0, y, IS_SMALL;
+       double      _x, _y, _z, cosX, sinX, cosY, sinY, cosZ, sinZ, k, z, zoom;
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         is3D = MI_IS_USE3D(mi);
+       double      delta = MI_DELTA3D(mi) * 8;
+       SpaceStruct *sp;
+
+       if (spaces == NULL)
+               return;
+       sp = &spaces[MI_SCREEN(mi)];
+       if (sp->stars1a == NULL)
+               return;
+       originX = sp->originX;
+       originY = sp->originY;
+       zoom = sp->zoom;
+       IS_SMALL = ((originX * originY) < (160 * 100));
+
+       /* get cos & sin of rotations */
+       cosX = COSF(sp->ax);
+       sinX = SINF(sp->ax);
+       cosY = COSF(sp->ay);
+       sinY = SINF(sp->ay);
+       cosZ = COSF(sp->az);
+       sinZ = SINF(sp->az);
+
+       /* move stars ! */
+       for (i = 0; i < sp->nb; i++) {
+               _x = sp->starX[i];
+               _y = sp->starY[i];
+               _z = sp->starZ[i];
+
+               /* X,Y & Z axis rotations */
+               k = _y * cosX + _z * sinX;
+               _z = _z * cosX - _y * sinX;
+               _y = k;
+               k = _x * cosY + _z * sinY;
+               _z = _z * cosY - _x * sinY;
+               _x = k;
+               k = _x * cosZ + _y * sinZ;
+               _y = _y * cosZ - _x * sinZ;
+               _x = k;
+
+               /* translations + space boundary overflow */
+               _x += sp->dx;
+               if (_x < (-X_LIMIT))
+                       _x = X_LIMIT;
+               else if (_x > X_LIMIT)
+                       _x = -X_LIMIT;
+               _y += sp->dy;
+               if (_y < (-Y_LIMIT))
+                       _y = Y_LIMIT;
+               else if (_y > Y_LIMIT)
+                       _y = -Y_LIMIT;
+               _z -= sp->dz;
+               if (_z < Z_MIN)
+                       _z = Z_MAX;
+               else if (_z > Z_MAX)
+                       _z = Z_MIN;
+
+               sp->starX[i] = _x;
+               sp->starY[i] = _y;
+               sp->starZ[i] = _z;
+       }
+
+       /* update translation parameters */
+       if (sp->ddxn == 0) {
+               k = (double) NRAND(TRANS_X_MAX * 2) - TRANS_X_MAX;
+               sp->ddxn = (int) NRAND(TIME_AMP) + TIME_MIN;
+               sp->ddx = (k - sp->dx) / sp->ddxn;
+       } else {
+               sp->dx += sp->ddx;
+               sp->ddxn--;
+       }
+       if (sp->ddyn == 0) {
+               k = (double) NRAND(TRANS_Y_MAX * 2) - TRANS_Y_MAX;
+               sp->ddyn = (int) NRAND(TIME_AMP) + TIME_MIN;
+               sp->ddy = (k - sp->dy) / sp->ddyn;
+       } else {
+               sp->dy += sp->ddy;
+               sp->ddyn--;
+       }
+       if (sp->ddzn == 0) {
+               k = (double) NRAND(TRANS_Z_MAX * 2) - TRANS_Z_MAX;
+               sp->ddzn = (int) NRAND(TIME_AMP) + TIME_MIN;
+               sp->ddz = (k - sp->dz) / sp->ddzn;
+       } else {
+               sp->dz += sp->ddz;
+               sp->ddzn--;
+       }
+
+       /* update rotation parameters */
+       if (sp->daxn == 0) {
+               k = (double) (NRAND(ROT_X_MAX * 2) - ROT_X_MAX) * DEGREE;
+               sp->daxn = (int) NRAND(TIME_AMP) + TIME_MIN;
+               sp->dax = (k - sp->ax) / sp->daxn;
+       } else {
+               sp->ax += sp->dax;
+               sp->daxn--;
+       }
+       if (sp->dayn == 0) {
+               k = (double) (NRAND(ROT_Y_MAX * 2) - ROT_Y_MAX) * DEGREE;
+               sp->dayn = (int) NRAND(TIME_AMP) + TIME_MIN;
+               sp->day = (k - sp->ay) / sp->dayn;
+       } else {
+               sp->ay += sp->day;
+               sp->dayn--;
+       }
+       if (sp->dazn == 0) {
+               k = (double) (NRAND(ROT_Z_MAX * 2) - ROT_Z_MAX) * DEGREE;
+               sp->dazn = (int) NRAND(TIME_AMP) + TIME_MIN;
+               sp->daz = (k - sp->az) / sp->dazn;
+       } else {
+               sp->az += sp->daz;
+               sp->dazn--;
+       }
+
+       /* project stars and create corresponding pixels */
+       n = 0;
+       for (i = 0; i < sp->nb; i++) {
+               z = sp->starZ[i];
+               k = zoom / (z + DIST);
+               y = sp->stars1[n].y = originY - (int) (k * sp->starY[i]);
+               if (is3D) {
+                       x = sp->stars1[n].x = originX + (int) (k * (sp->starX[i] - delta));
+                       x2 = sp->stars2[n].x = originX + (int) (k * (sp->starX[i] + delta));
+                       sp->stars2[n].y = y;
+               } else
+                       x = sp->stars1[n].x = originX + (int) (k * sp->starX[i]);
+               n++;
+               if (z < Z_L2) {
+                       /* not to close but closer : use 4 more pixels for this star */
+                       sp->stars1[n].x = x + 1;
+                       sp->stars1[n].y = y;
+                       sp->stars1[n + 1].x = x - 1;
+                       sp->stars1[n + 1].y = y;
+                       sp->stars1[n + 2].x = x;
+                       sp->stars1[n + 2].y = y + 1;
+                       sp->stars1[n + 3].x = x;
+                       sp->stars1[n + 3].y = y - 1;
+                       if (is3D) {
+                               sp->stars2[n].x = x2 + 1;
+                               sp->stars2[n].y = y;
+                               sp->stars2[n + 1].x = x2 - 1;
+                               sp->stars2[n + 1].y = y;
+                               sp->stars2[n + 2].x = x2;
+                               sp->stars2[n + 2].y = y + 1;
+                               sp->stars2[n + 3].x = x2;
+                               sp->stars2[n + 3].y = y - 1;
+                       }
+                       n += 4;
+               }
+               if ((z < Z_L3) && (!IS_SMALL)) {
+                       /* very close : use again 4 more pixels (makes 9 for this star) */
+                       sp->stars1[n].x = x - 1;
+                       sp->stars1[n].y = y + 1;
+                       sp->stars1[n + 1].x = x - 1;
+                       sp->stars1[n + 1].y = y - 1;
+                       sp->stars1[n + 2].x = x + 1;
+                       sp->stars1[n + 2].y = y + 1;
+                       sp->stars1[n + 3].x = x + 1;
+                       sp->stars1[n + 3].y = y - 1;
+                       if (is3D) {
+                               sp->stars2[n].x = x2 - 1;
+                               sp->stars2[n].y = y + 1;
+                               sp->stars2[n + 1].x = x2 - 1;
+                               sp->stars2[n + 1].y = y - 1;
+                               sp->stars2[n + 2].x = x2 + 1;
+                               sp->stars2[n + 2].y = y + 1;
+                               sp->stars2[n + 3].x = x2 + 1;
+                               sp->stars2[n + 3].y = y - 1;
+                       }
+                       n += 4;
+               }
+       }
+
+       /* erase pixels with previous pixel buffer */
+       if (MI_IS_INSTALL(mi) && is3D)
+               XSetForeground(display, gc, MI_NONE_COLOR(mi));
+       else
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       XDrawPoints(display, window, gc, sp->stars1copy, sp->pixel_nb, CoordModeOrigin);
+       if (is3D)
+               XDrawPoints(display, window, gc, sp->stars2copy, sp->pixel_nb, CoordModeOrigin);
+
+       /* draw pixels */
+       sp->pixel_nb = n;
+       if (is3D) {
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXor);
+               XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               XDrawPoints(display, window, gc, sp->stars1, sp->pixel_nb, CoordModeOrigin);
+               XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+               XDrawPoints(display, window, gc, sp->stars2, sp->pixel_nb, CoordModeOrigin);
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXcopy);
+       } else {
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               XDrawPoints(display, window, gc, sp->stars1, sp->pixel_nb, CoordModeOrigin);
+       }
+       XFlush(display);
+
+       /* swap pixel buffers a & b */
+       if (sp->stars1 == sp->stars1a) {
+               sp->stars1 = sp->stars1b;
+               sp->stars1copy = sp->stars1a;
+       } else {
+               sp->stars1 = sp->stars1a;
+               sp->stars1copy = sp->stars1b;
+       }
+       if (sp->stars2 == sp->stars2a) {
+               sp->stars2 = sp->stars2b;
+               sp->stars2copy = sp->stars2a;
+       } else {
+               sp->stars2 = sp->stars2a;
+               sp->stars2copy = sp->stars2b;
+       }
+}
+
+void
+refresh_space(ModeInfo * mi)
+{
+       /* Do nothing, it will refresh by itself */
+}
+
+void
+release_space(ModeInfo * mi)
+{
+       if (spaces != NULL) {
+               int screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_space(&spaces[screen]);
+               (void) free((void *) spaces);
+               spaces = NULL;
+       }
+}
+
+#endif /* MODE_space */
diff --git a/modes/sphere.c b/modes/sphere.c
new file mode 100644 (file)
index 0000000..fde3fe1
--- /dev/null
@@ -0,0 +1,306 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* sphere --- a bunch of shaded spheres */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)sphere.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1988 by Sun Microsystems
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 30-May-1997: <jwz@jwz.org> made it go vertically as well as horizontally.
+ * 27-May-1997: <jwz@jwz.org> turned into a standalone program.
+ * 02-Sep-1993: xlock version David Bagley <bagleyd@tux.org>
+ * 1988: Revised to use SunView canvas instead of gfxsw Sun Microsystems
+ * 1982: Orignal Algorithm Tom Duff Lucasfilm Ltd.
+ */
+
+/*-
+ * original copyright
+ * **************************************************************************
+ * Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, 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 Sun or MIT not be used in advertising
+ * or publicity pertaining to distribution of the software without specific
+ * prior written permission. Sun and M.I.T. make no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without any express or implied warranty.
+ *
+ * SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * IN NO EVENT SHALL SUN 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.
+ * ***************************************************************************
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Sphere"
+#define HACK_INIT init_sphere
+#define HACK_DRAW draw_sphere
+#define sphere_opts xlockmore_opts
+#define DEFAULTS "*delay: 5000 \n" \
+ "*cycles: 20 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 64 \n"
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_sphere
+
+ModeSpecOpt sphere_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   sphere_description =
+{"sphere", "init_sphere", "draw_sphere", "release_sphere",
+ "refresh_sphere", "init_sphere", NULL, &sphere_opts,
+ 5000, 1, 20, 0, 64, 1.0, "",
+ "Shows a bunch of shaded spheres", 0, NULL};
+
+#endif
+
+/*-
+ * (NX, NY, NZ) is the light source vector -- length should be 100
+ */
+#define NX 48
+#define NY (-36)
+#define NZ 80
+#define NR 100
+#define SQRT(a) ((int)sqrt((double)(a)))
+
+typedef struct {
+       int         width, height;
+       int         radius;
+       int         x0;         /* x center */
+       int         y0;         /* y center */
+       int         color;
+       int         x, y;
+       int         dirx, diry;
+       int         shadowx, shadowy;
+       int         maxx, maxy;
+       XPoint     *points;
+} spherestruct;
+
+static spherestruct *spheres = NULL;
+
+void
+init_sphere(ModeInfo * mi)
+{
+       spherestruct *sp;
+
+       if (spheres == NULL) {
+               if ((spheres = (spherestruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (spherestruct))) == NULL)
+                       return;
+       }
+       sp = &spheres[MI_SCREEN(mi)];
+
+       if (sp->points != NULL) {
+               (void) free((void *) sp->points);
+               sp->points = NULL;
+       }
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+       if ((sp->points = (XPoint *) malloc(MIN(sp->width, sp->height) *
+                        sizeof (XPoint))) == NULL) {
+               return;
+       }
+
+       MI_CLEARWINDOW(mi);
+
+       sp->dirx = 1;
+       sp->x = sp->radius;
+       sp->shadowx = (LRAND() & 1) ? 1 : -1;
+       sp->shadowy = (LRAND() & 1) ? 1 : -1;
+}
+
+void
+draw_sphere(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       int         sqrd, nd;
+       register int minx = 0, maxx = 0, miny = 0, maxy = 0, npts = 0;
+       spherestruct *sp;
+
+       if (spheres == NULL)
+               return;
+       sp = &spheres[MI_SCREEN(mi)];
+       if (sp->points == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if ((sp->dirx && ABS(sp->x) >= sp->radius) ||
+           (sp->diry && ABS(sp->y) >= sp->radius)) {
+               sp->radius = NRAND(MIN(sp->width / 2, sp->height / 2) - 1) + 1;
+
+               if (LRAND() & 1) {
+                       sp->dirx = (int) (LRAND() & 1) * 2 - 1;
+                       sp->diry = 0;
+               } else {
+                       sp->dirx = 0;
+                       sp->diry = (int) (LRAND() & 1) * 2 - 1;
+               }
+               sp->x0 = NRAND(sp->width);
+               sp->y0 = NRAND(sp->height);
+
+               sp->x = -sp->radius * sp->dirx;
+               sp->y = -sp->radius * sp->diry;
+
+               if (MI_NPIXELS(mi) > 2)
+                       sp->color = NRAND(MI_NPIXELS(mi));
+       }
+       if (sp->dirx == 1) {
+               if (sp->x0 + sp->x < 0)
+                       sp->x = -sp->x0;
+       } else if (sp->dirx == -1) {
+               if (sp->x0 + sp->x >= sp->width)
+                       sp->x = sp->width - sp->x0 - 1;
+       }
+       if (sp->diry == 1) {
+               if (sp->y0 + sp->y < 0)
+                       sp->y = -sp->y0;
+       } else if (sp->diry == -1) {
+               if (sp->y0 + sp->y >= sp->height)
+                       sp->y = sp->height - sp->y0 - 1;
+       }
+       if (sp->dirx) {
+               sp->maxy = SQRT(sp->radius * sp->radius - sp->x * sp->x);
+               miny = -sp->maxy;
+               if (sp->y0 - sp->maxy < 0)
+                       miny = -sp->y0;
+               maxy = sp->maxy;
+       }
+       if (sp->diry) {
+               sp->maxx = SQRT(sp->radius * sp->radius - sp->y * sp->y);
+               minx = -sp->maxx;
+               if (sp->x0 - sp->maxx < 0)
+                       minx = -sp->x0;
+               maxx = sp->maxx;
+       }
+       if (sp->dirx) {
+               if (sp->y0 + sp->maxy >= sp->height)
+                       maxy = sp->height - sp->y0;
+       }
+       if (sp->diry) {
+               if (sp->x0 + sp->maxx >= sp->width)
+                       maxx = sp->width - sp->x0;
+       }
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+       if (sp->dirx)
+               XDrawLine(display, MI_WINDOW(mi), gc,
+               sp->x0 + sp->x, sp->y0 + miny, sp->x0 + sp->x, sp->y0 + maxy);
+       if (sp->diry)
+               XDrawLine(display, MI_WINDOW(mi), gc,
+               sp->x0 + minx, sp->y0 + sp->y, sp->x0 + maxx, sp->y0 + sp->y);
+
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, sp->color));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       if (sp->dirx) {
+               sqrd = sp->radius * sp->radius - sp->x * sp->x;
+               nd = NX * sp->shadowx * sp->x;
+               for (sp->y = miny; sp->y <= maxy; sp->y++)
+                       if ((NRAND(sp->radius * NR)) <= nd + NY * sp->shadowy * sp->y +
+                           NZ * SQRT(sqrd - sp->y * sp->y)) {
+                               sp->points[npts].x = sp->x + sp->x0;
+                               sp->points[npts].y = sp->y + sp->y0;
+                               npts++;
+                       }
+       }
+       if (sp->diry) {
+               sqrd = sp->radius * sp->radius - sp->y * sp->y;
+               nd = NY * sp->shadowy * sp->y;
+               for (sp->x = minx; sp->x <= maxx; sp->x++)
+                       if ((NRAND(sp->radius * NR)) <= NX * sp->shadowx * sp->x + nd +
+                           NZ * SQRT(sqrd - sp->x * sp->x)) {
+                               sp->points[npts].x = sp->x + sp->x0;
+                               sp->points[npts].y = sp->y + sp->y0;
+                               npts++;
+                       }
+       }
+       XDrawPoints(display, MI_WINDOW(mi), gc, sp->points, npts, CoordModeOrigin);
+       if (sp->dirx == 1) {
+               sp->x++;
+               if (sp->x0 + sp->x >= sp->width)
+                       sp->x = sp->radius;
+       } else if (sp->dirx == -1) {
+               sp->x--;
+               if (sp->x0 + sp->x < 0)
+                       sp->x = -sp->radius;
+       }
+       if (sp->diry == 1) {
+               sp->y++;
+               if (sp->y0 + sp->y >= sp->height)
+                       sp->y = sp->radius;
+       } else if (sp->diry == -1) {
+               sp->y--;
+               if (sp->y0 + sp->y < 0)
+                       sp->y = -sp->radius;
+       }
+}
+
+void
+release_sphere(ModeInfo * mi)
+{
+       if (spheres != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       spherestruct *sp = &spheres[screen];
+
+                       if (sp->points) {
+                               (void) free((void *) sp->points);
+                               /* sp->points = NULL; */
+                       }
+               }
+               (void) free((void *) spheres);
+               spheres = NULL;
+       }
+}
+
+void
+refresh_sphere(ModeInfo * mi)
+{
+       spherestruct *sp;
+
+       if (spheres == NULL)
+               return;
+       sp = &spheres[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+
+       sp->x = -sp->radius;
+}
+
+#endif /* MODE_sphere */
diff --git a/modes/spiral.c b/modes/spiral.c
new file mode 100644 (file)
index 0000000..3daa040
--- /dev/null
@@ -0,0 +1,329 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* spiral --- spiraling dots */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)spiral.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1994 by Darrick Brown.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: jwz@jwz.org: turned into a standalone program.
+ * 24-Jul-1995: Fix to allow cycles not to have an arbitrary value by
+ *              Peter Schmitzberger (schmitz@coma.sbg.ac.at).
+ * 06-Mar-1995: Finished cleaning up and final testing.
+ * 03-Mar-1995: Cleaned up code.
+ * 12-Jul-1994: Written.
+ *
+ * Low CPU usage mode.
+ * Idea based on a graphics demo I saw a *LONG* time ago.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Spiral"
+#define HACK_INIT init_spiral
+#define HACK_DRAW draw_spiral
+#define spiral_opts xlockmore_opts
+#define DEFAULTS "*delay: 5000 \n" \
+ "*count: -40 \n" \
+ "*cycles: 350 \n" \
+ "*ncolors: 64 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_spiral
+
+ModeSpecOpt spiral_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   spiral_description =
+{"spiral", "init_spiral", "draw_spiral", "release_spiral",
+ "refresh_spiral", "init_spiral", NULL, &spiral_opts,
+ 5000, -40, 350, 1, 64, 1.0, "",
+ "Shows a helical locus of points", 0, NULL};
+
+#endif
+
+#define MAXTRAIL 512           /* The length of the trail */
+#define MAXDOTS 40
+#define MINDOTS 1
+#define TWOPI (2.0*M_PI)       /* for convienence */
+#define JAGGINESS 4            /* This sets the "Craziness" of the spiral (I like 4) */
+#define SPEED 2.0
+
+/* How many segments to draw per cycle when redrawing */
+#define REDRAWSTEP 3
+
+
+typedef struct {
+       float       hx, hy, ha, hr;
+} Traildots;
+
+typedef struct {
+       Traildots  *traildots;
+       float       cx, cy;
+       float       angle;
+       float       radius;
+       float       dr, da;
+       float       dx, dy;
+       int         erase;
+       int         inc;
+       float       colors;
+       int         width, height;
+       float       top, bottom, left, right;
+       int         dots, nlength;
+       int         redrawing, redrawpos;
+} spiralstruct;
+
+static spiralstruct *spirals = NULL;
+
+static void draw_dots(ModeInfo * mi, int in);
+
+#define TFX(sp,x) ((int)((x/sp->right)*(float)sp->width))
+#define TFY(sp,y) ((int)((y/sp->top)*(float)sp->height))
+
+static void
+draw_dots(ModeInfo * mi, int in)
+{
+
+       float       i, inc;
+       float       x, y;
+
+       spiralstruct *sp = &spirals[MI_SCREEN(mi)];
+
+       inc = TWOPI / (float) sp->dots;
+       for (i = 0.0; i < TWOPI; i += inc) {
+               x = sp->traildots[in].hx + COSF(i + sp->traildots[in].ha) *
+                       sp->traildots[in].hr;
+               y = sp->traildots[in].hy + SINF(i + sp->traildots[in].ha) *
+                       sp->traildots[in].hr;
+               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+                          TFX(sp, x), TFY(sp, y));
+       }
+}
+
+void
+init_spiral(ModeInfo * mi)
+{
+       spiralstruct *sp;
+       int         i;
+
+       if (spirals == NULL) {
+               if ((spirals = (spiralstruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (spiralstruct))) == NULL)
+                       return;
+       }
+       sp = &spirals[MI_SCREEN(mi)];
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+
+       MI_CLEARWINDOW(mi);
+
+       /* Init */
+       sp->nlength = MI_CYCLES(mi);
+
+       if (!sp->traildots)
+               if ((sp->traildots = (Traildots *) malloc(sp->nlength *
+                               sizeof (Traildots))) == NULL) {
+                       return;
+               }
+
+       /* initialize the allocated array */
+       for (i = 0; i < sp->nlength; i++) {
+               sp->traildots[i].hx = 0.0;
+               sp->traildots[i].hy = 0.0;
+               sp->traildots[i].ha = 0.0;
+               sp->traildots[i].hr = 0.0;
+       }
+       sp->redrawing = 0;
+
+       /* keep the window parameters proportional */
+       sp->top = 10000.0;
+       sp->bottom = 0;
+       sp->right = (float) (sp->width) / (float) (sp->height) * (10000.0);
+       sp->left = 0;
+
+       /* assign the initial values */
+       sp->cx = (float) (5000.0 - NRAND(2000)) / 10000.0 * sp->right;
+       sp->cy = (float) (5000.0 - NRAND(2000));
+       sp->radius = (float) (NRAND(200) + 200);
+       sp->angle = 0.0;
+       sp->dx = (float) (10 - NRAND(20)) * SPEED;
+       sp->dy = (float) (10 - NRAND(20)) * SPEED;
+       sp->dr = (float) ((NRAND(10) + 4) * (1 - (LRAND() & 1) * 2));
+       sp->da = (float) NRAND(360) / 7200.0 + 0.01;
+       if (MI_NPIXELS(mi) > 2)
+               sp->colors = (float) NRAND(MI_NPIXELS(mi));
+       sp->erase = 0;
+       sp->inc = 0;
+       sp->traildots[sp->inc].hx = sp->cx;
+       sp->traildots[sp->inc].hy = sp->cy;
+       sp->traildots[sp->inc].ha = sp->angle;
+       sp->traildots[sp->inc].hr = sp->radius;
+       sp->inc++;
+
+       sp->dots = MI_COUNT(mi);
+       if (sp->dots < -MINDOTS)
+               sp->dots = NRAND(sp->dots - MINDOTS + 1) + MINDOTS;
+       /* Absolute minimum */
+       if (sp->dots < MINDOTS)
+               sp->dots = MINDOTS;
+}
+
+void
+draw_spiral(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       int         i, j;
+       spiralstruct *sp;
+
+       if (spirals == NULL)
+               return;
+       sp = &spirals[MI_SCREEN(mi)];
+       if (sp->traildots == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (sp->erase == 1) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               draw_dots(mi, sp->inc);
+       }
+       sp->cx += sp->dx;
+       sp->traildots[sp->inc].hx = sp->cx;
+
+       if ((sp->cx > 9000.0) || (sp->cx < 1000.0))
+               sp->dx *= -1.0;
+
+       sp->cy += sp->dy;
+       sp->traildots[sp->inc].hy = sp->cy;
+
+       if ((sp->cy > 9000.0) || (sp->cy < 1000.0))
+               sp->dy *= -1.0;
+
+       sp->radius += sp->dr;
+       sp->traildots[sp->inc].hr = sp->radius;
+
+       if ((sp->radius > 2500.0) && (sp->dr > 0.0))
+               sp->dr *= -1.0;
+       else if ((sp->radius < 50.0) && (sp->radius < 0.0))
+               sp->dr *= -1.0;
+
+       /* Randomly give some variations to:  */
+
+       /* spiral direction (if it is within the boundaries) */
+       if ((NRAND(3000) < 1 * JAGGINESS) &&
+           (((sp->cx > 2000.0) && (sp->cx < 8000.0)) &&
+            ((sp->cy > 2000.0) && (sp->cy < 8000.0)))) {
+               sp->dx = (float) (10 - NRAND(20)) * SPEED;
+               sp->dy = (float) (10 - NRAND(20)) * SPEED;
+       }
+       /* The speed of the change in size of the spiral */
+       if (NRAND(3000) < 1 * JAGGINESS) {
+               if (LRAND() & 1)
+                       sp->dr += (float) (NRAND(3) + 1);
+               else
+                       sp->dr -= (float) (NRAND(3) + 1);
+
+               /* don't let it get too wild */
+               if (sp->dr > 18.0)
+                       sp->dr = 18.0;
+               else if (sp->dr < 4.0)
+                       sp->dr = 4.0;
+       }
+       /* The speed of rotation */
+       if (NRAND(3000) < 1 * JAGGINESS)
+               sp->da = (float) NRAND(360) / 7200.0 + 0.01;
+
+       /* Reverse rotation */
+       if (NRAND(3000) < 1 * JAGGINESS)
+               sp->da *= -1.0;
+
+       sp->angle += sp->da;
+       sp->traildots[sp->inc].ha = sp->angle;
+
+       if (sp->angle > TWOPI)
+               sp->angle -= TWOPI;
+       else if (sp->angle < 0.0)
+               sp->angle += TWOPI;
+
+       sp->colors += (float) MI_NPIXELS(mi) / ((float) (2 * sp->nlength));
+       if (sp->colors >= (float) MI_NPIXELS(mi))
+               sp->colors = 0.0;
+
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(display, gc, MI_PIXEL(mi, (int) sp->colors));
+       else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       draw_dots(mi, sp->inc);
+       sp->inc++;
+
+       if (sp->inc > sp->nlength - 1) {
+               sp->inc -= sp->nlength;
+               sp->erase = 1;
+       }
+       if (sp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       j = (sp->inc - sp->redrawpos + sp->nlength) % sp->nlength;
+                       draw_dots(mi, j);
+
+                       if (++(sp->redrawpos) >= sp->nlength) {
+                               sp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
+release_spiral(ModeInfo * mi)
+{
+       if (spirals != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       spiralstruct *sp = &spirals[screen];
+
+                       if (sp->traildots)
+                               (void) free((void *) sp->traildots);
+               }
+               (void) free((void *) spirals);
+               spirals = NULL;
+       }
+}
+
+void
+refresh_spiral(ModeInfo * mi)
+{
+       spiralstruct *sp;
+
+       if (spirals == NULL)
+               return;
+       sp = &spirals[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       sp->redrawing = 1;
+       sp->redrawpos = 0;
+}
+
+#endif /* MODE_spiral */
diff --git a/modes/spline.c b/modes/spline.c
new file mode 100644 (file)
index 0000000..463f50c
--- /dev/null
@@ -0,0 +1,458 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* spline --- spline fun */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)spline.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1992 by Jef Poskanzer
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000:
+ * 10-May-1997: Compatible with xscreensaver
+ * 13-Sep-1996: changed FOLLOW to a runtime option "-erase"
+ * 17-Jan-1996: added compile time option, FOLLOW to erase old splines like Qix
+ *              thanks to Richard Duran <rduran@cs.utep.edu>
+ * 09-Mar-1995: changed how batchcount is used
+ * 02-Sep-1993: xlock version: David Bagley <bagleyd@tux.org>
+ *              reminds me of a great "Twilight Zone" episode.
+ * 1992: X11 version Jef Poskanzer <jef@netcom.com>, <jef@well.sf.ca.us>
+ *
+ * spline fun #3
+ */
+
+/*-
+ * original copyright
+ * xsplinefun.c - X11 version of spline fun #3
+ * Displays colorful moving splines in the X11 root window.
+ * Copyright (C) 1992 by Jef Poskanzer
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  This software is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Spline"
+#define HACK_INIT init_spline
+#define HACK_DRAW draw_spline
+#define spline_opts xlockmore_opts
+#define DEFAULTS "*delay: 30000 \n" \
+ "*count: -6 \n" \
+ "*cycles: 2048 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n"
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_spline
+
+#define DEF_ERASE  "False"
+
+static Bool erase;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-erase", (char *) ".spline.erase", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+erase", (char *) ".spline.erase", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & erase, (char *) "erase", (char *) "Erase", (char *) DEF_ERASE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+erase", (char *) "turn on/off the following erase of splines"}
+};
+
+ModeSpecOpt spline_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   spline_description =
+{"spline", "init_spline", "draw_spline", "release_spline",
+ "refresh_spline", "init_spline", NULL, &spline_opts,
+ 30000, -6, 2048, 1, 64, 0.3, "",
+ "Shows colorful moving splines", 0, NULL};
+
+#endif
+
+#define MINPOINTS 3
+
+/* How many segments to draw per cycle when redrawing */
+#define REDRAWSTEP 3
+
+#define SPLINE_THRESH 5
+
+typedef struct {
+       XPoint      pos, delta;
+} splinepointstruct;
+
+typedef struct {
+       /* ERASE stuff */
+       int         first;
+       int         last;
+       int         max_delta;
+       XPoint    **splineq;
+       int         redrawing, redrawpos;
+       Bool        erase;
+
+       int         width;
+       int         height;
+       int         color;
+       int         points;
+       int         nsplines;
+       splinepointstruct *pt;
+} splinestruct;
+
+static splinestruct *splines = NULL;
+
+static void XDrawSpline(Display * display, Drawable d, GC gc,
+                       int x0, int y0, int x1, int y1, int x2, int y2);
+
+static void
+free_spline(splinestruct *sp)
+{
+
+       if (sp->pt != NULL) {
+               (void) free((void *) sp->pt);
+               sp->pt = NULL;
+       }
+       if (sp->splineq != NULL) {
+               int         spline;
+
+               for (spline = 0; spline < sp->nsplines; ++spline)
+                       if (sp->splineq[spline] != NULL)
+                               (void) free((void *) sp->splineq[spline]);
+               (void) free((void *) sp->splineq);
+               sp->splineq = NULL;
+       }
+}
+
+void
+init_spline(ModeInfo * mi)
+{
+       int         i;
+       splinestruct *sp;
+
+       if (splines == NULL) {
+               if ((splines = (splinestruct *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (splinestruct))) == NULL)
+                       return;
+       }
+       sp = &splines[MI_SCREEN(mi)];
+
+       if (MI_IS_FULLRANDOM(mi))
+               sp->erase = (Bool) (LRAND() & 1);
+       else
+               sp->erase = erase;
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+       /* batchcount is the upper bound on the number of points */
+       sp->points = MI_COUNT(mi);
+       if (sp->points < -MINPOINTS) {
+               if (sp->pt) {
+                       (void) free((void *) sp->pt);
+                       sp->pt = NULL;
+               }
+               if (sp->erase) {
+                       if (sp->splineq)
+                               for (i = 0; i < sp->nsplines; ++i)
+                                       if (sp->splineq[i]) {
+                                               (void) free((void *) sp->splineq[i]);
+                                               sp->splineq[i] = NULL;
+                                       }
+               }
+               sp->points = NRAND(-sp->points - MINPOINTS + 1) + MINPOINTS;
+       } else if (sp->points < MINPOINTS)
+               sp->points = MINPOINTS;
+       if (sp->pt == NULL)
+               if ((sp->pt = (splinepointstruct *) malloc(sp->points *
+                               sizeof (splinepointstruct))) == NULL) {
+                       free_spline(sp);
+                       return;
+               }
+
+       if (sp->erase) {
+               sp->max_delta = 16;
+               sp->redrawing = 0;
+               sp->last = 0;
+               sp->nsplines = MI_CYCLES(mi) / 64 + 1;  /* So as to be compatible */
+               if (sp->splineq == NULL)
+                       if ((sp->splineq = (XPoint **) calloc(sp->nsplines,
+                                       sizeof (XPoint *))) == NULL) {
+                               free_spline(sp);
+                               return;
+                       }
+               for (i = 0; i < sp->nsplines; ++i)
+                       if (sp->splineq[i] == NULL)
+                               if ((sp->splineq[i] = (XPoint *) calloc(sp->points,
+                                               sizeof (XPoint))) == NULL) {
+                                       free_spline(sp);
+                                       return;
+                               }
+       } else {
+               sp->max_delta = 3;
+               sp->nsplines = 0;
+       }
+
+       MI_CLEARWINDOW(mi);
+
+       /* Initialize points. */
+       for (i = 0; i < sp->points; ++i) {
+               sp->pt[i].pos.x = NRAND(sp->width);
+               sp->pt[i].pos.y = NRAND(sp->height);
+               sp->pt[i].delta.x = NRAND(sp->max_delta * 2) - sp->max_delta;
+               if (sp->pt[i].delta.x <= 0 && sp->width > 1)
+                       --sp->pt[i].delta.x;
+               sp->pt[i].delta.y = NRAND(sp->max_delta * 2) - sp->max_delta;
+               if (sp->pt[i].delta.y <= 0 && sp->height > 1)
+                       --sp->pt[i].delta.y;
+       }
+       if (MI_NPIXELS(mi) > 2)
+               sp->color = NRAND(MI_NPIXELS(mi));
+}
+
+void
+draw_spline(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         i, t, px, py, zx, zy, nx, ny;
+       splinestruct *sp;
+
+       if (splines == NULL)
+               return;
+       sp = &splines[MI_SCREEN(mi)];
+       if (sp->pt == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (sp->erase)
+               sp->first = (sp->last + 2) % sp->nsplines;
+
+       /* Move the points. */
+       for (i = 0; i < sp->points; i++) {
+               for (;;) {
+                       t = sp->pt[i].pos.x + sp->pt[i].delta.x;
+                       if (t >= 0 && t < sp->width)
+                               break;
+                       sp->pt[i].delta.x = NRAND(sp->max_delta * 2) - sp->max_delta;
+                       if (sp->pt[i].delta.x <= 0 && sp->width > 1)
+                               --sp->pt[i].delta.x;
+               }
+               sp->pt[i].pos.x = t;
+               for (;;) {
+                       t = sp->pt[i].pos.y + sp->pt[i].delta.y;
+                       if (t >= 0 && t < sp->height)
+                               break;
+                       sp->pt[i].delta.y = NRAND(sp->max_delta * 2) - sp->max_delta;
+                       if (sp->pt[i].delta.y <= 0 && sp->height > 1)
+                               --sp->pt[i].delta.y;
+               }
+               sp->pt[i].pos.y = t;
+       }
+
+       if (sp->erase) {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+               /* Erase first figure. */
+               px = zx = (sp->splineq[sp->first][0].x +
+                          sp->splineq[sp->first][sp->points - 1].x) / 2;
+               py = zy = (sp->splineq[sp->first][0].y +
+                          sp->splineq[sp->first][sp->points - 1].y) / 2;
+               for (i = 0; i < sp->points - 1; ++i) {
+                       nx = (sp->splineq[sp->first][i + 1].x +
+                             sp->splineq[sp->first][i].x) / 2;
+                       ny = (sp->splineq[sp->first][i + 1].y +
+                             sp->splineq[sp->first][i].y) / 2;
+                       XDrawSpline(display, window, gc,
+                                   px, py, sp->splineq[sp->first][i].x,
+                                   sp->splineq[sp->first][i].y, nx, ny);
+                       px = nx;
+                       py = ny;
+               }
+
+               XDrawSpline(display, window, gc,
+                           px, py, sp->splineq[sp->first][sp->points - 1].x,
+                           sp->splineq[sp->first][sp->points - 1].y, zx, zy);
+       }
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, sp->color));
+               if (++sp->color >= MI_NPIXELS(mi))
+                       sp->color = 0;
+       } else
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+
+       /* Draw the figure. */
+       px = zx = (sp->pt[0].pos.x + sp->pt[sp->points - 1].pos.x) / 2;
+       py = zy = (sp->pt[0].pos.y + sp->pt[sp->points - 1].pos.y) / 2;
+       for (i = 0; i < sp->points - 1; ++i) {
+               nx = (sp->pt[i + 1].pos.x + sp->pt[i].pos.x) / 2;
+               ny = (sp->pt[i + 1].pos.y + sp->pt[i].pos.y) / 2;
+               XDrawSpline(display, window, gc,
+                           px, py, sp->pt[i].pos.x, sp->pt[i].pos.y, nx, ny);
+               px = nx;
+               py = ny;
+       }
+
+       XDrawSpline(display, window, gc, px, py,
+        sp->pt[sp->points - 1].pos.x, sp->pt[sp->points - 1].pos.y, zx, zy);
+
+       if (sp->erase) {
+               for (i = 0; i < sp->points; ++i) {
+                       sp->splineq[sp->last][i].x = sp->pt[i].pos.x;
+                       sp->splineq[sp->last][i].y = sp->pt[i].pos.y;
+               }
+               sp->last++;
+               if (sp->last >= sp->nsplines)
+                       sp->last = 0;
+
+               if (sp->redrawing) {
+                       int         j, k;
+
+                       sp->redrawpos++;
+                       /* This compensates for the changed sp->last
+                          since last callback */
+
+                       for (k = 0; k < REDRAWSTEP; k++) {
+                               j = (sp->last - sp->redrawpos + sp->nsplines) %
+                                       sp->nsplines;
+#ifdef BACKWARDS
+                               /* Draw backwards, probably will not see it,
+                                  but its the thought ... */
+                               px = zx = (sp->splineq[j][0].x +
+                                      sp->splineq[j][sp->points - 1].x) / 2;
+                               py = zy = (sp->splineq[j][0].y +
+                                      sp->splineq[j][sp->points - 1].y) / 2;
+                               for (i = sp->points - 1; i > 0; --i) {
+                                       nx = (sp->splineq[j][i - 1].x +
+                                             sp->splineq[j][i].x) / 2;
+                                       ny = (sp->splineq[j][i - 1].y +
+                                             sp->splineq[j][i].y) / 2;
+                                       XDrawSpline(display, window, gc,
+                                                px, py, sp->splineq[j][i].x,
+                                               sp->splineq[j][i].y, nx, ny);
+                                       px = nx;
+                                       py = ny;
+                               }
+
+                               XDrawSpline(display, window, gc,
+                                           px, py, sp->splineq[j][0].x,
+                                           sp->splineq[j][0].y, zx, zy);
+#else
+                               px = zx = (sp->splineq[j][0].x +
+                                      sp->splineq[j][sp->points - 1].x) / 2;
+                               py = zy = (sp->splineq[j][0].y +
+                                      sp->splineq[j][sp->points - 1].y) / 2;
+                               for (i = 0; i < sp->points - 1; ++i) {
+                                       nx = (sp->splineq[j][i + 1].x +
+                                             sp->splineq[j][i].x) / 2;
+                                       ny = (sp->splineq[j][i + 1].y +
+                                             sp->splineq[j][i].y) / 2;
+                                       XDrawSpline(display, window, gc,
+                                                px, py, sp->splineq[j][i].x,
+                                               sp->splineq[j][i].y, nx, ny);
+                                       px = nx;
+                                       py = ny;
+                               }
+
+                               XDrawSpline(display, window, gc,
+                                   px, py, sp->splineq[j][sp->points - 1].x,
+                                  sp->splineq[j][sp->points - 1].y, zx, zy);
+#endif
+                               if (++(sp->redrawpos) >= sp->nsplines - 1) {
+                                       sp->redrawing = 0;
+                                       break;
+                               }
+                       }
+               }
+       } else if (++sp->nsplines > MI_CYCLES(mi))
+               init_spline(mi);
+}
+
+/* X spline routine. */
+
+static void
+XDrawSpline(Display * display, Drawable d, GC gc, int x0, int y0, int x1, int y1, int x2, int y2)
+{
+       register int xa, ya, xb, yb, xc, yc, xp, yp;
+
+       xa = (x0 + x1) / 2;
+       ya = (y0 + y1) / 2;
+       xc = (x1 + x2) / 2;
+       yc = (y1 + y2) / 2;
+       xb = (xa + xc) / 2;
+       yb = (ya + yc) / 2;
+
+       xp = (x0 + xb) / 2;
+       yp = (y0 + yb) / 2;
+       if (ABS(xa - xp) + ABS(ya - yp) > SPLINE_THRESH)
+               XDrawSpline(display, d, gc, x0, y0, xa, ya, xb, yb);
+       else
+               XDrawLine(display, d, gc, x0, y0, xb, yb);
+
+       xp = (x2 + xb) / 2;
+       yp = (y2 + yb) / 2;
+       if (ABS(xc - xp) + ABS(yc - yp) > SPLINE_THRESH)
+               XDrawSpline(display, d, gc, xb, yb, xc, yc, x2, y2);
+       else
+               XDrawLine(display, d, gc, xb, yb, x2, y2);
+}
+
+void
+release_spline(ModeInfo * mi)
+{
+       if (splines != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_spline(&splines[screen]);
+               (void) free((void *) splines);
+               splines = NULL;
+       }
+}
+
+void
+refresh_spline(ModeInfo * mi)
+{
+       splinestruct *sp;
+
+       if (splines == NULL)
+               return;
+       sp = &splines[MI_SCREEN(mi)];
+
+       if (sp->erase) {
+               sp->redrawing = 1;
+               sp->redrawpos = 1;
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+#endif /* MODE_spline */
diff --git a/modes/star.c b/modes/star.c
new file mode 100644 (file)
index 0000000..6d1ded2
--- /dev/null
@@ -0,0 +1,808 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* star --- flying through an asteroid field */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)star.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Based on TI Explorer Lisp code by John Nguyen <johnn@hx.lcs.mit.edu>
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-Oct-1996: Renamed from rock.  Added trek and rock options.
+ *              Combined with features from star by Heath Rice
+ *              <rice@asl.dl.nec.com>.
+ *              The Enterprise flys by from a few different views.
+ *              Romulan ship has some trouble.
+ * 07-Sep-1996: Fixed problems with 3d mode <theiling@coli.uni-sb.de>
+ * 08-May-1996: Blue on left instead of green for 3d.  It seems more common
+ *              than green.  Use "-left3d Green" if you have the other kind.
+ * 17-Jan-1996: 3D mode for star thanks to <theiling@coli.uni-sb.de>.
+ *              Get out your 3D glasses, Red on left and Blue on right.
+ * 14-Apr-1995: Jeremie PETIT <petit@aurora.unice.fr> added a "move" feature.
+ * 02-Sep-1993: xlock version David Bagley <bagleyd@tux.org>
+ * 1992: xscreensaver version Jamie Zawinski <jwz@jwz.org>
+ */
+
+/*-
+ * original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Star"
+#define HACK_INIT init_star
+#define HACK_DRAW draw_star
+#define star_opts xlockmore_opts
+#define DEFAULTS "*delay: 40000 \n" \
+ "*count: 100 \n" \
+ "*size: 100 \n" \
+ "*ncolors: 200 \n" \
+ "*use3d: False \n" \
+ "*delta3d: 1.5 \n" \
+ "*right3d: red \n" \
+ "*left3d: blue \n" \
+ "*both3d: magenta \n" \
+ "*none3d: black \n"
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+
+#endif /* STANDALONE */
+
+#ifdef MODE_star
+
+#define DEF_TREK  "50"
+#define DEF_ROCK  "False"
+#define DEF_STRAIGHT  "False"
+
+static int  trek;
+static Bool rock;
+static Bool straight;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-trek", (char *) ".star.trek", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-rock", (char *) ".star.rock", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+rock", (char *) ".star.rock", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-straight", (char *) ".star.straight", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+straight", (char *) ".star.straight", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & trek, (char *) "trek", (char *) "Trek", (char *) DEF_TREK, t_Int},
+       {(caddr_t *) & rock, (char *) "rock", (char *) "Rock", (char *) DEF_ROCK, t_Bool},
+       {(caddr_t *) & straight, (char *) "straight", (char *) "Straight", (char *) DEF_STRAIGHT, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-trek num", (char *) "chance of a Star Trek encounter"},
+       {(char *) "-/+rock", (char *) "turn on/off rocks"},
+       {(char *) "-/+straight", (char *) "turn on/off spin and shifting origin"}
+};
+
+ModeSpecOpt star_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   star_description =
+{"star", "init_star", "draw_star", "release_star",
+ "refresh_star", "init_star", NULL, &star_opts,
+ 40000, 100, 1, 100, 64, 0.3, "",
+ "Shows a star field with a twist", 0, NULL};
+
+#endif
+
+typedef struct _BitmapType {
+       int         direction, width, height;
+} BitmapType;
+
+#include "bitmaps/enterprise-2.xbm"    /* Enterprise EAST */
+#include "bitmaps/enterprise-3.xbm"    /* Enterprise SOUTH EAST */
+#include "bitmaps/enterprise-5.xbm"    /* Enterprise SOUTH WEST */
+#include "bitmaps/enterprise-6.xbm"    /* Enterprise WEST */
+#define TREKIES 4
+
+static BitmapType trekie[] =
+{
+       {2, enterprise2_width, enterprise2_height},
+       {3, enterprise3_width, enterprise3_height},
+       {5, enterprise5_width, enterprise5_height},
+       {6, enterprise6_width, enterprise6_height}
+};
+
+/*-
+ * For 3d effect get some 3D glasses, left lens red, and right lens blue.
+ * Too bad monitors do not emit polarized light.
+ */
+
+#define MIN_STARS 1
+#define MIN_DEPTH 2            /* stars disappear when they get this close */
+#define MAX_DEPTH 60           /* this is where stars appear */
+#define MINSIZE 3              /* how small where pixmaps are not used */
+#define MAXSIZE 200            /* how big (in pixels) stars are at depth 1 */
+#define DEPTH_SCALE 100                /* how many ticks there are between depths */
+#define RESOLUTION 1000
+#define MAX_DEP 1.0            /* how far the displacement can be (percents) */
+#define DIRECTION_CHANGE_RATE 60
+#define MAX_DEP_SPEED 5                /* Maximum speed for movement */
+#define MOVE_STYLE 0           /* Only 0 and 1. Distinguishes the fact that
+                                  these are the stars that are moving (1)
+                                  or the stars source (0). */
+
+#define GETZDIFF(z) \
+        (MI_DELTA3D(mi)*40.0*(1.0-((MAX_DEPTH*DEPTH_SCALE/2)/(z+20.0*DEPTH_SCALE))))
+ /* the compiler needs to optimize the calculations here */
+
+/*-
+  there's not much point in the above being user-customizable, but those
+  numbers might want to be tweaked for displays with an order of magnitude
+  higher resolution or compute power.
+ */
+
+#define TREKBITS(n,w,h)\
+  if ((sp->trekPixmaps[sp->init_treks]=\
+  XCreateBitmapFromData(display,window,(char *)n,w,h))==None){\
+  return False;} else {sp->init_treks++;}
+
+
+typedef struct {
+       int         real_size;
+       int         r;
+       unsigned long color;
+       int         theta;
+       int         depth;
+       int         size, x, y;
+       int         diff;
+} astar;
+
+typedef struct {
+       XPoint      loc, delta, size;
+} trekstruct;
+
+typedef struct {
+       int         current_delta;      /* observer Z rotation */
+       int         new_delta;
+       int         dchange_tick;
+       int         width, height;
+       int         midx, midy;
+       int         current_dep[2];
+       int         speed_dep[2];
+       short       direction[2];
+       int         rotate_p, speed, nstars;
+       float       max_dep;
+       int         move_p;
+       int         dep_x, dep_y;
+       int         max_star_size;
+       astar      *astars;
+       Pixmap     *pixmaps;
+       Pixmap      trekPixmaps[TREKIES];
+       int         init_treks;
+       int         current_trek;
+       GC          stippledGC;
+       trekstruct  trek;
+} starstruct;
+
+static float cos_array[RESOLUTION], sin_array[RESOLUTION];
+static float depths[(MAX_DEPTH + 1) * DEPTH_SCALE];
+
+static starstruct *stars = NULL;
+
+static void star_draw(ModeInfo * mi, astar * astars, int draw_p);
+static int  compute_move(starstruct * sp, int axe);
+
+static void
+star_compute(ModeInfo * mi, astar * astars)
+{
+       starstruct *sp = &stars[MI_SCREEN(mi)];
+       double      factor = depths[astars->depth];
+       double      rsize = astars->real_size * factor;
+
+       astars->size = (int) (rsize + 0.5);
+       astars->diff = (int) (int) GETZDIFF(astars->depth);
+       astars->x = sp->midx + (int) (cos_array[astars->theta] * astars->r * factor);
+       astars->y = sp->midy + (int) (sin_array[astars->theta] * astars->r * factor);
+       if (sp->move_p) {
+               double      move_factor = (double) (MOVE_STYLE - (double) astars->depth /
+                         (double) ((MAX_DEPTH + 1) * (double) DEPTH_SCALE));
+
+               /* move_factor is 0 when the star is close, 1 when far */
+               astars->x += (int) ((double) sp->dep_x * move_factor);
+               astars->y += (int) ((double) sp->dep_y * move_factor);
+       }
+}
+
+static void
+star_reset(ModeInfo * mi, astar * astars)
+{
+       starstruct *sp = &stars[MI_SCREEN(mi)];
+
+       astars->real_size = sp->max_star_size;
+       astars->r = (int) (RESOLUTION * 0.7 + NRAND(30 * RESOLUTION));
+       astars->theta = NRAND(RESOLUTION);
+       astars->depth = MAX_DEPTH * DEPTH_SCALE;
+       if (MI_NPIXELS(mi) > 2)
+               astars->color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+       else
+               astars->color = MI_WHITE_PIXEL(mi);
+       star_compute(mi, astars);
+       star_draw(mi, astars, True);
+}
+
+static void
+star_tick(ModeInfo * mi, astar * astars, int d)
+{
+       starstruct *sp = &stars[MI_SCREEN(mi)];
+
+       if (astars->depth > 0) {
+               star_draw(mi, astars, False);
+               astars->depth -= sp->speed;
+               if (sp->rotate_p)
+                       astars->theta = (astars->theta + d) % RESOLUTION;
+               while (astars->theta < 0)
+                       astars->theta += RESOLUTION;
+               if (astars->depth < (MIN_DEPTH * DEPTH_SCALE))
+                       astars->depth = 0;
+               else if (astars->depth > (MAX_DEPTH * DEPTH_SCALE))
+                       astars->depth = MAX_DEPTH * DEPTH_SCALE;
+               else {
+                       star_compute(mi, astars);
+                       star_draw(mi, astars, True);
+               }
+       } else if (!NRAND(40))
+               star_reset(mi, astars);
+}
+
+static void
+move_trek(starstruct * sp, int direction, int width, int height)
+{
+       switch (direction) {    /* Format: 0 = N, 1 = NE, etc */
+               case 2: /* EAST */
+                       sp->trek.loc.x = -width;
+                       sp->trek.loc.y = NRAND(sp->height);
+                       sp->trek.delta.x = NRAND(3) + 1;
+                       sp->trek.delta.y = NRAND(7) - 4;
+                       break;
+               case 3: /* SOUTH EAST */
+                       if (LRAND() & 1) {      /* Top to Right */
+                               sp->trek.loc.x = NRAND(sp->width);
+                               sp->trek.loc.y = -height;
+                       } else {        /* Left to Bottom */
+                               sp->trek.loc.x = -width;
+                               sp->trek.loc.y = NRAND(sp->height);
+                       }
+                       sp->trek.delta.x = NRAND(3) + 1;
+                       sp->trek.delta.y = NRAND(3) + 1;
+                       break;
+               case 4: /* SOUTH */
+                       sp->trek.loc.x = NRAND(sp->width);
+                       sp->trek.loc.y = sp->height;
+                       sp->trek.delta.x = NRAND(7) - 4;
+                       sp->trek.delta.y = -(NRAND(3) + 1);
+                       break;
+               case 5: /* SOUTH EAST */
+                       if (LRAND() & 1) {      /* Top to Right */
+                               sp->trek.loc.x = NRAND(sp->width);
+                               sp->trek.loc.y = -height;
+                       } else {        /* Left to Bottom */
+                               sp->trek.loc.x = sp->width;
+                               sp->trek.loc.y = NRAND(sp->height);
+                       }
+                       sp->trek.delta.x = -(NRAND(3) + 1);
+                       sp->trek.delta.y = NRAND(3) + 1;
+                       break;
+               case 6: /* WEST */
+                       sp->trek.loc.x = sp->width;
+                       sp->trek.loc.y = NRAND(sp->height);
+                       sp->trek.delta.x = -(NRAND(3) + 1);
+                       sp->trek.delta.y = NRAND(7) - 4;
+                       break;
+               default:
+                       (void) printf("not implemented for direction %d", direction);
+                       break;
+       }
+       sp->trek.size.x = width;
+       sp->trek.size.y = height;
+}
+
+static void
+free_star(Display *display, starstruct *sp)
+{
+       int         i;
+
+       if (sp->astars != NULL) {
+               (void) free((void *) sp->astars);
+               sp->astars = NULL;
+       }
+       if (sp->pixmaps != NULL) {
+               for (i = 0; i < sp->max_star_size; i++)
+                       XFreePixmap(display, sp->pixmaps[i]);
+               (void) free((void *) sp->pixmaps);
+               sp->pixmaps = NULL;
+       }
+       if (sp->stippledGC != None) {
+               XFreeGC(display, sp->stippledGC);
+               sp->stippledGC = None;
+       }
+       for (i = 0; i < sp->init_treks; i++) {
+               XFreePixmap(display, sp->trekPixmaps[i]);
+       }
+       sp->init_treks = 0;
+}
+
+static void
+draw_trek(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       starstruct *sp = &stars[MI_SCREEN(mi)];
+       int         new_one = 0;
+
+       if (TREKIES == sp->current_trek)
+               if (NRAND(10000) < trek) {
+                       sp->current_trek = NRAND(TREKIES);
+                       new_one = 1;
+                       move_trek(sp, trekie[sp->current_trek].direction,
+                                 trekie[sp->current_trek].width, trekie[sp->current_trek].height);
+               }
+       if (TREKIES != sp->current_trek) {
+               sp->trek.loc.x += sp->trek.delta.x;
+               sp->trek.loc.y += sp->trek.delta.y;
+
+               if ((sp->trek.loc.x < -sp->trek.size.x) ||
+                   (sp->trek.loc.y < -sp->trek.size.y) ||
+                   (sp->trek.loc.y >= sp->height) ||
+                   (sp->trek.loc.x >= sp->width)) {
+                       sp->current_trek = TREKIES;
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                       XFillRectangle(display, window, gc,
+                                      sp->trek.loc.x - sp->trek.delta.x,
+                                      sp->trek.loc.y - sp->trek.delta.y,
+                                      sp->trek.size.x, sp->trek.size.y);
+               } else {
+                       int trekx, treky, trekwidth, trekheight;
+
+                       XSetForeground(display, sp->stippledGC, MI_WHITE_PIXEL(mi));
+                       XSetTSOrigin(display, sp->stippledGC, sp->trek.loc.x, sp->trek.loc.y);
+                       XSetStipple(display, sp->stippledGC, sp->trekPixmaps[sp->current_trek]);
+                       XSetFillStyle(display, sp->stippledGC, FillOpaqueStippled);
+
+                       trekx = sp->trek.loc.x;
+                       treky = sp->trek.loc.y,
+                       trekwidth = sp->trek.size.x;
+                       trekheight = sp->trek.size.y;
+                       /* Bound checks needed for Sun but does not hurt elsewhere */
+                       if (trekx < 0) {
+                               trekwidth = sp->trek.size.x + trekx;
+                               trekx = 0;
+                       }
+                       if (treky < 0) {
+                               trekheight = sp->trek.size.y + treky;
+                               treky = 0;
+                       }
+                       /* This part is not needed but it jives with above */
+                       if (trekx + trekwidth >= sp->width) {
+                               trekwidth = sp->width - trekx;
+                       }
+                       if (treky + trekheight >= sp->height) {
+                               trekheight = sp->height - treky;
+                       }
+                       XFillRectangle(display, window, sp->stippledGC,
+                                      trekx, treky,
+                                      trekwidth, trekheight);
+
+                       if (!new_one) {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               ERASE_IMAGE(display, window, gc,
+                                           sp->trek.loc.x, sp->trek.loc.y,
+                                        (sp->trek.loc.x - sp->trek.delta.x),
+                                        (sp->trek.loc.y - sp->trek.delta.y),
+                                           sp->trek.size.x, sp->trek.size.y);
+
+                       }
+               }
+       }
+}
+
+static void
+star_draw(ModeInfo * mi, astar * astars, int draw_p)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       starstruct *sp = &stars[MI_SCREEN(mi)];
+
+       if (draw_p) {
+               if (MI_IS_USE3D(mi)) {
+                       if (MI_IS_INSTALL(mi))
+                               XSetForeground(MI_DISPLAY(mi), gc, MI_NONE_COLOR(mi));
+                       else
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               } else
+                       XSetForeground(display, gc, astars->color);
+       } else
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       if (astars->x <= 0 || astars->y <= 0 ||
+           astars->x >= sp->width || astars->y >= sp->height) {
+               /* This means that if a star were to go off the screen at 12:00, but
+                  would have been visible at 3:00, it won't come back once the observer
+                  rotates around so that the star would have been visible again.
+                  Oh well.
+                */
+               if (!sp->move_p)
+                       astars->depth = 0;
+               return;
+       }
+       if (astars->size <= 1) {
+               if (MI_IS_USE3D(mi)) {
+                       if (draw_p) {
+                               if (MI_IS_INSTALL(mi))
+                                       XSetFunction(display, gc, GXor);
+                               XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+                       }
+                       XDrawPoint(display, window, gc, astars->x - astars->diff, astars->y);
+                       if (draw_p)
+                               XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+                       XDrawPoint(display, window, gc, astars->x + astars->diff, astars->y);
+                       if (draw_p && MI_IS_INSTALL(mi))
+                               XSetFunction(display, gc, GXcopy);
+               } else
+                       XDrawPoint(display, window, gc, astars->x, astars->y);
+       } else if (astars->size <= MINSIZE || !draw_p) {
+               if (MI_IS_USE3D(mi)) {
+                       if (draw_p) {
+                               if (MI_IS_INSTALL(mi))
+                                       XSetFunction(display, gc, GXor);
+                               XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+                       }
+                       XFillRectangle(display, window, gc,
+                                astars->x - astars->size / 2 - astars->diff,
+                                      astars->y - astars->size / 2,
+                                      astars->size, astars->size);
+                       if (draw_p)
+                               XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+                       XFillRectangle(display, window, gc,
+                                astars->x - astars->size / 2 + astars->diff,
+                                      astars->y - astars->size / 2,
+                                      astars->size, astars->size);
+                       if (draw_p && MI_IS_INSTALL(mi))
+                               XSetFunction(display, gc, GXcopy);
+               } else
+                       XFillRectangle(display, window, gc,
+                                      astars->x - astars->size / 2, astars->y - astars->size / 2,
+                                      astars->size, astars->size);
+       } else if (astars->size < sp->max_star_size) {
+               if (MI_IS_USE3D(mi)) {
+                       if (MI_IS_INSTALL(mi))
+                               XSetFunction(display, gc, GXor);
+                       XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+                       XCopyPlane(display, sp->pixmaps[astars->size - MINSIZE], window, gc,
+                                  0, 0, astars->size, astars->size,
+                                astars->x - astars->size / 2 - astars->diff,
+                                  astars->y - astars->size / 2,
+                                  1L);
+                       XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+                       XCopyPlane(display, sp->pixmaps[astars->size - MINSIZE], window, gc,
+                                  0, 0, astars->size, astars->size,
+                                astars->x - astars->size / 2 + astars->diff,
+                                  astars->y - astars->size / 2,
+                                  1L);
+                       if (MI_IS_INSTALL(mi))
+                               XSetFunction(display, gc, GXcopy);
+               } else
+                       XCopyPlane(display, sp->pixmaps[astars->size - MINSIZE], window, gc,
+                                  0, 0, astars->size, astars->size,
+                                  astars->x - astars->size / 2, astars->y - astars->size / 2,
+                                  1L);
+       }
+}
+
+static Bool
+init_pixmaps(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       starstruct *sp = &stars[MI_SCREEN(mi)];
+       int         size = MI_SIZE(mi);
+       int         i;
+       XGCValues   gcv;
+       GC          fg_gc = 0, bg_gc = 0;
+
+       if (size < -MINSIZE)
+               sp->max_star_size = NRAND(-size - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE)
+               sp->max_star_size = MINSIZE;
+       else
+               sp->max_star_size = size;
+       if (sp->max_star_size > MAXSIZE)
+               sp->max_star_size = MAXSIZE;
+       if ((sp->pixmaps = (Pixmap *) calloc(sp->max_star_size,
+                       sizeof (Pixmap))) == None) {
+               return False;
+       }
+       for (i = 0; i < sp->max_star_size; i++) {
+               int         h = i + MINSIZE;
+               Pixmap      p;
+               XPoint      points[7];
+
+               if (rock)
+                       p = XCreatePixmap(display, window, h, h, 1);
+               else            /* Dunno why this is required */
+                       p = XCreatePixmap(display, window, 2 * h, 2 * h, 1);
+               sp->pixmaps[i] = p;
+               if (p == None) {
+                       return False;
+               }
+               if (fg_gc == None) {    /* must use drawable of pixmap, not window (fmh) */
+                       gcv.foreground = 1;
+                       gcv.background = 0;
+                       if ((fg_gc = XCreateGC(display, p,
+                                       GCForeground | GCBackground,
+                                       &gcv)) == None) {
+                               return False;
+                       }
+               }
+               if (bg_gc == None) {    /* must use drawable of pixmap, not window (fmh) */
+                       gcv.foreground = 0;
+                       gcv.background = 1;
+                       if ((bg_gc = XCreateGC(display, p,
+                                       GCForeground | GCBackground,
+                                       &gcv)) == None) {
+                               XFreeGC(display, fg_gc);
+                               return False;
+                       }
+               }
+               XFillRectangle(display, p, bg_gc, 0, 0, h, h);
+               if (rock) {
+                       points[0].x = (int) ((double) h * 0.15);
+                       points[0].y = (int) ((double) h * 0.85);
+                       points[1].x = (int) ((double) h * 0.00);
+                       points[1].y = (int) ((double) h * 0.20);
+                       points[2].x = (int) ((double) h * 0.30);
+                       points[2].y = (int) ((double) h * 0.00);
+                       points[3].x = (int) ((double) h * 0.40);
+                       points[3].y = (int) ((double) h * 0.10);
+                       points[4].x = (int) ((double) h * 0.90);
+                       points[4].y = (int) ((double) h * 0.10);
+                       points[5].x = (int) ((double) h * 1.00);
+                       points[5].y = (int) ((double) h * 0.55);
+                       points[6].x = (int) ((double) h * 0.45);
+                       points[6].y = (int) ((double) h * 1.00);
+                       XFillPolygon(display, p, fg_gc, points, 7, Nonconvex, CoordModeOrigin);
+               } else {
+                       XFillArc(display, p, fg_gc, 0, 0, h, h, 0, 23040);
+               }
+       }
+       XFreeGC(display, fg_gc);
+       XFreeGC(display, bg_gc);
+       if (sp->stippledGC == None) {
+               gcv.foreground = MI_BLACK_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((sp->stippledGC = XCreateGC(display, window,
+                                GCForeground | GCBackground, &gcv)) == None)
+                       return False;
+       }
+       if (!sp->init_treks && trek) {
+/* PURIFY 4.0.1 on SunOS4 reports a 3264 byte memory leak on the next line. *
+   PURIFY 4.0.1 on Solaris 2 does not report this memory leak. */
+               TREKBITS(enterprise2_bits, enterprise2_width, enterprise2_height);
+               TREKBITS(enterprise3_bits, enterprise3_width, enterprise3_height);
+               TREKBITS(enterprise5_bits, enterprise5_width, enterprise5_height);
+               TREKBITS(enterprise6_bits, enterprise6_width, enterprise6_height);
+       }
+       return True;
+}
+
+static void
+tick_stars(ModeInfo * mi, int d)
+{
+       starstruct *sp = &stars[MI_SCREEN(mi)];
+       int         i;
+
+       if (sp->move_p) {
+               sp->dep_x = compute_move(sp, 0);
+               sp->dep_y = compute_move(sp, 1);
+       }
+       for (i = 0; i < sp->nstars; i++)
+               star_tick(mi, &sp->astars[i], d);
+}
+
+static int
+compute_move(starstruct * sp, int axe)
+                               /* 0 for x, 1 for y */
+{
+       int         limit[2];
+
+       limit[0] = sp->midx;
+       limit[1] = sp->midy;
+
+       sp->current_dep[axe] += sp->speed_dep[axe];     /* We adjust the displacement */
+
+       if (sp->current_dep[axe] > (int) (limit[axe] * sp->max_dep)) {
+               if (sp->current_dep[axe] > limit[axe])
+                       sp->current_dep[axe] = limit[axe];
+               sp->direction[axe] = -1;
+       }                       /* This is when we reach the upper screen limit */
+       if (sp->current_dep[axe] < (int) (-limit[axe] * sp->max_dep)) {
+               if (sp->current_dep[axe] < -limit[axe])
+                       sp->current_dep[axe] = -limit[axe];
+               sp->direction[axe] = 1;
+       }                       /* This is when we reach the lower screen limit */
+       if (sp->direction[axe] == 1)    /* We adjust the sp->speed_dep */
+               sp->speed_dep[axe] += 1;
+       else if (sp->direction[axe] == -1)
+               sp->speed_dep[axe] -= 1;
+
+       if (sp->speed_dep[axe] > MAX_DEP_SPEED)
+               sp->speed_dep[axe] = MAX_DEP_SPEED;
+       else if (sp->speed_dep[axe] < -MAX_DEP_SPEED)
+               sp->speed_dep[axe] = -MAX_DEP_SPEED;
+
+       if (!straight && !NRAND(DIRECTION_CHANGE_RATE)) {
+               int         change = (int) (LRAND() & 1);
+
+               if (change != 1) {
+                       /* We change direction */
+                       if (sp->direction[axe] == 0)
+                               sp->direction[axe] = change - 1;        /* 0 becomes either 1 or -1 */
+                       else
+                               sp->direction[axe] = 0;         /* -1 or 1 become 0 */
+               }
+       }
+       return (sp->current_dep[axe]);
+}
+
+void
+init_star(ModeInfo * mi)
+{
+       Display *display = MI_DISPLAY(mi);
+       int         i;
+       starstruct *sp;
+
+       if (stars == NULL) {
+               if ((stars = (starstruct *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (starstruct))) == NULL)
+                       return;
+               for (i = 0; i < RESOLUTION; i++) {
+                       sin_array[i] = SINF((((float) i) / (RESOLUTION / 2.0)) * M_PI);
+                       cos_array[i] = COSF((((float) i) / (RESOLUTION / 2.0)) * M_PI);
+               }
+               /* We actually only need i/speed of these. Oh well. */
+               for (i = 1; i < (int) (sizeof (depths) / sizeof (depths[0])); i++)
+                       depths[i] = (float) atan(((double) 0.5) / (((double) i) / DEPTH_SCALE));
+               depths[0] = M_PI_2;     /* avoid division by 0 */
+       }
+       sp = &stars[MI_SCREEN(mi)];
+
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+       sp->midx = sp->width / 2;
+       sp->midy = sp->height / 2;
+       sp->speed = 100;
+       sp->rotate_p = !straight;
+       sp->max_dep = (straight) ? 0 : MAX_DEP;
+       sp->move_p = True;
+       sp->dep_x = 0;
+       sp->dep_y = 0;
+       sp->current_trek = TREKIES;
+       sp->nstars = MI_COUNT(mi);
+       if (sp->nstars < -MIN_STARS) {
+               if (sp->astars) {
+                       (void) free((void *) sp->astars);
+                       sp->astars = NULL;
+               }
+               sp->nstars = NRAND(-sp->nstars - MIN_STARS + 1) + MIN_STARS;
+       } else if (sp->nstars < MIN_STARS)
+               sp->nstars = MIN_STARS;
+       if (sp->speed > 100)
+               sp->speed = 100;
+
+       if (sp->astars == NULL)
+               if ((sp->astars = (astar *) calloc(sp->nstars,
+                               sizeof (astar))) == NULL) {
+                       free_star(display, sp);
+                       return;
+               }
+       if (sp->pixmaps == NULL)
+               if (!init_pixmaps(mi)) {
+                       free_star(display, sp);
+                       return;
+               }
+
+       /* don't want any exposure events from XCopyPlane */
+       XSetGraphicsExposures(display, MI_GC(mi), False);
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_star(ModeInfo * mi)
+{
+       starstruct *sp;
+
+       if (stars == NULL)
+               return;
+       sp = &stars[MI_SCREEN(mi)];
+       if (sp->astars == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (sp->current_delta != sp->new_delta) {
+               if (sp->dchange_tick++ == 5) {
+                       sp->dchange_tick = 0;
+                       if (sp->current_delta < sp->new_delta)
+                               sp->current_delta++;
+                       else
+                               sp->current_delta--;
+               }
+       } else {
+               if (!NRAND(50)) {
+                       sp->new_delta = (NRAND(11) - 5);
+                       if (!NRAND(10))
+                               sp->new_delta *= 5;
+               }
+       }
+       tick_stars(mi, sp->current_delta);
+       draw_trek(mi);
+#if 0
+       /* this is for making stars go backwards, not ready for prime-time */
+       if (!NRAND(500)) {
+               sp->speed = -sp->speed;
+       }
+#endif
+}
+
+void
+release_star(ModeInfo * mi)
+{
+       if (stars != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_star(MI_DISPLAY(mi), &stars[screen]);
+               (void) free((void *) stars);
+               stars = NULL;
+       }
+}
+
+void
+refresh_star(ModeInfo * mi)
+{
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+#endif /* MODE_star */
diff --git a/modes/starfish.c b/modes/starfish.c
new file mode 100644 (file)
index 0000000..9dd9a14
--- /dev/null
@@ -0,0 +1,672 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* starfish ---  */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)starfish.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/* xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 24-Feb-1998: xlockmore version by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ * 1997: original xscreensaver version by Jamie Zawinski <jwz@jwz.org>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Starfish"
+#define HACK_INIT init_starfish
+#define HACK_DRAW draw_starfish
+#define starfish_opts xlockmore_opts
+#define DEFAULTS "*delay: 2000 \n" \
+ "*cycles: 1000 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+
+#ifdef MODE_starfish
+
+#include "spline.h"
+
+#define DEF_ROTV  "-1"
+#define DEF_THICKNESS  "-20"
+#define DEF_CYCLE "True"
+#define DEF_BLOB "False"
+#define DEF_CYCLESPEED "3"
+
+static int  cyclespeed;
+static float rotv, thickness;
+
+static Bool blob, cycle_p;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-cyclespeed", (char *) "starfish.cyclespeed", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-rotation", (char *) "starfish.rotation", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-thickness", (char *) "starfish.thickness", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-blob", (char *) ".starfish.blob", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+blob", (char *) ".starfish.blob", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-cycle", (char *) ".starfish.cycle", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+cycle", (char *) ".starfish.cycle", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+{(caddr_t *) & cyclespeed, (char *) "cyclespeed", (char *) "CycleSpeed", (char *) DEF_CYCLESPEED, t_Int},
+       {(caddr_t *) & rotv, (char *) "rotation", (char *) "Rotation", (char *) DEF_ROTV, t_Float},
+ {(caddr_t *) & thickness, (char *) "thickness", (char *) "Thickness", (char *) DEF_THICKNESS, t_Float},
+       {(caddr_t *) & blob, (char *) "blob", (char *) "Blob", (char *) DEF_BLOB, t_Bool},
+       {(caddr_t *) & cycle_p, (char *) "cycle", (char *) "Cycle", (char *) DEF_CYCLE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-cyclespeed num", (char *) "Cycling speed"},
+       {(char *) "-rotation num", (char *) "Rotation velocity"},
+       {(char *) "-thickness num", (char *) "Thickness"},
+       {(char *) "-/+blob", (char *) "turn on/off blob"},
+       {(char *) "-/+cycle", (char *) "turn on/off cycle"}
+};
+
+ModeSpecOpt starfish_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   starfish_description =
+{"starfish", "init_starfish", "draw_starfish", "release_starfish",
+ "init_starfish", "init_starfish", NULL, &starfish_opts,
+ 2000, 1, 1000, 1, 64, 1.0, "",
+ "Shows starfish", 0, NULL};
+
+#endif
+
+#define SCALE        1000      /* fixed-point math, for sub-pixel motion */
+
+#define RAND(n) ((long) ((LRAND() & 0x7fffffff) % ((long) (n))))
+#define RANDSIGN() ((LRAND() & 1) ? 1 : -1)
+
+enum starfish_mode {
+       pulse,
+       zoom
+};
+
+
+typedef struct {
+       enum starfish_mode mode;
+       Bool        blob_p;
+       int         skip;
+       long        x, y;       /* position of midpoint */
+       double      th;         /* angle of rotation */
+       double      rotv;       /* rotational velocity */
+       double      rota;       /* rotational acceleration */
+       double      elasticity; /* how fast it deforms: radial velocity */
+       double      rot_max;
+       long        min_r, max_r;       /* radius range */
+       int         npoints;    /* control points */
+       long       *r;          /* radii */
+       spline     *splines;
+       XPoint     *prev;
+       int         n_prev;
+       GC          gc;
+       Colormap    cmap;
+       XColor     *colors;
+       int         ncolors;
+       Bool        cycle_p, mono_p, no_colors;
+       unsigned long fg_index;
+       int         size, winwidth, winheight, stage, counter;
+       float       thickness;
+       unsigned long blackpixel, whitepixel, fg, bg;
+       int         direction;
+       ModeInfo   *mi;
+} starfishstruct;
+
+static starfishstruct *starfishes = NULL;
+
+
+static void
+free_starfish(Display *display, starfishstruct * sp)
+{
+       ModeInfo *mi = sp->mi;
+
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               MI_WHITE_PIXEL(mi) = sp->whitepixel;
+               MI_BLACK_PIXEL(mi) = sp->blackpixel;
+#ifndef STANDALONE
+               MI_FG_PIXEL(mi) = sp->fg;
+               MI_BG_PIXEL(mi) = sp->bg;
+#endif
+               if (sp->colors != NULL) {
+                       if (sp->ncolors && !sp->no_colors)
+                               free_colors(display, sp->cmap, sp->colors, sp->ncolors);
+                       (void) free((void *) sp->colors);
+                       sp->colors = NULL;
+               }
+               if (sp->cmap != None) {
+                       XFreeColormap(display, sp->cmap);
+                       sp->cmap = None;
+               }
+       }
+       if (sp->gc != None) {
+               XFreeGC(display, sp->gc);
+               sp->gc = None;
+       }
+       if (sp->splines != NULL) {
+               free_spline(sp->splines);
+               sp->splines = NULL;
+       }
+       if (sp->r != NULL) {
+               (void) free((void *) sp->r);
+               sp->r = NULL;
+       }
+       if (sp->prev != NULL) {
+               (void) free((void *) sp->prev);
+               sp->prev = NULL;
+       }
+}
+
+static void
+make_starfish(ModeInfo * mi)
+{
+       starfishstruct *sp = &starfishes[MI_SCREEN(mi)];
+       int         i;
+
+       sp->elasticity = SCALE * sp->thickness;
+
+       if (sp->elasticity == 0.0)
+               /* bell curve from 0-15, avg 7.5 */
+               sp->elasticity = RAND(5 * SCALE) + RAND(5 * SCALE) + RAND(5 * SCALE);
+
+       if (sp->rotv == -1)
+               /* bell curve from 0-12 degrees, avg 6 */
+               sp->rotv = (double) 4.0 *((double) LRAND() / (double) MAXRAND +
+                                       (double) LRAND() / (double) MAXRAND +
+                                       (double) LRAND() / (double) MAXRAND);
+
+       sp->rotv /= 360;        /* convert degrees to ratio */
+
+       if (sp->blob_p) {
+               sp->elasticity *= 3.0;
+               sp->rotv *= 3;
+       }
+       sp->rot_max = sp->rotv * 2;
+       sp->rota = 0.0004 + 0.0002 * (double) LRAND() / (double) MAXRAND;
+
+
+       if (NRAND(20) == 5)
+               sp->size = (int) (sp->size *
+                       (0.35 * ((double) LRAND() / (double) MAXRAND +
+                                (double) LRAND() / (double) MAXRAND) + 0.3));
+
+       {
+               static char skips[] =
+               {2, 2, 2, 2, 3, 3, 3, 6, 6, 12};
+
+               sp->skip = skips[LRAND() % sizeof (skips)];
+       }
+
+       if (!(LRAND() % (sp->skip == 2 ? 3 : 12)))
+               sp->mode = zoom;
+       else
+               sp->mode = pulse;
+
+       sp->winwidth *= SCALE;
+       sp->winheight *= SCALE;
+       sp->size *= SCALE;
+
+       sp->max_r = sp->size;
+       sp->min_r = 0;
+
+       if (sp->min_r < (5 * SCALE))
+               sp->min_r = (5 * SCALE);
+       /* mid = ((sp->min_r + sp->max_r) / 2); */
+
+       sp->x = sp->winwidth / 2;
+       sp->y = sp->winheight / 2;
+
+       sp->th = 2.0 * M_PI * ((double) LRAND() / (double) MAXRAND) * RANDSIGN();
+
+       {
+               static char sizes[] =
+               {3, 3, 3, 3, 3,
+                4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
+                8, 8, 8, 10, 35};
+               int         nsizes = sizeof (sizes);
+
+               if (sp->skip > 3)
+                       nsizes -= 4;
+               sp->npoints = sp->skip * sizes[LRAND() % nsizes];
+       }
+
+       if (sp->splines)
+               free_spline(sp->splines);
+       sp->splines = make_spline(sp->npoints);
+
+       if (sp->r != NULL)
+               (void) free((void *) sp->r);
+       if ((sp->r = (long *) malloc(sizeof (*sp->r) * sp->npoints)) == NULL) {
+               free_starfish(MI_DISPLAY(mi), sp);
+               return;
+       }
+
+       for (i = 0; i < sp->npoints; i++)
+               sp->r[i] = ((i % sp->skip) == 0) ? 0 : sp->size;
+}
+
+static void
+throb_starfish(starfishstruct * sp)
+{
+       int         i;
+       double      frac = ((M_PI + M_PI) / sp->npoints);
+
+       for (i = 0; i < sp->npoints; i++) {
+               double      r = sp->r[i];
+               double      ra = (r > 0.0 ? r : -r);
+               double      th = (sp->th > 0 ? sp->th : -sp->th);
+               double      x, y;
+               double      elasticity = sp->elasticity;
+
+               /* place control points evenly around perimiter, shifted by theta */
+               x = sp->x + (ra * cos(i * frac + th));
+               y = sp->y + (ra * sin(i * frac + th));
+
+               sp->splines->control_x[i] = x / SCALE;
+               sp->splines->control_y[i] = y / SCALE;
+
+               if (sp->mode == zoom && ((i % sp->skip) == 0))
+                       continue;
+
+               /* Slow down near the end points: move fastest in the middle. */
+               {
+                       double      ratio = ra / (double) (sp->max_r - sp->min_r);
+
+                       if (ratio > 0.5)
+                               ratio = 1 - ratio;      /* flip */
+                       ratio *= 2.0;   /* normalize */
+                       ratio = (ratio * 0.9) + 0.1;    /* fudge */
+                       elasticity = elasticity * ratio;
+               }
+
+
+               /* Increase/decrease radius by elasticity */
+               ra += (r >= 0.0 ? elasticity : -elasticity);
+               if ((i % sp->skip) == 0)
+                       ra += (elasticity / 2.0);
+
+               r = ra * (r >= 0.0 ? 1.0 : -1.0);
+
+               /* If we've reached the end (too long or too short) reverse direction. */
+               if ((ra > sp->max_r && r >= 0.0) ||
+                   (ra < sp->min_r && r < 0.0))
+                       r = -r;
+
+               sp->r[i] = (long) r;
+       }
+}
+
+
+static void
+spin_starfish(starfishstruct * sp)
+{
+       double      th = sp->th;
+
+       if (th < 0)
+               th = -(th + sp->rotv);
+       else
+               th += sp->rotv;
+
+       if (th > (M_PI + M_PI))
+               th -= (M_PI + M_PI);
+       else if (th < 0)
+               th += (M_PI + M_PI);
+
+       sp->th = (sp->th > 0 ? th : -th);
+
+       sp->rotv += sp->rota;
+
+       if (sp->rotv > sp->rot_max ||
+           sp->rotv < -sp->rot_max) {
+               sp->rota = -sp->rota;
+       }
+       /* If it stops, start it going in the other direction. */
+       else if (sp->rotv < 0) {
+               if (LRAND() & 1) {
+                       /* keep going in the same direction */
+                       sp->rotv = 0;
+                       if (sp->rota < 0)
+                               sp->rota = -sp->rota;
+               } else {
+                       /* reverse gears */
+                       sp->rotv = -sp->rotv;
+                       sp->rota = -sp->rota;
+                       sp->th = -sp->th;
+               }
+       }
+       /* Alter direction of rotational acceleration randomly. */
+       if (!(LRAND() % 120))
+               sp->rota = -sp->rota;
+
+       /* Change acceleration very occasionally. */
+       if (!(LRAND() % 200)) {
+               if (LRAND() & 1)
+                       sp->rota *= 1.2;
+               else
+                       sp->rota *= 0.8;
+       }
+}
+
+
+static Bool
+draw1_starfish(Display * display, Drawable drawable, GC gc, starfishstruct * sp)
+{
+       compute_closed_spline(sp->splines);
+       if (sp->prev) {
+               XPoint     *points;
+               int         i = sp->splines->n_points;
+               int         j = sp->n_prev;
+
+               if ((points = (XPoint *) malloc(sizeof (XPoint) *
+                               (sp->n_prev + sp->splines->n_points + 2))) == NULL) {
+                       free_starfish(display, sp);
+                       return False;
+               }
+               (void) memcpy((char *) points, (char *) sp->splines->points,
+                             (i * sizeof (*points)));
+               (void) memcpy((char *) (points + i), (char *) sp->prev,
+                             (j * sizeof (*points)));
+
+               if (sp->blob_p)
+                       XClearWindow(display, drawable);
+               XFillPolygon(display, drawable, gc, points, i + j,
+                            Complex, CoordModeOrigin);
+               (void) free((void *) points);
+
+               (void) free((void *) sp->prev);
+               sp->prev = NULL;
+       }
+       if ((sp->prev = (XPoint *) malloc(sp->splines->n_points *
+                       sizeof (XPoint))) == NULL) {
+               free_starfish(display, sp);
+               return False;
+       }
+       (void) memcpy((char *) sp->prev, (char *) sp->splines->points,
+                     sp->splines->n_points * sizeof (XPoint));
+       sp->n_prev = sp->splines->n_points;
+
+#ifdef DEBUG
+       if (sp->blob_p) {
+               int         i;
+
+               for (i = 0; i < sp->npoints; i++)
+                       XDrawLine(display, drawable, gc, sp->x / SCALE, sp->y / SCALE,
+                       sp->splines->control_x[i], sp->splines->control_y[i]);
+       }
+#endif
+       return True;
+}
+
+
+void
+init_starfish(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       XGCValues   gcv;
+       starfishstruct *sp;
+
+/* initialize */
+       if (starfishes == NULL) {
+
+               if ((starfishes = (starfishstruct *) calloc(MI_NUM_SCREENS(mi),
+                                          sizeof (starfishstruct))) == NULL)
+                       return;
+       }
+       sp = &starfishes[MI_SCREEN(mi)];
+       sp->mi = mi;
+
+       if (MI_IS_FULLRANDOM(mi)) {
+               if (NRAND(10) == 9)
+                       sp->blob_p = True;
+               else
+                       sp->blob_p = False;
+               if (NRAND(8) == 7)
+                       sp->cycle_p = False;
+               else
+                       sp->cycle_p = True;
+       } else {
+               sp->blob_p = blob;
+               sp->cycle_p = cycle_p;
+       }
+       sp->rotv = (double) rotv;
+       sp->direction = (LRAND() & 1) ? 1 : -1;
+       if (thickness < 0)
+               sp->thickness = -thickness * (float) LRAND() / (float) MAXRAND;
+       else
+               sp->thickness = thickness;
+       if (sp->blob_p)
+               sp->fg_index = MI_BLACK_PIXEL(mi);
+       else
+               sp->fg_index = MI_WHITE_PIXEL(mi);
+
+       if (sp->gc == None) {
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XColor      color;
+
+#ifndef STANDALONE
+                       extern char *background;
+                       extern char *foreground;
+
+                       sp->fg = MI_FG_PIXEL(mi);
+                       sp->bg = MI_BG_PIXEL(mi);
+#endif
+                       sp->blackpixel = MI_BLACK_PIXEL(mi);
+                       sp->whitepixel = MI_WHITE_PIXEL(mi);
+                       if ((sp->cmap = XCreateColormap(display, window,
+                                       MI_VISUAL(mi), AllocNone)) == None) {
+                               free_starfish(display, sp);
+                               return;
+                       }
+                       XSetWindowColormap(display, window, sp->cmap);
+                       (void) XParseColor(display, sp->cmap, "black", &color);
+                       (void) XAllocColor(display, sp->cmap, &color);
+                       MI_BLACK_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, sp->cmap, "white", &color);
+                       (void) XAllocColor(display, sp->cmap, &color);
+                       MI_WHITE_PIXEL(mi) = color.pixel;
+#ifndef STANDALONE
+                       (void) XParseColor(display, sp->cmap, background, &color);
+                       (void) XAllocColor(display, sp->cmap, &color);
+                       MI_BG_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, sp->cmap, foreground, &color);
+                       (void) XAllocColor(display, sp->cmap, &color);
+                       MI_FG_PIXEL(mi) = color.pixel;
+#endif
+                       sp->colors = NULL;
+                       sp->ncolors = 0;
+               }
+               gcv.foreground = sp->fg_index;
+               gcv.fill_rule = EvenOddRule;
+               if ((sp->gc = XCreateGC(display, window,
+                               GCForeground | GCFillRule, &gcv)) == None) {
+                       free_starfish(display, sp);
+                       return;
+               }
+       }
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+/* Set up colour map */
+               if (sp->colors != NULL) {
+                       if (sp->ncolors && !sp->no_colors)
+                               free_colors(display, sp->cmap, sp->colors, sp->ncolors);
+                       (void) free((void *) sp->colors);
+                       sp->colors = NULL;
+               }
+               sp->ncolors = MI_NCOLORS(mi);
+               if (sp->ncolors < 2)
+                       sp->ncolors = 2;
+               if (sp->ncolors <= 2)
+                       sp->mono_p = True;
+               else
+                       sp->mono_p = False;
+
+               if (sp->mono_p)
+                       sp->colors = NULL;
+               else
+                       if ((sp->colors = (XColor *) malloc(sizeof (*sp->colors) *
+                                       (sp->ncolors + 1))) == NULL) {
+                       free_starfish(display, sp);
+                       return;
+               }
+
+               if (sp->mono_p || sp->blob_p)
+                       sp->cycle_p = False;
+               if (!sp->mono_p) {
+                       if (LRAND() % 3)
+                               make_smooth_colormap(mi, sp->cmap, sp->colors, &sp->ncolors,
+                                                    True, &sp->cycle_p);
+                       else
+                               make_uniform_colormap(mi, sp->cmap, sp->colors, &sp->ncolors,
+                                                     True, &sp->cycle_p);
+               }
+               XInstallColormap(display, sp->cmap);
+               if (sp->ncolors < 2) {
+                       sp->ncolors = 2;
+                       sp->no_colors = True;
+               } else
+                       sp->no_colors = False;
+               if (sp->ncolors <= 2)
+                       sp->mono_p = True;
+
+               if (sp->mono_p)
+                       sp->cycle_p = False;
+
+               sp->fg_index = 0;
+
+/*  if (!sp->mono_p && !sp->blob_p)
+   {
+   gcv.foreground = sp->colors[sp->fg_index].pixel;
+   XSetWindowBackground (display, window, gcv.foreground);
+   } */
+
+       } else
+               sp->fg_index = NRAND(MI_NPIXELS(mi));
+
+       sp->size = (MI_WIDTH(mi) < MI_HEIGHT(mi) ? MI_WIDTH(mi) : MI_HEIGHT(mi));
+       if (sp->blob_p)
+               sp->size /= 2;
+       else
+               sp->size = (int) (sp->size * 1.3);
+       sp->winwidth = MI_WIDTH(mi);
+       sp->winheight = MI_HEIGHT(mi);
+       MI_CLEARWINDOW(mi);
+       if (sp->prev != NULL) {
+               (void) free((void *) sp->prev);
+               sp->prev = NULL;
+       }
+       sp->stage = 0;
+       sp->counter = 0;
+       make_starfish(mi);
+}
+
+static Bool
+run_starfish(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       starfishstruct *sp = &starfishes[MI_SCREEN(mi)];
+
+       throb_starfish(sp);
+       spin_starfish(sp);
+       if (!draw1_starfish(display, window, sp->gc, sp))
+               return False;
+
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               if (sp->mono_p) {
+                       if (!sp->blob_p) {
+                               sp->fg_index = (sp->fg_index == MI_BLACK_PIXEL(mi) ?
+                                   MI_BLACK_PIXEL(mi) : MI_BLACK_PIXEL(mi));
+                       }
+                       XSetForeground(display, sp->gc, sp->fg_index);
+               } else {
+                       sp->fg_index = (sp->fg_index + 1) % sp->ncolors;
+                       XSetForeground(display, sp->gc, sp->colors[sp->fg_index].pixel);
+               }
+       } else {
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, sp->gc, MI_PIXEL(mi, sp->fg_index));
+               else if (sp->fg_index)
+                       XSetForeground(display, sp->gc, MI_BLACK_PIXEL(mi));
+               else
+                       XSetForeground(display, sp->gc, MI_WHITE_PIXEL(mi));
+               if (++sp->fg_index >= (unsigned int) MI_NPIXELS(mi))
+                       sp->fg_index = 0;
+       }
+       return True;
+}
+
+void
+draw_starfish(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       starfishstruct *sp;
+
+       if (starfishes == NULL)
+               return;
+       sp = &starfishes[MI_SCREEN(mi)];
+       if (sp->r == NULL)
+               return;
+
+       if (sp->no_colors) {
+               free_starfish(display, sp);
+               init_starfish(mi);
+               return;
+       }
+       MI_IS_DRAWN(mi) = True;
+
+       if (!sp->stage) {
+               if (!run_starfish(mi))
+                       return;
+       } else if (sp->cycle_p) {
+               rotate_colors(display, sp->cmap, sp->colors, sp->ncolors, sp->direction);
+
+               if (!NRAND(512))
+                       sp->direction = -sp->direction;
+       }
+       sp->stage++;
+
+       if (sp->stage > (2 * sp->blob_p + 1) * cyclespeed) {
+               sp->stage = 0;
+               sp->counter++;
+       }
+       if (sp->counter > MI_CYCLES(mi)) {
+               /* Every now and then, restart the mode */
+               init_starfish(mi);
+       }
+}
+
+void
+release_starfish(ModeInfo * mi)
+{
+       if (starfishes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_starfish(MI_DISPLAY(mi), &starfishes[screen]);
+               (void) free((void *) starfishes);
+               starfishes = NULL;
+       }
+}
+
+#endif /* MODE_starfish */
diff --git a/modes/strange.c b/modes/strange.c
new file mode 100644 (file)
index 0000000..abfa54c
--- /dev/null
@@ -0,0 +1,436 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* strange --- strange attractors */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)strange.c    5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by Massimino Pascal <Pascal.Massimon@ens.fr>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: jwz@jwz.org: turned into a standalone program.
+ *              Made it render into an offscreen bitmap and then copy
+ *              that onto the screen, to reduce flicker.
+ *
+ * strange attractors are not so hard to find...
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Strange"
+#define HACK_INIT init_strange
+#define HACK_DRAW draw_strange
+#define strange_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*ncolors: 100 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_strange
+
+ModeSpecOpt strange_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   strange_description =
+{"strange", "init_strange", "draw_strange", "release_strange",
+ "init_strange", "init_strange", NULL, &strange_opts,
+ 1000, 1, 1, 1, 64, 1.0, "",
+ "Shows strange attractors", 0, NULL};
+
+#endif
+
+typedef float DBL;
+typedef int PRM;
+
+#define UNIT (1<<12)
+#define UNIT2 (1<<14)
+/* #define UNIT2 (3140*UNIT/1000) */
+
+#define SKIP_FIRST      100
+#define MAX_POINTS      5500
+#define DBL_To_PRM(x)  (PRM)( (DBL)(UNIT)*(x) )
+
+
+#define DO_FOLD(a) (a)<0 ? -A->Fold[ (-(a))&(UNIT2-1) ] : A->Fold[ (a)&(UNIT2-1) ]
+
+#if 0
+#define DO_FOLD(a) (a)<-UNIT2 ? -A->Fold[(-(a))%UNIT2] : (a)<0 ? -A->Fold[ -(a) ] :\
+(a)>UNIT2 ? A->Fold[ (a)%UNIT2 ] : A->Fold[ (a) ]
+#define DO_FOLD(a) DBL_To_PRM( sin( (DBL)(a)/UNIT ) )
+#define DO_FOLD(a) (a)<0 ? DBL_To_PRM( exp( 16.0*(a)/UNIT2 ) )-1.0 : \
+DBL_To_PRM( 1.0-exp( -16.0*(a)/UNIT2 ) )
+#endif
+
+/******************************************************************/
+
+#define MAX_PRM 3*5
+
+typedef struct _ATTRACTOR {
+       DBL         Prm1[MAX_PRM], Prm2[MAX_PRM];
+       PRM         Prm[MAX_PRM], *Fold;
+       void        (*Iterate) (struct _ATTRACTOR *, PRM, PRM, PRM *, PRM *);
+       XPoint     *Buffer1, *Buffer2;
+       int         Cur_Pt, Max_Pt;
+       int         Col, Count, Speed;
+       int         Width, Height;
+       Pixmap      dbuf;       /* jwz */
+       GC          dbuf_gc;
+} ATTRACTOR;
+
+static ATTRACTOR *Root;
+
+static DBL  Amp_Prm[MAX_PRM] =
+{
+       1.0, 3.5, 3.5, 2.5, 4.7,
+       1.0, 3.5, 3.6, 2.5, 4.7,
+       1.0, 1.5, 2.2, 2.1, 3.5
+};
+static DBL  Mid_Prm[MAX_PRM] =
+{
+       0.0, 1.5, 0.0, .5, 1.5,
+       0.0, 1.5, 0.0, .5, 1.5,
+       0.0, 1.5, -1.0, -.5, 2.5,
+};
+
+static      DBL
+Gauss_Rand(DBL c, DBL A, DBL S)
+{
+       DBL         y;
+
+       y = (DBL) LRAND() / MAXRAND;
+       y = A * (1.0 - exp(-y * y * S)) / (1.0 - exp(-S));
+       if (NRAND(2))
+               return (c + y);
+       else
+               return (c - y);
+}
+
+static void
+Random_Prm(DBL * Prm)
+{
+       int         i;
+
+       for (i = 0; i < MAX_PRM; ++i)
+               Prm[i] = Gauss_Rand(Mid_Prm[i], Amp_Prm[i], 4.0);
+}
+
+/***************************************************************/
+
+   /* 2 examples of non-linear map */
+
+static void
+Iterate_X2(ATTRACTOR * A, PRM x, PRM y, PRM * xo, PRM * yo)
+{
+       PRM         xx, yy, xy, x2y, y2x, Tmp;
+
+       xx = (x * x) / UNIT;
+       x2y = (xx * y) / UNIT;
+       yy = (y * y) / UNIT;
+       y2x = (yy * x) / UNIT;
+       xy = (x * y) / UNIT;
+
+       Tmp = A->Prm[1] * xx + A->Prm[2] * xy + A->Prm[3] * yy + A->Prm[4] * x2y;
+       Tmp = A->Prm[0] - y + (Tmp / UNIT);
+       *xo = DO_FOLD(Tmp);
+       Tmp = A->Prm[6] * xx + A->Prm[7] * xy + A->Prm[8] * yy + A->Prm[9] * y2x;
+       Tmp = A->Prm[5] + x + (Tmp / UNIT);
+       *yo = DO_FOLD(Tmp);
+}
+
+static void
+Iterate_X3(ATTRACTOR * A, PRM x, PRM y, PRM * xo, PRM * yo)
+{
+       PRM         xx, yy, xy, x2y, y2x, Tmp_x, Tmp_y, Tmp_z;
+
+       xx = (x * x) / UNIT;
+       x2y = (xx * y) / UNIT;
+       yy = (y * y) / UNIT;
+       y2x = (yy * x) / UNIT;
+       xy = (x * y) / UNIT;
+
+       Tmp_x = A->Prm[1] * xx + A->Prm[2] * xy + A->Prm[3] * yy + A->Prm[4] * x2y;
+       Tmp_x = A->Prm[0] - y + (Tmp_x / UNIT);
+       Tmp_x = DO_FOLD(Tmp_x);
+
+       Tmp_y = A->Prm[6] * xx + A->Prm[7] * xy + A->Prm[8] * yy + A->Prm[9] * y2x;
+       Tmp_y = A->Prm[5] + x + (Tmp_y / UNIT);
+
+       Tmp_y = DO_FOLD(Tmp_y);
+
+       Tmp_z = A->Prm[11] * xx + A->Prm[12] * xy + A->Prm[13] * yy + A->Prm[14] * y2x;
+       Tmp_z = A->Prm[10] + x + (Tmp_z / UNIT);
+       Tmp_z = UNIT + Tmp_z * Tmp_z / UNIT;
+
+       *xo = (Tmp_x * UNIT) / Tmp_z;
+       *yo = (Tmp_y * UNIT) / Tmp_z;
+}
+
+static void (*Funcs[2]) (ATTRACTOR *, PRM, PRM, PRM *, PRM *) = {
+       Iterate_X2, Iterate_X3
+};
+
+/***************************************************************/
+
+static void
+free_strange(Display *display, ATTRACTOR *A)
+{
+       if (A->Buffer1 != NULL) {
+               (void) free((void *) A->Buffer1);
+               A->Buffer1 = NULL;
+       }
+       if (A->Buffer2 != NULL) {
+               (void) free((void *) A->Buffer2);
+               A->Buffer2 = NULL;
+       }
+       if (A->dbuf) {
+               XFreePixmap(display, A->dbuf);
+               A->dbuf = None;
+       }
+       if (A->dbuf_gc) {
+               XFreeGC(display, A->dbuf_gc);
+               A->dbuf_gc = None;
+       }
+       if (A->Fold != NULL) {
+               (void) free((void *) A->Fold);
+               A->Fold = NULL;
+       }
+}
+
+void
+draw_strange(ModeInfo * mi)
+{
+       int         i, j, n, Cur_Pt;
+       PRM         x, y, xo, yo;
+       DBL         u;
+       XPoint     *Buf;
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       DBL         Lx, Ly;
+       void        (*Iterate) (ATTRACTOR *, PRM, PRM, PRM *, PRM *);
+       PRM         xmin, xmax, ymin, ymax;
+       ATTRACTOR  *A;
+
+       if (Root == NULL)
+               return;
+       A = &Root[MI_SCREEN(mi)];
+       if (A->Fold == NULL)
+               return;
+
+       Cur_Pt = A->Cur_Pt;
+       Iterate = A->Iterate;
+
+       u = (DBL) (A->Count) / 1000.0;
+       for (j = MAX_PRM - 1; j >= 0; --j)
+               A->Prm[j] = DBL_To_PRM((1.0 - u) * A->Prm1[j] + u * A->Prm2[j]);
+
+       x = y = DBL_To_PRM(.0);
+       for (n = SKIP_FIRST; n; --n) {
+               (*Iterate) (A, x, y, &xo, &yo);
+               x = xo + NRAND(8) - 4;
+               y = yo + NRAND(8) - 4;
+       }
+
+       xmax = 0;
+       xmin = UNIT * 4;
+       ymax = 0;
+       ymin = UNIT * 4;
+       A->Cur_Pt = 0;
+       Buf = A->Buffer2;
+       Lx = (DBL) A->Width / UNIT / 2.2;
+       Ly = (DBL) A->Height / UNIT / 2.2;
+       for (n = A->Max_Pt; n; --n) {
+               (*Iterate) (A, x, y, &xo, &yo);
+               Buf->x = (int) (Lx * (x + DBL_To_PRM(1.1)));
+               Buf->y = (int) (Ly * (DBL_To_PRM(1.1) - y));
+               /* (void) fprintf( stderr, "X,Y: %d %d    ", Buf->x, Buf->y ); */
+               Buf++;
+               A->Cur_Pt++;
+               if (xo > xmax)
+                       xmax = xo;
+               else if (xo < xmin)
+                       xmin = xo;
+               if (yo > ymax)
+                       ymax = yo;
+               else if (yo < ymin)
+                       ymin = yo;
+               x = xo + NRAND(8) - 4;
+               y = yo + NRAND(8) - 4;
+       }
+
+       MI_IS_DRAWN(mi) = True;
+
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+
+       if (A->dbuf != None) {          /* jwz */
+               XSetForeground(display, A->dbuf_gc, 0);
+/* XDrawPoints(display, A->dbuf, A->dbuf_gc, A->Buffer1,
+   Cur_Pt,CoordModeOrigin); */
+               XFillRectangle(display, A->dbuf, A->dbuf_gc, 0, 0, A->Width, A->Height);
+       } else
+               XDrawPoints(display, window, gc, A->Buffer1, Cur_Pt, CoordModeOrigin);
+
+       if (MI_NPIXELS(mi) < 2)
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       else
+               XSetForeground(display, gc, MI_PIXEL(mi, A->Col % MI_NPIXELS(mi)));
+
+       if (A->dbuf != None) {
+               XSetForeground(display, A->dbuf_gc, 1);
+               XDrawPoints(display, A->dbuf, A->dbuf_gc, A->Buffer2, A->Cur_Pt,
+                           CoordModeOrigin);
+               XCopyPlane(display, A->dbuf, window, gc, 0, 0, A->Width, A->Height, 0, 0, 1);
+       } else
+               XDrawPoints(display, window, gc, A->Buffer2, A->Cur_Pt, CoordModeOrigin);
+
+       Buf = A->Buffer1;
+       A->Buffer1 = A->Buffer2;
+       A->Buffer2 = Buf;
+
+       if ((xmax - xmin < DBL_To_PRM(.2)) && (ymax - ymin < DBL_To_PRM(.2)))
+               A->Count += 4 * A->Speed;
+       else
+               A->Count += A->Speed;
+       if (A->Count >= 1000) {
+               for (i = MAX_PRM - 1; i >= 0; --i)
+                       A->Prm1[i] = A->Prm2[i];
+               Random_Prm(A->Prm2);
+               A->Count = 0;
+       }
+       A->Col++;
+}
+
+
+/***************************************************************/
+
+void
+init_strange(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       ATTRACTOR  *Attractor;
+
+       if (Root == NULL) {
+               if ((Root = (ATTRACTOR *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (ATTRACTOR))) == NULL)
+                       return;
+       }
+       Attractor = &Root[MI_SCREEN(mi)];
+
+       if (Attractor->Fold == NULL) {
+               int         i;
+
+               if ((Attractor->Fold = (PRM *) calloc(UNIT2 + 1,
+                               sizeof (PRM))) == NULL) {
+                       free_strange(display, Attractor);
+                       return;
+               }
+               for (i = 0; i <= UNIT2; ++i) {
+                       DBL         x;
+
+                       /* x = ( DBL )(i)/UNIT2; */
+                       /* x = sin( M_PI/2.0*x ); */
+                       /* x = sqrt( x ); */
+                       /* x = x*x; */
+                       /* x = x*(1.0-x)*4.0; */
+                       x = (DBL) (i) / UNIT;
+                       x = sin(x);
+                       Attractor->Fold[i] = DBL_To_PRM(x);
+               }
+       }
+       if (Attractor->Buffer1 == NULL)
+               if ((Attractor->Buffer1 = (XPoint *) calloc(MAX_POINTS,
+                               sizeof (XPoint))) == NULL) {
+                       free_strange(display, Attractor);
+                       return;
+               }
+       if (Attractor->Buffer2 == NULL)
+               if ((Attractor->Buffer2 = (XPoint *) calloc(MAX_POINTS,
+                               sizeof (XPoint))) == NULL) {
+                       free_strange(display, Attractor);
+                       return;
+               }
+       Attractor->Max_Pt = MAX_POINTS;
+
+       Attractor->Width = MI_WIDTH(mi);
+       Attractor->Height = MI_HEIGHT(mi);
+       Attractor->Cur_Pt = 0;
+       Attractor->Count = 0;
+       Attractor->Col = NRAND(MI_NPIXELS(mi));
+       Attractor->Speed = 4;
+
+       Attractor->Iterate = Funcs[NRAND(2)];
+       Random_Prm(Attractor->Prm1);
+       Random_Prm(Attractor->Prm2);
+#ifndef NO_DBUF
+       if (Attractor->dbuf != None)
+               XFreePixmap(display, Attractor->dbuf);
+       Attractor->dbuf = XCreatePixmap(display, window,
+            Attractor->Width, Attractor->Height, 1);
+       /* Allocation checked */
+       if (Attractor->dbuf != None) {
+               XGCValues   gcv;
+
+               gcv.foreground = 0;
+               gcv.background = 0;
+               gcv.graphics_exposures = False;
+               gcv.function = GXcopy;
+
+               if (Attractor->dbuf_gc != None)
+                       XFreeGC(display, Attractor->dbuf_gc);
+
+               if ((Attractor->dbuf_gc = XCreateGC(display, Attractor->dbuf,
+                               GCForeground | GCBackground | GCGraphicsExposures | GCFunction,
+                               &gcv)) == None) {
+                       XFreePixmap(display, Attractor->dbuf);
+                       Attractor->dbuf = None;
+               } else {
+                       XFillRectangle(display, Attractor->dbuf, Attractor->dbuf_gc,
+                               0, 0, Attractor->Width, Attractor->Height);
+                       XSetBackground(display, gc, MI_BLACK_PIXEL(mi));
+                       XSetFunction(display, gc, GXcopy);
+               }
+       }
+#endif
+
+       MI_CLEARWINDOW(mi);
+
+       /* Do not want any exposure events from XCopyPlane */
+       XSetGraphicsExposures(display, MI_GC(mi), False);
+}
+
+/***************************************************************/
+
+void
+release_strange(ModeInfo * mi)
+{
+       if (Root != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); ++screen)
+                       free_strange(MI_DISPLAY(mi), &Root[screen]);
+               (void) free((void *) Root);
+               Root = NULL;
+       }
+}
+
+#endif /* MODE_strange */
diff --git a/modes/swarm.c b/modes/swarm.c
new file mode 100644 (file)
index 0000000..b2671e3
--- /dev/null
@@ -0,0 +1,415 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* swarm --- swarm of bees */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)swarm.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 13-Jul-2000: Bee trails implemented by Juan Heguiabehere <jheguia@usa.net>
+ * 10-May-1997: Compatible with xscreensaver
+ * 31-Aug-1990: Adapted from xswarm by Jeff Butterworth <butterwo@ncsc.org>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Swarm"
+#define HACK_INIT init_swarm
+#define HACK_DRAW draw_swarm
+#define swarm_opts xlockmore_opts
+#define DEFAULTS "*delay: 15000 \n" \
+ "*count: -100 \n" \
+ "*size: -100 \n" \
+ "*trackmouse: False \n"
+#define BRIGHT_COLORS
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#include <X11/Xutil.h>
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#endif /* !STANDALONE */
+
+#ifdef MODE_swarm
+
+#define DEF_TRACKMOUSE  "False"
+
+static Bool trackmouse;
+
+static XrmOptionDescRec opts[] =
+{
+        {(char *) "-trackmouse", (char *) ".swarm.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+        {(char *) "+trackmouse", (char *) ".swarm.trackmouse", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+        {(caddr_t *) & trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+        {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"}
+};
+
+ModeSpecOpt swarm_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+
+#ifdef USE_MODULES
+ModStruct   swarm_description =
+{"swarm", "init_swarm", "draw_swarm", "release_swarm",
+ "refresh_swarm", "init_swarm", NULL, &swarm_opts,
+ 15000, -100, 1, -100, 64, 1.0, "",
+ "Shows a swarm of bees following a wasp", 0, NULL};
+
+#endif
+
+#define MINBEES        1               /* min number of bees */
+#define MINTRAIL 3             /* min number of time positions recorded */
+#define BEEACC 2               /* acceleration of bees */
+#define WASPACC 5              /* maximum acceleration of wasp */
+#define BEEVEL 17              /* maximum bee velocity */
+#define WASPVEL 15             /* maximum wasp velocity */
+
+/* Macros */
+#define X(t,b) (sp->x[((t)*sp->beecount+(b))])
+#define Y(t,b) (sp->y[((t)*sp->beecount+(b))])
+#define balance_rand(v)        ((NRAND(v))-((v-1)/2))  /* random number around 0, input odd */
+
+typedef struct {
+       int         pix;
+       int         width;
+       int         height;
+       int         border;     /* wasp won't go closer than this to the edge */
+       int         beecount;   /* number of bees */
+       XSegment   *segs;       /* bee lines */
+       XSegment   *old_segs;   /* old bee lines */
+       float      *x, *y;      /* bee positions x[time][bee#] */
+       float      *xv, *yv;    /* bee velocities xv[bee#] */
+       short       wx[3];
+       short       wy[3];
+       short       wxv;
+       short       wyv;
+       short       tick;
+       short       rolloverflag;
+       short       taillen;
+       Cursor      cursor;
+} swarmstruct;
+
+static swarmstruct *swarms = NULL;
+
+static void
+free_segs(swarmstruct *sp)
+{
+       if (sp->segs != NULL) {
+               (void) free((void *) sp->segs);
+               sp->segs = NULL;
+       }
+       if (sp->old_segs != NULL) {
+               (void) free((void *) sp->old_segs);
+               sp->old_segs = NULL;
+       }
+}
+
+static void
+free_bees(swarmstruct *sp)
+{
+       free_segs(sp);
+       if (sp->x != NULL) {
+               (void) free((void *) sp->x);
+               sp->x = NULL;
+       }
+       if (sp->y != NULL) {
+               (void) free((void *) sp->y);
+               sp->y = NULL;
+       }
+       if (sp->xv != NULL) {
+               (void) free((void *) sp->xv);
+               sp->xv = NULL;
+       }
+       if (sp->yv != NULL) {
+               (void) free((void *) sp->yv);
+               sp->yv = NULL;
+       }
+}
+
+static void
+free_swarm(Display *display, swarmstruct *sp)
+{
+       free_bees(sp);
+       if (sp->cursor != None) {
+               XFreeCursor(display, sp->cursor);
+               sp->cursor = None;
+       }
+}
+
+void
+init_swarm(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         b, t;
+       swarmstruct *sp;
+
+       if (swarms == NULL) {
+               if ((swarms = (swarmstruct *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (swarmstruct))) == NULL)
+                       return;
+       }
+       sp = &swarms[MI_SCREEN(mi)];
+
+       sp->beecount = MI_COUNT(mi);
+       if (sp->beecount < -MINBEES) {
+               sp->beecount = NRAND(-sp->beecount - MINBEES + 1) + MINBEES;
+               /* if sp->beecount is random ... the size can change */
+               free_bees(sp);
+       } else if (sp->beecount < MINBEES)
+               sp->beecount = MINBEES;
+       sp->taillen = MI_SIZE(mi);
+       if (sp->taillen < -MINTRAIL) {
+               /* Change by sqr so its seems more variable */
+               sp->taillen = NRAND((int) sqrt((double) (-sp->taillen - MINTRAIL + 1)));
+               sp->taillen = sp->taillen * sp->taillen + MINTRAIL;
+               free_segs(sp);
+       } else if (sp->taillen < MINTRAIL)
+               sp->taillen = MINTRAIL;
+       sp->width = MI_WIDTH(mi);
+       sp->height = MI_HEIGHT(mi);
+       sp->border = (sp->width + sp->height) / 50;
+       sp->tick = 0;
+       sp->rolloverflag = 0;
+
+       if (trackmouse && !sp->cursor) {        /* Create an invisible cursor */
+               Pixmap      bit;
+               XColor      black;
+
+               black.red = 0;
+               black.green = 0;
+               black.blue = 0;
+               black.flags = DoRed | DoGreen | DoBlue;
+               if ((bit = XCreatePixmapFromBitmapData(display, window,
+                               (char *) "\000", 1, 1, MI_BLACK_PIXEL(mi),
+                               MI_BLACK_PIXEL(mi), 1)) == None) {
+                       free_bees(sp); /* Do not need to free cursor */
+                       return;
+               }
+
+               if ((sp->cursor = XCreatePixmapCursor(display, bit, bit,
+                                &black, &black, 0, 0)) == None) {
+                       XFreePixmap(display, bit);
+                       free_bees(sp);
+                       return;
+               }
+               XFreePixmap(display, bit);
+       }
+       XDefineCursor(display, window, sp->cursor);
+
+       MI_CLEARWINDOW(mi);
+
+       /* Allocate memory. */
+
+       if (sp->segs == NULL) {
+               if (((sp->segs = (XSegment *) malloc(sizeof (XSegment) *
+                       sp->beecount)) == NULL) ||
+                   ((sp->old_segs = (XSegment *) malloc(sizeof (XSegment) *
+                       sp->beecount)) == NULL) ||
+                   ((sp->x = (float *) malloc(sizeof (float) * sp->beecount *
+                       sp->taillen)) == NULL) ||
+                   ((sp->y = (float *) malloc(sizeof (float) * sp->beecount *
+                       sp->taillen)) == NULL) ||
+                   ((sp->xv = (float *) malloc(sizeof (float) *
+                       sp->beecount)) == NULL) ||
+                   ((sp->yv = (float *) malloc(sizeof (float) *
+                       sp->beecount)) == NULL)) {
+                       free_swarm(display, sp);
+                       return;
+               }
+       }
+       /* Initialize point positions, velocities, etc. */
+       if (MI_NPIXELS(mi) > 2)
+               sp->pix = NRAND(MI_NPIXELS(mi));
+
+       /* wasp */
+       sp->wx[0] = sp->border + NRAND(sp->width - 2 * sp->border);
+       sp->wy[0] = sp->border + NRAND(sp->height - 2 * sp->border);
+       sp->wx[1] = sp->wx[0];
+       sp->wy[1] = sp->wy[0];
+       sp->wxv = 0;
+       sp->wyv = 0;
+
+       /* bees */
+       for (b = 0; b < sp->beecount; b++) {
+               X(0, b) = NRAND(sp->width);
+               Y(0, b) = NRAND(sp->height);
+               for (t = 1; t < sp->taillen; t++) {
+                       X(t, b) = X(0, b);
+                       Y(t, b) = Y(0, b);
+               }
+               sp->xv[b] = balance_rand(7);
+               sp->yv[b] = balance_rand(7);
+       }
+}
+
+void
+draw_swarm(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       int         b, newlimit;
+       Bool        track_p = trackmouse;
+       int         cx, cy;
+       short       prev;
+       float       speed;
+       swarmstruct *sp;
+
+       if (swarms == NULL)
+               return;
+       sp = &swarms[MI_SCREEN(mi)];
+       if (sp->segs == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       if (track_p) {
+               Window      r, c;
+               int         rx, ry;
+               unsigned int m;
+
+               (void) XQueryPointer(display, window,
+                                    &r, &c, &rx, &ry, &cx, &cy, &m);
+               if (cx <= sp->border || cy <= sp->border ||
+                   cx >= MI_WIDTH(mi) - 1 - sp->border ||
+                   cy >= MI_HEIGHT(mi) - 1 - sp->border)
+                       track_p = False;
+       }
+       /* <=- Wasp -=> */
+       /* Age the arrays. */
+       sp->wx[2] = sp->wx[1];
+       sp->wx[1] = sp->wx[0];
+       sp->wy[2] = sp->wy[1];
+       sp->wy[1] = sp->wy[0];
+       if (track_p) {
+               sp->wx[0] = cx;
+               sp->wy[0] = cy;
+       } else {
+
+               /* Accelerate */
+               sp->wxv += balance_rand(WASPACC);
+               sp->wyv += balance_rand(WASPACC);
+
+               /* Speed Limit Checks */
+               speed = sqrt((double) sp->wxv * sp->wxv + sp->wyv * sp->wyv);
+               if (speed > WASPVEL) {
+                       newlimit = (int) ((NRAND(WASPVEL) + WASPVEL / 2) / speed);
+                       sp->wxv *= newlimit;
+                       sp->wyv *= newlimit;
+               }
+               /* Move */
+               sp->wx[0] = sp->wx[1] + sp->wxv;
+               sp->wy[0] = sp->wy[1] + sp->wyv;
+
+               /* Bounce Checks */
+               if ((sp->wx[0] < sp->border) || (sp->wx[0] > sp->width - sp->border - 1)) {
+                       sp->wxv = -sp->wxv;
+                       sp->wx[0] += sp->wxv;
+               }
+               if ((sp->wy[0] < sp->border) || (sp->wy[0] > sp->height - sp->border - 1)) {
+                       sp->wyv = -sp->wyv;
+                       sp->wy[0] += sp->wyv;
+               }
+               /* Don't let things settle down. */
+               sp->xv[NRAND(sp->beecount)] += balance_rand(3);
+               sp->yv[NRAND(sp->beecount)] += balance_rand(3);
+       }
+       /* <=- Bees -=> */
+       sp->tick = ++(sp->tick) % (sp->taillen);
+       prev = (sp->tick) ? sp->tick - 1 : sp->taillen - 1; 
+       if (sp->tick == sp->taillen - 1)
+               sp->rolloverflag = 1;
+       for (b = 0; b < sp->beecount; b++) {
+               int         distance, dx, dy;
+
+               /* Accelerate */
+               dx = (int) (sp->wx[1] - X(prev, b));
+               dy = (int) (sp->wy[1] - Y(prev, b));
+               distance = (int) sqrt((double) dx * dx + dy * dy);
+               if (distance == 0)
+                       distance = 1;
+               sp->xv[b] += (dx * BEEACC) / distance;
+               sp->yv[b] += (dy * BEEACC) / distance;
+
+               /* Speed Limit Checks */
+               speed = sqrt(sp->xv[b] * sp->xv[b] + sp->yv[b] * sp->yv[b]);
+               if (speed > BEEVEL) {
+                       newlimit = (int) ((NRAND(BEEVEL) + BEEVEL / 2) / speed);
+                       sp->xv[b] *= newlimit;
+                       sp->yv[b] *= newlimit;
+               }
+               /* Move */
+               X(sp->tick, b) = X(prev, b) + sp->xv[b];
+               Y(sp->tick, b) = Y(prev, b) + sp->yv[b];
+               /* Fill the segment lists. */
+               sp->segs[b].x1 = (short) X(sp->tick, b);
+               sp->segs[b].y1 = (short) Y(sp->tick, b);
+               sp->segs[b].x2 = (short) X(prev, b);
+               sp->segs[b].y2 = (short) Y(prev, b);
+               sp->old_segs[b].x1 = (short) X(((sp->tick+2)%sp->taillen), b);
+               sp->old_segs[b].y1 = (short) Y(((sp->tick+2)%sp->taillen), b);
+               sp->old_segs[b].x2 = (short) X(((sp->tick+1)%sp->taillen), b);
+               sp->old_segs[b].y2 = (short) Y(((sp->tick+1)%sp->taillen), b);
+       }
+
+       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+       XDrawLine(display, window, gc,
+                 sp->wx[1], sp->wy[1], sp->wx[2], sp->wy[2]);
+       if (sp->rolloverflag) {
+               XDrawSegments(display, window, gc, sp->old_segs, sp->beecount);
+       }
+       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       XDrawLine(display, window, gc,
+                 sp->wx[0], sp->wy[0], sp->wx[1], sp->wy[1]);
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(display, gc, MI_PIXEL(mi, sp->pix));
+               if (++sp->pix >= MI_NPIXELS(mi))
+                       sp->pix = 0;
+       }
+       XDrawSegments(display, window, gc, sp->segs, sp->beecount);
+}
+
+void
+release_swarm(ModeInfo * mi)
+{
+       if (swarms != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_swarm(MI_DISPLAY(mi), &swarms[screen]);
+               (void) free((void *) swarms);
+               swarms = NULL;
+       }
+}
+
+void
+refresh_swarm(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_swarm */
diff --git a/modes/swirl.c b/modes/swirl.c
new file mode 100644 (file)
index 0000000..362da18
--- /dev/null
@@ -0,0 +1,1528 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* swirl --- swirly patterns */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)swirl.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1994 M.Dobie <mrd@ecs.soton.ac.uk>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 13-May-1997: jwz@jwz.org: turned into a standalone program.
+ * 21-Apr-1995: improved startup time for TrueColour displays
+ *              (limited to 16bpp to save memory) S.Early <sde1000@cam.ac.uk>
+ * 09-Jan-1995: fixed colour maps (more colourful) and the image now spirals
+ *              outwards from the centre with a fixed number of points drawn
+ *              every iteration. Thanks to M.Dobie <mrd@ecs.soton.ac.uk>.
+ * 1994: written.   Copyright (c) 1994 M.Dobie <mrd@ecs.soton.ac.uk>
+ *       based on original code by R.Taylor
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Swirl"
+#define HACK_INIT init_swirl
+#define HACK_DRAW draw_swirl
+#define swirl_opts xlockmore_opts
+#define DEFAULTS "*delay: 5000 \n" \
+ "*count: 5 \n" \
+ "*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#define WRITABLE_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#include <X11/Xutil.h>
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#include "color.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_swirl
+
+ModeSpecOpt swirl_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   swirl_description =
+{"swirl", "init_swirl", "draw_swirl", "release_swirl",
+ "refresh_swirl", "init_swirl", NULL, &swirl_opts,
+ 5000, 5, 1, 1, 64, 1.0, "",
+ "Shows animated swirling patterns", 0, NULL};
+
+#endif
+
+#include <time.h>
+
+#define MASS            4      /* maximum mass of a knot */
+#define MIN_RES         5      /* minimim resolution (>= MIN_RES) */
+#define MAX_RES         1      /* maximum resolution (>0) */
+#define TWO_PLANE_PCNT  30     /* probability for two plane mode (0-100) */
+#define RESTART         2500   /* number of cycles before restart */
+#define BATCH_DRAW      100    /* points to draw per iteration */
+
+/* knot types */
+typedef enum {
+       NONE = 0,
+       ORBIT = (1 << 0),
+       WHEEL = (1 << 1),
+       PICASSO = (1 << 2),
+       RAY = (1 << 3),
+       HOOK = (1 << 4),
+       ALL = (1 << 5)
+} KNOT_T;
+
+/* a knot */
+typedef struct Knot {
+       int         x, y;       /* position */
+       int         m;          /* mass */
+       KNOT_T      t;          /* type in the first (or only) plane */
+       KNOT_T      T;          /* type in second plane if there is one */
+       int         M;          /* mass in second plane if there is one */
+} KNOT     , *KNOT_P;
+
+/* a colour specification */
+typedef struct Colour {
+       unsigned short r, g, b;
+} COLOUR   , *COLOUR_P;
+
+/* drawing direction */
+typedef enum {
+       DRAW_RIGHT, DRAW_DOWN, DRAW_LEFT, DRAW_UP
+} DIR_T;
+
+/****************************************************************/
+
+/* data associated with a swirl window */
+typedef struct swirl_data {
+       /* window paramaters */
+       Window      win;        /* the window */
+       int         width, height;      /* window size */
+       int         depth;      /* depth */
+       int         rdepth;     /* real depth (for XImage) */
+       Visual     *visual;     /* visual */
+
+       /* swirl drawing parameters */
+       int         n_knots;    /* number of knots */
+       KNOT_P      knots;      /* knot details */
+       KNOT_T      knot_type;  /* general type of knots */
+       int         resolution; /* drawing resolution, 1..5 */
+       int         max_resolution;     /* maximum resolution, MAX_RES */
+       int         r;          /* pixel step */
+       Bool        two_plane;  /* two plane mode? */
+       Bool        first_plane;        /* doing first plane? */
+       int         start_again;        /* when to restart */
+
+       /* spiral drawing parameters */
+       int         x, y;       /* current point */
+       DIR_T       direction;  /* current direction */
+       int         dir_todo, dir_done;         /* how many points in current direction? */
+       int         batch_todo, batch_done;     /* how many points in this batch */
+       Bool        started, drawing;   /* are we drawing? */
+
+       /* image stuff */
+       XImage     *ximage;
+
+       /* colours stuff */
+       int         colours;    /* how many colours possible */
+       int         dcolours;   /* how many colours for shading */
+       Colormap    cmap;       /* colour map for the window */
+       XColor     *rgb_values; /* colour definitions array */
+       Bool        off_screen;
+#ifndef STANDALONE
+       Bool        fixed_colourmap;    /* fixed colourmap? */
+       int         current_map;        /* current colour map, 0..dcolours-1 */
+       unsigned long black, white, bg, fg;     /* black and white pixel values */
+       int         shift;      /* colourmap shift */
+       int         dshift;     /* colourmap shift while drawing */
+       XColor      bgcol, fgcol;       /* foreground and background colour specs */
+#endif                         /* !STANDALONE */
+} SWIRL    , *SWIRL_P;
+
+#ifndef STANDALONE
+#define SWIRLCOLOURS 13
+/* basic colours */
+static COLOUR basic_colours[SWIRLCOLOURS];
+
+#endif /* !STANDALONE */
+
+/* an array of swirls for each screen */
+static SWIRL_P swirls = NULL;
+
+/*-
+   random_no
+
+   Return a random integer between 0 and n inclusive
+
+   -      n is the maximum number
+
+   Returns a random integer */
+
+static int
+random_no(unsigned int n)
+{
+       return ((int) ((n + 1) * (double) LRAND() / MAXRAND));
+}
+
+/****************************************************************/
+
+static void
+free_swirl(Display *display, SWIRL_P swirl)
+{
+       if (swirl->cmap != None) {
+               XFreeColormap(display, swirl->cmap);
+               swirl->cmap = None;
+       }
+       if (swirl->rgb_values != NULL) {
+               XFree((caddr_t) swirl->rgb_values);
+               swirl->rgb_values = NULL;
+       }
+       if (swirl->ximage != None) {
+               (void) XDestroyImage(swirl->ximage);
+               swirl->ximage = None;
+       }
+       if (swirl->knots != NULL) {
+               (void) free((void *) swirl->knots);
+               swirl->knots = NULL;
+       }
+}
+
+/*-
+   initialise_swirl
+
+   Initialise all the swirl data
+
+   -      swirl is the swirl data */
+
+static void
+initialise_swirl(SWIRL_P swirl)
+{
+       swirl->width = 0;       /* width and height of window */
+       swirl->height = 0;
+       swirl->depth = 1;
+       swirl->rdepth = 1;
+       swirl->visual = NULL;
+       swirl->resolution = MIN_RES + 1;        /* current resolution */
+       swirl->max_resolution = MAX_RES;        /* maximum resolution */
+       swirl->n_knots = 0;     /* number of knots */
+       swirl->knot_type = ALL; /* general type of knots */
+       swirl->two_plane = False;       /* two plane mode? */
+       swirl->first_plane = False;     /* doing first plane? */
+       swirl->start_again = -1;        /* restart counter */
+
+       /* drawing parameters */
+       swirl->x = 0;
+       swirl->y = 0;
+       swirl->started = False;
+       swirl->drawing = False;
+
+       /* image stuff */
+       swirl->ximage = NULL;
+
+       /* colours stuff */
+       swirl->colours = 0;     /* how many colours possible */
+       swirl->dcolours = 0;    /* how many colours for shading */
+       swirl->cmap = (Colormap) NULL;
+       swirl->rgb_values = NULL;       /* colour definitions array */
+}
+
+/****************************************************************/
+
+/*-
+ * initialise_image
+ *
+ * Initialise the image for drawing to
+ *
+ * -      swirl is the swirl data
+ */
+static Bool
+initialise_image(Display * dpy, SWIRL_P swirl)
+{
+       unsigned int pad;
+       int         bytes_per_line;
+       int         image_depth = swirl->rdepth;
+       int         data_depth = image_depth;
+       unsigned char *image;   /* image data */
+
+       /* On SGIs at least, using an XImage of depth 24 on a Visual of depth 24
+        *  requires the XImage data to use 32 bits per pixel.  I don't understand
+        *  how one is supposed to determine this -- maybe XListPixmapFormats?
+        *  But on systems that don't work this way, allocating 32 bpp instead of
+        *  24 will be wasteful but non-fatal.  -- jwz, 16-May-97.
+        */
+       if (data_depth >= 24 && data_depth < 32)
+               data_depth = 32;
+
+       /* get the bitmap pad */
+       pad = BitmapPad(dpy);
+       /* destroy the old image (destroy XImage and data) */
+       if (swirl->ximage != NULL)
+               (void) XDestroyImage(swirl->ximage);
+
+       /* how many bytes per line? (bits rounded up to pad) */
+       bytes_per_line = ((swirl->width * data_depth + pad - 1) / pad) * (pad / 8);
+
+       /* allocate space for the image */
+       if ((image = (unsigned char *) calloc(bytes_per_line *
+                       swirl->height, 1)) == NULL) {
+               return False;
+       }
+
+       /* create an ximage with this */
+       if ((swirl->ximage = XCreateImage(dpy, swirl->visual, image_depth, ZPixmap,
+                                    0, (char *) image, swirl->width,
+                                    swirl->height, pad, bytes_per_line)) == None) {
+               (void) free((void *) image);
+               return False;
+       }
+       return True;
+}
+
+/****************************************************************/
+#ifndef STANDALONE
+
+/*-
+ * initialise_colours
+ *
+ * Initialise the list of colours from which the colourmaps are derived
+ *
+ * -      colours is the array to initialise
+ * -      saturation is the saturation value to use 0->grey,
+ *            1.0->full saturation
+ */
+static void
+initialise_colours(COLOUR * colours, float saturate)
+{
+       int         i;
+
+       /* start off fully saturated, medium and bright colours */
+       colours[0].r = 0xA000;
+       colours[0].g = 0x0000;
+       colours[0].b = 0x0000;
+       colours[1].r = 0xD000;
+       colours[1].g = 0x0000;
+       colours[1].b = 0x0000;
+       colours[2].r = 0x0000;
+       colours[2].g = 0x6000;
+       colours[2].b = 0x0000;
+       colours[3].r = 0x0000;
+       colours[3].g = 0x9000;
+       colours[3].b = 0x0000;
+       colours[4].r = 0x0000;
+       colours[4].g = 0x0000;
+       colours[4].b = 0xC000;
+       colours[5].r = 0x0000;
+       colours[5].g = 0x0000;
+       colours[5].b = 0xF000;
+       colours[6].r = 0xA000;
+       colours[6].g = 0x6000;
+       colours[6].b = 0x0000;
+       colours[7].r = 0xD000;
+       colours[7].g = 0x9000;
+       colours[7].b = 0x0000;
+       colours[8].r = 0xA000;
+       colours[8].g = 0x0000;
+       colours[8].b = 0xC000;
+       colours[9].r = 0xD000;
+       colours[9].g = 0x0000;
+       colours[9].b = 0xF000;
+       colours[10].r = 0x0000;
+       colours[10].g = 0x6000;
+       colours[10].b = 0xC000;
+       colours[11].r = 0x0000;
+       colours[11].g = 0x9000;
+       colours[11].b = 0xF000;
+       colours[12].r = 0xA000;
+       colours[12].g = 0xA000;
+       colours[12].b = 0xA000;
+
+       /* add white for low saturation */
+       for (i = 0; i < SWIRLCOLOURS - 1; i++) {
+               unsigned short max_rg, max;
+
+               /* what is the max intensity for this colour? */
+               max_rg = (colours[i].r > colours[i].g) ? colours[i].r : colours[i].g;
+               max = (max_rg > colours[i].b) ? max_rg : colours[i].b;
+
+               /* bring elements up to max as saturation approaches 0.0 */
+               colours[i].r += (unsigned short) ((float) (1.0 - saturate) *
+                                              ((float) max - colours[i].r));
+               colours[i].g += (unsigned short) ((float) (1.0 - saturate) *
+                                              ((float) max - colours[i].g));
+               colours[i].b += (unsigned short) ((float) (1.0 - saturate) *
+                                              ((float) max - colours[i].b));
+       }
+}
+
+/****************************************************************/
+
+/*-
+ * set_black_and_white
+ *
+ * Set the entries for foreground & background pixels and
+ * WhitePixel & BlackPixel in an array of colour specifications.
+ *
+ * -      swirl is the swirl data
+ * -      values is the array of specifications
+ */
+static void
+set_black_and_white(SWIRL_P swirl, XColor * values)
+{
+       unsigned long white, black;
+
+       /* where is black and white? */
+       white = swirl->white;
+       black = swirl->black;
+
+       /* set black and white up */
+       values[white].flags = DoRed | DoGreen | DoBlue;
+       values[white].pixel = white;
+       values[white].red = 0xFFFF;
+       values[white].green = 0xFFFF;
+       values[white].blue = 0xFFFF;
+       values[black].flags = DoRed | DoGreen | DoBlue;
+       values[black].pixel = black;
+       values[black].red = 0;
+       values[black].green = 0;
+       values[black].blue = 0;
+
+       /* copy the colour specs from the original entries */
+       values[swirl->bg] = swirl->bgcol;
+       values[swirl->fg] = swirl->fgcol;
+}
+
+/****************************************************************/
+
+/*-
+ * set_colour
+ *
+ * Set an entry in an array of XColor specifications. The given entry will be
+ * set to the given colour. If the entry corresponds to the foreground,
+ * background, WhitePixel, or BlackPixel it is ignored and the given colour
+ * is is put in the next entry.
+ *
+ * Therefore, the given colour may be placed up to four places after the
+ * specified entry in the array, if foreground, background, white, or black
+ * intervene.
+ *
+ * -      swirl is the swirl data
+ * -      value points to a pointer to the array entry. It gets updated to
+ *            point to the next free entry.
+ * -      pixel points to the current pixel number. It gets updated.
+ * -      c points to the colour to add
+ */
+static void
+set_colour(SWIRL_P swirl, XColor ** value, unsigned long *pixel, COLOUR_P c)
+{
+       Bool        done;
+       unsigned long black, white, bg, fg;
+
+       /* where are black, white, background, foreground? */
+       black = swirl->black;
+       white = swirl->white;
+       bg = swirl->bg;
+       fg = swirl->fg;
+
+       /* haven't set it yet */
+       done = False;
+
+       /* try and set the colour */
+       while (!done) {
+               (**value).flags = DoRed | DoGreen | DoBlue;
+               (**value).pixel = *pixel;
+
+               /* white, black, bg, fg, or a colour? */
+               if ((*pixel != black) && (*pixel != white) &&
+                   (*pixel != bg) && (*pixel != fg)) {
+                       (**value).red = c->r;
+                       (**value).green = c->g;
+                       (**value).blue = c->b;
+
+                       /* now we've done it */
+                       done = True;
+               }
+               /* next pixel */
+               (*value)++;
+               (*pixel)++;
+       }
+}
+
+/****************************************************************/
+
+/*-
+ * get_colour
+ *
+ * Get an entry from an array of XColor specifications. The next colour from
+ * the array will be returned. Foreground, background, WhitePixel, or
+ * BlackPixel will be ignored.
+ *
+ * -      swirl is the swirl data
+ * -      value points the array entry. It is updated to point to the entry
+ *            following the one returned.
+ * -      c is set to the colour found
+ */
+static void
+get_colour(SWIRL_P swirl, XColor ** value, COLOUR_P c)
+{
+       Bool        done;
+       unsigned long black, white, bg, fg;
+
+       /* where is white and black? */
+       black = swirl->black;
+       white = swirl->white;
+       bg = swirl->bg;
+       fg = swirl->fg;
+
+       /* haven't set it yet */
+       done = False;
+
+       /* try and set the colour */
+       while (!done) {
+               /* black, white or a colour? */
+               if (((*value)->pixel != black) && ((*value)->pixel != white) &&
+                   ((*value)->pixel != bg) && ((*value)->pixel != fg)) {
+                       c->r = (*value)->red;
+                       c->g = (*value)->green;
+                       c->b = (*value)->blue;
+
+                       /* now we've done it */
+                       done = True;
+               }
+               /* next value */
+               (*value)++;
+       }
+}
+
+/****************************************************************/
+
+/*-
+ *  interpolate
+ *
+ * Generate n colours between c1 and c2.  n XColors at *value are set up with
+ * ascending pixel values.
+ *
+ * If the pixel range includes BlackPixel or WhitePixel they are set to black
+ * and white respectively but otherwise ignored. Therefore, up to n+2 colours
+ * may actually be set by this function.
+ *
+ * -      swirl is the swirl data
+ * -      values points a pointer to an array of XColors to update
+ * -      pixel points to the pixel number to start at
+ * -      k n is the number of colours to generate
+ * -      c1, c2 are the colours to interpolate between
+ */
+static void
+interpolate(SWIRL_P swirl, XColor ** values, unsigned long *pixel, int n, COLOUR_P c1, COLOUR_P c2)
+{
+       int         i, r, g, b;
+       COLOUR      c;
+       unsigned short maxv;
+
+       /* maximum value */
+       maxv = (255 << 8);
+
+       for (i = 0; i < n / 2 && (int) *pixel < swirl->colours; i++) {
+               /* work out the colour */
+               r = c1->r + 2 * i * ((int) c2->r) / n;
+               c.r = (r > (int) maxv) ? maxv : r;
+               g = c1->g + 2 * i * ((int) c2->g) / n;
+               c.g = (g > (int) maxv) ? maxv : g;
+               b = c1->b + 2 * i * ((int) c2->b) / n;
+               c.b = (b > (int) maxv) ? maxv : b;
+
+               /* set it up */
+               set_colour(swirl, values, pixel, &c);
+       }
+       for (i = n / 2; i >= 0 && (int) *pixel < swirl->colours; i--) {
+               r = c2->r + 2 * i * ((int) c1->r) / n;
+               c.r = (r > (int) maxv) ? maxv : r;
+               g = c2->g + 2 * i * ((int) c1->g) / n;
+               c.g = (g > (int) maxv) ? maxv : g;
+               b = c2->b + 2 * i * ((int) c1->b) / n;
+               c.b = (b > (int) maxv) ? maxv : b;
+
+               /* set it up */
+               set_colour(swirl, values, pixel, &c);
+       }
+}
+
+/****************************************************************/
+
+/*-
+ * basic_map
+ *
+ * Generate a `random' closed loop colourmap that occupies the whole colour
+ * map.
+ *
+ * -      swirl is the swirl data
+ * -      values is the array of colour definitions to set up
+ */
+static void
+basic_map(SWIRL_P swirl, XColor * values)
+{
+       COLOUR      c[3];
+       int         i;
+       unsigned short r1, g1, b1, r2, g2, b2, r3, g3, b3;
+       int         L1, L2, L3, L;
+       unsigned long pixel;
+       XColor     *value;
+
+       /* start at the beginning of the colour map */
+       pixel = 0;
+       value = values;
+
+       /* choose 3 different basic colours at random */
+       for (i = 0; i < 3;) {
+               int         j;
+               Bool        same;
+
+               /* choose colour i */
+               c[i] = basic_colours[random_no(SWIRLCOLOURS - 1)];
+
+               /* assume different */
+               same = False;
+
+               /* different from the rest? */
+               for (j = 0; j < i; j++)
+                       if ((c[i].r == c[j].r) &&
+                           (c[i].g == c[j].g) &&
+                           (c[i].b == c[j].b))
+                               same = True;
+
+               /* ready for the next colour? */
+               if (!same)
+                       i++;
+       }
+
+       /* extract components into variables */
+       r1 = c[0].r;
+       g1 = c[0].g;
+       b1 = c[0].b;
+       r2 = c[1].r;
+       g2 = c[1].g;
+       b2 = c[1].b;
+       r3 = c[2].r;
+       g3 = c[2].g;
+       b3 = c[2].b;
+
+       /* work out the lengths of each side of the triangle */
+       L1 = (int) sqrt((((double) r1 - r2) * ((double) r1 - r2) +
+                        ((double) g1 - g2) * ((double) g1 - g2) +
+                        ((double) b1 - b2) * ((double) b1 - b2)));
+
+       L2 = (int) sqrt((((double) r3 - r2) * ((double) r3 - r2) +
+                        ((double) g3 - g2) * ((double) g3 - g2) +
+                        ((double) b3 - b2) * ((double) b3 - b2)));
+
+       L3 = (int) sqrt((((double) r1 - r3) * ((double) r1 - r3) +
+                        ((double) g1 - g3) * ((double) g1 - g3) +
+                        ((double) b1 - b3) * ((double) b1 - b3)));
+
+       L = L1 + L2 + L3;
+
+       /* allocate colours in proportion to the lengths of the sides */
+       interpolate(swirl, &value, &pixel,
+                   (int) ((double) swirl->dcolours * ((double) L1 / (double) L)) + 1, c, c + 1);
+       interpolate(swirl, &value, &pixel,
+                   (int) ((double) swirl->dcolours * ((double) L2 / (double) L)) + 1, c + 1, c + 2);
+       interpolate(swirl, &value, &pixel,
+                   (int) ((double) swirl->dcolours * ((double) L3 / (double) L)) + 1, c + 2, c);
+
+       /* fill up any remaining slots (due to rounding) */
+       while ((int) pixel < swirl->colours) {
+               /* repeat the last colour */
+               set_colour(swirl, &value, &pixel, c);
+       }
+
+       /* ensure black and white are correct */
+       if (!swirl->fixed_colourmap)
+               set_black_and_white(swirl, values);
+}
+
+/****************************************************************/
+
+/*-
+ * pre_rotate
+ *
+ * Generate pre-rotated versions of the colour specifications
+ *
+ * -      swirl is the swirl data
+ * -      values is an array of colour specifications
+ */
+static void
+pre_rotate(SWIRL_P swirl, XColor * values)
+{
+       int         i, j;
+       XColor     *src, *dest;
+       int         dcolours;
+       unsigned long pixel;
+
+       /* how many colours to display? */
+       dcolours = swirl->dcolours;
+
+       /* start at the first map */
+       src = values;
+       dest = values + swirl->colours;
+
+       /* generate dcolours-1 rotated maps */
+       for (i = 0; i < dcolours - 1; i++) {
+               COLOUR      first;
+
+               /* start at the first pixel */
+               pixel = 0;
+
+               /* remember the first one and skip it */
+               get_colour(swirl, &src, &first);
+
+               /* put a rotated version of src at dest */
+               for (j = 0; j < dcolours - 1; j++) {
+                       COLOUR      c;
+
+                       /* get the source colour */
+                       get_colour(swirl, &src, &c);
+
+                       /* set the colour */
+                       set_colour(swirl, &dest, &pixel, &c);
+               }
+
+               /* put the first one at the end */
+               set_colour(swirl, &dest, &pixel, &first);
+
+               /* NB: src and dest should now be ready for the next table */
+
+               /* ensure black and white are properly set */
+               set_black_and_white(swirl, src);
+       }
+}
+
+/****************************************************************/
+
+/*-
+ * create_colourmap
+ *
+ * Create a read/write colourmap to use
+ *
+ * -      swirl is the swirl data
+ */
+
+static Bool
+create_colourmap(ModeInfo * mi, SWIRL_P swirl)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         preserve = 0;
+       int         n_rotations;
+       int         i;
+       Bool        truecolor;
+       unsigned long redmask, greenmask, bluemask;
+
+       swirl->fixed_colourmap = !setupColormap(mi, &(swirl->colours),
+                               &truecolor, &redmask, &greenmask, &bluemask);
+
+       /* how many colours should we animate? */
+
+       if (MI_NPIXELS(mi) < 2)
+               return True; /* actually a third case */
+
+       /* how fast to shift the colourmap? */
+       swirl->shift = (swirl->colours > 64) ? swirl->colours / 64 : 1;
+       swirl->dshift = (swirl->shift > 1) ? swirl->shift * 2 : 1;
+
+       /* create a colour map */
+       if (!swirl->fixed_colourmap) {
+               swirl->current_map = 0;         /* current colour map, 0..dcolours-1 */
+
+               /* set up fg fb colour specs */
+               swirl->black = MI_BLACK_PIXEL(mi);
+               swirl->white = MI_WHITE_PIXEL(mi);
+               swirl->bg = MI_BG_PIXEL(mi);
+               swirl->fg = MI_FG_PIXEL(mi);
+               preserve = preserveColors(swirl->black, swirl->white,
+                                         swirl->bg, swirl->fg);
+               swirl->bgcol.pixel = swirl->bg;
+               swirl->fgcol.pixel = swirl->fg;
+               XQueryColor(display, MI_COLORMAP(mi), &(swirl->bgcol));
+               XQueryColor(display, MI_COLORMAP(mi), &(swirl->fgcol));
+               if (swirl->cmap) {
+                       XFreeColormap(display, swirl->cmap);
+               }
+               if ((swirl->cmap = XCreateColormap(display, swirl->win,
+                                swirl->visual, AllocAll)) == None) {
+                       return False;
+               }
+       }
+       swirl->dcolours = (swirl->colours > preserve + 1) ?
+               swirl->colours - preserve : swirl->colours;
+       /* how may colour map rotations are there? */
+       n_rotations = (swirl->fixed_colourmap) ? 1 : swirl->dcolours;
+
+       /* allocate space for colour definitions (if not already there) */
+       if (swirl->rgb_values != NULL)
+               XFree((caddr_t) swirl->rgb_values);
+       if ((swirl->rgb_values = (XColor *) calloc((swirl->colours + 3) *
+                        n_rotations, sizeof (XColor))) == NULL) {
+               return False;
+       }
+
+       /* select a set of colours for the colour map */
+       basic_map(swirl, swirl->rgb_values);
+
+       /* are we rotating them? */
+       if (!swirl->fixed_colourmap) {
+               /* generate rotations of the colour maps */
+               pre_rotate(swirl, swirl->rgb_values);
+
+               /* store the colours in the colour map */
+               XStoreColors(display, swirl->cmap, swirl->rgb_values, swirl->colours);
+       } else {
+               if (truecolor) {
+                       int         rsh, gsh, bsh;
+                       unsigned long int t;
+
+                       t = redmask;
+                       for (i = 0; (int) t > 0; i++, t >>= 1);
+                       rsh = 16 - i;
+                       t = greenmask;
+                       for (i = 0; (int) t > 0; i++, t >>= 1);
+                       gsh = 16 - i;
+                       t = bluemask;
+                       for (i = 0; (int) t > 0; i++, t >>= 1);
+                       bsh = 16 - i;
+                       for (i = 0; i < swirl->colours; i++)
+                               swirl->rgb_values[i].pixel =
+                                       ((rsh > 0 ? (swirl->rgb_values[i].red) >> rsh :
+                                         (swirl->rgb_values[i].red) << (-rsh)) & redmask) |
+                                       ((gsh > 0 ? (swirl->rgb_values[i].green) >> gsh :
+                                         (swirl->rgb_values[i].green) << (-gsh)) & greenmask) |
+                                       ((bsh > 0 ? (swirl->rgb_values[i].blue) >> bsh :
+                                         (swirl->rgb_values[i].blue) << (-bsh)) & bluemask);
+               } else {
+                       /* lookup the colours in the fixed colour map */
+                       for (i = 0; i < swirl->colours; i++)
+                               (void) XAllocColor(display, MI_COLORMAP(mi),
+                                                  &(swirl->rgb_values[i]));
+               }
+       }
+       return True;
+}
+
+/****************************************************************/
+
+/*-
+ * install_map
+ *
+ * Install a new set of colours into the colour map
+ *
+ * -      dpy is the display
+ * -      swirl is the swirl data
+ * -      shift is the amount to rotate the colour map by
+ */
+static void
+install_map(Display * dpy, SWIRL_P swirl, int shift)
+{
+       if (!swirl->fixed_colourmap) {
+               /* shift the colour map */
+               swirl->current_map = (swirl->current_map + shift) %
+                       swirl->dcolours;
+
+               /* store it */
+               XStoreColors(dpy, swirl->cmap,
+                            swirl->rgb_values +
+                            swirl->current_map * swirl->colours,
+                            swirl->colours);
+       }
+}
+
+#endif /* !STANDALONE */
+/****************************************************************/
+
+/*-
+ * create_knots
+ *
+ * Initialise the array of knot
+ *
+ * swirl is the swirl data
+ */
+static Bool
+create_knots(SWIRL_P swirl)
+{
+       int         k;
+       Bool        orbit, wheel, picasso, ray, hook;
+       KNOT_P      knot;
+
+       /* create array for knots */
+       if (swirl->knots)
+               (void) free((void *) swirl->knots);
+       if ((swirl->knots = (KNOT_P) calloc(swirl->n_knots,
+                       sizeof (KNOT))) == NULL) {
+               return False;
+       }
+
+       /* no knots yet */
+       orbit = wheel = picasso = ray = hook = False;
+
+       /* what types do we have? */
+       if ((int) swirl->knot_type & (int) ALL) {
+               orbit = wheel = ray = hook = True;
+       } else {
+               if ((int) swirl->knot_type & (int) ORBIT)
+                       orbit = True;
+               if ((int) swirl->knot_type & (int) WHEEL)
+                       wheel = True;
+               if ((int) swirl->knot_type & (int) PICASSO)
+                       picasso = True;
+               if ((int) swirl->knot_type & (int) RAY)
+                       ray = True;
+               if ((int) swirl->knot_type & (int) HOOK)
+                       hook = True;
+       }
+
+       /* initialise each knot */
+       knot = swirl->knots;
+       for (k = 0; k < swirl->n_knots; k++) {
+               /* position */
+               knot->x = random_no((unsigned int) swirl->width);
+               knot->y = random_no((unsigned int) swirl->height);
+
+               /* mass */
+               knot->m = random_no(MASS) + 1;
+
+               /* can be negative */
+               if (random_no(100) > 50)
+                       knot->m *= -1;
+
+               /* type */
+               knot->t = NONE;
+               while (knot->t == NONE) {
+                       /* choose a random one from the types available */
+                       switch (random_no(4)) {
+                               case 0:
+                                       if (orbit)
+                                               knot->t = ORBIT;
+                                       break;
+                               case 1:
+                                       if (wheel)
+                                               knot->t = WHEEL;
+                                       break;
+                               case 2:
+                                       if (picasso)
+                                               knot->t = PICASSO;
+                                       break;
+                               case 3:
+                                       if (ray)
+                                               knot->t = RAY;
+                                       break;
+                               case 4:
+                                       if (hook)
+                                               knot->t = HOOK;
+                                       break;
+                       }
+               }
+
+               /* if two planes, do same for second plane */
+               if (swirl->two_plane) {
+                       knot->T = NONE;
+                       while (knot->T == NONE || knot->T == knot->t) {
+                               /* choose a different type */
+                               switch (random_no(4)) {
+                                       case 0:
+                                               if (orbit)
+                                                       knot->T = ORBIT;
+                                               break;
+                                       case 1:
+                                               if (wheel)
+                                                       knot->T = WHEEL;
+                                               break;
+                                       case 2:
+                                               if (picasso)
+                                                       knot->T = PICASSO;
+                                               break;
+                                       case 3:
+                                               if (ray)
+                                                       knot->T = RAY;
+                                               break;
+                                       case 4:
+                                               if (hook)
+                                                       knot->T = HOOK;
+                                               break;
+                               }
+                       }
+               }
+               /* next knot */
+               knot++;
+       }
+       return True;
+}
+
+/****************************************************************/
+
+/*-
+ * do_point
+ *
+ * Work out the pixel value at i, j. Ensure it does not clash with BlackPixel
+ * or WhitePixel.
+ *
+ * -      swirl is the swirl data
+ * -      i, j is the point to calculate
+ *
+ * Returns the value of the point
+ */
+static unsigned long
+do_point(SWIRL_P swirl, int i, int j)
+{
+       int         tT, k, add, value;
+       unsigned long colour_value;
+       double      dx, dy, theta, dist;
+       int         dcolours, qcolours;
+       double      rads;
+       KNOT_P      knot;
+
+       /* how many colours? */
+       dcolours = swirl->dcolours;
+       qcolours = dcolours / 4;
+
+       /* colour step round a circle */
+       rads = (double) dcolours / (2.0 * M_PI);
+
+       /* start at zero */
+       value = 0;
+
+       /* go through all the knots */
+       knot = swirl->knots;
+       for (k = 0; k < swirl->n_knots; k++) {
+               dx = i - knot->x;
+               dy = j - knot->y;
+
+               /* in two_plane mode get the appropriate knot type */
+               if (swirl->two_plane)
+                       tT = (int) ((swirl->first_plane) ? knot->t : knot->T);
+               else
+                       tT = (int) knot->t;
+
+               /* distance from knot */
+               dist = sqrt(dx * dx + dy * dy);
+
+               /* nothing to add at first */
+               add = 0;
+
+               /* work out the contribution (if close enough) */
+               if (dist > 0.1)
+                       switch (tT) {
+                               case ORBIT:
+                                       add = (int) (dcolours / (1.0 + 0.01 * abs(knot->m) * dist));
+                                       break;
+                               case WHEEL:
+                                       /* Avoid atan2: DOMAIN error message */
+                                       if (dy == 0.0 && dx == 0.0)
+                                               theta = 1.0;
+                                       else
+                                               theta = (atan2(dy, dx) + M_PI) / M_PI;
+                                       if (theta < 1.0)
+                                               add = (int) (dcolours * theta +
+                                                 sin(0.1 * knot->m * dist) *
+                                               qcolours * exp(-0.01 * dist));
+                                       else
+                                               add = (int) (dcolours * (theta - 1.0) +
+                                                 sin(0.1 * knot->m * dist) *
+                                               qcolours * exp(-0.01 * dist));
+                                       break;
+                               case PICASSO:
+                                       add = (int) (dcolours *
+                                         fabs(cos(0.002 * knot->m * dist)));
+                                       break;
+                               case RAY:
+                                       /* Avoid atan2: DOMAIN error message */
+                                       if (dy == 0.0 && dx == 0.0)
+                                               add = 0;
+                                       else
+                                               add = (int) (dcolours * fabs(sin(2.0 * atan2(dy, dx))));
+
+                                       break;
+                               case HOOK:
+                                       /* Avoid atan2: DOMAIN error message */
+                                       if (dy == 0.0 && dx == 0.0)
+                                               add = (int) (0.05 * (abs(knot->m) - 1) * dist);
+                                       else
+                                               add = (int) (rads * atan2(dy, dx) +
+                                                            0.05 * (abs(knot->m) - 1) * dist);
+                                       break;
+                       }
+               /* for a +ve mass add on the contribution else take it off */
+               if (knot->m > 0)
+                       value += add;
+               else
+                       value -= add;
+
+               /* next knot */
+               knot++;
+       }
+
+       /* toggle plane */
+       swirl->first_plane = (!swirl->first_plane);
+
+       /* make sure we handle -ve values properly */
+       if (value >= 0)
+               colour_value = (value % dcolours) + 2;
+       else
+               colour_value = dcolours - (abs((int) value) % (dcolours - 1));
+
+#ifndef STANDALONE
+       /* if bg and fg are 0 and 1 we should be OK, but just in case */
+       while ((dcolours > 2) &&
+              (((colour_value % swirl->colours) == swirl->black) ||
+               ((colour_value % swirl->colours) == swirl->white) ||
+               ((colour_value % swirl->colours) == swirl->bg) ||
+               ((colour_value % swirl->colours) == swirl->fg))) {
+               colour_value++;
+       }
+#endif /* !STANDALONE */
+
+       /* definitely make sure it is in range */
+       colour_value = colour_value % swirl->colours;
+
+       /* lookup the pixel value if necessary */
+#ifndef STANDALONE
+       if (swirl->fixed_colourmap && swirl->dcolours > 2)
+#endif
+               colour_value = swirl->rgb_values[colour_value].pixel;
+
+       /* return it */
+       return colour_value;
+}
+
+/****************************************************************/
+
+/*-
+ * draw_block
+ *
+ * Draw a square block of points with the same value.
+ *
+ * -      ximage is the XImage to draw on.
+ * -      x, y is the top left corner
+ * -      s is the length of each side
+ * -      v is the value
+ */
+static void
+draw_block(XImage * ximage, int x, int y, int s, unsigned long v)
+{
+       int         a, b;
+
+       for (a = 0; a < s; a++)
+               for (b = 0; b < s; b++) {
+                       XPutPixel(ximage, x + b, y + a, v);
+               }
+}
+
+/****************************************************************/
+
+/*-
+ * draw_point  Draw the current point in a swirl pattern onto the XImage
+ *
+ * -    swirl is the swirl
+ * -    win is the window to update
+ */
+static void
+draw_point(ModeInfo * mi, SWIRL_P swirl)
+{
+       int         r;
+       int         x, y;
+
+       /* get current point coordinates and resolution */
+       x = swirl->x;
+       y = swirl->y;
+       r = swirl->r;
+
+       /* check we are within the window */
+       if ((x < 0) || (x > swirl->width - r) || (y < 0) || (y > swirl->height - r))
+               return;
+
+       /* what style are we drawing? */
+       if (swirl->two_plane) {
+               int         r2;
+
+               /* halve the block size */
+               r2 = r / 2;
+
+               /* interleave blocks at half r */
+               draw_block(swirl->ximage, x, y, r2, do_point(swirl, x, y));
+               draw_block(swirl->ximage, x + r2, y, r2, do_point(swirl, x + r2, y));
+               draw_block(swirl->ximage, x + r2, y + r2, r2, do_point(swirl,
+                                                           x + r2, y + r2));
+               draw_block(swirl->ximage, x, y + r2, r2, do_point(swirl, x, y + r2));
+       } else
+               draw_block(swirl->ximage, x, y, r, do_point(swirl, x, y));
+
+       /* update the screen */
+/*-
+ * PURIFY 4.0.1 on SunOS4 and on Solaris 2 reports a 256 byte memory leak on
+ * the next line. */
+       (void) XPutImage(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi), swirl->ximage,
+                        x, y, x, y, r, r);
+}
+
+/****************************************************************/
+
+/*-
+ * next_point  Move to the next point in the spiral pattern
+ *  -    swirl is the swirl
+ *  -    win is the window to update
+ */
+static void
+next_point(SWIRL_P swirl)
+{
+       /* more to do in this direction? */
+       if (swirl->dir_done < swirl->dir_todo) {
+               /* move in the current direction */
+               switch (swirl->direction) {
+                       case DRAW_RIGHT:
+                               swirl->x += swirl->r;
+                               break;
+                       case DRAW_DOWN:
+                               swirl->y += swirl->r;
+                               break;
+                       case DRAW_LEFT:
+                               swirl->x -= swirl->r;
+                               break;
+                       case DRAW_UP:
+                               swirl->y -= swirl->r;
+                               break;
+               }
+
+               /* done another point */
+               swirl->dir_done++;
+       } else {
+               /* none drawn yet */
+               swirl->dir_done = 0;
+
+               /* change direction - check and record if off screen */
+               switch (swirl->direction) {
+                       case DRAW_RIGHT:
+                               swirl->direction = DRAW_DOWN;
+                               if (swirl->x > swirl->width - swirl->r) {
+                                       /* skip these points */
+                                       swirl->dir_done = swirl->dir_todo;
+                                       swirl->y += (swirl->dir_todo * swirl->r);
+
+                                       /* check for finish */
+                                       if (swirl->off_screen)
+                                               swirl->drawing = False;
+                                       swirl->off_screen = True;
+                               } else
+                                       swirl->off_screen = False;
+                               break;
+                       case DRAW_DOWN:
+                               swirl->direction = DRAW_LEFT;
+                               swirl->dir_todo++;
+                               if (swirl->y > swirl->height - swirl->r) {
+                                       /* skip these points */
+                                       swirl->dir_done = swirl->dir_todo;
+                                       swirl->x -= (swirl->dir_todo * swirl->r);
+
+                                       /* check for finish */
+                                       if (swirl->off_screen)
+                                               swirl->drawing = False;
+                                       swirl->off_screen = True;
+                               } else
+                                       swirl->off_screen = False;
+                               break;
+                       case DRAW_LEFT:
+                               swirl->direction = DRAW_UP;
+                               if (swirl->x < 0) {
+                                       /* skip these points */
+                                       swirl->dir_done = swirl->dir_todo;
+                                       swirl->y -= (swirl->dir_todo * swirl->r);
+
+                                       /* check for finish */
+                                       if (swirl->off_screen)
+                                               swirl->drawing = False;
+                                       swirl->off_screen = True;
+                               } else
+                                       swirl->off_screen = False;
+                               break;
+                       case DRAW_UP:
+                               swirl->direction = DRAW_RIGHT;
+                               swirl->dir_todo++;
+                               if (swirl->y < 0) {
+                                       /* skip these points */
+                                       swirl->dir_done = swirl->dir_todo;
+                                       swirl->x += (swirl->dir_todo * swirl->r);
+
+                                       /* check for finish */
+                                       if (swirl->off_screen)
+                                               swirl->drawing = False;
+                                       swirl->off_screen = True;
+                               } else
+                                       swirl->off_screen = False;
+                               break;
+               }
+       }
+}
+
+/****************************************************************/
+
+/*-
+ * init_swirl
+ *
+ * Initialise things for swirling
+ *
+ * -      win is the window to draw in
+ */
+void
+init_swirl(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       SWIRL_P     swirl;
+
+       /* does the swirls array exist? */
+       if (swirls == NULL) {
+               int         i;
+
+               /* allocate an array, one entry for each screen */
+               if ((swirls = (SWIRL_P) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (SWIRL))) == NULL)
+                       return;
+
+               /* initialise them all */
+               for (i = 0; i < MI_NUM_SCREENS(mi); i++)
+                       initialise_swirl(&swirls[i]);
+       }
+       /* get a pointer to this swirl */
+       swirl = &(swirls[MI_SCREEN(mi)]);
+
+       /* get window parameters */
+       swirl->win = window;
+       swirl->width = MI_WIDTH(mi);
+       swirl->height = MI_HEIGHT(mi);
+       swirl->depth = MI_DEPTH(mi);
+       swirl->rdepth = swirl->depth;
+       swirl->visual = MI_VISUAL(mi);
+
+       if (swirl->depth > 16)
+               swirl->depth = 16;
+
+       /* initialise image for speeding up drawing */
+       if (!initialise_image(display, swirl)) {
+               free_swirl(display, swirl);
+               return;
+       }
+       MI_CLEARWINDOW(mi);
+
+#ifdef STANDALONE
+
+       swirl->rgb_values = mi->colors;
+       swirl->colours = mi->npixels;
+       swirl->dcolours = swirl->colours;
+/* swirl->fixed_colourmap = !mi->writable_p; */
+
+#else /* !STANDALONE */
+       /* initialise the colours from which the colourmap is derived */
+       initialise_colours(basic_colours, MI_SATURATION(mi));
+
+       /* set up the colour map */
+       if (!create_colourmap(mi, swirl)) {
+               free_swirl(display, swirl);
+               return;
+       }
+
+       /* attach the colour map to the window (if we have one) */
+       if (!swirl->fixed_colourmap) {
+#if 1
+               setColormap(display, window, swirl->cmap, MI_IS_INWINDOW(mi));
+#else
+               XSetWindowColormap(display, window, swirl->cmap);
+               XSetWMColormapWindows(display, window, &window, 1);
+               XInstallColormap(display, swirl->cmap);
+#endif
+       }
+#endif /* !STANDALONE */
+
+       /* resolution starts off chunky */
+       swirl->resolution = MIN_RES + 1;
+
+       /* calculate the pixel step for this resulution */
+       swirl->r = (1 << (swirl->resolution - 1));
+
+       /* how many knots? */
+       swirl->n_knots = random_no((unsigned int) MI_COUNT(mi) / 2) +
+               MI_COUNT(mi) + 1;
+
+       /* what type of knots? */
+       swirl->knot_type = ALL; /* for now */
+
+       /* use two_plane mode occaisionally */
+       if (random_no(100) <= TWO_PLANE_PCNT) {
+               swirl->two_plane = swirl->first_plane = True;
+               swirl->max_resolution = 2;
+       } else
+               swirl->two_plane = False;
+
+       /* fix the knot values */
+       if (!create_knots(swirl)) {
+               free_swirl(display, swirl);
+               return;
+       }
+
+       /* we are off */
+       swirl->started = True;
+       swirl->drawing = False;
+}
+
+/****************************************************************/
+
+/*-
+ * draw_swirl
+ *
+ * Draw one iteration of swirling
+ *
+ * -      win is the window to draw in
+ */
+void
+draw_swirl(ModeInfo * mi)
+{
+       SWIRL_P     swirl;
+
+       if (swirls == NULL)
+               return;
+       swirl = &(swirls[MI_SCREEN(mi)]);
+       if (swirl->knots == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       /* are we going? */
+       if (swirl->started) {
+               /* in the middle of drawing? */
+               if (swirl->drawing) {
+#ifdef STANDALONE
+                       if (mi->writable_p)
+                               rotate_colors(MI_DISPLAY(mi), MI_COLORMAP(mi),
+                                      swirl->rgb_values, swirl->colours, 1);
+#else /* !STANDALONE */
+                       /* rotate the colours */
+                       install_map(MI_DISPLAY(mi), swirl, swirl->dshift);
+#endif /* !STANDALONE */
+
+                       /* draw a batch of points */
+                       swirl->batch_todo = BATCH_DRAW;
+                       while ((swirl->batch_todo > 0) && swirl->drawing) {
+                               /* draw a point */
+                               draw_point(mi, swirl);
+
+                               /* move to the next point */
+                               next_point(swirl);
+
+                               /* done a point */
+                               swirl->batch_todo--;
+                       }
+               } else {
+#ifdef STANDALONE
+                       if (mi->writable_p)
+                               rotate_colors(MI_DISPLAY(mi), MI_COLORMAP(mi),
+                                      swirl->rgb_values, swirl->colours, 1);
+#else /* !STANDALONE */
+                       /* rotate the colours */
+                       install_map(MI_DISPLAY(mi), swirl, swirl->shift);
+#endif /* !STANDALONE */
+
+                       /* time for a higher resolution? */
+                       if (swirl->resolution > swirl->max_resolution) {
+                               /* move to higher resolution */
+                               swirl->resolution--;
+
+                               /* calculate the pixel step for this resulution */
+                               swirl->r = (1 << (swirl->resolution - 1));
+
+                               /* start drawing again */
+                               swirl->drawing = True;
+
+                               /* start in the middle of the screen */
+                               swirl->x = (swirl->width - swirl->r) / 2;
+                               swirl->y = (swirl->height - swirl->r) / 2;
+
+                               /* initialise spiral drawing parameters */
+                               swirl->direction = DRAW_RIGHT;
+                               swirl->dir_todo = 1;
+                               swirl->dir_done = 0;
+                       } else {
+                               /* all done, decide when to restart */
+                               if (swirl->start_again == -1) {
+                                       /* start the counter */
+                                       swirl->start_again = RESTART;
+                               } else if (swirl->start_again == 0) {
+                                       /* reset the counter */
+                                       swirl->start_again = -1;
+
+#ifdef STANDALONE
+                                       /* Pick a new colormap! */
+                                       MI_CLEARWINDOW(mi);
+                                       free_colors(MI_DISPLAY(mi), MI_COLORMAP(mi),
+                                                   mi->colors, mi->npixels);
+                                       make_smooth_colormap(MI_DISPLAY(mi),
+                                                            MI_VISUAL(mi),
+                                                            MI_COLORMAP(mi),
+                                             mi->colors, &mi->npixels, True,
+                                                            &mi->writable_p);
+                                       swirl->colours = mi->npixels;
+#endif /* STANDALONE */
+
+                                       /* start again */
+                                       init_swirl(mi);
+                               } else
+                                       /* decrement the counter */
+                                       swirl->start_again--;
+                       }
+               }
+       }
+}
+
+/****************************************************************/
+
+void
+release_swirl(ModeInfo * mi)
+{
+       /* does the swirls array exist? */
+       if (swirls != NULL) {
+               int         screen;
+
+               /* free them all */
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_swirl(MI_DISPLAY(mi), &swirls[screen]);
+               /* deallocate an array, one entry for each screen */
+               (void) free((void *) swirls);
+               swirls = NULL;
+       }
+}
+
+/****************************************************************/
+
+void
+refresh_swirl(ModeInfo * mi)
+{
+       SWIRL_P     swirl;
+
+       if (swirls == NULL)
+               return;
+       swirl = &swirls[MI_SCREEN(mi)];
+
+       if (swirl->started) {
+               MI_CLEARWINDOW(mi);
+               if (swirl->drawing)
+                       swirl->resolution = swirl->resolution + 1;
+               swirl->drawing = False;
+       }
+}
+
+#endif /* MODE_swirl */
diff --git a/modes/t3d.c b/modes/t3d.c
new file mode 100644 (file)
index 0000000..6b9d730
--- /dev/null
@@ -0,0 +1,1120 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* t3d --- Flying Balls Clock Demo */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)t3d.c        5.0 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1998 Bernd Paysan , paysan@informatik.tu-muenchen.de.
+ *
+ * Copy, modify, and distribute T3D either under GPL  version 2 or newer,
+ * or under the standard MIT/X license notice.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * partly based on flying balls demo by Georg Acher,
+ * acher@informatik.tu-muenchen.de
+ * (developed on HP9000/720 (55 MIPS,20 MFLOPS) )
+ *
+ * Todo for xlock:
+ *    -Set default options right and make it more "random"
+ *    -Add original colour scheme
+ *    -Get trackmouse is working
+ *    -Add some more options which were handled in the original by the XEvents.
+ *    -Get working better in password window.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 26-Jan-2000: joukj@hrem.stm.tudelft.nl (Jouk Jansen) : adapted for
+ *              xlockmore. Modified colour-schemes.
+ * 04-Jan-1999: jwz@jwz.org -- adapted to xscreensaver framework,
+ *              to take advantage of the command-line options
+ *              provided by screenhack.c.
+ */
+
+#define FASTDRAW
+#define FASTCOPY
+#undef USE_POLYGON
+
+#ifdef STANDALONE
+#define PROGCLASS "t3d"
+#define HACK_INIT init_t3d
+#define HACK_DRAW draw_t3d
+#define t3d_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*cycles: 60000 \n" \
+ "*ncolors: 200 \n" \
+ "*mouse: False \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+
+#ifdef TIME_WITH_SYS_TIME /* for sco */
+#include <time.h>
+#include <sys/time.h>
+#endif
+
+#ifdef MODE_t3d
+
+#define DEF_TRACKMOUSE  "False"
+#define DEF_MOVE "0.5"
+#define DEF_WOBBLE "2.0"
+#define DEF_MAG "10.0"
+#define DEF_FAST "50"
+#define DEF_MINUTES "False"
+#define DEF_CYCLE "True"
+
+#define PI M_PI
+#define TWOPI 2*M_PI
+
+#define MAXFAST 100
+
+#define   norm       20.0
+
+#ifdef FASTCOPY
+#define sum1ton(a) (((a)*(a)+1)/2)
+#define fastcw sum1ton(fastch)
+#endif
+
+#undef ABS
+#define ABS(x) ((x)<0.0 ? -(x) : (x))
+
+/* Anzahl der Kugeln */
+#define kmax ((t3dp->minutes?60:24))
+
+/* Werte in der Sinus-Tabelle */
+#define sines 52
+
+#define setink(inkcolor) XSetForeground(display,t3dp->gc,inkcolor)
+
+static Bool trackmouse , minutes , cycle_p;
+
+static float move, wobble , mag;
+
+static int fastch;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-cycle", (char *) ".t3d.cycle", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+cycle", (char *) ".t3d.cycle", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-move", (char *) ".t3d.move", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-wobble", (char *) ".t3d.wobble", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-mag", (char *) ".t3d.mag", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-fast", (char *) ".t3d.fast", XrmoptionSepArg, (caddr_t) NULL},
+        {(char *) "-minutes", (char *) ".t3d.minutes", XrmoptionNoArg, (caddr_t) "on"},
+        {(char *) "+minutes", (char *) ".t3d.minutes", XrmoptionNoArg, (caddr_t) "off"},
+        {(char *) "-trackmouse", (char *) ".t3d.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+        {(char *) "+trackmouse", (char *) ".t3d.trackmouse", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & cycle_p, (char *) "cycle", (char *) "Cycle", (char *) DEF_CYCLE, t_Bool},
+       {(caddr_t *) & move, (char *) "move", (char *) "Move", (char *) DEF_MOVE, t_Float},
+       {(caddr_t *) & wobble, (char *) "wobble", (char *) "Wobble", (char *) DEF_WOBBLE, t_Float},
+       {(caddr_t *) & mag, (char *) "mag", (char *) "Magnification", (char *) DEF_MAG, t_Float},
+       {(caddr_t *) & fastch, (char *) "fast", (char *) "Fast", (char *) DEF_FAST, t_Int},
+        {(caddr_t *) & minutes, (char *) "minutes", (char *) "Minutes", (char *) DEF_MINUTES, t_Bool},
+        {(caddr_t *) & trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-/+cycle", (char *) "turn on/off colour cycling"},
+       {(char *) "-move num", (char *) "Move speed"},
+       {(char *) "-wobble num", (char *) "Wobble speed"},
+       {(char *) "-mag num", (char *) "Magnification factor"},
+       {(char *) "-fast num", (char *) "Fast"},
+        {(char *) "-/+minutes", (char *) "turn on/off minutes"},
+        {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"}
+};
+
+ModeSpecOpt t3d_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+
+#ifdef USE_MODULES
+ModStruct   t3d_description =
+{"t3d", "init_t3d", "draw_t3d", "release_t3d",
+ "refresh_t3d", "init_t3d", NULL, &t3d_opts,
+ 250000, 1000, 60000 , 1, 64, 1.0, "",
+ "Flying Balls Clock Demo", 0, NULL};
+
+#endif
+
+typedef struct {
+  double x,y,z,r,d,r1;
+  int x1,y1;
+} kugeldat;
+
+typedef struct {
+   Cursor      cursor;
+   double cycles , movef , wobber , a[3] , x[3] , y[3] , zoom , speed , vspeed;
+   double sinus[sines] , cosinus[sines] , v[3] , am[3] , zaehler , vnorm;
+   double vturn;
+   int fastch , minutes , maxk;
+   GC gc;
+   Pixmap buffer;
+#ifdef FASTCOPY
+   GC orgc , andgc;
+   Pixmap fastcircles , fastmask;
+#else
+   XImage* fastcircles[maxfast] , fastmask[maxfast];
+#endif
+   Colormap    cmap;
+   XColor     *colors;
+   int         width, height, depth;
+   int         ncolors , fastdraw , scrnW2, scrnH2, startx , starty , px , py;
+   Bool        cycle_p, mono_p, no_colors;
+   unsigned long blackpixel, whitepixel, fg, bg;
+   int         direction;
+   struct tm *zeit;
+   kugeldat kugeln[100];
+   int         color_offset;
+   ModeInfo   *mi;
+} t3dstruct;
+
+static t3dstruct *t3ds = NULL;
+
+static void
+t3d_zeiger( ModeInfo* mi , double dist,double rad, double z, double sec,
+               int *q)
+/* Zeiger zeichnen */
+{
+  int i,n;
+  double gratio=sqrt(2.0/(1.0+sqrt(5.0)));
+   t3dstruct *t3dp;
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+  n = *q;
+
+  for(i=0;i<3;i++)
+    {
+      t3dp->kugeln[n].x=dist*cos(sec);
+      t3dp->kugeln[n].y=-dist*sin(sec);
+      t3dp->kugeln[n].z=z;
+      t3dp->kugeln[n].r=rad;
+      n++;
+
+      dist += rad;
+      rad = rad*gratio;
+    }
+  *q = n;
+}
+
+static void
+t3d_manipulate( ModeInfo* mi , double k)
+/*-----------------------------------------------------------------*
+ *                           Uhr zeichnen                          *
+ *-----------------------------------------------------------------*/
+{
+  double i,l,/*xs,*/ys,zs,mod;
+  double /*persec,*/sec,min,hour;
+  int n;
+  t3dstruct *t3dp;
+
+  t3dp = &t3ds[MI_SCREEN(mi)];
+
+  sec=TWOPI*modf(k/60,&mod);
+  min=TWOPI*modf(k/3600,&mod);
+  hour=TWOPI*modf(k/43200,&mod);
+
+  l=TWOPI*modf(k/300,&mod);
+  i=0.0;
+  for (n=0;n<kmax;n++)
+    {
+
+      t3dp->kugeln[n].x=4.0*sin(i);
+      t3dp->kugeln[n].y=4.0*cos(i);
+      t3dp->kugeln[n].z=t3dp->wobber* /* (sin(floor(2+2*l/(PI))*i)*sin(2*l)); */
+       cos((i-sec)*floor(2+5*l/(PI)))*sin(5*l);
+      if(t3dp->minutes)
+       {
+         t3dp->kugeln[n].r=/* (1.0+0.3*cos(floor(2+2*l/(PI))*i)*sin(2*l))* */
+           ((n % 5!=0) ? 0.3 : 0.6)*
+             ((n % 15 ==0) ? 1.25 : .75);
+       }
+      else
+       {
+         t3dp->kugeln[n].r=/* (1.0+0.3*cos(floor(2+2*l/(PI))*i)*sin(2*l))* */
+           ((n & 1) ? 0.5 : 1.0)*
+             ((n % 6==0) ? 1.25 : .75);
+       }
+      i+=TWOPI/kmax;
+    }
+
+  t3dp->kugeln[n].x=0.0;
+  t3dp->kugeln[n].y=0.0;
+  t3dp->kugeln[n].z=0.0;
+  t3dp->kugeln[n].r=2.0+cos(TWOPI*modf(k,&mod))/2;
+  n++;
+
+  t3d_zeiger( mi , 2.0,0.75,-2.0,sec,&n);
+  t3d_zeiger( mi , 1.0,1.0,-1.5,min,&n);
+  t3d_zeiger( mi , 0.0,1.5,-1.0,hour,&n);
+
+  for(n=0;n<t3dp->maxk;n++)
+    {
+       double cycle = (double) MI_CYCLES( mi );
+
+      ys=t3dp->kugeln[n].y*cos(t3dp->movef*sin(cycle*sec))+
+       t3dp->kugeln[n].z*sin(t3dp->movef*sin(cycle*sec));
+      zs=-t3dp->kugeln[n].y*sin(t3dp->movef*sin(cycle*sec))+
+       t3dp->kugeln[n].z*cos(t3dp->movef*sin(cycle*sec));
+      t3dp->kugeln[n].y=ys;
+      t3dp->kugeln[n].z=zs;
+    }
+}
+
+static double
+t3d_gettime (void)
+{
+  struct timeval time1;
+  struct tm *zeit;
+  time_t lt;
+
+#if HAVE_GETTIMEOFDAY
+  GETTIMEOFDAY(&time1);
+  lt = time1.tv_sec;   /* avoid type cast lossage */
+#else
+  lt = NULL;
+#endif
+  zeit=localtime(&lt);
+
+  return (zeit->tm_sec+60*(zeit->tm_min+60*(zeit->tm_hour))
+         + time1.tv_usec*1.0E-6);
+}
+
+
+static void
+t3d__sort( ModeInfo* mi , int l, int r)
+{
+  int i,j;
+  kugeldat ex;
+  double x;
+   t3dstruct *t3dp;
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+  i=l;j=r;
+  x=t3dp->kugeln[(l+r)/2].d;
+  for (;;) {
+      while(t3dp->kugeln[i].d>x) i++;
+      while(x>t3dp->kugeln[j].d) j--;
+      if (i<=j)
+       {
+         ex=t3dp->kugeln[i];
+          t3dp->kugeln[i]=t3dp->kugeln[j];
+          t3dp->kugeln[j]=ex;
+         i++;j--;
+       }
+      if (i>j) break;
+    }
+  if (l<j) t3d__sort( mi , l,j);
+  if (i<r) t3d__sort ( mi , i,r);
+}
+
+static void
+t3d_vektorprodukt(double feld1[], double feld2[], double feld3[])
+{
+  feld3[0]=feld1[1]*feld2[2]-feld1[2]*feld2[1];
+  feld3[1]=feld1[2]*feld2[0]-feld1[0]*feld2[2];
+  feld3[2]=feld1[0]*feld2[1]-feld1[1]*feld2[0];
+}
+
+static void
+t3d_turn(double feld1[], double feld2[], double winkel)
+{
+  double temp[3];
+  double s,ca,sa,sx1,sx2,sx3;
+
+  t3d_vektorprodukt(feld1,feld2,temp);
+
+  s=feld1[0]*feld2[0]+feld1[1]*feld2[1]+feld1[2]*feld2[2];
+
+  sx1=s*feld2[0];
+  sx2=s*feld2[1];
+  sx3=s*feld2[2];
+  sa=sin(winkel);ca=cos(winkel);
+  feld1[0]=ca*(feld1[0]-sx1)+sa*temp[0]+sx1;
+  feld1[1]=ca*(feld1[1]-sx2)+sa*temp[1]+sx2;
+  feld1[2]=ca*(feld1[2]-sx3)+sa*temp[2]+sx3;
+}
+
+static void
+t3d_projektion( ModeInfo* mi)
+{
+  double c1[3],c2[3],k[3],x1,y1;
+  double cno,cnorm/*,magnit*/;
+  int i;
+   t3dstruct *t3dp;
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+  for (i=0;i<t3dp->maxk;i++)
+    {
+      c1[0]=t3dp->kugeln[i].x-t3dp->a[0];
+      c1[1]=t3dp->kugeln[i].y-t3dp->a[1];
+      c1[2]=t3dp->kugeln[i].z-t3dp->a[2];
+      cnorm=sqrt(c1[0]*c1[0]+c1[1]*c1[1]+c1[2]*c1[2]);
+
+      c2[0]=c1[0];
+      c2[1]=c1[1];
+      c2[2]=c1[2];
+
+      cno=c2[0]*t3dp->v[0]+c2[1]*t3dp->v[1]+c2[2]*t3dp->v[2];
+      t3dp->kugeln[i].d=cnorm;
+      if (cno<0) t3dp->kugeln[i].d=-20.0;
+
+
+      t3dp->kugeln[i].r1=(mag*t3dp->zoom*t3dp->kugeln[i].r/cnorm);
+
+      c2[0]=t3dp->v[0]/cno;
+      c2[1]=t3dp->v[1]/cno;
+      c2[2]=t3dp->v[2]/cno;
+
+      t3d_vektorprodukt(c2,c1,k);
+
+
+      x1=(t3dp->startx+(t3dp->x[0]*k[0]+t3dp->x[1]*k[1]+t3dp->x[2]*k[2])*mag);
+      y1=(t3dp->starty-(t3dp->y[0]*k[0]+t3dp->y[1]*k[1]+t3dp->y[2]*k[2])*mag);
+      if(   (x1>-2000.0)
+        && (x1<t3dp->width+2000.0)
+        && (y1>-2000.0)
+        && (y1<t3dp->height+2000.0))
+       {
+         t3dp->kugeln[i].x1=(int)x1;
+         t3dp->kugeln[i].y1=(int)y1;
+       }
+      else
+       {
+         t3dp->kugeln[i].x1=0;
+         t3dp->kugeln[i].y1=0;
+         t3dp->kugeln[i].d=-20.0;
+       }
+    }
+}
+
+
+static void
+t3d_viewpoint( ModeInfo* mi)
+/* 1: Blickrichtung v;3:Ebenenmittelpunkt m
+   double feld1[],feld3[]; */
+{
+   t3dstruct *t3dp;
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+   t3dp->am[0]=-t3dp->zoom*t3dp->v[0];
+   t3dp->am[1]=-t3dp->zoom*t3dp->v[1];
+   t3dp->am[2]=-t3dp->zoom*t3dp->v[2];
+
+   t3dp->zaehler=norm*norm* t3dp->zoom;
+}
+
+static void
+t3d_fill_kugel(int i, Pixmap buf, int setcol , ModeInfo* mi )
+{
+   t3dstruct *t3dp;
+   Display    *display = MI_DISPLAY(mi);
+  double ra;
+  int m,inr=3,d;
+#ifdef USE_POLYGON
+   int inc = 1;
+#endif
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+  d=(int)((ABS(t3dp->kugeln[i].r1)*2));
+  if (d==0) d=1;
+
+# ifdef FASTDRAW
+  if(t3dp->fastdraw && d<t3dp->fastch)
+    {
+#      ifdef FASTCOPY
+      XCopyArea(display, t3dp->fastmask, buf, t3dp->andgc, sum1ton(d)-(d+1)/2,
+               1,d,d, (int)(t3dp->kugeln[i].x1)-d/2,
+               (int)(t3dp->kugeln[i].y1)-d/2);
+      XCopyArea(display, t3dp->fastcircles, buf, t3dp->orgc,
+               sum1ton(d)-(d+1)/2, 1,d,d, (int)(t3dp->kugeln[i].x1)-d/2,
+               (int)(t3dp->kugeln[i].y1)-d/2);
+#else
+      XPutImage(display, buf, t3dp->andgc, t3dp->fastmask[d-1], 0, 0,
+               (int)(t3dp->kugeln[i].x1)-d/2, (int)(t3dp->kugeln[i].y1)-d/2,
+               d, d);
+      XPutImage(display, buf, t3dp->orgc, t3dp->fastcircles[d-1], 0, 0,
+               (int)(t3dp->kugeln[i].x1)-d/2, (int)(t3dp->kugeln[i].y1)-d/2,
+               d, d);
+#      endif
+    }
+  else
+#endif
+    {
+       if(ABS(t3dp->kugeln[i].r1)<6.0) inr=9;
+
+      for (m=0;m<=28;m+=inr)
+       {
+         ra=t3dp->kugeln[i].r1*sqrt(1-m*m/(28.0*28.0));
+#ifdef USE_POLYGON
+         if(-ra< 3.0) inc=14;
+         else if(-ra< 6.0) inc=8;
+         else if(-ra<20.0) inc=4;
+         else if(-ra<40.0) inc=2;
+#endif
+         if(setcol)
+           {
+              if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                setink(t3dp->colors[m].pixel);
+              } else if (MI_NPIXELS(mi) <= 2) {
+                if ((m + t3dp->color_offset) % 2)
+                       setink(MI_WHITE_PIXEL(mi));
+                else
+                       setink(MI_BLACK_PIXEL(mi));
+              } else {
+                setink(MI_PIXEL(mi, ((m + t3dp->color_offset) % 29) * MI_NPIXELS(mi) / 29));
+              }
+           }
+
+#ifdef USE_POLYGON
+          {
+            int n, nr;
+         for (n=0,nr=0;n<=sines-1;n+=inc,nr++)
+           {
+             track[nr].x=t3dp->kugeln[i].x1+(int)(ra*t3dp->sinus[n])+
+                (t3dp->kugeln[i].r1-ra)/2;
+             track[nr].y=t3dp->kugeln[i].y1+(int)(ra*t3dp->cosinus[n])+
+                (t3dp->kugeln[i].r1-ra)/2;
+           }
+         XFillPolygon(display,buf,t3dp->gc,track,nr,Convex,CoordModeOrigin);
+          }
+#else /* Use XFillArc */
+         XFillArc(display, buf, t3dp->gc,
+                  (int)(t3dp->kugeln[i].x1+(t3dp->kugeln[i].r1+ra)/2),
+                  (int)(t3dp->kugeln[i].y1+(t3dp->kugeln[i].r1+ra)/2),
+                  (int)-(2*ra+1), (int)-(2*ra+1), 0, 360*64);
+#endif
+       }
+    }
+}
+
+
+static void
+t3d_init_kugel( ModeInfo* mi )
+{
+   t3dstruct *t3dp;
+
+#ifdef FASTDRAW
+   Display    *display = MI_DISPLAY(mi);
+  int i;
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+  for(i=0; i<t3dp->fastch; i++)
+    {
+#      ifdef FASTCOPY
+      t3dp->kugeln[i].r1=-((double) i)/2 -1;
+      t3dp->kugeln[i].x1=sum1ton(i);
+      t3dp->kugeln[i].y1=i/2 +1;
+
+      t3d_fill_kugel(i,t3dp->fastcircles,1 , mi );
+/*      setink((1<<MIN(24,t3dp->depth))-1);*/
+      setink(MI_BLACK_PIXEL(mi));
+      t3d_fill_kugel(i,t3dp->fastmask,0 , mi );
+#      else
+      t3dp->kugeln[i].r1=-((double) i)/2 -1;
+      t3dp->kugeln[i].x1=t3dp->kugeln[i].y1=i/2 +1;
+
+      t3d_fill_kugel(i,t3dp->buffer,1 , mi );
+      t3dp->fastcircles[i]=XGetImage(display,t3dp->buffer,0,0,i+2,i+2,
+                                    (1<<t3dp->depth)-1, ZPixmap);
+       /* setink((1<<MIN(24,t3dp->depth))-1); */
+      setink(MI_WHITE_PIXEL(mi));
+      t3d_fill_kugel(i,t3dp->buffer,0 , mi );
+      t3dp->fastmask[i]=XGetImage(display,t3dp->buffer,0,0,i+2,i+2,
+                                 (1<<t3dp->depth)-1,ZPixmap);
+      setink(MI_BLACK_PIXEL(mi));
+      XFillRectangle (display, t3dp->buffer     , t3dp->gc, 0, 0,
+                     t3dp->width, t3dp->height);
+#      endif
+    }
+  t3dp->fastdraw=1;
+#endif
+}
+
+static void
+t3d_init_3d( ModeInfo* mi )
+{
+   t3dstruct *t3dp;
+   double i;
+   int n=0;
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+   t3dp->a[0]=0.0;
+   t3dp->a[1]=0.0;
+   t3dp->a[2]=-10.0;
+
+   t3dp->x[0]=10.0;
+   t3dp->x[1]=0.0;
+   t3dp->x[2]=0.0;
+
+   t3dp->y[0]=0.0;
+   t3dp->y[1]=10.0;
+   t3dp->y[2]=0.0;
+
+   t3dp->zoom=-10.0;
+   t3dp->speed=.0;
+
+   for (i=0.0;n<sines;i+=TWOPI/sines,n++)
+    {
+      t3dp->sinus[n]=sin(i);
+      t3dp->cosinus[n]=cos(i);
+    }
+
+}
+
+
+static void
+free_t3d(Display *display, t3dstruct *t3dp)
+{
+       ModeInfo *mi = t3dp->mi;
+
+       if (t3dp->cursor != None) {
+               XFreeCursor(display, t3dp->cursor);
+               t3dp->cursor = None;
+       }
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               MI_WHITE_PIXEL(mi) = t3dp->whitepixel;
+               MI_BLACK_PIXEL(mi) = t3dp->blackpixel;
+#ifndef STANDALONE
+               MI_FG_PIXEL(mi) = t3dp->fg;
+               MI_BG_PIXEL(mi) = t3dp->bg;
+#endif
+               if (t3dp->colors != NULL) {
+                       if (t3dp->ncolors && !t3dp->no_colors)
+                               free_colors(display, t3dp->cmap, t3dp->colors, t3dp->ncolors);
+                       (void) free((void *) t3dp->colors);
+                       t3dp->colors = NULL;
+               }
+               if (t3dp->cmap != None) {
+                       XFreeColormap(display, t3dp->cmap);
+                       t3dp->cmap = None;
+               }
+       }
+       if (t3dp->buffer != None) {
+               XFreePixmap(display, t3dp->buffer);
+               t3dp->buffer = None;
+       }
+       if (t3dp->gc != None) {
+               XFreeGC(display, t3dp->gc);
+               t3dp->gc = None;
+       }
+#ifdef FASTCOPY
+       if (t3dp->orgc != None) {
+               XFreeGC(display, t3dp->orgc);
+               t3dp->orgc = None;
+       }
+       if (t3dp->andgc != None) {
+               XFreeGC(display, t3dp->andgc);
+               t3dp->andgc = None;
+       }
+       if (t3dp->fastcircles != None) {
+               XFreePixmap(display, t3dp->fastcircles);
+               t3dp->fastcircles = None;
+       }
+       if (t3dp->fastmask != None) {
+               XFreePixmap(display, t3dp->fastmask);
+               t3dp->fastmask = None;
+       }
+#endif
+       if (t3dp->zeit != NULL) {
+               (void) free((void *) t3dp->zeit);
+               t3dp->zeit = NULL;
+       }
+}
+
+static Bool
+t3d_initialize( ModeInfo* mi )
+{
+   Display    *display = MI_DISPLAY(mi);
+   Window      window = MI_WINDOW(mi);
+   t3dstruct *t3dp;
+   XGCValues   xgcv;
+
+   t3dp = &t3ds[MI_SCREEN(mi)];
+
+   t3dp->cycles = MI_CYCLES( mi ) / 6000.0;
+   if ( t3dp->cycles <= 1.0 )
+     t3dp->cycles = 10.0;
+
+   t3dp->movef = (double) move;
+   t3dp->wobber = (double) wobble;
+   t3dp->fastch = (int) (fastch * mag);
+   if ( t3dp->fastch > MAXFAST )
+     t3dp->fastch = MAXFAST;
+
+   if ( minutes )
+     {
+       t3dp->minutes = 1;
+       t3dp->maxk = 70;
+     }
+   else
+     {
+       t3dp->minutes = 0;
+       t3dp->maxk = 34;
+     }
+   xgcv.foreground = MI_WHITE_PIXEL(mi);
+   if ((t3dp->gc = XCreateGC (display, window, GCForeground, &xgcv)) == None) {
+       free_t3d(display, t3dp);
+       return False;
+   }
+#ifdef FASTDRAW
+   xgcv.function = GXor;
+   if ((t3dp->orgc = XCreateGC (display, window, GCFunction | GCForeground,
+               &xgcv)) == None) {
+       free_t3d(display, t3dp);
+       return False;
+   }
+   xgcv.function = GXandInverted;
+   if ((t3dp->andgc = XCreateGC (display, window, GCFunction | GCForeground,
+               &xgcv)) == None) {
+       free_t3d(display, t3dp);
+       return False;
+   }
+#endif
+   if (MI_IS_VERBOSE(mi))
+     {
+       (void) printf("Time 3D drawing ");
+#ifdef FASTDRAW
+#      ifdef FASTCOPY
+       (void) puts("fast by Pixmap copy");
+#      else
+       (void) puts("fast by XImage copy");
+#      endif
+#else
+       (void) puts("slow");
+#endif
+     }
+
+#ifdef FASTCOPY
+   if (((t3dp->fastcircles = XCreatePixmap (display, window,
+               fastcw, t3dp->fastch+1, t3dp->depth)) == None) ||
+       ((t3dp->fastmask    = XCreatePixmap (display, window,
+               fastcw, t3dp->fastch+1, t3dp->depth)) == None)) {
+       free_t3d(display, t3dp);
+       return False;
+   }
+#endif
+
+  setink(MI_BLACK_PIXEL(mi));
+  XFillRectangle (display, t3dp->buffer , t3dp->gc, 0, 0, t3dp->width,
+                 t3dp->height);
+
+#ifdef FASTCOPY
+  setink(MI_BLACK_PIXEL(mi));
+  XFillRectangle (display, t3dp->fastcircles, t3dp->gc, 0, 0, fastcw,
+                 t3dp->fastch+1);
+  XFillRectangle (display, t3dp->fastmask   , t3dp->gc, 0, 0, fastcw,
+                 t3dp->fastch+1);
+#endif
+
+   if (MI_IS_VERBOSE(mi))
+   {
+       (void) printf("move\t%.2f\nwobber\t%.2f\nmag\t%.2f\n",
+              t3dp->movef, t3dp->wobber, mag );
+       (void) printf("fast\t%i\nmarks\t%i\n", t3dp->fastch, t3dp->maxk);
+   }
+   return True;
+}
+
+void
+init_t3d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       t3dstruct *t3dp;
+
+       if (t3ds == NULL) {
+               if ((t3ds = (t3dstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (t3dstruct))) == NULL)
+                       return;
+       }
+       t3dp = &t3ds[MI_SCREEN(mi)];
+       t3dp->mi = mi;
+
+       if (trackmouse && !t3dp->cursor) {      /* Create an invisible cursor */
+               Pixmap      bit;
+               XColor      black;
+
+               black.red = 0;
+               black.green = 0;
+               black.blue = 0;
+               black.flags = DoRed | DoGreen | DoBlue;
+               if ((bit = XCreatePixmapFromBitmapData(display, window,
+                               (char *) "\000", 1, 1, MI_BLACK_PIXEL(mi),
+                               MI_BLACK_PIXEL(mi), 1)) == None) {
+                       free_t3d(display, t3dp);
+                       return;
+               }
+               if ((t3dp->cursor = XCreatePixmapCursor(display, bit, bit,
+                               &black, &black, 0, 0)) == None) {
+                       XFreePixmap(display, bit);
+                       free_t3d(display, t3dp);
+                       return;
+               }
+               XFreePixmap(display, bit);
+       }
+       XDefineCursor(display, window, t3dp->cursor);
+
+       t3dp->width = MI_WIDTH(mi);
+       t3dp->height = MI_HEIGHT(mi);
+       t3dp->depth = MI_DEPTH(mi);
+       if (t3dp->buffer != None) {
+               XFreePixmap(display, t3dp->buffer);
+               t3dp->buffer = None;
+       }
+       if ((t3dp->buffer = XCreatePixmap (display, window,
+                       t3dp->width, t3dp->height, t3dp->depth)) == None) {
+               free_t3d(display, t3dp);
+               return;
+       }
+
+   /* Initialization */
+   if (t3dp->gc == None) {
+       if (!t3d_initialize(mi))
+               return;
+
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2)
+         {
+            XColor      color;
+
+#ifndef STANDALONE
+            extern char *background;
+            extern char *foreground;
+
+            t3dp->fg = MI_FG_PIXEL(mi);
+            t3dp->bg = MI_BG_PIXEL(mi);
+#endif
+            t3dp->blackpixel = MI_BLACK_PIXEL(mi);
+            t3dp->whitepixel = MI_WHITE_PIXEL(mi);
+            if ((t3dp->cmap = XCreateColormap(display, window, MI_VISUAL(mi),
+                       AllocNone)) == None) {
+               free_t3d(display, t3dp);
+               return;
+            }
+            XSetWindowColormap(display, window, t3dp->cmap);
+            (void) XParseColor(display, t3dp->cmap, "black", &color);
+            (void) XAllocColor(display, t3dp->cmap, &color);
+            MI_BLACK_PIXEL(mi) = color.pixel;
+            (void) XParseColor(display, t3dp->cmap, "white", &color);
+            (void) XAllocColor(display, t3dp->cmap, &color);
+            MI_WHITE_PIXEL(mi) = color.pixel;
+#ifndef STANDALONE
+            (void) XParseColor(display, t3dp->cmap, background, &color);
+            (void) XAllocColor(display, t3dp->cmap, &color);
+            MI_BG_PIXEL(mi) = color.pixel;
+            (void) XParseColor(display, t3dp->cmap, foreground, &color);
+            (void) XAllocColor(display, t3dp->cmap, &color);
+            MI_FG_PIXEL(mi) = color.pixel;
+#endif
+            t3dp->colors = NULL;
+            t3dp->ncolors = 0;
+         }
+     }
+     t3dp->color_offset = NRAND(29);
+
+/*Set up t2d data */
+   t3dp->direction = (LRAND() & 1) ? 1 : -1;
+   t3dp->fastdraw = 0;
+   t3dp->vturn = 0.0;
+
+   if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+/* Set up colour map */
+               if (t3dp->colors != NULL) {
+                       if (t3dp->ncolors && !t3dp->no_colors)
+                               free_colors(display, t3dp->cmap, t3dp->colors, t3dp->ncolors);
+                       (void) free((void *) t3dp->colors);
+                       t3dp->colors = NULL;
+               }
+               t3dp->ncolors = MI_NCOLORS(mi);
+               if (t3dp->ncolors < 2)
+                       t3dp->ncolors = 2;
+               if (t3dp->ncolors <= 2)
+                       t3dp->mono_p = True;
+               else
+                       t3dp->mono_p = False;
+
+               if (t3dp->mono_p)
+                       t3dp->colors = NULL;
+               else
+                       if ((t3dp->colors = (XColor *) malloc(sizeof (*t3dp->colors) *
+                                       (t3dp->ncolors + 1))) == NULL) {
+                               free_t3d(display, t3dp);
+                               return;
+                       }
+               t3dp->cycle_p = has_writable_cells(mi);
+               if (t3dp->cycle_p) {
+                       if (MI_IS_FULLRANDOM(mi)) {
+                               if (!NRAND(8))
+                                       t3dp->cycle_p = False;
+                               else
+                                       t3dp->cycle_p = True;
+                       } else {
+                               t3dp->cycle_p = cycle_p;
+                       }
+               }
+               if (!t3dp->mono_p) {
+                       if (!(LRAND() % 10))
+                               make_random_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                                               t3dp->cmap, t3dp->colors, &t3dp->ncolors,
+                                               True, True, &t3dp->cycle_p);
+                       else if (!(LRAND() % 2))
+                               make_uniform_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                  t3dp->cmap, t3dp->colors, &t3dp->ncolors,
+                                                     True, &t3dp->cycle_p);
+                       else
+                               make_smooth_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                 t3dp->cmap, t3dp->colors, &t3dp->ncolors,
+                                                    True, &t3dp->cycle_p);
+               }
+               XInstallColormap(display, t3dp->cmap);
+               if (t3dp->ncolors < 2) {
+                       t3dp->ncolors = 2;
+                       t3dp->no_colors = True;
+               } else
+                       t3dp->no_colors = False;
+               if (t3dp->ncolors <= 2)
+                       t3dp->mono_p = True;
+
+               if (t3dp->mono_p)
+                       t3dp->cycle_p = False;
+
+       }
+
+   t3d_init_3d( mi );
+
+   if (t3dp->zeit == NULL)
+     if ((t3dp->zeit = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
+       free_t3d(display, t3dp);
+       return;
+     }
+
+   t3d_init_kugel( mi );
+
+   t3dp->startx = t3dp->width / 2;
+   t3dp->starty = t3dp->height / 2;
+   t3dp->scrnH2 = t3dp->startx;
+   t3dp->scrnW2 = t3dp->starty;
+   t3dp->vspeed=0;
+
+   t3d_vektorprodukt( t3dp->x, t3dp->y, t3dp->v);
+   t3d_viewpoint( mi );
+
+   MI_CLEARWINDOW(mi);
+}
+
+void
+release_t3d(ModeInfo * mi)
+{
+       if (t3ds != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_t3d(MI_DISPLAY(mi), &t3ds[screen]);
+               (void) free((void *) t3ds);
+               t3ds = NULL;
+       }
+}
+
+void
+draw_t3d(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       double dtime;
+       int button;
+       t3dstruct *t3dp;
+
+       if (t3ds == NULL)
+               return;
+       t3dp = &t3ds[MI_SCREEN(mi)];
+       if (t3dp->zeit == NULL)
+               return;
+
+       if (t3dp->no_colors) {
+               free_t3d(display, t3dp);
+               init_t3d(mi);
+               return;
+       }
+
+   MI_IS_DRAWN(mi) = True;
+
+/* Rotate colours */
+   if (t3dp->cycle_p)
+     {
+       rotate_colors(display, t3dp->cmap, t3dp->colors, t3dp->ncolors,
+                     t3dp->direction);
+       if (!(LRAND() % 1000))
+         t3dp->direction = -t3dp->direction;
+     }
+
+   t3d_vektorprodukt( t3dp->x, t3dp->y , t3dp->v);
+
+       t3dp->vnorm=sqrt(t3dp->v[0]*t3dp->v[0]+t3dp->v[1]*t3dp->v[1]+
+                        t3dp->v[2]*t3dp->v[2]);
+       t3dp->v[0]=t3dp->v[0]*norm/t3dp->vnorm;
+       t3dp->v[1]=t3dp->v[1]*norm/t3dp->vnorm;
+       t3dp->v[2]=t3dp->v[2]*norm/t3dp->vnorm;
+       t3dp->vnorm=sqrt(t3dp->x[0]*t3dp->x[0]+t3dp->x[1]*t3dp->x[1]+
+                        t3dp->x[2]*t3dp->x[2]);
+       t3dp->x[0]=t3dp->x[0]*norm/t3dp->vnorm;
+       t3dp->x[1]=t3dp->x[1]*norm/t3dp->vnorm;
+       t3dp->x[2]=t3dp->x[2]*norm/t3dp->vnorm;
+       t3dp->vnorm=sqrt(t3dp->y[0]*t3dp->y[0]+t3dp->y[1]*t3dp->y[1]+
+                        t3dp->y[2]*t3dp->y[2]);
+       t3dp->y[0]=t3dp->y[0]*norm/t3dp->vnorm;
+       t3dp->y[1]=t3dp->y[1]*norm/t3dp->vnorm;
+       t3dp->y[2]=t3dp->y[2]*norm/t3dp->vnorm;
+
+   t3d_projektion( mi );
+   t3d__sort ( mi , 0,t3dp->maxk-1);
+
+   dtime= t3d_gettime();
+
+   setink(MI_BLACK_PIXEL(mi));
+   XFillRectangle(display, t3dp->buffer,t3dp->gc,0,0,t3dp->width,
+                 t3dp->height);
+
+       {
+         int i;
+
+         t3d_manipulate( mi , dtime);
+
+         for (i=0;i<t3dp->maxk;i++)
+           {
+             if (t3dp->kugeln[i].d>0.0)
+               t3d_fill_kugel(i,t3dp->buffer,1 , mi );
+           }
+       }
+
+   XFlush(display);
+
+   XCopyArea (display, t3dp->buffer, window, t3dp->gc, 0, 0, t3dp->width,
+             t3dp->height, 0, 0);
+
+   XSync(display,0);
+
+   if ( trackmouse )
+     {
+       Window junk_win,in_win;
+       int junk;
+       unsigned int kb;
+
+       (void)(XQueryPointer (display, window, &junk_win, &in_win, &junk,
+                             &junk, &t3dp->px, &t3dp->py, &kb));
+       /* The following may have to much interference with the Xlockmore
+        * event handling  (JJ) */
+       if ( (kb&Button2Mask) )
+         {
+            button = 2;
+         }
+       else
+         {
+            if (kb&Button1Mask)
+              {
+                 button = 1;
+              }
+            else
+              {
+                 if (kb&Button3Mask)
+                   {
+                      button = 3;
+                   }
+                 else
+                   {
+                      button = 0;
+                   }
+              }
+         }
+     }
+   else
+     {
+       t3dp->px = NRAND( t3dp->width );
+        t3dp->py = NRAND( t3dp->height );
+       button = NRAND( 50 );
+       if ( button > 3 ) button = 0;
+     }
+
+   if ((t3dp->px>0)&&(t3dp->px<t3dp->width)&&(t3dp->py>0)&&
+       (t3dp->py<t3dp->height) )
+         {
+           if ((t3dp->px !=t3dp->startx)&&( button == 2 ))
+             {
+               t3d_turn(t3dp->y,t3dp->x,((double)(t3dp->px-t3dp->startx))/
+                        (8000*mag));
+             }
+           if ((t3dp->py !=t3dp->starty)&&( button == 2 ))
+             {
+               t3d_turn(t3dp->x,t3dp->y,((double)(t3dp->py-t3dp->starty))/
+                        (-8000*mag));
+             }
+           if ( button == 1 )
+             {
+               if (t3dp->vturn==0.0) t3dp->vturn=.005;
+                else if (t3dp->vturn<2)  t3dp->vturn+=.01;
+               t3d_turn(t3dp->x,t3dp->v,.002*t3dp->vturn);
+               t3d_turn(t3dp->y,t3dp->v,.002*t3dp->vturn);
+             }
+           if ( button == 3 )
+             {
+               if (t3dp->vturn==0.0) t3dp->vturn=.005;
+                else if (t3dp->vturn<2) t3dp->vturn+=.01;
+               t3d_turn(t3dp->x,t3dp->v,-.002*t3dp->vturn);
+               t3d_turn(t3dp->y,t3dp->v,-.002*t3dp->vturn);
+             }
+         }
+       if (!( button == 1 )&&!( button == 3 ))
+         t3dp->vturn=0;
+
+       t3dp->speed=t3dp->speed+t3dp->speed*t3dp->vspeed;
+       if ((t3dp->speed<0.0000001) &&(t3dp->vspeed>0.000001)) t3dp->speed=0.000001;
+       t3dp->vspeed=.1*t3dp->vspeed;
+       if (t3dp->speed>0.01) t3dp->speed=.01;
+       t3dp->a[0]=t3dp->a[0]+t3dp->speed*t3dp->v[0];
+       t3dp->a[1]=t3dp->a[1]+t3dp->speed*t3dp->v[1];
+       t3dp->a[2]=t3dp->a[2]+t3dp->speed*t3dp->v[2];
+}
+
+void
+refresh_t3d(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_t3d */
diff --git a/modes/tetris.c b/modes/tetris.c
new file mode 100644 (file)
index 0000000..88dfd46
--- /dev/null
@@ -0,0 +1,2549 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* tetris --- autoplaying tetris game */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)tetris.c     5.01 2000/12/19 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1998 by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The author should like to be notified if changes have been made to the
+ * routine.  Response will only be guaranteed when a VMS version of the
+ * program is available.
+ *
+ * An autoplaying tetris mode for xlockmore
+ * David Bagley changed much of it to look more like altetris code...
+ * which a significant portion belongs to Q. Alex Zhao.
+ *
+ * Copyright (c) 1992 - 95    Q. Alex Zhao, azhao@cc.gatech.edu
+ *
+ *     All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * 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 the author not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * This program is distributed in the hope that it will be "playable",
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Todo list:
+ *  -Add option for the level of thinking the computer should perform
+ *     (i.e. dummy = do nothing ..... genius = do always the best move
+ *     possible)
+ *  -Get welltris option to work better.
+ *     draw more sophisticated squares (i.e. something like the bitmaps
+ *       on tetris)
+ *
+ * Revision History:
+ * 01-Dec-2000: Lifted code from polyominoes for variable size pieces
+ *              Copyright (c) 2000 by Stephen Montgomery-Smith
+ * 01-Nov-2000: Allocation checks
+ * 02-Aug-2000: alwelltris trackmouse implemented
+ * 27-Jul-2000: alwelltris all but trackmouse
+ * 22-Jun-2000: trackmouse added, row clearing fixed, bonus pieces,
+ * 01-Nov-1998: altetris additions by David Bagley
+ * 01-Oct-1998: Created
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Tetris"
+#define HACK_INIT init_tetris
+#define HACK_DRAW draw_tetris
+#define tetris_opts xlockmore_opts
+#define DEFAULTS "*delay: 600000 \n" \
+ "*count: -500 \n" \
+ "*cycles: 200 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n" \
+ "*trackmouse: False \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"    /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"    /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+
+#ifdef MODE_tetris
+
+#define DEF_BONUS "False"
+#define DEF_CYCLE "True"
+#define DEF_PLAIN "False"
+#define DEF_TRACKMOUSE  "False"
+#define DEF_WELL "False"
+
+static Bool bonus;
+static Bool cycle_p;
+static Bool plain;
+static Bool trackmouse;
+static Bool well;
+
+#define INTRAND(min,max) (NRAND((max+1)-(min))+(min))
+
+static XrmOptionDescRec opts[] =
+{
+  {(char *) "-bonus", (char *) ".tetris.bonus", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+bonus", (char *) ".tetris.bonus", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-cycle", (char *) ".tetris.cycle", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+cycle", (char *) ".tetris.cycle", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-plain", (char *) ".tetris.plain", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+plain", (char *) ".tetris.plain", XrmoptionNoArg, (caddr_t) "off"},
+#ifndef DISABLE_INTERACTIVE
+  {(char *) "-trackmouse", (char *) ".tetris.trackmouse", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+trackmouse", (char *) ".tetris.trackmouse", XrmoptionNoArg, (caddr_t) "off"},
+#endif
+  {(char *) "-well", (char *) ".tetris.well", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+well", (char *) ".tetris.well", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+  {(caddr_t *) & bonus, (char *) "bonus", (char *) "Bonus", (char *) DEF_BONUS, t_Bool},
+  {(caddr_t *) & cycle_p, (char *) "cycle", (char *) "Cycle", (char *) DEF_CYCLE, t_Bool},
+  {(caddr_t *) & plain, (char *) "plain", (char *) "Plain", (char *) DEF_PLAIN, t_Bool},
+#ifndef DISABLE_INTERACTIVE
+  {(caddr_t *) & trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool},
+#endif
+  {(caddr_t *) & well, (char *) "well", (char *) "Well", (char *) DEF_WELL, t_Bool}
+};
+static OptionStruct desc[] =
+{
+  {(char *) "-/+bonus", (char *) "turn on/off larger bonus pieces"},
+  {(char *) "-/+cycle", (char *) "turn on/off colour cycling"},
+  {(char *) "-/+plain", (char *) "turn on/off plain pieces"},
+#ifndef DISABLE_INTERACTIVE
+  {(char *) "-/+trackmouse", (char *) "turn on/off the tracking of the mouse"},
+#endif
+  {(char *) "-/+well", (char *) "turn on/off the welltris mode"}
+};
+
+ModeSpecOpt tetris_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   tetris_description =
+{"tetris", "init_tetris", "draw_tetris", "release_tetris",
+ "refresh_tetris", "change_tetris", NULL, &tetris_opts,
+ 600000, -40, 200, -100, 64, 1.0, "",
+ "Shows an autoplaying tetris game", 0, NULL};
+
+#endif
+
+#include "bitmaps/gray1.xbm"
+
+#define MINGRIDSIZE 10 
+#define MAXPIXELSIZE 12
+#define MINSIZE 6 
+#define MAX_SIDES 4
+
+#define NUM_FLASHES 16
+#define BITMAPS 256
+
+#define DELTA 1
+#define WELL_WIDTH 8
+#define WELL_DEPTH 12
+#define WELL_PERIMETER (MAX_SIDES*WELL_WIDTH)
+#define BASE_WIDTH (WELL_WIDTH*tp->xs+DELTA)
+#define ENDPT (3*BASE_WIDTH)
+
+#define THRESHOLD(x) ((x+1)*10)
+#define EMPTY (-1)
+
+typedef enum {FALL, DROP, MOVE_LEFT, MOVE_RIGHT, ROTATE, REFLECT} move_t;
+
+typedef struct {
+  int  squares, polyomino_number;
+  int  xpos, ypos;
+  int  size, color_number;
+  int  random_rotation;
+  int  random_reflection;  /* not used */
+  long  random_number;
+} thing_t;
+
+typedef struct {
+  int  rotation;
+  int  reflection;  /* not used */
+  int  leadingEmptyWidth, leadingEmptyHeight;
+  int  *shape;
+  int  size;
+} Polyominoes;
+
+typedef struct {
+  int  number;
+  int  *start;
+} Mode;
+
+typedef struct {
+  Polyominoes *polyomino;
+  Mode  mode;
+} Polytris;
+
+static Polytris polytris[2];
+
+typedef struct {
+  int pmid, cid;
+} fieldstruct;
+
+typedef struct {
+  Bool   painted;
+  int   object, orient;
+  GC   gc;
+  Colormap cmap;
+  Bool   cycle_p, mono_p, no_colors, use3D;
+  unsigned long blackpixel, whitepixel, fg, bg;
+  int   direction;
+  unsigned long colour;
+  int   p_type;
+  int   sidemoves;
+
+  int   xb, yb;
+  int   xs, ys;
+  int   width, height;
+  int   pixelmode;
+  XImage *images[BITMAPS];
+  XColor     *colors;
+  int   ncolors;
+  int   ncols, nrows;
+  int   rows, level;
+  Bool    bonus, bonusNow;
+  thing_t     curPolyomino;
+
+  /* tetris */
+  fieldstruct *field;
+
+  /* welltris */
+  Bool well;
+  int frozen_wall[MAX_SIDES];
+  fieldstruct wall[WELL_DEPTH+WELL_WIDTH][WELL_PERIMETER];
+  fieldstruct base[WELL_WIDTH][WELL_WIDTH];
+  Pixmap graypix;
+
+  ModeInfo *mi;
+} trisstruct;
+
+#define ARR(i,j) (((i)<0||(i)>=tp->curPolyomino.size||\
+(j)<0||(j)>=tp->curPolyomino.size)?-2:\
+(polytris[(int) tp->bonusNow].polyomino[tp->curPolyomino.polyomino_number].shape[(j) * tp->curPolyomino.size + (i)]>0))
+
+#define ROUND8(n) ((((n)+7)/8)*8)
+
+/* Defines to index the bitmaps.  A set bit indicates that an edge or
+   corner is required. */
+#define LEFT 1 /* (1<<0) */
+#define DOWN 2 /* (1<<1) */
+#define RIGHT 4 /* (1<<2) */
+#define UP 8 /* (1<<3) */
+#define LEFT_DOWN 16 /* (1<<4) */
+#define RIGHT_DOWN 32 /* (1<<5) */
+#define RIGHT_UP 64 /* (1<<6) */
+#define LEFT_UP 128 /* (1<<7) */
+#define IS_LEFT(n) ((n)&LEFT)
+#define IS_DOWN(n) ((n)&DOWN)
+#define IS_RIGHT(n) ((n)&RIGHT)
+#define IS_UP(n) ((n)&UP)
+#define IS_LEFT_DOWN(n) ((n)&LEFT_DOWN)
+#define IS_RIGHT_DOWN(n) ((n)&RIGHT_DOWN)
+#define IS_RIGHT_UP(n) ((n)&RIGHT_UP)
+#define IS_LEFT_UP(n) ((n)&LEFT_UP)
+
+#define CHECKLEFT(x) ((x)|LEFT)
+#define CHECKDOWN(x) ((x)|DOWN)
+#define CHECKRIGHT(x) ((x)|RIGHT)
+#define CHECKUP(x) ((x)|UP)
+
+/* Defines to access the bitmaps. */
+#define BITNO(x,y) ((x)+(y)*ROUND8(tp->ys))
+#define SETBIT(x,y) {data[BITNO(x,y)/8] |= 1<<(BITNO(x,y)%8);}
+#define RESBIT(x,y) {data[BITNO(x,y)/8] &= ~(1<<(BITNO(x,y)%8));}
+#define TWOTHIRDSBIT(x,y) {if ((x+y-1)%3) SETBIT(x,y) else RESBIT(x,y)}
+#define HALFBIT(x,y) {if ((x-y)%2) SETBIT(x,y) else RESBIT(x,y)}
+#define THIRDBIT(x,y) {if (!((x-y-1)%3)) SETBIT(x,y) else RESBIT(x,y)}
+#define THREEQUARTERSBIT(x,y) \
+  {if ((y%2)||((x+2+y/2+1)%2)) SETBIT(x,y) else RESBIT(x,y)}
+#define NOTHALFBIT(x,y) {if ((x-y)%2) RESBIT(x,y) else SETBIT(x,y)}
+
+/* Parameters for bitmaps. */
+#define G ((tp->ys/45)+1)         /* 1/2 of gap between pentominoes. */
+#define T ((tp->ys<=12)?1:(G*2))  /* Thickness of walls of pentominoes. */
+#define R ((tp->ys<=12)?1:(G*6))  /* Amount of rounding. */
+#define RT ((tp->ys<=12)?1:(G*3)) /* Thickness of wall of rounded parts. 
+                                  Here 3 is an approximation to 2 sqrt(2).  */
+#define RR 0   /* Roof ridge thickness */
+
+/* A list of those bitmaps we need to create to display any polyomino. */
+static int images_needed[] =
+{
+/* This needed for mononimo*/
+ LEFT|RIGHT|UP|DOWN|LEFT_UP|LEFT_DOWN|RIGHT_UP|RIGHT_DOWN,
+
+ LEFT_UP|LEFT_DOWN|RIGHT_UP|RIGHT_DOWN,
+
+ LEFT|RIGHT_UP|RIGHT_DOWN,
+ RIGHT|LEFT_UP|LEFT_DOWN,
+ UP|LEFT_DOWN|RIGHT_DOWN,
+ DOWN|LEFT_UP|RIGHT_UP,
+ LEFT|RIGHT_UP,
+ RIGHT|LEFT_UP,
+ UP|LEFT_DOWN,
+ DOWN|LEFT_UP,
+ LEFT|RIGHT_DOWN,
+ RIGHT|LEFT_DOWN,
+ UP|RIGHT_DOWN,
+ DOWN|RIGHT_UP,
+
+#if 0
+/* These needed for hexonimoes*/
+ LEFT,
+ RIGHT,
+ UP,
+ DOWN,
+ LEFT_DOWN|RIGHT_UP|RIGHT_DOWN,
+ LEFT_UP|RIGHT_UP|RIGHT_DOWN,
+ LEFT_UP|LEFT_DOWN|RIGHT_DOWN,
+ LEFT_UP|LEFT_DOWN|RIGHT_UP,
+#endif
+
+ LEFT|UP|RIGHT_DOWN,
+ LEFT|DOWN|RIGHT_UP,
+ RIGHT|UP|LEFT_DOWN,
+ RIGHT|DOWN|LEFT_UP,
+ LEFT|UP,
+ LEFT|DOWN,
+ RIGHT|UP,
+ RIGHT|DOWN,
+
+ LEFT|RIGHT,
+ UP|DOWN,
+
+ RIGHT|UP|DOWN,
+ LEFT|UP|DOWN,
+ LEFT|RIGHT|DOWN,
+ LEFT|RIGHT|UP,
+
+ -1
+};
+
+static trisstruct *triss = NULL;
+
+/* Setup: Normal, Bonus */
+static int area_kinds[] = {3, 3};
+static int omino_squares[] = {4, 5};
+static int start_ominoes[] = {7, 18};
+static int max_ominoes[] = {19, 63};
+
+static int
+ominos[] =
+{
+  /* Side of smallest square that contains shape */
+  /* Number of orientations */
+  /* Position, Next Postion, (not used yet),
+     number_down, used_for_start?
+     Polyomino (side^2 values) */
+
+  /* Normal pieces  4 squares */
+  2,
+  1,
+  0, 0, 0,   2,   6, 3,  12, 9,
+
+  3,
+  16,
+  0, 1, 4,     2,   0, 0, 0,  6, 5, 1,   8, 0, 0,
+  1, 2, 7,     0,   0, 2, 0,  0, 10, 0,  0, 12, 1,
+  2, 3, 6,     0,   0, 0, 0,  0, 0, 2,   4, 5, 9,
+  3, 0, 5,     0,   0, 4, 3,  0, 0, 10,  0, 0, 8,
+  4, 5, 0,     1,   0, 0, 0,  4, 5, 3,   0, 0, 8,
+  5, 6, 3,     0,   0, 6, 1,  0, 10, 0,  0, 8, 0,
+  6, 7, 2,     0,   0, 0, 0,  2, 0, 0,   12, 5, 1,
+  7, 4, 1,     0,   0, 0, 2,  0, 0, 10,  0, 4, 9,
+  8, 9, 8,     2,   0, 0, 0,  4, 7, 1,   0, 8, 0,
+  9, 10, 11,   0,   0, 2, 0,  0, 14, 1,  0, 8, 0,
+  10, 11, 10,  0,   0, 0, 0,  0, 2, 0,   4, 13, 1,
+  11, 8, 9,    0,   0, 0, 2,  0, 4, 11,  0, 0, 8,
+  12, 13, 14,  2,   0, 0, 0,  4, 3, 0,   0, 12, 1,
+  13, 12, 15,  0,   0, 0, 2,  0, 6, 9,   0, 8, 0,
+  14, 15, 12,  1,   0, 0, 0,  0, 6, 1,   4, 9, 0,
+  15, 14, 13,  0,   0, 2, 0,  0, 12, 3,  0, 0, 8,
+
+  4,
+  2,
+  0, 1, 0,  2,   0, 0, 0, 0,  0, 0, 0, 0,   4, 5, 5, 1,   0, 0, 0, 0,
+  1, 0, 1,  0,   0, 0, 2, 0,  0, 0, 10, 0,  0, 0, 10, 0,  0, 0, 8, 0,
+
+  /* Bonus pieces  5 squares */
+  3,
+  37,
+  0, 1, 0,     2,   0, 0, 0,  6, 5, 3,    8, 0, 8,
+  1, 2, 3,     0,   0, 6, 1,  0, 10, 0,   0, 12, 1,
+  2, 3, 2,     0,   0, 0, 0,  2, 0, 2,    12, 5, 9,
+  3, 0, 1,     0,   0, 4, 3,  0, 0, 10,   0, 4, 9,
+  4, 5, 8,     2,   0, 0, 0,  6, 7, 1,    12, 9, 0,
+  5, 6, 11,    0,   0, 2, 0,  0, 14, 3,   0, 12, 9,
+  6, 7, 10,    0,   0, 0, 0,  0, 6, 3,    4, 13, 9,
+  7, 4, 9,     0,   0, 6, 3,  0, 12, 11,  0, 0, 8,
+  8, 9, 4,     1,   0, 0, 0,  4, 7, 3,    0, 12, 9,
+  9, 10, 7,    0,   0, 6, 3,  0, 14, 9,   0, 8, 0,
+  10, 11, 6,   0,   0, 0, 0,  6, 3, 0,    12, 13, 1,
+  11, 8, 5,    0,   0, 0, 2,  0, 6, 11,   0, 12, 9,
+  12, 13, 12,  2,   4, 7, 1,  0, 10, 0,   0, 8, 0,
+  13, 14, 15,  0,   2, 0, 0,  14, 5, 1,   8, 0, 0,
+  14, 15, 14,  0,   0, 2, 0,  0, 10, 0,   4, 13, 1,
+  15, 12, 13,  0,   0, 0, 2,  4,  5, 11,  0, 0, 8,
+  16, 17, 19,  2,   6, 5, 1,  10, 0, 0,   8, 0, 0,
+  17, 18, 18,  0,   2, 0, 0,  10, 0, 0,   12, 5, 1,
+  18, 19, 17,  0,   0, 0, 2,  0, 0, 10,   4, 5, 9,
+  19, 16, 16,  0,   4, 5, 3,  0, 0, 10,   0, 0, 8,
+  20, 21, 22,  2,   2, 0, 0,  12, 5, 3,   0, 0, 8,
+  21, 20, 23,  0,   0, 6, 1,  0, 10, 0,   4, 9, 0,
+  22, 23, 20,  1,   0, 0, 2,  6, 5, 9,    8, 0, 0,
+  23, 22, 21,  0,   4, 3, 0,  0, 10, 0,   0, 12, 1,
+  24, 25, 25,  2,   4, 3, 0,  0, 12, 3,   0, 0, 8,
+  25, 26, 24,  0,   0, 6, 1,  6, 9, 0,    8, 0, 0,
+  26, 27, 27,  0,   2, 0, 0,  12, 3, 0,   0, 12, 1,
+  27, 24, 26,  0,   0, 0, 2,  0, 6, 9,    4, 9, 0,
+  28, 29, 32,  2,   0, 2, 0,  6, 13, 1,   8, 0, 0,
+  29, 30, 35,  0,   0, 2, 0,  4, 11, 0,   0, 12, 1,
+  30, 31, 34,  0,   0, 0, 2,  4, 7, 9,    0, 8, 0,
+  31, 28, 33,  0,   4, 3, 0,  0, 14, 1,   0, 8, 0,
+  32, 33, 28,  1,   0, 2, 0,  4, 13, 3,   0, 0, 8,
+  33, 34, 31,  0,   0, 6, 1,  4, 11, 0,   0, 8, 0,
+  34, 35, 30,  0,   2, 0, 0,  12, 7, 1,   0, 8, 0,
+  35, 32, 29,  0,   0, 2, 0,  0, 14, 1,   4, 9, 0,
+  36, 36, 36,  2,   0, 2, 0,  4, 15, 1,   0, 8, 0,
+
+  4,
+  24,
+  0, 1, 4,     2,   0, 0, 0, 0,  6, 5, 5, 1,   8, 0, 0, 0,   0, 0, 0, 0,
+  1, 2, 7,     0,   0, 2, 0, 0,  0, 10, 0, 0,  0, 10, 0, 0,  0, 12, 1, 0,
+  2, 3, 6,     0,   0, 0, 0, 0,  0, 0, 0, 2,   4, 5, 5, 9,   0, 0, 0, 0,
+  3, 0, 5,     0,   0, 4, 3, 0,  0, 0, 10, 0,  0, 0, 10, 0,  0, 0, 8, 0,
+  4, 5, 0,     1,   0, 0, 0, 0,  4, 5, 5, 3,   0, 0, 0, 8,   0, 0, 0, 0,
+  5, 6, 3,     0,   0, 6, 1, 0,  0, 10, 0, 0,  0, 10, 0, 0,  0, 8, 0, 0,
+  6, 7, 2,     0,   0, 0, 0, 0,  2, 0, 0, 0,   12, 5, 5, 1,  0, 0, 0, 0,
+  7, 4, 1,     0,   0, 0, 2, 0,  0, 0, 10, 0,  0, 0, 10, 0,  0, 4, 9, 0,
+  8, 9, 12,    2,   0, 0, 0, 0,  4, 7, 5, 1,   0, 8, 0, 0,   0, 0, 0, 0,
+  9, 10, 15,   0,   0, 2, 0, 0,  0, 10, 0, 0,  0, 14, 1, 0,  0, 8, 0, 0,
+  10, 11, 14,  0,   0, 0, 0, 0,  0, 0, 2, 0,   4, 5, 13, 1,  0, 0, 0, 0,
+  11, 8, 13,   0,   0, 0, 2, 0,  0, 4, 11, 0,  0, 0, 10, 0,  0, 0, 8, 0,
+  12, 13, 8,   1,   0, 0, 0, 0,  4, 5, 7, 1,   0, 0, 8, 0,   0, 0, 0, 0,
+  13, 14, 11,  0,   0, 2, 0, 0,  0, 14, 1, 0,  0, 10, 0, 0,  0, 8, 0, 0,
+  14, 15, 10,  0,   0, 0, 0, 0,  0, 2, 0, 0,   4, 13, 5, 1,  0, 0, 0, 0,
+  15, 12, 9,   0,   0, 0, 2, 0,  0, 0, 10, 0,  0, 4, 11, 0,  0, 0, 8, 0,
+  16, 17, 20,  2,   0, 0, 0, 0,  4, 5, 3, 0,   0, 0, 12, 1,  0, 0, 0, 0,
+  17, 18, 23,  0,   0, 0, 2, 0,  0, 6, 9, 0,   0, 10, 0, 0,  0, 8, 0, 0,
+  18, 19, 22,  0,   0, 0, 0, 0,  4, 3, 0, 0,   0, 12, 5, 1,  0, 0, 0, 0,
+  19, 16, 21,  0,   0, 0, 2, 0,  0, 0, 10, 0,  0, 6, 9, 0,   0, 8, 0, 0,
+  20, 21, 16,  1,   0, 0, 0, 0,  0, 6, 5, 1,   4, 9, 0, 0,   0, 0, 0, 0,
+  21, 22, 19,  0,   0, 2, 0, 0,  0, 10, 0, 0,  0, 12, 3, 0,  0, 0, 8, 0,
+  22, 23, 18,  0,   0, 0, 0, 0,  0, 0, 6, 1,   4, 5, 9, 0,   0, 0, 0, 0,
+  23, 20, 17,  0,   0, 2, 0, 0,  0, 12, 3, 0,  0, 0, 10, 0,  0, 0, 8, 0,
+
+  5,
+  2,
+  0, 1, 0,  2,   0, 0, 0, 0, 0,  0, 0, 0, 0, 0,   4, 5, 5, 5, 1,   0, 0, 0, 0, 0,   0, 0, 0, 0, 0,
+  1, 0, 1,  0,   0, 0, 2, 0, 0,  0, 0, 10, 0, 0,  0, 0, 10, 0, 0,  0, 0, 10, 0, 0,  0, 0, 8, 0, 0,
+};
+
+static int
+image_needed(int n) {
+  int i;
+
+  for (i=0;images_needed[i]!=-1;i++)
+    if (n == images_needed[i])
+      return 1;
+  return 0;
+}
+
+static void 
+leadingEmptyWidth(Polyominoes * polyo)
+{
+  int i, j;
+
+  for (i = 0; i < polyo->size; i++) {
+    for (j = 0; j < polyo->size; j++) {
+      if (polyo->shape[j * polyo->size + i]) {
+        polyo->leadingEmptyWidth = i;
+        return;
+      }
+    }
+  }
+  polyo->leadingEmptyWidth = polyo->size;
+}
+
+static void
+leadingEmptyHeight(Polyominoes * polyo)
+{
+  int i, j;
+
+  for (j = 0; j < polyo->size; j++) {
+    for (i = 0; i < polyo->size; i++) {
+      if (polyo->shape[j * polyo->size + i]) {
+        polyo->leadingEmptyHeight = j;
+        return;
+      }
+    }
+  }
+  polyo->leadingEmptyHeight = polyo->size;
+}
+
+static Bool
+readPolyominoes(void)
+{
+  int   size, n, index = 0, sum = 0;
+  int   counter, start_counter;
+  int   polyomino, kinds, i, j, bonustype;
+
+  for (bonustype = 0; bonustype < 2; bonustype++) {
+    counter = 0, start_counter = 0;
+    polytris[bonustype].mode.number = start_ominoes[bonustype];
+    for (kinds = 0; kinds < area_kinds[bonustype]; kinds++) {
+      size = ominos[index++];
+      if (size > omino_squares[bonustype]) {
+        (void) printf("tetris corruption: size %d\n", size);
+        return False;
+      }
+      n = ominos[index++];
+      if (sum > max_ominoes[bonustype]) {
+        (void) printf("tetris corruption: n %d\n", n);
+        return False;
+      }
+      for (polyomino = 0; polyomino < n; polyomino++) {
+        if (polyomino + counter < max_ominoes[bonustype]) {
+          sum = polyomino + counter;
+        } else {
+          (void) printf("tetris corruption: bonustype %d, polyomino %d, counter %d\n",
+            bonustype, polyomino, counter);
+          return False;
+        }
+        if (polyomino != ominos[index]) {
+          (void) printf("tetris corruption: polyomino %d, ominos[index] %d\n",
+            polyomino, ominos[index]);
+          return False;
+        }
+        index++;  /* This is only there to "read" it */
+        polytris[bonustype].polyomino[sum].rotation =
+          ominos[index++] + counter;
+        polytris[bonustype].polyomino[sum].reflection =
+          ominos[index++] + counter; /* not used */
+
+        if (ominos[index++]) {
+          if (start_counter < start_ominoes[bonustype]) {
+            polytris[bonustype].mode.start[start_counter++] = sum;
+          } else {
+            (void) printf("tetris corruption: bonustype %d, polyomino %d, start_counter %d\n",
+              bonustype, polyomino, start_counter);
+            return False;
+          }
+        }
+        polytris[bonustype].polyomino[sum].size = size;
+        if ((polytris[bonustype].polyomino[sum].shape = (int *) malloc(size *
+            size * sizeof(int))) == NULL) {
+          (void) printf("tetris out of memory\n");
+          return False;
+       }
+        for (j = 0; j < size; j++) {
+          for (i = 0; i < size; i++) {
+            polytris[bonustype].polyomino[sum].shape[j * size + i] =
+        ominos[index++];
+          }
+        }
+        leadingEmptyWidth(&(polytris[bonustype].polyomino[sum]));
+        leadingEmptyHeight(&(polytris[bonustype].polyomino[sum]));
+      }
+      counter += n;
+    }
+  }
+  return True;
+}
+
+#ifdef DEBUG
+static void
+writePolyominoes(trisstruct * tp)
+{
+  int   size = 0;
+  int   polyomino, i, j, bonustype;
+
+  for (bonustype = 0; bonustype < 2; bonustype++) {
+    for (polyomino = 0; polyomino < max_ominoes[bonustype]; polyomino++) {
+      (void) printf("polyomino %d, rotation %d, reflection %d, size %d\n",
+        polyomino, polytris[bonustype].polyomino[polyomino].rotation,
+        polytris[bonustype].polyomino[polyomino].reflection,
+        polytris[bonustype].polyomino[polyomino].size);
+      size = polytris[bonustype].polyomino[polyomino].size;
+      for (j = 0; j < size; j++) {
+        (void) printf(" ");
+        for (i = 0; i < size; i++) {
+          (void) printf(" %d", polytris[bonustype].polyomino[polyomino].shape[j * size + i]);
+        }
+      }
+      (void) printf("\n");
+    }
+    (void) printf("Starts:");
+    for (polyomino = 0; polyomino < start_ominoes[bonustype]; polyomino++) {
+      (void) printf(" %d", polytris[bonustype].mode.start[polyomino]);
+    }
+    (void) printf("\n");
+  }
+}
+#endif
+
+static void
+setColour(ModeInfo * mi, int cid /* , int exor */) 
+{
+  Display    *display = MI_DISPLAY(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  long colour;
+
+  if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+    if (tp->ncolors >= start_ominoes[(int) tp->bonusNow] + 2)
+      colour = cid + 2;
+    else
+      colour = 1; /* Just in case */
+    XSetBackground(display, tp->gc, tp->blackpixel);
+    XSetForeground(display, tp->gc, tp->colors[colour].pixel);
+  } else {
+    if (MI_NPIXELS(mi) > start_ominoes[(int) tp->bonusNow])
+      colour = MI_PIXEL(mi, cid * MI_NPIXELS(mi) / start_ominoes[(int) tp->bonusNow]);
+    else
+      colour = MI_WHITE_PIXEL(mi);
+    XSetForeground(display, tp->gc, colour);
+    XSetBackground(display, tp->gc, MI_BLACK_PIXEL(mi));
+  }
+}
+
+static void
+drawSquare(ModeInfo * mi, int pmid, int cid, int col, int row)
+{
+  Display    *display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  setColour(mi, cid /* , 0 */);
+  if (tp->pixelmode)
+    XFillRectangle(display, window, tp->gc,
+      tp->xb + col * tp->xs, tp->yb + row * tp->ys, tp->xs, tp->ys);
+  else {
+    if (pmid < 0 || pmid >= 256)
+      (void) printf("pmid = %d\n", pmid);
+/*-
+ * PURIFY on SunOS4 and on Solaris 2 reports a 120 byte memory leak on
+ * the next line */
+    (void) XPutImage(display, window, tp->gc, tp->images[pmid], 0, 0,
+      tp->xb + col * tp->xs, tp->yb + row * tp->ys,
+      tp->xs, tp->ys);
+  }
+}
+
+static void
+xorSquare(ModeInfo * mi, int i, int j)
+{
+  Display    *display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  XSetFunction(display, tp->gc, GXxor);
+  XSetBackground(display, tp->gc, 0);
+  XSetForeground(display, tp->gc, 0xFFFFFF);
+  XFillRectangle(display, window, tp->gc,
+    tp->xb + i * tp->xs, tp->yb + j * tp->ys,
+    tp->xs, tp->ys);
+  XSetFunction(display, tp->gc, GXcopy);
+  XSetBackground(display, tp->gc, tp->blackpixel);
+  XSetForeground(display, tp->gc, tp->whitepixel);
+}
+
+static void
+XFillTrapazoid(Display *display, Window window, GC gc,
+  int ulx, int uly, int base_x, int base_y, int lrx, int lry,
+  int plateau_x, int plateau_y)
+{
+  XPoint trapazoid_list[MAX_SIDES];
+
+  trapazoid_list[0].x = ulx;
+  trapazoid_list[0].y = uly;
+  trapazoid_list[1].x = base_x;
+  trapazoid_list[1].y = base_y;
+  trapazoid_list[2].x = lrx - base_x - ulx;
+  trapazoid_list[2].y = lry - base_y - uly;
+  trapazoid_list[3].x = -plateau_x;
+  trapazoid_list[3].y = -plateau_y;
+  XFillPolygon(display, window, gc, trapazoid_list, MAX_SIDES,
+    Convex, CoordModePrevious);
+}
+
+static void
+drawWallSquare(ModeInfo * mi, GC gc, int i, int j)
+{
+  Display    *display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int ulx, uly, lrx, lry, base_x, plateau_x, w, offsetx, offsety;
+
+  offsetx = tp->width / 2 - 3 * (WELL_WIDTH * tp->xs) / 2 - DELTA;
+  offsety = tp->height / 2 - 3 * (WELL_WIDTH * tp->xs) / 2 - DELTA;
+  w = i / WELL_WIDTH;
+  i -= (w * WELL_WIDTH);
+  ulx = 3 * BASE_WIDTH / 2 + (i - (WELL_WIDTH / 2)) *
+    (2 * tp->xs * (WELL_DEPTH - j) / WELL_DEPTH + tp->xs) +
+    2 * DELTA;
+  uly = j * WELL_WIDTH * tp->xs / WELL_DEPTH + 2 * DELTA;
+  lrx = 3 * BASE_WIDTH / 2 + (i + 1 - (WELL_WIDTH / 2)) *
+    (2 * tp->xs * (WELL_DEPTH - j - 1) / WELL_DEPTH + tp->xs) +
+    DELTA * (i / 4) - 3 * DELTA;
+  lry = (j + 1) * WELL_WIDTH * tp->xs / WELL_DEPTH - DELTA;
+  base_x = tp->xs + (WELL_DEPTH - j) * 2 * tp->xs / WELL_DEPTH -
+    5 * DELTA;
+  plateau_x = tp->xs + (WELL_DEPTH - j - 1) * 2 *
+    tp->xs / WELL_DEPTH - 5 * DELTA;
+  {
+    XSetFillStyle(display, gc, FillOpaqueStippled);
+    XSetStipple(display, gc, tp->graypix);
+  }
+  switch (w) {
+  case 0:
+    XFillTrapazoid(display, window, gc,
+      ulx + offsetx, uly + offsety, base_x, 0,
+      lrx + offsetx, lry + offsety, plateau_x, 0);
+    break;
+  case 1:
+    XFillTrapazoid(display, window, gc,
+      ENDPT - uly + offsetx, ulx + offsety, 0, base_x,
+      ENDPT - lry + offsetx, lrx + offsety, 0, plateau_x);
+    break;
+  case 2:
+    XFillTrapazoid(display, window, gc,
+      ENDPT - 1 - ulx + offsetx, ENDPT - uly + offsety, -base_x, 0,
+      ENDPT - 1 - lrx + offsetx, ENDPT - lry + offsety, -plateau_x, 0);
+    break;
+  case 3:
+    XFillTrapazoid(display, window, gc,
+      uly + offsetx, ENDPT - 1 - ulx + offsety, 0, -base_x,
+      lry + offsetx, ENDPT - 1 - lrx + offsety, 0, -plateau_x);
+    break;
+  default:
+    (void) fprintf (stderr, "trapazoid kinds range 0-3, got %d.\n", w);
+  }
+  {
+    XSetFillStyle(display, gc, FillSolid);
+  }
+}
+
+static void
+clearTrapazoid(ModeInfo * mi, int i, int j)
+{
+  Display    *display = MI_DISPLAY(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  XSetForeground(display, tp->gc, tp->blackpixel);
+  drawWallSquare(mi, tp->gc, i, j); /* pmid not used yet */
+}
+
+static void
+drawTrapazoid(ModeInfo * mi, /* int pmid, */ int cid, int i, int j)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  setColour(mi, cid /* , 0 */ );
+  drawWallSquare(mi, tp->gc, i, j); /* pmid not used yet */
+}
+
+static void
+freezeTrapazoid(ModeInfo * mi, int i, int j)
+{
+  Display    *display = MI_DISPLAY(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  XSetFunction(display, tp->gc, GXxor);
+  XSetBackground(display, tp->gc, 0);
+  XSetForeground(display, tp->gc, 0xFFFFFF);
+  drawWallSquare(mi, tp->gc, i, j); /* pmid not used yet */
+  XSetFunction(display, tp->gc, GXcopy);
+  XSetBackground(display, tp->gc, tp->blackpixel);
+  XSetForeground(display, tp->gc, tp->whitepixel);
+}
+
+static int
+checkWall(int pmid, int base_i, int base_j)
+{
+  if (pmid < 0)
+    return pmid;
+  /* Check if next to well wall */
+  if (base_i == 0)
+    pmid = CHECKLEFT((unsigned int) pmid);
+  if (base_j == 0)
+    pmid = CHECKUP((unsigned int) pmid);
+  if (base_i == WELL_WIDTH - 1)
+    pmid = CHECKRIGHT((unsigned int) pmid);
+  if (base_j == WELL_WIDTH - 1)
+    pmid = CHECKDOWN((unsigned int) pmid);
+  return pmid;
+}
+
+static int
+checkSides(int pmid, int i)
+{
+  if (pmid < 0)
+    return pmid;
+  if (i == 0 || i == 3 * WELL_WIDTH - 1)
+    pmid = CHECKLEFT((unsigned int) pmid);
+  else if (i == WELL_WIDTH - 1 || i == 2 * WELL_WIDTH)
+    pmid = CHECKRIGHT((unsigned int) pmid);
+  else if (i == WELL_WIDTH || i == 4 * WELL_WIDTH - 1)
+    pmid = CHECKUP((unsigned int) pmid);
+  else if (i == 2 * WELL_WIDTH - 1 || i == 3 * WELL_WIDTH)
+    pmid = CHECKDOWN((unsigned int) pmid);
+  return pmid;
+}
+
+static int
+checkBottom(int pmid, int i, int j)
+{
+  if (pmid < 0 || j != WELL_DEPTH - 1)
+    return pmid;
+  switch (i / WELL_WIDTH) {
+  case 0:
+    return CHECKDOWN((unsigned int) pmid);
+  case 1:
+    return CHECKLEFT((unsigned int) pmid);
+  case 2:
+    return CHECKUP((unsigned int) pmid);
+  case 3:
+    return CHECKRIGHT((unsigned int) pmid);
+  }
+  return EMPTY;
+}
+
+/* Wall number ... imagine a 4 hour clock...
+     0
+    3+1
+     2
+ */
+static void
+wall_to_base(int *base_x, int *base_y, int wall_x, int wall_y)
+{
+  switch (wall_x / WELL_WIDTH)
+  {
+  case 0:
+    *base_x = wall_x;
+    *base_y = wall_y - WELL_DEPTH;
+    break;
+  case 1:
+    *base_x = WELL_WIDTH - 1 + WELL_DEPTH - wall_y;
+    *base_y = wall_x - WELL_WIDTH;
+    break;
+  case 2:
+    *base_x = WELL_PERIMETER - 1 - WELL_WIDTH - wall_x;
+    *base_y = WELL_WIDTH - 1 + WELL_DEPTH - wall_y;
+    break;
+  case 3:
+    *base_x = wall_y - WELL_DEPTH;
+    *base_y = WELL_PERIMETER - 1 - wall_x;
+    break;
+  default:
+   (void) fprintf (stderr, "wall_to_base kinds range 0-3, got %d.\n",
+               wall_x / WELL_WIDTH);
+  }
+}
+
+static void
+dropWall(ModeInfo *mi, int w)
+{
+  Display    *display = MI_DISPLAY(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int i, j, k, l, lines, base_x, base_y;
+  Bool fits;
+
+  lines = 0;
+  for (j = WELL_DEPTH - 1; j >= 0 && lines == 0; j--)
+    for (i = 0; i < WELL_WIDTH; i++)
+      if (tp->wall[j][w * WELL_WIDTH + i].pmid != EMPTY)
+        lines = WELL_DEPTH - j;
+  if (lines > 0) {
+    fits = True;
+    j = 0;
+    while (j < (WELL_WIDTH / 2 + lines - 1) && fits) {
+      j++;
+      for (l = WELL_DEPTH - j; l < WELL_DEPTH; l++)
+        for (i = 0; i < WELL_WIDTH; i++)
+          if (tp->wall[l][w * WELL_WIDTH + i].pmid != EMPTY) {
+            wall_to_base(&base_x, &base_y,
+              w * WELL_WIDTH + i, l + j);
+            if (tp->base[base_y][base_x].pmid != EMPTY)
+              fits = False;
+          }
+    }
+    if (!fits)
+      j--;
+    if (j > 0)
+    {
+      for (l = WELL_DEPTH - 1; l >= 0; l--)
+        for (i = 0; i < WELL_WIDTH; i++)
+          if (tp->wall[l][w * WELL_WIDTH + i].pmid != EMPTY) {
+            k = w * WELL_WIDTH + i;
+            if (l + j >= WELL_DEPTH) {
+              wall_to_base(&base_x, &base_y, k, l + j);
+              tp->base[base_y][base_x] = tp->wall[l][k];
+              tp->base[base_y][base_x].pmid =
+                checkWall(tp->base[base_y][base_x].pmid, base_x, base_y);
+              tp->wall[l][k].pmid = EMPTY;
+              clearTrapazoid(mi, k, l);
+              drawSquare(mi, tp->base[base_y][base_x].pmid,
+                tp->base[base_y][base_x].cid, base_x, base_y);
+            } else {
+              tp->wall[l + j][k] = tp->wall[l][k];
+              tp->wall[l + j][k].pmid =
+                checkBottom(tp->wall[l + j][k].pmid, k, l + j);
+              tp->wall[l][k].pmid = EMPTY;
+              clearTrapazoid(mi, k, l);
+              drawTrapazoid(mi, /* tp->wall[l][k].pmid, */ tp->wall[l][k].cid,
+                k, l + j);
+            }
+            XFlush(display);
+          }
+    }
+  }
+}
+
+static void
+freezeWall(ModeInfo * mi, int w)
+{
+  int i, j;
+
+  for (j = 0; j < WELL_DEPTH; j++)
+    for (i = 0; i < WELL_WIDTH; i++) {
+      freezeTrapazoid(mi, w * WELL_WIDTH + i, j);
+    }
+  XFlush(MI_DISPLAY(mi));
+}
+
+static Bool
+allFrozen(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int w;
+
+  for (w = 0; w < MAX_SIDES; w++)
+    if (tp->frozen_wall[w] == MAX_SIDES) {
+      freezeWall(mi, w);
+      XFlush(MI_DISPLAY(mi));
+    }
+  for (w = 0; w < MAX_SIDES; w++)
+    if (!tp->frozen_wall[w])
+      return False;
+  return True;
+}
+
+static void
+checkFreeze(ModeInfo *mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int w;
+
+  for (w = 0; w < MAX_SIDES; w++) {
+    if (!tp->frozen_wall[w]) {
+      dropWall(mi, w);
+    } else {
+      tp->frozen_wall[w]--;
+      if (!tp->frozen_wall[w]) {
+        freezeWall(mi, w);
+        dropWall(mi, w);
+      }
+    }
+  }
+}
+
+static int
+curPixmap(trisstruct *tp, int i, int j)
+{
+  int pmid = 0;
+
+  if (ARR(i,j) != ARR(i-1,j))
+    pmid |= LEFT;
+  if (ARR(i,j) != ARR(i,j+1))
+    pmid |= DOWN;
+  if (ARR(i,j) != ARR(i+1,j))
+    pmid |= RIGHT;
+  if (ARR(i,j) != ARR(i,j-1))
+    pmid |= UP;
+  if (ARR(i,j) != ARR(i-1,j+1))
+    pmid |= LEFT_DOWN;
+  if (ARR(i,j) != ARR(i+1,j+1))
+    pmid |= RIGHT_DOWN;
+  if (ARR(i,j) != ARR(i+1,j-1))
+    pmid |= RIGHT_UP;
+  if (ARR(i,j) != ARR(i-1,j-1))
+    pmid |= LEFT_UP;
+  return pmid;
+}
+
+static int
+rotateIndex(int pmid, int i)
+{
+  int wallRotation, pm1, pm0;
+
+  if (pmid == EMPTY)
+    return EMPTY;
+  wallRotation = (MAX_SIDES - i / WELL_WIDTH) % MAX_SIDES;
+  pm1 = (0xF0 & pmid) << wallRotation;
+  pm0 = (0xF & pmid) << wallRotation;
+  pm1 = (0xF0 & pm1) | ((pm1 & 0xF00) >> MAX_SIDES);
+  pm0 = (0xF & pm0) | ((pm0 & 0xF0) >> MAX_SIDES);
+  return (pm1 | pm0);
+}
+
+static void
+drawBox(ModeInfo * mi, int pmid, int cid, int i, int j)
+{
+  if (j < WELL_DEPTH) {
+    drawTrapazoid(mi, /* pmid, */ cid, i, j);
+  } else {
+    int base_i, base_j;
+
+    wall_to_base(&base_i, &base_j, i, j);
+    drawSquare(mi, pmid, cid, base_i, base_j);
+  }
+}
+
+static void
+clearSquare(ModeInfo * mi, int col, int row)
+{
+  Display    *display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  XSetForeground(display, tp->gc, tp->blackpixel);
+  XFillRectangle(display, window, tp->gc,
+    tp->xb + col * tp->xs, tp->yb + row * tp->ys, tp->xs, tp->ys);
+}
+
+static void
+drawPolyomino(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int   i, j;
+
+  if (tp->well) {
+    int xi, yj, base_i, base_j;
+    int temp_base[WELL_WIDTH][WELL_WIDTH];
+
+    /* Initialize */
+    for (i = 0; i < WELL_WIDTH; i++)
+      for (j = 0; j < WELL_WIDTH; j++)
+        temp_base[j][i] = 0;
+    /* Find pieces and overlap them if necessary */
+    for (i = 0; i < tp->curPolyomino.size; i++) {
+      for (j = 0; j < tp->curPolyomino.size; j++) {
+        if (polytris[(int) tp->bonusNow].polyomino
+                    [tp->curPolyomino.polyomino_number].shape
+                    [j * tp->curPolyomino.size + i]) {
+          int xi, yj;
+
+          xi = (tp->curPolyomino.xpos + i) % WELL_PERIMETER;
+          yj = tp->curPolyomino.ypos + j;
+          if (yj >= WELL_DEPTH) {
+            wall_to_base(&base_i, &base_j, xi, yj);
+            xi = checkWall(rotateIndex(curPixmap(tp, i, j), xi),
+              base_i, base_j);
+            if (!temp_base[base_j][base_i])
+              temp_base[base_j][base_i] = xi;
+            else
+              temp_base[base_j][base_i] &= xi;
+          }
+        }
+      }
+      /* Now draw */
+      for (i = 0; i < tp->curPolyomino.size; i++)
+        for (j = 0; j < tp->curPolyomino.size; j++)
+          if (polytris[(int) tp->bonusNow].polyomino
+                      [tp->curPolyomino.polyomino_number].shape
+                      [j * tp->curPolyomino.size + i]) {
+            xi = (tp->curPolyomino.xpos + i) % WELL_PERIMETER;
+            yj = tp->curPolyomino.ypos + j;
+            if (yj >= WELL_DEPTH) {
+              wall_to_base(&base_i, &base_j, xi, yj);
+              if (temp_base[base_j][base_i]) {
+                drawSquare(mi, temp_base[base_j][base_i],
+                  tp->curPolyomino.color_number, base_i, base_j);
+                temp_base[base_j][base_i] = 0;
+              }
+            } else if (yj >= 0) {
+              drawTrapazoid(mi, /* tp->curPolyomino.pmid, */
+                tp->curPolyomino.color_number, xi, yj);
+            }
+          }
+    }
+  } else {
+    for (i = 0; i < tp->curPolyomino.size; i++) {
+      for (j = 0; j < tp->curPolyomino.size; j++) {
+        if (polytris[(int) tp->bonusNow].polyomino
+                    [tp->curPolyomino.polyomino_number].shape
+                    [j * tp->curPolyomino.size + i]) {
+          drawSquare(mi, curPixmap(tp, i, j),
+            tp->curPolyomino.color_number,
+            tp->curPolyomino.xpos + i, tp->curPolyomino.ypos + j);
+        }
+      }
+    }
+  }
+}
+
+static void
+drawPolyominoDiff(ModeInfo *mi, thing_t * old)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int   i, j, ox, oy;
+
+  if (tp->well) {
+    int xi, yj, base_i, base_j;
+    int temp_base[WELL_WIDTH][WELL_WIDTH];
+
+    /* Initialize */
+    for (i = 0; i < WELL_WIDTH; i++)
+      for (j = 0; j < WELL_WIDTH; j++)
+        temp_base[j][i] = 0;
+    /* Find pieces and overlap them if necessary */
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++)
+        if (polytris[(int) tp->bonusNow].polyomino
+                    [tp->curPolyomino.polyomino_number].shape
+                    [j * tp->curPolyomino.size + i]) {
+          xi = (tp->curPolyomino.xpos + i) % WELL_PERIMETER;
+          yj = tp->curPolyomino.ypos + j;
+          if (yj >= WELL_DEPTH) {
+            wall_to_base(&base_i, &base_j, xi, yj);
+            xi = checkWall(rotateIndex(curPixmap(tp, i, j), xi),
+              base_i, base_j);
+            if (!temp_base[base_j][base_i])
+              temp_base[base_j][base_i] = xi;
+            else
+              temp_base[base_j][base_i] &= xi;
+           }
+          }
+    /* Now draw */
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++)
+        if (polytris[(int) tp->bonusNow].polyomino
+                    [tp->curPolyomino.polyomino_number].shape
+                    [j * tp->curPolyomino.size + i]) {
+          xi = (tp->curPolyomino.xpos + i) % WELL_PERIMETER;
+          yj = tp->curPolyomino.ypos + j;
+          if (yj >= WELL_DEPTH) {
+            wall_to_base(&base_i, &base_j, xi, yj);
+            if (temp_base[base_j][base_i] > 0) {
+              drawSquare(mi, temp_base[base_j][base_i],
+                tp->curPolyomino.color_number, base_i, base_j);
+               /* negate for erase */
+               temp_base[base_j][base_i] = -temp_base[base_j][base_i];
+             }
+           } else if (yj >= 0) {
+              drawTrapazoid(mi, /* tp->curPolyomino.pmid, */
+                tp->curPolyomino.color_number, xi, yj);
+            }
+          }
+    /* Erase */
+    for (i = 0; i < old->size; i++)
+      for (j = 0; j < old->size; j++) {
+        xi = (old->xpos + i) % WELL_PERIMETER;
+        yj = old->ypos + j;
+        ox = (xi - tp->curPolyomino.xpos + WELL_PERIMETER) % WELL_PERIMETER;
+        oy = yj - tp->curPolyomino.ypos;
+        if (yj >= WELL_DEPTH) {
+          wall_to_base(&base_i, &base_j, xi, yj);
+          if (polytris[(int) tp->bonusNow].polyomino
+                      [old->polyomino_number].shape
+                      [j * old->size + i] &&
+            ((ox >= tp->curPolyomino.size) || (oy < 0) ||
+             (oy >= tp->curPolyomino.size) || !temp_base[base_j][base_i]))
+            clearSquare(mi, base_i, base_j);
+        } else if (yj >= 0) {
+           if (polytris[(int) tp->bonusNow].polyomino
+                       [old->polyomino_number].shape
+                       [j * old->size + i] &&
+             ((ox >= tp->curPolyomino.size) || (oy < 0) ||
+              (oy >= tp->curPolyomino.size) || !polytris
+               [(int) tp->bonusNow].polyomino
+                [tp->curPolyomino.polyomino_number].shape
+                [oy * tp->curPolyomino.size + ox]))
+              clearTrapazoid(mi, xi, yj);
+          }
+        }
+  } else {
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++)
+        if ((tp->curPolyomino.ypos + j >= 0) &&
+          polytris[(int) tp->bonusNow].polyomino
+            [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i]) {
+          drawSquare(mi, curPixmap(tp, i, j),
+            tp->curPolyomino.color_number,
+            tp->curPolyomino.xpos + i, tp->curPolyomino.ypos + j);
+        }
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++) {
+        ox = old->xpos + i - tp->curPolyomino.xpos;
+        oy = old->ypos + j - tp->curPolyomino.ypos;
+        if (polytris[(int) tp->bonusNow].polyomino[old->polyomino_number].shape[j * tp->curPolyomino.size + i] &&
+          ((ox < 0) || (ox >= tp->curPolyomino.size) ||
+          (oy < 0) || (oy >= tp->curPolyomino.size) ||
+          !polytris[(int) tp->bonusNow].polyomino
+            [tp->curPolyomino.polyomino_number].shape[oy * tp->curPolyomino.size + ox])) {
+          clearSquare(mi, (old->xpos + i), (old->ypos + j));
+        }
+      }
+  }
+}
+
+static void
+redoNext(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int next_start, i;
+
+  next_start = (int) (tp->curPolyomino.random_number % polytris[(int) tp->bonusNow].mode.number);
+  tp->curPolyomino.color_number = next_start;
+
+  tp->curPolyomino.polyomino_number = polytris[(int) tp->bonusNow].mode.start[next_start];
+  for (i = 0; i < tp->curPolyomino.random_rotation; i++)
+    tp->curPolyomino.polyomino_number = polytris[(int) tp->bonusNow].polyomino
+      [tp->curPolyomino.polyomino_number].rotation;
+  tp->curPolyomino.size = polytris[(int) tp->bonusNow].polyomino[tp->curPolyomino.polyomino_number].size;
+  tp->curPolyomino.ypos = -polytris[(int) tp->bonusNow].polyomino
+    [tp->curPolyomino.polyomino_number].leadingEmptyHeight;
+}
+
+static void
+newPolyomino(ModeInfo * mi) {
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  tp->curPolyomino.random_number = LRAND();
+  tp->curPolyomino.random_rotation = NRAND(MAX_SIDES);
+#if 0
+  tp->curPolyomino.random_reflection = NRAND(2);  /* Future? */
+#endif
+  if (tp->bonus) {
+    if (trackmouse) {
+      tp->bonusNow = 0;
+    } else {
+      /* Unlikely to finish rows, so show bonus pieces this way */
+      tp->bonusNow = !NRAND(16);
+    }
+  }
+  redoNext(mi);
+  if (tp->well) {
+    int w;
+
+    /* pick a free spot on the rim, not all frozen else this is an infinite
+       loop */
+    /* tp->curPolyomino.xpos = (WELL_WIDTH - tp->curPolyomino.size) / 2; */
+    tp->curPolyomino.xpos = NRAND(WELL_WIDTH - tp->curPolyomino.size + 1);
+    do {
+      w = NRAND(MAX_SIDES);
+    } while (tp->frozen_wall[w]);
+    tp->curPolyomino.xpos += w * WELL_WIDTH;
+  } else {
+    tp->curPolyomino.xpos = NRAND(tp->ncols - tp->curPolyomino.size + 1);
+    /* tp->curPolyomino.xpos = (tp->ncols - tp->curPolyomino.size) / 2; */
+  }
+}
+
+static void
+putBox(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int   i, j;
+  int   x = tp->curPolyomino.xpos, y = tp->curPolyomino.ypos, pos;
+
+  for (i = 0; i < tp->curPolyomino.size; i++)
+    for (j = 0; j < tp->curPolyomino.size; j++)
+      if ((y + j >= 0) && polytris[(int) tp->bonusNow].polyomino
+        [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i]) {
+        if (tp->well) {
+          /* Set pieces and overlap them if necessary */
+          int xi, yj;
+
+          xi = (x + i) % WELL_PERIMETER;
+          yj = y + j;
+          if (yj >= WELL_DEPTH) {
+            int base_i, base_j;
+
+            wall_to_base(&base_i, &base_j, xi, yj);
+            xi = checkWall(rotateIndex(curPixmap(tp, i, j), xi),
+              base_i, base_j);
+            if (!tp->base[base_j][base_i].pmid)
+              tp->base[base_j][base_i].pmid = xi;
+            else
+              tp->base[base_j][base_i].pmid &= xi;
+            tp->base[base_j][base_i].cid = tp->curPolyomino.color_number;
+          } else {
+            tp->wall[yj][xi].pmid =
+              checkSides(checkBottom(rotateIndex(curPixmap(tp, i,
+              j), xi), xi, yj), xi);
+            tp->wall[yj][xi].cid = tp->curPolyomino.color_number;
+            tp->frozen_wall[xi / WELL_WIDTH] = MAX_SIDES;
+          }
+        } else {
+          pos = (y + j) * tp->ncols + x + i;
+          tp->field[pos].pmid = curPixmap(tp, i, j);
+          tp->field[pos].cid = tp->curPolyomino.color_number;
+        }
+      }
+}
+
+static Bool
+overlapping(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int       i, j;
+  int       x = tp->curPolyomino.xpos, y = tp->curPolyomino.ypos;
+  Bool gradualAppear = tp->well;
+
+  if (tp->well) {
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++)
+        if (polytris[(int) tp->bonusNow].polyomino
+                [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i]) {
+          int xi, yj;
+
+          xi = (x + i) % WELL_PERIMETER;
+          yj = y + j;
+          if (yj < WELL_DEPTH) {
+            if (tp->frozen_wall[xi / WELL_WIDTH])
+              return True;
+            if (gradualAppear) {
+/* This method one can turn polyomino to an area above of screen, also
+   part of the polyomino may not be visible initially */
+              if ((yj >= 0) && (tp->wall[yj][xi].pmid >= 0))
+                return True;
+            } else {
+/* This method does not allow turning polyomino to an area above screen */
+              if ((yj < 0) || (tp->wall[yj][xi].pmid >= 0))
+                return True;
+            }
+          }
+          else if (yj < WELL_DEPTH + WELL_WIDTH) {
+            int base_i, base_j;
+
+            wall_to_base(&base_i, &base_j, xi, yj);
+            if (tp->base[base_j][base_i].pmid >= 0)
+              return True;
+          }
+          else
+            return True;
+        }
+  } else {
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++)
+        if (polytris[(int) tp->bonusNow].polyomino
+            [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i]) {
+          if ((y + j >= tp->nrows) || (x + i < 0) || (x + i >= tp->ncols))
+            return True;
+          if (gradualAppear) {
+/* This method one can turn polyomino to an area above of screen, also
+   part of the polyomino may not be visible initially */
+            if ((y + j >= 0) &&
+                (tp->field[(y + j) * tp->ncols + x + i].pmid >= 0))
+              return True;
+          } else {
+/* This method does not allow turning polyomino to an area above screen */
+            if ((y + j < 0) ||
+                (tp->field[(y + j) * tp->ncols + x + i].pmid >= 0))
+              return True;
+          }
+        }
+  }
+  return False;
+}
+
+static Bool
+atBottom(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int       i, j;
+  int       x = tp->curPolyomino.xpos, y = tp->curPolyomino.ypos;
+
+  if (tp->well) {
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++)
+        if (polytris[(int) tp->bonusNow].polyomino
+            [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i]) {
+          int xi, yj;
+
+          xi = (x + i) % WELL_PERIMETER;
+          yj = y + j;
+          if (yj < -1)
+            return False;
+          if (yj < WELL_DEPTH - 1) {
+            if (tp->frozen_wall[xi / WELL_WIDTH])
+              return True;
+            if (tp->wall[yj + 1][xi].pmid >= 0)
+              return True;
+          } else if (yj < WELL_DEPTH + WELL_WIDTH - 1) {
+            int base_i, base_j;
+
+            wall_to_base(&base_i, &base_j, xi, yj + 1);
+            if (tp->base[base_j][base_i].pmid >= 0)
+              return True;
+          } else
+            return True;
+        }
+  } else {
+    for (i = 0; i < tp->curPolyomino.size; i++)
+      for (j = 0; j < tp->curPolyomino.size; j++)
+        if ((y + j >= -1) && polytris[(int) tp->bonusNow].polyomino
+          [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i])
+          if ((y + j >= tp->nrows - 1) || (x + i < 0) || (x + i >= tp->ncols) ||
+              (tp->field[(y + j + 1) * tp->ncols + x + i].pmid >= 0))
+            return True;
+  }
+  return False;
+}
+
+static Bool
+atBaseFully(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int i, j;
+
+  for (i = 0; i < tp->curPolyomino.size; i++)
+    for (j = 0; j < tp->curPolyomino.size; j++)
+      if (tp->curPolyomino.ypos + j < WELL_DEPTH &&
+          polytris[(int) tp->bonusNow].polyomino
+           [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i])
+    return False;
+  return True;
+}
+
+static Bool
+atBasePartially(ModeInfo * mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int i, j;
+
+  for (i = 0; i < tp->curPolyomino.size; i++)
+    for (j = 0; j < tp->curPolyomino.size; j++)
+        if ((tp->curPolyomino.ypos + j >= WELL_DEPTH) &&
+            polytris[(int) tp->bonusNow].polyomino
+              [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i])
+          return True;
+  return False;
+}
+
+static Bool
+wallChange(ModeInfo *mi, thing_t oldthing, thing_t newthing)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int             w = -1, i, j;
+  int             x = tp->curPolyomino.xpos;
+
+  for (i = 0; i < oldthing.size; i++)
+    for (j = 0; j < oldthing.size; j++)
+  if (polytris[(int) tp->bonusNow].polyomino[oldthing.polyomino_number].shape[j * tp->curPolyomino.size + i]) {
+    if (w == -1)
+      w = ((x + i) % WELL_PERIMETER) / WELL_WIDTH;
+    else if (w != ((x + i) % WELL_PERIMETER) / WELL_WIDTH)
+      return True;
+  }
+  for (i = 0; i < newthing.size; i++)
+    for (j = 0; j < newthing.size; j++)
+      if (polytris[(int) tp->bonusNow].polyomino
+                [tp->curPolyomino.polyomino_number].shape[j * tp->curPolyomino.size + i]) {
+          if (w != ((x + i) % WELL_PERIMETER) / WELL_WIDTH)
+            return True;
+      }
+  return False;
+}
+
+static void
+tryMove(ModeInfo * mi, move_t move)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  thing_t   old;
+  int       i;
+  int       skip = False;
+  int       cw = False; /* I am not sure if this is the original */
+
+  old = tp->curPolyomino;
+  switch (move) {
+    case FALL:
+      tp->curPolyomino.ypos++;
+      break;
+
+    case DROP:
+      do { /* so fast you can not see it ;) */
+        tp->curPolyomino.ypos ++;
+      } while (!overlapping(mi));
+      tp->curPolyomino.ypos--;
+      break;
+
+    case MOVE_LEFT:
+      if (tp->well) {
+        tp->curPolyomino.xpos = (tp->curPolyomino.xpos + WELL_PERIMETER - 1) % WELL_PERIMETER;
+        if (atBaseFully(mi) || (atBasePartially(mi) && wallChange(mi, old, tp->curPolyomino)))
+          skip = True;
+      } else
+        tp->curPolyomino.xpos--;
+      break;
+
+    case MOVE_RIGHT:
+      if (tp->well) {
+        tp->curPolyomino.xpos = (tp->curPolyomino.xpos + WELL_PERIMETER + 1) % WELL_PERIMETER;
+        if (atBaseFully(mi) || (atBasePartially(mi) && wallChange(mi, old, tp->curPolyomino)))
+          skip = True;
+      } else
+        tp->curPolyomino.xpos++;
+      break;
+
+    case ROTATE:
+        if (cw)
+          for (i = 0; i < MAX_SIDES - 1; i++)
+            tp->curPolyomino.polyomino_number = polytris[(int) tp->bonusNow].polyomino
+              [tp->curPolyomino.polyomino_number].rotation;
+        else /* ccw */
+          tp->curPolyomino.polyomino_number = polytris[(int) tp->bonusNow].polyomino
+            [tp->curPolyomino.polyomino_number].rotation;
+      tp->curPolyomino.xpos = old.xpos;
+      tp->curPolyomino.ypos = old.ypos;
+      if (tp->well && atBasePartially(mi) && wallChange(mi, old, tp->curPolyomino))
+          skip = True;
+      break;
+
+    case REFLECT: /* reflect on y axis */
+      tp->curPolyomino.polyomino_number = polytris[(int) tp->bonusNow].polyomino
+        [tp->curPolyomino.polyomino_number].reflection;
+      tp->curPolyomino.xpos = old.xpos;
+      tp->curPolyomino.ypos = old.ypos;
+      if (tp->well && atBasePartially(mi) && wallChange(mi, old, tp->curPolyomino))
+          skip = True;
+      break;
+  }
+
+  if (!skip && !overlapping(mi)) {
+    drawPolyominoDiff(mi, &old);
+  } else {
+    tp->curPolyomino = old;
+    tp->sidemoves = tp->ncols / 2;
+  }
+}
+
+static void
+fillLines(ModeInfo *mi)
+{
+  Display    *display = MI_DISPLAY(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  int             i, j;
+
+  XFlush(display);
+  if (tp->well) {
+    for (j = 0; j < WELL_DEPTH + WELL_WIDTH; j++)
+      for (i = 0; i < WELL_PERIMETER; i++) {
+         drawBox(mi, BITMAPS - 1, 
+           LRAND() % polytris[(int) tp->bonusNow].mode.number,
+                 i, j);
+         XFlush(display);
+      }
+  } else {
+    for (j = 0; j <= tp->nrows / 2; j++) {
+      for (i = 0; i < tp->ncols; i++) {
+         drawSquare(mi, BITMAPS - 1,
+           LRAND() % polytris[(int) tp->bonusNow].mode.number,
+                 i, j);
+         drawSquare(mi, BITMAPS - 1,
+           LRAND() % polytris[(int) tp->bonusNow].mode.number,
+                 i, tp->nrows - j - 1);
+      }
+      XFlush(display);
+    }
+  }
+}
+
+static void
+free_images(trisstruct *tp)
+{
+  int n;
+
+  if (tp->images[BITMAPS - 1] != None) {
+    (void) XDestroyImage(tp->images[BITMAPS - 1]);
+    tp->images[BITMAPS - 1] = None;
+  }
+  for (n = 0; n < BITMAPS - 1; n++) {
+    /* Don't bother to free duplicates */
+    if (IS_UP(n) && IS_DOWN(n) && IS_LEFT(n) && IS_RIGHT(n))
+      tp->images[n] = None;
+    else if (IS_LEFT_UP(n) && (IS_LEFT(n) || IS_UP(n)))
+      tp->images[n] = None;
+    else if (IS_LEFT_DOWN(n) && (IS_LEFT(n) || IS_DOWN(n)))
+      tp->images[n] = None;
+    else if (IS_RIGHT_UP(n) && (IS_RIGHT(n) || IS_UP(n)))
+      tp->images[n] = None;
+    else if (IS_RIGHT_DOWN(n) && (IS_RIGHT(n) || IS_DOWN(n)))
+      tp->images[n] = None;
+    else if (tp->images[n] != None) {
+      (void) XDestroyImage(tp->images[n]);
+      tp->images[n] = None;
+    }
+  }
+}
+
+static void
+free_tetris(Display *display, trisstruct *tp)
+{
+  ModeInfo *mi = tp->mi;
+
+  if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+    MI_WHITE_PIXEL(mi) = tp->whitepixel;
+    MI_BLACK_PIXEL(mi) = tp->blackpixel;
+#ifndef STANDALONE
+    MI_FG_PIXEL(mi) = tp->fg;
+    MI_BG_PIXEL(mi) = tp->bg;
+#endif
+    if (tp->colors != NULL) {
+      if (tp->ncolors && !tp->no_colors)
+        free_colors(display, tp->cmap, tp->colors, tp->ncolors);
+      (void) free((void *) tp->colors);
+      tp->colors = NULL;
+    }
+    if (tp->cmap != None) {
+      XFreeColormap(display, tp->cmap);
+      tp->cmap = None;
+    }
+  }
+  if (tp->gc != NULL) {
+     XFreeGC(display, tp->gc);
+     tp->gc = NULL;
+  }
+  if (tp->graypix != None) {
+    XFreePixmap(display, tp->graypix);
+    tp->graypix = None;
+  }
+  if (tp->field != NULL) {
+     (void) free((void *) tp->field);
+     tp->field = NULL;
+  }
+  free_images(tp);
+}
+
+static int
+checkLines(ModeInfo *mi)
+{
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+  Display    *display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+
+  if (tp->well) {
+    int             lSet[2][WELL_WIDTH], nset[2];
+    int             i, j, k, *tmp;
+
+    nset[0] = nset[1] = 0;
+
+    /* Find filled rows */
+    for (j = 0; j < WELL_WIDTH; j++) {
+      lSet[0][j] = 0;
+      for (i = 0; i < WELL_WIDTH; i++)
+        if (tp->base[j][i].pmid >= 0)
+          lSet[0][j] ++;
+      if (lSet[0][j] == WELL_WIDTH)
+        nset[0] ++;
+    }
+    /* Find filled columns */
+    for (i = 0; i < WELL_WIDTH; i++) {
+      lSet[1][i] = 0;
+      for (j = 0; j < WELL_WIDTH; j++)
+        if (tp->base[j][i].pmid >= 0)
+          lSet[1][i] ++;
+      if (lSet[1][i] == WELL_WIDTH)
+        nset[1] ++;
+    }
+
+    if (nset[0] || nset[1]) {
+        fieldstruct temp_base[WELL_WIDTH][WELL_WIDTH];
+        for (k = 0; k < ((NUM_FLASHES / (nset[0] + nset[1])) / 2) * 2; k++) {
+            for (j = 0; j < WELL_WIDTH; j++) {
+                if (lSet[0][j] == WELL_WIDTH)
+                  for (i = 0; i < WELL_WIDTH; i++)
+                    xorSquare(mi, i, j);
+                if (lSet[1][j] == WELL_WIDTH)
+                  for (i = 0; i < WELL_WIDTH; i++)
+                    xorSquare(mi, j, i);
+            }
+            XFlush(display);
+        }
+
+        for (j = 0; j < WELL_WIDTH; j++)
+          for (i = 0; i < WELL_WIDTH; i++)
+            temp_base[j][i] = tp->base[j][i];
+        if (nset[0]) {
+          for (j = 0; j < WELL_WIDTH / 2; j++)
+            if (lSet[0][j] == WELL_WIDTH)
+              for (i = 0; i < WELL_WIDTH; i++) {
+                for (k = j; k > 0; k--)
+                  temp_base[k][i] = temp_base[k - 1][i];
+                temp_base[0][i].pmid = EMPTY;
+                if (j > 0) {
+                  tmp = &temp_base[j][i].pmid;
+                  if (*tmp >= 0)
+                     *tmp = CHECKDOWN((unsigned int) *tmp);
+                }
+                tmp = &temp_base[j + 1][i].pmid;
+                if (*tmp >= 0)
+                   *tmp = CHECKUP((unsigned int) *tmp);
+              }
+          for (j = WELL_WIDTH - 1; j >= WELL_WIDTH / 2; j--)
+            if (lSet[0][j] == WELL_WIDTH)
+              for (i = 0; i < WELL_WIDTH; i++) {
+                for (k = j; k < WELL_WIDTH - 1; k++)
+                  temp_base[k][i] = temp_base[k + 1][i];
+                temp_base[WELL_WIDTH - 1][i].pmid = EMPTY;
+                if (j < WELL_WIDTH - 1) {
+                  tmp = &temp_base[j][i].pmid;
+                  if (*tmp >= 0)
+                     *tmp = CHECKUP((unsigned int) *tmp);
+                }
+                tmp = &temp_base[j - 1][i].pmid;
+                if (*tmp >= 0)
+                   *tmp = CHECKDOWN((unsigned int) *tmp);
+              }
+        }
+        if (nset[1]) {
+          for (i = 0; i < WELL_WIDTH / 2; i++)
+            if (lSet[1][i] == WELL_WIDTH)
+              for (j = 0; j < WELL_WIDTH; j++) {
+                for (k = i; k > 0; k--)
+                  temp_base[j][k] = temp_base[j][k - 1];
+                temp_base[j][0].pmid = EMPTY;
+                if (i > 0) {
+                  tmp = &temp_base[j][i].pmid;
+                  if (*tmp >= 0)
+                     *tmp = CHECKRIGHT((unsigned int) *tmp);
+                }
+                tmp = &temp_base[j][i + 1].pmid;
+                if (*tmp >= 0)
+                   *tmp = CHECKLEFT((unsigned int) *tmp);
+              }
+          for (i = WELL_WIDTH - 1; i >= WELL_WIDTH / 2; i--)
+            if (lSet[1][i] == WELL_WIDTH)
+              for (j = 0; j < WELL_WIDTH; j++) {
+                for (k = i; k < WELL_WIDTH - 1; k++)
+                  temp_base[j][k] = temp_base[j][k + 1];
+                temp_base[j][WELL_WIDTH - 1].pmid = EMPTY;
+                if (i < WELL_WIDTH - 1) {
+                  tmp = &temp_base[j][i].pmid;
+                  if (*tmp >= 0)
+                     *tmp = CHECKLEFT((unsigned int) *tmp);
+                }
+                tmp = &temp_base[j][i - 1].pmid;
+                if (*tmp >= 0)
+                   *tmp = CHECKRIGHT((unsigned int) *tmp);
+              }
+        }
+        for (j = 0; j < WELL_WIDTH; j++)
+          for (i = 0; i < WELL_WIDTH; i++)
+            if ((temp_base[j][i].cid != tp->base[j][i].cid) ||
+                (temp_base[j][i].pmid != tp->base[j][i].pmid))
+            {
+              tp->base[j][i] = temp_base[j][i];
+              if (tp->base[j][i].pmid >= 0)
+                drawSquare(mi, tp->base[j][i].pmid, tp->base[j][i].cid, i, j);
+              else
+                clearSquare(mi, i, j);
+            }
+       XFlush(display);
+    }
+
+    return (nset[0] + nset[1]);
+  } else {
+    int      *lSet, nset = 0;
+    int       i, j, y;
+
+    if ((lSet = (int *) calloc(tp->nrows, sizeof (int))) == NULL) {
+        free_tetris(display, tp);
+        return -1; /* error */
+    }
+    for (j = 0; j < tp->nrows; j++) {
+      for (i = 0; i < tp->ncols; i++)
+        if (tp->field[j * tp-> ncols + i].pmid >= 0)
+          lSet[j]++;
+      if (lSet[j] == tp->ncols)
+        nset++;
+    }
+    if (nset) {
+      for (i = 0; i < ((NUM_FLASHES / nset) % 2) * 2; i++) {
+        for (j = 0; j < tp->nrows; j++) {
+          if (lSet[j] == tp->ncols)
+            for (i = 0; i < tp->ncols; i++)
+              xorSquare(mi, i, j);
+        }
+        XFlush(display);
+      }
+
+      for (j = tp->nrows - 1; j >= 0; j--) {
+        if (lSet[j] == tp->ncols) {
+          for (y = j; y > 0; y--)
+            for (i = 0; i < tp->ncols; i++)
+              tp->field[y * tp->ncols + i] =
+                 tp->field[(y - 1) * tp->ncols + i];
+          for (i = 0; i < tp->ncols; i++)
+            tp->field[i].pmid = EMPTY;
+
+          XCopyArea(display, window, window, tp->gc,
+            tp->xb, tp->yb,
+            tp->xs * tp->ncols, j * tp->ys,
+            tp->xb, tp->yb + tp->ys);
+          XSetForeground(display, tp->gc, tp->blackpixel);
+          XFillRectangle(display, window, tp->gc,
+            tp->xb, tp->yb, tp->xs * tp->ncols, tp->ys);
+
+          for (i = j; i > 0; i--)
+            lSet[i] = lSet[i - 1];
+          lSet[0] = 0;
+
+          if (j > 0)
+            for (i = 0; i < tp->ncols; i++) {
+              int       tmp = tp->field[j * tp->ncols + i].pmid;
+
+              if ((tmp >= 0) && (tmp != CHECKDOWN(tmp))) {
+                tp->field[j * tp->ncols + i].pmid = CHECKDOWN(tmp);
+                  drawSquare(mi,
+                    tp->field[j * tp->ncols + i].pmid, tp->field[j * tp->ncols + i].cid,
+                    i, j);
+              }
+            }
+
+          j++;
+
+          if (j < tp->nrows)
+            for (i = 0; i < tp->ncols; i++) {
+              int       tmp = tp->field[j * tp->ncols + i].pmid;
+
+              if ((tmp >= 0) && (tmp != CHECKUP(tmp))) {
+                tp->field[j * tp->ncols + i].pmid = CHECKUP(tmp);
+                drawSquare(mi,
+                  tp->field[j * tp->ncols + i].pmid, tp->field[j * tp->ncols + i].cid,
+                  i, j);
+              }
+            }
+
+          XFlush(display);
+        }
+      }
+    }
+
+    if (lSet)
+      (void) free((void *) lSet);
+    return nset;
+  }
+}
+
+static void
+gameOver(ModeInfo *mi)
+{
+  /* maybe more stuff later */
+  fillLines(mi);
+}
+
+static Bool
+create_an_image(ModeInfo *mi, trisstruct *tp, int n)
+{
+  int x, y;
+  unsigned char * data;
+
+  if ((data = (unsigned char *) malloc(sizeof(char)*(tp->ys*ROUND8(tp->ys)/8))) == NULL) {
+    return False;  /* no biggie, will not use images */
+  }
+
+  for (y=0;y<tp->ys;y++) for (x=0;x<tp->ys;x++) {
+     if (!tp->use3D) {
+#ifdef SMALL_BELLYBUTTON 
+        if (x >= tp->ys / 2 && x <= tp->ys / 2 + 1 &&
+            y >= tp->ys / 2 && y <= tp->ys / 2 + 1)
+          NOTHALFBIT(x,y)
+        else
+#endif
+          HALFBIT(x,y)
+      } else if ((x>=y && x<=tp->ys-y-1 && IS_UP(n))
+          || (x<=y && x<=tp->ys-y-1 && y<tp->ys/2 && !IS_LEFT(n))
+          || (x>=y && x>=tp->ys-y-1 && y<tp->ys/2 && !IS_RIGHT(n)))
+        SETBIT(x,y)
+      else if ((x<=y && x<=tp->ys-y-1 && IS_LEFT(n))
+          || (x>=y && x<=tp->ys-y-1 && x<tp->ys/2 && !IS_UP(n))
+          || (x<=y && x>=tp->ys-y-1 && x<tp->ys/2 && !IS_DOWN(n)))
+        TWOTHIRDSBIT(x,y)
+      else if ((x>=y && x>=tp->ys-y-1 && IS_RIGHT(n))
+          || (x>=y && x<=tp->ys-y-1 && x>=tp->ys/2 && !IS_UP(n))
+          || (x<=y && x>=tp->ys-y-1 && x>=tp->ys/2 && !IS_DOWN(n)))
+        HALFBIT(x,y)
+      else if ((x<=y && x>=tp->ys-y-1 && IS_DOWN(n))
+          || (x<=y && x<=tp->ys-y-1 && y>=tp->ys/2 && !IS_LEFT(n))
+          || (x>=y && x>=tp->ys-y-1 && y>=tp->ys/2 && !IS_RIGHT(n)))
+        THIRDBIT(x,y)
+  }
+
+  if (IS_LEFT(n))
+    for (y=0;y<tp->ys;y++) for (x=G;x<G+T;x++)
+      SETBIT(x,y)
+  if (IS_RIGHT(n))
+    for (y=0;y<tp->ys;y++) for (x=G;x<G+T;x++)
+      SETBIT(tp->ys-1-x,y)
+  if (IS_UP(n))
+    for (x=0;x<tp->ys;x++) for (y=G;y<G+T;y++)
+      SETBIT(x,y)
+  if (IS_DOWN(n))
+    for (x=0;x<tp->ys;x++) for (y=G;y<G+T;y++)
+      SETBIT(x,tp->ys-1-y)
+  if (IS_LEFT(n))
+    for (y=0;y<tp->ys;y++) for (x=0;x<G;x++)
+      RESBIT(x,y)
+  if (IS_RIGHT(n))
+    for (y=0;y<tp->ys;y++) for (x=0;x<G;x++)
+      RESBIT(tp->ys-1-x,y)
+  if (IS_UP(n))
+    for (x=0;x<tp->ys;x++) for (y=0;y<G;y++)
+      RESBIT(x,y)
+  if (IS_DOWN(n))
+    for (x=0;x<tp->ys;x++) for (y=0;y<G;y++)
+      RESBIT(x,tp->ys-1-y)
+
+  if (IS_LEFT(n) && IS_UP(n))
+    for (x=G;x<=G+R;x++)
+      for (y=G;y<=R+2*G-x;y++) {
+        if (x+y>R+2*G-RT)
+          SETBIT(x,y)
+        else
+          RESBIT(x,y)
+      }
+  if (IS_LEFT(n) && IS_DOWN(n))
+    for (x=G;x<=G+R;x++)
+      for (y=G;y<=R+2*G-x;y++) {
+        if (x+y>R+2*G-RT)
+          SETBIT(x,tp->ys-1-y)
+        else
+          RESBIT(x,tp->ys-1-y)
+      }
+  if (IS_RIGHT(n) && IS_UP(n))
+    for (x=G;x<=G+R;x++)
+      for (y=G;y<=R+2*G-x;y++) {
+        if (x+y>R+2*G-RT)
+          SETBIT(tp->ys-1-x,y)
+        else
+          RESBIT(tp->ys-1-x,y)
+      }
+  if (IS_RIGHT(n) && IS_DOWN(n))
+    for (x=G;x<=G+R;x++)
+      for (y=G;y<=R+2*G-x;y++) {
+        if (x+y>R+2*G-RT)
+          SETBIT(tp->ys-1-x,tp->ys-1-y)
+        else
+          RESBIT(tp->ys-1-x,tp->ys-1-y)
+      }
+
+  if (!IS_LEFT(n) && !IS_UP(n) && IS_LEFT_UP(n)) {
+    for (x=0;x<G;x++) for(y=0;y<G;y++)
+      RESBIT(x,y)
+    for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+      SETBIT(x,y)
+    for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+      SETBIT(x,y)
+  }
+  if (!IS_LEFT(n) && !IS_DOWN(n) && IS_LEFT_DOWN(n)) {
+    for (x=0;x<G;x++) for(y=0;y<G;y++)
+      RESBIT(x,tp->ys-1-y)
+    for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+      SETBIT(x,tp->ys-1-y)
+    for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+      SETBIT(x,tp->ys-1-y)
+  }
+  if (!IS_RIGHT(n) && !IS_UP(n) && IS_RIGHT_UP(n)) {
+    for (x=0;x<G;x++) for(y=0;y<G;y++)
+      RESBIT(tp->ys-1-x,y)
+    for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+      SETBIT(tp->ys-1-x,y)
+    for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+      SETBIT(tp->ys-1-x,y)
+  }
+  if (!IS_RIGHT(n) && !IS_DOWN(n) && IS_RIGHT_DOWN(n)) {
+    for (x=0;x<G;x++) for(y=0;y<G;y++)
+      RESBIT(tp->ys-1-x,tp->ys-1-y)
+    for (x=G;x<G+T;x++) for(y=0;y<G;y++)
+      SETBIT(tp->ys-1-x,tp->ys-1-y)
+    for (x=0;x<G+T;x++) for(y=G;y<G+T;y++)
+      SETBIT(tp->ys-1-x,tp->ys-1-y)
+  }
+#ifdef LARGE_BELLYBUTTON 
+  if (!tp->use3D) {
+    if (!IS_LEFT(n) && !IS_UP(n) && !IS_LEFT_UP(n))
+      for (x=0;x<G+T;x++) for(y=0;y<G+T;y++)
+        SETBIT(x,y)
+    if (!IS_LEFT(n) && !IS_DOWN(n) && !IS_LEFT_DOWN(n))
+      for (x=0;x<G+T;x++) for(y=tp->ys-G-T;y<tp->ys;y++)
+        SETBIT(x,y)
+    if (!IS_RIGHT(n) && !IS_UP(n) && !IS_RIGHT_UP(n))
+      for (x=tp->ys-G-T;x<tp->ys;x++) for(y=0;y<G+T;y++)
+        SETBIT(x,y)
+    if (!IS_RIGHT(n) && !IS_DOWN(n) && !IS_RIGHT_DOWN(n))
+      for (x=tp->ys-G-T;x<tp->ys;x++) for(y=tp->ys-G-T;y<tp->ys;y++)
+        SETBIT(x,y)
+  } else
+#else
+  if (tp->use3D)
+#endif
+  {
+    if (!IS_LEFT(n) && !IS_UP(n) && !IS_LEFT_UP(n))
+      for (x=0;x<tp->ys/2-RR;x++) for(y=0;y<tp->ys/2-RR;y++)
+        THREEQUARTERSBIT(x,y)
+    if (!IS_LEFT(n) && !IS_DOWN(n) && !IS_LEFT_DOWN(n))
+      for (x=0;x<tp->ys/2-RR;x++) for(y=tp->ys/2+RR;y<tp->ys;y++)
+        THREEQUARTERSBIT(x,y)
+    if (!IS_RIGHT(n) && !IS_UP(n) && !IS_RIGHT_UP(n))
+      for (x=tp->ys/2+RR;x<tp->ys;x++) for(y=0;y<tp->ys/2-RR;y++)
+        THREEQUARTERSBIT(x,y)
+    if (!IS_RIGHT(n) && !IS_DOWN(n) && !IS_RIGHT_DOWN(n))
+      for (x=tp->ys/2+RR;x<tp->ys;x++) for(y=tp->ys/2+RR;y<tp->ys;y++)
+        THREEQUARTERSBIT(x,y)
+  }
+
+  if ((tp->images[n] = XCreateImage(MI_DISPLAY(mi), MI_VISUAL(mi),
+           1, XYBitmap, 0, (char *) data, tp->xs, tp->ys, 8, 0)) == None) {
+     (void) free((void *) data);
+     return False;
+  }
+  tp->images[n]->byte_order = MSBFirst;
+  tp->images[n]->bitmap_unit = 8;
+  tp->images[n]->bitmap_bit_order = LSBFirst;
+  return True;
+}
+
+static Bool
+create_images(ModeInfo *mi, trisstruct *tp)
+{
+  int n;
+
+  (void) create_an_image(mi, tp, BITMAPS - 1);
+  for (n = 0; n < BITMAPS - 1; n++) {
+    /* Avoid duplication of identical images. */
+    if (IS_UP(n) && IS_DOWN(n) && IS_LEFT(n) && IS_RIGHT(n))
+      tp->images[n] = tp->images[BITMAPS - 1];
+    else if (IS_LEFT_UP(n) && (IS_LEFT(n) || IS_UP(n)))
+      tp->images[n] = tp->images[n & ~LEFT_UP];
+    else if (IS_LEFT_DOWN(n) && (IS_LEFT(n) || IS_DOWN(n)))
+      tp->images[n] = tp->images[n & ~LEFT_DOWN];
+    else if (IS_RIGHT_UP(n) && (IS_RIGHT(n) || IS_UP(n)))
+      tp->images[n] = tp->images[n & ~RIGHT_UP];
+    else if (IS_RIGHT_DOWN(n) && (IS_RIGHT(n) || IS_DOWN(n)))
+      tp->images[n] = tp->images[n & ~RIGHT_DOWN];
+    else if (image_needed(n)) {
+      if (!create_an_image(mi, tp, n))
+        return False;
+    }
+  }
+  return True;
+}
+
+void
+refresh_tetris(ModeInfo * mi)
+{
+  trisstruct *tp;
+
+  if (triss == NULL)
+    return;
+  tp = &triss[MI_SCREEN(mi)];
+  if (!tp->well && tp->field == NULL)
+    return;
+
+  if (!tp->painted)
+    return;
+  MI_CLEARWINDOW(mi);
+  if (tp->well) {
+    int i, j;
+
+    for (i = 0; i < WELL_PERIMETER; i++) {
+      for (j = 0; j < WELL_DEPTH; j++) {
+        if (tp->wall[j][i].pmid >= 0) {
+          drawTrapazoid(mi, /*  tp->wall[j][i].pmid, */ tp->wall[j][i].cid, i, j);
+        }
+        if (tp->frozen_wall[i / WELL_WIDTH]) {
+          freezeTrapazoid(mi, i, j);
+        }
+      }
+    }
+    for (i = 0; i < WELL_WIDTH; i++)
+      for (j = 0; j < WELL_WIDTH; j++)
+        if (tp->base[j][i].pmid >= 0)
+          drawSquare(mi, tp->base[j][i].pmid, tp->base[j][i].cid, i, j);
+  } else {
+    int col, row, pos;
+
+    for (col = 0; col < tp->ncols; col++)
+      for (row = 0; row < tp->nrows; row++) {
+        pos = row * tp->ncols + col;
+#if DEBUG 
+        (void) printf("pmid %d, cid %d, %d %d\n",
+          tp->field[pos].pmid, tp->field[pos].cid, col, row);
+#endif
+        if (tp->field[pos].pmid != EMPTY)
+          drawSquare(mi, tp->field[pos].pmid, tp->field[pos].cid, col, row);
+    }
+  }
+  drawPolyomino(mi);
+}
+
+void
+release_tetris(ModeInfo * mi) {
+  int bonustype, number;
+
+  if (triss != NULL) {
+    int   screen;
+
+    for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+       free_tetris(MI_DISPLAY(mi), &triss[screen]);
+    (void) free((void *) triss);
+    triss = NULL;
+    for (bonustype = 0; bonustype < 2; bonustype++) {
+      if (polytris[bonustype].polyomino != NULL) {
+        for (number = 0; number < max_ominoes[bonustype]; number++) {
+          if (polytris[bonustype].polyomino[number].shape != NULL)
+            (void) free((void *) polytris[bonustype].polyomino[number].shape);
+        }
+        (void) free((void *) polytris[bonustype].polyomino);
+        polytris[bonustype].polyomino = NULL;
+      }
+      if (polytris[bonustype].mode.start != NULL) {
+        (void) free((void *) polytris[bonustype].mode.start);
+        polytris[bonustype].mode.start = NULL;
+      }
+    }
+  }
+}
+
+void
+change_tetris(ModeInfo * mi) {
+  trisstruct *tp;
+
+  if (triss == NULL)
+    return;
+  tp = &triss[MI_SCREEN(mi)];
+  if (!tp->well && tp->field == NULL)
+    return;
+
+  tryMove(mi, ROTATE);
+}
+
+void
+init_tetris(ModeInfo * mi) {
+  Display *   display = MI_DISPLAY(mi);
+  Window      window = MI_WINDOW(mi);
+  int size = MI_SIZE(mi);
+  int   i, j, bonustype;
+  trisstruct *tp;
+
+  if (triss == NULL) {
+    if ((triss = (trisstruct *) calloc(MI_NUM_SCREENS(mi),
+               sizeof (trisstruct))) == NULL)
+      return;
+    for (bonustype = 0; bonustype < 2; bonustype++) {
+      if (((polytris[bonustype].mode.start = (int *) malloc(start_ominoes[bonustype] *
+            sizeof(int))) == NULL) ||
+          ((polytris[bonustype].polyomino = (Polyominoes *) malloc(max_ominoes[bonustype] *
+            sizeof(Polyominoes))) == NULL)) {
+        release_tetris(mi);
+        return;
+      }
+    }
+    if (!readPolyominoes()) {
+      release_tetris(mi);
+      return;
+    }
+#ifdef DEBUG
+    writePolyominoes(tp);
+#endif
+  }
+   tp = &triss[MI_SCREEN(mi)];
+  tp->mi = mi;
+
+  if (MI_IS_FULLRANDOM(mi)) {
+    tp->bonus = (Bool) (LRAND() & 1);
+    tp->well = !(NRAND(3));
+    tp->use3D = (Bool) (NRAND(4));
+  } else {
+    tp->bonus = bonus;
+    tp->well = well;
+    tp->use3D = !plain;
+  }
+
+  if (tp->gc == None) {
+    tp->blackpixel = MI_BLACK_PIXEL(mi);
+    if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+      XColor      color;
+
+#ifndef STANDALONE
+      extern char *background;
+      extern char *foreground;
+
+      tp->fg = MI_FG_PIXEL(mi);
+      tp->bg = MI_BG_PIXEL(mi);
+#endif
+      tp->whitepixel = MI_WHITE_PIXEL(mi);
+      if ((tp->cmap = XCreateColormap(display, window,
+          MI_VISUAL(mi), AllocNone)) == None) {
+        free_tetris(display, tp);
+        return;
+      }
+      XSetWindowColormap(display, window, tp->cmap);
+      (void) XParseColor(display, tp->cmap, "black", &color);
+      (void) XAllocColor(display, tp->cmap, &color);
+      MI_BLACK_PIXEL(mi) = color.pixel;
+      (void) XParseColor(display, tp->cmap, "white", &color);
+      (void) XAllocColor(display, tp->cmap, &color);
+      MI_WHITE_PIXEL(mi) = color.pixel;
+#ifndef STANDALONE
+      (void) XParseColor(display, tp->cmap, background, &color);
+      (void) XAllocColor(display, tp->cmap, &color);
+      MI_BG_PIXEL(mi) = color.pixel;
+      (void) XParseColor(display, tp->cmap, foreground, &color);
+      (void) XAllocColor(display, tp->cmap, &color);
+      MI_FG_PIXEL(mi) = color.pixel;
+#endif
+      tp->colors = NULL;
+      tp->ncolors = 0;
+    }
+    if ((tp->gc = XCreateGC(display, MI_WINDOW(mi),
+        (unsigned long) 0, (XGCValues *) NULL)) == None) {
+      free_tetris(display, tp);
+      return;
+    }
+#if 0
+    {
+      XGCValues       gcv;
+      gcv.function = GXxor;
+      gcv.foreground = tp->fg;
+      gcv.background = tp->bg;
+    }
+#endif
+  }
+  MI_CLEARWINDOW(mi);
+  tp->painted = False;
+
+  tp->width = MI_WIDTH(mi);
+  tp->height = MI_HEIGHT(mi);
+
+  free_images(tp);
+  if (tp->width < 2 + 2 * tp->well)
+    tp->width = 2 + 2 * tp->well;
+  if (tp->height < 2 + 2 * tp->well)
+    tp->height = 2 + 2 * tp->well;
+  if (size >= MAXPIXELSIZE  &&
+        (MINGRIDSIZE * size < tp->width && MINGRIDSIZE * size < tp->height)) {
+      if (!tp->well) {
+        tp->xs = size;
+        tp->ys = size;
+      } else {
+        tp->xs = tp->ys = MAX(MINSIZE, MIN(tp->width, tp->height) /
+            ((tp->well) ? 3 * MINGRIDSIZE : MINGRIDSIZE));
+      }
+  } else {
+    if (size < -MINSIZE)
+      tp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(tp->width, tp->height) /
+        ((tp->well) ? 3 * MINGRIDSIZE : MINGRIDSIZE))) - MINSIZE + 1) + MINSIZE;
+    else if (size < MINSIZE)
+      tp->ys = MINSIZE;
+    else
+      tp->ys = MIN(size, MAX(MINSIZE, MIN(tp->width, tp->height) /
+        ((tp->well) ? 3 * MINGRIDSIZE : MINGRIDSIZE)));
+    tp->xs = tp->ys;
+  }
+  if (tp->ys >= MAXPIXELSIZE) {
+    tp->xs = tp->ys = (tp->ys / 12) * 12;
+    if (!create_images(mi, tp)) {
+      free_images(tp);
+      tp->pixelmode = True;
+    } else
+      tp->pixelmode = False;
+  } else
+    tp->pixelmode = True;
+  if (tp->well) {
+    if ((tp->graypix = XCreateBitmapFromData(display, window,
+         (char *) gray1_bits, gray1_width, gray1_height)) == None) {
+      free_tetris(display, tp);
+      return;
+    }
+    tp->ncols = MAX_SIDES * WELL_WIDTH;
+    tp->nrows = WELL_DEPTH;
+    tp->xb = tp->width / 2 - tp->xs * WELL_WIDTH / 2;
+    tp->yb = tp->height / 2 - tp->ys * WELL_WIDTH / 2;
+    for (i = 0; i < WELL_PERIMETER; i++) {
+      for (j = 0; j < WELL_DEPTH + WELL_WIDTH; j++) {
+        tp->wall[j][i].pmid = EMPTY;
+        tp->wall[j][i].cid = 0;
+      }
+    }
+    for (i = 0; i < WELL_WIDTH; i++) {
+      for (j = 0; j < WELL_WIDTH; j++) {
+        tp->base[j][i].pmid = EMPTY;
+        tp->base[j][i].cid = BITMAPS - 1;
+      }
+    }
+    for (i = 0; i < MAX_SIDES; i++) {
+      tp->frozen_wall[i] = 0;
+    }
+  } else {
+    tp->ncols = MAX(tp->width / tp->xs, 2);
+    tp->nrows = MAX(tp->height / tp->ys, 2);
+    tp->xb = (tp->width - tp->xs * tp->ncols) / 2;
+    tp->yb = (tp->height - tp->ys * tp->nrows) / 2;
+    if (tp->field != NULL)
+      (void) free((void *) tp->field);
+    if ((tp->field = (fieldstruct *) malloc(tp->ncols * tp->nrows *
+        sizeof (fieldstruct))) == NULL) {
+      free_tetris(display, tp);
+      return;
+    }
+    for (i = 0; i < tp->ncols * tp->nrows; i++) {
+      tp->field[i].pmid = EMPTY;
+      tp->field[i].cid = 0;
+    }
+  }
+  tp->rows = 0;
+  tp->level = 0;
+  tp->bonusNow = False;
+
+  /* Set up colour map */
+  tp->direction = (LRAND() & 1) ? 1 : -1;
+  if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+    if (tp->colors != NULL) {
+      if (tp->ncolors && !tp->no_colors)
+        free_colors(display, tp->cmap, tp->colors, tp->ncolors);
+      (void) free((void *) tp->colors);
+      tp->colors = NULL;
+    }
+    tp->ncolors = MI_NCOLORS(mi);
+    if (tp->ncolors < 2)
+      tp->ncolors = 2;
+    if (tp->ncolors <= 2)
+      tp->mono_p = True;
+    else
+      tp->mono_p = False;
+
+    if (tp->mono_p)
+      tp->colors = NULL;
+    else
+      if ((tp->colors = (XColor *) malloc(sizeof (*tp->colors) *
+          (tp->ncolors + 1))) == NULL) {
+        free_tetris(display, tp);
+        return;
+      }
+    tp->cycle_p = has_writable_cells(mi);
+    if (tp->cycle_p) {
+      if (MI_IS_FULLRANDOM(mi)) {
+        if (!NRAND(8))
+          tp->cycle_p = False;
+        else
+          tp->cycle_p = True;
+      } else {
+        tp->cycle_p = cycle_p;
+      }
+    }
+    if (!tp->mono_p) {
+      if (!(LRAND() % 10))
+        make_random_colormap(
+#if STANDALONE
+            display, MI_WINDOW(mi),
+#else
+            mi,
+#endif
+              tp->cmap, tp->colors, &tp->ncolors,
+              True, True, &tp->cycle_p);
+      else if (!(LRAND() % 2))
+        make_uniform_colormap(
+#if STANDALONE
+            display, MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                  tp->cmap, tp->colors, &tp->ncolors,
+                  True, &tp->cycle_p);
+      else
+        make_smooth_colormap(
+#if STANDALONE
+            display, MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                 tp->cmap, tp->colors, &tp->ncolors,
+                 True, &tp->cycle_p);
+    }
+    XInstallColormap(display, tp->cmap);
+    if (tp->ncolors < 2) {
+      tp->ncolors = 2;
+      tp->no_colors = True;
+    } else
+      tp->no_colors = False;
+    if (tp->ncolors <= 2)
+      tp->mono_p = True;
+
+    if (tp->mono_p)
+      tp->cycle_p = False;
+
+  }
+  /* initialize object */
+  newPolyomino(mi);
+}
+
+static Bool
+moveOne(ModeInfo *mi, move_t move)
+{
+  Display    *display = MI_DISPLAY(mi);
+  trisstruct *tp = &triss[MI_SCREEN(mi)];
+
+  if (move == FALL) {
+    if (trackmouse) {
+      tp->sidemoves = tp->sidemoves + 1;
+      if (tp->sidemoves < tp->ncols / 2) {
+        Window      r, c;
+        int         rx, ry, cx, cy;
+        unsigned int m;
+
+        (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
+          &r, &c, &rx, &ry, &cx, &cy, &m);
+        if (tp->well) {
+          cx = cx - tp->width / 2;
+          cy = cy - tp->height / 2;
+          if (ABS(cx) <= tp->xs * tp->ncols / 2 ||
+              ABS(cy) <= tp->ys * tp->nrows / 2) {
+            int ominopos, mousepos, diff;
+            double wall;
+
+            /* Avoid atan2: DOMAIN error message */
+            if (cy == 0 && cx == 0)
+              wall = 0.0;
+            else
+              wall = 2.0 * (atan2((double) cy, (double) cx) + 3 * M_PI / 4) / M_PI;
+            if (wall < 0.0)
+              wall += 4.0;
+            mousepos = (int) (wall * WELL_WIDTH);
+            ominopos = tp->curPolyomino.xpos;
+            diff = mousepos - ominopos;
+            if (diff < 0)
+              diff += WELL_WIDTH * MAX_SIDES;
+            if (diff > WELL_WIDTH * (MAX_SIDES / 2))
+              move = MOVE_LEFT;
+            else if (diff > 0)
+              move = MOVE_RIGHT;
+          }
+        } else {
+          cx = (cx - tp->xb) / tp->xs;
+          cy = (cy - tp->yb) / tp->ys;
+          if (!(cx < 0 || cy < 1 || cx >= tp->ncols || cy > tp->nrows)) {
+            if (cx > tp->curPolyomino.xpos +
+  polytris[(int) tp->bonusNow].polyomino[tp->curPolyomino.polyomino_number].leadingEmptyWidth) {
+              move = MOVE_RIGHT;
+            } else if (cx < tp->curPolyomino.xpos +
+  polytris[(int) tp->bonusNow].polyomino[tp->curPolyomino.polyomino_number].leadingEmptyWidth) {
+              move = MOVE_LEFT;
+            }
+          }
+        }
+      } else {
+        tp->sidemoves = 0;
+      }
+    } else if (!NRAND(4)) {
+      if (LRAND() & 1)
+        move = ROTATE;
+      else if (LRAND() & 1)
+        move = MOVE_LEFT;
+      else
+        move = MOVE_RIGHT;
+    }
+  }
+  if ((move == DROP) || ((move == FALL) && atBottom(mi))) {
+    putBox(mi);
+    {
+      int       lines;
+
+      if ((lines = checkLines(mi)) < 0) {
+        return False;
+      }
+      tp->rows += lines;
+      if (tp->rows > THRESHOLD(tp->level)) {
+        tp->level++;
+        if (tp->bonus) {
+          tp->bonusNow = True; /* No good deed goes unpunished */
+        }
+      }
+    }
+    XFlush(display);
+    if (tp->well) {
+      if (allFrozen(mi)) {
+        gameOver(mi);
+        init_tetris(mi);
+        return False;
+      }
+    }
+    newPolyomino(mi);
+    if (tp->well) {
+      checkFreeze(mi);
+    }
+    if (overlapping(mi)) {
+      gameOver(mi);
+      init_tetris(mi);
+      return False;
+    }
+    drawPolyomino(mi);
+    return True;
+  } else {
+    tryMove(mi, move);
+    if (tp->rows > THRESHOLD(tp->level)) {
+      tp->level++;
+      if (tp->bonus) {
+        tp->bonusNow = True;
+      }
+    }
+    return False;
+  }
+}
+
+void
+draw_tetris(ModeInfo * mi)
+{
+  Display *   display = MI_DISPLAY(mi);
+  trisstruct *tp;
+
+  if (triss == NULL)
+    return;
+  tp = &triss[MI_SCREEN(mi)];
+  if (!tp->well && tp->field == NULL)
+    return;
+
+  if (tp->no_colors) {
+    init_tetris(mi);
+    return;
+  }
+  tp->painted = True;
+  MI_IS_DRAWN(mi) = True;
+
+  /* Rotate colours */
+  if (tp->cycle_p) {
+    rotate_colors(display, tp->cmap, tp->colors, tp->ncolors,
+      tp->direction);
+    if (!(LRAND() % 1000))
+      tp->direction = -tp->direction;
+  }
+
+  (void) moveOne(mi, FALL);
+}
+
+#endif /* MODE_tetris */
diff --git a/modes/thornbird.c b/modes/thornbird.c
new file mode 100644 (file)
index 0000000..6c432dc
--- /dev/null
@@ -0,0 +1,269 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* thornbird --- continuously varying Thornbird set */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)thornbird.c  5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Tim Auckland <Tim.Auckland@Procket.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * "thornbird" shows a view of the "Bird in a Thornbush" fractal,
+ * continuously varying the three free parameters.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 04-Jun-1999: 3D tumble added by Tim Auckland
+ * 31-Jul-1997: Adapted from discrete.c Copyright (c) 1996 by Tim Auckland
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Thornbird"
+#define HACK_INIT init_thornbird
+#define HACK_DRAW draw_thornbird
+#define thornbird_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*count: 800 \n" \
+ "*cycles: 16 \n" \
+ "*ncolors: 100 \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_thornbird
+
+ModeSpecOpt thornbird_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   thornbird_description =
+{"thornbird", "init_thornbird", "draw_thornbird", "release_thornbird",
+ "refresh_thornbird", "init_thornbird", NULL, &thornbird_opts,
+ 1000, 800, 16, 1, 64, 1.0, "",
+ "Shows an animated Bird in a Thorn Bush fractal map", 0, NULL};
+
+#endif
+
+#define balance_rand(v)        ((LRAND()/MAXRAND*(v))-((v)/2)) /* random around 0 */
+
+typedef struct {
+       int         maxx;
+       int         maxy;       /* max of the screen */
+       double      a;
+       double      b;
+       double      c;
+       double      d;
+       double      e;
+       double      i;
+       double      j;          /* thornbird parameters */
+    struct {
+         double  f1;
+         double  f2;
+       }           liss;
+    struct {
+         double  theta;
+         double  dtheta;
+         double  phi;
+         double  dphi;
+       }           tumble;
+    int         inc;
+       int         pix;
+       int         count;
+       int         nbuffers;
+       XPoint    **pointBuffer;        /* pointer for XDrawPoints */
+} thornbirdstruct;
+
+static thornbirdstruct *thornbirds = NULL;
+
+static void
+free_thornbird(thornbirdstruct *hp)
+{
+       if (hp->pointBuffer != NULL) {
+               int         buffer;
+
+               for (buffer = 0; buffer < hp->nbuffers; buffer++)
+                       if (hp->pointBuffer[buffer] != NULL)
+                               (void) free((void *) hp->pointBuffer[buffer]);
+               (void) free((void *) hp->pointBuffer);
+               hp->pointBuffer = NULL;
+       }
+}
+
+void
+init_thornbird(ModeInfo * mi)
+{
+       thornbirdstruct *hp;
+
+       if (thornbirds == NULL) {
+               if ((thornbirds =
+                    (thornbirdstruct *) calloc(MI_NUM_SCREENS(mi),
+                                         sizeof (thornbirdstruct))) == NULL)
+                       return;
+       }
+       hp = &thornbirds[MI_SCREEN(mi)];
+
+
+       hp->maxx = MI_WIDTH(mi);
+       hp->maxy = MI_HEIGHT(mi);
+
+       hp->b = 0.1;
+       hp->i = hp->j = 0.1;
+
+       hp->pix = 0;
+       hp->inc = 0;
+
+       hp->nbuffers = MI_CYCLES(mi);
+
+       if (hp->pointBuffer == NULL)
+               if ((hp->pointBuffer = (XPoint **) calloc(MI_CYCLES(mi),
+                               sizeof (XPoint *))) == NULL) {
+                       free_thornbird(hp);
+                       return;
+               }
+
+       if (hp->pointBuffer[0] == NULL)
+               if ((hp->pointBuffer[0] = (XPoint *) malloc(MI_COUNT(mi) *
+                               sizeof (XPoint))) == NULL) {
+                       free_thornbird(hp);
+                       return;
+               }
+
+       /* select frequencies for parameter variation */
+       hp->liss.f1 = LRAND() % 5000;
+       hp->liss.f2 = LRAND() % 2000;
+
+       /* choose random 3D tumbling */
+       hp->tumble.theta = 0;
+       hp->tumble.phi = 0;
+       hp->tumble.dtheta = balance_rand(0.001);
+       hp->tumble.dphi = balance_rand(0.005);
+
+       /* Clear the background. */
+       MI_CLEARWINDOW(mi);
+
+       hp->count = 0;
+}
+
+
+void
+draw_thornbird(ModeInfo * mi)
+{
+       Display    *dsp = MI_DISPLAY(mi);
+       Window      win = MI_WINDOW(mi);
+       double      oldj, oldi;
+       int         batchcount = MI_COUNT(mi);
+       int         k;
+       XPoint     *xp;
+       GC          gc = MI_GC(mi);
+       int         erase;
+       int         current;
+
+       double      sint, cost, sinp, cosp;
+       thornbirdstruct *hp;
+
+       if (thornbirds == NULL)
+               return;
+       hp = &thornbirds[MI_SCREEN(mi)];
+       if (hp->pointBuffer == NULL)
+               return;
+
+       erase = (hp->inc + 1) % MI_CYCLES(mi);
+       current = hp->inc % MI_CYCLES(mi);
+       k = batchcount;
+
+
+       xp = hp->pointBuffer[current];
+
+       /* vary papameters */
+       hp->a = 1.99 + (0.4 * sin(hp->inc / hp->liss.f1) +
+                                       0.05 * cos(hp->inc / hp->liss.f2));
+       hp->c = 0.80 + (0.15 * cos(hp->inc / hp->liss.f1) +
+                                       0.05 * sin(hp->inc / hp->liss.f2));
+
+       /* vary view */
+       hp->tumble.theta += hp->tumble.dtheta;
+       hp->tumble.phi += hp->tumble.dphi;
+       sint = sin(hp->tumble.theta);
+       cost = cos(hp->tumble.theta);
+       sinp = sin(hp->tumble.phi);
+       cosp = cos(hp->tumble.phi);
+
+       while (k--) {
+               oldj = hp->j;
+               oldi = hp->i;
+
+               hp->j = oldi;
+               hp->i = (1 - hp->c) * cos(M_PI * hp->a * oldj) + hp->c * hp->b;
+               hp->b = oldj;
+
+               xp->x = (short)
+                 (hp->maxx / 2 * (1
+                                                  + sint*hp->j + cost*cosp*hp->i - cost*sinp*hp->b));
+               xp->y = (short)
+                 (hp->maxy / 2 * (1
+                                                  - cost*hp->j + sint*cosp*hp->i - sint*sinp*hp->b));
+               xp++;
+       }
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (hp->pointBuffer[erase] == NULL) {
+               if ((hp->pointBuffer[erase] = (XPoint *) malloc(MI_COUNT(mi) *
+                               sizeof (XPoint))) == NULL) {
+                       free_thornbird(hp);
+                       return;
+               }
+       } else {
+               XSetForeground(dsp, gc, MI_BLACK_PIXEL(mi));
+               XDrawPoints(dsp, win, gc, hp->pointBuffer[erase],
+                           batchcount, CoordModeOrigin);
+       }
+       if (MI_NPIXELS(mi) > 2) {
+               XSetForeground(dsp, gc, MI_PIXEL(mi, hp->pix));
+               if (erase == 0) /* change colours after "cycles" cycles */
+                       if (++hp->pix >= MI_NPIXELS(mi))
+                               hp->pix = 0;
+       } else
+               XSetForeground(dsp, gc, MI_WHITE_PIXEL(mi));
+
+       XDrawPoints(dsp, win, gc, hp->pointBuffer[current],
+                   batchcount, CoordModeOrigin);
+       hp->inc++;
+
+}
+
+void
+release_thornbird(ModeInfo * mi)
+{
+       if (thornbirds != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_thornbird(&thornbirds[screen]);
+               (void) free((void *) thornbirds);
+               thornbirds = NULL;
+       }
+}
+
+void
+refresh_thornbird(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_thornbird */
diff --git a/modes/tik_tak.c b/modes/tik_tak.c
new file mode 100644 (file)
index 0000000..5fbc33d
--- /dev/null
@@ -0,0 +1,610 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* tik_tak --- Rotating objects inspired by the Belgium television program *
+ * TIKTAK */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)tik_tak.c    5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1999 by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The author should like to be notified if changes have been made to the
+ * routine.  Response will only be guaranteed when a VMS version of the
+ * program is available.
+ *
+ * A rotating polygon-mode. This mode is inspired (but different) by some
+ * parts of the Belgium television program, TIKTAK, intended for babies.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 16-Sep-1999: Added shells and stars
+ * 08-Sep-1999: Created
+ *
+ * TODO list :
+ *   -make the objects move hormonically around the centre
+ *   -Create run-time options
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Tik_Tak"
+#define HACK_INIT init_tik_tak
+#define HACK_DRAW draw_tik_tak
+#define tik_tak_opts xlockmore_opts
+#define DEFAULTS "*delay: 60000 \n" \
+ "*count: -20 \n" \
+ "*cycles: 200 \n" \
+ "*size: -1000 \n" \
+ "*ncolors: 64 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#include "color.h"
+#endif /* STANDALONE */
+
+#ifdef MODE_tik_tak
+
+#define DEF_NUM_OBJECT 4
+
+#define DEF_CYCLE "True"
+
+#define min(a,b) ((a) <= (b) ? (a) : (b))
+
+static Bool cycle_p;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-cycle", (char *) ".tik_tak.cycle", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+cycle", (char *) ".tik_tak.cycle", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & cycle_p, (char *) "cycle", (char *) "Cycle", (char *) DEF_CYCLE, t_Bool}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-/+cycle", (char *) "turn on/off colour cycling"}
+};
+
+ModeSpecOpt tik_tak_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   tik_tak_description =
+{"tik_tak", "init_tik_tak", "draw_tik_tak", "release_tik_tak",
+ "refresh_tik_tak", "init_tik_tak", NULL, &tik_tak_opts,
+ 60000, -20, 200, -1000, 64, 1.0, "",
+ "Shows rotating polygons", 0, NULL};
+
+#endif
+
+#define PI_RAD (M_PI / 180.0)
+
+typedef struct {
+       unsigned long colour;
+        Bool        inner;
+       float       angle, velocity_a , angle1 , velocity_a1;
+   float size_mult , size_mult1;
+       int         num_point, size_ob;
+       int         num_point1, size_ob1;
+       XPoint      *xy , *xy1;
+} tik_takobject;
+
+typedef struct {
+       Bool        painted;
+       int         win_width, win_height, num_object , x0 , y0;
+       tik_takobject *object;
+       GC          gc;
+       Colormap    cmap;
+       XColor     *colors;
+       int         ncolors;
+       Bool        cycle_p, mono_p, no_colors;
+       unsigned long blackpixel, whitepixel, fg, bg;
+       int         direction;
+       ModeInfo   *mi;
+} tik_takstruct;
+
+static tik_takstruct *tik_taks = NULL;
+
+static void
+tik_tak_setupobject( ModeInfo * mi , tik_takobject * object0)
+{
+       tik_takstruct *tiktak = &tik_taks[MI_SCREEN(mi)];
+       int         x0=tiktak->x0 , y0=tiktak->y0 , i;
+   float curangle;
+
+   for (i = 0; i <= object0->num_point; i++)
+     {
+       object0->xy[i].x = object0->xy[i+object0->num_point+1].x;
+       object0->xy[i].y = object0->xy[i+object0->num_point+1].y;
+     }
+   for (i = 0; i < object0->num_point; i++)
+     {
+       object0->size_ob = (int) (object0->size_ob * object0->size_mult);
+       object0->size_mult = 1.0 / object0->size_mult;
+       curangle = object0->angle + i * 360.0 * PI_RAD /
+         (float) object0->num_point;
+       object0->xy[i+object0->num_point+1].x = x0 +
+         (int) (object0->size_ob * cos(curangle)) +
+         (int) (object0->size_ob * sin(curangle));
+       object0->xy[i+object0->num_point+1].y = y0 +
+         (int) (object0->size_ob * cos(curangle)) -
+         (int) (object0->size_ob * sin(curangle));
+     }
+   object0->xy[object0->num_point*2+1].x = object0->xy[object0->num_point+1].x;
+   object0->xy[object0->num_point*2+1].y = object0->xy[object0->num_point+1].y;
+
+   if ( object0->inner )
+     {
+       for (i = 0; i <= object0->num_point1; i++)
+         {
+            object0->xy1[i].x = object0->xy1[i+object0->num_point1+1].x;
+            object0->xy1[i].y = object0->xy1[i+object0->num_point1+1].y;
+         }
+
+       for (i = 0; i < object0->num_point1; i++)
+         {
+            object0->size_ob1 = (int) (object0->size_ob1 * object0->size_mult1);
+            object0->size_mult1 = 1.0 / object0->size_mult1;
+            curangle = object0->angle1 + i * 360.0 * PI_RAD /
+              (float) object0->num_point1;
+            object0->xy1[i+object0->num_point1+1].x = x0 +
+              (int) (object0->size_ob1 * cos(curangle)) +
+              (int) (object0->size_ob1 * sin(curangle));
+            object0->xy1[i+object0->num_point1+1].y = y0 +
+              (int) (object0->size_ob1 * cos(curangle)) -
+              (int) (object0->size_ob1 * sin(curangle));
+         }
+       object0->xy1[object0->num_point1*2+1].x =
+         object0->xy1[object0->num_point1+1].x;
+       object0->xy1[object0->num_point1*2+1].y =
+         object0->xy1[object0->num_point1+1].y;
+     }
+}
+
+static void
+tik_tak_reset_object( tik_takobject * object0)
+{
+   int i;
+
+   for (i = 0; i <= object0->num_point; i++)
+     {
+       object0->xy[i].x = object0->xy[object0->num_point+1].x;
+       object0->xy[i].y = object0->xy[object0->num_point+1].y;
+     }
+
+   if ( object0->inner )
+     {
+       for (i = 0; i <= object0->num_point1; i++)
+         {
+            object0->xy1[i].x = object0->xy1[object0->num_point1+1].x;
+            object0->xy1[i].y = object0->xy1[object0->num_point1+1].y;
+         }
+     }
+}
+
+static void
+tik_tak_drawobject(ModeInfo * mi, tik_takobject * object0 )
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       tik_takstruct *tiktak = &tik_taks[MI_SCREEN(mi)];
+
+   XFillPolygon(display, window, tiktak->gc, object0->xy ,
+               object0->num_point * 2 + 2 , Complex , CoordModeOrigin);
+   if ( object0->inner )
+     XFillPolygon(display, window, tiktak->gc, object0->xy1 ,
+                 object0->num_point1 * 2 + 2 , Complex , CoordModeOrigin);
+}
+
+static void
+free_tik_tak(Display *display, tik_takstruct *tiktak)
+{
+       ModeInfo *mi = tiktak->mi;
+
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+               MI_WHITE_PIXEL(mi) = tiktak->whitepixel;
+               MI_BLACK_PIXEL(mi) = tiktak->blackpixel;
+#ifndef STANDALONE
+               MI_FG_PIXEL(mi) = tiktak->fg;
+               MI_BG_PIXEL(mi) = tiktak->bg;
+#endif
+               if (tiktak->colors != NULL) {
+                       if (tiktak->ncolors && !tiktak->no_colors)
+                               free_colors(display, tiktak->cmap, tiktak->colors, tiktak->ncolors);
+                       (void) free((void *) tiktak->colors);
+                       tiktak->colors = NULL;
+               }
+               if (tiktak->cmap != None) {
+                       XFreeColormap(display, tiktak->cmap);
+                       tiktak->cmap = None;
+               }
+       }
+       if (tiktak->gc != None) {
+               XFreeGC(display, tiktak->gc);
+               tiktak->gc = None;
+       }
+       if (tiktak->object != NULL) {
+               int i;
+
+               for (i = 0; i < tiktak->num_object; i++) {
+                       tik_takobject *object0;
+
+                       object0 = &tiktak->object[i];
+                       if (object0->xy1 != NULL)
+                               (void) free((void *) object0->xy1);
+                       if (object0->xy != NULL)
+                               (void) free((void *) object0->xy);
+               }
+               (void) free((void *) tiktak->object);
+               tiktak->object = NULL;
+        }
+}
+
+void
+init_tik_tak(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i, max_objects, size_object;
+       tik_takstruct *tiktak;
+
+/* initialize */
+       if (tik_taks == NULL) {
+               if ((tik_taks = (tik_takstruct *) calloc(MI_NUM_SCREENS(mi),
+                               sizeof (tik_takstruct))) == NULL)
+                       return;
+       }
+       tiktak = &tik_taks[MI_SCREEN(mi)];
+       tiktak->mi = mi;
+
+       if (tiktak->gc == None) {
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XColor      color;
+
+#ifndef STANDALONE
+                       extern char *background;
+                       extern char *foreground;
+
+                       tiktak->fg = MI_FG_PIXEL(mi);
+                       tiktak->bg = MI_BG_PIXEL(mi);
+#endif
+                       tiktak->blackpixel = MI_BLACK_PIXEL(mi);
+                       tiktak->whitepixel = MI_WHITE_PIXEL(mi);
+                       if ((tiktak->cmap = XCreateColormap(display, window,
+                                       MI_VISUAL(mi), AllocNone)) == None) {
+                               free_tik_tak(display, tiktak);
+                               return;
+                       }
+                       XSetWindowColormap(display, window, tiktak->cmap);
+                       (void) XParseColor(display, tiktak->cmap, "black", &color);
+                       (void) XAllocColor(display, tiktak->cmap, &color);
+                       MI_BLACK_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, tiktak->cmap, "white", &color);
+                       (void) XAllocColor(display, tiktak->cmap, &color);
+                       MI_WHITE_PIXEL(mi) = color.pixel;
+#ifndef STANDALONE
+                       (void) XParseColor(display, tiktak->cmap, background, &color);
+                       (void) XAllocColor(display, tiktak->cmap, &color);
+                       MI_BG_PIXEL(mi) = color.pixel;
+                       (void) XParseColor(display, tiktak->cmap, foreground, &color);
+                       (void) XAllocColor(display, tiktak->cmap, &color);
+                       MI_FG_PIXEL(mi) = color.pixel;
+#endif
+                       tiktak->colors = NULL;
+                       tiktak->ncolors = 0;
+               }
+               if ((tiktak->gc = XCreateGC(display, MI_WINDOW(mi),
+                            (unsigned long) 0, (XGCValues *) NULL)) == None) {
+                       free_tik_tak(display, tiktak);
+                       return;
+               }
+       }
+/* Clear Display */
+       MI_CLEARWINDOW(mi);
+       tiktak->painted = False;
+       XSetFunction(display, tiktak->gc, GXxor);
+
+
+/*Set up tik_tak data */
+       tiktak->direction = (LRAND() & 1) ? 1 : -1;
+       tiktak->win_width = MI_WIDTH(mi);
+       tiktak->win_height = MI_HEIGHT(mi);
+       tiktak->num_object = MI_COUNT(mi);
+        tiktak->x0 = tiktak->win_width / 2;
+        tiktak->y0 = tiktak->win_height / 2;
+       max_objects = MI_COUNT(mi);
+       if (tiktak->num_object == 0) {
+               tiktak->num_object = DEF_NUM_OBJECT;
+               max_objects = DEF_NUM_OBJECT;
+       } else if (tiktak->num_object < 0) {
+               max_objects = -tiktak->num_object;
+               tiktak->num_object = NRAND(-tiktak->num_object) + 1;
+       }
+       if (tiktak->object == NULL)
+               if ((tiktak->object = (tik_takobject *) calloc(max_objects,
+                               sizeof (tik_takobject))) == NULL) {
+                       free_tik_tak(display, tiktak);
+                       return;
+               }
+       size_object = min( tiktak->win_width , tiktak->win_height) / 3;
+       if ( abs( MI_SIZE(mi) ) > size_object) {
+          if ( MI_SIZE( mi ) < 0 )
+            {
+               size_object = -size_object;
+            }
+       }
+   else
+     {
+       size_object = MI_SIZE(mi);
+     }
+       if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+/* Set up colour map */
+               if (tiktak->colors != NULL) {
+                       if (tiktak->ncolors && !tiktak->no_colors)
+                               free_colors(display, tiktak->cmap, tiktak->colors, tiktak->ncolors);
+                       (void) free((void *) tiktak->colors);
+                       tiktak->colors = NULL;
+               }
+               tiktak->ncolors = MI_NCOLORS(mi);
+               if (tiktak->ncolors < 2)
+                       tiktak->ncolors = 2;
+               if (tiktak->ncolors <= 2)
+                       tiktak->mono_p = True;
+               else
+                       tiktak->mono_p = False;
+
+               if (tiktak->mono_p)
+                       tiktak->colors = NULL;
+               else
+                       if ((tiktak->colors = (XColor *) malloc(sizeof (*tiktak->colors) *
+                                       (tiktak->ncolors + 1))) == NULL) {
+                               free_tik_tak(display, tiktak);
+                               return;
+                       }
+               tiktak->cycle_p = has_writable_cells(mi);
+               if (tiktak->cycle_p) {
+                       if (MI_IS_FULLRANDOM(mi)) {
+                               if (!NRAND(8))
+                                       tiktak->cycle_p = False;
+                               else
+                                       tiktak->cycle_p = True;
+                       } else {
+                               tiktak->cycle_p = cycle_p;
+                       }
+               }
+               if (!tiktak->mono_p) {
+                       if (!(LRAND() % 10))
+                               make_random_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                                               tiktak->cmap, tiktak->colors, &tiktak->ncolors,
+                                               True, True, &tiktak->cycle_p);
+                       else if (!(LRAND() % 2))
+                               make_uniform_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                  tiktak->cmap, tiktak->colors, &tiktak->ncolors,
+                                                     True, &tiktak->cycle_p);
+                       else
+                               make_smooth_colormap(
+#ifdef STANDALONE
+                                               MI_DISPLAY(mi), MI_WINDOW(mi),
+#else
+            mi,
+#endif
+                 tiktak->cmap, tiktak->colors, &tiktak->ncolors,
+                                                    True, &tiktak->cycle_p);
+               }
+               XInstallColormap(display, tiktak->cmap);
+               if (tiktak->ncolors < 2) {
+                       tiktak->ncolors = 2;
+                       tiktak->no_colors = True;
+               } else
+                       tiktak->no_colors = False;
+               if (tiktak->ncolors <= 2)
+                       tiktak->mono_p = True;
+
+               if (tiktak->mono_p)
+                       tiktak->cycle_p = False;
+
+       }
+       for (i = 0; i < tiktak->num_object; i++) {
+               tik_takobject *object0;
+
+               object0 = &tiktak->object[i];
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       if (tiktak->ncolors > 2)
+                               object0->colour = NRAND(tiktak->ncolors - 2) + 2;
+                       else
+                               object0->colour = 1;    /* Just in case */
+                       XSetForeground(display, tiktak->gc, tiktak->colors[object0->colour].pixel);
+               } else {
+                       if (MI_NPIXELS(mi) > 2)
+                               object0->colour = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       else
+                               object0->colour = 1;    /*Xor'red so WHITE may not be appropriate */
+                       XSetForeground(display, tiktak->gc, object0->colour);
+               }
+               object0->angle = NRAND(90) * PI_RAD;
+               object0->angle1 = NRAND(90) * PI_RAD;
+               object0->velocity_a = (NRAND(7) - 3) * PI_RAD;
+               object0->velocity_a1 = (NRAND(7) - 3) * PI_RAD;
+               if (size_object == 0)
+                       object0->size_ob = 9;
+               else if (size_object > 0)
+                       object0->size_ob = size_object;
+               else
+                       object0->size_ob = NRAND(-size_object) + 1;
+               object0->size_ob++;
+               object0->num_point = NRAND(6)+3;
+          if (LRAND() & 1)
+            object0->size_mult = 1.0;
+          else
+            {
+               object0->num_point *= 2;
+               object0->size_mult = 1.0 - ( 1.0 / (float) ((LRAND() & 1) +
+                                                           2 ) );
+            }
+          if (object0->xy != NULL)
+                       (void) free((void *) object0->xy);
+          if ((object0->xy = (XPoint *) malloc(sizeof( XPoint ) *
+                               (2 * object0->num_point + 2))) == NULL) {
+                       free_tik_tak(display, tiktak);
+                       return;
+               }
+          if ((LRAND() & 1) || object0->size_ob < 10 )
+            {
+               object0->inner = False;
+               if ( object0->xy1 != NULL ) free( object0->xy1 );
+               object0->xy1 = NULL;
+            }
+          else
+            {
+               object0->inner = True;
+               object0->size_ob1 = object0->size_ob -
+                 NRAND( object0->size_ob / 5 ) - 1;
+               object0->num_point1 = NRAND(6)+3;
+               if (LRAND() & 1)
+                 object0->size_mult1 = 1.0;
+               else
+                 {
+                    object0->num_point1 *= 2;
+                    object0->size_mult1 = 1.0 -
+                       ( 1.0 / (float) ((LRAND() & 1) + 2 ) );
+                 }
+               if (object0->xy1 != NULL)
+                       (void) free((void *) object0->xy1);
+               if ((object0->xy1 = (XPoint *) malloc(sizeof( XPoint ) *
+                               (2 * object0->num_point1 + 2))) == NULL) {
+                       free_tik_tak(display, tiktak);
+                       return;
+               }
+               object0->size_mult1 = 1.0;
+            }
+               tik_tak_setupobject( mi , object0);
+               tik_tak_reset_object( object0);
+               tik_tak_drawobject(mi, object0 );
+       }
+       XFlush(display);
+       XSetFunction(display, tiktak->gc, GXcopy);
+}
+
+void
+draw_tik_tak(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         i;
+       tik_takstruct *tiktak;
+
+       if (tik_taks == NULL)
+               return;
+       tiktak = &tik_taks[MI_SCREEN(mi)];
+       if (tiktak->object == NULL)
+               return;
+
+       if (tiktak->no_colors) {
+               free_tik_tak(display, tiktak);
+               init_tik_tak(mi);
+               return;
+       }
+       tiktak->painted = True;
+       MI_IS_DRAWN(mi) = True;
+       XSetFunction(display, tiktak->gc, GXxor);
+
+/* Rotate colours */
+       if (tiktak->cycle_p) {
+               rotate_colors(display, tiktak->cmap, tiktak->colors, tiktak->ncolors,
+                             tiktak->direction);
+               if (!(LRAND() % 1000))
+                       tiktak->direction = -tiktak->direction;
+       }
+       for (i = 0; i < tiktak->num_object; i++) {
+               tik_takobject *object0;
+
+               object0 = &tiktak->object[i];
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, tiktak->gc, tiktak->colors[object0->colour].pixel);
+               } else {
+                       XSetForeground(display, tiktak->gc, object0->colour);
+               }
+               object0->velocity_a += ((float) NRAND(1001) - 500.0) / 200000.0;
+               object0->angle += object0->velocity_a;
+               object0->velocity_a1 += ((float) NRAND(1001) - 500.0) / 200000.0;
+               object0->angle1 += object0->velocity_a1;
+               tik_tak_setupobject( mi , object0);
+               tik_tak_drawobject(mi, object0 );
+       }
+       XSetFunction(display, tiktak->gc, GXcopy);
+}
+
+void
+refresh_tik_tak(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       int         i;
+       tik_takstruct *tiktak;
+
+       if (tik_taks == NULL)
+               return;
+       tiktak = &tik_taks[MI_SCREEN(mi)];
+       if (tiktak->object == NULL)
+               return;
+
+       if (!tiktak->painted)
+               return;
+       MI_CLEARWINDOW(mi);
+       XSetFunction(display, tiktak->gc, GXxor);
+
+       for (i = 0; i < tiktak->num_object; i++) {
+               tik_takobject *object0;
+
+               object0 = &tiktak->object[i];
+               if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
+                       XSetForeground(display, tiktak->gc, tiktak->colors[object0->colour].pixel);
+               } else {
+                       XSetForeground(display, tiktak->gc, object0->colour);
+               }
+               tik_tak_setupobject( mi , object0);
+               tik_tak_reset_object( object0);
+               tik_tak_drawobject(mi, object0 );
+       }
+       XSetFunction(display, tiktak->gc, GXcopy);
+}
+
+void
+release_tik_tak(ModeInfo * mi)
+{
+       if (tik_taks != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_tik_tak(MI_DISPLAY(mi), &tik_taks[screen]);
+               (void) free((void *) tik_taks);
+               tik_taks = NULL;
+       }
+}
+
+#endif /* MODE_tik_tak */
diff --git a/modes/triangle.c b/modes/triangle.c
new file mode 100644 (file)
index 0000000..3e8fa2b
--- /dev/null
@@ -0,0 +1,374 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* triangle --- create a triangle-mountain */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)triangle.c   5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1995 by Tobias Gloth
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 22-Dec-1997: Removed MI_PAUSE since it does not work on multiscreens.
+ * 10-May-1997: Compatible with xscreensaver
+ * 10-Mar-1996: re-arranged and re-formatted the code for appearance and
+ *              to make common subroutines.  Simplified.
+ *                 Ron Hitchens <ron@idiom.com>
+ * 07-Mar-1996: Removed internal delay code, set MI_PAUSE(mi) for inter-scene
+ *              delays.  No other delays are needed here.
+ *              Made pause time sensitive to value of cycles (in 10ths of a
+ *              second).  Removed (hopefully) all references to globals.
+ *                 Ron Hitchens <ron@idiom.com>
+ * 27-Feb-1996: Undid the changes listed below.  Added ModeInfo argument.
+ *                 Implemented delay between scenes using the MI_PAUSE(mi)
+ *              scheme.  Ron Hitchens <ron@idiom.com>
+ * 27-Dec-1995: Ron Hitchens <ron@idiom.com>
+ *              Modified logic of draw_triangle() to provide a delay
+ *              (sensitive to the value of cycles) between each iteration.
+ *              Because this mode is so compute intensive, when the new
+ *              event loop adjusted the delay to compensate, this mode had
+ *              almost no delay time left.  This change pauses between each
+ *              new landscape, but could still be done better (it is not
+ *              sensitive to input events while drawing, for example).
+ * 03-Nov-1995: Many changes (hopefully some good ones) by David Bagley
+ * 01-Oct-1995: Written by Tobias Gloth
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Triangle"
+#define HACK_INIT init_triangle
+#define HACK_DRAW draw_triangle
+#define triangle_opts xlockmore_opts
+#define DEFAULTS "*delay: 10000 \n" \
+ "*ncolors: 128 \n " \
+ "*wireframe: False \n" \
+ "*fullrandom: False \n"
+#define SMOOTH_COLORS
+#if 0
+#define UNIFORM_COLORS /* To get blue water uncomment, but ... */
+#endif
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_triangle
+
+ModeSpecOpt triangle_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   triangle_description =
+{"triangle", "init_triangle", "draw_triangle", "release_triangle",
+ "refresh_triangle", "init_triangle", NULL, &triangle_opts,
+ 10000, 1, 1, 1, 64, 1.0, "",
+ "Shows a triangle mountain range", 0, NULL};
+
+#endif
+
+#define MAX_STEPS 8
+#define MAX_SIZE  (1<<MAX_STEPS)
+#define MAX_LEVELS 1000
+
+#define DELTA  0.4
+#define LEFT   (-0.25)
+#define RIGHT  1.25
+#define TOP    0.3
+#define BOTTOM 1.0
+#define BLUE   (45 * MI_NPIXELS(mi) / 64)      /* Just the right shade of blue */
+
+#define BACKFACE_REMOVAL
+
+#define DISPLACE(h,d) ((h)/2+LRAND()/(MAXRAND/(2*(d)+1))-d)
+
+typedef struct {
+       int         width;
+       int         height;
+       int         size;
+       int         steps;
+       int         stage;
+       int         busyLoop;
+       int         fast;
+       int         i;
+       int         j;
+       int         d;
+       short       level[MAX_LEVELS];
+       int         xpos[2 * MAX_SIZE + 1];
+       int         ypos[MAX_SIZE + 1];
+       short       H[(MAX_SIZE + 1) * (MAX_SIZE + 2) / 2];
+       short      *h[MAX_SIZE + 1];
+       short       delta[MAX_STEPS];
+       Bool        wireframe;
+       Bool        joke;
+} trianglestruct;
+
+static trianglestruct *triangles = NULL;
+
+static
+void
+draw_atriangle(ModeInfo * mi, XPoint * p, int y_0, int y_1, int y_2, double dinv)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       trianglestruct *tp = &triangles[MI_SCREEN(mi)];
+
+       if (MI_NPIXELS(mi) > 2) {       /* color */
+               int         dmax, dmin;
+               long        color;
+
+               dmin = MIN(y_0, y_1);
+               dmin = MIN(dmin, y_2);
+               dmax = MAX(y_0, y_1);
+               dmax = MAX(dmax, y_2);
+
+               if (dmax == 0) {
+                       color = BLUE;
+               } else {
+                       color = MI_NPIXELS(mi) -
+                               (int) ((double) MI_NPIXELS(mi) / M_PI_2 * atan(dinv * (dmax - dmin)));
+               }
+
+               XSetForeground(display, gc, MI_PIXEL(mi, color % MI_NPIXELS(mi)));
+               if (tp->joke) {
+                       if ((Bool) (LRAND() & 1))
+                               XDrawLines(display, window, gc, p, 4, CoordModeOrigin);
+                       else
+                               XFillPolygon(display, window, gc, p, 3, Convex, CoordModeOrigin);
+               } else if (tp->wireframe) {
+                       XDrawLines(display, window, gc, p, 4, CoordModeOrigin);
+               } else {
+                       XFillPolygon(display, window, gc, p, 3, Convex, CoordModeOrigin);
+               }
+       } else {
+               /* mono */
+#ifdef BACKFACE_REMOVAL
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillPolygon(display, window, gc, p, 3, Convex, CoordModeOrigin);
+#endif
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               XDrawLines(display, window, gc, p, 4, CoordModeOrigin);
+       }
+}
+
+static
+void
+calc_points1(trianglestruct * tp, int d, int *y0_p, int *y1_p, int *y2_p, XPoint * p)
+{
+       *y0_p = tp->level[MAX(tp->h[tp->i][tp->j], 0)];
+       *y1_p = tp->level[MAX(tp->h[tp->i + d][tp->j], 0)];
+       *y2_p = tp->level[MAX(tp->h[tp->i][tp->j + d], 0)];
+
+       p[0].x = tp->xpos[2 * tp->i + tp->j];
+       p[1].x = tp->xpos[2 * (tp->i + d) + tp->j];
+       p[2].x = tp->xpos[2 * tp->i + (tp->j + d)];
+
+       p[0].y = tp->ypos[tp->j] - *y0_p;
+       p[1].y = tp->ypos[tp->j] - *y1_p;
+       p[2].y = tp->ypos[tp->j + d] - *y2_p;
+
+       p[3] = p[0];
+}
+
+static
+void
+calc_points2(trianglestruct * tp, int d, int *y0_p, int *y1_p, int *y2_p, XPoint * p)
+{
+       *y0_p = tp->level[MAX(tp->h[tp->i + d][tp->j], 0)];
+       *y1_p = tp->level[MAX(tp->h[tp->i + d][tp->j + d], 0)];
+       *y2_p = tp->level[MAX(tp->h[tp->i][tp->j + d], 0)];
+
+       p[0].x = tp->xpos[2 * (tp->i + d) + tp->j];
+       p[1].x = tp->xpos[2 * (tp->i + d) + (tp->j + d)];
+       p[2].x = tp->xpos[2 * tp->i + (tp->j + d)];
+
+       p[0].y = tp->ypos[tp->j] - *y0_p;
+       p[1].y = tp->ypos[tp->j + d] - *y1_p;
+       p[2].y = tp->ypos[tp->j + d] - *y2_p;
+
+       p[3] = p[0];
+}
+
+
+static
+void
+draw_mesh(ModeInfo * mi, trianglestruct * tp, int d, int count)
+{
+       XPoint      p[4];
+       int         first = 1;
+       int         y_0, y_1, y_2;
+       double      dinv = 0.2 / d;
+
+       if ((tp->j == 0) && (tp->i == 0)) {
+               MI_CLEARWINDOW(mi);
+       }
+       for (; (tp->j < tp->size) && (count > 0); tp->j += ((count) ? d : 0)) {
+               for (tp->i = (first) ? tp->i : 0, first = 0;
+                    (tp->i < MAX_SIZE - tp->j) && (count > 0);
+                    tp->i += d, count--) {
+                       if (tp->i + tp->j < tp->size) {
+                               calc_points1(tp, d, &y_0, &y_1, &y_2, p);
+                               draw_atriangle(mi, p, y_0, y_1, y_2, dinv);
+                       }
+                       if (tp->i + tp->j + d < tp->size) {
+                               calc_points2(tp, d, &y_0, &y_1, &y_2, p);
+                               draw_atriangle(mi, p, y_0, y_1, y_2, dinv);
+                       }
+               }
+       }
+
+       if (tp->j == tp->size) {
+               tp->busyLoop = 1;
+       }
+}
+
+void
+init_triangle(ModeInfo * mi)
+{
+       short      *tmp;
+       int         i, dim, one;
+       trianglestruct *tp;
+
+       if (triangles == NULL) {
+               if ((triangles = (trianglestruct *) calloc(MI_NUM_SCREENS(mi),
+                                          sizeof (trianglestruct))) == NULL)
+                       return;
+       }
+       tp = &triangles[MI_SCREEN(mi)];
+
+       tp->width = MI_WIDTH(mi);
+       tp->height = MI_HEIGHT(mi);
+       tp->busyLoop = -1;
+       tp->fast = 2;
+       if (MI_IS_FULLRANDOM(mi)) {
+               tp->joke = (Bool) (NRAND(10) == 0);
+               tp->wireframe = (Bool) (LRAND() & 1);
+       } else
+               tp->wireframe = MI_IS_WIREFRAME(mi);
+
+       MI_CLEARWINDOW(mi);
+
+       tp->steps = MAX_STEPS;
+       do {
+               tp->size = 1 << --tp->steps;
+       } while (tp->size * 5 > tp->width);
+       tmp = tp->H;
+       for (i = 0; i < tp->size + 1; i++) {
+               tp->h[i] = tmp;
+               tmp += (tp->size) + 1 - i;
+       }
+
+       tp->stage = -1;
+       dim = MIN(tp->width, tp->height);
+
+       for (i = 0; i < 2 * tp->size + 1; i++) {
+               tp->xpos[i] = (short) ((((double) i)
+                        / ((double) (2 * tp->size)) * (RIGHT - LEFT) + LEFT)
+                                      * dim) + (tp->width - dim) / 2;
+       }
+
+       for (i = 0; i < (tp->size + 1); i++) {
+               tp->ypos[i] = (short) ((((double) i)
+                        / ((double) tp->size) * (BOTTOM - TOP) + TOP) * dim)
+                       + (tp->height - dim) / 2;
+       }
+
+       for (i = 0; i < tp->steps; i++) {
+               tp->delta[i] = ((short) (DELTA * dim)) >> i;
+       }
+
+       one = tp->delta[0];
+
+       if (one > 0)
+               for (i = 0; i < MAX_LEVELS; i++) {
+                       tp->level[i] = (i * i) / one;
+               }
+}
+
+void
+draw_triangle(ModeInfo * mi)
+{
+       int         d, d2, i, j, delta;
+       trianglestruct *tp;
+
+       if (triangles == NULL)
+               return;
+       tp = &triangles[MI_SCREEN(mi)];
+
+       MI_IS_DRAWN(mi) = True;
+       if (tp->busyLoop > 0) {
+               if (tp->busyLoop >= 100)
+                       tp->busyLoop = -1;
+               else
+                       tp->busyLoop++;
+               return;
+       }
+       if (!tp->busyLoop) {
+               draw_mesh(mi, tp, tp->d / 2, MAX_SIZE / tp->d);
+               return;
+       }
+       if (tp->delta[0] > 0) {
+               if (!(++tp->stage)) {
+                       tp->h[0][0] = (short int) MAX(0, DISPLACE(0, tp->delta[0]));
+                       tp->h[tp->size][0] = (short int) MAX(0, DISPLACE(0, tp->delta[0]));
+                       tp->h[0][tp->size] = (short int) MAX(0, DISPLACE(0, tp->delta[0]));
+               } else {
+                       d = 2 << (tp->steps - tp->stage);
+                       d2 = d / 2;
+                       delta = tp->delta[tp->stage - 1];
+
+                       for (i = 0; i < tp->size; i += d) {
+                               for (j = 0; j < (tp->size - i); j += d) {
+                                       tp->h[i + d2][j] = (short int) DISPLACE(tp->h[i][j] +
+                                                    tp->h[i + d][j], delta);
+                                       tp->h[i][j + d2] = (short int) DISPLACE(tp->h[i][j] +
+                                                    tp->h[i][j + d], delta);
+                                       tp->h[i + d2][j + d2] = (short int) DISPLACE(tp->h[i + d][j] +
+                                                    tp->h[i][j + d], delta);
+                               }
+
+                               tp->busyLoop = 0;
+                               tp->i = 0;
+                               tp->j = 0;
+                               tp->d = d;
+                       }
+               }
+       }
+       if (tp->stage == tp->steps) {
+#ifdef STANDALONE
+               erase_full_window(MI_DISPLAY(mi), MI_WINDOW(mi));
+#endif
+               init_triangle(mi);
+       }
+}
+
+void
+release_triangle(ModeInfo * mi)
+{
+       if (triangles != NULL) {
+               (void) free((void *) triangles);
+               triangles = NULL;
+       }
+}
+
+void
+refresh_triangle(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_triangle */
diff --git a/modes/tube.c b/modes/tube.c
new file mode 100644 (file)
index 0000000..295dcbf
--- /dev/null
@@ -0,0 +1,395 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* tube --- animated tube */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)tube.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 Dan Stromberg <strombrg@nis.acs.uci.edu>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 04-Mar-1997: Memory leak fix by Tom Schmidt <tschmidt@micron.com>
+ * 07-Feb-1997: Written by Dan Stromberg <strombrg@nis.acs.uci.edu>
+ */
+
+
+#ifdef STANDALONE
+#define PROGCLASS "Tube"
+#define HACK_INIT init_tube
+#define HACK_DRAW draw_tube
+#define tube_opts xlockmore_opts
+#define DEFAULTS "*delay: 25000 \n" \
+ "*cycles: 20000 \n" \
+ "*size: -200 \n" \
+ "*ncolors: 200 \n"
+#define SMOOTH_COLORS
+#define WRITABLE_COLORS
+#include "xlockmore.h"         /* from the xscreensaver distribution */
+#include <X11/Xutil.h>
+#else /* !STANDALONE */
+#include "xlock.h"             /* from the xlockmore distribution */
+#include "vis.h"
+#include "color.h"
+#endif /* !STANDALONE */
+
+#ifdef MODE_tube
+
+ModeSpecOpt tube_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   tube_description =
+{"tube", "init_tube", "draw_tube", "release_tube",
+ NULL, "init_tube", NULL, &tube_opts,
+ 25000, -9, 20000, -200, 64, 1.0, "",
+ "Shows an animated tube", 0, NULL};
+
+#endif
+
+#define MINSIZE 3
+#define MINSHAPE 1
+
+typedef struct {
+       int         dx1, dy1;
+       int         x1, y1;
+       int         width, height, average, linewidth;
+       int         shape;
+       XPoint     *pts, *proto_pts;
+       unsigned int cur_color;
+       Colormap    cmap;
+       XColor     *colors;
+       XColor      top;
+       XColor      bottom;
+       XColor      bgcol, fgcol;       /* foreground and background colour specs */
+       int         counter;
+       int         ncolors;
+       int         usable_colors;
+       Bool        fixed_colormap, reverse;
+} tubestruct;
+
+static tubestruct *tubes = NULL;
+
+static void
+free_pts(tubestruct *tp)
+{
+       if (tp->pts != NULL) {
+               (void) free((void *) tp->pts);
+               tp->pts = NULL;
+       }
+       if (tp->proto_pts != NULL) {
+               (void) free((void *) tp->proto_pts);
+               tp->proto_pts = NULL;
+       }
+}
+
+static void
+free_tube(Display *display,  tubestruct *tp)
+{
+       free_pts(tp);
+       if (tp->cmap != None) {
+               XFreeColormap(display, tp->cmap);
+               tp->cmap = None;
+       }
+       if (tp->colors != NULL) {
+               XFree((caddr_t) tp->colors);
+               tp->colors = NULL;
+       }
+}
+
+void
+init_tube(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         screen_width, screen_height, preserve;
+       int         size = MI_SIZE(mi);
+       Bool        truecolor;
+       int         star = 1, lw;
+       unsigned long redmask, greenmask, bluemask;
+       tubestruct *tp;
+
+       if (tubes == NULL) {
+               if ((tubes = (tubestruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (tubestruct))) == NULL)
+                       return;
+       }
+       tp = &tubes[MI_SCREEN(mi)];
+
+       screen_width = MI_WIDTH(mi);
+       screen_height = MI_HEIGHT(mi);
+
+       if (size < -MINSIZE) {
+               tp->width = NRAND(MIN(-size, MAX(MINSIZE, screen_width / 2)) -
+                                 MINSIZE + 1) + MINSIZE;
+               tp->height = NRAND(MIN(-size, MAX(MINSIZE, screen_height / 2)) -
+                                  MINSIZE + 1) + MINSIZE;
+       } else if (size < MINSIZE) {
+               if (!size) {
+                       tp->width = MAX(MINSIZE, screen_width / 2);
+                       tp->height = MAX(MINSIZE, screen_height / 2);
+               } else {
+                       tp->width = MINSIZE;
+                       tp->height = MINSIZE;
+               }
+       } else {
+               tp->width = MIN(size, MAX(MINSIZE, screen_width / 2));
+               tp->height = MIN(size, MAX(MINSIZE, screen_height / 2));
+       }
+       tp->average = (tp->width + tp->height) / 2;
+       tp->reverse = (Bool) (LRAND() & 1);
+       tp->dx1 = LRAND() & 1;
+       if (tp->dx1 == 0)
+               tp->dx1 = -1;
+       tp->dy1 = LRAND() & 1;
+       if (tp->dy1 == 0)
+               tp->dy1 = -1;
+       free_pts(tp);
+       tp->shape = MI_COUNT(mi);
+       if (tp->shape < -MINSHAPE) {
+               tp->shape = NRAND(-tp->shape - MINSHAPE + 1) + MINSHAPE;
+       } else if (tp->shape < MINSHAPE)
+               tp->shape = MINSHAPE;
+
+       if (tp->shape >= 3) {
+               int         i;
+               float       start;
+
+               tp->width = tp->height = tp->average;
+               if (((tp->pts = (XPoint *) malloc((tp->shape + 1) *
+                        sizeof (XPoint))) == NULL) ||
+                   ((tp->proto_pts = (XPoint *) malloc((tp->shape + 1) *
+                        sizeof (XPoint))) == NULL)) {
+                       free_tube(display, tp);
+                       return;
+               }
+               start = (float) NRAND(360);
+               do {
+                       star = NRAND(tp->shape / 2) + 1;        /* Not always a star but thats ok. */
+               } while ((star != 1) && (!(tp->shape % star)));
+               for (i = 0; i < tp->shape; i++) {
+                       tp->proto_pts[i].x = tp->average / 2 +
+                               (int) (cos((double) start * 2.0 * M_PI / 360.0) * tp->average / 2.0);
+                       tp->proto_pts[i].y = tp->average / 2 +
+                               (int) (sin((double) start * 2.0 * M_PI / 360.0) * tp->average / 2.0);
+                       start += star * 360 / tp->shape;
+               }
+               tp->proto_pts[tp->shape] = tp->proto_pts[0];
+       }
+       tp->linewidth = NRAND(tp->average / 6 + 1) + 1;
+       if (star > 1)           /* Make the width less */
+               tp->linewidth = NRAND(tp->linewidth / 2 + 1) + 1;
+       lw = tp->linewidth / 2;
+       tp->x1 = NRAND(screen_width - tp->width - 2 * lw) + lw;
+       tp->y1 = NRAND(screen_height - tp->height - 2 * lw) + lw;
+
+       tp->counter = 0;
+
+       MI_CLEARWINDOW(mi);
+
+#ifndef STANDALONE
+       tp->fixed_colormap = !setupColormap(mi,
+               &(tp->ncolors), &truecolor, &redmask, &greenmask, &bluemask);
+       if (!tp->fixed_colormap) {
+               preserve = preserveColors(MI_BLACK_PIXEL(mi), MI_WHITE_PIXEL(mi),
+                                         MI_BG_PIXEL(mi), MI_FG_PIXEL(mi));
+               tp->bgcol.pixel = MI_BG_PIXEL(mi);
+               tp->fgcol.pixel = MI_FG_PIXEL(mi);
+               XQueryColor(display, MI_COLORMAP(mi), &(tp->bgcol));
+               XQueryColor(display, MI_COLORMAP(mi), &(tp->fgcol));
+
+#define RANGE 65536
+#define DENOM 2
+               /* color in the bottom part */
+               tp->bottom.red = NRAND(RANGE / DENOM);
+               tp->bottom.blue = NRAND(RANGE / DENOM);
+               tp->bottom.green = NRAND(RANGE / DENOM);
+               /* color in the top part */
+               tp->top.red = RANGE - NRAND(RANGE / DENOM);
+               tp->top.blue = RANGE - NRAND(RANGE / DENOM);
+               tp->top.green = RANGE - NRAND(RANGE / DENOM);
+
+               /* allocate colormap, if needed */
+               if (tp->colors == NULL)
+                       if ((tp->colors = (XColor *) malloc(sizeof (XColor) *
+                                       tp->ncolors)) == NULL) {
+                               free_tube(display, tp);
+                               return;
+                       }
+               if (tp->cmap == None)
+                       if ((tp->cmap = XCreateColormap(display, window,
+                                                  MI_VISUAL(mi), AllocAll)) == None) {
+                               free_tube(display, tp);
+                               return;
+                       }
+               tp->usable_colors = tp->ncolors - preserve;
+       }
+       tp->cur_color = NRAND(tp->ncolors);
+#endif /* !STANDALONE */
+}
+
+void
+draw_tube(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       unsigned int i, j;
+       int         lw;
+       tubestruct *tp;
+
+       if (tubes == NULL)
+               return;
+       tp = &tubes[MI_SCREEN(mi)];
+#ifndef STANDALONE
+       if (!tp->fixed_colormap && tp->cmap == None)
+               return;
+#endif
+       if (tp->shape >= 3 && tp->pts == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       lw = tp->linewidth / 2;
+
+       /* advance drawing color */
+       tp->cur_color = (tp->cur_color + 1) % tp->ncolors;
+#ifndef STANDALONE
+       if (!tp->fixed_colormap && tp->usable_colors > 2) {
+               while (tp->cur_color == MI_WHITE_PIXEL(mi) ||
+                      tp->cur_color == MI_BLACK_PIXEL(mi) ||
+                      tp->cur_color == MI_BG_PIXEL(mi) ||
+                      tp->cur_color == MI_FG_PIXEL(mi)) {
+                       tp->cur_color = (tp->cur_color + 1) % tp->ncolors;
+               }
+               XSetForeground(display, gc, tp->cur_color);
+       } else
+               XSetForeground(display, gc, MI_PIXEL(mi, tp->cur_color));
+#endif /* !STANDALONE */
+
+       /* move rectangle forward, horiz */
+       tp->x1 += tp->dx1;
+       if (tp->x1 < lw) {
+               tp->x1 = lw;
+               tp->dx1 = -tp->dx1;
+       }
+       if (tp->x1 + tp->width + lw >= MI_WIDTH(mi)) {
+               tp->x1 = MI_WIDTH(mi) - tp->width - 1 - lw;
+               tp->dx1 = -tp->dx1;
+       }
+       /* move rectange forward, vert */
+       tp->y1 += tp->dy1;
+       if (tp->y1 < lw) {
+               tp->y1 = lw;
+               tp->dy1 = -tp->dy1;
+       }
+       if (tp->y1 + tp->height + lw >= MI_HEIGHT(mi)) {
+               tp->y1 = MI_HEIGHT(mi) - tp->height - 1 - lw;
+               tp->dy1 = -tp->dy1;
+       }
+       XSetLineAttributes(display, gc, tp->linewidth + (tp->shape >= 2),
+                          LineSolid, CapNotLast, JoinRound);
+       if (tp->shape < 2)
+               XDrawRectangle(display, window, gc,
+                              tp->x1, tp->y1, tp->width, tp->height);
+       else if (tp->shape == 2)
+               XDrawArc(display, window, gc,
+                        tp->x1, tp->y1, tp->width, tp->height, 0, 23040);
+       else {
+               for (i = 0; i <= (unsigned int) tp->shape; i++) {
+                       tp->pts[i].x = tp->x1 + tp->proto_pts[i].x;
+                       tp->pts[i].y = tp->y1 + tp->proto_pts[i].y;
+               }
+               XDrawLines(display, window, gc, tp->pts, tp->shape + 1,
+                          CoordModeOrigin);
+       }
+       XSetLineAttributes(display, gc, 1, LineSolid, CapNotLast, JoinRound);
+
+#ifndef STANDALONE
+       /* advance colormap */
+       if (!tp->fixed_colormap && tp->usable_colors > 2) {
+#if 1
+               for (i = 0, j = tp->cur_color;
+                    i < (unsigned int) tp->ncolors; i++) {
+#else
+               for (i = (unsigned int) tp->ncolors - 1, j = tp->cur_color;
+                    i >= 0; i--) {
+#endif
+                       if (i == MI_WHITE_PIXEL(mi)) {
+                               tp->colors[i].pixel = i;
+                               tp->colors[i].red = 65535;
+                               tp->colors[i].blue = 65535;
+                               tp->colors[i].green = 65535;
+                               tp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                       } else if (i == MI_BLACK_PIXEL(mi)) {
+                               tp->colors[i].pixel = i;
+                               tp->colors[i].red = 0;
+                               tp->colors[i].blue = 0;
+                               tp->colors[i].green = 0;
+                               tp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                       } else if (i == MI_BG_PIXEL(mi)) {
+                               tp->colors[i] = tp->bgcol;
+                       } else if (i == MI_FG_PIXEL(mi)) {
+                               tp->colors[i] = tp->fgcol;
+                       } else {
+                               double      range;
+
+                               tp->colors[i].pixel = i;
+                               range = ((double) (tp->top.red - tp->bottom.red)) /
+                                       tp->ncolors;
+                               tp->colors[i].red = (short unsigned int) (range * j +
+                                                            tp->bottom.red);
+                               range = ((double) (tp->top.green - tp->bottom.green)) /
+                                       tp->ncolors;
+                               tp->colors[i].green = (short unsigned int) (range * j +
+                                                          tp->bottom.green);
+                               range = ((double) (tp->top.blue - tp->bottom.blue)) /
+                                       tp->ncolors;
+                               tp->colors[i].blue = (short unsigned int) (range * j +
+                                                           tp->bottom.blue);
+                               tp->colors[i].flags = DoRed | DoGreen | DoBlue;
+                               if (tp->reverse)
+                                       j = (j + 1) % tp->ncolors;
+                               else
+                                       j = (j - 1 + tp->ncolors) % tp->ncolors;
+                       }
+               }
+               /* make the entire tube move forward */
+               XStoreColors(display, tp->cmap, tp->colors, tp->ncolors);
+               setColormap(display, window, tp->cmap, MI_IS_INWINDOW(mi));
+       }
+#endif /* !STANDALONE */
+       tp->counter++;
+       if (tp->counter > MI_CYCLES(mi)) {
+               init_tube(mi);
+       }
+}
+
+void
+release_tube(ModeInfo * mi)
+{
+       if (tubes != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_tube(MI_DISPLAY(mi), &tubes[screen]);
+               (void) free((void *) tubes);
+               tubes = NULL;
+       }
+}
+
+#endif /* MODE_tube */
diff --git a/modes/turtle.c b/modes/turtle.c
new file mode 100644 (file)
index 0000000..248bc83
--- /dev/null
@@ -0,0 +1,416 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* turtle --- fractal curves */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)turtle.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 01-Dec-1996: Not too proud how I hacked in 2 more curves
+ * 30-Sep-1996: started with Hilbert curve, David Bagley
+ * From Fractal Programming in C by Roger T. Stevens
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Turtle"
+#define HACK_INIT init_turtle
+#define HACK_DRAW draw_turtle
+#define turtle_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000000 \n" \
+ "*cycles: 20 \n" \
+ "*ncolors: 64 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_turtle
+
+ModeSpecOpt turtle_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   turtle_description =
+{"turtle", "init_turtle", "draw_turtle", "release_turtle",
+ "init_turtle", "init_turtle", NULL, &turtle_opts,
+ 1000000, 1, 20, 1, 64, 1.0, "",
+ "Shows turtle fractals", 0, NULL};
+
+#endif
+
+#define HILBERT 0              /* Not exactly a turtle algorthm... p199 */
+#define CESARO_VAR 1           /* Telephone curve p168 */
+#define HARTER_HEIGHTWAY 2     /* Dragon curve p292 */
+#define TURTLE_CURVES 3
+
+#define POINT(x_1,y_1,x_2,y_2) (((x_2)==(x_1))?(((y_2)>(y_1))?90.0:270.0):\
+  ((x_2)>(x_1))?(atan(((y_2)-(y_1))/((x_2)-(x_1)))*(180.0/M_PI)):\
+  (atan(((y_2)-(y_1))/((x_2)-(x_1)))*(180.0/M_PI)+180.0))
+#define TURN(theta, angle) ((theta)+=(angle))
+#define STEP(x, y, r, theta) ((x)+=(r)*cos((theta)*M_PI/180.0)),\
+  ((y)+=(r)*sin((theta)*M_PI/180.0))
+
+typedef struct {
+       double      r, theta, x, y;
+} turtletype;
+
+typedef struct {
+       double      x, y;
+} complextype;
+
+typedef struct {
+       int         width, height;
+       int         time;
+       int         level;
+       int         curve;
+       int         r, maxlevel, min, dir;
+       XPoint      pt1, pt2;
+       XPoint      start;
+       turtletype  turtle;
+       int         sign;
+} turtlestruct;
+
+static turtlestruct *turtles = NULL;
+
+static void
+generate_hilbert(ModeInfo * mi, int r1, int r2)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       turtlestruct *tp = &turtles[MI_SCREEN(mi)];
+
+       tp->level--;
+
+       if (tp->level > 0)
+               generate_hilbert(mi, r2, r1);
+
+       tp->pt2.x += r1;
+       tp->pt2.y += r2;
+       XDrawLine(display, window, gc,
+                 tp->pt1.x, tp->pt1.y, tp->pt2.x, tp->pt2.y);
+       tp->pt1.x = tp->pt2.x;
+       tp->pt1.y = tp->pt2.y;
+
+       if (tp->level > 0)
+               generate_hilbert(mi, r1, r2);
+
+       tp->pt2.x += r2;
+       tp->pt2.y += r1;
+       XDrawLine(display, window, gc,
+                 tp->pt1.x, tp->pt1.y, tp->pt2.x, tp->pt2.y);
+       tp->pt1.x = tp->pt2.x;
+       tp->pt1.y = tp->pt2.y;
+
+       if (tp->level > 0)
+               generate_hilbert(mi, r1, r2);
+
+       tp->pt2.x -= r1;
+       tp->pt2.y -= r2;
+       XDrawLine(display, window, gc,
+                 tp->pt1.x, tp->pt1.y, tp->pt2.x, tp->pt2.y);
+       tp->pt1.x = tp->pt2.x;
+       tp->pt1.y = tp->pt2.y;
+
+       if (tp->level > 0)
+               generate_hilbert(mi, -r2, -r1);
+
+       tp->level++;
+}
+
+static void
+generate_cesarovar(ModeInfo * mi, double pt1x, double pt1y,
+                  double pt2x, double pt2y, int level, int sign)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       turtlestruct *tp = &turtles[MI_SCREEN(mi)];
+       complextype points[4];
+
+       level--;
+
+       tp->turtle.r = sqrt((double) ((pt2x - pt1x) * (pt2x - pt1x) +
+                                     (pt2y - pt1y) * (pt2y - pt1y))) / 2.0;
+       points[0].x = pt1x;
+       points[0].y = pt1y;
+       points[2].x = pt2x;
+       points[2].y = pt2y;
+       tp->turtle.theta = POINT(pt1x, pt1y, pt2x, pt2y);
+       tp->turtle.x = pt1x;
+       tp->turtle.y = pt1y;
+       STEP(tp->turtle.x, tp->turtle.y, tp->turtle.r, tp->turtle.theta);
+       points[3].x = tp->turtle.x;
+       points[3].y = tp->turtle.y;
+       TURN(tp->turtle.theta, 90.0 * (double) sign);
+       STEP(tp->turtle.x, tp->turtle.y, tp->turtle.r, tp->turtle.theta);
+       points[1].x = tp->turtle.x;
+       points[1].y = tp->turtle.y;
+       sign = -1;
+       if (level > 0) {
+               int         j;
+
+               for (j = 0; j < 2; j++) {
+                       pt1x = points[j].x;
+                       pt2x = points[j + 1].x;
+                       pt1y = points[j].y;
+                       pt2y = points[j + 1].y;
+                       generate_cesarovar(mi, pt1x, pt1y, pt2x, pt2y, level, sign);
+               }
+       } else {
+               XDrawLine(display, window, gc,
+                         (int) points[0].x + tp->start.x, (int) points[0].y + tp->start.y,
+                         (int) points[2].x + tp->start.x, (int) points[2].y + tp->start.y);
+               XDrawLine(display, window, gc,
+                         (int) points[1].x + tp->start.x, (int) points[1].y + tp->start.y,
+                         (int) points[3].x + tp->start.x, (int) points[3].y + tp->start.y);
+       }
+}
+
+static void
+generate_harter_heightway(ModeInfo * mi, double pt1x, double pt1y,
+                         double pt2x, double pt2y, int level, int sign)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       turtlestruct *tp = &turtles[MI_SCREEN(mi)];
+       complextype points[4];
+       int         sign2 = -1;
+
+       level--;
+
+       tp->turtle.r = sqrt((double) ((pt2x - pt1x) * (pt2x - pt1x) +
+                                     (pt2y - pt1y) * (pt2y - pt1y)) / 2.0);
+       points[0].x = pt1x;
+       points[0].y = pt1y;
+       points[2].x = pt2x;
+       points[2].y = pt2y;
+       tp->turtle.theta = POINT(pt1x, pt1y, pt2x, pt2y);
+       tp->turtle.x = pt1x;
+       tp->turtle.y = pt1y;
+       TURN(tp->turtle.theta, 45.0 * (double) sign);
+       STEP(tp->turtle.x, tp->turtle.y, tp->turtle.r, tp->turtle.theta);
+       points[1].x = tp->turtle.x;
+       points[1].y = tp->turtle.y;
+       if (level > 0) {
+               int         j;
+
+               for (j = 0; j < 2; j++) {
+                       pt1x = points[j].x;
+                       pt2x = points[j + 1].x;
+                       pt1y = points[j].y;
+                       pt2y = points[j + 1].y;
+                       generate_harter_heightway(mi, pt1x, pt1y, pt2x, pt2y, level, sign2);
+                       sign2 *= -1;
+               }
+       } else {
+               XDrawLine(display, window, gc,
+                         (int) points[0].x + tp->start.x, (int) points[0].y + tp->start.y,
+                         (int) points[1].x + tp->start.x, (int) points[1].y + tp->start.y);
+               XDrawLine(display, window, gc,
+                         (int) points[1].x + tp->start.x, (int) points[1].y + tp->start.y,
+                         (int) points[2].x + tp->start.x, (int) points[2].y + tp->start.y);
+       }
+}
+
+
+void
+init_turtle(ModeInfo * mi)
+{
+       int         i;
+       turtlestruct *tp;
+
+       if (turtles == NULL) {
+               if ((turtles = (turtlestruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (turtlestruct))) == NULL)
+                       return;
+       }
+       tp = &turtles[MI_SCREEN(mi)];
+
+       tp->width = MI_WIDTH(mi);
+       tp->height = MI_HEIGHT(mi);
+       tp->min = MIN(tp->width, tp->height);
+       tp->maxlevel = 0;
+       i = tp->min;
+       do {
+               tp->r = i;
+               tp->maxlevel++;
+               i = (tp->min - 1) / (1 << tp->maxlevel);
+       } while (i > 1);
+       tp->maxlevel--;
+       tp->r = tp->min = (tp->r << tp->maxlevel);
+
+       tp->curve = NRAND(TURTLE_CURVES);
+       switch (tp->curve) {
+               case HILBERT:
+                       tp->start.x = NRAND(tp->width - tp->min);
+                       tp->start.y = NRAND(tp->height - tp->min);
+                       break;
+               case CESARO_VAR:
+                       tp->r <<= 6;
+                       tp->min = 3 * tp->min / 4;
+                       tp->start.x = tp->width / 2;
+                       tp->start.y = tp->height / 2;
+                       switch (NRAND(4)) {
+                               case 0:
+                                       tp->pt1.x = -tp->min / 2;
+                                       tp->pt1.y = 0;
+                                       tp->pt2.x = tp->min / 2;
+                                       tp->pt2.y = 0;
+                                       tp->start.y -= tp->min / 6;
+                                       break;
+                               case 1:
+                                       tp->pt1.x = 0;
+                                       tp->pt1.y = -tp->min / 2;
+                                       tp->pt2.x = 0;
+                                       tp->pt2.y = tp->min / 2;
+                                       tp->start.x += tp->min / 6;
+                                       break;
+                               case 2:
+                                       tp->pt1.x = tp->min / 2;
+                                       tp->pt1.y = 0;
+                                       tp->pt2.x = -tp->min / 2;
+                                       tp->pt2.y = 0;
+                                       tp->start.y += tp->min / 6;
+                                       break;
+                               case 3:
+                                       tp->pt1.x = 0;
+                                       tp->pt1.y = tp->min / 2;
+                                       tp->pt2.x = 0;
+                                       tp->pt2.y = -tp->min / 2;
+                                       tp->start.x -= tp->min / 6;
+                                       break;
+                       }
+                       break;
+               case HARTER_HEIGHTWAY:
+                       tp->r <<= 6;
+                       tp->min = 3 * tp->min / 4;
+                       tp->start.x = tp->width / 2;
+                       tp->start.y = tp->height / 2;
+                       switch (NRAND(4)) {
+                               case 0:
+                                       tp->pt1.x = -tp->min / 2;
+                                       tp->pt1.y = -tp->min / 12;
+                                       tp->pt2.x = tp->min / 2;
+                                       tp->pt2.y = -tp->min / 12;
+                                       break;
+                               case 1:
+                                       tp->pt1.x = tp->min / 12;
+                                       tp->pt1.y = -tp->min / 2;
+                                       tp->pt2.x = tp->min / 12;
+                                       tp->pt2.y = tp->min / 2;
+                                       break;
+                               case 2:
+                                       tp->pt1.x = tp->min / 2;
+                                       tp->pt1.y = tp->min / 12;
+                                       tp->pt2.x = -tp->min / 2;
+                                       tp->pt2.y = tp->min / 12;
+                                       break;
+                               case 3:
+                                       tp->pt1.x = -tp->min / 12;
+                                       tp->pt1.y = tp->min / 2;
+                                       tp->pt2.x = -tp->min / 12;
+                                       tp->pt2.y = -tp->min / 2;
+                                       break;
+                       }
+       }
+       tp->level = 0;
+       tp->sign = 1;
+       tp->dir = NRAND(4);
+       tp->time = 0;
+
+       MI_CLEARWINDOW(mi);
+
+       if (MI_NPIXELS(mi) <= 2)
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi), MI_WHITE_PIXEL(mi));
+}
+
+void
+draw_turtle(ModeInfo * mi)
+{
+       turtlestruct *tp;
+
+       if (turtles == NULL)
+               return;
+       tp = &turtles[MI_SCREEN(mi)];
+
+       if (++tp->time > MI_CYCLES(mi))
+               init_turtle(mi);
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (MI_NPIXELS(mi) > 2)
+               XSetForeground(MI_DISPLAY(mi), MI_GC(mi),
+                              MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+
+       tp->r = tp->r >> 1;
+       tp->level++;
+       if (tp->r > 1)
+               switch (tp->curve) {
+                       case HILBERT:
+                               switch (tp->dir) {
+                                       case 0:
+                                               tp->pt1.x = tp->pt2.x = tp->start.x + tp->r / 2;
+                                               tp->pt1.y = tp->pt2.y = tp->start.y + tp->r / 2;
+                                               generate_hilbert(mi, 0, tp->r);
+                                               break;
+                                       case 1:
+                                               tp->pt1.x = tp->pt2.x = tp->start.x + tp->min - tp->r / 2;
+                                               tp->pt1.y = tp->pt2.y = tp->start.y + tp->min - tp->r / 2;
+                                               generate_hilbert(mi, 0, -tp->r);
+                                               break;
+                                       case 2:
+                                               tp->pt1.x = tp->pt2.x = tp->start.x + tp->min - tp->r / 2;
+                                               tp->pt1.y = tp->pt2.y = tp->start.y + tp->min - tp->r / 2;
+                                               generate_hilbert(mi, -tp->r, 0);
+                                               break;
+                                       case 3:
+                                               tp->pt1.x = tp->pt2.x = tp->start.x + tp->r / 2;
+                                               tp->pt1.y = tp->pt2.y = tp->start.y + tp->r / 2;
+                                               generate_hilbert(mi, tp->r, 0);
+                               }
+                               break;
+                       case CESARO_VAR:
+                               generate_cesarovar(mi,
+                                       (double) tp->pt1.x, (double) tp->pt1.y,
+                                       (double) tp->pt2.x, (double) tp->pt2.y,
+                                       tp->level, tp->sign);
+                               break;
+                       case HARTER_HEIGHTWAY:
+                               generate_harter_heightway(mi,
+                                       (double) tp->pt1.x, (double) tp->pt1.y,
+                                       (double) tp->pt2.x, (double) tp->pt2.y,
+                                       tp->level, tp->sign);
+                               break;
+               }
+}
+
+void
+release_turtle(ModeInfo * mi)
+{
+       if (turtles != NULL) {
+               (void) free((void *) turtles);
+               turtles = NULL;
+       }
+}
+
+#endif /* MODE_turtle */
diff --git a/modes/vines.c b/modes/vines.c
new file mode 100644 (file)
index 0000000..353334f
--- /dev/null
@@ -0,0 +1,186 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* vines --- vine fractals */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)vines.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by Tracy Camp campt@hurrah.com
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * If you make a modification I would of course appreciate a copy.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 11-Jul-1997: David Hansen <dhansen@metapath.com>
+ *              Changed names to vines and modified draw loop
+ *              to honor batchcount so vines can be grown or plotted.
+ * 10-May-1997: Compatible with xscreensaver
+ * 21-Mar-1997: David Hansen <dhansen@metapath.com>
+ *              Updated mode to draw complete patterns on every
+ *              iteration instead of growing the vine.  Also made
+ *              adjustments to randomization and changed variable
+ *              names to make logic easier to follow.
+ */
+
+/*-
+ * This was modifed from a 'screen saver' that a friend and I
+ * wrote on our TI-8x calculators in high school physics one day
+ * Basically another geometric pattern generator, this ones claim
+ * to fame is a pseudo-fractal looking vine like pattern that creates
+ * nifty whorls and loops.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Vines"
+#define HACK_INIT init_vines
+#define HACK_DRAW draw_vines
+#define vines_opts xlockmore_opts
+#define DEFAULTS "*delay: 200000 \n" \
+ "*count: 0 \n" \
+ "*ncolors: 64 \n" \
+ "*eraseSpeed: 400 \n" \
+ "*eraseMode: -1 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_vines
+
+ModeSpecOpt vines_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   vines_description =
+{"vines", "init_vines", "draw_vines", "release_vines",
+ "refresh_vines", "init_vines", NULL, &vines_opts,
+ 200000, 0, 1, 1, 64, 1.0, "",
+ "Shows fractals", 0, NULL};
+
+#endif
+
+typedef struct {
+       int         a;
+       int         x1;
+       int         y1;
+       int         x2;
+       int         y2;
+       int         i;
+       int         length;
+       int         iterations;
+       int         constant;
+       int         ang;
+       int         centerx;
+       int         centery;
+} vinestruct;
+
+static vinestruct *vines = NULL;
+
+void
+refresh_vines(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}                              /* refresh_vines */
+
+void
+init_vines(ModeInfo * mi)
+{
+       vinestruct *fp;
+
+       if (vines == NULL) {
+               if ((vines = (vinestruct *) calloc(MI_NUM_SCREENS(mi),
+                                            sizeof (vinestruct))) == NULL) {
+                       return;
+               }
+       }
+       fp = &vines[MI_SCREEN(mi)];
+
+       fp->i = 0;
+       fp->length = 0;
+       fp->iterations = 30 + NRAND(100);
+
+       MI_CLEARWINDOW(mi);
+}                              /* init_vines */
+
+void
+draw_vines(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       int         count;
+       vinestruct *fp;
+
+       if (vines == NULL)
+               return;
+       fp = &vines[MI_SCREEN(mi)];
+
+       /* MI_IS_DRAWN(mi) = True; */
+       if (fp->i >= fp->length) {
+               if (--(fp->iterations) == 0) {
+                       init_vines(mi);
+               }
+               fp->centerx = NRAND(MI_WIDTH(mi));
+               fp->centery = NRAND(MI_HEIGHT(mi));
+
+               fp->ang = 60 + NRAND(720);
+               fp->length = 100 + NRAND(3000);
+               fp->constant = fp->length * (10 + NRAND(10));
+
+               fp->i = 0;
+               fp->a = 0;
+               fp->x1 = 0;
+               fp->y1 = 0;
+               fp->x2 = 1;
+               fp->y2 = 0;
+
+               if (MI_NPIXELS(mi) > 2)
+                       XSetForeground(display, gc, MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+               else
+                       XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+       }
+       count = fp->i + MI_COUNT(mi);
+       if ((count <= fp->i) || (count > fp->length))
+               count = fp->length;
+
+       while (fp->i < count) {
+               XDrawLine(display, MI_WINDOW(mi), gc,
+                         fp->centerx + (fp->x1 / fp->constant),
+                         fp->centery - (fp->y1 / fp->constant),
+                         fp->centerx + (fp->x2 / fp->constant),
+                         fp->centery - (fp->y2 / fp->constant));
+
+               fp->a += (fp->ang * fp->i);
+
+               fp->x1 = fp->x2;
+               fp->y1 = fp->y2;
+
+               fp->x2 += (int) (fp->i * (cos((double) fp->a) * 360.0) / (2.0 * M_PI));
+               fp->y2 += (int) (fp->i * (sin((double) fp->a) * 360.0) / (2.0 * M_PI));
+               fp->i++;
+       }
+}                              /* draw_vines */
+
+void
+release_vines(ModeInfo * mi)
+{
+       if (vines != NULL) {
+               (void) free((void *) vines);
+               vines = NULL;
+       }
+}                              /* release_vines */
+
+#endif /* MODE_vines */
diff --git a/modes/voters.c b/modes/voters.c
new file mode 100644 (file)
index 0000000..78f0d6f
--- /dev/null
@@ -0,0 +1,860 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* voters --- Dewdney's Voting Simulation */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)voters.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-Jun-1997: Coded from A.K. Dewdney's "The Armchair Universe, Computer
+ *              Recreations from the Pages of Scientific American Magazine"
+ *              W.H. Freedman and Company, New York, 1988  (Apr 1985)
+ *              Used wator.c and demon.c as a guide.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Voters"
+#define HACK_INIT init_voters
+#define HACK_DRAW draw_voters
+#define voters_opts xlockmore_opts
+#define DEFAULTS "*delay: 1000 \n" \
+ "*cycles: 327670 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 64 \n" \
+ "*neighbors: 0 \n"
+#define UNIFORM_COLORS
+#define BRIGHT_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_voters
+
+/*-
+ * neighbors of 0 randomizes it between 3, 4, 6, 8, 9, and 12.
+ */
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+
+static int  neighbors;
+
+static XrmOptionDescRec opts[] =
+{
+        {(char *) "-neighbors", (char *) ".voters.neighbors", XrmoptionSepArg, (caddr_t) NULL}
+};
+
+static argtype vars[] =
+{
+        {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int
+}
+};
+static OptionStruct desc[] =
+{
+        {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3, 9 or 12"}
+};
+
+ModeSpecOpt voters_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+
+#ifdef USE_MODULES
+ModStruct   voters_description =
+{"voters", "init_voters", "draw_voters", "release_voters",
+ "refresh_voters", "init_voters", NULL, &voters_opts,
+ 1000, 0, 327670, 0, 64, 1.0, "",
+ "Shows Dewdney's Voters", 0, NULL};
+
+#endif
+
+/*-
+ * From far left to right, at least in the currently in the US.  By the way, I
+ * consider myself to be a proud bleeding heart liberal democrat, in
+ * case anyone wants to know....  Please, no fascist "improvements".  :)
+ */
+
+#include "bitmaps/sickle.xbm"
+#include "bitmaps/donkey.xbm"
+#include "bitmaps/elephant.xbm"
+
+#define MINPARTIES 2
+#define BITMAPS 3
+#define MINGRIDSIZE 10
+#define MINSIZE 4
+#define FACTOR 10
+#define NEIGHBORKINDS 6
+
+static XImage logo[BITMAPS] =
+{
+      {0, 0, 0, XYBitmap, (char *) sickle_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) donkey_bits, LSBFirst, 8, LSBFirst, 8, 1},
+    {0, 0, 0, XYBitmap, (char *) elephant_bits, LSBFirst, 8, LSBFirst, 8, 1},
+};
+
+/* Voter data */
+typedef struct {
+       char        kind;
+       int         age;
+       int         col, row;
+} cellstruct;
+
+/* Doublely linked list */
+typedef struct _CellList {
+       cellstruct  info;
+       struct _CellList *previous, *next;
+} CellList;
+
+typedef struct {
+       Bool        painted;
+       int         party;      /* Currently working on donkey, elephant, or sickle? */
+       int         xs, ys;     /* Size of party icon */
+       int         xb, yb;     /* Bitmap offset for party icon */
+       int         nparties;   /* 2 parties or 3 */
+       int         number_in_party[BITMAPS];   /* Good to know when one party rules */
+       int         pixelmode;
+       int         generation;
+       int         ncols, nrows;
+       int         npositions;
+       int         width, height;
+       CellList   *last, *first;
+       char       *arr;
+       int         neighbors;
+       int         busyLoop;
+       XPoint      hexagonList[6];
+       XPoint      triangleList[2][3];
+} voterstruct;
+
+static char plots[NEIGHBORKINDS] =
+{
+       3, 4, 6, 8, 9, 12       /* Neighborhoods */
+};
+
+static voterstruct *voters = NULL;
+static int  icon_width, icon_height;
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned long color, int bitmap,
+        Bool firstChange)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       voterstruct *vp = &voters[MI_SCREEN(mi)];
+       unsigned long colour = (MI_NPIXELS(mi) > 2) ?
+       MI_PIXEL(mi, color) : MI_WHITE_PIXEL(mi);
+
+       XSetForeground(display, gc, colour);
+       if (vp->neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               vp->hexagonList[0].x = vp->xb + ccol * vp->xs;
+               vp->hexagonList[0].y = vp->yb + crow * vp->ys;
+               if (vp->xs == 1 && vp->ys == 1)
+                       XDrawPoint(display, window, gc,
+                          vp->hexagonList[0].x, vp->hexagonList[0].y);
+               else if (bitmap == BITMAPS - 1)
+                       XFillPolygon(display, window, gc,
+                             vp->hexagonList, 6, Convex, CoordModePrevious);
+               else {
+                       if (firstChange) {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XFillPolygon(display, window, gc,
+                                            vp->hexagonList, 6, Convex, CoordModePrevious);
+                               XSetForeground(display, gc, colour);
+                       }
+                       if (vp->xs <= 6 || vp->ys <= 2)
+                               XFillRectangle(display, window, gc,
+                                      vp->hexagonList[0].x - 3 * vp->xs / 4,
+                                              vp->hexagonList[0].y + vp->ys / 4, vp->xs, vp->ys);
+                       else
+                               XFillArc(display, window, gc,
+                                    vp->xb + vp->xs * ccol - 3 * vp->xs / 4,
+                                        vp->yb + vp->ys * crow + vp->ys / 4,
+                                        2 * vp->xs - 6, 2 * vp->ys - 2,
+                                        0, 23040);
+               }
+       } else if (vp->neighbors == 4 || vp->neighbors == 8) {
+               if (vp->pixelmode) {
+                       if (bitmap == BITMAPS - 1 || (vp->xs <= 2 || vp->ys <= 2))
+                               XFillRectangle(display, window, gc,
+                               vp->xb + vp->xs * col, vp->yb + vp->ys * row,
+                               vp->xs - (vp->xs > 3), vp->ys - (vp->ys > 3));
+                       else {
+                               if (firstChange) {
+                                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                                       XFillRectangle(display, window, gc,
+                                                      vp->xb + vp->xs * col, vp->yb + vp->ys * row,
+                                                      vp->xs, vp->ys);
+                                       XSetForeground(display, gc, colour);
+                               }
+                               XFillArc(display, window, gc,
+                                        vp->xb + vp->xs * col, vp->yb + vp->ys * row,
+                                        vp->xs - 1, vp->ys - 1,
+                                        0, 23040);
+                       }
+               } else
+                       (void) XPutImage(display, window, gc,
+                                        &logo[bitmap], 0, 0,
+                               vp->xb + vp->xs * col, vp->yb + vp->ys * row,
+                                        icon_width, icon_height);
+       } else {                /* TRI */
+               int         orient = (col + row) % 2;   /* O left 1 right */
+
+               vp->triangleList[orient][0].x = vp->xb + col * vp->xs;
+               vp->triangleList[orient][0].y = vp->yb + row * vp->ys;
+               if (vp->xs <= 3 || vp->ys <= 3)
+                       XDrawPoint(display, window, gc,
+                        ((orient) ? -1 : 1) + vp->triangleList[orient][0].x,
+                                      vp->triangleList[orient][0].y);
+               else {
+                       if (orient)
+                               vp->triangleList[orient][0].x += (vp->xs / 2 - 1);
+                       else
+                               vp->triangleList[orient][0].x -= (vp->xs / 2 - 1);
+                       if (bitmap == BITMAPS - 1)
+                               XFillPolygon(display, window, gc,
+                                            vp->triangleList[orient], 3, Convex, CoordModePrevious);
+                       else {
+                               if (firstChange) {
+                                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                                       XFillPolygon(display, window, gc,
+                                                    vp->triangleList[orient], 3, Convex, CoordModePrevious);
+                                       XSetForeground(display, gc, colour);
+                               }
+                               XFillArc(display, window, gc,
+                                    vp->xb + vp->xs * col - 4 * vp->xs / 5 +
+                                   ((orient) ? vp->xs / 3 : 3 * vp->xs / 5),
+                                        vp->yb + vp->ys * row - vp->ys / 2 + 1, vp->ys - 3, vp->ys - 3,
+                                        0, 23040);
+                       }
+               }
+       }
+}
+
+static Bool
+init_list(voterstruct * vp)
+{
+       /* Waste some space at the beginning and end of list
+          so we do not have to complicated checks against falling off the ends. */
+       if (((vp->last = (CellList *) malloc(sizeof (CellList))) == NULL) ||
+           ((vp->first = (CellList *) malloc(sizeof (CellList))) == NULL)) {
+               return False;
+       }
+       vp->first->previous = vp->last->next = NULL;
+       vp->first->next = vp->last->previous = NULL;
+       vp->first->next = vp->last;
+       vp->last->previous = vp->first;
+       return True;
+}
+
+static Bool
+addto_list(voterstruct * vp, cellstruct info)
+{
+       CellList   *curr;
+
+       if ((curr = (CellList *) malloc(sizeof (CellList))) == NULL) {
+               return False;
+       }
+       vp->last->previous->next = curr;
+       curr->previous = vp->last->previous;
+       curr->next = vp->last;
+       vp->last->previous = curr;
+       curr->info = info;
+       return True;
+}
+
+static void
+removefrom_list(CellList * ptr)
+{
+       ptr->previous->next = ptr->next;
+       ptr->next->previous = ptr->previous;
+       (void) free((void *) ptr);
+}
+
+static void
+flush_list(voterstruct * vp)
+{
+       CellList   *curr;
+
+       while (vp->last->previous != vp->first) {
+               curr = vp->last->previous;
+               curr->previous->next = vp->last;
+               vp->last->previous = curr->previous;
+               (void) free((void *) curr);
+       }
+}
+
+static char
+neighbors_opinion(voterstruct * vp, int col, int row, int dir)
+{
+       if (vp->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                               break;
+                       case 60:
+                               if (!(row & 1))
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                               row = (!row) ? vp->nrows - 1 : row - 1;
+                               break;
+                       case 120:
+                               if (row & 1)
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                               row = (!row) ? vp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? vp->ncols - 1 : col - 1;
+                               break;
+                       case 240:
+                               if (row & 1)
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                               row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                               break;
+                       case 300:
+                               if (!(row & 1))
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (vp->neighbors == 4 || vp->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                               break;
+                       case 45:
+                               col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                               row = (!row) ? vp->nrows - 1 : row - 1;
+                               break;
+                       case 90:
+                               row = (!row) ? vp->nrows - 1 : row - 1;
+                               break;
+                       case 135:
+                               col = (!col) ? vp->ncols - 1 : col - 1;
+                               row = (!row) ? vp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? vp->ncols - 1 : col - 1;
+                               break;
+                       case 225:
+                               col = (!col) ? vp->ncols - 1 : col - 1;
+                               row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                               break;
+                       case 270:
+                               row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                               break;
+                       case 315:
+                               col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               if ((col + row) % 2) {  /* right */
+                       switch (dir) {
+                               case 0:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 60:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       if (row + 1 == vp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == vp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (row + 1 == vp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == vp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 120:
+                                       row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 180:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? vp->nrows - 1 : row - 1;
+                                       break;
+                               case 240:
+                                       row = (!row) ? vp->nrows - 1 : row - 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (!row)
+                                               row = vp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = vp->nrows - 1;
+                                       else
+                                               row = row - 2;
+
+                                       break;
+                               case 300:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       if (!row)
+                                               row = vp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = vp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       row = (!row) ? vp->nrows - 1 : row - 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               } else {        /* left */
+                       switch (dir) {
+                               case 0:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? vp->nrows - 1 : row - 1;
+                                       break;
+                               case 60:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       if (!row)
+                                               row = vp->nrows - 2;
+                                       else if (row == 1)
+                                               row = vp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (!row)
+                                               row = vp->nrows - 2;
+                                       else if (row == 1)
+                                               row = vp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 120:
+                                       row = (!row) ? vp->nrows - 1 : row - 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       row = (!row) ? vp->nrows - 1 : row - 1;
+                                       break;
+                               case 180:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (!col) ? vp->ncols - 1 : col - 1;
+                                       row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 240:
+                                       row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (row + 1 == vp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == vp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 300:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       if (row + 1 == vp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == vp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (col + 1 == vp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == vp->nrows) ? 0 : row + 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               }
+       }
+
+       return vp->arr[row * vp->ncols + col];
+}
+
+static void
+advanceColors(ModeInfo * mi, int col, int row)
+{
+       voterstruct *vp = &voters[MI_SCREEN(mi)];
+       CellList   *curr;
+
+       curr = vp->first->next;
+       while (curr != vp->last) {
+               if (curr->info.col == col && curr->info.row == row) {
+                       curr = curr->next;
+                       removefrom_list(curr->previous);
+               } else {
+                       if (curr->info.age > 0)
+                               curr->info.age--;
+                       else if (curr->info.age < 0)
+                               curr->info.age++;
+                       drawcell(mi, curr->info.col, curr->info.row,
+                                (MI_NPIXELS(mi) + curr->info.age / FACTOR +
+                                 (MI_NPIXELS(mi) * curr->info.kind / BITMAPS)) % MI_NPIXELS(mi),
+                                curr->info.kind, False);
+                       if (curr->info.age == 0) {
+                               curr = curr->next;
+                               removefrom_list(curr->previous);
+                       } else
+                               curr = curr->next;
+               }
+       }
+}
+
+void
+refresh_voters(ModeInfo * mi)
+{
+       int         col, row, colrow;
+       voterstruct *vp;
+
+       if (voters == NULL)
+               return;
+       vp = &voters[MI_SCREEN(mi)];
+       if (vp->first == NULL)
+               return;
+
+       if (vp->painted) {
+               MI_CLEARWINDOW(mi);
+               vp->painted = False;
+               for (row = 0; row < vp->nrows; row++)
+                       for (col = 0; col < vp->ncols; col++) {
+                               colrow = col + row * vp->ncols;
+                               /* Draw all old, will get corrected soon if wrong... */
+                               drawcell(mi, col, row,
+                                        (unsigned long) (MI_NPIXELS(mi) * vp->arr[colrow] / BITMAPS),
+                                        vp->arr[colrow], False);
+                       }
+       }
+}
+
+static void
+free_voters(voterstruct *vp)
+{
+       if (vp->first != NULL) {
+               flush_list(vp);
+               (void) free((void *) vp->first);
+               vp->first = NULL;
+       }
+       if (vp->last != NULL) {
+               (void) free((void *) vp->last);
+               vp->last = NULL;
+       }
+       if (vp->arr != NULL) {
+               (void) free((void *) vp->arr);
+               vp->arr = NULL;
+       }
+}
+
+void
+init_voters(ModeInfo * mi)
+{
+       int         size = MI_SIZE(mi);
+       int         i, col, row, colrow;
+       voterstruct *vp;
+
+       if (voters == NULL) {
+               if ((voters = (voterstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (voterstruct))) == NULL)
+                       return;
+       }
+       vp = &voters[MI_SCREEN(mi)];
+
+       vp->generation = 0;
+       if (!vp->first) {       /* Genesis of democracy */
+               icon_width = donkey_width;
+               icon_height = donkey_height;
+               if (!init_list(vp)) {
+                       free_voters(vp);
+                       return;
+               }
+               for (i = 0; i < BITMAPS; i++) {
+                       logo[i].width = icon_width;
+                       logo[i].height = icon_height;
+                       logo[i].bytes_per_line = (icon_width + 7) / 8;
+               }
+       } else                  /* Exterminate all free thinking individuals */
+               flush_list(vp);
+
+       vp->width = MI_WIDTH(mi);
+       vp->height = MI_HEIGHT(mi);
+
+       for (i = 0; i < NEIGHBORKINDS; i++) {
+               if (neighbors == plots[i]) {
+                       vp->neighbors = neighbors;
+                       break;
+               }
+               if (i == NEIGHBORKINDS - 1) {
+#if 0
+                       vp->neighbors = plots[NRAND(NEIGHBORKINDS)];
+                       vp->neighbors = (LRAND() & 1) ? 4 : 8;
+#else
+                       vp->neighbors = 8;
+#endif
+                       break;
+               }
+       }
+
+       if (vp->neighbors == 6) {
+               int         nccols, ncrows, sides;
+
+               if (vp->width < 2)
+                       vp->width = 2;
+               if (vp->height < 4)
+                       vp->height = 4;
+               if (size < -MINSIZE)
+                       vp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(vp->width, vp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               vp->ys = MAX(MINSIZE, MIN(vp->width, vp->height) / MINGRIDSIZE);
+                       else
+                               vp->ys = MINSIZE;
+               } else
+                       vp->ys = MIN(size, MAX(MINSIZE, MIN(vp->width, vp->height) /
+                                              MINGRIDSIZE));
+               vp->xs = vp->ys;
+               vp->pixelmode = True;
+               nccols = MAX(vp->width / vp->xs - 2, 2);
+               ncrows = MAX(vp->height / vp->ys - 1, 2);
+               vp->ncols = nccols / 2;
+               vp->nrows = 2 * (ncrows / 4);
+               vp->xb = (vp->width - vp->xs * nccols) / 2 + vp->xs / 2;
+               vp->yb = (vp->height - vp->ys * (ncrows / 2) * 2) / 2 + vp->ys - 2;
+               for (sides = 0; sides < 6; sides++) {
+                       vp->hexagonList[sides].x = (vp->xs - 1) * hexagonUnit[sides].x;
+                       vp->hexagonList[sides].y =
+                               ((vp->ys - 1) * hexagonUnit[sides].y / 2) * 4 / 3;
+               }
+       } else if (vp->neighbors == 4 || vp->neighbors == 8) {
+               if (vp->width < 2)
+                       vp->width = 2;
+               if (vp->height < 2)
+                       vp->height = 2;
+               if (size == 0 ||
+                   MINGRIDSIZE * size > vp->width || MINGRIDSIZE * size > vp->height) {
+                       if (vp->width > MINGRIDSIZE * icon_width &&
+                           vp->height > MINGRIDSIZE * icon_height) {
+                               vp->pixelmode = False;
+                               vp->xs = icon_width;
+                               vp->ys = icon_height;
+                       } else {
+                               vp->pixelmode = True;
+                               vp->xs = vp->ys = MAX(MINSIZE, MIN(vp->width, vp->height) /
+                                                     MINGRIDSIZE);
+                       }
+               } else {
+                       vp->pixelmode = True;
+                       if (size < -MINSIZE)
+                               vp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(vp->width, vp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+                       else if (size < MINSIZE)
+                               vp->ys = MINSIZE;
+                       else
+                               vp->ys = MIN(size, MAX(MINSIZE, MIN(vp->width, vp->height) /
+                                                      MINGRIDSIZE));
+                       vp->xs = vp->ys;
+               }
+               vp->ncols = MAX(vp->width / vp->xs, 2);
+               vp->nrows = MAX(vp->height / vp->ys, 2);
+               vp->xb = (vp->width - vp->xs * vp->ncols) / 2;
+               vp->yb = (vp->height - vp->ys * vp->nrows) / 2;
+       } else {                /* TRI */
+               int         orient, sides;
+
+               if (vp->width < 2)
+                       vp->width = 2;
+               if (vp->height < 2)
+                       vp->height = 2;
+               if (size < -MINSIZE)
+                       vp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(vp->width, vp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               vp->ys = MAX(MINSIZE, MIN(vp->width, vp->height) / MINGRIDSIZE);
+                       else
+                               vp->ys = MINSIZE;
+               } else
+                       vp->ys = MIN(size, MAX(MINSIZE, MIN(vp->width, vp->height) /
+                                              MINGRIDSIZE));
+               vp->xs = (int) (1.52 * vp->ys);
+               vp->pixelmode = True;
+               vp->ncols = (MAX(vp->width / vp->xs - 1, 2) / 2) * 2;
+               vp->nrows = (MAX(vp->height / vp->ys - 1, 2) / 2) * 2;
+               vp->xb = (vp->width - vp->xs * vp->ncols) / 2 + vp->xs / 2;
+               vp->yb = (vp->height - vp->ys * vp->nrows) / 2 + vp->ys / 2;
+               for (orient = 0; orient < 2; orient++) {
+                       for (sides = 0; sides < 3; sides++) {
+                               vp->triangleList[orient][sides].x =
+                                       (vp->xs - 2) * triangleUnit[orient][sides].x;
+                               vp->triangleList[orient][sides].y =
+                                       (vp->ys - 2) * triangleUnit[orient][sides].y;
+                       }
+               }
+       }
+
+       vp->npositions = vp->ncols * vp->nrows;
+       if (vp->arr != NULL)
+               (void) free((void *) vp->arr);
+       if ((vp->arr = (char *) calloc(vp->npositions, sizeof (char))) == NULL) {
+               free_voters(vp);
+               return;
+       }
+
+       /* Play G-d with these numbers */
+       vp->nparties = MI_COUNT(mi);
+       if (vp->nparties < MINPARTIES || vp->nparties > BITMAPS)
+               vp->nparties = NRAND(BITMAPS - MINPARTIES + 1) + MINPARTIES;
+       if (vp->pixelmode)
+               vp->nparties = 2;
+
+       vp->busyLoop = 0;
+       MI_CLEARWINDOW(mi);
+       vp->painted = False;
+
+       for (i = 0; i < BITMAPS; i++)
+               vp->number_in_party[i] = 0;
+
+       for (row = 0; row < vp->nrows; row++)
+               for (col = 0; col < vp->ncols; col++) {
+                       colrow = col + row * vp->ncols;
+                       i = NRAND(vp->nparties) + (vp->nparties == 2);
+                       vp->arr[colrow] = (char) i;
+                       drawcell(mi, col, row, (unsigned long) (MI_NPIXELS(mi) * i / BITMAPS),
+                                i, False);
+                       vp->number_in_party[i]++;
+               }
+}
+
+void
+draw_voters(ModeInfo * mi)
+{
+       int         i, spineless_dude, neighbor_direction;
+       int         spineless_col, spineless_row;
+       int         new_opinion, old_opinion;
+       cellstruct  info;
+       voterstruct *vp;
+
+       if (voters == NULL)
+               return;
+       vp = &voters[MI_SCREEN(mi)];
+       if (vp->first == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       vp->painted = True;
+       if (vp->busyLoop) {
+               if (vp->busyLoop >= 5000)
+                       vp->busyLoop = 0;
+               else
+                       vp->busyLoop++;
+               return;
+       }
+       for (i = 0; i < BITMAPS; i++)
+               if (vp->number_in_party[i] == vp->npositions) {         /* The End of the WORLD */
+                       init_voters(mi);        /* Create a more interesting planet */
+               }
+       spineless_dude = NRAND(vp->npositions);
+       neighbor_direction = NRAND(vp->neighbors) * 360 / vp->neighbors;
+       spineless_col = spineless_dude % vp->ncols;
+       spineless_row = spineless_dude / vp->ncols;
+       old_opinion = vp->arr[spineless_dude];
+       new_opinion = neighbors_opinion(vp, spineless_col, spineless_row,
+                                       neighbor_direction);
+       if (old_opinion != new_opinion) {
+               vp->number_in_party[old_opinion]--;
+               vp->number_in_party[new_opinion]++;
+               vp->arr[spineless_dude] = new_opinion;
+               info.kind = new_opinion;
+               info.age = (old_opinion - new_opinion);
+               if (info.age == 2)
+                       info.age = -1;
+               if (info.age == -2)
+                       info.age = 1;
+               info.age *= (FACTOR * MI_NPIXELS(mi)) / 3;
+               info.col = spineless_col;
+               info.row = spineless_row;
+               if (MI_NPIXELS(mi) > 2) {
+                       advanceColors(mi, spineless_col, spineless_row);
+                       if (!addto_list(vp, info)) {
+                               free_voters(vp);
+                               return;
+                       }
+               }
+               drawcell(mi, spineless_col, spineless_row,
+                        (MI_NPIXELS(mi) + info.age / FACTOR +
+                 (MI_NPIXELS(mi) * new_opinion / BITMAPS)) % MI_NPIXELS(mi),
+                        new_opinion, True);
+       } else if (MI_NPIXELS(mi) > 2)
+               advanceColors(mi, -1, -1);
+       vp->generation++;
+       for (i = 0; i < BITMAPS; i++)
+               if (vp->number_in_party[i] == vp->npositions) {         /* The End of the WORLD */
+                       vp->busyLoop = 1;
+                       refresh_voters(mi);
+               }
+}
+
+void
+release_voters(ModeInfo * mi)
+{
+       if (voters != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_voters(&voters[screen]);
+               (void) free((void *) voters);
+               voters = NULL;
+       }
+}
+
+#endif /* MODE_voters */
diff --git a/modes/wator.c b/modes/wator.c
new file mode 100644 (file)
index 0000000..91e1f47
--- /dev/null
@@ -0,0 +1,1042 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* wator --- Dewdney's Wa-Tor, water torus simulation */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)wator.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1994 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 29-Aug-1995: Efficiency improvements.
+ * 12-Dec-1994: Coded from A.K. Dewdney's "The Armchair Universe, Computer
+ *              Recreations from the Pages of Scientific American Magazine"
+ *              W.H. Freedman and Company, New York, 1988  (Dec 1984 and
+ *              June 1985) also used life.c as a guide.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Wator"
+#define HACK_INIT init_wator
+#define HACK_DRAW draw_wator
+#define wator_opts xlockmore_opts
+#define DEFAULTS "*delay: 750000 \n" \
+ "*cycles: 32767 \n" \
+ "*size: 0 \n" \
+ "*ncolors: 200 \n" \
+ "*neighbors: 0 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_wator
+
+/*-
+ * neighbors of 0 randomizes it between 3, 4, 6, 8, 9, and 12.
+ */
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+
+static int  neighbors;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".wator.neighbors", XrmoptionSepArg, (caddr_t) NULL}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int
+}
+};
+
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3, 9 or 12"}
+};
+
+ModeSpecOpt wator_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   wator_description =
+{"wator", "init_wator", "draw_wator", "release_wator",
+ "refresh_wator", "init_wator", NULL, &wator_opts,
+ 750000, 1, 32767, 0, 64, 1.0, "",
+ "Shows Dewdney's Water-Torus planet of fish and sharks", 0, NULL};
+
+#endif
+
+#include "bitmaps/fish-0.xbm"
+#include "bitmaps/fish-1.xbm"
+#include "bitmaps/fish-2.xbm"
+#include "bitmaps/fish-3.xbm"
+#include "bitmaps/fish-4.xbm"
+#include "bitmaps/fish-5.xbm"
+#include "bitmaps/fish-6.xbm"
+#include "bitmaps/fish-7.xbm"
+#include "bitmaps/shark-0.xbm"
+#include "bitmaps/shark-1.xbm"
+#include "bitmaps/shark-2.xbm"
+#include "bitmaps/shark-3.xbm"
+#include "bitmaps/shark-4.xbm"
+#include "bitmaps/shark-5.xbm"
+#include "bitmaps/shark-6.xbm"
+#include "bitmaps/shark-7.xbm"
+
+#define FISH 0
+#define SHARK 1
+#define KINDS 2
+#define ORIENTS 4
+#define REFLECTS 2
+#define BITMAPS (ORIENTS*REFLECTS*KINDS)
+#define KINDBITMAPS (ORIENTS*REFLECTS)
+#define MINGRIDSIZE 10         /* It is possible for the fish to take over with 3 */
+#define MINSIZE 4
+#define NEIGHBORKINDS 6
+
+static XImage logo[BITMAPS] =
+{
+       {0, 0, 0, XYBitmap, (char *) fish0_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, (char *) fish1_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, (char *) fish2_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, (char *) fish3_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, (char *) fish4_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, (char *) fish5_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, (char *) fish6_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {0, 0, 0, XYBitmap, (char *) fish7_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark0_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark1_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark2_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark3_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark4_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark5_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark6_bits, LSBFirst, 8, LSBFirst, 8, 1},
+      {0, 0, 0, XYBitmap, (char *) shark7_bits, LSBFirst, 8, LSBFirst, 8, 1},
+};
+
+/* Fish and shark data */
+typedef struct {
+       char        kind, age, food, direction;
+       unsigned long color;
+       int         col, row;
+} cellstruct;
+
+/* Doublely linked list */
+typedef struct _CellList {
+       cellstruct  info;
+       struct _CellList *previous, *next;
+} CellList;
+
+typedef struct {
+       Bool        painted;
+       int         nkind[KINDS];       /* Number of fish and sharks */
+       int         breed[KINDS];       /* Breeding time of fish and sharks */
+       int         sstarve;    /* Time the sharks starve if they dont find a fish */
+       int         kind;       /* Currently working on fish or sharks? */
+       int         xs, ys;     /* Size of fish and sharks */
+       int         xb, yb;     /* Bitmap offset for fish and sharks */
+       int         pixelmode;
+       int         generation;
+       int         ncols, nrows, positions;
+       int         width, height;
+       CellList   *currkind, *babykind, *lastkind[KINDS + 1], *firstkind[KINDS + 1];
+       CellList  **arr;        /* 0=empty or pts to a fish or shark */
+       int         neighbors;
+       union {
+               XPoint      hexagon[6];
+               XPoint      triangle[2][3];
+       } shape;
+} watorstruct;
+
+static char plots[NEIGHBORKINDS] =
+{
+       3, 4, 6, 8, 9, 12       /* Neighborhoods */
+};
+
+static watorstruct *wators = NULL;
+static int  icon_width, icon_height;
+
+#if 0
+/*-
+ * shape either a bitmap or 0 for circle and 1 for polygon
+ * (if triangle shape:  -1, 0, 2 or 3 to differentiate left and right)
+ */
+drawshape(ModeInfo * mi, int x, int y, int sizex, int sizey,
+         int sides, int shape)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+
+       if (sides == 4 && sizex == 0 && sizey == 0) {
+               (void) XPutImage(display, window, gc, &logo[shape], 0, 0,
+               x - icon_width, y - icon_height / 2, icon_width, icon_height);
+       } else if (sizex < 3 || sizey < 3 || (sides == 4 && shape == 1)) {
+               XFillRectangle(display, window, gc,
+                       x - sizex / 2, y - sizey / 2,
+                       sizex - (sizey > 3), sizey - (sizey > 3));
+       } else if (sides == 4 && shape == 0) {
+       } else if (sides == 6 && shape == 1) {
+       } else if (sides == 6 && shape == 0) {
+       } else if (sides == 3 && shape == 1) {
+       } else if (sides == 3 && shape == 2) {
+       } else if (sides == 3 && shape == -1) {
+       } else if (sides == 3 && shape == 0) {
+       }
+}
+#endif
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned long color, int bitmap,
+        Bool alive)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       watorstruct *wp = &wators[MI_SCREEN(mi)];
+       unsigned long colour;
+
+       if (!alive)
+               colour = MI_BLACK_PIXEL(mi);
+       else if (MI_NPIXELS(mi) > 2)
+               colour = MI_PIXEL(mi, color);
+       else
+               colour = MI_WHITE_PIXEL(mi);
+       XSetForeground(display, gc, colour);
+       if (wp->neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               wp->shape.hexagon[0].x = wp->xb + ccol * wp->xs;
+               wp->shape.hexagon[0].y = wp->yb + crow * wp->ys;
+               if (wp->xs == 1 && wp->ys == 1)
+                       XDrawPoint(display, window, gc,
+                       wp->shape.hexagon[0].x, wp->shape.hexagon[0].y);
+               else if (bitmap >= KINDBITMAPS || !alive)
+                       XFillPolygon(display, window, gc,
+                           wp->shape.hexagon, 6, Convex, CoordModePrevious);
+               else {
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                       XFillPolygon(display, window, gc,
+                           wp->shape.hexagon, 6, Convex, CoordModePrevious);
+                       XSetForeground(display, gc, colour);
+                       if (wp->xs <= 6 || wp->ys <= 2)
+                               XFillRectangle(display, window, gc,
+                                    wp->shape.hexagon[0].x - 3 * wp->xs / 4,
+                                    wp->shape.hexagon[0].y + wp->ys / 4, wp->xs, wp->ys);
+                       else
+                               XFillArc(display, window, gc,
+                                    wp->xb + wp->xs * ccol - 3 * wp->xs / 4,
+                                        wp->yb + wp->ys * crow + wp->ys / 4,
+                                        2 * wp->xs - 6, 2 * wp->ys - 2,
+                                        0, 23040);
+               }
+       } else if (wp->neighbors == 4 || wp->neighbors == 8) {
+               if (wp->pixelmode) {
+                       if (bitmap >= KINDBITMAPS || (wp->xs <= 2 || wp->ys <= 2) || !alive)
+                               XFillRectangle(display, window, gc,
+                               wp->xb + wp->xs * col, wp->yb + wp->ys * row,
+                               wp->xs - (wp->xs > 3), wp->ys - (wp->ys > 3));
+                       else {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XFillRectangle(display, window, gc,
+                               wp->xb + wp->xs * col, wp->yb + wp->ys * row,
+                                              wp->xs, wp->ys);
+                               XSetForeground(display, gc, colour);
+                               XFillArc(display, window, gc,
+                                        wp->xb + wp->xs * col, wp->yb + wp->ys * row,
+                                        wp->xs - 1, wp->ys - 1,
+                                        0, 23040);
+                       }
+               } else
+                       (void) XPutImage(display, window, gc,
+                                        &logo[bitmap], 0, 0,
+                               wp->xb + wp->xs * col, wp->yb + wp->ys * row,
+                                        icon_width, icon_height);
+       } else {                /* TRI */
+               int         orient = (col + row) % 2;   /* O left 1 right */
+
+               wp->shape.triangle[orient][0].x = wp->xb + col * wp->xs;
+               wp->shape.triangle[orient][0].y = wp->yb + row * wp->ys;
+               if (wp->xs <= 3 || wp->ys <= 3)
+                       XDrawPoint(display, window, gc,
+                       ((orient) ? -1 : 1) + wp->shape.triangle[orient][0].x,
+                                      wp->shape.triangle[orient][0].y);
+               else {
+                       if (orient)
+                               wp->shape.triangle[orient][0].x += (wp->xs / 2 - 1);
+                       else
+                               wp->shape.triangle[orient][0].x -= (wp->xs / 2 - 1);
+                       if (bitmap >= KINDBITMAPS || !alive)
+                               XFillPolygon(display, window, gc,
+                                            wp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+                       else {
+                               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+                               XFillPolygon(display, window, gc,
+                                            wp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+                               XSetForeground(display, gc, colour);
+                               XFillArc(display, window, gc,
+                                    wp->xb + wp->xs * col - 4 * wp->xs / 5 +
+                                   ((orient) ? wp->xs / 3 : 3 * wp->xs / 5),
+                                        wp->yb + wp->ys * row - wp->ys / 2 + 1, wp->ys - 3, wp->ys - 3,
+                                        0, 23040);
+                       }
+               }
+       }
+}
+
+static Bool
+init_kindlist(watorstruct * wp, int kind)
+{
+       /* Waste some space at the beginning and end of list
+          so we do not have to complicated checks against falling off the ends. */
+       if (((wp->lastkind[kind] = (CellList *) malloc(sizeof (CellList))) ==
+                       NULL) ||
+           ((wp->firstkind[kind] = (CellList *) malloc(sizeof (CellList))) ==
+                        NULL)) {
+               return False;
+       }
+       wp->firstkind[kind]->previous = wp->lastkind[kind]->next = NULL;
+       wp->firstkind[kind]->next = wp->lastkind[kind]->previous = NULL;
+       wp->firstkind[kind]->next = wp->lastkind[kind];
+       wp->lastkind[kind]->previous = wp->firstkind[kind];
+       return True;
+}
+
+static Bool
+addto_kindlist(watorstruct * wp, int kind, cellstruct info)
+{
+       if ((wp->currkind = (CellList *) malloc(sizeof (CellList))) == NULL) {
+               return False;
+       }
+       wp->lastkind[kind]->previous->next = wp->currkind;
+       wp->currkind->previous = wp->lastkind[kind]->previous;
+       wp->currkind->next = wp->lastkind[kind];
+       wp->lastkind[kind]->previous = wp->currkind;
+       wp->currkind->info = info;
+       return True;
+}
+
+static void
+removefrom_kindlist(watorstruct * wp, CellList * ptr)
+{
+       ptr->previous->next = ptr->next;
+       ptr->next->previous = ptr->previous;
+       wp->arr[ptr->info.col + ptr->info.row * wp->ncols] = 0;
+       (void) free((void *) ptr);
+}
+
+static Bool
+dupin_kindlist(watorstruct * wp)
+{
+       CellList   *temp;
+
+       if ((temp = (CellList *) malloc(sizeof (CellList))) == NULL) {
+               return False;
+       }
+       temp->previous = wp->babykind;
+       temp->next = wp->babykind->next;
+       wp->babykind->next = temp;
+       temp->next->previous = temp;
+       temp->info = wp->babykind->info;
+       wp->babykind = temp;
+       return True;
+}
+
+/*-
+ * new fish at end of list, this rotates who goes first, young fish go last
+ * this most likely will not change the feel to any real degree
+ */
+static void
+cutfrom_kindlist(watorstruct * wp)
+{
+       wp->babykind = wp->currkind;
+       wp->currkind = wp->currkind->previous;
+       wp->currkind->next = wp->babykind->next;
+       wp->babykind->next->previous = wp->currkind;
+       wp->babykind->next = wp->lastkind[KINDS];
+       wp->babykind->previous = wp->lastkind[KINDS]->previous;
+       wp->babykind->previous->next = wp->babykind;
+       wp->babykind->next->previous = wp->babykind;
+}
+
+static void
+reattach_kindlist(watorstruct * wp, int kind)
+{
+       wp->currkind = wp->lastkind[kind]->previous;
+       wp->currkind->next = wp->firstkind[KINDS]->next;
+       wp->currkind->next->previous = wp->currkind;
+       wp->lastkind[kind]->previous = wp->lastkind[KINDS]->previous;
+       wp->lastkind[KINDS]->previous->next = wp->lastkind[kind];
+       wp->lastkind[KINDS]->previous = wp->firstkind[KINDS];
+       wp->firstkind[KINDS]->next = wp->lastkind[KINDS];
+}
+
+static void
+flush_kindlist(watorstruct * wp, int kind)
+{
+       while (wp->lastkind[kind]->previous != wp->firstkind[kind]) {
+               wp->currkind = wp->lastkind[kind]->previous;
+               wp->currkind->previous->next = wp->lastkind[kind];
+               wp->lastkind[kind]->previous = wp->currkind->previous;
+               /* wp->arr[wp->currkind->info.col + wp->currkind->info.row * wp->ncols] = 0; */
+               (void) free((void *) wp->currkind);
+       }
+}
+
+static int
+neighbor_position(watorstruct * wp, int col, int row, int dir)
+{
+       if (wp->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                               break;
+                       case 60:
+                               if (!(row & 1))
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                               row = (!row) ? wp->nrows - 1 : row - 1;
+                               break;
+                       case 120:
+                               if (row & 1)
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                               row = (!row) ? wp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? wp->ncols - 1 : col - 1;
+                               break;
+                       case 240:
+                               if (row & 1)
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                               row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                               break;
+                       case 300:
+                               if (!(row & 1))
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (wp->neighbors == 4 || wp->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                               break;
+                       case 45:
+                               col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                               row = (!row) ? wp->nrows - 1 : row - 1;
+                               break;
+                       case 90:
+                               row = (!row) ? wp->nrows - 1 : row - 1;
+                               break;
+                       case 135:
+                               col = (!col) ? wp->ncols - 1 : col - 1;
+                               row = (!row) ? wp->nrows - 1 : row - 1;
+                               break;
+                       case 180:
+                               col = (!col) ? wp->ncols - 1 : col - 1;
+                               break;
+                       case 225:
+                               col = (!col) ? wp->ncols - 1 : col - 1;
+                               row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                               break;
+                       case 270:
+                               row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                               break;
+                       case 315:
+                               col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                               row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               if ((col + row) % 2) {  /* right */
+                       switch (dir) {
+                               case 0:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 60:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       if (row + 1 == wp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == wp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (row + 1 == wp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == wp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 120:
+                                       row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 180:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? wp->nrows - 1 : row - 1;
+                                       break;
+                               case 240:
+                                       row = (!row) ? wp->nrows - 1 : row - 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (!row)
+                                               row = wp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = wp->nrows - 1;
+                                       else
+                                               row = row - 2;
+
+                                       break;
+                               case 300:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       if (!row)
+                                               row = wp->nrows - 2;
+                                       else if (!(row - 1))
+                                               row = wp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       row = (!row) ? wp->nrows - 1 : row - 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               } else {        /* left */
+                       switch (dir) {
+                               case 0:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       row = (!row) ? wp->nrows - 1 : row - 1;
+                                       break;
+                               case 60:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       if (!row)
+                                               row = wp->nrows - 2;
+                                       else if (row == 1)
+                                               row = wp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       if (!row)
+                                               row = wp->nrows - 2;
+                                       else if (row == 1)
+                                               row = wp->nrows - 1;
+                                       else
+                                               row = row - 2;
+                                       break;
+                               case 120:
+                                       row = (!row) ? wp->nrows - 1 : row - 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       row = (!row) ? wp->nrows - 1 : row - 1;
+                                       break;
+                               case 180:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = (!col) ? wp->ncols - 1 : col - 1;
+                                       row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 240:
+                                       row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       if (row + 1 == wp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == wp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 300:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       if (row + 1 == wp->nrows)
+                                               row = 1;
+                                       else if (row + 2 == wp->nrows)
+                                               row = 0;
+                                       else
+                                               row = row + 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = (col + 1 == wp->ncols) ? 0 : col + 1;
+                                       row = (row + 1 == wp->nrows) ? 0 : row + 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               }
+       }
+       return row * wp->ncols + col;
+}
+
+static void
+free_wator(watorstruct *wp)
+{
+       int kind;
+
+       for (kind = 0; kind <= KINDS; kind++) {
+               if (wp->firstkind[kind] != NULL) {
+                       flush_kindlist(wp, kind);
+                       (void) free((void *) wp->firstkind[kind]);
+                       wp->firstkind[kind] = NULL;
+               }
+               if (wp->lastkind[kind] != NULL) {
+                       (void) free((void *) wp->lastkind[kind]);
+                       wp->lastkind[kind] = NULL;
+               }
+       }
+       if (wp->arr != NULL) {
+               (void) free((void *) wp->arr);
+               wp->arr = NULL;
+       }
+}
+
+void
+init_wator(ModeInfo * mi)
+{
+       int         size = MI_SIZE(mi);
+       int         i, col, row, colrow, kind;
+       cellstruct  info;
+       watorstruct *wp;
+
+       if (wators == NULL) {
+               if ((wators = (watorstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (watorstruct))) == NULL)
+                       return;
+       }
+       wp = &wators[MI_SCREEN(mi)];
+
+       wp->generation = 0;
+       if (!wp->firstkind[0]) {        /* Genesis */
+               icon_width = fish0_width;
+               icon_height = fish0_height;
+               /* Set up what will be a 'triply' linked list.
+                  doubly linked list, doubly linked to an array */
+               for (kind = FISH; kind <= KINDS; kind++)
+                       if (!init_kindlist(wp, kind)) {
+                               free_wator(wp);
+                               return;
+                       }
+               for (i = 0; i < BITMAPS; i++) {
+                       logo[i].width = icon_width;
+                       logo[i].height = icon_height;
+                       logo[i].bytes_per_line = (icon_width + 7) / 8;
+               }
+       } else                  /* Exterminate all  */
+               for (i = FISH; i <= KINDS; i++)
+                       flush_kindlist(wp, i);
+
+       wp->width = MI_WIDTH(mi);
+       wp->height = MI_HEIGHT(mi);
+       if (wp->width < 2)
+               wp->width = 2;
+       if (wp->height < 2)
+               wp->height = 2;
+
+       for (i = 0; i < NEIGHBORKINDS; i++) {
+               if (neighbors == plots[i]) {
+                       wp->neighbors = neighbors;
+                       break;
+               }
+               if (i == NEIGHBORKINDS - 1) {
+#if 0
+                       wp->neighbors = plots[NRAND(NEIGHBORKINDS)];
+                       wp->neighbors = (LRAND() & 1) ? 4 : 8;
+#else
+                       wp->neighbors = 4;
+#endif
+                       break;
+               }
+       }
+
+       if (wp->neighbors == 6) {
+               int         nccols, ncrows, sides;
+
+               if (wp->width < 2)
+                       wp->width = 2;
+               if (wp->height < 4)
+                       wp->height = 4;
+               if (size < -MINSIZE)
+                       wp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               wp->ys = MAX(MINSIZE, MIN(wp->width, wp->height) / MINGRIDSIZE);
+                       else
+                               wp->ys = MINSIZE;
+               } else
+                       wp->ys = MIN(size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                              MINGRIDSIZE));
+               wp->xs = wp->ys;
+               wp->pixelmode = True;
+               nccols = MAX(wp->width / wp->xs - 2, 2);
+               ncrows = MAX(wp->height / wp->ys - 1, 2);
+               wp->ncols = nccols / 2;
+               wp->nrows = 2 * (ncrows / 4);
+               wp->xb = (wp->width - wp->xs * nccols) / 2 + wp->xs / 2;
+               wp->yb = (wp->height - wp->ys * (ncrows / 2) * 2) / 2 + wp->ys - 2;
+               for (sides = 0; sides < 6; sides++) {
+                       wp->shape.hexagon[sides].x = (wp->xs - 1) * hexagonUnit[sides].x;
+                       wp->shape.hexagon[sides].y =
+                               ((wp->ys - 1) * hexagonUnit[sides].y / 2) * 4 / 3;
+               }
+       } else if (wp->neighbors == 4 || wp->neighbors == 8) {
+               if (wp->width < 2)
+                       wp->width = 2;
+               if (wp->height < 2)
+                       wp->height = 2;
+               if (size == 0 ||
+                   MINGRIDSIZE * size > wp->width || MINGRIDSIZE * size > wp->height) {
+                       if (wp->width > MINGRIDSIZE * icon_width &&
+                           wp->height > MINGRIDSIZE * icon_height) {
+                               wp->pixelmode = False;
+                               wp->xs = icon_width;
+                               wp->ys = icon_height;
+                       } else {
+                               wp->pixelmode = True;
+                               wp->xs = wp->ys = MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                                     MINGRIDSIZE);
+                       }
+               } else {
+                       wp->pixelmode = True;
+                       if (size < -MINSIZE)
+                               wp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+                       else if (size < MINSIZE)
+                               wp->ys = MINSIZE;
+                       else
+                               wp->ys = MIN(size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                                      MINGRIDSIZE));
+                       wp->xs = wp->ys;
+               }
+               wp->ncols = MAX(wp->width / wp->xs, 2);
+               wp->nrows = MAX(wp->height / wp->ys, 2);
+               wp->xb = (wp->width - wp->xs * wp->ncols) / 2;
+               wp->yb = (wp->height - wp->ys * wp->nrows) / 2;
+       } else {                /* TRI */
+               int         orient, sides;
+
+               if (wp->width < 2)
+                       wp->width = 2;
+               if (wp->height < 2)
+                       wp->height = 2;
+               if (size < -MINSIZE)
+                       wp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               wp->ys = MAX(MINSIZE, MIN(wp->width, wp->height) / MINGRIDSIZE);
+                       else
+                               wp->ys = MINSIZE;
+               } else
+                       wp->ys = MIN(size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                              MINGRIDSIZE));
+               wp->xs = (int) (1.52 * wp->ys);
+               wp->pixelmode = True;
+               wp->ncols = (MAX(wp->width / wp->xs - 1, 2) / 2) * 2;
+               wp->nrows = (MAX(wp->height / wp->ys - 1, 2) / 2) * 2;
+               wp->xb = (wp->width - wp->xs * wp->ncols) / 2 + wp->xs / 2;
+               wp->yb = (wp->height - wp->ys * wp->nrows) / 2 + wp->ys / 2;
+               for (orient = 0; orient < 2; orient++) {
+                       for (sides = 0; sides < 3; sides++) {
+                               wp->shape.triangle[orient][sides].x =
+                                       (wp->xs - 2) * triangleUnit[orient][sides].x;
+                               wp->shape.triangle[orient][sides].y =
+                                       (wp->ys - 2) * triangleUnit[orient][sides].y;
+                       }
+               }
+       }
+
+       wp->positions = wp->ncols * wp->nrows;
+
+       if (wp->arr != NULL)
+               (void) free((void *) wp->arr);
+       if ((wp->arr = (CellList **) calloc(wp->positions,
+                       sizeof (CellList *))) == NULL) {
+               free_wator(wp);
+               return;
+       }
+
+       /* Play G-d with these numbers */
+       wp->nkind[FISH] = wp->positions / 3;
+       wp->nkind[SHARK] = wp->nkind[FISH] / 10;
+       wp->kind = FISH;
+       if (!wp->nkind[SHARK])
+               wp->nkind[SHARK] = 1;
+       wp->breed[FISH] = MI_COUNT(mi);
+       wp->breed[SHARK] = 10;
+       if (wp->breed[FISH] < 1)
+               wp->breed[FISH] = 1;
+       else if (wp->breed[FISH] > wp->breed[SHARK])
+               wp->breed[FISH] = 4;
+       wp->sstarve = 3;
+
+       MI_CLEARWINDOW(mi);
+       wp->painted = False;
+
+       for (kind = FISH; kind <= SHARK; kind++) {
+               i = 0;
+               while (i < wp->nkind[kind]) {
+                       col = NRAND(wp->ncols);
+                       row = NRAND(wp->nrows);
+                       colrow = col + row * wp->ncols;
+                       if (!wp->arr[colrow]) {
+                               i++;
+                               info.kind = kind;
+                               info.age = NRAND(wp->breed[kind]);
+                               info.food = NRAND(wp->sstarve);
+                               info.direction = NRAND(KINDBITMAPS) + kind * KINDBITMAPS;
+                               if (MI_NPIXELS(mi) > 2)
+                                       info.color = NRAND(MI_NPIXELS(mi));
+                               else
+                                       info.color = 0;
+                               info.col = col;
+                               info.row = row;
+                               if (!addto_kindlist(wp, kind, info)) {
+                                       free_wator(wp);
+                                       return;
+                               }
+                               wp->arr[colrow] = wp->currkind;
+                               drawcell(mi, col, row,
+                                        wp->currkind->info.color, wp->currkind->info.direction, True);
+                       }
+               }
+       }
+}
+
+void
+draw_wator(ModeInfo * mi)
+{
+       int         col, row;
+       int         colrow, cr, position;
+       int         i, numok;
+       struct {
+               int         pos, dir;
+       } acell[12];
+       watorstruct *wp;
+
+       if (wators == NULL)
+               return;
+       wp = &wators[MI_SCREEN(mi)];
+       if (wp->arr == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+       wp->painted = True;
+       /* Alternate updates, fish and sharks live out of phase with each other */
+       wp->kind = (wp->kind + 1) % KINDS;
+       {
+               wp->currkind = wp->firstkind[wp->kind]->next;
+
+               while (wp->currkind != wp->lastkind[wp->kind]) {
+                       col = wp->currkind->info.col;
+                       row = wp->currkind->info.row;
+                       colrow = col + row * wp->ncols;
+                       numok = 0;
+                       if (wp->kind == SHARK) {        /* Scan for fish */
+                               for (i = 0; i < wp->neighbors; i++) {
+                                       position = neighbor_position(wp, col, row, i * 360 / wp->neighbors);
+                                       if (wp->arr[position] && wp->arr[position]->info.kind == FISH) {
+                                               acell[numok].pos = position;
+                                               acell[numok++].dir = i;
+                                       }
+                               }
+                               if (numok) {    /* No thanks, I'm a vegetarian */
+                                       i = NRAND(numok);
+                                       wp->nkind[FISH]--;
+                                       cr = acell[i].pos;
+                                       removefrom_kindlist(wp, wp->arr[cr]);
+                                       wp->arr[cr] = wp->currkind;
+                                       if (wp->neighbors == 4) {
+                                               wp->currkind->info.direction = (5 - acell[i].dir) % ORIENTS +
+                                                       ((NRAND(REFLECTS)) ? 0 : ORIENTS) + wp->kind * KINDBITMAPS;
+                                       } else if (wp->neighbors == 8) {
+                                               wp->currkind->info.direction = (char) (5 - (acell[i].dir / 2 +
+                                                                                           ((acell[i].dir % 2) ? LRAND() & 1 : 0))) % ORIENTS +
+                                                       ((NRAND(REFLECTS)) ? 0 : ORIENTS) + wp->kind * KINDBITMAPS;
+                                       } else
+                                               wp->currkind->info.direction = wp->kind * KINDBITMAPS;
+                                       wp->currkind->info.col = acell[i].pos % wp->ncols;
+                                       wp->currkind->info.row = acell[i].pos / wp->ncols;
+                                       wp->currkind->info.food = wp->sstarve;
+                                       drawcell(mi, wp->currkind->info.col, wp->currkind->info.row,
+                                                wp->currkind->info.color, wp->currkind->info.direction, True);
+                                       if (++(wp->currkind->info.age) >= wp->breed[wp->kind]) {        /* breed */
+                                               cutfrom_kindlist(wp);   /* This rotates out who goes first */
+                                               wp->babykind->info.age = 0;
+                                               if (!dupin_kindlist(wp)) {
+                                                       free_wator(wp);
+                                                       return;
+                                               }
+                                               wp->arr[colrow] = wp->babykind;
+                                               wp->babykind->info.col = col;
+                                               wp->babykind->info.row = row;
+                                               wp->babykind->info.age = -1;    /* Make one a little younger */
+#if 0
+                                               if (MI_NPIXELS(mi) > 2 && (LRAND() & 1))
+                                                       /* A color mutation */
+                                                       if (++(wp->babykind->info.color) >= MI_NPIXELS(mi))
+                                                               wp->babykind->info.color = 0;
+#endif
+                                               wp->nkind[wp->kind]++;
+                                       } else {
+                                               wp->arr[colrow] = 0;
+                                               drawcell(mi, col, row, 0, 0, False);
+                                       }
+                               } else {
+                                       if (wp->currkind->info.food-- < 0) {    /* Time to die, Jaws */
+                                               /* back up one or else in void */
+                                               wp->currkind = wp->currkind->previous;
+                                               removefrom_kindlist(wp, wp->arr[colrow]);
+                                               wp->arr[colrow] = 0;
+                                               drawcell(mi, col, row, 0, 0, False);
+                                               wp->nkind[wp->kind]--;
+                                               numok = -1;     /* Want to escape from next if */
+                                       }
+                               }
+                       }
+                       if (!numok) {   /* Fish or shark search for a place to go */
+                               for (i = 0; i < wp->neighbors; i++) {
+                                       position = neighbor_position(wp, col, row, i * 360 / wp->neighbors);
+                                       if (!wp->arr[position]) {       /* Found an empty spot */
+                                               acell[numok].pos = position;
+                                               acell[numok++].dir = i;
+                                       }
+                               }
+                               if (numok) {    /* Found a place to go */
+                                       i = NRAND(numok);
+                                       wp->arr[acell[i].pos] = wp->currkind;
+                                       if (wp->neighbors == 4) {
+                                               wp->currkind->info.direction = (5 - acell[i].dir) % ORIENTS +
+                                                       ((NRAND(REFLECTS)) ? 0 : ORIENTS) + wp->kind * KINDBITMAPS;
+                                       } else if (wp->neighbors == 8) {
+                                               wp->currkind->info.direction = (char) (5 - (acell[i].dir / 2 +
+                                                                                           ((acell[i].dir % 2) ? LRAND() & 1 : 0))) % ORIENTS +
+                                                       ((NRAND(REFLECTS)) ? 0 : ORIENTS) + wp->kind * KINDBITMAPS;
+                                       } else
+                                               wp->currkind->info.direction = wp->kind * KINDBITMAPS;
+                                       wp->currkind->info.col = acell[i].pos % wp->ncols;
+                                       wp->currkind->info.row = acell[i].pos / wp->ncols;
+                                       drawcell(mi,
+                                                wp->currkind->info.col, wp->currkind->info.row,
+                                                wp->currkind->info.color, wp->currkind->info.direction, True);
+                                       if (++(wp->currkind->info.age) >= wp->breed[wp->kind]) {        /* breed */
+                                               cutfrom_kindlist(wp);   /* This rotates out who goes first */
+                                               wp->babykind->info.age = 0;
+                                               if (!dupin_kindlist(wp)) {
+                                                       free_wator(wp);
+                                                       return;
+                                               }
+                                               wp->arr[colrow] = wp->babykind;
+                                               wp->babykind->info.col = col;
+                                               wp->babykind->info.row = row;
+                                               wp->babykind->info.age = -1;    /* Make one a little younger */
+                                               wp->nkind[wp->kind]++;
+                                       } else {
+                                               wp->arr[colrow] = 0;
+                                               drawcell(mi, col, row, 0, 0, False);
+                                       }
+                               } else {
+                                       /* I'll just sit here and wave my tail so you know I am alive */
+                                       wp->currkind->info.direction =
+                                               (wp->currkind->info.direction + ORIENTS) % KINDBITMAPS +
+                                               wp->kind * KINDBITMAPS;
+                                       drawcell(mi, col, row, wp->currkind->info.color,
+                                        wp->currkind->info.direction, True);
+                               }
+                       }
+                       wp->currkind = wp->currkind->next;
+               }
+               reattach_kindlist(wp, wp->kind);
+       }
+
+       if ((wp->nkind[FISH] >= wp->positions) ||
+           (!wp->nkind[FISH] && !wp->nkind[SHARK]) ||
+           wp->generation >= MI_CYCLES(mi)) {
+               init_wator(mi);
+       }
+       if (wp->kind == SHARK)
+               wp->generation++;
+}
+
+void
+release_wator(ModeInfo * mi)
+{
+       if (wators != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_wator(&wators[screen]);
+               (void) free((void *) wators);
+               wators = NULL;
+       }
+}
+
+void
+refresh_wator(ModeInfo * mi)
+{
+       watorstruct *wp;
+
+       if (wators == NULL)
+               return;
+       wp = &wators[MI_SCREEN(mi)];
+
+       if (wp->painted) {
+               MI_CLEARWINDOW(mi);
+               wp->painted = False;
+       }
+}
+
+#endif /* MODE_wator */
diff --git a/modes/wire.c b/modes/wire.c
new file mode 100644 (file)
index 0000000..cb2743e
--- /dev/null
@@ -0,0 +1,1040 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* wire --- logical circuits based on simple state-changes (wireworld) */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)wire.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by David Bagley.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 05-Dec-1997: neighbors option added.
+ * 10-May-1997: Compatible with xscreensaver
+ * 14-Jun-1996: Coded from A.K. Dewdney's "Computer Recreations", Scientific
+ *              American Magazine" Jan 1990 pp 146-148.  Used ant.c as an
+ *              example.  do_gen() based on code by Kevin Dahlhausen
+ *              <ap096@po.cwru.edu> and Stefan Strack
+ *              <stst@vuse.vanderbilt.edu>.
+ */
+
+/*-
+ *  # Rules file for Wireworld
+ *
+ *  # 0 is space, 1 is wire, 2 is tail, 3 is head
+ *  states 4
+ *
+ *  passive 2
+ *  0[0123][0123][0123][0123]0 # No way to make a space into signal or wire
+ *
+ *  # Signal propagation
+ *  2[0123][0123][0123][0123]1 # tail -> wire
+ *  3[0123][0123][0123][0123]2 # head -> tail
+ *
+ *  # 1 or 2 heads adjacent to a wire makes it a head
+ *  1(3*1)3                    # wire with 1 head adjacent -> head
+ *  1(3*2)3                    # wire with 2 heads adjacent -> head
+ *
+ *
+ *  " " is space, X is wire, o is tail, O is head
+ *
+ *   ->XXXoOXXX-> Electron moving in a wire
+ *
+ * Diode -- permits an electron to pass right to left, but not the other way.
+ *    XX
+ *  XX XXX
+ *    XX
+ *
+ * OR gate or fan-in where inputs are protected by diodes
+ *           XX     XX
+ * Input ->XXX XX XX XXX<- Input
+ *           XX  X  XX
+ *               X
+ *               X
+ *               |
+ *               V
+ *             Output
+ *
+ * Dewdney's synchronous-logic flipflop.
+ * Bottom left input is write 1, top left is remember 0.
+ * When gate is on, 1 electron goes to output at right every 13 cycles
+ * memory element, about to forget 1 and remember 0
+ *         Remember 0
+ *             o
+ *            X O XX XX   Memory Loop
+ *            X  XX X XXXX
+ *            X   XX XX   X oOX-> 1 Output
+ * Inputs ->XX        X    X
+ *                X   X XX o
+ * Inputs ->XXXXXXX XX X XO Memory of 1
+ *                XX    XX
+ *         Remember 1
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Wire"
+#define HACK_INIT init_wire
+#define HACK_DRAW draw_wire
+#define wire_opts xlockmore_opts
+#define DEFAULTS "*delay: 500000 \n" \
+ "*count: 1000 \n" \
+ "*cycles: 150 \n" \
+ "*size: -8 \n" \
+ "*ncolors: 64 \n" \
+ "*neighbors: 0 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+#include "automata.h"
+
+#ifdef MODE_wire
+
+/*-
+ * neighbors of 0 randomizes it between 3, 4, 6, 8, 9, and 12.
+ */
+#define DEF_NEIGHBORS  "0"      /* choose random value */
+
+static int  neighbors;
+
+static XrmOptionDescRec opts[] =
+{
+       {(char *) "-neighbors", (char *) ".wire.neighbors", XrmoptionSepArg, (caddr_t) NULL}
+};
+
+static argtype vars[] =
+{
+       {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int
+}
+};
+static OptionStruct desc[] =
+{
+       {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3, 9 or 12"}
+};
+
+ModeSpecOpt wire_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct   wire_description =
+{"wire", "init_wire", "draw_wire", "release_wire",
+ "refresh_wire", "init_wire", NULL, &wire_opts,
+ 500000, 1000, 150, -8, 64, 1.0, "",
+ "Shows a random circuit with 2 electrons", 0, NULL};
+
+#endif
+
+#define WIREBITS(n,w,h)\
+  if ((wp->pixmaps[wp->init_bits]=\
+  XCreatePixmapFromBitmapData(display,window,(char *)n,w,h,1,0,1))==None){\
+  free_wire(display,wp); return;} else {wp->init_bits++;}
+
+#define COLORS 4
+#define MINWIRES 32
+#define MINGRIDSIZE 24
+#define MINSIZE 3
+#define ANGLES 360
+#define NEIGHBORKINDS 6
+
+#define SPACE 0
+#define WIRE 1                 /* Normal wire */
+#define HEAD 2                 /* electron head */
+#define TAIL 3                 /* electron tail */
+
+#define REDRAWSTEP 2000                /* How much wire to draw per cycle */
+
+/* Singly linked list */
+typedef struct _CellList {
+       XPoint      pt;
+       struct _CellList *next;
+} CellList;
+
+typedef struct {
+       int         init_bits;
+       int         neighbors;
+       int         generation;
+       int         xs, ys;
+       int         xb, yb;
+       int         nrows, ncols;
+       int         bnrows, bncols;
+       int         mincol, minrow, maxcol, maxrow;
+       int         width, height;
+       int         redrawing, redrawpos;
+       unsigned char *oldcells, *newcells;
+       int         ncells[COLORS - 1];
+       CellList   *cellList[COLORS - 1];
+       unsigned char colors[COLORS - 1];
+       GC          stippledGC;
+       Pixmap      pixmaps[COLORS - 1];
+       int         prob_array[12];
+       union {
+               XPoint      hexagon[6];
+               XPoint      triangle[2][3];
+       } shape;
+} circuitstruct;
+
+static char plots[NEIGHBORKINDS] =
+{3, 4, 6, 8, 9, 12};           /* Neighborhoods */
+
+static circuitstruct *circuits = NULL;
+
+static void
+position_of_neighbor(circuitstruct * wp, int dir, int *pcol, int *prow)
+{
+       int         col = *pcol, row = *prow;
+
+       /* NO WRAPING */
+
+       if (wp->neighbors == 6) {
+               switch (dir) {
+                       case 0:
+                               col = col + 1;
+                               break;
+                       case 60:
+                               if (!(row & 1))
+                                       col = col + 1;
+                               row = row - 1;
+                               break;
+                       case 120:
+                               if (row & 1)
+                                       col = col - 1;
+                               row = row - 1;
+                               break;
+                       case 180:
+                               col = col - 1;
+                               break;
+                       case 240:
+                               if (row & 1)
+                                       col = col - 1;
+                               row = row + 1;
+                               break;
+                       case 300:
+                               if (!(row & 1))
+                                       col = col + 1;
+                               row = row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else if (wp->neighbors == 4 || wp->neighbors == 8) {
+               switch (dir) {
+                       case 0:
+                               col = col + 1;
+                               break;
+                       case 45:
+                               col = col + 1;
+                               row = row - 1;
+                               break;
+                       case 90:
+                               row = row - 1;
+                               break;
+                       case 135:
+                               col = col - 1;
+                               row = row - 1;
+                               break;
+                       case 180:
+                               col = col - 1;
+                               break;
+                       case 225:
+                               col = col - 1;
+                               row = row + 1;
+                               break;
+                       case 270:
+                               row = row + 1;
+                               break;
+                       case 315:
+                               col = col + 1;
+                               row = row + 1;
+                               break;
+                       default:
+                               (void) fprintf(stderr, "wrong direction %d\n", dir);
+               }
+       } else {                /* TRI */
+               if ((col + row) % 2) {  /* right */
+                       switch (dir) {
+                               case 0:
+                                       col = col - 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = col - 1;
+                                       row = row - 1;
+                                       break;
+                               case 60:
+                                       col = col - 1;
+                                       row = row - 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       row = row - 2;
+                                       break;
+                               case 120:
+                                       row = row - 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = col + 1;
+                                       row = row - 1;
+                                       break;
+                               case 180:
+                                       col = col + 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = col + 1;
+                                       row = row + 1;
+                                       break;
+                               case 240:
+                                       row = row + 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       row = row + 2;
+                                       break;
+                               case 300:
+                                       col = col - 1;
+                                       row = row + 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = col - 1;
+                                       row = row + 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               } else {        /* left */
+                       switch (dir) {
+                               case 0:
+                                       col = col + 1;
+                                       break;
+                               case 30:
+                               case 40:
+                                       col = col + 1;
+                                       row = row + 1;
+                                       break;
+                               case 60:
+                                       col = col + 1;
+                                       row = row + 2;
+                                       break;
+                               case 80:
+                               case 90:
+                                       row = row + 2;
+                                       break;
+                               case 120:
+                                       row = row + 1;
+                                       break;
+                               case 150:
+                               case 160:
+                                       col = col - 1;
+                                       row = row + 1;
+                                       break;
+                               case 180:
+                                       col = col - 1;
+                                       break;
+                               case 200:
+                               case 210:
+                                       col = col - 1;
+                                       row = row - 1;
+                                       break;
+                               case 240:
+                                       row = row - 1;
+                                       break;
+                               case 270:
+                               case 280:
+                                       row = row - 2;
+                                       break;
+                               case 300:
+                                       col = col + 1;
+                                       row = row - 2;
+                                       break;
+                               case 320:
+                               case 330:
+                                       col = col + 1;
+                                       row = row - 1;
+                                       break;
+                               default:
+                                       (void) fprintf(stderr, "wrong direction %d\n", dir);
+                       }
+               }
+       }
+       *pcol = col;
+       *prow = row;
+}
+
+static      Bool
+withinBounds(circuitstruct * wp, int col, int row)
+{
+       return (row >= 2 && row < wp->bnrows - 2 &&
+               col >= 2 && col < wp->bncols - 2 - (wp->neighbors == 6 && !(row % 2)));
+}
+
+static void
+fillcell(ModeInfo * mi, GC gc, int col, int row)
+{
+       circuitstruct *wp = &circuits[MI_SCREEN(mi)];
+
+       if (wp->neighbors == 6) {
+               int         ccol = 2 * col + !(row & 1), crow = 2 * row;
+
+               wp->shape.hexagon[0].x = wp->xb + ccol * wp->xs;
+               wp->shape.hexagon[0].y = wp->yb + crow * wp->ys;
+               if (wp->xs == 1 && wp->ys == 1)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                       wp->shape.hexagon[0].x, wp->shape.hexagon[0].y);
+               else
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                           wp->shape.hexagon, 6, Convex, CoordModePrevious);
+       } else if (wp->neighbors == 4 || wp->neighbors == 8) {
+               XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+               wp->xb + wp->xs * col, wp->yb + wp->ys * row,
+               wp->xs - (wp->xs > 3), wp->ys - (wp->ys > 3));
+       } else {                /* TRI */
+               int         orient = (col + row) % 2;   /* O left 1 right */
+
+               wp->shape.triangle[orient][0].x = wp->xb + col * wp->xs;
+               wp->shape.triangle[orient][0].y = wp->yb + row * wp->ys;
+               if (wp->xs <= 3 || wp->ys <= 3)
+                       XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                       ((orient) ? -1 : 1) + wp->shape.triangle[orient][0].x,
+                                      wp->shape.triangle[orient][0].y);
+               else {
+                       if (orient)
+                               wp->shape.triangle[orient][0].x += (wp->xs / 2 - 1);
+                       else
+                               wp->shape.triangle[orient][0].x -= (wp->xs / 2 - 1);
+                       XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                    wp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+               }
+       }
+}
+
+static void
+drawcell(ModeInfo * mi, int col, int row, unsigned char state)
+{
+       circuitstruct *wp = &circuits[MI_SCREEN(mi)];
+       GC          gc;
+
+       if (MI_NPIXELS(mi) > 2) {
+               gc = MI_GC(mi);
+               XSetForeground(MI_DISPLAY(mi), gc, MI_PIXEL(mi, wp->colors[state]));
+       } else {
+               XGCValues   gcv;
+
+               gcv.stipple = wp->pixmaps[state];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), wp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = wp->stippledGC;
+       }
+       fillcell(mi, gc, col, row);
+}
+
+#if 0
+static void
+drawcell_notused(ModeInfo * mi, int col, int row, unsigned char state)
+{
+       circuitstruct *wp = &circuits[MI_SCREEN(mi)];
+       XGCValues   gcv;
+       GC          gc;
+
+       if (MI_NPIXELS(mi) > 2) {
+               gc = MI_GC(mi);
+               XSetForeground(MI_DISPLAY(mi), gc, MI_PIXEL(mi, wp->colors[state]));
+       } else {
+               gcv.stipple = wp->pixmaps[state];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), wp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = wp->stippledGC;
+       }
+       XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), MI_GC(mi),
+              wp->xb + wp->xs * col, wp->yb + wp->ys * row,
+               wp->xs - (wp->xs > 3), wp->ys - (wp->ys > 3));
+}
+#endif
+
+static Bool
+addtolist(ModeInfo * mi, int col, int row, unsigned char state)
+{
+       circuitstruct *wp = &circuits[MI_SCREEN(mi)];
+       CellList   *current = wp->cellList[state];
+
+       wp->cellList[state] = NULL;
+       if ((wp->cellList[state] = (CellList *) malloc(sizeof (CellList))) ==
+                       NULL) {
+               return False;
+       }
+       wp->cellList[state]->pt.x = col;
+       wp->cellList[state]->pt.y = row;
+       wp->cellList[state]->next = current;
+       wp->ncells[state]++;
+       return True;
+}
+
+#ifdef DEBUG
+static void
+print_state(ModeInfo * mi, int state)
+{
+       circuitstruct *wp = &circuits[MI_SCREEN(mi)];
+       CellList   *locallist = wp->cellList[state];
+       int         i = 0;
+
+       (void) printf("state %d\n", state);
+       while (locallist) {
+               (void) printf("%d x %d, y %d\n", i,
+                             locallist->pt.x, locallist->pt.y);
+               locallist = locallist->next;
+               i++;
+       }
+}
+
+#endif
+
+static void
+free_state(circuitstruct * wp, int state)
+{
+       CellList   *current;
+
+       while (wp->cellList[state]) {
+               current = wp->cellList[state];
+               wp->cellList[state] = wp->cellList[state]->next;
+               (void) free((void *) current);
+       }
+       wp->ncells[state] = 0;
+}
+
+static Bool
+draw_state(ModeInfo * mi, int state)
+{
+       circuitstruct *wp = &circuits[MI_SCREEN(mi)];
+       GC          gc;
+       XGCValues   gcv;
+       CellList   *current = wp->cellList[state];
+
+       if (MI_NPIXELS(mi) > 2) {
+               gc = MI_GC(mi);
+               XSetForeground(MI_DISPLAY(mi), gc, MI_PIXEL(mi, wp->colors[state]));
+       } else {
+               gcv.stipple = wp->pixmaps[state];
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               XChangeGC(MI_DISPLAY(mi), wp->stippledGC,
+                         GCStipple | GCForeground | GCBackground, &gcv);
+               gc = wp->stippledGC;
+       }
+
+       if (wp->neighbors == 6) {       /* Draw right away, slow */
+               while (current) {
+                       int         col, row, ccol, crow;
+
+                       col = current->pt.x;
+                       row = current->pt.y;
+                       ccol = 2 * col + !(row & 1), crow = 2 * row;
+                       wp->shape.hexagon[0].x = wp->xb + ccol * wp->xs;
+                       wp->shape.hexagon[0].y = wp->yb + crow * wp->ys;
+                       if (wp->xs == 1 && wp->ys == 1)
+                               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi),
+                                              gc, wp->shape.hexagon[0].x, wp->shape.hexagon[0].y);
+                       else
+                               XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                            wp->shape.hexagon, 6, Convex, CoordModePrevious);
+                       current = current->next;
+               }
+       } else if (wp->neighbors == 4 || wp->neighbors == 8) {
+               XRectangle *rects;
+               /* Take advantage of XFillRectangles */
+               int         nrects = 0;
+
+               /* Create Rectangle list from part of the cellList */
+               if ((rects = (XRectangle *) malloc(wp->ncells[state] *
+                               sizeof (XRectangle))) == NULL) {
+                       return False;
+       }
+
+               while (current) {
+                       rects[nrects].x = wp->xb + current->pt.x * wp->xs;
+                       rects[nrects].y = wp->yb + current->pt.y * wp->ys;
+                       rects[nrects].width = wp->xs - (wp->xs > 3);
+                       rects[nrects].height = wp->ys - (wp->ys > 3);
+                       current = current->next;
+                       nrects++;
+               }
+               /* Finally get to draw */
+               XFillRectangles(MI_DISPLAY(mi), MI_WINDOW(mi), gc, rects, nrects);
+               /* Free up rects list and the appropriate part of the cellList */
+               (void) free((void *) rects);
+       } else {                /* TRI */
+               while (current) {
+                       int         col, row, orient;
+
+                       col = current->pt.x;
+                       row = current->pt.y;
+                       orient = (col + row) % 2;       /* O left 1 right */
+                       wp->shape.triangle[orient][0].x = wp->xb + col * wp->xs;
+                       wp->shape.triangle[orient][0].y = wp->yb + row * wp->ys;
+                       if (wp->xs <= 3 || wp->ys <= 3)
+                               XDrawPoint(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                              ((orient) ? -1 : 1) + wp->shape.triangle[orient][0].x,
+                                     wp->shape.triangle[orient][0].y);
+                       else {
+                               if (orient)
+                                       wp->shape.triangle[orient][0].x += (wp->xs / 2 - 1);
+                               else
+                                       wp->shape.triangle[orient][0].x -= (wp->xs / 2 - 1);
+                               XFillPolygon(MI_DISPLAY(mi), MI_WINDOW(mi), gc,
+                                            wp->shape.triangle[orient], 3, Convex, CoordModePrevious);
+                       }
+                       current = current->next;
+               }
+       }
+       free_state(wp, state);
+       XFlush(MI_DISPLAY(mi));
+       return True;
+}
+
+#if 0
+static void
+RandomSoup(circuitstruct * wp)
+{
+       int         i, j;
+
+       for (j = 2; j < wp->bnrows - 2; j++)
+               for (i = 2; i < wp->bncols - 2; i++) {
+                       *(wp->newcells + i + j * wp->bncols) =
+                               (NRAND(100) > wp->n) ? SPACE : (NRAND(4)) ? WIRE : (NRAND(2)) ?
+                               HEAD : TAIL;
+               }
+}
+
+#endif
+
+static void
+create_path(circuitstruct * wp, int n)
+{
+       int         col, row;
+       int         count = 0;
+       int         dir, prob;
+       int         nextcol, nextrow, i;
+
+#ifdef RANDOMSTART
+       /* Path usually "mushed" in a corner */
+       col = NRAND(wp->ncols) + 1;
+       row = NRAND(wp->nrows) + 1;
+#else
+       /* Start from center */
+       col = wp->ncols / 2;
+       row = wp->nrows / 2;
+#endif
+       wp->mincol = col - 1, wp->minrow = row - 2;
+       wp->maxcol = col + 1, wp->maxrow = row + 2;
+       dir = NRAND(wp->neighbors) * ANGLES / wp->neighbors;
+       *(wp->newcells + col + row * wp->bncols) = HEAD;
+       while (++count < n) {
+               prob = NRAND(wp->prob_array[wp->neighbors - 1]);
+               i = 0;
+               while (prob > wp->prob_array[i])
+                       i++;
+               dir = ((dir * wp->neighbors / ANGLES + i) %
+                      wp->neighbors) * ANGLES / wp->neighbors;
+               nextcol = col;
+               nextrow = row;
+               position_of_neighbor(wp, dir, &nextcol, &nextrow);
+               if (withinBounds(wp, nextcol, nextrow)) {
+                       col = nextcol;
+                       row = nextrow;
+                       if (col == wp->mincol && col > 2)
+                               wp->mincol--;
+                       if (row == wp->minrow && row > 2)
+                               wp->minrow--;
+                       else if (row == wp->minrow - 1 && row > 3)
+                               wp->minrow -= 2;
+                       if (col == wp->maxcol && col < wp->bncols - 3)
+                               wp->maxcol++;
+                       if (row == wp->maxrow && row < wp->bnrows - 3)
+                               wp->maxrow++;
+                       else if (row == wp->maxrow + 1 && row < wp->bnrows - 4)
+                               wp->maxrow += 2;
+
+                       if (!*(wp->newcells + col + row * wp->bncols))
+                               *(wp->newcells + col + row * wp->bncols) = WIRE;
+               } else {
+                       if (wp->neighbors == 3)
+                               break;  /* There is no reverse step */
+                       dir = ((dir * wp->neighbors / ANGLES + wp->neighbors / 2) %
+                              wp->neighbors) * ANGLES / wp->neighbors;
+               }
+       }
+       *(wp->newcells + col + row * wp->bncols) = HEAD;
+}
+
+static void
+do_gen(circuitstruct * wp)
+{
+       int         i, j, k;
+       unsigned char *z;
+       int         count;
+
+#define LOC(X, Y) (*(wp->oldcells + (X) + ((Y) * wp->bncols)))
+#define ADD(X, Y) if (LOC((X), (Y)) == HEAD) count++
+
+       for (j = wp->minrow; j <= wp->maxrow; j++) {
+               for (i = wp->mincol; i <= wp->maxcol; i++) {
+                       z = wp->newcells + i + j * wp->bncols;
+                       switch (LOC(i, j)) {
+                               case SPACE:
+                                       *z = SPACE;
+                                       break;
+                               case TAIL:
+                                       *z = WIRE;
+                                       break;
+                               case HEAD:
+                                       *z = TAIL;
+                                       break;
+                               case WIRE:
+                                       count = 0;
+                                       for (k = 0; k < wp->neighbors; k++) {
+                                               int         newi = i, newj = j;
+
+                                               position_of_neighbor(wp, k * ANGLES / wp->neighbors, &newi, &newj);
+                                               ADD(newi, newj);
+                                       }
+                                       if (count == 1 || count == 2)
+                                               *z = HEAD;
+                                       else
+                                               *z = WIRE;
+                                       break;
+                               default:
+                                       {
+                                               (void) fprintf(stderr,
+                                                              "bad internal character %d at %d,%d\n",
+                                                     (int) LOC(i, j), i, j);
+                                       }
+                       }
+               }
+       }
+}
+
+static void
+free_list(circuitstruct * wp)
+{
+       int         state;
+
+       for (state = 0; state < COLORS - 1; state++)
+               free_state(wp, state);
+}
+
+static void
+free_wire(Display *display, circuitstruct *wp)
+{
+       int         shade;
+
+       for (shade = 0; shade < wp->init_bits; shade++)
+               XFreePixmap(display, wp->pixmaps[shade]);
+       wp->init_bits = 0;
+       if (wp->stippledGC != None) {
+               XFreeGC(display, wp->stippledGC);
+               wp->stippledGC = None;
+       }
+       if (wp->oldcells != NULL) {
+               (void) free((void *) wp->oldcells);
+               wp->oldcells = NULL;
+       }
+       if (wp->newcells != NULL) {
+               (void) free((void *) wp->newcells);
+               wp->newcells = NULL;
+       }
+       free_list(wp);
+}
+
+void
+release_wire(ModeInfo * mi)
+{
+       if (circuits != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_wire(MI_DISPLAY(mi), &circuits[screen]);
+               (void) free((void *) circuits);
+               circuits = NULL;
+       }
+}
+
+void
+init_wire(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         i, size = MI_SIZE(mi), n;
+       circuitstruct *wp;
+       XGCValues   gcv;
+
+       if (circuits == NULL) {
+               if ((circuits = (circuitstruct *) calloc(MI_NUM_SCREENS(mi),
+                                           sizeof (circuitstruct))) == NULL)
+                       return;
+       }
+       wp = &circuits[MI_SCREEN(mi)];
+
+       wp->redrawing = 0;
+
+       if ((MI_NPIXELS(mi) <= 2) && (wp->init_bits == 0)) {
+               if (wp->stippledGC == None) {
+                       gcv.fill_style = FillOpaqueStippled;
+                       if ((wp->stippledGC = XCreateGC(display, window, GCFillStyle,
+                                       &gcv)) == None) {
+                               free_wire(display, wp);
+                               return;
+                       }
+               }
+               WIREBITS(stipples[NUMSTIPPLES - 1], STIPPLESIZE, STIPPLESIZE);
+               WIREBITS(stipples[NUMSTIPPLES - 3], STIPPLESIZE, STIPPLESIZE);
+               WIREBITS(stipples[2], STIPPLESIZE, STIPPLESIZE);
+       }
+       if (MI_NPIXELS(mi) > 2) {
+               wp->colors[0] = (NRAND(MI_NPIXELS(mi)));
+               wp->colors[1] = (wp->colors[0] + MI_NPIXELS(mi) / 6 +
+                            NRAND(MI_NPIXELS(mi) / 4 + 1)) % MI_NPIXELS(mi);
+               wp->colors[2] = (wp->colors[1] + MI_NPIXELS(mi) / 6 +
+                            NRAND(MI_NPIXELS(mi) / 4 + 1)) % MI_NPIXELS(mi);
+       }
+       free_list(wp);
+       wp->generation = 0;
+       wp->width = MI_WIDTH(mi);
+       wp->height = MI_HEIGHT(mi);
+
+       for (i = 0; i < NEIGHBORKINDS; i++) {
+               if (neighbors == plots[i]) {
+                       wp->neighbors = plots[i];
+                       break;
+               }
+               if (i == NEIGHBORKINDS - 1) {
+                       i = NRAND(NEIGHBORKINDS - 3) + 1;       /* Skip triangular ones */
+                       wp->neighbors = plots[i];
+                       break;
+               }
+       }
+
+       wp->prob_array[wp->neighbors - 1] = 100;
+       if (wp->neighbors == 3) {
+               wp->prob_array[1] = 67;
+               wp->prob_array[0] = 33;
+       } else {
+               int         incr = 24 / wp->neighbors;
+
+               for (i = wp->neighbors - 2; i >= 0; i--) {
+                       wp->prob_array[i] = wp->prob_array[i + 1] - incr -
+                               incr * ((i + 1) != wp->neighbors / 2);
+               }
+       }
+
+       if (wp->neighbors == 6) {
+               int         nccols, ncrows;
+
+               if (wp->width < 4)
+                       wp->width = 4;
+               if (wp->height < 4)
+                       wp->height = 4;
+               if (size < -MINSIZE)
+                       wp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               wp->ys = MAX(MINSIZE, MIN(wp->width, wp->height) / MINGRIDSIZE);
+                       else
+                               wp->ys = MINSIZE;
+               } else
+                       wp->ys = MIN(size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                              MINGRIDSIZE));
+               wp->xs = wp->ys;
+               nccols = MAX(wp->width / wp->xs - 2, 2);
+               ncrows = MAX(wp->height / wp->ys - 1, 2);
+               wp->ncols = nccols / 2;
+               wp->nrows = ncrows / 2;
+               wp->nrows -= !(wp->nrows & 1);  /* Must be odd */
+               wp->xb = (wp->width - wp->xs * nccols) / 2 + wp->xs;
+               wp->yb = (wp->height - wp->ys * ncrows) / 2 + wp->ys;
+               for (i = 0; i < 6; i++) {
+                       wp->shape.hexagon[i].x = (wp->xs - 1) * hexagonUnit[i].x;
+                       wp->shape.hexagon[i].y = ((wp->ys - 1) * hexagonUnit[i].y / 2) * 4 / 3;
+               }
+       } else if (wp->neighbors == 4 || wp->neighbors == 8) {
+               if (size < -MINSIZE)
+                       wp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               wp->ys = MAX(MINSIZE, MIN(wp->width, wp->height) / MINGRIDSIZE);
+                       else
+                               wp->ys = MINSIZE;
+               } else
+                       wp->ys = MIN(size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                              MINGRIDSIZE));
+               wp->xs = wp->ys;
+               wp->ncols = MAX(wp->width / wp->xs, 2);
+               wp->nrows = MAX(wp->height / wp->ys, 2);
+               wp->xb = (wp->width - wp->xs * wp->ncols) / 2;
+               wp->yb = (wp->height - wp->ys * wp->nrows) / 2;
+       } else {                /* TRI */
+               int         orient;
+
+               if (wp->width < 4)
+                       wp->width = 4;
+               if (wp->height < 2)
+                       wp->height = 2;
+               if (size < -MINSIZE)
+                       wp->ys = NRAND(MIN(-size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                     MINGRIDSIZE)) - MINSIZE + 1) + MINSIZE;
+               else if (size < MINSIZE) {
+                       if (!size)
+                               wp->ys = MAX(MINSIZE, MIN(wp->width, wp->height) / MINGRIDSIZE);
+                       else
+                               wp->ys = MINSIZE;
+               } else
+                       wp->ys = MIN(size, MAX(MINSIZE, MIN(wp->width, wp->height) /
+                                              MINGRIDSIZE));
+               wp->xs = (int) (1.52 * wp->ys);
+               wp->ncols = (MAX(wp->width / wp->xs - 1, 4) / 2) * 2;
+               wp->nrows = (MAX(wp->height / wp->ys - 1, 2) / 2) * 2 - 1;
+               wp->xb = (wp->width - wp->xs * wp->ncols) / 2 + wp->xs / 2;
+               wp->yb = (wp->height - wp->ys * wp->nrows) / 2 + wp->ys;
+               for (orient = 0; orient < 2; orient++) {
+                       for (i = 0; i < 3; i++) {
+                               wp->shape.triangle[orient][i].x =
+                                       (wp->xs - 2) * triangleUnit[orient][i].x;
+                               wp->shape.triangle[orient][i].y =
+                                       (wp->ys - 2) * triangleUnit[orient][i].y;
+                       }
+               }
+       }
+
+       /*
+        * I am being a bit naughty here wasting a little bit of memory
+        * but it will give me a real headache to figure out the logic
+        * and to refigure the mappings to save a few bytes
+        * ncols should only need a border of 2 and nrows should only need
+        * a border of 4 when in the neighbors = 9 or 12
+        */
+       wp->bncols = wp->ncols + 4;
+       wp->bnrows = wp->nrows + 4;
+
+       MI_CLEARWINDOW(mi);
+
+       if (wp->oldcells != NULL) {
+               (void) free((void *) wp->oldcells);
+               wp->oldcells = NULL;
+       }
+       if ((wp->oldcells = (unsigned char *) calloc(wp->bncols * wp->bnrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_wire(display, wp);
+               return;
+       }
+
+       if (wp->newcells != NULL) {
+               (void) free((void *) wp->newcells);
+               wp->newcells = NULL;
+       }
+       if ((wp->newcells = (unsigned char *) calloc(wp->bncols * wp->bnrows,
+                       sizeof (unsigned char))) == NULL) {
+               free_wire(display, wp);
+               return;
+       }
+
+       n = MI_COUNT(mi);
+       i = (1 + (wp->neighbors == 6)) * wp->ncols * wp->nrows / 4;
+       if (n < -MINWIRES && i > MINWIRES) {
+               n = NRAND(MIN(-n, i) - MINWIRES + 1) + MINWIRES;
+       } else if (n < MINWIRES) {
+               n = MINWIRES;
+       } else if (n > i) {
+               n = MAX(MINWIRES, i);
+       }
+       create_path(wp, n);
+}
+
+void
+draw_wire(ModeInfo * mi)
+{
+       int         offset, i, j;
+       unsigned char *z, *znew;
+       circuitstruct *wp;
+
+       if (circuits == NULL)
+               return;
+       wp = &circuits[MI_SCREEN(mi)];
+       if (wp->newcells == NULL)
+               return;
+
+       MI_IS_DRAWN(mi) = True;
+
+       /* wires do not grow so min max stuff does not change */
+       for (j = wp->minrow; j <= wp->maxrow; j++) {
+               for (i = wp->mincol; i <= wp->maxcol; i++) {
+                       offset = j * wp->bncols + i;
+                       z = wp->oldcells + offset;
+                       znew = wp->newcells + offset;
+                       if (*z != *znew) {      /* Counting on once a space always a space */
+                               *z = *znew;
+                               if (!addtolist(mi, i - 2, j - 2, *znew - 1)) {
+                                       free_wire(MI_DISPLAY(mi), wp);
+                                       return;
+                               }
+                       }
+               }
+       }
+       for (i = 0; i < COLORS - 1; i++)
+               if (!draw_state(mi, i)) {
+                       free_wire(MI_DISPLAY(mi), wp);
+                       return;
+               }
+       if (++wp->generation > MI_CYCLES(mi)) {
+               init_wire(mi);
+               return;
+       } else
+               do_gen(wp);
+
+       if (wp->redrawing) {
+               for (i = 0; i < REDRAWSTEP; i++) {
+                       if ((*(wp->oldcells + wp->redrawpos))) {
+                               drawcell(mi, wp->redrawpos % wp->bncols - 2,
+                                        wp->redrawpos / wp->bncols - 2, *(wp->oldcells + wp->redrawpos) - 1);
+                       }
+                       if (++(wp->redrawpos) >= wp->bncols * (wp->bnrows - 2)) {
+                               wp->redrawing = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
+refresh_wire(ModeInfo * mi)
+{
+       circuitstruct *wp;
+
+       if (circuits == NULL)
+               return;
+       wp = &circuits[MI_SCREEN(mi)];
+
+       MI_CLEARWINDOW(mi);
+       wp->redrawing = 1;
+       wp->redrawpos = 2 * wp->ncols + 2;
+}
+
+#endif /* MODE_wire */
diff --git a/modes/world.c b/modes/world.c
new file mode 100644 (file)
index 0000000..5a2ea94
--- /dev/null
@@ -0,0 +1,295 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* world --- world spinner */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)world.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1993 Matthew Moyle-Croft <matthew@moyle-croft.com>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000:
+ * 10-May-1997: Compatible with xscreensaver
+ * 04-Oct-1995: multiscreen patch, thanks to Grant McDorman <grant@isgtec.com>.
+ * 10-Jul-1995: Backward spinning jump fixed by Neale Pickett <zephyr@nmt.edu>.
+ * 17-Jul-1994: Got batchcount to work.
+ * 09-Jan-1994: Written [ Modified from image.c ]
+ * 29-Jul-1990: image.c written. Copyright (c) 1991 by Patrick J. Naughton.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "World"
+#define HACK_INIT init_world
+#define HACK_DRAW draw_world
+#define world_opts xlockmore_opts
+#define DEFAULTS "*delay: 100000 \n" \
+ "*count: -16 \n" \
+ "*ncolors: 200 \n"
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_world
+
+ModeSpecOpt world_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   world_description =
+{"world", "init_world", "draw_world", "release_world",
+ "refresh_world", "init_world", NULL, &world_opts,
+ 100000, -16, 1, 1, 64, 0.3, "",
+ "Shows spinning Earths", 0, NULL};
+
+#endif
+
+#include "bitmaps/terra-00.xbm"
+#include "bitmaps/terra-01.xbm"
+#include "bitmaps/terra-02.xbm"
+#include "bitmaps/terra-03.xbm"
+#include "bitmaps/terra-04.xbm"
+#include "bitmaps/terra-05.xbm"
+#include "bitmaps/terra-06.xbm"
+#include "bitmaps/terra-07.xbm"
+#include "bitmaps/terra-08.xbm"
+#include "bitmaps/terra-09.xbm"
+#include "bitmaps/terra-10.xbm"
+#include "bitmaps/terra-11.xbm"
+#include "bitmaps/terra-12.xbm"
+#include "bitmaps/terra-13.xbm"
+#include "bitmaps/terra-14.xbm"
+#include "bitmaps/terra-15.xbm"
+#include "bitmaps/terra-16.xbm"
+#include "bitmaps/terra-17.xbm"
+#include "bitmaps/terra-18.xbm"
+#include "bitmaps/terra-19.xbm"
+#include "bitmaps/terra-20.xbm"
+#include "bitmaps/terra-21.xbm"
+#include "bitmaps/terra-22.xbm"
+#include "bitmaps/terra-23.xbm"
+#include "bitmaps/terra-24.xbm"
+#include "bitmaps/terra-25.xbm"
+#include "bitmaps/terra-26.xbm"
+#include "bitmaps/terra-27.xbm"
+#include "bitmaps/terra-28.xbm"
+#include "bitmaps/terra-29.xbm"
+
+#define NUM_EARTHS 30
+#define SIZE_X terra00_width   /* 64 */
+#define SIZE_Y terra00_height  /* 64 */
+#define NUM_REV 4
+#define MINWORLDS 1
+
+static XImage Earths[NUM_EARTHS] =
+{
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra00_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra01_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra02_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra03_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra04_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra05_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra06_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra07_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra08_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra09_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra10_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra11_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra12_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra13_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra14_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra15_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra16_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra17_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra18_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra19_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra20_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra21_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra22_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra23_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra24_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra25_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra26_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra27_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra28_bits, LSBFirst, 8, LSBFirst, 8, 1},
+       {SIZE_X, SIZE_Y, 0, XYBitmap, (char *) terra29_bits, LSBFirst, 8, LSBFirst, 8, 1}};
+
+typedef struct {
+       int         x;
+       int         y;
+       unsigned long color;
+       int         frame;
+       int         direction;
+} planetstruct;
+
+typedef struct {
+       int         width;
+       int         height;
+       int         nrows;
+       int         ncols;
+       int         xb;
+       int         yb;
+       int         frame_num;
+       int         nplanets;
+       planetstruct *planets;
+} worldstruct;
+
+static worldstruct *worlds = NULL;
+
+void
+init_world(ModeInfo * mi)
+{
+       int         i;
+       worldstruct *wp;
+
+       if (worlds == NULL) {
+               if ((worlds = (worldstruct *) calloc(MI_NUM_SCREENS(mi),
+                                             sizeof (worldstruct))) == NULL)
+                       return;
+       }
+       wp = &worlds[MI_SCREEN(mi)];
+       wp->frame_num = NUM_EARTHS * NUM_REV;
+       for (i = 0; i < NUM_EARTHS; i++)
+               Earths[i].bytes_per_line = 8;
+       wp->width = MI_WIDTH(mi);
+       wp->height = MI_HEIGHT(mi);
+       wp->ncols = wp->width / SIZE_X;
+       if (!wp->ncols)
+               wp->ncols = 1;
+       wp->nrows = wp->height / SIZE_Y;
+       if (!wp->nrows)
+               wp->nrows = 1;
+       wp->xb = (wp->width - SIZE_X * wp->ncols) / 2;
+       wp->yb = (wp->height - SIZE_Y * wp->nrows) / 2;
+       wp->nplanets = MI_COUNT(mi);
+       if (wp->nplanets < -MINWORLDS)
+               wp->nplanets = NRAND(-wp->nplanets - MINWORLDS + 1) + MINWORLDS;
+       else if (wp->nplanets < MINWORLDS)
+               wp->nplanets = MINWORLDS;
+
+       if (wp->nplanets > wp->ncols * wp->nrows)
+               wp->nplanets = wp->ncols * wp->nrows;
+#ifndef NOFLASH
+       if (wp->nplanets > wp->ncols)
+               wp->nplanets = wp->ncols;
+#endif
+       if (wp->planets != NULL)
+               (void) free((void *) wp->planets);
+       if ((wp->planets = (planetstruct *) malloc(wp->nplanets *
+                       sizeof (planetstruct))) == NULL) {
+               return;
+       }
+       for (i = 0; i < wp->nplanets; i++)
+               wp->planets[i].x = wp->planets[i].y = -1;
+
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_world(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       GC          gc = MI_GC(mi);
+       int         i;
+#ifndef NOFLASH
+       int        *col, j;
+#endif
+       worldstruct *wp;
+
+       if (worlds == NULL)
+               return;
+       wp = &worlds[MI_SCREEN(mi)];
+       if (wp->planets == NULL)
+               return;
+
+#ifndef NOFLASH
+       if ((col = (int *) calloc(wp->ncols, sizeof (int))) == NULL)
+                           return;
+#endif
+
+       MI_IS_DRAWN(mi) = True;
+
+       if (wp->frame_num == NUM_EARTHS * NUM_REV) {
+               wp->frame_num = 0;
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               for (i = 0; i < wp->nplanets; i++) {
+                       XFillRectangle(display, MI_WINDOW(mi), gc,
+                                wp->xb + SIZE_X * wp->planets[i].x,
+                                wp->yb + SIZE_Y * wp->planets[i].y,
+                                SIZE_X, SIZE_Y);
+#ifdef NOFLASH
+                       wp->planets[i].x = NRAND(wp->ncols);
+#else
+                       do {
+                               j = NRAND(wp->ncols);
+                               if (!col[j])
+                                       wp->planets[i].x = j;
+                               col[j]++;
+                       } while (col[j] > 1);
+#endif
+                       wp->planets[i].y = NRAND(wp->nrows);
+                       wp->planets[i].direction = (int) (LRAND() & 1);
+                       wp->planets[i].frame = NRAND(NUM_EARTHS);
+                       if (MI_NPIXELS(mi) > 2)
+                               wp->planets[i].color = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+                       else
+                               wp->planets[i].color = MI_WHITE_PIXEL(mi);
+               }
+       }
+#ifndef NOFLASH
+       (void) free((void *) col);
+#endif
+       for (i = 0; i < wp->nplanets; i++) {
+               XSetForeground(display, gc, wp->planets[i].color);
+               if (wp->planets[i].frame == NUM_EARTHS)
+                       wp->planets[i].frame = 0;
+               else {
+                       if ((wp->planets[i].frame < 0) && wp->planets[i].direction == 0)
+                               wp->planets[i].frame = NUM_EARTHS - 1;
+               }
+               (void) XPutImage(display, MI_WINDOW(mi), gc,
+                                (Earths + wp->planets[i].frame), 0, 0,
+                                wp->xb + SIZE_X * wp->planets[i].x,
+                                wp->yb + SIZE_Y * wp->planets[i].y,
+                                SIZE_X, SIZE_Y);
+
+               (wp->planets[i].direction) ? wp->planets[i].frame++ : wp->planets[i].frame--;
+       }
+       wp->frame_num++;
+}
+
+void
+release_world(ModeInfo * mi)
+{
+       if (worlds != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       if (worlds[screen].planets != NULL)
+                               (void) free((void *) worlds[screen].planets);
+               (void) free((void *) worlds);
+               worlds = NULL;
+       }
+}
+
+void
+refresh_world(ModeInfo * mi)
+{
+       MI_CLEARWINDOW(mi);
+}
+
+#endif /* MODE_world */
diff --git a/modes/worm.c b/modes/worm.c
new file mode 100644 (file)
index 0000000..d9f6ff5
--- /dev/null
@@ -0,0 +1,472 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* worm --- draw wiggly worms */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)worm.c       5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-May-1997: Compatible with xscreensaver
+ * 03-Sep-1996: fixed bug in allocation of space for worms, added 3d support
+ *              Henrik Theiling <theiling@coli.uni-sb.de>
+ * 27-Sep-1995: put back malloc
+ * 23-Sep-1993: got rid of "rint". (David Bagley)
+ * 27-Sep-1991: got rid of all malloc calls since there were no calls to free().
+ * 25-Sep-1991: Integrated into X11R5 contrib xlock.
+ *
+ * Adapted from a concept in the Dec 87 issue of Scientific American p. 142.
+ *
+ * SunView version: Brad Taylor <brad@sun.com>
+ * X11 version: Dave Lemke <lemke@ncd.com>
+ * xlock version: Boris Putanec <bp@cs.brown.edu>
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "Worm"
+#define HACK_INIT init_worm
+#define HACK_DRAW draw_worm
+#define worm_opts xlockmore_opts
+#define DEFAULTS "*delay: 17000 \n" \
+ "*count: -20 \n" \
+ "*cycles: 10 \n" \
+ "*size: -3 \n" \
+ "*ncolors: 200 \n" \
+ "*use3d: False \n" \
+ "*delta3d: 1.5 \n" \
+ "*right3d: red \n" \
+ "*left3d: blue \n" \
+ "*both3d: magenta \n" \
+ "*none3d: black \n"
+#define SMOOTH_COLORS
+#include "xlockmore.h"         /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"             /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#ifdef MODE_worm
+
+ModeSpecOpt worm_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct   worm_description =
+{"worm", "init_worm", "draw_worm", "release_worm",
+ "refresh_worm", "init_worm", NULL, &worm_opts,
+ 17000, -20, 10, -3, 64, 1.0, "",
+ "Shows wiggly worms", 0, NULL};
+
+#endif
+
+#define MINSIZE 1
+
+#define SEGMENTS  36
+#define MINWORMS 1
+
+#define MAXZ      750
+#define MINZ      100
+#define SCREENZ   200
+#define GETZDIFF(z) (MI_DELTA3D(mi)*20.0*(1.0-(SCREENZ)/((float)(z)+MINZ)))
+#define IRINT(x) ((int)(((x)>0.0)?(x)+0.5:(x)-0.5))
+
+/* How many segments to draw per cycle when redrawing */
+#define REDRAWSTEP 3
+
+typedef struct {
+       XPoint     *circ;
+       int        *diffcirc;
+       int         dir, dir2;
+       int         tail;
+       int         x, y, z;
+       int         redrawing, redrawpos;
+} wormstuff;
+
+typedef struct {
+       int         xsize, ysize, zsize;
+       int         wormlength;
+       int         nc;
+       int         nw;
+       int         circsize;
+       wormstuff  *worm;
+       XRectangle *rects;
+       int         maxsize;
+       int        *size;
+       unsigned int chromo;
+} wormstruct;
+
+static float sintab[SEGMENTS];
+static float costab[SEGMENTS];
+static int  init_table = 0;
+
+static wormstruct *worms = NULL;
+
+static void
+worm_doit(ModeInfo * mi, int which, unsigned long color)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       wormstruct *wp = &worms[MI_SCREEN(mi)];
+       wormstuff  *ws = &wp->worm[which];
+       int         x, y, z;
+       int         diff;
+
+       ws->tail++;
+       if (ws->tail == wp->wormlength)
+               ws->tail = 0;
+
+       x = ws->circ[ws->tail].x;
+       y = ws->circ[ws->tail].y;
+
+       if (MI_IS_USE3D(mi)) {
+               diff = ws->diffcirc[ws->tail];
+               if (MI_IS_INSTALL(mi)) {
+                       XSetForeground(display, gc, MI_NONE_COLOR(mi));
+               } else {
+                       XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               }
+               XFillRectangle(display, window, gc, x - diff, y,
+                              wp->circsize, wp->circsize);
+               XFillRectangle(display, window, gc, x + diff, y,
+                              wp->circsize, wp->circsize);
+       } else {
+               XSetForeground(display, gc, MI_BLACK_PIXEL(mi));
+               XFillRectangle(display, window, gc, x, y, wp->circsize, wp->circsize);
+       }
+
+       if (LRAND() & 1)
+               ws->dir = (ws->dir + 1) % SEGMENTS;
+       else
+               ws->dir = (ws->dir + SEGMENTS - 1) % SEGMENTS;
+
+       x = (ws->x + IRINT((float) wp->circsize * costab[ws->dir]) +
+            wp->xsize) % wp->xsize;
+       y = (ws->y + IRINT((float) wp->circsize * sintab[ws->dir]) +
+            wp->ysize) % wp->ysize;
+
+       ws->circ[ws->tail].x = x;
+       ws->circ[ws->tail].y = y;
+       ws->x = x;
+       ws->y = y;
+
+       if (MI_IS_USE3D(mi)) {
+               if (LRAND() & 1)
+                       ws->dir2 = (ws->dir2 + 1) % SEGMENTS;
+               else
+                       ws->dir2 = (ws->dir2 + SEGMENTS - 1) % SEGMENTS;
+               /* for the z-axis the wrap-around looks bad,
+                  * so worms should just turn around.
+                */
+               z = (int) (ws->z + wp->circsize * sintab[ws->dir2]);
+               if (z < 0 || z >= wp->zsize)
+                       z = (int) (ws->z - wp->circsize * sintab[ws->dir2]);
+
+               diff = (int) (GETZDIFF(z) + 0.5);       /* ROUND */
+               ws->diffcirc[ws->tail] = diff;
+
+               ws->z = z;
+
+               /* right eye */
+               color = 0;
+               wp->rects[color * wp->maxsize + wp->size[color]].x = x + diff;
+               wp->rects[color * wp->maxsize + wp->size[color]].y = y;
+               wp->size[color]++;
+
+               /* left eye */
+               color = 1;
+               wp->rects[color * wp->maxsize + wp->size[color]].x = x - diff;
+               wp->rects[color * wp->maxsize + wp->size[color]].y = y;
+               wp->size[color]++;
+
+#if 0
+               if (ws->redrawing) {    /* Too hard for now */
+                       int         j;
+
+                       for (j = 0; j < REDRAWSTEP; j++) {
+                               int         k = (ws->tail - ws->redrawpos + wp->wormlength)
+                               % wp->wormlength;
+
+                               color = 0;
+                               wp->rects[color * wp->maxsize + wp->size[color]].x =
+                                       ws->circ[k].x + ws->diffcirc[k];
+                               wp->rects[color * wp->maxsize + wp->size[color]].y =
+                                       ws->circ[k].y;
+                               wp->size[color]++;
+
+                               color = 1;
+                               wp->rects[color * wp->maxsize + wp->size[color]].x =
+                                       ws->circ[k].x - ws->diffcirc[k];
+                               wp->rects[color * wp->maxsize + wp->size[color]].y =
+                                       ws->circ[k].y;
+                               wp->size[color]++;
+
+                               if (++(ws->redrawpos) >= wp->wormlength) {
+                                       ws->redrawing = 0;
+                                       break;
+                               }
+                       }
+               }
+#endif
+
+       } else {
+
+               wp->rects[color * wp->maxsize + wp->size[color]].x = x;
+               wp->rects[color * wp->maxsize + wp->size[color]].y = y;
+               wp->size[color]++;
+               if (ws->redrawing) {
+                       int         j;
+
+                       ws->redrawpos++;
+                       /* Compensates for the changed ws->tail
+                          since the last callback. */
+
+                       for (j = 0; j < REDRAWSTEP; j++) {
+                               int         k = (ws->tail - ws->redrawpos + wp->wormlength)
+                               % wp->wormlength;
+
+                               wp->rects[color * wp->maxsize + wp->size[color]].x = ws->circ[k].x;
+                               wp->rects[color * wp->maxsize + wp->size[color]].y = ws->circ[k].y;
+                               wp->size[color]++;
+
+                               if (++(ws->redrawpos) >= wp->wormlength) {
+                                       ws->redrawing = 0;
+                                       break;
+                               }
+                       }
+               }
+       }
+}
+
+static void
+free_worm(wormstruct * wp)
+{
+       int         wn;
+
+       if (wp->worm) {
+               for (wn = 0; wn < wp->nw; wn++) {
+                       if (wp->worm[wn].circ)
+                               (void) free((void *) wp->worm[wn].circ);
+                       if (wp->worm[wn].diffcirc)
+                               (void) free((void *) wp->worm[wn].diffcirc);
+               }
+               (void) free((void *) wp->worm);
+               wp->worm = NULL;
+       }
+       if (wp->rects) {
+               (void) free((void *) wp->rects);
+               wp->rects = NULL;
+       }
+       if (wp->size) {
+               (void) free((void *) wp->size);
+               wp->size = NULL;
+       }
+}
+
+void
+init_worm(ModeInfo * mi)
+{
+       wormstruct *wp;
+       int         size = MI_SIZE(mi);
+       int         i, j;
+
+       if (worms == NULL) {
+               if ((worms = (wormstruct *) calloc(MI_NUM_SCREENS(mi),
+                                              sizeof (wormstruct))) == NULL)
+                       return;
+       }
+       wp = &worms[MI_SCREEN(mi)];
+       if (MI_NPIXELS(mi) <= 2 || MI_IS_USE3D(mi))
+               wp->nc = 2;
+       else
+               wp->nc = MI_NPIXELS(mi);
+
+       free_worm(wp);
+       wp->nw = MI_COUNT(mi);
+       if (wp->nw < -MINWORMS)
+               wp->nw = NRAND(-wp->nw - MINWORMS + 1) + MINWORMS;
+       else if (wp->nw < MINWORMS)
+               wp->nw = MINWORMS;
+       if (!wp->worm)
+               if ((wp->worm = (wormstuff *) malloc(wp->nw *
+                               sizeof (wormstuff))) == NULL) {
+                       free_worm(wp);
+                       return;
+               }
+
+       if (!wp->size)
+               if ((wp->size = (int *) malloc(MI_NPIXELS(mi) *
+                               sizeof (int))) == NULL) {
+                       free_worm(wp);
+                       return;
+               }
+
+       wp->maxsize = (REDRAWSTEP + 1) * wp->nw;        /*  / wp->nc + 1; */
+       if (!wp->rects)
+               if ((wp->rects = (XRectangle *) malloc(wp->maxsize * MI_NPIXELS(mi) *
+                               sizeof (XRectangle))) == NULL) {
+                       free_worm(wp);
+                       return;
+               }
+
+       if (!init_table) {
+               init_table = 1;
+               for (i = 0; i < SEGMENTS; i++) {
+                       sintab[i] = SINF(i * 2.0 * M_PI / SEGMENTS);
+                       costab[i] = COSF(i * 2.0 * M_PI / SEGMENTS);
+               }
+       }
+       wp->xsize = MI_WIDTH(mi);
+       wp->ysize = MI_HEIGHT(mi);
+       wp->zsize = MAXZ - MINZ + 1;
+       if (MI_NPIXELS(mi) > 2)
+               wp->chromo = NRAND(MI_NPIXELS(mi));
+
+       if (size < -MINSIZE)
+               wp->circsize = NRAND(-size - MINSIZE + 1) + MINSIZE;
+       else if (size < MINSIZE)
+               wp->circsize = MINSIZE;
+       else
+               wp->circsize = size;
+
+       for (i = 0; i < wp->nc; i++) {
+               for (j = 0; j < wp->maxsize; j++) {
+                       wp->rects[i * wp->maxsize + j].width = wp->circsize;
+                       wp->rects[i * wp->maxsize + j].height = wp->circsize;
+
+               }
+       }
+       (void) memset((char *) wp->size, 0, wp->nc * sizeof (int));
+
+       wp->wormlength = (int) sqrt((double) wp->xsize + wp->ysize) *
+               MI_CYCLES(mi) / 8;      /* Fudge this to something reasonable */
+       for (i = 0; i < wp->nw; i++) {
+               if (((wp->worm[i].circ = (XPoint *) malloc(wp->wormlength *
+                               sizeof (XPoint))) == NULL) ||
+                   ((wp->worm[i].diffcirc = (int *) malloc(wp->wormlength *
+                               sizeof (int))) == NULL)) {
+                       free_worm(wp);
+                       return;
+               }
+
+               for (j = 0; j < wp->wormlength; j++) {
+                       wp->worm[i].circ[j].x = wp->xsize / 2;
+                       wp->worm[i].circ[j].y = wp->ysize / 2;
+                       if (MI_IS_USE3D(mi))
+                               wp->worm[i].diffcirc[j] = 0;
+               }
+               wp->worm[i].dir = NRAND(SEGMENTS);
+               wp->worm[i].dir2 = NRAND(SEGMENTS);
+               wp->worm[i].tail = 0;
+               wp->worm[i].x = wp->xsize / 2;
+               wp->worm[i].y = wp->ysize / 2;
+               wp->worm[i].z = SCREENZ - MINZ;
+               wp->worm[i].redrawing = 0;
+       }
+
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+}
+
+void
+draw_worm(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       GC          gc = MI_GC(mi);
+       wormstruct *wp = &worms[MI_SCREEN(mi)];
+       unsigned long wcolor;
+       int         i;
+
+       (void) memset((char *) wp->size, 0, wp->nc * sizeof (int));
+
+       MI_IS_DRAWN(mi) = True;
+
+       for (i = 0; i < wp->nw; i++) {
+               if (MI_NPIXELS(mi) > 2) {
+                       wcolor = (i + wp->chromo) % wp->nc;
+
+                       worm_doit(mi, i, wcolor);
+               } else
+                       worm_doit(mi, i, (unsigned long) 0);
+       }
+
+       if (MI_IS_USE3D(mi)) {
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXor);
+               XSetForeground(display, gc, MI_RIGHT_COLOR(mi));
+               XFillRectangles(display, window, gc, &(wp->rects[0]), wp->size[0]);
+
+               XSetForeground(display, gc, MI_LEFT_COLOR(mi));
+               XFillRectangles(display, window, gc, &(wp->rects[wp->maxsize]), wp->size[1]);
+               if (MI_IS_INSTALL(mi))
+                       XSetFunction(display, gc, GXcopy);
+       } else if (MI_NPIXELS(mi) > 2) {
+               for (i = 0; i < wp->nc; i++) {
+                       XSetForeground(display, gc, MI_PIXEL(mi, i));
+                       XFillRectangles(display, window, gc, &(wp->rects[i * wp->maxsize]), wp->size[i]);
+               }
+       } else {
+               XSetForeground(display, gc, MI_WHITE_PIXEL(mi));
+               XFillRectangles(display, window, gc,
+                               &(wp->rects[0]), wp->size[0]);
+       }
+
+       if (++wp->chromo == (unsigned long) wp->nc)
+               wp->chromo = 0;
+}
+
+void
+release_worm(ModeInfo * mi)
+{
+       if (worms != NULL) {
+               int         screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+                       free_worm(&worms[screen]);
+               (void) free((void *) worms);
+               worms = NULL;
+       }
+}
+
+void
+refresh_worm(ModeInfo * mi)
+{
+       if (MI_IS_INSTALL(mi) && MI_IS_USE3D(mi)) {
+               MI_CLEARWINDOWCOLOR(mi, MI_NONE_COLOR(mi));
+       } else {
+               MI_CLEARWINDOW(mi);
+       }
+       /* The 3D code does drawing&clearing by XORing.  We do not
+          want to go to too much trouble here to make it redraw
+          correctly. */
+       if (!MI_IS_USE3D(mi) && worms != NULL) {
+               wormstruct *wp = &worms[MI_SCREEN(mi)];
+               int         i;
+
+               for (i = 0; i < wp->nw; i++) {
+                       wp->worm[i].redrawing = 1;
+                       wp->worm[i].redrawpos = 0;
+               }
+       }
+}
+
+#endif /* MODE_worm */
diff --git a/modes/xcl.c b/modes/xcl.c
new file mode 100644 (file)
index 0000000..4e2ae33
--- /dev/null
@@ -0,0 +1,570 @@
+/*
+ *  xcl.c
+ *  Control-Line in a box
+ *  Copyright (c) 2000 by Martin Berentsen <berentsen@sent5.uni-duisburg.de>
+ *
+ * change-log 
+ * 0.4pl2 -> 0.5pl0 25/07/2000
+ * -singl command line option becomes to -count num 
+ * 0.5pl0 -> 0.5pl1 02.02.2001
+ * bugs in -oldcolor and -randomstart option removed
+ *
+ * TODO as next:
+ * - a user defined speed for every used plane 
+ *
+ */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)xcl.c    5.00 2000/11/01 xlockmore";
+#endif
+
+#define RAND(x)    (((my_random() % x )- x/2))  /* random number around 0 */
+#define ROTATEDELAY 20000      /* delay for view-model rotating */
+#define STARTUPDELAY 5000      /* delay for the first calibration loop */
+#define REGULATE 25                    /* regulate delay every xx frames */
+#define FRAMETIME 45000                /* time for one frame */
+#define MINPLANES 1           /* define the min number of planes */
+#define MAXCOUNT 30           /* define the max number of planes */
+
+#ifdef STANDALONE
+#define PROGCLASS "Xcl"
+#define HACK_INIT init_xcl
+#define HACK_DRAW draw_xcl
+#define xcl_opts xlockmore_opts
+#define DEFAULTS "*delay: 20000 \n" \
+ "*count: 2 \n"
+#define UNIFORM_COLORS
+#include "xlockmore.h"        /* in xscreensaver distribution */
+#else /* STANDALONE */
+#include "xlock.h"        /* in xlockmore distribution */
+#endif
+
+#include "xcl.h"             /* model line data file */
+
+/* all parameters are global */
+static float speed[MAXCOUNT];     /* Speed in km/h */
+static float speed_in;       /* speed set by user */
+static int frametime;       /* time for one frame in usecs */
+static int line_length;     /* lines in mm*/
+static float spectator;     /* spectator distance from zero*/
+static Bool viewmodel;      /* shows one rotating model*/
+static Bool oldcolor;       /* use the old yellow/red color combination */
+static Bool debug;          /* debug modus */
+static Bool automatic;      /* automatic scale for fit into window */
+static Bool randomstart;    /* don't use the same start position */
+static int random_pid;
+
+
+#define DEF_SPEED_IN  "105.0"
+#define DEF_FRAMETIME  "45000"
+#define DEF_LINE_LENGTH  "15910"
+#define DEF_SPECTATOR  "22000"
+#define DEF_VIEWMODEL  "False"
+#define DEF_OLDCOLOR  "False"
+#define DEF_XCLDEBUG  "False"
+#define DEF_AUTOMATIC  "True"
+#define DEF_RANDOMSTART  "False"
+
+
+static XrmOptionDescRec opts[] =
+{
+  {(char *) "-speed", (char *) ".xcl.speed", XrmoptionSepArg, (caddr_t) NULL},
+  {(char *) "-frametime", (char *) ".xcl.frametime", XrmoptionSepArg, (caddr_t) NULL},
+  {(char *) "-line_length", (char *) ".xcl.line_length", XrmoptionSepArg, (caddr_t) NULL},
+  {(char *) "-spectator", (char *) ".xcl.spectator", XrmoptionSepArg, (caddr_t) NULL},
+  {(char *) "-viewmodel", (char *) ".xcl.viewmodel", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+viewmodel", (char *) ".xcl.viewmodel", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-oldcolor", (char *) ".xcl.oldcolor", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+oldcolor", (char *) ".xcl.oldcolor", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-xcldebug", (char *) ".xcl.xcldebug", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+xcldebug", (char *) ".xcl.xcldebug", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-automatic", (char *) ".xcl.automatic", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+automatic", (char *) ".xcl.automatic", XrmoptionNoArg, (caddr_t) "off"},
+  {(char *) "-randomstart", (char *) ".xcl.randomstart", XrmoptionNoArg, (caddr_t) "on"},
+  {(char *) "+randomstart", (char *) ".xcl.randomstart", XrmoptionNoArg, (caddr_t) "off"}
+};
+static argtype vars[] =
+{
+  {(caddr_t *) & speed_in, (char *) "speed", (char *) "Speed", (char *) DEF_SPEED_IN, t_Float},
+  {(caddr_t *) & frametime, (char *) "frametime", (char *) "frametime", (char *) DEF_FRAMETIME, t_Int},
+  {(caddr_t *) & line_length, (char *) "line_length", (char *) "Line_length", (char *) DEF_LINE_LENGTH, t_Int},
+  {(caddr_t *) & spectator, (char *) "spectator", (char *) "Spectator", (char *) DEF_SPECTATOR, t_Float},
+  {(caddr_t *) & viewmodel, (char *) "viewmodel", (char *) "Viewmodel", (char *) DEF_VIEWMODEL, t_Bool},
+  {(caddr_t *) & oldcolor, (char *) "oldcolor", (char *) "Oldcolor", (char *) DEF_OLDCOLOR, t_Bool},
+  {(caddr_t *) & debug, (char *) "xcldebug", (char *) "Xcldebug", (char *) DEF_XCLDEBUG, t_Bool},
+  {(caddr_t *) & automatic, (char *) "automatic", (char *) "Automatic", (char *) DEF_AUTOMATIC, t_Bool},
+  {(caddr_t *) & randomstart, (char *) "randomstart", (char *) "Randomstart", (char *) DEF_RANDOMSTART, t_Bool}
+};
+static OptionStruct desc[] =
+{
+  {(char *) "-speed num", (char *) "speed for the planes in km/h "},
+  {(char *) "-frametime num", (char *) "time for one frame on the screen in usecs "},
+  {(char *) "-line_length num", (char *) "distance between the pilot and the plane in mm "},
+  {(char *) "-spectator num", (char *) "distance  between  spectator  and  pilot in mm"},
+  {(char *) "-/+viewmodel", (char *) "turn on/off an anim view of one model"},
+  {(char *) "-/+oldcolor", (char *) "turn on/off the old yellow/red combination"},
+  {(char *) "-/+xcldebug", (char *) "turn on/off some timing information"},
+  {(char *) "-/+automatic", (char *) "turn on/off auto scale for fit into the window"},
+  {(char *) "-/+randomstart", (char *) "turn on/off a random start point for models at startup"}
+};
+
+ModeSpecOpt xcl_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES    /* for xlockmore */
+ModStruct   xcl_description =
+{"xcl", "init_xcl", "draw_xcl", "release_xcl",
+ "draw_xcl", "init_xcl", NULL, &xcl_opts ,
+ 20000, -3, 1, 1, 64, 1.0, "",
+ "Shows a control line combat model race", 0, NULL};
+#endif
+
+typedef struct
+{
+  int planes;    /* number of planes viewed*/
+  int lines;     /* number of lines counted in model */
+  double az[MAXCOUNT];  /* azimuth of plane */
+  double el[MAXCOUNT];  /* elevation of plane */
+  int width;
+  int height;
+  int mid_x;
+  int mid_y;
+  float Alpha;   /* rotate.1 */
+  float Beta;    /* rotate.2 */
+  float Gamma;   /* rotate.3 */
+  float Vx;      /* width from zero in X */
+  float Vy;      /* width from zero in Y */
+  float Vz;      /* width from zero in Z */
+  float G;       /* ZOOM  */
+  float Ca,Cb,Cc,Sa,Sb,Sc; /* only for faster calculation */
+  float Bx,By ;
+  struct timeval tv1;
+  double time1, time2, time3;        /* calibrate time */
+  int drawtime;
+  double alpha[MAXCOUNT];            /* direction */
+  double omega_const[MAXCOUNT];      /*  constant omega speed */
+  double delta_az[MAXCOUNT];
+  double delta_el[MAXCOUNT];
+  int turn[MAXCOUNT];
+  int turn_direction[MAXCOUNT];
+  int random_pid;
+  long planecolor[MAXCOUNT],bg;      /* used colours */
+  GC gc[MAXCOUNT];
+  GC erase_gc;
+  XSegment *xseg[MAXCOUNT];
+  XSegment *xseg_old[MAXCOUNT];
+  int xcldelay;
+  int no_preset;
+} xclstruct;
+
+static xclstruct *xcls = NULL;
+
+static int my_random(void)  /* not really good, but it works */
+{
+  static int number;
+  number -= random_pid;
+  return ( 0x0fff & (number));
+}
+
+static int countlines(void)
+{
+  int array;
+  int count = 0;
+  for(array = 0;array<LINEARRAYS;array++) {
+    count += model_data2[array][0] - 1;
+  }
+  return(count);
+}
+
+static void um2(int X, int Y, int Z, xclstruct *dp)
+{
+  float X2,X3,X4,Y1,Y3,Y4,Z1,Z2,Z4;
+  
+  Y1 = dp->Ca * Y - dp->Sa * Z;
+  Z1 = dp->Sa * Y + dp->Ca * Z;
+  X2 = dp->Cb * X - dp->Sb * Z1;
+  Z2 = dp->Sb * X + dp->Cb * Z1;
+  X3 = dp->Cc * X2 - dp->Sc * Y1;
+  Y3 = dp->Sc * X2 + dp->Cc * Y1;
+  X4 = X3 + dp->Vx;
+  Y4 = Y3 + dp->Vy;
+  Z4 = Z2 + dp->Vz;
+
+  dp->Bx = dp->mid_x + (-X4 / Y4 * dp->G);
+  dp->By = dp->mid_y - (-Z4 / Y4 * dp->G);
+}
+
+static void view_3d(XSegment *xseg, xclstruct *dp)
+{
+  int count = 0;
+  int I,J;
+  float BX [ENDPOINTS];
+  float BY [ENDPOINTS];
+
+  dp->Ca = cos(dp->Alpha);
+  dp->Cb = cos(dp->Beta);
+  dp->Cc = cos(dp->Gamma);
+  dp->Sa = sin(dp->Alpha);
+  dp->Sb = sin(dp->Beta);
+  dp->Sc = sin(dp->Gamma);
+
+  for(I = 0; I < ENDPOINTS; I++) {
+    um2( model_data1 [ I * 3 + 0], model_data1 [ I * 3 + 1], 
+         model_data1 [ I * 3 + 2],dp);
+    BX [I] = dp->Bx;
+    BY [I] = dp->By;
+  }
+  for (I = 0; I < LINEARRAYS; I++) {
+    for (J = 1; J < model_data2[I][0]; J++) {
+      xseg[count].x1 = (short) BX[(model_data2[I][J])-1];
+      xseg[count].y1 = (short) BY[(model_data2[I][J])-1]+(dp->mid_y/2);
+      xseg[count].x2 = (short) BX[(model_data2[I][J+1])-1];
+      xseg[count].y2 = (short) BY[(model_data2[I][J+1])-1]+(dp->mid_y/2);
+      count++;
+    }
+  }
+}
+
+static long get_color(Display *dpy,char *color,XColor *final_color)
+{
+  XColor cdef;
+  Colormap cmap;
+  cmap = DefaultColormap(dpy,DefaultScreen(dpy));
+  
+  if (!XParseColor(dpy, cmap, color, &cdef) ||
+      !XAllocColor(dpy, cmap, &cdef))
+    {
+      (void) fprintf(stderr, "Color \"%s\" wasn't found\n", color);
+    }
+  
+  if (final_color != NULL) *final_color = cdef;  /* copy the final color. */
+  
+  return(cdef.pixel);
+}
+
+static Bool get_GC(Display *dpy,Window win,GC *gc,long color)
+{
+  unsigned long valuemask = 0;  /*ignore XGCvalues and use defaults */
+  XGCValues values;
+  unsigned int line_width = 1;
+  int line_style = LineSolid;   /* LineOnOffDash;*/
+  int cap_style = CapRound;
+  int join_style = JoinRound;
+
+  if ((*gc = XCreateGC(dpy, win, valuemask , &values)) == None)
+    return False;
+  XSetForeground(dpy, *gc, color);
+
+  XSetLineAttributes(dpy, *gc, line_width, line_style,
+             cap_style, join_style);
+  return True;
+}
+
+static void
+free_xcl(Display *display, xclstruct  *dp)
+{
+    int plane;
+      
+    for (plane = 0; plane < dp->planes; plane++) {
+      if (dp->xseg[plane] != NULL) {
+        (void) free((void *) dp->xseg[plane]);
+        dp->xseg[plane] = NULL;
+      }
+      if (dp->xseg_old[plane] != NULL) {
+        free(dp->xseg_old[plane]);
+        dp->xseg_old[plane] = NULL;
+      }
+      if (dp->gc[plane] != None) {
+        XFreeGC(display, dp->gc[plane]);
+        dp->gc[plane] = None;
+      }
+    }
+    if (dp->erase_gc != None) {
+      XFreeGC(display, dp->erase_gc);
+      dp->erase_gc = None;
+    }
+}
+
+void release_xcl(ModeInfo * mi)
+{
+  if (xcls != NULL) {
+    int screen;
+    for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
+      free_xcl(MI_DISPLAY(mi), &xcls[screen]);
+    (void) free((void *) xcls);
+    xcls = NULL;
+  }
+}
+
+void init_xcl(ModeInfo * mi)
+{
+  Display *display = MI_DISPLAY(mi);
+  int i;            /* scratch */
+  xclstruct *dp;
+  
+  if (xcls == NULL) {
+    if ((xcls = (xclstruct *) calloc(MI_NUM_SCREENS(mi),
+                                     sizeof (xclstruct))) == NULL)
+      return;
+  }
+  dp = &xcls[MI_SCREEN(mi)];
+  
+  /* Update every time */
+  dp->width = MI_WIDTH(mi);
+  dp->height = MI_HEIGHT(mi);
+  dp->mid_x = (dp->width / 2);
+  dp->mid_y = (dp->height / 2);
+  
+  if(dp->no_preset != 1) {
+    dp->no_preset = 1;
+    /* some presettings */
+    dp->planes = MI_COUNT(mi);
+    if (dp->planes < -MINPLANES) {
+      dp->planes = NRAND(-MI_COUNT(mi) -MINPLANES + 1) + MINPLANES;
+    } else if (dp->planes < MINPLANES) {
+      dp->planes = MINPLANES;
+    }
+    if(dp->planes > MAXCOUNT)
+      dp->planes = MAXCOUNT;
+    dp->Alpha = 0.0;          /* rotate.1 */
+    dp->Beta  = 0.0;          /* rotate.2 */
+    dp->Gamma = 0.0;          /* rotate.3 */
+    dp->Vx = 1;               /* width from zero in X */
+    dp->Vy = 800;             /* width from zero in Y */
+    dp->Vz = -300;            /* width from zero in Z */
+    dp->G =  500.0;           /* ZOOM  */
+    dp->time3 = 1.0;
+    dp->drawtime = 25000;
+    dp->xcldelay = STARTUPDELAY;
+    for(i=0;i< dp->planes; i++) {
+      dp->az[i] = 2 * M_PI * i / (float)((dp->planes));
+      dp->el[i] = 0.0;
+      dp->alpha[i] = 0.75;      /* direction */
+      dp->turn[i] = 0;
+      dp->turn_direction[i] = 1;
+      
+      speed[i] = speed_in;  /* see TODO */
+    }
+    
+    random_pid = getpid(); /* goes here first for randomstart */
+    
+    if(randomstart) {
+      for(i=0;i< dp->planes; i++) { 
+        switch(i) {
+        case 0:
+          dp->az[0] += (random_pid % 31) / 5.0;
+          break;
+        default:
+          dp->az[i] = dp->az[0] + 2 * M_PI * i / (float)((dp->planes));
+        }
+      }
+    }
+    
+    dp->bg = MI_BLACK_PIXEL(mi);
+    
+    if(MI_IS_MONO(mi))
+      for(i=0;i< dp->planes; i++) { 
+        dp->planecolor[i] = MI_WHITE_PIXEL(mi);
+      }
+    else {
+      if(!oldcolor) {
+        for(i=0;i< dp->planes; i++) { 
+          dp->planecolor[i] = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+        }
+      }
+      else { /* with count >2 no so good */
+        for(i=0;i< dp->planes; i++) { 
+          switch(i) {
+          case 0:
+            dp->planecolor[0] = get_color(display, (char *) "yellow",NULL);
+            break;
+          case 1:
+            dp->planecolor[1] = get_color(display, (char *) "red",NULL);
+            break;
+          default:
+            dp->planecolor[i] = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+          }
+        }
+      }
+    }
+    
+    if(dp->erase_gc == NULL)
+      if (!get_GC(display, MI_WINDOW(mi), &(dp->erase_gc),dp->bg)) {
+        free_xcl(display, dp);
+        return;
+      }
+    
+    dp->lines = countlines();
+    
+    for(i=0;i< dp->planes; i++) { 
+      if(dp->gc[i] == NULL)
+        if (!get_GC(display, MI_WINDOW(mi), &(dp->gc[i]),
+                    dp->planecolor[i])) {
+          free_xcl(display, dp);
+          return;
+        }
+      dp->omega_const[i] = speed[i]/3.6 /line_length*1000.0;
+      
+      if(dp->xseg[i] == NULL)
+        if ((dp-> xseg[i] = (XSegment *) malloc(sizeof(XSegment) *
+                                                dp->lines)) == NULL) {
+          free_xcl(display, dp);
+          return;
+        }
+      if(dp->xseg_old[i] == NULL)
+        if ((dp->xseg_old[i] = (XSegment *) malloc(sizeof(XSegment) *
+                                                   dp->lines)) == NULL) {
+          free_xcl(display, dp);
+          return;
+        }
+    }
+    
+    if(MI_IS_VERBOSE(mi)) {
+      (void) printf("X control line combat in a box\n");
+#if !defined( lint ) && !defined( SABER )
+      (void) printf("Version: %s\n",sccsid);
+#endif
+      (void) printf("Line length: %gm\n",line_length/1000.0);
+      (void) printf("Speed %g km/h  \n",speed[0]);
+      (void) printf("Lines per plane: %d\n",dp->lines);
+      (void) printf("Spectator at %gm\n",spectator/1000.0);
+      (void) printf("Try %g frames per Second (frametime: %dus)\n",
+                    1000000.0/frametime,frametime);
+      (void) printf("Calibration at %d frames\n",REGULATE);
+    }
+  }
+  
+  /* clear the screen */
+  
+  MI_CLEARWINDOW(mi);
+    
+  (void) gettimeofday(&(dp->tv1),0);
+  dp->time1 = (double)dp->tv1.tv_sec + 
+    (double)dp->tv1.tv_usec/(double)1000000;
+  
+  dp->xcldelay = frametime;
+}
+
+void draw_xcl(ModeInfo * mi)
+{
+  static int count = 0;
+  int i;
+  xclstruct *dp;
+  
+  if (xcls == NULL)
+    return;
+  dp = &xcls[MI_SCREEN(mi)];
+  if (dp->erase_gc == None)
+    return;
+  
+  if(viewmodel == True)
+    {
+      dp->Vx = 1;                     /* movement in X (width,negativ)*/
+      if(dp->width < 900)
+        dp->Vy = 800*800/dp->width;   /*  Y (deep)*/
+      else
+        dp->Vy = 800*1200/dp->width;  /*  Y (deep)*/
+      dp->Vz = -300;                  /*  Z (height) */
+      dp->G = 350.0;          /* make it smaller when display is smaller */
+      dp->Alpha += 0.03;
+      dp->Beta += 0.006;
+      dp->Gamma += 0.009;
+      
+      if (count != 0) {
+        XDrawSegments(MI_DISPLAY(mi),MI_WINDOW(mi),dp->erase_gc,
+                      dp->xseg_old[0],dp->lines);
+        XDrawSegments(MI_DISPLAY(mi),MI_WINDOW(mi),dp->gc[0],
+                      dp->xseg[0],dp->lines);
+        (void) usleep(ROTATEDELAY * 2);
+      }
+      (void) memcpy(dp->xseg_old[0],dp->xseg[0],sizeof(XSegment)*dp->lines);
+      view_3d(dp->xseg[0],dp);
+      count ++;
+    }
+  else {
+    if(automatic)
+      dp->G = dp->width / 2.1 ;
+    
+    for(i=0;i<dp->planes;i++) {
+      (void) memcpy(dp->xseg_old[i],dp->xseg[i],sizeof(XSegment)*dp->lines);
+      
+      dp->Alpha = - dp->alpha[i];
+      dp->Beta = - dp->el[i];
+      dp->Gamma = dp->az[i];
+      
+      dp->Vx = -(int)(cos(dp->az[i]) * cos(dp->el[i]) * line_length);
+      dp->Vy = spectator - 
+        (int)(sin(dp->az[i]) * cos(dp->el[i]) * line_length);
+      dp->Vz = (int)(sin(dp->el[i]) * line_length);
+      
+      view_3d(dp->xseg[i],dp);
+      XDrawSegments(MI_DISPLAY(mi),MI_WINDOW(mi),dp->erase_gc,
+                    dp->xseg_old[i],dp->lines);
+      XDrawSegments(MI_DISPLAY(mi),MI_WINDOW(mi),dp->gc[i],
+                    dp->xseg[i],dp->lines);
+    }
+    
+    XFlush(MI_DISPLAY(mi));
+    
+    /* now move all planes */
+    for(i=0;i<dp->planes;i++) {
+      dp->delta_az[i] = cos(dp->alpha[i]) * dp->omega_const[i] *
+        frametime/1000000;
+      dp->delta_el[i] = sin(dp->alpha[i]) * dp->omega_const[i] *
+        frametime/1000000;
+      
+      dp->az[i] -= dp->delta_az[i];
+      dp->el[i] -= dp->delta_el[i];
+      
+      if (dp->el[i] >= 0.0)
+        switch (dp->turn[i]) {
+        case 0:
+          dp->turn_direction[i] *= -1;
+          dp->alpha[i] += 0.62831853 * dp->turn_direction[i];
+          dp->turn[i] ++;
+          break;
+        case 1:
+        case 2:
+        case 3:
+        case 4:
+        case 5:
+          dp->alpha[i] += 0.62831853 * dp->turn_direction[i];
+          dp->turn[i] ++;
+          break;
+        default:
+          dp->turn[i] ++;
+          break;
+        }
+      else
+        dp->turn[i] = 0;
+      if (dp->el[i] <= -(M_PI / 2.0))
+        {
+          dp->alpha[i] += M_PI;
+          dp->az[i] += M_PI;
+          /* el[i] = el[i] + (M_PI / 2.0) ; */
+        }
+      else
+        if(dp->turn[i] == 0)
+          dp->alpha[i] += (double)(RAND(600))  / 6283.0 * 2.0 * M_PI;
+    } /* for (i) */
+    
+    count++;
+    
+    (void) usleep(dp->xcldelay);
+    if((count % REGULATE) == 0) {
+      (void) gettimeofday(&(dp->tv1),0);
+      dp->time2 = (double)dp->tv1.tv_sec + (double)dp->tv1.tv_usec/
+        (double)1000000;
+      dp->time3 = dp->time2 - dp->time1;
+      dp->time1 = dp->time2;
+      dp->drawtime = (int) (dp->time3 * (1000000/REGULATE))  
+        - dp->xcldelay;
+      if((dp->xcldelay = frametime - dp->drawtime) <= 0) {
+        dp->xcldelay = 10;  /* 1 is possible xor xscreensaver mode */
+      }
+      if(debug == True)
+        (void) printf("t_draw: %d, t_delay: %d\n",dp->drawtime,
+                      dp->xcldelay);
+    }
+  }
+}
diff --git a/modes/xcl.h b/modes/xcl.h
new file mode 100644 (file)
index 0000000..9638d2a
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * xcl.h
+ * Control Line combat model data for xcl.c
+ * Copyright (c) 2000 by Martin Berentsen <berentsen@sent5.uni-duisburg.de>
+ * 2000/05/19
+ */
+
+#define ENDPOINTS 83
+#define LINEARRAYS 33
+#define ARRAYSIZE 5+1
+
+static int model_data1 [ENDPOINTS * 3] =
+{
+  0,15,0,       /* 1,1 */
+  0,13,5,
+  0,10,10,
+  0,5,12,
+  0,0,13,
+  0,13,-5,
+  0,10,-10,
+  0,5,-12,
+  0,0,-13,
+  0,-270,2,
+  0,-270,-2,
+
+  150,15,0,  /* 2, 12 */
+  150,13,5,
+  150,10,10,
+  150,5,12,
+  150,0,13,
+  150,13,-5,
+  150,10,-10,
+  150,5,-12,
+  150,0,-13,
+  150,-230,2,
+  150,-230,-2,
+
+  -150,15,0,  /* 3,23 */
+  -150,13,5,
+  -150,10,10,
+  -150,5,12,
+  -150,0,13,
+  -150,13,-5,
+  -150,10,-10,
+  -150,5,-12,
+  -150,0,-13,
+  -150,-230,2,
+  -150,-230,-2,
+
+  300,15,0,   /* 4, 34 */
+  300,13,5,
+  300,10,10,
+  300,5,12,
+  300,0,13,
+  300,13,-5,
+  300,10,-10,
+  300,5,-12,
+  300,0,-13,
+  300,-190,2,
+  300,-190,-2,
+
+  -300,15,0,  /* 5, 45 */
+  -300,13,5,
+  -300,10,10,
+  -300,5,12,
+  -300,0,13,
+  -300,13,-5,
+  -300,10,-10,
+  -300,5,-12,
+  -300,0,-13,
+  -300,-190,2,
+  -300,-190,-2,
+
+  450,15,0,   /* 6, 56 */
+  450,13,5,
+  450,10,10,
+  450,5,12,
+  450,0,13,
+  450,13,-5,
+  450,10,-10,
+  450,5,-12,
+  450,0,-13,
+  450,-150,2,
+  450,-150,-2,
+
+  -450,15,0,   /* 7, 67 */
+  -450,13,5,
+  -450,10,10,
+  -450,5,12,
+  -450,0,13,
+  -450,13,-5,
+  -450,10,-10,
+  -450,5,-12,
+  -450,0,-13,
+  -450,-150,2,
+  -450,-150,-2,
+
+  0,-270,0,
+  100,-290,0,
+  100,-325,0,
+  -100,-325,0,
+  -100,-290,0,
+};
+
+static int model_data2 [LINEARRAYS] [ARRAYSIZE] =
+ {
+   {5, 1,2,3,4,5 },
+   {5, 1,6,7,8,9 },
+   {4, 5,10,11,9,0},
+
+   {5, 12,13,14,15,16},
+   {5, 12,17,18,19,20},
+   {4, 16,21,22,20,0},
+
+   {5, 23,24,25,26,27},
+   {5, 23,28,29,30,31},
+   {4, 27,32,33,31,0},
+
+   {5, 34,35,36,37,38},
+   {5, 34,39,40,41,42},
+   {4, 38,43,44,42,0},
+
+   {5, 45,46,47,48,49},
+   {5, 45,50,51,52,53},
+   {4, 49,54,55,53,0},
+
+   {5, 56,57,58,59,60},
+   {5, 56,61,62,63,64},
+   {4, 60,65,66,64,0},
+
+   {5, 67,68,69,70,71},
+   {5, 67,72,73,74,75},
+   {4, 71,76,77,75,0},
+
+   {5, 10,21,43,65,66},
+   {5, 10,32,54,76,77},
+   {4, 77,55,33,11,0},
+   {4, 66,44,22,11,0},
+
+   {4, 1,12,34,56,0},
+   {4, 1,23,45,67,0},
+
+   {4, 5,16,38,60,0},
+   {4, 5,27,49,71,0},
+
+   {4, 9,20,42,64,0},
+   {4, 9,31,53,75,0},
+
+   {5, 78,79,80,81,82},
+   {2, 82,78,0,0,0}
+ };
diff --git a/modes/xjack.c b/modes/xjack.c
new file mode 100644 (file)
index 0000000..38ca417
--- /dev/null
@@ -0,0 +1,465 @@
+/* -*- Mode: C; tab-width: 4 -*- */
+/* xjack -- Jack having one of those days */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)xjack.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/* xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * Wendy, let me explain something to you.  Whenever you come in here and
+ * interrupt me, you're BREAKING my CONCENTRATION.  You're DISTRACTING me!
+ * And it will then take me time to get back to where I was. You understand?
+ * Now, we're going to make a new rule.        When you come in here and you hear
+ * me typing, or whether you DON'T hear me typing, or whatever the FUCK you
+ * hear me doing; when I'm in here, it means that I am working, THAT means
+ * don't come in!  Now, do you think you can handle that?
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 10-Oct-1998: revision history edited.
+ */
+
+#ifdef STANDALONE
+#define PROGCLASS "XJack"
+#define HACK_INIT init_xjack
+#define HACK_DRAW draw_xjack
+#define xjack_opts xlockmore_opts
+#define DEFAULTS "*delay: 50000 \n" \
+ "*font: \n" \
+ "*text: \n" \
+ "*fullrandom: True \n"
+#define DEF_FONT "-*-courier-medium-r-*-*-*-240-*-*-m-*-*-*",
+#define DEF_TEXT "All work and no play makes Jack a dull boy.  ";
+#include "xlockmore.h"  /* in xscreensaver distribution */
+
+#else /* STANDALONE */
+#include "xlock.h"     /* in xlockmore distribution */
+#endif
+#include "iostuff.h"
+
+#ifdef MODE_xjack
+
+ModeSpecOpt xjack_opts =
+{0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL};
+
+#ifdef USE_MODULES
+ModStruct       xjack_description =
+{"xjack", "init_xjack", "draw_xjack", "release_xjack",
+ "init_xjack", "init_xjack", NULL, &xjack_opts,
+ 50000, 1, 1, 1, 64, 1.0, "",
+ "Shows Jack having one of those days", 0, NULL};
+
+#endif
+
+#define font_height(f) ((f==None)?8:f->ascent + f->descent)
+
+extern XFontStruct *getFont(Display * display);
+
+typedef struct {
+       int   word_length;
+       int   sentences;
+       int   paras;
+       Bool  caps;
+       Bool  break_para;
+       int   mode, stage, busyloop;
+       int   left, right;      /* characters */
+       int   x, y;             /* characters */
+       int   hspace, vspace;   /* pixels */
+       int   ascent;
+       int   height;
+       int   win_width, win_height;
+       int   columns, rows;    /* characters */
+       int   char_width, line_height;  /* pixels */
+       const char *s;
+       GC    gc;
+} jackstruct;
+
+static jackstruct *jacks = NULL;
+
+static XFontStruct *mode_font = None;
+static const char *source = "All work and no play makes Jack a dull boy.  ";
+static const char *source_message;
+
+extern char *message;
+
+void
+release_xjack(ModeInfo * mi)
+{
+       if (jacks != NULL) {
+               int                              screen;
+
+               for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+                       jackstruct *jp = &jacks[screen];
+                       Display         *display = MI_DISPLAY(mi);
+
+                       if (jp->gc)
+                               XFreeGC(display, jp->gc);
+               }
+               (void) free((void *) jacks);
+               jacks = NULL;
+       }
+       if (mode_font != None) {
+               XFreeFont(MI_DISPLAY(mi), mode_font);
+               mode_font = None;
+       }
+}
+
+void
+init_xjack(ModeInfo * mi)
+{
+       Display         *display = MI_DISPLAY(mi);
+       jackstruct *jp;
+       XGCValues gcv;
+
+
+       if (jacks == NULL) {
+               if ((jacks = (jackstruct *) calloc(MI_NUM_SCREENS(mi),
+                        sizeof (jackstruct))) == NULL)
+                       return;
+       }
+       jp = &jacks[MI_SCREEN(mi)];
+       if (mode_font == None)
+               if ((mode_font = getFont(display)) == None) {
+                       release_xjack(mi);
+               }
+
+       if (jp->gc == NULL) {
+               gcv.font = mode_font->fid;
+               XSetFont(display, MI_GC(mi), mode_font->fid);
+               gcv.graphics_exposures = False;
+               gcv.foreground = MI_WHITE_PIXEL(mi);
+               gcv.background = MI_BLACK_PIXEL(mi);
+               if ((jp->gc = XCreateGC(display, MI_WINDOW(mi),
+                               GCForeground | GCBackground | GCGraphicsExposures | GCFont,
+                               &gcv)) == None) {
+                       return;
+               }
+               jp->ascent = mode_font->ascent;
+               jp->height = font_height(mode_font);
+       }
+
+       jp->win_width = MI_WIDTH(mi);
+       jp->win_height = MI_HEIGHT(mi);
+
+       jp->hspace = jp->vspace = 15;  /* pixels */
+       jp->char_width = (mode_font->per_char
+                               ? mode_font->per_char['n' - mode_font->min_char_or_byte2].rbearing
+                               : mode_font->min_bounds.rbearing);
+  if (!jp->char_width)
+               jp->char_width = 1;
+       jp->line_height = jp->height + 1;
+
+       jp->columns = (jp->win_width - jp->hspace - jp->hspace) / jp->char_width;
+       jp->rows = (MI_HEIGHT(mi) - jp->vspace - jp->vspace) / jp->line_height;
+
+       jp->left = 0xFF & (NRAND((jp->columns / 2) + 1));
+       if ( jp->columns - jp->left != 10 )
+               jp->right = jp->left + (0xFF & (NRAND(jp->columns - jp->left - 10) + 10));
+       else
+               jp->right = jp->left + 10;
+       jp->x = 0;
+       jp->y = 0;
+       jp->sentences = 0;
+       jp->paras = 0;
+       jp->caps = False;
+       jp->break_para = True;
+       jp->mode = 0;
+       jp->stage = 0;
+       jp->busyloop = 0;
+       if (!message || !*message)
+               source_message = source;
+       else
+               source_message = message;
+       jp->s = source_message;
+       MI_CLEARWINDOW(mi);
+}
+
+void
+draw_xjack(ModeInfo * mi)
+{
+       Display         *display = MI_DISPLAY(mi);
+       Window                  window = MI_WINDOW(mi);
+       const char *s2;
+       jackstruct *jp;
+
+       if (jacks == NULL)
+               return;
+       jp = &jacks[MI_SCREEN(mi)];
+       if (jp->gc == None)
+               return;
+
+       jp->word_length = 0;
+       for (s2 = jp->s; *s2 && *s2 != ' '; s2++)
+               jp->word_length++;
+
+       if (jp->break_para || (*(jp->s) != ' ' &&
+                (jp->x + jp->word_length) >= jp->right)) {
+               jp->x = jp->left;
+               jp->y++;
+
+               if (jp->break_para)
+                       jp->y++;
+
+               if (jp->mode == 1 || jp->mode == 2) {
+                       /* 1 = left margin goes southwest; 2 = southeast */
+                       jp->left += (jp->mode == 1 ? 1 : -1);
+                       if (jp->left >= jp->right - 10) {
+                               if ((jp->right < (jp->columns - 10)) && (LRAND() & 1))
+                                       jp->right += (0xFF & (NRAND(jp->columns - jp->right)));
+                               else
+                                       jp->mode = 2;
+                       } else if (jp->left <= 0) {
+                               jp->left = 0;
+                               jp->mode = 1;
+                       }
+               } else if (jp->mode == 3 || jp->mode == 4) {
+                       /* 3 = right margin goes southeast; 4 = southwest */
+                       jp->right += (jp->mode == 3 ? 1 : -1);
+                       if (jp->right >= jp->columns) {
+                               jp->right = jp->columns;
+                               jp->mode = 4;
+                       } else if (jp->right <= jp->left + 10)
+                               jp->mode = 3;
+                       }
+
+                       if (jp->y >= jp->rows) {  /* bottom of page */
+                               /* scroll by 1-5 lines */
+                               int lines = ((NRAND(5)) ? 0 : (0xFF & (NRAND(5)))) + 1;
+
+                               if (jp->break_para)
+                                       lines++;
+
+                               /* but sometimes scroll by a whole page */
+                               if (!NRAND(100))
+                                       lines += jp->rows;
+
+                               while (lines > 0) {
+                                       XCopyArea(display, window, window, jp->gc,
+                                                               0, jp->hspace + jp->line_height,
+                                                               jp->win_width,
+                                                               jp->win_height - jp->vspace - jp->vspace - jp->line_height,
+                                                               0, jp->vspace);
+                                       XClearArea(display, window,
+                                                               0,      jp->win_height - jp->vspace - jp->line_height,
+                                                               jp->win_width,
+                                                               jp->line_height + jp->vspace + jp->vspace,
+                                                               False);
+                                       XClearArea(display, window, 0, 0,       jp->win_width, jp->vspace, False);
+                                       /* See? It's OK. He saw it on the television. */
+                                       XClearArea(display, window, 0, 0, jp->hspace, jp->win_height, False);
+                                       XClearArea(display, window,     jp->win_width - jp->vspace, 0,
+                                                               jp->hspace, jp->win_height, False);
+                                       jp->y--;
+                                       lines--;
+#if 0
+                                       XFlush(display);
+                                       if (delay)
+                                                (void) usleep (delay * 10);
+#endif
+                               }
+                               if (jp->y < 0)
+                                       jp->y = 0;
+                       }
+
+                       jp->break_para = False;
+               }
+
+               if (*(jp->s) != ' ') {
+                       char c = *(jp->s);
+                       int xshift = 0, yshift = 0;
+
+                       if (!NRAND(50)) {
+                               xshift = NRAND((jp->char_width / 3) + 1);  /* mis-strike */
+                               yshift = NRAND((jp->line_height / 6) + 1);
+                               if (!NRAND(3))
+                                       yshift *= 2;
+                               if (LRAND() & 1)
+                                       xshift = -xshift;
+                               if (LRAND() & 1)
+                                       yshift = -yshift;
+                       }
+
+                       if (!NRAND(250)) {  /* introduce adjascent-key typo */
+                               static const char * const typo[] = {
+                                       "asqwz", "bghnv", "cdfvx", "dcefsrx", "edrsw34",
+                                       "fcdegrtv", "gbfhtvy", "hbgjnuy", "ijkou89", "jhikmnu",
+                                       "kijolm,", "lkop;.,", "mjkn,", "nbhjm", "oiklp09",
+                                       "plo;[-0", "qasw12", "redft45", "sadewxz", "tfgry56",
+                                       "uhijy78", "vbcfg", "waeqs23", "xcdsz", "yuhgt67",
+                                       "zasx", ".l,;/",
+                                       "ASQWZ", "BGHNV", "CDFVX", "DCEFSRX", "EDRSW#$",
+                                       "FCDEGRTV", "GBFHTVY", "HBGJNUY", "IJKOU*(", "JHIKMNU",
+                                       "KIJOLM,", "LKOP:><", "MJKN<", "NBHJM", "OIKLP)(",
+                                       "PLO:{_)", "QASW!@", "REDFT$%", "SADEWXZ", "TFGRY%^",
+                                       "UHIJY&*", "VBCFG", "WAEQS@#", "XCDSZ", "YUHGT^&",
+                                       "ZASX", 0 };
+                               int i = 0;
+
+                               while (typo[i] && typo[i][0] != c)
+                                       i++;
+                               if (typo[i])
+                                       c = typo[i][0xFF & (NRAND(strlen(typo[i]+1)))];
+                       }
+
+                       /* caps typo */
+                       if (c >= 'a' && c <= 'z' && (jp->caps || !NRAND(350))) {
+                               c -= ('a' - 'A');
+                               if (c == 'O' && LRAND() & 1)
+                                       c = '0';
+                       }
+
+                       {
+                               Bool overstrike;
+
+                               do {
+                                       (void) XDrawString (display, window, jp->gc,
+                                                       (jp->x * jp->char_width) + jp->hspace + xshift,
+                                                       (jp->y * jp->line_height) + jp->vspace + mode_font->ascent + yshift,
+                                                       &c, 1);
+                                       overstrike = (xshift == 0 && yshift == 0 &&
+                                               (0 == (LRAND() & 3000)));
+                                       if (overstrike) {
+                                               if (LRAND() & 1)
+                                                       xshift--;
+                                               else
+                                                       yshift--;
+                                       }
+                               } while (overstrike);
+                       }
+                       if ((tolower(c) != tolower(*(jp->s)))
+                                       ? (!NRAND(10))      /* backup to correct */
+                                       : (!NRAND(400))) {  /* fail to advance */
+                               jp->x--;
+                               jp->s--;
+#if 0
+                               XFlush(display);
+                               if (delay)
+                                        (void) usleep (0xFFFF & (delay + (NRAND(delay * 10))));
+#endif
+                       }
+               }
+
+               jp->x++;
+               jp->s++;
+
+               if (!NRAND(200)) {
+                       if (LRAND() & 1 && jp->s != source_message)
+                               jp->s--;   /* duplicate character */
+                       else if (*(jp->s))
+                               jp->s++;   /* skip character */
+               }
+
+               if (*(jp->s) == 0) {
+                       jp->sentences++;
+                       jp->caps = (!NRAND(40));  /* capitalize sentence */
+
+                       if (!NRAND(10) ||         /* randomly break paragraph */
+                                       (jp->mode == 0 && (NRAND(10) || jp->sentences > 20))) {
+                               jp->break_para = True;
+                               jp->sentences = 0;
+                               jp->paras++;
+
+                               if (LRAND() & 1)       /* mode=0 50% of the time */
+                                       jp->mode = 0;
+                               else
+                                       jp->mode = (0xFF & NRAND(5));
+
+                       if (LRAND() & 1) {         /* re-pick margins */
+                               if (jp->columns < 3)
+                                       jp->columns = 3;
+                               jp->left = 0xFF & (NRAND(jp->columns / 3));
+                               jp->right = jp->columns - (0xFF & (NRAND(jp->columns / 3)));
+
+                               if (!NRAND(3))        /* sometimes be wide */
+                                       jp->right = jp->left + ((jp->right - jp->left) / 2);
+                       }
+
+                       if (jp->right - jp->left <= 10) {  /* introduce sanity */
+                               jp->left = 0;
+                               jp->right = jp->columns;
+                       }
+
+                       if (jp->right - jp->left > 50) {   /* if wide, shrink and move */
+                               jp->left += (0xFF & (NRAND((jp->columns - 50) + 1)));
+                               jp->right = jp->left + (0xFF & (NRAND(40) + 10));
+                       }
+
+                       /* oh, gag. */
+                       if (jp->mode == 0 && jp->right - jp->left < 25 && jp->columns > 40) {
+                               jp->right += 20;
+                               if (jp->right > jp->columns)
+                                       jp->left -= (jp->right - jp->columns);
+                       }
+               }
+               jp->s = source_message;
+       }
+
+#if 0
+       XFlush(display);
+       if (delay) {
+               (void) usleep (delay);
+               if (!NRAND(3))
+                       (void) usleep(0xFFFFFF & ((NRAND(delay * 5)) + 1));
+
+               if (jp->break_para)
+                       (void) usleep(0xFFFFFF & ((NRAND(delay * 15)) + 1));
+       }
+#endif
+
+#ifdef NFS_COMPLAINTS
+       if (jp->paras > 5 && (!NRAND(1000)) && jp->y < jp->rows-5) {
+               int i;
+               int n = NRAND(3);
+
+               jp->y++;
+               for (i = 0; i < n; i++) {
+                       /* See also http://catalog.com/hopkins/unix-haters/login.html */
+                       const char *n1 =
+                                       "NFS server overlook not responding, still trying...";
+                       const char *n2 = "NFS server overlook ok.";
+
+                       while (*n1) {
+                               (void) XDrawString (display, window, jp->gc,
+                                                                       (jp->x * jp->char_width) + jp->hspace,
+                                                                       (jp->y * jp->line_height) + jp->vspace + mode_font->ascent,
+                                                                       n1, 1);
+                               jp->x++;
+                               if (jp->x >= jp->columns)
+                                       jp->x = 0, jp->y++;
+                               n1++;
+                       }
+#if 0
+                       XFlush(display);
+                       (void) usleep (5000000);
+#endif
+                       while (*n2) {
+                               (void) XDrawString (display, window, jp->gc,
+                                                               (jp->x * jp->char_width) + jp->hspace,
+                                                               (jp->y * jp->line_height) + jp->vspace + mode_font->ascent,
+                                                               n2, 1);
+                               jp->x++;
+                               if (jp->x >= jp->columns)
+                                       jp->x = 0, jp->y++;
+                               n2++;
+                       }
+                       jp->y++;
+#if 0
+                       XFlush(display);
+                       (void) usleep (500000);
+#endif
+               }
+       }
+#endif
+}
+
+#endif /* MODE_xjack */
diff --git a/pixmaps/back.xpm b/pixmaps/back.xpm
new file mode 100644 (file)
index 0000000..4850d33
--- /dev/null
@@ -0,0 +1,519 @@
+/* XPM */
+static char *back_data[] = {
+/* width height num_colors chars_per_pixel */
+"   256   256      256            2",
+/* colors */
+".. c #210404",
+".# c #137d7e",
+".a c #880305",
+".b c #8e8080",
+".c c #074040",
+".d c #884040",
+".e c #8eb9b9",
+".f c #484040",
+".g c #480506",
+".h c #c94040",
+".i c #d18080",
+".j c #48a8a8",
+".k c #c70405",
+".l c #507e7f",
+".m c #ccb8b7",
+".n c #882828",
+".o c #856060",
+".p c #496061",
+".q c #482727",
+".r c #09605f",
+".s c #90a0a0",
+".t c #092a29",
+".u c #c9605f",
+".v c #d0a0a0",
+".w c #4f9697",
+".x c #93d7d6",
+".y c #c72727",
+".z c #a80406",
+".A c #274040",
+".B c #a63f3e",
+".C c #674040",
+".D c #680305",
+".E c #b08080",
+".F c #6caaa9",
+".G c #2f9596",
+".H c #f67c7c",
+".I c #a72627",
+".J c #a76061",
+".K c #686060",
+".L c #682727",
+".M c #282828",
+".N c #286060",
+".O c #b1a1a0",
+".P c #e96060",
+".Q c #b4b8b7",
+".R c #e5403f",
+".S c #350304",
+".T c #707e7f",
+".U c #e80305",
+".V c #70c0c0",
+".W c #2f7f7f",
+".X c #d1d3d4",
+".Y c #f39c9c",
+".Z c #709798",
+".0 c #881918",
+".1 c #8e8f8f",
+".2 c #055051",
+".3 c #86504f",
+".4 c #495050",
+".5 c #491919",
+".6 c #c7504f",
+".7 c #cf8f8f",
+".8 c #a81818",
+".9 c #285050",
+"#. c #a95051",
+"## c #695051",
+"#a c #681717",
+"#b c #91c8c7",
+"#c c #c81818",
+"#d c #cc3637",
+"#e c #b09090",
+"#f c #b3d9da",
+"#g c #80aaa9",
+"#h c #e1b8b7",
+"#i c #883738",
+"#j c #867271",
+"#k c #487170",
+"#l c #473636",
+"#m c #073637",
+"#n c #c87170",
+"#o c #ceaeae",
+"#p c #a93738",
+"#q c #a87272",
+"#r c #687271",
+"#s c #683637",
+"#t c #283637",
+"#u c #287272",
+"#v c #8dafb0",
+"#w c #afaeaf",
+"#x c #0c7271",
+"#y c #e87271",
+"#z c #111919",
+"#A c #4f8a8a",
+"#B c #f78c8c",
+"#C c #341414",
+"#D c #708a89",
+"#E c #308a89",
+"#F c #b6c7c6",
+"#G c #50a09f",
+"#H c #70a0a0",
+"#I c #409596",
+"#J c #eb5051",
+"#K c #afe8e8",
+"#L c #cacbca",
+"#M c #6bb6b7",
+"#N c #208988",
+"#O c #980405",
+"#P c #a08080",
+"#Q c #184040",
+"#R c #98403f",
+"#S c #a0b9b9",
+"#T c #584040",
+"#U c #580405",
+"#V c #d94040",
+"#W c #e08080",
+"#X c #58aaa9",
+"#Y c #d80305",
+"#Z c #992928",
+"#0 c #986060",
+"#1 c #58605f",
+"#2 c #572727",
+"#3 c #176060",
+"#4 c #a1a0a0",
+"#5 c #172828",
+"#6 c #d96060",
+"#7 c #e09f9f",
+"#8 c #d72828",
+"#9 c #b80405",
+"a. c #374040",
+"a# c #c7e6e7",
+"aa c #edaeae",
+"ab c #dcc9ca",
+"ac c #80c2c1",
+"ad c #e61110",
+"ae c #a4e2e4",
+"af c #e03636",
+"ag c #80b5b6",
+"ah c #59b4b4",
+"ai c #b73f3f",
+"aj c #7a4040",
+"ak c #b86060",
+"al c #786060",
+"am c #386061",
+"an c #f46060",
+"ao c #175050",
+"ap c #985051",
+"aq c #595656",
+"ar c #d95252",
+"as c #385454",
+"at c #b85454",
+"au c #795454",
+"av c #9dcecf",
+"aw c #790304",
+"ax c #c0807f",
+"ay c #b92929",
+"az c #792828",
+"aA c #382828",
+"aB c #c09fa0",
+"aC c #981818",
+"aD c #a08f8f",
+"aE c #581919",
+"aF c #e08f8f",
+"aG c #b91818",
+"aH c #781818",
+"aI c #d71a1a",
+"aJ c #c09191",
+"aK c #201919",
+"aL c #349e9c",
+"aM c #207e7f",
+"aN c #5f7e7e",
+"aO c #609696",
+"aP c #a0dada",
+"aQ c #7e7e7f",
+"aR c #f70204",
+"aS c #407e7f",
+"aT c #809697",
+"aU c #963637",
+"aV c #977271",
+"aW c #587272",
+"aX c #583636",
+"aY c #183637",
+"aZ c #d77271",
+"a0 c #e1aeae",
+"a1 c #b83536",
+"a2 c #b87271",
+"a3 c #787271",
+"a4 c #7b3536",
+"a5 c #383637",
+"a6 c #387271",
+"a7 c #9faeae",
+"a8 c #c0aeaf",
+"a9 c #177271",
+"b. c #f77272",
+"b# c #608a89",
+"ba c #7e8a89",
+"bb c #3f8b8a",
+"bc c #3fa0a0",
+"bd c #82cbcc",
+"be c #ccc0c0",
+"bf c #b3c1c1",
+"bg c #aee0e0",
+"bh c #dfbebd",
+"bi c #b3cfcd",
+"bj c #ec5858",
+"bk c #60a0a0",
+"bl c #7fa0a0",
+"bm c #1d0d0c",
+"bn c #f78484",
+"bo c #330c0c",
+"bp c #cddcdc",
+"bq c #f2a4a4",
+"br c #f59394",
+"bs c #351c1c",
+"bt c #064949",
+"bu c #874847",
+"bv c #90c0bf",
+"bw c #484848",
+"bx c #c94848",
+"by c #866868",
+"bz c #486868",
+"bA c #0a6868",
+"bB c #c76868",
+"bC c #284848",
+"bD c #a84847",
+"bE c #684849",
+"bF c #a76868",
+"bG c #696868",
+"bH c #286868",
+"bI c #e96867",
+"bJ c #e94848",
+"bK c #075859",
+"bL c #855857",
+"bM c #485858",
+"bN c #c95857",
+"bO c #285858",
+"bP c #a85857",
+"bQ c #685858",
+"bR c #8fd0d0",
+"bS c #184848",
+"bT c #964847",
+"bU c #9fc0c1",
+"bV c #584848",
+"bW c #d84848",
+"bX c #986868",
+"bY c #586868",
+"bZ c #176869",
+"b0 c #d86867",
+"b1 c #374848",
+"b2 c #b84848",
+"b3 c #7b4849",
+"b4 c #b76869",
+"b5 c #776868",
+"b6 c #386969",
+"b7 c #f66969",
+"b8 c #165757",
+"b9 c #985859",
+/* pixels */
+"a9aMa9aM.WaM.W.W.W.Wbb.Wbbbbbb#Ebbbbbb#Ebb#E#E#E#E#E.W#E#E#N#E#E#N#E#E#E#E#E#E#E#E#E#E#E#E#E#Ebb#E#Ebb#Ebb#Ebbbbbbbbbbbbbbbbbb#Abb.l#A.l.laWaW#rbG.K.Kaub3b3.daUaU.I.8.z#O.aaH#aaE.5aA.MaY#QbtaobKbZa9a9aMaM#N#E#E#E#E.G#E#E.G#E#E#E#E#E.WaMaM#ua9a9bZbZ#3#3b8aoaobSbCbC.A.A.Aa.#ta5a.a5a5a5a.a5a.a5a.a.a.a.a.b1bCb1bC.9.9.9bObObObO.N.N.NambH.Nb6bHb6bHb6b6b6b6b6b6b6b6b6b6b6b6b6b6bza6bza6#k#k#k#kaW.laWaNaNaNaN.T.T#DbaaT.s#vbUavbgaeav.eblb#aN#kb6.N#3#3bAbZbAa9a9a9a9#u#ubHbHb6bHb6b6b6b6b6#ub6#u#u#u#u#ua9aMa9a9aMa9a9aMa9",
+"a9#uaM#u#u#u.WaS.WbbaSbbbbaSbbbbbbbbbbbbbbbbbbaS#E.W#E.W#E.W.WaM#E.W#NaM#EaM#E#N.W#E#E#E#E#E#E#E#Ebb#E#E#Ebb#E#Ebb#Ebbbbbbbbbb#Abb.l.l.laNaW#rbYbG.KbQaub3bu.daU#Z.8aC#O#O.aawaEaEbs.M.MaYaYbtaobK.rbZa9a9aMaM.W#N#E#E#E#E#E#E#E#E#E.WaMaMaM#ua9a9bZ#3#3b8aoaoaobSbC#Q#t.A#ta5a5a5a5a5a5#la5#l#l#l#la5#la5a.a.a.a.b1bCb1.9b1.9.9bObObObO.N.Nam.NbH.Nb6.Nb6bHbHb6bHb6bHb6b6b6b6b6b6a6b6a6#ka6#k#k#k#k.laW.l.laNaNaN#D#D#DaTbl#v.eavaPaeaP#b#g.Zb#.lb6bH.N#3#3#3bAbAbAbZa9bZa9bH#ubH#ubHa6bH#ubH#ub6#u#u#u#ua9aM#ua9a9a9a9a9a9a9a9",
+"#ua9#u.W.WaS.WaSbbaSbb#A#A#A#A#A#A#Abbbbbbbbbb#Ebb#E.W#E.W#N#E.W#N.W#N.W#N#EaM#E#EaM#E.W#E#E#E#E#E#E#Ebb#E#Ebb#Ebb#EbbbbbbaSbbaS.laS.l.laWaWaWbG.K.Kau##b3bu#iaU#ZaC.z#O.a.a#a#a.5bsaA.MaYaYbt.2b8bAbZa9a9aMaM#N.W#N#E#E#E#E#EaM.WaMaMaM#ua9a9bZ#3#3b8b8aoaobS.A#Q.A#t#ta5a5a5a5a5.q#l.q#l.q#l.q#l#l#l#la5#la5a5a.a.a.bCb1bC.9.9.9.9bObObO.N.N.N.N.NbHbH.Nb6bHb6bHb6b6b6#ub6a6b6a6b6a6a6a6#ka6#kaS.l.l.l.laNaNaN#D.T#D.ZaTbl#vbUavaPaeavbv#gaTaN#kbz.N.Nb8#3.rbAbAbZ#xbZa9bHa9bH#ubH#ubHbHbH#ubH#u#u#u#ua9a9a9a9a9a9a9a9a9a9a9a9",
+"#u#u#ua6.WaSaSaS#A#A#A#A#A.w.waO.w.w.w#A#A#AbbbbaSbbbb#E.W#E.WaM.WaM.W#N.WaM#EaM#EaM#E#N.W#E.W#E.W#E#E#E#Ebb#E#E#Ebbbb.WbbaSbbaSbb.l.l.laWaWbYbY.KbQbQaub3.d#i#Z#Z.8#O#O.aaw#a#U.5bs.M#5aY#Q.caobK.rbAa9a9a9aMaMaM#NaM#NaM#NaMaMaMaMaMa9a9a9bZ#3#3b8b8aobSbS#Q#Q#t#t#ta5a5aAa5.q.q.q.q#2#2#2#2#2#2#2#2.q#l#l#l#la5a5a5a..AbCb1bC.9.9.9bObObObO.N.N.N.NbH.NbHb6bHbHa6bHbHb6a6b6a6b6a6a6#ka6a6#kaS#kaS#k.l.laNb#aNb##D#D.Zbl#v.e#b.xaeaP#b#vbl#DaW#kam.NbO#3b8.r.rbAbAbAbZa9bZa9bZ#ubHbH#ubH#ubH#ua9bHa9a9a9a9a9a9a9#xa9#xbZa9bZ#u",
+"#ua6.Wa6aSaS#A#A#AaOaOaOaOaOaOaOaOaOaO.waO#A#AbbbbbbaS#EaS#E.W#EaM#EaMaMaM#NaMaM#N.W#N.W#N.W#N#E#E.W#E.W#E#E.Wbb.W#EbbaSbbaSaSaS.laS.l#kaWaWbGbG.KbQauauaj.d#iaUaCaC#O#O.aaw#aaE.5bsbs.M#5aYbtbtbKb8bAbZ#xaM.#aMaMaMaMaMaMaMaMaMaMa9a9a9bZbA#3bKbKaobtbS#Q#Q#t#t#ta5aAaAaA.q.q#2#2#2#2#2#2.L#2.L#2#2#2aX#2.q#l#l#la5a5a.a5a..AbCb1bC.9.9.9bOb8bO.N.N.N.N.NbH.NbHb6bHbHa6bHbHa6#ua6a6a6a6a6#kaS#kaS.l.l.l.laNb#b##D#D.Zblbl#gbvavaPaPbRbv#v.Z#DaWbzambObOb8bK#3.r.rbZ#xbZa9bZa9bHa9bZ#ubZ#ubZ#ua9bZa9a9bZa9a9bAa9bAa9bZbZa9bZ#ubZ",
+"a6a6aSaS.l#A#Ab#aOaOaOaObk.Z#H#H#HbkaOaOaO.waO.w#AbbbbbbaS#E.W.W.W.WaM.W.WaMaM#EaMaMaM#NaM#N.WaM#EaM#E.W#E.W#E.W#EaS#E.W#EaSbbaSaSaS.laWaWbYbY#1.KbQ##b3b3.daU#ZaCaC#O.aawaw#a#U.5bs.M#5aYaY.cbSbKbK.rbA#xa9a9a9aMaMaMaMaMaMaMa9a9a9bZbZ.r#3bKao.2bS#Q#QaY#t#t#taAaAaA.q.q#2#2#2#2.L.L.L.L.L.L.L.L.L.L#2.L#2#2.q.q#l#la5a.a5a.a..AbCbCbCao.9bObObOb8.N.N.N.NbHbHbHbHbHbHa6bHa6bHa6a6a6a6a6a6aSaSaS.l.l.l.l#Ab#b#b#.Z.Z#H#g.ebvbR.xaPav.e#gaTaNaWbzambObOb8b8bK.rbA.rbAbAbAbZa9bZbZa9bZbZ#ubZa9bZa9a9bZa9bZbA#xbZbAbAbZbZbZbZbH#u",
+"a6aS.l.lb#b#aO.Z.Z#H#H#H#g.F#H.F#H#H.F#H#HbkaOaO.w#A#AbbbbaS.W#E.W.W.WaMaMaM.WaMaMaM#EaM.WaM#N.W#N.W#N.W.W#E.W#E.W#E.WaSaSaSaSaS.l#k#k#kaWbYbY.K.KbQaub3aj#i#i#ZaC#O#O.a.aawaE#Ubs#Cbs#5#5aY.cbt.2b8.r.rbZ#xa9a9a9a9.#a9.#a9a9a9#xbZ.r.r#3bKaobtbS#QaYaY#t.M.MaAaA.q.q.q#2aE#a#a#a#aaH#aaHaHaHaH#a.L#a.L.L.L#2#2aX.q.q#la5a5a5.Aa..AbCbCbCbCao.9b8bO.Nb8.N.N.NbHbHbHbH#ubHa6#ua6#ua6a6a6.WaSa6aSaS.laS#Ab#b#b#b#aO.Z#H#g#gac#bav.xaPbv#vbl#DaNbY.pam.9aob8b8bK#3.r.rbAbAbZbAbZa9bZbZa9bZa9bZa9bZa9bZ#xbAbAbZbAbAbZ#3bZbZbHbH#ua6",
+"aS.l.lb#aOaO#H#H#H#H#gag#g#gag#gag#g#g#g.F#H#HaOaOaO#A#AbbaSbbaS.W.WaM.W.WaMaMaMaMaMaMaMaMaMaMaMaMaM.W#N.W#N.W.W#E.W.W.W#E.WaSaSaS#k.l#kaWbY#1#1bQ##bEb3aj#i#Z.0aC#O.a.aaw.DaE#U.5bsaK.M#5aY.cbS.2.2.r.rbAbA#x#xa9#xa9a9a9#xa9bA#3.r.rb8.2btbt#Q#QaYaY.M#taAaAaA.q.q#2aE#a#a.LaHaHaHaHaH.0aHaHaH.0aHaHaHaH#a.L.L#2#2aX.q.qa5a5a5a5.A.A.AbCbC.9aobObOb8bO#3.NbZ.N.NbHbHbH#ubHbH#u#ua6#ua6.Wa6aSaSaSaS#A.l#A#Ab#b#.Z.Z#H.FagbvbR.xaPbRbv#vaT#DaNbz.pasbO.9aoaobKbK.r.r.rbAbAbAbZbAa9bZbZbZbZa9bZbZbAbAbAbAbAbA#3.r#3bZ#3.NbHb6a6a6",
+".l.lb#aO.Z.Z#H#g#gag.e.e.ebv.e.eag.eag#g#g#g.F#H.ZaOaO#A#A#AbbaS.W.W.W.WaM.W#uaMaMaMaMaMaMaMaM#EaM#NaMaM.WaM.W.W.W.W#EaS.WaSaSaSa6aS#kaWbzbYbY.KbQbQauajaj#i.n#ZaC.a#O.aawaw#UaE#C#Cbs#5#5aY#m.cbt.2bK#3.rbAbZbA#xa9bA#xbAbZ.r.r.rbKbK.2bSbS#QaYaYaY.M.M.MaAbs.qaEaE#a#a#aaHaHaHaH.0.a.0.a.0.0.0.0.0.0aHaHazaH#a.L#2#2#2.q#l.qa5a5a5.A.A.AbSbCbS.9aobOb8bO#3.N#3bHbHbHbHbH#u#ua6#u#ua6.Wa6aSaSaSaS#A.l#A#Ab#aOaOaO#H#H#gagacbR.x.x#bbv#gaT#D#rbYamas.9.9aob8bKbKbK.r.rbA.rbAbAbZbAbAbAbAbAbAbAbAbAbZbA.r#3.r.r#3#3#3.NbHbHb6a6#k",
+"b#b#.Z.Z#H#g#vag.ebvbvbv#b#b#b#b#bbvbv.eacag#g#g.F#HaOaO#A#A.lbbaSaS.W.W#uaMaM#uaMaMa9aMaMaMaMaMaMaM.WaMaMaM#EaM.W.W.W.WaS.W.WaSaS#k#k#kaWbY#1aqbQ##bEb3a4#i.n.n.a#O.a.aaw#a.D.g.5#CbsaK#5#maY.cbS.2bKbK.r.r.rbAbAbAbAbA.r.r.rbKbKaobtbS.c#Q#maY.M.M.MaAbs.q.5aEaE#a#aaHaHaH.a.0#O.aaC#OaC#O#O#O#OaC.a.0.0.0aHaHaH#a.L#2#2.q.q.qa5a5a5a5.A.A.AbCaobSaobOb8b8bO#3.N#3bZbH#ubHbH#u#u#u.Wa6.W.W.WaSaSaSbb#A#A#Ab#aOaO#H.FagacacbR.xbR#b#v#gaT.TaWbzbMas.9.9aoaoaob8bK.r.r.rbA.rbAbAbAbAbZbAbZbAbAbAbA.r.r.r.r#3#3#3#3.N.NbHb6a6#k.l",
+"b#.Z.Zbl#g.e.ebv#b#bavavavavavavavav#bbU#bbv.eag#g#H#H.ZaOaO#A#AaSaS.Wa6.W#u.Wa9aM#uaMa9aMaMaMaMaMaMaMaMaM.WaMaM.W.W.W.W.W.Wa6a6#k#k#k#kbYbY#1#1bQ##b3ajaj#i.naCaC.a.aawaw.D#UaE.g#CaK.M#5#5#m.cbtbt.2bKbK.r.r.r.r.r.r#3.rbKbKao.2btbt#Q#maY#5.M.M.MaAbs.5.5aEaE#a#aaHaw.a.0#O.a#O#O#O#O#O#O#O#O#O#OaC#O#O.0.0.0aHaH#a.L#2#2#2.qaAa5a5#t#t.A.A.AbCbS.9aoaobOb8b8.N#3.NbZbHbH#u#u#u#ua6.Wa6.WaSaSbbbb#A#A#A.waOaObk.F.Fagag#bbR.xbRbv#vbl#D.TaW#1bMasbCbCaobS.2.2bKbKbK.r.r.r.r.rbA.rbA.rbA.r.r.r.r.r.rb8.rb8b8b8.N.Namb6bz#k.laN",
+".Z.Zbl#g.e.e#bavavavavaeaPaeaPaebgaPaPavavavbvbvag#g.F#H#HaO#A#A#AaSaS.Wa6.W#uaM#ua9a9aMa9a9a9.#a9aMaMaMaMaMaM.WaMaMaM.Wa6.WaSaSaS#k#kbzbzbY#1aq####bEb3a4.n.n.0.a.a.aawaw.D#U#U#C#CbsaK#5#5aYaY.cbS.2.2bKbKbKbKbK.rbKbKbK.2.2btbt#Q#maY#5aY.M.M.Mbs.5.5aEaE#a#aaHaH.a.0.a#O#O#O#O#O.z.z.z.z.z.z.z.z#O#O#O#O.0.a.0aHaH#a#a.L#2.q.qaAaAa5a5#t#t.A#QbCbS.9aoaobOb8#3#3#3bHbZbHbZbH#u#u#u#u.W.W.WaSbbaSbb#A#A.waOaObk.F.F#MacbdbdbR#bbv#vblba#rbY#1bMb1.9bCbSaoaoao.2bKbKbK.r.r.r.r.r.r.r.r.r.r.rbK.rb8bKb8b8b8b8bObOamb6bz#k.laNb#",
+"blblag.ebv#bavaPaPaeaebg#Kae#KbgaebgaeaPaPavavbvbv.eag#g#H.ZaOaO#A.laSaS.Wa6.W#u#uaM#ua9a9aMa9aMa9.#a9aMaMaMaMaMaM.W#u.W.W.Wa6a6a6a6#k#kbY.p#1.Kaq##bEaja4#i.0aC.a#O.aawaw.D#U.5.g#C#CaK#5#5.t#m.c.cbtbt.2.2bKbKbK.2.2.2.2bSbt#Q.caYaYaY#5.M.M.Mbs.5.5.5aE#a.DaHaw.a.a#O#O#O#O.z.z.z.z.z.z.z.z.z.z#O.z.z#O#O#OaC.a.0aHaHaH#a#2#2#2.q#laAa5#t#t#t.A#QbCbSbSaob8b8bOb8#3#3bZbHa9#u#u#u.W.W.W.WaS.WaSbb#A#A.w.waObkbk.F.Facacbd.xbR#b.e#gaT#D#r#rbMbMb1b1bCbSbSbS.2aobKbKbKbK.rbK.r.r.r.r.rbK.rbKbKbKbKb8b8b8bObObOamambz#kaWaNb#.Z",
+"#g#v.ebvavavaPaeaeae#K#Kae#K#K#K#K#K#KaebgaPaPavav#b.eag#g#H#HaOb##A#AaSa6.W#u#u#u#u#ua9#ua9a9a9a9aMa9aMa9aMa9aM#uaMaM.W#u.Wa6.Wa6a6#kbzbz#1#1aqbQbEbEaja4.n.n.0.a.a.aaw.D.D.D.g.g#C#CaKaK#5#5aY#m.c.cbtbtaobt.2bt.2.2bSbt.c.caY#maY#5#5.M.Mbs#C.5.5.5#a#a.DaH.a.a.a#O#O#O#O.z.z#O.z.8.z.z.8.z.8.z.z.z.z.z.z#O#O#OaC.aaHaHaH#a#a#2#2.qaAaAaAa5#t#t.A#Q.AbSbCaoaob8b8#3.N#3bZbHbZ#ua9#u#u#u.W.WaSbbbbbb#I#A.w.wbkbk.F#M.Vacbdbdbd#b.eblaTba#rbG#1.4asb1bCbCbSbS.2ao.2.2bKbKbKbKbKbKbKbKbKbKbKbKbKb8aob8aoao.9bOamambz#kaWaN#D#Dbl",
+"#v.e#bavaPaPaeaeaeae#Kae#Kae#K#K#K#K#K#K#KaebgaeavavbUbvag#gbl.ZaOb##A.laSaSa6a6#u#ua9#ua9a9a9a9a9a9.#a9.#a9aMaMa9aM#uaM.W#u.Wa6a6#ka6bzbz#1#1aqaq##bEaja4az.n.a.a.a.aawaw.D#U#U.g#C#CaK.M#5#5.taY.c.c.cbtbtbtbtbSbt.c.c.caY#maY#5#5#5bsaK#Cbs.5.5#U#a.D.Daw.a.a.a#O#O#O.z.z#O.8.8.8.8.8.8.8.8.8.8.8.z.z.z.z.z#O#O#O#O.0.0aH#a#aaE#2.q.q.qa5.Ma5#t#t#Q.AbSbSbSaoaob8b8#3#3bZbZbZ#u#u#u#u.W.W.W.WbbaSbb#A.w.waObk#X.F#MagacbdbRbRac.eblaT.T#rbGbMbMbwb1bC#QbSbSbSbtao.2.2.2bKbKbKbKbKbKbK.2ao.2aoaoaoao.9bO.9amam.pbzaWaNb##Dbl#g",
+".ebvavaPaPaeaeaeaeaeaeaeaeaeaPaeaeaeaeae#K#K#KaebgaPav#b.eag#g#H.ZaOb##A.l#k.Wa6#u#u#u#ua9#ua9a9a9a9a9a9aMa9aMa9aM#uaM#u.W#u.Wa6a6a6#kbzbz.p#1aqaqbEaj.Ca4az.0.0.a.aawawaw.D#U.g.gbo#C#CaKaK#5.t#5#maY.c#m.c.c.c.c.c#Q#maY#m#5#5#5.MaKbsbs#C.5.gaE#U#aawaH.a.a.a#O#O.z#O.zaC.8.8aC.8.8aC.I.8.8.8.8.8.8.8.8.z.z.z.z#O#O.a.a.aaH#a#a#aaE.q.qaAaA.M#t#t#t#t#QbSbSbSaob8b8b8#3#3bZbHbZa9a9aM#u.W.W.W#Ebbbbbb.w.w#Gbkbk.F#M.Vbdbdbdbdbv#vblaT.Ta3bYaqaqb1b1.A.A.A#QbSbSbS.2ao.2.2.2.2.2.2.2.2ao.2aoaobSaoao.9.9asas.pbzaWaN.T.ZaTbl#v",
+"#bavbRaeaPaeaPaeaPaPaPavavbiavaPav#faeaeae#K#K#KaeaeaPavbUbvag#g#H.Zb#b#.laSaSa6a6#ubHa9bHa9a9a9a9a9a9a9a9a9a9aMa9aMa9aM#uaMa6#ua6a6a6bzbz.p#1aqaqbEbE.Ca4az.0.0.a.a.aaw.D.D#U#U.gbobobmaKaK#5#5#5#m#maY#m#maY.c#m#m#maY.t#5#5#5aKbsaK#C#C.5#UaE.D.Dawaw.a.a#O#O#O#OaC.8aC.8aC.I.I#Z.I#Z.I#Z.I.I.8.I.8.8.8.8.z.z.z#O#O#O.0.0aHaHaH#aaE#2.5.q.qaA.M#t#taY#t#Q#QbSaoaoaob8#3#3#3bZbZ#u#u#u#uaM.W.Wbbbbbb#I#I.w.wbk#X.F#M#M.Vbdbdbdbvag.sba.T#rbGaq.4.4b1a.bC.A#QbS#QbtbSbtao.2ao.2.2ao.2aobtaobSbSaobCbC.9asam.p.paWaW.T#DaT#g#vbv",
+"#baPaPaPaeaPaPaPaPavavavavavavavavavavavaPaeae#Kae#KaeaPav#b.e#v#gbl.Zb#b#.l.l#ka6a6#ubHbHbZbHbZa9bZa9#xa9#xa9a9a9a9aM#uaM#u#u.Wa6a6b6b6bz.p.paqaqbV.Cajaz.naz.a.a.aawawaw.D#U#U.g.gbo#CaKaKaK#5#5#5#5#maY#m#maY#m#5#5#5#5#5.MaKbs#Cbs.g.5#UaE.D.DaHaw.a.a#O#O#O#O#O.8aCaC#Z#Z#Z#Z#Z#Z#Z#Z.I#Z#Z#Z.I#Z.8.8.8.8.8.z.z.z#O#O#O.a.aaHaH#aaEaE.q.qaAaAaA.M#taY#t#QbS#Qaoaoaob8b8#3#3bZbZa9a9a9.W.W.W.W#Ebbbb.w.w#G#G#X#X#M.Vbdbdbdacbv#gblaTba#r.K#1.4bwbwa..A.A.A#QbS#QbSbtbSbtbSbtbSbtbSbSbSbSbSbSbC.9b1asbMbM.pbYaW.T#DaT#g#g.ebv",
+"aP.xaP.xaP.xavav#bbUbUbvbUbUbUbUbUbUav#FavaP#faPaeaeaeaeaPavbUbvag#g#H.Zb##A.l#ka6a6a6bH#ubHbZbZbZa9bZa9a9a9a9a9.#a9a9a9#uaM#u#ua6a6a6bzbz.paqaqaqbEbE#sa4azaH.0.a.aaw.aaw.D.D#U.g.gbobo#CaKaK#5#z#5.t#5.t#5.t#5#5#5#5#5aKaKaK#C#C#Cbo.5#U#U.D.Dawaw.a.a.a#O#OaCaC#ZaC#Z#Z#Z#Z#ZaUaUaUaUaUaUaU#ZaU#Z.I#Z.I#Z.8.8.8.z.z#O#O#O.a.aaHaH#a#aaEaE.q.qaAaA#t.M#t#taY#QbSbSbS.2b8b8#3#3bZbZbZ#u#uaMaM.W#Ebb#Ebb#I.w#G#G.F#X#M.V.Vbdbdacac#vblbaaQa3bGaqaqbwbwa.a..A.A.A#Q#Q#Q#QbSbt#QbSbSbSbSbSbSbSbCbCbCb1asas.4.pbY#r.T#D.ZaT#v.ebvbR",
+"aPaP.xaP.xav#b#bbvbvbv.e.e.e.e.e#SbvbUbvavbUavaPaeae#KaeaeaPav#b.e#g#g.Z.Zb#.l.l#ka6a6b6bHbHbHbZbZbZbZbZbA#x#xa9a9a9a9a9aM#u#u#u#ua6b6b6b6.p.paqaqbV.C.Ca4azaH.aaw.aawawaw.D.D#U.g.gboboboaKaKaKaK#5#5#5#5#5#5#5#5#5#5aKaKaK#C#C#C.g.g#UaE.D.Dawaw.a.a.a#O#OaCaCaC#Z#Z#Z#ZaUaU#iaU#iaU#iaU#iaUaUaUaUaUaU#Z#Z.IaC.8aC.z.z.z#O#O.a.a.aaH#a#aaE.5.5.qaAaA#t.MaY#taY#Q.cbSaoaob8bK#3#3bZa9a9a9#uaM.W.W#Ebbbb#I#I.w#G#X#X#M.V.Vbdacac.e#gblaTaQ#rbG.Kaq.4bwa.a.a5.A#t.A#Q#Q#Q#Q#Q#Qbt#Q#Q#Q#Q#Q.A.AbCb1b1b1bMbMbY#raN#DbaaT#g#vbv#bav",
+".x.x.x.xbR#bbvbv.e.e.e#v#v#v#v#v#v.e.e.e#SbvbUavavaPaeaeaeaeaPavbv.e#vbl.Z#Db#aN.l#ka6b6bHbHbHbZbHbZbZbAa9bZ#x#xa9a9a9a9a9a9aM#u#u#ub6b6.p.p.pbMbVbVbE#sa4azaH.0.a.aawawaw.D.D#U#U.g.gbobo#CbmaKaKaKaK#5#z#5#zaK#zaKaKaK#C#Cbobo.g.5#U#U.D.Dawaw.a.a#O#O#O.0aCaC#Z.n#Z#i#i#i#i.d#i.d.d.d.d.d#i.daUaUaUaU#Z#Z#Z.I.I.8aC.8#O#O#O#O.a.0awaH#a#aaE.5.5bsaAaA.M#t#taYaY#QbSbtao.2b8b8#3#3bZa9a9#uaMaM.W#E#E#I#I#I#G#G#X#X#Mah.V.Vbdacagag.saTaQ.TbGbQaqbVbw.fa.a.#t.A.AaY.A#Q#Q#Q#Q#Q#Q#Q.A.A.AbCa.b1b1.4bMaq#1bY#r.T#DaT#g#vbv#bbRaP",
+".x.xbR#bbvacbvag#vag#v#g#g#g#v#g#g#v#v#v.e.ebvbUavavaPaPaeaeaPaPavbv.e#g#g.Zb#b#.l#k#ka6b6bHbH.N#3bZ#3bZbZbAbZbAa9#xa9a9a9a9#u#u#u#ua6b6b6.p.pbMaqbVbE#s#sazaz.aaw.aawawaw.D.D#U#U.g.g.Sbobm#CaKaK#zaKaKaKaKaKaKaKaK#C#Cbobo.5.g.g#U#U.D.Dawaw.a.a.a.a.aaCaC.n#Z.n#i#i#i#i.d.d.d.dajbuaj.d.d.d.d.d.d#i#iaUaUaU#Z#Z#Z.8aC.z.z#O#O#O.a.aawaH#a#aaE.5.qbsaA.M.M.M#taYaY#Q#QbSaoaobK.r#3#3bZa9a9aMaM.W#E#E#E#I#Ibc#G#X#Xah.V.Vbd.Vacac#gblbabaa3bG.KaqbVbwbwa.a5a.#t#t.A#t.A#t#Q#t.A.A.A.A.Aa..Ab1b1.4.4bM#1bY#r.TbaaTbl#v.ebvbR.x.x",
+"bRbR#bacac.eagag#g#g#g#g#gblbl#g#gbl#g#v#v#v.ebvbvbUavaPaPaeaeaPavavbv#v#gbl.Z#DaN.l#k#kb6b6.NbH#3#3bZ#3bZbAbZbAbAa9#xa9a9a9a9#u#ubHa6b6b6.pbMbMaqbVbE#s#sazaHaH.aaw.aawaw.D.D#U#U.g.g.g.SbobobobmbsaKaKaKaKaKaK#C#Cbmbobo.g.g.g#U.D.D.Dawaw.a.a.a#O#OaC.0.n#Z.n#i#i#iajb3ajb3b3b3b3b3b3b3b3b3b3aj.d.d.d#iaUaU#Z#Z#ZaC.8aC#O.z#O#O.a.a.0aw.D#aaEaE.5.5bsaA.M.M#taYaYaY#Q.cbtao.2b8.r#3bZbZa9a9aMaM.W#E#E#I#I#I#G.j#Xah#Mah.V.VacagagblaTbaaQa3.KbQaqbw.f.fa.a5a5a.#t#t.A#t.A#t.A#t.A.A.Aa.a.b1bw.4.4#1#1#r.T.TaTaT#v#vbvbRbRaPbR",
+"bRbd#bacagag#g#g.F#g#H#Hbl#Hbl#Hblblblbl#g#g#v#v.ebv#bavaPaPaPaeaPav#bbv#v#g.Z.Zb#aNaW#kb6b6b6.N.N.N#3#3#3#3bAbZbAbZbAbZa9a9a9a9#u#ubHb6b6am.pbM.4bV#T.C.Lazaz.aaw.aawawawaw.D.D#U#U.g.g.S.Sbobo#Cbobmbm#Cbmbo#Cbobo.gbo.g.g#U#U#U.D.Dawaw.a.a.a.a#O.0.0.n.n#i#i#iajajb3b3b3b3b3##b3aub3##b3b3b3b3b3b3bu.d.d#i#iaU#Z#Z#ZaC.8aC#O#O#O.a.aawaH.D#aaEaE.5.qbsbs.M.M.MaYaYaY#Q#QbS.2b8bK#3bAbZa9#uaMaMaM#E#E#I#I#I#G.j#Xahah.V.V.Vacag#g#gaTbaa3#rbGbQbVbV#T.f.fa.a5a5.Aa5#t#t#t.A#t#ta.a5a.a.bwbw.4.4aq.K#ra3.TbaaT#g#vbv#bbRbR.xbR",
+"acacacagag.F#g.Fbl#H#H#H#H#H#H.Z#H#Hblblbl#g#g#g.e.ebv#bavaPaPaeaPaPav#b.e#vbl.Z#Db#.laW#kb6am.N.N.N#3#3#3.r#3bAbAbA#xbAa9bZa9#ua9#ubHb6b6am.pbMaqbVbV.C#s.LaHaHaw.aaw.aaw.D.D.D#U#U.g.g.g.S.Sbobobmbobobobobobobo.Sbo.g.g#U#U#U.Dawawaw.a.a.a.a#O.0.0#Z.n#ia4a4b3ajb3b3##########bQ####au####aub3b3b3b3ajbu.d#i#iaU#Z#Z#ZaC.8#O#O#O#O.a.a.aaH.D#aaE.5.5.5bsaA.M.M#5aYaY#Q.cbtbS.2b8bK#3bAa9a9a9aM.W#N#E#E#Ibcbc#G.jah#M.V.V.V.VacagblaTbaaQa3.K.KbQbVbV.f.f#l.fa5a5a5a.a5a.a5a.a5a.a..f.fbwbwaqaq#1bG#r.TbaaTbl#v.ebv#bbRbRbdbd",
+"acacag#M#g.F.F#H#H#H#H#H.Z.Z.Z.Z.Z.Z.Z#H#H#H#g#g#g#v.e.e#bbR.x.xae.xaPavbv.e#vbl.Z#DaNaW#kbzb6b6.N.NbO#3#3#3#3.r#3bAbZbAbAa9bZa9a9bH#ubHb6amambM.4aqbVaX#sazaHaH.aaw.aawawaw.D.D#U#U#U.g.g.S.g.S.Sbo.Sbobobobo.S.S.g.g#U#U#U.D.D.Dawawaw.a.a.a.a.0.n.naz#ia4ajajb3b3##bE##au##bQbQbQbQbQbQbQbQ##bQ####b3b3b3ajbu#i#i#i#Z#Z#ZaCaC#O#O#O.a.a.aaw.D#a.DaE.5.5bsbs.M.M.M.MaYaY#Q#Qbtao.2b8.r.rbZa9a9aMaM#N#E#E.G#Ibc#G.j#Xahah.V.V.Vagag#gblbaaQa3b5.K##aqbVbV.f.f#la..fa5a5a.a5a5a5a5.fa..fbwbw.4aq.KbGbG.T.TbaaT#vagbvbdbd.xbdbRbd",
+"ac#Mag.F.F.F#H#HbkaO.ZaOaOaOaO.ZaO.Z.Z.Z.Z#Hbl#H#g#gag.ebvbvbRaP.xae.xav#bbv#v#gaT.Z#DaNaW#kbzamam.NbOb8#3b8#3.r.r.rbAbAa9bAa9a9bZ#u#ubHbHb6ambMbM.4bV.C#s.Lazawawaw.aawawaw.D.D.D#U#U.g.g.g.g.S.g.S.S.S.g.S.g.g.g.g#U#U#U.D.D.Dawaw.a.a.a.a.a.0.0.n.na4a4ajajbEbE######bQbQbQbQbQbQbQbQbQbQbQbQbQbQau##b3b3b3aj.d.d#i#i#Z#ZaCaCaC#O#O#O.a.aawaH.D#a#UaE.5.5bsbs.M.M#5#5aYaY.c#QbtbtbKb8.r#3a9a9a9aMaM#E#E.G#I#Ibc.j#Xahah.V.V.Vagag#gaTaTaQaQa3.KbQ##bVbV#T.f.f#l#l.fa5#la.#la..f.f.fbwbVbVaqbQ#1bGa3aQbablbl#v.eac#bbdbdbdbdac",
+"ag#M.F.F.F#Hbkbk#HaOaOaOaOaOaOaOaOaOaOaO.Z.Z.Z#H#H#g#gagagbvbvbR.x.xaPaPav#b.e#vbl.Z#DaNaNaWbzamamam.NbObO#3b8#3#3.r#3bAbAbA#xbZa9bZ#ubHb6b6ambM.4.4bV#T#s.L#aaHaw.aawawawawaw.D.D.D#U#U#U.g.g.g.g.g.g.g.g.g.g.g.g#U#U#U.D.Dawawaw.aaw.a.a.a.0.0.naza4ajajbEb3bE######bQbQ#1aq#1.K#1#1#1#1.K#1.KbQbQbQbQbQ##b3b3b3aj.d#i#i.n#Z#ZaC#O#O#O#O.a.aawaw.D#aaE#U.5bsbsbs.M.M.M#5aYaY.c#QbtaobK.r.rbAbZa9aMaM#N#E#E.G#Ibc.j.jahahah.V.V.Vag#gblaTbaaQa3b5albQ##bEbV#T#T.f.f#l#l.f#l.f.f.f.fbwbVbVaqbQ.KbGa3.TbaaTbl#g.eac#bbdbRbdbdac.V",
+"#M.F.F.FbkbkbkaOaOaOaOaOaOaOb#aOb#aOaOaOaOaO.Z#H.Z#H#g#g#gagbv#bbRaP.x.xaP#bbv#v#gaT.Z.TaNaWaWbzamambObOb8b8b8b8.r.r.r.rbAbZbAbZa9bZa9bHbHamamambM.4bV#TaX#sazaHawaw.aawawawaw.D.D#U.D#U.g#U.g.g.g.g.g.g.g.g.g#U#U#U.D.D.D.Dawawaw.a.a.a.a.0.0azaza4ajaj.CbE######aqbQaq#1#1.K#1#1#1#1bY#1#1#1.K#1aq.KbQbQ##bQ##b3b3aj#i#i#i.n#ZaCaCaC#O.a.a.a.aaw#a.D.DaE.5.5.5#Cbs.M#5.M#5aYaY.cbSbt.2b8.r.ra9a9a9aMaM#N#E.G#Ibcbc.j#Xahah.V#M#M#M#gblaTbaaQa3b5.KbQ##bVbE#T#T#T#l#T.f#l.f.f#T#T#TbVbVaqbQ.KbGa3.TaQbaaT.sag.eacacbdbdbd.V.Vag",
+"#M.F.FbkbkbkbkaO.waO.waO.wb#.wb#.wb#aOb#aOaOaO.ZaO#H#H#H#gagagac#bbR.x.xaPbRavbv#v#gbl#D#DaNaWbz.pamambObObOb8b8b8b8.r.r.rbAbAbZa9bZa9bHbHbHb6asbM.4bwbV#s.L.LaHawawaw.aawawawaw.D.D.D#U#U#U.g#U.g.g.g.g.g#U#U#U#U.D.D.D.Dawaw.aaw.aaw.aaH.0azaza4a4ajbEbEbEaqbQaqaq#1#1#1#1#1bY#1bYbYbYbY#1bY#1#1.K#1aqbQbQ######b3b3aj#i#i#i.n#Z.0aC#O#O#O.a.aawaw.D#a#UaE#U#C#Cbsbs.M.M#5#5aY#m.cbS.2bKbK.r.r#xa9a9aM#N#E#EaL#Ibc.j.jahahah.Vag#Mag#gaTaTaQaQa3b5albQ####bV#T#T#T.f#T#T#T#T#TbVbVbVaqbQ.K.K#ra3aQbaaT#g#g#vacacbdbdbd.Vac.V#M",
+".F#X.Fbkbk.waO.waO.w#A.w#A.w#A#AaO#A#AaOb#aOaOaOaO#Hbk#H.F#gagagbv#bbR.x.xaPbR#b.e#vblaT#DaNaWaW.p.pamasbO.9b8b8b8bK.r#3.rbAbAbAbZbZbZ#ubHbHamambM.4bwbVaX#s.LaHaHawawaw.aawaw.Daw.D.D#U#U#U#U#U#U#U#U#U#U#U#U.D.D.D.Dawawawawaw.a.a.aaH.0azaza4a4.CbEbE####aqaq#1#1#1#1#1bzbYbzbzbzbYbzbYbYbYbYbY#1#1.K#1.KbQbQ##bEb3b3aj#i#i.n.n#Z.0#O.a#O.a.a.aawaw.D#a#U.5.5.5#CbsaK.M#5#5aYaY.c.cbtbSbKbK#3bAa9a9aMaM#N#E.GaLbc.j.jahahah.V#M#M#MblblaTbaaQa3b5albQbQ##bEbEbV.C#T#T#T#T#TbVbV####bQbQ.Ka3a3.TbabaaT#g#vacacacbdbd.Vbd.V#M#M",
+".F#Xbk#G#G.w.w.w.w.w#A.w#A#A#A#A#A#A.w#A#A.wb#aOaOaOaO#H#H#H#Magagbd#b.x.x.xavbRbv#v#vaT#D.T#raWbz.pasam.9bO.9aob8b8b8bK.r.r.rbA#xbZa9bZbHbH.Namas.4.4#T#T.L.L#aaHawaw.aawawawaw.D.D.D.D.D#U#U#U#U#U#U#U#U.D#U.D.Daw.Dawawaw.a.aaw.aaH.0aHaza4#s.CbEbEbVaqaqaq#1#1#1#1bzbzbzbzbz#k#k#kbz#k#k#kbzbYbzbYbY#1#1aqbQbQ####bEajaj#i#i.n#Z.0aCaC.a#O.a.a.aaw.D.D.D#U.g.5#C#CbsaK.M#5#5#5aY.c#Qbt.2bK.rbA#xa9.#aM#N#N#E.GaLbc.j.jahahah#M#Mag.FblaTbaaQaQa3b5alau######bEbVbEbVbEbVbVbEbV##bQbQ.Kb5a3aQaQbaaT.s#gagagacbd.Vbd.V.V#M#M.F",
+"#Xbk#G.waO.w.w.w#A.wbb#Abb#A#I#Abb#A#A#A.w#A.w#AaOaOaO#Hbk.F#g.FagacacbR.x.x.xbR#bbv#v#gaT#D.T#raWbz.pasas.9.9aoaob8bKbKbK.r.rbAbAbZbZbZbHbH.NamambMbwbw#TaX.L#aaHawawawaw.aawawawaw.D.D.D.D#U.D#U#U.D#U.D.D.D.D.Dawawawaw.aawaw.aawaHaHaza4#saj.CbEbVbQaqaq#1.p.pbzbzbzbz#kbz#k#kbz#k#k#kbz#k#kbzbzbYbz#1#1#1aqbQbQ####b3b3aja4#i.n.n.0aC.a#O.a.a.aawaw.D#a#UaE.g.5#CbsbsaK.M#5#5aY#m.cbtbSbKbK.rbAa9a9.##N#N.G.G#Ibcbc.jahahah.V#M#M#g#HblaTbaaQa3b5b5albQau####bEbEbEbEbE######bQbQalb5a3a3.TbaaTaT#gagagacacbd.V.V.V#M#Mah#X",
+"bk#G#G#G.w.w#I#A#Ibb#Abb#Abbbbbb#Abbbb#A#A#A#A#A.w.waOaObk#H#H.F#MagacbdbdbR.xbRbRbv#v#vbl#D#D.TaW#1.pbMasbO.9.9aoaoaob8bK.r.r.rbAbAbZa9bZbHbHamasas.4bw#TaX.L.L#aawaw.aawawawawaw.Daw.D.D.D.D.D.D.D.D.D.D.D.D.Dawawaw.aawaw.a.aaw.0azazaz#s.C.CbEbVaqaqaq.p#1.p.pbzbzbzbz#k#k#k#ka6#ka6#kb6#k#k#k#k#kbYbzbYbY#1aqaq####bEbEajaja4#i.n.0aC.0#O.a.a.aawawaw.D.D#U#U.5.g#C#CbsaK.M#5#5aYaY.cbt.2bK.r.r#xa9a9aM#N#N#E.GbcaL.j.jahahah#M#M#M#g#HaTbaaQaQa3b5b5alau##au##############bQbQalbGb5a3aQbabaaTbl#gagacac.Vbd.V.V.V#Mah.F#X",
+"#G#G.w.w#I.w#Ibbbbbbbbbbbbbbbbbbbbbbbbbbbb#A#A.w#A.waO.waObkbk.F.FagagacbdbRbR.xbR#bbv#vblaT#D.T#rbY.p.pasas.9.9aoaoao.2b8bK.r.r.rbAbZbZbZbH.N.Namas.4bw#TaX#s#aaHaHawawaw.aawawawaw.Daw.D.D.D.D.D.D.D.D.Dawawawawawawaw.aawawawaHaHazaz#s.C.CbEbVaqaqbM.p.p.pbzbzbzb6#kb6a6b6a6a6a6a6a6a6#ka6a6#kbz#kbzbzbY.p#1#1.KaqbQ##bEb3aja4a4.n.n.n.0.a#O.a.a.aawaw.D.DaE#U.g.5#C#C#CaK.M#5#5#5#m#Q.cbt.2bK.rbA#xa9.#aM#N.G.GaLbcbc.j.jahahah#M.F.F#gaTaTbaaQaQa3b5alal.KaubQau##aubQaubQalalb5b5a3aQaQbaaTbl#g#gagac.V.V.V.V.Vahahah#X#X",
+"#G#G.w.w#I#Ibb#IbbbbbbbbbbbbaSbbaSbbaSbbbbbbbbbb#A#A.w.waOaObk.F.F.F#MagacbdbdbRbR#bbv.e#vblaT.TaN#rbY.pbMasas.9bCaoaoaobKbKbK.r.rbAbAbZbZbZbH.Namasasbw.faXaX.L#a.Dawawawawawawawawaw.Daw.Daw.D.D.D.Daw.Daw.Dawawawawaw.aaw.aaHaHaz.L#s#s.CbEbVbVaqbMaq.p.pbzbzbzb6#ka6a6a6a6a6a6a6a6a6.Wa6a6#ka6a6b6#k#kbzbzbY#1#1aqaq####bEbEajaja4.n.naC.0.a.a.a.a.aawawaw.D#U#U.g.g#C#C#CaKaK#5#5aY#m.c#QbtbKbK.rbAa9.#aM#N#N#N.GaLaL.j.jahahah#M#M#M#H#H.ZbaaQaQa3a3b5alb5aualauaubQaubQalalb5b5a3aQaQbabaaTbl#gagag.Vac.V.Vah.Vah#M#X#X#G",
+"#G#I#I#I#Ibbbbbbbb#E#E.W.W#E.W.W#EaS#EaSbbaSbb#Abb#A.w.w.waObkbkbk.F#M#MacacbdbR.xbR#bag#vblaTba.T#rbY#1bMasb1bC.9bSbSao.2b8bK.r.r.rbAbZbZbZ.N.N.NasbMbwbw#TaX.L#a#aawawaw.aawawawawawawawaw.Dawawaw.Dawawawawawaw.aaw.aawawaHaHaHaz#s#s.C#TbVaqaqbMbM.p.pbzb6b6b6a6a6a6a6a6a6.Wa6.Wa6a6a6.Wa6a6a6a6#ka6#kbzbzbzbz#1#1aqaq####bEaja4a4a4.n.0.0.a.a.a.aawawaw.D.D.D#UaE.g.g#C#CbsaK.M#5#5.taY.cbt.2bK.rbA#xa9.#aM#N#E.GaLbcbc.j.jahahah.F.F.FblaTaTbaaQaQa3a3b5b5alal.Kalalalb5alb5b5a3a3aQaQbaaTbl#g#gag.V.V.V.V.V.Vahah#X#X#X#G",
+"#I#G#I#I#I#Ibb#Ebb#Ebb.Wbb.W#E.W.W.W.W.W.Wbbbbbbbbbbbb#A.w.w.wbkbk.F.F#M#M.VbdbdbRbdbRbv.e#vaTba#D#rbG#1bM.4asasbCbCaobSao.2bKbK.r.r.rbA#3bZbZbH.Nasas.4bw#laX#2.L#aawawawawaw.aawawawawawawawaw.Dawawawawawawaw.aawawawawawaHaH.L.L#s.C#TbVbVaq.4bM.p.pambzb6b6b6a6a6#ua6.W#ua6#u#u#u.Wa6#u.Wa6.Wa6a6a6a6b6#kbzbz.p#1#1aqaqaqbEbEbEa4a4az.n.n.0.a.a.a.a.aawawaw.D#U#U.g.5.gbo#CaKaKaK#5#5#m.c.cbt.2bK.rbA#xa9.##N#N#N.GaLaL.j.j.j#Xah#M#M.F#H#H.ZbabaaQaQa3#ja3b5b5alb5alb5b5b5a3a3a3aQbabaaTaTbl#gag#Mag#M.V.V.Vahahah#X#X.j#G",
+"bc#I#I#I#E#E#E#E#E.W.W#E.W.W.W.W.W.W.W.Wbb.W.Wbbbbbbbbbb.w.w.w.wbkbk.F.F#Mag.VbdbdbRbd#b.e#g#gaT#D.T#rbY#1.4.4b1bCbCbSbSbS.2.2bKbK.rbA.rbZbZ.N.N.Nasasb1bw#TaX#2.L#a#aawawawawaw.aawawawawawawawawawawawawawawawaw.aawawawaHaH.Laz#saX.CbVbV.4.4bM.p.pb6bzb6b6b6a6#ua6#u#u#u#u.W#u.W#u.W#u.W#u#ua6a6a6a6a6a6#kb6bzbz.p#1#1aqaq##bEbE.Ca4a4az.n.0.0.a.a.aawawaw.D.D.D#U#U.g.g#C#C#CaKaK#5#5#5#m.c.c.2.2bK.rbAa9.#aM#N#N.G.GaLbc.j.jahah#X#M.F.F#g.ZaTbabaaQaQa3#ja3b5#jb5b5b5a3a3#ja3aQaQbabaaTbl#g.Fag#M.V.V.Vahahahahah.j.j#Gbc",
+"#I#I#I#I#Ebb#E#E.W#E.W.WaM.W.WaM.W.W.W.W.W.W.W.W.Wbbbbbbbb#I.w.w.wbk#X.F#M#Mac.VbdbdbRbdbv#v#vaTba.T#r#1#1bM.4asb1bCbCbSbSaoaobKbKbK.rbA.rbZbZ#3.N.Nasasbw.faXaX.L#a#aawawaw.aawaw.aawawawawawawawawawawawawaw.aawawawawaHaH#a.L#s#s#TbVbV.4aqbM.p.pamamb6b6b6#ub6#u#u#u#u#u#u#u#uaM#u#u#u#u.W#u.W#u.W#ua6a6a6b6bzbzbz.p.paqaqaqbVbEaj#sa4azaz.0.0.a.a.a.a.aawawaw.D.D#U.g.g.gbobo#CaKaK#5#5#5aY.cbt.2bK.rbA#xa9.#aM#N#N.GaLaLbc.j.j#Xah#X#M.F#H#H.ZaTbaaQaQaQaQa3#ja3#ja3#ja3#ja3aQaQbabaaTaT#H#g.Fag#M#M#M.Vah.Vahah#X#X.j#G#I",
+"#I.G#I#E#E#E#E.W#N.WaMaM.WaMaM.W#uaMaM.W.W.W.W.W#E.Wbbbbbbbb.w.w.w#Gbkbk#X#M#M.Vbdbdbdbdbvag#vblaTaQ.T#r#1aq.4b1b1bCbCbSbSbt.2.2bK.r.r.rbZ.rbZbH.N.Nasasbwbw#laX#2#a#a.Dawawawawawawaw.aawawawawawawawaw.aaw.aawawawawaHaH#aaz.LaXaX#TbV.4.4.4bM.pamamb6b6bH#ub6#u#u#u#u#u#uaM#ua9#ua9aM#ua9#u#u#uaM#ua6#ua6a6a6b6bzbz.p.p#1aqaq##bVbE.Ca4a4azaz.0.a.a.a.aaw.aawaw.D.D#U#U#U.gbo#C#C#CaK#5#5.t#m#m.cbt.2bK.rbA#x#xaM#N#N.G.GaLbc.j.j.jah#Xah.F.F#H#H.ZaTbabaaQaQ#jaQa3a3#ja3#jaQaQaQbabaaTaT#H#g.F#g#M#M.V#Mahahahah.j.j.j#Gbcbc",
+".G#I.G#E#E#E#EaM.WaM.WaMaMaM#uaM#uaM#uaM#uaMaM.W.W.W.W#Ebbbbbb#I.w.w#Gbk#X.F#M.V.Vbdbdbdbdbvag.saTbaa3#r.K#1bM.4b1b1.A.AbSbSbS.2.2bK.r.r.r#3bZ#3.N.NbOasb1.f.faX#2.L#aaH.Dawawaw.aaw.aawawawawawawawaw.aawawawawawawawawaH.L.L#s#sbV#T.4bV.4bM.pamamb6b6b6b6#u#u#u#u#ua9#ua9#ua9aMa9#ua9aM#uaM#uaM#u#u#ua6#ua6a6a6b6b6bz.p.pbMaqaqbVbE.C.C#sazaz.naH.aaw.a.aawawawaw.D.D#U#U.g.gbobo#CaKaKaK#5#5aY.c.c.2.2.rbA#x#x.#aM#N#N.GaLaLbc.j.j.jah#X#X.F.F#H.Z.Z#DbaaQaQaQaQaQaQaQaQaQaQaQbababa.ZaTbl#H#g#M#M#M.Vah.Vahahahah.j.jbcbc#I",
+"#I.G#E#E#E#EaM#EaMaMaM#ua9#uaMa9a9aM#ua9aM#uaM.WaM.W#E.Wbb#Ebb#I#I.w#G#G#X.F#M#M.V.Vbdbd#bac#v#gblaT.Ta3#raqaq.4bwb1.A.AbSbSbS.2.2bKbK.r.rbA#3#3#3.NbOasb1bw.faX#2#2#a#aawawawawawawaw.aaw.aaw.aaw.aawaw.aawawawawawaH#a.L.L.LaX#T#TbV.4.4bMasamamamb6bHbH#ubH#u#ua9#ua9#ua9a9a9#ua9a9#ua9a9a9a9#u#uaM#u#u#u#ua6b6b6b6bzbz.p.paqaqaqbVbE.Ca4a4azaH.0aH.a.aaw.aawawaw.D.D#U#U#U.g.gbobo#CaKaK#5.t.t#m.cbt.2bK.rbA#xa9.##N#N#N.GaLaLbc.jah.jah#X.F.F.F#HaT.ZaTbabaaQaQaQaQaQaQaQbabababaaTaT#H#H.F.F#M#M#M#Mahahahah.j.j.j#Gbc#I#I",
+".G#E.G#E#EaM#NaMaMaMa9aMa9aMa9a9#ua9a9#ua9#uaM#uaM.W.W.W#E#Ebbbb#I#I.w#G#G#X#X#M.V.V.Vbdbdbdag#vblbaba.T#r#1#1.4bwb1a..A.A#QbtbS.2.2bKbK.r.rbAbZ.N.N.Nasasb1.f.f#2#2#a#a.D.Dawawaw.aawawawaw.aawawaw.aawawawawawawaH#a#a.L.LaXaX#TbVbw.4bMas.pamamambHb6bH#ubH#ubZ#ua9#ua9a9#ua9a9a9a9a9a9aMa9#ua9a9a9#u#u#u#u#u#ua6b6b6b6.p.pbMbMaqaqbVbE#s#sa4azaHaH.aaw.a.aawawawaw.D.D#U#U.g.g.gbobobmaKaK#5#5aY#m.cbt.2bK.rbA#x.#.##N#N.GaLaLbcbc.j.j#X#X#Xbk.F#H.Z.Z.Z#Dba#DbaaQaQaQbaaQbababa.ZaT.Zbl#H#g#M.F#M#Mahahahahah.j.j.jbcbc#IaL",
+".G#E#E#N#EaMaMaMaMaMa9aMa9a9a9a9a9a9a9a9a9a9a9aMaMaMaM.W.W#E#Ebbbb#I#I.w#Gbk#X.F#M.Vbd.Vbdacbvag#gaTba.Ta3.Kaq.4bwb1a..A.A#Q#QbSbt.2bKbK.r.r.r#3#3.NbObOasb1bw#laX#2#2#a#aaw.Dawawawaw.aaw.aawaw.aawawawawawawaw.D#a#a.L.L#2aX#T.fbw.4.4bMasamamambHb6bH#ubHa9#ua9a9bZa9a9a9a9a9a9a9a9a9a9a9a9a9a9#ua9#ua9#u#u#ua6#ub6b6b6am.p.pbMaqbVbVbE.C#s#sazaz.0aH.aaw.aaw.aawaw.D.D.D#U#U.g.g.Sbo#CbmaK#z#5.t#m#mbtbtbK.rbA#x#x.##N#N#N.GaLaLbc.j.jah.j#X.F#X#H#H#H.Z.Zba#Dba#Dbaba#Dbaba#DaT.ZaT#H#H.F.F.F#M#Mah#Mahahah.jah.jbcbcbcaL.G",
+".G.G#E#EaM#NaMaMa9aMa9a9a9a9a9a9a9a9a9a9a9a9a9#ua9#uaMaMaM.W#E#Ebb#I#I#I#G#G#X#Xah.V.Vbdacbdacag.sblbaaQ#rbG.Kaq.4bwa.a..A#Q#QbSbt.2.2bK.r.r.rbZ#3#3bObOasb1bw.f#l#2#2#a#a.Daw.DawawawawawawawawawawawawawawawawaH#a#a.L.LaXaX#TbVbw.4.4asamamamb6bHbHbHbHa9bHbZ#ubZa9a9a9bZa9a9a9a9a9a9a9a9a9a9a9a9a9a9#ua9#u#u#ub6#ub6b6bzam.pbM.4aqaqbV#T.C#s.LazaH.0aw.aaw.aawawawawaw.D.D#U.g.g.g.Sbo#CaKaK#5#5#5#m.cbt.2bK.rbA#x.#.##N#N#N.GaLaLaL.j.j.j#X#Xbk#X#H#H.Z.Z.Z.ZaTba#Dbaba#Dba#DaT.Z.Zbl#H#H.F.F.F#Mahahahah.jahbc.jbc#IaL#I.G",
+"#E#E#N#NaMaMaMaMaMa9a9a9a9a9a9bZa9bZbZa9a9a9a9a9a9aM#uaM.WaM#E#E#Ebb#I#Ibc#G#X#Xah#M.V.Vbd.Vac.e#gblaTbaa3#r#1aqbVbwb1a..A.A#Q#Qbt.2.2bKbK.r.r#3#3#3.NbOasb1b1.f#laX#2#a#a.D.Dawawawawawawawaw.aawawawawawaw.D#a#a#a.L#2aXaX#T.fbw.4.4asamasam.NbHbHbHbHa9bHa9a9bZa9bZbZa9a9bZbAa9bAa9a9bZa9a9a9a9a9a9a9a9#ua9#ubH#ubHb6bHb6am.p.pbMbMbVbVbV.C#s#sazazaHaH.aaw.aawawawaw.D.D.D#U#U.g.g.S.SbobmaKaK#5.t#m#m.cbt.2.rbAbA#x.#.##N#N.GaLaLaLbc.j.j#X#X#X.Fbk#H#H.Z.ZaT#D.Zba.ZbaaT.ZaT.Z.Zbl#H.F.F.F#M#Xahahahah.j.j.j.jbcbcaL#IaL.G",
+".G#E#N#E#NaMaM.#aMa9a9a9a9bZa9bZbZa9bZbZbZa9bZa9a9a9a9aMaMaMaM.W#E#Ebb#I#Ibc#G#X#Xahah.V.Vacacagag.saTba.Ta3bGaqbVbw.fa5.A#t#Q#Q#Qbt.2bKbK.r.r.rbZ#3#3bObOasb1bw#laX#2#2aE#aaw.D.Dawawawawawawawawawawawaw.Daw#a#a#a#2.LaXaX#Tbwbwb1bMasasambHam.NbHbHbZbHa9bZbZa9bZa9a9bAbZ#xa9bAa9bA#xbA#xbZ#xbZa9a9a9a9a9a9a9a9bH#u#ub6b6b6amambMbM.4aqbVbV.C#s.L.LaHaHawaw.aaw.aawawaw.D.D.D#U#U.g.g.Sbo#CbmaK#z#5#5#m.cbt.2bK.rbA#x#x.##N#N#N.GaLaLbcbc.j.j.j#X#X#Xbkbk#H.Z.Z.Z.Z.Z.Z.Z.Zba.Z.Z.Z#H#H#H.F.F.F#X#M#Xahah.jah.j.j.jaLbcaL.G.G",
+"#E#N#NaMaMaMaMa9a9a9a9a9a9bAbZbAbAbZbAbZbZbZbZa9bZa9a9a9aMaM.W#N#E#E.Gbb#I#I#G.j#X#M#M.V.Vbd.Vacag#gaTbaaQ#r.K.Kaqbwbwa.a5.A.A#Q.cbSbt.2bKbK.r.r#3#3.NbObOb1b1a..f#l#2#2#a#a#a.Daw.Dawawawawawawawaw.Daw.D.D#a#a#a.L#2aXaX#l.fbwbw.4asasamam.N.NbHbHbHbZbHbZa9bZbZa9bZbZ#xbZbAbZbAbZbAbZ#xbZbAa9bAa9bZbZa9bZ#ubZ#u#ubHbHbHb6b6amam.pbMbM.4bVbV.C#s#sazaHaHaH.aaw.aawawawawaw.D.D#U#U#U.g.g.S.S#CbmaK#5.t.t#m.cbt.2bK.rbA#x.#.#.##N#N.GaLaLbc.j.j.j#X#X#Xbkbk#Hbk.Z.Z.Z.Z.Z#D.Z.Z.Z.Z#H#H#Hbk.F#Xahah#Xahah.jah.jbc.jaLbcaL.G.G.G",
+".G#E#N#NaMaM.#aM.#a9a9#xa9bAbZbAbZbAbZbAbAbAbZbAbZa9a9#ua9a9aMaMaM#E#E.G#I#Ibc#G.jahahah.V.Vacacag#gbl.1baa3bG.KaqbV.fa.a.#t#taY#Qbtbt.2bKbK.r.r.r#3#3bObObOb1b1.f#laX#2aEaE#a.Daw.Daw.Dawaw.Dawaw.Dawaw.DaH#a#aaE.L#2#2#l#Tbwbw.4asasamas.Nam.NbHbZbHbZa9bZbZbZa9bZbAa9bAbZbA#xbAbAa9bAbAbAbZbA#xbZbAa9bZa9bZa9a9bZ#u#ubHbHbHamamambM.4.4bVbV#TaX#s.L.LaHaHaw.aawaw.aawawaw.D.D.D#U#U.g.g.S.SboaKbmaK#5.t#m#m.cbt.2.rbA#x#x.##N#N#N.G.GaLaLaLbc.j.j#Xbk#Xbkbk#Hbk.Z.Z.Z.Z.Z.Z.Z.Z#H#H#Hbk.F#X.F.F#Xah.jah.j.j.jbc.jaLbcaL.G.G#E",
+"#N#N#NaMaM.#.#a9a9#xa9bAbZbAbZbAbA#3.r#3bA#3bAbZbAbZa9a9a9a9aMaM.W#N#E#E#I#I#I#G.j#Xah.Vah.V.Vacag#gblaTbaa3a3.KaqbVbw.fa5#t.A#Q#Q#Qbtbt.2bKbK.r.r#3#3#3bO.9b1b1.f#l#l#2#2#a#a#a.D.Daw.Daw.Dawaw.Daw.D.D#a.D#a#a#2#2aXaX#T.f.fbwb1asasas.Nam.NbH.NbHbZbZbZbZa9bZbAbAbAbAbAbAbAbZbAbAbAbAbZbAbAbAbZ#xbZ#xbZa9bZa9bZ#ubZbH#ubHb6b6amamambM.4.4bVbV#T#s#s.LaHaHaHawaw.aawawawawaw.D.D#U#U#U.g.g.S.SbobmaK#z#5.t#m.cbt.2bK.rbA#x#x.#.##N#NaL.GaLaLbc.j.j#G.j#Xbk#Xbk.Zbk#HaO.Z#H.Z#H.Zbk#Hbk.Fbk.F#X#Xah#Xah.jah.j.j.jaLbcaLaL.G.G.G",
+"#E#NaM#N.#aMa9.##xa9#xa9bAbAbA#3bA.rbA.r.r.rbZ.rbAbZbAbZa9a9a9aMaMaM#E#E#EaL#Ibc#G.jahah.V.V.VacagagblaTba.Ta3.KbQbV#T.fa.a5#t#taY#Q.cbt.2bKbK.r.r#3#3#3bObOb1b1b1#l#l.q#2aEaE.D#a.D.Daw.Daw.D.Daw.Daw.D#a#a#a#2.L#2aX#l#l.fb1.4b1asasas.N.N.N#3bH#3bHbZbZbZbAbZbAbZbAbZbAbZbAbAbAbAbAbAbAbAbAbAbAbAbAbAbZbAa9bZbZa9bZa9bHbHbHbHamamamasbM.4.4bVbVaX#s.L.LaHaHawawaw.aawawawawaw.D.D#U#U.g.g.g.S.S#CbmaK#5#5#m#m.cbt.2bK.r#x#x.#.##N#N#N.GaLaLaLbc.jbc#X#G#Xbkbkbkbkbkbk#HaO#HaO#Hbk#Hbkbk.F#X.F#X#X#Xah.j.j.j.j.jbcaLaLaL.G.G#E",
+"#N#N#NaMaM.#a9a9a9#xbAbAbZbAbAbA.r#3.r.r#3.r.r#3bA.rbZ#xbZa9a9aMaMaM#E#E#E.G#Ibcbc.j#Xahah.V.V.Vacag#gaTbaaQa3.KbQaqbV.f#la5#t#t#Q#Q.cbt.2.2bK.r.r.r#3b8bObO.9b1b1.f#laX#2#2aE#a#a.D.D.D.D.Daw.D.D.D#a#a.D#a#2#a#2aXaX#l.fbwbwb1asasas.N.N.N.NbHbZbZbZbZbZbZbZbAbZbAbAbAbAbA.rbA.r.rbA.rbAbAbAbZbAbAbAbZbA#xbZbAa9bZa9bHbZbHbHbHamamambMasbMbwbV#T#TaX.L.L#aaHawawaw.aawawawaw.Daw.D.D#U#U.g.g.S.SbmbmaK#z#5.t#m#mbt.2bK.r.r#x#x.##N#N#N.G.GaLaLbcbc.j#G.j#G#Xbkbkbkbk.ZbkaO#HbkaO#Hbkbkbk.F#X#X#X#X.j.jah.j.j.jaLbcaLaL.G.G.G#N",
+"#N#N#NaM.#.#.#a9#xa9bAa9bAbA.r.r.r.r.r.r.r.r.r.r#3.rbAbZbAa9a9a9a9aMaM#N#E#E.G#I#G.j.jahahah.V.Vagag#gblaTaQa3b5.K##bV.f.fa5#t#taYaY#Qbt.2.2bKbKbK.r#3#3b8bO.9b1b1a.#l#l.q#2aEaEaE.D#a.Daw.D.D.D.D#a.D#a#a#a#2#2#2.qaX#l.f.fb1bwasas.Nas.N.N.N#3bH#3bZ#3bZbZbAbZbAbAbA.rbA.rbA.rbA.rbA.rbA.r.r.rbA.rbAbAbAbAbZbAbZbZbZa9bHbZbHbHbH.NamamasbM.4bwbw#TaX#s.L.L#aaHawawawaw.aawawawaw.D.D#U#U#U.g.g.S.SbobmaK#z#5.t#m.cbt.2bK.rbA#x.#.##N#N#N.G.GaLaLbcbcbc.j#G#X#Gbkbkbkbkbk#HaObk#Hbkbkbkbk#Xbk#X#X#X#X.j.j.j.jbc.jaLaLaL.G.G.G#N",
+"#N#N#N.#aM.#a9#x#x#xbZbAbAbA.r.r.r.r.r.rbK.r.r.r.r.r.rbAbZbAa9a9.#aMaM#N#E#E.G#Ibcbc#Xahah.V.V.V.Vag#gblaTbaa3a3.K##bV#T.fa5a5#t#t#Q.c.cbt.2.2.r.rbK#3#3#3bObOb1b1a.#l#l.q#2#2#a#a#a.D#a.D.D#a.D#a.D#a#aaEaE#2#2#2aX#l.f.fbwb1b1asasbObO.N.N.N#3bH#3bZbZbZbAbA.rbA#3bAbA.rbA.r.r.r.r.r.r.rbA.rbA.r.rbA.rbAbAbAbZbAa9bZbZbZbHbZbHbH.Namamasas.4.4bw#TaXaX.L.LaHaHawawaw.aawawawaw.Daw.D.D#U#U.g.g.S.S.SbmbmaK#5.t#m#m.cbtbK.rbA#x#x.#.##N#N#N.GaL.GaLbc.jbc.j#G#G#GbkbkbkbkbkbkbkaObkbkbkbk#X#X#X#X.j.j.j.j.j.jaL.jaLaLaL.G.G.G#N",
+"#N#N#N.#aM.#.#a9a9#x#xbA.rbA.r.r.r.rbK#3bK.rb8bK.r.r#3.rbAa9bAa9a9aMaMaM#N.G#EaL#Ibc.j.jahahah#M.V#MagblaTbaaQb5.KbQbVbV#l#la5#t#taYaY.cbt.2.2bKbK.r.r#3b8bObO.9b1b1a.#l#l#2#2aEaEaE#a#U#a#a.D#a.D#aaE#aaE#a#2#2#2#l#l.fa.bwb1b1asbOasbO.N.N#3.NbZ#3bZ#3bAbZ.rbZbA.rbA.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbA.rbA.rbAbAbZbAbZbZbZbZbZbH.NbH.Namamas.4.4bwbw#TaXaX.L#a#aawawawawawawawawawaw.D.D.D#U#U.g.g.S.Sbobmbm#z#5.t#m.cbt.2bK.rbA#x#x.#.##N#N#N.GaLaLbcbcbc#G.j#G#X#G#G#GbkbkaObkbkbkbkbk#Xbkbk#G#X.j#X.j.jbc.j.jaLaLaL.G.G.G.G#N",
+"#N#N#NaM.#.#.##x#x#xbAbAbZ.rbA.r.rbKbKbK.rbKbK.rbK.r.r.r.rbAbAa9#xa9.#aMaM#E#E.G#Ibcbc.jahah.V.V#MagagblblbaaQa3b5bQbE#T.f#la5a5.MaY#Q#Q.cbt.2bKbK.rbK#3b8b8bO.9b1a..f#l#l.q#2#2aEaE#a#a.DaE.D#a#a.DaE#a#2#2#2#2#l#l#l.f.fb1b1asasasbO.NbO#3.N#3#3bZ#3bZ#3bA.rbA.r.r.rbA.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbA.rbAbAbAbZbAbZbZbZbZbH#3bH.N.Nasasas.4bwbw#TaXaX.L.L#a#aawawaw.aaw.aawawaw.D.D.D#U#U#U.g.g.S.SboaKaK#z.t.t#m.cbt.2.r.rbA#x.#.##N#N.G#N.GaLaLbcbcbc#Gbc#G#Gbk#Gbk#Gbkbkbkbkbkbk#G#X#X#G#X.j.j.j.j.jbcaL.jaLaLaL.G.G#N.G",
+"#N#N#N.#aM.#.#a9#xa9bAbAbA.r.r.r.rbK.rbKbKbKbKbKbKbKbK.r.r.rbAbA#xa9a9aMaM#N#E.G.Gbcbc.j.jahah#M.V.V.F#gblbaaQa3b5bQ##bV#T#l.q#t#t#taY#Q.cbt.2bKbKbK.r#3#3b8bO.9.9b1a.a5#l#l.q#2aEaEaEaEaE#a#a#U#aaE#a#2aE#2#2.qaX#l#l.fa.bwb1asb1bObObO.N.N#3bH#3#3#3bAbZ.rbZ.r.rbA.r.r.r.r.r.r.r.r.rbK.rbK.r.r.r.r.r.r.r.r.rbA.rbAbZbAbZbZbZ#3bH.N.N.Namamasasbwbw.faXaX#2#2.LaH.Dawawawawawawawawaw.D.D.D#U#U.g.g.S.S.SbmaK#z#5.t#m#mbt.2bK.rbA#x.#.#.##N#N#N.G.G.GaLbcbcbc#G.j#G#G#G#GaObk#Gbkbk#Gbk#Gbk#G#G#X#G#X.j.jbc.j.jaLaLaLaL.G.G.G#N",
+"#N#N#NaM.#.#a9#x#x#xbAbAbA.r.r.rbK.rbKbKbKbKbKbKbK.rbK.r#3.rbAbZa9#x.#.#aM#N#N#E.G#Ibc.j.jahahah.V#Mag#gblbabaa3b5.K##bV#T#la5a5.M#taY#m.cbt.2.2bKbK.rbK#3b8bO.9.9b1a..fa5#l#2.q#2aEaE#a#U#aaE#aaEaEaEaE#2#2#2#l#l#l.f.fa.b1b1as.9bObObO.N#3.N#3#3bZ#3bA#3bA.r.rbA.r.r.r.r.r.r.rbK.rbK.rbK.rbK.r.r.r.r.r.r.rbA.r.rbAbA#3bZ#3bZbZ#3bH.N.NbOasasas.4bwbw.faXaX.L.L#a#aawawawaw.aawawawaw.D.D.D#U#U.g.g.g.S.S..bmaK#z#5.t#mbtbt.2bKbAbA#x.#.#.##N.G#NaL.GaLaLbcbcbc#G#G#G#G#Gbk#GaO#Gbkbk#Gbk#G#X#G.j.j#G.j.jaL.jaLaLaLaL.G.G.G#N#N",
+"#N#N#NaM.#.#.##xa9#xbAbAbA.r.r.r.rbKbKbKbKbKbKbKbKbKbKbK.r.r.rbAbAa9a9.#aMaM#N#E.GaLbcbc.jahahah#M#M#M.FblaTbaaQb5al##bE#T#l#la5aA#taYaY#Qbtbt.2bKbK.rb8#3b8b8.9.9bCa.a.#l#l.q.q#2#2aEaEaEaE#aaEaE#aaEaE#2#2.q#2#l#l#la.bwb1b1.9asasbO#3bObO#3#3#3#3#3#3bA.r#3.r.r.r.r.r.r.r.rbK.rbKbK.rbKbK.rbKbKbKbK.r.r.r.r.rbA.r.rbAbAbZbZ#3bH#3.N.N.N.Nasasb1b1bw.faXaX#2#2#aaH.Dawawawawawawawawawaw.D.D#U#U.g.g.S.S.SbmaK#z#5.t#m.c.c.2bK.rbA#x#x.#.##N#N#N.G.G.GaL#Ibcbcbcbc#G#G#G.w#G#Gbk.w#Gbk#G#G#G#G#G#Xbc.j.jaL.jaLaLaLaLaL.G.G#N.G",
+"#N#N.##N.#.#a9#x#x#xbAbAbA.r.r.rbKbKbKbKbK.2bKbKbKbKbKbK.r.r.rbAbAbAa9a9.#aM#N#N.G.G#Ibc.j.jahah.V#M#M#gblaTbaa3a3al##bE#TaX#laAa5.MaYaY#m.cbt.2.2bK.r.rbK#3bObO.9.9b1a.a5#l#l.q#2aE#2aEaEaEaEaE#aaE#2aE#2#2.q#l#l#l.fa.a.b1b1b1.9bObObObO#3#3.N#3#3bAbA#3.r.r.r.r.r.r.rbKbK.rbK.rbKbKbKbKbKbKbK.rbK.rbK.r.r.r.r.r.rbA.r#3bA#3bZ#3#3bH.N.NbOasasas.4bw.f.faX#2.L#a#a.Dawawawaw.aawawawaw.D.D.D.D#U#U.g.g.S.SbobmaK#z#5.t#m.cbt.2bK.rbA#x.#.##N#N#N#N.G.GaLaLbc#I#Gbc#G#G#G#Gbk.wbk#Gbk.w#Gbk#G#G#G#G.jbc.j.jaLaLaLaLaL.G.G.G#N.G",
+"#N#N#N.#.#.#.#a9#x#xbAbAbAbA.rbK.rbKbKbKbKbK.2bK.2bKbKbKbKbK.r.rbAbA#xa9.#aMaM#N#E.GaLbcbc.jahahah#M#M#g#HaTbaaQa3albQbE#TaX#l#laA#t.MaY#Q.cbt.2.2bKbKbK#3b8b8b8.9bCb1a.a5#l#l.q.q.qaE#2aE#aaEaEaEaEaE#2#2.qaX.q#l#la..fb1b1b1b1bO.9bObOb8.N#3#3#3#3#3#3.r.r.r.r.r.rbK.rbK.rbK.rbKbKbKbKbKbKbKbKbKbKbKbKbK.rbK.r.r.r.rbA.rbAbZ#3bZ#3#3#3.NbO.Nasasb1bw.f.f#laX#2#2#a#a.Dawawawawawawawawawaw.D.D#U#U#U.g.S.S.Sbmbm#z#5.t#m#mbt.2bK.rbA#x#x.#.##N#N#N.G.G.G.G#Ibcbcbc#G#I#G#G.w#G#G.w#G#G#G#G#G#G.j#G#G.jbcaL.j.jaLaL.GaL.G.G.G#N",
+"#N#N#N.##N.#.##x#x#xbAbAbA.r.r.rbKbKbK.2.2.2.2.2bK.2bKbKbK.r.r.rbAbZ#x#xa9.##N#N#N.G.GaLbc.jahahah#M#M.F#gblbaaQa3alalbE.C#T#l.qa5.M#taYaY.c.cbt.2bKbK.rbK#3b8bO.9.9bCa.a.#l#l.q.q#2.qaEaEaEaEaEaE#2#2.5#2.q.q#l#l#la.a.a.b1b1.9.9bObObO.Nb8#3#3#3.r#3bA.r#3.r.r.r.r.rbK.rbKbKbKbKbKbKbKbKbKbKbKbKbKbK.rbK.rbK.r.r.r.r.r#3bA.r#3#3bZ.N.N.NbObObOasb1b1bw.f.faX#2#2#a#aaw.Dawawaw.aawawawawaw.D.D#U#U#U.g.g.S.S.SbmaK#z.t.t#m.cbt.2bK.rbA#x#x.#.##N#N.G.G.GaLaLaL#Ibcbc#G.w#G#G#G.wbk.w#G#G#G#G#G#G#Gbc#GbcbcbcaLaLaLaL.G.G.G#N.G",
+"#N#N#N#N.#.#.#a9#x#x#xbAbAbA.r.r.rbKbKbKbK.2bK.2.2.2.2.2bKbKbK.r.rbAbA#xa9.#aM#N#N#E.GaLbc.j.jahah#M#M.F.F.ZaTaQa3b5au##.CaXaX#laAaA.M#5aYaY.cbt.2bKbKbK.rb8b8b8.9.9bCa.a.a5a5#l.q.q#2.qaE#2aEaE#2aEaE.q#2.q#2#l#l#la5.fa.b1.9b1.9.9bObOb8bO#3#3#3#3#3.r#3.r.r.rbK.rbK.rbK.rbKbKbKbKbKbKbKbKbKbKbKbKbKbKbKbKbK.rbK.r.r.r.r.r#3bA#3#3#3#3#3.NbObOasasb1b1.f#laX#2#2#2#a#a.Dawawawaw.aawawawawaw.D.D#U#U.g.g.S.S.SbmbmaK#5.t#m.cbt.2bK.rbA#x.#.#.##N#N#N#N.G.GaLaL#Ibc.wbcbc#G.w#G.w#G#G.w#G.w#G#G#Gbc#Gbc.jbcbcbcaLaL.GaL.G.G.G#N",
+"#N#N#N.#.#.#.##x.##xbAbAbA.r.r.rbKbKbKbK.2.2.2.2.2.2.2.2bKbKbK.r.r.rbA#xa9.#aMaM#N#N.GaLaLbc.jahahah#M#M#gblbabaa3a3albEbEaXaX.qa5aA#t#taY#m.cbtbt.2bKbKbK#3b8b8b8.9bCb1a.a5#l#l.q.q#2.qaE#2aE#2aE.q#2#2.q.q.q#l#l#la.a.b1b1b1.9.9bO.9b8.Nb8#3#3#3#3.r#3.r.r.r.r.rbK.rbK.rbKbKbKbKbKbKbKbKbK.2bKbKbKbKbKbKbK.rbK.rbK.r.r.r.rbA#3#3#3#3#3.NbObObO.9asb1bwa..f#laX#2#a#a#a.Dawawawawaw.aawawaw.Daw.D.D#U#U.g.g.S.S.Sbmbm#z#5.t#m.cbt.2bK.rbA#x#x.#.##N#N.G.G.G.GaLaL#Ibc#I#G#I#G#G.w#G.w#G.w#G#G#G#G#Gbc#GbcbcbcaLbcaLaL.G.G.G#N.G",
+"#N#N#N#NaM.#.#.##x#x#xbAbAbA.rbK.rbKbKbKbK.2bK.2.2bK.2.2.2bKbKbK.r.rbA#x#xa9.#aM#N#N.G.GaL.j.j.jahah#M.F.F#HaTaQaQb5auaubE.CaX#l.qaA.M.MaYaY.c.c.2.2bKbK.rbK#3b8.9.9bCbCa.a.a5.q#l.q.q#2.5#2.5aE.qaE.5#2.q#2.q#l#la5.fa.a.b1bCb1.9.9.9bOb8.Nb8#3b8#3.r#3.r.r.r.rbK.rbK.rbKbKbKbKbKbKbKbK.2bKbK.2bK.2bK.2bKbKbKbKbK.rbK.r.r.r.r.rbA#3#3#3#3#3.NbObOasb1b1bw.f#l#l#2#2aE#a.D.Dawawawaw.aawawawaw.D.D.D#U#U#U.g.S.S.SbmbmaK.t.t#m#mbt.2bK.rbA#x.#.#.##N#N#N#N.G.G.GaL#Ibc#Ibc#G#I#G.w#G.w.w#G.w.wbc#Gbc#GbcbcbcbcbcaLaLaL.GaL.G.G#N",
+"#N#N#N.##N.#.##xa9#x#xbAbA.r.r.rbKbKbKbK.2.2.2.2.2.2.2.2bK.2bKbK.r.rbAbA#xa9.#.##N#N.G.GaLaL.j.jahahah#M.Fbl.ZbaaQa3al##bE#saX.q.qaAa5.MaYaY#Q.cbt.2bKbKbK.rb8b8b8.9.9bCa.a5a5#l.q.q.q.q#2.5#2.5#2.5#2.q.q.q#l#l#la5a5a.a.b1b1.9.9.9bObOb8b8.Nb8#3#3bK#3.rbK.rbK.rbK.rbKbKbKbKbKbK.2bK.2bK.2bK.2bK.2bKbK.2bKbKbKbKbK.r.r.r.r.r.r#3.r#3#3#3bOb8bObO.9asb1b1.f.f#l#2#2#2#a#a.Dawawawawaw.aawawawaw.D.D.D#U#U.g.g.S.S.SbmaK#z#5#m#m.cbt.2.r.rbA#x#x.#.##N#N.G#N.G.GaLaL#Ibc#Ibc#G.w#I#G.w#G.w#G.w.w#G#Gbc#GbcbcbcbcaLaL.G.G.G.G.G#N",
+".G#N#N#N#N.#.#.#.##xbA#xbAbA.r.r.r.rbK.2bK.2.2.2.2.2.2.2.2.2bKbKbK.r.rbA#x#x.#.#aM#N#N.G.GaL.j.j.jahah.F.F#HaTbaaQa3alaubE.CaXaX#laAaA.M#5aY#m.cbt.2.2bKbKbK#3b8b8aobCbCa.a.a.a5a5.q.q.q.q#2.5#2aE.q#2.q#2.q.q.q#la5#la.a.a.bCb1.9.9.9b8bOb8b8#3#3b8#3.r#3.r.r.r.rbKbK.rbKbKbKbK.2bKbK.2.2bK.2.2.2bK.2.2bK.2bKbKbKbKbKbKbK.r.r.r.r#3#3#3#3#3.NbObO.9.9b1b1a..f#l#l#2aEaE#a.D.Dawawaw.aaw.aawawawaw.D.D#U#U#U.g.S.S.SbmbmaK.t.t#m.cbt.2bK.rbA#x.#.#.##N#N#N.G.G.G.GaL#I#Ibc.w#Ibc.w#G.w.w.w.w#G.wbc.wbc.wbcbcbcbc.GaLaLaLaL.G#N.G",
+"#N#N#N#N.#.#.#.##x#x#xbAbAbA.r.rbKbKbKbK.2.2.2.2.2.2.2.2bK.2bKbKbK.r.rbAbAa9a9.#aM#N#N.G.GaLbc.j.jah#X#M.F#H.ZbaaQa3alauau.C#s#2.q.qaA.M#taYaY.cbtbt.2bKbK.rbKb8b8bO.9bCbCa.a5#l#l.q.q.q.5#2.qaE.qaE.q.q.q.q#l#la5#la5a.a.b1b1bC.9.9bO.9b8bOb8#3b8#3.rbKbK.rbK.rbK.rbKbKbKbKbKbKbK.2.2bK.2.2.2bK.2.2bK.2.2bK.2bKbKbK.r.rbK.r.r.r.r#3.r#3b8#3b8bObO.9.9b1b1b1a.#l#l.q#2aE#a.D.Dawawawawaw.aawawawaw.D.D.D#U#U.g.g.S.S.Sbm#z#z#5#m#mbtbtbK.r.r#x#x.#.#.##N#N#N.G.G.G.GaL#I#Ibc.w#G#I.w.w#G.w#G.w#G.w#Gbc.wbc#Ibcbcbc.GaL.G.G.G.G#N",
+".G#N#N#N#N#N.#.#.##x#x#xbAbAbA.r.r.rbKbKbK.2.2.2btbt.2.2.2.2.2bKbK.r.rbAbA#x#x.#.##N#N.G.GaLaL.j.jahah#X.F.F#HbaaQ#jb5aub3.C#saX#l.qaA.M.M#5aY.cbtbt.2bKbKbK#3b8b8ao.9bCbCa.a5a5a5.q.q.q.q.5#2.5.q.qaE.q.q.q.q.q#la5a5a.a..Ab1bC.9.9.9b8bOb8b8b8b8#3b8#3.r#3.rbK.rbK.rbKbKbKbKbK.2bK.2bK.2.2.2.2bK.2.2.2.2bK.2bKbKbKbKbK.rbK.rbK.r.r.r#3#3b8#3b8bObOas.9b1a.a..f#laX#2aE#a#a.D.Dawaw.aaw.aaw.aawawaw.D.D#U#U.g.g.S.S.SbmbmaK.t.t#m.cbt.2bK.rbA#x#x.#.##N#N#N#N.G.G.G.Gbc#I#Ibc#I.w#G#I.w.wbc.w.wbc.wbc.wbcbcbc#IbcaLaL.GaL.G.G.G",
+"#N.G#N#N.#.##N.##x#x#x#xbAbA.r.r.rbKbKbK.2.2.2.2.2.2bt.2.2.2.2bKbKbK.r.rbA#x#xa9.#aM#N#N.GaLaL.j.j.jah#X.F.Fblbabaa3b5bL##bE#saX#2.qaA.M#t#5aY#m.cbt.2.2bKbKbKb8b8b8.9bCbCa.a.a5a5#l.q.q.q.q.5#2.5#2.q.q#2.q#l.qa5#la5a.a.a.bCb1bC.9.9.9b8bOb8b8#3b8.rb8.rbK.rbK.rbKbKbKbKbK.2bKbK.2bK.2.2.2.2.2.2.2bK.2bK.2.2bK.2bKbKbKbKbKbK.r.rb8.rb8#3#3b8bOb8bO.9.9b1b1a.#la5#l#2#2aE.D.D.Dawawawawaw.aawawawawaw.D.D#U#U.g.g.S.S..bmaK#z.t#m.c.c.2bK.rbA#x#x.#.##N#N#N.G#N.G.GaL#I#Ibc#I.wbc.w.w.w.w.w.w.w.w.wbc.wbc#I#Ibc.GaL.G.GaL#NaL#N",
+".G#N#N#N#N#N.#.#.##x#x#x#xbAbA.r.r.rbKbKbK.2.2.2bt.2bt.2.2.2.2.2bKbK.r.rbAbA#x.#.#.##N#N.G.GaL.j.j.j#Xah.F#H.Z.Zba#jb5alb3b3#saX#2.qaAaA.M.MaY.c.cbt.2.2bK.rbK#3b8aoao.9bC.Aa.a5a5a5.q.q.q#2.q.qaE.qaE.q.q.q.q.qa5#la5a5a.a.a.bCbC.9ao.9.9b8bOb8b8#3bK#3bK#3bK.rbK.rbKbKbKbKbK.2bK.2bK.2.2bK.2.2.2.2.2.2.2.2.2.2bK.2bKbKbKbK.rbK.rbK.r.r#3#3b8#3bOb8.9.9bCb1a.a.#l#l.q#2aEaE.D.D.Dawaw.aaw.aaw.aawawaw.D.D.D#U.g.g.S.S.SbmaK#z.t.t#m.cbtbK.r.rbA#x.#.#.##N#N#N.G.G.G.G.GaL#I#I#I.w#I.w#I.w.w.w.wbc.w.wbc.wbc#Ibc#IbcaL.GaL.G.G.G",
+"#N.G#N#N#N.#.#.#.##x#x#xbA#xbA.r.r.rbKbK.2bK.2.2bt.2btbt.2bt.2.2.2bKbK.r.rbA#xa9.#.##N#N.G.GaLaL.j.jah#Xah.F#Hba#Da3#jalaubE#s#s#2.q.qaA.M#5aYaY.cbt.2.2bKbKbKb8b8b8.9.9bCa..Aa5a5.q#l.q.q.q.5#2.5.q.5.q.q.q#l.qa5#la5a5a.a.bCbCbC.9.9.9b8b8b8b8#3b8#3bK#3bK.rbKbKbK.rbKbKbKbKbK.2bK.2.2.2.2.2.2.2.2.2.2.2.2.2bK.2bK.2bKbKbKbK.rbK.rb8.rb8#3b8b8b8bObO.9.9b1b1a.#l#l.q.qaEaE#a.D.Dawawawaw.aaw.aawawaw.D.D#U#U#U.g.g.S.SbmbmaK#5.t#m.cbt.2bK.rbA#x#x.#.##N#N#N#N.G.G.G#I#I#I#I#I#I.w.w.w#I.w#I.w.w.w#I.wbc.wbc#Ibc.GaL.G.G.G.G.G",
+"#N.G#N#N#N.##N.#.#.##x#x#xbAbA.r.r.rbKbKbK.2.2.2.2btbt.2bt.2.2.2.2bKbK.rbAbA#x#x.#.##N#N#N.GaLaL.j.j.j#X#X.F.Z.ZbaaQb5alaub3.C#s#2.q.qaA.M.M#5aY.cbtbt.2.2bKbK.rb8b8ao.9bC.Aa.a5a5a5aA.q.q.q.q.5.q.5#2.q.q.q.q.qaA#la5a5a.a..Ab1bCbC.9ao.9.9bOb8b8b8b8bK#3bK.rbK.rbKbKbKbKbK.2bK.2bK.2.2.2.2.2.2.2bt.2.2.2.2.2.2.2bK.2bKbKbKbKbK.rbK.rbK.r#3#3#3b8b8b8.9.9bCa.a.a.#l.q.q#2aE#a.D.D.Dawawaw.aaw.aawawawaw.D.D.D#U.g.g.S.S.SbmaK#z.t#m#m.c.2bK.rbA#x#x.#.#.##N#N.G#N.G.G.G.G#I#I#I#I.w#I.w.w.w.w.w#I.w.w#I.w#I#Ibc#IbcaL.GaL.G.G.G",
+".G#N#N#N#N#N.#.#.#.##x#x#xbAbAbA.rbK.rbK.2.2.2.2bt.2btbt.2.2bt.2.2bKbK.r.r.rbA#x#x.#.##N.G.G.GaLaL.jah.j.F.Fbk.ZbaaQ#jalaub3#s#s#2#2.qaAaA.MaYaY#m.cbt.2bKbK.rbKb8b8ao.9bCbCa.a5a5#laA.q.q.q.qaE.qaE.q.5.q.q.qaA#laAa5a5a.a5a.bCbCbC.9.9aoaob8b8b8#3b8.rb8.rbK.rbK.rbKbKbKbKbKbK.2.2.2bK.2.2.2bt.2.2.2.2.2.2.2.2.2.2.2bKbKbKbKbKbK.rbK#3bKb8b8b8b8bO.9.9.9bCb1a.a5a5#l.q#2aEaE.D.Dawawawaw.aaw.aaw.aawaw.D.D#U#U#U.g.S.S.SbmbmaK.t.t#mbtbt.2.r.rbA#x.#.##N#N#N#N.G.G.G.G#I#I#I#I.w#I.w.w.w.w.w.w.w.w#I.w.wbc#I#I#I.Gbc.G.G.G.G.G",
+"#N.G.G#N#N#N#N.#.#.##x#x#x#xbAbA.r.rbKbKbKbK.2.2.2bt.2btbtbt.2.2.2bKbKbK.r.rbA#x#x.##N#N#N#NaLaLaL.j.j#X#X.F#H.Z#DaQ#jb5aub3.C#s#s#2.qbsaA.M.MaY.c.cbt.2.2bKbKbKb8b8aoaobCbC.Aa.a5a5a5.q.q.q.5.q.5.q.5.q.q.q.q.q.q#l#la5a5a..Aa.bCbCbC.9.9.9bOb8b8b8b8.rb8.rb8.rbKbKbKbKbKbK.2bK.2bK.2.2.2.2.2.2.2bt.2.2bt.2.2.2.2.2bK.2.2bKbKbKbKbKbK.rbK.r#3#3b8b8bOb8.9.9bCa.a.a.#l.q.qaEaE#U.D.Dawawawaw.aaw.aawawawaw.D.D#U#U.g.g.S.SbobmaK#z.t#m.cbt.2bKbAbA#x#x.#.##N#N#N#N.G.G.G.G#I#I#I#I#I.w#I#A.w#A.w#A.w.w.w#I.w#I#Ibc#I#IaLaL.G.G.G",
+".G#N.G#N#N#N.##N.#.#.##x#xbAbAbA.r.r.rbKbK.2bK.2btbtbtbt.2btbt.2.2.2bKbK.r.rbA#x#x.#.##N#N#NaLaLaL.j.j.j#X#X#H.ZbaaQa3byalb3aj#s#2#2#2.qbs.M.MaYaY.cbt.2.2bKbK.rbKb8b8.9bSbC.Aa5a5a5.qaA.q.q.q.5#2.5#2.5.q.q.qaA#laAa5a5a5a.a..AbCbC.9ao.9aob8b8b8b8b8b8.rb8.rbK.rbKbKbKbKbKbK.2bK.2.2.2.2.2.2.2.2.2.2bt.2.2.2.2.2.2bK.2bKbKbKbK.rbK.rbK#3bKb8b8b8b8b8.9.9bCbCb1a.a5#la5.q.qaEaE.D.D.Dawaw.aaw.a.aaw.aawawaw.D#U#U#U.g.S.S.Sbm#zaK.t#m#mbt.2bK.rbA#x#x.#.#.##N#N#N.G.G#E.G#I#I#I#I.wbb.w#A.w#A.w.w#A.w#I.w.w#I#Ibc#I.G#I.G.G.G.G",
+".G#N.G#N#N#N#N.#.#.#.##x#x#xbAbAbA.r.rbKbK.2.2.2.2.2btbtbtbt.2bt.2.2bKbK.r.rbAbA#x#x.#.##N.G#NaLaLaL.j#X.j.Fbk.Z.ZaQaQb5auauaj#s#s#2.q.qaA.M.M#5#m.c.c.2.2.2bKbKb8b8aoaobCbCa..Aa5a5a5.q.q.q.5.q.5.q.5.q.5.q.q.q.q#laAa5a5a5a..Ab1bCbCbC.9ao.9b8b8b8b8b8bK#3bKbKbK.rbKbKbKbK.2bK.2.2bK.2.2.2.2.2.2bt.2.2.2bt.2.2.2.2.2bK.2bK.2bKbKbKbKbK.rbK.r#3b8b8b8b8ao.9bC.Aa.a.a5#l.q#2aEaEaE.D.Dawawawaw.aaw.aawawawaw.D.D#U#U.g.g.S.S..aK#z#5.t#m.cbtbKbK.r#x#x.#.#.##N#N.G#N#N.G.G.G#I#I#A#I#A.w#A#I#A.w#A.w.w#A.w#I.w#I#I#Ibc.GaL.G.G.G",
+".G.G#N.G#N#N#N.#.#.#.##x#x#xbAbAbA.r.rbKbKbK.2.2.2btbtbtbt.2bt.2.2.2.2bK.r.rbAbA#x#x.#.##N#N.GaLaLaL.j.j#X#Xbk.Z#Dbaa3#jauauaj#s.L.L#2.5bsaA.MaYaY.c.cbt.2bKbK.rbKb8b8ao.9bS.Aa.a5a5aA.qaA.q.q.5.5aE.q.5.q.5.q.qaA.qa5a5a5a5a5a..AbCbCbCao.9aoaob8b8b8b8bKb8.rb8.rbKbKbKbKbKbKbK.2bK.2.2bK.2.2.2.2bt.2bt.2.2.2.2.2.2.2.2.2bK.2bKbKbK.rbKbK#3bKb8#3b8b8.9.9.9.9bCa.a.a5a5.q.q.5aE.D.D.Dawawaw.aaw.a.a.aawawaw.D.D.D#U.g.g.S.S..bmaK.t.t#m.cbt.2bKbAbA#x#x.#.##N#N#N.G.G.G.Gbb#I#I#I#A#I#A.w#A#A.w#A#A.w.wbb.w.w#I#I#I#I#I.GaL.G.G",
+".G#N.G#N#N#N#N#N.#.#.#.##x#x#xbAbA.r.r.rbKbK.2.2.2bt.2btbtbtbtbt.2.2.2bKbK.rbAbA#x#x.#.##N#N#N.GaLaL.j.j#X#Xbk.Z.Zbaa3a3.ob3b3a4#s#2#2.qaAbs.M#5aY#mbtbt.2.2bKbKbKb8b8aobSbC.A#ta5a5a5aA.q.q.5.q.5.q.5aE.q.5.q.q.qaA.qaAa5a5#ta..A.AbCbCbC.9ao.9b8b8b8b8bK#3bKbKbKbK.rbKbKbKbKbK.2bK.2.2.2.2.2.2.2.2bt.2.2.2bt.2.2.2.2.2bK.2bKbKbKbKbKbKbKbK#3bKb8b8b8b8aoaobCbC.Aa.a5a5#l.q.qaEaE#U.D.Dawawawaw.a.aaw.aawawaw.D.D#U#U.g.S.S.Sbm#zaK.t#m#mbt.2bK.rbA#x#x.#.#.##N#N#N.G#E#I.Gbb#Ibb#I#A.w#A#A.w#A#A.w#A#A.w#A#I.w#I#I#I.G#I.G.G.G",
+".G.G.G#N#N#N#N#N.#.#.##x#x#x#xbAbA.r.r.rbKbK.2.2.2.2btbtbtbtbtbt.2.2.2bKbKbK.rbA#x#x.#.##N#N.G.GaLaLbc.j.j#Gbk#H.Z#Da3#jalbLb3a4#s.L#2.5.qbs.M.MaYaY.cbt.2bKbKbK.rbKaoao.9bCbCa.a5a5aA.q.q.q.q.5aE.5.5.q.5.5.q.q.q.qa5#la5a5a5a..Aa.bCbCaoao.9aoaob8b8b8b8bK.rbK.rbKbKbKbKbKbK.2bK.2.2bK.2.2.2.2bt.2.2.2bt.2.2bt.2.2.2.2.2.2bK.2bKbKbK.rbK.rbKb8.rb8b8b8.9.9.9bCbCa.a5a5aA.q.qaEaE.D.D.Dawawaw.aaw.a.aaw.aawaw.D.D#U#U.g.g.S.Sbobm#z#5.t#mbt.2bK.r.r#x#x.#.##N#N#N#N#N.G.G#E#I#Ibb.wbb#A#A.w#A#A#A#A.w#A.w#A.w#I.w#I#I#I.G#I.G.G",
+".G.G.G#N.G#N#N#N#N.#.#.##x#x#xbAbAbA.r.rbKbKbK.2.2bt.2btbtbtbtbtbt.2.2.2bK.r.rbAbA#x.#.#.##N#N.G.GaLaL.j#G#Xbkbk#DbaaQa3.oaub3aj#s.L#2#2.5aAbs.MaY#m.cbtbt.2.2bKbKb8b8aoaobCbC.A#ta5a5aAaA.q.5.q.5.qaE.5aE.5.q.5.qaA.qaAa5a5a5#ta..A.AbCbCbS.9aobOaob8b8.rb8b8b8bKbK.rbKbKbKbKbKbK.2bK.2.2.2.2.2.2.2bt.2bt.2bt.2.2.2.2.2bK.2.2bK.2bKbKbKbKbKbK.rbKb8b8b8b8aoaobCbC.Aa.a5a5#l.q.5aEaE.D.D.Dawaw.aaw.a.a.aawawawaw.D.D#U#U.g.S.S..bmaK#5.t#m.cbt.2.r.r#x#x.#.#.##N#N#N.G.G#E.G#Ibb#I#Abb.w#A#A#A#A#A#A#A#A#A.w#A#A#I#I#I#I#I.G.G.G",
+".G.G#N.G#N#N#N.##N.#.#.##x#x#x#xbAbA.r.rbKbK.2.2.2.2btbt.2btbtbt.2bt.2bKbKbK.r.rbA#x#x.#.##N#N.G.GaLaL.j.j#Gbkbk.Z#DaQa3.oaub3aj#s.L#2aE.qbs.M.M#5aY.c.c.2.2.rbKbKbKb8aoaobCbC.Aa5a5a5.q.q.q.5.q.5aE.5.5.5.5.5.q.5.q.qaA.qa5a5a5.Aa..AbCbCbCaoaoaoaob8b8b8bK.rbK#3bKbKbKbKbKbK.2bKbK.2.2.2.2.2.2bt.2.2.2bt.2.2.2bt.2.2.2.2.2bK.2bKbKbKbK.rbKb8bKb8b8b8b8aoao.9.9bCbCa.a5a5aA.q.q.5#U#U.D.Dawawaw.a.aaw.a.aawawaw.D.D#U.g.g.g.S.SbmaK#z.t#m.cbt.2bK.rbA#x#x.#.##N#N#N#N.G#E.Gbb#Ibbbb#A#A#A#A#Ab##Ab##A#A#A#A.wbb.wbb#I#I#I.G#I.G",
+".G.G.G#N.G#N#N#N#N.#.#.#.##x#xbAbAbA.r.r.rbKbKbK.2bt.2btbtbt.2btbt.2.2.2.2bK.rbAbA#x#x.#.##N#N#N.GaLbcbc.j#G#XaO.Z#D.T#jb5bLb3aja4.L.L#2.5bsbs.M#5aY.c.cbt.2.2.2.rbKb8b8aobSbC.A#ta5aAaAaA.5.q.5.5.5.5aE.5aE.q.5.q.qaA.qaAa5a5a5a5.A.A.AbCbSbC.9aoaoaob8b8b8bKb8bKbK.rbK.rbKbKbKbK.2bK.2bK.2.2.2.2.2bt.2bt.2bt.2.2bt.2.2.2bK.2.2bK.2bKbKbKbK.rbK.rbKb8b8b8b8aoaobC.A.Aa.a5a5.q.q.qaE.D.D.Dawawawaw.a.a.a.a.aawaw.D.D#U#U#U.S.S.S.S#zaK.t#m#mbt.2bK.rbA#x#x.#.#.##N#N.G#E.G.G#E#I#A#I#A#A#A#A#Ab##A#A#Ab##A#A#A#A.w#A#I#I#I#I#I.G",
+".G.G.G#N.G#N#N#N.##N.#.##x.##x#xbAbAbA.rbKbK.2.2.2.2.2btbtbtbtbtbt.2.2.2bKbK.r.rbA#x#x.#.##N#N#N.G.GaL.jbc.jbkbk.Z#Dbaa3byau.3aja4.L.L#2.5.qbs.M.MaY#m.cbt.2bK.rbKbKb8aoaobCbC.Aa.a5a5aA.q.q.5.5aE.5aE.5.5.5.5.5.5.q.qaAaAa5a5a5#ta..A.AbCbCbS.9aoaob8aob8bKb8bK#3bKbKbKbKbKbKbKbKbK.2bK.2.2.2.2.2.2.2.2.2bt.2.2bt.2.2.2.2.2.2bK.2bKbKbKbKbKbKbKb8bKb8b8b8ao.9aobCbC.A.Aa5a5a5.q.5aEaE#U.D.Dawaw.aaw.a.a.aaw.aawaw.D.D#U.g.g.S.S..bmaK.t.t#mbtbtbK.rbA#x#x.#.##N#N#N#N.G#E#E#Ibbbbbb#A#A#A#A#A.lb#b#.lb##A#A#A#A#A#Ibb#I#I.G#I.G",
+".G#N.G.G.G#N#N#N#N.#.#.#.##x#x#x#xbA.r.r.rbK.r.2.2.2.2btbtbtbtbtbtbt.2.2bKbK.r.rbAbA#x.#.#.##N#N.G.GaLaL.j#G#GbkaO#D.TaQb5.oauaja4.L.L#2aE.qbs.M.MaYaY.cbt.2.2bKbKbKb8b8aobSbC.A#ta5aAaAaA.q.q.5.5.5.5.5aE.5aE.5.5.5.q.q.qaAaAa5a5#ta..A.AbCbCao.9aoaoaob8b8b8b8bKbK.rbK.rbKbKbKbK.2bKbK.2bK.2.2.2.2.2bt.2bt.2bt.2.2.2.2.2.2.2bK.2bKbKbKbKbKbK.rbK#3bKbKb8aoao.9aobCbC.Aa5a5aA.q.q.5#U.D.D.Dawawaw.a.a.a.a.aawawaw.D.D#U#U.g.g.S.SbmaK#5.t#m.cbtbK.r.r#x#x.#.#.##N#N#N#N.G#E#Ibb#I#Abb#A#AaN#Ab#.l#AaN#Ab##A#A#A#A.w#A#Ibbbb#I.G",
+".G.G.G#N.G#N#N#N#N#N.#.#.#.##x#xbAbAbA.r.rbKbK.2bK.2bt.2btbtbtbt.2btbt.2.2bKbK.rbAbA#x#x.#.##N#N.GaL.GaL.jbcbk#G.Z.Z.TaQb5.oaub3a4#s.LaE#2.5bsbs.M#5aY.cbt.2.2bKbKbKb8b8ao.9bS.A.Aa5a5aA.q.5.5.5aE.5aE#U.5aE.5.5.5.q.5aA.qaAa5a5a5a5#t.A.AbCbCbSbS.9aob8aobKb8bKb8bKbKbKbKbKbKbKbKbK.2bK.2bK.2.2.2.2.2.2bt.2bt.2.2bt.2.2.2.2.2.2bK.2bK.2.rbKbKbK.rbKb8b8b8b8aoaobSbCbC.Aa.a5a5aA.q.5aE#U#U.Dawawaw.aaw.a.a.a.aawawaw.D.D#U.g.g.S.Sbmbm#z#5#m.cbt.2bK.rbA#x#x.#.##N#N#N.G#E.Gbb#Ebb#A#A#A#A#A.laN#AaNb#.l#AaN#A#A#A#Abb.wbb#I#I#E",
+".G.G.G.G.G#N.G#N#N.##N.#.#.##x#x#xbAbA.r.r.rbKbK.2.2.2btbtbtbtbtbtbt.2btbKbKbK.rbAbA#x#x.#.##N#N#N.GaLbcbcbc#GbkaO#D#Da3a3.o.3b3a4a4.L.LaE.5aAbs.MaYaY.c.c.2.2.2.rbKbKb8aobSbC.A#ta5a5.qbs.q.5.5.5aE.5.5aE.5aE.5.5.5.5.qaA.qaAaAa5a5#ta..A.AbCbCbCaoaoaob8aob8b8b8bKb8.rbK.rbKbKbKbKbKbKbK.2.2.2.2.2.2.2.2.2.2bt.2.2bt.2.2.2.2bK.2bK.2bKbKbKbK.rbKb8bKbKb8b8aoao.9bSbC.A.Aa5a5aA.q.q.5aE#U.D.Dawawaw.a.a.a.a.a.aawaw.D.D#U#U.g.S.S..aKaK.t#m#mbt.2bKbAbA#x#x.#.##N#N#N#N#E#Ebb#Ibbbbbb#A.l.lb#.lb#aN.laNb#aN#A#A#A#A#Abbbb#Ibb#I",
+"#I#E.G#N.G#N.G#N#N#N.#.#.#.##x#x#xbAbA.r.rbKbKbK.2.2.2btbtbtbtbtbtbt.2.2.2bKbK.r.rbA#x#x.#.##N#N#N.G.GaLbc.j#G#GaOaO#DaQbyb5bLbuaja4.L.LaE.q.5bs.M#5aY#m.c.2.2bKbKbKb8bKb8bSbCbC.Aa5#taA.q.q.5.5.5.5#UaE.gaE#U.5.5.5.5.q.qaAaAaAa5a5#ta..A.A.AbSbSbCaoaoaob8b8bKbKb8bKbKbKbKbKbKbKbK.2bK.2bK.2bK.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2bK.2bKbK.2bKbKbKbK.rbKb8b8b8aob8ao.9bCbC.A.Aa5aA.q.q.5aE#U.D.D.Dawaw.aaw.a.a.aawawawaw.D#U#U.g.g.S.Sbm#z#5.t#mbt.2bK.rbA#x#x.#.##N#N#N.G#N.G#Ebbbb#A.l#A.l#AaN.laN.laNb#.laN#AaN#A#A#A#A#Ibb#I#I",
+".G.G.G.G.G.G#N#N#N#N#N.#.#.##x#xbA#xbAbA.r.rbK.r.2.2.2.2btbtbtbtbtbtbt.2.2.2bK.r.rbAbA#x.#.#.##N#N.G.GaLbcbc#G#GaO.Z#DaQa3b5bLb3a4a4.L.LaEaE.5aAbs.MaY#Q.cbt.2.2bK.rbKb8aoaobS.A#t#ta5aA.qbs.5.5aE.5#U.5#U.5#U.5aE.5.5.5bs.q.qaAaA#ta5a5#t.A.AbCbCbCbSaob8aoaob8b8bKb8bK.rbK.rbKbKbKbKbKbKbK.2bK.2.2.2.2.2.2bt.2bt.2.2.2.2.2bK.2.2bK.2bKbKbKbK.rbKbKb8bKbKbKb8aoaoaobSbC.A.Aa5a5aA.q.5aE#U#U.D.Daw.aaw.a.a.a.a.a.aaw.D.D.D#U.g.g.S.SbmaK#5.t#m.cbtbKbKbA#x#x.#.#.##N#N#N#E#Ebbbbbbbb#A#A.laN.laNaNaNaNaNaNaNaN#A.l#A#Abb#Abbbb#I",
+"bb.G#E.G#N.G#N#N#N#N#N.#.#.#.##x#x#xbAbA.r.rbKbK.2.2.2btbtbtbtbtbtbtbt.2.2bKbKbK.rbAbA#x#x.#.##N#N.G.GaLaLbc#G#G.waO#D.Ta3bybLau.da4az.LaE#2.5bs.M.M#5#m.cbt.2bKbKbKbKb8b8aobCbC.Aa5a5aAaA.q.5.5.5#U.5aE#UaE#U.5#U.5aE.5.q.5aA.qaAa5a5#t#t.A.A.AbSbS.9aoaoaob8bKb8b8bKb8bKbKbK.rbKbKbKbK.2bKbK.2.2bK.2.2.2.2.2.2.2.2.2.2.2.2.2.2bK.2bKbKbKbKbKbKbK.rbKb8b8b8b8aoaoaobCbC.A.Aa5a5a5aA.5.5aE#U.D.Dawawaw.a.a.a.a.aaw.aaw.D.D#U#U.g.S.S..bmaK.t#m.cbtbKbKbAbA#x.#.#.##N#N#N.G#E#Ebbbb#AaS.l.l.laNaNaN.laNaN.laN.lb#.l#A#A#A#Abb#Ibb",
+"#Ibb.G.G.G#N.G#N#N#N#N#N.#.#.##x#x#xbAbA.rbK.rbKbK.2.2.2btbtbtbtbtbtbtbt.2.2bKbK.rbAbA#x#x.#.##N#N#N.G.Gbcbcbc#GaOaO#D.Ta3b5.o.3aja4az.L#aaE.5bsbs.MaYaY.cbt.2.2bKbKbKbKb8aobS.A.A#ta5aA.qbs.5.5.5.5aE#U.5#UaE#U.5aE.5.5.5.5.qaAaAaAaAa5.Aa5.A.AbCbCbSbSaoaoaoaob8bKb8.rbK.rbKbKbKbK.r.2.r.2bK.2bK.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2bK.2bK.2bKbKbKbKbKbK.rbKb8bKb8aoaoaobS.A.A.Aa5aAaA.q.5aE#U.D.D.Dawaw.a.a.a.a.a.aawawaw.D#U#U.g.S.S.SaK#z#5#m#mbt.2.r.r#x#x.#.#.##N#N#N#N#E#Ebbbbbb#A#A.laN.laNaNaNaWaNaNaNaNaNaNaN.l#A#A#Abbbb",
+"bb.G#E.G#N.G#N#N#N#N.##N.#.#.##x#x#xbAbA.r.r.rbK.2.2.2.2btbtbtbtbtbtbt.2.2.2bKbK.r.rbA#x#x.#.##N#N#N.G.G.Gbcbc.w#GaO.Z.TaQb5.o.3b3a4a4.L.LaEaE.qbs.M#5aY.c.c.2.2bK.rbKb8b8aobSbC.A#ta5aAaA.q.5.5#UaE#U#U#U#U.5#U#U.5.gaE.5.5bs.qaAaAa5a5#t#t.A.A.AbSbCbSaoaoaob8b8bKb8bKb8bKbK.rbKbKbKbKbKbKbKbK.2bK.2.2.2.2.2.2.2.2.2.2.2.2.2.2bK.2bKbKbKbKbKbK.rbK.rbKbKb8b8aob8aoaobCbC.A.A#ta5aAaA.5.5aE#U.D.Dawaw.aaw.a.a.a.a.aawaw.D.D#U.g.g.S.SbmaK#5.t.c.c.2bK.rbA#x#x.#.##N#N#N#E.G#Ebbbb.l.l.l.laNaNaNaWaN#raNaWaNaNaN.l#A.l#A#A#Abbbb",
+"bbbb#I#E.G.G.G.G#N#N#N#N.#.#.##x#x#x#xbAbA.r.rbKbKbK.2bt.2btbtbtbtbtbtbt.2.2bKbKbKbAbAbA#x.#.#.##N#N.G.GaLbcbc#G.waOb##Da3#jb5.3buajazaz.LaE.5.5bs.M.MaY#Q.c.2.2.2bKbKbK.2b8bSbS.Aa5#taAaA.q.5.5.gaE.gaE#U#U#UaE#UaE#U.5.5.5.qbs.qaAaAaAa5a5#t#t.AbCbSbCaoaoaoaoaoaobKb8bKbK.rbKbKbKbKbKbKbKbK.2bKbK.2bK.2.2.2.2.2.2.2.2.2.2bK.2.2bK.2bK.2bKbKbKbKbKbKbKbKbKbKbKaoaoaoaobS.A.A#ta5a5aA.5.5aE#U.D.Dawawaw.a.a.a.a.a.aawaw.D.D#U#U.g.S.Sbmbm#5.t#m.cbtbK.rbA#x#x.##N.##N#N#N#E#EbbaSbb#A.l.laNaWaNaW#raN#raN#raNaWaNaNaN.l.l#A#Abb",
+"bbbb.G#E.G#N.G#N#N#N#N.#.#.#.#.##x#xbAbA.r.r.rbKbK.2.2.2btbtbtbtbtbtbtbt.2.2.2bK.r.rbA#x#x#x.#.##N#N.G.G.GaLbc.w#GaOb##D.Ta3.obLbuaja4az.LaEaE.5bsaA#5#5#m.cbt.2.rbK.rbKb8aoaobC.A#ta5aAaA.5.5.5.5#U#U#U#U#U#U#U#U.gaE.gaE.5.5.5.qaAaAaA#ta5#t.A#t.AbCbSbSaoaoaob8b8bKb8bKb8bKbK.rbK.rbKbKbKbKbKbK.2bK.2bK.2.2.2.2.2.2.2.2.2.2.2.2bK.2bKbKbKbKbK.rbK.rbK#3bKb8b8b8aoaobSbCbC.A#ta5aAaA.q.5.5#U#U.D.Daw.a.a.a.a.a.a.a.aawaw.D.D#U.g.g.S.SaK#z#5#m.c.2.2.r.rbA#x.#.#.##N#N#E#E#Ebbbb.l.l.l.laNaWaN#r#raW#r#raN#raNaNaN.l#A.l#Abb#A",
+"bbbbbb.G#E.G#N.G#N#N#N#N#N.#.#.##x#x#x#xbA.r.r.rbKbK.2.2.2btbtbtbtbtbtbt.2.2.2bKbK.r.rbA#x.#.#.##N#N#N.G.G.Gbc#G.w.wb##DaQa3b5bLb3#ia4az#a.LaE.5bsbs.MaY#Q.cbt.2.2bKbKbKb8b8bSbS.A#t#ta5aAaA.5.5aE.5#UaE#U#U#U#U#U#UaE#UaE.g.5.5.5.qaAaAa5aA#ta5.A.A#QbCbCbSaoaoaoaoaob8bKb8bK.rbKbKbKbKbKbKbKbKbKbK.2bKbK.2bK.2.2.2.2.2.2.2.2.2bK.2bKbK.2bKbKbKbKbKbKbKbKb8bKb8.2b8aoaobSbS.A.A#ta5a5aA.q.5#U#U.D.Dawawaw.a.a.a.a.a.aawaw.D.D#U#U.S.Sbobm#z#5#m.cbt.2.r.r#x#x#x.##N#N#N#N#E#EbbaSbb#A.laNaWaN#raW#r#r#r#r#r#raW#r.laNaN#A.l#Abb",
+"bbbbbbbb.G#E.G#N#N#N#N#N.#.#.#.##x#x#xbAbA.r.rbKbK.2.2.2btbtbtbtbtbtbtbtbt.2.2bKbK.rbAbAbA#x.#.##N#N#N.G.GaLbc#I#G.waO#D.Ta3bybL.3.da4azaz#aaE.5.qbs.M.MaY.cbt.2bKbKbKbKb8b8aobSbC#ta5aAaA.q.5.5.g#U#U#U#U#U#U#U#U#U#U.g.5#U.5.5.5bs.qaAaAa5#ta5#t.A.A.AbSbCbSaoaobKb8bKb8bKb8bKbK.rbK.rbKbKbKbKbKbKbKbK.2bK.2.2bK.2.2.2.2bK.2bK.2.2bK.2bKbKbKbKbK.rbK.rbK.rbKb8b8b8aoaoaobCbC.A#ta5.MaA.q.5.5#U.D.D.Dawaw.a.a.a#O.a.aawawaw.D#U#U.g.S.SbmaK#5.t#mbt.2bK.rbA#x.#.#.##N#N#N#E#E#EbbaS.l.l.laNaW#raN#r#r#r#r#r#r#raNaWaN.l.l.l#A#A",
+"bbbbbbbb#E#E.G#N.G#N#N#N#N.#.#.#.##x#xbAbAbA.r.rbK.r.2.2.2.2btbtbtbtbtbt.2.2.2bKbK.r.rbA#x#x.#.#.##N#N.G.G.G#Ibc.w.waOb#.Ta3b5.oaubua4azaz.LaEaE.5bsbs#5aY.c.c.2.2.2.rbKbKb8aobSbC#t#ta5aAbs.5.5.5#UaE#U#U#U.D#U#U#U#U#UaE#U.5.5.5.5.qbsaAaAaA#t#t#t.A.A.AbSbSaoaoaoaoaob8b8bK.rbKbK.rbK.rbK.rbKbKbKbKbKbK.2bKbK.2.2bK.2bK.2.2.2bK.2bK.2bKbKbKbKbKbKbK.rbK.rb8bKbKaob8aoaobSbS.A.A#ta5aAaA.5.5#U#U.D.Dawaw.a.a.a.a.a.a.aawaw.D#U#U.g.S.SbmaK#5#5#m.c.2bKbAbA#x#x.#.#.##N#N#E#EbbaSbb.l.laNaW#raW#r#r#r#r#r#r#r#r#r#raWaNaN.l.l#A",
+"#Abbbb#E.G#E#E.G#N#N#N#N.##N.#.##x#x#x#xbA.r.rbKbKbK.2.2.2btbtbtbtbtbtbtbt.2.2bKbK.r.rbAbA#x#x.#.##N#N#N.G.GaLbc#I.waOb#.T.Tbyal.3bu#ia4az#a#a.5.qbs.M.MaYaYbtbt.2.rbKbKb8bKaobSbC.A#taAaA.q.5.gaE.g#U#U.D#U#U.D#U.D#U#U#U.gaE.g.5.5bs.qbsaAa5aA#t#t.A.A.AbSbCbSaoaoaobKb8bKb8bKb8.rbKbKbK.rbKbKbKbKbKbKbKbK.2bK.2bK.2.2bK.2bK.2bK.2bKbK.2bKbKbKbK.rbKbK.rbKbK.rb8bKaoaoaobSbCbC.A#ta5aAaA.q.5.5#U.D.Dawaw.a.a.a.a.a.a.aawawaw.D#U#U.g.S.Sbm#z#5#mbtbtbK.rbA#x#x.#.##N#N#N#N#EbbaSaS.l.laWaWaW#r#rbGbGbGbGbG#r#raW#raNaWaN.l.l#A",
+"aS#Abbbbbb.G#N.G#N#N#N#N#N.#.#.#.##x#x#xbAbA.r.rbKbKbK.2.2.2btbtbtbtbtbtbt.2.2.2bKbK.rbAbA#x.#.#.##N#N#N.G.GaL#Ibc.waOb##Da3a3.obLbu#ia4az.L#aaE.5.5bs.M#5#Q.cbt.2.2bK.rbKb8b8bS#Q.A#t#taAbs.5.5.gaE#U#U#U#U.D#U.D#U#U#U#U#U.5#U.5.5.5bs.qaAaAa5a5#t#t#t.A#QbCbSbSaoaoaoaob8bKb8bKbK.rbK.rbKbK.rbK.rbKbKbKbKbKbKbK.2bK.2bK.2.2bK.2bKbK.2bKbKbKbKbKbKbKbKbK.rbKb8bKb8b8b8aoaobSbS.A#t#ta5aAbs.5aE#U#U.D.Dawaw.a.a.a#O.a.a.aawaw.D#U.g.g.S.SaKaK#5#m.cbt.2.r.r#x#x.#.#.##N#N#E#E#EbbaS.l.l.laNaW#rbG#rbG#rbG#rbG#r#r#r#raWaN.l.l.l",
+".lbbbbbbbb#E#E#E.G#N#N#N#N.#.#.#.##x#x#xbAbA.r.rbK.r.2.2.2.2btbtbtbtbtbtbt.2.2.2bK.r.rbAbA#x#x.#.#.##N#N.G.G.Gbc#I.w.wb#b#.Ta3albLbu.da4azaz#aaE.5.5aA.M#5aY.cbt.2.rbKbKbKb8aoaobC.A#ta5aAaA.5.5.5#U#U#U.D#U.D#U.D#U.D.D#U#U#U.gaE.5.5.5bs.qaA.Ma5#ta5.A.A.A#QbSbSaoaoaobKaob8bKb8.rbKbK.rbK.rbKbKbK.rbKbKbKbK.2bKbK.2bK.2bK.2bKbK.2bK.2bKbKbKbKbK.rbK.rbKbKbK.rbKb8bKaoaoaobSbC.A.A#t#taAaA.q.5.g#U.D.Dawaw.a.a.a.a.a.a.aawaw.D.D#U.g.S.SbmaK.t#5.cbt.2.r.r#x#x#x.##N#N#N#N.WbbaSaS.l.laWaW#r#rbGbGbGbGb5bGbGbG#rbG#raW#raN.l.l",
+"#A.l.lbbbb#E#E.G#N#N#N#N.##N.#.#.##x#x#x#xbA.r.r.rbK.r.2.2.2btbtbtbtbtbtbtbt.2bKbKbK.r.rbA#x#x#x.##N#N#N#N.G.G#I#I.w.waO.T.Ta3b5bL.3.d#iazaz#aaEaE.5bs.M.MaY#Qbt.2.2bK.r.rbKaoaobSbC#t#taAaA.5.5.5#U#U#U#U.D#U.D#U.D.D#U#U#U#U#U#U.g.5.5.5bsaAaAaAaA#t#t#t.A.AbSbCbSaoaoaob8bKb8bKb8bK.rbK.rbK.rbK.rbK.rbKbKbKbKbK.2bKbK.2bK.2bK.2bK.2bKbKbKbK.rbKbKbKbK.rbK.rb8bKb8bKb8aoaobSbS#Q.A#t#taAaAbs.5.5#U.D.D.Dawaw.a#O.a#O.a.a.aaw.D.D#U#U.S.Sbobm#5.t#mbt.2bKbAbA#x.#.#.##NaM#E#E.WbbaS.l.laW#raWbGbGbGb5bGbGb5bGb5bG#r#r#raWaWaN.l",
+".lbbbbaSbbbb#E#E#N.G#N#N#N#N.#.#.#.##x#xbAbAbA.rbKbK.2.2.2.2.2btbtbtbt.2bt.2bt.2bKbK.r.rbAbA#x.#.#.##N#N.G.G.GaL#Ibc.wb#b#.Ta3byau.3.da4azaz#a#aaE.5bsbs.MaY.c.c.2.2bKbKbKbKb8aobSbS#t#taAaA.5.5.g#U#U#U.D#U.D.D.D#U.D#U.D#U#U#U#U.5.g.5.5.5bsaAaAaA#t#t#t.A.A.AbSbSbSbSaoaob8b8bKb8.rbKbK.rbK.rbK.rbKbK.rbKbK.rbKbKbK.2bKbKbK.2bKbKbKbK.2bKbKbKbK.rbK.rbK.rbK.rbKb8bKaob8aoaobSbC.A.A#ta5aAaA.5.5#U#U.Dawawaw.a.a.a#O.a.a.aawaw.D#U#U.g.S.SaK#z#5#mbt.2bK.rbA#x#x.#.##N#N#N#E#EaSaS.l.laWaW#rbGbGbGbGb5bGalbGbGbGbGbG#r#raNaW.l",
+".l.l.lbbbb#E#E#E.G#N#N#N#N.##N.#.##x#x#x#xbAbA.r.r.rbKbK.2.2.2btbtbtbtbtbt.2.2.2bKbK.r.rbAbA#x#x.#.##N#N#N#N.GaL#I#I.w.wb#b#a3b5b5.3bu#i#iazaz#aaE.5.5aA.M#5#Q.cbt.2bK.r.rb8bKaobSbC.A#ta5aAbs.5.gaE#U#U#U.D#U.D.D.D.D.D#U.D#U#U#U#UaE.g.5.5.5bsaAaAaAa5#t#t.A.A#QbCbSaoaoao.2b8bKb8bKb8.rbK.rbK.r.rbK.rbK.rbKbKbKbKbKbKbK.2bKbKbK.2bKbKbKbKbKbKbKbK.rbK.rbK.rb8bKbKb8bKb8aoaobSbSbS.A#t#taAaA.5.5.5#U#U.Dawaw.a.a#O.a.a.a.aawaw.D#U#U.g.S.SbmaK#5#m.cbtbK.rbA#x#x.#.##NaM#N.W#EaSaS.laWaWaWbGbGbGbGbGal.Kb5.Kb5b5bGbG#r#raWaWaN",
+".l.laSbbaSbb#E#E#E#N#N#N#N#N.#.#.#.##x#x#xbAbA.r.rbKbK.2.2.2btbtbtbtbtbt.2bt.2.2bKbKbK.rbAbA#x#x.#.#.##N#N.G.G.GaL#I.w#Ab#.T.Ta3.o.3bu.dazazaH.LaEaE.5bs.M#taY.cbt.2bKbKbK.rbKb8bSbS.A#taAaA.q.5.5#U#U#U.D#U.D.D.D.D.D.D.D.D#U#U#U#U.g#U.5.5.5bsaAaAaA.Ma5#t#t#Q.A#QbSbSbSaoaob8b8bKb8.rbK.rbK.rbK.r.rbK.rbK.rbK.rbKbKbKbKbKbK.2bKbKbKbKbKbKbKbKbKbKbK.rbK.rbK.rbK.rbKb8aobKbSaobSbC.A#t#ta5aAaA.5.5#U.D.D.Daw.a.a.a.a#O.a.a.aawaw.D#U.g.g.SbmaK#5aY#mbt.2.rbA#x#x.#.#.##N#N#E.WbbaS.l#kaW#rbGbGbGb5.Kalal.KalalbGbGbGbG#r#raWaW",
+"aN.l.l.lbbbbbb#E#E.G#N#N#N#N#N.#.#.##x#x#xbAbA.r.r.rbKbK.2.2.2.2bt.2btbtbtbt.2.2.2bKbK.rbAbA#x#x.#.#.##N#N#N.G.G#I#I.w.wb#b#.Ta3albL.3.d#i.naz#a#aaE.5bsaA#5aY#Qbt.2bKbK.rbKbKaoaobS.A#t#taAbs.g.5.g#U#U.D#U.D.D.D.D.D.D#U.D.D.D#U#U#U#U.g.5.5.5.5bsaAaA.M#t#t#t.A.A.AbSbSaoaoaoaobKb8bKb8bK.rbK.r.rbK.rbK.rbK.rbKbKbKbKbKbKbKbKbKbKbKbKbKbKbKbK.rbK.rbK.rbK.rbK.rbKb8bKb8b8aoaobSbS.A.A#t#taAaA.5.5.g#U.D.Dawaw.a.a.a#O.a.a.aawaw.D#U#U.S.SboaK#5.t.cbt.2bK.r#x#x#x.##NaM#N.W#EaSaS#k.laWbY#rbG.K.Kalalalal.Kal.Kb5bGbGbGaW#raW",
+"aW.l.lbbaSbb#E#E#E#N#N#N#N#N.#.#.#.##x#x#x#xbAbA.rbK.r.2bK.2btbtbtbtbtbtbt.2bt.2bKbKbK.r.rbAbA#x#x.#.##N#N#N.G.G.G#I#I.wb#b#.Ta3b5bL.3.d#iazazaH#aaE.5bsaA.MaY.c.c.2.2.rbKbKb8bKbSbS.A.A.MaAaA.5.5#U#U#U#U.D.D.D.D.D.D.D.D.D.D#U.D#U#U#U.5.g.5.5bs.qbsaAaA.M#t#t.A#Q.AbSbSbSaoao.2b8aobKb8.rbK.rbK.r.r.rbK.rbK.rbK.rbK.rbKbKbKbKbKbKbKbKbKbK.rbKbKbK.rbK.rbK.rbK.rbK.rb8bKaob8aoaobS#Q.A#ta5.MaAbs.5aE#U#U.Dawaw.a.a.a#O.a.a.aawaw.D.D#U.g.S.SbmaK#5#mbt.2bK.rbA#x.#.#.##N#N#E.WbbaS.laWaW#rbGbG.Kalal.Kalalalalal.Kb5bGbG#r#raW",
+"aW.l.l.lbbaSbbbb#E.G#N#N#N#N#N.#.#.#.##x#x#xbA.r.rbK.rbK.2.2.2.2.2btbtbtbtbt.2.2.2bKbK.r.rbAbA#x.#.#.##N#N#N#N.G.G#I#I.w#Ab#aNa3b5albL.d.d.nazaz#aaEaE.5bs.M#taY.c.2.2bKbK.r.rb8b8bSbS#t#ta5bs.5.5.g#U.D#U.D.D.D.D.D.D.D.D.D.D.D.D#U#U#U#U#U.5.g.5bsaAaAaAaAaA#t#t#t.A#Q.AbSbSaoaoaob8bKb8bKb8bK.r.rbK.r.rbK.r.rbK.rbKbKbK.rbKbKbKbKbKbKbKbKbKbK.rbK.rbK.rbK.r.rbK#3bKbKbKb8bKaobSbSbSbC#t#t#ta5bs.5.5#U#U.D.Dawaw.a.a#O.a#O.a.aaw.D.D#U.g.S.Sbm#5.taY.c.2bK.rbA#x#x.#.##NaM#N.WaSaS.laWaWbG.KbGal.Kalaualaualalalal.KalbGbG#raW",
+"aW.laWaS.lbb.W#E#E#E#N#N#N#N.##N.#.#.##x#x#xbAbA.r.rbKbKbK.2.2btbtbtbt.2btbt.2.2.2bKbK.r.rbAbA#x#x.#.#.##N#N.G.G.G.G#I.w#Ab#aN.Ta3.obLbu.d#iazaH#a#aaE.5bs.M.MaY.cbt.2bK.rbKbKbKaobSbS.A#taAaAbs.5#U#U#U#U.D.D.D.Daw.Daw.D.D.D.D.D.D#U.D#U#U.g.5.5.5bsbsaAaA.M#t#t#t#t#Q.AbSbSbSaoaoaob8bKb8.rbKbK.r.r.r.r.r.rbK.r.rbK.rbKbKbKbK.rbKbKbKbKbK.rbKbK.rbK.rbK.rbK.r.rbK.rb8bKb8aoaoaoaobS#Q.A#t#taAaAbs.5.g#U.D.Dawaw.a.a.a#O.a.a.aawaw.D#U#U.g.SboaK#5#m.cbtbK.rbA#x#x.#.##N#NaM#E.WaS#kaWaWbYbG.Kalalalalaualauaualalal.KbGbGbG#r",
+"#raW.l.laSaSaSbb.W#E.G#N#N#N#N.#.#.#.##x#x#xbAbA.r.r.rbKbK.2.2.2bt.2btbt.2btbt.2.2bKbK.r.rbAbA#x#x#x.#.##N#N#N#N.G#I#I#I.wb#aN.Ta3albLbu.d#i.naH.L#aaEaEbsaA.MaY#Qbt.2.2bK.r.rbKb8aobS.A#t#taAbs.5.5#U#U.D#U.D.D.D.Daw.D.Daw.D.D.D.D.D#U#U#U#U.g.5.g.5.5bsaAaAaA.M#t#t#t#Q.AbSbSbSao.2aoaobKb8bKb8.rbK.rbK.r.r.rbK.r.rbK.rbK.rbKbKbK.rbK.rbKbKbK.rbK.rbK.r.r.r.rbK.rbK.rb8bKb8.2b8bSbSbC#Q#ta5#taAbs.5.5#U#U.Dawaw.a.a#O.a#O.a.a.aaw.D#U#U.g.SbmaK#zaYaYbt.2bKbA#x#x.#.#.#aM#N.WaSaS#kaWaWbGbG.KalbQauaualauauauaubQalalalbGbGbG",
+"aWaWaW.l.laSbbbb#E#E#N#N#N#N.##N.#.#.##x#x#xbAbAbA.rbKbKbK.2.2.2btbtbtbtbtbt.2.2.2bKbKbK.rbAbA#x#x.#.#.##N#N#N.G.G.G#I#I#A#Ab#.T#rbyau.3bu#i.nazaH#aaEaE.5bs.MaYaYbt.2.2.rbK.rbKb8aoao#Q#t#taA.5.5.g.g#U#U.D.D.D.Daw.Daw.Daw.D.D.D.D.D.D#U#U#U#U#U.5.5#C.5bsaAaA.M#t#t#t#t#Q.A#QbSbSaoaoaobKb8bKb8.rbK.r.r.r.r.r.r.rbK.rbK.rbK.rbKbKbK.rbKbK.rbKbK.rbK.rbK.rbK.r.r.rbK.rbKb8bKb8aoaoaobS.A.A#t.MaAaA.5.5.g#U.D.Dawaw.a.a#O#O.a.a.aawaw.D#U.g.S.SaKaK#m#mbt.2.r.r#x#x.#.##N#NaM#E.WaS.l#kaWbG.K.KalalauauauauaubLalaualal.K.KbGbG",
+"bG#raW.l.laSaSaS.W#E#E#N#N#N#N#N.#.#.##x#x#x#xbAbA.r.rbKbKbK.2.2bt.2bt.2bt.2bt.2.2.2bKbK.r.rbAbA#x#x.#.#.##N#N#N.G.G.G#I.w#Ab#aNa3b5.obL.d.d.nazaHaHaEaE.5bs.M#taYbSbt.2bKbK.rbKbKaobSbS.A#taAbsbs.5#U#U#U.D.D.Daw.D.Daw.Daw.Daw.D.D.D.D.D#U#U#U#U.g.g.5.5bsbsbsaAaA.M#t#t#t.A#QbSbSbSbtaoaob8bKb8bK.rbK.r.rbK.r.r.r.r.r.r.r.rbK.r.rbKbK.rbK.rbK.rbK.rbK.r.r.r.r.rbK#3.r.rbKb8b8bKaobSbSbS#Q#t#ta5aAbs.5.g#U#U.Dawaw.a.a.a.a#O.a.aawaw.D#U.g.g.SbmaK#5aY.c.2bK.r#x#x#x.#.##NaM.W.WaS#kaWbYbY.K.KalbQbLauauau.3auauauaualalalbGbG",
+"bGaWaWaW.l.laS#Ebb#E#E#N#N#N.##N.#.#.#.##x#xbAbAbA.r.r.rbK.2.2.2.2btbtbtbtbt.2bt.2bKbKbK.r.rbAbA#x#x.#.#.##N#N#N.G.G.G#I#A.w#A.T.Ta3albLbu.d#i.naz#a#aaE.5.qbs.MaY#QbtbKbKbK.rbK#3.2aobS.A#t.MaA.5.5.g#U#U.D.D.D.Daw.Dawaw.Daw.Daw.D.D.D.D.D#U#U#U#U#U.g.5.5bsaAbsaA.M.M#t#taY.A#QbSbSbSao.2aob8bKb8bK.rbK.r.r.r.r.r.r.rbK.rbK.rbK.rbK.rbK.rbKbK.rbK.r.r.rbK.r.rbK.r.rbK.rb8bKb8aoaoaobSbS.A#t#t.MaAaA.5.5#U#U.Dawaw.a.a#O#O.a#O.aawaw.D.D.g.g.SboaK#5#m.c.2bK.rbA#x.#.#.#aM#N.WaSaS#k#k#rbG.Kalauaualau.3au.3au.3auauaualbQ.KbG",
+"bGbGaWaW#k.laSaS.W.W#E#N#N#N#N#N.#.#.##x#x#x#xbAbA.r.rbK.rbK.2.2.2.2bt.2btbtbt.2.2.2bKbK.r.rbAbA#x#x.#.#.##N#N.G#N.G#E#I#I#A#Ab##ra3b5bLbu.d#i.n.naH#a#aaE.5bs.MaY#Q.c.2.2.rbK.rbKb8aobS#Q#t#taAbs.5.5#U#U#U.D.D.D.Dawaw.Dawawawaw.Daw.D.D.D.D.D#U#U.g#U.g.g.5.5bsbsaAaA.M#t#t#t#t.AbSbSbSaoaoaobKb8bKb8.r.rbK.r.r.r.r.r.r.r.r.r.r.r.rbK.rbK.r.rbK.r.rbK.r.rbK.r.r.r.r.rbK.rbKbKb8bKaobSbS#Q.A#t#t.MaAbs.5#U#U#U.Daw.a.a.a.a#O.a.a.aaw.D.D#U.g.SbmaK#5aY#QbtbK.rbA#x#x.#.#aMaM.W.Wa6aSaWbYbG.K.KbQauauau.3au.3buau.3auauaualalbG",
+"bGbGbGaWaW.laSaSbb#E#E#E#N#N#N.##N.#.#.##x#x#xbAbAbA.r.rbK.2bK.2.2btbt.2bt.2bt.2.2.2bKbKbK.rbAbAbA#x#x.#.#.##N#N#N.G.G#I#I#A#AaNaNa3b5bL.3bu#i.nazaHaHaEaE.5bsaA.MaYbSbtbKbK.r.rbKb8b8bSbS#t#taAbs.5.g#U#U.D.D.Daw.Daw.Dawawaw.Dawaw.Daw.D.D.D#U.D#U#U#U#U.g.5#C.5bsaAbs.M.M#t#taY#Q.A#QbSbSaobtb8b8bKb8.rbK.r.r.rbK.r.r.r.r.rbK.rbK.r.rbK.rbK.rbK.rbK.r.r.r.r.r.r.rbK.rb8.rb8bKaoaoaoaobSbS.A.A#ta5aAbs.5.5#U.D.Dawaw.a.a#O#O.a#O.aawaw.D#U.g.g.Sbm#5#5#mbt.2.r.r#x#x.#.##NaM#E.WaS#k#kbY.K.Kalauauaubuaububu.3buau.3auaualbQal",
+".KbGaWaWaW#k.laSaS.W#E.W#N#N.##N.#.#.#.##x#x#x#xbA.r.r.rbK.r.2.2.2.2.2bt.2btbt.2.2.2bKbKbK.r.rbA#x#x#x.#.#.##N#N#N#E.G.Gbb#I#Ab#aN#rb5albLbu#i#i.nazaH#a#a.5.q.M.MaY#Qbt.2bKbK.r.rbKbKbSbS.A#t.MaAbs.5.g#U#U.D.Daw.Dawawawawawaw.Dawaw.Daw.D.D.D.D.D#U#U#U#U.g.g.5.5bsbsaAaA.M.M#taY#t#QbSbSbSaoao.2b8bKb8.rbK.r.r.r.r.r.r.r.r.r.r.rbK.rbK.r.rbK.r.r.r.rbK.r.r.r.r.r.r.r.r.rbKb8bKb8bKaobSbSbSaY#t.M.MaAbs.g.g#U.D.Daw.a.a#O.a#O.a.aawaw.D#U#U.S.SbmaK#5aYbt.2.rbAbA#x.#.#.#aMaM.WaS#kaWbYbG.KbQalau.3b3.3bub3buaubu.3auauaual.K",
+".K.KbGaWaW.l.laSbb.W#E#E#N#N#N.##N.#.#.##x#x#xbAbAbA.r.rbKbK.2bK.2bt.2bt.2bt.2bt.2.2bKbKbK.r.rbAbA#x#x.#.#.##N#N#N.G.G#E#Ibb#A#AaN.Ta3albLbu.d#i.n.0aH#aaEaE.5bs.M#t#Q.cbK.2.r.r.rbKb8aobS#Q.A#tbs.5.5.g#U#U.D.D.Daw.Dawawawawawawawawawawaw.D.D.D.D.D#U#U#U#U.g.g.5#C.5bsbsaA.M.M#t#taY#Q#QbSbSaoaobKb8bKbK#3bK.r.r.r.r.r.r.r.r.r.r.r.r.rbK.r.rbK.rbK.r.r.rbK.r.r.r.r.rbK.rbKb8bKb8aoaoaobS#Q.A#t#taAaAbs.5#U#U#U.Dawaw.a.a#O#O.a#O.aaw.D.D#U.g.SboaK.t#mbS.2bK.rbA#x#x.#.##N.W.Wa6#k#kbY.K.Kauauauaubububububububuau.3auauaual",
+"al.KbGbYaWaW#kaSaSaS#E.W#N#N#N#N#N.#.#.#.##x#x#xbAbA.r.rbK.rbK.2.2.2bt.2bt.2bt.2.2.2.2bKbK.r.rbAbA#x#x#x.##N.##N#N#N#E.G#Ibb.w#AaN#ra3b5bL.3bT#i.nazaHaH#aaE.5.q.M#taYbSbt.2bKbK.r.rbKb8bSbS#t#t#tbs.5.g#U#U.D.D.D.Dawawawawawawawawawawawaw.Daw.D.D.D.D#U#U#U#U.g.g.g.5bsbsbsaAaA.M#t#t#t#Q#QbSbSao.2aobKb8bKbK.r.r.r.r.r.r.r.r.r.r.rbK.r.r.rbK.r.r.r.r.r.r.r.r.r.rbK.r.r.r#3bKbKbKb8btaobSbS#Q#t#t#taAbs.5.5#U#U.Daw.a.a.a.a#O#O.a.aawaw.D#U.g.SboaK#5aY.cbtbK.rbA#x.#.#.#aMaM.WaS#kaWbY.K.KbQauau.3b3bubububububububu.3auaual",
+"al.K.KbGbYaW#k.laS.W#E.W#E#NaM#N.#.#.#.##x#x#x#xbAbAbA.r.rbK.2bK.2.2.2.2bt.2.2.2.2.2bKbKbK.r.rbAbA#x#x.#.#.#.##N#N.G#N.G.G#Ibb#Ab#aN#rb5al.3bu#i#i.n.0aH#a#aaE.5bs.MaY#QbtbKbK.r.rbK#3bKaobS.A#taAaAbs.5.g#U.D.D.Dawawawawawaw.aawawawawawawawaw.Daw.D.D.D.D#U#U#U#U.g.5.gbsbsbs.M.M.M#t#taY#Q#Q#QbSaoaobKb8bK.rbK.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbK.r.r.r.r.r.r.r.r.r.rbK.rbK.rb8b8bKaoaobSbS.A#Q#t.MaAaAbs.g.g#U.D.Daw.a.a#O.a#O.a.a.aaw.D#U.g.g.Sbm#5#5.cbtbK.rbA#x#x.#.#aMaM.Wa6#k#kbY.K.Kauaub3b3bubu.dbu.dbubub3bubuauauau",
+"aual.KbGbYaWaW#kaSaS.W.W#EaM#N#N.##N.#.#.##x#xbA#xbAbA.rbK.rbKbK.2.2bt.2bt.2bt.2.2.2.2bKbK.r.r.rbA#x#x#x.#.#.##N#N#N#N.G#Ebbbb#A#AaN#ra3albLbu#R#i.nazaHaHaEaE.5aA.M#taYbS.2.2bK.r.rbKbKb8bS#Q#Q.MaAbs.5.g#U#U.D.D.D.Dawawawaw.aaw.a.aawawawawawawaw.D.D.D.D.D#U#U#U#U.g.5.g.5bsbsbsaA.M#t#t#t#Q#QbSbSbtaob8bKb8bK.rbK.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbK.r.r.r.r.r.r.r.r.r.rbKbKb8bKaoaobSbS#Q#t#t.MaAbs.5.g#U.D.Daw.a.a.a#O#O#O.a.aaw.D.D#U.S.Sbo#5#5#mbS.2.r.r#x#x.#.#aMaM.W.W#k#kbY.KbQauauaububu.dbu.dbu.d.dbubububuauau",
+"aubQ.KbGbGaW#k.laSaSbb.W#E#N#N.##N.#.#.#.##x#x#xbAbAbA.r.rbKbKbK.2.2.2.2bt.2.2.2bt.2bK.2bKbK.r.rbAbA#x#x#x.#.##N#N#N.G#N.G#Ibb#A#AaN.T#rb5bL.3.d#i.n.naHaH#aaE.5.5aA.MaYbSbtbKbK.r.r.rb8bKaobS.A#t.Mbs.5.g#U#U.D.Dawawawawawawaw.aawaw.aawawawawawawawaw.D.D.D.D#U#U#U#U.g.g.g.5#Cbsbs.M.M.MaY#t#Q#QbSbS.2aobKb8.rbK.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rb8.rb8bKb8ao.2aobSbS.A#Q#t.MaAaA.5.5#U#U.Dawaw.a.a#O.a#O.a.aaw.D.D#U.g.SbmaK#5aYbt.2bKbAbA#x.#.#.#aM.Wa6#kbzbY.KbQbQaub3bubu.d.d.d.d.dbu.dbubub3.3au",
+"auau.K.KbYbYaWaWaSaS.W.W.WaM#N#N.##N.#.##x.##x#x#xbAbA.r.r.rbKbKbK.2.2.2.2.2bt.2.2.2.2bKbK.r.r.rbAbA#x#x.#.#.#.##N#N#N#E.G#E#Ibb#AaNaNa3b5albLbuaU#i.n.naH#a#aaE.5aA.MaY#QbS.2bKbK.r.rbKb8aobS#Q#t.MaAbs.5.g#U#U.D.D.Dawaw.aaw.aaw.a.a.aaw.a.aawawawawaw.Daw.D.D.D.D#U#U#U#U.g.g.g.5bsbs.M.M.M#taYaY#QbSbSao.2aobKb8.rbK.r.r.r.rbA.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbK.rb8bKbKaoaoaobS#Q#Q#t#t.MaAbs.g.g#U.D.Daw.a.a#O#O#O.a.a.aaw.D#U.g.SboaK#5#m#Q.2bK.rbA#x#x.#aMaMaMa6#kbzbY.KbQauaub3bu.d.d.d.d#R.d#R.d.dbububuau",
+"auaual.K.KbYaW#k#kaSaS.W#E#EaM#N#N.#.#.#.#.##x#x#xbAbA.r.rbK.r.2.2bK.2.2.2bt.2.2.2.2.2bKbKbK.r.rbAbA#x#x#x.#.#.##N#N#N.G#E.Gbbbb#A#AaN#ra3albLbu.daU.n.0aHaH#aaE.5.qaA#taY.c.2bK.r.r.rbKbKb8aobS.A#taAbs.5.g#U#U.D.Dawawawawaw.a.aaw.aaw.a.aaw.aawawawawawawaw.D.D.D.D.D#U#U#U.g.g.5bo.5bsbs.M.M#taY#Q#QbSbSao.2b8bKbK#3.r.r.r.r.r.rbA.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbK.rb8b8bKaoaobSbS.A#t#t.MaAbs.5.g#U#Uawawaw.a#O.a#O#O.a.aaw.D.D.g.g.SaK#5#5.cbtbK.rbA#x#x.#.#aM.Wa6a6aW#1#1bQaub3bubu.d.d#R#i#R#i.d#R.d.dbubuau",
+"auauau.K.KbGbYaW#kaSaS.W.W#NaM#N#N.##N.#.##x#x#x#xbAbAbA.r.r.rbKbK.2.2.2.2.2.2.2.2.2.2bKbKbK.r.r.rbA#x#x#x.#.#.#.##N#N#N#E.G#Ebb#A#AaN#r#rb5bL.3bu#i.n.n.naH#a#aaE.5bs.MaY#QbS.2bKbK.r.rbKbKaobS#Q#t.Mbsbs.g#U#U.D.D.D.Dawaw.aaw.a.a.a.a.a.a.a.a.a.aaw.aawawawawawaw.D.D.D#U#U#U#U.g.5.g#Cbs.M.M.M#taYaY#QbSbtao.2b8bKbKbK.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbKb8bKaobtbS#QbSaY#t#t.Mbs#C.5#U#U.Dawaw.a.a#O#O#O.a.aawaw#U#U.S.Sbo#5#5.cbSbK.rbA#x.##xaMa9aMa6a6bz#1.K##auaubu.d.d.d.daU#i#RaU#i.d.d.dbubu",
+"buauaubQ.K.KbYaW#kaSaS.W.W.W#NaM#N.#.#.#.#.##x#x#xbAbA.r.r.rbKbK.2.2.2.2.2bt.2.2.2.2.2bKbKbK.r.rbAbAbA#x#x#x.#.##N#N#N#N.G#E.Gbbbb#A.laN#rb5al.3bT.daU.n.0aHaH#aaE.5bsaA#t#QbS.2bK.r.r.r.rb8.2ao#Q#Q#taAbs.5.g#U#U.Dawawawawaw.aaw.a.a.aaw.a.a.a.a.a.aaw.aawawawawawaw.D.D.D.D#U#U#U.g.g.5#Cbsbs.M.M#taY#Q#QbSaobtb8bKb8.rbK.r.r.rbA.rbA.r.rbA.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rb8.rbKbKaobKaoaobS#Q.A#t.MaAaAbs.g.g#U.D.Daw.a.a#O#O#O.a.a.a.D.D#U.g.SbmaK#5#Qbt.2.rbAbA#x.#.#aMaMa6a6#k#1.KbQb3b3bu.d.daU#iaUaU#iaU#R#i#R.d.dbu",
+"bub3auau.K.KbYbYaW#kaSaS.W#EaM#N#N.##N.#.#.##x#x#x#xbAbA.r.rbK.rbKbK.2.2.2.2.2.2.2.2.2bKbKbK.r.r.rbAbA#x#x.#.#.#.#.##N#N#N#E#Ebbbb#A.laN#ra3albLbu#R#i.n.n.0aH#aaEaE.qaA.MaY#QbSbKbKbK.r.rbKbKaobS#Q#t#tbsbs.g#U#U.D.D.D.Daw.aaw.a.a.a.a.a.a.a.a.a.a.a.a.a.aaw.aawawawawaw.D.D.D#U#U#U.g.g.g.5bs.M.M.M#taY#Q#QbSaobtaobKbKbK.r.r.r.r.r.rbA.r.r.r.rbA.r.r.rbA.r.rbA.rbA.r.r.r.r.r.r.rbKb8bKao.2aobSbS#QaY#t#t.Mbs.5.g#U.D.Daw.a.a.a#O#O#O.a.aaw.D#U.g.Sbo.M#5#m#Q.2bK.r#x#x#x.#a9aM#u#kbz#1bQbQaub3bu.d.d#i#R#iaUaUaU#i#R#i.d.dbu",
+"bub3auaubQ.K.KbY#k#k#k.W.W.W.W#N.##N.#.#.#.##x#x#xbAbAbA.r.r.rbKbK.2bK.2.2.2.2.2.2.2.2.2bKbKbK.r.rbAbA#x#x#x.#.#.##N#N#N#N.G#E.Gbbbb#AaN#r#ralau.3bu#iaU.n.0aHaH#aaE.5bsa5#t#QbtbtbK.r.r.r.rb8aoao#QaY#taAbs.5.g#U#U.Dawawawaw.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.aaw.aawawawawaw.D.D.D#U#U.g.gbo.5#Cbs.M.MaYaYaY#Qbtao.2aobKb8.rbK.r.r.r.r.r.rbA.r.r.r.rbA.r.r.rbA.r.r.r.rbA.r.r.r.rbK#3bKb8bKaoaobSbS#Q.A#t.MaAaAbs.5#U#U.Dawaw.a#O#O#O#O.a.aawaw#U#U.S.SaK#5aY.c.2bKbAbA#x#x.#aMaMa6a6bzbYbQbQb3b3bu.daUaUaUaUaUaUaUaUaUaU#i.d.d",
+"bubub3auau.K#1bYaW#k#kaSaS.WaM#N.##N.#.#.#.#.##x#x#xbAbAbA.rbK.rbKbK.2.2.2.2.2.2.2.2.2bKbKbKbK.rbA.rbA#x#x#x.#.#.##N.##N#N#N#E#Ebbbb#A.laN#rb5albLbu#R#i.n.n.0aH#aaEaE.5aA.MaY#QaobKbK.r.r.r.rbKaobS#Q#t.Mbsbs.g.g#U.D.D.Dawawawaw.a.a.a.a.a#O.a#O.a#O.a.a.a.a.a.a.a.a.aawawawaw.D.D.D#U#U#U.g.g#Cbsbs.M.MaYaY#QbSbSbtaobKbKbK.r.r.r.r.rbA.r.r.r.rbA.r.r.rbA.r.r.r.rbA.r.r.r.r.r.r.rbK.rbKaobKaobtbS#Q#QaY#t.MaAbs.g.g#U.Dawaw.a#O.a#O#O#O.aaw.D.D#U.gbobm#5#5#QbtbK.rbA#x#x.#a9aM#ua6bz#1bQ##aub3.d.d#i#iaU#Z#iaUaUaUaUaUaUaU.d",
+".dbub3auaubQ.KbYbY#k#kaSa6.W.WaM#N.##N.#.#.##x#x#x#xbAbA.r.r.rbKbKbKbK.2.2.2.2.2.2bK.2.2bKbK.r.r.rbAbAbA#x#x#x.#.#.##N#N#N.G#E#Ebbbb#A.laN#r#ralbLbu.daU.n.n.0aHaH#aaE.5aAaA#t#QbS.2bK.r.r.rbKbKb8bSbSaY#taAbs.5.g#U#U.D.Dawawaw.a.a.a.a#O.a.a#O.a.a#O.a#O.a#O.a.a.a.a.a.aawawawawaw.D.D#U#U#U.g.g#Cbsbs.M.MaYaY#QbSbtao.2b8bKbKbK.r.r.r.rbA.rbA.r.r.rbA.r.r.rbA.r.r.r.rbA.r.r.r#3.rbK#3bKb8.2aoaobSbS#Q#t#t.M.Mbs.5.g#U#U.Daw.a.a#O#O#O.a.a.aaw.D.g.g.S#CaKaY#mbtbK.rbA#x#x.#a9aMa6a6bz#1aqaub3b3.d#iaUaUaUaU#Z#ZaU#ZaUaU#i#R#i",
+".d.dbub3auau.K.KbYaW#ka6.W.W.WaMaM#N.#.#.#.#.##x#x#xbAbAbA.r.r.r.r.2bKbK.2.2.2.2.2.2.2bKbKbKbKbK.r.rbAbA#x#x#x.#.#.##N.##N#N.G#E#Ebbbb#A.laWa3b5al.3bu.daU.n.n.0aH#aaEaE.qaA#taYbSaobKbK.r.r.rbKb8.2bS#Q#t.Mbsbs.g#U#U.D.Dawaw.aaw.a.a.a.a.a#O.a#O#O.a#O.a#O#O.a#O.a.a.a.a.a.a.aaw.Daw.D.D#U#U.g.g.g#Cbsbs.M.MaYaY#QbSbtao.2bK.rbK.r.r.r.r.rbA.r.rbA.r.r.rbA.r.r.r.rbA.r.r.r.r.r.r.r.rbKbKb8bKb8btbSbS#Q#Q#t#t.Mbsbs.g#U.D.Daw.a.a.a#O#O#O.a.aaw.D#U.g.Sbo#5#5#mbS.2.r.r#x#x#x.##u#ua6bz.pbQbQb3bu.d#iaUaUaU#ZaU#Z#Z#ZaU#ZaUaUaU",
+"#i.dbub3au##bQ.K#1bY#kaSa6aS.WaM#NaM#N.#.#.##x#x#x#x#xbAbA.r.rbKbKbKbK.2bK.2bK.2.2.2bK.2bKbK.r.r.r.rbAbA#x#x#x.#.#.#.##N#N#N#N#E#Ebbbb.l.laN#rbG.obLbu#R#i#Z.n.0aHaH#aaE.5bsaA#t#QbtaobK.r.r.r.rbKb8ao#Q#Q#t.Mbs.5.g#U#U.D.Dawawaw.a.a.a#O.a#O.a#O.a#O#O#O#O.a#O#O#O.a#O.a.a.a.a.aawawaw.D.D.D#U#U.gbo#Cbs.M.M#5aYaY#QbSbtao.2b8bK.r.r.r.r.r.r.rbA.r.rbA.r.r.rbA.rbA.r.rbA.r.r.r.r.r.rbKb8bKbKaobKaobS#Q#Q#t.M.MaAbs.5.g#U.Dawaw.a#O#O#O#O#O.aawaw#U#U.S.SaK#5aYbt.2bKbAbA#x#x.#a9#ua6bz#1aq##b3aj.daUaU#Z#Z#Z#ZaU#ZaU#ZaUaUaU#i",
+"aU.d.d.db3aubQ.K#1bY#k#ka6.W.W.WaM.##N.#.#.#.#.##x#xbAbAbAbA.r.r.rbKbKbK.2bK.2.2bK.2bK.2bKbKbKbK.r.rbAbA#x#x#x#x.#.##N.##N#N#N#E#E#Ebbbb.l.l#rbGb5au.3buaU.n.n.0.0aH#aaEaE.qaA#taYbSaobK.r.r.r.r.rb8.2bS#Q#t.Mbs#C.g.g#U.D.Dawawaw.a.a.a.a#O.a#O#O#O#O#O#O#O#O#O#O#O#O.a#O#O.a.a.a.a.aawaw.D.D#U#U#U.g.g#C#C.M.M#taY.c#QbS.2aobKbKbKbK.r.r.r.rbA.r.rbA.r.r.rbA.r.r.r.r.r.rbA.r.r.r.r.r#3bKbKb8.2aobtbSbS#QaY#t.MaA#C.5.g#U.D.Daw.a.a#O#O#O#O.a.a.D.D#U.gboaK#5aY#Q.2bK.rbA#x#x.##u#ub6bz#1aqaub3.d.d#iaUaU#ZaU.I#Z#Z#Z#Z#Z#ZaUaU",
+"aU#i.dbub3auaubQ#1bYbz#k#k.W.W.WaMaM.##N.#.##x#x#x#x#xbAbA.r.r.rbK.rbKbK.2bK.2.2.2.2bK.2bKbKbK.r.r.rbAbAbA#x#x#x.#.#.#.##N#N#N#N.G#Ebbbb.l.laN#rb5al.3bu.daU#Z.n.0aHaH#aaE.5aAaA#t#QbS.2bK.r.r.r.rbKb8btbS#Q#t.Mbsbs.g#U#U.D.Dawaw.a.a.a.a#O.a#O#O.a#O#O#O#O#O#O#O#O#O#O#O#O#O.a#O.a.a.aawawaw.D#U#U#U.gbo#Cbs.M.MaYaY#Q.cbS.2.2b8bK.r.r.r.r.r.r.rbA.r.rbA.r.r.rbA.rbA.rbA.r.r.r.r.r.r.rbKb8bKb8ao.2bSbS#QaY#t#t.Mbs#C.g#U#U.Daw.a.a#O#O#O#O.a.aaw.D#U.S.S#C#5#5.cbtbK.rbA#x#xa9.##ua6am#1aq##b3.d#iaU#Z#Z#Z#Z#Z.I#Z.I#Z#Z#Z#ZaU",
+"aUaU#i.d.db3aubQbQ#1bY#k#ka6#u.WaM#N.#.#.#.#.#.##x#x#xbAbAbA.r.r.rbKbKbKbK.2bK.2bK.2.2.2bKbK.rbK.r.rbAbAbA#x#x#x.#.#.##N.##N#N#N#E#E#Ebb#A.l.l#r#ralbL.3.daU.n.n.0.0aH#a#aaE.qaAa5aYbSbSb8.r.r.r.r.rb8.2ao#QaY.MaAbs.g.g#U#U.Dawawaw.a.a.a.a#O.a#O#O#O#O#O#O#O#O#O#O#O#O#O#O#O#O#O.a.a.a.aawawaw.D#U#U#U.gbo#Cbs.M.MaYaY#QbSbtao.2bKbKbK.r.r.r.r.r.r.r.r.rbA.rbA.r.r.rbA.r.rbA.r.r.r.rbK.r.rb8.2bKaobtbSbS#QaY.M.Mbsbs.g#U#U.Daw.a.a#O#O#O#O.a.aaw.D#U.g.SbmaKaY.cbSbK.rbA#x#xa9a9#ua6b6aqbQ##b3.d#i#iaU#Z#Z#Z.I#Z.I#Z.I#Z#ZaU#Z",
+"aUaU.d#i.db3au##bQ#1bY#k#ka6.W.WaMaMaM.#.#.##x.##x#x#xbAbAbAbA.r.rbK.r.2bK.2bK.2.2bK.2bK.2bKbK.r.r.rbAbAbA#x#x#x#x.#.#.##N.##N#N#E#E#EbbaS#A.l#r#rb5bL.3bu#R#i#Z.n.0aHaH#aaE.5bsaA#t#QbS.2bK.r.r.r.r.rbKaobS#QaY.Mbsbs.g#U#U.D.Dawawaw.a.a#O.a#O#O#O#O#O#O#O#O.z#O.z#O#O#O#O#O#O#O#O#O.a.a.aawaw.D.D.D#U.g.g#C#CaK.M#5aY#Q.cbSbt.2b8bKbK.r.r.r.rbA.rbA.r.r.rbA.r.rbA.r.rbA.r.r.r.r.r.r#3bKbKbKb8b8btaobS#Q#Q#Q#t.M.Mbs.5.g#U.D.Daw.a#O#O#O#O#O.aaw.D.D.g.SboaK#5.cbt.2.rbAbA#x#xa9#ubHbz.p####aj.d#i#Z#Z#Z.I#Z.IaC.IaC.I#Z.I#Z#Z",
+"#ZaUaU#i.db3b3aubQ.K#1bz#ka6a6.W.WaM#N.#.#.#.##x#x#x#x#xbAbA.r.r.r.rbK.r.2bKbKbKbK.2bK.2bKbKbK.rbK.r.rbAbA#x#x#x#x.#.#.#.##N#N#N#N#E#E#Ebb.l.laW#rbGalaubu.d#i#Z.n.0.0aH#a#aaE.qaA#t#t#Qaob8bK.rbA.r.rb8.2btbSaY#t.Mbs.5.g#U#U.Dawawaw.a.a.a#O#O#O#O#O#O#O.z#O.z#O#O.z#O.z.z#O#O#O#O#O#O.a.a.aawaw.D.D#U#U.g.g#C#C.M.M#5aYaY#Qbtao.2bKbKbKbK.r.r.r.r.r.rbA.r.rbA.r.rbA.r.r.rbA.r.r.r.r.r.r#3bKbKb8.2aobtbS#Q#taY#taAbs#C.g#U.D.D.a.a.a#O#O#O#O.aawaw#U#U.S#CaK#5aYbS.2bK.r#x#x#xa9#ub6b6aqaqbEb3#i#iaU#Z#Z.I#Z.8#Z.8.I.8#Z.I#Z#Z",
+"#Z#ZaU#i.d.db3au###1#1bYbz#ka6.W#uaMaMaM.#.#.#.##x#x#x#xbAbAbA.r.rbKbKbKbK.2bK.2.2bK.2bKbKbKbKbK.r.r.rbAbA#x#x#x#x.#.#.#.##N.##N#N#E#E#EaSbb.l.laW#rb5bL.3buaUaU.n#Z.0aHaH#aaEaE.qaA#t#QbS.2b8.r.r.r.r.rbKaobS#QaY.M.M#C.g.g#U.D.Dawaw.a.a.a#O.a#O#O#O#O.z#O#O.z#O.z#O.z#O.z#O.z#O#O#O#O#O.a.a.a.aaw.D.D#U#U.g.g#Cbs.M#5aYaY.c#Qbtao.2bK.rbK.r.r.r.r.rbA.r.r.r.r.r.r.r.rbA.r.r.r.r.r.rbK.rbKbKb8.2b8btaobS#Q#QaY.M.Mbsbs.g.g#U.Daw.a#O#O#O#O#O.a.aaw.D#U.g.SaK#5#m.c.2.r.rbA#x#xa9a9b6b6aqaqb3aj#iaU#Z#Z#Z.IaC.I.8.IaC.I.8#Z.I#Z",
+"#Z#Z#ZaU#i.dajb3##bQ#1#1bza6a6#u.WaMaM.#.#.#.#.##x#x#x#xbAbAbA.r.r.r.rbKbKbKbK.2bKbK.2bK.2bKbKbK.r.r.rbAbAbA#x#x#x#x.#.#.#.##N#N#N#N#E#EbbbbaS.laW#rbGalbLbu#R#i#Z.n.0.0.0#a#aaE.5aAa5#tbSbSbKbK.r.r.r.rb8bKbtbSaY#t.Mbs#C.g#U#U.D.Dawaw.a.a.a#O#O#O#O#O#O.z.z#O.z.z.z.z.z.z#O.z.z#O.z#O#O#O#O.a.a.aaw.D.D#U.g.gbo#Cbs.M#5aY#Q#QbtbS.2bKbKbKbK.r.r.r.r.r.r.rbA.rbA.rbA.r.r.rbA.r.r.r.r.rbK.rbKbK.2b8.2bSbt#Q#Q#t#5#tbsbs#C#U#U.Dawaw.a#O#O#O#O#O.aaw.D#U.gbobm#5aY#Q.2bKbAbA#x#xa9#ubHb6aqaq##b3#i#i#Z#Z.IaC.I.8.8.8.8.8.I.8aC.I",
+".I#ZaU#ZaU.d.db3au##bQ#1bz#ka6a6.WaMaMaM.#.#.##x.##x#x#xbAbAbA.r.r.rbKbKbKbK.2bK.2bKbKbK.2bKbK.r.r.r.rbAbAbA#x#x#x.##x.#.##N.##N#N#N#E#E.Wbb.l.l.l#rbG.KbL.3buaU#i#Z.0.0aHaH#a#a.5.qaA#t#tbSaobK.r.r.r.r.rbKaobtbSaY.M.Mbsbo.g#U#U.Dawawaw.a.a#O#O#O#O.z#O.z#O.z.z#O.z#O.z.z.z.z.z.z#O.z#O#O#O.a.a.aawaw.D.D#U.g.gbo#CaK.MaYaY.c#Qbt.2aobKbK.rbK.r.r.r.r.r.r.r.r.r.r.rbA.r.r.r.r.r.r.r.r.rb8bKbKb8.2aobtaobS#QaY#t.M.Mbs.5.g#U.D.D.a.a#O#O#O#O#O.aaw.D#U.g.S#C#5#5.cbtbK.rbAbA#xa9a9b6ambM##bE.d#i#Z#Z#Z.I.8.8.I.8.8.8aC.8.I.8#Z",
+".I#Z#Z#ZaU#i.db3b3##aq#1#1bza6a6#u#uaMaM.#.#.#.##x#x#x#x#xbAbAbA.r.r.rbKbKbKbKb8.2bK.2bKbKbKbK.rbK.r.r.rbAbAbA#x#x#x.#.#.#.#.##NaM#N#N#E#E.Wbb.l.laW#rbGalaubu#R#i#Z#Z.0.0aHaH#aaE.qbsa5#t#Qaoaob8.r.r.r.r.rbK.2bS#QaY.Mbs#C.g.g#U.D.Daw.a.a.a.a#O#O#O#O.z#O.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z#O#O#O.a.aawaw.D.D#U.g.Sbobs.M#5aYaY.cbSbt.2.2bKbKbK.r.r.r.rbA.r.rbA.rbA.r.r.r.rbA.r.r.r.rbK.r.r.rbKbKbKb8.2bS.c#QaYaY#t.Mbs#C.g.g.D.Daw.a#O#O#O#O#O.a.a.D.D.g.S#CaK#5#Qbt.2.rbAbA#x#x#ubHamaqaqb3a4#i#i#Z.8#Z.8.8.8.8.8.8.8.8aC.8.I",
+".8#Z.I#ZaU#i#iajb3aubQaqbYbzbza6.WaMaMaM.#.#.##x.##x#x#xbAbAbAbA.r.rbKbKbKbKbKbK.2bKbK.2bKbKbKbK.r.r.rbAbAbA#x#x#x#x#x.#.#.##N.##N#N#N#E#E#EaSaS.l.l#rbGalau.3.daU#i#Z.n.0.0aH#a#aaE.qaA#t#tbS.2b8.r.r.r.r.rb8bKao.c#QaY.Mbs#C.g#U#U.Dawawaw.a#O#O#O#O#O.z#O.z#O.z.z.z.z.z.z.z.z.z.z.z.z#O.z#O#O#O#O.a.aawaw.D#U#U.gbo#Cbs#5#5aYaY.cbtbt.2bKbK.rbK.r.r.r.r.r.r.r.r.rbA.rbA.r.r.r.r.r.r.r.rbK#3bKbKao.2aobtbSbS#QaY.M.M.M#C.5.g#U.Daw.a.a#O.z#O#O.a.aaw#U#U.SboaK#5#mbtbK.r.r#xbAa9bZbHambM##bEaj#i#Z#Z.I.8.8.8.8.8.8.8.8.8.8.8.I",
+".8.8aC#Z#ZaU#i.db3b3##aq#1bzbza6a6#u#uaMaM.##x.#.##x#x#x#xbAbAbA.r.r.r.rbKbKbKbKbKbKbKbK.2bKbK.rbK.r.r.rbAbAbA#x#x#x#x.#.#.#.#.##NaM#N#E.W#E#EaS.l.laW#ralal.3bu.daU.n#ZaC.0awaH#a#a.5.qaA#t.AbS.2b8.r.rbA.r.rbK.2bS#QaY.M.Mbsbo.g#U#U.Dawaw.a.a.a#O.z#O#O.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z.z#O#O#O.a.aaw.D.D#U.g.gbo#CaK.MaY#m#QbSbtao.2bKbKbKbK.r.r.r.r.rbA.rbA.r.r.r.rbA.rbA.r.r.r.r.rbKb8bK.2bKbtaobt#Q#QaYaY.M.Mbs.g.g#U.Daw.a#O#O#O#O#O#O.aaw.D#U.gboaK#5aYbS.2bKbAbA#xbZa9b6amaqbVaj#i#i#Z.IaC.8.8.8.8.8.z.8.8.8.8.8.8",
+".8.I.I#Z#Z#Z#i#iajb3##bQaq.pbzb6a6#uaMa9aM.#.##x.##x#x#x#xbAbAbA.r.r.rbKbKbKbK.2b8.2bKbKbKbKbKbK.r.r.r.rbAbAbAbA#x#x#x.#.#.#.##N.##N#N#N#E#EaSbbaS.laWaWbGalau.3bTaUaU#Z.n.0.0aH#a#aaE.qaAa5#tbSaoao.r.r.r.r.rbKbK.2bS#QaY.Mbs#C.g.g#U.Dawaw.a.a.a#O#O#O.z.z.z.z.z.z.z.z#9.z.z#9.z.z#9.z.z.z.z.z.z#O#O.a.a.aaw.D.D#U.g.gbobs#5#5aYaY.cbtbt.2bKbKbK.rbK.r.r.r.r.r.r.r.rbA.r.r.r.r.r.r.r.r.rbK.rbKbKb8.2aobtbSbS#QaYaY.M.Mbs#C.g#U.Dawaw.a#O#O.z#O#O.aaw.D#U.S.SaK#5aY.c.2bK.rbA#xbAa9.NambM##.C#i#i#Z#Z.8.8.8.8.zaG.8#9.zaG.z.8.8",
+".8.8.8.8#Z#ZaU#i.daj####aq#1bzb6a6#u.Wa9aM.#.##x.##x#x#x#x#xbAbAbA.r.r.r.rbKbKbKbKbKbKbKbKbKbKbKbK.r.rbA.rbAbAbA#x#x.##x#x.#.#.##N#NaM#NaM#E#EaSaSaSaWaW#r.KbL.3bu.daU.n#ZaC.0.0aH#a#aaE.qaA#t.AbSaobK#3.r.r.r.rbKb8bt.c#Q#5.Mbsbo.g#U.D#Uawaw.a.a#O#O#O.z#O.z.z.z.z.z#9.z.z#9.z#9.z#9.z#9.z.z.z.z.z#O#O.a.aawaw.D.D.g.gbo#CaK.M#5#m#Q.cbS.2.2bKbKbKbK.r.r.r.r.r.rbA.r.r.rbA.r.r.r.r.r.r.rbK.rbK.r.2aobKbtao.c#Q#QaY.M.Mbs#C.g#U#U.Daw.a#O.z#O#O#O.aaw.D#U.g.SaKaKaY.c.2bK.rbAbAbZbZbHamaqbVaj#i.n#Z#Z.8.8.8.8aG.z.z.zaG.z.8.z.8",
+".8.8.8.I#Z.I#Z#i#i.db3##bQ#1.pbza6#u#uaMa9aM.#.##x#x#x#x#xbAbAbA.r.r.r.rbKbKbKbKbKbK.2b8bKbKbK.rbK.r.r.rbAbAbA#xbA#x#x#x.#.#.#.#.##N.##N#E#E.W#EaSaS.laWaWbGalau.3.daUaU#Z.n.0.0aHaH#aaE.q.qa5#t#QaoaobK.r.rbA.r.rbKbtbS#QaY#5.M#C.g.g#U.D.Daw.a.a#O#O#O.z.z.z.z.z#9.z.z#9#9.z#9.z#9.z#9.z#9.z.z.z.z.z#O#O.a.aaw.D.D#U.g.g.Sbs#5#5aYaY.cbtbt.2.2bKbK.rbK.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbK.rbK.rbKbKbKbtaobtbSbS#QaYaY.M.M#C.g.g.D.Daw.a#O#O.z#O#O#Oawaw#U#U.Sbo#5#5.cbtbK.rbAbA#xbZbHam.4bE.C#i#i#Z.8.8.8#9.z#9.8#9aG.z#9.8#9.8",
+".z.8.8.8.8#Z#ZaU#i.daj####aq.p.pb6a6#u#uaMa9.##x.#.##x#x#x#xbAbAbAbA.rbK.r.rbKb8bKbKbKbKbKbKbKbKbK.r.r.r.rbAbAbA#x#x#x#x#x.#.#.#.#.##NaM#NaM#E.WbbaS.laWaWbG.Kal.3bu#R#i#Z#ZaC.0.aaH#a#aaE.qaAa5.A#Qaob8#3.r.r.rbK.rb8.2btaYaY.Mbs#C.g.g#U.Dawaw.a.a#O.z#O.z.z.z.z#9.z#9.z#9.z#9#9.z#9#9#9.z#9#9.z.z.z.z.z#O.a.aaw.D#U#U.g.S#CaK.M#5aYaY.cbS.2.2bKbKbK.rbK.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbKbKb8.2bKaobtbS.c#QaYaY.M.Mbs.g.g#U.Daw.a#O#O#O.z#O#Oawaw.D.g.S#CaK#5#Qbt.2.rbAbAbAbZ.NamaqbVaj#i#Z#ZaC.8.8aG.zaG#9.z#9.z#9.zaG.z",
+"#9.8.z.8.8#ZaC#Z#i#iajb3##aq#1.pb6a6#u#uaMa9.#.##x#x#x#x#xbA#xbAbA.r.r.r.rbKbKbKbKbKbKbKbKbKbK.rbK.r.r.r.rbAbAbAbA#x#x#x.##x.#.#.##N#N#NaM#N#E.W.WaSaS.laWaWbGalau.3.daU#Z.n#Z.0.0.0aH#aaEaE.qaA#t.AbSaobK.r.r.r.r.rbK.2ao.caY#5.M#Cbo.g#U#U.Daw.a.a#O#O.z.z.z.z.z#9.z#9#9.z#9#9#9#9#9.z#9#9#9.z#9.z.z.z#O#O#O.a.aaw.D#U#U.gbo#CaK#5aY#m.c.cbt.2.2bKbKbK.r.r.r.r.r.r.r.r.rbA.r.r.r.r.r.rbK.rbK.rbKbKbKao.2btbS.c#QaYaY.M.M#C#C#U#U.Dawaw#O#O.z#O#O#O.aaw#U#U.SboaKaY#mbtbKbKbAbAbAbZ.Nas.4bEa4a4#ZaC.8.8.z#9.z#9.z#9#9#9.z#9.zaG",
+".8#9.8.8.8.8.I#Z#Z#ia4b3####aq.pbzb6#u#ua9aM#x.#.##x.##x#x#xbAbAbAbA.r.r.rbK.rbKbKb8bKbKbKbKbKbK.rbK.r.rbA.rbAbAbA#x#x#x#x.#.#.#.#.#.#aM#N#NaM#E#EaSaS.laWaWbG.Kal.3bu.daU#Z#ZaC.0.0awaH#aaE.qaAa5#tbSbSb8bK#3.r.r.rbKbKbtbt#QaY#5aK#C.g.g.D.Daw.a.a#O#O#O.z.z#9.z#9.z#9.z#9#9#9.z#9#9#9#9#9#9#9#9#9#9.z.z.z#O.a.aaw.D.D#U.g.S#CaK#5#5aY.c#Qbt.2.2bKbKbKbK.rbK.r.r.r.r.r.r.r.r.r.r.rbK.r.rbK.rbKb8bKbKbKbtaobtbS#Q#QaY#5.Mbs#C.g#U#Uaw.a.a#O#O.z#O#O.aaw.D#U.gboaK#5aYbt.2bK.rbAbAbZ.NasaqbVa4#i#Z#Z.8aG.8#9aG#9#9#9#9.z#9#9#9#9",
+"#9.zaG.z.8.8#Z#Z#Z#i#iajbE##aqbM.pb6a6#u#ua9.#a9#x.##x#x#x#xbAbAbA.r.r.r.rbK#3bKbKbKbKbKbKbKbKbKbK.r.r.r.rbAbAbA#xbA#x#x#x#x.#.#.#.##N#N.##N#E.W.W.WaSaS#kaWbGbGalaubu.daUaU#ZaCaC.0.0aH#a#aaE.qaAa5.AbSaob8.r.r.r.r.rbKb8btbSaYaY.M#Cbo.g#U.D.Daw.a.a#O#O.z.z.z#9.z#9#9#9#9.z#9#9#9#9#9#9#9#9.z#9.z#9.z.z.z.z#O.a.aaw.D#U#U.Sbo#C.M#5#5aY.cbtbt.2.2bKbKbKbK.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.rbK.rbKbKbKao.2btbSbt#QaYaY#t.Mbs#C.g.g.D.Daw.a#O.z#O.z#O.aaw.D#U.g.SaK#5#m.c.2.r.rbAbAbZ.NambwbEa4a4#ZaC.8.z#9#9.z#9#9#9#9#9#9.z#9.z",
+"#9#9#9#9.8.8.8.8#Z#Z#ia4b3bEaqaq.pb6b6#u#ua9a9.#.##x#x#x#xbA#xbAbAbAbA.r.r.rbK.rbKbKbKbKb8bKbKbK.rbK.r.r.r.rbAbAbA#x#x#x#x.##x.#.#.#.#.#aM#NaM#N.W#E.WaS.l#kaWbG.Kau.3bu#iaU.n#Z#Z.0.0aHaw#aaE.5.qa5#t.Aaoaob8.r.r.r.r.rbKbtbt#QaY#5aK#C.g.g#U.Daw.a.a#O#O.z.z.z.z#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9.z.z#O#O.aawaw.D#U#U.SboaK#5#5#maY#mbt.2.2bKbKbK.rbK.rbK.r.r.r.r.r.r.r.r.r.r.rbK.r.rbK.rbKbK.2ao.2btbS.c#Q#Q#5#5.Mbs.g.g#U.Daw#O#O#O.z.z#O.a.a.D#U.g.Sbo#5aY.c.2bK.r.rbA#3.NasbwbVa4.n#Z.8.zaG#9#9#9#9#9#9.z#9#9#9#9#9",
+"#9.z#9.8#9.8.8.8#Z#Z#i#iajbE##aq.pamb6bH#u#ua9a9#x.##x#x#x#x#xbAbAbA.r.r.r.rbK.rbKb8bKbKbKbKbK.rbK.rbK.r.rbA.rbAbAbA#x#x#x#x.##x.#.#.##N.##NaM#EaM.WaSaSaS#kaWbYbGalaububuaU#Z#ZaCaC.0.0aHaH#aaE.qaAa5#tbSaobKb8.r.r.r.rbKbKbt.caYaY.M#Cbo.g#U.Dawaw#O#O#O.z.z#9#9#9.z#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9.z#9.z.z#O#O.aaw.D#U.g.gbo#CaK#5aY#m.cbtbt.2.2bKbKbKbK.r.r.rbK.r.r.r.r.r.r.r.r.r.rbK.rbKbKbKbKbK.2.2ao.cbS.caYaY.MaKbsbo.g#U.Daw.a#O#O.z#O#O#O.a.D.D.g.Sbm#5#5btbtbK.r.rbA#3.NasbV.Ca4.n#Z.8.8#9.z#9#9#9#9#9#9#9#9#9#9#9",
+"#9#9#9#9.8#9.8.8.8#Z.n#iajajbEaqbM.pb6b6#u#u.#a9.##x#x#x#x#xbAbAbAbAbA.r.r.rbK.rbK.rbKbKbKbK.rbKbK.r.r.r.r.rbAbAbAbA#x#x#x#x#x.#.#.#.#.#.##NaM#N.W#E.W.WaS#kaWaW.K.Kau.3.d.daU#Z#ZaCaC.0.aaH#a#aaE.qaA#t.AbSaob8.r.r.r.rbKbK.2bt#maY#5aKbo.g#U#Uawaw.a#O#O.z.z#9.z#9#9#9#9#9#9#9#9#9#9#9#9#9#9.k#9.k#9#9#9#9.z.z.z#O.aawaw.D#U.g.S#CaK#5#5aYaY.cbtbt.2.2bKbKbK.rbKbK.r.rbK.r.r.r.r.r.r.rbK.r.rbK.rbKbK.2bK.2btbt.c#QaYaY.M.Mbsbo.g#U.Daw.a#O#O.z.z.z.a.aaw#U.g.Sbo.M#5.c.2.2.r.rbA#3.Nas.4.Ca4.naC.8.z#9#9#9#9#9#9#9#9#9#9#9#9#9",
+"#9#9#9#9#9.z.8.8.8#Z#Z.n#iajbE##aqbMamb6bHa9a9a9a9.##x#x#x#x#xbAbAbA.r.r.r.r.rbKbKbK.rb8.rbKbK.r.rbK.r.r.r.rbAbAbAbA#x#x#x#x.##x.#.#.#.##N.#aM#NaM.W.W.WaSaSaWaWbG.Kalau.3.daUaU#ZaC.0aC.0aHaw#aaE.q.qa5#tbCaoaobK.r.r.rbKbKbKbSbtaY#5.M#Cbo.g#U.Daw.a.a#O.z.z.z#9#9#9#9#9#9#9#9#9.k#9.k#9.k#9#9.k#9#9.k#9#9#9.z.z#O#O.aaw.D.D.g.g.S#CaK#5#m#m.c.cbt.2.2bKbKbKbK.r.r.r.r.r.rbK.rbK.rbK.r.rbKbK.rbKbKbKb8.2ao.2ao.cbSaYaY#5.Mbs#C.g#U.Daw.a.a.z#O.z#O#O.aaw.D#U.SboaK#5.cbt.2.r.r.r.r.Nasbw.Ca4.n.I.8#9#9#9.k#9.k#9#9#9#9#9#9#9#9",
+"#9#9#9#9#9#9#9.8.8.8#Z#i#ia4bEbVaqbM.pambH#ua9a9.##x#x#x#x#xbA#xbAbAbAbA.r.r.r.rb8.rbKbK.rbKb8bK.rbK.r.r.r.r.rbAbAbAbAbA#x#x#x.##x.#.#.#.##NaMaM#NaM#E.WaSaS#k#kaW.K.Kau.3.d.d#Z#Z#ZaCaC.a.0aH#a#aaE.qaA#t.AbSaob8b8.r.r.rbKbKbtbt#maY#5aKbo.g#U.Dawaw#O#O.z.z#9#9#9#9#9#9#9.k#9.k#9#9#9.k#9.k#9.k#9.k#9#9#9#9#9.z.z#O.a.aaw#U#U.g.S#CaK#5#5aYaY.cbt.2.2.2bKbKbKbKbKbK.rbK.r.r.r.r.r.r.rbK.rbK.rbKbKbKbKbK.2btbtbt.c#QaYaY#5bs#C.g.g.D.Daw#O#O.z.z.z#O.aaw.D#U.SboaKaY#mbtbKbK.r.r#3bOasbV.Caz.n.8.8#9#9#9#9#9#9.k#9.k#9#9#9#9#9",
+"#9#9#9#9#9#9#9.z.8.8aC#Z#ia4ajbEbVaqamamb6bH#ua9a9#x.##x#x#x#xbAbAbAbA.r.r.r.rbK.rbK.rbKbKbK.rbK.rbK.r.r.r.rbA.rbA#xbA#x#x#x#x#x.##x.#.#.#.#.##NaMaM.W.W.WaS#k#kaWbY.Kalb3bu.daUaU#ZaCaC.0.0.aaH#a#a#2.qa5#t.AaoaobK.rbK.rbKbK.2bt.caY#5aK#C.S#U#Uawaw.a#O.z.z#9#9#9#9.k#9.k#9#9.k#9.k#9#9.k#9.k#9.k#9.k.k#9#9#9#9.z.z#O.aaw.D#U.g.g.SaKaK#5#m#m.cbtbt.2.2bKbKbK.rbK.r.rbK.rbK.rbK.rbK.r.rbK.rbKbKbKbKbK.2.2aobtbS.c#QaYaY.MaK#C.g.g#Uawaw#O#O.z#O.z#O#Oaw.D#U.g.SaK#5#mbt.2bK.r.r#3bOb1bV#sa4aC.8.z#9#9.k#9.k#9.kaG#9.k#9#9.k#9",
+"#9.k#9#9#9#9#9aG#9.8.8#Z#Z#ia4.C##aqbMamambHbHa9a9#x#x#x#x#xbA#xbAbA.rbA.r.r.r.rbK.rbKbKbK.rbK.rbK.r.r.r.r.r.rbAbAbAbAbA#x#x.##x#x.#.##x.##N.#aMaM#NaM.W.W.WaS#kaWbY.K.Kau.3.d.d#Z#Z#ZaCaC.0.0awaH#aaE.qaAa5.A.Aaob8b8.r.r.rbKbKbtbt.c#5#5#C.S.g#U.D.a.a#O#O.z#9#9#9#9#9.k#9.k#9.k#9#9.k#9.k#9.k#9.k.k#9.k#9.k#9#9#9.z#O.a.aaw.D#U.S.S#CaK#5#5aY#m.cbtbt.2.2bKbKbKbKbK.rbK.r.r.r.r.r.rbK.rbK.rbK.rbKbK.2bK.2btbtbt.c.caYaY#5.Mbsbo#U#U.Daw.a#O.z.z.z#O#O.a.D#U.S.SaK#5aY.c.2bK.r.r#3bOb1bw#saz#ZaC#9#9#9#9.k.kaG.kaG.kaGaG.kaG#9",
+"#9#9.k#9#9#9#9#9.z.8.8aC#Z.na4ajbEbVbM.pambHbHa9a9a9#x#x#xbA#xbAbAbAbAbA.r.r.rbK.rbKb8.rbKb8.rbKbK.rbK.r.r.r.rbAbAbAbAbA#x#x#x#x#x.##x.#.#.#.##N.#aM.WaM.WaSa6#k#kaW#1.Kauaubu#RaU#Z#ZaCaCaC.a.0aw#a#aaE.qaA#tbCbSaobKbK.rbK.rbK.2btaY#m.MaK.S.g#U.Daw.a#O.z.z#9#9#9.k.k#9.k#9.k#9.k#9.k#9.k#9.k.k#9.k.k.k.k#9.k#9#9.z.z#O.aaw.D.D.g.SboaKaK#5#m#m.c.cbt.2.2.2bKbKbKbKbK.rbK.rbK.rbKbK.r.rbK.rbKbKbKbKbK.2bKbtaobtbS#Q#maY.M.M#Cbo.g#U.D.a.a#O.z.z.z#O#O.a.D#U.g.SaK#5#mbt.2bKbK.rbKbOas#T#s.naC.8#9#9.k.kaG.k#caG.kaG#c#9aG.kaG",
+"aG.kaG.k#9.k#9#9#9.z.8.8#Z.n#ia4bEbVbVbMambHbHa9bZa9#x#x#x#x#xbA#xbAbAbA.r.r.r.r.rbK.rbKbK.rbKbKbK.r.rbK.r.r.rbA.rbA#xbAbA#x#x#x#x.##x.#.#.#.#.#aM#NaMaM.W.WaSaS#kaWbY.K.Kaub3.daUaU#Z#ZaCaCaC.aaHaH#aaE.q.qa5.A#Qaoaob8bK.rbKbKbtbt.c#m#5aKbo.S#U.Daw.a#O.z.z#9#9.k#9.k#9.k.k.k#9.k#9.k#9.k#9.k#9.k.k.k.k.k.k.k#9#9#9.z#O.a.aaw.D#U.gbobmaK#5#5#m.c.cbtbt.2.2.2bKbK.rbK.rbKbK.rbK.r.rbK.rbK.rbKbKbKbKbKbK.2.2btbt.c.caYaY#5#5bsbo.g#U.Daw.a#O#O.z.z.z.a.aaw.D.g.Sbm#5#m.cbtbKbK.rb8bOb1#T#s.naC.8#9#9#9.k.k#caG.kaG#c#9#caG#c#9",
+"#c#9#c#9.k#9#9#9#9#9.8.8aC#Z#ia4ajbEaq.4bMambHbHbZa9#xbA#xbA#xbAbAbAbA.rbA.r.r.rbK.rbKbK.rbK.rbK#3bKbK.r.r.r.r.rbAbAbAbA#xbA#x#x#x#x.##x.##x.#.#.#aMaMaM.W.W#ua6#k#kbYbY.Kauaubu.daU#Z#ZaCaCaC.0.aaw#a#aaE.qaAa5.AbSaobK.rbK.rbKbKbtbt#m#5.Mbo.S#U#Uaw.a#O#O.z#9#9#9.k.k.k#9.k#9.k#9.k#9.k#9.k.k.k.k#9.k.k.k.k.k#9#9#9.z.z#O.aaw.D#U.g.SboaK#5#5.t#m.cbtbt.2.2bK.2bKbKbKbKbK.rbK.rbK.rbK.rbKbK.rbKbK.2bK.2.2aobtbtbS.c#QaY#5.MaK#C.g#U.Daw.a#O.z.z.z.z#O.a.D.D.g.S#C#5aY.c.2.2bK.rb8.9b1#Ta4.naC.z#9#9.k#c#c.k#caG#caGaG#c#9aG#c",
+"#caG.kaG#c#9.k.k#9#9#9.8.8aC#Za4a4.CbVaqasam.NbHa9bZa9#x#x#x#x#xbAbAbAbAbA.r.r.r.r.rbK.rb8bKbK.rbKbK.r.r.r.r.rbA.rbAbAbAbAbA#x#x#x#x.##x.#.#.#.#.#aMaMaMaM.W.WaSa6#k#kbY.KbQaubu.daU#Z#Z.IaCaC#O.0.0aw#aaE.qaAa5.A.AaoaobK.rbKbK.2.2bt#maYaKaK.S.g#U.Daw#O.z.z#9#9.k#9.k.k.k.k#9.k.k#9.k#9.k#9.k#9.k.k.k.k.k.k.k.k.k#9#9.z#O#Oawaw#U#U.gbobmaK#5#5#m.c.cbtbt.2.2.2bKbKbK.rbK.rbKbK.rbKbK.rbK.rbKbKbKbKbKbKbK.2.2btbt.c#maYaY#5bs#C.S#U#Uaw.a#O.z.z.z.z#O.aaw#U#U.Sbm#5.t.cbtbKbKbKb8.9b1#Taz.0aC#9#9.k#c.k#c#c#c#caG#caG#caG.kaG",
+"aG#caG.k#c.kaG#9.k#9#9.z.8aC#Z.na4.CbE.4bMamam.NbZbZa9bA#xbAbAbA#xbAbA.rbA.r.r.rbK.rbK.rbKbK.rbKbKbK.rbK.r.r.r.rbAbAbAbA#xbA#x#x#x#x#x#x.##x.#.#.#.#aMaMaMaM#u.Wa6#k#kbY#1.Kaub3bu#iaU#Z#ZaCaC#O.0.aaH#a#aaE.qaAa5.AbSaob8bKbKbKbK.2bt#m#m#5aKbo.g#Uawaw#O.z.z#9.k.k.k.k.k.k.k.k.k#9.k#9.k#9.k#9.k.k.k.k.k.k.k.k.k.k.k#9#9.z#O.aaw.D#U.g.SboaK#5.t#m#m.cbtbt.2.2bK.2bKbKbKbKbKbK.rbKbK.rbKbKbK.rbKbKbK.2.2.2.2btao.cbS.caY#5.MaK#C.g.g.Daw.a#O.z.z.z.z#O#Oaw.D.g.SboaKaY#mbt.2bKbKb8.9bwaXaz.n.z#9#9.k.k#c#c#c#c#c#c#caG#caG#caG",
+"#caG#caG#c#9#c.k#9#9#9#9.8.8#Z.n#ia4.CbV.4bMbObHbHbZbZ#xbA#x#x#xbAbAbAbAbA.r.r.r.rbK.rbKbK.rb8bK.rbK.rbK.r.r.r.r.r.rbAbAbAbAbA#x#x#x#x#x#x.#.#.#.#.#aMaMaMaM.W.W.Wa6#kbY#1.KbQaubu.daU#Z.IaC.8aC#O.0.aaw#aaE.qaAa5#t.AaoaobK.rbKbK.2bt.c#m#5aK.S.g#U.D.a.a.z#9#9#9#9.k.k.k.k.k.k.k.k#9.k#9.k#9.k.k.k.k.k.k.k.k.k.k.k.k#9#9.z#O#Oawaw#U.g.SbobmaK#5#5#m.c.cbtbt.2.2.2bKbKbKbKbKbKbKbKbKbK.rbK.rbKbKbKbK.2bK.2bKbtbtbt.c#maYaY#5.M#C.g.g#U.D.a#O.z.z.z.z#O.aaw.D#U.Sbo#5.t#mbt.2bKbKao.9.faXazaC.8#9#9.k#c#c#c#c#c#c#caG#caG#caG#c",
+"aG#caG#c#c#c#c.k#c#9#9#9#9.zaC#Z.na4.C.C.4.4am.N.NbZbZa9bAbAbAbAbAbAbA.r.r.r.r.r.r.rbK.rbKbKbK.rbKbKbK.rbK.r.r.rbAbAbAbAbA#xbA#x#x#x#x.##x#x.#.#.#.#.#aMaMaM#u.Wa6a6#k#kbY#1bQaub3.daUaU#Z.8aCaC#OaC.aaH.D#aaE.qaA#t.AbSaobKbKbKbK.2bt.c#m#5aKbo.S#U.D.a#O#O#9#9.k.k.k.k.k.k.k.k#9.k.k#9.k#9.k.k#9.k.k.k.k#Y.k#Y.k.k.k#9#9#9.z#O.aaw.D#U.g.S#C#z#5.t#m#m.cbtbt.2.2.2bK.2bKbKbKbK.rbK.rbKbKbKbKbK.r.2.r.2bK.2.2.2btbt#Q.caYaY#5aK#Cbo.g.Dawaw#O#O.z#9.z.z#Oaw.D#U.SboaK#5.cbt.2.2bKaobC.faXazaC.z#9.k#c#c#c#c.y#c.y.y#cay#cay#caG",
+"ay#c#c#c#c#caG#c.k.k.k#9#9.8.8aC.na4a4.CbV.4as.N.NbZbZbZbA#xbA#xbAbAbAbAbAbA.r.r.r.r.rbKbK.rbKbK.rb8.rbK.r.r.r.r.r.r.rbAbAbAbAbA#x#x#x#x#x#x.##x.#.#.#.#aMaM.W#u.Wa6a6#kbz#1.KbQb3bu#iaU#Z.IaC.8#OaC.a.aaH#aaE.q.qa5.AbSaoaobKbKbK.2btbt#m.taKbo.S#U.Daw#O.z#9#9.k.k.k.k.k.k.k.k.k.k#9.k.k#9.k#9.k.k.k.k.k.k.k#Y.k#Y.k.k#9#9.z#O.aaw.D#U.g.SboaK#z#5#m#m.c.cbtbt.2.2bK.2bKbKbKbKbKbKbKbKbKbK.rbKbKbKbKbK.2bK.2btbtbt.c.c.c#5#5#5#C.S.g#U.D.a#O.z.z.z.z.z.a.a.D#U.SboaK.t#m.c.2.2.2aobC.f.L.naC.z#9.k#caI#caI.y#c.y#c.y.yaG.yaG.y",
+"#cay#cay#c#c#c#c#c.k#9.k#9#9.8aC#Zaza4#TbVbVbMas.N.NbZbZbAbA#xbAbAbAbAbA.r.r.r.r.rbKbK.rbKbK.rbKbK.rbK.rbK.r.r.r.rbAbAbAbAbA#xbA#x#x#x#x#x.##x.##x.#a9.#aMa9aM.W#ua6a6#kbz#1.KbQaub3.daU#Z#Z.8aCaC#O.a.0awaHaEaE.qaA#t.AbSaobK.2.2.2.2.c#m#5#5bm.S#U.D.a.a.z#9#9.k.k#Y.k#Y.k.k.k.k#9.k#9.k#9.k#9.k#9.k.k#Y.k#Y.k#Y.k.k.k.k#9#9.z#O.a.D.D.g.g.SbmaK#5.t#m.c.cbtbt.2.2.2.2bK.2bKbKbKbKbKbK.rbKbKbKbK.2bK.2bK.2.2.2btbtbS.caYaY#5.M#Cbo.g#U.D.a.a.z.z#9.z.z#Oaw.D#U.g.S#z#5.cbtbt.2bKaobC#l.L.n#O#9#9#c#caI.y#8.y.y.y.yaG.yay#cayaG",
+"ay.yay#c.y#c#c#c.k#c#c.k#9#9.z.8aC.na4a4.Cbw.4asbO.NbZbZbZbAbAbAbAbAbAbA.rbA.r.r.r.r.rbK.rbKbKbK.rbKbKbK.rbK.r.r.r.r.rbAbAbAbAbAbA#x#x#x#x#x#x.##x.#.#a9.#aMaM#u.W#ua6#kbzbY#1bQaub3.daU#Z#ZaC.8.8#OaC.aawaw.DaE.qaAa5.AbSaoaobKbK.2btbt.c.t#z#C.S#U.Daw#O.z#9.k.k.k.k#Y.k.k.k.k.k.k.k#9.k#9.k#9.k.k.k.k.k.k.k#Y.k#Y#Y#Y.k#9#9.z#O.aaw.D#U.g.S#CaK#z.t#m#m.c.cbtbt.2.2bK.2bKbKbKbKbKbKbKbKbKbKbKbKbKbKbK.2.2.2.2.2bt.c.c#maY#5#5#Cbo.g#U.D.a.a.z.z#9.z#O#O.aaw#U.SboaK#5#m.cbt.2.2bSb1.f.L.0aC#9.k#c#caIaI.y#8.y.y.y.y.yay.yay.y",
+".y#c.y.y#c.y#c#c#c#c.k.k.k#9#9.8aC#Z.na4#sbVbwasambO#3bZbZbAbAbAbAbAbA.rbA.r.r.r.rbKbK.rbKbKbKbKbKbK.rbKbK.r.rbK.rbA.rbA.rbAbA#xbA#x#x#x#x#x#x#x.##x.#.#aMa9aMaM#u.Wa6a6bzbz#1aqbQb3bu.daU#Z.I.8aC.z#O#O.0aw#aaEaE.qaA#t#QbS.2.2.2.2.2bt#m#maKbm.S#U.D.a#O.z#9#9.k#Y#Y.k#Y.k.k.k.k#9.k#9.k#9.k#9.k#9.k.k.k#Y.k#Y.k#Y.k.k.k.k#9.z.z#Oawaw#U.g.S.SaKaK#5.t#m.c.cbtbtbt.2.2.2bK.2bKbKbKbKbKbKbKbK.2bK.2bK.2bK.2.2.2btbtbt.c#Q#m#5#5aKbo.g#U.Daw#O#O.z#9.z.z#O.a.D#U.g.SaK.t#m.cbt.2btaoa.#laz.0.z#9.k#caI#8.y#8.y.y.y.y.yay.yay.yay",
+"ayayay.y.y#c.y.y#c#c#c#c.k.k#9.z.8aC.naz#s#TbV.4asbO.N#3bZbAbAbAbAbAbAbA.rbA.r.r.r.r.rbK.rbK.rbK.rbKbK.rbK.rbK.r.r.rbA.rbAbAbAbAbAbAbA#x#x#x#x#x.##x.#a9.#a9aMa9aM#u#ua6b6bz#1#1bQb3b3.d#Z#Z#Z.8.8#OaC#O.a.a.D#aaE.qa5#t.AbSbSbKbK.2btbt#m.t#z#C.S#U.D.a#O.z#9.k.k#Y.k#Y.k#Y.k.k#9.k#9.k#9#9.k#9#9.k.k.k.k.k#Y.k#Y#Y#Y#Y#Y.k.k#9.z#O.aaw.D#U.S.Sbm#z#5.t#m#m.c.cbtbt.2.2.2.2.2.2bK.2bKbKbKbK.2.r.2.r.2bKbK.2.2btbtbt.c.c#maY#5#5bsbo.S#U.D.a.a.z#9.z#9.z#O.aaw#U.gbobm#5#m.cbt.2btbSa.aX.L.0.z#9#caI#8#8#8#8#8#d.y#day.yay.yay.y",
+".y.y.yay.y.y.y.yaI.y#c#c.k#9#9#9.zaCaC.na4#s#TbwasbObO#3#3bZbAbAbA.rbA.r.r.r.r.r.rbKbK.rbKbKbKbKbKbKbKbK.rbK.r.r.r.r.r.rbA.rbAbAbA#xbA#x#x#x#x#x#x#x#x.##x.#a9aM#u#u#ua6a6bz.p#1bQ##b3.daU#Z#Z.8.8.8#O#O.a.0aw#aaE.5aAa5.AbSao.2.2.2btbt#m#m#zbm.S#U.D.a#O#9#9.k#Y#Y#Y.k#Y.k.k.k.k.k#9#9.k#9#9.k#9.k#9.k.k.k.k#Y.k#Y#Y.k#Y.k.k#9#9#O#Oaw.D#U.g.SboaK#z.t#m#m.c.cbtbtbt.2.2bK.2bK.2bKbK.2bKbKbK.2bK.2bK.2.2bK.2.2btbtbt.c.caY#5#5aKbo.g#U.Daw.a.z.z#9.z.z#O.aaw#U.g.SaK#5.t.cbtbtbtbCa5#laHaC.z.k#c#c#8#8#8#d#d.y#d.y#day.yayay.y",
+"ayayay.y.y.y.y#8.y#caI#c#c#c.k#9#9.8aC.naz#s#Tbw.4asbO.N#3#3.r.rbAbAbAbA.rbA.r.r.r.r.rbKbK.rbKbKbKbK.rbKbK.rbKbK.r.r.r.r.rbAbAbAbAbAbAbA#x#x#x#x#x#x.##xa9.#a9.##uaM#ua6a6bz.p#1aq##b3.d#i#Z#Z.8aC.8.z#O#O.aaw.DaEaEaAa5#t#QbSao.2.2.2.c.c.t#z#C.S#U.D.a.z.z.k.k#Y.k#Y#Y#Y.k#Y.k.k#9.k#9#9.k#9#9#9#9.k.k.k.k#Y.k#Y#Y#Y#Y#Y#Y.k#9#9.z#O.a.D.D.g.S..aK#z#5.t#m#m.c.cbtbt.2.2.2.2.2.2bK.2bKbK.2bKbK.2bKbKbK.2.2.2btbtbtbt.c#m#m.t.MaKbo.S#U.Daw#O.z.z#9#9.z#O.aaw#U.g.Sbm#5#m.cbt.2btbS#l#2az#O.z#caI#8#8#8#d#d#8#d#d#day#da1ay#day",
+"#day#day#d.y.y.y#8.y#8#caI.k#c#9#9.zaCaC.na4#s#Tbwas.9.N#3#3bAbA.rbA.rbA.r.r.r.r.rbKbKbKbKbKbK.rbKbKbKbKbKbK.r.rbK.r.r.rbA.rbAbAbAbAbA#xbA#x#x#x#x#x#x#x.#a9.#a9a9#u#u#ub6b6bz#1aqbQb3aj#iaU#Z.8.8.z#O.z#O.a.aaH.DaE.qaA#t.AbSbt.2btbt.c#m.t#5bm.S#Uaw.a.z#9.k.k#Y#Y#Y.k#Y.k.k.k.k.k#9.k#9#9#9.k#9.k#9.k.k.k.k#Y#Y.k#Y#Y#Y.k#Y.k#9.z#O.aaw.D#U.g.SbmaK.t.t.t.c.c.cbtbtbt.2.2.2.2bK.2bK.2.2.2bK.2bK.2.2.2bK.2.2.2btbt.c.c.caYaY#5aK#C.g.g.Daw#O#O#9#9.z.z.z.aaw.D.g.SaK#z#m#mbtbtbS.Aa5.LaH.z#9.k#c#8#8afaf#d#d#d#da1#da1aya1aya1",
+"a1aya1ay#d.y#d.y#8.y#8.yaI#c.k.k#9#9.8aC.naz#s#Tbwb1asbOb8#3#3.r.rbA.r.rbA.r.r.r.r.r.rbK.rbKbKbKbKbKbKbK.rbKbKbK.rbK.r.r.r.r.r.rbAbAbAbA#xbA#x#x#x#x#x#x#x#xa9aMa9aM#u#ua6b6.p.paqbQ##b3.d#Z#ZaC.8.8.8#O#O#O.a.D#aaE.5aA#taYbSaobt.2btbt#m.t#zbo.S#Uaw.a.z#9.k#Y#Y#Y#Y#Y#Y#Y.k.k#9.k#9#9#9#9#9#9#9#9#9.k.k.k#Y.k#Y#Y#Y#Y#Y#Y#Y.k#9#9.z#Oaw.D#U.g.Sbmbm#z.t.t#m#m.cbtbtbtbt.2.2.2.2.2.2bK.2bK.2bK.2bKbK.2.2.2.2.2btbtbt.c.c#m#5#5aKbo.S#U.Daw#O.z.z#9#9.z.z.aaw.D.g.Sbm#5#m#m.cbt.c.A#l.L.0.z#9#c#8#8af#daf#d#d#d#d#da1a1#da1#day",
+"a1#da1.ya1#d.y#d.y#8#8#8#c#8#c.k#9#9.z.8.0.n.L#s.fbwb1.9bO#3#3.r.r.rbA.r.r.r.r.rbKbKbKbKbKbKbKbKbKbKbKbKbKbK.rbK.r.r.r.r.r.rbA.rbAbAbAbAbAbA#x#x#x#x#x#x.##xa9a9a9a9#u#u#ub6b6.p#1aq##aj.daU#Z.I.8.z.z.z#O#O.aaw.DaE.5aAa5#tbSbtbtbtbt.c#m.t#zbm.g#Uaw.a.z.k.k#Y#Y#Y#Y#Y.k.k.k.k.k#9#9#9#9#9#9#9#9.k#9.k#9.k.k#Y.k#Y#Y#Y#Y#Y#Y.k.k#9.z#O.aaw#U.g.SbobmaK#5.t#m#m.c.cbtbtbt.2.2.2.2.2.2.2.2bK.2bK.2.2bK.2.2.2.2bt.2bt.c.c.c#maY#5aK#C.S.g.Daw#O.z.z#9#9.z.z.aaw#U.g.Sbm#5.t.c.cbt#Q#t.q.L.a.8.k.y#8#8afaf#V#d#V#da1#da1a1aya1a1a1",
+"a1aya1#da1#d#d.y#d#d.y#8#8.yaI#c.k#9#9.zaC.naz#s#T#Tb1asbObOb8#3.r.r.rbA.r.r.r.r.r.r.rbK.rbKbKbKbKbKbKbKbKbKbKbK.rbKbK.r.r.r.r.r.rbAbAbAbA#xbAbA#x#x#x#x#x#xa9.#a9a9a9#u#ub6b6.paqbQ##b3#i#i#Z.8.8.8.z.z.z#O.a.a.D#a.5.q#t#t#QbSbtbtbt.c#m.t#z.S.S#Uaw#O.z.k.k#Y#Y#Y#Y#Y#Y#Y.k.k.k#9#9#9#9#9#9#9#9#9#9#9.k.k.k.k#Y#Y#Y.U#Y#Y#Y#Y.k#9#9.z.aaw.D#U.g.Sbm#z#z.t#m#m.c.c.cbtbtbt.2bt.2.2.2.2.2.2bK.2.2bK.2.2.2.2.2.2btbtbt.c.c#m.t#5aKbo.g.g.Daw.a.z#9#9#9#9#O#Oaw.D.g.Sbm#5.t#m.c.c#Qa..q.L#O.z#caI#8afaf.R#d#V.h.hai#da1#da1a1a1a1",
+"a1a1a1a1#da1#d#d#d#8#d#8#8#8aI#c#c.k#9.z.z.0.nazaX#Tbwb1.9b8#3b8.r.r.r.r.r.r.r.rbK.rbKbKbKbKbKbKbKbKbKbKbKbKbKbKbK.rbK.rbK.r.rbA.r.rbAbAbAbAbA#xbA#x#x#x#x#x#xa9a9a9#u#ubH#ub6.p.paq##bE.d#i#Z#Z.8.z.8.z.z#O.a.aawaEaEbsaA#t#QbSbtbt.c.c#m.t#z.S.g.Daw#O#9.k#Y#Y#Y.U#Y#Y.k.k.k.k#9#9#9#9#9#9#9#9#9#9#9.k#9.k.k.k#Y#Y#Y#Y#Y.U#Y#Y#Y.k#9.z#Oaw.D#U.g.Sbobm#5.t.t#m#m.c.cbtbtbt.2bt.2.2.2.2.2.2.2.2bK.2.2.2.2.2.2btbtbt.c.c.c#m#5#5aKbm.S#U.Daw#O.z.z#9#9#9#O#Oaw.D.g.SbmaK#m#m.c.c#Q#t#2aH#O#9#c#8afaf.R#V#V#V.h.h.haia1a1a1a1a1a1",
+"a1a1#da1a1a1#d#d#d#daf#d#d#8#8aIaI#c#9#9.8aC.0az#saX.fa.as.9b8#3bK.r.r.r.r.r.rbK.rbK.rbKbKbKbKbKbKbKbKbKbKbKbKbKbKbK.rbK.r.r.r.rbA.r.r.rbAbAbAbA#xbA#xbA#x#x#xa9a9a9a9a9bHb6b6.p.pbM##bE.d#i#Z.8.8.8#9.z.z#O#Oawaw.DaE.qaA#taYbS.cbtbt#m.t.tbm.S.g.D.a.z#9.k#Y#Y.U#Y#Y#Y#Y.k.k#9.k#9#9#9#9.z#9.z#9#9#9#9.k.k.k.k.k#Y#Y#Y.U#Y#Y#Y#Y.k#9.z#O.aaw#U.g.Sbmbm#z#z.t#m#m.c.c.cbtbtbt.2bt.2.2.2bK.2.2.2.2.2.2.2.2.2.2.2btbtbt.c#m#maY#5aK#C.S.g.Daw#O.z#9#9#9#9.z.aaw.D#U.Sbm.t.t#m.c.caYaA#2aH#O#9aI#8afaf.R#VbWbW.h.h.hai.haia1a1a1a1",
+"a1a1a1a1#da1.h#d#d#d#daf#8af#8#8#c#c.k#9#9#OaCazazaXaXbwb1bCbOb8b8.rbK.r.r.r.r.rbKbKbKbKbKbKbKbK.2bKbK.2bKbKbKbKbKbKbKbKbK.rbK.r.r.rbA.rbAbAbAbAbAbA#xbA#x#x#x#xa9a9a9#ubH#uamam.paqbVb3aj#i#Z#Z.8.z.z.z.z.z#O.aaw.DaE.5aA#taY#Q.cbt.c#m#m#zbm.S#U.D.a.z.k#Y#Y.U#Y.U#Y#Y.k.k.k.k#9#9#9.z#9.z#9.z#9#9#9#9#9.k.k.k#Y.k#Y#Y#Y.U.U#Y#Y.k.k#9#O.aaw.D#U.S.Sbm#z.t.t.t#m#m.c.cbtbtbtbtbt.2.2.2.2.2.2.2.2.2.2.2.2.2btbtbtbt.c.c.c#m.t#5aK#C.S#U.Daw#O.z#9#9#9#9#O#Oaw.D.g.SbmaK.t#m.c.caYa5aE.0#OaGaI#8.R.R.RbWbWbxbx.h.haiaia1aia1a1a1",
+"a1.Ba1aia1ai#dai#d#V#d#daf#d#8#8#8aI#c.k#9.zaC.0az.LaX.fb1b1.9aob8#3bKbK.rbK.rbK.rbK.rbKbKbK.2bK.2bK.2bKbKbK.2bKbKbKbKbK.rbK.rbK.r.r.r.rbA.rbAbAbAbAbA#xbA#xbAa9#xa9bZa9bHbHb6ambMaqaqbEaj#i#Z.8.8aG.z#9.z#O#O.aaw.D#U.5bs#taY#Q.c.c.c#m.t#zbm.S#Uaw#O#9.k#Y.U#Y.U#Y#Y#Y.k.k.k#9#9#9#9#9#9.z.z#9.z#9#9#9#9#9.k.k.k#Y#Y#Y.U#Y.U#Y#Y#Y.k#9.z#Oaw.D#U.g.Sbobm#z.t.t#m#m.c.c.c.cbtbt.2btbtbt.2.2.2.2.2.2.2.2.2.2.2btbtbt.c.c.c#m.t#5aKbo.S.g.Daw#O.z#9.k#9#9.z#Oaw.D.g.Sbm#5.t#m.c#m#taA#a.a.z#c#8afafbJbJbWbWbWbxb2.haiaiaiaia1.Ba1",
+"a1a1aiaiaia1.hai.h#d.h#V#dafaf#8#8aI#c#c#9#9.zaC.0.L#s#l.fb1.9.9b8bKbK.rbK.rbK.rbKbKbKbKbKbKbK.2bK.2bKbK.2bKbKbKbKbKbKbKbKbK.r.r.r.r.r.rbA.rbAbAbAbA#xbA#xbA#xbA#xa9a9bZ#ubHbHam.pbMbVbEaj#i#i#Z.8.z#9.z.z.z#O.aawawaE.5aAaAaY#Q.c.c.c#m.t#z...g#Uaw.z#9.k#Y#Y.U.U#Y#Y#Y.k.k#9#9#9#9.z.z.z#9.z.z#9.z#9#9#9.k.k.k.k#Y#Y#Y#Y.U#Y.U#Y#Y.k.k.z#O.a.D#U.g.S..bm#z.t.t.t#m#m.c.cbtbtbtbtbt.2bt.2bt.2.2.2.2.2.2.2btbt.2btbt.c.c#m#maY#5aKbm.g#U.D.a#O.z#9#9.k#9#O#Oaw.D.g.Sbm#z.t#m#m#m#t.q#a#OaG#c#8.R.RbJararbW.6bxbxaib2aiaia1.Ba1#p",
+".B.B#pa1aiaiai.h.h.h.h#V#V#dafafaf#8aI#c.k#9.zaC.0az.LaX.fa.bC.9aob8b8bKbKbK.rbKbKbKbKbKbKbK.2bKbK.2bK.2bK.2.2.2.2bKbKbKbKbKbKbKbKbK.r.r.r.r.rbAbAbAbAbAbA#xbA#xbAbZa9bZbZbHb6ambMbMaqbEaja4#Z.8.8.8#9#9.z.z#O.a.a.D#U.5aA.M#t#Q.c.c#m#m#z#z.S.g.D.a.z#9#Y#Y.U#Y.U#Y#Y.k.k.k.k#9#9.z#9.z.z.z.z.z.z#9.z#9#9#9#9.k#Y.k#Y#Y.U#Y.U.U.U#Y#Y.k#9.z.aaw#U#U.S.Sbm#z#z.t.t#m#m.c.c.c.c.cbtbtbtbtbt.2bt.2bt.2bt.2bt.2btbtbtbt.c.c#m#m.t#5aKbo.S.g.Daw#O.z#9.k#9#9.z#Oaw#U#U.Sbm#z.t#m#maY.M.qaH.a#9aIaf.RbJbJararbW.6bxb2bxaiai.Bai.Ba1.B",
+"#pa1aiaiaiaiai.hai.h.h#V#V#V#Vafaf#8#8aI#c.k#9.zaC.0azaX#l.fa.bCaoaob8bKbKbKbKbKbKbKbKbKbK.2bK.2.2bK.2.2bK.2bKbK.2bKbKbKbKbKbK.rbK.r.r.r.r.r.rbA.rbAbAbAbAbAbA#xbA#xbZbZa9bH.NamamaqbVbEaja4#Z#Z.8#9#9#9.z.z#O#Oawaw.D.5bs.MaYaY.c#m#m.t.tbm.S.g.D.a.z.k#Y.U.U.U.U#Y#Y#Y.k#9#9#9#9.z.z.z.z.z.z.z.z.z#9.z#9#9.k.k.k.k#Y#Y#Y.U.U#Y.U#Y#Y.k#9.z#O.a.D#U.g.Sbmbm#z.t.t#m#m#m.c.cbtbtbtbtbtbtbtbtbt.2bt.2bt.2bt.2btbtbt.c.c.c#m#m.t#5aKbo.S#U.D.a#O#9#9.k#9#9.z.a.a.D.g.SbmaK.t#m#maYaAaEaw#O#c#8af.R#J#Jararar.6.6b2b2b2aiai.Ba1.Ba1",
+".B#p.B#paiaiaiai.h.hbxbxbW#V#Vafafaf#8#8#c#c#9.z#O.0aH.LaX#la.bCbCaoao.2bKbKbKbKbKbKbK.2bK.2bK.2bK.2.2.2.2bK.2.2.2.2bK.2bKbKbKbKbKbKbK.r.r.r.r.rbA.rbAbAbAbAbAbAbAbAa9bZbHbZbHamasbMbVbVaj#i.n.8.8#9.z#9#9.z#O#Oawaw#U.5aAaAaYaY.c#m#m.t#zbm.S.gaw.z#9#Y#Y.U.U.U#Y#Y#Y.k.k.k#9#9#9.z#9.z.z.z.z.z.z.z.z#9#9#9#9.k.k.k#Y#Y#Y#Y.U.U#Y.U#Y#Y#9#9#O.a.D#U.g.S.Sbm#z#z.t.t#m#m#m.c.c.cbt.cbtbtbtbtbtbtbtbt.2bt.2btbtbt.cbt.c.c#m#m#5#zaKbo.S#U.D.a#O#9#9.k#9#9.z#Oaw.D.g.Sbm#z.t.t#m#5aAaE.0.zaGaf.RbJ#J#J#6arbN.6.6b2b2b2.Bai.B.B.B.B",
+"#p#p.Bai.Baiaib2bxbxbx.hbWbW#V#V#Vafaf#8aI#c.k#9.z#OazaH#s#l#lb1bC.9aoaobK.2bKbKbKbKbKbK.2bK.2.2.2.2bK.2.2.2.2bK.2bK.2bKbKbKbKbKbK.rbK.rbK.r.r.r.rbA.rbAbAbAbA#xbAbAbZbZbZ.N.N.N.pbMbVbEa4#i#ZaC.8#9#9#9.z.z.z#O.a.D.D.5bs.MaYaY#m#m#m.t#z...S.D.a.z#9#Y.U.U.U#Y.U#Y.k.k.k#9#9.z.z.z.z.z.z.z.z.z.z.z.z.z#9#9#9#9.k.k#Y#Y#Y.U#Y.U.U.U#Y#Y.k#9#O#Oaw.D.g.S.Sbm#z#z.t.t#m#m.c.c.c.c.cbtbtbtbtbt.2btbtbtbtbtbtbtbtbtbt.c.c.c#m#m.t#5aKbo.S#U.D.a#O#9#9.k.k#9.z.aaw.D.g.Sbm#z.t#m#5aYbs#a.a.z.yaf.R#Jbjar#6bNarbNatb2b2b2.B.B.Ba1.B#p",
+".B.B#p.B.Baiaib2aib2bxbxbxbWbWbW.Rafaf#8#8#8#c#9.z.z.0aH.LaX#la..AbCbSao.2bK.2bKbKbKbK.2.2bK.2.2bK.2.2.2.2.2.2.2.2.2bK.2.2.2bKbKbKbKbKbK.r.r.r.r.r.rbA.rbAbAbAbAbAbAbAbZbZbZ.NamasbMbVbVaj.n#Z.8.8#9#9#9#9.z.z.aawaw#U.5.5.MaYaY#m#m.t#zbm.S.g.D.a#9.k#Y.U.U.U.U#Y#Y.k.k#9#9.z#9.z.z.z#O.z#O.z#O.z.z.z.z.z#9#9.k.k.k.k#Y#Y#Y.U.U.U.U.U#Y.k#9.z#Oaw.D#U.S.Sbmbm#z.t.t.t#m#m#m.c.c.c.cbt.cbtbtbtbtbtbtbt.2btbtbtbt.cbt.c#m#m#m.t#zaK.S.S#Uaw.a.z#9.k.k#9#9.z#Oaw.D.g.Sbm#z.t.t#5.M.q.D#OaG#8.RbJ#Jbj.P#6#6bNat.6atb2bDb2.B.B.B#p.B",
+"#p.B#p.Bai.Bb2b2b2bxbx.6bW.6bWbJbW.R.Raf#8#8aI#c#9.z#O.0aH.L#l#la.bCbSaoao.2.2bK.2.2.2bK.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2bK.2bK.2bKbKbKbKbKbK.r.r.r.r.rbA.rbA.rbAbAbAbAbZ#3#3.N.NasbMbVbEa4a4#ZaC#9#9#9#9#9.z#O#O.a.D.D.5bs.M#5aY#m#m.t#zbm.S.gaw#O#9#Y.U.U.U.U#Y#Y#Y.k.k#9aG.z.8.z.8.z#O.zaC.z#O.z.z.z.zaG.z#9#9.k.k#Y#Y#Y.U.U.U.U.U#Y#Y#Y.k.z#O.a.D#U.g.S..bm#z#z.t.t#m#m#m.c.c.c.cbt.cbtbtbtbtbtbtbtbtbtbt.c.cbt.c.c.c#m.t.taKaK.S.g#U.D.a.z#9.k.k.k#9.z.aaw#U.g.Sbm#z.t.t#5.M.5aw#O#caf.R#Jbj.P#6#6#6bNbNatatbDbDbD.B.B.B.B.B",
+"#R.B.B.B.BbD.Bb2b2b2.6bx.6arbWbWbWbJ.R.Raf#8#8#c#c.z.z.0aH.L#2#la5.AbCbSbSao.2.2.2bK.2.2.2bK.2.2.2.2.2.2bt.2.2.2.2.2.2.2.2.2.2bK.2bKbKbKbKbK.rbK.r.r.r.r.r.rbA.rbAbA.rbZbZ#3.Namas.4bV#Ta4.n#Z.8.z#9#9#9#9.8.z#Oawaw#U.gbs.M#5#m#m.t#z#z...S.D.a.z.k#Y.U.U.U.U.U#Y.k#c#9aG#9.8.z.8.z#O.8#O#O#O.8#OaC.z.8.z#9aG#9#9.k.k#Y#Y#Y#Y.U.U.U.U#Y#Y.k#9.z.aaw.D#U.S.Sbm#z#z.t.t.t#m#m#m.c.c.c.cbt.cbt.cbtbtbtbtbtbtbtbt.c.c.c.c#m#m#m#5#zaK...g#Uaw#O.z#9.k.k#9#9.z#Oaw.D.g.Sbm#z.t.t#5bsaEaH.z.yafbJ#Jan.P#6#6.u.uatat#.b2bDbD.B.B#R.BaU",
+"#p#R#p.B.B.Bb2.Bb2b2b2.6.6.6arararbJ.R.Rafaf#8aI#c#9.z#O.0#a.LaXa5a5.AbSbS.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2bt.2bt.2.2.2.2.2.2.2.2bK.2bKbKbKbKbKbK.r.r.r.r.rbA.r.rbA.rbA#3#3.N.NbOas.4bV.Ca4.naC.8#9#9.kaG#9.8.z.a.a.D#U.5bs.M#5#5.t.t#zbm...g.D#O#9#Y.U.UaR.U.U#Y.k.k.kaG#9.8.8.zaC.zaC#OaC.8#OaC#O.8.z.8.z.8#9aG.k.k.k.k#Y.U.U.U.U.U.U.U#Y.k#9.z#Oaw.D.g.S.S..bm#z#z.t.t#m#m#m#m.c.c.c.cbt.cbtbt.cbt.cbt.cbt.c.c.c.c#m#m#m.t.t#zbm.S.g#Uaw#O.z#9.k.k.k#9.z.aaw#U.g.Sbm#z#5.t#5bs#U.a.8.y.R#Jan.P.Pb0b0.uakatatat#.bD.B.B#R.B#R#p",
+"#R.BaU#R.B.BbDb2b2b2at.6.6.6ararararbJbJ.Rafaf#8aI#9#9#OaCaH.L#2#la5a..AbSbSaobt.2.2.2.2.2.2.2.2.2.2bt.2btbt.2bt.2bt.2.2.2.2.2.2.2.2.2.2bKbKbKbKbKbK.r.r.r.r.rbA.r.rbA#3#3#3.NbOas.4bV.Ca4.naC.8#9#9.kaG#9.8.z.a.a.D#U.gbs.M#5#m.t.t#z...S#U.a#O.k#Y.UaR.U.U#Y#Y#Y#caGaG.8.8.z.8.zaC#OaC#O#OaC#O.8#OaC.z.8.8#9aG#9aG.k.k#Y#Y#Y.U.U.U.U.U#Y#Y.k.z#O.a.D#U.g.S..bm#z#z.t.t.t#m#m#m.c.c.c.c.c.c.c.cbt.cbt.cbt.c.c.c.c.c#m#m#m.t#5#zbo.S.g.Daw#O.z.k#Y.k.k#9.z.aaw.D.S.Sbm#z#z#5bsbs#a#OaGafbJbjan.P#yb0bBbB.uakat#.bDbDbT.B#R.BaU#R",
+"aU#R#R#p#R.BbDbD#.b2at.6.6bNbNarar#JarbJbJ.Raf#8#8#c#c.z#O.aaH.L#2#la5.A#QbSbSbt.2bt.2.2.2bt.2btbtbt.2bt.2btbtbt.2btbt.2.2.2.2.2.2.2bK.2bK.2bKbKbK.rbK.rbK.r.r.r.r.r.r.r#3#3bOasasbw#T#s#i.n.8.8#9#9#c#9aG.8.z.aaw.D#U.5bs.M#5.t#z#z#z...S.D.a#9.k.U.UaR.U.U#Y#Y#caG#9aG.8.8.8aCaCaC#OaCaC#OaC#OaC#O.8.8.z.8aG.8aG.k#c.k#Y#Y.U.U.UaR.U.U.U#Y.k#9#O.aaw#U.g.S..bm#z#z#z.t.t#m#m#m#m.c.c.c.c.cbt.c.cbt.cbt.c.c.c.c.c.c#m#m.t.t#z#zbo.S.g.D.a#O#9.k.k.k.k#9#O#Oaw#U.g.Sbm#z.t#5aK.5.D#O.yaf#JananbIaZb0bBbBakatbP#.#.bD#RbD#R#RaU#R",
+"aU#RaU#R#R.BbDbDbDatb2atatbNarbNbNarbj#JbJ.R.R.R#8aI#c#9.z#OaH#a#2.qa5a5.A#QbtbSbtbt.2btbtbt.2bt.2btbtbtbtbtbtbtbtbtbtbtbt.2bt.2.2.2.2.2.2bKbKbKbKbKbKbK.r.r.r.r.r.r.r#3#3b8bOasasbw#T#saz.n.8#9#9.k#9#caG.zaC.a.a.D#UbobsaK#5.t.t#z...S.gaw#O.k#Y.UaRaR.U#Y#Y#c#caGaG.8.8.8#OaCaC#OaCaC#OaCaC#OaCaC.zaC.8.8.zaG#9aG#c.k.k#Y#Y.U.U.UaR.U.U#Y.k#9.z#Oaw.D#U.S.S..bm#z#z.t.t.t#m#m#m#m#m.c.c.c.c.c.c.c.c.cbt.c.c.c.c#m#m#m#m.t#zaK...S#U.Daw.z#9.k.k#Y#9#9.z.aaw#U.g..bm#z#zaKbs#Uaw.8#8.Rbjanb7#yaZaZbBb4akakbP#.bTbD#R#R#RaU#RaU",
+"#RaU#RaU.B#RbDbDbDb2atatatbNbNbN#6#6arbj#JbJ.R.Raf#8#caG#9#O.aaH.L#2#la5#t.AbSbSbtbtbtbt.2bt.2btbtbt.2btbtbtbtbtbtbtbtbtbtbt.2bt.2.2.2.2.2.2.2bKbKbKbKbKbK.rbK.r.r.r.r#3b8bObOasb1bV#Ta4.naC.8#9#9#c#c#caG.8.8.aaw.D.g.5aK#5#5#z#z#z...S#U.a.z#Y.UaR.U.U.U#YaI#caGaGaG.8.8aC.8aCaCaC.0#O.0aC.aaCaC#OaC.8.8.8.8aG.8aG.k#c#Y#Y#Y.U.U.U.U.U.U.U#Y.k.z#Oaw.D#U.g.S..bm#z#z.t.t.t.t#m#m#m.c.c.c.c.c.c.cbt.c.c.c.c.c.c#m.c#m#m.t.t#zaK.S.S#U.D.a.z#9.k#Y.k.k#9#O.aaw#U.S.Sbm#z#zaKbs#U.aaG#dbJanb7#y#yaZ#n#nb4ak.J#.#.#.bT#R#R#RaU#RaU",
+"aU#RaU#R#RbD#RbDbD#.#.atatakbN#6bN#6#6#6bj#JbJ.Rafaf#8#c#9.z#O.0#a#a.qa5a5#t#Q#QbSbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbt.2.2.2.2.2.2.2bKbKbKbKbK.rbK.rbK.rbK#3b8.9.9bwbw#s#s.naC.8#9.k.k#caGaG.8#O.aaw.D.gbobsaK#z.t#z.....gaw#O.k#Y.UaRaR.Uad#Y#c#caGay.8.I.8aCaCaCaC.aaC.0#O.0aC.0aCaCaCaCaC.8.8.8aGaGaG#c#c#Y#Y#Y.U.UaRaR.U#Y#Y.k#9#O.aaw#U.g.S....#z#z#z#z.t.t#m#m#m#m#m.c#m.c.c.c.c.c.c.c.c.c.c#m#m#m.t.t.t#zbm.S.g#Uaw#O.z.k.k#Y.k.k.z.z.a.D#U.g..bm#zaKaK.5.D#Oay.Rbjanb7#y#WaZ#n#nb4b4atbPapbDbT#R#R#R#i#RaU",
+"aU#i#RaU#R#R#RbDbD#.#.atatat.ubN#6bN.P#6bjbj#JbJ.Raf#8aI#c#9.z.aaH#a#2.qa5#t#Q#Q.c.cbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbt.2bt.2.2.2.2bK.2bKbKbKbKbKbKbKbK.rbKb8b8b8bOb1bw.f#saz.n.z.z.k#c#c#caGay.8#O.a.D#U.g#CaK#5#z#z#z...S#U.a.z.k.UaRaR.U.Uad#c#caGay.8.8.IaCaCaCaC.0.0.0.0aC.0#O.0aCaCaC.8.8.8.8.8aGaGaG#9#c#Y#Y.U.U.U.UaR.U.U#Y.k#9.z.aaw.D.g.g.S..bm#z#z.t.t.t.t#m#m#m#m#m.c#m.c.c.c.c.c.c#m#m#m#m#m#m.t.t#z#zbm.S.S.Daw#O.z.k#Y#Y.k.k#9#O.a.D#U.S.Sbm#zaKaK.gaw.8.ybJbjb7b.#WaZ.i#na2b4.J.JbP#.bTbT#R#R#i#R#i#i",
+"#i#RaU#i#R#R#RbDbT#.#.bPatatak.u.u#6#6#6.Pbjbj#JbJ.Raf#8#caG.z#O.aaH#a.qaAa5#taY#QbS.c.cbt.cbtbtbt.cbt.cbt.cbt.c.cbt.cbt.cbtbtbtbtbtbtbtbt.2.2.2.2.2.2bKbKbKbKbKbKbKbKb8b8.9.9b1.f#T#sazaC.8#9#9.k#c#cayaG.8aC.aaw#U.g#CaK#z#z#z.....g.D#O#9.U.UaRaR.U.U#c#cayaG.I.I.8#ZaC#ZaC.0aC.0aC.0.0.0.0.0.0aCaCaCaCaC.8.8.8aGaG#c#c#caI#Y.U.UaR.UaR.U#Y#Y.k#9#Oaw.D#U.S.S..bmbm#z#z.t.t.t.t#m#m#m#m#m.c#m#m.c#m.c#m.c.c.c#m#m.t.t.t#zaKbm.S.g.Daw#O#9.k.k#Y.k.k.z#O.a.D#U.S..bm#zbm#C#UawaG#d#Janb..H#W.iaxa2a2b4.JbPapapbTbT#R#i#R#iaU#i",
+"#i#i#i#R#i#R#RbTbD#.#.#.bPakakak.u.ub0#6#6.Pbjbj#JbJ.Raf#8#c#9.z.aaH#aaE.qaAa5#t#Q#Q.c.c.cbt.cbt.cbt.cbt.cbt.cbt.cbt.cbt.cbt.cbtbtbtbtbt.2bt.2.2.2.2bK.2.2bKbKbKbKbKb8b8b8.9.9bw.faXaz.naC.z#9#c#c.y#c.y.8.8.aaw.D#U.g#CaKaK#zbm...S#U.a#9.k.UaRaR.U.UaI#c.yayay.I.I#ZaC#Z.0.0.0.0.0.0.0.0.0aC.0aC.0aCaC#Z.8.I.I.8ayaGaG#c.k#Y#Y.U.U.UaRaR.U.U#Y.k#9#O.aaw#U.g.S....bm#z#z#z.t.t.t.t#m#m#m#m#m#m.c#m.c#m.c#m#m#m#m#m.t.t.t#zbm.S.S#U.D.a#O#9.k#Y#Y.k.k.z#O.a.D#U.S.Sbmbmbm.g#UaCay#Vbjb7.H#W#W.i.ia2a2bFbFbPb9bTbT#R.d.d#i#i#i#i",
+"#i#iaU#i#i#R#RbTbTbT#.bPbPatakakbB.ub0b0b0bI.PanbjbJbJaf#8#8aG#9#O.aaH#a#2.qaA#taYaY#Q.c.c.c.c.c.cbt.c.cbt.c.cbt.c.c.c.cbt.cbt.cbt.cbtbtbtbt.2bt.2.2.2.2bK.2bK.2bKbKbKaoao.9b1a..f#saz.0.8.z.k.kaI.y.yay.IaCaCaw.D#UbobmaK#zbm...S.gaw#O#9.UaRaRaR.Uad#c.yaGay.I.I.I#Z#ZaC#ZaC.0.0.0.0.0.0.0.0.0.0.0aCaCaCaC.I.8.I.8ayaG#c#caIaI.U.U.UaR.UaR.U#Y.k#9.z.aaw#U#U.S.S....#z#z#z#z.t.t.t#m.t#m#m#m#m#m#m#m#m#m#m#m#m#m.t.t.t#z#zbm.S.S#U.D.a.z.k#Y#Y#Y.k.k.z#Oaw.D.g.S..bmbm#C.g.D#O.ybJanb..Hbn.i.iaxa2#qbF.JbPapapbTbT.daU#i.d#i#i",
+"#i#i#i#i#R.d#R#RbTbD#.#.bPbPakakakbBbBb0b0bI.P.Pan#J#J.R.R#8#caG.z#O.a#aaE.qaAa5#taY#Q#Q.c.c.c.c.c.c.c.c.c.c.c.c.cbt.c.c.c.cbt.cbt.cbtbtbtbtbtbt.2.2.2.2.2.2bK.2.2bKaoaoaobCb1.faX.LazaC.z#9#c#caI.y.yayaGaC.aaw#U.g.S#CaKbmbm...S#U.a.z#Y.UaRaR.U.UaI#cayay.I.I.I#Z#ZaC.n.0.n.0.0.0.0.0.0.0.0.0.0aC.naC#Z#ZaC.I.Iay.8ayaG#c#c#Y#Y.U.UaRaRaR.U.U#Y#9.z#Oaw.D#U.g.S....bm#z#z.t.t.t.t.t#m.t#m#m#m#m#m#m#m#m#m#m#m.t#m.t.t#z#zbm.S.S#Uaw#O.z.k#Y#Y#Y.k#9.z#Oaw.D.g.S..bmbmbo.gaw.I#d#Jb7.H#WaF.iaJaxa2#qbFbFb9apbTbu.d.d#i#i#i#i#i",
+"#i#i#i#i#i#i.d#RbTapapbPbPbPakakb4bBbB#nb0aZbI.Panan#JbJ.Raf#8#c.z.z.aaw#aaE.qaA.M#taY#m#Q.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.cbt.cbtbtbtbtbt.2.2.2.2.2bK.2.2aoaobCbCa..faX.L.0aC.z#9#caI#8.y.yay.IaC.a.D#U.gbobmbmbm.....g.D#O.k#YaRaR.Uadad.yayayay#p.I#Z#Z.n#Z.n.0.n.0.n.0aH.0aH.0.0.0.0.n.0#ZaC#Z#Z.I.8.IayaGay#caI#cad.U.UaR.UaR.U.U#Y.k#9#O.aaw#U.g.S......#z#z#z#z.t.t.t.t.t#m.t#m#m#m#m#m#m#m.t#m.t.t.t.t#zbm...S.g#U.a#O#9.k#Y#Y#Y#Y#9.z.aaw#U.g.S....bmbo#U.aaybWbjb..H#B.7.7ax.E#q#qbF#0b9apbTbu#R#i.d#i#i#i#i",
+"#iaz#i#i#i#R.d#RbTbTap#.bPbP.Jakb4b4bB#nb0aZb0#y.Panan#JbJ.R#8.y#c.z#O.aaw#a.5.qaA#t#taYaY.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.cbt.c.cbtbtbtbtbt.2bt.2bt.2.2.2.2aoaobSbCa.a.aX.Laz.0.z#9#caI#8.y#d.y.I.8.0aw.D#U.Sbobmbmbm...S.D.a#9#Y.UaRaR.Uad#c.yayay#p#Z#p#Z#Z#Z.n.n.n.0.naH.0.naH.0aH.n.0.n.0#Z.0#Z#Z.8#Z.I.I.IayaG.y#caI#Y#Y.UaRaRaR.U.U#Y#Y#9.z.aaw#U.g.S.S....bm#z#z#z.t.t.t.t.t#m.t#m.t#m#m#m#m#m.t#m.t.t#z#z#zbm.S.S#U.D.a.z#9#Y#Y#Y#Y.k#9.z#Oaw#U.g.S.....S.g.DaCay#Jb7.HbnaF.7aJax.E.E#q#0#0b9.3bT.d.d.d#i#ia4#iaz",
+"#ia4#i#i#i#i.d.dbTbTbTapb9bP.J.Jb4b4bB#n#naZaZ#ybIb7anbj#J.R.R#8.yaG.z#Oaw#aaE.5aAaA.MaYaYaY#m.c#m.c.c.c.c.c.c.c.c#m.c#m.c.c.c.c.c.c.c.cbt.c.cbtbtbtbtbt.2bt.2btaobtaobSbCa.#laX.L.0aC#9#9#caI#8#d.ya1ayaC.0aw#U#U.Sbmbm.....S.gaw#O.k.UaRaRaRadaI.y.y.I#p#p#ZaU#Z.n.n.n.0.naH.naH.naHaz.0az.0.n.0.n.0.n#Z#Z#Z#Z.I.I.Iayayay#c#caIad.UaR.UaRaR.U.U#Y.k.z#O.a.D#U.g.S....bmbm#z#z#z#z.t.t.t.t.t.t#m.t#m.t.t.t.t.t.t.t.t#z#z...S.S#U.D.a.z.k.k.U#Y#Y.k#9#O.aaw#U.g.S.....S.gaw.8.hbjb7bnaFaF.7aJ#e.E#qbFbXb9apapbubu.d#i#ia4#ia4#i",
+"az#ia4#i#i#i.d.d#RbTapapbPbP.J.Jb4b4a2bB#naZaZ#y#ybIb7anbj#J.Raf#8.y.z#O.aaw#aaE.qbs.M#t#5aYaY#m#m.c#m#m#m#m.c#m#m.c.c.c#m.c#m.c.c.c.c.c.cbt.cbtbtbtbtbtbtbtbtbtbtbSbS.A.Aa5aX#2az.0.z#9#caI#8#daf#da1.IaC.a.D#U.g.S.S.......S.D.a#9#Y.UaRaRadaI.yaya1#p#paUaU#ZaU#Z.n.n.n.naz.0azaz.0az.naH.naH.n.n.n#Z.n#Z#Z.I.I.I.IayayaG.y#caIad#Y.UaRaRaRaR.U#Y.k#9#O.aaw#U.g.S.S....bm#z#z#z#z.t.t.t.t.t.t.t.t.t.t#m.t.t.t.t#z#z#zbm...S.g.Daw#O#9.k#Y.U#Y#Y#9#9#O.a.D#U.S.S...S.S#U.a#pbWan.HbnaF.7.7aJ.E#P#qaV#0b9bLbTbu.d.d#ia4#ia4az#i",
+"#ia4aza4a4#i#i.d.dbubTapb9b9.J.JbFb4a2a2#n#n.iaZ#y#yb7b7anbjbJ.Raf.yaG.8#O.a.D#a.5.qaA.M.MaY#maY#m#m#m#m.c#m#m.c#m.c#m#m.c#m.c.c#m.c.c.c.c.c.c.cbt.cbtbtbtbtbtbtbSbSbS.Aa.#l#2.L.0#O.z.k#c#8#8af#da1ay#Z#Zaw.D#U.S.S.......S#Uaw.z.k.UaRaR.Uad#8.yay#p#p#paUaUaU.n#i.n.n.naz.nazaz.0azaHaz.naH.n.n.n.0#Z.n#Z#Z#Z#Z#p.I.Iayay.y#c#caI.U.U.UaRaRaR.U.U.k#9.z.aaw.D#U.S.S....bmbm#z#z#z#z.t#z.t.t.t.t.t.t.t.t.t.t.t#z#z#z#z...S.S.g.D.a#O#9#Y#Y.U#Y#Y#9#9#O.a.D#U.S.S...S.g.DaCa1#Jb7bn#B#7.vaJ#e.E.EaVbX#0b9apbubu.d.da4a4a4#ia4a4",
+"aza4#ia4#i#i.d.d.dbTbTapb9b9.J.JbFb4a2a2#nax#n#WaZ#y#yb7ananbjbJ.R#8.yaG.z.aaw.DaE.5bsaA.MaY#5aY#m#m#m#m#m#m.c#m#m#m#m.c#m#m#m.c#m.c#m.c.c.c.c.c.cbt.cbtbtbtbtbt#QbS.Aa5a5#l.LaH.0.z#9#caI#8af#d#d#d#p.I.0aw.D.g.S.S.....S.g.D#O#9.UaRaRaRadaIayay#p#paUaUaUaU.n#i.n.naz.nazazaz.nazazaz.naz.naz.n.n.n.n#Z.naU#Z#p#Z#p.Iayayay.y#caIad.UaRaRaR.UaR#Y#Y.k#9#O.a.D#U.g.S.S....bmbm#z#z#z#z.t.t.t.t.t.t.t.t.t.t#z.t#z#z#zbm.....S#Uaw.a.z.k#Y#Y.U#Y.k.k.z#Oaw.D#U.S.S.S.S.gaw#Z#V.P.H#B#7aFaBaJaD#P#PaVaV#0bLbLbu.d.da4.da4a4aza4az",
+"a4a4a4a4#ia4#i.d.dbu.3apapb9b9.JbFbF#qa2a2ax#n.i#W#W#Wb.b.anan#JbJafafaGaG#O#Oaw.DaE.5bs.M.M.MaY#5aY#m#m#m#m#m#m#m#m#m#m#m.c#m#m.c#m.c#m.c.c.c.c.c.c.c.c.cbt.c#Q#Q#Q.Aa5#l#2.L.0#O.zaGaI#8afaf#V.ha1.IaC.0.D#U.g.S.....S.S#U.a.z#YaRaRaRadaI.ya1#p#p.B.B#RaU#iaU#i#iaz#iaz.nazazazazazazazaz.naz.n.n.n.n.n#ZaU#ZaU#Z#p.I#payay.yaI#cad.U.U.UaRaRaR.U#Y.k#9#O.aaw#U#U.S.S......bm#z#z#z#z#z#z#z#z.t#z.t.t.t#z.t#z#z#z#z.....S.g.Daw#O#9.k#Y.U.U#Y.k#9.z#Oaw.D.g.S.S.S.S#UaHaybWbIbnbr#7.vaB.O#e#P#PaVbX.ob9.3bu.daj#ia4a4a4a4a4a4",
+"a4az#ia4a4a4.d.d.d.dbT.3apb9#0.JbFbF#qa2a2axax.i.iaZ#W#yb.b.anan#JbJaf.y.y.z#O.a.DaE.5.5aAbs#5.MaY.taY#m#m#m#m#m#m#m#m#m#m#m#m#m#m#m#m.c#m.c.c.c.c.c.cbt.c.c#Q#Q#Q#t#ta5.q.LaH.a.z#9#c#8afaf#V.haia1aUaCaw.D#U.S.S.S...S.gaw#O.k.UaRaRaRaI#8a1a1.B#R#RaU#RaU#i#i#i.na4azazazazazazaz.nazazazaz.naz.n.n#i.naU#ZaUaU#p#p#p.I#payay.y#caIad.UaRaRaRaR.U.U#Y#9.z#Oaw.D#U.g.S.S....bmbm#z#z#z#z.t#z.t#z.t#z#z.t#z#z#z#z#zbm.....S#U.D.a.z#9#Y#Y.U.U#Y.k#9.z.aaw.D.g.S.S.S.g.DaCa1.Pb.#B.Y.vaB.O#eaD#P.bbXbXbLbL.3bu.daja4a4a4a4aza4az",
+"a4a4aza4a4#ia4#i.dbubT.3apb9b9#0#0bF#q#qa2.E#nax.i#W#W#W.Hb.b7anbj#J.Raf.yaG.8#O.a.D#U.5bsbs.M.M#5#5.t#5.t#m.t#m#m#m#m#m#m#m#m#m#m.c#m#m.c#m#m.c.c.c.c.c.c#Q.caY.A#ta5.q#2#a.0#O#9#c#8afaf#V#Vbxai#p#Z.0aw#U.g.S.S...S.g.D.a#9#YaRaR.Uad#8aya1.B.B#R#R#R.d.d#i#ia4#iaz#ia4a4aza4azazazazazaz.naz.n#i.n#i.n#iaUaUaUaU#Z#p#payayay.y#8aIad.UaRaRaRaR.U.U#Y.k#9#O.aaw#U.g.S.S........bm#z#z#z#z#z#z#z#z#z.t#z#z#z#z#zbm.....S.g#Uaw#O.z.k#Y.U.U#Y#Y.k#9.z.aaw#U.g.S.S.S#Uaw.IbxbIbnbr#7.vaB.OaDaD.baVaV.o#0.3bubu.da4.da4a4a4a4aza4",
+"aza4a4a4a4a4aj.daj.dbu.3apapb9#0bFbFbF#q.Ea2.Eaxax.i#W#W#Wb.b.b7anbjbJ.R#d.y.8#O#Oaw.DaE.5.5bs.M.M#5aY#5#m#5#m.t#m.t#m#m#m#m#m#m#m#m#m#m#m#m.c#m#m.c.c#m.caY#QaY#ta5.q#2#aaH#O.zaGaI#8af.RbWbWbxa1#p#ZaH.D#U.g.S.S.S.S#Uaw.z#Y.UaRaRadaIaya1.B#R#RbTbT.d.d#i.d#ia4a4a4a4aza4a4aza4a4aza4az#iaza4az#i.n#i#iaU.naUaU#paU#p#p#p#pay.y.y#caI.U.UaRaRaRaR.U#Y#Y#9.z.aaw.D#U.g.S.S......bmbmbm#z#z#z#z#z#z#z#z#z#z#z#zbm.....S.S#U.Daw#O#9.k.U.U.U.U.k.k.z#O.a.D#U.g.S.S.g#U.0a1arb.#B.Ya0a8aB#4aDaD.baVby.obL.3bub3ajaja4a4a4a4aza4a4",
+"a4aza4a4a4a4#iaj.d.dbubu.3bLb9#0#0bXbX#q#q.Eaxaxax.i.7#W#W#W.Hb.b7anbjbJ#V.y.y.8#O.aaw.D#U.5bs.Mbs.M#5#5#5#5.t#m.t.t#m.t.t#m.t#m#m#m#m#m#m#m#m#m.c#m#maY.caYaY#ta5aA.qaEaH.a.z#9#c#8af.RbJarbxb2.B#Z.0aw.D#U.S.S.S.S#Uaw#O.k.UaRaRaRaI.ya1.B.BbTbTbTbu.d.d.da4#ia4#ia4a4a4a4a4a4aza4a4a4aza4aza4#iaz#i#i.n#iaUaUaUaUaUaU#p#paya1ay.y#8aIaI.UaRaRaRaRaR.U.k.k.z#O.a.D#U#U.S.S........bmbmbm#z#z#z#z#z#z#z#z#z#zbm.......S.g#Uaw.a.z#9#Y.U.U.U.U.k.k.z#O.a.D#U.g.g.S.g.D#Zai.P.Hbra0.va8.O#4aD.1.b#jbX.obL.3bu.daj.da4a4a4a4a4a4az",
+"a4a4a4a4a4a4a4.daj.dbubuapbLb9#0#0bX#q#q#q.E.E.EaxaJ.iaF#Wbn.H.Hb.b7an#JbJaf.yay.8#O.a.D#UaE.gbsbs.MaK#5#5#5#5.t.t#m.t.t#m.t#m.t#m.t#m#m#m#m#m#m#m#m#maYaYaY#t.MaA.q#2aH.a#O#9#c#8af.RbJbWbW.6ai#p#Z.0#a#U.g.S.S.S.g.D.a#9#Y.UaRaRaI#8a1.B#RbTbTbTbu.dbu.d.d.daja4a4a4a4a4a4a4a4a4a4a4a4a4a4a4#iaz#i#i#i#i#i#iaU#RaU#R#paU#p#pa1ay.y#c#8adadaRaRaRaRaR.U#Y.k#9.z.aaw.D.g.g.S.S........bm..bmbm#z#z#z#zbmbmbm...........g.g.Daw#O#9.k#Y.U.U.U#Y.k#9.z#Oaw.D#U.S.S.g#UaH.I.6bI#B.Ya0a8#w#4#4.1.b.baVby.obL.3b3aj.da4a4a4a4aza4aza4",
+"a4aza4a4a4a4aja4aj.dbubu.3.3b9bL#0bXbXaV#P#q.E.EaxaJax.7.7aF#Wbnb.b.anan#JbJaf.yaG.8.aawaw#U.g.5#Cbsbs.M#5#5#5#5#5#5.t.t.t.t.t.t.t#m.t#m.t#m#m#m#m#maYaYaY.M#taA.q#2#aaw#O.zaG#8af.RbJ#Jar.6b2ai#p.naH.D#U.g.S.S.g#Uaw.z.k.UaRaRad#8ay#p.BbTbTapbububu.d.d.dajajajajajajaja4aja4aja4a4a4a4a4a4a4a4#ia4#i#i#i#i.daU#RaU#R#R#p#p#pa1ay.yaIaIad.UaRaRaRaR.U#Y#Y#9.z#Oaw.D.D#U.g.S.S..........bmbmbmbmbmbmbmbm..bm.....S.S.g#Uaw.a.z#9#Y.UaR.U#Y#Y.k#9.z.aaw#U#U.g.g.g.D.0a1#6.Hbra0a0a8#w#4.1.1.b.bbybybLbLb3buajajaja4a4a4a4a4a4a4",
+"a4a4a4a4a4a4#iaj.dajbubu.3.3b9.o#0bXbXbX#q#P#P.E#eaxaJ.7.7aFaF#Wbnb.b.b7anbJ#V#d.y.8.z.aaw.D#UaEbo#CbsaK.MaK#5#5#5.t#5.t.t.t.t.t.t.t#m.t#m.taY.taY#5aY#5#t.MaAaAaE#aaw.a.zaG#caf.R.R#JbjbN.6b2.B#Z.0.D#U.g.S.g.S#U.D#O.k.UaRaRadaIay#p.BbTbu.3bu.3bububub3aj.dajaj.da4ajajajaja4ajaja4aja4a4a4a4#ia4#i#i.d.d#R#i#R#R#RaU.B#R#p#pa1ay.y.yaIad.UaRaRaRaRaR.U#Y.k#9#O.aaw.D#U.g.S.S.S..............bm..bmbm...........S.g#U.Daw#O.z.k#Y.U.U.U.U.k.k.8#O.aaw.D.g.g.g.gaw#Zb2#y#B.Ya0.m#wa7#4.s.1.b#j#j.obL.3b3buaja4aja4a4a4a4a4aza4",
+"a4aza4a4a4a4a4ajajajbubu.3.3bLb9.obXbXaVaV#q#P.E.E#eaJaJ.7.7aFaFbnbn.Hb7ananbJ#V#d.y.I#O.aaw.D#U.g.5#CbsaK.MaK#5#z#5#5#5#5.t#5.t#5.t.t#5#5.t#5aY#5aY#5.M.MaAbsaEaEaH.a#OaG#c#8afbJ#JbjarbN.6bD.B.naH.D#U.g.S.g.g.D.a#9#Y.UaRaRaI.ya1.BbTbuap.3.3.3.3bub3bub3b3buajajb3ajajajajajajajajaja4ajaja4aj.da4.d.d#i.d#R.d.d#R#R#R.B.B#p#pa1ay.y#8aIad.UaRaRaRaR.U#Y#Y#9.z#O.aaw#U#U.g.S.S...............................S.S#U#Uaw.a.z#9#Y.UaRaR.U#Y#Y#9.8#O.aaw#U.g.g.g.DaH#pbN#y#Baa#h.Q.Q#4.s.1baaQ#jby.obL.3b3b3.daj#ia4a4a4a4aza4a4",
+"a4a4a4a4a4aja4.daj.dbubu.3.3bLb9.o#0bXaVaV#P#P#P.E#e.EaJaJ.7.7aF#Bbnbnb.b.anbjbJ#V#day.8#O.aaw.D#U#U#C#C#CbsaK.MaKaK#5#5#5#5#5.t#5.t#5.t#5#5#5#5#5.M.M.MaAbsaEaEaw.a#O.z#c#8.RbJ#Jbj#6bNbNb2bDaU.naH#U#U.g.g.g#U.a.z.k.UaRaRaI.ya1#RbT.3.3.3.3.3.3bub3bub3b3ajb3b3b3b3bub3b3b3ajajajajajaj.daj.daja4.daj.d.d.d.d.dbT#R#R#R#R.B#p#pa1a1.y.yaIad.UaRaRaRaRaR.U#Y.k#9#O.aaw.D#U#U.g.S.S.S.........................S.S#U#U.D.a#O.z.k#Y.U.U.U.U#Y#caG.8#Oaw.D#U.g.g.g#a#Zb2bI#Bbqa0.m.Qa7.s.saT.baQ#jb5.oauaubub3aja4aja4#ia4a4a4a4az",
+"a4a4a4a4a4a4aja4ajb3b3bu.3.3bLbL#0bybyaVaVaV#P#PaD.E#e#eaJ.7.v.7aFaFbnbn.Hb7anbjbJ#V.yay.8#Oawaw.D#U#U.g#C#C#CaK.MaKaKaK#5aK#5#5#5#5#5#5#5#5#5#5.M.M.Mbs.5aE#a.Daw#O.zaG#8afbJ#Jbj.P#6.ubN#..B.naH.D#U.g.g.g#Uaw#O.k.UaRaRad.yay#pbT.3.3.3bLbL.3au.3b3.3b3b3bub3b3bub3b3bub3b3b3b3b3b3.dajajajajaj.daj.d.d.d.d.dbu#RbubTbT#R#R.B.Ba1a1.y.yaIadadaRaRaRaRaR.U.U.k#9.z#O.aaw.D#U.g.g.S.S.S.S...................S.g.g#U.Daw.a.z.k#Y.UaRaRaR#Y#YaG#9aC#Oaw.D#U.g#U#UaH#ZbN#ybraa#h.Q.Q#v.saTbaaQaQa3bybLau.3b3ajaj.daja4a4a4a4#ia4a4",
+"a4#ia4a4.daj#iaj.dajbub3.3.3bLbL.o#0bybX#jaV.b#P#PaD#e#eaJaB.7.vaFaFbrbnbnb.b.anbjbJ#VayayaC#O.aaw.D#U.g.g#C#C#CaKbsaKaKaKaK#5aK#5aK#5#5.MaK.M.Mbsbsbs.5.5#U.D.a#O.zay#8afbJ#Jan.Pb0#6.uatbDaU.naH#U#U.g.g#U.D#O#9#Y.UaR.UaIay.BbTbu.3bLbLaubLau.3aub3au.3b3au.3b3aub3.3b3b3.3b3bub3ajb3b3.daj.db3aj.dajbu.dbububTbubT#RbT#RbT.B.B#pa1a1.y.yaIad.UaRaRaRaRaR.U#Y.k#9.z.a.a.D.D#U.g.g.S.S.S.S...S.....S...S.S.S.g#U.Daw.a#O#9.k#Y.UaR.U.U#Y#caG.8aC.aaw.D#U#U.g.D.n.B#6#Wbq#hbebfa7#vblaTbaba#ja3.obLaub3buaj.da4aj#ia4#ia4a4a4#i",
+"a4a4a4a4a4a4ajajaj.db3b3.3.3bLbL.o.obybyaVaVaV#P#P#PaD#e#e#eaB.7.v#7aF#B#B.Hb.b7.PbjbJ#dayay.8.aawaw.D#U#U.g.gbo#C#CaKbsaKaKaKaKaK.MaKaKaK.MbsaKbsbs.5.g#a.D.a.a.8aG.yafbJ#Jan.PbIb0.uat#.#R.naz.D#U#U.g.g#U.a.z.k.UaR.UaI.y#p#RbuaubLbLbLbLaubLau.3au.3auau.3aubLaubLaubLau.3b3b3.3b3b3b3b3b3b3.db3bub3.dbubu.dbububububTbTbT#R#R.B#pa1.y.yaIaIadaRaRaRaRaR.U#Y#Y#9#9#O.aaw.D#U#U.g.g.S.S.S.S.S.S.S.S.S.S.g.g#U.D.D.a#O.z.k#Y.UaRaR.U.U#Y#caG.8aC.0aw.D#U#U#U#a#Z.6aZbraa#hbe.Q.e.sblaTbaaQa3b5albLaub3b3ajajaj#iaja4a4#ia4#ia4",
+"#ia4.da4ajaj#iajb3b3bub3.3aubLbL#0.obXbyaV.b.b.b#PaDaDaD.O#eaBaB.vaF#7aFbrbn.Hb.b7anbjbW#d#d.I.8#Oawaw.D#U#U.g.5bobo#C#C#CbsaKbsaKbsaKbsbsaKbsbs.5.gaE.D.D.a#O.8aG.yafbJ#Janb7bIaZbBb4at#.#R.naH.D#U.g#U.Daw#O.k.UaR.Uad.y#p#Rbu.3bLalalalaubLauauaubLau.3aubLaubLbLaubL.3aubLau.3b3aubub3b3b3b3b3b3bub3bububububububTbubTbT#RbT.B.B.Ba1a1.y#8aIadaRaRaRaRaRaR.U#Y.k#9.z#O.aawaw.D#U#U.g.g.S.S.S.S.S.S.g.g.g#U#U.D.a.a.z.k.k.U.UaRaR.U#YaIaGaG.8.0.a.D#U#U#U#a.n.B.ubn.Y#hbe#F#S#v#gbl#DbaaQa3byalauaubub3.daj.da4.da4#ia4#ia4a4",
+"a4a4a4aj#iajajaj.dajb3.3b3.3bLbL.o.obyby#j#jaV.b.b.baDaDaD#e.OaBaB.v.v#7brbrbnbnb.b7an#JbW#d.y.I.8.0.aaw.D#U#U.g.g.gbobo#Cbo#C#C#C#C#C#C#C#C.g.5.g#U#Uaw.a.a.zaG.yafbJ#Janb7bIaZb0bBakbP#R#iaH#a#U#U#U#U.D#O#9#Y.UaRad#cayaUbu.3alaualalaualalbLbLbLbLau.oau.obLalbLbL.oaubLbLauaubLaub3.3b3.3b3bub3bub3bub3bubu.3bu.3apbububTbTbT#R.B#p#p.y.yaIaIadaRaRaRaRaR.U#Y#Y.k#9.z#O.aaw.D.D#U#U.g.g#U.g.g.g.g.g#U#U#Uaw.a.a.z#9.k#Y.UaRaRaR.UaI#caG.I.8.0aw.D#U#U#UaH#ib2aZaFaabh#Lbf.e#gbl.ZaT.Ta3a3b5bLbLaub3b3aj.daj.da4#i#ia4#ia4#i",
+"#iaj#iaja4.dajajb3b3bub3b3bL.3bL.o.obybyaV#j.b.b#P.1aDaD#4#e.O.OaBaB.v#7#7brbr#Bbnb.b7anbjbW.h#d.I.8#O.aawaw.D.D#U#U.g.g.gbobobobo#Cbo.5.g.5.g#U#Uawaw.a#O.8ay.yafbJ#Janb7bI#yaZ#nakbP#.#i.naH.D#U.g#Uaw.a#9#Y.UaR.UaIay#pbu.3aubQalalalalbLalalalalbLal.o.o.o.o.o.o.o.o.obLau.obLaubLauau.3b3aub3b3au.3b3.3.3.3.3.3bu.3.3apbubTbTbD.B.Ba1a1.y#8aIad.UaRaRaRaRaR.U#Y.k#9.z#O#Oawaw.D.D#U#U#U#U#U.g#U#U#U.D.Dawaw.a#O#9.k#Y.UaRaRaR.U#YaI#cay.IaC.0aH.D.D#U#aaz#p.u#W.Y#hab#Fbv#v#g#H.Z#D.Ta3a3alalaub3b3buaj.daj#iaj#i#i#ia4.d#i",
+"a4.da4.dajaj.daj.db3b3.3au.3aubL.o.obyby#j#j#j.b.b.b.1.1aD#4aD.O.OaB.v.v#7#7.Y#B#B.Hb.b7.P#JbW#dayay#ZaC.aawaw.D#U#U#U.g.g#U.g#U.g.g.g.g.g#U#U.D.Daw.a#O.8ay.yafbJbjanb7b.#y#W#nb4b4bPbT#iaz#a#U#U#U.D.a.z.k.UaR.UaIay#pbub3aual.Kal.KalalalalalbLalalbyalbyalbyby.oby.o.o.o.oalbLaubLau.3auau.3au.3b3.3au.3b3.3.3.3.3.3.3.3.3bTbTbT#R.B.Ba1ay.y#8aIadaRaRaRaRaRaR.U#Y.k.k.z#O#O.aawaw.D.D.D#U#U#U.D#U.D.Dawaw.a#O#9.k#Y.U.UaRaRaR.UaI#cay.8#ZaC.0aH.D#U#UaH.nbD#n#Baaab#F#F.eag#H.Z.Z#D.Ta3b5alauaub3b3b3aj.daj#i.da4.d#i.da4#i",
+".da4.daj.dajajb3b3b3bub3au.3bLalbL.obyby#j#j#j.b.b.b.1aD.1aD#4#4.O.OaBaB.v#7#7.Ybr#B.Hb.b7.P#JbW.h#d.I.8aC.0.aawaw.D.D#U#U#U#U#U#U#U#U#U.D.D.Daw.a.aaC.8.y.y.RbJbjanb7b.#WaZ.i#nb4.Jap#R.naH#a#U.D.Daw#O.k#Y.U.UadaG#p#Rb3aubQ.Kal.Kalalalalalalalalbyb5byby#jbybybybybyby.o.o.o.oaubLauaubLau.3auau.3au.3au.3au.3.3.3.3.3ap.3.3bTbTbT.B.B#pa1.y.yadadadaRaRaRaRaR.U.U.k.k#9.z#O#O.aawawaw.D.Daw.D.D.Dawaw.a.a#O#9#9#Y#Y.UaRaRaR.UadaI#cay.I#ZaCaHaw#a#a#aaz#Rak#W#7#hab#FbUag.F#H#Hb#.T.Ta3b5alalb3aubub3.daj.d.d.d#i.d#i#i.da4",
+"#i.daj.dajajbub3bub3b3.3auaubLbL.oalbyby#j#j#jaQ.b.b.b.1.1.saD#4.O.O#wa8#o#o#7#7.Y#B#Bbnb.b7.PbjbW.h#day.IaCaC.aawawawaw.D.D.D.D.D.D.D.D.Daw.a.a.a.8aG.y#d#VbJbjanb.b..H#W.i#na2bFbPbT#iaz#a.D#U.Daw#O.z#Y.UaR#Y#c#paUajaubQ.K.KbGbGb5b5b5b5b5b5byb5byby#jby#j#j#jby#jbybybybyal.oal.oalbLaubLauau.3auauau.3au.3bLau.3bL.3.3.3.3.3bTbTbT.B#pa1ay.y#8aIadaRaRaRaRaRaR.U#Y#Y.k#9.z#O#O#O.aawawawawawaw.a.a#O#O.z#9#9#Y#Y.UaRaRaRaR.UaI#cay.I.I#Z.0aH#a.D#a#a#ibDbBaFaaab#Lavbvag.F#HaO#D.T#ra3bGalauaub3b3buaj.d.d.d#i.d#iaj.d#i.d",
+".daj.dajaj.db3b3b3b3aub3auaubLalal.ob5by#j#j#j.baQ.bba.1.1.1.s#4#4#4#waBa8.v#o#7bq.Ybrbnbnb.b7.PbjbW.h.hayayaCaCaC.a.aawawawaw.Dawawaw.a.a.aaCaC.8ay.y#VbW#Jbjb7b.b.bn#W.i.iax#q.Jap.d#iaz#a.D.D.D.a.z.k.U.U.U#cayaUbu##bQ.K.KbGbGb5b5bGb5b5b5b5a3#j#j#j#j#j#j#j#j#j#j#jbyb5byby.oal.oalauauaubLauauaubLauaubLaubLaubL.3bL.3bL.3.3bTbubT#R.B#pa1.y.yaIadaRaRaRaRaRaR.U.U#Y#Y.k#9#9#O#O#O#O.a.a.a.a.a.a#O#O.z.z.k.k#Y.UaRaRaRaR.UaIaI.yay.I.I#Z.naH#a#a#aazaUak#W.Y#h.XbibUag.F.FaOaOb#.T#ra3alalauaub3b3bu.d.d.d.d#i.d.d#i.d#i.d",
+".d.d.daj.db3b3b3b3b3.3au.3aualbLal.ob5byb5a3#jaQaQ.bba.b.1.1.1.s#4#4.O#w.Oa8#o#oa0.Y.Ybr#Bbn.Hb..PbjarbW#da1ay.I.8#ZaC.a.0.a.a.a.a.a.a.aaCaC.8ayay.y#VbJ#Janb7b..Hbn#W.7.i.Ea2bFb9ap#iaz#a.D.D.Daw.z.k#Y.U.UaIayaUajb3bQbQ#1bGbGbGbGb5b5b5a3b5#j#ja3#j#j#j#j.b#j.b#j#j#j#j#jbybyb5byal.oal.oalalau.oauauaubLauaubLaubLaubLbLbL.3.3.3.3bTbT.B.Ba1a1.y#8aIad.UaRaRaRaRaR.U.U#Y.k.k#9#9.z.z#O#O#O#O#O.z#O.z.z#9.k#Y#Y.UaRaRaRaR.UadaI.yay.I#p#Z.n.0aH#a#a#aa4bDbBaFa0ab.Xbibvag.FbkaO#Db#.T#rb5.Kauauaub3bub3.daj.d.d.d#i.d#i.d.d.d",
+".daj.dajb3bub3bub3aub3auauaubLalalalbyb5#j#ja3aQaQaQ.bba.1.1.s.1.s#4#4a7#wa8a8#o#7a0bq.Ybr#Bbnb.b.bIbjarbW.h.ha1a1.I.I.IaCaCaCaCaC#Z.8.I.8ayay#d#dbW#Jbjanb7b..HbnaF.7.iax.E#q.Jap.da4az#a.D.Daw#O#9#Y.U.U#YaG.I.db3##aq#1bGbGbG#rb5#ra3a3b5a3a3#jaQaQ.baQ.b.b#j.b#j.b#j#j#ja3byb5byalal.oalal.oalaual.oaualau.oaubLbLbLbLaubLbL.3.3apbubTbT.B#pa1ay.yaIaIadaRaRaRaRaRaR.U.U#Y#Y.k.k#9#9#9.z.z.z.z.z.z#9#9.k.k#Y.UaRaRaRaRaR.UaI#8ayay#paU#Z.nazaH#a#aa4#RbP.i#7#h.Xbiavag#MbkbkaOb#aN.T#rbGalalaub3b3b3bu.d.d.d.d.d.d.d.d.d#i.d",
+".d.dajbub3b3b3b3aub3auauaualbLalal.ob5b5a3a3aQ#jaQaQbabababaaT.s.s.s#4#4#w#wa8a8#o#oa0bqbqbr#Bbn.Hb.b7.PbjarbW.h#d#da1ay.Ia1.I.I.I.I.Iayaya1#d#VbW#Jbjb7b..HbnbnaF.7.7aJ.E#qbFb9bu.daz#a.D#aaw#O#9.k.U.U#Y#c#p#iaj##aq#1bYbYbG#rbGa3#ra3a3aQ#jaQaQ.baQ.b.b.baQ.b.b.baQ#j#j#jbya3byb5b5byb5alalalalalalalaualbLalbLalalalalbLbLaubLbL.3.3bubT#R.B#pa1.y#8aIad.UaRaRaRaRaRaR.U.U#Y#Y.k.k.k#9#9#9#9#9#9#9.k.k#Y.U.U.UaRaRaRaR.UaIaI.yay#p#paUaU.naHaz#aaz#iapbB.iaaab.Xbibv#M.F#GaO.wb#aN#rbGb5.Kauauaub3bub3bu.d.d.d.d.d.d.d.d.d.d",
+"bub3bub3bub3b3aub3auauauaubLalalalb5b5bya3a3a3aQaQaQaQbaba.1aT.1aT.s.sa7#4#w#wa8.m#oa0a0bqbq.Ybrbn.Hb.#ybIbjararbx.h#da1#da1#da1a1a1#d#d.h#VbW#J.Panb7b..Hbn#BaFaF.7aJax.E#q#0bL.d#iaz#aaHaw.aaC.k#Y.U#Y#cay#Zb3##aq#1#1bY#raW#r#ra3#ra3a3a3aQaQaQ.bba.bba.b.b.baQ.baQ.ba3#ja3#jb5#jb5b5albyalalalalalalalalalalalalaubLalalaual.3au.3.3.3bTbT#R#pa1a1.y#8adadaRaRaRaRaRaRaR.U.U.U#Y#Y.k#Y.k.k.k.k.k#Y#Y#Y.U.UaRaRaRaRaRaRaIaI.yaya1#paU#Z.n.naz#aazaz.dbP#n#7bh.Xbpavac.F#X#G.wb#b#aN#r#r.Kalauaub3b3bubu.d.d.d.d.d.d.d.d.d.d.d",
+"buajbub3b3b3b3.3auauauaualalalalalb5b5b5a3#ja3a3aQaQaQbababaaTaT.sbl.s.sa7a7a7.Q#w.m.m#oa0bqbq.Ybr#Bbnb.b.bIbI.P#JararbxbW.h.h.h#V.hbWbWararbjanb7b..Hbn#BbraF#7.7aJ#e.EaVbXb9.3.dazaH#aaHawaC#9.k.U#Y#YaG#Za4bEaqbM#1bYbY#r#r#r#r#ra3a3aQaQaQaQba.bba.1.b.1ba.1.baQ.baQ#jaQ#ja3#ja3b5byb5alb5b5alalalalalalalalalalalalalalaualbLbLau.3.3bubT#R#R#pa1.y.y#8aIad.UaRaRaRaRaRaRaR.U.U.U#Y#Y#Y#Y#Y#Y#Y#Y.U.U.UaRaRaRaRaRaRadaI.y.ya1#p#paUaU#iazaz.LazajbTb4.7a0ab.X#f#b#M#Xbk.w.w#AaNaN#rbGalbQauauaub3b3b3.dbu.d.d#R.d.d.d.dbu.d",
+"bub3b3b3b3auauauauauauaualalalalb5b5b5a3a3a3a3aQaQ.TbabababaaTaTaTbl.s.s#va7a7#w.Qa8.m#o.ma0aabq.Ybr#Bbnbnb.b.bI.P.Pbjararararar#Jar#Jbj.Panb7b.b.bnbn#BbraF#7.vaJaJ.E#PaVbXb9.da4az#aaHawaC.z#c.U.U#YaG.I.dbEbVaq.pbYaWaWaW#r#ra3.T.TaQ.Tbaba.b.1ba.1.1ba.1.bba.bbaaQaQaQ#ja3#ja3b5a3b5b5b5b5b5b5b5alb5alalalalalalalalalalalalaualaubL.3.3bubT#R.B#pa1ay.yaIad.UaRaRaRaRaRaRaR.U.U.U.U.U#Y#Y.U.U.U.U.UaRaRaRaRaRaRaRadaI#8.ya1#p#R#RaU#i.nazazaza4bubPaxaF#hbpbpavac.F#X.w.w.wb#aN#r#rbG.Kalauaub3b3bubu.d.dbu.d.d.d.d.dbu.db3",
+"b3bub3.3b3aub3auauaualaualalalb5b5b5a3b5a3a3.Ta3.TaQ.TaQ#Dba#DaTaTaTbl#g.s.s#va7a7.Q.Q.m.ma0a0aabqbq.Ybr#Bbn.H.Hb.bIbIbIbI.Pbj.Pbj.PbIbIb7b..H.Hbn#Bbr.Y#7.v.vaB#e#eaDaVaVb9.3ajazazaHaH.0.z#c#Y#Y#Y#c.I#iajbVaq.pbzbzaWaWaW.T#r.T.T.TaQaQbabababa.1.1.1.1.1ba.1ba.baQ.baQaQaQa3a3a3a3a3a3b5b5b5b5b5b5b5b5b5.Kb5.Kal.Kal.KalbQalalaualauau.3.3bubT#R#p#pay.y#8aIaI.UaRaRaRaRaRaRaRaRaRaR.UaR.U.U.U.U.UaRaRaRaRaRaRaRadaI#8.ya1#p#p.B#R#R#ia4a4aza4ajapb4.7a0abbp#f#b#M#X#G.w.w#A#AaNaWbGbG.KbQauaub3b3bub3.dbu.d.d.d.dbu.dbuajbu",
+"b3b3b3auauauauauauaualal.KalbGb5b5b5a3#ra3a3a3.TaQ.TaQ#Dba#DaT#DaTaTblbl#g#v#va7#Sa7.Q.Q.m.m.m#haabqbq.Y.Y#B#Bbnbn.Hb.b.b.#yb.bIb.#yb.b..Hbnbn#Bbrbr.Y#7.v.vaB#e#eaD#PaVbX.3bua4azazaH.0#OaG.kad#Y.kay#ZajbV.4bM.pbzaWaWaWaN#r.T.T.TaQ#Dbaba.1.1aT.1aTba.1ba.1ba.bbaaQaQaQaQa3a3a3a3a3a3b5b5b5b5b5b5bGb5bGb5b5albGb5al.Kalalal.KalbQalauauau.3bubu#R#R#pa1ay.y#caIad.U.UaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRadaIaI.ya1#p.B#R#R#R.d#ia4aza4a4bu.Ja2.v#h.Xa#bRac.F#G#G#I#I#A.laNaW#r.KalbQauaub3.3b3.dbu.dbu.dbu.dbububub3bu",
+".3b3aub3auauauaualbQal.Kalalb5bGb5#rb5a3#ra3#ra3.T.T.T#D#D#D#D.Z.Z.ZaTblbl#g.s#va7#S#S.Q.Qbe.m.m#h#haabqbq.Y.Ybr#B#Bbnbn.H.H.H.H.H.Hbnbnbn#Bbr.Y.Ybq#7#oaBaB.O.OaD.baVbX.obuaja4azaH.0aCaG#caI#Y#YaG#Za4.CbVbM.pbz#k#k.l#raNaN.T.T#D#DbabaaTaTaTaTaT.1.1aT.1ba.1bababaaQaQa3aQaQa3a3a3a3a3a3bGa3bGb5bGb5bGb5bGbGalbGb5.Kb5bG.KalbQalal.KbLauau.3bubT#RaU#pa1ay.y#8aIadad.UaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRadadaI.ya1a1.B.BbTbT.d.d#ia4a4a4b3apb4aJ#7.XbpbgbU#M#X#G#I#I#A#A.laWaWbG.K.Kau##b3b3b3bubub3.dbu.dbu.db3.db3bub3",
+"b3auauauauaubQalaual.KalbGb5bGb5#rb5#ra3#ra3.T.T.T.T.T#D.T#D#D#D.Z.Z.Zblblbl#g#v#v#v#S.Q.Qbf.mbe.m#h#haaaabqbq.Y.Ybrbr#B#B#B#B#B#B#B#Bbrbr.Ybq.Ya0#7#o#oaB.O#4aDaD.baVbybLbua4azazaH.0.8aG#Y#Y#YaG.I.n.CbV.4bMam#k#kaW.laNaN.T.T#D#DbabaaTaTaTaT.saT.saT.1aTaTbababaaQaQaQaQ.Ta3.Ta3#ra3#ra3#rb5#rb5bGa3bGbGb5bGb5bGbGb5.KbGalbG.KalbQalbQauauaubububu#R.B#pa1ay.yaIaIadad.UaRaRaRaRaRaRaRaRaRaRaRaRaRaRaRaR.UadaI#8.yay#p.B#RbTbTbu.d.da4aja4aj.3.J.E.v#hbpa#avac.F#G.w#I#Ibb#A.laW#rbG.KbQauauaub3b3b3bu.db3.db3.dbubub3b3b3b3",
+"auauauaubQalau.K.Kal.Kb5bGb5bG#rb5#r#ra3#r.T#r.T.T.T#D.T#D#D#D.Z#D.Z.Z.Z#Hblbl#g#v#v#v.e#Sbf.Qbfbebe#h#h#haabqbqbqbq.Y.Y.Y.Ybr.Ybr.Y.Y.Ybqbqbqa0a0#oa8#w.O#4#4aD.b.bby.o.3.da4azaz.0aCaG#c#Y#Y.k.8#Z#s#TbwbMamb6#k#kaWaNaNaN#Db##D#Dba.ZaTaTaT.saTaTaTaTaTaT.1bababaaQba.T.TaQ.Ta3a3a3#ra3#ra3#ra3#rbG#rb5#rbG#rbGbGbGbGbGbG.KbG.K.K.KalbQalauauau.3bubu#RaU#pa1ay.y.yaIadad.U.UaRaRaRaRaRaRaRaRaRaRaRaRaRadadaI#8.ya1a1.B.BbTbTbu#Rbu.daja4ajbub9#qax#o.Xbpbgav#M#Xbc#I#Ibbbb.l.laWbYbG.K.KbQ##aub3b3bub3b3.db3bubub3bub3buaub3",
+"auau##auau.K.Kal.KbGbGbGbGbG#ra3#r#r#r#r.T#r.T.T.T.T.T#D#D#D#D#D.Z.Z.Z#H#H#H#H#g#g#v#v#v#S#S.Qbfbfbebebe#h#h#haaaabqbqbqbqbqbqbqbqbqbqaaaaa0#o#o#oa8a8.O#4#4.1.1.baV.obLbua4a4az.naCaGaGaI#Y.kaG#Za4#Tbw.4asb6#k#kaS.l.laNaN#D#D#D.ZaTaTaTblaTblaT.saTaTaTaTaTbabababa.TaQ.T.Ta3.T.T#r#r#r#r#r#r#ra3#rbG#rbG#rb5bGbGbGbGbGbGbGbG.K.K.K.KbQbQal##aub3bubu#R#RaU#payay.yaIaIaIadad.U.U.UaR.UaRaRaR.UaR.UadadaIaI.y.yaya1.BbTbTbT.3bTbubuajajajbu.3#0ax.v.m.Xa#aPac.F#G#I#Ibbbbbb.l.laW#r#1.KbQauaub3aub3b3bubub3bub3b3b3b3b3aub3au",
+"auau.Kau.K.Kal.KbGbGb5bGbG#rbG#r#r#r#r.T#r.TaN.TaN.TaNb#.Tb#b##DaO#DaO.Z.Z#H#H#H#g#g#g.e#v.ebv.Qbfbfbfbebebhbh#hbhaa#haaaaaaaaaaaaaaa0#ha0.m.m.ma8#wa7a7#4.1.1.b.bby.o.3b3a4az.naC.IaG#c#Y.k#9.Iaz#s#T.4asamb6a6#k.l.laNb#b#b##D.Z.Z.Z.ZblblblblblblaTblaTbaaTba#Dba.T#D.T.T.T.T.T#r#r.T#ra3#ra3#r#r#r#r#r#rbG#rbG#rbGbGbGbGbGbGbGbG.K.K.K.KbQbQauauaub3bu#R#RaU#pa1ayay.yaIaIaIadad.Uad.U.U.U.UadadadaIaIaI.y.ya1#p.B#RbT.3bT.3.3bubuaj.db3.3#0bFaJ#o.Xbpbg#b#M#X.w#I.G#EbbaSaSaWaWbY.K.KaubQ##aub3b3b3b3b3.db3b3bub3aub3b3auau",
+"bQau.K.Kal.K.KbGbGbGbG#r#r#r#r#r#r#r.TaNaN.TaN.TaNb#.Tb#b##Db#.Zb#.ZaO.Zbk#H#H.F#H.F#gag#v.e#S#SbUbfbfbfbebe#Lbebhbhbhbh#h#h#h#h#h#h#h.m.m.m.m.Q#wa7#4#4.s.1.1aQ#j.obLb3aj#iaz.n#Z.8#caI.k.k.I.naz#Tb1asasbHb6a6aS.l.lb#b##Db#.Z.ZaTaT#HblblblblblblblaTaT.ZaT#Dba#D#D.T.T.T.T.T#r.T.T#r#r#r#r#r#r#rbG#rbG#rbG#rbG#rbG#rbGbGbGbG.KbG.K.K.K.KbQalbQauaub3b3bubu#RaU#p#payay.y.yaIaIaIaIadaIadaIadaIaIaIaI.y.y.ya1#p.BbTbTap.3.3.3.3bub3b3b3bubLbX.EaB.mbpa#aPbv.F.w#I#E#EbbbbaS.l#kaWbY.K.KbQbQaub3b3b3b3b3b3b3b3b3b3b3b3auau##au",
+"au.KbQ.K.K.KbGbGbG#rbG#r#r#r#raN#raNaN#raNaNaNaNaNaNb#.Tb#b#b#b#aOb#aOaOaO.Zbk#H#H#g.F#gag#vag.e#S#Sbfbfbfbfbebe#Lbebebhbebhbebhbe.mbebe.m.Q.Q#wa7a7.s.s.1ba.baQby.o.3b3a4#i.n#Z.IaG#c#Y.kaG#ZazaX.fb1as.Nb6a6#k.l.l#AaNb#b#.Z.Z.Z.Z#Hbl#Hbl#HblblaTblaT.ZaT#D.Z#D#D.T#D#D.TaN.TaN#raN#raNaNaW#raW#r#raW#raW#raW#rbY#rbYbGbYbGbYbGbYbGbY.K.K.KbQbQbQ##aub3bubu.dbTaU#p#payay.y.y.y#c#8aIaIaIaI#8aIaI.y.y.ya1#p#p.BbTbTbu.3.3.3.3.3.3b3.3b3bL#0#qaJ#o.Xa#bg#bag#X#I#I#E#E#E#EaS.laWaWbY#1bQbQ####au##b3b3b3b3b3b3b3aub3au##auaubQ",
+".K.K.K.KbGbGbGbG#raW#raW#raWaN#raNaNaNaNaNaNaNaNb#b#aNb#b#b#b#b#b#.ZaOaOaOaO#Hbkbk.F#H.F#gagag#v.ebv#SbUbfbfbfbfbe#Lbe#Lbebebebebfbe.Qbf.Q.Qa7a7#v.s.sbl.1baaQ#jbyaub3.da4.n.n.IaG#c#c.k#9.8.n.L#Tb1b1ambHb6.WaSaS.l#Ab#b#aOaO.Z.Z#H#Hbl#g#Hbl#H#H#H.Z.Z.Z.Z#D#D#D#D#DaN.TaNaNaN.TaNaN#raN#r#raNaW#raWaW#raWaWbGaW#rbY#rbY#rbYbYbGbY.K#1.K#1#1.KbQbQbQ##auaub3bu.d#R#RaU#p#payayay.y.y.y.y.y.y.y.yay.ya1#p#p#p#RbTbu.3.3bLbLbLau.3b3b3au.3.obX#eaB.mbpa#aeac.F.w#I#E#E#E#EaSaSaSaWbYbY.K.KbQ##au##b3b3aub3b3aub3aub3##au##bQbQau",
+".K.K.KbGbYbGaWaW#raWaWaNaWaNaN.laNaNaNaNaNaNb#aNb#aNb#b#b#b#b#aOb#aOb#aOaOaOaObkaO#H.F.F.F.F#gagag.e.ebvbUbU#FbU#Fbf#Fbfbfbfbfbfbfbfbf.Q#S#Sa7#v#vbl.saTbaaQa3#jalbLb3aj#i#i#Z.Iay#c.k.k.8.nazaX.fb1bO.NbHa6a6aS.l#A#Ab#b#aOaO.Z#H#H#H#H#H#g#Hbl#Hbl.ZaT.Z#D.Z#Db##Db#.Tb#aN.TaNaN#raNaWaNaWaNaW#raWaWaWaWaWaWaWaWbYaWaWbYaWbYbGbYbYbYbYbY#1.K#1.KbQbQbQ####b3b3bu.d.d#RaUaU#p#pay#payayayayayayaya1#p#p#paUbTbTbu.3.3bLbLaubLaubLauaubLbLbX#P#ea8#La##Kavagbk.w#E#E#E#E.WaSaS#k#kbY#1#1bQbQbQ##b3####b3##b3##b3####aubQbQau.K.K",
+".KbYbGbY#raWaWaWaWaWaNaWaN.laNaN.laN.laN#AaNb#.lb##AaN#Ab#b#b#b##AaOb#aOaOaObkaObkbkbk#H.F.F.F#M#gagag.e.ebvbUbUbUbfbUbf#Fbfbfbfbf#S#S#S.e#v#v.s#gaTaTbabaaQ#jb5bLb3b3#i#i.n.Iay#c#c.k#9aC.n.L#lb1b1bO.NbHa6.WaSaS#A#AaOaOaO.Zbk#H#H#H#H#H#H#H#H#H.Z#H.Z.Z#D.Zb##Db#aNb#aNaNaNaNaNaN.laWaNaW.laW.laWaWaWaWaWaWaWaWaWbYaWbYaWbYaWbYbGbYbY.KbY#1#1bQ#1bQbQ##bQ##b3b3b3bu.d#RaU#RaU#p#p#p#p.I#p#p#p#p#p#p#R#RbTbubu.3auaubLalaubLauau.3aubL.oaV.EaBbebp#Kbgbv.F#Gbb#E#EaM#E.W.WaS#kaWbYbY#1bQbQ####bQb3##b3##au##au##aubQbQbQ.K.K.K",
+"bGbYbGaWbYaWaWaWaW.laN.l.l.l.l.l.l.l#A.l#AaN#A#AaN#Ab##Ab##A#A.wb##AaO.waO.waOaOaObkbkbkbk.F.F.F.Fagagagag.e.ebUbvbUbUbUbUbUbUbU#S#S.e.e#v#v#gblblaT.ZbaaQaQa3alaub3aj#i#i#Z.Iay#c.k#9.8.0.L#l.fbC.9bObH#ua6aSaS#A#A#AaOaOaOaO#H#H#H#H#g.F#H#H#H#H.Z.ZaO.ZaOb#b#b#b#b#aNb#aN.laN.l.laW.l.laW.laWaW.laWaWaWaWaWaWaWbYaWaWaWbYaWbYbYbYbYbYbYbY#1#1#1bQ#1aqbQ##bQ####b3b3b3.d.d.d#RaUaUaU#paU#p#paU#RaU.d#Rbubu.3auaubLaualalbLalaualbLbL.oaV#P#ea8#L#Ka#bRagbk.w#E#EaM#N.W.WaSaS#kbzbY#1#1aqbQbQ########bQb3######bQ##bQbQbQ.K#1.K",
+"bYaWaWaWaWaWaN.l.l.l.l.l.l.l#A.l#A#A.l#A#A#A#A#A#A#A#Ab##A#Ab##A#AaO#AaO#AaO.w.wbkaObkbkbkbk.F.F.F.F.Fagagagagagbv.ebv.ebv.e.e.e.e.e#v#v#g#g#g#Hbl.Zba#DaQa3b5bLaubuaj#i#Z.IayaG#c#9#9aCaz.L#la.bCbO.NbH#u.WaSbb#A#A.waOaOaObkbk#Hbk.F#H#H#H#H#H#HaO.ZaOb#b#b#b#b#b#aN.laN.laN.l.l.l.laW.l#kaW#k.l#kaW#k#kaW#kaW#kaW#kbYaWaWbYaWbYaWbYbYbY#1bY#1#1#1#1aq#1bQbQ######b3b3b3b3.d.d.d.d#R.d#R.d#R.d#Rbu.dbubub3auauaual.KbLalalbLalaubLalbyaVaD.O#Lbp#K#K#b.F.wbb.W.WaM.WaM.W.W#k#k#kbY#1#1bQaqbQ################bQbQbQbQ.K#1.KbYbY",
+"bYaWaW#kaW.l#k.l.l.l.l.l.l#A.l#A.l#A#A#A#A#A.l#A#A#A#A#A#A#A#Ab#.w#A.w#A.w.w.waO.w.waO#Gbkbkbkbk.F.F.F.F#g#Magagagagag.e.e.eag.eagagag#g#g#H#H#H.Z#D#D.Ta3b5b5aub3b3#i#iaU.Iay#c#9#9.8.0.LaXa5a.bCbO#3#u#u.WaSbb#A#A.waO.wbk#Hbk.Fbk#H.Fbk#Hbkbk.ZaOaOaOaOaOb#b#b#.l#A.l#A.l.l.l.l#k.l#k.l#k.l#k#k#k#k#k#k#k#k#k#k#kaW#kaWbz#kbY#kbzbYbzbYbzbYbY#1#1#1#1#1aqaqaq##########b3b3b3b3.dbu.d.d.d.dbububub3auauauaualbQal.Kal.KalalbLal.oby#j#P.Oa8#L#K#Kavagbk#Abb#EaMaMaM.W.WaSa6#kbzbY#1#1.Kaq##bQ##bQ######bQbQbQbQbQ#1#1.K#1bGbY",
+"aW#k#k.l.laS.laSaSaSbbbbbbaSbbbb#Abbbb#Abb#Abb#A#A#A#A#A#A#A#A.w#A#A.w#A.waO.w.w.w.w#GaO#Gbkbkbk#Xbk.F.F.F.F#M.Fagagag#M#gagag#g#M#g.F.F#H#H#H.Z.Z#D#DaQa3b5alau.3.d.daU.I.Iay#c#9.zaCaz#2#la5bCaobO#3#u#uaS.Wbbbb.w.w.waObkbkbkbk#Hbkbk#Hbk#HaOaOaOaOb#b#b##A#A#A.l#A.l.laS.laS#kaS#kaS#ka6#k#k#k#k#k#k#k#k#kbz#k#kbz#kbz#kbY#kbzaWbzbYbzbYbz#1bz#1#1#1aq#1aqaqbQaq########b3##b3b3b3b3b3b3b3b3b3##au####bQ.KbQ.Kal.Kalb5alalalalby#j#PaD.Obfa##K#K#b.FaObb.WaMaMaMaM.W.Wa6a6#kbzbz#1#1aqaqbQaq##bQ##bQbQ##bQaq.K#1.K#1bYbYbYaW",
+"#k#k.laSaSaSaSaSbbbbaSbbaSbbbbbbbbbbaSbbbbbbbb#Abbbb#Abb#A#Abb#A#A.w#A#A.w#A#A.w.w.w.w.w.w.w#G#Gbkbk#X#X.F.F.F.F.F.F.F#g#M.F.F.F.F.F#H#H.F#HaO.Z#D#D.T.Tb5b5auaub3.d#iaU.IayaG#9#9aC.0.L#2#l.AbC.9#3bH#u.W.WaSbb#A#A.waO.wbkbkbkbkbkbkbkbkbkbkaOaOaOaOaO#A#A#A#A.l#A.l.laSaSaS#kaSa6#ka6a6#ka6a6#ka6#ka6#kbz#k#k#k#kbz#k#k#kbz#kbz#kbz#kbzbYbzbz#1bz.p#1.p#1aq#1aqaqaqaq########bE####bE##########au##bQbQbQ.K.K.K.Kb5bGalb5alb5b5by.b.b.O.Qbia##Kavag.F#Abb.WaMaMaMaMaM.W.Wa6#kbzbz#1#1#1aqaqbQaqbQaqbQaqaqbQ#1#1#1#1bYbYbY#k#k",
+"aS.laSaSaSaSbbaSbbaSbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#Abbbbbb.wbb#Abb#A.w#A#I.w.w#A.w.w.w.w#G.w#G.w#Gbk#Gbk#X#Xbk.F.F.F.F.F.F.F.F.F.F.Fbkbk#HaO.ZaO#D.T.T#rb5b5auaubu.daU#p.IayaG#9.zaCaH#2.qa5.AbSb8#3bH#u#u.Wbbbbbb.w.w.w#Gbkbkbk#XbkbkbkbkaOaObk.w.w#A#A#A#A#A#AaSaSaSaSaSa6a6aSa6a6a6a6a6a6a6a6b6a6b6#kb6a6b6bza6bz#kbz#kbz#k#kbz#kbzbzbzbzbzbzbzbz#1.p#1.p#1bMaqaqaqaqaqaqaq##################bQ##bQbQ.K.K.KbGbGbGbGb5b5b5b5b5#j#j.baD#wbfbp#K#K#b#gaObb.W.W#uaMa9aM.W#ua6a6#kbzbz#1#1aq#1aqaqaqbQaqaqbQ#1#1#1#1#1bYbzaW#k#k#k",
+"aSa6aS.Wbb.Wbb.W#E#E#E#E#E#E.Wbb#Ebb#Ebbbbbbbbbbbbbbbbbbbbbbbbbb.wbbbb#I#Abb#A#I.w#I.w.w.w.w#G.w#G#G#G#Gbk#Gbk#Xbk#X#X#X#X.FbkbkbkbkbkbkaOaOaOb#b#.T.TbGb5alaub3.d.daU#ZayaG#9#9#O.0.L#2#l#t.AbCb8#3a9#u.W.Wbbbbbb#I.w.wbk.w#GbkbkbkbkbkaO#GaO.w.waO#A.w#A#A#AaSaSaSaSaSa6aSa6b6a6a6a6b6b6b6b6b6b6b6b6b6b6b6a6b6bzb6a6bza6bz#kbz#kbz#kbz#kbzbzbzbz.pbzbzbz.p.p#1.p#1.paqaqaqaqaqaqaqaq##aqbQbQaqbQaq#1.K#1.K#1bGbGbGbGb5bGb5b5a3#j.baD#4a8bi#K#Kav.e.F#AaS.W#ua9a9aMaM#u.Wa6a6a6bz.p.p.p#1aqaqaqaqaq#1aq#1aq#1#1#1bzaWbz#k#k#kaS",
+"aS.WaS.W.W#E.W#E#E.W#E#E.W#E#E#E#E#Ebb#E#E#Ebb#Ebbbb#Ibbbbbbbbbbbbbb#Abb#I.wbb#I#A#I.w#I.w#I.w.w.w#G.w#G#G#G#G#Gbk#Gbkbkbkbkbk#XbkbkaOaOaOb#b##DaN.T#rb5bGauaub3.d.d#p.IayaG.z.zaCaH#a.qa5#tbCaob8#3a9#uaM#Ebbbb#I.w.w.w#G#Gbk#G#Gbk#G.wbk.w.w.w#A#A#A#AbbaSaSaSaSaSa6#ua6#ub6#ub6bHbHb6bHb6bHb6b6b6b6b6b6amb6b6b6b6b6b6b6bzb6a6bzbz#kbzbzbzbzbzbzbzbz.p.pbz.p.p.pbM#1bM#1aqaqaqaqaqaqaqaqaqaqaq#1#1.K#1bYbGbGbGbGbG#rb5a3b5a3#jaQ.b#4#wbf#f#K#K#b#gaO#AaS#ua9aMa9a9aM#uaMa6a6bzbzbz.p#1#1#1#1aq#1aqaq#1#1#1.pbYbzbzbz#k#k#kaSa6",
+".W.W.W#E.W#E.W#E.W#E#E#E#E#E#E#E#E#E#E#E#E#E#Ebb.G#Ebb#Ebb#Ibb#Ibbbb#Ibbbbbb.wbb#I#Ibb#I.w#I.w#I.w#I#G.w.w.w#G#G#Gbk#G#G#G#GaO#GaO.waO.waOaOb#b#.T#r#rbGalaub3bu.daUaU.IaG.8#9#O.0#a#2.q#t#t#Qaob8#3a9#u.W.W#Ebbbb#I#I#G.w.w#GaO#G.w#G.w.w.w.w.w#A.wbbbbaSbbaS.W.W#u.Wa6#ub6#ubHbHambH.Nam.N.Nam.N.Nam.Nam.Nb6amb6b6b6b6b6b6b6bzb6b6b6a6bza6bzb6bzbzbzbzbz.pbz.p.p.p.pbM.pbM.pbM#1bM#1aq#1aq#1#1#1#1#1#1bYbYbYbY#rbG#rbGa3a3a3aQ.b.1#4#Sbia##Kav.e#Hb#aS.W#ua9a9a9a9aM#u#u#ua6a6b6bz.p.p.pbM#1bM#1#1.p#1.p#1bzbzbz#k#k#kaSa6.WaS",
+".W.W.W.W.W#N.W#EaM#EaM#E#E#E#E#E#E#E#E#E#E.G#E#E#E#E.Gbb#E#Ebb#Ebbbbbbbb#Ibbbb#Ibbbb.wbb#I#I#I.w#I#I.w#I#G.w.w#G.w.w.w#G.w#G.w.w.w.waO.wb#b#aNaNaN#rb5b5.Kaub3bu.daU#p.Iay.z.zaCaH#a#2aA#t#tbSao#3bZ#ua9.W#E#Ebb#I.w#I.w.w#G.w#G.w#G.w.w.w.wbbbbbbbbbbaS#E.W.W.Wa6#u#u#ubHbHbH.NbH.N.N.N.NbOambO.Nam.Nam.Nam.Namamb6amb6b6b6b6b6b6b6bzb6b6bzb6#kb6b6bzb6.pb6bz.pbz.p.p.p.p.paq.pbM#1.p.p.p#1.p#1#1bYbYbYbYbG#r#rbG#ra3#ra3a3a3aQ.1#4a7bf#f#Kae#bagaO#AaS#u#ua9a9a9a9a9aM#ua6a6b6bzbz.p.p.p#1.p#1.p.p#1.pbzbzbzbz#kb6#ka6.Wa6.W.W",
+"aM.WaMaM#N.WaM#N.W#N#E.W#N.W#N#E#E#E.G#E#E#E#E#E#E#E#E#E#E#I#Ebb#E#I#Ebbbbbbbbbbbb#Ibb#Ibbbb#I#I#I#I.w#I#I#I.w#I.w#I#G.w.w.w.w.waO.w.wb##Ab#b#aN.T#rbG.Kauaub3.d#RaU.I.IaG.z.z.aaHaE.qaA#t#QbSaob8bZbZaMaM.W#Ebbbb#I#I#Ibc.w#I#G.w.w#I.w#I#I.wbbbbbbaS.W.W.Wa6#u#u#ubHbHbH.N.N.NbObObO.9bObObObOasbObObOambOam.N.N.N.Nam.Namb6b6b6b6b6b6b6b6b6b6b6bzb6bzb6bzb6.pb6.pbz.p.p.p.p.p.p.p.p#1.p.p#1bz#1bzbYbYbYaWbYaW#r#r#r#ra3aQaQ.1.1#4a7bi#K#KaP.e#gb#.la6#ubZbZa9a9aMa9#u#u#ua6b6b6b6.pbz.p.p.p.p.p.pbz.pbzbzb6#ka6a6.Wa6.W.W.W.W",
+"aMaMaMaMaMaM#NaM#EaMaM#E.W#E#E#N#E#E.W#E.G#E#E#E.G#E#E#E#E#E#E.G#E#Ebb#E#E#I#Ebb#Ibbbb#Ibb#Ibb#I#I#I#I#I.w#I#I#I#I.w#I.w#I.w.w.w.w#A#A#Ab#.laN#r#rbGbGalauaub3.daUaU.I.8.8.z#O.0aHaE.qaA#taYbSb8bKbZa9#uaM#E#E#Ebb#I#I#I.w#Ibc.w#I#I.w#Ibbbbbbbb#E.W.W.W#u#u#u#ubHbZ.N#3.Nb8bObObObO.9.9.9as.9.9.9bOasbO.9bOambOambOam.NambHam.Nb6b6b6b6b6b6bzb6b6b6b6b6bzb6bzb6.pamambzambz.p.p.p.p.p.p.pbzbzbzbzbYaWbYaWaW#r#r#r#r#ra3.TaQaQ.1.sa7#F#f#Kaeavag.Z#AaSa6bHbZa9bZ#xa9a9a9#u#ua6b6b6b6bzam.p.p.p.p.pbzbzb6bzb6#ka6a6a6a6.W.W#uaMaM",
+"aMaMaMaMaMaMaM.WaMaM#EaM#E#N.W#E.W#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#Ebb#E#E#Ebb#Ebbbb#Ibbbb#Ibb#I#I#I.w#I#I.w#I#I.w#I.w#I#A#A#A#A#AaNaNaW#rbGal.Kaub3bu.daU#p.I.8.z.z.aaH#a#2aA.M#t#Qbtaob8bZa9a9aM.W#E#E.Gbb#I#I#I#I#I#I#I#I#Ibbbb#Ebb#E.W.W.W.W#u#ua9bH#3#3.Nb8bOb8.9ao.9bC.9.9bCbCbC.9b1.9b1.9as.9.9as.9bOambO.Nam.Nam.NambHamb6b6b6b6b6b6b6b6b6b6amb6b6bzambzambzamambzam.pbzbzbzbzbzbzbzaW#kaWaWaWaW#raNa3.T.TaQba.s#4#SavbgaeaPbvbl.Z.l#k#ubHbZbZbAa9a9a9a9#u#u#ub6b6b6b6bzamb6.pb6.pb6bzb6b6a6a6a6#ua6aM#uaMaMaMaM",
+"aMaMaMaMaMaMaM.WaM#E.W#E.W#E.W#E#E#E.W#E.W#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#Ebb#Ebb#E#I#Ebbbb#Ibb#Ibbbb#I#I#I#I#Ibb#I#A#Ibb#A#A#A#Ab#.laNaN#r#rbG.Kauauaubu.daU.I.I.8.z#O.aaHaE.5aAaAaYaYbSbK#3bZa9#uaMaM#E#E#E.Gbb#I#I#I#I#I#Ibb#Ebb#E#E.W.W.WaM#ua9#ubZ#3#3#3bOb8bOao.9.9bCbCbCbCa.b1b1b1a.b1bCb1bCb1.9as.9.9as.9bOambO.Nam.Nam.Nb6.Nb6bHb6b6b6b6b6b6b6b6b6b6b6b6ambzb6bzb6bzambzb6bzbzbz#kaW#k#kaWaWaWaN#raN#r.T.TaQbaaT.s#vbU#fbgae#b.e#Hb#.la6bHbHbZbZbAa9#xa9#u#u#ubH#ub6b6b6ambzb6b6b6b6b6b6b6a6a6#u#u.W#uaM#uaM#uaMa9",
+"a9a9aMa9aM.WaM.W.W.W.W#E.Wbb#E#EaS#E#E#E#E.W#E#E.W#N#E#N#E#N#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#E#Ebb#Ebb#E#I#Ebbbbbb#Ibbbb#I#Abb#Abb#A#A.l.laNaWaWbGbG.KbQaub3.daUaU.I.I.z#O#O.0#aaE.5aA.MaY#QbSaobK#3a9a9aMaM.W#Ebb#E.Gbb.Gbb.Gbb.Gbb#E#E#E#E.WaM#u#ua9bHbZ#3#3bOb8b8aobCbSbCbC.A.A.Aa..Aa..Aa.a.a.a.a.b1a.b1bCbCas.9.9.9.9bObObObO.N.N.NbH.Nb6.Nb6.Nb6b6amb6b6b6b6b6b6b6b6b6b6b6bzb6bzb6#kbz#kbz#kaW#kaWaWaNaWaN.T.T.T#Dbaba.s.s#SavaPaeaPbv#g.Zb##kb6bH#3#3bAbZbAbZa9a9a9#u#ub6bHb6b6b6b6b6b6b6b6b6b6#ua6#u#u#u#uaMa9aMa9.#a9aM"
+};
diff --git a/pixmaps/bat-0.xpm b/pixmaps/bat-0.xpm
new file mode 100644 (file)
index 0000000..81ae384
--- /dev/null
@@ -0,0 +1,178 @@
+/* XPM */
+static char * bat0[] = {
+"147 108 67 1",
+"      c #000000000000",
+".     c #090909090909",
+"X     c #969696969696",
+"o     c #9C9C9C9C9C9C",
+"O     c #1E1E1E1E1E1E",
+"+     c #F0F0F0F0F0F0",
+"@     c #FFFFFFFFFFFF",
+"#     c #C6C6C6C6C6C6",
+"$     c #474747474747",
+"%     c #212121212121",
+"&     c #E2E2E2E2E2E2",
+"*     c #414141414141",
+"=     c #0C0C0C0C0C0C",
+"-     c #272727272727",
+";     c #AAAAAAAAAAAA",
+":     c #808080808080",
+">     c #B4B4B4B4B4B4",
+",     c #1A1A1A1A1A1A",
+"<     c #DDDDDDDDDDDD",
+"1     c #EDEDEDEDEDED",
+"2     c #2A2A2A2A2A2A",
+"3     c #D7D7D7D7D7D7",
+"4     c #2C2C2C2C2C2C",
+"5     c #999999999999",
+"6     c #FBFBFBFBFBFB",
+"7     c #4A4A4A4A4A4A",
+"8     c #BDBDBDBDBDBD",
+"9     c #B2B2B2B2B2B2",
+"0     c #585858585858",
+"q     c #C8C8C8C8C8C8",
+"w     c #101010101010",
+"e     c #151515151515",
+"r     c #6C6C6C6C6C6C",
+"t     c #C0C0C0C0C0C0",
+"y     c #7F7F7F7F7F7F",
+"u     c #3F3F3F3F3F3F",
+"i     c #6B6B6B6B6B6B",
+"p     c #868686868686",
+"a     c #353535353535",
+"s     c #F4F4F4F4F4F4",
+"d     c #4D4D4D4D4D4D",
+"f     c #5D5D5D5D5D5D",
+"g     c #050505050505",
+"h     c #EBEBEBEBEBEB",
+"j     c #606060606060",
+"k     c #A2A2A2A2A2A2",
+"l     c #FFFF00000000",
+"L     c #FFFF77777777",
+"z     c #656565656565",
+"x     c #7A7A7A7A7A7A",
+"c     c #919191919191",
+"v     c #6E6E70707070",
+"b     c #A5A5A5A5A5A5",
+"n     c #CECECECECECE",
+"m     c #727272727272",
+"M     c #515151515151",
+"N     c #E6E6E6E6E6E6",
+"B     c #D0D0D0D0D0D0",
+"V     c #3B3B3B3B3B3B",
+"C     c #BABABABABABA",
+"Z     c #555555555555",
+"A     c #888888888888",
+"S     c #313131313131",
+"D     c #ACACACACACAC",
+"F     c #757575757575",
+"G     c #8C8C8C8C8C8C",
+"H     c #DADADADADADA",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                   .Xo                                                                             ",
+"                                                                   O+@#$                                                                           ",
+"                                                                    %&@@*        %=                                                                ",
+"                                                                     -&@;      .:@>                                                                ",
+"                                                                      ,<1     23@@2                                                                ",
+"                                                                       4@2   5@@67                                                                 ",
+"                                                                        89 0&@@@q                                                                  ",
+"                                                          w=eee         r@t@@@@>%                                                                  ",
+"                                                       %y9@@@@@@<u ipua=%@@@@@s df                                                                 ",
+"                                                     gy@@h5ffffjki<@@@@@3@@@3l@zx@t=                                                               ",
+"                                                    =9@c%=vvvvvve<+llll9@@@bllln.m@t,                                                              ",
+"                                                   a+@Mvvvvvvvvv.N3lLLll@@BlLLl@t u+@2                                                             ",
+"                                                  f@<avvvvvvvvO% m@lLLlq@1hlLLl>@, ,t@V                                                            ",
+"                                                 M@Cevvvvvv=Z#6@t061lll@ZA@llll;@,   3+2                                                           ",
+"                                                O+nvvvvvvvz@@@5c@@@3@@64 Z@&lll1&V;   #&                                                           ",
+"                                               ,s&,vvvvvvz@N0g   S% t@@z D@@@1N@iF@7 .-sG                                                          ",
+"                                               5@4vvvvvvv3s-        t@@q h@@@++5g=@n %$j@%                                                         ",
+"                                              f@Zvvvvvvvw@>         :@sZ @@&=     j@y 0=B#                                                         ",
+"                                             ghCvvvvvvvvv6>         r@; O+3;       b6 -02@f                                                        ",
+"                                             i@2vvvvvvMxm&B         x@k 7N<m       2@uvm bs                                                        ",
+"                                             skvvvvvvx@@@@@M        t@b X#qV        &5v*aO@z                                                       ",
+"                                            G@%vvvvvw1h2e<@F        #@G >X#4        Dovvr Dhg                                                      ",
+"                                           .1bvvvvvv7@i  4*g        t@0 hj<4        D8vvFg-@u                                                      ",
+"                                           u@OvvvvvvX@              t@7g@V3         CNgv7M &C                                                      ",
+"                                           ;&vvvvvvvnN             =&@4%@u&        .1>vvwf rs,                                                     ",
+"                                          ,@5vvvvvvvsD             O+@ 7#f9        %@0vvvrge@0                                                     ",
+"                                          Ss-vvvvvvw@o             a@@ AxDX        ;@vvvva% #t                                                     ",
+"                                          D<vvvvvvvvsZ             Z@n q$#j     io;@ivvvve$ :@                                                     ",
+"                                          B5vvvvvvvv6Z             x@# Be@S    ,6@@C.vvvvv- 4@S                                                    ",
+"                                          6ivvvvvvvvs0             D@:eBO+.     D@N=vvvvvv-g=+j                                                    ",
+"                                         w@2vvvvvvvvsk             #@j,ny<g     w1Hvvvvvvvvvv#5                                                    ",
+"                                         7@%vvvvvvvvh>             @@2%n>k       o@*vvvvvvvuv>H                                                    ",
+"                                         01vvvvvvvvvo@             @1 jtNd       a@yvvvvvvv-vm1                                                    ",
+"                                         bNvvvvv=.vv:@g           4@& f1@$        HXvvvvvvvdv2@%                                                   ",
+"                                         bNgv,vvOgvv*@V           m@; 0@@g        q3vvvvvvv2w @j                                                   ",
+"                                         ;#vvgvuvvvv.hD           jH- r@H         qHvvvvvvv.d 39                                                   ",
+"                                         DkvvvOgvvvvvD@,           g  5@p         3kvvvvvvvvi ;q                                                   ",
+"                                         Dbvvvz.0r0ev*@j              =0.         @mvvvvvvvvf=yn                                                   ",
+"                                         Dkvvm@@@@@@o-Nt                         a@%vvvvvvvv-%i6,                                                  ",
+"                                         Dkv.@@;2e7C@+h@V                        chvvvvvvvvv,*21e                                                  ",
+"                                         Dkvy@x     *<@@k                        #8vvvvvvvvv%c-@2                                                  ",
+"                                         DovsH       .b@@2                      e@MvvvvvvvvvgF=@Z                                                  ",
+"                                         DD-@d         B@t                      j@vvvvvvvvvvvk @M                                                  ",
+"                                         ;Ha@%         -N@S                     C6vvvvvvvvvvvA sf                                                  ",
+"                                         x3:@           A@3.                   ,@DvvvvvvvvvvvX 6c                                                  ",
+"                                         dHi@           a@q.                   f@Zvvvvvvvvvvvx #D                                                  ",
+"                                         d&4@            u,                    DhgvvvvvvvvvvvXS59                                                  ",
+"                                         71a@e                                 @pvvvvvvvvvvvvZek9                                                  ",
+"                                         .@X@V                                F@evvvvvvvvvvvv0,o9                                                  ",
+"                                          @C@iOX                             %@Bvvvvvvvvvvvvvm4oC                                                  ",
+"                                          @B@5S@                             o@fvvvvvvvvvvvvv5wA@                                                  ",
+"                                          #tG3S@                            ,+1vvvvvvvvvvvvvvm*Z@                                                  ",
+"                                          :Hu@7@                           -n@8udM*gvvvvvvvvvi7$@                                                  ",
+"                                          a@m@i@   m=                     gH@@@@@@@@+nk*vvvvvXpa@-                                                 ",
+"                                          -@N@t@   @-                      o@+:aO,fFG36@sAOvvr8S@a                                                 ",
+"                                          .&@@@@   @O                      =ja        ,d9@6uvCyOsa                                                 ",
+"                                           y@@@@  46                                     S3@VbzZNV                                                 ",
+"                                           .9@@6  Xk                                      -@<krfNa                                                 ",
+"                                            ,@@@ w@*                                       $@@D5@a                                                 ",
+"                                             o@@;tH                                         d@@1@S                                                 ",
+"                                             a@@@hS                                          k@H@0                                                 ",
+"                                             u@6AO     ge                                    -@@@k                                                 ",
+"                                              +:       cC                              f.     t@@q                                                 ",
+"                                              r@a     $N*                             gH0   7C@@@p                                                 ",
+"                                               F@x,=0>1*                               x<dMC@18@@4                                                 ",
+"                                                *n+sn:                                  D6hqf i@;                                                  ",
+"                                                  gg                                     .    8@M                                                  ",
+"                                                                                             ,@@4                                                  ",
+"                                                                                            %+@q                                                   ",
+"                                                                                        f-  8#3y                                                   ",
+"                                                                                       ,@$%8+46Z                                                   ",
+"                                                                                       d@@@9 c+                                                    ",
+"                                                                                        ZiO  47                                                    "};
diff --git a/pixmaps/bat-1.xpm b/pixmaps/bat-1.xpm
new file mode 100644 (file)
index 0000000..a5c2074
--- /dev/null
@@ -0,0 +1,178 @@
+/* XPM */
+static char * bat1[] = {
+"147 108 67 1",
+"      c #000000000000",
+".     c #1A1A1A1A1A1A",
+"X     c #1C1C1C1C1C1C",
+"o     c #A9A9A9A9A9A9",
+"O     c #FFFFFFFFFFFF",
+"+     c #A1A1A1A1A1A1",
+"@     c #F9F9F9F9F9F9",
+"#     c #3E3E3E3E3E3E",
+"$     c #AEAEAEAEAEAE",
+"%     c #A7A7A7A7A7A7",
+"&     c #3B3B3B3B3B3B",
+"*     c #B9B9B9B9B9B9",
+"=     c #E7E7E7E7E7E7",
+"-     c #E8E8E8E8E8E8",
+";     c #2E2E2E2E2E2E",
+":     c #7F7F7F7F7F7F",
+">     c #797979797979",
+",     c #B7B7B7B7B7B7",
+"<     c #656565656565",
+"1     c #262626262626",
+"2     c #BFBFBFBFBFBF",
+"3     c #B3B3B3B3B3B3",
+"4     c #515151515151",
+"5     c #0B0B0B0B0B0B",
+"6     c #171717171717",
+"7     c #D9D9D9D9D9D9",
+"8     c #4F4F4F4F4F4F",
+"9     c #050505050505",
+"0     c #EDEDEDEDEDED",
+"q     c #373737373737",
+"w     c #4A4A4A4A4A4A",
+"e     c #C6C6C6C6C6C6",
+"r     c #131313131313",
+"t     c #8F8F8F8F8F8F",
+"y     c #E1E1E1E1E1E1",
+"u     c #636363636363",
+"i     c #6B6B6B6B6B6B",
+"p     c #585858585858",
+"a     c #2B2B2B2B2B2B",
+"s     c #737373737373",
+"d     c #808080808080",
+"f     c #8B8B8B8B8B8B",
+"g     c #464646464646",
+"h     c #9E9E9E9E9E9E",
+"j     c #575757575757",
+"k     c #202020202020",
+"l     c #757575757575",
+"z     c #CCCCCCCCCCCC",
+"x     c #CBCBCBCBCBCB",
+"c     c #F0F0F0F0F0F0",
+"v     c #D6D6D6D6D6D6",
+"b     c #999999999999",
+"n     c #858585858585",
+"m     c #404040404040",
+"M     c #FFFF00000000",
+"L     c #FFFF77777777",
+"N     c #0E0E0E0E0E0E",
+"B     c #DFDFDFDFDFDF",
+"V     c #C1C1C1C1C1C1",
+"C     c #959595959595",
+"Z     c #878784848181",
+"A     c #919191919191",
+"S     c #5F5F5F5F5F5F",
+"D     c #313131313131",
+"F     c #6C6C6C6C6C6C",
+"G     c #F6F6F6F6F6F6",
+"H     c #D1D1D1D1D1D1",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                          .X                                                                       ",
+"                                                                          oO+                                                                      ",
+"                                                                           X@#                                                                     ",
+"                                                                            $%                                                                     ",
+"                                                                      &*=-; $:                                                                     ",
+"                                                                     >,<1+2 34                                                                     ",
+"                                                                    5;   5O678          9                                                          ",
+"                                                                          0q=w        qe2                                                          ",
+"                                                                          *$O      rtOyu9                                                          ",
+"                                                                          i@O     p0OOa                                                            ",
+"                                                                          sO=   u7OOOOd                                                            ",
+"                                                             r..66w$-,3fg hO, j=OOO@-o.                                                            ",
+"                                                   9kql>2zxxx0c00cOO2+h0O:3O7,OOOOx1r                                                              ",
+"                                               6wf%v-3bnm#&#&qqaeOMM  NBOOOVOOOOOO+                                                                ",
+"                                         rquh%xCsuX9ZZZZZZZZZZZ9O+MMMMMi%OOOOO+sOOO&                                                               ",
+"                                     9kd,h+swkNZZZZZZZZZZZZZZZZrOMMLLMM .OOOha tcOO&                                                               ",
+"                                  1j+3tirZZZZZZZZZZZZZZZ.Z.94AZZzMNLLMMM;OOOMMM  SOp.g4X                                                           ",
+"                             NqSCC>w.ZZZZZZZZZZZZZZZZZZZZZmv@,j .OcsMMMM*OyMMLLMMDO89#>*7%8X                                                       ",
+"                          .F%ft#k9ZZZZZZZZZZZZZZZZZZZZZZZmOVa    mVOOOGOcGcuMLLMrxONZZZZ;SheoS5                                                    ",
+"                       ;h$ds6ZZZZZZZZZZZZZZZZZZZZZZZZZZZFOl        9a<Fkf0OOMMM,O-ZZZZZZZZZZX>zha                                                  ",
+"                    a<*Aw9ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ&OF          9+  eOA$Oe-2S9 ZZZZZZZZZZZZsH%k                                                ",
+"                 Ng+3p6ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ5xi           jh  BO;eV N    ZZZZZZZZZZZZZZi2n6                                              ",
+"               9>0%&ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ2A            $8 1OO =<      ZZZZZZZZZZZZZZZZlyt                                             ",
+"514#9        Nt2>NZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZf*             Vr f0%1-. 5D2OOhXZZZZZZZZZZZZZZZ9s$i                                           ",
+"8h,=Hq      gA>NZZZZN#ZZZ5rZZZZZZZZZZZZZZZZZZZZZZZZZ6=;            m,  oVj%: X*3l48%co9ZZZZZZZZZZZZZZZkdzp                                         ",
+"    lO.   #V2 .ZZZZZZrZZZZ9ZZZZZZZZZZZZZZZZZZZZZZZZZ7+             Cu 4lvDOX fm     X2@pZZZZZZZZZZZZZZZZqV*;                                       ",
+"     Fv  u>mjCht8m6ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ#OX             Br5vj*l+           8c39ZZZZZZZZZZZZZZZZ#*o1                                     ",
+"      GA+OBcOOGGOOGV8NZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ+o             .7 uobnyX            ;7xXZZZZZZZZZZZZZZZZZ>7F                                    ",
+"      oOOO%1     5<bBO=A1ZZZZZZZZZZZZZZZZZZZZZZZZZ1O;             4f VDvA$               %OwZZZZZZZZZZZZZZZZZ1zx1                                  ",
+"     kOOOi           rivO%&ZZZZZZZZZZZ6rNZZZZZZZZZ>G              hXpH;B=D                +-NZZZZZZZZZZZZZZZZZZgHfN                                ",
+"    ;=OOO#              #,@VmZZZZZZrsvcGc2n.ZZ4ZZZvC             6e znCH2                 .@*ZZZZZZZZZZZZZZZZZZZ6+=j                               ",
+"   k=x9$G                 rCOywZZZZ,O7tfn*OO+Z+rZkOp             gd;Oavv4                  nO5ZZZZZZZZZZZZZZZZZZZZ&H%5                             ",
+"   7f  Nvd                  6COt9ZlOo     9>Ozu;ZpOD             AD%$.B%6                  aOXZZZZZZZZZZZZZZZZZZZZZZj2S                            ",
+"  FB    acor                  4Oeacy5       jOFNZsO.             $&OX<O%                   wO.ZZZZZZZZZZZZZZZZZZZZZZZ;e35                          ",
+" 9V5      f@+g.5               8OyOl         H*ZZ:B             &Ctv vOa                   d=ZZZZZZZZZZZZZZZZZZZZZZZZZZi=g                         ",
+" ;n        X>2=i                COOD         sONZee             CuBSaO=                   .@:ZZZZZZZZZZZZZZZZZZZZZZZZZZZ1e+                        ",
+" lg           69                wOOD         6OmZv:             $p= sOo                   lOZZZZZZZZZZZZZZZZZZZZZZZZZZZZZNo3r                      ",
+" tN                             &O0r          =+Z=s            .zeA VOw                  .-tZZZZZZNZZZZ95ZZZZZZZZZZZZZZZZZZty;                     ",
+" %.                             N7o           +vZOF            wOOD O@.                  HOaZZZ.X5&5ZZ9a;5ZZZ9qZZ1ZZZZZZZZZZuyg                    ",
+" N                               r9           j0XO&            FOv <O7           ap  96FzOdNZZZZZZZZZZZZZZZZZZ9ZZ6ZZZZZZ99ZZZlOk                   ",
+"                                              1@hO.            ,O< eOF          NyO0xOOOo.ZZZZZZZZZZZZZZZZZZZZZZZ5ZZZZZZZZZXZZhH6                  ",
+"                                              9cOOX           9BO1 @@X          X@OOOcaZZZZZZZZZZZZZZZZZZZZZZZ1ZZk.wA+x@G0+#ZZ#Oe                  ",
+"                                               yOOX           kOB kOV            8hjh@z4ZZZZZZZZZZZZZZZZZZZZZZ5ZsHc=**lpp%OOBd;wGs                 ",
+"                                               zOOk           XOd lOj                9AOerZZZZZZZZZZZZZZZZZZZ#b@e8N        rm+OBVO1                ",
+"                                               AO05            SXrc-                   ;2Ot9ZZZZZZZZZZZZZZZD2=fX              XhOO$                ",
+"                                               sOV               NhS                     sO%ZZZZZZZZkXZZZ1oc:N                  jO@k 9             ",
+"                                               #O;                                        sOAZZZZZN9.ZZZlOf                      yO=OOH            ",
+"                                               91                                          FO<ZZZZk9ZZ1v7q                  9 5r;dOO%$Oi           ",
+"                                                                                            $c.ZN5ZZZ#0,N                   4z-0OOOO; *2           ",
+"                                                                                            rce9ZZZZ;@u                      61   bO6 ,x           ",
+"                                                                                             gO:ZZZkHS                            CO  B:           ",
+"                                                                                             N0oZZN=h                            9-H #ON           ",
+"                                                                                              FO5ZB%                            mOyX hh            ",
+"                                                                                              6Oq:79                            8lr  .N            ",
+"                                                                                              9Ov0.                                                ",
+"                                                                                               zOl                                                 ",
+"                                                                                               zB9                                                 ",
+"                                                                                               =z                                                  ",
+"                                                                                              DO*                                                  ",
+"                                                                                              hOl                                                  ",
+"                                                                                              vOq                                                  ",
+"                                                                                             qOb                                                   ",
+"                                                                                             fOm                                                   ",
+"                                                                                             8OF                                                   ",
+"                                                                                              wOa                                                  ",
+"                                                                                               %n                                                  ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   "};
diff --git a/pixmaps/bat-2.xpm b/pixmaps/bat-2.xpm
new file mode 100644 (file)
index 0000000..dff03b4
--- /dev/null
@@ -0,0 +1,178 @@
+/* XPM */
+static char * bat2[] = {
+"147 108 67 1",
+"      c #000000000000",
+".     c #060606060606",
+"X     c #B4B4B4B4B4B4",
+"o     c #929292929292",
+"O     c #BABABABABABA",
+"+     c #FFFFFFFFFFFF",
+"@     c #D6D6D6D6D6D6",
+"#     c #131313131313",
+"$     c #222222222222",
+"%     c #DFDFDFDFDFDF",
+"&     c #BFBFBFBFBFBF",
+"*     c #565656565656",
+"=     c #A1A1A1A1A1A1",
+"-     c #9D9D9D9D9D9D",
+";     c #616161616161",
+":     c #A5A5A5A5A5A5",
+">     c #C9C9C9C9C9C9",
+",     c #E6E6E6E6E6E6",
+"<     c #E3E3E3E3E3E3",
+"1     c #848484848484",
+"2     c #EFEFEFEFEFEF",
+"3     c #F0F0F0F0F0F0",
+"4     c #3F3F3F3F3F3F",
+"5     c #1B1B1B1B1B1B",
+"6     c #8B8B8B8B8B8B",
+"7     c #696969696969",
+"8     c #4B4B4B4B4B4B",
+"9     c #F5F5F5F5F5F5",
+"0     c #151515151515",
+"q     c #8D8D8D8D8D8D",
+"w     c #D9D9D9D9D9D9",
+"e     c #949494949494",
+"r     c #343434343434",
+"t     c #3A3A3A3A3A3A",
+"y     c #CECECECECECE",
+"u     c #454545454545",
+"i     c #0A0A0A0A0A0A",
+"p     c #747474747474",
+"a     c #595959595959",
+"s     c #C7C7C7C7C7C7",
+"d     c #515151515151",
+"f     c #5D5D5D5D5D5D",
+"g     c #C3C3C3C3C3C3",
+"h     c #F8F8F8F8F8F8",
+"j     c #E8E8E8E8E8E8",
+"k     c #838383838383",
+"l     c #0E0E0E0E0E0E",
+"z     c #B2B2B2B2B2B2",
+"x     c #414141414141",
+"c     c #737373737373",
+"v     c #D2D2D2D2D2D2",
+"b     c #878784848181",
+"n     c #A8A8A8A8A8A8",
+"m     c #646464646464",
+"M     c #6D6D6D6D6D6D",
+"N     c #303030303030",
+"B     c #292929292929",
+"V     c #262626262626",
+"C     c #7A7A7A7A7A7A",
+"Z     c #7F7F7F7F7F7F",
+"A     c #4C4C4C4C4C4C",
+"S     c #1E1E1E1E1E1E",
+"D     c #AEAEAEAEAEAE",
+"F     c #FFFF00000000",
+"L     c #FFFF77777777",
+"G     c #989898989898",
+"H     c #2D2D2D2D2D2D",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                         .Xo.                                                                                                                      ",
+"                          O+@#                                                                                                                     ",
+"                           $%&                                                                                                                     ",
+"                        *=-#;+                                                                                                                     ",
+"                       :+>,+<+*                                                                                                                    ",
+"                      12$ .>++3;                                                                                                                   ",
+"                     4,5 *,+++++6                                                                                                                  ",
+"                     &7 8+6o++++90                                                                                                                 ",
+"                    .q. we  rty+9%u                                                                                                                ",
+"                     i  +$    8+p3+a                                                                                                               ",
+"                    .0  2#     wsd<+d                                                                                                              ",
+"                        +*     f+oog+*                                                                                                             ",
+"                        df     #hjklq+o                                                                                                            ",
+"                                u++O k+oi                                                                                                          ",
+"                                 z++8 *+%t                                                                                                         ",
+"                                 x++20 d<+c                                                                                                        ",
+"                                  X+vXibb7+6                                                                                                       ",
+"                                  4+1oybbb4ys$                                                                                                     ",
+"                                   &X gnbbb.z+a                      il                                                                            ",
+"                                   8+ibzmbbbbf3-.                   $++M                                                                           ",
+"                                   l+Nb41#$bbb8+@B                  chMjB                                                                 V7V      ",
+"                                    9CbbmfxVbbbNwhM                 8h Zz                                                                 2++A     ",
+"                                    ewbb.a5Blbbb.e+yB                a 5+i                                                               e+dn+N    ",
+"                                    A90bbbflbbbbbbt@+nS                 sa                                                              l+1  yg    ",
+"                                    i,rbbbl5bbbbbbbbm2+oi               *g       5d.                                                    M+$  53t   ",
+"                                     sqbbbbbbbbbSbbbbbZh+ai             49i  .0az++N                                                    Dw 00 dhV  ",
+"                                     12bbbbbbbbbbbbbbbbB:+2-dl     if&e$V+xlZ@2++wx                                                i#umayh&3hwX&5  ",
+"                                     x+.bbbbbbbbbbbbbbbbbro@++,Dpxn+++++&+++++++hB                                         NNM1Zsww+++++++++q1&hk  ",
+"                                     i9Abbbbbbbbbbbbbbbbbbbb.x19+++&FVSX+++++jy++@7f8AAAA40000i    00000000000000000048cn2++++++2O:ao+++32+3   u+r ",
+"                                      @Gbbbbbbbbbbbbbbbi0ibbbbbl,+FFLLFB++++6F$+9+++++++++93hh2yg@@h3hhhh92h9hh9h999h+++9DCaCz@m  $>3@cuS$f+8   y6 ",
+"                                      z=bbbbbbbbbbbbbbbbb#b#bbbb2%FFLLFo+-h%FFFF#%%NHNS5rxxuk1kO&GD-A1111;Hmakk1=k&ekxN0 #V5#$l iz+=H   .h.sX   k, ",
+"                                      q@bbbbbbbbbbbbbbbbbbbib#SO++FFFF%+@l9,FLLFS+= l #bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#$S  V. C3@t     M+8Ds   8+5",
+"                                      a3.bbbbbbbbbbbbbbbbbbbbbc+o++vgh+<r.j+FLLFG++GA S.bbbbb5.bb5V5bbbbbbbbbbbbbbbbb00ibbV4 #&+;.      z+rXo   #2d",
+"                                      S3bbbbbbbbbbbbbbbbbbbbbbO+ 4e,+,%l  s++FF<+ww++s4bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.bbbb#ix+O5        #S gC    M:",
+"                                      #+Vbbbbbbbbbbbbbbbbbbbbbgw   A2-z   vh+j,X;  0M9+Dbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#o+c            .<t      ",
+"                                      V+Bbbbbbbbbbbbbbbbbbbbbbgj   Awoo  S9w%Si      #o+-lbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.bx3@8             Bhl      ",
+"                                       +HbbbbbbbbbbbbbbbbbbHubz+0  ;<-a  $j>,.         m+@Vbbbbbbbbbbbbbbbbbbbbbbbbbbbb.c+Z               Zs       ",
+"                                      B+lbbbbbbbbbbbbbbbbVZ@+D<+G. f<-f  $,k<.          x3+*bbbbbbbbbbbbbbbbbbbbbbbbbixO34                Zk       ",
+"                                      83.bbbbbbbbbbbbbbbNh+h+++++@Hd@-f  $%Dz            N2+cbbbbbbbbbbbbbbbbbbbbbbb.Aj%N                          ",
+"                                      a,bb#.bbbbbbbbbbb03+7  l*+++%mq-f  4w>f             l3+rbbbbbbbbbbbbbbbbbbbbbbBXh                            ",
+"                                      D:bbNbbbbbbbbbbbb8+c     =++h=oga  t++H              d+Obbbbbbbbbbbbbbbbbbbbb0424                            ",
+"                                      wmbbp$l.bbbbbbbbbd+.     lG,fpaw*  f++                9sbbbbbbbbbbbbbbbbbbbb#0g=                             ",
+"                                     5+Hbc++++gm#bbbbbb=3          Ct<H  f++                9nbbbbbbbbbbbbbbbbbbbbbS+$                             ",
+"                                     N+ C+3O&&v++nNbbbb:D          Z83.  f++               N+:bbbbbbbbbbbbbbbbbbbbbD-                              ",
+"                                     t+Z+>S    V6h+vdlbgD          &M+   f+>               p+abbbbbbbbbbbbbbbbbbbb5+5                              ",
+"                                     Z++z         7,+%bw:          OGy   :+g               j%.bbbbbbbbbbbbbbbbb#Vbcj                               ",
+"                                     1+9B           C+X3&          -nq   O+g              6+7.###bbbbbbbbbbbbbbx.bv*                               ",
+"                                     >+e             ;++3          G@Z   X+6           iuD++23333%OC8.bbbbbbbbblbA2.                               ",
+"                                    B++5              7+3          23d   O+m         $2+++hvD68t*eD<++<oNbbbbbbbb&g                                ",
+"                                    k++                v+4         ++B   X+7         S9++pi         lAZ@+jcbbbbbV+a                                ",
+"                                    g+9                4+6        #+2.   O+M          7Dr               H=+=bbbbq,.                                ",
+"                                    fwk                 >3        r+v    X+N                              7+Mbbbwk                                 ",
+"                                                        C+B       m+o    ,+V                               O+*b#+$                                 ",
+"                                                        0+D       q+f    +90                               $9%ba3                                  ",
+"                                                         g+4      6+$   t+@                                 M+Npv                                  ",
+"                                                         d+yi     g%.   e++$                                .,:&q                                  ",
+"                                                         t++C    S+D    8+si                                 C++7                                  ",
+"                                                          =<*     4#                                         N++B                                  ",
+"                                                                                                              ++B                                  ",
+"                                                                                                              ++V                                  ",
+"                                                                                                              ++f                                  ",
+"                                                                                                              v+;                                  ",
+"                                                                                                              ix                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   "};
diff --git a/pixmaps/bat-3.xpm b/pixmaps/bat-3.xpm
new file mode 100644 (file)
index 0000000..ec071e2
--- /dev/null
@@ -0,0 +1,165 @@
+/* XPM */
+static char * bat3[] = {
+"147 108 54 1",
+"      c #010101010101",
+".     c #1C1C1C1C1C1C",
+"X     c #A7A7A7A7A7A7",
+"o     c #FFFFFFFFFFFF",
+"O     c #9A9A9A9A9A9A",
+"+     c #DDDDDDDDDDDD",
+"@     c #D3D3D3D3D3D3",
+"#     c #3F3F3F3F3F3F",
+"$     c #F5F5F5F5F5F5",
+"%     c #BABABABABABA",
+"&     c #9E9E9E9E9E9E",
+"*     c #EDEDEDEDEDED",
+"=     c #121212121212",
+"-     c #4E4E4E4E4E4E",
+";     c #919191919191",
+":     c #5D5D5D5D5D5D",
+">     c #F2F2F2F2F2F2",
+",     c #797979797979",
+"<     c #C4C4C4C4C4C4",
+"1     c #767676767676",
+"2     c #0E0E0E0E0E0E",
+"3     c #2A2A2A2A2A2A",
+"4     c #888888888888",
+"5     c #2E2E2E2E2E2E",
+"6     c #434343434343",
+"7     c #969696969696",
+"8     c #B2B2B2B2B2B2",
+"9     c #050505050505",
+"0     c #ACACACACACAC",
+"q     c #272727272727",
+"w     c #D9D9D9D9D9D9",
+"e     c #6B6B6B6B6B6B",
+"r     c #474747474747",
+"t     c #090909090909",
+"y     c #8F8F8F8F8F8F",
+"u     c #373737373737",
+"i     c #646464646464",
+"p     c #BEBEBEBEBEBE",
+"a     c #575757575757",
+"s     c #CECECECECECE",
+"d     c #323232323232",
+"f     c #181818181818",
+"g     c #7E7E7E7E7E7E",
+"h     c #818181818181",
+"j     c #CACACACACACA",
+"k     c #E1E1E1E1E1E1",
+"l     c #5A5A5A5A5A5A",
+"z     c #494949494949",
+"x     c #A3A3A3A3A3A3",
+"c     c #3A3A3A3A3A3A",
+"v     c #878784848181",
+"b     c #707070707070",
+"n     c #FFFF00000000",
+"L     c #FFFF77777777",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                    .XoO                                                                                                           ",
+"                                   .+@#.                                                                                                           ",
+"                                   $%                                                                                                              ",
+"                                  &*=                                                                                                              ",
+"                                 -o;                                                                                                               ",
+"                                 ;o$.                                                                                                              ",
+"                                .:+o>#    .,<12                                                                                                    ",
+"                               3oO 4*o5  6$@7o4                                                                                                    ",
+"                               8<3   4o,9*0  .q                                                                                                    ",
+"                              9wo*3   &ooo3                                                                                                        ",
+"                               Ooe     1ooq                                                               ret                                      ",
+"                               qooy    uooq                                                               oo<                                      ",
+"                                tiwop1asooq                                                               deoq                                     ",
+"                                   i0***ood                                                                toa                                     ",
+"                                       .oo1                                                                foa   3                                 ",
+"                                       9+o7                                                         q<o*og ao9  h<                                 ",
+"                                        <o<                                                        f*jq=eo3<0 9h*q                                 ",
+"                                        Ookt                                                       ,$=   @wo:ek*5                                  ",
+"                                        -o$q                                                       4j    8ooooh                                    ",
+"                                        qo$q                                                       5l   iooo+3                                     ",
+"                                         oo1                                                            Ooooa                                      ",
+"                                         >op                                                            .o@k .=                                    ",
+"                                         <oo                                                            &&;*.oj                                    ",
+"                                         <ooz                                                          r+ a$=x:                                    ",
+"                                         <$<j                                                          @cr#oq                                      ",
+"                                         8o,oq                                                        1x x=>i                                      ",
+"                                         8oaox                                                       3*= 8vs0                                      ",
+"                                         1wrOoc                                                     2s-v97v,>                                      ",
+"                                         %O1v%@                                                     &Ovvf1vuo=                                     ",
+"                                         @Xxv3oX                                                   ,%vvvu4vv>g                                     ",
+"                                         wh8vvao89                                                i@2vvvi;vvhk9                                    ",
+"                                         o-&vvvbop2                                              akfvvvv74vvqod                                    ",
+"                                         ofc#vvvuoj.                                            5*zvvvvv%1vvvk4                                    ",
+"                                        .>9t-vvvv3+$a                 t                        d*#vvvvvcOOvvve>9                                   ",
+"                                        a<vv#9vvvvtjo4               f%=                      u+zvvvvvv&-ecvvq>b                                   ",
+"                                        &;vva2v9vvv94opq           9u %c                     3*-vvvvvvv*z.yvvv4ot                                  ",
+"                                        k6tda2vf9vvvvi>o7f        .+$s4,                    -*6vvvvvvvc>qv;3vv=kx                                  ",
+"                                       .ovvvu.vvvvvvvvq%o*i       td=7$<                   b*6vvvvvvvv4;tv-yvvvao:                                 ",
+"                                       bwvvvu3vvvvvvvvvvu+o%q         Oo                  hkcvvvvvvvv9Xevvv8qvvv;oq                                ",
+"                                       wiv=tuuvv=qvvvvvvv9,$o&.       to-      .xf      =08=vvvvvvvvv#11vvv.gvvvv<+                                ",
+"                                      rk9vvv.lvvvv9vvvvvvvvf@o$19      X0    f:jo#     .sgvvvvvvvvvvvbdavvvv;avvvqoX                               ",
+"                                      j4vvvv9cvvv9uvvvvvvvvvvz@o+c     4*9 5<ooo;     ro:vvvvvvvvvvvf;cevvvvv4.vvvqoy                              ",
+"                                      o=vvvvv-vvvv.fvvvvvvvvvvvz<o#tcq go3eooo$b     4w3vvvvvvvvvvvvaru3vvvvv30vvvv1ox                             ",
+"                                     4%vvq.vv:tvvvvu9vvvvvvvvvvvv.lwo*7josooook2   =%%.vvvvvvvvvvvvv7tl.vvvvvvb1vvvvgol                            ",
+"                                    t>qvva2vvc2vvvv=.vvvvvvvvvvvvco@8ooooooon4o0 .&o,vvvvvvvvvvvvvv-; 7vvvvvvvvu;fvvv1o0                           ",
+"                                    1%vvtcvvvqqvvvvvv.vvv.lxXXi6qwknnnf%ooonn &o,01=vvvvvvvvvvvvvvvO. ;vvvvvvvvv:%avvvc$sf                         ",
+"                                   =@qvtivvvvf6vvvvvvz.v2*oooooo*oonLLn,nLLnn 8*2vvvvvvvvvvvvvvvvvfOv=bvvvvvvvvvv.<ivvv6o*r                        ",
+"                                   8;vv:uvvvvvqvvvvvvvqvho-    56>$nLLn%nLLnn w<vvvvvvvvvvvvvvvvvvezvqivvvvvvvvvvvvgytvv9+o4                       ",
+"                                  .$fv.#vvvvvv6vvvvvvvv.ox       zo$nnnnonnnnnozvvvvvvvvvvvvvvvvvf%vvu#vvvvvvvvvvvvvzp6vvv4o@6                     ",
+"                                  pbvv-vvvvvvv:vvvvvvvv=oi        ,oooo@*o*ooo4ul=vvvvvvvvvvvvvvv-evvarvvvvvvvvvvvvvvfg4tvvd*o4                    ",
+"                                 a$vvifvvvvvvv-vvvvvvvv9o:        ro%oj:w*so1f0ooooXqvvvvvvvvvvvt02vvidvvvvvvvvvvvvvvvvqgh#2v1o<d                  ",
+"                                f*-v=3vvvvvvvv3tvv9dh+;6o;        q*io6 <X<0  u62-7oozvvvvvvvvvv46vvvl.vvvvvvvvvvvvvvvvvvqq2vv5woi                 ",
+"                                <0 .lvvvvvvvvv.vvvpoooooo+t       aoaoq og@h       q*$qvvvvvvvv=xvvvv-=vvvvvvvvvvvvvvvvvvvvv2ttq&o4                ",
+"                               x% =rvvvvvvvvvva=vpo:u%4>ooa       :$#*t ol+z        3o@vvvvvvvv0qvvvv;9vvvvvvvvvvvvvvvv=zO<*ooooooo4               ",
+"                              0*6h%ok%uvvvvvvv-9aol    ioo@       :*q*t o5*r         iozvvvvvvz,vvvvvivvvvvvvvvvvvvv9r<o*<hb5f=ae<ool              ",
+"                           2:0oooop08$o;tvvvvv- %@      rad       :*5<  o5*9          +w9vvvvv0.vvvv.4vvvvvvvvvvvvvlwo;r2         d1k9             ",
+"                           qooox5     io+vvvvvz.o:                i@6p  o5>           :o-vvvv,,vvvvvdlvvvvvvvvvvvb**hf              zq             ",
+"                            1+d        qk+uvvv6-*2                e;48  *3o           to,vvv=X9vvvvv:avvvvvvvvv6+o7                                ",
+"                             .          fj>dvv#O@                 1yyi  *5+            w<vvv;cvvvvvv4uvvvvvvv=0o7q                                 ",
+"                                          %ovvqkx                 %;<z 6kb<            swvvdXvvvvvvv&qvvvvvvuokq                                   ",
+"                                          9%@t @1                 %Ok9 6+&g            y+vveuvvvvvvv,9vvvvv1o&t                                    ",
+"                                           fo; wl                 %%o9 6*+1            0>v.1vvvvvvv9Ovvvvvbog                                      ",
+"                                            rou*.                 8s@  #*+c            @<vgcvvvvvvv3ivvvvboi                                       ",
+"                                             &ko-                 0oj  #oo3            ohv6vvvvvvvvl:vvvbou                                        ",
+"                                             .*o1                 so0  ao>f           dor63vt2vvvvvg.vveor                                         ",
+"                                              goe                 oob  7o@            Oo*ooooo;vvvvb9v3o,                                          ",
+"                                              to&                 ooc  7o7            :*y...q;o<vvva 9*4                                           ",
+"                                               &k                5oof  @oe             9      goevv1t4>9                                           ",
+"                                               col               co+   wod                     &o.v9coc                                            ",
+"                                               tow               uoj   wo3                     =ohvv@&                                             ",
+"                                                +o.              #o;   +*9                      X>tdoq                                             ",
+"                                                4oh               @O   +*t                      qo5x%                                              ",
+"                                                #o*               <O  9**2                       >x>c                                              ",
+"                                                q$oq              zq   a6                        0o*                                               ",
+"                                                 %oi                                             &o0                                               ",
+"                                                 -o8                                             &o-                                               ",
+"                                                  kk9                                            xo.                                               ",
+"                                                  bo;                                            js                                                ",
+"                                                  .oo6                                           oX                                                ",
+"                                                   *8                                           qob                                                ",
+"                                                   *4                                           aor                                                ",
+"                                                   0ou                                          #oz                                                ",
+"                                                   Xou                                          doz                                                ",
+"                                                   5b                                           .oi                                                ",
+"                                                                                                 g4                                                ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   "};
diff --git a/pixmaps/bat-4.xpm b/pixmaps/bat-4.xpm
new file mode 100644 (file)
index 0000000..8e701cf
--- /dev/null
@@ -0,0 +1,165 @@
+/* XPM */
+static char * bat4[] = {
+"147 108 54 1",
+"      c #010101010101",
+".     c #AEAEAEAEAEAE",
+"X     c #292929292929",
+"o     c #7A7A7A7A7A7A",
+"O     c #FFFFFFFFFFFF",
+"+     c #0C0C0C0C0C0C",
+"@     c #646464646464",
+"#     c #737373737373",
+"$     c #C8C8C8C8C8C8",
+"%     c #C4C4C4C4C4C4",
+"&     c #101010101010",
+"*     c #9D9D9D9D9D9D",
+"=     c #E4E4E4E4E4E4",
+"-     c #F2F2F2F2F2F2",
+";     c #A3A3A3A3A3A3",
+":     c #909090909090",
+">     c #D7D7D7D7D7D7",
+",     c #DADADADADADA",
+"<     c #171717171717",
+"1     c #3D3D3D3D3D3D",
+"2     c #989898989898",
+"3     c #8B8B8B8B8B8B",
+"4     c #A9A9A9A9A9A9",
+"5     c #202020202020",
+"6     c #A6A6A6A6A6A6",
+"7     c #5F5F5F5F5F5F",
+"8     c #868686868686",
+"9     c #E9E9E9E9E9E9",
+"0     c #DFDFDFDFDFDF",
+"q     c #CFCFCFCFCFCF",
+"w     c #060606060606",
+"e     c #D2D2D2D2D2D2",
+"r     c #575757575757",
+"t     c #252525252525",
+"y     c #B1B1B1B1B1B1",
+"u     c #4C4C4C4C4C4C",
+"i     c #484848484848",
+"p     c #B5B5B5B5B5B5",
+"a     c #434343434343",
+"s     c #1B1B1B1B1B1B",
+"d     c #6E6E6E6E6E6E",
+"f     c #878784848181",
+"g     c #2D2D2D2D2D2D",
+"h     c #BCBCBCBCBCBC",
+"j     c #7E7E7E7E7E7E",
+"k     c #5B5B5B5B5B5B",
+"l     c #313131313131",
+"z     c #6B6B6B6B6B6B",
+"x     c #525252525252",
+"c     c #F0F0F0F0F0F0",
+"v     c #FFFF00000000",
+"L     c #FFFF77777777",
+"b     c #F8F8F8F8F8F8",
+"n     c #383838383838",
+"                                                                             .X                                                                    ",
+"                                                                            oO+                                                                    ",
+"                                                                           @O#@$%@&                                                                ",
+"                                                                           *O=-;:>,X                                                               ",
+"                                                                      <1o234OO5   #6                                                               ",
+"                                                                   +7>OOOOOOOO                                                                     ",
+"                                                                  890.OOO=$qOO*w                                                                   ",
+"                                                                1eOrt,Oyu   1;Oi                                                                   ",
+"                                                              X,Op tO=1  &    q3                                                                   ",
+"                                                             8O4Xa&>=&  se>5  e8                                                                   ",
+"                                                            dO@fXaq=<    1-q  q8                                                                   ",
+"                                                           5O:ffuoOg       O1 9o                                                                   ",
+"                                                           e;ffi:Oo     oqhO# O1                                                                   ",
+"                                                          rO&ffj9q      pOOOOp9s                                                                   ",
+"                                                         5Ouffi6-X   w2OOOOOOO91                                                                   ",
+"                                                         h>ffwu9:    uO31-OOOOO-a                                                                  ",
+"                                                        oO1ffk:OX    2- 1O75k-OOOo                                                                 ",
+"                                                       +O@ffl@qy     p* @-   &99:O2w                                                               ",
+"                                                       8=ff&t1O1     #4 d$    X=q6O%&                                                              ",
+"                                                      aO1ffs<q9      @- #2     X-98O-X                                                             ",
+"                                                     +93ffg gO1      5-&7p      &%=u--a                                                            ",
+"                                                     *,&fsu ;>        .o5=       598w,Ok                                                           ",
+"                                                    1O5fw1 &Od        lOw=l       iO <6Oy<                                                         ",
+"                                                   5-kff&& h=+         1 d8       +-aff1-O4X                                                       ",
+"                                                   q;ffs&fsOo            wt        :hfffsjOO.X                                                     ",
+"                                                  yqwffXwfoOl                      5O<ffff&8-O21                                                   ",
+"                                                 #=+ffffff$9                        e*fffffffr0O=@s                                                ",
+"                                                dO1ffs+ff1Oy                        zOufffffffwi6OOhzt5                                            ",
+"                                               1Oxff5XfffoO@                        &O.ffffffffff<d>-OO9>2ag                                       ",
+"                                              tOoff+5ffffoOs                         oOffff&+ffffffff&rk2qOOOeyz5&                                 ",
+"                                             g98ffwiwffff:O                          sOafffwffffffffffffff5a#*0OOOe3g                              ",
+"                                            t-:fffa5fffffhq                           %.ffffffffffffffffffffffffi8$-O9;i&                          ",
+"                                           X-7fff+sffffffO;                           :9fffffffff<ffffffffffffffffffrpOOOh@a1                      ",
+"                                          @9ufffffffffff&O;                           x9fffffffff+ffffffffffffffw180--OOOOOO0+                     ",
+"                                        &$=gfff+ffffffff1O:                           r9ffffffffffffffffffffff1;OOO$jooo#2,O2                      ",
+"                                       19.&ffftgffffffffXOu                           x-fffffffffffffffffff&z9O9:1         5                       ",
+"                                      r9jfffwl&ffffffffffO3                           uO5fffffffffffffffffXeO.a+                                   ",
+"                                    w69gfffa1ffffffffffff.4                           @OtffffffffffffffffkO9l                                      ",
+"                                   &qpfff<71fffffffffffff4.                           yqfffffffffffffff+2O6w                                       ",
+"                                  g=:ffws&&ffffffffffffffd9                           qoXffffffffffffff2Oj                                         ",
+"                                 @OiffffwffffffffffffffffuO                          <O1ufffffffffffffuO#                                          ",
+"                                h01ffffffffffffffffffffffxO+                         1OfaffffffffffffXO2                                           ",
+"                              &h0sffffffffffffffffffffffftOl                         o,f1ffffffffffffye                                            ",
+"                             a>6fffl111<fffffffffffffffff+-o                         9of@wffffffffffrOg                                            ",
+"                          tx6O=2$OOOOcOO-:x&ffffffffffffff.e                        @Ogfk+ffffffffff9h                                             ",
+"                          9OOOOOe@u5s&tu2eO91fffffffffffffiOw                       >pffaffffffffffuO1                                             ",
+"                          qO$d1+          16O2ffffffffffff+O1        1s            5Ouf&uffffffffff:-w                                             ",
+"                           &                xO.ffffffffffff$y       jOOa           2O+f&xffffffffff,*                                              ",
+"                                             #Oxfffffffffff89w      pko,          1Okff57fffffffff&O@                                              ",
+"                                              :O&ffffffffff1Ou        &O&      *d $$fff1lfffffffff&O5                                              ",
+"                                               98fffffffffffq,         $#    5$O2@OXfffutffffffwwfkO&                                              ",
+"                                               o9fffffff5fffaOx        @h   o-O-uO:ffffr&ffffff+tf@O&                                              ",
+"                                               5O1ffffffsffff2Oa    51 l9 5,OO4l,=+ffff8&fffffffwf@O&                                              ",
+"                                                ,2ffffffsfffffpOX  aOO98O;OOOq&%OsfffffjffffffffffxOs                                              ",
+"                                                @-ffffffwffffff9>+t9=@=OOOOOO9=O7ffffff7ffldyh;@5fiOx                                              ",
+"                                                sO@ffffffffffffiO-99v&&=OOOqOOOg x:e*ok:&:OOO90OOhiO8                                              ",
+"                                                 ;,fffffffffffffs8OvvvvjOOvvadO%>O=h-OOOOOh1   a2OOO,w                                             ",
+"                                                 1O&fffflwfffffff1-vLLv;OvLLv O-:l  +l,OO8       1,OO1                                             ",
+"                                                  9@ffff5ffffffff1-vLLvOvvLLvdOx      :O=w        +yO2                                             ",
+"                                                  :effff&wfw@%Opf -vvvvhvvvvvO;       w:i           >Ou                                            ",
+"                                                  7O<fffw 1,O-*8w kObOO**O99O*                      1O-s                                           ",
+"                                                  5Olffffs-O1      +p8-ujO0Oz                       w,Oy                                           ",
+"                                                   0:ffff2O@        240 kO4O&                        3O8                                           ",
+"                                                   6hffff2Og        200 kO@9w                         5                                            ",
+"                                                   oOffffaOx        uO0 59r-w                                                                      ",
+"                                                   nOgp-O-O.        1O0 59r-+                                                                      ",
+"                                                   &-OO0;,OOX       lO0 59k-w                                                                      ",
+"                                                    qOk   dO,&       O. t9i-+                                                                      ",
+"                                                    h$    +OO1       O0 5-1-w                                                                      ",
+"                                                   &-4     ;4        O= s-5-+                                                                      ",
+"                                                   tOp               q= +=<-+                                                                      ",
+"                                                   aO8               h9  ,<-+                                                                      ",
+"                                                   aO8               q9  es-+                                                                      ",
+"                                                   7O8               p9  e<9+                                                                      ",
+"                                                   aO8               h9  >89+                                                                      ",
+"                                                   aO8               pO5 ey9w                                                                      ",
+"                                                   aO8               #Ot 4O0+                                                                      ",
+"                                                   1O3               kO1 oO=+                                                                      ",
+"                                                   @O-&              7Od #O9&                                                                      ",
+"                                                   dO-               gOd XOO<                                                                      ",
+"                                                    1u               7O: &Ob&                                                                      ",
+"                                                                     X,@ w0-+                                                                      ",
+"                                                                          1#                                                                       ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   ",
+"                                                                                                                                                   "};
diff --git a/pixmaps/face.xpm b/pixmaps/face.xpm
new file mode 100644 (file)
index 0000000..6f30181
--- /dev/null
@@ -0,0 +1,131 @@
+/* XPM */
+static char * face_data[] = {
+"64 64 64 1",
+".     c #3A127E",
+"+     c #326DB3",
+"@     c #12E6FA",
+"#     c #1CB9E2",
+"$     c #3655A6",
+"%     c #34499D",
+"&     c #1EB0DD",
+"*     c #4AE6F6",
+"=     c #38368F",
+"-     c #2298CF",
+";     c #32E2F2",
+">     c #3A2C8C",
+",     c #12D6EE",
+"'     c #22A6D6",
+")     c #2A76B6",
+"!     c #2AEAFA",
+"~     c #16CEEA",
+"{     c #228BC6",
+"]     c #0EF2FE",
+"^     c #47BEE8",
+"/     c #3A2286",
+"(     c #2EAEDA",
+"_     c #4A76C6",
+":     c #1EEAFE",
+"<     c #3B95D5",
+"[     c #16DAF2",
+"}     c #1EFEFE",
+"|     c #36F8FE",
+"1     c #3EBBE5",
+"2     c #32A2D2",
+"3     c #3A1E82",
+"4     c #2EEEFA",
+"5     c #36D6FE",
+"6     c #2A7EBE",
+"7     c #3BA8DE",
+"8     c #2F60AA",
+"9     c #23C2EB",
+"0     c #268AC6",
+"a     c #419EDD",
+"b     c #0AFAFE",
+"c     c #387EC1",
+"d     c #56B2F2",
+"e     c #3A1A82",
+"f     c #16FEFE",
+"g     c #50FEFE",
+"h     c #32BAE6",
+"i     c #2ECCF3",
+"j     c #3E127E",
+"k     c #43D5F8",
+"l     c #4896D6",
+"m     c #2BFDFE",
+"n     c #436AB9",
+"o     c #4AA4E4",
+"p     c #4060B0",
+"q     c #22BEE6",
+"r     c #4656AE",
+"s     c #46F4FE",
+"t     c #318CCC",
+"u     c #2883C0",
+"v     c #38167E",
+"w     c #393E97",
+"x     c #404AA0",
+"y     c #50ABEC",
+"z     c #4381C6",
+"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj",
+"..........................v/>>>/.....v.........................v",
+"jjjjjjjjjjjjjjjjjjjjjjj>8u--{)%=.j..e>w%w>3.jjjjjjjjjjjjjjjjj.jj",
+"..................../%-&###-{)%=...v/=%$)6)%>e...............j..",
+"jvvvvvvvvvvvvvvvvv/6'#&####'{)$=.j..vew%66{6{+>3vvvvvvvvvvvvv.jj",
+".jjjjjjjjjjjjjj.>8-#&######&-6%=.v....v/%+)u)uu83jjjjjjjjjjjj.v.",
+"..jjj..jjj..jj.=#######&##&&-{8=...v/>>/./=uu{u6u%>...j..jj.j.jj",
+"j....jj...j..v)&&&##########-{$w...e>w$8%/v=$)uuuu+3...jj..j.j..",
+"jjjj..jjj...>)##########&##-)%vv...3>%8)6)$.3=)666u)%3...j.j.jjv",
+"v...jj.....%-######&##&#-8=v3/%=..ve=%8)u6u$=e=8{u6{)8vj..j.j..j",
+".jj..jjj..=&###&######&)vv%,@~{8.../=%+666uu68v/))uuuu%3j.j.jj.j",
+"...j.....w{&#########-//)~]]],{8..v/w%)6u{u)66=3%)6u666$.j.j..j.",
+"jj..jj..=-##&####&#'8>8#bbbbb@{+..v/%%6)6){{6u)%v=8{6u)u>v.jj.jj",
+"..jj.../&&########'/38]bbbbb]@-8vv.=%8){u{)u6u{)>e=)u){6)=...j..",
+"j..j...$###&#&##&'8%#]bbb]bbb]'+..v>%8666{6{)6uu+=386u666+w..jjj",
+".jj...%-########-==,]]b]]bb]]]-).vv=$8uuu6uu{u{6{8==8)uuu68vj...",
+"..j..v'&#######'>={]bbbbbbbbb]&).vv=8){{{{{{u6uu{)8v%+u6u)6/v.jj",
+"j...v%&#######&)/'@bbbbbbbbbbb#6.v3%860{u0u{{{{{u{)//$){uu{$>...",
+"..../+&#######uw-@bbfbffbbfbbb#{..v%)){tt<ttt{0{u{u%3=6)6)u)%3.v",
+"...v8-##&#####%%bbfbfffffbb]bb,{.v38)uuuttt<<<tt{{{)=/){u{6{8=jj",
+"j../{########'/{bffbfbfbfbbbbb,-vv38){utt<t<<<<<tt{{%>8u66uu{$v.",
+"..v$'####9#~#+89fff}}fffbbbbb]]'.v/+)uuutu<<<<<<<-t{)w%)u6u)u8ej",
+"..v{&#####99-$#]bf}fffffbbbbbbb&vv/66uuuttt<<<<<<a<t6%=+{uu66)/.",
+".v/&#&##99#9+=[f}ff}}fffbbbbb]b#.vw66uuu0tt<<aaa<<<t-838{u6{{6=e",
+"..=#####99i#%$4f}}}}}ffbbbb]bbb~..=%%%+6utt<<<aaa<<<<+e$0uu)uu%>",
+"..8&####9i9'w+b}}}}}}fbfbb]bb]],..vvv3.v$c0<<aaa<aa<<)/x{{6{66+=",
+".v8#####99it%0}}}m}}}fbbbbbb]bb,v/)~,~{8./$<<<ao7aa<<c3%t0uu66)w",
+".v)&##999ii8=0}}}}}f}fffbb]bb]b]v8&@@@@@{w/n<aoaaoaaaz/wtt{uu{6w",
+".=)#&##9i9ix%-m}mm}}}fffbb#%==6,.{~[@@@@@98>8tooooaa<z/%tt0u){6%",
+"v={##999i5ix82}}fm}}}}ff'%3$){%>.&]@]@@::@i/=naoo7oo2z/x<<0uuuu$",
+"v%{#&##99ii=%2mmmmm}}}f93=-]bbb~v&@@@@@]:]!z=xlodooooc3x<ttuuuu8",
+"v$-###9ii5i$w<}}mm}}}f;8%~]]]bbbv&@@]@@@:::!8/lyydoo7_/$<tt{6u68",
+".%{####ii5i8=c}mmmmm}}8/fbb]]]b].&@@[@@:!::!c=loyyyoon3n<<<u66u8",
+"v${###9iiikc=ummmmmm};>8}fb]]bbbv&@@@@::!!4;i)xlyyyoar>c<<tuuu68",
+".${####ii5i7wcmmmmmmmh/uffbbb@]].#@@@::@::44;_/noyyylxxc<<tuuuu8",
+".%{##q99i5!^r84mmmmm}2%(}}}bbb]].#@:]@::!!4!inj=oydon=_l<<t0uu6$",
+".>6##99iiik58%;mmmm|4<%h}}}fbfbb.#@::::!!444t=j/_lolw/z<<<<uu6u%",
+"./)###qiiik;aximmmmmm<pi}m}}}f}f.h:!:!4!44|1xw=/rlyr>wo2<<tu6uu%",
+"..8###qii5ikinni|||ht%=1mm}}m}f;.t~!!!!4|4;/wzr/=nl/>raa<-t0u)6=",
+".v$&#q99ii55k2=7;h<rw=3nmmmmm}m#.ci4!4||4in=y*zw/rr/rzoa<ttuuu+=",
+"..=&&#q9ii5kkk=%cr%>ev/3c;|mmmm(.ph4|4|!c>>ks*lwe=/xzya<a<0uu6$/",
+".v>&##q9iiii;k<===/e/wcz.3ni4mm2j$(m4;arjp1g4gdrjj3looo<<ttuuu=3",
+".vv-&##9ii5kkkkzjv/wr_ss^uxv/=>ejv/=///r^**ssg1xj/pyyoa<<tt6u)/.",
+"...8'#9qqii5k;kkve/n<kssgsskyz_zka_clyssg|gsss^pjnlyoaa<t{uu6+ej",
+".../{&#999i55kkk1==y*sggggggssssgggsssggsgsggstw_ydyoo<attuu6$v.",
+"...v8-#q99ii5k5kk_=kssggsggsggggggsggggggggss*w=ddoooat<tu{6+=.v",
+"....=)##99955kkkkk_=ysgggsggggggggggggggggggsa>_ddyoaa<t0uu6%3..",
+"..v..='#999iii5k;k^=%<sggggggggggggggggggggszwzddyoa<<<<uuu$/...",
+"....e/'#q99iii;kkk*1x=^sgggggggggggggggggg*%/rddoooo<<ttuuu>e.jj",
+"......$-qq99iiik5k;k^_/cgggggggggggggggss^n>_ldyyoa<<-tu6u8e....",
+".......8&##99iki5kkk*kp/r1*gggggggggggg*r//dddyyaoaattt0u+=..vvj",
+"j...v../'##9i9ii;i;ki*k^=j=d*gggggggs*n=/_yddyoooa<<tt{66=ev..j.",
+"j..j..ve%-##99ii5ik;k;kk*lpj3wld**dp=v/rdddyyyol<a<ttuu)=v....jj",
+".j.......%{##q9hiikikk;kkkkklreejjj/r_ddddyyooo2<<tttu)8.....j..",
+"..j.j...v.=&qq99iii;5kk5kk*k^orwjv>rzoddyyyoalaa<ttu{u%/.....jjv",
+"jj.j....j.v$-##9qiiiii5kkkkk^opwjejxnllyooolaa<ttt{6u+3v...jj..j",
+".j.jjjj.v..v=)#q99iii5555k5k^2nxjee=r_llolaa<<<ttuu6w/......jj.j",
+"j.j....j.j.../)'##9qi9ii555k17nxjje>xpzzaa<<<t0tuu)/3...v.jj..j.",
+"j.jjjj.j.v...ev%##q99ii9ii55h2zxjjj/wxnc<<<<<0utu$>.....j..jj.jj",
+".j....j.jj.j..jj=8-qqq99iiih12c833e3/xpnt<t0ttu8/vv....j.jj..j..",
+".jjjj.j.jj.j...jvv>)'99999i9h(cpeee3/=r8cu0uu)=/.......j..jj.jjj",
+"j....j.j..j..jjjjjjv>%-&q99q#(0n//ej3>w$)66w=e...j...jj.jj..j...",
+"jjjj.j.jj.jj...j..j...e>8u-#&#t+//3v3/==w>/.......v...j..jj.jjjj",
+"....j.j..j..jj...j.j....vje/=w%w>/ej.v.v.v...j.....jjj.jj..j...."};
diff --git a/pixmaps/ground.xpm b/pixmaps/ground.xpm
new file mode 100644 (file)
index 0000000..f7005f0
--- /dev/null
@@ -0,0 +1,381 @@
+/* XPM */
+static char *ground[] = {
+/* width height num_colors chars_per_pixel */
+"   128   128      246            2",
+/* colors */
+".. c #3c210b",
+".# c #8c8564",
+".a c #c4b9a2",
+".b c #5c553c",
+".c c #aca184",
+".d c #846141",
+".e c #ac896a",
+".f c #847554",
+".g c #4c3e24",
+".h c #dcd1bb",
+".i c #c4a182",
+".j c #746944",
+".k c #dcbda2",
+".l c #9c7554",
+".m c #644523",
+".n c #745537",
+".o c #9c9574",
+".p c #ac9573",
+".q c #847d5c",
+".r c #c4ad8c",
+".s c #9c8567",
+".t c #d4c5ab",
+".u c #bc957c",
+".v c #9c8974",
+".w c #846d4c",
+".x c #5c492a",
+".y c #443117",
+".z c #d4b99c",
+".A c #746142",
+".B c #d4b59b",
+".C c #bca184",
+".D c #c4ad9c",
+".E c #644d2b",
+".F c #ac9984",
+".G c #947554",
+".H c #dcc8b0",
+".I c #6c654c",
+".J c #5c3d1e",
+".K c #6c5534",
+".L c #9c8d6c",
+".M c #947150",
+".N c #ebd4bb",
+".O c #947d5b",
+".P c #ccbdac",
+".Q c #9c7d5c",
+".R c #ac9d7c",
+".S c #846d54",
+".T c #54351c",
+".U c #745134",
+".V c #84755c",
+".W c #745d3b",
+".X c #c4b594",
+".Y c #7c6142",
+".Z c #bca594",
+".0 c #644d34",
+".1 c #3c2910",
+".2 c #b4a98e",
+".3 c #9c9176",
+".4 c #d4bdac",
+".5 c #ccc0a4",
+".6 c #84694b",
+".7 c #ac9173",
+".8 c #544525",
+".9 c #b49579",
+"#. c #bcb59c",
+"## c #ccad92",
+"#a c #a48563",
+"#b c #4c391e",
+"#c c #e3c8ab",
+"#d c #6c5d3a",
+"#e c #9c7d64",
+"#f c #ccb99c",
+"#g c #aca18c",
+"#h c #e3d8c4",
+"#i c #c4a98c",
+"#j c #7c7154",
+"#k c #dcc5ab",
+"#l c #a49d84",
+"#m c #bcad9c",
+"#n c #bca98c",
+"#o c #c4b59c",
+"#p c #543d1f",
+"#q c #a49579",
+"#r c #8c7d60",
+"#s c #bc9d81",
+"#t c #545134",
+"#u c #4c3117",
+"#v c #d4c0a4",
+"#w c #5c4526",
+"#x c #8c6d53",
+"#y c #8c755c",
+"#z c #442911",
+"#A c #645d44",
+"#B c #e3d0b9",
+"#C c #7c694a",
+"#D c #64452b",
+"#E c #7c593c",
+"#F c #bca18c",
+"#G c #b49984",
+"#H c #94755b",
+"#I c #6c553c",
+"#J c #947d64",
+"#K c #7c614c",
+"#L c #6c4d34",
+"#M c #543d2c",
+"#N c #948568",
+"#O c #645533",
+"#P c #ac8d73",
+"#Q c #dcbdac",
+"#R c #745944",
+"#S c #ac957c",
+"#T c #bcae92",
+"#U c #c4ad94",
+"#V c #d4c5b4",
+"#W c #a48974",
+"#X c #8c6d4c",
+"#Y c #d4b9a4",
+"#Z c #74624c",
+"#0 c #ebdcca",
+"#1 c #6c4d2c",
+"#2 c #dccdbc",
+"#3 c #5c412c",
+"#4 c #a48d6c",
+"#5 c #7c5d3e",
+"#6 c #a49175",
+"#7 c #8c694c",
+"#8 c #b49174",
+"#9 c #cca98c",
+"a. c #442513",
+"a# c #b4a184",
+"aa c #8c7553",
+"ab c #ccb19c",
+"ac c #a48163",
+"ad c #b4a18c",
+"ae c #c4a58c",
+"af c #bc9984",
+"ag c #5c4d34",
+"ah c #ebd8cb",
+"ai c #a4856c",
+"aj c #e3ccbb",
+"ak c #ccb9a4",
+"al c #a49884",
+"am c #8c7f6c",
+"an c #442d1c",
+"ao c #e3d4c2",
+"ap c #7c6c54",
+"aq c #948574",
+"ar c #64583c",
+"as c #b49d7c",
+"at c #ccb59c",
+"au c #5c5130",
+"av c #d4b5a4",
+"aw c #745d44",
+"ax c #ccb594",
+"ay c #846954",
+"az c #ac917c",
+"aA c #6c5d44",
+"aB c #c4a994",
+"aC c #dcc5b4",
+"aD c #bc9d8c",
+"aE c #a49184",
+"aF c #c4bda4",
+"aG c #846544",
+"aH c #ac8d6c",
+"aI c #c4a584",
+"aJ c #dcc0a4",
+"aK c #9c795b",
+"aL c #644924",
+"aM c #74593a",
+"aN c #ac9973",
+"aO c #c4b18c",
+"aP c #9c896b",
+"aQ c #d4c8ac",
+"aR c #bc997b",
+"aS c #9c8d74",
+"aT c #84714c",
+"aU c #5c4d2c",
+"aV c #44361c",
+"aW c #d4bd9c",
+"aX c #746544",
+"aY c #bca584",
+"aZ c #c4b19c",
+"a0 c #64512b",
+"a1 c #ac9d84",
+"a2 c #947954",
+"a3 c #dccdb4",
+"a4 c #5c4123",
+"a5 c #6c5934",
+"a6 c #ebd8c0",
+"a7 c #94815b",
+"a8 c #ccc0ad",
+"a9 c #9c815c",
+"b. c #847154",
+"b# c #54391d",
+"ba c #84795c",
+"bb c #7c6544",
+"bc c #bca994",
+"bd c #645134",
+"be c #d4c0ac",
+"bf c #b4997c",
+"bg c #ccb194",
+"bh c #a48963",
+"bi c #e3cdb2",
+"bj c #9c8164",
+"bk c #ccbd9c",
+"bl c #bcb19d",
+"bm c #544123",
+"bn c #a4997c",
+"bo c #8c8164",
+"bp c #4c351b",
+"bq c #8c7153",
+"br c #8c795c",
+"bs c #442d13",
+"bt c #e3d4bb",
+"bu c #7c6d4c",
+"bv c #64492b",
+"bw c #b49d84",
+"bx c #94795b",
+"by c #6c593c",
+"bz c #948165",
+"bA c #6c5134",
+"bB c #94896b",
+"bC c #bcb193",
+"bD c #ebe0cb",
+"bE c #a4916c",
+"bF c #b4a584",
+"bG c #8c7953",
+"bH c #b4a58c",
+"bI c #9c916c",
+"bJ c #7c7654",
+"bK c #bca58c",
+"bL c #7c654c",
+"bM c #54422c",
+"bN c #84654c",
+"bO c #dcc0ac",
+"bP c #ac997c",
+"bQ c #c4b194",
+"bR c #d4c8b4",
+"bS c #a48d74",
+"bT c #8c714c",
+"bU c #d4bda4",
+"bV c #74654c",
+"bW c #6c512c",
+"bX c #a4815c",
+"bY c #a4896c",
+"bZ c #ccbda4",
+/* pixels */
+".Wby#5.Wbq.Obf.9#sbx.l#a#J.w.Oasbwat.9#sbgaI.7bfbr#nbj.0#T.taZ#nabbUbK.Y#w#wbL#JaY.7bgbf.O#ybj#sb..6.sbY#x.Sb..Sbj#C.nbrbY.s#i.C##ax.sbjaxatab#U#abfaa.saabfbjaTby.6#O#w.E.Y#Jas#nbgbZbU#Ubeaj#2.s#N#iaYbf.p###e#sbQbw#6bQak#UbgaabPa#bY.p#S#F.7.paYbwbfbf#s.7bh",
+"bybybL.Ybbbj.9.9bf.QaK.ebqbrbj.CbfbK#S#P####.C.C#Jbf.s#R#qak#n.ZabbUaY.S.0.xb.bzbw.9#s.pbYbj.sbfaa.Sbj.sayay.SbbbzbTbAbqbYbY##bfae#i.paPaY#UaZ#ibh#8aPa9#X#4.Obq.A.S.WbW.0a5bxbPaY#fbUbkaBak#B#2.F#S#UaIbf.s.C#aas.Cbwbw.CbQ#U#ibx#4bP#4bf#G.C.p#6a#ad.9#s.C.e.Q",
+".W.6a2.w.S#4#a.7bx.p.e.e.sbPbw.raB#TasaMac.r#ibjaP.saa.6bV.v#q.7bH#kas#6#C.Yb.#C.OaR.eas#s#4bxbq.G.Ob.bLaw#C.YbA#5bqaT.sbfbz.9asasbwbg.Ca#a#bw#S.ebY.paa#aaibh.9.O.s#J.saMbvbr.CaP.rbQasa#bw.HaC.HbZax#S.pbb.saHafa#bw#UbKbw####.7as#nbKasbK#i#s#4bP.r#6as###4aa",
+"bb.6#S#4br.Qbxbq.6.raKa2#JazbU.B.zbe#n.w.K.Yas#4.7a7#H.Saa#r#Saz#C.L#na##y.V.w.Y.YbhaH#8as.7aa.6bL.7bL.W.6b.#C.A.m#5.pbKad.sbx#P.7.CaYaYbf#4bY#W.7.9.9bjbfaH#sbf.7bf.7asbq.w.w.p.Aaa.p.O#JbSa1.D.4bZatas#4bT.saH#H.z#UaxaWbK#S#S#Sbf.C#ibfbSbw.Lbr#4bwa##Xas.7aa",
+"bda5bYbf.7aP.wbq.W.sbf#X.W#C#P#nbg#fbfbYaGaL#y#i.rbfbfaP#6aP#4.O.S#6aYaJatadbq#y.Y.GbT.W#abxbYaa.A.6aT#yaP.OaX.AbAbAbj.pbS#NbPbS.7as.7bYbzbj#6#abY#SbgbSbh#S.p.7.7.7.p.9#4.7aa.S#y#ybjbz.sbxaPbc#Tai#6bQbP.sb.aaaM.s.C#J.pbwaY#GbP.pbPbKaIbfa1bKbSa#.CbQaaa2.pbb",
+".wbN.G.saP.sbqaM.Y.Obqbq.Yby#5aPaH.Cbx.p.Y.0.Yaias#n#i#saxaYaPbT#Cbrbbbzbga#bKbw.fbTaHbG#H.ObYbPaabb.S.wbr.Sbu#J.Sbubv#IaTaaaP.7#4bj.s#J.w.w.p.Gas#4.9.9.ObYbY.p#6bf#6.p#H#P.Obx.6a2aP#i.C.pbf.rbK.RbSbwatbQ.s#Cbx.A#4aPaN#qbw.Ca#bKbPbw.9#nasadbFbf#qa##4bq.saa",
+"bY.p.ObY.s.7.7#H.s#ia#.7bq.Y.6azbYaHaGbY.A#w.sbwbSazbYbf#i#ibY#C.WbT.xbWaa.A.7bQ.F#6bP.p.sbj.Objb..wbzbr#y.O#rbSaP#4bL.K.K.Abbaw.saHbq#X.S#Ha##abE#i#abf.C.7bQbfbfa#bE.O#Ja2bY.7br.s#4.7#ibwbQbKaY.9bwbHaZatat.saY.7aaa7.7#4aP.pbQ#nbPbP.sbSazbQataP.p.O.sbj.sbS",
+".s.s#ebjbEaN.7.9a2#ibObf#sbxbSbw.C.9bb.Eaw#wbx#UbY#4bY.s#sbfa#bhbb.Ra7a5.W#d.AbrbQ#U#UbwbY.waa.Oa#aa#Cbq.S.s.7bxbq#xas.s.Aa5.KaUbq#4bq.6aa.p.7bhbjasbj.Qat.Cbf#eas#6.7#P.YbA.W.sbw.C.s.S.7bj#i#i.r#i#UbU#Tbfbc.C#4.CbT#X.O.sbzbzadbnbj#W#ybqbj#q.2#y#y.s.O#4bYbw",
+"#P.7#4.s.C.p#Jbq.Wbx#i#f##bYae#U#faWaYbb.x#w.A.s.p#S.9bY.7#GbUbUbPataW.rbz#6bz.O.vbKbQaZbQbY.A.Ybf#6aXaXbA.Wb..w#Pbq.7.Q.w.p.w.K.6.Qbv.x#L#Xbfbh#S.C.9ac#s#UbfbY#J#P#ibK.n#D.J.6bYbYbq#5bx#X#Jbg#UabaBbc#ia#atat#P#saH.pbx.O.O#ya1bQazbPbKbYazbzbz.sb.bj#Jbx.9.s",
+"bj#P#PbxbP#6bY#Xby.6bYbK##bw#Uatax.BaJ.p.Kbm.K.w#4#4bf#P#S.C#ka3bH#k.Xbe#6a#bHbwbSa##i#nbga#bx.wa2.sbu#C.Kbdbdbyai.Qbja2.w.C.s#Caa.sbd.E.E.YaHbY.C.C.ebYai.7#U#P.GbxbK.r.6bA#w.W.s.sac#7a9aK.6bf#Sbwabad#U#S.CbKaHaYasaYbEbY.LbYbKata#as#UbPbw.Fbr.s#Jbja9.ObYbj",
+"bj#Jas.s#dbb.Obxbb.wbLbAaPbfab#v#nas.z#c.C.G#Xbh#S.7bfaYaB#U.Haj#TbQaxatat#T.4bU#faYatas#qbj.p#8.6bq.Sb..6.Y#Cbb.Oa9aHbY.Y#a.O.saG.GbuaabTaM.GaM#x#4ac#Xac#a.9.s.s#H.saH.e#E.S.Ybja9acbYbx.Q.na2.AbVa#abbQas.S.ObY#4bYbYbQ#Ubf#nbw#Fa#.9#i#Sbx#SasaPai#SbYbx.w.Q",
+"aP#4#q.CbubbaMbb.wbjbfbr.GbL.7bZasbfbx.p.ras.7.p#ibK.pbKaJ#fbea3.tat#U#fbK.ZbQbQ#f#iax#ibK.7acbhbxbb.6bj#La4.Y.S#H.w.9a2.K.w.sbj#4bY#S.O.p.GbqbbbA#5#saK.Qbj#Pbj.r#s.s.sbfaibjbj.s#e.nbq#5.K#Obyb..K#y#Sa#at#4aY#U.9bf#S#6#F.sbz#f#obfbY.C.Ca##6at#U.G.p.CbYbAbb",
+".w.w.OaN#n#6#S#S.S.was#i.p.6bbbras.7.K.WasasasaebQbg#SbzakatbZ#fat#f#nab#UbKae#n.7.sbK#f.Cbf#a#ebjbLa2.6awby.KaP.Y#D.x.K.Wbv#P.eai.p#S.Qbjbj.s#abq.Uac.GaK#aac#X.7#i#saY#s.7.e.CbPaibx.Y.Kbd.KbybrbqbSbcbK#G#TbY###i#i.C#6#SbYbLbr#n#UbwbYbr#4bq.paY.sbjbY.saMaL",
+"aX#dbjbj#4a#bS.7#WbqbP#i#n#4.wa0.r#f.sbra#bwbS.s#n#UaB#6#UbZ#T#S#nakbw#SbgbUbgbUbK.s.Q#4atbg.9.6.O#J.6a4bv.xbbbY.O.EaM.0bA#uaGbjbxaibz#e.7.7bx.9.saa#5aM.M.MaH#4bxa#bfbw#sbwbq.QbS.s.O.SaMbWbd.w.O#eaPbSaP.Vas.6.w#4.Cbx.s.Obr.S.8.W#Jbxbj#Cbra5#y.p.7#J#GaP#Z.x",
+"a#bY.sbxbzaz.ObqbSbS.C#4axaH.ObyaN#iax.r#f#oaY#qasbf#fbUbH.P#oaZat.Hbcbj#FaY#W.rbUaYbY.C#n##bfasbj#Ja9#5#IbA.YbY.Y#5bu.6bx#x#X.Qa2.wbjbx.O.7bq.K#5.6aGaMbXbh.eaebwaP#4bP#G#s.7bPbzaP.pbz.wbA.K.Ybx.sbP#GbP#JbGaa.Y.Ya7.6aw#Ibr.fb..Kbybd#Cb.bQ#4bwbfbSbPbUbU#qbz",
+"#v#v.DaeadbPadbYbjbYbQ#G.Cbf.saaa7#4bK#fbC#obZbQbQbf.C.H#m.P#h#2akbebead.s#J#6aYbQbO.r.z#oae.7bj#4.s.7.9.s#4bq.9b.bNbbbrbj.e#4asbxbA.wbY#4bSbw.w.Wa0.n.K#X.e#ybfbKbKbwaYbYbK.Fbwaz.sa#a#.saTawbb#y#N.CbcbPbwbPbw.s.ObS#6.v#J#S#6#SaP.vb.bxbL#6aP.F.9.vbz#6a1bea3",
+"adbHbKabbKbP#q.s.6aw.7bKbK#ibYbz#S#n.r#U#oa1bQa1aBas.Y.s#mbRaoaoa8at#BbZ.7.p#6bKaxbP.s.s#fbK.iaia2.e.9#aaPbY.A.sbh.waw.6aH.7bx.O#a.Ybv#CbTbxaY#UbSbE#4.Ya4.n.K.6aS#TbK#nbPat#Ua1bu#C#P#nbf.p.7aP#r.w#N#SbKasbzbK#nbxb.ad.R#6#obKbK#Y.t.4a1#NbxbSaz#G#J.saS#6#6#g",
+"albSbKaZbUbcbS.s.Y#I#J#sbKaYbY.p.rbQ.C#4#T#G#6#J.C.p#I.6#q.P#2#2#mad#B#ka#a#bE#6.r.p#JaPbQbf.9bh.saR.Obx#ybG.Ybjbr#C#C#y.p.e#xaa.GaGbma5.Wbx#S#UbKas.Cbj.JbvbAayaSadaBbQbfbKbQa1.sbrbq.7aYbPbPbS.s#y#J#NaYbfaTaP#G.vbradbc.FbH#F#Fab.tbUbc#q.v.s#4az#J#ybS.RamaP",
+"at#S#S.FaBaZ#maZ#6.WbL#ebwbw#GbfataYbjbY.Obhaa.Kbrbr.Abr#Jbc#V.tbwadaj#B.4bwaY#Nbf#f#ibYbf.p.saH.9#s.Ybrb.bj.waTb..6#C#y.s#H#6#Tad#ybdaT.Ybq#ybqbPbYbj#4aaaPbY#NaPbSbKbebS.6#6#4#6.sbLbb#S#N#a.s.O#N#4bwbwbfbq.Abzak#o#mbcaS#6ad.C.7.CbQ#i#S#S.s#W.Obr#J#N#n#6a1",
+"bC.Z.v#J#6bc#fbZ#T.saP.FbKbP#Gbjasa#.sbjbTbx#4.O.OaPa7.CaPa#.t.P#nbH.t.h#2.Pat#Uat#k#UbraYasbfbf#4bgbrbY.p.9bq.wbL#y#J.6ac#4#PbQbe#YbH.DbKbw#W#6bw#P.ObjaYbga#.C.SbzbjbK#n.7aabNbb.WbAby#6bPaY#nbx.Sbzbw#FbQ.pa#br.Fbc#qbK.p.FbPbc.s.S#6bg#Ubxbz#JbrbqbPbj#S#Sad",
+"a1bS.3albwaZbcbeat.FbPadbK.F#q#y#6bPasaaaa.7.CbEa9.7aNbf.sbSbebe#o.Fat#m.DbQbKadbU#U.Bbf.r#U.zabbY#Gbfbgas.7.s.w.S#ybj#H.p#P.6b.bSad.taCbU.D#UbHbwa##6bx.OatbjbYaM#L.A.ObfaP.mbm.KaM#u#p#R.wbY#4bjbrbybjbxad.va1#JbzaP#S.sbrb.babY#4bq#Jbw#S#F#q.Fadb..O.7adaba1",
+"bPa1a1aZalbH#6a1bQai.sa#bw#T#Ubw#Ua##n.R#4bE.sasbja2asbS.7.7#FaZ#Yat#o#n#SaPaN#J#SbxbwaxaY#N.sbSbqb.bE.7bK.s.sbb#r.6aybx#H#J.s#6bK.s.v.3bw#TbU.4ad#6bxbybmawbPbYa9.wbYb..saP.KbW.Y.A#u#zbp#w.0.mbL.W.S.sbx.7bcaS#q.F.v.v.sbz.v#rbz#S#6bSbPad.2aZ#o.a#JbVasbH.FaS",
+"a1.2aZa8a1adaZ#U#ibQ.saebKbCaZaZaxbQbPa#at#6b.bYa2b..C.CbSbK#WbQadaZbwakbZ#U#6bEbY.C#i.rat.pa5#C.waMbjbEaYbKbjbu#q.6.Y#ybrbqbub..r.7.c#Uada1a##Uat.D#obwa4#pbua9.w.s.p#n.B.k.G.Y.YbW#wbpbs.1b##p.EbA.A#Wb.#Z#T.vbzbwbO.ZaZ#Sa1aSbGbz#yap#N#6#m.ablblalb..V#6a#.F",
+"aS#gbc#maZa1bfbKbw.z.CbHbKbH#n#T#U#SbzaP#fbgaPbP.Cbr.w.7.YbxaPa1bH.D#TbH.H#Ba#.C.O#aasaxakaOaaa5aP#C#1.6brbrbLbua1bcb..s.sbzbq.6.Objbw.2ak.Z#N#S#oakbUakbr.O.LaPbbbSbw##bg#iaK.MaR.M.KbM.x.x#w#p.gbp#M#I#HbAbr.F#6bSbwbw#6.SaA.A.s#N#S#6.v.3#n#ga1bH.2aSaS#U.FbP",
+"baaSad#o#UbcbK#U#WbS#FbQbcbw.F.F#nbw.pbraa#n.raWbfaPbqbP.pbw#fbK#o.Da3#T#6bPbQ#U.sbfbS#S#Ubkas.6aYbh.Ybx#C.6.W#C.vaYbSbS.Sb..6.W#H.Qb.#y.v#UataZbebl.Hbeasa#bRbiadbKbw.7#F.r.ibX.7#aaabA.A.v#y#wbpanbs#w#5#3arbj#y#KbS#J#S#qapaabu#y#6aZaS#yaSap#6#mak#T#J.SbzbB",
+".Vam#6#U#naZ#Uat.FbYbP#Ta1bSbc#nbKbw.C.O.Y.QaYbQ.pbz.7bw#ibKbibZak#Y.tbQbnbS#nbQbY.C.9.ObHbQ.C.fasbh#a#a#JaP.S#J.FbKad#S#JbLbq#L.M#eb.b.bVbSbe#oata1ak#v#NbS#Vbeakak#Ua#bfabax#a.p.9.7aTbb.paa#D#b.8#p#L.SbL.S#J#C.K.Obqa1#S.s#qby.A#Zaq.s#Zaw.0bzbKaS#gbr#Z.vad",
+"aEaqbzbHbc.D#f#oabadbw.F.v#yat#o#obPbSasaM.nbYaaaYbSaYbEbwbYbfaB.v#6abbUat#fbw#s.s.s.7bx.v#SbS#6.r.raIbY.rbKbfbf#n.C#fbUbQ#HaG#L.d.Mbx#N#ramak#6.Z#UbKatbS#ybeaZbe#2bibe.FbP#faW#i.Cax#i.nai.7#yaMawbzawbj#abSb..Y#ybrb.#qbYaPaYbj.sbv#wbM#3bdaw#O.fbr#6.F#6#P#S",
+"aSbz.v.FaZ#m#v#YaBad.s#6#Jaza##S#Gat#S.7.Y#1.sbqbPa#.r#6brbLaPa#.Fbnatat.sbj#J.W.6aHaP#N#ybz.7bPbQbH.s.p.CaPbKbw.C#G#n#Y.CbxaL#D#x#H.0.YaP#q.4#Ua1#n###UbUbYakakaZaZ#Vbeasbr#JbkaxbP#ibUbjbYat.ra##Jbfbrbx#ybhbY#Cbqbx#G#Ga#a2.ObKaY#CbmaVbpbmar.EbdbzaSbPbSad#6",
+"blala1aZalaZad#o#U#n.s#J.saabj#Hbba#a#.CbY.e.O.Ybj.sbc#faSba#o#vbCa#bK#nbPbS.sbq.sbrbrbj#6#6#S#U.sbw.7asbga#aYbfbfai#s.ZaeaY.6#1#PbK#C.Sadatat.4#SbzbK#WaY#nat#vaZ#mbH#f#S.s.A#xabbwbe#katbgaZat.X#n#T.rbS#n#6.r.CbYbvbv#Z#4aYbf#6.7#C.x.x.8bdb.aa#JaPaz#SbSa#.s",
+"a8be#m.DbH#Ua#bcatbcbKa7bq#5.Q.Q.Wbjb.bYbfbfasbqaS#J.sat.2bjad#o.PbSbQ#i#qadbK.7.s#yb.aSak#F.7##.wa2aM.d.7bf.s.sbY.6bf.k.DaW##bh.O#iab#n.Z#YatbKat#Tat#GbjbPatbH#6.2#U#o#Tbgai.WaibfaEbcbc#T#U#oat#v#nbUa#aZb..w#iaY#5bs#3#J.S#S#UbwaxaP#w.Y.ObSbrb.#y#6.s#Jbr#q",
+"bc.Pbcadbeakakakbeat#F.sbxbqbha9bxbfaYaHbf#saJaY.Cbwazakbcazad#G#B.t.Da#.Dak.F#Sa#bz#6bwbcbY.7.C.O.6.E#1bT.9.r#nbS#5bxbKbZbUa#bgbwae#TaCadabazazbZaZatbU#sbQat#6.VaZakbU#S.p###Ha4.Kay#J.7#FbcakataBbKbwbz.7aPbdbwa#bj#p.T#wawbx#F#faC#iaG.Gbw#S#Fad#6#6.Fa1bSbS",
+".v#6bc.F#6aZakakaZakat.C#4#r.G.wbb#C#sbfasbgaWa#.Sbx#4a1bwbK#F.7bKbKbjbqaSa#bz#y#Ubw#6aBbP.w#s#iat.paa.n#8.s.C#f.rbYbr#4aZbQ#oatak#G.FaB.rbebw.vat#v#UbfbSbx.s.v#q#FbP#Gatazbh.Ebp#pbA#y#UbfbYaP#ibSbjaibA#wbybLbubjasbjaabb#4aNbPbwadat.RbS#nasadbKamaA.Raba#.7",
+"bKaz#Jbqapaq#S#T#UaZ#U#o#SaaaaaT#y.AbLbraz.saY#n.O#S#naP#6bYatbcaP#J.O#5a5bd.AbYaP#S#6#4aP#abx#XaW.rbYbTbf.9#f#Y#kbU#TbwaPbS.sbcbKbP#S.sbQbe#kataZ#U#4aGbb.w.YbjbxbjbqaMabbKbfa9bW#w.K.w#iaibq.Y#JbYbq.SbN.E#pbybbaraM#6#a.Oas.pbfasbwak#Ta#bQ#UbwbS.va1.va#.7bP",
+"aYaibL#KbV#y#6#Fad#UbKbw.pbq.A.Y#4ap#J#Sa#bqaN#i#Jbj#iaz#6bjbK#ibSbjaabbbA.xbdbzbj.p#4bz#e.s.G.waZaxbPbh.C.9.zaZbebe#fbQbr#Jap#6#J.sbj#xbfat#2ata#.7.s.6#d#H.WbLaM.6.6bA.p.sbQata2.E#5.wbf.7ayaM#HbYaibjbba0#p.KbxbV.x#JaH#abg.pbj#S#G#UbKbF#oakbw#q.FaZ.sa1.7aP",
+".w.K#1bd.Eb.bc.7aP.sbwbz#6bE.6.YaOa##nbSbYbj.sbg#4bN#J.sbj#Jbjbc.Obx.Qaaaabb.W#HaP#sa7aGbb.6#4.9#Sat##.CaIbKbeat.P#VbZ#UasbYbxbj.s.s#4aa.6bSbUatbwbKaI.7.W.wbW.naMai.Q.wbf.7#6#kbgbh.wbA.nbx#X.6.CaY#4bf.6bWbm.Kbbbx.W#L.6.Ybjbqaa#xbS.v.s#Wbwbwad.F#Sbw#6bjata#",
+"asbEbb.Ebybq.C.sbq.Y#J#a#4bP.pa7.6a2bb.K.Y.6#x.7as.Lbx.Aby.sbza#bqbWa2.7bS#s#n#YaYa#bgbEa9.Caea#br#6bf.s#s#8bZbR.4#k.HaY.r.paI.CaBaebwacbq.wbLbqbTaP.i.9.wa4#waM.0aG.Y.wbfax.rbQ.XbUbfbb.E.x.Waw.CaRbfa9.7a2bT.6.Wb#.Ubv#u..b#.naaa2bz#S.Z#6.Obj.sbYbLbqaaaMadbw",
+"bg#c.C.G.6.Ybqbh.w.6#PaN.7a#ax#TbY.ObjbTaMbGb.bq#6bfbr.ObAa9bj.ObPbbbd.wbx.r#U#fai.7a#.Ya9##.C.C.r.C#i.6bfab#obe.ZadbQaPbqaT.GbqbzbgbS#y.K#1bLbq.EaM.O.e.QaT.A.A#CbG.wbb.AbGbj#S#U#obgaNa##J.p#I#1.d#a.s.Obja9.Ga9.waK.ObA#u#bbd.Ebj.sbw.DbKbxaa#5bL.6bxbxbb.7br",
+"bKaxax##bh.K#w.K#5bq.r#i#4aPbK.r#oa#aW#naaaH.n.6a9.C#s#ia2.w#4.CbSbF.7.wbbbr.6.6aP.C.Ca2.W.7.sbYaPaYaWaIbq#Gbe.4ak#UbP#4aa.Y.nbq.O#Ubw.sbAbmaM.G.8#p#D#X.7.paP#C.W#Cbb.s#Zb.a#ataabf#i#S#c#k#UbY.Y.Y#5aMbjbT.7#X.p#s.e.7bLaw#ybb.n.n#H.9bwbP.Q.S.K#KaMbx#X.G#nbg",
+"#6bKat.k#i.7a7bN.O.A#H#4#s#Ubw#U#faPbFata9bx.Y.W.6#4bE#4a9bqa9#f.7bYat.pbr.A.Kbyaa.G#4aYbY.9#4bh#4bw#UbKbjbq#r.s#UbUbKatbK#Jbxbj#y#6#YbKbPaT#p#p#w#w.K.w#s#ibx.O#N.AaG#na#bQ#6.7bxbTaYbfbQ.DasbKaI.QaM.wbh.YbY#X#4ax#5.ObY#Sak.C.Q.U#5#xbwazbqaG.W.A#C.wbb.Aaa.7",
+".RbHbSaY#i#S#vbg#i#Jbj.pa##F#nbQbfbzaa.CaYaaa2.W#C#JbY.p#a.9bx#abfbg#ibK.p#T#N#6aH.sbG#Fbgbw#ibY#4aiax.zbf.z.Fbx#6atat.CaB#S#yaMbS.r#f.kbU#iaLbv.WbmaM#Xa9.p.O#rbE.LaTbba2#X.EbAawaM#rbb#y#H.YbuaHbTbT#1.Q.6#y.G.A#S#4asaw#JaeaOaI.9bq.YbbbYbG#4bj#C#Cbq.wbGbybL",
+"a##naa#4bKbKatbQ#i.r#nasbKbY#6.p.O.Wbjas#i.C#s.p#6#a.pas#e.7.s.sbg##bUaYb.#T#naY#U#ibx.p#G.z.CbYaMaL.d.p#xaKbj#ybxaP.z##aY#n.CbTbxasbz.p.Gbjbv#p#daL.Y.G.6#6aJat#nbU#n.Lbq.O.Y.E.wbTaTbT.Q.s.w.Y#X.O#8aT.Oa2.7bx.EbL.ObY.Yb.bbbP.7bras#rbq.Y.7aY.sa7bra5aTbg.LbK",
+"braP.waabw.R#F#6bYas.r#sbKasbzbx.s.Y.wbhbf.u#iaObwbfbwbw#a#4#s.p.H#Y#kbU.vbHbKbKaYaea7bf#G#YbQbhaG.maL.6.nbAaaaa#Haw#i#iat#i.rbYbqa7#5bq.n#e.Eb#.EbW.M#a.Y#Jbebe#T.t.P#UbPaYa7aM.MaGaaa9bYbfa9#CaG.Q.Ca9.CbY#4aibybLbq.sb.brbAbr.p.W#Tbw#4aTbSasaaa7bzbbaTaYaYaY",
+".EbyaM#Ca2#ybq#Kbv#C.CaYbwaxaP#4.pa7aM.W#e#PbfaI#6af#ibgaNbq.r.zbU#2#2.H#kakat#n.7.s.7.C#ibK#B.C.6.m.Ja4.Wbq.sbxbY.O#sbf.4#oae.7.O.S.E.Ebq#6bxa0bvaM.l.QaM.K.O#ebK#GakbeaPbQbgbj#4aM.wbxbTaK.7bx.s#a.C.7#s.C.Q.QaP#6#JbTbbbzbrbras#ebY.Lbf.7aibPaP.s#q.paa.Aaa.Y",
+"by.KbqbT.fbjbz#y#Cbza#bwa7a#bfa#ai.OaG.wb.#Pbf.9bf.sbPbQbj.Obg.zbKa3be.Hak#kaZaYbw#S#n#fbObQa3aWaa.WaL.Ebx#sax#ebb.O#CapbY#6bS.7a7.A#C.K.Gbfae.9#8bj.lbX.O.w.WaGbwbQabaW#y.w#fbfbb.M#OaM.w.6.O#S#6.pbg.CaH.Cas.Qbj.saPbq.6#X.VaP#i#S.s.wbz.sbS#GbUak#U.H.rbnaP#4",
+".paabh.Ka2aab.#J.O.pada#aT#4bT.sbx.p#1.Wa2.s.9.ebj#S#Sad#6bja7ax#qaCbeaZ#nad#fbQ#Fa#bQbeakbUbk#v.X.p.sbfa#aPax.7bEbE#I.W.K.xa0#5bzbh.Obb.WbKbfaebz.9.e.ebjbz.6#xawaPbf#rby#C.Caxbhbhbu#Caa#Xbf#n#nas#Sasbg.Cbw.O.6.EbAa4.Ya5.WbdbraHaab.bG.6.0.6.7.F#i#n.a#faNbU",
+"#T#4.G#X.Abbbz#J.saP#Uakasasb.aG.W.6.Y.O.6aa#a.Q.7bfbPbf.p#y.6bw#S#6bZ#Ybw#q#YbKa#aY.H#k#natbQ#fbiaJas.7#s#Xa2bjbx.7bGbq.f#Cbvbbaabx#a.O.6bj.e#eaM#U.Qacaz.C.7bq.0bybQaYaM.W.saNbf.C#i#s.7#S#4bh.ObY#SbSbPbc#f#i.paPa5bmaLaa#q.S.sbKbj.6#C.w#w#waw.wad.R#f#vaabS",
+"axbgaa.Q.W.A.s.s.pbK#6#UataY#4bh.n.6bfaH#4#4bfaI.7aN.OaTa1#U.p.paNbYatbUas#4ak#F#Jaa.Ca6.r#v#U#n#UaY.9aKbg.s.ObTaw.w.sasbQa#bj.sbYaibP.CaK.6#5aG#R.saebj.Y#W.r.pbb.W#Sa##CaMaMaaaHaHbK.9aB.r.7.7bqbxatbeadbSbwbUafbY#a.G.wbz#n#Ua##s#U#FasaY.VaXbbbG#JbK.R.L#C.w",
+".p#i.9asbf.7.sasa#a#.Cbwat##.r##aaaG#s#i.s.paI.Cbh#4a5.W.7#SbSbP.r.rbS#n#na#at#UaYbqa2#s#ibf.p.7bqbfbgaRbf##.7aNbKbcbY.7bw#UbO#naz.p.CaibS.O#1#Dbv.Sa7.G.YaGaaasbAbd.A.wbbaM.Y.6#Sbf.9bf#4bfbQ.racbqbeaCaZbP#SaBaY#Pbb#5bd.EbzaCbc.6bP#UazbP#n#4#6bxbd.w#iaP.K#H",
+"bq#abYaR#i#Sbg#ias#S.p.CbUab#Q.kbf.6bh##bgbK.C.C.7.C.GbG#Sa#adbY.pa#.p#4bE.CasbqaN#4.7#e#9#n#SaYaibf#ibUaxaxbFbga#ae#6bx#N.sbF#F.rae#UbK.9#nbj.n#C#n#6.s.Mbb#Kasbj.Y#p.E.s.mbW#C#aasbY.ObPbSbKbK#4#x#Uak#obKbSbz#Ubg.pbxbd#wbdbc#G.YaP.Cbqai#nbK#qaP.SbL#naYbNa5",
+"bb#H#P.7.C#S#i#U#s#4bzbSbObU.zbOaY.Q.6bfbKbKasaY.7.r#4.7bH#UbQ#4.O#4bf#Ja9.saNbTa9.O#x#x.7ae.r.C.C#i#iat.z#fbKbg#Fa#aN.p.Ob.bYbP#U.CaB#ibKbU.r#Jbx.zata##a#Xbjas.pbba4.x.saL.W.Y#ybYa9bj.p#6a#a#.9bqa1.D#v#Ub.bybP.za#asaX.K#Mam.SbWbGbSbxbS#i#Ubf#Saa#C.7.p.6aM",
+".Y.6.9.C.pbf#Wbw#U.C.w.w#SatbPat#Y#UbYbw#nbgbY.p.9aY#i.CbK#r#N#4.ObxaYbj.6bb.p#6#C#wa.#za2bY.Cas.C.rbZbKbkab#Sbw.C#8bf#ia##qada#bUbK.Ca##f#k#kaIbAbP.N#ibgbY#Fbfbf.M.K#waM.G.ebGa2#a.e.7asbf#4#U.7.O#yaSaB#4bY#C.n.sbjbwas.Abp.1.0a2.s.O#abx#PbKbSaPbq.wbb#x#CaM",
+"bA.w#a.9ac.sbfaz#ibQaibq.Y#6atbKak#kbKbf#Sa#.wbzaabhaH.s#NaP#6#4#s.9.C.9bSa9bj.7#CbW#p#baM.Ybfax#FaY#f.X#U#fbwbw#sa7.G.O#U#YbKbKaBaBaZ#Uatak#kbF#w#Zbw#Yab#P.9at.raIaPaGbTbfbY.O.p#s#iaHbhaMbA#eas#ibVbr.FbK#fbF#3bdbA#xbPbw#b#z#IasbQbx#Pbx.Y#a.7aPbq.6bW.Wbhbv",
+"#e#Xaa#abj.pbf.pbYaebfbf.w.YbPa##F#f#obKbh#6aP#WbEbra2bz#S#oasbua9.9.9.CaY.pbT#1.6.w.s#ya2.7.7.C##axae#U#U#U#vbU#faY#4#7.G.FbQbw.C#nbQakbeak.taWaaby#IbybjaIbK#v#U#fax#8aM#4axasa##ibf#a.p.W.E.Oa2#6bKaZ#T.P.H#vaPaa.Oaa.EaX.yaVbxbQ#UbY.s#Jbq#4bY.6.WbAa5.E.S#X",
+"bjbY.pbf#s#aa7bY#4a#aRbf#i.p#CbS.raZabbK.p#WbwbwaY#SbTaabPbQa#bx.YaHbXaH.C.7bY.YaL.sataO.e.C#sbwazbY.paY#na##Y.ra#aN#ibP#HbrbrbP.9bSbKaz#nbw.F#UaZa1.p.6aG.WbhbibebUaJaI#X.WaYbK#Fbf.Cbh##.paT.O#4aGaPbw#fbSbPbQaOaY.7bfawbd#b.g.sa#asbPbxbqbq#H#4a2aMa5bb.Wbj.9",
+".CbPbK.r.p.7.p.sas#s##as.r.raY.p#Taxad#6.7#4#Sadatas.sbSbfaZbF.s.Ka2.6#5#aa9##.Gb#bb#iaI.Q.7bjbQbg.9.sbj#6bjbg#i.z.rbwaJbwaPbVaa#P#S#eb.bY.C#W#Wad#U#vat#4#5a0bzbU.F.kbU#nbz.CaYab#P.p.7#saIa#ae.G.K.xbAbwbKaab.bjbxa5bfa7.YarbLbraPbw#4bf.p.wbb##asbLbLbP.pbY.C",
+"#obQ#T.Cbwbf.C.paPbP.C.C.C#n#faxbQbc#n#GataB#6.vaZaZ.7.ObSb.#oas#CaT.C.sbxa2.Q.eaM.6.7aY.nbb.OaY.pbf#8aY#4bxas#n#ibw#y#GbZatbP#4#5.7.Ybr.6bjae#oaB.C#faJ#i#4aM.Ka#atbKab.H.D.7az.9b.aH#Xa2.w.AbYbK.sbv#pbqasasbS.L#C#w.w#4#r#Z#N#ibP#n##a#bQ#n#SbQaZbPa#bwbga9#a",
+"bQbHbKbP#F.p#Gbj#4bP#s#Fbgbgat#Yat#U#Ua#.C#oatbQa##U.FaPbz#NbfbKaT#C#4aNa#bEa2aRbha2.Q.wa4a4.Sbx.Q#a.ObfaYaP.rbQbgaYbYbq#UbUaZat.7az#J#I#I.w.s.7#nasaY.7.z#s.9.w.Y#6#Gbfa8be#s#Wbjbx.O.Gbb.Ya5.Kax#U.S.xbmaa#4a#as#WbL.Sbr.Sbyby#nbPbwbK#n#U#oaCbl#TbebZbKbw.7bY",
+"bHbw#UbK#n#6#S#ebPbc#F#FbgataZabbQ#vbPas#6aBbQaZadbHa#bwbrbSaP.p#JbGbEbh#naYbf.ibX.Y.6a5a4bm#IaT.7#abb#H#Ubfbg.zat#Ua##Jbwbcbwbw#ibwasbrby.Ybxa7as.7.CbSat#saY.7bL.w#S#Sak.Hbg#sbzbh.6aaaGaG.K.Ebg#UbS#C#bbL.7#PbK.Cay#CaSbYb..xbxb..p.Cbc#o#T.t.PbZaCbea##4.9#i",
+"#q#q#n#U#oad#J.7#N#6#PbKbjazad#U#SbQ.sbSbY#6#q#n.F#nbObUbHbQ.Cbw#4bwaYbPaY#n.9aI.wa4aLbb#w.Y.6.Was#s.paPas.9.paYaBab#i#Ubw#S#WbS#FaY#naYbY.A#W#4.7#PbfbgbfbgaIat.C.s#S#iaZ.P#ias#4.Obb.K.YbG.Wbv.ratbUbUbqby#S#nbf#FbKbSbSbPaZbqbx.w.s#4bKbQbcat.PbRatatbfbj.p#n",
+"bFbP#S#TaZakbf#Jbz.S.FazbqbY.saYbPbw#faZbPa#aSbQ#qbwbQ.F.XbKbPaBbwaz#s.paY.r.Q.O#4#CbW#5.YaM.6.Aa9as##.p##bgbq.Q#Pae#U#TbCak#n#6bYava#bKbKbY.9ai#S#s#Pbw#n#9bf.C.r#faY#F#oaZat#UbwasaIaGaM.ObYby#X#4#6bKbU.C#4aY.sbj#Y#Uapbybr.R.sa#.pbx#6bFaPbcbwa8akadas.sbP#F",
+"#SbH#6#nbCblaBas.C#6aBae#S.v#nbK#fa#a##S#6.C#na#.sbH.Z.Xa##6#U#n#kbcbgbf.9.p.O.saYax.C.Cbh.A.W.WbT.p#i.9aI#s.wbT.w.7bHbUakbebc#6#ya#a##JaBaB#i#U#S#FbS#GbwbwaebfaZbU#vatas#nab#vatbz#i.C#abwa#.O.W.O#C#O#4aP.s.sa4agbr#Ubwbz#Ibrbx#Jbw#Sbx.Cbj#f.Fab#obcbF#6aN#6",
+"a##UbnbH#obQ#Uaebf#Gbfbg#ibKbPa#bgbwbwbj.s#4#Sa#.FbKat.H#UabbkaBbK#v#Y#iaY#4bEbGaJ#vbiaJbE#4.O#aa2aN#a.QaRaHa9bb.6a2#da##qbHal#G#6.sbfbYaPbw.C#F.sazbzbK#UbKaeab#fataZbK#i#nbf#nab.ZaYbU.r.C#Jbzbbbb.Aa0#n.p.6#ebd.8ag.RbwbSbS#qaPaabPbHbq#SbG.s.Y#S#vbQasbE.paa",
+".F#S#ga1bK#oaZbQ#sbj#y.sbw#e#CaP#i#n#Sa#.9aH#q#SbQbZ.Rbwas.Ra#bK.vbKbU###ibg.ra2bf.p.Bbi#4.6bT.ObG.w.7bqbf#faWas.s.7.Y.Oa##f#T#nbw#Cbb.s#J.Yawbx.f#C.7.sa1#qbwbj#S#Ubga#bQbw#J#4at.rbgbU#Uat.aasbf.O.sbq#v.CaGbS.r.Fapb.bPaMb..vbcbw#ZbqbybqbE.sbybqbZak#S.sbY.7",
+"#Ubc#f.F.3bKab.BbU#U#y#H#yaa#C#H#4aYas#i.CaeaOa#bKat#nbKbKbwaS#nat#faJ.zbg.zaJbfbWbWbbaY.r.Oa9bb.Y.Aa1axaI.z.zaW.pbEbf#ea#ab#TbS.p.sbW.W.x#D.E.AbS#Sbz#J.f.F.7b.bY#J#fae#TbZ.7bYaY###i#kbH.X#kat#4.s.paabf#6.J#LaS.2a3bnbfbw#Nbz.sbS.Aaw.Abmb.bb.w#Z#U#vakat.7#i",
+"bQ#JaP#6#q#6#i.r#F.r.CbKbxb..6.Aaaaa.7aN.p.7a#bwbS#6aB.t#va8#obZ.Hax#fas.r.O#faY.W.EbW.Q#i#i.r.paP.Ras#fbfa#.7aH.C.9bx.O.Obzakatat##aMb##zb#.E.6bP#q.CaYbSbKbK#FaPbKaYbU.tbibUbfas#8#GbcaSbS#n#kaB#4.9#easbf#5.xagby.a.H.6#yatbcbSbj#ybz.VbyaabPbP#r.VbSbHbQ#UaY",
+"#SbzaP#6asbEbw.C#Sa#bw.zbjbb#C.Kbzaabr#4bP#P.pbfbSaibw#Taja3bZ.X#v#fab.saebG##aO#CaL.n.saRaYaI.rbE#fbK#o.p.9bfaH#4.7bT.6.wbzataxbUaxaabp#z.Taw.sa#az#iaebPbwbg#U.Fatbc#vbZ.H#Y.C#s#P.C#T#6.S.satbQbfbf#4aYbgbjaM.8.8bzbZbqbq.FbcbKbS#rbSbrbLb.#6aZ#q.S.V.s.CbQ.p",
+"a##Ta#.Obzbhbj#qbfbKaPbK#kas.O#Ca2#q.ObEaYaYbYbf#PbYbz#y.aaj.HbHaYax#i#S.s#s#UbiaN.w.K.QaI.iaHaI.s.z#f#U#S#4.C.C.G.Y.Y.A.s#6#NbPat##aY.Ybp#w.O#FbPbz.CbfbY#JaB.BbfaS#U.zadaSbS#s.C.9bPbe#UbYbSabbQ#i.r#8.7bf.C.CbrbdbL.sbSbS.Sbq#SaY.Cbwbzbr.vbzaB#oa##6#q#6aP.7",
+"a##U#n.O.w#4bYbYa#bwas#S#c#vbKbq.Y.s#saY.Cbgas.C.9#P#6#r#SbKat.Cas#fbQat#Fbf.p#6.raYbh#aa9as#4.s.w#H#U#UbK.s#s.p.Ca7aTaG#NaYb.bx.sad#vbf.x.xa5.Saka##U#UbYb.#r#W#CbbbSbg#f.pbYbSbYasbKbebK.i.C.HbQa##Pbfbx#4.7#f#vbf#y#4aabT.Sbbbz.7bP.F#C#ZbKbwbza##n#oaZasaabx",
+"ad#U#nbP#Cai.7bPbQ#U#S#NbP.C#sbY#e#5#J.7bYaHa##s#U.CaY#4.v#W#qbfa#.C#fa#ata#bP#4.Ca#aJ.XasaIaOasbq.Obf#U#oab#n#SaYaYaN.paabPbw.7.FaYat.rbjaMbx.s#Sa1.C.r#n.p#4.s.s#JbxbjbP.raebfbfbf.C#TbY#Pbx.7#n#naYaHbjbjbga#as.7bqbxa2.O#6bG.sbxaM#C.Y.Abz#SaPbPbc#U#faYbjbj",
+".s.OaOa#.sbYbK#U#o#vbQ#Sa##f#f#P.Obj#4bS.r.Cbwbgat#S#F#nbw#4bf.s#i.CaY.7#iat.rbK.p#6.7axbU#Ubf#S.ObYaB#nbwadbwbw.C.CbSbYbr.wbfbY.z#Ua#as#6bqbj#6#6.s.O.7#S.pbQbPaPaP.G.O.Sb.#4.7.ea7bf#6bq.s.6bzas#iab#P#a.s.CbY.7.7.O.Oai#e.7#sa1aNbx.Obrbrbw#Tat#Tbca#axaRbYbx",
+"#6.Obfbw#ybG#f.HaCbUbeatbU#Bbi#obK.B##.r#yas.OazbfbKbwbw#n#i.Cbz.7a#bf#FbK#nataxae#4.pbKa#bP.O.7bx#Cbxaabr#J#Saa.sbP.paY#S#J.7#P#n#U.C.Cas.Objbz#sbSa2bz.CbfatbZ#UbK#6.9#4.Obf#sbfbx.7aIbSaz.s#W#Ube#fbfbh.M#C.R.7aObfbY.p.sbY#nbQbga#bE.7#6bKakaZataZbwbS.O.saa",
+"#e.s#eaPaPaPbK#F#n#n#Sa#a#ata8a3bZbU#6.7aM#XbYbY.C#satbQbwbK#i.9aY#i#nbwaYbK#n#naxbK.7bwbwa#bjaPaP.6bd.K.7aP.pbj.Y.G#4#PbQ#UaBbfae#9.p#ibgasbzbxbS#4#J.7#4bHaZat#kbebjbYbYasa#bK#U.7#Sbfas.9#S#Tbwa##YaY#i.7a2aO.O.9bYbj.7aYbfbKbwbPbjbqbgbK.7#UakakbUbC.r#qbfbf",
+".pbfaB#F#y#rbu.w#y.p#y#J#6bSbQat#TbKasbYaTaabz#5.zbgax#fbK#S.9#S.7bPaYaebSbwbS#4aY#i.C.r#nbS##bPbYbYbzbb.7#4.sa#.w.Wb.bxaZasa#ai.9bfaM.saY#n#ibKaY.pbfa#aYad#Tbc.FaYb..6by.6.sbY.CbK.Cae.Cbg.7bKasaPa#aYbfaY.fa#.s#a.p#P#Nbf.C#ia#bf.C#4.p###X.7.rbZatbUa3.H#fat",
+"#s.7bgaWbLbu.AaXbbaP.Oa9bz#JataZ#6#6ax.9#r#yaa.K.CbQ#SbF.rbwbf#S#6.paY#i#6#q#6aPbf#iasaY.r.p#ias#4.7bfaabjbE#4.paNbj#C.w#6#JbYbY.CbwaM.6#6asbK.C#ibK.p.C#s#n.DbQ.Fbfaab.a0aw#J#4as.CaBbQ#8.rbwbwbP#6bEaYaP#i#Ca7#4#ebf.7#6as.iaYaYas.Cbj#abfa2.s.CataZaka3a3aZbQ",
+"bKbfbP#fbz.saa#C.W#ybQbKaP.s#i#i.vbzatatbFbj#C#Cbb#4#J.pa##FaebwaYbwbKbw#ibwa##6bqaa.Q.S.zaY.CbP#4bS.7.s.w.s#f#4a#axaab.by.K#Cbx#4.7.p#J.p.7#P#S#n.kbKaYbP#6bw#iatbK#nas.Y.OaibY#i.7bK###S.9#UatbK#iaa#Sas.p.7#6a#bY.pbwaYbP#s.CasaI.9a2.Obx#s.O#6.rbKa##B.HbKbK",
+"bUbQ.7bPaT.wbP.sbS.sbf#UbKae#i#Ubf#Sad#f#k#f#rbfb..wbY.7#6bYbP#UbcaY.p#4#S#qbKa#.A.Wa7bj#4.s.7as.7#4.p#4#4.O.7.C#U#UbEas#Nbqbz.sbqbGbQbgae#ibf#Ubg#i#c#v#ibfbjbS.B#U.X#UbY.Ob.bq.p#PbwbfbKaBbK#FabaBbY.p#nbf.C#n#na#.7as.rbYaY##.p#a#X.Q#a.9as.p.O.ObS.Aad.t#UbQ",
+"at#U.s#4.K.YbSaHbg#s.Gasai#iad#ibw#i.z#U#SbKbS#6aY#H.M#ybj.s#WbH.p#6#Wbqbx#JbF#nbbaaasbfbTbz.s.7bKaYbwai.p.Q.7#naW#f.s.SbU#n#n#ias.O.9.CbQbKbf#G#UbSbwat.rbw.7ai#Fav#na#aY.9bbbq#4bYai.zbK#fbUbKbfae.9aY.r.r.pbfa##6bzbSaeas.Q.r.p.MaG.GaHbK.C.p.p#Sa#bq#4#Y#vbQ",
+"#6as.saabz.sbjbT#4a9#5#ebN#yaW#Ubg#Uat.ra#bg#U.7bf.7bjaa.Obj.SaP#n#S.C#FbjbS#JaP#4.9aN.Oaa#P.p.pbP.C.C.9.paY.raJbO.HbZa##o#naYas.7.s.ra#bUab.pbS#6bKbQaJbg.Cbf#4bqbwbg.tbcaBbS#yaa#H.W#S##bPbK#Uas.p.p#6#GaY#F#4bwbw.sbPbwbQb.bY.r#P.O#a.7bfaxat#4.7.C.f.W#6.X#i",
+"bq.Oaa.w#4aPbr.s.ebfbT.Qbj.6#S#4as.z#U#oaP#6bf.7aI.p.C.p#6bP.7bw#o#nbw#F.p#saYbSbjb.bjbz.sbxbP#nbfbfaIas#4#ia##ibZ#VbZbebZbUbH.pbSa##fbg#f#cbcbPbKbe#f.4#i.raibS#6.7asataY#F.7aibL.W.Y.Y#6.O#SbPbK#nadbH#s#na#bKa##Tada#.CbQbSbqasaYbfaYbjbxbS#i#6.w.s#4bbb.as#i",
+"bYbz#rbqbr.Oaaaa.saHbfbj.eaa#4#r#K.sbQ#n#6.6.s.p#Ja9a7.pbP#6.r#ia#bw.9bfbSbj#n#i.7bq#nbgas.Rbwat#4#saI.7#aaN.7.7abaZ#f#UbZbQbwbw#n#U#kaCat.HbeaZbFbcaWbQaz.p#H.6bxaMaabrbubx.s.7aPbx.7.G#ybY.p#6ai.7#UbQ#Fbwazasbw#U#f#SbPaP.sbx.OasaY.C#y.Y.S.Obx#Cbjas.7bjbfbK",
+"asa#.7.RbSbSbxbrbqbrasaHbj.ObjbPaab.bw#6#i.s.pbw.O.Obq#CbzaabxbF#ibw#4bP.7.LaHbw.CbY.6#4bwbQ#U#f#Sbx#f.C.wbT.7bS###TbKa##nata1bPat.PataZ#U#U.Ha3#n.p.B#iasbY#4bP#4bbbL.Ka4.x#5bxbfbY#4.CbT.w#H.ObjbY#Uad#6bP.Sbr.s#nat#JbY.ObrbY.W.w#S.s.Y.w#y.saPbz.sbYbSbYbSbz",
+"bP#nasbw#4bfbG#J.O#JbP.7#4.O.s#S#N.sbP#Na#asbzbP#4bzb..YbY#Nbq#6ax#i.7.7.7#4bE#saY.9.S#4bfaxbZabas.wbg##aa.G.7.9#i#UaYbPbKax#SaP#UbebQ#n#T#n#v.Hax#6ax.rasbSai#4.7#Hbx#C#O#w.6aa.7aNbjbf.G#xaabj#e#Jbw#S.s#6braabj#6a#bx.SbjaabY#5.W#G.R.Y.w#yaP#S#6.p#6aibj#Sbz",
+"#NbIbQ.r#6#n.sbz.s#6bPasb.b..R#qbP#na1#6.CbQa9aPaY#nbY.paPbSaSazasaO#naN#4.pasbw.r#ia#axbf.r.HbtbQbGa2bgaYbhasaRbwbK#UbPbzbPaa.AbzaBbQa#aO.C#n#U.C.9a#ax.L#6bq.Wbqbjas#T#4b.bjbYbf#n.7.C.pas.ObxbjbxbwakbwbfbQ#6bfbS#JaP.O#4#y.Oaaaw#6.Cbq#C.YbrbY.s#6#SbwbfbS#N",
+".V.fbKbC.CbK#U#SbY#6#4bYaN.saWbE#qbn#ya#.rasbfbPbQ.zaabfa2.sbLbu.pbf#4.p#fa1.6#4.zbK.s.7.Abd.sax.tboaM.QbKae#UaR.9.paY.p.wbj#n#Wbba7.r#S.p#6bhbjbf.r.pa#bK#4.7#6bY.sbPbFbgaW.7bSbS#4a9bfbYas#U.CbfaYadaZaY#SbQasbYbwaP#J.7bKa7bx.YaM.wa2bb.YbbbN#Sbj.s.pbQbQaS#6",
+".fb.bPbPbP.Cat#i.s.saS#6bkbn#T.C#6babo.s##aYa#aYat.rbS#4.W.AaXbG.QbfaH.p.XbU#6.Sbbb.aPaPbd#p.E.Eaaa5by#5bSbfbwae#SbfbPazbqaabx.C#4#saYasbY.s.7.O.9bKbg#nbK#sasbfbwbYbxaP#SaBae.r.pas#s#6.p#PasbK.ObSat#Tbf#S#s.CaP#6at#ibqbFbf#6bG#5.x.Kbj#1#5bb.7#G#WbSbH#Tb..V",
+"apbr.RbKbwbSaY#U#ia#bQ.tbRalbjbk#q#NaZbPaxaY#4.C.7#6aPbT.Ea0.waT.Qbf.rbC#f#k#k#6.A#OaY#ra0.8a4.J#Jbu.Sap#6bw.CbwbgbQa#bfbrbq#5a2.p.7.p.7.7as.9.pa#.Cadav#Ubf.BaY.7#Sbfbz#y.v#Uat.CbwaxaI#n.Cbraz#4.K#SbUbKaz.7#4#nbY#nbgbr#6bQbw.p.6aLaLa2.nbT.6#JbEbSbr#Nblbzap",
+"#NaP#q.FbQ#rbP#vbK.rbE.H#0ah#q#Sa3.t.Hbe#N#na9bx.WaMaaa2bAbd#I.WaTaYbkbCbna#a#at.X#q#q#raubm.x.EbT.Abybr.v#4#6a#bS#Sae#Fbjbz.Q.wbf.7bxbq.W#XbY.7.Catbw.z#F#6#ias#4.e#U#UbwbKbcatbcaP.p##aW.p.7.s.sb..8.w#S.p#N.Ab..K#y.7bEbx#f.rbQ#4bb.K.Wa9.7a9.s.7bFbKbS#T#nb.",
+"bzb.aP#6#T#U.Xao#oaC.s#4.p#o#fa##vaQ.Hbi.FaBas#4.E#w.Wbb.K.K.A#Caa.zbi#v.c#6bf#TbFbzbEbzbda0.Ebbbb.W.S.S.V.A#qbSapbzbzad.7#J.7.ObYas.7a7bAay.s#4bK#ibwbKatbKbQ.rbxbqbjasatbcbwaZ#i#6.waa#ibj#P.saa.A#IaU.K.0.w.S#n#J.7aRbPbSbKbfaxax#S.G.w.p.9.ObP#s#n#nbQbHbH#q",
+"bnaPaX#Z.s#6.ObH#0#0.A.Y.E.Aas#f#U#nakbiat.z.kaxaL#b.x#wa0a5#N.waTaNaWaxbEbg#iasa7#C.s.7bubybb.Ga9bbb.bSasbYbKa#as.O#Gbw#Ubwas#JbzaHat#n.sbYbS.p.C.C#i#UbgbUaW#Uasbf.6.wbPbK#Pbw#ibw.QaMbqaYaebS.7braP#j#Cby.waXbH.7bKbw.vazbSbzbcbUbKbfbbbxbg#T#n#nas.saN.pbY#n",
+".cbPb.#C.s.p#NaP#Bah#C#r#dbu#n#c#va1bw#f#YbUaxax.W.Ea5bbbW.A.O#C#dbbas#n#4#6asaNbzaPbz.sa7.A.Sa9#4bqbr#SbK.C.C#i#i.7abbQ#f#nasaPaa#J.rbQ#UasbS.7.pbP#i#i.rbZbQaY.9#iaa#y#r.saz.9bf#s#J.WaM#S###FaYbYa#bP#q.Obzbb#NbSbw#n#q.Fa#.vbKatbg.CbqbL#i.raYbfaY#4bYbPaP.7",
+"aO#T#n#6#q#i.7bhbE#f.aa3bZ#o.H.NbQbQbf#6.Cbf.r#k#n.XaObka#asaX.Wa0bda2bfa7.Y.O.C#4axaP.Aas.9aH#8asasbr.vasbfai.CbgaBbPbK.zbc#J.sbjaaaP#Sbk#U#n.Ca#.p#6.7bfbQ#iax.CaYat#6bu.A#e.9#JaP.w.K.nbr#S.CaI#s#f#v#cbe.CaPbz#q#SbZ#oatbH#6a1.vakat#sbr.Ca##U.9as.C.CaY#4aP",
+"#vaYbcbjaP#S.w.waTbF#nbe#B#BbU#vad#fas.p.A.W.rbi#f#2#kbe#B#B#6#C#dbu.O#4aPbGaa.paa#JbPaX.Q#ibf.9#a#ibn#G#n#S.Sb.azbrbb#yax#v#6#4bS#4b..SaP#S#UbwbK.Cas.C.sas.C.rbSbzbZ#f.FbSbqbNbj.w#ybv.w.C.7bSacaz.CbKaZ#Yae#6.pbSbS.Cbc#obQaSbSa#a##U#k#Tas#sa#bj.7.s.p.pbS#e",
+"aY.pbSb.bLbr.fbx.CasbVbzaZ.H#kbPaPasbYbGbubuas.tbU.t#V#B#2.N#Bad#4#U#UbfbYaH#4.s.AaA#CbV.p#4.p#a.O.sataZ#f.zaP#Jaab.b..Y.s.p##ax#sbK.7#4a1bwat#Fas#GbQ#iasaB.r#U.9bz.s#obUataYbj#4.Y.Kbv.Was.7#4#Pbj.9#a#J#sbcbK#ybS#P#6bLbzaZbQ#rbH#SbSbZbZbw#J.saabja9.Oa2b..Y",
+"bx#4bQbPb.bubz.O.Cat#GbP#6aSbw.p.O.w.7bK.t#f#vaZ#Bao.ha3#2.H.tbU.Cas#i#n.C#iaHbE.S.0ar.xbY#6.KaM.W.6bPbfbYas.p.rbj.AaG.K.O.GaP.7.9.7#nbQbKa#bKbKbK#FbK#ibK#Uae#UaxbgaPbPaB.pa#bQ#U#Ga5a4.E.w.paP#s.7a2bT#5braBbfbx.Ya5bqau.0.s#6bS.p.7.sbl.Pat#9.Q.Q.WaabT.Y.E.E",
+"bdaM#6.r.7#6brbG.sbUbQ#i.sbzaP.CaYaa.p#U.Haj.tbPaQ.tatata3aC#o.tbSa7aYaYbfa#.p.pbjbLbz#CaX.O.EbAbGbb#J.7#y.sbjbPbQ#6bGbbbqbS.s.pasbh#4#s#Ubw#G#sbcaZbQaB.CbPbf.CaxbK#Ubwa##S#Sa#bKatbfb.aM#XbYaPbf.7bfaH.7.9#SbS#qaXbm.xa0aUbraPap.f#6#S#UaZ#U#S#SbYbz.Wa5.W.Kau",
+"bz.f.pad.Basas#S.vae#naY.R.RbGaNaxbg#kbQbc#vaZ#NaPaY#SbKbZbeaC#vbP#J.7bQbFaxbh#a.Obha#bS#r.na4.xbYbG#JbY.sbz#SaP#v.t.raTaM#Jas#qa2a9bx.O#y#S#P.sbwbSbwbP.9bjbj.s#ibg#Tat.H#o#Jbz#ibKbgaIa9bY#UbK.paY.k#9bYbxb.#S.Cbz.x.8by#Caaa7bP#6a#bwbc#UbU.z#n.7.X.sbbbG.wa5",
+"#4bP#qbwabaYbH.r.C#Ua##k.H#vbo.W.Xax.N#B#vbQ#o.s.VbP.X.H#fbebQbUat.z.pbPaYbf#4bhbh#abfbjaNbbbv.n.6#J#Sbg#n.CbS#qaN.7asaa#Ca5.sa#aT.s#6.L.AbqaP#P#J.S.s#G.eaKbxbqbjbS#faZ#obwbSbzbYbz.7.CbfbwbKbcaYbrbUaxbfbSbSbK.t#UbrbbbL.WaXbS#NbQ#UbKbw#Tbcabat#6#s.r.pbfbh#4",
+".O#6aPbS#f#U#i#nad.r#F#va3a3.R#dbwbQ.N.N#B#v#v#q#ras#f#c#fatbc#f.r.z#Uas#SbPbK.7.C.7#s.sbPaa.0aMbL.Q#6.DbQ#U.7aP.O#r#4.Q#C.Ebb.sbq.sa#a1#ybr.Saz.6#y#JazbfbY#H#x.w.6.X.Rbc.F.FbY#Jbxbh#sbwbK#U#UaYbqbKbUbgaYa##T.HbU.RaPbr.A.W#4#Cad#U#Gad#Ua##nbgaYas.zaYa#bjbf",
+"br.ObrbrbQaxbQbKbgaY#qaPat.5#T#q.s#n.ta6.HbtbtbUbPa#.w#raO#6axaW#4.pbgbgbP.pbQaxaO.e.s.s.7bP#r.AaT.Oa#atbebUbZ#saPbYbha2.AaU.E.Waa.VbKak#UbKbL.sbV.A.Abx.C#UbYbj#Ha5.Cadbe#UbQa#aa.G.Ca#.CaPbw.r##.7#y.p#i.C.pbw.c#naZ#n.C.sbr#Jbd.Vbw#S#Ua#.s#Sbg.raB.zaZbQas#S",
+".w#J#6#6#6bS#TbQ#U.Raa.wbgbU#T.abU#qa#bZ#TbQ.H.H#TbP#Oa5aW.z#fbUbQ#i.raO.za1bF.RbE.Yaabhbfa##n#qbT.wata3.N#c#oabbPbQaS#r.#.q.jaTa7aabw#n#FbwbKas#Sbrby.wbY#SaO.7asbf#4bK#vbK#S#Sbz.s.rbQ#fada#.paIaJaPapbjbYbz#q#U#TbQ#Y#o#S#S#4.VbzaYbS.F#obS.s#i#U.rbe#UaZ#faY",
+"bx#NbPbPbw.La7#raY.X.RbwbK.tbe#o#U#U.L#T#v.H#va3#U.v#CbzaWa##iaN.raO#saY.raYbZatbkaYas.r.7bf#i#T.s.7.p#6#SaB.vbwbKakaQ.2#lbnbJbo.R#na#bP#6.7#F#FbK.CbY.6azbSas.C#4#a#e.sa1#f#UaObfbE#Fbca8at#Y#i.saxbC#SbP#T#FbHakbebK#TbZaW#UbPaxbQbwaPbSbQbU.C#sbfbPbK#S#6.C#T",
+".L.s.FbFbKbQ#6#4#n#o#kbU#fbUa3aZbcbQ.w.ObFbPadbw#Nbz#q.s#i.paY#4aP.O.9asaWbk#Tat#2a3#f#faIaH#TaJbE.O.AbV.Ybz#J.sbQbQ#Bbt.aa1babEbQ.XbCak#T#SbSat.CbKaebS#G.7bY#4.O.wbbaT#S#T#UaWbg.CbwbQ#fa1.F.rbLbrbQ#T#nbFbKakbc#obcbS#NbH#vbS#j.RbE#6braSbQaBaY.7bK#U#F.6aabw",
+"#S#4.RbcbQbCaN#nax.rad#v.H.t#v.abw#UaPbr.sbz.Rbw#qbHbr#CaY#i#iax.Cbf.WaPaW.HbQbw#Ba3#Ubc#sbh.p#v.RbYap.w#I.6asa1bHbQ.t#Bbt#vaYbf.2.t.P.t.D.F#ybHbcbj#n#UbK#U.7bE.W.W.W.sbzb..R#nbwbPaP#N#rby.VbwbL#ya##4.pbSada#bKbw#k.ta1ap.r#SaU.Wa#.rbPbr.sbf.9#s#6bUbQbf.7#n",
+"aP.s#6#q#Tat#Ta##n#v.Rbe#2bRa3.H.Fa#.zbP.2bKbKbQ#ga##N.sas.zaYax.CasaabF.t#f#o#r#6bUbKa#bk#n.7aN#4.ObS.sbqbqa##S#nbZ#B.ha3aZaJ#6bqa##SaYa1#g#6#WbF#qaPbw.CaeaPasaPaPbr.ObQa7bSbj.p#sa#bf#ragawb.bybV.C#e#6bE#nbw#q.sakbQbKb.bwaYbj#HbGaPbKbKbE#4.7#s#UbUbwbP.7at",
+"a##nbQbQ#oakadaPaP#TbcbZ.h#oa1.PaC#obQbQbUak#n#nbz#Nb.aabba2#4#naxaWaWbQbQ#nbZ.vbr.DakbgbQbK#4bYaa.w#Pas.pbYbTaPbKbZ#hbDa6.tbgbY.w#NbP.X#o#nbwbrbx#6bz.6.Y#J#JbzbKa#aY.s#Ubf.CbH#i.O.saY.V#O.K#Iap.w.ObYas#4#4bP#U#6#6bSb..A.L#y.w.p#6bz.O#Uas#6.p.7#sbw.v.7bxaP",
+"a#bK#TbHak#obHbzb.a1bK#o#B.Palbl.tbZ#T.ratbUaZ#T#6#6aTaXbubT#6#iaW.Hbi#TbFaY#f.FbqbPatbcbF#ibE.Obxb.#4.7bf.sbLbja#aZa6bD#0a6axbh#N#SbHatbC.ca##eb..Oaabybv.6#NbSbfbPad#6.pasbf#Ubg#4#4#n.V#Iby#dbq#xa2bf.p.pbSbEbQad#y#Nbrbybr.j.A.La#bP#C#6aNbfbhbjas#SbxbS.S.s",
+"bc#obH#JbHbH#6bnbH#U.abZ#maF.H.aaZatat.rat#fbQbZbU#TbS.faH#i#fa##nbUa3#vbQaY#f#TaA.6#naYaibS.saabf#6#P.s.sbT.Aaabz.F.hao#0bD.H#n#nbk.XbHbebQ#naYbz.6#D#w#I.A.v#S#FbKbKbc#P#S.pbQaWbQ.CbQ#fbn.6#y#4bx.GbfbfaPbP.p.Ca#apbSa##C.Aap.fbua#bQaS#JbP.paH.Q#6aYbYaH.sbS",
+".c#nbQ#6#N#T.a#TbPbnbFad.2a1bR#V#Uad.r#UbKbZa1axbe#U#S.7#N#n.p.saabPbQa3bU#n#f.5bzbLbS.C.sbxaabb.Gb..p.s.Obb.K.YaPaP#n#Tbt#0bt.5ba.2akbH.PaQ#faxbwapbv#w.Y#N#F.FaB.C#U#Tbfbf.C#UbkbU.pbxbZbka#bn.C.9aMa9.X#ibwbP.saPbr#jbc.sar.Va1#JaSbK.cbKa#.C#i.7.pbf#s#G.p#i",
+"bw#6bHbQad.P#lba.I#raPa1#n#.a8#hbO#nbfbfbwaZ#r#Ja#bUbK.7.S.O.wbuaa#4#n#kaObS#n#T#n.sas.r.7aPbxbqbGaaazbf.sbxbA.nbx#Jbr#JbgbtbDbt.c.2#V.t.t.hak#f#v.FbLbybza#as.s#Fbf#6bSasbw.7.sbQaxas#Jbrb.bQbwbg#i#N.Ya#a#a##4.s.S.AaU#Cbrb.#Cbr#6.s.Fa#bQa#.C.rbQbwasaebgbSaY",
+"a1bwbj.C.3akaFbBb..3aP#nbn#nbH#oatbgaIaH#UbO.F.G#S#oas#6braX.W#C.waTbSbHa#.FaPaP.7.s#4.CbP.p#4.sbxbqbY#UbK#F.sbL.6.OaabTbfbebD#h.t.tbt.P.a.hakaO#Y#TbzbLaM.6#fbcbQbQ#6braPbY#C.f.L.p.7br.gbm#Sa##U.z#fbP.CaB#U.s.w.AbyaU.xby.s#Nawbzbc#o#q#qaY#F#s#natax.7a#bK.C",
+"aZbQbx#J#6bcaFaF#q.3#N#q.caS#nbPbf.9.9asabbZ#UbKbQ.HaIbfbrbr#Caaa9bY#naP.L#6bP.7.O.S#4#4.O#ybj.s.Kaaat.CbU#i.C.YbL#JaabG.Q#6.h#h#2bZ.2b.al.a#obSa#.s.sb.bx#e#qaB#UbQat#S#qbE#Japbbbb.Oaa#dbm#C#n#G.Z#v#obY#JaH.Sbx.K.A.8.8.8bzbPaabr.va#.F#q.7aP#n.7bw.C#G#GbKat",
+"bgat.pbPaP#q.DbeblbwaPa##fa1bHas#6#6asaY#iatbY.7#a#na#bPasbYbrbf#4brbP#S#Sbz#N.s.f.S.pbP.sb..sbfbx.6#4bqbjbb#eaM.m.KbLbT#ebja8#haQ.2amauam.abza9bY#rb.bLbYbYbj#6bSai#SazbQa#.R.fbLaXbGbr#y#C#IaXbS#S#f.t#ibf#abS.wbb.KaU#raXaT#SaPbz.vbraSa1bnbr.s.7bfa#bw#U#n.C",
+"bf.9asbKa#bFa#aZaZ#f#o#q#fa#br#y.7#N.7.s#G.s.O#Jbq.sbF#U#nbPbj#SaY.Obxbzbqbjb.a1bubb#N.CbK#qbPbw.pbYbq.W.Kbb#4.O#wa4#5bqaKb.#qak.t.t.o.b.I.#bL#C#4.wbz#C.Gbj.Sbxazbx.7bj#T#kbC#q.L#6.6.Oa2.7#Nb.#4a#aZbZae.CaP.Obq.wbT.w.paPbraN.C#6a1#qbr#q#obH.pbP.Gax#U#o#v#i",
+".7bS.9bPbH#nadaZ#TbCbUaS#TbPbV.wbf#6.p.Obf#4#Ja9brbSa#.r.r.Cbxa7a#bSa7b..W#e#ybPb.by.f#S#nbKbHbfazaP.6.A.x.wbSbf#5.W.d#XaK.M#ra1.5.H.c#A#t.Iaabb#4bu.saabbbqbxbx#SbjbS.7a#.H#oaYa#bK.OaPbx#S#S.p#6bwbQ#o#i.pbf#6bEaaa9.sbPbw.L#6aY#nbHbHbr#N.abC.R.pbb.CbQa#bQ#U",
+"a##Fa#bK.2#nbcaZ.FbzbCbc#6#q.Sbfbfa#bf.M.9#sbf.p#6bP#f#vat.r.sb.bha#bGbq.Ebxbj.O.saX#Ca7#q#n#G.s#4aP.6bG.K.W#sbw.C.9#abx#8bYbrbzbK#o#o.q.bby#n.pbh#4.sbf.ObbbY.Cbga##4aS#Wa#atbk#n.CbKasaibSa##U#nbK#nbcbObUbK#q.zas#SbQ#nbFa1#4aSaPaPa#bw#qbF#TbPbj.6.wbP.O#SbP",
+"bY.p#UaZbQaZaka#bHaPbHaZ#oadaY#n#4bh##.9#6.9bK.7.CbQbfas#U#T.7bG.sas.p#iaabq#4bfbE.7.sbG.fbz#J.O.S#H#4a9bb.nbK#s#sbqbf.e.ebhai#J#6.RbCbC.qaXaYax.r.C.C#n#faYbS#GbZatbQ.Fbxbr#Sat#nbKbK.CbKa#aBbcabbc#G.raB.B#obS#n#oa#bQ#oa1.LbP.OaTbzbr#J#4.v.c#nbP#S.OaabYbf#6",
+".sbS#U#TadbQa#a#aa#CbK.Xak#n#Sa9bhbx#s.CaB.r.Caxbf.Cbf.s#n.C#4#Cbq.O.p.7.sbT.O##bS.O#qa7braP#6azbYaP.O#4#4#Hbxbj.GbW.r.7#eai#S.L.6#N#4.2bC#6as#fas#4#a.pa#.CasbKbe#kbebebw.R#6bPbKbK#nbwbKbKbK#TbKas#Ua#bS#F#Tae#n#fbe#v.cbz.j#y#rbrat.p.fbS#6bnbca#.CbK.GbT#J.s",
+"bj.OaSbwbwbP#6.7aP.waP#GbHbSaP#saPas#s.7atab.7.Cbg#U#nbw.7#nbF#yaTbz#a#4bh.7.ObYas.CbS#6.La1a#bHbwbP#Sas.C#S.GaMaG#5bz#i.OaM.sbPbraa#T#v#q#naO#f.C#4.6#C.Oa9#J#U#kbibZ#naY#6bS#rbwbS.7#6#Sb.bSbPbQbw.rbF.O.saO####aZ#o#obCbH#r#r.sbx#obf.W.ObZbZbHbcbf.Cbhbqaabr",
+".ebYa##obcbK#6.saN.O#qad#TaPbfbQ#N.A.9.Q.CbP#ibKbw#iatbK#6#i.r#n#4#PaP.9.sbYa9bq#naBbK.p#Nbw.Fa#bKa#bK#U#S.9bEbb.Ea4bra2bq.wbbbL#4aX.w#4#S#n.zaW.r.rbEbxbrbjbSbj#J.sasbx#N#Nbr.faq#S#rbw.pbjbS.sbc#nbQ.t.C.7.C#ibfat#T#oaZbZ.7.s#4aa.7bY.ma4br.F.abQbYasasa##4.O",
+".7.Ca#bwbwbPa7bqbzbz#S#n.4bcaW.raP.W.7#e.C##bKbUbQbwae#ibwaYbF#faY.r.Cbg.7.s#sbw#c#vbe#f#SaP#SbSbS.CbP#nbwbfbQ.C.waw#o.r.7bjaGaaa##4#I.W.WbzasaO.CasbwaY#Faa#C#I.W.K.sbq#ybr#C.V#6#nbfa##UaBbPbgbc#v.4.H#Y#sbf.7a1ad#6#6#ibZaZbP.7ai.C.raa#I.xbVbwbcaTaaaPbYbQ#n",
+"b.#y#U#n#6aPbjb..sbzbS#UbQbKaxax#4bGaPbq.O##bcbKbg#U.7#8#4.p#6.ra#bfbPbg.CaK.C.zakaC#kakbHbSbj.vbY#e.f#Jbf.7bw#n.R.wbKa3bw#sbj.9.paNa5#O#d#daH.i#iax.p.RaxbS#Nb..A#Ibx.CbPbz.s.7bwbw.7.saZatbK#SbQ#Ya#bS.p.C.C.7a1aZad.vbHatat#n#i#4.p.9.C.pap#I#rasbSbrbE.7bS.C",
+"bj.AbPbQbSa7bYbz#JbG.pabadaPbK#f#4bjb..6bL.p#SbzbwaB#sasbSbPbYbwbg.pbza#asbjaYbk#iaCbeak#n.Fbz#H.7#y.Obr.7bfbPa1bfbb#6.H#n#iaibYas.p.w.W#Cbb.O#sbf#nbQa##i#6.s.s.6bb.O#U#nbPas.p.CbPbjbxbwaZaPbxbK#faY#JaP.pbfbf.FataZ.C#nbUbUaxaY.pbj#Sbfax#q.w#r.p#4bz.7bf#J.7",
+"bSbrby#r.sbx#SaIaPbz.7bK.CbP.p#naxbQ.w.6bq.YaP.sbfbPa#aY.pbP.s#4aJa#.w#ybP#4bYbQ.7bebeaZ#Ua#ad#J#Wbr.w#C.O#6#SbSbSbTbu.O.r##.pbjabaDbwbf#Jbx.Qbf.7.p#v.r.7#yb.#6.7.p.7bY.r.Ca#.7bPbwbfbG#y#r.S.6#4a#.z.Cbf.7.p.iaBakbwbwasbU#n.C.7bPbx.pbf#nbQ#Sbr.sbx.sbfaP.7bj",
+"brapby.Sbr.s.G#Jbr.O#4#sbwbPa#.C#f#fbKbxaYbj.G#e#4#4aPbfa1aPbf#y.paY.ObG#6#4bubwbw#G#v#fbK#6at#ibPbw.S.A.Sbxbr#ras.p.w.Abv.Abf#SbO#Uatabasbx#a.CbQ.X#fa#br.wbG.s.Obf#a.6bSbY.9aY.s#4#nbPa#bjbGbq#C#ybYa#bw.7.p#Pa#bP.s.7br.s#UbQ#nbjbYaH#nbY#4aPb.bxbY#4.CaPai.s",
+"bP.O.s#JaP#SaMaMbb.A#4.7#UaYab#fbwbPbg.pbPaIaGaa#y#J.s#Ja#bz#N.f.w#S.sbY#q.p#N.p#6#WbQ#v.C#6#na#bPbwbf.R.SbxaP.s.s#4.7bSb..6.K.W#v#kab#vbKbY#ybfbfbPa#a#.w#4bS#abqbxaKaMa2.QbY.rbfbxbfaPaWbPbbbLaMbrbqbb#4.9.7.sbf#S.Objbr#4bw#Tbg#S.Q.OaH#4#6bw#4.s#4#J#4.Cbw#6",
+"a#bPbPbw#4aibAbA.Y.m.Qbf.Cbg#Tat.CaYatbQaH#sbYaHbTbxbxbqbKbP#rbS#C.Ga7bx.7bP#N#q.C#Uas#TaObf#naY#U.Ras.C#ebx.L.3.s.LbY#6aYaN.YaL#y#o.F#U.z#UbSaNbSbfbPbP.sbx.w.waabhbfbhaK.7aPbKbKbj#6.s#TbibK.7.Y.Wbf#4bwaY#s.QbSa#bf.7.pbfbQ.tbU.C.7.Q#C.CaP.r.p#a#SbY#6.Ca#a#",
+"a7.s#N.Obj.s.na4aMbA.M#ab.bP#vbg#T#JaP#W#4#n.7.rbfbf#SbwbKadbzbPaNb..Y.s#4bSbP.v#Sbfas.7#S.CaYaaa##naibwbwaiaNbPatax.sbz#Sa##4bTbdaabU#naZ.H#nbfasbS.CbfaPaaa5.K.n.W.Y#aaG.6.Oas.rbf#J.vazatatbg.6bbbj.p##.C.B#s#S.9aY#G#Sata1bPbg#i#ibPbYaxbzaH#4#a#4aIbwaYa1.p",
+".Obr.wap.6.Q.Y.x#L#E.Ga2.KbdbSbQbK#SbqbE.7#4.LbS#naY.sbK#Uat.Fas#fbE.Wa7.Xbw#T#WaTbj.R.ObxbTbfbz#NbSbjbrbK.s#J.O.p.paP#6.fbYaHbfa2aXbjbwbfbZbebQ.9bz.7bfbEbj.wbybA.n.maM#1.K#CaP.C#i.CaS#y.Oa##s#4bj.YbxaHbfbf.C#U#Ubfaxa1.CbP.L.9#s.7#n.w#4.s.O.p.ebY#S.C.Ca##U"
+};
diff --git a/pixmaps/l-bob.xpm b/pixmaps/l-bob.xpm
new file mode 100644 (file)
index 0000000..37c877a
--- /dev/null
@@ -0,0 +1,229 @@
+/* XPM */
+static char *image_name[] = {
+/* width height num_colors chars_per_pixel */
+"   104   151       69            2",
+/* colors */
+".. c #ffffff",
+".# c #ffffcc",
+".a c #ffccff",
+".b c #ffcccc",
+".c c #ffcc99",
+".d c #ffcc66",
+".e c #ff99cc",
+".f c #ff9999",
+".g c #ff9966",
+".h c #ccccff",
+".i c #cccccc",
+".j c #cccc99",
+".k c #cccc66",
+".l c #cc99cc",
+".m c #cc9999",
+".n c #cc9966",
+".o c #cc6699",
+".p c #cc6666",
+".q c #99cccc",
+".r c #99cc99",
+".s c #9999cc",
+".t c #999999",
+".u c #999966",
+".v c #9966cc",
+".w c #996699",
+".x c #996666",
+".y c #996633",
+".z c #993366",
+".A c #993333",
+".B c #6699cc",
+".C c #669999",
+".D c #669966",
+".E c #6666cc",
+".F c #666699",
+".G c #666666",
+".H c #666633",
+".I c #663399",
+".J c #663366",
+".K c #663333",
+".L c #663300",
+".M c #660033",
+".N c #660000",
+".O c #336633",
+".P c #333366",
+".Q c #333333",
+".R c #333300",
+".S c #330033",
+".T c #330000",
+".U c #000033",
+".V c #770000",
+".W c #550000",
+".X c #440000",
+".Y c #220000",
+".Z c #110000",
+".0 c #002200",
+".1 c #001100",
+".2 c #000022",
+".3 c #000011",
+".4 c #eeeeee",
+".5 c #dddddd",
+".6 c #bbbbbb",
+".7 c #aaaaaa",
+".8 c #888888",
+".9 c #777777",
+"#. c #555555",
+"## c #444444",
+"#a c #222222",
+"#b c #111111",
+"#c c #000000",
+/* pixels */
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#c#c#c#c#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#c#c#c#c.Z#c#c#c.Z#c#c.Z#c.Z#c#c#c.Z#c.Z.Z#c.Z#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#b#b.T#a#b#b#b.T#a#b#b.T#a#b#b.T#a#b#b.T#b#b#b#b.Z#c#b#b.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.Z.Z#c.Z#b#b#a#b#b#b#b#a#a.T#a#a#a.T#a#a#a.T#a#a#b#b#b#b#c.Z#b.Y#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.X.R.X.R.S#b.K##.K#..K##.K#.###..8.K.K.K.A.K.K.K.R.W#a.N.R.W#a.W.R.M.R.X#c#b#b#b.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#a.Z.R.M#a.X#..T.Q.T#a#b#c.T.Q.T#a#b.X.X.K.X.K.X.T.K.W.Q.N#a.W.Q.N#a.X.R.M.R#b.Q.K.S#a.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b.T#a.J.Q.S.R.W#a.X.K.T.T.W.K.T.K.X.K.X.W##.W.X.K.Y.K.T.N.K.L.Q.K.K.W.K.K.K.X#a.M.X.X.X.R.K###b#b#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Z#b#b.Q.K.H.S.R.X.S.L.X.T.K.T.K.X.K.L.K.T.T.K.X.T.K.T.X.T.K.K.M.Q.W.K.W.Q.M.R.M.Q.L.K.X.K.R.M.Q.Y.J.J#b.Y#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.T##.K.S.R.S.R.N.M.L.S.L.W.K.W.L.W.L.M.W.L.M.L.K.K.X.L.K.W.L.W.K.K.K.K.K.L.X.K.L.K.K.K.K.L.K.T.X.R.L.R.M.Y.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.K##.K.P.R.X.L.S.W.X.W.L.W.K.W.L.S.L.M.W.L.M.L.N.K.W.K.K.X.L.M.L.T.K.K.A.K.W.K.T.K.K.A.K.A.K.A.K#a.L.S.X.Y.K.Q#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#a.J##.M.T.S.T.R.W.K.X.K.N.K.W.K.K.V.K.L.K.K.K.K.K.X.L.K.A.W.K.L.K.K.T.K.K.K.K.X.K.K.K.A.y.9.J.K.A.L.S.K.K.T.Y.Y###b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#a.R.J#b.Z.K.X#a.M.R.X.W.M.N.K.W.A.L.K.W.A.L.K.A.L.K.K.K.A.K.K.N.M.K.A.K.X.L.K.A.K.X.K.A.H.x.x.y.A.K.S.L.M.R.K.T#c.K#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.Y.J.T.W.X.T.L.W.W.K.W.L.L.M.K.K.K.K.K.K.K.A.T.W.x.x.x.x.x.K.K.T.K.L.x.n.K.Y.J.9.x.Y.T.x.x.x.x.x.K.K.H.K.T.M.X.K.T.Y.J.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.S.8#b.X.X.R.X.X.X.L.W.M.R.M.L.K.A.X.N.K.K.L.K.K.K.K.x.x.x.x.x.A.K.X.K.K.m.A.K.K.F.j.K.Y.K.x.x.x.u.K.A.K.A.K.L.K.T.T.T.Y.Q#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b.K.Q.T.K.X.X.X.X.W.M.K.L.K.A.K.K.K.K.K.K.A.K.x.A.X.X.K.n.p.u.m.m.t.L.R.T.T.x.m.x.K.n.m.x.R.T.K.x.x.x.R.T.K.K.W.K.K.K.X.K.Z#.#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Z#b#b####.Z.Z.X.R.X.X.N.R.W.N.K.K.L.K.T.K.K.y.K.K.A.x.T.L.K.x.u.o.m.c.m.w.K.T.Y.K.m.x.K.x.m.x.K.Y.K.K.x.x.K.T.K.A.K.X.K.A.K.T.Z.Q.Y#a#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#a#a.X.S.Z.Y.X.X.X.R.M.T.K.K.x.p.t.L.K.T.x#c.K.x.x.n.x.S.T.M.x.n.8.m.m.m#..K.T.x.x.j.m.x.x.m.x.Z.Z##.A.x.K.T#b.7.X.T.K.n.K.T.Z.Z##.K#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.1.S.R.S.T.Y.Z.X.X.X.X.Y.K.W.Q.A.m.m.w.T.T.9.S#b#..n.p.l.K.R.T.K.n.m.x.m.7.x.T.Y.K.x.m.m.K.w.x.9.S.Y.Q.Q.K.A.K.X.9.K.T.K.x.T.T.Y.Q#a#b.Q.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.Z.Q.Q.T.T#b.X.R.X.X.X.K.x.K.X#a.x.x.j.x.Z.K.x.X.X.K.K.x.n.T.T.K.m.u.m.p.u.m.S.T.K.x.x.K.x.y.x#..K.T.T.A.K.K.T#..x.R.T.K.n##.Z.1.Z.Y.Z.K#b.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b#a.Q.T#a.X.S.X.X.R.T.K.K.A.K.T.X.Q.x.x#b.K.K.X.K.K.K.n.o.T.T.K.x.t.p.8.p.7.p.R.T.x.x.x.y.x.K.x.Y.T.T.K.K.A.K.Z.J.K.T.K.x.Z.Z.Z.Z#c.Z#b.Q#a#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b#a.T#b.Y.Z#b.R.Z.Y.Y#b.T.K##.X.T.T.K.S.K.X.Y.K.Z.Z.T.x.K.x.Q#c.X.x.p.u.p.x.f.x.X.T.K.x.K.K.A.x.x#a.Y.Y.T.R.K.K.T.x.Q.Y.T.x.Y.Z#c.Z#c.Z.Z#c.S#a.Z#b#c.Z#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.3.R#a.T#b.Z.Y#a.Y.Z.Z.T#b.Z.Z.X.T.T.T.S.L.T.T.Y.Z#c#c.X.Q.K.K.Q#c.T.T.u.o.x.x.x.j##.T#b#..A.K.x.y.x.X.Z#c.T.T.K.X.Y.K.Y.Z.T.T.Z#c.Z#c.Z.Z#c#c.R#a#b#b.Z#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b.S#a.Z.Y.Z#c.Y.Z.Z.3.Z.Y#c#c#c#c.T.T.X.Y.Y.Z#c.Z.Z#c.Z.Y.Y.x.x.Z.Z.Z.x.x.x.x.y.p###c.T.K.K.x.K.K.Q.Y#c.Z#c#c.T.T.Y.Z#c.Z#c#c#c.Z#c.Z#c#c.Z#c#c.Z#b#b.Z#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#a.R#a#b.Z.Y#c.Z.Z.Y#c.Z.Y.Z.Z#c#c.Z.T.T.T.T#c.1.Z#c#c.Z.Z#c.T.K#b.Y#c.Z.K.y.x.K.K.m.Q#c.Y#c.K.K.K.X.Y.Z.Z#c#c.Y.T.T.1#c.Z#c#c.Z.Z#c.Z#c#c.Z#c.Z#c.Z#b.Y#c.Z#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c.S#a.Y.R.3#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.Z.Z#c.Z#c#c.Z#c.Z#a.K.Z#c#c.T.K.K.K.x.x.Y#b.Z.Z.Y.x.X.L.Y#a#c.Z#c.Z#c.Z#c.Z#c.Z.Z#c.Z#b.T#a#c#c.Z#c.Z#c.Z#c###b#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.R#a#a.Y#c.Z#c#c.Z.Z#c#c#c#c#c#c#c#c#c.Z#c.Z#c#c.Z#c.Z#c.Z#c.Z.Z.Z.Z.Z.Z.Z.Z.T.L.K.x#a.T#c#c.T.K.K.M#a.Y.Z#c.Z#c.Z#c.Z#c.Z.Z.Z#a.K.t##.S#c#c#c.Z#c.Z#c.Y.S#a#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#b.Q#a.Y.Z.Z#c.Z.Z#c#c#c#c#c#c#c.Z#c.Z.Z#c.Z#c.Z#c.Z#c.Z.Z#c.Z#c#c.Z#c#c.Z#c.Z.Z.Z.Z.T.Z#b.Z#c#b.K.G.K.Z.Z#c.Z#c.Z.Z.Y#b#b.A.K.K.n.x.m.G#c#c#c.Z#c.Y.Z.K.T.H.K#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#b.S.Q.Y.Z.Z#c.Z#c#c.Z#c#c#c#c.Z#c.Z#c#c.Z#c.Z#c.Z#c.Z#c#c#c.Z#c.Z#c.Z.Z#c.Z#c.Z#c.Z.3.Y.Z.Z#c.Y.Q.x.T.Z.Y.Z#c.Z#c.Y#c.K.H.K.K.m.w.m.m.x.Z#c#c#c.Z.Z.Z.A.K.S#a#c.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#b#a.Y.Z.Y#c.Z#c#c#c#c#c#c#c.Z.Z#a#b.Q.Z#b.Z#c#b.S.0#b.Z.Z#c#c#c.Z#c#c.Z#c.Z#c.Z#c#c.Z#c.Z#c.Z.T.x.R.T.Z#c#c.Z.Z#b.K.K.w.w.n.f.n.m.n.m.6.S.Z#c.Z#c.X.L.K.x.1#c.Z#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z.Q.K#a.Y.Z.Z#c#c#c#c#c#c#c.Z#c.Z.Z.Q.S.Z.Q.Y#a#a#b.T#b.Z#c#c#c.Z#c#c.Z#c.Z#c.Z#c.Z.Z#c.Z#c.Z#c.Y.K.K.T.Z#a.Z.Z.K.t.x.l.m.j.n.m.m.n.m.n.i.K#c.Z#c.Z.K.K.K.K.Y#a#a.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#b###c#b.T.Z.Y#c.Z#c.Z#a#b#a#b#b.T###b.S#..Q.K##.K##.Q#b.T.3.Z#b#b.Z#c.Z#c.Z#c#c#c#c#c#c.Z.Z.Y#a#.#c#b.K#a.K.n.x.m.m.g.m.m.m.g.m.m.m.m.m.y.R.X.Z.Z.K.K.L.K.Z.Z###c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c.3.1.K.Q.Z#b#a.Z.Z.Z#c.Z.Z#b#a#b#a.K#.#a.J.O.K.J.Q.K.P.Q##.K#..Y#a#b#b#c.Z#c#c.Z#c#c#c#c#c.Z#c.Z.Y.Q.J.Z.x.G#..m.w.m.m.n.m.n.o.n.m.j.f.m.m.c.m.K.Y.Z.Z.K.A.K.W#c.Y#a.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#..T.T.W.R.M.R.Z.Y#c#c.Z.T#..K.P.K.l.9.w##.F.J##.K.P.K.P.K.P.K.J.K#..S#c.Z#c.Z#c#c#c#c#c#c.Z##.K#a.x.8.m.f.n.f.n.m.n.m.k.m.n.m.f.m.f.m.c.m.x.Z.T.T.K.X.K.K.Y.Z.Z#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Y.Q.T.X.R.S.R.X.Z.Y#c.Z.Z####.K.9.w.F.G.G.F.x.9.9.F.w.F.w.F.9.w.F.C.J#..Q#c.Z#c#c#c#c#c#c#c.Y.G.G#..m.l.n.n.m.n.m.n.c.n.m.d.m.f.n.m.f.n.m.c.9.S.T.T.X.K.K.A#c.Z#c.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b.K#b.Q.S.W#a.K.Z#b.S#a#..J.K.K.x.x.n.p.p.u.m.f.m.m.7.m.7.7.s.7.m.m.c.m.m.x.Y.T#a.Y.Z#b.J.9.m.m.x.m.m.c.m.c.m.c.j.c.m.c.m.j.c.m.m.c.n.b.u.m.u.K.Y.T.K.R.A.x#c#c.Z#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z.Q.Q.S.X#a.W.T#a.T#a#b.Q.G.x.l.x.x.x.n.w.p.m.n.m.7.m.m.s.7.6.t.m.7.c.n.c.m.t.t.K##.K.t.x.6.7.m.m.m.c.n.c.m.c.m.c.m.j.f.j.f.m.c.c.n.b.n.m.b.m.x.T.T.R.M.x.x#a.Z#c.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#b#c#c.Y.Y#a#b#b.S.Q.Q.x.w.j.x.m.f.x.o.k.m.f.j.m.n.m.n.m.m.m.m.m.m.m.m.m.n.m.m.m.m.m.n.m.m.n.m.f.n.m.j.m.d.m.j.f.c.m.c.j.c.m.k.m.c.m.f.m.m.c.m#c#c.X.K.G.p.Q.Z#c#b#b#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#b#c.Z.Z.Z.Z.R.S.Y.Q.Q.F.Q.y.m.n.m.p.u.f.n.j.c.n.m.n.c.m.m.m.j.m.m.j.m.n.m.m.n.m.n.n.m.m.c.m.m.n.m.k.m.d.m.c.g.j.m.c.j.f.m.d.c.c.m.f.m.m.c.j.m.Q.Z.Z.Z.K.x.Q#c#b.K.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z.Z.Z#c.Z.Z.Z.Z.Z#a#a#a.K.J.x.m.m.y.m.f.m.f.c.m.c.j.f.j.m.m.m.m.j.m.m.l.m.m.n.m.m.m.m.m.c.m.c.n.c.j.f.c.m.c.m.c.f.j.f.j.c.c.m.c.j.n.c.m.n.m.c.m.x.Z.T.T.K.K.K.Z#b###b#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#c.Z#c.Z.Y#a#b#a.Q##.K.x.m.j.m.m.n.m.d.m.f.j.f.j.c.m.m.j.m.m.m.m.m.j.f.m.m.m.f.m.m.m.j.n.b.j.m.c.m.c.m.d.j.k.f.j.g.m.c.c.m.m.c.t.c.m.m.n.c.9.S.T.Y.A.K.Z.Z.Y.Q.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#c#c#c.Z.Z#c.Z.Z#b.K.J.G.p.m.n.m.c.m.g.i.c.b.c.j.f.m.j.c.m.c.c.m.c.b.d.j.f.d.j.m.c.m.n.f.j.g.m.c.n.c.n.b.c.m.f.j.c.j.c.m.c.c.n.b.c.n.m.m.m.m.K.K.Y.K.K.n.T.T#b#b.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#c.Z#c.Z#c#c.Z.Q.Z##.w.u.p.m.n.m.c.b.b.m.c.j.c.j.j.c.b.c.m.c.m.b.k.m.n.c.m.c.m.j.n.c.c.m.c.j.n.c.n.b.b.n.c.j.c.n.f.c.c.f.j.c.m.c.b.m.m.m.m.u.T.Z.Z.K.x.K.X#b#b#c.Z#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.Y.J#.##.p.6.f.c.k.f.n.c.b.m.b.c.f.j.b.n.m.c.t.5.n.b.c.c.n.c.m.c.m.c.m.k.f.j.g.j.f.j.c.n.6.b.f.c.c.j.f.j.c.f.6.b.m.b.m.m.m.m.m.x.Z.Y.T.x.R.T#b.Y.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#..J#a.F.x.m.g.m.f.j.j.m.j.b.j.b.j.f.c.b.j.m.m.i.c.m.n.j.f.j.c.m.c.n.c.f.j.d.m.c.j.g.b.b.c.m.k.c.m.c.j.f.c.c.m.m.b.m.m.m.j.m.7.K.Z#c.T.Q.K.T#b#b#c.Z#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Z#b.K.J.K.8.8.m.g.m.f.c.m.c.j.f.j.c.j.b.c.m.j.m.c.m.c.c.m.c.m.j.c.m.j.f.j.g.m.j.f.m.j.c.m.c.c.c.b.n.b.c.j.f.j.c.b.n.m.n.m.b.6.m.P.Z#c#b.J.X.T#b#b.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.K#.##.K.m.m.n.m.f.m.m.c.c.f.j.c.m.c.f.j.c.m.c.f.j.f.j.f.j.g.c.f.j.g.j.c.m.c.c.k.c.m.m.c.c.m.b.n.b.c.f.c.j.c.b.n.t.x.t.x.m.b.F.K#c.Z#..K##.X#b#b#c.Z#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#c#c#c#c#c.Z#c##.J.G.F.x.m.f.m.c.n.c.j.f.c.c.j.b.j.c.b.m.c.j.c.f.k.f.j.f.j.f.j.c.c.f.j.c.f.m.b.j.g.c.j.f.c.m.b.j.b.j.f.c.c.m.c.m.x.x.6.b.j.x.Y.Z#c.Y.7.K#c#b#b.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#c#c#c#c#c#c#c.Y##.G.9.Q.f.m.m.n.m.c.c.f.j.c.6.c.c.b.c.j.c.j.f.m.j.f.j.f.j.f.k.c.f.c.k.f.c.j.c.c.m.c.j.f.c.j.b.c.c.j.c.c.f.j.c.m.m.x.p.m.m.b.6.K#c.1.S.x.Q.Z#b#b.Z.Z#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#b.Z#c#c#c#c#c#c#c.Q.J.G.x.x.m.f.m.j.f.j.m.c.b.c.j.f.j.c.f.j.c.c.c.m.j.c.n.c.b.c.j.c.m.c.c.m.c.j.f.j.j.f.c.j.c.c.m.c.f.j.j.c.m.c.j.x.K#..t.b.b.6.S.Z.Z#b.x.T.T.Z.S.Z.1#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b.K#c#c#c#c#c#c.Z.Z.S##.9##.x.j.m.k.f.j.n.c.m.j.c.c.b.c.m.c.j.f.j.c.j.f.m.j.b.j.f.c.m.c.c.m.c.c.f.j.c.f.c.j.c.b.m.c.c.j.f.c.m.c.m.c.x.x.F.x.i.b.6.K.Z#c.T.K.K.T.Z###c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b#c#c#c#c#c#c#c.K.J.F.K.x.p.m.f.j.f.c.m.c.m.c.6.c.c.b.j.c.i.c.c.j.c.c.b.n.b.j.f.c.j.f.c.j.f.5.c.j.b.c.c.j.c.c.m.c.c.i.c.c.j.c.m.m.x.L.t.m.b.x#a.Z.Z#c##.X.T#a.K#b#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Y##.Z#c#c#c#c#c#c#c.P.G.K.J.K.m.c.n.f.j.n.j.m.c.c.c.j.b.j.c.b.c.c.6.c.m.m.j.b.c.c.j.c.f.j.c.f.j.c.j.c.c.j.e.c.i.f.c.j.f.c.j.b.c.6.n.m.K.K.x.b.4.x.X.Z#c.Y.G##.T.Z.Q#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z.S#c.Z#c#c#c#c#b#b.Q##.Q.J.x.m.m.c.m.c.m.c.c.i.b.m.b.m.m.c.b.m.c.c.b.c.c.c.j.e.c.c.6.c.b.j.c.b.b.e.b.c.c.5.c.c.m.f.b.b.c.l.c.b.c.b.m.x.L.m.b.b.x#b.Z#c.T.x.X.T#c#a#b#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Q#c#c#c#c#c#a.S.S.Q.S.K.x.j.c.m.c.m.c.b.l.c.j.b.j.b.c.b.j.b.j.b.j.c.m.c.b.j.c.6.c.c.c.f.6.c.c.b.c.b.j.c.c.m.f.m.b.n.i.c.j.c.j.c.j.m.K.x.m.b.j.K#c.Z.Y.K.K.T#b.Q.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#b.G.Z#c#c#c#c.Y.0.Q#a.K.U.p.m.m.c.i.b.b.b.#.b.b.w.u.8.b.c.b.b.c.c.c.6.b.b.c.b.b.c.b.b.j.c.c.c.l.m.m.m.b.w.8.K##.K.u.t.x.m.w.t.b.b.b.m.x.y.b.c.i.S.Y.Z.T.x.9.Y.Z#b.Q.Z#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#a.9#c#c#c#c#c#a.T#a.Q#a##.x.6.c.b.m.m.K.9.K.x#..K.T.T.m.c.b.i.b.m.b.c.c.i.c.b.c.b.c.i.c.c.c.l.c.m.c.m.G.K.T.X#c#b.T.T.S.Y.T.T#..x.i.c.x.K.m.c.6.K.Z#c.X.Q.x#a#b#a.Q#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z.T.x.Z#c#c#c#c#c#c#a#a.J.K.x.m.b.t.K.X.K.T#c#a.Y.Z#c.Z#c#c.9.b.i.j.b.b.c.c.i.c.j.c.b.c.6.b.j.c.m.f.8.p.Q.Z.1.3.Z#c.3.Z#c#b.Z#c.Y#a.x.7.x.K.x.5.m.m#c#c.Z.Y.Y#b.Y#a.K#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b##.x#a#c#c#c#c#c.Y#a#a##.K.x.m.G.L.X.Y.Y.K.Y.Q#c.Z#c.Z#c.Z#..5.m.b.6.b.j.b.c.j.b.c.j.c.b.c.f.j.f.m.m.K.Y.Z.Z#c.Z#c.Z#c.Y.Q.Q.Z#c.Z.S.T.x.y.t.b.b.##c#c.Y.Z#a.T#b.Q.Q.Z#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c##.F.K###c#c#c#b#b.Q#a.T#..x.x#b.2#b.X##.6.b.b#b.T.Z#b.Z#c.Z.Z.4.b.b.b.b.i.c.b.c.m.c.6.c.f.j.m.f.m.x.H.S.T#b.X#..J.K.i.m.b.c.m.6.9.X.K.x.x.p.m.n.b#..Z#c.Z.Z.Y##.K.Q#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Y.G##.J.Q.Z#c#c#b.T#a.Q.Z.Q.x.x.H.J.m.t.b.b.#.m.m.7.Z.Q.Y#a#b.Q.K.x.j.b.6.b.c.c.j.c.b.c.c.c.m.m.m.f.u.z.u.m.8.t.a.i.5.4.b.4.b.c.F.9.K.T.K.x.9.m.b.c.9#c.Z#c.Y#c.J##.Q.Z#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c##.J.w##.w###c#c.Z#b.J.Y##.J.x.x.m.m.b.j.5.l.m.7.b.b.s.Q.J.Z##.J#.##.m.m.4.m.b.m.b.b.j.b.c.m.m.f.u.K.J.9.x.7.m.m.u.f.u.x.b.b...b.b.b.m###b.T.J.8.m.b.i.W.3.Z#b#b.Y.J.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.S##.G.w###..Z#c#b#a#a#..S##.x.x.m.c.7.b.m.b.9.x#..x.9.J.Y.Q#a.K##.K.x.l.#.m.6.j.b.c.b.c.b.c.f.x.S.T.J.9.w.x.u.x.b.b.i.b.b.5.b.b.b.b.i.b.8.m.G.8.b.m.e###c.Z#b#b#####c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z##.w##.w##.G#a.Y##.K##.K.9.j.x.m.m.r.x.x.8.l.7.b.5.b.8.K.J##.2.K.2.K##.m.h.b.b.c.b.c.i.#.l.D.Y.Z.Q#..J##.w.m.7.7.t.x.8.x.u.6.s.j.s.j.6.s.t.l.9.m.5.j.S.Z#c#b.T#b.K#a#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Y.Q.G.w.Q.J.K.Q.Z.9#..Y#..w.8.9.w.u.w.x.6.m.s.i.K.x.x.K##.K#a.J#a.J#..M.t.b.#.b.b.j.b.b.b.9.Y.Z.Q.S.Q.G.x.7.G.x.G.x.l.m.m.m.s.j.s.6.6.s.m.7.8.G.t.b.6.K.Z.Z#b#b.Y.Q#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#a#b.K##.9#a.2.m.J.8.J##.J.G.m.m.j.9.K.F.m.7.G.Z#c#b#c.Q.J##.Y.Q.P.Y.9##.x.m.l.b.c.b.c.b.7.K.K.n.9.Z.Q.J.P.K.x.x.o.t#c.Z.Z#b.7.P.x.6.6.j.s.m.w.F.m.m.6#a.T#b.Z.Z#b###b#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Y#a.J.P.K#a.S.9.x.F.J.Y.9.6.m.m.8.x.9.l.G.x#b.Y#b#a#b#..h.b.Q#b#a##.P.J.x.m.j.m.b.c.b.j.b.i.m.o#b.Z.S.K##.K.K.x.Y.T#c.Z##.8.w.Q.K.x.6.7.l.t.8.t.m.j.b.K.R#b.Z#c.Y.Q.Z#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#a#b##.K.Y.K##.x.B.G##.S.m.m.6.6.8.M##.j.b.J.Z#b##.b.m.l.....x.T.S.K.J##.K.n.m.b.c.b.c.b.4.j.P.K#b.T#a#b.K.i.5.J###a.b.8.m.#.h.w#b.J.4.6.5.6.s.m.m.m.l.T.Z.Y#c.Z.T.x#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#a.K##.Z.Z.J.F.6.w.x#..m.j.6.7.f.x.Q.6.h.x#b#a##.t.x.m.....6.K.K.J.O.K.K.x.b.m.b.c.5.c.b.x.K.Q.m.t#..Y.5.5.b.9.S##.x.K.b.b.5.8.x.Z.#.5.4.4.l.t.m.b.j#..Z.Y.Z#c.Y.K#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#b.Q##.Z.Y.K.x.s#..K.t.b.b.i.b.u.K.x.b.5.6.J#..J.J.m.4.b.b.m.7.j##.A.y.x.x.m.c.c.i.b.b.j.m.9.m.6.b.b.l.b.b.6.K.0.X.Q.l.b.6.m.5.8.w...#.b.b.6.x.b.b.6.M#c#c#c#c#a.Y#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c.Z#b.S##.S.Z#c.Y#..s.8.8...c.j.b.b.l.x.8.b.8.b.h.b.5.5.4.b.b.i.m.7.e.6.x.x.K.x.c.b.b.n.b.6.c.m.m.m.b.b.4.m.H.x.6.6.m.t.K.s.j.b.5.b.b.b.#.5.a.#.6.6.m.b.c##.Z.Z#c.3.K#a#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b.Y#a.Q#c.Z.1.K.i.s.b.m.4.b.#.#.b.b.b.i.b.5.b.b.b.b.j.m.m.m.m.m.#.b.m.x.K.x.j.c.c.b.b.c.b.b.5.b.5...b.b.l.b.m.m.m.m.q.b.b.b...#.5.b...4...4.c.m.#.a.i#.#b.T.3#b###c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#b#b.Q#a.Q.Z.2.G.8.i.m.5.b.4.5.b.#.#.i.b.b.b.b.i.#.m.c.n.m.t.m.7.b.m.f.x.K.x.c.b.b.j.n.c.j.b...4...4.#.b.j.m.u.x.G.l.b.i.b.4.#.4.b.b.........b.c.l.m.4.x.K#.#b#a.Q#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#b.Z##.Y#a#b##.l.i.7.b.b.m.b.b.5.b.c.i.c.c.m.f.l.7.x.x.x.m.x.b.i.b.m.x.L.m.c.j.b.b.c.6.b.b.b.#.b...b.#.f.m.x.t.m.m.m.l.j.b.b.b.4.....#.4.4.b.#.b.b.5.J##.w.Q.Z.G.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Z.G.J.Y.Z.K.t.i.m.5.j.c.i.b.#.b.b.j.b.m.f.x#..x.x.x.m.n.m.i.b.b.m.x.K.x.m.b.c.e.j.c.b.b.#.b.4.#.4.b.b.k.l.m.u.x.9.m.b.j.b.i...#.4...#.a.#.5.b.b.5.G.w.7.Q#c.x#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b##.G.Q.Y##.m.5.l.5.m.b.#.b.b.#.5.b.#.i.n.m.t.x.m.#.b.b.4.#.b.5.n.x.p.m.#.b.b.c.c.j.b.c.5.#.4.a.#.5.b.b.c.m.c.m.m.m.b.5.#.b...4...4.4.#.a.#.b.b.i.x.F.t.J.Z.G#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Y.Q.K#a.Y.Q.t.i.4.i.b.c.b.b.#.b.b.b.#.b.5.b.b.b.4.b.4.#...b.4.#.f.x.x.m.b.b.c.b.j.b.c.b.#.b.4.#.a.#.4.b.b.c.b.c.b.#.5.b.b.#.4...#...#.a.#.a.#.m.b.6.F.s.Z.Q.9.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#b#b####.G.w.x.b.6.h.b.i.5.b.4.......4...#...b.#.b...b.#.b.4...b.i.9.x.4.b.b.b.c.f.j.b.b.b.#.b.4.#.a.#...b.5.b.4.b.#.................a.#.b.#.b.b.7.l.9.i.K#c.G#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Z.S##.M.9#a.m.i.b.i.b.b.#.b.4.#.4.#.....a.#...b...b.#.a.#.a.#.5.b.6.t.b.b.m.c.b.j.b.c.b.b.b.#.4.b.#.a.#.4.b.#.a.#.a.................b.#.4.4.b.m...w##.4.Q#c.9.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#b.0.J##.i.M.G.b.i.a.i.i.b.4.4.4...4.#.4...a.#.#.b.4.b.#.b.4.b.b.m.b.x.m.7.#.e.c.b.j.c.c.b.b.a.#.#.b...#.b...b.#.a.#.4...4.4.4...4.4.#.a.b.#.b.j.a.8.x.i.5.J.Q.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#a.Y.9.F.e.Q#..5.h.i.i.b.4.b.4.#.4.4...#.a.#.#.b.4.b...b.5.#.b.b.b.f.x.j.b.a.c.b.j.c.e.j.b.b.#.b.a.#.#.a...b.#.a.#.b.#...4.4...#.a...#.b.#.b.j.b.6.8#..h.4.x.Q.Z#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#b#b.F.x.i.G.K.6.b.h.b.i.b.b...a.#.b.b.a.#.b.b.b.b.b.b.#.b.b.b.b.j.b.x.m.b.j.b.c.c.j.b.c.b.c.b.b.b.b...#.b...4.4.#.....#.a...#.a.#.4...4.a.#.a.m.6.X.9.b.s.9.Y#b#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b#b.x.9.4.x.Q.m.h.i.b.b.b.b.#...b.4.#.b.b.a.b.b.a.#.b.b.b.b.b.6.m.m.x.m.c.6.c.e.j.b.c.e.c.b.b.b.#.b.4.#.a.#.5.4.a.#.4.4...#.a.4...#.4.b.b.b.b.m.b###..h.x.9#b#b#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c#b#b.J.9.5.w#b.7.b.h.m.6.b.i.b.#.b.b.a.b.#.b.b.4.b.b.b.b.b.b.c.b.c.f.x.6.b.b.b.c.c.j.l.j.b.f.j.c.b.b.#.a.#.a.#.b...a.#...#.a.#.4.b.b.b.#.b.b.q.6.7.w.9.K.F.9#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b#b.9.l.i.8.S.G.h.b.j.l.j.b.4.b.b.b.b.#.b.b.a.b.#.b.b.b.b.b.b.n.m.x.p.m.#.l.c.b.i.f.c.l.c.b.c.c.b.b.a.#.#...b.4.#.#.....a.#.4.b.4.5.b.b.b.l.j.7.w.G.P.J.G.Q#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.K.G.l.t.K.J.4.6.s.m.7.i.b.b.j.c.b.b.b.#.b.b.b.b.#.b.j.f.x.j.l.f.9.b.b.b.b.b.#.m.m.f.i.m.j.m.b.b.c.b.b.c.b.b.a.b.b.b.#.b.b.c.b.c.b.b.q.j.l.7.t.K#b#a#c.Z#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b#..G.x.F.9.5.4.m.7.t.b.m.b.c.b.b.b.b.b.b.a.b.#.b.m.f.x.x.l.g.x.m.i.c.i.#.b.b.m.m.f.m.5.c.m.m.b.b.e.c.b.b.5.b.b.b.b.b.b.c.b.c.b.j.b.6.7.6.7.w.P.R#b#c.Z#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Y.x.Z####.9.5.h.w.x.t.m.f.b.b.b.b.b.b.b.b.b.m.b.f.x.m.f.n.m.x.m.m.b.b.b.i.m.b.c.m.b.j.b.b.m.x.j.m.m.m.j.l.b.5.b.b.b.m.l.m.b.c.b.b.t.w.q.j.x.Z#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b.Y.Z#b.K.h.i.8.x.x.n.n.b.j.b.b.#.b.b.b.m.b.m.x.m.n.m.f.m.x.m.c.m.b.i.b.b.m.b.c.7.b.b.b.m.K.m.b.m.j.l.m.i.c.b.b.m.b.c.l.c.b.b.m.8.w.j.7.9.S#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Y#a.9.b.s.s.G.w.9.l.m.b.f.m.f.n.c.f.m.x.m.b.m.x.c.b.j.f.m.6.b.c.n.b.c.b.b.f.b.b.5.b.9.8.b.b.#.6.x.m.c.m.b.#.b.m.b.f.m.b.6.7.K.8.s.s.H.Q.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.H.h.6.F.G.Q.K.9.c.c.m.g.m.f.m.x.x.m.b.4.f.x.m.j.f.x.9.m.m.m.b.c.7.m.f.b.m.m.H.x.m.m.b.4.4.4.x.9.n.j.b.f.j.5.f.b.b.m.J.x.G.w.6.F.J#a#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.w.j.v.G##.Q.K.J.x.m.b.b.j.t.K.F.b.5.#.6.8.K.T.T#c#c.K.x.m.m.m.f.m.f.5.8.K.Z.J.t.b.#.4.4.a...i.G.x.i.b.5.f.y.m.f.7.c#..w.F.9.m.F#a.Y#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.K.x.6.t.P.K##.K.x.m.m.m.x.M.9.l.i.5.5.x.X.S.T.T#c.Z.K.K.u.x.f.m.f.x.y.K.2.Q.u.4.5.b...b.4.b...z.Q.x.b.b.x.m.f.m.x.m.s##.8.x.F.G.K#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.Q.x.m.x.Q##.Y#b##.x.9.m.P.x.m.#.4.b.7###c#a.R.S#a#a.K#b.x.x.K.x.K.K.2.K.J.Z.T.x.4.#.b...#.#.b.7.K.P.m.i.m.x.9.9.F.s.G.v.F.s.9.x.1.3#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.T#..m.K.J.Q.J#a.T.G.x.G.x.6.5.5.b.b.w.P.Y.Q#a#a.Q.Q#b#a.K.x.K.L.K.T.x#a#b.Q#..b.b.b...b.#.a.4.m##.K.t.5.f.x.F.x.F.t.E.t.F.s.x.8.3#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c##.x.7.F.Y.J.Z#a#b.Q.J.x.q.m.i.5.6.m#c.Q.Z.S#a#a#a.S.T.x.P.K.K.x.K.K.X.X.K.t.4.4.5.4.b.#.a.#.b...6.W.K.n.Q.t.K.F.l.t.6.s.F.8#..3#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.3.T#..w.G.9#b#..Y.Q#a.K.F.j.s.5.5.x.X.Q.T#b.Q.Q#a#a#a.Y.K.K.K.Q.K.X.K.T.M.t.#.a.#...4.#.a.#.b...4.b.K.K.x.F.x.F.m.7.7.6.F.F.s.9.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.T.x.9.x##.Q.S#..Z##.x.b.a.m.m.w.9.J#c#c#b.Q.T#a.S#a#a.Q##.Z.J.Z###b.K.t...4.#...b.b.b.#.6.m.x.8.w.H.K.6.K.i.#.q.b.5.s.7.9.9.J#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Y.K.G##.P.K.9.Y.Q.Y.t.b.#.m.i.6.J#..Z.R.Q.S#a#b#a.Q#a#b#a.J.Y.Q#a.J.8...#.b...5.b.b.b.4.x.X#a.X.T.T.Q.l.i.b.4.a.4.a.7.w.F.x.8.Z.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.F.x.J.P.J.t.Y.S.m.b.4.#.b...j.S.Y.Z.Y.T#a.S#b#b.T#..Y#a.Y.x.K.8...b.b.b.m.f.u.t.x.K.u.Z.Z.3.T.9.i.b.5.5.#.b.4.j.s.9.9.F#a.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.K.G.Q.Q.G.7.K.8.t.b.4.b.b...5.i.K#c.Z#c#c#a.Z.R.S.Z.Q.J.G.K.5.8...#.4.a.j.f.x.S.X#b.M.2.Y#c.Z#..b.4...4.4.b.b.4.4.8.G.w.x.Q.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.Z##.J.K.w.i.S.Y.Y.#.b.4.b.i.4.w##.Z#c.Y#b.Y.S#b.T#a#b.T.x.w.j.b.b.b.b.K.K.K.K.K#..a.H.Z#c.T.x.4.....#.4.....4.m.s.K.F.9.x#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b.S##.9.w.j.K.K.t.6.7.b.i.a.5.8.J.Q#c.K.8.m.8.m.t.K#a.T.Y.K.x#..x.J.x.K.K.x.m.h.a.5.9#c.Y#..b.4.4.#.4...4.......8.F.m.G.w#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z##.J.G.i.7#b.J.5.b.i.4.7.m.i.T.K.X#b.m.4...5.....b...#.i.b.5.5.4.........#.#.l.u.K.T.x.5.5...4...4...#.....i.z.F.s.x#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.G.K.9.s.i.K##.w.i.h.5.6.r.e##.T.T.S.9.4.b...4.b...#.4.4...4.4.#.4.....#.4.b.x.S.X.J.b.4.4.....4...#.......4.G.F.t.x#a#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z##.Q.J.5.i.J.K.8.b.b.b.b.b.x.x.K.K.R.T.u.7.b.b...#.a...b...b.4.4.j.a.#.a.i.#.m.Y.9.m.4.4...#...4.4...4.b...t.K.s.9.P.T#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.G.S.K.w.h.u.Y.K.h.c.i.b.b.x.L.T.K.K.T.S.Y.K.x.4.b...5...4.6.m.b.w.j.m.b.x.b.6.K.b.#.b...#...4.4.4...#...4.w.P.u.F.Y.Q#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Y.S##.Q.m.m.s.G##.l.4.b.#.b.5.G.X.Y.Z##.K.Z#c#c.T.G.n.m.m##.....4.#.J.8.m.b.8.x...5.4.b...4.4...#...a...#.l.H.9.I.H###c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.K##.x.m.s.w.Q.7.b.b.b.b.a.G.K.T.Y.Q.Z.Z.Z#c.T.K.5.b.6.b.....#.4.x...b.m.b.b.b...#.....4...#.....#.4.b.9.K.w.G.w.Q.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.3####.x.4.i.J.8.i.5.b.b.c.6.x.Z.K.Z#c#c#c.Z#c.K.b.8.f.x.K.K.x.l.m.m.m.m.b.#.4.#.a.#.4...4...a.#...#.h.J.9.J#.#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b.G.T.G.8.h.G.x.h.5.b.b.i.c.9.S.Z.Z.Z#c#c.Z.Z.G.G.L.x.m.x.m##.y.5.b.b.#.b.4.#.a.......#.4...#...b...b.x.J##.9#c#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.K.Q.J.i.m.s#..4.l...#.a.i.j.S.Z.Z#c.Z.Z#b.x.x.x.w.c.m.t.x.b.a.c.#.4.b...#.a.#...#...a...#.a.#.4.b.h.8.9.J.x.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Y.Q#a.J.8.i.t.s.w.5.#.4.b.x.6.K#c#c.Z#c.Z.9.K.y.l.j.b.c.b.b.b.c.5.a.#.5.4.a.#...#...4...#...#.a.b.5.i.9.J###b.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b.K.9.9.5.l.t.7.i...#.m.x.x.Z.Y.Z.Z#b.J##.T.x.m.e.b.5.#.4.b.5.c.b.a.m.f.n.a.4.a.#.a.#.a.#.a.#.b.m.7##.K.P.Y#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b.Y.J#..5...w.7.b.b.h.m.K#b.Y#c#c.K.8##.K.T.Q.f.y#..x.l.m#..x.m.m.#.m.m.m.4.4.#.a.#...#.4.b.b.#.m.F.J#..T#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#a.K.x.7.5...m.s.x.y#c.Z.Z#c.Z#b.m.4#..Z.J.Z.Q.J##.K##.J##.9.J.9.x.8.x.b.#.b...#.a.#.a.#.b.b.h.t.x.P.Q.Z#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z.Q.9.x...5...8.x.K#c.Z#c.Z#b.G.4.b.9.Z#b#..S.K##.K.K.Q.K.w.G.w.m.l.n.b.a.4.#.a.#...b.#.b.b.i.w.P.K.Q.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.K.x.b.b.G.Y#b.T.Z#c.Z#c.K.i.#.a.9.J#b#b#..P.J#.#..J.i.s.j.h.4.4...#.#.b...#...b.b.b.b.f.7.9.Q.K#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b.G.K.9.T.Z.T#a#c.Z#c.Y.i.#.l.m.J##.K##.w.F.5.b.h.4.8.6.5.5.#.5.#.a.#.a.#.a.b...b.6.f.b.8.F.K.P#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b#b.Y#b.T.T#a.Z#c#c#c#c#c#c#c#c.Z.Z.x#a.Z.Z.Z.Z.Z#c.T.x.5.h.t.K.Q##.P.K.6.4.i.5.b.4.4.b.i.b.4.b...#.a.#.b.#.b.b.#.b.4.6.F.x.8.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#b#b.K.8.t.t.J.G.Z#c#c#c#c#c.Z#c#b.Q.x.X.Q#c.Z.Y#c.3.H.b.h.b.w.Q.J.Q.K.F.i.b.4.4...4.4.4.a...b.4.4.4.b.#.a.#.b.b.b.f.5.x.x.8.Z.Y#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#b.J.8.x.m.x.x.f.x.x.Z#c.Z#c#c#c#b.Z##.T.T.X.K.K.X.Z#b.m.5.j.7.G.G.K.J.K.8...a.#.a.#.4.4...#...4.#.4.4.#.a.#.b.#.i.4.#.l.F#..Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z.G.x.8.x.9.x.x.y.m.G#a.Z#c#c#c#c.Z.Z.G.T.T.K.L.X.T.K.8.4.b.6.l.G.G.J.Q.8...#.5.4.5...#.a.#...4.4.4.4.#.a.#.a.#.a.#.l.m.8.G.9#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c.Z##.m.x.x.x.8.A#b##.x.n.G.S#a#b#b#b.Z#b.w.Z.T.K.X.M.K.K.K.n.m.5.s.G.J.J#..G.m.b.b.b.#.b.4.4...a.#...b...b.4.#.b.#.b.b.b.6.s.G.x#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c.Z.G.f.x.x.K.X#a.Y.Q.K.m.K.Q#a.R#b#b.Z.G.R.Z.X.X.K.L.T.L.K.x.7.i.x.9.G.H.J.G.b.5.b...b.4.4.4.#.4.4.a...#.4.#.b.#.b.4.b.6.7.F.J###c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#b.7.w.t.m.x.Z#c#b.A.x.x.x#c.Z.Y.J.K#a###c.T.K.R.X#a.N#.##.9.x.J.p.t.F.J.t#..J.j.c.4.b.#.b.b.#.b.b...b.#.b.4.b.b.b.b.b.6.m.l.9#a.Y.3.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c.Y.G.w.8.n.x#b.Y#b.Q.x.y.x.K#c.Z.Z#a#a.J.Q.Z.R.T.X.S.L.S.R.S.G.Q.A#..w.t.t##.J.8.c.b.b.b.b.b.#.a.b.b.c.5.b.b.b.5.b.b.4.f.G.x.9.9#b#a.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#b.m.x.p.t.K.Y.T.K.m.x.x.K.T.T.T.T.T.K.K.X.T.X.K.X.R.S.R.K#c##.K##.J.G.e.t.S.J.8.m.i.b.b.5.c.i.c.b.i.b.c.l.b.c.b.#.a.7.s.G.F.K##.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c.1.T.F.p.m.m.x.t.t.7.p.x.K.A.K.T.T.T.T.W#a.K.T.K.L.S.S.R.W.Z.Z.Z#b##.K.K.x.w#..G.w.7.i.b.5.c.i.e.5.n.c.m.m.m.m.m.m.i.m.7.F.G.K#a.Y#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c.S.y.9.l.m.j.m.f.m.6.m.y.K.T.K.X.X.R.X.W.R.S.W.L#b.T#a#c#c#c#c.Z.Q##.Q.Q.K.x.K.G.x.l.j.t.l.t.n.x.s.m.G.m.6.t.m.t.F.x.F#####c#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c.X.Q.K.x.x.l.n.n.x.m.j.m.A.K.T.T.X.X.X.X.S.L.X#a.K#.#c#c#c#c.Z#c.Z.Y.J.Q.K.K.R.J.K.u.J.x#..x.m.K.G.x.x.x.G.x.G.x.x.w##.J.Q#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c.Z#a#b#b.T.Y.K.T##.x.f.m.x.x.X.Q.W.X.R.W.T.S.R.W.Q#c#c#c#c#c#c#c#c#b.T.K.Q.K.P.Y##.S.H.S.J.8.Q#..K#a.S#b.Q##.J.Q.Q.K.Q.Y#c#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c.Z.J#b.T.T.X.T#b.J.c.j.x.L.K.X.X.X.X.W#a#a.W#a.Q.Z#c#c#c#c#c#c#c.Z.Z.Z.Z#b#a.J.G.H.J.G.G.w.Z.Y.Q.J#.#..J.Q.J#a.Z#b.Y.Z.Z#c#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c.Z#c.Y#b.Y.Z.T.S.T.K.x.x.m.x.R.X.X.R.X.X.K.Y#a.Q.Z#c#c#c#c#c#c#c#c#c#c#c#c#c.Y.Z.Z#c#a.Y#b.Z.1.Z.3#c#b.T#b#b.Z#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#a#b.Z.Z.S.T.Z.Z.K.m.f.x.K.T.X.X.X.X.Z.Z#a.S#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#b#b#c.Z.Y#a#a#b.Z.3.Z#c.R#a#b#b#c.Z#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c.Z.Z.Z#b.X.T.T.T.K.X.H.x.m.f.K.T.X.X.X.R.Z#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.1.Z#c#c.Z#c#c.Z#c.Z#c.3.Z.Z.Z#c.Z#c#c#c#c#c#c#c#c#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c.Z#c#b#a.T#a.T.Y.X.T.Z#..f.m.A.K.X.R.X.X#b.K.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.Z#c#c.Z#c.Z#c.Z.Z#c.Z#c.Z#c#c#c#c#c#c#c#c#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#b#b.J.Y.Z.Y.T.T.K#a.f.x.K.K#a#b#b.T#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#b.Z#a#..Z.1.T.T.R.M.y.j.K.X.Y#a.T#a#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c.Z#c.Z.S###c.T.T.T.T#a.x.K.X#a#b.Y.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.Q#c.T.T.T.T.T.T.X.Y#a.R.Z.Y#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Y#b.J#b#b#b#b.Q#b.T#b.2.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b#b#a##.K.K#a.S.K#.#b#b#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#b.3#b.Z#c#c#c#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c.Z#c.Z#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c",
+"#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c#c"
+};
+
+/* J.R. "Bob" Dobbs, the holy prophet of the Church of the SubGenius */
diff --git a/pixmaps/l-bsd.xpm b/pixmaps/l-bsd.xpm
new file mode 100644 (file)
index 0000000..42cb8c7
--- /dev/null
@@ -0,0 +1,303 @@
+/* XPM */
+static char * image_name[] = {
+"146 165 129 2",
+"      c None",
+".     c #341E2C",
+"+     c #B6C7CF",
+"@     c #78A0BF",
+"#     c #6182AA",
+"$     c #982532",
+"%     c #4D71A3",
+"&     c #852834",
+"*     c #3F5F8E",
+"=     c #6C2C37",
+"-     c #9F7380",
+";     c #415277",
+">     c #99626D",
+",     c #4E2833",
+"'     c #C9D8DB",
+")     c #9C4A54",
+"!     c #8A606A",
+"~     c #A78798",
+"{     c #CFA9AD",
+"]     c #4C4659",
+"^     c #73545E",
+"/     c #562E37",
+"(     c #E9E2E4",
+"_     c #8A525C",
+":     c #52607F",
+"<     c #983D46",
+"[     c #676E88",
+"}     c #423E4F",
+"|     c #97A4BC",
+"1     c #76849D",
+"2     c #5F424E",
+"3     c #744A55",
+"4     c #AF252F",
+"5     c #8A414B",
+"6     c #5E3E49",
+"7     c #A4BBC9",
+"8     c #F0ECEC",
+"9     c #362E38",
+"0     c #4D4151",
+"a     c #5E3A45",
+"b     c #796C7C",
+"c     c #6F3C47",
+"d     c #883A42",
+"e     c #878497",
+"f     c #CACAD2",
+"g     c #515068",
+"h     c #B79EAA",
+"i     c #625E70",
+"j     c #9DB4C5",
+"k     c #662A36",
+"l     c #9D343F",
+"m     c #4F373F",
+"n     c #B0303C",
+"o     c #5C3640",
+"p     c #7E2534",
+"q     c #888FA6",
+"r     c #9E2430",
+"s     c #87303A",
+"t     c #BF888E",
+"u     c #F5F2F2",
+"v     c #916A74",
+"w     c #A3A1B6",
+"x     c #6C343E",
+"y     c #622E39",
+"z     c #6C606F",
+"A     c #7B7C92",
+"B     c #E7D9DD",
+"C     c #CFBAC0",
+"D     c #B97980",
+"E     c #422830",
+"F     c #4C2E33",
+"G     c #403642",
+"H     c #A32E3A",
+"I     c #654E5A",
+"J     c #958C9E",
+"K     c #A495A7",
+"L     c #DCC5C9",
+"M     c #A4AAC2",
+"N     c #522F36",
+"O     c #5E4653",
+"P     c #AD5D66",
+"Q     c #5B2E36",
+"R     c #90303A",
+"S     c #3A313D",
+"T     c #FDFDFA",
+"U     c #7594B4",
+"V     c #87707D",
+"W     c #95AEC4",
+"X     c #BB212A",
+"Y     c #A8565E",
+"Z     c #362830",
+"`     c #7C2F3B",
+" .    c #A83D45",
+"..    c #9596AD",
+"+.    c #78606D",
+"@.    c #74343E",
+"#.    c #5D323C",
+"$.    c #7C3D46",
+"%.    c #873640",
+"&.    c #5F7BA2",
+"*.    c #B6BDC5",
+"=.    c #B0757E",
+"-.    c #972E3A",
+";.    c #7A7486",
+">.    c #7C3641",
+",.    c #66333C",
+"'.    c #8F2834",
+").    c #41465F",
+"!.    c #85ABC5",
+"~.    c #BA98A0",
+"{.    c #A8232E",
+"].    c #ACB4C3",
+"^.    c #DCCFD6",
+"/.    c #9F7E8C",
+"(.    c #452F34",
+"_.    c #5C4F61",
+":.    c #B7AFBA",
+"<.    c #B66A74",
+"[.    c #742C38",
+"}.    c #4D3239",
+"|.    c #56323A",
+"1.    c #AA4A51",
+"2.    c #86A2BF",
+"3.    c #C1959A",
+"4.    c #698BAF",
+"5.    c #8F7986",
+"6.    c #8698AF",
+"7.    c #B8868D",
+"8.    c #887C8D",
+"                                                                                                                                                                                                                                                                                                    ",
+"                                                                                                    M ..w                                                                                                                                                                                           ",
+"                                                                                                    ;.6 _.                                                                                                                                                                                          ",
+"                                                                                            w +.I O e                                                                                                                                                                                               ",
+"                                                                                          ..! I a F e                                                                                                                                                                                               ",
+"                                                                                        J +.3 O A ;.w                                                                                         w J w                                                                                                 ",
+"                                                                                        _ @.,.O                                                                                               /._ -                                                                                                 ",
+"                                                                                        ! x }.0                                                                                               /.! v                                                                                                 ",
+"                                                                                  ..a $.c c 6 O                                                                                                   K 3 v w                                                                                           ",
+"                                                                                  K $.$.@.o m ]                                                                                                   w $.3 K                                                                                           ",
+"                                                                              J /.v $.>.c +.8.A                                                                                                   w 5 3 +...                                                                                        ",
+"                                                                            h Y d %.@.x 6 b |                                                                                                     w < 5 o b                                                                                         ",
+"                                                                          h 1. .< @.x Q , E i                                                                                                     h  .R Q b                                                                                         ",
+"                                                                        K 5 H < d $.#./ F (.(.g                                                                                                   w s s ` V                                                                                         ",
+"                                                                      K P  . .%.5 $.#.#.}.G (.G ;.8.M         K /.5.5.v v b +.+.z z z b b ;.|                                                     M  .%.@.2 i i M                                                                                   ",
+"                                                                    M <.1. . .< 5 $.#.#.#.}.G G I ^ ..        5.3 5 3 $.$.c ,.Q Q / o 6 6 m q                                                     h < R [.y Q (.M                                                                                   ",
+"                                                                    ~ Y  .n n  .) c Q #.|.|.m 0 2 2 ;.......K ! @.%.d c $.c ,.Q Q / N }.m E z 6.q ......|                                         w s %.` x ,.m e ..M                                                                               ",
+"                                                                    D  .n  .n 5 d @.o Q N m o #.}.F F m |.k ,.>.%.d @.x x ,.k Q Q , , / , . Z Z Z F E F b                                         w 5 @.%.[.N Z (.G [                                                                               ",
+"                                                                    P  .n n n %.d o |.}./ Q o x o #.Q |.o x x $.>.@.s x x ,./ Q |.|.Q Q Q Q Q Q / Q }.F }.^                                       w c s %.@.#.(.G 0 A                                                                               ",
+"                                                                    P n n n n d %.@.o o c $.%.< < < %.>.>.` %.%.%.>.%.` >.` y #./ Q / , k , Q Q Q , / E Z S g ^ i e                               w >.s @.#.o G F S [                                                                               ",
+"                                                                    Y 4 4 n  .< d x o ,.$.5 <  .<  .< d d l d d d d d %.d d ` @.Q Q N F , Q k / / (./ E E E E , F I ..                            w s s = Q |.G / }.b                                                                               ",
+"                                                                    Y 4 4 n  . .d c x %.5 5 ) < _ < 5 d d  .< < R < 5 < < %.R R @.Q |.}.F , , Q Q , , N F , / / N m I q                       M K /.R -.[.Q Q |.}.N ;.                                                                              ",
+"                                                                    P n n  . .) c c R  .1.1.) _ ) 5 5 d 5 1.1. .n  . .1. . .n n >.x |.(.F , , k Q Q , N Q / E , F (.(.9 ..                    > '.-.n H [.Q Q Q , . z                                                                               ",
+"                                                                    _ H n  .1.5 5 d d 1.Y =.t 3.7./.> 1.1.1. . . .1.Y 1.Y Y  . .d @.,.}.E N Q Q Q Q Q Q / k Q / , , Q }.I ..                ) R R '.R R = k Q Q Q F b                                                                               ",
+"                                                                    P n n %.5 d 5 5  .P D h L B L L t Y 1.1. .1.Y P <.P P Y  .1. .5 c / , N Q Q k p k Q Q / Q Q / N |./ #.I e       /.Y Y 1.H r {.-.= = k , , F F E z                                                                               ",
+"                                                                    >  .l < >.d 5 Y <.D { L ( u B B 3.Y 1.1.P =.7.3.h ~.t t <.P Y < >.= / , Q / k p k k k / Q / k Q / ,.,.= 3 - - - < $ r {.{.r H s / / Q / F , N E b                                                                               ",
+"                                                                    >  . .) 5 < ) <.3.{ B 8 u u ( L t P 1.Y =.h L ^.B B ^.L 3.D P ) %.s = k Q , Q / Q p k , Q Q / k y @.@.%.R R r $ $ {.{.{.$ $ & [.Q Q Q / / Q , E b                                                                               ",
+"                                                                    - 1.) 5 _ ) 1.D { ^.u T T T B L t P P <.t L u T T T T 8 L ~.P  . .& '.k k k Q k Q Q Q k k , Q ,.@.x d d %.'.n {.{.{.{.{.$ & [.k , Q , , , Q . . z                                                                               ",
+"                                                                    - _ 5 _ _ v D { B 8 u T T u L { D <.D C ^.u T T T T T u ( L D Y  .l @.Q p p k & k , k k '.k Q k s s s s l H $ $ $ $ $ & s s [.k Q Q Q / / k , / b                                                                               ",
+"                                                                    /._ 5 ) ) /.h C 8 u T T T 8 C t D =.t ^.( u T T T T T T u B 7.Y 1. .s ` = k k $ k p = k k Q k ,.` %.s %.%.'.$ $ $ & & s s [.y / , , , , , Q Q / b                                                                               ",
+"                                                                    ~ ! 3 _ > 3.C B T T T T T 8 { D D t { u u T T T T T T T T ( ~.<.1. .R l ` [.p p Q [.[.k p Q k x x %.s s %.s & p & s s [.[.y Q / }.(.F N , , Q |.;.                                                                              ",
+"                                                                    J +.^ ! <.C ( T T T T T u ( 3.<.7.{ L T T T T T T T T T T 8 { D Y n  . .l R & y k ` [.y & = [.[.= d s ` ` s s Q = ` & k Q Q Q / }.F , Q / N F F ;.                                                                              ",
+"                                                                    w b ^ - 7.L 8 T T T T u 8 B 3.=.3.L B u T T T T T T T T T 8 C t P n  .n  .l s s s @.@.@.@.s = = ` x x x y @.s = k = p Q Q / Q , E F , , , Q 0 0 A                                                                               ",
+"                                                                    ~ ! Y 7.{ ( u T T T T u ^.C 7.7.C ( T T T T T T T T T T T 8 L { <.n n n l d %.@.k x x ,.Q x @.x y Q y y @.x k ` = Q k Q N F F m F / N N N F |                                                                                   ",
+"                                                                    ~ ! v h L ( u T T T T ( L { t 3.L 8 T T T T T T T T T T T 8 L { <.4 n n R %.s ` x x @.x ,.x x x x Q Q y y y / y k / / F F , N F / , , F E Z M                                                                                   ",
+"                                                                    ~ ! 5.C ( 8 T T T T T ( { 3.h h ^.u T T T T T T T T T T T u L { <.n n  . .R s >.= @.@.x x ,.x y y N / / Q Q Q Q / k Q |., / , , Q F (.S (.S |                                                                                   ",
+"                                                                    J v ~ ^.u ( ( 8 u u T B { D { C B u T T T T T T T T T T T T B { D n  . . .l s >.= [.` x a #.Q Q / }.}.N / / / Q Q / / N F Q N , , F }.} 0 z                                                                                     ",
+"                                                                    ~ /.7.' 8 ' 7 + ' B u ^.3./.:.+ ( u T T T T T T T T T T T T ( L D  . . . .H s s s [.,.x @.y Q / m m }.m }.}./ , Q , E , Q Q Q / F Q 6 _.A                                                                                       ",
+"                                                                    J /.~.*.' j !.!.7 ' u ^.~ V w + ' ( u T T T T T T T T T T 8 ( C D 1.1. . .H s s y p [.k / k / / }.G }.Q Q Q y Q k Q N E / , N / E #.6 ;.                                                                                        ",
+"                                                                    J ~ ..W W 4.&.4.6.7 ( :.e +.6.].7 ].+ ' ( u T T T T T T T u B { D n n n n H '.$ y ` [./ Q Q , F }.|.F N Q Q / Q N , / , Q F , / m O 8.M                                                                                         ",
+"                                                                    e e q 4.4.% : % A ..f :.V I 1 2.6.q 2.+ ' 8 T T T T T T T T B { <.n n  .n n -.& k [.` Q Q Q , }.}.Q , , Q k / , Q / / E Q , N #.O +.w                                                                                           ",
+"                                                                  ..b b ;.: * ; ; : ;.e :.K b _.A 6.1 q | | 7 8 T T T T T T T u B { <.n n n n H H x ,.` = k Q Q |.F N , F , , Q Q k / , , N , _.^ +.;.K ].                                                                                          ",
+"                                                                M a 2 _.g ] } G } O ^ [ 5.b _.g [ U 1 K ^.1 2.' T T T T T T T 8 L 3.P n n n n H s x x @.x ,.Q F m }.F F Q E . k / Q . E , Q N e                                                                                                     ",
+"                                                                M m m } } G G G } g _.+._ 3 ] } ;.A :.^.^.&.| ' T T T T T T u 8 L t P n n n n H s %.c ,.Q k Q F F F F , Q k Q / k Q k Q Q Q 6 ..                                                                                                    ",
+"                                                                M c ,.m } S 9 S G } ] 2 c 6 G } g ; [ ;.8.C W ' T T T T T T T 8 C t Y X n 4 n l s %.s x y / Q / F , / , / E , , Q Q / Q 2 ..K                                                                                                       ",
+"                                                              M V %.x m G G 9 9 S } m o o m G G } ] } } g ....^.T T T T T T u ( { D Y X n n H -.s d ` [.,.y #.Q / / Q / , , , k , Q k c +.                                                                                                          ",
+"                                                            M - ` %.%.,.m G G 9 9 G |.o ,.m G G G 0 G } ] A 6.' T T T T T T u ( K <.1.n n n H R s d x y ,.y Q Q / , / / k Q , k Q / 3 V J                                                                                                           ",
+"                                                            - R n n R ` ,.G G G (.|.o o ,.o G G ).G G G _.B M ^.T T T T T T u B ~ > 1.n 4 n H H s x Q Q Q y , Q , , , E / / k Q Q , e                                                                                                               ",
+"                                                          > R H n n R s ` o a |.o ,.@.d @.2 0 G G G G ).[ B 7 ' T T T T T T 8 ^.- )  . . .n H s s @.x y Q k Q Q F F / E Q Q / , Q F q                                                                                                               ",
+"                                                        <.l {.H n n n -.s [.Q ,.x c >.d d c G G G G G } : | M ( T T T T T 8 ' *.>  . . .n l '.'.s x s k Q Q Q , F , , / k , , E , . e                                                                                                               ",
+"                                                      M l {.4 4 4 n H R '.'.[.` ` %.d d %.x m G G G G ).: | *.( T T T T T ( *.K Y  . . .l %.R '.` x [.k / , y F (.G F Q Q k , , N , e                                                                                                               ",
+"                                                      :.l {.{.4 H n R s & r $ '.R s d %.d c m G G G } g [ + ( u T T T T 8 ^.K 5.1. .n H s %.s s @.@.= k k k , |.G (.F , k , , / / , e                                                                                                               ",
+"                                                      M H {.{.{.$ n -.s '.$ $ {.4 H d %.%.$.6 ).G G } g ;.B ( u T T u 8 B { 5.^  .n n  .s @.` s ` c & k / / (.m G (.F (./ E , , , . e                                                                                                               ",
+"                                                      M -.X 4 H $ 4 R s & $ {.{.4 r '.s @.x c 2 a G ] ^ V C ^.B B ^.L h 7.- 3 _ 5 5 l H s @.` s @.@.y Q k Q Q , / Q Q , k , / k Q F e                                                                                                               ",
+"                                                      :.{.X X {.H -.R R $ $ {.{.{.{.'.'.s @.a o o |.2 ^ v { { C C { { D v ^ $.c 5 5 d -.s @.>.@.y '.k Q / / F , F / k Q , / / , , Z e                                                                                                               ",
+"                                                      M H {.4 {.4 H R & & r {.{.{.r '.'.d $.,.#.|.#.,.3 Y <.<.D D <.<.Y 3 5 ` ` %.5 %.s ` x ` ` k ` k , / Q E Q , , / , , / / F N z |                                                                                                               ",
+"                                                      M -.{.4 4 {.n R R & $ {.{.{.$ s s $.x #., F / x ` d _ 5 ) ) $.$.s s s s s '.R s s ` k [.[.k ,.y , , Q (.Q F , Q N / , k , , w                                                                                                                 ",
+"                                                      :.-.H H n n H -.s '.p $ & & s s x @.o |.F / Q @.d d %.d d R R R '.$ $ r r n {.$ R $ k [.[.Q Q Q Q Q , , / , N Q Q , , , (.. |                                                                                                                 ",
+"                                      &.w ^.          M %.R H H R R s ` = k k k [.` Q k Q Q / , / , = s R  .n n n 4 X X X X X X X X X r $ '.[.k / Q k Q / F E m F , Q Q Q E . y Q M                                                                                                                 ",
+"                                      W   M A         :.5 s R R & s s ` @.[.[.x = = p Q Q Q / N k |.@.R n n n n n n X X X X X X X X X r $ '.p [., Q / k , (.G (., / Q Q k , , F |.M                                                                                                                 ",
+"                                          2.i         ].3 @.` s s [.` @.x ` [.x x = p Q Q k / Q / Q ` R -.n 4 4 4 X X X X X X X X X X {.$ '.& = k [.Q |.N F G (., / Q Q / Q Q |.O M                                                                                                                 ",
+"                                          w [ | W       ;.+.$.s s y ,.o ,.x = @.@.x y k k k k k k k ` -.l 4 X n 4 X X X X X X X X X {.r $ & k Q k ` k / / , (.(.F , , Q , / 6 +.5.                                                                                                                  ",
+"                                              ;.1 |         5.@.s x y Q Q k s s & R s s s R s R s R H n n X 4 n X X 4 X X X X {.{.r p $ $ k Q Q / / Q Q / F k E / / , Q Q , b                                                                                                                       ",
+"                                              i :.f         8.c x Q k , Q / k s s s R s s s s s s s l n 4 r 4 n n n 4 X X {.r r $ p , k Q k , Q Q E , , , (.Q F / , , Q Q / b                                                                                                                       ",
+"                          ^.                ^.C q |         M K ....^ ,.,.y Q @.@.` s R H -.-.H H R l n n s r {.4 -.-.'.'.& p k k k k / Q Q Q , k N F F , E N , N F , , |.m ;.                                                                                                                      ",
+"                          (                 w B 1 q                 ..+.c c Q y = ,.s s -.l l n -.R l l -.H '.$ $ '.` ` [.[.p , y Q / k , Q k Q N , N F (.F , Q E , Q F m I q                                                                                                                       ",
+"                          ^.].| W         6.: C 6.W                   ..+.b ^ a k Q ,.` s R l H R s l l R l R R & s ,.,.y |.Q k y y Q Q / / , , F E , , , E Q k E , Q Q z 8.w                                                                                                                       ",
+"                            8.: &.        ..: ;.M                             ^ o Q k x x d %.R  .R s s s %.s s s ` Q k |.#.#.Q Q #.Q / E E F N Q F F / , . Q / Q Q / }.M                                                                                                                           ",
+"                              A ;.      | &.:                                 b O 6 y x x >.%.R R s ` ` s d %.$.@.x Q Q Q / |.Q Q / |.}.F E }.}.m }.(.N Q Q k , , #.I +.M                                                                                                                           ",
+"                                q [ [ [ i ; :                                 M ..5.#.o o x @.k k ,.c 2 c @.x #./ k / k , F / Q , N / / }.m }.m N / N / , , , e ..K ..w                                                                                                                             ",
+"                              M 1 _.] ).] g :                                     | V O 2 ,.o y y #.a c 6 x #.|.N Q N #./ / Q Q , N / Q / / / m N Q N |.N }.F w                                                                                                                                     ",
+"            | 2.| W           M e g g ] ).0 g                                         5.V I #.k x y y ,.o o #.Q k / |.#.Q Q y Q #., , , N / Q Q |.N |.m }.0 +.M                                                                                                                                     ",
+"          U * ; : &.|       | *.:.g g } G G } M                                           8.2 a o #.Q Q #.Q Q Q Q / Q Q Q ,.x #.o |./ , (.}.o o #.m }./ , I                                                                                                                                         ",
+"          q z A L J 1 6...U 1 M C g ; } G G ).g i q         - l l l < 5 -                     w o #.Q Q Q Q k , / k Q Q #.o o o Q F , / Q F N Q Q / |.}.6 +.                                                                                                                                        ",
+"          | e 1 B L C f L f C ^.^.C ].i ).} ).G G 1         <.r r r '.'.>                     M ^ c y Q Q Q Q p p , Q k / / F #., N / N Q , Q / / |.}.}.0 b                                                                                                                                         ",
+"            | | f ^.f f f f f f ^.f ^...1 1 A i } _.A A [ ;.) {.{.{.p p !                       J 5.3 Q , / / k k N , , Q / F Q / Q / / / k Q / |.|.F z 8...                                                                                                                                        ",
+"                                              q g } G (.E , p {.{.{.[., z                           ;.#.k Q Q k , (.F E / Q N Q Q y Q y Q / Q Q Q Q E e                                                                                                                                             ",
+"                                                A g ] #.k . k r {.{.k , _.                          ;.a Q Q / Q Q F m |., Q Q o @.y k x k #.k Q Q Q E A                                                                                                                                             ",
+"                                                  e g S Q p $ $ $ k k Q +.                          V y x x k = ` ,.x x y y @.s s '.$ '.$ ` k y = Q / a I e                                                                                                                                         ",
+"                                                  ..z |., k k p p k , , G z                         V [.& s & s s s s s @.@.s @.s & $ $ $ $ & s @.Q / m O b                                                                                                                                         ",
+"                                                  J 3 x p p k k k , , , . m A M                 ..8._ s & '.$ '.$ '.$ -.& & s ` s '.$ $ r -.'.s ` #.#.}.0 +.                                                                                                                                        ",
+"                                                  /.5 ` & $ p [.k . , E E m |.e               ].! a [.s '.$ r {.4 {.{.{.r '.s s s '.'.4 {.4 H R s #.#.|.m z                                                                                                                                         ",
+"                                                  /.5 & R $ $ $ p k k , , (.m O e             | ^ $.` R $ {.{.4 4 {.X {.r '.s R s s R -.n {.4 -.` Q Q , (.g                                                                                                                                         ",
+"                                                  - $ {.r $ '.[.k Q Q Q N (.|.}.m m G G G m m o Q ,.s '.$ {.{.r r {.4 '.'.'.s s %.d s '.r H -.R s x Q |.m I                                                                                                                                         ",
+"                                                  - $ 4 {.{.r & p k Q , , (./ }.}.N F F (.(.}.|.,.,.[.& p $ r $ $ R R R '.R s ` s @.@.s '.-.R s s @.#.F }.m g M                                                                                                                                     ",
+"                                                  - '.4 {.r r & [.p Q F F F Q |.#./ , / F (., |.y = ` ` [.& & '.& ` s ` %.s ` x >.= = [.s ` s s @.@.o |.F }.(.|                                                                                                                                     ",
+"                                                  - '.r r $ p p k p Q F F F Q N |.#.(.}.}.}., y = s & R R s & -.p [.` x x @.x ,.x ,.,.y ` @.[.` @.x ,.#.|.}.}.|                                                                                                                                     ",
+"                                                  5.` s '.& p / / / Q , (., Q Q Q / m E E , Q k s '.$ r {.{.r {.{.& Q k Q Q Q Q Q k Q o Q ,.@.$.$.o o #.N (.Z w                                                                                                                                     ",
+"                                                  5.o >.s k k / , , / Q N E Q Q Q / F F F N Q k $ H 4 4 X X X X {.p k / Q Q Q , Q Q Q Q #.Q ,.` >.Q Q Q Q / / |                                                                                                                                     ",
+"                                                  M ..J >.y / k Q E Q , , / , , , / (.E (., / k $ n 4 {.X X X X {.r & p k Q Q k , / / N Q #.Q ,.= Q Q Q Q , E w                                                                                                                                     ",
+"                                                      M 3 ,.#.Q Q , Q N , |.}.N , , F E F , Q k & 4 {.{.X X X X X {.r $ p k Q #.F N |.|.Q o #.|.Q Q , k Q , Z w                                                                                                                                     ",
+"                                                        b +.3 ,.= ,.Q , }.}.|./ N F (.F F , / k $ {.X {.{.X X X X {.$ $ R ` y o |.|.}.|./ N |.k Q / k / k , E |                                                                                                                                     ",
+"                                                            /.d %.c x Q Q Q / , , , F E F , k k {.{.X X {.X X X {.{.{.'.s s x @.Q |.|./ m / Q Q Q , k / N E . w                                                                                                                                     ",
+"                                                            ..- > ! ^ 3 6 }.}.F / Q Q Q Q p p r {.{.{.{.X X X {.{.{.{.$ '.` @.x Q #.|.}.}.Q , / k Q Q Q Q Q / w                                                                                                                                     ",
+"                                                              M M M w w 8.6 (.}.N F , Q E p r r {.{.{.{.{.X X {.{.{.r & R ` ,.,.Q #.o o |.|.Q Q / , k Q , , E w                                                                                                                                     ",
+"                                                                        M 8.A 2 m |., k , p r {.{.X {.{.{.{.X {.{.r $ [.[.y Q o Q #.o |.m F k , / Q / k k , E |                                                                                                                                     ",
+"                                                                              ^ o Q Q Q p r {.{.{.{.{.{.{.{.{.r p p $ k k / / #./ / |.}.}.N / / , k / / k Q , w                                                                                                                                     ",
+"                                                                              ;.I ,., k p {.{.{.{.r r {.{.{.r $ & [.s y Q / |./ |./ Q / F }.F , Q Q Q , Q , . |                                                                                                                                     ",
+"                                                                                  8.. , p r p r r p r p r p p p Q k k / Q , F Q F E F }.F |.#.Q Q , . , k Q , w                                                                                                                                     ",
+"                                                                                  e , , . , p p p p p p p '.= k / / / k , / , |./ F F }.E F , Q k k , , k , E w                                                                                                                                     ",
+"                                                                                  J / , , k p p , p = c @.[.Q Q Q Q , Q F F , F N N F m , / / Q Q Q k , , , E w                                                                                                                                     ",
+"                                                                                  J , k , , , , Q , ,.,.y Q k , Q , F N , F F (., , / N Q k , Q Q Q y . , / , w                                                                                                                                     ",
+"                                                                                  J #.k k k , k Q Q k Q Q Q k / / , Q F , N E (.Q , F F Q Q Q , , k Q k , E . |                                                                                                                                     ",
+"                                                                                  J (.}., Q k / N |.Q Q Q / Q , , (.E , F E (.Z , Q , , / k k , . / , (.F , E w                                                                                                                                     ",
+"                                                                                  J x #.N F F N |.F F N / Q N N N F (.(.F E (.(.(.F F , / / Q , , F , , (.Z . |                                                                                                                                     ",
+"                                                                                  ~ s p Q F }.G / F N |.}., , , , (., , (.(.E E , E E F , / k k / F S }., Z E w                                                                                                                                     ",
+"                                                                                  ~ $ $ [.k }.m m |.N / |.(.(.(., F Q E (.G }.(.F (.E , E N , / , F S (.(.E E |                                                                                                                                     ",
+"                                                                                  ~ {.$ $ s ,.#.|./ |.N / m m F (.F Q F F (.S E (.Z 9 (.F E F E , (., (.E Z . |                                                                                                                                     ",
+"                                                                                  ~ r {.$ $ & ,.o F }.|.Q }.m / N }.m (.E E 9 , (., Z Z F (.F (.E (.E (.E E E w                                                                                                                                     ",
+"                                                                                  ~ r {.{.r r '.` ,.o |.F F N }.}.(.F , (.(.Z . E (.(.E Z E (.(.G E }.F F (.. |                                                                                                                                     ",
+"                                                                                  ~ {.X X {.{.{.'.@.,.|./ , N (.(.E (.E E Z . . Z E (.(.E Z E (.(.(.G (.F F , |                                                                                                                                     ",
+"                                                                                  /.r {.X X {.{.$ & [.= y Q N m (.F F 9 (., . . E (., E (.Z E E (.G G m }.F , w                                                                                                                                     ",
+"                                                                                  ~ $ {.{.{.{.{.$ '.'.` @.k / Q N , Q N / Q Q E , N F , E . Z Z E F }.(.(.E . ..                                                                                                                                    ",
+"                                                                                  /.$ $ {.4 {.{.{.r R s ` Q Q Q Q / N m |.y , F m N / F Z . . F (.S G (.E , E m q                                                                                                                                   ",
+"                                                                                  J & & H 4 {.{.{.{.-.$ & & = [.[.,./ }./ Q , , Q , / / (.E Z E (.(.(.(.(.(.Z Z ] e                                                                                                                                 ",
+"                                                                                  ..c s -.H {.{.4 4 r $ $ R ` >.>.,.k |./ N F Q |.}., / E (.(.(.(.Z 9 S (.E Z E Z z                                                                                                                                 ",
+"                                                                                  w b > d -.-.'.H r r $ & $ '.` >.x Q #.Q / N , Q }., N E E E E (.. Z Z (.F (.(.E z                                                                                                                                 ",
+"                                                                                        > d s & $ $ & '.& $ '.& s ` k Q Q k , F / , (., F F F F E . . Z Z (.E Z Z i                                                                                                                                 ",
+"                                                                                          v $.s s & [.[.'.& = = = Q Q Q Q Q , F / F (.F / F (.E (.E E E , F E E E }.^                                                                                                                               ",
+"                                                                                          e $.@.` s ` = s s ` x |.k , k , k / , , Q , , k , , Q , / F F (.(.F }.F Z 9 _.M                                                                                                                           ",
+"                                                                                        q +.2 c o = x y ,.[.[.k Q Q Q / F / }.F , Q Q / N / N / , , F E E (.(.}.F E E Z w                                                                                                                           ",
+"                                                                                        i m #.#.#.#.Q / k / , k , Q , F F (.F (.Q F F / E (.E F F F E F F (.G (., F (.E |                                                                                                                           ",
+"                                                                                        ;.O m |./ |.}.|./ F / N , Q (.}.G (.F (., , F m , (.E N , F (.E E (.G (.N / E . ..                                                                                                                          ",
+"                                                                                          b F o #.Q Q Q , (.}.F }.m S G }.m F , F F (.}.G F }.F F F E }.m m m (.F }.}.(.m m ;.                                                                                                                      ",
+"                                                                                          ;.a o #.#.#.o |.}.F (.(.(.G G G m }.}.(.(.G G G (.(.}.}.m (.F N }.m }.(.m }./ F E z                                                                                                                       ",
+"                                                                                          A 2 6 c c ,.,.o |.(.(.(.F |.}.N |.|.|.}.}.(.G G F N F }.N }./ / m (.}.G (.F N , E O ;.8.                                                                                                                  ",
+"                                                                                          A O I $.$.c @.x o F F F F #.y y ,.#.#.m m |.|.N N / |./ / Q Q N m } }.}.F (.F N F F E }.|                                                                                                                 ",
+"                                                                                          ;.I I I 3 5 5 c ,.Q , }.m o c x x @.a ,.Q Q / Q Q |.N / E / |.m m 0 ] 2 6 }.m |.(., / . ..                                                                                                                ",
+"                                                                                        _.0 3 I ^ ^ ^ ^ _ 3 c F N O I I ^ 3 5 5 a o / (.E / , N Q }./ N m m O w   A G G m (., Q Q a a m i                                                                                                           ",
+"                                                                                      ..I O ^ ! ! ! ! ^ 3 d ,.|.m 6 2 3 3 3 2 $.x y Q Q / Q Q , }.0 6 o m 0 m w   W q g 0 m }., / k / N }.i M                                                                                                       ",
+"                                                                                  M V +.^ ^ ! v v v ! _ 3 @.,.m m m 6 $.c 6 a x x ,.Q k Q Q / F G O _.I 0 _.A         q q A i E #.|./ N F (.z b ;.e                                                                                                 ",
+"                                                              M w M w M M w M w w 8.2 I ^ +.! v - > _ _ $.#.o m G o o a 6 c a 6 c c ,., Q Q N (.} i z _.O I q               .._.+.z 6 / N / E Z . O ....w M                                                                                         ",
+"                                                            J +.+.+.+.v V +.+.^ _ _ ^ ^ ! ! ! _ _ 3 $.O 2 o o 0 0 o #.2 O 3 O O O I 6 N Q , ,.a ] z [ i 0 G . |                     ;.o / / , / (.E , |.O e                                                                                         ",
+"                                                            ;.a O I 3 _ ^ ^ _ ! v > _ ! ! ! 3 5 c ,.a a o 0 0 O 2 2 ,.O O 3 ^ ^ I I 6 / , , }.o 2 z C 5.O m Q w                       A , , Q , , Q / F F b                                                                                         ",
+"                                ].].j j j W 2.W 2.6.q 6.^.^.e O 2 c c ^ ^ ^ _ ^ ! +.+.+.^ 3 I 3 2 2 2 2 O O O 2 a a a 6 a a 6 a a a o N N , |.|.0 i ;.^ O G . w                       M ..........8.|.(.E (.g _.i z z b [                                                                           ",
+"                              j j +       7 W | 2.U 4.4.M M A g I a 3 3 ^ +.+.+.+.b b ^ I I O O O O O O O O O a m 0 ,.#.Q |./ #.|.Q |.|.#.N N N m ] ).O a Q E ;.M                                 ].A ;.0 E , E , F m a 0 M                                                                         ",
+"                            M j     ' '     j W W 2.U 4.4.&.: i i ^ ! ! V 5.5.e e q e /.b +.^ ^ I I O O O 6 2 a ,.0 ,.|.k / k , N / / Q #.Q / |.m 0 0 m #.y / a ;.M                                     8.O |./ , (.}.F (.1 q q ................                                                    ",
+"                    W | j     *.          j W !.!.@ U U U # &.[ ;.5.J w :.:.:.*.+ + f :.:.K J e [ I 3 O O ,.x @.c x o #.Q Q Q Q o |./ Q Q Q Q Q Q k Q Q Q / E }.G [                                       q 6 m (.m }.(.9 Z 9 Z Z (.E }.}.m a 0 ..                                                  ",
+"                  6.6.W *.      f       7 j W !.!.@ U 4.U 4.4.1 1 K h :.f C f ' f ' ' + *.:.K q ;.^ I 3 d o o 6 c @.x #.Q k Q k ,.y Q Q , k / Q Q / , k Q Q Q #.6 _.;.                                      ..).0 0 2 ).0 o o |.}.m }.m |.}.m (.q                                                   ",
+"                :.w M 7 7   7 *.*.j j j W !.@ !.@ @ U U 1 U | M j *.+ ' f ' ' ' ' f + *.7 M M 2.4.A K ~ O o x x a o ,.= Q Q , Q x = , Q Q / k , Q k Q Q / k Q #.o m )._.M                                     ..6.| ....6............._.G S Z Z 0 _.^ i ^ i ^ i z [ [ e | M                         ",
+"                K w ].*.7 7   7 *.j j W W !.@ @ @ @ 4.U U 6.j + + f ' ' ' ' f + + + + 7 j !.W 2.4.1 ].:.O a ,.x ,.Q Q y Q Q k ,.x y k Q , k Q Q , k / , y Q #.6 0 m G G |                                                             q b _.O ] 0 m m F , F , / #.O _.+.e ..                        ",
+"                | M       *.      7 j j W 2.@ @ @ U 4.U 6.| 7 ' + + + ' + ' + *.7 j j W !.2.@ q 4.&.:.C V 6 m o Q Q Q Q k Q Q ,.@.[.k k Q k k k Q Q Q / |.a a O ] 0 G S M                                                               w 8.e A ;.b b ^ o Q Q / o 6 6 3 ! V q                       ",
+"                                      7 W !.!.@ @ U 4.U w :.*.+ + 7 j 7 + 7 *.7 W W !.!.@ 4.4.# &.% w ^.C ] m |.Q Q Q Q Q Q k / p '.p / Q p = Q Q Q , }.} ] O g g ).G Z |                                                                               _.6 c 2 a o ,.,.#.m G q                     ",
+"                                              # 4.4.4.U W :.j 7 7 7 !.!.W !.W !.@ @ @ 4.4.# # &.&.% [ b i O a Q k , / k , / Q Q k Q k Q #.,.,.Q Q #.0 ).).; _.; ; ).G G |                                                                                       M O o x ,.#.#.i ;.J                 ",
+"                                              # # &.&.4.W j j W W j !.!.2.@ @ 2.@ @ 4.4.&.% % % % % * * _.a #.= = k ,.k Q Q Q #.#.|.|.#.#.6 0 6 2 g ).; ; * ; * ; ).S Z |                                                                                         3 ,.o o o ,.6 I ;.                ",
+"                                              2.2.2.2.6.2.j j j j j j W W !.6.@ U 4.# # &.% % % % * * * ; ] m a a m 2 a 0 ] O 0 0 ).).] g g ).).g ; * * ; ; ; ).).G 9 Z w                                                                                         /.8.^ o 6 o a 6 i ..K             ",
+"                                                        @ W j j 7 j j j j W 2.U 4.4.# # % % % * * * * * ; ; ; ).; ; g ; ; ; ; * ; * % # * * * ; * ; * * ; ).).9 Z . Z Z |                                                                                             e 2 O ,.6 2 3 +.+.M           ",
+"                                                        | W W j   7 ].*.7 !.!.U # # # % % % % % % * * ; * ; ; * ; * * * * ; ; ; * * q L * % * * * * ; ; ).).S 9 9 9 Z S |                                                                                             ..+.^ c x c O O O ..          ",
+"                                                                  !.W W W !.!.U U 4.4.# % % % % % * % % * * * * * * * * * * % * * * U f ; * ; ).G } 9 9 Z Z . 6.                                                                                                          M 6 |.o a O O I ^ 8.      ",
+"                                                                  ].W M !.@ U 4.# # # # % % % % % * * * * * * * * * ; * * * ; * * * : &.; ; ).G S Z Z Z Z G q                                                                                                           M ;.o F / ,.a 2 ] ).z       ",
+"                                                                          W !.2.2.@ !.@ &.4.U * * * * * * ; ; ; ; ; ; ).).).).).} ).).} } } S S } [ [ &.b A                                                                           ..5.J                           w ;.I #.}.F o 6 0 0 0 z       ",
+"                                                                                        # 2.| % A &.% ; ; ; ).} ).).).).} G S G G G 9 Z 9 Z ).g [                                                                                     ! x _ ..                      M b m }.}.}.|.m 2 O 0 ).z       ",
+"                                                                                        6.1 1 q B B ..* * g ] G G G ).S S S S S G } } } ).} q                                                                                         > & ` ,.w                     8.^ 6 m }.m F (.m ).G S :       ",
+"                                                                                                              : Z Z G 9 9 9 9 9 9 A                                                                                           A / R l '.'.s s $.K                 ] (.}.m |.m S G S Z G G } z       ",
+"                                                                                                              M 6.q 6.q U q q q q W                                                                                       - > 3 Q k $ '.s %.s x +.b b b b +.z z z (.(.(.(.F G G G G } } A 6.W       ",
+"                                                                                                                                                                                                                          ^ %.p [.p & ` s %.` ` x c c a a o N F G (.E E E (.G } } _.1 1 M           ",
+"                                                                                                                                                                                                              w K K ..K ~ c & & '.'.@.x @.` x ` [.[.[.Q / F (.(.G G 9 Z Z S S } } z                 ",
+"                                                                                                                                                                                                            K _ 5 >.x k '.s = p '.s x x @.x Q Q Q Q Q }.}.m F E (.S 9 . . Z m G G i                 ",
+"                                                                                                                                                                                                          J $.d s s s s s @.` ` @.@.,.Q ,.x Q o o #.N G }.m }.E (.G 9 Z . . E m 0 b                 ",
+"                                                                                                                                                                                                          M K K K K K K K K K K K ....I |.|.|.F F , (.9 9 E (.Z Z 9 Z Z . . Z Z (.0 i i |           ",
+"                                                                                                                                                                                                                                      b ] O 2 6 0 |.(.(.G G G (.Z S 9 S Z Z 9 S G ] ] 2 ..          ",
+"                                                                                                                                                                                                                                      q A A ;.;.b b ^ i [ [ z ^ i z i i i i : i [ ;.;.;.M           ",
+"                                                                                                                                                                                                                                                                                                    ",
+"                                                                                                                                                                                                                                                                                                    ",
+"                                                                                                                                                                                                                                                                                                    "};
+
+/*
+ * BSD daemon
+ * The original BSD daemon is Copyright (c) 1988 Marshall Kirk McKusick.
+ * All Rights Reserved.  Reproduced with permission.
+ */
diff --git a/pixmaps/l-hp.xpm b/pixmaps/l-hp.xpm
new file mode 100644 (file)
index 0000000..ce960da
--- /dev/null
@@ -0,0 +1,75 @@
+/* XPM */
+static char * image_name[] = {
+"93 59 13 1",
+"      c None",
+".     c #A8B2C4",
+"+     c #2B4F8D",
+"@     c #0A357E",
+"#     c #DEDEDF",
+"$     c #F3F3F4",
+"%     c #5B739D",
+"&     c #8E9AAE",
+"*     c #CDCDCD",
+"=     c #D6D6D8",
+"-     c #BEC4CD",
+";     c #FFFFFF",
+">     c #E5E6E7",
+"   .+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###++@+++#$%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+&>>      ",
+" %%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&*..@@@@@%==++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%*     ",
+" %%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&*..@@@@@%==++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%*     ",
+"-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-=%%@@@@@.=.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&*#   ",
+"+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%.**++@@@++**#===-&&%+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+*=   ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%.***=&@@@@@%%*=$;;;;$$>#.%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+**>> ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@&**===>%@@@@@--=#;;;;;;;;;$$$*%@@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@&**===>%@@@@@--=#;;;;;;;;;$$$*%@@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@+..=*=##$$+@@@@+**=$;;;;;;;;;;;;;$.@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@+.==*=>$$;.@@@@@&**=$;;;;;;;;;;;;;;;**+@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@.=**#>;;;;%@@@@@-**#;;;;;;;;;;;;;;;;;;#+@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@.**==>;;;;#@@@@@%*==$;;;;;;;;;;;;;;;;;;;=@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@.**==>;;;;#@@@@@%*==$;;;;;;;;;;;;;;;;;;;=@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@%%*==>>;;;;;.@@@@@&*==$;;;;;;;;;;;;;;;;;;;;.@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@+--*=>$$;;;;;%@@@@@-=>>;;;;;;;;;;;;;;;;;;;;;;%%@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@&==*#$;;;;;==@@@@@%*=$$;;;;;;;;;;;;;;;;;;;;;;##+@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@-**=>;;;;;;&&@@@@@+%%%%&>;;;;$%%%%%%%%%%%%-;;;;&@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@-**=>;;;;;;&&@@@@@+%%%%&>;;;;$%%%%%%%%%%%%-;;;;&@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@%***=$;;;;;;++@@@@@@@@@@@+#;;;-@@@@@@@@@@@@@&>;;=@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@&===>;;;;;;=@@@@@++++@@@@@.==;%@@@@@+++@@@@@%*>>;+@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@+**==$;;;;;;&@@@@@&&=%@@@@@.**=@@@@@%==*+@@@@%*##;.@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@+=*##$;;;;;$+@@@@+===+@@@@+=**.@@@@@&==&@@@@@&=##;=@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@+=*##$;;;;;$+@@@@+===+@@@@+=**.@@@@@&==&@@@@@&=##;=@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@%=*>>;;;;;;-@@@@@&==.@@@@@%***%@@@@@-**%@@@@+**>>;$+@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@%==>>;;;;;;&@@@@@.**%@@@@@.*--@@@@@%=--@@@@@%==$$;;+@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@%*=$$;;;;;>+@@@@+***+@@@@+**&&@@@@@&=&&@@@@@.*#;;;;%@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@&*=$$;;;;;.@@@@@&*..@@@@@&*=++@@@@+*=%%@@@++*=>;;;;%@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@&*=$$;;;;;.@@@@@&*..@@@@@&*=++@@@@+*=%%@@@++*=>;;;;%@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@%*=$$;;;;;%@@@@@-*%%@@@@@.*-@@@@@@%=.@@@@@%%*=$;;;;%@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@%==$$;;;$$+@@@@%**++@@@++=*%@@@@@@&=%@@@@@--=#;;;;;%@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@%*=$$;;;..@@@@@&*&@@@@@&&=*+@@@@++=#+@@@@+==*>;;;;$+@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@+*=$$;;;++@@@++-*%@@@@+--*.@@@@@&&*.@@@@@&**=$;;;;$+@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@+*=$$;;;++@@@++-*%@@@@+--*.@@@@@&&*.@@@@@&**=$;;;;$+@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@+**$$;;#@@@@@%%=-@@@@@%===%@@@@@..=%@@@@@.==#;;;;;-@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@&=>>;;&@@@@@&&=&@@@@@&**-+@@@@+==*+@@@@%=**>;;;;;&@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@%*##;$%@@@@+***+@@@@+-**&@@@@@+%%+@@@@@&*==$;;;;$+@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@.==$*@@@@@%**.@@@@@%=**%@@@@@@@@@@@@@+-=##;;;;;-@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@.==$*@@@@@%**.@@@@@%=**%@@@@@@@@@@@@@+-=##;;;;;-@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@%==$$#==..****#=...**--+@@@@+%%%%%%%%-*=>>;;;;;%@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@+--=;;>>#####>;$#####..@@@@@&-*****====#$$;;;--@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@%%=$;$$$$$$$$;$$$$$$%%@@@@@-===######>$;;;;;++@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@&#;;;;;;;;;;;;;;;#@@@@@%%**>>;;$;;;;;;;;;&@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@&#;;;;;;;;;;;;;;;#@@@@@%%**>>;;$;;;;;;;;;&@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@.$;;;;;;;;;;;;;;.@@@@@&&==$$;;;;;;;;;;;.@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@+.$$;;;;;;;;;;;;%@@@@@--*#;;;;;;;;;;;;.@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@+..;;;;;;;;;;;=@@@@@%===>;;;;;;;;;;..@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@&$;;;;;;;;;&@@@@@.**=$;;;;;;;;>%@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@&$;;;;;;;;;&@@@@@.**=$;;;;;;;;>%@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+-;;;;;;;;+@@@@+*==#;;;;;;$$&+@@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%.>;;;=@@@@@%=**>;;;$*&++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*;;&@@@@@.*..&&%%+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+**## ",
+"-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=>>@@@@@+**%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&=*## ",
+"-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=>>@@@@@+**%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&=*## ",
+" &&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&=&&@@@@@&=-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%**=## ",
+"   -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-*&&%%+%%.*.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%.****#>> ",
+"    =*********************************>>=***=#$$;$**************************************=>   ",
+"    >=================================$#=====>;;;>=====================================#>    ",
+"    >=================================$#=====>;;;>=====================================#>    ",
+"      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;$>>>>>$;;;$>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>      "};
diff --git a/pixmaps/l-irix.xpm b/pixmaps/l-irix.xpm
new file mode 100644 (file)
index 0000000..e5d9559
--- /dev/null
@@ -0,0 +1,165 @@
+/* XPM */
+static char * image_name[] = {
+"108 108 54 1",
+"      c None",
+".     c #909090",
+"+     c #606060",
+"@     c #585C58",
+"#     c #000000",
+"$     c #808080",
+"%     c #808480",
+"&     c #707070",
+"*     c #707470",
+"=     c #383C38",
+"-     c #181C18",
+";     c #404040",
+">     c #686868",
+",     c #E0E0E0",
+"'     c #E8E8E8",
+")     c #989898",
+"!     c #303030",
+"~     c #383838",
+"{     c #282828",
+"]     c #202020",
+"^     c #888888",
+"/     c #D8D8D8",
+"(     c #B8B8B8",
+"_     c #A0A0A0",
+":     c #787C78",
+"<     c #181818",
+"[     c #F8F8F8",
+"}     c #B0B0B0",
+"|     c #787878",
+"1     c #484848",
+"2     c #909490",
+"3     c #505050",
+"4     c #585858",
+"5     c #A8A8A8",
+"6     c #A0A4A0",
+"7     c #989C98",
+"8     c #888C88",
+"9     c #C8C8C8",
+"0     c #D0D0D0",
+"a     c #F0F0F0",
+"b     c #484C48",
+"c     c #A8ACA8",
+"d     c #B0B4B0",
+"e     c #080808",
+"f     c #303430",
+"g     c #101010",
+"h     c #606460",
+"i     c #404440",
+"j     c #686C68",
+"k     c #C0C0C0",
+"l     c #F8FCF8",
+"m     c #C8CCC8",
+"n     c #D0D4D0",
+"o     c #505450",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                              .+.           .+.                                             ",
+"                                              @#@           @#@                                             ",
+"                                          .@$ %$   &     $*@=-;>+@8                                         ",
+"                                          @#;$ ,,')!>   %+!#-~{]g#@                                         ",
+"                                      .@$ ^$  //(_>~:   .>;<-]]---;>+@8                                     ",
+"                                      @#;% ,'[/}|;~1$   2&3{-<<]!~!-<#@                                     ",
+"                                  .@$ .$  //(_.$&4++.    &>+44;!]]]]--;>@@^                                 ",
+"                                  @#;. ,'[/5&;14&$$^_   )^^^.)>~]g<]!;!]<#@                                 ",
+"                              .@$ .$  ,,(_^$|&||||%^6    ^^^^^^^>3;]]]]]--;>@4^                             ",
+"                              @#;. ,'[/(|~13$}678$%86    ^^^^^59 )+~]e<]!~!]<#@                             ",
+"                          2>.  |  ',9_.$&&||87)7)28^_   )^..^^.__)^|+3;{{]]!--;>@4^                         ",
+"                          ><> 0'a['0.;1;|65}2%.76}2$_    ^.5)^^|._} }^+~]-]!!~!{<#@                         ",
+"                      .@++b!|0,'/}.|&&||86cdc666662$_   )^))_.)__ c(_.$&4;~]!~]]-g;|.                       ",
+"                      @#e<];)/,'}3;{+_6}65}    56_8$_    $.))_     (_2_5^>3{{{]]--!;|5                      ",
+"                    .@fg<]~~4|^.|4+>8}cddd    dc6_8$_   )^^.)_5    }}5cc)^+1{]]~3&^  0)&.                   ",
+"                    @#g<!;~!]e<{;4%c}(         }_78$7    $..)_         }5_|4~<];$ ,'aa){>                   ",
+"                    8+=-]]{{]{{!~;4$)         }5668$)   )$$.._c         8+b!;4|_ '/0}.>;$                   ",
+"                      >!-<]]~~~!{{~b^          6}6.|)   _|^.25}         *!-g450,aa0_+{;4^                   ",
+"                      .*@;~~{{{!{!!;bh.       }__2%|)    &$$.)c         %b>^50/,k_.&+4|^                    ",
+"                        8&4{{g-!~;!{<eh        _8%|&)   ^$|&$2c         )> [[[,9%;;1&85                     ",
+"                        ^+++b~~{{{{{{]ij>>)   c_%>&|)    |>4$)c   .+>$ 9m /[0c2%|>>>^c                      ",
+"                        $4&||&1{<g{!~;{]<g>    _$b+|)   )$+;|_    @#]=_/,a[[64b1+2886                       ",
+"                         |2 &>+4b~{{{{{{{]1>&*&^+3>$_    ^|4+$++j*>&%_9,,k6_%&&&$.)6                        ",
+"                            ^4|.$4;gg<{;~~{-{~3>+4&^6    )$++4~#<!$900,, $4;+8.72.5                         ",
+"                ^+4@^        $%|&+431!{{{!{!!~;b;;4&)   .^4~~;b+|. ,,0 _^|&&|8)cc6      .@+>.               ",
+"                @##e@         .>+&$2&b{e<{!;;~!~!~;h^   )>~#g{&(,,a'/5&~3|86)86         +#g->               ",
+"              ^@=]--;>8        %).$&>+4b;{{{{{~~~~;~>^..h=;b&2},,,958^|&|%2}66       |$&@3&.                ",
+"              @#];~!!]>           %b+%%.+;<e-!~~;;{{~@+h~#b_0[[[,/^;44%c_26(d       %4=]+)m0,,0             ",
+"              +g<]]!!!1>>>8        |)_$+&+4;~{{]{~!~~~3>>^59,[0c_8%$||8_65c       7>j+&) 990}^              ",
+"              >-<g-!{~!]]]>           $;>28$3{<e<~!;{{;> ''a[a}+3b$_7222c         &]1> '',05+->             ",
+"              2|4;!-]]]~!!;>>|.        *%^||&+3;!{{{{{&}/a,kc28%$$$8)c6c      7&$$$$_ /a0_^|&>)             ",
+"               9 &1<<e]~!~!]!~|         )&&48(2&;ge#<{)[[[k%+1&65}8|)         |!=3)m0'aa2;~~$(              ",
+"                5_^|3{]]]]!!!!b>>$       ^))$&||&+1{{{+65c)%%^8.27_)      6$|:&>^  ,0 _^$&|^_c              ",
+"               _}090.3{#<]{~~!]]~;>         *!487(|3!<!b4+|%c06$%85       $;=~& 9'aa(|b{42}0kc              ",
+"              5)}( 9})|4;]{]]!!!!~3>.       &!4%%%$||||$%82__68|^_5     )&>+|_ /,,(_$&|$2}ck(5}             ",
+"               __(}(9,9_>{<#]{~~~{{]&       &{4|&4|7(09}(k}}2|||86      *{3: 'aa,9${b+_/9(}}66d             ",
+"               __(565cc()|4~~]]{]~!!1>|^$:>@1!b||$$|7}}72%$|||+4|.$&|$^8$$  'a/}.$|&$))565}(56              ",
+"              5)}(5_8$_999_|~<<e{{~;!];41=]#-~3+^6$+|22.>b1~4>4b4|b{!b34 0,aaac4b;&6d )|%25(c6}             ",
+"               _5}c68$2(90(.$+b!{]]{{!~;;3;~~{~~4^^.)c6c)%&3b1~{1+3;+|^ (',9c_$|||2d  ^+^_c((_c             ",
+"               _5((52|8_9,0((k^b!#<]{~~~13+&3{]g~+)       )>1g<g{b4|^5/'aa9.+{4%_}    $b$c}(}_              ",
+"              5_}(5}2%._9a,,09c)&4~{{]]{~13+31~{b|)        .h1;~4|8}90,,9_^$$%)c}     ^3$5}k5_5             ",
+"               _5}(678279llla0/0(5>!<g<{{;;13+4b>$6         )++&$70l[[,/$~3+_/009     ^+$5ck}_c             ",
+"               _5}c62^2_9lll9.%$)c_$+~~]{]!~~1>))_        )&j&8ck9,l/}_%$$867)886     ^3|5ck5_c             ",
+"              5_}}(_2$260lll61;{|k9/5$;<g<-!{!$/0k        &{b>(a[lll}>3;%90/73b;$     $1*5ck}_}             ",
+"               _5}c6)875}(_$>3|7},k}65^&b!]<<<&000_*j>>*$)3<{1_a'/(7%|%26(7%+;;;3+.   $b|_ck}_c             ",
+"               _5}(c_)6}2|~#!>}lllk$6009^b!ee#+90,^!]<-]3&=#g].a/}|!+%},/}&{{{!;{#h   $3|5}(})              ",
+"              5_}(562882|3>|7}0a09)|$%_}).&4;{4%_c$b+|4!3&@1;~>5)2^|86_78$+31{!~!!3&**>@%}}k6_5             ",
+"               _5(5_8$$|3{2llla/($||4;+)ck(_$3b14|||50.~4>|^>bbb4|2k(984b1+%4!!!14~{!!3>% (}c_c             ",
+"               _5(}68|%7)29l,(62%%8).|)5dk}c_.8^8)88ka^{1>. _)^.8)5(0,}^&34>43b11;~]{~3>^}(}c_              ",
+"              5_}(}}%+8(/lll(|+b>$_      9}}90999(}6/[^g~*5,/009k}kk/l, )h4b4++31{{-!;+&.}}(c_c             ",
+"               _}(5}8&8}(0(}2%||%_        }c}9(k((})__4{b|_09k(k}}c}9/n  %.%&4443b;!~~4|.(}(c6}             ",
+"               _5}c}.|8666|3&82_c         (5cc(}}}6.>1;{48_k(}c}cc56d       ^344+>31~~4$.((cc6              ",
+"               55(}c7%82.8%|8)6c       *|%)(c}c(}(7||>+4+|)k(cc}}(68$|)      |..>obbb;+$)(c}c_c             ",
+"               5}5(}688^||866}d       &1;;$ 9c(}}92+|28$&48k}}}c(97$4!|         |~b444+|)((cc5              ",
+"               (55}}_82_2%_cd      )$&&&^65}(c(}}k6))56)).6(c}(c}968&;@>)        *%^>~;b^k}c}_}             ",
+"               k5_}(6^_(})5       _%3]j 0,/55cc(}(         6((c(}k}5$4;]&           >{{-|0}66c              ",
+"                _^8.%|)(}c      _|||^^ ,/,k5}c(}}(         _5}cc(96%+1~{1+>>        )&@1$}c6cd              ",
+"                .$>+>+29        |=4* aa[,(c}5}(c}(        }5c}}((9241{~~]<<-+         .>^665d               ",
+"                 ))).)5     6^^.^^6 /[/52%_}c}(((}         6(}(}(9)+1{{~!]]];+>:       ^6 c                 ",
+"                            ^@@@_n,a[a6443%}(}(}}}(        _c}(}(97|1]{{~~~]-g]~&                           ",
+"                         c_).^_ 9,09c_).^.)cc}(}(}d        5((cc((_||&3;~!!{]]!!1@>$                        ",
+"                        c.$+) /'''98>1|    _5(}c(c         _5}}}}}625 %1~{{~~;{{<g{1.,9                     ",
+"                      .h&^..). a/(_^$$    6)_}}}}(d       }5c}}}}}6c  6$j31~~;~{{]>) 9                      ",
+"                      +e;>)9)+6,6&|$)     6^_k}}}c         _c}}}6_c      |+1;;~{;1)/9_k,                    ",
+"                      @#-~+$&+&|&+%)      _$_k}}}}d        _c}}}5_c      .*1~!1+$_9,}$8(                    ",
+"                      @###]~4+;g~>)       _$)k}}c(d       }5c(}}}_}       $1~<b.9,,,5b&)}                   ",
+"                      $3;{{{{;!{!~3*7     _*_k}}c(         _c}}}6_c     .>3~+^_90, _$+^5                    ",
+"                       )|+{ee<!3{e<{&     )*. (}(5d        _c}}}6_c     >g<{^,aa,9|~4$)                     ",
+"                       )^|+;!<{{{<<]=+)   )|_k}}}c         _c(}}5_    .@3;&^9,/(_%^|.)                      ",
+"                       _).^.4<e#<!{<g#@    &_((}(c(       }5c}}}}6}   @#;| ,,a(&43%                         ",
+"                        5 .^|+b{{g<{-{3:*>&|_ (}}c         _c}}}}})|&&**2 /,9_8|$^                          ",
+"                          _^_}%3{#g{~b1;!]@%59}}}(d        _c}}}(9$={]$90,,/^;+$)                           ",
+"                           __68$4b!{{{~i11+^)k}}cc         _c(}}}}8|$^ ,0 }.^%.6                            ",
+"                            6.))224{ge{14>>|_ (}}(d       }5c}}}c5650,a' $+3%                               ",
+"                             66 )%$+b{{{!~+^_9}}(5d        _c}}}}_(0,a06.|$$                                ",
+"                                )$2($3{#eeb)5k((}c         5c((c6_9l[,_b+$)                                 ",
+"                                 .).%$41{e;^_k}(5c(        _c}((56}k}_8^))                                  ",
+"                                  _|8)28be;^_k}(}cd       }_c}}((})|>4.                                     ",
+"                                   )6c.^&3&|7(}(}c         _}}}c(}2%^.6                                     ",
+"                                      6^.68$2(}}cc(       c_5}(}c()%6                                       ",
+"                                       _)^$>2k}(ccd        )5(}(c(c6                                        ",
+"                                        _|+48k((c5        5)6kccd                                           ",
+"                                         ).^5   }}         6 ( d                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            ",
+"                                                                                                            "};
diff --git a/pixmaps/l-lin.xpm b/pixmaps/l-lin.xpm
new file mode 100644 (file)
index 0000000..b0e7b00
--- /dev/null
@@ -0,0 +1,332 @@
+/* XPM */
+static char * image_name [] = {
+/* width height num_colors chars_per_pixel */
+"    64    75      250            2",
+/* colors */
+"bZ c #000000",
+"b3 c #f8f8f8",
+".. c #a87010",
+".# c #f0c814",
+".a c #a88004",
+".b c #100404",
+".c c #503800",
+".d c #eccc38",
+".e c #101004",
+".f c #f0d014",
+".g c #684800",
+".h c #b08804",
+".i c #f0d820",
+".j c #503000",
+".k c #a87800",
+".l c #684808",
+".m c #d09010",
+".n c #503008",
+".o c #e0a410",
+".p c #805800",
+".q c #f8d830",
+".r c #f8c838",
+".s c #a08004",
+".t c #d0b404",
+".u c #f0d810",
+".v c #281804",
+".w c #d8a410",
+".x c #f0cc20",
+".y c #d8a800",
+".z c #686868",
+".A c #a87c1c",
+".B c #b88804",
+".C c #c08810",
+".D c #a08c74",
+".E c #805808",
+".F c #483000",
+".G c #e4cc20",
+".H c #a4803c",
+".I c #483008",
+".J c #604c04",
+".K c #f4d850",
+".L c #e8b010",
+".M c #606060",
+".N c #a48804",
+".O c #684000",
+".P c #606058",
+".Q c #c08010",
+".R c #201804",
+".S c #745804",
+".T c #a8a8a8",
+".U c #e0b800",
+".V c #805000",
+".W c #685030",
+".X c #f0d818",
+".Y c #a8a8a0",
+".Z c #805008",
+".0 c #201004",
+".1 c #a0a0a0",
+".2 c #f4d448",
+".3 c #403004",
+".4 c #583800",
+".5 c #604000",
+".6 c #785000",
+".7 c #585858",
+".8 c #f0d838",
+".9 c #707070",
+"#. c #a07000",
+"## c #e0b808",
+"#a c #b0aca4",
+"#b c #b87800",
+"#c c #885800",
+"#d c #e8c808",
+"#e c #b48410",
+"#f c #503c2c",
+"#g c #f8b808",
+"#h c #e0c808",
+"#i c #986000",
+"#j c #888888",
+"#k c #784804",
+"#l c #484848",
+"#m c #a07008",
+"#n c #887870",
+"#o c #f8cc14",
+"#p c #181404",
+"#q c #c0881c",
+"#r c #e8a810",
+"#s c #e8cc14",
+"#t c #986800",
+"#u c #503808",
+"#v c #909090",
+"#w c #606068",
+"#x c #704800",
+"#y c #b0b0b0",
+"#z c #f4d028",
+"#A c #906804",
+"#B c #f0b008",
+"#C c #707078",
+"#D c #583808",
+"#E c #404040",
+"#F c #604008",
+"#G c #704808",
+"#H c #906000",
+"#I c #704004",
+"#J c #e8b808",
+"#K c #240004",
+"#L c #c08000",
+"#M c #c08008",
+"#N c #886000",
+"#O c #e0b008",
+"#P c #986808",
+"#Q c #886008",
+"#R c #383838",
+"#S c #e8a800",
+"#T c #e8a808",
+"#U c #505050",
+"#V c #785008",
+"#W c #f8d820",
+"#X c #583004",
+"#Y c #989898",
+"#Z c #303030",
+"#0 c #808080",
+"#1 c #a8a8b0",
+"#2 c #a06800",
+"#3 c #585864",
+"#4 c #d8b404",
+"#5 c #c88800",
+"#6 c #684008",
+"#7 c #e0a000",
+"#8 c #c88c10",
+"#9 c #d09810",
+"a. c #382420",
+"a# c #282828",
+"aa c #603804",
+"ab c #888890",
+"ac c #484840",
+"ad c #906008",
+"ae c #885808",
+"af c #483804",
+"ag c #a87000",
+"ah c #b88000",
+"ai c #c89000",
+"aj c #181818",
+"ak c #f8d814",
+"al c #c08800",
+"am c #e0d08c",
+"an c #e8e8e8",
+"ao c #a06808",
+"ap c #d09000",
+"aq c #d8d8d8",
+"ar c #a87008",
+"as c #d08808",
+"at c #f0c808",
+"au c #a06008",
+"av c #c09004",
+"aw c #a86804",
+"ax c #f0d008",
+"ay c #705004",
+"az c #d89810",
+"aA c #806404",
+"aB c #787878",
+"aC c #b08004",
+"aD c #c89008",
+"aE c #e0e0d8",
+"aF c #e0e0e0",
+"aG c #f0d808",
+"aH c #101010",
+"aI c #d89010",
+"aJ c #402800",
+"aK c #402808",
+"aL c #a0a0ac",
+"aM c #8c6030",
+"aN c #d09800",
+"aO c #b88008",
+"aP c #e4bc10",
+"aQ c #986008",
+"aR c #404038",
+"aS c #d09808",
+"aT c #d89800",
+"aU c #080800",
+"aV c #905804",
+"aW c #202020",
+"aX c #d89008",
+"aY c #b07800",
+"aZ c #080004",
+"a0 c #b07004",
+"a1 c #c08808",
+"a2 c #d0d0d0",
+"a3 c #685004",
+"a4 c #f0f0e8",
+"a5 c #f0e8ec",
+"a6 c #b07808",
+"a7 c #f8d83c",
+"a8 c #080808",
+"a9 c #c4a474",
+"b. c #d8a000",
+"b# c #403824",
+"ba c #482804",
+"bb c #e0a800",
+"bc c #382804",
+"bd c #d8a008",
+"be c #382004",
+"bf c #c0c0c0",
+"bg c #f8cc08",
+"bh c #d09008",
+"bi c #242418",
+"bj c #886804",
+"bk c #e8b000",
+"bl c #e8d008",
+"bm c #bc8c3c",
+"bn c #c88808",
+"bo c #e0a008",
+"bp c #e8e8f0",
+"bq c #a87808",
+"br c #e8b008",
+"bs c #c88008",
+"bt c #e0a808",
+"bu c #201c10",
+"bv c #d89808",
+"bw c #e0c004",
+"bx c #80809c",
+"by c #f0b010",
+"bz c #a07804",
+"bA c #f0e8d8",
+"bB c #2c2404",
+"bC c #885004",
+"bD c #f8d808",
+"bE c #b49804",
+"bF c #484850",
+"bG c #b8b8b8",
+"bH c #f0b808",
+"bI c #d8d8e8",
+"bJ c #f0c008",
+"bK c #f8b008",
+"bL c #d8a808",
+"bM c #282840",
+"bN c #544404",
+"bO c #b87808",
+"bP c #c4b4a4",
+"bQ c #d0a404",
+"bR c #e8c008",
+"bS c #c8c8c8",
+"bT c #d8ac34",
+"bU c #947404",
+"bV c #f8a808",
+"bW c #f0b810",
+"bX c #f8b810",
+"bY c #c0c0e0",
+"b0 c #f8c008",
+"b1 c #f0f0f0",
+"b2 c #0000f8",
+/* pixels */
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZaHbMaWbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZbZaj.M#w#Za8bZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZbZbZaj.9.9#Ea#bZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZbZbZaW#l#ZajaHbZbZ.bb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZbZbZaHaHbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZbZbZbZbZbZbZbZbZbZa8bZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZaHa8aWaWbZbZbZbZa8bZbZbZbZ.9bZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZaH#v#0aHajbZbZa8bZab#v.1.TbZ.zbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZa8aLbS#y#0ajbZbZbZ#j.TbGbSaq.1bZaHbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZ.zbfb3b3b3bZbZbZbZaqb3b3b3b3bG#jbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZ#YaHa8a#b3.9bZaHbZa4b3bZ#Ya8b3b3bZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZa2bZbZ#jb3.9aW.7bZb3bZbZbZ#Eb3b3bZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbSajbZ#Yan.7.bbZa8bSbZbZbZbZbfb3bZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZb3bZbZbyb0#J#4.ubL#pbZbZbZb3b3bZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZb3bZa6bWb0.##haP.G#oaD.Wb3b3bZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZ.bbn#rb0.xblak.d.d.d#h#haxbL#pbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbc.AbobHbWbJat#h.d.d.G.G#h#h.G#obZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZa6bnbobJbJ.f.f.G.d.G#h#h#hbEaS.LbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZayaDbtb0b0bg.Gam#h#h.G.saS#7bdbTbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZ.p.ab0.#.8.d#h.G.h#xaSbtbt.Q.0bZbZ#0#wbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbibSad.cbzbU.I.4albvbvbv#8a9#1bfbZbZbZ#0#0bZaZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbGbGaQ..bdazbvbv.Q.Q.1bSbfa2bfbSbZbZ#0#0bZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbfbfaLad#QaQaQaQa6bGbSbfb3b3b3a2bZbZbZbZbZbZbZaHb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZb1a2bfbGaLaLbSbGbfbYa2b1b3b3b3b3.7bZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2ajaHbZaLb3b3bGbGbGbGbGbSbSaFb3b3b3b3b3b3b3bZbZbZbZbZbZbZaHb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZa8bZb3b3b3b3bGbGbSbfa2b3b3b3b3b3b3b3b3b3#jbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZb3b3b3b3b3b3aqaqb1b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbfb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3aWbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZb1b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3#0bZbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZ#Cb1b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b1b3b1bZbZbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZ.1bfb1b3b3b3b3ananaFb1b3b3b3b3b1b1anaFaqa2aqb3bZbZbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZbZ.1.Ya2aFb3b3b3b3aFb3b3b3b3b3b3b1aqbSbfbfbfbfa2b3bZbZaHbZbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZaB#yanb3b3b3b3b3b3b1b3b3b3b3b3b3b3b3b3b3aFa2bSbSb3bZbZbZ#ZaHbZbZbZbZbZbZb2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbMbZ#yb1b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b1a2bfb3bZbZbZ#la8bZbZbZbZbZb2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZ#lbZbZb1b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3a2aqbZbZbZbZ#RbZbZbZbZbZbZb2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bSb3bZaH#RaHa#bZbZbZbZbZb2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZ#UbZbZb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3aHaW#Ua#bMbZbZbZbZbZb2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2bZbZbZbZb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3#Eajaja8bZ#lbZbZbZbZbZb2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2bZbZ#RbZbZb3b3b3b3b3b3b3b3b3b3b1b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZ#UbZbZbZbZbZb2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2bZaZbZbZb1b3b3b3b3b3b3b3b3b3b1b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZbZbZbZbZbZbZb2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2bZa8bZbZb3b3b3b3b3b3b3b3b3b3anb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZbZbZbZbZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2bZbZ#RbZbZb3b3b3b3b3b3b3b3b3b3aFb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZaWbZbZbZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2bZbZ#UbZ#Eb3b3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZ#lbZbZbZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2bZbZbZ#0bZbfb3b3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZ#3bZbZbZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2bZbZbZbZ.PbZbfb3b3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZaWbZbZbZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2bZbZbZa##UbZbfb3b3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZaHbZbZbZbZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2bZbZbZbZaHbZbSb3b3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZ#RbZbZbZbZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2bZbZbXbZbZ.zbSb3b3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZa#bZbZbZa8#Z#ZbZbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2bXb0bXb0bZ.Tb3b3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3aWbZbZbZbZbZbZbZ.MbZbZb2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2azb0.#b0.#bJbZ#lb3b3b3b3b3b3b3b3b3aqb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3#h.G#o.JbZbZbZbZbZbZbZa#bZb2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2.maz.x#o.#b0.x.LbZa#b3b3b3b3b3b3b3b3aFb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3azb0#h#h.HbZbZbZbZbZbZajaH.G#h#ob2b2b2b2b2",
+"b2b2b2b2b2b2b2b2asbobybXb0bXbXb0btbZaHbfb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bm.#bXat.JbZbZbZbZbZbZbZ.B#h#h.Gb2b2b2b2b2",
+"b2b2b2b2b2b2a6bnaz.L.#.#bobXb0b0b0bZbZbZa2b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3aFbmbobJazarbZbZbZbZbZbZbU.LbJb0bVb2b2b2b2b2",
+"b2b2b2b2.Aa6#8bd#rbWbX#o.#.#.#bob0aPbZbZbZaFb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3aqbSbmbobHbvaOarbebZbZbBaraibrbHb0bXb2b2b2b2b2",
+"b2au#rby#r.L.L.LbWb0bob0.#bX.xb0b0bRa8bZbZbZ#Rb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3a2bfa9bo#Jbobh#MbOa6a6aCaD#ObWbXbX.#b2b2b2b2b2",
+"b2azaPbybWbWbXbXbWb0b0bX#z.x.#bX.xbJbtbZbZbZbZbZb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3a2bSbmbdbrbtb.aSbhaDaDaSbtb0bobob0.#.xb2b2b2b2",
+"b2btb0b0b0bo.x.##z#z.#.#.#.#.xb0.xbWax.wbZbZbZbZ#Eb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3anbS.Ha1#Tbb#SbtbdbdbobtbH.xbX.x.#bobX.xb2b2b2",
+"b2bTbWbob0.#bo.#b0#zbXbo#zbobobo.xbXb0#JbZbZbZbZbZb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bSaM.Bbd#T#Jbr.LbrbrbWbHb0b0b0b0bXb0b0b0b2b2",
+"b2#9.Lb0bo.#bobobo.#bobo.#.xbobob0b0b0.##rbZbZbZ.Mb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bSada1b.bHbHbXbHbHb0bJb0b0.#bob0b0bX.#b0#ob2",
+"b2.m#rb0b0bobX.x#z.#.x.#.xbo.xbo.#bXb0bJ.uaza#anb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3a8bZ#QaibobHb0b0.#bo.x.xb0.xb0b0bo.x.x.#.xbobX",
+"b2#8.obX.#bXbo.#bX#o.#.x.xb0b0.#.#bobobWbR#Oaub3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZaeaibtbWb0.#b0.#b0b0.##obXbXbXbX#zbob0#o.x",
+"b2aIbobXbob0b0.xb0#obo.xbo.xbob0b0bXb0bW#J#daDb3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZadaSbtbWb0.x#z.xbX#z.#.x#z.x.#.xbX#o.xbXaI",
+"b2aIbtb0bobo.x.r.#b0b0.#.#.#bob0.#b0.#b0#JaPaS#Gb3b3b3b3b3b3b3b3b3b3b3b3b3bZbZbZbZbZ#p#tbhbtbH.#.#b0bXbXbob0b0bXb0bX#zbXbXbXazb2",
+"b2azbtbWbX.#bXb0#o.xb0b0bo.#bXbXb0.xb0bJbH#O#9#m.3b1b3b3b3b3b3b3b3b3#jbZbZbZbZbZbZbZ.v#maSbtbW.#b0b0bXb0bo.x.xbX.#b0bX.#boazb2b2",
+"azbvazbtbrbr.LbWbXbXb0b0b0.#.#.xbXbobobXb0.L#9aOaJbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZ.FagaSbtb0.#bX.#bX.#.#bobob0bX.razazb2b2b2b2",
+"b2bh.mbhaz#9bdbtbt#Tbr#JbXb0bXbo.##z.#bXbXbtaDar#6bZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZ.cawaDb.#JbXb0.xb0bXbXbWby#raI.Ab2b2b2b2b2b2",
+"b2adaQ.AbOa1bnaDbhbhaSbdbobtbW.#.##zbXby#TaSbOao#GbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZ.F#H#MaNbtbrbWbWbr#Tbtbd.m.Qb2b2b2b2b2b2b2b2",
+"b2b2b2b2b2#Qaoa6a6a6bOaOa1bnaSbtbt#ObtbdaDaOao.V.nbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbZbebCa6#MaDbvbdbdbdaSala6#Qb2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2#Gad#Paoaoa6aOa1aDa1aOa6ao.p.ObBbZb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2.3#xaoa0aOa1aD#5ala6#maKb2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2#uaV#Paoar#maoad.Z.OaKb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2.n.V#2ara6aYa6aoae#fb2b2b2b2b2b2b2b2b2b2b2",
+"b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2.3#u#G#V.6#x#F.3b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2.3.F.O.Zadae.V#FaKb2b2b2b2b2b2b2b2b2b2b2b2"
+};
diff --git a/pixmaps/l-linux.xpm b/pixmaps/l-linux.xpm
new file mode 100644 (file)
index 0000000..4822c23
--- /dev/null
@@ -0,0 +1,3266 @@
+/* XPM */
+static char * image_name[] = {
+"128 151 3112 2",
+"      c None",
+".     c #010101",
+"+     c #020202",
+"@     c #030303",
+"#     c #070102",
+"$     c #050102",
+"%     c #090906",
+"&     c #191917",
+"*     c #151411",
+"=     c #0B0A08",
+"-     c #030302",
+";     c #080807",
+">     c #1B1B1B",
+",     c #2F2F38",
+"'     c #3C3C3F",
+")     c #343437",
+"!     c #242426",
+"~     c #0F0E0A",
+"{     c #10100F",
+"]     c #242424",
+"^     c #464647",
+"/     c #5C5C5D",
+"(     c #5F5E60",
+"_     c #4A4A4A",
+":     c #2F2E2C",
+"<     c #161613",
+"[     c #060606",
+"}     c #050505",
+"|     c #100F0C",
+"1     c #292827",
+"2     c #4C4C4D",
+"3     c #727273",
+"4     c #837B6C",
+"5     c #656567",
+"6     c #434347",
+"7     c #2A2A2C",
+"8     c #14130F",
+"9     c #040404",
+"0     c #090909",
+"a     c #272729",
+"b     c #555559",
+"c     c #7C7C7D",
+"d     c #858586",
+"e     c #737375",
+"f     c #515151",
+"g     c #363636",
+"h     c #222222",
+"i     c #11100B",
+"j     c #0F0F0E",
+"k     c #303030",
+"l     c #5B5B5D",
+"m     c #7D7D7E",
+"n     c #767677",
+"o     c #606061",
+"p     c #464646",
+"q     c #373736",
+"r     c #2C2C2C",
+"s     c #181818",
+"t     c #070706",
+"u     c #040403",
+"v     c #121211",
+"w     c #555556",
+"x     c #5F5F60",
+"y     c #525253",
+"z     c #3F3F3F",
+"A     c #30302F",
+"B     c #262626",
+"C     c #202020",
+"D     c #151514",
+"E     c #090908",
+"F     c #13120D",
+"G     c #2A2A29",
+"H     c #3D3D3D",
+"I     c #39393C",
+"J     c #2B2B2D",
+"K     c #1F1F1E",
+"L     c #131312",
+"M     c #0D0D0C",
+"N     c #0C0C0B",
+"O     c #060605",
+"P     c #191919",
+"Q     c #1E1E1B",
+"R     c #191916",
+"S     c #080808",
+"T     c #040303",
+"U     c #0A0908",
+"V     c #11110E",
+"W     c #0D0C0A",
+"X     c #0D0C08",
+"Y     c #0B0B0A",
+"Z     c #11100C",
+"`     c #181713",
+" .    c #22211D",
+"..    c #151410",
+"+.    c #121215",
+"@.    c #2D2D32",
+"#.    c #4D4D4E",
+"$.    c #242423",
+"%.    c #050504",
+"&.    c #0E0E0D",
+"*.    c #262628",
+"=.    c #323239",
+"-.    c #1D1D1D",
+";.    c #1E1E1E",
+">.    c #1A1A1A",
+",.    c #353532",
+"'.    c #070707",
+").    c #161616",
+"!.    c #1A1917",
+"~.    c #0A0907",
+"{.    c #171717",
+"].    c #414142",
+"^.    c #1C1C1C",
+"/.    c #292929",
+"(.    c #676768",
+"_.    c #818182",
+":.    c #838385",
+"<.    c #858585",
+"[.    c #717070",
+"}.    c #141414",
+"|.    c #111111",
+"1.    c #484849",
+"2.    c #171612",
+"3.    c #565657",
+"4.    c #828284",
+"5.    c #969698",
+"6.    c #383737",
+"7.    c #585754",
+"8.    c #8B8B8C",
+"9.    c #919193",
+"0.    c #9E9E9F",
+"a.    c #A2A2A5",
+"b.    c #A3A3A7",
+"c.    c #AEAEAF",
+"d.    c #B1B1B1",
+"e.    c #757576",
+"f.    c #0A0A0A",
+"g.    c #1F1F1F",
+"h.    c #0A0A09",
+"i.    c #0F0F10",
+"j.    c #6C6353",
+"k.    c #8E8E91",
+"l.    c #AFAFB0",
+"m.    c #BDBDBD",
+"n.    c #B1B1B2",
+"o.    c #8D8D8E",
+"p.    c #525151",
+"q.    c #0E0D0A",
+"r.    c #0D0D0D",
+"s.    c #0B0B0E",
+"t.    c #606063",
+"u.    c #909091",
+"v.    c #9A9A9B",
+"w.    c #A5A5A6",
+"x.    c #B4B4B4",
+"y.    c #BCBCBC",
+"z.    c #CACACA",
+"A.    c #CBCBCB",
+"B.    c #AFAFAF",
+"C.    c #0B0B0B",
+"D.    c #050402",
+"E.    c #141412",
+"F.    c #3B3B3B",
+"G.    c #848486",
+"H.    c #A8A8AB",
+"I.    c #C1C1C1",
+"J.    c #C6C6C6",
+"K.    c #BDBDBE",
+"L.    c #A9A9A9",
+"M.    c #8D8D8C",
+"N.    c #5B5B5C",
+"O.    c #070704",
+"P.    c #49494A",
+"Q.    c #BEBEBE",
+"R.    c #C2C2C3",
+"S.    c #CDCDCD",
+"T.    c #D1D1D1",
+"U.    c #D4D4D5",
+"V.    c #ACACAE",
+"W.    c #8E8E90",
+"X.    c #343435",
+"Y.    c #0C0C0C",
+"Z.    c #101010",
+"`.    c #686869",
+" +    c #A4A4A6",
+".+    c #B6B6B7",
+"++    c #D0D0D0",
+"@+    c #E1E1E1",
+"#+    c #E8E8E8",
+"$+    c #EAE9E3",
+"%+    c #DBD9D2",
+"&+    c #9C9CA0",
+"*+    c #0E0E11",
+"=+    c #B8B8B8",
+"-+    c #E3E3E3",
+";+    c #F4F4F4",
+">+    c #F7F7F7",
+",+    c #F8F8F8",
+"'+    c #F0F0F0",
+")+    c #D8D8D8",
+"!+    c #B2B2B3",
+"~+    c #646466",
+"{+    c #1E1E1D",
+"]+    c #929292",
+"^+    c #CFCFCF",
+"/+    c #EEEEEE",
+"(+    c #E7E7E7",
+"_+    c #EDEDED",
+":+    c #414141",
+"<+    c #C4C4C5",
+"[+    c #E9E9E9",
+"}+    c #DCDCDC",
+"|+    c #D2D2D2",
+"1+    c #EBEBEB",
+"2+    c #C9C9C9",
+"3+    c #979798",
+"4+    c #1C1C1D",
+"5+    c #030102",
+"6+    c #25252C",
+"7+    c #ACACAD",
+"8+    c #828282",
+"9+    c #232323",
+"0+    c #4B4A4A",
+"a+    c #DEDEDE",
+"b+    c #9F9F9F",
+"c+    c #0E0E0F",
+"d+    c #747473",
+"e+    c #F1F1F1",
+"f+    c #D9D9DA",
+"g+    c #80807F",
+"h+    c #222120",
+"i+    c #3F3F40",
+"j+    c #626261",
+"k+    c #F6F6F6",
+"l+    c #F9F9F9",
+"m+    c #D7D7D7",
+"n+    c #080102",
+"o+    c #313137",
+"p+    c #DADADA",
+"q+    c #A3A3A3",
+"r+    c #595959",
+"s+    c #525251",
+"t+    c #787879",
+"u+    c #100F0B",
+"v+    c #72716B",
+"w+    c #D2D1D1",
+"x+    c #585858",
+"y+    c #888889",
+"z+    c #69696A",
+"A+    c #353536",
+"B+    c #DDDDDD",
+"C+    c #868686",
+"D+    c #2E2D2D",
+"E+    c #D8D8D9",
+"F+    c #5D5C58",
+"G+    c #8C8C8C",
+"H+    c #B0B0B0",
+"I+    c #272727",
+"J+    c #161510",
+"K+    c #767676",
+"L+    c #E2E2E2",
+"M+    c #2E2E2E",
+"N+    c #313131",
+"O+    c #878788",
+"P+    c #B2B2B2",
+"Q+    c #D5D5D5",
+"R+    c #33322F",
+"S+    c #D9D9D9",
+"T+    c #565656",
+"U+    c #444444",
+"V+    c #383839",
+"W+    c #181817",
+"X+    c #3C3C3C",
+"Y+    c #D6D6D6",
+"Z+    c #BABABA",
+"`+    c #383837",
+" @    c #8F8F90",
+".@    c #E6E6E6",
+"+@    c #2B2B2B",
+"@@    c #636261",
+"#@    c #0A0A07",
+"$@    c #080706",
+"%@    c #656463",
+"&@    c #373737",
+"*@    c #323232",
+"=@    c #F3F3F3",
+"-@    c #D7D7D8",
+";@    c #2A2A2B",
+">@    c #39393A",
+",@    c #C0C0C1",
+"'@    c #ECECEC",
+")@    c #B7B7B7",
+"!@    c #383838",
+"~@    c #C2C2C2",
+"{@    c #6D6D6D",
+"]@    c #ECECE8",
+"^@    c #9A9487",
+"/@    c #37290F",
+"(@    c #3F2F05",
+"_@    c #413006",
+":@    c #352704",
+"<@    c #2E2106",
+"[@    c #2C2307",
+"}@    c #29241A",
+"|@    c #ABAAA8",
+"1@    c #E5E4E2",
+"2@    c #848484",
+"3@    c #393117",
+"4@    c #EAC751",
+"5@    c #CD9F09",
+"6@    c #D4AA0B",
+"7@    c #D8AC0A",
+"8@    c #C79E07",
+"9@    c #C79D06",
+"0@    c #D9AA0B",
+"a@    c #D1A80A",
+"b@    c #B18909",
+"c@    c #917727",
+"d@    c #A79D83",
+"e@    c #A5A49F",
+"f@    c #4B4B4B",
+"g@    c #EFEFEF",
+"h@    c #494949",
+"i@    c #E0E0E1",
+"j@    c #ADADAD",
+"k@    c #070503",
+"l@    c #2C1E05",
+"m@    c #AB7D0A",
+"n@    c #D89E0D",
+"o@    c #DEA90C",
+"p@    c #F5C00B",
+"q@    c #EBBF0C",
+"r@    c #E3BC0D",
+"s@    c #E1BE0F",
+"t@    c #CEA910",
+"u@    c #BA960E",
+"v@    c #BE960D",
+"w@    c #DEB70E",
+"x@    c #CFAE0A",
+"y@    c #9E7E08",
+"z@    c #4F3D05",
+"A@    c #120E03",
+"B@    c #DFDFDF",
+"C@    c #484848",
+"D@    c #0D0A02",
+"E@    c #6B4907",
+"F@    c #B4800A",
+"G@    c #CA930C",
+"H@    c #D29E0D",
+"I@    c #EBB30B",
+"J@    c #F4BF0C",
+"K@    c #F2C411",
+"L@    c #E9C512",
+"M@    c #E5C70F",
+"N@    c #DDBB0A",
+"O@    c #C99D09",
+"P@    c #AB840F",
+"Q@    c #CBA413",
+"R@    c #EBCB10",
+"S@    c #F1CA0F",
+"T@    c #EBBF0A",
+"U@    c #A17E0A",
+"V@    c #151002",
+"W@    c #0F0C03",
+"X@    c #5D5D5D",
+"Y@    c #969696",
+"Z@    c #DCD1B9",
+"`@    c #8E6307",
+" #    c #BC8409",
+".#    c #D99E0B",
+"+#    c #F3BA0C",
+"@#    c #F3BE0C",
+"##    c #F7C10D",
+"$#    c #F4BE0E",
+"%#    c #EEC510",
+"&#    c #EDCB0F",
+"*#    c #E7CD11",
+"=#    c #ECD214",
+"-#    c #E9CE1B",
+";#    c #E7CA20",
+">#    c #EACF2A",
+",#    c #E5CC1B",
+"'#    c #E5CB17",
+")#    c #EECD10",
+"!#    c #E8C70F",
+"~#    c #CFAC0A",
+"{#    c #AF8A0D",
+"]#    c #9E802D",
+"^#    c #D0BD90",
+"/#    c #EEE9DB",
+"(#    c #F4F3F0",
+"_#    c #A0A0A0",
+":#    c #2A2A2A",
+"<#    c #DED5C2",
+"[#    c #BD8B24",
+"}#    c #C88C0A",
+"|#    c #DDA50A",
+"1#    c #E9B50D",
+"2#    c #F5BE0B",
+"3#    c #F6BE0D",
+"4#    c #F5BF0C",
+"5#    c #F0C20D",
+"6#    c #F0C613",
+"7#    c #EBCC10",
+"8#    c #EDD010",
+"9#    c #EFD313",
+"0#    c #EBD01A",
+"a#    c #EBD028",
+"b#    c #EBCE2B",
+"c#    c #EBCE39",
+"d#    c #EDCD2C",
+"e#    c #E9CD2B",
+"f#    c #E4CB17",
+"g#    c #E2C80A",
+"h#    c #E2C90E",
+"i#    c #DCBD0A",
+"j#    c #C7980A",
+"k#    c #C69509",
+"l#    c #C9AB51",
+"m#    c #A19261",
+"n#    c #28251A",
+"o#    c #1E1603",
+"p#    c #8D6207",
+"q#    c #BC8509",
+"r#    c #D8970D",
+"s#    c #E2AA0C",
+"t#    c #EFB80D",
+"u#    c #F2BC0A",
+"v#    c #F3BE0E",
+"w#    c #F5BD0C",
+"x#    c #EEC80F",
+"y#    c #EBCD11",
+"z#    c #EED212",
+"A#    c #E6CD17",
+"B#    c #E8CD27",
+"C#    c #EACD2E",
+"D#    c #E9CC2D",
+"E#    c #E7CE4D",
+"F#    c #ECCE42",
+"G#    c #E6CC1E",
+"H#    c #E2C70C",
+"I#    c #E2C90F",
+"J#    c #E2C909",
+"K#    c #E2C809",
+"L#    c #E3CA0B",
+"M#    c #E9C70B",
+"N#    c #E9BA0E",
+"O#    c #DEAB11",
+"P#    c #926E08",
+"Q#    c #201905",
+"R#    c #0A0102",
+"S#    c #030202",
+"T#    c #312207",
+"U#    c #966708",
+"V#    c #B57C0B",
+"W#    c #CE920C",
+"X#    c #DFA40C",
+"Y#    c #E9AF0F",
+"Z#    c #F1B60D",
+"`#    c #F5C00C",
+" $    c #F5BD0A",
+".$    c #F1BF0C",
+"+$    c #F0C40E",
+"@$    c #F0CC0E",
+"#$    c #EFCF0F",
+"$$    c #EED210",
+"%$    c #E4CC18",
+"&$    c #E6CC1C",
+"*$    c #E8CE46",
+"=$    c #E7CD58",
+"-$    c #EACC3D",
+";$    c #E8CC23",
+">$    c #E3CB12",
+",$    c #E2C80D",
+"'$    c #E2CA0C",
+")$    c #E2C80E",
+"!$    c #E6C91B",
+"~$    c #F2CA2A",
+"{$    c #EABA1E",
+"]$    c #896808",
+"^$    c #0D0B03",
+"/$    c #160F03",
+"($    c #976B09",
+"_$    c #B57D0A",
+":$    c #C3850D",
+"<$    c #D99A08",
+"[$    c #E2A80C",
+"}$    c #EBB30D",
+"|$    c #F2BC0D",
+"1$    c #F1BC0C",
+"2$    c #F0BB0C",
+"3$    c #EFC011",
+"4$    c #F0C812",
+"5$    c #F0CD10",
+"6$    c #EFCF11",
+"7$    c #E8CE18",
+"8$    c #E3CB13",
+"9$    c #E7CC42",
+"0$    c #E6CB4D",
+"a$    c #ECCD3D",
+"b$    c #EACC29",
+"c$    c #E3C910",
+"d$    c #E2CA0A",
+"e$    c #E1C809",
+"f$    c #DFC609",
+"g$    c #D8BF0C",
+"h$    c #E4C724",
+"i$    c #F1CC29",
+"j$    c #BB8C09",
+"k$    c #1D1705",
+"l$    c #4D3506",
+"m$    c #AF7C0A",
+"n$    c #B67B0D",
+"o$    c #CF8E0B",
+"p$    c #DB9C0D",
+"q$    c #E5A90D",
+"r$    c #EEB40D",
+"s$    c #F2BC0B",
+"t$    c #F5BC0A",
+"u$    c #F1BE0A",
+"v$    c #EFC20D",
+"w$    c #EFCB10",
+"x$    c #EFCE11",
+"y$    c #F3D116",
+"z$    c #E9CD2C",
+"A$    c #E8CE57",
+"B$    c #E3CD69",
+"C$    c #E8CC26",
+"D$    c #E3CA11",
+"E$    c #DBC008",
+"F$    c #B79907",
+"G$    c #916F06",
+"H$    c #CCA110",
+"I$    c #EDBA10",
+"J$    c #9F7907",
+"K$    c #110E04",
+"L$    c #583D07",
+"M$    c #B37C0E",
+"N$    c #C0840F",
+"O$    c #D1930C",
+"P$    c #DCA00B",
+"Q$    c #E7AB0B",
+"R$    c #EFB70D",
+"S$    c #F3BD0C",
+"T$    c #F3C10A",
+"U$    c #F2BD0A",
+"V$    c #F3C60D",
+"W$    c #F1D110",
+"X$    c #EED21F",
+"Y$    c #E4C917",
+"Z$    c #EACD41",
+"`$    c #E6CD59",
+" %    c #E9CB1D",
+".%    c #E4C914",
+"+%    c #E2C80B",
+"@%    c #E2C80C",
+"#%    c #DCC20D",
+"$%    c #C7AA07",
+"%%    c #B79107",
+"&%    c #C09306",
+"*%    c #D29C08",
+"=%    c #DBA107",
+"-%    c #E6A90C",
+";%    c #8B6A08",
+">%    c #0D0A04",
+",%    c #513A05",
+"'%    c #9D6D08",
+")%    c #B87F0C",
+"!%    c #D1960A",
+"~%    c #DCA209",
+"{%    c #E7AC0A",
+"]%    c #EEB70B",
+"^%    c #F6BB0A",
+"/%    c #F4C00C",
+"(%    c #F1BE0B",
+"_%    c #F2C50C",
+":%    c #F2CE11",
+"<%    c #EFD00E",
+"[%    c #E7CD1D",
+"}%    c #EACE34",
+"|%    c #E7CC52",
+"1%    c #E4CB16",
+"2%    c #C9AF0D",
+"3%    c #A88610",
+"4%    c #BD9309",
+"5%    c #D19D08",
+"6%    c #DDA408",
+"7%    c #DEA408",
+"8%    c #DB9E0B",
+"9%    c #DCA50F",
+"0%    c #896608",
+"a%    c #0B0902",
+"b%    c #221805",
+"c%    c #503706",
+"d%    c #785207",
+"e%    c #C1890A",
+"f%    c #E5AB0D",
+"g%    c #EBB20D",
+"h%    c #F3B60E",
+"i%    c #F4BE0B",
+"j%    c #F3C00D",
+"k%    c #F4C20B",
+"l%    c #F2C810",
+"m%    c #F4D114",
+"n%    c #EACF0F",
+"o%    c #E7CB1E",
+"p%    c #E8CC2C",
+"q%    c #E5CC24",
+"r%    c #E2CA0D",
+"s%    c #E3C810",
+"t%    c #E2C90D",
+"u%    c #E1C80B",
+"v%    c #D3BA17",
+"w%    c #A6880C",
+"x%    c #9A7914",
+"y%    c #C69608",
+"z%    c #DBA40A",
+"A%    c #E0A609",
+"B%    c #DEA50A",
+"C%    c #DFA60A",
+"D%    c #D99E0E",
+"E%    c #CE9411",
+"F%    c #5D4609",
+"G%    c #121213",
+"H%    c #291D04",
+"I%    c #583905",
+"J%    c #6B4807",
+"K%    c #B7880B",
+"L%    c #E8B10C",
+"M%    c #F4BC0C",
+"N%    c #F1BA0D",
+"O%    c #F5BF0B",
+"P%    c #F1C50F",
+"Q%    c #F2CF18",
+"R%    c #F3D51C",
+"S%    c #E7CB18",
+"T%    c #E4CA17",
+"U%    c #E3C80F",
+"V%    c #DCC30B",
+"W%    c #C5AE0D",
+"X%    c #8C740A",
+"Y%    c #72591A",
+"Z%    c #956E06",
+"`%    c #D09708",
+" &    c #DDA20A",
+".&    c #DEA70B",
+"+&    c #E1A50B",
+"@&    c #D59A0B",
+"#&    c #CE8F0C",
+"$&    c #A2740C",
+"%&    c #1B1503",
+"&&    c #7A7A7B",
+"*&    c #3C3C3D",
+"=&    c #11100D",
+"-&    c #694C22",
+";&    c #754F08",
+">&    c #664606",
+",&    c #A97D07",
+"'&    c #E6AD0B",
+")&    c #F5BF0D",
+"!&    c #F5C40C",
+"~&    c #F2CA15",
+"{&    c #F5D437",
+"]&    c #F0D038",
+"^&    c #EDCD38",
+"/&    c #E7CC22",
+"(&    c #DFC412",
+"_&    c #D0B50E",
+":&    c #A78B14",
+"<&    c #745B0A",
+"[&    c #5E4611",
+"}&    c #866108",
+"|&    c #C18E08",
+"1&    c #D59D05",
+"2&    c #D9A20A",
+"3&    c #DDA60B",
+"4&    c #E1A80A",
+"5&    c #DCA10A",
+"6&    c #D1960E",
+"7&    c #B8840E",
+"8&    c #A77A1B",
+"9&    c #948566",
+"0&    c #595958",
+"a&    c #4E4E4F",
+"b&    c #7F7F7F",
+"c&    c #7E7E7F",
+"d&    c #6C6C6D",
+"e&    c #616162",
+"f&    c #A7A090",
+"g&    c #957745",
+"h&    c #835D07",
+"i&    c #896107",
+"j&    c #BF8F09",
+"k&    c #D9B20C",
+"l&    c #DDBD0B",
+"m&    c #DDBA14",
+"n&    c #D3B914",
+"o&    c #D0B619",
+"p&    c #C7B010",
+"q&    c #B09509",
+"r&    c #8B6C0D",
+"s&    c #765606",
+"t&    c #7E5B07",
+"u&    c #A57708",
+"v&    c #C38C09",
+"w&    c #D39706",
+"x&    c #D79A06",
+"y&    c #D99A04",
+"z&    c #DC9D06",
+"A&    c #D89D09",
+"B&    c #CF9609",
+"C&    c #C58C13",
+"D&    c #C6922B",
+"E&    c #C2A669",
+"F&    c #BCB6A7",
+"G&    c #BCBBBF",
+"H&    c #AAAAA9",
+"I&    c #1B1B1A",
+"J&    c #272728",
+"K&    c #727172",
+"L&    c #807F80",
+"M&    c #818081",
+"N&    c #5E5E5F",
+"O&    c #070604",
+"P&    c #8A8885",
+"Q&    c #C2BEB4",
+"R&    c #B6B4AD",
+"S&    c #997A35",
+"T&    c #926608",
+"U&    c #916407",
+"V&    c #835906",
+"W&    c #906907",
+"X&    c #AE8807",
+"Y&    c #A07A06",
+"Z&    c #8D6E09",
+"`&    c #8D6B0E",
+" *    c #8B690F",
+".*    c #9A720E",
+"+*    c #AE7E08",
+"@*    c #C98F05",
+"#*    c #D19408",
+"$*    c #D69806",
+"%*    c #D69708",
+"&*    c #D6970B",
+"**    c #D5950D",
+"=*    c #D1950B",
+"-*    c #CA9009",
+";*    c #BE840B",
+">*    c #B98D2E",
+",*    c #BFA67C",
+"'*    c #CCC7B8",
+")*    c #C3C3C3",
+"!*    c #BFBFBF",
+"~*    c #C0C0C0",
+"{*    c #434343",
+"]*    c #707070",
+"^*    c #3A3A3C",
+"/*    c #848487",
+"(*    c #BCBCC2",
+"_*    c #B1ACA5",
+":*    c #967029",
+"<*    c #9A6A08",
+"[*    c #A46C09",
+"}*    c #A97309",
+"|*    c #CC9F0A",
+"1*    c #E1B908",
+"2*    c #E1B50A",
+"3*    c #DEB00A",
+"4*    c #D49D08",
+"5*    c #D59707",
+"6*    c #D7970A",
+"7*    c #D79709",
+"8*    c #D7960D",
+"9*    c #D8960D",
+"0*    c #D5950B",
+"a*    c #D3940A",
+"b*    c #C98C0D",
+"c*    c #BB860F",
+"d*    c #AF831C",
+"e*    c #B69864",
+"f*    c #BAB6B1",
+"g*    c #C3C3C4",
+"h*    c #CCCCCD",
+"i*    c #BBBBBB",
+"j*    c #808081",
+"k*    c #08080A",
+"l*    c #ADA599",
+"m*    c #9B732E",
+"n*    c #9C6708",
+"o*    c #9B6908",
+"p*    c #B68208",
+"q*    c #CD9E09",
+"r*    c #D7A00A",
+"s*    c #D79E0B",
+"t*    c #D79909",
+"u*    c #D8960B",
+"v*    c #D7970C",
+"w*    c #D5950C",
+"x*    c #D09208",
+"y*    c #C9890A",
+"z*    c #C1810A",
+"A*    c #C1820B",
+"B*    c #BC8211",
+"C*    c #B89242",
+"D*    c #B8A886",
+"E*    c #BBB9B3",
+"F*    c #C5C5C6",
+"G*    c #C4C4C4",
+"H*    c #343434",
+"I*    c #757575",
+"J*    c #7D7D7D",
+"K*    c #7C7C7C",
+"L*    c #BBBBBC",
+"M*    c #BEBDB6",
+"N*    c #B2AC9C",
+"O*    c #A17937",
+"P*    c #8D6107",
+"Q*    c #9A6808",
+"R*    c #B1790A",
+"S*    c #C3860C",
+"T*    c #C88909",
+"U*    c #C7890A",
+"V*    c #CA8C09",
+"W*    c #C7880A",
+"X*    c #BC7E0A",
+"Y*    c #B37609",
+"Z*    c #AF7509",
+"`*    c #AF780A",
+" =    c #BD851B",
+".=    c #BE9A5A",
+"+=    c #BEB9A8",
+"@=    c #BCBCBD",
+"#=    c #F2F2F2",
+"$=    c #919191",
+"%=    c #171716",
+"&=    c #454546",
+"*=    c #353535",
+"==    c #7F7E7D",
+"-=    c #C0BFBC",
+";=    c #C3BFAE",
+">=    c #B2ADA5",
+",=    c #9C7837",
+"'=    c #8E6517",
+")=    c #916307",
+"!=    c #9B6808",
+"~=    c #A26B08",
+"{=    c #9E6A08",
+"]=    c #A06B09",
+"^=    c #A06908",
+"/=    c #996508",
+"(=    c #9A6509",
+"_=    c #A26E13",
+":=    c #B88522",
+"<=    c #BEA16E",
+"[=    c #BEBBB9",
+"}=    c #BCBCC0",
+"|=    c #BBBBC0",
+"1=    c #0C0B0A",
+"2=    c #7E7D7C",
+"3=    c #C4C3C2",
+"4=    c #BFBBB8",
+"5=    c #BCB6A3",
+"6=    c #AE986D",
+"7=    c #8E6928",
+"8=    c #90671D",
+"9=    c #8F691B",
+"0=    c #926619",
+"a=    c #8F6A18",
+"b=    c #986E1D",
+"c=    c #A48038",
+"d=    c #A7884F",
+"e=    c #B0A287",
+"f=    c #BAB0A0",
+"g=    c #BFBDBB",
+"h=    c #BCBBBB",
+"i=    c #C0C0C4",
+"j=    c #D2D2D5",
+"k=    c #EAEAEA",
+"l=    c #F5F5F5",
+"m=    c #DBDBDB",
+"n=    c #0D0B06",
+"o=    c #080806",
+"p=    c #898989",
+"q=    c #BEBEC2",
+"r=    c #BCBCC4",
+"s=    c #B9B5A8",
+"t=    c #ADA79E",
+"u=    c #B0A899",
+"v=    c #B4A78D",
+"w=    c #B5AB99",
+"x=    c #B9B09F",
+"y=    c #BBBAB5",
+"z=    c #BCBBBA",
+"A=    c #BAB9BB",
+"B=    c #BEBEC1",
+"C=    c #BAB9B8",
+"D=    c #C2C1C0",
+"E=    c #B8B8B9",
+"F=    c #181816",
+"G=    c #040402",
+"H=    c #CECECF",
+"I=    c #BEBEBF",
+"J=    c #BCBCC1",
+"K=    c #C5C1B4",
+"L=    c #BFBFC0",
+"M=    c #D5D5D6",
+"N=    c #8B8B8B",
+"O=    c #171614",
+"P=    c #171613",
+"Q=    c #12110D",
+"R=    c #313132",
+"S=    c #E1E1E2",
+"T=    c #BDBDC5",
+"U=    c #CECECE",
+"V=    c #DDDDDE",
+"W=    c #212121",
+"X=    c #121009",
+"Y=    c #111110",
+"Z=    c #1A1A19",
+"`=    c #656566",
+" -    c #717173",
+".-    c #D3D3D3",
+"+-    c #C7C7CF",
+"@-    c #E0E0E0",
+"#-    c #C9C9CA",
+"$-    c #E4E4E4",
+"%-    c #2D2D2E",
+"&-    c #D0D0D1",
+"*-    c #A2A2A2",
+"=-    c #868687",
+"--    c #DDDBD2",
+";-    c #33322D",
+">-    c #A4A4A4",
+",-    c #B4B4B5",
+"'-    c #11100E",
+")-    c #D2D2D3",
+"!-    c #2E2D2B",
+"~-    c #0B0B09",
+"{-    c #97979A",
+"]-    c #A8A8A8",
+"^-    c #0F0F0F",
+"/-    c #444447",
+"(-    c #9E9EA1",
+"_-    c #E9E9EA",
+":-    c #E5E5E5",
+"<-    c #5F5F61",
+"[-    c #9D9DA0",
+"}-    c #EEEEEF",
+"|-    c #DCDCDD",
+"1-    c #434344",
+"2-    c #A0A0A4",
+"3-    c #A4A4A7",
+"4-    c #B4B4B3",
+"5-    c #CAC9C5",
+"6-    c #DBDBDC",
+"7-    c #CCCCCC",
+"8-    c #C5C5C5",
+"9-    c #C8C8C8",
+"0-    c #AAAAAE",
+"a-    c #151517",
+"b-    c #98989B",
+"c-    c #9D9D9F",
+"d-    c #A1A1A5",
+"e-    c #AEAEAD",
+"f-    c #C4C2C5",
+"g-    c #DEDEDF",
+"h-    c #F3F3F4",
+"i-    c #E2E2E3",
+"j-    c #CACACB",
+"k-    c #878786",
+"l-    c #0D0C0B",
+"m-    c #A2A2A4",
+"n-    c #B5B5B7",
+"o-    c #E6E6E7",
+"p-    c #D4D4D4",
+"q-    c #C7C7C7",
+"r-    c #3F3F42",
+"s-    c #1B1B1C",
+"t-    c #060604",
+"u-    c #89888A",
+"v-    c #A5A5A8",
+"w-    c #E8E8E9",
+"x-    c #888888",
+"y-    c #242422",
+"z-    c #9F9FA0",
+"A-    c #D6D6D7",
+"B-    c #252525",
+"C-    c #262629",
+"D-    c #333335",
+"E-    c #1C1C1B",
+"F-    c #2D2D2B",
+"G-    c #131317",
+"H-    c #6B6B6C",
+"I-    c #858584",
+"J-    c #1E1E1F",
+"K-    c #4E4E4E",
+"L-    c #1F1E1D",
+"M-    c #2A2A2F",
+"N-    c #393938",
+"O-    c #424242",
+"P-    c #050503",
+"Q-    c #202021",
+"R-    c #232324",
+"S-    c #454443",
+"T-    c #B6B6B6",
+"U-    c #282828",
+"V-    c #161514",
+"W-    c #121212",
+"X-    c #2D2D30",
+"Y-    c #252524",
+"Z-    c #2E2E34",
+"`-    c #2D2D2D",
+" ;    c #191813",
+".;    c #333333",
+"+;    c #0D0D0A",
+"@;    c #404040",
+"#;    c #131313",
+"$;    c #CBCACA",
+"%;    c #161615",
+"&;    c #3E3E43",
+"*;    c #2B2B2C",
+"=;    c #11110F",
+"-;    c #1E1D1B",
+";;    c #302F2E",
+">;    c #323233",
+",;    c #686868",
+"';    c #464541",
+");    c #313133",
+"!;    c #0F0F14",
+"~;    c #373739",
+"{;    c #13120E",
+"];    c #080809",
+"^;    c #3C3B42",
+"/;    c #09090A",
+"(;    c #8F8F94",
+"_;    c #1A1A1B",
+":;    c #2C2C37",
+"<;    c #3A3A3B",
+"[;    c #1E1D1A",
+"};    c #0E0E0C",
+"|;    c #2C2B2E",
+"1;    c #1C1C20",
+"2;    c #2C2C2F",
+"3;    c #12110E",
+"4;    c #1A1A18",
+"5;    c #141413",
+"6;    c #1E1E1C",
+"7;    c #4E4D4E",
+"8;    c #100F0D",
+"9;    c #E7E7E8",
+"0;    c #191816",
+"a;    c #454545",
+"b;    c #282725",
+"c;    c #B7B7B8",
+"d;    c #0B0B08",
+"e;    c #404043",
+"f;    c #060102",
+"g;    c #1A1918",
+"h;    c #222221",
+"i;    c #8D8D8D",
+"j;    c #9E9E9E",
+"k;    c #414143",
+"l;    c #020102",
+"m;    c #050202",
+"n;    c #ACACAC",
+"o;    c #9D9D9D",
+"p;    c #EFEFF0",
+"q;    c #0E0E0E",
+"r;    c #353531",
+"s;    c #737373",
+"t;    c #141416",
+"u;    c #292825",
+"v;    c #B5B5B6",
+"w;    c #1C1C1E",
+"x;    c #2C2B2F",
+"y;    c #DFDFE0",
+"z;    c #373635",
+"A;    c #313031",
+"B;    c #E4E4E5",
+"C;    c #333234",
+"D;    c #2F2F2F",
+"E;    c #242425",
+"F;    c #0F0E0B",
+"G;    c #262627",
+"H;    c #404045",
+"I;    c #626263",
+"J;    c #292926",
+"K;    c #2B2A2E",
+"L;    c #505051",
+"M;    c #797979",
+"N;    c #323230",
+"O;    c #696969",
+"P;    c #787878",
+"Q;    c #15151D",
+"R;    c #272625",
+"S;    c #777777",
+"T;    c #21201D",
+"U;    c #2F2F2E",
+"V;    c #1A1916",
+"W;    c #1D1C1B",
+"X;    c #191815",
+"Y;    c #151515",
+"Z;    c #080702",
+"`;    c #534105",
+" >    c #4D3E06",
+".>    c #78787A",
+"+>    c #050403",
+"@>    c #171718",
+"#>    c #29292F",
+"$>    c #2B2B29",
+"%>    c #232326",
+"&>    c #1C1B18",
+"*>    c #2C1F04",
+"=>    c #9F7C08",
+"->    c #F1BC12",
+";>    c #EAB910",
+">>    c #CDA00A",
+",>    c #755905",
+"'>    c #D1D1D2",
+")>    c #151516",
+"!>    c #1C1C1A",
+"~>    c #18181A",
+"{>    c #424244",
+"]>    c #2A1E03",
+"^>    c #8A610A",
+"/>    c #DCA50B",
+"(>    c #F2C011",
+"_>    c #F4BE0F",
+":>    c #F3C112",
+"<>    c #ECBB10",
+"[>    c #7D6007",
+"}>    c #5A5955",
+"|>    c #DBD8CC",
+"1>    c #E5E5E6",
+"2>    c #737372",
+"3>    c #0C0C09",
+"4>    c #5D5D5E",
+"5>    c #48484A",
+"6>    c #CB8F0E",
+"7>    c #E7AA0E",
+"8>    c #F4C110",
+"9>    c #EEBB12",
+"0>    c #F0BF15",
+"a>    c #EFBA0F",
+"b>    c #F4BF0E",
+"c>    c #F6C10F",
+"d>    c #EFBC0B",
+"e>    c #775906",
+"f>    c #727272",
+"g>    c #F4ECDB",
+"h>    c #ECD6A6",
+"i>    c #EDD7A7",
+"j>    c #EBD5A5",
+"k>    c #654E20",
+"l>    c #1C1913",
+"m>    c #0F0D07",
+"n>    c #343336",
+"o>    c #8C630A",
+"p>    c #DB9810",
+"q>    c #F3BC0F",
+"r>    c #F0BD11",
+"s>    c #F4C412",
+"t>    c #F2B90C",
+"u>    c #F2C316",
+"v>    c #F4C00E",
+"w>    c #EFBD0F",
+"x>    c #F7BD0E",
+"y>    c #EEB90B",
+"z>    c #765806",
+"A>    c #504F4E",
+"B>    c #B9B6B3",
+"C>    c #E3E3E4",
+"D>    c #E9CA8C",
+"E>    c #DEAF24",
+"F>    c #E9BA0B",
+"G>    c #EBBF0F",
+"H>    c #EBBF0D",
+"I>    c #EFBF11",
+"J>    c #E5A80D",
+"K>    c #A07A16",
+"L>    c #100D08",
+"M>    c #0F0F0D",
+"N>    c #2E2E30",
+"O>    c #D8970F",
+"P>    c #D8980E",
+"Q>    c #E9B60F",
+"R>    c #EEB70F",
+"S>    c #F1BB0F",
+"T>    c #F3C213",
+"U>    c #F1BD0D",
+"V>    c #EDBD0F",
+"W>    c #F4C00F",
+"X>    c #F1BF0F",
+"Y>    c #F8BE0B",
+"Z>    c #EEBD0C",
+"`>    c #7A5D06",
+" ,    c #F5ECDD",
+".,    c #E0A828",
+"+,    c #E8C30D",
+"@,    c #E2CA0E",
+"#,    c #E3C80B",
+"$,    c #EAC911",
+"%,    c #C8A11C",
+"&,    c #17120A",
+"*,    c #241F0C",
+"=,    c #C79C0B",
+"-,    c #D2A80B",
+";,    c #C68B0B",
+">,    c #D8950F",
+",,    c #DB980D",
+"',    c #E2A70B",
+"),    c #F2BC13",
+"!,    c #EFC012",
+"~,    c #F0BD13",
+"{,    c #F3BF10",
+"],    c #F5BF0F",
+"^,    c #EDBD12",
+"/,    c #F3C012",
+"(,    c #F1BA0C",
+"_,    c #F4C30C",
+":,    c #E9B30C",
+"<,    c #705405",
+"[,    c #070605",
+"},    c #2E2D2A",
+"|,    c #EDD7A9",
+"1,    c #DE9C0E",
+"2,    c #EFB910",
+"3,    c #E7C710",
+"4,    c #E5CB0B",
+"5,    c #E2CA0B",
+"6,    c #E2C90A",
+"7,    c #E2CA0F",
+"8,    c #C6AC32",
+"9,    c #15130E",
+"0,    c #0D0A06",
+"a,    c #886907",
+"b,    c #EBBC0E",
+"c,    c #E6CA10",
+"d,    c #E8C70E",
+"e,    c #9B7F08",
+"f,    c #785206",
+"g,    c #D4920D",
+"h,    c #D6980E",
+"i,    c #DD9D0D",
+"j,    c #E1A80B",
+"k,    c #EBB712",
+"l,    c #F1BF10",
+"m,    c #F1BC11",
+"n,    c #F3BF13",
+"o,    c #EDBF12",
+"p,    c #F1BF11",
+"q,    c #F1C10E",
+"r,    c #F7BF0F",
+"s,    c #F5C50F",
+"t,    c #E6BA0E",
+"u,    c #4A3905",
+"v,    c #191918",
+"w,    c #787776",
+"x,    c #EEDAAA",
+"y,    c #DD9B0E",
+"z,    c #EAB00D",
+"A,    c #F4C20E",
+"B,    c #F4C813",
+"C,    c #E6CA0D",
+"D,    c #E3C30D",
+"E,    c #B7973F",
+"F,    c #151513",
+"G,    c #574507",
+"H,    c #EAC210",
+"I,    c #E4C80B",
+"J,    c #E1C90A",
+"K,    c #EACE10",
+"L,    c #C9890F",
+"M,    c #D5920E",
+"N,    c #D8970E",
+"O,    c #E4A40B",
+"P,    c #E6AD0D",
+"Q,    c #F1BC15",
+"R,    c #F4C113",
+"S,    c #F4BF10",
+"T,    c #EEBD0F",
+"U,    c #F3C110",
+"V,    c #EEC111",
+"W,    c #F3BE11",
+"X,    c #EEBA11",
+"Y,    c #F5C10E",
+"Z,    c #F7BD0D",
+"`,    c #F6C511",
+" '    c #C2990A",
+".'    c #1F1903",
+"+'    c #131311",
+"@'    c #B9B9B9",
+"#'    c #EADAB5",
+"$'    c #D99D12",
+"%'    c #E8AC0C",
+"&'    c #EEBC0F",
+"*'    c #F6BD0E",
+"='    c #F0C512",
+"-'    c #E9C90D",
+";'    c #DDB00C",
+">'    c #916F1F",
+",'    c #131009",
+"''    c #403405",
+")'    c #DDB20C",
+"!'    c #E9CE0C",
+"~'    c #E3C90E",
+"{'    c #B37B0C",
+"]'    c #CD8B0B",
+"^'    c #D7970E",
+"/'    c #DB9C0A",
+"('    c #E4A60D",
+"_'    c #E6AA0B",
+":'    c #EDBD11",
+"<'    c #F0C210",
+"['    c #EFBC10",
+"}'    c #EFBE0F",
+"|'    c #EFBB12",
+"1'    c #F5C110",
+"2'    c #EFBD0E",
+"3'    c #F6BF0C",
+"4'    c #F5C20D",
+"5'    c #F0C20F",
+"6'    c #B58908",
+"7'    c #393939",
+"8'    c #EDE0B9",
+"9'    c #D69D1D",
+"0'    c #E8B411",
+"a'    c #F3BB0E",
+"b'    c #F3C00E",
+"c'    c #EEBC0B",
+"d'    c #E6B90A",
+"e'    c #C8920C",
+"f'    c #94670A",
+"g'    c #241806",
+"h'    c #191204",
+"i'    c #BF8B09",
+"j'    c #F4C210",
+"k'    c #E3C809",
+"l'    c #E4CB0A",
+"m'    c #E8C915",
+"n'    c #E4CB0C",
+"o'    c #B17B17",
+"p'    c #C5860D",
+"q'    c #D2920D",
+"r'    c #D99A0E",
+"s'    c #E1A30C",
+"t'    c #E9AF10",
+"u'    c #F0B90F",
+"v'    c #EEBB13",
+"w'    c #EFBD12",
+"x'    c #EEBD12",
+"y'    c #F1C10F",
+"z'    c #F5BE12",
+"A'    c #EEBE11",
+"B'    c #F0BC0D",
+"C'    c #F7C10E",
+"D'    c #F3C50F",
+"E'    c #E3B908",
+"F'    c #4B3805",
+"G'    c #323231",
+"H'    c #999895",
+"I'    c #FAFAFA",
+"J'    c #DCCEA4",
+"K'    c #D69F22",
+"L'    c #E8AA0C",
+"M'    c #F1C012",
+"N'    c #EDBA0D",
+"O'    c #DDA70B",
+"P'    c #D1960B",
+"Q'    c #AB760A",
+"R'    c #53380A",
+"S'    c #251B06",
+"T'    c #A2730A",
+"U'    c #D99B0C",
+"V'    c #EEC50F",
+"W'    c #F0CB12",
+"X'    c #F2C30E",
+"Y'    c #F1C00D",
+"Z'    c #F3C90E",
+"`'    c #F5C311",
+" )    c #745108",
+".)    c #B27C16",
+"+)    c #C78912",
+"@)    c #D0910C",
+"#)    c #D99A0D",
+"$)    c #E3A60C",
+"%)    c #E4A90D",
+"&)    c #EDB50F",
+"*)    c #F5BC0F",
+"=)    c #F1BA0F",
+"-)    c #EFBD15",
+";)    c #F0C10F",
+">)    c #EFBB10",
+",)    c #F2C20F",
+"')    c #EDBD0E",
+"))    c #F7BD0F",
+"!)    c #EDBB0D",
+"~)    c #F6C00C",
+"{)    c #F3C90D",
+"])    c #ECC510",
+"^)    c #BF9A0A",
+"/)    c #211904",
+"()    c #848380",
+"_)    c #CDC098",
+":)    c #D09E2A",
+"<)    c #EAB310",
+"[)    c #F1B70D",
+"})    c #ECB30C",
+"|)    c #DDA308",
+"1)    c #CD8F09",
+"2)    c #AF7C08",
+"3)    c #996708",
+"4)    c #503805",
+"5)    c #1B1305",
+"6)    c #0C0805",
+"7)    c #2D1F08",
+"8)    c #9B6A08",
+"9)    c #D4960D",
+"0)    c #E2A90C",
+"a)    c #EAC40A",
+"b)    c #EEC00A",
+"c)    c #F5BA0D",
+"d)    c #F5BB0B",
+"e)    c #F3BA0B",
+"f)    c #F6B40D",
+"g)    c #9A6D0C",
+"h)    c #A7750A",
+"i)    c #B87F0E",
+"j)    c #C58A0D",
+"k)    c #D1910C",
+"l)    c #D99C0D",
+"m)    c #DFA40B",
+"n)    c #E7A80D",
+"o)    c #EDB20F",
+"p)    c #F1B80E",
+"q)    c #F1BE0F",
+"r)    c #F1BE13",
+"s)    c #F6BE10",
+"t)    c #ECBD13",
+"u)    c #F3C20F",
+"v)    c #F5BD0E",
+"w)    c #F3BC10",
+"x)    c #F2CD0F",
+"y)    c #E6B80B",
+"z)    c #B2840A",
+"A)    c #CCBF99",
+"B)    c #D59E18",
+"C)    c #E5AA0E",
+"D)    c #F4BC12",
+"E)    c #F1B90F",
+"F)    c #E8AF0B",
+"G)    c #DDA106",
+"H)    c #CF9209",
+"I)    c #BA7F09",
+"J)    c #AA7309",
+"K)    c #A06A08",
+"L)    c #6C4708",
+"M)    c #1F1505",
+"N)    c #1F1707",
+"O)    c #714C08",
+"P)    c #946809",
+"Q)    c #BB7E09",
+"R)    c #D69B08",
+"S)    c #E4AC09",
+"T)    c #ECBA0B",
+"U)    c #F7BC0C",
+"V)    c #F5B80E",
+"W)    c #F9B30B",
+"X)    c #664605",
+"Y)    c #A2710C",
+"Z)    c #AE7F0B",
+"`)    c #C09017",
+" !    c #D59A0A",
+".!    c #C89011",
+"+!    c #C88E0F",
+"@!    c #CF9311",
+"#!    c #D6950E",
+"$!    c #DC9D0D",
+"%!    c #E1A60A",
+"&!    c #E3AA0E",
+"*!    c #EDB110",
+"=!    c #F1BB0E",
+"-!    c #EFBB11",
+";!    c #F6C010",
+">!    c #F2C00E",
+",!    c #F2BD11",
+"'!    c #F5C111",
+")!    c #EDBB0C",
+"!!    c #F0BB10",
+"~!    c #EEBF11",
+"{!    c #F5C112",
+"]!    c #F2BF0D",
+"^!    c #F6BE0C",
+"/!    c #F1C511",
+"(!    c #EAC30D",
+"_!    c #DAA80A",
+":!    c #463204",
+"<!    c #CDC09A",
+"[!    c #D69E1C",
+"}!    c #E5AA12",
+"|!    c #F2B713",
+"1!    c #ECB60B",
+"2!    c #E8AD0C",
+"3!    c #DBA208",
+"4!    c #D09609",
+"5!    c #C3880B",
+"6!    c #B87D09",
+"7!    c #AC7709",
+"8!    c #9E6D08",
+"9!    c #875B08",
+"0!    c #533A07",
+"a!    c #4C3307",
+"b!    c #573C06",
+"c!    c #7C5307",
+"d!    c #9C6C09",
+"e!    c #A87208",
+"f!    c #B47D09",
+"g!    c #CB8F08",
+"h!    c #DC9E07",
+"i!    c #E4AC0B",
+"j!    c #E9B70A",
+"k!    c #F3C00A",
+"l!    c #F1BD0E",
+"m!    c #F4BB0D",
+"n!    c #8E5F12",
+"o!    c #C48F16",
+"p!    c #DEA20E",
+"q!    c #EAB10D",
+"r!    c #E9AE0F",
+"s!    c #E2AA0E",
+"t!    c #E1A90B",
+"u!    c #E1A80E",
+"v!    c #E6AD0F",
+"w!    c #E7AE0E",
+"x!    c #E8AF10",
+"y!    c #EFB30F",
+"z!    c #EEB70C",
+"A!    c #F3BB0C",
+"B!    c #F1C110",
+"C!    c #EEBC0E",
+"D!    c #F2BC16",
+"E!    c #F5C213",
+"F!    c #EEBA10",
+"G!    c #F4C112",
+"H!    c #EEB90F",
+"I!    c #F2C013",
+"J!    c #EFB90F",
+"K!    c #F6BF0F",
+"L!    c #F6BB0E",
+"M!    c #F1C00A",
+"N!    c #F0CC0F",
+"O!    c #E2B80C",
+"P!    c #AE8009",
+"Q!    c #40403F",
+"R!    c #CCC1A5",
+"S!    c #D29B1B",
+"T!    c #DFA108",
+"U!    c #EBB20C",
+"V!    c #EDB20B",
+"W!    c #EAB00A",
+"X!    c #DEA007",
+"Y!    c #D69A06",
+"Z!    c #CA8F09",
+"`!    c #C28908",
+" ~    c #B98009",
+".~    c #B47C09",
+"+~    c #B07709",
+"@~    c #AB7709",
+"#~    c #A87309",
+"$~    c #A67309",
+"%~    c #AE7908",
+"&~    c #AF7A08",
+"*~    c #B27C0B",
+"=~    c #B98408",
+"-~    c #C98E09",
+";~    c #D8A308",
+">~    c #E5AD09",
+",~    c #EFB40D",
+"'~    c #F0B60E",
+")~    c #F5BA0C",
+"!~    c #F5BF0A",
+"~~    c #F5BE0F",
+"{~    c #F3BF0E",
+"]~    c #E8B70F",
+"^~    c #AF7B10",
+"/~    c #CA930D",
+"(~    c #D9A00A",
+"_~    c #E6A80C",
+":~    c #E8AE0E",
+"<~    c #EBAF0D",
+"[~    c #E8B00F",
+"}~    c #E8AF0F",
+"|~    c #EBB311",
+"1~    c #EDB60F",
+"2~    c #EEB50F",
+"3~    c #F0B50F",
+"4~    c #F0BA0D",
+"5~    c #F3B80B",
+"6~    c #F5BC0C",
+"7~    c #EEBB0E",
+"8~    c #F5C00E",
+"9~    c #F1BE16",
+"0~    c #EEBC0D",
+"a~    c #EFBB0E",
+"b~    c #F2C112",
+"c~    c #EFBE14",
+"d~    c #EFBA10",
+"e~    c #F0BC10",
+"f~    c #ECBE0F",
+"g~    c #F3C312",
+"h~    c #ECBD0F",
+"i~    c #F4BE0D",
+"j~    c #F3BE0A",
+"k~    c #F3C60F",
+"l~    c #E9C70F",
+"m~    c #DBA80B",
+"n~    c #483406",
+"o~    c #8E8E8E",
+"p~    c #C5B8A4",
+"q~    c #CB9325",
+"r~    c #DDA112",
+"s~    c #E8AD0B",
+"t~    c #EBB40A",
+"u~    c #E8AF0A",
+"v~    c #DFA608",
+"w~    c #D99C04",
+"x~    c #D49705",
+"y~    c #CB8F09",
+"z~    c #C58C0A",
+"A~    c #C38909",
+"B~    c #BE8309",
+"C~    c #BD820A",
+"D~    c #B78008",
+"E~    c #B78208",
+"F~    c #BB8209",
+"G~    c #C0820B",
+"H~    c #C18709",
+"I~    c #CF9509",
+"J~    c #D9A007",
+"K~    c #E7AA0B",
+"L~    c #F0B60C",
+"M~    c #F0B80C",
+"N~    c #F4BD0D",
+"O~    c #F2BB0B",
+"P~    c #EEBC11",
+"Q~    c #F2C111",
+"R~    c #F3BE0F",
+"S~    c #A4810A",
+"T~    c #594115",
+"U~    c #CD8F11",
+"V~    c #D79E0C",
+"W~    c #E3A90D",
+"X~    c #E4AF0C",
+"Y~    c #E7AF0E",
+"Z~    c #EAB00E",
+"`~    c #EFB70E",
+" {    c #F3B70E",
+".{    c #F1B70E",
+"+{    c #F2B60F",
+"@{    c #F1B90D",
+"#{    c #F3BA0D",
+"${    c #F5BB0C",
+"%{    c #F4C00D",
+"&{    c #F7BC10",
+"*{    c #F2BB0F",
+"={    c #F0BD0E",
+"-{    c #F2BD0E",
+";{    c #F0BE10",
+">{    c #EEC013",
+",{    c #EEBB10",
+"'{    c #F3BF11",
+"){    c #F2B80B",
+"!{    c #F4BF0D",
+"~{    c #F3BF0B",
+"{{    c #F2CE10",
+"]{    c #E9C10F",
+"^{    c #BE8E0A",
+"/{    c #C48D20",
+"({    c #D3960C",
+"_{    c #E4A90A",
+":{    c #EAB00B",
+"<{    c #E8AE0A",
+"[{    c #E2A70A",
+"}{    c #DCA308",
+"|{    c #CD9209",
+"1{    c #C98D0A",
+"2{    c #C88C09",
+"3{    c #C78A09",
+"4{    c #C78C09",
+"5{    c #CA910A",
+"6{    c #CD920A",
+"7{    c #D29A08",
+"8{    c #DB9E07",
+"9{    c #E4AB0B",
+"0{    c #F0B70C",
+"a{    c #EFBB0A",
+"b{    c #F6C00E",
+"c{    c #EFBD0C",
+"d{    c #F2BF12",
+"e{    c #F0BC11",
+"f{    c #EFBE10",
+"g{    c #593E0A",
+"h{    c #D09112",
+"i{    c #E0A60C",
+"j{    c #E9AD0E",
+"k{    c #F2B50F",
+"l{    c #F4BA0F",
+"m{    c #F4B80E",
+"n{    c #F1BA0B",
+"o{    c #F3B90E",
+"p{    c #F5B90E",
+"q{    c #F3BB0D",
+"r{    c #F5BD0D",
+"s{    c #F0B80A",
+"t{    c #F6BF0E",
+"u{    c #F6BC0E",
+"v{    c #F2BE18",
+"w{    c #F4C10F",
+"x{    c #F7C111",
+"y{    c #EFBE11",
+"z{    c #F3C011",
+"A{    c #F4BE10",
+"B{    c #F3C111",
+"C{    c #F3C30C",
+"D{    c #EFCD10",
+"E{    c #E1B10B",
+"F{    c #B0820A",
+"G{    c #5B5A57",
+"H{    c #BEB097",
+"I{    c #BA892A",
+"J{    c #C8910A",
+"K{    c #D89E07",
+"L{    c #E6AC09",
+"M{    c #E9AF0A",
+"N{    c #E3A70A",
+"O{    c #DB9E05",
+"P{    c #D79906",
+"Q{    c #D69A05",
+"R{    c #D69605",
+"S{    c #D29508",
+"T{    c #D09508",
+"U{    c #D29408",
+"V{    c #CE9408",
+"W{    c #D59A07",
+"X{    c #E4AC0A",
+"Y{    c #ECB40C",
+"Z{    c #F6B90B",
+"`{    c #EEBE0E",
+" ]    c #F1C20F",
+".]    c #E9B710",
+"+]    c #F5C418",
+"@]    c #F5BC0D",
+"#]    c #EFBD17",
+"$]    c #F7BC0F",
+"%]    c #EEBB0F",
+"&]    c #F5C117",
+"*]    c #E9B913",
+"=]    c #5E4414",
+"-]    c #CE951F",
+";]    c #E1A70C",
+">]    c #EBB310",
+",]    c #EFBC11",
+"']    c #EFBD0D",
+")]    c #F6BE0E",
+"!]    c #F1BB0D",
+"~]    c #F3C415",
+"{]    c #F0BC13",
+"]]    c #EFC014",
+"^]    c #EFBC13",
+"/]    c #EEBF14",
+"(]    c #F5C20F",
+"_]    c #F2B910",
+":]    c #F5BF10",
+"<]    c #F0BC0F",
+"[]    c #ECB912",
+"}]    c #EEC30F",
+"|]    c #F0BE12",
+"1]    c #EEBB11",
+"2]    c #F6BF16",
+"3]    c #F3C210",
+"4]    c #EDBC0C",
+"5]    c #F6BA0D",
+"6]    c #F2C10A",
+"7]    c #F1CA10",
+"8]    c #E8C110",
+"9]    c #DAA309",
+"0]    c #463305",
+"a]    c #191817",
+"b]    c #A2A2A3",
+"c]    c #BBAF99",
+"d]    c #A87814",
+"e]    c #B68608",
+"f]    c #CF9608",
+"g]    c #DEA508",
+"h]    c #E6AC0A",
+"i]    c #E5AB0A",
+"j]    c #E0A60A",
+"k]    c #DDA309",
+"l]    c #D8A009",
+"m]    c #D89D07",
+"n]    c #D79B06",
+"o]    c #D99F07",
+"p]    c #D99F06",
+"q]    c #DCA207",
+"r]    c #DFA709",
+"s]    c #ECB80B",
+"t]    c #F1BB0C",
+"u]    c #F2C212",
+"v]    c #F7C30E",
+"w]    c #F0BD0D",
+"x]    c #F1BD0F",
+"y]    c #F2BE0C",
+"z]    c #EBB70F",
+"A]    c #F7C017",
+"B]    c #F6C00D",
+"C]    c #E4B40F",
+"D]    c #563F0C",
+"E]    c #CE9315",
+"F]    c #E4A90C",
+"G]    c #EEB210",
+"H]    c #F5BD11",
+"I]    c #F1BC0D",
+"J]    c #F4C316",
+"K]    c #F3BE18",
+"L]    c #F4C310",
+"M]    c #F3C40F",
+"N]    c #ECBD11",
+"O]    c #F4C313",
+"P]    c #F2C015",
+"Q]    c #EFBE12",
+"R]    c #F5C313",
+"S]    c #F0BF12",
+"T]    c #EEBD10",
+"U]    c #F5BE11",
+"V]    c #F6BF0D",
+"W]    c #EFBE17",
+"X]    c #F0BE0F",
+"Y]    c #F0BC0E",
+"Z]    c #F2BD0B",
+"`]    c #F0CA10",
+" ^    c #E3B20D",
+".^    c #BD8C09",
+"+^    c #201704",
+"@^    c #9A6F1B",
+"#^    c #B48207",
+"$^    c #CB930A",
+"%^    c #DAA108",
+"&^    c #E6AB0B",
+"*^    c #E4AA0A",
+"=^    c #E7AD0A",
+"-^    c #E0A40A",
+";^    c #DEA70A",
+">^    c #E2A50A",
+",^    c #E4AB09",
+"'^    c #E4AD0A",
+")^    c #EBB10B",
+"!^    c #EFB50D",
+"~^    c #F4B40C",
+"{^    c #F1B910",
+"]^    c #F0BA0C",
+"^^    c #F3C413",
+"/^    c #F8C316",
+"(^    c #F4C211",
+"_^    c #F3C310",
+":^    c #F6C30D",
+"<^    c #E0AF0D",
+"[^    c #CE9410",
+"}^    c #DEA514",
+"|^    c #ECB40D",
+"1^    c #F4BA0E",
+"2^    c #F5BF11",
+"3^    c #EEBE10",
+"4^    c #EFBD11",
+"5^    c #F3BD0E",
+"6^    c #F0C012",
+"7^    c #F4B80C",
+"8^    c #EEBA0E",
+"9^    c #F3C211",
+"0^    c #F5C012",
+"a^    c #F6BD0F",
+"b^    c #EDBE0D",
+"c^    c #EFBC0E",
+"d^    c #EDBB10",
+"e^    c #F0BF10",
+"f^    c #F2C213",
+"g^    c #F1BE11",
+"h^    c #F1C113",
+"i^    c #EFBC0D",
+"j^    c #F5C010",
+"k^    c #F7BB0C",
+"l^    c #F1BE0C",
+"m^    c #F3CA0F",
+"n^    c #E9C60E",
+"o^    c #E2AB0A",
+"p^    c #775607",
+"q^    c #676767",
+"r^    c #B8A68F",
+"s^    c #9A6E16",
+"t^    c #AF790A",
+"u^    c #C88E0A",
+"v^    c #D59C0A",
+"w^    c #E0A50A",
+"x^    c #E7AF0A",
+"y^    c #E9B20A",
+"z^    c #E9B10A",
+"A^    c #E8B00A",
+"B^    c #E8AE0B",
+"C^    c #E3AB0A",
+"D^    c #E5AC0B",
+"E^    c #E9B00A",
+"F^    c #EBB50B",
+"G^    c #EFB70B",
+"H^    c #F5BC0E",
+"I^    c #EDBC11",
+"J^    c #F4C012",
+"K^    c #F1C211",
+"L^    c #EFBA16",
+"M^    c #F4C510",
+"N^    c #F3BD10",
+"O^    c #EDBE0F",
+"P^    c #E5B613",
+"Q^    c #C38B16",
+"R^    c #DCA30C",
+"S^    c #E6AE0D",
+"T^    c #F0B40E",
+"U^    c #EFBF13",
+"V^    c #F6BF11",
+"W^    c #ECBE13",
+"X^    c #F3BC16",
+"Y^    c #EFB912",
+"Z^    c #ECBA0E",
+"`^    c #F6C315",
+" /    c #F1BD11",
+"./    c #F3C313",
+"+/    c #F4C411",
+"@/    c #F2BE11",
+"#/    c #EEBF0F",
+"$/    c #F3BE12",
+"%/    c #EEBE12",
+"&/    c #F4C111",
+"*/    c #F1BF12",
+"=/    c #F3BD0B",
+"-/    c #F0C80E",
+";/    c #E6BA0C",
+">/    c #C89309",
+",/    c #545455",
+"'/    c #8A6F3C",
+")/    c #9C6A08",
+"!/    c #B57C09",
+"~/    c #C68D0A",
+"{/    c #D79A04",
+"]/    c #DEA40A",
+"^/    c #E7AE0A",
+"//    c #F1B20D",
+"(/    c #E8B10A",
+"_/    c #EBB20B",
+":/    c #EDB60C",
+"</    c #EEB50C",
+"[/    c #F0B80B",
+"}/    c #EFBB0D",
+"|/    c #F5C011",
+"1/    c #F2C113",
+"2/    c #EFBE0E",
+"3/    c #F3BF0D",
+"4/    c #F0BB0F",
+"5/    c #EDBD14",
+"6/    c #F6C113",
+"7/    c #F6BD12",
+"8/    c #EABB10",
+"9/    c #A58106",
+"0/    c #C48B18",
+"a/    c #D8990D",
+"b/    c #E4A80C",
+"c/    c #EEB30E",
+"d/    c #F3B90F",
+"e/    c #EDBF10",
+"f/    c #F4BF14",
+"g/    c #F0BD12",
+"h/    c #EEBF13",
+"i/    c #ECBD10",
+"j/    c #ECB90E",
+"k/    c #EFBF0F",
+"l/    c #EEBF12",
+"m/    c #EFBE16",
+"n/    c #F6C011",
+"o/    c #F0BA0E",
+"p/    c #F8BD0F",
+"q/    c #F3C00B",
+"r/    c #EFC20B",
+"s/    c #E6B40B",
+"t/    c #BA840A",
+"u/    c #201703",
+"v/    c #0A0A0B",
+"w/    c #656565",
+"x/    c #6B6762",
+"y/    c #5A3F08",
+"z/    c #A56F09",
+"A/    c #BA8009",
+"B/    c #C88F09",
+"C/    c #D39D07",
+"D/    c #E0A509",
+"E/    c #EAAE0B",
+"F/    c #EDB30C",
+"G/    c #F0B70E",
+"H/    c #F2B90F",
+"I/    c #EEB50D",
+"J/    c #F1B80B",
+"K/    c #F2BA0D",
+"L/    c #F2BA0C",
+"M/    c #F4BE0C",
+"N/    c #F0C011",
+"O/    c #F6C215",
+"P/    c #F0BF0F",
+"Q/    c #F4C212",
+"R/    c #F2C416",
+"S/    c #F7C20F",
+"T/    c #F2BE12",
+"U/    c #EFBB0F",
+"V/    c #ECBF11",
+"W/    c #A6850E",
+"X/    c #C28A1C",
+"Y/    c #D4970B",
+"Z/    c #E0A20C",
+"`/    c #ECB20F",
+" (    c #F2B90E",
+".(    c #EDBB11",
+"+(    c #F6BF10",
+"@(    c #EFBA0E",
+"#(    c #EFBF16",
+"$(    c #F4C312",
+"%(    c #EEBD11",
+"&(    c #F2C311",
+"*(    c #F2C20D",
+"=(    c #F3BC0E",
+"-(    c #F1BC1A",
+";(    c #F7BF0C",
+">(    c #EEBF10",
+",(    c #E8B613",
+"'(    c #F2BF10",
+")(    c #EFBF12",
+"!(    c #F2B80D",
+"~(    c #F2BF16",
+"{(    c #F4C10D",
+"](    c #F1BD10",
+"^(    c #EEC910",
+"/(    c #EBC711",
+"((    c #DDA40B",
+"_(    c #755208",
+":(    c #4B4B4C",
+"<(    c #636363",
+"[(    c #0C0B06",
+"}(    c #533907",
+"|(    c #A37009",
+"1(    c #BB8009",
+"2(    c #C8900A",
+"3(    c #D79C06",
+"4(    c #E1A70B",
+"5(    c #EDB50C",
+"6(    c #F0B80D",
+"7(    c #F6BE0A",
+"8(    c #F1BF0D",
+"9(    c #F6BD0A",
+"0(    c #F4BD0C",
+"a(    c #F6BE0B",
+"b(    c #F5BE0D",
+"c(    c #F0B90C",
+"d(    c #EEBC10",
+"e(    c #F6C212",
+"f(    c #F4BE12",
+"g(    c #F6C211",
+"h(    c #F5C317",
+"i(    c #F4BD10",
+"j(    c #F2C40F",
+"k(    c #EFB80C",
+"l(    c #F5C013",
+"m(    c #F5C10F",
+"n(    c #F2BF0F",
+"o(    c #F7BF13",
+"p(    c #EDBD0D",
+"q(    c #EABA10",
+"r(    c #A57E07",
+"s(    c #BF891A",
+"t(    c #D0920B",
+"u(    c #DFA10C",
+"v(    c #EAB00C",
+"w(    c #F4B40E",
+"x(    c #F1BE1A",
+"y(    c #F3C30F",
+"z(    c #F0C211",
+"A(    c #F3C414",
+"B(    c #F0BA11",
+"C(    c #EEBB16",
+"D(    c #F5C312",
+"E(    c #F4C514",
+"F(    c #F0C213",
+"G(    c #F2C010",
+"H(    c #EDC015",
+"I(    c #EFBE13",
+"J(    c #F1C010",
+"K(    c #EDBB0F",
+"L(    c #F0BA10",
+"M(    c #EFC10C",
+"N(    c #F2CF12",
+"O(    c #E8C30C",
+"P(    c #C48B0A",
+"Q(    c #211805",
+"R(    c #563D06",
+"S(    c #A07008",
+"T(    c #CB920A",
+"U(    c #D89D05",
+"V(    c #E0A90A",
+"W(    c #EBB30A",
+"X(    c #EFBC0C",
+"Y(    c #EBB70E",
+"Z(    c #F0BD15",
+"`(    c #F1BD16",
+" _    c #ECBB11",
+"._    c #F7BF18",
+"+_    c #F0BA0F",
+"@_    c #F7C117",
+"#_    c #F2C211",
+"$_    c #EBBA12",
+"%_    c #C38B19",
+"&_    c #CC8E15",
+"*_    c #DA9D0E",
+"=_    c #EAAE0F",
+"-_    c #EEB60E",
+";_    c #EEBD0E",
+">_    c #F4C20C",
+",_    c #F0B810",
+"'_    c #F1C311",
+")_    c #F3C410",
+"!_    c #F2C10D",
+"~_    c #F2BF0E",
+"{_    c #EEC012",
+"]_    c #F3C113",
+"^_    c #EEBE0F",
+"/_    c #F0BD0F",
+"(_    c #F4BF11",
+"__    c #EBBC11",
+":_    c #F4B90A",
+"<_    c #EFBE0B",
+"[_    c #EEC50B",
+"}_    c #EDCB0D",
+"|_    c #DFAC0A",
+"1_    c #B6820B",
+"2_    c #BAB19E",
+"3_    c #664307",
+"4_    c #9E6B07",
+"5_    c #BF8709",
+"6_    c #DA9E05",
+"7_    c #EEB30B",
+"8_    c #F0B90D",
+"9_    c #F3BB0F",
+"0_    c #EAB70F",
+"a_    c #F2C315",
+"b_    c #EDBC0E",
+"c_    c #ECBC0C",
+"d_    c #F6C20C",
+"e_    c #F2BA0E",
+"f_    c #EDBD10",
+"g_    c #F5BD0F",
+"h_    c #F3BE16",
+"i_    c #F7C00F",
+"j_    c #F3C010",
+"k_    c #F4C311",
+"l_    c #F3C10F",
+"m_    c #F4C215",
+"n_    c #F5BF0E",
+"o_    c #E5B411",
+"p_    c #C28A1D",
+"q_    c #CA8D10",
+"r_    c #DA9A0E",
+"s_    c #E6A80D",
+"t_    c #F0B70F",
+"u_    c #EFBC12",
+"v_    c #F5C211",
+"w_    c #F0BD17",
+"x_    c #ECBC0E",
+"y_    c #F1C313",
+"z_    c #F6C012",
+"A_    c #F4C011",
+"B_    c #EEB812",
+"C_    c #F3C212",
+"D_    c #F5BA0E",
+"E_    c #F2BB0C",
+"F_    c #EDBF0A",
+"G_    c #ECC40A",
+"H_    c #E2BE0A",
+"I_    c #D9A00C",
+"J_    c #C2902B",
+"K_    c #ECE3D7",
+"L_    c #1D1604",
+"M_    c #6C4806",
+"N_    c #A57107",
+"O_    c #BD850B",
+"P_    c #D29809",
+"Q_    c #DAA208",
+"R_    c #E3A709",
+"S_    c #EFB30C",
+"T_    c #F0B60D",
+"U_    c #F6BA0C",
+"V_    c #F5BE10",
+"W_    c #F2C10F",
+"X_    c #F0BD16",
+"Y_    c #F2BD18",
+"Z_    c #F8C00F",
+"`_    c #EEBB0C",
+" :    c #ECBE11",
+".:    c #F2C012",
+"+:    c #ECBE10",
+"@:    c #F3C00F",
+"#:    c #F0BB11",
+"$:    c #EFBD10",
+"%:    c #EEBA16",
+"&:    c #F0B90E",
+"*:    c #ECBC0F",
+"=:    c #F9C117",
+"-:    c #F3C412",
+";:    c #C78D10",
+">:    c #D18F12",
+",:    c #D8960F",
+"':    c #E5A60C",
+"):    c #EEB60F",
+"!:    c #E7B40F",
+"~:    c #F4BE11",
+"{:    c #F4B60E",
+"]:    c #F2BC0F",
+"^:    c #F5BB0E",
+"/:    c #EFBF10",
+"(:    c #F6C00F",
+"_:    c #EDB50E",
+"::    c #F5BC10",
+"<:    c #F1C312",
+"[:    c #EEBC17",
+"}:    c #EEBB0D",
+"|:    c #F1C018",
+"1:    c #F2C00F",
+"2:    c #F2C110",
+"3:    c #F1BF14",
+"4:    c #F5B60C",
+"5:    c #F1BD0B",
+"6:    c #EDBD0A",
+"7:    c #ECC20B",
+"8:    c #E9C60D",
+"9:    c #DFAD0C",
+"0:    c #CF970C",
+"a:    c #C1AA7B",
+"b:    c #352405",
+"c:    c #724D06",
+"d:    c #A97608",
+"e:    c #C28909",
+"f:    c #D39908",
+"g:    c #DCA408",
+"h:    c #E5AE0A",
+"i:    c #F6BC0D",
+"j:    c #F5C00F",
+"k:    c #F1C111",
+"l:    c #F1B80D",
+"m:    c #F0BC12",
+"n:    c #EDBC12",
+"o:    c #F3C314",
+"p:    c #F7C110",
+"q:    c #EDBC10",
+"r:    c #EEBE16",
+"s:    c #F3C30E",
+"t:    c #F0C510",
+"u:    c #F1BE17",
+"v:    c #F7C00E",
+"w:    c #F5C212",
+"x:    c #E9B712",
+"y:    c #F2B70E",
+"z:    c #F6C31B",
+"A:    c #D7910F",
+"B:    c #D3930D",
+"C:    c #D6980D",
+"D:    c #E4A40D",
+"E:    c #ECB810",
+"F:    c #F5B810",
+"G:    c #F2BD0F",
+"H:    c #F7C114",
+"I:    c #EEBE17",
+"J:    c #F1BF18",
+"K:    c #F7BF10",
+"L:    c #F3B90D",
+"M:    c #F1BE14",
+"N:    c #EFBE18",
+"O:    c #F4BA0D",
+"P:    c #F1BB0B",
+"Q:    c #EDBA0C",
+"R:    c #EDBE0A",
+"S:    c #E8C40A",
+"T:    c #E3BD0A",
+"U:    c #D79D0C",
+"V:    c #A4760D",
+"W:    c #D6C9AD",
+"X:    c #3C2805",
+"Y:    c #744C06",
+"Z:    c #AB7708",
+"`:    c #C88D09",
+" <    c #D49907",
+".<    c #DCA30A",
+"+<    c #E6AB0A",
+"@<    c #EEB80C",
+"#<    c #EDB70E",
+"$<    c #F1BC0F",
+"%<    c #F1C214",
+"&<    c #ECBC12",
+"*<    c #F0BF13",
+"=<    c #F2C413",
+"-<    c #E9B70E",
+";<    c #EEBD14",
+"><    c #F3C311",
+",<    c #F5BC12",
+"'<    c #ECBA12",
+")<    c #F6C10E",
+"!<    c #EFBD14",
+"~<    c #ECBC13",
+"{<    c #EBAB0E",
+"]<    c #D6940E",
+"^<    c #E4A70C",
+"/<    c #EDB410",
+"(<    c #F0BA0A",
+"_<    c #F5C113",
+":<    c #F7BB0D",
+"<<    c #F3C10B",
+"[<    c #EFC015",
+"}<    c #EDC016",
+"|<    c #EAB812",
+"1<    c #F2BB0E",
+"2<    c #F3B810",
+"3<    c #F2C016",
+"4<    c #F1C112",
+"5<    c #F5B90C",
+"6<    c #EFBA11",
+"7<    c #F1BA0E",
+"8<    c #E8BC0C",
+"9<    c #E6C10B",
+"0<    c #E6C50B",
+"a<    c #D6A708",
+"b<    c #B4820D",
+"c<    c #9D7527",
+"d<    c #E8E4D6",
+"e<    c #3E2905",
+"f<    c #7A5206",
+"g<    c #AA7409",
+"h<    c #D39B0A",
+"i<    c #F1C014",
+"j<    c #EDBE0E",
+"k<    c #EEBD0D",
+"l<    c #F6C311",
+"m<    c #EEBE13",
+"n<    c #F4C20F",
+"o<    c #EDBE12",
+"p<    c #F2B80F",
+"q<    c #F0B710",
+"r<    c #F6BB13",
+"s<    c #E0A20A",
+"t<    c #D7950F",
+"u<    c #D6970D",
+"v<    c #D9990F",
+"w<    c #E4AB0C",
+"x<    c #F0B610",
+"y<    c #EFBF18",
+"z<    c #EFBF19",
+"A<    c #F7C113",
+"B<    c #ECBC10",
+"C<    c #F7C311",
+"D<    c #F4C413",
+"E<    c #ECB70E",
+"F<    c #F5C215",
+"G<    c #F5C30F",
+"H<    c #F0C110",
+"I<    c #F4C213",
+"J<    c #F7BE0D",
+"K<    c #EBB80B",
+"L<    c #E8BA0A",
+"M<    c #E5BE09",
+"N<    c #DCA90B",
+"O<    c #C58A0A",
+"P<    c #9C6B08",
+"Q<    c #8A7A56",
+"R<    c #060603",
+"S<    c #422D06",
+"T<    c #7D5406",
+"U<    c #C78D09",
+"V<    c #D19906",
+"W<    c #DEA407",
+"X<    c #E6AE0B",
+"Y<    c #EEB50B",
+"Z<    c #F1C410",
+"`<    c #F0BB0D",
+" [    c #F1BB14",
+".[    c #EFBB0C",
+"+[    c #EDB80D",
+"@[    c #F7C31A",
+"#[    c #F5C00D",
+"$[    c #F3BF12",
+"%[    c #F2C414",
+"&[    c #EDBA15",
+"*[    c #F3BC11",
+"=[    c #EAA911",
+"-[    c #DA980F",
+";[    c #D2950D",
+">[    c #DB9D0C",
+",[    c #E9AE0D",
+"'[    c #F3BC0C",
+")[    c #F5BD10",
+"![    c #EDBC0D",
+"~[    c #F2BF11",
+"{[    c #EBB910",
+"][    c #F0C010",
+"^[    c #F2C00C",
+"/[    c #F3BD0D",
+"([    c #F4BB0E",
+"_[    c #E8B30A",
+":[    c #E4B30A",
+"<[    c #E1B409",
+"[[    c #D7A60A",
+"}[    c #CD9609",
+"|[    c #A47208",
+"1[    c #63450B",
+"2[    c #9B8E7B",
+"3[    c #F0EEEB",
+"4[    c #0C0903",
+"5[    c #442F06",
+"6[    c #835806",
+"7[    c #AE7A08",
+"8[    c #D59C08",
+"9[    c #DFA509",
+"0[    c #F4B90B",
+"a[    c #EDBE11",
+"b[    c #EABC0D",
+"c[    c #F3C014",
+"d[    c #F4C013",
+"e[    c #EFB90B",
+"f[    c #F0BE11",
+"g[    c #EEBF15",
+"h[    c #F7BF11",
+"i[    c #EFBA17",
+"j[    c #EBB211",
+"k[    c #DFA10E",
+"l[    c #AB780C",
+"m[    c #674905",
+"n[    c #D7940F",
+"o[    c #D9980F",
+"p[    c #DE9F08",
+"q[    c #E2AA0B",
+"r[    c #F6B710",
+"s[    c #F6B80E",
+"t[    c #F5BB12",
+"u[    c #F2C30F",
+"v[    c #F0BD10",
+"w[    c #EEBB15",
+"x[    c #ECBC14",
+"y[    c #F4BD0E",
+"z[    c #F4BD18",
+"A[    c #F2BA0A",
+"B[    c #EEB60D",
+"C[    c #E9B209",
+"D[    c #E5B00A",
+"E[    c #DBAB0A",
+"F[    c #D7A208",
+"G[    c #D29A0A",
+"H[    c #B67D09",
+"I[    c #7C5606",
+"J[    c #482F08",
+"K[    c #2C2A24",
+"L[    c #EAEAEB",
+"M[    c #4B3206",
+"N[    c #855906",
+"O[    c #B77F09",
+"P[    c #C78F0A",
+"Q[    c #D59907",
+"R[    c #ECB50C",
+"S[    c #F1C00F",
+"T[    c #F2C313",
+"U[    c #EEBA13",
+"V[    c #ECB813",
+"W[    c #F2C510",
+"X[    c #F1C413",
+"Y[    c #F7C00D",
+"Z[    c #E3AA10",
+"`[    c #EBAD0D",
+" }    c #E4A40F",
+".}    c #9B6D0A",
+"+}    c #DC9E06",
+"@}    c #E0A209",
+"#}    c #ECB30B",
+"$}    c #EAB40A",
+"%}    c #ECB50B",
+"&}    c #F4B60F",
+"*}    c #F6BD0D",
+"=}    c #EEB90E",
+"-}    c #EFB810",
+";}    c #F3C20D",
+">}    c #F0BA0B",
+",}    c #F6BE0F",
+"'}    c #F2B90D",
+")}    c #F1C00E",
+"!}    c #F0BE0E",
+"~}    c #F8BD0D",
+"{}    c #F3BB10",
+"]}    c #E3AD09",
+"^}    c #DEA509",
+"/}    c #D69F07",
+"(}    c #CE950A",
+"_}    c #BC8309",
+":}    c #926208",
+"<}    c #5C3E05",
+"[}    c #161004",
+"}}    c #8F8F8E",
+"|}    c #19140B",
+"1}    c #563706",
+"2}    c #8A5F06",
+"3}    c #B58008",
+"4}    c #D69B06",
+"5}    c #F0B50C",
+"6}    c #F4BA0C",
+"7}    c #EEBA0F",
+"8}    c #F7C118",
+"9}    c #EEBA0D",
+"0}    c #F1C416",
+"a}    c #F7C312",
+"b}    c #EEBC13",
+"c}    c #EDB710",
+"d}    c #DA9A0D",
+"e}    c #795508",
+"f}    c #D6970E",
+"g}    c #D89A0D",
+"h}    c #D89E09",
+"i}    c #E2A60A",
+"j}    c #E2AC0A",
+"k}    c #ECB40B",
+"l}    c #F2B60C",
+"m}    c #F3B90C",
+"n}    c #F7C213",
+"o}    c #F6C310",
+"p}    c #F0B60A",
+"q}    c #F3C214",
+"r}    c #F5BC11",
+"s}    c #E9B810",
+"t}    c #F1BF0E",
+"u}    c #F2BE0D",
+"v}    c #E8B20A",
+"w}    c #D79E08",
+"x}    c #CD940A",
+"y}    c #C08609",
+"z}    c #A26C08",
+"A}    c #654206",
+"B}    c #261B08",
+"C}    c #474748",
+"D}    c #4F4F50",
+"E}    c #2E1F05",
+"F}    c #604006",
+"G}    c #8E6007",
+"H}    c #C9900A",
+"I}    c #DEA709",
+"J}    c #F3B90B",
+"K}    c #EDBB0E",
+"L}    c #EEB710",
+"M}    c #F7BA10",
+"N}    c #ECB614",
+"O}    c #ECB20E",
+"P}    c #E2A610",
+"Q}    c #DC9C0B",
+"R}    c #D8970C",
+"S}    c #7A5608",
+"T}    c #D99710",
+"U}    c #D5960D",
+"V}    c #D79A0A",
+"W}    c #D69A0D",
+"X}    c #D79A07",
+"Y}    c #DA9F08",
+"Z}    c #DFA209",
+"`}    c #E8AE0C",
+" |    c #EEB20E",
+".|    c #F0B70B",
+"+|    c #F0B510",
+"@|    c #F2B70B",
+"#|    c #F5BA0F",
+"$|    c #F6BC0C",
+"%|    c #EFBB13",
+"&|    c #EFBE0D",
+"*|    c #D7A007",
+"=|    c #A06E08",
+"-|    c #714C06",
+";|    c #372506",
+">|    c #392405",
+",|    c #916308",
+"'|    c #B88009",
+")|    c #C88F0A",
+"!|    c #DEA209",
+"~|    c #E3A90A",
+"{|    c #F6BB0F",
+"]|    c #ECBF12",
+"^|    c #EDBE10",
+"/|    c #F3C20E",
+"(|    c #F3C215",
+"_|    c #EEBA12",
+":|    c #F0B910",
+"<|    c #F0C111",
+"[|    c #F7BA0E",
+"}|    c #F4BB0F",
+"||    c #EFB410",
+"1|    c #EDB30E",
+"2|    c #E3A60E",
+"3|    c #D39911",
+"4|    c #C08810",
+"5|    c #A4720A",
+"6|    c #D0930B",
+"7|    c #D2930C",
+"8|    c #D09308",
+"9|    c #D09209",
+"0|    c #D29808",
+"a|    c #D69E09",
+"b|    c #D89C08",
+"c|    c #DAA008",
+"d|    c #DCA009",
+"e|    c #E0A70A",
+"f|    c #DFA70B",
+"g|    c #E4AB0A",
+"h|    c #ECB20D",
+"i|    c #EEB20D",
+"j|    c #F1B40E",
+"k|    c #F4B70F",
+"l|    c #F6BC11",
+"m|    c #EEB90C",
+"n|    c #F1BA11",
+"o|    c #EDBA0E",
+"p|    c #F0BF16",
+"q|    c #F4BC11",
+"r|    c #F2B80E",
+"s|    c #D49C07",
+"t|    c #C18B0B",
+"u|    c #B37A09",
+"v|    c #9A6708",
+"w|    c #7A4D06",
+"x|    c #503607",
+"y|    c #130D03",
+"z|    c #392804",
+"A|    c #6C4505",
+"B|    c #986208",
+"C|    c #B47A09",
+"D|    c #D89F06",
+"E|    c #ECB30A",
+"F|    c #F2BB0D",
+"G|    c #F4B90E",
+"H|    c #F0BB0E",
+"I|    c #F5BD12",
+"J|    c #F1BC0A",
+"K|    c #ECBB12",
+"L|    c #F8BC0F",
+"M|    c #F2BC12",
+"N|    c #F3B811",
+"O|    c #EDB40F",
+"P|    c #EEB410",
+"Q|    c #EEB20F",
+"R|    c #EFB20F",
+"S|    c #E3A80D",
+"T|    c #D9990E",
+"U|    c #CB8B0F",
+"V|    c #BB8512",
+"W|    c #C5890C",
+"X|    c #CD8D0A",
+"Y|    c #C4890A",
+"Z|    c #C18609",
+"`|    c #C68A09",
+" 1    c #CC8E09",
+".1    c #CC910A",
+"+1    c #CE900A",
+"@1    c #CE960A",
+"#1    c #D69809",
+"$1    c #D69906",
+"%1    c #DA9C07",
+"&1    c #D89E08",
+"*1    c #DCA20A",
+"=1    c #E0AB0B",
+"-1    c #E5AD0A",
+";1    c #E9AF0B",
+">1    c #E9AF0C",
+",1    c #ECB10E",
+"'1    c #F4BA11",
+")1    c #F2BE0F",
+"!1    c #F3BD0F",
+"~1    c #F5BB11",
+"{1    c #E2A609",
+"]1    c #CC930A",
+"^1    c #BC8009",
+"/1    c #AC7409",
+"(1    c #986608",
+"_1    c #7C5205",
+":1    c #5B3C06",
+"<1    c #161003",
+"[1    c #382406",
+"}1    c #694206",
+"|1    c #8E5C07",
+"11    c #AE7309",
+"21    c #C38709",
+"31    c #CB9009",
+"41    c #D49B08",
+"51    c #DBA109",
+"61    c #F5BA10",
+"71    c #EBBA16",
+"81    c #F6BC12",
+"91    c #F6BA0F",
+"01    c #F2BA12",
+"a1    c #EFB60E",
+"b1    c #E9B20B",
+"c1    c #E6AA0C",
+"d1    c #DFA409",
+"e1    c #DDA20D",
+"f1    c #D8990E",
+"g1    c #D3930E",
+"h1    c #BB800F",
+"i1    c #815A0C",
+"j1    c #9B6F08",
+"k1    c #AB7108",
+"l1    c #B27A08",
+"m1    c #B67D0D",
+"n1    c #B87E08",
+"o1    c #BC8209",
+"p1    c #C28609",
+"q1    c #C88A09",
+"r1    c #CA8A09",
+"s1    c #CC900A",
+"t1    c #CE940A",
+"u1    c #D0940A",
+"v1    c #D0970A",
+"w1    c #D49A07",
+"x1    c #D89A04",
+"y1    c #DCA208",
+"z1    c #E3AA08",
+"A1    c #E7AD0B",
+"B1    c #F5B60E",
+"C1    c #F0B80F",
+"D1    c #D9A106",
+"E1    c #CE9709",
+"F1    c #C18909",
+"G1    c #B17A09",
+"H1    c #A96F09",
+"I1    c #8F5E07",
+"J1    c #7B5305",
+"K1    c #593B05",
+"L1    c #140E03",
+"M1    c #382705",
+"N1    c #5E3D06",
+"O1    c #835506",
+"P1    c #AB7109",
+"Q1    c #BA7D09",
+"R1    c #DCA108",
+"S1    c #ECB10C",
+"T1    c #EAB40B",
+"U1    c #F4B710",
+"V1    c #F4B70E",
+"W1    c #F4B70D",
+"X1    c #F0B70D",
+"Y1    c #ECB20B",
+"Z1    c #E5A80B",
+"`1    c #DDA208",
+" 2    c #D59C09",
+".2    c #CE8F0F",
+"+2    c #BF830B",
+"@2    c #A17008",
+"#2    c #583D05",
+"$2    c #4E350E",
+"%2    c #8E6411",
+"&2    c #956609",
+"*2    c #9B6708",
+"=2    c #A06E11",
+"-2    c #A86E09",
+";2    c #AD7508",
+">2    c #B87C09",
+",2    c #C3860B",
+"'2    c #C1870B",
+")2    c #C48809",
+"!2    c #C58B0A",
+"~2    c #C8880A",
+"{2    c #CC940A",
+"]2    c #D09607",
+"^2    c #D2990A",
+"/2    c #DCA006",
+"(2    c #DDA507",
+"_2    c #EFB40F",
+":2    c #E7B00B",
+"<2    c #E3AA0A",
+"[2    c #DA9F05",
+"}2    c #CD9309",
+"|2    c #BF890B",
+"12    c #B87B09",
+"22    c #A97109",
+"32    c #9D6609",
+"42    c #8A5906",
+"52    c #6C4706",
+"62    c #4E3505",
+"72    c #352107",
+"82    c #583806",
+"92    c #7D4F06",
+"02    c #A06C08",
+"a2    c #CB9109",
+"b2    c #D69B07",
+"c2    c #DBA108",
+"d2    c #DFA208",
+"e2    c #DDA508",
+"f2    c #DBA007",
+"g2    c #DA9C06",
+"h2    c #D69909",
+"i2    c #D1920B",
+"j2    c #CA8A0B",
+"k2    c #C3850A",
+"l2    c #B67C0D",
+"m2    c #8D6008",
+"n2    c #4B3304",
+"o2    c #4B3305",
+"p2    c #6D4E0F",
+"q2    c #936612",
+"r2    c #976808",
+"s2    c #A77009",
+"t2    c #AE7809",
+"u2    c #AF7609",
+"v2    c #AF7809",
+"w2    c #B27809",
+"x2    c #B27A09",
+"y2    c #C08109",
+"z2    c #C08409",
+"A2    c #C68D09",
+"B2    c #D39A09",
+"C2    c #D9A008",
+"D2    c #E4A909",
+"E2    c #E5AC0E",
+"F2    c #E7AD0D",
+"G2    c #EAAE0C",
+"H2    c #DAA007",
+"I2    c #D49C09",
+"J2    c #BD8309",
+"K2    c #AA7209",
+"L2    c #A16908",
+"M2    c #906008",
+"N2    c #7B4E06",
+"O2    c #644106",
+"P2    c #493105",
+"Q2    c #2D2006",
+"R2    c #4F3506",
+"S2    c #946207",
+"T2    c #AB7409",
+"U2    c #B87A09",
+"V2    c #BB7D09",
+"W2    c #C68B09",
+"X2    c #CB8E09",
+"Y2    c #D19708",
+"Z2    c #D69D09",
+"`2    c #DB9E06",
+" 3    c #E0A409",
+".3    c #DE9F06",
+"+3    c #DCA007",
+"@3    c #D49806",
+"#3    c #C98F09",
+"$3    c #C68909",
+"%3    c #BD7F09",
+"&3    c #9B6E0C",
+"*3    c #6B4B08",
+"=3    c #4A3204",
+"-3    c #775107",
+";3    c #835707",
+">3    c #916107",
+",3    c #A26E09",
+"'3    c #A36C08",
+")3    c #A87109",
+"!3    c #A66F09",
+"~3    c #A97409",
+"{3    c #AB7609",
+"]3    c #B07A08",
+"^3    c #B07D08",
+"/3    c #B37909",
+"(3    c #BD8209",
+"_3    c #C3870A",
+":3    c #CE9409",
+"<3    c #D69D07",
+"[3    c #D7A006",
+"}3    c #D59B08",
+"|3    c #CF9709",
+"13    c #C9910A",
+"23    c #C28B0B",
+"33    c #BC8109",
+"43    c #B27909",
+"53    c #A26A09",
+"63    c #915F07",
+"73    c #835406",
+"83    c #704906",
+"93    c #352305",
+"03    c #221607",
+"a3    c #4E3206",
+"b3    c #6E4406",
+"c3    c #8D5C07",
+"d3    c #A66E09",
+"e3    c #AE7609",
+"f3    c #B87D08",
+"g3    c #BB7F09",
+"h3    c #C58B09",
+"i3    c #CC9109",
+"j3    c #CD950A",
+"k3    c #D1980A",
+"l3    c #D49906",
+"m3    c #D39B09",
+"n3    c #CC920A",
+"o3    c #C38609",
+"p3    c #A26F08",
+"q3    c #7C5407",
+"r3    c #3C2904",
+"s3    c #362403",
+"t3    c #6B4705",
+"u3    c #855A07",
+"v3    c #8C5F07",
+"w3    c #966408",
+"x3    c #9D6A08",
+"y3    c #9E6C08",
+"z3    c #A46E09",
+"A3    c #A67209",
+"B3    c #A77109",
+"C3    c #B67A08",
+"D3    c #B98008",
+"E3    c #C48C0A",
+"F3    c #C68F0B",
+"G3    c #C58C09",
+"H3    c #C2890B",
+"I3    c #BD8409",
+"J3    c #B37809",
+"K3    c #AC7209",
+"L3    c #9B6608",
+"M3    c #845506",
+"N3    c #744A05",
+"O3    c #603F06",
+"P3    c #452E06",
+"Q3    c #120D04",
+"R3    c #150F02",
+"S3    c #452D05",
+"T3    c #674005",
+"U3    c #845606",
+"V3    c #9E6409",
+"W3    c #A76E09",
+"X3    c #B97C09",
+"Y3    c #BE820A",
+"Z3    c #C18509",
+"`3    c #C48C0B",
+" 4    c #CA8D09",
+".4    c #C68C09",
+"+4    c #C08309",
+"@4    c #BA800A",
+"#4    c #795106",
+"$4    c #211803",
+"%4    c #251904",
+"&4    c #412C0D",
+"*4    c #5C3F05",
+"=4    c #6B4906",
+"-4    c #7F5406",
+";4    c #885A07",
+">4    c #8F5F07",
+",4    c #A16C08",
+"'4    c #AA7509",
+")4    c #B47E08",
+"!4    c #B57B08",
+"~4    c #AC7809",
+"{4    c #AD7509",
+"]4    c #A16A08",
+"^4    c #905D07",
+"/4    c #815306",
+"(4    c #764906",
+"_4    c #523606",
+":4    c #2E1E05",
+"<4    c #453006",
+"[4    c #563A05",
+"}4    c #784E06",
+"|4    c #8B5C06",
+"14    c #A16809",
+"24    c #AA7009",
+"34    c #AA7109",
+"44    c #AF7909",
+"54    c #BC7F0A",
+"64    c #BD8109",
+"74    c #B97D09",
+"84    c #AB7509",
+"94    c #A26B09",
+"04    c #8A5C07",
+"a4    c #6C4B17",
+"b4    c #221803",
+"c4    c #342503",
+"d4    c #503408",
+"e4    c #644506",
+"f4    c #775110",
+"g4    c #926107",
+"h4    c #976608",
+"i4    c #A26D09",
+"j4    c #A66D09",
+"k4    c #A57009",
+"l4    c #A56E09",
+"m4    c #A56C09",
+"n4    c #9D6708",
+"o4    c #9A6508",
+"p4    c #926007",
+"q4    c #855706",
+"r4    c #815205",
+"s4    c #744706",
+"t4    c #4E3305",
+"u4    c #3B2507",
+"v4    c #4C3106",
+"w4    c #643F05",
+"x4    c #7C4E05",
+"y4    c #8E5D07",
+"z4    c #A06509",
+"A4    c #AC7609",
+"B4    c #B17B08",
+"C4    c #B37D08",
+"D4    c #B47C08",
+"E4    c #B17909",
+"F4    c #A36C09",
+"G4    c #966307",
+"H4    c #573B10",
+"I4    c #291A04",
+"J4    c #543907",
+"K4    c #724F06",
+"L4    c #895906",
+"M4    c #906208",
+"N4    c #956308",
+"O4    c #926207",
+"P4    c #966608",
+"Q4    c #936408",
+"R4    c #875806",
+"S4    c #825206",
+"T4    c #794D06",
+"U4    c #6F4805",
+"V4    c #614105",
+"W4    c #3C2707",
+"X4    c #271A03",
+"Y4    c #432B06",
+"Z4    c #4D3205",
+"`4    c #644005",
+" 5    c #784C06",
+".5    c #855806",
+"+5    c #916007",
+"@5    c #A76F09",
+"#5    c #A87009",
+"$5    c #AB7209",
+"%5    c #A97209",
+"&5    c #966407",
+"*5    c #845906",
+"=5    c #794F06",
+"-5    c #5A3B08",
+";5    c #241A03",
+">5    c #4E3506",
+",5    c #593D06",
+"'5    c #6C4705",
+")5    c #7B5006",
+"!5    c #7F5106",
+"~5    c #815406",
+"{5    c #7C4F06",
+"]5    c #784D05",
+"^5    c #734A05",
+"/5    c #674206",
+"(5    c #5C3C06",
+"_5    c #493005",
+":5    c #392805",
+"<5    c #3E2A07",
+"[5    c #462D06",
+"}5    c #523605",
+"|5    c #664206",
+"15    c #784D06",
+"25    c #855907",
+"35    c #8C5D07",
+"45    c #956407",
+"55    c #8E5E07",
+"65    c #895A07",
+"75    c #7E5106",
+"85    c #6E4906",
+"95    c #623F06",
+"05    c #503913",
+"a5    c #362605",
+"b5    c #4D3406",
+"c5    c #503606",
+"d5    c #6D4806",
+"e5    c #6E4806",
+"f5    c #624106",
+"g5    c #5F3E05",
+"h5    c #563705",
+"i5    c #402C06",
+"j5    c #2A1A05",
+"k5    c #3D2706",
+"l5    c #402808",
+"m5    c #432E05",
+"n5    c #513505",
+"o5    c #5B3B05",
+"p5    c #694506",
+"q5    c #6D4606",
+"r5    c #6E4606",
+"s5    c #603F05",
+"t5    c #553806",
+"u5    c #422B0B",
+"v5    c #241A05",
+"w5    c #211703",
+"x5    c #402D06",
+"y5    c #412E06",
+"z5    c #3C2907",
+"A5    c #3C2906",
+"B5    c #1F1504",
+"C5    c #2C1E04",
+"D5    c #412A07",
+"E5    c #412B06",
+"F5    c #402B06",
+"G5    c #442E06",
+"H5    c #422C07",
+"I5    c #422A07",
+"J5    c #231803",
+"K5    c #1D1206",
+"                                                                                                                  . . . . . . . . . . . .                                                                                                                       ",
+"                                                                                                            . . . + . . . + . . . + . . . + . .                                                                                                                 ",
+"                                                                                                        . . . . + . . . . . . . + . . . . . . . + . .                                                                                                           ",
+"                                                                                                    @ . . . . . . . . . . . . . . . . . . . . . . . # $                                                                                                         ",
+"                                                                                                  # . . . . + . . . . . . . + . . . . . . . + + + + . . . .                                                                                                     ",
+"                                                                                                . + . . . + . . . + . . . + . . . + . . . @ % & * = @ + . + .                                                                                                   ",
+"                                                                                              . . . . . + . . . . . . . + . . . . . . . - ; > , ' ) ! ~ @ + . .                                                                                                 ",
+"                                                                                            . . . . . . . . . . . . . . . . . . . . . . @ { ] ^ / ( _ : < [ + . .                                                                                               ",
+"                                                                                          . . . . . + . . . . . . . + . . . . . . . . . } | 1 2 3 4 5 6 7 8 9 . . .                                                                                             ",
+"                                                                                        . + . . . + . . . + . . . . . . . . . . . . . . + 0 a b c d e f g h i 9 . . .                                                                                           ",
+"                                                                                        . . . . + . . . . . . . . . . . . . . . . . . . - j k l m n o p q r s t + . .                                                                                           ",
+"                                                                                      . . . . . . . . . . . . . . . . . . . . . . . . . u v k w x y z A B C D E + . . .                                                                                         ",
+"                                                                                      . . . . . . . . . . . . . . . . . . . . . . . . . 9 F G H I J K L M N 0 . . . . @                                                                                         ",
+"                                                                                      . . . . . . . . . . . . . . . . . . . . . . . . . O j P Q R M O + . . . . . . . . .                                                                                       ",
+"                                                                                    . . . . . . . . . . . . . . . . . . . . . . . . . . } S M N } . . . . . . . . . . . . @                                                                                     ",
+"                                                                                    . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ . . . . . . . . . . . . . . #                                                                                     ",
+"                                                                                    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                                     ",
+"                                                                                    . . . . . . . . . . . . . . . . . . . . . . . . . . u + + . . . . . . . . . . . . . . . .                                                                                   ",
+"                                                                                    . . . . . . + - T U ; @ . . . . . . . . . . . . . @ 0 0 V W X } + . . . . . . . . . . . .                                                                                   ",
+"                                                                                    . . . . + 9 Y j Z `  ...9 . . . . . . . . @ u + . . . . S +.@.#.$.%.. . . . . . . . . . .                                                                                   ",
+"                                                                                    . . . . 9 &.[ } @ N *.=.-.} . . . . . . + O + . + [ ..;.>.S @ h x ,.@ . . . . . . . . . .                                                                                   ",
+"                                                                                    . . . + t @ '.).>.!.~.{.].^.@ . . . . @ 9 . . E /.(._.:.<.[.f }.|.1.2.- . . . . . . . . . .                                                                                 ",
+"                                                                                    . . . . + |.3.4.5.:.2 } /.6.j . . . . '.@ . 0 7.8.9.0.a.b.c.d.e.f.g.r h.. . . . . . . . . .                                                                                 ",
+"                                                                                    . . . + i.j.k.l.m.n.o.p.~.q.r.. . . + '.. s.t.u.v.w.c.x.y.z.A.B.x C.D.E.- . . . . . . . . .                                                                                 ",
+"                                                                                    . . . %.F.G.H.I.J.K.L.M.N.Y O.- . . + + @ P.8.c.Q.R.z.S.T.U.R.V.W.X.. Y.@ . . . . . . . . .                                                                                 ",
+"                                                                                    . . . Z.`. +.+++@+#+$+%+&+*+. . . . @ . > d =+-+;+>+,+,+,+'+)+!+W.~+9 . . . . . . . . . . .                                                                                 ",
+"                                                                                    . . . {+]+^+/+(+#+_+>+,+-+:+. . . + u . 2 <+[+,+,+;+}+0.|+'+,+1+2+3+4+. . . . . . . . . . .                                                                                 ",
+"                                                                                    5+. . 6+7+;+8+9+h 0+a+,+,+b+c++ . t %.. d+T.e+>+f+g+h+}.i+j+^+k+l+m+P.. . . . . . . . . . .                                                                                 ",
+"                                                                                    n+. . o+p+q+- '.r+s+t+}+>+)+B Y @ u+} . v+w+k+,+x++ . /.y+z+A+B+,+l+C+@ . . . . . . . . . .                                                                                 ",
+"                                                                                    . . . D+E+F+. + z G+g.H+,+f+I+J+).X.{.%.K+p+>+L+M+. . + N+O+>.P+k+>+Q+C . . . . . . . . . .                                                                                 ",
+"                                                                                    . . . R+S+T+. . }.<.U+G+>+p+V+W+^.N+X+P 3 Y+>+Z+. . . . f.`+S  @k+,+.@I+. . . . . . . . . .                                                                                 ",
+"                                                                                    . . . +@|+@@#@. $@%@&@*@=@-@;@%.9 . '.-.>@,@'@)@. . . . . . . !@1+>+#+I+. . . . . . . . . .                                                                                 ",
+"                                                                                    . . . /.~@{@E . + 9+9+*@]@^@/@(@_@:@<@[@}@|@1@=+. . . . . . . !@1+,+.@I+. . . . . . . . . .                                                                                 ",
+"                                                                                    . . . . 2@z.-.+ + + + 3@4@5@6@7@8@9@0@a@b@c@d@e@+ . . . . . . f@g@>+#+I+. . . . . . . . . .                                                                                 ",
+"                                                                                    . . . . h@i@j@Z.+ k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@. . . . {.=+,+,+B@9+. . . . . . . . . .                                                                                 ",
+"                                                                                    . . . . h S._+C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@S@T@U@V@W@&.z L+,+>+/+X@. . . . . . . . . . . .                                                                               ",
+"                                                                                    . . . . f.Y@>+Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#l+_#. . . . . . . . . . . . .                                                                               ",
+"                                                                                      . . . . :#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#+ . . . . . . . . . . . .                                                                               ",
+"                                                                                      . . . + o#p#q#r#s#t#u#v#w#5#x#y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#+ . . . . . . . . . . R#                                                                              ",
+"                                                                                      . . S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>$h#,$I#J#'$)$!$~${$]$^$. . . . . . . . . . .                                                                               ",
+"                                                                                      . . /$($_$:$<$[$}$|$1$2$3$4$5$6$7$8$9$0$a$b$G#c$d$e$e$g#K#f$g$h$i$j$k$. . . . . . . . . . n+                                                                              ",
+"                                                                                      . . l$m$n$o$p$q$r$s$t$u$v$w$x$y$7$z$A$B$C$D$K#K#g#K#K#,$E$F$G$H$I$J$K$. . . . . . . . . . .                                                                               ",
+"                                                                                      . . L$M$N$O$P$Q$R$S$T$U$V$5$W$X$Y$Z$`$ %.%+%g#J#@%J##%$%%%&%*%=%-%;%>%. . . . . . . . . . .                                                                               ",
+"                                                                                      . . ,%'%)%!%~%{%]%^%/%(%_%:%<%[%}%|%b$1%h#g#,$J#f$2%3%4%5%6%7%8%9%0%a%. . . . . . . . . . . .                                                                             ",
+"                                                                                      . . b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%+%t%u%v%w%x%y%z%A%B%C%D%E%F%D.. . . r.G%9 . . . . . .                                                                             ",
+"                                                                                      . . . H%I%J%K%L%M%N%O%P%Q%R%S%T%U%)$e$e$V%W%X%Y%Z%`% &C%.&+&@&#&$&%&. . . . #.&&*&r.. . . . .                                                                             ",
+"                                                                                      . . . =&-&;&>&,&'&)&!&~&{&]&^&/&D$(&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&+ . . . a&b&c&d&2 g.+ . . .                                                                           ",
+"                                                                                      . . + e&f&g&h&>&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z&A&B&C&D&E&F&G&H&I&. . . J&K&L&M&M&N&'.. . . .                                                                         ",
+"                                                                                      . . O&P&Q&R&S&T&U&V&W&X&Y&Z&`& *.*+*@*#*$*%*&***=*-*;*>*,*'*)*!*m.~*I+. . . . {*L&_.b&]*^*[ . . .                                                                         ",
+"                                                                                      . . @ /*(*m._*:*<*[*}*|*1*2*3*4*5*6*7*8*9*0*a*b*c*d*e*f*g*h*++J.y.i*{@'.. . . h X@j*_.b&t.k*. . . .                                                                       ",
+"                                                                                      . . . m ~*m.i*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*A*B*C*D*E*m.Q.F*E+Q+G*m.!*&@. . . . H*I*J*m +@+ . . . .                                                                       ",
+"                                                                                      . . . K*L*m.Q.M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=L*@=K.z./+,+,+#=}+J.$=9 . . . S %=&=*=9 . . . . . .                                                                     ",
+"                                                                                    . . . . ==-=~@~@@=;=>=,='=)=!=~={=]=^=/=(=_=:=<=[=}=|=~@^+[+,+>+>+l+,+B+I.+@. . . . . . . . . . . . . 1=                                                                    ",
+"                                                                                    . . . . 2=3=)+^+G*m.4=5=6=7=8=9=0=a=b=c=d=e=f=g=h=!*i=j=k=>+,+,+>+k+,+l=m=8+[ . . . . . . . . . . . . n=o=                                                                  ",
+"                                                                                  . . . . . p=#+1+m=z.Q.q=|=r=s=t=u=v=w=x=y=z=A=B=C=D=2+Q+.@;+>+l+>+l+,+>+>+k+E= .@ . . . . . . . . . . . . F=                                                                  ",
+"                                                                                G=9 + . . S w.,+=@.@H=!*y.y.I=J=!*K=Q.m.y.Q.m.m.L=z.M=B+#+=@,+>+,+>+k+,+,+,+k+#=N=t @ . . . . . . . . . . . &.O=                                                                ",
+"                                                                              f.P=Q=; + . R=S=,+>+;+_+A.m.m.Q.Q.T=|=m.m.Q.m.y.~@U=V=#+g@k+,+,+l+>+l+,+>+k+>+>+>+m=W=. . . . . . . . . . . . @ X=-                                                               ",
+"                                                                              Y=I&Z=h.@ P .+=@,+>+>+,+k=I.m.Q.m.m.Q.m.y.m.Q.R.-@#+'+l=>+>+>+>+l+>+k+,+,+l+,+,+,+/+`=S . . . . . . . . . . . . @ +                                                               ",
+"                                                                            . [ N M [ 0  -'@,+>+>+>+,+,+.-y.m.Q.m.m.y.m.Q.+-@-g@>+>+>+,+>+>+,+>+>+,+k+>+>+>+,+>+>+#- .. . . . . . . . . . . . . . .                                                             ",
+"                                                                          . . . - } S z+@-k+,+>+>+>+,+,+=@++G*~*Q.m.Q.I.^+$-;+k+,+>+,+>+>+,+,+>+,+l+,+,+>+>+,+>+,+_+p.+ . . . . . . . . . . . . . . .                                                           ",
+"                                                                        . . . . . . %-h*k+,+>+>+>+,+,+>+>+k+[+)+&-.-m+@-g@,+>+,+>+>+,+>+>+,+>+>+k+>+,+>+,+k+>+>+>+>+*-'.. . . . . . . . . . . . . . .                                                           ",
+"                                                                        . . . . . '.=-e+>+,+>+>+>+>+l+>+,+>+>+g@1+_+;+>+>+>+>+,+>+,+>+>+>+,+>+,+,+,+,+>+>+,+>+,+>+>+--;-. . . . . . . . . . . . . . . .                                                         ",
+"                                                                      . . . . . . M+B+>+,+>+>+,+,+>+>+>+k+l+>+l=k+,+>+,+,+>+,+>+>+,+>+>+>+,+,+k+,+>+>+,+>+,+,+>+>+,+l=:.} . . . . . . . . . . . . . . . .                                                       ",
+"                                                                      . . . . . |.>-;+>+,+>+>+,+>+,+>+>+,+,+>+,+>+>+,+>+>+>+,+>+,+>+>+>+>+,+,+>+,+>+,+>+>+,+>+>+>+,+>+,-'-. . . . . . . . . . . . . . . . .                                                     ",
+"                                                                    . . . . . . k )-#=,+>+>+>+>+,+,+>+>+>+>+>+,+>+,+>+,+>+,+>+>+,+>+>+>+>+,+>+,+,+>+>+>+,+,+>+>+,+>+>+|+!-. . . . . . . . . . . . . . . . . .                                                   ",
+"                                                                  . . . . . . ~-:.p+'+,+>+,+k+l+k+l+>+l+,+>+,+>+>+,+>+>+>+,+>+,+>+>+>+>+>+>+>+>+>+>+>+,+,+>+>+>+>+,+k+/+X@. . . . . . . . . . . . . . . . . .                                                   ",
+"                                                                . . . . . . . 9+{-|+=@>+>+,+>+,+,+>+>+>+>+>+,+>+,+k+,+>+,+>+>+,+>+>+>+>+>+>+,+,+>+>+>+k+,+,+k+#=;+>+>+e+]-^-. . . . . . . . . . . . . . . . . .                                                 ",
+"                                                              . . . . . . . + /-(-~*#+>+,+>+>+>+,+>+l+,+>+,+k+k+g@'+k+>+,+>+,+>+>+>+>+>+,+,+k+,+,+>+,+>+l==@_-:-:-_+=@/+V=*=. . . . . . . . . . . . . . . . . . .                                               ",
+"                                                            . . . . . . . . S <-[-l.A.#+=@k+>+,+>+>+>+>+;+'@(+[+(+-+.@/+=@>+,+>+>+>+>+>+,+;+}-/+k=1+(+$-@-|-E+.-^+M=@+e+'+1-. . . . . . . . . . . . . . . . . . .                                               ",
+"                                                            . . . . . . . . -./*2-3-4-5-p+.@k==@,+,+,+>+l=_+:-a+a+$-.@k=#=,+>+>+>+,+>+>+=@:-6-.-7-A.8-9-G*8-J.~@~@I.z.-+l=0-a-. . . . . . . . . . . . . . . . . . .                                             ",
+"                                                          . . . . . . . . + i+b-c-d-e-f-)-g-#+=@>+>+>+>+,+>+h-B@i-#=>+,+>+,+>+>+>+>+l+,+>+/+k=B@Q+j-8-)*)*~*I.I.I.~@)*7-k=,+k-9 . . f.> l-- . . . . . . . . . . . . .                                           ",
+"                                                          . . . . . . . . - X@c-m-n-j-L+/+=@k+>+>+l+>+,+>+>+l=(+e+>+,+>+,+>+>+>+>+,+k+k+l+l+>+;+e+o-L+)+p-7-q-)*~*I.~@~*Y+#=-@] . . f.1.r-s-t-@ . . . . . . . . . . .                                           ",
+"                                                        . . . . . . . . . j u-v-Q.m+_+l=l+>+>+>+>+>+>+,+>+,+#=[+l=,+,+>+,+>+>+>+>+,+l+,+,+,+,+,+l+,+>+=@}-w-B+p-2+8-~@I.z.:-,+x-9 . . C.P 7 y-L } . . . . . . . . . . .                                         ",
+"                                                        . . . . + O&; . . A+z-L*@-=@>+>+,+>+>+>+l+>+,+>+>+,+>+#=k+,+>+,+>+>+>+>+,+>+>+,+,+,+>+k+>+>+,+,+,+>+l=/+-+A-A.)*~@H=/+@+B-. . . . Y C-D-E-9 . . . . . . . . . .                                         ",
+"                                                        . . . + }.F-G-. 9 H-Q.m==@k+>+,+,+>+>+>+>+>+,+>+,+>+,+>+,+,+>+,+>+>+>+,+k+l+,+,+,+,+,+,+,+>+,+,+>+,+l+>+l='+-+Q+q-)*Q+;+I-9 . . . + - J-g J++ . . . . . . . . . .                                       ",
+"                                                      . . . . Z.K-}.@ . {.n.a+e+>+,+>+,+>+>+>+l+>+,+>+>+,+>+>+>+,+>+,+>+>+>+,+,+>+>+l+,+,+>+k+,+k+,+k+>+>+,+>+,+>+,+k+k=Y+G*J.$-$-:#. . . . + u L-M-Y.+ . . . . . . . . .                                       ",
+"                                                      . . . + N-] . . . O-1+;+>+>+l+>+,+>+>+>+>+>+,+>+l+>+,+>+,+,+>+,+>+>+>+>+,+>+,+,+,+,+,+,+,+,+>+,+>+>+l+>+>+,+k+,+>+1+m+q-A._+ @9 . . . %.O P-Q-R-} . . . . . . . . . .                                     ",
+"                                                      . . . E S-'.. . f.T-l+,+>+,+>+,+>+>+>+l+>+,+>+>+,+>+>+>+,+>+,+>+>+,+l+,+,+l+l+,+,+k+k+>+,+k+>+>+>+>+l+l+>+>+,+,+,+>+'@S+q-m+$-U-. . 9 Z V-W-c+X-2.+ . . . . . . . . .                                     ",
+"                                                    . . . + -.Y-. . . b&>+>+>+>+,+,+>+>+>+>+>+>+,+>+l+>+,+>+,+,+>+,+>+>+,+,+,+k+>+>+,+,+,+,+,+>+>+,+>+k+,+k+k+,+,+l+k+,+>+>+1+S+U=k=<.@ . h.;.Z-`- ;^..;+;+ . . . . . . . . .                                   ",
+"                                                    . . . M @;[ . . #;H=,+,+,+k+>+,+,+>+>+l+>+,+>+>+,+>+>+>+,+>+,+>+>+>+,+>+k+l+l+,+,+k+>+k+,+>+l+,+>+,+l+l+>+>+,+,+>+>+,+,+k+#=_+e+$;%;- M *.O-&;*;=;I+-;9 . . . . . . . . .                                   ",
+"                                                    . . - ;;>;. . . ,;k+,+>+>+,+,+,+>+,+,+>+>+,+>+l+>+,+>+,+,+>+,+>+>+>+,+,+>+>+>+,+,+,+l+>+>+k+>+,+k+>+>+>+,+,+,+,+>+>+>+>+l+>+k+>+#=';0 }.);^ U+`-).!;~;{;+ . . . . . . . .                                   ",
+"                                                  . . . ];^;/;. . #;^+,+,+,+k+>+>+,+k+l+,+>+,+>+>+,+>+>+>+,+>+,+>+>+>+,+l+k+l+l+,+,+k+>+k+,+,+l+>+,+,+,+,+>+,+>+>+>+>+>+l+k+,+,+>+l+>+(;_;>.:;<;N+[;};@ F.|;%.. . . . . . . . .                                 ",
+"                                                  . . + 1;2;. . @ / k+,+>+>+,+l+,+>+,+>+>+>+,+>+l+>+,+>+>+l=>+,+>+>+>+>+>+,+k+,+,+,+,+l+,+,+>+k+,+,+>+>+>+k+,+,+,+>+,+>+k+,+l+,+>+,+>+i*9+3;4;Z=5;Y } . 6;7;8;. . . . . . . . .                                 ",
+"                                                . . . [ D-P . . Y.T-l+,+,+>+k+>+,+>+,+>+>+,+>+,+>+>+>+>+=@9;>+>+>+>+,+>+,+>+l+,+,+k+>+k+,+,+>+,+,+k+,+>+,+,+>+>+>+>+>+,+,+,+k+>+,+>+,+'+r } t @ + 9 @ . t-{*0;. . . . . . . . .                                 ",
+"                                                . . + Y=V+. . . a;/+>+l=l+>+l+k+,+,+>+>+,+>+>+l+,+,+>+,+/+.@>+>+>+>+,+>+,+k+,+,+,+,+l+,+,+>+>+,+,+,+>+,+k+>+,+>+,+>+,+,+>+>+l+,+>+l+k+,++@. . . . . + . . r b;- . . . . . . . . .                               ",
+"                                                . . @ 9+s . . r.c;l+>+,+>+>+k+,+>+,+>+>+,+>+>+,+>+>+>+>+(+[+>+>+>+>+,+l+>+l+,+,+k+k+>+>+,+,+k+>+>+>+>+,+,+,+>+l+k+,+,+k+,+>+,+>+>+,+>+>+N.. . . . . . . . ^->;0 . . . . . . . . .                               ",
+"                                              . . . d;r 9 . . N+/+l+>+,+>+,+k+l+>+,+>+,+>+>+,+,+,+>+,+k+(+_+>+>+>+>+>+,+k+,+,+,+,+,+,+>+>+>+,+l+,+,+,+k+,+l+,+,+>+,+>+>+,+k+,+>+,+>+>+,+Y@. . . . . . . . @ e;Z.. . . . . . . . .                               ",
+"                                              . 5+f;g;h;. . . i;,+>+>+k+,+,+,+l+>+>+>+,+>+>+,+>+>+>+,+l=.@_+>+>+>+,+,+,+l+,+,+k+k+>+>+l+,+k+>+>+>+>+>+,+>+>+k+,+,+,+k+>+,+,+,+>+>+>+,+>+j;. . . . . . . . . k;S . . . . . . . . . .                             ",
+"                                              . l;m;h P . . '.n;,+,+l+,+>+k+,+,+,+>+,+>+>+,+,+,+>+,+,+'+i@'@>+>+>+,+,+k+,+,+,+,+,+,+>+>+>+,+>+,+,+,+k+,+l+,+>+,+>+,+,+l+>+>+,+>+,+>+>+,+o;. . . . . . . . . h@'.. . . . . . . . . .                             ",
+"                                            . . . S $.. . . -.p;,+>+k+,+,+,+,+,+>+>+,+>+>+,+>+>+>+,+>+e+B+_+,+,+k+l+,+l+,+,+k+>+>+>+l+,+k+>+>+,+>+>+,+>+>+k+,+,+k+,+k+,+,+,+>+,+>+,+,+,+H+S . . . . . . . . O-'.. . . . . . . . . .                             ",
+"                                            . . . }.{.. . . 1->+>+,+,+>+k+,+,+>+>+,+>+>+,+,+,+>+,+,+>+e+B+}-,+>+,+,+k+,+,+,+,+,+,+k+>+>+,+>+>+>+,+k+,+l+k+l+>+,+,+k+,+>+>+>+>+,+>+>+>+>+E+{.. . . . . . . q;r;u . . . . . . . . . . .                           ",
+"                                          . . . + C >.. . . s;>+,+>+>+,+,+,+,+,+>+>+>+>+>+>+>+>+,+>+,+'+a+_+,+>+,+,+l+,+,+k+>+>+>+,+,+>+>+>+,+>+>+l+k+,+l+,+k+,+,+>+l+>+,+>+,+>+>+l+,+,+#=W=. . . . . . . t;W=@ . . . . . . . . . . .                           ",
+"                                        . . . . T u;g.. . C.v;>+l+>+,+k+,+,+>+,+>+,+>+>+>+,+>+,+,+>+,+[+g-1+l+>+,+k+,+,+,+,+,+,+>+>+k+>+>+>+>+,+k+l+,+,+>+,+>+>+>+>+,+,+>+>+,+>+>+,+>+,+,+9+. . . . . . . w;_;+ . . . . . . . . . . .                           ",
+"                                        . . . . @ x;U-. . > y;>+>+k+,+,+l+>+,+>+,+>+>+,+l+>+>+,+>+,+>+o-|-_+,+l+,+l+,+,+k+>+>+>+l+k+,+,+>+,+>+>+l+k+k+l+k+,+>+,+>+,+>+,+>+,+>+>+,+k+,+,+k+9+. . . . . . . h P . . . . . . . . . . . .                           ",
+"                                      . . . . . @ z;A;. . >.2+l+,+,+,+,+>+>+,+>+,+>+>+>+,+>+,+,+>+,+,+B;}+/+,+>+k+,+,+,+,+,+,+>+>+,+>+k+>+>+,+k+l+,+,+l+,+>+>+>+,+,+>+>+>+,+>+>+,+,+,+,+,+9+. . . . . . . .;P . . . . . . . . . . . .                           ",
+"                                    . . . . . . @ C;;@. . {.J.>+>+k+,+l+>+>+>+,+>+>+,+l+>+>+,+>+,+,+,+.@B+g@,+,+l+,+,+k+>+>+>+l+k+,+,+,+,+>+>+l+k+k+>+>+>+>+,+>+,+,+,+>+,+>+,+>+>+,+,+,+k+9+. . . . . . @ D;f.. . . . . . . . . . . . .                         ",
+"                                    . . . . . + Y=A+E;. . s 2+l+,+,+l+>+,+l+>+,+>+>+>+,+>+>+,+,+>+>+,+:-V=l=>+k+,+,+,+,+,+,+>+,+,+>+,+k+>+,+k+l+,+,+,+,+>+>+>+,+,+,+>+l+k+l+k+,+,+,+,+,+,+/.. . . . . . ).D;} . . . . . . . . . . . . .                         ",
+"                                  . . . . . + F;G;H;`=. . &@2+>+k+,+>+>+>+>+,+>+>+,+l+>+>+>+>+,+,+>+>+(+@-;+,+l+,+,+k+>+>+>+,+k+,+,+,+l+>+>+l+k+k+>+>+>+>+,+>+,+>+,+>+,+>+,+>+>+,+,+,+,+>+I;. . . . . . J;C + . . . . . . . . . . . . .                         ",
+"                                  . . . . . + d;K;L;M;. . K+q-,+,+,+>+,+l+>+,+>+>+>+,+>+>+,+>+>+>+,+k+.@y;l=k+,+,+,+,+,+,+>+,+,+>+,+>+>+,+k+l+,+,+,+,+>+>+>+,+>+l+k+,+>+>+>+,+,+,+,+,+,+,+o.. . . . . t N;#;. . . . . . . . . . . . . .                         ",
+"                                  . . . . . . - E `-O;r . P;J.,+,+,+,+>+>+,+>+>+,+l+>+>+>+,+>+>+l+,+k+:-y;l=l+,+,+k+>+>+>+,+k+,+,+,+l+>+>+l+k+k+>+>+>+>+,+>+,+,+,+>+,+>+>+l+>+,+,+,+,+>+l+$=. . . . . Q;R;t . . . . . . . . . . . . .                           ",
+"                                  . . . . . . . S#u+N-@;. S;B@,+l+k+l+>+>+,+>+>+>+,+>+>+,+>+>+,+k+>+>+:-(+l=,+,+,+,+,+,+>+,+,+k+,+>+>+,+k+l+,+,+,+,+>+>+>+,+,+,+>+,+>+>+>+>+>+,+,+,+,+>+>+f . . . . . ] > + . . . . . . . . . . . . .                           ",
+"                                  . . . . . . . . @ {.y 9+K+-+,+,+l+,+k+l+>+>+,+l+>+>+>+,+>+l+k+l+>+,+:--+>+,+,+k+>+>+>+,+k+,+,+,+l+>+>+l+k+k+>+>+>+>+,+,+,+>+,+>+,+>+l+>+,+,+,+,+,+l+>+>+*@. . . W-T;U;V;M W;X;Y;% @ . . . . . . . .                           ",
+"                                  . . . . Z;`; >. . @ ] .>$=$-l+k+,+>+>+>+>+>+>+,+>+>+>+,+>+>+>+l+,+>+o-B@l=,+,+,+,+,+>+,+,+k+,+>+>+,+k+l+,+,+,+,+>+>+>+>+k+l+k+,+>+,+k+,+>+>+,+,+,+k+,+=@W=. q.9+C g.Z.+>'.@>2.#>$>%>&>^-u . . . . .                           ",
+"                                    . . *>=>->;>>>,>. } q q+L+,+l+,+>+l+>+>+>+,+>+>+>+>+>+,+k+,+,+,+k+:-B;l=,+k+>+>+>+,+k+,+,+,+l+>+>+l+k+k+>+>+>+>+,+,+,+>+,+l+k+l+k+,+k+l+,+,+,+l+k+l+'>)>h.!>W-9 . . . . . + O C.~>g.{>' C.9 . . .                           ",
+"                                    ]>^>/>(>_>v#:><>[>. } }>|>,+>+>+,+>+>+>+l+,+>+>+>+>+>+>+l+>+>+,+,+1>@-l=,+,+,+,+>+,+,+k+,+>+>+,+k+l+,+,+,+,+>+>+>+>+,+>+>+,+>+,+>+>+,+>+>+,+,+>+,+k+2>3>h+f.+ . . . . . . . . . . - -.4>5>N . . .                           ",
+"                                    6>7>8>9>0>a>b>c>d>e>. r.f>p+e+>+,+>+>+,+,+,+>+>+>+>+l+l+k+,+,+k+k+(+-+>+k+>+>+>+,+k+,+,+,+l+>+>+l+k+k+>+>+>+>+,+,+,+l+,+,+>+>+,+>+>+>+l+,+g>h>i>h>j>k>l>P + . . . . . . . . . . . . m>n>:+).+ . .                           ",
+"                                  o>p>q>r>s>t>u>v>w>x>y>z>. r.A>B>e+>+k+>+>+,+>+>+>+>+>+>+k+,+,+,+l+k+C>L+k+,+,+,+>+,+,+k+,+>+>+,+k+l+,+,+,+,+>+>+>+>+,+>+>+>+>+>+,+l+k+>+>+D>E>F>G>H>I>J>K>L>. . . . . . . . . . . . . M>N>b;} 9 .                             ",
+"                                  O>P>Q>R>S>T>U>V>W>X>Y>Z>`>. S @;d.(+,+l+,+>+>+>+>+l+,+>+k+,+,+>+>+k+:-S=l=>+>+>+,+k+,+,+,+l+,+>+l+k+k+>+>+>+>+,+,+,+l+,+,+>+>+,+>+k+,+>+ ,.,+,@,H#h##,$,%,&,. . . . . . . . . . . . @ * g.D *,=,-,                            ",
+"                                ;,>,,,',),!,~,{,],^,/,(,_,:,<,. [,},<.a+>+,+>+>+>+,+k+l+,+,+,+k+,+>+l=:-i-l=,+,+>+,+,+k+,+>+>+,+k+l+,+,+,+,+>+>+>+>+k+>+>+>+>+>+,+,+,+k+,+|,1,2,3,4,5,6,7,8,9,. . . . . . . . . . . . N E.Q=0,a,b,c,d,e,                        ",
+"                              f,g,h,i,j,k,@#l,m,n,o,p,q,r,s,t,u,- + v,w,g-l+k+>+>+>+,+>+k+,+>+,+l+>+>+.@6-/+>+>+,+k+,+,+,+l+,+>+,+k+k+>+>+>+>+,+,+,+l+>+,+>+,+,+>+>+,+,+,+x,y,z,A,B,C,6,D,E,F,. . . . . . . . . . . . ; O } G,H,I,J#J,K,                        ",
+"                              L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,`, '.'. + +',;@''+>+,+k+,+l+,+l+>+k+,+k+>+#=(+=@,+>+,+,+k+,+>+>+,+k+l+,+,+,+,+>+>+>+>+>+,+,+>+l+k+,+>+,+>+,+>+#'$'%'&'*'='-';'>','. . . . . . . . . . . 9 + . '')'!'J#K#K#~'                        ",
+"                            {']'^'/'('_':'S,<'['S,}'|'1'2'3'4'5'6'. . + C.7'7+#=,+l+>+>+k+>+,+l+,+,+,+,+k+k+>+,+k+,+,+,+l+,+>+,+k+k+>+>+>+>+,+,+,+,+>+,+>+,+k+,+>+,+l+,+>+8'9'0'a'b'c'd'e'f'g'. . . . . . . . . . . + u h'i'j'k'l'm'K#n'                        ",
+"                          o'p'q'r's't'u'v'v#o,w'x'y'z'A'5'B'C'D'E'F'. . + ; G'H';+k+l+,+,+l+k+,+k+I'k+>+,+,+>+,+,+k+,+>+>+,+k+,+,+,+,+,+>+>+>+>+>+>+l+k+>+>+l+,+>+>+>+h-1+J'K'L'M'],N'O'P'Q'R'+>. . . . . . . . . . . S'T'U'V'W'X'Y'Z'`'                        ",
+"                       ).)+)@)#)$)%)&)*)=)-)X>V,;)>),)')))!)~){)])^)/). . @ @ h.()l=>+>+k+>+l+,+,+l=l+>+,+>+,+k+,+,+,+l+,+>+,+k+k+>+>+>+>+,+,+,+,+,+,+>+>+>+>+,+,+l+/+++9-_):)<)q>[)})|)1)2)3)4)5)+ . . . . . . . 6)7)8)9)0)a)b)c)d)e)f)                        ",
+"                  g)h)i)j)k)l)m)n)o)p)M'B'q)r)s)>)8>t)u)N'v)w)T$x)y)z). . + + + E 8+l=,+,+k+,+k+I',+>+>+>+>+,+,+k+,+>+>+,+k+,+,+,+,+,+>+>+>+>+>+,+,+>+>+,+,+,+>+>+#=T.8-8-A)B)C)D)E)F)G)H)I)J)K)L)M)[,. . . . Z;N)O)P)Q)R)S)T)R$U>U)V)W)                        ",
+"      X)Y)Z)`) !.!j)+!@!#!$!%!&!*!=!|$-!;!>!,!&''!)!!!~!{!]!^!J@/!(!_!:!. . . . + '.e&m=,+l+,+,+>+,+>+,+>+>+k+,+,+,+l+,+>+,+k+>+>+>+>+>+,+,+,+,+>+>+>+,+>+k+,+,+k+k=9-8-8-<![!}!|!1!2!3!4!5!6!7!8!9!d%0!a!l$b!c!d!e!f!g!h!i!j![)e)k!l!m!                        ",
+"    n!o!p!q!r!s!q$t!u!0)v!w!x!y!z!A!*)B!C!D!],E!F!T>G!H!I!J!K!L!M!N!O!P!- . . . . . @ Q!B+k+l+,+,+>+k+>+l+,+,+k+,+>+>+,+k+,+,+,+,+,+>+>+>+,+>+,+>+>+,+l+,+l+,+,+,+.@J.8-8-R!S!T!U!V!W!X!Y!Z!`! ~.~+~@~#~J)$~%~&~*~=~-~;~>~,~'~)~!~~~{~I>]~                      ",
+"  ^~/~(~_~:~<~[~}~|~<)1~2~1~3~4~5~6~7~8~9~0~a~b~c~d~e~f~g~h~t>i~j~k~l~m~n~. . . @ . . @ 9+o~>+>+>+,+,+>+>+>+>+,+,+l+,+>+,+k+>+>+>+>+>+,+>+>+>+,+>+,+>+>+l=>+>+>+>+(+8-J.G*p~q~r~s~t~u~v~w~x~y~z~A~B~C~D~E~F~G~H~z~I~J~K~L~M~N~O~P~Q~T,R~T,S~                    ",
+"T~U~V~W~X~Y~Z~U!`~p) {.{+{@{#{${%{&{*{={-{q>v>['A';{q,>{,{:>'{){!{~{{{]{^{/). . %.@ . . . |.N&:->+k+>+l+,+>+>+,+>+>+,+k+,+,+,+,+,+>+>+l=l+,+>+,+>+,+>+,+l+>+>+,+,+[+9-8-8-p~/{({_{:{<{[{}{w~w&|{Z!1{2{2{3{4{5{6{7{8{9{0{ $a{b{c{8>}'d{e{u)f{                    ",
+"g{h{i{j{k{l{m{n{o{p{@#q{r{s{t{]!u{C!T,T,v{w{,{`'x{(>y{z{A{-!B'B{0{],C{D{E{F{- . . . + - . . f.G{(+,+>+>+>+,+k+,+l+,+>+,+k+>+>+>+>+>+,+,+,+k+,+l+k+,+l+l=,+k+,+,+,+1+2+)*q-H{I{J{K{L{M{N{C%~%O{P{Q{R{S{T{U{V{Y!W{~%X{Y{Z{`{ ].]+]@]#]$]%]&]0~*]                  ",
+"=]-];]>]J@,]']G! $}'(,)]!]~]0~{]]]^]/](]_]:]<][]B{r>}]|]1]2]3]4]T>5]6]7]8]9]0]. . . + + . . + a]b]k+l+l+>+,+,+,+>+,+k+,+,+,+,+,+>+,+,+,+>+,+,+,+l+l=>+,+l+,+,+,+,+e+S.8-8-c]d]e]f]g]h]i]j,N{j]k]=%l]m]n]o]p]q]r]h]M{s]t]u]{]v]w]x]y]z]<]A'A]B]C]                ",
+"D]E]F]G]H]I]J]T,K]L]S,<]M]N]w>O]3'P]C'y{f{Q]R]S]A'T]U]@{V]W]!!X]b>Y]t$Z]`] ^.^+^. . . . . . . @ (.;+>+l=l+k+,+l+,+>+,+k+>+>+>+>+,+k+>+>+>+,+,+>+>+l+k+,+>+k+>+>+>+k+m+J.J.c]@^#^$^%^&^*^=^=^<{h]j,-^3&;^>^C%,^'^)^!^~^b{{^]^^^V>3$/^(^_^*{:^']V><^              ",
+"  [^}^|^1^I]~!2^`#3^&'W>4^5^6^2'S]7^8^9^0^a^b^c^d^(>e^f^g^J@h^:]i^j^k^l^m^n^o^p^. . . . + 9 . } q^l=l+,+>+,+,+>+,+k+,+,+,+,+,+,+k+,+>+>+>+,+>+>+>+,+,+>+>+,+,+,+,+>+@+J.8-r^s^t^u^v^w^x^=^y^z^A^B^x^C^D^h]s~E^W!F^G^q{H^I^(^I^'{.{,{n,J^K^L^M^N^O^P^            ",
+"  Q^R^S^T^3#S,4]U^t#V^W^>!X^u)Y^Z^`^T]~!Q~ /S>./+/;{@/#/$/%/&/>!*/=/I> $6]-/;/>/+^. . . . + . + ,/_+l=l+>+k+l+,+>+,+k+>+,+k+,+,+,+,+,+k+l+,+>+>+,+,+>+l+l+k+>+,+>+,+L+8-9-'/)/!/~/{/]/^/)^I@//})(/E^M{)^<{_/:/</k{[/r{}/|/}'1/X]U^2/3/4/5/']%/6/7/a{8/9/        ",
+"  0/a/b/c/d/1]s,O^R,e/f/g/Y,4/B{h/;{9^w{r>A{i/(]j/k/l/M'l,N^m/w].{n/o/p/q/r/D{s/t/u/. . . . . v/w/'@>+,+l+,+>+,+k+,+,+,+,+,+k+l+>+l+k+,+,+>+l+>+k+,+,+k+>+,+>+,+,+>+@+G*x/y/z/A/B/C/D/E/F/G/@{H/T^'~I/T^!^L~J/K/L/@]M/z{>)y'i^o/N/O/P/Q/p)R/S/T/d{x'U/V/W/      ",
+"  X/Y/Z/`/ (.(Q/+(@(#($(:>%(=)&(*(f{=(-(;(>(B{,('()(!(I>5'~(O%P/J^W>Z^{(](~{^(/(((_(. . . . S :(K.>+,+>+k+l+,+>+,+k+>+,+k+,+>+,+>+,+k+l+,+k+,+,+,+,+,+,+,+>+,+,+,+l+}+<([(}(|(1(2(3(4()^5(6(7(8(9(0(a(U>M/b({(k^c(*(d((^e(['f(g(J!h(i(j(I^k(l(m(0~n({,o(p(q(r(  ",
+"  s(t(u(v(w([/x(y(z(U>S>$#4/A(B(C(D(a>&'E(F(w'l!^^G(H(S,I(v>J(*'K(X]L(c~U)q/M(N(O(P(Q(^-}.h@P+.@k+,+>+,+,+>+,+k+,+,+,+,+,+k+l+>+>+,+l+>+>+l+k+>+>+k+,+k+l+k+>+l+,+Q+U-9 W@R(S(F~T(U(V(W(`~o{X(S,}'Q~Y(g^Z(G(T,']&(`(i~,{{]V^j( _w>1$._+_@_~!#_V/$_}':]a~='-!8>  ",
+"  %_&_*_=_-_;_>_;{,_'_+_)_|'w{!_2'e{~_{_T]]_4/^_y'r>w{/_{~2/(_%(__d{{!$#q):_<_[_}_|_1_2_$-'+k+,+>+>+,+>+,+,+>+,+k+>+,+k+,+,+>+,+>+k+l+,+>+,+>+>+,+,+l+,+>+>+l+>+Y+B-. . 5)3_4_5_I~6_9{7_8_9_8~0_a_b_$(c_d_e_R,#_f_g_h_i_|/O^h~j_l/5^t]T>X(k_A{3^E!l_/_m_%{T]n_o_",
+"  p_q_r_s_t_D){!T]/,*)(>d~V^ _u_v_R,w_*'x_3^y_P~z_A_I^B_Y]v_B!S]C_b(={V>g^D_E_F_G_H_I_J_K_>+,+,+>+,+,+>+,+,+k+,+,+,+,+,+k+,+l+k+>+l+>+,+,+>+>+>+>+,+,+,+k+l+,+Q+B-. . . L_M_N_O_P_Q_R_S_T_U_k/b~x]V_w>W_X_0^c^Y_Z_['`_ :(_J^_].:+:R,@:E!5##:$:,_%::]&:*:=:T,-:}/",
+"  ;:>:,:':):9_!:9>~:{:j_]:^:/:(:_:V^9(%(::X]<:[:}:|:W>r)G!1:4^a>2:3:y(6^]!4:5:6:7:8:9:0:a:>+,+k+l+>+k+l+>+>+,+k+>+,+k+,+,+,+,+,+,+>+,+,+>+>+>+>+>+>+>+>+>+>+K*q;. . . . b:c:d:e:f:g:h:r$]^i:j:|]](k:|]k:l:w{f_B]m:n:o:p:q:r:s:/_|]t:$:A{u:v:J^w:(:x:/,(]U/y:<]z:",
+"  A:B:C:D:E:F:W>e^m,G:;(l_]^j_$:H:I:J:K:l,L:f(m(e{3/M:b'N:k/4~2:|/H]G/K:x>O:P:Q:R:S:T:U:V:W:,+,+>+,+,+>+,+>+,+,+,+,+,+k+,+,+l+,+>+>+>+>+>+,+>+>+>+l+,+k+.-/.} . . . . . X:Y:Z:`: <.<+<@<){k^#<$<%<&<*<K(&'=<C_-<D(~)A{^_{!E)|];<4/><,<'<|/)<R$~!(]f{`'!<8_~<{<  ",
+"  ^']<P>^</<n(T,(<u{_<e{H]l/4#;{_>:<<<[<#_}<v>|<_^j^1<k_c>2<3<f{e^4/4<}'5<6<L/7<8<9<0<a<b<c<d<,+>+>+>+>+>+,+k+>+,+k+,+,+,+,+>+>+>+,+>+>+,+k+>+>+>+>+k+K*Y.. . . . . . . e<f<g<2{h<C%h]R$7^A!e{i<8~P~|/;!L/A_!!O/j<R~)(Q/k<o:l<3^m<Z#%/n<_,/_o<p<&(U,q<r<W~s<    ",
+"  t<u<v<w<x<n_,]^_l_U/2^y<+_z<A<B<J^s)1$P~C<'(`_P~1]D<v>E<F<G<:]H<u_I<a~')J<l:k(K<L<M<N<O<P<Q<k+>+l+>+,+>+,+,+,+,+,+k+,+,+l+,+,+>+>+>+>+>+>+>+>+k+A.+@} . . . . . . . R<S<T<%~U<V<W<X<Y<K/v>k:`'%/'!e{I<Z<,]j:`<S,~~$# [.[#_+[1/T,@[#[z]$[_<o/%[w{&[*[=[-[      ",
+"  ;[>,>[,[1^)&Q]Z^><9^{^'[^_0{l<)[w{%(],![./Q]3^z(>(~[e{X>1:f{{[l/][f_v_^[/[([:/_[:[<[[[}[|[1[2[3[>+>+>+,+k+>+,+k+,+,+,+,+>+k+k+,+>+>+>+,+,+>+S.x+f.. . . . . . . . . 4[5[6[7[B/8[9[h]:/0[s{a[b[S>U,~<i(,]l_O^c[T,T,R,;_V/d[9^;{8>e[m<f[g[h[]_a{i[j[k[l[        ",
+"m[n[o[p[q[1!r[s[t[g_%]`'7~_<u[:'e{.$1]v[4^W>w[(:,]:>.(><A_x[y[!,m:!{7< ]z[y[A[B[C[D[E[F[G[H[I[J[K[2+>+>+,+l+,+,+,+k+,+,+,+,+,+,+>+,+k+L[Q.2@p f.. . . . . . . . . . . 4[M[N[O[P[Q[C%S)R[A!9^a[S[x''!e^3][)w'3:=)T[X]U[T,<]k:a>W_V[W[L/X[Y[}'Z[`[ }o[            ",
+".}#!a/+}@}W!#}$}%}&}*}=}-};}^_>}K:,}m:#_)('}_<{_+/T]B{x[)} /U/v_A{w>*[-!!}~}t>{}F/]}^}/}(}_}:}<}[}0 _ i;7->+,+k+,+,+,+,+l+1+8-}}2@s;N+r.S + . . . . . . . . . . . . . |}1}2}3}T(4}A%h]5}6}D<u_(^7}k/8}9}0}w{@{T[]_l_f~,]a}o/6/b}]:l/T[7}c}P,P$d}e}              ",
+"t<f}g}h}~%i}j}B^:{k}V!l}m}&}c/n}@{r:o}U^p}A(U>4^A{A'0~q},]m,#_-{r}q>}'U,s}v>t}u}J/v}4&w}x}y}z}A}B}. . + 0 Z.C H C}D}:+-.q;Y.S + . . . . . . . . . . . . . . . . . . . E}F}G}1(H}4}I}h]J}8~i/&<j_B{U/B'T[K}|/h/G:w>4^z(4/9^V_L}M}h~N}O}P}Q}R}S}                  ",
+"T}U}V}W}X}Y}Z}]/9{'^<{F)`}s~ |O}.|+|@|#|~~$|%|c>f{W>3^.:T,/:W_|]%/U]$#&|!_*/],M%e_A^%!*|T(1(=|-|;|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . >|A},|'|)|f:!|~|R${|N]@:Y]]|^|/|Y](|n<_|f{:|<|[|{,2<}|D_||1|2|3|4|                        ",
+"5|6|7|8|6|9|0|a|b|b|c|d|g:e|f|_'F]g|<{v(h|i|j|k|a>l|m|,<j_(>n|o|A_N'p|@:)[T]q|/:r|s~9]s|t|u|v|w|x|y|. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . z|A|B|C|2{V{D|j]E|F|G|)(Q~j_H|I|i_J|K|D)L|M|N|O|P|Q|R|S|T|U|V|>&                          ",
+"  W|X|W|Y|Z|`| 1.1+1.1@1#1$1%1%1&1~%*17%=1-1;1>1,1,~'1F:][x_X(,]2^_<W> /)1%]!1~1E^{1R)]1^1/1(1_1:1<1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [1}1|11121314151'^i| {61b{718191H!01+{a1b1/<u~c1d1e1f1g1h1i1                              ",
+"    z/j1k1l1m1n1o1p1q1r1`:s1]1t1u1t1v1w1x1c|y17%.&z1A1j|B1{,'(w]@<C19>K:#|D_p))^,^D1E1F1G1H1I1J1K1L1. . . . . . . . . . . . @ . . . . . . . . . . . . . . . . . . . . M1N1O1P1Q1`|]1Q{R1h]S1T1U1V1W1X1T^Y1u~_'C^Z1`1 2**.2+2@2#2                                ",
+"        $2%2&2*2=2-2;2>2^1Q),2'2)2!2~2q12{t1{2]2^2a|/2(2_/+{G|S>'}t{)[_2,~:2<2e|[2}2|2122232425262/$. . . . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . 72829202>2^1`|a2b2c2d2+<'&+<-1X{g|-^e2f2g2h2i2j2k2l2m2                                    ",
+"              n2o2p2q2r2s2t2u2v2w2x2>2>2 ~^1y2z2)2A2t1B2C2D2E2S^F2h|G2x^N{B%H2I22(J2H[K2L2M2N2O2P2L1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q2R2Y:S2T2U2V2W2X2Y2Z2`2R1^} 3.3+3K{@3x}#3$3%3+~&3*3                                      ",
+"                        =3-3;3>3=|,3'3)3!3~3{3]3^3/3(3_3-~:3w&Z2b|<3[3Z2}3|313233343)3536373838293+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 03a3b3c3d3e3f3g3B~h3i3j3k3l3m3k3T{n3;,o3 ~l1p3q3r3                                        ",
+"                              s362t3u3v3U&w3x3y3z3A3B3x2C3D3o1e:E3F3B/G3H3I3Q1J3K3z/L3I1M3N3O3P3Q3. . . .                                                             R3S3T3U3V3W3J)C|X3Y3Z3`3U< 4 4U<.4+4@4G1g<o*#4                                            ",
+"                                    $4%4&4*4=4-4;4>4Q*,4[*T2'4Z:C|)4!4u|~4{4)3d3]4B|^4/4(4A}_4:4+ .                                                                     <4[4}4|414243444u|X35464(3o1J274H[849404a4                                              ",
+"                                              b4c4d4e4f4g4h4{=i4j4!3k4l4j4m4n4o4p4q4r4s4A}t4e<                                                                          u4v4w4x4y4z4m434A4t2]3B4C4D4E4'4F4G4M3H4                                                ",
+"                                                      I4J4K4L4M4N4O4P4(1Q4)=>4R4S4T4U4V4v4W4                                                                            X4Y4Z4`4 5.5+5L2@5#5$5K2$5%5z3&5*5=5-5                                                  ",
+"                                                          ;5>5,5'5}4)5!5~5/4{5]5^5/5(5_5:5                                                                                ;5<5[5}5|5152535>345g4556575859505                                                    ",
+"                                                                a5b5c5d5e552f5g5h5a3i5j5                                                                                      k5l5m5n5o5O2p5q5r5|5s5t5u5v5                                                      ",
+"                                                                    w5b4x5<5y5z5A5B5                                                                                              C5D5E5F5G5H5I5Y4J5K5                                                          "};
diff --git a/pixmaps/l-sgi.xpm b/pixmaps/l-sgi.xpm
new file mode 100644 (file)
index 0000000..32931a3
--- /dev/null
@@ -0,0 +1,114 @@
+/* XPM */
+static char * image_name[] = {
+"120 94 17 1",
+"      c None",
+".     c #FFFFFF",
+"+     c #FAFAFA",
+"@     c #F3F3F3",
+"#     c #E6E6E6",
+"$     c #CFCFCF",
+"%     c #B4B4B4",
+"&     c #989898",
+"*     c #888888",
+"=     c #797979",
+"-     c #696969",
+";     c #535353",
+">     c #353535",
+",     c #191919",
+"'     c #0C0C0C",
+")     c #050505",
+"!     c #000000",
+"                                                                                                 #                      ",
+"                                                                                                 #                      ",
+"                                                                                              $,,)!!;                   ",
+"                                                                                            ##'))!!!!;;                 ",
+"                                                                                            ##'))!!!!;;                 ",
+"                                                                                            **!!!!!!!!!$$               ",
+"                                                                                            ;;!!!!!!!))%%               ",
+"                                                                                            ;;!!!!!!!))%%               ",
+"                                                                        ##*;;!''=           &&!!!!!!!))##               ",
+"                                                                        ##*;;!''=           &&!!!!!!!))##               ",
+"                                                                     ##-!!!!!!!!)%%           >!!!!!!**                 ",
+"                                                                    %''!!!!!!!!!!&&            ==>;;%                   ",
+"                                                                    %''!!!!!!!!!!&&            ==>;;%                   ",
+"                                                                  %%)!!!!!!!!!!!,##                                     ",
+"                                                                 %!!!!!!!!!!!>**                                        ",
+"                                                                 %!!!!!!!!!!!>**                                        ",
+"                                                               ##,!!!!!!!!>%%                                           ",
+"           #%%--->;;=&&##                              $$*--;-->>!!!!!!!;;                                              ",
+"           #%%--->;;=&&##                              $$*--;-->>!!!!!!!;;                                              ",
+"        $;;)!!!!!!!!!!!));$$                        **,!!!!!!!!!!!!!!!!;              %%-------------==   $$-,,=--*  -==",
+"      &&'))!!!!!!!!!!!!!!!!!;                    $$,!!!!!!!!!!!!!!!!!!!-              **!!!!!!!!!!!!!,,      ;; ;;-  ;==",
+"      &&'))!!!!!!!!!!!!!!!!!;                    $$,!!!!!!!!!!!!!!!!!!!-              **!!!!!!!!!!!!!,,      ;; ;;-  ;==",
+"     *!!!!!!!!!!!!!!!!!!!!!!)>>                 &!!!!!!!!!!!!!!!!!!!!!!!>>            **!!!!!!!!!!!!!,,      -- --&==&==",
+"   $$!!!!!!!!!!!!!!!!!!!!!!!!!!-              %%!!!!!!!!!!!!!!!!!!!!!!!!))>           **!!!!!!!!!!!!!,,      ;; ;; >>#**",
+"   $$!!!!!!!!!!!!!!!!!!!!!!!!!!-              %%!!!!!!!!!!!!!!!!!!!!!!!!))>           **!!!!!!!!!!!!!,,      ;; ;; >>#**",
+"   >>!!!!!!!)),--&&&;,,!!!!!!!!!$$           $))!!!!!!!!!>==&&&;;'!!!!!!!!)**         **!!!!!!!!!!!!!,,      ** **   #&&",
+" $$!!!!!!!!!&&         ;;!!!!!!!%%           >!!!!!!!!,&&         ;;!!!!!!!))$        ##$$$$&&!!!!!!!,,                 ",
+" $$!!!!!!!!!&&         ;;!!!!!!!%%           >!!!!!!!!,&&         ;;!!!!!!!))$        ##$$$$&&!!!!!!!,,                 ",
+" **!!!!!!!!=             *))!!!)##         %%)!!!!!!))$             ;!!!!!!!!-              %%!!!!!!!,,                 ",
+" **!!!!!!!!=             *))!!!)##         %%)!!!!!!))$             ;!!!!!!!!-              %%!!!!!!!,,                 ",
+" --!!!!!!!!#              %%;;;%           --!!!!!!!==              #))!!!!!!'              %%!!!!!!!,,                 ",
+" ;;!!!!!!))                                ,,!!!!!!)$$               ;;!!!!!!!%%            %%!!!!!!!,,                 ",
+" ;;!!!!!!))                                ,,!!!!!!)$$               ;;!!!!!!!%%            %%!!!!!!!,,                 ",
+" ==!!!!!!!!#                               !!!!!!!!)                 --!!!!!!!**            %%)!!!!!!,,                 ",
+" **!!!!!!!!=                             $$!!!!!!!!,                 **!!!!!!!==            %%!!!!!!!,,                 ",
+" **!!!!!!!!=                             $$!!!!!!!!,                 **!!!!!!!==            %%!!!!!!!,,                 ",
+" $$!!!!!!!!!&&                           $$!!!!!!!!,                 **!!!!!!!;;            %%!!!!!!!,,                 ",
+"   ,,!!!!!!!!!>%%                        $$!!!!!!!!,                 **!!!!!!!--            %%!!!!!!!,,                 ",
+"   ,,!!!!!!!!!>%%                        $$!!!!!!!!,                 **!!!!!!!--            %%!!!!!!!,,                 ",
+"   %%!!!!!!!!!!!!'--%                    $$!!!!!!!!,                 **)!!!!!!;;            %%)!!!!!!,,                 ",
+"     -!!!!!!!!!!!!!!!'';;$               $$!!!!!!!!,                 **!!!!!!!--            %%)!!!!!!,,                 ",
+"     -!!!!!!!!!!!!!!!'';;$               $$!!!!!!!!,                 **!!!!!!!--            %%)!!!!!!,,                 ",
+"      --!!!!!!!!!!!!!!!!!!;;$            $$!!!!!!!!,                 **!!!!!!!--            %%!!!!!!!,,                 ",
+"        %,,!!!!!!!!!!!!!!!!!)%%          ##!!!!!!!!'                 ==!!!!!!!**            %%!!!!!!!,,                 ",
+"        %,,!!!!!!!!!!!!!!!!!)%%          ##!!!!!!!!'                 ==!!!!!!!**            %%!!!!!!!,,                 ",
+"           %;;!!!!!!!!!!!!!!!!!&           ))!!!!!!!##               ;;!!!!!!!%%            %%)!!!!!!,,                 ",
+"              $==>!!!!!!!!!!!!!)$$         >>)!!!!!!&&              #''!!!!!!!##            %%)!!!!!!,,                 ",
+"              $==>!!!!!!!!!!!!!)$$         >>)!!!!!!&&              #''!!!!!!!##            %%)!!!!!!,,                 ",
+"                  ##*,,!!!!!!!!)>>         &&!!!!!!!''#             ;!!!!!!))>              %%!!!!!!!,,                 ",
+"                  ##*,,!!!!!!!!)>>         &&!!!!!!!''#             ;!!!!!!))>              %%!!!!!!!,,                 ",
+"                       ==!!!!!!!))$          ,!!!!!!!!>$$         --!!!!!!!!!%              %%!!!!!!!,,                 ",
+"                         ;!!!!!!!!*          &!!!!!!!!!))-%%$%%=='!!!!!!!!!;;               %%)!!!!!!,,                 ",
+"                         ;!!!!!!!!*          &!!!!!!!!!))-%%$%%=='!!!!!!!!!;;               %%)!!!!!!,,                 ",
+"                         $))!!!!!!;           --!!!!!!!!!!!!!!!!!)!!!!!!!!,                 %%)!!!!!!,,                 ",
+"                          ''!!!!))>           ==!!!!!!!!!!!!!!!!!!!!!!!),,$                 %%!!!!!!!,,                 ",
+"                          ''!!!!))>           ==!!!!!!!!!!!!!!!!!!!!!!!),,$                 %%!!!!!!!,,                 ",
+"     *,,%                 ,,!!!!!!>           ,,!!!!!!!!!!!!!!!!!!!!!))>##                  %%!!!!!!!,,                 ",
+"$--))!))>                #!!!!!!!!;          %))!!!!!!!!!!!!!!!!!!!!,&&                     $$!!!!!!!''                 ",
+"$--))!))>                #!!!!!!!!;          %))!!!!!!!!!!!!!!!!!!!!,&&                     $$!!!!!!!''                 ",
+";!!!!!!!)==              &!!!!!!!!-          -!!!!!!--$==>>>!,,>>-%%                        ##!!!!!!!!!$$               ",
+"%!!!!!!!!))%           $$)!!!!!!))%          '!!!!!!%%                                        ,!!!!!!!!;;               ",
+"%!!!!!!!!))%           $$)!!!!!!))%          '!!!!!!%%                                        ,!!!!!!!!;;               ",
+" >>!!!!!!!!!==      #--!!!!!!!!),,         %%!!!!!!,                                          ;!!!!!!!!!!;$$            ",
+" $$!!!!!!!!!!!!>>>,,!))!!!!!!!!!%%         ;;!!!!!!-                                          $))!!!!!!!!!))=           ",
+" $$!!!!!!!!!!!!>>>,,!))!!!!!!!!!%%         ;;!!!!!!-                                          $))!!!!!!!!!))=           ",
+"   &&!!!!!!!!!!!!!!!!!!!!!!!!!!-         ##!!!!!!!!$                                           --!!!!!!!!!!!!%%         ",
+"     &!!!!!!!!!!!!!!!!!!!!!!!--          &&!!!!!!''&&&&&&&&&&&&&&&&&%$$                          ;!!!!!!!!!!!--         ",
+"     &!!!!!!!!!!!!!!!!!!!!!!!--          &&!!!!!!''&&&&&&&&&&&&&&&&&%$$                          ;!!!!!!!!!!!--         ",
+"      %%>!!!!!!!!!!!!!!!!!''%            ;;!!!!!!!!!!!!!!!!!!!!!!!!!)!!'--$                       ==)!!!!!!!!&&         ",
+"      %%>!!!!!!!!!!!!!!!!!''%            ;;!!!!!!!!!!!!!!!!!!!!!!!!!)!!'--$                       ==)!!!!!!!!&&         ",
+"         &&>!!!!!!!!!!!>>*               >>))!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!==                       $**;;,,,-           ",
+"            ##%&&&&&%##                  &&))!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;                                          ",
+"            ##%&&&&&%##                  &&))!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;                                          ",
+"                                           &&;>>>>>,!!!!!!!!!!!>>>,,!!!!!!!!!)&&                                        ",
+"                                                   ,!!!!!!''%       #==!!!!!!),,                                        ",
+"                                                   ,!!!!!!''%       #==!!!!!!),,                                        ",
+"                                                 **!!!!!!)$$           &!!!!!!!!$                                       ",
+"                                                 >>!!!!!!=              >>!!!!!!=                                       ",
+"                                                 >>!!!!!!=              >>!!!!!!=                                       ",
+"                                                 ))!!!!!!%              --!!!!!!-                                       ",
+"                                                 ))!!!!!!%              --!!!!!!-                                       ",
+"                                                 ))!!!!!!%              --!!!!!!-                                       ",
+"                                                 ,,)!!!!!-              >>!!!!!!*                                       ",
+"                                                 ;;!!!!!!'##           *!!!!!!!!%                                       ",
+"                                                 ;;!!!!!!'##           *!!!!!!!!%                                       ",
+"                                                 %%!!!!!!!''&##     #--!!!!!!!,,                                        ",
+"                                                   >!!!!!!!!)))!!!!!!!!!!!!!!!&&                                        ",
+"                                                   >!!!!!!!!)))!!!!!!!!!!!!!!!&&                                        ",
+"                                                   $,,!!!!!!!!!!!!!!!!!!!!!!!;                                          ",
+"                                                    $$>!!!!!!!!!!!!!!!!!!!!--                                           ",
+"                                                    $$>!!!!!!!!!!!!!!!!!!!!--                                           ",
+"                                                       &&>!!!!!!!!!!!!!';;$                                             ",
+"                                                       &&>!!!!!!!!!!!!!';;$                                             ",
+"                                                            $$$$$$$$$$$                                                 "};
diff --git a/pixmaps/l-sol.xpm b/pixmaps/l-sol.xpm
new file mode 100644 (file)
index 0000000..aea655e
--- /dev/null
@@ -0,0 +1,994 @@
+/* XPM */
+static char * image_name[] = {
+"125 133 858 2",
+"      c None",
+".     c #A3A4A5",
+"+     c #6D6D6E",
+"@     c #D5D6DA",
+"#     c #D2D3D7",
+"$     c #A4A4A5",
+"%     c #9FA0A2",
+"&     c #D7D8DA",
+"*     c #A2A3A4",
+"=     c #D2D3D5",
+"-     c #696A6B",
+";     c #858585",
+">     c #FEFEFE",
+",     c #EDB0B6",
+"'     c #FDE8EB",
+")     c #000000",
+"!     c #151515",
+"~     c #393939",
+"{     c #7D7D7D",
+"]     c #323232",
+"^     c #626262",
+"/     c #747475",
+"(     c #D2D4D6",
+"_     c #D0D1D4",
+":     c #6C6C6D",
+"<     c #868686",
+"[     c #E8A1A8",
+"}     c #ECA4AB",
+"|     c #535354",
+"1     c #2C2C2C",
+"2     c #4A4A4A",
+"3     c #131313",
+"4     c #56575A",
+"5     c #D3D3D5",
+"6     c #D3D4D6",
+"7     c #C3C3C3",
+"8     c #E79EA5",
+"9     c #DC606C",
+"0     c #030303",
+"a     c #BBBDC0",
+"b     c #535353",
+"c     c #333333",
+"d     c #424243",
+"e     c #D3D4D5",
+"f     c #9E9FA1",
+"g     c #E99EA6",
+"h     c #D1414F",
+"i     c #626264",
+"j     c #D2D3D6",
+"k     c #7D7D7E",
+"l     c #060606",
+"m     c #434344",
+"n     c #96979B",
+"o     c #67686A",
+"p     c #C4C4C4",
+"q     c #CF3A49",
+"r     c #FBDDE0",
+"s     c #929293",
+"t     c #A5A6A7",
+"u     c #79797A",
+"v     c #D9DADB",
+"w     c #C9CBCF",
+"x     c #D0D2D5",
+"y     c #8A8A8A",
+"z     c #E6949C",
+"A     c #D24452",
+"B     c #EDA5AC",
+"C     c #FEFBFC",
+"D     c #303030",
+"E     c #CECFD2",
+"F     c #C5C7CB",
+"G     c #2A2B2D",
+"H     c #DCDCDC",
+"I     c #A0A0A2",
+"J     c #070707",
+"K     c #C5C5C5",
+"L     c #E37C87",
+"M     c #DB5C69",
+"N     c #FEFDFD",
+"O     c #9A9A9C",
+"P     c #0C0C0C",
+"Q     c #B8B9BB",
+"R     c #3E3E3E",
+"S     c #252527",
+"T     c #2E2E2E",
+"U     c #727375",
+"V     c #8C8C8C",
+"W     c #E1707B",
+"X     c #D24654",
+"Y     c #D44A58",
+"Z     c #F9D2D6",
+"`     c #040404",
+" .    c #D0D1D5",
+"..    c #D1D3D5",
+"+.    c #D2D4D5",
+"@.    c #838486",
+"#.    c #C8CACE",
+"$.    c #DDDDDD",
+"%.    c #CCCED1",
+"&.    c #0D0D0D",
+"*.    c #CFD0D4",
+"=.    c #8D8D8D",
+"-.    c #FFFFFF",
+";.    c #FFF2F4",
+">.    c #FFECEF",
+",.    c #FFF6F7",
+"'.    c #FFFCFC",
+").    c #686869",
+"!.    c #010101",
+"~.    c #666768",
+"{.    c #D4D4D6",
+"].    c #A8A8A9",
+"^.    c #A6A6A8",
+"/.    c #D1D2D6",
+"(.    c #C6B6B8",
+"_.    c #FBE1E3",
+":.    c #BCBDBF",
+"<.    c #D0D2D4",
+"[.    c #D9D9DB",
+"}.    c #292929",
+"|.    c #3A3A3A",
+"1.    c #B2B3B6",
+"2.    c #DBDBDC",
+"3.    c #CACCCF",
+"4.    c #464647",
+"5.    c #7C7C7D",
+"6.    c #D6D7DA",
+"7.    c #DA5A67",
+"8.    c #FADFE1",
+"9.    c #494949",
+"0.    c #C4C5C8",
+"a.    c #DADADB",
+"b.    c #C5C5C6",
+"c.    c #7C7D7E",
+"d.    c #CCCDCF",
+"e.    c #C7C7C7",
+"f.    c #E68993",
+"g.    c #DC6470",
+"h.    c #FCE4E6",
+"i.    c #020202",
+"j.    c #909092",
+"k.    c #D3D3D6",
+"l.    c #6C6C6E",
+"m.    c #939394",
+"n.    c #676769",
+"o.    c #101010",
+"p.    c #D5D6D9",
+"q.    c #FDE6E9",
+"r.    c #D75360",
+"s.    c #FDF5F6",
+"t.    c #3F3F3F",
+"u.    c #D9D9DA",
+"v.    c #98989A",
+"w.    c #727373",
+"x.    c #545558",
+"y.    c #181818",
+"z.    c #A5A6A8",
+"A.    c #C8C8C8",
+"B.    c #E6858F",
+"C.    c #D03D4C",
+"D.    c #DD6974",
+"E.    c #FDF6F7",
+"F.    c #6A6A6C",
+"G.    c #D5D5D7",
+"H.    c #D4D5D7",
+"I.    c #BDBEC1",
+"J.    c #4C4C4E",
+"K.    c #C7C8CB",
+"L.    c #D1D2D4",
+"M.    c #BEBEBF",
+"N.    c #444445",
+"O.    c #171717",
+"P.    c #7F7F80",
+"Q.    c #D1D1D2",
+"R.    c #F2BAC0",
+"S.    c #D13F4E",
+"T.    c #D03E4C",
+"U.    c #E3818A",
+"V.    c #FEF7F8",
+"W.    c #B4B4B6",
+"X.    c #0F0F0F",
+"Y.    c #0A0A0A",
+"Z.    c #7A7B7C",
+"`.    c #0E0E0E",
+" +    c #525254",
+".+    c #B9B9BB",
+"++    c #A8A9AB",
+"@+    c #C5C7CA",
+"#+    c #FEF6F7",
+"$+    c #E1727E",
+"%+    c #D24553",
+"&+    c #E68992",
+"*+    c #FBE3E6",
+"=+    c #6B6C6D",
+"-+    c #353535",
+";+    c #AAACAF",
+">+    c #606162",
+",+    c #080808",
+"'+    c #202021",
+")+    c #C6C7CA",
+"!+    c #646567",
+"~+    c #090909",
+"{+    c #CACBCD",
+"]+    c #FCDDE1",
+"^+    c #F7CBD0",
+"/+    c #FEFCFC",
+"(+    c #5E5E5F",
+"_+    c #69696B",
+":+    c #0E0F0F",
+"<+    c #8F9092",
+"[+    c #CED0D3",
+"}+    c #323233",
+"|+    c #CACCD0",
+"1+    c #DBDBDB",
+"2+    c #A7A8AA",
+"3+    c #7E7F81",
+"4+    c #515151",
+"5+    c #A2A3A5",
+"6+    c #999A9C",
+"7+    c #050505",
+"8+    c #767678",
+"9+    c #CECFD1",
+"0+    c #DCDCDD",
+"a+    c #C9CACF",
+"b+    c #D7D8D9",
+"c+    c #D4D4D7",
+"d+    c #0C0C0D",
+"e+    c #545557",
+"f+    c #D8D9DA",
+"g+    c #D7D7D8",
+"h+    c #222222",
+"i+    c #969798",
+"j+    c #909091",
+"k+    c #D1D2D5",
+"l+    c #282828",
+"m+    c #B8B8BA",
+"n+    c #D0D1D3",
+"o+    c #7E7F7F",
+"p+    c #939494",
+"q+    c #CBCBCB",
+"r+    c #D5D5D8",
+"s+    c #CBCCD0",
+"t+    c #DADBDB",
+"u+    c #CACBCF",
+"v+    c #797A7D",
+"w+    c #848586",
+"x+    c #434345",
+"y+    c #919194",
+"z+    c #676869",
+"A+    c #CCCCCC",
+"B+    c #BBBCBE",
+"C+    c #CFD0D3",
+"D+    c #1C1C1C",
+"E+    c #D4D4D4",
+"F+    c #656567",
+"G+    c #CBCCCE",
+"H+    c #262626",
+"I+    c #BCBDC0",
+"J+    c #C8CBCF",
+"K+    c #CCCDCE",
+"L+    c #6F7072",
+"M+    c #0B0B0B",
+"N+    c #949596",
+"O+    c #C9CACE",
+"P+    c #4D4D4D",
+"Q+    c #D3D4D7",
+"R+    c #B7B8BB",
+"S+    c #1A1A1A",
+"T+    c #5A5A5C",
+"U+    c #A9AAAC",
+"V+    c #626365",
+"W+    c #CECECE",
+"X+    c #CBCDD0",
+"Y+    c #A9AAAE",
+"Z+    c #8A8A8C",
+"`+    c #646465",
+" @    c #8F8F8F",
+".@    c #D4D5D6",
+"+@    c #D5D6D7",
+"@@    c #6B6C6C",
+"#@    c #5A5A5A",
+"$@    c #909090",
+"%@    c #FFFBFC",
+"&@    c #D07781",
+"*@    c #D67D86",
+"=@    c #D0737D",
+"-@    c #D17680",
+";@    c #CE737D",
+">@    c #D27A83",
+",@    c #D57982",
+"'@    c #CF7680",
+")@    c #D27982",
+"!@    c #CC6F7A",
+"~@    c #D1757F",
+"{@    c #DC9AA1",
+"]@    c #C9CBCE",
+"^@    c #D5D5D5",
+"/@    c #F4CDD1",
+"(@    c #F3C6CA",
+"_@    c #FDF3F4",
+":@    c #D03E4D",
+"<@    c #CF3C4A",
+"[@    c #D1404E",
+"}@    c #D24351",
+"|@    c #CA7A83",
+"1@    c #D5D5D6",
+"2@    c #5B5B5C",
+"3@    c #252525",
+"4@    c #848588",
+"5@    c #7F8081",
+"6@    c #232323",
+"7@    c #D0D0D0",
+"8@    c #FCEDEE",
+"9@    c #E4838D",
+"0@    c #E06D79",
+"a@    c #F3B9BF",
+"b@    c #F8E5E7",
+"c@    c #FAEAEB",
+"d@    c #FFF8F8",
+"e@    c #D03D4B",
+"f@    c #CF3C4B",
+"g@    c #CF737C",
+"h@    c #CBCCCF",
+"i@    c #1D1D1D",
+"j@    c #484848",
+"k@    c #838485",
+"l@    c #B1B1B4",
+"m@    c #CACBCE",
+"n@    c #C8C9CC",
+"o@    c #5C5C5D",
+"p@    c #FFF4F6",
+"q@    c #EFA6AD",
+"r@    c #D03F4D",
+"s@    c #D7515E",
+"t@    c #E99AA1",
+"u@    c #FBEBED",
+"v@    c #FFFDFD",
+"w@    c #FFF6F8",
+"x@    c #CF3B4A",
+"y@    c #CE3847",
+"z@    c #D4737D",
+"A@    c #9A9A9B",
+"B@    c #6D6E6F",
+"C@    c #A4A5A7",
+"D@    c #C5C6C9",
+"E@    c #CCCED2",
+"F@    c #D1D1D1",
+"G@    c #FFFCFD",
+"H@    c #EFAEB5",
+"I@    c #D85864",
+"J@    c #D24251",
+"K@    c #E06D78",
+"L@    c #CE3947",
+"M@    c #C97781",
+"N@    c #D6D7D9",
+"O@    c #CBCDD1",
+"P@    c #C7C8C9",
+"Q@    c #565657",
+"R@    c #79797B",
+"S@    c #F5C4C9",
+"T@    c #D95E6A",
+"U@    c #F2B5BB",
+"V@    c #FEFDFE",
+"W@    c #FDF9FA",
+"X@    c #CE3948",
+"Y@    c #D03C4B",
+"Z@    c #CE727C",
+"`@    c #D5D6D8",
+" #    c #C2C3C5",
+".#    c #5D5E60",
+"+#    c #ADAEB1",
+"@#    c #C4C5C7",
+"##    c #B4B4B7",
+"$#    c #939393",
+"%#    c #E27984",
+"&#    c #FAFAFA",
+"*#    c #F8F8F9",
+"=#    c #F7F4F5",
+"-#    c #EDEDEE",
+";#    c #E3E3E5",
+">#    c #E0DFE3",
+",#    c #DCDFE3",
+"'#    c #F4BDC2",
+")#    c #EEAEB4",
+"!#    c #EA919A",
+"~#    c #DB6470",
+"{#    c #D5525F",
+"]#    c #D75461",
+"^#    c #D24453",
+"/#    c #CE3646",
+"(#    c #D66D78",
+"_#    c #D9DADA",
+":#    c #C2C3C4",
+"<#    c #2A2A2A",
+"[#    c #1C1D1D",
+"}#    c #2B2B2B",
+"|#    c #6A6B6B",
+"1#    c #8A8A8D",
+"2#    c #D7D8DB",
+"3#    c #CFD1D5",
+"4#    c #C3C4C6",
+"5#    c #E4E5E6",
+"6#    c #FFFAFB",
+"7#    c #FFF8F9",
+"8#    c #FEE4E7",
+"9#    c #EEA3AB",
+"0#    c #D26F7A",
+"a#    c #CFD1D3",
+"b#    c #D6D6D8",
+"c#    c #383838",
+"d#    c #7D7D7F",
+"e#    c #A3A4A7",
+"f#    c #C8C9CE",
+"g#    c #CFD1D4",
+"h#    c #7F8080",
+"i#    c #7F7F7F",
+"j#    c #F0F0F0",
+"k#    c #E0E1E3",
+"l#    c #F0B7BD",
+"m#    c #E6838D",
+"n#    c #D8616D",
+"o#    c #CCCDD1",
+"p#    c #B4B4B5",
+"q#    c #3A3A3B",
+"r#    c #1C1C1D",
+"s#    c #4C4C4C",
+"t#    c #868789",
+"u#    c #8A8B8D",
+"v#    c #949597",
+"w#    c #B8B9BA",
+"x#    c #CACACB",
+"y#    c #949494",
+"z#    c #E9E9EA",
+"A#    c #EB969F",
+"B#    c #D66A75",
+"C#    c #2E2E2F",
+"D#    c #757679",
+"E#    c #A8A9AA",
+"F#    c #C1C3C7",
+"G#    c #7C7C7E",
+"H#    c #FCFCFD",
+"I#    c #EEEEEF",
+"J#    c #D7D7D9",
+"K#    c #FCE0E3",
+"L#    c #E37D88",
+"M#    c #D34755",
+"N#    c #CE747E",
+"O#    c #D6D7D8",
+"P#    c #D4D5D8",
+"Q#    c #C8C9CB",
+"R#    c #AFB0B1",
+"S#    c #FFFDFE",
+"T#    c #E7E8E9",
+"U#    c #F5B7BE",
+"V#    c #D06C76",
+"W#    c #5B5B5B",
+"X#    c #FDFEFF",
+"Y#    c #E0DFE2",
+"Z#    c #D6525F",
+"`#    c #D24250",
+" $    c #CC7B85",
+".$    c #848486",
+"+$    c #303031",
+"@$    c #FBFBFB",
+"#$    c #ECEAED",
+"$$    c #FFF9FA",
+"%$    c #EEAAB1",
+"&$    c #D07680",
+"*$    c #B4B6B9",
+"=$    c #828283",
+"-$    c #E5E6E7",
+";$    c #ECA2AA",
+">$    c #D14150",
+",$    c #D46571",
+"'$    c #C6C7C9",
+")$    c #959596",
+"!$    c #1B1B1B",
+"~$    c #EFEEF0",
+"{$    c #FFF7F8",
+"]$    c #E68891",
+"^$    c #343435",
+"/$    c #D7D7D7",
+"($    c #FCFCFC",
+"_$    c #DCDDDE",
+":$    c #CECFD3",
+"<$    c #FCE8EA",
+"[$    c #D7646F",
+"}$    c #C9CACC",
+"|$    c #282929",
+"1$    c #E6E3E6",
+"2$    c #EDA2AA",
+"3$    c #CF3B49",
+"4$    c #D1404F",
+"5$    c #D46570",
+"6$    c #AEAFB0",
+"7$    c #414142",
+"8$    c #FDFDFD",
+"9$    c #8A8B8E",
+"0$    c #CDCED1",
+"a$    c #F0AFB6",
+"b$    c #CE3645",
+"c$    c #D86672",
+"d$    c #F5F5F6",
+"e$    c #FDEBED",
+"f$    c #DB5F6C",
+"g$    c #CF7E88",
+"h$    c #9D9EA0",
+"i$    c #363737",
+"j$    c #E9E9EB",
+"k$    c #E7929B",
+"l$    c #CD747E",
+"m$    c #B0B1B3",
+"n$    c #717272",
+"o$    c #2D2D2D",
+"p$    c #232324",
+"q$    c #E6E3E5",
+"r$    c #EDADB3",
+"s$    c #D3727D",
+"t$    c #D1D3D6",
+"u$    c #C3C5C8",
+"v$    c #98999B",
+"w$    c #5B5C5F",
+"x$    c #272727",
+"y$    c #9B9B9B",
+"z$    c #D2D4D7",
+"A$    c #CDCED2",
+"B$    c #D8D9D9",
+"C$    c #FCE5E7",
+"D$    c #CD7C86",
+"E$    c #CED0D2",
+"F$    c #C8CACD",
+"G$    c #828284",
+"H$    c #F4F3F4",
+"I$    c #FFF7F9",
+"J$    c #DD626E",
+"K$    c #CF3A48",
+"L$    c #D86773",
+"M$    c #CFD0D2",
+"N$    c #959595",
+"O$    c #3B3B3C",
+"P$    c #EAEAEC",
+"Q$    c #E8919A",
+"R$    c #D56671",
+"S$    c #A1A2A4",
+"T$    c #454546",
+"U$    c #EBEBEC",
+"V$    c #F0ADB4",
+"W$    c #D16E79",
+"X$    c #363637",
+"Y$    c #FCEBED",
+"Z$    c #F6D8DB",
+"`$    c #EFABB2",
+" %    c #E3858F",
+".%    c #DD737E",
+"+%    c #EDB7BC",
+"@%    c #F5C2C7",
+"#%    c #D76571",
+"$%    c #CECED0",
+"%%    c #767677",
+"&%    c #343536",
+"*%    c #FADFE2",
+"=%    c #F0B3B9",
+"-%    c #E3747F",
+";%    c #D54C59",
+">%    c #ECECED",
+",%    c #F8CDD1",
+"'%    c #CB727C",
+")%    c #CDCFD2",
+"!%    c #D8D8D9",
+"~%    c #878789",
+"{%    c #FCE2E5",
+"]%    c #F6CACE",
+"^%    c #EEABB1",
+"/%    c #DC6A76",
+"(%    c #EDAFB6",
+"_%    c #F6C4C9",
+":%    c #CE7780",
+"<%    c #404142",
+"[%    c #333334",
+"}%    c #FEF5F6",
+"|%    c #F4C1C6",
+"1%    c #D06B75",
+"2%    c #B6B7BA",
+"3%    c #797A7B",
+"4%    c #EDABB2",
+"5%    c #CC7580",
+"6%    c #C5C6C7",
+"7%    c #9D9E9F",
+"8%    c #8C8E91",
+"9%    c #DFDFDF",
+"0%    c #F1EDEE",
+"a%    c #E47C87",
+"b%    c #D66672",
+"c%    c #ADAEAF",
+"d%    c #9C9DA0",
+"e%    c #6F6F70",
+"f%    c #F8F5F6",
+"g%    c #FFFBFB",
+"h%    c #D95763",
+"i%    c #D5636F",
+"j%    c #C8C8CA",
+"k%    c #3D3D3E",
+"l%    c #373737",
+"m%    c #F7D0D4",
+"n%    c #BBBCBF",
+"o%    c #717172",
+"p%    c #E3E4E6",
+"q%    c #EAA7AD",
+"r%    c #D66671",
+"s%    c #BBBBBD",
+"t%    c #9D9EA1",
+"u%    c #ECECEE",
+"v%    c #E58F97",
+"w%    c #D6646F",
+"x%    c #BEBEC1",
+"y%    c #737374",
+"z%    c #D7D6D9",
+"A%    c #F9E6E8",
+"B%    c #D34654",
+"C%    c #CC7680",
+"D%    c #ABABAD",
+"E%    c #97989A",
+"F%    c #9C9D9E",
+"G%    c #939598",
+"H%    c #9F9FA0",
+"I%    c #97989B",
+"J%    c #F0EDEE",
+"K%    c #E9A3AA",
+"L%    c #D2707A",
+"M%    c #9D9D9F",
+"N%    c #131415",
+"O%    c #FDEEF0",
+"P%    c #CE7881",
+"Q%    c #A7A9AE",
+"R%    c #222223",
+"S%    c #EDEAEC",
+"T%    c #E58C95",
+"U%    c #CB757E",
+"V%    c #BDBEC0",
+"W%    c #282829",
+"X%    c #E8E5E6",
+"Y%    c #F8D7DB",
+"Z%    c #D6636F",
+"`%    c #2F3030",
+" &    c #FBF8F8",
+".&    c #FAE1E4",
+"+&    c #D14250",
+"@&    c #CF3948",
+"#&    c #C8C9CD",
+"$&    c #4D4E50",
+"%&    c #F3F3F4",
+"&&    c #FCEEEF",
+"*&    c #E0727D",
+"=&    c #D13F4D",
+"-&    c #D46470",
+";&    c #C2C2C4",
+">&    c #767779",
+",&    c #D9D9D9",
+"'&    c #EFEFEF",
+")&    c #E58D96",
+"!&    c #D76470",
+"~&    c #515253",
+"{&    c #FCF0F1",
+"]&    c #E27882",
+"^&    c #CB7780",
+"/&    c #191919",
+"(&    c #D8D8D8",
+"_&    c #F5F5F5",
+":&    c #DCDBDD",
+"<&    c #F9E1E4",
+"[&    c #DC6772",
+"}&    c #D26E79",
+"|&    c #B4B5B6",
+"1&    c #B1B2B4",
+"2&    c #929395",
+"3&    c #4A4B4C",
+"4&    c #F9F8F9",
+"5&    c #EA9FA7",
+"6&    c #D4505D",
+"7&    c #CD737C",
+"8&    c #8B8B8C",
+"9&    c #EEEBEC",
+"0&    c #D6D8DB",
+"a&    c #F3CCCF",
+"b&    c #E68A93",
+"c&    c #CB7882",
+"d&    c #D2D2D3",
+"e&    c #6C6D6F",
+"f&    c #D6D6D6",
+"g&    c #D9D7DA",
+"h&    c #F8D9DC",
+"i&    c #E68C95",
+"j&    c #D16C77",
+"k&    c #8B8C8E",
+"l&    c #F4F4F4",
+"m&    c #959293",
+"n&    c #FBFAFA",
+"o&    c #F6F7F7",
+"p&    c #ECE9EB",
+"q&    c #E4E4E4",
+"r&    c #FEF1F3",
+"s&    c #F4C9CE",
+"t&    c #E9929B",
+"u&    c #DA6470",
+"v&    c #D54B58",
+"w&    c #CC6F78",
+"x&    c #9B9B9D",
+"y&    c #A1A1A2",
+"z&    c #F9F9F9",
+"A&    c #F8F8F8",
+"B&    c #F7F7F7",
+"C&    c #DADBDF",
+"D&    c #D7D8DC",
+"E&    c #DADADD",
+"F&    c #D9DADC",
+"G&    c #D8D2D5",
+"H&    c #CFBBBF",
+"I&    c #D3BABE",
+"J&    c #D2B9BD",
+"K&    c #D5BABE",
+"L&    c #D7A8AF",
+"M&    c #D9ABB1",
+"N&    c #D0B6BA",
+"O&    c #D2BBBF",
+"P&    c #B2B3B5",
+"Q&    c #979797",
+"R&    c #A7A7A8",
+"S&    c #BEC0C3",
+"T&    c #6A696B",
+"U&    c #272829",
+"V&    c #E7E7E8",
+"W&    c #CBCBCE",
+"X&    c #D4D1D2",
+"Y&    c #3B3B3B",
+"Z&    c #444444",
+"`&    c #E8E8E9",
+" *    c #585859",
+".*    c #AAAAAA",
+"+*    c #C1C2C5",
+"@*    c #909192",
+"#*    c #777778",
+"$*    c #6C6D6D",
+"%*    c #D3D3D3",
+"&*    c #666769",
+"**    c #484849",
+"=*    c #A9AAAD",
+"-*    c #737476",
+";*    c #202020",
+">*    c #666767",
+",*    c #BBBBBC",
+"'*    c #BFBFC0",
+")*    c #121212",
+"!*    c #1F1F20",
+"~*    c #CBCCCD",
+"{*    c #C3C4C7",
+"]*    c #DADADA",
+"^*    c #737474",
+"/*    c #8D8D8F",
+"(*    c #CDCED0",
+"_*    c #969697",
+":*    c #959597",
+"<*    c #CDCECF",
+"[*    c #D3D4D8",
+"}*    c #919191",
+"|*    c #191A1A",
+"1*    c #868688",
+"2*    c #C5C5C8",
+"3*    c #858586",
+"4*    c #A1A1A1",
+"5*    c #ABACAE",
+"6*    c #8E8E8E",
+"7*    c #8B8B8B",
+"8*    c #AEAEB0",
+"9*    c #CFCFCF",
+"0*    c #727273",
+"a*    c #525253",
+"b*    c #8D8D8E",
+"c*    c #89898A",
+"d*    c #656667",
+"e*    c #A5A5A7",
+"f*    c #949496",
+"g*    c #CFD0D1",
+"h*    c #A0A1A2",
+"i*    c #BDBDBF",
+"j*    c #A4A5A8",
+"k*    c #5E5F61",
+"l*    c #808080",
+"m*    c #CDCDCD",
+"n*    c #ECECEC",
+"o*    c #B1B1B1",
+"p*    c #707071",
+"q*    c #1E1E1E",
+"r*    c #68686A",
+"s*    c #9C9D9F",
+"t*    c #7A7A7B",
+"u*    c #828282",
+"v*    c #AAABAC",
+"w*    c #656668",
+"x*    c #9C9C9E",
+"y*    c #B6B7B9",
+"z*    c #E8E8EA",
+"A*    c #68696A",
+"B*    c #B2B3B4",
+"C*    c #C0C1C3",
+"D*    c #3D3D3D",
+"E*    c #999999",
+"F*    c #C1C1C1",
+"G*    c #909193",
+"H*    c #4C4D4E",
+"I*    c #8E8E8F",
+"J*    c #858688",
+"K*    c #989898",
+"L*    c #A7A8A9",
+"M*    c #616162",
+"N*    c #111111",
+"O*    c #A8A8A8",
+"P*    c #B0ADAF",
+"Q*    c #5C5D5E",
+"R*    c #CACACA",
+"S*    c #A0A0A1",
+"T*    c #565656",
+"U*    c #959698",
+"V*    c #979799",
+"W*    c #707172",
+"X*    c #E3E3E3",
+"Y*    c #F3F4F5",
+"Z*    c #434343",
+"`*    c #575758",
+" =    c #121213",
+".=    c #BFBFBF",
+"+=    c #BABBBE",
+"@=    c #C9C9C9",
+"#=    c #6F7071",
+"$=    c #D0D1D2",
+"%=    c #646464",
+"&=    c #BFC0C2",
+"*=    c #929292",
+"==    c #636363",
+"-=    c #7B7B7C",
+";=    c #AFAFB0",
+">=    c #D0D0D2",
+",=    c #636465",
+"'=    c #A3A4A6",
+")=    c #9B9C9E",
+"!=    c #C6C6C6",
+"~=    c #A0A1A3",
+"{=    c #454545",
+"]=    c #ABABAB",
+"^=    c #575757",
+"/=    c #29292A",
+"(=    c #6E6F70",
+"_=    c #A4A5A6",
+":=    c #A0A0A0",
+"<=    c #DBDBDD",
+"[=    c #AAAAAB",
+"}=    c #E0E0E0",
+"|=    c #707070",
+"1=    c #D8D9DB",
+"                                                                                                                                                                                                                                                          ",
+"                                                                                                                                                                      .                                                                                   ",
+"                                                                                                                                                                    + @                                                                                   ",
+"                                                                                                                                                                    # $                                                                                   ",
+"                                                                                                                                                                  % &                                                                                     ",
+"                                                                                                                                                                * = -                                                                                     ",
+"                                                                                              ; ; > > , ' > > > > ) ) ) ) ) ! ~ { ] ^                         / ( _ :                                                                                     ",
+"                                                                                    < < < > > > > > > [ } > > > > ) ) ) ) ) ) | 1 ) ) ! 2 ) 3 4               5 5 6                                                                                       ",
+"                                                                                7 > > > > > > > > > > 8 9 > > > > ) ) ) ) ) 0 a b ) ) ) ) ) ) ) c d         . e = f                                                                                       ",
+"                                                                          > > > > > > > > > > > > > > g h > > > > ) ) ) ) ) i j k ) ) ) ) ) ) ) ) ) ) l m n = = = o                                                                                       ",
+"                                                                    p > > > > > > > > > > > > > > > > [ q r > > > ) ) ) ) ) s = t ) ) ) ) ) ) ) ) ) ) ) u v w = x                                                                                         ",
+"                                                                y > > > > > > > > > > > > > > > > > > z A B C > > ) ) ) ) D E = F ) ) ) ) ) ) ) ) ) ) G = w H = I J                                                                                       ",
+"                                                            K > > > > > > > > > > > > > > > > > > > > L q M N > > ) ) ) ) O w 6 _ ) ) ) ) ) ) ) ) ) P Q _ = 6 6 R ) S T                                                         U                         ",
+"                                                        V > > > > > > > > > > > > > > > > > > > > > > W X Y Z > > ) ) ) `  ...+.( ) ) ) ) ) ) ) ) ` @._ +.#.$.%.) ) ) ) &.                                                    *.                          ",
+"                                                    =.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.;.>.,.'.-.-.) ) ) ).= 6 5 e !.) ) ) ) ) ) ) ~.6 5 e {...].) ) ) ) ) ) )                                             ^./.                            ",
+"                                                  (._.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) ) ) :.<.[.e e }.) ) ) ) ) ) |.1.[.e e 2.3.4.) ) ) ) ) ) ) l J                                     5.6.F                               ",
+"                                                -.-.7.8.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) ) 3 <.5 3.5 5 9.) ) ) ) ) l 0.a.#.5 5 #.b.) ) ) ) ) ) ) ) ) ) J                                 c. .d.                                ",
+"                                            e.-.-.-.f.g.h.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) i.j.k.k.6 k.k.l.) ) ) ) J m.k.6 = k.k.= n.) ) ) ) ) ) ) ) ) ) ) o.                            p.<.d.                                  ",
+"                                          > > > > > q.r.h s.> > > > > > > > > > > > > > > > > > > > > > > > > > > ) t.x +.+.u._ +.v.) ) ) ) w.+.+.2.3.+.+.3.x.) ) ) ) ) ) ) ) ) ) ) ) ) y.                    z.<.6 +.                                    ",
+"                                        A.> > > > > > B.C.D.E.> > > > > > > > > > > > > > > > > > > > > > > > > > ) F.G.( ( H.( ( I.) ) ) J.K.( ( H.L.( ( M.o.) ) ) ) ) ) i.N.O.) ) ) ) ) )               P.z.( ( Q.                                      ",
+"                                      > > > > > > > > R.S.T.U.V.> > > > > > > > > > > > > > > > > > > > > > > > > l W.k.k.k.6 k.k._ X.) Y.3.= k.k.L.H.k.k.Z.) ) ) ) ) ) `. +.+) ) ) ) ) ) ) 3           ++j k.k.@+                                        ",
+"                                    > > > > > > > > > #+$+%+&+*+> > > > > > > > > > > > > > > > > > > > > > > > > =+= 5 5 5 6 5 5 _ -+` ;+5 = 5 5 = 6 5 5 >+) ) ) ) ,+'+)+<.!+) ) ) ) ) ) ) ) ~+       .5 H.5 {+                                          ",
+"                                  > > > > > > > > > > > ]+^+/+> > > > > > > > > > > > > > > > > > > > > > > > > > L.= 6 e 6 6 e 6 = (+_+<.e H.6 e H.L.e 3.P ) ) ) :+<+6 [+[.1 ) ) ) ) ) ) ) ) ) }+++<.e 6 6 e                                             ",
+"                                > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > j |+= = = 1+= = w 2+|+= = 6 = = 6 _ = 3+) ) !.4+5+[+= = 6+) ) ) ) ) ) ) ) 7+8+9+|+= = = 0+                                              ",
+"                              > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _ $.k.5 k.a+5 k.b+c+E k.5 1+k.5 1+|+= }.) d+e+<.f+g+k.5 ).) ) ) ) ) ) i.h+i+k.5 6 k.5 6 j+                                              ",
+"                            > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > k+L.( ( ( H.( ( ( 6 = = ( H.( ( H.L._ ) l+m+_ ( 6 g+( n+l+) ) ) ) ) ` o+|+( ( ( 1+( ( p+                                                ",
+"                          q+> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > r+s++.+.+.t++.+.+...u+<.+.t++.+.t+s+5+v+1.t++.+.t+s++.w+) ) ) ) i.x+y+<.t++.+.+.s+= z+)                                                 ",
+"                        A+> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > H.6 5 5 5 = 5 5 5 n+E 5 5 = 5 5 = 6 B+5 C+= 5 5 = 6 5 D+) ) ) D+P.d.5 5 s+5 5 5 E+F+) ) }.                                              ",
+"                      =.> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _ 6 = = = = = = = 6 = = = = = = = 6 = = 6 = = = = 6 G+) ) Y.H+I+2.J+= = <.= = K+=+) ) ) )                                               ",
+"                      > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > /.<.= = = G.= = = <.= = = G.= = G.<.= = <.G.= = G.<.L+) M+N+j = H O+= = O+= = P+) ) ) ) ) )                                             ",
+"                    > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Q+#.( +.( $.+.( +.#.( +.( $.+.( $.#.( +.#.$.+.( $.R+S+T+U+f++.( $.#.( +.#.( V+) ) ) ) ) ) ) 7+                                          ",
+"                  W+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.u.X+e e e a.e e e X+e e e a.e e a.X+e e X+a.e e a.Y+Z+6 = 6 e e 6 = e e G+`+) ) ) ) ) ) ) ) )                                           ",
+"                 @-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. .6 e e e = e e e 6 e e e = e e = 6 e e 6 = e e = .@e e +@_ e e _ +@e d.@@) ) ) ) ) ) ) ) ) ) 7+                                        ",
+"                -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.j 6 e e e = e e e 6 e e e = e e = 6 e e 6 = e e = 6 e e 6 = e e = 6 e #@) ) ) ) ) ) ) ) ) ) ) ) !.                                      ",
+"              $@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.%@&@*@=@=@-@;@-@-@>@,@-@-@-@'@-@=@;@,@>@)@,@!@-@-@'@*@~@-@{@]@e e X+^@+ ) ) ) ) ) ) ) ) ) ) ) ) ) 7+                                      ",
+"              /@(@_@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.,.:@<@[@[@A }@[@[@[@}@[@[@}@T.}@[@}@}@[@C.}@}@[@}@T.}@C.}@|@= e = 1@2@) ) ) ) i.X.3@b 4@5@6@) ) ) ) ,+                                    ",
+"            7@8@9@0@a@b@c@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.d@[@S.C.C.e@f@C.C.C.:@C.C.:@T.:@C.:@C.C.C.:@C.C.:@T.C.C.:@g@= e h@/ M+y.i@i@j@k@l@m@Q+n@o@) ) ) ) ) )                                     ",
+"            -.-.p@q@r@e@s@t@u@v@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.w@C.T.C.C.C.[@C.C.C.x@C.C.x@}@x@C.x@y@C.C.x@y@C.x@}@y@C.x@z@= e A@B@C@D@/.E@e E e X+e 9.) ) ) ) ) ) ) 7+                                  ",
+"          F@-.-.-.G@H@I@C.J@K@w@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.,.C.T.C.C.x@C.C.C.C.[@C.C.[@L@[@C.[@J@C.C.[@J@C.[@L@J@C.[@M@= e e N@O@k+H.O@e e e P@Q@) ) ) ) ) ) ) ) )                     s R@          ",
+"          -.-.-.-.-.G@S@T@f@U@%@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.V@W@A Y C.C.C.X@C.C.C.r@C.C.C.x@C.C.Y@[@C.C.r@C.C.C.x@[@C.C.Z@`@L.e `@n+e e n+e e  #.#) ) ) ) ) ) ) ) ) ) J             Z++#@###            ",
+"        $#-.-.-.-.-.-.G@;.%#G@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.&#*#=#-#;#>#,#'#'#)#!#~#{#]#r@C.^#C.C.C./#C.C./#^#C.C.^#/#C.C./#^#C.C.(#_#C+e 6 = e e = e :#<#) ) ) ) ) ) ) ) M+[#'+}#|#1#2# .3#k+k+4#                ",
+"        -.-.-.-.-.-.-.-.-.G@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.&#5#p.Q+k+e = e C+-.-.-.-.6#7#8#9#s@r@C.C.C.C.C.C.C.T.C.C.T.C.C.C.C.T.C.C.0#H.L.e a#b#e e +@m@h+) ) ) ) ) ` ! c#d#e#f#6 k+[.g#e e b#e h#                  ",
+"      i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.j#k#& 6 k+= e e = e = -.-.-.-.-.-.-.7#q.l#m#r@C.C.C.C.C.T.C.C.T.C.C.C.C.T.C.C.n#%.o#e o#_#e e p#q#) P r#s#t#u#v#w#6 6 o#e e e _#e = = x#                      ",
+"      y#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*#z#Q+k+e e 6 = e e = e /.-.-.-.-.-.-.-.-.-.G@;.A#r.h C.C.[@x@C.C.x@[@C.C.[@x@C.C.B#= 6 e 6 = e L.>+C#D#E#F#k+e k+$.e b+e _#= e e o#e H.G#                        ",
+"      -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.H#I#j H.%.J#e _ J#%.e e %.e _ -.-.-.-.-.-.-.-.-.-.-.-.K#L#M#C.T.C.C.C.C.T.C.C.T.C.C.C.N#O#L.e 6 = e H.P#6 L.e = e e e 6 e e e = k+e e Q#R#                            ",
+"    i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.S#T#j e e C+O#e e O#C+e e C+e = -.-.-.-.-.-.-.-.-.-.-.-.-.6#U#r@x@[@C.C.[@x@C.C.x@[@C.C.V#6 e e 6 = e L.e e a#_ %._ _ e J#k+e e ]@e e Q#W#)                             ",
+"    ^@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.X#Y#H.= e e = 6 e e 6 = e e = e k+-.-.-.-.-.-.-.-.-.-.-.-.-.-.6#l#Z#`#C.C.`#X@C.C.X@`#C.C. $u.e e 6 = e a#e = e e C+e e e O#H.e e ]@e .$+$) )                             ",
+"    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.@$#$k+b+%.e e %.u.e e u.%.e e %.e _ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.$$%$Y C.C.[@x@C.C.x@[@C.C.&$%.e e 6 = e e e Q+e e ]@e e e $.e e e *$=$) ) ) ) )                           ",
+"    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.S#-$ .e ]@a.e _ a.]@_ _ ]@a._ e $.e ( -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.G@;$>$C.T.C.C.C.C.T.C.C.,$C+e e C+O#e e e e e e O#e e e C+e '$)$!$) ) ) ) ) )                           ",
+"  i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.~$j e e = 6 e e 6 = e e = 6 e e 6 e 6 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.{$]$C.T.C.C.C.C.T.C.C.V#= E e ]@$.e e b+e e e 6 e e e = @#^$) ) ) ) ) ) ) )                           ",
+"  /$-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.($_$:$e e %.u.e e u.%.e e %.u.e e u.e 6 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.<$M#`#X@C.C.X@`#C.C.[$%.e e = 6 e e a#e e e 6 e e }$B@|$) ) ) ) ) ) ) ) )                           ",
+"  -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.1$H.C+e e C+O#e e O#C+e e C+O#e e O#e ( -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.2$M#3$C.C.3$4$C.C.5$6 e e O#C+e e C+e e e 6 = 6$7$) ) ) ) ) ) ) ) ) ) ) )                         ",
+"  -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.8$j C+O#e e O#C+e e C+O#e e O#C+e e C+e j -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.6#9@C.C.C.C.T.C.C.V#b#e e 6 = e e = e e e d.9$l ) ) ) ) ) ) ) ) ) ) ) ) )                         ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.5#k+0$f+e e f+0$e e 0$f+e e f+0$e e 0$e /.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.a$y@C.C.b$^#C.C.c$`@e e 6 = e e = e e f c#` ) ) ) ) ) ) ) ) ) ) ) ) ) )                         ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.d$= e [+g+e e g+[+e e [+g+e e g+[+e e [+e *.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.e$f$C.C.b$^#C.C.g$n+e e 6 = e e = e `@h$G#i$3 ) ) ) ) ) ) ) ) ) ) ) ) )                         ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.j$j e = 6 e e 6 = e e = 6 e e 6 = e e = e _ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.k$C.C.C.T.C.C.l$G.e e [+g+e e g+e G.e [. .m$n$q#o$p$` ) ) ) ) ) ) ) ) )                       ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.q$e e = 6 e e 6 = e e = 6 e e 6 = e e = e /.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.r$C.C.b$^#C.C.s$6 <.e = 6 e e 6 e e e 6 e e t$k+t$u$v$w$x$` ) ) ) ) ) )                       ",
+"y$-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.v@z$e e A$B$e e B$A$e e A$B$e e B$A$e e A$e  .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.C$h C.b$^#C.C.D$$._ e b#E$e e E$e e e $.e e _ E$e e e f+F$G$M+) ) ) ) )                       ",
+"-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.H$k+e e 6 = e e = 6 e e 6 = e e = 6 e e 6 e  .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.I$J$C.K$>$C.C.L$6 e e J#A$e e A$e e e B$e e e A$e e M$N$O$y.) ) ) ) ) )                       ",
+"-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.P$E e e E b+e e b+E e e E b+e e b+E e e E e 6 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Q$C.T.C.C.C.R$E e e = 6 e e 6 e e e = e e e 6 {+S$T$Y.) ) ) ) ) ) ) )                       ",
+"-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.U$]@e e ]@$.e e $.]@e e ]@$.e e $.]@e e ]@e *.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.V$C.q h C.C.W$b+e e b+E e e E e e k+O#e k+C+A@X$) ) ) ) ) ) ) ) ) ) )                       ",
+"-.-.Y$Z$`$ %.%.%+%-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.P$]@e e ]@$.e e $.]@e e ]@$.e e $.]@e e ]@e _ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.@%C.q h C.C.#%E e e E b+e e b+e e k+A$$%%%&%`.) ) ) ) ) ) ) ) ) ) ) )                       ",
+"*%=%-%;%}@T.T.h 8 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.>%= e e = 6 e e 6 = e e = 6 e e 6 = e e = e k+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.,%C.^#b$C.C.'%]@e e )%!%e e !%e e e ~%~ ) ) ) ) ) ) ) ) ) ) ) ) ) ) )                       ",
+"-.w@{%]%^%9@/%~#(%-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.U$)%e e )%!%e e !%)%e e )%!%e e !%)%e e )%e _ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-._%C.T.C.C.C.:%+@e e !%)%e e )%e e e )+S$<%[%y.) ) ) ) ) ) ) ) ) ) ) )                       ",
+"-.-.-.-.-.%@%@d@}%-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.T#`@_ e `@)%e e )%`@e _ `@)%_ _ )%`@_ e `@e k+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.|%C.T.C.C.C.1%_ e e = 6 e e 6 e e e = e k+k+2%3%H+) ) ) ) ) ) ) ) ) )                       ",
+"-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.P$%.e e )%!%e e !%)%e e )%!%e e !%)%e e )%e k+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.4%C.T.C.C.C.5%!%E e ]@$.e e $.e e e X+e e e `@6 6%7%8%2 X.) ) ) ) ) )                       ",
+"9%-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.0%O#e e b+E e e E b+e e b+E e e E b+e e b+e 6 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.a%C.q h C.C.b%= e e _ 6 e e 6 e e _ e e e e = e e _ _ +@c%d%e%x$) ) )                       ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.f%:$e e ]@$.e e $.]@e e ]@$.e e $.]@e e ]@e  .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.g%h%C.C.T.C.C.i%]@e e !%)%e e )%e e e +@e e e = e e e 6 e e k+O@j%~%k%l%                      ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.a.e e = 6 e e 6 = e e = 6 e e 6 = e e = e 6 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.m%h C.C.T.C.C.V#= E e )%!%e e !%e e e )%e e e !%e e e )%e e e !%e 6 6 [.n%o%                  ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.p%e e E b+e e b+E e e E b+e e b+E e e E e _ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.q%C.C.q h C.C.r%= e e = 6 e e 6 e e e = _ e e 6 e e e = _ e e 6 e e e +@k+ .s%t%e#            ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.u%e e )%!%e e !%)%e e )%!%e e !%)%e e )%e k+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.v@v%C.C.h q C.C.w%]@e e !%)%e e )%e e e !%e e e )%e e e !%e e e )%e e e e e e )%!%C+N@x%y%      ",
+"i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.($z%e = 6 e e 6 = e e = 6 e e 6 = e e = e _ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.A%B%C.C.C.T.C.C.C%!%E e 6 = e e = e e D%E%O O O F%O O O E%O O O F%O O O O O O F%E%E%O G%H%I%@.  ",
+"  -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.J%k+]@2.k+e 2.]@e e ]@2.e k+2.]@k+k+]@e *.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.K%f@C.C.q h C.C.L%6 e e 6 = e e = e e M%N%) ) ) ) ) ) ) ) ) ) ) ) ) ) )                         ",
+"  -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.v@z$E b#k+e b#E e e E b#e k+b#E k+k+E e  .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.O%~#y@C.C.K$>$C.C.P%$.E e 6 = e e = e e H.Q%R%) ) ) ) ) ) ) ) ) ) ) ) ) )                         ",
+"  y$-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.S%_ B$e e B$A$e e A$B$e e B$A$e e A$e k+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.T%C.>$C.C.>$K$C.C.U%6 e e A$B$e e B$e e e s+V%W%) ) ) ) ) ) ) ) ) ) ) )                           ",
+"    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.X%k+e e 6 = e e = 6 e e 6 = e e = e  .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Y%h C.T.C.C.T.C.C.C.Z%A$e e = 6 e e 6 e e e = e 0.`%) ) ) ) ) ) ) ) ) ) )                           ",
+"    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. &[.e e 6 = e e = 6 e e 6 = e e = e t$-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-..&s@C.+&@&C.C.@&+&C.C.0#= e e = 6 e e 6 e e e = e e #&$&) ) ) ) ) ) ) ) ) )                           ",
+"    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.%&`@e $.]@e e ]@$.e e $.]@e e ]@e k+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.&&*&=&C.T.C.C.C.C.T.C.C.-&[+n+e [+g+e e g+e e e [+e e ..;&>&) ) ) ) ) ) ) ) )                           ",
+"    ,&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.'&e $.]@e e ]@$.e e $.]@e e ]@e *.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.7#)&=&C.C.4$3$C.C.3$4$C.C.!&g+<.e g+[+e e [+e e e g+k+k+e [+k+~&) ) ) ) ) ) )                             ",
+"      -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-#9%[+e e [+g+e e g+[+e e [+e _ -.-.-.-.-.-.-.-.-.-.-.-.-.-.{&]&=&C.C.C.C.T.C.C.T.C.C.C.^&= `@e f+0$e e 0$e e e f+....e 0$e Q+(+/&) ) ) ) )                             ",
+"      (&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-._&:&e _ H.C+_ _ C+H._ e H.e k+-.-.-.-.-.-.-.-.-.-.-.-.-.<&[&r@C.3$C.C.3$4$C.C.4$3$C.C.}&]@6 e 6 = e a#6%|&|&|&1&|&. . . . . 2&3&) ) ) ) )                             ",
+"      i#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.4&z#e = 6 e e 6 = e e = e = -.-.-.-.-.-.-.-.-.-.-.-.5&6&r@r@C.T.C.C.T.C.C.C.C.T.C.C.7&= H.e O#C+e L.8&! ! ! ! ! Y.Y.,+Y.Y.) ) ) ) ) )                               ",
+"        -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.9&0&$.e e $.]@e e ]@e _ -.-.-.-.-.-.-.-.-.6#a&b&h C.C.q Y@[@C.C.[@x@C.C.x@[@C.C.c&u.a#e = 6 e e d&e&J ) ) ) ) ) ) ) ) ) ) ) ) ) )                               ",
+"        f&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.8$j#g&e H.C+e e C+e _ -.-.-.-.-.-.-.-.h&i&}@C.r@x@C.Y@T.C.C.C.C.T.C.C.T.C.C.C.j&%.L.e ]@2.e k+$._ k&) ) ) ) ) ) ) ) ) ) ) ) ) )                               ",
+"        i#-.-.-.-.-.-.-.l&m&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.n&o&p&q&b#e $.e e -.-.-.-.r&s&t&u&v&X@C.C.C.^#C.C.^#b$C.C.b$^#C.C.^#b$C.C.w&]@e e C+`@e = O#e 6 x&/&) ) ) ) ) ) ) ) ) ) )                                 ",
+"          -.-.-.-.-.-.y&x$M+z&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.8$A&B&A&B&B&C&D&E&F&G&H&I&J&J&K&L&J&L&M&J&L&M&N&L&L&N&M&L&J&M&N&J&J&O&]@e e O#C+e e C+e e 6 P&[%) ) ) ) ) ) ) ) ) )                                 ",
+"            -.-.-.G@Q&/&) ) R&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-./.b#k+%.a#e e e a#a#e e e ]@e e ]@$.e e $.]@e e ]@$.e e %.u.|+e ]@$.e e $.e e e ]@S&-+) ) ) ) ) ) ) )                                   ",
+"            -.-.'&T&) ) U&@.V&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.j b#a#L.e e L.e L.H.E e e = e e = 6 e e 6 = e e = 6 e e L.!%L.e u.%.e e %.e e e u.e W&S+) ) ) ) ) ) )                                   ",
+"            y#X&Y&Z&Q E+`&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Q+b#%.e e e H.L.e L.e e e = e e = 6 e e 6 = e e = 6 e e L.6 e e 6 _ e _ _ e _ _ 6 e e I+ *) ) ) ) )                                     ",
+"              .*1+_&-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.6 a#e e e 1+e L.e C+e e e _#e e _#o#e e o#_#e e _#o#e e H.u.e e $.]@e e ]@e e e $.e e e +*@*) ) ) )                                     ",
+"                -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*.6 e e e o#e _#e O#e e e 6 e e 6 = e e = 6 e e 6 = e e C+#*t#E#C+= e e = e e e 6 e e e = k+$*) )                                       ",
+"                %*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.H.6 e e e = e C+e e e e e 6 e e 6 = e e = 6 e e 6 = e e = &*) &.**=*e e a#e e _ b#e e e a#e k+5@J                                       ",
+"                  -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.= b#e e e a#e e e H.e e e 6 e e 6 = e e = 6 e e 6 = e e = -*) ) ) o.;*>*,*e e e a#e e e b#e e [+'*                                      ",
+"                    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.6 n+e e e `@e e e n+e e e `@e e `@n+e e n+`@e e `@n+e e n+K.,+) ) ) ) ) )*!*o%~*`@e e e n+e e e H.{*                                    ",
+"                    F@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.( O@e e e ]*e e e $.e e e ]@e e ]@$.e e $.]@e e ]@$.e e $.w N.) ) ) ) ) ) ) ) 6@^*/*(*e O@e e e ]*[+@#                                  ",
+"                      -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.k+a.e e e X+e e e X+e e e a.e e a.X+e e X+a.e e a.X+e e X+b+_*) ) ) ) ) ) ) ) ) ) i.}#:*<*e e e 6 e e [*                                ",
+"                      }*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.g#+@e e e _ e e _ _ e _ _ 6 _ _ 6 _ _ e _ 6 e e 6 _ e _ = .@(*) ) ) ) ) ) ) ) ) ) ) ) 7+|*  1*e 6 e e = 2*3*                            ",
+"                        4*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.H.= e e e 6 e e e = e e e 6 e e 6 = e e 5*1.e e X+a.e e a.C+_ `.) ) ) ) ) ) ) ) ) ) ) )       6*7*8*e e L.Q+                            ",
+"                          9*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.E@a.e e e X+e e e a.e e e X+e e X+a.e e 0*+$w+e = 6 e e 6 = _ a*) ) ) ) ) ) ) ) ) ) )               b*w+P#e k+c*                        ",
+"                            -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.j 6 e e e = e e e 6 e e e = e e = 6 e e _*) ) d*0.+@e e +@_ e e*) ) ) ) ) ) ) ) ) ) )                     Z+e k+f*                      ",
+"                              W+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.( +@e e e _ e e e +@e e e _ e e _ +@e e g*M+) !.h+h*e e = 6 e E T ) ) ) ) ) ) ) ) )                             3%i*                    ",
+"                                W+-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.k+_ e e e +@e e e . j*e e X+e e X+a.e e H.9.) ) ) O.i#0$a.X+e e k*) ) ) ) ) ) ) )                                   l*                  ",
+"                                  m*-.-.-.-.-.-.-.-.-.-.n*o*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.= a.e _ _ ]@_ _ e p*q*C+e = e e = 6 e e k+r*) ) ) ) ) 7$s*a.e e t*) ) ) ) ) ) )                                                         ",
+"                                    -.-.-.-.-.-.-.-.-.-.u*l i+G@-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.v*X+e e e a.e e e w*) x*e = e e = 6 e e 6 e%) ) ) ) ) ) ,+k@e e y*) ) ) ) ) )                                                           ",
+"                                      A+-.-.-.-.-.-.-.]*Y.) /&z*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.<#<.e e e G.e e e A*) P e <.e e <.G.e e G.B*) ) ) ) ) ) ) ~+q*C*f+D*) ) ) )                                                             ",
+"                                        E*-.-.-.-.-.-.V ) )*F*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) G*e e e t+e e k+H*) ) I*s+e e s+t+e e t+)%/&) ) ) ) ) ) ) ) ;*J*d*) ) )                                                               ",
+"                                          K*-.-.-.-.A&Y&~+F*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) #@e e e 6 e e = D+) ) `.L*e e t+s+e e s+[.M*) ) ) ) ) ) ) ) ) 0 N*)                                                                   ",
+"                                              -.-.-.O*~+P*-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) &.'$e e 6 e e )+) ) ) ) Q*e e 6 = e e = = e*) ) ) ) ) ) ) ) ) ) )                                                                     ",
+"                                                R*-.S+S*> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) ) T*e e H.e e U*) ) ) ) J V*e H.L.e e L.H.C+) ) ) ) ) ) ) ) ) )                                                                       ",
+"                                                  N$. 8$-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.) ) P e e 1+e e W*) ) ) ) ) 3@e 1+|+e e |+1+E l ) ) ) ) ) ) )                                                                           ",
+"                                                      y#-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.X*Y*-.-.-.-.) ) ) ^.e a._ e Z*) ) ) ) ) ) 6*|+1+e e 1+|+e c#) ) ) ) )                                                                               ",
+"                                                          -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.`* =}#.=-.-.) ) ) }+e H.e e ! ) ) ) ) ) ) &.+=6 e e 6 = e #*) ) ) )                                                                                 ",
+"                                                              @=-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.#=) O.z&-.-.) ) ) !.$== e e !.) ) ) ) ) ) ) %=6 e e 6 = e &=) )                                                                                     ",
+"                                                                *=A.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.i#) ==-.-.-.) ) ) ) -== e 6 ) ) ) ) ) ) ) ) ! ;=_ e a.]@e x                                                                                         ",
+"                                                                      A.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.i#) i*-.-.-.) ) ) ) o.>=e d.) ) ) ) ) ) ) ) ) ,=e e 6 = e <.                                                                                        ",
+"                                                                          $@e.-.-.-.-.-.-.-.-.-.-.-.-.i#) ($-.-.-.) ) ) ) ) e%e s*) ) ) ) ) ) ) ) ) l '=e .@k+e = n.                                                                                      ",
+"                                                                                   @-.-.-.-.-.-.-.-.-.i#N*-.-.-.-.) ) ) ) ) t._ L+) ) ) ) ) ) ) )       <.k+.@e e )=                                                                                      ",
+"                                                                                        6*6*!=-.-.-.-.=.w*-.-.-.-.) ) ) ) ) i.~={=) ) ) ) )             ]=<.= e e 6                                                                                       ",
+"                                                                                                  =.=.^=Q&-.-.-.-.) ) ) ) ) ) /=)*                        `@..e e j                                                                                       ",
+"                                                                                                                                                          (={.e e 6 -                                                                                     ",
+"                                                                                                                                                            _=e e = o                                                                                     ",
+"                                                                                                                                                            + e e w :=                                                                                    ",
+"                                                                                                                                                              <=e H o#                                                                                    ",
+"                                                                                                                                                                _ 6 =                                                                                     ",
+"                                                                                                                                                                [=6 = 2#                                                                                  ",
+"                                                                                                                                                                  f = Q+                                                                                  ",
+"                                                                                                                                                                  - = _                                                                                   ",
+"                                                                                                                                                                    }=_                                                                                   ",
+"                                                                                                                                                                    |=e :                                                                                 ",
+"                                                                                                                                                                      $ 1=                                                                                ",
+"                                                                                                                                                                         .                                                                                ",
+"                                                                                                                                                                        '=:                                                                               ",
+"                                                                                                                                                                          #=                                                                              "};
diff --git a/pixmaps/l-xlock.xpm b/pixmaps/l-xlock.xpm
new file mode 100644 (file)
index 0000000..9f194f3
--- /dev/null
@@ -0,0 +1,57 @@
+/* XPM */
+static char * image_name[] = {
+/* width height ncolors cpp */
+"100 48 3 1",
+/* colors */
+"      c Black",
+".     c Red",
+"X     c SteelBlue",
+/* pixels */
+"                                                                                                    ",
+"                                                                                                    ",
+"  ...................                                  .....                                        ",
+"   ...................                                .....                                         ",
+"    ...................                              .....                                          ",
+"     ...................                            .....                                           ",
+"      ...................                          .....                                            ",
+"       ...................                        .....                                             ",
+"        ...................                      .....                        XXXXXXXXXX            ",
+"         ...................                    .....                       XXXXXXXXXXXXXX          ",
+"          ...................                  .....                      XXXXXXXXXXXXXXXXXX        ",
+"           ...................                .....                       XXXXXXXXXXXXXXXXXX        ",
+"            ...................              .....                       XXXXXXXXXXXXXXXXXXXX       ",
+"             ...................            .....                        XXXXXXXXXXXXXXXXXXXX       ",
+"              ...................          .....                        XXXXXXXXX    XXXXXXXXX      ",
+"               ...................        .....                         XXXXXXXX      XXXXXXXX      ",
+"                ...................      .....                          XXXXXXX        XXXXXXX      ",
+"                 ...................    .....                           XXXXXX          XXXXXX      ",
+"                  ..................   .....                            XXXXXX          XXXXXX      ",
+"                   ................   .....                             XXXXXX          XXXXXX      ",
+"                    ..............   .....                              XXXXXX          XXXXXX      ",
+"                     ............   .....                               XXXXXX          XXXXXX      ",
+"                      ..........   ......                               XXXXXX          XXXXXX      ",
+"                       ........   ........                                                          ",
+"                        ......   ..........                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"                        .....   ............                        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"                       .....   ..............                       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"                      .....   ................                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"                     .....   ..................                     XXXXXXXXXX  XXXXXX  XXXXXXXXXX  ",
+"                    .....    ...................                    XXXXXXXXXX  XXXXXX  XXXXXXXXXX  ",
+"                   .....      ...................                   XXXX  XXXX          XXXX  XXXX  ",
+"                  .....        ...................                  XXXX  XXXX          XXXX  XXXX  ",
+"                 .....          ...................                 XXXX  XXXX  XXXXXX  XXXX  XXXX  ",
+"                .....            ...................                XXXX  XXXX  XXXXXX  XXXX  XXXX  ",
+"               .....              ...................               XXXX  XXXX          XXXX  XXXX  ",
+"              .....                ...................              XXXX  XXXX          XXXX  XXXX  ",
+"             .....                  ...................             XXXX  XXXX  XXXXXX  XXXX  XXXX  ",
+"            .....                    ...................            XXXX  XXXX  XXXXXX  XXXX  XXXX  ",
+"           .....                      ...................           XXXX  XXXX          XXXX  XXXX  ",
+"          .....                        ...................          XXXX  XXXX          XXXX  XXXX  ",
+"         .....                          ...................         XXXX  XXXX  XXXXXX  XXXX  XXXX  ",
+"        .....                            ...................        XXXX  XXXX  XXXXXX  XXXX  XXXX  ",
+"       .....                              ...................       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"      .....                                ...................      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"     .....                                  ...................     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"    .....                                    ...................    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  ",
+"                                                                                                    ",
+"                                                                                                    "};
diff --git a/pixmaps/lament.xpm b/pixmaps/lament.xpm
new file mode 100644 (file)
index 0000000..96c4dbd
--- /dev/null
@@ -0,0 +1,791 @@
+/* XPM */
+static char *lament_faces[] = {
+/* width height num_colors chars_per_pixel */
+"   128   768       16            1",
+/* colors */
+". c #c7c913",
+"# c #241d15",
+"a c #5e5a1b",
+"b c #6a6a19",
+"c c #e7d60b",
+"d c #fceb05",
+"e c #d8c610",
+"f c #3e3a1b",
+"g c #2c2b16",
+"h c #88891a",
+"i c #99971a",
+"j c #a8a918",
+"k c #7c781b",
+"l c #050506",
+"m c #b9b817",
+"n c #4d4c1a",
+/* pixels */
+"lf........eeee.e.e.e..eee.eeee.ee..allfkkkbabaabnknabbbbbhhhhallajiiijiiiihmiiijiihjiiiillimmjjjijijjjjjjiiijjmmmmmjmm....ee.lll",
+"#lacdddccdicmjdbdedcdccjcjdjcjccmddcllgdddejd.ceceeddded.d.ddelliddddec.cmcjchchciejeddjlfdddicbeedi.h.ecjhejc..kchcbehedddeflll",
+"cnlbdddddddddddddddddddcdddedcdc.dddflleddcmd.dedc.dddidmdmddmlliddddcdcdmdjd.cje.ejeddnlidddec.ccdmcje.ceichcmdidhcieieddc#llia",
+"cdhlhdic.#####edekk#ggg##ggggggggkdccjiecdhgggggggggggfgggfcdcmmcdcngggggggfgfgfggfh.mdjic.cgggfffggggfgffgfnncdddbnnadijd#lljda",
+"edde.ki..bllll.dmljglllllllllllll#ecdkaaemjllllllllllll#iglee.nfmmelllllllllllllllljmmbnicekllllllllllllllllfmeijilllkb..kighcda",
+"edddblncbdklllkd.lgclllllllllllfbcde.hllkjdgllllllllllllkdjdjmllhdc#llllllllllllll#d.cll.lmfllllllllllllllliddllh#llidicglbdddda",
+"edd.dblgckcilllcdhmj.#lllllll.c.ajddcell#dhjllllk.i#lllg.j.cejllibeelllllllllllllladcilfdedmmjnllllllllllfedde..hllhdac#ll.cacda",
+".iemcealgc.mbllidddg#jllllllgcddcmjjccfllme.llfmefl#lllnededkmlli.cd#lllllllllllll.nc#lijmi.cajki#llllllk.kf#lljllkmjeallkjjckjn",
+"edjf.kdblgcdhhlbdd.ll.mlllamcecdmdmhde.llgmhnn.dffmcnll#cdbcdjllibeeillllllllllllfdcilleddbaah.dhmllllliellllllhlicecgllimcc#cdn",
+".hmlfdcdhlgekch#edc#f..jllecdj#iadddd.dgll.mehlhecn#bgll#cmddillih.ndcjlllllllllliadflhbhddcbmdkbdchlg.ddcccjfhbhdhc#llmebeg#hmn",
+"e.jllgcmdal#ebcbnddmckihflkddd.eaeddde.bllkmdb#.cenmhllllkhdeilli..gddd.lllllllllcjcllc.ddddddd#ljdcacddccemedd.ckegllh.hc#ll.cn",
+".jilllfdcdblg.cckjdddailjnd.iedddddddddell#dddc#hddif#ll#aedijllhaml.dddflllllllbmbal#.nddddddellbacdd.nlkfllmd.edgllhjec#ll#iif",
+"jkillllgc.jhl#cmcddddbfhjdjdh.ddddddihicbllhdc.limddddccdhacmhlliijlljddjlllllllccelli.cc.dddddckmheb#llljll#edhe#llm.e.#llllecn",
+"e.ebglll#mmeal#ehcdddilj.emijc..ddd.m#dj.llgdmchfaiabheddckcjhlliicii.mcd.lllllgmbjlgcnda.aaddddddjllllljblgmekegllicae#llll#imn",
+"mbdddeb#lfcadblgce.ddmlleklllgddddcl.#m.dlllei.ilcccmjhkhmdddkllijcdd#liddallllicdflhdddecg#cddddmlllllhefmdeedgllieac#l#lbagccn",
+"..ieddmccmmdacbl#eccddklgdmhbmddd..lja#mhjllf.c.g#.fhlll#jbcdblliidddjlgddhlllgegmll.ndmfmd.dddenllllljdiaecie#ll.jm.gbcccdddicn",
+"mjhkdclk.bmdd.cnl#ejcddnlhikmdi.dikbfebc.c#llejciidajllbjflcckllj.dhdd.ned.allb.enlndce#l#chacjlllllajcclbcaegllh.mcajddddccde.n",
+".jhl.dlcjllgcccdal#eiedcl#cllkigdcfdjmfi.cnllidd##ddflmbll#cdblljneebdagjddnllml.llckc#lllgmmglllfhc.lnd.j.c#lljdidddddddclgddcf",
+".ehlndadilllmddcdklgce.dflgmbnccd.kejbll.f.llgcbc.enlljlaeedjklljmd.mdhllmdblnmmal#c.cllllllllb.cdddjlkdemm#ll.ikdddddj#ncfijhmf",
+".ihlliddelllccdddcaf...millfecmddflfek##mmdflliej#llllj#dcaedblljhcm#cellnd.l.nillkhj.nillll#mi#jdddcmdcf.#llijecdddcdnlgi.nlecf",
+".eklll.dd#lgdbdncbdc##ejdallf.lbdgll.jed.damllgc.nllllmkdddddblljedd.ddillcegdcjl#cddcdfll##dflladdddchic#llmceddmagl.mecallljig",
+"ibhlll#.dblkdheagca.kl#ejchl#knljglgdglgid.ell#dijlllledd..cenlljkcel.cfmi.cdnj#lkeibnmb.iecm#l#..dddmee.#l.ehdmfllnmmaglllllccn",
+"m.hllllfde#bdddmnc.mmal#.c..i#bl.inidill#dmjbllhjellllkb.jaecalljcjkmcdl#ecf.mjllmcd.eddeddjhekmaaddekm#b.mhi.nl#hedi#lllllllm.n",
+"mkklllllndhkdjmdceh.jdbll.d.j#k#c#bddcbllcccclllckblllllllneimkamhceaadklgdeajnl#eacdhj.ldmelmblgddhgelll.hcjll#cddblllllllllceg",
+"..bllllllkccdmli.llfdacbl#mme.nndmheddamikacdflljeell#nbjmeddknbcdddccddhbcdhell.ec#meeeeilkme.mjdhmmllle.iilliekmkkllllllllljjn",
+".iblllllllbcdc##mg#mddkdall.idmjngned.n#.ilckillbemmmedmdkcddalleddmdcdmdedcbbl#dijfehlmmllfknclhekill#mjkml#hhachbelllllllllcef",
+"edklllllllgeddhlmddddddi.kll..malllkmlc#gdlhddnhccdcn..dcjafnlll#gnhjcdhegdddehjicgf#lbblll#mkcmenjlllebejllmkamflhjj.llllllljhf",
+".iklllllfjhcicd#ndddddddemkllm.bbllkil#iknlfcmeflndcin#nblllllllllllll#gajcdm#adbhllllllllllbjdhjjlllc.mj#n.ngjgllje.cfllllllccg",
+"e.hllllgeakllidagdddddcdcbdallmhckii.bif.ll#ddelllb#lllg.lllllllllllllllll#bglnddillllllllllncmcillg.cje.mj.li#nhkigadkllllllmig",
+".jillllfcblliddc#mdddjlmneacbll.#eiecddhagaddddglllllll#dllllllllllllllllllllladdecfllllllll.cihlllcjbmllllibd.a#bllgdallllllddg",
+".hilllllhjllcdddhg.#fhlljgcmihlljj.igkddccckdkgllllllllleglllllllllllllllllllll#h.ch.gllll#miaill#ci.dkbillhcd#fa#llkd.cilllljkf",
+".milllnjhmklcddd.l.gljbn..ccj.blljccaa.dccdj#llllllllllljn#gfnaanfg##llllllllllllfj.mdbllljjchllgeie.c#l.mfedcge.nkhejfej#llle.#",
+".ailllefjf.edddjm#g.lnddjggjmfcblljedhjdmccgllllllllll#bcddddddddddddehglllllllllllmdmemle.nbllledh.lfl#bfddde.ddb#jfllkjnll#hbg",
+"eehlllmjlkdddddddilnmehkbf.jjeichlle.ddchlg.lllllllnjcdddddddddddda#gajdejglllllll#efjcichmjll#ccjkahllfgnh##mddmhbjlllgcgll#ceg",
+"eddifl.cgndddbkaihlla.gijmalll..ma#eedcalllaklll#a.dddddddddddddddfllllcdddmalllllm#lljcdd.mlgeh.hjlmllilkflledddden##lacl#bedd#",
+"kddfcddjdddddkllillll#eelllllll.d.c#lh#lllllcglncdddddddddddddddddglll#dddddddalliallllbdklajckdaajfal#mlilladddddcj.ececjdihdd#",
+"lgcjc#e.ddddcckmgllllhmc#lllllll.jdillllllllf.mdddddddddddddddddddejm.cdddddddd.jhllllllgllfde.abacm.ccc.hllmccddd.lllhdc.kc.kgl",
+"##mnb.cadjddffhklllllijbmgllllllfdddglllllllbdddddddddddddddddddddfff#mddddddddddhllllllllgcci.gjncn#dddddjjk#bddddakm.jac..alll",
+"ee.nllfmdaefchgclllfl#djedkllllleddflllllllmddddddddddddddddddddddbgghddddddddddddelllllllbdd.#eccmlimdcjn.kmklkddddebfdmglbalgg",
+".ddcalllgbmmchcdeb#i.bm#ccehlllihckllllll#edddddddddddddddddddddddkkh.dddddddddddddefllllllbdh.diflhalj#lg.ige#kdjb...b#lllbe.dh",
+".ddjcebglllnmechccc.hhegc.lnllbcehllllllgcdddddddddddddddddddddddc#l#.ddddddddddddddegllllll.hddflfklbblljmbk.ceimi.allll#bmkddb",
+".mdjcfcd.glll#ad..hee#adddjlllcbdllllll#cddddddddddddddddddddddddddddddddddddddddddddd#llllllcadc.dnnd.fmkndcclcch#llllb.dhmhddb",
+".eeficdiceekllllnj.cmceddmhglmcckmfllll.ddddddddddddddddddddddddd.##bdddddddddddddddddcglllllicem##kn#gmdcjcacjn#lllgk.bei.iahjb",
+"...ll#hecebcehglllgi.chcccglfccilgmall.ddddddddddddddddddddddddddeabcdddddddddddddddddd.#llgmjinjblllfh...iejfllllgiemaj.hgllhjb",
+"ejmlllllgmccg.e.allllneccjdeeeellllijhdddddddddddddddddddddddddddcabdddddddddddddddddddd.lkc#llciilac.j#dealllllncjhge.#llllleea",
+".emlllllll#amcamkciflllgkmdmddnllllljddddddddddddddddddddddddddddhlkddddddddddddddddddddd.kllllnjmc.dhehgllllgj.chee.bhlllllljjn",
+".kmllllllllllfje.ke.jflllleecelllllleddddddddddddddddddddddddddddemdddddddddddddddddddddddglllllmdd.eb#llllnjcei.dmcflgjlllllecn",
+".djlllllllllllllgmdamdcil#d#lllllllkdddddddddddddddddddddddddddddbgdddddddddddddddddddddddjlllllndjjlllllidkjmddkclg.ecdilll#hkn",
+".hjlllllllllllllll#hdhcnemelllllll#ddddddddddddddddddddddddddddddnkddddddddddddddddddddddddalllllnlajla.chcjmakblfhfmkgicllllccn",
+".djllllllllllllllllfdem.jnd.glllllkddddddddddddddddddddddddddddddf.ddddddddddddddddddddddddclllllllndejch.icnljfb#jdd.llhbllljif",
+".djllllllllllllf#l.ddc#idddc#llll#cddddddddddddddddddddddddddddddjddddddddddddddddddddddddddflllllmde.ecallgc.jejeddfeallllllcdf",
+"mcjllllllllllg.dcedecdceccdjlllllhddddddddddddddddddddddddddddddddddddddddddddddddddddddddddjlllllmddkflllllg.dbibjd#billllllmhf",
+"mdjlllllllll#.dddea#cmkle.iallllledddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgllllg.h#ll#lllllkmbdbcb#hllllllmjf",
+".jjllllllll#eddkmllgillledd#lllllddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddklllllifbllhenllllllchcmlllllll#i.f",
+"mcillllllkcdddmbkllmb#gjdmclllllhecddddddddddddddddddddddddddddddddddddddddddddddddddddddddddmllllljmjlladdihj#l#dce#llllllllhmg",
+"ejjlllll#cddde#hcmeddccdc.hlllllenkijcdddddddddddddddddddddddddddddddddddddddddddddddddddddddclllllhbellm.deg#mllce.lllkgblg#c.n",
+".dmlllllcddecggcddhcccmdddnllll#dgfmllkdddddddddddddddddddddddddddddddddddddddddddddddddddddddnlniccc.nlgmed.lkhlji.llmccbmjljnh",
+".cmlllfic.klc.dm.hf.#h#dem#llllfd#lc#llm#nedddddddddddddddddddddddddddddddddddddddddddddddddddcjkf#ge.alljbmdbljbhi.#mdddem#leef",
+".ee##kdd###hddmieemdec.dcclllllbd#legll.llhhkeddddddddddddddddddddddddddddddddddddddddddddddddelllllchkl#nmn.mlbdnhiecmcie#l#bhf",
+"eddedededcdcdcdcddccdddddelllllkelljfllmllkhlhbkddddddddddddddddddddddddddddddddddddddddddddddclllllmkj#gfmjbegfdnihiigmgcfgadcg",
+"eddhcbdjdhekckdbeh.hcj.idelllllhde.c.ikeafii#haljiicddddddddddddddddddddddddddddddddddddddddddclllllhddkchckckchmb.ichckekchiddf",
+"gamjkhhihhhhihijijijiijdjhllllljddddddddddddcdc.c.k.ddddddddddddddddddddddddddddddddddddddddddclllllhcdhci.jcjcj.jejcickebcbjcdf",
+"llfnllllllllllllllllll#clllllllmdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddllllll#bj###########g###ggg#bdgn#",
+"ll#allllllllllllllllll#clllllll.dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddlllllllnhlllllllllllllllllllgelll",
+"fnkiffgg#g########ggg#ndgglllllmddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddclllll#nkmggg#g##############a.##l",
+"eddddecedddddddddddddddddclllllmddddddddddddddddddddddddddddddddddddddddddcimeedcddddddddddddddllllljdejdcdcdd.dcd.ddddddddc.ddg",
+".ddddiejdd.mjjcdjdjc.ddddelllllhdddddddddddddddddddddddddddddddddddddddddddmb#le#feghefejhecmedlllllidefekcimjamacbcackeijjkfdcl",
+".dcacdeccj.jcmdbhebkbkkmjmlllllbdddddddddddddddddddddddddddddddddddddddddddddcjelgmlbiljllhnlncllllliiddhddcccdddeijdde....m.ccl",
+"mdcfdddcd#aijacg#ciba#l#eelllllkddddddddddddddddddddddddddddddddddddddddddddddddceelbhlmll.llkelllllecdcem.imjdhbfljhllllllllbjl",
+".ddicddcflg.jk#hl.dddhllcdnfbijmdddddddddddddddddddddddddddddddddddddddddddddddddddm.ilmll.llj.llllleadfmmedddklngiclllllllll..l",
+".ddch..flllc.iljffdddblleddehfl#ddddddddddddddddddddddddddddddddddddddddddddddddddddddicnl.ll.hllllgdmdccddmfj#ljjdjllllllll#bil",
+"ehc#nlnllllcc.lgeggcdnll.emlllllcdddddddddddddddddddddddddddddddddddddddddddddddddddddddd.c#lcfllllfj.dh#a.llm#kdddnlllllllllccl",
+"ed.llllllll.dellgkh.dalljmclllllhddddddddddddddddddddddddddddddddddddddddddddddddddddddddddc..lllllkecbllbflncacmhallllllllllhjl",
+"ecellllllj#mdelbglllbjllb.d#llllgddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddillllljbc#lk.lidddelllllllllllllccl",
+".d.llll#fkcc.jcmdmlllllll.hallllledddddddddddddddddddddddddddddddddddddddddddddddddddddddddddnlllllemdkcdceddddalllllllllllllh.l",
+"ed.llla#cgjd.akeddjlllllkcdmllllliddddddddddddddddddddddddddcdddddddddddddddddddddddddddddddd#llllkcjddddddcjd.#lllllllllllll..l",
+"ec.lllmhkebdemc.nacnl#kck.de#llllfddddddddddddddddddddddddddkcddddddddddddddddddddddddddddddhlllll.ddddcdde#lgllllllllllllll#mel",
+"edcllladn.dkfgfinlae.dmcceilllllllidddddddddddddddddddddddddnddddddddddddddddddddddddddddddcllllllg.cdnedmlllllllllllllllllllccl",
+"edelll#edchlbkljla.ddd.bgg.lglllllgddddddddddddddddddddddddmnddddddddddddddddddddddddddddddilllllllbih.cic.hfllllllllllllllllkjl",
+"edmllllkjlhb#eeceddc.alll#djcalllll.dddddddddddddddddddddddakdddddddddddddddddddddddddddddc#lllllk#j#llaeem.dmglllllllllllllli.l",
+".c.llllgelhdddddcdklllllne.cdcllllllcddddddddddddddddddddddjhdddddddddddddddddddddddddddddklllllbdde#llll#kcc.ccilllllllllll#jel",
+".d.lllllgmcdidd.b#lllfhecjeeddfllln.mdddddddddddddddddddddmlhddddddddddddddddddddddddddddcilllll.ddj.mnllll#ajc.chjnllllllll#jel",
+"eemllllgmcbd..nllllgjc.cd.b#enjllk.flmddddddddddddddddddddmicddddddddddddddddddddddddddddnh.#llbdd.iijcea#llllamch.j.a#lllllleel",
+"edellaed.jcklllllacdbeddcgllndejcalll#ddddddddddddddddddddbljdddddddddddddddddddddddddddjllgdklcaellkccf..m#lllllb.c.hd.flll#k.l",
+"eddh..ce.b#lllgh.jim.dj#nehm.dkcnlllllfcdddddddddddddddddilljddddddddddddddddddddddddddjllllg.cjenl#l#.de.jcmalllllnmcjc..kg#..l",
+"edd.ei.fllllfjchcmca#illjfgmcddkjllllllkdddddddddddddddddbnhcdddddddddddddddddddddddddc#llllladkilln.#kdddccmdck#llll#kckdjc.jjl",
+"edddkllll#icc.edj#h#c#lnafmlnddddalllllladdddddddddddddddhfl.ddddddddddddddddddddddddcllllllleac#lllhdddmaddde.ec.nlllllnmdmgdcl",
+"m.he#llnic..ecb.g#jiekickilncd.cdmfllllllkddddddddddddddillledddddddddddddddddddddddegllllll.j.fll###d.kmnenmddeea.mb#llllgjcdcl",
+"llle#a.cicmdd.fnlgdieddddkleddgncje#llllllacddddddddddddhkhhddddddddddddddddddddddd.gllllllbdkmlllnccdhl.cnllbdkcjegcch#lllfca.#",
+"llgddkc.dddddcmllcflcmddddcdibblbddclllllllleddddddddddca#lgcdddddddddddddddddddddillllllladcelllll#jdejjnlllli..#cccidceklf.lll",
+"fidkc.jaadddddd#kjlfhi#ambddeflamhc#llllllllgedddddddddjl###ddddddddddddddddddddeallllllll#id.illllllbife#llllndblmddddh.m.jclll",
+"eddddenheddddddfe.lhljllhl.jagae..ib#mllllllcgfcdddddddcm...dddddddddddddddddddeallllllllllfckcallllllaccblll#c.hbiddddeehk.cjfl",
+"edeaek#leneddddddddhljl#albajaeee#ledddglllahlllaedddd.llllbdddddddddddddddddjglcflllllkc#bmljm.hllllll.jlllfcallcddcdcjmjecbddn",
+"edmb.iajif.ddddddm.llj#kfl#b.db.llgcdde.alg.llllllnmddmglllkddddddddddddddciflll#.gllliddcjlllicjhlgihebhhllgcllledddakehllnjddn",
+"ed.bdmdjkemaddddcljlljgelllc.ne#l#e.dhmcck.nllllllllgjcc.kn.dddddddddddceklllllllkcl#mcdd..glll.iciellilfeflleaibcdddkl.llllleea",
+"ehmlllmhlmllcddd.lgehhiblliimelllecdfllm.ddfllllllllllllfkmeedddddeemj#llllllllllliecckk#.kd#lllijedjmccnlmllgdddddd.#hhilll#men",
+"ecjlllmij.hhcedd.ll#kmcglkjjjll#ejmnllllbc..jflllllllllllll#l#####lllhllllllllllla.ejdd.bnebeflllj.cdcffbl#illedddenmhahklll#ejn",
+"ejmlllhjdi#cf#dddjllliciim#mll#.bcnllllll#.ic.i#llllllllllllllllllllljlllllllll#m.eheedjbbneee#lllemjeblmgleglgcddblhj.nlllll.kn",
+"edjll#j.djjllgcajdi.emhdki.lll.hdnlllllllllgecdd#lllllllllllllllllllliflllllllmcdaehaadenllfckc#lllmcmegbeidmlladc#llmgllllll..n",
+"ehklllanchmln.nlbdkgnn.cjjll#.ejbbllllllflllleckliehfllllllllllllllllbklllfallkddi#fjlcbfnkjkcaenll#miecdddddbll.cflkk.lllll#hjn",
+"c.hllllfcink..llkal#ddmk.lll.h.jbilllllkelllabeejdddd.in#llllllllllllnenj.dc#lieail.ik#hdhnl#.cecglllcbcddddd.llndc.nhjlllll#ddf",
+"ejmllll#cdcafiljklllemk.lll.adicfhallljclacnccjlh.ddmea.ic..jhllf.mececfjkddcmfbjinilnkgd.m.kggjjc#lllmkedddddfllcddcnllllll#khn",
+"ejjllll#.ejlhehmll#jk.jll#.c.abeahillkjcmdbncmfl.icccecchcn.dcllfddicheiibhkcllgmjienlhdd.h#lllb.kegll#mmidjnf.lljdde#llllll#eef",
+"emjllllifjgkmgj#llmc.mlllma.dhjfdbmfahnkadjdjml#.egm.#.dcdmccciijddjknlllllejnllcheeemjddkgmglll.ch.#ll#ej.#llcnlnddd.#lllll#hjf",
+"ef.lllbhnccnim#lbechmllleacddblle#fedjklndddealmjemdc#gcljmhjcf#bgj#lllllllia.llajcclllmdklljm#jb.eecllll.heabb.ll.dedd#llll#edf",
+"ccilll.amaemnghedjmjll#...dddmnhcbnddmjmjfdid##djdd.cnlei.fc..llfccgaabbbklgcefll.ndiglfd.b#lnchlmbij.#llfcf.cjc.#mcadd.#lllgjif",
+"emjllbeeflkdcdddkcmlll.cjdddddh#lcmckllinlc..lndmcdg#egen.heamllnhjgbhmddmllikhllijdaeb#d#beflmg#mljcn.lll.che#ijmem#cddhlllgeef",
+"edjliblgdmcddeejeee#lejmbedddegjmglllllgkcik#l.jjfdclledi.mdcellndcfmece.lllg.mllgelej#.clllncikai#aacjc#mageccmil.nl.dddfllfkj#",
+"c..mdilhddddddejjlaeehdklfdddehfllllllllgd..lnddalhdhlhcg.ajb.llnamikhcghlllne.klljmd.hjkigllenfbbmllem.eillncjdc#.lljddkcllgjeg",
+"c.dddd.dddccdikjlll.cmmkl#d.blll#hhlllllkdhiljjd#lfdcafd.keccellfcdndmflilli.km.llfc.ai.lg.imddddddalidea.lllgdbdebllide#dblfmef",
+"ccdddddddf#cncjll#cmmbjfij#lllg.cbnc#lll.ec#l..hl#cdde.d.kccfmllfbi.#lkmg#ccll.c#lldccfaindddddddddelledcam#llgci.nllhdb#cdggimg",
+"ccdddeanfgmimill#eddjae.klll#hcdmglijfiediilnem#llmddalnciid.ellg.e#niblliecihmkmllhhmgfmgcdddddngacilkdd...gllne.eilic##cdhfccg",
+"cccanlllle.billl.bcehfhblllkcddddclncehbedfleeellllmcd#ladcdnmllgjjhmllllghe#gcdcgllcem#dbeddddmillfclnd.hea.lllfcgc.chl#dd.fbig",
+"ecillll#cajkll#eemm#lhalnjcdccdddcgbgllmddlgdmklllll#.mll.ddccllfcce..mm..ha.lbcjklliadkddddddjlg.llgnfddbacne#llfe.dejiidddcddg",
+"eeilllg.bchllg.j.ceihcmcdddcjbddddddb#he.ilk.clllllllideb.dda.llgjkjbj..ihkihljcej#lncmdddddddcnlnnllmkdddkhj..fllfmcmafbicddjjf",
+"cmjlllec.kll#efedgbcdddcdddklke.edcddcd.j#lekhlllllllkddjamdeellgcebakkcc.kjcjfac.kll.gcdddddhjc.bcglidiedclheee#llfcbd#llfmd.eg",
+"cdjlfcijbll#cbdbhlll#nbmdcmi#labl.ddddcimlbddflllllllleddglcf.llf.ih###lll#ec.l.dkmllndmdcddmlliagicmhklkdd#lbenc#llncncflllahe#",
+"c.cf.gckllgemenhfllllnic.giaklfm#ncjcdcmal.delllllllll#kchl..ellfccjkllllljjadmfbeegl#cmdddd.il#illkmeiljddeflhmm.glla.emfllnic#",
+"cdccmmbll#e.calm##gheddelllimnecccnlkdhellcdblllllllllllbelenellgcjhcblllaindeiljehjllijbcagljllmglfdnmlcdddjllh.me#llnc.d#lnm.#",
+"cccmibll#eedfl#ecdddddillllgkhcjl.j#fdcblidclllllllllllladfeeellfdckddjlllkefkdegncdfllemmlllmlljmbjcgiej#mdd#llbefc#llaehcfnj.#",
+"cdddkllf.eeallkgnjcdcalllllllljheccecm.f#demllllllllllll#c.daellgem.cddal#hgkckgllm#jlljjdglljik.mhi.lgd#lgdd#lllicemgllacaejjc#",
+"ecd.llgc.mnllldfgaee#llllllllllhgmcicc.lfdealllllllllllllhddcellgddacdclllljklllllfcclladcillb.hhmlllllmllfddnllllijbellla..ma.#",
+"edbk.fcicgllladdddallllllllllllllln.mknljm.lllllllllllllllidfellgce.dd.mllllllllllldbjlle#..ahel#llllll#mgcddcllllladnc#lln.bdd#",
+"ehllicbenlll#edd.glllllllllllllllll.dclfdcblllllllllllllll#d.ellfddngh.#llllllllllljce#lb..ebhklllllllllbceddd#lllllimcjglb.cdc#",
+"lllgelcbllll.ddallllllllllllllllllgdcd.ccdglllllllllllllll#dkdc.c.jfllg#lllllllllll#.md..dnclllllllllllllhancdglllllliefebe#fdcl",
+"ll#cdcccccecddeecccccce.cccecec.eecddflcddccccccccccecec.ecddcllfddcccecccccec.cjc.ccdd##jddccccccccecccccdecdceje.cecdcddfllkd#",
+"lghdddhcdd.edd.cddddddehdcd.dcd.ccddjlndddc..mddjm.e.cjcmc.ddell#cccccmceccdjdmcicmccddnlgcdd.ddddddddjdcdjdidhefcbckdddddcfllal",
+"lbanfffnnnanabhbafnnaanaafbnnnaaaaanglgjhhbbbibbbajbbkbkhkhjjhlllllllllll##g#g##gg#fgfnlllfnnnanabbbbbbabkjbaaanbabnbabbbhknllll",
+"llllllllllkim..mjijmhkkhjj.ijmim....himbhaa...ibkbnaabbbaaakfffgfnnang##nbbbanlffl#ggabbnafnbbbabbbkhhimmmhijimbkecc.flgmec.klll",
+"llfjcd.hlnddddddddddddddddddddddddddddddilcddddddddddddddddddddddddddddd.dddddjdd.dddddddcddcddddddddddddddddddddecddagcdddddj#l",
+"lnddddddcgdddddddddddddddddddddeeddddddnhfcddddddddddddddddddddddddddddddddddddddddddddddbhckddddddddddddjncekddalnddbddddddddml",
+"lcdddddddedddjf.dddddhbddddddd...ddddcbcdlcdddddddddddeddddfadddd.kddddd.dddddddddddddddddbhkdd.cddcjahd.gmddcdnfm#cdddddddddddf",
+"kddddddddddddjcddddcid.ecdcdddddd.jdddddd#ceedddhedddjgcddkiacdijebdmmddhdjkhiddddddehdddde#add.khajlmddmc.nddigcdg.dddddddddddk",
+".dddddddddddddddddddddddde.dddddd#iddddddkdddddd.#nhb#eddbmdecddd.imlcddjcacdcddddjddddddddmaddddemdfcdddengcjl.ddajdddddddddddk",
+"mddddddddddddddddddddddd.jdddddmn.ddddddddddddddddcaeddc#.dddddddihmf.ddnhddddddddkbcdcdddm.nddd.gddmdddchcfdkhdddh.ddddddddddd#",
+"jddddddddcddddddddddddddedddddmgdecddedddddc.dddddcidddi.ddddddddccdmeddidddddddddcnfnjdddecnddd.edddc.dddcndhcddd.ddmddddddddml",
+"gcdddddddbccdddddddddddddddddddddddddhdddddc#cdddd.mdddddddddddddddddddddddddddddddddddddddcfddddddddjaddddjdddddddddfjddddddd#l",
+"laddddddhleddddddddkidddddddcmdddddddmddddddddddddj.dddddddddddddddddddddddddddddddddddddddcfdddddddddddddddddddddddd#lacddde#ll",
+"gacdddddibcdddc.jb#ln..e.mmialannabhmmddddddddddm.aim....mjmmeedd.mee.e.e.eeeeedddddddddddce.eeeeeeeee..ee.ee....eeedmjjedddc.ml",
+"eddddddddd.###lllllllllllllllllllllllbddddddddddflllllllllllllldcllllllllllllll.ddddddddd.lllllllllllllllllllllllllliddddddddddn",
+".ddddddddd.lllllllllllllllllllllllllljdddddddddd#llllllllllll#cddcnllllllllllll.dddden#g.bllllllllllllllllllllllllllidddcingfddh",
+".ddddd.dddmllllllllllllllllllllllllll.dddddddddd#lllllllllllgeddddcflllllllllllndddddebddhllllllllllllllllllllllllllidddmaabkdcg",
+".didddidddmlllllllllllllllllllllllllgdddjddddddelllllllllllleddddddcllllllllllll.ddddcnddmlllllllllllllllllllllllllljdddddddddel",
+"hdddddjedd.lllllllllllllllllllllllllgdddecddddd.llllllllllfeddddddddcflllllllllhddcdddk.dellllllllllllllllllllllllll#iddjednadel",
+"fcddcdddddmlllllllllllllllllllllllllfddddddddddhlllllllllfcddddddddddcnllllllllf.dedddchddlllllllllllllllllllllllllllhdcghdbfdel",
+"jddmjdddddmlllllllllllllllllllllllllkddjmddddddallllllllleddddddddddddcllllllllllcddddddddfllllllllllllllllllllllllllcdaiddjfdcl",
+"mddnmdddddilllllllllllllllllllllllllmdddddddddclllllllll.ddddddddddddddcgllllllgeddjidddddblllllllllllllllllllllllllgddjdddeadcl",
+"mddnidddddilllllllllllllllllllllllllcdddddddddcllllllllfddddddddddddddddbllllll#ddd.iddmambllllllllllllllllllllllllllcddc.dcmdel",
+".dddddd.ddillllllllllllllllllllllllbdddddcmddd.lllllll..ndddddddddddddddflllllllddddjddchddnllllllllllllllllllllllllledde#ddddel",
+"mddddddmddilllllllllllllllllllllll#cddddddccddhllllll.ddeeddddddddddbl##l#.#llll.d.n#iddjdd.llllllllllllllllllllllllledfmdddddel",
+".ddcddddddilllllllllllllllllllllllbdd.edddceddnlllllbddddddddddddddckcdcmcdj#llladek.cddccdd#llllllllllllllllllllllllmd.ckcdddel",
+"eddfadddddilllllllllllllllllllllllmddhdddddddclllllbddddddddddddddddddddddddellll.dfddddddddmlllllllllllllllllllllllllhdddddddel",
+".ddc#jddddillllllllllllllllllllllnddc#gkddddbfllll#cddddddddddddddddddddddddde#llhdedddddddddallllllllllllllllllllllllfddddddd.l",
+"mdddhacdddilllllllllllllllllllllledddicdddddjllllnghcddddddddddddddddddddddddd.#lfdddiedddddd.lllllllllllllllllllllllleddddcdd.l",
+".ddd.lheddilllllllllllllllllllllifcdddddddddd#llkddgnddddddddddddddddddddddddddelljdddddd.ddddmllllllllllllllllllllllkddddmndbll",
+"iddddmheddjllllllllllllllllllll.ccdddddde.ddnllkdddcaedddddddddddddddddddddddddd.#gddddedhhddddnlllllllllllllllllllllmdddikdddel",
+"#idddddddd.lllllllllllllllllllmddddddddddddmlladddddcnjddddddddddddcakddddddddddd.g.dddaceacdddcglllllllllllllllllllleddd.ddddcl",
+"lnddddddddmlllllllllllllllllljdddejedddddddglkddddddddb#iaddddddddelllbdddddddddddcliadcddddddddc#lllllllllllllllllll.dcddddddd#",
+"mdddddddddjllllllllllllllllljdddahecddddddk#nbdddddddddbfcddddddddnlaklfeddddddddddekdddddddkadddcglllllllllllllllllljdckmddddd#",
+"jcddddddddillllllllllllllllkddh.fedddddddcf.dcdddddddde#edddddddddca.dhg#hcddddddddddddddkjdddddddcflllllllllllllllllkddcn.ecddg",
+"l#hdddkkddjllllllllllllll#.ddddifeddcddddiedddddddddddhfddddddddddddddddcimdddddddddddddc#cddddddddhi#llllllllllllll#cdddd#l#cdg",
+"geddddcgcdjlllllllllllllaedcddddcdddddddddddddddddddddb.dddddddddddddddddddddddddddddddddcdcakfhddddddj#llllllllllll#cddidcccmdn",
+"mddcdddkjdjlllllllllllamdddmhcddddddddddddddddddddddddkdddddddddddddddddddddddddddddddddddddcdeedddddddcb#llllllllllgddddddd.hda",
+"eddfeddddd.lllllllllbcddddddddcdddddddddddddddddddddddcdddddddddddddddddddddddddddddddddddddcdddddddddddddjllllllllladddddckfddk",
+".ddikddddd.lllllfbnadddddddeahcdeffidddddddddddjidddddddddddddddddddddddd.#iddddddddddddddddcdddddncdddddddc.k#lllllbddddmm.dddf",
+"mdddfcddddchbimcdd.cddddjdddcgfdd.cddddddddddchljddddddddddddddddddddddddebcddcddddddddddddddj.dddjiddccdddddddcmjih.ddddddddddg",
+"mdddj#dddddddddddddddddddddddccddddddddddddddaliddddddddddddddddddddddddddddddfeddddddddddddde#dddmbdclhdddddddddndddddekkmddddg",
+"bdddd.ddddddddddddcdddddagaedddddddddddddddddal.dddddddddddddddecddddddddddekljdddddddddddddddcddddaidcdddddddcecaddddcghm.ddddg",
+"ndddcdddddddddddddbcd.ddea.dddddddddddddd.g.dd.ddddddddddddddddk.ddd.k.ce.alljdddddddddddddddddddddcaaedddddckhbfmddddcmdddcmdd#",
+"kddbfdddddddddddd.id.lbdddicddddddddddddcln#.ddddddddddddddddddajdddjlllllllkddddddddddddddddddddddddhidihddkdddieddddddcddkndd#",
+"kdcmdddddddddiddd.bdegfnddddddjkddddddddhedhlfhcdddddddddddddddnkdddellllllidddddddddc#beddddddddddddkmd..ddcdddfcdddddcdddbcdcl",
+"kdcdddddddddcfd.ibbdddilidddca#cddddddckedddmafggfaieddddddddddfbdddellll#jddddddddddmgagnhmdddd.bccckddddmddchdhcdehddcdddaddd#",
+"kdfe.bddddddc#flfcdddelbcddnlleddddddcl.dddddddddddddddddddddddfndddclllgeddddddddddc#.ddccddddddclfhcddddamdk#cddml.dddddcidddf",
+"kdcjmehedddddja.cdddddcchfll#eddddddhg.ddddddddddddddddddddddddffdddd#n.ddddddddddddnadddddddddddd.#la.cddccddf.dbhcdddddd.fedd#",
+"bdcdddciddddddddddddejnllllljddddddb#geddddddddddddddddddddddddgfddddcdddddddddddddabddddddddddddddblll#nk.cdddddbhhmddddddhbdcl",
+"bdhjdddhddddddddddhgllllllleddddddddddccddddddcddddddddddddddddlgdddddddddddddddddbli.ddddddddddddnlllllllllniddddddddddddddeddl",
+"kddgedmmddeafg##llllllllll.dddddddddddddddddddcgiddddddddddddddl#ddddddddddenddddcjikicddddddddmcdeieeglllllll#gfabjmdddaeddjccl",
+"kddkkdi.dd.lllllllllllllljddddddddddddddddddddde#neddddddddddcjl#ecddddddd.ghdddcddddddddddddcklkddddd.llllllllllllllcddifijfdcl",
+"kdddddddddmlllllllllllll.dddddddddddccccddddddddellbdddddddeflllllllhddddilnddd.lmddddddddddhl#jddddddddlllllllllllllcddddd.ddd#",
+"hddddddddd.lllllllllllljddddddcibfg#llllllgfhcddd.llg.dddmnllllllllll#kdbllmdddkbcdddddddddcmedddddddddd.#llllllllll#cddddddddcl",
+"hddddddddd.llllllllllliddddddjfgg###llllllll#cddddm#lljdjllllllllllllllglladdddddddddddddddddddddddddddddjlllllllllllcdddddddk#l",
+"hdddddddddmlllllllllljddddddddddddddcjh#llllcddddddc#ll#lllllllllllllllll#ddddddddddddddddddddddddddddddddmllllllllll.ddddddddjl",
+"idddej..ddmlllllllllidddddddddddddddddddcjfadddddddd.llllllllllllllllllllliikaahcdddddddddddddddmfeddddddddmllllllllljddddddddd#",
+"mdddddcacd.lllllllladdddddddd.mcdddddddddddcdddddddddklllllllllllllllllllll#nj.ccddddddddddddddd#lfdddddddddmllllllllndjcdddddda",
+".ddddcc.fd.lllllllkdddddddddanedddddddddddddccddddddclllllllllllllllllllllljdddddddddddddddddddcllleddddddddallllllllkdddddddddb",
+".dhedmedmd.lllllll.cdddddddhjdddddddddddddiflledddddhlllllllllllllllllllllladdddddddddddddddddddinacdddddddemdenlllllkdddddddddf",
+"mdgmdddm.d.lllllgbaahme.mjaidddddddddddd.g#fnicdddddfllllllllllllllllllllllleddddddddddddddddddddddddddddddddddc#llllk.mmeeecdda",
+".dkkddemdd.lllladddddddddceddddddddddddckedddddddddellllllllllllllllllllllllhddddddddddddddddddddddddddddddddddddllllfkh#ln#fddi",
+"mdc#dddddd.lllncdddddddddddddddddddddddddddddddddddmllllllllllllllllllllllllfddddddddddddddddddddddddddddddddddddcnlljdd.cdkcddm",
+"mddfmdddddellfddddddddddddddddddddddddddddddcee.jik#lllllllllllllllllllllllllaanakj.eccdddddddddddddddddddddddddddcnlmdddddhdddm",
+"bddd.dddddclnddddddddddddddddddddddddddddckgllllllllllllllllllllllllllllllllllllllllllliddddd.dddkcdddddddddddddddddfeddddd.dddi",
+"bddddddddddbcdddddddddddddddddddddddddddd.ihknf#llllllllllllllllllllllllllllll#naij.ecdddddddhddd#cdddegicdddddddddddddddddddddi",
+"bddddddddddddddddddddddddddddddddddddddddddddddddejallllllllllllllllllllllll#cddcdddddddddddcgdddlcdddd.l#adddddddddccdddddddddm",
+"kddddddddddddddddddddddddddddddddddddddddddddddddddcllllllllllllllllllllllllgddddddddddddddd.lcdd#adddddjlhddddddddc#cdddddddddj",
+"bddejddm.de#eddddddddd.dddddddddddddddddddddddddddddfllllllllllllllllllllllladddddddddddddddi#dddkljdddcghddddddddeglcddddkedddn",
+"bddfiddcddelg.dddddddhl.dddddckddddddddddddddddddddeglllllllllllllllllllllll.dddddddebeddddd#fdddckeddeghddddddddcfllcceeejbdddf",
+"bd.mddddddelllmddddddjgl.dddhll.ddddddddddddddhddcffj#lllllllllllllllllllllnddddddddhleddddclbdddddddh#mdddddddddllllcelabbhddel",
+"adkedddddd.lllljddddddci#gflfimcddddddddddddddaaahedd.lllllllllllllllllllllhdddddddddeddddi#lkcce.ibfjcddddddddefllll.djmdddddcl",
+"ndfceabddd.llllljdddddddjllhdddddddddddddddcce#hcdddddnlllllllllllllllllllgcddddddeddddddddcag#gggniddddddddddcfllllljddicdddem#",
+"fdblncnddd.llllllhdddddddigdddddddddddddddddklfddddddbllllllllllllllllllllhddddddjlcdddddddddddddddddddddddddc#llllllmdddedddbll",
+"nmf.ddfcdd.llllllliddddddcedddddjnfbkjcddddddnjdddddillllllllllllllllllllllbdddddhmdmkddddddddddddddddddddddcflllllllmddddddddeg",
+"lnddddm.dd.llllllllhddddddddddddjlllll#mdddd.addddd.llladalllllllllllllgallladdddcdiiddceecddddddddddddddddcnlllllllljdddddddddg",
+"adddbddddd.lllllllllndddddddddddd#llllledddclcddddc#lgcdddhllllllllllaedd.lllhddddcddddiallgedddddddddddddd#llllllllljdcne##jddf",
+"addmfddddd.llllllllllacddddddddddallllmddddk.ddddcglkdddddddjalllla.cdddddeallhdddddddddddmklhdddddddddddcnllllllllllmdchdecdddg",
+"addddddddd.lllllllllllgcdddddddddjlllfdddddedddddbljdddddddddddgll.dddddddddjllmddddddddcjbkjddddddddckccflllllllllllmddmddddddf",
+"bdddddddddmlllllllllllllccjdddddddfllmddddddddddaadddddddddddddnlledddddddddddaldddddjje#.ddddddddddddnllllllllllllllmdce.cdddc#",
+"addbaci.dddmjjhaglllllll#fedddddddhlndddddddddddjddddddddddddddbllcddddddddddddmhddddd.iahcddddmdddddd.llllllllg#llll.ddd.cdddd#",
+"bddfl#aadddddddddmfbgllllfcdddddddeljddddddddddddddddddddddddddhl#dddddddddddddddddddddddjfidddidddddcfllll#nicdclll#cddddddddd#",
+"kddaniiiddddddddddcddd.all#cdddddddl.ddddddddddddccddddddddddddmlndddddddddddddddddddddddddm#.ddddddclllla.dddddddmcdddddddddibl",
+"bddddddddd.niddddddf#fkecjnacddddddhcdddddddddddnfcddddddddddddelhddddcaedddddddddddddddddddea.ddddcfllbedddddk.dddddddddddddfll",
+"hdddddddccmlidddddcnfnnhdddjhddddddddddddddddddde.dddddddddddddd#eddddcf.dcjeddddddddddddddddddddddn#kcdddddddecddc.eddddddedjll",
+".dddddddnhcjd.dddddddddddddddmcdddddddddddddddddddddddddddddddddfddddddddddc#jddddddddddddddddddddnjdddddddddddddd.aaddceddgdd#l",
+"iddddddddddebbdddddck.ddddddd.cdddddddddddddddddddddddddddddddddkdddddddcdddelf.dddddddddddddddddcmddddddddccdddddddddddhnnljdfl",
+"idddiddddd.lkdcdddddflacdddddddddddd.keddddddddddddddmdddebmddddcddddddd.fkfgjeddddddddddddddddddddddccddddd.dddddddddddddcghdfl",
+".dddbhddddddddmcddddddcedddeddddddddhllfcddddddddddddhidddmlhdddddddddcddjlmddddddddddddddmdddddddddd#.ddddcgeejdacddddddddfddll",
+"fijkn#dddddddddd.fdddddddddjcddddddd.lfhcddcmbh.ddddddgedddhleddddddddmfa#.ddddddddddddddnnddddddddddebbdddded.km.dddddddddddill",
+"fiihhidddddddcdddddddddddcigdddddddddjddddddddh#amccddakdddd#hddddddddddkaddddddddddddddclfdddddddddcihhdddddd.ecddde#eddddddall",
+"hdddddddddcgn#nhcddddddddcn.ddddddddddddddddddddc.gl#fggddddakdddddddddddddddddddddddddddflmddddddddcfmddddddddeaccegkddddceddc#",
+"iddddddddd.llllll#njdddddddbmddddddddddddddddddddddemkakdddd..dddddddddddddddddddddddddddck#hcddddddcjfcdddddeiallllfddddmihdedk",
+"idaeddddddjlllllllllg.dddddd.dddddddddddddddcmmcddddddddddddddddddddddddddddddddddddddddddddccdddddddcddddcjflllllllnddcakdddiek",
+"jdhcdddddmllllllllllllgmdddddddddde#edddddddaflledddddddddddddddddddddddddddddddddddddddddddddddddddddddcfllllllllllgdcljdeddbmb",
+"iddddddddnllllllllllllllb.dddddddddjgdddddddddckidddddddddddddddddddddddddddddddieddddddddddijijddddddch#lllllllllll#ddbndicda.b",
+"hdddcidddcnlllllllllllllllidddddddddadddddddddddddddddddddddddddddddddddddddcdddddddddddddddiddcddddd.glllllllllllll#cddg.e.da.b",
+"idddn.ddddelllllllllllllllladddfnaf#.dddddddddddddddddddddddddddddddddddddnlleddddddddddddddddddddddalllllllllllllll#cddhbdddnek",
+"kdcffddddd.llllllllllllllllln.cm.ijcddddddkidddddddccddd.kdddddebhcdddddcbhmcddddddddddddddddddddd.glllllllllllllllllcddmfdddaca",
+"hdal.ddced.lllllllllllllllllllcddddddddddd.l.dddddjaeddelkdddddnllidddddddddddecddddddddeeeddddddelllllllllllllllllllcddcbddekcb",
+"hddcdddddd.lllllllllllllllllllgcdddddddddddaliddcnaddddnlhdddddkllmdddddddddddkcddddddchedddddddklllllllllllllllllll#cddd.ddcldf",
+"iddddddddd.llllllllllllllllllllbdddddddemddjllkdnfcddddblbddddddmmddddddddddddhmddmddekicdddddcalllllllllllllllllllllcdddddddjd#",
+"bdddd.c.ddilllllllllllllllllllllcdddddcbgddclll#l.ddddddk#cddddddddddddddddddd.ndigdd.gl#cdddelllllllllllllllllllllllcdddddddddg",
+"g.dd.fdhdd.lllllllllllllllllllllfdddmkaddjednllladdddddddcdddddddddddddddddddddillmddddcgkdddc#lllllllllllllllllllllledddddddddf",
+"liddhnh#miallllllllllllllllllllll.ddi#hdck.dcllllkdddddddddddddddddddddddddddddallhddddd.bdddellllllllllllllllllllllledddddciddg",
+"gdddhjmecekllllllllllllllllllllllndddjlhddddilllllkdddddddddddddddddddddddddddkllgmdddddmidddhllllllllllllllllllllllleddddcddddf",
+"ldddidddddcllllllllllllllllllllllljdkhdfbddddilllllfddddddddddddddddddddddddcgllleddddddcddde#lllllllllllllllllllllllcddddcbcddf",
+"lcdd.dddddcllllllllllllllllllllllladcgn..ddddcllllllndddddd.ddddddddddddddddblllgddddddddddc#llllllllllllllllllllllllcdchfdeacdf",
+"ldddddddcdclllllllllllllllllllllllgdd.#hddddddnllllllfcdddd#eddddddddddddddblllladddddddddd.llllllllllllllllllllllll#ccgidcddddn",
+"gddddddddddllllllllllllllllllllllll.ddddddddddjlllllll#edde#dddddddddddddcfllllljddddddddjhgllllllllllllllllllllllllgddbeddddddn",
+"#ddddmcdddcllllllllllllllllllllllllfddcia.dddd.llllllll#ccnmddddddddddddcallllllcddddddddcnlllllllllllllllllllllllllfdddidddddda",
+"gdddddddddclllllllllllllllllllllllllcdelmddeddclllllllllgffdddddddddddddalllllllddddddddddmlllllllllllllllllllllllllnddddddddddb",
+"lcdddeihddcllllllllllllllllllllllllleddfdddddddglllllllllfcdddddddddeddnlllllllgddddddddddalllllllllllllllllllllllllnddddddcddda",
+"ledkkhceddclllllllllllllllllllllllll.ddgcedddddhlllllllllladddddddddifbllllllllgddddcdddddflllllllllllllllllllllllllnddddddacddn",
+"#mdcddddddcllllllllllllllllllllllllljddfjgc.dddhllllllllllladdddddddd#lllllllllfcecnfedddd#lllllllllllllllllllllllllnddddddimddf",
+"nddejddddddlllllllllllllllllllllllllhddk#hdfdddhllllllllllllnddddddc#llllllllllk.jdddddddcllllllllllllllllllllllllllfdddddddddda",
+"ndddddddddcllllllllllllllllllllllllladdddddcdddjllllllllllllladdddcalllllllllll.mhdddddddmlllllllllllllllllllllllllladdddddddddb",
+"ndddddddddclllll######llllllllllllllbddddddddddcllllllllllllllbdddallllllllllllc.bdddddddilllllllllllllllllllllllllliddddddddddg",
+"gji.dddddecdcccddddddddddaf.cdccdceecdddddddddcdcecc.fembhjllkheddhkan#l#g#g##gd.addddddde#ll#glgggfbbbkhkiikkhkkhijcddddddddddf",
+"ll#jdddddafdddddddddddcddcdddddddddddddddddddd.ddddddddddddimdddddddddifcdddddddddddddddddccdddddddddddddddddddddddddmiddddd.g#l",
+"lledddddddidddcdddddddddddddenjmddddddddddddddmdddddddddddddddddddddddddddicddddddddddddddddddddddddddcddcdddddddddddacddddddhll",
+"lhdddddddddddddddddddddddddmhcdcfdddddddddddddddddddddddajddddagdddddamddd#cdddddjjdddddcdddddddddd.bngddddjbnfkjddddcddddddddal",
+"l.dddddddddddddddddddddddddcddddgdddddddddddddddddddddddjedddibedddcdbeddc#dddddcmdddddhlcdddjddddddcendddddddchhnidddddddddddjl",
+"lddddddddddddddcdddjdddddddddddmmdddmmdddddddddddc.ddddddddddcdddddadddddclcddddmcdddddfkedcdcddddddifgdddddeddbcladdddddddddd.l",
+"l.dddddddddddddbmddcdddddddddc.cdddddddddddddddddcaddddddddddddddd.fddddddajcnddjcddddgjeejgdnhdddddddndddddcdbmhlhddddddddddd.l",
+"lkddddddddcddddbidddddcaddddjcdddddncdddddddddddddnicdddddddddddddenfnadddcanedddccd.kide.c.ddddddddddkddddddc#cjmddddddddddddml",
+"l#cddddddcfddddhnhbfcdefddddhddemdel.dddddddddddddddddddfkbbkdddddddddbddddcidddddekhedd.jddeabcddddddjedddddcl.ecdddeddddddddal",
+"lllhddddm##ddddc..ecdddddddddddddddbaddmdddddjddddddddddcccccddddddddccdddddddddddddddddmidddccdddddbkddddddddmbjddddnbddddddill",
+"llll#nngllgdceeecdddddddiecddcdddcddddddddddhjddddcddddddcddddddchdcccccdcddcccdc......ekiecccceee.bllkj...........j.flfhm.mnlll",
+"lllllllllllglllll##gnl#llllll#g###ff#gn##lllll##gg##ggggg#l####llll#llllglllllllllllllllllllllllllllllllllllllllllllllllllllllll",
+"lllfieehllfhihijmjmimjjmknjjmjjjjjmiimm.mjf.mmmm.jmmemmhbkbnlggggfnanff#l#bannllfflnbbmjmhiijjiihhhi..e.eecccccee....#lgieeehlll",
+"llhdddddcnjdddddddddddddddddddddddddddddjgaddddddddddddddddd.cdddddddddc.dddddbadkaddddddddddddddddde.cmddddddddddccd#nddddddm#l",
+"lhdddddddddddddddddddddddddddddddddddddhagbddddddddddddddddddddddddddddddddddddddddddddddddd.edddddd.ie#cdddddddd.#ndbddddddddil",
+"bddddddddddddddddddddkmdddddecdddm.ddddcdgjdddddddddddddddddddddddiddddddddddcdddddddibcdddchiddchaamddjcddddeedchh#ddddddddddel",
+"mddddddddddddddj.ddcknghmdddcddddemddddddg.cedddmddddd.jdddddddcddjddcddddchaancddddjlgeddcb#iddnncceddcdddcdddc.dc#cdddddddddd#",
+".ddddddddddddddddddecdeggdddddddddddddddd#.ddddd.bihjjkdcfeddd.eddidd.dddc#mddjmdddedbdckidcghdhlheddddddddkedd.cddfcdddddddddcg",
+"jdddddddddddddddddddddddjddicddddhmdkidddedddddddcefhcddddddddd.edceddddhncdddddd.dddddc.ddegmdgmm#hdddddcddddg.dddcddddddddddc#",
+"bdddddddddddmeddddddddddddceddddcdddfhddddde.ddddddacdddkkkddehjedjjdddd.edddddddddddcjcdddeecdfmdenddd.ecddddbcddddd.ddddddddhl",
+"#cdddddddcmdeddd.mddddddddddddddjnedfhdddddilhdddddbdddcbheddedddddddddddddb.ccccdddcbl.ddddjedejddedddecdddcddddddddfhddddddell",
+"lbdddddddgjddddddddenedddddddcdddeedfhdddddd.eddddcadddddddddddddddddddddddeeccccdddc#feddddddddddcddddddddddddddddddnliddddb##l",
+"jmdddddddecdddddddmhicddddddjnmjiimd#aee....mm.cddekddddejcdddddd.cddddddddddddcccccceddddddcccddcccdddddddccddddddddcm.dddcmeml",
+"ddddddddddddddddddddddddddddflllll#dlllllllllllm.ddaddddnl#ddddddicddddddddddddnlll###ffffmh##g#f#ladddddd.ll.dddddddddd.hfgl.el",
+"ddddddddddddddddddddddddddddgllllllclllllllllllj.ddcddddd..dddddddddddddddddde.lllllllllllhalllllllfdddddddhlemedddddddebflllcel",
+"dddddddddddddd..cddddddddddc#lllllld#llllllllllnedddddddddcddddddddddmhkcddddd.llllllllllliflllllllgdd.gfmddacddddddddddddcmjdel",
+"ddddddddddddddddddddddddddd.llllll#d#llllllllll#kkddddd.hbfddddddddddn#cdddddejlllllllllllmflllllllledcjcddddddcdddddddddddibe.l",
+"dddddddddddddddddddddddddddhllnnffndngggglllllll.edddddcllgdddddddddhgcdddddddnlllllllllllmlllllllllhddddddcddcjddddddd.bddili.l",
+"ddddjddccddddddc.i.ddddddddnlnddd.eddddddkllljglhmddddddm.gedddddcd.lmejicddcc#lmmmmjiiijicijijijhllfddddm.eeddddddddddhnddmlm.l",
+"dddeedddddddcmjieccdddddddd#l.dddecddddddhllleil#cidddddddddddddccdalnl#.dddcallncdddnefj#.#cfcgcdnllcddd#nklcdmcdddcdda.ddel.ml",
+"dddddddddddddjcdd.cddcjdddkl#ddi#######ikhllleellbecddddddddddddiddhnh.dddd.mllllfe...bkbkbbabbkmemllidddh.dkfdmcijddddddcdd#mel",
+"dddddddddddddddddkcddh.ddcllndcglllllllhehllledallckcddddddddddmbdddddddddccall#llg.he#lllllllllnmefll.ddccdc#mddfiddddde#eda.el",
+"ddddddjncddddddddh.ddadddkll.jmllll#bllhjillledd#lgcmddddddddddkjdddddddddehllbdfllgd.e#lllllllllenhllnddcddd.lkd#addddn.gedmcel",
+"dddddddmddddddddddadddddillhedfllll#illhchlll.mkjllneccdddddddddccinddddekhllfcdcnllnec.nllllllllgmcbllbddddddebf#bddecg.acdddel",
+"ddddemdddddddddddcn.ddde#l#ecmlllllle#lichllledd.hllacbdcdddmcimec.cdddkccll#cmcg.nllgcac#lllllgll.a.#llmddddd.ddcdddkjcefcdddel",
+"ddddc.mdddddddddddddddcllldcclllllll.hlidhlllmj#ecklllececddcdddcddddim.befl.c.#dmm#l#dd.e#lllgd#llcdmllljddddcddddddjleddd.dd.l",
+"ddddcdddddddddddddddd.#lliddhllllllljclhchllleelnmeilllbdjem.dcdmdcchchglgdcmm#l#mhckef#memahijdhlmjcgllllacdddddddddelcdddjcdml",
+"mcddmedceddddddddddcillllnc..#lllllladbhchlllmjllnmejglambmmmcaebd..hglllndde#lllg.fehll#ebcgllhcjk.gl#k#llfedddddddddhdd..ee.hl",
+"liddicdekcddddddddeglll#ll#.cc#lllllled..hllleclllgmiejcllll#fhan#lllll#mmdmlllllllcejglllejeflledcfllmdcflljjmcddddddddjl#####l",
+".cdd.m.cdddddddehhhllbedfllfeceglllllndd.hlllimllll#j.i.if#lllllllll#bmjc.allllllll#jhenll#me.fmdde#le.dikjnjll#nkim.eddh.ddddel",
+"#kddchh.ddcikagllleamcdd.fllfcb.#llllledchllle.llllllnjea.jibnllllkmcddjjfllllllllllg.nefll#mkdeenc.jcea..eeh#lllllllicfcdddddcl",
+"cdddddddddmlllll#kcd.decad#lllckc#llll#dj.llljjllllllllf..jkjdjlllcdddddmjjjhmijhiijmmdddlllledc#l#cdcfllhdmjmjflllllfdgndddddc#",
+"ccdddddddd.lllnee.jecal#.icgllgmejflllljcdm#l..lnigllllll#fbedilllcdjckdajikdkciej..jencdcnll#j#llmiddka.igk.enec#lll#ccfndddddg",
+"fgfcdddddd.llljdcm.kllllgj.jfllfehe#llliddd.nm.llaeiglllllllkmelllhmjjjiijjjiicmiiiiijihkknllllllhcmnkcdhlll#bjcd#lllnddeghib.c#",
+"lncdddddddmlllmcmlllllllll.md#lljdad#lliddddd.illlljdkllllllkdilllllllllllllllj#lllllllllllllllljijfll#hglllllli.glllcdncdfhhlcg",
+"mdddddd.ddjlllmjhllllllllllmkdamhg.jjglicimdddcnllllhdm#llllkimlllbkbkhabbkbkbehbkkbbkbkkbknllljmcfllllllllllllimgllledbaddddhjg",
+"cddddddcddjlllmdillllllllll#mie.ll#...#idblidmjdjng##.d.#gnhe.mlllcdejbchcaeh.hiejcjehdiddcnlljejnlllllllllllllj.glll.ddcddddijg",
+"cdddddddddekafe.hllllllllllll.c.glllmkdedklladddddddeeddd.jmdk.lllcddccc.djccdced.dmdeddddglljbefllllllllllllllhfglll.dddddde#cg",
+"d.dddddddd.abkceillllllllllllljjcnllgeacdklllmeddddddchcdgllhcmlll.jg#gggg#g##gg###ggg..cgllmkeglllllllllllllllmcejjjddddehbkcdf",
+"chmdddddddjlllm.hlllllllllllll#jh.all#eddbllleenmcdd.#lkcjllhi.llleclllllllllllllllllh.inllhcmnllllllllllllllllj.agfnedmhhcddddf",
+"ckgdddddccmlll.cklllllllllllllll.dcgllledalllhmlllfalll#ddalkdmlllmmllllllllllllllllindfllmdeflllllllllllllllllmd#lllemllljkhddf",
+"cm.dddddddjlll.mi########lllll#ll.cdall#eklll.mlllllllllide#kcc.m.celllllllllllllllicefllmkcfllllllllllllllllllim#lllefaeedb.ddg",
+"cddecdddddjlll.dce...mcjemm.mcme.ccdcall##llljjllllllllllf#lkdeg##.jllllllllllllllkcekllh..alllllllllllllllllllmcllllmlcdddnddd#",
+"cddcdddcddkllled.mjj.hdjdhiehdkekejdddfllllllijlllllllllllllh..lllemlllllllllllllhke.elm.mflllllllll#hlllllllll.d#lll.#cdddbddcl",
+"cenddddddchlllgfffffnnffffffnfcnnnnnfn#lllllle.llllllllll#ahedmll#e.fllllllllllljieflkcj.flllllllllnc.lllllllllmdllllejidddbddcl",
+"d.adcdddddjlllllllllllllllllll.llllllllllllllccgllllll#ajceedd.lllcdemb#lllllllkehnllbeealllllllllbeidgllllllll.d#lllednmddfedcl",
+"dcgcm#cdddjlllllllllllllllllll.#lllllllllllllceegllllhdeabecdeillgcdgmidhlllllijmnllheaallllllllf.j#lchllllllnedd#lll.ddmddifdcl",
+"ddenm.feddillllfffanannnffffffcnfgfgfggg#fgllfek.flbejikehng#lllll#fbmciccbllik.flliienlllllabhjkglllke#lllb.bddd#llledddcdklccl",
+"deddddeiddjllllkedddddcd.c.c.ee.d.cj.ece.dcbllg..mim.n.eblllllllllllllhecbdjkm.blla.ebllllllbnglllllll.il#ji.hingllllecmcdddkicl",
+"ddddedjjddellllll#.ddd.dkeb.jmibdaek.kiibdddalll..dmcnlgd#lfahijibgllgcl#m.hdjnllhchbllllllllllllllllladhmbcillll#khjde#lfkbgccl",
+"ddddcdjeddcee.ialllfemedknnnnnnnnnnnnnnnafme.bllg.diglllc.eddddddddcmejlllbccfllhj.nllllllllllllllllllledcmfllghjmhmaecgemj.cdc#",
+"dddd.jkcddcmcmddckglljmcm#lllllllllllllllllijebllghlll#iddddddddddddddeflllakllbjeklllllllllllllllllllncdc#l#kci.eddecdaedddmmcl",
+"ddddddddddddddddccdbllhmcelllllllllnglllllll.ackllllladdddddddddddddddddmlllllidjalllllllllllllllllllfmgddkfcfcdddde#edddck#ljcl",
+"dddccdddddddddddddecm#licjmllllln..a#llllllll.ddblllkdddddddddddddddddddde#ll#cdclllllllllllllllllllljimncdijcdddddil.d.a#niedcl",
+"dddddddddddddddddddddeglmedflllnde#lllllllll#cde#llkdddddddddddddddddddddde#llkccallllllllllllllllllkjjlljdccddddddbl.e#lg.dddcl",
+"ddddddddddddddmjdddddd.l#en.lllmdbllllllllll.cclllbdddddddddddddddddddddddd.llljl.lllllllllllg.llllnjeflacddddddcddal.dd.bl#edcl",
+"ddddddddddddddmidddddcdjlncdbl#cdmlllllllllgceillfddddddddddddddddddddddddddillg.chllla#llllln.llllijhllebdddddjdddnlj.ihdm##ccl",
+"dddddddddddddd..dcddddddflciefjdddig#aallllhcc#lljdddddddddddddddddddddddddddlllebelll.llllllnelllgjk#laidddddmbddcf#ggffmdgfdcl",
+"cddddddddddddd..ddddddddmlmddcfgeddd.allll#cghlladdddddddddddddddddddddddddddmllgcdgll.llllllbclllie.l#dkdddddfjddddddddddmbddcl",
+"ddddddddddddddciddddddddd.ddmmlllgg#llllllaccjgl.dddddddddddddddddddddddddddddfghefhllmllllllk.lllejnlaacddddd#mdijddddddddddddn",
+"dddddddddddddddbk.ddddddddajedllllllllllllj.cmemddddddddddddddddddddddddddddddc.hjmclljllllllk.ll#eelljnddddddf#afaijjjmm.mihddb",
+"cddddddddddddddddccdddddcelnddgllllllllllledjlljddddddddddddddddddddddddddddddjllb.mflm#lllllijlla#hl#hidddddddc.hbbnkki#fb#nddb",
+"cdddddddddddddddddddddddddg#eenllllllllllledbllmddddddddddddddddddddddddddddddellgecnl.gllllljjllhehlfecdddckmddcjmmedddbedfiddn",
+"cddddddddmkdddddddddddddceale.blllllllllllccflleddddddddddddddddddddddddddddddd#l#ckbljfllllljilljbblkhdddddj#aedgllgcddmcdamdcl",
+"cddddddddcedddmdddddddddddhl.hhllllllllllgce#l#ddddddddddddddddddddddddddddddddfl#cjcjd.hkhhhcehhcdnlidddddddel#edil#cdddddmcddf",
+"cdddddddddddddcdddddddddccbljdcj.m.jeieiemddll#ddddddddddddddddddddddddddddddddflledmhddcmha.ccbcddnljhdddddddjmcdd.nddddddddddf",
+"eddddddddddddddddcmdddddccblmc.i.jeheichcjcell#ddddddddddddddddddddddddddddddddfllmce.edce.medc.ee.#ljeddddcdddddddddddddddcdddf",
+"edddddddddddddddddhiddddemfllllllllllllllllllllcddddddddddddddddddddddddddddddc#lllllll.#llllcallllllkkdddddddeeddddcdddddhhdddg",
+"edjedddmdddddddddddimdddddfllllllllllllllllllllmddddddddddddddddddddddddddddddclllllllljhlllgcbllllllf.cddddmknfddddddcddd.gddd#",
+"ecfeddddddddddddcdddddddcc#l##########llllllllliddddddddddddddddddddddddddddddmllllllllhelllfdalllllllhhddddddcgbdddddccejaljdd#",
+"eddcddddddddddde#gcdddddd.laddddddddddddccccellfcdddddddddddddddddddddddddddddbllgjiihied.mmede.jjiklljedddddddilcdddddl#nhmcdd#",
+"e.dddddddddddddd.fcddddd.hljddbcnckckmjeeidddglledddddddddddddddddddddddddddddgllmddidacddieddcbckddnlamddddddd.lc.gkddabdde.dd#",
+"eicdehadddddddddccddddddcgled.mmjcmjjjmmjmmdealliddddddddddddddddddddddddddddcll#ee.mmjm.dejcdcmjmed.l#ciddddddcl..l#cddbedaljcl",
+"eieaadidddddddddddddddc.hlnhjllllillllllllljn.bmccdddddddddddddddddddddddddddm.fh.mlllll#dklidalllgddllfcdddddemlmilgcdddcd.lmc#",
+"ejgmd.jdddddddddddddddcdglccmlll#klllllllllnd.ck#bdddddddddddddddddddddddddd.lnmdk.llllllecnjdalllljaillmiddddmglenlgcddddddfjc#",
+"kkddddcdddddddddddddddcblb.enlllablllllllll#dk.llleddddddddddddddddddddddddcgllahbnllllllbdccdallllaecfl#e.dddd.ncflnddddddd.id#",
+"mdddcdddddddddddddddddjlfccillll.nlllllllllladjbllledddddddddddddddddddddddfllgdcillllllll.dddbllllligmllgckcdddddccdddffgfnajd#",
+".dddkddddddddddddddcddalei.#llllcflllllllllll.kcgllgedddddddddddddddddddddnlllmemflllllllladddhlllll#cjjllgjm.ddddddddca.....cc#",
+"mdddddddddddddddcdedibc.cdfllll#dglllllllllllfdd.lllgeddddddddddddddddddcalllkddillllllllll.ddhllllllamekll#.eaccdddddbgedhdbcd#",
+"jdd.edddddddddccicdfl#cdcalllll#dffhbf#llllllnddhlllllkdddddddddddddddddnlllllmcdblllllllll#ddilllllllac..lbmnc.bdicedcedddcjdc#",
+".ddfgcmmdddmemcemn#lfemdallllll#df#nbmcejallaeh.#la#lllgjcdddddddddddmagm#lb#lli..blllllllllmdmllllllllachec#l#nh.mcjddcddddddd#",
+".dd#lfifddc..jkgll#kcecnlllllll#cblllndjed.kdd.llgd.fllll#ideccccc.iflllh.edmllle.dfllllllll#eelllllllllacich#llll#fhdddddddddcg",
+".dde.ikkcd.lllllfmc.cj#lllllllllj.lll.d#lidddjllnddc.m#lllbhlll#lllllllljceddelllikebllllllllnelllllllllllid#cek#lllfddddddddmgl",
+"mdddddddddjlllheemcjalllllllllllfdhlhdkllacdd.gfccmm.kjif#mgllllllllllliddekc.i#llhcjhllllllllillllllllllllnidhdclllfdddddccd#ll",
+"mdddddddccillledd.bllllllllllllll.dicellnecmcdcdc.l#hjj.cecn#####gfhjllidellg...lll.hcallllllllllllllllllllllf.dc#llgdceddmadkll",
+"mdddddddnhmllledbllllllllllllllll#.ddflacbklgcddjlllllaednjkecedc.mdcllijmlll#eac#llcickllllllllllllllllllllll#.clllgddgcddnmc#l",
+"mdddddddhijllledblllllllllllllllll#hblncdillfcddfllllll#nh.me.mejcmdc#li.jllllf.kjf.hhcmhlllllllllllllllllllll#.clllgcdakialadgl",
+".dddddddbmjlllecbllllllllllllllllllllfcdmllgcccdillllllllll#gnbbbfkecllj.mlllllfjecklleadnllllllllllllllllllll#cclll#dddccefadgl",
+"mdddddcdddde..ddejiikhhikhabbaaannaaidmillfdcjgddfllllfbllllllllllamclljcmllllll#mfc#lliech##l###llll#lll#llllf.clllgdddddjl.cll",
+"mdddcddddd.fnfededmjcmeickdbeici.emdddm#lge.m#lidjlll.cnllllllllllaeclljijlllllllg.jmglljddc.iehejejimick.mejidddlll#edddenjdall",
+"nmcjkdddddjllljmee...m.ceme.e.eeececc.llgcd.lllgcc#amdilllllllllllaicllicmllllllllgmme#lljddknegj#cbgmbdfmbkjbmddllllg.ddddddfll",
+".dddddddddmllllllllllllmnllllllllllllllfc.illllleddcednlllllllllllaeelljhmllllllllll.bcgll#g#f#ffbfbagfnficanbabbllllgidddddddjl",
+"edddddddddmllllllllllll.nlllllllllllll#cj.#llllncjn#lgllllllllllllb.c##jejllllllllll#...flllllllllllllllln.lllllllllgcddb##gcncl",
+".dddddddddilllieeeee...dem.....mjjbllfcd.lllllndflllllllllllllllllbedeedimlllllllllll#edclllnkbabanaangggbcgfffgglllbdcbfehhd#e#",
+"jdicdddddfllll.dmdbenei..bdidicddjlllbdmlllll#c#llllllllllllllllllbcellmjjllllllllllllledflllhdddkda.nmmheadmdmdd#llhdkndecdd#.l",
+"idcddddcflllll.dmkbkhkkkkkkkhdcdjllllbejlllllf.lllllllllllllllllllbjellj.jlllllllllllllmdfllllkdceejmj..i.h.meedd#llfddg.cjdcl.l",
+"idddddddcflllleealllllllllllnddmlllllbjjllllllkhllllllllllllllllllbcellmjjlllllllllllllmjglllllijchllllllllllln.c#llnddiadaddl.l",
+"iddd.iddddjllledhllllllllllhdchllfc#lbfilllllllehlllllllllllllllllbjellmcilllllllllllll.d#l#dfllhdeillllllllllgdcllladddbcmmd#cl",
+"idddjbddddmllleddcja#lllllbcdhllfcc#lbeilllllll#chllllllllllllllllkc.ll.hjlllllllllllll.jglgdcfllbcdilllllllgbeddlllnddd.cdkcgel",
+"jdccc.cdddmlllai.dddcalllaec.llfddc#lbhhllllllllacnlllllllfbm..e.eccellmccmjjjjjjjjijjjdd#l#dce#ll.cdkllll#idcee.lllnddddcdh.#e#",
+"iddchjdkddmlllllllccddcaidei.nadcdd#lbcilllllllllkdalllk.ckci..hchddd#l.dcndndnijkcfd.ncd#lfmcdcg#dic.illjedeh#lllllbdddddd.l#el",
+"idegiddiddcjjiaglah#bcedddjlgdcime.#lbhhlllllllll#cchkehe.mikaannbimillijjiiijiii.dijjmjjllfemjhc.albc.jjehb.#lllll#mddcdddcgl.#",
+"hdeeddddddddddddedfllg.ddmllgdd.lec#lbcillllllllllfcdc..jfllllllllllllllllllllllln.llllllllfcile..#llijdjj#lhelfh.cdddddddddhle#",
+"iddddddddddddddddddhlllbillbdjjllmhglbkhllllllllllbddd.#lllfkj..mia#llll#kbkbhbab.ebnaanallaiillmdcfllkcglllgcddddddddjcddddc#c#",
+"idddeddhcdddddddddddmgllllhd.mlll.c#lacillllllllla.icddhfjmded.emccemb#l#hddd.hckeie.eddd#lndill#jdcfll#lllkcdddddddddcdddd.ijc#",
+"hddcneckieddddddcddddcnllgddellllmiglabhllllllllk.cigdddddmddddddddemc.fllacdcjckebem.dddllnmillllcdd#lll#mddddddddddddddceemdc#",
+"iddcedddddddecdc#fdddddbllkdc#llled.kmchlllllllaecallmddddddddddddddddc.mllgcdelll####g.ellndillllnddgllgcddddddddddddc.kdnmddcl",
+"mddccddddddddddnambdddddnll.cellleckkmahllllllgcjillkjeddddddddm.dddddd.d.#lfdcjlllllll.c#lajilllledkllgcdmngfakiddddddi#.cecdc#",
+"mdddddedddddddc#.daiddddc#lncealled#ladhlllllljgmllhcmddddddddjl#ddddddddcc#lhdd#lllllljj#lbdilllnmjll#cddblidddcdddddj#.mcddddf",
+"mdddjncddddddeljdddfdddddml#.dellecglbnhlllllaedglachdddddddddegkdddddddddi.lledellllllec.mekhll#edfllmdddd.gidkbdddddc#.ddddddk",
+"iddmkcddddddcajddddbidddddjmiccbled#lbchlllll.hil#dmddek.ddcddddddddddddddde.ejddblllllmmllndillkjjllbddddddefabdddddddjfcdddddk",
+"jdddddd.idddindddddi#dddddd#lmd.led#lbfhllllfkjllhedddgl.mgfcddddddddddddddednljdmlllllecllnhkll.d#llcdddddddd#iddddddddafdddddb",
+"mddddda#iddddcdddddmlcddddd#lfddedc#lbcc.mm.ceilgebddblekgjdddddddddjeddddddmjlgdciikimccllac.kicellfdddddddddcgdddddddddcdhdddn",
+"idhhkbjjmdddddddddd.l.dedddnllcdmcd#lbdekchdddnlh.ddcliekcddddddkcdddc.ddddd.d#lddejebddclladdjddmlljdddebdddddmidddddddd.bfdddg",
+"#cnacddidddddddddddel.dacddhllnkhkbllgihhdmkkh#l.kddelcdddddddddkeddddddddddd.al.ceic.cdclladdecdalgdd.jaeddm.ddedddddddjllgcddg",
+".dbgdddddddddddddddcicdbeddellllllllllllleflllllmiddmmdddddddddddddddddddddddcilllllikllllll#gc#llladdil#ghdjkdddddd.ddcemlbk.mf",
+".ddcdddddddddekedddddddecdddgllllllllllllefllllgceddcdddddemeddddddddceeddddde.llllliklllllll#cllllhddijjjiddddddddddddddefdddda",
+"edddcdddddddddddddddddddddddbllllll#lllllcfllllnccdddddddjll.ddddddddnlleddddcellllljklllllll#clllljddddddddddddddddddddddiddddi",
+"bmeddddddiiddddddddddddddddddccccdddhaannda##gge.dddddddddmndddddddddflleddddddk#gfn..anf##l#gcg##lmdddddddddddddddddddddddddddh",
+"ll#cdddddb#ddddddddddddddddddddddddddddddddcddeddddddddddddddddddddddk#fcddddddddddddddddcccccddcccdddddddddddddddddcbidddddhffl",
+"ll.dddddddjddddddddddddddddd.heddddddddcccddddccdddddddddddddddddddddddddceddddckddddddddddddddddddddc.ddddddcc.jdddmgedddddd#ll",
+"lnddddddddddddddddddddeddddd.mjg.ddddddddcddddcdddddddddhhdddddacddddddddhnddddfcddddddafddcdddddddiflgddddcdcddccddeedddddddjll",
+"liddddddddddddddddddddmcdddddddi#cdddddd.cddddcfakkddddd#iddddhjdddddddddbndddmnddddddel#ddjcdddddcmm.addddcemeiadddddddddddddgl",
+"lmddddddddddddddddd.dddddddddddiaddddmdjlndeddddd.gdddddedddddddddmacddddhndcdebddddddkllddddddddddcebaddddddddkcdddddddddddddfl",
+"lidddddddddddddddddddddddddddddcddddd.dca.dddddddel.cdddddddddddddejce.mdelehmd.dddddc#.ldddddddddd.mhadddddddfnddddddddddddddfl",
+"lndddddddddddddddddddddcddddddddddddddcdddcmdddddel#jddddddddddddddmhhbfddffa#cdcccc.bemlcddddddmiddddfddddcdclndddddddddddddc#l",
+"llhdddddddbcddddddcmjdc.dddddddddddccdddddcedddddencdd.iiab#hddddddccc#iddcglneddcmhmddjlcddddednhddddbcddddd.llbdddi.dddddddbll",
+"lllkdddde##ddddddd..cddddddddddddddccddddddddkjddcddddccdcejmdddddelchlcddd.cddddddddddjlcddckmdddd.gmdcddddddccddddkgcdddddelll",
+"llll#nbflll.ddddddddddcddddddddddddddddddddd.l.dcdddccddddddddddcnccdccdddddddcdddddccdkleddddcddd.#lg.eeeeee.eccdcdal#im.jb#lll",
+"lllllllllll#kbbihjkng#ll#nnaabijbbbnhi...jha#llg##gf#l##fffnkhhkflakababbbnfgf#ngffg#l##lganf##ffnllllllllllllllllllllllllllllll",
+"llllgnglllk.ee.......mjjhikiceceecccccee....ee.....mjijm.e.e.e.eecceeee..m.mmmm.alllllllge.meeeeeee.e..mjj.m..eeche.eallllllllll",
+"ll#jdddmfljdddddddcccdddddc.dddddddddddddddddddddddddddddddddddddddddddddddddddd.#nhiia#jddcbaababbahddddddddddddhdddhlfjcccilll",
+"ll.ddddddgicacdma#l#mdddddcmdddddddddddddddddmhdddddddddddddddddddddddddddcnedddddddddddddddddddddh.dddddddddddddcdddh#dddddde#l",
+"lkdddddddcccled#nmcddddddddiddddcddccddddddddd.bdd..ddcjeddddddddddddfcdcajl.dddddchnamddddddddcddddddiddhdddddddddddccdddddddml",
+"leddddddddddnddcdddddkdddddaagcdbedddddddddddddicddkd.ahkdc#jcdddddddacdccdgeddddcnanijcdddddddddddddddcnjcdddddddddddddddddddcl",
+"fdddddddddddddddddd..ddddddddddk#cdddddddddddddc.ddhkl.dddclkidddddddbcddddfddddddddhjdddddddddddddddddeee#ddmddddcdddddddddddd#",
+"gddddddddddddddkaddddcddddddddhacdigeddkedecdddccddcgkddddcgdddddddddkdddddbddddddddaedddddede.dddddddddj#jdi.dddnjdddddddddddcl",
+"l.ddddddddcdddd.bmddddddddddddidddflhddaabiddddddddd.cddddcfdd.hkiedddddddcgbmdddddi#.ddddddcicdddddddddmjbjidddcg.dddddddddddml",
+"ladddddddiadddddddddddddddddddddddjljddekdddddddddddddddddefddeeddddddddddddddddddhmceddddddddddddddddddddbkddddddddd.cdddddddfl",
+"llnddddd.lbdddddddddddddhdddddddjddddddddddddddddddddddmddebdddddddddddddddddddddddddddddddddddddddddddddddddddddddddh#cdddddfll",
+"bkacddddikmddddddddddddcfdddjkbalabkkbdiijijmm.cdddddddcdd.iddddddddddddddddddddddddddddjcccdcccccnmddddddddddddddddd.kcdddd.aal",
+"edddddddddddddddddddddddddddgllllllllld#llllllljicddddddddhjddddddddddddddddddchbkhimmcj#ll#ellllllkddddddddddddddddddddddddddda",
+"eddbkddddddddddddddccedddddd#lllllllllc#lllllllb.dddddddddfjddddddddddddddddddmllllllllllll#.lllllladddddddddddddddddddddddddddb",
+".djndddddddddejdee.jmfjddddelllllllllld#lllllllg..ddddddek#mdddddde.ddddddddddkllllllllllllgmllllllfddddcdddeddccdddddddddddddda",
+"mddfidddddddd.dddddddijddddilllllllllld#llllllll.eddddddddn.dddddcgcddddddddddnllllllllllll#jllllll#ddddgcddgekllndddddddddddddf",
+"jdddifcddddddddddddddndd.ddbllecccmemecemem.ejllj.dddddcngledddddhkmafnfcddddd#laiinllmjijjmchkhhblliddclcddklfmecdddddeg.dddddl",
+"jddddegiddddddddddddnjddhddgl#ddhckcbciek.bdddnlnccddddddeiddcadd.gh..ekdddddilldddhl#ddijeiimc.dd#lfddc#id.gbddddddddd.aahddddl",
+"idddddm.dddddddddddhaddccdellik.fnfnaaaakkih.djlli.ddddddddddjhddd.dddcddddddllgdddbllcdemdceeceddbllcdd#gclhdddijdddddddddddddl",
+"iddddddddddddddddbb.ddddddgllceblllllllllllled.llfe.ddddddddd.ddddddddddddddillhickalldcnggggggfjcclliddklljddddeeddddddddddddcl",
+"hdde.dddddddddddclcddddddjlln..#llllllllll#jcm#llljccdddddddddddddddddddddd.llfce.bbllchglllllllgecblledc#fdddddddddddddddddddcl",
+"hddigdddddddddddclcdddddc#ll.dhlllllllllll.c.llnnlljcedddddddddcjddddddddddgllmakm.alldd#llllllllifmllnddecdde.dddddddddddkmddel",
+"hdddbcddddddddddel#n.dddfllhe.glllll#lll#ejmllfcc#llhcddddddddddeddddddddc#llhc.ljgbl#.hgllllllll#cmjlladddddd#fjdddddddddddddel",
+"idddemdddddddcddchedddcallledmlllfkjnll#mc.#lfeddmlllh.ddddddddddddddddd.gllnejnlm.nl#c.lllllggllliddfllidddddghdddddddddddddd.l",
+"mddddddddddddkhdddddddnlllljddfnednlllledcel#cidc.ell#ccdeddddddddddcedehllndcbllmgflle.llkedd.lllledd#llidddde.dddddddddddddd.l",
+"mdddddddddddd.leddddeglllfllhjdd.#lllgcmjlbcche#g.c.bcflnmd.e..cdcidckgljjicihlll..nl#dd.cddddellllmddhlllnddddddddddddddddddd.l",
+"mddbedddddddddedddeehlllmdbl#dddglllfebm#ln.cj#ll#.jdillllfkmm.e.mhallllfdhmillllifnlfddddceddelllmjhblllllgjcdddddddddfffbeddhl",
+"mddalcddddddddddenl#d#gcdddnbddmc#llebell#ckc#lllll.ec.flllllllllllllllkmndalllll.cfbddddeflddcll.jdblllnnlll#mdddddddd#dmdddcgl",
+"mddde.dddddmibn#llllkcci.ekccdnidmbecjllfc..#lllllllacccikgllllllll#ni.nei#llllllmkdddddallledda..ialllkdd.glll#fkj.dddbcdddddml",
+".dddddddddcllllllllfmcjef#eddel#mjdiillfedcejjhiihhhhjccjdd.ihlllajeciejnllllllllmmddddellllkdddhcalllbcddickgllllllbddhmdddddcl",
+"mddddddddddllllllhec#cjlll#dddglledelllcddhca.kch.#mibim.dddddgll.dddiglllllllllleddenjk#llll.ddcblllhjgebcejdmbllllgdddcdddddcl",
+"mddhmdddddcllllmcjeejfllllbddkcfl#klllnbbbbbkkbbk..hhhhihiiiihlllmmhllllllllllll.ddm##cmllll#.ddilllkb.jll#b.mcddnllgdddddddddcl",
+"idddacdddddllllcd.iflllllledeckm#llllllllllllllllknllllllllllllllmiklllllllllllndddfl#.hlll#ebddcflkekhllllllamddfllfdddddccddcl",
+"bdddmamidddglll.mllllllll#ddb#cdd#lllllllllllllllballllllllllllllmdallllllllll#ddd.fl#ejll#dcdfmddchnhlllllllllmdfllfdddddddddc#",
+"bddmnke.dddfllle.llllllllgddnlgeheflgecce.eee....ccm.mmmmjjjjilllmbklllllllllljdcddfl#cml#ekmnllhddehllllllllllhgfllfddeddddddd#",
+"bddibdd.dddglll.hllllllllgddallncbm#lfcdefcbdn.gendbefeaeijecclllmeallllllllllcc#.jfl#e.geicgllljdddhllllllllllmmmiimdddddddddd#",
+"bddmaddddddglllc.llllllllgddklllgimc#l#cede..eececcdcdddddddddhabdhalllllllllidklcdfl#.edceflllekjkkddblllllllljbn#gkddddddddddl",
+"bdd.addddddflllmmllllllll#ddjllllne#m#ln.eillllllllll#######ecaaaehblllllllllcilljanl#ccncfll#mhebll#ni.mhblllljiflladddddddddd#",
+"bddckdddddclllle.#g#llllll.d.lllllnemillni.illllllllllllllllijlllmeallllllllgd#ll..fl#ddegll#mcialllllllgffllllmmglladddddddddd#",
+"bdddjdddddd#lllmi#.demihbamdd#lllllnehellamajlllllllllllllllccllleinllllllllkblll.hflgdc#lllcbbnlllllllllllllllj.#llbdddddce.ee#",
+"bdddddddddcllll.mllghcddddddddcce...dddmaamcmhlllllllllllllljhlll.cnllllllllmllll.iglge#ll#mmeblllllllllllllllljigllbdddh#lfflll",
+"bddddddddddlllliillllfmdddddddddddddddddddddddemjikbaanfgg#lmjlll.hallllllllmllllje#l##lllmddebaanffffffffggg#fe.#llbdddcfl.dc.l",
+"addddddddddllllcellllllhddccddehjmjijijdedjiidddjibaababbhgljjlllednllllllllllllledllllllcddmm.eim.jcd.djdjdedcdd#llbdddddggdddl",
+"bdddddddddd#lllmhlllllll#llfddillllllllhebhllbdcnllllllllllgjjlllehblllllllllllladd#llllaeee.e.e..cecccdmcmc.dedd#lljdddddc#kddl",
+"bdddddddddd#llle.llllllllll#cdcllllllllljb.hlladcnlllll#fi.ddclllcdcebgllllllllfede#lllllllllllll#cag#ggggggfnfnnlllmdddheda#ddl",
+"bddddddddddllll.mllllllllllleddflllllllllmf.hllabeflllicjifddclllcdj.je.flllllne#.llllllllllllllllcgllllllllllllllllhdddkedhlcd#",
+"#cddcedddddglllcdjglllllllllcddnllllllllllj.nbllkmjkhckcjcianglllgnbm.emcm#llaihegllllllllllllllllcgllllllllllllllllkddddddg#ddl",
+"ndddddddddclllleddcigllllll#dddnlllllllllllmaebllhmdee.mcflllllllllllghd.hcbnejjcnlf.e....mmmjjj.mdmiihhhihhhhkhklllkdddcchlkdcl",
+"fdddddddddcllllln.cbdhlllllbdddfllllllllllllcaaklladd.glnhllllllllllllf.bdijc#jllehddcfekejk.lc#.hchbiadmcdddd.hgllliddc#llhddcl",
+"addddddddddhbgllllbmckm#lllhddelllllllllllll#m.mallabllllekjeeccce.if#.#lg.ddj#llkddc.imm.mm...mee.mm.mcmcddiglllgfacdddc.edddcl",
+"fcddddddddddddekglllk.ec#ll.ddbllllllllllllll#jidnlllll#iddddddddddddcellllj.lllfene#lllllllllllllllll#mi.mgllgb..ehcdddddi.ddel",
+"ndddddddddddddemce#llgcddgbddd#lllllllllllllllnddellllbdddddddddddddddde#llllllgdcclllllllllllllllllll.cehll#jem.eceddddddhkddcl",
+"bddjjddddddddddcdechllgckcdddnlllllllllllllllgmiegll#mddddddddddddddddddckllllnc.j#llllllllllllllllllm.kallh.cidddddddddddjbddcl",
+"bdddbddjjdddddddddmmjll#ccddjllllllllllllllllmjjfll#mdddddddddddddddddddddnllljddnllllllllllllllllllajeilljc.dehcdddddddddbhddd#",
+"adddmbddddddddddddddd.llecdc#lllllllllllllllnhhalll.dddddddddddddddddddddddbll#cajlllllllllllllllllfdehll.h.cgllnddddddddm#cddd#",
+"f.j.iledddddddddddddde..dddc#llllllllllllll#cjjllliddddddddddddddddddddddddcglln.dnlllllllllllllllljhmllihddc.iglcddddd.hicdddd#",
+"be..m.dddddddmdddddddcdddddckllllllllllllllfhiallfdddddddddddddddddddddddddd.lllci.lllllllllllllllncdb#bdmdddddelmddcdddddddddd#",
+"mddddddddddddgdddddddddddmhfjllllllllllllllicdjlledddddddddddddddddddddddddddnllhdcllllllllllllllldm.mdj.dddneddnkdelfddddccddd#",
+"jddddddddddddnkdcddddddde#lecnllllllllllll#enbfjeddddddddddddddddddddddddddddellbemnlllllllllllll#jm#l.cddddfmddikc#l#ddddb#mdd#",
+"hddcdddddddddjlmjmddddddc#l.ijllllllllllllbedgll.dddddddddddddddddddddddddddddmm.ecmlllllllllllllaihllmiddddddddg.c#l#ddddk#cddl",
+"hddnbdddddddddc#flcddddd.klbdclllllllllllljhc#llcdddddddddddddddddddddddddddddhllked#llllllllllll.khlbcddddddddd.cddjmdddddddddl",
+"idddn.eddddddddck#mddddddmlg.m#lllllllllll..illnddddddddddddddddddddddddddddddmllnccglllllllllllgdjnlmhdddddddddddjgddddddddddd#",
+"jdddbl#dddddddddddcddddd..llcdn#########l#jballjddddddddddddddddddddddddddddddellfccnlllllllllllncdlleddcdddcdddde#jdddcddd.cd.l",
+".dddf.lcddddddddcfnjdddddcll.decddcmceeec.ddglljdddddddddddddddddddddddddddddddgl#cdmkaabananfnnieml#hmdcdddbddddifdddaljdda#dnl",
+"mddnndgedddddddddcjbmddddcllmdijkmmijhihemdc#llmdddddddddddddddddddddddddddddddgl#cddjdicicicjceddil#cddddddfcddd.ndddjhfdd.jdcl",
+"jddeddjcddddddddddddddddddll#gffafffnaanfffnlllmdddddddddddddddddddddddddddddddgllmmmjmj.jcj.m.eeeal#jmdddddfeddddcdddddjhdddddl",
+"iddddddddddddd.eddddddddddllllllllllllllllllllljdddddddddddddddddddddddddddddddglllllllllljlllllllll#ccdddddfjdddddddddddcdddddg",
+".dddcddddddddi#bbkcddddde.llllllllllllllllllllljddddddddddddddddddddddddddddddcllllllllllljlllllllll#eedddddcdddddcnmdddddddcdcl",
+".dddmddddddddicddmaeddddc.llhhbbabnnnnnffnaf#llbdddddddddddddddddddddddddddddd.lll########m####l##llljmdddddd..dddjllhddddddn.cl",
+"mdddddddddddddddddddddddbmladdkmgehmcm.mckdd.ll#ddddddddddddddddddddddddddddddjllbddedcdccceddeddddfledddddddfgdddc#heddddidkmcl",
+".dddddcdddddddddddddddddcblkddmmj.mmmje.emcdd#lledddddddddddddddddddddddddddddalljddici.ee..jejedddklkcddddddckddddddddddibdbecl",
+"edddcnacddddddddddddddddm#lmmhlllllllll#l#gc.nllmddddddddddddddddddddddddddddd#ll.iifgffggggfgnggjbjllcdddddcnidddddddddenddbcd#",
+".ddddmddddddddddddheddddhllddglllllllllllllidjndjedddddddddddddddddddddddddddcj#adc#llllllllllnllgdeglicddddckmdddddddddddddhcd#",
+"mdddmddddddddeddddddddddglmimllllllllllllllnj.mflkddddddddddddddddddddddddddc#nmdkcllllllllllgelll.bmlgcidddddddddddddddddddjcd#",
+"mdddkbdddddddnncddddddddffcdbllllllllllllll#dcill#cdddddddddddddddddddddddddbllfddklllllllllliellljee#lkkcdddddddddddddddddddddg",
+"jddddacddddd.hddddddddddddmmllllllllllllllllfi.glllcdddddddddddddddddddddddhll#ebmllllllllllhdjlllljb.llcddddddddddddddddddddddf",
+"jdddejedddd.kcdddddddcdddddnllfnlllllllllllll.ee#llncdddddddddddddddddddddilllidcalllllllllfcdhllllbcjijbmdedddc#ncdddddddndddd#",
+"jddcihbjmiabddddddccc#iddddalncglllllllllllllnddilllfcdddddddddddddddddddmlllljdcfllllllllfcddhllllljkdil#maccdd.gedddddcc#cdddl",
+"jddejfedddddddddcciilladddddcdiieeejflllllllljcdklllll.dddddddddddddddddnllllllhkcnllllll#cdddmllllllch.gllkegcddddddddc#gfmdddl",
+"hddd.lcdddddc.acimnllkjdmcddddddddddd.nllllljmbbllllll.i.ddddddddddddcigllla.nllmjefllll#cddddcllllllgmcikllfidbdhd.dddhjddddddl",
+"adddjmdddd.bjijjbll#icke#ndddddddddddddilllikehll#.j#killnjccdddddcecgllllkdddfllmccflllmdddddd#llllll#ebc.#llfiehdbcccbhdddddcl",
+"kdddddddddiagllllljdkiklllfdddddebaahcddcl..dnll#eddddlllllll#gf#ll#d#llfecdcmdnlljc.f#eddd.eddkllllllllm.hcillllll#al#hcdddddcl",
+"hdddegcdddnllllajj.b.nlllllbdddalllll#bcdceinll#jadccd.alllllllllllldffjed.ngcmcgllmeccddd.#fcdclllllllllbckmeiagllln.cdddddddml",
+"eddddeddddallllce#ehllllllllbdhllllllllndddhll#..mfg.ddclll#llllll#fcccedjlllgcccfl#cddddcgllmddalllllllll#mcmdddlllkddddddddbll",
+"edddddddddkllllccflllllllllllbgllllllllehddmlgeg.glllbdellgdcc.eedchdjcbllllllfcccaedddd.llllnddcllllllllllllbcdelllbdddddddddcl",
+".dddddddddblllle.llllllllllllllllllll#.ehnhdj.cjgllllfdcllgddcddcccihn#llllllllfdddddddc.lllllhddmllllllllllll.dclllbdddidcnmdel",
+"fifbcdddddhllllcmlllllllllllllllllll#ebjnllhdkm#lllllnjmllf..bffgglllllllllllllgddddden.g.#llllcdd#lllllllllll.aclllbddddddccddl",
+"jgddddddddbllllccbnnnffkfggfggggggggeadgllg.ednllllllfcellgjhllllllllllllllllljdddddc#lgece#lll#cd.lll#llllllledelllbdkcddddccdl",
+"ehbdddddddbllllccbck.i.hcidbcheidk.ddefllg.m.he#llllln..llfdillllllllllllllgicdddejdde#l#edcee.eeddcj.c.m.m.i.ddclllbcl.ekdd.mcl",
+"ed#eddddddbllllm.jm.mj..c..j.j.m.i.cenllge#mllbelllllahmllfkkllllllllllllfmddddckllbce.#l#eccc.cecddmcccec.cieccelllbeljchdd..dl",
+"eddaddddddnlllllllllllll.llllllllllllllfcej#lllamllllncellfcillllllllfh.dddddddclllladd.lllllllll#edclllllllllllllllbdl.dddc#cdl",
+"edd.ddddddbllllnaannffnfcfgfgggg##llllnchillllllkklllajckhmmhllllbmeee.mjkngadddhlllladmellll#g#g##cdj###l#ll###llllbd#..mdijdd#",
+"eddddddddn#lllldd.dmdjccdcd.ce.ddegllgdd.llllllllk#llbeckkjjillll#ll#llllllllmdddfllllkcd.ll#eddddcddddcec.ccccdhlllbdfeh#dddddg",
+"cdddddddddjllllcdmceeeecceceeccdc#lllfdelllllllllllllkbmllacilllllllllllllllllmdd.lllllkdclll#edddeeecddcdececddjlllhdaedddddddl",
+"edddddddddhllllc.llllllllll#n.d.#llllfd.lllllllllllllkc.llaaklllllllllllllllll#.ddillllfdd#lll#cjdg###bcb#####eeilllideddddddddl",
+"edddddddddhfnakehllllllllllfc#.#lln#lnd.lllllllllllllhb.llacillllllllllllllllll#dddnlllfdd#leglgej.#lllgeallllmamlllmdddddddddc#",
+"edddddddddehbande#llllllllnjjclllhc##khmlllllllllllllhdellbnklllllllllllllllllll#eddbllnielldell#edelllllnflllcdilll.dddbfddddd#",
+"eddmcdddddhlllldcjjallllladjefllhdcmj.ccannnnnannnffnejellkcillllllllllllllllllllgmdcnlfdclldd.ll#cee#lllllgh.ddjlll.dddm.ddddd#",
+".ddmedddddilllledje.enllacamndfbmcellndcidjcjmided.cccdellb#hl##lllllllllllllllllllmdcnn.ellddd.ll#e.e#llgidjcccklll.dddddcddddl",
+"edddddddddjllllllnmec.ejhimll#cmddelladddcccec.dececdcc.llbcdeddde.jfllllllllllllllladdccel#cdce.ll#edefjdhcckllllllcddddddddddl",
+".dddddddddehkngllllfiiddmhlllhehhj.llggg####lhh#########llkdcjeeejemd.iglllllllllllllfmddel#ccjde.ll#c.ddcmb.lllgnakddddeddjbcdl",
+".ddddddddddddddek#l#lnedjlllhh.klc.lllllllllljnlllll##llllgflglllgfh.eedhllllllllllllllkddb#dd#icc.llgcdchllmaheddebbcddddde.ddl",
+"nddddddddddddddddd.glllklllmcmbllkillnccececedcccddccdc#llll#faaagllllkddcnllllllllllllnedccdm#lked.ll#m#llgeddddflllidddddddddl",
+".ddd.hdddddddddddddchllllljehalllm.llnddkdbmk.bcjedddjgllajeeedcdcemb#lgicdhlllllllllllace#adcallkdj.lllllhddddddmm..ddd..dddddl",
+"mdddhnjddddddddddddddmlllfdd.lll#kjllndcbfbanfafaedekllfccdcdcddddddddhllbcijllllllllllbe.l#mijegleddklll.ddddddddddddddhidddddl",
+".ddjadddddddddddddddddclllbimflllemllnm.lllllllli.cnl#e.dddddddddddddddcal#eejlllllllllac.lldellllcecll#cdddddddddddddddbcc#cdcl",
+"mdcg.dddddddddddddcdddde#lljec#l#bhllbh.llllllla.cflfeecddddckneddddddddcilgmdbllllllllkh.l#ej#llbdjal#edddkf.dddddddddd.ddhcdcl",
+"jddacdddddddddddddnbddddjllgemkllcellbc.llllll#deblncdddddcn.bjddddddcddcdklgc.gllllllladjl#dellgdcmll.ddddddddcjddddddddddddddl",
+"mddeaddddedddddddddedddddh#eee.glbkllbi.lllllljekl#cddddddcbcdddddddil#.dddhlbdelllllllbhc##jjlljdeidcddddddddef#ddddddddddegcdl",
+"jdddiddddckddddddddddccdddea#cch#e.llbj.lllllnc.#l.mdddddddddddddeddcjflmdddfljmnllllllb.el#delldeflgdddd.hkmcnllcdddddddddelccl",
+"mdddddddddjddddemcccmfmdddkllbj.#hbllbf.llllljmalacddddddddcddddh.ddddcladddelaee#lllllkg.l#jhgkccllhdddhbcdddd.#cddddddddddlccl",
+"idddddddddddddddn.nn.ddddddlllcded.llbddee.m.del#cjddddddcgcdddjeddmacdhfdd.inl.dcecce.dcjl#ddcddjlgddcfedddddddddddddddddddmdel",
+"iddddddddddddjddmedddddddddnlleddd.llbddkehnddhlkcdddddddfaddddddddml.ddcdddceladmkekdbcdil#ddjddglbddcakcddddddddddddcahdddddcl",
+"hddddddddddddi.dcfdddddddddhllk.ccklln.m.dcmmj#l.eddekk.blcdbbcdddddkbhicddde.f#khhm.bhhb#llkhhkalljddddfaddddddddddddhfcdddddd#",
+"hddddddmdddddegcdcadddddddd.llllailllllll.nlllllecddikkafmddekl.ddddddccdddddcbllllbhlllllllllllllledddddbfdhedddbjddddddddddddl",
+"idddddddddddddddddbcdddddcdcllllaillllllljnllllaeedddddddddddeeeddddddddddddd.hllllhklllllllllllll#cddedddn#hddcnfcddddddddddddl",
+"jdddddddddddddddddddddddchddglllhilllllll.fllllicdddddmaaidddadddddddddddddddd.llll.blllllllllllllnd.cn.dddmddddicddddddddddddcl",
+".ddcddddddddddddddddddddcgddjkbfmj#lllllgdbfg#g.mddddd.knjdddiddddddddddddddddchkkhcejhkafglllll#gkdjedddddddddddddddddddddcecjl",
+"faedddddibddddddddddddddciddddddddddccccddddddddddcddddddddddedddddddddddddddddddddddddddddillnecdddjcddddddddddddddngiddddcalll",
+"l#cdddddcgeddddddddddddddddddddddddddddddddddddhng#acdddddddddddddddddddddddddddddddddddddddgndddddd.cdddddddddddddd#bdddddddgll",
+"lmddddddddddddddddddicddddddddnnddddddcdddddddddcilcddddddddddddddddddddddddddddddddddddcdddddddddddc.dddjnnkdddddddmdddddddddll",
+"fdddddddddddddddddddddddddddddbjfidddddddddddcddcckdddddddddddddddddcmmdddddddddcm.ddddddddddddddddekhddd.becdddddddddddddddddal",
+"bddddddddddddddddddddddddddidddddbaddddddddddcddcc#edddddcacdddddddddcfedddddddddddddddddddddddddddddfdddd.eddddddddddddddddddal",
+"bddddddddddddddbbmddddddddddddddddeiddddddddhddd.mlgdddcddflidddddddddeddd.mddddddddddcedddddhjdddcjegmddddbcdd.ddddddddddddddgl",
+"fddddddddddddddchfcdddddddddddddddddddddddddejddcenhddefha#j#ndddddiddeiddmeddddddddcjhjdddddcjdddcjhamddddhjddkcdddkcdddddddill",
+"l.dddddddcddddddddddddddddddddddmedddddddjecdidddddddcmllgcdd.dddddddddkcddddddddddddddddddckdddddddddddddd.gjdedddd#hddddddd#ll",
+"l#cdddddc#mddddddddddddddddddddddnedddddddejcddddddddnlfdddddddddddddddcjdddddddddddddddddddcdddddddmdddddddcdcjddddf#kddddcalll",
+"ll#hee.klljdddddd.jcdddcce#fccdccgheeecccccdddddddddcecccdccccccceeececdh.dddddddddddddiddddddddccbj.eecddeeccfj.eeenllnbba#llll",
+"lllllllllllgggg#nlll#fglllllll#lllllllllll#ggfffffn#ll#ll#llllllllllllllll#ffgg#gfnggff#ffff#####lllllll##ll#lllllllllllllllllll",
+"l#liiiiihkhhhihiiiijjmjmmjjmm..eeecefl#jmjjjmjijjjm.mmmmjmmmmmjll.ee.....eeeeeeeeeeceecemlfe...eeeeeeeee.ee.eeeeeeeeccccccecelll",
+"ke#kcddddddccededmdcdcdcddcdcd.cdcddjll.dddcmddd.e..cjdjdjdcdd.l#ddc.emcjchdmdhcjcjdjeddilbdddd..djdidickeicmeiccdedidkddddcbl#l",
+"idclbddddd.jmjdidjdcdmccccedmd.edcddclladddd.dddeedddddcdcddddml#ddceejdcdmdmd.dcdcd.cdcllmdddddddcdddddcdddcddddddddddddddall.#",
+"iddmfddcmdhbabbcdddmabababbaaaanaa.dchgacm.agg#g##gg###ggj##cjcaicemggffffffffffffggkc.mniddcg#############ll#ncdm#lllgdcdcflecl",
+"iddddjkc.dhllllmdekjllllllllll#ggghdeddcceckllllllllllll#ciaemchidcjllllllllllllllllhccmmdddblllllllllllllll#idddnlllfc.ckf.mdcl",
+"mcdhd.lbdbdklllhdclamllllllllled..cdddfl#db.lllllllllllllcddde.lld.cllllllllllllllll.i.l#dddlllllllllllllllkddddclllgccdall.ddcl",
+"m.dcm.m#fcejbll#ediidm#llllllljciiebeemllhmc#llllnjllllllhdddemlldcdillllllllllllllncmfladcdma.glllllllllnejagfjmll#cicfllehddcl",
+"mcdj.ecjlb.gckllidddjnj#llllgb.dkgjlcdd#l#cbillgkmlllllljicbdc.l#dcddhlllllllllllll.jell.eddd.ecgfglllllhcbngllablgeidblljeeceel",
+"eid#bdndmladi.nlbddcllgc#ll.ddecadmhdmdnllmcd#bdc#lknllllcdddd.l#ddmdd.lllllllllll#ddhlndcddblfdemmnlll.dddddkli#l.edblljdibimel",
+"mcdllnci.jlne.dafddcllhmmll.djlbaddddddmllachjm#.#mblllllgcac.ml#dchcddcnlllllllllkam#lmm.debj#ciiak##.ddddddd.h#cejnllea.flim.l",
+"ehdlllk..chlkchcb.dcancmkincckm.fcddddacgllmbdalcecfballllkeceml#dchhdddillllllll#ecil#ceddddd.nllhijeddcmbfgn.ie.mkl#jm.bllhdel",
+"mddblllbdfdjlnddckdddd.mbcdcn#k.ddddddcdillac.d.a.cddikbj.ecd.ml#dckl.ddkllllllllam.flieedddddcll#a.ddddhflllljdmdklljdhalllbjel",
+".hdd.bllbcmeklnc.dddddjl.ddehbjddddddbdiell#c.dh#mecccdce.cccjjl#ddejeddcjlllllllmc.l#cdcddddddmebfeddddddchl#ddcnll.minllllbdcl",
+"meddddehnme.cklacdddddhlhdilkdgjdddimgkedflljcecmfeh.dcemkaic.ml#dedj#bcddmlllll#cjalndhcmcddddddmmdddc.d..cmmdmhllijcklllllkj.l",
+"mjdiddi#hddcgdbladcdddcicmellckedddbaklci.ll#midafmhcgllgfkdmkml#dddc#lgcddallllhmclljddfljaedddddddcfll.llhdddhllhcail#ieccddcl",
+".icledblndkjc.eklacdddddi#djmddddddhlhk..dgll.edigmhakllllkcdmml#cmddealkddallllc.jlfdmdjech.cddddigll#m.iic.dblljijdcccddddddcl",
+"m.clbda#cellie.dklkcddddblaemdccddjmnbmecbkllkjdijhcchl#ain#.n.l#dddedcjjddnlllfecgli.dci#nd#idejnlllf.dk#j.jillki.cdddddddke.el",
+"eael#djndjllkddbdblbdeddkllmndklnddgmelbdielllcekllbcl#egl#iddmlgd.i#djlfdcalll.emllcmdhllli.malllln.mladdhcdjlid.cddddcddmfdn.l",
+".dellbd.dellcmc.ddblaeddmllgene.cddcc.lejdehllhj.llhilkhgecd.n.lgddcb.ellndcglfeealhkmdfllllllllnmcddfl#c.cb#jecaddddd.##ichidel",
+"emellledddgadjhdcedbnecicglla.m.dddfbcj.#djellgdealkllkbedcccjmlgc.cnmdi#lcdilhce#lccdmlblllll#imcdddhgj.cillheedddcj.elgbhlhcel",
+"meelllgdddijddmjjdjdd#addclllijidd.llejd.cde#lleh.lllljbdd.f.f.lgddddbdb.hedelmmblf.iel#jllllfe#l.ddddddmkllhd.cddelllm.i#llhdel",
+".kelllladdcmdcke#dcccnla.icnklm#kdalkdg#acde.llgde#llledddfgcemlg.mcd.dagcdmgkcellmmcalhgbg.hdblheddddiekllidmddm.e#hjkgllllbdcl",
+"e..lllllkddddelaemc..calkchdkljln.#l.djlled.dgllemilln.cealf.amlgdcecaeegadk#cdmlfdkdabb#iid.bemalmddjchllkdecb#lgedk#llllllbcel",
+".f.llllll.ddddaljdnjdednlb.c.ginmj..ddd##dh..hllhdd#lll#blllc.mgfdjh.eeddedc.ddnlimdddhlgnedklhbllcdechllhdejlllia.m#lllllllkcml",
+".c.lllllllhdddcl#d#ndcddaladmdhaig##cddjfd#cccll#ccblll#aimedddhjddecjkdbbdkec.llceddd#ncck#bem.jcdeiblli.ckllhcjkjnflllllllbcel",
+"ebmlllllll#cdddnlj.cdd.icnlhdeeekijhddee.d#kjeblljd.bj.cicmddd.lgddddideehdkcdblji.cmdecdblll.#eddjmhllbdijllhciebbj##llllllbj.l",
+"edjlllllla.fecdmlnddddddecnlbccelllleelendf#dd.#kcddcccdce.ihklllgfnhmecccdddd.nddd#bc#hcllllncechdkllkdchllkmmadkjdi.jlllllbjel",
+"mamllllljjkb#fddalcdddddjednlncmef#fejlg.cglmjecagddciag.flllllllllllll#gajcdif.dkelmgljjllll#e.c.nlliehi#gjjb..nglcikmlllllkccl",
+".imllllljegllnddml.ccde.dcnenlkcjc.kkeknnclladdmllka#lllinlllllllllllllllll#b#lmddil#llj#llllgdmmkllkhcjhhbhmed.l..dniklllllbhel",
+".imlllllndgll.ddc#hjgchlc.hednlnddc.ddcdbegacdd.llllllllnbllllllllllllllllllll#cdddklllllllllmjdbllkdeeflllmddd.l.ijeemfflllhdel",
+".k.lllljdmmlbddddjlm##j#hmdmndnlfc.difedcdcdciglllllllllljlllllllllllllllllllll#kcdcenllllll.jcflljd.kfeekmf.ddckiaff.cmhlllkecl",
+"ecmllljcbl..dddddd#aelfjjibd..ealbcd.fhddcddflllllllllll#ennkhiiihbag#lllllllllll#hccchllllidiblladejllajjdlmcdmlnn#dcfmbnllhe.l",
+".h.lll.ilfddddcddd#lbihiealddmadnlndjcfcc.hmflllllllllnjcddddddddddddddjallllllllllnddde#lmedfllhcd.illb#lcai#jd..iemnbhhnllk.el",
+"edcfllmdhlmcddkhcdlllhcgh..f#kdicaladddmegl#eglllllamcdddddddddddddb#gnkccmalllllllaehddcecdflliedca.lljlf.fh.addb#gafkbcll#.del",
+".ddd.jdieicddelbcalll#hcjagllli.ccaf.cdmglllgmllla.ddddddddddddddddfllll.dddeb#lll#cnlaccddjllkd.jnb.#bnlinllccddina#nfje#keddcl",
+"bmdmeddmmddccdec#llllnedjllllllhdgcd#nmllllllb.gcddddddddddddddddddiflllcdddddchllmflllgedjdghddhl#ccddmhkllbdddddddi.dddddmmd.#",
+"ll#kcccjdddddhg.lllllladikllllllkecdnllllllllgcddddddddddddddddddddaakjedddddddd.jjllllllflgcechgkfehddddebfhf.ddddigedcidcek#ll",
+"g#ll.bm.d.dcdig.flll##me.cnllllllmddmlllllllncddddddddddddddddddddc#llldddddddddddillllllllhdcj#.jcjledddcccifkcddde.dhcjmebllll",
+"edi#jll#kdcndddd.llad.khgddalllllecd#llllllhdddddddddddddddddddddddcmkadddddddddddd.#lllllliddbdddegh#hd.##iljibdddd#cch#lkbllll",
+"eddccblll#amcd.cd.a#habcadejhlll.mjfllllllmddddddddddddddddddddddde#gn.dddddddddddddefllllll.ddd.nlnilnilliji..c.dmdjb#lllkhgjel",
+".ddjc.chglllnmecddd.fh#dcedgfllbkebllllllmdddddddddddddddddddddddd.lll.ddddddddddddddc#lllll#eddkggmlli#lgcg.deemejnllllllhcddcl",
+"eidbedddd.nllllkcdm.dchdelg.glndcillllllmddddddddddddddddddddddddddcjiddddddddddddddddd#lllllnddcmdbl.c.j.dd.jdchlllllllbcdacdel",
+".cmllgkeicdehgll#fmc.c.ddkllll.bcefllllmddddddddddddddddddddddddddm#g.ddddddddddddddddd.lllllljdel#hjf#bdddmcjf#lllllnmcideec.cl",
+"ejmllll#becdeciflllgjemd.chglaccnbeklladdddddddddddddddddddddddddddikcdddddddddddddddddd.lll#h.cdhll#becmdchflllll#b.dhdm.k#ik.#",
+"e..lllllll#hdcgcckllllaedcedcdkmlllj.addddddddddddddddddddddddddddilbddddddddddddddddddddblgdklfecnjdd.deallllll#mcckjdi#lllkdel",
+".mjlllllllll#bjdcdmjnlllficjmdc#llllkdddddddddddddddddddddddddddddkljddddddddddddddddddddd.mgllljddcheiflllll#k.cicedcflllllhdel",
+".hmllllllllllllfjeid..bgllgccdklllllhdddddddddddddddddddddddddddddb#ddddddddddddddddddddddclllllnddchllllllficdmceddhn.#llllkmcl",
+"mdjllllllllllllllln.jmidmgnhln#llll#cdddddddddddddddddddddddddddddafdddddddddddddddddddddddblllllbf.llll#hdd.cdddjkhmncbllllhdcl",
+".hmlllllllllllllllllf.ede..iglllllljddddddddddddddddddddddddddddddajdddddddddddddddddddddddclllllllkhlamjjmdmbnjgkiadeic#lllkmcl",
+".djlllllllllllllll#nkcfmdjhd.lllllgddddddddddddddddddddddddddddddd.dddddddddddddddddddddddddallllllad.dmmmmfllkng#hdcjlenlllkdcl",
+"..mllllllllllllljfcdddcddddcilllllicddddddddddddddddddddddddddddddddddddddddddddddddddddddddcllllljddidcnlllllkim.dd#.lkalllbdcl",
+"mcjllllllllllliedddemddcc.denllll#cddddddddddddddddddddddddddddddddddddddddddddddddddddddddddallllhddiflllllllljlnjd#hfgglllhjd#",
+"mcjllllllllllbdddckgbma#jmdelllllkdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddjllll#cegllllllllgjbnkcng#lllllhec#",
+".h.lllllllllcdddcllle#lkjmdhlllll.dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddc#lllljnillllllllllabidnlllllllkam#",
+".cjllllllliedd.bkllhcmeddciflllllcbgidddddddddddddddddddddddddddddddddddddddddddddddddddddddddbllllic.llgemijinlgmjjllllflllkecl",
+"eijlllllliddd.lmmh.dcdmfjdcgllllad#lkkfccdddddddddddddddddddddddddddddddddddddddddddddddddddddjlll#hed#llm.ngljg#cijllaem#hlh.cl",
+"mdjlllllgdd.c#jdedbiheehib.lllllmellmglmlfcdddddddddddddddddddddddddddddddddddddddddddddddddddcbmecmdcfll.ddclfk#.hjlgddb.#lhkcl",
+".emlllnjeinleed.#bm.bmnjceelllllejllml#hlghfc.dddddddddddddddddddddddddddddddddddddddddddddddddbf#l#ceall.ddciligih.ljddmdllh.cl",
+".ccaabddiggmkddjjckjjejbii.llll#dkllilanlkafhlficddddddddddddddddddddddddddddddddddddddddddddddlllllekklfhccbclnehbmkmci.c#lhiel",
+".ddckddcidddddcddddddddcddmllll#deij.ama#cfkgllllgjddddddddddddddddddddddddddddddddddddddddddddgllll.ccj.ccdmdjjcc.ededd.dihcddl",
+"edccccdckdmdjdkd.dhen.kmedillllfddddddddcdccc...mjicdddddddddddddddddddddddddddddddddddddddddddnlllljceachdnekcncf.bckmiecdmddc#",
+"#f#gefffanaabbbbkkhhiiijeinllllfdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddallllaccicec.ccc.cmcmc.ej.cdjddc#",
+"lllljllllllllllllllllllfillllllndddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddbllllllhkllllllllllllll#llll.gfgl",
+"lllljllllllllllllllllllnkllllllndddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddkllll##hhllllllllllllllllllljllll",
+"jmmjcjikbkbbbabbbkkkhhk.eibllllndddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddbllllfccc.mmjiiijbaaanfgg#g#.f#fl",
+".dddjdadcdndbebcmcaeijbiedellllfdddddddddddddddddddddddddddddddddddddddddddddibhbimdddccdddddddallllfdd.d.d.ckdbdncndkdidbdjddd#",
+".ddmmdecddcd.e.dmjemcdjjccellllgddddddddddddddddddddddddddddddddddddddddddddddmallgcac#fc#k.fadnllllncdmcjeddddddc.md.djcjdhcdd#",
+".dclldjeddecmbjdfleace#lmidllllgddddddddddddddddddddddddddddddddddddddddddddddddeki.aelfelbhl#d#llllb.dhejececdddelgcdcf#ffam.c#",
+"mdclndcddehl.hdamlbddcelkdd#ll#kddddddddddddddddddddddddddddddddddddddddddddddddddddcjlkjliflfclllllkcchjkibddd.ikaddcllllllkn.l",
+".ddkjf.h.#llmddgkfljddmlbjd.mmihcddddddddddddddddddddddddddddddddddddddddddddddddddddd.chlmllkclllll.cdicmddddhlneeddhllllllkjcl",
+".ccglk#fllll.ed##.ggnchlfdch#lllidddddddddddddddddddddddddddddddddddddddddddddddddddddddcielljmllll#ceddecdife#ndddde#llllllhael",
+"eiclllllllll.dd#l#mmmeel#.nkllllgdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddichllllgddcglf.llelecdjbllllllllijc#",
+".d.lllllllllec.#llllll#lljc.lllllcddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddglllladdk#.cbfidmddjlllllllllligjl",
+".celllllllghddcheilllllllki.#llll.dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddelllllhddhcddddddddc#llllllllllh.cl",
+".dmllllll#jndemfed.llllllfddalllladddddddddddddddddddddddddddddddddddddddddddddddddddddddddddhllllledmdedddddj.j#lllllllllllkajl",
+"ec.llllhllebdecjcajkllllamddjllll#eddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgllllfddccfkcd.alllllllllllllllk.c#",
+"ec.llllmflidcmmjk#lgl#aedcdcklllllkdddddddddddddddddddddddddddddddddddddddddddddddddddddddddmlllllacdbdcianlllllllllllllllllkfj#",
+"edellllndkjeg.ll.llfjdddd.dfllllll#dddddddddddddddddddddddddkddddddddddddddddddddddddddddddd#llllllfdedmdecnllllllllllllllllkdd#",
+"edellllldikj#femja.dddehflajnblllllhdddddddddddddddddddddddcndddddddddddddddddddddddddddddd.lllllgljblnjcicieh#lllllllllllllkae#",
+".d.llllljglb.hddcc.eeblllladdd#llll#cddddddddddddddddddddddbnddddddddddddddddddddddddddddddfllllfdie#lll#jeaehch#lllllllllllkcc#",
+"ecellllllmjmddddccigllllhddhddkllllledddddddddddddddddddddcladddddddddddddddddddddddddddddillllljdd.calllllnmedfdealllllllllki.l",
+"ec.llllllf.dded.kglllfiedidm.c.#llnmn.dddddddddddddddddddd.lkddddddddddddddddddddddddddddc.flllfcdcide.h#llllnjmcgemb#llllllhccl",
+"...llllnjdddceblllln.edbccklgddilimllfddddddddddddddddddddcnjddddddddddddddddddddddddddddff.allckcghek.jchgllll#ij.#cehgllllhhcl",
+"edclgjddddck#llllhc.dbdddmfn#ndddnllllndddddddddddddddddddfaedddddddddddddddddddddddddddilllj.kddalllncmmjd.flllllaeclei.nllkdcl",
+".dd.cddd.bglllfieecjddchjd.dckcdcllllllidddddddddddddddddcknmddddddddddddddddddddddddddilllllidbjllf##.dce.cc.alllllaicnjj.hmnel",
+"eddddcmnllllnmdjced.idblbhn.kcd.mblllllliddddddddddddddddkbmcddddddddddddddddddddddddd.lllllljidnllhdccmjaddmce.alllll#jcnejcmcl",
+"eddcc#lll#hddhedmakhdal#mgclgcdddcnlllllliddddddddddddddd#llmddddddddddddddddddddddddmllllllid.hll#lndb#df.#bccmbdm#lllllac..ddl",
+"jjb#.llnicecceifla.ec..cmjg#.j..mmcgllllllhddddddddddddddhafedddddddddddddddddddddddj#llllladi.lllamicjlch.al#kd.midjnllllfejddl",
+"llll.b.dccmddm##adcbgddddcfidghkfddc#llllllbddddddddddddbfhjdddddddddddddddddddddddhllllll#dddgllllg.dcacg#m#llejecdddenllljlnjl",
+"llljdddddddddddefdall.dddddddjl#dbdi#llllll#dedddddddddclllleddddddddddddddddddddcfllllllll.d.mllllllacndhllllljbladdddceifmllll",
+"hmcdddehgedddddblmmlgekcfjciclg.cecnfjkllllkb#kcddddddd.hihkcdddddddddddddddddddeklllllll#l#dhdhllllllhjhillllkdbjddddd.heccalll",
+"eddddck#lmddddd.hee.cffb#ikfcb.ceifddddallf.lllgmddddddnllgkdddddddddddddddddd.n#.llllllj.#ma..ehlllll#cdenllb.igcdddcdddmihechl",
+"eddkdggid..hccdddbl.d#mlaagbjdi.algdmddcmlmflllll#icddcflll#ddddddddddddddddj#lllnelll#edcdilljcejllnimjkjlllc#jjddddkkdcfjcdddg",
+"edcidg#ae##ledddclfcdmdghgl.endhlgedei.jdejllllllllgbedceibkddddddddddddd.bgllllllhhlncjcdjmll#.jcijcnjnm.jlleiddddddflic#lgmdd#",
+"e.egj.cdckk.edddcg.ddddm.##cc.kl#eddbll.cmdkllllllllllnh.cccddddddddddmkglllllllll#dmddc#ijdhlll.kcde#adc#bnlndddddcc#g.cfllbdd#",
+"e..lllmillnc#cddcajnddddcnde.blgdm.blllladcdcnlllllllllllll#fannnngg#mllllllllllllndddddmlbcmjll#mcedce#m#lmnljddd.lkcehhlllbkcg",
+"ee.lllihl#jfjmndjlincfiddccdklfe.dbllllllf.cbcjllllllllllllllllllllllmllllllllllnjdddeddkhlkdjjll#.mchj#ghg#jll.ddil#c.allllbhdg",
+"ei.ll#i.ne.mmi#e.lkkml#cdddkl#e.dhlllllfbllkdddfllllllllllllllllllllliflllllllgmddche#kcdn#licdhll#eicc.lidhd#lnddnlliblllllb.dg",
+".cmlllih..lljidhdgmdddcdmcblgcc.dblllllcfln#ejcll#ealllllllllllllllllkilllnhflfcdil#c#lmdcfgic.djll#ek.d.cdcdjllfc#lgcelllllkhd#",
+"ekalllllkdng.jil..manhd.dklfeheddj#lllidfmjf.icmabddeiaglllllllllllllheai.dd.lgddjljhjlbdemibiecdmll#ecddddcdclllhmiceflllllbjc#",
+"ed.lllllkcedd.llmd#lbdcdkllchdcciimllgddcdnhcdffedddddcdcmiannglfijm.dcdd.ddcbee.c#effkbdffb.hlmcdhllled.dddddflllcdefllllllbic#",
+"eamllllll.db.#ljdnlfddcalncedmmckmc#acd.cdbdaillnddddddddd.eddkljddbdcddcibmfj#lddjlenndcdig#fhddc.ill#efddjbnelllhdblllllllbmd#",
+"eemlllll#eh#if.djlfeccklgeccdjajhfbcckilnddhcalliiddmfedcdddddhf.ccihbn##llmmc#lkdc#mkmdddjihicdde.dill#chdnl#dallnddallllllbmcg",
+"encllllfcclkdddm#fcedkl#e.edclljm#gdc.fgjdcfc#lleeddclnddmccmjcmcfillllllllbhenlled.alliddflll#dm#cddbll#e.cj.mmll#cdc#lllllk.df",
+"ej.lllfml.jmfedccdcdklgcmcddcmmgnm.cddedfae.bllaimdddl#cdiccdcali.mlllbm#lll..mllhddhlllkdeklladngbhmchllbdccch.klliddclllllbjdf",
+"ecmllle.jjgllmddddce#g.ecdcdddflamnbnb#hlj.j#llecdddkmjddij..iblh.m#ejc.klllahcglgddcjfl#cgbjedc##hadc.h#maccdfkealndddjllllbmdn",
+"ej.llimfl.h#ndddcdjmccdccdddd.fmklllllim.di.llgdejddkl.d.mecddalihm#ddcbjlll#cimll.d.idjnalllh.gll.gcic.caladjcibjhfcdddklllbhdf",
+"cd.n.f.flidddddddklfdddklidddcbllllll#kgdcdnllkb.led.lndd#m.kialic.gcdcahllllmmcllfddkbdmm#llh#lnjdfbgj.dkllfce.cl#kdcdacallaicf",
+"cid.gfcc.cddddcdklgejcchlnddi#l#fanlllladk.lllcmblgccnfcdj.d.ealiec.cdjlilljbgjknllccilainiblmkjknnhlgjcaekllf.hdbllcdml.c#lb.cf",
+"eddc.dddcddcccdhlleedem.kbcfl#keddd.llleddblla.iglfccccddbndbinlhkee.ilfhlhellm..llkdell#nlj.calfikmllihm.efllnendnld.lljdmlkcdf",
+"eedddddddihd.cblgcccebcedjlgmddddigcekcdddgllmcelllccfl#mdecccalhe.llla.#gddn#bi.nll.jalgg#cdcmdclnejlaelhdcbllnc..mc#llkddakfdg",
+"eddccejbfaebckl#.dedmkfncijdddddd.lfc..mb.lllebnllliddflle.ejjnlijml#hkllbhejimcmilli.e#aakddddddnlih#gdk#ijcbllahicmf#ljddjaedg",
+"ejel#lllgdceblleecddkhmdddddddddd.#hblnccfllieelllllmdhlljddecalimc.d.ffkenhblbdl.#lfedbeddcdcdcdeli#n#ddfl.hmnllhe#cc.mddcc.gcf",
+"edmllllbcccbl#cecj.ddddddddn#hedddddmjdhell#djhllllllfcalhcdi.alh.egfnnaankkcl.cccjlljkdddddddd.cddblmaddcglhcjk#lacg.#l#n.ddccg",
+"ej.lllbcmeblg.idjllfidddddcnll#.ddddddecilla..gllllllledmjjdmmalhhchkkhkbbahcbkfdjcllfe.ddddddchgkem#accdd.llijdmllamjiglllnendg",
+"edmlladidflledcdemmmcddddhd.llladdddcdiegllj.illllllll.dml#ckhalidcahjj.mmmjdd#hdejfllc.dccdbfjbm#ahe#ilmddnll.ddfllbmie#lllbcdg",
+"eedlhcccnl#cdcd.ddddddddalmhjlkeeceddcejllnmbnllllllllncdjlmmmalib.mlllll#enbd.jbcjellkimcddc#blheblb.ellcddnllji.blladfe#llbadf",
+"cedjddealgmdemelnheddddbllgi.jcjl##cdcmnllhec#lllllllllghefjjjnlhmebhllllf#aehc#ge.efll.cdcecjhlgdinkgjbaddchll#hejbllbeh.glamdg",
+"ecddddfllcidkfhllllmddbllllfble.lgjeddd#llciillllllllllllfcei.alicdajklllla.flekege.illhnc#lkdcl#c.eecm.cddd.llll.bcfllbjjcgbgcg",
+"cddccglgc.dklkd..ccddgllllllllmdeededdhllbjj#llllllllllllledmenlhicacmebll#lle.hflkmc#lgc.klefckjcnahfgc#l#cdjlllljkcbllncfcecd#",
+"cdddjlgeechll.dddddmglllllllll#if#jdjc#ll.emllllllllllllllfcmmnlhecjcjaalllghnllll#dhjllijehk#cbnballllhlllcdelllllje.allaeb.idg",
+"eddkefcdehllgdddddilllllllllllllll#dc.llgdjklllllllllllllllmmenlhecfdmjbllllllllllle.cggkcjdknchjilllll#blkdddfllllljjcfllajcdc#",
+"ee#lndddklllmdddj#llllllllllllllllhccc..ccc#lllllllllllllllmbbhfmfckii.alllllllllllfib.nbcccb.mlllllllllbcddddc#llllljbckllhdddl",
+"bglneacilllncdcalllllllllllllllll#ejeffackjllllllllllllllll....iecclll#nllllllllllll..ellbj.hn#llllllllllacddddflllll#ciekfmkddl",
+"lllcdddce.edddd.m.mjjjjjiiijjiijm.dekllkdddemmmjmmmm..mmm..cdcaliedhbbkabbkbbbbbbbbhccdnll.dc.m...mm.m.emmcdddce.eeeeedcdddflicl",
+"lncdddd.dddcdccdedcddddkejdmm.bincddgll.ddcach.ikbbhicnjfmbeddalhddjmjn.icacndacndhdiddillkddcheacncndnef.neb.gjh.hkhb.gcddhllll",
+"lajjjmmjjjjjmmj...m..mmmm...mmmjjm.jlll.ecc.c.e.mmecee.e..meeeblhddeeejc.cmcmdmdedcdedddglfe..m.mmjjmmjjj.jijiiiijiijijijmjjglll",
+"lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllfnnnnnfffffffffffgffgfnllllllllllllllllllllllllllllllllllllllll",
+"llllllllllfiiijkkhj.e.mjjighe.ee.ceceeee.m.e.ee.e.mme..eeeeccccceeeeeeeeeee..ee.llllllllke.mjm...mjjm..eeeccccec.hceeglfjeekllll",
+"lllk.dcjalmdddddddddddddddhcddddcecdddddddddddecdcbcdddcdddddcdddddddd..cdddddddmbi..iafddbllll#llllf.ddddddd.cdckdddnbddddd.#ll",
+"ll.ddddddmmddddc.cddddddddedddddiddddddddddddngn.dgjdda#cdddddddddddddgllmncdddddddddddddde..m.m.j#mddmddedddehehhdddjddddjddell",
+"lhdddddddddddddcb.ddddddddbdddddcdddddddddcdjkddaddfcf.cmc.lfhdddddcddajcdjcdddddcng#feddddddddccedddcjdbjdddde.l.ddddddddddddhl",
+"gdddddddddddddddddddddddddfeddddj.ddddcddddddddckddik#cd.e.ammdddddjddddddeddddddmhdnjnedciddcmdddddddd.nceddddclahdddddddddddml",
+"hddddddddddddddddddegcbdddekddd.addddcajdddddddcmdddfhddddejdddddddccdddddddddddddddbddcdcedcddddddddddcdhedddddae.dddddddddddcl",
+"iddddddddddddddbddddmdeddddccdikdddddehmdddddddccddd.dc.dd.lakdddddd.ddddddddddddddcbdddddcfccjicddddddcbmddbkddj.ddddddddddddcl",
+"nddddddddddddddmdddddmdddddddeiddcddddcb...ddddjmiddddchdd.bijddddddneddddc.c.ddddeahddddddmbghd.jddcddccjmahddddcdddkddddddddjl",
+"l.dddddddddddddddddddddddddddcddddddddddjicenddiieddddcbddm.ddddddddjedddddcikddddddddddddddfcdalmdeadddddnidddddddddf.ddddddc#l",
+"lfdddddddhjdddddddddddcngj.ddddedddddddddddccdddcdddddcaddjeddddddddddddddddddddddddddddgjdddd.bmedddddddddddddddddddf#edddde#ll",
+"lgjddddddhccccee..mmminllllfhjnlfmmmjeddd.cdedddd..mmjhl#gl#gnkdddhffffnijmjihi.edddddddjbcmiijji#ahbkkkkbbbkhjjmjmmcdcddddddehl",
+".dddddddddc#lllllllllllllllllllllllllbddclkcldid.lllllllllllllmdddmllllllllllllllcddddddedhlllllllllllllllllllllllllidddddddddjl",
+"eddmddddddellllllllllllllllllllllllllkdddbgei.hd.llllllllllllidddddmlllllllllllledddddddcdkllllllllllllllllllllllllljdddddddddil",
+"edd.ddddddellllllllllllllllllllllllllkdccddddmkdmlllllllllllidddddddhlllllllllllddddddddddbllllllllllllllllllllllllliddeddddddbl",
+".dddddddddellllllllllllllllllllllllllmd.gmdcdkndhllllllllll.dddddddddklllllllllidddddddddeglllllllllllllllllllllllllhddgeddeedhl",
+".ddddddddd.lllllllllllllllllllllllll#dddccdcddcdbllllllll#mdddddddd.jd.llllllll.dddddddddcillllllllllllllllllllllllljddgfkcaadjl",
+"mddddde.dd.lllllllllllllllllllllllllbdddcdddddddgllllllllmdcdcddejalhddglllllllhddddddddddc#lllllllllllllllllllllllljddackllbdml",
+"mdddddcedd.lllllllllllllllllllllllllhdddcdddddddgllllllledddddddiaheddcgllllllladddddddddddblllllllllllllllllllllllljddhddhfcdml",
+".dddcmcdddelllllllllllllllllllllllll.ddd.ddddddd#llllllmdddddn.dddddddellllllllgdddddddddddillllllllllllllllllllllllmddbcddddd.l",
+"edddc#kcddelllllllllllllllllllllllllcdddcddddddjlllllljddddddgmdddddddckm.alllllcddddddcdccellllllllllllllllllllllll.ddkcdcdddml",
+"eddddicdddcllllllllllllllllllllllllkdddddddddddglllllmdddddddadddddddddddddbllllmdddcdchdejdlllllllllllllllllllllllljdd.ddddddjl",
+"edddddedddcllllllllllllllllllllllllcddddddddjdelllllmddddddddedddddcddddddddklllfddddddmddkdblllllllllllllllllllllllmdddddddddil",
+".dddddddddc#llllllllllllllllllllllfddddddddcjdillllmdddddddddddddddddddddddddfllledddddimdadcllllllllllllllllllllllljdddddddddhl",
+"menanijjedcgllllllllllllllllllllllmdddddddddddflll#cdddcddddddddddddddddddddddnllidddddindkddbllllllllllllllllllllllidddddddddbl",
+"mmbeeedccddklllllllllllllllllllllkdddddj##iddell#.h.dd.bdddfjdddddddddddddddddcnllcdddjm.dcddc#lllllllllllllllllllllidmb.kcdddnl",
+"jmmcdddddddbllllllllllllllllllllgcddddcbcjfaebl#mdddddeadddcdddddddejdddddddddddfladdjmeddddddilllllllllllllllllllllbdc#jlcdcall",
+".jmddddddddblllllllllllllllllll#cddddd.cdddefllcdddddddfddddddddddda#ddddddddddddfldd.ddddddddd#llllllllllllllllllllhddac#dddfll",
+".hcdddeddddhlllllllllllllllllll.ddddddddddddb#mddddddddkbdddddddddi#kidddddddddddiladdeddddddddcnlllllllllllllllllllbddedidddcbl",
+"jhdddeedddcglllllllllllllllllljddddddddddddel.dddddddddblhcddddddcn.djeddddddddddg#g.ddddddddcddmlllllllllllllllllllbddddddddd.l",
+"imdddkddddilllllllllllllllllljdddddddddddddheddddddddd.#j#lhcddddmcdddddddddcddddddddddddddddddddklllllllllllllllllladddddddddel",
+"idddcbddddcllllllllllllllllljdddckiddddddddcddddddddddhndcancdddddddddddddddfjddddddddddddddddddddnlllllllllllllllll#ecddddddd.l",
+"hddddcdddddallllllllllllll#.dddddcncdddhddddddddddddddbkddfdddddddddddddddd.gddddddddddddddddcmcdddbllllllllllllllll#.ddddddddel",
+"kddddddddddflllllllllllllgddddddddbddddiddddddddddddddbmd.addddddddddddddddj.ddddddddddddddddekdddddalllllllllllllllkdddddddkdel",
+"amjhkkkbbieallllllllllllhcdddddddmbdddedcbdddddc.cddddk.djjddddddddddddddddddddddddddddddddddecddddch.blllllllllllllkdcdddddcdel",
+"amka##lahk.kllllllllllf.dddddddddbh.jiddmgddddj#l#mdddh.d..ddddddddddddddddddddddddddddddddddcembddddddekgllllllllllhddiedddddcl",
+"nddjkda.dddbllllllllljdddcddmiddddmjddddd.dddmllllljddm.de.ddddddddddddddddddddddddddddddddd.gmehdddddddddefllllllllhddfkdddddcl",
+"nddedddcdddhllgnfnj.edddddenfhdcdddddddddddddalllllgddddddeddddddddddddddddddddddddddddddiabmcddcdddddddddddcma#llllkdddddddddel",
+"fdddcdddddddccddddddcdddd.fmckdddddddddddddddflllllledddddddddddddddddddddddddddddcddddd.#mddddddddddddcdddddddddmhkedddddddddel",
+"nddddddddddddddddddcccddddddeadddddddddddddddhlllllleddddddddddmddddddddddddddddddhdddddbcdddddddddedkllbdddddddddddddddbfglllll",
+"ndddddddddddcdddddddddddddcbngcddddddddddddddc#lllladddddddddddbdddddddddddddddmddimddddaddekdddjddkiacenmddd.iddddddddda#eeecml",
+"nddddddddddddddddddcmdddddcmdkmdddddddddddddedilllg.ddddddddddcgdddddddddddddddndd.l.dddeddj.ddddddhlcddddd.nf.dddddddddckbcddel",
+"fdddddemddddddddddddddddddddddadddddddddddcnlmdeecddddddddddddel.ddddddddddcddc#ddcl#edddddddddddddd.jddddd#mdddddddddddddigdd.l",
+"ndddddddddddddddddddddhcddddddmcdddddddddd.llkddddddddddddddddelidddddddddddddc#.efamddddddddddddddddddddddddddcmdddddddcddbidel",
+"fddi.ddddddddddddddddegmdddcmacdddddddddddcfl.ddddddddddddddddmlbddddddddddddddgffiddddddddddddddddddddddddddddjkdddddddbmdjgdel",
+"ledddddddcdddddddddddjcdddc##ddddddddddddcddddddddddddddddddddjladdddddddddddddhncdddddddddddddddddjjddacddddddceddddddddddmgdel",
+"lkddddmddddddddddcdddddchfl#.dddddddddddkgddddddddddddddddddddilfdddddddddddddddddddddddddddmjdddddcffalcddddddddmhjdddjdddmnd.l",
+"#dddddhdddddddjdefedcei#lllhdddddddddddd.mddddddcdddddddddddddhlgdddddeaddddddddddddddddddddbiddddddc#llgiecdddddeibeddnmddn.del",
+"ljddddddddddcilmnlf#lllllll#.dddddddddddddddddddnjddddddddddddkl#dddddcledddddddddddddddddddnnddddddddglllllficcdddddddd#inbddcl",
+"laddcmdddddhlllllllllllllkc.aeddddddddcddddddddde#bdddddddddddkl#dddddclmddddddddddddddddddda#ddddddddmlllllllll#fnkmddd.bjddd.l",
+"gdddkddddddklllllllllllljdddeiddddddddc.dddddddddmlkdddddddde.nlleddddclmdddchhdddddddddddddhlidddddddd.#llllllllllladdddcebnd.l",
+"fdddjddddddklllllllllll.dddddddddddddddicdddddddddnlfddddci#llllllgkcdml.dd.##cdddddddddddddelleddddddddclllllllllllnddde#lllccl",
+"gdddjidddddblllllllll#jddddddddddddddde.ddddddddddc#lg.ca#lllllllllllnffdca##edddddddddddicddabdddddddddd.#llllllllladddddehmdel",
+"#dcddhcddddallllllll#.ddddddddddddddddbddddddddddddjllfflllllllllllllllgmflljcddddddddddel.dddddddddddddddelllllllllbdci.cieddcl",
+"#dddddaddddhlllllll#dddddddddddddddddmddddddddddddddhllllllllllllllllllllllhdddddddddddd.icdddddddddddddddde#llllllladddddddddd#",
+"#hkkecfkdddkllllll#.dddddddddddddddddbddddedddddddddelllllllllllllllllllllkcddddieddddddddddddddddddddcddddde#lllllladdddddddddg",
+"#.eecddddddallllll.ddddddddddddddddddedcddmdddddddddhllllllllllllllllllll#cddddc#iddddddddddddddddddddhmddddif#lllllfcddddecddd#",
+"nddddddddddnlllllmcdcdddddddddddddddddddddcddddddddclllllllllllllllllllllladdddddd.edddddd..dddddddddedc.ddkhdcglllllfdddcl#hdd#",
+"ndddddddcddflll##fdddddddddddddddddddddddddddddddddblllllllllllllllllllllllmddddddbcddddddcdddddddddddddeiihdddegllllbddddamcddl",
+"gddddddddddfll#e.ndddddddddddddddddddddddddddddddddgllllllllllllllllllllllladddddddddddddddddddddddddddddigdddddelllkddddc.addc#",
+"#cdddddddddflndcddddddddddddddddddddddddddddddddddd#lllllllllllllllllllllll#cdddddddddddddddddddddddddnddacdddddde#lbdcdilgldddg",
+"lcdaedeicddfbcdddddddddddddddddddddddddddddddddcejbllllllllllllllllllllllllledddddddddddddddddddddddddnddidddddddd.#hcndn..edddl",
+"#ddedddedddmdddddddddddddddddddddddddddddde.iaf#llllllllllllllllllllllllllllkecccdddddddddddddddddddddkddddddddddddeec.cmdddddbl",
+"#cdd.dddddddddddddddddddddddddddddddddddcklllllllllllllllllllllllllllllllllllllllgniedddddddddddddddddddddddddddddddddddddmacdml",
+"#cddcdmmdddajddddddddddddddddddcddddddddddccc.mihkblllllllllllllllllllllllllll#g#akmcddddddddddddddddddddddddddddddddddijdelmdel",
+"lmdddddkdddnlmddddddddddddddddhiddddddddddddddddddd#llllllllllllllllllllllllkedddddddddddddddddddddddddddddddddddddheddnfddnedel",
+"nddddddceddnlljddddddddcddddddgiddddddddddddddddddd#llllllllllllllllllllllllcdedddddddddddddcdddddddddddddddddddddhledddn.diedel",
+"bddddddddddflll.ddddddccdddddd#ndddddddddddddddddddnlllllllllllllllllllllllfdddddddddddddddeleddcddddddddddddddddkllbcddceddddcl",
+"kdddddddddc#lll#edddddidddddddll.ddddddddddddddddddilllllllllllllllllllllllidddddddddddddddc.dddhbjdddddddddddddjllllkddddddddcl",
+"hddddddddddgllll#cdddaiddddddd#l#cddddddddddddddddddbllllllllllllllllllllllcdddddddddddddddddddddcbddddddddddddkllllnddddddddddg",
+"hddddcde.dc#lllll#.dibddddddddhlleddddddddceddddddddc#llllllllllllllllllllmddddddddddddddddddddddcedddddddddehblllllhdeacdddced#",
+"hddddcd.hdc#llllll#aledddddddddagcddddddcb#l#bcddddddmllllllllllllllllllladdddddddddddddddddddddd.cddddddddddglllllljdmlhdddc.dl",
+"hdddcdddddclllllllllmddddddddddddddddddddccenlfdddddclllllllllllllllllllliddddddddddddddddddddddehddddddddddillllllljddccddddmd#",
+"bdddi.ddddd#llllllllgcdddddddddddddddddddddddb#dddddjllglllllllllllllllll#ddddddddddcdddddddeddcedcedddddddkllllllllidddddddcidg",
+"hddddccdddd#lllllllllncddddddddddddddddddddddc#dddde#lnccallllllllllllafllkdddddddddmdddddddeddddddecdddddmlllllllllbdddddccmkd#",
+"iddddeedddd#llllllllll#cddddddddddddddddddddddaddddflnddddbf#lllllllhcddbllmddddddddddddddddmdddddddjdddchllllllllllidddddj#lid#",
+"idddd.fmeiallllllllllll#edcdddddddddddddddddddcdddhladddd.gddelll..cddddcklfdddddddddddddddddddddddddmdcglllllllllllcdddcdddmjd#",
+"iddddccdddclllllllllllllfcdddddddddddddddddddddddelbdddddbndddglgdddddddddhlhddddddddddddddddddddddddkimlllllllllllleddddddd.icl",
+"iddddmddddd#lllllllllllllgddddddddddd.dddddddddddbhdddddd#jdddalfdddddddddd.fddddddddcddddddddddddddddglllllllllllll.dddmddd.id#",
+"jddd.cdddddchaa#llllllllllfeddccddddd.fjcdddddddmkddddddifcdddklbdddddddddddcmdddddd.cdddddddddddddddallllllllllllll.dddkdddc.d#",
+"mdddddddddddddddc.ag#llllllljcncddddddcgfieeedddddddcjm.#kddddklidddddddddddddddddddcdddddddddddddddhlllllllllllllll.e..ndddddcl",
+"iddddcdddddddddddddddeifllllll.ddddddddddmb#gcddddddekgllleddd.l.ddddddddddddddddddddddecddddddddddnllllllllllnhjmc.#lll#dddddd#",
+".dddddcd.cdddcfcddddddddciflll.ddddddddddddddddddddddddbl#kddde#cddddddddddddddddddddddbeddddddd..fllllll#ajedddddddceceeddddcml",
+".dddmdde#eddddcjddddddddddd.nlkdddddddddddddddddddddccc#bcidddc#cddddddddddddddddddddddiddddddddnlllll#amcddddddddddddddddddefg#",
+"jdddccdddddddddddddddddddddddcgndddddddddddddddddddmgmll.ddddddaddddddddddddddddddddddneddddddddalllacdddddddd.njdddddddcmdddddf",
+"bimm.ecddddddcddddddddddddddcddmcdddddddddcddddddddmbdcb#cdddddcdddddmaddddddddddddddc.ddddddddi#fjedddecdddefhedddddddddedi.ddn",
+"fll#llkddddddddddddddddddddcfddddddddddddjfcdddddddejdddkjdddddddddddalicdddddddddddejdddddddddf.dddddhiddddm#ccddddd.iddcdddddb",
+"jjkcddddddddddddddddddddddd.adddddddddddbljddddddddddddddddddddddddddnllidddddddddddeddddddddddddddddddddddddl#jddddd.idjfddddda",
+"icncddddddddddddddddddddhedccddddddddddd.ncddddddddddddddddddddddddddd.hcddddddddddddddddddddddddddidddddddddmedddddd.kdddddccda",
+"hddjddddddddddddddddddddniddddddddb.ddddddddddciddddddddddddddddddddddddddddddddddcdddddddddddddddmbddddddjcdcddddddddcddddcacdf",
+"kddcddddddd.m.dddddddddddcdddddddd.lmdddddddddkfdddddddddddddddddddddddddddddddddddddddddddddddddddddddddil.daedddddddddckg#cddg",
+"hddddddmhkflll#gnbjedddddddddddddmd..dddddddddkkddddddddddddddddddddddddddddddddddddddddddddddddddddddddmgacdcdb.mjjcddde#nedddg",
+"bddddddddd.lllllllllbeddddd.dddddjddddddddddddkmdddddddcdddddddddddddddddddddddddddddddddddddjmiddddddddecddcjallllledddddcdddda",
+"hdddddadddelllllllllll#hcddcddddddddddddddddddi.ddddddel.ddddddddddddddddddddddddddddddddddddcckhddddddddck#lllllllleddddddddddb",
+"hddmingdddelllllllllllll#hidddh.deddddddddddddemdddddddjddddddddddddddddddddddddddddddddddddddddbddmddcjnllllllllllleddddddddddn",
+"kdddddkdddelllllllllllllllndddenemddddddddddddddddddddddddddddddddddddddddcdddddddddddddddddddddkddddefllllllllllllleddddddddddg",
+"hdddddddddcllllllllllllllllkddddddddddddddemddddddddddddddddddddddddddddddcfjdddddddddddddddcddiiddcalllllllllllllllcdddddce.ddf",
+"bdddddddddclllllllllllllllllnddddddddcm.ddcg.dddddddddddddddddciddddddddddflnddddddddddddddddddhad.glllllllllllllllleda#kbf.dddf",
+"ndddddddd.illlllllllllllllllladddddddj#mdddhledddddddddddcdddegmddddddddddn#hddddd.mddddddddddddab#lllllllllllllllllcdegdckdccdg",
+"gdddcdaddiklllllllllllllllllllkdddddcachdddclledddccdddddaddb#eddddddddddddcdddddh#cddddddddddddmllllllllllllllllllliddamdicdidg",
+"#mddddbdddmlllllllllllllllllllljdddd.edncdddmlfdddhjdddddgngn.ddddddddddddcdddddjlhddddddddcdddcflllllllllllllllllllgcdchdccdcdf",
+"#eddddhcdd.llllllllllllllllllll#.ddddddnkddddglfcdgadddddgacdddddddddddddelhdddml#ddddddmcdddddfllllllllllllllllllllljddeddddddf",
+"fddddddcddellllllllllllllllllllllmdcdddjlcdddhllgklbdddddbcddddddddddddddj#cddilliddddddciddddjllllllllllllllllllllllfddddddcddn",
+"fdddmihcdd.llllllllllllllllllllllfcdddddiddddelllllmdddddhmdddddeddddddddccddm#lledddddddddddmllllllllllllllllllllllmcdddddddddn",
+"gdddkaniddelllllllllllllllllllllllhddddddcddddallllcdddddmndddcaidddddddddddelllfddddddddddddfllllllllllllllllllllllcdddcdehddda",
+"fdddbcddddmlllllllllllllllllllllllgdddddddcbdd.llllfddddddfdd.lmddddddddccdmlllljdddddddddddhlllllllllllllllllllllllcddddddaddda",
+"nddcadddddjlllllllllllllllllllllllliddddddekddclllllndddddmhdcmddddddcddddm#llllcddddddddddcllllllllllllllllllllllllcdddaedidddn",
+"nddd.mdddklllllllllllllllllllllllll#cddddddddddflllllncddddgedddddddmmddd.lllllfdddddjcddddhllllllllllllllllllllllllcdddeddddddn",
+"fddddmdddelllllllllllllllllllllllllljdddddccdddhllllllndcdddacddddddn.ddhllllllfdddddeddddclllllllllllllllllllllllllcdddddddddda",
+"gddddcddddfllllllllllllllllllllllllladddddfbdddcllllllladddd.ncdjddd#idilllllllkddddddddddillllllllllllllllllllllllleddddddddddn",
+"gdddddddddhlllllllllllllllllllllllll#cddddmgdddd#llllllladdddjlj#dddjlfllllllllnccddddddddnlllllllllllllllllllllllllcdddddddddda",
+"fdddddddddmllllllllllllllllllllllllll.ddeddbjccdflllllllladdddm#gddddglllllllllmcddddddddclllllllllllllllllllllllllleddheddddddn",
+"fdddicccdc.llllllllllllllllllllllllllhddddde#eddnlllllllllhddddemddcflllllllllbddddddddddellllllllllllllllllllllllllcddkghedddda",
+"fdddajdeddclllllllllllllllllllllllllladcddcdmbddblllllllllledddddddflllllllllliddddddddddjlllllllllllllllllllllllllledddcjeddddn",
+"adddanddddellllllllllllllllllllllllllfdeedekgfedilllllllllll.dddddfllllllllllljdddddddddd#lllllllllllllllllllllllllledddddddddda",
+"bdcdj.ddddcllllllllllllllllllllllllllfddddddcdddmlllllllllllgeddcallllllllllllmddddddddddkllllllllllllllllllllllllll.ddddddddddf",
+"kdddddddddcllllllllllllllllllllllllllfdddddddddd.llllllllllllgddkllllllllllllleddddddddddalllllllllllllllllllllllllleddddddddddf",
+"gihedddddmccejmmjihbannbaakbkbnffggffidd.cddddddmlnnffffnbknab.cbffg##l###lll#cddddddddddm#llll#fnngllllijhkbkhjm.ecdijddddd.bbl",
+"llgedddddnhdddddddddddddddddddddddddddddm.ddddddemdddddddddddddddddddccdccccecdddddddddddddc.lgeddddddciddddddddddddd#bdddddenll",
+"l#cdddddddjddddcccddddcdddddeddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddneddddddddncddddddddddddhddddddddnl",
+"lhddddddddddd.lnmcddddddddd.#cddddddddddddcddjadddddddddddddddddddddddddddddddd..ddddddddddddddddcdddbngddddacceedddddddddddddml",
+"lcddddddddddd.l.dddddddj.dd.#ddddddddddddddd.fikijddddjiddddddddddddddddddddddcfjddddddddddddddddcdddemfddmdikddddddddddddddddd#",
+"lddddddddddddcleddddddclaccj#dddddddddcddddcledddaddddddfjdddddkedddddd.cdddddd.idddddddcddddddddddddd.ndd.kdiedddddddddddddddc#",
+"leddddddddddddjmddcdddelgbbbhddddddmaniddddbnaeddjdddddddcddddeladddddcndddcddjljdddddmnadddddefgeddddendddkicadceedddddddddddel",
+"liddddddddddddd.ddcbacckddddddddddei.dddddddc#jdcjdcdddddddcdd.l#cdddeee.ddcddh#hdddddeeiddcddddddddddcinmdc.dn.h#.ddcddddddddhl",
+"l#ddddddddmdddddddddcdddddddddddiddddddddddefbddddddddddchghddc#lbddddifndddddddcdddddddidddjjddddddddddddddddab.hcddadddddddd#l",
+"ll#.dddddffddddddddddddddddddjdcl.ddddddddddcddddddddddddccdddddccdddddcabddddddddddddddhddddcddddccdddddddcdddddcdddg#.ddddegll",
+"llllfkik#l#.cddddddddceccjkem#..fg.ceeccccddccdccccddddddcceeee..m.ecccem#eecceeccccdddcbccccccdcdaicceeccccccccedddd#llgaafllll",
+"lllllllllllllgfg#gllllll#lllllllllllllll#l##l###lllgfgf##llllllllllllllllllllllllllll##ll#llll####lllllllllllllllabnalllllllllll"
+};
diff --git a/pixmaps/m-axp.xpm b/pixmaps/m-axp.xpm
new file mode 100644 (file)
index 0000000..09f089c
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c #bb0000",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"   OO    OOOOOO   OOOOOOOOO+++++++++++++++++++++++XXXXoo        ",
+"  OO OO  OO OOOO OOOO OOOOOO+++++++++++++++++++++++XXXooo       ",
+" OOO   OOO   OOOOOOO  OO.XOO+@@+@++@+@@@@++@+++++++XXXooo       ",
+" OOO   OOO    OOOOO   OO.XOO+++++++++++++++++++++++XXXoooo      ",
+" OOO   OO      OOO    OOOOOO+@@@@+@@+@@@+++++++++++XXXoooo      ",
+" OOO   OO     OOOOO   OOOOO++++++++++++++++++++++++XXXooooo     ",
+" OOO  OOO    OOOOOOO  OO.XX++@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"  OO OO OO  OOOO OOOO OO.XX++++++++++++++++++++++++XXXooooo     ",
+"   OOO   O OOOO   OOOOOO.XX++@@@+@@@@+@@++@@@++++++XXXooooo     ",
+"         OOOOOO         .XX++++++++++++++++++++++++XXXooooo     ",
+"          OOO           .XX++@+++++++++++++++++++++XXXooooo     ",
+"                        .XX++++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@@@@+@+@@@+@++++++++++XXXooooo     ",
+"                        .XX++++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@+@@@@++++++++++++++++XXXooooo     ",
+"                        .XXX++++++++++++++++++++++XXXXoooo      ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"                            ooooooooooooooooooooooooo...oo      ",
+"                             ..........................ooo      ",
+"                            oooooooooooooooooooooooooooooo      ",
+"                          oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"                          oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"                        oooooooooooooooooooooooooooXXXooo     . ",
+"                       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-blank.xpm b/pixmaps/m-blank.xpm
new file mode 100644 (file)
index 0000000..3e025ea
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c red",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"                        .XX+++++++++++++++++++++++XXXXoo        ",
+"                        .XX++++++++++++++++++++++++XXXooo       ",
+"                        .XX++@@+@++@+@@@@++@+++++++XXXooo       ",
+"                        .XX++++++++++++++++++++++++XXXoooo      ",
+"                        .XX++@@@@+@@+@@@+++++++++++XXXoooo      ",
+"                        .XX++++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"                        .XX++++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@@@+@@@@+@@++@@@++++++XXXooooo     ",
+"                        .XX++++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@+++++++++++++++++++++XXXooooo     ",
+"                        .XX++++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@@@@+@+@@@+@++++++++++XXXooooo     ",
+"                        .XX++++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@+@@@@++++++++++++++++XXXooooo     ",
+"                        .XXX++++++++++++++++++++++XXXXoooo      ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"                            ooooooooooooooooooooooooo...oo      ",
+"                             ..........................ooo      ",
+"                            oooooooooooooooooooooooooooooo      ",
+"                          oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"                          oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"                        oooooooooooooooooooooooooooXXXooo     . ",
+"                       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-bsd.xpm b/pixmaps/m-bsd.xpm
new file mode 100644 (file)
index 0000000..d51cf70
--- /dev/null
@@ -0,0 +1,62 @@
+/* XPM */
+/*
+ * BSD daemon
+ * The original BSD daemon is Copyright (c) 1988 Marshall Kirk McKusick.
+ * All Rights Reserved.  Reproduced with permission.
+ */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 9 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"-      c gray10",
+"O     c red",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                     OO                                         ",
+"                      OO  ...........................           ",
+"          O           OOO.XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"         OO     OOOOOO OOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"         OO    OOOOOOOO OXX+++++++++++++++++++++++XXXXoo        ",
+"        OOO  OOOOOOOO OO.XX++++++++++++++++++++++++XXXooo       ",
+"        OOOO OOOO OO O O.XX++@@+@++@+@@@@++@+++++++XXXooo       ",
+"         OOOOOOO O OO  O.XX++++++++++++++++++++++++XXXoooo      ",
+"          OOOOOOO  OO  OOXX++@@@@+@@+@@@+++++++++++XXXoooo      ",
+"            OOOOO  OOOOOOXX++++++++++++++++++++++++XXXooooo     ",
+"             OOOOOOOO OOOOX++@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"             OOOOOOO  OOOOX++++++++++++++++++++++++XXXooooo     ",
+"             OOOOOOOOOO OOX+-@@@+@@@@+@@++@@@++++++XXXooooo     ",
+"             OOOOO OOO OOXX--+--+++++++++++++++++++XXXooooo     ",
+"              OOOOO   OOOXX----++++++++++++++++++++XXXooooo     ",
+"               OOOOOOOO .XX---++-++++++++++++++++++XXXooooo     ",
+"                 OOOOOO .XX------+@+@@@+@++++++++++XXXooooo     ",
+"                O O OO  OO-++++++++++++++++++++++++XXXooooo     ",
+"                OOOOOO OOOO++@+@@@@++++++++++++++++XXXooooo     ",
+"                OOOOO O-OOOX++++++++++++++++++++++XXXXoooo      ",
+"                OOO  O- OOXXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"                OOOOO-O  .XXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"                OOOO-OO     ooooooooooooooooooooooooo...oo      ",
+"                OOOOOO O     ..........................ooo      ",
+"                OO    OO    oooooooooooooooooooooooooooooo      ",
+"              OOOO OOOOO  oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"            OOOOO OOOOO   oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"        OOOOOOOOOOOOOOO oooooooooooooooooooooooooooXXXooo     . ",
+"     OOOOOO    OOOOO OOOOXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"    OOO        OOOOO OOOOOOXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"    OO         OOOOOO OOOOOOO@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"    O OO       OOOOOOO OOOOOXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"     OOOO       OOOOOOO OOO@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                  OOOXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-dec.xpm b/pixmaps/m-dec.xpm
new file mode 100644 (file)
index 0000000..40dd35d
--- /dev/null
@@ -0,0 +1,57 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 9 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"-     c #a00000",
+"O     c white",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"                        .XX+++++++++++++++++++++++XXXXoo        ",
+"                        .XX++++++++++++++++++++++++XXXooo       ",
+"-----------------------------------@+@@@@++@+++++++XXXooo       ",
+"----OO-OO--------OO---O---------OO-++++++++++++++++XXXoooo      ",
+"----OO-OO--------OO--OO---------OO-@+@@@+++++++++++XXXoooo      ",
+"----OO---------------OO---------OO-++++++++++++++++XXXooooo     ",
+"-OOOOO-OO--OOO-O-OO-OOOO-XOOO-O-OO-@@@@+@@@@@++++++XXXooooo     ",
+"OOOOOO-OO-OOOOOO-OO-OOOO-OOOOOO-OO-++++++++++++++++XXXooooo     ",
+"OO--OO-OO-OO--OO-OO--OO--OO--OO-OO-@@+@@++@@@++++++XXXooooo     ",
+"OO--OO-OO-OO--OO-OO--OO--OO--OO-OO-++++++++++++++++XXXooooo     ",
+"OO--OO-OO-OO--OO-OO--OO--OO--OO-OO-++++++++++++++++XXXooooo     ",
+"OO--OO-OO-OOOOOO-OO--OOO-OOOOOO-OO-++++++++++++++++XXXooooo     ",
+"-OOOOO-OO--OOOOO-OO---OO-XOOOOO-OO-+@@@+@++++++++++XXXooooo     ",
+"--------------OO-------------------++++++++++++++++XXXooooo     ",
+"----------OOOOOO-------------------++++++++++++++++XXXooooo     ",
+"-----------OOOO--------------------+++++++++++++++XXXXoooo      ",
+"-----------------------------------XXXXXXXXXXXXXXXXXXXooo       ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"                            ooooooooooooooooooooooooo...oo      ",
+"                             ..........................ooo      ",
+"                            oooooooooooooooooooooooooooooo      ",
+"                          oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"                          oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"                        oooooooooooooooooooooooooooXXXooo     . ",
+"                       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-hp.xpm b/pixmaps/m-hp.xpm
new file mode 100644 (file)
index 0000000..113a477
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c red",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"           OOOOO O OOOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"           OOOOO O  OOOOOOX+++++++++++++++++++++++XXXXoo        ",
+"          OOOOOO O   OOOOOO++++++++++++++++++++++++XXXooo       ",
+"          OOOOO  O    OOOOO++@@+@++@+@@@@++@+++++++XXXooo       ",
+"          OOOO  OO     OOOO++++++++++++++++++++++++XXXoooo      ",
+"          OOOO  O      OOOO++@@@@+@@+@@@+++++++++++XXXoooo      ",
+"          OOOO  O      OOOO++++++++++++++++++++++++XXXooooo     ",
+"          OOOO  OO  OO OOOO++@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"          OOO  OOO OOO  OOO++++++++++++++++++++++++XXXooooo     ",
+"          OOO  OOO O O  OOO++@@@+@@@@+@@++@@@++++++XXXooooo     ",
+"          OOO  O O O O  OOO++++++++++++++++++++++++XXXooooo     ",
+"          OOO  O O O O  OOO++@+++++++++++++++++++++XXXooooo     ",
+"          OOO  O O O O  OOO++++++++++++++++++++++++XXXooooo     ",
+"          OOOO O O OOO OOOO++@@@@+@+@@@+@++++++++++XXXooooo     ",
+"          OOOO     OO  OOOO++++++++++++++++++++++++XXXooooo     ",
+"          OOOO     O   OOOO++@+@@@@++++++++++++++++XXXooooo     ",
+"          OOOO     O   OOOOX++++++++++++++++++++++XXXXoooo      ",
+"          OOOOO   OO  OOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"          OOOOOO  O  OOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"           OOOOOO O OOOOOO  ooooooooooooooooooooooooo...oo      ",
+"           OOOOOO O OOOOOO   ..........................ooo      ",
+"                            oooooooooooooooooooooooooooooo      ",
+"                          oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"                          oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"                        oooooooooooooooooooooooooooXXXooo     . ",
+"                       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-ibm.xpm b/pixmaps/m-ibm.xpm
new file mode 100644 (file)
index 0000000..8b8ace1
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca   1992                **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c blue",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"                        .XX+++++++++++++++++++++++XXXXoo        ",
+"                        .XX++++++++++++++++++++++++XXXooo       ",
+"                        .XX++@@+@++@+@@@@++@+++++++XXXooo       ",
+" OOOOOOO  OOOOOOOO   OOOOXX+++OOOO+++++++++++++++++XXXoooo      ",
+"                         XX++@    @@+@@@+++++++++++XXXoooo      ",
+" OOOOOOO  OOOOOOOO   OOOOXX+++OOOO+++++++++++++++++XXXooooo     ",
+"                         XX++@    @@@@@+@@@@@++++++XXXooooo     ",
+"   OOO     OO    OO   OOOXX+++OOO++++++++++++++++++XXXooooo     ",
+"                          X++    @@@@+@@++@@@++++++XXXooooo     ",
+"   OOO     OOOOOOO    OOOOX++OOOO++++++++++++++++++XXXooooo     ",
+"                           +     ++++++++++++++++++XXXooooo     ",
+"   OOO     OOOOOOO    OO.OO+OO+OO++++++++++++++++++XXXooooo     ",
+"                              @  +@+@@@+@++++++++++XXXooooo     ",
+"   OOO     OO    OO   OO.XOOO++OO++++++++++++++++++XXXooooo     ",
+"                        .X   @+   @++++++++++++++++XXXooooo     ",
+" OOOOOOO  OOOOOOOO   OOO.XXO+++OOO++++++++++++++++XXXXoooo      ",
+"                        .XX XXX   XXXXXXXXXXXXXXXXXXXXooo       ",
+" OOOOOOO  OOOOOOOO   OOO .XXXXXOOOXXXXXXXXXXXXXXXXXXXooo        ",
+"                            ooooooooooooooooooooooooo...oo      ",
+"                             ..........................ooo      ",
+"                            oooooooooooooooooooooooooooooo      ",
+"                          oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"                          oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"                        oooooooooooooooooooooooooooXXXooo     . ",
+"                       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-linux.xpm b/pixmaps/m-linux.xpm
new file mode 100644 (file)
index 0000000..8d4a15c
--- /dev/null
@@ -0,0 +1,181 @@
+/* XPM */
+/* Linux Penguin from logo.gif and logo.txt /usr/src/linux/Documentation
+This is the full-colour version of the currenly unofficial Linux logo
+("currently unofficial" just means that there has been no paperwork and
+that I haven't really announced it yet).  It was created by Larry Ewing,
+and is freely usable as long as you acknowledge Larry as the original
+artist.
+
+Note that there are black-and-white versions of this available that
+scale down to smaller sizes and are better for letterheads or whatever
+you want to use it for: for the full range of logos take a look at
+Larry's web-page:
+
+        http://www.isc.tamu.edu/~lewing/linux/
+ */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char *image_name[] = {
+/* width height num_colors chars_per_pixel */
+"    64    38      117            2",
+/* colors */
+".. c #000000",
+"#X c #f0f0f0",
+".# c #b3b3b3",
+".a c #d9d9d9",
+".b c #7f7f7f",
+".c c #556b2f",
+".d c #ffffff",
+".e c #000000",
+".f c #f8f8f8",
+".g c #f0c814",
+".h c #503800",
+".i c #eccc38",
+".j c #d09010",
+".k c #805800",
+".l c #f8c838",
+".m c #f0cc20",
+".n c #a87c1c",
+".o c #e4cc20",
+".p c #a4803c",
+".q c #e8b010",
+".r c #606060",
+".s c #c08010",
+".t c #a8a8a8",
+".u c #685030",
+".v c #a0a0a0",
+".w c #583800",
+".x c #585858",
+".y c #707070",
+".z c #e0c808",
+".A c #888888",
+".B c #484848",
+".C c #a07008",
+".D c #f8cc14",
+".E c #e8a810",
+".F c #986800",
+".G c #606068",
+".H c #704800",
+".I c #b0b0b0",
+".J c #f4d028",
+".K c #707078",
+".L c #404040",
+".M c #704808",
+".N c #906000",
+".O c #e8b808",
+".P c #c08008",
+".Q c #e0b008",
+".R c #986808",
+".S c #383838",
+".T c #e8a800",
+".U c #e8a808",
+".V c #505050",
+".W c #989898",
+".X c #303030",
+".Y c #808080",
+".Z c #a8a8b0",
+".0 c #c88c10",
+".1 c #d09810",
+".2 c #282828",
+".3 c #906008",
+".4 c #885808",
+".5 c #a87000",
+".6 c #181818",
+".7 c #c08800",
+".8 c #e0d08c",
+".9 c #e8e8e8",
+"#. c #a06808",
+"## c #d8d8d8",
+"#a c #a87008",
+"#b c #a06008",
+"#c c #f0d008",
+"#d c #d89810",
+"#e c #b08004",
+"#f c #c89008",
+"#g c #e0e0e0",
+"#h c #101010",
+"#i c #d89010",
+"#j c #402800",
+"#k c #a0a0ac",
+"#l c #d09800",
+"#m c #b88008",
+"#n c #986008",
+"#o c #d09808",
+"#p c #202020",
+"#q c #080004",
+"#r c #b07004",
+"#s c #c08808",
+"#t c #d0d0d0",
+"#u c #f0f0e8",
+"#v c #b07808",
+"#w c #080808",
+"#x c #c4a474",
+"#y c #d8a000",
+"#z c #d8a008",
+"#A c #c0c0c0",
+"#B c #f8cc08",
+"#C c #d09008",
+"#D c #bc8c3c",
+"#E c #c88808",
+"#F c #e0a008",
+"#G c #e8b008",
+"#H c #e0a808",
+"#I c #d89808",
+"#J c #f0b010",
+"#K c #2c2404",
+"#L c #b8b8b8",
+"#M c #f0b808",
+"#N c #f0c008",
+"#O c #b87808",
+"#P c #e8c008",
+"#Q c #c8c8c8",
+"#R c #947404",
+"#S c #f8a808",
+"#T c #f0b810",
+"#U c #f8b810",
+"#V c #c0c0e0",
+"#W c #f8c008",
+"#Y c #404040",
+/* pixels */
+"............................#Y#Y#Y#Y#Y#Y#Y#Y....................................................................................",
+"..........................#Y..............#Y....................................................................................",
+"........................#Y.............6.G#w..#Y.....#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#......................",
+"......................#Y..............#p.X#h..#Y...#.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.#....................",
+"......................#Y........................#Y.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.b.b................",
+"......................#Y..#h#p....#w.....y......#Y.a.a.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.a.b.b................",
+"......................#Y..#k.I.6...A.t#Q.v#h....#Y.a.a.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b..............",
+"......................#Y..#h.2.y#h#u.f.W.f......#Y.a.a.c.c.d.d.c.d.c.c.d.c.d.d.d.d.c.c.d.c.c.c.c.c.c.c.a.a.a.b.b.b..............",
+"......................#Y...6.W.x..#Q....#A......#Y.a.a.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b............",
+"......................#Y...f#v#W.z.o.D.u.f......#Y.a.a.c.c.d.d.d.d.c.d.d.c.d.d.d.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b............",
+"......................#Y...n#M#N.z.i.o.z.o......#Y.a.a.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"......................#Y..#f#W#B.8.z.o#o#z........#Y.a.c.c.d.d.d.d.d.d.d.d.d.d.c.d.d.d.d.d.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"......................#Y..#Q.h#R.w#I#I.0.Z.....Y#q#Y.a.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"......................#Y..#L#n#z#I.s.s#Q#t#Q...Y..#Y.a.c.c.d.d.d.c.d.d.d.d.c.d.d.c.c.d.d.d.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"......................#Y..#X#A#k#Q#A#V#X.f.f........#Y.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"....................#Y.....f.f#L#A.f.f.f.f.f.A........#Y.c.d.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"..................#Y.....f.f.f.f.f.f.f.f.f.f.f..........#Y.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"..................#Y...K.f.f.f.f.f.f.f.f.f.f.f............#Y.d.d.d.c.d.c.d.d.d.c.d.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"..............#Y.......v#t.f.f#g.f.f.f#X#Q#A#A.f..........#Y.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"..............#Y......#X.f.f.f.f.f.f.f.f.f.f#X#A.....B......#Y.d.d.d.d.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.b.b.b.b.b..........",
+"..............#Y.....f.f.f.f.f.f.f.f.f.f.f.f.f.f.f#h.S.2....#Y.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.a.a.a.a.b.b.b.b............",
+"............#Y.......f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.6.6........#Y.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.b.b.b..............",
+"............#Y#q..#X.f.f.f.f#X.f.f.f.f.f.f.f.f.f.f............#Y.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.b.b.b................",
+"..........#Y...S...f.f.f.f.f#g.f.f.f.f.f.f.f.f.f.f............#Y.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.#.#.#.b.b............",
+"..........#Y...Y#A.f.f.f.f.f##.f.f.f.f.f.f.f.f.f.f............#Y.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.b.b.b............",
+"........#Y.....V#A.f.f.f.f.f##.f.f.f.f.f.f.f.f.f.f....#h......#Y.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b............",
+"........#Y....#h#Q.f.f.f.f.f##.f.f.f.f.f.f.f.f.f.f.....S......#Y.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.b.b.b.b.#.#...#.#..",
+"..........#Y#W#W.t.f.f.f.f.f##.f.f.f.f.f.f.f.f.f.f#p..........#Y.a.a.a.a.a.a.a.a.a.a.a.a.a.e.e.e.e.e.e.e.a.a.b.b.b.b.....#.....#",
+"........#Y#d.D#W.q...f.f.f.f#g.f.f.f.f.f.f.f.f#d.z.p.......6.o.D#Y.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.a.a.a.b.b.b...........#..",
+"......#Y#E.q.g#U#W#W..#t.f.f.f.f.f.f.f.f.f.f.f#D#N#a......#R#N#S#Y.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.b.b.b.b.b.............#....",
+"#Y#b#J.q.q#W#W#U#W#W#w...S.f.f.f.f.f.f.f.f.f#t#x.O#C.P#v#e.Q#U.g#Y.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.b.b.............b.b.b.b.b.b..",
+"#Y#H#W#F.g.J.g.g#W.m#c.....L.f.f.f.f.f.f.f.f.9.p.U.T#H#z#H.m.m#F.m#Y.d.d.d.d.d.d.d.d.d.d.a.a.a.a.a.b.b.......b.b.b.b.b.#.#.#.b..",
+"#Y.1#W.g#F.g#F.m#F#W#W.E...r.f.f.f.f.f.f.f.f.f.3#y#M#U#M#N#W#F#W.g.D.a.a.a.a.a.a.a.a.a.a.a.a.a.a.b.b.......b.b.a.a.a.b.b.#.#.b..",
+"#Y.0#U#U.g.D.m#W.g.g#F#P#b.f.f.f.f.f.f.f.f.f...4#H#W.g.g#W.D#U#U#F.D.d.d.d.d.d.d.d.d.d.a.a.a.a.b.b.........b.a.a.a.a.a.#.#.b....",
+"#Y#i#W#F.l#W.g.g#W.g.g.O#o.f.f.f.f.f.f.f.......F#H.g.g#U#F#W#W.J#U#d.a.a.a.a.a.a.a.a.a.a.a.a.b.b...........b.#.#.#.#.#.b.b......",
+"#d#I#H#G#T#U#W.g.m#U#F#W.1#j...................5#H.g#U#U.g#F#U#d#Y.b.b.b.b.b.b.b.b.b.b.b.b.b.b.............b.b.b.b.b.b.b........",
+"#Y.3.n#s#f#C#z#H.g.g#U.U#O.M...................N#l#G#T#G#H.j#Y..................................................................",
+"........#Y.M.R#.#m#s#s#v.k#K#Y#Y#Y#Y#Y#Y#Y#Y#Y.H#r#s#f.7.C#Y...................................................................."
+};
diff --git a/pixmaps/m-linux1.xpm b/pixmaps/m-linux1.xpm
new file mode 100644 (file)
index 0000000..c1c4c4c
--- /dev/null
@@ -0,0 +1,58 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 10 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c gray40",
+"H     c red",
+"I     c blue",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"OOOOOOOOOOOOOOOOOOOOOOOOOOOOO........................           ",
+"OO                         OOXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+" O  O       O       O      OXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+" OOOOOOOO  O   O   O   O  OO++++++++++++++++++++++XXXXoo        ",
+"  OHHHHHO   O   O   O   O O++++++++++++++++++++++++XXXooo       ",
+"  OOOHHOOO O O O O O O O OO++@@+@++@+@@@@++@+++++++XXXooo       ",
+"   OOHHOOOOOOOOOOOOOOOOOOOOO+++++++++++++++++++++++XXXoooo      ",
+"   OOHHOHHHOHOOHOHOOHOHOOOHO+@@@@+@@+@@@+++++++++++XXXoooo      ",
+"    OHHOOHOOHHOHOHOOHOHHOHHO+++++++++++++++++++++++XXXooooo     ",
+"    OHHOOHOOHHOHOHOOHOOHHHOO+@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"    OHHOOHOOHHHHOHOOHOOHHHO++++++++++++++++++++++++XXXooooo     ",
+"    OHHOOHOOHOHHOHOOHOOHHHOO+@@@+@@@@+@@++@@@++++++XXXooooo     ",
+"    OHHOOHOOHOHHOHHHHOHHOHHO+++++++++++++++++++++++XXXooooo     ",
+"    OHHOHHHOHOOHOHHHHOHOOOHO+@+++++++++++++++++++++XXXooooo     ",
+"IIIIIHHIIIIIIIIIIIIIIIIIIIIII++++++++++++++++++++++XXXooooo     ",
+"IIIIIHHIIIIIHIIIIIIIIIIIIIIII@@@@+@+@@@+@++++++++++XXXooooo     ",
+"   OOHHOOOOOHOOOOOOOOO  .XX++++++++++++++++++++++++XXXooooo     ",
+"   OHHHHHHHHHOOOOOOOO   .XX++@+@@@@++++++++++++++++XXXooooo     ",
+"   OOOOOOOOOOOOOOOOO    .XXX++++++++++++++++++++++XXXXoooo      ",
+"         OOOOOOOOOOO    .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"          OOOOOOOOO      .XXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"          OOOOOOOOO         ooooooooooooooooooooooooo...oo      ",
+"           OOOOOOO           ..........................ooo      ",
+"           OOOOOOO          oooooooooooooooooooooooooooooo      ",
+"            OOOOO         oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"            OOOOO         oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"             OOO        oooooooooooooooooooooooooooXXXooo     . ",
+"             OOO       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"              O       oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"              O       oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-sco.xpm b/pixmaps/m-sco.xpm
new file mode 100644 (file)
index 0000000..c04093b
--- /dev/null
@@ -0,0 +1,58 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 10 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c red",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"Y     c #E0C000",
+"B     c #0000A0",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"                        .XX+++++++++++++++++++++++XXXXoo        ",
+"YYYYYYYYYYYYYYYYYYYYYBYYYXX++++++++++++++++++++++++XXXooo       ",
+"YYYYYYYYYYYYYYYYYBBBBBBBBBB++@@+@++@+@@@@++@+++++++XXXooo       ",
+"YYYYYYYYYYYYYYYYYYYBYYYYYYX++++++++++++++++++++++++XXXoooo      ",
+"YYYYYYYYYYYYYYBBBBBBBBBBBBB++@@@@+@@+@@@+++++++++++XXXoooo      ",
+"YYYYYYYYYYYYYYYYYYYBYYYYYYYYY++++++++++++++++++++++XXXooooo     ",
+"YYYYYYYYYYYBBBBBBBBBBBBBBBBBB@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"YYYYYYYYBBBBBBBBBBBBBBBBBBBBB++++++++++++++++++++++XXXooooo     ",
+"YYYYYYYYYYYYYYYYYYYYBBYYBBYYY@@@+@@@@+@@++@@@++++++XXXooooo     ",
+"YYYYYYYYYYYYBBBBBBBBBBBBBBBBB++++++++++++++++++++++XXXooooo     ",
+"YYYYYYYYYYYYYYYYYYYYBBYBYYYYY@+++++++++++++++++++++XXXooooo     ",
+"YYYYYYYYYYYYYYYYYYYYYBBYYYYYY++++++++++++++++++++++XXXooooo     ",
+"BBBBBBBBBBBBBBBBBBBBBBBBBBBBB@@@@+@+@@@+@++++++++++XXXooooo     ",
+"BBBBBBBBBBBBBBBBBBBBBBBBBBBBB++++++++++++++++++++++XXXooooo     ",
+"                        .XX++@+@@@@++++++++++++++++XXXooooo     ",
+"                        .XXX++++++++++++++++++++++XXXXoooo      ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"                            ooooooooooooooooooooooooo...oo      ",
+"                             ..........................ooo      ",
+"                            oooooooooooooooooooooooooooooo      ",
+"                          oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"                          oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"                        oooooooooooooooooooooooooooXXXooo     . ",
+"                       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-sgi.xpm b/pixmaps/m-sgi.xpm
new file mode 100644 (file)
index 0000000..c37ca75
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c #71717171C6C6",
+"o     c gray85",
+"O     c gray50",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                  XX XX  .ooooooooooooooooooooooooooo.          ",
+"                 XXX XXX.oooooooooooooooooooooooooooooOO        ",
+"                XX X X XXoo+++++++++++++++++++++++ooooOO        ",
+"               XX  X X  XXo++++++++++++++++++++++++oooOOO       ",
+"               XX  X X  XXo++@@+@++@+@@@@++@+++++++oooOOO       ",
+"             XX XX X X XXoXX+++++++++++++++++++++++oooOOOO      ",
+"            XXXX XXX XXX.XXXX@@@@+@@+@@@+++++++++++oooOOOO      ",
+"            XX XX XXXXX XXoXX++++++++++++++++++++++oooOOOOO     ",
+"            XX  XXXXXXXXXooXX@@@@@@@@@@+@@@@@++++++oooOOOOO     ",
+"            XX  XXXXXXXXXooXX++++++++++++++++++++++oooOOOOO     ",
+"            XX XX XXXXX XXoXX@@@+@@@@+@@++@@@++++++oooOOOOO     ",
+"            XXXX XXX XXX.XXXX++++++++++++++++++++++oooOOOOO     ",
+"             XX XX X X XXoXX+@+++++++++++++++++++++oooOOOOO     ",
+"               XX  X X  XXo++++++++++++++++++++++++oooOOOOO     ",
+"               XX  X X  XXo++@@@@+@+@@@+@++++++++++oooOOOOO     ",
+"                XX X X XXoo++++++++++++++++++++++++oooOOOOO     ",
+"                 XXX XXX.oo++@+@@@@++++++++++++++++oooOOOOO     ",
+"                  XX XX .ooo++++++++++++++++++++++ooooOOOO      ",
+"                        .oooooooooooooooooooooooooooooOOO       ",
+"                         .oooooooooooooooooooooooooooOOO        ",
+"                            OOOOOOOOOOOOOOOOOOOOOOOOO...OO      ",
+"                             ..........................OOO      ",
+"                            OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO      ",
+"                          OoooooooooooooooooooooooooooOOOO.. .. ",
+"                          Ooooooooooooooooooo#######ooOOOO  .  .",
+"                        OOOOOOOOOOOOOOOOOOOOOOOOOOOoooOOO     . ",
+"                       OooooooooooooooooooooooooooOOOOO      .  ",
+"                      OooooooooooooooooooooooooooOO      OOOOOO ",
+"                      Ooo@@@@@@@@@@@@@@@@@@@oooooOO   OOOOO...O ",
+"                     OooooooooooooooooooooooooooOO   OOoooOO..O ",
+"                    Ooo@@@@@@@@@@@@@@@@@@@@ooooOO    Oooooo..O  ",
+"                   OooooooooooooooooooooooooooOO     O.....OO   ",
+"                   OOOOOOOOOOOOOOOOOOOOOOOOOOOO      OOOOOOO    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-sol.xpm b/pixmaps/m-sol.xpm
new file mode 100644 (file)
index 0000000..605cdfc
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c white",
+"o     c red",
+"O     c black",
+"+     c gray85",
+"@     c gray50",
+"#     c darkolivegreen",
+"                                                                ",
+"                      .                                         ",
+"          XXXXoOO.OOO..   ...........................           ",
+"        oXXXXXoOO.OOO.O  .+++++++++++++++++++++++++++.          ",
+"       XXoXXXXXOO.OOO.OOO+++++++++++++++++++++++++++++@@        ",
+"      XXXXXXXXXO...O...O.O+#######################++++@@        ",
+"     XXXXXXXXXX.......O..O+#.######################+++@@@       ",
+"    XXXXXXXXXXX.........O.O.#XX#X##X#XXXX##X#######+++@@@       ",
+"   XoXXXXXXXXXXooooooooo...O#######################+++@@@@      ",
+"   XXoXXXXXXX..XXooooooo..OO#XXXX#XX#XXX###########+++@@@@      ",
+"  XXXXXXXX.....XXXXXoooo...OO######################+++@@@@@     ",
+"  XXXXXXX......XXXXXXooo.....XXXXXXXXXX#XXXXX######+++@@@@@     ",
+"  XXXXXX.......XXXXXXXoo...OO######################+++@@@@@     ",
+"  XXXXXX.......XXXXXXXoo..OOO..X#XXXX#XX##XXX######+++@@@@@     ",
+"  ooXXXX.......XXXXXXXoo.....######################+++@@@@@     ",
+" XXXXXXX.......XXXXXXXoo.....X#####################+++@@@@@     ",
+"  XXXXXX.......XXXXXXXoo...OO######################+++@@@@@     ",
+"  XXXXXX.......XXXXXXXoo..OOOXXXX#X#XXX#X##########+++@@@@@     ",
+"  XXXXXX.......XXXXXXXoo....O######################+++@@@@@     ",
+"  XXXXXXX......XXXXXXooo.....X#XXXX################+++@@@@@     ",
+"  XXOXXXXX.....XXXXXoooo....O#####################++++@@@@      ",
+"   OXXXXXXXXX..XXooooooo.O.O++++++++++++++++++++++++++@@@       ",
+"   XXXXXXXXXXXXooooooooo..OO+++++++++++++++++++++++++@@@        ",
+"    XXXXXXXXXXX...........O @@@@@@@@@@@@@@@@@@@@@@@@@...@@      ",
+"     XXXOXXXXXX........................................@@@      ",
+"      XOXXXXXXX....O...O.O  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@      ",
+"       XXXXXXXX...OOO..OO @+++++++++++++++++++++++++++@@@@.. .. ",
+"        XXXOXXXO.OOOO..   @++++++++++++++++++OOOOOOO++@@@@  .  .",
+"          XOXXXO.OOO  . @@@@@@@@@@@@@@@@@@@@@@@@@@@+++@@@     . ",
+"                       .++++++++++++++++++++++++++@@@@@      .  ",
+"                      @++++++++++++++++++++++++++@@      @@@@@@ ",
+"                      @++XXXXXXXXXXXXXXXXXXX+++++@@   @@@@@...@ ",
+"                     @++++++++++++++++++++++++++@@   @@+++@@..@ ",
+"                    @++XXXXXXXXXXXXXXXXXXXX++++@@    @+++++..@  ",
+"                   @++++++++++++++++++++++++++@@     @.....@@   ",
+"                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-solaris.xpm b/pixmaps/m-solaris.xpm
new file mode 100644 (file)
index 0000000..16a3265
--- /dev/null
@@ -0,0 +1,71 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 23 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c white",
+"O     c black",
+"+     c gray85",
+"@     c gray50",
+"#     c darkolivegreen",
+"o c #574c8f",
+"0 c #5c519a",
+"a c #6559a6",
+"b c #4e4582",
+"c c #7368af",
+"d c #453c72",
+"e c #8278b8",
+"f c #37305a",
+"g c #9f574c",
+"h c #aa5c51",
+"i c #b66559",
+"j c #924e45",
+"k c #bf7368",
+"l c #82453c",
+"m c #c88278",
+"n c #6a3730",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"             g           .+++++++++++++++++++++++++++.          ",
+"             ij     g   .+++++++++++++++++++++++++++++@@        ",
+"             kj     kn  .++#######################++++@@        ",
+"       g     kg    ggj  .++#.######################+++@@@       ",
+"       kg    mgj   mjn  .++##XX#X##X#XXXX##X#######+++@@@       ",
+"        g    mgl  mmj   .++########################+++@@@@      ",
+"        ih   mhn imgj   .++##XXXX#XX#XXX###########+++@@@@      ",
+"         hh  mhn mkln   .k+########################+++@@@@@     ",
+"         kh  mhl mhn   kmhn##XXXXXXXXXX#XXXXX######+++@@@@@     ",
+"         ghhnhnnnlhn kmmnn+########################+++@@@@@     ",
+"    mmi   klnj    llmminn++##XXX#XXXX#XX##XXX######+++@@@@@     ",
+"     ljhgkgj        hlnj.++########################+++@@@@@     ",
+"       lhhn         lnl .++##X#####################+++@@@@@     ",
+"        lhn          l  .++########################+++@@@@@     ",
+"         jn   oaacceeeeeeeeeccaoX#X#XXX#X##########+++@@@@@     ",
+"        aeeeeeecca0bffffffffffddb##################+++@@@@@     ",
+"    aeeeeao000dfffff    .++##X#XXXX################+++@@@@@     ",
+"  aeeco00000ffd         .+++######################++++@@@@      ",
+" cec000000bff           .+++++++++++++++++++++++++++++@@@       ",
+" aa0000000bf             .+++++++++++++++++++++++++++@@@        ",
+"  dd0000000oo               @@@@@@@@@@@@@@@@@@@@@@@@@...@@      ",
+"    fffb0000oeeao            ..........................@@@      ",
+"       dffffffddoccccaa     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@      ",
+"                          @+++++++++++++++++++++++++++@@@@.. .. ",
+"                          @++++++++++++++++++OOOOOOO++@@@@  .  .",
+"                        @@@@@@@@@@@@@@@@@@@@@@@@@@@+++@@@     . ",
+"                       .++++++++++++++++++++++++++@@@@@      .  ",
+"                      @++++++++++++++++++++++++++@@      @@@@@@ ",
+"                      @++XXXXXXXXXXXXXXXXXXX+++++@@   @@@@@...@ ",
+"                     @++++++++++++++++++++++++++@@   @@+++@@..@ ",
+"                    @++XXXXXXXXXXXXXXXXXXXX++++@@    @+++++..@  ",
+"                   @++++++++++++++++++++++++++@@     @.....@@   ",
+"                   @@@@@@@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-sun.xpm b/pixmaps/m-sun.xpm
new file mode 100644 (file)
index 0000000..6f36d58
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c #4000bf",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"               OOO                                              ",
+"              OOOOO       ...........................           ",
+"              OO OOO     .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"            O OOO OOO   .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+"           OOO OOO OOO  .XX+++++++++++++++++++++++XXXXoo        ",
+"          O OOO OOO OOO .XX++++++++++++++++++++++++XXXooo       ",
+"         OOO OOO OOO OOO.XX++@@+@++@+@@@@++@+++++++XXXooo       ",
+"        O OOO OOO OOO O OXX++++++++++++++++++++++++XXXoooo      ",
+"       OOO OOO OOO OOO OOOX++@@@@+@@+@@@+++++++++++XXXoooo      ",
+"      OOO O OOO OOO O OOOXO++++++++++++++++++++++++XXXooooo     ",
+"     OOO OOO OOO OO  OOO.OOO+@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"    OOO OOO   OOOOO OOO OOO++++++++++++++++++++++++XXXooooo     ",
+"   OOO OOO OOO OOO OOO OOOXOOO@@+@@@@+@@++@@@++++++XXXooooo     ",
+"  OOO OOO OOOOO   OOO OOOXOOOOO++++++++++++++++++++XXXooooo     ",
+"  OO OOO OOO OO   OO OOO.OOO+OO++++++++++++++++++++XXXooooo     ",
+"  OOOOO OOO OOO   OOOOO OOO+OOO++++++++++++++++++++XXXooooo     ",
+"   OOO OOO OOO OOO OOO OOOXOOO@@@+@+@@@+@++++++++++XXXooooo     ",
+"      OOO OOO OOOOO   OOOXOOO++++++++++++++++++++++XXXooooo     ",
+"     OOO OOO  OO OOO OOO.OOO+@+@@@@++++++++++++++++XXXooooo     ",
+"      O OOO O OOO OOO O OOOX++++++++++++++++++++++XXXXoooo      ",
+"       OOO OOO OOO OOO OOOXXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"        O O OOO OOO OOO O.XXXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"         OOO OOO OOO OOO    ooooooooooooooooooooooooo...oo      ",
+"          OOO OOO OOO O      ..........................ooo      ",
+"           OOO OOO OOO      oooooooooooooooooooooooooooooo      ",
+"            OOO OOO O     oXXXXXXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+"             OOO OO       oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"              OOOOO     oooooooooooooooooooooooooooXXXooo     . ",
+"               OOO     oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-x11.xpm b/pixmaps/m-x11.xpm
new file mode 100644 (file)
index 0000000..fd9bf9a
--- /dev/null
@@ -0,0 +1,56 @@
+/* XPM */
+/*****************************************************************************/
+/**       This pixmap is kindly offered by Ion Cionca - 1992 -              **/
+/**       Swiss Federal Institute of Technology                             **/
+/**       Central Computing Service                                         **/
+/*****************************************************************************/
+static char * image_name [] = {
+/**/
+"64 38 8 1",
+/**/
+"      s mask  c black",
+".     c gray70",
+"X     c gray85",
+"o     c gray50",
+"O     c red",
+"+     c darkolivegreen",
+"@     c white",
+"#     c black",
+"                                                                ",
+"                                                                ",
+"                          ...........................           ",
+"                         .XXXXXXXXXXXXXXXXXXXXXXXXXXX.          ",
+"                        .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXoo        ",
+" OOOOOOOOOO             .XXOOO++++++++++++++++++++XXXXoo        ",
+"  OOOOOOOOOO            .XOOO++++++++++++++++++++++XXXooo       ",
+"   OOOOOOOOOO           .OOO+@@+@++@+@@@@++@+++++++XXXooo       ",
+"    OOOOOOOOOO          OOO++++++++++++++++++++++++XXXoooo      ",
+"     OOOOOOOOOO        OOOX++@@@@+@@+@@@+++++++++++XXXoooo      ",
+"      OOOOOOOOOO      OOOXX++++++++++++++++++++++++XXXooooo     ",
+"       OOOOOOOOOO    OOO.XX++@@@@@@@@@@+@@@@@++++++XXXooooo     ",
+"        OOOOOOOOOO  OOO .XX++++++++++++++++++++++++XXXooooo     ",
+"         OOOOOOOOO OOO  .XX++@@@+@@@@+@@++@@@++++++XXXooooo     ",
+"          OOOOOOO OOO   .XX++++++++++++++++++++++++XXXooooo     ",
+"           OOOOO OOOO   .XX++@+++++++++++++++++++++XXXooooo     ",
+"            OOO OOOOOO  .XX++++++++++++++++++++++++XXXooooo     ",
+"           OOO OOOOOOOO .XX++@@@@+@+@@@+@++++++++++XXXooooo     ",
+"          OOO OOOOOOOOOO.XX++++++++++++++++++++++++XXXooooo     ",
+"         OOO   OOOOOOOOOOXX++@+@@@@++++++++++++++++XXXooooo     ",
+"        OOO     OOOOOOOOOOXX++++++++++++++++++++++XXXXoooo      ",
+"       OOO       OOOOOOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXooo       ",
+"      OOO         OOOOOOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXooo        ",
+"     OOO           OOOOOOOOOOoooooooooooooooooooooooo...oo      ",
+"    OOO             OOOOOOOOOO.........................ooo      ",
+"   OOO               OOOOOOOOOOooooooooooooooooooooooooooo      ",
+"  OOO                 OOOOOOOOOOXXXXXXXXXXXXXXXXXXXXXXoooo.. .. ",
+" OOO                      oXXXXXXXXXXXXXXXXXX#######XXoooo  .  .",
+"                        oooooooooooooooooooooooooooXXXooo     . ",
+"                       oXXXXXXXXXXXXXXXXXXXXXXXXXXooooo      .  ",
+"                      oXXXXXXXXXXXXXXXXXXXXXXXXXXoo      oooooo ",
+"                      oXX@@@@@@@@@@@@@@@@@@@XXXXXoo   ooooo...o ",
+"                     oXXXXXXXXXXXXXXXXXXXXXXXXXXoo   ooXXXoo..o ",
+"                    oXX@@@@@@@@@@@@@@@@@@@@XXXXoo    oXXXXX..o  ",
+"                   oXXXXXXXXXXXXXXXXXXXXXXXXXXoo     o.....oo   ",
+"                   oooooooooooooooooooooooooooo      ooooooo    ",
+"                                                                ",
+"                                                                "};
diff --git a/pixmaps/m-xlock.xpm b/pixmaps/m-xlock.xpm
new file mode 100644 (file)
index 0000000..206a1e8
--- /dev/null
@@ -0,0 +1,33 @@
+/* XPM */
+static char * image_name[] = {
+/* width height ncolors cpp */
+"50 24 3 1",
+/* colors */
+"      c Black",
+".     c Red",
+"X     c SteelBlue",
+/* pixels */
+"                                                  ",
+" ..........                ...                    ",
+"  ..........              ...                     ",
+"   ..........            ...                      ",
+"    ..........          ...            XXXXX      ",
+"     ..........        ...           XXXXXXXXX    ",
+"      ..........      ...            XXXXXXXXX    ",
+"       ..........    ...            XXXX   XXXX   ",
+"        ..........  ...             XXX     XXX   ",
+"         ......... ...              XXX     XXX   ",
+"          ....... ...               XXX     XXX   ",
+"           ..... ....                             ",
+"            ... ......            XXXXXXXXXXXXXXX ",
+"           ... ........           XXXXXXXXXXXXXXX ",
+"          ... ..........          XXXXX XXX XXXXX ",
+"         ...   ..........         XX XX     XX XX ",
+"        ...     ..........        XX XX XXX XX XX ",
+"       ...       ..........       XX XX     XX XX ",
+"      ...         ..........      XX XX XXX XX XX ",
+"     ...           ..........     XX XX     XX XX ",
+"    ...             ..........    XX XX XXX XX XX ",
+"   ...               ..........   XXXXXXXXXXXXXXX ",
+"  ...                 ..........  XXXXXXXXXXXXXXX ",
+"                                                  "};
diff --git a/pixmaps/s-grelb-2.xpm b/pixmaps/s-grelb-2.xpm
new file mode 100644 (file)
index 0000000..e8a5af3
--- /dev/null
@@ -0,0 +1,44 @@
+/* XPM */
+static char* image2_name[] = {
+/* width height num_colors chars_per_pixel */
+"30 33 4 1",
+/* colors */
+"- c #000000",
+". c #9f9f9f",
+"g c #7fff7f",
+"b c #7f7fff",
+/* pixels */
+"------------------------------",
+"------------------------------",
+"-----..----------------..-----",
+"----.--.--------------.--.----",
+"--------.------------.--------",
+"---------.--gggggg--.---------",
+"---------gggggggggggg---------",
+"-------gggggggggggggggg-------",
+"------gggggggggggggggggg------",
+"-----gggggggggggggggggggg-----",
+"-----gggggggggggggggggggg-----",
+"----ggggggbbggggggbbgggggg----",
+"----gggggb..bggggb..bggggg----",
+"----ggggggbbggggggbbgggggg----",
+"----gggggggggggggggggggggg----",
+"-----gggggggggggggggggggg-----",
+"------gggggggggggggggggg------",
+"-------gggggggggggggggg-------",
+"---------gggggggggggg---------",
+"-----------bbbbbbbb-----------",
+"-----------bbb--bbb-----------",
+"------------bb--bb------------",
+"------------bb--bb------------",
+"------------bb--bb------------",
+"------------g----g------------",
+"------------g----g------------",
+"------------g----g------------",
+"-------......----......-------",
+"------........--........------",
+"-------......----......-------",
+"------------------------------",
+"------------------------------",
+"------------------------------",
+};
diff --git a/pixmaps/s-grelb.xpm b/pixmaps/s-grelb.xpm
new file mode 100644 (file)
index 0000000..d2a1c8b
--- /dev/null
@@ -0,0 +1,45 @@
+/* XPM */
+static char* image_name[] = {
+/* width height num_colors chars_per_pixel */
+"30 33 4 1",
+/* colors */
+"- c #000000",
+". c #9f9f9f",
+"g c #7fff7f",
+"b c #7f7fff",
+/* pixels */
+"------------------------------",
+"------------------------------",
+"------------------------------",
+"------------------------------",
+"-----....------------....-----",
+"----.----.--gggggg--.----.----",
+"---------gggggggggggg---------",
+"-------gggggggggggggggg-------",
+"------gggggggggggggggggg------",
+"-----gggggggggggggggggggg-----",
+"-----gggggggggggggggggggg-----",
+"----ggggggbbggggggbbgggggg----",
+"----gggggb..bggggb..bggggg----",
+"----ggggggbbggggggbbgggggg----",
+"----gggggggggggggggggggggg----",
+"-----gggggggggggggggggggg-----",
+"------gggggggggggggggggg------",
+"-------gggggggggggggggg-------",
+"---------gggggggggggg---------",
+"-----------bbbbbbbb-----------",
+"-----------bbb--bbb-----------",
+"------------bb--bb------------",
+"------------bb--bb------------",
+"------------bb--bb------------",
+"------------g----g------------",
+"------------g----g------------",
+"------------g----g------------",
+"-------......----......-------",
+"------........--........------",
+"-------......----......-------",
+"------------------------------",
+"------------------------------",
+"------------------------------",
+};
+#define XPM_GRELB
diff --git a/pixmaps/sea-texture.xpm b/pixmaps/sea-texture.xpm
new file mode 100644 (file)
index 0000000..2f7206c
--- /dev/null
@@ -0,0 +1,199 @@
+/* XPM */
+static char *sea_texture[] = {
+/* width height num_colors chars_per_pixel */
+"   128   128       64            1",
+/* colors */
+". c #b1b1b1",
+"# c #afafaf",
+"a c #adadad",
+"b c #ababab",
+"c c #a7a7a7",
+"d c #a5a5a5",
+"e c #a3a3a3",
+"f c #f0f0f0",
+"g c #e0e0e0",
+"h c #dedede",
+"i c #dadada",
+"j c #d8d8d8",
+"k c #d6d6d6",
+"l c #d4d4d4",
+"m c #d2d2d2",
+"n c #d0d0d0",
+"o c #cecece",
+"p c #cccccc",
+"q c #cacaca",
+"r c #c8c8c8",
+"s c #c6c6c6",
+"t c #c4c4c4",
+"u c #c2c2c2",
+"v c #c0c0c0",
+"w c #bebebe",
+"x c #bcbcbc",
+"y c #bababa",
+"z c #b8b8b8",
+"A c #b6b6b6",
+"B c #b4b4b4",
+"C c #b2b2b2",
+"D c #b0b0b0",
+"E c #aeaeae",
+"F c #acacac",
+"G c #aaaaaa",
+"H c #a8a8a8",
+"I c #a0a0a0",
+"J c #9c9c9c",
+"K c #929292",
+"L c #e9e9e9",
+"M c #e5e5e5",
+"N c #e3e3e3",
+"O c #dddddd",
+"P c #dbdbdb",
+"Q c #d9d9d9",
+"R c #d7d7d7",
+"S c #d5d5d5",
+"T c #d3d3d3",
+"U c #d1d1d1",
+"V c #cfcfcf",
+"W c #cdcdcd",
+"X c #cbcbcb",
+"Y c #c9c9c9",
+"Z c #c7c7c7",
+"0 c #c5c5c5",
+"1 c #c3c3c3",
+"2 c #c1c1c1",
+"3 c #bfbfbf",
+"4 c #bdbdbd",
+"5 c #bbbbbb",
+"6 c #b9b9b9",
+"7 c #b7b7b7",
+"8 c #b5b5b5",
+"9 c #b3b3b3",
+/* pixels */
+"PPilW0w65w2tZYpoUTlkRQQQjRRjPhNMLMMNNOTY38B7y42sWlPgPUZ4B.#abGGGbbFaE#D.A5v0qVljOhQTWZsoSONLMMNghOPQRkkkkkkjQPPPPiQQjRRkSWt5.HHH",
+"PPilW0w65w2tZYpoUTlkRQQQjRRjPhNMLMMNNOTY38B7y42sWlPgPUZ4B.#abGGGbbFaE#D.A5v0qVljOhQTWZsoSONLMMNghOPQRkkkkkkjQPPPPiQQjRRkSWt5.HHH",
+"PPQTp0w6y4v1srXWnmTSkjjjRkkRihgMMMNNNPmrwB97y42sWlihinsx9DEabGGGbbFaE#D.A5v0YoTRPhjmps0WlPNLMNNghPijkSSSSlSRjiPPiQQQjRRkSWt5.HHH",
+"iijmp0w6yxwvutZYponTlRkSmnooUSjPhhhggPUZ499z4uZXnljPkW1yC#EaFbaED.9BB88Ay420YWmkPOkVYuvZoSPhhOPiQklmnooWpppVUlkRjjQiQQQjRVsxCGHH",
+"jjRUX0w6yy5x4vu0rqpVmSlUWY00rpVTSRiPhQV05.9y2rVmTSkRUYvzDEEaaaD9A6xxxxx5wv10rpnlQPTp0452ZWTkkSllmnWqrs0t1u1sqWUTSRQPPPPPPmrwBbGG",
+"RRSnX03y66z665wv1sYpVTmWZu45wu0YpnlRPRW1yDCxtokjRklmWt48EaaEE#97xvtt11u2u1t0ZqVTjQnYv685v0qWWoWopYs123456z6wusXomSQOOOhhhSXvAFbb",
+"SSlVq03y67A8B76x3u0YpUnYu5B.Bz531roTjkpuzEC4rlhhiRmorv6CaFaE#.7xurWpXYrZsss0sYWUkRo0xBDB64ut0ssZsuvx67BCDaD8yv0qVlQhhggggjou7aFF",
+"TTmWYt3y6A9CD98z5wusqVo04BFHb#CA52YVklqv7aC3XQNNORnY1xADbba#D9yvrVlTUVopqrZt0rpnSSXuzDbECAyxww32vx68C#aGcdca96vspTjhgNNNNPnt6Eaa",
+"YYr01v4y678B9A6xv10ZYpqu59bHbE.86vZWlmr3Aa.wYkghQmq1w6B#bF#.9Ax2rWmnWqZ0t1uv2tZXVVZ3AEGECA54w3v2vxzB.EFGHdH#8y20qVlQPOhgNin0yDDD",
+"xx5555y6y6zzzxvtZqYYYYsvyBabaD9AyvspmnZwAE.xsUijUXt468C#aE.B7yw2sYpY024yy55543u0YYu58EbD86w2uuu12468.#EaaF#B6w1sYpoUlkiPhjo0x9CC",
+"###D9876yy54wusXVUoprs246BDED98z5vsXVWs4AE.6uXTUqt47BC.#EDB7y43210su4z9#DCBAzy4vu14z9EF.7xu000001wy8.DDD..B642sZZrrYpnljPSW04888",
+"eeedbDBz5xw21rWmRQTor14yz8C.9876xv0YWXt4A#.7wspY147.#####CAy422222v58EHdcGaDBAzyx468CEa963srrrZZtvyA.DC9A7yw2trZstu2tYVTjTp0w777",
+"KKKJeG.z5wu0YoTQhgjnrv6778BBA7654v0rXY1x8#D85v0uxA.bGFa#DB64vt1v34yBadIJIecbD.9B8ABCDEE8xuYpXqqYs25A..BAy4v10ZXrt2x641YVSUX03yyy",
+"KKKJebBxvtrXVlQhNNPTqu5y67887765xwutst3z9aEC75347CEHHbFEDB6xvt2w57BEHeIJJedGE#DDD.D##E#AxurXYrs0uw68..9A6xw2u1s1v4y752ZWmVY14zzz",
+"KKKJdD61ZXVmkQOgNMhkVZ2wx6A877zyyxw3vw6B#GbE97568DaHHbFED9z5w2wyA.aGcdIIedHbEEEaFFFaEEDA5v0stuvw5z8C#DCBAzy55x4x5y6zx2ZpnWs2y888",
+"KKKJHB3qomkQOhNNLLgQTps135zA777zz66yyzB#GdcGECA8CEbHHbFE#CA6x358DbcddddddHGaEFbHccHba#CA642u3x67B9.#EED.9B888BBBA7zy4usqoqtw7CCC",
+"KKKIbz0UkQOgNMLLLLNORUpZ146A7777AA88BCEGdeecGEC.#FGHHbFE#C8zyx7.bdIIedcHGFFEEbHdeedHFD9Az54wy79#aaaFFaE#D..DEFFa.Bz5wu0Ypr25B#EE",
+"KKKIE4XjOgNLLLLLLLMgPkUpsvyAA7AAB9.DEFHdeIIedHaaFGHHHbFE#.BAzyBadIJJIdGE####EGceIJIdbDBA7zy68.FHdHHGbFFaaaFGcdedF.7x3u0rq03z.Fbb",
+"KKJdC3WQhNMLLLLLLLNgPjlWswz99999.DEaFGcdeIIecGEEaFbbFaED.9876y8#HeIIdFDB9CD#aGHdeIdHECAA77z7CEGddcGFE#EEaFbHdIIeHD74v10rqt48EHHH",
+"IIebA2pkPhNLLLLMNghPijlp159EEEEEaaFFFGHddIedGEC9.D##D.C9BAzy5x68.Eba.B7y78.#FbbbbbaD9Az7777ACEGcdGE.8ABCDEbHdIJIHD7w2tsrqtxBFddd",
+"GGbCy1qmRPgMLMNghPiQjRlq27EHHHHHHGGbFbHcdddGEC77A8B9B8A7zy54w34xy676543vx7CEGa#.B8A7z6y6z7AB.EbHHaC7xx6AC#FHeIJIHDzv10ZYq1yCHeII",
+"BBB6wtYVlihNLNgPjSkkRRlYw9HedddddcHGFFGHcdHaCA5xy6z77z65x4w3v22u1ttt0ss0vy9aHE9z4v3w4x5yz789DEbHGDAxu1w68DFHeIJIHD62tsZYqu6DcIII",
+"44wvusrpURONMgPRTVUmSRlrx#dJIIIIedcHFFbGHHbDAy3vw4x55x43v22uu10rpVUnVVoXtxBaH#7wsqr01v45z7BCDEbHF9yuYY147CFHeIJIHD6u0ZrYquzEdJJJ",
+"222uuttZpmQhNOjToqWVmSmZyEeJJJIIedHF#D#EEF#9z42uv3w443vu1t1tt0rpmkijkSmVZwAEH.y1XnWY02w5zA9.D#EaD7wsWp03zCaHeIJIH.y1srrYY27EdJJJ",
+"333wwww30pmQOjTVqZqpoUV06EdIIIedcb#97z78B9B7y4vvww4x43utsss0t0YoSihOiRlUY2z.FBx0omoY0vx6AB.D.9BA6w1rWp03zCaHdIJIb9xtZrrrZv7EdJJJ",
+"xxxy6z77w0pljlVqs1srXop16#dIeddHFD8y3vwx5665x4ww4x554v1ZqYrZ00qnjhNgOikmX15BD73ZnlVY035z8C#D97yw2tZqWX03zCaHdeIda8wsZrZZ03AEdIJJ",
+"yy67BCD#A3somVXs1v10ZqY2zDcedHGFDA52Zrstuv3www4x55y6x20YWpqrs0XmPNLMgOjlW0w79yuqmknqtw6A9Da#ByvZqXXWoqtwzCaGHdecD7vZrrs0148EdIII",
+"77A9DFHH#zvrWqsu34vutZs37DHdHbE.8x2roVWXYstuvw55y6zzx2spnVpqs0plhMfLNgiSoZ2yA40plRUqt4z8C#FEAwZVmUnVoqtwzCabHcdGC62YYrstux8EcIII",
+"88B.aGdda84sXZtv45wvu0t3zCFGa#C8yvspmTUopYs13xz7777z52ZpUVWqs0WkgLfLMgiSorux63ZokQmXt47BC#F#72XSjkTUVqtw69#abHcFB51qqrstu4ADHddd",
+"99C.#abbCy2YWqsuwx321ss2xzC.98zy4usXnnopqZ1w68##.B8z5v0YWpXYZsoRgLfLNhknX02xy2YnjPlWs367BC#Cy1pSjRlTUpZ2xAC#EbHa8xtXXqrZ0vy8#GGG",
+"......DCz3sWnprtv4vu0rrt246z654w2tZqWWXYZt369acHFD9z53usYYrrZZVjNLfLNPmXZ1vxx1XmiOkVr2x678984sokQRSlTVYt368CDab#A4tXpXXYrt3yBDDD",
+"DD#.CB8zwtqnTVq02w21sYqZ0u3w3vu10sZYqYrst2xBadIIdFCz5wv10ssZZrnQNLfLgjos12344tplPhjUq1wxyzA6vrVkQjkklUXZu468C#FD7w0pWWWpXZ13yAAA",
+"EEE.Bz5wtYolkmpZuvu0ZqpqYZ00ssZrYrrrrs0123z#cIKJIHDz5xwvu1t0ZYUiNffLhSqv3ww4wsokhgiTp0v345yxuqnRiQjRkToY0vxz8.E.6vsWVoVVoXZt3xxx",
+"###C7xv0YWmRQloYtutZqWVWWpXqqqXXXYrZst123w7adJKKIH.y4w3v21tsrqmiNLfLOms444wwvrnjgNPlp0v3w4xwtXUkQjRRkToXZuwyA9D9y2ZonnUUnWqZ1vvv",
+"777ywu0qomkPPRmWrsrXoUTUnopXXXXXXYrZstt1u25CGIJJdD6u0sZrYqXppolPNLfNQn04w32utXmQgNiUrvyyyyyxurWmSlTmUVXr0uw579D9y2ZonnUUUWqs2444",
+"33320rXVmkihhiSUpqpVTkjSTnWXXXXqqYrZs0000037DHIdEz2qWVnUmmmmUmkPhNLhkWt43v10roSPNNjotyB8A7z530qoUVoWXqZ012w579.B5urVUUUUUWYt3555",
+"ZZZYpVUlRiOgNhQlnonljPOjSmopXXqqYrZss0sZZrtxA#HaAvYmkRQiPiQjkSjPOggimX14vusYpmRONNRpv8EDC9A642sqpqYrs0t12vw57B.B5urVUUmmUWru4zzz",
+"VVVUmSkQPhgMMgPjlmSjPggPjlVpXXqYrrZsssZYqprux8D8wrUihgNNNNghPQiPPPPkVYu42trpnSQhNNkYx#HbED975w1srstuvvvv33w57BC8x1YnmmmmUWZ25AAA",
+"kkkRjiPOhNNLLNhPRSjPgNMhikUWpXXqYYrZZrYXWVps25Ax0VjgMLLLLLMNhPiijRkUpZ2wusXnljPhNNls6becbECA6xv1tuv455x443w5z8B74tqnmTTTmWZvyBBB",
+"QQQQQiiPOgNMMNhiRSjPhNNhPRTnnUUUUUnVVoVVVUWr1w6wZnjgNMLLLLNhQkSlTTmVqs23troTRQPhghUt7bdHFDBz5wut02wy7765xw34x5yx2ZXUmTTlTVYuxAAA",
+"PPPiiiQQPhgNNgOQklRiOgNhPjSTSkRjQQjRRklTmmoYtv5vrnjhNNMLLMhilVVVVVVpYsu2sXUkiPPPhiouAbdHEC75wvtss2xz99A65wvvvvv1sqWUmTlSSUXtw666",
+"hhOPiQjRQPhgNhPjSTkQPhghPQRkQPOgggghhOiRlToqsuwuYnRhgNMMLNPkVYYqqXXqZ011rWlQOPPPikXv8bdG#B64v1srZ258##97yw2ut0ZYqWoUmlSkRTWZ2555",
+"gghOPQRSRiOhghPRlmSjiOhOPiQQOgNLLLLLLNgPRlVXZtvtqnROggNMMgjUY11t0ZZZs0t0qnRPghPQRmrwBbcb.Axv10rqr26CbbD86wu0rXoVVnnUmlkRQSVY1www",
+"gggOPjSTSjPhgOikTUlRQPOPPPPPgMLffffffLNhQlVpr0u0qnkPhhgNNhSW0wwv21t0000ZpmQhNhPjlo04BbHa963u0ZqpY26.HHEBy3trpUlSTTmUmSRQPRUps222",
+"iiQklUoWnljPhPjSmnTSRiPPPQQQOgNLLLLLLMgPRTVprt21sXVmkjPhgPSoZ2v22uu1t0sYVlPgMgOikUYuyC#9z4u0rqpopsvy9B6wtrpnTRiijkSTlRQPOikmWYYY",
+"mmUopYZsqnSQPiRlUVmlkQiQQRkkQPhgNNggghPjlmoXZ1vvu0ZYWUkihiSnqst1u2vutsrXUkONMNhPQlWZv67y420rXponVprtv2sqVlRQPhggPijkRiPhghPjSUmm",
+"YYrstuv30XURPjSmnoUTSjQjRSlTSkRQiiQQQRSlmnWqsu3www3vtYVkPQSmoXr01vw2tZqWTjhNLNghPRUps2wv1srXWonmmUnoWVTRPhgNNMMMghPQiOhgNNghPiPP",
+"vv3wxy6z3ZoSQRlUVWnmlRjkSTUnnUUUmmUUUnnnVVpY02w5yz7AxuYURRSTUnprt34vtrXnSigMLMNghPkUprsZrqpWnUTSkRjQiPgNMLLLLLLLMNhPPhgNMMMNNNNN",
+"zz7A89CCy1qTjkTnopVUTkRSTUVWWpXqqqqqqqXpWoprtv46A9Da95tplkSSllVqtw531rWmRPgMLLMNgOQkmVWWWVVnmTSRjPgNMLLfffffffffLMghhNNMLLLLLLLL",
+"666z7A88xtqmkSTUnVmlkQijklmnWXr00ssZrYXoVUVq024z8.EbD62qmTTmUnX0vy7xuroljOgMLMNhPikTVpqpWVnUmUmmlQhNLLfffffffffLMNhPPhhNNNMMMMLL",
+"44xxx5y5vsXUlllTTTkjiOhOPQRlVXs2vutsrqWnTSTWZu4zBDaG#zvYUUVWXYtvy8CzvZoSQOgNMNhPRlnWqZ0rXoUmUoWXWlPgLLfffffffLLNgOQkkjQPPOhhhhgg",
+"vvvvv3vvtrpnmllSkRiPhgNghOPjUXt4x3u0rXVTkQRnY147BDFHE73rnVpY01wy8.E8wsVkiOgNNgPRTVXrt220YomTnpY0ZnRhLfffffffLLNhPRlUUmTSSkRRjjQQ",
+"111ttt0srXWVUTSRQPhgNMMMNNgPTXu67x3trpnSQOPTXt479#bHaAwZopYtvxzB#FGCx0VjPOgNNhQToY0u3xxuZWTlVYt32XlhLfffffffLNOjSmVppWWooVnnUUmm",
+"ZZZZrYqXpWWoVTSQPhgNMLLLLMNhSqv89z4uZWmRPghkW0479#bcF84sWq0vy8.EGcdEy0VQPOgggPSVYtv4y77w0WTlosvzysUPLffffffLMhRmnWqZZZZZZZrrYYqq",
+"XXqXppWWWpXqXVmkQPhgNMMNghOjotyDF.8ywtqnkPPlWZvyACEGEAxtqs2yB#bHddeFztVQiPOhhjmXt3x67BBxuqnUXtw7ysUPLffffffLNPknWY02vvvv3v2utt00",
+"VVoooooopqrssqWUSRQiPhOPRlnX1yCHdHbE.A40pllnprt357CE.7xusux8EHddeIIb7uoRQiPPiloZv5zABCC63spWr1w6xZmhLfffffLMgPknXsv5y6zz765x3v22",
+"TTmmUnVoXr0u20rpnTllSkSUWYt3z.GeIIIedH.yuXWpXqrtv579Bz5vu47DHeIIIIIGA2WkRjjjRnq1x789CD.7xurY0uwy4YThLfLLLLMghiknqux89C.D#.BAyx44",
+"RRkSlmUVXs1wxv1ZpooVVVWr1wz9aceJJJKKKJd#zuZrqXWY0v577y5436CGeJJJJJIHBvpSkSSSTWs3z9..#E#By3101vw53qSgLfLLMNghPQknr37#FGHHcGa.87zz",
+"PPijklmVqtvy7ywuZYYYrZ03z9FceIJKKKKKKKJdEyvtYWUVq0vxy5555BadJKKKJJJc93XllTTmnYu5B#EEFFa.7532v3wx2pkgLfLMNhPiQjknsxCHdeIIIedbD9BB",
+"PPiRSUVXs2x78z42srZs01v58#HdIJJKKKKKKKKea6v0XnklVq0u3wx5y9FdIJJJJJIHB3qmmnVWXtw7.FbbGbFDAy3233wx2pSgLLLgORSlSlTWty.HdeIIJIdGD8AA",
+"jjRTnprtvx68Bz4uZqZs1v468.FHdIJJKKKKKKJd.4tYVSiQSnpr0u34y8#HeIIIeedE7vYnopqr0369aHHHHHbDA5212vwxvqlhLLNORUoooooY2yCbcdIIJecEB655",
+"SSlnXZuw5zA9C741rXr02w5z8C#FHdIJJKKKKKIG8vrolihhikmoqsu35ACaHddcHGF9yurWXr0u3y8#GcccccH#741012w53YmPMMhjUqrrrrr036BEGceIIeG.zwvv",
+"TTUpZ2x789C..741Yprtv5z789.#FHdIJJJKKJeE6tpmjhNNgPjSnq0v57B.EFaE#.9741rXrt246BDbcdddddH#7w0Zt2w5wrniNNPTX122uu12xz8.aHdeIdFBx100",
+"nnoruxAD####D74tqortw6A888B9DFHdIIJJJJcC4rnkPNLLMNhPkoru5678B9B8A76xvtZY0vx79#Fcdeeeedc#73ZYsuw54sojghRo04y5xx44yzABDbceIdE7vrqq",
+"ppX0369aE#D.963sXor1xA9B8A77BDaHddIIJeb83qUjhMLLLMghjnYuxy6666y5x43v10ssu47CEGHdeIeeddG.6vZqs1vxwsokhPmYvz8Az6556z7ACaHdIH.y1XWW",
+"rrZu469#.987y31rpWZ2y9D98z55zB.aGHdeIdE7vqURPNLLMNghjnYux55x4w3vu1tt000t369aHddeIIedHFD85v0rstuvuroliRo0xBCBA6556z7A9#bHdbBx0WVV",
+"tt1vxzB.B75w2tZqpWs3zDEC8y3vxz8.EFHHdG.62qnkPgMLNNgOjnYux54321tsZYqrZst2x8#HeeIIIIdHaCA64vtss00tsqomkmq2zD#C8z55y6z7B.EbH#73Zonn",
+"vv34y7897xvtrqqpWpt48abDAxut2468CDEFGEB5uqVlihNMNghPRnYuxx3u0rYXWoVpYZ136CGeIJIIIIdbC7xwv21t0sZrYponmo04BFF#B75x5y6zA9DEFCy2YVUU",
+"xx5yz7885v0qVVoooX159GH#AwsY0246ABC.#Cz41qVTjhNNghhPRnYux420YponmllnXZux8EdIJJJJJIcEA4uuu2210ZqpWWoooY26DHHaC75x5y6z7B9CD84tXUTT",
+"66z6z77zwtqVlTnVWY26.Hc#A3rXr02w5yz78zxv0qomRPhghhhPRUq1431sXonmlkkUpr14A#cIJJJJIIHDz3t1122u0ZXoVoWWpZvz#cHEB6w3w4x5yz7A8yvZWmll",
+"zzz666652ZpmkTVpY0w7DHH#73ZXYrs01u22v21srXoUljPPPOhhilWZuutsrqXWVUUVpqZ1wzCbddddedGDA53vvv2u0ZqpWWWWWYu5Cba9630s0t1u23w4xv0Xnlkk",
+"zz76y5xwtYVSjTVqsv58#HH#7wsqqqXXXqqqqqqXXXWVUlkQiPhgPkUXs000ssZrqpppppXqsvx7CDEFHHFDBzyxw3210ZYqXpWoVX04A#.z3spopXqYrs01u0qoTkRR",
+"7776543uZpmRQlorux79EHHD7w0qXWnmTTlllTUnopWoVUmSjPhghQlVXrs0tuutsZrqpWVnWYsuwy79#aEDCBA6xwu10srYqXWonWZv69A40pTSTmUnVWpqYXomSRQQ",
+"AAA6x320qVliPlW0wzB.aHGD741YWnSQPPOOhPjSUWpWpWoUSihNgPjTVXrt2ww32u1ZpVTRSmnoX0vyB.DDDD.864ut0ssZrqWVUVq147y1qTiPiQjRSlmUnUTkjQii",
+"zzzywu0YWUkiPTptxA9.EFaCz41roTQhgNNMMNhQlopXqqqomjhNgPQSUpr1v5x432urWmjPPQjRlWZ2y89CD##B6wtsZZZrrXWVmVqtw6x0WSOhOPPiQjklTlkjQiPP",
+"www2tZqWVmlkknXtwyz78997531roligNNMMLNhQlopXqYrXVTRPQkmVpYs1v43u0rqVljOghPijSnX0vx6z8BBz4uZqXpWooVVVnpZ258zvZVkjRkSlTmUnnUlkQPPP",
+"000rqWVUmmmmUWY02w4x5yy4321ZoSPNMMLLLMgiSVpXYrZrXonTUVpYZ0tu2v1ZXVTRPhNNNhPiRmoqs1vw5664usXonmTSSTUVWY147.952rVUnVooWWpXpoUSjPPP",
+"ppponmlSlmnoXYZ01u2u2u2u111ZokONLLLLLMgPSVpqrZ0sZrqXqrs1u2uuuuZpURPhgNMLMghPjSmVpYstvw4usqVmSRQPPRTVXs369a#85urYYrrrZZZZrXVTRPPP",
+"TTTSkjQikmoYssss0ssrrYrrs01soRhLLLLLLLNPknpqZs111111u23w4w321tqURhNMLLLLLNgPQRSTUnpYs1usXVTRQOhNgPSVYuxA#HGDA52uu22222uutZWUkPPP",
+"QQQiPPOOQTWZ1tsZrqqpWoWXr0utWkOMLLLLLLgPSoqZtu3ww4xx55yyyx3u0rokONLLffffLLNhPiQjRkmVqZsqoTRPhgNLMhkos3zCbdcF.A5555555x4wvtqVSiPP",
+"PPPPOOhOQSUXrYqXpWppXXYs13x40WlPggNNNhjmp0246A999BB87654v1sYpoligLLffffffLLNghhOPiSUprsXnlQOgNMLMOlXu58#HddG#9z66zz77z6yxvZWTjii",
+"hhOOhOhOiRlnooVnnnWpYrt2468A4tXmkRjQiRnYux7CEGdcHGF#9z4uZqWnTSihNLffffffffLLMNNNghjTWrsXUkPgNNMLMPUZ4A.aHedHaCAAA8BBB88A741qURjj",
+"gghhhhhOPQjSlllllTVXZtv579##852ZXWonUoZv6CaceIJJIIdH#AwsWUlRiPhNLLfffffffffLLLLMMNPSor0XmRONNMLLMiVt6CEGdeeHFDBBBC.DD..C96vrVSRR",
+"NNggghhOPPPPiQQjjknX0v5A.aHHaC742u0ZYsw7DHeJKKKKKJJeb8vqljPhgNMLLfffffffffffffLLLMhRVr0XTQhNMMLLNjW28EbcdIecGECC.#EaaaaE#840WTSS",
+"NNNNghOPPPOOOPPiQknYuxA.Fceedb#Bzy4vu37DHIJKKKKKKKKJcB2oihgNLLLLffffffffffffffffLLhRVs1qmQgMMMLLNkqw.GHdeIedHaDD#abGGGbbF95tpmll",
+"MMMNghPijRSlTmnVopsvyBDFHdeecFD86x310uyCHIJKKKKKKKKJcBuVPgNMLLLffffffffffffLLMNNhPSWs3xuYVkiOhgNhmZ5DHcdeIedGECC.#abFa#DC6vYnRQQ",
+"LLLMNhiRTnpYs01u23yA.FHccdddG#97531ZqZw8FeJKKKKKKKKJcBuVPgNMLLfffffffffffLMgOiRlUWruxAB63tqomSjPjW16#HcdeIecbD88B.#a#.BA6vZVkOhh",
+"LLLLNOQloY1wyz7A8C#bHdeeddcHa.8ywuZXVpu6#dJKKKKKKKKJH8uVPgNMLLfffffffffLLNPkUWqZtv5ACaFD86w1ZXnlmYv7EHdeIIecaCzzAB.#.86xvZoSPNNN",
+"fffLNORUquy9abGHHdeIIJJIedHFDBzxv0qVlnsx.cIKKKKKKKKJH8uVPgNLLfffffffffLLNiTp0246ACEbHddcb#C7xurWptx8aHdeIIeHEByy6A9.B6w1rolPNLLL",
+"fffLNPSW05CHeIIJJJJJKKKJIdG#9AywuroTjlq3BHIJKKKKKKKJH82oigNLLffffffffLLNPTXuy8.aHdeIIJJIIdcbC6vZZv69FHdeIIeH#A445zA9741YoligLfff",
+"fffLgjVswAEdIIJJJJJKKKJJeHaCA6420YWUkmr38FeJKKKKKKKIGA2WQhgNMLLffffffLNhRoswA.FceIJJJJJJIIdH#7wssv6CbcdeIIeHD7w3wx56xuZpUkPgMLLL",
+"fffMPmrwz.GdIIJJJJJJJJJIdb#BzxvtZqpVUoswAEdJKKKKKKJIbA2pRPPOhgNLLfffLNhjUqu59EHeIJJJJKKJJIIdEAwsZv6CbcdeIIeG.z3222vvuZXomkihNLLL",
+"fffNjW2A.FceIIJJJJJJJJIdHaCA5w1ZYqXpWqt47.GIJKKKKKJeFAvXSRRjjQONLffLMhQTp0w7.bdIJKKKKKKJJJIda8wZZv6CGddeIIebC6v1t0sZYpoUTkQOgNNN",
+"fffglZ6EGcdIIIJJJJJIIIdHFDB642sqpXqqYs2xz9adJKKKKJJeaAvqTlTmmmRONLfLgilWZvyBEHeJKKKKKKKKJJJebBwZrv6CGddeIIdF9y2tZYpoVUmTSkjPOhgg",
+"ffLhnuCdeeIIIIJJJJIIedHFD975vtYWoXYZ0u3x6ADcIKKKKJIdEAvYUUoWXqnjhMLMOkVZuxA.bdIJKKKKKKKKKJJIGBwZrv6CGddeIIdF9y2sqWUSSSkkkkjQiPPP",
+"LLLQX4EeIIIIIIeeddcHHbaD9A6xvtrpWqrstv4y79adJKKKKJId#Aw0pXr0uvZVkhNhjUXt3y8DbdIJKKKKKKKJJIIdE7vYq26CGddeeIdF96v0qoTRRkkSSSRjQiPP",
+"NNhT0zGIIIIeedHFED...C987zy4v1ZqXYZ0tvxzB#GeJKKKKJeH#B52Z0246Ax0pSPRmpru4zB#bdeJJKJJJJIeddHaBxtpX1yCGddeeedFCzw1rWTjjkSlTTSRQiPP",
+"iiRpv9cJIIeedb#B6x55yy6y55x4vusrYZs0t35ADbdIJKKKKJeH#9z4u36B#FC51XmVpZtvx79EbcdIIJIIedcGFEDBy2ZoWt5CGdddeedb.AxuZWTQjklmUmlkjiPP",
+"mmn0y#eJJIedH#A41Zstu2333w4wvutsss0tt369aceJJKKKJIdG#CA64zCFdIH.6uYrs12wyACEbHddeIdcHFE.9875v0Xno05CGddddedbD8yvspTQQklUonTkjiPP",
+"qqr3BGIJJIecFB40omnWXr0tu23wv21tttttt3z.GeIJKKKKJIdb#.987CbeJKIcD6vvvwwxz8.abHHcccGaD9A6543usqoTnsx9Gddddddb#9zw0pTiQkTVpomSjiPP",
+"tt15CHIJJedG#72qmRlUVprs1v4x4321tt00026CHeJJJKKKJeH#CBA769beJKJd#62uuuu2468.EaFGHHa#C87yxwv1Zqomnrv7DbGHHHHbE.ByuYUjjlmopWnTSRjj",
+"vvwz.HeJIdHaCy1XTjSTnWqs2467yxvut0sZrt59GeIJJKKJIdaB76x43z#dIKIHBwZYYYqY02x7B.#abHa#.9Azyx4vtrpnVqtwy89.#FFFaED840WSSTUopWVnUmTT",
+"55y8#GdIdHFD840WSQRlmVXsvy89Ayw2tsrqXZw8FeIJJJKJeG.64321049HIJIaztWVnUmUWr1wyA9#FGaEDCBA7654u0qoopYstvxz8.#EFFb.62qmTUnoWpWWWWWW",
+"AA8CEGddcFDB6vZokijkTUWsw7DE97x2tZYpoqv7adIIJJJId#AwutZYquzaeJdDxYTkRjiiSnqt35ACEbaa#DCB87zy31rpoooWWq0v5AC#FHdF84sonVVoWpXqrrrr",
+"CC.#aGHcb#97xuqnRPQRSTos48FG#8yvtrXoUWu6EdIIIIJeG9y1ZYpVnZxDdJdB2oiPhgNNORUX03yB#baaE#D.98Az420YWnmlRlWZ2y8DbcecD6uXoWooWpYZt111",
+"EEaFbHHHFDBz4urWlRSlmnp1y.HdF9y2sqomSmZx.ceeIIIdEAwsqWnTSp28beb71ViPhhggOjToY14zCE#E#DDC98Az42sqoUlkQSVr2yBEHeJebB40rrYYYrstu222",
+"bbGGHccdG#9753trpVoWXqsw8adeG9y1YomRPRpu7FHHccdbC6vZXVmkQUZxCG.y1WSkRRjRkTUoXs2x7B9CCCCBAzyx20qonUmmTVYux8#GdIJJdE84vv22uuuuu111",
+"HHHccdddHECAy4vu0Zss0t26DHIIHC5tpUkPgOmZx.aaFFFD852ZpnSQPkp1yC74tXnnnVVoVVVoWY0vx67A8BBAz54v0YWUTmUVoqt47DbdIJKJIcE87z66yxwvut00",
+"ddddddedHFD86y5xw333ww5BbdJJc.xsVSPgMNjp2ACCCCC86w1rWmROgPmq25420rXqYZs0rqponpY02wxyzAAz5w2tYWUSSTnpYtwzCbdIJKKKJIcF##D.9Aywu0ZZ",
+"eeeeeeeedb#B7777777z7zAEdIJJd.xrmjhMLLOUsxz7777y420YoligNgjUY11t0sstu34x20qomVpYs1v45z7yw2tZpnljjTortw69FdIJKKKKKJIddcHHbDAxuZrr",
+"eeeeeIIedb#B77AA88A77zA#cIJJdC4qTQgMLLhTYw5555542trXnkPgMgPlors0t1u3x6A8yvsXnopqZs1vw5542trqoUlRknXt368#HdIJKKKKKKJIedddHaByvsZZ",
+"ddddddedHa.Ayy555x4w3vwzDGeea7vqmRPgMNinZw5xxx4v1ZXVmRPhNhQTorstuv4yz8C.Ay31rZs0001u2vvu0ZqXWooVWYt3yACEHdIJKKKKKJIeddHHb#Bz42uu",
+"HHHHcdddG#9zxw3vu1tsZrZv69Fb95uqnlQPgOkWsw5x4wwusqVmSjiOhPRmoYs13x6AB.#E.Bzx3322u111tt0ZYXWppqYZ024yACDFHdIJJKKKKJIdcHba#.B76x44",
+"aaFbGHcHF.8y321srqXoVUVYuxABy30qVmSRiRUqtwx4w3vtrWmkjQQPPjSUoqs24z8C#abGFE.B7z543u10ZYqpWoVoqs13x67BC#abHdeIJKKKJIecGbEDC9B8A7zz",
+"DD#EabHHaC7x2trXoUmSRQjmX034vtZqWVUmlmWr1wxw322sXVSiPiQQjkTnoqsvy8DabHcdcHGFE.8zxv1sYWVnUUmVY1479CD#aFbHHcdIJJKJJIdHFED988BB9999",
+"AA89.#FFDB64usYWnTSQPOPknqt2utsZYqXXXqs13x5w3u1rWURPPijRSTmnoXsv69abHcddddcHGECA5vtZXnUTTTTVr2yCEaFbGHHHHHdeIJJJIecbE#CBA89.#EEE",
+"vv3x6AC.97y4v10rXWnlRiiTWsvxxx44wwwwwwxyzA75w1sqWnljjRkSlTmnVWZv6CabGHHcHHGba.8642tZqWVnUUmVr2y9#abGHHHHHGHcdeeedHGE##D..DEFGHHH",
+"qqYs24zA76543vu10sqVTkRnYu5AA89CCCC.....DD96wtrponmllllllTmUnor26CFbGGGGbFE#.Bz53utsrXpoVnUVr2y9#abHccHHGFbbbGGbFaED#EEaFGHcdddd",
+"SSTVqtw555x444ww3vtqoTlW0w7.#aGHdddddddHHG#A40XooVnnUUmmTTmUUnY26CFbbFFaE#.CB754210sZrYXWonor25BDabHddHGbaEDD.CCCCCCDEbHcdeeIIII",
+"hhOjmX0vww44x5yyz6w0qVUYuyCFHdIJJJJJKJJIedbBxsWnVoWWWVnUmTmmmUqu6CbbFa#D.98Azy4v1000sssYXWVor258.abcddHGa#.BAzy6z788.aHdeIIJJJJJ",
+"LLMhjnruvwx56zA8996vspos37DHdIJKKKKKKKKJJIHCxZVUVWXYqponmTTTTTXt59FFEDCB876yxw210ss0011sYXWpsvyBDaGcddHF#C8z54v34yzA.aHeIJJJJKKK",
+"LLMhkW0wxyzAB9..#DA41YXsvyBEHeJKKKKKKKKJIda8wZVnWXr0ZqonlSSkkkVrv6998765432100ZZYrZ0t1ut0sYZ258#FGHcdHaDBzyxw3v3xy78.aHdIIIJJJJJ",
+"LLMOlX2y78C.#EaaFa9630Y02469adIJKKKKKKJIdb.6vrVVpr0u0YWUSRjjQQTW036yxw210ZqpWWWppXYstuv2uu12xADGHHHHHF.Ay3vvvvvw56AB.EbHdeeIIIII",
+"LLMPmrw89DaFGHHHHGDAxustuvw6CGeJKKKKKJIdGDAxuYVoqsuwuZWmRQiPPPRUX0v210rqpVmlklTUnWqZt23wwww5ADbdedcHb#85vss01234yz89.EFGHcddeeee",
+"LLMPn0y.EbHdddddddF96311111wAadJJJJJJJeH#8y3tqVWrt3530pTQPPhhgPknpZYXWnmlRPOhPQkTVprtv4x5y6A.bdIIedGa96vsppYsu3x67BC.#EFbGHHcddd",
+"LLMPV17aGcdeIIIIedGDAx2110Z1yDcJJJJJJIda96wusqVWZu4z4tpTiOhggNhiSUWVUTkjPhNMMNhikUWrtvxyzA8.FdIJJIdG#A4tXmUpr13x67BC.##EEaFbGHHH",
+"LLMPV17aGcdeIIIIedGDAx21tsrt5.HIJJJJJIcEBy31ZXVWZu4z4tplPhhgNNhPkmonmlRQPhNMLNhPRmoYtvxyzA8.FdIJJIdbD7w0pTmWYt3x67BC.DD##EaFbGGG",
+"LLMPV17aGcdeIIIIedGDAx21tsrt5.HIJJJJJIcEBy31ZXVWZu4z4tplPhhgNNhPkmonmlRQPhNMLNhPRmoYtvxyzA8.FdIJJIdbD7w0pTmWYt3x67BC.DD##EaFbGGG"
+};
diff --git a/pixmaps/tree.xpm b/pixmaps/tree.xpm
new file mode 100644 (file)
index 0000000..692e16c
--- /dev/null
@@ -0,0 +1,390 @@
+/* XPM */
+static char *tree[] = {
+/* width height num_colors chars_per_pixel */
+"   128   128      255            2",
+/* colors */
+".. c None",
+".# c #0a0c15",
+".a c #050413",
+".b c #0c1215",
+".c c #0d1318",
+".d c #121416",
+".e c #161a18",
+".f c #0c0912",
+".g c #1a261a",
+".h c #1c341c",
+".i c #1d371f",
+".j c #26291b",
+".k c #28371d",
+".l c #35391c",
+".m c #332c1a",
+".n c #26292b",
+".o c #2b2b32",
+".p c #293923",
+".q c #353924",
+".r c #383a33",
+".s c #312d30",
+".t c #3d3c49",
+".u c #2a431e",
+".v c #38451c",
+".w c #2a4622",
+".x c #384923",
+".y c #3a5524",
+".z c #3a4937",
+".A c #3e632b",
+".B c #3c5543",
+".C c #463e18",
+".D c #453c2e",
+".E c #3f3e49",
+".F c #47491d",
+".G c #49571f",
+".H c #58551e",
+".I c #534b1b",
+".J c #464a25",
+".K c #464835",
+".L c #485924",
+".M c #4b5538",
+".N c #575926",
+".O c #565838",
+".P c #544c33",
+".Q c #57621f",
+".R c #4a6629",
+".S c #4b6736",
+".T c #586827",
+".U c #5a6838",
+".V c #5a712d",
+".W c #5b7335",
+".X c #61571c",
+".Y c #655926",
+".Z c #63573b",
+".0 c #6a641c",
+".1 c #666a29",
+".2 c #666a35",
+".3 c #64722c",
+".4 c #6c762b",
+".5 c #6a7736",
+".6 c #756c28",
+".7 c #776b38",
+".8 c #797929",
+".9 c #767a35",
+"#. c #48484a",
+"## c #575a4e",
+"#a c #575754",
+"#b c #514e4c",
+"#c c #5b5b63",
+"#d c #586547",
+"#e c #5a6654",
+"#f c #576f4b",
+"#g c #5e6263",
+"#h c #5d7762",
+"#i c #675c4a",
+"#j c #605f64",
+"#k c #676847",
+"#l c #686852",
+"#m c #6a7644",
+"#n c #6b7854",
+"#o c #756d44",
+"#p c #767947",
+"#q c #787956",
+"#r c #736e54",
+"#s c #646766",
+"#t c #6b7769",
+"#u c #787869",
+"#v c #767a7d",
+"#w c #7d7f80",
+"#x c #6b8038",
+"#y c #79812d",
+"#z c #7d8333",
+"#A c #7a8438",
+"#B c #798446",
+"#C c #798456",
+"#D c #748956",
+"#E c #7b876a",
+"#F c #7b8576",
+"#G c #71876c",
+"#H c #7c8883",
+"#I c #897c1e",
+"#J c #847b2b",
+"#K c #847937",
+"#L c #8a7328",
+"#M c #837b47",
+"#N c #837a56",
+"#O c #817b69",
+"#P c #87832b",
+"#Q c #888837",
+"#R c #8c923b",
+"#S c #968728",
+"#T c #958a39",
+"#U c #989339",
+"#V c #9c922c",
+"#W c #a59639",
+"#X c #aa9436",
+"#Y c #b7a239",
+"#Z c #b1a037",
+"#0 c #878947",
+"#1 c #888957",
+"#2 c #8b9247",
+"#3 c #8b9459",
+"#4 c #968b47",
+"#5 c #968c56",
+"#6 c #989548",
+"#7 c #989858",
+"#8 c #868a68",
+"#9 c #858b77",
+"a. c #8a9469",
+"a# c #8a9776",
+"aa c #938a67",
+"ab c #979866",
+"ac c #969877",
+"ad c #968b75",
+"ae c #9da257",
+"af c #a0a04d",
+"ag c #99a267",
+"ah c #9aa476",
+"ai c #a69948",
+"aj c #a69a57",
+"ak c #b29c44",
+"al c #b39b56",
+"am c #a48c50",
+"an c #a69a66",
+"ao c #a79c76",
+"ap c #bd9a6d",
+"aq c #a9a14a",
+"ar c #a9a458",
+"as c #b7a648",
+"at c #b8a757",
+"au c #bbaf59",
+"av c #a9a667",
+"aw c #a8a676",
+"ax c #acb278",
+"ay c #b6a867",
+"az c #b5a975",
+"aA c #b9b26a",
+"aB c #b8b577",
+"aC c #aeb36d",
+"aD c #c6a73a",
+"aE c #c4a948",
+"aF c #c4aa56",
+"aG c #c8b158",
+"aH c #d4b75a",
+"aI c #cfb54d",
+"aJ c #c2ab66",
+"aK c #c7b768",
+"aL c #c6ba77",
+"aM c #d2bb69",
+"aN c #d1b674",
+"aO c #dbbf5e",
+"aP c #cac27a",
+"aQ c #d7c06b",
+"aR c #d7c577",
+"aS c #c8bf6e",
+"aT c #e2c777",
+"aU c #878a84",
+"aV c #8b9584",
+"aW c #979b85",
+"aX c #969896",
+"aY c #8f928f",
+"aZ c #9aa486",
+"a0 c #98a398",
+"a1 c #8ea289",
+"a2 c #9ea6a4",
+"a3 c #a49c83",
+"a4 c #a19a98",
+"a5 c #a8aa87",
+"a6 c #a7ac9b",
+"a7 c #aab389",
+"a8 c #aab49b",
+"a9 c #b3aa87",
+"b. c #b8b887",
+"b# c #b7b899",
+"ba c #b6aa98",
+"bb c #a6a7a3",
+"bc c #adadb1",
+"bd c #a8b5a5",
+"be c #acb3b1",
+"bf c #b8b9a7",
+"bg c #b8bbb6",
+"bh c #bcc289",
+"bi c #bac295",
+"bj c #bac2b4",
+"bk c #bcc2a6",
+"bl c #bcc6bf",
+"bm c #c5b987",
+"bn c #c5ba97",
+"bo c #cdae87",
+"bp c #c4bca4",
+"bq c #c5bcb9",
+"br c #c2bfc0",
+"bs c #c8c488",
+"bt c #c8c697",
+"bu c #d7ca85",
+"bv c #d4c89a",
+"bw c #d8d298",
+"bx c #d8d08d",
+"by c #c7c8a8",
+"bz c #c6c8b6",
+"bA c #cdd2ab",
+"bB c #cbd2b7",
+"bC c #d2c7a9",
+"bD c #d4cab7",
+"bE c #dad7a8",
+"bF c #d8d6b8",
+"bG c #dfe1bd",
+"bH c #e3d593",
+"bI c #eed280",
+"bJ c #e3d9a8",
+"bK c #ede09f",
+"bL c #e7e3b9",
+"bM c #ebe3af",
+"bN c #cacac8",
+"bO c #ccd2c8",
+"bP c #d8d8cb",
+"bQ c #d9d9d5",
+"bR c #d4cdcb",
+"bS c #dfdfe1",
+"bT c #dee2c8",
+"bU c #dde2d6",
+"bV c #e2dbd5",
+"bW c #e3dac2",
+"bX c #e5e6c8",
+"bY c #e7e5d7",
+"bZ c #f5f1d9",
+"b0 c #f1ebce",
+"b1 c #e6e9e5",
+"b2 c #e9ebe5",
+"b3 c #e9e9e8",
+"b4 c #eef1ea",
+"b5 c #f1ebe9",
+"b6 c #f3f3ea",
+"b7 c #f5f3f2",
+"b8 c #f1eff0",
+/* pixels */
+"........................................................................................................................bZ............bPa7b6b1..................................................................................................................",
+"......................................................................................................................b7bwbZb6..bZbZbEbJbwb4..b2................................................................................................................",
+"............................................................................................................b0b0b0....b7bGbtbEbZbLbwbEbtb6bka7bkbU..............................................................................................................",
+"......................................................................................................b7b4bib0btbhbxbtbTbwbsbtbFbLbEbKbTbBblblbja7bUbFb7b7b8....................................................................................................",
+"....................................................................................................bwbEaBb.bybib4bYbEbZb0bGbwbUbEbEbxbLbA..b7..a8bibia7a8b4bkbAbY..............................................................................................",
+"....................................................................................................bwbsbhbibkbU..bBbUb4a7biaha8bEbZbHbLbGbjbGbObi#Fbjbjbibia#b#b2..............................................................................................",
+"....................................................................................................bTbFbLb2b2bUbTb7bia7bia7aBaCbhbwbtbBbTbGbwb0bAbAa7bda7axbA#GbP..............................................................................................",
+"......................................................................................................b7bTb6bGbkbAb4bjaZbhbha7a.agagaSbhahbsbGaBbEbkbka8a7a.#Gb#aZb2............................................................................................",
+"....................................................................................................bFb1b6b1bEahbxaBbhaxb.bsahaBaCagaCbBb7bibhaPbEbwbAbha1a##GbjbUa1bO..........................................................................................",
+"....................................................................................................b2bjb6b4biawbtbsaxbhaxbsa9btbhbhbhbibEaxaBaBaPbxbxa7bi#G.B#Ha1bj#hbebS......................................................................................",
+"....................................................................................................bZb6..b6ahbkbkbhaLbxaLacaxaLbhbtbhaCaBavaCaCbhbsbhbha1bea1#GaY#H#H#vb1b1....................................................................................",
+"............................................................................................b6bLbFbZbxbLb6bLbLacawaBbsaPaxahaBaBaxaha#ahbFaSaBaPaCaxbsbwa##Ga##Ga0bj..bO..b4b4..................................................................................",
+"..........................................................................................bZbubXbhb.bxaPbsbxaLaBawb.aBb.awb.aPbtbwbhbibhagagaCa.ag#3#Dbha7a0a0aVa7bda#beb8bPb1..................................................................................",
+"..........................................................................................b0bFbsbta7bsaPbuaAaBaPavb.avbhabaBaBb.btaCaPavag#3#2aeaC#3#xaCbhbFbj#HbdbUbNbNbGbpb2..................................................................................",
+"......................................................................................bL....bZbJbsbhaSbxbuaCaSaBaC#Eawaxaha7a#a7btaBaBagaBae#f#Dagbhah#EahbLbiahbwbLbXbEbxbF....................................................................................",
+"..................................................................................b6bZbBbLb6bYbtbhbhbHaTbiaCaCbsava.bs#3anaBbEbxauaS#3aeag#3bhbObkbU#D#G#3aLbFbHbubsbhaPaPaCaxbX................................................................................",
+"................................................................................b6bXbEbtaBaPb0aBaLaCaPaPbLaCagavawabbhawabavaAaLagae#3agavagbhb.ahawbhbwaL#3#2bsbxaPaxbhagagaPbBb7..............................................................................",
+"..............................................................................b6bKbZbKbHbxbsaKaQaSagaSaAbtavbEazaB#7b.anav#7aBbxaCbhb.b.aA#0#2#C#1#3bhaxa7ahaw#DbhaBa7bhbybTbAbwbOb1bOb7........................................................................",
+"..............................................................................b7b0bMaSbubuaRaranaraCaraAaRbsbxbuaC#7aC#5#paraBaxaxaPb#ax#6.M#3ab#1aeavaPaAaPbhbhbtbAbAa7b4..bBbY..bU..b7........................................................................",
+"..............................................................................bFbxaPaRaPaAaLaAaLavaPaCayaraLaBbsawavaA.Z#7avagavaBar#3ag#3#d#EabaAaKbuaPaPbsb.aearbwbhava1btb.ax..bdaXb2........................................................................",
+"..............................................................................bCaLaRaRaRaRbsaxaCaQaraKaK#0aAavaAay#1aB#k#7#3bfayav#6#B#0#x.5#DaxaBaSaLaPaBaBb.av#7aearbsbiaxavaCbvbQa2b7........................................................................",
+"..........................................................................b8..b#a7aPaBbsaRaAbmaKaAaL#6araravazaBar.U#7#0#qara.#3aearaCav#7ag#2aCaKaKaKawahar#3aw#2avaxbTbYbFaPaBbubmbX....b2bt..................................................................",
+"........................................................................bjb#bmb.bkbHaLbwbuaLauavaB#7ae#2aG#2abaral.U#1ajaeae#2#2agae#2#B#3#7#7abay#8axaca.aCaLajafaeaBaPbwbFbFaAbaa.bmb#bYbtbAbY................................................................",
+"..........................................................................bbacbmbEaRaRaMaQaJb#a0aBavaq#2#2#5ah#7ar#1aj#4aB#6avaqae#0#m#p#9aZaC#Baba.#EagaKaAazaCavaAaBaPbubvbvaAb...b7....bDbYb7bP..............................................................",
+"....................................................................a6a9.p.zabavbsbxaPaRatayaxawbtar#7.W#dae#2#C#mabaA.5#B#0#0avar#B#Bavbq#ObQajawaoaraKb.ayanbuaeaKaPaLaPaAaLbJbpbNaWb2bQb3b8b2bzbX............................................................",
+"....................................................................b#a9aca0aXbtaRaRaLaAavaB#3araCaLa5bkahac#3ar#8aw#2#5#6#0arbFag#Cb#a9bwa9#7ar#5#1#7aranayarayavaCauaLaLaNaJbsaLbV....b2bUbSb3b2..............................................................",
+"....................................................................b1aLbsbIbubHbuaQbuavagbyavaLaBavaLabaga6a##ra5a5a.#2#p#3#CaZbO#F..bUbEbEaraq#1#5#pazayaqabajaAar#2araAaAaNao#r..bgbRbBbPbO#a................................................................",
+"..................................................................ac#tawaQaRaKaTaQaQaRaGazaLaQaAaqar#2bBaga8b3bQ#tacbmav#ua8#pava.a.bYbNbYbiaLat#2.2aBaNaM#2awbabQ#5#1#7a5araSb...bQbQb7b7..bbb8................................................................",
+"................................................................bOaxaLaRaPaKaKaQaTaSaRaQ#6ajar#7#2#6afaraf#Bbia7b.aiar#D#2#BaZ#m#Ea5aZb.bEbtavan#0aiaraOar#2#7anajanb#az#NabaravbFbO......bObY..................................................................",
+"................................................................bQarayaRaRaQayabaJaNaAat#7#6at#2#2af#x#R#2#0#x#R#1b.#3#3.5#3#C.5.U#C.S#0araj#U.9#6#6#7baaJ.9bFacajau#q#0#o#3aAaBaBaRbxb.bTb2b6..................................................................",
+"..................................................................bmayaj#7aCbBbfanb#azatav#6aravawarauafafaq#6#x#A#Aarab.p#Ba6ah#n#0#6araKat.7ajar#x#x#6#XanbVawaob.b8.9bQa##5#7aAbuaLbububsb.b5bOb1............................................................",
+"..................................................................bYav#Aab#daZb7#8aaanawaraFayaiataiaf#3atavavar.9#Aar.P.pbj#3#ua5#2ayar#6#R.9bp#K.1aw.2#4ajataM#7#7avai#6arararagaAavaxaCbsavbybfbQ............................................................",
+"......................................................................aza9aFaiaK#1#n#0avaz#4.9ar#7#6#B#x#7araGauaeahagar#par#Abz#pazaj#A#2#A.1#B#7#Q#7asaraK#2#2#A.W#A#6ararafab#2#7bsagaxaLaCbObSbNb2..........................................................",
+"......................................................................b2bCawbsayabbAayaBaCajaqaiayav.7ab.9#2#6at#6ahaeaq#2#0#Basad#1#B.W.5.2.W.2#Q#R#6aqat#Q#6aA#Q.3#A#2#B#0#R#BaSav#3#Eawb.aCbU..a2bO..........................................................",
+"......................................................................bY..bjaZataAaHaQaNaHaGaMau#0arauai#6#2#6.9#2#2#2afa.#1#6#Aa..V#C.R.R.U.5.2.5.5#R#Q#1.9#Rai#3#7auarauaQau#6aKbxb.a7bibia5bP......aY........................................................",
+"............................................................................bQbObyaiaMaHaNaQaMaraq#5#6aq#6a9av#p#B.Sa8#p#0#6ab#Qar#2#1#m#1#CbD.2.2..bzawbN#U#2#6#6.9ar#Q#Q#Rat#6aqafaqaear#7aZbPb7..#9bf........................................................",
+"..............................................................................bYb8bCanbna9araiaj#6#3#2#Qar#R#Q.9.R.xa.ao#5#z.5#6#R.4#p.S#BbW..bQbbbpaj#4#A#A.V#Uaq#2#2aqar.9.9#6#2#x#2#Rar#0#dbjbdbe#hbd........................................................",
+"............................................................................b2bqaJaJaNazaian#4aj#5#B#2#9#0#B#B.7.M#8aaai#6#6#R#6#A#Q.5.w.w.9.9a7#5ar#z.3#Q#B.S#y#B.4#Q#z#Q.9#Q#U#2bza##R#2#3a.aVa2#t.B.B........................................................",
+"............................................................................be#lbcbpaa#4#MbCbRai.9.U.5#rbV.9#p#B#x.9#Q#Rataq#R#A.2.V.V.x.L.y#d.S.5.W.W.3.5#Q.3.9.5.5.y.R.8awao......a##A.5.5a5aX#e#H.M#t........................................................",
+"....................................................................bsbWbpb#aV#F#raXbCbqan#5bza3#C.5.5#1#Q#Q#K#Q#B.5.U#R#6.x#R.5#f.9.L.y.y.x.R#m#B#y.3.2.T.R#Q.1.2#A.S.2bQaw#kbD..a5#6.9#m.T#Ba6a4aU.p....bl#H..................................................",
+"..............................................................bQbnbuaJatau#p#5b#bQ#FbNbqbabVbgbbb8#O.2.P#q#7#Kb#bP#B.q#m#p.j#p.9#A#A.W.V.R.U#E#f.Vai#la9aj#5.1#pan#6#UavbW.7bp..b8bVbd.2#Q.2.9#Babbf##aUbNaUbg..................................................",
+"............................................................b#ataQaQaQaM#3aoac#oaXacbfbqbqbq#sa6bb.r.l.d.e.nbbaY#M.9.R.2#C.h#U.V.R.V.y.W#A#6as.9#4#U#7ata9bnanay#y#1#0aw..bP....bV#KaW#p#6az#7ai#7bububmaLaybabO................................................",
+"......................................bBazb4................bf#0aRawatataKaKanaKaGaJasaqakanaL#Oaz.K.C.e.e#s.E.D#Oaj.2.4.3.xasai#Q#Q.L#f#Q#U#6#W#5.Jam.Yam#4al.9#zai#6avbQ.5#5bFbYadao#5ana9bzbFaz#5auaLayaKaAbO................................................",
+"........................................a5b#bQ..............b8b8..adb.azaKaGaRaMasar#4#Uaiat#0bean.N#q.n.eayaz#N#5#4.7.L.x.w#A.5#Q.9.5.y#f.R.y#Q.7.N.9auataHaMaI#P#z#U.9#A.5.L#0bnb3bVaWavaJao#4ajbPadb3#8#p.Mb1................................................",
+"..........................................a#a7bD............bqbCaLaoaFajaLaFaMataG#UauaFaMataHaM#K.9ai.9.2an#Ual#6avaY.raU.O.9.9.R.V.V.R#x#xaq#A.R.V#QauaGaJai#U#U#6#K.4#C#paw#3bF..b2#1aaab#Q#M#0bYb1..bg#vaV..................................................",
+"........................................aWbzbjajbFb7........a2#la9bRawaiajaJaGaGaJak#U#ZaGaMaq#6au#0#6#6.9as#6.4#q.T.R.J.5.M#k.J.w.y.S#f.R.R.5.y.R.9#X#V#P.4.R#x#U#A#Q#3#E.5#z.5.Ra6..b1bzbQ#pa#................................................................",
+"......................................bU..#DbDa.a5bvb.bnbmbnbfavaMaJapazaFaHayasapataE#Z#6asaGar#Q#Q#0#Q.9#Ual#2#C.3#7.5.L.5#xax.2.9.R.R.V.3#Q.x.L.3.V.4.4.V.R#y#Q.Tbf#C#n.yac#2.8.2bP......bj..bS..............................................................",
+"......................................bfb2a.#3#7b0b#aj#2aN#T.5ar#R#2#5apapaJamaA#6aEas#WaIataj#2#Taba5a5#Mai.9#1bPb1bz#o.y.MaV.S.5#6#R#y.9.A.J.3.T.5.9.R.y.R.4.4#6.9#Bbz..a8bd#S#T#A#5........b3a2bQ............................................................",
+"........................................bRbj#G.R.Rbkbfb1.U.y.R.R.R.V.W#x#6akb3bV.9aFai#4atatajai#6ai#UaraG#W#6akazbnanad.g.x.n.J#1#k.x.u.L.p.p.y#x#R#z#R#A#m.3.y.3.R.y.yawa5.U#mbRab#6..b3..awab#5bNb3..........................................................",
+"......................................bza6..b1a1......a6.V.y.5.9.R.R#p#Q#p#5..bVawan#7aa..aza5#Q.5#AafaL#Ras#K#2#B#A.U#o.P.j.e.J.2#2#e.u#a.g.u.L.x.3#A.5.5.4#D.UbjaWa6#E.y#mbybYa6a5anbPbDbFaa#BbQ..............................................................",
+"........................................a#bf............#9#EabbFaW#1#M#7bYbR....b5........bOaiak#A#6aear#A.4#Uai#U.9#A#U.O.I.k#l.1##.U#k.v.p.x.L.3a8#d#f.V#m..b1b1......aVaWa..R.8.TazacbNbQbbb8b5..............................................................",
+"..........................................................bf.2azbQaoa5ab#4alapayaNbJba....b1aAaFai#U#6#R#U#T#Q#0aj#f.V.5.5.5.T#Q.8#5.2.l.x#Pai#p.L#nbP..aVbO............bjbjbja..N.9.4ah.L.9bDbR................................................................",
+"........................................................b2#pbf.Mbpa9b7aY#7as#U#WaGaHaHatbv#Q#z.8#C.3#4.9#2#6#A.N#4.1.W.9#2#p.4.1.4.r.k.4.G.6#y.x.za6............................#d#m.J.R.x.La8bf................................................................",
+"........................................................#D.3#5bRbgbzbq#T#W.1#TaqaiasaE#Y#Uak#1bR#3#Qai#p#W#U.4.9.J.3.5#Rak.Z.w.1#K#q###P.m.I.x.U.ya0a6..............................bVa6.1.3#7..................................................................",
+"..........................................................b5aWbvaLb3bQajac#K.F#0.8asaq#Q#p#J#Tasar.8.4#X.9as#T.4#Q#Q#0#Tar.1.g.H#1.q.Kas.Lak#p#5#3bU..............................bQbtb4bza5b3..b8..............................................................",
+"............................................................bYaYajbp......#W#S#Ta9at#6#Rai#Q#Uas#Uam.O#6#T#Qai#y#P#P#T#P.v.x.c.d.eak.O#4.N#J#4#1aa................................bQ..........bR................................................................",
+"..........................................................bP#WbB..b.bqbvbmayasaNaM#5.7aoal#p.8#U#Q.N.T#p#4.9.Na..3.4#y.T.7.O.g.k.g.H.Iav#y.2.9#2.Na6b4#8b1..b6..................................................................................................",
+"..........................................................bzbjbzbb#1ayaMaGaMbmataqazaUab.4#X#L#0#7#1.5.9#Q#Qal.H.m#0#1.v.T#q.c.e#b#b.g.U.3.G.J#P.U#e.u.L.9#P.8#Ubv..............................................................................................",
+"............................................................#9#U#2#Q#5#4#W#zas#6bDbRbFbfazan.Y.P.7.j#4.N.1.Z.m#l#l.j.b.#.c.d#b.d.b#.#b.F.v.k.v.Ta.b1#e.T.9.F#V.3bzbv..........b2................................................................................",
+"............................................................a7bfbC#P#Eaaa8##.n.OaFao#TaJayayam#d.e.d.j.e#5.J.8.j.v.3.2.d.n.c.e.c.#.e.d.v.T.N.L.9bPa6#l..b#.9.4.8.V#z.3.R.3aga5.2#0awbQ#Bbfb8....................................................................",
+"..............................................................b1bj.w.e#eaUb2..a9b#bfa9asaEaGas.2.7.j.d.d#o.r.j.M.s.r#j.d.j#O.d.c.e.c.b.l.T.y.Va7#c#nan.5.W.L.R.y.3#f.4#z.T.V#y.5#x#Q#2#0by.5.9bR................................................................",
+"..............................................................bvby#3#U.v.p#Taqai#o#t.C#oas#T#6.V#5.7#Q.O.d.r.I#q.2.m.sai#X#p.l.d.j.w.1.ga8bza.#E.C#.aobDa6#Cbza6.L#e.M.R.4#z.4#Q#W#Q#6bm#6.3.V#0b5..............................................................",
+"............................................................bQ#Qaiai#Mau#r.q#X#4.F.d#a.P#B#W.5.8#Q#yai#P.la3.e#r.N.Y.9aEataHas.j#X.g.g.9ax.7.F.y.T#Tbob3b6#4ac.5.Gb1#caVa8#0#7#0#6#L#5#1a.bP#Ebj.5b2............................................................",
+"........................................................bP#p#P#A#6asaras#L.s.D#4#oaFam#i#k.Z#M#T#W#W#W#y#6aHaE#VaF.Y#N.8ak.J#X.d.J.d.m.1ai.1.1.9.5aqaEb8bP#obz.K.1a.#8#naZ#B.9at#W#SacbY........bzb6bnb1........................................................",
+"....................................................bN#D.3#m.K#Q.T.4#A#UataTal#K#TasaFaz#Zak#W#UasaI#W#V.8#0#P.8.4.V.L#4#5.d.r.b.b.e.j#Naib#aaaiaIaF#Uay#T#Wai#W.6aa#1.5bp.O.Zbp#T.6#4.Nalbab2....ac.5#RbBb2....................................................",
+"........................................bPb2bD....be#n.5.9.5.2#pbD#q.y.y#0aFaM.9#0#zai#4#4aIaIas#6asas#y.U.1#6#Q#T.6#N.V#W#5.Y.j.D.naoat#P#T#P#V#W#S.8#q#TaJai#7#4.9#Makaray#Ea5#p#7.L#3an#0#Q#8bz.4.L#q#Bbzb2..................................................",
+"........................................aw#2#2.5.R.y.x.Lao.7.U.L.R#l.z.x.R.9#Q#Q#0#U#Uaiat#YaE#ZaE#6#Q.5#6#4#z#z.9aC#6.4aiaF.8.N#q.d.O#4#4#J#K#M.6al#0#K#Q#o.Y.F#l#4ay#Qaj#Q#k.q#u.Y##.j#ka5avao.5.q.Sbdb2......................................................",
+"..........................................#2#B.V.A.R.V#x#0.y.z.L.9.L.y.O#Q#7asaj#Q.4.4#B#Y#T#J#Vas#V#Q#W#z.1#T.9#yai#6.R#y#W#R#z#N.q#u.r.6#..Fak#V#X#Wboal.6#Z.8#W#k.X.6al#4.V.R.T.UaW.m.x.T#M.N.9.2.R#Aa5......................................................",
+"..................................bQbzb2...j.w.w.iac.M.M.O.g.r.q.p.J.m.q#o#8#4#U.5.9.9#UasaIaE#U#0aj.5.3.3.1.3.9.O.9.4.L.u.5.T.V.N.p.v.k#2#i.f.F.F#p#VaEaE#S#T#WaE#X.F.2.9#J.6.8.p.T.L.T.y.q#m#7#y#B.U.x.S.5a#..................................................",
+"..................................ayaMaNat.6.g.e.c.K.e.c.7.M.9aF#P.T.h.p#B#3azajbza5.1#7#2aiat#Z#W#Pai.3#p#Q.O.L.O.v.x.x.w.u.y.y.5.3.l.e.6#U.Z.s.f.f.I.8#T#S#W#X#Yay#Y#V.6#K#Q#P#T#J.8.3.y.L.3.9b2..#q.5bjbjbj..................................................",
+"...................................r.NaF#4#4.m#4ai#k.Z.Parar#W.8.l.2#man#4#p.1a7#Q#Paz.9#Q#4#z.9#W#T#oatakap.j.e.sam.6.O.J.g.j.y.T.L.T.MakaqaG#UaF.6.l.e.m#S#U.7.H.I#P#1ab.6.N.H.j.e.k.T.w.g.h.xa.......b1......................................................",
+"..................................bN.z#J#p#Mat.n.s#4amaTaFai#P.6.R.6#P#R.8#Q#W#K.7#U#Q.9#Q.9a7#p#T.6.8aD#W#TaMaK#K.C.z.K.j#N.#.b.g.h.h.k.G.k.O#n#J#S.j.g.e.I.O.Kaj.8#U#4#p.T.7#k#T.1#0.T.F.#.e.L#0.9.4..........................................................",
+"..................................bzalaKas#KataFaHaMar.9aH#T#T.J.L.T.1#J.T#J#J#J#Xai#W#V#Q#7#0#7aw.T.U.K.e#..C#oa3aHad#l.F.j.h.l.g.J.b.d.e.b.g.l.e.d.a.#.b.d.g.g.Z.M.m.N#y.G#Q.3#y.4#o#z.T.x.c.b.L#z#Rb.........................................................",
+"..................................aZ.xbFawaB#KaKaE#W.T#kasas#z.T.R.L.y.L.T.H#N.j.l.1.Y.v.d#sbzawb1adad.K.e.d#O.s.e.l.#.s.g.g.h.Q.L.e.g.j#s.M.u.L.H.v.a.a.a.P.g.g.l.x.d.e.x.R.y.V#B#y#U#Z.4#P#A.8.5.3#Q#Q#TbP....................................................",
+"..................................#w.e#g#O.7#W#X#S.N.Y#y#J.R.R.L.L.6ay.l.l.e.l.h.a.D#b..#a..bcbR..b1#r.e.d.T.N#Q.x.6.J.#.e.c.g.k.G.z.f.#.#.e.y.N.F.G.v.M.7.#.f.n#g#E.5.2.U.G.u.4.R.V.R.4.V.9.L.T.y.5#B.R#z#Aa5..................................................",
+"....................................#g.c.c.d.j.N.e.N#P#z.1.L.4.8#J.4#M#g#c#..#.a.PbQbN..#sbc#v....bO.d.#.a.q.k.L.J.D.a.#.#.#.l.g.j.d.g.b.J#S.8#S.0.H#Q#P.T.l.Mbf#CbDb2b1aWaW.1ab.U.u.u.L.1.L#kbjbj.k.x.L.L.y.y#E................................................",
+"....................................#w.e.d.##l#iarat.1.L.N.y.K.j.C#ba9b5bDbFbR.rb8b8b3bc.o.a.EbN...o.d.a.a.E.a.#.D.o.#.d.#.b.o.b.g.b.k.H#J#T#4.F#S.6.T.H.U.1a5..#qabbP....bgbTb2bya6.g.v.9#4.vbjbg..b1.T#y.5.h.e#g..............................................",
+"..................................b3bebq#b.Jaj#4.7.2.j.l.x#4.g.ebrb3bRbCbD#6bnb2b3.....E#w.a.E....#j#..d.n.s.a.a.a.a.a.a.n.d.d##.b.g.e.e.m#l.Z.K.9.r.b.J.F.gbP..bU..........b1#3ava6a0b#b2#ub1........aW.Ra8bRawa...............................................",
+"....................................bvajal#QayaF.d.#.#.j.#.c.#.saYbWbg..b3b7b7b6..bS#b.#.a.o#bbNbQ.d#s.q.N.e.M.#.#.o.a.a.a.#.e.v.g.K.D.s#bbgaW.r.j.v.j.d.r.la3................bzbOb1..........................b1b2..............................................",
+"..................................a4bOanaqazamad#b#9#M.r.P.7#abDbnbq..............bSa4.e.a.#.o.d.E.s.f.e.a.j.D.#.a.n.a.a.a.#.b.b.O.O.N#9bcao#N#b.j#9bB##.l.l.H#1aLbz............................................................................................",
+"..................................b2bqbVbnbfaFaIaTaNaMboaJboapazbpb3........bcbNbQ.t.o#v#c.a.a.s.f.a.f.d.d.J.L.g##acb1.f.a.#.#.#.#.b.q.obcaW.7.Zb6....bX.2.N.8.Q.6.0............................................................................................",
+"....................................bQ......bVaoakbnapboan#4ama9br............b1bN.dbqaX.t.a.a#b.a.a.a.r.8.N.l.6.P.l##bt#u.#.#.b.b.#.oaY#c.d.##.#n#E.Gaba5.kbjbP.v.Q.8bB........................................................................................",
+"..............................................bVbqbqbQbRa3bDb8..............bcbc#c#ba4#v.o.a.a.a.a.a.#.j.e.M.5.g.x.r.6.J.K.a.#.#.#.a.a.a.a.a.aaY....b1bPbjbc....................................................................................................",
+"..................................................bVb5b3bV................b5aX.l#NaH#YaF#N#i.C#Q.1#K#0arar.9#p#q#q.H.j.o.a.#.b.#.#.a.#.a.f.j#Rba....bP.v....................bz....#n.xawb1......................................................................",
+"............................................................................bq.#.1#V#U#UaMaOaEasasasar#R#Rag#6#P#d.9.N.2#6.O.b.#.#.a##.t.n.H#5bn......................bFbvaZ#C.Ub2.5#1a7........................................................................",
+"......................................................................bzanaEaH#K#J#T###SakaEas.T#y#P#0.3#y#y.4#1#B.8.L.3#K.1.e.g.#.d.d.E.abc................b1..aW#1a5bt.8.1.U.F#mb#............................................................................",
+"....................................................................#ZaMaIakak#T.0az.K#o.0.T.L.x.y.4#Q#y.8.3.T.T.9.8.T.G.m.q.y.L.w.j.#.a.o................aN.8.T.G.T#J.k.z.v.Q#Pas#Rb.bP........................................................................",
+"..................................................................bVazaiaJ#u.2#4.o.f.j.O.I.L.1.l.G#U#U.8.V#z.R.Q.g.y.R.y.9.j.n.g.w.M.r.o#c..............a8.3.8.V.V.1#4aV#c#t.5.4.4.4#PbCb2..bmb4................................................................",
+"....................................................................bPbQbOb1aV#s.w#m#2#6.V.y.x.L.T.4#y#y.R.L.G.F.T.3.R.T.y.L.y.p.q.c.d.o#c......b3......#E.M.K#n#f.u.W#R#Q.O##.g.K.k.T#Saz#0#W#8b1..............................................................",
+"..............................................................................#f.y.w.L.T.y.T.w.w.J.L.Q.T.3.R.y.8#A.L.y.u.x.M.y#B.L.2.k.qaZaV..b4b3bb#N#nbBaW.n#g#t.L.R.G.T.1#Uaq#T#Jbz.L.3#Qai#zarbF............................................................",
+"..............................................................................a1.z.h.y.y.h.h.u.w.N.T.8.4.T#W#y.G.q.y.u.y.y.p.V.p.p.J#m#5.y.y.xbUbNb7bzbOa8.L.T.S#D#Ha8#pa.#y#Q.4.8b#b1bObOb6b#.7.xag............................................................",
+"................................................................................#E.w.y.u.y.Q.k.h.k.1.y.g.b.h.k.h.k.k.x.h.i.w.w.g.v.#.b.w.p#H.Ab2a6b1....#n.L.h.j.U.u.S#D#Ea..4.4.T#sb1.9a7bf#E#0.P.L#n..........................................................",
+"........................................................................bOaVa6a5.G.1.R.y.y.U.N.N.4.l.w.g.y.h.y.i.x.j#e.h.h.h.w.w.L.y.w.u#fa0..aV#8bDb2#8acb#.u.F.Ub1aZb1bPbj..bOa8.c.s#6ai#S.P.L#8#Ebj..........................................................",
+"......................................................................b4.9.9#x#Q.G.y.Q.j#Q.8#Q#P#a.g.h.k.i.h.u.k.k.y.h.n.g.h.c.L.h.w.w.y.ga8bgb1....#t.3......bOa8.T#nb2bjbO......#q.1#K.D.2.I.ebc..............................................................",
+"....................................................................b1#z#P#U.4.F.4#P#y.R.8.6.T#P.O.l.b.e.g.h.w.w.h.y.x.h.g.h.b.g.g.e.g.h.haX.g#bbOb1..bj..........a1.ka0bg#G#Gb1...L.R#2ai#4ay#k#c..............................................................",
+"............................................................bVb#ambLbjbPbj.8.s.M.N.v.v.4.M.z.g.l.j.T.G.x.T.V.T.T.T.R.w.e.i.L.g.#.e.N.v#Q#o.N.1.J.ea8..............bOa8......#G#D.U.x.5.R#P.xbj..................................................................",
+"............................................................b1#0#7ajbzb3.6.N.e.s.#.s.Y.1#7.b.a.a.d.F.F#6.O#9.v.v.G.5.T.g.h.p.h.g.eaa#4.P.N.O#E#T#2aq#2a.......................a6.LaV.4.V.R#zavbz................................................................",
+"..............................................................#4#5bm#T#Q.Y.7#XaEaFas#U.6#P.C.e.k.G.k#P#Q#qbPbPbO..aU.k.4.J.x.h.h.lai.8aw.2.d#9..aVbz#nb1........................bR......b2bR.ya.................................................................",
+"............................................................b#by.9aB.PaiazaDaIaHaG#T#U.T.k.h.e.v.0.8#P#7#Ra7aZ#m.U.JbyaW#1.O.c.c.j.5.1aiaJ.Dbn................................................b1bR..............................................................",
+"..............................................................azbtb#bvawaH#p.9#W#U#Z#W.u.I.1.Yat#6.m.l.Fa7b2b.#6a5bza8.TbD.J.#.b.g.F.u.x#RaFazajbs..............................................................................................................",
+"............................................................b2b.#m..b2#Caw#N#Kaj.6#0#J.N.4at#7#S.F.9as.8#Wb2..........#dbO.j.#.c.d.5.l.d.za..xaj#6a6............................................................................................................",
+"................................................................bma9b6b3bQbj.T.8#S#P.8#M.m.l.6.d.g.N#I.6.6a9..........b1b2.b.#.c.m.Ib#bfa.....#0#2#4b1..........................................................................................................",
+"..............................................................bjab#3#UbD..bPbRa#.5#y#P#Z#Z#4ba.6#oak.0#4#P#T............b4.e.a.b.4.O.2#Q.2..abbP....bP..........................................................................................................",
+"....................................................................bR..........bP.L.8#J#PaDbPb4aj#P#Waj#Ca6a5.............b.#.g.L#caV#Q#J..b1..................................................................................................................",
+"..............................................................................aiak#T#Tabb#.8......bP.9b#...................b.b.h#pa6bUbz.9......................................................................................................................",
+"............................................................................bBb1#pa3b6....b1..........b6...................n.#.e#Ba6b2bO#8......................................................................................................................",
+"....................................................................................................b##Saw................#g.b.ca8..b1bzbP......................................................................................................................",
+"....................................................................................................b4....................#s.#.b.M..bO..........................................................................................................................",
+"..........................................................................................................................aX.b.b.x..............................................................................................................................",
+"..........................................................................................................................aX.b.baV..............................................................................................................................",
+"..........................................................................................................................bc.b.bbe..............................................................................................................................",
+".............................................................................................................................c.baX..............................................................................................................................",
+".............................................................................................................................c.c#s..............................................................................................................................",
+".............................................................................................................................e.b#s..............................................................................................................................",
+"............................................................................................................................#a.e#s..............................................................................................................................",
+".............................................................................................................................z.e#t..............................................................................................................................",
+"............................................................................................................................#..c#s..............................................................................................................................",
+"............................................................................................................................#g.b#s..............................................................................................................................",
+".............................................................................................................................e.b#...............................................................................................................................",
+".............................................................................................................................e.c.#..............................................................................................................................",
+".............................................................................................................................g.c.b..............................................................................................................................",
+".............................................................................................................................g.c#...............................................................................................................................",
+".............................................................................................................................e.c#g..............................................................................................................................",
+".............................................................................................................................e.c#g..............................................................................................................................",
+".............................................................................................................................e.c#g..............................................................................................................................",
+".............................................................................................................................e.e#...............................................................................................................................",
+".............................................................................................................................g.e.e..............................................................................................................................",
+"..........................................................................................................................bS.e.e.e.............................................................................................................................."
+};
diff --git a/sounds/complete.au b/sounds/complete.au
new file mode 100644 (file)
index 0000000..33661e2
Binary files /dev/null and b/sounds/complete.au differ
diff --git a/sounds/identify-please.au b/sounds/identify-please.au
new file mode 100644 (file)
index 0000000..30a8e2b
Binary files /dev/null and b/sounds/identify-please.au differ
diff --git a/sounds/not-programmed.au b/sounds/not-programmed.au
new file mode 100644 (file)
index 0000000..d361ddb
Binary files /dev/null and b/sounds/not-programmed.au differ
diff --git a/sounds/thank-you.au b/sounds/thank-you.au
new file mode 100644 (file)
index 0000000..2c15213
Binary files /dev/null and b/sounds/thank-you.au differ
diff --git a/tclIndex b/tclIndex
new file mode 100644 (file)
index 0000000..2180613
--- /dev/null
+++ b/tclIndex
@@ -0,0 +1,29 @@
+# Tcl autoload index file, version 2.0
+# This file is generated by the "auto_mkindex" command
+# and sourced to set up indexing information for one or
+# more commands.  Typically each line is a command that
+# sets an element in the auto_index array, where the
+# element name is the name of a command and the value is
+# a script that loads the command.
+
+set auto_index(cont) [list source [file join $dir configure.tcl]]
+set auto_index(read_pipe) [list source [file join $dir configure.tcl]]
+set auto_index(action) [list source [file join $dir configure.tcl]]
+set auto_index(getyesno) [list source [file join $dir configure.tcl]]
+set auto_index(openfont) [list source [file join $dir configure.tcl]]
+set auto_index(fontselect_action) [list source [file join $dir configure.tcl]]
+set auto_index(opencolorsel) [list source [file join $dir configure.tcl]]
+set auto_index(openfilesel) [list source [file join $dir configure.tcl]]
+set auto_index(state_configure) [list source [file join $dir configure.tcl]]
+set auto_index(prec_ecran) [list source [file join $dir configure.tcl]]
+set auto_index(next_ecran) [list source [file join $dir configure.tcl]]
+set auto_index(creationscreennb) [list source [file join $dir configure.tcl]]
+set auto_index(creationentry) [list source [file join $dir configure.tcl]]
+set auto_index(mkecran) [list source [file join $dir configure.tcl]]
+set auto_index(set_language) [list source [file join $dir gettext.tcl]]
+set auto_index(set_catalogue) [list source [file join $dir gettext.tcl]]
+set auto_index(gettext) [list source [file join $dir gettext.tcl]]
+set auto_index(settext) [list source [file join $dir gettext.tcl]]
+set auto_index(_) [list source [file join $dir gettext.tcl]]
+set auto_index(lang_substr1) [list source [file join $dir gettext.tcl]]
+set auto_index(lang_substr2) [list source [file join $dir gettext.tcl]]
diff --git a/xglock/Makefile.in b/xglock/Makefile.in
new file mode 100644 (file)
index 0000000..2bdd57f
--- /dev/null
@@ -0,0 +1,204 @@
+# $Id : Makefile.in 4.04 1997/07/10 $
+#
+# xlockmore Makefile.in for autoconf (UNIX/VMS X11 support)
+############################################################
+
+# @SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@/
+
+N=
+O = .o
+#O = .obj
+C = .c
+# C = .cc
+S = $(N) $(N)
+#S = ,
+
+
+# please define
+# C as the C source code extension
+# O as the object extension
+# S as the separator for object code
+
+####################################################################
+# List of object files
+XGLOCKOBJS = xglock$(O)
+
+# List of source files
+XGLOCKSRCS = $(VPATH)xglock$(C)
+
+# default target
+all : @XGLOCK@
+
+# this tells GNU make not to export variables into the environment
+# But other makes do not understand its significance, so it must
+# not be the first target in the file. So it is here, before
+# any variables are created, but after the default target
+.NOEXPORT :
+
+SHELL = /bin/sh
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+datadir = @datadir@
+mandir = @mandir@/man1
+
+CONFIGDIR = $(srcdir)/config/
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTPGMFLAGS = @INSTPGMFLAGS@
+
+#CC = cc -g
+#CC = cc -Ac -g
+#CC = cc -Xc -g
+#CC = acc -g
+#CC = CC -g
+#CC = gcc -g -Wall -ansi -pedantic
+#CC = gcc -g -Wall
+#CC = g++ -g -Wall
+CC = @CC@
+
+#LINT = lint
+LINT = lint -Ncheck=%all
+#LINT = alint
+
+#DEPEND = makedepend
+DEPEND = @DEPEND@
+DEPEND_FLAGS = @DEPEND_FLAGS@
+DEPEND_DEFINES = @DEPEND_DEFINES@
+
+LN_S = @LN_S@
+RM = rm -f
+RM_S = $(RM)
+ECHO = echo
+
+#BLN_S = set file/enter=[]
+#RM = delete/noconfirm/nolog
+#RM_S = set file/remove/nolog
+#ECHO = write sys$output
+
+DEFS = @DEFS@ $(DEFINES) -DXGLOCKRC_FILE=\"$(datadir)/xlock/xglockrc\"
+XGLOCKINC = @XGLOCKINC@ -I.. -I$(top_srcdir)
+CFLAGS = @GTK_CFLAGS@ @CFLAGS@
+#CFLAGS = -O
+#CFLAGS = -g
+XGLOCKLDFLAGS = @XGLOCKLDFLAGS@
+XLIBS = @XLIBS@
+XGLOCKLIBS = @XGLOCKLIBS@
+#If you have purify, and want to use it, uncomment this definition or
+# run the make as `make PURIFY=purify'
+# or run configure with the --with-purify argument.
+PURIFY = @PURIFY@
+
+xglock : $(XGLOCKOBJS)
+       $(PURIFY) $(CC) -o $@ $(XGLOCKOBJS) $(XGLOCKLDFLAGS) $(XGLOCKLIBS)
+       @ $(ECHO) "$@ BUILD COMPLETE"
+       @ $(ECHO) ""
+
+.SUFFIXES : $(C) $(O)
+
+$(C)$(O) :
+       $(CC) -c $(CPPFLAGS) $(DEFS) $(XGLOCKINC) $(CFLAGS) $<
+
+install : @INSTALL_XGLOCK@
+
+install_xglock : install-program install-man install-ad
+       @ $(ECHO) "$@ COMPLETE"
+       @ $(ECHO) ""
+
+install-program : xglock
+       $(top_srcdir)/mkinstalldirs $(bindir)
+       $(INSTALL_PROGRAM) xglock $(bindir)
+
+install-man :
+
+install-ad :
+       $(top_srcdir)/mkinstalldirs $(datadir)/xlock
+       $(INSTALL_PROGRAM) $(top_srcdir)/xglock/xglockrc $(datadir)/xlock/xglockrc
+
+uninstall : @UNINSTALL_XGLOCK@
+
+uninstall_xglock : uninstall-program uninstall-man uninstall-ad
+
+uninstall-program :
+       $(RM) $(bindir)/xglock
+
+uninstall-man :
+
+uninstall-ad :
+       $(RM) $(datadir)/xlock/xglockrc
+
+install.program : install-program
+
+install.man : install-man
+
+install.ad : install-ad
+
+uninstall.program : uninstall-program
+
+uninstall.man : uninstall-man
+
+uninstall.ad : uninstall-ad
+
+depend :
+
+lint :
+       $(LINT) -ax -DLINT $(DEFS) $(XGLOCKINC) $(XGLOCKSRCS)
+
+xrdb :
+
+man :
+
+html :
+
+hlp :
+
+clean :
+       $(RM) *.o core *~ *% *.bak *.orig *.rej make.log MakeOut *.patch xglock
+
+distclean : clean
+       $(RM) Makefile
+
+clean.all : distclean
+
+# Adds all current dependencies to Makefile
+depend :
+       $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
+       $(DEPEND_FLAGS) --                                                  \
+       $(XGLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                 \
+       $(XGLOCKSRCS)
+
+# Adds some dependencies to Makefile.in -- not totally accurate, but pretty
+# close.  This excludes dependencies on files in /usr/include, etc.  It tries
+# to include only dependencies on files which are themselves a part of this
+# package. -w 0
+distdepend :
+       @echo updating dependencies in `pwd`/Makefile.in... ;               \
+       $(DEPEND) -w 0 -f -                                                 \
+       -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
+       $(XGLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                 \
+       $(XGLOCKSRCS) |                                                     \
+       (                                                                   \
+         awk '/^#.*Id : Makefile.in/,/^# DO .*distdepend/' < Makefile.in ; \
+         sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
+             -e 's@\.\./bitmaps@$$(BITMAPDIR)@g' ;                         \
+         echo ''                                                           \
+       ) > /tmp/distdepend.$$$$ &&                                         \
+       mv Makefile.in Makefile.in.bak &&                                   \
+       mv /tmp/distdepend.$$$$ Makefile.in
+
+##############################################################################
+#
+# DO NOT DELETE: updated by make distdepend
+
+xglock.o: ../config.h
+xglock.o: modes.h
+xglock.o: logo.h
+
diff --git a/xglock/README.xglock b/xglock/README.xglock
new file mode 100644 (file)
index 0000000..a396333
--- /dev/null
@@ -0,0 +1,12 @@
+Authors: Charles Vidal <vidalc@club-internet.fr>
+         Remi Cohen-Scali <r.cohenscali@pobox.com>
+         Eric Lassauge <lassauge@mail.dotcom.fr>
+
+Status: under construction
+
+This used GNU's GTK but now the fontsel widget have been
+integrated into GTK (since between 1.1 & 1.2 ?).
+The xlockmore package does not need the gtkfontsel
+library anymore. The root configure script has been modified.
+               Thank You !
+                                               R. Cohen-Scali
diff --git a/xglock/logo.h b/xglock/logo.h
new file mode 100644 (file)
index 0000000..56bcde9
--- /dev/null
@@ -0,0 +1,1107 @@
+/*
+ * logo.h: GIMP header image file format (INDEXED) for xglock
+ */
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)logo.h     1.0 99/11/16 xlockmore";
+#endif
+/* Copyright (c) E. Lassauge, 1999 <lassauge@mail.dotcom.fr> */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ *   Nov-99: Initial version.
+ */
+
+
+static unsigned int logo_width = 200;
+static unsigned int logo_height = 72;
+
+/*  Call this macro repeatedly.  After each use, the pixel data can be extracted  */
+
+#define HEADER_PIXEL(data,pixel) {\
+  pixel[0] = header_data_cmap[(unsigned char)data[0]][0]; \
+  pixel[1] = header_data_cmap[(unsigned char)data[0]][1]; \
+  pixel[2] = header_data_cmap[(unsigned char)data[0]][2]; \
+  data ++; }
+
+static char header_data_cmap[128][3] = {
+       {  3,  3,  6},
+       { 66, 81, 82},
+       {142,145,123},
+       {204,219,231},
+       {187,194,198},
+       { 79,107,146},
+       { 55, 62, 54},
+       {151,176,203},
+       {250,246,250},
+       { 39, 46, 43},
+       {151,149,130},
+       { 95,122,155},
+       {198,194,204},
+       {230,220,231},
+       { 18, 34, 28},
+       {146,158,172},
+       {177,175,175},
+       {125,123,115},
+       { 82, 78, 64},
+       {205,206,207},
+       {231,232,225},
+       { 24, 24, 27},
+       {186,159,121},
+       {  2, 18, 19},
+       {107,105, 85},
+       {144,131,103},
+       { 94, 90, 73},
+       {139,168,197},
+       {175,186,205},
+       {118,121,134},
+       { 22,  7, 69},
+       {214,209,210},
+       {168,163,172},
+       {251,240,249},
+       { 44, 67,100},
+       {118,146,180},
+       { 95,107,119},
+       { 16,  6, 57},
+       {112,133,159},
+       {153,161,181},
+       { 82, 89,101},
+       {188,185,184},
+       { 91, 89, 95},
+       {192,220,244},
+       { 81, 81, 92},
+       {106,106,113},
+       {243,242,247},
+       {131,148,175},
+       {185,211,236},
+       {211,201,212},
+       {124,130,145},
+       {149,145,156},
+       {186,187,204},
+       { 58, 81,114},
+       {198,201,223},
+       {151,152,164},
+       {241,230,238},
+       { 81, 67, 77},
+       {201,209,230},
+       { 18,  3, 20},
+       {215,206,220},
+       {253,252,252},
+       {164,190,217},
+       {204,224,247},
+       { 18, 18,  4},
+       {148,168,193},
+       { 62, 50, 87},
+       {  7,  7, 39},
+       { 79, 66,100},
+       { 63, 65, 83},
+       {162,175,197},
+       {163,154,162},
+       { 98, 82,105},
+       {172,197,222},
+       {174,176,196},
+       {143,135,116},
+       {213,212,224},
+       {113, 98,117},
+       {185,197,220},
+       {200,200,193},
+       {129,138,155},
+       {136,157,185},
+       {115,114,120},
+       {102,133,168},
+       {168,169,192},
+       {186,178,189},
+       {227,214,226},
+       {162,186,211},
+       { 52, 51, 48},
+       {185,206,231},
+       { 24, 18, 52},
+       {158,168,188},
+       {219,235,247},
+       {238,225,235},
+       {238,238,228},
+       {219,219,220},
+       { 68, 94,133},
+       {100, 96, 86},
+       { 34, 34, 34},
+       {129,143,162},
+       {232,233,244},
+       {154,159,169},
+       {158,153,160},
+       {195,189,205},
+       {134,137,117},
+       { 88,113,150},
+       {242,236,245},
+       {  2,  4, 28},
+       { 66, 64, 55},
+       {176,169,177},
+       {217,224,246},
+       {139,146,159},
+       { 19, 18, 21},
+       {121,110, 90},
+       {170,170,175},
+       { 38, 32, 68},
+       {134,130,141},
+       {218,222,236},
+       {203,200,207},
+       {182,176,190},
+       { 81, 98,107},
+       {142,137,145},
+       {162,160,167},
+       {219,212,222},
+       {164,182,203},
+       {229,226,234},
+       { 96, 96,103},
+       {115,108,114}
+       };
+
+static char header_data[] = {
+       123,123,60,19,19,49,118,49,118,49,118,49,49,118,49,118,
+       19,49,118,19,49,118,19,49,118,19,49,118,19,49,118,19,
+       49,118,19,49,118,19,49,118,19,49,118,19,49,49,118,19,
+       49,118,19,49,118,118,118,118,118,118,118,118,118,118,118,118,
+       118,118,118,118,118,118,118,118,118,118,79,79,79,4,52,28,
+       124,7,15,81,83,83,11,5,5,5,5,105,105,11,11,83,
+       83,38,35,99,35,81,81,65,65,7,70,70,124,124,7,7,
+       7,7,27,27,27,27,27,27,27,27,7,124,87,28,28,52,
+       52,52,41,41,52,103,103,103,12,79,79,79,12,79,12,12,
+       12,12,12,4,103,41,103,41,28,28,124,70,65,27,81,81,
+       47,35,35,83,83,11,11,11,11,83,99,81,70,124,28,52,
+       4,4,12,4,79,79,79,79,118,79,118,118,118,118,118,118,
+       118,118,118,12,41,41,31,20,
+       103,123,20,8,8,61,61,61,61,61,61,61,61,61,61,61,
+       8,61,61,8,61,61,8,61,61,8,61,61,8,61,61,8,
+       61,61,8,61,61,8,61,61,8,61,61,8,61,61,61,8,
+       61,61,8,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,8,61,8,61,61,61,61,61,61,8,8,8,8,8,46,
+       92,92,43,89,62,7,81,35,83,83,11,105,11,105,11,83,
+       83,35,35,27,7,7,87,62,73,73,73,48,89,48,48,48,
+       48,89,48,48,73,48,73,48,48,48,43,43,63,92,92,92,
+       92,92,92,92,92,92,92,94,46,46,46,8,61,8,61,61,
+       61,61,8,8,61,8,8,8,46,46,92,63,63,43,48,48,
+       73,62,87,7,27,27,35,35,35,35,81,124,73,48,63,92,
+       92,92,46,46,46,106,46,8,8,8,61,61,61,61,61,61,
+       61,61,46,95,79,85,118,20,
+       103,60,93,8,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,8,
+       46,92,63,43,73,62,27,35,83,83,105,5,5,5,5,105,
+       11,83,83,35,81,27,27,7,7,62,62,73,73,73,73,73,
+       48,73,48,48,48,48,48,43,48,43,48,43,43,43,43,63,
+       92,63,63,63,92,92,92,100,106,46,8,8,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,8,46,92,92,63,43,48,
+       48,62,62,7,27,27,35,35,83,83,35,27,7,62,89,63,
+       110,92,92,92,92,100,100,46,46,46,8,61,61,61,61,8,
+       94,93,123,41,102,116,109,123,
+       12,123,56,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,46,46,
+       92,92,63,43,73,62,7,27,35,83,11,105,5,5,5,5,
+       105,5,11,83,83,35,35,81,27,27,7,7,87,73,73,73,
+       73,73,73,89,48,48,48,48,48,89,48,48,48,48,48,48,
+       48,48,43,58,58,76,3,110,110,100,106,106,46,8,8,61,
+       61,61,61,61,61,61,61,61,46,61,8,46,92,92,63,43,
+       48,48,62,62,27,81,81,35,83,83,35,35,81,7,28,89,
+       48,58,3,3,117,3,63,117,92,92,100,106,100,20,125,13,
+       49,103,119,102,25,29,32,31,
+       49,95,106,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
+       61,61,61,61,61,61,61,8,8,8,8,8,8,8,61,61,
+       61,61,61,61,61,61,61,61,61,61,61,61,8,46,46,92,
+       92,63,43,48,48,62,7,27,27,35,83,83,105,5,5,5,
+       5,5,11,11,83,83,35,35,27,27,27,7,7,87,87,62,
+       73,73,89,89,89,89,89,89,73,73,73,73,73,73,73,73,
+       73,78,89,48,48,58,58,3,123,117,125,93,56,106,33,33,
+       61,61,61,61,61,61,61,8,8,46,46,92,46,92,63,63,
+       48,89,73,62,7,27,27,35,35,83,83,35,35,81,7,28,
+       89,89,3,58,3,58,3,76,76,76,58,31,60,118,103,41,
+       85,109,71,121,17,29,122,31,
+       31,125,94,61,61,61,61,61,8,8,33,33,33,33,8,8,
+       8,8,33,8,33,33,33,33,8,8,8,61,8,61,8,8,
+       8,8,8,8,8,8,33,8,33,8,8,8,8,8,8,8,
+       8,8,33,33,33,33,33,8,8,33,33,33,33,33,33,33,
+       33,8,61,61,61,61,61,61,8,33,106,46,100,46,106,100,
+       92,110,43,43,73,73,62,7,27,27,35,35,83,11,5,5,
+       5,5,5,105,83,83,83,35,35,35,27,27,27,7,87,87,
+       62,62,62,62,73,73,73,28,73,62,87,62,87,62,62,62,
+       73,73,73,54,58,58,58,76,3,86,110,13,100,56,106,106,
+       33,33,33,33,46,8,46,46,46,46,46,46,92,92,92,43,
+       43,48,48,62,62,27,27,81,35,83,38,83,83,81,65,87,
+       62,78,89,89,89,58,58,89,54,78,52,28,74,74,114,114,
+       32,122,71,51,17,82,32,19,
+       60,13,94,61,61,61,8,8,33,33,33,33,33,106,106,106,
+       33,33,56,33,33,106,33,33,106,33,106,33,33,33,33,33,
+       33,33,106,106,106,106,33,106,56,33,33,33,33,33,33,33,
+       33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,
+       33,33,33,33,33,33,33,33,33,46,106,106,100,100,92,125,
+       110,95,58,48,48,73,73,87,27,27,27,35,83,83,105,5,
+       5,96,5,5,5,11,83,83,35,35,27,81,27,27,27,7,
+       87,87,62,62,28,87,62,28,62,87,87,87,87,87,87,124,
+       4,73,78,89,19,58,58,76,3,86,110,117,13,125,100,100,
+       106,106,106,46,106,46,46,94,92,94,92,94,100,125,92,117,
+       43,48,48,89,62,62,7,27,81,35,35,38,83,47,27,124,
+       87,73,89,89,78,78,52,28,28,70,32,122,101,122,122,91,
+       122,101,10,121,17,82,32,31,
+       19,125,106,61,61,8,8,33,33,33,106,56,56,56,93,93,
+       93,93,93,86,86,49,12,49,12,12,49,12,49,12,49,12,
+       49,12,49,49,49,49,49,49,49,12,49,49,49,60,60,60,
+       60,123,60,123,60,123,60,60,60,60,49,60,60,60,60,60,
+       60,60,60,123,60,123,60,60,31,49,118,118,19,118,118,54,
+       78,4,4,28,28,124,7,27,27,35,35,35,11,11,5,96,
+       96,53,53,53,53,96,5,11,83,11,83,83,35,35,35,81,
+       81,15,15,15,65,65,65,15,65,15,65,15,15,15,15,65,
+       65,114,70,74,124,28,52,52,52,52,103,103,4,12,12,79,
+       54,19,19,118,58,19,19,58,19,19,19,118,54,79,78,4,
+       4,28,62,87,27,27,27,35,35,38,83,38,38,35,81,65,
+       70,124,78,28,28,124,70,70,39,91,39,39,101,39,122,122,
+       71,101,102,121,17,82,122,19,
+       19,13,94,61,8,33,33,106,56,56,93,93,13,13,86,31,
+       60,54,118,103,55,127,72,44,44,72,44,44,44,72,42,26,
+       97,97,77,97,97,77,97,77,97,77,77,24,127,127,127,127,
+       127,127,127,127,127,127,127,127,113,127,127,77,113,77,113,113,
+       127,113,127,113,127,127,127,45,127,127,45,45,45,45,45,45,
+       45,45,45,36,36,126,120,120,120,96,1,53,53,34,34,34,
+       9,9,9,14,9,9,34,34,34,34,34,1,1,1,1,1,
+       1,1,1,1,1,1,40,1,40,1,40,40,40,40,40,44,
+       40,40,40,26,126,126,36,126,36,126,36,126,126,45,126,45,
+       45,45,45,45,45,127,127,127,127,45,127,45,45,45,45,45,
+       45,36,126,120,120,40,40,96,40,40,120,5,105,29,38,35,
+       81,65,124,124,84,91,39,91,122,91,122,101,101,122,101,122,
+       102,102,51,116,29,82,122,19,
+       60,117,106,61,8,33,56,56,13,13,95,123,19,118,118,78,
+       103,52,119,84,80,127,44,72,40,42,42,42,42,36,127,29,
+       29,116,116,121,121,121,51,121,51,10,51,51,10,102,10,102,
+       102,102,102,102,71,71,71,71,71,71,71,122,71,122,71,71,
+       71,71,71,71,71,71,71,71,101,101,101,102,101,102,55,55,
+       55,55,55,10,55,55,111,111,99,50,38,83,11,5,5,96,
+       53,53,34,34,34,34,34,53,1,96,120,120,120,36,36,82,
+       11,11,29,29,38,29,29,29,17,38,38,29,38,38,50,50,
+       50,80,50,80,50,80,121,99,121,121,111,51,111,51,10,51,
+       51,10,102,102,102,122,102,101,102,71,71,122,122,71,10,51,
+       51,111,111,111,99,80,99,99,35,47,81,81,27,81,81,81,
+       81,39,65,91,91,91,91,91,91,91,39,39,101,101,102,55,
+       102,55,51,116,82,127,122,19,
+       31,13,106,8,8,33,106,106,93,13,95,86,76,19,54,54,
+       103,52,28,84,99,45,40,44,40,40,40,40,40,36,45,29,
+       29,50,50,121,121,51,51,51,102,71,122,32,32,109,109,109,
+       114,109,109,109,109,109,109,109,109,109,109,119,109,85,109,109,
+       109,109,109,109,109,109,109,109,109,114,114,114,114,114,114,114,
+       114,32,114,91,114,32,101,101,39,15,111,47,99,83,83,105,
+       5,96,53,53,34,34,34,1,96,120,5,105,11,11,29,83,
+       50,38,38,80,80,99,35,99,99,99,47,99,2,47,2,81,
+       111,55,111,15,55,55,102,101,101,55,55,102,102,101,101,32,
+       32,32,114,114,114,114,114,16,16,114,109,109,109,16,109,32,
+       32,32,32,91,70,70,124,28,62,62,7,27,81,35,35,35,
+       47,81,65,7,7,70,91,70,91,114,122,39,101,101,101,55,
+       55,55,2,116,82,127,101,19,
+       31,95,106,61,61,8,33,106,106,56,125,13,123,76,76,54,
+       54,78,52,74,111,105,40,44,96,40,96,96,120,5,36,105,
+       29,11,29,50,80,121,51,55,102,32,32,109,16,85,16,41,
+       41,41,41,41,41,41,41,41,103,41,41,41,103,41,103,103,
+       103,103,41,41,41,41,41,41,41,41,41,41,41,41,16,41,
+       41,41,41,85,41,16,41,16,70,114,91,65,15,47,99,38,
+       83,105,5,53,53,53,96,96,96,36,11,11,29,38,38,38,
+       80,99,99,47,47,111,81,15,15,15,81,15,15,15,101,101,
+       91,91,91,122,91,91,91,122,122,32,91,114,114,16,16,85,
+       16,41,41,41,0,0,108,14,64,59,59,90,57,0,103,103,
+       103,12,4,79,54,58,58,89,78,73,87,27,81,81,38,83,
+       35,81,39,91,91,70,70,91,91,39,91,39,101,101,55,55,
+       55,51,111,17,82,45,122,19,
+       76,13,94,61,61,61,8,33,33,106,106,100,13,110,117,76,
+       60,89,54,28,81,29,40,120,120,126,36,36,36,107,21,0,
+       0,0,0,0,0,50,50,111,55,122,32,109,119,41,41,103,
+       103,12,79,12,12,12,12,12,12,12,12,12,12,12,12,12,
+       12,79,12,79,79,79,79,79,12,79,79,4,12,79,103,41,
+       4,103,4,103,4,103,41,103,41,28,16,124,70,7,15,47,
+       99,11,11,120,53,96,96,96,5,105,11,38,38,99,99,99,
+       99,47,47,81,15,15,15,15,15,39,65,65,91,91,91,91,
+       91,32,114,91,32,114,114,70,16,16,119,28,119,52,52,4,
+       4,4,0,44,9,14,14,67,64,64,64,64,112,59,98,0,
+       0,31,76,95,3,117,3,58,89,73,87,27,81,35,83,11,
+       38,35,81,15,65,91,91,91,91,39,91,15,15,101,15,55,
+       55,51,51,50,82,45,122,19,
+       31,125,106,61,61,61,61,61,8,33,106,56,56,13,13,117,
+       76,58,54,52,81,29,120,126,36,11,105,105,0,21,26,2,
+       122,2,75,16,41,109,41,119,41,41,116,104,17,17,97,18,
+       108,98,64,64,59,19,31,19,31,79,31,79,79,31,79,19,
+       79,79,19,118,118,19,79,19,31,79,19,31,79,79,79,49,
+       79,79,49,79,118,79,79,12,79,79,4,4,28,70,7,81,
+       47,99,11,105,96,120,5,5,11,11,38,35,35,47,47,47,
+       81,81,81,15,27,15,65,65,65,70,91,70,91,70,7,114,
+       91,91,91,114,70,16,74,28,85,41,103,103,79,79,79,79,
+       0,127,101,3,6,98,64,64,59,59,59,59,90,23,59,59,
+       68,0,0,117,110,110,63,63,48,48,62,87,27,81,83,105,
+       11,38,99,81,15,65,91,65,91,91,39,101,101,15,55,55,
+       51,111,121,116,82,127,101,118,
+       19,125,94,61,61,61,61,8,8,46,106,106,100,125,110,117,
+       76,58,54,52,81,29,120,36,82,29,29,88,98,21,18,2,
+       122,2,75,114,4,79,79,19,31,123,95,125,95,20,20,20,
+       94,106,94,94,94,94,94,114,16,32,24,26,6,98,0,0,
+       0,79,19,76,76,76,76,76,123,76,76,76,76,31,31,31,
+       31,31,31,31,31,31,31,19,19,19,89,79,4,87,124,27,
+       47,35,83,11,5,105,105,11,83,83,35,47,47,81,81,47,
+       47,81,81,55,81,65,39,91,91,70,70,124,70,74,70,70,
+       70,74,70,84,70,74,28,52,52,4,79,118,19,76,76,0,
+       36,125,3,88,98,14,64,64,14,64,112,59,59,59,64,112,
+       64,68,0,0,0,110,110,92,63,63,48,73,87,81,35,105,
+       11,83,38,99,47,15,39,39,39,15,39,15,55,15,55,15,
+       111,111,121,17,127,45,122,19,
+       19,117,94,61,61,61,61,61,8,33,46,100,56,13,117,76,
+       58,58,89,52,81,50,120,36,11,38,38,64,14,14,18,2,
+       122,17,113,104,16,16,79,31,31,95,95,95,125,20,20,20,
+       20,94,94,94,94,8,8,8,46,46,8,8,8,8,8,8,
+       79,41,75,0,95,95,95,95,95,95,95,95,123,95,76,76,
+       123,123,123,123,95,76,76,76,19,58,19,89,78,62,70,27,
+       81,35,83,83,11,11,83,83,83,35,47,35,81,47,47,35,
+       80,38,38,99,99,81,15,65,65,7,7,70,124,124,124,124,
+       124,124,74,74,74,74,16,28,52,12,118,54,19,31,0,88,
+       19,101,98,9,14,6,6,108,69,57,57,108,98,59,59,64,
+       59,64,66,0,0,0,92,92,92,92,43,43,73,7,35,11,
+       11,29,83,80,47,15,15,65,65,65,39,39,15,55,15,111,
+       51,111,80,50,82,45,102,19,
+       19,117,106,61,61,61,8,61,8,33,106,106,125,13,117,76,
+       58,54,89,28,39,50,36,82,38,50,50,14,98,21,40,10,
+       2,24,113,113,104,32,41,4,79,95,95,125,125,20,94,94,
+       94,94,46,94,46,94,61,8,94,61,94,33,8,8,8,95,
+       12,31,61,98,95,95,123,95,95,123,95,95,123,95,95,95,
+       31,94,46,61,46,46,94,94,92,76,89,78,61,92,20,92,
+       3,117,3,3,3,43,3,3,73,117,63,63,3,3,38,58,
+       58,19,58,58,11,38,47,81,15,65,87,78,7,70,124,70,
+       70,70,70,70,70,74,74,74,28,52,103,118,49,0,69,18,
+       9,14,14,108,1,69,9,98,9,88,68,44,44,57,112,59,
+       59,59,67,72,0,0,0,100,92,46,63,43,48,87,81,83,
+       38,38,38,99,81,81,39,101,101,65,15,15,15,111,15,111,
+       111,111,80,29,127,36,102,19,
+       19,117,94,61,61,61,61,8,8,8,106,100,125,110,76,58,
+       54,54,12,52,39,50,36,29,50,47,111,21,98,14,18,114,
+       3,24,24,113,18,0,0,0,14,98,9,6,108,26,24,104,
+       75,32,114,79,31,125,20,94,94,94,33,94,33,94,31,22,
+       109,33,61,9,123,123,95,95,95,95,95,95,95,76,95,95,
+       61,61,20,31,95,3,76,94,61,117,79,89,61,3,78,78,
+       3,61,61,73,73,62,117,92,27,65,61,61,73,35,11,105,
+       3,61,65,36,120,105,38,35,81,27,4,61,7,124,70,70,
+       70,70,70,91,91,84,84,74,119,28,52,4,118,99,64,23,
+       64,64,108,69,88,14,0,0,0,0,0,69,72,57,57,112,
+       59,59,59,112,0,0,0,92,46,92,92,63,48,124,81,38,
+       38,38,80,99,81,39,65,65,91,39,39,55,15,55,111,55,
+       111,111,80,29,82,45,102,118,
+       31,125,46,61,61,61,61,61,46,46,106,100,125,117,117,76,
+       76,58,60,54,84,51,82,116,51,102,102,98,98,98,18,122,
+       31,17,24,24,24,108,67,107,67,59,0,67,107,107,107,67,
+       37,59,59,37,37,37,37,98,18,24,113,2,122,71,22,32,
+       79,8,8,9,123,123,95,123,95,123,95,31,95,31,95,61,
+       61,94,95,31,31,76,76,58,61,63,79,3,20,62,62,87,
+       89,61,61,7,87,7,7,61,27,27,61,61,70,83,11,11,
+       94,15,53,53,53,120,11,38,99,81,4,61,7,124,124,7,
+       70,7,91,70,70,70,74,74,74,74,119,52,0,9,98,64,
+       64,6,108,9,9,0,0,0,0,0,0,0,0,57,72,108,
+       64,59,64,0,72,0,0,0,92,92,3,58,73,7,81,38,
+       35,99,35,111,15,91,91,91,91,91,39,15,39,39,111,15,
+       51,111,99,29,45,36,102,19,
+       19,117,94,61,61,61,8,8,33,46,106,100,100,20,125,125,
+       117,13,13,123,85,51,17,116,51,102,101,98,9,9,18,122,
+       19,113,97,97,24,45,18,67,107,107,67,67,37,67,37,37,
+       30,37,37,37,37,37,37,37,37,37,37,37,88,25,2,2,
+       97,20,61,98,95,95,31,95,95,95,76,95,95,95,20,61,
+       61,95,76,76,76,76,19,19,95,3,79,89,79,41,28,28,
+       76,61,61,62,62,87,87,73,7,27,61,61,124,83,11,19,
+       76,53,34,34,34,96,120,105,11,35,4,61,65,7,7,70,
+       70,70,70,91,70,74,70,70,74,74,74,28,94,23,64,23,
+       34,9,9,9,0,0,0,0,0,0,0,0,0,0,72,57,
+       57,59,59,59,9,0,0,0,92,110,3,89,73,70,81,99,
+       99,47,81,15,15,91,65,91,91,65,91,15,15,15,15,55,
+       111,111,80,29,45,126,55,118,
+       118,95,94,61,61,61,61,8,33,106,106,106,100,100,56,20,
+       93,125,93,86,85,51,17,121,51,122,101,98,9,98,18,122,
+       79,113,26,26,97,97,24,18,67,37,107,67,107,30,115,115,
+       66,66,115,30,30,30,30,30,37,37,30,66,113,25,10,108,
+       26,94,61,98,95,95,95,31,95,95,95,76,95,95,61,61,
+       46,95,95,95,95,95,76,31,19,19,79,79,4,4,4,4,
+       95,61,61,79,78,4,62,28,7,7,61,61,124,38,58,94,
+       5,34,34,34,34,53,105,15,65,70,58,61,4,54,89,78,
+       7,70,70,70,70,70,74,70,70,74,16,74,2,98,0,64,
+       88,108,115,0,0,0,0,0,0,76,76,76,123,95,57,18,
+       72,59,59,59,90,0,0,0,117,110,58,89,73,124,65,81,
+       81,15,39,27,65,122,65,91,91,91,39,15,15,15,55,81,
+       111,111,99,17,82,36,101,79,
+       54,76,100,8,8,8,8,8,8,46,94,106,106,106,100,56,
+       100,93,93,86,103,71,17,121,51,122,122,98,9,9,18,101,
+       41,82,88,26,26,97,77,24,24,66,30,90,115,88,68,69,
+       88,115,42,68,69,68,66,115,115,21,72,113,25,75,75,90,
+       97,94,61,9,95,95,95,95,95,95,123,95,95,95,61,61,
+       46,76,95,95,95,76,95,95,31,19,49,118,118,118,79,79,
+       95,61,61,19,89,78,78,4,28,70,61,61,89,94,61,81,
+       96,53,34,34,34,53,47,61,61,61,61,61,61,61,61,61,
+       70,7,7,91,70,70,70,70,16,70,70,70,127,14,14,9,
+       9,6,14,0,0,0,0,31,76,76,123,95,95,86,86,72,
+       57,9,59,64,59,116,0,0,0,110,3,58,78,28,70,39,
+       91,91,91,91,91,70,91,91,91,101,65,39,55,15,15,55,
+       111,111,50,38,36,126,55,19,
+       4,19,117,106,106,46,8,46,33,33,106,106,100,106,106,56,
+       106,56,56,13,103,102,17,51,51,32,109,9,9,9,26,10,
+       41,82,21,18,26,97,97,24,113,24,24,69,69,69,98,0,
+       0,0,0,107,0,67,21,88,108,77,113,17,25,10,72,30,
+       42,20,8,98,95,123,95,95,95,95,95,76,95,95,61,61,
+       46,31,76,31,20,94,46,8,46,46,20,60,19,19,19,118,
+       125,61,61,19,19,19,78,78,62,124,61,61,58,92,61,61,
+       5,53,53,34,34,53,96,105,11,35,28,61,27,7,7,7,
+       70,7,70,65,70,70,70,70,84,84,70,74,1,64,6,88,
+       98,9,9,0,0,0,0,31,76,76,31,76,76,95,95,57,
+       68,57,59,112,59,18,0,0,0,100,3,3,89,78,87,91,
+       7,70,70,114,91,70,91,91,65,91,15,15,15,15,81,55,
+       47,2,80,17,36,36,55,19,
+       28,54,76,92,106,46,8,8,8,46,106,94,106,106,100,106,
+       56,100,56,86,41,102,116,75,71,32,0,88,6,98,26,10,
+       16,113,0,108,18,26,26,97,97,24,24,24,24,26,108,21,
+       67,67,64,59,112,108,18,113,113,113,17,25,25,25,30,30,
+       97,94,61,9,123,95,123,123,95,123,76,95,31,19,61,61,
+       61,19,19,31,31,76,95,61,61,20,123,31,31,60,60,76,
+       125,61,61,19,58,19,19,89,4,28,61,61,28,38,110,61,
+       94,96,53,34,34,96,120,5,11,38,87,61,15,65,65,91,
+       7,70,7,70,70,70,74,70,70,70,91,91,6,98,53,9,
+       98,98,9,0,0,0,0,19,19,31,31,31,123,123,86,57,
+       72,57,59,90,59,57,0,0,0,100,110,3,58,78,28,70,
+       70,70,70,70,70,70,91,91,91,101,65,15,81,111,55,47,
+       47,99,80,29,45,24,55,118,
+       28,78,76,110,100,100,46,46,33,8,33,33,106,33,106,94,
+       56,56,56,13,41,102,17,2,102,32,98,108,6,9,26,10,
+       16,24,107,21,18,26,26,26,26,26,97,97,97,24,97,97,
+       97,97,24,113,17,113,113,113,113,17,17,25,75,113,30,30,
+       26,94,46,9,76,95,95,76,95,95,76,76,31,79,20,61,
+       61,76,79,19,19,19,31,61,61,125,95,123,123,95,76,76,
+       20,61,61,95,76,19,19,79,4,28,61,61,4,35,35,94,
+       61,78,53,53,53,96,96,11,11,38,87,61,81,39,27,65,
+       65,70,70,70,70,70,70,70,70,70,70,7,44,1,1,9,
+       9,98,6,0,0,0,12,118,12,118,118,19,60,31,123,57,
+       127,57,21,90,64,57,0,0,0,92,110,3,48,78,87,91,
+       7,70,70,70,70,70,91,91,65,101,65,101,15,15,47,111,
+       111,99,80,29,36,120,101,79,
+       52,54,76,110,100,106,46,33,8,8,8,8,33,33,106,106,
+       106,56,93,86,41,55,17,121,102,0,98,108,6,9,40,10,
+       16,24,0,59,98,18,18,18,18,18,18,72,26,26,97,97,
+       24,113,113,113,32,94,61,94,31,17,75,25,12,61,33,17,
+       97,94,8,9,19,19,95,95,95,76,76,76,19,19,118,61,
+       61,61,19,118,49,19,31,61,61,20,76,95,95,76,123,123,
+       20,61,61,123,95,76,19,54,78,4,61,61,28,35,83,47,
+       61,61,73,53,53,96,5,105,11,38,124,61,27,65,65,7,
+       7,7,124,87,124,70,70,70,7,91,70,70,36,126,69,9,
+       9,14,108,0,0,0,74,119,52,52,103,12,118,49,60,115,
+       116,57,98,30,59,57,0,0,0,92,63,58,78,73,70,65,
+       91,91,70,70,70,70,91,91,65,65,15,15,15,81,15,47,
+       111,99,80,29,45,126,55,19,
+       28,54,3,110,100,100,8,8,8,61,8,8,33,33,106,106,
+       56,56,56,13,41,71,17,121,102,0,14,18,108,9,26,10,
+       16,126,107,0,59,88,18,18,57,18,57,18,18,18,26,26,
+       24,113,113,19,46,8,46,94,33,94,25,103,8,46,122,12,
+       41,20,94,98,24,42,50,41,95,95,76,95,19,19,54,19,
+       8,61,8,117,54,19,117,61,61,20,95,95,95,95,95,76,
+       94,61,61,20,123,31,76,19,54,54,61,61,125,47,38,11,
+       58,61,61,54,5,96,5,11,83,38,35,47,81,39,65,65,
+       7,7,7,7,7,7,91,70,7,70,7,70,97,36,1,69,
+       9,23,9,0,0,0,91,84,84,74,85,52,103,12,49,115,
+       51,66,115,98,64,57,0,0,0,110,3,89,28,124,91,15,
+       27,39,70,91,70,7,70,70,39,65,39,65,15,15,81,111,
+       47,99,104,29,36,36,55,19,
+       28,54,58,110,92,92,106,106,106,33,33,33,33,33,106,56,
+       106,56,93,13,41,102,17,111,10,0,98,18,18,6,26,101,
+       41,45,0,0,0,59,88,57,108,108,108,108,57,18,26,26,
+       97,24,17,20,94,20,41,113,122,125,95,8,8,16,21,17,
+       12,109,17,21,6,26,40,26,41,31,76,31,31,58,118,49,
+       118,110,8,61,61,61,8,94,125,76,95,95,95,95,125,46,
+       46,8,46,46,46,76,76,19,110,94,94,20,110,3,35,76,
+       58,58,89,54,58,38,5,5,105,83,38,35,47,81,27,65,
+       65,91,7,70,7,70,7,70,70,70,70,82,40,57,69,6,
+       108,108,66,66,9,9,66,9,88,9,9,9,9,6,6,108,
+       6,6,6,108,1,1,26,99,0,92,3,89,73,124,7,15,
+       101,65,91,91,70,91,91,91,91,70,39,15,101,15,81,55,
+       111,99,99,29,45,97,55,118,
+       52,78,58,117,110,125,100,106,106,33,33,33,33,106,106,56,
+       56,93,93,86,103,102,29,121,55,0,98,97,26,6,97,114,
+       41,45,0,107,0,0,0,88,108,108,108,108,57,57,18,26,
+       97,113,17,95,20,94,6,88,102,114,94,94,46,32,0,98,
+       16,97,88,9,97,122,16,97,29,76,95,76,31,31,19,19,
+       19,49,58,31,76,31,76,76,95,76,95,95,76,76,95,95,
+       76,95,95,95,95,123,123,123,19,78,78,28,70,81,35,35,
+       11,105,5,5,96,96,96,5,5,11,83,35,35,81,27,65,
+       7,65,7,7,7,7,70,70,124,124,82,9,108,108,69,66,
+       88,88,88,9,88,115,115,115,115,9,98,9,9,9,9,9,
+       6,34,6,108,1,108,1,18,15,0,0,54,28,124,70,27,
+       65,65,91,65,91,91,91,91,39,65,39,39,15,15,15,55,
+       47,111,80,29,82,36,55,118,
+       4,49,123,110,125,100,100,100,106,106,33,106,106,106,106,56,
+       56,56,93,13,41,102,17,111,10,64,14,24,97,6,24,114,
+       19,29,107,0,0,0,0,59,88,88,108,88,108,18,18,18,
+       97,97,82,31,95,20,40,0,98,122,125,12,20,20,122,114,
+       75,108,88,88,26,91,16,82,1,79,31,95,76,19,58,19,
+       19,19,19,60,31,31,76,123,76,76,31,31,76,31,76,31,
+       123,31,123,123,123,123,123,76,19,54,4,28,70,65,81,38,
+       83,11,5,96,96,96,96,96,5,11,11,83,35,35,81,81,
+       27,7,65,65,7,7,7,7,70,70,64,112,112,112,64,64,
+       64,59,64,112,59,64,59,64,64,23,23,23,23,23,23,23,
+       23,23,23,23,23,64,23,64,14,0,0,0,73,28,70,101,
+       65,91,65,91,65,65,39,91,39,91,101,15,101,55,55,55,
+       111,2,80,29,45,126,55,19,
+       118,76,117,93,100,100,100,56,106,106,106,106,106,106,106,56,
+       56,56,93,86,41,102,17,121,55,64,9,24,24,1,24,124,
+       31,17,107,107,0,0,0,59,21,88,108,88,108,108,18,26,
+       26,97,24,103,19,95,4,18,40,31,10,25,2,16,16,10,
+       26,18,6,88,18,45,50,26,6,41,58,95,31,31,60,60,
+       76,60,31,31,31,31,31,31,31,31,60,31,31,31,31,31,
+       31,60,31,60,31,31,31,123,76,54,54,52,124,70,27,47,
+       83,11,5,96,53,53,53,53,96,105,11,83,35,35,81,81,
+       81,27,65,65,65,70,7,7,70,70,23,64,112,64,112,112,
+       64,112,64,64,112,64,112,59,64,23,64,23,64,23,64,23,
+       64,23,64,0,64,23,64,112,14,0,0,0,78,62,124,91,
+       65,91,39,91,91,39,101,39,101,101,101,55,15,55,15,111,
+       111,111,80,29,45,126,55,19,
+       19,76,125,106,56,100,93,100,106,106,33,106,106,106,56,56,
+       56,93,93,13,41,102,17,121,55,64,9,24,17,1,113,41,
+       95,10,107,107,107,0,0,64,59,88,88,108,108,108,57,18,
+       26,97,97,10,79,76,76,76,95,4,17,17,17,17,17,113,
+       26,40,18,108,6,1,18,88,108,28,19,76,76,76,76,76,
+       31,123,76,31,123,31,123,123,31,31,31,123,123,31,31,31,
+       31,60,31,31,31,31,123,60,19,19,54,89,52,124,91,81,
+       38,11,105,96,53,53,53,53,96,5,105,83,83,35,35,81,
+       27,27,27,65,7,65,70,70,7,70,112,112,23,64,67,23,
+       112,112,112,64,59,64,112,23,112,64,23,64,23,64,23,64,
+       23,64,23,112,23,112,23,59,14,0,0,0,89,28,124,7,
+       70,91,65,65,101,15,65,101,15,101,15,15,55,55,55,55,
+       51,111,80,17,82,45,55,118,
+       31,95,100,46,106,106,125,100,56,106,33,106,106,106,106,56,
+       56,93,93,86,41,71,17,121,10,0,88,17,82,1,17,4,
+       20,10,107,0,107,107,0,64,59,9,108,88,108,108,57,18,
+       57,18,97,97,24,75,2,75,25,113,17,25,113,17,113,24,
+       97,126,40,18,108,6,6,98,44,52,4,12,118,118,54,19,
+       60,60,76,31,123,31,31,123,123,123,31,123,31,31,123,31,
+       31,31,123,123,123,123,123,123,76,19,118,54,4,62,70,65,
+       35,38,105,5,96,53,53,53,96,5,11,83,83,35,81,81,
+       27,65,27,65,65,65,65,70,91,70,64,59,112,64,112,64,
+       67,64,112,112,112,64,64,112,67,23,64,67,64,23,67,23,
+       67,23,64,23,64,67,64,64,14,0,0,0,58,89,28,70,
+       7,70,65,39,39,15,15,101,101,39,101,15,15,55,55,55,
+       111,51,99,17,45,36,101,118,
+       76,13,100,8,8,106,106,106,106,106,33,106,106,106,56,93,
+       93,56,93,86,41,102,17,121,55,0,9,104,104,40,17,79,
+       94,102,107,107,107,0,67,64,59,21,88,108,88,108,108,57,
+       57,57,26,97,97,24,24,113,113,113,113,17,113,113,24,26,
+       45,82,97,40,18,69,88,88,50,124,28,28,52,103,4,103,
+       54,118,118,118,60,60,60,123,60,60,31,49,60,49,49,60,
+       31,123,123,123,95,95,95,76,76,19,54,54,78,78,28,65,
+       81,35,11,5,96,96,96,53,5,5,11,83,35,35,81,81,
+       15,27,65,65,7,7,7,70,7,70,112,112,64,67,64,64,
+       64,67,64,112,64,67,64,64,64,23,23,64,23,64,23,64,
+       23,64,67,64,23,64,23,67,14,0,0,0,43,48,73,28,
+       124,91,91,65,15,15,15,15,15,101,101,101,101,15,101,101,
+       55,10,111,29,82,24,102,19,
+       76,13,100,8,8,46,33,33,33,33,33,106,106,56,106,56,
+       93,13,13,86,41,55,17,2,102,0,88,104,17,26,17,79,
+       94,32,107,107,107,107,67,21,0,64,98,108,88,108,108,108,
+       18,88,108,26,26,97,97,24,24,113,113,113,24,97,26,18,
+       26,17,82,45,42,44,57,120,39,70,70,74,124,28,28,52,
+       52,103,12,12,49,49,49,60,31,49,60,49,19,49,49,49,
+       19,31,123,123,123,123,95,123,123,31,54,118,78,78,28,84,
+       27,47,83,11,5,5,96,96,5,105,11,83,35,81,81,81,
+       27,39,65,65,91,91,70,70,70,70,98,90,98,98,115,112,
+       90,112,98,21,115,98,115,21,115,14,21,14,9,9,14,98,
+       14,14,14,21,14,14,14,14,9,0,0,0,110,63,48,78,
+       62,70,39,39,65,101,101,39,39,101,101,15,101,101,101,101,
+       55,51,111,17,127,36,102,19,
+       31,125,106,61,61,8,33,33,33,33,33,106,56,56,93,93,
+       93,93,93,86,41,102,17,121,101,0,6,2,104,120,104,19,
+       46,16,107,107,0,107,64,21,59,59,21,88,108,88,88,6,
+       26,18,108,108,18,26,97,26,97,97,97,97,26,26,18,18,
+       18,29,17,82,24,97,36,80,65,91,70,70,70,74,74,28,
+       52,52,103,118,118,60,60,60,60,60,60,19,49,49,118,60,
+       60,31,123,123,95,95,95,95,76,76,76,54,12,78,28,124,
+       65,47,80,11,105,5,5,96,5,11,83,83,35,35,81,81,
+       81,15,65,7,7,70,91,70,70,70,97,120,97,120,97,120,
+       44,120,126,44,44,44,120,120,1,68,44,68,68,44,18,68,
+       44,72,72,68,72,72,72,126,126,0,0,0,92,3,19,4,
+       28,16,91,91,101,101,91,101,39,101,101,101,101,102,101,102,
+       55,55,51,50,82,24,101,19,
+       19,125,94,61,61,8,8,33,33,33,106,106,56,56,56,93,
+       20,93,13,86,41,102,50,121,102,0,9,2,104,26,104,19,
+       8,16,0,107,107,107,112,98,0,59,21,21,88,108,88,108,
+       18,97,113,97,98,108,57,18,26,18,26,26,18,18,57,108,
+       57,18,26,45,127,82,47,91,91,91,91,91,70,74,28,119,
+       52,103,103,118,49,60,31,123,123,31,60,60,19,49,49,60,
+       31,123,123,95,13,95,13,95,123,31,19,54,78,52,62,84,
+       65,81,35,11,105,5,5,5,105,11,83,83,35,81,81,27,
+       27,39,65,91,7,7,70,70,70,70,50,45,127,127,36,36,
+       126,126,126,126,126,126,44,18,120,72,72,72,72,77,126,126,
+       126,126,77,77,77,77,77,77,29,0,0,0,117,58,54,28,
+       28,70,91,32,91,122,122,122,122,122,122,122,122,122,32,122,
+       71,55,51,116,82,45,102,19,
+       19,95,106,61,8,8,33,33,33,33,106,106,106,56,93,56,
+       93,93,93,13,41,102,17,2,102,0,88,2,10,97,104,31,
+       46,16,107,107,107,107,112,9,21,64,88,88,18,18,72,26,
+       113,77,24,18,88,98,98,88,88,57,57,18,57,57,18,108,
+       108,18,26,24,29,27,91,65,91,91,91,91,74,74,74,52,
+       52,12,118,118,49,31,31,123,31,60,60,60,60,31,31,125,
+       46,31,95,86,95,95,95,95,95,19,49,54,78,52,124,70,
+       39,47,35,38,83,83,83,87,62,83,35,35,81,81,81,39,
+       65,65,65,91,70,70,70,70,70,70,126,44,97,40,120,120,
+       97,120,44,44,1,18,69,44,18,44,68,68,44,68,44,68,
+       44,72,72,44,72,72,72,126,126,0,0,0,58,54,4,52,
+       74,114,122,91,122,122,91,32,84,84,32,84,32,109,32,109,
+       32,71,102,116,17,127,122,19,
+       19,95,106,61,61,61,8,33,33,33,33,106,106,106,56,56,
+       56,93,13,86,41,10,17,111,10,0,88,10,10,24,104,31,
+       8,16,107,107,107,107,21,18,72,113,113,25,25,113,113,72,
+       57,26,113,97,26,57,88,9,98,21,64,64,21,98,98,9,
+       98,108,97,9,39,65,91,7,7,70,70,91,70,74,74,123,
+       100,100,106,106,106,106,13,31,46,94,94,94,106,123,61,61,
+       61,123,123,123,123,95,95,123,123,76,49,54,78,78,28,124,
+       65,39,81,47,35,81,61,61,3,81,81,81,81,65,65,65,
+       65,70,7,91,91,70,70,70,70,70,120,126,126,97,120,120,
+       120,120,44,97,120,44,120,1,18,66,44,72,72,72,68,72,
+       126,72,72,72,77,77,77,77,120,0,0,0,58,54,52,74,
+       74,84,122,122,39,32,32,84,109,109,109,109,109,109,109,32,
+       32,71,51,121,17,127,122,60,
+       118,95,100,8,8,8,46,33,33,33,33,33,106,106,56,93,
+       93,125,93,86,85,102,17,121,10,0,6,10,2,24,104,95,
+       8,79,107,67,9,126,116,109,22,22,22,25,72,98,21,98,
+       98,88,108,97,97,26,18,108,88,98,21,64,64,59,64,112,
+       9,122,95,98,65,7,70,91,70,70,70,91,70,74,28,28,
+       12,100,61,61,46,31,60,31,123,46,61,20,123,76,95,61,
+       61,95,95,123,86,31,123,123,76,19,19,118,4,28,74,124,
+       91,27,39,81,47,81,28,61,117,81,81,39,65,91,65,91,
+       70,70,91,91,7,84,91,70,70,74,97,126,97,36,97,120,
+       97,44,44,44,44,44,44,120,44,44,44,44,44,44,72,44,
+       68,72,77,42,72,72,72,126,126,0,0,0,58,78,52,28,
+       74,84,32,32,32,32,32,109,84,109,109,109,109,109,109,109,
+       32,32,71,116,17,127,122,19,
+       49,95,106,61,8,8,8,33,33,33,106,106,106,106,56,93,
+       93,13,13,86,85,51,17,121,55,0,6,10,2,24,104,31,
+       20,101,88,29,51,12,95,94,10,72,90,59,59,59,21,21,
+       98,21,98,98,98,98,98,98,21,21,64,59,98,59,37,30,
+       18,79,20,98,91,70,70,70,70,70,74,74,124,74,74,74,
+       52,103,94,61,61,13,123,123,125,61,20,95,123,95,95,61,
+       61,76,123,31,123,31,31,31,19,54,118,103,52,28,124,7,
+       91,65,65,65,65,65,78,61,125,91,65,84,7,70,70,70,
+       91,70,91,39,91,91,91,91,91,84,44,40,120,40,18,44,
+       44,18,69,44,1,44,18,1,44,68,44,68,44,68,44,68,
+       68,68,68,72,72,72,72,44,44,0,0,0,58,54,103,28,
+       74,74,84,84,84,84,84,109,109,109,109,109,109,109,32,32,
+       32,71,51,75,82,127,122,19,
+       19,95,20,33,33,33,106,33,106,106,106,56,56,93,93,93,
+       93,93,13,123,41,102,17,121,10,0,6,15,10,97,104,31,
+       126,88,21,127,55,45,18,115,98,88,98,98,98,98,21,21,
+       98,98,98,98,21,64,21,64,21,21,21,21,90,59,30,37,
+       18,31,56,98,91,7,70,70,70,70,124,70,74,74,74,74,
+       52,52,54,61,61,61,123,95,61,20,95,123,95,123,95,61,
+       61,31,76,123,31,31,31,19,49,118,12,54,52,28,28,74,
+       70,70,70,70,70,70,54,61,125,70,124,70,84,84,84,91,
+       84,39,39,39,55,55,55,55,55,15,82,26,120,120,120,44,
+       44,44,44,1,44,18,44,120,40,44,72,44,72,44,72,72,
+       68,68,68,72,44,44,126,77,127,0,0,107,123,58,54,103,
+       41,74,109,84,16,16,16,109,74,109,84,109,32,109,109,32,
+       71,71,51,116,29,77,71,19,
+       118,86,100,33,33,33,106,33,56,56,56,56,56,93,93,13,
+       13,13,13,123,85,102,17,51,102,0,14,10,10,36,104,41,
+       6,98,67,0,107,107,67,90,21,115,21,115,112,21,21,90,
+       90,112,112,90,112,90,112,90,90,90,115,90,30,30,30,30,
+       18,95,94,9,91,91,70,70,70,74,70,70,70,70,74,74,
+       28,52,103,19,61,61,106,61,93,123,95,95,95,95,95,61,
+       61,95,123,123,123,106,33,33,61,56,60,118,12,103,52,54,
+       100,61,61,8,19,28,19,61,100,74,76,125,100,110,84,84,
+       91,39,39,55,51,111,121,111,51,47,82,82,36,97,120,97,
+       44,1,44,44,44,126,18,44,44,68,69,44,44,68,72,68,
+       18,44,72,72,126,77,77,77,36,0,0,0,93,13,76,49,
+       12,103,119,119,119,74,119,109,109,109,32,32,32,122,122,122,
+       102,51,121,17,127,126,102,19,
+       118,123,93,33,33,33,33,56,106,56,56,93,13,13,13,86,
+       86,86,86,60,85,51,17,121,10,114,0,104,2,24,17,24,
+       98,108,108,40,40,18,18,18,44,26,72,42,26,18,57,18,
+       108,57,57,57,57,57,18,18,42,72,77,82,17,121,2,101,
+       16,20,46,98,91,70,91,84,70,84,74,70,84,84,91,84,
+       74,119,52,103,95,61,61,8,76,76,95,123,95,123,95,61,
+       61,31,76,95,61,46,60,49,20,61,8,49,49,118,13,61,
+       106,118,13,61,61,103,76,61,100,52,103,8,76,119,84,84,
+       84,84,122,39,15,51,99,111,111,15,40,36,44,126,44,1,
+       44,1,44,18,44,44,1,44,1,68,68,68,72,57,72,68,
+       72,44,68,72,44,44,72,126,44,0,0,0,106,13,123,76,
+       118,12,41,41,119,119,74,16,84,84,32,32,101,102,55,51,
+       121,80,50,127,36,126,111,79,
+       19,86,56,33,33,106,33,56,56,56,93,93,13,86,13,13,
+       86,86,86,60,41,51,17,121,102,109,16,104,2,120,26,24,
+       32,79,41,16,114,91,32,41,79,95,95,76,79,49,4,41,
+       41,16,16,114,16,114,16,85,41,4,79,31,123,13,20,20,
+       94,46,8,98,91,70,70,91,70,91,84,91,91,91,39,39,
+       84,74,74,28,54,61,61,61,20,60,123,31,123,123,95,61,
+       61,123,31,20,61,13,60,49,60,61,61,20,60,60,61,61,
+       60,49,49,123,123,118,95,61,56,76,106,103,85,28,119,119,
+       84,84,84,84,32,39,71,39,55,39,44,40,1,1,69,69,
+       18,40,1,1,18,69,1,108,6,68,108,69,68,68,68,68,
+       68,68,68,72,69,72,69,72,44,0,0,0,106,93,95,123,
+       118,118,103,41,85,119,109,109,32,32,101,71,55,51,51,111,
+       121,116,50,36,126,120,51,79,
+       19,95,56,33,33,33,56,56,56,56,93,93,93,93,13,86,
+       13,13,13,86,85,71,17,51,10,32,91,17,2,120,17,19,
+       41,16,114,114,114,114,41,19,125,20,125,20,125,95,76,31,
+       19,79,19,79,79,19,19,19,76,95,95,125,20,20,20,46,
+       46,46,8,9,65,91,91,70,7,70,91,84,39,39,91,91,
+       84,84,74,41,8,19,94,61,61,123,31,31,123,31,31,61,
+       61,123,123,61,61,125,60,60,60,8,61,106,60,13,61,61,
+       49,118,49,49,49,12,123,61,46,61,61,12,52,85,52,52,
+       103,52,52,74,74,74,84,91,84,91,126,44,44,1,1,1,
+       44,1,44,1,69,44,1,69,69,66,66,68,66,68,68,66,
+       68,68,68,68,68,72,68,44,126,0,0,0,33,106,13,31,
+       60,103,103,41,41,119,74,109,84,91,122,55,51,55,111,80,
+       80,50,50,82,126,126,51,79,
+       19,13,106,33,33,33,33,56,56,56,56,56,93,93,93,93,
+       93,93,13,86,85,71,17,111,102,114,16,17,104,26,17,79,
+       41,16,32,32,16,41,31,20,94,94,20,20,20,20,20,20,
+       117,125,95,125,95,125,20,125,20,20,20,20,94,94,94,46,
+       8,46,8,9,70,124,84,70,84,91,91,91,91,32,39,91,
+       91,84,28,46,19,28,103,61,61,61,31,60,31,123,123,61,
+       61,60,31,61,61,20,60,49,60,46,61,46,60,13,61,61,
+       49,49,12,49,12,49,86,61,100,20,61,106,103,52,103,103,
+       12,103,103,103,52,74,74,91,39,39,36,44,120,126,120,44,
+       120,97,120,120,120,97,97,44,44,57,72,72,57,72,72,72,
+       72,44,72,77,72,72,126,68,36,0,0,0,61,94,125,31,
+       19,103,41,85,119,16,84,32,122,71,55,55,111,80,121,80,
+       116,50,29,82,120,126,111,118,
+       49,123,93,33,33,56,56,56,56,56,56,56,93,93,56,93,
+       93,93,13,86,41,51,17,75,10,32,114,26,24,1,24,79,
+       41,16,16,16,4,19,95,20,94,94,94,94,94,94,20,20,
+       20,20,20,20,95,95,31,31,19,79,79,79,79,41,16,16,
+       16,41,114,37,70,70,124,70,124,70,70,84,91,91,84,84,
+       84,28,8,76,52,52,52,118,61,61,8,49,31,49,60,61,
+       61,123,31,8,61,33,60,123,60,106,61,13,31,13,61,61,
+       13,49,49,49,60,118,95,61,106,103,61,61,100,103,103,12,
+       12,54,54,103,52,28,74,84,84,91,44,1,18,44,40,6,
+       1,108,69,18,44,69,69,1,108,69,57,57,68,44,57,72,
+       68,68,18,68,72,68,66,66,44,0,0,0,8,106,13,31,
+       118,103,85,74,109,32,84,122,39,55,55,51,111,121,80,50,
+       50,29,11,36,126,120,111,79,
+       118,31,13,56,106,56,56,56,56,56,56,56,56,93,93,93,
+       93,93,93,86,85,51,17,121,102,32,16,64,1,26,1,24,
+       17,17,24,26,24,1,26,10,114,114,41,41,16,4,4,79,
+       79,79,19,95,31,41,114,16,41,41,4,79,19,98,124,124,
+       70,70,16,70,74,74,74,74,74,70,74,84,74,70,84,74,
+       76,46,8,41,103,12,103,12,94,61,61,94,123,60,86,61,
+       61,123,31,13,61,61,13,123,123,61,94,60,60,60,46,61,
+       61,123,60,20,106,49,100,61,46,12,60,61,61,13,12,54,
+       49,12,78,103,52,28,74,74,84,84,23,64,112,23,64,64,
+       64,23,64,112,64,112,64,112,64,59,59,59,112,59,59,59,
+       59,59,37,59,59,59,64,64,90,0,0,0,100,125,76,118,
+       12,28,109,84,32,101,102,55,55,15,111,111,99,80,50,50,
+       38,29,82,36,126,126,111,54,
+       12,60,13,56,56,56,56,93,93,56,93,93,93,93,93,93,
+       13,93,13,86,85,102,17,121,10,109,114,16,41,0,88,120,
+       104,104,24,113,101,108,26,20,20,20,20,95,95,95,31,31,
+       95,19,31,3,95,95,79,79,4,41,114,122,109,21,124,70,
+       70,74,124,74,70,74,84,74,74,74,74,74,74,85,52,123,
+       100,100,100,106,60,12,118,106,106,106,46,106,94,93,94,46,
+       46,106,60,60,95,46,61,106,8,56,49,49,49,49,49,106,
+       8,61,8,93,60,13,106,106,106,125,31,106,106,106,13,12,
+       12,12,103,103,52,74,74,74,70,70,112,64,59,64,64,64,
+       112,64,64,64,67,64,67,64,64,64,59,64,59,64,59,64,
+       59,64,59,64,59,64,59,59,112,0,0,0,117,58,54,103,
+       74,74,39,39,39,55,39,15,55,47,111,111,80,80,50,50,
+       50,29,29,36,120,120,111,118,
+       12,60,13,56,56,56,56,93,93,93,93,93,93,13,93,93,
+       93,86,93,60,85,102,17,121,102,109,16,16,41,41,41,41,
+       0,88,24,24,24,9,98,88,88,6,6,6,6,6,6,88,
+       6,6,6,108,108,26,108,108,18,18,18,18,97,0,124,124,
+       74,70,84,84,84,74,84,84,84,119,74,85,85,52,103,103,
+       103,12,12,12,49,49,49,49,60,49,123,60,123,60,60,60,
+       60,49,60,49,60,60,49,49,49,49,49,49,49,49,49,49,
+       60,60,60,31,60,19,19,49,118,118,118,54,12,78,103,12,
+       103,103,28,85,28,74,74,74,74,84,112,23,64,64,59,23,
+       64,112,64,64,64,64,64,64,59,59,64,59,64,59,64,59,
+       64,59,64,59,112,59,64,59,112,0,0,0,76,89,78,52,
+       74,84,39,39,39,81,55,81,55,55,47,47,111,99,80,38,
+       38,38,29,36,126,126,111,79,
+       49,86,93,33,33,33,56,56,93,93,86,93,86,93,86,93,
+       86,93,93,86,85,51,17,2,102,32,109,16,85,16,41,85,
+       41,124,0,23,97,14,21,21,64,64,64,64,64,21,98,98,
+       9,9,88,9,97,0,70,65,65,65,91,70,70,91,70,70,
+       70,84,70,84,84,84,84,74,74,74,119,74,28,85,103,103,
+       12,103,49,49,49,60,60,60,60,123,60,123,60,60,86,60,
+       60,60,60,60,49,49,49,49,49,49,49,49,49,49,49,60,
+       60,60,31,60,60,49,118,54,12,12,103,103,52,103,52,52,
+       52,28,119,119,74,74,74,74,70,74,64,64,64,64,64,59,
+       64,67,112,64,64,59,64,64,64,64,59,64,59,23,59,64,
+       59,23,59,23,59,64,59,59,112,0,0,0,58,54,78,28,
+       70,91,39,55,15,15,55,15,15,15,55,47,111,99,80,80,
+       50,50,29,82,120,126,111,19,
+       49,86,93,33,33,56,56,56,93,56,93,93,93,93,93,93,
+       93,86,93,86,41,102,17,121,102,114,109,109,16,109,114,32,
+       91,122,101,55,24,24,18,9,21,64,64,64,64,14,98,98,
+       9,6,108,26,24,26,0,0,91,91,91,91,70,91,91,91,
+       91,84,91,91,91,84,84,84,84,74,74,74,52,119,52,103,
+       103,103,54,49,49,49,60,60,60,60,31,123,123,60,60,60,
+       86,60,60,60,60,49,12,12,12,12,49,12,49,49,60,60,
+       60,60,60,60,60,118,54,12,103,52,52,28,119,28,119,74,
+       119,74,74,74,74,74,84,74,74,74,112,112,59,64,64,64,
+       64,64,64,67,64,23,64,112,64,59,23,59,64,59,112,0,
+       112,59,64,59,64,59,64,64,90,0,0,0,58,89,28,28,
+       124,91,39,39,15,15,15,15,55,15,15,51,111,111,99,99,
+       80,80,38,82,36,126,111,79,
+       49,123,56,33,33,33,93,93,93,93,93,86,93,93,93,93,
+       13,93,13,86,85,51,17,121,10,32,122,122,122,122,0,6,
+       108,9,6,9,1,24,17,26,108,88,9,88,6,18,24,2,
+       10,114,114,16,91,25,41,31,79,40,0,65,91,39,39,91,
+       65,65,65,91,39,91,65,84,70,84,74,74,74,52,52,103,
+       12,12,12,118,60,60,60,60,31,123,123,31,86,31,86,31,
+       60,86,60,60,60,49,49,12,12,103,12,12,49,49,49,49,
+       60,60,60,49,49,12,103,52,52,52,28,85,28,119,74,119,
+       74,74,74,74,84,84,74,109,84,84,0,64,23,64,64,64,
+       23,64,64,64,64,64,67,64,67,112,59,112,59,59,59,64,
+       59,64,59,67,112,112,112,90,0,0,0,0,58,54,73,28,
+       70,91,39,15,55,15,55,39,39,81,55,15,47,55,55,111,
+       99,80,38,29,36,126,55,19,
+       49,60,13,56,56,93,93,86,13,86,13,13,86,86,86,86,
+       13,86,86,60,119,51,29,116,111,101,55,55,111,111,26,75,
+       75,25,6,64,21,21,23,14,14,98,9,6,26,17,16,31,
+       20,94,20,20,95,20,20,94,94,46,94,10,65,91,91,39,
+       91,39,91,84,91,91,84,84,70,84,84,74,119,52,52,103,
+       103,12,49,54,60,19,60,60,60,31,123,123,60,31,60,60,
+       60,31,60,60,60,60,49,49,49,49,49,49,49,49,49,49,
+       49,12,118,103,103,103,52,74,119,74,84,84,74,74,74,74,
+       74,74,84,74,74,84,74,74,74,74,74,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,48,78,28,74,
+       70,91,39,39,39,91,39,39,55,39,55,15,51,47,55,111,
+       111,121,50,29,36,126,111,19,
+       103,49,86,13,13,13,86,86,13,86,86,86,86,86,86,86,
+       123,123,76,49,84,121,82,50,80,111,111,99,99,80,80,0,
+       9,26,24,108,88,17,2,122,41,19,95,125,94,94,94,94,
+       94,94,94,94,46,46,94,125,117,95,10,127,91,91,91,70,
+       84,70,84,70,84,84,70,84,84,74,74,84,74,85,103,103,
+       12,49,12,49,49,60,60,60,123,60,60,31,60,31,60,60,
+       123,86,86,123,86,86,60,60,49,49,49,12,103,103,103,103,
+       41,52,119,52,74,74,84,84,91,84,84,84,32,39,32,39,
+       32,84,84,84,84,74,74,74,74,74,74,74,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,58,54,73,124,
+       70,39,39,39,55,39,55,15,39,55,47,55,111,111,111,99,
+       80,80,50,29,126,36,55,118,
+       103,49,86,93,93,93,86,93,86,86,13,86,86,86,86,86,
+       123,60,58,54,114,80,45,29,50,38,50,50,50,38,80,50,
+       99,99,0,14,0,14,21,98,98,9,9,9,9,9,108,88,
+       88,6,88,14,67,0,0,91,91,91,91,91,91,70,70,70,
+       74,74,74,28,74,74,28,28,74,52,52,52,52,103,12,49,
+       12,49,49,60,60,60,60,60,86,60,60,60,60,86,123,123,
+       123,31,31,31,31,31,49,49,49,12,118,12,103,52,28,74,
+       74,28,74,124,74,124,74,124,84,70,84,91,84,84,84,84,
+       84,84,84,119,74,74,74,28,28,52,52,28,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,58,78,103,74,
+       70,91,39,39,15,15,55,15,55,15,51,47,55,99,111,111,
+       80,80,50,29,36,126,10,118,
+       103,49,86,93,93,93,93,93,93,13,86,86,86,86,60,123,
+       123,58,49,4,39,50,36,36,29,50,50,50,38,50,50,80,
+       80,111,15,15,101,91,70,70,114,70,16,74,74,74,74,28,
+       124,74,28,28,28,28,70,70,74,70,70,74,28,74,74,28,
+       52,28,52,52,78,103,103,103,12,12,12,54,49,49,60,49,
+       60,60,60,60,60,60,86,60,86,86,123,86,31,123,31,60,
+       60,31,31,19,118,118,118,54,12,78,78,4,28,28,28,28,
+       28,124,28,28,62,28,62,52,62,28,28,28,28,74,74,74,
+       85,119,52,85,52,85,52,52,52,28,78,52,28,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+       0,0,0,0,0,0,0,0,0,0,0,54,58,78,28,28,
+       70,39,39,55,15,55,81,55,55,55,55,55,111,111,121,111,
+       80,116,50,127,36,126,55,19,
+       49,60,13,93,56,93,93,86,86,86,86,86,86,60,60,60,
+       49,54,12,52,55,29,36,36,82,38,38,80,99,99,47,47,
+       15,39,91,70,70,74,74,124,74,74,124,28,28,28,28,52,
+       28,52,28,28,28,52,28,28,28,52,28,28,52,78,103,52,
+       78,54,78,54,54,54,49,54,54,60,60,60,76,76,123,123,
+       60,123,60,86,86,86,86,86,123,123,31,123,31,60,19,19,
+       54,54,78,54,78,78,78,78,78,78,52,73,52,73,52,73,
+       28,62,62,28,73,52,73,78,78,78,78,78,78,12,78,103,
+       54,103,103,103,52,103,52,52,52,52,78,78,78,78,78,4,
+       78,4,78,52,78,52,78,4,78,78,78,78,78,78,78,4,
+       78,52,78,52,52,78,52,78,78,78,78,54,54,78,28,74,
+       84,39,39,55,55,15,55,55,55,15,55,55,51,55,111,51,
+       111,80,50,82,36,126,51,118,
+       49,86,93,56,56,93,93,93,93,93,86,86,86,86,60,118,
+       54,103,52,70,47,82,120,36,11,50,80,99,47,27,91,70,
+       124,62,78,78,78,78,78,52,78,78,52,78,78,78,52,78,
+       78,78,52,103,4,78,78,78,78,89,54,54,54,54,58,58,
+       58,58,76,76,76,76,117,86,117,117,123,117,123,13,117,13,
+       13,13,13,86,86,86,86,86,60,123,76,58,58,58,89,54,
+       54,89,54,78,78,89,78,89,78,73,89,73,89,73,89,78,
+       89,78,78,78,73,78,78,78,78,54,54,58,60,76,123,123,
+       123,76,60,54,49,54,54,54,54,58,54,58,58,58,58,58,
+       58,58,58,58,58,58,58,58,60,58,76,58,60,58,58,58,
+       58,58,54,58,89,54,89,54,54,54,58,54,54,78,52,74,
+       74,84,39,39,39,71,39,55,15,55,55,55,55,55,55,51,
+       111,121,80,29,45,126,55,19,
+       49,86,93,33,33,33,56,93,93,93,86,86,60,58,12,103,
+       52,28,74,114,99,82,40,45,29,80,47,39,70,124,4,89,
+       89,58,3,3,58,58,58,58,54,58,54,54,54,58,54,54,
+       54,54,54,54,58,58,58,60,58,58,76,3,76,76,117,117,
+       13,125,93,100,56,100,56,56,56,100,56,106,100,56,56,100,
+       93,93,125,13,13,117,76,76,60,58,76,58,58,58,58,48,
+       89,48,89,48,89,89,89,73,89,89,89,89,89,89,89,89,
+       89,89,89,89,89,54,54,58,58,76,117,110,125,100,100,106,
+       106,106,100,13,13,13,13,13,110,110,13,13,100,110,100,110,
+       125,110,125,110,125,110,117,110,110,110,110,110,110,13,117,117,
+       117,117,117,123,117,76,117,76,76,76,76,117,123,60,54,52,
+       74,84,84,122,39,122,39,122,39,39,39,39,39,102,39,102,
+       55,51,121,29,127,36,10,19,
+       49,13,106,8,33,33,56,93,13,86,60,54,12,52,52,124,
+       74,91,91,101,80,29,36,50,111,114,124,4,78,54,58,58,
+       76,117,110,110,125,125,100,125,110,13,110,117,117,123,117,123,
+       123,117,117,117,110,13,125,100,93,100,100,100,100,100,106,106,
+       46,8,8,8,8,8,61,61,61,61,61,61,8,8,8,46,
+       106,100,100,92,110,110,3,76,3,76,58,58,3,3,3,3,
+       3,3,43,43,43,43,48,43,43,48,43,48,48,48,58,48,
+       58,3,58,76,58,76,76,117,13,100,56,106,46,8,61,61,
+       61,61,8,8,8,8,46,46,33,46,46,8,46,8,46,46,
+       46,46,106,106,100,56,106,106,106,106,106,106,106,106,106,106,
+       106,106,106,106,100,106,100,100,100,100,100,100,100,117,60,54,
+       103,85,84,109,84,84,84,32,32,32,32,32,32,32,32,122,
+       101,102,51,116,82,45,101,118,
+       118,31,13,106,56,13,123,60,12,12,52,52,74,84,84,122,
+       32,39,39,122,55,51,111,91,4,76,76,76,117,76,110,110,
+       110,100,100,106,106,46,46,8,8,106,106,106,46,100,106,100,
+       106,56,56,106,46,106,46,46,46,46,46,8,8,8,8,8,
+       8,8,8,8,8,8,8,61,8,8,8,61,8,46,46,92,
+       46,92,100,110,110,110,110,110,63,110,110,117,117,3,117,63,
+       110,63,110,63,63,63,63,43,63,43,63,63,63,63,110,110,
+       110,110,117,110,110,125,93,100,106,46,8,8,8,8,8,8,
+       8,61,61,8,8,61,8,8,8,8,8,8,8,8,8,8,
+       8,61,8,8,8,46,46,46,8,8,8,61,61,61,61,8,
+       8,61,61,61,8,8,8,8,8,8,8,8,33,100,13,76,
+       54,103,119,119,109,109,74,109,74,109,84,84,84,84,84,109,
+       32,101,55,121,82,127,122,19,
+       119,103,58,76,76,54,54,103,103,52,85,74,119,84,84,84,
+       32,84,109,84,84,84,109,85,52,54,12,12,103,12,103,103,
+       12,12,79,54,118,118,118,118,118,118,118,118,118,118,118,118,
+       12,118,118,118,79,54,118,118,118,118,118,118,54,118,79,54,
+       118,79,118,79,54,79,4,12,4,4,4,52,28,52,28,28,
+       28,52,28,4,4,4,73,28,28,28,74,74,74,74,74,28,
+       28,28,28,28,73,73,73,73,73,4,73,4,4,4,4,52,
+       52,103,103,103,103,54,118,118,118,118,118,118,118,118,118,54,
+       118,79,12,54,79,12,79,118,12,79,12,118,79,118,118,118,
+       79,118,118,118,118,19,118,118,118,118,118,118,118,118,118,19,
+       118,118,118,118,118,118,118,118,118,118,118,118,58,60,76,76,
+       118,103,74,84,74,84,109,84,109,84,109,84,109,32,32,122,
+       102,55,51,116,82,45,102,19,
+       74,52,78,60,58,49,49,58,54,49,54,12,12,103,103,52,
+       85,85,52,85,85,85,119,119,109,109,109,84,109,109,16,109,
+       109,109,109,119,119,119,119,119,85,85,119,119,119,119,109,85,
+       119,109,119,119,85,119,41,85,41,41,52,41,41,119,74,16,
+       74,91,91,122,39,39,39,39,15,15,15,15,15,15,81,15,
+       81,55,81,15,81,15,15,15,55,15,15,15,55,55,51,55,
+       15,55,15,55,55,55,55,15,39,101,39,91,91,91,84,84,
+       84,84,74,16,74,16,74,85,119,119,119,119,119,119,119,119,
+       16,74,119,16,74,109,84,16,84,16,84,16,74,119,119,119,
+       85,41,41,103,41,103,103,41,41,41,85,85,119,85,119,85,
+       85,85,85,85,85,85,119,16,109,109,84,122,122,39,122,91,
+       101,101,122,102,122,101,101,71,122,102,71,102,122,71,71,71,
+       51,51,116,17,77,24,55,118,
+       119,103,60,123,86,117,86,123,86,123,86,60,60,49,49,49,
+       103,103,103,85,119,109,109,109,109,109,119,109,109,109,109,109,
+       109,109,119,109,109,109,109,109,109,109,109,109,32,109,109,109,
+       32,109,32,122,122,122,122,39,122,122,122,122,122,91,122,101,
+       101,15,55,15,111,111,111,47,111,111,111,111,99,99,80,80,
+       99,47,99,47,99,47,47,111,47,47,111,47,111,111,47,111,
+       111,15,55,15,55,15,55,101,101,122,122,122,32,109,32,109,
+       109,16,16,16,119,119,119,119,119,16,109,109,109,109,109,109,
+       109,109,109,109,109,109,109,109,109,109,109,32,109,84,109,109,
+       109,109,109,109,109,109,109,109,32,32,122,122,71,71,71,122,
+       71,71,122,122,122,122,122,71,122,101,55,55,55,55,111,51,
+       51,55,111,111,51,51,55,55,102,39,71,122,32,122,122,71,
+       71,102,121,116,127,45,102,19,
+       12,49,13,100,93,93,93,13,13,13,13,86,86,60,12,12,
+       103,119,109,109,32,32,32,32,109,109,109,109,109,32,32,109,
+       32,32,32,32,32,32,32,32,32,32,71,32,71,102,55,51,
+       51,51,51,121,121,80,116,116,80,80,80,99,99,111,111,47,
+       111,111,47,111,47,99,111,47,99,47,99,99,99,99,99,80,
+       80,80,80,80,121,99,111,111,111,55,51,55,55,55,55,55,
+       55,55,55,15,102,101,101,122,122,32,32,32,84,109,109,109,
+       109,109,109,109,109,109,109,109,109,109,109,109,32,109,32,109,
+       109,32,32,32,32,32,32,32,32,32,32,71,71,71,122,32,
+       71,32,71,32,71,71,71,71,71,71,51,71,51,51,51,51,
+       51,51,51,51,51,51,102,102,51,102,55,55,15,55,55,15,
+       51,55,55,55,55,102,102,122,122,32,32,32,32,32,32,32,
+       71,71,51,121,82,127,122,19,
+       49,123,93,33,33,106,56,93,93,13,86,60,49,12,85,109,
+       32,32,71,71,32,71,71,32,71,32,71,71,71,71,71,71,
+       71,71,71,51,71,51,51,51,121,51,51,121,121,121,116,80,
+       50,50,50,50,29,29,11,29,82,29,29,50,50,38,80,80,
+       38,80,80,80,80,80,80,50,80,50,80,80,80,80,80,80,
+       121,80,121,121,111,111,111,51,51,111,55,111,51,51,51,51,
+       51,55,55,102,102,71,71,102,122,122,122,122,32,32,32,109,
+       32,109,32,109,32,32,122,71,71,71,71,71,71,71,71,71,
+       71,71,71,71,71,51,71,51,51,51,51,51,51,51,51,51,
+       71,51,71,51,71,71,51,71,51,71,51,51,51,51,51,51,
+       51,51,51,51,51,51,51,51,51,51,51,55,55,55,55,55,
+       55,55,55,55,102,102,71,71,122,122,32,32,32,32,32,32,
+       122,71,102,116,82,127,122,19,
+       19,95,93,33,33,56,56,93,86,60,49,103,109,109,71,71,
+       51,71,51,71,51,71,71,51,71,51,102,51,51,51,51,51,
+       51,121,51,121,121,121,116,121,116,50,50,50,29,29,29,29,
+       29,29,82,11,29,82,29,11,29,11,29,29,50,29,50,50,
+       50,50,38,50,38,80,80,50,80,80,116,116,80,121,111,121,
+       121,111,121,121,121,51,121,51,51,51,51,51,51,111,51,51,
+       111,121,51,51,51,51,51,51,51,51,71,102,102,71,51,71,
+       102,51,102,51,51,51,51,121,121,121,121,121,121,116,121,116,
+       121,121,121,121,51,121,51,121,51,51,51,51,121,51,121,121,
+       121,121,121,121,121,51,121,51,51,51,51,51,51,51,51,121,
+       121,121,121,121,121,121,51,51,51,51,51,51,51,51,51,51,
+       51,51,51,51,51,55,55,102,71,102,102,71,71,71,71,102,
+       51,51,121,17,127,97,55,118,
+       49,86,93,33,56,93,86,49,103,119,109,71,71,51,51,51,
+       121,121,121,121,121,121,51,121,51,51,51,51,51,121,121,121,
+       121,121,121,116,116,29,50,29,29,29,29,29,29,29,29,82,
+       82,82,29,82,82,11,82,82,29,29,29,50,29,38,29,29,
+       50,50,50,50,50,116,50,80,50,116,80,50,121,116,121,121,
+       121,121,121,111,51,121,51,51,121,121,121,121,121,121,80,121,
+       116,121,116,116,80,121,121,121,121,121,121,121,121,121,121,121,
+       121,116,116,25,116,116,17,17,17,17,17,17,17,17,116,116,
+       29,116,116,116,116,116,116,116,116,116,116,116,116,116,116,29,
+       29,116,29,116,29,116,116,116,116,116,116,116,116,116,116,116,
+       116,116,29,116,29,116,116,116,116,121,121,116,116,80,116,116,
+       80,121,121,121,121,121,51,121,121,51,51,121,121,121,121,121,
+       116,116,29,45,126,42,51,118,
+       12,118,60,13,49,41,109,71,51,116,116,116,17,116,113,116,
+       82,116,29,17,29,17,29,29,29,17,82,29,29,29,82,82,
+       82,82,82,82,45,45,45,45,45,45,45,126,45,126,36,36,
+       36,126,36,36,45,36,36,45,36,36,45,36,45,45,82,36,
+       45,127,82,82,127,127,82,82,82,82,29,82,29,29,17,29,
+       29,29,29,29,29,29,29,29,29,29,29,82,82,82,127,127,
+       45,127,127,127,45,127,127,82,127,127,113,82,113,82,127,127,
+       127,127,77,77,77,77,77,77,77,77,77,77,77,127,77,77,
+       127,77,127,77,127,127,77,127,77,127,77,77,77,77,77,77,
+       77,45,77,45,45,77,45,77,45,77,77,77,77,77,77,126,
+       77,126,77,126,77,77,77,45,45,45,82,127,82,127,82,82,
+       127,82,82,82,82,82,29,82,82,82,82,82,82,127,45,127,
+       45,45,45,42,44,44,121,79,
+       109,109,122,102,121,17,127,77,77,77,77,77,77,77,77,77,
+       77,77,72,77,126,126,77,126,42,77,126,77,42,42,126,126,
+       126,42,40,42,126,42,42,42,42,42,40,42,40,126,72,42,
+       42,126,42,42,42,126,126,126,126,126,126,126,126,126,126,126,
+       126,126,126,126,36,126,126,126,126,126,97,126,126,126,126,126,
+       126,126,97,126,97,42,126,42,126,42,42,126,42,40,42,42,
+       42,40,42,42,42,42,126,72,77,126,126,77,72,77,72,72,
+       72,72,72,72,72,72,72,72,72,72,72,77,77,77,77,77,
+       42,77,42,126,42,42,126,42,42,42,42,126,42,40,40,42,
+       40,40,42,40,42,40,42,40,42,40,40,40,40,40,42,44,
+       72,44,44,44,44,40,40,40,42,42,40,42,42,42,42,42,
+       42,42,42,126,42,42,42,126,126,42,126,126,40,126,40,126,
+       42,42,42,42,44,44,111,79
+       };
diff --git a/xglock/modes.h b/xglock/modes.h
new file mode 100644 (file)
index 0000000..8019649
--- /dev/null
@@ -0,0 +1,663 @@
+/*-
+ * @(#)modes.h 4.01 2000/01/28 xlockmore
+ *
+ * modes.h - mode management for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 10-Oct-1999: Generated by genlauncher.
+ *              Adapted by Eric Lassauge <lassauge@mail.dotcom.fr>
+ * 08-Jul-1998: Adapted to xglock from mode.h by Remi Cohen-Scali
+ *              <remi.cohenscali@pobox.com>
+ *
+ */
+
+/*-
+ * Declare external interface routines for supported screen savers.
+ */
+
+#ifndef _LMODE_H_
+#define _LMODE_H_
+
+/* -------------------------------------------------------------------- */
+
+typedef struct LockStruct_s {
+       gchar       *cmdline_arg;       /* mode name */
+       gint         def_delay;         /* default delay for mode */
+       gint         def_batchcount;
+       gint         def_cycles;
+       gint         def_size;
+       gfloat       def_saturation;
+       gchar       *desc;              /* text description of mode */
+       void        *userdata;          /* for use by the mode */
+} LockStruct;
+
+LockStruct  LockProcs[] =
+{
+       {"ant",
+        1000, -3, 40000, -7, 1.00,
+        "Shows Langton's and Turk's generalized ants", (void *) NULL},
+#ifdef USE_GL
+       {"atlantis",
+        18000, 4, 100, 6000, 1.00,
+        "Shows moving sharks/whales/dolphin", (void *) NULL},
+#endif
+       {"ball",
+        10000, 10, 20, -100, 1.00,
+        "Shows bouncing balls", (void *) NULL},
+       {"bat",
+        100000, -8, 1, 0, 1.00,
+        "Shows bouncing flying bats", (void *) NULL},
+       {"blot",
+        200000, 6, 30, 1, 0.30,
+        "Shows Rorschach's ink blot test", (void *) NULL},
+       {"bouboule",
+        10000, 100, 1, 15, 1.00,
+        "Shows Mimi's bouboule of moving stars", (void *) NULL},
+       {"bounce",
+        5000, -10, 1, 0, 1.00,
+        "Shows bouncing footballs", (void *) NULL},
+       {"braid",
+        1000, 15, 100, -7, 1.00,
+        "Shows random braids and knots", (void *) NULL},
+       {"bubble",
+        100000, 25, 1, 100, 0.60,
+        "Shows popping bubbles", (void *) NULL},
+#if defined( USE_GL ) && defined( HAVE_CXX )
+       {"bubble3d",
+        1000, 1, 2, 1, 1.00,
+        "Richard Jones's GL bubbles", (void *) NULL},
+#endif
+       {"bug",
+        75000, 10, 32767, -4, 1.00,
+        "Shows Palmiter's bug evolution and garden of Eden", (void *) NULL},
+#ifdef USE_GL
+       {"cage",
+        25000, 1, 1, 1, 1.00,
+        "Shows the Impossible Cage, an Escher-like GL scene", (void *) NULL},
+#endif
+       {"clock",
+        100000, -16, 200, -200, 1.00,
+        "Shows Packard's clock", (void *) NULL},
+       {"coral",
+        60000, -3, 1, 35, 0.60,
+        "Shows a coral reef", (void *) NULL},
+       {"crystal",
+        60000, -500, 200, -15, 1.00,
+        "Shows polygons in 2D plane groups", (void *) NULL},
+       {"daisy",
+        100000, 300, 350, 1, 1.00,
+        "Shows a meadow of daisies", (void *) NULL},
+       {"dclock",
+        10000, 1, 10000, 1, 0.30,
+        "Shows a floating digital clock or message", (void *) NULL},
+       {"decay",
+        200000, 6, 30, 1, 0.30,
+        "Shows a decaying screen", (void *) NULL},
+       {"deco",
+        1000000, -30, 2, -10, 0.60,
+        "Shows art as ugly as sin", (void *) NULL},
+       {"demon",
+        50000, 0, 1000, -7, 1.00,
+        "Shows Griffeath's cellular automata", (void *) NULL},
+       {"dilemma",
+        200000, -2, 1000, 0, 1.00,
+        "Shows Lloyd's Prisoner's Dilemma simulation", (void *) NULL},
+       {"dragon",
+        2000000, 1, 16, -24, 1.00,
+        "Shows Deventer's Hexagonal Dragons Maze", (void *) NULL},
+       {"discrete",
+        1000, 4096, 2500, 1, 1.00,
+        "Shows various discrete maps", (void *) NULL},
+       {"drift",
+        10000, 30, 1, 1, 1.00,
+        "Shows cosmic drifting flame fractals", (void *) NULL},
+       {"euler2d",
+        1000, 1024, 3000, 1, 1.00,
+        "Shows a simulation of 2D incompressible inviscid fluid", (void *) NULL},
+       {"eyes",
+        20000, -8, 5, 1, 1.00,
+        "Shows eyes following a bouncing grelb", (void *) NULL},
+       {"fadeplot",
+        30000, 10, 1500, 1, 0.60,
+        "Shows a fading plot of sine squared", (void *) NULL},
+#ifdef USE_GL
+       {"fire",
+        10000, 800, 1, 1, 1.00,
+        "Shows a 3D fire-like image", (void *) NULL},
+#endif
+       {"flag",
+        50000, 1, 1000, -7, 1.00,
+        "Shows a waving flag image", (void *) NULL},
+       {"flame",
+        750000, 20, 10000, 1, 1.00,
+        "Shows cosmic flame fractals", (void *) NULL},
+       {"flow",
+        1000, 1024, 3000, 1, 1.00,
+        "Shows dynamic strange attractors", (void *) NULL},
+       {"forest",
+        400000, 100, 200, 1, 1.00,
+        "Shows binary trees of a fractal forest", (void *) NULL},
+       {"galaxy",
+        100, -5, 250, -3, 1.00,
+        "Shows crashing spiral galaxies", (void *) NULL},
+#ifdef USE_GL
+       {"gears",
+        1000, 1, 2, 1, 1.00,
+        "Shows GL's gears", (void *) NULL},
+#endif
+#ifdef USE_GL
+       {"glplanet",
+        1000, 1, 2, 1, 1.00,
+        "Animates texture mapped sphere (planet)", (void *) NULL},
+#endif
+       {"goop",
+        10000, -12, 1, 1, 1.00,
+        "Shows goop from a lava lamp", (void *) NULL},
+       {"grav",
+        10000, -12, 1, 1, 1.00,
+        "Shows orbiting planets", (void *) NULL},
+       {"helix",
+        25000, 1, 100, 1, 1.00,
+        "Shows string art", (void *) NULL},
+       {"hop",
+        10000, 1000, 2500, 1, 1.00,
+        "Shows real plane iterated fractals", (void *) NULL},
+       {"hyper",
+        100000, -6, 300, 1, 1.00,
+        "Shows spinning n-dimensional hypercubes", (void *) NULL},
+       {"ico",
+        100000, 0, 400, 0, 1.00,
+        "Shows a bouncing polyhedron", (void *) NULL},
+       {"ifs",
+        1000, 1, 1, 1, 1.00,
+        "Shows a modified iterated function system", (void *) NULL},
+       {"image",
+        3000000, -20, 1, 1, 1.00,
+        "Shows randomly appearing logos", (void *) NULL},
+#if defined( USE_GL ) && defined( HAVE_CXX )
+       {"invert",
+        100, 1, 1, 1, 1.00,
+        "Shows a sphere inverted without wrinkles", (void *) NULL},
+#endif
+       {"juggle",
+        10000, 150, 30, 1, 1.00,
+        "Shows a Juggler, juggling", (void *) NULL},
+       {"julia",
+        10000, 1000, 20, 1, 1.00,
+        "Shows the Julia set", (void *) NULL},
+       {"kaleid",
+        80000, 4, 40, -9, 0.60,
+        "Shows a kaleidoscope", (void *) NULL},
+       {"kumppa",
+        10000, 1, 1, 1, 1.00,
+        "Shows kumppa", (void *) NULL},
+#ifdef USE_GL
+       {"lament",
+        10000, 1, 1, 1, 1.00,
+        "Shows Lemarchand's Box", (void *) NULL},
+#endif
+       {"laser",
+        20000, -10, 200, 1, 1.00,
+        "Shows spinning lasers", (void *) NULL},
+       {"life",
+        750000, 40, 140, 0, 1.00,
+        "Shows Conway's game of Life", (void *) NULL},
+       {"life1d",
+        10000, 1, 10, 0, 1.00,
+        "Shows Wolfram's game of 1D Life", (void *) NULL},
+       {"life3d",
+        1000000, 35, 85, 1, 1.00,
+        "Shows Bays' game of 3D Life", (void *) NULL},
+       {"lightning",
+        10000, 1, 1, 1, 0.60,
+        "Shows Keith's fractal lightning bolts", (void *) NULL},
+       {"lisa",
+        25000, 1, 256, -1, 1.00,
+        "Shows animated lisajous loops", (void *) NULL},
+       {"lissie",
+        10000, 1, 2000, -200, 0.60,
+        "Shows lissajous worms", (void *) NULL},
+       {"loop",
+        100000, -5, 1600, -12, 1.00,
+        "Shows Langton's self-producing loops", (void *) NULL},
+       {"lyapunov",
+        25000, 600, 1, 1, 1.00,
+        "Shows lyapunov space", (void *) NULL},
+       {"mandelbrot",
+        25000, -8, 20000, 1, 1.00,
+        "Shows mandelbrot sets", (void *) NULL},
+       {"marquee",
+        100000, 1, 1, 1, 1.00,
+        "Shows messages", (void *) NULL},
+       {"matrix",
+        100, 1, 1, 1, 1.00,
+        "Shows the matrix", (void *) NULL},
+       {"maze",
+        1000, 1, 3000, -40, 1.00,
+        "Shows a random maze and a depth first search solution", (void *) NULL},
+#ifdef USE_GL
+       {"moebius",
+        1000, 1, 1, 1, 1.00,
+        "Shows Moebius Strip II, an Escher-like GL scene with ants", (void *) NULL},
+#endif
+#ifdef USE_GL
+       {"morph3d",
+        1000, 0, 1, 1, 1.00,
+        "Shows GL morphing polyhedra", (void *) NULL},
+#endif
+       {"mountain",
+        1000, 30, 4000, 1, 1.00,
+        "Shows Papo's mountain range", (void *) NULL},
+       {"munch",
+        5000, 1, 7, 1, 1.00,
+        "Shows munching squares", (void *) NULL},
+       {"nose",
+        100000, 1, 1, 1, 1.00,
+        "Shows a man with a big nose runs around spewing out messages", (void *) NULL},
+       {"pacman",
+        100000, 10, 1, 0, 1.00,
+        "Shows Pacman(tm)", (void *) NULL},
+       {"penrose",
+        10000, 1, 1, -40, 1.00,
+        "Shows Penrose's quasiperiodic tilings", (void *) NULL},
+       {"petal",
+        10000, -500, 400, 1, 1.00,
+        "Shows various GCD Flowers", (void *) NULL},
+#ifdef USE_GL
+       {"pipes",
+        1000, 2, 5, 500, 1.00,
+        "Shows a selfbuilding pipe system", (void *) NULL},
+#endif
+       {"polyominoes",
+        6000, 1, 8192, 1, 1.00,
+        "Shows attempts to place polyominoes into a rectangle", (void *) NULL},
+       {"puzzle",
+        10000, 250, 1, 1, 1.00,
+        "Shows a puzzle being scrambled and then solved", (void *) NULL},
+       {"pyro",
+        15000, 100, 1, -3, 1.00,
+        "Shows fireworks", (void *) NULL},
+       {"qix",
+        30000, -5, 32, 1, 1.00,
+        "Shows spinning lines a la Qix(tm)", (void *) NULL},
+       {"roll",
+        100000, 25, 1, -64, 0.60,
+        "Shows a rolling ball", (void *) NULL},
+       {"rotor",
+        100, 4, 100, -6, 0.30,
+        "Shows Tom's Roto-Rooter", (void *) NULL},
+#ifdef USE_GL
+       {"rubik",
+        10000, -30, 5, -6, 1.00,
+        "Shows an auto-solving Rubik's Cube", (void *) NULL},
+#endif
+#ifdef USE_GL
+       {"sballs",
+        10000, 0, 10, 400, 1.00,
+        "Balls spinning like crazy in GL", (void *) NULL},
+#endif
+       {"scooter",
+        20000, 24, 3, 100, 1.00,
+        "Shows a journey through space tunnel and stars", (void *) NULL},
+       {"shape",
+        10000, 100, 256, 1, 1.00,
+        "Shows stippled rectangles, ellipses, and triangles", (void *) NULL},
+       {"sierpinski",
+        400000, 2000, 100, 1, 1.00,
+        "Shows Sierpinski's triangle", (void *) NULL},
+#ifdef USE_GL
+       {"sierpinski3d",
+        1000, 1, 2, 1, 1.00,
+        "Shows GL's Sierpinski gasket", (void *) NULL},
+#endif
+#if defined(USE_GL) && defined( USE_UNSTABLE )
+       {"skewb",
+        10000, -30, 5, 1, 1.00,
+        "Shows an auto-solving Skewb", (void *) NULL},
+#endif
+       {"slip",
+        50000, 35, 50, 1, 1.00,
+        "Shows slipping blits", (void *) NULL},
+#ifdef HAVE_CXX
+       {"solitare",
+        2000000, 1, 1, 1, 1.00,
+        "Shows Klondike's game of solitare", (void *) NULL},
+#endif
+#ifdef USE_UNSTABLE
+       {"space",
+        10000, 100, 1, 15, 1.00,
+        "Shows a journey into deep space", (void *) NULL},
+#endif
+       {"sphere",
+        5000, 1, 20, 0, 1.00,
+        "Shows a bunch of shaded spheres", (void *) NULL},
+       {"spiral",
+        5000, -40, 350, 1, 1.00,
+        "Shows a helical locus of points", (void *) NULL},
+       {"spline",
+        30000, -6, 2048, 1, 0.30,
+        "Shows colorful moving splines", (void *) NULL},
+#ifdef USE_GL
+       {"sproingies",
+        1000, 5, 0, 400, 1.00,
+        "Shows Sproingies!  Nontoxic.  Safe for pets and small children", (void *) NULL},
+#endif
+#ifdef USE_GL
+       {"stairs",
+        200000, 0, 1, 1, 1.00,
+        "Shows some Infinite Stairs, an Escher-like scene", (void *) NULL},
+#endif
+       {"star",
+        75000, 100, 1, 100, 0.30,
+        "Shows a star field with a twist", (void *) NULL},
+       {"starfish",
+        10000, 1, 1, 1, 1.00,
+        "Shows starfish", (void *) NULL},
+       {"strange",
+        1000, 1, 1, 1, 1.00,
+        "Shows strange attractors", (void *) NULL},
+#ifdef USE_GL
+       {"superquadrics",
+        1000, 25, 40, 1, 1.00,
+        "Shows 3D mathematical shapes", (void *) NULL},
+#endif
+       {"swarm",
+        15000, -100, 1, -100, 1.00,
+        "Shows a swarm of bees following a wasp", (void *) NULL},
+       {"swirl",
+        5000, 5, 1, 1, 1.00,
+        "Shows animated swirling patterns", (void *) NULL},
+       {"t3d",
+        250000, 1000, 60000, 0, 1.00,
+        "Shows a Flying Balls Clock Demo", (void *) NULL},
+       {"tetris",
+        50000, 1, 1, -100, 1.00,
+        "Shows an autoplaying tetris game", (void *) NULL},
+#if defined(USE_GL) && defined(HAVE_CXX) && defined( HAVE_TTF ) && defined( HAVE_GLTT ) && defined( USE_UNSTABLE )
+       {"text3d",
+        100000, 1, 1, 1, 1.00,
+        "Shows 3D text", (void *) NULL},
+#endif
+       {"thornbird",
+        1000, 800, 16, 1, 1.00,
+        "Shows an animated bird in a thorn bush fractal map", (void *) NULL},
+       {"tik_tak",
+        60000, -20, 200, -1000, 1.00,
+        "Shows rotating polygons", (void *) NULL},
+       {"triangle",
+        10000, 1, 1, 1, 1.00,
+        "Shows a triangle mountain range", (void *) NULL},
+       {"tube",
+        25000, -9, 20000, -200, 1.00,
+        "Shows an animated tube", (void *) NULL},
+       {"turtle",
+        1000000, 1, 20, 1, 1.00,
+        "Shows turtle fractals", (void *) NULL},
+       {"vines",
+        200000, 0, 1, 1, 1.00,
+        "Shows fractals", (void *) NULL},
+       {"voters",
+        1000, 0, 327670, 0, 1.00,
+        "Shows Dewdney's Voters", (void *) NULL},
+       {"wator",
+        750000, 1, 32767, 0, 1.00,
+        "Shows Dewdney's Water-Torus planet of fish and sharks", (void *) NULL},
+       {"wire",
+        500000, 1000, 150, -8, 1.00,
+        "Shows a random circuit with 2 electrons", (void *) NULL},
+       {"world",
+        100000, -16, 1, 1, 0.30,
+        "Shows spinning Earths", (void *) NULL},
+       {"worm",
+        17000, -20, 10, -3, 1.00,
+        "Shows wiggly worms", (void *) NULL},
+       {"xcl",
+        20000, -3, 1, 1, 1.00,
+        "Shows a control line combat model race", (void *) NULL},
+       {"xjack",
+        50000, 1, 1, 1, 1.00,
+        "Shows Jack having one of those days", (void *) NULL},
+       {"blank",
+        3000000, 1, 1, 1, 1.00,
+        "Shows nothing but a black screen", (void *) NULL},
+#ifdef USE_BOMB
+       {"bomb",
+        100000, 10, 20, 1, 1.0,
+        "Shows a bomb and will autologout after a time", (void *) NULL},
+       {"random",
+        1, 1, 1, 1, 1.0,
+        "Shows a random mode from above except blank and bomb", (void *) NULL},
+#else
+       {"random",
+        1, 1, 1, 1, 1.0,
+        "Shows a random mode from above except blank", (void *) NULL},
+#endif
+};
+
+/* Number of modes (set in main) */
+guint nb_mode = 0;
+
+/* Defaults values available */
+#define DEF_DELAY              0
+#define DEF_BATCHCOUNT         1
+#define DEF_CYCLES             2
+#define DEF_SIZE               3
+#define DEF_SATURATION         4
+#define NB_DEFAULTED_OPTIONS   5
+
+/* Default values options names */
+static gchar *defaulted_options[NB_DEFAULTED_OPTIONS] = {
+  "delay",
+  "batchcount",
+  "cycles",
+  "size",
+  "saturation"};
+
+/* Number of default values options */
+static guint nb_defaultedOptions = NB_DEFAULTED_OPTIONS;
+
+/*------------------------------------*/
+/*       Boolean xlock options        */
+/*------------------------------------*/
+
+/* boolean option entry */
+typedef struct struct_option_bool_s {
+       gchar       *cmdarg;
+       gchar       *label;
+       gchar       *desc;
+       gchar          defval;
+       gchar        value;
+} struct_option_bool;
+
+/* Description of the boolean options */
+struct_option_bool BoolOpt[] =
+{
+  {"mono", "mono", "The mono option causes xlock to display monochrome", '\000', '\000'},
+  {"nolock", "nolock", "The nolock option causes xlock to only draw the patterns and not lock the display", '\000', '\000'},
+  {"remote", "remote", "The remote option causes xlock to not stop you from locking remote X11 server", '\000', '\000'},
+  {"allowroot", "allowroot", "The allowroot option allow the root password to unlock the server", '\000', '\000'},
+  {"enablesaver", "enablesaver", "This option enables the use of the normal Xserver screen saver", '\000', '\000'},
+  {"resetsaver", "resetsaver", "This option enables the call of XResetScreenSaver", '\000', '\000'},
+  {"allowaccess", "allowaccess", "For servers not allowing clients to modify host access, left the X11 server open", '\000', '\000'},
+#ifdef USE_VTLOCK
+  {"lockvt", "lockvt", "This option control the VT switch locking", '\000', '\000'},
+#endif
+  {"mousemotion", "mousemotion", "Allows to turn on/off the mouse sensitivity to bring up pass window", '\001', '\000'},
+  {"grabmouse", "grabmouse", "This option causes xlock to grab mouse and keyboard", '\001', '\000'},
+  {"grabserver", "grabserver", "The grabserver option causes xlock to grab the server", '\001', '\000'},
+  {"echokeys", "echokeys", "This option causes xlock to echo a question mark for each typed character", '\000', '\000'},
+  {"usefirst", "usefirst", "This option enables xlock to use the first keystroke in the password", '\000', '\000'},
+  {"verbose", "verbose", "verbose launch", '\000', '\000'},
+  {"debug", "debug", "This option allows xlock to be locked in a window", '\000', '\000'},
+  {"wireframe", "wireframe", "This option turns on wireframe rendering mode mainly for GL", '\000', '\000'},
+#ifdef USE_GL
+  {"showfps", "showfps", "This option turns on frame per sec display for GL", '\000', '\000'},
+  {"fpstop", "fpstop", "This option turns on top fps display for GL", '\000', '\000'},
+#endif
+  {"install", "install", "Allows xlock to install its own colormap if xlock runs out of colors", '\000', '\000'},
+  {"sound", "sound", "Allows you to turn on and off sound if installed with the capability", '\000', '\000'},
+  {"timeelapsed", "timeelapsed", "Allows you to find out how long a machine is locked", '\000', '\000'},
+  {"fullrandom", "fullrandom", "Turn on/off randomness options within modes", '\000', '\000'},
+  {"use3d", "use3d", "Turn on/off 3d view, available on bouboule, pyro, star, and worm", '\000', '\000'},
+  {"trackmouse", "trackmouse", "Turn on and off mouse interaction in eyes, julia, and swarm", '\000', '\000'},
+#if 0
+  {"dtsaver", "dtsaver", "Turn on/off CDE Saver Mode. Only available if CDE support was compiled in", '\000', '\000'},
+#endif
+};
+
+/* Number of boolean options (set in main) */
+guint nb_boolOpt = 0;
+
+/* Boolean option dialog callback struct */
+typedef struct struct_option_bool_callback_s {
+    GtkWidget          *boolopt_dialog;
+} struct_option_bool_callback;
+
+/*------------------------------------*/
+/*          General options           */
+/*------------------------------------*/
+
+/* Gen option entry struct */
+typedef struct struct_option_gen_s {
+    gchar      *cmdarg;
+    gchar      *label;
+    gchar      *desc;
+    gchar      *help_anchor;
+    GtkWidget  *text_widget;
+} struct_option_gen;
+
+/* Description of the general option */
+struct_option_gen generalOpt[] =
+{
+  {"username", "username", "text string to use for Name prompt", "opt_gen_", (GtkWidget *)NULL},
+  {"password", "password", "text string to use for Password prompt", "gen_opt_", (GtkWidget *)NULL},
+  {"info", "info", "text string to use for instruction", "gen_opt_", (GtkWidget *)NULL},
+  {"validate", "validate", "text string to use for validating password message", "gen_opt_", (GtkWidget *)NULL},
+  {"invalid", "invalidate", "text string to use for invalid password message", "gen_opt_", (GtkWidget *)NULL},
+  {"message", "message", "message to say", "gen_opt_", (GtkWidget *)NULL},
+  {"delay", "delay", "The delay option sets the speed at which a mode will operate", "gen_opt_", (GtkWidget *)NULL},
+  {"batchcount", "batchcount", "This option sets number of things to do per batch to num", "gen_opt_", (GtkWidget *)NULL},
+  {"cycles", "cycles", "This option delay is used for some mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"ncolors", "ncolors", "This option delay is used for some mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"size", "size", "This option delay is used for some mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"saturation", "saturation", "This option delay is used for some GL mode as parameter", "gen_opt_", (GtkWidget *)NULL},
+  {"nice", "nice", "This option sets system nicelevel of the xlock process", "gen_opt_", (GtkWidget *)NULL},
+  {"lockdelay", "lockdelay", "This option set the delay between launch and lock", "gen_opt_", (GtkWidget *)NULL},
+  {"timeout", "timeout", "The timeout option sets the password screen timeout", "gen_opt_", (GtkWidget *)NULL},
+  {"geometry", "geometry", "geometry of mode window", "gen_opt_", (GtkWidget *)NULL},
+  {"icongeometry", "icongeometry", "geometry of mode icon window", "gen_opt_", (GtkWidget *)NULL},
+  {"glgeometry", "geometry", "geometry of GL mode window", "gen_opt_", (GtkWidget *)NULL},
+  {"delta3d", "delta3d", "Turn on/off 3d view, available on bouboule, pyro, star, and worm", "gen_opt_", (GtkWidget *)NULL},
+  {"neighbors", "neighbors", "Sets number of neighbors of cell (3, 4, 6, 9, 12) for automata modes", "gen_opt_", (GtkWidget *)NULL},
+  {"cpasswd", "cpasswd", "Sets the key to be this text string to unlock", "gen_opt_", (GtkWidget *)NULL},
+  {"program", "program", "program used as a fortune generator", "gen_opt_", (GtkWidget *)NULL},
+#ifdef USE_AUTO_LOGOUT
+  {"forceLogout", "forceLogout", "This option sets minutes to auto-logout", "gen_opt_", (GtkWidget *)NULL},
+#endif
+#ifdef USE_BUTTON_LOGOUT
+  {"logoutButtonHelp", "logoutButtonHelp", "Text string is a message shown outside logout", "gen_opt_", (GtkWidget *)NULL},
+  {"logoutButtonLabel", "logoutButtonLabel", "Text string is a message shown inside logout button", "gen_opt_", (GtkWidget *)NULL},
+#endif
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+  {"logoutFailedString", "logoutFailedString", "Text string is shown when a logout is attempted and fails", "gen_opt_", (GtkWidget *)NULL},
+#endif
+  {"startCmd", "startCmd", "Command to execute when the screen is locked", "gen_opt_", (GtkWidget *)NULL},
+  {"endCmd", "endCmd", "Command to execute when the screen is unlocked", "gen_opt_", (GtkWidget *)NULL},
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+  {"logoutCmd", "logoutCmd", "Command to execute when the user is logged out", "gen_opt_", (GtkWidget *)NULL},
+#endif
+  {"mailCmd", "mailCmd", "Command to execute when mails are checked", "gen_opt_", (GtkWidget *)NULL},
+#ifdef USE_DPMS
+  {"dpmsstandby", "dpmsstandby", "Allows one to set DPMS Standby for monitor (0 is infinite)", "gen_opt_", (GtkWidget *)NULL},
+  {"dpmssuspend", "dpmssuspend", "Allows one to set DPMS Suspend for monitor (0 is infinite)", "gen_opt_", (GtkWidget *)NULL},
+  {"dpmsoff", "dpmsoff", "Allows one to set DPMS Power Off for monitor (0 is infinite)", "gen_opt_", (GtkWidget *)NULL},
+#endif
+};
+
+/* Number of general options (set in main) */
+guint nb_genOpt = 0;
+
+/* General option dialog callback struct */
+typedef struct struct_option_gen_callback_s {
+    GtkWidget  *gen_dialog;
+    GtkWidget  *text_widget;
+} struct_option_gen_callback;
+
+/*------------------------------------*/
+/*      Font/File/Color options       */
+/*------------------------------------*/
+
+/* Option type (font/color/file) */
+typedef enum enum_type_option_fntcol_e {
+    TFNTCOL_FONT = 0,
+    TFNTCOL_COLOR,
+    TFNTCOL_FILE
+} enum_type_option_fntcol;
+
+/* Font/Color/File option entry struct */
+typedef struct struct_option_fntcol_s {
+    enum_type_option_fntcol    type;
+    gchar                     *cmdarg;
+    gchar                     *label;
+    gchar                     *desc;
+    gchar                     *help_anchor;
+    GtkWidget                 *entry;
+    GtkWidget                 *drawing_area;
+} struct_option_fntcol;
+
+/* Description of the font and color option */
+struct_option_fntcol fntcolorOpt[] =
+{
+  {TFNTCOL_COLOR, "bg", "background", "background color to use for password prompt", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "fg", "foreground", "foreground color to use for password prompt", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "none3d", "none3d", "color used for empty size in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "right3d", "right3d", "color used for right eye in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "left3d", "left3d", "color used for left eye in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_COLOR, "both3d", "both3d", "color used for overlapping images for left and right eye in 3d mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FONT, "font", "font", "font to use for password prompt", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FONT, "messagefont", "msgfont", "font to use for message", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FONT, "planfont", "planfont", "font to use for lower part of password screen", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+#ifdef USE_GL
+  {TFNTCOL_FONT, "fpsfont", "fpsfont", "font to use for FPS display in GL mode", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+#endif
+  {TFNTCOL_FILE, "messagesfile", "messagesfile", "file to be used as the fortune generator", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "messagefile", "messagefile", "file whose contents are displayed", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "bitmap", "bitmap", "sets the xbm, xpm, or ras file to be displayed with some modes", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "lifefile", "lifefile", "sets the lifeform (only one format: #P xlife format)", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+  {TFNTCOL_FILE, "life3dfile", "life3dfile", "sets the lifeform (only one format similar to #P xlife format)", "opt_fntcol_",
+     (GtkWidget *)NULL, (GtkWidget *)NULL},
+};
+
+/* Number of font/color/file options (set in main) */
+guint nb_fntColorOpt = 0;
+
+/* Font/Color/File option dialog callback struct */
+typedef struct struct_option_fntcol_callback_s {
+    GtkWidget                         *fntcol_dialog;
+    GtkWidget                 *entry;
+    GtkWidget                 *drawing_area;
+} struct_option_fntcol_callback;
+
+/* Colors handling */
+GdkVisual *gdkvisual;
+GdkColormap *gdkcolormap;
+
+#endif /* !_LMODE_H_ */
diff --git a/xglock/xglock.c b/xglock/xglock.c
new file mode 100644 (file)
index 0000000..211f10a
--- /dev/null
@@ -0,0 +1,1719 @@
+/*-
+ * xglock.c - main file for xglock, the GTK+ gui interface to xlock.
+ *
+ * Copyright (c) 1998 by An Unknown author & Remi Cohen-Scali
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * Nov-99: updates by Eric Lassauge <lassauge@mail.dotcom.fr>:
+ *         - Callbacks for 'Cancel' buttons , don't SIGSEGV anymore
+ *         - FontSelection dialog updates for GTK 1.2.6
+ *         - Drawing of little colored rectangle simplified, now works in
+ *           Pseudo 8 bits and doesn't need an 'expose'
+ *         - Add 'About' box
+ *         - Add handling of "similar to xmlock" RC file
+ *         - etc...
+ * Jul-98: Continual improvements by Remi Cohen-Scali <remi.cohenscali@pobox.com>
+ * ?? -98: First written by Charles Vidal <vidalc@club-internet.fr>.
+ */
+
+/*-
+  XgLock Problems are almost the same as XmLock's ones.
+    1. Allowing only one in -inroot.  Need a way to kill it. (a menu ?)
+    2. Still missing many options (TO DO).
+    3. Need a clean rewritting.
+ */
+
+#include <sys/types.h>
+#include <sys/signal.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if 0
+# define XGLOCK_DEBUG    1
+#else
+# undef XGLOCK_DEBUG
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#else
+# define HAVE_UNISTD_H          1
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_VFORK
+#define FORK                            vfork
+#define FORK_STR                        "vfork"
+#else
+#define FORK                            fork
+#define FORK_STR                        "fork"
+#endif
+
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
+#include "modes.h"
+
+/* Alloc args by chunks of */
+#define ARGS_CHUNK                      20
+#define MODE_STRING                     "-mode"
+
+#define XLOCK                           "xlock"
+#define WINDOW_WIDTH                    160
+#define WINDOW_HEIGHT                   100
+#define WINDOW_GEOMETRY                 "160x100"
+
+#define XGLOCK_SPACING                  3
+#define XGLOCK_TABLE_HOMOGENEOUS        ARG_HOMOGENEOUS
+#define XGLOCK_TABLE_SPACING            XGLOCK_SPACING
+#define XGLOCK_TABLE_ROW_SPACING        XGLOCK_SPACING
+#define XGLOCK_TABLE_COL_SPACING        XGLOCK_SPACING
+#define XGLOCK_TABLE_BORDER_WIDTH       XGLOCK_SPACING
+
+#define FRAME_WIDTH                     500
+#define FRAME_HEIGHT                    300
+
+#define FONT_DIALOG_WIDTH               600
+#define FONT_DIALOG_HEIGHT              400
+
+#define MAX_WIDGET_NUMBER_LEN           25
+
+#include "logo.h"
+
+#ifndef XGLOCKRC_FILE
+#define XGLOCKRC_FILE "xglockrc"
+#endif
+
+static char numberwidget[MAX_WIDGET_NUMBER_LEN];
+static pid_t numberprocess = -1;
+static pid_t *launchedprocesses =(pid_t *)NULL;
+static int num_launchedprocesses = 0;
+static int sz_launchedprocesses = 0;
+static int selected_mode = -1;
+static GtkWidget *font_sel_entry =(GtkWidget *)NULL;
+static GtkTooltips *tooltips=(GtkTooltips *)NULL;
+
+/* Prototypes */
+#if defined( __ANSI_C__ ) || defined( NeedFunctionsPrototypes )
+# define __PROTO( name, args )  name args
+#else /* ! __ANSI_C__ && ! NeedFunctionsPrototypes */
+# define __PROTO( name, args )  name ()
+#endif /* ? __ANSI_C__ && ! NeedFunctionsPrototypes */
+
+#define STD_CB_ARGS    (GtkWidget *, gpointer)
+
+static void *__PROTO( secured_malloc, (size_t) );
+static void *__PROTO( secured_calloc, (int, size_t) );
+static void *__PROTO( secured_realloc, (void *, size_t) );
+static gchar *__PROTO( check_quotes, (gchar *str) );
+
+static void __PROTO( mode_list_item_select_cb, STD_CB_ARGS );
+static void __PROTO( mode_list_item_unselect_cb, STD_CB_ARGS );
+static void __PROTO( compose_xlock_command, (char *) );
+static void __PROTO( kill_xlock_cb, STD_CB_ARGS );
+static void __PROTO( launch_xlock, STD_CB_ARGS );
+static void __PROTO( exit_xglock, STD_CB_ARGS );
+static void __PROTO( bool_option_clicked_cb, STD_CB_ARGS );
+static void __PROTO( destroy_window, STD_CB_ARGS );
+
+static void __PROTO( color_selection_cancel_cb, STD_CB_ARGS );
+static void __PROTO( color_selection_ok_cb, STD_CB_ARGS );
+static void __PROTO( color_selection_changed_cb, STD_CB_ARGS );
+static void __PROTO( create_color_selection_dialog, STD_CB_ARGS );
+
+static void __PROTO( font_select_item_select_cb, STD_CB_ARGS );
+static void __PROTO( font_select_cancel_cb, STD_CB_ARGS );
+static void __PROTO( font_select_ok_cb, STD_CB_ARGS );
+static void __PROTO( create_font_selection_dialog, STD_CB_ARGS );
+
+static void __PROTO( file_selection_cancel_cb, STD_CB_ARGS );
+static void __PROTO( file_selection_ok_cb, STD_CB_ARGS );
+static void __PROTO( create_file_selection_dialog, STD_CB_ARGS );
+
+static void __PROTO( contextual_help_dialog, STD_CB_ARGS );
+static void __PROTO( window_help_dialog, STD_CB_ARGS );
+static void __PROTO( global_help_dialog, STD_CB_ARGS );
+static void __PROTO( about_dialog, STD_CB_ARGS );
+static void __PROTO( about_dialog_close_callback, STD_CB_ARGS );
+
+static GtkWidget * __PROTO( create_file_menu, (GtkWidget *) );
+static GtkWidget * __PROTO( create_help_menu, (GtkWidget *) );
+
+static void __PROTO( create_fntColorOptions_entries, (GtkWidget *) );
+static void __PROTO( create_genOptions_entries, (GtkWidget *) );
+static void __PROTO( create_boolOptions_buttons, (GtkWidget *) );
+
+/*
+ * secured_malloc
+ * --------------
+ * Return an allocated string of bytes
+ */
+static gpointer
+secured_malloc(gulong sz)
+{
+    gpointer allocated =(gpointer)NULL;
+    allocated =(gpointer)g_malloc( sz );
+    g_assert( allocated );
+    return allocated;
+}
+
+/*
+ * secured_calloc
+ * --------------
+ * Return an allocated string of bytes
+ */
+static gpointer
+secured_calloc(gulong n,
+               gulong sz)
+{
+    gpointer allocated = NULL;
+
+    allocated =(gpointer )g_malloc( n * sz );
+    g_assert( allocated );
+    return allocated;
+}
+
+/*
+ * secured_realloc
+ * ---------------
+ * Return an allocated string of bytes
+ */
+static gpointer
+secured_realloc(gpointer ptr,
+                gulong sz)
+{
+    gpointer allocated = NULL;
+
+    allocated =(gpointer )g_realloc( ptr, sz );
+    g_assert( allocated );
+    return allocated;
+}
+
+/*
+ * compose_xlock_command
+ * ---------------------
+ * This function scan the string passed as argument to see if
+ * it is necessary to suround it with quotes for using it as a command
+ * line argument.
+ */
+static gchar *
+check_quotes(gchar *str)
+{
+    static gchar *req_dbl = "'#&;* ";
+    static gchar *req_simple = "\"";
+    gint len = strlen( str );
+    gint dbl_cspn = strcspn( str, req_dbl );
+    gint simple_cspn = strcspn( str, req_simple );
+    gchar *quotes = "";
+
+    if ( dbl_cspn != len )
+      quotes = "\"";
+    if ( simple_cspn != len )
+      quotes = "'";
+    return quotes;
+}
+
+/*
+ * compose_xlock_command
+ * ---------------------
+ * This function scan all the selected options and build an according
+ * command line for running xlock.
+ */
+static void
+compose_xlock_command(gchar ***cmd_argv_p,
+                      gulong  *cmd_argv_sz,
+                      gulong  *cmd_argc)
+{
+    gint        i;
+    gulong      n = *cmd_argc;
+    gulong      sz = *cmd_argv_sz;
+    gchar     **cmd_argv = *cmd_argv_p;
+
+#ifdef XGLOCK_DEBUG
+# define CHECK_REALLOC(num, size, need)                                                 \
+    fprintf(stderr,                                                                     \
+            "check realloc: current=%ld need=%d size=%ld\n",                            \
+            num, need, size );                                                          \
+    if (size <= num+need) {                                                             \
+        fprintf(stderr,                                                                 \
+                "must realloc: size <= num+need is %s\n",                               \
+                size<=num+need?"TRUE":"FALSE");                                         \
+        cmd_argv =(char **)secured_realloc((gpointer)cmd_argv,                          \
+                                           (gulong)(size+ARGS_CHUNK)*sizeof(char **));  \
+        size+= ARGS_CHUNK;                                                              \
+    }
+
+#else /* ! XGLOCK_DEBUG */
+# define CHECK_REALLOC(num, size, need)                                                 \
+    if (size <= num+need) {                                                             \
+        cmd_argv =(char **)secured_realloc((gpointer)cmd_argv,                          \
+                                           (gulong)(size+ARGS_CHUNK)*sizeof(char **));  \
+        size+= ARGS_CHUNK;                                                              \
+    }
+
+#endif /* ? XGLOCK_DEBUG */
+
+    for (i = 0; i < nb_boolOpt; i++)
+      if (BoolOpt[i].value) {
+
+          /* Check dynamic tab size */
+          CHECK_REALLOC( n, sz, 1 );
+
+          /* Add the arg */
+          cmd_argv[n] = secured_malloc( strlen( BoolOpt[i].cmdarg )+2 );
+          (void) sprintf( cmd_argv[n], "-%s", BoolOpt[i].cmdarg );
+          n++;
+      }
+
+    /* General options */
+    for (i = 0; i < nb_genOpt; i++)
+    {
+        gchar *val;
+
+        if ( !( GTK_IS_ENTRY( generalOpt[i].text_widget ) ) ) continue;
+
+        val = gtk_entry_get_text( GTK_ENTRY( generalOpt[i].text_widget ));
+        if ( strlen( val ) > 0 )
+        {
+            gint j;
+            gchar *quotes;
+
+            for ( j = 0; j < nb_defaultedOptions; j++ )
+              if ( !strcmp( generalOpt[i].cmdarg, defaulted_options[j] ) )
+                break;
+            if ( j < nb_defaultedOptions )
+            {
+                gint defval = 0;
+
+                switch ( j )
+                {
+                  case DEF_DELAY:
+                    defval = LockProcs[selected_mode].def_delay; break;
+                  case DEF_BATCHCOUNT:
+                    defval = LockProcs[selected_mode].def_batchcount; break;
+                  case DEF_CYCLES:
+                    defval = LockProcs[selected_mode].def_cycles; break;
+                  case DEF_SIZE:
+                    defval = LockProcs[selected_mode].def_size; break;
+                  case DEF_SATURATION:
+                    defval = LockProcs[selected_mode].def_saturation; break;
+                }
+
+                if ( defval == atoi( val ) )
+#ifdef XGLOCK_DEBUG
+                {
+                    fprintf(stderr,
+                            "Option %s has its default value (%d): discarded\n",
+                            generalOpt[i].cmdarg, defval);
+#endif
+                    continue;
+#ifdef XGLOCK_DEBUG
+                }
+#endif
+            }
+
+            /* Check dyntab size */
+            CHECK_REALLOC( n, sz, 2 );
+
+            cmd_argv[n] = secured_malloc( strlen( generalOpt[i].cmdarg )+2 );
+            (void) sprintf( cmd_argv[n], "-%s", generalOpt[i].cmdarg );
+            n++;
+
+            quotes = check_quotes( val );
+
+            cmd_argv[n] = secured_malloc( strlen( val )+3 );
+            (void) sprintf( cmd_argv[n], "%s%s%s", quotes, val, quotes);
+            n++;
+        }
+    }
+
+    /* font and color options */
+    for (i = 0; i < nb_fntColorOpt; i++)
+    {
+        switch ( fntcolorOpt[i].type )
+        {
+            /* Handle color parameter */
+          case TFNTCOL_COLOR:
+          {
+              gchar *val = gtk_entry_get_text( GTK_ENTRY( fntcolorOpt[i].entry ) );
+              gushort R, G, B;
+              gdouble T;
+              gchar   opt[50];
+
+              if ( strlen( val ) > 0 )
+              {
+                  CHECK_REALLOC( n, sz, 2 );
+
+                  cmd_argv[n] = secured_malloc( strlen( fntcolorOpt[i].cmdarg )+2 );
+                  (void) sprintf( cmd_argv[n], "-%s", fntcolorOpt[i].cmdarg );
+                  n++;
+
+                  sscanf( val, "#%4hx%4hx%4hx (%lf)", &R, &G, &B, &T );
+                  sprintf( opt, "#%04x%04x%04x", R, G, B );
+
+                  cmd_argv[n] = secured_malloc( strlen( opt )+3 );
+                  (void) sprintf( cmd_argv[n], "\"%s\"", opt );
+                  n++;
+              }
+              break;
+          }
+
+            /* Handle font or file parameters */
+          case TFNTCOL_FONT:
+          case TFNTCOL_FILE:
+          {
+              gchar *val = gtk_entry_get_text( GTK_ENTRY( fntcolorOpt[i].entry ) );
+              gchar *quotes;
+
+              if (strlen( val ) > 0)
+              {
+                  CHECK_REALLOC( n, sz, 2 );
+
+                  cmd_argv[n] = secured_malloc( strlen( fntcolorOpt[i].cmdarg )+2 );
+                  (void) sprintf( cmd_argv[n], "-%s", fntcolorOpt[i].cmdarg );
+                  n++;
+
+                  quotes = check_quotes( val );
+
+                  cmd_argv[n] = secured_malloc( strlen( val )+3 );
+                  (void) sprintf( cmd_argv[n], "%s%s%s", quotes, val, quotes);
+                  n++;
+              }
+              break;
+          }
+        }
+    }
+
+    /* Add a NULL ptr */
+    CHECK_REALLOC( n, sz, 1 );
+    cmd_argv[n++] =(char *)NULL;
+
+#undef CHECK_REALLOC
+
+    /* Return argv, argc, argsz */
+    *cmd_argc = n;
+    *cmd_argv_sz = sz;
+    *cmd_argv_p = cmd_argv;
+}
+
+/*
+ * kill_xlock_cb
+ * -------------
+ * Callback associated wih the Kill xlock file menu entry
+ */
+static void
+kill_xlock_cb(GtkWidget *w,
+              gpointer udata)
+{
+    guint i;
+    gint dummy = 0;
+
+    for ( i = 0;  i < num_launchedprocesses; i++ )
+      if ( launchedprocesses[i] != -1 ) {
+          (void) kill( launchedprocesses[i], SIGKILL );
+          (void) wait( &dummy );
+          launchedprocesses[i] = -1;
+      }
+    num_launchedprocesses = 0;
+}
+
+/*
+ * launch_xlock
+ * ------------
+ * This callback launch the xlock command accordingly to the selected
+ * modes and options. The xlock process is launched in root window, in
+ * a window or in normal mode.
+ */
+static void
+launch_xlock(GtkWidget *w,
+             gpointer udata )
+{
+#ifdef XGLOCK_DEBUG
+    gint i;
+#endif
+    gchar  *launch_opt =(char *)udata;
+    gulong  args_size = 0,
+            args_cnt = 0;
+    gchar **cmd_argv =(char **)NULL;
+
+    if ( selected_mode >= 0 && selected_mode < nb_mode )
+    {
+        /* Alloc argv table */
+        args_size = ARGS_CHUNK;
+        args_cnt = 0;
+        cmd_argv =(char **)secured_calloc( ARGS_CHUNK, sizeof(char *) );
+
+        /* First arg is xlock itself */
+        cmd_argv[args_cnt] = secured_malloc( strlen( XLOCK )+1 );
+        (void) strcpy(cmd_argv[args_cnt], XLOCK);
+        args_cnt++;
+
+        /* If launch in window/root */
+        if ( launch_opt )
+        {
+            cmd_argv[args_cnt] = secured_malloc( strlen( launch_opt )+1 );
+            (void) strcpy(cmd_argv[args_cnt], launch_opt);
+            args_cnt++;
+        }
+
+        /* Mode arg */
+        cmd_argv[args_cnt] = secured_malloc( strlen( MODE_STRING )+1 );
+        (void) strcpy(cmd_argv[args_cnt], MODE_STRING);
+        args_cnt++;
+
+        /* Mode name */
+        cmd_argv[args_cnt] = secured_malloc( strlen( LockProcs[selected_mode].cmdline_arg )+1 );
+        (void) strcpy(cmd_argv[args_cnt], LockProcs[selected_mode].cmdline_arg);
+        args_cnt++;
+
+        /* Add other user selected args */
+        compose_xlock_command( &cmd_argv, &args_size, &args_cnt );
+
+#ifdef XGLOCK_DEBUG
+        fprintf( stderr, "Running command: " );
+        for ( i = 0; i < args_cnt; i++ )
+          fprintf( stderr, "%s ", cmd_argv[i] ? cmd_argv[i] : "\n" );
+#endif
+        /* Allocate the launched pid_t dyntab */
+        if ( !launchedprocesses )
+        {
+            launchedprocesses = secured_calloc( 10, sizeof( pid_t ) );
+            sz_launchedprocesses = 10;
+        }
+        /* Grow dyntab */
+        if ( num_launchedprocesses == sz_launchedprocesses )
+        {
+            launchedprocesses = secured_realloc(launchedprocesses,
+                                                (sz_launchedprocesses+10)*sizeof( pid_t ) );
+            sz_launchedprocesses+= 10;
+        }
+        /* Fork process to run xlock */
+        if ( (launchedprocesses[num_launchedprocesses] = FORK() ) == -1 )
+        {
+            perror( FORK_STR );
+            fprintf(stderr,
+                    "Cannot " FORK_STR " process for xlock !\n" );
+        }
+        /* Child process */
+        else if ( launchedprocesses[num_launchedprocesses] == 0 )
+          (void) execvp( XLOCK, cmd_argv );
+        else
+          num_launchedprocesses++;
+    }
+
+    /* Free resources */
+    while ( args_cnt-- )
+      (void) free( cmd_argv[args_cnt] );
+    (void) free( cmd_argv );
+    cmd_argv =(char **)NULL;
+}
+
+/*
+ * exit_xglock
+ * -----------
+ * This callback terminates the xglock process. It kills the root
+ * widget and break the gtk main loop.
+ */
+static void
+exit_xglock(GtkWidget *w,
+            gpointer udata )
+{
+    GtkWidget *root =(GtkWidget *)udata;
+    guint i;
+    gint dummy = 0;
+
+    /* Cleanup launched processes */
+    for ( i = 0;  i < num_launchedprocesses; i++ )
+      if ( launchedprocesses[i] != -1 ) {
+          (void) kill( launchedprocesses[i], SIGKILL );
+          (void) wait( &dummy );
+          launchedprocesses[i] = -1;
+      }
+    num_launchedprocesses = 0;
+
+    if ( numberprocess != -1 ) {
+        (void) kill( numberprocess, SIGKILL );
+        (void) wait( &dummy );
+        numberprocess = -1;
+    }
+
+    gtk_main_quit();
+    gtk_widget_destroy(root);
+}
+
+/*
+ * destroy_window
+ * --------------
+ * Callback for destroying window
+ */
+static void
+destroy_window(GtkWidget * widget,
+               gpointer udata)
+{
+    gtk_widget_destroy( (GtkWidget *)udata );
+}
+
+/*
+ * bool_option_clicked_cb
+ * ----------------------
+ * This callback is called when a check button is clicked. It's
+ * state is then saved in the structure.
+ */
+static void
+bool_option_clicked_cb(GtkWidget *w,
+                       gpointer udata )
+{
+    guint optnr =(guint)udata;
+
+    if ( !( GTK_IS_CHECK_BUTTON(w) )) return;
+
+    BoolOpt[optnr].value = !BoolOpt[optnr].value;
+#ifdef XGLOCK_DEBUG
+    fprintf(stderr,
+            "Option #%ud %s is %s\n",
+            optnr, BoolOpt[optnr].cmdarg,
+            BoolOpt[optnr].value ? "ACTIVE":"INACTIVE" );
+#endif
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*                      List items' callbacks                        */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * mode_list_item_select_cb
+ * ------------------------
+ * Callback called when a mode list item is selected in the list.
+ * It fork the process and exec xlock in the specified mode.
+ */
+static void
+mode_list_item_select_cb(GtkWidget *w,
+                         gpointer mode_nr )
+{
+    gint mode =(gint)mode_nr;
+    gint i;
+
+    if (w->state != GTK_STATE_SELECTED ) return;
+
+    if ( mode < 0 || mode >= nb_mode ) return;
+
+    selected_mode = mode;
+
+    for ( i = 0; i < nb_defaultedOptions; i++ )
+    {
+        gchar temp[30];
+        gint defval = 0, j;
+
+        for ( j = 0; j < nb_mode; j++ )
+          if ( !strcmp( generalOpt[j].cmdarg, defaulted_options[i] ) )
+            break;
+        if ( j == nb_mode ) break;
+        switch ( i ) {
+          case DEF_DELAY:
+            defval = LockProcs[selected_mode].def_delay; break;
+          case DEF_BATCHCOUNT:
+            defval = LockProcs[selected_mode].def_batchcount; break;
+          case DEF_CYCLES:
+            defval = LockProcs[selected_mode].def_cycles; break;
+          case DEF_SIZE:
+            defval = LockProcs[selected_mode].def_size; break;
+          case DEF_SATURATION:
+            defval = LockProcs[selected_mode].def_saturation; break;
+        }
+        sprintf(temp, "%d", defval );
+        gtk_entry_set_text(GTK_ENTRY(generalOpt[j].text_widget), temp);
+    }
+
+    if ( ( numberprocess = FORK() ) == -1 )
+      fprintf( stderr, "Fork error !\n" );
+    else if ( numberprocess == 0 ) {
+        (void) execlp(XLOCK, XLOCK, "-parent", numberwidget,
+                      MODE_STRING, LockProcs[mode].cmdline_arg, "-geometry", WINDOW_GEOMETRY, "-delay", "100000",
+                      "-nolock", "-inwindow", "+install", 0);
+    }
+}
+
+/*
+ * mode_list_item_unselect_cb
+ * --------------------------
+ * Callback called when a mode list item is deselected in the list.
+ * It kills the child process forked to display preview in the
+ * preview window.
+ */
+static void
+mode_list_item_unselect_cb(GtkWidget *w,
+                           gpointer udata )
+{
+    gint dummy = 0;
+
+    if ( w->state == GTK_STATE_SELECTED ) return;
+
+    selected_mode = -1;
+
+    if ( numberprocess != -1 ) {
+        (void) kill( numberprocess, SIGKILL );
+        (void) wait( &dummy );
+        numberprocess = -1;
+    }
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*                      Color selection dialog                       */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * color_selection_cancel_cb
+ * -------------------------
+ * Cancel callback for color selection dialog
+ */
+static void
+color_selection_cancel_cb(GtkWidget *w,
+                          gpointer udata)
+{
+    struct_option_fntcol_callback *cbs_ptr =(struct_option_fntcol_callback *)udata;
+    gtk_widget_hide(cbs_ptr->fntcol_dialog);
+    gtk_widget_destroy(cbs_ptr->fntcol_dialog);
+    (void) g_free(udata);
+}
+
+/*
+ * color_selection_ok_cb
+ * ---------------------
+ * Ok callback for color selection dialog
+ */
+static void
+color_selection_ok_cb(GtkWidget *w,
+                      gpointer udata)
+{
+    struct_option_fntcol_callback *cbs_ptr =(struct_option_fntcol_callback *)udata;
+    GtkColorSelection            *colorsel;
+    GdkColor                      gdkcol_bg;
+    gdouble                               colors[4];
+    gchar                                 colorstr[30];
+
+    colorsel = GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->colorsel );
+
+    gtk_color_selection_get_color(colorsel, colors);
+    gtk_color_selection_set_color(colorsel, colors);
+
+    sprintf(colorstr, "#%04x%04x%04x (%3.2f)",
+            (gushort)(colors[0] * 0xffff),
+            (gushort)(colors[1] * 0xffff),
+            (gushort)(colors[2] * 0xffff),
+            colors[3]);
+
+    gdkcol_bg.red = (gushort)(colors[0] * 0xffff);
+    gdkcol_bg.green = (gushort)(colors[1] * 0xffff);
+    gdkcol_bg.blue = (gushort)(colors[2] * 0xffff);
+    gdk_color_alloc(gdkcolormap, &gdkcol_bg);
+
+#ifdef XGLOCK_DEBUG
+    fprintf(stderr,
+            "Parsed bg color: color=#%04x%04x%04x pixel=%lx\n",
+            gdkcol_bg.red,
+            gdkcol_bg.green,
+            gdkcol_bg.blue,
+            gdkcol_bg.pixel);
+#endif
+    gdk_window_set_background(GTK_WIDGET(cbs_ptr->drawing_area)->window, &gdkcol_bg);
+    gdk_window_clear(GTK_WIDGET(cbs_ptr->drawing_area)->window);
+    gdk_flush();
+
+    gtk_entry_set_text( GTK_ENTRY(cbs_ptr->entry), colorstr );
+    gtk_widget_hide( cbs_ptr->fntcol_dialog );
+    gtk_widget_destroy(cbs_ptr->fntcol_dialog);
+    (void) g_free(udata);
+}
+
+/*
+ * color_selection_changed_cb
+ * --------------------------
+ * Color changed callback for color selection dialog (update the current color)
+ */
+static void
+color_selection_changed_cb(GtkWidget *w,
+                           gpointer udata)
+{
+    GtkWidget           *colorsel_dialog =(GtkWidget *)udata;
+    GtkColorSelection   *colorsel;
+    gdouble                      colors[4];
+
+    colorsel = GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG(colorsel_dialog)->colorsel );
+    gtk_color_selection_get_color(colorsel, colors);
+}
+
+/*
+ * create_color_selection_dialog
+ * -----------------------------
+ * Create a color selection dialog. Is the callback for a color option
+ * choice button
+ */
+static void
+create_color_selection_dialog(GtkWidget *w,
+                              gpointer udata)
+{
+    struct_option_fntcol         *optentry =(struct_option_fntcol *)udata;
+    gdouble                               colors[4];
+    gchar                                *val;
+    struct_option_fntcol_callback *cbs_ptr;
+
+    cbs_ptr =(struct_option_fntcol_callback *)secured_malloc(sizeof(struct_option_fntcol_callback));
+
+    gtk_preview_set_install_cmap(TRUE);
+    gtk_widget_push_visual(gtk_preview_get_visual());
+    gtk_widget_push_colormap(gtk_preview_get_cmap());
+
+    cbs_ptr->fntcol_dialog = gtk_color_selection_dialog_new("color selection dialog");
+    cbs_ptr->entry = optentry->entry;
+    cbs_ptr->drawing_area = optentry->drawing_area;
+
+    val = gtk_entry_get_text( GTK_ENTRY(cbs_ptr->entry) );
+    if ( strlen( val ) > 0 )
+    {
+        gushort R, G, B;
+
+        sscanf( val, "#%04hx%04hx%04hx (%lf)", &R, &G, &B, &colors[3]);
+        colors[0] = R /(gdouble)0xffff;
+        colors[1] = G /(gdouble)0xffff;
+        colors[2] = B /(gdouble)0xffff;
+        gtk_color_selection_set_opacity(GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->colorsel),
+                                        colors[3] < 1.0);
+        gtk_color_selection_set_color(GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->colorsel),
+                                      colors);
+    }
+
+    gtk_color_selection_set_opacity(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->colorsel),
+                                    TRUE);
+
+    gtk_color_selection_set_update_policy(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->colorsel),
+                                          GTK_UPDATE_CONTINUOUS);
+
+    gtk_window_position(GTK_WINDOW(cbs_ptr->fntcol_dialog), GTK_WIN_POS_MOUSE);
+    gtk_signal_connect(GTK_OBJECT(cbs_ptr->fntcol_dialog), "destroy",
+                       (GtkSignalFunc) destroy_window,
+                       (gpointer) cbs_ptr->fntcol_dialog);
+
+    gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->colorsel),
+                       "color_changed",
+                       (GtkSignalFunc) color_selection_changed_cb,
+                       (gpointer) cbs_ptr->fntcol_dialog);
+
+    gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->ok_button),
+                       "clicked",
+                       (GtkSignalFunc) color_selection_ok_cb,
+                       (gpointer) cbs_ptr);
+
+    gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->cancel_button),
+                       "clicked",
+                       (GtkSignalFunc) color_selection_cancel_cb,
+                       (gpointer) cbs_ptr);
+
+    gtk_widget_pop_colormap();
+    gtk_widget_pop_visual();
+    gtk_widget_show(cbs_ptr->fntcol_dialog);
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*                       Font selection dialog                       */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * font_select_cancel_cb
+ * ---------------------
+ * Font dialog cancel button callback
+ */
+static void
+font_select_cancel_cb(GtkWidget *w,
+                      gpointer udata)
+{
+    struct_option_fntcol_callback *cbs_ptr = (struct_option_fntcol_callback *)udata;
+    gtk_widget_hide(cbs_ptr->fntcol_dialog);
+    gtk_widget_destroy(cbs_ptr->fntcol_dialog);
+    (void) g_free(udata);
+}
+
+/*
+ * font_select_ok_cb
+ * -----------------
+ * Font dialog ok button callback
+ */
+static void
+font_select_ok_cb(GtkWidget *w,
+                  gpointer udata)
+{
+    struct_option_fntcol_callback *cbs_ptr = (struct_option_fntcol_callback *)udata;
+    gtk_widget_hide(cbs_ptr->fntcol_dialog);
+    gtk_entry_set_text(GTK_ENTRY(cbs_ptr->entry),
+                       gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)));
+    gtk_widget_destroy(cbs_ptr->fntcol_dialog);
+    (void) g_free(udata);
+}
+
+/*
+ * create_font_selection_dialog
+ * ----------------------------
+ * Create a font selection dialog for font parameters
+ */
+static void
+create_font_selection_dialog(GtkWidget *w,
+                             gpointer udata)
+{
+    struct_option_fntcol         *optentry =(struct_option_fntcol *)udata;
+    struct_option_fntcol_callback *cbs_ptr;
+    gchar                        *fontname;
+
+    cbs_ptr =(struct_option_fntcol_callback *)secured_malloc( sizeof(struct_option_fntcol_callback) );
+    cbs_ptr->fntcol_dialog =(GtkWidget *)NULL;
+    cbs_ptr->entry = optentry->entry;
+    cbs_ptr->drawing_area =(GtkWidget *)NULL;
+
+    cbs_ptr->fntcol_dialog = gtk_font_selection_dialog_new("Xglock Font Selection Dialog");
+    fontname = gtk_entry_get_text(GTK_ENTRY(optentry->entry));
+    if ( fontname && strlen(fontname) )
+      gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(cbs_ptr->fntcol_dialog), fontname);
+    gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->ok_button), "clicked",
+                       GTK_SIGNAL_FUNC(font_select_ok_cb),
+                       (gpointer) cbs_ptr);
+    gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(cbs_ptr->fntcol_dialog)->cancel_button), "clicked",
+                       GTK_SIGNAL_FUNC(font_select_cancel_cb),
+                       (gpointer) cbs_ptr);
+    gtk_widget_show(cbs_ptr->fntcol_dialog);
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*                       File selection dialog                       */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * file_selection_cancel_cb
+ * ------------------------
+ * File selector Cancel callback
+ */
+static void
+file_selection_cancel_cb(GtkWidget *w,
+                         gpointer udata)
+{
+    struct_option_fntcol_callback *cbs_ptr= (struct_option_fntcol_callback *)udata;
+    gtk_widget_hide( cbs_ptr->fntcol_dialog );
+    gtk_widget_destroy( cbs_ptr->fntcol_dialog );
+    (void) g_free(udata);
+}
+
+/*
+ * file_selection_ok_cb
+ * --------------------
+ * File selector OK callback
+ */
+static void
+file_selection_ok_cb(GtkWidget *w,
+                     gpointer udata)
+{
+    struct stat                   stbuf;
+    struct_option_fntcol_callback *cbs_ptr= (struct_option_fntcol_callback *)udata;
+    gchar                        *filename;
+
+    /* Be sure file exist. We could be more paranoia */
+    filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(cbs_ptr->fntcol_dialog));
+    if ( stat(filename, &stbuf) != -1 )
+    {
+        gtk_widget_hide(cbs_ptr->fntcol_dialog);
+        gtk_entry_set_text(GTK_ENTRY(cbs_ptr->entry), filename);
+        gtk_widget_destroy(cbs_ptr->fntcol_dialog);
+        (void) g_free(udata);
+    }
+}
+
+/*
+ * create_file_selection_dialog
+ * ----------------------------
+ * Create a file selection dialog for file path parameters (
+ */
+static void
+create_file_selection_dialog(GtkWidget *w,
+                             struct_option_fntcol *optentry )
+{
+    struct_option_fntcol_callback *cbs_ptr;
+
+    cbs_ptr =(struct_option_fntcol_callback *)secured_malloc( sizeof(struct_option_fntcol_callback) );
+    cbs_ptr->fntcol_dialog = gtk_file_selection_new("file selection dialog");
+    cbs_ptr->entry = optentry->entry;
+    cbs_ptr->drawing_area =(GtkWidget *)NULL;
+    gtk_window_position(GTK_WINDOW(cbs_ptr->fntcol_dialog), GTK_WIN_POS_MOUSE);
+    gtk_signal_connect(GTK_OBJECT(cbs_ptr->fntcol_dialog), "destroy",
+                       (GtkSignalFunc) destroy_window,
+                       (gpointer) cbs_ptr->fntcol_dialog);
+    gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(cbs_ptr->fntcol_dialog)->ok_button),
+                       "clicked", (GtkSignalFunc) file_selection_ok_cb,
+                       (gpointer) cbs_ptr);
+    gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(cbs_ptr->fntcol_dialog)->cancel_button),
+                       "clicked", (GtkSignalFunc) file_selection_cancel_cb,
+                       (gpointer) cbs_ptr);
+    gtk_widget_show(cbs_ptr->fntcol_dialog);
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*                        Help dialogs routines                      */
+/*                                                                   */
+/* ================================================================= */
+
+static void
+contextual_help_dialog(GtkWidget *w,
+                       gpointer udata )
+{
+    fprintf(stderr, "contextual_help_dialog !\n");
+}
+
+static void
+window_help_dialog(GtkWidget *w,
+                   gpointer udata )
+{
+    fprintf(stderr, "window_help_dialog !\n");
+}
+
+static void
+global_help_dialog(GtkWidget *w,
+                   gpointer udata )
+{
+    fprintf(stderr, "global_help_dialog !\n");
+}
+
+static void about_dialog_close_callback(GtkWidget *widget, gpointer   data)
+{
+   gtk_widget_destroy(GTK_WIDGET (data));
+}
+
+static void
+about_dialog(GtkWidget *w,
+             gpointer udata )
+{
+  GtkWidget *xdlg;
+  GtkWidget *xlabel;
+  GtkWidget *xbutton;
+  GtkWidget *xlogo_box;
+  GtkWidget *xpreview;
+  GtkWidget *xframe,*xframe2;
+  GtkWidget *xvbox;
+  GtkWidget *xhbox;
+  char *text;
+  guchar *temp,*temp2;
+  guchar *datapointer;
+  gint y,x;
+  xdlg = gtk_dialog_new();
+  gtk_window_set_title(GTK_WINDOW(xdlg), "About");
+  gtk_window_position(GTK_WINDOW(xdlg), GTK_WIN_POS_CENTER);
+  gtk_signal_connect(GTK_OBJECT(xdlg), "destroy",
+                     (GtkSignalFunc)about_dialog_close_callback,
+                    xdlg);
+
+  xbutton = gtk_button_new_with_label("Ok");
+  GTK_WIDGET_SET_FLAGS(xbutton, GTK_CAN_DEFAULT);
+  gtk_signal_connect(GTK_OBJECT(xbutton), "clicked",
+                     (GtkSignalFunc)about_dialog_close_callback,
+                    xdlg);
+  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(xdlg)->action_area),
+                    xbutton, TRUE, TRUE, 0);
+  gtk_widget_grab_default(xbutton);
+  gtk_widget_show(xbutton);
+  gtk_tooltips_set_tip(tooltips,xbutton,"Click here to close the information box.",(gchar *)NULL);
+
+  xframe = gtk_frame_new(NULL);
+  gtk_frame_set_shadow_type(GTK_FRAME(xframe), GTK_SHADOW_ETCHED_IN);
+  gtk_container_border_width(GTK_CONTAINER(xframe), 10);
+  gtk_box_pack_start(GTK_BOX(GTK_DIALOG(xdlg)->vbox), xframe, TRUE, TRUE, 0);
+  xvbox = gtk_vbox_new(FALSE, 5);
+  gtk_container_border_width(GTK_CONTAINER(xvbox), 10);
+  gtk_container_add(GTK_CONTAINER(xframe), xvbox);
+
+  /*  The logo frame & drawing area  */
+  xhbox = gtk_hbox_new (FALSE, 5);
+  gtk_box_pack_start (GTK_BOX (xvbox), xhbox, FALSE, TRUE, 0);
+
+  xlogo_box = gtk_vbox_new (FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (xhbox), xlogo_box, FALSE, FALSE, 0);
+
+  xframe2 = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (xframe2), GTK_SHADOW_IN);
+  gtk_box_pack_start (GTK_BOX (xlogo_box), xframe2, FALSE, FALSE, 0);
+
+  xpreview = gtk_preview_new (GTK_PREVIEW_COLOR);
+  gtk_preview_size (GTK_PREVIEW (xpreview), logo_width, logo_height);
+  temp = g_new (guchar,logo_width * 3);
+  datapointer=(guchar *)header_data;
+  for (y = 0; y < logo_height; y++)
+  {
+    temp2=temp;
+    for (x = 0; x< logo_width; x++)
+    {
+      HEADER_PIXEL(datapointer,temp2);
+      temp2+=3;
+    }
+    gtk_preview_draw_row (GTK_PREVIEW (xpreview), temp,
+                         0, y, logo_width);
+  }
+  g_free(temp);
+  gtk_container_add (GTK_CONTAINER (xframe2), xpreview);
+  gtk_widget_show (xpreview);
+  gtk_widget_show (xframe2);
+  gtk_widget_show (xlogo_box);
+  gtk_widget_show (xhbox);
+
+  xhbox = gtk_hbox_new(FALSE, 5);
+  gtk_box_pack_start(GTK_BOX(xvbox), xhbox, TRUE, TRUE, 0);
+  text = "\nFirst written by Charles Vidal <vidalc@club-internet.fr>.\n"
+         "Continual improvements by Remi Cohen-Scali <remi.cohenscali@pobox.com>.\n"
+         "Updates by Eric Lassauge <lassauge@mail.dotcom.fr>.\n\n"
+         "GTK+ launcher for xlockmore: the maintained version of xlock.\n"
+        "http://www.tux.org/~bagleyd/xlockmore.html\n"
+        "Version 2.0\n";
+
+  xlabel = gtk_label_new(text);
+  gtk_box_pack_start(GTK_BOX(xhbox), xlabel, TRUE, FALSE, 0);
+  gtk_widget_show(xlabel);
+
+  gtk_widget_show(xhbox);
+
+  gtk_widget_show(xvbox);
+  gtk_widget_show(xframe);
+  gtk_widget_show(xdlg);
+}
+
+
+/* ================================================================= */
+/*                                                                   */
+/*                     Menu bar creation routines                    */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * create_file_menu
+ * ----------------
+ * Create the file menu attached to file menubar item
+ */
+static GtkWidget *
+create_file_menu(GtkWidget *window)
+{
+    GtkWidget           *menu;
+    GtkWidget           *menu_item;
+    GtkAccelGroup       *group;
+
+    menu = gtk_menu_new();
+    group = gtk_accel_group_new();
+    gtk_menu_set_accel_group (GTK_MENU (menu), group);
+
+    menu_item = gtk_menu_item_new_with_label("Kill xlock");
+    gtk_container_add( GTK_CONTAINER (menu), menu_item);
+    gtk_widget_add_accelerator(menu_item,
+                              "activate",
+                              group,
+                              'K',
+                              0, GTK_ACCEL_VISIBLE);
+    gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
+                        (GtkSignalFunc) kill_xlock_cb,
+                        (gpointer) window);
+    gtk_widget_show(menu_item);
+
+    menu_item = gtk_menu_item_new_with_label("Quit");
+    gtk_container_add( GTK_CONTAINER (menu), menu_item);
+    gtk_widget_add_accelerator(menu_item,
+                              "activate",
+                              group,
+                              'Q',
+                              0, GTK_ACCEL_VISIBLE);
+    gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
+                        (GtkSignalFunc) exit_xglock,
+                        (gpointer) window);
+    gtk_widget_show(menu_item);
+
+    return menu;
+}
+
+/*
+ * create_help_menu
+ * ----------------
+ * Create the help menu attached to help menubar item
+ */
+static GtkWidget  *
+create_help_menu(GtkWidget *window)
+{
+    GtkWidget           *menu;
+    GtkWidget           *menu_item;
+    GtkAccelGroup *group;
+
+    menu = gtk_menu_new();
+    group = gtk_accel_group_new();
+    gtk_menu_set_accel_group (GTK_MENU (menu), group);
+
+    menu_item = gtk_menu_item_new_with_label("Context help");
+    gtk_container_add( GTK_CONTAINER (menu), menu_item);
+    gtk_widget_add_accelerator(menu_item,
+                                   "activate",
+                              group,
+                                   'C',
+                              0, GTK_ACCEL_VISIBLE);
+    gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
+                        (GtkSignalFunc) contextual_help_dialog,
+                        (gpointer) window);
+    gtk_widget_show(menu_item);
+
+    menu_item = gtk_menu_item_new_with_label("Window help");
+    gtk_container_add( GTK_CONTAINER (menu), menu_item);
+    gtk_widget_add_accelerator(menu_item,
+                                   "activate",
+                              group,
+                                   'W',
+                              0, GTK_ACCEL_VISIBLE);
+    gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
+                        (GtkSignalFunc) window_help_dialog,
+                        (gpointer) window);
+    gtk_widget_show(menu_item);
+
+    menu_item = gtk_menu_item_new_with_label("Global help");
+    gtk_container_add( GTK_CONTAINER (menu), menu_item);
+    gtk_widget_add_accelerator(menu_item,
+                                   "activate",
+                              group,
+                                   'G',
+                              0, GTK_ACCEL_VISIBLE);
+    gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
+                        (GtkSignalFunc) global_help_dialog,
+                        (gpointer) window);
+    gtk_widget_show(menu_item);
+
+    menu_item = gtk_menu_item_new_with_label("About XgLock");
+    gtk_container_add( GTK_CONTAINER (menu), menu_item);
+    gtk_widget_add_accelerator(menu_item,
+                                   "activate",
+                              group,
+                                   'A',
+                              0, GTK_ACCEL_VISIBLE);
+    gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
+                        (GtkSignalFunc) about_dialog,
+                        (gpointer) window);
+    gtk_widget_show(menu_item);
+
+    return menu;
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*             Special parameters' dialog creation                   */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * create_fntColorOptions_entries
+ * ------------------------------
+ * Create all entries for font and color options.
+ */
+static void
+create_fntColorOptions_entries(GtkScrolledWindow *window)
+{
+    gint         i;
+    GtkWidget   *box0;
+    GtkWidget   *box1;
+    GtkWidget   *table;
+    GtkWidget   *label;
+    GtkWidget   *entry;
+    GtkWidget   *button =(GtkWidget *)NULL;
+    GdkColor    gdkcol_bg;
+    GdkColor    gdkcol_fg;
+
+
+    box0 = gtk_hbox_new(FALSE, 0);
+    gtk_scrolled_window_add_with_viewport(window, box0);
+    gtk_widget_show(box0);
+
+    table = gtk_table_new(nb_fntColorOpt,6,0);
+    gtk_table_set_row_spacings(GTK_TABLE(table),XGLOCK_TABLE_ROW_SPACING);
+    gtk_table_set_col_spacings(GTK_TABLE(table),XGLOCK_TABLE_COL_SPACING);
+    gtk_container_border_width(GTK_CONTAINER(table),XGLOCK_TABLE_BORDER_WIDTH);
+    gtk_box_pack_start(GTK_BOX(box0),table,TRUE,TRUE,XGLOCK_SPACING);
+    gtk_widget_show(table);
+
+    for (i = 0; i < nb_fntColorOpt; i++) {
+
+        label = gtk_label_new(fntcolorOpt[i].label);
+        gtk_table_attach(GTK_TABLE(table),label,
+                         0,1,i,i+1,
+                         GTK_EXPAND|GTK_FILL,
+                         GTK_EXPAND|GTK_FILL,
+                         XGLOCK_TABLE_SPACING,
+                         XGLOCK_TABLE_SPACING);
+        gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
+        gtk_widget_show(label);
+
+        fntcolorOpt[i].entry = entry = gtk_entry_new();
+        gtk_entry_set_editable(GTK_ENTRY(entry), False);
+        gtk_widget_set_usize(entry, 0, 21);
+        gtk_tooltips_set_tip(tooltips, entry, fntcolorOpt[i].desc,(gchar *)NULL);
+        gtk_table_attach(GTK_TABLE(table),entry,
+                         1,5,i,i+1,
+                         GTK_EXPAND|GTK_FILL,
+                         GTK_EXPAND|GTK_FILL,
+                         XGLOCK_TABLE_SPACING,
+                         XGLOCK_TABLE_SPACING);
+        gtk_widget_show(entry);
+
+        switch ( fntcolorOpt[i].type ) {
+
+          case TFNTCOL_COLOR:
+            box1 = gtk_hbox_new(FALSE, 0);
+            gtk_container_border_width(GTK_CONTAINER(box1),XGLOCK_TABLE_BORDER_WIDTH);
+            gtk_table_attach(GTK_TABLE(table),box1,
+                             5,6,i,i+1,
+                             GTK_EXPAND|GTK_FILL,
+                             GTK_EXPAND|GTK_FILL,
+                             XGLOCK_TABLE_SPACING,
+                             XGLOCK_TABLE_SPACING);
+            gtk_widget_show(box1);
+
+            gdkcol_bg.red = 0x0000;
+            gdkcol_bg.green = 0x0000;
+            gdkcol_bg.blue = 0x0000;
+            gdk_color_alloc(gdkcolormap, &gdkcol_bg);
+            gdkcol_bg.red = 0xffff;
+            gdkcol_bg.green = 0xffff;
+            gdkcol_bg.blue = 0xffff;
+            gdk_color_alloc(gdkcolormap, &gdkcol_fg);
+            button = gtk_button_new_with_label( "Select color ..." );
+            gtk_signal_connect(GTK_OBJECT(button), "clicked",
+                               (GtkSignalFunc) create_color_selection_dialog,
+                               (gpointer)&fntcolorOpt[i]);
+            GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
+            gtk_tooltips_set_tip(tooltips, button, fntcolorOpt[i].desc,(gchar *)NULL);
+            gtk_box_pack_start(GTK_BOX(box1), button, FALSE, TRUE, 0);
+            gtk_widget_show(button);
+
+            fntcolorOpt[i].drawing_area = gtk_drawing_area_new();
+            gtk_tooltips_set_tip(tooltips, fntcolorOpt[i].drawing_area, fntcolorOpt[i].desc,(gchar *)NULL);
+            gtk_widget_set_usize(fntcolorOpt[i].drawing_area, 10, 21);
+            gtk_container_add(GTK_CONTAINER(box1), fntcolorOpt[i].drawing_area);
+            gtk_widget_show(fntcolorOpt[i].drawing_area);
+
+            break;
+
+          case TFNTCOL_FONT:
+            button = gtk_button_new_with_label( "Select font ..." );
+            gtk_signal_connect(GTK_OBJECT(button), "clicked",
+                               (GtkSignalFunc) create_font_selection_dialog,
+                               (gpointer)&fntcolorOpt[i]);
+            GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
+            gtk_tooltips_set_tip(tooltips, button, fntcolorOpt[i].desc,(gchar *)NULL);
+            gtk_table_attach(GTK_TABLE(table),button,
+                             5,6,i,i+1,
+                             GTK_EXPAND|GTK_FILL,
+                             GTK_EXPAND|GTK_FILL,
+                             XGLOCK_TABLE_SPACING,
+                             XGLOCK_TABLE_SPACING);
+            gtk_widget_show(button);
+            break;
+
+          case TFNTCOL_FILE:
+            button = gtk_button_new_with_label( "Select file ..." );
+            gtk_signal_connect(GTK_OBJECT(button), "clicked",
+                               (GtkSignalFunc) create_file_selection_dialog,
+                               (gpointer)&fntcolorOpt[i]);
+            GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
+            gtk_tooltips_set_tip(tooltips, button, fntcolorOpt[i].desc,(gchar *)NULL);
+            gtk_table_attach(GTK_TABLE(table),button,
+                             5,6,i,i+1,
+                             GTK_EXPAND|GTK_FILL,
+                             GTK_EXPAND|GTK_FILL,
+                             XGLOCK_TABLE_SPACING,
+                             XGLOCK_TABLE_SPACING);
+            gtk_widget_show(button);
+            break;
+
+          default:
+            fprintf(stderr,
+                    "Program Inconsistency: Unknown parameter type #%d !\n",
+                    fntcolorOpt[i].type );
+        }
+
+        if ( fntcolorOpt[i].drawing_area && GTK_WIDGET(fntcolorOpt[i].drawing_area)->window )
+          gdk_window_set_background(GTK_WIDGET(fntcolorOpt[i].drawing_area)->window,
+                                    &gdkcol_bg);
+    }
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*                   Create general optrions entries                 */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * create_genOptions_entries
+ * -------------------------
+ * Create all entries for general options (text fields).
+ */
+static void
+create_genOptions_entries(GtkScrolledWindow *window)
+{
+    gint         i;
+/*     gint         j; */
+    GtkWidget   *box0;
+    GtkWidget   *box1;
+    GtkWidget   *box2;
+    GtkWidget   *entry;
+    GtkWidget   *label;
+
+
+    box0 = gtk_hbox_new(FALSE, 0);
+    gtk_scrolled_window_add_with_viewport(window, box0);
+    gtk_widget_show(box0);
+
+    box1 = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box0), box1);
+    gtk_widget_show(box1);
+
+    box2 = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box0), box2);
+    gtk_widget_show(box2);
+
+    for (i = 0; i < nb_genOpt; i++) {
+        label = gtk_label_new(generalOpt[i].label);
+        gtk_widget_set_usize(label, 60, 21);
+        gtk_box_pack_start(GTK_BOX(box1), label, FALSE, TRUE, 0);
+        gtk_widget_show(label);
+    }
+    for (i = 0; i < nb_genOpt; i++) {
+        entry = gtk_entry_new();
+        gtk_widget_set_usize(entry, 350, 21);
+        gtk_tooltips_set_tip(tooltips, entry, generalOpt[i].desc,(gchar *)NULL);
+        gtk_box_pack_start(GTK_BOX(box2), entry, FALSE, TRUE, 0);
+        gtk_widget_show(entry);
+        generalOpt[i].text_widget = entry;
+    }
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*             Create boolean options check buttons                  */
+/*                                                                   */
+/* ================================================================= */
+
+/*
+ * create_boolOptions_buttons
+ * --------------------------
+ * Creates all toggles buttons for boolean options
+ */
+static void
+create_boolOptions_buttons(GtkScrolledWindow *parent)
+{
+    gint         i;
+    GtkWidget   *box0;
+    GtkWidget   *box1;
+    GtkWidget   *box2;
+    GtkWidget   *button;
+
+
+    box0 = gtk_hbox_new(FALSE, 0);
+    gtk_scrolled_window_add_with_viewport(parent, box0);
+    gtk_widget_show(box0);
+
+    box1 = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box0), box1);
+    gtk_widget_show(box1);
+
+    box2 = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box0), box2);
+    gtk_widget_show(box2);
+
+    for (i = 0; i < nb_boolOpt; i++) {
+        button = gtk_check_button_new_with_label(BoolOpt[i].label);
+        gtk_tooltips_set_tip(tooltips, button, BoolOpt[i].desc,(gchar *)NULL);
+        gtk_box_pack_start(GTK_BOX(i%2 ? box1 : box2), button, TRUE, TRUE, 0);
+        gtk_signal_connect(GTK_OBJECT(button), "clicked",
+                           (GtkSignalFunc) bool_option_clicked_cb,
+                           (gpointer)i);
+        gtk_widget_show(button);
+    }
+}
+
+/* ================================================================= */
+/*                                                                   */
+/*                            Main function                          */
+/*                                                                   */
+/* ================================================================= */
+
+gint
+main(gint argc, gchar *argv[])
+{
+    GtkWidget  *xglockroot;
+    GdkWindow  *gdkwin;
+    Window     *xwin;
+
+    GtkWidget  *box0;
+    GtkWidget  *box1;
+    GtkWidget  *box2;
+    GtkWidget  *box3;
+    GtkWidget  *scrolled_win;
+    GtkWidget  *list;
+    GtkWidget  *list_item;
+    GtkWidget  *button;
+    GtkWidget  *separator;
+    GtkWidget  *menubar;
+    GtkWidget  *menuitem;
+    GtkWidget  *menu;
+    GtkWidget  *previewButton;
+    GtkWidget  *notebook;
+    GtkWidget  *frame;
+    GtkWidget  *label;
+    gint        i;
+    gchar       temp[100];
+
+    /* Init for some data */
+    nb_mode = sizeof (LockProcs) / sizeof (LockProcs[0]);
+    nb_boolOpt = sizeof (BoolOpt) / sizeof (BoolOpt[0]);
+    nb_genOpt = sizeof (generalOpt) / sizeof (generalOpt[0]);
+    nb_fntColorOpt = sizeof (fntcolorOpt) / sizeof (fntcolorOpt[0]);
+
+#ifdef USE_MB
+    gtk_set_locale();
+#endif
+    gtk_init(&argc, &argv);
+    gtk_rc_parse(XGLOCKRC_FILE);
+    gtk_rc_parse("xglockrc");
+
+/*
+    gdkvisual = gdk_visual_get_best();
+    gdkcolormap = gdk_colormap_new(gdkvisual, False);
+*/
+    /* E.Lassauge : now it works in 8bits Pseudo-Color */
+    gdkcolormap = gdk_colormap_get_system();
+
+    xglockroot = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    gtk_widget_set_name(xglockroot, "xglock");
+    gtk_window_set_title(GTK_WINDOW(xglockroot), "GTK+ XLock Launcher");
+    gtk_window_set_wmclass (GTK_WINDOW (xglockroot), "XgLock", "XLock");
+
+    tooltips = gtk_tooltips_new();
+
+    box1 = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(xglockroot), box1);
+    gtk_widget_show(box1);
+
+    box0 = gtk_vbox_new(FALSE, 10);
+    gtk_container_border_width(GTK_CONTAINER(box0), 10);
+    gtk_box_pack_start(GTK_BOX(box1), box0, TRUE, TRUE, 0);
+    gtk_widget_show(box0);
+
+    box2 = gtk_hbox_new(FALSE, 10);
+    gtk_container_border_width(GTK_CONTAINER(box2), 10);
+    gtk_box_pack_start(GTK_BOX(box1), box2, TRUE, TRUE, 0);
+    gtk_widget_show(box2);
+
+    /* menu bar */
+    menubar = gtk_menu_bar_new();
+    gtk_box_pack_start(GTK_BOX(box0), menubar, FALSE, TRUE, 0);
+    gtk_widget_show(menubar);
+
+    /* File menu and File menu bar item */
+    menu = create_file_menu(xglockroot);
+    menuitem = gtk_menu_item_new_with_label("File");
+    gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
+    gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
+    gtk_widget_show(menuitem);
+
+    /* File menu and File menu bar item */
+    menu = create_help_menu(xglockroot);
+    menuitem = gtk_menu_item_new_with_label("Help");
+    gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
+    gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
+    gtk_widget_show(menuitem);
+
+    /* Third box containing preview button */
+    box3 = gtk_hbox_new(FALSE, 10);
+    gtk_widget_set_usize(box3, WINDOW_WIDTH+20, WINDOW_HEIGHT );
+    gtk_container_border_width(GTK_CONTAINER(box3), 1);
+    gtk_box_pack_start(GTK_BOX(box0), box3, TRUE, TRUE, 0);
+    gtk_widget_show(box3);
+
+    /* Preview button (button because I need here an X window) */
+    previewButton = gtk_button_new_with_label( "Preview window" );
+    gtk_widget_set_name(previewButton,"preview_button");
+    gtk_widget_set_usize(previewButton, WINDOW_WIDTH, WINDOW_HEIGHT );
+    gtk_box_pack_start(GTK_BOX(box3), previewButton, TRUE, FALSE, 10);
+    gtk_tooltips_set_tip(tooltips, previewButton, "This is the preview window",(gchar *)NULL);
+    gtk_widget_realize(previewButton);
+    gtk_widget_show(previewButton);
+
+    /* Getting X window id through GDK */
+    gdkwin = GTK_WIDGET(previewButton)->window;
+    xwin =(Window *)GDK_WINDOW_XWINDOW( gdkwin );
+    (void) sprintf(numberwidget, "%ld",(unsigned long)xwin );
+
+    /* notebook */
+    notebook = gtk_notebook_new();
+    gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
+    gtk_box_pack_start(GTK_BOX(box2), notebook, TRUE, TRUE, 0);
+    gtk_widget_show(notebook);
+
+    /* list of modes */
+    frame = gtk_frame_new("Choice of the mode");
+    gtk_container_border_width(GTK_CONTAINER(frame), 10);
+    gtk_widget_set_usize(frame, FRAME_WIDTH, FRAME_HEIGHT);
+
+    /* list */
+    scrolled_win = gtk_scrolled_window_new(NULL, NULL);
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_win),
+                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_container_add(GTK_CONTAINER(frame), scrolled_win);
+    gtk_widget_show(scrolled_win);
+
+    list = gtk_list_new();
+    gtk_list_set_selection_mode(GTK_LIST(list), GTK_SELECTION_SINGLE);
+    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_win), list);
+    gtk_container_set_focus_vadjustment (GTK_CONTAINER (list),
+                                         gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled_win)));
+    GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW (scrolled_win)->vscrollbar, GTK_CAN_FOCUS);
+    gtk_tooltips_set_tip(tooltips, list, "Select the mode you want to try",(gchar *)NULL);
+
+    for (i = 0; i < nb_mode; i++) {
+        sprintf(temp, "%s :%s", LockProcs[i].cmdline_arg, LockProcs[i].desc);
+        list_item = gtk_list_item_new_with_label(temp);
+        gtk_container_add(GTK_CONTAINER(list), list_item);
+        gtk_signal_connect (GTK_OBJECT (list_item), "select",
+                            (GtkSignalFunc) mode_list_item_select_cb,
+                            (gpointer) ((long) i));
+        gtk_signal_connect (GTK_OBJECT (list_item), "deselect",
+                            (GtkSignalFunc) mode_list_item_unselect_cb,
+                            (gpointer) NULL);
+        gtk_widget_show(list_item);
+    }
+    gtk_widget_show( list );
+
+    label = gtk_label_new("Choose the mode");
+    gtk_widget_show(frame);
+    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label);
+
+    /* Options */
+
+    frame = gtk_frame_new("Boolean Options");
+    gtk_container_border_width(GTK_CONTAINER(frame), 10);
+    gtk_widget_set_usize(frame, FRAME_WIDTH, FRAME_HEIGHT);
+    gtk_widget_show(frame);
+
+    scrolled_win = gtk_scrolled_window_new(NULL, NULL);
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_win),
+                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_container_add(GTK_CONTAINER(frame), scrolled_win);
+    gtk_widget_show(scrolled_win);
+
+    create_boolOptions_buttons(GTK_SCROLLED_WINDOW(scrolled_win));
+    label = gtk_label_new("Options");
+    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label);
+    /* General Options */
+
+    frame = gtk_frame_new("General Options");
+    gtk_container_border_width(GTK_CONTAINER(frame), 10);
+    gtk_widget_set_usize(frame, FRAME_WIDTH, FRAME_HEIGHT);
+    gtk_widget_show(frame);
+
+    scrolled_win = gtk_scrolled_window_new(NULL, NULL);
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_win),
+                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_container_add(GTK_CONTAINER(frame), scrolled_win);
+    gtk_widget_show(scrolled_win);
+
+    create_genOptions_entries(GTK_SCROLLED_WINDOW(scrolled_win));
+    label = gtk_label_new("General Options");
+    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label);
+    /* Color Options */
+
+    frame = gtk_frame_new("Color Options");
+    gtk_container_border_width(GTK_CONTAINER(frame), 10);
+    gtk_widget_set_usize(frame, FRAME_WIDTH, FRAME_HEIGHT );
+    gtk_widget_show(frame);
+
+    scrolled_win = gtk_scrolled_window_new(NULL, NULL);
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_win),
+                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_container_add(GTK_CONTAINER(frame), scrolled_win);
+    gtk_widget_show(scrolled_win);
+
+    create_fntColorOptions_entries(GTK_SCROLLED_WINDOW(scrolled_win));
+    label = gtk_label_new("Font & Color Options");
+    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label);
+
+    /* end of notebook */
+    separator = gtk_hseparator_new();
+    gtk_box_pack_start(GTK_BOX(box1), separator, FALSE, TRUE, 0);
+    gtk_widget_show(separator);
+
+    /* Last Hbox for buttons */
+    box2 = gtk_hbox_new(FALSE, 10);
+    gtk_container_border_width(GTK_CONTAINER(box2), 10);
+    gtk_box_pack_start(GTK_BOX(box1), box2, FALSE, TRUE, 0);
+    gtk_widget_show(box2);
+
+    /* buttons */
+    button = gtk_button_new_with_label("Launch");
+    gtk_widget_set_usize(button, 60, 30);
+    GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
+    gtk_tooltips_set_tip(tooltips, button, "Launch xlock in selected mode",(gchar *)NULL);
+    gtk_signal_connect(GTK_OBJECT(button), "clicked",
+                       (GtkSignalFunc) launch_xlock,
+                       (gpointer) NULL);
+    gtk_box_pack_start(GTK_BOX(box2), button, FALSE, TRUE, 4);
+    gtk_widget_show(button);
+
+    /* launch in root button */
+    button = gtk_button_new_with_label("Launch in root");
+    gtk_widget_set_usize(button, 95, 30);
+    GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
+    gtk_tooltips_set_tip(tooltips, button, "Launch xlock in root window",(gchar *)NULL);
+    gtk_signal_connect(GTK_OBJECT(button), "clicked",
+                       (GtkSignalFunc) launch_xlock,
+                       (gpointer) "-inroot" );
+    gtk_box_pack_start(GTK_BOX(box2), button, FALSE, TRUE, 4);
+    gtk_widget_show(button);
+
+    /* launch -- in window -- button */
+    button = gtk_button_new_with_label("Launch in window");
+    gtk_widget_set_usize(button, 115, 30);
+    GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
+    gtk_tooltips_set_tip(tooltips, button, "Launch xlock in a window",(gchar *)NULL);
+    gtk_signal_connect(GTK_OBJECT(button), "clicked",
+                       (GtkSignalFunc) launch_xlock,
+                       (gpointer) "-inwindow" );
+    gtk_box_pack_start(GTK_BOX(box2), button, FALSE, TRUE, 4);
+    gtk_widget_show(button);
+
+    /* exit button */
+    button = gtk_button_new_with_label("Exit");
+    gtk_widget_set_name(button,"special_button");
+    gtk_tooltips_set_tip(tooltips, button, "Exit xglock",(gchar *)NULL);
+    gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
+                              (GtkSignalFunc) exit_xglock,
+                              (gpointer)xglockroot );
+    gtk_box_pack_start(GTK_BOX(box2), button, TRUE, TRUE, 4);
+    GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+    gtk_widget_grab_default(button);
+    gtk_widget_show(button);
+
+    gtk_widget_show(xglockroot);
+
+    gtk_main();
+
+    return 0;
+}
diff --git a/xglock/xglockrc b/xglock/xglockrc
new file mode 100644 (file)
index 0000000..3f59870
--- /dev/null
@@ -0,0 +1,41 @@
+  style "tooltip"
+  {
+    font = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*"
+    fg[NORMAL] = { 0.0, 0.0, 0.0 }
+    bg[NORMAL] = { 1.0, 1.0, 1.0 }
+  }
+
+  style "button"
+  {
+     font = "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
+     fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
+     bg[PRELIGHT] = { 0.67, 0.85, 0.90 }
+     fg[ACTIVE] =   { 1.0, 1.0, 1.0 }
+     bg[ACTIVE] =   { 0.67, 0.85, 0.90 }
+     fg[NORMAL] =   { 1.0, 1.0, 1.0 }
+     bg[NORMAL] =   { 0.67, 0.85, 0.90 }
+  }
+
+  style "preview" = "button"
+  {
+     fg[PRELIGHT] = { 0.0, 0.0, 0.0 }
+     bg[PRELIGHT] = { 1.0, 1.0, 1.0 }
+     fg[ACTIVE] =   { 0.0, 0.0, 0.0 }
+     bg[ACTIVE] =   { 1.0, 1.0, 1.0 }
+     fg[NORMAL] =   { 0.0, 0.0, 0.0 }
+     bg[NORMAL] =   { 1.0, 1.0, 1.0 }
+  }
+
+  style "special" = "button"
+  {
+     bg[NORMAL] = { 0.98, 0.50, 0.50 }
+     bg[ACTIVE] =   { 1.00, 0.75, 0.79 }
+     bg[PRELIGHT] =   { 1.00, 0.00, 0.00 }
+  }
+
+  widget "xglock.*GtkButton*"   style "button"
+
+  widget "gtk-tooltips" style "tooltip"
+
+  widget "*preview_button*" style "preview"
+  widget "*special_button*" style "special"
diff --git a/xlock/Imakefile b/xlock/Imakefile
new file mode 100644 (file)
index 0000000..08569cf
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef XCOMM
+#define XCOMM /**/#
+#endif
+XCOMM @(#)Sub Imakefile        xlockmore
+XCOMM
+
+#include "../iconfig.h"
+top_srcdir = ..
+UTILSDIR = ./
+UTILOBJDIR = ./
+
+DU = $(UTILDIR)
+DOU = $(UTILOBJDIR)
+OU = $(O)$(S)$(DOU)
+CU = $(C) $(DU)
+
+XCOMM  List of object files
+XLOCKUTILOBJS = $(DOU)xlock$(OU)passwd$(OU)resource$(OU)parsecmd$(O)$(S)\
+$(DOU)util$(OU)logout$(OU)mode$(OU)xlockimage$(OU)ras$(OU)xbm$(O)$(S)\
+$(DOU)vis$(OU)visgl$(OU)color$(OU)random$(OU)iostuff$(OU)automata$(O)$(S)\
+$(DOU)spline$(OU)sound$(OU)erase$(O)$(S)\
+$(DOU)vtlock$(OU)vtlock_proc$(O)
+#ifdef Check
+XLOCKCHECKOBJS = $(S)memcheck$(O)
+#endif
+
+XCOMM  List of source files
+XLOCKUTILHDRS = xlock.h mode.h vroot.h xlockimage.h ras.h \
+version.h config.h
+XLOCKUTILSRCS = $(DU)xlock$(CU)passwd$(CU)resource$(CU)parsecmd$(C) \
+$(DU)util$(CU)logout$(CU)mode$(CU)xlockimage$(CU)ras$(CU)xbm$(C) \
+$(DU)vis$(CU)visgl$(CU)color$(CU)random$(CU)iostuff$(CU)automata$(C) \
+$(DU)spline$(CU)sound$(CU)erase$(C) \
+$(DU)vtlock$(CU)vtlock_proc$(C)
+XLOCKCHECKSRCS = $(DU)memcheck$(C)
+
+XCOMM default target
+
+all:: $(XLOCKUTILOBJS) $(XLOCKDEBUGOBJS)
+
+DependTarget()
+LintTarget()
+
+InstallProgram(xlock,$(BINDIR))
+InstallAppDefaults(XLock)
+InstallManPage(xlock,$(MANDIR))
+
+distclean::    clean
+       $(RM) Makefile config.status config.cache config.log config.h memdiag.xlock-*
+
+clean.all:: distclean
+
diff --git a/xlock/Makefile.in b/xlock/Makefile.in
new file mode 100644 (file)
index 0000000..22af744
--- /dev/null
@@ -0,0 +1,331 @@
+# $Id : Makefile.in 4.16 2000/01/17 $
+#
+# xlockmore Makefile.in for autoconf (UNIX/VMS X11 support)
+############################################################
+
+# @SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@/
+BITMAPDIR = @BITMAPDIR@/
+UTILDIR = $(top_srcdir)/xlock/
+UTILOBJDIR = ./
+
+N =
+O = .o
+#O = .obj
+C = .c
+#C = .cc
+S = $(N) $(N)
+#S = ,
+
+DU = $(UTILDIR)
+DOU = $(UTILOBJDIR)
+OU = $(O)$(S)$(DOU)
+CU = $(C) $(DU)
+
+# please define
+# C as the C source code extension
+# O as the object extension
+# S as the separator for object code
+
+
+# This debugging is new and is untested on many systems.
+@CHECK@CHECKDEF = -DDEBUG
+@CHECK@XLOCKCHECKOBJS = $(DOU)memcheck$(O)
+
+# List of object files
+XLOCKUTILOBJS = $(DOU)xlock$(OU)passwd$(OU)resource$(OU)parsecmd$(O)$(S)\
+$(DOU)util$(OU)logout$(OU)mode$(OU)xlockimage$(OU)ras$(OU)xbm$(O)$(S)\
+$(DOU)vis$(OU)visgl$(OU)color$(OU)random$(OU)iostuff$(OU)automata$(O)$(S)\
+$(DOU)spline$(OU)sound$(OU)erase$(OU)magick$(O)$(S)\
+$(DOU)vtlock$(OU)vtlock_proc$(O)$(S)$(XLOCKCHECKOBJS)
+
+XLOCKCHECKSRCS = $(DU)memcheck$(C)
+
+XLOCKUTILHDRS = xlock.h mode.h vroot.h xlockimage.h ras.h \
+version.h config.h
+XLOCKUTILSRCS = $(DU)xlock$(CU)passwd$(CU)resource$(CU)parsecmd$(C) \
+$(DU)util$(CU)logout$(CU)mode$(CU)xlockimage$(CU)ras$(CU)xbm$(C) \
+$(DU)vis$(CU)visgl$(CU)color$(CU)random$(CU)iostuff$(CU)automata$(C) \
+$(DU)spline$(CU)sound$(CU)erase$(CU)magick$(C) \
+$(DU)vtlock$(CU)vtlock_proc$(C) $(XLOCKCHECKSRCS)
+
+# default target
+all : $(XLOCKUTILOBJS)
+
+# this tells GNU make not to export variables into the environment
+# But other makes do not understand its significance, so it must
+# not be the first target in the file. So it is here, before
+# any variables are created, but after the default target
+.NOEXPORT :
+
+SHELL = /bin/sh
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+mandir = @mandir@/man1
+xapploaddir = @APPDEFAULTS@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTPGMFLAGS = @INSTPGMFLAGS@
+
+
+#CC = cc -g
+#CC = cc -Ac -g
+#CC = cc -Xc -g
+#CC = acc -g
+#CC = CC -g
+#CC = gcc -g -Wall -ansi -pedantic
+#CC = gcc -g -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wstrict-prototypes
+#CC = g++ -g -Wall
+CC = @CC@
+
+#LINT = lint
+LINT = lint -Ncheck=%all
+#LINT = alint
+
+#DEPEND = makedepend
+DEPEND = @DEPEND@
+DEPEND_FLAGS = @DEPEND_FLAGS@
+DEPEND_DEFINES = @DEPEND_DEFINES@
+
+LN_S = @LN_S@
+RM = rm -f
+RM_S = $(RM)
+ECHO = echo
+
+#BLN_S = set file/enter=[]
+#RM = delete/noconfirm/nolog
+#RM_S = set file/remove/nolog
+#ECHO = write sys$output
+
+DEF_MODULEPATH = $(prefix)/lib/xlock_modules
+@MODULES@MODULEDEF = -DDEF_MODULEPATH=\"$(DEF_MODULEPATH)\"
+DEFINES = -DDEF_FILESEARCHPATH=\"$(xapploaddir)/%N%C%S:$(xapploaddir)/%N%S\" $(MODULEDEF) $(CHECKDEF)
+DEFS = @DEFS@ $(DEFINES)
+XLOCKINC = -I. -I.. -I../.. @XLOCKINC@
+CFLAGS = @CFLAGS@
+#CFLAGS = -O
+#CFLAGS = -g
+
+#If you have purify, and want to use it, uncomment this definition or
+# run the make as `make PURIFY=purify'
+# or run configure with the --with-purify argument.
+PURIFY = @PURIFY@
+
+.SUFFIXES : $(C) $(O)
+
+$(C)$(O) :
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEFS) $(XLOCKINC) $(CFLAGS) $<
+
+install :
+
+install-program :
+
+install-man :
+
+install-ad :
+
+uninstall :
+
+uninstall-program :
+
+uninstall-man :
+
+uninstall-ad :
+
+install.program : install-program
+
+install.man : install-man
+
+install.ad : install-ad
+
+uninstall.program : uninstall-program
+
+uninstall.man : uninstall-man
+
+uninstall.ad : uninstall-ad
+
+lint :
+
+xrdb :
+       xrdb $(UTILDIR)XLock.ad
+
+man :
+       nroff -man $(UTILDIR)/xlock.man | more
+
+html :
+       nroff -man < $(UTILDIR)xlock.man | man2html > $(UTILOBJDIR)xlock.html
+
+hlp :
+       (PROG=`echo "xlock" | tr -s  [:lower:] [:upper:]` ; \
+ echo "1 ${PROG}" ; nroff -man < $(UTILDIR)xlock.man \
+ | sed -e 's/.\b//g' -e '/^ *Page [0-9]/D' \
+ -e '/^User Commands/D' \
+ -e '/X11R6 Contrib *Last change: /D' \
+ -e 's/^     //' \
+ -e '/^NAME/D;/^SYNOPSIS/D;/^DESCRIPTION/D' \
+ -e 's/\(Copyright\) .*c.*\(19\)/\1 (C) \2/' \
+ -e 's/^\([A-Z][A-Z]*\) \([A-Z][A-Z]*\)/\1_\2/' \
+ -e 's/^\([A-Z]\)/2 \1/' \
+ | more -flsu | /usr/xpg4/bin/more -s) \
+ > $(UTILOBJDIR)xlock.hlp
+
+clean :
+       $(RM) *.o core *~ *% *.bak *.orig *.rej make.log MakeOut xlock memdiag.xlock-* *.patch
+
+distclean : clean
+       $(RM) Makefile
+
+clean.all : distclean
+
+# Adds all current dependencies to Makefile
+depend :
+       $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
+       $(DEPEND_FLAGS) --                                                  \
+       $(XLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                  \
+       $(XLOCKUTILSRCS)
+
+# Adds some dependencies to Makefile.in -- not totally accurate, but pretty
+# close.  This excludes dependencies on files in /usr/include, etc.  It tries
+# to include only dependencies on files which are themselves a part of this
+# package.
+distdepend :
+       @echo updating dependencies in `pwd`/Makefile.in... ;               \
+       $(DEPEND) -w 0 -f -                                                 \
+       -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
+       $(XLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                  \
+       $(XLOCKUTILSRCS) |                                                  \
+       (                                                                   \
+         awk '/^#.*Id : Makefile.in/,/^# DO .*distdepend/' < Makefile.in ; \
+         sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
+             -e 's@^\.\./xlock@$$(UTILOBJDIR)@'                            \
+             -e 's@\.\./bitmaps@$$(BITMAPDIR)@g' ;                         \
+         echo ''                                                           \
+       ) > /tmp/distdepend.$$$$ &&                                         \
+       mv Makefile.in Makefile.in.bak &&                                   \
+       mv /tmp/distdepend.$$$$ Makefile.in
+
+##############################################################################
+#
+# DO NOT DELETE: updated by make distdepend
+
+$(UTILOBJDIR)/xlock.o: xlock.h
+$(UTILOBJDIR)/xlock.o: ../config.h
+$(UTILOBJDIR)/xlock.o: mode.h
+$(UTILOBJDIR)/xlock.o: random.h
+$(UTILOBJDIR)/xlock.o: color.h
+$(UTILOBJDIR)/xlock.o: util.h
+$(UTILOBJDIR)/xlock.o: iostuff.h
+$(UTILOBJDIR)/xlock.o: passwd.h
+$(UTILOBJDIR)/xlock.o: $(BITMAPDIR)/mailempty.xbm
+$(UTILOBJDIR)/xlock.o: $(BITMAPDIR)/mailfull.xbm
+$(UTILOBJDIR)/xlock.o: vroot.h
+$(UTILOBJDIR)/passwd.o: xlock.h
+$(UTILOBJDIR)/passwd.o: ../config.h
+$(UTILOBJDIR)/passwd.o: mode.h
+$(UTILOBJDIR)/passwd.o: random.h
+$(UTILOBJDIR)/passwd.o: iostuff.h
+$(UTILOBJDIR)/passwd.o: passwd.h
+$(UTILOBJDIR)/resource.o: xlock.h
+$(UTILOBJDIR)/resource.o: ../config.h
+$(UTILOBJDIR)/resource.o: mode.h
+$(UTILOBJDIR)/resource.o: random.h
+$(UTILOBJDIR)/resource.o: vis.h
+$(UTILOBJDIR)/resource.o: visgl.h
+$(UTILOBJDIR)/resource.o: iostuff.h
+$(UTILOBJDIR)/resource.o: version.h
+$(UTILOBJDIR)/util.o: xlock.h
+$(UTILOBJDIR)/util.o: ../config.h
+$(UTILOBJDIR)/util.o: mode.h
+$(UTILOBJDIR)/util.o: random.h
+$(UTILOBJDIR)/util.o: util.h
+$(UTILOBJDIR)/logout.o: xlock.h
+$(UTILOBJDIR)/logout.o: ../config.h
+$(UTILOBJDIR)/logout.o: mode.h
+$(UTILOBJDIR)/logout.o: random.h
+$(UTILOBJDIR)/logout.o: iostuff.h
+$(UTILOBJDIR)/mode.o: xlock.h
+$(UTILOBJDIR)/mode.o: ../config.h
+$(UTILOBJDIR)/mode.o: mode.h
+$(UTILOBJDIR)/mode.o: random.h
+$(UTILOBJDIR)/xlockimage.o: xlock.h
+$(UTILOBJDIR)/xlockimage.o: ../config.h
+$(UTILOBJDIR)/xlockimage.o: mode.h
+$(UTILOBJDIR)/xlockimage.o: random.h
+$(UTILOBJDIR)/xlockimage.o: iostuff.h
+$(UTILOBJDIR)/xlockimage.o: xlockimage.h
+$(UTILOBJDIR)/ras.o: xlock.h
+$(UTILOBJDIR)/ras.o: ../config.h
+$(UTILOBJDIR)/ras.o: mode.h
+$(UTILOBJDIR)/ras.o: random.h
+$(UTILOBJDIR)/ras.o: iostuff.h
+$(UTILOBJDIR)/ras.o: ras.h
+$(UTILOBJDIR)/ras.o: xlockimage.h
+$(UTILOBJDIR)/xbm.o: xlock.h
+$(UTILOBJDIR)/xbm.o: ../config.h
+$(UTILOBJDIR)/xbm.o: mode.h
+$(UTILOBJDIR)/xbm.o: random.h
+$(UTILOBJDIR)/vis.o: xlock.h
+$(UTILOBJDIR)/vis.o: ../config.h
+$(UTILOBJDIR)/vis.o: mode.h
+$(UTILOBJDIR)/vis.o: random.h
+$(UTILOBJDIR)/vis.o: vis.h
+$(UTILOBJDIR)/vis.o: visgl.h
+$(UTILOBJDIR)/visgl.o: xlock.h
+$(UTILOBJDIR)/visgl.o: ../config.h
+$(UTILOBJDIR)/visgl.o: mode.h
+$(UTILOBJDIR)/visgl.o: random.h
+$(UTILOBJDIR)/visgl.o: visgl.h
+$(UTILOBJDIR)/color.o: xlock.h
+$(UTILOBJDIR)/color.o: ../config.h
+$(UTILOBJDIR)/color.o: mode.h
+$(UTILOBJDIR)/color.o: random.h
+$(UTILOBJDIR)/color.o: color.h
+$(UTILOBJDIR)/color.o: vis.h
+$(UTILOBJDIR)/color.o: visgl.h
+$(UTILOBJDIR)/iostuff.o: xlock.h
+$(UTILOBJDIR)/iostuff.o: ../config.h
+$(UTILOBJDIR)/iostuff.o: mode.h
+$(UTILOBJDIR)/iostuff.o: random.h
+$(UTILOBJDIR)/iostuff.o: vis.h
+$(UTILOBJDIR)/iostuff.o: visgl.h
+$(UTILOBJDIR)/iostuff.o: color.h
+$(UTILOBJDIR)/iostuff.o: iostuff.h
+$(UTILOBJDIR)/iostuff.o: ras.h
+$(UTILOBJDIR)/iostuff.o: xlockimage.h
+$(UTILOBJDIR)/automata.o: xlock.h
+$(UTILOBJDIR)/automata.o: ../config.h
+$(UTILOBJDIR)/automata.o: mode.h
+$(UTILOBJDIR)/automata.o: random.h
+$(UTILOBJDIR)/automata.o: automata.h
+$(UTILOBJDIR)/spline.o: xlock.h
+$(UTILOBJDIR)/spline.o: ../config.h
+$(UTILOBJDIR)/spline.o: mode.h
+$(UTILOBJDIR)/spline.o: random.h
+$(UTILOBJDIR)/spline.o: spline.h
+$(UTILOBJDIR)/sound.o: xlock.h
+$(UTILOBJDIR)/sound.o: ../config.h
+$(UTILOBJDIR)/sound.o: mode.h
+$(UTILOBJDIR)/sound.o: random.h
+$(UTILOBJDIR)/erase.o: xlock.h
+$(UTILOBJDIR)/erase.o: ../config.h
+$(UTILOBJDIR)/erase.o: mode.h
+$(UTILOBJDIR)/erase.o: random.h
+$(UTILOBJDIR)/erase.o: erase_init.h
+$(UTILOBJDIR)/erase.o: erase.h
+$(UTILOBJDIR)/erase.o: erase_debug.h
+$(UTILOBJDIR)/vtlock.o: xlock.h
+$(UTILOBJDIR)/vtlock.o: ../config.h
+$(UTILOBJDIR)/vtlock.o: mode.h
+$(UTILOBJDIR)/vtlock.o: random.h
+$(UTILOBJDIR)/vtlock_proc.o: xlock.h
+$(UTILOBJDIR)/vtlock_proc.o: ../config.h
+$(UTILOBJDIR)/vtlock_proc.o: mode.h
+$(UTILOBJDIR)/vtlock_proc.o: random.h
diff --git a/xlock/Makefile.inxs b/xlock/Makefile.inxs
new file mode 100644 (file)
index 0000000..2d0be0b
--- /dev/null
@@ -0,0 +1,314 @@
+# xlock/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# the `../configure' script generates `xlock/Makefile' from this file.
+
+@SET_MAKE@
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+srcdir         = @srcdir@
+VPATH          = @srcdir@
+
+install_prefix =
+prefix         = @prefix@
+exec_prefix    = @exec_prefix@
+bindir         = @bindir@
+mandir         = @mandir@
+man1dir                = $(mandir)/man1
+mansuffix      = 1
+
+CC             = @CC@
+CFLAGS         = @CFLAGS@
+LDFLAGS                = @LDFLAGS@
+DEFS           = -DSTANDALONE @DEFS@
+LIBS           = @LIBS@
+
+DEPEND         = @DEPEND@
+DEPEND_FLAGS   = @DEPEND_FLAGS@
+DEPEND_DEFINES = @DEPEND_DEFINES@
+
+SHELL          = /bin/sh
+INSTALL                = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA   = @INSTALL_DATA@
+HACKDIR                = @HACKDIR@
+
+X_CFLAGS       = @X_CFLAGS@
+X_LIBS         = @X_LIBS@
+X_PRE_LIBS     = @X_PRE_LIBS@
+X_EXTRA_LIBS   = @X_EXTRA_LIBS@
+
+HACK_PRE       = $(LIBS) $(X_LIBS) $(X_PRE_LIBS)
+HACK_POST      = -lXt -lX11 -lXext $(X_EXTRA_LIBS) -lm
+HACK_LIBS      = $(HACK_PRE)            @HACK_LIBS@ $(HACK_POST)
+XPM_LIBS       = $(HACK_PRE) @XPM_LIBS@ @HACK_LIBS@ $(HACK_POST)
+XLOCK_LIBS     = $(HACK_LIBS)
+SGI_VIDEO_OBJS  = @SGI_VIDEO_OBJS@
+SGI_VIDEO_LIBS  = @SGI_VIDEO_LIBS@
+
+XS     = $(srcdir)/../..
+XLOCK_SRC      = $(srcdir)
+XLOCK_BIN      = .
+HACKS_SRC      = $(XS)/hacks
+HACKS_BIN      = ../../hacks
+UTILS_SRC      = $(XS)/utils
+UTILS_BIN      = ../../utils
+
+INCLUDES       = -I$(srcdir) -I$(srcdir)/../.. -I$(UTILS_SRC) -I$(HACKS_SRC) -I../.. @INCLUDES@
+
+UTIL_SRCS      = $(UTILS_SRC)/alpha.c $(UTILS_SRC)/colors.c \
+                 $(UTILS_SRC)/grabscreen.c $(UTILS_SRC)/hsv.c \
+                 $(UTILS_SRC)/resources.c $(UTILS_SRC)/spline.c \
+                 $(UTILS_SRC)/usleep.c $(UTILS_SRC)/visual.c \
+                 $(UTILS_SRC)/xroger.c $(UTILS_SRC)/yarandom.c \
+                 $(UTILS_SRC)/erase.c $(UTILS_SRC)/sgivideo.c
+UTIL_OBJS      = $(UTILS_BIN)/alpha.o $(UTILS_BIN)/colors.o \
+                 $(UTILS_BIN)/grabscreen.o $(UTILS_BIN)/hsv.o \
+                 $(UTILS_BIN)/resources.o $(UTILS_BIN)/spline.o \
+                 $(UTILS_BIN)/usleep.o $(UTILS_BIN)/visual.o \
+                 $(UTILS_BIN)/xroger.o $(UTILS_BIN)/yarandom.o \
+                 $(UTILS_BIN)/erase.o $(UTILS_BIN)/sgivideo.o
+
+SRCS           = xlock.c automata.c iostuff.c spline.c xbm.c
+
+OBJS           = xlock.o automata.o iostuff.o spline.o xbm.o
+
+EXES           =
+
+HACK_OBJS_1    = $(UTILS_BIN)/resources.o $(UTILS_BIN)/visual.o \
+                 $(UTILS_BIN)/usleep.o $(UTILS_BIN)/yarandom.o @XMU_OBJS@
+HACK_OBJS      = screenhack.o $(HACK_OBJS_1)
+XLOCK_OBJS     = screenhack-xlock.o $(XLOCK_OBJS)/xlockmore.o $(COLOR_OBJS) $(HACK_OBJS_1)
+COLOR_OBJS     = $(UTILS_BIN)/hsv.o $(UTILS_BIN)/colors.o
+GRAB_OBJS_1    = $(UTILS_BIN)/grabscreen.o $(SGI_VIDEO_OBJS)
+GRAB_OBJS      = $(GRAB_OBJS_1) $(COLOR_OBJS)
+GRAB_LIBS      = $(SGI_VIDEO_LIBS)
+
+HDRS           = xlock.h mode.h
+MEN            =
+STAR           = *
+EXTRAS         = README Makefile.in xlock.h .gdbinit \
+                 vidwhacker \
+                 images/$(STAR).xbm \
+                 images/bubbles/$(STAR).pov \
+                 images/bubbles/$(STAR).xpm \
+                 images/noseguy/$(STAR).xbm \
+                 images/noseguy/$(STAR).xpm \
+                 images/puzzle/$(STAR).xbm  \
+
+VMSFILES       = compile_axp.com compile_decc.com link_axp.com link_decc.com \
+                 vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
+
+TARFILES       = $(SRCS) $(HDRS) $(MEN) $(EXTRAS) $(VMSFILES)
+
+
+all: $(EXES)
+
+install:   install-program   install-man
+uninstall: uninstall-program uninstall-man
+
+install-strip:
+       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
+
+install-program:
+       @if [ ! -d $(HACKDIR) ]; then mkdir $(HACKDIR) ; fi ;           \
+       for program in $(EXES); do                                      \
+         echo $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ;      \
+         $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ;           \
+       done
+
+install-man:
+       @if [ ! -d $(mandir) ]; then mkdir $(mandir) ; fi ;             \
+       if [ ! -d $(man1dir) ]; then mkdir $(man1dir) ; fi ;            \
+       men="$(MEN)" ;                                                  \
+       for man in $$men; do                                            \
+         instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
+         echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ;  \
+         $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ;       \
+       done
+
+uninstall-program:
+       @for program in $(EXES); do                                     \
+         echo rm -f $(HACKDIR)/$$program ;                             \
+         rm -f $(HACKDIR)/$$program ;                                  \
+       done
+
+uninstall-man:
+       @men="$(MEN)" ;                                                 \
+       for man in $$men; do                                            \
+         instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
+         echo rm -f $(man1dir)/$$instname ;                            \
+         rm -f $(man1dir)/$$instname ;                                 \
+       done
+
+clean:
+       -rm -f *.o a.out core $(EXES)
+
+distclean: clean
+       -rm -f Makefile *~ "#"*
+
+# Adds all current dependencies to Makefile
+depend:
+       $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
+       $(DEPEND_FLAGS) --                                                  \
+       $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
+       $(SRCS)
+
+# Adds some dependencies to Makefile.in -- not totally accurate, but pretty
+# close.  This excludes dependencies on files in /usr/include, etc.  It tries
+# to include only dependencies on files which are themselves a part of this
+# package.
+distdepend::
+       @echo updating dependencies in `pwd`/Makefile.in... ;               \
+       $(DEPEND) -w 0 -f -                                                 \
+       -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
+       $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
+       $(SRCS) |                                                           \
+       (                                                                   \
+         awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
+         sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
+             -e 's@\.\./utils@$$(UTILS_SRC)@g'                             \
+             -e 's@ \([^$$]\)@ $$(srcdir)/\1@g'                            \
+             -e 's@ $$(srcdir)/\(.*config.h\)@ \1@g' ;                     \
+         echo ''                                                           \
+       ) > /tmp/distdepend.$$$$ &&                                         \
+       mv Makefile.in Makefile.in.bak &&                                   \
+       mv /tmp/distdepend.$$$$ Makefile.in
+
+TAGS: tags
+tags:
+       find $(srcdir) -name '*.[chly]' -print | xargs etags -a
+
+echo_tarfiles:
+       @echo $(TARFILES)
+
+
+# Rules for generating the VMS makefiles on Unix, so that it doesn't have to
+# be done by hand...
+#
+VMS_AXP_COMPILE_1=$$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE
+VMS_AXP_COMPILE_2=)/INCL=([],[-],[-.UTILS])
+
+compile_axp.com: Makefile.in
+       @echo generating $@ from $<...  ;                                   \
+       ( for c in $(SRCS) ; do                                             \
+          c=`echo $$c | tr a-z A-Z` ;                                      \
+          echo "$(VMS_AXP_COMPILE_1)$(VMS_AXP_COMPILE_2) $$c" ;            \
+         done ;                                                                    \
+        foo="$(VMS_AXP_COMPILE_1),XLOCKMORE$(VMS_AXP_COMPILE_2)" ;         \
+         echo $${foo}/OBJ=SCREENHACK-XLOCK.OBJ SCREENHACK.C ;              \
+       ) | sort > $@
+
+compile_decc.com: compile_axp.com
+       @echo generating $@ from $<...  ;                                   \
+       sed 's/axp/decc/g' < $< > $@
+
+#### TODO: generating link_axp.com is kinda tricky...
+
+link_decc.com: link_axp.com
+       @echo generating $@ from $<...  ;                                   \
+       sed 's/axp/decc/g' < $< > $@
+
+$(srcdir)/../setup.com: Makefile.in
+       @echo generating $@ from $<...  ;                                   \
+       ( echo '$$! Xscreensaver - definition of various DCL symbols' ;     \
+         echo '$$ set NOON' ;                                              \
+         echo '$$ set def [.HACKS]' ;                                      \
+         echo '$$ mydisk = f$$trnlmn("SYS$$DISK")' ;                       \
+         echo '$$ mydir  = mydisk+f$$directory()' ;                        \
+         ( for c in $(EXES) ; do                                           \
+            c2="$${c}          " ;                                         \
+            c2=`echo "$${c2}" | sed 's/^\(........*\)  $$/\1/'` ;          \
+            echo '$$' "$${c2}:== $$'mydir'$${c}" ;                         \
+             done ;                                                        \
+         ) | sort ;                                                        \
+          echo '$$ set def [-.DRIVER]' ;                                   \
+          echo '$$ mydir  = mydisk+f$$directory()' ;                       \
+          echo "$$ xscreensaver :== $$'mydir'xscreensaver" ;               \
+         echo "$$ xscreen*command :== $$'mydir'xscreensaver-command" ;     \
+         echo '$$ set def [-]' ;                                           \
+         echo '$$ exit' ;                                                  \
+          ) > $@
+
+distdepend:: compile_axp.com compile_decc.com
+distdepend:: link_axp.com link_decc.com
+distdepend:: $(srcdir)/../setup.com
+
+
+# Rules for noticing when the objects from the utils directory are out of
+# date with respect to their sources, and going and building them according
+# to the rules in their own Makefile...
+#
+$(UTILS_BIN)/alpha.o:          $(UTILS_SRC)/alpha.c
+$(UTILS_BIN)/colors.o:         $(UTILS_SRC)/colors.c
+$(UTILS_BIN)/grabscreen.o:     $(UTILS_SRC)/grabscreen.c
+$(UTILS_BIN)/sgivideo.o:       $(UTILS_SRC)/sgivideo.c
+$(UTILS_BIN)/hsv.o:            $(UTILS_SRC)/hsv.c
+$(UTILS_BIN)/resources.o:      $(UTILS_SRC)/resources.c
+$(UTILS_BIN)/spline.o:         $(UTILS_SRC)/spline.c
+$(UTILS_BIN)/usleep.o:         $(UTILS_SRC)/usleep.c
+$(UTILS_BIN)/visual.o:         $(UTILS_SRC)/visual.c
+$(UTILS_BIN)/xmu.o:            $(UTILS_SRC)/xmu.c
+$(UTILS_BIN)/xroger.o:         $(UTILS_SRC)/xroger.c
+$(UTILS_BIN)/yarandom.o:       $(UTILS_SRC)/yarandom.c
+$(UTILS_BIN)/erase.o:          $(UTILS_SRC)/erase.c
+
+$(UTIL_OBJS):
+       cd $(UTILS_BIN) ; \
+       $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+# How we build object files in this directory.
+.c.o:
+       $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
+
+# Some hacks use a slightly-differently-compiled variant of this file.
+# This is how to make the the other .o file from it.
+#
+screenhack-xlock.o: screenhack.c
+       $(CC) -o $@ -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) \
+       -DXLOCKMORE $(srcdir)/screenhack.c
+
+# Some abbreviations to keep the lines short...
+ALP            = $(HSV) $(UTILS_BIN)/alpha.o
+HSV            = $(UTILS_BIN)/hsv.o
+SPL            = $(UTILS_BIN)/spline.o
+XROG           = $(UTILS_BIN)/xroger.o $(SPL)
+GRAB           = $(GRAB_OBJS)
+ERASE          = $(UTILS_BIN)/erase.o
+COL            = $(COLOR_OBJS)
+
+CC_HACK                = $(CC) $(LDFLAGS)
+
+##############################################################################
+#
+# DO NOT DELETE: updated by make distdepend
+
+xlock.o: $(srcdir)/../../hacks/screenhack.h
+xlock.o: ../../config.h
+xlock.o: $(srcdir)/$(UTILS_SRC)/yarandom.h
+xlock.o: $(srcdir)/$(UTILS_SRC)/usleep.h
+xlock.o: $(srcdir)/$(UTILS_SRC)/resources.h
+xlock.o: $(srcdir)/$(UTILS_SRC)/hsv.h
+xlock.o: $(srcdir)/$(UTILS_SRC)/colors.h
+xlock.o: $(srcdir)/$(UTILS_SRC)/grabscreen.h
+xlock.o: $(srcdir)/$(UTILS_SRC)/visual.h
+xlock.o: $(srcdir)/mode.h
+automata.o: $(srcdir)/$(UTILS_SRC)/utils.h
+automata.o: ../../config.h
+automata.o: $(srcdir)/automata.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/utils.h
+iostuff.o: ../../config.h
+iostuff.o: $(srcdir)/mode.h
+iostuff.o: $(srcdir)/../../hacks/screenhack.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/yarandom.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/usleep.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/resources.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/hsv.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/colors.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/grabscreen.h
+iostuff.o: $(srcdir)/$(UTILS_SRC)/visual.h
+iostuff.o: $(srcdir)/iostuff.h
+iostuff.o: $(srcdir)/ras.h
+spline.o: $(srcdir)/$(UTILS_SRC)/utils.h
+spline.o: ../../config.h
+spline.o: $(srcdir)/spline.h
+
diff --git a/xlock/XLock-jp.ad b/xlock/XLock-jp.ad
new file mode 100644 (file)
index 0000000..047e2c9
--- /dev/null
@@ -0,0 +1,791 @@
+!!!!
+! XLock-jp: Japanese class resource for xlock (xlockmore-5.01)
+!!!!
+!! By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
+XLock.mode: random
+!XLock.mode: blank
+!XLock.mode: life
+!XLock.erasemode: no_fade
+XLock.erasedelay: 400
+XLock.font: -b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1
+!XLock.font: -*-times-*-*-*-*-18-*-*-*-*-*-*-*
+!XLock.background: White
+!XLock.foreground: Black
+XLock.background: Black
+XLock.foreground: White
+!XLock.foreground: AntiqueWhite
+!XLock.username: ¥í¥°¥¤¥ó̾:
+!XLock.password: ¥Ñ¥¹¥ï¡¼¥É:
+!XLock.info: Enter ¥Ñ¥¹¥ï¡¼¥É¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤ÈºÆ¥í¥Ã¥¯¤·¤Þ¤¹¡£
+!XLock.validate: ¥Ñ¥¹¥ï¡¼¥É¸¡ººÃæ...
+!XLock.invalid: ¥Ñ¥¹¥ï¡¼¥É¤¬°ã¤¤¤Þ¤¹¡£
+XLock.nolock: off
+XLock.inwindow: off
+XLock.inroot: off
+XLock.remote: off
+XLock.mono: off
+XLock.allowaccess: off
+XLock.vtlock: off
+XLock.allowroot: off
+XLock.description: on
+XLock.echokeys: off
+XLock.enablesaver: on
+XLock.resetsaver: on
+XLock.grabmouse: on
+XLock.install: on
+XLock.mousemotion: off
+XLock.sound: off
+XLock.timeelapsed: off
+XLock.usefirst: on
+XLock.verbose: off
+XLock.nice: 10
+XLock.lockdelay: 0
+XLock.timeout: 30
+!XLock.geometry: 64x64
+!XLock.icongeometry: 4x4
+XLock.icongeometry: 64x64
+!XLock.icongeometry: 256x256
+
+! For bouboule, pyro, star, & worm modes
+XLock.use3d: off
+XLock.delta3d: 1.5
+XLock.right3d: Blue
+XLock.left3d: Red
+XLock.both3d: Magenta
+
+! For marquee & nose modes
+!XLock.program: fortune -o
+XLock.program: fortune -s
+!XLock.program: fortune
+!XLock.program: /usr/games/fortune -o
+!XLock.program: /usr/games/fortune -s
+!XLock.program: /usr/games/fortune
+!XLock.program: finger
+!XLock.messagesfile: fortune.dat
+!XLock.messagefile: /etc/hosts
+!XLock.message: "Go away, no one is here"
+XLock.messagefont: -b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1
+!XLock.messagefont: -*-times-*-*-*-*-18-*-*-*-*-*-*-*
+
+! For modes with images
+!XLock.*.bitmap: bitmaps/m-xlock.xbm
+!XLock.*.bitmap: pixmaps/m-xlock.xpm
+
+! For mailbox check application
+!XLock.mailCmd: /usr/ucb/mail -e
+!XLock.mailCmd: /usr/bin/mail -e
+!XLock.mailCmd: /usr/local/bin/chkmbox
+!XLock.mailIcon:
+!XLock.nomailIcon:
+
+! 0 defaults to maximum defined value
+XLock.logoutAuto: 0
+! 0 defaults to maximum defined value
+XLock.logoutButton: 0
+XLock.logoutButtonLabel: ¤³¤³¤ò²¡¤¹¤È¥í¥°¥¢¥¦¥È¤·¤Þ¤¹
+XLock.logoutButtonHelp: \
+¥¿¡¼¥ß¥Ê¥ë¤«¤é X ¤òµ¯Æ°¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥»¥Ã¥·¥ç¥ó¤Î½ªÎ»¤¬½ÐÍè¤Þ¤¹¡£
+XLock.logoutFailedString: \
+¥í¥°¥¢¥¦¥È¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£\n\
+¤³¤Î¥æ¡¼¥¶¡¼¤Ï¼«Æ°¥í¥°¥¢¥¦¥È½ÐÍè¤Þ¤»¤ó¡£
+
+! Mode options: If count, cycles, or size options are set to 1 ...
+! they are probably not used by the mode.
+XLock.ant.delay: 1000
+XLock.ant.count: -3
+XLock.ant.cycles: 40000
+XLock.ant.size: -12
+XLock.ant.saturation: 1.0
+XLock.ant.truchet: on
+XLock.ant.eyes: off
+XLock.ant.sharpturn: off
+! ant neighbors (3, 4, 6, 8, 12, all else random)
+XLock.ant.neighbors: 0
+XLock.atlantis.delay: 18000
+XLock.atlantis.count: 4
+XLock.atlantis.cycles: 250
+XLock.atlantis.size: 6000
+XLock.atlantis.saturation: 1.0
+XLock.ball.delay: 10000
+XLock.ball.count: 10
+XLock.ball.cycles: 20
+XLock.ball.size: -100
+XLock.ball.saturation: 1.0
+XLock.bat.delay: 100000
+XLock.bat.count: -8
+!XLock.bat.cycles: 1
+XLock.bat.size: 0
+XLock.bat.saturation: 1.0
+XLock.blot.delay: 200000
+XLock.blot.count: 6
+XLock.blot.cycles: 30
+!XLock.blot.size: 1
+XLock.blot.saturation: 0.3
+XLock.bouboule.delay: 10000
+XLock.bouboule.count: 100
+!XLock.bouboule.cycles: 1
+XLock.bouboule.size: 15
+XLock.bouboule.saturation: 1.0
+XLock.bounce.delay: 5000
+XLock.bounce.count: -10
+!XLock.bounce.cycles: 1
+XLock.bounce.size: 0
+XLock.bounce.saturation: 1.0
+XLock.braid.delay: 1000
+XLock.braid.count: 15
+XLock.braid.cycles: 100
+!XLock.braid.size: 1
+XLock.braid.saturation: 1.0
+XLock.bubble.delay: 100000
+XLock.bubble.count: 25
+!XLock.bubble.cycles: 1
+XLock.bubble.size: 100
+XLock.bubble.saturation: 0.6
+XLock.bubble.boil: off
+XLock.bug.delay: 75000
+XLock.bug.count: 10
+XLock.bug.cycles: 32767
+XLock.bug.size: -4
+XLock.bug.saturation: 1.0
+! bug neighbors (3, 4, 6, 8, 12, all else random)
+XLock.bug.neighbors: 0
+XLock.bug.eyes: off
+XLock.cage.delay: 25000
+!XLock.cage.count: 1
+!XLock.cage.cycles: 1
+!XLock.cage.size: 1
+XLock.cage.saturation: 1.0
+XLock.clock.delay: 100000
+XLock.clock.count: -16
+XLock.clock.cycles: 200
+XLock.clock.size: -200
+XLock.clock.saturation: 1.0
+XLock.coral.delay: 60000
+XLock.coral.count: -3
+!XLock.coral.cycles: 1
+XLock.coral.size: 35
+XLock.coral.saturation: 0.6
+XLock.crystal.delay: 60000
+XLock.crystal.count: -500
+XLock.crystal.cycles: 200
+XLock.crystal.size: -15
+XLock.crystal.saturation: 1.0
+XLock.crystal.nx: -3
+XLock.crystal.ny: -3
+XLock.crystal.cell: on
+XLock.crystal.grid: off
+XLock.crystal.centre: off
+XLock.crystal.maxsize: off
+XLock.crystal.cycle: on
+XLock.daisy.delay: 100000
+XLock.daisy.count: 300
+XLock.daisy.cycles: 350
+!XLock.daisy.size: 1
+XLock.daisy.saturation: 1.0
+XLock.daisy.garden: off
+XLock.dclock.delay: 10000
+!XLock.dclock.count: 1
+XLock.dclock.cycles: 10000
+!XLock.dclock.size: 1
+XLock.dclock.saturation: 0.3
+XLock.dclock.popex: off
+XLock.dclock.forest: off
+XLock.dclock.hiv: off
+XLock.dclock.lab: off
+XLock.dclock.veg: off
+XLock.dclock.y2k: off
+XLock.dclock.millennium: off
+XLock.deco.delay: 1000000
+XLock.deco.count: -30
+XLock.deco.cycles: 2
+XLock.deco.size: -10
+XLock.deco.saturation: 0.6
+XLock.demon.delay: 50000
+XLock.demon.count: 0
+XLock.demon.cycles: 1000
+XLock.demon.size: -7
+XLock.demon.saturation: 1.0
+! demon neighbors (3, 4, 6, 8, 9, 12, all else random)
+XLock.demon.neighbors: 0
+XLock.dilemma.delay: 200000
+XLock.dilemma.count: -2
+XLock.dilemma.cycles: 1000
+XLock.dilemma.size: 0
+XLock.dilemma.saturation: 1.0
+XLock.dilemma.bonus: 1.85
+XLock.dilemma.conscious: on
+! dilemma neighbors (3, 4, 6, 8, 9, 12, all else defaults to 4 or 8 for bitmap)
+XLock.dilemma.neighbors: 0
+XLock.discrete.delay: 1000
+XLock.discrete.count: 4096
+XLock.discrete.cycles: 2500
+!XLock.discrete.size: 1
+XLock.discrete.saturation: 1.0
+XLock.dragon.delay: 2000000
+!XLock.dragon.count: 1
+XLock.dragon.cycles: 16
+XLock.dragon.size: -24
+XLock.dragon.saturation: 1.0
+XLock.drift.delay: 10000
+XLock.drift.count: 30
+!XLock.drift.cycles: 1
+!XLock.drift.size: 1
+XLock.drift.saturation: 1.0
+XLock.drift.grow: off
+XLock.drift.liss: off
+XLock.euler2d.delay: 1000
+XLock.euler2d.count: 1024 
+XLock.euler2d.cycles: 3000
+!XLock.euler2d.size: 1
+XLock.euler2d.saturation: 1.0
+XLock.eyes.delay: 20000
+XLock.eyes.count: -8
+XLock.eyes.cycles: 5
+!XLock.eyes.size: 1
+XLock.eyes.saturation: 1.0
+XLock.eyes.trackmouse: off
+XLock.fadeplot.delay: 30000
+XLock.fadeplot.count: 10
+XLock.fadeplot.cycles: 1500
+!XLock.fadeplot.size: 1
+XLock.fadeplot.saturation: 0.6
+XLock.fire.delay: 10000
+XLock.fire.count: 800
+!XLock.fire.cycles: 1
+XLock.fire.size: 400
+XLock.fire.saturation: 1.0
+XLock.fire.texture: on
+XLock.fire.fog: off
+XLock.fire.shadows: on
+XLock.fire.framerate: off
+XLock.fire.trackmouse: off
+XLock.fire.trees: 5
+XLock.flag.delay: 50000
+!XLock.flag.count: 1
+XLock.flag.cycles: 1000
+XLock.flag.size: -7
+XLock.flag.saturation: 1.0
+XLock.flag.invert: off
+XLock.flame.delay: 750000
+XLock.flame.count: 20
+XLock.flame.cycles: 10000
+!XLock.flame.size: 1
+XLock.flame.saturation: 1.0
+XLock.flow.delay: 1000
+XLock.flow.count: 1024
+XLock.flow.cycles: 3000
+!XLock.flow.size: 1
+XLock.flow.saturation: 1.0
+XLock.forest.delay: 400000
+XLock.forest.count: 100
+XLock.forest.cycles: 200
+!XLock.forest.size: 1
+XLock.forest.saturation: 1.0
+XLock.galaxy.delay: 100
+XLock.galaxy.count: -5
+XLock.galaxy.cycles: 250
+XLock.galaxy.size: -3
+XLock.galaxy.saturation: 1.0
+XLock.galaxy.tracks: off
+XLock.gears.delay: 1000
+XLock.gears.count: 1
+XLock.gears.cycles: 2
+XLock.gears.size: 0
+XLock.gears.saturation: 1.0
+XLock.gears.planetary: on
+XLock.gears.planetsize: 400
+XLock.glplanet.delay:1000
+XLock.glplanet.count: 1
+XLock.glplanet.cycles:2
+XLock.goop.delay: 10000
+XLock.goop.count: -5
+!XLock.goop.cycles: 1
+!XLock.goop.size: 1
+XLock.goop.saturation: 1.0
+XLock.grav.delay: 10000
+XLock.grav.count: -12
+!XLock.grav.cycles: 1
+!XLock.grav.size: 1
+XLock.grav.saturation: 1.0
+XLock.grav.decay: off
+XLock.grav.trail: off
+XLock.helix.delay: 25000
+!XLock.helix.count: 1
+XLock.helix.cycles: 100
+!XLock.helix.size: 1
+XLock.helix.saturation: 1.0
+XLock.helix.ellipse: off
+XLock.hop.delay: 10000
+XLock.hop.count: 1000
+XLock.hop.cycles: 2500
+!XLock.hop.size: 1
+XLock.hop.saturation: 1.0
+XLock.hop.martin: off
+XLock.hop.popcorn: off
+XLock.hop.ejk1: off
+XLock.hop.ejk2: off
+XLock.hop.ejk3: off
+XLock.hop.ejk4: off
+XLock.hop.ejk5: off
+XLock.hop.ejk6: off
+XLock.hop.rr: off
+XLock.hop.jong: off
+XLock.hop.sine: off
+XLock.hyper.delay: 100000
+XLock.hyper.count: -6
+XLock.hyper.cycles: 300
+!XLock.hyper.size: 1
+XLock.hyper.saturation: 1.0
+XLock.hyper.randomStart: on
+XLock.hyper.showAxes: on
+XLock.hyper.showPlanes: off
+XLock.ico.delay: 100000
+XLock.ico.count: 0
+XLock.ico.cycles: 400
+XLock.ico.size: 0
+XLock.ico.saturation: 1.0
+XLock.ico.faces: off
+XLock.ico.trail: on
+XLock.ifs.delay: 1000
+!XLock.ifs.count: 1
+!XLock.ifs.cycles: 1
+!XLock.ifs.size: 1
+XLock.ifs.saturation: 1.0
+XLock.image.delay: 3000000
+XLock.image.count: -20
+!XLock.image.cycles: 1
+!XLock.image.size: 1
+XLock.image.saturation: 1.0
+XLock.juggle.delay: 10000
+XLock.juggle.count: 150
+XLock.juggle.cycles: 30
+!XLock.juggle.size: 1
+XLock.juggle.saturation: 1.0
+XLock.julia.delay: 10000
+XLock.julia.count: 1000
+XLock.julia.cycles: 20
+!XLock.julia.size: 1
+XLock.julia.saturation: 1.0
+XLock.julia.trackmouse: off
+XLock.kaleid.delay: 60000
+XLock.kaleid.count: -8
+XLock.kaleid.cycles: 40
+XLock.kaleid.size: -9
+XLock.kaleid.saturation: 0.6
+XLock.kaleid.alternate: off
+XLock.kaleid.serial: off
+XLock.kaleid.disconnected: on
+XLock.kaleid.quad: off
+XLock.kaleid.oct: off
+XLock.kaleid.linear: off
+XLock.kumppa.delay: 10000
+!XLock.kumppa.count: 1
+!XLock.kumppa.cycles: 1000
+!XLock.kumppa.size: 1
+XLock.kumppa.saturation: 1.0
+XLock.kumppa.dbuf: off
+XLock.kumppa.rrandom: on
+XLock.lament.delay: 10000
+!XLock.lament.count: 1
+!XLock.lament.cycles: 1
+!XLock.lament.size: 1 
+XLock.lament.saturation: 1.0
+XLock.laser.delay: 20000
+XLock.laser.count: -10
+XLock.laser.cycles: 200
+!XLock.laser.size: 1
+XLock.laser.saturation: 1.0
+XLock.life.delay: 750000
+XLock.life.count: 40
+XLock.life.cycles: 140
+XLock.life.size: 0
+XLock.life.saturation: 1.0
+!XLock.life.rule: P
+XLock.life.rule: G
+! life neighbors (3, 4, 6, 8, 9, 12, all else defaults to 8 for bitmap and Conway's Life)
+XLock.life.neighbors: 0
+!XLock.life.neighbors: 8
+!XLock.life.rule: S23/B3
+!XLock.life.neighbors: 6
+!XLock.life.rule: S2b34/B2a
+!XLock.life.rule: S2a2b4a/B2b3a4b
+!XLock.life.rule: S12b2c3a4b4c6/B2a3b3c5
+!XLock.life.rule: S12b2c3c4a56/B23a3c4b4c6
+!XLock.life.rule: S13b/B2a2c6
+XLock.life.callahan: off
+XLock.life.andreen: off
+XLock.life1d.delay: 10000
+!XLock.life1d.count: 1
+XLock.life1d.cycles: 10
+XLock.life1d.size: 0
+XLock.life1d.saturation: 1.0
+XLock.life1d.totalistic: True
+XLock.life3d.delay: 1000000
+XLock.life3d.count: 35
+XLock.life3d.cycles: 85
+!XLock.life3d.size: 1
+XLock.life3d.saturation: 1.0
+!XLock.life3d.rule: P
+XLock.life3d.rule: G
+!XLock.life3d.rule: S45/B5
+!XLock.life3d.rule3d: S567/B6
+!XLock.life3d.rule3d: S56/B5
+!XLock.life3d.rule3d: S67/B67
+XLock.lightning.delay: 10000
+!XLock.lightning.count: 1
+!XLock.lightning.cycles: 1
+!XLock.lightning.size: 1
+XLock.lightning.saturation: 0.6
+XLock.lisa.delay: 25000
+XLock.lisa.count: 1
+XLock.lisa.cycles: 256
+XLock.lisa.size: -1
+XLock.lisa.saturation: 1.0
+XLock.lisa.additive: on
+XLock.lissie.delay: 10000
+XLock.lissie.count: 1
+XLock.lissie.cycles: 2000
+XLock.lissie.size: -200
+XLock.lissie.saturation: 0.6
+XLock.loop.delay: 100000
+XLock.loop.count: -5
+XLock.loop.cycles: 1600
+XLock.loop.size: -12
+XLock.loop.saturation: 1.0
+! loop neighbors (4, 6, all else random)
+XLock.loop.neighbors: 0
+XLock.mandelbrot.delay: 25000
+XLock.mandelbrot.count: -8
+XLock.mandelbrot.cycles: 20000
+!XLock.mandelbrot.size: 1
+XLock.mandelbrot.saturation: 1.0
+XLock.mandelbrot.increment: 1.0
+XLock.mandelbrot.binary: off
+XLock.mandelbrot.dem: off
+XLock.marquee.delay: 100000
+!XLock.marquee.count: 1
+!XLock.marquee.cycles: 1
+!XLock.marquee.size: 1
+XLock.marquee.saturation: 1.0
+XLock.matrix.delay: 1000
+!XLock.matrix.count: 1
+!XLock.matrix.cycles: 1
+!XLock.matrix.size: 1
+XLock.matrix.saturation: 1.0
+XLock.maze.delay: 1000
+!XLock.maze.count: 1
+XLock.maze.cycles: 3000
+!XLock.maze.size: 8
+XLock.maze.size: -40
+XLock.maze.saturation: 1.0
+XLock.moebius.delay: 1000
+!XLock.moebius.count: 1
+!XLock.moebius.cycles: 1
+!XLock.moebius.size: 1
+XLock.moebius.saturation: 1.0
+XLock.moebius.solidmoebius: off
+XLock.moebius.noants: off
+XLock.morph3d.delay: 1000
+XLock.morph3d.count: 0
+!XLock.morph3d.cycles: 1
+!XLock.morph3d.size: 1
+XLock.morph3d.saturation: 1.0
+XLock.mountain.delay: 1000
+XLock.mountain.count: 30
+XLock.mountain.cycles: 4000
+!XLock.mountain.size: 1
+XLock.mountain.saturation: 1.0
+XLock.munch.delay: 5000
+!XLock.munch.count: 1
+XLock.munch.cycles: 7
+!XLock.munch.size: 1
+XLock.munch.saturation: 1.0
+XLock.nose.delay: 100000
+!XLock.nose.count: 1
+!XLock.nose.cycles: 1
+!XLock.nose.size: 1
+XLock.nose.saturation: 1.0
+XLock.pacman.delay: 100000
+XLock.pacman.count: 10
+!XLock.pacman.cycles: 1
+XLock.pacman.size: 0
+XLock.pacman.saturation: 1.0
+XLock.penrose.delay: 10000
+!XLock.penrose.count: 1
+!XLock.penrose.cycles: 1
+XLock.penrose.size: -40
+XLock.penrose.saturation: 1.0
+XLock.penrose.ammann: off
+XLock.petal.delay: 10000
+XLock.petal.count: -500
+XLock.petal.cycles: 400
+!XLock.petal.size: 1
+XLock.petal.saturation: 1.0
+XLock.pipes.delay: 1000
+XLock.pipes.count: 2
+XLock.pipes.cycles: 5
+XLock.pipes.size: 500
+XLock.pipes.saturation: 1.0
+XLock.pipes.fisheye: on
+XLock.pipes.tightturns: off
+XLock.pipes.rotatepipes: on
+XLock.polyominoes.delay: 6000
+!XLock.polyominoes.count: 1
+XLock.polyominoes.cycles: 8192
+!XLock.polyominoes.size: 1
+XLock.polyominoes.saturation: 1.0
+XLock.puzzle.delay: 10000
+XLock.puzzle.count: 250
+!XLock.puzzle.cycles: 1
+!XLock.puzzle.size: 1
+XLock.puzzle.saturation: 1.0
+XLock.pyro.delay: 15000
+XLock.pyro.count: 100
+!XLock.pyro.cycles: 1
+XLock.pyro.size: -3
+XLock.pyro.saturation: 1.0
+XLock.qix.delay: 30000
+XLock.qix.count: -5
+XLock.qix.cycles: 32
+!XLock.qix.size: 1
+XLock.qix.saturation: 1.0
+XLock.qix.complete: off
+XLock.qix.kaleid: off
+XLock.roll.delay: 100000
+XLock.roll.count: 25
+!XLock.roll.cycles: 1
+XLock.roll.size: -64
+XLock.roll.saturation: 0.6
+XLock.rotor.delay: 100
+XLock.rotor.count: 4
+XLock.rotor.cycles: 100
+XLock.rotor.size: -6
+XLock.rotor.saturation: 0.3
+XLock.rubik.delay: 10000
+XLock.rubik.count: -30
+XLock.rubik.cycles: 5
+XLock.rubik.size: -6
+XLock.rubik.saturation: 1.0
+XLock.sballs.delay: 10000
+XLock.sballs.count: 0
+XLock.sballs.cycles: 10
+XLock.sballs.size: 400
+XLock.sballs.saturation: 1.0
+XLock.sballs.object: 0
+XLock.sballs.texture: on
+XLock.sballs.framerate: off
+XLock.sballs.trackmouse: off
+XLock.scooter.delay: 20000
+XLock.scooter.count: 24
+XLock.scooter.cycles: 3
+XLock.scooter.size: 100
+XLock.scooter.saturation: 1.0
+XLock.shape.delay: 10000
+!XLock.shape.count: 1
+XLock.shape.cycles: 256
+!XLock.shape.size: 1
+XLock.shape.saturation: 1.0
+XLock.shape.border: off
+XLock.shape.shade: on
+!XLock.shape.stipple: on
+XLock.sierpinski.delay: 400000
+XLock.sierpinski.count: 2000
+XLock.sierpinski.cycles: 100
+!XLock.sierpinski.size: 1
+XLock.sierpinski.saturation: 1.0
+XLock.sierpinski3d.delay: 10000
+XLock.sierpinski3d.maxdepth: 6
+XLock.sierpinski3d.speed: 150
+XLock.sierpinski3d.intensity: 2185
+XLock.slip.delay: 50000
+XLock.slip.count: 35
+XLock.slip.cycles: 50
+!XLock.slip.size: 1
+XLock.slip.saturation: 1.0
+XLock.solitare.delay: 2000000
+!XLock.solitare.count: 1
+!XLock.solitare.cycles: 1
+!XLock.solitare.size: 1
+XLock.solitare.saturation: 1.0
+XLock.space.delay: 10000
+XLock.space.count: 100
+!XLock.space.cycles: 1
+!XLock.space.size: 1
+XLock.space.saturation: 1.0
+XLock.sphere.delay: 5000
+!XLock.sphere.count: 1
+!XLock.sphere.cycles: 1
+!XLock.sphere.size: 1
+XLock.sphere.saturation: 1.0
+XLock.spiral.delay: 5000
+XLock.spiral.count: -40
+XLock.spiral.cycles: 350
+!XLock.spiral.size: 1
+XLock.spiral.saturation: 1.0
+XLock.spline.delay: 30000
+XLock.spline.count: -6
+XLock.spline.cycles: 2048
+!XLock.spline.size: 1
+XLock.spline.saturation: 0.3
+XLock.spline.erase: off
+XLock.sproingies.delay: 1000
+XLock.sproingies.count: 5
+XLock.sproingies.cycles: 0
+XLock.sproingies.size: 400
+XLock.sproingies.saturation: 1.0
+XLock.stairs.delay: 200000
+!XLock.stairs.count: 1
+!XLock.stairs.cycles: 1
+!XLock.stairs.size: 1
+XLock.stairs.saturation: 1.0
+XLock.star.delay: 75000
+XLock.star.count: 100
+!XLock.star.cycles: 1
+XLock.star.size: 100
+XLock.star.saturation: 0.3
+!XLock.star.saturation: 1.0
+XLock.star.straight: off
+XLock.star.rock: off
+XLock.star.trek: 50
+XLock.starfish.delay: 2000
+!XLock.starfish.count: 1
+!XLock.starfish.cycles: 1000
+!XLock.starfish.size: 1
+XLock.starfish.saturation: 1.0
+XLock.starfish.cyclespeed: 3
+XLock.starfish.rotation: -1
+XLock.starfish.thickness: -20
+XLock.starfish.blob: off
+XLock.starfish.cycle: on
+XLock.strange.delay: 1000
+!XLock.strange.count: 1
+!XLock.strange.cycles: 1
+!XLock.strange.size: 1
+XLock.strange.saturation: 1.0
+XLock.superquadrics.delay: 1000
+XLock.superquadrics.count: 25
+XLock.superquadrics.cycles: 40
+!XLock.superquadrics.size: 1
+XLock.superquadrics.saturation: 1.0
+XLock.superquadrics.spinspeed: 5.0
+XLock.swarm.delay: 15000
+XLock.swarm.count: -100
+!XLock.swarm.cycles: 1
+XLock.swarm.size: -100
+XLock.swarm.saturation: 1.0
+XLock.swarm.trackmouse: off
+XLock.swirl.delay: 5000
+XLock.swirl.count: 5
+!XLock.swirl.cycles: 1
+!XLock.swirl.size: 1
+XLock.swirl.saturation: 1.0
+XLock.t3d.delay: 250000
+XLock.t3d.count: 1
+XLock.t3d.cycles: 60000
+XLock.t3d.size: 1
+XLock.t3d.saturation: 1.0
+XLock.tetris.delay: 50000
+!XLock.tetris.count: 1
+!XLock.tetris.cycles: 1
+XLock.tetris.size: -100
+XLock.tetris.saturation: 1.0
+XLock.tetris.cycle: on
+XLock.tetris.bonus: off
+XLock.tetris.trackmouse: off
+XLock.tetris.well: off
+XLock.thornbird.delay: 1000
+XLock.thornbird.count: 800
+XLock.thornbird.cycles: 16
+!XLock.thornbird.size: 1
+XLock.thornbird.saturation: 1.0
+XLock.tik_tak.delay: 60000
+!XLock.tik_tak.count: -20
+!XLock.tik_tak.cycles: 200
+XLock.tik_tak.size: -1000
+XLock.tik_tak.saturation: 1.0
+XLock.tik_tak.cycle: on
+XLock.triangle.delay: 10000
+!XLock.triangle.count: 1
+!XLock.triangle.cycles: 1
+!XLock.triangle.size: 1
+XLock.triangle.saturation: 1.0
+XLock.tube.delay: 25000
+XLock.tube.count: -9
+XLock.tube.cycles: 20000
+XLock.tube.size: -200
+XLock.tube.saturation: 1.0
+XLock.turtle.delay: 1000000
+!XLock.turtle.count: 1
+XLock.turtle.cycles: 20
+!XLock.turtle.size: 1
+XLock.turtle.saturation: 1.0
+XLock.vines.delay: 200000
+XLock.vines.count: 0
+!XLock.vines.cycles: 1
+!XLock.vines.size: 1
+XLock.vines.saturation: 1.0
+XLock.voters.delay: 1000
+XLock.voters.count: 0
+XLock.voters.cycles: 327670
+XLock.voters.size: 0
+XLock.voters.saturation: 1.0
+! voters neighbors (3, 4, 6, 8, 9, 12, all else defaults to 4 or 8 for bitmap)
+XLock.voters.neighbors: 0
+XLock.wator.delay: 750000
+!XLock.wator.count: 1
+XLock.wator.cycles: 32767
+XLock.wator.size: 0
+XLock.wator.saturation: 1.0
+! wator neighbors (3, 4, 6, 8, 9, 12, all else defaults to 4 or 8 for bitmap)
+XLock.wator.neighbors: 0
+XLock.wire.delay: 500000
+XLock.wire.count: 1000
+XLock.wire.cycles: 150
+XLock.wire.size: -8
+XLock.wire.saturation: 1.0
+! wire neighbors (3, 4, 6, 8, 9, 12, all else random)
+XLock.wire.neighbors: 0
+XLock.world.delay: 100000
+XLock.world.count: -16
+!XLock.world.cycles: 1
+!XLock.world.size: 1
+XLock.world.saturation: 0.3
+XLock.worm.delay: 17000
+XLock.worm.count: -20
+XLock.worm.cycles: 10
+XLock.worm.size: -3
+XLock.worm.saturation: 1.0
+XLock.xcl.delay: 20000
+XLock.xcl.count: -3
+!XLock.xcl.cycles: 1
+!XLock.xcl.size: 1
+XLock.xcl.saturation: 1.0
+XLock.xjack.delay: 50000
+!XLock.xjack.count: 1
+!XLock.xjack.cycles: 1
+!XLock.xjack.size: 1
+XLock.xjack.saturation: 1.0
+
+XLock.blank.delay: 3000000
+!XLock.blank.count: 1
+!XLock.blank.cycles: 1
+!XLock.blank.size: 1
+XLock.blank.saturation: 1.0
+XLock.bomb.delay: 100000
+XLock.bomb.count: 10
+XLock.bomb.cycles: 20
+!XLock.bomb.size: 1
+XLock.bomb.saturation: 1.0
+
+XLock.random.duration: 60
+!XLock.random.duration: 0
+XLock.random.modelist: all
+!XLock.random.modelist: allnice
+!XLock.random.modelist: all3d
+!XLock.random.modelist: allgl
+!XLock.random.modelist: allautomata
+!XLock.random.modelist: allfractal
+!XLock.random.modelist: allgeometry
+!XLock.random.modelist: allspace
+XLock.random.fullrandom: on
+XLock.random.sequential: off
diff --git a/xlock/XLock.ad b/xlock/XLock.ad
new file mode 100644 (file)
index 0000000..0b89fbf
--- /dev/null
@@ -0,0 +1,799 @@
+!!!!
+! XLock: Class resource for xlock (xlockmore-5.01)
+!!!!
+XLock.mode: random
+!XLock.mode: blank
+!XLock.mode: life
+!XLock.erasemode: no_fade
+XLock.erasedelay: 400
+XLock.font: -b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1
+!XLock.font: -*-times-*-*-*-*-18-*-*-*-*-*-*-*
+!XLock.background: White
+!XLock.foreground: Black
+XLock.background: Black
+XLock.foreground: White
+!XLock.foreground: AntiqueWhite
+!XLock.username: Name:
+!XLock.password: Password:
+!XLock.info: Enter password to unlock; select icon to lock.
+!XLock.validate: Validating login...
+!XLock.invalid: Invalid login.
+XLock.nolock: off
+XLock.inwindow: off
+XLock.inroot: off
+XLock.remote: off
+XLock.mono: off
+XLock.allowaccess: off
+XLock.vtlock: off
+XLock.allowroot: off
+XLock.description: on
+XLock.echokeys: off
+XLock.enablesaver: on
+XLock.resetsaver: on
+XLock.grabmouse: on
+XLock.install: on
+XLock.mousemotion: off
+XLock.sound: off
+XLock.timeelapsed: off
+XLock.usefirst: on
+XLock.verbose: off
+XLock.nice: 10
+XLock.lockdelay: 0
+XLock.timeout: 30
+!XLock.geometry: 64x64
+!XLock.icongeometry: 4x4
+XLock.icongeometry: 64x64
+!XLock.icongeometry: 256x256
+
+! For bouboule, pyro, star, & worm modes
+XLock.use3d: off
+XLock.delta3d: 1.5
+XLock.right3d: Blue
+XLock.left3d: Red
+XLock.both3d: Magenta
+
+! For marquee & nose modes
+!XLock.program: fortune -o
+XLock.program: fortune -s
+!XLock.program: fortune
+!XLock.program: /usr/games/fortune -o
+!XLock.program: /usr/games/fortune -s
+!XLock.program: /usr/games/fortune
+!XLock.program: finger
+!XLock.messagesfile: fortune.dat
+!XLock.messagefile: /etc/hosts
+!XLock.message: "Go away, no one is here"
+XLock.messagefont: -b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1
+!XLock.messagefont: -*-times-*-*-*-*-18-*-*-*-*-*-*-*
+
+! For modes with images
+!XLock.*.bitmap: bitmaps/m-xlock.xbm
+!XLock.*.bitmap: pixmaps/m-xlock.xpm
+
+! For mailbox check application
+!XLock.mailCmd: /usr/ucb/mail -e
+!XLock.mailCmd: /usr/bin/mail -e
+!XLock.mailCmd: /usr/local/bin/chkmbox
+!XLock.mailIcon:
+!XLock.nomailIcon:
+
+! 0 defaults to maximum defined value
+XLock.logoutAuto: 0
+! 0 defaults to maximum defined value
+XLock.logoutButton: 0
+XLock.logoutButtonLabel: Click here to logout
+XLock.logoutButtonHelp: \
+You may log out this session if no terminals are available.\n\
+WARNING: This will crash any open applications that the user\n\
+has running. You should try to contact the user if possible\n\
+before logging them out.
+XLock.logoutFailedString: \
+Logout attempt FAILED.\n\
+Current user could not be automatically logged out.
+
+! Mode options: If count, cycles, or size options are set to 1 ...
+! they are probably not used by the mode.
+XLock.ant.delay: 1000
+XLock.ant.count: -3
+XLock.ant.cycles: 40000
+XLock.ant.size: -12
+XLock.ant.saturation: 1.0
+XLock.ant.truchet: on
+XLock.ant.eyes: off
+XLock.ant.sharpturn: off
+! ant neighbors (3, 4, 6, 8, 12, all else random)
+XLock.ant.neighbors: 0
+XLock.atlantis.delay: 18000
+XLock.atlantis.count: 4
+XLock.atlantis.cycles: 250
+XLock.atlantis.size: 6000
+XLock.atlantis.saturation: 1.0
+XLock.ball.delay: 10000
+XLock.ball.count: 10
+XLock.ball.cycles: 20
+XLock.ball.size: -100
+XLock.ball.saturation: 1.0
+XLock.bat.delay: 100000
+XLock.bat.count: -8
+!XLock.bat.cycles: 1
+XLock.bat.size: 0
+XLock.bat.saturation: 1.0
+XLock.blot.delay: 200000
+XLock.blot.count: 6
+XLock.blot.cycles: 30
+!XLock.blot.size: 1
+XLock.blot.saturation: 0.3
+XLock.bouboule.delay: 10000
+XLock.bouboule.count: 100
+!XLock.bouboule.cycles: 1
+XLock.bouboule.size: 15
+XLock.bouboule.saturation: 1.0
+XLock.bounce.delay: 5000
+XLock.bounce.count: -10
+!XLock.bounce.cycles: 1
+XLock.bounce.size: 0
+XLock.bounce.saturation: 1.0
+XLock.braid.delay: 1000
+XLock.braid.count: 15
+XLock.braid.cycles: 100
+!XLock.braid.size: 1
+XLock.braid.saturation: 1.0
+XLock.bubble.delay: 100000
+XLock.bubble.count: 25
+!XLock.bubble.cycles: 1
+XLock.bubble.size: 100
+XLock.bubble.saturation: 0.6
+XLock.bubble.boil: off
+XLock.bug.delay: 75000
+XLock.bug.count: 10
+XLock.bug.cycles: 32767
+XLock.bug.size: -4
+XLock.bug.saturation: 1.0
+! bug neighbors (3, 4, 6, 8, 12, all else random)
+XLock.bug.neighbors: 0
+XLock.bug.eyes: off
+XLock.cage.delay: 25000
+!XLock.cage.count: 1
+!XLock.cage.cycles: 1
+!XLock.cage.size: 1
+XLock.cage.saturation: 1.0
+XLock.clock.delay: 100000
+XLock.clock.count: -16
+XLock.clock.cycles: 200
+XLock.clock.size: -200
+XLock.clock.saturation: 1.0
+XLock.coral.delay: 60000
+XLock.coral.count: -3
+!XLock.coral.cycles: 1
+XLock.coral.size: 35
+XLock.coral.saturation: 0.6
+XLock.crystal.delay: 60000
+XLock.crystal.count: -500
+XLock.crystal.cycles: 200
+XLock.crystal.size: -15
+XLock.crystal.saturation: 1.0
+XLock.crystal.nx: -3
+XLock.crystal.ny: -3
+XLock.crystal.cell: on
+XLock.crystal.grid: off
+XLock.crystal.centre: off
+XLock.crystal.maxsize: off
+XLock.crystal.cycle: on
+XLock.daisy.delay: 100000
+XLock.daisy.count: 300
+XLock.daisy.cycles: 350
+!XLock.daisy.size: 1
+XLock.daisy.saturation: 1.0
+XLock.daisy.garden: off
+XLock.dclock.delay: 10000
+!XLock.dclock.count: 1
+XLock.dclock.cycles: 10000
+!XLock.dclock.size: 1
+XLock.dclock.saturation: 0.3
+XLock.dclock.popex: off
+XLock.dclock.forest: off
+XLock.dclock.hiv: off
+XLock.dclock.lab: off
+XLock.dclock.veg: off
+XLock.dclock.y2k: off
+XLock.dclock.millennium: off
+XLock.deco.delay: 1000000
+XLock.deco.count: -30
+XLock.deco.cycles: 2
+XLock.deco.size: -10
+XLock.deco.saturation: 0.6
+XLock.demon.delay: 50000
+XLock.demon.count: 0
+XLock.demon.cycles: 1000
+XLock.demon.size: -7
+XLock.demon.saturation: 1.0
+! demon neighbors (3, 4, 6, 8, 9, 12, all else random)
+XLock.demon.neighbors: 0
+XLock.dilemma.delay: 200000
+XLock.dilemma.count: -2
+XLock.dilemma.cycles: 1000
+XLock.dilemma.size: 0
+XLock.dilemma.saturation: 1.0
+XLock.dilemma.bonus: 1.85
+XLock.dilemma.conscious: on
+! dilemma neighbors (3, 4, 6, 8, 9, 12, all else defaults to 4 or 8 for bitmap)
+XLock.dilemma.neighbors: 0
+XLock.discrete.delay: 1000
+XLock.discrete.count: 4096
+XLock.discrete.cycles: 2500
+!XLock.discrete.size: 1
+XLock.discrete.saturation: 1.0
+XLock.dragon.delay: 2000000
+!XLock.dragon.count: 1
+XLock.dragon.cycles: 16
+XLock.dragon.size: -24
+XLock.dragon.saturation: 1.0
+XLock.drift.delay: 10000
+XLock.drift.count: 30
+!XLock.drift.cycles: 1
+!XLock.drift.size: 1
+XLock.drift.saturation: 1.0
+XLock.drift.grow: off
+XLock.drift.liss: off
+XLock.euler2d.delay: 1000
+XLock.euler2d.count: 1024 
+XLock.euler2d.cycles: 3000
+!XLock.euler2d.size: 1
+XLock.euler2d.saturation: 1.0
+XLock.eyes.delay: 20000
+XLock.eyes.count: -8
+XLock.eyes.cycles: 5
+!XLock.eyes.size: 1
+XLock.eyes.saturation: 1.0
+XLock.eyes.trackmouse: off
+XLock.fadeplot.delay: 30000
+XLock.fadeplot.count: 10
+XLock.fadeplot.cycles: 1500
+!XLock.fadeplot.size: 1
+XLock.fadeplot.saturation: 0.6
+XLock.fire.delay: 10000
+XLock.fire.count: 800
+!XLock.fire.cycles: 1
+XLock.fire.size: 400
+XLock.fire.saturation: 1.0
+XLock.fire.texture: on
+XLock.fire.fog: off
+XLock.fire.shadows: on
+XLock.fire.framerate: off
+XLock.fire.trackmouse: off
+XLock.fire.trees: 5
+XLock.flag.delay: 50000
+!XLock.flag.count: 1
+XLock.flag.cycles: 1000
+XLock.flag.size: -7
+XLock.flag.saturation: 1.0
+XLock.flag.invert: off
+XLock.flame.delay: 750000
+XLock.flame.count: 20
+XLock.flame.cycles: 10000
+!XLock.flame.size: 1
+XLock.flame.saturation: 1.0
+XLock.flow.delay: 1000
+XLock.flow.count: 1024
+XLock.flow.cycles: 3000
+!XLock.flow.size: 1
+XLock.flow.saturation: 1.0
+XLock.forest.delay: 400000
+XLock.forest.count: 100
+XLock.forest.cycles: 200
+!XLock.forest.size: 1
+XLock.forest.saturation: 1.0
+XLock.galaxy.delay: 100
+XLock.galaxy.count: -5
+XLock.galaxy.cycles: 250
+XLock.galaxy.size: -3
+XLock.galaxy.saturation: 1.0
+XLock.galaxy.tracks: off
+XLock.gears.delay: 1000
+XLock.gears.count: 1
+XLock.gears.cycles: 2
+XLock.gears.size: 0
+XLock.gears.saturation: 1.0
+XLock.gears.planetary: on
+XLock.gears.planetsize: 400
+XLock.glplanet.delay:1000
+XLock.glplanet.count: 1
+XLock.glplanet.cycles:2
+XLock.goop.delay: 10000
+XLock.goop.count: -5
+!XLock.goop.cycles: 1
+!XLock.goop.size: 1
+XLock.goop.saturation: 1.0
+XLock.grav.delay: 10000
+XLock.grav.count: -12
+!XLock.grav.cycles: 1
+!XLock.grav.size: 1
+XLock.grav.saturation: 1.0
+XLock.grav.decay: off
+XLock.grav.trail: off
+XLock.helix.delay: 25000
+!XLock.helix.count: 1
+XLock.helix.cycles: 100
+!XLock.helix.size: 1
+XLock.helix.saturation: 1.0
+XLock.helix.ellipse: off
+XLock.hop.delay: 10000
+XLock.hop.count: 1000
+XLock.hop.cycles: 2500
+!XLock.hop.size: 1
+XLock.hop.saturation: 1.0
+XLock.hop.martin: off
+XLock.hop.popcorn: off
+XLock.hop.ejk1: off
+XLock.hop.ejk2: off
+XLock.hop.ejk3: off
+XLock.hop.ejk4: off
+XLock.hop.ejk5: off
+XLock.hop.ejk6: off
+XLock.hop.rr: off
+XLock.hop.jong: off
+XLock.hop.sine: off
+XLock.hyper.delay: 100000
+XLock.hyper.count: -6
+XLock.hyper.cycles: 300
+!XLock.hyper.size: 1
+XLock.hyper.saturation: 1.0
+XLock.hyper.randomStart: on
+XLock.hyper.showAxes: on
+XLock.hyper.showPlanes: off
+XLock.ico.delay: 100000
+XLock.ico.count: 0
+XLock.ico.cycles: 400
+XLock.ico.size: 0
+XLock.ico.saturation: 1.0
+XLock.ico.faces: off
+XLock.ico.trail: on
+XLock.ifs.delay: 1000
+!XLock.ifs.count: 1
+!XLock.ifs.cycles: 1
+!XLock.ifs.size: 1
+XLock.ifs.saturation: 1.0
+XLock.image.delay: 3000000
+XLock.image.count: -20
+!XLock.image.cycles: 1
+!XLock.image.size: 1
+XLock.image.saturation: 1.0
+XLock.juggle.delay: 10000
+XLock.juggle.count: 150
+XLock.juggle.cycles: 30
+!XLock.juggle.size: 1
+XLock.juggle.saturation: 1.0
+XLock.julia.delay: 10000
+XLock.julia.count: 1000
+XLock.julia.cycles: 20
+!XLock.julia.size: 1
+XLock.julia.saturation: 1.0
+XLock.julia.trackmouse: off
+XLock.kaleid.delay: 60000
+XLock.kaleid.count: -8
+XLock.kaleid.cycles: 40
+XLock.kaleid.size: -9
+XLock.kaleid.saturation: 0.6
+XLock.kaleid.alternate: off
+XLock.kaleid.serial: off
+XLock.kaleid.disconnected: on
+XLock.kaleid.quad: off
+XLock.kaleid.oct: off
+XLock.kaleid.linear: off
+XLock.kumppa.delay: 10000
+!XLock.kumppa.count: 1
+!XLock.kumppa.cycles: 1000
+!XLock.kumppa.size: 1
+XLock.kumppa.saturation: 1.0
+XLock.kumppa.dbuf: off
+XLock.kumppa.rrandom: on
+XLock.lament.delay: 10000
+!XLock.lament.count: 1
+!XLock.lament.cycles: 1
+!XLock.lament.size: 1 
+XLock.lament.saturation: 1.0
+XLock.laser.delay: 20000
+XLock.laser.count: -10
+XLock.laser.cycles: 200
+!XLock.laser.size: 1
+XLock.laser.saturation: 1.0
+XLock.life.delay: 750000
+XLock.life.count: 40
+XLock.life.cycles: 140
+XLock.life.size: 0
+XLock.life.saturation: 1.0
+!XLock.life.rule: P
+XLock.life.rule: G
+! life neighbors (3, 4, 6, 8, 9, 12, all else defaults to 8 for bitmap and Conway's Life)
+XLock.life.neighbors: 0
+!XLock.life.neighbors: 8
+!XLock.life.rule: S23/B3
+!XLock.life.neighbors: 6
+!XLock.life.rule: S2b34/B2a
+!XLock.life.rule: S2a2b4a/B2b3a4b
+!XLock.life.rule: S12b2c3a4b4c6/B2a3b3c5
+!XLock.life.rule: S12b2c3c4a56/B23a3c4b4c6
+!XLock.life.rule: S13b/B2a2c6
+XLock.life.callahan: off
+XLock.life.andreen: off
+XLock.life1d.delay: 10000
+!XLock.life1d.count: 1
+XLock.life1d.cycles: 10
+XLock.life1d.size: 0
+XLock.life1d.saturation: 1.0
+XLock.life1d.totalistic: True
+XLock.life3d.delay: 1000000
+XLock.life3d.count: 35
+XLock.life3d.cycles: 85
+!XLock.life3d.size: 1
+XLock.life3d.saturation: 1.0
+!XLock.life3d.rule: P
+XLock.life3d.rule: G
+!XLock.life3d.rule: S45/B5
+!XLock.life3d.rule3d: S567/B6
+!XLock.life3d.rule3d: S56/B5
+!XLock.life3d.rule3d: S67/B67
+XLock.lightning.delay: 10000
+!XLock.lightning.count: 1
+!XLock.lightning.cycles: 1
+!XLock.lightning.size: 1
+XLock.lightning.saturation: 0.6
+XLock.lisa.delay: 25000
+XLock.lisa.count: 1
+XLock.lisa.cycles: 256
+XLock.lisa.size: -1
+XLock.lisa.saturation: 1.0
+XLock.lisa.additive: on
+XLock.lissie.delay: 10000
+XLock.lissie.count: 1
+XLock.lissie.cycles: 2000
+XLock.lissie.size: -200
+XLock.lissie.saturation: 0.6
+XLock.loop.delay: 100000
+XLock.loop.count: -5
+XLock.loop.cycles: 1600
+XLock.loop.size: -12
+XLock.loop.saturation: 1.0
+! loop neighbors (4, 6, all else random)
+XLock.loop.neighbors: 0
+XLock.mandelbrot.delay: 25000
+XLock.mandelbrot.count: -8
+XLock.mandelbrot.cycles: 20000
+!XLock.mandelbrot.size: 1
+XLock.mandelbrot.saturation: 1.0
+XLock.mandelbrot.increment: 1.0
+XLock.mandelbrot.binary: off
+XLock.mandelbrot.dem: off
+XLock.marquee.delay: 100000
+!XLock.marquee.count: 1
+!XLock.marquee.cycles: 1
+!XLock.marquee.size: 1
+XLock.marquee.saturation: 1.0
+XLock.matrix.delay: 1000
+!XLock.matrix.count: 1
+!XLock.matrix.cycles: 1
+!XLock.matrix.size: 1
+XLock.matrix.saturation: 1.0
+XLock.maze.delay: 1000
+!XLock.maze.count: 1
+XLock.maze.cycles: 3000
+!XLock.maze.size: 8
+XLock.maze.size: -40
+XLock.maze.saturation: 1.0
+XLock.moebius.delay: 1000
+!XLock.moebius.count: 1
+!XLock.moebius.cycles: 1
+!XLock.moebius.size: 1
+XLock.moebius.saturation: 1.0
+XLock.moebius.solidmoebius: off
+XLock.moebius.noants: off
+XLock.molecule.cycles: 20
+XLock.molecule.atoms: on
+XLock.molecule.bbox: off
+XLock.molecule.bonds: on
+XLock.molecule.labels: on
+XLock.molecule.titles: on
+XLock.morph3d.delay: 1000
+XLock.morph3d.count: 0
+!XLock.morph3d.cycles: 1
+!XLock.morph3d.size: 1
+XLock.morph3d.saturation: 1.0
+XLock.mountain.delay: 1000
+XLock.mountain.count: 30
+XLock.mountain.cycles: 4000
+!XLock.mountain.size: 1
+XLock.mountain.saturation: 1.0
+XLock.munch.delay: 5000
+!XLock.munch.count: 1
+XLock.munch.cycles: 7
+!XLock.munch.size: 1
+XLock.munch.saturation: 1.0
+XLock.nose.delay: 100000
+!XLock.nose.count: 1
+!XLock.nose.cycles: 1
+!XLock.nose.size: 1
+XLock.nose.saturation: 1.0
+XLock.pacman.delay: 100000
+XLock.pacman.count: 10
+!XLock.pacman.cycles: 1
+XLock.pacman.size: 0
+XLock.pacman.saturation: 1.0
+XLock.penrose.delay: 10000
+!XLock.penrose.count: 1
+!XLock.penrose.cycles: 1
+XLock.penrose.size: -40
+XLock.penrose.saturation: 1.0
+XLock.penrose.ammann: off
+XLock.petal.delay: 10000
+XLock.petal.count: -500
+XLock.petal.cycles: 400
+!XLock.petal.size: 1
+XLock.petal.saturation: 1.0
+XLock.pipes.delay: 1000
+XLock.pipes.count: 2
+XLock.pipes.cycles: 5
+XLock.pipes.size: 500
+XLock.pipes.saturation: 1.0
+XLock.pipes.fisheye: on
+XLock.pipes.tightturns: off
+XLock.pipes.rotatepipes: on
+XLock.polyominoes.delay: 6000
+!XLock.polyominoes.count: 1
+XLock.polyominoes.cycles: 8192
+!XLock.polyominoes.size: 1
+XLock.polyominoes.saturation: 1.0
+XLock.puzzle.delay: 10000
+XLock.puzzle.count: 250
+!XLock.puzzle.cycles: 1
+!XLock.puzzle.size: 1
+XLock.puzzle.saturation: 1.0
+XLock.pyro.delay: 15000
+XLock.pyro.count: 100
+!XLock.pyro.cycles: 1
+XLock.pyro.size: -3
+XLock.pyro.saturation: 1.0
+XLock.qix.delay: 30000
+XLock.qix.count: -5
+XLock.qix.cycles: 32
+!XLock.qix.size: 1
+XLock.qix.saturation: 1.0
+XLock.qix.complete: off
+XLock.qix.kaleid: off
+XLock.roll.delay: 100000
+XLock.roll.count: 25
+!XLock.roll.cycles: 1
+XLock.roll.size: -64
+XLock.roll.saturation: 0.6
+XLock.rotor.delay: 100
+XLock.rotor.count: 4
+XLock.rotor.cycles: 100
+XLock.rotor.size: -6
+XLock.rotor.saturation: 0.3
+XLock.rubik.delay: 10000
+XLock.rubik.count: -30
+XLock.rubik.cycles: 5
+XLock.rubik.size: -6
+XLock.rubik.saturation: 1.0
+XLock.sballs.delay: 10000
+XLock.sballs.count: 0
+XLock.sballs.cycles: 10
+XLock.sballs.size: 400
+XLock.sballs.saturation: 1.0
+XLock.sballs.object: 0
+XLock.sballs.texture: on
+XLock.sballs.framerate: off
+XLock.sballs.trackmouse: off
+XLock.scooter.delay: 20000
+XLock.scooter.count: 24
+XLock.scooter.cycles: 3
+XLock.scooter.size: 100
+XLock.scooter.saturation: 1.0
+XLock.shape.delay: 10000
+!XLock.shape.count: 1
+XLock.shape.cycles: 256
+!XLock.shape.size: 1
+XLock.shape.saturation: 1.0
+XLock.shape.border: off
+XLock.shape.shade: on
+!XLock.shape.stipple: on
+XLock.sierpinski.delay: 400000
+XLock.sierpinski.count: 2000
+XLock.sierpinski.cycles: 100
+!XLock.sierpinski.size: 1
+XLock.sierpinski.saturation: 1.0
+XLock.sierpinski3d.delay: 10000
+XLock.sierpinski3d.maxdepth: 6
+XLock.sierpinski3d.speed: 150
+XLock.sierpinski3d.intensity: 2185
+XLock.slip.delay: 50000
+XLock.slip.count: 35
+XLock.slip.cycles: 50
+!XLock.slip.size: 1
+XLock.slip.saturation: 1.0
+XLock.solitare.delay: 2000000
+!XLock.solitare.count: 1
+!XLock.solitare.cycles: 1
+!XLock.solitare.size: 1
+XLock.solitare.saturation: 1.0
+XLock.space.delay: 10000
+XLock.space.count: 100
+!XLock.space.cycles: 1
+!XLock.space.size: 1
+XLock.space.saturation: 1.0
+XLock.sphere.delay: 5000
+!XLock.sphere.count: 1
+!XLock.sphere.cycles: 1
+!XLock.sphere.size: 1
+XLock.sphere.saturation: 1.0
+XLock.spiral.delay: 5000
+XLock.spiral.count: -40
+XLock.spiral.cycles: 350
+!XLock.spiral.size: 1
+XLock.spiral.saturation: 1.0
+XLock.spline.delay: 30000
+XLock.spline.count: -6
+XLock.spline.cycles: 2048
+!XLock.spline.size: 1
+XLock.spline.saturation: 0.3
+XLock.spline.erase: off
+XLock.sproingies.delay: 1000
+XLock.sproingies.count: 5
+XLock.sproingies.cycles: 0
+XLock.sproingies.size: 400
+XLock.sproingies.saturation: 1.0
+XLock.stairs.delay: 200000
+!XLock.stairs.count: 1
+!XLock.stairs.cycles: 1
+!XLock.stairs.size: 1
+XLock.stairs.saturation: 1.0
+XLock.star.delay: 75000
+XLock.star.count: 100
+!XLock.star.cycles: 1
+XLock.star.size: 100
+XLock.star.saturation: 0.3
+!XLock.star.saturation: 1.0
+XLock.star.straight: off
+XLock.star.rock: off
+XLock.star.trek: 50
+XLock.starfish.delay: 2000
+!XLock.starfish.count: 1
+!XLock.starfish.cycles: 1000
+!XLock.starfish.size: 1
+XLock.starfish.saturation: 1.0
+XLock.starfish.cyclespeed: 3
+XLock.starfish.rotation: -1
+XLock.starfish.thickness: -20
+XLock.starfish.blob: off
+XLock.starfish.cycle: on
+XLock.strange.delay: 1000
+!XLock.strange.count: 1
+!XLock.strange.cycles: 1
+!XLock.strange.size: 1
+XLock.strange.saturation: 1.0
+XLock.superquadrics.delay: 1000
+XLock.superquadrics.count: 25
+XLock.superquadrics.cycles: 40
+!XLock.superquadrics.size: 1
+XLock.superquadrics.saturation: 1.0
+XLock.superquadrics.spinspeed: 5.0
+XLock.swarm.delay: 15000
+XLock.swarm.count: -100
+!XLock.swarm.cycles: 1
+XLock.swarm.size: -100
+XLock.swarm.saturation: 1.0
+XLock.swarm.trackmouse: off
+XLock.swirl.delay: 5000
+XLock.swirl.count: 5
+!XLock.swirl.cycles: 1
+!XLock.swirl.size: 1
+XLock.swirl.saturation: 1.0
+XLock.t3d.delay: 250000
+XLock.t3d.count: 1
+XLock.t3d.cycles: 60000
+XLock.t3d.size: 1
+XLock.t3d.saturation: 1.0
+XLock.tetris.delay: 50000
+!XLock.tetris.count: 1
+!XLock.tetris.cycles: 1
+XLock.tetris.size: -100
+XLock.tetris.saturation: 1.0
+XLock.tetris.cycle: on
+XLock.tetris.bonus: off
+XLock.tetris.trackmouse: off
+XLock.tetris.well: off
+XLock.thornbird.delay: 1000
+XLock.thornbird.count: 800
+XLock.thornbird.cycles: 16
+!XLock.thornbird.size: 1
+XLock.thornbird.saturation: 1.0
+XLock.tik_tak.delay: 60000
+!XLock.tik_tak.count: -20
+!XLock.tik_tak.cycles: 200
+XLock.tik_tak.size: -1000
+XLock.tik_tak.saturation: 1.0
+XLock.tik_tak.cycle: on
+XLock.triangle.delay: 10000
+!XLock.triangle.count: 1
+!XLock.triangle.cycles: 1
+!XLock.triangle.size: 1
+XLock.triangle.saturation: 1.0
+XLock.tube.delay: 25000
+XLock.tube.count: -9
+XLock.tube.cycles: 20000
+XLock.tube.size: -200
+XLock.tube.saturation: 1.0
+XLock.turtle.delay: 1000000
+!XLock.turtle.count: 1
+XLock.turtle.cycles: 20
+!XLock.turtle.size: 1
+XLock.turtle.saturation: 1.0
+XLock.vines.delay: 200000
+XLock.vines.count: 0
+!XLock.vines.cycles: 1
+!XLock.vines.size: 1
+XLock.vines.saturation: 1.0
+XLock.voters.delay: 1000
+XLock.voters.count: 0
+XLock.voters.cycles: 327670
+XLock.voters.size: 0
+XLock.voters.saturation: 1.0
+! voters neighbors (3, 4, 6, 8, 9, 12, all else defaults to 4 or 8 for bitmap)
+XLock.voters.neighbors: 0
+XLock.wator.delay: 750000
+!XLock.wator.count: 1
+XLock.wator.cycles: 32767
+XLock.wator.size: 0
+XLock.wator.saturation: 1.0
+! wator neighbors (3, 4, 6, 8, 9, 12, all else defaults to 4 or 8 for bitmap)
+XLock.wator.neighbors: 0
+XLock.wire.delay: 500000
+XLock.wire.count: 1000
+XLock.wire.cycles: 150
+XLock.wire.size: -8
+XLock.wire.saturation: 1.0
+! wire neighbors (3, 4, 6, 8, 9, 12, all else random)
+XLock.wire.neighbors: 0
+XLock.world.delay: 100000
+XLock.world.count: -16
+!XLock.world.cycles: 1
+!XLock.world.size: 1
+XLock.world.saturation: 0.3
+XLock.worm.delay: 17000
+XLock.worm.count: -20
+XLock.worm.cycles: 10
+XLock.worm.size: -3
+XLock.worm.saturation: 1.0
+XLock.xcl.delay: 20000
+XLock.xcl.count: -3
+!XLock.xcl.cycles: 1
+!XLock.xcl.size: 1
+XLock.xcl.saturation: 1.0
+XLock.xjack.delay: 50000
+!XLock.xjack.count: 1
+!XLock.xjack.cycles: 1
+!XLock.xjack.size: 1
+XLock.xjack.saturation: 1.0
+
+XLock.blank.delay: 3000000
+!XLock.blank.count: 1
+!XLock.blank.cycles: 1
+!XLock.blank.size: 1
+XLock.blank.saturation: 1.0
+XLock.bomb.delay: 100000
+XLock.bomb.count: 10
+XLock.bomb.cycles: 20
+!XLock.bomb.size: 1
+XLock.bomb.saturation: 1.0
+
+XLock.random.duration: 60
+!XLock.random.duration: 0
+XLock.random.modelist: all
+!XLock.random.modelist: allnice
+!XLock.random.modelist: all3d
+!XLock.random.modelist: allgl
+!XLock.random.modelist: allautomata
+!XLock.random.modelist: allfractal
+!XLock.random.modelist: allgeometry
+!XLock.random.modelist: allspace
+XLock.random.fullrandom: on
+XLock.random.sequential: off
diff --git a/xlock/automata.c b/xlock/automata.c
new file mode 100644 (file)
index 0000000..80be4b0
--- /dev/null
@@ -0,0 +1,63 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)automata.c   4.10 98/04/28 xlockmore";
+
+#endif
+
+/*-
+ * automata.c - special stuff for automata modes
+ *
+ * Copyright (c) 1998 by David Bagley
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 20-Apr-98: Separated out of util.c
+ *
+ */
+
+#if STANDALONE
+#include "utils.h"
+#else
+#include "xlock.h"
+
+#endif
+#include "automata.h"
+
+XPoint      hexagonUnit[6] =
+{
+       {0, 0},
+       {1, 1},
+       {0, 2},
+       {-1, 1},
+       {-1, -1},
+       {0, -2}
+};
+
+XPoint      triangleUnit[2][3] =
+{
+       {
+               {0, 0},
+               {1, -1},
+               {0, 2}
+       },
+       {
+               {0, 0},
+               {-1, 1},
+               {0, -2}
+       }
+};
+
+unsigned char stipples[NUMSTIPPLES][STIPPLESIZE] =
+{
+       {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},       /* white */
+       {0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22},       /* grey+white | stripe */
+       {0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00},       /* spots */
+       {0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11},       /* lt. / stripe */
+       {0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66},       /* | bars */
+       {0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa},       /* 50% grey */
+       {0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00},       /* - bars */
+       {0xee, 0xdd, 0xbb, 0x77, 0xee, 0xdd, 0xbb, 0x77},       /* dark \ stripe */
+       {0xff, 0x99, 0x99, 0xff, 0xff, 0x99, 0x99, 0xff},       /* spots */
+       {0xaa, 0xff, 0xff, 0x55, 0xaa, 0xff, 0xff, 0x55},       /* black+grey - stripe */
+       {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}        /* black */
+};
diff --git a/xlock/automata.h b/xlock/automata.h
new file mode 100644 (file)
index 0000000..1ed78c6
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _AUTOMATA_H_
+#define _AUTOMATA_H_
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)automata.h 4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Cellular Automata stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+extern XPoint hexagonUnit[6];
+extern XPoint triangleUnit[2][3];
+
+#define NUMSTIPPLES 11
+#define STIPPLESIZE 8
+extern unsigned char stipples[NUMSTIPPLES][STIPPLESIZE];
+
+/* extern unsigned char **stipples; */
+
+#endif /* _AUTOMATA_H_ */
diff --git a/xlock/color.c b/xlock/color.c
new file mode 100644 (file)
index 0000000..db6426f
--- /dev/null
@@ -0,0 +1,1175 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)color.c      4.00 97/01/01 xlockmore";
+
+#endif
+
+/*-
+ * color.c - extracted from swirl.c, xlock.c and util.c
+ *
+ * See xlock.c for copying information.
+ *
+ * xlock.c and util.c Copyright (c) 1988-91 by Patrick J. Naughton.
+ * swirl.c Copyright (c) 1994 M.Dobie <mrd@ecs.soton.ac.uk>
+ *
+ */
+
+#include "xlock.h"
+#include "color.h"
+#include "vis.h"
+
+/* Formerly in util.c */
+/*-
+ * Create an HSB ramp.
+ *
+ * Revision History:
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * Changes of Patrick J. Naughton
+ * 29-Jul-90: renamed hsbramp.c from HSBmap.c
+ *           minor optimizations.
+ * 01-Sep-88: Written.
+ */
+
+static void
+hsb2rgb(double H, double S, double B,
+       unsigned char *r, unsigned char *g, unsigned char *b)
+{
+       int         i;
+       double      f, bb;
+       unsigned char p, q, t;
+
+       H -= floor(H);          /* remove anything over 1 */
+       H *= 6.0;
+       i = (int) floor(H);     /* 0..5 */
+       f = H - (float) i;      /* f = fractional part of H */
+       bb = 255.0 * B;
+       p = (unsigned char) (bb * (1.0 - S));
+       q = (unsigned char) (bb * (1.0 - (S * f)));
+       t = (unsigned char) (bb * (1.0 - (S * (1.0 - f))));
+       switch (i) {
+               case 0:
+                       *r = (unsigned char) bb;
+                       *g = t;
+                       *b = p;
+                       break;
+               case 1:
+                       *r = q;
+                       *g = (unsigned char) bb;
+                       *b = p;
+                       break;
+               case 2:
+                       *r = p;
+                       *g = (unsigned char) bb;
+                       *b = t;
+                       break;
+               case 3:
+                       *r = p;
+                       *g = q;
+                       *b = (unsigned char) bb;
+                       break;
+               case 4:
+                       *r = t;
+                       *g = p;
+                       *b = (unsigned char) bb;
+                       break;
+               case 5:
+                       *r = (unsigned char) bb;
+                       *g = p;
+                       *b = q;
+                       break;
+       }
+}
+
+
+/*-
+ * Input is two points in HSB color space and a count
+ * of how many discreet rgb space values the caller wants.
+ *
+ * Output is that many rgb triples which describe a linear
+ * interpolate ramp between the two input colors.
+ */
+
+static void
+hsbramp(double h1, double s1, double b1, double h2, double s2, double b2,
+    int count, unsigned char *red, unsigned char *green, unsigned char *blue)
+{
+       double      dh, ds, db;
+
+       dh = (h2 - h1) / count;
+       ds = (s2 - s1) / count;
+       db = (b2 - b1) / count;
+       while (count--) {
+               hsb2rgb(h1, s1, b1, red++, green++, blue++);
+               h1 += dh;
+               s1 += ds;
+               b1 += db;
+       }
+}
+
+
+/* Formerly in xlock.c */
+
+unsigned long
+allocPixel(Display * display, Colormap cmap, const char *name, const char *def)
+{
+       XColor      col, tmp;
+
+       (void) XParseColor(display, cmap, name, &col);
+       if (!XAllocColor(display, cmap, &col)) {
+               (void) fprintf(stderr, "could not allocate: %s, using %s instead\n",
+                              name, def);
+               (void) XAllocNamedColor(display, cmap, def, &col, &tmp);
+       }
+       return col.pixel;
+}
+
+static void
+monoColormap(Screen * scr, ScreenInfo * si, char *foreground, char *background)
+{
+       si->black_pixel = BlackPixelOfScreen(scr);
+       si->white_pixel = WhitePixelOfScreen(scr);
+       if (strcmp(foreground, "White") == 0 || strcmp(foreground, "white") == 0 ||
+           strcmp(background, "Black") == 0 || strcmp(background, "black") == 0) {
+               si->fg_pixel = WhitePixelOfScreen(scr);
+               si->bg_pixel = BlackPixelOfScreen(scr);
+       } else {
+               si->fg_pixel = BlackPixelOfScreen(scr);
+               si->bg_pixel = WhitePixelOfScreen(scr);
+       }
+       si->pixels[0] = WhitePixelOfScreen(scr);
+       si->pixels[1] = BlackPixelOfScreen(scr);
+       si->npixels = 2;
+}
+
+void
+fixColormap(ModeInfo * mi, int ncolors, float saturation,
+           Bool mono, Bool install, Bool inroot, Bool inwindow, Bool verbose)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window     window = MI_WINDOW(mi);
+       Screen     *scr = MI_SCREENPTR(mi);
+       Colormap    cmap = MI_COLORMAP(mi);
+       Colormap    dcmap = DefaultColormapOfScreen(scr);
+       XColor      xcolor;
+       unsigned char *red = NULL, *green = NULL, *blue = NULL;
+       int         colorcount, i, fixed, visualclass;
+       extern char *foreground;
+       extern char *background;
+
+#ifdef USE_DTSAVER
+       extern Bool dtsaver;
+
+#endif
+#ifndef COMPLIANT_COLORMAP
+       Bool        retry = False;
+
+#endif
+
+       if (mono || CellsOfScreen(scr) <= 2) {
+               if (MI_PIXELS(mi))
+                       return;
+               if ((MI_PIXELS(mi) = (unsigned long *) calloc(2,
+                               sizeof (unsigned long))) == NULL) {
+                       (void) fprintf(stderr, "could not get the 2 colors for mono\n");
+               }
+
+               monoColormap(scr, MI_SCREENINFO(mi), foreground, background);
+               return;
+       }
+       colorcount = ncolors;
+       if (((  red = (unsigned char *) calloc(ncolors,
+                       sizeof (unsigned char))) == NULL) ||
+           ((green = (unsigned char *) calloc(ncolors,
+                       sizeof (unsigned char))) == NULL) ||
+           (( blue = (unsigned char *) calloc(ncolors,
+                       sizeof (unsigned char))) == NULL)) {
+               (void) fprintf(stderr, "could not get the %d colors\n", ncolors);
+               if (red != NULL)
+                       (void) free((void *) red);
+               if (green != NULL)
+                       (void) free((void *) green);
+               return;
+       }
+
+       visualclass = MI_VISUALCLASS(mi);
+       fixed = (visualclass == StaticGray) || (visualclass == StaticColor) ||
+               (visualclass == TrueColor);
+       if (
+#ifdef USE_DTSAVER
+                  dtsaver ||   /* needs to be in focus without mouse */
+
+#endif
+                  inroot || (!install && !fixed) || cmap == None) {
+               cmap = dcmap;
+       }
+       if (cmap != dcmap && MI_PIXELS(mi)) {
+               XFreeColors(display, cmap, MI_PIXELS(mi), MI_NPIXELS(mi), 0);
+#ifndef COMPLIANT_COLORMAP
+               XFreeColors(display, cmap, &(MI_BLACK_PIXEL(mi)), 1, 0);
+               XFreeColors(display, cmap, &(MI_WHITE_PIXEL(mi)), 1, 0);
+#endif
+               XFreeColors(display, cmap, &(MI_BG_PIXEL(mi)), 1, 0);
+               XFreeColors(display, cmap, &(MI_FG_PIXEL(mi)), 1, 0);
+       }
+       /* else if (cmap) { (void) printf("cmap: this case is possible?\n");  } */
+       if (MI_PIXELS(mi))
+               (void) free((void *) MI_PIXELS(mi));
+       if ((MI_PIXELS(mi) = (unsigned long *) calloc(ncolors,
+                       sizeof (unsigned long))) == NULL) {
+               (void) fprintf(stderr, "could not get the %d colors\n", ncolors);
+       }
+       /* "allocate" the black and white pixels, so that they
+          will be included by XCopyColormapAndFree() if it gets called */
+#ifdef COMPLIANT_COLORMAP
+       MI_BLACK_PIXEL(mi) = BlackPixelOfScreen(scr);
+       MI_WHITE_PIXEL(mi) = WhitePixelOfScreen(scr);
+#else
+       MI_BLACK_PIXEL(mi) = allocPixel(display, cmap, "Black", "Black");
+       MI_WHITE_PIXEL(mi) = allocPixel(display, cmap, "White", "White");
+#endif
+       MI_BG_PIXEL(mi) = allocPixel(display, cmap, background, "White");
+       MI_FG_PIXEL(mi) = allocPixel(display, cmap, foreground, "Black");
+       hsbramp(0.0, saturation, 1.0, 1.0, saturation, 1.0, colorcount,
+               red, green, blue);
+
+       MI_NPIXELS(mi) = 0;
+       for (i = 0; i < colorcount; i++) {
+               xcolor.red = red[i] << 8;
+               xcolor.green = green[i] << 8;
+               xcolor.blue = blue[i] << 8;
+               xcolor.flags = DoRed | DoGreen | DoBlue;
+
+               if (!XAllocColor(display, cmap, &xcolor)) {
+#ifdef COMPLIANT_COLORMAP
+                       if (!install || cmap != dcmap)
+                               break;
+                       if ((cmap = XCopyColormapAndFree(display, cmap)) == dcmap)
+                               break;
+                       if (verbose)
+                               (void) fprintf(stderr, "using private colormap\n");
+                       if (!XAllocColor(display, cmap, &xcolor))
+                               break;
+#else
+                       if (verbose)
+                               (void) fprintf(stderr, "ran out of colors on colormap\n");
+                       if ((saturation != 1.0 || ncolors != 64) && MI_NPIXELS(mi) < 2) {
+                               if (verbose)
+                                       (void) fprintf(stderr,
+                                                      "retrying with saturation = 1.0 and ncolors = 64\n");
+                               retry = True;
+                       }
+                       break;
+#endif
+               }
+               MI_PIXELS(mi)[i] = xcolor.pixel;
+               MI_NPIXELS(mi)++;
+       }
+       (void) free((void *) red);
+       (void) free((void *) green);
+       (void) free((void *) blue);
+       if (verbose)
+               (void) fprintf(stderr, "%d pixel%s allocated\n", MI_NPIXELS(mi),
+                              (MI_NPIXELS(mi) == 1) ? "" : "s");
+       if (MI_NPIXELS(mi) <= 4) {
+               XFreeColors(display, cmap, MI_PIXELS(mi), MI_NPIXELS(mi), 0);
+#ifndef COMPLIANT_COLORMAP
+               XFreeColors(display, cmap, &(MI_BLACK_PIXEL(mi)), 1, 0);
+               XFreeColors(display, cmap, &(MI_WHITE_PIXEL(mi) ), 1, 0);
+#endif
+               XFreeColors(display, cmap, &(MI_BG_PIXEL(mi)), 1, 0);
+               XFreeColors(display, cmap, &(MI_FG_PIXEL(mi)), 1, 0);
+#ifndef COMPLIANT_COLORMAP
+               if (retry) {
+                       fixColormap(mi, 64, 1.0,
+                                   mono, install, inroot, inwindow, verbose);
+                       return;
+               }
+#endif
+               monoColormap(scr, MI_SCREENINFO(mi), foreground, background);
+               MI_COLORMAP(mi) = cmap = DefaultColormapOfScreen(scr);
+               return;
+       }
+       MI_COLORMAP(mi) = cmap;
+       if ((install || fixed) && !inroot && MI_NPIXELS(mi) > 2) {
+#if 0
+               (void) XGetWindowAttributes(display, window, &xgwa);
+               if (cmap != xgwa.colormap)
+#endif
+#if 1                          /* Turn off to simulate fvwm and tvwm */
+                       setColormap(display, window, cmap, inwindow);
+#endif
+       }
+#if 0
+       else {
+               /* white and black colors may not be right for GL modes so lets set them */
+               MI_BLACK_PIXEL(mi) = BlackPixelOfScreen(scr);
+               MI_WHITE_PIXEL(mi) = WhitePixelOfScreen(scr);
+               /* foreground and background colors may not be right.... */
+               BlackPixelOfScreen(scr) = MI_BLACK_PIXEL(mi);
+               WhitePixelOfScreen(scr) = MI_WHITE_PIXEL(mi);
+       }
+#endif
+}
+
+void
+setColormap(Display * display, Window window, Colormap cmap, Bool inwindow)
+{
+       XSetWindowColormap(display, window, cmap);
+       /* Now, here we have a problem.  When we are running full-screen, the
+          window's override_redirect attribute is on.  So, the window manager
+          never gets the ColormapNotify event that gets generated on the
+          above XSetWindowColormap() call, and does not So, a quick solution
+          is to install it ourselves.  The problem with this is that it
+          violates the ICCCM convention that only window managers should
+          install colormaps. Indeed, Fvwm _enforces_ this by immediately
+          un-doing any XInstallColormap() performed by a client (which is why
+          this does not work right under Fvwm). */
+
+       if (!inwindow) {
+               XInstallColormap(display, cmap);
+       }
+}
+
+/*-
+ * useableColors
+ */
+int
+preserveColors(unsigned long black, unsigned long white,
+              unsigned long bg, unsigned long fg)
+{
+       /* how many colours should we preserve (out of white, black, fg, bg)? */
+       if (((bg == black) || (bg == white)) && ((fg == black) || (fg == white)))
+               return 2;
+       else if ((bg == black) || (fg == black) ||
+                (bg == white) || (fg == white) || (bg == fg))
+               return 3;
+       else
+               return 4;
+}
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+void
+reserveColors(ModeInfo * mi, Colormap cmap, unsigned long *black)
+{
+       Display    *display = MI_DISPLAY(mi);
+       XColor      blackcolor, whitecolor;
+
+       blackcolor.flags = DoRed | DoGreen | DoBlue;
+       blackcolor.pixel = MI_BLACK_PIXEL(mi);
+       blackcolor.red = 0;
+       blackcolor.green = 0;
+       blackcolor.blue = 0;
+       whitecolor.flags = DoRed | DoGreen | DoBlue;
+       whitecolor.pixel = MI_WHITE_PIXEL(mi);
+       whitecolor.red = 0xFFFF;
+       whitecolor.green = 0xFFFF;
+       whitecolor.blue = 0xFFFF;
+
+       /* If they fail what should I do? */
+       (void) XAllocColor(display, cmap, &blackcolor);
+       (void) XAllocColor(display, cmap, &whitecolor);
+       *black = blackcolor.pixel;
+
+#if 0
+       {
+               XColor      bgcolor, fgcolor;
+
+               bgcolor.pixel = MI_BG_PIXEL(mi);
+               fgcolor.pixel = MI_FG_PIXEL(mi);
+               XQueryColor(display, cmap, &bgcolor);
+               XQueryColor(display, cmap, &fgcolor);
+               (void) XAllocColor(display, cmap, &bgcolor);
+               (void) XAllocColor(display, cmap, &fgcolor);
+       }
+#endif
+}
+
+#endif
+
+/* the remaining of this file was hacked from colors.c and hsv.c from
+ * xscreensaver
+ *
+ * xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * Modified for the use with xlockmore by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ * 12 June 1998
+ */
+
+/* This file contains some utility routines for randomly picking the colors
+   to hack the screen with.
+ */
+
+void
+free_colors(Display * dpy, Colormap cmap, XColor * colors, int ncolors)
+{
+       int         i;
+
+       if (ncolors > 0) {
+               unsigned long *pixels;
+
+               if ((pixels = (unsigned long *) malloc(sizeof (unsigned long) *
+                               ncolors)) == NULL) {
+                       (void) fprintf(stderr, "could not free colors\n");
+                       return;
+               }
+
+               for (i = 0; i < ncolors; i++)
+                       pixels[i] = colors[i].pixel;
+               XFreeColors(dpy, cmap, pixels, ncolors, 0L);
+               (void) free((void *) pixels);
+       }
+}
+
+
+void
+allocate_writable_colors(Display * dpy, Colormap cmap,
+                        unsigned long *pixels, int *ncolorsP)
+{
+       int         desired = *ncolorsP;
+       int         got = 0;
+       int         requested = desired;
+       unsigned long *new_pixels = pixels;
+
+       *ncolorsP = 0;
+       while (got < desired
+              && requested > 0) {
+               if (desired - got < requested)
+                       requested = desired - got;
+
+               if (XAllocColorCells(dpy, cmap, False, 0, 0, new_pixels, requested)) {
+                       /* Got all the pixels we asked for. */
+                       new_pixels += requested;
+                       got += requested;
+               } else {
+                       /* We didn't get all/any of the pixels we asked for.  This time, ask
+                          for half as many.  (If we do get all that we ask for, we ask for
+                          the same number again next time, so we only do O(log(n)) server
+                          roundtrips.)
+                        */
+                       requested = requested / 2;
+               }
+       }
+       *ncolorsP += got;
+}
+
+
+
+void
+make_color_ramp(Display * dpy, Colormap cmap,
+               int h1, double s1, double v1,   /* 0-360, 0-1.0, 0-1.0 */
+               int h2, double s2, double v2,   /* 0-360, 0-1.0, 0-1.0 */
+               XColor * colors, int *ncolorsP,
+               Bool closed_p,
+               Bool allocate_p,
+               Bool writable_p)
+{
+       int         i;
+       int         ncolors = *ncolorsP;
+       double      dh, ds, dv; /* deltas */
+
+      AGAIN:
+
+       (void) memset(colors, 0, (*ncolorsP) * sizeof (*colors));
+
+       if (closed_p)
+               ncolors = (ncolors / 2) + 1;
+
+       /* Note: unlike other routines in this module, this function assumes that
+          if h1 and h2 are more than 180 degrees apart, then the desired direction
+          is always from h1 to h2 (rather than the shorter path.)  make_uniform
+          depends on this.
+        */
+       dh = ((double) h2 - (double) h1) / ncolors;
+       ds = (s2 - s1) / ncolors;
+       dv = (v2 - v1) / ncolors;
+
+       for (i = 0; i < ncolors; i++) {
+               colors[i].flags = DoRed | DoGreen | DoBlue;
+               hsv_to_rgb((int) (h1 + (i * dh)), (s1 + (i * ds)), (v1 + (i * dv)),
+                          &colors[i].red, &colors[i].green, &colors[i].blue);
+       }
+
+       if (closed_p)
+               for (i = ncolors; i < *ncolorsP; i++)
+                       colors[i] = colors[(*ncolorsP) - i];
+
+       if (!allocate_p)
+               return;
+
+       if (writable_p) {
+               unsigned long *pixels;
+
+               if ((pixels = (unsigned long *) malloc(sizeof (unsigned long) *
+                               ((*ncolorsP) + 1))) == NULL) {
+                       goto FAIL;
+               }
+
+               /* allocate_writable_colors() won't do here, because we need exactly this
+                  number of cells, or the color sequence we've chosen won't fit. */
+               if (!XAllocColorCells(dpy, cmap, False, 0, 0, pixels, *ncolorsP)) {
+                       (void) free((void *) pixels);
+                       goto FAIL;
+               }
+               for (i = 0; i < *ncolorsP; i++)
+                       colors[i].pixel = pixels[i];
+               (void) free((void *) pixels);
+
+               XStoreColors(dpy, cmap, colors, *ncolorsP);
+       } else {
+               for (i = 0; i < *ncolorsP; i++) {
+                       XColor      color;
+
+                       color = colors[i];
+                       if (XAllocColor(dpy, cmap, &color)) {
+                               colors[i].pixel = color.pixel;
+                       } else {
+                               free_colors(dpy, cmap, colors, i);
+                               goto FAIL;
+                       }
+               }
+       }
+
+       return;
+
+      FAIL:
+       /* we weren't able to allocate all the colors we wanted;
+          decrease the requested number and try again.
+        */
+       ncolors = (ncolors > 170 ? ncolors - 20 :
+                  ncolors > 100 ? ncolors - 10 :
+                  ncolors > 75 ? ncolors - 5 :
+                  ncolors > 25 ? ncolors - 3 :
+                  ncolors > 10 ? ncolors - 2 :
+                  ncolors > 2 ? ncolors - 1 :
+                  0);
+       *ncolorsP = ncolors;
+       if (ncolors > 0)
+               goto AGAIN;
+}
+
+
+#define MAXPOINTS 50           /* yeah, so I'm lazy */
+
+
+static void
+make_color_path(Display * dpy, Colormap cmap,
+               int npoints, int *h, double *s, double *v,
+               XColor * colors, int *ncolorsP,
+               Bool allocate_p,
+               Bool writable_p)
+{
+       int         i, k;
+       int         total_ncolors = *ncolorsP;
+
+       int         ncolors[MAXPOINTS];         /* number of pixels per edge */
+       double      dh[MAXPOINTS];      /* distance between pixels, per edge (0 - 360.0) */
+       double      ds[MAXPOINTS];      /* distance between pixels, per edge (0 - 1.0) */
+       double      dv[MAXPOINTS];      /* distance between pixels, per edge (0 - 1.0) */
+
+       if (npoints == 0) {
+               *ncolorsP = 0;
+               return;
+       } else if (npoints == 2) {      /* using make_color_ramp() will be faster */
+               make_color_ramp(dpy, cmap,
+                               h[0], s[0], v[0], h[1], s[1], v[1],
+                               colors, ncolorsP,
+                               True,   /* closed_p */
+                               allocate_p, writable_p);
+               return;
+       } else if (npoints >= MAXPOINTS) {
+               npoints = MAXPOINTS - 1;
+       }
+      AGAIN:
+
+       {
+               double      DH[MAXPOINTS];      /* Distance between H values in the shortest
+
+                                                  direction around the circle, that is, the
+                                                  distance between 10 and 350 is 20.
+                                                  (Range is 0 - 360.0.)
+                                                */
+               double      edge[MAXPOINTS];    /* lengths of edges in unit HSV space. */
+               double      ratio[MAXPOINTS];   /* proportions of the edges (total 1.0) */
+               double      circum = 0;
+               double      one_point_oh = 0;   /* (debug) */
+
+               for (i = 0; i < npoints; i++) {
+                       int         j = (i + 1) % npoints;
+                       double      d = ((double) (h[i] - h[j])) / 360;
+
+                       if (d < 0)
+                               d = -d;
+                       if (d > 0.5)
+                               d = 0.5 - (d - 0.5);
+                       DH[i] = d;
+               }
+
+               for (i = 0; i < npoints; i++) {
+                       int         j = (i + 1) % npoints;
+
+                       edge[i] = sqrt((DH[i] * DH[j]) +
+                                      ((s[j] - s[i]) * (s[j] - s[i])) +
+                                      ((v[j] - v[i]) * (v[j] - v[i])));
+                       circum += edge[i];
+               }
+
+#ifdef DEBUG
+               (void) fprintf(stderr, "\ncolors:");
+               for (i = 0; i < npoints; i++)
+                       (void) fprintf(stderr, " (%d, %.3f, %.3f)", h[i], s[i], v[i]);
+               (void) fprintf(stderr, "\nlengths:");
+               for (i = 0; i < npoints; i++)
+                       (void) fprintf(stderr, " %.3f", edge[i]);
+#endif /* DEBUG */
+
+               if (circum < 0.0001)
+                       goto FAIL;
+
+               for (i = 0; i < npoints; i++) {
+                       ratio[i] = edge[i] / circum;
+                       one_point_oh += ratio[i];
+               }
+
+#ifdef DEBUG
+               (void) fprintf(stderr, "\nratios:");
+               for (i = 0; i < npoints; i++)
+                       (void) fprintf(stderr, " %.3f", ratio[i]);
+#endif /* DEBUG */
+
+               if (one_point_oh < 0.99999 || one_point_oh > 1.00001)
+                       abort();
+
+               /* space the colors evenly along the circumference -- that means that the
+                  number of pixels on a edge is proportional to the length of that edge
+                  (relative to the lengths of the other edges.)
+                */
+               for (i = 0; i < npoints; i++)
+                       ncolors[i] = (int) (total_ncolors * ratio[i]);
+
+
+#ifdef DEBUG
+               (void) fprintf(stderr, "\npixels:");
+               for (i = 0; i < npoints; i++)
+                       (void) fprintf(stderr, " %d", ncolors[i]);
+               (void) fprintf(stderr, "  (%d)\n", total_ncolors);
+#endif /* DEBUG */
+
+               for (i = 0; i < npoints; i++) {
+                       int         j = (i + 1) % npoints;
+
+                       if (ncolors[i] > 0) {
+                               dh[i] = 360 * (DH[i] / ncolors[i]);
+                               ds[i] = (s[j] - s[i]) / ncolors[i];
+                               dv[i] = (v[j] - v[i]) / ncolors[i];
+                       }
+               }
+       }
+
+       (void) memset(colors, 0, (*ncolorsP) * sizeof (*colors));
+
+       k = 0;
+       for (i = 0; i < npoints; i++) {
+               int         distance, direction, j;
+
+               distance = h[(i + 1) % npoints] - h[i];
+               direction = (distance >= 0 ? -1 : 1);
+
+               if (distance > 180)
+                       distance = 180 - (distance - 180);
+               else if (distance < -180)
+                       distance = -(180 - ((-distance) - 180));
+               else
+                       direction = -direction;
+
+#ifdef DEBUG
+               (void) fprintf(stderr, "point %d: %3d %.2f %.2f\n",
+                       i, h[i], s[i], v[i]);
+               (void) fprintf(stderr, "  h[i]=%d  dh[i]=%.2f  ncolors[i]=%d\n",
+                       h[i], dh[i], ncolors[i]);
+#endif /* DEBUG */
+               for (j = 0; j < ncolors[i]; j++, k++) {
+                       double      hh = (h[i] + (j * dh[i] * direction));
+
+                       if (hh < 0)
+                               hh += 360;
+                       else if (hh > 360)
+                               hh -= 0;
+                       colors[k].flags = DoRed | DoGreen | DoBlue;
+                       hsv_to_rgb((int)
+                                  hh,
+                                  (s[i] + (j * ds[i])),
+                                  (v[i] + (j * dv[i])),
+                         &colors[k].red, &colors[k].green, &colors[k].blue);
+#ifdef DEBUG
+                       (void) fprintf(stderr, "point %d+%d: %.2f %.2f %.2f  %04X %04X %04X\n",
+                               i, j,
+                               hh,
+                               (s[i] + (j * ds[i])),
+                               (v[i] + (j * dv[i])),
+                            colors[k].red, colors[k].green, colors[k].blue);
+#endif /* DEBUG */
+               }
+       }
+
+       /* Floating-point round-off can make us decide to use fewer colors. */
+       if (k < *ncolorsP) {
+               *ncolorsP = k;
+               if (k <= 0)
+                       return;
+       }
+       if (!allocate_p)
+               return;
+
+       if (writable_p) {
+               unsigned long *pixels = (unsigned long *)
+               malloc(sizeof (unsigned long) * ((*ncolorsP) + 1));
+
+               /* allocate_writable_colors() won't do here, because we need exactly this
+                  number of cells, or the color sequence we've chosen won't fit. */
+               if (!XAllocColorCells(dpy, cmap, False, 0, 0, pixels, *ncolorsP)) {
+                       (void) free((void *) pixels);
+                       goto FAIL;
+               }
+               for (i = 0; i < *ncolorsP; i++)
+                       colors[i].pixel = pixels[i];
+               (void) free((void *) pixels);
+
+               XStoreColors(dpy, cmap, colors, *ncolorsP);
+       } else {
+               for (i = 0; i < *ncolorsP; i++) {
+                       XColor      color;
+
+                       color = colors[i];
+                       if (XAllocColor(dpy, cmap, &color)) {
+                               colors[i].pixel = color.pixel;
+                       } else {
+                               free_colors(dpy, cmap, colors, i);
+                               goto FAIL;
+                       }
+               }
+       }
+
+       return;
+
+      FAIL:
+       /* we weren't able to allocate all the colors we wanted;
+          decrease the requested number and try again.
+        */
+       total_ncolors = (total_ncolors > 170 ? total_ncolors - 20 :
+                        total_ncolors > 100 ? total_ncolors - 10 :
+                        total_ncolors > 75 ? total_ncolors - 5 :
+                        total_ncolors > 25 ? total_ncolors - 3 :
+                        total_ncolors > 10 ? total_ncolors - 2 :
+                        total_ncolors > 2 ? total_ncolors - 1 :
+                        0);
+       *ncolorsP = total_ncolors;
+       if (total_ncolors > 0)
+               goto AGAIN;
+}
+
+
+void
+make_color_loop(Display * dpy, Colormap cmap,
+               int h0, double s0, double v0,   /* 0-360, 0-1.0, 0-1.0 */
+               int h1, double s1, double v1,   /* 0-360, 0-1.0, 0-1.0 */
+               int h2, double s2, double v2,   /* 0-360, 0-1.0, 0-1.0 */
+               XColor * colors, int *ncolorsP,
+               Bool allocate_p,
+               Bool writable_p)
+{
+       int         h[3];
+       double      s[3], v[3];
+
+       h[0] = h0;
+       h[1] = h1;
+       h[2] = h2;
+       s[0] = s0;
+       s[1] = s1;
+       s[2] = s2;
+       v[0] = v0;
+       v[1] = v1;
+       v[2] = v2;
+       make_color_path(dpy, cmap,
+                       3, h, s, v,
+                       colors, ncolorsP,
+                       allocate_p, writable_p);
+}
+
+
+static void
+complain(int wanted_colors, int got_colors,
+        Bool wanted_writable, Bool got_writable)
+{
+       if (wanted_writable && !got_writable)
+               (void) fprintf(stderr,
+                "%s: wanted %d writable colors; got %d read-only colors.\n",
+                       ProgramName, wanted_colors, got_colors);
+
+       else if (wanted_colors > (got_colors + 10))
+               /* don't bother complaining if we're within ten pixels. */
+               (void) fprintf(stderr, "%s: wanted %d%s colors; got %d.\n",
+                 ProgramName, wanted_colors, (got_writable ? " writable" : ""),
+                       got_colors);
+}
+
+
+void
+make_smooth_colormap(ModeInfo * mi, Colormap cmap,
+                    XColor * colors, int *ncolorsP,
+                    Bool allocate_p,
+                    Bool * writable_pP)
+{
+       int         npoints;
+       int         ncolors = *ncolorsP;
+       Bool        wanted_writable = (allocate_p && writable_pP && *writable_pP);
+       int         i;
+       int         h[MAXPOINTS];
+       double      s[MAXPOINTS];
+       double      v[MAXPOINTS];
+       double      total_s = 0;
+       double      total_v = 0;
+
+       if (*ncolorsP <= 0)
+               return;
+
+       {
+               int         n = (int) (LRAND() % 20);
+
+               if (n <= 5)
+                       npoints = 2;    /* 30% of the time */
+               else if (n <= 15)
+                       npoints = 3;    /* 50% of the time */
+               else if (n <= 18)
+                       npoints = 4;    /* 15% of the time */
+               else
+                       npoints = 5;    /*  5% of the time */
+       }
+
+      REPICK_ALL_COLORS:
+       for (i = 0; i < npoints; i++) {
+             REPICK_THIS_COLOR:
+               h[i] = (int) (LRAND() % 360);
+               s[i] = LRAND() / MAXRAND;
+               v[i] = 0.8 * LRAND() / MAXRAND + 0.2;
+
+               /* Make sure that no two adjascent colors are *too* close together.
+                  If they are, try again.
+                */
+               if (i > 0) {
+                       int         j = (i + 1 == npoints) ? 0 : (i - 1);
+                       double      hi = ((double) h[i]) / 360;
+                       double      hj = ((double) h[j]) / 360;
+                       double      dh = hj - hi;
+                       double      distance;
+
+                       if (dh < 0)
+                               dh = -dh;
+                       if (dh > 0.5)
+                               dh = 0.5 - (dh - 0.5);
+                       distance = sqrt((dh * dh) +
+                                       ((s[j] - s[i]) * (s[j] - s[i])) +
+                                       ((v[j] - v[i]) * (v[j] - v[i])));
+                       if (distance < 0.2)
+                               goto REPICK_THIS_COLOR;
+               }
+               total_s += s[i];
+               total_v += v[i];
+       }
+
+       /* If the average saturation or intensity are too low, repick the colors,
+          so that we don't end up with a black-and-white or too-dark map.
+        */
+       if (total_s / npoints < 0.2)
+               goto REPICK_ALL_COLORS;
+       if (total_v / npoints < 0.3)
+               goto REPICK_ALL_COLORS;
+
+       /* If this visual doesn't support writable cells, don't bother trying.
+        */
+       if (wanted_writable && !has_writable_cells(mi))
+               *writable_pP = False;
+
+      RETRY_NON_WRITABLE:
+       make_color_path(MI_DISPLAY(mi), cmap, npoints, h, s, v, colors, &ncolors,
+                       allocate_p, (writable_pP && *writable_pP));
+
+       /* If we tried for writable cells and got none, try for non-writable. */
+       if (allocate_p && *ncolorsP == 0 && *writable_pP) {
+               *writable_pP = False;
+               goto RETRY_NON_WRITABLE;
+       }
+       if (MI_IS_VERBOSE(mi) || MI_IS_DEBUG(mi))
+               complain(*ncolorsP, ncolors, wanted_writable,
+                        wanted_writable && *writable_pP);
+
+       *ncolorsP = ncolors;
+}
+
+
+void
+make_uniform_colormap(ModeInfo * mi, Colormap cmap,
+                     XColor * colors, int *ncolorsP,
+                     Bool allocate_p,
+                     Bool * writable_pP)
+{
+       int         ncolors = *ncolorsP;
+       Bool        wanted_writable = (allocate_p && writable_pP && *writable_pP);
+
+       double      S = ((double) (LRAND() % 34) + 66) / 100.0;         /* range 66%-100% */
+       double      V = ((double) (LRAND() % 34) + 66) / 100.0;         /* range 66%-100% */
+
+       if (*ncolorsP <= 0)
+               return;
+
+       /* If this visual doesn't support writable cells, don't bother trying. */
+       if (wanted_writable && !has_writable_cells(mi))
+               *writable_pP = False;
+
+      RETRY_NON_WRITABLE:
+       make_color_ramp(MI_DISPLAY(mi), cmap,
+                       0, S, V,
+                       359, S, V,
+                       colors, &ncolors,
+                       False, True, wanted_writable);
+
+       /* If we tried for writable cells and got none, try for non-writable. */
+       if (allocate_p && *ncolorsP == 0 && writable_pP && *writable_pP) {
+               ncolors = *ncolorsP;
+               *writable_pP = False;
+               goto RETRY_NON_WRITABLE;
+       }
+       if (MI_IS_VERBOSE(mi) || MI_IS_DEBUG(mi))
+               complain(*ncolorsP, ncolors, wanted_writable,
+                        wanted_writable && *writable_pP);
+
+       *ncolorsP = ncolors;
+}
+
+
+void
+make_random_colormap(ModeInfo * mi, Colormap cmap,
+                    XColor * colors, int *ncolorsP,
+                    Bool bright_p,
+                    Bool allocate_p,
+                    Bool * writable_pP)
+{
+       Bool        wanted_writable = (allocate_p && writable_pP && *writable_pP);
+       int         ncolors = *ncolorsP;
+       int         i;
+
+       if (*ncolorsP <= 0)
+               return;
+
+       /* If this visual doesn't support writable cells, don't bother trying. */
+       if (wanted_writable && !has_writable_cells(mi))
+               *writable_pP = False;
+
+       for (i = 0; i < ncolors; i++) {
+               colors[i].flags = DoRed | DoGreen | DoBlue;
+               if (bright_p) {
+                       int         H = (int) LRAND() % 360;    /* range 0-360    */
+                       double      S = ((double) (LRAND() % 70) + 30) / 100.0;         /* range 30%-100% */
+                       double      V = ((double) (LRAND() % 34) + 66) / 100.0;         /* range 66%-100% */
+
+                       hsv_to_rgb(H, S, V,
+                         &colors[i].red, &colors[i].green, &colors[i].blue);
+               } else {
+                       colors[i].red = (unsigned short) (LRAND() % 0xFFFF);
+                       colors[i].green = (unsigned short) (LRAND() % 0xFFFF);
+                       colors[i].blue = (unsigned short) (LRAND() % 0xFFFF);
+               }
+       }
+
+       if (!allocate_p)
+               return;
+
+      RETRY_NON_WRITABLE:
+       if (writable_pP && *writable_pP) {
+               unsigned long *pixels = (unsigned long *)
+               malloc(sizeof (unsigned long) * (ncolors + 1));
+
+               allocate_writable_colors(MI_DISPLAY(mi), cmap, pixels, &ncolors);
+               if (ncolors > 0)
+                       for (i = 0; i < ncolors; i++)
+                               colors[i].pixel = pixels[i];
+               (void) free((void *) pixels);
+               if (ncolors > 0)
+                       XStoreColors(MI_DISPLAY(mi), cmap, colors, ncolors);
+       } else {
+               for (i = 0; i < ncolors; i++) {
+                       XColor      color;
+
+                       color = colors[i];
+                       if (!XAllocColor(MI_DISPLAY(mi), cmap, &color))
+                               break;
+                       colors[i].pixel = color.pixel;
+               }
+               ncolors = i;
+       }
+
+       /* If we tried for writable cells and got none, try for non-writable. */
+       if (allocate_p && ncolors == 0 && writable_pP && *writable_pP) {
+               ncolors = *ncolorsP;
+               *writable_pP = False;
+               goto RETRY_NON_WRITABLE;
+       }
+       if (MI_IS_VERBOSE(mi) || MI_IS_DEBUG(mi))
+               complain(*ncolorsP, ncolors, wanted_writable,
+                        wanted_writable && *writable_pP);
+
+       *ncolorsP = ncolors;
+}
+
+
+void
+rotate_colors(Display * dpy, Colormap cmap,
+             XColor * colors, int ncolors, int distance)
+{
+       int         i;
+       XColor     *colors2 = (XColor *) malloc(sizeof (XColor) * ncolors);
+
+       if (ncolors < 2)
+               return;
+       distance = distance % ncolors;
+       for (i = 0; i < ncolors; i++) {
+               int         j = i - distance;
+
+               if (j >= ncolors)
+                       j -= ncolors;
+               if (j < 0)
+                       j += ncolors;
+               colors2[i] = colors[j];
+               colors2[i].pixel = colors[i].pixel;
+       }
+       XStoreColors(dpy, cmap, colors2, ncolors);
+       XFlush(dpy);
+       (void) memcpy((char *) colors, colors2, sizeof (*colors) * ncolors);
+       (void) free((void *) colors2);
+}
+
+/* xscreensaver, Copyright (c) 1992, 1997 Jamie Zawinski <jwz@jwz.org>
+
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+/* This file contains some utility routines for randomly picking the colors
+   to hack the screen with.
+ */
+
+void
+hsv_to_rgb(int h, double s, double v,
+          unsigned short *r, unsigned short *g, unsigned short *b)
+{
+       double      H, S, V, R, G, B;
+       double      p1, p2, p3;
+       double      f;
+       int         i;
+
+       if (s < 0)
+               s = 0;
+       if (v < 0)
+               v = 0;
+       if (s > 1)
+               s = 1;
+       if (v > 1)
+               v = 1;
+
+       S = s;
+       V = v;
+       H = (h % 360) / 60.0;
+       i = (int) H;
+       f = H - i;
+       p1 = V * (1 - S);
+       p2 = V * (1 - (S * f));
+       p3 = V * (1 - (S * (1 - f)));
+       if (i == 0) {
+               R = V;
+               G = p3;
+               B = p1;
+       } else if (i == 1) {
+               R = p2;
+               G = V;
+               B = p1;
+       } else if (i == 2) {
+               R = p1;
+               G = V;
+               B = p3;
+       } else if (i == 3) {
+               R = p1;
+               G = p2;
+               B = V;
+       } else if (i == 4) {
+               R = p3;
+               G = p1;
+               B = V;
+       } else {
+               R = V;
+               G = p1;
+               B = p2;
+       }
+       *r = (short unsigned int) (R * 65535);
+       *g = (short unsigned int) (G * 65535);
+       *b = (short unsigned int) (B * 65535);
+}
+
+void
+rgb_to_hsv(unsigned short r, unsigned short g, unsigned short b,
+          int *h, double *s, double *v)
+{
+       double      R, G, B, H, S, V;
+       double      cmax, cmin;
+       double      cmm;
+       int         imax;
+
+       R = ((double) r) / 65535.0;
+       G = ((double) g) / 65535.0;
+       B = ((double) b) / 65535.0;
+       cmax = R;
+       cmin = G;
+       imax = 1;
+       if (cmax < G) {
+               cmax = G;
+               cmin = R;
+               imax = 2;
+       }
+       if (cmax < B) {
+               cmax = B;
+               imax = 3;
+       }
+       if (cmin > B) {
+               cmin = B;
+       }
+       cmm = cmax - cmin;
+       V = cmax;
+       if (cmm == 0)
+               S = H = 0;
+       else {
+               S = cmm / cmax;
+               if (imax == 1)
+                       H = (G - B) / cmm;
+               else if (imax == 2)
+                       H = 2.0 + (B - R) / cmm;
+               else            /*if (imax == 3) */
+                       H = 4.0 + (R - G) / cmm;
+               if (H < 0)
+                       H += 6.0;
+       }
+       *h = (int) (H * 60.0);
+       *s = S;
+       *v = V;
+}
diff --git a/xlock/color.h b/xlock/color.h
new file mode 100644 (file)
index 0000000..d344231
--- /dev/null
@@ -0,0 +1,232 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)color.h 4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Color stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+extern unsigned long allocPixel(Display * display, Colormap cmap,
+                               const char *name, const char *def);
+
+extern void setColormap(Display * display, Window window, Colormap map,
+                       Bool inwindow);
+extern void fixColormap(ModeInfo * mi, int ncolors, float saturation,
+         Bool mono, Bool install, Bool inroot, Bool inwindow, Bool verbose);
+extern int  preserveColors(unsigned long black, unsigned long white,
+                          unsigned long bg, unsigned long fg);
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+extern void reserveColors(ModeInfo * mi, Colormap cmap,
+                         unsigned long *black);
+
+#endif
+
+/* the rest of this file is a modified version of colors.h, hsv.h and
+ * visual.h from xscreensaver
+ *
+ * xscreensaver, Copyright (c) 1992, 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifndef __COLORS_H__
+#define __COLORS_H__
+
+/* Like XFreeColors, but works on `XColor *' instead of `unsigned long *'
+ */
+extern void free_colors(Display *, Colormap, XColor *, int ncolors);
+
+
+/* Allocates writable, non-contiguous color cells.  The number requested is
+   passed in *ncolorsP, and the number actually allocated is returned there.
+   (Unlike XAllocColorCells(), this will allocate as many as it can, instead
+   of failing if they can't all be allocated.)
+ */
+extern void allocate_writable_colors(Display * dpy, Colormap cmap,
+                                    unsigned long *pixels, int *ncolorsP);
+
+
+/* Generates a sequence of colors evenly spaced between the given pair
+   of HSV coordinates.
+
+   If closed_p is true, the colors will go from the first point to the
+   second then back to the first.
+
+   If allocate_p is true, the colors will be allocated from the map;
+   if enough colors can't be allocated, we will try for less, and the
+   result will be returned to ncolorsP.
+
+   If writable_p is true, writable color cells will be allocated;
+   otherwise, read-only cells will be allocated.
+ */
+extern void make_color_ramp(Display * dpy, Colormap cmap,
+                           int h1, double s1, double v1,
+                           int h2, double s2, double v2,
+                           XColor * colors, int *ncolorsP,
+                           Bool closed_p,
+                           Bool allocate_p,
+                           Bool writable_p);
+
+/* Generates a sequence of colors evenly spaced around the triangle
+   indicated by the thee HSV coordinates.
+
+   If allocate_p is true, the colors will be allocated from the map;
+   if enough colors can't be allocated, we will try for less, and the
+   result will be returned to ncolorsP.
+
+   If writable_p is true, writable color cells will be allocated;
+   otherwise, read-only cells will be allocated.
+ */
+extern void make_color_loop(Display *, Colormap,
+                           int h1, double s1, double v1,
+                           int h2, double s2, double v2,
+                           int h3, double s3, double v3,
+                           XColor * colors, int *ncolorsP,
+                           Bool allocate_p,
+                           Bool writable_p);
+
+
+/* Allocates a hopefully-interesting colormap, which will be a closed loop
+   without any sudden transitions.
+
+   If allocate_p is true, the colors will be allocated from the map;
+   if enough colors can't be allocated, we will try for less, and the
+   result will be returned to ncolorsP.  An error message will be
+   printed on stderr depending on verbose and debug.
+
+   If *writable_pP is true, writable color cells will be allocated;
+   otherwise, read-only cells will be allocated.  If no writable cells
+   cannot be allocated, we will try to allocate unwritable cells
+   instead, and print a message on stderr to that effect.
+ */
+extern void make_smooth_colormap(ModeInfo * mi,
+                                Colormap cmap,
+                                XColor * colors, int *ncolorsP,
+                                Bool allocate_p,
+                                Bool * writable_pP);
+
+/* Allocates a uniform colormap which touches each hue of the spectrum,
+   evenly spaced.  The saturation and intensity are chosen randomly, but
+   will be high enough to be visible.
+
+   If allocate_p is true, the colors will be allocated from the map;
+   if enough colors can't be allocated, we will try for less, and the
+   result will be returned to ncolorsP.  An error message will be
+   printed on stderr depending on verbose and debug.
+
+   If *writable_pP is true, writable color cells will be allocated;
+   otherwise, read-only cells will be allocated.  If no writable cells
+   cannot be allocated, we will try to allocate unwritable cells
+   instead, and print a message on stderr to that effect.
+ */
+extern void make_uniform_colormap(ModeInfo * mi,
+                                 Colormap cmap,
+                                 XColor * colors, int *ncolorsP,
+                                 Bool allocate_p,
+                                 Bool * writable_pP);
+
+/* Allocates a random colormap (the colors are unrelated to one another.)
+   If `bright_p' is false, the colors will be completely random; if it is
+   true, all of the colors will be bright enough to see on a black background.
+
+   If allocate_p is true, the colors will be allocated from the map;
+   if enough colors can't be allocated, we will try for less, and the
+   result will be returned to ncolorsP.  An error message will be
+   printed on stderr depending on verbose and debug.
+
+   If *writable_pP is true, writable color cells will be allocated;
+   otherwise, read-only cells will be allocated.  If no writable cells
+   cannot be allocated, we will try to allocate unwritable cells
+   instead, and print a message on stderr to that effect.
+ */
+extern void make_random_colormap(ModeInfo * mi,
+                                Colormap cmap,
+                                XColor * colors, int *ncolorsP,
+                                Bool bright_p,
+                                Bool allocate_p,
+                                Bool * writable_pP);
+
+
+/* Assuming that the array of colors indicates the current state of a set
+   of writable color cells, this rotates the contents of the array by
+   `distance' steps, moving the colors of cell N to cell (N - distance).
+ */
+extern void rotate_colors(Display *, Colormap,
+                         XColor *, int ncolors, int distance);
+
+#endif /* __COLORS_H__ */
+/* xscreensaver, Copyright (c) 1992, 1997 Jamie Zawinski <jwz@jwz.org>
+
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifndef __HSV_H__
+#define __HSV_H__
+
+/* Converts between RGB and HSV color spaces.
+   R, G, and B are in the range 0 - 65535;
+   H is in the range 0 - 360;
+   S and V are in the range 0.0 - 1.0.
+ */
+extern void hsv_to_rgb(int h, double s, double v,
+                      unsigned short *r,
+                      unsigned short *g,
+                      unsigned short *b);
+extern void rgb_to_hsv(unsigned short r, unsigned short g, unsigned short b,
+                      int *h, double *s, double *v);
+
+#endif /* __HSV_H__ */
+/* xscreensaver, Copyright (c) 1993-1998 by Jamie Zawinski <jwz@jwz.org>
+
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#ifndef __VISUAL_H__
+#define __VISUAL_H__
+
+extern Visual *get_visual(Screen *, const char *name, Bool, Bool);
+extern Visual *get_visual_resource(Screen *, char *, char *, Bool);
+extern int  visual_depth(Screen *, Visual *);
+
+/* extern int visual_pixmap_depth (Screen *, Visual *); */
+extern int  visual_class(Screen *, Visual *);
+extern int  visual_cells(Screen *, Visual *);
+extern int  screen_number(Screen *);
+extern Visual *find_similar_visual(Screen *, Visual * old);
+extern void describe_visual(FILE * f, Screen *, Visual *);
+extern Visual *get_overlay_visual(Screen *, unsigned long *pixel_return);
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern Bool has_writable_cells(ModeInfo * mi);
+#ifdef __cplusplus
+  }
+#endif
+
+#endif /* __VISUAL_H__ */
diff --git a/xlock/erase.c b/xlock/erase.c
new file mode 100644 (file)
index 0000000..7402c40
--- /dev/null
@@ -0,0 +1,701 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)erase.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * erase.c: Erase the screen in various more or less interesting ways.
+ *
+ * (c) 1997 by Johannes Keukelaar <johannes@nada.kth.se>
+ *
+ * Revision History:
+ * 01-Nov-2000: Allocation checks
+ * 17-May-1999: changed timing by Jouk Jansen
+ * 13-Aug-1998: changed to be used with xlockmore by Jouk Jansen
+ *              <joukj@hrem.stm.tudelft.nl>
+ * 1997: original version by Johannes Keukelaar <johannes@nada.kth.se>
+ *
+ * Permission to use in any way granted. Provided "as is" without expressed
+ * or implied warranty. NO WARRANTY, NO EXPRESSION OF SUITABILITY FOR ANY
+ * PURPOSE. (I.e.: Use in any way, but at your own risk!)
+ */
+
+#include "xlock.h"
+
+#undef countof
+#define countof(x) (sizeof(x)/sizeof(*(x)))
+
+extern int  erasedelay, erasemode, erasetime;
+extern int erasemodefromname(char *name);
+
+typedef void (*Eraser) (Display * dpy, Window window, GC gc,
+                       int width, int height, int delay, int granularity);
+
+static void
+no_fade(Display * dpy, Window window, GC gc,
+       int width, int height, int delay, int granularity)
+{
+}
+
+static void
+random_lines(Display * dpy, Window window, GC gc,
+            int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "random_lines"
+       Bool        horiz_p = (Bool) (LRAND() & 1);
+       int         max = (horiz_p ? height : width);
+       int        *lines;
+       int         i;
+       int         actual_delay = delay / max;
+
+#include "erase_init.h"
+
+       if ((lines = (int *) calloc(max, sizeof (int))) == NULL) {
+               XDrawRectangle(dpy, window, gc, 0, 0, width, height);
+               return;
+       }
+       for (i = 0; i < max; i++)
+               lines[i] = i;
+
+       for (i = 0; i < max; i++) {
+               int         t, r;
+
+               t = lines[i];
+               r = NRAND(max);
+               lines[i] = lines[r];
+               lines[r] = t;
+       }
+
+       for (i = 0; i < max; i++) {
+               if (horiz_p)
+                       XDrawLine(dpy, window, gc, 0, lines[i], width,
+                                 lines[i]);
+               else
+                       XDrawLine(dpy, window, gc, lines[i], 0, lines[i],
+                                 height);
+
+               XSync(dpy, False);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+       (void) free((void *) lines);
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+random_squares(Display * dpy, Window window, GC gc,
+              int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "random_squares"
+       int         randsize = MAX(1, MIN(width, height) / (16 + NRAND(32)));
+       int         max = (height / randsize + 1) * (width / randsize + 1);
+       int        *squares;
+       int         i;
+       int         columns = width / randsize + 1;  /* Add an extra for roundoff */
+       int         actual_delay = delay / max;
+
+#include "erase_init.h"
+
+       if ((squares = (int *) calloc(max, sizeof (int))) == NULL) {
+               XDrawRectangle(dpy, window, gc, 0, 0, width, height);
+               return;
+       }
+       for (i = 0; i < max; i++)
+               squares[i] = i;
+
+       for (i = 0; i < max; i++) {
+               int         t, r;
+
+               t = squares[i];
+               r = NRAND(max);
+               squares[i] = squares[r];
+               squares[r] = t;
+       }
+
+       for (i = 0; i < max; i++) {
+               XFillRectangle(dpy, window, gc,
+                              (squares[i] % columns) * randsize,
+                                                (squares[i] / columns) *
+                              randsize, randsize, randsize);
+
+               XSync(dpy, False);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+       (void) free((void *) squares);
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+venetian(Display * dpy, Window window, GC gc,
+        int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "venetian"
+       Bool        horiz_p = (Bool) (LRAND() & 1);
+       Bool        flip_p = (Bool) (LRAND() & 1);
+       int         max = (horiz_p ? height : width);
+       int        *lines;
+       int         i, j;
+       int         actual_delay = delay / max;
+
+#include "erase_init.h"
+
+/*     granularity /= 6;*/
+
+       if ((lines = (int *) calloc(max, sizeof (int))) == NULL) {
+               XDrawRectangle(dpy, window, gc, 0, 0, width, height);
+               return;
+       }
+       j = 0;
+       for (i = 0; i < max * 2; i++) {
+               int         line = ((i / 16) * 16) - ((i % 16) * 15);
+
+               if (line >= 0 && line < max)
+                       lines[j++] = (flip_p ? max - line : line);
+       }
+
+       for (i = 0; i < max; i++) {
+               if (horiz_p)
+                       XDrawLine(dpy, window, gc, 0, lines[i], width,
+                                 lines[i]);
+               else
+                       XDrawLine(dpy, window, gc, lines[i], 0, lines[i],
+                                 height);
+
+               XSync(dpy, False);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+       (void) free((void *) lines);
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+triple_wipe(Display * dpy, Window window, GC gc,
+           int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "triple_wipe"
+       Bool        flip_x = (Bool) (LRAND() & 1);
+       Bool        flip_y = (Bool) (LRAND() & 1);
+       int         max = width + (height / 2);
+       int        *lines;
+       int         i;
+       int         actual_delay = delay / max;
+
+#include "erase_init.h"
+
+       if ((lines = (int *) calloc(max, sizeof (int))) == NULL) {
+               XDrawRectangle(dpy, window, gc, 0, 0, width, height);
+               return;
+       }
+       for (i = 0; i < width / 2; i++)
+               lines[i] = i * 2 + height;
+       for (i = 0; i < height / 2; i++)
+               lines[i + width / 2] = i * 2;
+       for (i = 0; i < width / 2; i++)
+               lines[i + width / 2 + height / 2] = width - i * 2 - (width % 2 ?
+0 : 1) + height;
+
+/*     granularity /= 6;*/
+
+       for (i = 0; i < max; i++) {
+               int         x, y, x2, y2;
+
+               if (lines[i] < height)
+                       x = 0, y = lines[i], x2 = width, y2 = y;
+               else
+                       x = lines[i] - height, y = 0, x2 = x, y2 = height;
+
+               if (flip_x)
+                       x = width - x - 1, x2 = width - x2 - 1;
+               if (flip_y)
+                       y = height - y - 1, y2 = height - y2 - 1;
+
+               XDrawLine(dpy, window, gc, x, y, x2, y2);
+               XSync(dpy, False);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+       (void) free((void *) lines);
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+quad_wipe(Display * dpy, Window window, GC gc,
+         int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "quad_wipe"
+       Bool        flip_x = (Bool) (LRAND() & 1);
+       Bool        flip_y = (Bool) (LRAND() & 1);
+       int         max = width + height;
+       int        *lines;
+       int         i;
+       int         actual_delay = delay / max;
+
+#include "erase_init.h"
+
+       if ((lines = (int *) calloc(max, sizeof (int))) == NULL) {
+               XDrawRectangle(dpy, window, gc, 0, 0, width, height);
+               return;
+       }
+/*     granularity /= 3;*/
+
+       for (i = 0; i < max / 4; i++) {
+               lines[i * 4] = i * 2;
+               lines[i * 4 + 1] = height - i * 2 - (height % 2 ? 0 : 1);
+               lines[i * 4 + 2] = height + i * 2;
+               lines[i * 4 + 3] = height + width - i * 2 - (width % 2 ? 0 : 1);
+       }
+
+       for (i = 0; i < max; i++) {
+               int         x, y, x2, y2;
+
+               if (lines[i] < height)
+                       x = 0, y = lines[i], x2 = width, y2 = y;
+               else
+                       x = lines[i] - height, y = 0, x2 = x, y2 = height;
+
+               if (flip_x)
+                       x = width - x, x2 = width - x2;
+               if (flip_y)
+                       y = height - y, y2 = height - y2;
+
+               XDrawLine(dpy, window, gc, x, y, x2, y2);
+               XSync(dpy, False);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+       (void) free((void *) lines);
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+circle_wipe(Display * dpy, Window window, GC gc,
+           int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "circle_wipe"
+       int         full = 360 * 64;
+       int         inc = 360;
+       int         start = NRAND(full);
+       int         rad = (width > height ? width : height);
+       int         i;
+       int         actual_delay = delay * inc / full;
+
+#include "erase_init.h"
+
+       if (LRAND() & 1)
+               inc = -inc;
+       for (i = (inc > 0 ? 0 : full);
+            (inc > 0 ? i < full : i > 0);
+            i += inc) {
+               XFillArc(dpy, window, gc,
+                    (width / 2) - rad, (height / 2) - rad, rad * 2, rad * 2,
+                        (i + start) % full, inc);
+               XFlush(dpy);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+three_circle_wipe(Display * dpy, Window window, GC gc,
+                 int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "three_circle_wipe"
+       int         i;
+       int         full = 360 * 64;
+       int         q = full / 6;
+       int         q2 = q * 2;
+       int         inc = full / 240;
+       int         start = NRAND(q);
+       int         rad = (width > height ? width : height);
+       int         actual_delay = delay * inc / q;
+
+#include "erase_init.h"
+
+       for (i = 0; i < q; i += inc) {
+               XFillArc(dpy, window, gc, (width / 2) - rad, (height / 2) - rad,
+rad * 2, rad * 2,
+                        (start + i) % full, inc);
+               XFillArc(dpy, window, gc, (width / 2) - rad, (height / 2) - rad,
+rad * 2, rad * 2,
+                        (start - i) % full, -inc);
+
+               XFillArc(dpy, window, gc, (width / 2) - rad, (height / 2) - rad,
+rad * 2, rad * 2,
+                        (start + q2 + i) % full, inc);
+               XFillArc(dpy, window, gc, (width / 2) - rad, (height / 2) - rad,
+rad * 2, rad * 2,
+                        (start + q2 - i) % full, -inc);
+
+               XFillArc(dpy, window, gc, (width / 2) - rad, (height / 2) - rad,
+rad * 2, rad * 2,
+                        (start + q2 + q2 + i) % full, inc);
+               XFillArc(dpy, window, gc, (width / 2) - rad, (height / 2) - rad,
+rad * 2, rad * 2,
+                        (start + q2 + q2 - i) % full, -inc);
+
+               XSync(dpy, False);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+squaretate(Display * dpy, Window window, GC gc,
+          int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "squaretate"
+#ifdef FAST_CPU
+       int         steps = (((width > height ? width : height) * 2) /
+granularity);
+
+#else
+       int         steps = (((width > height ? width : height)) / (8 *
+granularity));
+
+#endif
+       int         i;
+       Bool        flip = (Bool) (LRAND() & 1);
+       int         actual_delay = delay / steps;
+
+#include "erase_init.h"
+
+#define DRAW() \
+      if (flip) { \
+       points[0].x = width-points[0].x; \
+       points[1].x = width-points[1].x; \
+        points[2].x = width-points[2].x; } \
+      XFillPolygon (dpy, window, gc, points, 3, Convex, CoordModeOrigin)
+
+       for (i = 0; i < steps; i++) {
+               XPoint      points[3];
+
+               points[0].x = 0;
+               points[0].y = 0;
+               points[1].x = width;
+               points[1].y = 0;
+               points[2].x = 0;
+               points[2].y = points[0].y + ((i * height) / steps);
+               DRAW();
+
+               points[0].x = 0;
+               points[0].y = 0;
+               points[1].x = 0;
+               points[1].y = height;
+               points[2].x = ((i * width) / steps);
+               points[2].y = height;
+               DRAW();
+
+               points[0].x = width;
+               points[0].y = height;
+               points[1].x = 0;
+               points[1].y = height;
+               points[2].x = width;
+               points[2].y = height - ((i * height) / steps);
+               DRAW();
+
+               points[0].x = width;
+               points[0].y = height;
+               points[1].x = width;
+               points[1].y = 0;
+               points[2].x = width - ((i * width) / steps);
+               points[2].y = 0;
+               DRAW();
+
+               XSync(dpy, True);
+
+#define LOOPVAR i
+#include "erase.h"
+#undef LOOPVAR
+
+       }
+#undef DRAW
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static void
+fizzle (Display *dpy, Window window, GC gc,
+           int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "fizzle"
+  /* These dimensions must be prime numbers.  They should be roughly the
+     square root of the width and height. */
+# define BX 31
+# define BY 31
+# define SIZE (BX*BY)
+
+       int array[SIZE];
+       int i, j;
+       XPoint *skews;
+       int nx, ny;
+       int actual_delay = delay / SIZE;
+
+#include "erase_init.h"
+
+       /* Distribute the numbers [0,SIZE) randomly in the array */
+       {
+               int indices[SIZE];
+
+               for (i = 0; i < SIZE; i++) {
+                       array[i] = -1;
+                       indices[i] = i;
+               }
+
+               for (i = 0; i < SIZE; i++) {
+                       j = (int) (LRAND() % (SIZE - i));
+                       array[indices[j]] = i;
+                       indices[j] = indices[SIZE - i - 1];
+               }
+       }
+
+       /* nx, ny are the number of cells across and down, rounded up */
+       nx = width  / BX + (0 == (width % BX) ? 0 : 1);
+       ny = height / BY + (0 == (height % BY) ? 0 : 1);
+       if ((skews = (XPoint *) malloc(nx * ny * sizeof (XPoint))) == NULL) {
+               XDrawRectangle(dpy, window, gc, 0, 0, width, height);
+               return;
+       }
+       for (i = 0; i < nx; i++) {
+               for (j = 0; j < ny; j++) {
+                       skews[j * nx + i].x = (short) (LRAND() % BX);
+                       skews[j * nx + i].y = (short) (LRAND() % BY);
+               }
+       }
+
+# define SKEWX(cx, cy) (skews[cy*nx + cx].x)
+# define SKEWY(cx, cy) (skews[cy*nx + cx].y)
+
+       for (i = 0; i < SIZE; i++) {
+               int x = array[i] % BX;
+               int y = array[i] / BX;
+               int iy, cy;
+
+               for (iy = 0, cy = 0; iy < height; iy += BY, cy++) {
+                       int ix, cx;
+
+                       for (ix = 0, cx = 0; ix < width; ix += BX, cx++) {
+                               int xx = ix + (SKEWX(cx, cy) + x*((cx%(BX-1))+1))%BX;
+                               int yy = iy + (SKEWY(cx, cy) + y*((cy%(BY-1))+1))%BY;
+
+                               XDrawPoint(dpy, window, gc, xx, yy);
+                       }
+               }
+
+               if ((BX-1) == (i%BX)) {
+                       XSync (dpy, False);
+               }
+
+#define LOOPVAR i
+# include "erase.h"
+#undef LOOPVAR
+       }
+
+# undef SKEWX
+# undef SKEWY
+
+       (void) free((void *) skews);
+
+# undef BX
+# undef BY
+# undef SIZE
+#include "erase_debug.h"
+}
+
+/* from Rick Campbell <rick@campbellcentral.org> */
+#undef ERASEMODE
+static void
+spiral (Display *display, Window window, GC context,
+        int width, int height, int delay, int granularity)
+{
+#define ERASEMODE "spiral"
+# define SPIRAL_ERASE_PI_2 (M_PI + M_PI)
+# define SPIRAL_ERASE_LOOP_COUNT (100)
+# define SPIRAL_ERASE_ARC_COUNT (360.0)
+# define SPIRAL_ERASE_ANGLE_INCREMENT (SPIRAL_ERASE_PI_2 /     \
+SPIRAL_ERASE_ARC_COUNT)
+# define SPIRAL_ERASE_DELAY (0)
+
+       double angle;
+       int arc_limit;
+       int arc_max_limit;
+       int length_step;
+       XPoint points [3];
+       int actual_delay;
+
+#include "erase_init.h"
+
+  angle = 0.0;
+  arc_max_limit = (int) (ceil (sqrt((double) (width * width) + (height * height)))
+                         / 2.0);
+  length_step = ((arc_max_limit + SPIRAL_ERASE_LOOP_COUNT - 1) /
+                 SPIRAL_ERASE_LOOP_COUNT);
+  arc_max_limit += length_step;
+  points [0].x = width / 2;
+  points [0].y = height / 2;
+  points [1].x = points [0].x + length_step;
+  points [1].y = points [0].y;
+  points [2].x = points [1].x;
+  points [2].y = points [1].y;
+
+       actual_delay = delay * length_step / arc_max_limit;
+
+  for (arc_limit = length_step;
+       arc_limit < arc_max_limit;
+       arc_limit += length_step)
+    {
+      int arc_length = length_step;
+      int length_base = arc_limit;
+      for (angle = 0.0; angle < SPIRAL_ERASE_PI_2;
+           angle += SPIRAL_ERASE_ANGLE_INCREMENT)
+        {
+          arc_length = length_base + (int) ((length_step * angle) /
+                                      SPIRAL_ERASE_PI_2);
+          points [1].x = points [2].x;
+          points [1].y = points [2].y;
+          points [2].x = points [0].x + (int)(cos (angle) * arc_length);
+          points [2].y = points [0].y + (int)(sin (angle) * arc_length);
+          XFillPolygon (display, window, context, points, 3, Convex,
+                        CoordModeOrigin);
+        }
+
+#define LOOPVAR arc_limit
+#include "erase.h"
+#undef LOOPVAR
+
+#if (SPIRAL_ERASE_DELAY != 0)
+          (void) usleep (SPIRAL_ERASE_DELAY);
+# endif /* (SPIRAL_ERASE_DELAY != 0) */
+    }
+# undef SPIRAL_ERASE_DELAY
+# undef SPIRAL_ERASE_ANGLE_INCREMENT
+# undef SPIRAL_ERASE_ARC_COUNT
+# undef SPIRAL_ERASE_LOOP_COUNT
+# undef SPIRAL_ERASE_PI_2
+#include "erase_debug.h"
+}
+#undef ERASEMODE
+
+static struct eraser_names {
+       Eraser      mode;
+       char       *name;
+} erasers[] = {
+
+       {
+               random_lines, (char *) "random_lines"
+       },
+       {
+               random_squares, (char *) "random_squares"
+       },
+       {
+               venetian, (char *) "venetian"
+       },
+       {
+               triple_wipe, (char *) "triple_wipe"
+       },
+       {
+               quad_wipe, (char *) "quad_wipe"
+       },
+       {
+               circle_wipe, (char *) "circle_wipe"
+       },
+       {
+               three_circle_wipe, (char *) "three_circle_wipe"
+       },
+       {
+               squaretate, (char *) "squaretate"
+       },
+       {
+               fizzle , (char *) "fizzle"
+       },
+       {
+               spiral , (char *) "spiral"
+       },
+       {
+               no_fade, (char *) "no_fade"
+       }
+};
+
+
+static void
+erase_window(ModeInfo * mi, GC erase_gc, unsigned long pixel, int mode,
+            int delay)
+{
+       int         granularity = 1;
+
+       XSetForeground(MI_DISPLAY(mi), erase_gc, pixel);
+       if (MI_IS_DRAWN(mi) && delay > 0) {
+               if (mode < 0 || mode >= (int) countof(erasers))
+                       mode = NRAND(countof(erasers));
+               (*(erasers[mode].mode)) (MI_DISPLAY(mi), MI_WINDOW(mi),
+                                      erase_gc, MI_WIDTH(mi), MI_HEIGHT(mi),
+                                        delay, granularity);
+               MI_IS_DRAWN(mi) = False;
+       }
+       XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), erase_gc, 0, 0,
+                 (unsigned int) MI_WIDTH(mi), (unsigned int) MI_HEIGHT(mi));
+}
+
+void
+erase_full_window(ModeInfo * mi, GC erase_gc, unsigned long pixel)
+{
+       erase_window(mi, erase_gc, pixel, erasemode, erasedelay);
+}
+
+int
+erasemodefromname(char *name)
+{
+       int         a;
+       char       *s1, *s2;
+       int         eraseMode = -1;
+
+       for (a = 0; a < (int) countof(erasers); a++) {
+               for (s1 = erasers[a].name, s2 = name; *s1 && *s2; s1++, s2++)
+                       if ((isupper((int) *s1) ? tolower((int) *s1) : *s1) !=
+                           (isupper((int) *s2) ? tolower((int) *s2) : *s2))
+                               break;
+
+               if ((*s1 == '\0') || (*s2 == '\0')) {
+
+                       if (eraseMode != -1) {
+                               (void) fprintf(stderr,
+                                              "%s does not uniquely describe an erase mode (set to random)\n"
+                                              ,name);
+                               return (-1);
+                       }
+                       eraseMode = a;
+               }
+       }
+       return (eraseMode);
+}
diff --git a/xlock/erase.h b/xlock/erase.h
new file mode 100644 (file)
index 0000000..b4abaa6
--- /dev/null
@@ -0,0 +1,35 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)erase.h    4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Erase stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+#if HAVE_GETTIMEOFDAY
+               GETTIMEOFDAY(&tp);
+               if (tp.tv_sec - t0 >= erasetime ) {
+                       break;
+               }
+#endif
+               if (actual_delay > 0 && ((LOOPVAR % granularity) == 0))
+#if HAVE_GETTIMEOFDAY
+               {
+                       interval = (int) (tp.tv_usec - t_prev +
+                               1000000 * ( tp.tv_sec - t1_prev ));
+                       interval = actual_delay * granularity - interval;
+                       if (interval > 0)
+                               (void) usleep(interval);
+                       GETTIMEOFDAY(&tp);
+                       t_prev = (int) (tp.tv_usec);
+                       t1_prev = (int) (tp.tv_sec);
+               }
+#else
+                       (void) usleep( actual_delay * granularity );
+#endif
diff --git a/xlock/erase_debug.h b/xlock/erase_debug.h
new file mode 100644 (file)
index 0000000..ea89f4f
--- /dev/null
@@ -0,0 +1,19 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)erase_debug.h      4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Erase Debug stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+#if HAVE_GETTIMEOFDAY && defined( DEBUG )
+   GETTIMEOFDAY(&tp);
+   t_prev = (int) (tp.tv_sec * 1000 + tp.tv_usec / 1000);
+   (void) printf( "Elapsed time in %s : %d\n" , ERASEMODE , t_prev - t_0 );
+#endif
diff --git a/xlock/erase_init.h b/xlock/erase_init.h
new file mode 100644 (file)
index 0000000..95fa37e
--- /dev/null
@@ -0,0 +1,30 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)erase_init.h       4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Erase Initialize stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+#if HAVE_GETTIMEOFDAY
+       struct timeval tp;
+       int         interval, t_prev, t1_prev, t0;
+#ifdef DEBUG
+       int t_0;
+#endif
+
+       GETTIMEOFDAY(&tp);
+       t_prev = (int) (tp.tv_usec);
+       t1_prev = (int) (tp.tv_sec);
+        t0 = (int) (tp.tv_sec);
+
+#ifdef DEBUG
+       t_0 = (int) (tp.tv_sec * 1000 + tp.tv_usec / 1000);
+#endif
+#endif
diff --git a/xlock/iostuff.c b/xlock/iostuff.c
new file mode 100644 (file)
index 0000000..5430b85
--- /dev/null
@@ -0,0 +1,936 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)iostuff.c    4.10 98/10/23 xlockmore";
+
+#endif
+
+/*-
+ * iostuff.c - various file utilities for images, text, fonts
+ *
+ * Copyright (c) 1998 by David Bagley
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 23-Apr-98: Separated out of util.c
+ *
+ */
+#ifdef USE_MAGICK
+# include "magick.h"
+#endif
+
+#ifdef STANDALONE
+#include "utils.h"
+extern char *message, *messagefile, *messagesfile, *program;
+extern char *messagefontname;
+
+#else
+#include "xlock.h"
+#include "vis.h"
+#include "color.h"
+char       *message, *messagefile, *messagesfile, *program;
+char       *messagefontname;
+
+#endif
+#include "mode.h"
+#include "iostuff.h"
+#include "random.h"
+
+#include <X11/Xutil.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
+static int
+readable(char *filename)
+{
+       FILE       *fp;
+
+       if ((fp = my_fopen(filename, "r")) == NULL)
+               return False;
+       (void) fclose(fp);
+       return True;
+}
+
+FILE       *
+my_fopen(char *filename, const char *type)
+{
+       FILE       *fp = NULL;
+       int         s;
+       struct stat fileStat;
+
+       s = stat(filename, &fileStat);
+       if ((s >= 0 && S_ISREG(fileStat.st_mode)) || (s < 0 && type[0] == 'w')) {
+               if ((fp = fopen(filename, type)) == NULL)
+                       return NULL;
+       } else {
+               return NULL;
+       }
+
+       return fp;
+}
+
+#if HAVE_DIRENT_H
+static void
+randomFileFromList(char *directory,
+                  struct dirent **filelist, int numfiles, char *file_local)
+{
+       int         num;
+
+       num = NRAND(numfiles);
+       if (strlen(directory) + strlen(filelist[num]->d_name) + 1 < 256) {
+               (void) sprintf(file_local, "%s%s",
+                              directory, filelist[num]->d_name);
+       }
+}
+
+#endif
+
+#if HAVE_DIRENT_H
+
+extern Bool debug;
+
+/* index_dir emulation of FORTRAN's index in C. Author: J. Jansen */
+int
+index_dir(char *str1, char *substr)
+{
+       int         i, num, l1 = strlen(str1), ls = strlen(substr), found;
+       char       *str1_tmp, *substr_tmp, *substr_last;
+
+       num = l1 - ls + 1;
+       substr_last = substr + ls;
+       for (i = 0; i < num; ++i) {
+               str1_tmp = str1 + i;
+               substr_tmp = substr;
+               found = 1;
+               while (substr_tmp < substr_last)
+                       if (*str1_tmp++ != *substr_tmp++) {
+                               found = 0;
+                               break;
+                       }
+               if (found)
+                       return (i + 1);
+       }
+       return (0);
+}
+
+#ifdef VMS
+/* Upcase string  Author: J. Jansen */
+static void
+upcase(char *s)
+{
+       int         i;
+
+       for (i = 0; s[i] != '\0'; i++) {
+               if (s[i] >= 'a' && s[i] <= 'z') {
+                       s[i] = (char) (s[i] - 32);
+               }
+       }
+}
+
+#endif
+
+/* Split full path into directory and filename parts  Author: J. Jansen */
+void
+get_dir(char *fullpath, char *dir, char *filename)
+{
+       char       *ln;
+       int         ip_temp = 0, ip;
+
+#ifdef VMS
+       ip = index_dir(fullpath, "]");
+#else
+       ln = fullpath;
+       ip = 0;
+       while ((ip_temp = index_dir(ln, (char *) "/"))) {
+               ip = ip + ip_temp;
+               ln = fullpath + ip;
+       }
+#endif
+       if (ip == 0) {
+#ifdef VMS
+               (void) strcpy(dir, "[]");
+#else
+               (void) strcpy(dir, "./");
+#endif
+       } else {
+               if (ip > DIRBUF - 1)
+                       ip_temp = DIRBUF - 1;
+               else
+                       ip_temp = ip;
+               (void) strncpy(dir, fullpath, ip_temp);
+               dir[ip_temp] = '\0';
+       }
+       ln = fullpath + ip;
+       (void) strncpy(filename, ln, MAXNAMLEN - 1);
+       filename[MAXNAMLEN - 1] = '\0';
+#ifdef VMS
+       upcase(filename);       /* VMS knows uppercase filenames only */
+#else
+       {
+               DIR        *dirp;
+
+               /* This finds a directory if there is no final slash */
+               if (filename[0] && (dirp = opendir(fullpath)) != NULL) {
+                       (void) closedir(dirp);
+                       (void) strncpy(dir, fullpath, DIRBUF - 1);
+                       ip = strlen(fullpath);
+                       if (ip < DIRBUF - 2) {
+                               dir[ip] = '/';
+                               dir[ip + 1] = '\0';
+                       }
+                       dir[DIRBUF - 1] = '\0';
+                       filename[0] = '\0';
+               }
+       }
+#endif
+       if (debug)
+               (void) printf("get_dir %s %s %s\n", fullpath, dir, filename);
+}
+
+/* Procedure to select the matching filenames  Author: J. Jansen */
+int
+sel_image(struct dirent *name)
+{
+       extern char filename_r[MAXNAMLEN];
+       char       *name_tmp = name->d_name;
+       char       *filename_tmp = filename_r;
+       int         numfrag = -1;
+#define MAX_FRAGS 64
+#ifdef VMS
+   char *frags[MAX_FRAGS];
+#else
+   static char *frags[MAX_FRAGS];
+#endif
+
+       int         ip, i = -1;
+
+       if (numfrag == -1) {
+               ++numfrag;
+               while ((ip = index_dir(filename_tmp, (char *) "*"))) {
+                       if (numfrag >= MAX_FRAGS) {
+                               numfrag--;
+                               goto FAIL;
+                       }
+                       if ((frags[numfrag] = (char *) malloc(ip)) == NULL) {
+                               numfrag--;
+                               goto FAIL;
+                       }
+                       (void) strcpy(frags[numfrag], "\0");
+                       (void) strncat(frags[numfrag], filename_tmp, ip - 1);
+                       ++numfrag;
+                       filename_tmp = filename_tmp + ip;
+               }
+               if ( strlen( filename_tmp ) != 0 ) {
+                       if (numfrag > 0 && frags[numfrag] != NULL)
+                               (void) free((void *) frags[numfrag]);
+                       if ((frags[numfrag] = (char *) malloc(strlen(filename_tmp) +
+                                       1)) == NULL) {
+                               numfrag--;
+                               goto FAIL;
+                       }
+                       (void) strcpy(frags[numfrag], filename_tmp);
+               } else
+                       numfrag--;
+       }
+       for (i = 0; i <= numfrag; ++i) {
+               ip = index_dir(name_tmp, frags[i]);
+               (void) free((void *) frags[i]);
+               if (ip == 0) {
+                       goto FAIL;
+               }
+               name_tmp = name_tmp + ip;
+       }
+
+       return (1);
+FAIL:
+       {
+               int         j;
+
+               for (j = i + 1; j <= numfrag; ++j)
+                       (void) free((void *) frags[j]);
+               return (0);
+       }
+}
+
+/* scandir implementiation for VMS  Author: J. Jansen */
+/* name changed to scan_dir to solve portablity problems */
+#define _MEMBL_ 64
+int
+scan_dir(const char *directoryname, struct dirent ***namelist,
+        int         (*specify) (struct dirent *),
+        int         (*compare) (const void *, const void *))
+{
+       DIR        *dirp;
+       struct dirent *new_entry, **namelist_tmp;
+       int         size_tmp, num_list_tmp;
+
+       if (debug)
+               (void) printf("scan_dir directoryname %s\n", directoryname);
+       if ((dirp = opendir(directoryname)) == NULL) {
+               if (debug)
+                       (void) printf("scan_dir can not open directoryname %s\n", directoryname);
+               return (-1);
+       }
+       size_tmp = _MEMBL_;
+/*-
+ * PURIFY on SunOS4 and on Solaris 2 reports a cumulative memory leak on
+ * the next line when used with the modes/glx/text3d.cc file. It only
+ * leaks like this for the C++ modes, and is OK in the C modes. */
+       if ((namelist_tmp = (struct dirent **) malloc(size_tmp *
+                       sizeof (struct dirent *))) == NULL) {
+               if (debug)
+                       (void) printf("scan_dir no memory\n");
+               return (-1);
+       }
+       num_list_tmp = 0;
+       while ((new_entry = readdir(dirp)) != NULL) {
+#ifndef VMS
+               if (!strcmp(new_entry->d_name, ".") || !strcmp(new_entry->d_name, ".."))
+                       continue;
+#endif
+               if (specify != NULL && !(*specify) (new_entry))
+                       continue;
+               if (++num_list_tmp >= size_tmp) {
+                       size_tmp = size_tmp + _MEMBL_;
+                       if ((namelist_tmp = (struct dirent **) realloc(
+                                       (void *) namelist_tmp, size_tmp *
+                                       sizeof (struct dirent *))) == NULL) {
+                               if (debug)
+                                       (void) printf("scan_dir no memory\n");
+                               return (-1);
+                       }
+               }
+               if ((namelist_tmp[num_list_tmp - 1] =
+                       (struct dirent *) malloc(sizeof (struct dirent)
+#ifdef SVR4
+                        + strlen(new_entry->d_name)
+#endif
+               )) == NULL)
+                               return (-1);
+
+               (void) strcpy(namelist_tmp[num_list_tmp - 1]->d_name, new_entry->d_name);
+
+               *namelist = namelist_tmp;
+       }
+
+       (void) closedir(dirp);
+       if (num_list_tmp && compare != NULL)
+               (void) qsort((void *) namelist_tmp, num_list_tmp,
+                            sizeof (struct dirent *), compare);
+       if (debug)
+               (void) printf("scan_dir number %d\n", num_list_tmp);
+       *namelist = namelist_tmp;
+       return (num_list_tmp);
+}
+
+#endif
+
+#if HAVE_DIRENT_H
+static void
+getRandomFile(char *randomfile, char *randomfile_local)
+{
+       extern char directory_r[DIRBUF];
+       struct dirent ***images_list = NULL;
+       extern struct dirent **image_list;
+       extern int  num_list;
+       extern char filename_r[MAXNAMLEN];
+
+       get_dir(randomfile, directory_r, filename_r);
+       if (image_list != NULL) {
+               int         i;
+
+               for (i = 0; i < num_list; i++) {
+                       if (image_list[i] != NULL)
+                               (void) free((void *) image_list[i]);
+               }
+               (void) free((void *) image_list);
+               image_list = NULL;
+       }
+       if ((images_list = (struct dirent ***) malloc(sizeof (struct dirent **))) != NULL) {
+               num_list = scan_dir(directory_r, images_list, sel_image, NULL);
+               image_list = *images_list;
+               (void) free((void *) images_list);
+               if (num_list > 0) {
+                       randomFileFromList(directory_r, image_list, num_list,
+                               randomfile_local);
+               } else if (num_list < 0) {
+                       num_list = 0;
+                       image_list = NULL;
+               }
+       } else
+               num_list = 0;
+}
+
+#endif
+
+extern int  XbmReadFileToImage(char *filename,
+                              int *width, int *height, unsigned char **bits);
+
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#if USE_XPMINC
+#include <xpm.h>
+#else
+#include <X11/xpm.h>           /* Normal spot */
+#endif
+#endif
+#ifndef USE_MAGICK
+# include "ras.h"
+#endif
+
+static XImage blogo =
+{
+       0, 0,                   /* width, height */
+       0, XYBitmap, 0,         /* xoffset, format, data */
+       LSBFirst, 8,            /* byte-order, bitmap-unit */
+       LSBFirst, 8, 1          /* bitmap-bit-order, bitmap-pad, depth */
+};
+
+void
+getImage(ModeInfo * mi, XImage ** logo,
+        int default_width, int default_height, unsigned char *default_bits,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+        int default_xpm, char **name,
+#endif
+        int *graphics_format, Colormap * ncm,
+        unsigned long *black)
+{
+       Display    *display = MI_DISPLAY(mi);
+       static char *bitmap_local = NULL;
+
+#ifndef STANDALONE
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       XpmAttributes attrib;
+
+#endif
+#if 0
+       /* This probably works best in most cases but for random mode used
+          with random selection of a file it will fail often. */
+       *ncm = None;
+#else
+       if (!fixedColors(mi))
+               *ncm = XCreateColormap(display, MI_WINDOW(mi), MI_VISUAL(mi), AllocNone);
+       else
+               *ncm = None;
+#endif
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       attrib.visual = MI_VISUAL(mi);
+       if (*ncm == None) {
+               attrib.colormap = MI_COLORMAP(mi);
+       } else {
+               attrib.colormap = *ncm;
+       }
+       attrib.depth = MI_DEPTH(mi);
+       attrib.valuemask = XpmVisual | XpmColormap | XpmDepth;
+#endif
+#endif /* !STANDALONE */
+       *graphics_format = 0;
+
+       if (bitmap_local != NULL) {
+               (void) free((void *) bitmap_local);
+               bitmap_local = NULL;
+       }
+       if (MI_BITMAP(mi) && strlen(MI_BITMAP(mi))) {
+#ifdef STANDALONE
+               bitmap_local = MI_BITMAP(mi);
+#else
+               if ((bitmap_local = (char *) malloc(256)) == NULL) {
+                       (void) fprintf(stderr , "no memory for \"%s\"\n" ,
+                               MI_BITMAP(mi));
+                       return;
+               }
+               (void) strncpy(bitmap_local, MI_BITMAP(mi), 256);
+#if HAVE_DIRENT_H
+               getRandomFile(MI_BITMAP(mi), bitmap_local);
+#endif
+#endif /* STANDALONE */
+       }
+       if (bitmap_local && strlen(bitmap_local)) {
+#if defined( USE_MAGICK ) && !defined( STANDALONE )
+          if ( readable( bitmap_local ) )
+            {
+               if ( MI_NPIXELS( mi ) > 2 )
+                 {
+                    if ( MagickSuccess == MagickFileToImage( mi ,
+                                                            bitmap_local ,
+                                                            logo) )
+                      {
+                         *graphics_format = IS_MAGICKFILE;
+                         if ( !fixedColors( mi ) )
+                           SetImageColors( display , *ncm );
+                         *black = GetColor(mi, MI_BLACK_PIXEL(mi));
+                         (void) GetColor(mi, MI_WHITE_PIXEL(mi));
+                         (void) GetColor(mi, MI_BG_PIXEL(mi));
+                         (void) GetColor(mi, MI_FG_PIXEL(mi));
+                      }
+                 }
+            }
+          else
+            {
+               (void) fprintf(stderr , "could not read file \"%s\"\n" ,
+                       bitmap_local);
+            }
+#else
+# ifndef STANDALONE
+               if (readable(bitmap_local)) {
+                       if (MI_NPIXELS(mi) > 2) {
+                               if (RasterSuccess == RasterFileToImage(mi, bitmap_local, logo)) {
+                                       *graphics_format = IS_RASTERFILE;
+                                       if (!fixedColors(mi))
+                                               SetImageColors(display, *ncm);
+                                       *black = GetColor(mi, MI_BLACK_PIXEL(mi));
+                                       (void) GetColor(mi, MI_WHITE_PIXEL(mi));
+                                       (void) GetColor(mi, MI_BG_PIXEL(mi));
+                                       (void) GetColor(mi, MI_FG_PIXEL(mi));
+                               }
+                       }
+               } else {
+                       (void) fprintf(stderr,
+                              "could not read file \"%s\"\n", bitmap_local);
+               }
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#ifndef USE_MONOXPM
+               if (MI_NPIXELS(mi) > 2)
+#endif
+               {
+                       if (*graphics_format <= 0) {
+                               if (*ncm != None)
+                                       reserveColors(mi, *ncm, black);
+                               if (XpmSuccess == XpmReadFileToImage(display,
+                                     bitmap_local, logo,
+                                     (XImage **) NULL, &attrib))
+                                       *graphics_format = IS_XPMFILE;
+                       }
+               }
+#endif
+#endif /* !STANDALONE */
+               if (*graphics_format <= 0) {
+                       if (!blogo.data) {
+                               if (BitmapSuccess == XbmReadFileToImage(bitmap_local,
+                                                &blogo.width, &blogo.height,
+                                          (unsigned char **) &blogo.data)) {
+                                       blogo.bytes_per_line = (blogo.width + 7) / 8;
+                                       *graphics_format = IS_XBMFILE;
+                                       *logo = &blogo;
+                               }
+                       } else {
+                               *graphics_format = IS_XBMDONE;
+                               *logo = &blogo;
+                       }
+               }
+#endif
+          if (*graphics_format <= 0 && MI_IS_VERBOSE(mi))
+                       (void) fprintf(stderr,
+                                      "\"%s\" is in an unrecognized format or not compatible with screen\n",
+                                      bitmap_local);
+       }
+#ifndef STANDALONE
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       if (*graphics_format <= 0 &&
+           ((MI_IS_FULLRANDOM(mi)) ? LRAND() & 1: default_xpm))
+#ifndef USE_MONOXPM
+               if (MI_NPIXELS(mi) > 2)
+#endif
+                       if (XpmSuccess == XpmCreateImageFromData(display, name,
+                                           logo, (XImage **) NULL, &attrib))
+                               *graphics_format = IS_XPM;
+#endif
+#endif /* STANDALONE */
+       if (*graphics_format <= 0) {
+               if (!blogo.data) {
+                       blogo.data = (char *) default_bits;
+                       blogo.width = default_width;
+                       blogo.height = default_height;
+                       blogo.bytes_per_line = (blogo.width + 7) / 8;
+                       *graphics_format = IS_XBM;
+               } else
+                       *graphics_format = IS_XBMDONE;
+               *logo = &blogo;
+       }
+#ifndef STANDALONE             /* Come back later */
+       if (*ncm != None && *graphics_format != IS_RASTERFILE &&
+           *graphics_format != IS_XPMFILE && *graphics_format != IS_XPM &&
+           *graphics_format != IS_MAGICKFILE) {
+               XFreeColormap(display, *ncm);
+               *ncm = None;
+       }
+#endif /* STANDALONE */ /* Come back later */
+}
+
+void
+destroyImage(XImage ** logo, int *graphics_format)
+{
+       switch (*graphics_format) {
+               case IS_XBM:
+                       blogo.data = NULL;
+                       break;
+               case IS_XBMFILE:
+                       if (blogo.data) {
+                               (void) free((void *) blogo.data);
+                               blogo.data = NULL;
+                       }
+                       break;
+               case IS_XPM:
+               case IS_XPMFILE:
+               case IS_RASTERFILE:
+               case IS_MAGICKFILE:
+                       if (logo && *logo)
+                               (void) XDestroyImage(*logo);
+                       break;
+       }
+       *graphics_format = -1;
+       *logo = NULL;
+}
+
+void
+pickPixmap(Display * display, Drawable drawable, char *name,
+          int default_width, int default_height, unsigned char *default_bits,
+          int *width, int *height, Pixmap * pixmap,
+          int *graphics_format)
+{
+       int         x_hot, y_hot;       /* dummy */
+
+       if (name && *name) {
+               if (readable(name)) {
+                       if (BitmapSuccess == XReadBitmapFile(display, drawable, name,
+                            (unsigned int *) width, (unsigned int *) height,
+                                                  pixmap, &x_hot, &y_hot)) {
+                               *graphics_format = IS_XBMFILE;
+                       }
+                       if (*graphics_format <= 0)
+                               (void) fprintf(stderr,
+                                           "\"%s\" not xbm format\n", name);
+               } else {
+                       (void) fprintf(stderr,
+                                      "could not read file \"%s\"\n", name);
+               }
+       }
+       if (*graphics_format <= 0) {
+               *width = default_width;
+               *height = default_height;
+               *graphics_format = IS_XBM;
+               *pixmap = XCreateBitmapFromData(display, drawable,
+                                    (char *) default_bits, *width, *height);
+       }
+}
+
+void
+getPixmap(ModeInfo * mi, Drawable drawable,
+         int default_width, int default_height, unsigned char *default_bits,
+         int *width, int *height, Pixmap * pixmap,
+         int *graphics_format)
+{
+       Display    *display = MI_DISPLAY(mi);
+       static char *bitmap_local = NULL;
+
+       if (bitmap_local) {
+               (void) free((void *) bitmap_local);
+               bitmap_local = NULL;
+       }
+       if (MI_BITMAP(mi) && strlen(MI_BITMAP(mi))) {
+#ifdef STANDALONE
+               bitmap_local = MI_BITMAP(mi);
+#else
+               if ((bitmap_local = (char *) malloc(256)) == NULL) {
+                       (void) fprintf(stderr , "no memory for \"%s\"\n" ,
+                               MI_BITMAP(mi));
+                       return;
+               }
+               (void) strncpy(bitmap_local, MI_BITMAP(mi), 256);
+#if HAVE_DIRENT_H
+               getRandomFile(MI_BITMAP(mi), bitmap_local);
+#endif
+#endif /* STANDALONE */
+       }
+       pickPixmap(display, drawable, bitmap_local,
+                  default_width, default_height, default_bits,
+                  width, height, pixmap, graphics_format);
+}
+
+char *
+getModeFont(char *infont)
+{
+       static char *localfont = NULL;
+
+       if (localfont != NULL) {
+               (void) free((void *) localfont);
+               localfont = NULL;
+       }
+       if (infont && strlen(infont)) {
+#ifdef STANDALONE
+               localfont = infont;
+#else
+               if ((localfont = (char *) malloc(256)) == NULL) {
+                       (void) fprintf(stderr , "no memory for \"%s\"\n" ,
+                               infont);
+                       return NULL;
+               }
+               (void) strncpy(localfont, infont, 256);
+#if HAVE_DIRENT_H
+               getRandomFile(infont, localfont);
+#endif
+#endif /* STANDALONE */
+       }
+       if (localfont && strlen(localfont) && !readable(localfont)) {
+               (void) fprintf(stderr,
+                      "could not read file \"%s\"\n", localfont);
+               if (localfont) {
+                       (void) free((void *) localfont);
+                       localfont = NULL;
+               }
+       }
+       return localfont;
+}
+
+#define FROM_PROGRAM 1
+#define FROM_FORMATTEDFILE    2
+#define FROM_FILE    3
+#define FROM_RESRC   4
+
+static char *def_words = (char *) "I'm out running around.";
+static int  getwordsfrom;
+
+static void
+strcat_firstword(char *fword, char *words)
+{
+       while (*fword)
+               fword++;
+       while (*words && !(isspace((int) *words)))
+               *fword++ = *words++;
+       *fword = '\0';
+}
+
+int
+isRibbon(void)
+{
+       return (getwordsfrom == FROM_RESRC);
+}
+
+char       *
+getWords(int screen, int screens)
+{
+       FILE       *pp;
+       static char *buf = NULL, progerr[BUFSIZ], progrun[BUFSIZ];
+       register char *p;
+       int         i;
+
+#if !defined(__cplusplus) && !defined(c_plusplus)
+       extern int  pclose(FILE *);
+
+#endif
+
+       if (buf == NULL) {
+               if ((buf = (char *) calloc(screens * BUFSIZ,
+                               sizeof (char))) == NULL)
+                       return NULL;
+       }
+       p = &buf[screen * BUFSIZ];
+       *p = '\0';
+       if (message && *message)
+               getwordsfrom = FROM_RESRC;
+       else if (messagefile && *messagefile) {
+               getwordsfrom = FROM_FILE;
+       } else if (messagesfile && *messagesfile) {
+               getwordsfrom = FROM_FORMATTEDFILE;
+       } else {
+               getwordsfrom = FROM_PROGRAM;
+
+               (void) sprintf(progrun, "( %s ) 2>&1",
+                           (!program || !*program) ? DEF_PROGRAM : program);
+       }
+
+       switch (getwordsfrom) {
+#ifndef VMS
+               case FROM_PROGRAM:
+/*-
+ * PURIFY 4.0.1 on SunOS4 and on Solaris2 reports a duplication of file
+ *  descriptor on the next line.  Do not know if this is a problem or not. */
+                       if ((pp = (FILE *) popen(progrun, "r")) != NULL) {
+                               while (fgets(p, BUFSIZ - strlen(&buf[screen * BUFSIZ]), pp)) {
+                                       if (strlen(&buf[screen * BUFSIZ]) + 1 < BUFSIZ)
+                                               p = &buf[screen * BUFSIZ] + strlen(&buf[screen * BUFSIZ]);
+                                       else
+                                               break;
+                               }
+                               (void) pclose(pp);
+                               p = &buf[screen * BUFSIZ];
+                               if (!buf[screen * BUFSIZ])
+                                       (void) sprintf(&buf[screen * BUFSIZ], "\"%s\" produced no output!",
+                                        (!program) ? DEF_PROGRAM : program);
+                               else {
+                                       (void) memset((char *) progerr, 0, sizeof (progerr));
+                                       (void) strcpy(progerr, "sh: ");
+                                       strcat_firstword(progerr, (!program || !*program) ?
+                                                     (char *) DEF_PROGRAM : program);
+                                       (void) strcat(progerr, ": not found\n");
+                                       if (!strcmp(&buf[screen * BUFSIZ], progerr))
+                                               switch (NRAND(12)) {
+                                                       case 0:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "( Get with the program, bub. )\n");
+                                                               break;
+                                                       case 1:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "( I blow my nose at you, you silly person! )\n");
+                                                               break;
+                                                       case 2:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "\nThe resource you want to\nset is `program'.\n");
+                                                               break;
+                                                       case 3:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "\nHelp!!  Help!!\nAAAAAAGGGGHHH!!  \n\n");
+                                                               break;
+                                                       case 4:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "( Hey, who called me `Big Nose'? )\n");
+                                                               break;
+                                                       case 5:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "( Hello?  Are you paying attention? )\n");
+                                                               break;
+                                                       case 6:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "sh: what kind of fool do you take me for? \n");
+                                                               break;
+                                                       case 7:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "\nRun me with -program \"fortune -o\".\n");
+                                                               break;
+                                                       case 8:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "( Where is your fortune? )\n");
+                                                               break;
+                                                       case 9:
+                                                               (void) strcat(&buf[screen * BUFSIZ],
+                                                                             "( Your fortune has not been written yet!! )");
+                                                               break;
+                                               }
+                               }
+                               p = &buf[screen * BUFSIZ];
+                       } else {
+                               perror(progrun);
+                               p = def_words;
+                       }
+                       break;
+#endif
+               case FROM_FORMATTEDFILE:
+                       if ((pp = my_fopen(messagesfile, "r")) != NULL) {
+                               int         len_mess_file;
+
+                               if (fscanf(pp, "%d", &len_mess_file)) {
+                                       int         no_quote;
+
+                                       if (len_mess_file <= 0)
+                                               buf[screen * BUFSIZ] = '\0';
+                                       else {
+                                               (void) fgets(p, BUFSIZ - strlen(&buf[screen * BUFSIZ]), pp);
+                                               /* get first '%%' (the one after the number of quotes) */
+                                               (void) fgets(p, BUFSIZ - strlen(&buf[screen * BUFSIZ]), pp);
+                                               no_quote = NRAND(len_mess_file);
+                                               for (i = 0; i <= no_quote; ++i) {
+                                                       unsigned int len_cur = 0;
+
+                                                       buf[screen * BUFSIZ] = '\0';
+                                                       p = &buf[screen * BUFSIZ] + strlen(&buf[screen * BUFSIZ]);
+                                                       while (fgets(p, BUFSIZ - strlen(&buf[screen * BUFSIZ]), pp)) {
+                                                               if (strlen(&buf[screen * BUFSIZ]) + 1 < BUFSIZ) {
+                                                                       /* a line with '%%' contains 3 characters */
+                                                                       if ((strlen(&buf[screen * BUFSIZ]) == len_cur + 3) &&
+                                                                           (p[0] == '%') && (p[1] == '%')) {
+                                                                               p[0] = '\0';    /* get rid of "%%" in &buf[screen * BUFSIZ] */
+                                                                               break;
+                                                                       } else {
+                                                                               p = &buf[screen * BUFSIZ] + strlen(&buf[screen * BUFSIZ]);
+                                                                               len_cur = strlen(&buf[screen * BUFSIZ]);
+                                                                       }
+                                                               } else
+                                                                       break;
+                                                       }
+                                               }
+                                       }
+                                       (void) fclose(pp);
+                                       if (!buf[screen * BUFSIZ])
+                                               (void) sprintf(&buf[screen * BUFSIZ],
+                                                              "file \"%s\" is empty!", messagesfile);
+                                       p = &buf[screen * BUFSIZ];
+                               } else {
+                                       (void) sprintf(&buf[screen * BUFSIZ],
+                                                      "file \"%s\" not in correct format!", messagesfile);
+                                       p = &buf[screen * BUFSIZ];
+                               }
+                       } else {
+                               (void) sprintf(&buf[screen * BUFSIZ],
+                               "could not read file \"%s\"!", messagesfile);
+                               p = &buf[screen * BUFSIZ];
+                       }
+                       break;
+               case FROM_FILE:
+                       if ((pp = my_fopen(messagefile, "r")) != NULL) {
+                               while (fgets(p, BUFSIZ - strlen(&buf[screen * BUFSIZ]), pp)) {
+                                       if (strlen(&buf[screen * BUFSIZ]) + 1 < BUFSIZ)
+                                               p = &buf[screen * BUFSIZ] + strlen(&buf[screen * BUFSIZ]);
+                                       else
+                                               break;
+                               }
+                               (void) fclose(pp);
+                               if (!buf[screen * BUFSIZ])
+                                       (void) sprintf(&buf[screen * BUFSIZ],
+                                       "file \"%s\" is empty!", messagefile);
+                               p = &buf[screen * BUFSIZ];
+                       } else {
+                               (void) sprintf(&buf[screen * BUFSIZ],
+                                "could not read file \"%s\"!", messagefile);
+                               p = &buf[screen * BUFSIZ];
+                       }
+                       break;
+               case FROM_RESRC:
+                       p = message;
+                       break;
+               default:
+                       p = def_words;
+                       break;
+       }
+
+       if (!p || *p == '\0')
+               p = def_words;
+       return p;
+}
+
+XFontStruct *
+getFont(Display * display)
+{
+       XFontStruct *messagefont;
+
+       if (!(messagefont = XLoadQueryFont(display,
+                  (messagefontname) ? messagefontname : DEF_MESSAGEFONT))) {
+               if (messagefontname) {
+                       (void) fprintf(stderr, "can not find font: %s, using %s...\n",
+                                      messagefontname, DEF_MESSAGEFONT);
+                       messagefont = XLoadQueryFont(display, DEF_MESSAGEFONT);
+               }
+               if (!(messagefont)) {
+                       (void) fprintf(stderr, "can not find font: %s, using %s...\n",
+                                      DEF_MESSAGEFONT, FALLBACK_FONTNAME);
+                       messagefont = XLoadQueryFont(display, FALLBACK_FONTNAME);
+                       if (!messagefont) {
+                               (void) fprintf(stderr, "can not even find %s!!!\n", FALLBACK_FONTNAME);
+                               return (None);  /* Do not want to exit when in a mode */
+                       }
+               }
+       }
+       return messagefont;
+}
+
+#ifdef USE_MB
+XFontSet
+getFontSet(Display * display)
+{
+       char **miss, *def;
+       int n_miss;
+       XFontSet fs;
+
+       fs = XCreateFontSet(display,
+                           DEF_MESSAGEFONTSET,
+                           &miss, &n_miss, &def);
+       return fs;
+}
+#endif
diff --git a/xlock/iostuff.h b/xlock/iostuff.h
new file mode 100644 (file)
index 0000000..837b093
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef _FILE_H_
+#define _FILE_H_
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)iostuff.h  4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * IO stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+#ifdef STANDALONE
+#ifdef HAVE_XPM
+#define USE_XPM
+#endif
+#endif /* STANDALONE */
+
+#define FALLBACK_FONTNAME "fixed"
+#ifndef DEF_MESSAGEFONT
+#define DEF_MESSAGEFONT "-*-times-*-*-*-*-18-*-*-*-*-*-*-*"
+#define DEF_MESSAGEFONTSET "-*-*-medium-r-normal-*-18-*-*-*-*-*-*-*"
+#endif
+#ifndef DEF_PROGRAM            /* Try the -o option ;) */
+#define DEF_PROGRAM "fortune -s"
+#endif
+
+#define IS_NONE 0
+#define IS_XBMDONE 1           /* Only need one mono image */
+#define IS_XBM 2
+#define IS_XBMFILE 3
+#define IS_XPM 4
+#define IS_XPMFILE 5
+#define IS_RASTERFILE 6
+#define IS_MAGICKFILE 7
+
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+
+extern FILE *my_fopen(char *, const char *);
+int index_dir(char *str1, char *substr);
+extern void get_dir(char *fullpath, char *dir, char *filename);
+#if HAVE_DIRENT_H
+extern int  sel_image(struct dirent *name);
+extern int scan_dir(const char *directoryname, struct dirent ***namelist,
+   int         (*specify) (struct dirent *),
+   int         (*compare) (const void *, const void *));
+#endif
+
+extern int isRibbon(void);
+extern char * getWords(int screen, int screens);
+extern XFontStruct * getFont(Display * display);
+
+extern void pickPixmap(Display * display, Drawable drawable, char *name,
+   int default_width, int default_height,
+        unsigned char *default_bits,
+   int *width, int *height, Pixmap * pixmap,
+   int *graphics_format);
+extern void getImage(ModeInfo * mi, XImage ** logo,
+         int default_width, int default_height, unsigned char *default_bits,
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+                    int default_xpm, char **name,
+#endif
+                    int *graphics_format, Colormap * newcolormap,
+                    unsigned long *black);
+extern void destroyImage(XImage ** logo, int *graphics_format);
+extern void getPixmap(ModeInfo * mi, Drawable drawable,
+         int default_width, int default_height, unsigned char *default_bits,
+                     int *width, int *height, Pixmap * pixmap,
+                     int *graphics_format);
+
+extern char * getModeFont(char *infont);
+#ifdef __cplusplus
+  }
+#endif
+
+#endif /* _FILE_H_ */
diff --git a/xlock/logout.c b/xlock/logout.c
new file mode 100644 (file)
index 0000000..1fd1dfe
--- /dev/null
@@ -0,0 +1,527 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)logout.c     4.02 97/04/01 xlockmore";
+
+#endif
+
+/*-
+ * logout.c: handle compile-time optional logout
+ *
+ * See xlock.c for copying information.
+ *
+ * xclosedown code
+ * Copyright 1990 by Janet Carson
+ * Permission to use, copy, modify, and distribute 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.  The author makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * Revision History:
+ * 27-Jul-95: put back in logout.c (oops).
+ *            Window shutdown program by Janet L. Carson,
+ *            Baylor College of Medicine.
+ *            Main procedure modified for use w/ xlock by
+ *            Anthony Thyssen <anthony@cit.gu.edu.au>.
+ * 24-Feb-95: fullLock rewritten to handle non-default group names from
+ *            Dale A. Harris <rodmur@ecst.csuchico.edu>
+ * 13-Feb-95: Heath A. Kehoe <hakehoe@icaen.uiowa.edu>.
+ *            Mostly taken from bomb.c
+ * 1994:      bomb.c written.  Copyright (c) 1994 Dave Shield
+ *            Liverpool Computer Science
+ */
+
+#include "xlock.h"
+#include "iostuff.h"
+
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT ) || defined( USE_BOMB )
+
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+#include <syslog.h>
+#endif
+#include <sys/signal.h>
+
+extern Bool inroot, inwindow, nolock, debug;
+extern char *logoutCmd;
+
+/*-
+ * This file contains a function called logoutUser() that, when called,
+ * will (try) to log out the user.
+ *
+ * A portable way to do this is to simply kill all of the user's processes,
+ * but this is a really ugly way to do it (it kills background jobs that
+ * users may want to remain running after they log out).
+ *
+ * If your system provides for a cleaner/easier way to log out a user,
+ * you may implement it here.
+ *
+ * For example, on some systems, one may define for the users an environment
+ * variable named XSESSION that contains the pid of the X session leader
+ * process.  So, to log the user out, we just need to kill that process,
+ * and the X session will end.  Of course, a user can defeat that by
+ * changing the value of XSESSION; so we can fall back on the ugly_logout()
+ * method.
+ *
+ * If you can't log the user out (and you don't want to use the brute
+ * force method) simply return from logoutUser(), and xlock will continue
+ * on it's merry way (only applies if USE_AUTO_LOGOUT or USE_BUTTON_LOGOUT
+ * is defined.)
+ */
+
+#define NAP_TIME        5      /* Sleep between shutdown attempts */
+
+
+#ifdef CLOSEDOWN_LOGOUT
+
+/* Logout the user by contacting the display and closeing all windows */
+
+
+/*-
+ *  Window shutdown program by Janet L. Carson, Baylor College of Medicine.
+ *  Version 1.0, placed in /contrib on 2/12/90.
+ *
+ *  Please send comments or fixes to jcarson@bcm.tmc.edu
+ */
+
+/*-
+ *  I'm probably going to get some BadWindow errors as I kill clients
+ *  which have multiple windows open and then try to kill them again
+ *  on another of their windows.  I'm just going to plow right through!
+ *  The flag is set back to false in recurse_tree and kill_tree...
+ */
+
+static int  err_occurred = False;
+
+static int
+err_handler(Display * display, XErrorEvent * err)
+{
+       err_occurred = True;
+       return 0;
+}
+
+/*-
+ *  Looking for properties...
+ */
+
+static int
+has_property(Display * display, Window window, Atom prop)
+{
+       int         nprops, j, retval = 0;
+       Atom       *list = XListProperties(display, window, &nprops);
+
+       if (err_occurred)
+               return 0;
+
+       for (j = 0; j < nprops; j++) {
+               if (list[j] == prop) {
+                       retval = 1;
+                       break;
+               }
+       }
+
+       if (nprops)
+               XFree((caddr_t) list);
+
+       return retval;
+}
+
+/*-
+ *  Send a WM_PROTOCOLS WM_DELETE_WINDOW message to a window
+ */
+
+static void
+send_delete_message(Display * display, Window window,
+                   Atom protocols_atom, Atom delete_window_atom)
+{
+       XClientMessageEvent xclient;
+
+       xclient.type = ClientMessage;
+       xclient.send_event = True;
+       xclient.display = display;
+       xclient.window = window;
+       xclient.message_type = protocols_atom;
+       xclient.format = 32;
+       xclient.data.l[0] = delete_window_atom;
+
+       XSendEvent(display, window, False, 0, (XEvent *) & xclient);
+}
+
+/*-
+ *  To shutdown a top level window:  if the window participates
+ *  in WM_DELETE_WINDOW, let the client shut itself off.  Otherwise,
+ *  do an XKillClient on it.
+ */
+
+static void
+handle_top_level(Display * display, Window window,
+                Atom protocols_atom, Atom delete_window_atom)
+{
+       Atom       *prots;
+       int         nprots, j;
+
+       if (has_property(display, window, protocols_atom)) {
+               XGetWMProtocols(display, window, &prots, &nprots);
+
+               if (err_occurred)
+                       return;
+
+               for (j = 0; j < nprots; j++)
+                       if (prots[j] == delete_window_atom) {
+                               send_delete_message(display, window,
+                                        protocols_atom, delete_window_atom);
+                               break;
+                       }
+               if (j == nprots)        /* delete window not found */
+                       XKillClient(display, window);
+
+               XFree((caddr_t) prots);
+       } else
+               XKillClient(display, window);
+}
+
+/*-
+ *  recurse_tree: look for top level windows to kill all the way down
+ *  the window tree.  This pass is "nice"--I'll use delete_window protocol
+ *  if the window supports it.  If I get an error in the middle, I'll start
+ *  over again at the same level, because reparenting window managers throw
+ *  windows back up to the root...
+ */
+
+static void
+recurse_tree(Display * display, Window window,
+            Atom state_atom, Atom protocols_atom, Atom delete_window_atom)
+{
+       Window      root, parent, *kids;
+       unsigned int nkids;
+       int         j;
+       int         swm_state;
+
+       for (;;) {
+               XQueryTree(display, window, &root, &parent, &kids, &nkids);
+               if (err_occurred) {
+                       err_occurred = False;
+                       return;
+               }
+               for (j = 0; j < nkids; j++) {
+                       swm_state = has_property(display, kids[j], state_atom);
+
+                       if (err_occurred)
+                               break;
+
+                       if (swm_state) {
+                               handle_top_level(display, kids[j], protocols_atom, delete_window_atom);
+                               if (err_occurred)
+                                       break;
+                       } else
+                               recurse_tree(display, kids[j],
+                                            state_atom, protocols_atom, delete_window_atom);
+               }
+
+               XFree((caddr_t) kids);
+
+               /* when I get all the way through a level without an error, I'm done  */
+
+               if (err_occurred)
+                       err_occurred = False;
+               else
+                       return;
+
+       }
+}
+
+/*-
+ *  This is the second pass--anything left gets an XKillClient!
+ */
+
+static void
+kill_tree(Display * display, Window window)
+{
+       Window      root, parent, *kids;
+       unsigned int nkids;
+       int         j;
+
+       for (;;) {
+               XQueryTree(display, window, &root, &parent, &kids, &nkids);
+               if (err_occurred) {
+                       err_occurred = False;
+                       return;
+               }
+               for (j = 0; j < nkids; j++) {
+                       XKillClient(display, kids[j]);
+                       if (err_occurred)
+                               break;
+               }
+
+               XFree((caddr_t) kids);
+
+               /* when I get all the way through a level without an error, I'm done  */
+
+               if (err_occurred)
+                       err_occurred = False;
+               else
+                       return;
+       }
+}
+
+/*-
+ *  Main program
+ */
+
+static void
+closedownLogout(Display * display, int screens)
+{
+       Atom        __SWM_DELETE_WINDOW = None;
+       Atom        __SWM_PROTOCOLS = None;
+       Atom        __SWM_STATE = None;
+       int         j;
+
+#if 0
+       /* synchronize -- so I'm aware of errors immediately */
+       XSynchronize(display, True);
+
+       /* use my error handler from here on out */
+       (void) XSetErrorHandler(err_handler);
+#endif
+
+       /* init atoms */
+       __SWM_STATE = XInternAtom(display, "__SWM_STATE", False);
+       __SWM_PROTOCOLS = XInternAtom(display, "__SWM_PROTOCOLS", False);
+       __SWM_DELETE_WINDOW = XInternAtom(display, "__SWM_DELETE_WINDOW", False);
+
+       /* start looking for windows to kill -- be nice on pass 1 */
+       for (j = 0; j < screens; j++)
+               recurse_tree(display, RootWindow(display, j),
+                         __SWM_STATE, __SWM_PROTOCOLS, __SWM_DELETE_WINDOW);
+
+       /* wait for things to clean themselves up */
+       (void) sleep(NAP_TIME);
+
+       /* this will forcibly kill anything that's still around --
+          this second pass may or may not be needed... */
+       for (j = 0; j < screens; j++)
+               kill_tree(display, RootWindow(display, j));
+       (void) sleep(NAP_TIME);
+}
+
+#endif /* CLOSEDOWN_LOGOUT */
+
+#ifdef SESSION_LOGOUT
+static void
+sessionLogout(void)
+{
+       char       *pidstr;
+
+       pidstr = getenv("XSESSION");
+       if (pidstr) {
+               kill(atoi(pidstr), SIGTERM);
+               (void) sleep(NAP_TIME);
+       }
+}
+
+#endif /* SESSION_LOGOUT */
+
+static void
+uglyLogout(void)
+{
+#ifdef SunCplusplus
+/* #include <signal.h> */
+       extern void (*signal(int, void (*)(int))) (int);
+       extern int  kill(pid_t, int);
+
+#else
+#if 0
+       extern int  signal(int, void *);
+       extern int  kill(int, int);
+
+#endif
+#endif
+
+#ifndef VMS
+#ifndef KILL_ALL_OTHERS
+#define KILL_ALL_OTHERS -1
+       (void) signal(SIGHUP, SIG_IGN);
+       (void) signal(SIGTERM, SIG_IGN);
+#endif
+
+       (void) kill(KILL_ALL_OTHERS, SIGHUP);
+       (void) sleep(NAP_TIME);
+       (void) kill(KILL_ALL_OTHERS, SIGTERM);
+       (void) sleep(NAP_TIME);
+
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+       syslog(SYSLOG_NOTICE, "%s: failed to exit - sending kill (uid %d)\n",
+              ProgramName, getuid());
+#endif
+
+       (void) kill(KILL_ALL_OTHERS, SIGKILL);
+       (void) sleep(NAP_TIME);
+
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+       syslog(SYSLOG_WARNING, "%s: still won't exit - suicide (uid %d)\n",
+              ProgramName, getuid());
+#endif
+
+       (void) kill((int) getpid(), SIGKILL);
+#endif /* !VMS */
+       exit(-1);
+}
+
+void
+logoutUser(Display * display
+#ifdef CLOSEDOWN_LOGOUT
+  , int screens
+#endif
+)
+{
+
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+       extern      syslogStop(char *);
+
+       syslog(SYSLOG_INFO, "%s: expired. closing down (uid %d) on %s\n",
+              ProgramName, getuid(), getenv("DISPLAY"));
+       syslogStop(XDisplayString(display));
+#endif
+       if (logoutCmd && *logoutCmd) {
+               int         cmd_pid;
+
+               if ((cmd_pid = (int) FORK()) == -1) {
+                       (void) fprintf(stderr, "Failed to launch \"%s\"\n", logoutCmd);
+                       perror(ProgramName);
+                       cmd_pid = 0;
+               } else if (!cmd_pid) {
+                       (void) system(logoutCmd);
+                       exit(0);
+               }
+       }
+#ifdef CLOSEDOWN_LOGOUT
+       (void) finish(display, False);
+#else
+       (void) finish(display, True);
+#endif
+#ifdef VMS
+       (void) system("mcr decw$endsession -noprompt");
+#else
+#ifdef __sgi
+       (void) system("/usr/bin/X11/tellwm end_session >/dev/null 2>&1");
+       (void) sleep(10);       /* Give the above a chance to run */
+#endif
+#endif
+
+#ifdef CLOSEDOWN_LOGOUT
+       /* Do not want to kill other user's processes e.g. telnet session */
+       closedownLogout(display, screens);
+       return;
+#endif
+#ifdef SESSION_LOGOUT
+       sessionLogout();
+#endif
+       uglyLogout();
+       exit(-1);
+}
+
+
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+       /*
+        *  Determine whether to "fully" lock the terminal, or
+        *    whether the time-limited version should be imposed.
+        *
+        *  Policy:
+        *      Members of staff can fully lock
+        *        (hard-wired user/group names + file read at run time)
+        *      Students (i.e. everyone else)
+        *          are forced to use the time-limit version.
+        *
+        *  An alternative policy could be based on display location
+        */
+#define FULL_LOCK       1
+#define TEMP_LOCK       0
+
+/* assuming only staff file is needed */
+#ifndef STAFF_FILE
+#define STAFF_FILE      "/usr/remote/etc/xlock.staff"
+#endif
+
+#undef passwd
+#undef pw_name
+#undef getpwnam
+#undef getpwuid
+#include <pwd.h>
+#include <grp.h>
+#include <sys/param.h>
+#include <errno.h>
+#ifndef NGROUPS
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef NGROUPS_MAX
+#define NGROUPS NGROUPS_MAX
+#else
+#define NGROUPS NGROUPS_MAX_DEFAULT
+#endif
+#endif
+
+int
+fullLock(void)
+{
+       uid_t       uid;
+       int         ngroups = NGROUPS;
+
+#ifdef SUNOS4
+       gid_t       mygidset[NGROUPS * sizeof (gid_t)];
+
+#else
+       gid_t       mygidset[NGROUPS];
+
+#endif
+       int         ngrps, i;
+       struct passwd *pwp;
+       struct group *gp;
+       FILE       *fp;
+       char        buf[BUFSIZ];
+       extern int  logoutButton;
+
+       if (inwindow || inroot || nolock || logoutButton < 0 /*|| debug */ )
+               return (FULL_LOCK);     /* (mostly) harmless user */
+       uid = getuid();
+       /* Do not try to logout root! */
+       if (!uid)
+               return (FULL_LOCK);     /* root */
+
+       pwp = getpwuid(uid);
+       if ((ngrps = getgroups(ngroups, mygidset)) == -1)
+               perror(ProgramName);
+
+#ifdef STAFF_NETGROUP
+       if (innetgr(STAFF_NETGROUP, NULL, pwp->pw_name, NULL))
+               return (FULL_LOCK);
+#endif
+
+       if ((fp = my_fopen(STAFF_FILE, "r")) == NULL)
+               return (TEMP_LOCK);
+
+       while ((fgets(buf, BUFSIZ, fp)) != NULL) {
+               char       *cp;
+
+               if ((cp = (char *) strchr(buf, '\n')) != NULL)
+                       *cp = '\0';
+               if (!strcmp(buf, pwp->pw_name))
+                       return (FULL_LOCK);
+               if ((gp = getgrnam(buf)) != NULL) {
+                       /* check all of user's groups */
+#ifdef SUNOS4
+                       for (i = 1; i < ngrps * sizeof (gid_t); i += 2)
+#else
+                       for (i = 0; i < ngrps; ++i)
+#endif
+                               if (gp->gr_gid == mygidset[i])
+                                       return (FULL_LOCK);
+               }
+       }
+       (void) fclose(fp);
+
+       return (TEMP_LOCK);
+}
+#endif /* USE_AUTO_LOGOUT || USE_BUTTON_LOGOUT */
+
+#endif /* USE_AUTO_LOGOUT || USE_BUTTON_LOGOUT || USE_BOMB */
diff --git a/xlock/magick.c b/xlock/magick.c
new file mode 100644 (file)
index 0000000..0865bda
--- /dev/null
@@ -0,0 +1,193 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)magick.c     5.00 00/10/26 xlockmore";
+
+#endif
+
+/*-
+ * Utilities for Reading images using ImageMagick
+ * 
+ * Copyright (c) 2000 by J.Jansen (joukj@hrem.stm.tudelft.nl)
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 26-Oct-00: Created
+ */
+
+#ifdef USE_MAGICK
+
+#include "magick.h"
+
+XLockImage xlockimage;
+
+int
+MagickFileToImage(ModeInfo * mi, char *filename, XImage ** image)
+{
+   Image* imageData = (Image*) NULL;
+   ImageInfo imageInfo;
+   ExceptionInfo exception;
+   PixelPacket* pixdata;
+   int i , fuzz;
+   unsigned long black, white, fgpix, bgpix;
+   XColor      fgcol, bgcol;
+   
+   /* Read image data from file */
+   GetImageInfo( &imageInfo );
+   imageInfo.dither = 0;
+   strcpy( imageInfo.filename , filename );
+   if ( MI_IS_VERBOSE( mi ) )
+       (void) printf ( "Reading image %s\n", imageInfo.filename );
+   imageData = ReadImage ( &imageInfo, &exception );
+   if ( imageData == (Image*) NULL )
+     {
+       (void) fprintf ( stderr , "Error reading image %s\n", imageInfo.filename );
+       return MagickFileInvalid;
+     }
+
+   /* setup X-image */
+   xlockimage.width = imageData->columns;
+   xlockimage.height = imageData->rows;
+   if ( MI_IS_VERBOSE( mi ) )
+     {
+       (void) printf ( "MagickImage dimensions %d %d\n", imageData->columns ,
+                      imageData->rows );
+       (void) printf ( "XlockImage dimensions %d %d ( %d )\n",
+                      xlockimage.width , xlockimage.height ,
+                      xlockimage.width );
+     }
+   xlockimage.data = (unsigned char *) malloc((int) ( xlockimage.width *
+                                                    xlockimage.height));
+   if (!xlockimage.data)
+     {
+       (void) fprintf(stderr, "out of memory for Raster file\n");
+       return MagickNoMemory;
+     }
+
+   if ( imageData->colors == 0 )
+     {
+       PixelPacket* pixtmp;
+       
+       AllocateImageColormap ( imageData , COLORMAP_SIZE );
+       pixdata = GetImagePixels( imageData , 0 , 0 , imageData->columns ,
+                                            imageData->rows );
+       imageData->colors = imageData->columns*imageData->rows;
+
+       for ( fuzz=0; imageData->colors > COLORMAP_SIZE; fuzz++)
+         {
+            int num_col , j;
+            
+            pixtmp = pixdata;
+            num_col = 0;
+            for ( i=0; i<imageData->columns*imageData->rows; i++)
+              {
+                 PixelPacket* pixtmp2;
+                   
+                 pixtmp2 = imageData->colormap;
+                 for ( j=0; j<num_col; j++ )
+                   {
+                      if ( ABS( pixtmp->red - pixtmp2->red ) +
+                        ABS( pixtmp->green - pixtmp2->green ) +
+                        ABS( pixtmp->blue - pixtmp2->blue ) < fuzz )
+                        break;
+                      pixtmp2++;
+                   }
+                 if ( j == num_col )
+                   {
+                      pixtmp2->red = pixtmp->red;
+                      pixtmp2->green = pixtmp->green;
+                      pixtmp2->blue = pixtmp->blue;
+                      num_col++;
+                      if ( num_col == COLORMAP_SIZE )
+                        {
+                           num_col++;
+                           break;
+                        }
+                   }
+                 xlockimage.data[ i ] = j;
+                 pixtmp++;
+              }
+            imageData->colors = num_col;
+         }
+     }
+   else
+     {
+       if ( imageData->colors > COLORMAP_SIZE )
+         {
+            imageData->colors = COLORMAP_SIZE;
+            (void) fprintf( stderr ,
+                           "wrong colour reducing algorithm used\n" );
+            (void) fprintf( stderr ,
+            "Please notify the maintainer that this statement is reached\n" );
+         }
+   
+   /* get pixel information */
+   if ( !( pixdata = GetImagePixels( imageData , 0 , 0 , imageData->columns ,
+                                   imageData->rows ) ) )
+     {
+       (void) fprintf( stderr , "Error getting pixels\n" );
+       return MagickFileInvalid;
+     }
+   
+       xlockimage.data = GetIndexes ( imageData );
+     }
+   *image = XCreateImage( MI_DISPLAY(mi), MI_VISUAL(mi), 8, ZPixmap, 0,
+                        (char *) xlockimage.data, (int) xlockimage.width,
+                        (int) xlockimage.height, 16, (int) xlockimage.width );
+   if (!*image)
+     {
+       (void) fprintf(stderr, "could not create image from file\n");
+       return MagickColorError;
+     }
+   
+   /*set up colourmap */
+       black = MI_BLACK_PIXEL(mi);
+       white = MI_WHITE_PIXEL(mi);
+       fgpix = MI_FG_PIXEL(mi);
+       bgpix = MI_BG_PIXEL(mi);
+       fgcol.pixel = fgpix;
+       bgcol.pixel = bgpix;
+       XQueryColor(MI_DISPLAY(mi), MI_COLORMAP(mi), &fgcol);
+       XQueryColor(MI_DISPLAY(mi), MI_COLORMAP(mi), &bgcol);
+
+       /* Set these, if Image does not overwrite some, so much the better. */
+       if (fgpix < COLORMAP_SIZE) {
+               xlockimage.red[fgpix] = fgcol.red >> 8;
+               xlockimage.green[fgpix] = fgcol.green >> 8;
+               xlockimage.blue[fgpix] = fgcol.blue >> 8;
+       }
+       if (bgpix < COLORMAP_SIZE) {
+               xlockimage.red[bgpix] = bgcol.red >> 8;
+               xlockimage.green[bgpix] = bgcol.green >> 8;
+               xlockimage.blue[bgpix] = bgcol.blue >> 8;
+       }
+       if (white < COLORMAP_SIZE) {
+               xlockimage.red[white] = 0xFF;
+               xlockimage.green[white] = 0xFF;
+               xlockimage.blue[white] = 0xFF;
+       }
+       if (black < COLORMAP_SIZE) {
+               xlockimage.red[black] = 0;
+               xlockimage.green[black] = 0;
+               xlockimage.blue[black] = 0;
+       }
+   /* supply data and colours*/
+       xlockimage.colors = imageData->colors;
+       for ( i=0 ; i<xlockimage.colors ; i++ )
+         {
+            xlockimage.red[ i ] = imageData->colormap->red;
+            xlockimage.green[ i ] = imageData->colormap->green;
+            xlockimage.blue[ i ] = imageData->colormap->blue;
+            imageData->colormap++;
+         }
+   
+   /* Make sure there is a black ... */
+   if (xlockimage.colors <= 0xff)
+     xlockimage.red[0xff] = xlockimage.green[0xff] = xlockimage.blue[0xff] = 0;
+
+   /* clean up */
+   DestroyImage( imageData );
+
+   return MagickSuccess;
+}
+
+#endif /* USE_MAGICK */
diff --git a/xlock/magick.h b/xlock/magick.h
new file mode 100644 (file)
index 0000000..fc2460c
--- /dev/null
@@ -0,0 +1,35 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident        "@(#)magick.h      4.18 00/10/26 xlockmore" */
+
+#endif
+
+/*-
+ * Utilities for Reading images using ImageMagickSun rasterfile processing
+ * 
+ * Copyright (c) 2000 by J.Jansen
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 26-Oct-00: Created
+ */
+
+#ifdef USE_MAGICK
+
+#include <stdio.h>
+#include <time.h>
+#include <sys/types.h>
+#include <magick/api.h>
+
+#include "xlock.h"
+#include "iostuff.h"
+#include "xlockimage.h"
+
+#define MagickColorError   1
+#define MagickSuccess      0
+#define MagickFileInvalid -2
+#define MagickNoMemory    -3
+
+extern int  MagickFileToImage(ModeInfo * mi, char *filename, XImage ** image);
+
+#endif /* USE_MAGICK */
diff --git a/xlock/memcheck.c b/xlock/memcheck.c
new file mode 100644 (file)
index 0000000..a479d9a
--- /dev/null
@@ -0,0 +1,489 @@
+/*****************************************************************************
+*  (c) Copyright 1996,1997 Metapath Software Corporation
+*
+*  Permission to use, copy, modify, and distribute this software and its
+*  documentation for any purpose and without fee is hereby granted,
+*  provided that the above copyright notice appear in all copies and that
+*  both that copyright notice and this permission notice appear in
+*  supporting documentation.
+*
+*  This file is provided AS IS with no warranties of any kind.  The author
+*  shall have no liability with respect to the infringement of copyrights,
+*  trade secrets or any patents by this file or any part thereof.  In no
+*  event will the author be liable for any lost revenue or profits or
+*  other special, indirect and consequential damages.
+*
+*  Author:  David A. Hansen
+*  Created: 28-MAR-1996
+*
+*  Change History:
+*  22-JUL-96   D.Hansen    Fixed some bugs and added length check.
+*  01-AUG-96   D.Hansen    Added Usage dump on SIGHUP
+*  17-JUL-97   D.Hansen    Removed dependencies for use with xlock
+*
+*  Description:
+*     This module replaces the standard malloc/free routines with more
+*     enhanced/robust version to aid in catching memory bugs.
+*
+*****************************************************************************/
+
+/*-
+   It's still a little crude, but it works.  So the next thing I need to do is
+   add some more refinement.  First on my list is to figure out a way to
+   translate the caller's address into something useful, like a symbol.
+   Currently you have to be in gdb and use something like:
+
+   gdb> x <addr>
+
+   Oh, and don't forget to link with debugging, LDFLAGS=-g
+
+   To build, I just put memcheck.c in the xlock subdirectory and hand edited
+
+   the Makefile and ../mode/Makefile to include it.  You'll probably want to
+   create a debug subdirectory and figure out a way to eloquently get
+   configure to build with it.
+
+   Also, there is no comparison/growth detection utility.  Maybe that's
+   something you can add.  Basically, you send HUP signals to the process
+   every so often and it will dump the memory users and amount they have
+   allocated.  After running and HUPing for a while, a script could analyze
+   the output and determine which caller addresses are continuing to consume
+   memory.
+
+   Also, the method for determining the caller's address is probably specific
+   to Intel machines since I use a trick that is based on the way the frame is
+   stacked.  It may work on Sun with a little playing around with the
+   reference variable, like the last variable in the parameter list instead of
+   the first, or maybe by changing the reference to add 1 long word instead of
+   subtract 1 long word.  If you look at the variable caller_addr, you'll see
+   what I'm talking about.  It all depends on things like whether the stack
+   grows up or down, etc.  I would try it first without changing anything and
+   use gdb or dbx or whatever to see if the addresses translate into
+   appropriate symbols.  In any case, it will always be very machine
+   dependent.  Not much one can do about that.
+
+   Finally, what we probably want to do in the long run is create a script
+   that runs xlock randomly through all the modes on a given interval and at
+   the same interval issues SIGHUPs to the process to take a snapshot of the
+   used memory.  Then after letting it iterate through all the modes several
+   times, another script can post-process the output looking for memory growth
+   and bad memory users.  (gdb> handle SIGHUP print pass nostop) (ifndebug
+   around the SIGHUP handler in xlock.c).
+
+   I've also thought about adding another signal catcher to snapshot a stable
+   allocation.  In other words, once xlock is started, issue a SIGUSR1 or
+   something, and then all subsequent SIGHUPs would print deviations from the
+   initial SIGUSR1.  Of course, that would produce a different list for every
+   mode, but it would delete the common mallocs done at process
+   initialization.  Sometimes it's also hard to tell if a library is doing a
+   one time permanent malloc and just reusing it later.  I think MesaGL does
+   this. */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <time.h>
+
+#ifdef ULONG
+#undef ULONG
+#endif
+#if LINT                       /* Lint complains so give it what it expects */
+#define ULONG unsigned int
+#else
+#define ULONG unsigned long
+#endif
+
+extern char *ProgramName;
+extern pid_t ProgramPID;
+extern void *sbrk(int incr);
+
+typedef struct mem_struct {
+       struct mem_hdr {
+               ULONG       check_mark;
+               ULONG       chunk_size;
+               ULONG       used_length;
+               struct mem_struct *next;
+               void       *caller;
+       } hdr;
+
+       /* allocate space for the marker at the end of the data */
+       /* but return the address of data */
+       unsigned char data[2];
+
+} mem_type;
+
+
+#define USED_MARKER   ((ULONG) 0xBABECAFE)
+#define FREE_MARKER   ((ULONG) 0xDEADBEEF)
+#define HEAD_MARKER   ((ULONG) 0xFACEF00D)
+#define EOD_MARKER    ((ULONG) 0xEC)
+
+#define SBRK_MIN      4096
+#define SPLIT_MIN     32
+
+static mem_type *free_head = NULL;
+static mem_type *malloc_head = NULL;
+static int  reentrancy_check = 0;
+static int  first_time = 1;
+static FILE *dump_file;
+static char dump_fname[256];
+
+static struct sigaction hup_action;
+static struct sigaction old_action;
+
+static ULONG total_count;
+static ULONG total_size;
+static ULONG total_chunk;
+static ULONG caller_count;
+static ULONG caller_size;
+static ULONG caller_chunk;
+static time_t hup_time;
+static char time_str[256];
+
+/*-------------------------------------------------------------------------*/
+static void
+message(char *msgstr)
+{
+       if (dump_file == NULL)
+               return;
+       (void) time(&hup_time);
+       (void) strftime(time_str, sizeof (time_str), "%d-%b-%y %H:%M:%S",
+                       localtime(&hup_time));
+       (void) fprintf(dump_file, "%s - %s (%d): %s\n",
+                      time_str, ProgramName, (int) ProgramPID, msgstr);
+       (void) fflush(dump_file);
+}                              /* message */
+
+
+/*-------------------------------------------------------------------------*/
+static void
+hup_handler(int interrupt)
+{
+       mem_type   *t1;
+       mem_type   *t2;
+
+       if (dump_file == NULL)
+               return;
+       if (reentrancy_check > 1) {
+               message("Memory allocation list is currently unaccessible");
+               return;
+       }
+       message("malloc/free usage dump:");
+
+       (void) fprintf(dump_file,
+                      "Dumping on interrupt %d.\n", interrupt);
+       (void) fprintf(dump_file,
+                      "=================================================\n");
+       (void) fprintf(dump_file,
+                      "Caller      |   Number  |    Size   |    Heap   |\n");
+       (void) fprintf(dump_file,
+                      "------------|-----------|-----------|-----------|\n");
+       total_count = 0;
+       total_size = 0;
+       total_chunk = 0;
+       for (t1 = malloc_head; t1; t1 = t1->hdr.next) {
+               total_count++;
+               total_size += t1->hdr.used_length;
+               total_chunk += t1->hdr.chunk_size;
+               if (t1->hdr.check_mark == HEAD_MARKER) {
+                       t1->hdr.check_mark = USED_MARKER;
+                       continue;
+               }
+               caller_count = 1;
+               caller_size = t1->hdr.used_length;
+               caller_chunk = t1->hdr.chunk_size;
+               for (t2 = t1->hdr.next; t2; t2 = t2->hdr.next) {
+                       if (t2->hdr.caller == t1->hdr.caller) {
+                               t2->hdr.check_mark = HEAD_MARKER;
+                               caller_count++;
+                               caller_size += t2->hdr.used_length;
+                               caller_chunk += t2->hdr.chunk_size;
+                       }
+               }
+#ifdef LINT
+               (void) fprintf(dump_file, "0x%08X: |%10u |%10u |%10u |\n",
+#else
+               (void) fprintf(dump_file, "0x%08lX: |%10lu |%10lu |%10lu |\n",
+#endif
+                              (ULONG) t1->hdr.caller,
+                              caller_count, caller_size, caller_chunk);
+       }
+       (void) fprintf(dump_file,
+                      "------------|-----------|-----------|-----------|\n");
+#ifdef LINT
+       (void) fprintf(dump_file, "totals:     |%10u |%10u |%10u |\n\n",
+#else
+       (void) fprintf(dump_file, "totals:     |%10lu |%10lu |%10lu |\n\n",
+#endif
+                      total_count, total_size, total_chunk);
+       (void) fflush(dump_file);
+}                              /* hup_handler */
+
+
+
+/*-------------------------------------------------------------------------*/
+static void *
+allocate_memory(ULONG length, void *caller_addr)
+{
+       mem_type   *temp;
+       mem_type   *cnew;
+       mem_type   *last;
+       ULONG       req_size;
+       ULONG       incr;
+
+       if (first_time) {
+               /* install SIGHUP handler to dump usage info */
+               first_time = 0;
+               (void) sprintf(dump_fname,
+                            "memdiag.%s-%d", ProgramName, (int) ProgramPID);
+               dump_file = fopen(dump_fname, "a");
+
+               message("malloc/free diagnostics started");
+
+               (void) sigaction(SIGHUP, NULL, &old_action);
+               if (old_action.sa_handler == SIG_DFL) {
+                       hup_action.sa_handler = hup_handler;
+#ifdef _INCLUDE_HPUX_SOURCE
+                       hup_action.sa_flags = SA_RESETHAND;     /* Just gettting it to compile */
+#else
+                       hup_action.sa_flags = SA_RESTART;
+#endif
+                       (void) sigaction(SIGHUP, &hup_action, NULL);
+                       message("Installed SIGHUP handler for usage dump");
+               } else {
+                       message("Another SIGHUP handler already installed");
+               }
+       }
+       if (++reentrancy_check > 1) {
+               message("MALLOC - reentrancy detected");
+               *(ULONG *) 1 = 1L;
+       }
+       /* round length up to next long word boundary */
+       req_size = (length + 3) & ~3;
+
+       /* add in the mem_type overhead */
+       req_size += sizeof (mem_type);
+
+       /* check the current list of free space */
+       last = NULL;
+       for (temp = free_head; temp != NULL; temp = temp->hdr.next) {
+               if (temp->hdr.check_mark != FREE_MARKER) {
+                       message("MALLOC - corrupt free list");
+                       *(ULONG *) 1 = 1L;
+               }
+               if (temp->hdr.chunk_size >= req_size)
+                       break;
+               last = temp;
+       }
+
+       /* no free space large enough, lets sbrk some more */
+       if (temp == NULL) {
+               /* round up to the next page boundary */
+               incr = (req_size + SBRK_MIN) & ~SBRK_MIN;
+               temp = (mem_type *) sbrk(incr);
+               if (temp == NULL) {
+                       message("MALLOC - no memory available");
+                       *(ULONG *) 1 = 1L;
+               }
+               temp->hdr.check_mark = FREE_MARKER;
+               temp->hdr.chunk_size = incr;
+               temp->hdr.caller = NULL;
+               temp->hdr.next = NULL;
+       }
+       /* if space is large enough to split */
+       if ((temp->hdr.chunk_size - req_size) > SPLIT_MIN) {
+               cnew = (mem_type *) ((char *) temp + req_size);
+               cnew->hdr.check_mark = FREE_MARKER;
+               cnew->hdr.chunk_size = temp->hdr.chunk_size - req_size;
+               cnew->hdr.caller = NULL;
+               cnew->hdr.next = temp->hdr.next;
+               temp->hdr.next = cnew;
+               temp->hdr.chunk_size = req_size;
+       }
+       /* remove block from the free list */
+       if (last == NULL)
+               free_head = temp->hdr.next;
+       else
+               last->hdr.next = temp->hdr.next;
+
+       /* add block to the malloc list */
+       temp->hdr.next = malloc_head;
+       malloc_head = temp;
+
+       temp->hdr.caller = caller_addr;
+       temp->hdr.check_mark = USED_MARKER;
+       temp->hdr.used_length = length;
+       temp->data[length] = EOD_MARKER;
+
+       reentrancy_check--;
+
+       return ((void *) temp->data);
+
+}                              /* allocate_memory */
+
+
+
+/*-------------------------------------------------------------------------*/
+void       *
+malloc(ULONG length)
+{
+       void       *caller_addr = (void *) *((ULONG *) & length - 1);
+
+       return (allocate_memory(length, caller_addr));
+
+}                              /* malloc */
+
+
+
+/*-------------------------------------------------------------------------*/
+void
+free(void *ptr)
+{
+       mem_type   *cur;
+       mem_type   *temp;
+       mem_type   *last;
+
+       /* Don't try to free null */
+       if (ptr == NULL) {
+               message("FREE - NULL pointer");
+               *(ULONG *) 1 = 1L;
+       }
+       if (++reentrancy_check > 1) {
+               message("FREE - reentrancy detected");
+               *(ULONG *) 1 = 1L;
+       }
+       /* subtract off mem_type header */
+       cur = (mem_type *) ((char *) ptr - sizeof (struct mem_hdr));
+
+       /* check data length integrity */
+       if (cur->data[cur->hdr.used_length] != EOD_MARKER) {
+               message("FREE - end of data corrupted");
+               *(ULONG *) 1 = 1L;
+       }
+       /* find the current memory in the malloc list */
+       last = NULL;
+       for (temp = malloc_head; temp != NULL; temp = temp->hdr.next) {
+               if (temp->hdr.check_mark != USED_MARKER) {
+                       message("FREE - corrupt malloc list");
+                       *(ULONG *) 1 = 1L;
+               }
+               if (temp == cur)
+                       break;
+               last = temp;
+       }
+
+       if (temp == NULL) {
+               message("FREE - pointer not found");
+               *(ULONG *) 1 = 1L;
+       }
+       /* remove block from the malloc list */
+       if (last == NULL)
+               malloc_head = temp->hdr.next;
+       else
+               last->hdr.next = temp->hdr.next;
+
+       cur->hdr.check_mark = FREE_MARKER;
+
+       /* add block by insertion sort to the free list */
+       last = NULL;
+       for (temp = free_head; temp != NULL; temp = temp->hdr.next) {
+               if (temp > cur)
+                       break;
+               last = temp;
+       }
+       cur->hdr.next = temp;
+       if (last == NULL)
+               free_head = cur;
+       else
+               last->hdr.next = cur;
+
+       /* do garbage collection */
+
+       /* forward chunk reconciliation */
+       if (cur->hdr.next != NULL) {
+               temp = (mem_type *) ((char *) cur + cur->hdr.chunk_size);
+               if (temp == cur->hdr.next) {
+                       cur->hdr.next = temp->hdr.next;
+                       cur->hdr.chunk_size += temp->hdr.chunk_size;
+                       temp->hdr.check_mark = 0L;
+                       temp->hdr.next = NULL;
+               }
+       }
+       /* reverse chunk reconciliation */
+       if (last != NULL) {
+               temp = (mem_type *) ((char *) last + last->hdr.chunk_size);
+               if (temp == cur) {
+                       last->hdr.next = temp->hdr.next;
+                       last->hdr.chunk_size += temp->hdr.chunk_size;
+                       temp->hdr.check_mark = 0L;
+                       temp->hdr.next = NULL;
+               }
+       }
+       reentrancy_check--;
+
+}                              /* free */
+
+
+
+/*-------------------------------------------------------------------------*/
+void       *
+calloc(ULONG nelem, ULONG length)
+{
+       void       *caller_addr = (void *) *((ULONG *) & nelem - 1);
+       register void *temp;
+
+       length *= nelem;
+       temp = allocate_memory(length, caller_addr);
+       (void) memset(temp, 0, length);
+       return (temp);
+
+}                              /* calloc */
+
+
+
+/*-------------------------------------------------------------------------*/
+void       *
+realloc(void *ptr, ULONG new_length)
+{
+       void       *caller_addr = (void *) *((ULONG *) & ptr - 1);
+       mem_type   *temp;
+       ULONG       alloc_length;
+       void       *cnew;
+
+       if (new_length == 0) {
+               if (ptr)
+                       (void) free(ptr);
+               return (NULL);
+       }
+       if (ptr == NULL)
+               return (allocate_memory(new_length, caller_addr));
+
+       temp = (mem_type *) ((char *) ptr - sizeof (struct mem_hdr));
+
+       if (temp->hdr.check_mark != USED_MARKER) {
+               message("REALLOC - corrupt malloc list");
+               *(ULONG *) 1 = 1L;
+       }
+       alloc_length = temp->hdr.chunk_size - sizeof (mem_type);
+
+       if (new_length <= alloc_length) {
+               /* check data length integrity */
+               if (temp->data[temp->hdr.used_length] != EOD_MARKER) {
+                       message("FREE - end of data corrupted");
+                       *(ULONG *) 1 = 1L;
+               }
+               /* update the info */
+               temp->hdr.used_length = new_length;
+               temp->data[new_length] = EOD_MARKER;
+       } else {
+               /* we need a new chunk */
+               cnew = allocate_memory(new_length, caller_addr);
+               (void) memcpy(cnew, ptr, temp->hdr.used_length);
+               (void) free(ptr);
+               ptr = cnew;
+       }
+
+       return (ptr);
+
+}                              /* realloc */
diff --git a/xlock/mode.c b/xlock/mode.c
new file mode 100644 (file)
index 0000000..6cffb24
--- /dev/null
@@ -0,0 +1,1290 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)mode.c       4.07 97/11/24 xlockmore";
+
+#endif
+/*-
+ * mode.c - Modes for xlock.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 01-Apr-97: Fixed memory leak in XStringListToTextProperty.
+ * 23-Feb-96: Extensive revision to implement new mode hooks and stuff
+ *             Ron Hitchens <ron@idiom.com>
+ * 04-Sep-95: Moved over from mode.h (previously resource.h) with new
+ *            "&*_opts" by Heath A. Kehoe <hakehoe@icaen.uiowa.edu>.
+ *
+ */
+
+#include "xlock.h"
+
+
+/* -------------------------------------------------------------------- */
+
+/*-
+ * Mode options: If count, cycles, or size options are set to 1 ...
+ * they are probably not used by the mode.
+ * To remove unwanted modes put a line of "#if 0" and "#endif"
+ * around the mode and remove mode from the generated "modes/Makefile"
+ * and/or "modes/glx/Makefile".  When adding new modes, keep them in
+ * alphabetical order for -sequential to work properly.
+ */
+
+#ifndef USE_MODULES
+
+LockStruct  LockProcs[] =
+{
+#ifdef MODE_ant
+       {(char *) "ant", init_ant, draw_ant, release_ant,
+        refresh_ant, init_ant, NULL, &ant_opts,
+        1000, -3, 40000, -12, 64, 1.0, (char *) "",
+        (char *) "Shows Langton's and Turk's generalized ants", 0, NULL},
+#endif
+#ifdef MODE_atlantis
+       {(char *) "atlantis", init_atlantis, draw_atlantis, release_atlantis,
+        refresh_atlantis, change_atlantis, NULL, &atlantis_opts,
+        18000, 4, 100, 6000, 64, 1.0, (char *) "",
+        (char *) "Shows moving sharks/whales/dolphin", 0, NULL},
+#endif
+#ifdef MODE_ball
+       {(char *) "ball", init_ball, draw_ball, release_ball,
+        refresh_ball, init_ball, NULL, &ball_opts,
+        10000, 10, 20, -100, 64, 1.0, (char *) "",
+        (char *) "Shows bouncing balls", 0, NULL},
+#endif
+#ifdef MODE_bat
+       {(char *) "bat", init_bat, draw_bat, release_bat,
+        refresh_bat, init_bat, NULL, &bat_opts,
+        100000, -8, 1, 0, 64, 1.0, (char *) "",
+        (char *) "Shows bouncing flying bats", 0, NULL},
+#endif
+#ifdef MODE_billiards
+       {(char *) "billiards", init_billiards, draw_billiards, release_billiards,
+        refresh_billiards, init_billiards, NULL, &billiards_opts,
+        200000, 6, 30, 1, 64, 0.3, (char *) "",
+        (char *) "Shows billiards", 0, NULL},
+#endif
+#ifdef MODE_blot
+       {(char *) "blot", init_blot, draw_blot, release_blot,
+        refresh_blot, init_blot, NULL, &blot_opts,
+        200000, 6, 30, 1, 64, 0.3, (char *) "",
+        (char *) "Shows Rorschach's ink blot test", 0, NULL},
+#endif
+#ifdef MODE_bouboule
+       {(char *) "bouboule", init_bouboule, draw_bouboule, release_bouboule,
+        refresh_bouboule, init_bouboule, NULL, &bouboule_opts,
+        10000, 100, 1, 15, 64, 1.0, (char *) "",
+        (char *) "Shows Mimi's bouboule of moving stars", 0, NULL},
+#endif
+#ifdef MODE_bounce
+       {(char *) "bounce", init_bounce, draw_bounce, release_bounce,
+        refresh_bounce, init_bounce, NULL, &bounce_opts,
+        5000, -10, 1, 0, 64, 1.0, (char *) "",
+        (char *) "Shows bouncing footballs", 0, NULL},
+#endif
+#ifdef MODE_braid
+       {(char *) "braid", init_braid, draw_braid, release_braid,
+        refresh_braid, init_braid, NULL, &braid_opts,
+        1000, 15, 100, -7, 64, 1.0, (char *) "",
+        (char *) "Shows random braids and knots", 0, NULL},
+#endif
+#ifdef MODE_bubble
+       {(char *) "bubble", init_bubble, draw_bubble, release_bubble,
+        refresh_bubble, init_bubble, NULL, &bubble_opts,
+        100000, 25, 1, 100, 64, 0.6, (char *) "",
+        (char *) "Shows popping bubbles", 0, NULL},
+#endif
+#ifdef MODE_bubble3d
+       {(char *) "bubble3d", init_bubble3d, draw_bubble3d, release_bubble3d,
+        draw_bubble3d, change_bubble3d, NULL, &bubble3d_opts,
+        1000, 1, 2, 1, 64, 1.0, (char *) "",
+        (char *) "Richard Jones's GL bubbles", 0, NULL},
+#endif
+#ifdef MODE_bug
+       {(char *) "bug", init_bug, draw_bug, release_bug,
+        refresh_bug, init_bug, NULL, &bug_opts,
+        75000, 10, 32767, -4, 64, 1.0, (char *) "",
+        (char *) "Shows Palmiter's bug evolution and garden of Eden", 0, NULL},
+#endif
+#ifdef MODE_cage
+       {(char *) "cage", init_cage, draw_cage, release_cage,
+        draw_cage, change_cage, NULL, &cage_opts,
+        25000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows the Impossible Cage, an Escher-like GL scene", 0, NULL},
+#endif
+#ifdef MODE_clock
+       {(char *) "clock", init_clock, draw_clock, release_clock,
+        refresh_clock, init_clock, NULL, &clock_opts,
+        100000, -16, 200, -200, 64, 1.0, (char *) "",
+        (char *) "Shows Packard's clock", 0, NULL},
+#endif
+#ifdef MODE_coral
+       {(char *) "coral", init_coral, draw_coral, release_coral,
+        init_coral, init_coral, NULL, &coral_opts,
+        60000, -3, 1, 35, 64, 0.6, (char *) "",
+        (char *) "Shows a coral reef", 0, NULL},
+#endif
+#ifdef MODE_crystal
+       {(char *) "crystal", init_crystal, draw_crystal, release_crystal,
+        refresh_crystal, init_crystal, NULL, &crystal_opts,
+        60000, -500, 200, -15, 64, 1.0, (char *) "",
+        (char *) "Shows polygons in 2D plane groups", 0, NULL},
+#endif
+#ifdef MODE_daisy
+       {(char *) "daisy", init_daisy, draw_daisy, release_daisy,
+        refresh_daisy, init_daisy, NULL, &daisy_opts,
+        100000, 300, 350, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a meadow of daisies", 0, NULL},
+#endif
+#ifdef MODE_dclock
+       {(char *) "dclock", init_dclock, draw_dclock, release_dclock,
+        refresh_dclock, init_dclock, NULL, &dclock_opts,
+        10000, 1, 10000, 1, 64, 0.3, (char *) "",
+        (char *) "Shows a floating digital clock or message", 0, NULL},
+#endif
+#ifdef MODE_decay
+       {(char *) "decay", init_decay, draw_decay, release_decay,
+        refresh_decay, init_decay, NULL, &decay_opts,
+        200000, 6, 30, 1, 64, 0.3, (char *) "",
+        (char *) "Shows a decaying screen", 0, NULL},
+#endif
+#ifdef MODE_deco
+       {(char *) "deco", init_deco, draw_deco, release_deco,
+        init_deco, init_deco, NULL, &deco_opts,
+        1000000, -30, 2, -10, 64, 0.6, (char *) "",
+        (char *) "Shows art as ugly as sin", 0, NULL},
+#endif
+#ifdef MODE_demon
+       {(char *) "demon", init_demon, draw_demon, release_demon,
+        refresh_demon, init_demon, NULL, &demon_opts,
+        50000, 0, 1000, -7, 64, 1.0, (char *) "",
+        (char *) "Shows Griffeath's cellular automata", 0, NULL},
+#endif
+#ifdef MODE_dilemma
+       {(char *) "dilemma", init_dilemma, draw_dilemma, release_dilemma,
+        refresh_dilemma, init_dilemma, NULL, &dilemma_opts,
+        200000, -2, 1000, 0, 64, 1.0, (char *) "",
+        (char *) "Shows Lloyd's Prisoner's Dilemma simulation", 0, NULL},
+#endif
+#ifdef MODE_discrete
+       {(char *) "discrete", init_discrete, draw_discrete, release_discrete,
+        refresh_discrete, init_discrete, NULL, &discrete_opts,
+        1000, 4096, 2500, 1, 64, 1.0, (char *) "",
+        (char *) "Shows various discrete maps", 0, NULL},
+#endif
+#ifdef MODE_dragon
+       {(char *) "dragon", init_dragon, draw_dragon, release_dragon,
+        refresh_dragon, init_dragon, NULL, &dragon_opts,
+        2000000, 1, 16, -24, 64, 1.0, (char *) "",
+        (char *) "Shows Deventer's Hexagonal Dragons Maze", 0, NULL},
+#endif
+#ifdef MODE_drift
+       {(char *) "drift", init_drift, draw_drift, release_drift,
+        refresh_drift, init_drift, NULL, &drift_opts,
+        10000, 30, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows cosmic drifting flame fractals", 0, NULL},
+#endif
+#ifdef MODE_euler2d
+       {(char *) "euler2d", init_euler2d, draw_euler2d, release_euler2d,
+        refresh_euler2d, init_euler2d, NULL, &euler2d_opts,
+        1000, 1024, 3000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a simulation of 2D incompressible inviscid fluid", 0, NULL},
+#endif
+#ifdef MODE_eyes
+       {(char *) "eyes", init_eyes, draw_eyes, release_eyes,
+        refresh_eyes, init_eyes, NULL, &eyes_opts,
+        20000, -8, 5, 1, 64, 1.0, (char *) "",
+        (char *) "Shows eyes following a bouncing grelb", 0, NULL},
+#endif
+#ifdef MODE_fadeplot
+       {(char *) "fadeplot", init_fadeplot, draw_fadeplot, release_fadeplot,
+        refresh_fadeplot, init_fadeplot, NULL, &fadeplot_opts,
+        30000, 10, 1500, 1, 64, 0.6, (char *) "",
+        (char *) "Shows a fading plot of sine squared", 0, NULL},
+#endif
+#ifdef MODE_fire
+       {(char *) "fire", init_fire, draw_fire, release_fire,
+        draw_fire, change_fire, NULL, &fire_opts,
+        10000, 800, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a 3D fire-like image", 0, NULL},
+#endif
+#ifdef MODE_flag
+       {(char *) "flag", init_flag, draw_flag, release_flag,
+        refresh_flag, init_flag, NULL, &flag_opts,
+        50000, 1, 1000, -7, 64, 1.0, (char *) "",
+        (char *) "Shows a waving flag image", 0, NULL},
+#endif
+#ifdef MODE_flame
+       {(char *) "flame", init_flame, draw_flame, release_flame,
+        refresh_flame, init_flame, NULL, &flame_opts,
+        750000, 20, 10000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows cosmic flame fractals", 0, NULL},
+#endif
+#ifdef MODE_flow
+       {(char *) "flow", init_flow, draw_flow, release_flow,
+        refresh_flow, init_flow, NULL, &flow_opts,
+        1000, 1024, 3000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows dynamic strange attractors", 0, NULL},
+#endif
+#ifdef MODE_forest
+       {(char *) "forest", init_forest, draw_forest, release_forest,
+        refresh_forest, init_forest, NULL, &forest_opts,
+        400000, 100, 200, 1, 64, 1.0, (char *) "",
+        (char *) "Shows binary trees of a fractal forest", 0, NULL},
+#endif
+#ifdef MODE_galaxy
+       {(char *) "galaxy", init_galaxy, draw_galaxy, release_galaxy,
+        refresh_galaxy, init_galaxy, NULL, &galaxy_opts,
+        100, -5, 250, -3, 64, 1.0, (char *) "",
+        (char *) "Shows crashing spiral galaxies", 0, NULL},
+#endif
+#ifdef MODE_gears
+       {(char *) "gears", init_gears, draw_gears, release_gears,
+        draw_gears, init_gears, NULL, &gears_opts,
+        1000, 1, 2, 1, 64, 1.0, (char *) "",
+        (char *) "Shows GL's gears", 0, NULL},
+#endif
+#ifdef MODE_glplanet
+        {(char *) "glplanet", init_glplanet, draw_glplanet, release_glplanet,
+         draw_glplanet, init_glplanet, NULL, &glplanet_opts,
+         1000, 1, 2, 1, 64, 1.0, (char *) "",
+         (char *) "Animates texture mapped sphere (planet)", 0, NULL},
+#endif
+#ifdef MODE_goop
+       {(char *) "goop", init_goop, draw_goop, release_goop,
+        init_goop, init_goop, NULL, &goop_opts,
+        10000, -12, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows goop from a lava lamp", 0, NULL},
+#endif
+#ifdef MODE_grav
+       {(char *) "grav", init_grav, draw_grav, release_grav,
+        refresh_grav, init_grav, NULL, &grav_opts,
+        10000, -12, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows orbiting planets", 0, NULL},
+#endif
+#ifdef MODE_helix
+       {(char *) "helix", init_helix, draw_helix, release_helix,
+        refresh_helix, init_helix, NULL, &helix_opts,
+        25000, 1, 100, 1, 64, 1.0, (char *) "",
+        (char *) "Shows string art", 0, NULL},
+#endif
+#ifdef MODE_hop
+       {(char *) "hop", init_hop, draw_hop, release_hop,
+        refresh_hop, init_hop, NULL, &hop_opts,
+        10000, 1000, 2500, 1, 64, 1.0, (char *) "",
+        (char *) "Shows real plane iterated fractals", 0, NULL},
+#endif
+#ifdef MODE_hyper
+       {(char *) "hyper", init_hyper, draw_hyper, release_hyper,
+        refresh_hyper, change_hyper, NULL, &hyper_opts,
+        100000, -6, 300, 1, 64, 1.0, (char *) "",
+        (char *) "Shows spinning n-dimensional hypercubes", 0, NULL},
+#endif
+#ifdef MODE_ico
+       {(char *) "ico", init_ico, draw_ico, release_ico,
+        refresh_ico, change_ico, NULL, &ico_opts,
+        200000, 0, 400, 0, 64, 1.0, (char *) "",
+        (char *) "Shows a bouncing polyhedron", 0, NULL},
+#endif
+#ifdef MODE_ifs
+       {(char *) "ifs", init_ifs, draw_ifs, release_ifs,
+        init_ifs, init_ifs, NULL, &ifs_opts,
+        1000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a modified iterated function system", 0, NULL},
+#endif
+#ifdef MODE_image
+       {(char *) "image", init_image, draw_image, release_image,
+        refresh_image, init_image, NULL, &image_opts,
+        3000000, -20, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows randomly appearing logos", 0, NULL},
+#endif
+#ifdef MODE_invert
+       {(char *) "invert", init_invert, draw_invert, release_invert,
+        draw_invert, init_invert, NULL, &invert_opts,
+        100, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a sphere inverted without wrinkles", 0, NULL},
+#endif
+#ifdef MODE_juggle
+       {(char *) "juggle", init_juggle, draw_juggle, release_juggle,
+        draw_juggle, init_juggle, NULL, &juggle_opts,
+        10000, 150, 30, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a Juggler, juggling", 0, NULL},
+#endif
+#ifdef MODE_julia
+       {(char *) "julia", init_julia, draw_julia, release_julia,
+        refresh_julia, init_julia, NULL, &julia_opts,
+        10000, 1000, 20, 1, 64, 1.0, (char *) "",
+        (char *) "Shows the Julia set", 0, NULL},
+#endif
+#ifdef MODE_kaleid
+       {(char *) "kaleid", init_kaleid, draw_kaleid, release_kaleid,
+        refresh_kaleid, init_kaleid, NULL, &kaleid_opts,
+        80000, 4, 40, -9, 64, 0.6, (char *) "",
+        (char *) "Shows a kaleidoscope", 0, NULL},
+#endif
+#ifdef MODE_kumppa
+       {(char *) "kumppa", init_kumppa, draw_kumppa, release_kumppa,
+        init_kumppa, init_kumppa, NULL, &kumppa_opts,
+        10000, 1, 1000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows kumppa", 0, NULL},
+#endif
+#ifdef MODE_lament
+       {(char *) "lament", init_lament, draw_lament, release_lament,
+        draw_lament, change_lament, NULL, &lament_opts,
+        10000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows Lemarchand's Box", 0, NULL},
+#endif
+#ifdef MODE_laser
+       {(char *) "laser", init_laser, draw_laser, release_laser,
+        refresh_laser, init_laser, NULL, &laser_opts,
+        20000, -10, 200, 1, 64, 1.0, (char *) "",
+        (char *) "Shows spinning lasers", 0, NULL},
+#endif
+#ifdef MODE_life
+       {(char *) "life", init_life, draw_life, release_life,
+        refresh_life, change_life, NULL, &life_opts,
+        750000, 40, 140, 0, 64, 1.0, (char *) "",
+        (char *) "Shows Conway's game of Life", 0, NULL},
+#endif
+#ifdef MODE_life1d
+       {(char *) "life1d", init_life1d, draw_life1d, release_life1d,
+        refresh_life1d, init_life1d, NULL, &life1d_opts,
+        10000, 1, 10, 0, 64, 1.0, (char *) "",
+        (char *) "Shows Wolfram's game of 1D Life", 0, NULL},
+#endif
+#ifdef MODE_life3d
+       {(char *) "life3d", init_life3d, draw_life3d, release_life3d,
+        refresh_life3d, change_life3d, NULL, &life3d_opts,
+        1000000, 35, 85, 1, 64, 1.0, (char *) "",
+        (char *) "Shows Bays' game of 3D Life", 0, NULL},
+#endif
+#ifdef MODE_lightning
+       {(char *) "lightning", init_lightning, draw_lightning, release_lightning,
+        refresh_lightning, init_lightning, NULL, &lightning_opts,
+        10000, 1, 1, 1, 64, 0.6, (char *) "",
+        (char *) "Shows Keith's fractal lightning bolts", 0, NULL},
+#endif
+#ifdef MODE_lisa
+       {(char *) "lisa", init_lisa, draw_lisa, release_lisa,
+        refresh_lisa, change_lisa, NULL, &lisa_opts,
+        25000, 1, 256, -1, 64, 1.0, (char *) "",
+        (char *) "Shows animated lisajous loops", 0, NULL},
+#endif
+#ifdef MODE_lissie
+       {(char *) "lissie", init_lissie, draw_lissie, release_lissie,
+        refresh_lissie, init_lissie, NULL, &lissie_opts,
+        10000, 1, 2000, -200, 64, 0.6, (char *) "",
+        (char *) "Shows lissajous worms", 0, NULL},
+#endif
+#ifdef MODE_loop
+       {(char *) "loop", init_loop, draw_loop, release_loop,
+        refresh_loop, init_loop, NULL, &loop_opts,
+        100000, -5, 1600, -12, 64, 1.0, (char *) "",
+        (char *) "Shows Langton's self-producing loops", 0, NULL},
+#endif
+#ifdef MODE_lyapunov
+       {(char *) "lyapunov", init_lyapunov, draw_lyapunov, release_lyapunov,
+        NULL, init_lyapunov, NULL, &lyapunov_opts,
+        25000, 600, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows lyapunov space", 0, NULL},
+#endif
+#ifdef MODE_mandelbrot
+       {(char *) "mandelbrot", init_mandelbrot, draw_mandelbrot, release_mandelbrot,
+        NULL, init_mandelbrot, NULL, &mandelbrot_opts,
+        25000, -8, 20000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows mandelbrot sets", 0, NULL},
+#endif
+#ifdef MODE_marquee
+       {(char *) "marquee", init_marquee, draw_marquee, release_marquee,
+        init_marquee, init_marquee, NULL, &marquee_opts,
+        100000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows messages", 0, NULL},
+#endif
+#ifdef MODE_matrix
+       {(char *) "matrix", init_matrix, draw_matrix, release_matrix,
+        refresh_matrix, change_matrix, NULL, &matrix_opts,
+        1000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows the Matrix", 0, NULL},
+#endif
+#ifdef MODE_maze
+       {(char *) "maze", init_maze, draw_maze, release_maze,
+        refresh_maze, init_maze, NULL, &maze_opts,
+        1000, 1, 3000, -40, 64, 1.0, (char *) "",
+        (char *) "Shows a random maze and a depth first search solution", 0, NULL},
+#endif
+#ifdef MODE_moebius
+       {(char *) "moebius", init_moebius, draw_moebius, release_moebius,
+        draw_moebius, change_moebius, NULL, &moebius_opts,
+        1000, 1, 1, 1, 64, 1.0, (char *) "",
+    (char *) "Shows Moebius Strip II, an Escher-like GL scene with ants", 0, NULL},
+#endif
+#ifdef MODE_molecule
+       {(char *) "molecule", init_molecule, draw_molecule, release_molecule,
+       draw_molecule, init_molecule, NULL, &molecule_opts,
+       50000, 1, 20, 1, 64, 1.0, (char *) "",
+       (char *) "Draws molecules", 0, NULL},
+#endif
+#ifdef MODE_morph3d
+       {(char *) "morph3d", init_morph3d, draw_morph3d, release_morph3d,
+        draw_morph3d, change_morph3d, NULL, &morph3d_opts,
+        1000, 0, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows GL morphing polyhedra", 0, NULL},
+#endif
+#ifdef MODE_mountain
+       {(char *) "mountain", init_mountain, draw_mountain, release_mountain,
+        refresh_mountain, init_mountain, NULL, &mountain_opts,
+        1000, 30, 4000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows Papo's mountain range", 0, NULL},
+#endif
+#ifdef MODE_munch
+       {(char *) "munch", init_munch, draw_munch, release_munch,
+        init_munch, init_munch, NULL, &munch_opts,
+        5000, 1, 7, 1, 64, 1.0, (char *) "",
+        (char *) "Shows munching squares", 0, NULL},
+#endif
+#ifdef MODE_nose
+       {(char *) "nose", init_nose, draw_nose, release_nose,
+        refresh_nose, init_nose, NULL, &nose_opts,
+        100000, 1, 1, 1, 64, 1.0, (char *) "",
+    (char *) "Shows a man with a big nose runs around spewing out messages", 0, NULL},
+#endif
+#ifdef MODE_pacman
+       {(char *) "pacman", init_pacman, draw_pacman, release_pacman,
+        refresh_pacman, init_pacman, NULL, &pacman_opts,
+        100000, 10, 1, 0, 64, 1.0, (char *) "",
+        (char *) "Shows Pacman(tm)", 0, NULL},
+#endif
+#ifdef MODE_penrose
+       {(char *) "penrose", init_penrose, draw_penrose, release_penrose,
+        init_penrose, init_penrose, NULL, &penrose_opts,
+        10000, 1, 1, -40, 64, 1.0, (char *) "",
+        (char *) "Shows Penrose's quasiperiodic tilings", 0, NULL},
+#endif
+#ifdef MODE_petal
+       {(char *) "petal", init_petal, draw_petal, release_petal,
+        refresh_petal, init_petal, NULL, &petal_opts,
+        10000, -500, 400, 1, 64, 1.0, (char *) "",
+        (char *) "Shows various GCD Flowers", 0, NULL},
+#endif
+#ifdef MODE_pipes
+       {(char *) "pipes", init_pipes, draw_pipes, release_pipes,
+#if defined( MESA ) && defined( SLOW )
+        draw_pipes,
+#else
+        change_pipes,
+#endif
+        change_pipes, NULL, &pipes_opts,
+        1000, 2, 5, 500, 64, 1.0, (char *) "",
+        (char *) "Shows a selfbuilding pipe system", 0, NULL},
+#endif
+#ifdef MODE_polyominoes
+       {(char *) "polyominoes", init_polyominoes, draw_polyominoes, release_polyominoes,
+        refresh_polyominoes, init_polyominoes, NULL, &polyominoes_opts,
+        6000, 1, 8192, 1, 64, 1.0, (char *) "",
+        (char *) "Shows attempts to place polyominoes into a rectangle", 0, NULL},
+#endif
+#ifdef MODE_puzzle
+       {(char *) "puzzle", init_puzzle, draw_puzzle, release_puzzle,
+        init_puzzle, init_puzzle, NULL, &puzzle_opts,
+        10000, 250, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a puzzle being scrambled and then solved", 0, NULL},
+#endif
+#ifdef MODE_pyro
+       {(char *) "pyro", init_pyro, draw_pyro, release_pyro,
+        refresh_pyro, init_pyro, NULL, &pyro_opts,
+        15000, 100, 1, -3, 64, 1.0, (char *) "",
+        (char *) "Shows fireworks", 0, NULL},
+#endif
+#ifdef MODE_qix
+       {(char *) "qix", init_qix, draw_qix, release_qix,
+        refresh_qix, init_qix, NULL, &qix_opts,
+        30000, -5, 32, 1, 64, 1.0, (char *) "",
+        (char *) "Shows spinning lines a la Qix(tm)", 0, NULL},
+#endif
+#ifdef MODE_roll
+       {(char *) "roll", init_roll, draw_roll, release_roll,
+        refresh_roll, init_roll, NULL, &roll_opts,
+        100000, 25, 1, -64, 64, 0.6, (char *) "",
+        (char *) "Shows a rolling ball", 0, NULL},
+#endif
+#ifdef MODE_rotor
+       {(char *) "rotor", init_rotor, draw_rotor, release_rotor,
+        refresh_rotor, init_rotor, NULL, &rotor_opts,
+        100, 4, 100, -6, 64, 0.3, (char *) "",
+        (char *) "Shows Tom's Roto-Rooter", 0, NULL},
+#endif
+#ifdef MODE_rubik
+       {(char *) "rubik", init_rubik, draw_rubik, release_rubik,
+        draw_rubik, change_rubik, NULL, &rubik_opts,
+        10000, -30, 5, -6, 64, 1.0, (char *) "",
+        (char *) "Shows an auto-solving Rubik's Cube", 0, NULL},
+#endif
+#ifdef MODE_sballs
+       {(char *) "sballs", init_sballs, draw_sballs, release_sballs,
+        draw_sballs, change_sballs, NULL, &sballs_opts,
+        10000, 0, 10, 400, 64, 1.0, (char *) "",
+        (char *) "Shows balls spinning like crazy in GL", 0, NULL},
+#endif
+#ifdef MODE_scooter
+       {(char *) "scooter", init_scooter, draw_scooter, release_scooter,
+        refresh_scooter, change_scooter, NULL, &scooter_opts,
+        20000, 24, 3, 100, 64, 1.0, (char *) "",
+        (char *) "Shows a journey through space tunnel and stars", 0, NULL},
+#endif
+#ifdef MODE_shape
+       {(char *) "shape", init_shape, draw_shape, release_shape,
+        refresh_shape, init_shape, NULL, &shape_opts,
+        10000, 100, 256, 1, 64, 1.0, (char *) "",
+        (char *) "Shows stippled rectangles, ellipses, and triangles", 0, NULL},
+#endif
+#ifdef MODE_sierpinski
+       {(char *) "sierpinski", init_sierpinski, draw_sierpinski, release_sierpinski,
+        refresh_sierpinski, init_sierpinski, NULL, &sierpinski_opts,
+        400000, 2000, 100, 1, 64, 1.0, (char *) "",
+        (char *) "Shows Sierpinski's triangle", 0, NULL},
+#endif
+#ifdef MODE_sierpinski3d
+        {(char *) "sierpinski3d", init_gasket, draw_gasket, release_gasket,
+         draw_gasket, init_gasket, NULL, &gasket_opts,
+         1000, 1, 2, 1, 64, 1.0, (char *) "",
+         (char *) "Shows GL's Sierpinski gasket", 0, NULL},
+#endif
+#ifdef MODE_skewb
+       {(char *) "skewb", init_skewb, draw_skewb, release_skewb,
+        draw_skewb, change_skewb, NULL, &skewb_opts,
+        10000, -30, 5, 1, 64, 1.0, (char *) "",
+        (char *) "Shows an auto-solving Skewb", 0, NULL},
+#endif
+#ifdef MODE_slip
+       {(char *) "slip", init_slip, draw_slip, release_slip,
+        init_slip, init_slip, NULL, &slip_opts,
+        50000, 35, 50, 1, 64, 1.0, (char *) "",
+        (char *) "Shows slipping blits", 0, NULL},
+#endif
+#ifdef MODE_solitare
+       {(char *) "solitare", init_solitare, draw_solitare, release_solitare,
+        refresh_solitare, init_solitare, NULL, &solitare_opts,
+        2000000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows Klondike's game of solitare", 0, NULL},
+#endif
+#ifdef MODE_space
+       {(char *) "space", init_space, draw_space, release_space,
+        refresh_space, init_space, NULL, &space_opts,
+        10000, 100, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a journey into deep space", 0, NULL},
+#endif
+#ifdef MODE_sphere
+       {(char *) "sphere", init_sphere, draw_sphere, release_sphere,
+        refresh_sphere, init_sphere, NULL, &sphere_opts,
+        5000, 1, 20, 0, 64, 1.0, (char *) "",
+        (char *) "Shows a bunch of shaded spheres", 0, NULL},
+#endif
+#ifdef MODE_spiral
+       {(char *) "spiral", init_spiral, draw_spiral, release_spiral,
+        refresh_spiral, init_spiral, NULL, &spiral_opts,
+        5000, -40, 350, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a helical locus of points", 0, NULL},
+#endif
+#ifdef MODE_spline
+       {(char *) "spline", init_spline, draw_spline, release_spline,
+        refresh_spline, init_spline, NULL, &spline_opts,
+        30000, -6, 2048, 1, 64, 0.3, (char *) "",
+        (char *) "Shows colorful moving splines", 0, NULL},
+#endif
+#ifdef MODE_sproingies
+       {(char *) "sproingies", init_sproingies, draw_sproingies, release_sproingies,
+        refresh_sproingies, init_sproingies, NULL, &sproingies_opts,
+        1000, 5, 0, 400, 64, 1.0, (char *) "",
+  (char *) "Shows Sproingies!  Nontoxic.  Safe for pets and small children", 0, NULL},
+#endif
+#ifdef MODE_stairs
+       {(char *) "stairs", init_stairs, draw_stairs, release_stairs,
+        draw_stairs, change_stairs, NULL, &stairs_opts,
+        200000, 0, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows some Infinite Stairs, an Escher-like scene", 0, NULL},
+#endif
+#ifdef MODE_star
+       {(char *) "star", init_star, draw_star, release_star,
+        refresh_star, init_star, NULL, &star_opts,
+        75000, 100, 1, 100, 64, 0.3, (char *) "",
+        (char *) "Shows a star field with a twist", 0, NULL},
+#endif
+#ifdef MODE_starfish
+       {(char *) "starfish", init_starfish, draw_starfish, release_starfish,
+        init_starfish, init_starfish, NULL, &starfish_opts,
+        2000, 1, 1000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows starfish", 0, NULL},
+#endif
+#ifdef MODE_strange
+       {(char *) "strange", init_strange, draw_strange, release_strange,
+        init_strange, init_strange, NULL, &strange_opts,
+        1000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows strange attractors", 0, NULL},
+#endif
+#ifdef MODE_superquadrics
+       {(char *) "superquadrics", init_superquadrics, draw_superquadrics, release_superquadrics,
+        refresh_superquadrics, init_superquadrics, NULL, &superquadrics_opts,
+        1000, 25, 40, 1, 64, 1.0, (char *) "",
+        (char *) "Shows 3D mathematical shapes", 0, NULL},
+#endif
+#ifdef MODE_swarm
+       {(char *) "swarm", init_swarm, draw_swarm, release_swarm,
+        refresh_swarm, init_swarm, NULL, &swarm_opts,
+        15000, -100, 1, -100, 64, 1.0, (char *) "",
+        (char *) "Shows a swarm of bees following a wasp", 0, NULL},
+#endif
+#ifdef MODE_swirl
+       {(char *) "swirl", init_swirl, draw_swirl, release_swirl,
+        refresh_swirl, init_swirl, NULL, &swirl_opts,
+        5000, 5, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows animated swirling patterns", 0, NULL},
+#endif
+#ifdef MODE_t3d
+       {(char *) "t3d", init_t3d, draw_t3d, release_t3d,
+        refresh_t3d, init_t3d, NULL, &t3d_opts,
+        250000, 1, 60000, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a Flying Balls Clock Demo", 0, NULL},
+#endif
+#ifdef MODE_tetris
+       {(char *) "tetris", init_tetris, draw_tetris, release_tetris,
+        refresh_tetris, change_tetris, NULL, &tetris_opts,
+        50000, 1, 1, -100, 64, 1.0, (char *) "",
+        (char *) "Shows an autoplaying tetris game", 0, NULL},
+#endif
+#ifdef MODE_text3d
+       {(char *) "text3d", init_text3d, draw_text3d, release_text3d,
+        refresh_text3d, change_text3d, NULL, &text3d_opts,
+        100000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows 3D text", 0, NULL},
+#endif
+#ifdef MODE_thornbird
+       {(char *) "thornbird", init_thornbird, draw_thornbird, release_thornbird,
+        refresh_thornbird, init_thornbird, NULL, &thornbird_opts,
+        1000, 800, 16, 1, 64, 1.0, (char *) "",
+        (char *) "Shows an animated bird in a thorn bush fractal map", 0, NULL},
+#endif
+#ifdef MODE_tik_tak
+       {(char *) "tik_tak", init_tik_tak, draw_tik_tak, release_tik_tak,
+        refresh_tik_tak, init_tik_tak, NULL, &tik_tak_opts,
+        60000, -20, 200, -1000, 64, 1.0, (char *) "",
+        (char *) "Shows rotating polygons", 0, NULL},
+#endif
+#ifdef MODE_triangle
+       {(char *) "triangle", init_triangle, draw_triangle, release_triangle,
+        refresh_triangle, init_triangle, NULL, &triangle_opts,
+        10000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a triangle mountain range", 0, NULL},
+#endif
+#ifdef MODE_tube
+       {(char *) "tube", init_tube, draw_tube, release_tube,
+        NULL, init_tube, NULL, &tube_opts,
+        25000, -9, 20000, -200, 64, 1.0, (char *) "",
+        (char *) "Shows an animated tube", 0, NULL},
+#endif
+#ifdef MODE_turtle
+       {(char *) "turtle", init_turtle, draw_turtle, release_turtle,
+        init_turtle, init_turtle, NULL, &turtle_opts,
+        1000000, 1, 20, 1, 64, 1.0, (char *) "",
+        (char *) "Shows turtle fractals", 0, NULL},
+#endif
+#ifdef MODE_vines
+       {(char *) "vines", init_vines, draw_vines, release_vines,
+        refresh_vines, init_vines, NULL, &vines_opts,
+        200000, 0, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows fractals", 0, NULL},
+#endif
+#ifdef MODE_voters
+       {(char *) "voters", init_voters, draw_voters, release_voters,
+        refresh_voters, init_voters, NULL, &voters_opts,
+        1000, 0, 327670, 0, 64, 1.0, (char *) "",
+        (char *) "Shows Dewdney's Voters", 0, NULL},
+#endif
+#ifdef MODE_wator
+       {(char *) "wator", init_wator, draw_wator, release_wator,
+        refresh_wator, init_wator, NULL, &wator_opts,
+        750000, 1, 32767, 0, 64, 1.0, (char *) "",
+        (char *) "Shows Dewdney's Water-Torus planet of fish and sharks", 0, NULL},
+#endif
+#ifdef MODE_wire
+       {(char *) "wire", init_wire, draw_wire, release_wire,
+        refresh_wire, init_wire, NULL, &wire_opts,
+        500000, 1000, 150, -8, 64, 1.0, (char *) "",
+        (char *) "Shows a random circuit with 2 electrons", 0, NULL},
+#endif
+#ifdef MODE_world
+       {(char *) "world", init_world, draw_world, release_world,
+        refresh_world, init_world, NULL, &world_opts,
+        100000, -16, 1, 1, 64, 0.3, (char *) "",
+        (char *) "Shows spinning Earths", 0, NULL},
+#endif
+#ifdef MODE_worm
+       {(char *) "worm", init_worm, draw_worm, release_worm,
+        refresh_worm, init_worm, NULL, &worm_opts,
+        17000, -20, 10, -3, 64, 1.0, (char *) "",
+        (char *) "Shows wiggly worms", 0, NULL},
+#endif
+#ifdef MODE_xcl
+       {(char *) "xcl", init_xcl, draw_xcl, release_xcl,
+        draw_xcl, init_xcl, NULL, &xcl_opts,
+        20000, -3, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a control line combat model race", 0, NULL},
+#endif
+#ifdef MODE_xjack
+       {(char *) "xjack", init_xjack, draw_xjack, release_xjack,
+        init_xjack, init_xjack, NULL, &xjack_opts,
+        50000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows Jack having one of those days", 0, NULL},
+#endif
+
+/* SPECIAL MODES */
+       {(char *) "blank", init_blank, draw_blank, release_blank,
+        refresh_blank, init_blank, NULL, &blank_opts,
+        3000000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows nothing but a black screen", 0, NULL},
+#ifdef MODE_run
+       {(char *) "run", init_run, draw_run, release_run,
+        refresh_run, init_run, NULL, &run_opts,
+        3000000, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows another xprogram", 0, NULL},
+#endif
+#ifdef MODE_bomb
+       {(char *) "bomb", init_bomb, draw_bomb, release_bomb,
+        refresh_bomb, change_bomb, NULL, &bomb_opts,
+        100000, 10, 20, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a bomb and will autologout after a time", 0, NULL},
+       {(char *) "random", init_random, draw_random, release_random,
+        refresh_random, change_random, NULL, &random_opts,
+        1, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a random mode (except blank and bomb)", 0, NULL},
+#else
+       {(char *) "random", init_random, draw_random, release_random,
+        refresh_random, change_random, NULL, &random_opts,
+        1, 1, 1, 1, 64, 1.0, (char *) "",
+        (char *) "Shows a random mode (except blank)", 0, NULL},
+#endif
+};
+
+int         numprocs = sizeof (LockProcs) / sizeof (LockProcs[0]);
+
+#else /* #ifndef USE_MODULES */
+
+#include <sys/stat.h>
+#include <pwd.h>
+#include <dlfcn.h>
+#include <errno.h>
+
+LockStruct *LockProcs = NULL;
+void      **LoadedModules = NULL;      /* save module handles to unload them later */
+int         numprocs = 0;
+
+/*-
+ * I use a stack to save information about each module until they are
+ * all loaded because I can not allocate LockProcs until I know how many
+ * modules there are.
+ */
+typedef struct stack {
+       struct stack *next;
+       LockStruct *lock;
+       void       *mod;        /* pointer to module */
+} stack;
+
+/*-
+ * compare function to use with qsort, to sort the list of modules
+ * after loading them.
+ */
+static int
+lock_compare(const void *a, const void *b)
+{
+       const LockStruct *A = *((LockStruct **) a), *B = *((LockStruct **) b);
+
+       return strcmp(A->cmdline_arg, B->cmdline_arg);
+}
+
+/*-
+ * Does tilde expansion on path, and expands any occurrence of %S to
+ * the default modulepath.  Returns a pointer to a static string
+ * containing the expanded path.  This will be overwritten by
+ * subsequent calls to ExpandPath.
+ */
+static char *
+ExpandPath(char *path)
+{
+       static char expandedpath[1024];
+       char       *ep = expandedpath;
+
+       if (path[0] == '~') {   /* find homedir */
+               int         i = 0;
+               char        user[128], *homedir;
+               struct passwd *pw = NULL;
+
+               path++;
+               while (*path && *path != '/')
+                       user[i++] = *path++;
+               user[i] = '\0';
+
+               if (user[0] == '\0') {  /* get this user's homedir */
+                       homedir = getenv("HOME");
+                       if (!homedir) {         /* try password entry */
+                               pw = getpwuid(getuid());
+                               if (!pw) {
+                                       char       *login = getlogin();
+
+                                       if (login)
+                                               pw = getpwnam(login);
+                               }
+                               if (pw)
+                                       homedir = pw->pw_dir;
+                               else
+                                       return NULL;    /* can't expand name */
+                       }
+               } else {        /* refers to another user's home dir */
+                       pw = getpwnam(user);
+                       if (pw)
+                               homedir = pw->pw_dir;
+                       else
+                               return NULL;
+               }
+               (void) strcpy(ep, homedir);
+               ep += strlen(homedir);
+       }                       /* if (path[0] ..  */
+       while (*path) {
+               switch (*path) {
+                       case '%':
+                               path++;
+                               switch (*path) {
+                                       case 'S':
+                                               *ep = '\0';
+                                               (void) strcat(ep, DEF_MODULEPATH);
+                                               ep += strlen(DEF_MODULEPATH);
+                                               break;
+                                       case '%':
+                                               *ep++ = *path++;
+                                               break;
+                                       default:
+                                               path++;
+                                               break;
+                               }
+
+                       default:
+                               *ep++ = *path++;
+                               break;
+               }
+       }
+
+       *ep = '\0';
+       return expandedpath;
+}
+
+/*-
+ * Loads screensaver modules in the directories in path.  path is a
+ * colon separated list of direcories to search in.  LoadModules
+ * searches for files ending in .xlk to load as modules.
+ */
+
+#define nextone (void) fprintf(stderr, "LoadModule: %s: %s\n", cpath, dlerror()); \
+(void) dlclose(mp); \
+(void) free((void *) newstack->lock); \
+(void) free((void *) newstack); \
+continue
+
+void
+LoadModules(char *path)
+{
+       DIR        *dp;
+       struct stat st;
+       struct dirent *ent;
+       char        cpath[128], *p, *thisp;
+       stack      *newstack, *head = NULL;
+       int         count = 0;
+
+       if (path) {
+               p = (char *) malloc(strlen(path) + 1);
+               (void) strcpy(p, path);
+       } else {
+               p = (char *) malloc(1);
+               p[0] = '\0';
+               (void) fprintf(stderr, "%s: LoadModules: modulepath is null\n",
+                              ProgramName);
+       }
+       for (thisp = strtok(p, ": \t"); thisp != NULL; thisp = strtok(NULL, ": \t")) {
+               char       *ep;
+
+               ep = ExpandPath(thisp);
+               if (ep == NULL) {
+                       (void) fprintf(stderr, "%s: LoadModules: Can not expand path - '%s'\n",
+                                      ProgramName, thisp);
+                       continue;
+               } else
+                       thisp = ep;
+
+               dp = opendir(thisp);
+               if (dp == NULL) {
+                       (void) fprintf(stderr, "%s: LoadModules: %s: %s\n", ProgramName,
+                                      thisp, strerror(errno));
+                       continue;
+               }
+               while ((ent = readdir(dp)) != NULL) {
+                       int         len;
+                       void       *mp;
+
+                       if ((len = strlen(ent->d_name)) > 4) {
+                               char       *suf = &ent->d_name[len - 4];        /* check suffix */
+
+                               if (strcmp(suf, ".xlk") != 0)
+                                       continue;
+                       } else
+                               continue;
+
+                       (void) sprintf(cpath, "%s%s%s", thisp,
+                               (thisp[strlen(thisp) - 1] == '/') ? "" : "/",
+                                      ent->d_name);
+                       if (stat(cpath, &st) != 0) {
+                               (void) fprintf(stderr, "%s: LoadModules: %s: %s\n", ProgramName,
+                                              cpath, strerror(errno));
+                               continue;
+                       }
+                       if (!S_ISREG(st.st_mode))       /* make sure it's not a directory */
+                               continue;
+
+                       mp = dlopen(cpath, RTLD_NOW);   /* load module */
+                       if (mp == NULL) {
+                               (void) fprintf(stderr, "%s: LoadModule: %s: %s\n", ProgramName,
+                                              cpath, dlerror());
+                               continue;
+                       } else {
+                               char        descsym[32];
+                               ModStruct  *desc;
+
+                               /*
+                                * The name of the description structure is formed by concatenating
+                                * the name of the module minus the .xlk suffix, and the string
+                                * "_description".
+                                */
+                               (void) sprintf(descsym, "%.*s_description", len - 4, ent->d_name);
+                               desc = (ModStruct *) dlsym(mp, descsym);
+                               if (desc == NULL) {
+                                       (void) fprintf(stderr, "LoadModule: %s: %s\n", descsym, dlerror());
+                                       (void) dlclose(mp);
+                                       continue;
+                               }
+                               /* save information about module on stack. */
+                               newstack = (stack *) malloc(sizeof (stack));
+                               newstack->mod = mp;
+                               newstack->lock = (LockStruct *) malloc(sizeof (LockStruct));
+                               newstack->lock->cmdline_arg = desc->cmdline_arg;
+
+                               if (desc->init_name != NULL) {
+                                       newstack->lock->init_hook = (ModeHook *) dlsym(mp, (char *) desc->init_name);
+                                       if (newstack->lock->init_hook == NULL) {
+                                               nextone;
+                                       }
+                               } else
+                                       newstack->lock->init_hook = NULL;
+                               if (desc->callback_name != NULL) {
+                                       newstack->lock->callback_hook = (ModeHook *) dlsym(mp, desc->callback_name);
+                                       if (newstack->lock->callback_hook == NULL) {
+                                               nextone;
+                                       }
+                               } else
+                                       newstack->lock->callback_hook = NULL;
+                               if (desc->release_name != NULL) {
+                                       newstack->lock->release_hook = (ModeHook *) dlsym(mp, desc->release_name);
+                                       if (newstack->lock->release_hook == NULL) {
+                                               nextone;
+                                       }
+                               } else
+                                       newstack->lock->refresh_hook = NULL;
+                               if (desc->refresh_name != NULL) {
+                                       newstack->lock->refresh_hook = (ModeHook *) dlsym(mp, desc->refresh_name);
+                                       if (newstack->lock->refresh_hook == NULL) {
+                                               nextone;
+                                       }
+                               } else
+                                       newstack->lock->refresh_hook = NULL;
+                               if (desc->change_name != NULL) {
+                                       newstack->lock->change_hook = (ModeHook *) dlsym(mp, desc->change_name);
+                                       if (newstack->lock->change_hook == NULL) {
+                                               nextone;
+                                       }
+                               } else
+                                       newstack->lock->change_hook = NULL;
+                               if (desc->unused_name != NULL) {
+                                       newstack->lock->unused_hook = (ModeHook *) dlsym(mp, desc->unused_name);
+                                       if (newstack->lock->unused_hook == NULL) {
+                                               nextone;
+                                       }
+                               } else
+                                       newstack->lock->unused_hook = NULL;
+                               newstack->lock->msopt = desc->msopt;
+                               newstack->lock->def_delay = desc->def_delay;
+                               newstack->lock->def_count = desc->def_count;
+                               newstack->lock->def_cycles = desc->def_cycles;
+                               newstack->lock->def_size = desc->def_size;
+                               newstack->lock->def_ncolors = desc->def_ncolors;
+                               newstack->lock->def_saturation = desc->def_saturation;
+                               newstack->lock->def_bitmap = desc->def_bitmap;
+                               newstack->lock->desc = desc->desc;
+                               newstack->lock->flags = desc->flags;
+                               newstack->lock->userdata = desc->userdata;
+
+                               newstack->next = head;
+                               head = newstack;
+                               count++;
+                       }       /* if (mp == NULL) .. else */
+               }               /* while ((ent = ...) */
+
+               (void) closedir(dp);
+       }                       /* for (thisp = ... */
+       (void) free((void *) p);
+
+       if (count > 0) {
+               int         i;
+               stack      *discard;
+               LockStruct **locks;
+
+               LoadedModules = (void **) malloc(count * sizeof (void *));
+
+               LockProcs = (LockStruct *) malloc(count * sizeof (LockStruct));
+               locks = (LockStruct **) malloc(count * sizeof (LockStruct *));
+
+               /* Copy module info from stack to locks array temporarily to
+                * sort them. Then copy them to LockProcs.  Also save module
+                * handles in LoadedModules, to be used by UnloadModules()
+                * later.
+                */
+               for (i = 0; i < count; i++) {
+                       LoadedModules[i] = head->mod;
+                       locks[i] = head->lock;
+                       discard = head;
+                       head = head->next;
+                       (void) free((void *) discard);
+               }
+               (void) qsort((void *) locks, count, sizeof (LockStruct *), lock_compare);
+               for (i = 0; i < count; i++) {
+                       (void) memcpy(&LockProcs[i], locks[i], sizeof (LockStruct));
+                       (void) free((void *) locks[i]);
+               }
+               (void) free((void *) locks);
+       }
+       numprocs = count;
+}
+
+void
+UnloadModules()
+{
+       int         i;
+
+       if (LoadedModules != NULL) {
+               for (i = 0; i < numprocs; i++)
+                       (void) dlclose(LoadedModules[i]);
+
+               (void) free((void *) LoadedModules);
+       }
+       if (LockProcs != NULL)
+               (void) free((void *) LockProcs);
+}
+
+#endif /* #ifndef USE_MODULES ... #else */
+
+/* -------------------------------------------------------------------- */
+
+static LockStruct *last_initted_mode = NULL;
+static LockStruct *default_mode = NULL;
+
+/* -------------------------------------------------------------------- */
+
+void
+set_default_mode(LockStruct * ls)
+{
+       default_mode = ls;
+}
+
+/* -------------------------------------------------------------------- */
+
+static void
+set_window_title(ModeInfo * mi)
+{
+       XTextProperty prop;
+       char       *buf;
+       unsigned int status;
+       extern Bool description;
+
+       buf = (char *) malloc(strlen(MI_NAME(mi)) + strlen(MI_DESC(mi)) + 3);
+       (void) sprintf(buf, "%s: %s", MI_NAME(mi), MI_DESC(mi));
+       status = XStringListToTextProperty(&buf, 1, &prop);
+       if (status != 0) {
+               XSetWMName(MI_DISPLAY(mi), MI_WINDOW(mi), &prop);
+               XFree((caddr_t) prop.value);
+       }
+       (void) free((void *) buf);
+       if (MI_IS_ICONIC(mi) && description) {
+               modeDescription(mi);
+       }
+}
+
+/* -------------------------------------------------------------------- */
+
+/*-
+ *    This hook is called prior to calling the init hook of a
+ *      different mode.  It is to inform the mode that it is losing
+ *      control, and should therefore release any dynamically created
+ *      resources.
+ */
+
+void
+call_release_hook(LockStruct * ls, ModeInfo * mi)
+{
+       if (ls == NULL) {
+               return;
+       }
+       MI_LOCKSTRUCT(mi) = ls;
+       if (ls->release_hook != NULL) {
+               ls->release_hook(mi);
+       }
+       ls->flags &= ~(LS_FLAG_INITED);
+
+       last_initted_mode = NULL;
+}
+
+void
+release_last_mode(ModeInfo * mi)
+{
+       if (last_initted_mode == NULL) {
+               return;
+       }
+       call_release_hook(last_initted_mode, mi);
+
+       last_initted_mode = NULL;
+}
+
+/* -------------------------------------------------------------------- */
+
+/*-
+ *    Call the init hook for a mode.  If this mode is not the same
+ *      as the last one, call the release proc for the previous mode
+ *      so that it will surrender its dynamic resources.
+ *      A mode's init hook may be called multiple times, without
+ *      intervening release calls.
+ */
+
+void
+call_init_hook(LockStruct * ls, ModeInfo * mi)
+{
+       if (ls == NULL) {
+               if (default_mode == NULL) {
+                       return;
+               } else {
+                       ls = default_mode;
+               }
+       }
+       if (ls != last_initted_mode) {
+               call_release_hook(last_initted_mode, mi);
+       }
+       MI_LOCKSTRUCT(mi) = ls;
+       set_window_title(mi);
+
+       ls->init_hook(mi);
+
+       ls->flags |= LS_FLAG_INITED;
+       MI_SET_FLAG_STATE(mi, WI_FLAG_JUST_INITTED, True);
+
+       last_initted_mode = ls;
+}
+
+/* -------------------------------------------------------------------- */
+
+/*-
+ *    Call the callback hook for a mode.  This hook is called repeatedly,
+ *      at (approximately) constant time intervals.  The time between calls
+ *      is controlled by the -delay command line option, which is mapped
+ *      to the variable named delay.
+ */
+
+void
+call_callback_hook(LockStruct * ls, ModeInfo * mi)
+{
+       if (ls == NULL) {
+               if (default_mode == NULL) {
+                       return;
+               } else {
+                       ls = default_mode;
+               }
+       }
+       MI_LOCKSTRUCT(mi) = ls;
+
+       ls->callback_hook(mi);
+
+       MI_SET_FLAG_STATE(mi, WI_FLAG_JUST_INITTED, False);
+}
+
+/* -------------------------------------------------------------------- */
+
+/*-
+ *    Window damage has occurred.  If the mode has been initted and
+ *      supplied a refresh proc, call that.  Otherwise call its init
+ *      hook again.
+ */
+
+#define JUST_INITTED(mi)       (MI_FLAG_IS_SET(mi, WI_FLAG_JUST_INITTED))
+
+void
+call_refresh_hook(LockStruct * ls, ModeInfo * mi)
+{
+       if (ls == NULL) {
+               if (default_mode == NULL) {
+                       return;
+               } else {
+                       ls = default_mode;
+               }
+       }
+       MI_LOCKSTRUCT(mi) = ls;
+
+       if (ls->refresh_hook == NULL) {
+               /*
+                * No refresh hook supplied.  If the mode has been
+                * initialized, and the callback has been called at least
+                * once, then call the init hook to do the refresh.
+                * Note that two flags are examined here.  The first
+                * indicates if the mode has ever had its init hook called,
+                * the second is a per-screen flag which indicates
+                * if the draw (callback) hook has been called since the
+                * init hook was called for that screen.
+                * This second test is a hack.  A mode should gracefully
+                * deal with its init hook being called twice in a row.
+                * Once all the modes have been updated, this hack should
+                * be removed.
+                */
+               if (MODE_NOT_INITED(ls) || JUST_INITTED(mi)) {
+                       return;
+               }
+               call_init_hook(ls, mi);
+       } else {
+               ls->refresh_hook(mi);
+       }
+}
+
+/* -------------------------------------------------------------------- */
+
+/*-
+ *    The user has requested a change, by pressing the middle mouse
+ *      button.  Let the mode know about it.
+ */
+
+void
+call_change_hook(LockStruct * ls, ModeInfo * mi)
+{
+       if (ls == NULL) {
+               if (default_mode == NULL) {
+                       return;
+               } else {
+                       ls = default_mode;
+               }
+       }
+       MI_LOCKSTRUCT(mi) = ls;
+
+       if (ls->change_hook != NULL) {
+               ls->change_hook(mi);
+       }
+}
+
+/* -------------------------------------------------------------------- */
diff --git a/xlock/mode.h b/xlock/mode.h
new file mode 100644 (file)
index 0000000..1695c40
--- /dev/null
@@ -0,0 +1,1633 @@
+#ifndef __XLOCK_MODE_H__
+#define __XLOCK_MODE_H__
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident  "@(#)mode.h      4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * mode.h - mode management for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ * xscreensaver code, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 18-Mar-96: Ron Hitchens <ron@idiom.com>
+ *             Extensive revision to define new data types for
+ *             the new mode calling scheme.
+ * 02-Jun-95: Extracted out of resource.c.
+ *
+ */
+
+/*-
+ * Declare external interface routines for supported screen savers.
+ */
+
+/* -------------------------------------------------------------------- */
+
+#ifdef STANDALONE
+
+/* xscreensaver compatibility layer for xlockmore modules. */
+
+/*-
+ * xscreensaver, Copyright (c) 1997, 1998 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * The definitions in this file make it possible to compile an xlockmore
+ * module into a standalone program, and thus use it with xscreensaver.
+ * By Jamie Zawinski <jwz@jwz.org> on 10-May-97; based on the ideas
+ * in the older xlock.h by Charles Hannum <mycroft@ai.mit.edu>.  (I had
+ * to redo it, since xlockmore has diverged so far from xlock...)
+ */
+
+/*-
+ * Accessor macros for the ModeInfo structure
+ */
+
+#define MI_DISPLAY(MI)         ((MI)->dpy)
+#define MI_WINDOW(MI)          ((MI)->window)
+#define MI_NUM_SCREENS(MI)     (1)     /* Only manage one screen at a time; */
+#define MI_SCREEN(MI)          (0)     /*  this might be fragile... */
+#define MI_NPIXELS(MI)         ((MI)->npixels)
+#define MI_PIXEL(MI,N)         ((MI)->pixels[(N)])
+#define MI_VISUAL(MI)          ((MI)->xgwa.visual)
+#define MI_GC(MI)              ((MI)->gc)
+#define MI_PAUSE(MI)           ((MI)->pause)
+#define MI_LEFT_COLOR(MI)      ((MI)->threed_left_color)
+#define MI_RIGHT_COLOR(MI)     ((MI)->threed_right_color)
+#define MI_BOTH_COLOR(MI)      ((MI)->threed_both_color)
+#define MI_NONE_COLOR(MI)      ((MI)->threed_none_color)
+#define MI_DELTA3D(MI)         ((MI)->threed_delta)
+#define MI_CYCLES(MI)          ((MI)->cycles)
+#define MI_BATCHCOUNT(MI)      ((MI)->count)
+#define MI_SIZE(MI)            ((MI)->size)
+#define MI_BITMAP(MI)          ((MI)->bitmap)
+#define MI_WHITE_PIXEL(MI)     ((MI)->white)
+#define MI_BLACK_PIXEL(MI)     ((MI)->black)
+#define MI_WIDTH(MI)   ((MI)->xgwa.width)
+#define MI_HEIGHT(MI)  ((MI)->xgwa.height)
+#define MI_DEPTH(MI)   ((MI)->xgwa.depth)
+#define MI_COLORMAP(MI)        ((MI)->xgwa.colormap)
+#define MI_IS_FULLRANDOM(MI)((MI)->fullrandom)
+#define MI_IS_DEBUG(MI)   ((MI)->verbose)
+#define MI_IS_VERBOSE(MI)   ((MI)->verbose)
+#define MI_IS_INSTALL(MI)   (True)
+#define MI_IS_MONO(MI) (mono_p)
+#define MI_IS_INROOT(MI)       ((MI)->root_p)
+#define MI_IS_INWINDOW(MI)     (!(MI)->root_p)
+#define MI_IS_ICONIC(MI)       (False)
+#define MI_IS_WIREFRAME(MI)    ((MI)->wireframe_p)
+#define MI_IS_FPS(MI)  ((MI)->fps_p)
+#define MI_IS_USE3D(MI)        ((MI)->threed)
+#define MI_COUNT(MI)   ((MI)->count)
+#define MI_NCOLORS(MI)    ((MI)->ncolors)
+#define MI_IS_DRAWN(MI)((MI)->is_drawn)
+
+
+#define MI_CLEARWINDOWCOLORMAP(mi, gc, pixel) \
+{ \
+ XSetForeground(MI_DISPLAY(mi), gc, pixel); \
+ XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc, \
+   0, 0, (unsigned int) MI_WIDTH(mi), (unsigned int) MI_HEIGHT(mi)); \
+}
+#define MI_CLEARWINDOWCOLORMAPFAST(mi, gc, pixel) \
+ MI_CLEARWINDOWCOLORMAP(mi, gc, pixel)
+#define MI_CLEARWINDOWCOLOR(mi, pixel) \
+ MI_CLEARWINDOWCOLORMAP(mi, MI_GC(mi), pixel)
+
+/* #define MI_CLEARWINDOW(mi) XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi)) */
+#define MI_CLEARWINDOW(mi) MI_CLEARWINDOWCOLOR(mi, MI_BLACK_PIXEL(mi))
+
+#include "screenhack.h"
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+typedef struct ModeInfo {
+       Display    *dpy;
+       Window      window;
+       Bool        root_p;
+       int         npixels;
+       unsigned long *pixels;
+       XColor     *colors;
+       Bool        writable_p;
+       unsigned long white;
+       unsigned long black;
+       XWindowAttributes xgwa;
+       GC          gc;
+       long        pause;
+       Bool        fullrandom;
+       Bool        verbose;
+       int         count;
+       int         cycles;
+       int         size;
+       int         ncolors;
+       Bool        threed;
+       long        threed_left_color;
+       long        threed_right_color;
+       long        threed_both_color;
+       long        threed_none_color;
+       long        threed_delta;
+       Bool        wireframe_p;
+       char       *bitmap;
+       Bool        is_drawn;
+        Bool        fps_p;
+} ModeInfo;
+
+typedef enum {
+       t_String, t_Float, t_Int, t_Bool
+} xlockmore_type;
+
+typedef struct {
+       void       *var;
+       char       *name;
+       char       *classname;
+       char       *def;
+       xlockmore_type type;
+} argtype;
+
+typedef struct {
+       char       *opt;
+       char       *desc;
+} OptionStruct;
+
+typedef struct {
+       int         numopts;
+       XrmOptionDescRec *opts;
+       int         numvarsdesc;
+       argtype    *vars;
+       OptionStruct *desc;
+} ModeSpecOpt;
+
+extern void xlockmore_screenhack(Display * dpy, Window window,
+                                Bool want_writable_colors,
+                                Bool want_uniform_colors,
+                                Bool want_smooth_colors,
+                                Bool want_bright_colors,
+                                void        (*hack_init) (ModeInfo *),
+                                void        (*hack_draw) (ModeInfo *),
+                                void        (*hack_free) (ModeInfo *));
+#ifdef USE_GL
+extern Visual *get_gl_visual(Screen * screen, char *name, char *class);
+#endif
+#ifdef __cplusplus
+  }
+#endif
+
+#else /* STANDALONE */
+#ifdef __cplusplus
+  extern "C" {
+#endif
+struct LockStruct_s;
+struct ModeInfo_s;
+
+typedef void (ModeHook) (struct ModeInfo_s *);
+typedef void (HookProc) (struct LockStruct_s *, struct ModeInfo_s *);
+
+typedef struct LockStruct_s {
+       char       *cmdline_arg;        /* mode name */
+       ModeHook   *init_hook;  /* func to init a mode */
+       ModeHook   *callback_hook;      /* func to run (tick) a mode */
+       ModeHook   *release_hook;       /* func to shutdown a mode */
+       ModeHook   *refresh_hook;       /* tells mode to repaint */
+       ModeHook   *change_hook;        /* user wants mode to change */
+       ModeHook   *unused_hook;        /* for future expansion */
+       ModeSpecOpt *msopt;     /* this mode's def resources */
+       int         def_delay;  /* default delay for mode */
+       int         def_count;
+       int         def_cycles;
+       int         def_size;
+       int         def_ncolors;
+       float       def_saturation;
+       char       *def_bitmap;
+       char       *desc;       /* text description of mode */
+       unsigned int flags;     /* state flags for this mode */
+       void       *userdata;   /* for use by the mode */
+} LockStruct;
+
+#define LS_FLAG_INITED         1
+
+typedef struct {
+       Pixmap      pixmap;
+#ifdef ORIGINAL_XPM_PATCH
+       /* Not recommended */
+       Pixmap      bitmap;
+#else
+       int         width, height, graphics_format;
+#endif
+} mailboxInfo;
+
+typedef struct {
+       mailboxInfo mail;
+       mailboxInfo nomail;
+       GC          mbgc;
+} mboxInfo;
+
+typedef struct {
+       Visual     *visual;
+       int         visualclass;        /* visual class name of current window */
+       unsigned int depth;
+       unsigned long red_mask, green_mask, blue_mask;  /* masks of current window */
+       int         colormap_size;      /* colormap of current window */
+       Colormap    colormap;   /* current colormap */
+       Window      window;     /* window used to cover screen */
+       Window      icon;       /* window used during password typein */
+       Window      root;       /* convenience pointer to the root window */
+#ifdef USE_BUTTON_LOGOUT
+       Window      button;
+#endif
+       GC          gc;         /* graphics context for animation */
+       GC          textgc;     /* graphics context used for text rendering */
+       GC          plantextgc; /* graphics context for plan message rendering */
+       XPoint      iconpos;    /* location of top left edge of icon */
+       XPoint      planpos;    /* location of top left edge of message */
+       int         npixels;    /* number of valid entries in pixels */
+       unsigned long *pixels;  /* pixel values in the colormap */
+       unsigned long black_pixel, white_pixel;         /* black and white pixel values */
+       unsigned long bg_pixel, fg_pixel;       /* background and foreground pixel values */
+       unsigned long right_pixel, left_pixel;  /* 3D color pixel values */
+       unsigned long none_pixel, both_pixel;
+       XWindowChanges fullsizeconfigure;
+       mboxInfo    mb;
+       Pixmap      root_pixmap;
+} ScreenInfo;
+
+typedef struct {
+       Display    *display;    /* handle to X display */
+       Screen     *screenptr;  /* ptr to screen info */
+       int         screen;     /* number of current screen */
+       int         real_screen;        /* for debugging */
+       int         num_screens;        /* number screens locked */
+       int         max_screens;        /* max # active screens */
+       Window      window;     /* handle to current window */
+       int         width;      /* width of current window */
+       int         height;     /* height of current window */
+       unsigned int flags;     /* xlock window flags */
+       float       delta3d;
+       Bool        is_drawn;   /*Indicates that enough is drawn for special *
+                                *  erase                                    */
+} WindowInfo;
+#ifdef __cplusplus
+  }
+#endif
+
+#define WI_FLAG_INFO_INITTED   0x001   /* private state flag */
+#define WI_FLAG_ICONIC         0x002
+#define WI_FLAG_MONO           0x004
+#define WI_FLAG_INWINDOW       0x008
+#define WI_FLAG_INROOT         0x010
+#define WI_FLAG_NOLOCK         0x020
+#define WI_FLAG_INSTALL                0x040
+#define WI_FLAG_DEBUG          0x080
+#define WI_FLAG_USE3D          0x100
+#define WI_FLAG_VERBOSE                0x200
+#define WI_FLAG_FULLRANDOM     0x400
+#define WI_FLAG_WIREFRAME      0x800
+#define WI_FLAG_FPS            0x1000
+#define WI_FLAG_JUST_INITTED   0x2000  /* private state flag */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+typedef struct {
+       long        pause;      /* output, set by mode */
+       long        delay;      /* inputs, current settings */
+       int         count;
+       int         cycles;
+       int         size;
+       int         ncolors;
+       float       saturation;
+       char       *bitmap;
+} RunInfo;
+
+typedef struct ModeInfo_s {
+       WindowInfo  windowinfo;
+       ScreenInfo *screeninfo;
+       RunInfo     runinfo;
+       struct LockStruct_s *lockstruct;
+} ModeInfo;
+#ifdef __cplusplus
+  }
+#endif
+
+/* -------------------------------------------------------------------- */
+
+/*-
+ * These are the public interfaces that a mode should use to obtain
+ * information about the display and other environmental parameters.
+ * Everything hangs off a ModeInfo pointer.  A mode should NOT cache
+ * a ModeInfo pointer, the struct it points to is volatile.  The mode
+ * can safely make a copy of the data it points to, however.  But it
+ * is recommended the mode make use of the passed-in pointer and pass
+ * it along to functions it calls.
+ * Use these macros, don't look at the fields directly.  The insides
+ * of the ModeInfo struct are certain to change in the future.
+ */
+
+#define MODE_IS_INITED(ls)     ((ls)->flags & LS_FLAG_INITED)
+#define MODE_NOT_INITED(ls)    ( ! MODE_IS_INITED(ls))
+
+#define MI_DISPLAY(mi)         ((mi)->windowinfo.display)
+#define MI_SCREEN(mi)          ((mi)->windowinfo.screen)
+#define MI_SCREENPTR(mi)       ((mi)->windowinfo.screenptr)
+#define MI_REAL_SCREEN(mi)     ((mi)->windowinfo.real_screen)
+#define MI_NUM_SCREENS(mi)     ((mi)->windowinfo.num_screens)
+#define MI_MAX_SCREENS(mi)     ((mi)->windowinfo.max_screens)
+#define MI_WINDOW(mi)          ((mi)->windowinfo.window)
+#define MI_WIDTH(mi)           ((mi)->windowinfo.width)
+#define MI_HEIGHT(mi)          ((mi)->windowinfo.height)
+#define MI_DELTA3D(mi)         ((mi)->windowinfo.delta3d)
+#define MI_FLAGS(mi)           ((mi)->windowinfo.flags)
+#define MI_IS_DRAWN(mi)                ((mi)->windowinfo.is_drawn)
+#define MI_SET_FLAG_STATE(mi,f,bool) ((mi)->windowinfo.flags = \
+                                       (bool) ? (mi)->windowinfo.flags | f \
+                                       : (mi)->windowinfo.flags & ~(f))
+#define MI_FLAG_IS_SET(mi,f)   ((mi)->windowinfo.flags & f)
+#define MI_FLAG_NOT_SET(mi,f)  ( ! MI_FLAG_IS_SET(mi,f))
+#define MI_IS_ICONIC(mi)       (MI_FLAG_IS_SET (mi, WI_FLAG_ICONIC))
+#define MI_IS_MONO(mi)         (MI_FLAG_IS_SET (mi, WI_FLAG_MONO))
+#define MI_IS_INWINDOW(mi)     (MI_FLAG_IS_SET (mi, WI_FLAG_INWINDOW))
+#define MI_IS_INROOT(mi)       (MI_FLAG_IS_SET (mi, WI_FLAG_INROOT))
+#define MI_IS_NOLOCK(mi)       (MI_FLAG_IS_SET (mi, WI_FLAG_NOLOCK))
+#define MI_IS_INSTALL(mi)      (MI_FLAG_IS_SET (mi, WI_FLAG_INSTALL))
+#define MI_IS_DEBUG(mi)                (MI_FLAG_IS_SET (mi, WI_FLAG_DEBUG))
+#define MI_IS_USE3D(mi)                (MI_FLAG_IS_SET (mi, WI_FLAG_USE3D))
+#define MI_IS_VERBOSE(mi)      (MI_FLAG_IS_SET (mi, WI_FLAG_VERBOSE))
+#define MI_IS_FULLRANDOM(mi)   (MI_FLAG_IS_SET (mi, WI_FLAG_FULLRANDOM))
+#define MI_IS_WIREFRAME(mi)    (MI_FLAG_IS_SET (mi, WI_FLAG_WIREFRAME))
+#define MI_IS_FPS(mi)          (MI_FLAG_IS_SET (mi, WI_FLAG_FPS))
+
+#define MI_SCREENINFO(mi)      ((mi)->screeninfo)
+#define MI_DEPTH(mi)           ((mi)->screeninfo->depth)
+#define MI_VISUAL(mi)          ((mi)->screeninfo->visual)
+#define MI_VISUALCLASS(mi)     ((mi)->screeninfo->visualclass)
+#define MI_COLORMAP_SIZE(mi)   ((mi)->screeninfo->colormap_size)
+#define MI_RED_MASK(mi)                ((mi)->screeninfo->red_mask)
+#define MI_GREEN_MASK(mi)      ((mi)->screeninfo->green_mask)
+#define MI_BLUE_MASK(mi)       ((mi)->screeninfo->blue_mask)
+#define MI_COLORMAP(mi)                ((mi)->screeninfo->colormap)
+#define MI_GC(mi)              ((mi)->screeninfo->gc)
+#define MI_NPIXELS(mi)         ((mi)->screeninfo->npixels)
+#define MI_PIXELS(mi)          ((mi)->screeninfo->pixels)
+#define MI_PIXEL(mi,n)         ((mi)->screeninfo->pixels[n])
+#define MI_BLACK_PIXEL(mi)     ((mi)->screeninfo->black_pixel)
+#define MI_WHITE_PIXEL(mi)     ((mi)->screeninfo->white_pixel)
+#define MI_BG_PIXEL(mi)                ((mi)->screeninfo->bg_pixel)
+#define MI_FG_PIXEL(mi)                ((mi)->screeninfo->fg_pixel)
+#define MI_NONE_COLOR(mi)      ((mi)->screeninfo->none_pixel)  /* -install */
+#define MI_RIGHT_COLOR(mi)     ((mi)->screeninfo->right_pixel)
+#define MI_LEFT_COLOR(mi)      ((mi)->screeninfo->left_pixel)
+#define MI_ROOT_PIXMAP(mi)     ((mi)->screeninfo->root_pixmap)
+
+#define MI_DELAY(mi)           ((mi)->runinfo.delay)
+#define MI_COUNT(mi)           ((mi)->runinfo.count)
+#define MI_CYCLES(mi)          ((mi)->runinfo.cycles)
+#define MI_SIZE(mi)            ((mi)->runinfo.size)
+#define MI_NCOLORS(mi)         ((mi)->runinfo.ncolors)
+#define MI_SATURATION(mi)      ((mi)->runinfo.saturation)
+#define MI_BITMAP(mi)          ((mi)->runinfo.bitmap)
+#define MI_PAUSE(MI)           ((mi)->runinfo.pause)
+
+#define MI_LOCKSTRUCT(mi)      ((mi)->lockstruct)
+#define MI_DEFDELAY(mi)                ((mi)->lockstruct->def_delay)
+#define MI_DEFCOUNT(mi)                ((mi)->lockstruct->def_count)
+#define MI_DEFCYCLES(mi)       ((mi)->lockstruct->def_cycles)
+#define MI_DEFSIZE(mi)         ((mi)->lockstruct->def_size)
+#define MI_DEFNCOLORS(mi)      ((mi)->lockstruct->def_ncolors)
+#define MI_DEFSATURATION(mi)   ((mi)->lockstruct->def_saturation)
+#define MI_DEFBITMAP(mi)       ((mi)->lockstruct->def_bitmap)
+
+#define MI_NAME(mi)            ((mi)->lockstruct->cmdline_arg)
+#define MI_DESC(mi)            ((mi)->lockstruct->desc)
+#define MI_USERDATA(mi)                ((mi)->lockstruct->userdata)
+
+#ifdef SOLARIS2
+/*-
+ * It was acting weird with the first rectangle drawn
+ * on a Ultra2 with TrueColor Solaris2.x in deco mode.
+ * Not sure if other modes are affected... now handled in deco mode.
+ * If it does happen it is probably not as noticable to worry about.
+ */
+#endif
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern void modeDescription(ModeInfo * mi);
+extern void erase_full_window(ModeInfo * mi, GC erase_gc, unsigned long pixel);
+#ifdef __cplusplus
+  }
+#endif
+
+#define MI_CLEARWINDOWCOLORMAP(mi, gc, pixel) \
+{ \
+ erase_full_window( mi , gc , pixel ); \
+}
+#define MI_CLEARWINDOWCOLORMAPFAST(mi, gc, pixel) \
+{ \
+ XSetForeground(MI_DISPLAY(mi), gc, pixel); \
+ if ((MI_WIDTH(mi) >= 2) || (MI_HEIGHT(mi) >= 2)) { \
+ XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc, 1, 1, \
+  (unsigned int) MI_WIDTH(mi) - 2, (unsigned int) MI_HEIGHT(mi) - 2); \
+ XDrawRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc, 0, 0, \
+  (unsigned int) MI_WIDTH(mi) - 1, (unsigned int) MI_HEIGHT(mi) - 1); \
+ } else \
+ XFillRectangle(MI_DISPLAY(mi), MI_WINDOW(mi), gc, 0, 0, \
+  (unsigned int) MI_WIDTH(mi), (unsigned int) MI_HEIGHT(mi)); \
+}
+#define MI_CLEARWINDOWCOLOR(mi, pixel) \
+ MI_CLEARWINDOWCOLORMAP(mi, MI_GC(mi), pixel)
+#if 1
+/*-
+ * XClearWindow with GL or MONO does not always work.
+ */
+#define MI_CLEARWINDOW(mi) MI_CLEARWINDOWCOLOR(mi, MI_BLACK_PIXEL(mi))
+#else
+#define MI_CLEARWINDOW(mi) XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi))
+#endif
+
+/* -------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern HookProc call_init_hook;
+extern HookProc call_callback_hook;
+extern HookProc call_release_hook;
+extern HookProc call_refresh_hook;
+extern HookProc call_change_hook;
+
+extern void set_default_mode(LockStruct *);
+extern void release_last_mode(ModeInfo *);
+
+/* -------------------------------------------------------------------- */
+
+/* if you just want the blank mode... how sad! */
+#ifndef BLANK_ONLY 
+/* comment out following defines to remove modes */
+#ifdef USE_GL
+#define MODE_cage
+#define MODE_fire
+#define MODE_gears
+#define MODE_lament
+#define MODE_moebius
+#define MODE_molecule
+#define MODE_morph3d
+#define MODE_glplanet
+#define MODE_rubik
+#define MODE_sierpinski3d
+#define MODE_sballs
+#define MODE_sproingies
+#define MODE_stairs
+#define MODE_superquadrics
+#ifdef USE_UNSTABLE
+#define MODE_skewb /* under development */
+#ifdef HAVE_CXX
+#if defined( HAVE_TTF ) && defined( HAVE_GLTT )
+#define MODE_text3d
+#endif
+#endif
+#endif
+#define MODE_atlantis
+#define MODE_bubble3d
+#define MODE_pipes
+#define MODE_sproingies
+#ifdef HAVE_CXX
+#define MODE_invert
+#endif
+#endif
+#ifdef HAVE_CXX
+#define MODE_solitare
+#endif
+#ifdef USE_UNSTABLE
+#define MODE_run /* VMS problems as well as --debug problems */
+#ifdef UNDER_DEVELOPMENT
+#if 0
+#ifdef HAVE_CXX
+#define MODE_billiards
+#endif
+#endif
+#endif
+#endif
+#define MODE_ant
+#define MODE_ball
+#define MODE_bat
+#define MODE_blot
+#define MODE_bouboule
+#define MODE_bounce
+#define MODE_braid
+#define MODE_bubble
+#define MODE_bug
+#define MODE_clock
+#define MODE_coral
+#define MODE_crystal
+#define MODE_daisy
+#define MODE_dclock
+/*-
+ * Comment out dclock sub-modes to disable them from random selection.
+ * Useful for disabling y2k and millennium after those countdown dates
+ * have already gone by.
+ */
+/* #define MODE_dclock_y2k */
+/* #define MODE_dclock_millennium */
+#define MODE_decay
+#define MODE_deco
+#define MODE_demon
+#define MODE_dilemma
+#define MODE_discrete
+#define MODE_dragon
+#define MODE_drift
+#define MODE_euler2d
+#define MODE_eyes
+#define MODE_fadeplot
+#define MODE_flag
+#define MODE_flame
+#define MODE_flow
+#define MODE_forest
+#define MODE_galaxy
+#define MODE_goop
+#define MODE_grav
+#define MODE_helix
+#define MODE_hop
+#define MODE_hyper
+#define MODE_ico
+#define MODE_ifs
+#define MODE_image
+#define MODE_juggle
+#define MODE_julia
+#define MODE_kaleid
+#define MODE_kumppa
+#define MODE_laser
+#define MODE_life
+#define MODE_life1d
+#define MODE_life3d
+#define MODE_lightning
+#define MODE_lisa
+#define MODE_lissie
+#define MODE_loop
+#define MODE_lyapunov
+#define MODE_mandelbrot
+#define MODE_marquee
+#define MODE_matrix
+#define MODE_maze
+#define MODE_mountain
+#define MODE_munch
+#define MODE_nose
+#define MODE_pacman
+#define MODE_penrose
+#define MODE_petal
+#define MODE_polyominoes
+#define MODE_puzzle
+#define MODE_pyro
+#define MODE_qix
+#define MODE_roll
+#define MODE_rotor
+#define MODE_scooter /* should be combined with star some day */
+#define MODE_shape
+#define MODE_sierpinski
+#define MODE_slip
+#define MODE_space /* should be combined with star some day */
+#define MODE_sphere
+#define MODE_spiral
+#define MODE_spline
+#define MODE_star
+#define MODE_starfish
+#define MODE_strange
+#define MODE_swarm
+#define MODE_swirl
+#define MODE_t3d
+#define MODE_tetris
+#define MODE_thornbird
+#define MODE_tik_tak
+#define MODE_triangle
+#define MODE_tube
+#define MODE_turtle
+#define MODE_vines
+#define MODE_voters
+#define MODE_wator
+#define MODE_wire
+#define MODE_world
+#define MODE_worm
+#define MODE_xcl
+#define MODE_xjack
+
+#ifdef USE_BOMB
+#define MODE_bomb
+#endif
+#endif
+
+#ifndef USE_MODULES
+
+#ifdef MODE_ant
+extern ModeHook init_ant;
+extern ModeHook draw_ant;
+extern ModeHook release_ant;
+extern ModeHook refresh_ant;
+extern ModeSpecOpt ant_opts;
+#endif
+
+#ifdef MODE_atlantis
+extern ModeHook init_atlantis;
+extern ModeHook draw_atlantis;
+extern ModeHook release_atlantis;
+extern ModeHook refresh_atlantis;
+extern ModeHook change_atlantis;
+extern ModeSpecOpt atlantis_opts;
+#endif
+
+#ifdef MODE_ball
+extern ModeHook init_ball;
+extern ModeHook draw_ball;
+extern ModeHook release_ball;
+extern ModeHook refresh_ball;
+extern ModeSpecOpt ball_opts;
+#endif
+
+#ifdef MODE_bat
+extern ModeHook init_bat;
+extern ModeHook draw_bat;
+extern ModeHook release_bat;
+extern ModeHook refresh_bat;
+extern ModeSpecOpt bat_opts;
+#endif
+
+#ifdef MODE_billiards
+extern ModeHook init_billiards;
+extern ModeHook draw_billiards;
+extern ModeHook release_billiards;
+extern ModeHook refresh_billiards;
+extern ModeSpecOpt billiards_opts;
+#endif
+
+#ifdef MODE_blot
+extern ModeHook init_blot;
+extern ModeHook draw_blot;
+extern ModeHook release_blot;
+extern ModeHook refresh_blot;
+extern ModeSpecOpt blot_opts;
+#endif
+
+#ifdef MODE_bouboule
+extern ModeHook init_bouboule;
+extern ModeHook draw_bouboule;
+extern ModeHook release_bouboule;
+extern ModeHook refresh_bouboule;
+extern ModeSpecOpt bouboule_opts;
+#endif
+
+#ifdef MODE_bounce
+extern ModeHook init_bounce;
+extern ModeHook draw_bounce;
+extern ModeHook release_bounce;
+extern ModeHook refresh_bounce;
+extern ModeSpecOpt bounce_opts;
+#endif
+
+#ifdef MODE_braid
+extern ModeHook init_braid;
+extern ModeHook draw_braid;
+extern ModeHook release_braid;
+extern ModeHook refresh_braid;
+extern ModeSpecOpt braid_opts;
+#endif
+
+#ifdef MODE_bubble
+extern ModeHook init_bubble;
+extern ModeHook draw_bubble;
+extern ModeHook release_bubble;
+extern ModeHook refresh_bubble;
+extern ModeSpecOpt bubble_opts;
+#endif
+
+#ifdef MODE_bubble3d
+extern ModeHook init_bubble3d;
+extern ModeHook draw_bubble3d;
+extern ModeHook release_bubble3d;
+extern ModeHook change_bubble3d;
+extern ModeSpecOpt bubble3d_opts;
+#endif
+
+#ifdef MODE_bug
+extern ModeHook init_bug;
+extern ModeHook draw_bug;
+extern ModeHook release_bug;
+extern ModeHook refresh_bug;
+extern ModeSpecOpt bug_opts;
+#endif
+
+#ifdef MODE_cage
+extern ModeHook init_cage;
+extern ModeHook draw_cage;
+extern ModeHook release_cage;
+extern ModeHook change_cage;
+extern ModeSpecOpt cage_opts;
+#endif
+
+#ifdef MODE_clock
+extern ModeHook init_clock;
+extern ModeHook draw_clock;
+extern ModeHook release_clock;
+extern ModeHook refresh_clock;
+extern ModeSpecOpt clock_opts;
+#endif
+
+#ifdef MODE_coral
+extern ModeHook init_coral;
+extern ModeHook draw_coral;
+extern ModeHook release_coral;
+extern ModeHook refresh_coral;
+extern ModeSpecOpt coral_opts;
+#endif
+
+#ifdef MODE_crystal
+extern ModeHook init_crystal;
+extern ModeHook draw_crystal;
+extern ModeHook release_crystal;
+extern ModeHook refresh_crystal;
+extern ModeSpecOpt crystal_opts;
+#endif
+
+#ifdef MODE_daisy
+extern ModeHook init_daisy;
+extern ModeHook draw_daisy;
+extern ModeHook release_daisy;
+extern ModeHook refresh_daisy;
+extern ModeSpecOpt daisy_opts;
+#endif
+
+#ifdef MODE_dclock
+extern ModeHook init_dclock;
+extern ModeHook draw_dclock;
+extern ModeHook release_dclock;
+extern ModeHook refresh_dclock;
+extern ModeSpecOpt dclock_opts;
+#endif
+
+#ifdef MODE_decay
+extern ModeHook init_decay;
+extern ModeHook draw_decay;
+extern ModeHook release_decay;
+extern ModeHook refresh_decay;
+extern ModeSpecOpt decay_opts;
+#endif
+
+#ifdef MODE_deco
+extern ModeHook init_deco;
+extern ModeHook draw_deco;
+extern ModeHook release_deco;
+extern ModeHook refresh_deco;
+extern ModeSpecOpt deco_opts;
+#endif
+
+#ifdef MODE_demon
+extern ModeHook init_demon;
+extern ModeHook draw_demon;
+extern ModeHook release_demon;
+extern ModeHook refresh_demon;
+extern ModeSpecOpt demon_opts;
+#endif
+
+#ifdef MODE_dilemma
+extern ModeHook init_dilemma;
+extern ModeHook draw_dilemma;
+extern ModeHook release_dilemma;
+extern ModeHook refresh_dilemma;
+extern ModeSpecOpt dilemma_opts;
+#endif
+
+#ifdef MODE_discrete
+extern ModeHook init_discrete;
+extern ModeHook draw_discrete;
+extern ModeHook release_discrete;
+extern ModeHook refresh_discrete;
+extern ModeHook change_discrete;
+extern ModeSpecOpt discrete_opts;
+#endif
+
+#ifdef MODE_dragon
+extern ModeHook init_dragon;
+extern ModeHook draw_dragon;
+extern ModeHook release_dragon;
+extern ModeHook refresh_dragon;
+extern ModeSpecOpt dragon_opts;
+#endif
+
+#ifdef MODE_drift
+extern ModeHook init_drift;
+extern ModeHook draw_drift;
+extern ModeHook release_drift;
+extern ModeHook refresh_drift;
+extern ModeSpecOpt drift_opts;
+#endif
+
+#ifdef MODE_euler2d
+extern ModeHook init_euler2d;
+extern ModeHook draw_euler2d;
+extern ModeHook release_euler2d;
+extern ModeHook refresh_euler2d;
+extern ModeSpecOpt euler2d_opts;
+#endif
+
+#ifdef MODE_eyes
+extern ModeHook init_eyes;
+extern ModeHook draw_eyes;
+extern ModeHook release_eyes;
+extern ModeHook refresh_eyes;
+extern ModeSpecOpt eyes_opts;
+#endif
+
+#ifdef MODE_fadeplot
+extern ModeHook init_fadeplot;
+extern ModeHook draw_fadeplot;
+extern ModeHook release_fadeplot;
+extern ModeHook refresh_fadeplot;
+extern ModeSpecOpt fadeplot_opts;
+#endif
+
+#ifdef MODE_fire
+extern ModeHook init_fire;
+extern ModeHook draw_fire;
+extern ModeHook release_fire;
+extern ModeHook refresh_fire;
+extern ModeHook change_fire;
+extern ModeSpecOpt fire_opts;
+#endif
+
+#ifdef MODE_flag
+extern ModeHook init_flag;
+extern ModeHook draw_flag;
+extern ModeHook release_flag;
+extern ModeHook refresh_flag;
+extern ModeSpecOpt flag_opts;
+#endif
+
+#ifdef MODE_flame
+extern ModeHook init_flame;
+extern ModeHook draw_flame;
+extern ModeHook release_flame;
+extern ModeHook refresh_flame;
+extern ModeSpecOpt flame_opts;
+#endif
+
+#ifdef MODE_flow
+extern ModeHook init_flow;
+extern ModeHook draw_flow;
+extern ModeHook release_flow;
+extern ModeHook refresh_flow;
+extern ModeHook change_flow;
+extern ModeSpecOpt flow_opts;
+#endif
+
+#ifdef MODE_forest
+extern ModeHook init_forest;
+extern ModeHook draw_forest;
+extern ModeHook release_forest;
+extern ModeHook refresh_forest;
+extern ModeSpecOpt forest_opts;
+#endif
+
+#ifdef MODE_galaxy
+extern ModeHook init_galaxy;
+extern ModeHook draw_galaxy;
+extern ModeHook release_galaxy;
+extern ModeHook refresh_galaxy;
+extern ModeSpecOpt galaxy_opts;
+#endif
+
+#ifdef MODE_gears
+extern ModeHook init_gears;
+extern ModeHook draw_gears;
+extern ModeHook release_gears;
+extern ModeSpecOpt gears_opts;
+#endif
+
+#ifdef MODE_glplanet
+extern ModeHook init_glplanet;
+extern ModeHook draw_glplanet;
+extern ModeHook release_glplanet;
+extern ModeSpecOpt glplanet_opts;
+#endif
+
+#ifdef MODE_goop
+extern ModeHook init_goop;
+extern ModeHook draw_goop;
+extern ModeHook release_goop;
+extern ModeSpecOpt goop_opts;
+#endif
+
+#ifdef MODE_grav
+extern ModeHook init_grav;
+extern ModeHook draw_grav;
+extern ModeHook release_grav;
+extern ModeHook refresh_grav;
+extern ModeSpecOpt grav_opts;
+#endif
+
+#ifdef MODE_helix
+extern ModeHook init_helix;
+extern ModeHook draw_helix;
+extern ModeHook release_helix;
+extern ModeHook refresh_helix;
+extern ModeSpecOpt helix_opts;
+#endif
+
+#ifdef MODE_hop
+extern ModeHook init_hop;
+extern ModeHook draw_hop;
+extern ModeHook release_hop;
+extern ModeHook refresh_hop;
+extern ModeSpecOpt hop_opts;
+#endif
+
+#ifdef MODE_hyper
+extern ModeHook init_hyper;
+extern ModeHook draw_hyper;
+extern ModeHook release_hyper;
+extern ModeHook refresh_hyper;
+extern ModeHook change_hyper;
+extern ModeSpecOpt hyper_opts;
+#endif
+
+#ifdef MODE_ico
+extern ModeHook init_ico;
+extern ModeHook draw_ico;
+extern ModeHook release_ico;
+extern ModeHook refresh_ico;
+extern ModeHook change_ico;
+extern ModeSpecOpt ico_opts;
+#endif
+
+#ifdef MODE_ifs
+extern ModeHook init_ifs;
+extern ModeHook draw_ifs;
+extern ModeHook release_ifs;
+extern ModeSpecOpt ifs_opts;
+#endif
+
+#ifdef MODE_image
+extern ModeHook init_image;
+extern ModeHook draw_image;
+extern ModeHook release_image;
+extern ModeHook refresh_image;
+extern ModeSpecOpt image_opts;
+#endif
+
+#ifdef MODE_invert
+extern ModeHook init_invert;
+extern ModeHook draw_invert;
+extern ModeHook release_invert;
+extern ModeSpecOpt invert_opts;
+#endif
+
+
+#ifdef MODE_juggle
+extern ModeHook init_juggle;
+extern ModeHook draw_juggle;
+extern ModeHook release_juggle;
+extern ModeSpecOpt juggle_opts;
+#endif
+#ifdef MODE_julia
+extern ModeHook init_julia;
+extern ModeHook draw_julia;
+extern ModeHook release_julia;
+extern ModeHook refresh_julia;
+extern ModeSpecOpt julia_opts;
+#endif
+
+#ifdef MODE_kaleid
+extern ModeHook init_kaleid;
+extern ModeHook draw_kaleid;
+extern ModeHook release_kaleid;
+extern ModeHook refresh_kaleid;
+extern ModeSpecOpt kaleid_opts;
+#endif
+
+#ifdef MODE_kumppa
+extern ModeHook init_kumppa;
+extern ModeHook draw_kumppa;
+extern ModeHook release_kumppa;
+extern ModeSpecOpt kumppa_opts;
+#endif
+
+#ifdef MODE_lament
+extern ModeHook init_lament;
+extern ModeHook draw_lament;
+extern ModeHook release_lament;
+extern ModeHook change_lament;
+extern ModeSpecOpt lament_opts;
+#endif
+
+#ifdef MODE_laser
+extern ModeHook init_laser;
+extern ModeHook draw_laser;
+extern ModeHook release_laser;
+extern ModeHook refresh_laser;
+extern ModeSpecOpt laser_opts;
+#endif
+
+#ifdef MODE_life
+extern ModeHook init_life;
+extern ModeHook draw_life;
+extern ModeHook release_life;
+extern ModeHook refresh_life;
+extern ModeHook change_life;
+extern ModeSpecOpt life_opts;
+#endif
+
+#ifdef MODE_life1d
+extern ModeHook init_life1d;
+extern ModeHook draw_life1d;
+extern ModeHook release_life1d;
+extern ModeHook refresh_life1d;
+extern ModeSpecOpt life1d_opts;
+#endif
+
+#ifdef MODE_life3d
+extern ModeHook init_life3d;
+extern ModeHook draw_life3d;
+extern ModeHook release_life3d;
+extern ModeHook refresh_life3d;
+extern ModeHook change_life3d;
+extern ModeSpecOpt life3d_opts;
+#endif
+
+#ifdef MODE_lightning
+extern ModeHook init_lightning;
+extern ModeHook draw_lightning;
+extern ModeHook release_lightning;
+extern ModeHook refresh_lightning;
+extern ModeSpecOpt lightning_opts;
+#endif
+
+#ifdef MODE_lisa
+extern ModeHook init_lisa;
+extern ModeHook draw_lisa;
+extern ModeHook release_lisa;
+extern ModeHook refresh_lisa;
+extern ModeHook change_lisa;
+extern ModeSpecOpt lisa_opts;
+#endif
+
+#ifdef MODE_lissie
+extern ModeHook init_lissie;
+extern ModeHook draw_lissie;
+extern ModeHook release_lissie;
+extern ModeHook refresh_lissie;
+extern ModeSpecOpt lissie_opts;
+#endif
+
+#ifdef MODE_loop
+extern ModeHook init_loop;
+extern ModeHook draw_loop;
+extern ModeHook release_loop;
+extern ModeHook refresh_loop;
+extern ModeSpecOpt loop_opts;
+#endif
+
+#ifdef MODE_lyapunov
+extern ModeHook init_lyapunov;
+extern ModeHook draw_lyapunov;
+extern ModeHook release_lyapunov;
+extern ModeHook refresh_lyapunov;
+extern ModeSpecOpt lyapunov_opts;
+#endif
+
+#ifdef MODE_mandelbrot
+extern ModeHook init_mandelbrot;
+extern ModeHook draw_mandelbrot;
+extern ModeHook release_mandelbrot;
+extern ModeHook refresh_mandelbrot;
+extern ModeSpecOpt mandelbrot_opts;
+#endif
+
+#ifdef MODE_marquee
+extern ModeHook init_marquee;
+extern ModeHook draw_marquee;
+extern ModeHook release_marquee;
+extern ModeSpecOpt marquee_opts;
+#endif
+
+#ifdef MODE_matrix
+extern ModeHook init_matrix;
+extern ModeHook draw_matrix;
+extern ModeHook release_matrix;
+extern ModeHook refresh_matrix;
+extern ModeHook change_matrix;
+extern ModeSpecOpt matrix_opts;
+#endif
+
+#ifdef MODE_maze
+extern ModeHook init_maze;
+extern ModeHook draw_maze;
+extern ModeHook release_maze;
+extern ModeHook refresh_maze;
+extern ModeSpecOpt maze_opts;
+#endif
+
+#ifdef MODE_moebius
+extern ModeHook init_moebius;
+extern ModeHook draw_moebius;
+extern ModeHook release_moebius;
+extern ModeHook change_moebius;
+extern ModeSpecOpt moebius_opts;
+#endif
+
+#ifdef MODE_molecule
+extern ModeHook init_molecule;
+extern ModeHook draw_molecule;
+extern ModeHook release_molecule;
+extern ModeSpecOpt molecule_opts;
+#endif
+
+#ifdef MODE_morph3d
+extern ModeHook init_morph3d;
+extern ModeHook draw_morph3d;
+extern ModeHook release_morph3d;
+extern ModeHook change_morph3d;
+extern ModeSpecOpt morph3d_opts;
+#endif
+
+#ifdef MODE_mountain
+extern ModeHook init_mountain;
+extern ModeHook draw_mountain;
+extern ModeHook release_mountain;
+extern ModeHook refresh_mountain;
+extern ModeSpecOpt mountain_opts;
+#endif
+
+#ifdef MODE_munch
+extern ModeHook init_munch;
+extern ModeHook draw_munch;
+extern ModeHook release_munch;
+extern ModeSpecOpt munch_opts;
+#endif
+
+#ifdef MODE_nose
+extern ModeHook init_nose;
+extern ModeHook draw_nose;
+extern ModeHook release_nose;
+extern ModeHook refresh_nose;
+extern ModeSpecOpt nose_opts;
+#endif
+
+#ifdef MODE_pacman
+extern ModeHook init_pacman;
+extern ModeHook draw_pacman;
+extern ModeHook release_pacman;
+extern ModeHook refresh_pacman;
+extern ModeSpecOpt pacman_opts;
+#endif
+
+#ifdef MODE_penrose
+extern ModeHook init_penrose;
+extern ModeHook draw_penrose;
+extern ModeHook release_penrose;
+
+#if 0
+extern ModeHook refresh_penrose;       /* Needed */
+#endif
+extern ModeSpecOpt penrose_opts;
+#endif
+
+#ifdef MODE_petal
+extern ModeHook init_petal;
+extern ModeHook draw_petal;
+extern ModeHook release_petal;
+extern ModeHook refresh_petal;
+extern ModeSpecOpt petal_opts;
+#endif
+
+#ifdef MODE_pipes
+extern ModeHook init_pipes;
+extern ModeHook draw_pipes;
+extern ModeHook release_pipes;
+extern ModeHook refresh_pipes;
+extern ModeHook change_pipes;
+extern ModeSpecOpt pipes_opts;
+#endif
+
+#ifdef MODE_polyominoes
+extern ModeHook init_polyominoes;
+extern ModeHook draw_polyominoes;
+extern ModeHook release_polyominoes;
+extern ModeHook refresh_polyominoes;
+extern ModeSpecOpt polyominoes_opts;
+#endif
+
+#ifdef MODE_puzzle
+extern ModeHook init_puzzle;
+extern ModeHook draw_puzzle;
+extern ModeHook release_puzzle;
+
+#if 0
+extern ModeHook refresh_puzzle;        /* Needed */
+#endif
+extern ModeSpecOpt puzzle_opts;
+#endif
+
+#ifdef MODE_pyro
+extern ModeHook init_pyro;
+extern ModeHook draw_pyro;
+extern ModeHook release_pyro;
+extern ModeHook refresh_pyro;
+extern ModeSpecOpt pyro_opts;
+#endif
+
+#ifdef MODE_qix
+extern ModeHook init_qix;
+extern ModeHook draw_qix;
+extern ModeHook release_qix;
+extern ModeHook refresh_qix;
+extern ModeSpecOpt qix_opts;
+#endif
+
+#ifdef MODE_roll
+extern ModeHook init_roll;
+extern ModeHook draw_roll;
+extern ModeHook release_roll;
+extern ModeHook refresh_roll;
+extern ModeSpecOpt roll_opts;
+#endif
+
+#ifdef MODE_rotor
+extern ModeHook init_rotor;
+extern ModeHook draw_rotor;
+extern ModeHook release_rotor;
+extern ModeHook refresh_rotor;
+extern ModeSpecOpt rotor_opts;
+#endif
+
+#ifdef MODE_rubik
+extern ModeHook init_rubik;
+extern ModeHook draw_rubik;
+extern ModeHook release_rubik;
+extern ModeHook change_rubik;
+extern ModeSpecOpt rubik_opts;
+#endif
+
+#ifdef MODE_sballs
+extern ModeHook init_sballs;
+extern ModeHook draw_sballs;
+extern ModeHook release_sballs;
+extern ModeHook refresh_sballs;
+extern ModeHook change_sballs;
+extern ModeSpecOpt sballs_opts;
+#endif
+
+#ifdef MODE_scooter
+extern ModeHook init_scooter;
+extern ModeHook draw_scooter;
+extern ModeHook release_scooter;
+extern ModeHook refresh_scooter;
+extern ModeHook change_scooter;
+extern ModeSpecOpt scooter_opts;
+#endif
+
+#ifdef MODE_shape
+extern ModeHook init_shape;
+extern ModeHook draw_shape;
+extern ModeHook release_shape;
+extern ModeHook refresh_shape;
+extern ModeSpecOpt shape_opts;
+#endif
+
+#ifdef MODE_sierpinski
+extern ModeHook init_sierpinski;
+extern ModeHook draw_sierpinski;
+extern ModeHook release_sierpinski;
+extern ModeHook refresh_sierpinski;
+extern ModeSpecOpt sierpinski_opts;
+#endif
+
+#ifdef MODE_sierpinski3d
+extern ModeHook init_gasket;
+extern ModeHook draw_gasket;
+extern ModeHook release_gasket;
+extern ModeSpecOpt gasket_opts;
+#endif
+
+#ifdef MODE_skewb
+extern ModeHook init_skewb;
+extern ModeHook draw_skewb;
+extern ModeHook release_skewb;
+extern ModeHook change_skewb;
+extern ModeSpecOpt skewb_opts;
+#endif
+
+#ifdef MODE_slip
+extern ModeHook init_slip;
+extern ModeHook draw_slip;
+extern ModeHook release_slip;
+
+#if 0
+extern ModeHook refresh_slip;  /* Probably not practical */
+#endif
+extern ModeSpecOpt slip_opts;
+#endif
+
+#ifdef MODE_solitare
+extern ModeHook init_solitare;
+extern ModeHook draw_solitare;
+extern ModeHook release_solitare;
+extern ModeHook refresh_solitare;
+extern ModeSpecOpt solitare_opts;
+#endif
+
+#ifdef MODE_space
+extern ModeHook init_space;
+extern ModeHook draw_space;
+extern ModeHook release_space;
+extern ModeHook refresh_space;
+extern ModeSpecOpt space_opts;
+#endif
+
+#ifdef MODE_sphere
+extern ModeHook init_sphere;
+extern ModeHook draw_sphere;
+extern ModeHook release_sphere;
+extern ModeHook refresh_sphere;
+extern ModeSpecOpt sphere_opts;
+#endif
+
+#ifdef MODE_spiral
+extern ModeHook init_spiral;
+extern ModeHook draw_spiral;
+extern ModeHook release_spiral;
+extern ModeHook refresh_spiral;
+extern ModeSpecOpt spiral_opts;
+#endif
+
+#ifdef MODE_spline
+extern ModeHook init_spline;
+extern ModeHook draw_spline;
+extern ModeHook release_spline;
+extern ModeHook refresh_spline;
+extern ModeSpecOpt spline_opts;
+#endif
+
+#ifdef MODE_sproingies
+extern ModeHook init_sproingies;
+extern ModeHook draw_sproingies;
+extern ModeHook release_sproingies;
+extern ModeHook refresh_sproingies;
+extern ModeSpecOpt sproingies_opts;
+#endif
+
+#ifdef MODE_stairs
+extern ModeHook init_stairs;
+extern ModeHook draw_stairs;
+extern ModeHook release_stairs;
+extern ModeHook refresh_stairs;
+extern ModeHook change_stairs;
+extern ModeSpecOpt stairs_opts;
+#endif
+
+#ifdef MODE_star
+extern ModeHook init_star;
+extern ModeHook draw_star;
+extern ModeHook release_star;
+extern ModeHook refresh_star;
+extern ModeSpecOpt star_opts;
+#endif
+
+#ifdef MODE_starfish
+extern ModeHook init_starfish;
+extern ModeHook draw_starfish;
+extern ModeHook release_starfish;
+extern ModeSpecOpt starfish_opts;
+#endif
+
+#ifdef MODE_strange
+extern ModeHook init_strange;
+extern ModeHook draw_strange;
+extern ModeHook release_strange;
+extern ModeSpecOpt strange_opts;
+#endif
+
+#ifdef MODE_superquadrics
+extern ModeHook init_superquadrics;
+extern ModeHook draw_superquadrics;
+extern ModeHook release_superquadrics;
+extern ModeHook refresh_superquadrics;
+extern ModeSpecOpt superquadrics_opts;
+#endif
+
+#ifdef MODE_swarm
+extern ModeHook init_swarm;
+extern ModeHook draw_swarm;
+extern ModeHook release_swarm;
+extern ModeHook refresh_swarm;
+extern ModeSpecOpt swarm_opts;
+#endif
+
+#ifdef MODE_swirl
+extern ModeHook init_swirl;
+extern ModeHook draw_swirl;
+extern ModeHook release_swirl;
+extern ModeHook refresh_swirl;
+extern ModeSpecOpt swirl_opts;
+#endif
+
+#ifdef MODE_t3d
+extern ModeHook init_t3d;
+extern ModeHook draw_t3d;
+extern ModeHook release_t3d;
+extern ModeHook refresh_t3d;
+extern ModeSpecOpt t3d_opts;
+#endif
+
+#ifdef MODE_tetris
+extern ModeHook init_tetris;
+extern ModeHook draw_tetris;
+extern ModeHook release_tetris;
+extern ModeHook refresh_tetris;
+extern ModeHook change_tetris;
+extern ModeSpecOpt tetris_opts;
+#endif
+
+#ifdef MODE_text3d
+extern ModeHook init_text3d;
+extern ModeHook draw_text3d;
+extern ModeHook release_text3d;
+extern ModeHook refresh_text3d;
+extern ModeHook change_text3d;
+extern ModeSpecOpt text3d_opts;
+#endif
+
+#ifdef MODE_thornbird
+extern ModeHook init_thornbird;
+extern ModeHook draw_thornbird;
+extern ModeHook release_thornbird;
+extern ModeHook refresh_thornbird;
+extern ModeHook change_thornbird;
+extern ModeSpecOpt thornbird_opts;
+#endif
+
+#ifdef MODE_tik_tak
+extern ModeHook init_tik_tak;
+extern ModeHook draw_tik_tak;
+extern ModeHook release_tik_tak;
+extern ModeHook refresh_tik_tak;
+extern ModeSpecOpt tik_tak_opts;
+#endif
+
+#ifdef MODE_triangle
+extern ModeHook init_triangle;
+extern ModeHook draw_triangle;
+extern ModeHook release_triangle;
+extern ModeHook refresh_triangle;
+extern ModeSpecOpt triangle_opts;
+#endif
+
+#ifdef MODE_tube
+extern ModeHook init_tube;
+extern ModeHook draw_tube;
+extern ModeHook release_tube;
+extern ModeHook refresh_tube;
+extern ModeSpecOpt tube_opts;
+#endif
+
+#ifdef MODE_turtle
+extern ModeHook init_turtle;
+extern ModeHook draw_turtle;
+extern ModeHook release_turtle;
+extern ModeHook refresh_turtle;
+extern ModeSpecOpt turtle_opts;
+#endif
+
+#ifdef MODE_vines
+extern ModeHook init_vines;
+extern ModeHook draw_vines;
+extern ModeHook release_vines;
+extern ModeHook refresh_vines;
+extern ModeSpecOpt vines_opts;
+#endif
+
+#ifdef MODE_voters
+extern ModeHook init_voters;
+extern ModeHook draw_voters;
+extern ModeHook release_voters;
+extern ModeHook refresh_voters;
+extern ModeSpecOpt voters_opts;
+#endif
+
+#ifdef MODE_wator
+extern ModeHook init_wator;
+extern ModeHook draw_wator;
+extern ModeHook release_wator;
+extern ModeHook refresh_wator;
+extern ModeSpecOpt wator_opts;
+#endif
+
+#ifdef MODE_wire
+extern ModeHook init_wire;
+extern ModeHook draw_wire;
+extern ModeHook release_wire;
+extern ModeHook refresh_wire;
+extern ModeSpecOpt wire_opts;
+#endif
+
+#ifdef MODE_world
+extern ModeHook init_world;
+extern ModeHook draw_world;
+extern ModeHook release_world;
+extern ModeHook refresh_world;
+extern ModeSpecOpt world_opts;
+#endif
+
+#ifdef MODE_worm
+extern ModeHook init_worm;
+extern ModeHook draw_worm;
+extern ModeHook release_worm;
+extern ModeHook refresh_worm;
+extern ModeSpecOpt worm_opts;
+#endif
+
+#ifdef MODE_xcl
+extern ModeHook init_xcl;
+extern ModeHook draw_xcl;
+extern ModeHook release_xcl;
+extern ModeSpecOpt xcl_opts;
+#endif
+
+#ifdef MODE_xjack
+extern ModeHook init_xjack;
+extern ModeHook draw_xjack;
+extern ModeHook release_xjack;
+extern ModeSpecOpt xjack_opts;
+#endif
+
+extern ModeHook init_blank;
+extern ModeHook draw_blank;
+extern ModeHook release_blank;
+extern ModeHook refresh_blank;
+extern ModeSpecOpt blank_opts;
+
+#ifdef MODE_run
+extern ModeHook init_run;
+extern ModeHook draw_run;
+extern ModeHook release_run;
+extern ModeHook refresh_run;
+extern ModeSpecOpt run_opts;
+#endif
+
+#ifdef MODE_bomb
+extern ModeHook init_bomb;
+extern ModeHook draw_bomb;
+extern ModeHook release_bomb;
+extern ModeHook refresh_bomb;
+extern ModeHook change_bomb;
+extern ModeSpecOpt bomb_opts;
+#endif
+
+extern ModeHook init_random;
+extern ModeHook draw_random;
+extern ModeHook release_random;
+extern ModeHook refresh_random;
+extern ModeHook change_random;
+extern ModeSpecOpt random_opts;
+
+extern LockStruct LockProcs[];
+
+#else /* #ifndef USE_MODULES */
+
+extern void LoadModules(char *);
+extern void UnloadModules();
+
+extern LockStruct *LockProcs;
+extern void **LoadedModules;   /* save handles on loaded modules for closing */
+
+#endif
+
+extern int  numprocs;
+
+#ifdef __cplusplus
+  }
+#endif
+
+#endif /* STANDALONE */
+/* -------------------------------------------------------------------- */
+#endif /* __XLOCK_MODE_H__ */
diff --git a/xlock/parsecmd.c b/xlock/parsecmd.c
new file mode 100644 (file)
index 0000000..ff6198f
--- /dev/null
@@ -0,0 +1,272 @@
+/* Taken from X11R6.4 ParseCmd.c
+   Modified so it does not change (or shadow) argv and argc.
+   This is only tested for a few cases in the switch.
+   This is needed if one has multiple use options to set ...
+   like a program.a.optname1 and program.b.optname1 .
+   One can use this to set the options and then run the real
+   XrmParseCommand on a null XrmDatabase to have it
+   then modify argv and argc for checking purposes.
+ */
+
+/* $TOG: ParseCmd.c /main/26 1998/02/06 17:46:14 kaleb $ */
+
+/***********************************************************
+
+Copyright 1987, 1988, 1998  The Open Group
+
+All Rights Reserved.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+/* XrmParseCommand()
+
+   Parse command line and store argument values into resource database
+
+   Allows any un-ambiguous abbreviation for an option name, but requires
+   that the table be ordered with any options that are prefixes of
+   other options appearing before the longer version in the table.
+*/
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+
+#include <X11/Xlib.h>
+#include <X11/Xresource.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void _XReportParseError(XrmOptionDescRec *arg, char *msg)
+{
+    (void) fprintf(stderr, "Error parsing argument \"%s\" (%s); %s\n",
+                  arg->option, arg->specifier, msg);
+    exit(1);
+}
+
+void
+XlockrmParseCommand(
+    XrmDatabase                *pdb,           /* data base */
+    register XrmOptionDescList options, /* pointer to table of valid options */
+    int                        num_options,    /* number of options                 */
+    char       *prefix,        /* name to prefix resources with     */
+    int                        *arg_c,         /* address of argument count         */
+    char               **arg_v)                /* argument list (command line)      */
+{
+    int                foundOption;
+    char               **argsave;
+    register int       i, myargc;
+    XrmBinding         bindings[100];
+    XrmQuark           quarks[100];
+    XrmBinding         *start_bindings;
+    XrmQuark           *start_quarks;
+    char               *optP, *argP = NULL, optchar, argchar = '\0';
+    int                        matches;
+    enum {DontCare, Check, NotSorted, Sorted} table_is_sorted;
+#if 0
+    char               **argend;
+#endif
+
+#define PutCommandResource(value_str)                          \
+    {                                                          \
+    XrmStringToBindingQuarkList(                               \
+       options[i].specifier, start_bindings, start_quarks);    \
+    XrmQPutStringResource(pdb, bindings, quarks, value_str);    \
+    } /* PutCommandResource */
+
+    myargc = (*arg_c);
+#if 0
+    argend = arg_v + myargc;
+    argsave = ++arg_v;
+#else
+    argsave = arg_v;
+    ++arg_v;
+#endif
+    /* Initialize bindings/quark list with prefix (typically app name). */
+    quarks[0] = XrmStringToName(prefix);
+    bindings[0] = XrmBindTightly;
+    start_quarks = quarks+1;
+    start_bindings = bindings+1;
+
+    table_is_sorted = (myargc > 2) ? Check : DontCare;
+    for (--myargc; myargc > 0; --myargc, ++arg_v) {
+       foundOption = False;
+       matches = 0;
+       for (i=0; i < num_options; ++i) {
+           /* checking the sort order first insures we don't have to
+              re-do the check if the arg hits on the last entry in
+              the table.  Useful because usually '=' is the last entry
+              and users frequently specify geometry early in the command */
+           if (table_is_sorted == Check && i > 0 &&
+               strcmp(options[i].option, options[i-1].option) < 0) {
+               table_is_sorted = NotSorted;
+           }
+           for (argP = *arg_v, optP = options[i].option;
+                (optchar = *optP++) &&
+                (argchar = *argP++) &&
+                argchar == optchar;);
+           if (!optchar) {
+               if (!*argP ||
+                   options[i].argKind == XrmoptionStickyArg ||
+                   options[i].argKind == XrmoptionIsArg) {
+                   /* give preference to exact matches, StickyArg and IsArg */
+                   matches = 1;
+                   foundOption = i;
+                   break;
+               }
+           }
+           else if (!argchar) {
+               /* may be an abbreviation for this option */
+               matches++;
+               foundOption = i;
+           }
+           else if (table_is_sorted == Sorted && optchar > argchar) {
+               break;
+           }
+           if (table_is_sorted == Check && i > 0 &&
+               strcmp(options[i].option, options[i-1].option) < 0) {
+               table_is_sorted = NotSorted;
+           }
+       }
+       if (table_is_sorted == Check && i >= (num_options-1))
+           table_is_sorted = Sorted;
+       if (matches == 1) {
+               i = foundOption;
+               switch (options[i].argKind){
+                 /* So far only 3 are used... No, Sep, Res */
+               case XrmoptionNoArg:
+#if 0
+                   --(*arg_c);
+#endif
+                   PutCommandResource(options[i].value);
+                   break;
+
+               case XrmoptionIsArg:
+#if 0
+                   --(*arg_c);
+#endif
+                   PutCommandResource(*arg_v);
+                   break;
+
+               case XrmoptionStickyArg:
+#if 0
+                   --(*arg_c);
+#endif
+                   PutCommandResource(argP);
+                   break;
+
+               case XrmoptionSepArg:
+                   if (myargc > 1) {
+                       ++arg_v; --myargc;
+#if 0
+                        --(*arg_c); --(*arg_c);
+#endif
+                       PutCommandResource(*arg_v);
+                   }
+#if 0
+               else
+                       (*argsave++) = (*arg_v);
+#endif
+                   break;
+
+               case XrmoptionResArg:
+                   if (myargc > 1) {
+                       ++arg_v; --myargc;
+#if 0
+                        --(*arg_c); --(*arg_c);
+#endif
+                       XrmPutLineResource(pdb, *arg_v);
+                   }
+#if 0
+               else
+                       (*argsave++) = (*arg_v);
+#endif
+                   break;
+
+               case XrmoptionSkipArg:
+                   if (myargc > 1) {
+                       --myargc;
+#if 0
+                       (*argsave++) = (*arg_v++);
+#endif
+                   }
+#if 0
+                   (*argsave++) = (*arg_v);
+#endif
+                   break;
+
+               case XrmoptionSkipLine:
+#if 0
+                   for (; myargc > 0; myargc--)
+                       (*argsave++) = (*arg_v++);
+#endif
+                   break;
+
+               case XrmoptionSkipNArgs:
+                   {
+                       register int j = 1 + (int) options[i].value;
+
+                       if (j > myargc) j = myargc;
+                       for (; j > 0; j--) {
+#if 0
+                           (*argsave++) = (*arg_v++);
+#endif
+                           myargc--;
+                       }
+                       arg_v--;                /* went one too far before */
+                       myargc++;
+                   }
+                   break;
+
+               default:
+                   _XReportParseError (&options[i], (char *) "unknown kind");
+                   break;
+               }
+       }
+#if 0
+       else
+           (*argsave++) = (*arg_v);  /*compress arglist*/
+#endif
+    }
+
+#if 0
+    if (argsave < argend)
+       (*argsave)=NULL; /* put NULL terminator on compressed arg_v */
+#endif
+   (*arg_v) = (*argsave);  /*return unmotified arglist*/
+}
diff --git a/xlock/passwd.c b/xlock/passwd.c
new file mode 100644 (file)
index 0000000..fc0964c
--- /dev/null
@@ -0,0 +1,2042 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)passwd.c     5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * passwd.c - passwd stuff.
+ *
+ * Copyright (c) 1988-91 by Patrick J. Naughton.
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 01-Nov-2000: SIA passwording for Tru64 added
+ * 18-Feb-1999: allowroot option no longer ignored for PAM authentication.
+ *              Sven Paas <Sven.Paas@t-online.de>
+ * 24-Jan-1998: Updated PAM support and made it configure-able.
+ *              Marc Ewing <marc@redhat.com>  Original PAM support from
+ *              25-Jul-96 Michael K. Johnson <johnsonm@redhat.com>
+ * 18-Jan-1998: Kerberos corrections by RLS <sinkr@cbl.umces.edu>
+ * 25-May-1996: When xlock is compiled with shadow passwords it will still
+ *              work on non shadowed systems.  Marek Michalkiewicz
+ *              <marekm@i17linuxb.ists.pwr.wroc.pl>
+ * 25-Feb-1996: Lewis Muhlenkamp
+ *              Added in ability for any of the root accounts to unlock
+ *              screen.  Message now gets sent to syslog if root does the
+ *              unlocking.
+ * 23-Dec-1995: Ron Hitchens <ron@idiom.com> reorganized.
+ * 10-Dec-1995: More context handling stuff for DCE thanks to
+ *              Terje Marthinussen <terjem@cc.uit.no>.
+ * 01-Sep-1995: DCE code added thanks to Heath A. Kehoe
+ *              <hakehoe@icaen.uiowa.edu>.
+ * 24-Jun-1995: Extracted from xlock.c, encrypted passwords are now fetched
+ *              on start-up to ensure correct operation (except Ultrix).
+ */
+
+#include "xlock.h"
+#include "iostuff.h"
+#include "passwd.h"
+
+#ifdef VMS
+#include <str$routines.h>
+#include <starlet.h>
+#define ROOT "SYSTEM"
+#else
+#define ROOT "root"
+#endif
+
+extern Bool allowroot;
+extern Bool inroot;
+extern Bool inwindow;
+extern Bool grabmouse;
+extern Bool nolock;
+extern char *cpasswd;
+
+#if defined( USE_XLOCKRC ) || defined( FALLBACK_XLOCKRC )
+#include <sys/stat.h>          /* order of includes matters */
+#endif
+
+#if !defined( VMS ) && !defined( SUNOS_ADJUNCT_PASSWD )
+#include <pwd.h>
+#endif
+
+#if defined( USE_XLOCKRC ) || defined( FALLBACK_XLOCKRC )  || defined( __bsdi__ ) || defined( HAVE_KRB4 ) || defined( HAVE_KRB5 )
+#include <sys/param.h>
+#endif
+
+
+#if defined( __bsdi__ ) && _BSDI_VERSION >= 199608
+#define       BSD_AUTH
+#endif
+
+#ifdef        BSD_AUTH
+#include <login_cap.h>
+static login_cap_t *lc = NULL;
+static login_cap_t *rlc = NULL;
+
+#endif
+
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+#include <syslog.h>
+#endif
+
+#if ( HAVE_FCNTL_H && (defined( USE_MULTIPLE_ROOT ) || defined( USE_MULTIPLE_USER )))
+#include <fcntl.h>
+#include <errno.h>
+extern int  errno;
+
+void        get_multiple(struct passwd *);
+void        set_multiple(int uid);
+
+#define BUFMAX 1024            /* Maximum size of pipe buffer */
+
+
+/* Linked list to keep track of everyone that's authorized * to unlock the
+   screen. */
+struct pwln {
+       char       *pw_name;
+#ifdef        BSD_AUTH
+       login_cap_t *pw_lc;
+#else
+       char       *pw_passwd;
+#endif
+       struct pwln *next;
+};
+typedef struct pwln pwlnode;
+typedef struct pwln *pwlptr;
+
+pwlptr      pwll, pwllh = (pwlptr) NULL;
+extern pwlptr pwllh;
+
+/* Function that creates and initializes a new node that * will be added to
+   the linked list. */
+pwlptr
+new_pwlnode(void)
+{
+       pwlptr      pwl;
+
+       if ((pwl = (pwlptr) malloc(sizeof (pwlnode))) == 0)
+               return ((pwlptr) ENOMEM);
+
+       pwl->pw_name = (char *) NULL;
+#ifdef BSD_AUTH
+       pwl->pw_lc = NULL;
+#else
+       pwl->pw_passwd = (char *) NULL;
+#endif
+       pwl->next = (pwlptr) NULL;
+
+       return (pwl);
+}
+#endif
+
+#ifdef ultrix
+#include <auth.h>
+
+#if defined( HAVE_SETEUID ) || defined(HAVE_SETREUID )
+gid_t       rgid, egid;
+
+#endif
+#endif
+
+#ifdef OSF1_ENH_SEC
+#include <sys/security.h>
+#include <prot.h>
+#endif
+
+#if defined( __linux__ ) && defined( __ELF__ ) && !defined( HAVE_SHADOW )
+/*-
+ * Linux may or may not have shadow passwords, so it is best to make the same
+ * binary work with both shadow and non-shadow passwords. It's easy with the
+ * ELF libc since it has getspnam() and there is no need for any additional
+ * libraries like libshadow.a.
+ */
+#define HAVE_SHADOW
+#endif
+
+#if defined( __linux__ ) && defined( HAVE_SHADOW ) && defined( HAVE_PW_ENCRYPT )
+/*-
+ * Deprecated - long passwords have known weaknesses.  Also, pw_encrypt is
+ *  non-standard (requires libshadow.a) while everything else you need to
+ *  support shadow passwords is in the standard (ELF) libc.
+ */
+#define crypt pw_encrypt
+#endif
+
+#ifdef HAVE_SHADOW
+#ifndef __hpux
+#include <shadow.h>
+#endif
+#endif
+
+#ifdef SUNOS_ADJUNCT_PASSWD
+#include <sys/label.h>
+#include <sys/audit.h>
+#include <pwdadj.h>
+#define passwd passwd_adjunct
+#define pw_passwd pwa_passwd
+#define getpwnam(_s) getpwanam(_s)
+#define pw_name pwa_name
+#define getpwuid(_s) (((_s)==0)?getpwanam(ROOT):getpwanam(cuserid(NULL)))
+#endif /* SUNOS_ADJUNCT_PASSWD */
+
+/* System V Release 4 redefinitions of BSD functions and structures */
+#if !defined( SHADOW ) && (defined( SYSV ) || defined( SVR4 ))
+
+#ifdef LESS_THAN_AIX3_2
+struct passwd {
+       char       *pw_name;
+       char       *pw_passwd;
+       uid_t       pw_uid;
+       gid_t       pw_gid;
+       char       *pw_gecos;
+       char       *pw_dir;
+       char       *pw_shell;
+};
+
+#endif /* LESS_THAN_AIX3_2 */
+
+#ifdef HPUX_SECURE_PASSWD
+#include <hpsecurity.h>
+#include <prot.h>
+#define crypt bigcrypt
+
+/* #define seteuid(_eu) setresuid(-1, _eu, -1) */
+#define passwd s_passwd
+#define getpwnam(_s) getspwnam(_s)
+#define getpwuid(_u) getspwuid(_u)
+#endif /* HPUX_SECURE_PASSWD */
+
+#endif /* defined( SYSV ) || defined( SVR4 ) */
+
+#ifdef VMS
+#include <uaidef.h>
+#define VMS_PASSLENGTH 9
+static short uai_salt, root_salt;
+static char hash_password[VMS_PASSLENGTH], hash_system[VMS_PASSLENGTH];
+static char root_password[VMS_PASSLENGTH], root_system[VMS_PASSLENGTH];
+static char uai_encrypt, root_encrypt;
+
+struct ascid {
+       short       len;
+       char        dtype;
+       char        c_class;
+       char       *addr;
+};
+
+static struct ascid username, rootuser;
+
+struct itmlst {
+       short       buflen;
+       short       code;
+       long        addr;
+       long        retadr;
+};
+
+#endif /* VMS */
+
+#ifdef HP_PASSWDETC            /* HAVE_SYS_WAIT_H */
+#include <sys/wait.h>
+
+/*-
+ * Potential security problem on HP with PasswdEtc
+ * This hack is totally crazy and has security holes.
+ */
+
+#if 1
+        /* Change 1 to 0 */
+        Hackers can probably get at the encrypted passwd file
+#endif
+
+#endif /* HP_PASSWDETC */
+
+#ifdef AFS
+#include <afs/kauth.h>
+#include <afs/kautils.h>
+#endif /* AFS */
+
+#ifdef SIA
+#include<sia.h>
+#include<siad.h>
+#endif /* SIA */
+
+char        user[PASSLENGTH];
+#ifdef GLOBAL_UNLOCK
+char        global_user[PASSLENGTH];
+#endif
+
+#ifdef PAM
+#include <security/pam_appl.h>
+/* used to pass the password to the conversation function */
+static char *PAM_password;
+
+/*-
+ * PAM conversation function
+ * Here we assume (for now, at least) that echo on means login name, and
+ * echo off means password.
+ */
+static int
+PAM_conv(int num_msg,
+        /* const */ struct pam_message **msg,
+        struct pam_response **resp,
+        void *appdata_ptr)
+{
+       int         replies = 0;
+       struct pam_response *reply = NULL;
+
+
+#define COPY_STRING(s) (s) ? strdup(s) : NULL
+
+
+       reply = (struct pam_response *) malloc(sizeof (struct pam_response) *
+                                              num_msg);
+
+       if (!reply)
+               return PAM_CONV_ERR;
+
+
+       for (replies = 0; replies < num_msg; replies++) {
+               switch (msg[replies]->msg_style) {
+                       case PAM_PROMPT_ECHO_ON:
+                               reply[replies].resp_retcode = PAM_SUCCESS;
+                               reply[replies].resp = COPY_STRING(user);
+                               /* PAM frees resp */
+                               break;
+                       case PAM_PROMPT_ECHO_OFF:
+                               reply[replies].resp_retcode = PAM_SUCCESS;
+                               reply[replies].resp = COPY_STRING(PAM_password);
+                               /* PAM frees resp */
+                               break;
+                       case PAM_TEXT_INFO:
+                               /* ignore it... */
+                               reply[replies].resp_retcode = PAM_SUCCESS;
+                               reply[replies].resp = NULL;
+                               break;
+                       case PAM_ERROR_MSG:
+                               /* ignore it... */
+                               reply[replies].resp_retcode = PAM_SUCCESS;
+                               reply[replies].resp = NULL;
+                               break;
+                       default:
+                               /* Must be an error of some sort... */
+                               (void) free((void *) reply);
+                               return PAM_CONV_ERR;
+               }
+       }
+       *resp = reply;
+       return PAM_SUCCESS;
+}
+static struct pam_conv PAM_conversation =
+{
+       &PAM_conv,
+       NULL
+};
+
+#endif /* PAM */
+
+#if !defined( ultrix ) && !defined( PAM )
+static char userpass[PASSLENGTH];
+static char rootpass[PASSLENGTH];
+
+#ifdef VMS
+static char root[] = ROOT;
+
+#endif
+#endif /* !ultrix */
+
+#ifdef DCE_PASSWD
+static int  usernet, rootnet;
+static int  check_dce_net_passwd(char *, char *);
+
+#endif
+
+#if defined( HAVE_KRB4 ) || defined( HAVE_KRB5 )
+#ifdef HAVE_KRB4
+#include <krb.h>
+#else /* HAVE_KRB5 */
+#include <krb5.h>
+#endif
+static int  krb_check_password(struct passwd *, char *);
+
+#endif
+
+#if defined(__cplusplus) || defined(c_plusplus)
+#ifdef SunCplusplus
+#include <crypt.h>
+#else
+#if 0
+#if 1
+extern char *crypt(char *, char *);
+
+#else
+extern char *crypt(const char *, const char *);
+
+#endif
+#endif
+#endif
+#endif
+
+#if (defined( USE_XLOCKRC ) || (!defined( OSF1_ENH_SEC ) && !defined( HP_PASSWDETC ) && !defined( VMS )))
+static struct passwd *
+my_passwd_entry(void)
+{
+       int         uid;
+       struct passwd *pw;
+
+#ifdef HAVE_SHADOW
+       struct spwd *spw;
+
+#endif
+
+       uid = (int) getuid();
+#ifndef SUNOS_ADJUNCT_PASSWD
+       {
+               char       *logname;
+
+               pw = 0;
+               logname = getenv("LOGNAME");
+               if (logname == NULL)
+                       logname = getenv("USER");
+               if (logname != NULL) {
+                       pw = getpwnam(logname);
+                       if (pw && (pw->pw_uid != uid))
+                               pw = 0;
+               }
+       }
+       if (!pw)
+#endif
+               pw = getpwuid(uid);
+       if (!pw)
+               return (pw);
+#ifdef HAVE_SHADOW
+       if ((spw = getspnam(pw->pw_name)) != NULL) {
+               char       *tmp;        /* swap */
+
+               tmp = pw->pw_passwd;
+               pw->pw_passwd = spw->sp_pwdp;
+               spw->sp_pwdp = tmp;
+       }
+       endspent();
+#endif
+       return (pw);
+}
+#endif
+
+#ifdef SAFEWORD
+int
+checkDynamic()
+{
+       struct passwd *pw;
+       char       *buf;
+
+#ifndef SAFELOG_SWCHECK
+#define SAFELOG_SWCHECK "/progs/safelog/swcheck"
+#endif
+#ifndef SAFELOG_IDENT
+#define SAFELOG_IDENT "/progs/safelog/ident"
+#endif
+
+
+       if (!(pw = my_passwd_entry())) {
+               /*if ((pw = (struct passwd *) getpwuid(getuid())) == NULL) */
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                            "%s: could not get user shell.\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       return (!(strcmp(pw->pw_shell, SAFELOG_SWCHECK) &&
+                 strcmp(pw->pw_shell, SAFELOG_IDENT)));
+}
+#endif
+
+static void
+getUserName(void)
+{
+
+#ifdef VMS
+       (void) strcpy(user, cuserid(NULL));
+#else /* !VMS */
+#ifdef HP_PASSWDETC
+
+/*-
+ * The PasswdEtc libraries have replacement passwd functions that make
+ * queries to DomainOS registries.  Unfortunately, these functions do
+ * wierd things to the process (at minimum, signal handlers get changed,
+ * there are probably other things as well) that cause xlock to become
+ * unstable.
+ *
+ * As a (really, really sick) workaround, we'll fork() and do the getpw*()
+ * calls in the child, and pass the information back through a pipe.
+ */
+       struct passwd *pw;
+       int         pipefd[2], n, total = 0, stat_loc;
+       pid_t       pid;
+       char       *buf;
+
+       pipe(pipefd);
+
+       if ((pid = fork()) == 0) {
+               (void) close(pipefd[0]);
+               pw = getpwuid(getuid());
+               write(pipefd[1], pw->pw_name, strlen(pw->pw_name));
+               (void) close(pipefd[1]);
+               _exit(0);
+       }
+       if (pid < 0) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get user password (fork failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       (void) close(pipefd[1]);
+
+       while ((n = read(pipefd[0], &(user[total]), 50)) > 0)
+               total += n;
+
+       wait(&stat_loc);
+
+       if (n < 0) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                "%s: could not get user name (read failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       user[total] = 0;
+
+       if (total < 1) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get user name (lookups failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+#else /* !HP_PASSWDETC */
+#ifdef OSF1_ENH_SEC
+       struct pr_passwd *pw;
+       char       *buf;
+
+       /*if ((pw = getprpwuid(getuid())) == NULL) */
+       if ((pw = getprpwuid(starting_ruid())) == NULL) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get user name.\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       (void) strcpy(user, pw->ufld.fd_name);
+#else /* !OSF1_ENH_SEC */
+
+       struct passwd *pw;
+       char       *buf;
+
+       if (!(pw = my_passwd_entry())) {
+               /*if ((pw = (struct passwd *) getpwuid(getuid())) == NULL) */
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get user name.\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       (void) strcpy(user, pw->pw_name);
+
+#if ( HAVE_FCNTL_H && (defined( USE_MULTIPLE_ROOT ) || defined( USE_MULTIPLE_USER )))
+       get_multiple(pw);
+#endif
+
+#endif /* !OSF1_ENH_SEC */
+#endif /* !HP_PASSWDETC */
+#endif /* !VMS */
+}
+
+#if defined( USE_XLOCKRC ) || defined( FALLBACK_XLOCKRC )
+
+#define CPASSLENGTH 14
+#define CPASSCHARS 64
+static void
+gpasskey(char *pass)
+{
+       static char saltchars[CPASSCHARS + 1] =
+       "abcdefghijklmnopwrstuvwxyzABCDEFGHIJKLMNOPWRSTUVWXYZ1234567890./";
+       char        pw[9], salt[3], *pw2;
+
+#if 0
+       char       *getpass(const char *);
+
+#endif
+
+       (void) strncpy(pw, (char *) getpass("Key: "), sizeof (pw));
+       pw2 = (char *) getpass("Again:");
+       if (strcmp(pw, pw2) != 0) {
+               (void) fprintf(stderr, "%s: Mismatch, try again\n", ProgramName);
+               exit(1);
+       }
+       /* grab a random printable character that is not a colon */
+       salt[0] = saltchars[LRAND() & (CPASSCHARS - 1)];
+       salt[1] = saltchars[LRAND() & (CPASSCHARS - 1)];
+       salt[2] = '\0';
+       (void) strncpy(pass, (char *) crypt(pw, salt), CPASSLENGTH);
+}
+
+static void
+gpass(void)
+{
+       FILE       *fp;
+       char        xlockrc[MAXPATHLEN], *home;
+
+       if (!cpasswd || !*cpasswd) {
+               /*
+                * No password given on command line or from database, get from
+                * $HOME/.xlockrc instead.
+                */
+               if ((home = getenv("HOME")) == 0) {
+                       /* struct passwd *p = getpwuid(getuid()); */
+                       struct passwd *p = my_passwd_entry();
+
+                       if (p == 0) {
+                               char       *buf = (char *) malloc(strlen(ProgramName) + 80);
+
+                               (void) sprintf(buf,
+                                         "%s: Who are you?\n", ProgramName);
+                               error(buf);
+                               (void) free((void *) buf);      /* Should never get here */
+                       }
+                       home = p->pw_dir;
+               }
+               (void) strncpy(xlockrc, home, MAXPATHLEN);
+               (void) strncat(xlockrc, "/.xlockrc", MAXPATHLEN);
+               if ((fp = my_fopen(xlockrc, "r")) == NULL) {
+                       if ((fp = my_fopen(xlockrc, "w")) != NULL)
+                               (void) fchmod(fileno(fp), 0600);
+#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
+                       (void) strcpy(userpass, "*");
+#else
+                       gpasskey(userpass);
+#endif /* KRB4 || KRB5 */
+                       if (fp)
+                               (void) fprintf(fp, "%s\n", userpass);
+               } else {
+                       char        buf[BUFSIZ];
+
+                       (void) fchmod(fileno(fp), 0600);
+                       buf[0] = '\0';
+                       if ((fgets(buf, sizeof buf, fp) == NULL) ||
+                           (!(strlen(buf) == CPASSLENGTH - 1 ||
+#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
+                              (((strlen(buf) == 1) || strlen(buf) == 2)
+                               && buf[0] == '*') ||
+#endif
+                              (strlen(buf) == CPASSLENGTH && buf[CPASSLENGTH - 1] == '\n')))) {
+                               (void) fprintf(stderr, "%s: %s crypted password %s\n", xlockrc,
+                                      buf[0] == '\0' ? "null" : "bad", buf);
+#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
+                               gpasskey(buf);
+#else
+                               exit(1);
+#endif
+                       }
+                       buf[CPASSLENGTH - 1] = '\0';
+                       (void) strncpy(userpass, buf, CPASSLENGTH);
+               }
+               if (fp)
+                       (void) fclose(fp);
+       } else {
+
+               if (strlen(cpasswd) != CPASSLENGTH - 1) {
+                       (void) fprintf(stderr, "%s: bad crypted password %s\n",
+                                      ProgramName, cpasswd);
+                       exit(1);
+               } else
+                       (void) strncpy(userpass, cpasswd, CPASSLENGTH);
+       }
+}
+
+#endif /* USE_XLOCKRC || FALLBACK_XLOCKRC */
+
+#if !defined( ultrix ) && !defined( DCE_PASSWD ) && !defined( BSD_AUTH )  && !defined ( PAM )
+#ifndef USE_XLOCKRC
+
+#if defined( HAVE_SHADOW ) && !defined( AFS ) && !defined( SIA )
+static int
+passwd_invalid(char *passwd)
+{
+       int         i = strlen(passwd);
+
+       return (i == 1 || i == 2);
+}
+#endif
+
+#ifdef OSF1_ENH_SEC
+static int user_oldcrypt, root_oldcrypt;
+#endif
+
+static void
+getCryptedUserPasswd(void)
+{
+
+#ifdef VMS
+       struct itmlst il[4];
+
+       il[0].buflen = 2;
+       il[0].code = UAI$_SALT;
+       il[0].addr = (long) &uai_salt;
+       il[0].retadr = 0;
+       il[1].buflen = 8;
+       il[1].code = UAI$_PWD;
+       il[1].addr = (long) &hash_password;
+       il[1].retadr = 0;
+       il[2].buflen = 1;
+       il[2].code = UAI$_ENCRYPT;
+       il[2].addr = (long) &uai_encrypt;
+       il[2].retadr = 0;
+       il[3].buflen = 0;
+       il[3].code = 0;
+       il[3].addr = 0;
+       il[3].retadr = 0;
+
+       username.len = strlen(user);
+       username.dtype = 0;
+       username.c_class = 0;
+       username.addr = user;
+
+       sys$getuai(0, 0, &username, &il, 0, 0, 0);
+#else /* !VMS */
+#ifdef HP_PASSWDETC
+
+/*-
+ * still very sick, see above
+ */
+       struct passwd *pw;
+       int         pipefd[2], n, total = 0, stat_loc;
+       pid_t       pid;
+       char       *buf;
+
+       pipe(pipefd);
+
+       if ((pid = fork()) == 0) {
+               (void) close(pipefd[0]);
+               pw = getpwuid(getuid());
+               write(pipefd[1], pw->pw_passwd, strlen(pw->pw_passwd));
+               (void) close(pipefd[1]);
+               _exit(0);
+       }
+       if (pid < 0) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get user password (fork failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       (void) close(pipefd[1]);
+
+       while ((n = read(pipefd[0], &(userpass[total]), 50)) > 0)
+               total += n;
+
+       wait(&stat_loc);
+
+       if (n < 0) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get user password (read failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       user[total] = 0;
+
+       if (total < 1) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get user password (lookups failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+#else /* !HP_PASSWDETC */
+#ifdef OSF1_ENH_SEC
+       struct pr_passwd *pw;
+       char       *buf;
+
+       /*if ((pw = getprpwuid(getuid())) == NULL) */
+       if ((pw = getprpwuid(starting_ruid())) == NULL) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+               "%s: could not get encrypted user password.\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       (void) strcpy(userpass, pw->ufld.fd_encrypt);
+       /* also save encryption algorithm associated with encrypted password */
+       user_oldcrypt = pw->ufld.fd_oldcrypt;
+#else /* !OSF1_ENH_SEC */
+
+       struct passwd *pw;
+       char       *buf;
+
+       if (!(pw = my_passwd_entry())) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+               "%s: could not get encrypted user password.\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       /*if ((pw = (struct passwd *) getpwuid(getuid())) == NULL) */
+       /* Check if there is any chance of unlocking the display later...  */
+       /* Program probably needs to be setuid to root.  */
+       (void) strcpy(userpass, pw->pw_passwd);
+#ifdef HAVE_SHADOW
+#if !defined ( AFS ) && !defined ( SIA )
+       if (passwd_invalid(pw->pw_passwd)) {
+               extern Bool verbose, debug;
+
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               if (verbose || debug) {
+                       (void) fprintf(stderr,
+                         "%s: it looks like you have shadow passwording.\n",
+                                      ProgramName);
+                       (void) fprintf(stderr, "Contact your administrator to setgid or\n");
+                       (void) fprintf(stderr, "setuid %s for /etc/shadow read access.\n",
+                                      ProgramName);
+#ifdef FALLBACK_XLOCKRC
+                       (void) fprintf(stderr, "Falling back on $HOME/.xlockrc password.\n");
+#endif
+               }
+#ifdef FALLBACK_XLOCKRC
+               gpass();
+#endif
+       }
+#endif /* !AFS && !SIA */
+#endif /* HAVE_SHADOW */
+#if ( HAVE_FCNTL_H && defined( USE_MULTIPLE_USER ))
+       set_multiple(getuid());
+#endif /* HAVE_FCNTL_H && MULTIPLE_USER */
+#endif /* !OSF1_ENH_SEC */
+#endif /* !HP_PASSWDETC */
+#endif /* !VMS */
+}
+
+#endif /* !USE_XLOCKRC */
+
+static void
+getCryptedRootPasswd(void)
+{
+
+#ifdef VMS
+       struct itmlst il[4];
+
+       il[0].buflen = 2;
+       il[0].code = UAI$_SALT;
+       il[0].addr = (long) &root_salt;
+       il[0].retadr = 0;
+       il[1].buflen = 8;
+       il[1].code = UAI$_PWD;
+       il[1].addr = (long) &root_password;
+       il[1].retadr = 0;
+       il[2].buflen = 1;
+       il[2].code = UAI$_ENCRYPT;
+       il[2].addr = (long) &root_encrypt;
+       il[2].retadr = 0;
+       il[3].buflen = 0;
+       il[3].code = 0;
+       il[3].addr = 0;
+       il[3].retadr = 0;
+
+       rootuser.len = strlen(root);
+       rootuser.dtype = 0;
+       rootuser.c_class = 0;
+       rootuser.addr = root;
+
+       sys$getuai(0, 0, &rootuser, &il, 0, 0, 0);
+#else /* !VMS */
+#ifdef HP_PASSWDETC
+
+/*-
+ * Still really, really sick.  See above.
+ */
+       struct passwd *pw;
+       int         pipefd[2], n, total = 0, stat_loc;
+       pid_t       pid;
+       char       *buf;
+
+       pipe(pipefd);
+
+       if ((pid = fork()) == 0) {
+               (void) close(pipefd[0]);
+               pw = getpwnam(ROOT);
+               write(pipefd[1], pw->pw_passwd, strlen(pw->pw_passwd));
+               (void) close(pipefd[1]);
+               _exit(0);
+       }
+       if (pid < 0) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get root password (fork failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       (void) close(pipefd[1]);
+
+       while ((n = read(pipefd[0], &(rootpass[total]), 50)) > 0)
+               total += n;
+
+       wait(&stat_loc);
+
+       if (n < 0) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get root password (read failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       rootpass[total] = 0;
+
+       if (total < 1) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                              "%s: could not get root password (lookups failed)\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+#else /* !HP_PASSWDETC */
+#ifdef OSF1_ENH_SEC
+       struct pr_passwd *pw;
+       char       *buf;
+
+       if ((pw = getprpwnam(ROOT)) == NULL) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+               "%s: could not get encrypted root password.\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       (void) strcpy(rootpass, pw->ufld.fd_encrypt);
+       /* also save encryption algorithm associated with encrypted password */
+       root_oldcrypt = pw->ufld.fd_oldcrypt;
+#else /* !OSF1_ENH_SEC */
+       struct passwd *pw;
+       char       *buf;
+
+#ifdef HAVE_SHADOW
+       struct spwd *spw;
+
+#endif
+
+       if (!(pw = getpwnam(ROOT)))
+               if (!(pw = getpwuid(0))) {
+                       /*if ((pw = (struct passwd *) getpwuid(0)) == NULL) */
+                       buf = (char *) malloc(strlen(ProgramName) + 80);
+                       (void) sprintf(buf,
+                                      "%s: could not get encrypted root password.\n", ProgramName);
+                       error(buf);
+                       (void) free((void *) buf);      /* Should never get here */
+               }
+#ifdef HAVE_SHADOW
+       if ((spw = getspnam(pw->pw_name)) != NULL) {
+               char       *tmp;        /* swap */
+
+               tmp = pw->pw_passwd;
+               pw->pw_passwd = spw->sp_pwdp;
+               spw->sp_pwdp = tmp;
+       }
+       endspent();
+#endif
+       (void) strcpy(rootpass, pw->pw_passwd);
+
+#if ( HAVE_FCNTL_H && defined( USE_MULTIPLE_ROOT ))
+       set_multiple(0);
+#endif /* HAVE_FCNTL_H && MULTIPLE_ROOT */
+
+#endif /* !OSF1_ENH_SEC */
+#endif /* !HP_PASSWDETC */
+#endif /* !VMS */
+}
+
+#endif /* !ultrix && !DCE_PASSWD && !BSD_AUTH && !PAM */
+
+
+#ifdef GLOBAL_UNLOCK
+void
+checkUser(char *buffer)
+{
+#ifdef OSF1_ENH_SEC
+       struct pr_passwd *pw;
+#else /* !OSF1_ENH_SEC */
+       struct passwd *pw;
+#ifdef HAVE_SHADOW
+       struct spwd *spw;
+
+#endif
+#endif /* !OSF1_ENH_SEC */
+       pw = (struct passwd *)getpwnam(buffer);
+
+       if (pw == NULL)
+               (void) strcpy(userpass, "*");
+       else {
+#ifdef HAVE_SHADOW
+       if ((spw = getspnam(pw->pw_name)) != NULL) {
+               char       *tmp;        /* swap */
+
+               tmp = pw->pw_passwd;
+               pw->pw_passwd = spw->sp_pwdp;
+               spw->sp_pwdp = tmp;
+       }
+       endspent();
+#endif
+               (void) strcpy(userpass, pw->pw_passwd);
+       }
+
+}
+#endif
+
+
+
+/*-
+ * We do not allow for root to have no password, but we handle the case
+ * where the user has no password correctly; they have to hit return
+ * only.
+ */
+int
+checkPasswd(char *buffer)
+{
+       int         done = False;
+
+#ifdef VMS
+       struct ascid password;
+
+       password.len = strlen(buffer);
+       password.dtype = 0;
+       password.c_class = 0;
+       password.addr = buffer;
+
+       str$upcase(&password, &password);
+
+       sys$hash_password(&password, uai_encrypt, uai_salt,
+                         &username, &hash_system);
+
+       hash_password[VMS_PASSLENGTH - 1] = 0;
+       hash_system[VMS_PASSLENGTH - 1] = 0;
+
+       done = !strcmp(hash_password, hash_system);
+       if (!done && allowroot) {
+               sys$hash_password(&password, root_encrypt, root_salt,
+                                 &rootuser, &root_system);
+               root_password[VMS_PASSLENGTH - 1] = 0;
+               root_system[VMS_PASSLENGTH - 1] = 0;
+               done = !strcmp(root_password, root_system);
+       }
+#else /* !VMS */
+
+#ifdef DCE_PASSWD
+       if (usernet)
+               done = check_dce_net_passwd(user, buffer);
+       else
+               done = !strcmp(userpass, crypt(buffer, userpass));
+
+       if (done)
+               return True;
+       if (!allowroot)
+               return False;
+
+       if (rootnet)
+               done = check_dce_net_passwd(ROOT, buffer);
+       else
+               done = !strcmp(rootpass, crypt(buffer, rootpass));
+#else /* !DCE_PASSWD */
+
+#ifdef PAM
+/*-
+ * Use PAM to do authentication.  No session logging, only authentication.
+ * Bail out if there are any errors.
+ * For now, don't try to display strings explaining errors.
+ * Later, we could integrate PAM more by posting errors to the
+ * user.
+ * Query: should we be using PAM_SILENT to shut PAM up?
+ */
+       pam_handle_t *pamh;
+       int         pam_error;
+#ifdef BAD_PAM
+       uid_t       ruid;
+#define BAD_PAM_SETUID seteuid(ruid);
+#else
+#define BAD_PAM_SETUID
+#endif
+
+#define PAM_BAIL if (pam_error != PAM_SUCCESS) { \
+    pam_end(pamh, 0); BAD_PAM_SETUID return 0; \
+}
+#ifdef BAD_PAM
+       ruid = getuid();  /* the real user we are running as */
+#endif
+       PAM_password = buffer;
+       pam_error = pam_start("xlock", user, &PAM_conversation, &pamh);
+       PAM_BAIL;
+#ifdef BAD_PAM
+       (void) seteuid(0); /* temporarily go to root so that pam can get shadow password */
+#endif
+       pam_error = pam_authenticate(pamh, 0);
+       if (pam_error != PAM_SUCCESS) {
+                if (!allowroot) {
+                        pam_end(pamh, 0);
+                        return 0;
+                }
+
+               /* Try as root; bail if no success there either */
+               pam_error = pam_set_item(pamh, PAM_USER, ROOT);
+               PAM_BAIL;
+               pam_error = pam_authenticate(pamh, 0);
+               PAM_BAIL;
+       }
+#ifdef BAD_PAM
+       (void) seteuid(ruid); /* back to user's privileges */
+#endif
+       /* Do not do account management or credentials; credentials
+        * are not needed and account management would just lock up
+        * a computer and require root to come and unlock it.  Blech.
+        */
+       pam_end(pamh, PAM_SUCCESS);
+       /* If this point is reached, the user has been authenticated. */
+       done = True;
+
+#else /* !PAM */
+
+#ifdef ultrix
+
+#ifdef HAVE_SETEUID
+       (void) setegid(egid);
+#else
+#ifdef HAVE_SETREUID
+       (void) setregid(rgid, egid);
+#endif
+#endif
+       done = ((authenticate_user((struct passwd *) getpwnam(user),
+                                  buffer, NULL) >= 0);
+       if (!done && allowroot &&
+                (authenticate_user((struct passwd *) getpwnam(ROOT),
+                                           buffer, NULL) >= 0))) {
+               done = True;
+               if (!*buffer)
+                       /*
+                        * root has no password, don't let him in...
+                        */
+                       done = False;
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+               else
+                       syslog(SYSLOG_NOTICE, "%s: %s unlocked screen", ProgramName, ROOT);
+#endif
+       }
+#ifdef HAVE_SETEUID
+       (void) setegid(rgid);
+#else
+#ifdef HAVE_SETREUID
+       (void) setregid(egid, rgid);
+#endif
+#endif
+
+#else /* !ultrix */
+
+#ifdef BSD_AUTH
+       char       *pass;
+       char       *style;
+       char       *name;
+
+#if ( HAVE_FCNTL_H && (defined( USE_MULTIPLE_ROOT ) || defined( USE_MULTIPLE_USER )))
+       /* Scan through the linked list until you match a password.  Print
+        * message to log if password match doesn't equal the user.
+        *
+        * This should be changed to allow the user name to be typed in also
+        * to make this more secure.
+        */
+       for (pwll = pwllh; done == 0 && pwll->next; pwll = pwll->next) {
+               name = pwll->pw_name;
+               lc = pwll->pw_lc;
+#else
+       name = user;
+#endif
+       if ((pass = strchr(buffer, ':')) != NULL) {
+               *pass++ = '\0';
+               style = login_getstyle(lc, buffer, "auth-xlock");
+               if (auth_response(name, lc->lc_class, style,
+                                 "response", NULL, "", pass) > 0)
+                       done = True;
+               else if (rlc != NULL) {
+                       style = login_getstyle(rlc, buffer, "auth-xlock");
+                       if (auth_response(ROOT, rlc->lc_class, style,
+                                         "response", NULL, "", pass) > 0)
+                               done = True;
+               }
+               pass[-1] = ':';
+       }
+       if (!done) {
+               style = login_getstyle(lc, NULL, "auth-xlock");
+               if (auth_response(name, lc->lc_class, style,
+                                 "response", NULL, "", buffer) > 0)
+                       done = True;
+               else if (rlc != NULL) {
+                       style = login_getstyle(rlc, NULL, "auth-xlock");
+                       if (auth_response(ROOT, rlc->lc_class, style,
+                                         "response", NULL, "", buffer) > 0) {
+                               done = True;
+                               if (!*buffer)
+                                       /*
+                                        * root has no password, don't let him in...
+                                        */
+                                       done = False;
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+                               else
+                                       syslog(SYSLOG_NOTICE, "%s: %s unlocked screen", ProgramName, ROOT);
+#endif
+                       }
+               }
+       }
+#if ( HAVE_FCNTL_H && (defined( USE_MULTIPLE_ROOT ) || defined( USE_MULTIPLE_USER )))
+}
+#endif
+
+#else /* !BSD_AUTH */
+
+       /* check AFS & SIA passwd first, then local, then root */
+#ifdef AFS
+       {
+               char       *reason;
+
+               if (!ka_UserAuthenticate(user, "", 0, buffer, 0, &reason))
+                       return True;
+       }
+#endif /* AFS */
+#ifdef SIA
+       {
+               if ((sia_validate_user(NULL, "xlock", 1, NULL, user, NULL,
+                               0, NULL, buffer)) == SIASUCCESS)
+                       return True;
+       }
+#endif /* SIA */
+#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
+       {
+               /* Somehow, buffer gets 'erased' after either doing a krb pw check
+                  or a reg pw check */
+               char        buffer2[1024];
+
+               (void) strncpy(buffer2, buffer, sizeof (buffer2));
+#if 0
+               if (!strcmp(userpass, "*"))
+#endif
+                       if (krb_check_password((struct passwd *) getpwuid(getuid()), buffer2))
+                               return True;
+       }
+#endif /* !HAVE_KRB4 && !HAVE_KRB5 */
+#if ( HAVE_FCNTL_H && (defined( USE_MULTIPLE_ROOT ) || defined( USE_MULTIPLE_USER )))
+       if (!done) {
+               /* Scan through the linked list until you match a password.  Print
+                * message to log if password match does not equal the user.
+                *
+                * This should be changed to allow the user name to be typed in also
+                * to make this more secure.
+                */
+               for (pwll = pwllh; pwll->next; pwll = pwll->next)
+                       if (!strcmp((char *) crypt(buffer, pwll->pw_passwd), pwll->pw_passwd)) {
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+                               if (strcmp(user, pwll->pw_name) != 0)
+                                       syslog(SYSLOG_NOTICE, "%s: %s unlocked screen",
+                                              ProgramName, pwll->pw_name);
+#endif
+                               return True;
+                       }
+       }
+#endif
+       if (!done) {
+#ifdef OSF1_ENH_SEC
+               done = (!strcmp((char *) dispcrypt(buffer, userpass, user_oldcrypt), userpass));
+#else
+               done = (!strcmp((char *) crypt(buffer, userpass), userpass));
+#endif
+               /* userpass is used */
+               if (!*userpass && *buffer)
+                       /*
+                        * the user has no password, but something was typed anyway.
+                        * sounds fishy: don't let him in...
+                        */
+                       done = False;
+       }
+#if 0
+       (void) printf("buffer=%s, encrypt=%s, userpass=%s\n", buffer,
+                     (char *) crypt(buffer, userpass), userpass);
+#endif
+       if (!done && allowroot &&
+#ifdef OSF1_ENH_SEC
+               !strcmp((char *) dispcrypt(buffer, rootpass, root_oldcrypt), rootpass)
+#else
+               !strcmp((char *) crypt(buffer, rootpass), rootpass)
+#endif
+       ) {
+               done = True;    
+               if (!rootpass || !*buffer)
+                       /*
+                        * root has no password, don't let him in...
+                        */
+                       done = False;
+#if ( HAVE_SYSLOG_H && defined( USE_SYSLOG ))
+               else
+                       syslog(SYSLOG_NOTICE, "%s: %s unlocked screen", ProgramName, ROOT);
+#endif
+       }
+#endif /* !BSD_AUTH */
+#endif /* !ultrix */
+#endif /* !PAM */
+#endif /* !DCE_PASSWD */
+#endif /* !VMS */
+
+       return done;
+}
+
+/*-
+ * Functions for DCE authentication
+ *
+ * Revision History:
+ * 21-Aug-95: Added fallback to static password file [HAK]
+ * 06-Jul-95: Mods by Heath A. Kehoe <hakehoe@icaen.uiowa.edu> for
+ *            inclusion into xlockmore
+ * May-95: Created by Phil O'Connell <philo@icaen.uiowa.edu>
+ */
+
+#ifdef DCE_PASSWD
+#include <pthread.h>
+#include <dce/sec_login.h>
+#ifdef AIXV3
+#include <userpw.h>
+#endif
+
+static void
+initDCE(void)
+{
+       sec_login_handle_t login_context;
+       error_status_t error_status;
+       boolean32   valid;
+       struct passwd *pwd;
+
+#ifdef AIXV3
+       struct userpw *userpwd;
+
+#endif
+       char       *buf;
+
+       /* test to see if this user exists on the network registry */
+       valid = sec_login_setup_identity((unsigned_char_p_t) user,
+                         sec_login_no_flags, &login_context, &error_status);
+       if (!valid) {
+               switch (error_status) {
+                       case sec_rgy_object_not_found:
+                               break;
+                       case sec_rgy_server_unavailable:
+                               (void) fprintf(stderr, "%s: the network registry is not available.\n",
+                                              ProgramName);
+                               break;
+                       case sec_login_s_no_memory:
+                               buf = (char *) malloc(strlen(ProgramName) + 80);
+                               (void) sprintf(buf,
+                                        "%s: out of memory\n", ProgramName);
+                               error(buf);
+                               (void) free((void *) buf);      /* Should never get here */
+                       default:
+                               (void) fprintf(stderr,
+                                              "%s: sec_login_setup_identity() returned status %d\n",
+                                           ProgramName, (int) error_status);
+                               break;
+               }
+
+               pwd = getpwnam(user);
+               if (!pwd || strlen(pwd->pw_passwd) < 10) {
+                       buf = (char *) malloc(strlen(ProgramName) + 80);
+                       (void) sprintf(buf,
+                          "%s: could not get user password\n", ProgramName);
+                       error(buf);
+                       (void) free((void *) buf);      /* Should never get here */
+               }
+               usernet = 0;
+               (void) strcpy(userpass, pwd->pw_passwd);
+       } else
+               usernet = 1;
+
+       if (allowroot) {
+#ifdef AIXV3
+               userpwd = getuserpw("root");
+               (void) strcpy(rootpass, userpwd->upw_passwd);
+               if (!(strcmp(rootpass, ""))) {
+                       (void) fprintf(stderr, "%s: could not get root password\n", ProgramName);
+                       allowroot = 0;
+               } else {
+                       rootnet = 0;
+               }
+#else
+               valid = sec_login_setup_identity((unsigned_char_p_t) ROOT,
+                         sec_login_no_flags, &login_context, &error_status);
+               if (!valid) {
+                       switch (error_status) {
+                               case sec_rgy_object_not_found:
+                                       break;
+                               case sec_rgy_server_unavailable:
+                                       (void) fprintf(stderr, "%s: the network registry is not available.\n",
+                                                      ProgramName);
+                                       break;
+                               case sec_login_s_no_memory:
+                                       buf = (char *) malloc(strlen(ProgramName) + 80);
+                                       (void) sprintf(buf,
+                                        "%s: out of memory\n", ProgramName);
+                                       error(buf);
+                                       (void) free((void *) buf);      /* Should never get here */
+                               default:
+                                       (void) fprintf(stderr,
+                                                      "%s: sec_login_setup_identity() returned status %d\n",
+                                           ProgramName, (int) error_status);
+                                       break;
+                       }
+
+                       pwd = getpwuid(0);
+                       if (!pwd || strlen(pwd->pw_passwd) < 10) {
+                               (void) fprintf(stderr,
+                                              "%s: could not get root password\n", ProgramName);
+                               allowroot = 0;
+                       }
+                       rootnet = 0;
+                       (void) strcpy(rootpass, pwd->pw_passwd);
+               } else
+                       rootnet = 1;
+#endif
+       }
+       pthread_lock_global_np();
+}
+
+static char *
+error_string(error_status_t error_status)
+{
+       static char buf[60];
+
+       switch (error_status) {
+               case error_status_ok:
+                       return "no error";
+               case sec_rgy_object_not_found:
+                       return "The principal does not exist";
+               case sec_rgy_server_unavailable:
+                       return "The network registry is not available";
+               case sec_login_s_no_memory:
+                       return "Not enough memory is available to complete the operation";
+               case sec_login_s_already_valid:
+                       return "The login context has already been validated";
+               case sec_login_s_default_use:
+                       return "Can't validate the default context";
+               case sec_login_s_acct_invalid:
+                       return "The account is invalid or has expired";
+               case sec_login_s_unsupp_passwd_type:
+                       return "The password type is not supported";
+               case sec_login_s_context_invalid:
+                       return "The login context itself is not valid";
+               default:
+                       (void) sprintf(buf, "error status #%d", (int) error_status);
+                       return buf;
+       }
+}
+
+
+/*-
+ *----------------------------------------------------------------------
+ *     Function Created 5/95 to be used with xlock to validate DCE
+ *     passwords.  Routine simply returns a (1) if the the variable
+ *     PASS is the USER's PASSWORD, else it returns a (0).
+ *     Functions used:
+ *
+ *               sec_login_setup_identity
+ *               sec_login_validate_identity
+ *               sec_login_certify_identity
+ *
+ *     where setup_identity obtains the login context for the USER.
+ *     This identity is then validated with validate_identity.  Finally,
+ *     cerfify_identity is called to make sure that the Security
+ *       Server used to set up and validate a login context is legitimate.
+ *
+ *       Created by Phil O'Connell
+ *     philo@icaen.uiowa.edu
+ *     Student Programmer
+ *
+ *-----------------------------------------------------------------------
+ */
+
+static int
+check_dce_net_passwd(char *usr, char *pass)
+{
+       sec_login_handle_t login_context;
+       error_status_t error_status;
+       sec_passwd_rec_t password;
+       boolean32   reset_password;
+       sec_login_auth_src_t auth_src;
+       unsigned_char_p_t principal_name;
+       boolean32   valid = 0;
+       char       *passcpy;
+       boolean32   current_context;
+
+
+       pthread_unlock_global_np();
+       /* -------------------- SETUP IDENTITY--------------------------------- */
+
+       principal_name = (unsigned_char_p_t) usr;
+
+       /*
+        * We would rather like to refresh and existing login context instead of
+        * making a new one.
+        */
+
+       sec_login_get_current_context(&login_context, &error_status);
+       if (error_status != error_status_ok) {
+               current_context = 0;
+               (void) fprintf(stderr,
+                      "get_current_context failed! Setting up a new one\n");
+
+               valid = sec_login_setup_identity(principal_name, sec_login_no_flags,
+                                             &login_context, &error_status);
+
+               if (!valid) {
+                       (void) fprintf(stderr, "sec_login_setup_identity() failed: %s\n",
+                                      error_string(error_status));
+                       pthread_lock_global_np();
+                       return False;
+               }
+       } else
+               current_context = 1;
+
+/*--------------- VALIDATE IDENTITY ---------------------------------*/
+
+       /* make a copy of pass, because sec_login_validate_identity() will
+          clobber the plaintext password passed to it */
+       passcpy = (char *) strdup(pass);
+
+       password.key.key_type = sec_passwd_plain;
+       password.key.tagged_union.plain = (unsigned char *) passcpy;
+       password.pepper = NULL;
+       password.version_number = sec_passwd_c_version_none;
+
+       valid = sec_login_validate_identity(login_context, &password, &reset_password, &auth_src, &error_status);
+
+       /* report unusual error conditions */
+       if (error_status != error_status_ok &&
+           error_status != sec_rgy_passwd_invalid &&
+           error_status != sec_login_s_already_valid &&
+           error_status != sec_login_s_null_password) {
+               (void) fprintf(stderr, "sec_login_validate_identity failed: %s\n",
+                              error_string(error_status));
+       }
+       /* done with the copy of the password */
+       (void) free((void *) passcpy);
+
+       /* Refresh the context if we already have one */
+       if (current_context) {
+               if (!sec_login_refresh_identity(login_context, &error_status)) {
+                       (void) fprintf(stderr, "sec_login_refresh_identity failed: %s\n",
+                                      error_string(error_status));
+               } else {
+                       passcpy = (char *) strdup(pass);
+
+                       password.key.key_type = sec_passwd_plain;
+                       password.key.tagged_union.plain = (unsigned char *) passcpy;
+                       password.pepper = NULL;
+                       password.version_number = sec_passwd_c_version_none;
+
+                       /* Have to validate the refreshed context */
+                       valid = sec_login_validate_identity(login_context,
+                       &password, &reset_password, &auth_src, &error_status);
+
+                       /* report unusual error conditions */
+                       if (error_status != error_status_ok &&
+                           error_status != sec_rgy_passwd_invalid &&
+                           error_status != sec_login_s_null_password) {
+                               (void) fprintf(stderr, "sec_login_validate_identity failed: %s\n",
+                                              error_string(error_status));
+                       }
+               }
+               /* done with the copy of the password */
+               (void) free((void *) passcpy);
+       }
+       /* make sure that the authentication service is not an imposter */
+       if (valid) {
+               if (!sec_login_certify_identity(login_context, &error_status)) {
+                       (void) fprintf(stderr, "Authentication service is an imposter!\n");
+                       /* logoutUser(); */
+                       valid = 0;
+               }
+       }
+       pthread_lock_global_np();
+       return valid;
+}
+
+#endif /* DCE_PASSWD */
+
+#ifdef HAVE_KRB4
+int
+krb_check_password(struct passwd *pwd, char *pass)
+{
+       char        realm[REALM_SZ];
+       char        tkfile[MAXPATHLEN];
+
+       /* find local realm */
+       if (krb_get_lrealm(realm, 1) != KSUCCESS)
+#ifdef KRB_REALM
+               /* krb_get_default_realm() may not work well on Solaris */
+               (void) strncpy(realm, KRB_REALM, sizeof (realm));
+#else
+               (void) strncpy(realm, krb_get_default_realm(), sizeof (realm));
+#endif
+       /* Construct a ticket file */
+       (void) sprintf(tkfile, "/tmp/tkt_%d", pwd->pw_uid);
+
+       /* Now, let's make the ticket file named above the _active_ tkt file */
+       krb_set_tkt_string(tkfile);
+
+       /* ask the kerberos server for a ticket! */
+       if (krb_get_pw_in_tkt(pwd->pw_name, "", realm,
+                             "krbtgt", realm,
+                             DEFAULT_TKT_LIFE,
+                             pass) == INTK_OK)
+               return True;
+       return False;
+}
+#endif /* HAVE_KRB4 */
+
+#ifdef HAVE_KRB5
+/*-
+ * Pretty much all of this was snatched out of the kinit from the Kerberos5b6
+ * distribution.  The reason why I felt it was necessary to use kinit was
+ * that if someone is locked for a long time, their credentials could expire,
+ * so xlock must be able to get a new ticket.  -- dah <rodmur@ecst.csuchico.edu>
+ */
+#define KRB5_DEFAULT_OPTIONS           0
+#define KRB5_DEFAULT_LIFE 60*60*10     /* 10 hours */
+static int
+krb_check_password(struct passwd *pwd, char *pass)
+{
+       krb5_context kcontext;
+       krb5_timestamp now;
+       krb5_ccache ccache = NULL;
+       krb5_principal me;
+       krb5_principal server;
+       int         options = KRB5_DEFAULT_OPTIONS;
+       krb5_deltat lifetime = KRB5_DEFAULT_LIFE;
+       krb5_error_code code;
+       krb5_creds  my_creds;
+       char       *client_name;
+       krb5_address **addrs = (krb5_address **) 0;
+       krb5_preauthtype *preauth = NULL;
+
+        krb5_deltat rlife = 0;
+
+       krb5_data   tgtname =
+       {
+               0,
+               KRB5_TGS_NAME_SIZE,
+               KRB5_TGS_NAME
+       };
+
+       krb5_init_context(&kcontext);
+       krb5_init_ets(kcontext);
+
+       if ((code = krb5_timeofday(kcontext, &now))) {
+               com_err(ProgramName, code, "while getting time of day");
+               return False;   /* seems better to deny access, than just exit, which
+                                  was what happened in kinit  */
+       }
+       if ((code = krb5_cc_default(kcontext, &ccache))) {
+               com_err(ProgramName, code, "while getting default ccache");
+               return False;
+       }
+       code = krb5_cc_get_principal(kcontext, ccache, &me);
+       if (code) {
+               if ((code = krb5_parse_name(kcontext, pwd->pw_name, &me))) {
+                       com_err(ProgramName, code, "when parsing name %s", pwd->pw_name);
+                       return False;
+               }
+       }
+       if ((code = krb5_unparse_name(kcontext, me, &client_name))) {
+               com_err(ProgramName, code, "when unparsing name");
+               return False;
+       }
+       (void) memset((char *) &my_creds, 0, sizeof (my_creds));
+
+
+       if ((code = krb5_build_principal_ext(kcontext, &server,
+                                     krb5_princ_realm(kcontext, me)->length,
+                                       krb5_princ_realm(kcontext, me)->data,
+                                            tgtname.length, tgtname.data,
+                                     krb5_princ_realm(kcontext, me)->length,
+                                       krb5_princ_realm(kcontext, me)->data,
+                                            0))) {
+               com_err(ProgramName, code, "while building server name");
+               return False;
+       }
+
+
+       my_creds.client = me;
+       my_creds.server = server;
+
+       my_creds.times.starttime = 0;
+
+       my_creds.times.renew_till = 0;
+
+       /*
+        ** find our default ticket, and copy out renewable, forwardable info.
+        */
+       {
+       krb5_cc_cursor cur;
+       krb5_creds creds;
+
+       if ((code = krb5_cc_start_seq_get(kcontext, ccache, &cur))) {
+           com_err(ProgramName, code, "while starting to retrieve tickets");
+       } else {
+
+           while (!(code = krb5_cc_next_cred(kcontext, ccache, &cur, &creds))) {
+               if (creds.server->length == 2 &&
+                       strcmp(creds.server->realm.data, me->realm.data) == 0 &&
+                       strcmp((char *)creds.server->data[0].data, "krbtgt") == 0 &&
+                       strcmp((char *)creds.server->data[1].data, me->realm.data) == 0 &&
+                       creds.times.endtime > now) {
+                   /*
+                    ** this is the krbtgt token to steal options from...
+                   */
+           
+                   if (creds.times.renew_till) {
+                      options |= KDC_OPT_RENEWABLE;
+                      my_creds.times.renew_till = creds.times.renew_till;
+                   }
+                   if (creds.ticket_flags & TKT_FLG_FORWARDABLE) {
+                      options |= KDC_OPT_FORWARDABLE;
+                   }
+               }
+               krb5_free_cred_contents(kcontext, &creds);
+           }
+        }
+
+       }
+
+       if (strlen(pass) == 0)
+               (void) strcpy(pass, "*");
+       /* if pass is NULL, krb5_get_in_tkt_with_password will prompt with
+          krb5_default_pwd_prompt1 for password, you don't want that in
+          this application, most likely the user won't have '*' for a
+          password -- dah <rodmur@ecst.csuchico.edu> */
+
+       code = krb5_get_in_tkt_with_password(kcontext, options, addrs,
+                                            NULL, preauth, pass, 0,
+                                            &my_creds, 0);
+
+       (void) memset(pass, 0, sizeof (pass));
+
+       if (code) {
+               if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY)
+                       return False;   /* bad password entered */
+               else {
+                       com_err(ProgramName, code, "while getting initial credentials");
+                       return False;
+               }
+       }
+       code = krb5_cc_initialize(kcontext, ccache, me);
+       if (code != 0) {
+               com_err(ProgramName, code, "when initializing cache");
+               return False;
+       }
+       code = krb5_cc_store_cred(kcontext, ccache, &my_creds);
+       if (code) {
+               com_err(ProgramName, code, "while storing credentials");
+               return False;
+       }
+       krb5_free_principal(kcontext, server);
+
+       krb5_free_context(kcontext);
+
+       return True;            /* success */
+}
+#endif /* HAVE_KRB5 */
+
+#ifndef VMS
+#undef passwd
+#undef pw_name
+#undef pw_passwd
+#ifndef SUNOS_ADJUNCT_PASSWD
+#include <pwd.h>
+#endif
+#endif
+
+#if ( HAVE_FCNTL_H && (defined( USE_MULTIPLE_ROOT ) || defined( USE_MULTIPLE_USER )))
+
+void
+get_multiple(struct passwd *pw)
+{
+       /* This should be the first element on the linked list.
+        * If not, then there could be problems.
+        * Also all memory allocations tend to force an exit of
+        * the program.  This should probably be changed somehow.
+        */
+       if (pwllh == (pwlptr) NULL) {
+               if ((pwll = new_pwlnode()) == (pwlptr) ENOMEM) {
+                       perror("new");
+                       exit(1);
+               }
+               pwllh = pwll;
+       }
+       if ((pwll->pw_name = (char *) strdup(pw->pw_name)) == NULL) {
+               perror("new");
+               exit(1);
+       }
+#ifdef        BSD_AUTH
+       pwll->pw_lc = login_getclass(pw->pw_class);
+#else
+       if ((pwll->pw_passwd = (char *) strdup(pw->pw_passwd)) == NULL) {
+               perror("new");
+               exit(1);
+       }
+#endif
+       if ((pwll->next = new_pwlnode()) == (pwlptr) ENOMEM) {
+               perror("new");
+               exit(1);
+       }
+}
+
+void
+set_multiple(int uid)
+{
+#ifdef BSD_AUTH
+       struct passwd *pw;
+       pwlptr      pwll;
+
+       if (pwllh == (pwlptr) NULL) {
+               if ((pwll = new_pwlnode()) == (pwlptr) ENOMEM) {
+                       perror("new");
+                       exit(1);
+               }
+               pwllh = pwll;
+       }
+       for (pwll = pwllh; pwll->next; pwll = pwll->next);
+
+       while ((pw = getpwent()) != (struct passwd *) NULL) {
+               if (pw->pw_uid != uid)
+                       continue;
+               if ((pwll->pw_name = (char *) strdup(pw->pw_name)) == NULL) {
+                       perror("new");
+                       exit(1);
+               }
+               pwll->pw_lc = login_getclass(pw->pw_class);
+
+               if ((pwll->next = new_pwlnode()) == (pwlptr) ENOMEM) {
+                       perror("new");
+                       exit(1);
+               }
+       }
+
+       if (pwll->next = new_pwlnode())
+               pwll = pwll->next;
+#else /* !BSD_AUTH */
+       /* If you thought the above was sick, then you will think this is
+        * downright horrific.  This is set up so that a child process
+        * is created to read in the password entries using getpwent(3C).
+        * In the man pages on the HPs, getpwent(3C) has in it the fact
+        * that once getpwent(3C) has opened the password file, it keeps
+        * it open until the process is finished.  Thus, the child
+        * process exits immediately after reading the entire password
+        * file.  Otherwise, the password file remains open the entire
+        * time this program is running.
+        *
+        * I went with getpwent(3C) because it will actually read in
+        * the password entries from the NIS maps as well.
+        */
+       struct passwd *pw;
+       int         pipefd[2];
+       char        buf[BUFMAX], xlen;
+       pid_t       cid;
+
+#ifdef HAVE_SHADOW
+       struct spwd *spw;
+
+#endif
+
+       if (pipe(pipefd) < 0) {
+               perror("Pipe Generation");
+               exit(1);
+       }
+       if ((cid = fork()) < 0) {
+               perror("fork");
+               exit(1);
+       } else if (cid == 0) {
+               /* child process.  Used to read in password file.  Also checks to
+                * see if the uid is one we want.  If so, then writes that to the pipe.
+                */
+               register int sbuf = 0;
+               char       *cbuf, *pbuf;
+
+               (void) close(pipefd[0]);
+               while ((pw = getpwent()) != (struct passwd *) NULL) {
+                       if (pw->pw_uid != uid)
+                               continue;
+#ifdef HAVE_SHADOW
+                       if ((spw = getspnam(pw->pw_name)) != NULL) {
+                               char       *tmp;        /* swap */
+
+                               tmp = pw->pw_passwd;
+                               pw->pw_passwd = spw->sp_pwdp;
+                               spw->sp_pwdp = tmp;
+                       }
+#endif
+                       if (pw->pw_passwd[0] != '*') {
+                               xlen = strlen(pw->pw_name);
+                               if ((sbuf + xlen) >= BUFMAX) {
+                                       if (write(pipefd[1], buf, sbuf) != sbuf)
+                                               perror("write");
+                                       sbuf = 0;
+                               }
+                               cbuf = &buf[sbuf];
+                               *cbuf++ = xlen;
+                               for (pbuf = pw->pw_name; *pbuf;)
+                                       *cbuf++ = *pbuf++;
+                               sbuf += xlen + 1;
+
+                               xlen = strlen(pw->pw_passwd);
+                               if ((sbuf + xlen) >= BUFMAX) {
+                                       if (write(pipefd[1], buf, sbuf) != sbuf)
+                                               perror("write");
+                                       sbuf = 0;
+                               }
+                               cbuf = &buf[sbuf];
+                               *cbuf++ = xlen;
+                               for (pbuf = pw->pw_passwd; *pbuf;)
+                                       *cbuf++ = *pbuf++;
+                               sbuf += xlen + 1;
+                       }
+               }
+#ifdef HAVE_SHADOW
+               endspent();
+#endif
+               cbuf = &buf[sbuf];
+               *cbuf = -1;
+               sbuf++;
+               if (write(pipefd[1], buf, sbuf) != sbuf)
+                       perror("write");
+
+               (void) close(pipefd[1]);
+               exit(0);
+       } else {
+               /* parent process.  Does the actual creation of the linked list.
+                * It assumes that everything coming through the pipe are password
+                * entries that are authorized to unlock the screen.
+                */
+               register int bufsize = BUFMAX, done = 0, sbuf = BUFMAX,
+                           i;
+               char       *cbuf, *pbuf;
+               pwlptr      pwll;
+
+               (void) close(pipefd[1]);
+
+               if (pwllh == (pwlptr) NULL) {
+                       if ((pwll = new_pwlnode()) == (pwlptr) ENOMEM) {
+                               perror("new");
+                               exit(1);
+                       }
+                       pwllh = pwll;
+               }
+               for (pwll = pwllh; pwll->next; pwll = pwll->next);
+               while (!done) {
+                       if (sbuf >= bufsize) {
+                               if ((bufsize = read(pipefd[0], buf, BUFMAX)) <= 0)
+                                       perror("read");
+                               sbuf = 0;
+                       }
+                       cbuf = &buf[sbuf];
+                       xlen = *cbuf++;
+                       if (xlen < 0) {
+                               done = 1;
+                               break;
+                       }
+                       sbuf++;
+                       if (sbuf >= bufsize) {
+                               if ((bufsize = read(pipefd[0], buf, BUFMAX)) <= 0)
+                                       perror("read");
+                               sbuf = 0;
+                       }
+                       if ((pwll->pw_name = (char *) malloc(xlen + 1)) == NULL)
+                               break;
+                       pbuf = pwll->pw_name;
+                       cbuf = &buf[sbuf];
+                       for (i = 0; i < xlen; i++) {
+                               *pbuf++ = *cbuf++;
+                               sbuf++;
+                               if (sbuf >= bufsize) {
+                                       if ((bufsize = read(pipefd[0], buf, BUFMAX)) <= 0)
+                                               perror("read");
+                                       sbuf = 0;
+                                       cbuf = buf;
+                               }
+                       }
+                       *pbuf = (char) NULL;
+
+                       cbuf = &buf[sbuf];
+                       xlen = *cbuf++;
+                       sbuf++;
+                       if (sbuf >= bufsize) {
+                               if ((bufsize = read(pipefd[0], buf, BUFMAX)) <= 0)
+                                       perror("read");
+                               sbuf = 0;
+                       }
+                       if ((pwll->pw_passwd = (char *) malloc(xlen + 1)) == NULL)
+                               break;
+                       pbuf = pwll->pw_passwd;
+                       cbuf = &buf[sbuf];
+                       for (i = 0; i < xlen; i++) {
+                               *pbuf++ = *cbuf++;
+                               sbuf++;
+                               if (sbuf >= bufsize) {
+                                       if ((bufsize = read(pipefd[0], buf, BUFMAX)) <= 0)
+                                               perror("read");
+                                       sbuf = 0;
+                                       cbuf = buf;
+                               }
+                       }
+                       *pbuf = (char) NULL;
+
+                       if ((pwll->next = new_pwlnode()) == (pwlptr) ENOMEM)
+                               break;
+                       pwll = pwll->next;
+               }
+               (void) close(pipefd[0]);
+       }
+#endif /* !BSD_AUTH */
+}
+
+#endif
+
+void
+initPasswd(void)
+{
+       getUserName();
+#if !defined( ultrix ) && !defined( DCE_PASSWD ) && !defined( PAM )
+       if (!nolock && !inroot && !inwindow && grabmouse) {
+#ifdef BSD_AUTH
+               struct passwd *pwd = getpwnam(user);
+
+               lc = login_getclass(pwd->pw_class);
+               if (allowroot && (pwd = getpwnam(ROOT)) != NULL)
+                       rlc = login_getclass(pwd->pw_class);
+#else /* !BSD_AUTH */
+#ifdef USE_XLOCKRC
+               gpass();
+#else
+#ifdef FALLBACK_XLOCKRC
+               if (!cpasswd || !*cpasswd)
+                       getCryptedUserPasswd();
+               else
+                       gpass();
+#else
+               getCryptedUserPasswd();
+#endif
+#endif
+               if (allowroot)
+                       getCryptedRootPasswd();
+#endif /* !BSD_AUTH */
+       }
+#endif /* !ultrix && !DCE_PASSWD && !PAM */
+#ifdef DCE_PASSWD
+       initDCE();
+#endif
+}
diff --git a/xlock/passwd.h b/xlock/passwd.h
new file mode 100644 (file)
index 0000000..3ea029b
--- /dev/null
@@ -0,0 +1,16 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)passwd.h   4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Password stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+extern void initPasswd(void);
+extern int checkPasswd(char *buffer);
diff --git a/xlock/random.c b/xlock/random.c
new file mode 100644 (file)
index 0000000..b40e4b7
--- /dev/null
@@ -0,0 +1,45 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)random.c     4.10 98/04/23 xlockmore";
+
+#endif
+
+/*-
+ * random.c - various utilities for random numbers
+ *
+ * Copyright (c) 1998 by David Bagley
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 23-Apr-96: Separated out of util.c
+ *
+ */
+
+
+/*-
+ * Dr. Park's algorithm published in the Oct. '88 ACM  "Random Number
+ * Generators: Good Ones Are Hard To Find" His version available at
+ * ftp://cs.wm.edu/pub/rngs.tar Present form by many authors.
+ */
+
+static int  Seed = 1;          /* This is required to be 32 bits long */
+
+/*-
+ *      Given an integer, this routine initializes the RNG seed.
+ */
+void
+SetRNG(long int s)
+{
+       Seed = (int) s;
+}
+
+/*-
+ *      Returns an integer between 0 and 2147483647, inclusive.
+ */
+long
+LongRNG(void)
+{
+       if ((Seed = Seed % 44488 * 48271 - Seed / 44488 * 3399) < 0)
+               Seed += 2147483647;
+       return (long) (Seed - 1);
+}
diff --git a/xlock/random.h b/xlock/random.h
new file mode 100644 (file)
index 0000000..cbde408
--- /dev/null
@@ -0,0 +1,106 @@
+#ifndef _RANDOM_H_
+#define _RANDOM_H_
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)random.h   4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Random stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+/*** random number generator ***/
+/* defaults */
+#ifdef STANDALONE
+/*-
+ * Compatibility with the xlockmore RNG API
+ * (note that the xlockmore hacks never expect negative numbers.)
+ */
+#define LRAND()     ((long) (random() & 0x7fffffff))
+#define NRAND(n)    ((int) (LRAND() % (n)))
+#define MAXRAND     (2147483648.0)     /* unsigned 1<<31 as a float */
+#define SRAND(n)               /* already seeded by screenhack.c */
+#else /* STANDALONE */
+#ifdef HAVE_RAND48
+#define SRAND srand48
+#define LRAND lrand48
+#define MAXRAND (2147483648.0)
+#ifndef DECLARED_SRAND48
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void srand48(long int);
+extern long int lrand48(void);
+#ifdef __cplusplus
+}
+#endif
+#endif
+#else /* HAVE_RAND48 */
+#ifdef HAVE_RANDOM
+#define SRAND srandom
+#define LRAND random
+#define MAXRAND (2147483648.0)
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void srandom(unsigned int);
+extern long int random(void);
+#ifdef __cplusplus
+}
+#endif
+#else /* HAVE_RANDOM */
+#ifdef HAVE_RAND
+#define SRAND srand
+#define LRAND rand
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void srand(unsigned int);
+extern int rand(void);
+#ifdef __cplusplus
+}
+#endif
+#ifdef AIXV3
+#define MAXRAND (2147483648.0)
+#else
+#define MAXRAND (32768.0)
+#endif
+#endif /* HAVE_RAND */
+#endif /* HAVE_RANDOM */
+#endif /* HAVE_RAND48 */
+
+#ifndef SRAND
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern void SetRNG(long int s);
+#ifdef __cplusplus
+  }
+#endif
+
+#define SRAND(X) SetRNG((long) X)
+#endif
+#ifndef LRAND
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern long LongRNG(void);
+#ifdef __cplusplus
+  }
+#endif
+
+extern long LongRNG(void);
+#define LRAND() LongRNG()
+#endif
+#ifndef MAXRAND
+#define MAXRAND (2147483648.0)
+#endif
+#define NRAND(X) ((int)(LRAND()%(X)))
+#endif /* STANDALONE */
+#endif /* _RANDOM_H_ */
diff --git a/xlock/ras.c b/xlock/ras.c
new file mode 100644 (file)
index 0000000..0ca641e
--- /dev/null
@@ -0,0 +1,94 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)ras.c        4.00 97/01/01 xlockmore";
+
+#endif
+
+/*-
+ * Utilities for Sun rasterfile processing
+ *
+ * Copyright (c) 1995 by Tobias Gloth
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ *  3-Mar-96: Added random image selection.
+ * 12-Dec-95: Modified to be a used in more than one mode
+ *            <joukj@hrem.stm.tudelft.nl>
+ * 22-May-95: Written.
+ */
+
+#include "xlock.h"
+#include "iostuff.h"
+#include "ras.h"
+#include <time.h>
+
+XLockImage xlockimage;
+
+static unsigned long get_long(int n);
+
+static void
+analyze_header(void)
+{
+       xlockimage.sign = get_long(0);
+       xlockimage.width = get_long(1);
+       xlockimage.height = get_long(2);
+       xlockimage.depth = get_long(3);
+       xlockimage.colors = get_long(7) / 3;
+}
+
+static unsigned long
+get_long(int n)
+{
+       return
+               (((unsigned long) xlockimage.header[4 * n + 0]) << 24) +
+               (((unsigned long) xlockimage.header[4 * n + 1]) << 16) +
+               (((unsigned long) xlockimage.header[4 * n + 2]) << 8) +
+               (((unsigned long) xlockimage.header[4 * n + 3]) << 0);
+}
+
+int
+RasterFileToImage(ModeInfo * mi, char *filename, XImage ** image)
+{
+       int         read_width;
+       FILE       *file;
+
+       if ((file = my_fopen(filename, "r")) == NULL) {
+               /*(void) fprintf(stderr, "could not read file \"%s\"\n", filename); */
+               return RasterOpenFailed;
+       }
+       (void) fread((void *) xlockimage.header, 8, 4, file);
+       analyze_header();
+       if (xlockimage.sign != 0x59a66a95) {
+               /* not a raster file */
+               (void) fclose(file);
+               return RasterFileInvalid;
+       }
+       if (xlockimage.depth != 8) {
+               (void) fclose(file);
+               (void) fprintf(stderr, "only 8-bit Raster files are supported\n");
+               return RasterColorFailed;
+       }
+       read_width = (int) xlockimage.width;
+       if ((xlockimage.width & 1) != 0)
+               read_width++;
+       xlockimage.data = (unsigned char *) malloc((int) (read_width * xlockimage.height));
+       if (!xlockimage.data) {
+               (void) fclose(file);
+               (void) fprintf(stderr, "out of memory for Raster file\n");
+               return RasterNoMemory;
+       }
+       *image = XCreateImage(MI_DISPLAY(mi), MI_VISUAL(mi),
+                             8, ZPixmap, 0,
+                       (char *) xlockimage.data, (int) xlockimage.width, (int) xlockimage.height,
+                             16, (int) read_width);
+       if (!*image) {
+               (void) fclose(file);
+               (void) fprintf(stderr, "could not create image from Raster file\n");
+               return RasterColorError;
+       }
+       (void) fread((void *) xlockimage.color, (int) xlockimage.colors, 3, file);
+       (void) fread((void *) xlockimage.data, read_width, (int) xlockimage.height, file);
+       (void) fclose(file);
+       convert_colors(mi);
+       return RasterSuccess;
+}
diff --git a/xlock/ras.h b/xlock/ras.h
new file mode 100644 (file)
index 0000000..93151a4
--- /dev/null
@@ -0,0 +1,28 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident        "@(#)ras.h      4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Utilities for Sun rasterfile processing
+ *
+ * Copyright (c) 1995 by Tobias Gloth
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 12-Dec-95: Modified to be a used in more than one mode
+ *            <joukj@hrem.stm.tudelft.nl>
+ * 22-May-95: Written.
+ */
+
+#include "xlockimage.h"
+
+#define RasterColorError   1
+#define RasterSuccess      0
+#define RasterOpenFailed  -1
+#define RasterFileInvalid -2
+#define RasterNoMemory    -3
+#define RasterColorFailed -4
+
+extern int  RasterFileToImage(ModeInfo * mi, char *filename, XImage ** image);
diff --git a/xlock/resource-msg-jp.h b/xlock/resource-msg-jp.h
new file mode 100644 (file)
index 0000000..1ce6fa2
--- /dev/null
@@ -0,0 +1,18 @@
+/* Japanese messages are separate to another file.             */
+/* Because Japanese EUC-JP encoding is conflict with ISO-8859. */
+/* By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>         */
+
+#ifndef __RESOURCE_MSG_JP__
+#define __RESOURCE_MSG_JP__
+
+#define DEF_NAME        "¥í¥°¥¤¥ó̾: "
+#define DEF_PASS        "¥Ñ¥¹¥ï¡¼¥É: "
+#define DEF_VALID       "¥Ñ¥¹¥ï¡¼¥É¸¡ººÃæ..."
+#define DEF_INVALID     "¥Ñ¥¹¥ï¡¼¥É¤¬°ã¤¤¤Þ¤¹¡£"
+#define DEF_INFO        "¥Ñ¥¹¥ï¡¼¥É¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤ÈºÆ¥í¥Ã¥¯¤·¤Þ¤¹¡£"
+
+#define DEF_BTN_LABEL  "¥í¥°¥¢¥¦¥È"
+#define DEF_BTN_HELP   "¤³¤³¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¥í¥°¥¢¥¦¥È"
+#define DEF_FAIL       "¼«Æ°¥í¥°¥¢¥¦¥È¼ºÇÔ"
+
+#endif
diff --git a/xlock/resource.c b/xlock/resource.c
new file mode 100644 (file)
index 0000000..236881e
--- /dev/null
@@ -0,0 +1,2171 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)resource.c   4.08 98/08/04 xlockmore";
+
+#endif
+
+/*-
+ * resource.c - resource management for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 19-Jun-98: batchcount depreciated.  Use count instead.  batchcount still
+ *            works for commandline.
+ * 01-May-97: Matthew Rench <mdrench@mtu.edu>
+ *            Added DPMS options.
+ * 01-Apr-97: Tom Schmidt <tschmidt@micron.com>
+ *            Fixed memory leak.  Made -visual option a hacker mode for now.
+ * 20-Mar-97: Tom Schmidt <tschmidt@micron.com>
+ *            Added -visual option.
+ *  3-Apr-96: Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ *            Supply for wildcards for filenames for random selection
+ * 18-Mar-96: Ron Hitchens <ron@idiom.com>
+ *            Setup chosen mode with set_default_mode() for new hook scheme.
+ *  6-Mar-96: Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ *            Remote node checking for VMS fixed
+ * 20-Dec-95: Ron Hitchens <ron@idiom.com>
+ *            Resource parsing fixed for "nolock".
+ * 02-Aug-95: Patch to use default delay, etc., from mode.h thanks to
+ *            Roland Bock <exp120@physik.uni-kiel.d400.de>
+ * 17-Jun-95: Split out mode.h from resource.c .
+ * 29-Mar-95: Added -cycles for more control over a lockscreen similar to
+ *            -delay, -batchcount, and -saturation.
+ * 21-Feb-95: MANY patches from Heath A. Kehoe <hakehoe@icaen.uiowa.edu>.
+ * 21-Dec-94: patch for -delay, -batchcount and -saturation for X11R5+
+ *            from Patrick D Sullivan <pds@bss.com>.
+ * 18-Dec-94: -inroot option added from Bill Woodward <wpwood@pencom.com>.
+ * 20-Sep-94: added bat mode from Lorenzo Patocchi <patol@info.isbiel.ch>.
+ * 11-Jul-94: added grav mode, and inwindow option from Greg Bowering
+ *            <greg@cs.adelaide.edu.au>
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 17-Jun-94: default changed from life to blank
+ * 21-Mar-94: patch fix for AIXV3 from <R.K.Lloyd@csc.liv.ac.uk>
+ * 01-Dec-93: added patch for AIXV3 from Tom McConnell
+ *            <tmcconne@sedona.intel.com>
+ * 29-Jun-93: added spline, maze, sphere, hyper, helix, rock, and blot mode.
+ *
+ * Changes of Patrick J. Naughton
+ * 25-Sep-91: added worm mode.
+ * 24-Jun-91: changed name to username.
+ * 06-Jun-91: Added flame mode.
+ * 24-May-91: Added -name and -usefirst and -resources.
+ * 16-May-91: Added random mode and pyro mode.
+ * 26-Mar-91: checkResources: delay must be >= 0.
+ * 29-Oct-90: Added #include <ctype.h> for missing isupper() on some OS revs.
+ *           moved -mode option, reordered Xrm database evaluation.
+ * 28-Oct-90: Added text strings.
+ * 26-Oct-90: Fix bug in mode specific options.
+ * 31-Jul-90: Fix ':' handling in parsefilepath
+ * 07-Jul-90: Created from resource work in xlock.c
+ *
+ */
+
+#include "xlock.h"
+#include "vis.h"
+#include "iostuff.h"
+#include "version.h"
+#if VMS
+# if ( __VMS_VER < 70000000 )
+#  ifdef __DECC
+#   define gethostname decc$gethostname
+#   define gethostbyname decc$gethostbyname
+#  endif
+# else
+#  include <socket.h>
+# endif
+#endif
+
+#ifdef __sgi
+#undef offsetof
+#endif
+
+#ifndef offsetof
+# define offsetof(s,m) ((char*)(&((s *)0)->m)-(char*)0)
+#endif
+
+#ifdef USE_MODULES
+# ifndef DEF_MODULEPATH
+#  define DEF_MODULEPATH "/usr/lib/X11/xlock_modules"
+# endif
+#endif
+
+#ifndef DEF_FILESEARCHPATH
+# ifdef VMS
+#  include <descrip>
+#  include <iodef>
+#  include <ssdef>
+#  include <stsdef>
+#  include <types.h>
+#  include <starlet.h>
+
+#  define DEF_FILESEARCHPATH "DECW$SYSTEM_DEFAULTS:DECW$%N.DAT%S"
+#  define BUFSIZE 132
+#  define DECW$C_WS_DSP_TRANSPORT 2    /*  taken from wsdriver.lis */
+#  define IO$M_WS_DISPLAY 0x00000040   /* taken from wsdriver */
+
+struct descriptor_t {          /* descriptor structure         */
+       unsigned short len;
+       unsigned char type;
+       unsigned char c_class;
+       char       *ptr;
+};
+typedef struct descriptor_t dsc;
+
+/* $dsc creates a descriptor for a predefined string */
+
+#  define $dsc(name,string) dsc name = { sizeof(string)-1,14,1,string}
+
+/* $dscp creates a descriptor pointing to a buffer allocated elsewhere */
+
+#  define $dscp(name,size,addr) dsc name = { size,14,1,addr }
+
+static int  descr();
+
+# else
+#  define DEF_FILESEARCHPATH "/usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%T/%N%S"
+# endif
+#endif
+#ifndef DEF_MODE
+# if 0
+#  define DEF_MODE     "blank" /* May be safer */
+# else
+#  define DEF_MODE     "random"        /* May be more interesting */
+# endif
+#endif
+#define DEF_DELAY      "200000"        /* microseconds between batches */
+#define DEF_COUNT      "100"   /* vectors (or whatever) per batch */
+#define DEF_CYCLES     "1000"  /* timeout in cycles for a batch */
+#define DEF_SIZE       "0"     /* size, default if 0 */
+#define DEF_NCOLORS    "64"    /* maximum number of colors */
+#define DEF_SATURATION "1.0"   /* color ramp saturation 0->1 */
+#define DEF_NICE       "10"    /* xlock process nicelevel */
+#define DEF_ERASEDELAY "400"   /* Speed for screen erase modes */
+#define DEF_ERASETIME  "2"     /* Maximum number of seconds for erase */
+#define DEF_LOCKDELAY  "0"     /* secs until lock */
+#define DEF_TIMEOUT    "30"    /* secs until password entry times out */
+#ifndef DEF_FONT
+# ifdef AIXV3
+#  define DEF_FONT     "fixed"
+# else /* !AIXV3 */
+#  define DEF_FONT     "-b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1"
+# endif /* !AIXV3 */
+#endif
+#define DEF_PLANFONT     "-adobe-courier-medium-r-*-*-14-*-*-*-m-*-iso8859-1"
+#ifdef USE_MB
+# define DEF_FONTSET   DEF_FONT ## ",-*-24-*"
+#endif
+#define DEF_BG         "White"
+#define DEF_FG         "Black"
+#ifdef FR
+# define DEF_NAME      "Nom: "
+# define DEF_PASS      "Mot de passe: "
+# define DEF_VALID     "Validation ..."
+# define DEF_INVALID   "Mot de passe Invalide."
+# define DEF_INFO      "Entrez le mot de passe ou choisissez l'icone pour verrouiller."
+#else
+#if defined NL
+# define DEF_NAME      "Naam: "
+# define DEF_PASS      "Wachtwoord: "
+# define DEF_VALID     "Aan het checken ..."
+# define DEF_INVALID   "Ongeldig wachtwoord."
+# define DEF_INFO      "Geef wachtwoord om te ontgrendelen ; selecteer het icoon om te vergendelen."
+#else
+#if defined JP
+# include "resource-msg-jp.h"
+#else
+# define DEF_NAME      "Name: "
+# define DEF_PASS      "Password: "
+# define DEF_VALID     "Validating login..."
+# define DEF_INVALID   "Invalid login."
+# define DEF_INFO      "Enter password to unlock; select icon to lock."
+#endif
+#endif
+#endif
+#ifdef GLOBAL_UNLOCK
+# define DEF_GUSER "Username: "
+#endif
+#ifdef SAFEWORD
+# define DEF_DPASS "Dynamic password: "
+# define DEF_FPASS "Fixed Password: "
+# define DEF_CHALL "Challenge: "
+#endif
+#define DEF_GEOMETRY   ""
+#define DEF_ICONGEOMETRY       ""
+#ifdef FX
+# define DEF_GLGEOMETRY ""
+#endif
+#define DEF_DELTA3D    "1.5"   /* space between things in 3d mode relative to their size */
+#ifndef DEF_MESSAGESFILE
+# define DEF_MESSAGESFILE      ""
+#endif
+#ifndef DEF_MESSAGEFILE
+# define DEF_MESSAGEFILE ""
+#endif
+#ifndef DEF_MESSAGE
+/* #define DEF_MESSAGE "I am out running around." */
+# define DEF_MESSAGE ""
+#endif
+#ifndef DEF_BITMAP
+# define DEF_BITMAP ""
+#endif
+#ifndef DEF_MAILAPP
+# define DEF_MAILAPP ""
+#endif
+#ifdef USE_VTLOCK
+# define VTLOCKMODE_OFF        "off"
+# define VTLOCKMODE_NOSWITCH     "noswitch"
+# define VTLOCKMODE_SWITCH       "switch"
+# define VTLOCKMODE_RESTORE      "restore"
+# define DEF_VTLOCK              VTLOCKMODE_OFF
+#endif
+#define DEF_CLASSNAME  "XLock"
+#if 0
+/*-
+  Grid     Number of Neigbors
+  ----     ------------------
+  Square   4 or 8
+  Hexagon  6
+  Triangle 3, 9 or 12     <- 9 is not too mathematically sound...
+*/
+# define DEF_NEIGHBORS  "0"    /* automata mode will choose best or random value */
+# define DEF_MOUSE   "False"
+#endif
+
+#ifdef USE_RPLAY
+# define DEF_LOCKSOUND "thank-you"
+# define DEF_INFOSOUND "identify-please"
+# define DEF_VALIDSOUND        "complete"
+# define DEF_INVALIDSOUND      "not-programmed"
+#else /* !USE_RPLAY */
+# if defined ( DEF_PLAY ) || defined ( USE_NAS )
+#  define DEF_LOCKSOUND        "thank-you.au"
+#  define DEF_INFOSOUND        "identify-please.au"
+#  define DEF_VALIDSOUND       "complete.au"
+#  define DEF_INVALIDSOUND     "not-programmed.au"
+# else /* !DEF_PLAY && !USE_NAS */
+#  ifdef USE_VMSPLAY
+#   define DEF_LOCKSOUND       "[]thank-you.au"
+#   define DEF_INFOSOUND       "[]identify-please.au"
+#   define DEF_VALIDSOUND      "[]complete.au"
+#   define DEF_INVALIDSOUND    "[]not-programmed.au"
+#  endif /* !USE_VMSPLAY */
+#  ifdef USE_ESOUND
+#   ifndef DEFAULT_SOUND_DIR
+#    define DEFAULT_SOUND_DIR "/usr/share/sounds/xlockmore"
+#   endif
+#   define DEF_LOCKSOUND       "thank-you.au"
+#   define DEF_INFOSOUND       "identify-please.au"
+#   define DEF_VALIDSOUND      "complete.au"
+#   define DEF_INVALIDSOUND    "not-programmed.au"
+#  endif
+# endif /* !DEF_PLAY && !USE_NAS */
+#endif /* !USE_RPLAY */
+
+#if defined( USE_AUTO_LOGOUT ) && !defined( DEF_AUTO_LOGOUT )
+# if ( USE_AUTO_LOGOUT <= 0 )
+#  define DEF_AUTO_LOGOUT "120"        /* User Default, can be overridden */
+# else
+#  define DEF_AUTO_LOGOUT "0"  /* User Default, can be overridden */
+# endif
+#endif
+
+#ifdef USE_DPMS
+# define DEF_DPMSSTANDBY "-1"
+# define DEF_DPMSSUSPEND "-1"
+# define DEF_DPMSOFF     "-1"
+#endif
+
+#if defined( USE_BUTTON_LOGOUT )
+# if !defined( DEF_BUTTON_LOGOUT )
+#  if ( USE_BUTTON_LOGOUT <= 0 )
+#   define DEF_BUTTON_LOGOUT "5"       /* User Default, can be overridden */
+#  else
+#   define DEF_BUTTON_LOGOUT "0"       /* User Default, can be overridden */
+#  endif
+# endif
+
+# ifdef FR
+#  define DEF_BTN_LABEL        "Logout"
+#  define DEF_BTN_HELP "Cliquer ici pour etre deloger"
+#  define DEF_FAIL     "Auto-logout a echoue"
+# else
+#ifdef NL
+#  define DEF_BTN_LABEL "Loguit"
+#  define DEF_BTN_HELP  "klik hier om uit te loggen"
+#  define DEF_FAIL  "Auto-loguit mislukt"
+# else
+#ifdef JP
+#  include "resource-msg-jp.h"
+# else
+#  define DEF_BTN_LABEL        "Logout"        /* string that appears in logout button */
+
+/* this string appears immediately below logout button */
+#  define DEF_BTN_HELP "Click here to logout"
+
+/* this string appears in place of the logout button if user could not be
+   logged out */
+#  define DEF_FAIL     "Auto-logout failed"
+
+# endif
+#endif
+#endif
+#endif
+
+/* For modes with text, marquee & nose */
+extern char *program;
+extern char *messagesfile;
+extern char *messagefile;
+extern char *message;          /* flag as well here */
+extern char *messagefontname;
+
+#if 0
+/* For automata modes */
+extern int  neighbors;
+
+/* For eyes, julia, & swarm modes */
+Bool        mouse;
+#endif
+
+char        hostname[MAXHOSTNAMELEN];
+static char *mode = NULL;
+char       *displayname = NULL;
+static char *classname;
+static char *modename;
+static char *modeclassname;
+extern Window parent;
+static char *parentname;
+extern Bool parentSet;
+
+#if HAVE_DIRENT_H
+static struct dirent ***images_list = NULL;
+int         num_list = 0;
+struct dirent **image_list = NULL;
+char        filename_r[MAXNAMLEN];
+char        directory_r[DIRBUF];
+
+#endif
+
+static XrmOptionDescRec genTable[] =
+{
+       {(char *) "-mode", (char *) ".mode", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-erasemode", (char *) ".erasemode", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-erasedelay", (char *) ".erasedelay", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-erasetime", (char *) ".erasetime", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-nolock", (char *) ".nolock", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+nolock", (char *) ".nolock", XrmoptionNoArg, (caddr_t) "off"},
+#ifdef USE_VTLOCK
+       {(char *) "-vtlock", (char *) ".vtlock", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+       {(char *) "-inwindow", (char *) ".inwindow", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+inwindow", (char *) ".inwindow", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-inroot", (char *) ".inroot", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+inroot", (char *) ".inroot", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-remote", (char *) ".remote", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+remote", (char *) ".remote", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-mono", (char *) ".mono", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+mono", (char *) ".mono", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-allowaccess", (char *) ".allowaccess", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+allowaccess", (char *) ".allowaccess", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-allowroot", (char *) ".allowroot", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+allowroot", (char *) ".allowroot", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-debug", (char *) ".debug", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+debug", (char *) ".debug", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-description", (char *) ".description", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+description", (char *) ".description", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-echokeys", (char *) ".echokeys", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+echokeys", (char *) ".echokeys", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-enablesaver", (char *) ".enablesaver", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+enablesaver", (char *) ".enablesaver", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-resetsaver", (char *) ".resetsaver", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+resetsaver", (char *) ".resetsaver", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-grabmouse", (char *) ".grabmouse", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+grabmouse", (char *) ".grabmouse", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-grabserver", (char *) ".grabserver", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+grabserver", (char *) ".grabserver", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-hide", (char *) ".hide", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+hide", (char *) ".hide", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-install", (char *) ".install", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+install", (char *) ".install", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-mousemotion", (char *) ".mousemotion", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+mousemotion", (char *) ".mousemotion", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-sound", (char *) ".sound", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+sound", (char *) ".sound", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-timeelapsed", (char *) ".timeelapsed", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+timeelapsed", (char *) ".timeelapsed", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-usefirst", (char *) ".usefirst", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+usefirst", (char *) ".usefirst", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-verbose", (char *) ".verbose", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+verbose", (char *) ".verbose", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-nice", (char *) ".nice", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-lockdelay", (char *) ".lockdelay", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-timeout", (char *) ".timeout", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-font", (char *) ".font", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-planfont", (char *) ".planfont", XrmoptionSepArg, (caddr_t) NULL},
+#ifdef USE_MB
+       {(char *) "-fontset", (char *) ".fontset", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+       {(char *) "-bg", (char *) ".background", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-fg", (char *) ".foreground", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-background", (char *) ".background", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-foreground", (char *) ".foreground", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-username", (char *) ".username", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-password", (char *) ".password", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-info", (char *) ".info", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-validate", (char *) ".validate", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-invalid", (char *) ".invalid", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-geometry", (char *) ".geometry", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-icongeometry", (char *) ".icongeometry", XrmoptionSepArg, (caddr_t) NULL},
+#ifdef FX
+       {(char *) "-glgeometry", (char *) ".glgeometry", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+
+       {(char *) "-wireframe", (char *) ".wireframe", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+wireframe", (char *) ".wireframe", XrmoptionNoArg, (caddr_t) "off"},
+
+#ifdef USE_GL
+       {(char *) "-showfps", (char *) ".showfps", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+showfps", (char *) ".showfps", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-fpstop", (char *) ".fpstop", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+fpstop", (char *) ".fpstop", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-fpsfont", (char *) ".fpsfont", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+
+       {(char *) "-use3d", (char *) ".use3d", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+use3d", (char *) ".use3d", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-delta3d", (char *) ".delta3d", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-none3d", (char *) ".none3d", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-right3d", (char *) ".right3d", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-left3d", (char *) ".left3d", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-both3d", (char *) ".both3d", XrmoptionSepArg, (caddr_t) NULL},
+
+    /* For modes with text, marquee & nose */
+       {(char *) "-program", (char *) ".program", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-messagesfile", (char *) ".messagesfile", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-messagefile", (char *) ".messagefile", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-message", (char *) ".message", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-messagefont", (char *) ".messagefont", XrmoptionSepArg, (caddr_t) NULL},
+#if 0
+    /* For automata modes */
+       {(char *) "-neighbors", (char *) ".neighbors", XrmoptionSepArg, (caddr_t) NULL},
+    /* For eyes, julia, and swarm modes */
+       {(char *) "-mouse", (char *) ".mouse", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+mouse", (char *) ".mouse", XrmoptionNoArg, (caddr_t) "off"},
+#endif
+
+#if defined( USE_XLOCKRC ) || defined( FALLBACK_XLOCKRC )
+       {(char *) "-cpasswd", (char *) ".cpasswd", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+#ifdef USE_AUTO_LOGOUT
+       {(char *) "-logoutAuto", (char *) ".logoutAuto", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+#ifdef USE_BUTTON_LOGOUT
+       {(char *) "-logoutButton", (char *) ".logoutButton", XrmoptionSepArg, (caddr_t) NULL},
+{(char *) "-logoutButtonLabel", (char *) ".logoutButtonLabel", XrmoptionSepArg, (caddr_t) NULL},
+ {(char *) "-logoutButtonHelp", (char *) ".logoutButtonHelp", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-logoutFailedString", (char *) ".logoutFailedString", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+#ifdef USE_DTSAVER
+       {(char *) "-dtsaver", (char *) ".dtsaver", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+dtsaver", (char *) ".dtsaver", XrmoptionNoArg, (caddr_t) "off"},
+#endif
+#ifdef USE_SOUND
+       {(char *) "-locksound", (char *) ".locksound", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-infosound", (char *) ".infosound", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-validsound", (char *) ".validsound", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-invalidsound", (char *) ".invalidsound", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+       {(char *) "-startCmd", (char *) ".startCmd", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-endCmd", (char *) ".endCmd", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-logoutCmd", (char *) ".logoutCmd", XrmoptionSepArg, (caddr_t) NULL},
+
+       {(char *) "-mailCmd", (char *) ".mailCmd", XrmoptionSepArg, (caddr_t) ""},
+       {(char *) "-mailIcon", (char *) ".mailIcon", XrmoptionSepArg, (caddr_t) ""},
+       {(char *) "-nomailIcon", (char *) ".nomailIcon", XrmoptionSepArg, (caddr_t) ""},
+#ifdef USE_DPMS
+       {(char *) "-dpmsstandby", (char *) ".dpmsstandby", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-dpmssuspend", (char *) ".dpmssuspend", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-dpmsoff", (char *) ".dpmsoff", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+};
+
+#define genEntries (sizeof genTable / sizeof genTable[0])
+
+static XrmOptionDescRec modeTable[] =
+{
+       {(char *) "-delay", (char *) "*delay", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-batchcount", (char *) "*count", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-count", (char *) "*count", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-cycles", (char *) "*cycles", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-size", (char *) "*size", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-ncolors", (char *) "*ncolors", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-saturation", (char *) "*saturation", XrmoptionSepArg, (caddr_t) NULL},
+    /* For modes with images, xbm, xpm, & ras */
+       {(char *) "-bitmap", (char *) "*bitmap", XrmoptionSepArg, (caddr_t) NULL},
+};
+
+#define modeEntries (sizeof modeTable / sizeof modeTable[0])
+
+/*-
+   Chicken/egg problem here.
+   Customization strings will only work with
+#define CUSTOMIZATION
+   I prefer not to use it because "xlock -display whatever:0" does not work.
+   If I get any complaints about this I will change it the default.
+ */
+
+static XrmOptionDescRec cmdlineTable[] =
+{
+#ifndef CUSTOMIZATION
+       {(char *) "-display", (char *) ".display", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+       {(char *) "-visual", (char *) ".visual", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-parent", (char *) ".parent", XrmoptionSepArg, (caddr_t) NULL},
+       {(char *) "-nolock", (char *) ".nolock", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+nolock", (char *) ".nolock", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-remote", (char *) ".remote", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+remote", (char *) ".remote", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-inwindow", (char *) ".inwindow", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+inwindow", (char *) ".inwindow", XrmoptionNoArg, (caddr_t) "off"},
+       {(char *) "-inroot", (char *) ".inroot", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+inroot", (char *) ".inroot", XrmoptionNoArg, (caddr_t) "off"},
+#ifdef USE_DTSAVER
+       {(char *) "-dtsaver", (char *) ".dtsaver", XrmoptionNoArg, (caddr_t) "on"},
+       {(char *) "+dtsaver", (char *) ".dtsaver", XrmoptionNoArg, (caddr_t) "off"},
+#endif
+       {(char *) "-xrm", NULL, XrmoptionResArg, (caddr_t) NULL}
+};
+
+#define cmdlineEntries (sizeof cmdlineTable / sizeof cmdlineTable[0])
+
+static XrmOptionDescRec earlyCmdlineTable[] =
+{
+       {(char *) "-name", (char *) ".name", XrmoptionSepArg, (caddr_t) NULL},
+#ifdef CUSTOMIZATION
+       {(char *) "-display", (char *) ".display", XrmoptionSepArg, (caddr_t) NULL},
+#endif
+};
+
+#define earlyCmdlineEntries (sizeof earlyCmdlineTable / sizeof earlyCmdlineTable[0])
+
+#ifdef USE_MODULES
+static XrmOptionDescRec modulepathTable[] =
+{
+       {(char *) "-modulepath", (char *) ".modulepath", XrmoptionSepArg, (caddr_t) NULL},
+};
+
+#endif
+
+static OptionStruct opDesc[] =
+{
+       {(char *) "-help", (char *) "print out this message to standard output"},
+       {(char *) "-version", (char *) "print version number (if >= 4.00) to standard output"},
+       {(char *) "-resources", (char *) "print default resource file to standard output"},
+       {(char *) "-display displayname", (char *) "X server to contact"},
+#ifdef USE_MODULES
+       {(char *) "-modulepath", (char *) "directory where screensaver modules are stored"},
+#endif
+       {(char *) "-visual visualname", (char *) "X visual to use"},
+       {(char *) "-parent", (char *) "parent window id (for inwindow)"},
+{(char *) "-name resourcename", (char *) "class name to use for resources (default is XLock)"},
+       {(char *) "-delay usecs", (char *) "microsecond delay between screen updates"},
+       {(char *) "-batchcount num", (char *) "number of things per batch (depreciated)"},
+       {(char *) "-count num", (char *) "number of things per batch"},
+       {(char *) "-cycles num", (char *) "number of cycles per batch"},
+       {(char *) "-size num", (char *) "size of a unit in a mode, default is 0"},
+       {(char *) "-ncolors num", (char *) "maximum number of colors, default is 64"},
+       {(char *) "-saturation value", (char *) "saturation of color ramp"},
+  /* For modes with images, xbm, xpm, & ras */
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+       {(char *) "-bitmap filename", (char *) "bitmap file (sometimes xpm and ras too)"},
+#else
+       {(char *) "-bitmap filename", (char *) "bitmap file (sometimes ras too)"},
+#endif
+       {(char *) "-erasemode erase-modename", (char *) "Erase mode to use"},
+       {(char *) "-erasedelay num", (char *) "Erase delay for clear screen modes"},
+       {(char *) "-erasetime num", (char *) "Maximum time (sec) to be used by erase"},
+       {(char *) "-/+nolock", (char *) "turn on/off no password required"},
+       {(char *) "-/+inwindow", (char *) "turn on/off making xlock run in a window"},
+       {(char *) "-/+inroot", (char *) "turn on/off making xlock run in the root window"},
+       {(char *) "-/+remote", (char *) "turn on/off remote host access"},
+       {(char *) "-/+mono", (char *) "turn on/off monochrome override"},
+       {(char *) "-/+allowaccess", (char *) "turn on/off allow new clients to connect"},
+#ifdef USE_VTLOCK
+       {(char *) "-vtlock lock-modename", (char *) "turn on vt switching in [" VTLOCKMODE_SWITCH "|" VTLOCKMODE_NOSWITCH "|" VTLOCKMODE_RESTORE "] lock-mode"},
+
+#endif
+#ifndef ALWAYS_ALLOW_ROOT
+       {(char *) "-/+allowroot", (char *) "turn on/off allow root password to unlock"},
+#else
+ {(char *) "-/+allowroot", (char *) "turn on/off allow root password to unlock (off ignored)"},
+#endif
+       {(char *) "-/+debug", (char *) "whether to use debug xlock (yes/no)"},
+       {(char *) "-/+description", (char *) "whether to show mode description (yes/no)"},
+       {(char *) "-/+echokeys", (char *) "turn on/off echo '?' for each password key"},
+       {(char *) "-/+enablesaver", (char *) "turn on/off enable X server screen saver"},
+       {(char *) "-/+resetsaver", (char *) "turn on/off resetting of X server screen saver"},
+       {(char *) "-/+grabmouse", (char *) "turn on/off grabbing of mouse and keyboard"},
+       {(char *) "-/+grabserver", (char *) "turn on/off grabbing of server"},
+       {(char *) "-/+install", (char *) "whether to use private colormap if needed (yes/no)"},
+       {(char *) "-/+hide", (char *) "turn on/off user background manipulation"},
+       {(char *) "-/+mousemotion", (char *) "turn on/off sensitivity to mouse"},
+       {(char *) "-/+sound", (char *) "whether to use sound if configured for it (yes/no)"},
+       {(char *) "-/+timeelapsed", (char *) "turn on/off clock"},
+       {(char *) "-/+usefirst", (char *) "turn on/off using the first char typed in password"},
+       {(char *) "-/+verbose", (char *) "turn on/off verbosity"},
+       {(char *) "-nice level", (char *) "nice level for xlock process"},
+       {(char *) "-lockdelay seconds", (char *) "number of seconds until lock"},
+       {(char *) "-timeout seconds", (char *) "number of seconds before password times out"},
+       {(char *) "-font fontname", (char *) "font to use for password prompt"},
+       {(char *) "-planfont fontname", (char *) "font to use for plan message"},
+#ifdef USE_GL
+       {(char *) "-/+showfps", (char *) "turn on/off display of FPS"},
+       {(char *) "-/+fpstop", (char *) "turn on/off FPS display on top of window"},
+       {(char *) "-fpsfont fontname", (char *) "font to use for FPS display"},
+#endif
+#ifdef USE_MB
+       {(char *) "-fontset fontsetname", (char *) "fontset to use for Xmb..."},
+#endif
+       {(char *) "-bg color", (char *) "background color to use for password prompt"},
+       {(char *) "-fg color", (char *) "foreground color to use for password prompt"},
+       {(char *) "-background color", (char *) "background color to use for password prompt"},
+       {(char *) "-foreground color", (char *) "foreground color to use for password prompt"},
+       {(char *) "-username string", (char *) "text string to use for Name prompt"},
+       {(char *) "-password string", (char *) "text string to use for Password prompt"},
+       {(char *) "-info string", (char *) "text string to use for instructions"},
+  {(char *) "-validate string", (char *) "text string to use for validating password message"},
+      {(char *) "-invalid string", (char *) "text string to use for invalid password message"},
+       {(char *) "-geometry geom", (char *) "geometry for non-full screen lock"},
+   {(char *) "-icongeometry geom", (char *) "geometry for password window (location ignored)"},
+#ifdef FX
+       {(char *) "-glgeometry geom", (char *) "geometry for gl modes (location ignored)"},
+#endif
+       {(char *) "-/+wireframe", (char *) "turn on/off wireframe"},
+
+       {(char *) "-/+use3d", (char *) "turn on/off 3d view"},
+        {(char *) "-delta3d value", (char *) "space between the center of your 2 eyes for 3d mode"},
+       {(char *) "-none3d color", (char *) "color to be used for null in 3d mode"},
+       {(char *) "-right3d color", (char *) "color to be used for the right eye in 3d mode"},
+       {(char *) "-left3d color", (char *) "color to be used for the left eye in 3d mode"},
+       {(char *) "-both3d color", (char *) "color to be used overlap in 3d mode"},
+
+    /* For modes with text, marquee & nose */
+   {(char *) "-program programname", (char *) "program to get messages from, usually fortune"},
+       {(char *) "-messagesfile formatted-filename", (char *) "formatted file of fortunes"},
+       {(char *) "-messagefile filename", (char *) "text file for mode"},
+       {(char *) "-message string", (char *) "text for mode"},
+       {(char *) "-messagefont fontname", (char *) "font for a specific mode"},
+#if 0
+    /* For automata modes */
+      {(char *) "-neighbors num", (char *) "squares 4 or 8, hexagons 6, triangles 3, 9 or 12"},
+    /* For eyes, julia, and swarm modes */
+       {(char *) "-/+mouse", (char *) "turn on/off the grabbing the mouse"},
+#endif
+
+#if defined( USE_XLOCKRC ) || defined( FALLBACK_XLOCKRC )
+       {(char *) "-cpasswd crypted-password", (char *) "text string of encrypted password"},
+#endif
+#ifdef USE_AUTO_LOGOUT
+       {(char *) "-logoutAuto minutes", (char *) "number of minutes until auto logout (not more than forced auto logout time)"},
+#endif
+#ifdef USE_BUTTON_LOGOUT
+       {(char *) "-logoutButton minutes", (char *) "number of minutes until logout button appears (not more than forced button time)"},
+    {(char *) "-logoutButtonLabel string", (char *) "text string to use inside logout button"},
+   {(char *) "-logoutButtonHelp string", (char *) "text string to use for logout button help"},
+       {(char *) "-logoutFailedString string", (char *) "text string to use for failed logout attempts"},
+#endif
+#ifdef USE_DTSAVER
+       {(char *) "-/+dtsaver", (char *) "turn on/off CDE Saver Mode"},
+#endif
+#ifdef USE_SOUND
+       {(char *) "-locksound string", (char *) "sound to use at locktime"},
+       {(char *) "-infosound string", (char *) "sound to use for information"},
+       {(char *) "-validsound string", (char *) "sound to use when password is valid"},
+       {(char *) "-invalidsound string", (char *) "sound to use when password is invalid"},
+#endif
+       {(char *) "-startCmd string", (char *) "command to run at locktime"},
+       {(char *) "-endCmd string", (char *) "command to run when unlocking"},
+      {(char *) "-logoutCmd string", (char *) "command to run when automatically logging out"},
+       {(char *) "-mailCmd string", (char *) "command to run to check for mail"},
+       {(char *) "-mailIcon string", (char *) "Icon to display when there is mail"},
+       {(char *) "-nomailIcon string", (char *) "Icon to display when there is no mail"},
+#ifdef USE_DPMS
+    {(char *) "-dpmsstandby seconds", (char *) "seconds to wait before engaging DPMS standby"},
+    {(char *) "-dpmssuspend seconds", (char *) "seconds to wait before engaging DPMS suspend"},
+       {(char *) "-dpmsoff seconds", (char *) "seconds to wait before engaging DPMS off"},
+#endif
+};
+
+#define opDescEntries (sizeof opDesc / sizeof opDesc[0])
+
+int         delay;
+int         count;
+int         cycles;
+int         size;
+int         ncolors;
+float       saturation;
+
+/* For modes with images, xbm, xpm, & ras */
+char       *bitmap;
+
+#ifdef USE_MODULES
+char       *modulepath;
+
+#endif
+
+static char *erasemodename;
+int         erasemode;
+int         erasedelay, erasetime;
+Bool        nolock;
+Bool        inwindow;
+Bool        inroot;
+Bool        mono;
+
+Bool        allowaccess;
+
+#ifdef ALWAYS_ALLOW_ROOT
+Bool        allowroot = 1;
+
+#else
+Bool        allowroot;
+
+#endif
+Bool        debug;
+Bool        description;
+Bool        echokeys;
+Bool        enablesaver;
+Bool        resetsaver;
+Bool        fullrandom = False;
+Bool        grabmouse;
+Bool        grabserver;
+Bool        hide;
+Bool        install;
+Bool        mousemotion;
+Bool        sound;
+Bool        timeelapsed;
+Bool        usefirst;
+Bool        verbose;
+Bool        remote;
+
+#ifdef USE_GL
+Bool        fpsTop;
+Bool        showfps;
+char       *fpsfontname;
+#endif
+static char *visualname;
+int         VisualClassWanted;
+
+int         nicelevel;
+int         lockdelay;
+int         timeout;
+
+char       *fontname;
+char       *planfontname;
+
+#ifdef USE_DPMS
+int         dpmsstandby;
+int         dpmssuspend;
+int         dpmsoff;
+
+#endif
+
+#ifdef USE_MB
+char       *fontsetname;
+
+#endif
+char       *background;
+char       *foreground;
+char       *text_user;
+char       *text_pass;
+
+#ifdef GLOBAL_UNLOCK
+char       *text_guser;
+#endif
+
+#ifdef SAFEWORD
+char       *text_dpass;
+char       *text_fpass;
+char       *text_chall;
+
+#endif
+char       *text_info;
+char       *text_valid;
+char       *text_invalid;
+char       *geometry;
+char       *icongeometry;
+
+#ifdef FX
+char       *glgeometry;
+
+#endif
+
+Bool        wireframe;
+
+Bool        use3d;
+float       delta3d;
+char       *none3d;
+char       *right3d;
+char       *left3d;
+char       *both3d;
+
+#if defined( USE_XLOCKRC ) || defined( FALLBACK_XLOCKRC )
+char       *cpasswd;
+
+#endif
+#ifdef USE_AUTO_LOGOUT
+int         logoutAuto;
+
+#endif
+#ifdef USE_BUTTON_LOGOUT
+int         enable_button = 1;
+
+int         logoutButton;
+char       *logoutButtonLabel;
+char       *logoutButtonHelp;
+char       *logoutFailedString;
+
+#endif
+#ifdef USE_DTSAVER
+Bool        dtsaver;
+
+#endif
+#ifdef USE_SOUND
+char       *locksound;
+char       *infosound;
+char       *validsound;
+char       *invalidsound;
+
+#endif
+
+char       *startCmd;
+char       *endCmd;
+char       *logoutCmd;
+
+char       *mailCmd;
+char       *mailIcon;
+char       *nomailIcon;
+
+#ifdef USE_VTLOCK
+char       *vtlockres;
+Bool        vtlock;
+Bool        vtlock_set_active;
+Bool        vtlock_restore;
+
+#endif
+
+static argtype genvars[] =
+{
+       {(caddr_t *) & erasemodename, (char *) "erasemode", (char *) "EraseMode", (char *) "", t_String},
+       {(caddr_t *) & erasedelay, (char *) "erasedelay", (char *) "EraseDelay", (char *) DEF_ERASEDELAY, t_Int},
+       {(caddr_t *) & erasetime, (char *) "erasetime", (char *) "EraseTime", (char *) DEF_ERASETIME, t_Int},
+       {(caddr_t *) & allowaccess, (char *) "allowaccess", (char *) "AllowAccess", (char *) "off", t_Bool},
+#ifndef ALWAYS_ALLOW_ROOT
+       {(caddr_t *) & allowroot, (char *) "allowroot", (char *) "AllowRoot", (char *) "off", t_Bool},
+#endif
+       {(caddr_t *) & debug, (char *) "debug", (char *) "Debug", (char *) "off", t_Bool},
+       {(caddr_t *) & description, (char *) "description", (char *) "Description", (char *) "on", t_Bool},
+       {(caddr_t *) & echokeys, (char *) "echokeys", (char *) "EchoKeys", (char *) "off", t_Bool},
+    {(caddr_t *) & enablesaver, (char *) "enablesaver", (char *) "EnableSaver", (char *) "off", t_Bool},
+       {(caddr_t *) & resetsaver, (char *) "resetsaver", (char *) "ResetSaver", (char *) "on", t_Bool},
+       {(caddr_t *) & grabmouse, (char *) "grabmouse", (char *) "GrabMouse", (char *) "on", t_Bool},
+       {(caddr_t *) & grabserver, (char *) "grabserver", (char *) "GrabServer", (char *) "off", t_Bool},
+       {(caddr_t *) & hide, (char *) "hide", (char *) "Hide", (char *) "on", t_Bool},
+       {(caddr_t *) & install, (char *) "install", (char *) "Install", (char *) "on", t_Bool},
+    {(caddr_t *) & mousemotion, (char *) "mousemotion", (char *) "MouseMotion", (char *) "off", t_Bool},
+       {(caddr_t *) & mono, (char *) "mono", (char *) "Mono", (char *) "off", t_Bool},
+       {(caddr_t *) & sound, (char *) "sound", (char *) "Sound", (char *) "off", t_Bool},
+#ifdef USE_GL
+       {(caddr_t *) & showfps, (char *) "showfps", (char *) "ShowFps", (char *) "off", t_Bool},
+       {(caddr_t *) & fpsTop, (char *) "fpstop", (char *) "FpsTop", (char *) "on", t_Bool},
+       {(caddr_t *) & fpsfontname, (char *) "fpsfont", (char *) "FpsFont", (char *) DEF_FONT, t_String},
+#endif
+    {(caddr_t *) & timeelapsed, (char *) "timeelapsed", (char *) "TimeElapsed", (char *) "off", t_Bool},
+       {(caddr_t *) & usefirst, (char *) "usefirst", (char *) "UseFirst", (char *) "on", t_Bool},
+       {(caddr_t *) & verbose, (char *) "verbose", (char *) "Verbose", (char *) "off", t_Bool},
+       {(caddr_t *) & visualname, (char *) "visual", (char *) "Visual", (char *) "", t_String},
+       {(caddr_t *) & nicelevel, (char *) "nice", (char *) "Nice", (char *) DEF_NICE, t_Int},
+   {(caddr_t *) & lockdelay, (char *) "lockdelay", (char *) "LockDelay", (char *) DEF_LOCKDELAY, t_Int},
+       {(caddr_t *) & timeout, (char *) "timeout", (char *) "Timeout", (char *) DEF_TIMEOUT, t_Int},
+       {(caddr_t *) & fontname, (char *) "font", (char *) "Font", (char *) DEF_FONT, t_String},
+{(caddr_t *) & planfontname, (char *) "planfont", (char *) "PlanFont", (char *) DEF_PLANFONT, t_String},
+#ifdef USE_MB
+    {(caddr_t *) & fontsetname, (char *) "fontset", (char *) "FontSet", (char *) DEF_FONTSET, t_String},
+#endif
+    {(caddr_t *) & background, (char *) "background", (char *) "Background", (char *) DEF_BG, t_String},
+    {(caddr_t *) & foreground, (char *) "foreground", (char *) "Foreground", (char *) DEF_FG, t_String},
+       {(caddr_t *) & text_user, (char *) "username", (char *) "Username", (char *) DEF_NAME, t_String},
+       {(caddr_t *) & text_pass, (char *) "password", (char *) "Password", (char *) DEF_PASS, t_String},
+#ifdef GLOBAL_UNLOCK
+       {(caddr_t *) & text_guser, (char *) "globaluser", (char *) "GlobalUser", (char *) DEF_GUSER, t_String},
+#endif
+
+#ifdef SAFEWORD
+       {(caddr_t *) & text_dpass, (char *) "dynpass", (char *) "Dynpass", (char *) DEF_DPASS, t_String},
+       {(caddr_t *) & text_fpass, (char *) "fixpass", (char *) "Fixpass", (char *) DEF_FPASS, t_String},
+   {(caddr_t *) & text_chall, (char *) "challenge", (char *) "Challenge", (char *) DEF_CHALL, t_String},
+#endif
+       {(caddr_t *) & text_info, (char *) "info", (char *) "Info", (char *) DEF_INFO, t_String},
+     {(caddr_t *) & text_valid, (char *) "validate", (char *) "Validate", (char *) DEF_VALID, t_String},
+   {(caddr_t *) & text_invalid, (char *) "invalid", (char *) "Invalid", (char *) DEF_INVALID, t_String},
+    {(caddr_t *) & geometry, (char *) "geometry", (char *) "Geometry", (char *) DEF_GEOMETRY, t_String},
+       {(caddr_t *) & icongeometry, (char *) "icongeometry", (char *) "IconGeometry", (char *) DEF_ICONGEOMETRY, t_String},
+#ifdef FX
+       {(caddr_t *) & glgeometry, (char *) "glgeometry", (char *) "GLGeometry", (char *) DEF_GLGEOMETRY, t_String},
+#endif
+       {(caddr_t *) & wireframe, (char *) "wireframe", (char *) "WireFrame", (char *) "off", t_Bool},
+
+       {(caddr_t *) & use3d, (char *) "use3d", (char *) "Use3D", (char *) "off", t_Bool},
+       {(caddr_t *) & delta3d, (char *) "delta3d", (char *) "Delta3D", (char *) DEF_DELTA3D, t_Float},
+       {(caddr_t *) & none3d, (char *) "none3d", (char *) "None3D", (char *) DEF_NONE3D, t_String},
+       {(caddr_t *) & right3d, (char *) "right3d", (char *) "Right3D", (char *) DEF_RIGHT3D, t_String},
+       {(caddr_t *) & left3d, (char *) "left3d", (char *) "Left3D", (char *) DEF_LEFT3D, t_String},
+       {(caddr_t *) & both3d, (char *) "both3d", (char *) "Both3D", (char *) DEF_BOTH3D, t_String},
+
+       {(caddr_t *) & program, (char *) "program", (char *) "Program", (char *) DEF_PROGRAM, t_String},
+       {(caddr_t *) & messagesfile, (char *) "messagesfile", (char *) "Messagesfile", (char *) DEF_MESSAGESFILE, t_String},
+       {(caddr_t *) & messagefile, (char *) "messagefile", (char *) "Messagefile", (char *) DEF_MESSAGEFILE, t_String},
+       {(caddr_t *) & message, (char *) "message", (char *) "Message", (char *) DEF_MESSAGE, t_String},
+       {(caddr_t *) & messagefontname, (char *) "messagefont", (char *) "MessageFont", (char *) DEF_MESSAGEFONT, t_String},
+#if 0
+   {(caddr_t *) & neighbors, (char *) "neighbors", (char *) "Neighbors", (char *) DEF_NEIGHBORS, t_Int},
+       {(caddr_t *) & mouse, (char *) "mouse", (char *) "Mouse", (char *) DEF_MOUSE, t_Bool},
+#endif
+
+#if defined( USE_XLOCKRC ) || defined( FALLBACK_XLOCKRC )
+       {(caddr_t *) & cpasswd, (char *) "cpasswd", (char *) "cpasswd", (char *) "", t_String},
+#endif
+#ifdef USE_AUTO_LOGOUT
+       {(caddr_t *) & logoutAuto, (char *) "logoutAuto", (char *) "logoutAuto", (char *) DEF_AUTO_LOGOUT, t_Int},
+#endif
+#ifdef USE_BUTTON_LOGOUT
+       {(caddr_t *) & logoutButton, (char *) "logoutButton", (char *) "LogoutButton", (char *) DEF_BUTTON_LOGOUT, t_Int},
+       {(caddr_t *) & logoutButtonLabel, (char *) "logoutButtonLabel",
+        "LogoutButtonLabel", (char *) DEF_BTN_LABEL, t_String},
+       {(caddr_t *) & logoutButtonHelp, (char *) "logoutButtonHelp",
+        "LogoutButtonHelp", (char *) DEF_BTN_HELP, t_String},
+       {(caddr_t *) & logoutFailedString, (char *) "logoutFailedString",
+        "LogoutFailedString", (char *) DEF_FAIL, t_String},
+#endif
+#ifdef USE_SOUND
+       {(caddr_t *) & locksound, (char *) "locksound", (char *) "LockSound", (char *) DEF_LOCKSOUND, t_String},
+       {(caddr_t *) & infosound, (char *) "infosound", (char *) "InfoSound", (char *) DEF_INFOSOUND, t_String},
+       {(caddr_t *) & validsound, (char *) "validsound", (char *) "ValidSound", (char *) DEF_VALIDSOUND, t_String},
+       {(caddr_t *) & invalidsound, (char *) "invalidsound", (char *) "InvalidSound", (char *) DEF_INVALIDSOUND, t_String},
+#endif
+       {(caddr_t *) & startCmd, (char *) "startCmd", (char *) "StartCmd", (char *) "", t_String},
+       {(caddr_t *) & endCmd, (char *) "endCmd", (char *) "EndCmd", (char *) "", t_String},
+       {(caddr_t *) & logoutCmd, (char *) "logoutCmd", (char *) "LogoutCmd", (char *) "", t_String},
+#ifdef USE_DPMS
+       {(caddr_t *) & dpmsstandby, (char *) "dpmsstandby", (char *) "DPMSStandby", (char *) DEF_DPMSSTANDBY, t_Int},
+       {(caddr_t *) & dpmssuspend, (char *) "dpmssuspend", (char *) "DPMSSuspend", (char *) DEF_DPMSSUSPEND, t_Int},
+       {(caddr_t *) & dpmsoff, (char *) "dpmsoff", (char *) "DPMSOff", (char *) DEF_DPMSOFF, t_Int},
+#endif
+
+       {(caddr_t *) & mailCmd, (char *) "mailCmd", (char *) "MailCmd", (char *) DEF_MAILAPP, t_String},
+       {(caddr_t *) & mailIcon, (char *) "mailIcon", (char *) "MailIcon", (char *) DEF_MAILAPP, t_String},
+       {(caddr_t *) & nomailIcon, (char *) "nomailIcon", (char *) "NomailIcon", (char *) DEF_MAILAPP, t_String},
+#ifdef USE_VTLOCK
+       {(caddr_t *) & vtlockres, (char *) "vtlock", (char *) "VtLock", DEF_VTLOCK, t_String},
+#endif
+#if 0
+    /* These resources require special handling.  They must be examined
+     * before the display is opened.  They are evaluated by individual
+     * calls to GetResource(), so they should not be evaluated again here.
+     * For example, X-terminals need this special treatment.
+     */
+       {(caddr_t *) & nolock, (char *) "nolock", (char *) "NoLock", (char *) "off", t_Bool},
+       {(caddr_t *) & inwindow, (char *) "inwindow", (char *) "InWindow", (char *) "off", t_Bool},
+       {(caddr_t *) & inroot, (char *) "inroot", (char *) "InRoot", (char *) "off", t_Bool},
+       {(caddr_t *) & remote, (char *) "remote", (char *) "Remote", (char *) "off", t_Bool},
+#endif
+};
+
+#define NGENARGS (sizeof genvars / sizeof genvars[0])
+
+static argtype modevars[] =
+{
+       {(caddr_t *) & delay, (char *) "delay", (char *) "Delay", (char *) DEF_DELAY, t_Int},
+       {(caddr_t *) & count, (char *) "count", (char *) "Count", (char *) DEF_COUNT, t_Int},
+       {(caddr_t *) & cycles, (char *) "cycles", (char *) "Cycles", (char *) DEF_CYCLES, t_Int},
+       {(caddr_t *) & size, (char *) "size", (char *) "Size", (char *) DEF_SIZE, t_Int},
+       {(caddr_t *) & ncolors, (char *) "ncolors", (char *) "NColors", (char *) DEF_NCOLORS, t_Int},
+       {(caddr_t *) & saturation, (char *) "saturation", (char *) "Saturation", (char *) DEF_SATURATION, t_Float},
+       {(caddr_t *) & bitmap, (char *) "bitmap", (char *) "Bitmap", (char *) DEF_BITMAP, t_String}
+};
+
+#define NMODEARGS (sizeof modevars / sizeof modevars[0])
+
+static int  modevaroffs[NMODEARGS] =
+{
+       offsetof(LockStruct, def_delay),
+       offsetof(LockStruct, def_count),
+       offsetof(LockStruct, def_cycles),
+       offsetof(LockStruct, def_size),
+       offsetof(LockStruct, def_ncolors),
+       offsetof(LockStruct, def_saturation),
+       offsetof(LockStruct, def_bitmap)
+};
+
+#ifdef VMS
+static char *
+stripname(char *string)
+{
+       char       *characters;
+
+       while (string && *string++ != ']');
+       characters = string;
+       while (characters)
+               if (*characters == '.') {
+                       *characters = '\0';
+                       return string;
+               } else
+                       characters++;
+       return string;
+}
+#endif
+
+static void
+Syntax(const char *badOption)
+{
+       int         col, len, i;
+
+       (void) fprintf(stderr, "%s:  bad command line option \"%s\"\n\n",
+                      ProgramName, badOption);
+
+       (void) fprintf(stderr, "usage:  %s", ProgramName);
+       col = 8 + strlen(ProgramName);
+       for (i = 0; i < (int) opDescEntries; i++) {
+               len = 3 + strlen(opDesc[i].opt);        /* space [ string ] */
+               if (col + len > 79) {
+                       (void) fprintf(stderr, "\n   ");        /* 3 spaces */
+                       col = 3;
+               }
+               (void) fprintf(stderr, " [%s]", opDesc[i].opt);
+               col += len;
+       }
+
+       len = 8 + strlen(LockProcs[0].cmdline_arg);
+       if (col + len > 79) {
+               (void) fprintf(stderr, "\n   ");        /* 3 spaces */
+               col = 3;
+       }
+       (void) fprintf(stderr, " [-mode %s", LockProcs[0].cmdline_arg);
+       col += len;
+       for (i = 1; i < numprocs; i++) {
+               len = 3 + strlen(LockProcs[i].cmdline_arg);
+               if (col + len > 79) {
+                       (void) fprintf(stderr, "\n   ");        /* 3 spaces */
+                       col = 3;
+               }
+               (void) fprintf(stderr, " | %s", LockProcs[i].cmdline_arg);
+               col += len;
+       }
+       (void) fprintf(stderr, "]\n");
+
+       (void) fprintf(stderr, "\nType %s -help for a full description.\n\n",
+                      ProgramName);
+       exit(1);
+}
+
+static void
+Help(void)
+{
+       int         i;
+
+       (void) printf("usage:\n        %s [-options ...]\n\n", ProgramName);
+       (void) printf("where options include:\n");
+       for (i = 0; i < (int) opDescEntries; i++) {
+               (void) printf("    %-28s %s\n", opDesc[i].opt, opDesc[i].desc);
+       }
+
+       (void) printf("    %-28s %s\n", "-mode mode", "animation mode");
+       (void) printf("    where mode is one of:\n");
+       for (i = 0; i < numprocs; i++) {
+               int         j;
+
+               (void) printf("          %-23s %s\n",
+                             LockProcs[i].cmdline_arg, LockProcs[i].desc);
+               for (j = 0; j < LockProcs[i].msopt->numvarsdesc; j++)
+                       (void) printf("              %-23s %s\n",
+                                     LockProcs[i].msopt->desc[j].opt, LockProcs[i].msopt->desc[j].desc);
+       }
+       (void) printf("\n");
+
+       exit(0);
+}
+
+static void
+Version(void)
+{
+       (void) printf("XLock version %s\n", VERSION);
+       exit(0);
+}
+
+static void
+checkSpecialArgs(int argc, char **argv)
+{
+       int         i;
+
+       for (i = 0; i < argc; i++) {
+               if (!strncmp(argv[i], "-help", strlen(argv[i])))
+                       Help();
+               if (!strncmp(argv[i], "-version", strlen(argv[i])))
+                       Version();
+#ifdef CHECK_OLD_ARGS
+               {
+                       static char *depreciated_args[] =
+       {(char *) "-v", (char *) "-imagefile", (char *) "-mfont",
+        (char *) "-rule3d", (char *) "-life3dfile", (char *) "-mouse",
+        (char *) "-shift", (char *) "-tshift"};
+                       static char *current_args[] =
+       {(char *) "-verbose", (char *) "-bitmap", (char *) "-messagefont",
+        (char *) "-rule", (char *) "-lifefile", (char *) "-trackmouse",
+        (char *) "-cycle", (char *) "-cycle"};
+                       int         j;
+
+                       for (j = 0; j < (int) ((sizeof current_args) / sizeof (*current_args)); j++)
+                               if (!strncmp(argv[i], depreciated_args[j], strlen(argv[i]))) {
+                                       (void) printf("%s depreciated, use %s\n",
+                                       depreciated_args[j], current_args[j]);
+                                       exit(0);
+                               }
+               }
+#endif
+       }
+}
+
+static void
+DumpResources(void)
+{
+       int         i, j;
+
+       (void) printf("%s.mode: %s\n", classname, DEF_MODE);
+
+       for (i = 0; i < (int) NGENARGS; i++)
+               (void) printf("%s.%s: %s\n",
+                             classname, genvars[i].name, genvars[i].def);
+
+       for (i = 0; i < numprocs; i++) {
+               (void) printf("%s.%s.%s: %d\n", classname, LockProcs[i].cmdline_arg,
+                             "delay", LockProcs[i].def_delay);
+               (void) printf("%s.%s.%s: %d\n", classname, LockProcs[i].cmdline_arg,
+                             "count", LockProcs[i].def_count);
+               (void) printf("%s.%s.%s: %d\n", classname, LockProcs[i].cmdline_arg,
+                             "cycles", LockProcs[i].def_cycles);
+               (void) printf("%s.%s.%s: %d\n", classname, LockProcs[i].cmdline_arg,
+                             "size", LockProcs[i].def_size);
+               (void) printf("%s.%s.%s: %d\n", classname, LockProcs[i].cmdline_arg,
+                             "ncolors", LockProcs[i].def_ncolors);
+               (void) printf("%s.%s.%s: %g\n", classname, LockProcs[i].cmdline_arg,
+                             "saturation", LockProcs[i].def_saturation);
+               (void) printf("%s.%s.%s: %s\n", classname, LockProcs[i].cmdline_arg,
+                             "bitmap",
+                  (LockProcs[i].def_bitmap) ? LockProcs[i].def_bitmap : "");
+               for (j = 0; j < LockProcs[i].msopt->numvarsdesc; j++)
+                       (void) printf("%s.%s.%s: %s\n", classname, LockProcs[i].cmdline_arg,
+                                     LockProcs[i].msopt->vars[j].name,
+                                     LockProcs[i].msopt->vars[j].def);
+       }
+       exit(0);
+}
+
+static void
+LowerString(char *s)
+{
+
+       while (*s) {
+               if (isupper((int) *s))
+                       *s += ('a' - 'A');
+               s++;
+       }
+}
+
+static void
+GetResource(XrmDatabase database,
+          const char *parentName, const char *parentClassName,
+     const char *name, const char *className, int valueType, char *def,
+     caddr_t * valuep)
+{
+       char       *type;
+       XrmValue    value;
+       char       *string;
+       char       *buffer;
+       char       *fullName;
+       char       *fullClassName;
+       int         len, temp;
+
+       fullName = (char *) malloc(strlen(parentName) + strlen(name) + 2);
+       fullClassName = (char *) malloc(strlen(parentClassName) +
+                                       strlen(className) + 2);
+
+       (void) sprintf(fullName, "%s.%s", parentName, name);
+       (void) sprintf(fullClassName, "%s.%s", parentClassName, className);
+       temp = XrmGetResource(database, fullName, fullClassName, &type, &value);
+       (void) free((void *) fullName);
+       (void) free((void *) fullClassName);
+
+       if (temp) {
+               string = value.addr;
+               len = value.size - 1;
+       } else {
+               string = def;
+               if (!string || !*string) {
+                       *valuep = NULL;
+                       return;
+               }
+               len = strlen(string);
+       }
+
+       buffer = (char *) malloc(strlen(string) + 1);
+       (void) strcpy(buffer, string);
+
+       switch (valueType) {
+               case t_String:
+                       {
+/*-
+ * PURIFY 4.2 on Solaris 2 and on SunOS4 reports a memory leak on the following
+ * line. It leaks as many bytes as there are characters in the string + 1. */
+                               char       *s = (char *) malloc(len + 1);
+
+                               if (s == (char *) NULL) {
+                                       char       *buf = (char *) malloc(strlen(ProgramName) + 80);
+
+                                       (void) sprintf(buf,
+                                                      "%s: GetResource - could not allocate memory", ProgramName);
+                                       error(buf);
+                                       (void) free((void *) buf);      /* Should never get here */
+                               }
+                               (void) strncpy(s, string, len);
+                               s[len] = '\0';
+                               *((char **) valuep) = s;
+                       }
+                       break;
+               case t_Float:
+                       *((float *) valuep) = (float) atof(buffer);
+                       break;
+               case t_Int:
+                       *((int *) valuep) = atoi(buffer);
+                       break;
+               case t_Bool:
+                       LowerString(buffer);
+                       *((int *) valuep) = (!strcmp(buffer, "true") ||
+                                            !strcmp(buffer, "on") ||
+                                            !strcmp(buffer, "enabled") ||
+                                     !strcmp(buffer, "yes")) ? True : False;
+                       break;
+       }
+       (void) free((void *) buffer);
+}
+
+static      XrmDatabase
+parsefilepath(char *xfilesearchpath, const char *typeName,
+        char *className, char *customName)
+{
+       XrmDatabase database = NULL;
+       char       *appdefaults;
+       char       *src;
+       char       *dst;
+       int         i, maxlen;
+
+       i = maxlen = 0;
+       for (src = xfilesearchpath; *src != '\0'; src++) {
+               if (*src == '%') {
+                       src++;
+                       switch (*src) {
+                               case '%':
+                               case ':':
+                                       i++;
+                                       break;
+                               case 'T':
+                                       i += strlen(typeName);
+                                       break;
+                               case 'N':
+                                       i += strlen(className);
+                                       break;
+                               case 'C':
+                                       i += strlen(customName);
+                                       break;
+                               default:
+                                       break;
+                       }
+#ifdef VMS
+               } else if (*src == '#') {       /* Colons required in VMS use # */
+#else
+               } else if (*src == ':') {
+#endif
+                       if (i > maxlen)
+                               maxlen = i;
+                       i = 0;
+               } else
+                       i++;
+       }
+       if (i > maxlen)
+               maxlen = i;
+
+       /* appdefaults will be at most this long */
+       appdefaults = (char *) malloc(maxlen + 1);
+
+       src = xfilesearchpath;
+       dst = appdefaults;
+       *dst = '\0';
+       for (;;) {
+               if (*src == '%') {
+                       src++;
+                       switch (*src) {
+                               case '%':
+                               case ':':
+                                       *dst++ = *src++;
+                                       *dst = '\0';
+                                       break;
+                               case 'T':
+                                       (void) strcat(dst, typeName);
+                                       src++;
+                                       dst += strlen(typeName);
+                                       break;
+                               case 'N':
+                                       (void) strcat(dst, className);
+                                       src++;
+                                       dst += strlen(className);
+                                       break;
+                               case 'C':
+                                       (void) strcat(dst, customName);
+                                       src++;
+                                       dst += strlen(customName);
+                                       break;
+                               case 'S':
+                                       src++;
+                                       break;
+                               default:
+                                       src++;
+                                       break;
+                       }
+#ifdef VMS
+               } else if (*src == '#') {       /* Colons required in VMS use # */
+#else
+               } else if (*src == ':') {
+#endif
+                       database = XrmGetFileDatabase(appdefaults);
+                       if (database == NULL) {
+                               dst = appdefaults;
+                               src++;
+                       } else
+                               break;
+               } else if (*src == '\0') {
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 reports this also when using X11R5, but not
+   * with OpenWindow 3.0 (X11R4 based). */
+                       database = XrmGetFileDatabase(appdefaults);
+                       break;
+               } else {
+                       *dst++ = *src++;
+                       *dst = '\0';
+               }
+       }
+       (void) free((void *) appdefaults);
+       return database;
+}
+
+#ifdef VMS
+/*-
+ * FUNCTIONAL DESCRIPTION:
+ * int get_info (chan, item, ret_str, ret_len)
+ * Fetch a single characteristics from the pseudo-workstation
+ * device and return the information.
+ * (Taken and modified from the v5.4 fiche. PPL/SG 2/10/91
+ * FORMAL PARAMETERS:
+ *      chan:   the device channel
+ *      item:   the characteristic to show
+ *      ret_str: str pointer to information
+ * ret_len: length of above string
+ *  IMPLICIT INPUTS:
+ *      none
+ *  IMPLICIT OUTPUTS:
+ *      none
+ *  COMPLETION CODES:
+ * errors returned by SYS$QIO
+ *  SIDE EFFECTS:
+ *      none
+ * Hacked from Steve Garrett's xservername (as posted to INFO-VAX)
+ */
+
+int
+get_info(unsigned long chan, unsigned long item,
+        char *ret_str, unsigned long *ret_len)
+{
+       unsigned long iosb[2];
+       int         status;
+       char        itembuf[BUFSIZE];
+       struct dsc$descriptor itemval;
+
+       itemval.dsc$w_length = BUFSIZE;
+       itemval.dsc$b_dtype = 0;
+       itemval.dsc$b_class = 0;
+       itemval.dsc$a_pointer = &itembuf[0];
+
+       status = sys$qiow(0, chan, IO$_SENSEMODE | IO$M_WS_DISPLAY, &iosb, 0, 0,
+                         itemval.dsc$a_pointer,
+                         itemval.dsc$w_length,
+                         item, 0, 0, 0);
+       if (status != SS$_NORMAL)
+               return (status);
+       if (iosb[0] != SS$_NORMAL)
+               return (iosb[0]);
+
+       itemval.dsc$w_length = iosb[1];
+       *ret_len = iosb[1];
+       itembuf[*ret_len] = 0;
+       (void) strcpy(ret_str, &itembuf[0]);
+
+       return (status);
+}
+
+
+/* routine that will return descripter of asciz string */
+
+static int
+descr(char *name)
+{
+       static      $dscp(d1, 0, 0);
+       static      $dscp(d2, 0, 0);
+       static      $dscp(d3, 0, 0);
+       static      $dscp(d4, 0, 0);
+       static      $dscp(d5, 0, 0);
+       static      $dscp(d6, 0, 0);
+       static dsc *tbl[] =
+       {&d1, &d2, &d3, &d4, &d5, &d6};
+       static int  didx = 0;
+
+       if (didx == 6)
+               didx = 0;
+
+       tbl[didx]->len = strlen(name);
+       tbl[didx]->ptr = name;
+
+       return (int) tbl[didx++];
+}
+
+#endif
+
+static void
+openDisplay(Display ** displayp)
+{
+       char       *buf;
+
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+ * the following line. */
+       if (!(*displayp = XOpenDisplay((displayname) ? displayname : ""))) {
+               buf = (char *) malloc(strlen(ProgramName) +
+                            ((displayname) ? strlen(displayname) : 0) + 80);
+               (void) sprintf(buf,
+                            "%s: unable to open display %s.\n", ProgramName,
+                              ((displayname) ? displayname : ""));
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+       displayname = DisplayString(*displayp);
+}
+
+static void
+checkDisplay(void)
+{
+       char       *buf;
+       struct hostent *host;
+
+#if defined(__cplusplus) || defined(c_plusplus)                /* !__bsdi__ */
+/* #include <netdb.h> */
+#ifdef SunCplusplus
+       extern struct hostent *gethostbyname(const char *);
+#else
+#if !HAVE_GETHOSTNAME
+#if 0
+       extern int  gethostname(char *, size_t);
+       extern struct hostent *gethostbyname(const char *);
+
+#endif
+#else
+#if 1
+extern int  gethostname(char *, size_t);
+#else
+#define gethostname(name,namelen) sysinfo(SI_HOSTNAME,name,namelen)
+#endif
+#endif
+#endif
+#endif
+
+       /*
+        * only restrict access to other displays if we are locking and if the
+        * Remote resource is not set.
+        */
+       if (nolock || inwindow || inroot)
+               remote = True;
+
+       if (gethostname(hostname, MAXHOSTNAMELEN)) {
+               buf = (char *) malloc(strlen(ProgramName) + 80);
+               (void) sprintf(buf,
+                          "%s: Can not get local hostname.\n", ProgramName);
+               error(buf);
+               (void) free((void *) buf);      /* Should never get here */
+       }
+#ifdef VMS
+       if (!remote && ((displayname[0] == '_') |
+                       ((displayname[0] == 'W') &
+                        (displayname[1] == 'S') &
+                        (displayname[2] == 'A')))) {   /* this implies a v5.4 system. The return
+                                                          value is a device name, which must be
+                                                          interrogated to find the real information */
+               unsigned long chan;
+               unsigned int status;
+               unsigned long len;
+               char        server_transport[100];
+
+               status = sys$assign(descr(displayname), &chan, 0, 0);
+               if (!(status & 1))
+                       displayname = " ";
+               else {
+                       status = get_info(chan, DECW$C_WS_DSP_TRANSPORT,
+                                         server_transport, &len);
+                       if (!(status & 1))
+                               exit(status);
+
+                       if (strcmp(server_transport, "LOCAL")) {
+                               (void) strcat(displayname, "'s display via ");
+                               (void) strncat(displayname, server_transport, len);
+                               buf = (char *) malloc(strlen(ProgramName) + strlen(displayname) + 80);
+                               (void) sprintf(buf,
+                                              "%s: can not lock %s\n", ProgramName, displayname);
+                               error(buf);
+                               (void) free((void *) buf);      /* Should never get here */
+                       }
+               }
+       } else {
+#endif /* VMS */
+
+               if (displayname != NULL) {
+                       char       *colon = (char *) strchr(displayname, ':');
+                       int         n = colon - displayname;
+
+                       if (colon == NULL) {
+                               buf = (char *) malloc(strlen(ProgramName) +
+                                                  strlen(displayname) + 80);
+                               (void) sprintf(buf,
+                                "%s: Malformed -display argument, \"%s\"\n",
+                                              ProgramName, displayname);
+                               error(buf);
+                               (void) free((void *) buf);      /* Should never get here */
+                       }
+                       if (!remote && n
+                           && strncmp(displayname, "unix", n)
+                           && strncmp(displayname, "localhost", n)) {
+                               int         badhost = 1;
+                               char      **hp;
+
+                               if (!(host = (struct hostent *) gethostbyname(hostname))) {
+                                       if (debug || verbose) {
+                                               (void) fprintf(stderr, "%s: Can not get hostbyname.\n",
+                                                              ProgramName);
+                                               (void) fprintf(stderr,
+                                                              "Contact your administrator to fix /etc/hosts.\n");
+                                       }
+                               } else if (strncmp(displayname, host->h_name, n)) {
+                                       for (hp = host->h_aliases; *hp; hp++) {
+                                               if (!strncmp(displayname, *hp, n)) {
+                                                       badhost = 0;
+                                                       break;
+                                               }
+                                       }
+                                       if (badhost) {
+                                               *colon = (char) 0;
+                                               buf = (char *) malloc(strlen(ProgramName) +
+                                                  strlen(displayname) + 80);
+                                               (void) sprintf(buf,
+                                                              "%s: can not lock %s's display\n",
+                                                  ProgramName, displayname);
+                                               error(buf);
+                                               (void) free((void *) buf);      /* Should never get here */
+                                       }
+                               }
+                       }
+               }
+#ifdef VMS
+       }
+#endif
+}
+
+static void
+printvar(char *className, argtype var)
+{
+       switch (var.type) {
+               case t_String:
+                       (void) fprintf(stderr, "%s.%s: %s\n",
+                                      className, var.name,
+                        (*((char **) var.var)) ? *((char **) var.var) : "");
+                       break;
+               case t_Float:
+                       (void) fprintf(stderr, "%s.%s: %g\n",
+                                 className, var.name, *((float *) var.var));
+                       break;
+               case t_Int:
+                       (void) fprintf(stderr, "%s.%s: %d\n",
+                                   className, var.name, *((int *) var.var));
+                       break;
+               case t_Bool:
+                       (void) fprintf(stderr, "%s.%s: %s\n",
+                                      className, var.name, *((int *) var.var) ? "True" : "False");
+                       break;
+       }
+}
+
+static void
+getServerResources(Display * display, char *homeenv,
+#ifdef CUSTOMIZATION
+  char **custom,
+#endif
+  XrmDatabase * RDB, XrmDatabase * serverDB)
+{
+       char       *serverString;
+
+       serverString = XResourceManagerString(display);
+       if (serverString) {
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 reports this also when using X11R5, but not
+   * with OpenWindow 3.0 (X11R4 based). */
+               *serverDB = XrmGetStringDatabase(serverString);
+#ifndef CUSTOMIZATION
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 does not report this error. */
+               (void) XrmMergeDatabases(*serverDB, RDB);
+#endif
+       } else {
+               char       *buf = (char *) malloc(strlen(homeenv) + 12);
+
+               (void) sprintf(buf, "%s/.Xdefaults", homeenv);
+#ifdef CUSTOMIZATION
+               *serverDB = XrmGetFileDatabase(buf);
+#else
+               (void) XrmMergeDatabases(XrmGetFileDatabase(buf), RDB);
+#endif
+               (void) free((void *) buf);
+       }
+#ifdef CUSTOMIZATION
+       if (*serverDB)
+               GetResource(*serverDB, ProgramName, classname, "customization",
+                           "Customization", t_String, "", custom);
+       else
+               *custom = "";
+#endif
+}
+
+static void
+getAppResources(char *homeenv, char **custom, XrmDatabase * RDB,
+#ifdef CUSTOMIZATION
+          XrmDatabase * serverDB,
+#endif
+          int *argc, char **argv)
+{
+       char       *env;
+       char       *userpath;
+       char       *userfile = NULL;
+       XrmDatabase cmdlineDB = NULL;
+       XrmDatabase userDB = NULL;
+       XrmDatabase applicationDB = NULL;
+
+       env = getenv("XFILESEARCHPATH");
+       applicationDB = parsefilepath(env ? env : (char *) DEF_FILESEARCHPATH,
+                                     "app-defaults", classname, *custom);
+
+       XrmParseCommand(&cmdlineDB, cmdlineTable, cmdlineEntries, ProgramName,
+                       argc, argv);
+
+       userpath = getenv("XUSERFILESEARCHPATH");
+       if (!userpath) {
+               env = getenv("XAPPLRESDIR");
+               if (env) {
+                       userfile = (char *) malloc(strlen(env) + strlen(homeenv) + 8);
+                       (void) strcpy(userfile, env);
+                       (void) strcat(userfile, "/%N:");
+                       (void) strcat(userfile, homeenv);
+                       (void) strcat(userfile, "/%N");
+               } else {
+#ifdef VMS
+                       userfile = (char *) malloc(2 * strlen(homeenv) + 31);
+                       (void) strcpy(userfile, homeenv);
+                       (void) strcat(userfile, "DECW$%N.DAT#");
+                       (void) strcat(userfile, homeenv);
+                       (void) strcat(userfile, "DECW$XDEFAULTS.DAT");
+#else
+                       userfile = (char *) malloc(strlen(homeenv) + 4);
+                       (void) strcpy(userfile, homeenv);
+                       (void) strcat(userfile, "/%N");
+#endif
+               }
+               userpath = userfile;
+       }
+       userDB = parsefilepath(userpath, "app-defaults", classname, *custom);
+
+       if (userfile)
+               (void) free((void *) userfile);
+
+       (void) XrmMergeDatabases(applicationDB, RDB);
+       (void) XrmMergeDatabases(userDB, RDB);
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 does not report this error. */
+       (void) XrmMergeDatabases(cmdlineDB, RDB);
+#ifdef CUSTOMIZATION
+       if (*serverDB)
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 does not report this error. */
+               (void) XrmMergeDatabases(*serverDB, RDB);
+#else
+       GetResource(*RDB, ProgramName, classname, "display", "Display", t_String,
+                   (char *) "", &displayname);
+#endif
+       GetResource(*RDB, ProgramName, classname, "parent", "Parent", t_String,
+                   (char *) "", &parentname);
+       if (parentname && *parentname) {
+               if (sscanf(parentname, "%ld", &parent))
+                       parentSet = True;
+       }
+       GetResource(*RDB, ProgramName, classname, "nolock", "NoLock", t_Bool,
+                   (char *) "off", (caddr_t *) & nolock);
+       GetResource(*RDB, ProgramName, classname, "inwindow", "InWindow", t_Bool,
+                   (char *) "off", (caddr_t *) & inwindow);
+       GetResource(*RDB, ProgramName, classname, "inroot", "InRoot", t_Bool,
+                   (char *) "off", (caddr_t *) & inroot);
+       GetResource(*RDB, ProgramName, classname, "remote", "Remote", t_Bool,
+                   (char *) "off", (caddr_t *) & remote);
+#ifdef USE_DTSAVER
+       GetResource(*RDB, ProgramName, classname, "dtsaver", "DtSaver", t_Bool,
+                   (char *) "off", (caddr_t *) & dtsaver);
+       if (dtsaver) {
+               inroot = False;
+               inwindow = True;
+               nolock = True;
+       }
+#endif
+}
+
+void
+getResources(Display ** displayp, int argc, char **argv)
+{
+       XrmDatabase RDB = NULL;
+
+#ifdef USE_MODULES
+       XrmDatabase modulepathDB = NULL;
+
+#endif
+       XrmDatabase serverDB = NULL;
+       XrmDatabase earlyCmdlineDB = NULL;
+       XrmDatabase modeDB = NULL;
+       XrmDatabase generalDB = NULL;
+       char       *custom = NULL;
+       char       *homeenv = NULL;
+       int         i, j;
+       int         max_length;
+extern void XlockrmParseCommand(
+    XrmDatabase                *pdb,           /* data base */
+    register XrmOptionDescList options, /* pointer to table of valid options */
+    int                 num_options,   /* number of options                 */
+    char               *prefix,                /* name to prefix resources with     */
+    int                *arg_c,         /* address of argument count         */
+    char              **arg_v);                /* argument list (command line)      */
+
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+       extern int  fullLock();
+
+#endif
+
+       XrmInitialize();
+
+#ifndef USE_MODULES
+       /*
+        * Moved back because its annoying if you need -remote and
+        * you do not know it.
+        */
+       checkSpecialArgs(argc, argv);
+#endif
+
+       /* Application Class is fixed */
+       classname = (char*) DEF_CLASSNAME;
+       /*
+        * Application Name may be modified by -name arg from command
+        * line so you can have different resource files for different
+        * configurations/machines etc...
+        */
+#ifdef VMS
+       /*Strip off directory and .exe; parts */
+       ProgramName = stripname(ProgramName);
+#endif
+       XrmParseCommand(&earlyCmdlineDB, earlyCmdlineTable,
+                       earlyCmdlineEntries, "xlock", &argc, argv);
+       GetResource(earlyCmdlineDB, "xlock", classname, "name", "Name",
+                   t_String, ProgramName, &ProgramName);
+#ifdef CUSTOMIZATION
+       GetResource(earlyCmdlineDB, ProgramName, classname, "display",
+                   "Display", t_String, "", &displayname);
+#endif
+       homeenv = getenv("HOME");
+       if (!homeenv)
+               homeenv = (char *) "";
+
+#ifdef CUSTOMIZATION
+       openDisplay(displayp);
+       getServerResources(*displayp, homeenv, &custom, &RDB, &serverDB);
+       getAppResources(homeenv, &custom, &RDB, &serverDB, &argc, argv);
+       checkDisplay();
+#else
+       custom = (char *) "";
+       getAppResources(homeenv, &custom, &RDB, &argc, argv);
+       openDisplay(displayp);
+       checkDisplay();
+       getServerResources(*displayp, homeenv, &RDB, &serverDB);
+#endif
+
+#ifdef USE_MODULES
+       /*
+        * Now that all the resource files have been loaded, check for the
+        * modules directory, so we'll know what modes are available.
+        */
+       XrmParseCommand(&modulepathDB, modulepathTable, 1, ProgramName,
+                       &argc, argv);
+       (void) XrmMergeDatabases(modulepathDB, &RDB);
+       GetResource(RDB, ProgramName, classname, "modulepath", "Modulepath",
+                   t_String, DEF_MODULEPATH, &modulepath);
+
+       /* read modules from modules directory */
+       atexit(UnloadModules);  /* make sure modules get unloaded */
+       LoadModules(modulepath);
+
+       /*
+        * Moved the search for help to here because now the modules
+        * have been loaded so they can be listed by help.
+        */
+       checkSpecialArgs(argc, argv);
+#endif
+       XrmParseCommand(&generalDB, genTable, genEntries, ProgramName, &argc, argv);
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 does not report this error. */
+       (void) XrmMergeDatabases(generalDB, &RDB);
+
+       GetResource(RDB, ProgramName, classname, "mode", "Mode", t_String,
+                   (char *) DEF_MODE, (caddr_t *) & mode);
+
+       XrmParseCommand(&modeDB, modeTable, modeEntries, ProgramName, &argc, argv);
+       (void) XrmMergeDatabases(modeDB, &RDB);
+
+
+
+       for (i = 0; i < numprocs; i++) {
+               /* if (!strcmp(mode, LockProcs[i].cmdline_arg)) */
+               XrmDatabase optDB = NULL;
+               ModeSpecOpt *ms = LockProcs[i].msopt;
+
+               if (!ms->numopts)
+                       continue;
+               /* The problem was with XrmParseCommand is that it does not
+                   work for multiple use options.  Running it first with a
+                   corrupted version (that makes sure argc and argv do
+                   not change) to setup optDB then run the real
+                   XrmParseCommand on a nullDB to set argv and argc.
+                 */
+               XlockrmParseCommand(&optDB, ms->opts, ms->numopts,
+                               ProgramName, &argc, argv);
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 does not report this error. */
+               (void) XrmMergeDatabases(optDB, &RDB);
+       }
+       for (i = 0; i < numprocs; i++) {
+               /* if (!strcmp(mode, LockProcs[i].cmdline_arg)) */
+               XrmDatabase nullDB = NULL;
+               ModeSpecOpt *ms = LockProcs[i].msopt;
+
+               if (!ms->numopts)
+                       continue;
+                 /*     Runnning real XrmParseCommand on a nullDB to set argv
+                        and argc.
+                 */
+               XrmParseCommand(&nullDB, ms->opts, ms->numopts,
+                               ProgramName, &argc, argv);
+       }
+
+       /* the RDB is set, now query load the variables from the database */
+
+       for (i = 0; i < (int) NGENARGS; i++) {
+               GetResource(RDB, ProgramName, classname,
+                           genvars[i].name, genvars[i].classname,
+                           genvars[i].type, genvars[i].def, genvars[i].var);
+       }
+
+#ifdef USE_VTLOCK
+        /* Process the vtlock resource */
+        if ( !vtlockres || !*vtlockres )
+               vtlock = False;
+        else {
+           if (debug)
+               (void) fprintf(stderr,"vtlock: %s\n",vtlockres);
+            if ( !strcmp( VTLOCKMODE_SWITCH, vtlockres ) )
+            {
+                vtlock = True;
+                vtlock_set_active = True;
+                vtlock_restore = False;
+            }
+            else if ( !strcmp( VTLOCKMODE_RESTORE, vtlockres ) )
+            {
+                vtlock = True;
+                vtlock_set_active = True;
+                vtlock_restore = True;
+            }
+            else if ( !strcmp( VTLOCKMODE_OFF, vtlockres ) )
+            {
+                vtlock = False;
+           }
+            else
+            {
+                vtlock = True;
+                vtlock_set_active = False;
+                vtlock_restore = False;
+            }
+        }
+#endif
+
+       max_length = 0;
+       for (i = 0; i < numprocs; i++) {
+               j = strlen(LockProcs[i].cmdline_arg);
+               if (j > max_length)
+                       max_length = j;
+       }
+
+       modename = (char *) malloc(strlen(ProgramName) + max_length + 2);
+       modeclassname = (char *) malloc(strlen(classname) + max_length + 2);
+
+       for (i = 0; i < numprocs; i++) {
+               argtype    *v;
+               ModeSpecOpt *ms = LockProcs[i].msopt;
+
+               (void) sprintf(modename, "%s.%s", ProgramName, LockProcs[i].cmdline_arg);
+               (void) sprintf(modeclassname, "%s.%s", classname, LockProcs[i].cmdline_arg);
+               for (j = 0; j < (int) NMODEARGS; j++) {
+                       char       *buf = NULL;
+                       void       *p = (void *) ((char *) (&LockProcs[i]) + modevaroffs[j]);
+
+                       switch (modevars[j].type) {
+                               case t_String:
+                                       buf = (char *) malloc(strlen(*((char **) p)) + 1);
+                                       (void) sprintf(buf, "%s", *((char **) p));
+                                       break;
+                               case t_Float:
+                                       buf = (char *) malloc(16);
+                                       (void) sprintf(buf, "%g", *((float *) p));
+                                       break;
+                               case t_Int:
+                                       buf = (char *) malloc(16);
+                                       (void) sprintf(buf, "%d", *((int *) p));
+                                       break;
+                               case t_Bool:
+                                       buf = (char *) malloc(6);
+                                       (void) sprintf(buf, "%s", *((int *) p) ? "True" : "False");
+                                       break;
+                       }
+                       GetResource(RDB, modename, modeclassname,
+                                   modevars[j].name, modevars[j].classname,
+                                   modevars[j].type, buf, (caddr_t *) p);
+                       if (!strcmp(mode, LockProcs[i].cmdline_arg)) {
+                               GetResource(RDB, modename, modeclassname,
+                                    modevars[j].name, modevars[j].classname,
+                                    modevars[j].type, buf, modevars[j].var);
+                       }
+                       if (buf) {
+                               (void) free((void *) buf);
+                               buf = NULL;
+                       }
+               }
+               if (!ms->numvarsdesc)
+                       continue;
+               v = ms->vars;
+               for (j = 0; j < ms->numvarsdesc; j++) {
+                       GetResource(RDB, modename, modeclassname,
+                               v[j].name, v[j].classname,
+                               v[j].type, v[j].def, v[j].var);
+               }
+       }
+
+       /*XrmPutFileDatabase(RDB, "/tmp/xlock.rsrc.out"); */
+/* PURIFY 4.0.1 on Solaris 2 reports an uninitialized memory read on the next
+   * line.  PURIFY 4.0.1 on SunOS4 reports this also when using X11R5, but not
+   * with OpenWindow 3.0 (X11R4 based). */
+       (void) XrmDestroyDatabase(RDB);
+       if (!strcmp(mode, "run")) {
+               geometry = (char *) malloc(4);
+               (void) strcpy(geometry, "1x1");
+       }
+
+       /* Parse the rest of the command line */
+       for (argc--, argv++; argc > 0; argc--, argv++) {
+               if (**argv != '-')
+                       Syntax(*argv);
+               switch (argv[0][1]) {
+                       case 'r':
+                               DumpResources();
+                               /* NOTREACHED */
+                       default:
+                               Syntax(*argv);
+                               /* NOTREACHED */
+               }
+       }
+
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+       if (fullLock()) {
+#ifdef USE_AUTO_LOGOUT
+               logoutAuto = 0;
+#endif
+#ifdef USE_BUTTON_LOGOUT
+               enable_button = 0;
+#endif
+       } else {
+#ifdef USE_AUTO_LOGOUT
+#if ( USE_AUTO_LOGOUT > 0 )    /* Could be USER defined if 0 */
+               if (logoutAuto > USE_AUTO_LOGOUT)
+                       logoutAuto = USE_AUTO_LOGOUT;
+               else if (logoutAuto <= 0)       /* Handle 0 as a special case */
+                       logoutAuto = USE_AUTO_LOGOUT;
+#else
+               if (logoutAuto <= 0)    /* Handle 0 as a special case */
+                       (void) sscanf(DEF_AUTO_LOGOUT, "%d", &logoutAuto);
+#endif
+#endif
+#ifdef USE_BUTTON_LOGOUT
+#if ( USE_BUTTON_LOGOUT > 0 )  /* Could be USER defined if <= 0 */
+               if (logoutButton > USE_BUTTON_LOGOUT)
+                       logoutButton = USE_BUTTON_LOGOUT;
+               else if (logoutButton <= 0)     /* Handle 0 as a special case */
+                       logoutButton = USE_BUTTON_LOGOUT;
+#endif
+#if ( USE_BUTTON_LOGOUT == 0 )
+               if (logoutButton <= 0)  /* Handle 0 as a special case */
+                       (void) sscanf(DEF_BUTTON_LOGOUT, "%d", &logoutButton);
+#endif
+#endif
+       }
+#endif
+#ifdef USE_DTSAVER
+       if (dtsaver) {
+               inroot = False;
+               inwindow = True;
+               nolock = True;
+               enablesaver = True;
+               grabmouse = False;
+               grabserver = False;
+               install = False;
+               lockdelay = 0;
+               geometry = (char *) DEF_GEOMETRY;
+       }
+#endif
+
+       if (verbose) {
+               for (i = 0; i < (int) NGENARGS; i++)
+                       printvar(classname, genvars[i]);
+               for (i = 0; i < (int) NMODEARGS; i++)
+                       printvar(modename, modevars[i]);
+       }
+       if (!visualname || !*visualname || !strcmp(visualname, "default")) {
+               VisualClassWanted = -1;
+               if (verbose)
+                       (void) fprintf(stderr, "Using default visual class\n");
+       } else {
+               VisualClassWanted = visualClassFromName(visualname);
+               if (verbose)
+                       (void) fprintf(stderr, "Using visual class %s\n",
+                                      nameOfVisualClass(VisualClassWanted));
+       }
+       if (!erasemodename || !*erasemodename || !strcmp(erasemodename,
+                                                        "default")) {
+               erasemode = -1;
+               if (verbose)
+                       (void) fprintf(stderr, "Using random erase mode\n");
+       } else {
+               extern int  erasemodefromname(char *name);
+
+               erasemode = erasemodefromname(erasemodename);
+               if (verbose)
+                       (void) fprintf(stderr, "Using erase mode %s\n",
+                                      erasemodename);
+       }
+#if HAVE_DIRENT_H
+       /* Evaluate bitmap */
+       if (bitmap && strcmp(bitmap, DEF_BITMAP)) {
+               get_dir(bitmap, directory_r, filename_r);
+               if (image_list != NULL) {
+                       int         num;
+
+                       for (num = 0; num < num_list; num++) {
+                               if  (image_list[num])
+                                       (void) free((void *) image_list[num]);
+                       }
+                       (void) free((void *) image_list);
+                       image_list = NULL;
+               }
+               images_list = (struct dirent ***) malloc(sizeof (struct dirent **));
+
+               num_list = scan_dir(directory_r, images_list, sel_image, NULL);
+               image_list = *images_list;
+               if (images_list) {
+                       (void) free((void *) images_list);
+                       images_list = NULL;
+               }
+               if (debug)
+                       for (i = 0; i < num_list; i++)
+                               (void) printf("File number %d: %s\n", i, image_list[i]->d_name);
+               if (num_list < 0) {
+                       image_list = NULL;
+                       num_list = 0;
+               }
+       } else {
+               num_list = 0;
+       }
+#endif
+       (void) free((void *) modename);
+       (void) free((void *) modeclassname);
+}
+
+
+void
+checkResources(void)
+{
+       extern char * old_default_mode;
+       int         i;
+
+       /* in case they have a 'xlock*mode: ' empty resource */
+       if (!mode || !*mode)
+               mode = (char *) DEF_MODE;
+
+       if (!old_default_mode || !*old_default_mode) {
+                old_default_mode = (char *) malloc(strlen(mode) + 1);
+               (void) strcpy(old_default_mode, mode);
+       }
+       for (i = 0; i < numprocs; i++) {
+               if (!strcmp(LockProcs[i].cmdline_arg, mode)) {
+                       set_default_mode(&LockProcs[i]);
+                       break;
+               }
+       }
+       if (i == numprocs) {
+               (void) fprintf(stderr, "Unknown mode: ");
+               Syntax(mode);
+       } else {
+
+               /* count and size we allow negative to mean randomize up to that number */
+               if (delay < 0)
+                       Syntax("-delay argument must not be negative.");
+               if (cycles < 0)
+                       Syntax("-cycles argument must not be negative.");
+               if (ncolors < 2 || ncolors > 200)
+                       Syntax("-ncolors argument must be between 2 and 200.");
+               if (saturation < 0.0 || saturation > 1.0)
+                       Syntax("-saturation argument must be between 0.0 and 1.0.");
+               if (delta3d < 0.0 || delta3d > 20.0)
+                       Syntax("-delta3d argument must be between 0.0 and 20.0.");
+       }
+}
diff --git a/xlock/sound.c b/xlock/sound.c
new file mode 100644 (file)
index 0000000..677e185
--- /dev/null
@@ -0,0 +1,431 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)sound.c      4.00 97/01/01 xlockmore";
+
+#endif
+
+/*-
+ * sound.c - xlock.c and vms_play.c
+ *
+ * See xlock.c for copying information.
+ *
+ */
+
+#include "xlock.h"
+
+#ifdef USE_RPLAY
+#include <rplay.h>
+
+void
+play_sound(char *filename, Bool verbose)
+{
+       int         rplay_fd = rplay_open_default();
+
+       if (rplay_fd >= 0) {
+               rplay_sound(rplay_fd, filename);
+               rplay_close(rplay_fd);
+       }
+}
+#endif
+
+#ifdef USE_NAS
+/* Gives me lots of errors when I compile nas-1.2p5  -- xlock maintainer */
+
+/*-
+ * Connect each time, because it might be that the server was not running
+ * when xlock first started, but is when next nas_play is called
+ */
+
+#include <audio/audio.h>
+#include <audio/audiolib.h>
+
+extern Display *dsp;
+
+void
+play_sound(char *filename, Bool verbose)
+{
+       char       *auservername = DisplayString(dsp);
+       char       *fname = filename;
+       AuServer   *aud;        /* audio server connection */
+
+       if (!(aud = AuOpenServer(auservername, 0, NULL, 0, NULL, NULL)))
+               return;         /*cannot connect - no server? */
+       /*
+        * now play the file at recorded volume (3rd arg is a percentage),
+        * synchronously
+        */
+       AuSoundPlaySynchronousFromFile(aud, fname, 100);
+       AuCloseServer(aud);
+}
+#endif
+
+#ifdef USE_XAUDIO
+  /* Anybody ever get this working? XAudio.007 */
+#endif
+
+#ifdef HAS_MMOV
+#include <prvdef.h>
+#include <ssdef.h>
+
+extern void PLAY_SOUND_MMOV(char* filename, Bool verbose);
+#endif
+
+#ifdef USE_VMSPLAY
+/*-
+ * Jouk Jansen <joukj@hrem.stm.tudelft.nl> contributed this
+ * which he found at http://axp616.gsi.de:8080/www/vms/mzsw.html
+ *
+ * quick hack for sounds in xlockmore on VMS
+ * with a the above AUDIO package slightly modified
+ */
+#include <file.h>
+#include <unixio.h>
+#include <iodef.h>
+#include "vms_amd.h"
+
+int
+play_sound_so(char *filename, Bool verbose)
+{
+       int         i, j, status;
+       char        buffer[2048];
+       int         volume = 65;        /* volume is default to 65% */
+
+       /* use the internal speaker(s) */
+       int         speaker = SO_INTERNAL /*SO_EXTERNAL */ ;
+       int         fp;
+
+       status = AmdInitialize("SO:", volume);  /* Initialize access to AMD */
+        if ( status !=0 ) return status;
+   
+       AmdSelect(speaker);     /* Select which speaker */
+       fp = open(filename, O_RDONLY, 0777);    /* Open the file */
+       if (!(fp == -1)) {
+               /* Read through it */
+               i = read(fp, buffer, 2048);
+               while (i) {
+                       status = AmdWrite(buffer, i);
+                       if (!(status & 1))
+                               exit(status);
+                       i = read(fp, buffer, 1024);
+               }
+       }
+       (void) close(fp);
+   return 0;
+}
+
+#endif
+
+#if defined( HAS_MMOV ) || defined( USE_VMSPLAY )
+void
+play_sound(char* filename, Bool verbose)
+{
+#ifdef USE_VMSPLAY
+   if ( play_sound_so(filename, verbose) != 0 )
+#endif
+     {
+#ifdef HAS_MMOV
+       int pr_status , privs[2] , SYS$SETPRV();
+
+       privs[1] = 0;
+       privs[0] = PRV$M_SYSNAM;
+       pr_status = SYS$SETPRV ( 1, privs, 0, 0 );
+       
+       if ( pr_status == SS$_NORMAL ) PLAY_SOUND_MMOV(filename, verbose);
+#endif
+     }
+}
+#endif
+
+#ifdef DEF_PLAY
+void
+play_sound(char *filename, Bool verbose)
+{
+       char        *progrun = NULL;
+
+       if ((progrun = (char *) malloc(strlen(DEF_PLAY) + strlen(filename) + 10)) != NULL) {
+               (void) sprintf(progrun, "( %s%s ) 2>&1", DEF_PLAY, filename);
+               /*(void) printf("%s\n", progrun); */
+               (void) system(progrun);
+               (void) free((void *) progrun);
+       }
+}
+
+#endif
+
+#ifdef USE_ESOUND
+
+#ifndef DEFAULT_SOUND_DIR
+#define DEFAULT_SOUND_DIR "/usr/share/sounds/xlockmore/"
+#endif
+
+#ifdef HAVE_LIBESD
+
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <esd.h>
+
+#else
+
+#error Sorry, but you cannot use ESD without ESD !!!?
+
+#endif
+
+typedef struct _esd_sample
+{
+    char               *file;
+    int                 rate;
+    int                 format;
+    int                 samples;
+    unsigned char      *data;
+    int                 id;
+    struct _esd_sample *next;
+} EsdSample_t;
+
+typedef EsdSample_t    *EsdSample_ptr;
+
+static EsdSample_ptr   EsdSamplesList =(EsdSample_ptr)NULL;
+static int             sound_fd = -1;
+
+static EsdSample_ptr           sound_esd_load_sample(char *file);
+static void            sound_esd_play(EsdSample_ptr s);
+static void            sound_esd_destroy_sample(EsdSample_ptr s);
+static int             sound_esd_init(void);
+static void            sound_esd_shutdown(void);
+
+
+/*
+ * Public ESOUND sound functions
+ * =============================
+ */
+
+void
+play_sound(char *filename, Bool verbose)
+{
+#ifdef DEBUG
+    (void) fprintf( stderr, "play_sound %s\n", filename );
+#endif
+    if ( filename && *filename )
+      sound_esd_play( sound_esd_load_sample( filename ) );
+}
+
+int init_sound(void)
+{
+    return( sound_esd_init() );
+}
+
+void shutdown_sound(void)
+{
+    sound_esd_shutdown();
+}
+
+/*
+ * Private ESOUND sound functions
+ * ==============================
+ */
+
+static EsdSample_ptr
+sound_esd_load_sample(char *file)
+{
+   AFfilehandle        in_file;
+   struct stat        stbuf;
+   EsdSample_ptr       s;
+   int                 in_format, in_width, in_channels, frame_count;
+   int                 bytes_per_frame, frames_read;
+   double              in_rate;
+   char              *origfile = strdup( file ? file : "" );
+   char               fullfile[MAXPATHLEN];
+
+#ifdef DEBUG
+   (void) fprintf(stderr, "sound_esd_load_sample: %s\n", origfile);
+#endif
+
+   s = EsdSamplesList;
+   while ( s && strcmp( file, s->file ) )
+     s = s->next;
+   if ( s && !strcmp( file, s->file ) )
+     return s;
+
+#ifdef DEBUG
+   (void) fprintf(stderr, "sound_esd_load_sample: sample not loaded: loading ...\n", origfile);
+#endif
+
+   if (file[0] != '/')
+   {
+       (void) sprintf( fullfile, "%s/%s", DEFAULT_SOUND_DIR, file );
+       file = fullfile;
+   }
+   if (stat(file, &stbuf) < 0)
+   {
+       (void) fprintf( stderr, "Error ! Cannot find the sound file %s\n", file);
+       return NULL;
+   }
+   if ( !( in_file = afOpenFile(file, "r", NULL) ) )
+   {
+       (void) fprintf( stderr, "Error ! Cannot open sound sample ! Bad format ?\n" );
+       return(NULL);
+   }
+   s = EsdSamplesList;
+   if ( s )
+   {
+       while ( s && s->next )
+         s = s->next;
+       s->next = malloc(sizeof(EsdSample_t));
+       if ( !s->next )
+       {
+           (void) fprintf( stderr, "Error ! cannot allocate sample data !\n" );
+           afCloseFile(in_file);
+           return NULL;
+       }
+       s = s->next;
+       s->next = NULL;
+   }
+   else
+   {
+       s = malloc(sizeof(EsdSample_t));
+       if ( !s )
+       {
+           (void) fprintf( stderr, "Error ! cannot allocate sample data !\n" );
+           afCloseFile(in_file);
+           return NULL;
+       }
+       EsdSamplesList = s;
+       s->next = NULL;
+   }
+
+   frame_count = afGetFrameCount(in_file, AF_DEFAULT_TRACK);
+   in_channels = afGetChannels(in_file, AF_DEFAULT_TRACK);
+   in_rate = afGetRate(in_file, AF_DEFAULT_TRACK);
+   afGetSampleFormat(in_file, AF_DEFAULT_TRACK, &in_format, &in_width);
+#ifdef WORDS_BIGENDIAN
+   afSetVirtualByteOrder(in_file, AF_DEFAULT_TRACK, AF_BYTEORDER_BIGENDIAN);
+#else
+   afSetVirtualByteOrder(in_file, AF_DEFAULT_TRACK, AF_BYTEORDER_LITTLEENDIAN);
+#endif
+   s->file = strdup(origfile);
+   s->rate = 44100;
+   s->format = ESD_STREAM | ESD_PLAY;
+   s->samples = 0;
+   s->data = NULL;
+   s->id = 0;
+
+   if (in_width == 8)
+      s->format |= ESD_BITS8;
+   else if (in_width == 16)
+      s->format |= ESD_BITS16;
+   bytes_per_frame = (in_width * in_channels) / 8;
+   if (in_channels == 1)
+      s->format |= ESD_MONO;
+   else if (in_channels == 2)
+      s->format |= ESD_STEREO;
+   s->rate = (int)in_rate;
+
+   s->samples = frame_count * bytes_per_frame;
+   s->data = malloc(frame_count * bytes_per_frame);
+   if ( !s->data )
+   {
+       (void) fprintf( stderr, "Error ! cannot allocate memory for sample !\n" );
+       afCloseFile(in_file);
+       return NULL;
+   }
+   frames_read = afReadFrames(in_file, AF_DEFAULT_TRACK, s->data, frame_count);
+   afCloseFile(in_file);
+   return s;
+}
+
+static
+void
+sound_esd_play(EsdSample_ptr s)
+{
+   int                 size, confirm = 0;
+
+#ifdef DEBUG
+   (void) fprintf( stderr, "sound_esd_play\n" );
+#endif
+
+   if ((sound_fd < 0) || (!s))
+     return;
+   if (!s->id)
+     {
+       if (sound_fd >= 0)
+         {
+            if (s->data)
+              {
+                 size = s->samples;
+                 s->id = esd_sample_getid(sound_fd, s->file);
+                 if (s->id < 0)
+                   {
+                      s->id = esd_sample_cache(sound_fd, s->format, s->rate, size, s->file);
+                      write(sound_fd, s->data, size);
+                      confirm = esd_confirm_sample_cache(sound_fd);
+                      if (confirm != s->id)
+                         s->id = 0;
+                   }
+                 free(s->data);
+                 s->data = NULL;
+              }
+         }
+     }
+   if (s->id > 0)
+     esd_sample_play(sound_fd, s->id);
+   return;
+}
+
+static void
+sound_esd_destroy_sample(EsdSample_ptr s)
+{
+#ifdef DEBUG
+    (void) fprintf( stderr, "sound_esd_destroy_sample\n" );
+#endif
+
+    if ((s->id) && (sound_fd >= 0))
+      esd_sample_free(sound_fd, s->id);
+
+    if (s->data)
+      free(s->data);
+    if (s->file)
+      free(s->file);
+}
+
+static int
+sound_esd_init(void)
+{
+    int                 fd;
+
+#ifdef DEBUG
+    (void) fprintf(stderr, "sound_esd_init\n");
+#endif
+    if (sound_fd != -1)
+      return 0;
+    fd = esd_open_sound(NULL);
+    if (fd >= 0)
+      sound_fd = fd;
+    else
+    {
+       (void) fprintf(stderr, "Error initialising sound\n");
+        return -1;
+     }
+    return 0;
+}
+
+static void
+sound_esd_shutdown(void)
+{
+#ifdef DEBUG
+    (void) fprintf( stderr, "sound_esd_shutdown\n" );
+#endif
+    if (sound_fd >= 0)
+    {
+        EsdSample_ptr  s = EsdSamplesList;
+        while ( s )
+        {
+            EsdSamplesList = s->next;
+            sound_esd_destroy_sample( s );
+            free( s );
+            s = EsdSamplesList;
+        }
+       close(sound_fd);
+       sound_fd = -1;
+    }
+}
+
+#endif
diff --git a/xlock/spline.c b/xlock/spline.c
new file mode 100644 (file)
index 0000000..1edec4a
--- /dev/null
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 1987, 1988, 1989 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.
+ */
+
+/*-
+ * This code came with the InterViews distribution, and was translated
+ * from C++ to C by Matthieu Devin <devin@lucid.com> some time in 1992.
+ */
+
+#if STANDALONE
+#include "utils.h"
+#else
+#include "xlock.h"
+#endif
+#include "spline.h"
+
+#define SMOOTHNESS 1.0
+
+static void no_more_memory(void);
+static void grow_spline_points(spline * s);
+static void mid_point(double x0, double y0, double x1, double y1,
+                     double *mx, double *my);
+static int  can_approx_with_line(double x0, double y0, double x2,
+                                double y2, double x3, double y3);
+static void add_line(spline * s, double x0, double y0, double x1, double y1);
+static void add_bezier_arc(spline * s,
+                          double x0, double y0, double x1, double y1,
+                          double x2, double y2, double x3, double y3);
+static void third_point(double x0, double y0, double x1, double y1,
+                       double *tx, double *ty);
+static void calc_section(spline * s, double cminus1x, double cminus1y,
+                        double cx, double cy, double cplus1x, double cplus1y,
+                        double cplus2x, double cplus2y);
+
+static void
+no_more_memory(void)
+{
+       (void) fprintf(stderr, "No more memory\n");
+#if STANDALONE
+       exit(1);
+#endif
+}
+
+spline     *
+make_spline(unsigned int size)
+{
+       spline     *s = (spline *) calloc(1, sizeof (spline));
+
+       if (s) {
+               s->n_controls = size;
+               s->control_x = (double *) calloc(s->n_controls, sizeof (double));
+               s->control_y = (double *) calloc(s->n_controls, sizeof (double));
+
+               s->n_points = 0;
+               s->allocated_points = s->n_controls;
+               s->points = (XPoint *) calloc(s->allocated_points, sizeof (XPoint));
+
+               if (!s->control_x || !s->control_y || !s->points) {
+                       no_more_memory();
+               }
+       } else
+               no_more_memory();
+       return s;
+}
+
+void
+free_spline(spline * s)
+{
+       (void) free((void *) s->control_x);
+       (void) free((void *) s->control_y);
+       (void) free((void *) s->points);
+       (void) free((void *) s);
+}
+
+/* PURIFY says that this leaks */
+static void
+grow_spline_points(spline * s)
+{
+       s->allocated_points *= 2;
+       s->points =
+               (XPoint *) realloc(s->points, s->allocated_points * sizeof (XPoint));
+
+       if (!s->points)
+               no_more_memory();
+}
+
+static void
+mid_point(double x0, double y0,
+         double x1, double y1,
+         double *mx, double *my)
+{
+       *mx = (x0 + x1) / 2.0;
+       *my = (y0 + y1) / 2.0;
+}
+
+static void
+third_point(double x0, double y0,
+           double x1, double y1,
+           double *tx, double *ty)
+{
+       *tx = (2 * x0 + x1) / 3.0;
+       *ty = (2 * y0 + y1) / 3.0;
+}
+
+static int
+can_approx_with_line(double x0, double y0,
+                    double x2, double y2,
+                    double x3, double y3)
+{
+       double      triangle_area, side_squared, dx, dy;
+
+       triangle_area = x0 * y2 - x2 * y0 + x2 * y3 - x3 * y2 + x3 * y0 - x0 * y3;
+       /* actually 4 times the area. */
+       triangle_area *= triangle_area;
+       dx = x3 - x0;
+       dy = y3 - y0;
+       side_squared = dx * dx + dy * dy;
+       return triangle_area <= SMOOTHNESS * side_squared;
+}
+
+static void
+add_line(spline * s,
+        double x0, double y0,
+        double x1, double y1)
+{
+       if (s->n_points >= s->allocated_points)
+               grow_spline_points(s);
+
+       if (s->n_points == 0) {
+               s->points[s->n_points].x = (short) x0;
+               s->points[s->n_points].y = (short) y0;
+               s->n_points += 1;
+       }
+       s->points[s->n_points].x = (short) x1;
+       s->points[s->n_points].y = (short) y1;
+       s->n_points += 1;
+}
+
+static void
+add_bezier_arc(spline * s,
+              double x0, double y0,
+              double x1, double y1,
+              double x2, double y2,
+              double x3, double y3)
+{
+       double      midx01, midx12, midx23, midlsegx, midrsegx, cx, midy01,
+                   midy12, midy23, midlsegy, midrsegy, cy;
+
+       mid_point(x0, y0, x1, y1, &midx01, &midy01);
+       mid_point(x1, y1, x2, y2, &midx12, &midy12);
+       mid_point(x2, y2, x3, y3, &midx23, &midy23);
+       mid_point(midx01, midy01, midx12, midy12, &midlsegx, &midlsegy);
+       mid_point(midx12, midy12, midx23, midy23, &midrsegx, &midrsegy);
+       mid_point(midlsegx, midlsegy, midrsegx, midrsegy, &cx, &cy);
+
+       if (can_approx_with_line(x0, y0, midlsegx, midlsegy, cx, cy))
+               add_line(s, x0, y0, cx, cy);
+       else if ((midx01 != x1) || (midy01 != y1) || (midlsegx != x2)
+                || (midlsegy != y2) || (cx != x3) || (cy != y3))
+               add_bezier_arc(s, x0, y0, midx01, midy01, midlsegx, midlsegy, cx, cy);
+
+       if (can_approx_with_line(cx, cy, midx23, midy23, x3, y3))
+               add_line(s, cx, cy, x3, y3);
+       else if ((cx != x0) || (cy != y0) || (midrsegx != x1) || (midrsegy != y1)
+                || (midx23 != x2) || (midy23 != y2))
+               add_bezier_arc(s, cx, cy, midrsegx, midrsegy, midx23, midy23, x3, y3);
+}
+
+static void
+calc_section(spline * s,
+            double cminus1x, double cminus1y,
+            double cx, double cy,
+            double cplus1x, double cplus1y,
+            double cplus2x, double cplus2y)
+{
+       double      p0x, p1x, p2x, p3x, tempx, p0y, p1y, p2y, p3y, tempy;
+
+       third_point(cx, cy, cplus1x, cplus1y, &p1x, &p1y);
+       third_point(cplus1x, cplus1y, cx, cy, &p2x, &p2y);
+       third_point(cx, cy, cminus1x, cminus1y, &tempx, &tempy);
+       mid_point(tempx, tempy, p1x, p1y, &p0x, &p0y);
+       third_point(cplus1x, cplus1y, cplus2x, cplus2y, &tempx, &tempy);
+       mid_point(tempx, tempy, p2x, p2y, &p3x, &p3y);
+       add_bezier_arc(s, p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y);
+}
+
+void
+compute_spline(spline * s)
+{
+       int         i;
+
+       s->n_points = 0;
+
+       if (s->n_controls < 3)
+               return;
+
+       calc_section(s, s->control_x[0], s->control_y[0], s->control_x[0],
+                    s->control_y[0], s->control_x[0], s->control_y[0],
+                    s->control_x[1], s->control_y[1]);
+       calc_section(s, s->control_x[0], s->control_y[0], s->control_x[0],
+                    s->control_y[0], s->control_x[1], s->control_y[1],
+                    s->control_x[2], s->control_y[2]);
+
+       for (i = 1; i < (int) s->n_controls - 2; i++)
+               calc_section(s, s->control_x[i - 1], s->control_y[i - 1],
+                            s->control_x[i], s->control_y[i],
+                            s->control_x[i + 1], s->control_y[i + 1],
+                            s->control_x[i + 2], s->control_y[i + 2]);
+
+       calc_section(s, s->control_x[i - 1], s->control_y[i - 1],
+                    s->control_x[i], s->control_y[i],
+                    s->control_x[i + 1], s->control_y[i + 1],
+                    s->control_x[i + 1], s->control_y[i + 1]);
+       calc_section(s, s->control_x[i], s->control_y[i],
+                    s->control_x[i + 1], s->control_y[i + 1],
+                    s->control_x[i + 1], s->control_y[i + 1],
+                    s->control_x[i + 1], s->control_y[i + 1]);
+}
+
+void
+compute_closed_spline(spline * s)
+{
+       int         i;
+
+       s->n_points = 0;
+
+       if (s->n_controls < 3)
+               return;
+
+       calc_section(s,
+                    s->control_x[s->n_controls - 1],
+                    s->control_y[s->n_controls - 1],
+                    s->control_x[0], s->control_y[0],
+                    s->control_x[1], s->control_y[1],
+                    s->control_x[2], s->control_y[2]);
+
+       for (i = 1; i < (int) s->n_controls - 2; i++)
+               calc_section(s, s->control_x[i - 1], s->control_y[i - 1],
+                            s->control_x[i], s->control_y[i],
+                            s->control_x[i + 1], s->control_y[i + 1],
+                            s->control_x[i + 2], s->control_y[i + 2]);
+
+       calc_section(s, s->control_x[i - 1], s->control_y[i - 1],
+                    s->control_x[i], s->control_y[i],
+                    s->control_x[i + 1], s->control_y[i + 1],
+                    s->control_x[0], s->control_y[0]);
+       calc_section(s, s->control_x[i], s->control_y[i],
+                    s->control_x[i + 1], s->control_y[i + 1],
+                    s->control_x[0], s->control_y[0],
+                    s->control_x[1], s->control_y[1]);
+}
+
+void
+just_fill_spline(spline * s)
+{
+       int         i;
+
+       while (s->allocated_points < s->n_controls + 1)
+               grow_spline_points(s);
+
+       for (i = 0; i < (int) s->n_controls; i++) {
+               s->points[i].x = (short) s->control_x[i];
+               s->points[i].y = (short) s->control_y[i];
+       }
+       s->points[s->n_controls].x = (short) s->control_x[0];
+       s->points[s->n_controls].y = (short) s->control_y[0];
+       s->n_points = s->n_controls + 1;
+}
+
+void
+append_spline_points(spline * s1, spline * s2)
+{
+       int         i;
+
+       while (s1->allocated_points < s1->n_points + s2->n_points)
+               grow_spline_points(s1);
+       for (i = s1->n_points; i < (int) (s1->n_points + s2->n_points); i++) {
+               s1->points[i].x = s2->points[i - s1->n_points].x;
+               s1->points[i].y = s2->points[i - s1->n_points].y;
+       }
+       s1->n_points = s1->n_points + s2->n_points;
+}
+
+void
+spline_bounding_box(spline * s, XRectangle * rectangle_out)
+{
+       int         min_x;
+       int         max_x;
+       int         min_y;
+       int         max_y;
+       int         i;
+
+       if (s->n_points == 0) {
+               rectangle_out->x = 0;
+               rectangle_out->y = 0;
+               rectangle_out->width = 0;
+               rectangle_out->height = 0;
+       }
+       min_x = s->points[0].x;
+       max_x = min_x;
+       min_y = s->points[0].y;
+       max_y = min_y;
+
+       for (i = 1; i < (int) s->n_points; i++) {
+               if (s->points[i].x < min_x)
+                       min_x = s->points[i].x;
+               if (s->points[i].x > max_x)
+                       max_x = s->points[i].x;
+               if (s->points[i].y < min_y)
+                       min_y = s->points[i].y;
+               if (s->points[i].y > max_y)
+                       max_y = s->points[i].y;
+       }
+       rectangle_out->x = min_x;
+       rectangle_out->y = min_y;
+       rectangle_out->width = max_x - min_x;
+       rectangle_out->height = max_y - min_y;
+}
diff --git a/xlock/spline.h b/xlock/spline.h
new file mode 100644 (file)
index 0000000..b5d2d01
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef _SPLINE_H_
+#define _SPLINE_H_
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident  "@(#)spline.h      4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Spline stuff
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+/*
+ * Copyright (c) 1987, 1988, 1989 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.
+ */
+
+/* This code came with the InterViews distribution, and was translated
+   from C++ to C by Matthieu Devin <devin@lucid.com> some time in 1992.
+ */
+
+typedef struct {
+       /* input */
+       unsigned int n_controls;
+       double     *control_x;
+       double     *control_y;
+
+       /* output */
+       unsigned int n_points;
+       XPoint     *points;
+       unsigned int allocated_points;
+} spline;
+
+spline     *make_spline(unsigned int size);
+void        compute_spline(spline * s);
+void        compute_closed_spline(spline * s);
+void        just_fill_spline(spline * s);
+void        append_spline_points(spline * s1, spline * s2);
+void        spline_bounding_box(spline * s, XRectangle * rectangle_out);
+void        free_spline(spline * s);
+
+#endif /* _SPLINE_H_ */
diff --git a/xlock/util.c b/xlock/util.c
new file mode 100644 (file)
index 0000000..b3a9282
--- /dev/null
@@ -0,0 +1,191 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)util.c       4.10 98/04/23 xlockmore";
+
+#endif
+
+/*-
+ * util.c - various utilities - usleep, seconds, strdup, matherr
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 23-Apr-98: Separated stuff out of this file, changed name to util.c
+ * 08-Jul-96: Bug in strcat_firstword fixed thanks to
+ *            <Jeffrey_Doggett@caradon.com>.  Fix for ":not found" text
+ *            that appears after about 40 minutes.
+ * 04-Apr-96: Added procedures to handle wildcards on filenames
+ *            J. Jansen <joukj@hrem.stm.tudelft.nl>
+ * 15-May-95: random number generator added, moved hsbramp.c to utils.c .
+ *            Also renamed file from usleep.c to utils.c .
+ * 14-Mar-95: patches for rand and seconds for VMS
+ * 27-Feb-95: fixed nanosleep for times >= 1 second
+ * 05-Jan-95: nanosleep for Solaris 2.3 and greater Greg Onufer
+ *            <Greg.Onufer@Eng.Sun.COM>
+ * 22-Jun-94: Fudged for VMS by Anthony Clarke
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 10-Jun-94: patch for BSD from Victor Langeveld <vic@mbfys.kun.nl>
+ * 02-May-94: patch for Linux, got ideas from Darren Senn's xlock
+ *            <sinster@scintilla.capitola.ca.us>
+ * 21-Mar-94: patch fix for HP from <R.K.Lloyd@csc.liv.ac.uk>
+ * 01-Dec-93: added patch for HP
+ *
+ * Changes of Patrick J. Naughton
+ * 30-Aug-90: written.
+ *
+ */
+
+#include "xlock.h"
+#include "util.h"
+#include <sys/stat.h>
+
+#if 1
+/* def USE_OLD_EVENT_LOOP */
+#if !defined( VMS ) || defined( XVMSUTILS ) || ( __VMS_VER >= 70000000 )
+#ifdef USE_XVMSUTILS
+#include <X11/unix_time.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#endif
+#else
+#include <starlet.h>
+#endif
+#if defined( SYSV ) || defined( SVR4 )
+#ifdef LESS_THAN_AIX3_2
+#include <sys/poll.h>
+#else /* !LESS_THAN_AIX3_2 */
+#include <poll.h>
+#endif /* !LESS_THAN_AIX3_2 */
+#endif /* defined( SYSV ) || defined( SVR4 ) */
+
+#ifndef HAVE_USLEEP
+ /* usleep should be defined */
+int
+usleep(unsigned long usec)
+{
+#if (defined( SYSV ) || defined( SVR4 )) && !defined( __hpux )
+#ifdef HAVE_NANOSLEEP
+       {
+               struct timespec rqt;
+
+               rqt.tv_nsec = 1000 * (usec % (unsigned long) 1000000);
+               rqt.tv_sec = usec / (unsigned long) 1000000;
+               return nanosleep(&rqt, NULL);
+       }
+#else /* !HAVE_NANOSLEEP */
+#ifdef SunCplusplus
+       (void) poll((pollfd *) 0, (int) 0, usec / 1000);        /* ms resolution */
+#else
+       (void) poll((void *) 0, (int) 0, usec / 1000);  /* ms resolution */
+#endif
+#endif /* !HAVE_NANOSLEEP */
+#else /* !SYSV */
+#if HAVE_GETTIMEOFDAY
+       struct timeval time_out;
+
+       time_out.tv_usec = usec % (unsigned long) 1000000;
+       time_out.tv_sec = usec / (unsigned long) 1000000;
+       (void) select(0, (void *) 0, (void *) 0, (void *) 0, &time_out);
+#else
+       long        timadr[2];
+
+       if (usec != 0) {
+               timadr[0] = -usec * 10;
+               timadr[1] = -1;
+
+               sys$setimr(4, &timadr, 0, 0, 0);
+               sys$waitfr(4);
+       }
+#endif
+#endif /* !SYSV */
+       return 0;
+}
+#endif /* !HAVE_USLEEP */
+#endif /* USE_OLD_EVENT_LOOP */
+
+/*-
+ * returns the number of seconds since 01-Jan-70.
+ * This is used to control rate and timeout in many of the animations.
+ */
+unsigned long
+seconds(void)
+{
+#if HAVE_GETTIMEOFDAY
+       struct timeval now;
+
+       GETTIMEOFDAY(&now);
+       return (unsigned long) now.tv_sec;
+#else
+       return (unsigned long) time((time_t *) 0);
+#endif
+}
+
+#if (! HAVE_STRDUP )
+char       *
+strdup(char *str)
+{
+       register char *ptr;
+
+       ptr = (char *) malloc(strlen(str) + 1);
+       (void) strcpy(ptr, str);
+       return ptr;
+}
+#endif
+
+#ifdef USE_MATHERR
+/* Handle certain math exception errors */
+int
+matherr(register struct exception *x)
+{
+       extern Bool debug;
+
+       switch (x->type) {
+               case DOMAIN:
+                       /* Suppress "asin: DOMAIN error" stderr message */
+                       if (!strcmp(x->name, "asin")) {
+                               x->retval = 0.0;
+                               return ((debug) ? 0 : 1);       /* suppress message unless debugging */
+                       }
+                       /* Suppress "acos: DOMAIN error" stderr message */
+                       if (!strcmp(x->name, "acos")) {
+                               x->retval = 0.0;
+                               return ((debug) ? 0 : 1);       /* suppress message unless debugging */
+                       }
+                       /* Suppress "atan2: DOMAIN error" stderr message */
+                       if (!strcmp(x->name, "atan2")) {
+                               x->retval = 0.0;
+                               return ((debug) ? 0 : 1);       /* suppress message unless debugging */
+                       }
+                       /* change sqrt to return sqrt(-arg1), not NaN */
+                       if (!strcmp(x->name, "sqrt")) {
+                               x->retval = sqrt(-x->arg1);
+                               /* x->retval = 0.0; */
+                               return ((debug) ? 0 : 1);       /* suppress message unless debugging */
+                       }
+                       break;
+#ifdef __hpux
+                       /* Fix how HP-UX does not like sin and cos of angles >= 360.  */
+               case TLOSS:
+                       if (!strcmp(x->name, "cos")) {
+                               x->retval = cos(fmod(x->arg1, 360.0));
+                               return (1);     /* suppress message */
+                       }
+                       if (!strcmp(x->name, "sin")) {
+                               x->retval = sin(fmod(x->arg1, 360.0));
+                               return (1);     /* suppress message */
+                       }
+                       break;
+               case PLOSS:
+                       return (1);
+                       break;
+#endif
+       }
+       return (0);             /* all other exceptions, execute default procedure */
+}
+#endif
diff --git a/xlock/util.h b/xlock/util.h
new file mode 100644 (file)
index 0000000..a0a6b58
--- /dev/null
@@ -0,0 +1,20 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)util.h     4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Utilites stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+extern unsigned long seconds(void);
+
+#if ( !HAVE_STRDUP )
+extern char *strdup(char *);
+
+#endif
diff --git a/xlock/version.h b/xlock/version.h
new file mode 100644 (file)
index 0000000..9379998
--- /dev/null
@@ -0,0 +1,6 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)version.h  5.01 2001/04/13 xlockmore" */
+
+#endif
+
+#define VERSION "xlockmore-5.01.1"
diff --git a/xlock/vis.c b/xlock/vis.c
new file mode 100644 (file)
index 0000000..aed00a7
--- /dev/null
@@ -0,0 +1,331 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)vis.c        4.07 97/01/30 xlockmore";
+
+#endif
+
+/*-
+ * vis.c - separated out of util.c for no good reason
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Revision History:
+ * 19-Feb-01: Separated out pure GL stuff <lassauge@mail.dotcom.fr>
+ * 23-Apr-97: Name conflict with xscreensaver, name changed.
+ * 15-Oct-97: Separated out and modified.
+ *
+ */
+
+#include "xlock.h"
+#include "vis.h"
+
+extern Bool verbose;
+extern Bool debug;
+
+static void
+showVisualInfo(XVisualInfo * Vis)
+{
+       (void) fprintf(stderr, "Visual info: ");
+       (void) fprintf(stderr, "screen %d, ", Vis->screen);
+       (void) fprintf(stderr, "visual id 0x%x, ", (int) Vis->visualid);
+       (void) fprintf(stderr, "class %s, ", nameOfVisualClass(Vis->CLASS));
+       (void) fprintf(stderr, "depth %d\n", Vis->depth);
+}
+
+extern ScreenInfo *Scr;
+
+Bool
+fixedColors(ModeInfo * mi)
+{
+       Bool        temp;
+
+#ifdef FORCEFIXEDCOLORS
+       /* pretending a fixed colourmap */
+       return TRUE;
+#else
+       /* get information about the default visual */
+       temp = (!((MI_NPIXELS(mi) > 2) &&
+                 (MI_VISUALCLASS(mi) != StaticGray) &&
+                 (MI_VISUALCLASS(mi) != StaticColor) &&
+                 (MI_VISUALCLASS(mi) != TrueColor) &&
+#if 0
+/*-
+ * This may fix wrong colors (possibly unreadable text) in password window
+ */
+                 !MI_IS_ICONIC(mi) &&
+#endif
+                 !MI_IS_INROOT(mi) &&
+                 MI_IS_INSTALL(mi)));
+#endif
+       if (debug) {
+               (void) printf("%s colors on screen %d\n", (temp) ? "fixed" : "writeable",
+                             MI_SCREEN(mi));
+       }
+       return temp;
+}
+
+static struct visual_class_name {
+       int         visualclass;
+       char       *name;
+} VisualClassName[] = {
+
+       {
+               StaticGray, (char *) "StaticGray"
+       },
+       {
+               GrayScale, (char *) "GrayScale"
+       },
+       {
+               StaticColor, (char *) "StaticColor"
+       },
+       {
+               PseudoColor, (char *) "PseudoColor"
+       },
+       {
+               TrueColor, (char *) "TrueColor"
+       },
+       {
+               DirectColor, (char *) "DirectColor"
+       },
+       {
+               -1, NULL        /* Others are 0-5 respectively */
+       },
+};
+
+int
+visualClassFromName(char *name)
+{
+       int         a;
+       char       *s1, *s2;
+       int         visualclass = -1;
+
+       for (a = 0; VisualClassName[a].name; a++) {
+               for (s1 = VisualClassName[a].name, s2 = name; *s1 && *s2; s1++, s2++)
+                       if ((isupper((int) *s1) ? tolower((int) *s1) : *s1) !=
+                           (isupper((int) *s2) ? tolower((int) *s2) : *s2))
+                               break;
+
+               if ((*s1 == '\0') || (*s2 == '\0')) {
+
+                       if (visualclass != -1) {
+                               (void) fprintf(stderr,
+                                              "%s does not uniquely describe a visual class (ignored)\n", name);
+                               return (-1);
+                       }
+                       visualclass = VisualClassName[a].visualclass;
+               }
+       }
+       if (visualclass == -1)
+               (void) fprintf(stderr, "%s is not a visual class (ignored)\n", name);
+       return (visualclass);
+}
+
+const char *
+nameOfVisualClass(int visualclass)
+{
+       int         a;
+
+       for (a = 0; VisualClassName[a].name; a++)
+               if (VisualClassName[a].visualclass == visualclass)
+                       return (VisualClassName[a].name);
+       return ("[Unknown Visual Class]");
+}
+
+/*-
+ * setupColormap
+ *
+ * Create a read/write colourmap to use
+ *
+ */
+
+Bool
+setupColormap(ModeInfo * mi, int *colors, Bool * truecolor,
+unsigned long *red_mask, unsigned long *blue_mask, unsigned long *green_mask)
+{
+       /* how many colours are there altogether? */
+       *colors = MI_NPIXELS(mi);
+       if (*colors > MI_COLORMAP_SIZE(mi)) {
+               *colors = MI_COLORMAP_SIZE(mi);
+       }
+       if (*colors < 2)
+               *colors = 2;
+
+       *truecolor = (MI_VISUALCLASS(mi) == TrueColor);
+
+       *red_mask = MI_RED_MASK(mi);
+       *green_mask = MI_GREEN_MASK(mi);
+       *blue_mask = MI_BLUE_MASK(mi);
+
+       return !fixedColors(mi);
+}
+
+
+extern Bool mono;
+
+/*-
+ * default_visual_info
+ *
+ * Gets a XVisualInfo structure that refers to a given visual or the default
+ * visual.
+ *
+ * -      mi is the ModeInfo
+ * -      visual is the visual to look up NULL => look up the default visual
+ * -      default_info is set to point to the member of the returned list
+ *          that corresponds to the default visual.
+ *
+ * Returns a list of XVisualInfo structures or NULL on failure. Free the list
+ *   with XFree.
+ */
+void
+defaultVisualInfo(Display * display, int screen)
+{
+       XVisualInfo *info_list = NULL, *info = NULL, vTemplate;
+       int         n = 0;
+       extern int  VisualClassWanted;
+
+       vTemplate.screen = screen;
+       vTemplate.depth = DisplayPlanes(display, screen);
+       {
+#if defined( USE_GL )          /* go with what init_GL found */
+       extern Bool *glOK;
+               XVisualInfo *wantVis = NULL;
+
+               if (!glOK) {
+                       glOK = (Bool *) malloc(ScreenCount(display) * sizeof (Bool));
+                       if (!glOK)
+                               return;
+               }
+               glOK[screen] = True;
+               if (VisualClassWanted == -1) {
+
+                       wantVis = NULL;         /* NULL means use the default in getVisual() */
+
+               } else {
+                       vTemplate.CLASS = VisualClassWanted;
+                       wantVis = XGetVisualInfo(display,
+                       VisualScreenMask | VisualDepthMask | VisualClassMask,
+                                                &vTemplate, &n);
+
+                       if (n == 0) {
+                               /* Wanted visual not found so use default */
+                               wantVis = NULL;
+                       }
+               }
+
+               /* if User asked for color, try that first, then try mono */
+               /* if User asked for mono.  Might fail on 16/24 bit displays,
+                  so fall back on color, but keep the mono "look & feel". */
+               info = info_list = getGLVisual(display, screen, wantVis, mono);
+               if (!info_list) {
+                       info = info_list = getGLVisual(display, screen, wantVis, !mono);
+                       if (!info_list) {
+#endif
+                               int         i;
+
+                               if (VisualClassWanted == -1) {
+                                       vTemplate.CLASS = DefaultVisual(display, screen)->CLASS;
+                               } else {
+                                       vTemplate.CLASS = VisualClassWanted;
+                               }
+                               info_list = XGetVisualInfo(display,
+                                                          VisualScreenMask | VisualDepthMask | VisualClassMask,
+                                                          &vTemplate, &n);
+                               if (VisualClassWanted != -1 && n == 0) {
+                                       /* Wanted visual not found so use default */
+                                       vTemplate.CLASS = DefaultVisual(display, screen)->CLASS;
+                                       if (info_list)
+                                               XFree((char *) info_list);
+                                       info_list = XGetVisualInfo(display,
+                                                                  VisualScreenMask | VisualDepthMask | VisualClassMask,
+                                                            &vTemplate, &n);
+                                       if (n == 0) {
+                                               info_list = XGetVisualInfo(display,
+                                                                          VisualScreenMask | VisualClassMask,
+                                                            &vTemplate, &n);
+                                       }
+                               }
+                               if ((info_list == NULL) || (n == 0)) {
+                                       if (info_list)
+                                               XFree((char *) info_list);
+                                       if (verbose)
+                                               (void) fprintf(stderr,
+                                                              "Could get visual for screen %d.\n", screen);
+                                       return;
+                               }
+                               if (VisualClassWanted == -1) {
+                                       /* search through the list for the default visual */
+                                       info = info_list;
+                                       for (i = 0; i < n; i++, info++)
+                                               if (info->visual == DefaultVisual(display, screen) &&
+                                                   info->screen == screen)
+                                                       break;
+                               } else {
+                                       info = info_list;
+                                       for (i = 0; i < n; i++, info++) {
+                                               if (info->screen == screen &&
+                                                   info->CLASS == VisualClassWanted) {
+                                                       break;
+                                               }
+                                       }
+                                       if (i == n) {
+                                               info = info_list;
+                                               for (i = 0; i < n; i++, info++) {
+                                                       if (info->screen == screen &&
+                                                           info->visual == DefaultVisual(display, screen))
+                                                               break;
+                                               }
+                                       }
+                               }
+#if defined( USE_GL )
+                               if (verbose)
+                                       (void) fprintf(stderr, "GL can not render with root visual\n");
+                               glOK[screen] = False;
+                       }
+               }
+#endif
+       }
+       if (verbose) {
+               showVisualInfo(info);
+       }
+       Scr[screen].depth = info->depth;
+       Scr[screen].visual = info->visual;
+       Scr[screen].visualclass = info->CLASS;
+       Scr[screen].colormap_size = info->colormap_size;
+       Scr[screen].red_mask = info->red_mask;
+       Scr[screen].green_mask = info->green_mask;
+       Scr[screen].blue_mask = info->blue_mask;
+       XFree((char *) info_list);      /* NOT info ... its modified */
+}
+
+/* has_writeable was hacked out of xscreensaver and modified for xlockmore
+ * by Jouk Jansen <joukj@hrem.stm.tudelft.nl>
+ *
+ * xscreensaver, Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998
+ *  by Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+Bool
+has_writable_cells(ModeInfo * mi)
+{
+       switch (MI_VISUALCLASS(mi)) {
+               case GrayScale: /* Mappable grays. */
+               case PseudoColor:       /* Mappable colors. */
+                       return True;
+               case StaticGray:        /* Fixed grays. */
+               case TrueColor: /* Fixed colors. */
+               case StaticColor:       /* (What's the difference again?) */
+               case DirectColor:       /* DirectColor visuals are like TrueColor, but have
+                                          three colormaps - one for each component of RGB.
+                                          Screw it. */
+                       return False;
+               default:
+                       abort();
+       }
+       return False;
+}
diff --git a/xlock/vis.h b/xlock/vis.h
new file mode 100644 (file)
index 0000000..110cf2c
--- /dev/null
@@ -0,0 +1,31 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)vis.h      4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * Visual stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-06-99: Started log. :)
+ */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern void defaultVisualInfo(Display * display, int screen);
+extern Bool setupColormap(ModeInfo * mi, int *colors, Bool * truecolor,
+  unsigned long *redmask, unsigned long *bluemask, unsigned long *greenmask);
+extern int  visualClassFromName(char *name);
+extern const char *nameOfVisualClass(int visualclass);
+extern Bool has_writable_cells(ModeInfo * mi);
+extern Bool fixedColors(ModeInfo * mi);
+#ifdef __cplusplus
+  }
+#endif
+
+#ifdef USE_GL
+#include "visgl.h"
+#endif
diff --git a/xlock/visgl.c b/xlock/visgl.c
new file mode 100644 (file)
index 0000000..2fb0950
--- /dev/null
@@ -0,0 +1,416 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)visgl.c      5.01 01/02/19 xlockmore";
+
+#endif
+
+/*-
+ * visgl.c - separated out of vis.c for lots of good reasons !
+ *         - parts grabbed from xscreensaver
+ *
+ * Copyright (c) 2001 by Eric Lassauge
+ *
+ * Revision History:
+ *
+ * E.Lassauge - 09-Mar-2001:
+ *     - Use showfps vs erroneous fpsTop
+ *      - use MI_DELAY instead of MI_PAUSE for accumulating FPS value
+ */
+
+
+#include "xlock.h"
+#include "visgl.h"
+
+#ifdef USE_GL
+#include <GL/glu.h>
+
+static GLXContext *glXContext = NULL;
+Bool *glOK = NULL;
+
+/* fps stuff */
+static XFontStruct *font_struct = (XFontStruct *)NULL;
+static GLuint   font_dlist;
+extern Bool     fpsTop;
+extern char    *fpsfontname;
+
+/*-
+ * NOTE WELL:  We _MUST_ destroy the glXContext between each mode
+ * in random mode, otherwise OpenGL settings and paramaters from one
+ * mode will affect the default initial state for the next mode.
+ * BUT, we are going to keep the visual returned by glXChooseVisual,
+ * because it will still be good (and because Mesa must keep track
+ * of each one, even after XFree(), causing a small memory leak).
+ */
+
+XVisualInfo *
+getGLVisual(Display * display, int screen, XVisualInfo * wantVis, int monochrome)
+{
+       if (wantVis) {
+               /* Use glXGetConfig() to see if wantVis has what we need already. */
+               int         depthBits, doubleBuffer;
+
+               /* glXGetConfig(display, wantVis, GLX_RGBA, &rgbaMode); */
+               glXGetConfig(display, wantVis, GLX_DEPTH_SIZE, &depthBits);
+               glXGetConfig(display, wantVis, GLX_DOUBLEBUFFER, &doubleBuffer);
+
+               if ((depthBits > 0) && doubleBuffer) {
+                       return wantVis;
+               } else {
+                       XFree((char *) wantVis);        /* Free it up since its useless now. */
+                       wantVis = NULL;
+               }
+       }
+       /* If wantVis is useless, try glXChooseVisual() */
+       if (monochrome) {
+               /* Monochrome display - use color index mode */
+               int         attribList[] =
+               {GLX_DOUBLEBUFFER, None};
+
+               return glXChooseVisual(display, screen, attribList);
+       } else {
+               int         attribList[] =
+#if 1
+               {GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1,
+                GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1, None};
+
+#else
+               {GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1, None};
+
+#endif
+               return glXChooseVisual(display, screen, attribList);
+       }
+}
+
+/*-
+ * The following function should be called on startup of any GL mode.
+ * It returns a GLXContext for the calling mode to use with
+ * glXMakeCurrent().
+ */
+GLXContext *
+init_GL(ModeInfo * mi)
+{
+       Display    *display = MI_DISPLAY(mi);
+       Window      window = MI_WINDOW(mi);
+       int         screen = MI_SCREEN(mi);
+       XVisualInfo xvi_in, *xvi_out;
+       int         num_vis;
+       GLboolean   rgbaMode;
+
+#ifdef FX
+       extern void resetSize(ModeInfo * mi, Bool setGL);
+
+#endif
+
+       if (!glXContext) {
+               glXContext = (GLXContext *) calloc(MI_NUM_SCREENS(mi),
+                                                  sizeof (GLXContext));
+               if (!glXContext)
+                       return NULL;
+       }
+       if (glXContext[screen]) {
+               glXDestroyContext(display, glXContext[screen]);
+               glXContext[screen] = NULL;
+       }
+       xvi_in.screen = screen;
+       xvi_in.visualid = XVisualIDFromVisual(MI_VISUAL(mi));
+       xvi_out = XGetVisualInfo(display, VisualScreenMask | VisualIDMask,
+                                &xvi_in, &num_vis);
+       if (!xvi_out) {
+               (void) fprintf(stderr, "Could not get XVisualInfo\n");
+               return NULL;
+       }
+/*-
+ * PURIFY 4.0.1 on SunOS4 and on Solaris 2 reports a 104 byte memory leak on
+ * the next line each time that a GL mode is run in random mode when using
+ * MesaGL 2.2.  This cumulative leak can cause xlock to eventually crash if
+ * available memory is depleted.  This bug is fixed in MesaGL 2.3. */
+       if (glOK && glOK[screen])
+               glXContext[screen] = glXCreateContext(display, xvi_out, 0, GL_TRUE);
+
+       XFree((char *) xvi_out);
+
+       if (!glXContext[screen]) {
+               if (MI_IS_VERBOSE(mi))
+                       (void) fprintf(stderr,
+                                      "GL could not create rendering context on screen %d.\n", screen);
+               return (NULL);
+       }
+/*-
+ * PURIFY 4.0.1 on Solaris2 reports an uninitialized memory read on the next
+ * line. PURIFY 4.0.1 on SunOS4 does not report this error. */
+       if (!glXMakeCurrent(display, window, glXContext[screen])) {
+               if (MI_IS_DEBUG(mi)) {
+                       (void) fprintf(stderr, "GLX error\n");
+                       (void) fprintf(stderr, "If using MesaGL, XGetWindowAttributes is\n");
+                       (void) fprintf(stderr, "probably returning a null colormap in\n");
+                       (void) fprintf(stderr, "XMesaCreateWindowBuffer in xmesa1.c .\n");
+               }
+               return (NULL);
+       }
+       /* True Color junk */
+       glGetBooleanv(GL_RGBA_MODE, &rgbaMode);
+       if (!rgbaMode) {
+               glIndexi(MI_WHITE_PIXEL(mi));
+               glClearIndex((float) MI_BLACK_PIXEL(mi));
+       }
+#ifdef FX
+       resetSize(mi, True);
+#endif
+       return (&(glXContext[screen]));
+}
+
+void
+FreeAllGL(ModeInfo * mi)
+{
+       int         scr;
+
+#ifdef FX
+       extern void resetSize(ModeInfo * mi, Bool setGL);
+
+#endif
+
+       if (glXContext) {
+               /* To release the current context */
+               glXMakeCurrent(MI_DISPLAY(mi),None, NULL);
+               /* then destroy all contexts */
+               for (scr = 0; scr < MI_NUM_SCREENS(mi); scr++) {
+                       if (glXContext[scr]) {
+                               glXDestroyContext(MI_DISPLAY(mi), glXContext[scr]);
+                               glXContext[scr] = NULL;
+                       }
+               }
+               (void) free((void *) glXContext);
+               glXContext = NULL;
+       }
+#ifdef FX
+       resetSize(mi, False);
+#endif
+
+#if 0
+       if (glOK) {
+               (void) free((void *) glOK);
+               glOK = NULL;
+       }
+#endif
+       if (MI_IS_FPS(mi))
+       {
+               /* Free font stuff */
+               if (font_struct)
+               {
+                       int last;
+
+                       last = font_struct->max_char_or_byte2;
+                       clear_gl_error ();
+                       if (glIsList(font_dlist)) {
+                               glDeleteLists (font_dlist,(GLuint) last+1);
+                               check_gl_error ("glDeleteLists");
+                               font_dlist = 0;
+                       }
+                       XFreeFont(MI_DISPLAY(mi),font_struct);
+                       /* font_struct should be freed now */
+                       font_struct = (XFontStruct *) NULL;
+               }
+               /* else oops ? */
+       }
+}
+
+/* clear away any lingering error codes */
+void
+clear_gl_error (void)
+{
+  while (glGetError() != GL_NO_ERROR);
+}
+
+/* report a GL error. */
+void
+check_gl_error (const char *type)
+{
+  char buf[100];
+  GLenum i;
+  const char *e;
+  switch ((i = glGetError())) {
+  case GL_NO_ERROR: return;
+  case GL_INVALID_ENUM:          e = "invalid enum";      break;
+  case GL_INVALID_VALUE:         e = "invalid value";     break;
+  case GL_INVALID_OPERATION:     e = "invalid operation"; break;
+  case GL_STACK_OVERFLOW:        e = "stack overflow";    break;
+  case GL_STACK_UNDERFLOW:       e = "stack underflow";   break;
+  case GL_OUT_OF_MEMORY:         e = "out of memory";     break;
+#ifdef GL_TABLE_TOO_LARGE_EXT
+  case GL_TABLE_TOO_LARGE_EXT:   e = "table too large";   break;
+#endif
+#ifdef GL_TEXTURE_TOO_LARGE_EXT
+  case GL_TEXTURE_TOO_LARGE_EXT: e = "texture too large"; break;
+#endif
+  default:
+    e = buf; sprintf (buf, "unknown error %d", (int) i); break;
+  }
+  fprintf (stderr, "XLock: %s error: %s\n", type, e);
+  exit (1);
+}
+
+
+/* Frames-per-second statistics */
+
+static int fps_text_x = 10;
+static int fps_text_y = 10;
+static int fps_sample_frames = 10;
+
+static void
+fps_init (ModeInfo *mi)
+{
+  const char *font = fpsfontname;
+  XFontStruct *f;
+  Font id;
+  int first, last;
+
+  if (!font) font = "-*-courier-bold-r-normal-*-180-*";
+  f = XLoadQueryFont(MI_DISPLAY(mi), font);
+  if (!f) f = XLoadQueryFont(MI_DISPLAY(mi), "fixed");
+
+  font_struct = f; /* save font struct info */
+  id = f->fid;
+  first = f->min_char_or_byte2;
+  last = f->max_char_or_byte2;
+  
+  clear_gl_error ();
+  font_dlist = glGenLists ((GLuint) last+1);
+  check_gl_error ("glGenLists");
+
+  if (fpsTop) /* Draw string on top of screen */
+    fps_text_y = - (f->ascent + 10);
+
+  glXUseXFont(id, first, last-first+1, font_dlist + first);
+  check_gl_error ("glXUseXFont");
+}
+
+static void
+fps_print_string (ModeInfo *mi, GLfloat x, GLfloat y, const char *string)
+{
+  int i;
+  /* save the current state */
+  /* note: could be expensive! */
+
+  if (y < 0)
+    y = MI_HEIGHT(mi) + y;
+
+  clear_gl_error ();
+  glPushAttrib(GL_ALL_ATTRIB_BITS);
+  {
+    check_gl_error ("glPushAttrib");
+
+    /* disable lighting and texturing when drawing bitmaps!
+       (glPopAttrib() restores these, I believe.)
+     */
+    glDisable(GL_TEXTURE_2D);
+    glDisable(GL_LIGHTING);
+    glDisable(GL_BLEND);
+
+    /* glPopAttrib() does not restore matrix changes, so we must
+       push/pop the matrix stacks to be non-intrusive there.
+     */
+    glMatrixMode(GL_PROJECTION);
+    glPushMatrix();
+    {
+      check_gl_error ("glPushMatrix");
+      glLoadIdentity();
+
+      /* Each matrix mode has its own stack, so we need to push/pop
+         them separately. */
+      glMatrixMode(GL_MODELVIEW);
+      glPushMatrix();
+      {
+        check_gl_error ("glPushMatrix");
+        glLoadIdentity();
+
+        gluOrtho2D(0.0, (GLfloat) MI_WIDTH(mi), 0.0, (GLfloat) MI_HEIGHT(mi));
+        check_gl_error ("gluOrtho2D");
+
+        /* draw the text */
+        glColor3f (1.0, 0.0, 0.0);
+        glRasterPos2f (x, y);
+        for (i = 0; i < (int) strlen(string); i++)
+          glCallList (font_dlist + (int)string[i]);
+
+        check_gl_error ("fps_print_string");
+      }
+      glPopMatrix();
+    }
+    glMatrixMode(GL_PROJECTION);
+    glPopMatrix();
+
+  }
+  /* clean up after our state changes */
+  glPopAttrib();
+  check_gl_error ("glPopAttrib");
+}
+
+
+void
+do_fps (ModeInfo *mi)
+{
+  /* every N frames, get the time and use it to get the frames per second */
+  static int frame_counter = -1;
+  static double oldtime = 0; /* time in usecs, as a double */
+  static double newtime = 0;
+
+  static char msg [1024] = { 0, };
+
+  if (MI_IS_ICONIC(mi))
+  {
+       /* don't do it in iconic state */
+       frame_counter = fps_sample_frames;
+       return;
+  }
+  if (frame_counter == -1)
+    {
+      fps_init (mi);
+      frame_counter = fps_sample_frames;
+    }
+
+  if (frame_counter++ == fps_sample_frames)
+    {
+      double fps;
+      struct timeval now;
+# ifdef GETTIMEOFDAY_TWO_ARGS
+#ifdef VMS
+       gettimeofday(&now, NULL);
+#else
+       struct timezone tzp;
+       gettimeofday(&now, &tzp);
+#endif
+# else
+      gettimeofday(&now);
+# endif
+
+      oldtime = newtime;
+      newtime = now.tv_sec + ((double) now.tv_usec * 0.000001);
+
+      fps = fps_sample_frames / (newtime - oldtime);
+
+      if (fps < 0.0001)
+        {
+          strcpy(msg, "FPS: (accumulating...)");
+        }
+      else
+        {
+          sprintf(msg, "FPS: %.02f", fps);
+
+          if (MI_DELAY(mi) != 0 && !fpsTop)
+            { /* Include delay information in FPS display only if not on top */
+              char buf[40];
+              sprintf(buf, "%f", MI_DELAY(mi) / 1000000.0); /* FTSO C */
+              while(*buf && buf[strlen(buf)-1] == '0')
+                buf[strlen(buf)-1] = 0;
+              if (buf[strlen(buf)-1] == '.')
+                buf[strlen(buf)-1] = 0;
+              sprintf(msg + strlen(msg), " (including %s sec/frame delay)",
+                      buf);
+            }
+        }
+
+      frame_counter = 0;
+    }
+
+  fps_print_string (mi, (float) fps_text_x, (float) fps_text_y, msg);
+}
+#endif
diff --git a/xlock/visgl.h b/xlock/visgl.h
new file mode 100644 (file)
index 0000000..12d0d46
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef __XLOCK_VISGL_H__
+#define __XLOCK_VISGL_H__
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)visgl.h    5.01 01/02/19 xlockmore" */
+
+#endif
+
+/*-
+ * GL Visual stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 19-02-01: Started log. :)
+ */
+
+#ifdef USE_GL
+#include <GL/gl.h>
+#include <GL/glx.h>
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern GLXContext *init_GL(ModeInfo * mi);
+extern void FreeAllGL(ModeInfo * mi);
+extern void do_fps (ModeInfo *mi);
+extern void clear_gl_error (void);
+extern void check_gl_error (const char *type);
+
+extern XVisualInfo *
+getGLVisual(Display * display, int screen, XVisualInfo * wantVis, int monochrome);
+
+#ifdef __cplusplus
+  }
+#endif
+
+#endif
+
+#ifdef OPENGL_MESA_INCLUDES
+/* Allow OPEN GL using MESA includes */
+#undef MESA
+#endif
+
+#endif /* __XLOCK_VISGL_H__ */
diff --git a/xlock/vms_amd.c b/xlock/vms_amd.c
new file mode 100644 (file)
index 0000000..95617da
--- /dev/null
@@ -0,0 +1,727 @@
+/*-
+ * Sound file for vms
+ * Jouk Jansen <joukj@alpha.chem.uva.nl> contributed this
+ * which he found at http://axp616.gsi.de:8080/www/vms/mzsw.html
+ */
+
+/** amd.c **/
+
+#include <iodef.h>             /* needed for IO$_ functions */
+#include <ssdef.h>             /* system condition codes */
+#include <descrip.h>           /* VMS Descriptor functions */
+#include <string.h>
+#include <starlet.h>
+
+#include "vms_amd.h"           /* AMD access functions */
+
+struct dsc$descriptor_s devname;       /* device we are using */
+static short int so_chan;      /* Channel to SODRIVER */
+char        ReadBuffer[512];   /* Asynchronous read buffer */
+unsigned short ReadIOsb[4] =
+{0, 0, 0, 0};
+int         ReadPending = 0;
+int         ReadCompleted = 0;
+
+/*-
+ *     Initialize access to the AMD chip
+ */
+unsigned long int
+AmdInitialize(char *device, int volume)
+{
+       unsigned long int status;
+       unsigned long int iosb[2] =
+       {0, 0};
+       int         p1;
+
+#ifdef DEBUG
+       (void) printf("Address of AMD Read buffer is 0x%x\n", &ReadBuffer);
+#endif
+       /*
+        *    Create the descriptor
+        */
+       devname.dsc$w_length = strlen(device);
+       devname.dsc$a_pointer = device;
+       devname.dsc$b_dtype = DSC$K_DTYPE_T;
+       devname.dsc$b_class = DSC$K_CLASS_S;
+       /*
+        *    Assign a channel to the device
+        */
+       status = sys$assign(&devname, &so_chan, 0, 0, 0);
+       if (!(status & 1))
+               return (status);
+       /*
+        *    Clear MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Clear MMR2
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR2,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set Volume to initial 30%
+        */
+       p1 = 0x2ABD;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GER,      /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set MMR1 to 8
+        */
+       p1 = 8;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set GR
+        */
+       p1 = 0x92FB;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GR,       /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set MMR1 to 12 (0x0C)
+        */
+       p1 = 12;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR2
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR2,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Put it back MMR2
+        */
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR2,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set GX to 0x0112
+        */
+       p1 = 0x0112;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GX,       /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set MMR1 to 14 (0x0E)
+        */
+       p1 = 14;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set GER (Volume to what the user wants)
+        */
+       p1 = VolumeTable[volume - 1].ger_value;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GER,      /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set GR (Volume to what the user wants)
+        */
+       p1 = VolumeTable[volume - 1].gr_value;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GR,       /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Return Success
+        */
+       return (SS$_NORMAL);
+}
+
+/*-
+ *     Return the channel number associated with the device
+ */
+unsigned short
+AmdGetChannel(void)
+{
+       return (so_chan);
+}
+
+/*-
+ *     Increase or Decrease the Volume
+ */
+AmdSetVolume(int volume)
+{
+       unsigned long int status;
+       unsigned short iosb[4] =
+       {0, 0, 0, 0};
+       int         p1;
+
+       /*
+        *    Set GER (Volume to what the user wants)
+        */
+       p1 = VolumeTable[volume - 1].ger_value;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GER,      /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set GR (Volume to what the user wants)
+        */
+       p1 = VolumeTable[volume - 1].gr_value;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GR,       /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Get MMR1
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR1,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Return Success
+        */
+       return (SS$_NORMAL);
+}
+
+/*-
+ *     Start recording sound
+ */
+unsigned long int
+AmdInitRecord()
+{
+       unsigned long int status;
+       unsigned long int iosb[2] =
+       {0, 0};
+       int         p1, p2, p3, p4, p5, p6;
+
+       /*
+        *    Set recording level to 100%
+        */
+       p1 = 0x0E;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* I/O status */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer Length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_GX,       /* AMD Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Start recording
+        */
+       p3 = 2;
+       p4 = 0x07D0;
+       p5 = 0x14;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACCESS,   /* function code */
+                         iosb, /* I/O Status */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         0,    /* P1 */
+                         0,    /* P2 */
+                         p3,   /* Single freq tone */
+                         p4,   /* frequency */
+                         p5,   /* amplitude */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Retrieve the value of MMR2
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_GETREG,   /* IOCTL code (P3) */
+                         MAP_MMR2,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Set MMR2 to 0
+        */
+       p1 = 0;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR2,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Issue a stop
+        */
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* I/O status */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         0,    /* P1 */
+                         0,    /* P2 */
+                         AMD_STOP,     /* IOCTL function code */
+                         0,    /* P4 */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Issue a read start to begin reading data
+        */
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* I/O status */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         0,    /* P1 */
+                         0,    /* P2 */
+                         AMD_READSTART,        /* IOCTL function code */
+                         0,    /* P4 */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+       /*
+        *    Return success
+        */
+       return (SS$_NORMAL);
+}
+
+/*-
+ *     Select the Internal or External Speaker
+ */
+unsigned long int
+AmdSelect(int s)
+{
+       unsigned long int status;
+       unsigned long int iosb[2];
+       int         p1;
+
+       /*
+        *    Set the MMR2 register to indicate speaker
+        */
+       p1 = s;
+       status = sys$qiow(0,    /* efn */
+                         so_chan,      /* channel */
+                         IO$_ACPCONTROL,       /* function */
+                         iosb, /* iosb */
+                         0,    /* ast routine */
+                         0,    /* ast param */
+                         &p1,  /* Buffer (P1) */
+                         sizeof (p1),  /* Buffer length (P2) */
+                         AMD_SETREG,   /* IOCTL code (P3) */
+                         MAP_MMR2,     /* AMD INDIRECT Register (P4) */
+                         0,    /* P5 */
+                         0);   /* P6 */
+
+       if (!(status & 1))
+               return (status);
+       if (!(iosb[0] & 1))
+               return (iosb[0]);
+
+}
+
+/*-
+ *  Write a buffer of sound data to the device
+ */
+unsigned long int
+AmdWrite(char *buffer, int len)
+{
+       unsigned long int status;
+       unsigned long iosb[2] =
+       {0, 0};
+
+       /*
+        *    Write the data to the device
+        */
+       status = sys$qiow(0,
+                         so_chan,
+                         IO$_WRITEVBLK,
+                         iosb,
+                         0,
+                         0,
+                         buffer, len, 0, 0, 0, 0);
+
+       if (!(status & 1))
+               return (status);
+       /*
+        *    Return success
+        */
+       return (SS$_NORMAL);
+}
diff --git a/xlock/vms_amd.h b/xlock/vms_amd.h
new file mode 100644 (file)
index 0000000..7634c29
--- /dev/null
@@ -0,0 +1,399 @@
+#ifndef AMD_H
+#define AMD_H 1
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)vms_amd.h  4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * VMS sound stuff
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 199?: Jouk Jansen <joukj@alpha.chem.uva.nl> contributed this
+ *       which he found at http://axp616.gsi.de:8080/www/vms/mzsw.html
+ */
+
+/** amd.h **/
+
+/*-
+ *    AMD access for the SODRIVER
+ */
+
+/*-
+ *    Define the SO Indirect Registers
+ */
+#define MAP_X          0x01
+#define MAP_R          0x02
+#define MAP_GX         0x03
+#define MAP_GR         0x04
+#define MAP_GER                0x05
+#define MAP_SGCR       0x06
+#define MAP_FTGR       0x07
+#define MAP_ATGR       0x08
+#define MAP_MMR1       0x09
+#define MAP_MMR2       0x0A
+#define MAP_PERFORM    0x0B
+#define MUX_MCR1       0x0C
+#define MUX_MCR2       0x0D
+#define MUX_MCR3       0x0E
+#define MUX_MCR4       0x0F
+#define MUX_PERFORM    0x10
+#define INIT_INIT      0x11
+
+/*-
+ *    Define SO ACPCONTROL (IOCTL) Subfunctions
+ */
+#define AMD_SETQSIZE   1
+#define AMD_GETQSIZE   2
+#define AMD_GETREG     3
+#define AMD_SETREG     4
+#define AMD_READSTART  5
+#define AMD_STOP       6
+#define AMD_PAUSE      7
+#define AMD_RESUME     8
+#define AMD_READQ      9
+#define AMD_WRITEQ     10
+#define AMD_DEBUG      11
+
+/*-
+ *     *** HACK ***
+ *
+ *     GER and GR values for Volume Control for the SODRIVER.  These values
+ *     where determine via FTS (available from PUBLIC.TGV.COM) which allowed
+ *     me to see the $QIO[W] calls made to the SODRIVER.  How DECsound
+ *     actually calculates them is beyond me.  This table is index by percentage.
+ *     For Example, if you want the volume at 45% then you use the following
+ *     values: VolumeTable[44].ger_value and VolumeTable[44].gr_value.
+ *
+ *     *** HACK ***
+ */
+
+static struct vtable {
+       unsigned short ger_value;
+       unsigned short gr_value;
+} VolumeTable[] = {
+
+/* GER            GR    */
+       {
+               0XAAAA, 0X91F9
+       },                      /* 001 % */
+       {
+               0XAAAA, 0X91F9
+       },                      /* 002 % */
+       {
+               0X9BBB, 0X91F9
+       },                      /* 003 % */
+       {
+               0X9BBB, 0X91F9
+       },                      /* 004 % */
+       {
+               0X79AC, 0X91F9
+       },                      /* 005 % */
+       {
+               0X79AC, 0X91C5
+       },                      /* 006 % */
+       {
+               0X099A, 0X91C5
+       },                      /* 007 % */
+       {
+               0X099A, 0X91C5
+       },                      /* 008 % */
+       {
+               0X4199, 0X91C5
+       },                      /* 009 % */
+       {
+               0X3199, 0X91B6
+       },                      /* 010 % */
+       {
+               0X3199, 0X91B6
+       },                      /* 011 % */
+       {
+               0X9CDE, 0X91B6
+       },                      /* 012 % */
+       {
+               0X9CDE, 0X91B6
+       },                      /* 013 % */
+       {
+               0X9DEF, 0X9212
+       },                      /* 014 % */
+       {
+               0X9DEF, 0X9212
+       },                      /* 015 % */
+       {
+               0X749C, 0X9212
+       },                      /* 016 % */
+       {
+               0X749C, 0X9212
+       },                      /* 017 % */
+       {
+               0X549D, 0X91A4
+       },                      /* 018 % */
+       {
+               0X6AAE, 0X91A4
+       },                      /* 019 % */
+       {
+               0X6AAE, 0X91A4
+       },                      /* 020 % */
+       {
+               0XABCD, 0X91A4
+       },                      /* 021 % */
+       {
+               0XABCD, 0X9222
+       },                      /* 022 % */
+       {
+               0XABDF, 0X9222
+       },                      /* 023 % */
+       {
+               0XABDF, 0X9222
+       },                      /* 024 % */
+       {
+               0X7429, 0X9222
+       },                      /* 025 % */
+       {
+               0X64AB, 0X9232
+       },                      /* 026 % */
+       {
+               0X64AB, 0X9232
+       },                      /* 027 % */
+       {
+               0X6AFF, 0X9232
+       },                      /* 028 % */
+       {
+               0X6AFF, 0X9232
+       },                      /* 029 % */
+       {
+               0X2ABD, 0X9232
+       },                      /* 030 % */
+       {
+               0X2ABD, 0X92FB
+       },                      /* 031 % */
+       {
+               0XBEEF, 0X92FB
+       },                      /* 032 % */
+       {
+               0XBEEF, 0X92FB
+       },                      /* 033 % */
+       {
+               0X5CCE, 0X92FB
+       },                      /* 034 % */
+       {
+               0X75CD, 0X92AA
+       },                      /* 035 % */
+       {
+               0X75CD, 0X92AA
+       },                      /* 036 % */
+       {
+               0X0099, 0X92AA
+       },                      /* 037 % */
+       {
+               0X0099, 0X92AA
+       },                      /* 038 % */
+       {
+               0X554C, 0X9327
+       },                      /* 039 % */
+       {
+               0X554C, 0X9327
+       },                      /* 040 % */
+       {
+               0X43DD, 0X9327
+       },                      /* 041 % */
+       {
+               0X43DD, 0X9327
+       },                      /* 042 % */
+       {
+               0X33DD, 0X93B3
+       },                      /* 043 % */
+       {
+               0X52EF, 0X93B3
+       },                      /* 044 % */
+       {
+               0X52EF, 0X93B3
+       },                      /* 045 % */
+       {
+               0X771B, 0X93B3
+       },                      /* 046 % */
+       {
+               0X771B, 0X94B3
+       },                      /* 047 % */
+       {
+               0X5542, 0X94B3
+       },                      /* 048 % */
+       {
+               0X5542, 0X94B3
+       },                      /* 049 % */
+       {
+               0X41DD, 0X94B3
+       },                      /* 050 % */
+       {
+               0X31DD, 0X9F91
+       },                      /* 051 % */
+       {
+               0X31DD, 0X9F91
+       },                      /* 052 % */
+       {
+               0X441F, 0X9F91
+       },                      /* 053 % */
+       {
+               0X431F, 0X9F91
+       },                      /* 054 % */
+       {
+               0X431F, 0X9CEA
+       },                      /* 055 % */
+       {
+               0X331F, 0X9CEA
+       },                      /* 056 % */
+       {
+               0X331F, 0X9CEA
+       },                      /* 057 % */
+       {
+               0X40DD, 0X9CEA
+       },                      /* 058 % */
+       {
+               0X1100, 0X9BF9
+       },                      /* 059 % */
+       {
+               0X1100, 0X9BF9
+       },                      /* 060 % */
+       {
+               0X440F, 0X9BF9
+       },                      /* 061 % */
+       {
+               0X440F, 0X9BF9
+       },                      /* 062 % */
+       {
+               0X411F, 0X9AAC
+       },                      /* 063 % */
+       {
+               0X411F, 0X9AAC
+       },                      /* 064 % */
+       {
+               0X311F, 0X9AAC
+       },                      /* 065 % */
+       {
+               0X311F, 0X9AAC
+       },                      /* 066 % */
+       {
+               0X5520, 0X9A4A
+       },                      /* 067 % */
+       {
+               0X10DD, 0X9A4A
+       },                      /* 068 % */
+       {
+               0X10DD, 0X9A4A
+       },                      /* 069 % */
+       {
+               0X4211, 0X9A4A
+       },                      /* 070 % */
+       {
+               0X4211, 0XA222
+       },                      /* 071 % */
+       {
+               0X410F, 0XA222
+       },                      /* 072 % */
+       {
+               0X410F, 0XA222
+       },                      /* 073 % */
+       {
+               0X111F, 0XA222
+       },                      /* 074 % */
+       {
+               0X600B, 0XA2A2
+       },                      /* 075 % */
+       {
+               0X600B, 0XA2A2
+       },                      /* 076 % */
+       {
+               0X00DD, 0XA2A2
+       },                      /* 077 % */
+       {
+               0X00DD, 0XA2A2
+       },                      /* 078 % */
+       {
+               0X4210, 0XA2A2
+       },                      /* 079 % */
+       {
+               0X4210, 0XA68D
+       },                      /* 080 % */
+       {
+               0X400F, 0XA68D
+       },                      /* 081 % */
+       {
+               0X400F, 0XA68D
+       },                      /* 082 % */
+       {
+               0X110F, 0XA68D
+       },                      /* 083 % */
+       {
+               0X2210, 0XAAA3
+       },                      /* 084 % */
+       {
+               0X2210, 0XAAA3
+       },                      /* 085 % */
+       {
+               0X7200, 0XAAA3
+       },                      /* 086 % */
+       {
+               0X7200, 0XAAA3
+       },                      /* 087 % */
+       {
+               0X4200, 0XB242
+       },                      /* 088 % */
+       {
+               0X4200, 0XB242
+       },                      /* 089 % */
+       {
+               0X2110, 0XB242
+       },                      /* 090 % */
+       {
+               0X2110, 0XB242
+       },                      /* 091 % */
+       {
+               0X100F, 0XBB52
+       },                      /* 092 % */
+       {
+               0X2200, 0XBB52
+       },                      /* 093 % */
+       {
+               0X2200, 0XBB52
+       },                      /* 094 % */
+       {
+               0X1110, 0XBB52
+       },                      /* 095 % */
+       {
+               0X1110, 0XCB52
+       },                      /* 096 % */
+       {
+               0X000B, 0XCBB2
+       },                      /* 097 % */
+       {
+               0X000B, 0XCBB2
+       },                      /* 098 % */
+       {
+               0X2100, 0XCBB2
+       },                      /* 099 % */
+       {
+               0X000F, 0X0808
+       }                       /* 100 % */
+};
+
+#define volume_table_size ((unsigned)sizeof(VolumeTable)/(unsigned)sizeof(VolumeTable[0]))
+
+/*-
+ *     Constants for Speaker selection
+ */
+#define        SO_EXTERNAL     0
+#define SO_INTERNAL    2
+
+/*-
+ *     How many bytes of sound / second
+ */
+#define SO_BYTES_PER_SECOND    (1024*8)
+
+extern unsigned long int AmdInitialize(char *device, int volume);
+extern unsigned long int AmdSelect(int s);
+extern unsigned long int AmdWrite(char *buffer, int len);
+
+#endif /* !AMD_H */
diff --git a/xlock/vms_mmov.c b/xlock/vms_mmov.c
new file mode 100644 (file)
index 0000000..dcee0ca
--- /dev/null
@@ -0,0 +1,256 @@
+#include <stdio.h>
+#include <signal.h>
+#include <mme/mme_api.h>
+#include "mmc_buffers.h"
+#include "mmc_cmdlin.h"
+#include "mmc_memory.h"
+#include "mmc_wave_format.h"
+#include "mmc_wave_file.h"
+#include "mmc_wave.h"
+
+#define BUFFER_PAD 4
+
+#define DEFAULT_NCHANNELS              1
+#define DEFAULT_ENCODING       WAVE_FORMAT_MULAW
+#define DEFAULT_SAMPLESIZE             8
+#define DEFAULT_SAMPLERATE     8000
+
+#define DIV_ROUND_UP_(n,d) ((n + d - 1) / d)
+#define ROUND_UP_(n,d) (DIV_ROUND_UP_(n,d) * d)
+
+enum mmov_state 
+{
+  MMOV_START,
+  MMOV_PLAY,
+  MMOV_WAITING,
+  MMOV_CLOSE
+};
+
+#define NUM_DATA 32
+struct mmov_soundformat
+{
+   WAVEFORMATEX wave;
+   char extra_data[ NUM_DATA ];
+};
+
+static int Verbose;
+static mmcWaveFileState_t wavefilestatus = mmcWaveFileStateInitialValue;
+static mmcBufferList_t mmov_buffer = mmcBufferListInitialValue;
+static enum mmov_state play_state;
+
+static void mmov_cleanup( )
+{
+   if (mmov_buffer.b) 
+     {
+       mmcBuffersFree (&mmov_buffer);
+     }
+   mmcFreeAll ();
+    {
+       mmcWaveInFileClose (&wavefilestatus);
+    }
+    return;
+}
+
+static void mmov_driver (HANDLE hWaveOut,
+                            UINT wMsg,
+                            DWORD dwInstance,
+                            LPARAM lParam1,
+                            LPARAM lParam2)
+{
+    switch (wMsg)
+    {
+      case WOM_OPEN:
+       play_state = MMOV_PLAY;
+       break;
+      case WOM_CLOSE:
+       play_state = MMOV_CLOSE;
+       break;
+       
+      case WOM_DONE:
+      {
+         int buffer_index = mmcWaveOutGotData (&mmov_buffer, lParam1);
+         mmcBuffer_p bp = &mmov_buffer.b[buffer_index];
+         mmcBufferSetStatus (&mmov_buffer, buffer_index, Empty,
+                             mmov_buffer.nbytes);
+      }
+       break;
+      default:
+       mmcVerboseDisplay(Verbose, "Unknown index %d", wMsg);
+       break;
+    }
+}
+
+void play_sound_mmov( char* FileName , int verbose )
+{
+    HWAVEOUT hwaveout;
+    MMRESULT status;
+    int mask1;
+    int allDone;
+
+    static int uDeviceId = WAVE_MAPPER;
+    static int AdpcmBitsPerSample = 16; 
+    static int AdpcmSamplesPerBlock = 0;
+    static int sizeBuffers = 0;
+    static int msBuffers = 0;
+    static int numBuffers = 4;
+    static struct mmov_soundformat sound_format =
+    {
+       {
+           DEFAULT_ENCODING,
+           DEFAULT_NCHANNELS,
+           DEFAULT_SAMPLERATE,
+           0,
+           0,
+           DEFAULT_SAMPLESIZE,
+           NUM_DATA
+       }, {
+           0, 0, 0, 0, 0, 0, 0, 0,
+           0, 0, 0, 0, 0, 0, 0, 0,
+           0, 0, 0, 0, 0, 0, 0, 0,
+           0, 0, 0, 0, 0, 0, 0, 0
+       }
+    };
+
+   Verbose = verbose;
+   play_state = MMOV_START;
+   
+    /* Open the Wave In file */
+    if (mmcWaveInFileOpen (FileName, &sound_format.wave, &wavefilestatus) != 0) 
+    {
+       mmcVerboseDisplay(Verbose,"Error opening input file");
+       mmov_cleanup();
+       return;
+    }
+
+    if ( sound_format.wave.wFormatTag == WAVE_FORMAT_PCM)
+      mmcVerboseDisplay(Verbose,"PCM file");
+    else if ( sound_format.wave.wFormatTag == WAVE_FORMAT_MULAW)
+      mmcVerboseDisplay(Verbose,"mu-law file");
+    else if ( sound_format.wave.wFormatTag == WAVE_FORMAT_IMA_ADPCM)
+      mmcVerboseDisplay(Verbose,"IMA file");
+    else
+      mmcVerboseDisplay(Verbose,"Unknown sound format %d", 
+                               sound_format.wave.wFormatTag);
+    mmcVerboseDisplay(Verbose,"Channels = %d ",  sound_format.wave.nChannels );
+    mmcVerboseDisplay(Verbose,"Sample rate = %d", 
+                     sound_format.wave.nSamplesPerSec);
+    mmcVerboseDisplay(Verbose,
+                     "Sample size = %d", sound_format.wave.wBitsPerSample );
+    
+    if( sound_format.wave.nChannels == 0)
+      sound_format.wave.nChannels = DEFAULT_NCHANNELS;
+    if( sound_format.wave.nSamplesPerSec == 0)
+      sound_format.wave.nSamplesPerSec = DEFAULT_SAMPLERATE;
+    if( sound_format.wave.wBitsPerSample == 0)
+      sound_format.wave.wBitsPerSample = DEFAULT_SAMPLESIZE;
+    
+    if ( sound_format.wave.wFormatTag == WAVE_FORMAT_IMA_ADPCM ) {
+      AdpcmSamplesPerBlock = *(Uint16 *)(&sound_format.extra_data[0]);
+    }
+
+    if ( ( sound_format.wave.wFormatTag == WAVE_FORMAT_PCM) ||
+       ( sound_format.wave.wFormatTag == WAVE_FORMAT_MULAW) ) {
+      mask1 = WAVE_FORMAT_FIX_BLOCK_ALIGN | WAVE_FORMAT_FIX_AVG_BPS;
+      mmcWaveFormatFix((LPPCMWAVEFORMAT)(&sound_format), mask1 );
+    }
+
+    if ( sound_format.wave.wFormatTag == WAVE_FORMAT_IMA_ADPCM) {
+      sizeBuffers = sound_format.wave.nBlockAlign;
+      msBuffers = sizeBuffers * 1000 /
+         (DIV_ROUND_UP_(AdpcmBitsPerSample,8) * 
+          sound_format.wave.nSamplesPerSec * 
+          sound_format.wave.nChannels);
+
+
+    } else {
+      if (!msBuffers && !sizeBuffers)
+       msBuffers = 1000/numBuffers;
+
+      if (msBuffers)
+       sizeBuffers = 
+         ROUND_UP_(DIV_ROUND_UP_(msBuffers * 
+                               DIV_ROUND_UP_( sound_format.wave.wBitsPerSample,
+                                             8) * 
+                               sound_format.wave.nSamplesPerSec * 
+                               sound_format.wave.nChannels,1000), BUFFER_PAD);
+      else
+       {
+         sizeBuffers = ROUND_UP_(sizeBuffers, BUFFER_PAD);
+         msBuffers = sizeBuffers * 1000 /
+           (DIV_ROUND_UP_( sound_format.wave.wBitsPerSample,8) * 
+            sound_format.wave.nSamplesPerSec * 
+            sound_format.wave.nChannels);
+       }
+    }
+
+
+    mmcVerboseDisplay(Verbose, "Buffer size = %d bytes or %d milliseconds",
+                     sizeBuffers, msBuffers);
+
+    hwaveout = NULL;
+
+    status = mmcWaveOutOpen(&sound_format.wave, uDeviceId, &mmov_driver ,
+                           WAVE_OPEN_SHAREABLE, &hwaveout);
+
+    if (status != MMSYSERR_NOERROR)
+     {
+       mmov_cleanup();
+       return;
+     }
+
+   if (mmcBuffersCreate (&mmov_buffer, numBuffers, sizeBuffers, BUFFER_PAD)
+       != MMSYSERR_NOERROR)
+     {
+       mmov_cleanup();
+       return;
+     }
+      
+    while (1)
+    {
+       switch ( play_state )
+       {
+         case MMOV_START:
+           break;
+
+         case MMOV_PLAY:
+           status = mmcWaveOutQueueBufferAll (hwaveout, &mmov_buffer, Verbose,
+                                              &wavefilestatus, &allDone);
+           if (allDone) 
+             play_state = MMOV_WAITING;
+           else
+            {
+               if (status != MMSYSERR_NOERROR)
+                 {
+                    mmov_cleanup();
+                    return;
+                 }
+            }
+           break;
+
+         case MMOV_WAITING:
+           if ((mmcBufferFind(&mmov_buffer,Filling) != mmcBufferNone) ||
+               (mmcBufferFind(&mmov_buffer,Full) != mmcBufferNone) ||
+               (mmcBufferFind(&mmov_buffer,Playing) != mmcBufferNone))
+             break;
+           play_state = MMOV_CLOSE;
+           
+         case MMOV_CLOSE:
+          status = mmcWaveOutClose (hwaveout, &mmov_buffer);
+          if (status != MMSYSERR_NOERROR)
+                 {
+                    mmov_cleanup();
+                    return;
+                 }
+           mmov_cleanup();
+          return;
+
+         default:
+           mmcVerboseDisplay(Verbose,"Unknown play_state %d", play_state);
+           mmov_cleanup();
+          return;
+       }
+
+       mmeWaitForCallbacks (); /* block so we don't hog 100% of the CPU */
+       mmeProcessCallbacks ();
+    }
+}
diff --git a/xlock/vms_x_fix.h b/xlock/vms_x_fix.h
new file mode 100644 (file)
index 0000000..0eeb97c
--- /dev/null
@@ -0,0 +1,829 @@
+/***************************************************************************
+ *                                                                         *
+ * Repair definitions of Xlib when compiling with /name=(as_is) on VMS     *
+ *                                                                         *
+ * Author : Jouk Jansen (joukj@hrem.stm.tudelft.nl)                        *
+ *                                                                         *
+ * Last revision : 22 August 2000                                          *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VMS_X_FIX
+#define VMS_X_FIX
+
+#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE 
+#define XAllocClassHint XALLOCCLASSHINT
+#define XAllocColor XALLOCCOLOR
+#define XAllocColorCells XALLOCCOLORCELLS
+#define XAllocSizeHints XALLOCSIZEHINTS
+#define XAllocWMHints XALLOCWMHINTS
+#define XAutoRepeatOff XAUTOREPEATOFF
+#define XAutoRepeatOn XAUTOREPEATON
+#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
+#define XBell XBELL
+#define XBitmapPad XBITMAPPAD
+#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
+#define XChangeGC XCHANGEGC
+#define XChangeProperty XCHANGEPROPERTY
+#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
+#define XCheckIfEvent XCHECKIFEVENT
+#define XCheckMaskEvent XCHECKMASKEVENT
+#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
+#define XCheckWindowEvent XCHECKWINDOWEVENT
+#define XClearArea XCLEARAREA
+#define XClearWindow XCLEARWINDOW
+#define XClipBox XCLIPBOX
+#define XCloseDisplay XCLOSEDISPLAY
+#define XCloseIM XCLOSEIM
+#define XConfigureWindow XCONFIGUREWINDOW
+#define XConvertSelection XCONVERTSELECTION
+#define XCopyArea XCOPYAREA
+#define XCopyGC XCOPYGC
+#define XCopyPlane XCOPYPLANE
+#define XCreateBitmapFromData XCREATEBITMAPFROMDATA
+#define XCreateColormap XCREATECOLORMAP
+#define XCreateFontCursor XCREATEFONTCURSOR
+#define XCreateFontSet XCREATEFONTSET
+#define XCreateGC XCREATEGC
+#define XCreateIC XCREATEIC
+#define XCreateImage XCREATEIMAGE
+#define XCreatePixmap XCREATEPIXMAP
+#define XCreatePixmapCursor XCREATEPIXMAPCURSOR
+#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA
+#define XCreateRegion XCREATEREGION
+#define XCreateSimpleWindow XCREATESIMPLEWINDOW
+#define XCreateWindow XCREATEWINDOW
+#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
+#define XDefineCursor XDEFINECURSOR
+#define XDeleteProperty XDELETEPROPERTY
+#define XDestroyIC XDESTROYIC
+#define XDestroyRegion XDESTROYREGION
+#define XDestroyWindow XDESTROYWINDOW
+#define XDisplayName XDISPLAYNAME
+#define XDisplayOfScreen XDISPLAYOFSCREEN
+#define XDrawArc XDRAWARC
+#define XDrawImageString XDRAWIMAGESTRING
+#define XDrawImageString16 XDRAWIMAGESTRING16
+#define XDrawLine XDRAWLINE
+#define XDrawLines XDRAWLINES
+#define XDrawPoint XDRAWPOINT
+#define XDrawPoints XDRAWPOINTS
+#define XDrawRectangle XDRAWRECTANGLE
+#define XDrawSegments XDRAWSEGMENTS
+#define XDrawString XDRAWSTRING
+#define XDrawString16 XDRAWSTRING16
+#define XEmptyRegion XEMPTYREGION
+#define XEqualRegion XEQUALREGION
+#define XEventsQueued XEVENTSQUEUED
+#define XExtentsOfFontSet XEXTENTSOFFONTSET
+#define XFillArc XFILLARC
+#define XFillPolygon XFILLPOLYGON
+#define XFillRectangle XFILLRECTANGLE
+#define XFillRectangles XFILLRECTANGLES
+#define XFilterEvent XFILTEREVENT
+#define XFlush XFLUSH
+#define XFontsOfFontSet XFONTSOFFONTSET
+#define XFree XFREE
+#define XFreeColormap XFREECOLORMAP
+#define XFreeColors XFREECOLORS
+#define XFreeCursor XFREECURSOR
+#define XFreeFont XFREEFONT
+#define XFreeFontInfo XFREEFONTINFO
+#define XFreeFontNames XFREEFONTNAMES
+#define XFreeFontSet XFREEFONTSET
+#define XFreeGC XFREEGC
+#define XFreeModifiermap XFREEMODIFIERMAP
+#define XFreePixmap XFREEPIXMAP
+#define XFreeStringList XFREESTRINGLIST
+#define XGetAtomName XGETATOMNAME
+#define XGetDefault XGETDEFAULT
+#define XGetErrorDatabaseText XGETERRORDATABASETEXT
+#define XGetErrorText XGETERRORTEXT
+#define XGetFontProperty XGETFONTPROPERTY
+#define XGetGCValues XGETGCVALUES
+#define XGetGeometry XGETGEOMETRY
+#define XGetICValues XGETICVALUES
+#define XGetIMValues XGETIMVALUES
+#define XGetImage XGETIMAGE
+#define XGetKeyboardControl XGETKEYBOARDCONTROL
+#define XGetModifierMapping XGETMODIFIERMAPPING
+#define XGetMotionEvents XGETMOTIONEVENTS
+#define XGetNormalHints XGETNORMALHINTS
+#define XGetSelectionOwner XGETSELECTIONOWNER
+#define XGetSubImage XGETSUBIMAGE
+#define XGetVisualInfo XGETVISUALINFO
+#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
+#define XGetWMHints XGETWMHINTS
+#define XGetWMName XGETWMNAME
+#define XGetWMNormalHints XGETWMNORMALHINTS
+#define XGetWindowAttributes XGETWINDOWATTRIBUTES
+#define XGetWindowProperty XGETWINDOWPROPERTY
+#define XGrabKeyboard XGRABKEYBOARD
+#define XGrabPointer XGRABPOINTER
+#define XGrabServer XGRABSERVER
+#define XHeightOfScreen XHEIGHTOFSCREEN
+#define XIfEvent XIFEVENT
+#define XInternAtom XINTERNATOM
+#define XIntersectRegion XINTERSECTREGION
+#define XKeycodeToKeysym XKEYCODETOKEYSYM
+#define XKeysymToKeycode XKEYSYMTOKEYCODE
+#define XKeysymToString XKEYSYMTOSTRING
+#define XListFonts XLISTFONTS
+#define XListFontsWithInfo XLISTFONTSWITHINFO
+#define XListPixmapFormats XLISTPIXMAPFORMATS
+#define XListProperties XLISTPROPERTIES
+#define XLoadQueryFont XLOADQUERYFONT
+#define XLookupString XLOOKUPSTRING
+#define XLowerWindow XLOWERWINDOW
+#define XMapRaised XMAPRAISED
+#define XMapWindow XMAPWINDOW
+#define XMatchVisualInfo XMATCHVISUALINFO
+#define XMoveResizeWindow XMOVERESIZEWINDOW
+#define XMoveWindow XMOVEWINDOW
+#define XNextEvent XNEXTEVENT
+#define XOffsetRegion XOFFSETREGION
+#define XOpenDisplay XOPENDISPLAY
+#define XOpenIM XOPENIM
+#define XParseColor XPARSECOLOR
+#define XParseGeometry XPARSEGEOMETRY
+#define XPeekEvent XPEEKEVENT
+#define XPending XPENDING
+#define XPointInRegion XPOINTINREGION
+#define XPolygonRegion XPOLYGONREGION
+#define XPutBackEvent XPUTBACKEVENT
+#define XPutImage XPUTIMAGE
+#define XQueryColor XQUERYCOLOR
+#define XQueryColors XQUERYCOLORS
+#define XQueryExtension XQUERYEXTENSION
+#define XQueryPointer XQUERYPOINTER
+#define XQueryTree XQUERYTREE
+#define XRaiseWindow XRAISEWINDOW
+#define XReconfigureWMWindow XRECONFIGUREWMWINDOW
+#define XRectInRegion XRECTINREGION
+#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
+#define XReparentWindow XREPARENTWINDOW
+#define XResizeWindow XRESIZEWINDOW
+#define XRestackWindows XRESTACKWINDOWS
+#define XRootWindowOfScreen XROOTWINDOWOFSCREEN
+#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
+#define XSelectAsyncEvent XSELECTASYNCEVENT
+#define XSelectAsyncInput XSELECTASYNCINPUT
+#define XSelectInput XSELECTINPUT
+#define XSendEvent XSENDEVENT
+#define XServerVendor XSERVERVENDOR
+#define XSetBackground XSETBACKGROUND
+#define XSetClassHint XSETCLASSHINT
+#define XSetClipMask XSETCLIPMASK
+#define XSetClipOrigin XSETCLIPORIGIN
+#define XSetClipRectangles XSETCLIPRECTANGLES
+#define XSetCloseDownMode XSETCLOSEDOWNMODE
+#define XSetCommand XSETCOMMAND
+#define XSetDashes XSETDASHES
+#define XSetErrorHandler XSETERRORHANDLER
+#define XSetFillStyle XSETFILLSTYLE
+#define XSetFont XSETFONT
+#define XSetForeground XSETFOREGROUND
+#define XSetFunction XSETFUNCTION
+#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES
+#define XSetICFocus XSETICFOCUS
+#define XSetICValues XSETICVALUES
+#define XSetIOErrorHandler XSETIOERRORHANDLER
+#define XSetInputFocus XSETINPUTFOCUS
+#define XSetLineAttributes XSETLINEATTRIBUTES
+#define XSetLocaleModifiers XSETLOCALEMODIFIERS
+#define XSetNormalHints XSETNORMALHINTS
+#define XSetRegion XSETREGION
+#define XSetSelectionOwner XSETSELECTIONOWNER
+#define XSetStipple XSETSTIPPLE
+#define XSetSubwindowMode XSETSUBWINDOWMODE
+#define XSetTSOrigin XSETTSORIGIN
+#define XSetTile XSETTILE
+#define XSetTransientForHint XSETTRANSIENTFORHINT
+#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
+#define XSetWMHints XSETWMHINTS
+#define XSetWMIconName XSETWMICONNAME
+#define XSetWMName XSETWMNAME
+#define XSetWMNormalHints XSETWMNORMALHINTS
+#define XSetWMProperties XSETWMPROPERTIES
+#define XSetWMProtocols XSETWMPROTOCOLS
+#define XSetWindowBackground XSETWINDOWBACKGROUND
+#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
+#define XSetWindowColormap XSETWINDOWCOLORMAP
+#define XShapeCombineMask XSHAPECOMBINEMASK
+#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
+#define XShapeGetRectangles XSHAPEGETRECTANGLES
+#define XShrinkRegion XSHRINKREGION
+#define XStoreColor XSTORECOLOR
+#define XStoreColors XSTORECOLORS
+#define XStoreName XSTORENAME
+#define XStringToKeysym XSTRINGTOKEYSYM
+#define XSubtractRegion XSUBTRACTREGION
+#define XSupportsLocale XSUPPORTSLOCALE
+#define XSync XSYNC
+#define XSynchronize XSYNCHRONIZE
+#define XTextExtents XTEXTEXTENTS
+#define XTextExtents16 XTEXTEXTENTS16
+#define XTextWidth XTEXTWIDTH
+#define XTextWidth16 XTEXTWIDTH16
+#define XTranslateCoordinates XTRANSLATECOORDINATES
+#define XUndefineCursor XUNDEFINECURSOR
+#define XUngrabKeyboard XUNGRABKEYBOARD
+#define XUngrabPointer XUNGRABPOINTER
+#define XUngrabServer XUNGRABSERVER
+#define XUnionRectWithRegion XUNIONRECTWITHREGION
+#define XUnionRegion XUNIONREGION
+#define XUnmapWindow XUNMAPWINDOW
+#define _XUnregisterFilter _XUNREGISTERFILTER
+#define XUnsetICFocus XUNSETICFOCUS
+#define XVaCreateNestedList XVACREATENESTEDLIST
+#define XVisualIDFromVisual XVISUALIDFROMVISUAL
+#define XWidthOfScreen XWIDTHOFSCREEN
+#define XWindowEvent XWINDOWEVENT
+#define XWithdrawWindow XWITHDRAWWINDOW
+#define XXorRegion XXORREGION
+#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
+#define XmAddProtocols XMADDPROTOCOLS
+#define XmChangeColor XMCHANGECOLOR
+#define XmClipboardCopy XMCLIPBOARDCOPY
+#define XmClipboardEndCopy XMCLIPBOARDENDCOPY
+#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
+#define XmClipboardLock XMCLIPBOARDLOCK
+#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
+#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
+#define XmClipboardUnlock XMCLIPBOARDUNLOCK
+#define XmCreateArrowButton XMCREATEARROWBUTTON
+#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
+#define XmCreateCascadeButton XMCREATECASCADEBUTTON
+#define XmCreateDialogShell XMCREATEDIALOGSHELL
+#define XmCreateDragIcon XMCREATEDRAGICON
+#define XmCreateDrawingArea XMCREATEDRAWINGAREA
+#define XmCreateDrawnButton XMCREATEDRAWNBUTTON
+#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
+#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
+#define XmCreateForm XMCREATEFORM
+#define XmCreateFormDialog XMCREATEFORMDIALOG
+#define XmCreateFrame XMCREATEFRAME
+#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
+#define XmCreateLabelGadget XMCREATELABELGADGET
+#define XmCreateMainWindow XMCREATEMAINWINDOW
+#define XmCreateMenuBar XMCREATEMENUBAR
+#define XmCreateMessageBox XMCREATEMESSAGEBOX
+#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG
+#define XmCreateOptionMenu XMCREATEOPTIONMENU
+#define XmCreatePanedWindow XMCREATEPANEDWINDOW
+#define XmCreatePopupMenu XMCREATEPOPUPMENU
+#define XmCreatePromptDialog XMCREATEPROMPTDIALOG
+#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU
+#define XmCreatePushButton XMCREATEPUSHBUTTON
+#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET
+#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG
+#define XmCreateRadioBox XMCREATERADIOBOX
+#define XmCreateRowColumn XMCREATEROWCOLUMN
+#define XmCreateScale XMCREATESCALE
+#define XmCreateScrollBar XMCREATESCROLLBAR
+#define XmCreateScrolledList XMCREATESCROLLEDLIST
+#define XmCreateScrolledText XMCREATESCROLLEDTEXT
+#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW
+#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
+#define XmCreateSeparator XMCREATESEPARATOR
+#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
+#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
+#define XmCreateText XMCREATETEXT
+#define XmCreateTextField XMCREATETEXTFIELD
+#define XmCreateToggleButton XMCREATETOGGLEBUTTON
+#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
+#define XmDragStart XMDRAGSTART
+#define XmDropSiteRegister XMDROPSITEREGISTER
+#define XmDropSiteUnregister XMDROPSITEUNREGISTER
+#define XmDropSiteUpdate XMDROPSITEUPDATE
+#define XmDropTransferStart XMDROPTRANSFERSTART
+#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD
+#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH
+#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY
+#define XmFontListCopy XMFONTLISTCOPY
+#define XmFontListCreate XMFONTLISTCREATE
+#define XmFontListEntryCreate XMFONTLISTENTRYCREATE
+#define XmFontListEntryFree XMFONTLISTENTRYFREE
+#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT
+#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG
+#define XmFontListEntryLoad XMFONTLISTENTRYLOAD
+#define XmFontListFree XMFONTLISTFREE
+#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT
+#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT
+#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
+#define XmFontListNextEntry XMFONTLISTNEXTENTRY
+#define XmGetColors XMGETCOLORS
+#define XmGetFocusWidget XMGETFOCUSWIDGET
+#define XmGetMenuCursor XMGETMENUCURSOR
+#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
+#define XmGetTearOffControl XMGETTEAROFFCONTROL
+#define XmGetXmDisplay XMGETXMDISPLAY
+#define XmImMbLookupString XMIMMBLOOKUPSTRING
+#define XmImRegister XMIMREGISTER
+#define XmImSetFocusValues XMIMSETFOCUSVALUES
+#define XmImSetValues XMIMSETVALUES
+#define XmImUnregister XMIMUNREGISTER
+#define XmImUnsetFocus XMIMUNSETFOCUS
+#define XmInternAtom XMINTERNATOM
+#define XmIsMotifWMRunning XMISMOTIFWMRUNNING
+#define XmListAddItem XMLISTADDITEM
+#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
+#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
+#define XmListDeleteAllItems XMLISTDELETEALLITEMS
+#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
+#define XmListDeletePos XMLISTDELETEPOS
+#define XmListDeselectAllItems XMLISTDESELECTALLITEMS
+#define XmListDeselectPos XMLISTDESELECTPOS
+#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
+#define XmListGetMatchPos XMLISTGETMATCHPOS
+#define XmListGetSelectedPos XMLISTGETSELECTEDPOS
+#define XmListPosSelected XMLISTPOSSELECTED
+#define XmListSelectItem XMLISTSELECTITEM
+#define XmListSelectPos XMLISTSELECTPOS
+#define XmListSetBottomPos XMLISTSETBOTTOMPOS
+#define XmListSetItem XMLISTSETITEM
+#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS
+#define XmListSetPos XMLISTSETPOS
+#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS
+#define XmMenuPosition XMMENUPOSITION
+#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD
+#define XmOptionButtonGadget XMOPTIONBUTTONGADGET
+#define XmOptionLabelGadget XMOPTIONLABELGADGET
+#define XmProcessTraversal XMPROCESSTRAVERSAL
+#define XmQmotif XMQMOTIF
+#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
+#define XmRepTypeGetId XMREPTYPEGETID
+#define XmRepTypeGetRecord XMREPTYPEGETRECORD
+#define XmRepTypeRegister XMREPTYPEREGISTER
+#define XmRepTypeValidValue XMREPTYPEVALIDVALUE
+#define XmScrollBarSetValues XMSCROLLBARSETVALUES
+#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
+#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
+#define XmStringByteCompare XMSTRINGBYTECOMPARE
+#define XmStringCompare XMSTRINGCOMPARE
+#define XmStringConcat XMSTRINGCONCAT
+#define XmStringCopy XMSTRINGCOPY
+#define XmStringCreate XMSTRINGCREATE
+#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED
+#define XmStringCreateLtoR XMSTRINGCREATELTOR
+#define XmStringCreateSimple XMSTRINGCREATESIMPLE
+#define XmStringDraw XMSTRINGDRAW
+#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE
+#define XmStringExtent XMSTRINGEXTENT
+#define XmStringFree XMSTRINGFREE
+#define XmStringFreeContext XMSTRINGFREECONTEXT
+#define XmStringGetLtoR XMSTRINGGETLTOR
+#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT
+#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT
+#define XmStringInitContext XMSTRINGINITCONTEXT
+#define XmStringLength XMSTRINGLENGTH
+#define XmStringLtoRCreate XMSTRINGLTORCREATE
+#define XmStringNConcat XMSTRINGNCONCAT
+#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
+#define XmStringWidth XMSTRINGWIDTH
+#define XmTextClearSelection XMTEXTCLEARSELECTION
+#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
+#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
+#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
+#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
+#define XmTextFieldGetString XMTEXTFIELDGETSTRING
+#define XmTextFieldInsert XMTEXTFIELDINSERT
+#define XmTextFieldRemove XMTEXTFIELDREMOVE
+#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
+#define XmTextFieldSetString XMTEXTFIELDSETSTRING
+#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
+#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
+#define XmTextGetLastPosition XMTEXTGETLASTPOSITION
+#define XmTextGetMaxLength XMTEXTGETMAXLENGTH
+#define XmTextGetSelection XMTEXTGETSELECTION
+#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
+#define XmTextGetString XMTEXTGETSTRING
+#define XmTextInsert XMTEXTINSERT
+#define XmTextRemove XMTEXTREMOVE
+#define XmTextReplace XMTEXTREPLACE
+#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
+#define XmTextSetHighlight XMTEXTSETHIGHLIGHT
+#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
+#define XmTextSetSelection XMTEXTSETSELECTION
+#define XmTextSetString XMTEXTSETSTRING
+#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
+#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
+#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
+#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
+#define XmUpdateDisplay XMUPDATEDISPLAY
+#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
+#define XmbDrawString XMBDRAWSTRING
+#define XmbLookupString XMBLOOKUPSTRING
+#define XmbResetIC XMBRESETIC
+#define XmbSetWMProperties XMBSETWMPROPERTIES
+#define XmbTextEscapement XMBTEXTESCAPEMENT
+#define XmbTextExtents XMBTEXTEXTENTS
+#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
+#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
+#define XmuClientWindow XMUCLIENTWINDOW
+#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
+#define XrmGetDatabase XRMGETDATABASE
+#define XrmGetResource XRMGETRESOURCE
+#define XrmPutStringResource XRMPUTSTRINGRESOURCE
+#define XrmQuarkToString XRMQUARKTOSTRING
+#define XrmStringToQuark XRMSTRINGTOQUARK
+#define XtAddCallback XTADDCALLBACK
+#define XtAddCallbacks XTADDCALLBACKS
+#define XtAddEventHandler XTADDEVENTHANDLER
+#define XtAddGrab XTADDGRAB
+#define XtAllocateGC XTALLOCATEGC
+#define XtAppAddActions XTAPPADDACTIONS
+#define XtAppAddInput XTAPPADDINPUT
+#define XtAppAddTimeOut XTAPPADDTIMEOUT
+#define XtAppCreateShell XTAPPCREATESHELL
+#define XtAppInitialize XTAPPINITIALIZE
+#define XtAppNextEvent XTAPPNEXTEVENT
+#define XtAppPeekEvent XTAPPPEEKEVENT
+#define XtAppPending XTAPPPENDING
+#define XtAppProcessEvent XTAPPPROCESSEVENT
+#define XtAppSetErrorHandler XTAPPSETERRORHANDLER
+#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
+#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
+#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
+#define XtAppWarning XTAPPWARNING
+#define XtCallActionProc XTCALLACTIONPROC
+#define XtCallCallbackList XTCALLCALLBACKLIST
+#define XtCallCallbacks XTCALLCALLBACKS
+#define XtConfigureWidget XTCONFIGUREWIDGET
+#define XtConvertAndStore XTCONVERTANDSTORE
+#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
+#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
+#define XtCreatePopupShell XTCREATEPOPUPSHELL
+#define XtCreateWidget XTCREATEWIDGET
+#define XtDatabase XTDATABASE
+#define XtDestroyWidget XTDESTROYWIDGET
+#define XtDisownSelection XTDISOWNSELECTION
+#define XtDispatchEvent XTDISPATCHEVENT
+#define XtDisplayOfObject XTDISPLAYOFOBJECT
+#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
+#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
+#define XtAppAddWorkProc XTAPPADDWORKPROC
+#define XtRemoveWorkProc XTREMOVEWORKPROC
+#define XtFree XTFREE
+#define XtGetActionKeysym XTGETACTIONKEYSYM
+#define XtGetActionList XTGETACTIONLIST
+#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
+#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
+#define XtGetGC XTGETGC
+#define XtGetMultiClickTime XTGETMULTICLICKTIME
+#define XtGetSelectionValue XTGETSELECTIONVALUE
+#define XtGetSelectionValues XTGETSELECTIONVALUES
+#define XtGetSubresources XTGETSUBRESOURCES
+#define XtGetValues XTGETVALUES
+#define XtGrabKeyboard XTGRABKEYBOARD
+#define XtGrabPointer XTGRABPOINTER
+#define XtHasCallbacks XTHASCALLBACKS
+#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
+#define XtInsertEventHandler XTINSERTEVENTHANDLER
+#define XtIsManaged XTISMANAGED
+#define XtIsObject XTISOBJECT
+#define XtIsSensitive XTISSENSITIVE
+#define XtIsSubclass XTISSUBCLASS
+#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
+#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
+#define XtMakeResizeRequest XTMAKERESIZEREQUEST
+#define XtMalloc XTMALLOC
+#define XtManageChild XTMANAGECHILD
+#define XtManageChildren XTMANAGECHILDREN
+#define XtMergeArgLists XTMERGEARGLISTS
+#define XtMoveWidget XTMOVEWIDGET
+#define XtName XTNAME
+#define XtNameToWidget XTNAMETOWIDGET
+#define XtOpenDisplay XTOPENDISPLAY
+#define XtOverrideTranslations XTOVERRIDETRANSLATIONS
+#define XtOwnSelection XTOWNSELECTION
+#define XtParseTranslationTable XTPARSETRANSLATIONTABLE
+#define XtPopdown XTPOPDOWN
+#define XtPopup XTPOPUP
+#define XtQueryGeometry XTQUERYGEOMETRY
+#define XtRealizeWidget XTREALIZEWIDGET
+#define XtRealloc XTREALLOC
+#define XtReleaseGC XTRELEASEGC
+#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
+#define XtRemoveCallback XTREMOVECALLBACK
+#define XtRemoveEventHandler XTREMOVEEVENTHANDLER
+#define XtRemoveGrab XTREMOVEGRAB
+#define XtRemoveInput XTREMOVEINPUT
+#define XtRemoveTimeOut XTREMOVETIMEOUT
+#define XtResizeWidget XTRESIZEWIDGET
+#define XtResolvePathname XTRESOLVEPATHNAME
+#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
+#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
+#define XtSetSensitive XTSETSENSITIVE
+#define XtSetTypeConverter XTSETTYPECONVERTER
+#define XtSetValues XTSETVALUES
+#define XtShellStrings XTSHELLSTRINGS
+#define XtStrings XTSTRINGS
+#define XtToolkitInitialize XTTOOLKITINITIALIZE
+#define XtTranslateCoords XTTRANSLATECOORDS
+#define XtTranslateKeycode XTTRANSLATEKEYCODE
+#define XtUngrabKeyboard XTUNGRABKEYBOARD
+#define XtUngrabPointer XTUNGRABPOINTER
+#define XtUnmanageChild XTUNMANAGECHILD
+#define XtUnmanageChildren XTUNMANAGECHILDREN
+#define XtUnrealizeWidget XTUNREALIZEWIDGET
+#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
+#define XtVaCreateWidget XTVACREATEWIDGET
+#define XtVaGetValues XTVAGETVALUES
+#define XtVaSetValues XTVASETVALUES
+#define XtWarning XTWARNING
+#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
+#define XtWindowOfObject XTWINDOWOFOBJECT
+#define XtWindowToWidget XTWINDOWTOWIDGET
+#define XwcDrawString XWCDRAWSTRING
+#define XwcFreeStringList XWCFREESTRINGLIST
+#define XwcTextEscapement XWCTEXTESCAPEMENT
+#define XwcTextExtents XWCTEXTEXTENTS
+#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
+#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
+#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
+#define _XmClearBorder _XMCLEARBORDER
+#define _XmConfigureObject _XMCONFIGUREOBJECT
+#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK
+#define _XmDrawArrow _XMDRAWARROW
+#define _XmDrawShadows _XMDRAWSHADOWS
+#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT
+#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS
+#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS
+#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR
+#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST
+#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON
+#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA
+#define _XmGrabKeyboard _XMGRABKEYBOARD
+#define _XmGrabPointer _XMGRABPOINTER
+#define _XmInheritClass _XMINHERITCLASS
+#define _XmInputInGadget _XMINPUTINGADGET
+#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
+#define _XmMenuPopDown _XMMENUPOPDOWN
+#define _XmMoveObject _XMMOVEOBJECT
+#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED
+#define _XmOSBuildFileList _XMOSBUILDFILELIST
+#define _XmOSFileCompare _XMOSFILECOMPARE
+#define _XmOSFindPatternPart _XMOSFINDPATTERNPART
+#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC
+#define _XmPostPopupMenu _XMPOSTPOPUPMENU
+#define _XmPrimitiveEnter _XMPRIMITIVEENTER
+#define _XmPrimitiveLeave _XMPRIMITIVELEAVE
+#define _XmRedisplayGadgets _XMREDISPLAYGADGETS
+#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE
+#define _XmStringDraw _XMSTRINGDRAW
+#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT
+#define _XmStrings _XMSTRINGS
+#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS
+#define _XmToVerticalPixels _XMTOVERTICALPIXELS
+#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
+#define _Xm_fastPtr _XM_FASTPTR
+#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
+#define _XtInherit _XTINHERIT
+#define _XtInheritTranslations _XTINHERITTRANSLATIONS
+#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
+#define compositeWidgetClass COMPOSITEWIDGETCLASS
+#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
+#define shellWidgetClass SHELLWIDGETCLASS
+#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
+#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
+#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
+#define vendorShellClassRec VENDORSHELLCLASSREC
+#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
+#define wmShellWidgetClass WMSHELLWIDGETCLASS
+#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
+#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
+#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
+#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
+#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
+#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
+#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
+#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
+#define xmFormWidgetClass XMFORMWIDGETCLASS
+#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
+#define xmGadgetClass XMGADGETCLASS
+#define xmLabelGadgetClass XMLABELGADGETCLASS
+#define xmLabelWidgetClass XMLABELWIDGETCLASS
+#define xmListWidgetClass XMLISTWIDGETCLASS
+#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
+#define xmManagerClassRec XMMANAGERCLASSREC
+#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
+#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
+#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
+#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
+#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
+#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
+#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
+#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
+#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
+#define xmSashWidgetClass XMSASHWIDGETCLASS
+#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
+#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
+#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
+#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
+#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
+#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
+#define xmTextWidgetClass XMTEXTWIDGETCLASS
+#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
+#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
+#define XtRegisterDrawable _XTREGISTERWINDOW
+#define XtUnregisterDrawable _XTUNREGISTERWINDOW
+#define XQueryFont XQUERYFONT
+#define XSetPlaneMask XSETPLANEMASK
+#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
+#define XDestroySubwindows XDESTROYSUBWINDOWS
+#define XFreeDeviceList XFREEDEVICELIST
+#define XFreeDeviceState XFREEDEVICESTATE
+#define XGetExtensionVersion XGETEXTENSIONVERSION
+#define XGetRGBColormaps XGETRGBCOLORMAPS
+#define XIconifyWindow XICONIFYWINDOW
+#define XInstallColormap XINSTALLCOLORMAP
+#define XListInputDevices XLISTINPUTDEVICES
+#define XLookupKeysym XLOOKUPKEYSYM
+#define XOpenDevice XOPENDEVICE
+#define XQueryDeviceState XQUERYDEVICESTATE
+#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
+#define XWarpPointer XWARPPOINTER
+#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
+#define XAllocNamedColor XALLOCNAMEDCOLOR
+#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
+#define XDefaultColormap XDEFAULTCOLORMAP
+#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
+#define XDefaultDepth XDEFAULTDEPTH
+#define XDefaultScreen XDEFAULTSCREEN
+#define XDefaultVisual XDEFAULTVISUAL
+#define XSetIconName XSETICONNAME
+#define XtInitialize XTINITIALIZE
+#define XtMainLoop XTMAINLOOP
+#define DtSaverGetWindows DTSAVERGETWINDOWS
+#define XAddHosts XADDHOSTS
+#define XDisableAccessControl XDISABLEACCESSCONTROL
+#define XEnableAccessControl XENABLEACCESSCONTROL
+#define XFillArcs XFILLARCS
+#define XForceScreenSaver XFORCESCREENSAVER
+#define XGetScreenSaver XGETSCREENSAVER
+#define XListHosts XLISTHOSTS
+#define XReadBitmapFile XREADBITMAPFILE
+#define XRemoveHosts XREMOVEHOSTS
+#define XResetScreenSaver XRESETSCREENSAVER
+#define XResourceManagerString XRESOURCEMANAGERSTRING
+#define XSetScreenSaver XSETSCREENSAVER
+#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
+#define XrmDestroyDatabase XRMDESTROYDATABASE
+#define XrmGetFileDatabase XRMGETFILEDATABASE
+#define XrmGetStringDatabase XRMGETSTRINGDATABASE
+#define XrmInitialize XRMINITIALIZE
+#define XrmMergeDatabases XRMMERGEDATABASES
+#define XrmParseCommand XRMPARSECOMMAND
+#define XrmPutLineResource XRMPUTLINERESOURCE
+#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
+#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
+#define XrmStringToQuark XRMSTRINGTOQUARK
+#define XmCreateLabel XMCREATELABEL
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void XtFree(char*);
+#ifdef __cplusplus
+}
+#endif
+
+#define pthread_attr_create PTHREAD_ATTR_CREATE
+#define pthread_attr_delete PTHREAD_ATTR_DELETE
+#define pthread_attr_destroy PTHREAD_ATTR_DESTROY
+#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP
+#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP
+#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED
+#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO
+#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED
+#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM
+#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE
+#define pthread_attr_init PTHREAD_ATTR_INIT
+#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP
+#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE
+#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP
+#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED
+#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO
+#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED
+#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
+#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY
+#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
+#define pthread_cancel PTHREAD_CANCEL
+#define pthread_cancel_e PTHREAD_CANCEL_E
+#define pthread_cond_broadcast PTHREAD_COND_BROADCAST
+#define pthread_cond_destroy PTHREAD_COND_DESTROY
+#define pthread_cond_init PTHREAD_COND_INIT
+#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP
+#define pthread_cond_signal PTHREAD_COND_SIGNAL
+#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP
+#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT
+#define pthread_cond_wait PTHREAD_COND_WAIT
+#define pthread_condattr_create PTHREAD_CONDATTR_CREATE
+#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE
+#define pthread_condattr_init PTHREAD_CONDATTR_INIT
+#define pthread_create PTHREAD_CREATE
+#define pthread_delay_np PTHREAD_DELAY_NP
+#define pthread_detach PTHREAD_DETACH
+#define pthread_equal PTHREAD_EQUAL
+#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP
+#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP
+#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP
+#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP
+#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP
+#define pthread_exit PTHREAD_EXIT
+#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
+#define pthread_getprio PTHREAD_GETPRIO
+#define pthread_getschedparam PTHREAD_GETSCHEDPARAM
+#define pthread_getscheduler PTHREAD_GETSCHEDULER
+#define pthread_getspecific PTHREAD_GETSPECIFIC
+#define pthread_getunique_np PTHREAD_GETUNIQUE_NP
+#define pthread_join PTHREAD_JOIN
+#define pthread_join32 PTHREAD_JOIN32
+#define pthread_keycreate PTHREAD_KEYCREATE
+#define pthread_key_create PTHREAD_KEY_CREATE
+#define pthread_kill PTHREAD_KILL
+#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP
+#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
+#define pthread_mutex_init PTHREAD_MUTEX_INIT
+#define pthread_mutex_lock PTHREAD_MUTEX_LOCK
+#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK
+#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK
+#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE
+#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE
+#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY
+#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP
+#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT
+#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP
+#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP
+#define pthread_once PTHREAD_ONCE
+#define pthread_resume_np PTHREAD_RESUME_NP
+#define pthread_self PTHREAD_SELF
+#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL
+#define pthread_setcancel PTHREAD_SETCANCEL
+#define pthread_setcancelstate PTHREAD_SETCANCELSTATE
+#define pthread_setprio PTHREAD_SETPRIO
+#define pthread_setschedparam PTHREAD_SETSCHEDPARAM
+#define pthread_setscheduler PTHREAD_SETSCHEDULER
+#define pthread_setspecific PTHREAD_SETSPECIFIC
+#define pthread_suspend_np PTHREAD_SUSPEND_NP
+#define pthread_testcancel PTHREAD_TESTCANCEL
+#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP
+#define pthread_yield PTHREAD_YIELD
+#define pthread_yield_np PTHREAD_YIELD_NP
+#define XDefaultRootWindow XDEFAULTROOTWINDOW
+#define XDisplayCells XDISPLAYCELLS
+#define XMaxRequestSize XMAXREQUESTSIZE
+#define XScreenOfDisplay XSCREENOFDISPLAY
+#define XSetFillRule XSETFILLRULE
+#define XmActivateProtocol XMACTIVATEPROTOCOL
+#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
+#define XmCreateErrorDialog XMCREATEERRORDIALOG
+#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
+#define XmCvtCTToXmString XMCVTCTTOXMSTRING
+#define XmDestroyPixmap XMDESTROYPIXMAP
+#define XmGetPixmap XMGETPIXMAP
+#define XmInstallImage XMINSTALLIMAGE
+#define XmListAddItems XMLISTADDITEMS
+#define XmListDeleteItem XMLISTDELETEITEM
+#define XmListItemExists XMLISTITEMEXISTS
+#define XmListItemPos XMLISTITEMPOS
+#define XmListReplaceItems XMLISTREPLACEITEMS
+#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
+#define XmRemoveProtocols XMREMOVEPROTOCOLS
+#define XmRemoveTabGroup XMREMOVETABGROUP
+#define XmSetColorCalculation XMSETCOLORCALCULATION
+#define XmTextCopy XMTEXTCOPY
+#define XmTextCut XMTEXTCUT
+#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
+#define XmTextFieldCopy XMTEXTFIELDCOPY
+#define XmTextFieldCut XMTEXTFIELDCUT
+#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
+#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
+#define XmTextFieldPaste XMTEXTFIELDPASTE
+#define XmTextFieldReplace XMTEXTFIELDREPLACE
+#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
+#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
+#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
+#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
+#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
+#define XmTextGetEditable XMTEXTGETEDITABLE
+#define XmTextPaste XMTEXTPASTE
+#define XmTextPosToXY XMTEXTPOSTOXY
+#define XmTextSetEditable XMTEXTSETEDITABLE
+#define XmTextShowPosition XMTEXTSHOWPOSITION
+#define XmUninstallImage XMUNINSTALLIMAGE
+#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
+#define XrmPutFileDatabase XRMPUTFILEDATABASE
+#define XtAddConverter XTADDCONVERTER
+#define XtError XTERROR
+#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
+#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
+#define pthread_key_delete PTHREAD_KEY_DELETE
+#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
+#define xmScaleWidgetClass XMSCALEWIDGETCLASS
+#define XtDisplay XTDISPLAY
+#define XtScreen XTSCREEN
+#define XtWindow XTWINDOW
+
+#endif
diff --git a/xlock/vroot.h b/xlock/vroot.h
new file mode 100644 (file)
index 0000000..a186752
--- /dev/null
@@ -0,0 +1,134 @@
+#ifndef _VROOT_H_
+#define _VROOT_H_
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)vroot.h    4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*****************************************************************************/
+/**                   Copyright 1991 by Andreas Stolcke                     **/
+/**               Copyright 1990 by Solbourne Computer Inc.                 **/
+/**                          Longmont, Colorado                             **/
+/**                                                                         **/
+/**                           All Rights Reserved                           **/
+/**                                                                         **/
+/**    Permission to use, copy, modify, and distribute this software and    **/
+/**    its documentation  for  any  purpose  and  without  fee is hereby    **/
+/**    granted, provided that the above copyright notice appear  in  all    **/
+/**    copies and that both  that  copyright  notice  and  this  permis-    **/
+/**    sion  notice appear in supporting  documentation,  and  that  the    **/
+/**    name of Solbourne not be used in advertising                         **/
+/**    in publicity pertaining to distribution of the  software  without    **/
+/**    specific, written prior permission.                                  **/
+/**                                                                         **/
+/**    ANDREAS STOLCKE AND SOLBOURNE COMPUTER INC. DISCLAIMS ALL WARRANTIES **/
+/**    WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF    **/
+/**    MERCHANTABILITY  AND  FITNESS,  IN  NO  EVENT SHALL ANDREAS STOLCKE  **/
+/**    OR SOLBOURNE 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.                                     **/
+/*****************************************************************************/
+/*-
+ * vroot.h -- Virtual Root Window handling header file
+ *
+ * This header file redefines the X11 macros RootWindow and DefaultRootWindow,
+ * making them look for a virtual root window as provided by certain `virtual'
+ * window managers like swm and tvtwm. If none is found, the ordinary root
+ * window is returned, thus retaining backward compatibility with standard
+ * window managers.
+ * The function implementing the virtual root lookup remembers the result of
+ * its last invocation to avoid overhead in the case of repeated calls
+ * on the same display and screen arguments.
+ * The lookup code itself is taken from Tom LaStrange's ssetroot program.
+ *
+ * Most simple root window changing X programs can be converted to using
+ * virtual roots by just including
+ *
+ * #include <X11/vroot.h>
+ *
+ * after all the X11 header files.  It has been tested on such popular
+ * X clients as xphoon, xfroot, xloadimage, and xaqua.
+ * It also works with the core clients xprop, xwininfo, xwd, and editres
+ * (and is necessary to get those clients working under tvtwm).
+ * It does NOT work with xsetroot; get the xsetroot replacement included in
+ * the tvtwm distribution instead.
+ *
+ * Andreas Stolcke <stolcke@ICSI.Berkeley.EDU>, 9/7/90
+ * - replaced all NULL's with properly cast 0's, 5/6/91
+ * - free children list (suggested by Mark Martin <mmm@cetia.fr>), 5/16/91
+ * - include X11/Xlib.h and support RootWindowOfScreen, too 9/17/91
+ */
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+
+#include <X11/X.h>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+
+static      Window
+VirtualRootWindowOfScreen(Screen * s)
+{
+       static Screen *save_screen = (Screen *) 0;
+       static Window root = (Window) 0;
+
+       if (s != save_screen) {
+
+               root = RootWindowOfScreen(s);
+
+               /* go look for a virtual root */
+#if 0
+/*-
+ * I forget why I put this here....
+ * With this it screws up the mouse focus with xscreensaver.
+ */
+               if (inroot)
+#endif
+               {
+                       Display    *dpy = DisplayOfScreen(s);
+                       Atom        __SWM_VROOT;
+                       int         i;
+                       Window      rootReturn, parentReturn, *children;
+                       unsigned int numChildren;
+
+                       __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False);
+                       if (XQueryTree(dpy, root, &rootReturn, &parentReturn,
+                                      &children, &numChildren)) {
+                               for (i = 0; i < (int) numChildren; i++) {
+                                       Atom        actual_type;
+                                       int         actual_format;
+                                       unsigned long nitems, bytesafter;
+                                       Window     *newRoot = (Window *) 0;
+
+                                       if (XGetWindowProperty(dpy, children[i],
+                                        __SWM_VROOT, 0, 1, False, XA_WINDOW,
+                                               &actual_type, &actual_format,
+                                                       &nitems, &bytesafter,
+                                                              (unsigned char **) &newRoot) == Success && newRoot) {
+                                               root = *newRoot;
+                                               break;
+                                       }
+                               }
+                               if (children)
+                                       XFree((caddr_t) children);
+                       }
+               }
+               save_screen = s;
+       }
+       return root;
+}
+
+#undef RootWindowOfScreen
+#define RootWindowOfScreen(s) VirtualRootWindowOfScreen(s)
+
+#undef RootWindow
+#define RootWindow(dpy,s) VirtualRootWindowOfScreen(ScreenOfDisplay(dpy,s))
+
+#undef DefaultRootWindow
+#define DefaultRootWindow(dpy) VirtualRootWindowOfScreen(DefaultScreenOfDisplay(dpy))
+
+#endif /* _VROOT_H_ */
diff --git a/xlock/vtlock.c b/xlock/vtlock.c
new file mode 100644 (file)
index 0000000..fe51010
--- /dev/null
@@ -0,0 +1,176 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)vtlock.c     1.3 2000/01/28 xlockmore";
+
+#endif
+
+/* Copyright (c) E. Lassauge/ R. Cohen-Scali, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The original code for was written by R. Cohen-Scali
+ * (remi.cohenscali@pobox.com) for a command line vtswich control tool
+ * can be found in the etc directory!
+ *
+ * My e-mail address is lassauge@mail.dotcom.fr
+ *
+ * REVISION HISTORY:
+ *       98/10/01: Eric Lassauge - vtlock renamed from lockvt.
+ *                 Merge changes from Remi and David.
+ *       98/09/07: Remi Cohen-Scali - A problem stayed in the vtlock process:
+ *     If a user has switched vt while an xautolock is running, it could
+ *     be possible that the vt is locked. Then the user cannot unlock
+ *     vt switch without the vtswitch command I wrote to test.
+ *     (if you want it just send me a mail to remi.cohenscali@pobox.com
+ *     and I will send it back).
+ *     In order to avoid it, we need to know the active vt (this is easily
+ *     achieved with VT_GETSTATE ioctl), and, more dificult, we need to
+ *     know the vt used by the X server.The vt used by X is known as an
+ *      internal variable in the xf86Info structure (xf86InfoRec defined in
+ *     xc/programs/Xserver/hw/xfree86/common/xf86Priv.h).
+ *     The problem is that this structure in not accessible to the clients.
+ *     In order to access this information, the workaround is to use
+ *     the proc filesystem.
+ *     All proc specific routines are implemented in vtlock_proc.c
+ *     in order to help porting to other procfs.
+ *     The method is explained in the vtlock_proc.c file.
+ *
+ *     PS from E.L: all this stuff is significant for Linux only. For other
+ *      OSs the problem remains the same but the details are different !
+ */
+
+
+#include "xlock.h"
+
+#ifdef USE_VTLOCK
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+
+#if defined( __linux__ )
+#include <linux/vt.h>          /* for VT_LOCKSWITCH/VT_UNLOCKSWITCH */
+#else
+#error Sorry ! You must adapt this file to your system !
+#endif
+
+
+#define CONSOLE "/dev/console"
+
+#define DISPLAY_NR(name)        (*(strchr( (name), ':' ) +1) -'0')
+
+int         vtlocked = 0;
+int         myvt = 0;
+
+static uid_t ruid;
+static int display_nr = -1;
+
+       /* from vtlock_proc.c */
+extern int is_x_vt_active(int);
+extern int restore_vt_active(int);
+extern int set_x_vt_active(int);
+       /* from ressource.c */
+extern Bool vtlock_set_active;
+extern Bool vtlock_restore;
+extern Bool debug;
+
+extern void dovtlock(void);
+extern void dovtunlock(void);
+
+static void
+getrootprivs(void)
+{
+        ruid = getuid();
+
+        (void) seteuid(0);
+}
+
+/* revoke root privs, if there were any */
+static void
+revokerootprivs(void)
+{
+        (void) seteuid(ruid);
+}
+
+static void
+lockvt(Bool lock)
+{
+        int         consfd = -1;
+        struct stat consstat;
+
+        if (stat(CONSOLE, &consstat) == -1 || ruid != consstat.st_uid) return;
+
+        /* Open console */
+        if ((consfd = open(CONSOLE, O_RDWR)) == -1) return;
+
+        /* Do it */
+        if (ioctl(consfd, lock ? VT_LOCKSWITCH : VT_UNLOCKSWITCH) == -1) {
+                close(consfd);
+                return;
+        }
+        /* Terminate */
+        close(consfd);
+        vtlocked = lock;
+}
+
+void
+dovtlock(void)
+{
+    char *dispname = XDisplayName( (char *)NULL );
+    Bool x_vt_active = 0;
+
+    if (debug)
+      (void) fprintf(stderr,"dovtlock start\n");
+    if ( display_nr == -1 ) {
+      if ( dispname )
+        display_nr = DISPLAY_NR( dispname );
+      else
+        display_nr = 0;
+       }
+    getrootprivs();
+    x_vt_active = is_x_vt_active(display_nr);
+    if ( ! x_vt_active ) {
+        if ( vtlock_set_active )
+          if ( set_x_vt_active( display_nr ) != -1 )
+            lockvt(True);
+    }
+    else
+      lockvt(True);
+    if (debug)
+      (void) fprintf(stderr,"dovtlock: %d\n",vtlocked);
+
+    revokerootprivs();
+}
+
+void
+dovtunlock(void)
+{
+    char *dispname = XDisplayName( (char *)NULL );
+
+    if (debug)
+      (void) fprintf(stderr,"dovtunlock start\n");
+    if ( display_nr == -1 ) {
+      if ( dispname )
+        display_nr = DISPLAY_NR( dispname );
+      else
+        display_nr = 0;
+       }
+    getrootprivs();
+    if (is_x_vt_active(display_nr))
+      lockvt(False);
+    if ( vtlock_set_active && vtlock_restore )
+      (void)restore_vt_active(display_nr);
+    revokerootprivs();
+}
+
+#endif
diff --git a/xlock/vtlock_proc.c b/xlock/vtlock_proc.c
new file mode 100644 (file)
index 0000000..2802781
--- /dev/null
@@ -0,0 +1,448 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)vtlock_proc.c        1.2 00/08/30 xlockmore";
+#endif
+
+/* Copyright (c) R. Cohen-Scali, 1998. */
+
+/*
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * <remi.cohenscali@pobox.com>
+ *       00/08/30: Eric Lassauge - updates for assorted compilation warnings
+ *       98/10/08: Eric Lassauge - vtlock_proc renamed from lockvt_proc.
+ *                                misc corrections.
+ */
+
+#include "xlock.h"     /* lots of include come from here */
+#ifdef USE_VTLOCK
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/param.h>
+#include <errno.h>
+#if defined( __linux__ )
+#include <linux/major.h>
+#include <linux/fs.h>
+#include <linux/tty.h>
+#include <linux/vt.h>
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>    /* for readlink() */
+#endif
+#endif
+
+/* Misc definitions to modify if not applicable on the current system */
+#if defined( __linux__ ) && HAVE_DIRENT_H
+#include <dirent.h>    /* for alphasort() */
+#define PROCDIR        "/proc"
+#define DEVDIR                 "/dev"
+#define TTY            DEVDIR "/tty%c"
+#define CONSOLE        DEVDIR "/console"
+#define BASEVTNAME     DEVDIR "/tty%d"
+#define XPATH          "/usr/X11R6/bin" /* default path of X server */
+#define XNAME          "X"              /* X server name : mandatory ! */
+#define MAX_VT         20
+#else
+#error Sorry ! You must adapt this file to your system !
+#endif
+
+/* This struct contains the vt tty refs used for comparison */
+struct inode_ref {
+    unsigned short n;
+    char          ref[MAXPATHLEN+1];
+};
+
+/* Static variables used to keep X device, inode and process */
+static dev_t xdev =(dev_t)-1;
+static ino_t xino =(ino_t)-1;
+static pid_t xproc =(pid_t)-1;
+static unsigned short xvt =(unsigned short)0;
+static unsigned short othervt =(unsigned short)0;
+
+/* Static variables to keep vt devices */
+static int n_ttys = -1;
+static struct inode_ref ttyinodes[MAX_NR_CONSOLES];
+
+/* Prototypes */
+static unsigned short get_active_vt(void);
+static ino_t find_x(const char *, const char *, dev_t * );
+static int proc_dir_select(const struct dirent *);
+static pid_t find_x_proc(int, dev_t, ino_t);
+static int find_tty_inodes(struct inode_ref *);
+static int scan_x_fds(struct inode_ref *, int, pid_t);
+
+/* use scan_dir from iostuff.c */
+extern int  scan_dir(const char *directoryname, struct dirent ***namelist,
+                     int         (*specify) (const struct dirent *),
+                     int         (*compare) (const void *, const void *));
+
+extern int is_x_vt_active(int display_nr);
+extern int set_x_vt_active(int display_nr);
+extern int restore_vt_active(void);
+
+/*
+ * get_active_vt
+ * -------------
+ * Find with ioctl on console what is the active vt number.
+ * The number found by this will be compared to the X vt number to
+ * find if vt locking is possible.
+ */
+static unsigned short
+get_active_vt(void)
+{
+    struct vt_stat vtstat;
+    int fd = -1;
+
+    fd = open( CONSOLE, O_RDONLY );
+    if ( fd == -1 ) return( (unsigned short)  -1 );
+    if ( ioctl( fd, VT_GETSTATE,(void *)&vtstat ) == -1 )
+    {
+        close( fd );
+        return((unsigned short) -1 );
+    }
+    close( fd );
+    return vtstat.v_active;
+}
+
+/*
+ * find_x
+ * ------
+ * Find X server executable file inode.
+ * The inode number found here will be used to find in the X process
+ * in the proc fs.
+ */
+static ino_t
+find_x(const  char *path, const char *name, dev_t *pxdev )
+{
+    struct stat stbuf;
+    char xpath[MAXPATHLEN+1];
+
+    (void) sprintf( xpath, "%s/%s", path, name );
+    if ( stat( xpath, &stbuf ) != -1 ) {
+        (void) strcpy( xpath, name );
+        while ( S_ISLNK(stbuf.st_mode) ) {
+            char buf[MAXPATHLEN+1];
+
+            if (readlink(xpath, buf, MAXPATHLEN ) == -1 || ! *buf)
+                return( (ino_t) -1 );
+
+            /*
+            * Let's try to know if the path is absolute or relative
+             * It is absolute if it begin with '/',
+             * else is relative ,
+            * then we need to add the path given as argument
+            */
+            if ( buf[0] != '/' )
+              (void) sprintf( xpath, "%s/%s", path, buf );
+            else
+              (void) strcpy( xpath, buf );
+            /* Stat linked file */
+            if ( stat( xpath, &stbuf ) == -1 ) return( (ino_t) -1 );
+        }
+    }
+    else
+      return( (ino_t) -1 );
+    if ( pxdev ) *pxdev = stbuf.st_dev;
+    return stbuf.st_ino;
+}
+
+/*
+ * proc_dir_select
+ * ---------------
+ * Callback called for each proc fs dir in order to select all
+ * processes directories. Only returns 1 for directory entries
+ * with a number [0->9].
+ */
+static int
+proc_dir_select( const struct dirent *entry )
+{
+    return( entry->d_name[0] >= '0' && entry->d_name[0] <= '9' );
+}
+
+/*
+ * find_x_proc
+ * -----------
+ * This function scans the /proc dir in order to find the X process
+ * for the given display, knowing the X server file inode and device.
+ */
+static pid_t
+find_x_proc(int disp_nr, dev_t lxdev, ino_t lxino)
+{
+    /*static*/ char xdisp[10];
+    /*static*/ char xcmd_ref[MAXPATHLEN+1];
+    struct stat stbuf;
+    pid_t proc = -1;
+    struct dirent **namelist = NULL;
+    int curn = 0,names = 0;
+    int lencmd ;
+
+    /* These are the display string searched in X cmd running (e.g.: :1) */
+    /* and the searched  value of the link (e.g.: "[0301]:286753") */
+    (void) sprintf( xdisp, ":%d", disp_nr );
+    (void) sprintf( xcmd_ref, "[%04x]:%ld", (int)lxdev, (long)lxino );
+    lencmd = strlen(xcmd_ref);
+    if ( stat( PROCDIR, &stbuf ) == -1 ) return( (pid_t)-1 );
+    namelist = (struct dirent **) malloc(sizeof (struct dirent *));
+    if ((names = scan_dir(PROCDIR, &namelist, proc_dir_select, alphasort)) == -1 )
+    {
+      (void) free((void *) namelist);
+      return( (pid_t)-1 );
+    }
+    while ( curn < names ) {
+        char pname[MAXPATHLEN+1];
+        char buf[MAXPATHLEN+1];
+
+        (void) sprintf( pname, PROCDIR "/%s/exe", namelist[curn]->d_name );
+        (void) memset((char *) buf, 0, sizeof (buf));
+        if ( readlink( pname, buf, MAXPATHLEN ) <= 0 ) {
+            /* This is unreadable, let's continue */
+            curn++;
+            continue;
+        }
+        /*
+         * If the strings are equals, we found an X process, but is it the one
+         * managing the wanted display ?
+         * We are going to try to know it by reading the command line used to
+         * invoke the server.
+              */
+        if ( !strncmp( buf, xcmd_ref, lencmd ) ) {
+            char cmdlinepath[MAXPATHLEN+1];
+            char cmdlinebuf[1024];     /* 1k should be enough */
+            int cmdlinefd;
+            off_t cmdlinesz;
+            char *p;
+
+            proc =(pid_t)atoi( namelist[curn]->d_name );
+            (void) sprintf( cmdlinepath, PROCDIR "/%s/cmdline", namelist[curn]->d_name );
+            if ( ( cmdlinefd = open( cmdlinepath, O_RDONLY ) ) == -1 ) {
+                curn++;
+                continue;
+            }
+            /* Ask the kernel what it was (actually do ps)
+             * If stat'ed the cmdline proc file as a size of zero
+             * No means to dynamically allocate buffer !
+            */
+            if ( ( cmdlinesz = read( cmdlinefd, cmdlinebuf, 1023 ) ) == -1) {
+                close( cmdlinefd );
+                curn++;
+                continue;
+            }
+            /*
+            * The command line proc file contains all command line args
+            * separated by NULL characters. We are going to replace all ^@
+            * with a space, then we'll searched for the display string
+            * (:0, :1, ..., :N). If a match is found, then we got the good
+            * process. If no match is found, then we can assume this is the
+            * good process only if we are searching for the display #0 manager
+            * (the default display). In other case the process is discarded.
+            */
+            p = cmdlinebuf;
+            while ( p < cmdlinebuf+cmdlinesz ) {
+                if ( !*p ) *p = ' ';
+                p++;
+            }
+            close( cmdlinefd );
+            if ( strstr( cmdlinebuf, xdisp ) ) break;
+            else if ( !disp_nr )
+              break;
+            else
+              proc =(pid_t)-1;
+        }
+        curn++;
+    }
+    (void) free((void *) namelist);
+    return proc;
+}
+
+/*
+ * find_tty_inodes
+ * ---------------
+ * This function finds all vt console dev and inode.
+ * Warning ! The dev is not the console major:minor
+ * but the filesystem's major:minor containing the special
+ * device file.
+ */
+static int
+find_tty_inodes( struct inode_ref *inotab )
+{
+    struct stat stbuf;
+    int ln_ttys = 0;
+    int ix = 0;
+    char name[MAXPATHLEN+1];
+
+    for ( ix = 1; ix < MAX_NR_CONSOLES; ix++ ) {
+        (void) sprintf( name, BASEVTNAME, ix );
+        if ( stat( name, &stbuf ) == -1 )
+          continue;
+        inotab[ln_ttys].n = ix;
+        (void) sprintf( inotab[ln_ttys].ref, "[%04x]:%ld", (int)stbuf.st_dev, stbuf.st_ino );
+        ln_ttys++;
+    }
+    return ln_ttys;
+}
+
+/*
+ * scan_x_fds
+ * ----------
+ * This function scans all found process file descriptors
+ * to find a link towards a tty device special file.
+ */
+static int
+scan_x_fds( struct inode_ref *inotab, int ln_ttys, pid_t proc )
+{
+    char xfddir[MAXPATHLEN+1];
+    struct dirent **namelist=NULL;
+    int curn = 0;
+
+    (void) sprintf(xfddir, PROCDIR "/%d/fd", proc);
+    namelist = (struct dirent **) malloc(sizeof (struct dirent *));
+    if (scan_dir(xfddir, &namelist, NULL, alphasort) == -1) {
+        (void) free((void *) namelist);
+        return 0;
+    }
+    while ( namelist[curn] ) {
+        char linkname[MAXPATHLEN+1];
+        char linkref[MAXPATHLEN+1];
+        struct stat stbuf;
+        int ix;
+
+        (void) sprintf( linkname, "%s/%s", xfddir, namelist[curn]->d_name );
+        if ( stat( linkname, &stbuf ) == -1 ) {
+            /* If cannot stat it, just discard it */
+            curn++;
+            continue;
+        }
+        if ( !S_ISDIR(stbuf.st_mode) ) {
+            /*
+            * Let's read the link to get the file device and inode
+            * (e.g.: [0301]:6203)
+            */
+           (void) memset((char *) linkref, 0, sizeof (linkref));
+            if ( readlink( linkname, linkref, MAXPATHLEN ) <= 0 ) {
+                curn++;
+                continue;
+            }
+            for ( ix = 0; ix < ln_ttys; ix++ )
+           {
+              if ( !strncmp( linkref, inotab[ix].ref, strlen( inotab[ix].ref ) ) )
+              {
+               (void) free((void *) namelist);
+                return inotab[ix].n;
+              }
+            }
+        }
+        curn++;
+    }
+    (void) free((void *) namelist);
+    return 0;
+}
+
+/*
+ * is_x_vt_active
+ * --------------
+ * This function is the one called from vtlock.c and which tells
+ * if the X vt is active or not.
+ * If the X vt is active it returns 1 else 0.
+ * -1 is returned in case of errno or if cannot stat.
+ */
+int
+is_x_vt_active(int display_nr)
+{
+    int active_vt = 0;
+    char *path = getenv( "PATH" );
+    char *envtokenizer =(char *)NULL;
+    struct stat stbuf;
+
+    /* The active VT */
+    active_vt = get_active_vt();
+    if ( xino == (ino_t)-1 )
+      if (stat( XPATH, &stbuf ) == -1 ||
+          (xino = find_x( XPATH, XNAME, &xdev )) == (ino_t)-1 ) {
+          /* No executable at the default location */
+          /* Let's try with $PATH */
+          if ( !path ) return -1;
+          envtokenizer = strtok( path, ":" );
+          while ( envtokenizer ) {
+              if ( stat( envtokenizer, &stbuf ) != -1 )
+                if ( ( xino = find_x( envtokenizer, XNAME, &xdev ) ) != (ino_t)-1 )
+                  break;
+              envtokenizer = strtok( (char *)NULL, ":" );
+          }
+          if ( !envtokenizer ) return -1;
+      }
+    if ((xproc ==(pid_t)-1 ) &&
+        (xproc = find_x_proc(display_nr, xdev, xino)) == (pid_t)-1)
+      return -1;
+    if ((n_ttys == -1) &&
+        (n_ttys = find_tty_inodes(ttyinodes))== 0)
+      return -1;
+    if ( ! xvt && ( xvt = scan_x_fds( ttyinodes, n_ttys, xproc ) ) == 0 ) return -1;
+    return(active_vt == xvt);
+}
+
+/*
+ * set_x_vt_active
+ * ---------------
+ * This is the core function. It check if the VT of the X server managing
+ * display number <display_nr> is active.
+ */
+int
+set_x_vt_active(int display_nr)
+{
+    int fd = -1;
+
+    if ( !othervt ) othervt = get_active_vt();
+    if ( !xvt ) (void)is_x_vt_active( display_nr );
+    fd = open( CONSOLE, O_RDONLY );
+    if ( fd == -1 ) return( -1 );
+    if ( ioctl( fd, VT_ACTIVATE, xvt ) == -1 ) {
+        close( fd );
+        return( -1 );
+    }
+    if ( ioctl( fd, VT_WAITACTIVE, xvt ) == -1 ) {
+        close( fd );
+        return( -1 );
+    }
+    close( fd );
+    return 0;
+}
+
+/*
+ * restore_vt_active
+ * -----------------
+ * This function revert the work of the previous one. Actually it restores
+ * the VT which was active when we locked.
+ */
+int
+restore_vt_active(void)
+{
+    int fd = -1;
+
+    if ( !othervt ) return 0;
+    fd = open( CONSOLE, O_RDONLY );
+    if ( fd == -1 ) return( -1 );
+    if ( ioctl( fd, VT_ACTIVATE, othervt ) == -1 ) {
+        close( fd );
+        return( -1 );
+    }
+    if ( ioctl( fd, VT_WAITACTIVE, xvt ) == -1 ) {
+        /* We can achieve that vt has switched */
+        othervt =(unsigned short)0;
+        close( fd );
+        return( -1 );
+    }
+    othervt =(unsigned short)0;
+    close( fd );
+    return 0;
+}
+#endif
diff --git a/xlock/xbm.c b/xlock/xbm.c
new file mode 100644 (file)
index 0000000..e4f721e
--- /dev/null
@@ -0,0 +1,138 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)xbm.c        4.00 97/01/01 xlockmore";
+
+#endif
+
+/*-
+ * Utilities for XBM processing
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 25-May-95: David Bagley "snarfed" xv's xvxbm.c
+ *            John Bradley <bradley@central.cis.upenn.edu>
+ *            code used here by permission
+ */
+#ifdef STANDALONE
+#include "utils.h"
+#else
+#include "xlock.h"
+#endif
+
+#include <X11/Xutil.h>
+
+extern int XbmReadFileToImage(char *filename,
+                  int *width, int *height, unsigned char **bits);
+extern FILE *my_fopen(char *, const char *);
+
+int
+XbmReadFileToImage(char *filename,
+                  int *width, int *height, unsigned char **bits)
+{
+       FILE       *file;
+       int         c, c1;
+       int         i, j, k = 0;
+       unsigned char *pix;
+       char        line[256], name[256];
+       unsigned char hex[256];
+
+       if ((file = my_fopen(filename, "r")) == NULL) {
+               /*(void) fprintf(stderr, "could not read file \"%s\"\n", filename); */
+               return BitmapOpenFailed;
+       }
+       /* read width:  skip lines until we hit a #define */
+       for (;;) {
+               if (!fgets(line, 256, file)) {
+                       /* not a xbm file */
+                       (void) fclose(file);
+                       return BitmapFileInvalid;
+               }
+               if (strncmp(line, "#define", (size_t) 7) == 0 &&
+                   sscanf(line, "#define %s %d", name, width) == 2 &&
+                   strcmp(name, "_width"))
+                       break;
+       }
+
+       /* read height:  skip lines until we hit another #define */
+       for (;;) {
+               if (!fgets(line, 256, file)) {
+                       (void) fclose(file);
+                       (void) fprintf(stderr, "EOF reached in header info.\n");
+                       return BitmapFileInvalid;
+               }
+               if (strncmp(line, "#define", (size_t) 7) == 0 &&
+                   sscanf(line, "#define %s %d", name, height) == 2 &&
+                   strcmp(name, "_height"))
+                       break;
+       }
+       /* scan forward until we see the first '0x' */
+       c = getc(file);
+       c1 = getc(file);
+       while (c1 != EOF && !(c == '0' && c1 == 'x')) {
+               c = c1;
+               c1 = getc(file);
+       }
+       if (c1 == EOF) {
+               (void) fclose(file);
+               (void) fprintf(stderr, "No bitmap data found\n");
+               return BitmapFileInvalid;
+       }
+       if (*width < 1 || *height < 1 || *width > 10000 || *height > 10000) {
+               (void) fclose(file);
+               (void) fprintf(stderr, "Not an xbm file");
+               return BitmapFileInvalid;
+       }
+       *bits = (unsigned char *) calloc((size_t) ((*width + 7) / 8) * (*height),
+                                        (size_t) 8);
+       if (!*bits) {
+               (void) fclose(file);
+               (void) fprintf(stderr, "couldn't malloc bits\n");
+               return BitmapNoMemory;
+       }
+       /* initialize the 'hex' array for zippy ASCII-hex -> int conversion */
+
+       for (i = 0; i < 256; i++)
+               hex[i] = 255;   /* flag 'undefined' chars */
+       for (i = '0'; i <= '9'; i++)
+               hex[i] = i - '0';
+       for (i = 'a'; i <= 'f'; i++)
+               hex[i] = i + 10 - 'a';
+       for (i = 'A'; i <= 'F'; i++)
+               hex[i] = i + 10 - 'A';
+
+       /* read the image data */
+
+       for (i = 0, pix = *bits; i < *height; i++)
+               for (j = 0; j < (*width + 7) / 8; j++, pix++) {
+                       /* get next byte from file.  we're already positioned at it */
+                       c = getc(file);
+                       c1 = getc(file);
+                       if (c < 0 || c1 < 0) {
+                               /* EOF: break out of loop */
+                               c = c1 = '0';
+                               i = *height;
+                               j = *width;
+                               (void) fclose(file);
+                               (void) fprintf(stderr, "The file would appear to be truncated.\n");
+                               return BitmapFileInvalid;
+                       }
+                       if (hex[c1] == 255) {
+                               if (hex[c] == 255)
+                                       k = 0;  /* no digits after the '0x' ... */
+                               else
+                                       k = hex[c];
+                       } else
+                               k = (hex[c] << 4) + hex[c1];
+
+                       /* advance to next '0x' */
+                       c = getc(file);
+                       c1 = getc(file);
+                       while (c1 != EOF && !(c == '0' && c1 == 'x')) {
+                               c = c1;
+                               c1 = getc(file);
+                       }
+                       *pix = k;
+               }
+       (void) fclose(file);
+       return BitmapSuccess;
+}
diff --git a/xlock/xlock-msg-jp.h b/xlock/xlock-msg-jp.h
new file mode 100644 (file)
index 0000000..1e84926
--- /dev/null
@@ -0,0 +1,15 @@
+/* Japanese messages are separate to another file.             */
+/* Because Japanese EUC-JP encoding is conflict with ISO-8859. */
+/* By: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>         */
+
+#ifndef __XLOCK_MSG_JP_H__
+#define __XLOCK_MSG_JP_H__
+
+#define JP_TIME_ELAPSSED_MINUTES "¥í¥Ã¥¯¤·¤Æ¤«¤é %d Ê¬¤¬·Ð²á¤·¤Þ¤·¤¿¡£                      \n"
+#define JP_TIME_ELAPSSED_HOURS   "¥í¥Ã¥¯¤·¤Æ¤«¤é %d »þ´Ö %02d Ê¬·Ð²á¤·¤Þ¤·¤¿¡£              \n"
+#define JP_BUTTON_MINUTES        "%d Ê¬¸å¤Ë¥í¥°¥¢¥¦¥È¥Ü¥¿¥ó¤¬½Ð¸½¤·¤Þ¤¹¡£                   \n"
+#define JP_BUTTON_HOURS          "%d »þ´Ö %02d Ê¬¸å¤Ë¥í¥°¥¢¥¦¥È¥Ü¥¿¥ó¤¬½Ð¸½¤·¤Þ¤¹¡£         \n"
+#define JP_AUTOLOGOUT_MINUTES    "¼«Æ°¥í¥°¥¢¥¦¥È¤Þ¤Ç %d Ê¬"
+#define JP_AUTOLOGOUT_HOURS      "¼«Æ°¥í¥°¥¢¥¦¥È¤Þ¤Ç %d »þ´Ö %02d Ê¬"
+
+#endif
diff --git a/xlock/xlock.c b/xlock/xlock.c
new file mode 100644 (file)
index 0000000..e304771
--- /dev/null
@@ -0,0 +1,3708 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)xlock.c      5.00 2000/11/01 xlockmore";
+
+#endif
+
+/*-
+ * xlock.c - X11 client to lock a display and show a screen saver.
+ *
+ * Copyright (c) 1988-91 by Patrick J. Naughton.
+ * xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 09-Mar-01: showfps stuff corrected
+ * 01-Nov-00: Allocation checks
+ * 08-Apr-98: A way for users to unlock each others display.  Kind of defeats
+ *            the lock but the unlocked user is mailed and and entry is
+ *            written to syslogd.  Thanks to Mark Kirk <mkirk@pdi.com> for
+ *            his vizlock-1.0 patch.  Compile-time switch for this is
+ *            GLOBAL_UNLOCK.  This is probably full of security holes when
+ *            enabled... :)
+ * 01-Jul-98: Eric Lassauge <lassauge@mail.dotcom.fr> &
+ *              Remi Cohen-Scali <remi.cohenscali@pobox.com>
+ *            Added support for locking VT switching (-/+vtlock)
+ *            Added code is enclosed in USE_VTLOCK
+ * 01-May-97: Matthew Rench <mdrench@mtu.edu>
+ *            Added DPMS options.
+ * 02-Dec-97: Strong user authentication, utilizing the SafeWord API.
+ *            Author unknown.
+ * 01-May-97: Scott Carter <scarter@sdsc.edu>
+ *            Added code to stat .xlocktext, .plan, and .signature files
+ *            before reading the message;  only regular files are read (no
+ *            pipes or special files).
+ *            Added code to replace tabs with 8 spaces in the plantext buffer.
+ * 01-Sep-96: Ron Hitchens <ron@idiom.com>
+ *            Updated xlock so it would refresh more reliably and
+ *            handle window resizing.
+ * 18-Mar-96: Ron Hitchens <ron@idiom.com>
+ *            Implemented new ModeInfo hook calling scheme.
+ *            Created mode_info() to gather and pass info to hooks.
+ *            Watch for and use MI_PAUSE value if mode hook sets it.
+ *            Catch SIGSEGV, SIGBUS and SIGFPE signals.  Other should
+ *            be caught.  Eliminate some globals.
+ * 23-Dec-95: Ron Hitchens <ron@idiom.com>
+ *            Rewrote event loop so as not to use signals.
+ * 01-Sep-95: initPasswd function, more stuff removed to passwd.c
+ * 24-Jun-95: Cut out passwd stuff to passwd.c-> getPasswd & checkPasswd
+ * 17-Jun-95: Added xlockrc password compile time option.
+ * 12-May-95: Added defines for SunOS's Adjunct password file from
+ *            Dale A. Harris <rodmur@ecst.csuchico.edu>
+ * 21-Feb-95: MANY patches from Heath A. Kehoe <hakehoe@icaen.uiowa.edu>.
+ * 24-Jan-95: time_displayed fixed from Chris Ross <cross@va.pubnix.com>.
+ * 18-Jan-95: Ultrix systems (at least DECstations) running enhanced
+ *            security from Chris Fuhrman <cfuhrman@vt.edu> and friend.
+ * 26-Oct-94: In order to use extra-long passwords with the Linux changed
+ *            PASSLENGTH to 64 <slouken@virtbrew.water.ca.gov>
+ * 11-Jul-94: added -inwindow option from Greg Bowering
+ *            <greg@cs.adelaide.edu.au>
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 10-Jun-94: patch for BSD from Victor Langeveld <vic@mbfys.kun.nl>
+ * 02-May-94: patched to work on Linux from Darren Senn's
+ *            <sinster@scintilla.capitola.ca.us> xlock for Linux.
+ *            Took out "bounce" since it was too buggy (maybe I will put
+ *            it back later).
+ * 21-Mar-94: patch to to trap Shift-Ctrl-Reset courtesy of Jamie Zawinski
+ *            <jwz@jwz.org>, patched the patch (my mistake) for AIXV3
+ *            and HP from <R.K.Lloyd@csc.liv.ac.uk>.
+ * 01-Dec-93: added patch for AIXV3 from Tom McConnell
+ *            <tmcconne@sedona.intel.com> also added a patch for HP-UX 8.0.
+ * 29-Jul-93: "hyper", "helix", "rock", and "blot" (also tips on "maze") I
+ *            got courtesy of Jamie Zawinski <jwz@jwz.org>;
+ *            at the time I could not get his stuff to work for the hpux 8.0,
+ *            so I scrapped it but threw his stuff in xlock.
+ *            "maze" and "sphere" I got courtesy of Sun Microsystems.
+ *            "spline" I got courtesy of Jef Poskanzer <jef@netcom.com or
+ *            jef@well.sf.ca.us>.
+ *
+ * Changes of Patrick J. Naughton
+ * 24-Jun-91: make foreground and background color get used on mono.
+ * 24-May-91: added -usefirst.
+ * 16-May-91: added pyro and random modes.
+ *           ripped big comment block out of all other files.
+ * 08-Jan-91: fix some problems with password entry.
+ *           removed renicing code.
+ * 29-Oct-90: added cast to XFree() arg.
+ *           added volume arg to call to XBell().
+ * 28-Oct-90: center prompt screen.
+ *           make sure Xlib input buffer does not use up all of swap.
+ *           make displayed text come from resource file for better I18N.
+ *           add backward compatible signal handlers for pre 4.1 machines.
+ * 31-Aug-90: added blank mode.
+ *           added swarm mode.
+ *           moved usleep() and seconds() out to usleep.c.
+ *           added SVR4 defines to xlock.h
+ * 29-Jul-90: added support for multiple screens to be locked by one xlock.
+ *           moved global defines to xlock.h
+ *           removed use of allowsig().
+ * 07-Jul-90: reworked commandline args and resources to use Xrm.
+ *           moved resource processing out to resource.c
+ * 02-Jul-90: reworked colors to not use dynamic colormap.
+ * 23-May-90: added autoraise when obscured.
+ * 15-Apr-90: added hostent alias searching for host authentication.
+ * 18-Feb-90: added SunOS3.5 fix.
+ *           changed -mono -> -color, and -saver -> -lock.
+ *           allow non-locking screensavers to display on remote machine.
+ *           added -echokeys to disable echoing of '?'s on input.
+ *           cleaned up all of the parameters and defaults.
+ * 20-Dec-89: added -xhost to allow access control list to be left alone.
+ *           added -screensaver (do not disable screen saver) for the paranoid.
+ *           Moved seconds() here from all of the display mode source files.
+ *           Fixed bug with calling XUngrabHosts() in finish().
+ * 19-Dec-89: Fixed bug in GrabPointer.
+ *           Changed fontname to XLFD style.
+ * 23-Sep-89: Added fix to allow local hostname:0 as a display.
+ *           Put empty case for Enter/Leave events.
+ *           Moved colormap installation later in startup.
+ * 20-Sep-89: Linted and made -saver mode grab the keyboard and mouse.
+ *           Replaced SunView code for life mode with Jim Graham's version,
+ *             so I could contrib it without legal problems.
+ *           Sent to expo for X11R4 contrib.
+ * 19-Sep-89: Added '?'s on input.
+ * 27-Mar-89: Added -qix mode.
+ *           Fixed GContext->GC.
+ * 20-Mar-89: Added backup font (fixed) if XQueryLoadFont() fails.
+ *           Changed default font to lucida-sans-24.
+ * 08-Mar-89: Added -nice, -mode and -display, built vector for life and hop.
+ * 24-Feb-89: Replaced hopalong display with life display from SunView1.
+ * 22-Feb-89: Added fix for color servers with n < 8 planes.
+ * 16-Feb-89: Updated calling conventions for XCreateHsbColormap();
+ *           Added -count for number of iterations per color.
+ *           Fixed defaulting mechanism.
+ *           Ripped out VMS hacks.
+ *           Sent to expo for X11R3 contrib.
+ * 15-Feb-89: Changed default font to pellucida-sans-18.
+ * 20-Jan-89: Added -verbose and fixed usage message.
+ * 19-Jan-89: Fixed monochrome gc bug.
+ * 16-Dec-88: Added SunView style password prompting.
+ * 19-Sep-88: Changed -color to -mono. (default is color on color displays).
+ *           Added -saver option. (just do display... do not lock.)
+ * 31-Aug-88: Added -time option.
+ *           Removed code for fractals to separate file for modularity.
+ *           Added signal handler to restore host access.
+ *           Installs dynamic colormap with a Hue Ramp.
+ *           If grabs fail then exit.
+ *           Added VMS Hacks. (password 'iwiwuu').
+ *           Sent to expo for X11R2 contrib.
+ * 08-Jun-88: Fixed root password pointer problem and changed PASSLENGTH to 20.
+ * 20-May-88: Added -root to allow root to unlock.
+ * 12-Apr-88: Added root password override.
+ *           Added screen saver override.
+ *           Removed XGrabServer/XUngrabServer.
+ *           Added access control handling instead.
+ * 01-Apr-88: Added XGrabServer/XUngrabServer for more security.
+ * 30-Mar-88: Removed startup password requirement.
+ *           Removed cursor to avoid phosphor burn.
+ * 27-Mar-88: Rotate fractal by 45 degrees clockwise.
+ * 24-Mar-88: Added color support. [-color]
+ *           wrote the man page.
+ * 23-Mar-88: Added HOPALONG routines from Scientific American Sept. 86 p. 14.
+ *           added password requirement for invokation
+ *           removed option for command line password
+ *           added requirement for display to be "unix:0".
+ * 22-Mar-88: Recieved Walter Milliken's comp.windows.x posting.
+ *
+ */
+
+#ifdef STANDALONE
+
+/*-
+ * xscreensaver compatibility layer for xlockmore modules.
+ * xscreensaver, Copyright (c) 1997, 1998 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * This file, along with xlockmore.h, make it possible to compile an xlockmore
+ * module into a standalone program, and thus use it with xscreensaver.
+ * By Jamie Zawinski <jwz@jwz.org> on 10-May-97; based on the ideas
+ * in the older xlock.h by Charles Hannum <mycroft@ai.mit.edu>.  (I had
+ * to redo it, since xlockmore has diverged so far from xlock...)
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include "screenhack.h"
+#include "mode.h"
+#include "vis.h"
+
+#define countof(x) (sizeof((x))/sizeof(*(x)))
+
+extern ModeSpecOpt xlockmore_opts[];
+extern const char *app_defaults;
+char       *message, *messagefile, *messagesfile, *program;
+char       *messagefontname;
+
+void
+pre_merge_options(void)
+{
+       int         i, j;
+       char       *s;
+
+       /* Translate the xlockmore `opts[]' argument to a form that
+          screenhack.c expects.
+        */
+       for (i = 0; i < xlockmore_opts->numopts; i++) {
+               XrmOptionDescRec *old = &xlockmore_opts->opts[i];
+               XrmOptionDescRec *new = &options[i];
+
+               if (old->option[0] == '-')
+                       new->option = old->option;
+               else {
+                       /* Convert "+foo" to "-no-foo". */
+                       if ((new->option = (char *) malloc(strlen(old->option) +
+                                       5)) != NULL) {
+                               (void) strcpy(new->option, "-no-");
+                               (void) strcat(new->option, old->option + 1);
+                       }
+               }
+
+               new->specifier = strrchr(old->specifier, '.');
+               if (!new->specifier)
+                       abort();
+
+               new->argKind = old->argKind;
+               new->value = old->value;
+       }
+
+       /* Add extra args, if they're mentioned in the defaults... */
+       {
+               char       *args[] =
+               {"-delay", "-count", "-cycles", "-size", "-ncolors", "-bitmap",
+                "-text", "-filename", "-program",
+                "-wireframe", "-use3d", "-verbose"};
+
+               for (j = 0; j < countof(args); j++)
+                       if (strstr(app_defaults, args[j] + 1)) {
+                               XrmOptionDescRec *new = &options[i++];
+
+                               new->option = args[j];
+                               new->specifier = strdup(args[j]);
+                               new->specifier[0] = '.';
+                               if (!strcmp(new->option, "-wireframe")) {
+                                       new->argKind = XrmoptionNoArg;
+                                       new->value = "True";
+                                       new = &options[i++];
+                                       new->option = "-no-wireframe";
+                                       new->specifier = options[i - 2].specifier;
+                                       new->argKind = XrmoptionNoArg;
+                                       new->value = "False";
+                               } else if (!strcmp(new->option, "-use3d")) {
+                                       new->option = "-3d";
+                                       new->argKind = XrmoptionNoArg;
+                                       new->value = "True";
+                                       new = &options[i++];
+                                       new->option = "-no-3d";
+                                       new->specifier = options[i - 2].specifier;
+                                       new->argKind = XrmoptionNoArg;
+                                       new->value = "False";
+                               } else if (!strcmp(new->option, "-verbose")) {
+                                       new->option = "-verbose";
+                                       new->argKind = XrmoptionNoArg;
+                                       new->value = "True";
+                                       new = &options[i++];
+                                       new->option = "-no-verbose";
+                                       new->specifier = options[i - 2].specifier;
+                                       new->argKind = XrmoptionNoArg;
+                                       new->value = "False";
+                               } else {
+                                       new->argKind = XrmoptionSepArg;
+                                       new->value = 0;
+                               }
+                       }
+       }
+
+
+       /* Construct the kind of `defaults' that screenhack.c expects from
+          the xlockmore `vars[]' argument.
+        */
+       i = 0;
+
+       /* Put on the PROGCLASS.background/foreground resources. */
+       if ((s = (char *) malloc(50)) != NULL) {
+               (void) strcpy(s, progclass);
+               (void) strcat(s, ".background: black");
+               defaults[i++] = s;
+       }
+
+       if ((s = (char *) malloc(50)) != NULL) {
+               (void) strcpy(s, progclass);
+               (void) strcat(s, ".foreground: white");
+               defaults[i++] = s;
+       }
+
+       /* Copy the lines out of the `app_defaults' var and into this array. */
+       s = strdup(app_defaults);
+       while (s && *s) {
+               defaults[i++] = s;
+               s = strchr(s, '\n');
+               if (s)
+                       *s++ = 0;
+       }
+
+       /* Copy the defaults out of the `xlockmore_opts->' variable. */
+       for (j = 0; j < xlockmore_opts->numvarsdesc; j++) {
+               const char *def = xlockmore_opts->vars[j].def;
+
+               if (!def)
+                       def = "False";
+               if (def == ((char *) 1))
+                       def = "True";
+               if ((s = (char *) malloc(strlen(xlockmore_opts->vars[j].name) +
+                                   strlen(def) + 10)) != NULL) {
+                       (void) strcpy(s, "*");
+                       (void) strcat(s, xlockmore_opts->vars[j].name);
+                       (void) strcat(s, ": ");
+                       (void) strcat(s, def);
+                       defaults[i++] = s;
+               }
+       }
+
+       defaults[i] = 0;
+}
+
+
+static void
+xlockmore_read_resources(void)
+{
+       int         i;
+
+       for (i = 0; i < xlockmore_opts->numvarsdesc; i++) {
+               void       *var = xlockmore_opts->vars[i].var;
+               Bool       *var_b = (Bool *) var;
+               char      **var_c = (char **) var;
+               int        *var_i = (int *) var;
+               float      *var_f = (float *) var;
+
+               switch (xlockmore_opts->vars[i].type) {
+                       case t_String:
+                               *var_c = get_string_resource(xlockmore_opts->vars[i].name,
+                                         xlockmore_opts->vars[i].classname);
+                               break;
+                       case t_Float:
+                               *var_f = get_float_resource(xlockmore_opts->vars[i].name,
+                                         xlockmore_opts->vars[i].classname);
+                               break;
+                       case t_Int:
+                               *var_i = get_integer_resource(xlockmore_opts->vars[i].name,
+                                         xlockmore_opts->vars[i].classname);
+                               break;
+                       case t_Bool:
+                               *var_b = get_boolean_resource(xlockmore_opts->vars[i].name,
+                                         xlockmore_opts->vars[i].classname);
+                               break;
+                       default:
+                               abort();
+               }
+       }
+}
+
+void
+xlockmore_screenhack(Display * dpy, Window window,
+                    Bool want_writable_colors,
+                    Bool want_uniform_colors,
+                    Bool want_smooth_colors,
+                    Bool want_bright_colors,
+                    void        (*hack_init) (ModeInfo *),
+                    void        (*hack_draw) (ModeInfo *),
+                    void        (*hack_free) (ModeInfo *))
+{
+       ModeInfo    mi;
+       XGCValues   gcv;
+       XColor      color;
+       int         i;
+       time_t      start, now;
+       int         orig_pause;
+
+       (void) memset((char *) &mi, 0, sizeof (mi));
+       mi.dpy = dpy;
+       mi.window = window;
+       (void) XGetWindowAttributes(dpy, window, &mi.xgwa);
+
+       color.flags = DoRed | DoGreen | DoBlue;
+       color.red = color.green = color.blue = 0;
+       if (!XAllocColor(dpy, mi.xgwa.colormap, &color))
+               abort();
+       mi.black = color.pixel;
+       color.red = color.green = color.blue = 0xFFFF;
+       if (!XAllocColor(dpy, mi.xgwa.colormap, &color))
+               abort();
+       mi.white = color.pixel;
+
+       if (mono_p) {
+               static unsigned long pixels[2];
+               static XColor colors[2];
+
+             MONO:
+               mi.npixels = 2;
+               mi.pixels = pixels;
+               mi.colors = colors;
+               pixels[0] = mi.black;
+               pixels[1] = mi.white;
+               colors[0].flags = DoRed | DoGreen | DoBlue;
+               colors[1].flags = DoRed | DoGreen | DoBlue;
+               colors[0].red = colors[0].green = colors[0].blue = 0;
+               colors[1].red = colors[1].green = colors[1].blue = 0xFFFF;
+               mi.writable_p = False;
+       } else {
+               mi.npixels = get_integer_resource("ncolors", "Integer");
+               if (mi.npixels <= 0)
+                       mi.npixels = 64;
+               else if (mi.npixels > 256)
+                       mi.npixels = 256;
+
+               mi.writable_p = want_writable_colors;
+               if ((mi.colors = (XColor *) calloc(mi.npixels,
+                       sizeof (*mi.colors))) != NULL) {
+
+                       if (want_uniform_colors)
+                               make_uniform_colormap(dpy, mi.xgwa.visual, mi.xgwa.colormap,
+                                             mi.colors, &mi.npixels,
+                                             True, &mi.writable_p, True);
+                       else if (want_smooth_colors)
+                               make_smooth_colormap(dpy, mi.xgwa.visual, mi.xgwa.colormap,
+                                            mi.colors, &mi.npixels,
+                                            True, &mi.writable_p, True);
+                       else
+                               make_random_colormap(dpy, mi.xgwa.visual, mi.xgwa.colormap,
+                                            mi.colors, &mi.npixels,
+                                            want_bright_colors,
+                                            True, &mi.writable_p, True);
+               }
+
+               if (mi.npixels <= 2)
+                       goto MONO;
+               else {
+                       if ((mi.pixels = (unsigned long *)
+                               calloc(mi.npixels, sizeof (*mi.pixels))) != NULL) {
+                               int         i;
+
+                               for (i = 0; i < mi.npixels; i++)
+                                       mi.pixels[i] = mi.colors[i].pixel;
+                       }
+               }
+       }
+
+       gcv.foreground = mi.white;
+       gcv.background = mi.black;
+       mi.gc = XCreateGC(dpy, window, GCForeground | GCBackground, &gcv);
+
+       mi.pause = get_integer_resource("delay", "Usecs");
+
+       mi.count = get_integer_resource("count", "Int");
+       mi.cycles = get_integer_resource("cycles", "Int");
+       mi.size = get_integer_resource("size", "Int");
+       mi.ncolors = get_integer_resource("ncolors", "Int");
+       mi.bitmap = get_string_resource("bitmap", "String");
+       messagefontname = get_string_resource("font", "String");
+       message = get_string_resource("text", "String");
+       messagefile = get_string_resource("filename", "String");
+       messagesfile = get_string_resource("fortunefile", "String");
+       program = get_string_resource("program", "String");
+
+
+#if 0
+       decay = get_boolean_resource("decay", "Boolean");
+       if (decay)
+               mi.fullrandom = False;
+
+       trail = get_boolean_resource("trail", "Boolean");
+       if (trail)
+               mi.fullrandom = False;
+
+       grow = get_boolean_resource("grow", "Boolean");
+       if (grow)
+               mi.fullrandom = False;
+
+       liss = get_boolean_resource("liss", "Boolean");
+       if (liss)
+               mi.fullrandom = False;
+
+       ammann = get_boolean_resource("ammann", "Boolean");
+       if (ammann)
+               mi.fullrandom = False;
+
+       jong = get_boolean_resource("jong", "Boolean");
+       if (jong)
+               mi.fullrandom = False;
+
+       sine = get_boolean_resource("sine", "Boolean");
+       if (sine)
+               mi.fullrandom = False;
+#endif
+
+       mi.threed = get_boolean_resource("use3d", "Boolean");
+       mi.threed_delta = get_float_resource("delta3d", "Boolean");
+       mi.threed_right_color = get_pixel_resource("right3d", "Color", dpy,
+                                                  mi.xgwa.colormap);
+       mi.threed_left_color = get_pixel_resource("left3d", "Color", dpy,
+                                                 mi.xgwa.colormap);
+       mi.threed_both_color = get_pixel_resource("both3d", "Color", dpy,
+                                                 mi.xgwa.colormap);
+       mi.threed_none_color = get_pixel_resource("none3d", "Color", dpy,
+                                                 mi.xgwa.colormap);
+
+       mi.wireframe_p = get_boolean_resource("wireframe", "Boolean");
+        mi.fps_p = get_boolean_resource("showfps", "Boolean");
+       mi.verbose = get_boolean_resource("verbose", "Boolean");
+
+       mi.root_p = (window == RootWindowOfScreen(mi.xgwa.screen));
+       mi.is_drawn = False;
+
+
+       if (mi.pause < 0)
+               mi.pause = 0;
+       else if (mi.pause > 100000000)
+               mi.pause = 100000000;
+       orig_pause = mi.pause;
+
+       xlockmore_read_resources();
+
+       XClearWindow(dpy, window);
+
+       i = 0;
+       start = time((time_t) 0);
+
+       hack_init(&mi);
+       do {
+               hack_draw(&mi);
+               XSync(dpy, False);
+               if (mi.pause)
+                       (void) usleep(mi.pause);
+               mi.pause = orig_pause;
+
+               if (hack_free) {
+                       if (i++ > (mi.count / 4) &&
+                           (start + 5) < (now = time((time_t) 0))) {
+                               i = 0;
+                               start = now;
+                               hack_free(&mi);
+                               hack_init(&mi);
+                               XSync(dpy, False);
+                       }
+               }
+       } while (1);
+}
+
+#else /* STANDALONE */
+#include "xlock.h"
+#include "color.h"
+#include "util.h"
+#include "iostuff.h"
+#include "passwd.h"
+#include <sys/stat.h>
+#include <signal.h>
+#include <errno.h>
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#if HAVE_SYS_SELECT_H && defined(AIXV3)
+#include <sys/select.h>
+#endif
+#include <X11/cursorfont.h>
+#include <X11/Xatom.h>
+#if USE_XVMSUTILS
+#if 0
+#include "../xvmsutils/unix_types.h"
+#include "../xvmsutils/unix_time.h"
+#else
+#include <X11/unix_types.h>
+#include <X11/unix_time.h>
+#endif
+#endif /* USE_XVMSUTILS */
+#ifdef USE_DTSAVER
+#include <X11/Intrinsic.h>
+#include <Dt/Saver.h>
+#endif
+#if defined( __hpux ) || defined( __apollo )
+#include <X11/XHPlib.h>
+extern int  XHPEnableReset(Display * dsp);
+
+#endif
+#ifdef USE_DPMS
+#define MIN_DPMS 30            /* 30 second minimum */
+#if 1
+#include <X11/Xmd.h>
+#include <X11/Xdmcp.h>
+#include <X11/extensions/dpms.h>
+#ifdef SunCplusplus 
+extern unsigned char DPMSQueryExtension(Display *, int *, int *);
+extern int  DPMSGetTimeouts(Display *, unsigned short *, unsigned short *, unsigned short *);
+extern int  DPMSSetTimeouts(Display *, unsigned short, unsigned short, unsigned short);
+extern int  DPMSCapable(Display *);
+extern int  DPMSInfo(Display *, CARD16 *, BOOL *);
+#endif
+#else /* XFree86 < 4.x */
+#include <X11/extensions/dpms.h>
+extern unsigned char DPMSQueryExtension(Display *, int *, int *);
+extern int  DPMSGetTimeouts(Display *, unsigned short *, unsigned short *, unsigned short *);
+extern int  DPMSSetTimeouts(Display *, unsigned short, unsigned short, unsigned short);
+#endif
+extern int  dpmsstandby;
+extern int  dpmssuspend;
+extern int  dpmsoff;
+
+#endif
+
+#if ( HAVE_SYSLOG_H && (defined( USE_SYSLOG ) || defined( GLOBAL_UNLOCK )))
+#include <pwd.h>
+#include <grp.h>
+#include <syslog.h>
+#ifndef SYSLOG_FACILITY
+#define SYSLOG_FACILITY LOG_AUTH
+#endif
+#endif
+
+#if ( __VMS_VER >= 70000000 )
+#include <lib$routines.h>
+#include <mail$routines.h>
+#include <maildef.h>
+struct itmlst_3 {
+       unsigned short int buflen;
+       unsigned short int itmcode;
+       void       *bufadr;
+       unsigned short int *retlen;
+};
+
+#endif
+
+#ifdef __FreeBSD__
+#include <floatingpoint.h>
+#endif
+
+extern void checkResources(void);
+extern void defaultVisualInfo(Display * display, int screen);
+
+#ifdef USE_OLD_EVENT_LOOP
+extern int  usleep(unsigned int);
+
+#endif
+
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+extern void logoutUser(Display * display
+#ifdef CLOSEDOWN_LOGOUT
+ , int screens
+#endif
+);
+
+#endif
+
+#if 0
+       /* #if !defined( AIXV3 ) && !defined( __hpux ) && !defined( __bsdi__ ) */
+extern int  select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+
+#if !defined( __hpux ) && !defined( apollo )
+extern int  select(size_t, int *, int *, int *, const struct timeval *);
+
+#endif
+
+#endif
+extern int  nice(int);
+
+char       *ProgramName;       /* argv[0] */
+
+#ifdef DEBUG
+pid_t       ProgramPID;                /* for memcheck.c */
+
+#endif
+ScreenInfo *Scr = NULL;
+
+/* This is a private data structure, don't touch */
+static ModeInfo *modeinfo = NULL;
+
+Window      parent;
+Bool        parentSet = False;
+Display    *dsp = NULL;                /* server display connection */
+
+extern char user[PASSLENGTH];
+extern char hostname[MAXHOSTNAMELEN];
+extern char *displayname;
+extern char *bitmap;
+extern int  delay;
+extern int  count;
+extern int  cycles;
+extern int  size;
+extern int  ncolors;
+extern float saturation;
+extern float delta3d;
+extern Bool nolock;
+extern Bool resetsaver;
+extern Bool inwindow;
+extern Bool inroot;
+extern Bool mono;
+extern Bool allowaccess;
+extern Bool allowroot;
+extern Bool debug;
+extern Bool description;
+extern Bool echokeys;
+extern Bool enablesaver;
+extern Bool fullrandom;
+extern Bool grabmouse;
+extern Bool grabserver;
+extern Bool install;
+extern Bool mousemotion;
+extern Bool timeelapsed;
+extern Bool usefirst;
+extern Bool verbose;
+extern Bool remote;
+extern int  nicelevel;
+extern int  lockdelay;
+extern int  timeout;
+extern Bool wireframe;
+#ifdef USE_GL
+extern Bool showfps;
+extern Bool fpsTop;
+#endif
+extern Bool use3d;
+
+extern char *fontname;
+extern char *planfontname;
+
+#ifdef USE_MB
+XFontSet    fontset;
+extern char *fontsetname;
+XRectangle  mbRect;
+
+#endif
+extern char *background;
+extern char *foreground;
+extern char *text_user;
+extern char *text_pass;
+extern char *text_info;
+extern char *text_valid;
+extern char *text_invalid;
+extern char *geometry;
+extern char *icongeometry;
+
+#ifdef FX
+extern char *glgeometry;
+
+#endif
+extern char *none3d;
+extern char *right3d;
+extern char *left3d;
+extern char *both3d;
+
+#ifdef USE_SOUND
+extern char *locksound;
+extern char *infosound;
+extern char *validsound;
+extern char *invalidsound;
+#ifdef USE_ESOUND
+extern char *welcomesound;
+extern char *shutdownsound;
+#endif
+extern void play_sound(char *string, Bool verbose);
+#ifdef USE_ESOUND
+extern int init_sound(void);
+extern void shutdown_sound(void);
+#endif
+extern Bool sound;
+
+#endif
+
+extern char *startCmd;
+extern char *endCmd;
+extern char *logoutCmd;
+
+extern char *mailCmd;
+extern char *mailIcon;
+extern char *nomailIcon;
+
+#ifdef USE_AUTO_LOGOUT
+extern int  logoutAuto;
+
+#endif
+
+#ifdef USE_BUTTON_LOGOUT
+extern int  logoutButton;
+extern int  enable_button;
+extern char *logoutButtonLabel;
+extern char *logoutButtonHelp;
+extern char *logoutFailedString;
+
+#endif
+
+#ifdef USE_DTSAVER
+extern Bool dtsaver;
+
+#endif
+
+static int  screen = 0;                /* current screen */
+int         startscreen = 0;
+static int  screens;           /* number of screens */
+
+static Cursor mycursor;                /* blank cursor */
+static Pixmap lockc;
+static Pixmap lockm;           /* pixmaps for cursor and mask */
+static char no_bits[] =
+{0};                           /* dummy array for the blank cursor */
+static int  passx, passy;      /* position of the ?'s */
+static int  iconwidth, iconheight;
+static int  lock_delay;
+
+#ifdef FX
+static int  glwidth, glheight;
+
+#endif
+static int  timex, timey;      /* position for the times */
+static XFontStruct *font;
+static XFontStruct *planfont;
+static int  sstimeout;         /* screen saver parameters */
+static int  ssinterval;
+static int  ssblanking;
+static int  ssexposures;
+static unsigned long start_time;
+static char *plantext[TEXTLINES + 1];  /* Message is stored here */
+
+/* GEOMETRY STUFF */
+static int  sizeconfiguremask;
+static XWindowChanges minisizeconfigure;
+static Bool fullscreen = False;
+
+#if defined( USE_AUTO_LOGOUT ) || defined( USE_BUTTON_LOGOUT )
+static int  tried_logout = 0;
+
+#endif
+
+#ifdef USE_SOUND
+static int  got_invalid = 0;
+
+#endif
+
+/* This still might not be right for Solaris, change the "1"->"0" if error */
+#if 1
+#if (defined( SYSV ) || defined( SVR4 )) && defined( SOLARIS2 ) && !defined( HAVE_STRUCT_SIGSET_T )
+#if !defined( __cplusplus ) && !defined( c_plusplus ) && !defined ( _SIGSET_T )
+#define _SIGSET_T
+typedef struct {               /* signal set type */
+       unsigned long __sigbits[4];
+} sigset_t;
+
+ /* This is good for gcc compiled on Solaris-2.5 but used on Solaris-2.6 */
+
+#endif
+#endif
+#endif
+
+#ifdef ORIGINAL_XPM_PATCH
+#if defined( USE_XPM ) || defined( USE_XPMINC )
+#if USE_XPMINC
+#include <xpm.h>
+#else
+#include <X11/xpm.h>           /* Normal spot */
+#endif
+#endif
+
+static XpmImage *mail_xpmimg = NULL;
+static XpmImage *nomail_xpmimg = NULL;
+
+#else
+#include <bitmaps/mailempty.xbm>
+#include <bitmaps/mailfull.xbm>
+
+#define NOMAIL_WIDTH   mailempty_width
+#define NOMAIL_HEIGHT  mailempty_height
+#define NOMAIL_BITS    mailempty_bits
+#define MAIL_WIDTH   mailfull_width
+#define MAIL_HEIGHT  mailfull_height
+#define MAIL_BITS    mailfull_bits
+#endif
+
+#ifdef USE_VTLOCK
+       /* EL - RCS : for VT switching locking */
+extern int  vtlock;            /* Have to lock VT switching */
+extern int  vtlocked;          /* VT switching is locked */
+
+extern void dovtlock(void);    /* Actual do it */
+extern void dovtunlock(void);  /* & undo it functions */
+
+#endif
+
+static int  signalUSR1 = 0;
+static int  signalUSR2 = 0;
+char * old_default_mode = NULL;
+
+#define AllPointerEventMask \
+       (ButtonPressMask | ButtonReleaseMask | \
+       EnterWindowMask | LeaveWindowMask | \
+       PointerMotionMask | PointerMotionHintMask | \
+       Button1MotionMask | Button2MotionMask | \
+       Button3MotionMask | Button4MotionMask | \
+       Button5MotionMask | ButtonMotionMask | \
+       KeymapStateMask)
+
+#ifdef USE_VROOT
+#include "vroot.h"
+#endif
+#ifdef SAFEWORD
+#include "custpb.h"
+#include "custf.h"
+
+extern char *text_dpass;
+extern char *text_fpass;
+extern char *text_chall;
+static int  challx, chally;
+
+extern      pbmain();
+
+struct pblk pblock;            /* our instance of the pblk */
+struct pblk *pb;               /* global pointer to the pblk */
+
+extern int  checkDynamic();
+
+#endif
+
+#if defined( HAVE_SYSLOG_H ) && defined( USE_SYSLOG )
+static void
+syslogStart(void)
+{
+       struct passwd *pw;
+       struct group *gr;
+
+       pw = getpwuid(getuid());
+       gr = getgrgid(getgid());
+
+       (void) openlog(ProgramName, LOG_PID, SYSLOG_FACILITY);
+       syslog(SYSLOG_INFO, "Start: %s, %s, %s",
+              pw->pw_name, gr->gr_name, XDisplayString(dsp));
+}
+
+void
+syslogStop(char *displayName)
+{
+       struct passwd *pw;
+       struct group *gr;
+       int         secs, mins;
+
+       secs = (int) (seconds() - start_time);
+       mins = secs / 60;
+       secs %= 60;
+
+       pw = getpwuid(getuid());
+       gr = getgrgid(getgid());
+
+       syslog(SYSLOG_INFO, "Stop: %s, %s, %s, %dm %ds",
+              pw->pw_name, gr->gr_name, displayName, mins, secs);
+}
+
+#endif
+
+#define ERROR_BUF 2048
+char error_buf[ERROR_BUF];
+
+void
+error(const char *buf)
+{
+#if defined( HAVE_SYSLOG_H ) && defined( USE_SYSLOG )
+       extern Display *dsp;
+
+       syslog(SYSLOG_WARNING, "%s", buf);
+       if (!nolock) {
+               if (strstr(buf, "unable to open display") == NULL)
+                       syslogStop(XDisplayString(dsp));
+               else
+                       syslogStop("unknown display");
+               closelog();
+       }
+#else
+       (void) fprintf(stderr, "%s", buf);
+#endif
+       exit(1);
+}
+
+/* Server access control support. */
+
+static XHostAddress *XHosts;   /* the list of "friendly" client machines */
+static int  HostAccessCount;   /* the number of machines in XHosts */
+static Bool HostAccessState;   /* whether or not we even look at the list */
+
+static void
+XGrabHosts(Display * display)
+{
+       XHosts = XListHosts(display, &HostAccessCount, &HostAccessState);
+       if (XHosts)
+               XRemoveHosts(display, XHosts, HostAccessCount);
+       XEnableAccessControl(display);
+}
+
+static void
+XUngrabHosts(Display * display)
+{
+       if (XHosts) {
+               XAddHosts(display, XHosts, HostAccessCount);
+               XFree((caddr_t) XHosts);
+       }
+       if (HostAccessState == False)
+               XDisableAccessControl(display);
+}
+
+/* Provides support for the DPMS options. */
+#ifdef USE_DPMS
+static void
+SetDPMS(Display * display, int nstandby, int nsuspend, int noff)
+{
+       static unsigned short standby = 0, suspend = 0, off = 0, flag = 0;
+       int         dummy;
+
+       if (DPMSQueryExtension(display, &dummy, &dummy)) {
+               if (!flag) {
+                       DPMSGetTimeouts(display, &standby, &suspend, &off);
+                       flag++;
+               }
+               if ((nstandby < 0) && (nsuspend < 0) && (noff < 0))
+                       DPMSSetTimeouts(display, standby, suspend, off);
+               else
+                       DPMSSetTimeouts(display,
+                                       (nstandby <= 0 ? 0 : (nstandby > MIN_DPMS ? nstandby : MIN_DPMS)),
+                                       (nsuspend <= 0 ? 0 : (nsuspend > MIN_DPMS ? nsuspend : MIN_DPMS)),
+                                       (noff <= 0 ? 0 : (noff > MIN_DPMS ? noff : MIN_DPMS)));
+       }
+}
+
+static int
+monitor_powered_on_p(Display *dpy)
+{
+  int result;
+  int event_number, error_number;
+  BOOL onoff = False;
+  CARD16 state;
+
+  if (!DPMSQueryExtension(dpy, &event_number, &error_number))
+    /* DPMS extention is not supported */
+    result = True;
+
+  else if (!DPMSCapable(dpy))
+    /* Monitor is incapable of DPMS */
+    result = True;
+
+  else
+    {
+      DPMSInfo(dpy, &state, &onoff);
+      if (!onoff)
+       /*  DPMS is disabled */
+       result = True;
+      else {
+       switch (state) {
+       case DPMSModeOn:      result = True;  break;
+       case DPMSModeStandby: result = False; break;
+       case DPMSModeSuspend: result = False; break;
+       case DPMSModeOff:     result = False; break;
+       default:              result = True;  break;
+       }
+      }
+    }
+  return result;
+}
+#else
+static int
+monitor_powered_on_p(Display *dpy)
+{
+  return 1;
+}
+#endif
+
+
+/*-
+ * Simple wrapper to get an asynchronous grab on the keyboard and mouse. If
+ * either grab fails, we sleep for one second and try again since some window
+ * manager might have had the mouse grabbed to drive the menu choice that
+ * picked "Lock Screen..".  If either one fails the second time we print an
+ * error message and exit.
+ */
+static void
+GrabKeyboardAndMouse(Display * display, Window window)
+{
+       Status      status;
+
+       status = XGrabKeyboard(display, window, True,
+                              GrabModeAsync, GrabModeAsync, CurrentTime);
+       if (status != GrabSuccess) {
+               (void) sleep(1);
+               status = XGrabKeyboard(display, window, True,
+                                 GrabModeAsync, GrabModeAsync, CurrentTime);
+
+               if (status != GrabSuccess) {
+                       (void) sprintf(error_buf,
+                               "%s, could not grab keyboard! (%d)\n",
+                               (strlen(ProgramName) < ERROR_BUF - 80) ?
+                               ProgramName : "xlock", status);
+                       error(error_buf);
+               }
+       }
+       status = XGrabPointer(display, window, True,
+               (unsigned int) AllPointerEventMask, GrabModeAsync,
+               GrabModeAsync, None, mycursor, CurrentTime);
+       if (status != GrabSuccess) {
+               (void) sleep(1);
+               status = XGrabPointer(display, window, True,
+                       (unsigned int) AllPointerEventMask, GrabModeAsync,
+                       GrabModeAsync, None, mycursor, CurrentTime);
+
+               if (status != GrabSuccess) {
+                       (void) sprintf(error_buf,
+                               "%s, could not grab pointer! (%d)\n",
+                               (strlen(ProgramName) < ERROR_BUF - 80) ?
+                               ProgramName : "xlock", status);
+                       error(error_buf);
+               }
+       }
+}
+
+/* Assuming that we already have an asynch grab on the pointer, just grab it
+   again with a new cursor shape and ignore the return code. */
+static void
+ChangeGrabbedCursor(Display * display, Window window, Cursor cursor)
+{
+       if (!debug && grabmouse && !inwindow && !inroot)
+               (void) XGrabPointer(display, window, True,
+                       (unsigned int) AllPointerEventMask, GrabModeAsync,
+                       GrabModeAsync, None, cursor, CurrentTime);
+}
+
+/*-
+ *    Return True of False indicating if the given window has changed
+ *    size relative to the window geometry cached in the mode_info
+ *    struct.  If the window handle given does not match the one in
+ *    the cache, or if the width/height are not the same, then True
+ *    is returned and the window handle in the cache is cleared.
+ *    This causes mode_info() to reload the window info next time
+ *    it is called.
+ *    This function has non-obvious side-effects.  I feel so dirty.  Rh
+ */
+
+static int
+window_size_changed(int scrn, Window window)
+{
+       XWindowAttributes xgwa;
+       ModeInfo   *mi = &modeinfo[scrn];
+
+       if (MI_WINDOW(mi) != window) {
+               MI_WINDOW(mi) = None;   /* forces reload on next mode_info() */
+               return (True);
+       } else {
+               (void) XGetWindowAttributes(dsp, window, &xgwa);
+               if ((MI_WIDTH(mi) != xgwa.width) ||
+                   (MI_HEIGHT(mi) != xgwa.height)) {
+                       MI_WINDOW(mi) = None;
+                       return (True);
+               }
+       }
+
+       return (False);
+}
+
+#ifdef FX
+void
+resetSize(ModeInfo * mi, Bool setGL)
+{
+       char       *mesa_3Dfx_env;
+       static int  width = 0, height = 0;
+
+       mesa_3Dfx_env = getenv("MESA_GLX_FX");
+       if (!mesa_3Dfx_env)
+               return;
+       if (tolower(mesa_3Dfx_env[0]) != 'f')
+               return;
+
+       /*
+        * This is not correct for multiscreens, but there are other problems
+        * here for multiscreens as well so I am not going bother
+        */
+       if (!width)
+               width = MI_WIDTH(mi);
+       if (!height)
+               height = MI_HEIGHT(mi);
+
+       if (setGL) {
+               MI_WIDTH(mi) = glwidth;
+               MI_HEIGHT(mi) = glheight;
+       } else {
+               MI_WIDTH(mi) = width;
+               MI_HEIGHT(mi) = height;
+       }
+       XResizeWindow(MI_DISPLAY(mi), MI_WINDOW(mi),
+                     MI_WIDTH(mi), MI_HEIGHT(mi));
+}
+#endif
+
+/*-
+ *    Return a pointer to an up-to-date ModeInfo struct for the given
+ *      screen, window and iconic mode.  Because the number of screens
+ *      is limited, and much of the information is screen-specific, this
+ *      function keeps static copies of ModeInfo structs are kept for
+ *      each screen.  This also eliminates redundant calls to the X server
+ *      to acquire info that does change.
+ */
+
+static ModeInfo *
+mode_info(Display * display, int scrn, Window window, int iconic)
+{
+       XWindowAttributes xgwa;
+       ModeInfo   *mi;
+
+       mi = &modeinfo[scrn];
+
+       if (MI_FLAG_NOT_SET(mi, WI_FLAG_INFO_INITTED)) {
+               /* This stuff only needs to be set once per screen */
+
+               (void) memset((char *) mi, 0, sizeof (ModeInfo));
+
+               MI_DISPLAY(mi) = display;
+               MI_SCREEN(mi) = scrn;
+               MI_REAL_SCREEN(mi) = scrn;      /* TODO, for multiscreen debugging */
+               MI_SCREENPTR(mi) = ScreenOfDisplay(display, scrn);
+               MI_NUM_SCREENS(mi) = screens;
+               MI_MAX_SCREENS(mi) = screens;   /* TODO, for multiscreen debugging */
+
+               MI_SCREENINFO(mi) = &Scr[scrn];
+
+               /* accessing globals here */
+               MI_SET_FLAG_STATE(mi, WI_FLAG_MONO,
+                            (mono || CellsOfScreen(MI_SCREENPTR(mi)) <= 2));
+               MI_SET_FLAG_STATE(mi, WI_FLAG_INWINDOW, inwindow);
+               MI_SET_FLAG_STATE(mi, WI_FLAG_INROOT, inroot);
+               MI_SET_FLAG_STATE(mi, WI_FLAG_NOLOCK, nolock);
+#ifdef USE_DTSAVER
+               MI_SET_FLAG_STATE(mi, WI_FLAG_INSTALL, install && !inroot && !dtsaver);
+#else
+               MI_SET_FLAG_STATE(mi, WI_FLAG_INSTALL, install && !inroot);
+#endif
+               MI_SET_FLAG_STATE(mi, WI_FLAG_DEBUG, debug);
+               MI_SET_FLAG_STATE(mi, WI_FLAG_USE3D, use3d &&
+                           !(mono || CellsOfScreen(MI_SCREENPTR(mi)) <= 2));
+               MI_SET_FLAG_STATE(mi, WI_FLAG_VERBOSE, verbose);
+               MI_SET_FLAG_STATE(mi, WI_FLAG_FULLRANDOM, False);
+               MI_SET_FLAG_STATE(mi, WI_FLAG_WIREFRAME, wireframe);
+#ifdef USE_GL
+               MI_SET_FLAG_STATE(mi, WI_FLAG_FPS, showfps);
+#endif
+               MI_SET_FLAG_STATE(mi, WI_FLAG_INFO_INITTED, True);
+               MI_IS_DRAWN(mi) = False;
+       }
+       if (MI_WINDOW(mi) != window) {
+               MI_WINDOW(mi) = window;
+
+               (void) XGetWindowAttributes(display, window, &xgwa);
+
+               MI_WIDTH(mi) = xgwa.width;
+               MI_HEIGHT(mi) = xgwa.height;
+       }
+       MI_SET_FLAG_STATE(mi, WI_FLAG_ICONIC, iconic);
+
+       MI_DELTA3D(mi) = delta3d;
+
+       MI_DELAY(mi) = delay;   /* globals */
+       MI_COUNT(mi) = count;
+       MI_CYCLES(mi) = cycles;
+       MI_SIZE(mi) = size;
+       MI_NCOLORS(mi) = ncolors;
+       MI_SATURATION(mi) = saturation;
+       MI_BITMAP(mi) = bitmap;
+       return (mi);
+}
+
+#ifdef GLOBAL_UNLOCK
+
+extern char *text_guser;
+extern char global_user[PASSLENGTH];
+extern void checkUser(char *buffer);
+static int unamex = 0, unamey = 0;
+#define LOG_FACILITY    LOG_LOCAL2
+#define LOG_LEVEL       LOG_INFO
+
+
+static int
+inform()
+{
+       /*
+       - the time, in date(1) style, is generated with a combination of the
+         time(2) and ctime(3C) system calls.
+       - the owner of the xlock process is learned with getlogin(3C).
+       - global_user is a global character array  that holds the username
+         of the person wishing to unlock the display.
+       - the hostname is learned with gethostname(2).
+       - the syslog(3B) call uses the syslog facility to log
+         happenings at LOG_LEVEL to LOG_FACILITY
+       - yes, a system(3S) call is used...
+       - I never said it was pretty.
+
+       */
+
+       char Mail[256];
+       time_t unlock_time;
+
+       /* learn what time it is and what host we are on */
+       time(&unlock_time);
+
+#if defined( HAVE_SYSLOG_H ) /* && defined( USE_SYSLOG ) */
+       /* log this event to syslogd as defined */
+       syslog(LOG_FACILITY | LOG_LEVEL, "%s: %s unlocked %s's display",
+         ProgramName, global_user, getlogin());
+#endif
+       /* if (mailCmd && mailCmd[0]) { */
+               /* build a string suitable for use in system(3S) */
+               (void) sprintf(Mail, "%s -s \"%s:\" %s << EOF\n %s unlocked "
+                       "%s's display on %s\n EOF",
+                       /* Want the mail with the subject line control */
+#if defined( SYSV ) || defined( SVR4 ) || ( __VMS_VER >= 70000000 )
+                       "/usr/ucb/mail" ,
+#else
+                       "/usr/bin/mail" ,
+#endif
+                       ProgramName, getlogin(),
+                       global_user, hostname, ctime(&unlock_time));
+
+               if (debug)
+                       (void) printf("%s\n", Mail);
+               (void) system(Mail);
+       /* } */
+}
+#endif
+
+/* Restore all grabs, reset screensaver, restore colormap, close connection. */
+void
+finish(Display * display, Bool closeDisplay)
+{
+       int         scrn;
+
+       for (scrn = startscreen; scrn < screens; scrn++) {
+               if (Scr[scrn].window != None) {
+                       release_last_mode(mode_info(display, scrn, Scr[scrn].window, False));
+               }
+               if (Scr[scrn].icon != None) {
+                       release_last_mode(mode_info(display, scrn, Scr[scrn].icon, True));
+               }
+       }
+#ifdef ORIGINAL_XPM_PATCH
+       if (mail_xpmimg)
+               (void) free((void *) mail_xpmimg);
+       if (nomail_xpmimg)
+               (void) free((void *) nomail_xpmimg);
+#endif
+
+       XSync(display, False);
+#ifdef USE_VROOT
+       if (inroot)
+               XClearWindow(display, Scr[startscreen].window);
+#endif
+
+#ifdef GLOBAL_UNLOCK
+       /* Check to see if the owner is doing the unlocking themselves,
+       and if not then inform the display owner of who is unlocking */
+
+       if (strcmp(global_user, getlogin()) != 0)
+               inform();
+#endif
+
+       if (!nolock && !allowaccess) {
+               if (grabserver)
+                       XUngrabServer(display);
+               XUngrabHosts(display);
+       }
+       XUngrabPointer(display, CurrentTime);
+       XUngrabKeyboard(display, CurrentTime);
+       if (!enablesaver && !nolock) {
+               XSetScreenSaver(display, sstimeout, ssinterval, ssblanking, ssexposures);
+       }
+       XFlush(display);
+#if 0
+/* Report that this gives "bad file descriptor" on XFree86 4.x */
+#ifndef __sgi
+  /*-
+   * The following line seems to cause a core dump on the SGI.
+   * More work is needed on the cleanup code.
+   */
+       if (closeDisplay)
+               (void) XCloseDisplay(display);
+#endif
+#endif
+#ifdef VMS
+       (void) nice(0);
+#endif
+#ifdef USE_VTLOCK
+       /* EL - RCS : Unlock VT switching */
+       if (vtlock && vtlocked)
+               dovtunlock();
+#endif
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static int
+xio_error(Display * d)
+{
+#ifdef USE_DTSAVER
+       if (dtsaver) {          /* this is normal when run as -dtsaver */
+               /* X connection to :0.0 broken (explicit kill or server shutdown). */
+               exit(0);
+       }
+#endif
+       (void) sprintf(error_buf,
+               "%s, xio_error\n",
+               (strlen(ProgramName) < ERROR_BUF - 80) ?
+               ProgramName : "xlock");
+       error(error_buf);
+       return ((debug) ? 0 : 1);       /* suppress message unless debugging */
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Convenience function for drawing text */
+static void
+putText(Display * display, Window window, GC gc,
+       const char *string, int bold, int left, int *px, int *py)
+                               /* which window */
+                               /* gc */
+                               /* text to write */
+                               /* 1 = make it bold */
+                               /* left edge of text */
+                               /* current x and y, input & return */
+{
+#define PT_BUFSZ 2048
+       char        buf[PT_BUFSZ], *p, *s;
+       int         x = *px, y = *py, last, len;
+
+       (void) strncpy(buf, string, PT_BUFSZ);
+       buf[PT_BUFSZ - 1] = 0;
+
+       p = buf;
+       last = 0;
+       for (;;) {
+               s = p;
+               for (; *p; ++p)
+                       if (*p == '\n')
+                               break;
+               if (!*p)
+                       last = 1;
+               *p = 0;
+
+               if ((len = strlen(s))) {        /* yes, "=", not "==" */
+                       (void) XDrawImageString(display, window, gc, x, y, s, len);
+                       if (bold)
+                               (void) XDrawString(display, window, gc, x + 1, y, s, len);
+               }
+               if (!last) {
+                       y += font->ascent + font->descent + 2;
+                       x = left;
+               } else {
+                       if (len)
+                               x += XTextWidth(font, s, len);
+                       break;
+               }
+               p++;
+       }
+       *px = x;
+       *py = y;
+}
+
+#ifdef JP
+#include "xlock-msg-jp.h"
+#endif
+
+static void
+statusUpdate(int isnew, int scr)
+{
+       int         left, x, y, len;
+       char        buf[1024];
+       XWindowAttributes xgwa;
+       static int  last_time;
+
+#ifdef USE_BUTTON_LOGOUT
+       int         ysave;
+       static int  made_button, last_tried_lo = 0;
+
+#endif /* USE_BUTTON_LOGOUT */
+
+       len = (int) (seconds() - start_time) / 60;
+
+#ifdef USE_BUTTON_LOGOUT
+       if (tried_logout && !last_tried_lo) {
+               last_tried_lo = 1;
+               isnew = 1;
+#ifdef USE_AUTO_LOGOUT
+               logoutAuto = 0;
+#endif
+       }
+       if (isnew)
+               made_button = 0;
+#endif /* USE_BUTTON_LOGOUT */
+
+       if (isnew || last_time != len)
+               last_time = len;
+       else
+               return;
+
+       (void) XGetWindowAttributes(dsp, Scr[scr].window, &xgwa);
+       x = left = timex;
+       y = timey;
+
+       if (timeelapsed) {
+               if (len < 60)
+                       (void) sprintf(buf,
+#ifdef DE
+                                      "Seit %d Minute%s gesperrt.                                  \n",
+                                      len, len <= 1 ? "" : "n"
+#elif defined FR
+                                      "%d minute%s écoulée%s depuis verrouillage.                      \n",
+                               len, len <= 1 ? "" : "s", len <= 1 ? "" : "s"
+#elif defined NL
+                                      "%d minute%s op slot.                                        \n",
+                                      len, len <= 1 ? "" : "n"
+#elif defined JP
+                                      JP_TIME_ELAPSSED_MINUTES,
+                                      len
+#else
+                                      "%d minute%s elapsed since locked.                           \n",
+                                      len, len <= 1 ? "" : "s"
+#endif
+                               );
+               else
+                       (void) sprintf(buf,
+#ifdef DE
+                                      "Seit %d:%02d Stunden gesperrt.                                 \n",
+                                      len / 60, len % 60
+#elif defined FR
+                                      "%d:%02d heures écoulée%s depuis verouillage.                        \n",
+                              len / 60, len % 60, (len / 60) <= 1 ? "" : "s"
+#elif defined NL
+                                      "%d:%02d uur op slot.                                           \n",
+                                      len / 60, len % 60
+#elif defined JP
+                                      JP_TIME_ELAPSSED_HOURS,
+                                      len / 60, len % 60
+#else
+                                      "%d:%02d hours elapsed since locked.                            \n",
+                                      len / 60, len % 60
+#endif
+                               );
+               putText(dsp, Scr[scr].window, Scr[scr].textgc, buf, False, left, &x, &y);
+       }
+#ifdef USE_BUTTON_LOGOUT
+       if (enable_button) {
+               if (logoutButton > len) {
+                       int         tmp = logoutButton - len;
+
+                       if (tmp < 60)
+                               (void) sprintf(buf,
+#ifdef DE
+                                              "In %d Minute%s erscheint der Auslogger.                       \n",
+                                              tmp, (tmp <= 1) ? "" : "n"
+#elif defined FR
+                                              "%d minute%s jusqu'à apparition du bouton lougout.             \n",
+                                              tmp, (tmp <= 1) ? "" : "s"
+#elif defined NL
+                                              "Over %d minute%s verschijnt de logout knop.                   \n",
+                                              tmp, (tmp <= 1) ? "" : "n"
+#elif defined JP
+                                              JP_BUTTON_MINUTES,
+                                              tmp
+#else
+                                              "%d minute%s until the public logout button appears.           \n",
+                                              tmp, (tmp <= 1) ? "" : "s"
+#endif
+                                       );
+                       else
+                               (void) sprintf(buf,
+#ifdef DE
+                                              "In %d:%02d Stunden erscheint der Auslogger.                 \n",
+#elif defined FR
+                                              "%d:%02d heures jusqu'à apparition du bouton lougout         \n",
+#elif defined NL
+                                              "Over %d:%02d uur verschijnt de logout knop.                 \n",
+#elif defined JP
+                                              JP_BUTTON_HOURS,
+#else
+                                              "%d:%02d hours until the public logout button appears.       \n",
+#endif
+                                              tmp / 60, tmp % 60);
+                       putText(dsp, Scr[scr].window, Scr[scr].textgc, buf, False, left, &x, &y);
+               } else {
+                       /* Erase previous logout button message */
+                       putText(dsp, Scr[scr].window, Scr[scr].textgc,
+                               "                                                             \n",
+                               False, left, &x, &y);
+                       if (!made_button || (isnew && tried_logout)) {
+                               made_button = 1;
+                               ysave = y;
+
+                               y += font->ascent + font->descent + 8;  /* Leave a gap for validating */
+                               XUnmapWindow(dsp, Scr[scr].button);
+                               XSetForeground(dsp, Scr[scr].gc, Scr[scr].bg_pixel);
+                               XFillRectangle(dsp, Scr[scr].window, Scr[scr].gc, left, y,
+                                              xgwa.width - left,
+                                    5 + 2 * (font->ascent + font->descent));
+                               XSetForeground(dsp, Scr[scr].gc, Scr[scr].fg_pixel);
+
+                               if (tried_logout) {
+                                       putText(dsp, Scr[scr].window, Scr[scr].textgc, logoutFailedString,
+                                               True, left, &x, &y);
+                               } else {
+                                       XMoveWindow(dsp, Scr[scr].button, left, y);
+                                       XMapWindow(dsp, Scr[scr].button);
+                                       XRaiseWindow(dsp, Scr[scr].button);
+                                       (void) sprintf(buf, " %s ", logoutButtonLabel);
+                                       XSetForeground(dsp, Scr[scr].gc, Scr[screen].white_pixel);
+                                       (void) XDrawString(dsp, Scr[scr].button, Scr[scr].gc,
+                                                          0, font->ascent + 1, buf, strlen(buf));
+                                       XSetForeground(dsp, Scr[scr].gc, Scr[scr].fg_pixel);
+                                       y += 5 + 2 * font->ascent + font->descent;
+                                       putText(dsp, Scr[scr].window, Scr[scr].textgc, logoutButtonHelp,
+                                               False, left, &x, &y);
+                               }
+                               y = ysave;
+                               x = left;
+                       }
+               }
+       }
+#endif /* USE_BUTTON_LOGOUT */
+#ifdef USE_AUTO_LOGOUT
+       if (logoutAuto) {
+               int         tmp = logoutAuto - len;
+
+               if (tmp < 60)
+                       (void) sprintf(buf,
+#ifdef FR
+                                      "%d minute%s jusqu'à l'auto-logout.    \n",
+                                      tmp, (tmp <= 1) ? "" : "s"
+#elif defined JP
+                                      JP_AUTOLOGOUT_MINUTES,
+                                      tmp
+#else
+                                      "%d minute%s until auto-logout.    \n",
+                                      tmp, (tmp <= 1) ? "" : "s"
+#endif
+                               );
+               else
+                       (void) sprintf(buf,
+#ifdef FR
+                                      "%d:%02d heure%s jusqu'à auto-logout.  \n",
+                                      tmp / 60, tmp % 60, (tmp / 60) <= 1 ? "" : "s"
+#elif defined JP
+                                      JP_AUTOLOGOUT_HOURS,
+                                      tmp / 60, tmp % 60
+#else
+                                      "%d:%02d hours until auto-logout.  \n",
+                                      tmp / 60, tmp % 60
+#endif
+                               );
+               putText(dsp, Scr[scr].window, Scr[scr].textgc, buf, False, left, &x, &y);
+       }
+#endif /* USE_AUTO_LOGOUT */
+}
+
+#ifdef USE_AUTO_LOGOUT
+static void
+checkLogout(Display * display)
+{
+       if (nolock || tried_logout || !logoutAuto)
+               return;
+       if (logoutAuto * 60 < (int) (seconds() - start_time)) {
+               tried_logout = 1;
+               logoutAuto = 0;
+               logoutUser(display
+#ifdef CLOSEDOWN_LOGOUT
+ , screens
+#endif
+               );
+       }
+}
+
+#endif /* USE_AUTO_LOGOUT */
+
+#ifndef USE_OLD_EVENT_LOOP
+
+/* subtract timer t2 from t1, return result in t3.  Result is not allowed to
+   go negative, set to zero if result underflows */
+
+static
+void
+sub_timers(struct timeval *t1, struct timeval *t2, struct timeval *t3)
+{
+       struct timeval tmp;
+       int         borrow = 0;
+
+       if (t1->tv_usec < t2->tv_usec) {
+               borrow++;
+               tmp.tv_usec = (1000000 + t1->tv_usec) - t2->tv_usec;
+       } else {
+               tmp.tv_usec = t1->tv_usec - t2->tv_usec;
+       }
+
+       /* Be careful here, timeval fields may be unsigned.  To avoid
+          underflow in an unsigned int, add the borrow value to the
+          subtrahend for the relational test.  Same effect, but avoids the
+          possibility of a negative intermediate value. */
+       if (t1->tv_sec < (t2->tv_sec + borrow)) {
+               tmp.tv_usec = tmp.tv_sec = 0;
+       } else {
+               tmp.tv_sec = t1->tv_sec - t2->tv_sec - borrow;
+       }
+
+       *t3 = tmp;
+}
+
+/* return 0 on event recieved, -1 on timeout */
+static int
+runMainLoop(int maxtime, int iconscreen)
+{
+       static int  lastdelay = -1, lastmaxtime = -1;
+       int         fd = ConnectionNumber(dsp), r;
+        int         poweron=True;
+       struct timeval sleep_time, first, repeat, elapsed, tmp;
+       fd_set      reads;
+       unsigned long started;
+
+#ifdef USE_NEW_EVENT_LOOP
+       struct timeval loopStart, timeSinceLoop;
+       unsigned long lastIter = 0, desiredIter = 0;
+
+       GETTIMEOFDAY(&loopStart);
+#endif
+
+       first.tv_sec = 0;
+       first.tv_usec = 0;
+       elapsed.tv_sec = 0;
+       elapsed.tv_usec = 0;
+       repeat.tv_sec = delay / 1000000;
+       repeat.tv_usec = delay % 1000000;
+
+       started = seconds();
+
+       for (;;) {
+               poweron= monitor_powered_on_p(dsp);
+                if(!poweron) usleep(100000);
+
+               if (signalUSR1 || signalUSR2) {
+                       int         i;
+
+                       if (signalUSR1) {
+#ifdef DEBUG
+                               (void) printf("switch to mode %s\n", "blank");
+#endif
+                               for (i = 0; i < numprocs; i++) {
+                                       if (!strcmp(LockProcs[i].cmdline_arg, "blank")) {
+                                               set_default_mode(&LockProcs[i]);
+                                               break;
+                                       }
+                               }
+                       } else {
+#ifdef DEBUG
+                               (void) printf("switch to mode %s\n", old_default_mode);
+#endif
+                               for (i = 0; i < numprocs; i++) {
+                                       if (!strcmp(LockProcs[i].cmdline_arg, old_default_mode)) {
+                                               set_default_mode(&LockProcs[i]);
+                                               break;
+                                       }
+                               }
+                       }
+
+                       for (screen = startscreen; screen < screens; screen++) {
+                               call_change_hook((LockStruct *) NULL,
+                                                mode_info(dsp, screen, Scr[screen].window, False));
+                       }
+
+                       signalUSR1 = signalUSR2 = 0;
+               }
+               if (delay != lastdelay || maxtime != lastmaxtime) {
+                       if (!delay || (maxtime && delay / 1000000 > maxtime)) {
+                               repeat.tv_sec = maxtime;
+                               repeat.tv_usec = 0;
+                       } else {
+                               repeat.tv_sec = delay / 1000000;
+                               repeat.tv_usec = delay % 1000000;
+                       }
+                       first = repeat;
+                       lastdelay = delay;
+                       lastmaxtime = maxtime;
+                       sleep_time = first;
+               } else {
+                       sleep_time = repeat;
+               }
+
+               /* subtract time spent doing last loop iteration */
+               sub_timers(&sleep_time, &elapsed, &sleep_time);
+
+               /* (void) */ FD_ZERO(&reads);
+               FD_SET(fd, &reads);
+#ifdef VMS
+               /* Seems to work for UNIX to but... */
+               FD_SET(fd + 1, &reads);
+#else
+               FD_SET(fd, &reads);
+#endif
+
+#if DCE_PASSWD
+               r = _select_sys(fd + 1,
+                       (fd_set *) & reads, (fd_set *) NULL, (fd_set *) NULL,
+                               (struct timeval *) &sleep_time);
+#else
+#if defined( __cplusplus ) || defined( c_plusplus )
+               r = select(fd + 1,
+                       (fd_set *) & reads, (fd_set *) NULL, (fd_set *) NULL,
+                          (struct timeval *) &sleep_time);
+#else
+               r = select(fd + 1,
+                          (void *) &reads, (void *) NULL, (void *) NULL,
+                          (struct timeval *) &sleep_time);
+#endif
+#endif
+
+               if (r == 1)
+                       return 0;
+               if (r > 0 || (r == -1 && errno != EINTR))
+                       (void) fprintf(stderr,
+                                      "Unexpected select() return value: %d (errno=%d)\n", r, errno);
+
+               GETTIMEOFDAY(&tmp);     /* get time before calling mode proc */
+
+#ifdef USE_NEW_EVENT_LOOP
+               if (delay == 0) {
+                       desiredIter = lastIter + 1;
+               } else {
+                       sub_timers(&tmp, &loopStart, &timeSinceLoop);
+                       desiredIter =
+                               (timeSinceLoop.tv_usec / delay) +
+                               (((timeSinceLoop.tv_sec % delay) * 1000000) / delay) +
+                               (timeSinceLoop.tv_sec / delay) * 1000000;
+               }
+               while (lastIter != desiredIter) {
+                       ++lastIter;
+#endif
+
+                       for (screen = startscreen; screen < screens; screen++) {
+                               Window      cbwin;
+                               Bool        iconic;
+                               ModeInfo   *mi;
+
+                               if (screen == iconscreen) {
+                                       cbwin = Scr[screen].icon;
+                                       iconic = True;
+                               } else {
+                                       cbwin = Scr[screen].window;
+                                       iconic = False;
+                               }
+                               if (cbwin != None && poweron) {
+                                       mi = mode_info(dsp, screen, cbwin, iconic);
+                                       call_callback_hook((LockStruct *) NULL, mi);
+                               }
+                       }
+                       
+                       if(poweron) XSync(dsp, False);
+                       else usleep(100000);
+
+                       /* check for events received during the XSync() */
+                       if (QLength(dsp)) {
+                               return 0;
+                       }
+                       if (maxtime && ((int) (seconds() - started) > maxtime)) {
+                               return -1;
+                       }
+#ifdef USE_NEW_EVENT_LOOP
+               }
+#endif
+               /* if (mindelay) usleep(mindelay); */
+
+               /* get the time now, figure how long it took */
+               GETTIMEOFDAY(&elapsed);
+               sub_timers(&elapsed, &tmp, &elapsed);
+       }
+}
+
+#endif /* !USE_OLD_EVENT_LOOP */
+
+static int
+ReadXString(char *s, int slen
+#ifdef GLOBAL_UNLOCK
+  , Bool pass
+#endif
+)
+{
+       XEvent      event;
+       char        keystr[20];
+       char        c;
+       int         i;
+       int         bp;
+       int         len;
+       int         thisscreen = screen;
+       char        pwbuf[PASSLENGTH];
+       int         first_key = 1;
+
+       for (screen = startscreen; screen < screens; screen++)
+               if (thisscreen == screen) {
+                       call_init_hook((LockStruct *) NULL,
+                            mode_info(dsp, screen, Scr[screen].icon, True));
+               } else {
+                       call_init_hook((LockStruct *) NULL,
+                         mode_info(dsp, screen, Scr[screen].window, False));
+               }
+       statusUpdate(True, thisscreen);
+       bp = 0;
+       *s = 0;
+
+       for (;;) {
+               unsigned long lasteventtime = seconds();
+
+               while (!XPending(dsp)) {
+#ifdef USE_OLD_EVENT_LOOP
+                       for (screen = startscreen; screen < screens; screen++)
+                               if (thisscreen == screen)
+                                       call_callback_hook(NULL, mode_info(dsp, screen,
+                                                   Scr[screen].icon, True));
+                               else
+                                       call_callback_hook(NULL, mode_info(dsp, screen,
+                                                Scr[screen].window, False));
+                       statusUpdate(False, thisscreen);
+                       XSync(dsp, False);
+                       (void) usleep(delay);
+#else
+                       statusUpdate(False, thisscreen);
+                       if (runMainLoop(MIN(timeout, 5), thisscreen) == 0)
+                               break;
+#endif
+
+                       if (timeout < (int) (seconds() - lasteventtime)) {
+                               screen = thisscreen;
+                               return 1;
+                       }
+               }
+
+               screen = thisscreen;
+               (void) XNextEvent(dsp, &event);
+
+               /*
+                * This event handling code should be unified with the
+                * similar code in justDisplay().
+                */
+               switch (event.type) {
+                       case KeyPress:
+                               len = XLookupString((XKeyEvent *) & event, keystr, 20, NULL, NULL);
+                               for (i = 0; i < len; i++) {
+                                       c = keystr[i];
+                                       switch (c) {
+                                               case 8: /* ^H */
+                                               case 127:       /* DEL */
+                                                       if (bp > 0)
+                                                               bp--;
+                                                       break;
+                                               case 10:        /* ^J */
+                                               case 13:        /* ^M */
+                                                       if (first_key && usefirst)
+                                                               break;
+                                                       s[bp] = '\0';
+                                                       return 0;
+                                               case 21:        /* ^U */
+                                                       bp = 0;
+                                                       break;
+                                               default:
+                                                       s[bp] = c;
+                                                       if (bp < slen - 1)
+                                                               bp++;
+                                                       else
+                                                               XSync(dsp, True);       /* flush input buffer */
+                                       }
+                               }
+                               XSetForeground(dsp, Scr[screen].gc, Scr[screen].bg_pixel);
+#ifdef GLOBAL_UNLOCK
+                               if (!pass) {
+                                       XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                                                unamex, unamey - font->ascent,
+                                              XTextWidth(font, s, slen),
+                                              font->ascent + font->descent);
+                                       (void) XDrawString(dsp, Scr[screen].window, Scr[screen].textgc,
+                                                   unamex, unamey, s, bp);
+                               } else
+#endif
+                               if (echokeys) {
+                                       (void) memset((char *) pwbuf, '?', slen);
+                                       XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                                                passx, passy - font->ascent,
+                                              XTextWidth(font, pwbuf, slen),
+                                              font->ascent + font->descent);
+                                       (void) XDrawString(dsp, Scr[screen].window, Scr[screen].textgc,
+                                                   passx, passy, pwbuf, bp);
+                               }
+                               /* eat all events if there are more than
+                                  enough pending... this keeps the Xlib event
+                                  buffer from growing larger than all
+                                  available memory and crashing xlock. */
+                               if (XPending(dsp) > 100) {      /* 100 is arbitrarily
+                                                                  big enough */
+                                       register Status status;
+
+                                       do {
+                                               status = XCheckMaskEvent(dsp,
+                                                                        KeyPressMask | KeyReleaseMask, &event);
+                                       } while (status);
+                                       XBell(dsp, 100);
+                               }
+                               break;
+
+                       case MotionNotify:
+                               if (!mousemotion)
+                                       break;
+                               /* fall through on last mouse event */
+                       case ButtonPress:
+                               if (((XButtonEvent *) & event)->window == Scr[screen].icon) {
+                                       return 1;
+                               }
+#ifdef USE_BUTTON_LOGOUT
+                               if (((XButtonEvent *) & event)->window == Scr[screen].button) {
+                                       XSetFunction(dsp, Scr[screen].gc, GXxor);
+                                       XSetForeground(dsp, Scr[screen].gc, Scr[screen].fg_pixel);
+                                       XFillRectangle(dsp, Scr[screen].button, Scr[screen].gc,
+                                                      0, 0, 500, 100);
+                                       XSync(dsp, False);
+                                       tried_logout = 1;
+                                       logoutUser(dsp
+#ifdef CLOSEDOWN_LOGOUT
+ , screens
+#endif
+                                       );
+                                       XSetFunction(dsp, Scr[screen].gc, GXcopy);
+                               }
+#endif
+                               break;
+
+                       case Expose:
+                               if (event.xexpose.count != 0)
+                                       break;
+                               /* fall through on last expose event */
+                       case VisibilityNotify:
+                               /* next line for -geometry */
+                               if (event.xvisibility.state != VisibilityUnobscured) {
+                                       /* window was restacked or exposed */
+                                       if (!debug && !inwindow)
+                                               XRaiseWindow(dsp, event.xvisibility.window);
+                                       call_refresh_hook((LockStruct *) NULL,
+                                                         mode_info(dsp, screen, Scr[screen].window, False));
+#ifndef USE_WINDOW_VISIBILITY
+                                       s[0] = '\0';
+                                       return 1;
+#endif
+                               }
+                               break;
+                       case ConfigureNotify:
+                               /* next line for -geometry */
+                               if (!fullscreen)
+                                       break;
+                               /* window config changed */
+                               if (!debug && !inwindow) {
+                                       XRaiseWindow(dsp, event.xconfigure.window);
+                                       fixColormap(mode_info(dsp, screen, Scr[screen].window, False), ncolors,
+                                               saturation, mono, install, inroot, inwindow, verbose);
+                               }
+                               if (window_size_changed(screen, Scr[screen].window)) {
+                                       call_init_hook((LockStruct *) NULL,
+                                                      mode_info(dsp, screen, Scr[screen].window, False));
+                               } else if (install)
+                                       /* next line : refresh would be logical. But some modes
+                                        * look weird when continuing from an erased screen */
+                                       call_refresh_hook((LockStruct *) NULL,
+                                               mode_info(dsp, screen, Scr[screen].window, False));
+
+                               s[0] = '\0';
+                               return 1;
+                       case KeymapNotify:
+                       case KeyRelease:
+                       case ButtonRelease:
+                       case LeaveNotify:
+                       case EnterNotify:
+                       case NoExpose:
+                       case CirculateNotify:
+                       case DestroyNotify:
+                       case GravityNotify:
+                       case MapNotify:
+                       case ReparentNotify:
+                       case UnmapNotify:
+                               break;
+
+                       default:
+                               (void) fprintf(stderr, "%s: unexpected event: %d\n",
+                                              ProgramName, event.type);
+                               break;
+               }
+               first_key = 0;
+       }
+}
+
+void
+modeDescription(ModeInfo * mi)
+{
+       int         left, x, y;
+       int         scrn = MI_SCREEN(mi);
+       XWindowAttributes xgwa;
+
+       (void) XGetWindowAttributes(dsp, Scr[scrn].window, &xgwa);
+
+       x = left = Scr[scrn].iconpos.x;
+       y = Scr[scrn].iconpos.y - font->ascent + font->descent + 2;
+
+       XSetForeground(dsp, Scr[scrn].gc, Scr[scrn].bg_pixel);
+       XFillRectangle(dsp, Scr[scrn].window, Scr[scrn].gc,
+                      x, y - font->ascent,
+                      xgwa.width - x, font->ascent + font->descent + 2);
+
+       putText(dsp, Scr[scrn].window, Scr[scrn].textgc, MI_NAME(mi),
+               True, left, &x, &y);
+       putText(dsp, Scr[scrn].window, Scr[scrn].textgc, ": ", True, left, &x, &y);
+       putText(dsp, Scr[scrn].window, Scr[scrn].textgc, MI_DESC(mi),
+               False, left, &x, &y);
+       putText(dsp, Scr[scrn].window, Scr[scrn].textgc, "\n", False, left, &x, &y);
+}
+
+static int
+getPassword(void)
+{
+       XWindowAttributes xgwa;
+       int         x, y, left, done, remy;
+       char        buffer[PASSLENGTH];
+       char      **planp;
+       char       *hostbuf = NULL;
+       ModeInfo   *mi = &modeinfo[screen];
+
+#ifdef FX
+       Bool        mesa_3Dfx_fullscreen;
+       char       *mesa_3Dfx_env;
+
+       mesa_3Dfx_env = getenv("MESA_GLX_FX");
+       if (mesa_3Dfx_env)
+               if (tolower(mesa_3Dfx_env[0] == 'f')) {
+                       /* disabling fullscreen HW 3dfx rendering to
+                          allow iconic mode window. */
+                       mesa_3Dfx_fullscreen = True;
+                       unsetenv("MESA_GLX_FX");
+               }
+#endif
+#ifdef VMS
+       (void) nice(0);
+#endif
+       if (!fullscreen)
+               XConfigureWindow(dsp, Scr[screen].window, sizeconfiguremask,
+                                &(Scr[screen].fullsizeconfigure));
+
+
+       (void) XGetWindowAttributes(dsp, Scr[screen].window, &xgwa);
+
+       ChangeGrabbedCursor(dsp, Scr[screen].window,
+                           XCreateFontCursor(dsp, XC_left_ptr));
+
+       MI_CLEARWINDOWCOLOR(mi, Scr[screen].bg_pixel);
+       XMapWindow(dsp, Scr[screen].icon);
+       XRaiseWindow(dsp, Scr[screen].icon);
+
+       if (description)
+               modeDescription(mi);
+
+       x = left = Scr[screen].iconpos.x + iconwidth + font->max_bounds.width;
+       y = Scr[screen].iconpos.y + font->ascent;
+
+       if ((hostbuf = (char *) malloc(strlen(user) + strlen(hostname) +
+                       2)) != NULL) {
+               (void) sprintf(hostbuf, "%s@%s", user, hostname);
+
+               putText(dsp, Scr[screen].window, Scr[screen].textgc, text_user, True, left, &x, &y);
+               putText(dsp, Scr[screen].window, Scr[screen].textgc, hostbuf, False, left, &x, &y);
+               (void) free((void *) hostbuf);
+       }
+       if (displayname && displayname[0] != ':') {
+               char       *displaybuf = NULL;
+               char       *colon = (char *) strchr(displayname, ':');
+               int         n = colon - displayname;
+
+               if ((displaybuf = (char *) malloc(n + 1)) != NULL) {
+                       (void) strncpy(displaybuf, displayname, n);
+                       displaybuf[n] = '\0';
+                       if (remote && n
+                           && strcmp(displaybuf, "unix") != 0
+                           && strcmp(displaybuf, "localhost") != 0
+                           && strcmp(displaybuf, hostname) != 0) {
+                               putText(dsp, Scr[screen].window, Scr[screen].textgc, "  Display: ", True, left, &x, &y);
+                               putText(dsp, Scr[screen].window, Scr[screen].textgc, displaybuf, False, left, &x, &y);
+                       }
+                       (void) free((void *) displaybuf);
+               }
+       }
+       putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n", False, left, &x, &y);
+
+#ifdef GLOBAL_UNLOCK
+       putText(dsp, Scr[screen].window, Scr[screen].textgc, text_guser,
+               True, left, &x, &y);
+       putText(dsp, Scr[screen].window, Scr[screen].textgc, " ",
+               False, left, &x, &y);
+               unamex = x;
+                unamey = y;
+       putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n", False, left, &x, &y);
+#endif
+#ifdef SAFEWORD
+       if (checkDynamic()) {
+               pb = &pblock;
+               (void) memset((char *) &pblock, 0, sizeof (pblock));
+#if 0
+               (void) strcpy(pblock.uport, "custpb");
+               pblock.status = NO_STATUS;
+#endif
+               challx = x;
+               chally = y;
+               putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n\n",
+                       False, left, &x, &y);
+               pb->mode = CHALLENGE;
+               (void) strcpy(pb->id, user);
+               pbmain(pb);
+               if (pb->status != GOOD_USER) {
+                       chall[0] = 0;
+                       return 1;
+               }
+               if (pb->dynpwdf) {
+                       /* We do not really care if they also got a fixed password... */
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, text_dpass,
+                               True, left, &x, &y);
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, " ",
+                               False, left, &x, &y);
+                       passx = x;
+                       passy = y;
+               } else if (pb->fixpwdf) {
+                       /* In the unlikely event they only got a fixed password... */
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, text_fpass,
+                               True, left, &x, &y);
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, " ",
+                               False, left, &x, &y);
+                       passx = x;
+                       passy = y;
+               }
+       } else
+#endif
+       {
+               putText(dsp, Scr[screen].window, Scr[screen].textgc, text_pass, True, left, &x, &y);
+               putText(dsp, Scr[screen].window, Scr[screen].textgc, " ", False, left, &x, &y);
+
+               passx = x;
+               passy = y;
+       }
+       y += font->ascent + font->descent + 6;
+       if (y < Scr[screen].iconpos.y + iconheight + font->ascent + 12)
+               y = Scr[screen].iconpos.y + iconheight + font->ascent + 12;
+       x = left = Scr[screen].iconpos.x;
+       putText(dsp, Scr[screen].window, Scr[screen].textgc, text_info, False, left, &x, &y);
+       putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n", False, left, &x, &y);
+
+       timex = x;
+       timey = y;
+
+#ifdef USE_AUTO_LOGOUT
+       if (logoutAuto) {
+               y += font->ascent + font->descent + 2;
+       }
+#endif
+#ifdef USE_BUTTON_LOGOUT
+       if (enable_button) {
+               y += font->ascent + font->descent + 2;
+       }
+#endif
+       if (timeelapsed) {
+               y += font->ascent + font->descent + 2;
+       }
+       remy = y;
+
+       putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n", False, left, &x, &y);
+
+       y = Scr[screen].planpos.y;
+       if (*plantext) {
+               for (planp = plantext; *planp; ++planp) {
+#ifdef USE_MB
+                       y += mbRect.height + 2;
+#else
+                       y += planfont->ascent + planfont->descent + 2;
+#endif
+                       (void) XDrawString(dsp, Scr[screen].window, Scr[screen].plantextgc,
+                          Scr[screen].planpos.x, y, *planp, strlen(*planp));
+               }
+       }
+       XFlush(dsp);
+
+       if (mailCmd && mailCmd[0]) {
+#ifdef ORIGINAL_XPM_PATCH
+               XpmImage   *mbxpm;
+               mailboxInfo *mbi;
+               int         x, y;
+
+               if (system(mailCmd)) {
+                       mbxpm = nomail_xpmimg;
+                       mbi = &Scr[screen].mb.nomail;
+               } else {
+                       mbxpm = mail_xpmimg;
+                       mbi = &Scr[screen].mb.mail;
+               }
+
+               if (mbxpm) {
+                       x = (DisplayWidth(dsp, screen) - mbxpm->width) / 2;
+                       y = (Scr[screen].planpos.y - 5) - mbxpm->height;
+                       XCopyArea(dsp, mbi->pixmap,
+                                 Scr[screen].window, Scr[screen].mb.mbgc,
+                                 0, 0,
+                                 mbxpm->width, mbxpm->height, x, y);
+               }
+#else
+               mailboxInfo *mbi;
+               int         mbx, mby;
+
+               if (system(mailCmd)) {
+                       mbi = &Scr[screen].mb.nomail;
+               } else {
+                       mbi = &Scr[screen].mb.mail;
+               }
+               if (mbi) {
+                       mbx = (DisplayWidth(dsp, screen) - mbi->width) / 2;
+                       mby = (Scr[screen].planpos.y - 5) - mbi->height;
+                       XSetTSOrigin(dsp, Scr[screen].mb.mbgc, mbx, mby);
+                       XSetStipple(dsp, Scr[screen].mb.mbgc, mbi->pixmap);
+                       XSetFillStyle(dsp, Scr[screen].mb.mbgc, FillOpaqueStippled);
+                       XFillRectangle(dsp, Scr[screen].window, Scr[screen].mb.mbgc,
+                              mbx, mby, mbi->width, mbi->height);
+               }
+#endif
+       }
+       done = False;
+       while (!done) {
+#ifdef USE_SOUND
+               if (sound && !got_invalid) {
+                       play_sound(infosound, verbose);
+               }
+               got_invalid = 0;
+#endif
+
+#ifdef SAFEWORD
+               pb->mode = CHALLENGE;
+               (void) strcpy(pb->id, user);
+               pbmain(pb);
+               if (pb->status != GOOD_USER) {
+                       chall[0] = 0;
+                       return 1;
+               }
+               left = x = challx;
+               y = chally;
+               if (strlen(pb->chal) > 0) {
+                       (void) strcpy(chall, pb->chal);
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, text_chall,
+                               True, left, &x, &y);
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, " ",
+                               False, left, &x, &y);
+                       XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                                      left + XTextWidth(font, text_chall, strlen(text_chall)),
+                                      y - font->ascent, XTextWidth(font, chall, strlen(chall)),
+                                      font->ascent + font->descent + 2);
+
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, chall,
+                               False, left, &x, &y);
+               }
+               putText(dsp, Scr[screen].window, Scr[screen].textgc, "\n",
+                       False, left, &x, &y);
+               if (pb->dynpwdf || pb->fixpwdf) {
+                       /* If they have a dynamic passwd we do not really care about
+                          the fixed password... */
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc,
+                               (pb->dynpwdf) ? text_dpass : text_fpass,
+                               True, left, &x, &y);
+                       putText(dsp, Scr[screen].window, Scr[screen].textgc, " ",
+                               False, left, &x, &y);
+                       passx = x;
+                       passy = y;
+               }
+#endif
+
+#ifdef GLOBAL_UNLOCK
+               if (ReadXString(global_user, PASSLENGTH, False))
+                       break;
+               (void) XDrawString(dsp, Scr[screen].window, Scr[screen].textgc,
+                       unamex, unamey,
+                       global_user, strlen(global_user));
+               checkUser(global_user);
+#endif
+               if (ReadXString(buffer, PASSLENGTH
+#ifdef GLOBAL_UNLOCK
+                   , True
+#endif
+                   ))
+                       break;
+               y = remy;
+
+               XSetForeground(dsp, Scr[screen].gc, Scr[screen].bg_pixel);
+#ifdef SAFEWORD
+               (void) strcpy(pb->dynpwd, buffer);
+               pb->mode = EVALUATE_ALL;
+               pbmain(pb);
+
+               done = (pb->status == PASS || pb->status == PASS_MASTER);
+               pb->mode = UPDATE_LOGS;
+               pbmain(pb);
+#else
+               XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                              Scr[screen].iconpos.x, y - font->ascent,
+                       XTextWidth(font, text_invalid, strlen(text_invalid)),
+                              font->ascent + font->descent + 2);
+
+               (void) XDrawString(dsp, Scr[screen].window, Scr[screen].textgc,
+                  Scr[screen].iconpos.x, y, text_valid, strlen(text_valid));
+               XFlush(dsp);
+
+               done = checkPasswd(buffer);
+
+
+               if (!done && !*buffer) {
+                       /* just hit return, and it was not his password */
+                       break;
+#if defined( HAVE_SYSLOG_H ) && defined( USE_SYSLOG )
+               } else if (!done) {
+                       /* bad password... log it... */
+                       (void) printf("failed unlock attempt on user %s\n", user);
+                       syslog(SYSLOG_NOTICE, "%s: failed unlock attempt on user %s\n",
+                              ProgramName, user);
+#endif
+               }
+#endif
+               /* clear plaintext password so you can not grunge around
+                  /dev/kmem */
+               (void) memset((char *) buffer, 0, sizeof (buffer));
+
+               if (done) {
+#ifdef USE_SOUND
+                       if (sound)
+                               play_sound(validsound, verbose);
+#endif
+                       XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                                    Scr[screen].iconpos.x, y - font->ascent,
+                       XTextWidth(font, text_invalid, strlen(text_invalid)),
+                                      font->ascent + font->descent + 2);
+
+                       (void) XDrawString(dsp, Scr[screen].window, Scr[screen].textgc,
+                                          Scr[screen].iconpos.x, y, text_valid, strlen(text_valid));
+                       XFlush(dsp);
+
+                       if (!fullscreen)
+                               XConfigureWindow(dsp, Scr[screen].window, sizeconfiguremask,
+                                                &minisizeconfigure);
+                       return 0;
+               } else {
+                       XSync(dsp, True);       /* flush input buffer */
+                       (void) sleep(1);
+                       XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                                    Scr[screen].iconpos.x, y - font->ascent,
+                           XTextWidth(font, text_valid, strlen(text_valid)),
+                                      font->ascent + font->descent + 2);
+                       (void) XDrawString(dsp, Scr[screen].window, Scr[screen].textgc,
+                                          Scr[screen].iconpos.x, y, text_invalid, strlen(text_invalid));
+                       if (echokeys)   /* erase old echo */
+                               XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                                              passx, passy - font->ascent,
+                                              xgwa.width - passx,
+                                              font->ascent + font->descent);
+                       XSync(dsp, True);       /* flush input buffer */
+                       (void) sleep(1);
+                       XFillRectangle(dsp, Scr[screen].window, Scr[screen].gc,
+                                    Scr[screen].iconpos.x, y - font->ascent,
+                       XTextWidth(font, text_invalid, strlen(text_invalid)),
+                                      font->ascent + font->descent + 2);
+#ifdef USE_SOUND
+                       if (sound)
+                               play_sound(invalidsound, verbose);
+                       got_invalid = 1;
+#endif
+               }
+       }
+       ChangeGrabbedCursor(dsp, Scr[screen].window, mycursor);
+       XUnmapWindow(dsp, Scr[screen].icon);
+#ifdef USE_BUTTON_LOGOUT
+       XUnmapWindow(dsp, Scr[screen].button);
+#endif
+       if (!fullscreen)
+               XConfigureWindow(dsp, Scr[screen].window, sizeconfiguremask,
+                                &minisizeconfigure);
+#ifdef VMS
+       (void) nice(nicelevel);
+#endif
+#ifdef FX
+       if (mesa_3Dfx_fullscreen)
+               setenv("MESA_GLX_FX", "fullscreen", 0);
+#endif
+       return 1;
+}
+
+static int
+event_screen(Display * display, Window event_win)
+{
+       int         i;
+
+       for (i = startscreen; i < screens; i++) {
+               if (event_win == RootWindow(display, i)) {
+                       return (i);
+               }
+       }
+       return (0);
+}
+
+static int
+justDisplay(Display * display)
+{
+       int         timetodie = False;
+       int         not_done = True;
+       XEvent      event;
+        
+#ifdef USE_VTLOCK
+        /* EL - RCS : lock VT switching */
+       /*
+        * I think it has to be done here or 'switch/restore' modes won't
+         * ever be usefull !
+        */
+        if (!nolock && vtlock && !vtlocked)
+                dovtlock();
+#endif
+
+       for (screen = startscreen; screen < screens; screen++) {
+               call_init_hook((LockStruct *) NULL,
+                     mode_info(display, screen, Scr[screen].window, False));
+       }
+
+       while (not_done) {
+               while (!XPending(display)) {
+#ifdef USE_OLD_EVENT_LOOP
+                       (void) usleep(delay);
+                       for (screen = startscreen; screen < screens; screen++)
+                               call_callback_hook((LockStruct *) NULL,
+                                                  mode_info(display, screen, Scr[screen].window, False));
+#ifdef USE_AUTO_LOGOUT
+                       checkLogout(display);
+#endif
+                       XSync(display, False);
+#else /* !USE_OLD_EVENT_LOOP */
+#ifdef USE_AUTO_LOGOUT
+                       if (runMainLoop(30, -1) == 0)
+                               break;
+                       checkLogout(display);
+#else
+                       (void) runMainLoop(0, -1);
+#endif
+#endif /* !USE_OLD_EVENT_LOOP */
+               }
+               (void) XNextEvent(display, &event);
+               /*
+                * This event handling code should be unified with the
+                * similar code in ReadXString().
+                */
+               switch (event.type) {
+                       case Expose:
+                               if (event.xexpose.count != 0) {
+                                       break;
+                               }
+                               /* fall through on last expose event of the series */
+
+                       case VisibilityNotify:
+                               if (!debug && !inwindow) {
+                                       XRaiseWindow(display, event.xany.window);
+                               }
+                               for (screen = startscreen; screen < screens; screen++) {
+                                       call_refresh_hook((LockStruct *) NULL,
+                                                         mode_info(display, screen, Scr[screen].window, False));
+                               }
+                               break;
+
+                       case ConfigureNotify:
+                               if (!debug && !inwindow) {
+                                       XRaiseWindow(display, event.xconfigure.window);
+                               }
+
+                               for (screen = startscreen; screen < screens; screen++) {
+                                       if (install)
+                                               fixColormap(mode_info(dsp, screen, Scr[screen].window, False), ncolors, saturation,
+                                                       mono, install, inroot, inwindow, verbose);
+                                       if (window_size_changed(screen, Scr[screen].window)) {
+                                               call_init_hook((LockStruct *) NULL,
+                                                              mode_info(display, screen, Scr[screen].window, False));
+                                       } else if (install)
+                                               /* next line : refresh would be logical. But some modes
+                                                * look weird when continuing from an erased screen */
+                                               call_refresh_hook((LockStruct *) NULL,
+                                                       mode_info(display, screen, Scr[screen].window, False));
+                               }
+                               break;
+
+                       case ButtonPress:
+                               if (event.xbutton.button == Button2) {
+                                       /* call change hook only for clicked window? */
+                                       for (screen = startscreen; screen < screens; screen++) {
+                                               call_change_hook((LockStruct *) NULL,
+                                                                mode_info(display, screen, Scr[screen].window,
+                                                                    False));
+                                       }
+                               } else {
+                                       screen = event_screen(display, event.xbutton.root);
+                                       not_done = False;
+                               }
+                               break;
+
+                       case MotionNotify:
+                               if (mousemotion) {
+                                       screen = event_screen(display, event.xmotion.root);
+                                       not_done = False;
+                               }
+                               break;
+
+                       case KeyPress:
+                               screen = event_screen(display, event.xkey.root);
+                               not_done = False;
+                               break;
+               }
+
+               if (!nolock && lock_delay &&
+                   (lock_delay <= (int) (seconds() - start_time))) {
+                       timetodie = True;
+                       /* not_done = False; */
+               }
+       }
+
+       /* KLUDGE SO TVTWM AND VROOT WILL NOT MAKE XLOCK DIE */
+       if (screen >= screens)
+               screen = startscreen;
+
+       lock_delay = False;
+       if (usefirst)
+               (void) XPutBackEvent(display, &event);
+       return timetodie;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static void
+sigcatch(int signum)
+{
+       ModeInfo   *mi = mode_info(dsp, startscreen, Scr[startscreen].window, False);
+       const char       *name = (mi == NULL) ? "unknown" : MI_NAME(mi);
+
+       finish(dsp, True);
+       (void) sprintf(error_buf,
+               "Access control list restored.\n%s: caught signal %d while running %s mode (uid %ld).\n",
+               (strlen(ProgramName) < ERROR_BUF - 120) ?
+               ProgramName: "xlock", signum,
+               (strlen(ProgramName) + strlen(name) < ERROR_BUF - 120) ?
+               name: "?", (long) getuid());
+       error(error_buf);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+static void
+lockDisplay(Display * display, Bool do_display)
+{
+#ifdef USE_VTLOCK
+       /* EL - RCS : lock VT switching */
+       if (!nolock && vtlock && !vtlocked)
+               dovtlock();
+#endif
+#if defined( HAVE_SYSLOG_H ) && defined( USE_SYSLOG )
+       syslogStart();
+#endif
+#ifdef USE_SOUND
+       if (sound && !inwindow && !inroot && !lockdelay)
+               play_sound(locksound, verbose);
+#endif
+       if (!allowaccess) {
+#if defined( SYSV ) || defined( SVR4 ) || ( __VMS_VER >= 70000000 )
+               sigset_t    oldsigmask;
+               sigset_t    newsigmask;
+
+               (void) sigemptyset(&newsigmask);
+#ifndef DEBUG
+               (void) sigaddset(&newsigmask, SIGHUP);
+#endif
+               (void) sigaddset(&newsigmask, SIGINT);
+               (void) sigaddset(&newsigmask, SIGQUIT);
+               (void) sigaddset(&newsigmask, SIGTERM);
+               (void) sigprocmask(SIG_BLOCK, &newsigmask, &oldsigmask);
+#else
+               int         oldsigmask;
+
+#ifndef VMS
+#if !defined(__cplusplus) && !defined(c_plusplus)
+               extern int  sigblock(int);
+               extern int  sigsetmask(int);
+
+#endif
+               oldsigmask = sigblock(
+#ifndef DEBUG
+                                            sigmask(SIGHUP) |
+#endif
+                                            sigmask(SIGINT) |
+                                            sigmask(SIGQUIT) |
+                                            sigmask(SIGTERM));
+#endif
+#endif
+
+               /* (void (*)(int)) sigcatch */
+#ifndef DEBUG
+               (void) signal(SIGHUP, sigcatch);
+#endif
+               (void) signal(SIGINT, sigcatch);
+               (void) signal(SIGQUIT, sigcatch);
+               (void) signal(SIGTERM, sigcatch);
+               /* we should trap ALL signals, especially the deadly ones */
+               (void) signal(SIGSEGV, sigcatch);
+               (void) signal(SIGBUS, sigcatch);
+               (void) signal(SIGFPE, sigcatch);
+
+               if (grabserver)
+                       XGrabServer(display);
+               XGrabHosts(display);
+
+#if defined( SYSV ) || defined( SVR4 ) || ( __VMS_VER >= 70000000 )
+               (void) sigprocmask(SIG_SETMASK, &oldsigmask, &oldsigmask);
+#else
+               (void) sigsetmask(oldsigmask);
+#endif
+       }
+#if defined( __hpux ) || defined( __apollo )
+       XHPDisableReset(display);
+#endif
+       do {
+               if (do_display)
+                       (void) justDisplay(display);
+               else
+                       do_display = True;
+       } while (getPassword());
+#if defined( __hpux ) || defined( __apollo )
+       XHPEnableReset(display);
+#endif
+}
+
+static void
+read_plan(void)
+{
+       FILE       *planf = NULL;
+       char        buf[121];
+       const char *home = getenv("HOME");
+       char       *buffer;
+       int         i, j, len = 0;
+
+       if (!home)
+               home = "";
+
+       if ((buffer = (char *) malloc(
+#if ( __VMS_VER >= 70000000 )
+       255
+
+#else
+       strlen(home) + 32
+
+#endif
+       )) == NULL) {
+               error("low memory for plan");
+       }
+
+#ifdef VMS
+       (void) sprintf(buffer, "%s%s", home, ".xlocktext");
+#else
+       (void) sprintf(buffer, "%s/%s", home, ".xlocktext");
+#endif
+       planf = my_fopen(buffer, "r");
+       if (planf == NULL) {
+#ifdef VMS
+               (void) sprintf(buffer, "%s%s", home, ".plan");
+#else
+               (void) sprintf(buffer, "%s/%s", home, ".plan");
+#endif
+               planf = my_fopen(buffer, "r");
+       }
+       if (planf == NULL) {
+#ifndef VMS
+               (void) sprintf(buffer, "%s/%s", home, ".signature");
+#else
+#if ( __VMS_VER >= 70000000 )
+/* Get signature file for VMS 7.0 and higher */
+               char       *buffer1;
+               unsigned int ival;
+               unsigned long int mail_context = 0;
+               unsigned short int buflen, buflen1;
+               struct itmlst_3 item[2], itm_d[1];
+
+               if ((buffer1 = (char *) malloc(256)) == NULL) {
+                       error("low memory for signature");
+               }
+               itm_d[0].buflen = 0;
+               itm_d[0].itmcode = 0;
+               item[0].buflen = 255;
+               item[0].itmcode = MAIL$_USER_SIGFILE;
+               item[0].bufadr = buffer1;
+               item[0].retlen = &buflen1;
+               item[1].buflen = 255;
+               item[1].itmcode = MAIL$_USER_FULL_DIRECTORY;
+               item[1].bufadr = buffer;
+               item[1].retlen = &buflen;
+               item[2].buflen = 0;
+               item[2].itmcode = 0;
+               ival = mail$user_begin(&mail_context, itm_d, item);
+               (void) mail$user_end(&mail_context, itm_d, itm_d);
+               (void) strncat(buffer, buffer1, buflen1);
+               (void) free((void *) buffer1);
+#else
+               (void) sprintf(buffer, "%s%s", home, ".signature");
+#endif
+#endif
+               planf = my_fopen(buffer, "r");
+       }
+       if (planf != NULL) {
+               for (i = 0; i < TEXTLINES; i++) {
+                       if (fgets(buf, 120, planf) && (len = strlen(buf)) > 0) {
+                               if (buf[len - 1] == '\n') {
+                                       buf[--len] = '\0';
+                               }
+                               /* this expands tabs to 8 spaces */
+                               for (j = 0; j < len; j++) {
+                                       if (buf[j] == '\t') {
+                                               int         k, tab = 8 - (j % 8);
+
+                                               for (k = 120 - tab; k > j; k--) {
+                                                       buf[k + tab - 1] = buf[k];
+                                               }
+                                               for (k = j; k < j + tab; k++) {
+                                                       buf[k] = ' ';
+                                               }
+                                               len += tab;
+                                               if (len > 120)
+                                                       len = 120;
+                                       }
+                               }
+
+                               if ((plantext[i] = (char *) malloc(strlen(buf) + 1)) == NULL) {
+                                       error("low memory for plan");
+                               }
+                               (void) strcpy(plantext[i], buf);
+                       }
+               }
+               plantext[i] = NULL;
+               (void) fclose(planf);
+       } else {
+               plantext[0] = NULL;
+       }
+       (void) free((void *) buffer);
+       buffer = NULL;
+}
+
+#ifdef USE_MB
+static      XFontSet
+createFontSet(Display * display, char *name)
+{
+       XFontSet    xfs;
+       char       *def, **miss;
+       int         miss_count;
+
+#define DEF_FONTSET2 "fixed,-*-14-*"
+
+       if ((xfs = XCreateFontSet(display, name, &miss, &miss_count, &def)) == NULL) {
+               (void) fprintf(stderr, "Could not create FontSet %s\n", name);
+               if ((xfs = XCreateFontSet(display, DEF_FONTSET2, &miss, &miss_count, &def)) == NULL)
+                       (void) fprintf(stderr, "Could not create FontSet %s\n", DEF_FONTSET2);
+       }
+       return xfs;
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static void SigUsr2(int sig);
+
+static void
+SigUsr1(int sig)
+{
+#ifdef DEBUG
+       (void) printf("Signal %d received\n", sig);
+#endif
+       signalUSR1 = 1;
+       signalUSR2 = 0;
+
+       (void) signal(SIGUSR1, SigUsr1);
+       (void) signal(SIGUSR2, SigUsr2);
+}
+
+static void
+SigUsr2(int sig)
+{
+#ifdef DEBUG
+       (void) printf("Signal %d received\n", sig);
+#endif
+       signalUSR1 = 0;
+       signalUSR2 = 1;
+
+       (void) signal(SIGUSR1, SigUsr1);
+       (void) signal(SIGUSR2, SigUsr2);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+int
+main(int argc, char **argv)
+{
+       XSetWindowAttributes xswa;
+       XGCValues   xgcv;
+       XColor      nullcolor;
+       char      **planp;
+       int         tmp;
+       uid_t       ruid;
+       pid_t       cmd_pid = 0;
+
+#if defined( SYSV ) || defined( SVR4 ) || ( __VMS_VER >= 70000000 )
+       static sigset_t old_sigmask;
+
+#else
+       static int  old_sigmask;
+
+#endif
+
+#if ultrix
+       extern gid_t rgid;
+
+#else
+       gid_t       rgid;
+
+#endif
+#if defined( HAVE_SETEUID ) || defined( HAVE_SETREUID )
+       uid_t       euid;
+
+#if ultrix
+       extern gid_t egid;
+
+#else
+       gid_t       egid;
+
+#endif
+#endif
+
+#ifdef USE_MB
+       setlocale(LC_ALL, "");
+#endif
+
+       (void) signal(SIGUSR1, SigUsr1);
+       (void) signal(SIGUSR2, SigUsr2);
+
+#if defined( __FreeBSD__ ) && !defined( DEBUG )
+       /* do not exit on FPE */
+       fpsetmask(0);
+#endif
+
+#ifdef OSF1_ENH_SEC
+       set_auth_parameters(argc, argv);
+#endif
+
+       ruid = getuid();
+       rgid = getgid();
+#ifdef HAVE_SETEUID
+       /* save effective uid and gid for later */
+       euid = geteuid();
+       egid = getegid();
+
+       /* revoke root privs temporarily, to get the correct .Xauthority */
+       (void) setegid(rgid);
+       (void) seteuid(ruid);
+#else
+#ifdef HAVE_SETREUID
+       /* save effective uid and gid for later */
+       euid = geteuid();
+       egid = getegid();
+
+       /* revoke root privs temporarily, to get the correct .Xauthority */
+       (void) setregid(egid, rgid);
+       (void) setreuid(euid, ruid);
+
+#endif
+#endif
+
+       ProgramName = strrchr(argv[0], '/');
+       if (ProgramName)
+               ProgramName++;
+       else
+               ProgramName = argv[0];
+
+       start_time = seconds();
+#ifdef DEBUG
+       ProgramPID = getpid();  /* for memcheck.c */
+#endif
+#if 1
+       SRAND((long) start_time);       /* random mode needs the seed set. */
+#else
+       SRAND((long) ProgramPID);
+#endif
+
+       getResources(&dsp, argc, argv);
+
+#ifdef HAVE_SETEUID
+       /* become root to get the password */
+       (void) setegid(egid);
+       (void) seteuid(euid);
+#else
+#ifdef HAVE_SETREUID
+       /* become root to get the password */
+       (void) setregid(rgid, egid);
+       (void) setreuid(ruid, euid);
+
+#endif
+#endif
+
+       initPasswd();
+
+/* revoke root privs, if there were any */
+#ifdef ultrix
+/*-
+ * Potential security problem on ultrix
+ * Here's the problem.  Later on you need setgid to a root group to
+ * use the crypt program.  I do not want to keep the password in memory.
+ * That means other parts will be running setgid as well.
+ */
+
+#if 1
+       /* Change 1 to 0 */
+       UNTESTED CODE, COMMENT OUT AND SEE IF IT WORKS, PLEASE GET BACK TO ME
+#endif
+
+#ifdef HAVE_SETEUID
+       /* Lets try to dampen it a bit */
+                   (void) setegid(rgid);
+
+#else
+#ifdef HAVE_SETREUID
+                   (void) setregid(egid, rgid);
+
+#else
+                   (void) setgid(rgid);        /* Forget it */
+
+#endif
+#endif
+#else
+       /* In order to lock VT switch we must issue an ioctl on console */
+       /* (VT_LOCKSWITCH). This ioctl MUST be issued by root. */
+       /* We need later to be able to do another seteuid(0), so let's */
+       /* disable the overwrite of saved uid/gid */
+
+#ifdef BAD_PAM
+/* BAD_PAM must have root access to authenticate against shadow passwords */
+      (void) seteuid(ruid);
+/* for BAD_PAM to use shadow passwords, must call seteuid() later */
+#else
+
+#ifdef USE_VTLOCK
+       if (!vtlock)
+#endif
+               (void) setgid(rgid);
+#endif
+#endif
+
+#ifdef USE_VTLOCK
+       if (!vtlock)
+#endif
+               (void) setuid(ruid);
+
+#if 0
+       /* synchronize -- so I am aware of errors immediately */
+       /* Too slow only for debugging */
+       (void) printf("DEBUGGING: XSynchronize version\n");
+       XSynchronize(dsp, True);
+#endif
+
+#ifdef USE_MB
+       fontset = createFontSet(dsp, fontsetname);
+       XmbTextExtents(fontset, "A", 1, NULL, &mbRect);
+#endif
+       checkResources();
+
+       font = XLoadQueryFont(dsp, fontname);
+       if (font == NULL) {
+               (void) fprintf(stderr, "%s: can not find font: %s, using %s...\n",
+                              ProgramName, fontname, FALLBACK_FONTNAME);
+               font = XLoadQueryFont(dsp, FALLBACK_FONTNAME);
+               if (font == NULL) {
+                       (void) sprintf(error_buf,
+                               "%s: can not even find %s!!!\n",
+                               (strlen(ProgramName) < ERROR_BUF - 80) ?
+                               ProgramName : "xlock",
+                               (strlen(ProgramName) + strlen(FALLBACK_FONTNAME) < ERROR_BUF - 80) ?
+                               FALLBACK_FONTNAME: "a font");
+                       error(error_buf);
+               }
+       } {
+               int         flags, x, y;
+               unsigned int w, h;
+
+#ifdef FX
+               if (!glgeometry || !*glgeometry) {
+                       glwidth = DEF_GLW;
+                       glheight = DEF_GLH;
+               } else {
+                       flags = XParseGeometry(glgeometry, &x, &y, &w, &h);
+                       glwidth = flags & WidthValue ? w : DEF_GLW;
+                       glheight = flags & HeightValue ? h : DEF_GLH;
+                       if (glwidth < MINICONW)
+                               glwidth = MINICONW;
+                       if (glheight < MINICONH)
+                               glheight = MINICONH;
+               }
+#endif
+               if (!icongeometry || !*icongeometry) {
+                       iconwidth = DEF_ICONW;
+                       iconheight = DEF_ICONH;
+               } else {
+                       flags = XParseGeometry(icongeometry, &x, &y, &w, &h);
+                       iconwidth = flags & WidthValue ? w : DEF_ICONW;
+                       iconheight = flags & HeightValue ? h : DEF_ICONH;
+                       if (iconwidth < MINICONW)
+                               iconwidth = MINICONW;
+                       else if (iconwidth > MAXICONW)
+                               iconwidth = MAXICONW;
+                       if (iconheight < MINICONH)
+                               iconheight = MINICONH;
+                       else if (iconheight > MAXICONH)
+                               iconheight = MAXICONH;
+               }
+               if (!geometry || !*geometry) {
+                       fullscreen = True;
+               } else {
+                       flags = XParseGeometry(geometry, &x, &y, &w, &h);
+                       if (w < MINICONW)
+                               w = MINICONW;
+                       if (h < MINICONH)
+                               h = MINICONH;
+                       minisizeconfigure.x = flags & XValue ? x : 0;
+                       minisizeconfigure.y = flags & YValue ? y : 0;
+                       minisizeconfigure.width = flags & WidthValue ? w : iconwidth;
+                       minisizeconfigure.height = flags & HeightValue ? h : iconheight;
+               }
+       }
+
+       planfont = XLoadQueryFont(dsp, planfontname);
+       if (planfont == NULL) {
+               (void) fprintf(stderr, "%s: can't find font: %s, using %s...\n",
+                              ProgramName, planfontname, FALLBACK_FONTNAME);
+               planfont = XLoadQueryFont(dsp, FALLBACK_FONTNAME);
+               if (planfont == NULL) {
+                       (void) sprintf(error_buf,
+                               "%s: can not even find %s!!!\n",
+                               (strlen(ProgramName) < ERROR_BUF - 80) ?
+                               ProgramName : "xlock",
+                               (strlen(ProgramName) + strlen(FALLBACK_FONTNAME) < ERROR_BUF - 80) ?
+                               FALLBACK_FONTNAME: "a font");
+                       error(error_buf);
+               }
+       }
+       read_plan();
+
+       screens = ScreenCount(dsp);
+       if (((modeinfo = (ModeInfo *) calloc(screens,
+                       sizeof (ModeInfo))) == NULL) ||
+           ((Scr = (ScreenInfo *) calloc(screens,
+                       sizeof (ScreenInfo))) == NULL)) {
+               error("low memory for info");
+       }
+
+#ifdef FORCESINGLE
+       /* Safer to keep this after the calloc in case ScreenCount is used */
+       startscreen = DefaultScreen(dsp);
+       screens = startscreen + 1;
+#endif
+
+#if defined( USE_SOUND ) && defined( USE_ESOUND )
+        sound = (sound && (init_sound() != -1));
+#endif
+
+#ifdef USE_DTSAVER
+       /* The CDE Session Manager provides the windows for the screen saver
+          to draw into. */
+       if (dtsaver) {
+               Window     *saver_wins;
+               int         num_wins;
+               int         this_win;
+               int         this_screen;
+               XWindowAttributes xgwa;
+
+
+               /* Get the list of requested windows */
+               if (!DtSaverGetWindows(dsp, &saver_wins, &num_wins)) {
+                       (void) sprintf(error_buf,
+                               "%s: Unable to get screen saver info.\n",
+                               (strlen(ProgramName) < ERROR_BUF - 80) ?
+                               ProgramName : "xlock");
+                       error(error_buf);
+               }
+               for (this_win = 0; this_win < num_wins; this_win++) {
+                       (void) XGetWindowAttributes(dsp, saver_wins[this_win], &xgwa);
+                       this_screen = XScreenNumberOfScreen(xgwa.screen);
+                       if (Scr[this_screen].window != None) {
+                               (void) sprintf(error_buf,
+                                       "%s: Two windows on screen %d\n",
+                                       (strlen(ProgramName) < ERROR_BUF - 80) ?
+                                       ProgramName : "xlock", this_screen);
+                               error(error_buf);
+                       }
+                       Scr[this_screen].window = saver_wins[this_win];
+               }
+               /* Reduce to the screens that have windows.  Avoid problems and */
+               /* assume that if one fails there is only one good window. */
+               for (this_screen = startscreen; this_screen < screens; this_screen++) {
+                       if (Scr[this_screen].window == None) {
+                               startscreen = DefaultScreen(dsp);
+                               screens = startscreen + 1;
+                               break;
+                       }
+               }
+       } else
+#endif
+
+       if (inwindow) {
+               /* Reduce to the last screen requested */
+               startscreen = DefaultScreen(dsp);
+               screens = startscreen + 1;
+       }
+       for (screen = startscreen; screen < screens; screen++) {
+               Screen     *scr = ScreenOfDisplay(dsp, screen);
+               Colormap    cmap = (Colormap) NULL;
+
+/* Start of MI_ROOT_PIXMAP hack */
+               Window                  temp_rw;
+               XGCValues               temp_gcv;
+               GC                      temp_gc;
+               XWindowAttributes       temp_xgwa;
+
+               temp_rw = (parentSet) ? parent : RootWindowOfScreen(scr);
+               (void) XGetWindowAttributes(dsp, temp_rw, &temp_xgwa);
+               temp_gcv.function = GXcopy;
+               temp_gcv.subwindow_mode = IncludeInferiors;
+               temp_gc = XCreateGC(dsp, temp_rw, GCFunction|GCSubwindowMode,
+                                  &temp_gcv);
+               Scr[screen].root_pixmap = XCreatePixmap(dsp, temp_rw,
+                                                  temp_xgwa.width,
+                                                  temp_xgwa.height,
+                                                  temp_xgwa.depth);
+               XCopyArea(dsp, temp_rw, Scr[screen].root_pixmap,
+                         temp_gc, 0, 0, temp_xgwa.width, temp_xgwa.height,
+                         0, 0);
+               XFreeGC(dsp, temp_gc);
+
+/* End of MI_ROOT_PIXMAP hack */
+
+#ifdef ORIGINAL_XPM_PATCH
+               if (mailIcon && mailIcon[0]) {
+                       if ((mail_xpmimg = (XpmImage *) malloc(sizeof (XpmImage))))
+                               if (XpmReadFileToXpmImage(mailIcon, mail_xpmimg,
+                                          (XpmInfo *) NULL) != XpmSuccess) {
+                                       (void) free((void *) mail_xpmimg);
+                                       mail_xpmimg = NULL;
+                               }
+               }
+               if (nomailIcon && nomailIcon[0]) {
+                       if ((nomail_xpmimg = (XpmImage *) malloc(sizeof (XpmImage))))
+                               if (XpmReadFileToXpmImage(nomailIcon, nomail_xpmimg,
+                                          (XpmInfo *) NULL) != XpmSuccess) {
+                                       free(nomail_xpmimg);
+                                       nomail_xpmimg = NULL;
+                               }
+               }
+#endif
+
+               Scr[screen].root = (parentSet) ? parent : RootWindowOfScreen(scr);
+               defaultVisualInfo(dsp, screen);
+
+/*-
+ * Some window managers like fvwm and tvtwm do not like it when an application
+ * thinks it can install a full screen colormap (i.e xlock).  It promptly
+ * deinstalls the colormap and this might lead to white backgrounds if
+ * CopyFromParent is not used.
+ * But if CopyFromParent is used one can not change the visual
+ * and one may get White = Black on PseudoColor (see bug mode).
+ * There is another spot in xlock.c like this one...
+ * As far as I can tell, this problem exists only if your using MesaGL.
+ */
+#if (defined( USE_GL ) && (!defined( MESA ) || defined( REALGLX ))) || !defined( COMPLIANT_COLORMAP )
+               Scr[screen].colormap = cmap = xswa.colormap =
+                       XCreateColormap(dsp, Scr[screen].root, Scr[screen].visual, AllocNone);
+#else
+               cmap = DefaultColormapOfScreen(scr);
+               Scr[screen].colormap = None;
+#endif
+
+               xswa.override_redirect = True;
+               xswa.background_pixel = Scr[screen].black_pixel;
+               xswa.border_pixel = Scr[screen].white_pixel;
+               xswa.event_mask = KeyPressMask | ButtonPressMask |
+                       VisibilityChangeMask | ExposureMask | StructureNotifyMask;
+               if (mousemotion)
+                       xswa.event_mask |= MotionNotify;
+
+#ifdef USE_VROOT
+               if (inroot) {
+                       Scr[screen].window = Scr[screen].root;
+                       XChangeWindowAttributes(dsp, Scr[screen].window, CWBackPixel, &xswa);
+                       /* this gives us these events from the root window */
+                       XSelectInput(dsp, Scr[screen].window,
+                                    VisibilityChangeMask | ExposureMask);
+               } else
+#endif
+#ifdef USE_DTSAVER
+               if (!dtsaver)
+#endif
+               {
+#define WIDTH (inwindow? WidthOfScreen(scr)/2 : (debug? WidthOfScreen(scr) - 100 : WidthOfScreen(scr)))
+#define HEIGHT (inwindow? HeightOfScreen(scr)/2 : (debug? HeightOfScreen(scr) - 100 : HeightOfScreen(scr)))
+#if (defined( USE_GL ) && (!defined( MESA ) || defined( REALGLX ))) || !defined( COMPLIANT_COLORMAP )
+#define CWMASK (((debug||inwindow||inroot)? 0 : CWOverrideRedirect) | CWBackPixel | CWBorderPixel | CWEventMask | CWColormap)
+#else
+#define CWMASK (((debug||inwindow||inroot)? 0 : CWOverrideRedirect) | CWBackPixel | CWBorderPixel | CWEventMask)
+#endif
+
+#if (defined( USE_GL ) && (!defined( MESA ) || defined( REALGLX ))) || !defined( COMPLIANT_COLORMAP )
+#define XLOCKWIN_DEPTH (Scr[screen].depth)
+#define XLOCKWIN_VISUAL (Scr[screen].visual)
+#else
+#define XLOCKWIN_DEPTH CopyFromParent
+#define XLOCKWIN_VISUAL CopyFromParent
+#endif
+
+                       if (fullscreen) {
+                               Scr[screen].window = XCreateWindow(dsp, Scr[screen].root, 0, 0,
+                                                                  (unsigned int) WIDTH, (unsigned int) HEIGHT, 0,
+                               XLOCKWIN_DEPTH, InputOutput, XLOCKWIN_VISUAL,
+                                                             CWMASK, &xswa);
+                       } else {
+                               sizeconfiguremask = CWX | CWY | CWWidth | CWHeight;
+                               Scr[screen].fullsizeconfigure.x = 0;
+                               Scr[screen].fullsizeconfigure.y = 0;
+                               Scr[screen].fullsizeconfigure.width = WIDTH;
+                               Scr[screen].fullsizeconfigure.height = HEIGHT;
+                               Scr[screen].window = XCreateWindow(dsp, Scr[screen].root,
+                                                  (int) minisizeconfigure.x,
+                                                  (int) minisizeconfigure.y,
+                                     (unsigned int) minisizeconfigure.width,
+                                    (unsigned int) minisizeconfigure.height,
+                                                                  0, XLOCKWIN_DEPTH, InputOutput, XLOCKWIN_VISUAL,
+                                                             CWMASK, &xswa);
+                       }
+               }
+               if (use3d) {
+                       XColor      C;
+
+#ifdef CALCULATE_BOTH
+                       XColor      C2;
+
+#endif
+                       unsigned long planemasks[10];
+                       unsigned long pixels[10];
+
+                       if (!install || !XAllocColorCells(dsp, cmap, False, planemasks, 2, pixels,
+                                                         1)) {
+                               /* did not get the needed colours.  Use normal 3d view without */
+                               /* color overlapping */
+                               Scr[screen].none_pixel = allocPixel(dsp, cmap, none3d, DEF_NONE3D);
+                               Scr[screen].right_pixel = allocPixel(dsp, cmap, right3d, DEF_RIGHT3D);
+                               Scr[screen].left_pixel = allocPixel(dsp, cmap, left3d, DEF_LEFT3D);
+                               Scr[screen].both_pixel = allocPixel(dsp, cmap, both3d, DEF_BOTH3D);
+
+                       } else {
+                               /*
+                                  * attention: the mixture of colours will only be guaranteed, if
+                                  * the right black is used.  The problems with BlackPixel would
+                                  * be that BlackPixel | left_pixel need not be equal to left_pixel.
+                                  * The same holds for rightcol (of course). That is why the right
+                                  * black (black3dcol) must be used when GXor is used as put
+                                  * function.  I have allocated four colors above:
+                                  * pixels[0],                                - 3d black
+                                  * pixels[0] | planemasks[0],                - 3d right eye color
+                                  * pixels[0] | planemasks[1],                - 3d left eye color
+                                  * pixels[0] | planemasks[0] | planemasks[1] - 3d white
+                                */
+
+                               if (!XParseColor(dsp, cmap, none3d, &C))
+                                       (void) XParseColor(dsp, cmap, DEF_NONE3D, &C);
+                               Scr[screen].none_pixel = C.pixel = pixels[0];
+                               XStoreColor(dsp, cmap, &C);
+
+                               if (!XParseColor(dsp, cmap, right3d, &C))
+                                       (void) XParseColor(dsp, cmap, DEF_RIGHT3D, &C);
+                               Scr[screen].right_pixel = C.pixel = pixels[0] | planemasks[0];
+                               XStoreColor(dsp, cmap, &C);
+
+#ifdef CALCULATE_BOTH
+                               C2.red = C.red;
+                               C2.green = C.green;
+                               C2.blue = C.blue;
+#else
+                               if (!XParseColor(dsp, cmap, left3d, &C))
+                                       (void) XParseColor(dsp, cmap, DEF_LEFT3D, &C);
+#endif
+                               Scr[screen].left_pixel = C.pixel = pixels[0] | planemasks[1];
+                               XStoreColor(dsp, cmap, &C);
+
+#ifdef CALCULATE_BOTH
+                               C.red |= C2.red;        /* or them together... */
+                               C.green |= C2.green;
+                               C.blue |= C2.blue;
+#else
+                               if (!XParseColor(dsp, cmap, both3d, &C))
+                                       (void) XParseColor(dsp, cmap, DEF_BOTH3D, &C);
+#endif
+                               Scr[screen].both_pixel = C.pixel =
+                                       pixels[0] | planemasks[0] | planemasks[1];
+                               XStoreColor(dsp, cmap, &C);
+                       }
+
+               }
+               fixColormap(mode_info(dsp, screen, Scr[screen].window, False), ncolors, saturation,
+                           mono, install, inroot, inwindow, verbose);
+               if (debug || inwindow) {
+                       XWMHints    xwmh;
+
+                       xwmh.flags = InputHint;
+                       xwmh.input = True;
+                       XChangeProperty(dsp, Scr[screen].window,
+                              XA_WM_HINTS, XA_WM_HINTS, 32, PropModeReplace,
+                                       (unsigned char *) &xwmh, sizeof (xwmh) / sizeof (int));
+               }
+               if (debug) {
+                       Scr[screen].iconpos.x = (DisplayWidth(dsp, screen) - 100 -
+                                                MAX(512, XTextWidth(font, text_info, strlen(text_info)))) / 2;
+                       Scr[screen].iconpos.y = (DisplayHeight(dsp, screen) - 100) / 6;
+               } else {
+                       Scr[screen].iconpos.x = (DisplayWidth(dsp, screen) -
+                                                MAX(512, XTextWidth(font, text_info, strlen(text_info)))) / 2;
+                       Scr[screen].iconpos.y = DisplayHeight(dsp, screen) / 6;
+               }
+
+               Scr[screen].planpos.x = Scr[screen].planpos.y = 0;
+               for (planp = plantext; *planp; ++planp) {
+                       tmp = XTextWidth(planfont, *planp, strlen(*planp));
+                       if (tmp > Scr[screen].planpos.x)
+                               Scr[screen].planpos.x = tmp;
+                       ++Scr[screen].planpos.y;
+               }
+               if (debug) {
+                       Scr[screen].planpos.x = (DisplayWidth(dsp, screen) - 100 -
+                                                Scr[screen].planpos.x) / 2;
+                       Scr[screen].planpos.y = DisplayHeight(dsp, screen) - 100 -
+#ifdef USE_MB
+                               (Scr[screen].planpos.y + 4) * (mbRect.height + 2);
+#else
+                               (Scr[screen].planpos.y + 4) * (planfont->ascent + planfont->descent + 2);
+#endif
+               } else {
+                       Scr[screen].planpos.x = (DisplayWidth(dsp, screen) -
+                                                Scr[screen].planpos.x) / 2;
+                       Scr[screen].planpos.y = DisplayHeight(dsp, screen) -
+#ifdef USE_MB
+                               (Scr[screen].planpos.y + 4) * (mbRect.height + 2);
+#else
+                               (Scr[screen].planpos.y + 4) * (planfont->ascent + planfont->descent + 2);
+#endif
+               }
+
+               xswa.border_pixel = Scr[screen].white_pixel;
+               xswa.background_pixel = Scr[screen].black_pixel;
+               xswa.event_mask = ButtonPressMask;
+#if (defined( USE_GL ) && (!defined( MESA ) || defined( REALGLX ))) || !defined( COMPLIANT_COLORMAP )
+#define CIMASK CWBorderPixel | CWBackPixel | CWEventMask | CWColormap
+#else
+#define CIMASK CWBorderPixel | CWBackPixel | CWEventMask
+#endif
+               if (nolock)
+                       Scr[screen].icon = None;
+               else {
+                       Scr[screen].icon = XCreateWindow(dsp, Scr[screen].window,
+                               Scr[screen].iconpos.x, Scr[screen].iconpos.y,
+                             iconwidth, iconheight, 1, (int) CopyFromParent,
+                                                InputOutput, CopyFromParent,
+                                                        CIMASK, &xswa);
+#ifdef USE_BUTTON_LOGOUT
+                       {
+                               char       *buf;
+                               int         w, h;
+
+                               if ((buf = (char *) malloc(strlen(logoutButtonLabel) +
+                                                3)) == NULL) {
+                                       w = (strlen(logoutButtonLabel) + 5) * 8;
+                               } else {
+                                       (void) sprintf(buf, " %s ", logoutButtonLabel);
+                                       w = XTextWidth(font, buf, strlen(buf));
+                                       (void) free((void *) buf);
+                               }
+                               h = font->ascent + font->descent + 2;
+                               Scr[screen].button = XCreateWindow(dsp, Scr[screen].window,
+                                        0, 0, w, h, 1, (int) CopyFromParent,
+                                                InputOutput, CopyFromParent,
+                                                             CIMASK, &xswa);
+                       }
+#endif
+               }
+               XMapWindow(dsp, Scr[screen].window);
+               XRaiseWindow(dsp, Scr[screen].window);
+
+#if 0
+               if (install && cmap != DefaultColormapOfScreen(scr))
+                       setColormap(dsp, Scr[screen].window, cmap, inwindow);
+#endif
+
+               xgcv.font = font->fid;
+               xgcv.foreground = Scr[screen].white_pixel;
+               xgcv.background = Scr[screen].black_pixel;
+               Scr[screen].gc = XCreateGC(dsp, Scr[screen].window,
+                               GCFont | GCForeground | GCBackground, &xgcv);
+
+               xgcv.foreground = Scr[screen].fg_pixel;
+               xgcv.background = Scr[screen].bg_pixel;
+               Scr[screen].textgc = XCreateGC(dsp, Scr[screen].window,
+                               GCFont | GCForeground | GCBackground, &xgcv);
+               xgcv.font = planfont->fid;
+               Scr[screen].plantextgc = XCreateGC(dsp, Scr[screen].window,
+                               GCFont | GCForeground | GCBackground, &xgcv);
+
+#ifdef ORIGINAL_XPM_PATCH
+               if (mail_xpmimg) {
+                       XpmAttributes xpm_attr;
+
+                       xpm_attr.valuemask = 0;
+                       XpmCreatePixmapFromXpmImage(dsp, Scr[screen].window, mail_xpmimg,
+                                                &Scr[screen].mb.mail.pixmap,
+                                    &Scr[screen].mb.mail.bitmap, &xpm_attr);
+               }
+               if (nomail_xpmimg) {
+                       XpmAttributes xpm_attr;
+
+                       xpm_attr.valuemask = 0;
+                       XpmCreatePixmapFromXpmImage(dsp, Scr[screen].window, nomail_xpmimg,
+                                              &Scr[screen].mb.nomail.pixmap,
+                                  &Scr[screen].mb.nomail.bitmap, &xpm_attr);
+               }
+               if (mail_xpmimg || nomail_xpmimg) {
+                       Scr[screen].mb.mbgc = XCreateGC(dsp, Scr[screen].window,
+                                       GCFont | GCForeground | GCBackground,
+                                                       &xgcv);
+               }
+#else
+               if (mailCmd && mailCmd[0]) {
+                       pickPixmap(dsp, Scr[screen].window, nomailIcon,
+                                  NOMAIL_WIDTH, NOMAIL_HEIGHT, NOMAIL_BITS,
+                                  &(Scr[screen].mb.nomail.width),
+                                  &(Scr[screen].mb.nomail.height),
+                                  &(Scr[screen].mb.nomail.pixmap),
+                                  &(Scr[screen].mb.nomail.graphics_format));
+                       pickPixmap(dsp, Scr[screen].window, mailIcon,
+                                  MAIL_WIDTH, MAIL_HEIGHT, MAIL_BITS,
+                                  &(Scr[screen].mb.mail.width),
+                                  &(Scr[screen].mb.mail.height),
+                                  &(Scr[screen].mb.mail.pixmap),
+                                  &(Scr[screen].mb.mail.graphics_format));
+                       Scr[screen].mb.mbgc = XCreateGC(dsp, Scr[screen].window,
+                                       GCFont | GCForeground | GCBackground,
+                                                       &xgcv);
+               }
+#endif
+       }
+       lockc = XCreateBitmapFromData(dsp, Scr[startscreen].root, no_bits, 1, 1);
+       lockm = XCreateBitmapFromData(dsp, Scr[startscreen].root, no_bits, 1, 1);
+       mycursor = XCreatePixmapCursor(dsp, lockc, lockm,
+                                      &nullcolor, &nullcolor, 0, 0);
+       XFreePixmap(dsp, lockc);
+       XFreePixmap(dsp, lockm);
+
+       if (!grabmouse || inwindow || inroot) {
+               nolock = 1;
+               enablesaver = 1;
+       } else if (!debug) {
+               GrabKeyboardAndMouse(dsp, Scr[startscreen].window);
+       }
+       if (!nolock) {
+               XGetScreenSaver(dsp, &sstimeout, &ssinterval,
+                               &ssblanking, &ssexposures);
+               if (resetsaver)
+                       XResetScreenSaver(dsp);         /* make sure not blank now */
+               if (!enablesaver)
+                       XSetScreenSaver(dsp, 0, 0, 0, 0);       /* disable screen saver */
+       }
+#ifdef USE_DPMS
+       if ((dpmsstandby >= 0) || (dpmssuspend >= 0) || (dpmsoff >= 0))
+               SetDPMS(dsp, dpmsstandby, dpmssuspend, dpmsoff);
+#endif
+       (void) nice(nicelevel);
+
+       (void) XSetIOErrorHandler(xio_error);
+
+       /* start the command startcmd */
+       if (startCmd && *startCmd) {
+
+               if ((cmd_pid = FORK()) == -1) {
+                       (void) fprintf(stderr, "Failed to launch \"%s\"\n", startCmd);
+                       perror(ProgramName);
+                       cmd_pid = 0;
+               } else if (!cmd_pid) {
+#ifndef VMS
+                       (void) setpgid(0, 0);
+#endif
+#if 0
+#if (defined(sun) && defined(__svr4__)) || defined(sgi) || defined(__hpux) || defined(linux)
+                       setsid();
+#else
+                       setpgrp(getpid(), getpid());
+#endif
+#endif
+#if defined( SYSV ) || defined( SVR4 ) || ( __VMS_VER >= 70000000 )
+                       (void) sigprocmask(SIG_SETMASK, &old_sigmask, &old_sigmask);
+#else
+                       (void) sigsetmask(old_sigmask);
+#endif
+                       (void) system(startCmd);
+                       exit(0);
+               }
+       }
+       lock_delay = lockdelay;
+       if (nolock) {
+               (void) justDisplay(dsp);
+       } else if (lock_delay) {
+               if (justDisplay(dsp)) {
+                       lockDisplay(dsp, False);
+               } else
+                       nolock = 1;
+       } else {
+               lockDisplay(dsp, True);
+       }
+#if defined( HAVE_SYSLOG_H ) && defined( USE_SYSLOG )
+       if (!nolock) {
+               syslogStop(XDisplayString(dsp));
+               closelog();
+       }
+#endif
+#ifdef USE_DPMS
+       SetDPMS(dsp, -1, -1, -1);
+#endif
+       finish(dsp, True);
+
+       if (cmd_pid)
+#if defined(NO_KILLPG) || defined(__svr4__) || defined(sgi) || defined(__hpux) || defined(VMS)
+               kill(-cmd_pid, SIGTERM);
+#else
+               (void) killpg(cmd_pid, SIGTERM);
+#endif
+       if (endCmd && *endCmd) {
+               if ((cmd_pid = FORK()) == -1) {
+                       (void) fprintf(stderr, "Failed to launch \"%s\"\n", endCmd);
+                       perror(ProgramName);
+                       cmd_pid = 0;
+               } else if (!cmd_pid) {
+                       (void) system(endCmd);
+                       exit(0);
+               }
+       }
+
+#if defined( USE_SOUND ) && defined( USE_ESOUND )
+        shutdown_sound();
+        sound = 0;
+#endif
+
+#ifdef VMS
+       return 1;
+#else
+       return 0;
+#endif
+}
+
+#if defined( __hpux ) || defined( __apollo )
+int
+_main(int argc, char **argv)
+{
+  main(argc, argv);
+}
+#endif
+
+#endif /* STANDALONE */
diff --git a/xlock/xlock.h b/xlock/xlock.h
new file mode 100644 (file)
index 0000000..9e8af9f
--- /dev/null
@@ -0,0 +1,574 @@
+#ifndef __XLOCK_XLOCK_H__
+#define __XLOCK_XLOCK_H__
+
+#if !defined( lint ) && !defined( SABER )
+/* #ident      "@(#)xlock.h    4.14 99/06/17 xlockmore" */
+
+#endif
+
+/*-
+ * @(#)xlock.h 4.00 97/01/01 xlockmore
+ *
+ * External interfaces for new modes and SYSV OS defines.
+ *
+ * xscreensaver code, Copyright (c) 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ * Changes maintained by David Bagley <bagleyd@tux.org>
+ * 23-Apr-98: Merged in xlockmore.h from xscreensaver, not much in common yet.
+ * 12-May-95: Added defines for SunOS's Adjunct password file
+ *            Dale A. Harris <rodmur@ecst.csuchico.edu>
+ * 18-Nov-94: Modified for QNX 4.2 w/ Metrolink X server from Brian Campbell
+ *            <brianc@qnx.com>.
+ * 11-Jul-94: added Bool flag: inwindow, which tells xlock to run in a
+ *            window from Greg Bowering <greg@cs.adelaide.edu.au>
+ * 11-Jul-94: patch for Solaris SYR4 from Chris P. Ross <cross@eng.umd.edu>
+ * 28-Jun-94: Reorganized shadow stuff
+ * 24-Jun-94: Reorganized
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 17-Jun-94: patched shadow passwords and bcopy and bzero for SYSV from
+ *            <reggers@julian.uwo.ca>
+ * 21-Mar-94: patched the patch for AIXV3 and HP from
+ *            <R.K.Lloyd@csc.liv.ac.uk>.
+ * 01-Dec-93: added patch for AIXV3 from Tom McConnell
+ *            <tmcconne@sedona.intel.com> also added a patch for HP-UX 8.0.
+ *
+ */
+
+#ifdef STANDALONE
+/* xscreensaver compatibility layer for xlockmore modules. */
+
+/*-
+ * xscreensaver, Copyright (c) 1997, 1998 Jamie Zawinski <jwz@jwz.org>
+ *
+ * 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ *
+ * The definitions in this file make it possible to compile an xlockmore
+ * module into a standalone program, and thus use it with xscreensaver.
+ * By Jamie Zawinski <jwz@jwz.org> on 10-May-97; based on the ideas
+ * in the older xlock.h by Charles Hannum <mycroft@ai.mit.edu>.  (I had
+ * to redo it, since xlockmore has diverged so far from xlock...)
+ */
+
+#if !defined(PROGCLASS) || !defined(HACK_INIT) || !defined(HACK_DRAW)
+ERROR ! Define PROGCLASS, HACK_INIT, and HACK_DRAW before including xlockmore.h
+#endif
+
+#include "config.h"
+
+#include <stdio.h>
+#include <math.h>
+#include "mode.h"
+
+#ifdef USE_GL
+#include "visgl.h"
+#define FreeAllGL(dpy)         /* */
+#endif
+
+/*-
+ * Sun version of OpenGL needs to have the constant
+ * SUN_OGL_NO_VERTEX_MACROS defined in order to compile modes that
+ * use glNormal3f (the number of arguments to the macro changes...)
+ */
+#ifndef HAVE_MESA_GL
+#if defined(__sun) && defined(__SVR4)  /* Solaris */
+#define SUN_OGL_NO_VERTEX_MACROS 1
+#endif /* Solaris */
+#endif /* !HAVE_MESA_GL */
+
+
+/* Some other utility macros.
+ */
+#define SINF(n)                        ((float)sin((double)(n)))
+#define COSF(n)                        ((float)cos((double)(n)))
+#define FABSF(n)               ((float)fabs((double)(n)))
+
+#undef MAX
+#undef MIN
+#undef ABS
+#define MAX(a,b)((a)>(b)?(a):(b))
+#define MIN(a,b)((a)<(b)?(a):(b))
+#define ABS(a)((a)<0 ? -(a) : (a))
+
+/* Maximum possible number of colors (*not* default number of colors.) */
+#define NUMCOLORS 256
+
+/* The globals that screenhack.c expects (initialized by xlockmore.c).
+ */
+#ifdef __cplusplus
+  extern "C" {
+#endif
+char       *defaults[100];
+XrmOptionDescRec options[100];
+#ifdef __cplusplus
+  }
+#endif
+
+#define XSCREENSAVER_PREF 1    /* Disagreements handled with this  :) */
+
+#else /* !STANDALONE */
+#include <sys/types.h>
+#ifdef __NetBSD__
+#include <signal.h>
+#else /* !__NetBSD__ */
+#include <sys/signal.h>
+#endif /* __NetBSD__ */
+#if defined( VMS ) && defined( __cplusplus )
+/* Xlib.h for VMS is not (yet) compatible with C++ *
+ * The resulting warnings are switched off here    */
+#pragma message disable nosimpint
+#endif
+#ifdef VMS
+#include "vms_x_fix.h"
+#endif
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xos.h>
+#include <X11/Xresource.h>
+#if defined( VMS ) && defined( __cplusplus )
+#pragma message enable nosimpint
+#endif
+#include <math.h>
+
+/* I use this for testing SunCplusplus
+   I still get this in the link:
+   Undefined                       first referenced
+   symbol                             in file
+   gethostbyname(const char*)               ../xlock/resource.o
+   kill(long, int)                         ../xlock/logout.o
+   signal(int, void (*)(int))                   ../xlock/logout.o
+
+ */
+#ifdef SunCplusplus
+#ifndef HAVE_USLEEP
+#define HAVE_USLEEP 1
+#endif
+#ifndef SUN_OGL_NO_VERTEX_MACROS
+#define SUN_OGL_NO_VERTEX_MACROS 1
+#endif
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#ifdef USE_MB
+#ifdef __linux__
+/*#define X_LOCALE*/
+#endif
+#include <X11/Xlocale.h>
+#endif
+#else /* HAVE_CONFIG_H */
+
+/* THIS MAY SOON BE DEFUNCT, SHOULD WORK NOW THOUGH FOR IMAKE */
+#define HAVE_GLBINDTEXTURE 1
+#if !defined(__cplusplus) && !defined(c_plusplus)
+#ifdef inline
+#undef inline
+#endif
+#define inline
+#endif
+#ifdef AIXV3
+#define HAVE_SYS_SELECT_H 1
+#else
+#define HAVE_SYS_TIME_H 1
+#endif
+#if !defined( __hpux ) && !defined( apollo ) && !defined( VMS )
+#define HAVE_SETEUID
+#endif
+#define HAVE_FCNTL_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_SYSLOG_H 1
+#define HAVE_GETHOSTNAME 1
+#define HAVE_UNISTD_H 1
+#ifdef VMS
+#if ( __VMS_VER < 70000000 )
+#ifdef USE_XVMSUTILS
+#define HAVE_DIRENT_H 1
+#define HAVE_GETTIMEOFDAY 1
+#define GETTIMEOFDAY_TWO_ARGS 1
+#else /* !USE_XVMSUTILS */
+#ifndef USE_OLD_EVENT_LOOP
+#define USE_OLD_EVENT_LOOP
+#endif /* USE_OLD_EVENT_LOOP */
+#define HAVE_DIRENT_H 0
+#define HAVE_GETTIMEOFDAY 0
+#endif /* !USE_XVMSUTILS */
+#define HAVE_STRDUP 0
+#else /* __VMS_VER >= 70000000 */
+#define HAVE_DIRENT_H 1
+#define HAVE_GETTIMEOFDAY 1
+#define GETTIMEOFDAY_TWO_ARGS 1
+#define HAVE_STRDUP 1
+#endif /* __VMS_VER >= 70000000 */
+#else /* !VMS */
+#define HAVE_DIRENT_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_GETTIMEOFDAY 1
+#define GETTIMEOFDAY_TWO_ARGS 1
+#ifdef ultrix
+#define HAVE_STRDUP 0
+#else /* !ultrix */
+#define HAVE_STRDUP 1
+#endif /* !ultrix */
+#endif /* !VMS */
+#endif /* !HAVE_CONF_H */
+
+#ifndef TEXTLINES
+#define TEXTLINES      40
+#endif
+#define PASSLENGTH        120
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+#ifndef DEF_NONE3D
+#define DEF_NONE3D "Black"
+#endif
+#ifndef DEF_RIGHT3D
+#define DEF_RIGHT3D "Blue"
+#endif
+#ifndef DEF_LEFT3D
+#define DEF_LEFT3D "Red"
+#endif
+#ifndef DEF_BOTH3D
+#define DEF_BOTH3D "Magenta"
+#endif
+
+#ifndef DEF_ICONW
+#define DEF_ICONW         64   /* Age old default */
+#endif
+#ifndef DEF_ICONH
+#define DEF_ICONH         64
+#endif
+
+#ifndef DEF_GLW
+#define DEF_GLW         640
+#endif
+#ifndef DEF_GLH
+#define DEF_GLH         480
+#endif
+
+#define MINICONW          1    /* Will not see much */
+#define MINICONH          1
+
+#ifndef MAXICONW
+#define MAXICONW          256  /* Want users to know the screen is locked */
+#endif
+#ifndef MAXICONH
+#define MAXICONH          256  /* by a particular user */
+#endif
+
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
+#ifndef ABS
+#define ABS(a)  ((a<0)?(-(a)):(a))
+#endif
+
+#ifndef M_E
+#define M_E         2.7182818284590452354      /* e */
+#endif
+#ifndef M_LN2
+#define M_LN2       0.69314718055994530942     /* log e2 */
+#endif
+#ifndef M_PI
+#define M_PI        3.14159265358979323846     /* pi */
+#endif
+#ifndef M_PI_2
+#define M_PI_2      1.57079632679489661923     /* pi/2 */
+#endif
+#ifdef MATHF
+#define SINF(n) sinf(n)
+#define COSF(n) cosf(n)
+#define FABSF(n) fabsf(n)
+#else
+#define SINF(n) ((float)sin((double)(n)))
+#define COSF(n) ((float)cos((double)(n)))
+#define FABSF(n) ((float)fabs((double)(n)))
+#endif
+
+#if VMS
+#include <unixlib.h>
+#endif
+#if 0
+#ifndef uid_t
+#define uid_t int
+#endif
+#ifndef gid_t
+#define gid_t int
+#endif
+#ifndef pid_t
+#define pid_t int
+#endif
+#ifndef size_t
+#define size_t unsigned
+#endif
+#ifndef caddr_t
+#define caddr_t char *
+#endif
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_MEMORY_H
+#include <memory.h>
+#endif
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#if (defined( SYSV ) || defined( SVR4 )) && defined( SOLARIS2 ) && !defined( LESS_THAN_SOLARIS2_5 )
+#ifdef __cplusplus
+  extern "C" {
+#endif
+struct hostent {
+       char       *h_name;     /* official name of host */
+       char      **h_aliases;  /* alias list */
+       int         h_addrtype; /* host address type */
+       int         h_length;   /* length of address */
+       char      **h_addr_list;        /* list of addresses from name server */
+};
+#ifdef __cplusplus
+  }
+#endif
+
+#else
+#include <netdb.h>             /* Gives problems on Solaris 2.6 with gcc */
+#endif
+#include <ctype.h>
+#if HAVE_DIRENT_H
+#ifdef USE_XVMSUTILS
+#if 0
+#include "../xvmsutils/unix_types.h"
+#include "../xvmsutils/dirent.h"
+#else
+#include <X11/unix_types.h>
+#include <X11/dirent.h>
+#endif
+#else /* !USE_XVMSUTILS */
+#include <dirent.h>
+#endif /* !USE_XVMSUTILS */
+#else
+#define dirent direct
+#define NAMELEN(dirent) (dirent)->d_namelen
+#if HAVE_SYS_NDIR_H
+#include <sys/ndir.h>
+#endif
+#if HAVE_SYS_DIR_H
+#include <sys/dir.h>
+#endif
+#if HAVE_NDIR_H
+#include <ndir.h>
+#endif
+#endif
+#if defined(_SYSTYPE_SVR4) && !defined(SVR4)   /* For SGI */
+#define SVR4
+#endif
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64      /* SunOS 3.5 does not define this */
+#endif
+
+#ifndef MAXNAMLEN
+#define MAXNAMLEN       256    /* maximum filename length */
+#endif
+#ifndef DIRBUF
+#define DIRBUF          512    /* buffer size for fs-indep. dirs */
+#endif
+
+#if defined(__cplusplus) || defined(c_plusplus)
+#define CLASS c_class
+#else
+#define CLASS class
+#endif
+
+#if (!defined( AFS ) && !defined( SIA ) && defined( HAVE_SHADOW ) && !defined( OSF1_ENH_SEC ) && !defined( HP_PASSWDETC ) && !defined( VMS ) && !defined( PAM ))
+#define FALLBACK_XLOCKRC
+#endif
+
+#define t_String        0
+#define t_Float         1
+#define t_Int           2
+#define t_Bool          3
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+typedef struct {
+       caddr_t    *var;
+       char       *name;
+       char       *classname;
+       char       *def;
+       int         type;
+} argtype;
+
+typedef struct {
+       char       *opt;
+       char       *desc;
+} OptionStruct;
+
+typedef struct {
+       int         numopts;
+       XrmOptionDescRec *opts;
+       int         numvarsdesc;
+       argtype    *vars;
+       OptionStruct *desc;
+} ModeSpecOpt;
+
+#ifdef USE_MODULES
+typedef struct {
+       char       *cmdline_arg;        /* mode name */
+       char       *init_name;  /* name of init a mode */
+       char       *callback_name;      /* name of run (tick) a mode */
+       char       *release_name;       /* name of shutdown of a mode */
+       char       *refresh_name;       /* name of mode to repaint */
+       char       *change_name;        /* name of mode to change */
+       char       *unused_name;        /* name for future expansion */
+       ModeSpecOpt *msopt;     /* this mode's def resources */
+       int         def_delay;  /* default delay for mode */
+       int         def_count;
+       int         def_cycles;
+       int         def_size;
+       int         def_ncolors;
+       float       def_saturation;
+       char       *def_bitmap;
+       char       *desc;       /* text description of mode */
+       unsigned int flags;     /* state flags for this mode */
+       void       *userdata;   /* for use by the mode */
+} ModStruct;
+
+#endif
+#ifdef __cplusplus
+  }
+#endif
+
+/* this must follow definition of ModeSpecOpt */
+#include "mode.h"
+
+#define CHECK_OLD_ARGS         /* check depreciated args */
+
+#ifdef OPENGL_MESA_INCLUDES
+/* Allow OPEN GL using MESA includes */
+#undef MESA
+#endif
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern char * ProgramName;
+extern void getResources(Display ** displayp, int argc, char **argv);
+extern void finish(Display * display, Bool closeDisplay);
+#ifdef HAS_MMOV
+#define error xlock_error
+#endif
+extern void error(const char *buf);
+#ifndef DECLARED_GETENV
+extern char * getenv(const char *);
+#endif
+#ifdef __cplusplus
+  }
+#endif
+
+#ifdef VMS
+#define FORK vfork
+#else
+#define FORK fork
+#endif
+
+#ifdef LESS_THAN_AIX3_2
+#undef NULL
+#define NULL 0
+#endif /* LESS_THAN_AIX3_2 */
+
+#ifndef SYSLOG_WARNING
+#define SYSLOG_WARNING LOG_WARNING
+#endif
+#ifndef SYSLOG_NOTICE
+#define SYSLOG_NOTICE LOG_NOTICE
+#endif
+#ifndef SYSLOG_INFO
+#define SYSLOG_INFO LOG_INFO
+#endif
+
+#if (defined( USE_RPLAY ) || defined( USE_NAS ) || defined( USE_VMSPLAY ) || \
+     defined( HAS_MMOV ) || defined( DEF_PLAY ) || defined( USE_ESOUND ))
+#define USE_SOUND
+#endif
+
+#ifdef USE_MB
+#ifdef __cplusplus
+  extern "C" {
+#endif
+extern XFontSet fontset;
+#ifdef __cplusplus
+  }
+#endif
+
+#define XTextWidth(font,string,length) \
+               XmbTextEscapement(fontset,string,length)
+#define XDrawString(display,window,gc,x,y,string,length) \
+               XmbDrawString(display,window,fontset,gc,x,y,string,length)
+#define XDrawImageString(display,window,gc,x,y,string,length) \
+               XmbDrawImageString(display,window,fontset,gc,x,y,string,length)
+#endif
+
+#endif /* STANDALONE */
+
+/* COMMON STUFF */
+#if HAVE_GETTIMEOFDAY
+#ifdef GETTIMEOFDAY_TWO_ARGS
+#define GETTIMEOFDAY(t) (void)gettimeofday(t,NULL);
+#else
+#define GETTIMEOFDAY(t) (void)gettimeofday(t);
+#endif
+#endif
+
+#ifndef CLOCKS_PER_SEC
+#define        CLOCKS_PER_SEC          1000000
+#endif
+
+
+/* There is some overlap so it can be made more efficient */
+#define ERASE_IMAGE(d,w,g,x,y,xl,yl,xs,ys) \
+if (yl<y) \
+(y<(yl+ys))?XFillRectangle(d,w,g,xl,yl,xs,y-(yl)): \
+XFillRectangle(d,w,g,xl,yl,xs,ys); \
+else if (yl>y) \
+(y>(yl-(ys)))?XFillRectangle(d,w,g,xl,y+ys,xs,yl-(y)): \
+XFillRectangle(d,w,g,xl,yl,xs,ys); \
+if (xl<x) \
+(x<(xl+xs))?XFillRectangle(d,w,g,xl,yl,x-(xl),ys): \
+XFillRectangle(d,w,g,xl,yl,xs,ys); \
+else if (xl>x) \
+(x>(xl-(xs)))?XFillRectangle(d,w,g,x+xs,yl,xl-(x),ys): \
+XFillRectangle(d,w,g,xl,yl,xs,ys)
+
+#include "random.h"
+#endif /* __XLOCK_XLOCK_H__ */
diff --git a/xlock/xlock.man b/xlock/xlock.man
new file mode 100644 (file)
index 0000000..7a57bcc
--- /dev/null
@@ -0,0 +1,2206 @@
+.\" @(#)xlock.man      5.01 2001/05/18
+.\" Copyright (c) 1991 - Patrick J. Naughton
+.\" xlockmore updates from David A. Bagley
+.TH XLOCK 1 "18 May 2001" "X11R6 Contrib"
+.SH NAME
+xlock \- Locks the local X display until a password is entered.
+.sp
+.IX xlock#(1) "" "\fLxlock\fP(1)"
+.SH SYNOPSIS
+.B xlock
+[
+.BI \-help
+]
+[
+.BI \-version
+]
+[
+.BI \-resources
+]
+[
+.BI \-display " displayname"
+]
+[
+.BI \-visual " visualname"
+]
+[
+.BI \-name " resourcename"
+]
+[
+.BI \-mode " modename"
+]
+[
+.BI \-delay " usecs"
+]
+[
+.BI \-batchcount " num"
+]
+[
+.BI \-count " num"
+]
+[
+.BI \-cycles " num"
+]
+[
+.BI \-ncolors " num"
+]
+[
+.BI \-size " num"
+]
+[
+.BI \-saturation " value"
+]
+[
+.BI \-erasemode " modename"
+]
+[
+.BI \-erasedelay " usecs"
+]
+[
+.BI -/+allowaccess
+]
+[
+.BI \-vtlock " modename"
+]
+[
+.BI -/+nolock
+]
+[
+.BI -/+inwindow
+]
+[
+.BI -/+inroot
+]
+[
+.BI -/+remote
+]
+[
+.BI -/+mono
+]
+[
+.BI -/+allowroot
+]
+[
+.BI -/+debug
+]
+[
+.BI -/+description
+]
+[
+.BI -/+echokeys
+]
+[
+.BI -/+enablesaver
+]
+[
+.BI -/+resetsaver
+]
+[
+.BI -/+grabmouse
+]
+[
+.BI -/+grabserver
+]
+[
+.BI -/+install
+]
+[
+.BI -/+mousemotion
+]
+[
+.BI -/+sound
+]
+[
+.BI -/+timeelapsed
+]
+[
+.BI -/+usefirst
+]
+[
+.BI -/+verbose
+]
+[
+.BI \-nice " level"
+]
+[
+.BI \-lockdelay " seconds"
+]
+[
+.BI \-timeout " seconds"
+]
+[
+.BI \-font " fontname"
+]
+[
+.BI \-planfont " fontname"
+]
+[
+.BI \-bg " color"
+]
+[
+.BI \-fg " color"
+]
+[
+.BI \-background " color"
+]
+[
+.BI \-foreground " color"
+]
+[
+.BI \-username " string"
+]
+[
+.BI \-password " string"
+]
+[
+.BI \-info " string"
+]
+[
+.BI \-validate " string"
+]
+[
+.BI \-invalid " string"
+]
+[
+.BI \-geometry " geom"
+]
+[
+.BI \-icongeometry " geom"
+]
+[
+.BI \-glgeometry " geom"
+]
+[
+.BI -/+wireframe
+]
+[
+.BI -/+showfps
+]
+[
+.BI \-fpsfont " fontname"
+]
+[
+.BI -/+fpstop
+]
+[
+.BI -/+use3d
+]
+[
+.BI \-delta3d " value"
+]
+[
+.BI \-none3d " color"
+]
+[
+.BI \-right3d " color"
+]
+[
+.BI \-left3d " color"
+]
+[
+.BI \-both3d " color"
+]
+[
+.BI \-program " programname"
+]
+[
+.BI \-messagesfile " formatted-filename"
+]
+[
+.BI \-messagefile " filename"
+]
+[
+.BI \-message " string"
+]
+[
+.BI \-messagefont " fontname"
+]
+[
+.BI \-bitmap " filename"
+]
+[
+.BI \-cpasswd " crypted-password"
+]
+[
+.BI \-forceLogout " minutes"
+]
+[
+.BI \-logoutButtonLabel " textstring"
+]
+[
+.BI \-logoutButtonHelp " textstring"
+]
+[
+.BI \-logoutFailedString " textstring"
+]
+[
+.BI -/+dtsaver
+]
+[
+.BI \-modulepath " path"
+]
+[
+.BI \-locksound " string"
+]
+[
+.BI \-infosound " string"
+]
+[
+.BI \-validsound " string"
+]
+[
+.BI \-invalidsound " string"
+]
+[
+.BI \-startCmd " string"
+]
+[
+.BI \-endCmd " string"
+]
+[
+.BI \-logoutCmd " string"
+]
+
+.SH DESCRIPTION
+.B xlock
+locks the X server till the user enters their password at the keyboard.
+While
+.B xlock
+is running,
+all new server connections are refused.
+The screen saver is disabled.
+The mouse cursor is turned off.
+The screen is blanked and a changing pattern is put on the screen.
+If a key or a mouse button is pressed then the user is prompted for the
+password of the user who started
+.BR xlock .
+
+If the correct password is typed, then the screen is unlocked and the X
+server is restored.  When typing the password Control-U and Control-H are
+active as kill and erase respectively.  To return to the locked screen,
+click in the small icon version of the changing pattern.
+
+In the lower part of the password screen a text is displayed.  This
+message is taken from the first file of the following that exists:
+$HOME/.xlocktext, $HOME/.plan, or $HOME/.signature.
+
+On systems which support new BSD style authentication, the password
+may be prefixed by an authentication style followed by a colon
+(i.e. "style:password").  See the login.conf(5) for more information
+on authentication styles.
+
+.SH "NOTE ON ETIQUETTE"
+.I Xlock
+should not be used on public terminals when there is a high demand for them.
+
+If you find a public terminal that has been locked by another user and
+there are no other terminals available, and the terminal appears to have
+been left idle for a while (normally more than 15 minutes), it is fair to
+try to reset the session in some manner.
+
+.SH OPTIONS
+.TP 5
+.BI \-help
+Print options and a brief description to standard output.
+.TP 5
+.BI \-version
+Print version number (if >= 4.00) to standard output.
+.TP 5
+.BI \-resources
+Print default resource file to standard output.
+.TP 5
+.BI \-display \ displayname
+The
+.I display
+option sets the X11 display to lock.
+.B xlock
+locks all available screens on a given server,
+and restricts you to locking only a local server such as
+.BI unix:0,
+.BI localhost:0,
+or
+.BI :0
+unless you set the
+.B \-remote
+option.
+.TP 5
+.BI \-visual \ visualname
+.I visualname
+which is one of "StaticGray", "GrayScale", "StaticColor", "PseudoColor",
+"TrueColor", "DirectColor", or "default".  default used to set the screen's
+default visual (the visual of the root window).
+.TP 5
+.BI \-name \ resourcename
+.I resourcename
+is used instead of
+.B XLock
+when looking for resources to configure
+.BR xlock .
+.TP 5
+.BI \-mode \ modename
+As of this writing there are over 90 display modes supported
+(plus one more for random selection of one of these).
+.TP 8
+.B ant
+Shows Langton's and Turk's generalized ants.
+.TP 8
+.B atlantis
+Shows moving sharks/whales/dolphin.  May not be available depending on how
+it was configured.
+.TP 8
+.B ball
+Shows bouncing balls.
+.TP 8
+.B bat
+Shows bouncing flying bats.
+.TP 8
+.B blot
+Shows Rorschach's ink blot test.
+.TP 8
+.B bouboule
+Shows Mimi's bouboule of moving stars.
+.TP 8
+.B bounce
+Shows bouncing footballs.
+.TP 8
+.B braid
+Shows random braids and knots.
+.TP 8
+.B bubble
+Shows popping bubbles.
+.TP 8
+.B bubble3d
+Shows Richard Jones's GL bubbles.  May not be available depending on how
+it was configured.
+.TP 8
+.B bug
+Shows Palmiter's bug evolution and a garden of Eden.
+.TP 8
+.B clock
+Shows Packard's oclock.
+.TP 8
+.B coral
+Shows a coral reef.
+.TP 8
+.B crystal
+Shows polygons in 2D plane groups.
+.TP 8
+.B daisy
+Shows a meadow of daisies.
+.TP 8
+.B dclock
+Shows a floating digital clock or message.
+.TP 8
+.B deco
+Shows art as ugly as sin.
+.TP 8
+.B demon
+Shows Griffeath's cellular automata.
+.TP 8
+.B dilemma
+Shows Lloyd's Prisoner's Dilemma simulation.
+.TP 8
+.B discrete
+Shows various discrete maps.
+.TP 8
+.B dragon
+Shows Deventer's Hexagonal Dragons Maze.
+.TP 8
+.B drift
+Shows cosmic drifting flame fractals.
+.TP 8
+.B cage
+Shows the Impossible Cage, an Escher-like GL scene.  May not be available
+depending on how it was configured.
+.TP 8
+.B euler2d
+Shows a simulation of 2D incompressible inviscid fluid.
+.TP 8
+.B eyes
+Shows eyes following a bouncing grelb.
+.TP 8
+.B fadeplot
+Shows a fading plot of sine squared.
+.TP 8
+.B fire
+Shows a 3D fire-like image.  May not be available depending on how it was
+configured.
+.TP 8
+.B flag
+Shows a waving flag image.  This may be text or a graphic image.
+Default text is the hostname and operating system.
+.TP 8
+.B flame
+Shows cosmic flame fractals.
+.TP 8
+.B flow
+Shows dynamic strange attractors.
+.TP 8
+.B forest
+Shows binary trees of a fractal forest.
+.TP 8
+.B galaxy
+Shows crashing spiral galaxies.
+.TP 8
+.B gears
+Shows GL's gears.  May not be available depending on how it was configured.
+.TP 8
+.B glplanet
+Animates texture mapped sphere (planet)
+.TP 8
+.B goop
+Shows goop from a lava lamp.
+.TP 8
+.B grav
+Shows orbiting planets.
+.TP 8
+.B helix
+Shows string art.
+.TP 8
+.B hop
+Shows real plane iterated fractals.
+.TP 8
+.B hyper
+Shows spinning n-dimensional hypercubes.
+.TP 8
+.B ico
+Shows a bouncing polyhedron.
+.TP 8
+.B ifs
+Shows a modified iterated function system.
+.TP 8
+.B image
+Shows randomly appearing logos.
+.TP 8
+.B juggle
+Shows a Juggler, juggling.
+.TP 8
+.B julia
+Shows the Julia set.
+.TP 8
+.B kaleid
+Shows Brewster's Kaleidoscope.
+.TP 8
+.B kumppa
+Shows kumppa.
+.TP 8
+.B laser
+Shows spinning lasers.
+.TP 8
+.B life
+Shows Conway's game of life.
+.TP 8
+.B life1d
+Shows Wolfram's game of 1D life.
+.TP 8
+.B life3d
+Shows Bays' game of 3D life.
+.TP 8
+.B lightning
+Shows Keith's fractal lightning bolts.
+.TP 8
+.B lisa
+Shows animated lissajous loops.
+.TP 8
+.B lissie
+Shows lissajous worms.
+.TP 8
+.B loop
+Shows Langton's self-producing loops.
+.TP 8
+.B mandelbrot
+Shows mandelbrot sets.
+.TP 8
+.B marquee
+Shows text.
+.TP 8
+.B matrix
+Shows the matrix.
+.TP 8
+.B maze
+Shows a random maze and a depth first search solution.
+.TP 8
+.B moebius
+Shows the Moebius Strip II, an Escher-like GL scene with ants.  May not be
+available depending on how it was configured.
+.TP 8
+.B molecule
+Draws molecules, based on coordinates from PDB (Protein Data Base) files.
+.TP 8
+.B morph3d
+Shows GL morphing polyhedra.  May not be available depending on how it
+was configured.
+.TP 8
+.B mountain
+Shows Papo's mountain range.
+.TP 8
+.B munch
+Shows munching squares.
+.TP 8
+.B nose
+Shows a man with a big nose runs around spewing out text.
+.TP 8
+.B pacman
+Shows Pacman(tm).
+.TP 8
+.B penrose
+Shows Penrose's quasiperiodic tilings.
+.TP 8
+.B petal
+Shows various GCD Flowers.
+.TP 8
+.B pipes
+Shows a self-building pipe system.  May not be available depending on how it
+was configured.
+.TP 8
+.B polyominoes
+Shows attempts to place polyominoes into a rectangle.
+.TP 8
+.B puzzle
+Shows a puzzle being scrambled and then solved.
+.TP 8
+.B pyro
+Shows fireworks.
+.TP 8
+.B qix
+Shows spinning lines a la Qix(tm).
+.TP 8
+.B roll
+Shows a rolling ball.
+.TP 8
+.B rotor
+Shows Tom's Roto-Rooter.
+.TP 8
+.B rubik
+Shows an auto-solving Rubik's Cube.  May not be available depending on how it
+was configured.
+.TP 8
+.B sballs
+Shows balls spinning like crazy in GL.  May not be available depending on how
+it was configured.
+.TP 8
+.B scooter
+Shows a journey through space tunnel and stars.
+.TP 8
+.B shape
+Shows stippled rectangles, ellipses, and triangles.
+.TP 8
+.B sierpinski
+Shows a Sierpinski's triangle.
+.TP 8
+.B sierpinski3d
+Shows a Sierpinski's gasket.
+.TP 8
+.B slip
+Shows slipping blits.
+.TP 8
+.B solitare
+Shows Klondike's game of solitare.
+.TP 8
+.B space
+Shows a journey into deep space.
+.TP 8
+.B sphere
+Shows a bunch of shaded spheres.
+.TP 8
+.B spiral
+Shows a helical locus of points.
+.TP 8
+.B spline
+Shows colorful moving splines.
+.TP 8
+.B sproingies
+Shows Sproingies!  Nontoxic.  Safe for pets and small children.
+May not be available depending on how it was configured.
+.TP 8
+.B stairs
+Shows Infinite Stairs, an Escher-like GL scene.
+May not be available depending on how it was configured.
+.TP 8
+.B star
+Shows a star field with a twist.
+.TP 8
+.B starfish
+Shows starfish.
+.TP 8
+.B strange
+Shows strange attractors.
+.TP 8
+.B superquadrics
+Shows 3D mathematical shapes.  May not be available depending on how it
+was configured.
+.TP 8
+.B swarm
+Shows a swarm of bees following a wasp.
+.TP 8
+.B swirl
+Shows animated swirling patterns.
+.TP 8
+.B t3d
+Shows a Flying Balls Clock Demo.
+.TP 8
+.B tetris
+Shows an autoplaying tetris game.
+.TP 8
+.B text3d
+Shows 3D moving texts.
+.TP 8
+.B thornbird
+Shows an animated Bird in a Thorn Bush fractal map.
+.TP 8
+.B tik_tak
+Shows rotating polygons.
+.TP 8
+.B triangle
+Shows a triangular mountain range.
+.TP 8
+.B tube
+Shows an animated tube.
+.TP 8
+.B turtle
+Shows turtle fractals.
+.TP 8
+.B vines
+Shows fractal-like vines.
+.TP 8
+.B voters
+Shows Dewdney's Voters.
+.TP 8
+.B wator
+Shows Dewdney's Water-Torus planet of fish and sharks.
+.TP 8
+.B wire
+Shows a random circuit with 2 electrons.
+.TP 8
+.B world
+Shows spinning Earths.
+.TP 8
+.B worm
+Shows wiggly worms.
+.TP 8
+.B xjack
+Shows Jack having one of those days.
+.TP 8
+.B xcl
+Shows a Control Line combat model race
+.TP 8
+.B blank
+Shows nothing but a black screen.  Does not show up in random mode.
+.TP 8
+.B bomb
+Shows a bomb and will autologout after a time.  Does not show up in random
+mode and may be available depending on how it was configured.
+.TP 8
+.B random
+Shows a random mode from above except blank (and bomb).
+
+.TP 5
+.BI \-delay \ usecs
+The
+.I delay
+option sets the speed at which a mode will operate.  It simply sets the
+number of microseconds to delay between batches of animations.  In
+blank mode, it is important to set this to some small number of seconds,
+because the keyboard and mouse are only checked after each delay, so you
+cannot set the delay too high, but a delay of zero would needlessly
+consume cpu checking for mouse and keyboard input in a tight loop, since
+blank mode has no work to do.
+.TP 5
+.BI \-count \ num
+The
+.I batchcount
+option sets number of
+.I things
+to do per batch to
+.I num .
+
+In ant mode this refers the number of ants.
+
+In atlantis mode it is the number of sharks.
+
+In ball mode it is the number of balls.
+
+In bat mode it is the number of bats, could be less because of conflicts.
+
+In blot mode this refers to the number of pixels rendered in the same color.
+
+In bouboule mode it is the number of stars.
+
+In bounce mode it is the number of balls, could be less because of conflicts.
+
+In braid mode it is the upper bound number of strands.
+
+In bubble mode it is the number of bubbles.
+
+In bubble3d mode it is the number of bubbles.
+
+In bug mode it is the number of bugs, could be less because of conflicts.
+
+In cage mode it is means nothing.
+
+In clock mode it is the percentage of the screen, but less than 100%.
+
+In coral mode it is the number of seeds.
+
+In crystal mode it is the number of polygons.
+
+In daisy mode it is the number flowers that make a meadow.
+
+In dclock mode it means nothing.
+
+In deco mode it is the depth.
+
+In demon mode this refers the number of colors.
+
+In dilemma mode this refers the number of initial defectors.
+
+In discrete mode it is the number of points.
+
+In drift mode it is the number of levels to recurse (larger = more complex).
+
+In dragon mode it means nothing.
+
+In euler2d mode it is the number of segments.
+
+In eyes mode it is the number of eyes.
+
+In fadeplot mode it is the number of steps.
+
+In fire mode it is the number of fire particles (set it to 0 to have rain).
+
+In flag mode it means nothing.
+
+In flame mode it is the number of levels to recurse (larger = more complex).
+
+In flow mode it is the number of bees.
+
+In forest mode it is the number trees that make a forest.
+
+In galaxy mode it means the number of galaxies.
+
+In gears mode it is the number of degrees to rotate the set of gears by.
+
+In glplanet mode it is the number of hundredth degrees to roll the planet by.
+
+In goop mode it is the number of blobs per plane.
+
+In grav mode it is the number of planets.
+
+In helix mode it means nothing.
+
+In hop mode this refers to the number of pixels rendered in the same color.
+
+In hyper mode it the number of dimensions.
+
+In ico mode it is the ith platonic solid.
+
+In ifs mode it means nothing.
+
+In image mode it means it is the number of logos on screen at once.
+
+In juggle mode it is speed in milliseconds betewwen a throw and the next
+catch.
+
+In julia mode it is the depth of recursion.
+
+In kaleid mode it is the number of pens.
+
+In kumppa mode it means nothing.
+
+In lament mode it means nothing.
+
+In laser mode it is the number lasers.
+
+In life mode it is the number of generations before a glider is introduced.
+
+In life1d mode it means nothing.
+
+In life3d mode it is the number of generations before a glider is introduced.
+
+In lisa mode it is the number of loops.
+
+In lissie mode it is the number of worms.
+
+In loop mode it is the number of flaws.
+
+In mandelbrot mode it is the order.
+
+In marquee mode it means nothing.
+
+In matrix mode it means nothing.
+
+In maze mode it means nothing.
+
+In moebius mode it is means nothing.
+
+In molecule mode it means nothing.
+
+In morph3d mode it is the ith platonic solid.
+
+In mountain mode it is the number of mountains.
+
+In munch mode it means nothing.
+
+In nose mode it means nothing.
+
+In qix mode it is the number of points.
+
+In pacman mode it means the number of ghosts.
+
+In penrose mode it means nothing.
+
+In petal mode it the greatest random number of petals.
+
+In pipes mode it shows different joints, 0 random, 1 spherical, 2 bolted
+elbow, 3 elbow, and 4 alternating.
+
+In polyominoes mode it means nothing.
+
+In puzzle mode it the number of moves.
+
+In pyro mode it is the maximum number flying rockets at one time.
+
+In roll mode it is the number of points.
+
+In rotor mode it is the number of rotor thingys which whirr...
+
+In rubik mode it is the number of moves.
+
+In sballs mode it is the number of spheres.
+
+In scooter mode it is the number of doors.
+
+In shape mode it means nothing.
+
+In sierpinski mode it is the number of points.
+
+In slip mode it means nothing.
+
+In solitare mode it means nothing.
+
+In space mode it is the number of stars.
+
+In sphere mode it means nothing.
+
+In spiral mode it is the number of spirals.
+
+In spline mode it is the number of points "splined".
+
+In sproingies mode it is the number of sproingies.
+
+In stairs mode it is means nothing.
+
+In star mode it is the number of stars on the screen at once.
+
+In starfish mode it means nothing.
+
+In strange mode it means nothing.
+
+In superquadrics mode its the number of horizontal and vertical lines in
+the superquadric.
+
+In swirl mode it means the number of "knots".
+
+In swarm mode it is the number of bees.
+
+In t3d mode it means nothing.
+
+In tetris mode it means nothing.
+
+In text3d mode it means nothing.
+
+In thornbird mode it is the number of points.
+
+In triangular mode it is the number of mountains.
+
+In tube mode it is a rectangle (= 1), an ellipse (= 2), or a polygon if
+greater.
+
+In turtle mode it means nothing.
+
+In vines mode it is draw a complete vine (= 0) or a portion (= 1).
+
+In voters mode it means the number of parties, 2 or 3.
+
+In wator mode it means the breed time for the fish.
+
+In wire mode it means the length of the circuit.
+
+In world mode it is the number of worlds.
+
+In worm mode it is the number of worms.
+
+In xcl mode it represents the number of planes.
+
+In xjack mode it means nothing.
+
+In blank mode it means nothing.
+
+In bomb mode it means the number of minutes to autologout.
+
+A negative
+.I count
+allows for randomness.  The range from the minimum allowed nonnegative
+.I count
+for a particular mode to the
+ABS(
+.I count
+) (or maximum allowed
+.I count
+, whichever is less).
+.TP 5
+.BI \-batchcount \ num
+The
+.I batchcount
+option is depreciated but should still work as
+.I count.
+.TP 5
+.BI \-cycles \ num
+The
+.I cycles
+option sets the number of cycles until time out for ant, blot, braid,
+bug, clock, crystal, daisy, deco, demon, dilemma, discrete, dragon,
+eyes, flag, flow, forest, galaxy, helix, hop, hyper, ico,
+laser, life, life1d, life3d, lisa, lissie, loop, mandelbrot, mountain,
+petal, sierpinski, shape, spline +erase, t3d, thornbird, triangle, tube,
+voters, wator, and wire.  For euler2d and worm it is the length
+of the lines, for atlantis it is the shark speed,
+for fadeplot, julia and spiral it is the length of the trail of dots,
+munch it is the minimum size of the squares,
+for kaleid it is the % of black,
+for qix it is the number of lines,
+for spline -erase it means the number of
+splines * 64 (for compatibility with +erase),
+for gears it is the number of degrees to increment the spin of each gear by,
+for glplanet it is the number of hundredth degrees to rotate the planet by,
+for molecule it is the time in seconds until timeout,
+for pipes it is the number of systems to draw before clearing the screen,
+for rubik it is the number of steps to complete a 90 move,
+for sballs it is the sphere speed value,
+for scooter it is the speed,
+for superquadrics it is the number of frames it takes to morph from one
+shape to another.
+for text3d it is the number of times drawing a word before the next one,
+For others it means nothing.
+.TP 5
+.BI \-size \ num
+The
+.I size
+option sets the size maximum size of a star in bouboule, pyro and star,
+size of ball in ball and bounce, size of bat in bat,
+maximum size of bubble in bubble, size of clock in clock,
+minimum size of rectangles in deco, size of the polygons in crystal and
+tik_tak, size of polyhedron in ico, size of lissie in lissie, size of dots
+of flag, for kaleid it is the symmetry,
+width of maze hallway, size of side of penrose tile, radius of loop in lisa,
+radius of ball in roll, number of corners in sierpinski,
+number of stars in scooter, size of tube in tube, width of worm in worm,
+line width in rotor, size of cells in ant, bug, dilemma, dragon, life,
+life1d, pacman, tetris, voters, wator, and wire.
+In pipes it is the maximum length of a system.
+In atlantis it is the shark size.
+A negative number allows for randomness, similar to
+.I count.
+In fire, gears, sballs and sproingies it is the size of the screen,
+this is because on many slow systems it runs too slow when the picture
+covers the full screen.
+.TP 5
+.BI \-ncolors \ num
+The
+.I ncolors
+option sets the maximum number of colors to be used.
+.TP 5
+.BI \-saturation \ value
+The
+.I saturation
+option sets saturation of the color ramp used to
+.I value .
+0 is grayscale and 1 is very rich color.  0.4 is a nice pastel.
+.TP 5
+.BI \-erasemode \ modename
+As of this writing there are over 9 erase modes supported
+(if its not chosen its assumed random).
+The erase modes are random_lines, random_squares, venetian, triple_wipe,
+quad_wipe, circle_wipe, three_circle_wipe, squaretate, no_fade.
+.TP 5
+.BI \-erasedelay \ usecs
+The
+.I erasedelay
+option sets the number of microseconds for steps of the
+.B erasemode
+(a setting of 0 and the
+.B erasemode
+is bypassed).
+.TP 5
+.B +/-nolock
+The
+.I nolock
+option causes
+.B xlock
+to only draw the patterns and not lock the display.
+A key press or a mouse click will terminate the screen saver.
+.TP 5
+.B -/+inwindow
+Runs
+.B xlock
+in a window, so that you can iconify, move, or resize it and
+still use your screen for other stuff.  When running in a window,
+.B xlock
+no longer locks your screen, it just looks good.
+.TP 5
+.B -/+inroot
+Runs
+.B xlock
+in your root window.  Like the
+.I inwindow
+option it no longer locks the screen, it just looks good.
+.TP 5
+.B -/+remote
+The
+.I remote
+option tells
+.B xlock
+to not stop you from locking remote X11 servers.  This option should be
+used with care and is intended mainly to lock X11 terminals which cannot
+run
+.B xlock
+locally.  If you lock someone else's workstation, they will have to know
+.B your
+password to unlock it.  Using
+.I +remote
+overrides any resource derived values for
+.I remote
+and prevents
+.B xlock
+from being used to lock other X11 servers.  (Use `+' instead of `-' to
+override resources for other options that can take the `+' modifier
+similarly.)
+.TP 5
+.B -/+mono
+The
+.I mono
+option causes
+.B xlock
+to display monochrome, (black and white) pixels rather than the default
+colored ones on color displays.
+.TP 5
+.B -/+allowaccess
+This option is required for servers which do not allow clients to modify
+the host access control list.  It is also useful if you need to run x
+clients on a server which is locked for some reason...  When
+.I allowaccess
+is true, the X11 server is left open for clients to attach and thus
+lowers the inherent security of this lock screen.  A side effect of using
+this option is that if
+.B xlock
+is killed -KILL, the access control list is not lost.
+.TP 5
+.BI \-vtlock \ modename
+This option is used on a XFree86 system to manage VT switching in
+[off|noswitch|switch|restore] mode.
+.TP 10
+.I off
+means no VT switch locking.
+.TP 10
+.I switch
+means VT switch locking + switching to xlock VT when activated.
+.TP 10
+.I restore
+means VT switch locking + switching to xlock VT when activated +
+switching back to previous VT when desactivated.
+.TP 10
+.I noswitch
+means VT switch locking only when xlock VT is active.
+.TP 5
+.B -/+allowroot
+The
+.I allowroot
+option allows the root password to unlock the server as well as the user
+who started
+.BR xlock .
+May not be able to turn this on and off depending on your system and how
+.B xlock
+was configured.
+.TP 5
+.B -/+debug
+Allows
+.B xlock
+to be debugged by doing all but locking the screen.
+.TP 5
+.B -/+description
+The
+.I description
+option causes
+.B xlock
+shows a mode description above password window.  The default is to
+show this description.
+.TP 5
+.B -/+echokeys
+The
+.I echokeys
+option causes
+.B xlock
+to echo '?' characters for each key typed into the password prompt.
+Some consider this a security risk, so the default is to not echo
+anything.
+.TP 5
+.B -/+enablesaver
+By default
+.B xlock
+will disable the normal X server's screen saver since
+it is in effect a replacement for it.  Since it is possible to set delay
+parameters long enough to cause phosphor burn on some displays, this
+option will turn back on the default screen saver which is very careful
+to keep most of the screen black.
+.TP 5
+.B -/+resetsaver
+By default
+.B xlock
+will call XResetScreenSaver.  This may be undesirable with DPMS monitors.
+.TP 5
+.B -/+grabmouse
+The
+.I grabmouse
+option causes
+.B xlock
+to grab the mouse and keyboard, this is the default.
+.B xlock
+can not lock the screen without this.
+.TP 5
+.B -/+grabserver
+The
+.I grabserver
+option causes
+.B xlock
+to grab the server.  This is not usually needed but some unsecure X servers
+can be defeated without this.
+.TP 5
+.B -/+install
+Allows
+.B xlock
+to install its own colormap if
+.B xlock
+runs out of colors.
+May not work on with some window managers (fvwm) and does not work with
+the -inroot option.
+.TP 5
+.B -/+mousemotion
+Allows you to turn on and off the sensitivity to the mouse to bring up
+the password window.
+.TP 5
+.B -/+sound
+Allows you to turn on and off sound if installed with the capability.
+.TP 5
+.B -/+timeelapsed
+Allows you to find out how long a machine is locked so you can complain
+to an administrator that someone is hogging a machine.
+.TP 5
+.B -/+usefirst
+The
+.I usefirst
+option causes
+.B xlock
+to use the keystroke which got you to the password screen as the first
+character in the password.  The default is to ignore the first key
+pressed.
+.TP 5
+.B -/+verbose
+Verbose mode, tells what options it is going to use.
+.TP 5
+.BI \-nice \ nicelevel
+The
+.I nice
+option sets system nicelevel of the
+.B xlock
+process to
+.I nicelevel .
+.TP 5
+.BI \-lockdelay \ seconds
+The
+.I lockdelay
+option sets the number of
+.I seconds
+before the screen needs a password to be unlocked.  Good for use with
+an autolocking mechanism like xautolock(1).
+.TP 5
+.BI \-timeout \ seconds
+The
+.I timeout
+option sets the number of
+.I seconds
+before the password screen will time out.
+.TP 5
+.BI \-font \ fontname
+The
+.I font
+option sets the font to be used on the prompt screen.
+.TP 5
+.BI \-planfont \ fontname
+option sets the font to be used for the text that is displayed in
+the lower part of the password screen.
+.TP 5
+.BI \-fg \ color
+The
+.I fg
+option sets the color of the text on the password screen to
+.I color .
+.TP 5
+.BI \-bg \ color
+The
+.I bg
+option sets the color of the background on the password screen to
+.I color .
+.TP 5
+.BI \-foreground \ color
+The
+.I foreground
+option sets the color of the text on the password screen to
+.I color .
+.TP 5
+.BI \-background \ color
+The
+.I background
+option sets the color of the background on the password screen to
+.I color .
+.TP 5
+.BI \-username \ string
+Text
+.I string
+is shown in front of user name, defaults to "Name: ".
+.TP 5
+.BI \-password \ string
+Text
+.I string
+is the password prompt string, defaults to "Password: ".
+.TP 5
+.BI \-info \ string
+Text
+.I string
+is an informational message to tell the user what to do, defaults to
+"Enter password to unlock; select icon to lock.".
+.TP 5
+.BI \-validate \ string
+Text
+.I string
+is a message shown while validating the password, defaults to
+"Validating login..."
+.TP 5
+.BI \-invalid \ string
+Text
+.I string
+is a message shown when password is invalid, defaults to
+"Invalid login."
+.TP 5
+.BI \-geometry \ geom
+The
+.I geometry
+option sets
+.I geom
+the size and offset of the lock window (normally the entire screen).
+The entire screen format is still used for entering the password.  The
+purpose is to see the screen even though it is locked.  This should be
+used with caution since many of the modes will fail if the windows
+are far from square or are too small (size must be greater than 0x0).
+This should also be used with -enablesaver to protect screen from
+phosphor burn.
+.TP 5
+.BI \-icongeometry \ geom
+The
+.I icongeometry
+option sets
+.I geom
+the size of the iconic screen (normally 64x64) seen when entering the
+password.  This should be used with caution since many of the modes will
+fail if the windows are far from square or are too small (size must be
+greater than 0x0).  The greatest size is 256x256.  There should be some
+limit so users could see who has locked the screen.  Position
+information of icon is ignored.
+.TP 5
+.BI \-glgeometry \ geom
+The
+.I glgeometry
+option sets
+.I geom
+the size of the screen for gl modes.  Not normally available or needed.
+.TP 5
+.B -/+wireframe
+Turn on/off wireframe, available on atlantis, daisy, fire, gears,
+lament, life3d, mountain, sballs, sproingies, superquadrics, and triangle.
+.TP 5
+.B -/+showfps
+Turn on/off frame per sec display, available on atlantis, bubble3d, cage, fire,
+gears, invert, lament, moebius, morph3d, rubik, sballs, stairs, and superquadrics.
+.TP 5
+.B -/+fpstop
+Turn on/off frame per sec display on top of screen, used if showfps is on.
+.TP 5
+.BI \-fpsfont \ fontname
+The
+.I fpsfont
+option sets the font to be used in the frame per sec display, used if showfps is on.
+.TP 5
+.B -/+use3d
+Turn on/off 3d view, available on bouboule, pyro, star, and worm.
+.TP 5
+.BI \-delta3d \ value
+Space between the center of your 2 eyes for 3d mode.
+.TP 5
+.BI \-none3d \ color
+Color used for empty size in 3d mode.
+.TP 5
+.BI \-right3d \ color
+Color used for right eye in 3d mode.
+.TP 5
+.BI \-left3d \ color
+Color used for left eye in 3d mode.
+.TP 5
+.BI \-both3d \ color
+Color used for overlapping images for left and right eye in 3d mode.
+.TP 5
+.BI \-program \ programname
+The
+.I program
+option sets the program to be used as the fortune generator.  Currently
+used only for marquee and nose modes.
+.TP 5
+.BI \-messagesfile \ formatted-filename
+The
+.I messagesfile
+option sets the file to be used as the fortune generator.  The first
+entry is the number of fortunes, the next line contains the first fortune.
+Fortunes begin with a "%%" on a line by itself.  Currently used only for
+marquee and nose modes.  If one exists, it takes precedence over the
+fortune program.
+.TP 5
+.BI \-messagefile \ filename
+The
+.I messagefile
+option sets the file whose contents are displayed.  Currently
+used only for marquee and nose modes.  If one exists, it takes
+precedence over the fortune program and messagesfile.
+.TP 5
+.BI \-message \ textstring
+The
+.I message
+option sets the text to be displayed in a mode.  Currently used only for
+flag, marquee and nose modes.  If one exists, it takes precedence over the
+fortune program, messagesfile and message.
+.TP 5
+.BI \-messagefont \ fontname
+The
+.I messagefont
+option sets the font to be used in the mode.  Currently used only for
+flag, marquee, and nose modes.
+.TP 5
+.BI \-bitmap \ filename
+The
+.I bitmap
+option sets the xbm, xpm, or ras file to be displayed with flag, image, life,
+life1d, maze, or puzzle mode.  For eyes and pacman only a xbm file is
+accepted.  Certain modes reject the bitmap if too big.
+/
+.sp
+.SH "MORE OPTIONS (these may not be available)"
+.TP 5
+.BI \-cpasswd  \ crypted-password
+The
+.I cpasswd
+option sets the key to be this text string to unlock
+.B xlock
+instead of password file.
+.TP 5
+.BI \-forceLogout \ minutes
+The
+.I forceLogout
+option sets
+.I minutes
+to auto-logout.
+.TP 5
+.BI \-logoutButtonLabel \ string
+Text
+.I string
+is a message shown inside logout button when logout button is displayed.
+Defaults to
+"Logout".
+.TP 5
+.BI \-logoutButtonHelp \ string
+Text
+.I string
+is a message shown outside logout button when logout button is
+displayed.  Defaults to
+"Click the \\"Logout\\" button to log out current\\n
+user and make workstation available."
+.TP 5
+.BI \-logoutFailedString \ string
+Text
+.I string
+is a message shown when a logout is attempted and fails.
+Defaults to
+"Logout attempt FAILED.\\n
+Current user could not be automatically logged out."
+.TP 5
+.B -/+dtsaver
+Turn on/off CDE Saver Mode.  This option is only available if CDE
+support was compiled in.
+.TP 5
+.BI \-modulepath \ path
+The
+.I modulepath
+option sets the
+.I directories
+that
+.B xlock
+searches for mode modules to load.  It is a colon separated list of
+directories to search. If "%S" is included in the path, it is replaced
+by the default modulepath.  To add a private module directory to the
+default path, use something like '%S:~/mymoduledir' as the path.  This
+option is only available if module support was compiled in.
+.TP 5
+.BI \-locksound \ string
+Text
+.I string
+references sound to use at lock time.  Default sound, male voice:
+"Thank you, for your cooperation."
+.TP 5
+.BI \-infosound \ string
+Text
+.I string
+references sound to use for information.  Default sound, male voice:
+"Identify please."
+.TP 5
+.BI \-validsound \ string
+Text
+.I string
+references sound to when a password is valid.  Default sound, female voice:
+"Complete."
+.TP 5
+.BI \-invalidsound \ string
+Text
+.I string
+references sound to when a password is invalid.  Default sound, female
+voice: "I am not programmed to give you that information."
+.TP 5
+.BI \-startCmd \ string
+Text
+.I string
+command to execute when the screen is locked. Commonly used instructions include:
+"zaway". This command, if still running when the screensaver exist, will be killed.
+.TP 5
+.BI \-endCmd \ string
+Text
+.I string
+command to execute when the screen is unlocked.
+.TP 5
+.BI \-logoutCmd \ string
+Text
+.I string
+command to execute when the program logs the user out (either via the autologout
+or by pressing the logout button).
+.TP 5
+.BI \-mailCmd \ string
+Text
+.I string
+command to execute when the program to check mail.
+.TP 5
+.BI \-mailIcon \ string
+Text
+.I string
+of file for the "mail arrived" bitmap.
+.TP 5
+.BI \-nomailIcon \ string
+Text
+.I string
+of file for the "no mail" bitmap.
+.TP 5
+.B -dpmsstandby \ seconds
+Allows one to set DPMS Standby for monitor (0 is defined as infinite).
+(Horizontal sync on, Vertical sync off, RGB guns off, power supply on,
+tube filaments energized, (screen saver mode).  Typical 17 inch screen...
+110 out of 120 watts with a 3 sec recovery time.)  This option is only
+available if DPMS support was compiled in.
+.TP 5
+.B -dpmssuspend \ seconds
+Allows one to set DPMS Suspend for monitor (0 is defined as infinite).
+(Horizontal sync off, Vertical sync on, RGB guns off, power supply off,
+tube filaments energized.  Typical 17 inch screen ...  15 out of 120 watts
+with a 3 sec recovery time.)  This option is only available if DPMS support
+was compiled in.
+.TP 5
+.B -dpmsoff \ seconds
+Allows one to set DPMS Power Off for monitor (0 is defined as infinite).
+(Horizontal sync off, Vertical sync off, Small auxiliary circuit stays on
+to monitor the HS/VS signals to enable power on when data needs to be
+displayed on the screen.  Typical 17 inch screen ...  5 out of 120 watts with
+a 10 sec recovery time.)  This option is only available if DPMS support was
+compiled in.
+.sp
+.SH "SPECIAL MODE DEPENDENT OPTIONS"
+.TP 5
+.BI \-neighbors \ num
+The
+.I neighbors
+option sets the number of neighbors of a cell to 3, 4, 6, 9 (may not have
+real mathematical meaning), or 12 for several automata modes
+.I (ant, bug, demon, dilemma, life, loop, voters, wator,
+and
+.I wire) (bug
+and
+.I loop
+do not span this full range).  Setting it to 0 typically randomizes this,
+except where bitmaps are used
+.I (dilemma, life, voters,
+and
+.I wator).
+.TP 5
+.BI -/+eyes
+Turn on and off eyes for
+.I ant
+and
+.I bug.
+.TP 5
+.BI -/+cycle
+Turn on and off colour cycling in
+.I crystal, starfish, tetris,
+and
+.I tik_tak.
+.TP 5
+.BI -/+trackmouse
+Turn on and off mouse interaction in
+.I eyes, fire, julia, solitare, sballs, swarm,
+and
+.I tetris.
+For
+.I solitare
+and
+.I tetris
+this may not be available depending on how 
+.B xlock
+was configured.
+.TP 5
+.BI -/+texture
+Turn on and off texturing in
+.I fire,
+.I lament 
+and
+.I sballs.
+This may not be available depending on how
+.B xlock
+was configured.
+.TP 5
+.BI \-rule \ S<neighborhood>/B<neighborhood>
+Allows one to set the rule for
+.I life
+and
+.I life3d.
+Special parameters: P, picks a random rule from all rules that have known
+patterns; G, picks a random rule from all rules that have known gliders.
+For
+.I life
+a good example is Conway's rule which is S23/B3.
+For
+.I life3d
+good examples are Bay's rules which are S45/B5, S567/B6, S56/B5, and S67/B67.
+.TP 5
+.BI \-lifefile \ filename
+The
+.I lifefile
+option sets the
+.I life
+and
+.I life3d
+lifeform.  Only one format is currently supported, similar to the #P xlife
+format.  For
+.I life3d,
+2 linefeeds in a row are assumed to advance the depth.
+.TP 5
+.BI \-whalespeed \ num
+Allows one to set the speed of the whales and dolphin in
+.I atlantis.
+.TP 5
+.BI -/+truchet
+Turn on and off Truchet lines (trail) in
+.I ant.
+.TP 5
+.BI -/+boil
+Turn on and off having the bubbles bubble up in
+.I bubble.
+.TP 5
+.BI \-nx \ num
+Allows one to set the number of unit cells in x-direction in
+.I crystal.
+.TP 5
+.BI \-ny \ num
+Allows one to set the number of unit cells in y-direction in
+.I crystal.
+.TP 5
+.BI -/+centre
+Turn on and off the centering on screen in
+.I crystal.
+.TP 5
+.BI -/+maxsize
+Turn on and off the centering on screen in
+.I crystal.
+.TP 5
+.BI -/+cell
+Turn on and off the drawing of unit cell in
+.I crystal.
+.TP 5
+.BI -/+grid
+Turn on and off the drwing of grid of unit cells (if -cell is on) in
+.I crystal.
+.TP 5
+.BI -/+garden
+Turn off and on garden look in
+.I daisy.
+.TP 5
+.BI -/+popex
+Turn on and off the population explosion counter in
+.I dclock.
+.TP 5
+.BI -/+forest
+Turn on and off the tropical deforest (hectares/acres) counter in
+.I dclock.
+.TP 5
+.BI -/+hiv
+Turn on and off the HIV infection counter in
+.I dclock.
+.TP 5
+.BI -/+lab
+Turn on and off the Animal Research counter in
+.I dclock.
+.TP 5
+.BI -/+veg
+Turn on and off the Animal Consumation counter in
+.I dclock.
+.TP 5
+.BI -/+y2k
+Turn on and off the Year 2000 countdown in
+.I dclock.
+.TP 5
+.BI -/+millennium
+Turn on and off the Second Millennium (January 1, 2001) countdown in
+.I dclock.
+.TP 5
+.BI \-bonus \ value
+Allows one to set the bonus for cheating... between 1.0 and 4.0 in
+.I dilemma.
+.TP 5
+.BI -/+conscious
+Turn off and on self-awareness in
+.I dilemma.
+.TP 5
+.BI -/+grow
+Turn on and off growing fractals (else they are animated) for
+.I drift.
+.TP 5
+.BI -/+liss
+Turn on and off using lissajous figures to get points for
+.I drift.
+.TP 5
+.BI -/+framerate
+Turn on and off displaying of the frame rate for
+.I fire
+and
+.I sballs
+.TP 5
+.BI -/+fog
+Turn on and off fog for
+.I fire.
+.TP 5
+.BI -/+shadows
+Turn on and off shadows for
+.I fire.
+.TP 5
+.BI -trees \ num
+Validate the displaying of trees for
+.I fire
+if greater than zero.
+.TP 5
+.BI -/+invert
+Turn on and off inverting of the
+.I flag.
+.TP 5
+.BI -/+tracks
+Turn on and off star tracks in
+.I galaxy.
+.TP 5
+.BI -/+light
+Turn on and off lighting of the planet for
+.I glplanet.
+.TP 5
+.BI -/+bounce
+Turn on and off bouncing movement of the planet for
+.I glplanet.
+.TP 5
+.BI \-pimage \ filename
+Use the named xbm or xpm file for texturing the planet for
+.I glplanet.
+Use BUILTIN as filename for the builtin image taken from Xearth.
+.TP 5
+.BI -/+roll
+Turn on and off rolling of the planet for
+.I glplanet.
+.TP 5
+.BI -/+rotate
+Turn on and off rotation of the planet for
+.I glplanet.
+.TP 5
+.BI -/+texture
+Turn on and off texturing of the planet for
+.I glplanet.
+.TP 5
+.BI -/+stars
+Turn on and off showing stars in the background for
+.I glplanet.
+.TP 5
+.BI -/+decay
+Turn on and off decaying orbits for
+.I grav.
+.TP 5
+.BI -/+trail
+Turn on and off decaying trail of dots for
+.I grav.
+.TP 5
+.BI -/+ellipse
+Turn on and off ellipse format in
+.I helix.
+.TP 5
+.BI -/+martin
+Turn on and off Barry Martin's square root
+.I hop.
+.BI -/+popcorn
+Turn on and off Clifford A. Pickover's popcorn
+.I hop.
+.TP 5
+.BI -/+ejk1...ejk6
+Turn on and off Ed J. Kubaitis'
+.I hops.
+.TP 5
+.BI -/+rr
+Turn on and off Renaldo Recuerdo's
+.I hop.
+.TP 5
+.BI -/+jong
+Turn on and off Jong's
+.I hop.
+.TP 5
+.BI -/+sine
+Turn on and off Barry Martin's sine
+.I hop.
+.TP 5
+.BI \-pattern \ <pattern>
+Allows one to set the pattern for
+.I juggle.
+.TP 5
+.BI \-patterntrace \ num
+Allows one to see the trails for
+.I juggle.
+.TP 5
+.BI -/+solid
+Turn off and on solid color (else its a 4 panel look (half white)) for 
+.I juggle.
+.TP 5
+.BI -/+planetary
+Turn on and off planetary gears in
+.I gears.
+.TP 5
+.BI \-planetsize \ num
+Sets the size of the screen for planetary option in
+.I gears.
+This is for machines with slower CPU. (Set to 0 for full screen).
+.TP 5
+.BI -/+disconnected
+Turn on and off disconnected pen movement in
+.I kaleid.
+.TP 5
+.BI -/+serial
+Turn on and off sequential allocation of colors in
+.I kaleid.
+.TP 5
+.BI -/+alternate
+Turn on and off alternate rotated display mode
+.I kaleid.
+.TP 5
+.BI -/+quad
+Turn on and off quad mirrored/rotated mode similar to size 4 in
+.I kaleid.
+.TP 5
+.BI -/+oct
+Turn on and off oct mirrored/rotated mode similar to size 8 in
+.I kaleid.
+.TP 5
+.BI -/+linear
+Turn on and off Cartesian/Polar coordinate mode in
+.I kaleid.
+.TP 5
+.BI -/+callahan
+Turn on and off Paul Callahan's S2b34/B2a hexagonal
+.I life.
+.TP 5
+.BI -/+andreen
+Turn on and off Bob Andreen's S2a2b4a/B2a3a4b hexagonal
+.I life.
+.TP 5
+.BI -/+totalistic
+Turn on and off totalistic rules for
+.I life1d.
+If this is off then it follows rules of the LCAU collection.  These
+rules may not be symmetric and are more general.
+.TP 5
+.BI -/+additive
+Turn on and off additive functions mode in
+.I lisa.
+.TP 5
+.BI -/+noants
+Turn off and on ants in
+.I moebius.
+.TP 5
+.BI -/+solidmoebius
+Turn on and off solid Mobius strip in
+.I moebius.
+.TP 5
+.BI -/+atoms
+Turn on and off the drawing of spheres for the atoms in
+.I molecule.
+.TP 5
+.BI -/+bbox
+Turn on and off showing the molecules in a blue box in
+.I molecule.
+.TP 5
+.BI -/+bonds
+Turn on and off the drawing of the atomic bonds in
+.I molecule.
+.TP 5
+.BI \-molecule \ filename
+Read a molecule structure from a pdb file in
+.I molecule.
+.TP 5
+.BI -/+labels
+Turn on and off the labeling of the atoms in
+.I molecule.
+.TP 5
+.BI \-spin {x|y|z}
+Set the axis for molecule rotation in
+.I molecule.
+The default is "XYZ".
+.TP 5
+.BI \+spin
+Turn off the molecule rotation in
+.I molecule.
+.TP 5
+.BI -/+titles
+Turn on and off the molecule description in
+.I molecule.
+.TP 5
+.BI -/+wander
+Turn on and off the moving of the molecule on a sinoid curve in
+.I molecule.
+.TP 5
+.BI -/+ammann
+Turn on and off lines for
+.I penrose.
+.TP 5
+.BI \-increment \ value
+Allows fine adjustments to order in
+.I mandelbrot.
+.TP 5
+.BI -/+erase
+Turn on and off erasing for
+.I spline.
+If this option is on,
+.I cycles
+is divided by 64 to compute the number of lines, so as to be compatible
+when using -fullrandom.
+.TP 5
+.BI \-factory \ num
+Number of extra factory parts in
+.I pipes.
+.TP 5
+.BI -/+fisheye
+Turn on if you want a zoomed-in view of
+.I pipes.
+.TP 5
+.BI -/+tightturns
+Turn on if you want the
+.I pipes
+to bend more often.
+.TP 5
+.BI -/+rotatepipes
+Turn on if you want the pipe system rotated in
+.I pipes.
+.TP 5
+.BI -/+complete
+Turn on or off complete graph morphing in
+.I qix.
+.TP 5
+.BI \-size[xyz] \ num
+Number represents the number of cubies on the x, y, or z axis.  Negative
+numbers offer randomness from 2 to the absolute value of the number.
+.I star.
+.TP 5
+.BI -/+hideshuffling
+Turn on or off hidden shuffle phase for
+.I rubik.
+.TP 5
+.BI -/+border
+Turn on or off borders in
+.I shape.
+.TP 5
+.BI -/+ shape
+Turn on or off shadowing in
+.I shape.
+.TP 5
+.BI -/+ shape
+Turn on or off stippling in
+.I shape.
+.TP 5
+.BI \-intensity \ value
+Set the brightness (default 2185) of the sierpinski structure for
+.I sierpinski3d.
+.TP 5
+.BI \-maxdepth \ value
+Set the maximum depth (up to 10) of the sierpinski structure for
+.I sierpinski3d.
+.TP 5
+.BI \-speed \ value
+Determines after how much steps the depth changes for
+.I sierpinski3d.
+.TP 5
+.BI \-trek \ num
+If its a high number you will see the space ship all the time in
+.I star.
+.TP 5
+.BI -/+rock
+Turn on and off rocks for
+.I star.
+If this is off, stars will be seen instead.
+.TP 5
+.BI -/+straight
+Turn on if
+.I star
+gets you motion sick.
+.TP 5
+.BI \-cyclepeed \ num
+Set speed of cycling in
+.I starfish.
+.TP 5
+.BI \-rotation \ num
+Set rotation velocity in
+.I starfish.
+.TP 5
+.BI \-thickness \ num
+Set thickness in
+.I starfish.
+.TP 5
+.BI -/+rock
+Turn on and off blob for
+.I starfish.
+.TP 5
+.BI \-spinspeed \ num
+Set speed of rotation, in degrees per frame for
+.I superquadrics.
+.TP 5
+.BI -/+bonus
+Turn on in
+.I tetris
+to see 5 square bonus pieces.
+.TP 5
+.BI -/+well
+Turn on in
+.I tetris
+to see welltris.
+.TP 5
+.BI \-ttfont \ filename
+Sets the True Type font file (or font directory) used for
+.I text3d
+.TP 5
+.BI \-extrusion \ num
+Sets length of the text extrusion for
+.I text3d
+.TP 5
+.BI \-rot_amplitude \ float
+Sets rotation amplitude value of each letter for
+.I text3d
+.TP 5
+.BI \-rot_frequency \ float
+Sets rotation frequency for
+.I text3d
+.TP 5
+.BI -/+no_split
+Turn on and off word splitting for
+.I text3d
+.TP 5
+.BI \-ttanimate \ function_name
+Sets the animation function used for
+.I text3d.
+Currently one of : \
+Random \ FullRandom \ Default \ Default2 \ None \ Crazy \ UpDown \ Extrude \ RotateXY \ RotateYZ \ Frequency \ Amplitude
+.TP 5
+.B \-speed \fIkm/h\fP
+The speed for all planes in km/h for
+.I xcl.
+.TP 5
+.B \-frametime \fImicroseconds\fP
+The time for one frame on the screen. This time is used to calculate
+the delay time and depends on the speed of the X server for
+.I xcl.
+.TP 5
+.B \-line_length \fImm\fP
+The distance between the pilot and the plane for
+.I xcl.
+.TP 5
+.B \-spectator \fImm\fP
+The distance between spectator and pilot. It should be grater than the
+line_length and the half wing width of the plane to be not dangerous
+for the spectator for
+.I xcl.
+.TP 5
+.B \-viewmodel
+Shows an animated view of one model for
+.I xcl.
+.TP 5
+.B -/+oldcolor
+Sets the colors for the first two planes fixed to red and yellow in
+.I xcl.
+.TP 5
+.B \-xcldebug
+Shows some additional timing information to make sure that the calibrate
+procedure goes right in
+.I xcl.
+.TP 8
+.B \-automatic
+The auto scale for automatic fit into the window is \fIDe\fPactivated
+with this option for
+.I xcl.
+.TP 5
+.B \-randomstart
+Use a random start point for models at startup for
+.I xcl.
+.TP 5
+.BI \-duration \ seconds
+Allows one to set a duration for a mode in
+.I random.
+Duration of 0 is defined as infinite.
+.TP 5
+.B -/+fullrandom
+Turn on/off randomness options within modes in
+.I random.
+Not implemented for all mode options.
+.TP 5
+.BI \-modelist \ textstring
+Allows one to pass a list of files to randomly display to
+.I random.
+"all" will get all files but blank (and bomb if compiled in). "all,blank"
+will get all modes.  "all,-image bounce,+blank" will get all modes but
+image and bounce.  "bug wator" will get only bug and wator.  "allgl" will
+get only the GL modes if compiled in, all-allgl will get all but the GL
+modes, "allnice" will weed out high cpu usage modes (as well as hackers and
+gl modes).  "allxpm" will get all modes that use xpm.  "allwrite" will get
+all modes that take advantage of writable colormaps (not including xpm).
+"all3d" will get all the modes that support this option.  "allmouse"
+will get all the modes that support mouse interaction.  Similarly,
+"allautomata" for automata modes, "allfractal" for fractal modes,
+"allgeometry" for geometry modes, "allspace" for space modes.  The random
+mode itself can not be referenced.
+.TP 5
+.BI -/+sequential
+Turn on non-random
+.I random
+option.
+.sp
+.SH **WARNING**
+.B xlock
+can appear to hang if it is competing with a high-priority process for
+the CPU. For example, if
+.B xlock
+is started after a process with 'nice -20'
+(high priority),
+.B xlock
+will take  considerable amount of time to respond.
+.sp
+.SH "SHADOW PASSWORDS"
+If the machine is using a shadow password system, then
+.B xlock
+may not be set up to get the real password and so must be given one
+of its own. This can be either on the command line, via the
+.B -cpasswd
+option,
+or in the file
+.BR $HOME/.xlockrc ,
+with the first taking precedence.  In both cases an encrypted password
+is expected (see makekey(8)).  If neither is given, then
+.B xlock
+will prompt for a password and will use that, also storing an
+encrypted version of it in
+.B $HOME/.xlockrc
+for future use.
+.sp
+.SH BUGS
+"kill -KILL
+.B xlock
+" causes the server that was locked to be unusable, since all hosts
+(including localhost) were removed from the access control list
+to lock out new X clients, and since
+.B xlock
+could not catch SIGKILL, it terminated before restoring the access
+control list.  This will leave the X server in a state where
+\fI"you can no longer connect to that server,
+and this operation cannot be reversed unless you reset the server."\fP
+               -From the X11R4 Xlib Documentation, Chapter 7.
+.br
+NCD terminals do not allow xlock to remove all the hosts from the access
+control list.  Therefore you will need to use the "-remote" and
+"-allowaccess" switches.  If you happen to run without "-allowaccess" on an
+NCD terminal,
+.B xlock
+will not work and you will need to reboot the terminal, or simply go into
+the SETUP menus, under 'Network Parameters', and turn off TCP/IP access
+control.
+.br
+.SH "SEE ALSO"
+X(1), Xlib Documentation.
+.sp
+.SH AUTHOR
+Maintained by:
+.RS
+David Albert Bagley, <\fIbagleyd@tux.org\fP>
+.RE
+.sp
+The latest version is currently at:
+.RS
+\fIftp://ftp.tux.org/pub/tux/bagleyd/xlockmore\fP
+.br
+\fIftp://ftp.x.org/contrib/applications\fP
+.RE
+.sp
+Original Author:
+.RS
+Patrick J. Naughton, <\fInaughton@eng.sun.com\fP>
+.br
+Mailstop 21-14
+.br
+Sun Microsystems Laboratories, Inc.
+.br
+Mountain View, CA  94043
+.br
+415/336-1080
+.RE
+.sp
+with many additional contributors.
+.sp
+.SH COPYRIGHT
+Copyright (c) 1988-1991 by Patrick J. Naughton
+.br
+Copyright (c) 1993-2001 by David A. Bagley
+.sp
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation.
+.br
+The original BSD daemon is Copyright (c) 1988 Marshall Kirk McKusick.
+All Rights Reserved.
+.br
+DEC, HP, IBM, Linux, SCO, SGI, and Sun icons have their respective
+copyrights.
diff --git a/xlock/xlockimage.c b/xlock/xlockimage.c
new file mode 100644 (file)
index 0000000..4923db7
--- /dev/null
@@ -0,0 +1,135 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)xlockimage.c 4.19 00/10/26 xlockmore";
+
+#endif
+
+/*-
+ * Utilities for Sun rasterfile processing
+ *
+ * Copyright (c) 1995 by Tobias Gloth
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ *  3-Mar-96: Added random image selection.
+ * 12-Dec-95: Modified to be a used in more than one mode
+ *            <joukj@hrem.stm.tudelft.nl>
+ * 22-May-95: Written.
+ */
+
+#include "xlock.h"
+#include "iostuff.h"
+#include "xlockimage.h"
+#include <time.h>
+
+void
+convert_colors(ModeInfo * mi)
+{
+       int         i;
+       unsigned long black, white, fgpix, bgpix;
+       XColor      fgcol, bgcol;
+
+       black = MI_BLACK_PIXEL(mi);
+       white = MI_WHITE_PIXEL(mi);
+       fgpix = MI_FG_PIXEL(mi);
+       bgpix = MI_BG_PIXEL(mi);
+       fgcol.pixel = fgpix;
+       bgcol.pixel = bgpix;
+       XQueryColor(MI_DISPLAY(mi), MI_COLORMAP(mi), &fgcol);
+       XQueryColor(MI_DISPLAY(mi), MI_COLORMAP(mi), &bgcol);
+
+       /* Set these, if raster does not overwrite some, so much the better. */
+       if (fgpix < COLORMAP_SIZE) {
+               xlockimage.red[fgpix] = fgcol.red >> 8;
+               xlockimage.green[fgpix] = fgcol.green >> 8;
+               xlockimage.blue[fgpix] = fgcol.blue >> 8;
+       }
+       if (bgpix < COLORMAP_SIZE) {
+               xlockimage.red[bgpix] = bgcol.red >> 8;
+               xlockimage.green[bgpix] = bgcol.green >> 8;
+               xlockimage.blue[bgpix] = bgcol.blue >> 8;
+       }
+       if (white < COLORMAP_SIZE) {
+               xlockimage.red[white] = 0xFF;
+               xlockimage.green[white] = 0xFF;
+               xlockimage.blue[white] = 0xFF;
+       }
+       if (black < COLORMAP_SIZE) {
+               xlockimage.red[black] = 0;
+               xlockimage.green[black] = 0;
+               xlockimage.blue[black] = 0;
+       }
+       /* Set up raster colors */
+       /* Could try juggling this stuff around so it does not conflict
+          with fg,bg,white,black */
+       for (i = 0; i < (int) xlockimage.colors; i++) {
+               xlockimage.red[i] = xlockimage.color[i + 0 * xlockimage.colors];
+               xlockimage.green[i] = xlockimage.color[i + 1 * xlockimage.colors];
+               xlockimage.blue[i] = xlockimage.color[i + 2 * xlockimage.colors];
+       }
+
+       /* Make sure there is a black ... */
+       if (xlockimage.colors <= 0xff)
+               xlockimage.red[0xff] = xlockimage.green[0xff] = xlockimage.blue[0xff] = 0;
+}
+
+unsigned long
+find_nearest(int r, int g, int b)
+{
+       unsigned long i, minimum = RGBCOLORMAP_SIZE, imin = 0, t;
+
+       for (i = 0; i < COLORMAP_SIZE; i++) {
+               t = abs(r - (int) xlockimage.red[i]) + abs(g - (int) xlockimage.green[i]) +
+                       abs(b - (int) xlockimage.blue[i]);
+               if (t < minimum) {
+                       minimum = t;
+                       imin = i;
+               }
+       }
+#ifdef DEBUG
+       (void) fprintf(stderr, "giving (%d/%d/%d)[%ld] for (%d/%d/%d) diff %ld\n",
+                      xlockimage.red[imin], xlockimage.green[imin], xlockimage.blue[imin], imin, r, g, b, minimum);
+#endif
+       return imin;
+}
+
+unsigned long
+GetBlack(void)
+{
+       return xlockimage.entry[find_nearest(0, 0, 0)];
+}
+
+unsigned long
+GetWhite(void)
+{
+       return xlockimage.entry[find_nearest(0xff, 0xff, 0xff)];
+}
+
+unsigned long
+GetColor(ModeInfo * mi, unsigned long pixel)
+{
+       XColor      col;
+
+       col.pixel = pixel;
+       XQueryColor(MI_DISPLAY(mi), MI_COLORMAP(mi), &col);
+       return xlockimage.entry[find_nearest(col.red >> 8, col.green >> 8, col.blue >> 8)];
+}
+
+void
+SetImageColors(Display * display, Colormap cmap)
+{
+       XColor      xcolor[COLORMAP_SIZE];
+       int         i;
+
+       for (i = 0; i < COLORMAP_SIZE; i++) {
+               xcolor[i].flags = DoRed | DoGreen | DoBlue;
+               xcolor[i].red = xlockimage.red[i] << 8;
+               xcolor[i].green = xlockimage.green[i] << 8;
+               xcolor[i].blue = xlockimage.blue[i] << 8;
+               if (!XAllocColor(display, cmap, xcolor + i))
+                       error("not enough colors.\n");
+               xlockimage.entry[i] = (int) xcolor[i].pixel;
+       }
+/* for (i = 0; i < xlockimage.width * xlockimage.height; i++) xlockimage.data[i] =
+   xlockimage.entry[xlockimage.data[i]]; */
+}
diff --git a/xlock/xlockimage.h b/xlock/xlockimage.h
new file mode 100644 (file)
index 0000000..284a029
--- /dev/null
@@ -0,0 +1,41 @@
+#if !defined( lint ) && !defined( SABER )
+/* #ident        "@(#)xlockimage.h      4.18 00/10/26 xlockmore" */
+
+#endif
+
+/*-
+ * Utilities for Sun rasterfile processing
+ *
+ * Copyright (c) 1995 by Tobias Gloth
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 12-Dec-95: Modified to be a used in more than one mode
+ *            <joukj@hrem.stm.tudelft.nl>
+ * 22-May-95: Written.
+ */
+
+extern void SetImageColors(Display * display, Colormap cmap);
+extern unsigned long GetBlack(void);
+extern unsigned long GetWhite(void);
+extern unsigned long GetColor(ModeInfo * mi, unsigned long pixel);
+extern unsigned long find_nearest(int r, int g, int b);
+extern void convert_colors(ModeInfo * mi);
+
+#define COLORMAP_SIZE 0x100
+#define RGBCOLORMAP_SIZE 0x300
+
+typedef struct {
+       int         entry[COLORMAP_SIZE];
+       unsigned char header[32];
+       unsigned char color[RGBCOLORMAP_SIZE];
+       unsigned char red[COLORMAP_SIZE], green[COLORMAP_SIZE], blue[COLORMAP_SIZE];
+       unsigned char *data;
+       unsigned long sign;
+       unsigned long width, height;
+       unsigned long depth;
+       unsigned long colors;
+} XLockImage;
+
+extern XLockImage xlockimage;
diff --git a/xmlock/Imakefile b/xmlock/Imakefile
new file mode 100644 (file)
index 0000000..9b6ef7d
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef XCOMM
+#define XCOMM /**/#
+#endif
+XCOMM @(#)Sub Imakefile        xlockmore
+XCOMM
+
+#include "../iconfig.h"
+
+top_srcdir = ..
+UTILSDIR = .
+
+XCOMM  List of object files
+XMLOCKOBJS = option$(O)$(S)xmlock$(O)
+
+XCOMM  List of source files
+XMLOCKSRCS = option$(C) xmlock$(C)
+
+
+#ifdef XmLibrary
+AllTarget(xmlock)
+NormalProgramTarget(xmlock, $(XMLOCKOBJS), $(DEPXLIB), $(MLIBS), NullParameter)
+#else
+clean::
+       $(RM) xmlock .pure
+#endif
+
+DependTarget()
+LintTarget()
+
+#ifdef XmLibrary
+InstallProgram(xmlock$(E),$(BINDIR))
+InstallAppDefaults(XmLock)
+#endif
+
+distclean::    clean
+       $(RM) Makefile config.status config.cache config.log config.h
+
+clean.all:: distclean
diff --git a/xmlock/Makefile.in b/xmlock/Makefile.in
new file mode 100644 (file)
index 0000000..17da7e2
--- /dev/null
@@ -0,0 +1,206 @@
+# $Id : Makefile.in 4.04 1997/07/10 $
+#
+# xlockmore Makefile.in for autoconf (UNIX/VMS X11 support)
+############################################################
+
+# @SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@/
+BITMAPDIR = @BITMAPDIR@/
+
+N=
+O = .o
+#O = .obj
+C = .c
+# C = .cc
+S = $(N) $(N)
+#S = ,
+
+
+# please define
+# C as the C source code extension
+# O as the object extension
+# S as the separator for object code
+
+####################################################################
+# List of object files
+XMLOCKOBJS = option$(O)$(S)xmlock$(O)
+
+# List of source files
+XMLOCKSRCS = $(VPATH)option$(C) $(VPATH)xmlock$(C)
+
+# default target
+all : @XMLOCK@
+
+# this tells GNU make not to export variables into the environment
+# But other makes do not understand its significance, so it must
+# not be the first target in the file. So it is here, before
+# any variables are created, but after the default target
+.NOEXPORT :
+
+SHELL = /bin/sh
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+mandir = @mandir@/man1
+xapploaddir = @APPDEFAULTS@
+
+CONFIGDIR = $(srcdir)/config/
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTPGMFLAGS = @INSTPGMFLAGS@
+
+#CC = cc -g
+#CC = cc -Ac -g
+#CC = cc -Xc -g
+#CC = acc -g
+#CC = CC -g
+#CC = gcc -g -Wall -ansi -pedantic
+#CC = gcc -g -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wstrict-prototypes
+#CC = g++ -g -Wall
+CC = @CC@
+
+#LINT = lint
+LINT = lint -Ncheck=%all
+#LINT = alint
+
+#DEPEND = makedepend
+DEPEND = @DEPEND@
+DEPEND_FLAGS = @DEPEND_FLAGS@
+DEPEND_DEFINES = @DEPEND_DEFINES@
+
+LN_S = @LN_S@
+RM = rm -f
+RM_S = $(RM)
+ECHO = echo
+
+#BLN_S = set file/enter=[]
+#RM = delete/noconfirm/nolog
+#RM_S = set file/remove/nolog
+#ECHO = write sys$output
+
+DEFS = @DEFS@ $(DEFINES)
+XMLOCKINC = @XMLOCKINC@ -I.. -I$(top_srcdir)
+CFLAGS = @CFLAGS@
+#CFLAGS = -O
+#CFLAGS = -g
+XMLOCKLDFLAGS = @XMLOCKLDFLAGS@
+XLIBS = @XLIBS@
+XMLOCKLIBS = @XMLOCKLIBS@
+#If you have purify, and want to use it, uncomment this definition or
+# run the make as `make PURIFY=purify'
+# or run configure with the --with-purify argument.
+PURIFY = @PURIFY@
+
+xmlock : $(XMLOCKOBJS)
+       $(PURIFY) $(CC) -o $@ $(XMLOCKOBJS) $(XMLOCKLDFLAGS) $(XMLOCKLIBS)
+       @ $(ECHO) "$@ BUILD COMPLETE"
+       @ $(ECHO) ""
+
+.SUFFIXES : $(C) $(O)
+
+$(C)$(O) :
+       $(CC) -c $(CPPFLAGS) $(DEFS) $(XMLOCKINC) $(CFLAGS) $<
+
+install : @INSTALL_XMLOCK@
+
+install_xmlock : install-program install-man install-ad
+       @ $(ECHO) "$@ COMPLETE"
+       @ $(ECHO) ""
+
+install-program : xmlock
+       $(top_srcdir)/mkinstalldirs $(bindir)
+       $(INSTALL_PROGRAM) xmlock $(bindir)
+
+install-man :
+
+install-ad :
+       $(top_srcdir)/mkinstalldirs $(xapploaddir)
+       $(INSTALL_DATA) $(top_srcdir)/xmlock/XmLock.ad $(xapploaddir)/XmLock
+
+uninstall : @UNINSTALL_XMLOCK@
+
+uninstall_xmlock : uninstall-program uninstall-man uninstall-ad
+
+uninstall-program :
+       $(RM) $(bindir)/xmlock
+
+uninstall-man :
+
+uninstall-ad :
+       $(RM) $(xapploaddir)/XmLock
+
+install.program : install-program
+
+install.man : install-man
+
+install.ad : install-ad
+
+uninstall.program : uninstall-program
+
+uninstall.man : uninstall-man
+
+uninstall.ad : uninstall-ad
+
+lint :
+       $(LINT) -ax -DLINT $(DEFS) $(XMLOCKINC) $(XMLOCKSRCS)
+
+xrdb :
+       xrdb $(top_srcdir)/xmlock/XmLock.ad
+
+man :
+
+html :
+
+hlp :
+
+clean :
+       $(RM) *.o core *~ *% *.bak *.orig *.rej make.log MakeOut xmlock *.patch .pure
+
+distclean : clean
+       $(RM) Makefile
+
+clean.all : distclean
+
+# Adds all current dependencies to Makefile
+depend :
+       $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
+       $(DEPEND_FLAGS) --                                                  \
+       $(XMLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                 \
+       $(XMLOCKSRCS)
+
+# Adds some dependencies to Makefile.in -- not totally accurate, but pretty
+# close.  This excludes dependencies on files in /usr/include, etc.  It tries
+# to include only dependencies on files which are themselves a part of this
+# package. -w 0
+distdepend :
+       @echo updating dependencies in `pwd`/Makefile.in... ;               \
+       $(DEPEND) -w 0 -f -                                                 \
+       -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
+       $(XMLOCKINC) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) --                 \
+       $(XMLOCKSRCS) |                                                     \
+       (                                                                   \
+         awk '/^#.*Id : Makefile.in/,/^# DO .*distdepend/' < Makefile.in ; \
+         sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
+             -e 's@\.\./bitmaps@$$(BITMAPDIR)@g' ;                         \
+         echo ''                                                           \
+       ) > /tmp/distdepend.$$$$ &&                                         \
+       mv Makefile.in Makefile.in.bak &&                                   \
+       mv /tmp/distdepend.$$$$ Makefile.in
+
+##############################################################################
+#
+# DO NOT DELETE: updated by make distdepend
+
+option.o: option.h
+xmlock.o: ../config.h
+xmlock.o: option.h
+xmlock.o: $(BITMAPDIR)/m-xlock.xbm
+xmlock.o: modes.h
+
diff --git a/xmlock/XmLock-jp.ad b/xmlock/XmLock-jp.ad
new file mode 100644 (file)
index 0000000..431aaed
--- /dev/null
@@ -0,0 +1,46 @@
+!!!!
+! XmLock-ja: Japanese class resource for xmlock
+!!!!
+! by YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
+
+XmLock*international: true
+
+XmLock*fontList:       \
+-misc-fixed-medium-r-normal--12-*-*-*-*-*-iso8859-1;\
+-misc-fixed-medium-r-normal--12-*-*-*-*-*-jisx0208.1983-0;\
+-misc-fixed-medium-r-normal--12-*-*-*-*-*-jisx0201.1976-0;\
+-misc-fixed-medium-r-normal--12-*-*-*-*-*-jisx0212.1990-0:
+
+XmLock.Form.PushButtonRow.Exit.Background: red
+XmLock.Form.PushButtonRow.Exit.Armcolor: pink
+XmLock.Form.Row*ScrolledListModes.Background: light blue
+XmLock.Form.Row.TogglesRow.Background: white
+
+XmLock.Form.Modes.labelString: Æ°ºî¥â¡¼¥É
+XmLock.Form.Window.labelString: ¥Æ¥¹¥È¥¦¥£¥ó¥É¥¦
+XmLock.Form.Switches.labelString: ¥¹¥¤¥Ã¥Á
+
+XmLock.Form.PushButtonRow.Exit.labelString: ½ªÎ»
+XmLock.Form.PushButtonRow.In Window.labelString: ¥¦¥£¥ó¥É¥¦¤Ç¼Â¹Ô
+XmLock.Form.PushButtonRow.In Root.labelString: ¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ç¼Â¹Ô
+XmLock.Form.PushButtonRow.Launch.labelString: ¼Â¹Ô
+
+XmLock.Form.PushButtonRow.MenuBar.Options.labelString: ¥ª¥×¥·¥ç¥ó
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.username.labelString: ¥æ¡¼¥¶Ì¾
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.password.labelString: ¥Ñ¥¹¥ï¡¼¥É
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.info.labelString: ¥Ñ¥¹¥ï¡¼¥ÉÍ×µá»þ¤Î¥á¥Ã¥»¡¼¥¸
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.invalid.labelString: ¥Ñ¥¹¥ï¡¼¥É¼ºÇÔ»þ¤Î¥á¥Ã¥»¡¼¥¸
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.validate.labelString: ¥Ñ¥¹¥ï¡¼¥É¥Á¥§¥Ã¥¯»þ¤Î¥á¥Ã¥»¡¼¥¸
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.geometry.labelString: ²èÌ̤ÎÂ礭¤µ
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.font.labelString: ¥Õ¥©¥ó¥È̾
+XmLock.Form.PushButtonRow.MenuBar.popup_PopupOptions.PopupOptions.program.labelString: ¥á¥Ã¥»¡¼¥¸ºîÀ®¥×¥í¥°¥é¥à
+
+XmLock.Form.Row.TogglesRow.mono.labelString: ¥â¥Î¥¯¥í
+XmLock.Form.Row.TogglesRow.nolock.labelString: ¥Ñ¥¹¥ï¡¼¥É̵¤·
+XmLock.Form.Row.TogglesRow.remote.labelString: Â¾Ã¼Ëö¤«¤é¤ÎÄä»ß²Ä
+XmLock.Form.Row.TogglesRow.allowroot.labelString: root¤Î¥Ñ¥¹¥ï¡¼¥É²Ä
+XmLock.Form.Row.TogglesRow.enablesaver.labelString: XÁȹþ¤ß¥»¡¼¥ÐÍ­¸ú
+XmLock.Form.Row.TogglesRow.allowaccess.labelString: ¥¢¥¯¥»¥¹¥ê¥¹¥È»ÈÍÑ
+XmLock.Form.Row.TogglesRow.grabmouse.labelString: ¥Þ¥¦¥¹¤ò¾è¤Ã¼è¤ë
+XmLock.Form.Row.TogglesRow.echokeys.labelString: '?' ¤òɽ¼¨
+XmLock.Form.Row.TogglesRow.usefirst.labelString: ºÇ½é¤Î¥­¡¼¤â»È¤¦
diff --git a/xmlock/XmLock.ad b/xmlock/XmLock.ad
new file mode 100644 (file)
index 0000000..bdbe1ac
--- /dev/null
@@ -0,0 +1,16 @@
+!!!!
+! XmLock: Class resource for xmlock
+!!!!
+!XmLock.Form.Boolean.Fontlist: -*-*-bold-i-*-*-16-*-*-*-*-*-*-*
+!XmLock.Form.Switches.Fontlist: -*-*-bold-i-*-*-16-*-*-*-*-*-*-*
+!XmLock.Form.PushButtonRow.Menubar.PopupOptions.Options.Font.Fontlist: -*-*-bold-i-*-*-*-*-*-*-*-*-*-*
+XmLock.Form.PushButtonRow.Exit.Background: red
+XmLock.Form.PushButtonRow.Exit.Armcolor: pink
+!XmLock.Form.PushButtonRow.Exit.Fontlist: -*-*-bold-i-*-*-*-*-*-*-*-*-*-*
+!XmLock.Form.Modes.Labelstring: Modes
+!XmLock.Form.Switches.Labelstring: Turn On/Off
+!XmLock.Form.Row*ScrolledListModes.BorderColor: black
+!XmLock.Form.Row*ScrolledListModes.Fontlist: -*-*-bold-*-*-*-16-*-*-*-*-*-*-*
+XmLock.Form.Row*ScrolledListModes.Background: light blue
+XmLock.Form.Row.TogglesRow.Background: white
+!XmLock.Form.Row.Xmrowcolumn*Fontlist: -*-*-*-*-*-*-14-*-*-*-*-*-*-*
diff --git a/xmlock/menu.h b/xmlock/menu.h
new file mode 100644 (file)
index 0000000..b600f85
--- /dev/null
@@ -0,0 +1,42 @@
+// This structure come from smith.motif.tar.Z
+// of "Designing X clients with Xt/Motif,"
+// by Jerry D. Smith, Morgan Kaufmann, 1992
+/*
+Public data structures:
+*/
+
+/*
+Constants:
+*/
+
+#define menu_TITLE              -1001
+#define menu_SEPARATOR  -1002
+#define menu_SUBMENU    -1003
+#define menu_ENTRY              -1004
+#define menu_TOG_ENTRY  -1005
+#define menu_END                -1006
+
+typedef struct _menu_entry {
+        int type;
+        char *label;                            /* can be NULL */
+        char *instance_name;
+        void (*callback)();                     /* can be NULL */
+        XtPointer data;                         /* can be NULL */
+        struct _menu_entry *menu;       /* can be NULL */
+        Widget id;                                      /* RETURN */
+} menu_entry;
+
+#if 0
+extern void create_menus( Widget parent,menu_entry menu[], XmStringCharSet char_set);
+#endif
+
+/* number of buttons, toggles, and string options */
+
+#define  PUSHBUTTONS  3
+
+#define XLOCK "xlock"
+#define WINDOW_WIDTH 160
+#define WINDOW_HEIGHT 100
+#define WINDOW_GEOMETRY "160x100"
+
+
diff --git a/xmlock/modes.h b/xmlock/modes.h
new file mode 100644 (file)
index 0000000..2c86a70
--- /dev/null
@@ -0,0 +1,176 @@
+typedef struct LockStruct_s
+{
+       char *cmdline_arg;          /* mode name */
+       /* Maybe other things should be added here from xlock? */
+       /* Should read in XLock as well to set defaults */
+       char *desc;                 /* text description of mode */
+} LockStruct;
+
+static LockStruct LockProcs[] =
+{
+{(char *) "ant", (char *) "Shows Langton's and Turk's generalized ants"},
+#ifdef USE_GL
+{(char *) "atlantis", (char *) "Shows moving sharks/whales/dolphin"},
+#endif
+{(char *) "ball", (char *) "Shows bouncing balls"},
+{(char *) "bat", (char *) "Shows bouncing flying bats"},
+{(char *) "blot", (char *) "Shows Rorschach's ink blot test"},
+{(char *) "bouboule", (char *) "Shows Mimi's bouboule of moving stars"},
+{(char *) "bounce", (char *) "Shows bouncing footballs"},
+{(char *) "braid", (char *) "Shows random braids and knots"},
+{(char *) "bubble", (char *) "Shows popping bubbles"},
+#if defined( USE_GL ) && defined( HAVE_CXX )
+{(char *) "bubble3d", (char *) "Richard Jones's GL bubbles"},
+#endif
+{(char *) "bug", (char *) "Shows Palmiter's bug evolution and garden of Eden"},
+#ifdef USE_GL
+{(char *) "cage", (char *) "Shows the Impossible Cage, an Escher-like GL scene"},
+#endif
+{(char *) "clock", (char *) "Shows Packard's clock"},
+{(char *) "coral", (char *) "Shows a coral reef"},
+{(char *) "crystal", (char *) "Shows polygons in 2D plane groups"},
+{(char *) "daisy", (char *) "Shows a meadow of daisies"},
+{(char *) "dclock", (char *) "Shows a floating digital clock or message"},
+{(char *) "decay", (char *) "Shows a decaying screen"},
+{(char *) "deco", (char *) "Shows art as ugly as sin"},
+{(char *) "demon", (char *) "Shows Griffeath's cellular automata"},
+{(char *) "dilemma", (char *) "Shows Lloyd's Prisoner's Dilemma simulation"},
+{(char *) "dragon", (char *) "Shows Deventer's Hexagonal Dragons Maze"},
+{(char *) "discrete", (char *) "Shows various discrete maps"},
+{(char *) "drift", (char *) "Shows cosmic drifting flame fractals"},
+{(char *) "euler2d", (char *) "Shows a simulation of 2D incompressible inviscid fluid"},
+{(char *) "eyes", (char *) "Shows eyes following a bouncing grelb"},
+{(char *) "fadeplot", (char *) "Shows a fading plot of sine squared"},
+#ifdef USE_GL
+{(char *) "fire", (char *) "Shows a 3D fire-like image"},
+#endif
+{(char *) "flag", (char *) "Shows a waving flag image"},
+{(char *) "flame", (char *) "Shows cosmic flame fractals"},
+{(char *) "flow", (char *) "Shows dynamic strange attractors"},
+{(char *) "forest", (char *) "Shows binary trees of a fractal forest"},
+{(char *) "galaxy", (char *) "Shows crashing spiral galaxies"},
+#ifdef USE_GL
+{(char *) "gears", (char *) "Shows GL's gears"},
+#endif
+#ifdef USE_GL
+{(char *) "glplanet", (char *) "Animates texture mapped sphere (planet)"},
+#endif
+{(char *) "goop", (char *) "Shows goop from a lava lamp"},
+{(char *) "grav", (char *) "Shows orbiting planets"},
+{(char *) "helix", (char *) "Shows string art"},
+{(char *) "hop", (char *) "Shows real plane iterated fractals"},
+{(char *) "hyper", (char *) "Shows spinning n-dimensional hypercubes"},
+{(char *) "ico", (char *) "Shows a bouncing polyhedron"},
+{(char *) "ifs", (char *) "Shows a modified iterated function system"},
+{(char *) "image", (char *) "Shows randomly appearing logos"},
+#if defined( USE_GL ) && defined( HAVE_CXX )
+{(char *) "invert", (char *) "Shows a sphere inverted without wrinkles"},
+#endif
+{(char *) "juggle", (char *) "Shows a Juggler, juggling"},
+{(char *) "julia", (char *) "Shows the Julia set"},
+{(char *) "kaleid", (char *) "Shows a kaleidoscope"},
+{(char *) "kumppa", (char *) "Shows kumppa"},
+#ifdef USE_GL
+{(char *) "lament", (char *) "Shows Lemarchand's Box"},
+#endif
+{(char *) "laser", (char *) "Shows spinning lasers"},
+{(char *) "life", (char *) "Shows Conway's game of Life"},
+{(char *) "life1d", (char *) "Shows Wolfram's game of 1D Life"},
+{(char *) "life3d", (char *) "Shows Bays' game of 3D Life"},
+{(char *) "lightning", (char *) "Shows Keith's fractal lightning bolts"},
+{(char *) "lisa", (char *) "Shows animated lisajous loops"},
+{(char *) "lissie", (char *) "Shows lissajous worms"},
+{(char *) "loop", (char *) "Shows Langton's self-producing loops"},
+{(char *) "lyapunov", (char *) "Shows lyapunov space"},
+{(char *) "mandelbrot", (char *) "Shows mandelbrot sets"},
+{(char *) "marquee", (char *) "Shows messages"},
+{(char *) "matrix", (char *) "Shows the matrix"},
+{(char *) "maze", (char *) "Shows a random maze and a depth first search solution"},
+#ifdef USE_GL
+{(char *) "moebius", (char *) "Shows Moebius Strip II, an Escher-like GL scene with ants"},
+#endif
+#ifdef USE_GL
+{(char *) "morph3d", (char *) "Shows GL morphing polyhedra"},
+#endif
+{(char *) "mountain", (char *) "Shows Papo's mountain range"},
+{(char *) "munch", (char *) "Shows munching squares"},
+{(char *) "nose", (char *) "Shows a man with a big nose runs around spewing out messages"},
+{(char *) "pacman", (char *) "Shows Pacman(tm)"},
+{(char *) "penrose", (char *) "Shows Penrose's quasiperiodic tilings"},
+{(char *) "petal", (char *) "Shows various GCD Flowers"},
+#ifdef USE_GL
+{(char *) "pipes", (char *) "Shows a selfbuilding pipe system"},
+#endif
+{(char *) "polyominoes", (char *) "Shows attempts to place polyominoes into a rectangle"},
+{(char *) "puzzle", (char *) "Shows a puzzle being scrambled and then solved"},
+{(char *) "pyro", (char *) "Shows fireworks"},
+{(char *) "qix", (char *) "Shows spinning lines a la Qix(tm)"},
+{(char *) "roll", (char *) "Shows a rolling ball"},
+{(char *) "rotor", (char *) "Shows Tom's Roto-Rooter"},
+#ifdef USE_GL
+{(char *) "rubik", (char *) "Shows an auto-solving Rubik's Cube"},
+#endif
+#ifdef USE_GL
+{(char *) "sballs", (char *) "Balls spinning like crazy in GL"},
+#endif
+{(char *) "scooter", (char *) "Shows a journey through space tunnel and stars"},
+{(char *) "shape", (char *) "Shows stippled rectangles, ellipses, and triangles"},
+{(char *) "sierpinski", (char *) "Shows Sierpinski's triangle"},
+#ifdef USE_GL
+{(char *) "sierpinski3d", (char *) "Shows GL's Sierpinski gasket"},
+#endif
+#if defined(USE_GL) && defined( USE_UNSTABLE )
+{(char *) "skewb", (char *) "Shows an auto-solving Skewb"},
+#endif
+{(char *) "slip", (char *) "Shows slipping blits"},
+#ifdef HAVE_CXX
+{(char *) "solitare", (char *) "Shows Klondike's game of solitare"},
+#endif
+#ifdef USE_UNSTABLE
+{(char *) "space", (char *) "Shows a journey into deep space"},
+#endif
+{(char *) "sphere", (char *) "Shows a bunch of shaded spheres"},
+{(char *) "spiral", (char *) "Shows a helical locus of points"},
+{(char *) "spline", (char *) "Shows colorful moving splines"},
+#ifdef USE_GL
+{(char *) "sproingies", (char *) "Shows Sproingies!  Nontoxic.  Safe for pets and small children"},
+#endif
+#ifdef USE_GL
+{(char *) "stairs", (char *) "Shows some Infinite Stairs, an Escher-like scene"},
+#endif
+{(char *) "star", (char *) "Shows a star field with a twist"},
+{(char *) "starfish", (char *) "Shows starfish"},
+{(char *) "strange", (char *) "Shows strange attractors"},
+#ifdef USE_GL
+{(char *) "superquadrics", (char *) "Shows 3D mathematical shapes"},
+#endif
+{(char *) "swarm", (char *) "Shows a swarm of bees following a wasp"},
+{(char *) "swirl", (char *) "Shows animated swirling patterns"},
+{(char *) "t3d", (char *) "Shows a Flying Balls Clock Demo"},
+{(char *) "tetris", (char *) "Shows an autoplaying tetris game"},
+#if defined(USE_GL) && defined(HAVE_CXX) && defined( HAVE_TTF ) && defined( HAVE_GLTT ) && defined( USE_UNSTABLE )
+{(char *) "text3d", (char *) "Shows 3D text"},
+#endif
+{(char *) "thornbird", (char *) "Shows an animated bird in a thorn bush fractal map"},
+{(char *) "tik_tak", (char *) "Shows rotating polygons"},
+{(char *) "triangle", (char *) "Shows a triangle mountain range"},
+{(char *) "tube", (char *) "Shows an animated tube"},
+{(char *) "turtle", (char *) "Shows turtle fractals"},
+{(char *) "vines", (char *) "Shows fractals"},
+{(char *) "voters", (char *) "Shows Dewdney's Voters"},
+{(char *) "wator", (char *) "Shows Dewdney's Water-Torus planet of fish and sharks"},
+{(char *) "wire", (char *) "Shows a random circuit with 2 electrons"},
+{(char *) "world", (char *) "Shows spinning Earths"},
+{(char *) "worm", (char *) "Shows wiggly worms"},
+{(char *) "xcl", (char *) "Shows a control line combat model race"},
+{(char *) "xjack", (char *) "Shows Jack having one of those days"},
+{(char *) "blank", (char *) "Shows nothing but a black screen"},
+#ifdef USE_BOMB
+{(char *) "bomb", (char *) "Shows a bomb and will autologout after a time"},
+{(char *) "random", (char *) "Shows a random mode (except blank and bomb)"}
+#else
+{(char *) "random", (char *) "Shows a random mode (except blank)"}
+#endif
+};
+
+#define numprocs (sizeof(LockProcs) /sizeof(LockProcs[0]))
diff --git a/xmlock/option.c b/xmlock/option.c
new file mode 100644 (file)
index 0000000..a7b9d1a
--- /dev/null
@@ -0,0 +1,294 @@
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)option.c     4.00 97/01/01 xlockmore";
+
+#endif
+
+/*-
+ * option.c - option stuff for xmlock, the gui interface to xlock.
+ *
+ * Copyright (c) 1996 by Charles Vidal
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * Nov-96: written.
+ *
+ */
+
+/*-
+ * if you want add some options ,so it's not really difficult
+ * 1: Learn Motif ... but only if you want to :)
+ * 2: add a name of widget after geometry,font,program
+ * 3: add a string ( char * ) after *inval=NULL,*geo=NULL
+ * 4: add a callback like f_username with your new string
+ * 5: copy and paste after
+   geometry=XtVaCreateManagedWidget("geometry",xmPushButtonGadgetClass,options,NULL);
+   XtAddCallback(geometry,XmNactivateCallback,f_geometry,NULL);
+ *    change geometry by your name of widget, and f_geometry by the name
+ *    of your new callback
+ * 6: go to the church , call god for a miracle :)
+ * GOOD LUCK
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef VMS
+#include <vms_x_fix.h>
+#include <descrip.h>
+#include <lib$routines.h>
+#endif
+
+#include <X11/cursorfont.h>
+/* #include <Xm/XmAll.h> Does not work on my version of Lesstif */
+#include <Xm/RowColumn.h>
+#include <Xm/SelectioB.h>
+#include <Xm/CascadeB.h>
+#include <Xm/PushBG.h>
+#include <Xm/List.h>
+#include <Xm/Label.h>
+#include <Xm/ToggleBG.h>
+
+
+#include <Xm/MessageB.h> /* needed ? */
+
+#include "option.h"
+
+/*#define OPTIONS 8*/
+/*#define REGULAR_OPTIONS (OPTIONS-2)*/
+
+#define NBPROGNAME 3
+#define MAXNAMES 10000
+Widget      Menuoption;
+static Widget Options[OPTIONS];
+
+/* extern variables */
+extern Widget toplevel;
+
+void exitcallback(Widget w, XtPointer client_data, XtPointer call_data);
+
+
+/* Widget */
+static Widget PromptDialog, FontSelectionDialog, ProgramSelectionDialog;
+
+/* strings */
+char       *c_Options[OPTIONS];
+extern char *r_Options[OPTIONS];
+
+Widget Toggles[TOGGLES];
+
+static char *prompts[OPTIONS] =
+{
+       (char *) "Enter the user name.",
+       (char *) "Enter the password message.",
+       (char *) "Enter the info message.",
+       (char *) "Enter the valid message.",
+       (char *) "Enter the invalid message.",
+       (char *) "Enter the geometry mxn."
+};
+
+static char *prognames[NBPROGNAME] =
+{
+       (char *) "fortune",
+       (char *) "finger",
+       (char *) "echo hello world"
+};
+static int  loadfont = 0;
+
+char *r_Toggles[TOGGLES] =
+{
+        (char *) "allowaccess",
+        (char *) "allowroot",
+        (char *) "debug",
+        (char *) "echokeys",
+        (char *) "echokeys",
+        (char *) "enablesaver",
+        (char *) "fullrandom",
+        (char *) "grabmouse",
+        (char *) "grabmouse",
+        (char *) "grabserver",
+        (char *) "install",
+        (char *) "mousemotion",
+        (char *) "nolock",
+        (char *) "remote",
+        (char *) "sound",
+        (char *) "timeelapsed",
+        (char *) "trackmouse",
+        (char *) "use3d",
+        (char *) "usefirst",
+        (char *) "usefirst",
+        (char *) "verbose",
+        (char *) "wireframe",
+       (char *) "mono"
+
+};
+
+/* string temp */
+static char **whichone;
+
+
+static void
+managePrompt(char *s)
+{
+       int         ac;
+       Arg         args[3];
+       XmString    label_str1, label_str2;
+
+       ac = 0;
+       label_str1 = XmStringCreateSimple(s);
+       XtSetArg(args[ac], XmNselectionLabelString, label_str1);
+       ac++;
+       if (*whichone != NULL) {
+               label_str2 = XmStringCreateSimple(*whichone);
+               XtSetArg(args[ac], XmNtextString, label_str2);
+               ac++;
+       } else {
+               label_str2 = XmStringCreateSimple((char *) "");
+               XtSetArg(args[ac], XmNtextString, label_str2);
+               ac++;
+       }
+
+       XtSetValues(PromptDialog, args, ac);
+/* PURIFY 4.0.1 on Solaris 2 reports a 71 byte memory leak on the next line. */
+       XtManageChild(PromptDialog);
+       XmStringFree(label_str1);
+       XmStringFree(label_str2);
+}
+
+/* CallBack */
+static void
+f_option(Widget w, XtPointer client_data, XtPointer call_data)
+{
+                       whichone = &c_Options[(int) client_data];
+                       managePrompt(prompts[(int) client_data]);
+}
+
+#if 0
+/******************************
+ * Callback for the font dialog
+******************************/
+static void
+f_fontdia(Widget w, XtPointer client_data, XtPointer call_data)
+{
+       int         numdirnames, i;
+       char      **dirnames;
+       XmString    label_str;
+       Widget      listtmp;
+       Cursor      tmp;
+
+       whichone = &c_Options[OPTIONS];
+       if (!loadfont) {
+               tmp = XCreateFontCursor(XtDisplay(toplevel), XC_watch);
+               XDefineCursor(XtDisplay(toplevel), XtWindow(toplevel), tmp);
+               dirnames = XListFonts(XtDisplay(toplevel), "*", MAXNAMES, &numdirnames);
+               listtmp = XmSelectionBoxGetChild(FontSelectionDialog, XmDIALOG_LIST);
+               for (i = 0; i < numdirnames; i++) {
+                       label_str = XmStringCreateSimple(dirnames[i]);
+                       XmListAddItemUnselected(listtmp, label_str, 0);
+                       XmStringFree(label_str);
+               }
+               tmp = XCreateFontCursor(XtDisplay(toplevel), XC_left_ptr);
+               XDefineCursor(XtDisplay(toplevel), XtWindow(toplevel), tmp);
+               loadfont = 1;
+               XFreeFontNames(dirnames);
+       }
+       XtManageChild(FontSelectionDialog);
+}
+
+/******************************
+ * Callback for the program dialog
+******************************/
+static void f_programdia(Widget w, XtPointer client_data, XtPointer call_data) {
+                       /*whichone = &c_Options[REGULAR_OPTIONS + 1];*/
+/* PURIFY 4.0.1 on Solaris 2 reports a 71 byte memory leak on the next line. */
+                       XtManageChild(ProgramSelectionDialog);
+       }
+#endif
+
+static void
+f_Dialog(Widget w, XtPointer client_data, XtPointer call_data)
+{
+       static char *quoted_text;
+       char       *nonquoted_text = NULL;
+       XmSelectionBoxCallbackStruct *scb =
+               (XmSelectionBoxCallbackStruct *) call_data;
+
+       if (whichone != NULL)
+               XtFree(*whichone);
+       XmStringGetLtoR(scb->value, XmSTRING_DEFAULT_CHARSET, &nonquoted_text);
+       if ((quoted_text = (char *) malloc(strlen(nonquoted_text) + 3)) ==
+                       NULL) {
+               (void) fprintf(stderr, "Memory error\n");
+               return;
+       }
+       (void) sprintf(quoted_text, "\"%s\"", nonquoted_text);
+       (void) free((void *) nonquoted_text);
+       *whichone = quoted_text;
+}
+
+/* Setup Widget */
+void
+setup_Option(Widget MenuBar)
+{
+       Arg         args[15];
+       int         i, ac = 0;
+       XmString    label_str;
+       Widget      listtmp, pulldownmenu,exitwidget;
+
+/** 
+ ** Popup Menu File
+ **/
+       pulldownmenu = XmCreatePulldownMenu(MenuBar, "PopupFile", NULL, 0);
+       label_str = XmStringCreateSimple((char *) "File");
+       XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, MenuBar,
+               XmNlabelString, label_str, XmNsubMenuId, pulldownmenu, NULL);
+       XmStringFree(label_str);
+       exitwidget = XtVaCreateManagedWidget("Exit", xmPushButtonGadgetClass, pulldownmenu, NULL);
+       XtAddCallback(exitwidget, XmNactivateCallback, exitcallback,NULL);
+
+       pulldownmenu = XmCreatePulldownMenu(MenuBar, "PopupOptions", NULL, 0);
+       label_str = XmStringCreateSimple("Options");
+       XtVaCreateManagedWidget("Options", xmCascadeButtonWidgetClass, MenuBar,
+               XmNlabelString, label_str, XmNsubMenuId, pulldownmenu, NULL);
+       XmStringFree(label_str);
+
+       for (i = 0; i < OPTIONS; i++) {
+               Options[i] = XtVaCreateManagedWidget(r_Options[i],
+/*                             xmToggleButtonGadgetClass, pulldownmenu, NULL);*/
+                               xmPushButtonGadgetClass, pulldownmenu, NULL);
+               XtAddCallback(Options[i], XmNactivateCallback, f_option, (XtPointer) i);
+       }
+/* PURIFY 4.0.1 on Solaris 2 reports a 12 byte memory leak on the next line. */
+       PromptDialog = XmCreatePromptDialog(toplevel, "PromptDialog", args, ac);
+       XtAddCallback(PromptDialog, XmNokCallback, f_Dialog, NULL);
+
+/* PURIFY 4.0.1 on Solaris 2 reports a 28 byte and a 12 byte memory leak on
+   the next line. */
+       FontSelectionDialog = XmCreateSelectionDialog(toplevel,
+                                            "FontSelectionDialog", NULL, 0);
+       XtAddCallback(FontSelectionDialog, XmNokCallback, f_Dialog, NULL);
+
+/* PURIFY 4.0.1 on Solaris 2 reports a 38 byte memory leak on the next line. */
+       ProgramSelectionDialog = XmCreateSelectionDialog(toplevel,
+                                         "ProgramSelectionDialog", NULL, 0);
+       XtAddCallback(ProgramSelectionDialog, XmNokCallback, f_Dialog, NULL);
+       listtmp = XmSelectionBoxGetChild(ProgramSelectionDialog, XmDIALOG_LIST);
+       for (i = 0; i < NBPROGNAME; i++) {
+               label_str = XmStringCreateSimple(prognames[i]);
+               XmListAddItemUnselected(listtmp, label_str, 0);
+               XmStringFree(label_str);
+       }
+
+/**
+ ** Make the menu with all options boolean
+***/
+       pulldownmenu = XmCreatePulldownMenu(MenuBar, "PopupSwitches", NULL, 0);
+       label_str = XmStringCreateSimple("Switches");
+       XtVaCreateManagedWidget("Switches", xmCascadeButtonWidgetClass, MenuBar,
+               XmNlabelString, label_str, XmNsubMenuId, pulldownmenu, NULL);
+       XmStringFree(label_str);
+
+        for (i = 0; i < TOGGLES; i++) {
+               Toggles[i] = XtVaCreateManagedWidget(r_Toggles[i],
+                               xmToggleButtonGadgetClass, pulldownmenu, NULL);
+       }
+}
diff --git a/xmlock/option.h b/xmlock/option.h
new file mode 100644 (file)
index 0000000..84b58c7
--- /dev/null
@@ -0,0 +1,11 @@
+/* number of buttons, toggles, and string options */
+
+#define  PUSHBUTTONS  3
+#define  TOGGLES  23
+#define  OPTIONS  6
+
+#define XLOCK "xlock"
+#define WINDOW_WIDTH 160
+#define WINDOW_HEIGHT 100
+#define WINDOW_GEOMETRY "160x100"
+
diff --git a/xmlock/xmlock.c b/xmlock/xmlock.c
new file mode 100644 (file)
index 0000000..09dc975
--- /dev/null
@@ -0,0 +1,434 @@
+#if !defined( lint ) && !defined( SABER )
+
+static const char sccsid[] = "@(#)xmlock.c     4.08 98/02/18 xlockmore";
+
+#endif
+
+/*-
+ * xmlock.c - main file for xmlock, the gui interface to xlock.
+ *
+ * Copyright (c) 1996 by Charles Vidal
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * Nov-96: Continual minor improvements by Charles Vidal and David Bagley.
+ * Oct-96: written.
+ */
+
+/*-
+  XmLock Problems
+  1. Allowing only one in -inroot.  Need a way to kill it.
+  2. XLock resources need to be read and used to set initial values.
+  3. Integer and floating point and string input.
+ */
+
+/* 
+ * 01/2001
+ * I'm confused because the source is old and really not well programming 
+ * I put boolean option and option in the menubar
+ * I have had the option.h 
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/signal.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+#define HAVE_UNISTD_H 1
+#endif /* HAVE_CONFIG_H */
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#ifdef VMS
+#include "vms_x_fix.h"
+#include <descrip.h>
+#include <lib$routines.h>
+#endif
+
+#ifdef USE_MB
+#include <X11/Xlocale.h>
+#endif
+
+/* #include <Xm/XmAll.h> Does not work on my version of Lesstif */
+#include <Xm/PanedW.h>
+#include <Xm/RowColumn.h>
+#include <Xm/ToggleB.h>
+#include <Xm/List.h>
+#include <Xm/PushB.h>
+#include <Xm/CascadeB.h>
+#include <Xm/Form.h>
+#include <Xm/Label.h>
+#include <Xm/Separator.h>
+
+#if USE_XMU
+#include <X11/Xmu/Editres.h>
+#endif
+
+#include "option.h"
+
+#ifdef SunCplusplus
+        extern int  kill(pid_t, int);
+        extern pid_t  wait(int *);
+
+#else
+#if 0
+        extern int  kill(int, int);
+        extern pid_t  wait(int *);
+
+#endif
+#endif
+
+#include "bitmaps/m-xlock.xbm" /* icon bitmap */
+
+/* like an enum */
+enum ACTION {
+  LAUNCH=0,
+  ROOT,   
+  WINDOW 
+       };
+
+/* extern variable */
+extern char *c_Options[OPTIONS];
+extern Widget Menuoption;
+extern Widget Toggles[TOGGLES];
+
+extern char *r_Toggles[];
+
+static pid_t numberprocess = -1;       /* PID of xlock */
+
+/* Widget */
+Widget      toplevel;
+static Widget Labelxlock;
+
+static Widget ScrolledListModes, PushButtons[PUSHBUTTONS];
+
+ /*Resource string */
+#include "modes.h"
+
+#if 0
+static XmStringCharSet char_set = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET;
+#endif
+
+/* some resources of buttons and toggles not really good programming :( */
+
+static char *r_PushButtons[PUSHBUTTONS] =
+{
+       (char *) "Launch",
+       (char *) "In Root",
+       (char *) "In Window",
+};
+
+char       *r_Options[OPTIONS] =
+{
+       (char *) "username",
+       (char *) "password",
+       (char *) "info",
+       (char *) "validate",
+       (char *) "invalid",
+       (char *) "geometry",
+       /*(char *) "font",
+       (char *) "program"*/
+};
+
+static int  numberinlist = 0;
+
+/* CallBack */
+
+void exitcallback(Widget w, XtPointer client_data, XtPointer call_data) {
+                       if (numberprocess != -1) {
+                               (void) kill(numberprocess, SIGKILL);
+                               /*(void) wait(&n);*/
+                       }
+                       exit(0);
+       }
+
+static void
+f_PushButtons(Widget w, XtPointer client_data, XtPointer call_data)
+{
+       int         i;
+       char        command[500];
+
+#ifdef VMS
+       int         mask = 17;
+       struct dsc$descriptor_d vms_image;
+
+#endif
+
+       (void) sprintf(command, "%s ", XLOCK);
+
+/* booleans (+/-) options */
+
+       for (i = 0; i < TOGGLES; i++) {
+               if (XmToggleButtonGetState(Toggles[i])) {
+                       (void) strcat(command, "-");
+                       (void) strcat(command, r_Toggles[i]);
+                       (void) strcat(command, " ");
+               }
+       }
+       for (i = 0; i < OPTIONS; i++)
+               if (c_Options[i] != NULL) {
+                       (void) strcat(command, "-");
+                       (void) strcat(command, r_Options[i]);
+                       (void) strcat(command, " ");
+                       (void) strcat(command, c_Options[i]);
+                       (void) strcat(command, " ");
+               }
+       switch ((int) client_data) {
+               case LAUNCH:
+                       /* the default value then nothing to do */
+                       break;
+               case WINDOW:
+                       (void) strcat(command, "-inwindow ");
+                       break;
+               case ROOT:
+                       (void) strcat(command, "-inroot ");
+                       break;
+       }
+       (void) strcat(command, "-mode ");
+       (void) strcat(command, LockProcs[numberinlist].cmdline_arg);
+#ifdef VMS
+       vms_image.dsc$w_length = strlen(command);
+       vms_image.dsc$a_pointer = command;
+       vms_image.dsc$b_class = DSC$K_CLASS_S;
+       vms_image.dsc$b_dtype = DSC$K_DTYPE_T;
+       (void) printf("%s\n", command);
+       (void) lib$spawn(&vms_image, 0, 0, &mask);
+#else
+       (void) strcat(command, " & ");
+       (void) printf("%s\n", command);
+       (void) system(command);
+#endif
+}
+
+static void
+f_ScrolledListModes(Widget w, XtPointer client_data, XtPointer call_data)
+{
+       char        numberwidget[50];
+       char        str[50];
+       int         n;
+
+       numberinlist = ((XmListCallbackStruct *) call_data)->item_position - 1;
+       (void) sprintf(numberwidget, "%ld", XtWindow(Labelxlock));
+       (void) sprintf(str, "%s", LockProcs[numberinlist].cmdline_arg);
+       if (numberprocess != -1) {
+               (void) kill(numberprocess, SIGKILL);
+               (void) wait(&n);
+       }
+#ifdef VMS
+#define FORK vfork
+#else
+#define FORK fork
+#endif
+       if ((numberprocess = FORK()) == -1)
+               (void) fprintf(stderr, "Fork error\n");
+       else if (numberprocess == 0) {
+               (void) execlp(XLOCK, XLOCK, "-parent", numberwidget,
+                             "-mode", str, "-geometry", WINDOW_GEOMETRY, "-delay", "100000",
+                             "-nolock", "-inwindow", "+install", 0);
+       }
+}
+
+/* Setup Widget */
+
+/**********************/
+
+static void
+Setup_Widget(Widget father)
+{
+       Arg         args[15];
+       int         i, ac;
+       Widget      PushButtonRow, exitwidgetB;
+       char        string[160];
+       XmString    label_str;
+       XmString    TabXmStr[numprocs];
+
+/* buttons in the bottom */
+       ac = 0;
+       XtSetArg(args[ac], XmNorientation, XmHORIZONTAL);
+       ac++;
+       XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
+       ac++;
+       XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
+       ac++;
+       XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM);
+       ac++;
+
+       Menuoption = XmCreateMenuBar(father, (char *) "MenuBar", args,ac);
+       XtManageChild(Menuoption);
+
+       ac = 0;
+       XtSetArg(args[ac], XmNwidth, WINDOW_WIDTH);
+       ac++;
+       XtSetArg(args[ac], XmNheight, WINDOW_HEIGHT);
+       ac++;
+
+       XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
+       XtSetArg(args[ac], XmNtopWidget, Menuoption); ac++;
+
+#if 0
+       int ModeLabel;
+       XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
+
+       XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+
+       XtSetArg(args[ac], XmNleftWidget, ModeLabel); ac++;
+#endif
+
+       Labelxlock = XmCreateLabel(father, (char *) "Window", args, ac);
+       XtManageChild(Labelxlock);
+
+/* buttons in the bottom */
+ ac = 0;
+
+       XtSetArg(args[ac], XmNorientation, XmHORIZONTAL);
+       ac++;
+       XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
+       ac++;
+       XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
+       ac++;
+       XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM);
+       ac++;
+       PushButtonRow = XmCreateRowColumn(father, (char *) "PushButtonRow", args, ac);
+
+       for (i = 0; i < PUSHBUTTONS; i++) {
+               ac = 0;
+#ifndef USE_MB
+               label_str = XmStringCreate(r_PushButtons[i], XmSTRING_DEFAULT_CHARSET);
+               XtSetArg(args[ac], XmNlabelString, label_str);
+               ac++;
+#endif
+               PushButtons[i] = XmCreatePushButton(PushButtonRow, r_PushButtons[i],
+                                                   args, ac);
+#ifndef USE_MB
+               XmStringFree(label_str);
+#endif
+               XtAddCallback(PushButtons[i], XmNactivateCallback, f_PushButtons,
+                             (XtPointer) i);
+               XtManageChild(PushButtons[i]);
+       }
+/* 
+ *  Fro the exit button
+ */
+               ac = 0;
+#ifndef USE_MB
+               label_str = XmStringCreate("Exit", XmSTRING_DEFAULT_CHARSET);
+               XtSetArg(args[ac], XmNlabelString, label_str);
+               ac++;
+#endif
+               exitwidgetB = XmCreatePushButton(PushButtonRow, "Exit",
+                                                   args, ac);
+#ifndef USE_MB
+               XmStringFree(label_str);
+#endif
+               XtAddCallback(exitwidgetB, XmNactivateCallback, exitcallback, (XtPointer) NULL);
+               XtManageChild(exitwidgetB);
+
+       
+       XtManageChild(PushButtonRow);
+
+/* list and toggles in row like that (row(list)(TogglesRow(toggles...))) */
+       ac = 0;
+       XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET);
+       ac++;
+       XtSetArg(args[ac], XmNtopWidget, Labelxlock);
+       ac++;
+       XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM);
+       ac++;
+       XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM);
+       ac++;
+       XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_WIDGET);
+       ac++;
+       XtSetArg(args[ac], XmNbottomWidget, PushButtonRow);
+       ac++;
+       XtSetArg(args[ac], XmNitems, TabXmStr);
+       ac++;
+       XtSetArg(args[ac], XmNitemCount, numprocs);
+       ac++;
+       XtSetArg(args[ac], XmNvisibleItemCount, 10);
+       ac++;
+
+
+       for (i = 0; i < (int) numprocs; i++) {
+               (void) sprintf(string, "%-14s%s", LockProcs[i].cmdline_arg,
+                              LockProcs[i].desc);
+               TabXmStr[i] = XmStringCreate(string, XmSTRING_DEFAULT_CHARSET);
+       }
+               ScrolledListModes = XmCreateScrolledList(father, (char *) "ScrolledListModes",
+                                                args, ac);
+       XtAddCallback(ScrolledListModes, XmNbrowseSelectionCallback,
+                     f_ScrolledListModes, NULL);
+       XtManageChild(ScrolledListModes);
+
+#if 0
+       int TogglesRow, Row;
+       TogglesRow = XmCreateRowColumn(Row, (char *) "TogglesRow", NULL, 0);
+       for (i = 0; i < TOGGLES; i++) {
+#ifndef USE_MB
+               ac = 0;
+               label_str = XmStringCreate(r_Toggles[i], XmSTRING_DEFAULT_CHARSET);
+               XtSetArg(args[ac], XmNlabelString, label_str);
+               ac++;
+#endif
+               Toggles[i] = XmCreateToggleButton(TogglesRow, r_Toggles[i], args, ac);
+#ifndef USE_MB
+               XmStringFree(label_str);
+#endif
+               XtManageChild(Toggles[i]);
+       }
+       XtManageChild(TogglesRow);
+
+       XtManageChild(Row);
+#endif
+
+       for (i = 0; i < (int) numprocs; i++) {
+               XmStringFree(TabXmStr[i]);
+       }
+}
+
+extern void setup_Option(Widget MenuBar);
+
+int
+main(int argc, char **argv)
+{
+       Widget      form;
+       Arg         args[15];
+
+#ifdef USE_MB
+       setlocale(LC_ALL, "");
+       XtSetLanguageProc(NULL, NULL, NULL);
+#endif
+
+/* PURIFY 4.0.1 on Solaris 2 reports an unitialized memory read on the next
+   line. */
+       toplevel = XtInitialize(argv[0], "XmLock", NULL, 0, &argc, argv);
+       XtSetArg(args[0], XtNiconPixmap,
+                XCreateBitmapFromData(XtDisplay(toplevel),
+                                      RootWindowOfScreen(XtScreen(toplevel)),
+                           (char *) image_bits, image_width, image_height));
+       XtSetValues(toplevel, args, 1);
+       /* creation Widget */
+/* PURIFY 4.0.1 on Solaris 2 reports an unitialized memory read on the next
+   line. */
+       form = XmCreateForm(toplevel, (char *) "Form", NULL, 0);
+       Setup_Widget(form);
+       setup_Option(Menuoption);
+       XtManageChild(form);
+       XtRealizeWidget(toplevel);
+#if USE_XMU
+       XtAddEventHandler(toplevel, (EventMask) 0, TRUE,
+                         (XtEventHandler) _XEditResCheckMessages, NULL);
+/* With this handler you can use editres */
+#endif
+       XtMainLoop();
+#ifdef VMS
+       return 1;
+#else
+       return 0;
+#endif
+}
diff --git a/xscreensaver/Makefile.in b/xscreensaver/Makefile.in
new file mode 100644 (file)
index 0000000..e8d1edb
--- /dev/null
@@ -0,0 +1,76 @@
+# Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# the `../configure' script generates `Makefile' from this file.
+
+@SET_MAKE@
+srcdir         = @srcdir@
+VPATH          = @srcdir@
+
+SHELL          = /bin/sh
+SUBDIRS                = utils driver xlockmore/xlock xlockmore/modes hacks hacks/glx
+TARFILES       = README README.VMS README.debugging INSTALL xscreensaver.lsm \
+                 configure configure.in Makefile.in config.h.in \
+                 config.h-vms install-sh setup.com config.guess \
+                 config.sub makevms.com screenblank.txt \
+                 xscreensaver.lsm.sh
+TAR            = gtar
+COMPRESS       = gzip --verbose --best
+COMPRESS_EXT   = gz
+# COMPRESS     = compress
+# COMPRESS_EXT = Z
+
+MAKE_SUBDIR    = for dir in $(SUBDIRS) ; do ( cd $$dir ; $(MAKE) $@ ) ; done
+
+all::
+       @$(MAKE_SUBDIR)
+install:
+       @$(MAKE_SUBDIR)
+install-program:
+       @$(MAKE_SUBDIR)
+install-man:
+       @$(MAKE_SUBDIR)
+install-strip:
+       @$(MAKE_SUBDIR)
+uninstall:
+       @$(MAKE_SUBDIR)
+uninstall-program:
+       @$(MAKE_SUBDIR)
+uninstall-man:
+       @$(MAKE_SUBDIR)
+depend:
+       @$(MAKE_SUBDIR)
+distdepend:
+       @$(MAKE_SUBDIR)
+TAGS: tags
+tags:
+       @$(MAKE_SUBDIR)
+clean:
+       @$(MAKE_SUBDIR)
+distclean: clean
+       -rm -f config.h Makefile config.status config.cache config.log *~ "#"*
+       @$(MAKE_SUBDIR)
+
+dist: tar
+
+# This really makes me sick...
+tar:
+       @$(MAKE) distdepend ;                                               \
+  sh config.status ;                                                       \
+  sh xscreensaver.lsm.sh > xscreensaver.lsm.$$$$ ;                         \
+  mv xscreensaver.lsm.$$$$ xscreensaver.lsm ;                              \
+  NAME=`sed -n                                                             \
+  's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/xscreensaver-\1/p' utils/version.h` ;  \
+  rm -f $$NAME ; ln -s . $$NAME ;                                          \
+  FILES= ;                                                                 \
+  for subdir in $(SUBDIRS) ; do                                                    \
+    d=`pwd` ;                                                              \
+    cd $$subdir ;                                                          \
+    FILES="$$FILES `$(MAKE) echo_tarfiles                                  \
+      | grep -v '^.*make\['                                                \
+      | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\"                           \
+      ` ";                                                                 \
+    cd $$d ; done ;                                                        \
+  echo creating tar file $${NAME}.tar.$(COMPRESS_EXT)... ;                 \
+  $(TAR) -vchf -                                                           \
+    `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" `      \
+   | $(COMPRESS) > $${NAME}.tar.$(COMPRESS_EXT) ;                          \
+  rm $$NAME
diff --git a/xscreensaver/README b/xscreensaver/README
new file mode 100644 (file)
index 0000000..973d202
--- /dev/null
@@ -0,0 +1,47 @@
+This is for getting xlockmore modes running in xscreensaver-2.17.
+xlockmore-modes will install first ...
+So during an installation these executables will be overwritten
+if there is a conflict with the xscreensavers modes.
+
+See docs/TODO for current problems.
+
+0. OK say you have xscreensaver-2.17/ .  Drop xlockmore in that directory
+   change the name of xlockmore to "xlockmore".
+   (This is not 100% tested so it would be wise to read it first!)
+
+      cd xscreensaver-2.17/xlockmore/xscreensaver
+
+1. Makefile.in replaces ../../Makefile.in
+   configure.in replaces ../../configure.in
+   need autoconf to replace configure... (pick it from your favorite gnu site)
+
+      mv ../../configure.in ../../configure.in.orig
+      mv ../../Makefile.in ../../Makefile.in.orig
+      cp ./configure.in ../../configure.in
+      cp ./Makefile.in ../../Makefile.in
+      cd ../..
+      autoconf
+      cd xlockmore/xscreensaver
+
+2. modes/glx directory goes in xscreensaver/hacks/glx with the old
+   Makefile.in (do not write over this file!) and xlock-gl.c
+
+      mv ../../hacks/glx ../../hacks/glx.orig
+      cp -R ../modes/glx ../../hacks/glx
+      cp ../../hacks/glx.orig/Makefile.in ../../hacks/glx/
+      cp ../../hacks/glx.orig/xlock-gl.c ../../hacks/glx/
+
+
+3. change Makefiles... make backups
+
+     cp ../xlock/Makefile.in ../xlock/Makefile.inxl
+     cp ../modes/Makefile.in ../modes/Makefile.inxl
+     cp ../xlock/Makefile.inxs ../xlock/Makefile.in
+     cp ../modes/Makefile.inxs ../modes/Makefile.in
+
+
+4. Then its all ready...
+
+     cd ../..
+     configure
+     make
diff --git a/xscreensaver/configure.in b/xscreensaver/configure.in
new file mode 100644 (file)
index 0000000..ef491af
--- /dev/null
@@ -0,0 +1,1403 @@
+# configure.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+#
+
+AC_INIT(driver/subprocs.c)
+AC_CONFIG_HEADER(config.h)
+AC_CANONICAL_HOST
+
+AC_PROG_CC
+
+if test -z "$GCC"; then
+  AC_MSG_CHECKING(how to request ANSI compilation)
+  case "$host" in
+    *-hpux*)
+      AC_MSG_RESULT(HPUX: adding -Ae)
+      CC="$CC -Ae"
+    ;;
+    *-aix*)
+      AC_MSG_RESULT(AIX: adding -qlanglvl=ansi -qhalt=e)
+      CC="$CC -qlanglvl=ansi -qhalt=e"
+    ;;
+    *)
+      AC_MSG_RESULT(no idea)
+    ;;
+  esac
+fi
+
+
+AC_MSG_CHECKING([whether the compiler works on ANSI C])
+AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
+   AC_MSG_RESULT(yes),
+   AC_MSG_RESULT(no)
+   AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.),
+   AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.))
+
+case "$host" in
+  *-irix*)
+  if test -n "$GCC"; then
+    AC_MSG_RESULT(Turning on gcc compiler warnings.)
+    CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
+  else
+    # not gcc
+    AC_MSG_RESULT(Turning on SGI compiler warnings.)
+    CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
+  fi
+  ;;
+esac
+
+
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+AC_C_CONST
+AC_C_INLINE
+
+AC_HEADER_STDC
+AC_HEADER_TIME
+AC_HEADER_SYS_WAIT
+AC_HEADER_DIRENT
+
+AC_TYPE_MODE_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SIGNAL
+
+AC_MSG_CHECKING(how to call gettimeofday)
+AC_CACHE_VAL(ac_cv_gettimeofday_args,
+ [AC_TRY_COMPILE([#include <stdlib.h>
+                 #include <sys/time.h>],
+                [struct timeval tv; gettimeofday(&tv);],
+                [ac_gettimeofday_args=1],
+                [AC_TRY_COMPILE([#include <stdlib.h>
+                                 #include <sys/time.h>],
+                                [struct timeval tv; struct timezone tzp;
+                                 gettimeofday(&tv, &tzp);],
+                                [ac_gettimeofday_args=2],
+                                [ac_gettimeofday_args=0])])
+  ac_cv_gettimeofday_args=$ac_gettimeofday_args])
+ac_gettimeofday_args=$ac_cv_gettimeofday_args
+if test $ac_gettimeofday_args = 1 ; then
+  AC_DEFINE(HAVE_GETTIMEOFDAY)
+  AC_MSG_RESULT(one argument)
+elif test $ac_gettimeofday_args = 2 ; then
+  AC_DEFINE(HAVE_GETTIMEOFDAY)
+  AC_DEFINE(GETTIMEOFDAY_TWO_ARGS)
+  AC_MSG_RESULT(two arguments)
+else
+  AC_MSG_RESULT(unknown)
+fi
+
+
+AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv)
+AC_CHECK_FUNCS(sigaction)
+
+AC_CHECK_HEADERS(unistd.h)
+
+dnl    /usr/local/src/ssh-1.2.17/putenv.c -- AC_REPLACE_FUNCS(putenv)
+
+
+AC_ARG_ENABLE(subdir,[
+Installation options:
+
+  --enable-subdir=DIR     Put the demo programs in a subdirectory of \`bindir',
+                          instead of putting them in bindir itself.  You can
+                          specify the name of the subdirectory.  For example,
+                          --exec-prefix=/usr/local/bin --enable-subdir=demos
+                          would put xscreensaver in /usr/local/bin/, and would
+                          put the demos in /usr/local/bin/demos/.  Note that if
+                          you do this, you must make sure that the directory
+                          is on your \$PATH before xscreensaver is started: the
+                          directory name is not hardcoded into the program.
+                          This merely sets the default installation location.
+
+  --disable-subdir        Just put the demos in \`bindir' (this is the default.)
+],
+  [enable_subdir="$enableval"],[enable_subdir=no])
+if test x"$enable_subdir" = xno; then
+  HACKDIR='$(bindir)'
+elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
+  echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
+  exit 1
+else
+  HACKDIR='$(bindir)/'$enable_subdir
+fi
+
+
+AC_PATH_XTRA
+
+# Try and find the app-defaults directory.
+# It sucks that autoconf doesn't do this already...
+#
+AC_DEFUN(AC_PATH_X_APP_DEFAULTS_XMKMF,
+  [
+  rm -fr conftestdir
+  if mkdir conftestdir; then
+    cd conftestdir
+    # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+    cat > Imakefile <<'EOF'
+acfindx:
+       @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
+EOF
+    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+      # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
+      eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    fi
+    cd ..
+    rm -fr conftestdir
+  fi])
+
+AC_DEFUN(AC_PATH_X_APP_DEFAULTS_DIRECT,
+[  # Look for the directory under a standard set of common directories.
+  # Check X11 before X11Rn because it's often a symlink to the current release.
+  for ac_dir in                                        \
+    /usr/X11/lib/app-defaults                  \
+    /usr/X11R6/lib/app-defaults                        \
+    /usr/X11R6/lib/X11/app-defaults            \
+    /usr/X11R5/lib/app-defaults                        \
+    /usr/X11R5/lib/X11/app-defaults            \
+    /usr/X11R4/lib/app-defaults                        \
+    /usr/X11R4/lib/X11/app-defaults            \
+                                               \
+    /usr/lib/X11/app-defaults                  \
+    /usr/lib/X11R6/app-defaults                        \
+    /usr/lib/X11R5/app-defaults                        \
+    /usr/lib/X11R4/app-defaults                        \
+                                               \
+    /usr/local/X11/lib/app-defaults            \
+    /usr/local/X11R6/lib/app-defaults          \
+    /usr/local/X11R5/lib/app-defaults          \
+    /usr/local/X11R4/lib/app-defaults          \
+                                               \
+    /usr/local/lib/X11/app-defaults            \
+    /usr/local/lib/X11R6/app-defaults          \
+    /usr/local/lib/X11R6/X11/app-defaults      \
+    /usr/local/lib/X11R5/app-defaults          \
+    /usr/local/lib/X11R5/X11/app-defaults      \
+    /usr/local/lib/X11R4/app-defaults          \
+    /usr/local/lib/X11R4/X11/app-defaults      \
+                                               \
+    /usr/X386/lib/X11/app-defaults             \
+    /usr/x386/lib/X11/app-defaults             \
+    /usr/XFree86/lib/X11/app-defaults          \
+                                               \
+    /usr/lib/X11/app-defaults                  \
+    /usr/local/lib/X11/app-defaults            \
+    /usr/unsupported/lib/X11/app-defaults      \
+    /usr/athena/lib/X11/app-defaults           \
+    /usr/local/x11r5/lib/X11/app-defaults      \
+    /usr/lpp/Xamples/lib/X11/app-defaults      \
+    /lib/usr/lib/X11/app-defaults              \
+                                               \
+    /usr/openwin/lib/app-defaults              \
+    /usr/openwin/lib/X11/app-defaults          \
+    /usr/openwin/share/lib/app-defaults                \
+    /usr/openwin/share/lib/X11/app-defaults    \
+                                               \
+    /X11R6/lib/app-defaults                    \
+    /X11R5/lib/app-defaults                    \
+    /X11R4/lib/app-defaults                    \
+    ; \
+  do
+    if test -d "$ac_dir"; then
+      ac_x_app_defaults=$ac_dir
+      break
+    fi
+  done
+])
+
+
+AC_DEFUN(AC_PATH_X_APP_DEFAULTS,
+  [AC_REQUIRE_CPP()
+    AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
+     [AC_PATH_X_APP_DEFAULTS_XMKMF
+      AC_PATH_X_APP_DEFAULTS_DIRECT
+      if test x"$ac_x_app_defaults" = x; then
+        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
+      else
+        # Record where we found app-defaults for the cache.
+        ac_cv_x_app_defaults="$ac_x_app_defaults"
+      fi])
+    eval ac_x_app_defaults="$ac_cv_x_app_defaults"])
+
+AC_PATH_X_APP_DEFAULTS
+
+APPDEFAULTS=$ac_x_app_defaults
+
+
+# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
+#
+AC_DEFUN(AC_CHECK_X_HEADER, [
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
+  fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  AC_CHECK_HEADER([$1], [$2])
+  CPPFLAGS="$ac_save_CPPFLAGS"])
+
+# Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
+#
+AC_DEFUN(AC_EGREP_X_HEADER, [
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
+  fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  AC_EGREP_HEADER([$1], [$2], [$3], [$4])
+  CPPFLAGS="$ac_save_CPPFLAGS"])
+
+# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
+#
+AC_DEFUN(AC_TRY_X_COMPILE, [
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
+  fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  AC_TRY_COMPILE([$1], [$2], [$3], [$4])
+  CPPFLAGS="$ac_save_CPPFLAGS"])
+
+
+# Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
+# Use this sparingly; it probably doesn't work very well on X programs.
+#
+AC_DEFUN(AC_CHECK_X_LIB, [
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  ac_save_LDFLAGS="$LDFLAGS"
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
+  fi
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
+  fi
+  if test \! -z "$libdir" ; then
+    LDFLAGS="$LDFLAGS -L$libdir"
+  fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  if test \! -z "$x_libraries" ; then
+    LDFLAGS="$LDFLAGS -L$x_libraries"
+  fi
+  AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"])
+
+# Like AC_TRY_RUN, but it uses the already-computed -I directories.
+# (But not the -L directories!)
+#
+AC_DEFUN(AC_TRY_X_RUN, [
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  if test \! -z "$includedir" ; then
+    CPPFLAGS="$CPPFLAGS -I$includedir"
+  fi
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  AC_TRY_RUN([$1], [$2], [$3], [$4])
+  CPPFLAGS="$ac_save_CPPFLAGS"])
+
+
+
+
+
+# check for the HP XHPDisableReset server extension headers.
+#
+AC_EGREP_X_HEADER(XHPDisableReset, X11/XHPlib.h,
+                 [AC_DEFINE(HAVE_XHPDISABLERESET)
+                  SAVER_LIBS="-lXhp11 $SAVER_LIBS"])
+
+
+# Check for the availability of the XPointer typedef, and define it otherwise.
+#
+AC_CACHE_CHECK([for XPointer], ac_cv_xpointer,
+               [AC_TRY_X_COMPILE([#include <X11/Xlib.h>],
+                                 [XPointer foo = (XPointer) 0;],
+                                 [ac_cv_xpointer=yes],
+                                 [ac_cv_xpointer=no])])
+if test $ac_cv_xpointer != yes; then
+  AC_DEFINE(XPointer,[char*])
+fi
+
+
+case "$host" in
+  *-hpux*)
+    # Thanks for not making xmkmf find this by default, you losers.
+    if test -d /usr/lib/Motif1.2 ; then
+      X_CFLAGS="-I/usr/include/Motif1.2 $X_CFLAGS"
+      X_LIBS="-L/usr/lib/Motif1.2 $X_LIBS"
+    elif test -d /usr/lib/Motif1.1 ; then
+      X_CFLAGS="-I/usr/include/Motif1.1 $X_CFLAGS"
+      X_LIBS="-L/usr/lib/Motif1.1 $X_LIBS"
+    fi
+
+    # This too.  You losers.
+    if test -d /usr/contrib/X11R6/include ; then
+      X_CFLAGS="-I/usr/contrib/X11R6/include $X_CFLAGS"
+      X_LIBS="-L/usr/contrib/X11R6/lib $X_LIBS"
+    elif test -d /usr/X11R6/include ; then
+      X_CFLAGS="-I/usr/X11R6/include $X_CFLAGS"
+      X_LIBS="-L/usr/X11R6/lib $X_LIBS"
+    elif test -d /usr/contrib/X11R5/include ; then
+      X_CFLAGS="-I/usr/contrib/X11R5/include $X_CFLAGS"
+      X_LIBS="-L/usr/contrib/X11R5/lib $X_LIBS"
+    elif test -d /usr/X11R5/include ; then
+      X_CFLAGS="-I/usr/X11R5/include $X_CFLAGS"
+      X_LIBS="-L/usr/X11R5/lib $X_LIBS"
+    fi
+
+  ;;
+  *-solaris*)
+    # Same to you, pinheads.  (Is this really the standard location now?
+    # What happened to the joke that this kind of thing went in /opt?)
+    # cthomp says "answer: CDE (Common Disorganized Environment)"
+    if test -f /usr/dt/include/Xm/Xm.h ; then
+      X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
+      X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
+
+      # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
+      AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
+    fi
+  ;;
+esac
+
+
+
+# Check for Xmu (some fucked up vendors don't ship it...)
+#
+have_xmu=no
+AC_CHECK_X_HEADER(X11/Xmu/Error.h, [have_xmu=yes])
+if test $have_xmu = no ; then
+  XMU_SRCS='$(UTILS_SRC)/xmu.c'
+  XMU_OBJS='$(UTILS_BIN)/xmu.o'
+else
+  XMU_SRCS=''
+  XMU_OBJS=''
+  SAVER_LIBS="-lXmu $SAVER_LIBS"
+  HACK_LIBS="-lXmu $HACK_LIBS"
+  AC_DEFINE(HAVE_XMU)
+fi
+
+
+# See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
+# The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
+#
+if test $have_xmu = yes ; then
+  case "$host" in
+    *-sunos4*)
+    AC_CACHE_CHECK([for the SunOS 4.1.x _get_wmShellWidgetClass bug],
+                  ac_cv_sunos_xmu_bug,
+                  [ac_save_LDFLAGS="$LDFLAGS"
+                   if test \! -z "$x_libraries" ; then
+                     LDFLAGS="$LDFLAGS -L$x_libraries"
+                   fi
+                   # Note: this trick never works!  (Generally.)
+                   # We're only getting away with using AC_TRY_LINK
+                   # with X libraries because we know it's SunOS.
+                   LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
+                   AC_TRY_LINK(,,
+                               [ac_cv_sunos_xmu_bug=no],
+                               [ac_cv_sunos_xmu_bug=yes])
+                   LDFLAGS="$ac_save_LDFLAGS"])
+    if test $ac_cv_sunos_xmu_bug = yes ; then
+      AC_CACHE_CHECK([whether the compiler understands -static],
+                    ac_cv_ld_static,
+                    [ac_save_LDFLAGS="$LDFLAGS"
+                     LDFLAGS="$LDFLAGS -static"
+                     AC_TRY_LINK(,,[ac_cv_ld_static=yes],[ac_cv_ld_static=no])
+                   LDFLAGS="$ac_save_LDFLAGS"])
+      if test $ac_cv_ld_static = yes ; then
+        LDFLAGS="$LDFLAGS -static"
+      else
+       LDFLAGS="$LDFLAGS -Bstatic"
+      fi
+    fi
+    ;;
+  esac
+fi
+
+
+# Check for the SGI SCREEN_SAVER server extension header.
+#
+have_sgi=no
+with_sgi_req=unspecified
+AC_ARG_WITH(sgi-ext,[
+Server options:
+
+  --with-sgi-ext          Include support for the SGI SCREEN_SAVER
+                          server extension, if possible (this is the default).
+  --without-sgi-ext       Do not compile in support for this extension.],
+  [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes])
+if test $with_sgi = yes; then
+  AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h,
+                   [have_sgi=yes
+                    AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)])
+
+elif test $with_sgi != no; then
+  echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
+  exit 1
+fi
+
+# Check for the MIT-SCREEN-SAVER server extension header,
+# unless the SGI extension has already been found.
+#
+have_mit=no
+with_mit_req=unspecified
+AC_ARG_WITH(mit-ext,
+[  --with-mit-ext          Include support for the MIT-SCREEN-SAVER
+                          server extension, if possible (this is the default).
+  --without-mit-ext       Do not compile in support for this extension.],
+  [with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
+if test $have_sgi != yes; then
+  if test $with_mit = yes; then
+    AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes])
+
+    # Now check to see if it's really in the library; XF86Free-3.3 ships
+    # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
+    #
+    if test $have_mit = yes; then
+      AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [], [have_mit=no], -lm)
+
+      if test $have_mit = no; then
+       # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
+       # of in Xext.  Thank you master, may I have another.
+        AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
+                      [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
+                      [], -lX11 -lXext -lm)
+      fi
+
+      if test $have_mit = no; then
+       # Double fuck!  Looks like some versions of XFree86 (whichever version
+       # it is that comes with RedHat Linux 2.0 -- I can't find a version
+       # number) put this garbage in Xss instead of Xext.  Thank you master,
+       #  may I have another.
+        AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
+                      [have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
+                      [], -lX11 -lXext -lm)
+      fi
+
+    if test $have_mit = yes; then
+      AC_DEFINE(HAVE_MIT_SAVER_EXTENSION)
+    fi
+
+    fi
+
+  elif test $with_mit != no; then
+    echo "error: must be yes or no: --with-mit-ext=$with_mit"
+    exit 1
+  fi
+fi
+
+
+# Check for the XIDLE server extension header.
+#
+have_xidle=no
+with_xidle_req=unspecified
+AC_ARG_WITH(xidle-ext,
+[  --with-xidle-ext        Include support for the XIDLE server extension,
+                          if possible (this is the default).
+  --without-xidle-ext     Do not compile in support for this extension.],
+  [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes])
+if test $with_xidle = yes; then
+  AC_CHECK_X_HEADER(X11/extensions/xidle.h,
+                   [have_xidle=yes
+                    AC_DEFINE(HAVE_XIDLE_EXTENSION)])
+elif test $with_xidle != no; then
+  echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
+  exit 1
+fi
+
+
+# Check for the XSHM server extension header.
+#
+have_xshm=no
+with_xshm_req=unspecified
+AC_ARG_WITH(xshm-ext,
+[  --with-xshm-ext         Include support for the XSHM (Shared Memory) server
+                          extension, if possible (this is the default).
+  --without-xshm-ext      Do not compile in support for this extension.],
+  [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
+if test $with_xshm = yes; then
+
+  # first check for Xshm.h.
+  AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
+
+  # if that succeeded, then check for sys/ipc.h.
+  if test $have_xshm = yes; then
+    have_xshm=no
+    AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
+  fi
+
+  # if that succeeded, then check for sys/shm.h.
+  if test $have_xshm = yes; then
+    have_xshm=no
+    AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
+  fi
+
+  # if that succeeded, then we've really got it.
+  if test $have_xshm = yes; then
+    AC_DEFINE(HAVE_XSHM_EXTENSION)
+  fi
+
+elif test $with_xshm != no; then
+  echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
+  exit 1
+fi
+
+
+# Check for the SGI-VIDEO-CONTROL server extension header.
+#
+have_sgivc=no
+with_sgivc_req=unspecified
+AC_ARG_WITH(sgivc-ext,
+[  --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL server
+                          extension, if possible (this is the default).
+  --without-sgivc-ext     Do not compile in support for this extension.],
+  [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes])
+if test $with_sgivc = yes; then
+
+  # first check for XSGIvc.h
+  AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes])
+
+  # if that succeeded, then check for the -lXsgivc
+  if test $have_sgivc = yes; then
+    have_sgivc=no
+    AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap,
+                 [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [],
+                 -lXext -lX11)
+  fi
+
+  # if that succeeded, then we've really got it.
+  if test $have_sgivc = yes; then
+    AC_DEFINE(HAVE_SGI_VC_EXTENSION)
+  fi
+
+elif test $with_sgivc != no; then
+  echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
+  exit 1
+fi
+
+
+
+
+
+
+
+
+# Check for Motif and Athena --with and --without arguments.
+#
+have_motif=no
+have_athena=no
+with_motif_req=unspecified
+with_athena_req=unspecified
+
+AC_ARG_WITH(motif,[
+Toolkit options:
+
+  --with-motif            Use the Motif toolkit for the user interface,
+                          if possible (this is the default).
+  --without-motif         Do not use Motif.],
+  [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no])
+
+AC_ARG_WITH(athena,
+[  --with-athena           Use the Athena toolkit for the user interface, if
+                          possible (this is the default if Motif isn't used.)
+  --without-athena        Do not use Athena.],
+  [with_athena="$withval"; with_athena_req="$withval"],[with_athena=no])
+
+if test $with_motif != yes -a $with_motif != no ; then
+  echo "error: must be yes or no: --with-motif=$with_motif"
+  exit 1
+fi
+
+if test $with_athena != yes -a $with_athena != no ; then
+  echo "error: must be yes or no: --with-athena=$with_athena"
+  exit 1
+fi
+
+
+# Saying --without-motif is the same as saying --with-athena.
+if test $with_motif_req = no ; then
+  with_athena_req=yes
+  with_athena=yes
+fi
+
+# Saying --without-athena is the same as saying --with-motif.
+if test $with_athena_req = no ; then
+  with_motif_req=yes
+  with_motif=yes
+fi
+
+# Check for Motif and Athena headers.
+
+check_motif() {
+  AC_CHECK_X_HEADER(Xm/Xm.h,
+                   [have_motif=yes
+                    AC_DEFINE(HAVE_MOTIF)
+                    SAVER_LIBS="-lXm $SAVER_LIBS"])
+}
+
+check_athena() {
+  AC_CHECK_X_HEADER(X11/Xaw/Dialog.h,
+                  [have_athena=yes
+                   AC_DEFINE(HAVE_ATHENA)
+                   SAVER_LIBS="-lXaw $SAVER_LIBS"])
+}
+
+
+# If they asked for both motif and athena, check motif then athena.
+# If they asked for only motif, check motif then athena.
+# If they asked for only athena, check athena then motif.
+# If they asked for neither, check motif then athena.
+
+proselytize_motif=yes
+if test $with_motif = yes; then
+  # asked for both, or for motif only
+  check_motif
+  if test $have_motif = yes; then
+    with_athena=no
+    with_athena_req=no
+  else
+    check_athena
+  fi
+
+elif test $with_athena = yes; then
+  # asked for athena only
+  check_athena
+  if test $have_athena = yes; then
+    with_motif=no
+    proselytize_motif=no
+  else
+    check_motif
+  fi
+
+else
+  # asked for neither
+  check_motif
+  if test $have_motif = yes; then
+    with_athena=no
+  else
+    check_athena
+  fi
+
+fi
+
+if test $have_motif = yes; then
+  proselytize_motif=no
+fi
+
+# If we have Athena, check whether it's a version that includes
+# XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
+if test $have_athena = yes ; then
+  AC_CACHE_CHECK([for XawViewportSetCoordinates in Viewport.h],
+                ac_cv_have_XawViewportSetCoordinates,
+                [ac_cv_have_XawViewportSetCoordinates=no
+                 AC_EGREP_X_HEADER(XawViewportSetCoordinates,
+                                   X11/Xaw/Viewport.h,
+                                   ac_cv_have_XawViewportSetCoordinates=yes)])
+  if test $ac_cv_have_XawViewportSetCoordinates = yes ; then
+    AC_DEFINE(HAVE_XawViewportSetCoordinates)
+  fi
+fi
+
+
+# If we have Motif, check whether it's really LessTif.
+#
+have_lesstif=no
+if test $have_motif = yes ; then
+  AC_CACHE_CHECK([whether Motif is really LessTif],
+                ac_cv_have_lesstif,
+                [AC_TRY_X_COMPILE([#include <Xm/Xm.h>],
+                                  [long vers = LesstifVersion;],
+                                  [ac_cv_have_lesstif=yes],
+                                  [ac_cv_have_lesstif=no])])
+  have_lesstif=$ac_cv_have_lesstif
+fi
+
+# don't cache this
+unset ac_cv_good_lesstif
+
+good_lesstif=no
+if test $have_lesstif = yes ; then
+  # It must be at least "GNU Lesstif 0.82".
+  # #### If you change this, also sync the warning message lower down.
+  AC_CACHE_CHECK([whether LessTif is of a recent enough vintage],
+                ac_cv_good_lesstif,
+                [AC_TRY_X_RUN([#include <Xm/Xm.h>
+                               int main() { exit(LesstifVersion < 82); }],
+                              [ac_cv_good_lesstif=yes],
+                              [ac_cv_good_lesstif=no],
+                              # cross compiling?  Make an ass out of umption.
+                              [ac_cv_good_lesstif=yes])])
+  good_lesstif=$ac_cv_good_lesstif
+fi
+
+
+# check for XPM header.
+#
+have_xpm=no
+with_xpm_req=unspecified
+AC_ARG_WITH(xpm,[
+Demo options:
+
+  --with-xpm              Include support for XPM files in some demos,
+                          if possible (this is the default).
+  --without-xpm           Do not compile in support for XPM files.],
+  [with_xpm="$withval"; with_xpm_req="$withval"],[with_xpm=yes])
+if test $with_xpm = yes; then
+  AC_CHECK_X_HEADER(X11/xpm.h,
+                  [have_xpm=yes
+                   AC_DEFINE(HAVE_XPM)
+                   XPM_LIBS="-lXpm"])
+elif test $with_xpm != no; then
+  echo "error: must be yes or no: --with-xpm=$with_xpm"
+  exit 1
+fi
+
+
+# check for the GL header
+#
+have_gl=no
+with_gl_req=unspecified
+AC_ARG_WITH(gl,
+[  --with-gl               Build those demos which depend on OpenGL,
+                          if possible (this is the default).
+  --without-gl            Do not build the OpenGL demos.],
+  [with_gl="$withval"; with_gl_req="$withval"],[with_gl=yes])
+
+if test $with_gl = yes; then
+  AC_CHECK_X_HEADER(GL/gl.h, have_gl=yes, have_gl=no)
+  if test $have_gl = yes ; then
+    AC_CHECK_X_HEADER(GL/glx.h, have_gl=yes, have_gl=no)
+  fi
+
+  # If we have the headers, try and figure out which vendor it's from.
+  #
+  if test $have_gl = yes ; then
+
+    AC_DEFINE(HAVE_GL)
+    have_mesa_gl=no
+    AC_EGREP_X_HEADER(Mesa, GL/glx.h, [have_mesa_gl=yes])
+    if test $have_mesa_gl = no ; then
+      GL_LIBS="-lGL -lGLU"
+    else
+      AC_DEFINE(HAVE_MESA_GL)
+      GL_LIBS="-lMesaGL -lMesaGLU"
+    fi
+  fi
+
+elif test $with_gl != no; then
+  echo "error: must be yes or no: --with-gl=$with_gl"
+  exit 1
+fi
+
+
+# check for SGI XReadDisplay server extension header.
+#
+have_readdisplay=no
+with_readdisplay_req=unspecified
+AC_ARG_WITH(readdisplay,
+[  --with-readdisplay      Include support for the XReadDisplay server
+                          extension if possible (this is the default).
+  --without-readdisplay   Do not compile in support for this extension.],
+  [with_readdisplay="$withval"; with_readdisplay_req="$withval"],
+  [with_readdisplay=yes])
+if test $with_readdisplay = yes; then
+  AC_CHECK_X_HEADER(X11/extensions/readdisplay.h,
+                   AC_DEFINE(HAVE_READ_DISPLAY_EXTENSION))
+elif test $with_readdisplay != no; then
+  echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
+  exit 1
+fi
+
+
+# check for SGI's Iris Video Library header.
+#
+have_sgivideo=no
+with_sgivideo_req=unspecified
+AC_ARG_WITH(sgivideo,
+[  --with-sgivideo         Include support for SGI's Iris Video Library
+                          if possible (this is the default).
+  --without-sgivideo       Do not compile in support for this library.],
+  [with_sgivideo="$withval"; with_sgivideo_req="$withval"],
+  [with_sgivideo=yes])
+if test $with_sgivideo = yes; then
+  AC_CHECK_X_HEADER(dmedia/vl.h, have_sgivideo=yes)
+  if test $have_sgivideo = yes; then
+    have_sgivideo=no
+    AC_CHECK_LIB(vl, vlOpenVideo, have_sgivideo=yes)
+    if test $have_sgivideo = yes; then
+      SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
+      SGI_VIDEO_LIBS="-lvl"
+      AC_DEFINE(HAVE_SGI_VIDEO)
+    fi
+  fi
+elif test $with_sgivideo != no; then
+  echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
+  exit 1
+fi
+
+
+
+# Try to find a program to generate random text.
+#
+# Zippy is funnier than the idiocy generally spat out by `fortune',
+# so try to find that, by invoking Emacs and asking it where its
+# libexec directory is ("yow" lives in there.)
+#
+# If that doesn't work, see if fortune, zippy, or yow are on $PATH,
+# and if so, use them.
+#
+# If that doesn't work, look in /usr/games, and if it's there, use
+# the full pathname.
+#
+with_zippy_req=""
+AC_ARG_WITH(zippy,
+[  --with-zippy=PROGRAM    Some demos are able to run an external program and
+                          display its text; this names the program to use by
+                          default (though it can be overridden with X
+                          resources.)  If you don't specify this, the default
+                          is to use \"yow\" from the Emacs distribution (if you
+                          have it) or else to use \"fortune\".],
+  [ with_zippy_req="$withval"; with_zippy="$withval" ],
+  [ with_zippy_req="$withval"; with_zippy="$withval" ])
+
+if test "$with_zippy" = no || test "$with_zippy" = yes ; then
+  with_zippy=""
+  with_zippy_req=""
+fi
+
+if test -n "$with_zippy_req" ; then
+  ac_cv_zippy_program=""
+  case "$with_zippy_req" in
+    /*)
+      AC_MSG_CHECKING([for $with_zippy_req])
+      if test -x "$with_zippy_req" ; then
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+        with_zippy=""
+      fi
+    ;;
+    *)
+      # don't cache
+      unset ac_cv_path_zip2
+      AC_PATH_PROG(zip2, $with_zippy_req, [])
+      if test "$zip2" = ""; then
+        with_zippy=""
+      fi
+    ;;
+  esac
+  ac_cv_zippy_program="$with_zippy"
+
+elif test -n "$ac_cv_zippy_program"; then
+  AC_MSG_RESULT([checking for zippy... (cached) $ac_cv_zippy_program])
+fi
+
+if test ! -n "$ac_cv_zippy_program"; then
+
+  AC_CHECK_PROGS(emacs_exe, emacs)
+  AC_CHECK_PROGS(xemacs_exe, xemacs)
+
+  ac_cv_zippy_program=""
+  eargs='-batch -q -nw --eval'
+
+  if test -n "$emacs_exe" ; then
+    AC_MSG_CHECKING([for emacs yow])
+    #
+    # get emacs to tell us where the libexec directory is.
+    #
+    dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
+        2>/dev/null | tail -1`
+    dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
+    #
+    # try running libexec/yow and see if it exits without error.
+    #
+    if test x"$dir" != x -a -x $dir/yow ; then
+      if $dir/yow >&- 2>&- ; then
+       ac_cv_zippy_program="$dir/yow"
+       AC_MSG_RESULT($ac_cv_zippy_program)
+      else
+       AC_MSG_RESULT(no)
+      fi
+    fi
+  fi
+
+  if test -z "$ac_cv_zippy_program" ; then
+    AC_MSG_CHECKING([for xemacs yow])
+    if test -n "$xemacs_exe" ; then
+      #
+      # get xemacs to tell us where the libexec directory is.
+      #
+      dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
+          2>/dev/null | tail -1`
+      dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
+      #
+      # try running libexec/yow and see if it exits without error.
+      #
+      if test x"$dir" != x -a -x $dir/yow ; then
+        if $dir/yow >&- 2>&- ; then
+         ac_cv_zippy_program="$dir/yow"
+         AC_MSG_RESULT($ac_cv_zippy_program)
+       else
+         #
+         # in some xemacs installations, the pathname of the yow.lines file
+         # isn't hardcoded into the yow executable, and must be passed on
+         # the command line.  See if it's in libexec/../etc/.
+
+         # M4 sucks!!
+         changequote(X,Y)
+         dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
+         changequote([,])
+
+          yow="yow -f $dir_up/etc/yow.lines"
+         if $dir/$yow >&- 2>&- ; then
+           ac_cv_zippy_program="$dir/$yow"
+           AC_MSG_RESULT($ac_cv_zippy_program)
+         else
+           AC_MSG_RESULT(no)
+         fi
+        fi
+      fi
+    fi
+  fi
+
+  # if that didn't work, try for some other programs...
+  if test -z "$ac_cv_zippy_program" ; then
+    fortune=''
+    AC_CHECK_PROGS(fortune, [fortune zippy yow])
+    # if that didn't work, try for those programs in /usr/games...
+    if test -z "$fortune" ; then
+      AC_PATH_PROGS(fortune, [fortune zippy yow], fortune,
+                   /usr/games:/usr/local/games)
+    fi
+  fi
+fi
+
+if test -z "$ac_cv_zippy_program" ; then
+  ac_cv_zippy_program=fortune
+fi
+
+AC_DEFINE_UNQUOTED(ZIPPY_PROGRAM, "$ac_cv_zippy_program")
+
+
+
+
+# Allow locking to be disabled at compile-time.
+#
+have_locking=yes
+have_kerberos=no
+with_kerberos_req=unspecified
+have_shadow=no
+with_shadow_req=unspecified
+need_setuid=no
+
+AC_ARG_ENABLE(locking,[
+Locking options:
+
+  --enable-locking        Compile in support for locking the display
+                          (this is the default.)
+  --disable-locking       Do not allow locking at all.],
+  [enable_locking="$enableval"],[enable_locking=yes])
+if test $enable_locking = yes; then
+
+  # Check for Kerberos.
+  #
+  AC_ARG_WITH(kerberos, [
+  --with-kerberos         Include support for Kerberos authentication,
+                          if possible (this is the default.)
+  --without-kerberos      Do not compile in support for Kerberos.],
+  [with_kerberos="$withval"; with_kerberos_req="$withval"],[with_kerberos=yes])
+  if test $with_kerberos = yes; then
+    AC_CACHE_CHECK([for Kerberos], ac_cv_kerberos,
+                  [AC_TRY_X_COMPILE([#include <krb.h>],,
+                                    [ac_cv_kerberos=yes],
+                                    [ac_cv_kerberos=no])])
+    if test $ac_cv_kerberos = yes ; then
+      have_kerberos=yes
+      AC_DEFINE(HAVE_KERBEROS)
+      PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lnsl -lsocket"
+    fi
+  elif test $with_kerberos != no; then
+    echo "error: must be yes or no: --with-kerberos=$with_kerberos"
+    exit 1
+  fi
+
+  # Next, check for the nine billion variants of shadow passwords...
+
+  passwd_cruft_done=no
+  AC_ARG_WITH(shadow,
+[  --with-shadow           Include support for shadow password authentication,
+                          if possible (this is the default, if no Kerberos.)
+  --without-shadow        Do not compile in support for shadow passwords.
+],
+  [with_shadow="$withval"; with_shadow_req="$withval"],[with_shadow=yes])
+  if test $with_shadow = no; then
+    passwd_cruft_done=yes
+  elif test $with_shadow != yes; then
+    echo "error: must be yes or no: --with-shadow=$with_shadow"
+    exit 1
+  fi
+
+
+  # Sun's "adjunct" passwords.
+  #
+  if test $passwd_cruft_done = no ; then
+    AC_CACHE_CHECK([for Sun-style shadow passwords], ac_cv_sun_adjunct,
+                  [AC_TRY_X_COMPILE([#include <stdlib.h>
+                                     #include <unistd.h>
+                                     #include <sys/types.h>
+                                     #include <sys/label.h>
+                                     #include <sys/audit.h>
+                                     #include <pwdadj.h>],
+                       [struct passwd_adjunct *p = getpwanam("nobody");
+                        const char *pw = p->pwa_passwd;],
+                       [ac_cv_sun_adjunct=yes],
+                       [ac_cv_sun_adjunct=no])])
+    if test $ac_cv_sun_adjunct = yes; then
+      have_shadow=yes
+      need_setuid=yes
+      passwd_cruft_done=yes
+      AC_DEFINE(HAVE_ADJUNCT_PASSWD)
+    fi
+  fi
+
+  # DEC and SCO so-called "enhanced" security.
+  #
+  if test $passwd_cruft_done = no ; then
+    AC_CACHE_CHECK([for DEC-style shadow passwords], ac_cv_enhanced_passwd,
+                  [AC_TRY_X_COMPILE([#include <stdlib.h>
+                                     #include <unistd.h>
+                                     #include <sys/types.h>
+                                     #include <pwd.h>
+                                     #include <sys/security.h>
+                                     #include <prot.h>],
+                       [struct pr_passwd *p;
+                        const char *pw;
+                        set_auth_parameters(0, 0);
+                        check_auth_parameters();
+                        p = getprpwnam("nobody");
+                        pw = p->ufld.fd_encrypt;],
+                       [ac_cv_enhanced_passwd=yes],
+                       [ac_cv_enhanced_passwd=no])])
+    if test $ac_cv_enhanced_passwd = yes; then
+      have_shadow=yes
+      need_setuid=yes
+      passwd_cruft_done=yes
+      AC_DEFINE(HAVE_ENHANCED_PASSWD)
+
+      # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
+      # (I'm told it needs -lcurses too, but I don't understand why.)
+      AC_CHECK_LIB(prot, getprpwnam,
+                  [PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"],
+                  [# On DEC, getprpwnam() is in -lsecurity
+                   AC_CHECK_LIB(security, getprpwnam,
+                                [PASSWD_LIBS="$PASSWD_LIBS -lsecurity"])],
+                  [-lx])
+    fi
+  fi
+
+  # HP's entry in the "Not Invented Here" Sweepstakes.
+  #
+  if test $passwd_cruft_done = no ; then
+    AC_CACHE_CHECK([for HP-style shadow passwords], ac_cv_hpux_passwd,
+                  [AC_TRY_X_COMPILE([#include <stdlib.h>
+                                     #include <unistd.h>
+                                     #include <sys/types.h>
+                                     #include <pwd.h>
+                                     #include <hpsecurity.h>
+                                     #include <prot.h>],
+                       [struct s_passwd *p = getspwnam("nobody");
+                        const char *pw = p->pw_passwd;],
+                       [ac_cv_hpux_passwd=yes],
+                       [ac_cv_hpux_passwd=no])])
+    if test $ac_cv_hpux_passwd = yes; then
+      have_shadow=yes
+      need_setuid=yes
+      passwd_cruft_done=yes
+      AC_DEFINE(HAVE_HPUX_PASSWD)
+
+      # on HPUX, bigcrypt is in -lsec
+      AC_CHECK_LIB(sec, bigcrypt, [PASSWD_LIBS="$PASSWD_LIBS -lsec"])
+    fi
+  fi
+
+  # Traditional (ha!) shadow passwords.
+  #
+  if test $passwd_cruft_done = no ; then
+    AC_CACHE_CHECK([for generic shadow passwords], ac_cv_shadow,
+                  [AC_TRY_X_COMPILE([#include <stdlib.h>
+                                     #include <unistd.h>
+                                     #include <sys/types.h>
+                                     #include <pwd.h>
+                                     #include <shadow.h>],
+                       [struct spwd *p = getspnam("nobody");
+                        const char *pw = p->sp_pwdp;],
+                       [ac_cv_shadow=yes],
+                       [ac_cv_shadow=no])])
+    if test $ac_cv_shadow = yes; then
+      have_shadow=yes
+      need_setuid=yes
+      passwd_cruft_done=yes
+      AC_DEFINE(HAVE_SHADOW_PASSWD)
+
+      # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
+      have_getspnam=no
+      AC_CHECK_LIB(c, getspnam, [have_getspnam=yes])
+      if test $have_getspnam = no ; then
+        AC_CHECK_LIB(gen, getspnam,
+                    [have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"])
+      fi
+    fi
+  fi
+
+  # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
+  have_crypt=no
+  AC_CHECK_LIB(c, crypt, [have_crypt=yes])
+  if test $have_crypt = no ; then
+    AC_CHECK_LIB(crypt, crypt,
+                [have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"])
+  fi
+
+
+  # Most of the above shadow mechanisms will have set need_setuid to yes,
+  # if they were found.  But, on some systems, we need setuid even when
+  # using plain old vanilla passwords.
+  #
+  if test $need_setuid = no ; then
+    case "$host" in
+      *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
+        need_setuid=yes
+      ;;
+    esac
+  fi
+
+elif test $enable_locking = no; then
+  AC_DEFINE(NO_LOCKING)
+else
+  echo "error: must be yes or no: --enable-locking=$enable_locking"
+  exit 1
+fi
+
+
+
+if test \! -z "$includedir" ; then
+  INCLUDES="-I$includedir"
+fi
+
+if test \! -z "$libdir" ; then
+  LDFLAGS="$LDFLAGS -L$libdir"
+fi
+
+
+##### should have options to override the DEPEND crap, I guess...
+DEPEND=makedepend
+DEPEND_FLAGS=
+DEPEND_DEFINES=
+
+
+
+# Done testing things -- now substitute in some stuff for the Makefiles.
+#
+if test $have_motif = yes; then
+  AC_DEFINE(HAVE_MOTIF)
+  DIALOG_SRCS='$(MOTIF_SRCS)'
+  DIALOG_OBJS='$(MOTIF_OBJS)'
+elif test $have_athena = yes; then
+  AC_DEFINE(HAVE_ATHENA)
+  DIALOG_SRCS='$(ATHENA_SRCS)'
+  DIALOG_OBJS='$(ATHENA_OBJS)'
+else
+  DIALOG_SRCS=''
+  DIALOG_OBJS=''
+fi
+
+if test $have_kerberos = yes; then
+  PASSWD_SRCS='$(KERBEROS_SRCS)'
+  PASSWD_OBJS='$(KERBEROS_OBJS)'
+else
+  PASSWD_SRCS='$(PWENT_SRCS)'
+  PASSWD_OBJS='$(PWENT_OBJS)'
+fi
+
+if test $enable_locking = yes; then
+  LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
+  LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
+else
+  LOCK_SRCS=''
+  LOCK_OBJS=''
+fi
+
+if test $need_setuid = yes; then
+  NEED_SETUID=yes
+  INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
+else
+  NEED_SETUID=no
+  INSTALL_SETUID='$(INSTALL_PROGRAM)'
+fi
+
+tab='  '
+if test $have_gl = yes; then
+  GL_EXES='$(GL_EXES)'
+  GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'  \'
+  GL_KLUDGE_2=${tab}
+else
+  GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'\n'
+  GL_KLUDGE_2='!'${tab}
+fi
+
+AC_SUBST(INCLUDES)
+
+AC_SUBST(SAVER_LIBS)
+AC_SUBST(HACK_LIBS)
+AC_SUBST(XPM_LIBS)
+AC_SUBST(GL_LIBS)
+AC_SUBST(PASSWD_LIBS)
+AC_SUBST(INSTALL_SETUID)
+AC_SUBST(NEED_SETUID)
+AC_SUBST(SGI_VIDEO_OBJS)
+AC_SUBST(SGI_VIDEO_LIBS)
+
+AC_SUBST(DIALOG_SRCS)
+AC_SUBST(DIALOG_OBJS)
+AC_SUBST(PASSWD_SRCS)
+AC_SUBST(PASSWD_OBJS)
+AC_SUBST(XMU_SRCS)
+AC_SUBST(XMU_OBJS)
+AC_SUBST(LOCK_SRCS)
+AC_SUBST(LOCK_OBJS)
+AC_SUBST(GL_EXES)
+AC_SUBST(GL_KLUDGE_1)
+AC_SUBST(GL_KLUDGE_2)
+AC_SUBST(HACKDIR)
+AC_SUBST(APPDEFAULTS)
+
+AC_SUBST(DEPEND)
+AC_SUBST(DEPEND_FLAGS)
+AC_SUBST(DEPEND_DEFINES)
+
+# Print some warnings before emitting the Makefiles.
+#
+warning=no
+warnsep='    #################################################################'
+warnpre() {
+  if test $warning = no ; then
+    echo '' ; echo "$warnsep" ; echo ''
+    warning=yes
+  fi
+}
+
+warn() {
+  warnpre
+  if test $warning = long ; then echo '' ; fi
+  warning=yes
+  echo "    Warning: $@"
+}
+
+warnL() {
+  was=$warning
+  warnpre
+  warning=yes
+  if test $was != no ; then echo '' ; fi
+  echo "    Warning: $@"
+}
+
+warn2() {
+  echo "             $@"
+  warning=long
+}
+
+if test $with_sgi_req = yes -a $have_sgi = no ; then
+  warn 'The SGI saver extension was requested, but was not found.'
+fi
+
+if test $with_mit_req = yes -a $have_mit = no ; then
+  warn 'The MIT saver extension was requested, but was not found.'
+fi
+
+if test $with_xidle_req = yes -a $have_xidle = no ; then
+  warn 'The XIdle extension was requested, but was not found.'
+fi
+
+if test $with_xshm_req = yes -a $have_xshm = no ; then
+  warn 'The XSHM extension was requested, but was not found.'
+fi
+
+if test $with_sgivc_req = yes -a $have_sgivc = no ; then
+  warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
+fi
+
+if test $have_motif = no -a $have_athena = no ; then
+  warnL "Neither Motif nor Athena widgets seem to be available;"
+  warn2 "one or the other is required."
+  proselytize_motif=no
+
+elif test $with_motif_req = yes -a $have_motif = no ; then
+  warnL "Use of Motif was requested, but it wasn't found;"
+  warn2 "Athena will be used instead."
+
+elif test $with_athena_req = yes -a $have_athena = no ; then
+  warnL "Use of Athena was requested, but it wasn't found;"
+  warn2 "Motif will be used instead."
+fi
+
+if test $have_motif = yes -a $have_lesstif = yes ; then
+  if test $good_lesstif != yes ; then
+    warnL "Motif is being used, but it appears to actually be"
+    warn2 "LessTif, and the version number is less than 0.82!"
+    warn2 "Such old versions of LessTif are too buggy to use"
+    warn2 "with XScreenSaver; it is strongly recommended that"
+    warn2 "you upgrade!  See <http://www.lesstif.org/>."
+  fi
+fi
+
+if test $proselytize_motif = yes ; then
+    warnL "Athena widgets are being used instead of Motif."
+    warn2 "XScreenSaver looks much better with Motif, and has"
+    warn2 "a few extra features as well.  Wouldn't you rather"
+    warn2 "be using Motif?  It is shipped by every commercial"
+    warn2 "Unix vendor; and there is a free implementation"
+    warn2 "available as well: see <http://www.lesstif.org/>."
+fi
+
+if test $with_xpm_req = yes -a $have_xpm = no ; then
+  warn 'Use of XPM was requested, but it was not found.'
+fi
+
+if test $with_gl_req = yes -a $have_gl = no ; then
+  warn 'Use of GL was requested, but it was not found.'
+fi
+
+if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then
+  warn 'Use of XReadDisplay was requested, but it was not found.'
+fi
+
+if test $with_sgivideo_req = yes -a $have_sgivideo = no ; then
+  warn 'Use of the Iris Video Library was requested, but it was not found.'
+fi
+
+if test $with_kerberos_req = yes -a $have_kerberos = no ; then
+  warn 'Use of Kerberos was requested, but it was not found.'
+fi
+
+if test $with_shadow_req = yes -a $have_shadow = no ; then
+  warn 'Use of shadow passwords was requested, but they were not found.'
+fi
+
+if test -n "$with_zippy_req"; then
+  if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
+    warnL "$with_zippy_req was requested as the Zippy program,"
+    warn2 "but was not found.  The default will be used instead."
+  fi
+fi
+
+if test $warning != no; then
+  echo '' ; echo "$warnsep" ; echo ''
+fi
+
+
+AC_OUTPUT(Makefile
+         utils/Makefile
+         driver/Makefile
+         xlockmore/xlock/Makefile
+         xlockmore/modes/Makefile
+         hacks/Makefile
+         hacks/glx/Makefile
+         driver/XScreenSaver.ad)